@loczer/storefront-sdk 0.185.0 → 0.187.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.
@@ -1,28 +1,28 @@
1
1
  import { applyBookingParamsToSearch as e, getBookingDurationLabel as t, getBookingDurationMinutes as n, getBookingParamsFromSearch as r, resolveBookingSearchParamsFromSessionStorage as i, writeBookingSearchParamsToSessionStorage as ee } from "../lib/booking.js";
2
2
  import { useStorefrontCart as te } from "../lib/cart.js";
3
3
  import { buildStorefrontCartSummary as ne } from "../lib/cartSummary.js";
4
- import { ROUTE as re, responseSchema as ie } from "../lib/checkoutSubmit.js";
5
- import { ROUTE as ae, buildStorefrontAvailabilityKey as oe, getStorefrontAvailabilityIssue as se, getValidStorefrontAvailabilitySchedule as ce, responseSchema as le } from "../lib/storefrontAvailability.js";
6
- import { Button as ue } from "../ui/button.js";
7
- import { BookingFlowSteps as de } from "../components/BookingFlowSteps/index.js";
8
- import { useStorefront as fe, useStorefrontProducts as pe } from "../StorefrontProvider.js";
9
- import { apiPost as a } from "../lib/apiCall.js";
10
- import { FulfillmentSection as me } from "../components/FulfillmentSection/index.js";
11
- import { ROUTE as he, responseSchema as ge } from "../lib/checkoutPaymentDecision.js";
12
- import { ROUTE as _e, responseSchema as ve } from "../lib/checkoutVerifyCoupon.js";
13
- import { CheckoutDetailsCard as ye } from "./checkout/components/CheckoutDetailsCard.js";
14
- import { CheckoutPaymentSummaryCard as be } from "./checkout/components/CheckoutPaymentSummaryCard.js";
15
- import { CheckoutSummaryColumn as xe } from "./checkout/components/CheckoutSummaryColumn.js";
16
- import { checkoutFormSchema as Se } from "./checkout/types.js";
17
- import { useEffect as o, useMemo as s, useState as c } from "react";
18
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
19
- import { toast as d } from "@rpcbase/client";
20
- import { Link as Ce, useNavigate as we, useParams as Te, useSearchParams as Ee } from "@rpcbase/router";
21
- import { useTranslation as De } from "react-i18next";
22
- import { ArrowLeft as Oe } from "lucide-react";
23
- import { useForm as ke, zodResolver as Ae } from "@rpcbase/form";
4
+ import { ROUTE as re, responseSchema as ie } from "../lib/checkoutPaymentDecision.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 a } from "../ui/button.js";
8
+ import { BookingFlowSteps as fe } from "../components/BookingFlowSteps/index.js";
9
+ import { useStorefront as pe, useStorefrontProducts as me } from "../StorefrontProvider.js";
10
+ import { apiPost as o } from "../lib/apiCall.js";
11
+ import { FulfillmentSection as he } from "../components/FulfillmentSection/index.js";
12
+ import { ROUTE as ge, responseSchema as _e } from "../lib/checkoutVerifyCoupon.js";
13
+ import { CheckoutDetailsCard as ve } from "./checkout/components/CheckoutDetailsCard.js";
14
+ import { CheckoutPaymentSummaryCard as ye } from "./checkout/components/CheckoutPaymentSummaryCard.js";
15
+ import { CheckoutSummaryColumn as be } from "./checkout/components/CheckoutSummaryColumn.js";
16
+ import { checkoutFormSchema as xe } from "./checkout/types.js";
17
+ import { useEffect as s, useMemo as c, useState as l } from "react";
18
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
19
+ import { toast as f } from "@rpcbase/client";
20
+ import { Link as Se, useNavigate as Ce, useParams as we, useSearchParams as Te } from "@rpcbase/router";
21
+ import { useTranslation as Ee } from "react-i18next";
22
+ import { ArrowLeft as De } from "lucide-react";
23
+ import { useForm as Oe, zodResolver as ke } from "@rpcbase/form";
24
24
  //#region src/pages/CheckoutPage.tsx
25
- var je = .2, Me = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), f = (e, t, n) => {
25
+ var Ae = .2, je = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), p = (e, t, n) => {
26
26
  try {
27
27
  return new Intl.NumberFormat(n, {
28
28
  style: "currency",
@@ -31,7 +31,7 @@ var je = .2, Me = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), f = (e,
31
31
  } catch {
32
32
  return `${(e / 100).toFixed(2)} ${t.toUpperCase()}`;
33
33
  }
34
- }, Ne = (e, t) => {
34
+ }, Me = (e, t) => {
35
35
  try {
36
36
  return new Intl.NumberFormat(t, {
37
37
  style: "percent",
@@ -41,7 +41,7 @@ var je = .2, Me = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), f = (e,
41
41
  } catch {
42
42
  return `${Math.round(e * 100)}%`;
43
43
  }
44
- }, Pe = (e, t, n) => {
44
+ }, Ne = (e, t, n) => {
45
45
  let r = {
46
46
  dateStyle: "medium",
47
47
  timeStyle: "short"
@@ -54,40 +54,40 @@ var je = .2, Me = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), f = (e,
54
54
  } catch {}
55
55
  return new Intl.DateTimeFormat(t, r).format(e);
56
56
  };
57
- function p() {
58
- let { t: p, i18n: m } = De(), { storefrontConfiguration: h } = fe(), g = h.workspace?.workspaceLanguage, { bikes: _, accessories: v } = pe(), { storeSlug: y } = Te(), [b, Fe] = Ee(), Ie = we(), { items: x, itemCount: Le, setQuantity: Re, removeItem: ze, clear: Be } = te(), [S, Ve] = c(!1), [C, w] = c(null), [He, T] = c(!1), [Ue, E] = c(null), We = b.get("coupon") ?? b.get("code") ?? "", [D, O] = c(We), [Ge, Ke] = c(We.trim()), [k, A] = c(null), [qe, j] = c(null), [Je, M] = c(!1), [Ye, N] = c(null), [Xe, P] = c(null), [F, Ze] = c(!1), Qe = s(() => i(b, y), [b, y]), I = h.settings.fulfillmentModes.includes("delivery"), $e = h.settings.deliveryDisabledReason.trim(), et = I || $e.length > 0, tt = h.shop.address?.trim() ?? "", L = s(() => {
57
+ function m() {
58
+ let { t: m, i18n: h } = Ee(), { storefrontConfiguration: g } = pe(), _ = g.workspace?.workspaceLanguage, { bikes: v, accessories: y } = me(), { storeSlug: b } = we(), [x, Pe] = Te(), Fe = Ce(), { items: Ie, itemCount: Le, setQuantity: Re, removeItem: ze, clear: Be } = te(), [S, Ve] = l(!1), [C, w] = l(null), [He, T] = l(!1), [Ue, E] = l(null), We = x.get("coupon") ?? x.get("code") ?? "", [D, O] = l(We), [Ge, Ke] = l(We.trim()), [k, A] = l(null), [qe, j] = l(null), [Je, M] = l(!1), [Ye, N] = l(null), [Xe, P] = l(null), [F, Ze] = l(!1), Qe = c(() => i(x, b), [x, b]), I = g.settings.fulfillmentModes.includes("delivery"), $e = g.settings.deliveryDisabledReason.trim(), et = I || $e.length > 0, tt = g.shop.address?.trim() ?? "", L = c(() => {
59
59
  let e = r(Qe);
60
60
  return e.fulfillment === "delivery" && !I ? {
61
61
  ...e,
62
62
  fulfillment: "pickup"
63
63
  } : e;
64
- }, [Qe, I]), nt = s(() => t(L), [L]), rt = s(() => n(L), [L]), it = s(() => Me(rt), [rt]), R = s(() => ne({
65
- items: x,
66
- language: m.language,
67
- fallbackLanguage: g,
64
+ }, [Qe, I]), nt = c(() => t(L), [L]), rt = c(() => n(L), [L]), it = c(() => je(rt), [rt]), R = c(() => ne({
65
+ items: Ie,
66
+ language: h.language,
67
+ fallbackLanguage: _,
68
68
  products: {
69
- bikes: _,
70
- accessories: v
69
+ bikes: v,
70
+ accessories: y
71
71
  },
72
72
  estimatedDays: it
73
73
  }), [
74
+ y,
74
75
  v,
75
- _,
76
76
  it,
77
- m.language,
78
- x,
79
- g
80
- ]), z = s(() => R.lines.map((e) => ({
77
+ h.language,
78
+ Ie,
79
+ _
80
+ ]), z = c(() => R.lines.map((e) => ({
81
81
  productId: e.checkoutProductId,
82
82
  productVariantId: e.productVariantId,
83
83
  quantity: e.quantity
84
- })), [R.lines]), [at, B] = c([]), [V, H] = c(!1);
85
- o(() => {
86
- if (!y || z.length === 0) {
84
+ })), [R.lines]), [at, B] = l([]), [V, H] = l(!1);
85
+ s(() => {
86
+ if (!b || z.length === 0) {
87
87
  B([]), H(!1);
88
88
  return;
89
89
  }
90
- let e = ce(L);
90
+ let e = ue(L);
91
91
  if (!e) {
92
92
  H(!1);
93
93
  return;
@@ -95,11 +95,11 @@ function p() {
95
95
  let t = !1;
96
96
  return H(!0), B([]), (async () => {
97
97
  try {
98
- let n = await a(ae, {
99
- storeSlug: y,
98
+ let n = await o(se, {
99
+ storeSlug: b,
100
100
  schedule: e,
101
101
  products: z
102
- }), r = le.parse(n);
102
+ }), r = de.parse(n);
103
103
  if (t) return;
104
104
  B(r.success ? r.availability ?? [] : []);
105
105
  } catch (e) {
@@ -117,12 +117,12 @@ function p() {
117
117
  L.start_date,
118
118
  L.start_time,
119
119
  z,
120
- y
120
+ b
121
121
  ]);
122
- let ot = s(() => new Map(at.map((e) => [oe(e.productId, e.productVariantId), e])), [at]), U = s(() => ({
122
+ let ot = c(() => new Map(at.map((e) => [ce(e.productId, e.productVariantId), e])), [at]), U = c(() => ({
123
123
  ...R,
124
124
  lines: R.lines.map((e) => {
125
- let t = ot.get(oe(e.checkoutProductId, e.productVariantId)), n = t ? se(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
125
+ let t = ot.get(ce(e.checkoutProductId, e.productVariantId)), n = t ? le(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
126
126
  return {
127
127
  ...e,
128
128
  insufficientCapacity: !V && n !== void 0,
@@ -133,13 +133,13 @@ function p() {
133
133
  ot,
134
134
  V,
135
135
  R
136
- ]), W = s(() => R.lines.map((e) => ({
136
+ ]), W = c(() => R.lines.map((e) => ({
137
137
  kind: e.kind,
138
138
  productId: e.checkoutProductId,
139
139
  productVariantId: e.productVariantId,
140
140
  quantity: e.quantity
141
- })), [R.lines]), st = R.estimatedTotalMinor ?? R.totalPerDayMinor, G = qe?.totalMinor ?? st, K = k?.discountAmountMinor ?? 0, q = e(new URLSearchParams(), L).toString(), J = `/${y ?? ""}/booking${q ? `?${q}` : ""}`, ct = `/${y ?? ""}/checkout${q ? `?${q}` : ""}`, lt = ke({
142
- resolver: Ae(Se),
141
+ })), [R.lines]), st = R.estimatedTotalMinor ?? R.totalPerDayMinor, G = qe?.totalMinor ?? st, K = k?.discountAmountMinor ?? 0, q = e(new URLSearchParams(), L).toString(), J = `/${b ?? ""}/booking${q ? `?${q}` : ""}`, ct = `/${b ?? ""}/checkout${q ? `?${q}` : ""}`, lt = Oe({
142
+ resolver: ke(xe),
143
143
  defaultValues: {
144
144
  full_name: "",
145
145
  email: "",
@@ -147,26 +147,26 @@ function p() {
147
147
  notes: ""
148
148
  }
149
149
  });
150
- o(() => {
151
- ee(y, L);
152
- }, [L, y]);
150
+ s(() => {
151
+ ee(b, L);
152
+ }, [L, b]);
153
153
  let Y = (t) => {
154
154
  let n = {
155
155
  ...L,
156
156
  ...t
157
- }, r = e(b, n);
158
- Fe(r, { replace: !0 }), ee(y, r);
157
+ }, r = e(x, n);
158
+ Pe(r, { replace: !0 }), ee(b, r);
159
159
  };
160
- o(() => {
161
- if (!y || W.length === 0) {
160
+ s(() => {
161
+ if (!b || W.length === 0) {
162
162
  A(null), j(null), M(!1), N(null), P(null);
163
163
  return;
164
164
  }
165
165
  let e = Ge.trim(), t = e.length === 0 && !F, n = !1;
166
166
  return M(!0), P(null), N(null), (async () => {
167
167
  try {
168
- let r = await a(_e, {
169
- storeSlug: y,
168
+ let r = await o(ge, {
169
+ storeSlug: b,
170
170
  schedule: {
171
171
  startDate: L.start_date,
172
172
  endDate: L.end_date,
@@ -176,20 +176,20 @@ function p() {
176
176
  items: W,
177
177
  couponCode: e || void 0,
178
178
  includeAutoApply: t
179
- }), i = ve.parse(r);
179
+ }), i = _e.parse(r);
180
180
  if (n) return;
181
181
  if (j(typeof i.subtotalMinor == "number" && typeof i.totalMinor == "number" ? {
182
182
  subtotalMinor: i.subtotalMinor,
183
183
  totalMinor: i.totalMinor,
184
184
  lateReturnSurchargeMinor: i.lateReturnSurchargeMinor
185
185
  } : null), !i.success) {
186
- A(null), P(i.message || p("checkout_coupon_invalid"));
186
+ A(null), P(i.message || m("checkout_coupon_invalid"));
187
187
  return;
188
188
  }
189
- A(i.coupon ?? null), i.coupon && (i.coupon.autoApplied && e.length === 0 ? (O(i.coupon.code), N(p("checkout_coupon_auto_applied", { code: i.coupon.code }))) : N(p("checkout_coupon_manual_applied")));
189
+ A(i.coupon ?? null), i.coupon && (i.coupon.autoApplied && e.length === 0 ? (O(i.coupon.code), N(m("checkout_coupon_auto_applied", { code: i.coupon.code }))) : N(m("checkout_coupon_manual_applied")));
190
190
  } catch (e) {
191
191
  if (n) return;
192
- console.error("Failed to verify checkout coupon", e), A(null), j(null), P(p("checkout_coupon_error"));
192
+ console.error("Failed to verify checkout coupon", e), A(null), j(null), P(m("checkout_coupon_error"));
193
193
  } finally {
194
194
  n || M(!1);
195
195
  }
@@ -203,19 +203,19 @@ function p() {
203
203
  L.start_date,
204
204
  L.start_time,
205
205
  W,
206
- y,
206
+ b,
207
207
  Ge,
208
- p
209
- ]), o(() => {
210
- if (!y || R.lines.length === 0) {
208
+ m
209
+ ]), s(() => {
210
+ if (!b || R.lines.length === 0) {
211
211
  w(null), E(null), T(!1);
212
212
  return;
213
213
  }
214
214
  let e = !1;
215
215
  return T(!0), E(null), (async () => {
216
216
  try {
217
- let t = await a(he, {
218
- storeSlug: y,
217
+ let t = await o(re, {
218
+ storeSlug: b,
219
219
  schedule: {
220
220
  startDate: L.start_date,
221
221
  endDate: L.end_date,
@@ -223,16 +223,16 @@ function p() {
223
223
  endTime: L.end_time
224
224
  },
225
225
  estimatedTotalMinor: G
226
- }), n = ge.parse(t);
226
+ }), n = ie.parse(t);
227
227
  if (e) return;
228
228
  if (!n.success || !n.decision) {
229
- w(null), E(n.message || p("checkout_payment_error"));
229
+ w(null), E(n.errorCode === "online_payment_provider_missing" ? m("checkout_payment_error") : n.message || m("checkout_payment_error"));
230
230
  return;
231
231
  }
232
232
  w(n.decision);
233
233
  } catch (t) {
234
234
  if (e) return;
235
- console.error("Failed to load checkout payment decision", t), w(null), E(p("checkout_payment_error"));
235
+ console.error("Failed to load checkout payment decision", t), w(null), E(m("checkout_payment_error"));
236
236
  } finally {
237
237
  e || T(!1);
238
238
  }
@@ -246,32 +246,32 @@ function p() {
246
246
  L.start_time,
247
247
  G,
248
248
  R.lines.length,
249
- y,
250
- p
249
+ b,
250
+ m
251
251
  ]);
252
- let X = C?.currency ?? "EUR", ut = f(G, X, m.language), dt = K > 0 ? `-${f(K, X, m.language)}` : null, ft = Math.round(G / 1.2), pt = Math.max(0, G - ft), mt = f(ft, X, m.language), ht = f(pt, X, m.language), gt = Ne(je, m.language), Z = C?.amountToCollectMinor ?? 0, _t = f(Z, X, m.language), vt = C?.paymentMode === "deposit" && Z > 0 ? f(Z, X, m.language) : null, yt = C?.shouldCollectOnlinePayment === !0 && Z > 0, bt = h.shop.timeZone?.trim() || void 0, Q = s(() => C ? Ne(Math.max(0, Math.min(1, C.bookingDepositPercentage)), m.language) : null, [m.language, C]), $ = s(() => {
252
+ let X = C?.currency ?? "EUR", ut = p(G, X, h.language), dt = K > 0 ? `-${p(K, X, h.language)}` : null, ft = Math.round(G / 1.2), pt = Math.max(0, G - ft), mt = p(ft, X, h.language), ht = p(pt, X, h.language), gt = Me(Ae, h.language), Z = C?.amountToCollectMinor ?? 0, _t = p(Z, X, h.language), vt = C?.paymentMode === "deposit" && Z > 0 ? p(Z, X, h.language) : null, yt = C?.shouldCollectOnlinePayment === !0 && Z > 0, bt = g.shop.timeZone?.trim() || void 0, Q = c(() => C ? Me(Math.max(0, Math.min(1, C.bookingDepositPercentage)), h.language) : null, [h.language, C]), $ = c(() => {
253
253
  if (!C?.depositRefundableUntilIso) return null;
254
254
  let e = new Date(C.depositRefundableUntilIso);
255
- return Number.isNaN(e.getTime()) ? null : Pe(e, m.language, bt);
255
+ return Number.isNaN(e.getTime()) ? null : Ne(e, h.language, bt);
256
256
  }, [
257
- m.language,
257
+ h.language,
258
258
  C?.depositRefundableUntilIso,
259
259
  bt
260
- ]), xt = s(() => C ? C.paymentMode === "deposit" && Z > 0 && Q ? $ ? p("checkout_payment_due_now_helper_deposit_refundable_until", {
260
+ ]), xt = c(() => C ? C.paymentMode === "deposit" && Z > 0 && Q ? $ ? m("checkout_payment_due_now_helper_deposit_refundable_until", {
261
261
  percent: Q,
262
262
  date: $
263
- }) : p("checkout_payment_due_now_helper_deposit", { percent: Q }) : C.paymentMode === "none" || Z <= 0 ? p("checkout_payment_due_now_helper_none") : null : null, [
263
+ }) : m("checkout_payment_due_now_helper_deposit", { percent: Q }) : C.paymentMode === "none" || Z <= 0 ? m("checkout_payment_due_now_helper_none") : null : null, [
264
264
  Z,
265
265
  Q,
266
266
  $,
267
267
  C,
268
- p
268
+ m
269
269
  ]), St = lt.handleSubmit(async (e) => {
270
- if (!(!y || W.length === 0)) {
270
+ if (!(!b || W.length === 0)) {
271
271
  Ve(!0);
272
272
  try {
273
- let t = await a(re, {
274
- storeSlug: y,
273
+ let t = await o(ae, {
274
+ storeSlug: b,
275
275
  schedule: {
276
276
  startDate: L.start_date,
277
277
  endDate: L.end_date,
@@ -290,78 +290,78 @@ function p() {
290
290
  notes: e.notes
291
291
  },
292
292
  items: W
293
- }), n = ie.parse(t);
293
+ }), n = oe.parse(t);
294
294
  if (!n.success || !n.checkout) {
295
- d.error(n.message || p("checkout_payment_error"));
295
+ f.error(n.errorCode === "online_payment_provider_missing" ? m("checkout_payment_error") : n.message || m("checkout_payment_error"));
296
296
  return;
297
297
  }
298
- n.checkout.requiresPayment || d.success(p("checkout_success_toast")), await Ie(n.checkout.nextPath), Be();
298
+ n.checkout.requiresPayment || f.success(m("checkout_success_toast")), await Fe(n.checkout.nextPath), Be();
299
299
  } catch (e) {
300
- console.error("Failed to submit storefront checkout", e), d.error(p("checkout_payment_error"));
300
+ console.error("Failed to submit storefront checkout", e), f.error(m("checkout_payment_error"));
301
301
  } finally {
302
302
  Ve(!1);
303
303
  }
304
304
  }
305
- }), Ct = p(yt ? "checkout_continue_to_payment" : "checkout_submit"), wt = L.fulfillment === "delivery" && L.start_address.trim().length === 0, Tt = !S && !He && !Ue && !Je && !Xe && !!C && !wt && W.length > 0;
306
- return R.lines.length === 0 ? /* @__PURE__ */ l("div", {
305
+ }), Ct = m(yt ? "checkout_continue_to_payment" : "checkout_submit"), wt = L.fulfillment === "delivery" && L.start_address.trim().length === 0, Tt = !S && !He && !Ue && !Je && !Xe && !!C && !wt && W.length > 0;
306
+ return R.lines.length === 0 ? /* @__PURE__ */ u("div", {
307
307
  className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
308
- children: /* @__PURE__ */ u("div", {
308
+ children: /* @__PURE__ */ d("div", {
309
309
  className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
310
310
  children: [
311
- /* @__PURE__ */ l("h1", {
311
+ /* @__PURE__ */ u("h1", {
312
312
  className: "text-xl font-semibold tracking-tight text-slate-950",
313
- children: /* @__PURE__ */ l("span", { children: p("cart_empty_title") })
313
+ children: /* @__PURE__ */ u("span", { children: m("cart_empty_title") })
314
314
  }),
315
- /* @__PURE__ */ l("p", {
315
+ /* @__PURE__ */ u("p", {
316
316
  className: "mt-2 text-sm text-slate-600",
317
- children: /* @__PURE__ */ l("span", { children: p("cart_empty_description") })
317
+ children: /* @__PURE__ */ u("span", { children: m("cart_empty_description") })
318
318
  }),
319
- /* @__PURE__ */ l("div", {
319
+ /* @__PURE__ */ u("div", {
320
320
  className: "mt-6",
321
- children: /* @__PURE__ */ l(Ce, {
321
+ children: /* @__PURE__ */ u(Se, {
322
322
  to: J,
323
- children: /* @__PURE__ */ u(ue, {
323
+ children: /* @__PURE__ */ d(a, {
324
324
  className: "gap-2",
325
- children: [/* @__PURE__ */ l(Oe, {
325
+ children: [/* @__PURE__ */ u(De, {
326
326
  className: "h-4 w-4",
327
327
  "aria-hidden": "true"
328
- }), /* @__PURE__ */ l("span", { children: p("back_to_booking") })]
328
+ }), /* @__PURE__ */ u("span", { children: m("back_to_booking") })]
329
329
  })
330
330
  })
331
331
  })
332
332
  ]
333
333
  })
334
- }) : /* @__PURE__ */ l("div", {
334
+ }) : /* @__PURE__ */ u("div", {
335
335
  className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
336
- children: /* @__PURE__ */ u("div", {
336
+ children: /* @__PURE__ */ d("div", {
337
337
  className: "flex flex-col gap-6",
338
338
  children: [
339
- /* @__PURE__ */ l(de, {
339
+ /* @__PURE__ */ u(fe, {
340
340
  currentStep: "checkout",
341
341
  bookingPath: J,
342
342
  checkoutPath: ct
343
343
  }),
344
- /* @__PURE__ */ u(Ce, {
344
+ /* @__PURE__ */ d(Se, {
345
345
  to: J,
346
346
  className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950",
347
- children: [/* @__PURE__ */ l(Oe, {
347
+ children: [/* @__PURE__ */ u(De, {
348
348
  className: "h-4 w-4",
349
349
  "aria-hidden": "true"
350
- }), /* @__PURE__ */ l("span", { children: p("back_to_booking") })]
350
+ }), /* @__PURE__ */ u("span", { children: m("back_to_booking") })]
351
351
  }),
352
- /* @__PURE__ */ u("div", {
352
+ /* @__PURE__ */ d("div", {
353
353
  className: "grid gap-6 lg:grid-cols-12",
354
- children: [/* @__PURE__ */ u("div", {
354
+ children: [/* @__PURE__ */ d("div", {
355
355
  className: "lg:col-span-7",
356
- children: [/* @__PURE__ */ l("h1", {
356
+ children: [/* @__PURE__ */ u("h1", {
357
357
  className: "text-xl font-semibold tracking-tight text-slate-950",
358
- children: /* @__PURE__ */ l("span", { children: p("checkout_title") })
359
- }), /* @__PURE__ */ u("div", {
358
+ children: /* @__PURE__ */ u("span", { children: m("checkout_title") })
359
+ }), /* @__PURE__ */ d("div", {
360
360
  className: "mt-5 grid gap-4",
361
361
  children: [
362
- et ? /* @__PURE__ */ l("div", {
362
+ et ? /* @__PURE__ */ u("div", {
363
363
  className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
364
- children: /* @__PURE__ */ l(me, {
364
+ children: /* @__PURE__ */ u(he, {
365
365
  value: L.fulfillment,
366
366
  onValueChange: (e) => Y({ fulfillment: e }),
367
367
  pickupAddress: tt,
@@ -375,8 +375,8 @@ function p() {
375
375
  testIdPrefix: "storefront-checkout-fulfillment"
376
376
  })
377
377
  }) : null,
378
- /* @__PURE__ */ l(ye, { form: lt }),
379
- /* @__PURE__ */ l(be, {
378
+ /* @__PURE__ */ u(ve, { form: lt }),
379
+ /* @__PURE__ */ u(ye, {
380
380
  estimatedTotalLabel: ut,
381
381
  couponCode: k?.code,
382
382
  discountAmountLabel: dt,
@@ -395,7 +395,7 @@ function p() {
395
395
  submitting: S,
396
396
  onSelectPaymentMethod: () => {}
397
397
  }),
398
- /* @__PURE__ */ l(ue, {
398
+ /* @__PURE__ */ u(a, {
399
399
  type: "button",
400
400
  size: "lg",
401
401
  onClick: () => {
@@ -403,15 +403,15 @@ function p() {
403
403
  },
404
404
  disabled: !Tt,
405
405
  className: "mt-4 w-fit",
406
- children: /* @__PURE__ */ l("span", { children: Ct })
406
+ children: /* @__PURE__ */ u("span", { children: Ct })
407
407
  }),
408
- wt ? /* @__PURE__ */ l("p", {
408
+ wt ? /* @__PURE__ */ u("p", {
409
409
  className: "text-sm text-slate-600",
410
- children: /* @__PURE__ */ l("span", { children: p("checkout_delivery_address_required") })
410
+ children: /* @__PURE__ */ u("span", { children: m("checkout_delivery_address_required") })
411
411
  }) : null
412
412
  ]
413
413
  })]
414
- }), /* @__PURE__ */ l(xe, {
414
+ }), /* @__PURE__ */ u(be, {
415
415
  lines: U.lines,
416
416
  itemCount: Le,
417
417
  totalPerDayMinor: U.totalPerDayMinor,
@@ -427,7 +427,7 @@ function p() {
427
427
  coupon: {
428
428
  code: D,
429
429
  appliedCode: k?.code,
430
- discountLabel: k && K > 0 ? f(K, X, m.language) : null,
430
+ discountLabel: k && K > 0 ? p(K, X, h.language) : null,
431
431
  message: Ye,
432
432
  error: Xe,
433
433
  loading: Je,
@@ -449,4 +449,4 @@ function p() {
449
449
  });
450
450
  }
451
451
  //#endregion
452
- export { p as default };
452
+ export { m as default };
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA6GA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CA8qB/B"}
1
+ {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA8GA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAwrB/B"}