@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,12 +1,13 @@
1
1
  import { Button as e } from "../../ui/button.js";
2
2
  import { AcceptanceModal as t } from "./AcceptanceModal.js";
3
3
  import { formatContractSaleDocumentLabel as n, resolveContractSaleDocumentLanguage as r } from "./language.js";
4
- import { InvoiceDetails as i } from "./InvoiceDetails.js";
5
- import { Page as a } from "./Page.js";
6
- import { PageFooter as ee } from "./PageFooter.js";
7
- import { PageHeader as o } from "./PageHeader.js";
4
+ import { DocumentAcceptanceSection as i } from "./DocumentAcceptanceSection.js";
5
+ import { InvoiceDetails as a } from "./InvoiceDetails.js";
6
+ import { Page as o } from "./Page.js";
7
+ import { PageFooter as s } from "./PageFooter.js";
8
+ import { PageHeader as ee } from "./PageHeader.js";
8
9
  import { SignatureModal as te } from "./SignatureModal.js";
9
- import { DEFAULT_TERMS_ARTICLES as s, TermsAndConditionsContent as ne } from "./TermsAndConditionsContent.js";
10
+ import { TermsAndConditionsContent as ne } from "./TermsAndConditionsContent.js";
10
11
  import { ThumbnailSidebar as re } from "./ThumbnailSidebar.js";
11
12
  /* empty css */
12
13
  import { useEffect as c, useRef as l, useState as u } from "react";
@@ -16,12 +17,23 @@ import { CheckCircle2 as oe } from "lucide-react";
16
17
  import * as se from "html-to-image";
17
18
  import { toString as ce } from "qrcode";
18
19
  //#region src/components/ContractSaleDocument/Invoice.tsx
19
- var p = 22, m = 10, h = 14, g = 14, _ = 3, v = 6, y = (e, t) => {
20
+ async function le(e) {
21
+ e.complete || await new Promise((t) => {
22
+ let n = () => {
23
+ e.removeEventListener("load", n), e.removeEventListener("error", n), t();
24
+ };
25
+ e.addEventListener("load", n), e.addEventListener("error", n), e.complete && n();
26
+ });
27
+ try {
28
+ await e.decode();
29
+ } catch {}
30
+ }
31
+ var p = 22, m = 10, h = 14, g = 14, ue = 3, _ = 6, v = (e, t) => {
20
32
  if (t <= 0) return [e];
21
33
  let n = [];
22
34
  for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
23
35
  return n;
24
- }, le = (e) => {
36
+ }, de = (e) => {
25
37
  if (e.length <= m) return [{
26
38
  kind: "invoice",
27
39
  key: "invoice-page-1",
@@ -51,8 +63,8 @@ var p = 22, m = 10, h = 14, g = 14, _ = 3, v = 6, y = (e, t) => {
51
63
  }), t;
52
64
  let r = n.length % h;
53
65
  r === 0 && (r = Math.min(g, h));
54
- let i = Math.max(0, n.length - r), a = n.slice(0, i), ee = n.slice(i), o = y(a, h);
55
- return o.forEach((e, n) => {
66
+ let i = Math.max(0, n.length - r), a = n.slice(0, i), o = n.slice(i), s = v(a, h);
67
+ return s.forEach((e, n) => {
56
68
  t.push({
57
69
  kind: "invoice",
58
70
  key: `invoice-page-continuation-${n + 1}`,
@@ -64,31 +76,35 @@ var p = 22, m = 10, h = 14, g = 14, _ = 3, v = 6, y = (e, t) => {
64
76
  });
65
77
  }), t.push({
66
78
  kind: "invoice",
67
- key: `invoice-page-final-${o.length + 1}`,
68
- items: ee,
79
+ key: `invoice-page-final-${s.length + 1}`,
80
+ items: o,
69
81
  showInvoiceMeta: !1,
70
82
  showTotalsSection: !0,
71
83
  showNotesSection: !0,
72
84
  showAcceptanceSection: !0
73
85
  }), t;
74
- }, ue = (e, t, n) => y(e, n ? _ : v).map((e, n) => ({
75
- kind: "terms",
76
- key: `terms-page-${n + 1}`,
77
- title: t,
78
- showTitle: n === 0,
79
- articles: e
80
- })), de = (e) => e.kind === "credit_note" ? [] : !e.terms || e.terms.articles.length === 0 ? s : e.terms.articles, fe = (e) => e.terms?.title ?? "Conditions Generales de Vente";
81
- function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, heightMode: g = "viewport", renderMode: _ = "interactive", publicDocumentUrl: v, onAccept: y }) {
82
- let { t: b, i18n: pe } = ae(), x = v?.trim() ?? "", S = _ === "pdf", [C, w] = u(s), [T, E] = u(!1), [D, O] = u(null), [me, k] = u(0), [A, j] = u([]), [he, M] = u(!0), [ge, N] = u(0), [P, F] = u(""), [_e, I] = u(x.length === 0 && !S), L = l(null), R = l(null), z = l([]);
86
+ }, fe = (e, t) => {
87
+ let n = t && e.articles.some((e) => !!(e.translationTitle || e.translationBody || e.translationBodyHtml)), r = n ? ue : _;
88
+ return v(e.articles, r).map((t, r) => ({
89
+ kind: "appendix",
90
+ key: `${e.id}-page-${r + 1}`,
91
+ title: e.title,
92
+ showTitle: r === 0,
93
+ articles: t,
94
+ withTranslation: n
95
+ }));
96
+ };
97
+ function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, heightMode: ue = "viewport", renderMode: _ = "interactive", publicDocumentUrl: v, onAccept: y }) {
98
+ let { t: b, i18n: pe } = ae(), x = v?.trim() ?? "", S = _ === "pdf", [C, w] = u(m), [T, me] = u(!1), [E, D] = u(null), [he, O] = u(0), [k, A] = u([]), [ge, j] = u(!0), [_e, M] = u(0), [N, P] = u(""), [ve, F] = u(x.length === 0 && !S), [ye, I] = u(!S), L = l(null), R = l(null), z = l(null), B = l([]);
83
99
  c(() => {
84
- w(s);
85
- }, [s]), c(() => {
100
+ w(m);
101
+ }, [m]), c(() => {
86
102
  if (!x) {
87
- F(""), I(!S);
103
+ P(""), F(!S);
88
104
  return;
89
105
  }
90
106
  let e = !1;
91
- return F(""), I(!1), ce(x, {
107
+ return P(""), F(!1), ce(x, {
92
108
  type: "svg",
93
109
  errorCorrectionLevel: "M",
94
110
  margin: 1,
@@ -98,52 +114,78 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
98
114
  light: "#FFFFFF"
99
115
  }
100
116
  }).then((t) => {
101
- e || F(`data:image/svg+xml;utf8,${encodeURIComponent(t)}`);
117
+ e || P(`data:image/svg+xml;utf8,${encodeURIComponent(t)}`);
102
118
  }).catch((t) => {
103
- e || (console.error("Document QR code generation failed:", t), F(""));
119
+ e || (console.error("Document QR code generation failed:", t), P(""));
104
120
  }).finally(() => {
105
- e || I(!0);
121
+ e || F(!0);
106
122
  }), () => {
107
123
  e = !0;
108
124
  };
109
125
  }, [x, S]);
110
- let B = r(C, pe.language), ve = (e, t = {}) => n(b, B, e, t), ye = C.kind === "credit_note" ? -1 : 1, V = C.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * ye, H = C.taxRate == null ? V : V / (1 + C.taxRate), be = C.taxRate == null ? 0 : V - H, U = ve(C.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : C.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), W = fe(C), G = de(C), xe = le(C.items), K = h, Se = m ? ue(G, W, K) : [], q = [...xe, ...Se], J = q.length, Ce = [
126
+ let V = r(C, pe.language), be = (e, t = {}) => n(b, V, e, t), H = C.kind === "credit_note" ? -1 : 1, U = C.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * H, W = C.items.reduce((e, t) => e + t.quantity * t.unitPrice * H / (1 + (t.taxRate ?? C.taxRate ?? 0)), 0), xe = U - W, G = be(C.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : C.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), Se = de(C.items), K = C.kind === "credit_note" || !h ? [] : C.appendices, q = K.flatMap((e) => fe(e, g)), J = [...Se, ...q], Y = J.length, X = [
111
127
  C.id,
112
128
  C.kind,
113
129
  C.saleDocumentNumber,
114
130
  C.items.map((e) => `${e.id}:${e.description}:${e.quantity}:${e.unitPrice}`).join(","),
115
- m ? W : "",
116
- m ? G.map((e) => `${e.id}:${e.title}:${e.body}:${e.translationTitle ?? ""}:${e.translationBody ?? ""}`).join(",") : "",
117
- K ? "translated" : "legal-only",
118
- B.legal,
119
- B.customer,
120
- B.translation ?? "",
121
- q.map((e) => e.key).join(",")
122
- ].join("|"), Y = !S && (C.acceptanceLevel !== "none" || C.acceptance != null), X = C.acceptance;
123
- z.current.length > J && (z.current.length = J), c(() => {
124
- N((e) => J === 0 ? 0 : Math.min(e, J - 1));
125
- }, [J]), c(() => {
131
+ C.rental ? `${C.rental.bookingNumber}:${C.rental.start.toISOString()}:${C.rental.end.toISOString()}:${C.rental.pickupAddress ?? ""}:${C.rental.returnAddress ?? ""}` : "",
132
+ h ? K.map((e) => [
133
+ e.id,
134
+ e.title,
135
+ e.articles.map((e) => `${e.id}:${e.title}:${e.body}:${e.bodyHtml ?? ""}:${e.translationTitle ?? ""}:${e.translationBody ?? ""}:${e.translationBodyHtml ?? ""}`).join(",")
136
+ ].join(":")).join("|") : "",
137
+ g ? "translated" : "legal-only",
138
+ V.legal,
139
+ V.customer,
140
+ V.translation ?? "",
141
+ J.map((e) => e.key).join(",")
142
+ ].join("|"), Z = !S && (C.acceptanceLevel !== "none" || C.acceptance != null), Q = C.acceptance;
143
+ c(() => {
144
+ if (!S) {
145
+ I(!0);
146
+ return;
147
+ }
148
+ let e = z.current;
149
+ if (!e) {
150
+ I(!1);
151
+ return;
152
+ }
153
+ let t = !1;
154
+ I(!1);
155
+ let n = Array.from(e.querySelectorAll("img"));
156
+ return Promise.all(n.map(le)).then(() => {
157
+ t || I(!0);
158
+ }), () => {
159
+ t = !0;
160
+ };
161
+ }, [
162
+ N,
163
+ S,
164
+ X
165
+ ]), B.current.length > Y && (B.current.length = Y), c(() => {
166
+ M((e) => Y === 0 ? 0 : Math.min(e, Y - 1));
167
+ }, [Y]), c(() => {
126
168
  let e = L.current;
127
- E(!1), N(0), e?.scrollTo({
169
+ me(!1), M(0), e?.scrollTo({
128
170
  top: 0,
129
171
  left: 0,
130
172
  behavior: "auto"
131
173
  });
132
174
  let t = () => {
133
- e && e.scrollHeight - e.scrollTop <= e.clientHeight + 5 && E(!0);
175
+ e && e.scrollHeight - e.scrollTop <= e.clientHeight + 5 && me(!0);
134
176
  };
135
177
  return e?.addEventListener("scroll", t), t(), () => {
136
178
  e?.removeEventListener("scroll", t);
137
179
  };
138
- }, [Ce]), c(() => {
180
+ }, [X]), c(() => {
139
181
  let e = !1;
140
182
  return (async () => {
141
183
  if (S) {
142
- j([]), M(!1);
184
+ A([]), j(!1);
143
185
  return;
144
186
  }
145
- M(!0), await new Promise((e) => setTimeout(e, 0));
146
- let t = [], n = z.current.slice(0, J);
187
+ j(!0), await new Promise((e) => setTimeout(e, 0));
188
+ let t = [], n = B.current.slice(0, Y);
147
189
  for (let e of n) if (e) try {
148
190
  let n = await se.toPng(e, {
149
191
  quality: .7,
@@ -158,26 +200,26 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
158
200
  } catch (e) {
159
201
  console.error("Thumbnail generation failed:", e);
160
202
  }
161
- e || (j(t), M(!1));
203
+ e || (A(t), j(!1));
162
204
  })(), () => {
163
205
  e = !0;
164
206
  };
165
207
  }, [
166
208
  C,
167
- m,
168
- K,
169
- J,
209
+ h,
210
+ g,
211
+ Y,
170
212
  S,
171
- P
213
+ N
172
214
  ]), c(() => {
173
- if (S || A.length === 0) return;
174
- let e = z.current.slice(0, J).filter((e) => e != null);
215
+ if (S || k.length === 0) return;
216
+ let e = B.current.slice(0, Y).filter((e) => e != null);
175
217
  if (e.length === 0) return;
176
218
  let t = new IntersectionObserver((t) => {
177
219
  for (let n of t) {
178
220
  if (!n.isIntersecting) continue;
179
221
  let t = e.findIndex((e) => e === n.target);
180
- t !== -1 && N(t);
222
+ t !== -1 && M(t);
181
223
  }
182
224
  }, {
183
225
  root: L.current,
@@ -191,37 +233,37 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
191
233
  });
192
234
  };
193
235
  }, [
194
- A,
195
- J,
236
+ k,
237
+ Y,
196
238
  S
197
239
  ]), c(() => {
198
240
  let e = R.current;
199
- if (!Y || !e) {
200
- k(0);
241
+ if (!Z || !e) {
242
+ O(0);
201
243
  return;
202
244
  }
203
245
  let t = () => {
204
- k(Math.ceil(e.getBoundingClientRect().height));
246
+ O(Math.ceil(e.getBoundingClientRect().height));
205
247
  };
206
248
  if (t(), typeof ResizeObserver > "u") return;
207
249
  let n = new ResizeObserver(t);
208
250
  return n.observe(e), () => {
209
251
  n.disconnect();
210
252
  };
211
- }, [C.acceptance, Y]);
212
- let Z = (e) => {
253
+ }, [C.acceptance, Z]);
254
+ let Ce = (e) => {
213
255
  let t = e instanceof Date ? e : new Date(e);
214
256
  return Number.isNaN(t.getTime()) ? null : t;
215
257
  }, we = (e) => {
216
- let t = Z(e);
217
- return t ? new Intl.DateTimeFormat(B.legal, {
258
+ let t = Ce(e);
259
+ return t ? new Intl.DateTimeFormat(V.legal, {
218
260
  day: "2-digit",
219
261
  month: "2-digit",
220
262
  year: "numeric"
221
263
  }).format(t) : "-";
222
264
  }, Te = (e) => {
223
- let t = Z(e);
224
- return t ? new Intl.DateTimeFormat(B.legal, {
265
+ let t = Ce(e);
266
+ return t ? new Intl.DateTimeFormat(V.legal, {
225
267
  day: "2-digit",
226
268
  month: "2-digit",
227
269
  year: "numeric",
@@ -246,85 +288,90 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
246
288
  }, Oe = async (e) => {
247
289
  await Ee(e);
248
290
  }, ke = (e) => {
249
- N(e), z.current[e]?.scrollIntoView({
291
+ M(e), B.current[e]?.scrollIntoView({
250
292
  behavior: "smooth",
251
293
  block: "start"
252
294
  });
253
- }, Ae = Y ? me + p : p, Q = g === "parent", je = C.acceptanceLevel === "signature" ? b(T ? "docs_contract_sale_action_signature_ready" : "docs_contract_sale_action_signature_locked") : b(T ? "docs_contract_sale_action_acceptance_ready" : "docs_contract_sale_action_acceptance_locked"), Me = X?.mode === "signature" ? b("docs_contract_sale_already_signed", { date: Te(X.date) }) : X?.mode === "acceptance" ? b("docs_contract_sale_already_accepted", { date: Te(X.date) }) : null, $ = (e, t) => /* @__PURE__ */ f(a, {
295
+ }, Ae = Z ? he + p : p, $ = ue === "parent", je = C.acceptanceLevel === "signature" ? b(T ? "docs_contract_sale_action_signature_ready" : "docs_contract_sale_action_signature_locked") : b(T ? "docs_contract_sale_action_acceptance_ready" : "docs_contract_sale_action_acceptance_locked"), Me = Q?.mode === "signature" ? b("docs_contract_sale_already_signed", { date: Te(Q.date) }) : Q?.mode === "acceptance" ? b("docs_contract_sale_already_accepted", { date: Te(Q.date) }) : null, Ne = (e, t) => /* @__PURE__ */ f(o, {
254
296
  ref: (e) => {
255
- z.current[t] = e;
297
+ B.current[t] = e;
256
298
  },
257
- className: S || t === J - 1 ? "!mb-0" : void 0,
299
+ className: S || t === Y - 1 ? "!mb-0" : void 0,
258
300
  children: [
259
- /* @__PURE__ */ d(o, {
260
- documentTitle: U,
301
+ /* @__PURE__ */ d(ee, {
302
+ documentTitle: G,
261
303
  saleDocumentNumber: C.saleDocumentNumber,
262
304
  currentPage: t + 1,
263
- totalPages: J,
264
- documentLanguage: B
305
+ totalPages: Y,
306
+ documentLanguage: V
265
307
  }),
266
- e.kind === "invoice" ? /* @__PURE__ */ d(i, {
308
+ e.kind === "invoice" ? /* @__PURE__ */ d(a, {
267
309
  saleDocument: C,
268
310
  items: e.items,
269
- subtotal: H,
270
- tax: be,
271
- total: V,
311
+ subtotal: W,
312
+ tax: xe,
313
+ total: U,
272
314
  formatDate: we,
273
315
  showInvoiceMeta: e.showInvoiceMeta,
274
316
  showTotalsSection: e.showTotalsSection,
275
317
  showNotesSection: e.showNotesSection,
276
- showAcceptanceSection: e.showAcceptanceSection,
277
- documentQrCodeUrl: e.showInvoiceMeta ? P : void 0,
278
- documentLanguage: B
279
- }) : /* @__PURE__ */ d("main", {
280
- className: "flex-grow px-4 text-left md:px-8",
281
- children: /* @__PURE__ */ d(ne, {
318
+ showAcceptanceSection: e.showAcceptanceSection && q.length === 0,
319
+ documentQrCodeUrl: e.showInvoiceMeta ? N : void 0,
320
+ documentLanguage: V
321
+ }) : /* @__PURE__ */ f("main", {
322
+ className: "flex flex-grow flex-col px-4 text-left md:px-8",
323
+ children: [/* @__PURE__ */ d(ne, {
282
324
  title: e.title,
283
325
  articles: e.articles,
284
- withEnglishTranslation: K,
326
+ withEnglishTranslation: e.withTranslation,
285
327
  showTitle: e.showTitle
286
- })
328
+ }), t === Y - 1 ? /* @__PURE__ */ d(i, {
329
+ saleDocument: C,
330
+ documentLanguage: V,
331
+ formatDate: we
332
+ }) : null]
287
333
  }),
288
- /* @__PURE__ */ d(ee, {
289
- documentTitle: U,
334
+ /* @__PURE__ */ d(s, {
335
+ documentTitle: G,
290
336
  saleDocumentNumber: C.saleDocumentNumber,
291
337
  currentPage: t + 1,
292
- totalPages: J,
293
- documentLanguage: B
338
+ totalPages: Y,
339
+ documentLanguage: V
294
340
  })
295
341
  ]
296
342
  }, e.key);
297
343
  return S ? /* @__PURE__ */ d("div", {
298
- "data-testid": _e ? "contract-sale-document-pdf-ready" : void 0,
344
+ ref: z,
345
+ "data-testid": ve && ye ? "contract-sale-document-pdf-ready" : void 0,
299
346
  className: "contract-sale-document contract-sale-document-pdf bg-white text-foreground",
300
- children: q.map($)
347
+ children: J.map(Ne)
301
348
  }) : /* @__PURE__ */ d(ie, { children: /* @__PURE__ */ f("div", {
302
- className: `contract-sale-document ${Q ? "h-full" : "h-dvh"} min-h-0 md:flex`,
349
+ className: `contract-sale-document ${$ ? "h-full" : "h-dvh"} min-h-0 md:flex`,
303
350
  children: [/* @__PURE__ */ d(re, {
304
- thumbnails: A,
305
- activePage: ge,
351
+ thumbnails: k,
352
+ activePage: _e,
306
353
  onThumbnailClick: ke,
307
- totalPages: J,
308
- heightClassName: Q ? "h-full" : "h-dvh",
309
- contentClassName: Q ? "pt-16" : void 0,
310
- isLoading: he
354
+ totalPages: Y,
355
+ heightClassName: $ ? "h-full" : "h-dvh",
356
+ contentClassName: $ ? "pt-16" : void 0,
357
+ isLoading: ge
311
358
  }), /* @__PURE__ */ f("div", {
312
359
  ref: L,
313
360
  "data-testid": "contract-sale-document-scroll-container",
314
- className: `${Q ? "h-full" : "h-dvh"} min-h-0 flex-1 overflow-y-auto overscroll-y-contain bg-transparent`,
361
+ className: `${$ ? "h-full" : "h-dvh"} min-h-0 flex-1 overflow-y-auto overscroll-y-contain bg-transparent`,
315
362
  style: {
316
- paddingTop: Q ? "3.5rem" : void 0,
317
- scrollPaddingTop: Q ? "3.5rem" : void 0,
363
+ paddingTop: $ ? "3.5rem" : void 0,
364
+ scrollPaddingTop: $ ? "3.5rem" : void 0,
318
365
  paddingBottom: `${Ae}px`
319
366
  },
320
367
  children: [
321
- q.map($),
368
+ J.map(Ne),
322
369
  /* @__PURE__ */ d("p", {
323
370
  className: "px-4 text-center text-xs text-muted-foreground/75 md:px-8",
324
371
  style: { paddingTop: `${p}px` },
325
372
  children: b("docs_contract_sale_end")
326
373
  }),
327
- Y ? /* @__PURE__ */ d("div", {
374
+ Z ? /* @__PURE__ */ d("div", {
328
375
  ref: R,
329
376
  className: "fixed bottom-0 left-0 right-0 z-30 flex items-center justify-center border-t border-border bg-background/70 p-4 backdrop-blur-xl backdrop-saturate-125 supports-[backdrop-filter]:bg-background/55",
330
377
  children: Me ? /* @__PURE__ */ f("div", {
@@ -337,7 +384,7 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
337
384
  children: Me
338
385
  })]
339
386
  }) : /* @__PURE__ */ d(e, {
340
- onClick: () => O(C.acceptanceLevel === "signature" ? "signature" : "acceptance"),
387
+ onClick: () => D(C.acceptanceLevel === "signature" ? "signature" : "acceptance"),
341
388
  disabled: !T,
342
389
  className: "px-6 py-3 text-sm font-semibold",
343
390
  "data-testid": "contract-sale-document-action-button",
@@ -345,17 +392,17 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
345
392
  })
346
393
  }) : null,
347
394
  /* @__PURE__ */ d(t, {
348
- isOpen: D === "acceptance",
349
- onClose: () => O(null),
395
+ isOpen: E === "acceptance",
396
+ onClose: () => D(null),
350
397
  onAccept: async () => {
351
- await De(), O(null);
398
+ await De(), D(null);
352
399
  }
353
400
  }),
354
401
  /* @__PURE__ */ d(te, {
355
- isOpen: D === "signature",
356
- onClose: () => O(null),
402
+ isOpen: E === "signature",
403
+ onClose: () => D(null),
357
404
  onSave: async (e) => {
358
- await Oe(e), O(null);
405
+ await Oe(e), D(null);
359
406
  }
360
407
  })
361
408
  ]
@@ -363,4 +410,4 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
363
410
  }) });
364
411
  }
365
412
  //#endregion
366
- export { b as ContractSaleDocument };
413
+ export { y as ContractSaleDocument };
@@ -1 +1 @@
1
- {"version":3,"file":"InvoiceDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/InvoiceDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,oBAAoB,CAAA;IAClC,KAAK,EAAE,4BAA4B,EAAE,CAAA;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAoBD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,eAAsB,EACtB,iBAAwB,EACxB,gBAAuB,EACvB,qBAA4B,EAC5B,iBAAiB,GAClB,EAAE,mBAAmB,2CA2OrB"}
1
+ {"version":3,"file":"InvoiceDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/InvoiceDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAKvC,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,oBAAoB,CAAA;IAClC,KAAK,EAAE,4BAA4B,EAAE,CAAA;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AA0CD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,eAAsB,EACtB,iBAAwB,EACxB,gBAAuB,EACvB,qBAA4B,EAC5B,iBAAiB,GAClB,EAAE,mBAAmB,2CAyOrB"}