@loczer/storefront-sdk 0.182.0 → 0.183.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/StorefrontProvider.d.ts +18 -15
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +24 -34
- package/dist/chunks/booking-engine/dist/models/{Product.shared-CJ6vPb6n.js → Product.shared-CTuk4fiR.js} +2 -2
- package/dist/chunks/booking-engine/dist/schemas/{base-asset-PqhtKnZA.js → base-asset-B_Dm8_Vk.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-BM3jZzqu.js → base-booking-DW8AEPKo.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-product-BJd4ttMP.js → base-product-1H8l2aUv.js} +1 -1
- package/dist/chunks/booking-engine/dist/{schemas-BNlwu75Z.js → schemas-34QQv0EH.js} +4 -4
- package/dist/chunks/ui/dist/Map/{MapContent--PwVTg2W.js → MapContent-QPkuTBvK.js} +2 -2
- package/dist/chunks/ui/dist/Map/{constants-DqrK8UkE.js → constants-BNmiJXfg.js} +1 -1
- package/dist/chunks/ui/dist/{Map-B45AxZ-D.js → Map-BXmRf5Ep.js} +3 -3
- package/dist/chunks/ui/dist/static/strings-1T2w7LqX.js +4 -0
- package/dist/components/AboutSection/index.d.ts +1 -6
- package/dist/components/AboutSection/index.d.ts.map +1 -1
- package/dist/components/AboutSection/index.js +43 -39
- package/dist/components/ContactSection/index.d.ts +1 -3
- package/dist/components/ContactSection/index.d.ts.map +1 -1
- package/dist/components/ContactSection/index.js +222 -164
- package/dist/components/Footer/index.d.ts +3 -4
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +98 -69
- package/dist/components/FulfillmentSection/index.d.ts.map +1 -1
- package/dist/components/FulfillmentSection/index.js +17 -16
- package/dist/components/Header/index.d.ts +1 -3
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +77 -72
- package/dist/components/Layout/index.d.ts +3 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +45 -47
- package/dist/components/Map/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +68 -60
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/fr.js +1 -1
- package/dist/index.d.ts +151 -150
- package/dist/index.js +62 -62
- package/dist/lib/cart.d.ts +4 -1
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +64 -40
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +4 -3
- package/dist/lib/checkoutSubmit.js +2 -2
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +20 -9
- package/dist/lib/storefrontAddress.d.ts +5 -0
- package/dist/lib/storefrontAddress.d.ts.map +1 -0
- package/dist/lib/storefrontAddress.js +24 -0
- package/dist/lib/storefrontAvailability.d.ts +6 -6
- package/dist/lib/storefrontContact.d.ts +10 -0
- package/dist/lib/storefrontContact.d.ts.map +1 -0
- package/dist/lib/storefrontContact.js +24 -0
- package/dist/lib/storefrontMissingValues.d.ts +5 -0
- package/dist/lib/storefrontMissingValues.d.ts.map +1 -0
- package/dist/lib/storefrontMissingValues.js +4 -0
- package/dist/lib/storefrontProducts.d.ts +23 -21
- package/dist/lib/storefrontProducts.d.ts.map +1 -1
- package/dist/lib/storefrontProducts.js +7 -5
- package/dist/lib/whatsapp.d.ts +8 -6
- package/dist/lib/whatsapp.d.ts.map +1 -1
- package/dist/lib/whatsapp.js +16 -43
- package/dist/pages/BookingPage.js +36 -36
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +126 -128
- package/dist/pages/ProductPage.js +160 -160
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -12
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +3 -2
- package/dist/ui/radio-group.d.ts +1 -1
- package/package.json +7 -6
- package/dist/chunks/ui/dist/static/strings-CPnO-KbA.js +0 -4
- package/dist/data/config.d.ts +0 -15
- package/dist/data/config.d.ts.map +0 -1
- package/dist/data/config.js +0 -24
- package/dist/static/strings.d.ts +0 -2
- package/dist/static/strings.d.ts.map +0 -1
- package/dist/static/strings.js +0 -4
|
@@ -1,281 +1,281 @@
|
|
|
1
1
|
import { getBookingParamsFromSearch as e, resolveBookingSearchParamsFromSessionStorage as t, writeBookingSearchParamsToSessionStorage as n } from "../lib/booking.js";
|
|
2
|
-
import {
|
|
3
|
-
import { getProductVariantAttributeValue as i, getStorefrontProductVariantDisplay as ee } from "../lib/productVariants.js";
|
|
2
|
+
import { getProductVariantAttributeValue as r, getStorefrontProductVariantDisplay as i } from "../lib/productVariants.js";
|
|
4
3
|
import { findStorefrontProductBySlug as a, getStorefrontCheckoutProductId as o } from "../lib/products.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
4
|
+
import { useStorefrontCart as s } from "../lib/cart.js";
|
|
5
|
+
import { getAvailabilityVariant as c } from "../lib/utils.js";
|
|
6
|
+
import { getLocalizedValue as l } from "../localization.js";
|
|
7
|
+
import { ROUTE as ee, buildStorefrontAvailabilityKey as u, getStorefrontAvailabilityIssue as d, getStorefrontAvailabilityStatus as f, getValidStorefrontAvailabilitySchedule as te, isStorefrontAvailabilityInsufficient as p, responseSchema as ne } from "../lib/storefrontAvailability.js";
|
|
8
|
+
import { Badge as re } from "../ui/badge.js";
|
|
9
|
+
import { Button as m } from "../ui/button.js";
|
|
10
|
+
import { Input as ie } from "../ui/input.js";
|
|
11
|
+
import { useStorefront as ae, useStorefrontProducts as oe } from "../StorefrontProvider.js";
|
|
12
|
+
import { Card as se } from "../ui/card.js";
|
|
13
|
+
import { ProductWarningNotice as ce } from "../components/ProductWarningNotice/index.js";
|
|
14
|
+
import { ProductPriceBadge as le } from "../components/ProductPriceBadge/index.js";
|
|
15
|
+
import { resolveProductImageContainerStyle as ue } from "../lib/productImageStyles.js";
|
|
16
|
+
import { apiPost as de } from "../lib/apiCall.js";
|
|
17
|
+
import { RadioGroup as fe, RadioGroupItem as pe } from "../ui/radio-group.js";
|
|
18
|
+
import { useEffect as h, useMemo as g, useState as _ } from "react";
|
|
19
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
20
|
+
import { cn as b } from "@rpcbase/ui";
|
|
21
|
+
import { Link as me, useLocation as he, useNavigate as ge, useParams as _e, useSearchParams as ve } from "@rpcbase/router";
|
|
22
|
+
import { useTranslation as ye } from "react-i18next";
|
|
23
|
+
import { ArrowLeft as x, ArrowRight as S, Bike as be, CheckCircle2 as xe } from "lucide-react";
|
|
24
24
|
//#region src/pages/ProductPage.tsx
|
|
25
|
-
var
|
|
25
|
+
var C = (e, t = () => !0) => {
|
|
26
26
|
if (!e) return null;
|
|
27
27
|
if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
|
|
28
28
|
let n = e.productVariants ?? [];
|
|
29
29
|
return n.find((e) => t(e.id))?.id ?? n[0]?.id ?? null;
|
|
30
|
-
},
|
|
30
|
+
}, Se = (e, t) => {
|
|
31
31
|
if (!e) return [];
|
|
32
32
|
let n = o(e), r = /* @__PURE__ */ new Map();
|
|
33
|
-
r.set(
|
|
33
|
+
r.set(u(n), {
|
|
34
34
|
productId: n,
|
|
35
35
|
quantity: t
|
|
36
36
|
});
|
|
37
|
-
for (let i of e.productVariants ?? []) r.set(
|
|
37
|
+
for (let i of e.productVariants ?? []) r.set(u(n, i.id), {
|
|
38
38
|
productId: n,
|
|
39
39
|
productVariantId: i.id,
|
|
40
40
|
quantity: t
|
|
41
41
|
});
|
|
42
42
|
let i = e.representedVariantId?.trim();
|
|
43
|
-
return i && r.set(
|
|
43
|
+
return i && r.set(u(n, i), {
|
|
44
44
|
productId: n,
|
|
45
45
|
productVariantId: i,
|
|
46
46
|
quantity: t
|
|
47
47
|
}), Array.from(r.values());
|
|
48
|
-
},
|
|
48
|
+
}, Ce = (e, t) => {
|
|
49
49
|
let n = o(e), r = e.representedVariantId?.trim();
|
|
50
50
|
if (r) {
|
|
51
|
-
let e = t.get(
|
|
51
|
+
let e = t.get(u(n, r));
|
|
52
52
|
if (e) return e;
|
|
53
53
|
}
|
|
54
|
-
return t.get(
|
|
55
|
-
},
|
|
56
|
-
let r =
|
|
54
|
+
return t.get(u(n));
|
|
55
|
+
}, we = (e, t, n) => n.get(u(o(e), t)), w = (e, t, n) => {
|
|
56
|
+
let r = d(t);
|
|
57
57
|
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 });
|
|
58
|
-
},
|
|
59
|
-
function
|
|
60
|
-
let { t:
|
|
61
|
-
bikes:
|
|
62
|
-
accessories:
|
|
58
|
+
}, Te = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
|
|
59
|
+
function T() {
|
|
60
|
+
let { t: d, i18n: T } = ye(), { storeSlug: E, productSlug: D } = _e(), [O] = ve(), Ee = he(), De = ge(), { addItem: Oe, itemCount: k } = s(), { storefrontConfiguration: ke } = ae(), A = ke.workspace?.workspaceLanguage, { bikes: j, accessories: M } = oe(), N = g(() => D ? a(D, {
|
|
61
|
+
bikes: j,
|
|
62
|
+
accessories: M
|
|
63
63
|
}) : null, [
|
|
64
|
+
M,
|
|
64
65
|
j,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
H(null);
|
|
66
|
+
D
|
|
67
|
+
]), P = g(() => t(O, E), [O, E]), F = g(() => e(P), [P]), I = P.toString(), L = `/${E ?? ""}/checkout${I ? `?${I}` : ""}`, R = `/${E ?? ""}`, Ae = R, z = Ee.state, je = typeof z?.backTo == "string" && z.backTo.startsWith(R) ? z.backTo : Ae, [B, V] = _(1), [H, U] = _(() => C(N)), W = Number.isFinite(B) ? Math.max(1, Math.min(99, Math.floor(B))) : 1, G = g(() => Se(N, W), [W, N]), [K, q] = _([]), [Me, J] = _(!1);
|
|
68
|
+
h(() => {
|
|
69
|
+
if (V(1), !N) {
|
|
70
|
+
U(null);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
n(
|
|
76
|
-
}, [
|
|
77
|
-
if (!
|
|
78
|
-
|
|
73
|
+
U(C(N));
|
|
74
|
+
}, [D, N]), h(() => {
|
|
75
|
+
n(E, P);
|
|
76
|
+
}, [P, E]), h(() => {
|
|
77
|
+
if (!E || G.length === 0) {
|
|
78
|
+
q([]), J(!1);
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
let e =
|
|
81
|
+
let e = te(F);
|
|
82
82
|
if (!e) {
|
|
83
|
-
|
|
83
|
+
J(!1);
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
let t = !1;
|
|
87
|
-
return
|
|
87
|
+
return J(!0), q([]), (async () => {
|
|
88
88
|
try {
|
|
89
|
-
let n = await
|
|
90
|
-
storeSlug:
|
|
89
|
+
let n = await de(ee, {
|
|
90
|
+
storeSlug: E,
|
|
91
91
|
schedule: e,
|
|
92
|
-
products:
|
|
93
|
-
}), r =
|
|
92
|
+
products: G
|
|
93
|
+
}), r = ne.parse(n);
|
|
94
94
|
if (t) return;
|
|
95
|
-
|
|
95
|
+
q(r.success ? r.availability ?? [] : []);
|
|
96
96
|
} catch (e) {
|
|
97
97
|
if (t) return;
|
|
98
|
-
console.error("Failed to load storefront product availability", e),
|
|
98
|
+
console.error("Failed to load storefront product availability", e), q([]);
|
|
99
99
|
} finally {
|
|
100
|
-
t ||
|
|
100
|
+
t || J(!1);
|
|
101
101
|
}
|
|
102
102
|
})(), () => {
|
|
103
103
|
t = !0;
|
|
104
104
|
};
|
|
105
105
|
}, [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
G,
|
|
107
|
+
F.end_date,
|
|
108
|
+
F.end_time,
|
|
109
|
+
F.start_date,
|
|
110
|
+
F.start_time,
|
|
111
|
+
E
|
|
112
112
|
]);
|
|
113
|
-
let
|
|
114
|
-
|
|
113
|
+
let Y = g(() => new Map(K.map((e) => [u(e.productId, e.productVariantId), e])), [K]), Ne = () => {
|
|
114
|
+
De(je);
|
|
115
115
|
};
|
|
116
|
-
if (!
|
|
116
|
+
if (!N) return /* @__PURE__ */ v("div", {
|
|
117
117
|
className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
|
|
118
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ y("div", {
|
|
119
119
|
className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
|
|
120
120
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ v("h1", {
|
|
122
122
|
className: "text-xl font-semibold tracking-tight text-slate-950",
|
|
123
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ v("span", { children: d("product_not_found_title") })
|
|
124
124
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ v("p", {
|
|
126
126
|
className: "mt-2 text-sm text-slate-600",
|
|
127
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ v("span", { children: d("product_not_found_description") })
|
|
128
128
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ v("div", {
|
|
130
130
|
className: "mt-6",
|
|
131
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ y(m, {
|
|
132
132
|
type: "button",
|
|
133
133
|
className: "gap-2",
|
|
134
|
-
onClick:
|
|
135
|
-
children: [/* @__PURE__ */
|
|
134
|
+
onClick: Ne,
|
|
135
|
+
children: [/* @__PURE__ */ v(x, {
|
|
136
136
|
className: "h-4 w-4",
|
|
137
137
|
"aria-hidden": "true"
|
|
138
|
-
}), /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ v("span", { children: d("go_back") })]
|
|
139
139
|
})
|
|
140
140
|
})
|
|
141
141
|
]
|
|
142
142
|
})
|
|
143
143
|
});
|
|
144
|
-
let Pe =
|
|
145
|
-
return /* @__PURE__ */
|
|
144
|
+
let Pe = l(N.name, T.language, A), Fe = l(N.description, T.language, A), Ie = l(N.warning, T.language, A), Le = typeof N.images?.[0] == "string" ? N.images[0].trim() : "", X = ue(N.primaryImageStyle), Z = Ce(N, Y), Re = Te(N), ze = Z ? f(Z) : Re, Be = c(ze), Ve = Me ? d("availability_checking") : w(d, Z, ze), Q = Z ? p(Z) : Re === "OUT_OF_STOCK", $ = N.productVariants ?? [], He = $.some((e) => !!r(e, "size")) ? d("product_size_label") : d("product_variant_label"), Ue = !!H;
|
|
145
|
+
return /* @__PURE__ */ v("div", {
|
|
146
146
|
className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
|
|
147
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ y("div", {
|
|
148
148
|
className: "flex flex-col gap-6",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ y("div", {
|
|
150
150
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
151
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ y(m, {
|
|
152
152
|
type: "button",
|
|
153
153
|
variant: "ghost",
|
|
154
154
|
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",
|
|
155
|
-
onClick:
|
|
156
|
-
children: [/* @__PURE__ */
|
|
155
|
+
onClick: Ne,
|
|
156
|
+
children: [/* @__PURE__ */ v(x, {
|
|
157
157
|
className: "h-4 w-4",
|
|
158
158
|
"aria-hidden": "true"
|
|
159
|
-
}), /* @__PURE__ */
|
|
160
|
-
}), /* @__PURE__ */
|
|
161
|
-
to:
|
|
162
|
-
className:
|
|
163
|
-
children: /* @__PURE__ */
|
|
159
|
+
}), /* @__PURE__ */ v("span", { children: d("go_back") })]
|
|
160
|
+
}), /* @__PURE__ */ v(me, {
|
|
161
|
+
to: L,
|
|
162
|
+
className: b(k > 0 ? "inline-flex" : "hidden"),
|
|
163
|
+
children: /* @__PURE__ */ y(m, {
|
|
164
164
|
size: "sm",
|
|
165
165
|
className: "gap-2",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
166
|
+
children: [/* @__PURE__ */ v("span", { children: d("checkout_button") }), /* @__PURE__ */ v(S, {
|
|
167
167
|
className: "h-4 w-4",
|
|
168
168
|
"aria-hidden": "true"
|
|
169
169
|
})]
|
|
170
170
|
})
|
|
171
171
|
})]
|
|
172
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ y("div", {
|
|
173
173
|
className: "grid gap-6 lg:grid-cols-12",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ y("div", {
|
|
175
175
|
className: "lg:col-span-7",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
177
|
-
className:
|
|
176
|
+
children: [/* @__PURE__ */ v("div", {
|
|
177
|
+
className: b("relative aspect-[1618/1000] overflow-hidden rounded-2xl", X.className),
|
|
178
178
|
style: X.style,
|
|
179
|
-
children: Le ? /* @__PURE__ */
|
|
179
|
+
children: Le ? /* @__PURE__ */ v("img", {
|
|
180
180
|
src: Le,
|
|
181
181
|
alt: Pe,
|
|
182
182
|
className: "absolute inset-0 h-full w-full object-contain p-2",
|
|
183
183
|
loading: "lazy"
|
|
184
|
-
}) : /* @__PURE__ */
|
|
184
|
+
}) : /* @__PURE__ */ v("div", {
|
|
185
185
|
className: "absolute inset-0 flex items-center justify-center text-slate-400",
|
|
186
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ v(be, {
|
|
187
187
|
className: "h-12 w-12",
|
|
188
188
|
"aria-hidden": "true"
|
|
189
189
|
})
|
|
190
190
|
})
|
|
191
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ y("div", {
|
|
192
192
|
className: "mt-5 flex flex-col gap-3",
|
|
193
193
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ y("div", {
|
|
195
195
|
className: "flex flex-wrap items-center gap-2",
|
|
196
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ v(re, {
|
|
197
197
|
variant: Be.variant,
|
|
198
|
-
children: /* @__PURE__ */
|
|
199
|
-
}), /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ v("span", { children: Ve })
|
|
199
|
+
}), /* @__PURE__ */ v(le, { prices: N.prices })]
|
|
200
200
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ v("h1", {
|
|
202
202
|
className: "text-2xl font-semibold tracking-tight text-slate-950",
|
|
203
|
-
children: /* @__PURE__ */
|
|
203
|
+
children: /* @__PURE__ */ v("span", { children: Pe })
|
|
204
204
|
}),
|
|
205
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ v("p", {
|
|
206
206
|
className: "text-sm text-slate-600",
|
|
207
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ v("span", { children: Fe })
|
|
208
208
|
}),
|
|
209
|
-
|
|
209
|
+
N.features?.length ? /* @__PURE__ */ y("div", {
|
|
210
210
|
className: "mt-2 space-y-2",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ v("p", {
|
|
212
212
|
className: "text-sm font-semibold text-slate-950",
|
|
213
|
-
children: /* @__PURE__ */
|
|
214
|
-
}), /* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ v("span", { children: d("product_features_title") })
|
|
214
|
+
}), /* @__PURE__ */ v("ul", {
|
|
215
215
|
className: "grid gap-1 text-sm text-slate-700",
|
|
216
|
-
children:
|
|
216
|
+
children: N.features.map((e, t) => /* @__PURE__ */ y("li", {
|
|
217
217
|
className: "inline-flex items-start gap-2",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ v(xe, {
|
|
219
219
|
className: "mt-0.5 h-4 w-4 text-success",
|
|
220
220
|
"aria-hidden": "true"
|
|
221
|
-
}), /* @__PURE__ */
|
|
222
|
-
}, `${
|
|
221
|
+
}), /* @__PURE__ */ v("span", { children: l(e, T.language, A) })]
|
|
222
|
+
}, `${N.id}-${t}`))
|
|
223
223
|
})]
|
|
224
224
|
}) : null,
|
|
225
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ v(ce, { warning: Ie })
|
|
226
226
|
]
|
|
227
227
|
})]
|
|
228
|
-
}), /* @__PURE__ */
|
|
228
|
+
}), /* @__PURE__ */ v("div", {
|
|
229
229
|
className: "lg:col-span-5",
|
|
230
|
-
children: /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ y(se, {
|
|
231
231
|
className: "border-slate-200 bg-white shadow-sm",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ y("div", {
|
|
233
233
|
className: "border-b border-slate-200 px-4 py-4",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ v("p", {
|
|
235
235
|
className: "text-sm font-semibold text-slate-950",
|
|
236
|
-
children: /* @__PURE__ */
|
|
237
|
-
}), /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ v("span", { children: d("add_to_cart_title") })
|
|
237
|
+
}), /* @__PURE__ */ v("p", {
|
|
238
238
|
className: "mt-1 text-xs text-slate-600",
|
|
239
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ v("span", { children: d("add_to_cart_description") })
|
|
240
240
|
})]
|
|
241
|
-
}), /* @__PURE__ */
|
|
241
|
+
}), /* @__PURE__ */ y("div", {
|
|
242
242
|
className: "grid gap-4 px-4 py-4",
|
|
243
243
|
children: [
|
|
244
|
-
$.length > 1 ? /* @__PURE__ */
|
|
244
|
+
$.length > 1 ? /* @__PURE__ */ y("div", {
|
|
245
245
|
className: "grid gap-2",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ v("p", {
|
|
247
247
|
className: "text-xs font-medium text-slate-700",
|
|
248
|
-
children: /* @__PURE__ */
|
|
249
|
-
}), /* @__PURE__ */
|
|
250
|
-
value:
|
|
251
|
-
onValueChange:
|
|
248
|
+
children: /* @__PURE__ */ v("span", { children: He })
|
|
249
|
+
}), /* @__PURE__ */ v(fe, {
|
|
250
|
+
value: H ?? "",
|
|
251
|
+
onValueChange: U,
|
|
252
252
|
className: "grid gap-2",
|
|
253
253
|
children: $.map((e) => {
|
|
254
|
-
let t = `variant-${
|
|
255
|
-
return /* @__PURE__ */
|
|
254
|
+
let t = `variant-${N.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${N.id}-${e.id}`.toLowerCase(), { label: r, description: a } = i(e), o = we(N, e.id, Y), s = o ? p(o) : Q, c = o ? w(d, o, f(o)) : Q ? d("availability_out_of_stock") : null;
|
|
255
|
+
return /* @__PURE__ */ y("label", {
|
|
256
256
|
htmlFor: t,
|
|
257
257
|
"data-testid": n,
|
|
258
|
-
className:
|
|
259
|
-
children: [/* @__PURE__ */
|
|
258
|
+
className: b("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"),
|
|
259
|
+
children: [/* @__PURE__ */ v(pe, {
|
|
260
260
|
id: t,
|
|
261
261
|
value: e.id,
|
|
262
262
|
className: "mt-1"
|
|
263
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ y("span", {
|
|
264
264
|
className: "flex flex-1 flex-col gap-0.5",
|
|
265
265
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ v("span", {
|
|
267
267
|
className: "text-sm font-medium text-slate-950",
|
|
268
268
|
children: r
|
|
269
269
|
}),
|
|
270
|
-
|
|
270
|
+
a ? /* @__PURE__ */ v("span", {
|
|
271
271
|
className: "text-xs text-slate-600",
|
|
272
|
-
children:
|
|
272
|
+
children: a
|
|
273
273
|
}) : null,
|
|
274
|
-
|
|
274
|
+
c ? /* @__PURE__ */ v("span", {
|
|
275
275
|
className: "pt-1",
|
|
276
|
-
children: /* @__PURE__ */
|
|
277
|
-
variant:
|
|
278
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ v(re, {
|
|
277
|
+
variant: s ? "destructive" : "outline",
|
|
278
|
+
children: /* @__PURE__ */ v("span", { children: c })
|
|
279
279
|
})
|
|
280
280
|
}) : null
|
|
281
281
|
]
|
|
@@ -284,42 +284,42 @@ function w() {
|
|
|
284
284
|
})
|
|
285
285
|
})]
|
|
286
286
|
}) : null,
|
|
287
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ y("div", {
|
|
288
288
|
className: "grid gap-2",
|
|
289
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: [/* @__PURE__ */ v("p", {
|
|
290
290
|
className: "text-xs font-medium text-slate-700",
|
|
291
|
-
children: /* @__PURE__ */
|
|
292
|
-
}), /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ v("span", { children: d("quantity_label") })
|
|
292
|
+
}), /* @__PURE__ */ v(ie, {
|
|
293
293
|
type: "number",
|
|
294
294
|
min: 1,
|
|
295
295
|
max: 99,
|
|
296
|
-
value:
|
|
297
|
-
onChange: (e) =>
|
|
296
|
+
value: B,
|
|
297
|
+
onChange: (e) => V(Number(e.target.value))
|
|
298
298
|
})]
|
|
299
299
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ y(m, {
|
|
301
301
|
className: "h-11 rounded-xl text-sm font-semibold gap-2",
|
|
302
302
|
onClick: () => {
|
|
303
|
-
|
|
304
|
-
kind:
|
|
305
|
-
productId: o(
|
|
306
|
-
...
|
|
307
|
-
quantity:
|
|
303
|
+
H && Oe({
|
|
304
|
+
kind: N.kind,
|
|
305
|
+
productId: o(N),
|
|
306
|
+
...H ? { productVariantId: H } : {},
|
|
307
|
+
quantity: W
|
|
308
308
|
});
|
|
309
309
|
},
|
|
310
310
|
disabled: !Ue,
|
|
311
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ v("span", { children: d("add_to_cart") }), /* @__PURE__ */ v(S, {
|
|
312
312
|
className: "h-4 w-4",
|
|
313
313
|
"aria-hidden": "true"
|
|
314
314
|
})]
|
|
315
315
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
to:
|
|
318
|
-
className:
|
|
319
|
-
children: /* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ v(me, {
|
|
317
|
+
to: L,
|
|
318
|
+
className: b(k > 0 ? "block" : "hidden"),
|
|
319
|
+
children: /* @__PURE__ */ y(m, {
|
|
320
320
|
variant: "outline",
|
|
321
321
|
className: "h-11 w-full rounded-xl gap-2",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ v("span", { children: d("go_to_checkout") }), /* @__PURE__ */ v(S, {
|
|
323
323
|
className: "h-4 w-4",
|
|
324
324
|
"aria-hidden": "true"
|
|
325
325
|
})]
|
|
@@ -334,4 +334,4 @@ function w() {
|
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
336
|
//#endregion
|
|
337
|
-
export {
|
|
337
|
+
export { T as default };
|