@loczer/storefront-sdk 0.218.0 → 0.220.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/components/BookingFlowPageLayout/index.d.ts +13 -0
- package/dist/components/BookingFlowPageLayout/index.d.ts.map +1 -0
- package/dist/components/BookingFlowPageLayout/index.js +35 -0
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +10 -33
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -4
- package/dist/components/BookingPeriodSelector/index.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/index.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +0 -5
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +150 -159
- package/dist/components/Footer/BusinessHours.d.ts +2 -1
- package/dist/components/Footer/BusinessHours.d.ts.map +1 -1
- package/dist/components/Footer/BusinessHours.js +19 -18
- package/dist/components/Footer/businessHoursStatus.d.ts +25 -0
- package/dist/components/Footer/businessHoursStatus.d.ts.map +1 -0
- package/dist/components/Footer/businessHoursStatus.js +99 -0
- package/dist/components/Footer/businessHoursUtils.d.ts +2 -1
- package/dist/components/Footer/businessHoursUtils.d.ts.map +1 -1
- package/dist/components/Footer/businessHoursUtils.js +52 -45
- package/dist/components/Footer/index.d.ts +2 -1
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +26 -25
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +2 -1
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -1
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +89 -86
- package/dist/components/StorefrontCartPanel/index.js +4 -4
- package/dist/components/StorefrontInsuranceNotice/index.d.ts +2 -1
- package/dist/components/StorefrontInsuranceNotice/index.d.ts.map +1 -1
- package/dist/components/StorefrontInsuranceNotice/index.js +155 -162
- package/dist/i18n/en.d.ts +7 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +8 -2
- package/dist/i18n/fr.d.ts +7 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +8 -2
- package/dist/index.d.ts +24 -10
- package/dist/index.js +66 -66
- package/dist/lib/checkoutPaymentDecision.d.ts +2 -6
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +3 -4
- package/dist/lib/checkoutSubmit.d.ts +0 -3
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +41 -43
- package/dist/lib/pricing.d.ts.map +1 -1
- package/dist/lib/pricing.js +3 -1
- 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/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +306 -335
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +172 -186
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +435 -378
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAuGA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAysBnC"}
|
|
@@ -2,15 +2,15 @@ import { applyBookingParamsToSearch as e, getBookingParamsFromSearch as t, pickB
|
|
|
2
2
|
import { useStorefrontCart as ee } from "../lib/cart.js";
|
|
3
3
|
import { calculateBookingRentalUnitSummary as te, formatRentalUnitQuantity as ne, getPricingUnitLabel as re } from "../lib/pricing.js";
|
|
4
4
|
import { buildStorefrontCartSummary as ie } from "../lib/cartSummary.js";
|
|
5
|
-
import { ROUTE as ae, responseSchema as oe } from "../lib/
|
|
6
|
-
import { ROUTE as se,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { toast as _e } from "../lib/toast.js";
|
|
11
|
-
import { BookingFlowSteps as ve } from "../components/BookingFlowSteps/index.js";
|
|
5
|
+
import { ROUTE as ae, responseSchema as oe } from "../lib/checkoutSubmit.js";
|
|
6
|
+
import { ROUTE as se, buildStorefrontAvailabilityKey as ce, getStorefrontAvailabilityIssue as le, getValidStorefrontAvailabilitySchedule as ue, responseSchema as de } from "../lib/storefrontAvailability.js";
|
|
7
|
+
import { Button as fe } from "../ui/button.js";
|
|
8
|
+
import { useStorefront as pe, useStorefrontProducts as me } from "../StorefrontContext.js";
|
|
9
|
+
import { toast as he } from "../lib/toast.js";
|
|
12
10
|
import { apiPost as a } from "../lib/apiCall.js";
|
|
13
|
-
import { FulfillmentSection as
|
|
11
|
+
import { FulfillmentSection as ge } from "../components/FulfillmentSection/index.js";
|
|
12
|
+
import { BookingFlowPageLayout as _e } from "../components/BookingFlowPageLayout/index.js";
|
|
13
|
+
import { ROUTE as ve, responseSchema as ye } from "../lib/checkoutPaymentDecision.js";
|
|
14
14
|
import { ROUTE as be, responseSchema as xe } from "../lib/checkoutVerifyCoupon.js";
|
|
15
15
|
import { CheckoutDetailsCard as Se } from "./checkout/components/CheckoutDetailsCard.js";
|
|
16
16
|
import { CheckoutPaymentSummaryCard as Ce } from "./checkout/components/CheckoutPaymentSummaryCard.js";
|
|
@@ -57,7 +57,7 @@ var Ie = .2, d = (e, t, n) => {
|
|
|
57
57
|
return new Intl.DateTimeFormat(t, r).format(e);
|
|
58
58
|
};
|
|
59
59
|
function f() {
|
|
60
|
-
let { t: f, i18n: p } = Me(), { storefrontConfiguration: m } =
|
|
60
|
+
let { t: f, i18n: p } = Me(), { storefrontConfiguration: m } = pe(), ze = m.workspace?.workspaceLanguage, { bikes: h, accessories: Be } = me(), { storeSlug: g } = Ae(), [_, Ve] = je(), He = ke(), { items: Ue, itemCount: We, setQuantity: Ge, removeItem: Ke, beginCheckoutSubmission: qe, confirmCheckoutPaymentSession: Je, clearCheckoutSession: Ye, clear: Xe } = ee(), [v, Ze] = c(!1), Qe = De(!1), [y, b] = c(null), [$e, et] = c(!1), [tt, x] = c(null), nt = _.get("coupon") ?? _.get("code") ?? "", [rt, it] = c(nt), [at, ot] = c(nt.trim()), [S, C] = c(null), [w, T] = c(null), [E, D] = c(!1), [st, O] = c(null), [ct, k] = c(null), [A, lt] = c(!1), [j, ut] = c(!1), dt = n(_).toString(), ft = s(() => r(new URLSearchParams(dt), g), [dt, g]), M = m.settings.fulfillmentModes.includes("delivery"), pt = m.settings.deliveryDisabledReason.trim(), mt = M || pt.length > 0, ht = m.shop.address?.trim() ?? "", N = s(() => {
|
|
61
61
|
let e = t(ft, {
|
|
62
62
|
start_time: "",
|
|
63
63
|
end_time: ""
|
|
@@ -66,7 +66,7 @@ function f() {
|
|
|
66
66
|
...e,
|
|
67
67
|
fulfillment: "pickup"
|
|
68
68
|
} : e;
|
|
69
|
-
}, [ft, M]), P = s(() =>
|
|
69
|
+
}, [ft, M]), P = s(() => ue(N), [N]), F = m.bookingEngine.pricing, I = te(N, F, m.bookingEngine.shop.timeZone), gt = re(F.baseUnit, f), _t = I ? ne(I.billableUnitCount, I.priceUnit, p.language, f) : void 0, vt = I?.billableUnitCount, L = s(() => ie({
|
|
70
70
|
items: Ue,
|
|
71
71
|
language: p.language,
|
|
72
72
|
fallbackLanguage: ze,
|
|
@@ -101,11 +101,11 @@ function f() {
|
|
|
101
101
|
let e = !1;
|
|
102
102
|
return B(!0), z([]), (async () => {
|
|
103
103
|
try {
|
|
104
|
-
let t = await a(
|
|
104
|
+
let t = await a(se, {
|
|
105
105
|
storeSlug: g,
|
|
106
106
|
schedule: P,
|
|
107
107
|
products: R
|
|
108
|
-
}), n =
|
|
108
|
+
}), n = de.parse(t);
|
|
109
109
|
if (e) return;
|
|
110
110
|
z(n.success ? n.availability ?? [] : []);
|
|
111
111
|
} catch (t) {
|
|
@@ -126,10 +126,10 @@ function f() {
|
|
|
126
126
|
R,
|
|
127
127
|
g
|
|
128
128
|
]);
|
|
129
|
-
let xt = s(() => new Map(yt.map((e) => [
|
|
129
|
+
let xt = s(() => new Map(yt.map((e) => [ce(e.productId, e.productVariantId), e])), [yt]), St = s(() => ({
|
|
130
130
|
...L,
|
|
131
131
|
lines: L.lines.map((e) => {
|
|
132
|
-
let t = xt.get(
|
|
132
|
+
let t = xt.get(ce(e.checkoutProductId, e.productVariantId)), n = t ? le(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
133
133
|
return {
|
|
134
134
|
...e,
|
|
135
135
|
insufficientCapacity: !bt && n !== void 0,
|
|
@@ -140,19 +140,19 @@ function f() {
|
|
|
140
140
|
xt,
|
|
141
141
|
bt,
|
|
142
142
|
L
|
|
143
|
-
]),
|
|
143
|
+
]), V = s(() => L.lines.map((e) => ({
|
|
144
144
|
kind: e.kind,
|
|
145
145
|
productId: e.checkoutProductId,
|
|
146
146
|
productVariantId: e.productVariantId,
|
|
147
147
|
quantity: e.quantity
|
|
148
|
-
})), [L.lines]),
|
|
149
|
-
let t =
|
|
148
|
+
})), [L.lines]), Ct = new Map(h.map((e) => [e.checkoutProductId?.trim() || e.id, e])), H = L.lines.flatMap((e) => {
|
|
149
|
+
let t = Ct.get(e.checkoutProductId);
|
|
150
150
|
return t?.insurance?.enabled ? [{
|
|
151
151
|
quantity: e.quantity,
|
|
152
152
|
pricePerDayMinor: t.insurance.pricePerDayMinor,
|
|
153
153
|
deductibleAmountMinor: t.insurance.deductibleAmountMinor
|
|
154
154
|
}] : [];
|
|
155
|
-
}), U = m.modules?.insurance?.enabled === !0 &&
|
|
155
|
+
}), U = m.modules?.insurance?.enabled === !0 && H.length > 0, W = U && j, wt = H.reduce((e, t) => e + t.pricePerDayMinor * t.quantity, 0), Tt = H.reduce((e, t) => Math.max(e, t.deductibleAmountMinor), 0), Et = L.estimatedTotalMinor ?? L.totalPerBaseUnitMinor, G = w?.totalMinor ?? Et, K = S?.discountAmountMinor ?? 0, q = e(new URLSearchParams(), N).toString(), J = `/${g ?? ""}/booking${q ? `?${q}` : ""}`, Dt = `/${g ?? ""}/checkout${q ? `?${q}` : ""}`, Ot = Pe({
|
|
156
156
|
resolver: Fe(Ee),
|
|
157
157
|
defaultValues: {
|
|
158
158
|
first_name: "",
|
|
@@ -167,7 +167,7 @@ function f() {
|
|
|
167
167
|
}, [N, g]), o(() => {
|
|
168
168
|
!U && j && ut(!1);
|
|
169
169
|
}, [j, U]);
|
|
170
|
-
let
|
|
170
|
+
let Y = (t) => {
|
|
171
171
|
let n = {
|
|
172
172
|
...N,
|
|
173
173
|
...t
|
|
@@ -175,38 +175,38 @@ function f() {
|
|
|
175
175
|
r.toString() !== _.toString() && (Ve(r, { replace: !0 }), i(g, r));
|
|
176
176
|
};
|
|
177
177
|
o(() => {
|
|
178
|
-
if (!g ||
|
|
179
|
-
|
|
178
|
+
if (!g || V.length === 0 || !P) {
|
|
179
|
+
C(null), T(null), D(!1), O(null), k(null);
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
let e =
|
|
183
|
-
return
|
|
182
|
+
let e = at.trim(), t = e.length === 0 && !A, n = !1;
|
|
183
|
+
return D(!0), k(null), O(null), (async () => {
|
|
184
184
|
try {
|
|
185
185
|
let r = await a(be, {
|
|
186
186
|
storeSlug: g,
|
|
187
187
|
schedule: P,
|
|
188
|
-
items:
|
|
188
|
+
items: V,
|
|
189
189
|
couponCode: e || void 0,
|
|
190
190
|
includeAutoApply: t,
|
|
191
191
|
insuranceAccepted: W
|
|
192
192
|
}), i = xe.parse(r);
|
|
193
193
|
if (n) return;
|
|
194
|
-
if (
|
|
194
|
+
if (T(typeof i.subtotalMinor == "number" && typeof i.totalMinor == "number" ? {
|
|
195
195
|
subtotalMinor: i.subtotalMinor,
|
|
196
196
|
totalMinor: i.totalMinor,
|
|
197
197
|
lateReturnSurchargeMinor: i.lateReturnSurchargeMinor,
|
|
198
198
|
insuranceSubtotalMinor: i.insuranceSubtotalMinor,
|
|
199
199
|
insuranceBillableDays: i.insuranceBillableDays
|
|
200
200
|
} : null), !i.success) {
|
|
201
|
-
|
|
201
|
+
C(null), k(i.message || f("checkout_coupon_invalid"));
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
|
|
204
|
+
C(i.coupon ?? null), i.coupon && (i.coupon.autoApplied && e.length === 0 ? (it(i.coupon.code), O(f("checkout_coupon_auto_applied", { code: i.coupon.code }))) : O(f("checkout_coupon_manual_applied")));
|
|
205
205
|
} catch (e) {
|
|
206
206
|
if (n) return;
|
|
207
|
-
console.error("Failed to verify checkout coupon", e),
|
|
207
|
+
console.error("Failed to verify checkout coupon", e), C(null), T(null), k(f("checkout_coupon_error"));
|
|
208
208
|
} finally {
|
|
209
|
-
n ||
|
|
209
|
+
n || D(!1);
|
|
210
210
|
}
|
|
211
211
|
})(), () => {
|
|
212
212
|
n = !0;
|
|
@@ -218,35 +218,35 @@ function f() {
|
|
|
218
218
|
N.start_date,
|
|
219
219
|
N.start_time,
|
|
220
220
|
P,
|
|
221
|
-
|
|
221
|
+
V,
|
|
222
222
|
W,
|
|
223
223
|
g,
|
|
224
|
-
|
|
224
|
+
at,
|
|
225
225
|
f
|
|
226
226
|
]), o(() => {
|
|
227
227
|
if (!g || L.lines.length === 0 || !P) {
|
|
228
|
-
b(null),
|
|
228
|
+
b(null), x(null), et(!1);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
let e = !1;
|
|
232
|
-
return
|
|
232
|
+
return et(!0), x(null), (async () => {
|
|
233
233
|
try {
|
|
234
|
-
let t = await a(
|
|
234
|
+
let t = await a(ve, {
|
|
235
235
|
storeSlug: g,
|
|
236
236
|
schedule: P,
|
|
237
237
|
estimatedTotalMinor: G
|
|
238
|
-
}), n =
|
|
238
|
+
}), n = ye.parse(t);
|
|
239
239
|
if (e) return;
|
|
240
240
|
if (!n.success || !n.decision) {
|
|
241
|
-
b(null),
|
|
241
|
+
b(null), x(n.message || f("checkout_payment_error"));
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
244
|
b(n.decision);
|
|
245
245
|
} catch (t) {
|
|
246
246
|
if (e) return;
|
|
247
|
-
console.error("Failed to load checkout payment decision", t), b(null),
|
|
247
|
+
console.error("Failed to load checkout payment decision", t), b(null), x(f("checkout_payment_error"));
|
|
248
248
|
} finally {
|
|
249
|
-
e ||
|
|
249
|
+
e || et(!1);
|
|
250
250
|
}
|
|
251
251
|
})(), () => {
|
|
252
252
|
e = !0;
|
|
@@ -262,29 +262,29 @@ function f() {
|
|
|
262
262
|
g,
|
|
263
263
|
f
|
|
264
264
|
]);
|
|
265
|
-
let
|
|
265
|
+
let X = y?.currency ?? "EUR", kt = d(G, X, p.language), At = K > 0 ? `-${d(K, X, p.language)}` : null, Z = w?.insuranceSubtotalMinor ?? 0, jt = Math.max(0, G - Z), Mt = Math.round(jt / 1.2), Nt = Mt + Z, Pt = Math.max(0, jt - Mt), Ft = d(Nt, X, p.language), It = d(Pt, X, p.language), Lt = Le(Ie, p.language), Rt = Z > 0 ? d(Z, X, p.language) : void 0, Q = y?.amountToCollectMinor ?? 0, zt = d(Q, X, p.language), Bt = y?.paymentMode === "deposit" && Q > 0 ? d(Q, X, p.language) : null, Vt = y?.shouldCollectOnlinePayment === !0 && Q > 0, Ht = m.shop.timeZone?.trim() || void 0, $ = s(() => y ? Le(Math.max(0, Math.min(1, y.bookingDepositPercentage)), p.language) : null, [p.language, y]), Ut = s(() => {
|
|
266
266
|
if (!y?.depositRefundableUntilIso) return null;
|
|
267
267
|
let e = new Date(y.depositRefundableUntilIso);
|
|
268
|
-
return Number.isNaN(e.getTime()) ? null : Re(e, p.language,
|
|
268
|
+
return Number.isNaN(e.getTime()) ? null : Re(e, p.language, Ht);
|
|
269
269
|
}, [
|
|
270
270
|
p.language,
|
|
271
271
|
y?.depositRefundableUntilIso,
|
|
272
|
-
|
|
273
|
-
]), Wt = s(() => y ? y.paymentMode === "deposit" &&
|
|
274
|
-
percent:
|
|
275
|
-
date:
|
|
276
|
-
}) : f("checkout_payment_due_now_helper_deposit", { percent:
|
|
277
|
-
Z,
|
|
272
|
+
Ht
|
|
273
|
+
]), Wt = s(() => y ? y.paymentMode === "deposit" && Q > 0 && $ ? Ut ? f("checkout_payment_due_now_helper_deposit_refundable_until", {
|
|
274
|
+
percent: $,
|
|
275
|
+
date: Ut
|
|
276
|
+
}) : f("checkout_payment_due_now_helper_deposit", { percent: $ }) : y.paymentMode === "none" || Q <= 0 ? f("checkout_payment_due_now_helper_none") : null : null, [
|
|
278
277
|
Q,
|
|
279
278
|
$,
|
|
279
|
+
Ut,
|
|
280
280
|
y,
|
|
281
281
|
f
|
|
282
|
-
]), Gt =
|
|
283
|
-
if (!g ||
|
|
282
|
+
]), Gt = Ot.handleSubmit(async (e) => {
|
|
283
|
+
if (!g || V.length === 0 || !P || Qe.current) return;
|
|
284
284
|
Ze(!0), Qe.current = !0;
|
|
285
285
|
let t = qe();
|
|
286
286
|
try {
|
|
287
|
-
let n = await a(
|
|
287
|
+
let n = await a(ae, {
|
|
288
288
|
storeSlug: g,
|
|
289
289
|
checkoutSessionId: t.checkoutSessionId,
|
|
290
290
|
replacesCheckoutSessionId: t.replacesCheckoutSessionId,
|
|
@@ -292,8 +292,8 @@ function f() {
|
|
|
292
292
|
fulfillment: N.fulfillment,
|
|
293
293
|
startAddress: N.fulfillment === "delivery" ? N.start_address : void 0,
|
|
294
294
|
endAddress: N.fulfillment === "delivery" ? N.end_address : void 0,
|
|
295
|
-
couponCode:
|
|
296
|
-
couponAutoApplied: !A &&
|
|
295
|
+
couponCode: S?.code,
|
|
296
|
+
couponAutoApplied: !A && S?.autoApplied,
|
|
297
297
|
insuranceAccepted: W,
|
|
298
298
|
customer: {
|
|
299
299
|
firstName: e.first_name,
|
|
@@ -302,19 +302,19 @@ function f() {
|
|
|
302
302
|
phone: e.phone,
|
|
303
303
|
notes: e.notes
|
|
304
304
|
},
|
|
305
|
-
items:
|
|
306
|
-
}), r =
|
|
305
|
+
items: V
|
|
306
|
+
}), r = oe.parse(n);
|
|
307
307
|
if (!r.success || !r.checkout) {
|
|
308
|
-
Ye(),
|
|
308
|
+
Ye(), he.error(r.message || f("checkout_payment_error"));
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
|
-
r.checkout.requiresPayment ? Je(r.checkout.checkoutSessionId ?? t.checkoutSessionId) :
|
|
311
|
+
r.checkout.requiresPayment ? Je(r.checkout.checkoutSessionId ?? t.checkoutSessionId) : he.success(f("checkout_success_toast")), await He(r.checkout.nextPath), r.checkout.requiresPayment || Xe();
|
|
312
312
|
} catch (e) {
|
|
313
|
-
console.error("Failed to submit storefront checkout", e),
|
|
313
|
+
console.error("Failed to submit storefront checkout", e), he.error(f("checkout_payment_error"));
|
|
314
314
|
} finally {
|
|
315
315
|
Qe.current = !1, Ze(!1);
|
|
316
316
|
}
|
|
317
|
-
}), Kt = f(
|
|
317
|
+
}), Kt = f(Vt ? "checkout_continue_to_payment" : "checkout_submit"), qt = N.fulfillment === "delivery" && N.start_address.trim().length === 0, Jt = !v && !$e && !tt && !E && !ct && !!y && !!P && !qt && V.length > 0;
|
|
318
318
|
return L.lines.length === 0 ? /* @__PURE__ */ l("div", {
|
|
319
319
|
className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
|
|
320
320
|
children: /* @__PURE__ */ u("div", {
|
|
@@ -331,8 +331,8 @@ function f() {
|
|
|
331
331
|
/* @__PURE__ */ l("div", {
|
|
332
332
|
className: "mt-6",
|
|
333
333
|
children: /* @__PURE__ */ l(Oe, {
|
|
334
|
-
to:
|
|
335
|
-
children: /* @__PURE__ */ u(
|
|
334
|
+
to: J,
|
|
335
|
+
children: /* @__PURE__ */ u(fe, {
|
|
336
336
|
className: "gap-2",
|
|
337
337
|
children: [/* @__PURE__ */ l(Ne, {
|
|
338
338
|
className: "h-4 w-4",
|
|
@@ -343,138 +343,124 @@ function f() {
|
|
|
343
343
|
})
|
|
344
344
|
]
|
|
345
345
|
})
|
|
346
|
-
}) : /* @__PURE__ */ l(
|
|
347
|
-
|
|
346
|
+
}) : /* @__PURE__ */ l(_e, {
|
|
347
|
+
currentStep: "checkout",
|
|
348
|
+
bookingPath: J,
|
|
349
|
+
checkoutPath: Dt,
|
|
350
|
+
backPath: J,
|
|
351
|
+
backLabel: f("back_to_booking"),
|
|
348
352
|
children: /* @__PURE__ */ u("div", {
|
|
349
|
-
className: "
|
|
350
|
-
children: [
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
/* @__PURE__ */ u("div", {
|
|
365
|
-
className: "grid gap-6 lg:grid-cols-12",
|
|
366
|
-
children: [/* @__PURE__ */ u("div", {
|
|
367
|
-
className: "lg:col-span-7",
|
|
353
|
+
className: "grid gap-6 lg:grid-cols-12",
|
|
354
|
+
children: [/* @__PURE__ */ u("div", {
|
|
355
|
+
className: "lg:col-span-7",
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ l("h1", {
|
|
358
|
+
className: "text-xl font-semibold tracking-tight text-slate-950",
|
|
359
|
+
children: /* @__PURE__ */ l("span", { children: f("checkout_title") })
|
|
360
|
+
}),
|
|
361
|
+
P ? null : /* @__PURE__ */ l("p", {
|
|
362
|
+
role: "alert",
|
|
363
|
+
className: "mt-3 text-sm text-destructive",
|
|
364
|
+
children: /* @__PURE__ */ l("span", { children: f("booking_time_slots_required") })
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ u("div", {
|
|
367
|
+
className: "mt-5 grid gap-4",
|
|
368
368
|
children: [
|
|
369
|
-
/* @__PURE__ */ l("
|
|
370
|
-
className: "
|
|
371
|
-
children: /* @__PURE__ */ l(
|
|
369
|
+
mt ? /* @__PURE__ */ l("div", {
|
|
370
|
+
className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
371
|
+
children: /* @__PURE__ */ l(ge, {
|
|
372
|
+
value: N.fulfillment,
|
|
373
|
+
onValueChange: (e) => Y({ fulfillment: e }),
|
|
374
|
+
pickupAddress: ht,
|
|
375
|
+
deliveryEnabled: M,
|
|
376
|
+
deliveryDisabledReason: pt,
|
|
377
|
+
startAddress: N.start_address,
|
|
378
|
+
onStartAddressChange: (e) => Y({ start_address: e }),
|
|
379
|
+
endAddress: N.end_address,
|
|
380
|
+
onEndAddressChange: (e) => Y({ end_address: e }),
|
|
381
|
+
showPickupAddressWhenPickupOnly: !1,
|
|
382
|
+
testIdPrefix: "storefront-checkout-fulfillment"
|
|
383
|
+
})
|
|
384
|
+
}) : null,
|
|
385
|
+
/* @__PURE__ */ l(Se, { form: Ot }),
|
|
386
|
+
U ? /* @__PURE__ */ l(we, {
|
|
387
|
+
accepted: W,
|
|
388
|
+
disabled: v || E,
|
|
389
|
+
dailyAmountLabel: d(wt, X, p.language),
|
|
390
|
+
totalAmountLabel: Rt,
|
|
391
|
+
billableDays: w?.insuranceBillableDays,
|
|
392
|
+
deductibleLabel: Tt > 0 ? d(Tt, X, p.language) : void 0,
|
|
393
|
+
onAcceptedChange: ut
|
|
394
|
+
}) : null,
|
|
395
|
+
/* @__PURE__ */ l(Ce, {
|
|
396
|
+
estimatedTotalLabel: kt,
|
|
397
|
+
couponCode: S?.code,
|
|
398
|
+
discountAmountLabel: At,
|
|
399
|
+
totalExcludingTaxLabel: Ft,
|
|
400
|
+
vatAmountLabel: It,
|
|
401
|
+
vatRateLabel: Lt,
|
|
402
|
+
insuranceAmountLabel: Rt,
|
|
403
|
+
depositAmountLabel: Bt,
|
|
404
|
+
amountToCollectMinor: Q,
|
|
405
|
+
amountToCollectLabel: zt,
|
|
406
|
+
paymentSummaryHelper: Wt,
|
|
407
|
+
paymentDecisionLoading: $e,
|
|
408
|
+
paymentDecisionError: tt,
|
|
409
|
+
canChoosePaymentMethod: !1,
|
|
410
|
+
showAmountDueNowRow: !0,
|
|
411
|
+
selectedPaymentMethod: "card",
|
|
412
|
+
submitting: v,
|
|
413
|
+
onSelectPaymentMethod: () => {}
|
|
372
414
|
}),
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
415
|
+
/* @__PURE__ */ l(fe, {
|
|
416
|
+
type: "button",
|
|
417
|
+
size: "lg",
|
|
418
|
+
onClick: () => {
|
|
419
|
+
Gt();
|
|
420
|
+
},
|
|
421
|
+
disabled: !Jt,
|
|
422
|
+
className: "mt-4 w-fit",
|
|
423
|
+
children: /* @__PURE__ */ l("span", { children: Kt })
|
|
377
424
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
-
className: "
|
|
380
|
-
children:
|
|
381
|
-
|
|
382
|
-
className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
383
|
-
children: /* @__PURE__ */ l(ye, {
|
|
384
|
-
value: N.fulfillment,
|
|
385
|
-
onValueChange: (e) => J({ fulfillment: e }),
|
|
386
|
-
pickupAddress: ht,
|
|
387
|
-
deliveryEnabled: M,
|
|
388
|
-
deliveryDisabledReason: pt,
|
|
389
|
-
startAddress: N.start_address,
|
|
390
|
-
onStartAddressChange: (e) => J({ start_address: e }),
|
|
391
|
-
endAddress: N.end_address,
|
|
392
|
-
onEndAddressChange: (e) => J({ end_address: e }),
|
|
393
|
-
showPickupAddressWhenPickupOnly: !1,
|
|
394
|
-
testIdPrefix: "storefront-checkout-fulfillment"
|
|
395
|
-
})
|
|
396
|
-
}) : null,
|
|
397
|
-
/* @__PURE__ */ l(Se, { form: kt }),
|
|
398
|
-
U ? /* @__PURE__ */ l(we, {
|
|
399
|
-
accepted: W,
|
|
400
|
-
disabled: v || at,
|
|
401
|
-
dailyAmountLabel: d(wt, Y, p.language),
|
|
402
|
-
totalAmountLabel: zt,
|
|
403
|
-
billableDays: E?.insuranceBillableDays,
|
|
404
|
-
deductibleLabel: Tt > 0 ? d(Tt, Y, p.language) : void 0,
|
|
405
|
-
onAcceptedChange: ut
|
|
406
|
-
}) : null,
|
|
407
|
-
/* @__PURE__ */ l(Ce, {
|
|
408
|
-
estimatedTotalLabel: At,
|
|
409
|
-
couponCode: w?.code,
|
|
410
|
-
discountAmountLabel: jt,
|
|
411
|
-
totalExcludingTaxLabel: It,
|
|
412
|
-
vatAmountLabel: Lt,
|
|
413
|
-
vatRateLabel: Rt,
|
|
414
|
-
insuranceAmountLabel: zt,
|
|
415
|
-
depositAmountLabel: Vt,
|
|
416
|
-
amountToCollectMinor: Z,
|
|
417
|
-
amountToCollectLabel: Bt,
|
|
418
|
-
paymentSummaryHelper: Wt,
|
|
419
|
-
paymentDecisionLoading: $e,
|
|
420
|
-
paymentDecisionError: et,
|
|
421
|
-
canChoosePaymentMethod: !1,
|
|
422
|
-
showAmountDueNowRow: !0,
|
|
423
|
-
selectedPaymentMethod: "card",
|
|
424
|
-
submitting: v,
|
|
425
|
-
onSelectPaymentMethod: () => {}
|
|
426
|
-
}),
|
|
427
|
-
/* @__PURE__ */ l(me, {
|
|
428
|
-
type: "button",
|
|
429
|
-
size: "lg",
|
|
430
|
-
onClick: () => {
|
|
431
|
-
Gt();
|
|
432
|
-
},
|
|
433
|
-
disabled: !Jt,
|
|
434
|
-
className: "mt-4 w-fit",
|
|
435
|
-
children: /* @__PURE__ */ l("span", { children: Kt })
|
|
436
|
-
}),
|
|
437
|
-
qt ? /* @__PURE__ */ l("p", {
|
|
438
|
-
className: "text-sm text-slate-600",
|
|
439
|
-
children: /* @__PURE__ */ l("span", { children: f("checkout_delivery_address_required") })
|
|
440
|
-
}) : null
|
|
441
|
-
]
|
|
442
|
-
})
|
|
425
|
+
qt ? /* @__PURE__ */ l("p", {
|
|
426
|
+
className: "text-sm text-slate-600",
|
|
427
|
+
children: /* @__PURE__ */ l("span", { children: f("checkout_delivery_address_required") })
|
|
428
|
+
}) : null
|
|
443
429
|
]
|
|
444
|
-
})
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
]
|
|
430
|
+
})
|
|
431
|
+
]
|
|
432
|
+
}), /* @__PURE__ */ l(Te, {
|
|
433
|
+
lines: St.lines,
|
|
434
|
+
itemCount: We,
|
|
435
|
+
totalPerBaseUnitMinor: St.totalPerBaseUnitMinor,
|
|
436
|
+
baseUnitLabel: gt,
|
|
437
|
+
estimatedTotalMinor: St.estimatedTotalMinor,
|
|
438
|
+
discountedEstimatedTotalMinor: G,
|
|
439
|
+
discountAmountMinor: K,
|
|
440
|
+
lateReturnSurchargeMinor: w?.lateReturnSurchargeMinor,
|
|
441
|
+
couponCode: S?.code,
|
|
442
|
+
durationInBaseUnitLabel: _t,
|
|
443
|
+
onQuantityChange: Ge,
|
|
444
|
+
onRemove: Ke,
|
|
445
|
+
coupon: {
|
|
446
|
+
code: rt,
|
|
447
|
+
appliedCode: S?.code,
|
|
448
|
+
discountLabel: S && K > 0 ? d(K, X, p.language) : null,
|
|
449
|
+
message: st,
|
|
450
|
+
error: ct,
|
|
451
|
+
loading: E,
|
|
452
|
+
disabled: v,
|
|
453
|
+
onCodeChange: (e) => {
|
|
454
|
+
it(e), k(null), O(null);
|
|
455
|
+
},
|
|
456
|
+
onApply: () => {
|
|
457
|
+
lt(!1), ot(rt.trim());
|
|
458
|
+
},
|
|
459
|
+
onRemove: () => {
|
|
460
|
+
it(""), ot(""), C(null), T(null), k(null), O(null), lt(!0);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
})]
|
|
478
464
|
})
|
|
479
465
|
});
|
|
480
466
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA2JA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAw4B/B"}
|