@loczer/storefront-sdk 0.198.0 → 0.199.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/StorefrontContext.d.ts +483 -0
- package/dist/StorefrontContext.d.ts.map +1 -0
- package/dist/StorefrontContext.js +39 -0
- package/dist/StorefrontProvider.d.ts +6 -486
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +34 -67
- package/dist/components/AboutSection/index.js +5 -5
- package/dist/components/BikeProductCard/index.d.ts.map +1 -1
- package/dist/components/BikeProductCard/index.js +27 -27
- package/dist/components/BookingBikeVariantDialog/index.js +14 -8
- package/dist/components/ContactSection/index.js +107 -107
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +117 -111
- package/dist/components/Header/index.js +4 -4
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +47 -40
- package/dist/components/ProductPriceBadge/index.d.ts +2 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +72 -70
- package/dist/components/TestimonialsSection/index.js +1 -1
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +1 -0
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +1 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.js +59 -58
- package/dist/lib/cartSummary.js +7 -7
- package/dist/lib/products.d.ts +6 -0
- package/dist/lib/products.d.ts.map +1 -1
- package/dist/lib/products.js +36 -32
- package/dist/lib/toast.d.ts +9 -0
- package/dist/lib/toast.d.ts.map +1 -0
- package/dist/lib/toast.js +13 -0
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +143 -138
- package/dist/pages/CheckoutPage.js +217 -217
- package/dist/pages/CheckoutPaymentPage.js +124 -124
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +83 -83
- package/dist/pages/HomePage.js +6 -3
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +177 -165
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAKrC,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAKrC,MAAM,gCAAgC,CAAA;AAWvC,OAAO,eAAe,CAAA;AAOtB,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAClC,UAAU,CAAC,EAAE,aAAa,GAAG,KAAK,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,CACT,UAAU,EAAE,oCAAoC,KAC7C,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,GAAG,wBAAwB,GAAG,IAAI,CAAA;CAChF,CAAA;AAsKD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EAAE,WAAW,EACjB,cAAqB,EACrB,sBAA6B,EAC7B,UAAuB,EACvB,UAA0B,EAC1B,iBAAiB,EACjB,QAAQ,GACT,EAAE,yBAAyB,2CAmiB3B;AAED,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -6,18 +6,18 @@ import { InvoiceDetails as a } from "./InvoiceDetails.js";
|
|
|
6
6
|
import { Page as o } from "./Page.js";
|
|
7
7
|
import { PageFooter as s } from "./PageFooter.js";
|
|
8
8
|
import { PageHeader as ee } from "./PageHeader.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { ThumbnailSidebar as re } from "./ThumbnailSidebar.js";
|
|
9
|
+
import { TermsAndConditionsContent as te } from "./TermsAndConditionsContent.js";
|
|
10
|
+
import { ThumbnailSidebar as ne } from "./ThumbnailSidebar.js";
|
|
12
11
|
/* empty css */
|
|
13
|
-
import {
|
|
14
|
-
import { Fragment as ie, jsx as
|
|
12
|
+
import { Suspense as re, lazy as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
13
|
+
import { Fragment as ie, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
15
14
|
import { useTranslation as ae } from "react-i18next";
|
|
16
15
|
import { CheckCircle2 as oe } from "lucide-react";
|
|
17
16
|
import * as se from "html-to-image";
|
|
18
17
|
import { toString as ce } from "qrcode";
|
|
19
18
|
//#region src/components/ContractSaleDocument/Invoice.tsx
|
|
20
|
-
async
|
|
19
|
+
var le = c(async () => ({ default: (await import("./SignatureModal.js")).SignatureModal }));
|
|
20
|
+
async function ue(e) {
|
|
21
21
|
e.complete || await new Promise((t) => {
|
|
22
22
|
let n = () => {
|
|
23
23
|
e.removeEventListener("load", n), e.removeEventListener("error", n), t();
|
|
@@ -28,13 +28,13 @@ async function le(e) {
|
|
|
28
28
|
await e.decode();
|
|
29
29
|
} catch {}
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var m = 22, h = 10, g = 14, _ = 14, de = 3, fe = 6, v = (e, t) => {
|
|
32
32
|
if (t <= 0) return [e];
|
|
33
33
|
let n = [];
|
|
34
34
|
for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
|
|
35
35
|
return n;
|
|
36
|
-
},
|
|
37
|
-
if (e.length <=
|
|
36
|
+
}, pe = (e) => {
|
|
37
|
+
if (e.length <= h) return [{
|
|
38
38
|
kind: "invoice",
|
|
39
39
|
key: "invoice-page-1",
|
|
40
40
|
items: e,
|
|
@@ -46,13 +46,13 @@ var p = 22, m = 10, h = 14, g = 14, ue = 3, _ = 6, v = (e, t) => {
|
|
|
46
46
|
let t = [{
|
|
47
47
|
kind: "invoice",
|
|
48
48
|
key: "invoice-page-1",
|
|
49
|
-
items: e.slice(0,
|
|
49
|
+
items: e.slice(0, h),
|
|
50
50
|
showInvoiceMeta: !0,
|
|
51
51
|
showTotalsSection: !1,
|
|
52
52
|
showNotesSection: !1,
|
|
53
53
|
showAcceptanceSection: !1
|
|
54
|
-
}], n = e.slice(
|
|
55
|
-
if (n.length <=
|
|
54
|
+
}], n = e.slice(h);
|
|
55
|
+
if (n.length <= _) return t.push({
|
|
56
56
|
kind: "invoice",
|
|
57
57
|
key: "invoice-page-final-1",
|
|
58
58
|
items: n,
|
|
@@ -61,9 +61,9 @@ var p = 22, m = 10, h = 14, g = 14, ue = 3, _ = 6, v = (e, t) => {
|
|
|
61
61
|
showNotesSection: !0,
|
|
62
62
|
showAcceptanceSection: !0
|
|
63
63
|
}), t;
|
|
64
|
-
let r = n.length %
|
|
65
|
-
r === 0 && (r = Math.min(
|
|
66
|
-
let i = Math.max(0, n.length - r), a = n.slice(0, i), o = n.slice(i), s = v(a,
|
|
64
|
+
let r = n.length % g;
|
|
65
|
+
r === 0 && (r = Math.min(_, g));
|
|
66
|
+
let i = Math.max(0, n.length - r), a = n.slice(0, i), o = n.slice(i), s = v(a, g);
|
|
67
67
|
return s.forEach((e, n) => {
|
|
68
68
|
t.push({
|
|
69
69
|
kind: "invoice",
|
|
@@ -83,8 +83,8 @@ var p = 22, m = 10, h = 14, g = 14, ue = 3, _ = 6, v = (e, t) => {
|
|
|
83
83
|
showNotesSection: !0,
|
|
84
84
|
showAcceptanceSection: !0
|
|
85
85
|
}), t;
|
|
86
|
-
},
|
|
87
|
-
let n = t && e.articles.some((e) => !!(e.translationTitle || e.translationBody || e.translationBodyHtml)), r = n ?
|
|
86
|
+
}, me = (e, t) => {
|
|
87
|
+
let n = t && e.articles.some((e) => !!(e.translationTitle || e.translationBody || e.translationBodyHtml)), r = n ? de : fe;
|
|
88
88
|
return v(e.articles, r).map((t, r) => ({
|
|
89
89
|
kind: "appendix",
|
|
90
90
|
key: `${e.id}-page-${r + 1}`,
|
|
@@ -94,17 +94,17 @@ var p = 22, m = 10, h = 14, g = 14, ue = 3, _ = 6, v = (e, t) => {
|
|
|
94
94
|
withTranslation: n
|
|
95
95
|
}));
|
|
96
96
|
};
|
|
97
|
-
function y({ data:
|
|
98
|
-
let { t:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}, [
|
|
102
|
-
if (!
|
|
103
|
-
P(""), F(!
|
|
97
|
+
function y({ data: c, showAppendices: h = !0, withEnglishTranslation: g = !0, heightMode: _ = "viewport", renderMode: de = "interactive", publicDocumentUrl: fe, onAccept: v }) {
|
|
98
|
+
let { t: y, i18n: he } = ae(), b = fe?.trim() ?? "", x = de === "pdf", [S, C] = d(c), [w, T] = d(!1), [E, D] = d(null), [ge, _e] = d(!1), [ve, O] = d(0), [k, A] = d([]), [ye, j] = d(!0), [be, M] = d(0), [N, P] = d(""), [xe, F] = d(b.length === 0 && !x), [Se, I] = d(!x), L = u(null), R = u(null), z = u(null), B = u([]);
|
|
99
|
+
l(() => {
|
|
100
|
+
C(c);
|
|
101
|
+
}, [c]), l(() => {
|
|
102
|
+
if (!b) {
|
|
103
|
+
P(""), F(!x);
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
let e = !1;
|
|
107
|
-
return P(""), F(!1), ce(
|
|
107
|
+
return P(""), F(!1), ce(b, {
|
|
108
108
|
type: "svg",
|
|
109
109
|
errorCorrectionLevel: "M",
|
|
110
110
|
margin: 1,
|
|
@@ -122,13 +122,13 @@ function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
122
122
|
}), () => {
|
|
123
123
|
e = !0;
|
|
124
124
|
};
|
|
125
|
-
}, [
|
|
126
|
-
let V = r(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
}, [b, x]);
|
|
126
|
+
let V = r(S, he.language), Ce = (e, t = {}) => n(y, V, e, t), H = S.kind === "credit_note" ? -1 : 1, U = S.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * H, W = S.items.reduce((e, t) => e + t.quantity * t.unitPrice * H / (1 + (t.taxRate ?? S.taxRate ?? 0)), 0), we = U - W, G = Ce(S.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : S.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), Te = pe(S.items), K = S.kind === "credit_note" || !h ? [] : S.appendices, q = K.flatMap((e) => me(e, g)), J = [...Te, ...q], Y = J.length, X = [
|
|
127
|
+
S.id,
|
|
128
|
+
S.kind,
|
|
129
|
+
S.saleDocumentNumber,
|
|
130
|
+
S.items.map((e) => `${e.id}:${e.description}:${e.quantity}:${e.unitPrice}`).join(","),
|
|
131
|
+
S.rental ? `${S.rental.bookingNumber}:${S.rental.start.toISOString()}:${S.rental.end.toISOString()}:${S.rental.pickupAddress ?? ""}:${S.rental.returnAddress ?? ""}` : "",
|
|
132
132
|
h ? K.map((e) => [
|
|
133
133
|
e.id,
|
|
134
134
|
e.title,
|
|
@@ -139,9 +139,9 @@ function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
139
139
|
V.customer,
|
|
140
140
|
V.translation ?? "",
|
|
141
141
|
J.map((e) => e.key).join(",")
|
|
142
|
-
].join("|"), Z = !
|
|
143
|
-
|
|
144
|
-
if (!
|
|
142
|
+
].join("|"), Z = !x && (S.acceptanceLevel !== "none" || S.acceptance != null), Q = S.acceptance;
|
|
143
|
+
l(() => {
|
|
144
|
+
if (!x) {
|
|
145
145
|
I(!0);
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
@@ -153,34 +153,34 @@ function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
153
153
|
let t = !1;
|
|
154
154
|
I(!1);
|
|
155
155
|
let n = Array.from(e.querySelectorAll("img"));
|
|
156
|
-
return Promise.all(n.map(
|
|
156
|
+
return Promise.all(n.map(ue)).then(() => {
|
|
157
157
|
t || I(!0);
|
|
158
158
|
}), () => {
|
|
159
159
|
t = !0;
|
|
160
160
|
};
|
|
161
161
|
}, [
|
|
162
162
|
N,
|
|
163
|
-
|
|
163
|
+
x,
|
|
164
164
|
X
|
|
165
|
-
]), B.current.length > Y && (B.current.length = Y),
|
|
165
|
+
]), B.current.length > Y && (B.current.length = Y), l(() => {
|
|
166
166
|
M((e) => Y === 0 ? 0 : Math.min(e, Y - 1));
|
|
167
|
-
}, [Y]),
|
|
167
|
+
}, [Y]), l(() => {
|
|
168
168
|
let e = L.current;
|
|
169
|
-
|
|
169
|
+
T(!1), M(0), e?.scrollTo({
|
|
170
170
|
top: 0,
|
|
171
171
|
left: 0,
|
|
172
172
|
behavior: "auto"
|
|
173
173
|
});
|
|
174
174
|
let t = () => {
|
|
175
|
-
e && e.scrollHeight - e.scrollTop <= e.clientHeight + 5 &&
|
|
175
|
+
e && e.scrollHeight - e.scrollTop <= e.clientHeight + 5 && T(!0);
|
|
176
176
|
};
|
|
177
177
|
return e?.addEventListener("scroll", t), t(), () => {
|
|
178
178
|
e?.removeEventListener("scroll", t);
|
|
179
179
|
};
|
|
180
|
-
}, [X]),
|
|
180
|
+
}, [X]), l(() => {
|
|
181
181
|
let e = !1;
|
|
182
182
|
return (async () => {
|
|
183
|
-
if (
|
|
183
|
+
if (x) {
|
|
184
184
|
A([]), j(!1);
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
@@ -205,14 +205,14 @@ function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
205
205
|
e = !0;
|
|
206
206
|
};
|
|
207
207
|
}, [
|
|
208
|
-
|
|
208
|
+
S,
|
|
209
209
|
h,
|
|
210
210
|
g,
|
|
211
211
|
Y,
|
|
212
|
-
|
|
212
|
+
x,
|
|
213
213
|
N
|
|
214
|
-
]),
|
|
215
|
-
if (
|
|
214
|
+
]), l(() => {
|
|
215
|
+
if (x || k.length === 0) return;
|
|
216
216
|
let e = B.current.slice(0, Y).filter((e) => e != null);
|
|
217
217
|
if (e.length === 0) return;
|
|
218
218
|
let t = new IntersectionObserver((t) => {
|
|
@@ -235,8 +235,8 @@ function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
235
235
|
}, [
|
|
236
236
|
k,
|
|
237
237
|
Y,
|
|
238
|
-
|
|
239
|
-
]),
|
|
238
|
+
x
|
|
239
|
+
]), l(() => {
|
|
240
240
|
let e = R.current;
|
|
241
241
|
if (!Z || !e) {
|
|
242
242
|
O(0);
|
|
@@ -250,19 +250,19 @@ function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
250
250
|
return n.observe(e), () => {
|
|
251
251
|
n.disconnect();
|
|
252
252
|
};
|
|
253
|
-
}, [
|
|
254
|
-
let
|
|
253
|
+
}, [S.acceptance, Z]);
|
|
254
|
+
let Ee = (e) => {
|
|
255
255
|
let t = e instanceof Date ? e : new Date(e);
|
|
256
256
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
257
|
-
},
|
|
258
|
-
let t =
|
|
257
|
+
}, De = (e) => {
|
|
258
|
+
let t = Ee(e);
|
|
259
259
|
return t ? new Intl.DateTimeFormat(V.legal, {
|
|
260
260
|
day: "2-digit",
|
|
261
261
|
month: "2-digit",
|
|
262
262
|
year: "numeric"
|
|
263
263
|
}).format(t) : "-";
|
|
264
|
-
},
|
|
265
|
-
let t =
|
|
264
|
+
}, Oe = (e) => {
|
|
265
|
+
let t = Ee(e);
|
|
266
266
|
return t ? new Intl.DateTimeFormat(V.legal, {
|
|
267
267
|
day: "2-digit",
|
|
268
268
|
month: "2-digit",
|
|
@@ -270,141 +270,147 @@ function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, he
|
|
|
270
270
|
hour: "2-digit",
|
|
271
271
|
minute: "2-digit"
|
|
272
272
|
}).format(t) : "-";
|
|
273
|
-
},
|
|
274
|
-
let t =
|
|
273
|
+
}, ke = async (e) => {
|
|
274
|
+
let t = v ? await v(e) : void 0;
|
|
275
275
|
if (t) {
|
|
276
|
-
|
|
276
|
+
C(t);
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
|
-
|
|
279
|
+
C((t) => ({
|
|
280
280
|
...t,
|
|
281
281
|
acceptance: e
|
|
282
282
|
}));
|
|
283
|
-
},
|
|
284
|
-
await
|
|
283
|
+
}, Ae = async () => {
|
|
284
|
+
await ke({
|
|
285
285
|
mode: "acceptance",
|
|
286
286
|
date: /* @__PURE__ */ new Date()
|
|
287
287
|
});
|
|
288
|
-
},
|
|
289
|
-
await
|
|
290
|
-
},
|
|
288
|
+
}, je = async (e) => {
|
|
289
|
+
await ke(e);
|
|
290
|
+
}, Me = () => {
|
|
291
|
+
let e = S.acceptanceLevel === "signature" ? "signature" : "acceptance";
|
|
292
|
+
e === "signature" && _e(!0), D(e);
|
|
293
|
+
}, Ne = (e) => {
|
|
291
294
|
M(e), B.current[e]?.scrollIntoView({
|
|
292
295
|
behavior: "smooth",
|
|
293
296
|
block: "start"
|
|
294
297
|
});
|
|
295
|
-
},
|
|
298
|
+
}, Pe = Z ? ve + m : m, $ = _ === "parent", Fe = S.acceptanceLevel === "signature" ? y(w ? "docs_contract_sale_action_signature_ready" : "docs_contract_sale_action_signature_locked") : y(w ? "docs_contract_sale_action_acceptance_ready" : "docs_contract_sale_action_acceptance_locked"), Ie = Q?.mode === "signature" ? y("docs_contract_sale_already_signed", { date: Oe(Q.date) }) : Q?.mode === "acceptance" ? y("docs_contract_sale_already_accepted", { date: Oe(Q.date) }) : null, Le = (e, t) => /* @__PURE__ */ p(o, {
|
|
296
299
|
ref: (e) => {
|
|
297
300
|
B.current[t] = e;
|
|
298
301
|
},
|
|
299
|
-
className:
|
|
302
|
+
className: x || t === Y - 1 ? "!mb-0" : void 0,
|
|
300
303
|
children: [
|
|
301
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ f(ee, {
|
|
302
305
|
documentTitle: G,
|
|
303
|
-
saleDocumentNumber:
|
|
306
|
+
saleDocumentNumber: S.saleDocumentNumber,
|
|
304
307
|
currentPage: t + 1,
|
|
305
308
|
totalPages: Y,
|
|
306
309
|
documentLanguage: V
|
|
307
310
|
}),
|
|
308
|
-
e.kind === "invoice" ? /* @__PURE__ */
|
|
309
|
-
saleDocument:
|
|
311
|
+
e.kind === "invoice" ? /* @__PURE__ */ f(a, {
|
|
312
|
+
saleDocument: S,
|
|
310
313
|
items: e.items,
|
|
311
314
|
subtotal: W,
|
|
312
|
-
tax:
|
|
315
|
+
tax: we,
|
|
313
316
|
total: U,
|
|
314
|
-
formatDate:
|
|
317
|
+
formatDate: De,
|
|
315
318
|
showInvoiceMeta: e.showInvoiceMeta,
|
|
316
319
|
showTotalsSection: e.showTotalsSection,
|
|
317
320
|
showNotesSection: e.showNotesSection,
|
|
318
321
|
showAcceptanceSection: e.showAcceptanceSection && q.length === 0,
|
|
319
322
|
documentQrCodeUrl: e.showInvoiceMeta ? N : void 0,
|
|
320
323
|
documentLanguage: V
|
|
321
|
-
}) : /* @__PURE__ */
|
|
324
|
+
}) : /* @__PURE__ */ p("main", {
|
|
322
325
|
className: "flex flex-grow flex-col px-4 text-left md:px-8",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ f(te, {
|
|
324
327
|
title: e.title,
|
|
325
328
|
articles: e.articles,
|
|
326
329
|
withEnglishTranslation: e.withTranslation,
|
|
327
330
|
showTitle: e.showTitle
|
|
328
|
-
}), t === Y - 1 ? /* @__PURE__ */
|
|
329
|
-
saleDocument:
|
|
331
|
+
}), t === Y - 1 ? /* @__PURE__ */ f(i, {
|
|
332
|
+
saleDocument: S,
|
|
330
333
|
documentLanguage: V,
|
|
331
|
-
formatDate:
|
|
334
|
+
formatDate: De
|
|
332
335
|
}) : null]
|
|
333
336
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ f(s, {
|
|
335
338
|
documentTitle: G,
|
|
336
|
-
saleDocumentNumber:
|
|
339
|
+
saleDocumentNumber: S.saleDocumentNumber,
|
|
337
340
|
currentPage: t + 1,
|
|
338
341
|
totalPages: Y,
|
|
339
342
|
documentLanguage: V
|
|
340
343
|
})
|
|
341
344
|
]
|
|
342
345
|
}, e.key);
|
|
343
|
-
return
|
|
346
|
+
return x ? /* @__PURE__ */ f("div", {
|
|
344
347
|
ref: z,
|
|
345
|
-
"data-testid":
|
|
348
|
+
"data-testid": xe && Se ? "contract-sale-document-pdf-ready" : void 0,
|
|
346
349
|
className: "contract-sale-document contract-sale-document-pdf bg-white text-foreground",
|
|
347
|
-
children: J.map(
|
|
348
|
-
}) : /* @__PURE__ */
|
|
350
|
+
children: J.map(Le)
|
|
351
|
+
}) : /* @__PURE__ */ f(ie, { children: /* @__PURE__ */ p("div", {
|
|
349
352
|
className: `contract-sale-document ${$ ? "h-full" : "h-dvh"} min-h-0 md:flex`,
|
|
350
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ f(ne, {
|
|
351
354
|
thumbnails: k,
|
|
352
|
-
activePage:
|
|
353
|
-
onThumbnailClick:
|
|
355
|
+
activePage: be,
|
|
356
|
+
onThumbnailClick: Ne,
|
|
354
357
|
totalPages: Y,
|
|
355
358
|
heightClassName: $ ? "h-full" : "h-dvh",
|
|
356
359
|
contentClassName: $ ? "pt-16" : void 0,
|
|
357
|
-
isLoading:
|
|
358
|
-
}), /* @__PURE__ */
|
|
360
|
+
isLoading: ye
|
|
361
|
+
}), /* @__PURE__ */ p("div", {
|
|
359
362
|
ref: L,
|
|
360
363
|
"data-testid": "contract-sale-document-scroll-container",
|
|
361
364
|
className: `${$ ? "h-full" : "h-dvh"} min-h-0 flex-1 overflow-y-auto overscroll-y-contain bg-transparent`,
|
|
362
365
|
style: {
|
|
363
366
|
paddingTop: $ ? "3.5rem" : void 0,
|
|
364
367
|
scrollPaddingTop: $ ? "3.5rem" : void 0,
|
|
365
|
-
paddingBottom: `${
|
|
368
|
+
paddingBottom: `${Pe}px`
|
|
366
369
|
},
|
|
367
370
|
children: [
|
|
368
|
-
J.map(
|
|
369
|
-
/* @__PURE__ */
|
|
371
|
+
J.map(Le),
|
|
372
|
+
/* @__PURE__ */ f("p", {
|
|
370
373
|
className: "px-4 text-center text-xs text-muted-foreground/75 md:px-8",
|
|
371
|
-
style: { paddingTop: `${
|
|
372
|
-
children:
|
|
374
|
+
style: { paddingTop: `${m}px` },
|
|
375
|
+
children: y("docs_contract_sale_end")
|
|
373
376
|
}),
|
|
374
|
-
Z ? /* @__PURE__ */
|
|
377
|
+
Z ? /* @__PURE__ */ f("div", {
|
|
375
378
|
ref: R,
|
|
376
379
|
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",
|
|
377
|
-
children:
|
|
380
|
+
children: Ie ? /* @__PURE__ */ p("div", {
|
|
378
381
|
className: "flex items-center gap-2 px-6 py-3 text-sm font-semibold text-success",
|
|
379
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ f(oe, {
|
|
380
383
|
className: "h-4 w-4 shrink-0",
|
|
381
384
|
"aria-hidden": "true"
|
|
382
|
-
}), /* @__PURE__ */
|
|
385
|
+
}), /* @__PURE__ */ f("p", {
|
|
383
386
|
className: "text-center",
|
|
384
|
-
children:
|
|
387
|
+
children: Ie
|
|
385
388
|
})]
|
|
386
|
-
}) : /* @__PURE__ */
|
|
387
|
-
onClick:
|
|
388
|
-
disabled: !
|
|
389
|
+
}) : /* @__PURE__ */ f(e, {
|
|
390
|
+
onClick: Me,
|
|
391
|
+
disabled: !w,
|
|
389
392
|
className: "px-6 py-3 text-sm font-semibold",
|
|
390
393
|
"data-testid": "contract-sale-document-action-button",
|
|
391
|
-
children:
|
|
394
|
+
children: Fe
|
|
392
395
|
})
|
|
393
396
|
}) : null,
|
|
394
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ f(t, {
|
|
395
398
|
isOpen: E === "acceptance",
|
|
396
399
|
onClose: () => D(null),
|
|
397
400
|
onAccept: async () => {
|
|
398
|
-
await
|
|
401
|
+
await Ae(), D(null);
|
|
399
402
|
}
|
|
400
403
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
404
|
+
ge ? /* @__PURE__ */ f(re, {
|
|
405
|
+
fallback: null,
|
|
406
|
+
children: /* @__PURE__ */ f(le, {
|
|
407
|
+
isOpen: E === "signature",
|
|
408
|
+
onClose: () => D(null),
|
|
409
|
+
onSave: async (e) => {
|
|
410
|
+
await je(e), D(null);
|
|
411
|
+
}
|
|
412
|
+
})
|
|
413
|
+
}) : null
|
|
408
414
|
]
|
|
409
415
|
})]
|
|
410
416
|
}) });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveBookingSearchParamsFromSessionStorage as e } from "../../lib/booking.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { getLocalizedValue as t } from "../../localization.js";
|
|
3
|
+
import { useStorefrontCart as n } from "../../lib/cart.js";
|
|
4
4
|
import { buildStorefrontImageUrl as r } from "../../lib/storefrontImage.js";
|
|
5
5
|
import ee from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
|
|
6
6
|
import { MISSING_SHOP_EMAIL as i } from "../../lib/storefrontMissingValues.js";
|
|
@@ -19,13 +19,13 @@ var b = 36, x = (e, t) => {
|
|
|
19
19
|
return n ? r(n, t ?? "") : "";
|
|
20
20
|
};
|
|
21
21
|
function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay: C }) {
|
|
22
|
-
let { t: w, i18n: T } = h(), { storeSlug: E } = m(), D = p(), { itemCount: O } =
|
|
22
|
+
let { t: w, i18n: T } = h(), { storeSlug: E } = m(), D = p(), { itemCount: O } = n(), k = u("(max-width: 640px)"), [A, te] = d(), j = te?.height ?? b, M = _({
|
|
23
23
|
enabled: k,
|
|
24
24
|
thresholdPx: j
|
|
25
25
|
}), N = k && M ? `translateY(-${j}px)` : "translateY(0)", P = () => {
|
|
26
26
|
let e = T.language.startsWith("fr") ? "en" : "fr";
|
|
27
27
|
T.changeLanguage(e);
|
|
28
|
-
}, F = `/${E ?? ""}`, I = e(new URLSearchParams(D.search), E), L = I.toString(), R = !!(I.get("start_time")?.trim() && I.get("end_time")?.trim()), z = L ? `?${L}` : "", B = `${F}/booking${z}`, V = `${F}/checkout${z}`, H = r?.shop.name?.trim() ?? "", U = r?.shop.emailAddress?.trim() ?? "", W = r?.workspace?.workspaceLanguage, G =
|
|
28
|
+
}, F = `/${E ?? ""}`, I = e(new URLSearchParams(D.search), E), L = I.toString(), R = !!(I.get("start_time")?.trim() && I.get("end_time")?.trim()), z = L ? `?${L}` : "", B = `${F}/booking${z}`, V = `${F}/checkout${z}`, H = r?.shop.name?.trim() ?? "", U = r?.shop.emailAddress?.trim() ?? "", W = r?.workspace?.workspaceLanguage, G = t(r?.content?.tagline, T.language, W).trim(), K = a(r?.shop), q = G || K || "[Missing shop address]", J = !G && !K, Y = t(r?.content?.topBannerMessage, T.language, W).trim() || w("top_bar_message"), X = x(r?.content?.logoWideImageId, E), Z = x(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, E), Q = X.length > 0, $ = Z.length > 0;
|
|
29
29
|
return /* @__PURE__ */ l("div", {
|
|
30
30
|
className: "sticky top-0 z-30",
|
|
31
31
|
children: [/* @__PURE__ */ c("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAGvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAItE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,kBAAkB,EAAE,6BAA6B,CAAA;CAClD,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,uBAAuB,EACvB,kBAAkB,GACnB,EAAE,WAAW,2CAiEb"}
|
|
@@ -7,54 +7,61 @@ import { PlaygroundDevFloatingButton as a } from "../PlaygroundDevFloatingButton
|
|
|
7
7
|
import { StorefrontPopupMessages as o } from "../StorefrontPopupMessages/index.js";
|
|
8
8
|
import { WhatsAppFloatingButton as s } from "../WhatsAppFloatingButton/WhatsAppFloatingButton.js";
|
|
9
9
|
import "../WhatsAppFloatingButton/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
10
|
+
import { STOREFRONT_TOASTER_ID as c } from "../../lib/toast.js";
|
|
11
|
+
import { Provider as l } from "../../ui/tooltip.js";
|
|
12
|
+
import { useEffect as u } from "react";
|
|
13
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
14
|
+
import { RootProvider as m } from "@rpcbase/client";
|
|
15
|
+
import { Outlet as h, useLocation as g, useParams as _ } from "@rpcbase/router";
|
|
16
|
+
import { useTranslation as v } from "react-i18next";
|
|
17
|
+
import { Toaster as y } from "sonner";
|
|
16
18
|
//#region src/components/Layout/index.tsx
|
|
17
|
-
function
|
|
18
|
-
let { storeSlug:
|
|
19
|
-
|
|
19
|
+
function b({ storefrontConfiguration: b, storefrontProducts: x }) {
|
|
20
|
+
let { storeSlug: S, referenceId: C } = _(), w = g(), { i18n: T } = v();
|
|
21
|
+
u(() => {
|
|
20
22
|
document.documentElement.setAttribute("data-hydrated", "true");
|
|
21
23
|
}, []);
|
|
22
|
-
let
|
|
23
|
-
storefrontConfiguration:
|
|
24
|
-
language:
|
|
25
|
-
}),
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
let E = t({
|
|
25
|
+
storefrontConfiguration: b,
|
|
26
|
+
language: T.language
|
|
27
|
+
}), D = E?.href, O = typeof C == "string" && C.trim().length > 0, k = O && new URLSearchParams(w.search).get("pdf") === "1";
|
|
28
|
+
return /* @__PURE__ */ p(m, { children: [/* @__PURE__ */ f(y, {
|
|
29
|
+
id: c,
|
|
30
|
+
closeButton: !0,
|
|
31
|
+
position: "bottom-center",
|
|
32
|
+
theme: "dark"
|
|
33
|
+
}), /* @__PURE__ */ f(l, { children: /* @__PURE__ */ f(e, {
|
|
34
|
+
storeSlug: S ?? "",
|
|
35
|
+
products: x,
|
|
36
|
+
children: /* @__PURE__ */ f("div", {
|
|
37
|
+
className: `loczer-storefront flex flex-col bg-background text-foreground ${O && !k ? "h-dvh overflow-hidden" : "min-h-screen"}`,
|
|
38
|
+
children: O ? /* @__PURE__ */ f("main", {
|
|
39
|
+
className: `flex-1 ${k ? "bg-white" : "overflow-hidden"}`,
|
|
40
|
+
children: /* @__PURE__ */ f(h, {})
|
|
41
|
+
}) : /* @__PURE__ */ p(d, { children: [
|
|
42
|
+
/* @__PURE__ */ f(r, {
|
|
43
|
+
storefrontConfiguration: b,
|
|
44
|
+
whatsappHref: D,
|
|
45
|
+
whatsappPhoneDisplay: E?.phoneDisplay
|
|
39
46
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ f("main", {
|
|
41
48
|
className: "flex-1",
|
|
42
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ f(h, {})
|
|
43
50
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
shop:
|
|
46
|
-
whatsappHref:
|
|
47
|
-
whatsappPhoneDisplay:
|
|
48
|
-
openingHours:
|
|
49
|
-
openingHoursOverrides:
|
|
51
|
+
/* @__PURE__ */ f(n, {
|
|
52
|
+
shop: b?.shop,
|
|
53
|
+
whatsappHref: D,
|
|
54
|
+
whatsappPhoneDisplay: E?.phoneDisplay,
|
|
55
|
+
openingHours: b?.bookingEngine.shop.openingHours,
|
|
56
|
+
openingHoursOverrides: b?.bookingEngine.shop.openingHoursOverrides
|
|
50
57
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ f(i, {}),
|
|
59
|
+
D && b?.content?.showWhatsappFloatingButton !== !1 ? /* @__PURE__ */ f(s, { href: D }) : null,
|
|
60
|
+
/* @__PURE__ */ f(a, {}),
|
|
61
|
+
/* @__PURE__ */ f(o, { storefrontConfiguration: b })
|
|
55
62
|
] })
|
|
56
63
|
})
|
|
57
|
-
}) }) });
|
|
64
|
+
}) })] });
|
|
58
65
|
}
|
|
59
66
|
//#endregion
|
|
60
|
-
export {
|
|
67
|
+
export { b as Layout };
|
|
@@ -3,7 +3,8 @@ type ProductPriceBadgeProps = {
|
|
|
3
3
|
prices?: StorefrontPublicProductPrice[];
|
|
4
4
|
minPriceMinor?: number;
|
|
5
5
|
className?: string;
|
|
6
|
+
openOnHover?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare const ProductPriceBadge: ({ prices, minPriceMinor, className }: ProductPriceBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export declare const ProductPriceBadge: ({ prices, minPriceMinor, className, openOnHover, }: ProductPriceBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ProductPriceBadge/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAA;AAoBhF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,CAAC,EAAE,4BAA4B,EAAE,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ProductPriceBadge/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAA;AAoBhF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,CAAC,EAAE,4BAA4B,EAAE,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,oDAK/B,sBAAsB,mDA8WxB,CAAA"}
|