@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.
- package/dist/StorefrontProvider.d.ts +9 -0
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/chunks/pkg/booking-engine/dist/models/{Product.shared-IYOeC3N7.js → Product.shared-cjcvMCMa.js} +4 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-zsUj5_3O.js → base-asset-CsOe0vXi.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-TzCge_mR.js → base-booking-Sjsqh31e.js} +28 -23
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-DvFFzAcg.js → base-product-C_ATjuc6.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-B0HpcFe5.js → cart-inputs-D1_Wmkca.js} +11 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/insurance-B01h642r.js +67 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas-D_yUBLa0.js +14 -0
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts +10 -0
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +104 -0
- package/dist/components/ContractSaleDocument/Invoice.d.ts +2 -2
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +157 -110
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +132 -155
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts +0 -2
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.js +32 -37
- package/dist/i18n/en.d.ts +15 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +15 -0
- package/dist/i18n/fr.d.ts +15 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +15 -0
- package/dist/index.d.ts +314 -12
- package/dist/index.js +66 -65
- package/dist/lib/booking.js +2 -2
- package/dist/lib/checkoutSubmit.d.ts +8 -2
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +13 -4
- package/dist/lib/checkoutVerifyCoupon.d.ts +3 -0
- package/dist/lib/checkoutVerifyCoupon.d.ts.map +1 -1
- package/dist/lib/checkoutVerifyCoupon.js +4 -1
- package/dist/lib/contractSaleDocument.d.ts +48 -3
- package/dist/lib/contractSaleDocument.d.ts.map +1 -1
- package/dist/lib/contractSaleDocument.js +36 -18
- package/dist/lib/contractSaleDocumentApi.d.ts +60 -6
- package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
- package/dist/lib/contractSaleDocumentApi.js +41 -37
- package/dist/lib/storefrontProducts.d.ts +3 -0
- package/dist/lib/storefrontProducts.d.ts.map +1 -1
- package/dist/lib/storefrontProducts.js +2 -1
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +264 -237
- package/dist/pages/ContractSaleDocumentPage.d.ts +23 -9
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutDetailsCard.js +17 -3
- package/dist/pages/checkout/components/CheckoutInsuranceCard.d.ts +12 -0
- package/dist/pages/checkout/components/CheckoutInsuranceCard.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutInsuranceCard.js +53 -0
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts +2 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +47 -30
- package/dist/pages/checkout/types.d.ts +2 -1
- package/dist/pages/checkout/types.d.ts.map +1 -1
- package/dist/pages/checkout/types.js +2 -1
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +6 -0
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +5 -2
- package/package.json +1 -1
- 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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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 {
|
|
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
|
-
|
|
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
|
-
},
|
|
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),
|
|
55
|
-
return
|
|
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-${
|
|
68
|
-
items:
|
|
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
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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(
|
|
85
|
-
}, [
|
|
100
|
+
w(m);
|
|
101
|
+
}, [m]), c(() => {
|
|
86
102
|
if (!x) {
|
|
87
|
-
|
|
103
|
+
P(""), F(!S);
|
|
88
104
|
return;
|
|
89
105
|
}
|
|
90
106
|
let e = !1;
|
|
91
|
-
return
|
|
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 ||
|
|
117
|
+
e || P(`data:image/svg+xml;utf8,${encodeURIComponent(t)}`);
|
|
102
118
|
}).catch((t) => {
|
|
103
|
-
e || (console.error("Document QR code generation failed:", t),
|
|
119
|
+
e || (console.error("Document QR code generation failed:", t), P(""));
|
|
104
120
|
}).finally(() => {
|
|
105
|
-
e ||
|
|
121
|
+
e || F(!0);
|
|
106
122
|
}), () => {
|
|
107
123
|
e = !0;
|
|
108
124
|
};
|
|
109
125
|
}, [x, S]);
|
|
110
|
-
let
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
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 &&
|
|
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
|
-
}, [
|
|
180
|
+
}, [X]), c(() => {
|
|
139
181
|
let e = !1;
|
|
140
182
|
return (async () => {
|
|
141
183
|
if (S) {
|
|
142
|
-
|
|
184
|
+
A([]), j(!1);
|
|
143
185
|
return;
|
|
144
186
|
}
|
|
145
|
-
|
|
146
|
-
let t = [], n =
|
|
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 || (
|
|
203
|
+
e || (A(t), j(!1));
|
|
162
204
|
})(), () => {
|
|
163
205
|
e = !0;
|
|
164
206
|
};
|
|
165
207
|
}, [
|
|
166
208
|
C,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
209
|
+
h,
|
|
210
|
+
g,
|
|
211
|
+
Y,
|
|
170
212
|
S,
|
|
171
|
-
|
|
213
|
+
N
|
|
172
214
|
]), c(() => {
|
|
173
|
-
if (S ||
|
|
174
|
-
let e =
|
|
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 &&
|
|
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
|
-
|
|
195
|
-
|
|
236
|
+
k,
|
|
237
|
+
Y,
|
|
196
238
|
S
|
|
197
239
|
]), c(() => {
|
|
198
240
|
let e = R.current;
|
|
199
|
-
if (!
|
|
200
|
-
|
|
241
|
+
if (!Z || !e) {
|
|
242
|
+
O(0);
|
|
201
243
|
return;
|
|
202
244
|
}
|
|
203
245
|
let t = () => {
|
|
204
|
-
|
|
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,
|
|
212
|
-
let
|
|
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 =
|
|
217
|
-
return t ? new Intl.DateTimeFormat(
|
|
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 =
|
|
224
|
-
return t ? new Intl.DateTimeFormat(
|
|
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
|
-
|
|
291
|
+
M(e), B.current[e]?.scrollIntoView({
|
|
250
292
|
behavior: "smooth",
|
|
251
293
|
block: "start"
|
|
252
294
|
});
|
|
253
|
-
}, Ae =
|
|
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
|
-
|
|
297
|
+
B.current[t] = e;
|
|
256
298
|
},
|
|
257
|
-
className: S || t ===
|
|
299
|
+
className: S || t === Y - 1 ? "!mb-0" : void 0,
|
|
258
300
|
children: [
|
|
259
|
-
/* @__PURE__ */ d(
|
|
260
|
-
documentTitle:
|
|
301
|
+
/* @__PURE__ */ d(ee, {
|
|
302
|
+
documentTitle: G,
|
|
261
303
|
saleDocumentNumber: C.saleDocumentNumber,
|
|
262
304
|
currentPage: t + 1,
|
|
263
|
-
totalPages:
|
|
264
|
-
documentLanguage:
|
|
305
|
+
totalPages: Y,
|
|
306
|
+
documentLanguage: V
|
|
265
307
|
}),
|
|
266
|
-
e.kind === "invoice" ? /* @__PURE__ */ d(
|
|
308
|
+
e.kind === "invoice" ? /* @__PURE__ */ d(a, {
|
|
267
309
|
saleDocument: C,
|
|
268
310
|
items: e.items,
|
|
269
|
-
subtotal:
|
|
270
|
-
tax:
|
|
271
|
-
total:
|
|
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 ?
|
|
278
|
-
documentLanguage:
|
|
279
|
-
}) : /* @__PURE__ */
|
|
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:
|
|
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(
|
|
289
|
-
documentTitle:
|
|
334
|
+
/* @__PURE__ */ d(s, {
|
|
335
|
+
documentTitle: G,
|
|
290
336
|
saleDocumentNumber: C.saleDocumentNumber,
|
|
291
337
|
currentPage: t + 1,
|
|
292
|
-
totalPages:
|
|
293
|
-
documentLanguage:
|
|
338
|
+
totalPages: Y,
|
|
339
|
+
documentLanguage: V
|
|
294
340
|
})
|
|
295
341
|
]
|
|
296
342
|
}, e.key);
|
|
297
343
|
return S ? /* @__PURE__ */ d("div", {
|
|
298
|
-
|
|
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:
|
|
347
|
+
children: J.map(Ne)
|
|
301
348
|
}) : /* @__PURE__ */ d(ie, { children: /* @__PURE__ */ f("div", {
|
|
302
|
-
className: `contract-sale-document ${
|
|
349
|
+
className: `contract-sale-document ${$ ? "h-full" : "h-dvh"} min-h-0 md:flex`,
|
|
303
350
|
children: [/* @__PURE__ */ d(re, {
|
|
304
|
-
thumbnails:
|
|
305
|
-
activePage:
|
|
351
|
+
thumbnails: k,
|
|
352
|
+
activePage: _e,
|
|
306
353
|
onThumbnailClick: ke,
|
|
307
|
-
totalPages:
|
|
308
|
-
heightClassName:
|
|
309
|
-
contentClassName:
|
|
310
|
-
isLoading:
|
|
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: `${
|
|
361
|
+
className: `${$ ? "h-full" : "h-dvh"} min-h-0 flex-1 overflow-y-auto overscroll-y-contain bg-transparent`,
|
|
315
362
|
style: {
|
|
316
|
-
paddingTop:
|
|
317
|
-
scrollPaddingTop:
|
|
363
|
+
paddingTop: $ ? "3.5rem" : void 0,
|
|
364
|
+
scrollPaddingTop: $ ? "3.5rem" : void 0,
|
|
318
365
|
paddingBottom: `${Ae}px`
|
|
319
366
|
},
|
|
320
367
|
children: [
|
|
321
|
-
|
|
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
|
-
|
|
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: () =>
|
|
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:
|
|
349
|
-
onClose: () =>
|
|
395
|
+
isOpen: E === "acceptance",
|
|
396
|
+
onClose: () => D(null),
|
|
350
397
|
onAccept: async () => {
|
|
351
|
-
await De(),
|
|
398
|
+
await De(), D(null);
|
|
352
399
|
}
|
|
353
400
|
}),
|
|
354
401
|
/* @__PURE__ */ d(te, {
|
|
355
|
-
isOpen:
|
|
356
|
-
onClose: () =>
|
|
402
|
+
isOpen: E === "signature",
|
|
403
|
+
onClose: () => D(null),
|
|
357
404
|
onSave: async (e) => {
|
|
358
|
-
await Oe(e),
|
|
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 {
|
|
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;
|
|
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"}
|