@loczer/storefront-sdk 0.230.0 → 0.232.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/StorefrontContext.d.ts +0 -2
  2. package/dist/StorefrontContext.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.d.ts +0 -1
  4. package/dist/StorefrontProvider.d.ts.map +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-C9kJFMIu.js → base-booking-BJXFzDM5.js} +0 -2
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-epi7FXIk.js → cart-inputs-3lBblkB0.js} +0 -10
  7. package/dist/chunks/pkg/booking-engine/dist/{schemas-DW5gdDYz.js → schemas-JjiUWFIv.js} +2 -2
  8. package/dist/chunks/pkg/ui/dist/LanguagePicker/index-D7_3voTe.js +83 -0
  9. package/dist/components/BookingBikeQuickAddCard/index.d.ts +3 -1
  10. package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -1
  11. package/dist/components/BookingBikeQuickAddCard/index.js +94 -85
  12. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
  13. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
  14. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
  15. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
  16. package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
  17. package/dist/components/ContractSaleDocument/InvoiceDetails.js +62 -56
  18. package/dist/components/Footer/businessHoursStatus.js +1 -1
  19. package/dist/components/Header/index.d.ts.map +1 -1
  20. package/dist/components/Header/index.js +56 -56
  21. package/dist/components/LanguageSelector/index.d.ts.map +1 -1
  22. package/dist/components/LanguageSelector/index.js +19 -64
  23. package/dist/components/StorefrontCartPanel/index.js +1 -1
  24. package/dist/i18n/en.d.ts +2 -4
  25. package/dist/i18n/en.d.ts.map +1 -1
  26. package/dist/i18n/en.js +3 -5
  27. package/dist/i18n/fr.d.ts +2 -4
  28. package/dist/i18n/fr.d.ts.map +1 -1
  29. package/dist/i18n/fr.js +4 -6
  30. package/dist/index.d.ts +17 -35
  31. package/dist/index.js +3 -3
  32. package/dist/lib/booking-period.js +1 -1
  33. package/dist/lib/booking.d.ts +6 -6
  34. package/dist/lib/booking.d.ts.map +1 -1
  35. package/dist/lib/booking.js +21 -21
  36. package/dist/lib/cart.d.ts +1 -0
  37. package/dist/lib/cart.d.ts.map +1 -1
  38. package/dist/lib/cart.js +2 -0
  39. package/dist/lib/checkoutSubmit.d.ts +2 -6
  40. package/dist/lib/checkoutSubmit.d.ts.map +1 -1
  41. package/dist/lib/checkoutSubmit.js +3 -11
  42. package/dist/lib/pricing.js +1 -1
  43. package/dist/lib/storefrontAvailability.d.ts +12 -8
  44. package/dist/lib/storefrontAvailability.d.ts.map +1 -1
  45. package/dist/lib/storefrontAvailability.js +17 -7
  46. package/dist/pages/BookingPage.d.ts.map +1 -1
  47. package/dist/pages/BookingPage.js +236 -238
  48. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  49. package/dist/pages/CheckoutPage.js +127 -125
  50. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  51. package/dist/pages/ContractSaleDocumentPage.js +117 -171
  52. package/dist/pages/HomePage.js +8 -8
  53. package/dist/pages/ProductPage.d.ts.map +1 -1
  54. package/dist/pages/ProductPage.js +187 -181
  55. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  56. package/dist/pages/checkout/components/CheckoutDetailsCard.js +4 -17
  57. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts +7 -0
  58. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts.map +1 -0
  59. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.js +105 -0
  60. package/dist/pages/checkout/types.d.ts +1 -2
  61. package/dist/pages/checkout/types.d.ts.map +1 -1
  62. package/dist/pages/checkout/types.js +1 -2
  63. package/dist/storefront.css +1 -1
  64. package/dist/storefrontSchemas.d.ts +0 -2
  65. package/dist/storefrontSchemas.d.ts.map +1 -1
  66. package/dist/storefrontSchemas.js +1 -2
  67. package/package.json +1 -1
  68. package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-j1CgFGLe.js → MorphingModalWizard-Q8O5Rjfq.js} +1 -1
@@ -1,293 +1,299 @@
1
1
  import { getBookingParamsFromSearch as e, pickBookingSearchParams as t, resolveBookingSearchParamsFromSessionStorage as n, writeBookingSearchParamsToSessionStorage as r } from "../lib/booking.js";
2
2
  import { getProductVariantAttributeValue as i, getStorefrontProductVariantDisplay as ee } from "../lib/productVariants.js";
3
3
  import { getLocalizedValue as a } from "../localization.js";
4
- import { findStorefrontProductBySlug as o, getStorefrontCheckoutProductId as s, getStorefrontProductSelectionDisplayName as te } from "../lib/products.js";
5
- import { useStorefrontCart as ne } from "../lib/cart.js";
6
- import { getAvailabilityVariant as re } from "../lib/utils.js";
7
- import { ROUTE as ie, buildStorefrontAvailabilityKey as c, getStorefrontAvailabilityIssue as l, getStorefrontAvailabilityStatus as ae, getValidStorefrontAvailabilitySchedule as oe, isStorefrontAvailabilityInsufficient as u, responseSchema as se } from "../lib/storefrontAvailability.js";
8
- import { Badge as ce } from "../ui/badge.js";
9
- import { Button as d } from "../ui/button.js";
10
- import { useStorefront as le, useStorefrontProducts as ue } from "../StorefrontContext.js";
11
- import { toast as de } from "../lib/toast.js";
12
- import { Input as fe } from "../ui/input.js";
13
- import { Card as pe } from "../ui/card.js";
14
- import { ProductWarningNotice as me } from "../components/ProductWarningNotice/index.js";
15
- import { ProductPriceBadge as he } from "../components/ProductPriceBadge/index.js";
16
- import { resolveProductImageContainerStyle as ge } from "../lib/productImageStyles.js";
17
- import { apiPost as _e } from "../lib/apiCall.js";
18
- import { RadioGroup as ve, RadioGroupItem as ye } from "../ui/radio-group.js";
19
- import { useEffect as f, useMemo as p, useState as m } from "react";
20
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
21
- import { Link as be, useLocation as xe, useNavigate as Se, useParams as Ce, useSearchParams as we } from "@rpcbase/router";
22
- import { useTranslation as Te } from "react-i18next";
4
+ import { findStorefrontProductBySlug as te, getStorefrontCheckoutProductId as o, getStorefrontProductSelectionDisplayName as ne } from "../lib/products.js";
5
+ import { useStorefrontCart as re } from "../lib/cart.js";
6
+ import { getAvailabilityVariant as ie } from "../lib/utils.js";
7
+ import { ROUTE as ae, buildStorefrontAvailabilityKey as s, getStorefrontAvailabilityIssue as oe, getStorefrontAvailabilityStatus as c, getStorefrontProductAvailabilityStatus as se, getValidStorefrontAvailabilitySchedule as ce, isStorefrontAvailabilityInsufficient as le, responseSchema as ue } from "../lib/storefrontAvailability.js";
8
+ import { Badge as l } from "../ui/badge.js";
9
+ import { Button as u } from "../ui/button.js";
10
+ import { useStorefront as de, useStorefrontProducts as fe } from "../StorefrontContext.js";
11
+ import { toast as pe } from "../lib/toast.js";
12
+ import { Input as me } from "../ui/input.js";
13
+ import { Card as he } from "../ui/card.js";
14
+ import { ProductWarningNotice as ge } from "../components/ProductWarningNotice/index.js";
15
+ import { ProductPriceBadge as _e } from "../components/ProductPriceBadge/index.js";
16
+ import { resolveProductImageContainerStyle as ve } from "../lib/productImageStyles.js";
17
+ import { apiPost as ye } from "../lib/apiCall.js";
18
+ import { RadioGroup as be, RadioGroupItem as xe } from "../ui/radio-group.js";
19
+ import { useEffect as d, useMemo as f, useState as p } from "react";
20
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
21
+ import { Link as g, useLocation as Se, useNavigate as Ce, useParams as we, useSearchParams as Te } from "@rpcbase/router";
22
+ import { useTranslation as Ee } from "react-i18next";
23
23
  import { cn as _ } from "@rpcbase/ui";
24
- import { ArrowLeft as v, ArrowRight as y, Bike as Ee, CheckCircle2 as De, Plus as Oe } from "lucide-react";
24
+ import { ArrowLeft as v, ArrowRight as y, Bike as De, CheckCircle2 as Oe, Plus as ke } from "lucide-react";
25
25
  //#region src/pages/ProductPage.tsx
26
26
  var b = (e, t = () => !0) => {
27
27
  if (!e) return null;
28
28
  if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
29
29
  let n = e.productVariants ?? [];
30
30
  return n.find((e) => t(e.id))?.id ?? n[0]?.id ?? null;
31
- }, ke = (e, t) => {
31
+ }, Ae = (e, t) => {
32
32
  if (!e) return [];
33
- let n = s(e), r = /* @__PURE__ */ new Map();
34
- r.set(c(n), {
33
+ let n = o(e), r = /* @__PURE__ */ new Map();
34
+ r.set(s(n), {
35
35
  productId: n,
36
36
  quantity: t
37
37
  });
38
- for (let i of e.productVariants ?? []) r.set(c(n, i.id), {
38
+ for (let i of e.productVariants ?? []) r.set(s(n, i.id), {
39
39
  productId: n,
40
40
  productVariantId: i.id,
41
41
  quantity: t
42
42
  });
43
43
  let i = e.representedVariantId?.trim();
44
- return i && r.set(c(n, i), {
44
+ return i && r.set(s(n, i), {
45
45
  productId: n,
46
46
  productVariantId: i,
47
47
  quantity: t
48
48
  }), Array.from(r.values());
49
- }, Ae = (e, t) => {
50
- let n = s(e), r = e.representedVariantId?.trim();
49
+ }, je = (e, t) => {
50
+ let n = o(e), r = e.representedVariantId?.trim();
51
51
  if (r) {
52
- let e = t.get(c(n, r));
52
+ let e = t.get(s(n, r));
53
53
  if (e) return e;
54
54
  }
55
- return t.get(c(n));
56
- }, je = (e, t, n) => n.get(c(s(e), t)), x = (e, t, n) => {
57
- let r = l(t);
58
- return r === "quantity_unavailable" ? e("availability_quantity_unavailable") : r === "unavailable" || n === "OUT_OF_STOCK" ? e("availability_out_of_stock") : t?.remaining === void 0 ? t?.fewRemaining || n === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock") : e("availability_remaining_count", { count: t.remaining });
55
+ return t.get(s(n));
56
+ }, x = (e, t, n) => n.get(s(o(e), t)), S = (e, t, n) => {
57
+ let r = oe(t);
58
+ return r === "quantityUnavailable" ? e("availability_quantity_unavailable") : r === "unavailable" || n === "OUT_OF_STOCK" ? e("availability_out_of_stock") : t?.remaining === void 0 ? t?.fewRemaining || n === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock") : e("availability_remaining_count", { count: t.remaining });
59
59
  }, Me = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
60
- function S() {
61
- let { t: l, i18n: S } = Te(), { storeSlug: C, productSlug: w } = Ce(), [Ne] = we(), Pe = xe(), Fe = Se(), { addItem: Ie, itemCount: T } = ne(), { storefrontConfiguration: Le } = le(), E = Le.workspace?.workspaceLanguage, { bikes: D, accessories: O } = ue(), k = p(() => w ? o(w, {
62
- bikes: D,
63
- accessories: O
60
+ function C() {
61
+ let { t: C, i18n: w } = Ee(), { storeSlug: T, productSlug: E } = we(), [Ne] = Te(), Pe = Se(), Fe = Ce(), { addItem: Ie, itemCount: D } = re(), { storefrontConfiguration: Le } = de(), O = Le.workspace?.workspaceLanguage, { bikes: k, accessories: A } = fe(), j = f(() => E ? te(E, {
62
+ bikes: k,
63
+ accessories: A
64
64
  }) : null, [
65
- O,
66
- D,
67
- w
68
- ]), A = t(Ne).toString(), j = p(() => n(new URLSearchParams(A), C), [A, C]), M = p(() => e(j, {
69
- start_time: "",
70
- end_time: ""
71
- }), [j]), N = p(() => oe(M), [M]), P = j.toString(), F = `/${C ?? ""}/checkout${P ? `?${P}` : ""}`, I = `/${C ?? ""}`, Re = I, L = Pe.state, ze = typeof L?.backTo == "string" && L.backTo.startsWith(I) ? L.backTo : Re, [R, z] = m(1), [B, V] = m(() => b(k)), H = Number.isFinite(R) ? Math.max(1, Math.min(99, Math.floor(R))) : 1, U = p(() => ke(k, H), [H, k]), [W, G] = m([]), [Be, K] = m(!1);
72
- f(() => {
73
- if (z(1), !k) {
74
- V(null);
65
+ A,
66
+ k,
67
+ E
68
+ ]), M = t(Ne).toString(), N = f(() => n(new URLSearchParams(M), T), [M, T]), P = f(() => e(N, {
69
+ startTime: "",
70
+ endTime: ""
71
+ }), [N]), F = f(() => ce(P), [P]), I = N.toString(), L = `/${T ?? ""}/checkout${I ? `?${I}` : ""}`, R = `/${T ?? ""}`, Re = R, z = Pe.state, ze = typeof z?.backTo == "string" && z.backTo.startsWith(R) ? z.backTo : Re, [B, V] = p(1), [H, U] = p(() => b(j)), W = Number.isFinite(B) ? Math.max(1, Math.min(99, Math.floor(B))) : 1, G = f(() => Ae(j, W), [W, j]), [K, q] = p([]), [Be, J] = p(!1);
72
+ d(() => {
73
+ if (V(1), !j) {
74
+ U(null);
75
75
  return;
76
76
  }
77
- V(b(k));
78
- }, [w, k]), f(() => {
79
- r(C, j);
80
- }, [j, C]), f(() => {
81
- if (!C || U.length === 0) {
82
- G([]), K(!1);
77
+ U(b(j));
78
+ }, [E, j]), d(() => {
79
+ r(T, N);
80
+ }, [N, T]), d(() => {
81
+ if (!T || G.length === 0) {
82
+ q([]), J(!1);
83
83
  return;
84
84
  }
85
- if (!N) {
86
- G([]), K(!1);
85
+ if (!F) {
86
+ q([]), J(!1);
87
87
  return;
88
88
  }
89
89
  let e = !1;
90
- return K(!0), G([]), (async () => {
90
+ return J(!0), q([]), (async () => {
91
91
  try {
92
- let t = await _e(ie, {
93
- storeSlug: C,
94
- schedule: N,
95
- products: U
96
- }), n = se.parse(t);
92
+ let t = await ye(ae, {
93
+ storeSlug: T,
94
+ schedule: F,
95
+ products: G
96
+ }), n = ue.parse(t);
97
97
  if (e) return;
98
- G(n.success ? n.availability ?? [] : []);
98
+ q(n.success ? n.availability ?? [] : []);
99
99
  } catch (t) {
100
100
  if (e) return;
101
- console.error("Failed to load storefront product availability", t), G([]);
101
+ console.error("Failed to load storefront product availability", t), q([]);
102
102
  } finally {
103
- e || K(!1);
103
+ e || J(!1);
104
104
  }
105
105
  })(), () => {
106
106
  e = !0;
107
107
  };
108
108
  }, [
109
- U,
110
- N,
111
- M.end_date,
112
- M.end_time,
113
- M.start_date,
114
- M.start_time,
115
- C
109
+ G,
110
+ F,
111
+ P.endDate,
112
+ P.endTime,
113
+ P.startDate,
114
+ P.startTime,
115
+ T
116
116
  ]);
117
- let q = p(() => new Map(W.map((e) => [c(e.productId, e.productVariantId), e])), [W]), J = () => {
117
+ let Y = f(() => new Map(K.map((e) => [s(e.productId, e.productVariantId), e])), [K]), Ve = () => {
118
118
  Fe(ze);
119
119
  };
120
- if (!k) return /* @__PURE__ */ h("div", {
120
+ if (!j) return /* @__PURE__ */ m("div", {
121
121
  className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
122
- children: /* @__PURE__ */ g("div", {
122
+ children: /* @__PURE__ */ h("div", {
123
123
  className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
124
124
  children: [
125
- /* @__PURE__ */ h("h1", {
125
+ /* @__PURE__ */ m("h1", {
126
126
  className: "text-xl font-semibold tracking-tight text-slate-950",
127
- children: /* @__PURE__ */ h("span", { children: l("product_not_found_title") })
127
+ children: /* @__PURE__ */ m("span", { children: C("product_not_found_title") })
128
128
  }),
129
- /* @__PURE__ */ h("p", {
129
+ /* @__PURE__ */ m("p", {
130
130
  className: "mt-2 text-sm text-slate-600",
131
- children: /* @__PURE__ */ h("span", { children: l("product_not_found_description") })
131
+ children: /* @__PURE__ */ m("span", { children: C("product_not_found_description") })
132
132
  }),
133
- /* @__PURE__ */ h("div", {
133
+ /* @__PURE__ */ m("div", {
134
134
  className: "mt-6",
135
- children: /* @__PURE__ */ g(d, {
135
+ children: /* @__PURE__ */ h(u, {
136
136
  type: "button",
137
137
  className: "gap-2",
138
- onClick: J,
139
- children: [/* @__PURE__ */ h(v, {
138
+ onClick: Ve,
139
+ children: [/* @__PURE__ */ m(v, {
140
140
  className: "h-4 w-4",
141
141
  "aria-hidden": "true"
142
- }), /* @__PURE__ */ h("span", { children: l("go_back") })]
142
+ }), /* @__PURE__ */ m("span", { children: C("go_back") })]
143
143
  })
144
144
  })
145
145
  ]
146
146
  })
147
147
  });
148
- let Y = a(k.name, S.language, E), Ve = a(k.description, S.language, E), He = a(k.warning, S.language, E), X = typeof k.images?.[0] == "string" ? k.images[0].trim() : "", Z = ge(k.primaryImageStyle), Q = Ae(k, q), Ue = Me(k), We = Q ? ae(Q) : Ue, Ge = re(We), Ke = Be ? l("availability_checking") : x(l, Q, We), qe = Q ? u(Q) : Ue === "OUT_OF_STOCK", $ = k.productVariants ?? [], Je = $.some((e) => !!i(e, "size")) ? l("product_size_label") : l("product_variant_label"), Ye = !!B && N !== null;
149
- return /* @__PURE__ */ h("div", {
148
+ let He = a(j.name, w.language, O), Ue = a(j.description, w.language, O), We = a(j.warning, w.language, O), Ge = typeof j.images?.[0] == "string" ? j.images[0].trim() : "", Ke = ve(j.primaryImageStyle), X = j.productVariants ?? [], Z = je(j, Y), Q = se({
149
+ availabilityByKey: Y,
150
+ fallbackStatus: Me(j),
151
+ productId: o(j),
152
+ productVariantIds: X.map((e) => e.id),
153
+ representedVariantId: j.representedVariantId
154
+ }), qe = Z ? c(Z) === Q : !1, Je = Q === "OUT_OF_STOCK" ? X.map((e) => x(j, e.id, Y)).find((e) => oe(e) === "quantityUnavailable") : void 0, Ye = ie(Q), Xe = Be ? C("availability_checking") : S(C, qe ? Z : Je, Q), $ = Q === "OUT_OF_STOCK", Ze = X.some((e) => !!i(e, "size")) ? C("product_size_label") : C("product_variant_label"), Qe = !!H && F !== null;
155
+ return /* @__PURE__ */ m("div", {
150
156
  className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
151
- children: /* @__PURE__ */ g("div", {
157
+ children: /* @__PURE__ */ h("div", {
152
158
  className: "flex flex-col gap-6",
153
- children: [/* @__PURE__ */ g("div", {
159
+ children: [/* @__PURE__ */ h("div", {
154
160
  className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
155
- children: [/* @__PURE__ */ g(d, {
161
+ children: [/* @__PURE__ */ h(u, {
156
162
  type: "button",
157
163
  variant: "ghost",
158
164
  className: "h-auto justify-start gap-2 self-start px-0 text-sm font-medium text-slate-700 hover:bg-transparent hover:text-slate-950",
159
- onClick: J,
160
- children: [/* @__PURE__ */ h(v, {
165
+ onClick: Ve,
166
+ children: [/* @__PURE__ */ m(v, {
161
167
  className: "h-4 w-4",
162
168
  "aria-hidden": "true"
163
- }), /* @__PURE__ */ h("span", { children: l("go_back") })]
164
- }), /* @__PURE__ */ h(be, {
165
- to: F,
166
- className: _(T > 0 && N ? "inline-flex" : "hidden"),
167
- children: /* @__PURE__ */ g(d, {
169
+ }), /* @__PURE__ */ m("span", { children: C("go_back") })]
170
+ }), /* @__PURE__ */ m(g, {
171
+ to: L,
172
+ className: _(D > 0 && F ? "inline-flex" : "hidden"),
173
+ children: /* @__PURE__ */ h(u, {
168
174
  size: "sm",
169
175
  className: "gap-2",
170
- children: [/* @__PURE__ */ h("span", { children: l("checkout_button") }), /* @__PURE__ */ h(y, {
176
+ children: [/* @__PURE__ */ m("span", { children: C("checkout_button") }), /* @__PURE__ */ m(y, {
171
177
  className: "h-4 w-4",
172
178
  "aria-hidden": "true"
173
179
  })]
174
180
  })
175
181
  })]
176
- }), /* @__PURE__ */ g("div", {
182
+ }), /* @__PURE__ */ h("div", {
177
183
  className: "grid gap-6 lg:grid-cols-12",
178
- children: [/* @__PURE__ */ g("div", {
184
+ children: [/* @__PURE__ */ h("div", {
179
185
  className: "lg:col-span-7",
180
- children: [/* @__PURE__ */ h("div", {
181
- className: _("relative aspect-[1618/1000] overflow-hidden rounded-2xl", Z.className),
182
- style: Z.style,
183
- children: X ? /* @__PURE__ */ h("img", {
184
- src: X,
185
- alt: Y,
186
+ children: [/* @__PURE__ */ m("div", {
187
+ className: _("relative aspect-[1618/1000] overflow-hidden rounded-2xl", Ke.className),
188
+ style: Ke.style,
189
+ children: Ge ? /* @__PURE__ */ m("img", {
190
+ src: Ge,
191
+ alt: He,
186
192
  className: "absolute inset-0 h-full w-full object-contain p-2",
187
193
  loading: "lazy"
188
- }) : /* @__PURE__ */ h("div", {
194
+ }) : /* @__PURE__ */ m("div", {
189
195
  className: "absolute inset-0 flex items-center justify-center text-slate-400",
190
- children: /* @__PURE__ */ h(Ee, {
196
+ children: /* @__PURE__ */ m(De, {
191
197
  className: "h-12 w-12",
192
198
  "aria-hidden": "true"
193
199
  })
194
200
  })
195
- }), /* @__PURE__ */ g("div", {
201
+ }), /* @__PURE__ */ h("div", {
196
202
  className: "mt-5 flex flex-col gap-3",
197
203
  children: [
198
- /* @__PURE__ */ g("div", {
204
+ /* @__PURE__ */ h("div", {
199
205
  className: "flex flex-wrap items-center gap-2",
200
- children: [/* @__PURE__ */ h(ce, {
201
- variant: Ge.variant,
202
- children: /* @__PURE__ */ h("span", { children: Ke })
203
- }), /* @__PURE__ */ h(he, {
204
- prices: k.prices,
205
- openOnHover: k.kind !== "accessory"
206
+ children: [/* @__PURE__ */ m(l, {
207
+ variant: Ye.variant,
208
+ children: /* @__PURE__ */ m("span", { children: Xe })
209
+ }), /* @__PURE__ */ m(_e, {
210
+ prices: j.prices,
211
+ openOnHover: j.kind !== "accessory"
206
212
  })]
207
213
  }),
208
- /* @__PURE__ */ h("h1", {
214
+ /* @__PURE__ */ m("h1", {
209
215
  className: "text-2xl font-semibold tracking-tight text-slate-950",
210
- children: /* @__PURE__ */ h("span", { children: Y })
216
+ children: /* @__PURE__ */ m("span", { children: He })
211
217
  }),
212
- /* @__PURE__ */ h("p", {
218
+ /* @__PURE__ */ m("p", {
213
219
  className: "text-sm text-slate-600",
214
- children: /* @__PURE__ */ h("span", { children: Ve })
220
+ children: /* @__PURE__ */ m("span", { children: Ue })
215
221
  }),
216
- k.features?.length ? /* @__PURE__ */ g("div", {
222
+ j.features?.length ? /* @__PURE__ */ h("div", {
217
223
  className: "mt-2 space-y-2",
218
- children: [/* @__PURE__ */ h("p", {
224
+ children: [/* @__PURE__ */ m("p", {
219
225
  className: "text-sm font-semibold text-slate-950",
220
- children: /* @__PURE__ */ h("span", { children: l("product_features_title") })
221
- }), /* @__PURE__ */ h("ul", {
226
+ children: /* @__PURE__ */ m("span", { children: C("product_features_title") })
227
+ }), /* @__PURE__ */ m("ul", {
222
228
  className: "grid gap-1 text-sm text-slate-700",
223
- children: k.features.map((e, t) => /* @__PURE__ */ g("li", {
229
+ children: j.features.map((e, t) => /* @__PURE__ */ h("li", {
224
230
  className: "inline-flex items-start gap-2",
225
- children: [/* @__PURE__ */ h(De, {
231
+ children: [/* @__PURE__ */ m(Oe, {
226
232
  className: "mt-0.5 h-4 w-4 text-success",
227
233
  "aria-hidden": "true"
228
- }), /* @__PURE__ */ h("span", { children: a(e, S.language, E) })]
229
- }, `${k.id}-${t}`))
234
+ }), /* @__PURE__ */ m("span", { children: a(e, w.language, O) })]
235
+ }, `${j.id}-${t}`))
230
236
  })]
231
237
  }) : null,
232
- /* @__PURE__ */ h(me, { warning: He })
238
+ /* @__PURE__ */ m(ge, { warning: We })
233
239
  ]
234
240
  })]
235
- }), /* @__PURE__ */ h("div", {
241
+ }), /* @__PURE__ */ m("div", {
236
242
  className: "lg:col-span-5",
237
- children: /* @__PURE__ */ g(pe, {
243
+ children: /* @__PURE__ */ h(he, {
238
244
  className: "border-slate-200 bg-white shadow-sm",
239
- children: [/* @__PURE__ */ g("div", {
245
+ children: [/* @__PURE__ */ h("div", {
240
246
  className: "border-b border-slate-200 px-4 py-4",
241
- children: [/* @__PURE__ */ h("p", {
247
+ children: [/* @__PURE__ */ m("p", {
242
248
  className: "text-sm font-semibold text-slate-950",
243
- children: /* @__PURE__ */ h("span", { children: l("add_to_cart_title") })
244
- }), /* @__PURE__ */ h("p", {
249
+ children: /* @__PURE__ */ m("span", { children: C("add_to_cart_title") })
250
+ }), /* @__PURE__ */ m("p", {
245
251
  className: "mt-1 text-xs text-slate-600",
246
- children: /* @__PURE__ */ h("span", { children: l("add_to_cart_description") })
252
+ children: /* @__PURE__ */ m("span", { children: C("add_to_cart_description") })
247
253
  })]
248
- }), /* @__PURE__ */ g("div", {
254
+ }), /* @__PURE__ */ h("div", {
249
255
  className: "grid gap-4 px-4 py-4",
250
256
  children: [
251
- N ? null : /* @__PURE__ */ h("p", {
257
+ F ? null : /* @__PURE__ */ m("p", {
252
258
  role: "alert",
253
259
  className: "text-sm text-destructive",
254
- children: /* @__PURE__ */ h("span", { children: l("booking_time_slots_required") })
260
+ children: /* @__PURE__ */ m("span", { children: C("booking_time_slots_required") })
255
261
  }),
256
- $.length > 1 ? /* @__PURE__ */ g("div", {
262
+ X.length > 1 ? /* @__PURE__ */ h("div", {
257
263
  className: "grid gap-2",
258
- children: [/* @__PURE__ */ h("p", {
264
+ children: [/* @__PURE__ */ m("p", {
259
265
  className: "text-xs font-medium text-slate-700",
260
- children: /* @__PURE__ */ h("span", { children: Je })
261
- }), /* @__PURE__ */ h(ve, {
262
- value: B ?? "",
263
- onValueChange: V,
266
+ children: /* @__PURE__ */ m("span", { children: Ze })
267
+ }), /* @__PURE__ */ m(be, {
268
+ value: H ?? "",
269
+ onValueChange: U,
264
270
  className: "grid gap-2",
265
- children: $.map((e) => {
266
- let t = `variant-${k.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${k.id}-${e.id}`.toLowerCase(), { label: r, description: i } = ee(e), a = je(k, e.id, q), o = a ? u(a) : qe, s = a ? x(l, a, ae(a)) : qe ? l("availability_out_of_stock") : null;
267
- return /* @__PURE__ */ g("label", {
271
+ children: X.map((e) => {
272
+ let t = `variant-${j.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${j.id}-${e.id}`.toLowerCase(), { label: r, description: i } = ee(e), a = x(j, e.id, Y), te = a ? le(a) : $, o = a ? S(C, a, c(a)) : $ ? C("availability_out_of_stock") : null;
273
+ return /* @__PURE__ */ h("label", {
268
274
  htmlFor: t,
269
275
  "data-testid": n,
270
- className: _("flex items-start gap-3 rounded-xl border p-3 transition", B === e.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
271
- children: [/* @__PURE__ */ h(ye, {
276
+ className: _("flex items-start gap-3 rounded-xl border p-3 transition", H === e.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
277
+ children: [/* @__PURE__ */ m(xe, {
272
278
  id: t,
273
279
  value: e.id,
274
280
  className: "mt-1"
275
- }), /* @__PURE__ */ g("span", {
281
+ }), /* @__PURE__ */ h("span", {
276
282
  className: "flex flex-1 flex-col gap-0.5",
277
283
  children: [
278
- /* @__PURE__ */ h("span", {
284
+ /* @__PURE__ */ m("span", {
279
285
  className: "text-sm font-medium text-slate-950",
280
286
  children: r
281
287
  }),
282
- i ? /* @__PURE__ */ h("span", {
288
+ i ? /* @__PURE__ */ m("span", {
283
289
  className: "text-xs text-slate-600",
284
290
  children: i
285
291
  }) : null,
286
- s ? /* @__PURE__ */ h("span", {
292
+ o ? /* @__PURE__ */ m("span", {
287
293
  className: "pt-1",
288
- children: /* @__PURE__ */ h(ce, {
289
- variant: o ? "destructive" : "outline",
290
- children: /* @__PURE__ */ h("span", { children: s })
294
+ children: /* @__PURE__ */ m(l, {
295
+ variant: te ? "destructive" : "outline",
296
+ children: /* @__PURE__ */ m("span", { children: o })
291
297
  })
292
298
  }) : null
293
299
  ]
@@ -296,50 +302,50 @@ function S() {
296
302
  })
297
303
  })]
298
304
  }) : null,
299
- /* @__PURE__ */ g("div", {
305
+ /* @__PURE__ */ h("div", {
300
306
  className: "grid gap-2",
301
- children: [/* @__PURE__ */ h("p", {
307
+ children: [/* @__PURE__ */ m("p", {
302
308
  className: "text-xs font-medium text-slate-700",
303
- children: /* @__PURE__ */ h("span", { children: l("quantity_label") })
304
- }), /* @__PURE__ */ h(fe, {
309
+ children: /* @__PURE__ */ m("span", { children: C("quantity_label") })
310
+ }), /* @__PURE__ */ m(me, {
305
311
  type: "number",
306
312
  min: 1,
307
313
  max: 99,
308
- value: R,
309
- onChange: (e) => z(Number(e.target.value))
314
+ value: B,
315
+ onChange: (e) => V(Number(e.target.value))
310
316
  })]
311
317
  }),
312
- /* @__PURE__ */ g(d, {
318
+ /* @__PURE__ */ h(u, {
313
319
  className: "h-11 rounded-xl text-sm font-semibold gap-2",
314
320
  onClick: () => {
315
- !B || !N || (Ie({
316
- kind: k.kind,
317
- productId: s(k),
318
- ...B ? { productVariantId: B } : {},
319
- quantity: H
320
- }), de.success(l("product_added_to_cart_successfully", {
321
- quantity: H,
322
- productName: te({
323
- product: k,
324
- productVariantId: B,
325
- language: S.language,
326
- fallbackLanguage: E
321
+ !H || !F || (Ie({
322
+ kind: j.kind,
323
+ productId: o(j),
324
+ ...H ? { productVariantId: H } : {},
325
+ quantity: W
326
+ }), pe.success(C("product_added_to_cart_successfully", {
327
+ quantity: W,
328
+ productName: ne({
329
+ product: j,
330
+ productVariantId: H,
331
+ language: w.language,
332
+ fallbackLanguage: O
327
333
  })
328
334
  })));
329
335
  },
330
- disabled: !Ye,
331
- children: [/* @__PURE__ */ h("span", { children: l("add_to_cart") }), /* @__PURE__ */ h(Oe, {
336
+ disabled: !Qe,
337
+ children: [/* @__PURE__ */ m("span", { children: C("add_to_cart") }), /* @__PURE__ */ m(ke, {
332
338
  className: "h-4 w-4",
333
339
  "aria-hidden": "true"
334
340
  })]
335
341
  }),
336
- /* @__PURE__ */ h(be, {
337
- to: F,
338
- className: _(T > 0 && N ? "block" : "hidden"),
339
- children: /* @__PURE__ */ g(d, {
342
+ /* @__PURE__ */ m(g, {
343
+ to: L,
344
+ className: _(D > 0 && F ? "block" : "hidden"),
345
+ children: /* @__PURE__ */ h(u, {
340
346
  variant: "outline",
341
347
  className: "h-11 w-full rounded-xl gap-2",
342
- children: [/* @__PURE__ */ h("span", { children: l("go_to_checkout") }), /* @__PURE__ */ h(y, {
348
+ children: [/* @__PURE__ */ m("span", { children: C("go_to_checkout") }), /* @__PURE__ */ m(y, {
343
349
  className: "h-4 w-4",
344
350
  "aria-hidden": "true"
345
351
  })]
@@ -354,4 +360,4 @@ function S() {
354
360
  });
355
361
  }
356
362
  //#endregion
357
- export { S as default };
363
+ export { C as default };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutDetailsCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutDetailsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAK5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAOlD,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAElE,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,YAAY,CAAA;CACnB,CAAA;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,2CAsHrE"}
1
+ {"version":3,"file":"CheckoutDetailsCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutDetailsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAK5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAOlD,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAElE,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,YAAY,CAAA;CACnB,CAAA;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,2CAwGrE"}
@@ -30,26 +30,13 @@ function h({ form: h }) {
30
30
  children: [
31
31
  /* @__PURE__ */ l(r, {
32
32
  control: h.control,
33
- name: "first_name",
33
+ name: "fullName",
34
34
  render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
35
- /* @__PURE__ */ l(a, { children: g("checkout_first_name_label") }),
35
+ /* @__PURE__ */ l(a, { children: g("checkout_full_name_label") }),
36
36
  /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
37
37
  ...t,
38
- autoComplete: "given-name",
39
- placeholder: g("checkout_first_name_placeholder")
40
- }) }),
41
- /* @__PURE__ */ l(o, {})
42
- ] })
43
- }),
44
- /* @__PURE__ */ l(r, {
45
- control: h.control,
46
- name: "last_name",
47
- render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
48
- /* @__PURE__ */ l(a, { children: g("checkout_last_name_label") }),
49
- /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
50
- ...t,
51
- autoComplete: "family-name",
52
- placeholder: g("checkout_last_name_placeholder")
38
+ autoComplete: "name",
39
+ placeholder: g("checkout_full_name_placeholder")
53
40
  }) }),
54
41
  /* @__PURE__ */ l(o, {})
55
42
  ] })
@@ -0,0 +1,7 @@
1
+ type CheckoutLoadingSkeletonProps = {
2
+ bookingPath: string;
3
+ checkoutPath: string;
4
+ };
5
+ export declare function CheckoutLoadingSkeleton({ bookingPath, checkoutPath, }: CheckoutLoadingSkeletonProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=CheckoutLoadingSkeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckoutLoadingSkeleton.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutLoadingSkeleton.tsx"],"names":[],"mappings":"AAMA,KAAK,4BAA4B,GAAG;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAMD,wBAAgB,uBAAuB,CAAC,EACtC,WAAW,EACX,YAAY,GACb,EAAE,4BAA4B,2CAuF9B"}