@instockng/storefront-ui 1.0.46 → 1.0.47
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/Checkout.d.ts.map +1 -1
- package/dist/index100.mjs +20 -26
- package/dist/index101.mjs +13 -10
- package/dist/index102.mjs +55 -205
- package/dist/index103.mjs +13 -175
- package/dist/index104.mjs +32 -15
- package/dist/index105.mjs +17 -16
- package/dist/index106.mjs +27 -26
- package/dist/index107.mjs +21 -150
- package/dist/index108.mjs +12 -13
- package/dist/index109.mjs +14 -24
- package/dist/index110.mjs +39 -76
- package/dist/index111.mjs +16 -31
- package/dist/index112.mjs +255 -132
- package/dist/index113.mjs +64 -49
- package/dist/index114.mjs +7 -22
- package/dist/index115.mjs +2 -27
- package/dist/index116.mjs +2 -23
- package/dist/index117.mjs +28 -20
- package/dist/index118.mjs +2 -21
- package/dist/index119.mjs +34 -22
- package/dist/index120.mjs +42 -20
- package/dist/index121.mjs +231 -61
- package/dist/index122.mjs +5 -17
- package/dist/index123.mjs +129 -34
- package/dist/index124.mjs +67 -23
- package/dist/index125.mjs +84 -31
- package/dist/index126.mjs +28 -26
- package/dist/index127.mjs +8 -18
- package/dist/index128.mjs +72 -18
- package/dist/index129.mjs +3 -46
- package/dist/index13.mjs +200 -180
- package/dist/index130.mjs +2 -23
- package/dist/index131.mjs +81 -266
- package/dist/index132.mjs +53 -69
- package/dist/index133.mjs +5 -7
- package/dist/index134.mjs +5 -2
- package/dist/index135.mjs +179 -2
- package/dist/index136.mjs +50 -30
- package/dist/index137.mjs +69 -2
- package/dist/index138.mjs +2 -21
- package/dist/index139.mjs +2 -56
- package/dist/index140.mjs +2 -29
- package/dist/index141.mjs +2 -7
- package/dist/index142.mjs +16 -50
- package/dist/index143.mjs +32 -6
- package/dist/index144.mjs +37 -11
- package/dist/index145.mjs +18 -7
- package/dist/index146.mjs +18 -28
- package/dist/index147.mjs +2 -2
- package/dist/index148.mjs +20 -70
- package/dist/index149.mjs +42 -163
- package/dist/index150.mjs +2 -2
- package/dist/index151.mjs +30 -2
- package/dist/index152.mjs +18 -2
- package/dist/index153.mjs +2 -18
- package/dist/index154.mjs +2 -32
- package/dist/index155.mjs +2 -38
- package/dist/index156.mjs +2 -18
- package/dist/index157.mjs +67 -13
- package/dist/index158.mjs +2 -2
- package/dist/index159.mjs +48 -15
- package/dist/index160.mjs +2 -46
- package/dist/index161.mjs +36 -2
- package/dist/index162.mjs +142 -20
- package/dist/index163.mjs +2 -18
- package/dist/index164.mjs +2 -2
- package/dist/index165.mjs +19 -2
- package/dist/index167.mjs +2 -2
- package/dist/index168.mjs +18 -64
- package/dist/index169.mjs +2 -2
- package/dist/index170.mjs +2 -53
- package/dist/index171.mjs +24 -2
- package/dist/index172.mjs +15 -28
- package/dist/index173.mjs +2 -152
- package/dist/index174.mjs +2 -2
- package/dist/index175.mjs +2 -2
- package/dist/index176.mjs +14 -10
- package/dist/index177.mjs +2 -2
- package/dist/index178.mjs +23 -2
- package/dist/index179.mjs +2 -26
- package/dist/index180.mjs +2 -2
- package/dist/index181.mjs +2 -2
- package/dist/index182.mjs +16 -17
- package/dist/index183.mjs +2 -23
- package/dist/index184.mjs +23 -2
- package/dist/index185.mjs +2 -2
- package/dist/index186.mjs +2 -2
- package/dist/index187.mjs +2 -23
- package/dist/index188.mjs +2 -2
- package/dist/index189.mjs +2 -23
- package/dist/index190.mjs +2 -2
- package/dist/index191.mjs +2 -2
- package/dist/index192.mjs +2 -2
- package/dist/index193.mjs +124 -20
- package/dist/index194.mjs +2 -2
- package/dist/index195.mjs +71 -20
- package/dist/index196.mjs +74 -2
- package/dist/index197.mjs +21 -2
- package/dist/index198.mjs +56 -2
- package/dist/index199.mjs +29 -2
- package/dist/index200.mjs +7 -2
- package/dist/index201.mjs +52 -2
- package/dist/index202.mjs +6 -2
- package/dist/index203.mjs +12 -2
- package/dist/index204.mjs +7 -127
- package/dist/index205.mjs +28 -2
- package/dist/index206.mjs +2 -74
- package/dist/index207.mjs +69 -73
- package/dist/index208.mjs +167 -2
- package/dist/index209.mjs +2 -31
- package/dist/index210.mjs +2 -11
- package/dist/index211.mjs +2 -4
- package/dist/index212.mjs +2 -4
- package/dist/index213.mjs +2 -13
- package/dist/index214.mjs +2 -7
- package/dist/index215.mjs +2 -2
- package/dist/index216.mjs +2 -2
- package/dist/index217.mjs +108 -2
- package/dist/index218.mjs +2 -2
- package/dist/index220.mjs +37 -2
- package/dist/index221.mjs +2 -2
- package/dist/index222.mjs +244 -2
- package/dist/index223.mjs +2 -108
- package/dist/index224.mjs +33 -2
- package/dist/index225.mjs +65 -2
- package/dist/index226.mjs +19 -31
- package/dist/index227.mjs +2 -2
- package/dist/index228.mjs +2 -2
- package/dist/index229.mjs +2 -244
- package/dist/index230.mjs +2 -2
- package/dist/index231.mjs +2 -33
- package/dist/index232.mjs +2 -65
- package/dist/index233.mjs +2 -25
- package/dist/index234.mjs +2 -2
- package/dist/index236.mjs +2 -2
- package/dist/index237.mjs +4 -2
- package/dist/index238.mjs +2 -2
- package/dist/index239.mjs +2 -12
- package/dist/index240.mjs +30 -4
- package/dist/index241.mjs +11 -33
- package/dist/index242.mjs +4 -31
- package/dist/index243.mjs +4 -28
- package/dist/index244.mjs +12 -60
- package/dist/index245.mjs +7 -2
- package/dist/index246.mjs +12 -2
- package/dist/index247.mjs +5 -2
- package/dist/index248.mjs +33 -4
- package/dist/index249.mjs +31 -2
- package/dist/index250.mjs +28 -2
- package/dist/index251.mjs +61 -2
- package/dist/index252.mjs +2 -2
- package/dist/index253.mjs +18 -2
- package/dist/index254.mjs +42 -13
- package/dist/index255.mjs +2 -47
- package/dist/index260.mjs +1 -1
- package/dist/index262.mjs +2 -3
- package/dist/index263.mjs +2 -2
- package/dist/index264.mjs +2 -2
- package/dist/index265.mjs +3 -17
- package/dist/index266.mjs +2 -13
- package/dist/index267.mjs +2 -6
- package/dist/index268.mjs +17 -30
- package/dist/index269.mjs +13 -2
- package/dist/index270.mjs +6 -2
- package/dist/index271.mjs +30 -2
- package/dist/index40.mjs +1 -1
- package/dist/index46.mjs +1 -1
- package/dist/index51.mjs +17 -17
- package/dist/index52.mjs +2 -2
- package/dist/index66.mjs +149 -19
- package/dist/index67.mjs +19 -149
- package/dist/index74.mjs +35 -35
- package/dist/index75.mjs +1 -1
- package/dist/index76.mjs +2 -2
- package/dist/index77.mjs +2 -2
- package/dist/index80.mjs +2 -235
- package/dist/index81.mjs +27 -5
- package/dist/index82.mjs +14 -130
- package/dist/index83.mjs +214 -67
- package/dist/index84.mjs +175 -82
- package/dist/index85.mjs +21 -28
- package/dist/index86.mjs +22 -8
- package/dist/index87.mjs +30 -72
- package/dist/index88.mjs +155 -3
- package/dist/index89.mjs +20 -2
- package/dist/index90.mjs +29 -81
- package/dist/index91.mjs +83 -53
- package/dist/index92.mjs +37 -5
- package/dist/index93.mjs +144 -4
- package/dist/index94.mjs +49 -173
- package/dist/index95.mjs +23 -53
- package/dist/index96.mjs +27 -69
- package/dist/index97.mjs +23 -34
- package/dist/index98.mjs +24 -42
- package/dist/index99.mjs +21 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/Checkout.tsx +22 -0
package/dist/index13.mjs
CHANGED
|
@@ -1,170 +1,170 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs as a, jsx as e, Fragment as Me } from "react/jsx-runtime";
|
|
3
|
-
import { useState as w, useEffect as
|
|
4
|
-
import { object as
|
|
3
|
+
import { useState as w, useEffect as S, useMemo as K, useCallback as qe } from "react";
|
|
4
|
+
import { object as G, string as N, ValidationError as Ie } from "./index43.mjs";
|
|
5
5
|
import "./index21.mjs";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
7
|
import { useGetDeliveryZones as je } from "./index36.mjs";
|
|
8
|
-
import { useCart as
|
|
8
|
+
import { useCart as Se } from "./index3.mjs";
|
|
9
9
|
import { Modal as oe } from "./index17.mjs";
|
|
10
10
|
import { FormInput as q } from "./index18.mjs";
|
|
11
11
|
import { FormSelect as me } from "./index19.mjs";
|
|
12
|
-
import { Button as
|
|
13
|
-
import { Loader2 as
|
|
14
|
-
import { formatCurrency as I, cn as P, getFbCookies as ye, getTikTokCookies as
|
|
15
|
-
import
|
|
12
|
+
import { Button as _ } from "./index14.mjs";
|
|
13
|
+
import { Loader2 as O, ChevronLeft as Ze, ChevronRight as Le, CheckCircle as ze, Package as he, Banknote as ue, Mail as Fe, Phone as Te, ChevronDown as Ae, Zap as _e } from "lucide-react";
|
|
14
|
+
import { formatCurrency as I, cn as P, getFbCookies as ye, getTikTokCookies as pe } from "./index20.mjs";
|
|
15
|
+
import Be from "./index44.mjs";
|
|
16
16
|
import { usePaystackPayment as Re } from "./index45.mjs";
|
|
17
|
-
const $e = (
|
|
18
|
-
firstName:
|
|
19
|
-
lastName:
|
|
20
|
-
email:
|
|
21
|
-
phone:
|
|
22
|
-
if (!
|
|
23
|
-
const j =
|
|
17
|
+
const We = "2348125648668", $e = `https://wa.me/${We}`, He = (i) => i.replace(/\D/g, ""), Ke = G({
|
|
18
|
+
firstName: N().required("First name is required").min(2, "First name must be at least 2 characters").max(50, "First name must be less than 50 characters"),
|
|
19
|
+
lastName: N().required("Last name is required").min(2, "Last name must be at least 2 characters").max(50, "Last name must be less than 50 characters"),
|
|
20
|
+
email: N().required("Email is required").email("Please enter a valid email address"),
|
|
21
|
+
phone: N().required("Phone number is required").test("nigerian-phone", "Please enter a valid Nigerian phone number (e.g. 0812 564 8668)", (i) => {
|
|
22
|
+
if (!i) return !1;
|
|
23
|
+
const j = He(i);
|
|
24
24
|
return [
|
|
25
25
|
/^0[789]\d{9}$/
|
|
26
26
|
// 0xxxxxxxxx (11 digits total)
|
|
27
|
-
].some((
|
|
27
|
+
].some((v) => v.test(j));
|
|
28
28
|
})
|
|
29
|
-
}), Oe =
|
|
30
|
-
address:
|
|
31
|
-
city:
|
|
32
|
-
state:
|
|
33
|
-
deliveryZoneId:
|
|
34
|
-
}), Ge =
|
|
35
|
-
paymentMethod:
|
|
29
|
+
}), Oe = G({
|
|
30
|
+
address: N().required("Street address is required").min(10, "Please provide a complete address"),
|
|
31
|
+
city: N().required("City is required").min(3, "City name must be at least 3 characters"),
|
|
32
|
+
state: N().required("State is required").test("not-empty", "State is required", (i) => !!i && i.trim() !== ""),
|
|
33
|
+
deliveryZoneId: N().required("Delivery zone is required").test("not-empty", "Delivery zone is required", (i) => !!i && i.trim() !== "")
|
|
34
|
+
}), Ge = G({
|
|
35
|
+
paymentMethod: N().oneOf(["cod", "online"], "Please select a payment method").required("Payment method is required")
|
|
36
36
|
});
|
|
37
|
-
function
|
|
38
|
-
isOpen:
|
|
37
|
+
function dt({
|
|
38
|
+
isOpen: i,
|
|
39
39
|
onClose: j,
|
|
40
|
-
initialData:
|
|
41
|
-
onSuccess:
|
|
40
|
+
initialData: l,
|
|
41
|
+
onSuccess: v,
|
|
42
42
|
onError: c,
|
|
43
|
-
submitButtonText:
|
|
44
|
-
refundPolicy:
|
|
43
|
+
submitButtonText: fe = "Place Order",
|
|
44
|
+
refundPolicy: Z
|
|
45
45
|
}) {
|
|
46
|
-
var te, ae, re, se, le,
|
|
47
|
-
const [o,
|
|
48
|
-
isOpen:
|
|
46
|
+
var te, ae, re, se, ne, le, ie, de, ce;
|
|
47
|
+
const [o, g] = w("customer"), [L, Ne] = w(void 0), [p, U] = w(void 0), [f, B] = w(null), { refetch: V, isLoading: Y, cart: s, updateCartMutation: R, checkoutMutation: ve, clearAndCreateNewCart: J } = Se(), Q = (te = s == null ? void 0 : s.brand) == null ? void 0 : te.paystackPublicKey, X = Re({
|
|
48
|
+
isOpen: i,
|
|
49
49
|
publicKey: Q || "",
|
|
50
50
|
onSuccess: async (t) => {
|
|
51
51
|
try {
|
|
52
|
-
const { fbc:
|
|
52
|
+
const { fbc: n, fbp: d } = ye(), { ttp: y, ttclid: M } = pe(), x = await k.mutateAsync({
|
|
53
53
|
firstName: r.firstName,
|
|
54
54
|
lastName: r.lastName,
|
|
55
55
|
email: r.email,
|
|
56
56
|
phone: r.phone,
|
|
57
57
|
address: r.address,
|
|
58
58
|
city: r.city,
|
|
59
|
-
deliveryZoneId:
|
|
59
|
+
deliveryZoneId: p || r.deliveryZoneId,
|
|
60
60
|
paymentMethod: r.paymentMethod,
|
|
61
61
|
paystackReference: t.reference,
|
|
62
|
-
fbc:
|
|
63
|
-
fbp:
|
|
62
|
+
fbc: n,
|
|
63
|
+
fbp: d,
|
|
64
64
|
ttp: y,
|
|
65
65
|
ttclid: M
|
|
66
66
|
});
|
|
67
67
|
if ("error" in x) {
|
|
68
|
-
const
|
|
69
|
-
c == null || c(new Error((
|
|
68
|
+
const H = x.error;
|
|
69
|
+
c == null || c(new Error((H == null ? void 0 : H.message) || "Checkout failed"));
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
} catch (
|
|
74
|
-
c == null || c(
|
|
72
|
+
B(x), J(), v == null || v(x.id);
|
|
73
|
+
} catch (n) {
|
|
74
|
+
c == null || c(n);
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
onClose: () => {
|
|
78
78
|
console.log("Payment popup closed by user");
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, [
|
|
81
|
+
S(() => {
|
|
82
|
+
i && V();
|
|
83
|
+
}, [i, V]);
|
|
84
84
|
const { data: C } = je(((ae = s == null ? void 0 : s.brand) == null ? void 0 : ae.id) || "", {
|
|
85
85
|
enabled: !!((re = s == null ? void 0 : s.brand) != null && re.id)
|
|
86
|
-
}), m =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
const [r,
|
|
91
|
-
firstName: (
|
|
92
|
-
lastName: (
|
|
93
|
-
email: (
|
|
94
|
-
phone: (
|
|
95
|
-
address: (
|
|
96
|
-
city: (
|
|
97
|
-
deliveryZoneId: (
|
|
98
|
-
paymentMethod: (
|
|
99
|
-
notes: (
|
|
86
|
+
}), m = K(() => C == null ? void 0 : C.find((t) => t.id === L), [C, L]), u = K(() => m == null ? void 0 : m.zones.find((t) => t.id === p), [m, p]), k = ve;
|
|
87
|
+
S(() => {
|
|
88
|
+
i || (B(null), g("customer"), k.reset());
|
|
89
|
+
}, [i]);
|
|
90
|
+
const [r, W] = w({
|
|
91
|
+
firstName: (l == null ? void 0 : l.firstName) || "",
|
|
92
|
+
lastName: (l == null ? void 0 : l.lastName) || "",
|
|
93
|
+
email: (l == null ? void 0 : l.email) || "",
|
|
94
|
+
phone: (l == null ? void 0 : l.phone) || "",
|
|
95
|
+
address: (l == null ? void 0 : l.address) || "",
|
|
96
|
+
city: (l == null ? void 0 : l.city) || "",
|
|
97
|
+
deliveryZoneId: (l == null ? void 0 : l.deliveryZoneId) || "",
|
|
98
|
+
paymentMethod: (l == null ? void 0 : l.paymentMethod) || "online",
|
|
99
|
+
notes: (l == null ? void 0 : l.notes) || ""
|
|
100
100
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}, [
|
|
101
|
+
S(() => {
|
|
102
|
+
i && g("customer");
|
|
103
|
+
}, [i]);
|
|
104
104
|
const [E, D] = w(!1);
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
var
|
|
105
|
+
S(() => {
|
|
106
|
+
i && s && !l && !E && (W((t) => {
|
|
107
|
+
var n;
|
|
108
108
|
return {
|
|
109
109
|
...t,
|
|
110
110
|
firstName: s.customerFirstName || t.firstName,
|
|
111
111
|
lastName: s.customerLastName || t.lastName,
|
|
112
112
|
email: s.customerEmail || t.email,
|
|
113
113
|
phone: s.customerPhone || t.phone,
|
|
114
|
-
deliveryZoneId: ((
|
|
114
|
+
deliveryZoneId: ((n = s.deliveryZone) == null ? void 0 : n.id) || t.deliveryZoneId
|
|
115
115
|
};
|
|
116
|
-
}), D(!0)),
|
|
117
|
-
}, [
|
|
118
|
-
if (
|
|
119
|
-
const t = m == null ? void 0 : m.zones.find((
|
|
120
|
-
t &&
|
|
121
|
-
...
|
|
116
|
+
}), D(!0)), i || D(!1);
|
|
117
|
+
}, [i, s, l, E]), S(() => {
|
|
118
|
+
if (p) {
|
|
119
|
+
const t = m == null ? void 0 : m.zones.find((n) => n.id === p);
|
|
120
|
+
t && W((n) => ({
|
|
121
|
+
...n,
|
|
122
122
|
paymentMethod: t.allowOnline ? "online" : "cod"
|
|
123
123
|
}));
|
|
124
124
|
}
|
|
125
|
-
}, [
|
|
126
|
-
const [
|
|
127
|
-
const { name:
|
|
128
|
-
|
|
129
|
-
},
|
|
125
|
+
}, [p, m]);
|
|
126
|
+
const [h, z] = w({}), [$, ge] = w(!1), b = (t) => {
|
|
127
|
+
const { name: n, value: d } = t.target;
|
|
128
|
+
W((y) => ({ ...y, [n]: d })), h[n] && z((y) => ({ ...y, [n]: void 0 }));
|
|
129
|
+
}, F = qe(
|
|
130
130
|
(t) => {
|
|
131
|
-
const
|
|
132
|
-
if (!
|
|
133
|
-
const
|
|
134
|
-
t === "firstName" ?
|
|
131
|
+
const n = r[t];
|
|
132
|
+
if (!n) return;
|
|
133
|
+
const d = {};
|
|
134
|
+
t === "firstName" ? d.customerFirstName = n : t === "lastName" ? d.customerLastName = n : t === "email" ? d.customerEmail = n : t === "phone" && (d.customerPhone = n), R.mutate(d);
|
|
135
135
|
},
|
|
136
136
|
[r, R]
|
|
137
137
|
), T = (t) => {
|
|
138
|
-
const
|
|
138
|
+
const n = {};
|
|
139
139
|
try {
|
|
140
140
|
if (t === "customer")
|
|
141
141
|
Ke.validateSync(r, { abortEarly: !1 });
|
|
142
142
|
else if (t === "delivery") {
|
|
143
|
-
const
|
|
143
|
+
const d = {
|
|
144
144
|
address: r.address,
|
|
145
145
|
city: r.city,
|
|
146
|
-
state:
|
|
147
|
-
deliveryZoneId:
|
|
146
|
+
state: L || r.state || "",
|
|
147
|
+
deliveryZoneId: p || r.deliveryZoneId || ""
|
|
148
148
|
};
|
|
149
|
-
Oe.validateSync(
|
|
149
|
+
Oe.validateSync(d, { abortEarly: !1 });
|
|
150
150
|
} else t === "payment" && Ge.validateSync(r, { abortEarly: !1 });
|
|
151
|
-
} catch (
|
|
152
|
-
|
|
153
|
-
y.path && (
|
|
151
|
+
} catch (d) {
|
|
152
|
+
d instanceof Ie && d.inner.forEach((y) => {
|
|
153
|
+
y.path && (n[y.path] = y.message);
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
return
|
|
157
|
-
},
|
|
158
|
-
T(o) && (o === "customer" ?
|
|
156
|
+
return z(n), Object.keys(n).length === 0;
|
|
157
|
+
}, be = () => {
|
|
158
|
+
T(o) && (o === "customer" ? g("delivery") : o === "delivery" && g("payment"));
|
|
159
159
|
}, xe = () => {
|
|
160
|
-
o === "payment" ?
|
|
160
|
+
o === "payment" ? g("delivery") : o === "delivery" && g("customer");
|
|
161
161
|
}, we = async () => {
|
|
162
162
|
if (!T("customer")) {
|
|
163
|
-
|
|
163
|
+
g("customer");
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
if (!T("delivery")) {
|
|
167
|
-
|
|
167
|
+
g("delivery");
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
if (T("payment")) {
|
|
@@ -201,18 +201,18 @@ function nt({
|
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
try {
|
|
204
|
-
const { fbc: t, fbp:
|
|
204
|
+
const { fbc: t, fbp: n } = ye(), { ttp: d, ttclid: y } = pe(), M = await k.mutateAsync({
|
|
205
205
|
firstName: r.firstName,
|
|
206
206
|
lastName: r.lastName,
|
|
207
207
|
email: r.email,
|
|
208
208
|
phone: r.phone,
|
|
209
209
|
address: r.address,
|
|
210
210
|
city: r.city,
|
|
211
|
-
deliveryZoneId:
|
|
211
|
+
deliveryZoneId: p || r.deliveryZoneId,
|
|
212
212
|
paymentMethod: r.paymentMethod,
|
|
213
213
|
fbc: t,
|
|
214
|
-
fbp:
|
|
215
|
-
ttp:
|
|
214
|
+
fbp: n,
|
|
215
|
+
ttp: d,
|
|
216
216
|
ttclid: y
|
|
217
217
|
});
|
|
218
218
|
if ("error" in M) {
|
|
@@ -220,7 +220,7 @@ function nt({
|
|
|
220
220
|
c == null || c(new Error((x == null ? void 0 : x.message) || "Checkout failed"));
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
B(M), J(), v == null || v(M.id);
|
|
224
224
|
} catch (t) {
|
|
225
225
|
c == null || c(t);
|
|
226
226
|
}
|
|
@@ -229,23 +229,23 @@ function nt({
|
|
|
229
229
|
customer: "Customer Information",
|
|
230
230
|
delivery: "Delivery Address",
|
|
231
231
|
payment: "Payment Method"
|
|
232
|
-
}, Pe =
|
|
232
|
+
}, Pe = K(() => Ce[o], [o]), ke = /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
233
233
|
(o === "payment" || o === "delivery") && ((se = s == null ? void 0 : s.pricing) == null ? void 0 : se.total) && /* @__PURE__ */ a("div", { className: "text-sm text-black relative", children: [
|
|
234
|
-
|
|
234
|
+
Y && /* @__PURE__ */ e("div", { className: "absolute flex items-center justify-center inset-0 bg-white opacity-50", children: /* @__PURE__ */ e(O, { className: "animate-spin text-accent-500" }) }),
|
|
235
235
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
236
236
|
/* @__PURE__ */ e("span", { children: "Subtotal" }),
|
|
237
|
-
/* @__PURE__ */ e("span", { children: I(((
|
|
237
|
+
/* @__PURE__ */ e("span", { children: I(((ne = s == null ? void 0 : s.pricing) == null ? void 0 : ne.subtotal) ?? 0) })
|
|
238
238
|
] }),
|
|
239
239
|
s.pricing.discount && /* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
240
240
|
/* @__PURE__ */ e("span", { children: "Discount" }),
|
|
241
241
|
/* @__PURE__ */ a("span", { className: "text-green-600", children: [
|
|
242
242
|
"-",
|
|
243
|
-
I(((
|
|
243
|
+
I(((ie = (le = s == null ? void 0 : s.pricing) == null ? void 0 : le.discount) == null ? void 0 : ie.amount) ?? 0)
|
|
244
244
|
] })
|
|
245
245
|
] }),
|
|
246
246
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
247
247
|
/* @__PURE__ */ e("span", { children: "Delivery Fee" }),
|
|
248
|
-
/* @__PURE__ */ e("span", { children: I(((
|
|
248
|
+
/* @__PURE__ */ e("span", { children: I(((de = s == null ? void 0 : s.pricing) == null ? void 0 : de.deliveryCharge) ?? 0) })
|
|
249
249
|
] }),
|
|
250
250
|
/* @__PURE__ */ e("hr", { className: "border-gray-200 my-2" }),
|
|
251
251
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
@@ -255,7 +255,7 @@ function nt({
|
|
|
255
255
|
] }),
|
|
256
256
|
/* @__PURE__ */ a("div", { className: "flex gap-3", children: [
|
|
257
257
|
o !== "customer" && /* @__PURE__ */ a(
|
|
258
|
-
|
|
258
|
+
_,
|
|
259
259
|
{
|
|
260
260
|
type: "button",
|
|
261
261
|
variant: "outline",
|
|
@@ -263,25 +263,25 @@ function nt({
|
|
|
263
263
|
className: "flex-1 border-gray-400",
|
|
264
264
|
size: "lg",
|
|
265
265
|
children: [
|
|
266
|
-
/* @__PURE__ */ e(
|
|
266
|
+
/* @__PURE__ */ e(Ze, { className: "mr-2 h-4 w-4" }),
|
|
267
267
|
"Back"
|
|
268
268
|
]
|
|
269
269
|
}
|
|
270
270
|
),
|
|
271
271
|
o !== "payment" ? /* @__PURE__ */ a(
|
|
272
|
-
|
|
272
|
+
_,
|
|
273
273
|
{
|
|
274
274
|
type: "button",
|
|
275
|
-
onClick:
|
|
275
|
+
onClick: be,
|
|
276
276
|
className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
|
|
277
277
|
size: "lg",
|
|
278
278
|
children: [
|
|
279
279
|
"Next",
|
|
280
|
-
/* @__PURE__ */ e(
|
|
280
|
+
/* @__PURE__ */ e(Le, { className: "ml-2 h-4 w-4" })
|
|
281
281
|
]
|
|
282
282
|
}
|
|
283
283
|
) : /* @__PURE__ */ e(
|
|
284
|
-
|
|
284
|
+
_,
|
|
285
285
|
{
|
|
286
286
|
type: "button",
|
|
287
287
|
onClick: we,
|
|
@@ -289,23 +289,23 @@ function nt({
|
|
|
289
289
|
className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
|
|
290
290
|
size: "lg",
|
|
291
291
|
children: k.isPending ? /* @__PURE__ */ a(Me, { children: [
|
|
292
|
-
/* @__PURE__ */ e(
|
|
292
|
+
/* @__PURE__ */ e(O, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
293
293
|
"Processing..."
|
|
294
|
-
] }) :
|
|
294
|
+
] }) : fe
|
|
295
295
|
}
|
|
296
296
|
)
|
|
297
297
|
] }),
|
|
298
298
|
k.isError && /* @__PURE__ */ e("div", { className: "rounded-lg bg-red-50 p-3 text-sm text-red-600", children: "Failed to place order. Please check your information and try again." })
|
|
299
|
-
] }),
|
|
300
|
-
if (
|
|
299
|
+
] }), A = (t) => !(s != null && s.availablePaymentMethods.includes(t));
|
|
300
|
+
if (f)
|
|
301
301
|
return /* @__PURE__ */ e(
|
|
302
302
|
oe,
|
|
303
303
|
{
|
|
304
|
-
isOpen:
|
|
304
|
+
isOpen: i,
|
|
305
305
|
onClose: j,
|
|
306
306
|
title: "Order Placed Successfully!",
|
|
307
307
|
footer: /* @__PURE__ */ e(
|
|
308
|
-
|
|
308
|
+
_,
|
|
309
309
|
{
|
|
310
310
|
onClick: j,
|
|
311
311
|
className: "w-full bg-accent-500 text-white hover:bg-accent-600",
|
|
@@ -316,43 +316,43 @@ function nt({
|
|
|
316
316
|
size: "lg",
|
|
317
317
|
contentClassName: "p-6",
|
|
318
318
|
children: /* @__PURE__ */ a("div", { className: "text-center space-y-6", children: [
|
|
319
|
-
/* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
319
|
+
/* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e(ze, { className: "h-12 w-12 text-green-600" }) }) }),
|
|
320
320
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
321
321
|
/* @__PURE__ */ e("h3", { className: "text-2xl font-bold text-gray-900", children: "Thank You!" }),
|
|
322
322
|
/* @__PURE__ */ e("p", { className: "text-gray-600", children: "Your order has been placed successfully." })
|
|
323
323
|
] }),
|
|
324
324
|
/* @__PURE__ */ a("div", { className: "bg-gray-50 rounded-lg p-6 space-y-4", children: [
|
|
325
325
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-center space-x-2 text-gray-700", children: [
|
|
326
|
-
/* @__PURE__ */ e(
|
|
326
|
+
/* @__PURE__ */ e(he, { className: "h-5 w-5" }),
|
|
327
327
|
/* @__PURE__ */ a("span", { className: "font-medium", children: [
|
|
328
328
|
"Order #",
|
|
329
|
-
|
|
329
|
+
f.orderNumber
|
|
330
330
|
] })
|
|
331
331
|
] }),
|
|
332
332
|
/* @__PURE__ */ a("div", { className: "border-t border-gray-200 pt-4 space-y-3", children: [
|
|
333
333
|
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
334
334
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Customer" }),
|
|
335
335
|
/* @__PURE__ */ a("span", { className: "font-medium text-gray-900", children: [
|
|
336
|
-
|
|
336
|
+
f.firstName,
|
|
337
337
|
" ",
|
|
338
|
-
|
|
338
|
+
f.lastName
|
|
339
339
|
] })
|
|
340
340
|
] }),
|
|
341
341
|
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
342
342
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Phone" }),
|
|
343
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
343
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: f.phone })
|
|
344
344
|
] }),
|
|
345
|
-
|
|
345
|
+
f.email && /* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
346
346
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Email" }),
|
|
347
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
347
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: f.email })
|
|
348
348
|
] }),
|
|
349
349
|
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
350
350
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Payment Method" }),
|
|
351
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
351
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: f.paymentMethod === "cod" ? "Cash on Delivery" : "Online Payment" })
|
|
352
352
|
] }),
|
|
353
353
|
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
354
354
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Total" }),
|
|
355
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900", children: I(
|
|
355
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900", children: I(f.totalPrice) })
|
|
356
356
|
] })
|
|
357
357
|
] })
|
|
358
358
|
] }),
|
|
@@ -364,33 +364,53 @@ function nt({
|
|
|
364
364
|
] })
|
|
365
365
|
}
|
|
366
366
|
);
|
|
367
|
-
const ee =
|
|
367
|
+
const ee = u && (o === "delivery" || o === "payment") && (u.waybillOnly || !(u != null && u.allowCOD));
|
|
368
368
|
return /* @__PURE__ */ e(
|
|
369
369
|
oe,
|
|
370
370
|
{
|
|
371
|
-
isOpen:
|
|
371
|
+
isOpen: i,
|
|
372
372
|
onClose: j,
|
|
373
373
|
title: Pe,
|
|
374
374
|
footer: ke,
|
|
375
375
|
size: "lg",
|
|
376
376
|
contentClassName: "p-0",
|
|
377
|
-
children:
|
|
377
|
+
children: Y ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[300px]", children: /* @__PURE__ */ e(O, { className: "h-8 w-8 animate-spin text-gray-600" }) }) : /* @__PURE__ */ e("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ a("div", { className: "relative w-full", children: [
|
|
378
378
|
ee && /* @__PURE__ */ a("div", { className: "space-y-3 p-4 pb-0", children: [
|
|
379
|
-
|
|
380
|
-
/* @__PURE__ */ e(
|
|
379
|
+
u.noteTitle && u.noteContent && /* @__PURE__ */ e("div", { className: "bg-amber-50 border border-amber-200 rounded-lg p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
380
|
+
/* @__PURE__ */ e(he, { className: "h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5" }),
|
|
381
381
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
382
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-amber-900 whitespace-pre-wrap", children:
|
|
383
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-amber-800 whitespace-pre-wrap", children:
|
|
382
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-amber-900 whitespace-pre-wrap", children: u.noteTitle }),
|
|
383
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-amber-800 whitespace-pre-wrap", children: u.noteContent })
|
|
384
384
|
] })
|
|
385
385
|
] }) }),
|
|
386
|
-
!(
|
|
387
|
-
/* @__PURE__ */ e(
|
|
386
|
+
!(u != null && u.allowCOD) && /* @__PURE__ */ e("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
387
|
+
/* @__PURE__ */ e(ue, { className: "h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5" }),
|
|
388
388
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
389
389
|
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-blue-900", children: "Cash on Delivery Unavailable" }),
|
|
390
390
|
/* @__PURE__ */ e("p", { className: "text-sm text-blue-800", children: "We're unable to offer cash on delivery to this location. Please use online payment to complete your order." })
|
|
391
391
|
] })
|
|
392
392
|
] }) })
|
|
393
393
|
] }),
|
|
394
|
+
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ a(
|
|
395
|
+
"a",
|
|
396
|
+
{
|
|
397
|
+
href: $e,
|
|
398
|
+
target: "_blank",
|
|
399
|
+
rel: "noopener noreferrer",
|
|
400
|
+
className: "flex items-center justify-center gap-2 p-3 bg-green-500 hover:bg-green-600 rounded-lg transition-colors",
|
|
401
|
+
children: [
|
|
402
|
+
/* @__PURE__ */ e(
|
|
403
|
+
"img",
|
|
404
|
+
{
|
|
405
|
+
src: "https://toyland.ng/cdn-cgi/image/width=64/icon-whatsapp.svg",
|
|
406
|
+
alt: "WhatsApp",
|
|
407
|
+
className: "h-5 w-5"
|
|
408
|
+
}
|
|
409
|
+
),
|
|
410
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-white", children: "Need help with your order? Click to Contact us on WhatsApp" })
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
) }),
|
|
394
414
|
/* @__PURE__ */ a(
|
|
395
415
|
"div",
|
|
396
416
|
{
|
|
@@ -409,9 +429,9 @@ function nt({
|
|
|
409
429
|
type: "text",
|
|
410
430
|
name: "firstName",
|
|
411
431
|
value: r.firstName,
|
|
412
|
-
onChange:
|
|
413
|
-
onBlur: () =>
|
|
414
|
-
error:
|
|
432
|
+
onChange: b,
|
|
433
|
+
onBlur: () => F("firstName"),
|
|
434
|
+
error: h.firstName,
|
|
415
435
|
autoCorrect: "off",
|
|
416
436
|
required: !0
|
|
417
437
|
}
|
|
@@ -423,9 +443,9 @@ function nt({
|
|
|
423
443
|
type: "text",
|
|
424
444
|
name: "lastName",
|
|
425
445
|
value: r.lastName,
|
|
426
|
-
onChange:
|
|
427
|
-
onBlur: () =>
|
|
428
|
-
error:
|
|
446
|
+
onChange: b,
|
|
447
|
+
onBlur: () => F("lastName"),
|
|
448
|
+
error: h.lastName,
|
|
429
449
|
autoCorrect: "off",
|
|
430
450
|
required: !0
|
|
431
451
|
}
|
|
@@ -437,10 +457,10 @@ function nt({
|
|
|
437
457
|
type: "email",
|
|
438
458
|
name: "email",
|
|
439
459
|
value: r.email,
|
|
440
|
-
onChange:
|
|
441
|
-
onBlur: () =>
|
|
442
|
-
error:
|
|
443
|
-
icon: /* @__PURE__ */ e(
|
|
460
|
+
onChange: b,
|
|
461
|
+
onBlur: () => F("email"),
|
|
462
|
+
error: h.email,
|
|
463
|
+
icon: /* @__PURE__ */ e(Fe, { size: 16 }),
|
|
444
464
|
autoCorrect: "off",
|
|
445
465
|
required: !0
|
|
446
466
|
}
|
|
@@ -452,11 +472,11 @@ function nt({
|
|
|
452
472
|
type: "tel",
|
|
453
473
|
name: "phone",
|
|
454
474
|
value: r.phone,
|
|
455
|
-
onChange:
|
|
456
|
-
onBlur: () =>
|
|
475
|
+
onChange: b,
|
|
476
|
+
onBlur: () => F("phone"),
|
|
457
477
|
placeholder: "e.g. 08012345678",
|
|
458
478
|
maxLength: 18,
|
|
459
|
-
error:
|
|
479
|
+
error: h.phone,
|
|
460
480
|
icon: /* @__PURE__ */ e(Te, { size: 16 }),
|
|
461
481
|
autoCorrect: "off",
|
|
462
482
|
required: !0,
|
|
@@ -472,8 +492,8 @@ function nt({
|
|
|
472
492
|
type: "text",
|
|
473
493
|
name: "address",
|
|
474
494
|
value: r.address,
|
|
475
|
-
onChange:
|
|
476
|
-
error:
|
|
495
|
+
onChange: b,
|
|
496
|
+
error: h.address,
|
|
477
497
|
autoCorrect: "off",
|
|
478
498
|
required: !0
|
|
479
499
|
}
|
|
@@ -486,8 +506,8 @@ function nt({
|
|
|
486
506
|
type: "text",
|
|
487
507
|
name: "city",
|
|
488
508
|
value: r.city,
|
|
489
|
-
onChange:
|
|
490
|
-
error:
|
|
509
|
+
onChange: b,
|
|
510
|
+
error: h.city,
|
|
491
511
|
autoCorrect: "off",
|
|
492
512
|
required: !0
|
|
493
513
|
}
|
|
@@ -497,13 +517,13 @@ function nt({
|
|
|
497
517
|
{
|
|
498
518
|
label: "State",
|
|
499
519
|
name: "state",
|
|
500
|
-
value:
|
|
520
|
+
value: L || "",
|
|
501
521
|
onChange: (t) => {
|
|
502
|
-
|
|
503
|
-
const
|
|
504
|
-
|
|
522
|
+
U("");
|
|
523
|
+
const n = t.target.value;
|
|
524
|
+
Ne(n || void 0), h.state && z((d) => ({ ...d, state: void 0 }));
|
|
505
525
|
},
|
|
506
|
-
error:
|
|
526
|
+
error: h.state,
|
|
507
527
|
required: !0,
|
|
508
528
|
children: [
|
|
509
529
|
/* @__PURE__ */ e("option", { disabled: !0, value: "", children: "Select State" }),
|
|
@@ -515,13 +535,13 @@ function nt({
|
|
|
515
535
|
me,
|
|
516
536
|
{
|
|
517
537
|
label: "Delivery Zone",
|
|
518
|
-
value:
|
|
538
|
+
value: p || "",
|
|
519
539
|
onChange: (t) => {
|
|
520
|
-
const
|
|
521
|
-
|
|
540
|
+
const n = t.target.value;
|
|
541
|
+
U(n || void 0), h.deliveryZoneId && z((d) => ({ ...d, deliveryZoneId: void 0 })), n && R.mutate({ deliveryZoneId: n });
|
|
522
542
|
},
|
|
523
543
|
disabled: !m,
|
|
524
|
-
error:
|
|
544
|
+
error: h.deliveryZoneId,
|
|
525
545
|
required: !0,
|
|
526
546
|
children: [
|
|
527
547
|
/* @__PURE__ */ e("option", { disabled: !0, value: "", children: m ? "Select Delivery Zone" : "Select State First" }),
|
|
@@ -537,22 +557,22 @@ function nt({
|
|
|
537
557
|
] })
|
|
538
558
|
] }) }),
|
|
539
559
|
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ a("div", { className: "space-y-6", children: [
|
|
540
|
-
|
|
560
|
+
Z && /* @__PURE__ */ a("div", { className: `border border-gray-200 rounded-lg ${ee ? "mt-4" : ""}`, children: [
|
|
541
561
|
/* @__PURE__ */ a(
|
|
542
562
|
"button",
|
|
543
563
|
{
|
|
544
564
|
type: "button",
|
|
545
|
-
onClick: () =>
|
|
565
|
+
onClick: () => ge(!$),
|
|
546
566
|
className: "overflow-hidden w-full flex items-center overflow-hidden rounded-lg rounded-b-none justify-between p-4 text-left hover:bg-gray-50 transition-colors",
|
|
547
567
|
children: [
|
|
548
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-bold text-accent-700", children:
|
|
568
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-bold text-accent-700", children: Z.title || "🤔 Curious about Refunds?" }),
|
|
549
569
|
/* @__PURE__ */ e(
|
|
550
|
-
|
|
570
|
+
Ae,
|
|
551
571
|
{
|
|
552
572
|
size: 16,
|
|
553
573
|
className: P(
|
|
554
574
|
"transform transition-transform duration-200 text-gray-500",
|
|
555
|
-
|
|
575
|
+
$ && "rotate-180"
|
|
556
576
|
)
|
|
557
577
|
}
|
|
558
578
|
)
|
|
@@ -564,14 +584,14 @@ function nt({
|
|
|
564
584
|
{
|
|
565
585
|
className: P(
|
|
566
586
|
"overflow-hidden transition-all duration-300 ease-in-out",
|
|
567
|
-
|
|
587
|
+
$ ? "max-h-96 opacity-100" : "max-h-0 opacity-0"
|
|
568
588
|
),
|
|
569
|
-
children: /* @__PURE__ */ e("div", { className: "px-4 pb-4 border-t border-gray-100", children: /* @__PURE__ */ e("div", { className: "text-sm text-gray-600 space-y-3 pt-4", children:
|
|
589
|
+
children: /* @__PURE__ */ e("div", { className: "px-4 pb-4 border-t border-gray-100", children: /* @__PURE__ */ e("div", { className: "text-sm text-gray-600 space-y-3 pt-4", children: Z.policies && /* @__PURE__ */ a("div", { children: [
|
|
570
590
|
/* @__PURE__ */ e("h4", { className: "font-bold text-gray-800 mb-2", children: "Our Refund Policy" }),
|
|
571
|
-
/* @__PURE__ */ e("ul", { className: "space-y-1", children:
|
|
591
|
+
/* @__PURE__ */ e("ul", { className: "space-y-1", children: Z.policies.map((t, n) => /* @__PURE__ */ a("li", { className: "flex items-start", children: [
|
|
572
592
|
/* @__PURE__ */ e("span", { className: "text-green-600 mr-2", children: "✓" }),
|
|
573
593
|
/* @__PURE__ */ e("span", { children: t })
|
|
574
|
-
] },
|
|
594
|
+
] }, n)) })
|
|
575
595
|
] }) }) })
|
|
576
596
|
}
|
|
577
597
|
)
|
|
@@ -583,7 +603,7 @@ function nt({
|
|
|
583
603
|
className: P(
|
|
584
604
|
"flex items-center justify-center relative p-4 border-2 rounded-xl cursor-pointer transition-all duration-200",
|
|
585
605
|
r.paymentMethod === "online" ? "border-accent-500 bg-accent-50" : "border-gray-200 hover:border-gray-300",
|
|
586
|
-
|
|
606
|
+
A("online") && "opacity-50 cursor-not-allowed"
|
|
587
607
|
),
|
|
588
608
|
children: [
|
|
589
609
|
/* @__PURE__ */ e(
|
|
@@ -592,9 +612,9 @@ function nt({
|
|
|
592
612
|
type: "radio",
|
|
593
613
|
name: "paymentMethod",
|
|
594
614
|
value: "online",
|
|
595
|
-
disabled:
|
|
615
|
+
disabled: A("online"),
|
|
596
616
|
checked: r.paymentMethod === "online",
|
|
597
|
-
onChange:
|
|
617
|
+
onChange: b,
|
|
598
618
|
className: "sr-only"
|
|
599
619
|
}
|
|
600
620
|
),
|
|
@@ -606,7 +626,7 @@ function nt({
|
|
|
606
626
|
"p-3 rounded-full",
|
|
607
627
|
r.paymentMethod === "online" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
|
|
608
628
|
),
|
|
609
|
-
children: /* @__PURE__ */ e(
|
|
629
|
+
children: /* @__PURE__ */ e(_e, { size: 24 })
|
|
610
630
|
}
|
|
611
631
|
),
|
|
612
632
|
/* @__PURE__ */ a("div", { children: [
|
|
@@ -615,7 +635,7 @@ function nt({
|
|
|
615
635
|
/* @__PURE__ */ e(
|
|
616
636
|
"img",
|
|
617
637
|
{
|
|
618
|
-
src:
|
|
638
|
+
src: Be,
|
|
619
639
|
alt: "Paystack",
|
|
620
640
|
className: "h-4 w-auto mt-2 mx-auto"
|
|
621
641
|
}
|
|
@@ -632,7 +652,7 @@ function nt({
|
|
|
632
652
|
className: P(
|
|
633
653
|
"flex items-center justify-center relative p-4 border-2 rounded-xl cursor-pointer transition-all duration-200",
|
|
634
654
|
r.paymentMethod === "cod" ? "border-accent-500 bg-accent-50" : "border-gray-200 hover:border-gray-300",
|
|
635
|
-
|
|
655
|
+
A("cod") && "opacity-50 cursor-not-allowed"
|
|
636
656
|
),
|
|
637
657
|
children: [
|
|
638
658
|
/* @__PURE__ */ e(
|
|
@@ -641,9 +661,9 @@ function nt({
|
|
|
641
661
|
type: "radio",
|
|
642
662
|
name: "paymentMethod",
|
|
643
663
|
value: "cod",
|
|
644
|
-
disabled:
|
|
664
|
+
disabled: A("cod"),
|
|
645
665
|
checked: r.paymentMethod === "cod",
|
|
646
|
-
onChange:
|
|
666
|
+
onChange: b,
|
|
647
667
|
className: "sr-only"
|
|
648
668
|
}
|
|
649
669
|
),
|
|
@@ -655,7 +675,7 @@ function nt({
|
|
|
655
675
|
"p-3 rounded-full",
|
|
656
676
|
r.paymentMethod === "cod" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
|
|
657
677
|
),
|
|
658
|
-
children: /* @__PURE__ */ e(
|
|
678
|
+
children: /* @__PURE__ */ e(ue, { size: 24 })
|
|
659
679
|
}
|
|
660
680
|
),
|
|
661
681
|
/* @__PURE__ */ a("div", { children: [
|
|
@@ -668,7 +688,7 @@ function nt({
|
|
|
668
688
|
}
|
|
669
689
|
)
|
|
670
690
|
] }),
|
|
671
|
-
|
|
691
|
+
h.paymentMethod && /* @__PURE__ */ e("p", { className: "text-red-600 text-sm", children: h.paymentMethod })
|
|
672
692
|
] }) })
|
|
673
693
|
]
|
|
674
694
|
}
|
|
@@ -678,5 +698,5 @@ function nt({
|
|
|
678
698
|
);
|
|
679
699
|
}
|
|
680
700
|
export {
|
|
681
|
-
|
|
701
|
+
dt as Checkout
|
|
682
702
|
};
|