@burdenoff/microfe-kadaikodi 2026.625.1 → 2026.626.2
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/kadaikodi/pages/HomePage.js +19 -14
- package/dist/kadaikodi/pages/HomePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +118 -83
- package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminDashboard.js +75 -46
- package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +144 -128
- package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +255 -237
- package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminProfilePage.js +129 -128
- package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +178 -150
- package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/CartManagementPage.js +182 -159
- package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/admin/UserManagementPage.js +325 -303
- package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +500 -469
- package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +534 -503
- package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +73 -48
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +103 -96
- package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +130 -129
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +673 -670
- package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +517 -514
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +140 -125
- package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/HelpSupportPage.js +302 -311
- package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/NotificationCenterPage.js +102 -91
- package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/kadaikodi/pages/common/SettingsPage.js +766 -734
- package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +366 -356
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDetailPage.js +243 -213
- package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +200 -195
- package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CheckoutPage.js +95 -89
- package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js +430 -387
- package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +488 -478
- package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +523 -512
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/FavoritesPage.js +83 -75
- package/dist/kadaikodi/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js +116 -108
- package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +67 -61
- package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js +90 -73
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/ReviewsPage.js +80 -72
- package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js +70 -53
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +289 -255
- package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +92 -84
- package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +63 -55
- package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js +339 -311
- package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +40 -32
- package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +174 -150
- package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +385 -381
- package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +302 -273
- package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js +87 -59
- package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +82 -75
- package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +81 -77
- package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +78 -71
- package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +2 -2
|
@@ -6,8 +6,9 @@ import { formatCurrency as a } from "../../utils/formatters.js";
|
|
|
6
6
|
import { useMemo as o, useState as s } from "react";
|
|
7
7
|
import { AlertCircle as c, ArrowLeft as l, Banknote as u, CheckCircle2 as d, CreditCard as f, Heart as p, Loader2 as m, MapPin as h, ShoppingBag as g, Smartphone as _, Wallet as v } from "lucide-react";
|
|
8
8
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
9
|
+
import { GlassCard as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
|
|
9
10
|
//#region src/kadaikodi/pages/customer/CheckoutPage.tsx
|
|
10
|
-
var
|
|
11
|
+
var C = [
|
|
11
12
|
{
|
|
12
13
|
id: "cash",
|
|
13
14
|
label: "Cash on Delivery",
|
|
@@ -32,66 +33,66 @@ var x = [
|
|
|
32
33
|
icon: v,
|
|
33
34
|
description: "Kadaikodi Wallet Balance"
|
|
34
35
|
}
|
|
35
|
-
],
|
|
36
|
+
], w = [
|
|
36
37
|
0,
|
|
37
38
|
10,
|
|
38
39
|
20,
|
|
39
40
|
30
|
|
40
41
|
];
|
|
41
|
-
function
|
|
42
|
-
let { navigateTo: u, currentUser: _ } = e(), { data: v = [], isLoading:
|
|
42
|
+
function T() {
|
|
43
|
+
let { navigateTo: u, currentUser: _ } = e(), { data: v = [], isLoading: T } = r({ customerId: _?.id }), E = i(), D = o(() => v.find((e) => e.status === "pending") || v[0], [v]), [O, k] = s({
|
|
43
44
|
addressLine1: "",
|
|
44
45
|
addressLine2: "",
|
|
45
46
|
city: "Bangalore",
|
|
46
47
|
state: "Karnataka",
|
|
47
48
|
pincode: ""
|
|
48
|
-
}), [
|
|
49
|
+
}), [A, j] = s("cash"), [M, N] = s({
|
|
49
50
|
cardNumber: "",
|
|
50
51
|
expiryDate: "",
|
|
51
52
|
cvv: "",
|
|
52
53
|
upiId: ""
|
|
53
|
-
}), [
|
|
54
|
-
if (!
|
|
54
|
+
}), [P, F] = s(0), [I, L] = s(""), [R, z] = s(""), [B, V] = s(!1), H = o(() => {
|
|
55
|
+
if (!D) return {
|
|
55
56
|
subtotal: 0,
|
|
56
57
|
deliveryFee: 0,
|
|
57
58
|
tax: 0,
|
|
58
59
|
total: 0
|
|
59
60
|
};
|
|
60
|
-
let e =
|
|
61
|
+
let e = D.subtotal, t = D.deliveryFee, n = D.taxes, r = D.discount ?? 0;
|
|
61
62
|
return {
|
|
62
63
|
subtotal: e,
|
|
63
64
|
deliveryFee: t,
|
|
64
65
|
tax: n,
|
|
65
66
|
discount: r,
|
|
66
|
-
total: e + t + n +
|
|
67
|
+
total: e + t + n + P - r
|
|
67
68
|
};
|
|
68
|
-
}, [
|
|
69
|
-
|
|
69
|
+
}, [D, P]), U = o(() => D ? D.items.reduce((e, t) => e + t.quantity, 0) : 0, [D]), W = (e, t) => {
|
|
70
|
+
k((n) => ({
|
|
70
71
|
...n,
|
|
71
72
|
[e]: t
|
|
72
73
|
}));
|
|
73
|
-
},
|
|
74
|
-
|
|
74
|
+
}, G = (e, t) => {
|
|
75
|
+
N((n) => ({
|
|
75
76
|
...n,
|
|
76
77
|
[e]: t
|
|
77
78
|
}));
|
|
78
|
-
},
|
|
79
|
-
if (!
|
|
80
|
-
if (!
|
|
81
|
-
if (
|
|
82
|
-
if (!
|
|
83
|
-
if (!
|
|
84
|
-
if (!
|
|
79
|
+
}, K = () => {
|
|
80
|
+
if (!O.addressLine1.trim()) return alert("Please enter delivery address"), !1;
|
|
81
|
+
if (!O.pincode.trim() || O.pincode.length !== 6) return alert("Please enter a valid 6-digit pincode"), !1;
|
|
82
|
+
if (A === "card") {
|
|
83
|
+
if (!M.cardNumber || M.cardNumber.length < 16) return alert("Please enter a valid 16-digit card number"), !1;
|
|
84
|
+
if (!M.expiryDate) return alert("Please enter card expiry date"), !1;
|
|
85
|
+
if (!M.cvv || M.cvv.length < 3) return alert("Please enter a valid 3-digit CVV"), !1;
|
|
85
86
|
}
|
|
86
|
-
return
|
|
87
|
+
return A === "upi" && !M.upiId.trim() ? (alert("Please enter UPI ID"), !1) : !0;
|
|
87
88
|
};
|
|
88
|
-
return
|
|
89
|
+
return T ? /* @__PURE__ */ y(n, {
|
|
89
90
|
title: "Checkout",
|
|
90
91
|
children: /* @__PURE__ */ y("div", {
|
|
91
92
|
className: "flex h-[60vh] items-center justify-center",
|
|
92
93
|
children: /* @__PURE__ */ y(m, { className: "h-8 w-8 animate-spin text-primary" })
|
|
93
94
|
})
|
|
94
|
-
}) :
|
|
95
|
+
}) : D ? /* @__PURE__ */ b(n, {
|
|
95
96
|
title: /* @__PURE__ */ b("div", {
|
|
96
97
|
className: "flex items-center gap-3",
|
|
97
98
|
children: [/* @__PURE__ */ y("button", {
|
|
@@ -102,7 +103,10 @@ function C() {
|
|
|
102
103
|
}), /* @__PURE__ */ y("span", { children: "Checkout" })]
|
|
103
104
|
}),
|
|
104
105
|
description: "Review your order and complete payment",
|
|
105
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ y(S, {
|
|
107
|
+
className: "mb-6",
|
|
108
|
+
children: "The last step before your food is on its way — confirm where it's going, pick how you'd like to pay, add a tip or special instructions, and review the total. Everything checks out? Place your order from the summary on the right."
|
|
109
|
+
}), /* @__PURE__ */ b("div", {
|
|
106
110
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
107
111
|
children: [/* @__PURE__ */ b("div", {
|
|
108
112
|
className: "lg:col-span-2 space-y-6",
|
|
@@ -124,8 +128,8 @@ function C() {
|
|
|
124
128
|
}), /* @__PURE__ */ y("input", {
|
|
125
129
|
type: "text",
|
|
126
130
|
placeholder: "Building, Street, Area",
|
|
127
|
-
value:
|
|
128
|
-
onChange: (e) =>
|
|
131
|
+
value: O.addressLine1,
|
|
132
|
+
onChange: (e) => W("addressLine1", e.target.value),
|
|
129
133
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
130
134
|
})] }),
|
|
131
135
|
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
@@ -134,8 +138,8 @@ function C() {
|
|
|
134
138
|
}), /* @__PURE__ */ y("input", {
|
|
135
139
|
type: "text",
|
|
136
140
|
placeholder: "Apartment, Suite, Floor (Optional)",
|
|
137
|
-
value:
|
|
138
|
-
onChange: (e) =>
|
|
141
|
+
value: O.addressLine2,
|
|
142
|
+
onChange: (e) => W("addressLine2", e.target.value),
|
|
139
143
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
140
144
|
})] }),
|
|
141
145
|
/* @__PURE__ */ b("div", {
|
|
@@ -148,8 +152,8 @@ function C() {
|
|
|
148
152
|
})]
|
|
149
153
|
}), /* @__PURE__ */ y("input", {
|
|
150
154
|
type: "text",
|
|
151
|
-
value:
|
|
152
|
-
onChange: (e) =>
|
|
155
|
+
value: O.city,
|
|
156
|
+
onChange: (e) => W("city", e.target.value),
|
|
153
157
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
154
158
|
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
155
159
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
@@ -159,8 +163,8 @@ function C() {
|
|
|
159
163
|
})]
|
|
160
164
|
}), /* @__PURE__ */ y("input", {
|
|
161
165
|
type: "text",
|
|
162
|
-
value:
|
|
163
|
-
onChange: (e) =>
|
|
166
|
+
value: O.state,
|
|
167
|
+
onChange: (e) => W("state", e.target.value),
|
|
164
168
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
165
169
|
})] })]
|
|
166
170
|
}),
|
|
@@ -174,8 +178,8 @@ function C() {
|
|
|
174
178
|
type: "text",
|
|
175
179
|
placeholder: "560001",
|
|
176
180
|
maxLength: 6,
|
|
177
|
-
value:
|
|
178
|
-
onChange: (e) =>
|
|
181
|
+
value: O.pincode,
|
|
182
|
+
onChange: (e) => W("pincode", e.target.value.replace(/\D/g, "")),
|
|
179
183
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
180
184
|
})] })
|
|
181
185
|
]
|
|
@@ -190,12 +194,12 @@ function C() {
|
|
|
190
194
|
}),
|
|
191
195
|
/* @__PURE__ */ y("div", {
|
|
192
196
|
className: "space-y-2",
|
|
193
|
-
children:
|
|
197
|
+
children: C.map((e) => {
|
|
194
198
|
let n = e.icon;
|
|
195
199
|
return /* @__PURE__ */ b("button", {
|
|
196
200
|
type: "button",
|
|
197
|
-
onClick: () =>
|
|
198
|
-
className: t("flex w-full items-center gap-4 rounded-lg border p-3 transition-colors text-left",
|
|
201
|
+
onClick: () => j(e.id),
|
|
202
|
+
className: t("flex w-full items-center gap-4 rounded-lg border p-3 transition-colors text-left", A === e.id ? "border-foreground bg-accent" : "border-border-subtle bg-bg-surface hover:bg-accent"),
|
|
199
203
|
children: [
|
|
200
204
|
/* @__PURE__ */ y("div", {
|
|
201
205
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-bg-sunken",
|
|
@@ -211,12 +215,12 @@ function C() {
|
|
|
211
215
|
children: e.description
|
|
212
216
|
})]
|
|
213
217
|
}),
|
|
214
|
-
|
|
218
|
+
A === e.id && /* @__PURE__ */ y(d, { className: "h-5 w-5 text-text-primary shrink-0" })
|
|
215
219
|
]
|
|
216
220
|
}, e.id);
|
|
217
221
|
})
|
|
218
222
|
}),
|
|
219
|
-
|
|
223
|
+
A === "card" && /* @__PURE__ */ b("div", {
|
|
220
224
|
className: "mt-4 space-y-4 border-t border-border-subtle pt-4",
|
|
221
225
|
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
222
226
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
@@ -228,8 +232,8 @@ function C() {
|
|
|
228
232
|
type: "text",
|
|
229
233
|
placeholder: "1234 5678 9012 3456",
|
|
230
234
|
maxLength: 16,
|
|
231
|
-
value:
|
|
232
|
-
onChange: (e) =>
|
|
235
|
+
value: M.cardNumber,
|
|
236
|
+
onChange: (e) => G("cardNumber", e.target.value.replace(/\D/g, "")),
|
|
233
237
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
234
238
|
})] }), /* @__PURE__ */ b("div", {
|
|
235
239
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
@@ -243,10 +247,10 @@ function C() {
|
|
|
243
247
|
type: "text",
|
|
244
248
|
placeholder: "MM/YY",
|
|
245
249
|
maxLength: 5,
|
|
246
|
-
value:
|
|
250
|
+
value: M.expiryDate,
|
|
247
251
|
onChange: (e) => {
|
|
248
252
|
let t = e.target.value.replace(/\D/g, "");
|
|
249
|
-
t.length >= 2 && (t = t.slice(0, 2) + "/" + t.slice(2, 4)),
|
|
253
|
+
t.length >= 2 && (t = t.slice(0, 2) + "/" + t.slice(2, 4)), G("expiryDate", t);
|
|
250
254
|
},
|
|
251
255
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
252
256
|
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
@@ -259,13 +263,13 @@ function C() {
|
|
|
259
263
|
type: "text",
|
|
260
264
|
placeholder: "123",
|
|
261
265
|
maxLength: 3,
|
|
262
|
-
value:
|
|
263
|
-
onChange: (e) =>
|
|
266
|
+
value: M.cvv,
|
|
267
|
+
onChange: (e) => G("cvv", e.target.value.replace(/\D/g, "")),
|
|
264
268
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
265
269
|
})] })]
|
|
266
270
|
})]
|
|
267
271
|
}),
|
|
268
|
-
|
|
272
|
+
A === "upi" && /* @__PURE__ */ b("div", {
|
|
269
273
|
className: "mt-4 border-t border-border-subtle pt-4",
|
|
270
274
|
children: [/* @__PURE__ */ b("label", {
|
|
271
275
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
@@ -276,12 +280,12 @@ function C() {
|
|
|
276
280
|
}), /* @__PURE__ */ y("input", {
|
|
277
281
|
type: "text",
|
|
278
282
|
placeholder: "user@paytm",
|
|
279
|
-
value:
|
|
280
|
-
onChange: (e) =>
|
|
283
|
+
value: M.upiId,
|
|
284
|
+
onChange: (e) => G("upiId", e.target.value),
|
|
281
285
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
282
286
|
})]
|
|
283
287
|
}),
|
|
284
|
-
|
|
288
|
+
A === "wallet" && /* @__PURE__ */ b("div", {
|
|
285
289
|
className: "mt-4 flex items-start gap-3 rounded-lg bg-[var(--color-accent-soft)] p-4 border border-border-focus/20",
|
|
286
290
|
children: [/* @__PURE__ */ y(c, { className: "h-4 w-4 text-text-primary mt-0.5 shrink-0" }), /* @__PURE__ */ y("p", {
|
|
287
291
|
className: "text-sm text-text-primary",
|
|
@@ -304,22 +308,22 @@ function C() {
|
|
|
304
308
|
}),
|
|
305
309
|
/* @__PURE__ */ y("div", {
|
|
306
310
|
className: "flex flex-wrap gap-2 mb-3",
|
|
307
|
-
children:
|
|
311
|
+
children: w.map((e) => /* @__PURE__ */ y("button", {
|
|
308
312
|
type: "button",
|
|
309
313
|
onClick: () => {
|
|
310
|
-
|
|
314
|
+
F(e), L("");
|
|
311
315
|
},
|
|
312
|
-
className: t("flex-1 min-w-[64px] rounded-lg px-3 py-2.5 text-sm font-medium transition-colors",
|
|
316
|
+
className: t("flex-1 min-w-[64px] rounded-lg px-3 py-2.5 text-sm font-medium transition-colors", P === e && I === "" ? "bg-foreground text-background" : "bg-bg-sunken text-text-secondary hover:bg-accent hover:text-text-primary"),
|
|
313
317
|
children: e === 0 ? "No Tip" : `₹${e}`
|
|
314
318
|
}, e))
|
|
315
319
|
}),
|
|
316
320
|
/* @__PURE__ */ y("input", {
|
|
317
321
|
type: "number",
|
|
318
322
|
placeholder: "Custom tip amount",
|
|
319
|
-
value:
|
|
323
|
+
value: I,
|
|
320
324
|
onChange: (e) => {
|
|
321
325
|
let t = e.target.value;
|
|
322
|
-
|
|
326
|
+
L(t), F(parseInt(t) || 0);
|
|
323
327
|
},
|
|
324
328
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
325
329
|
})
|
|
@@ -329,8 +333,8 @@ function C() {
|
|
|
329
333
|
}), /* @__PURE__ */ y("textarea", {
|
|
330
334
|
rows: 3,
|
|
331
335
|
placeholder: "Any special requests for your order...",
|
|
332
|
-
value:
|
|
333
|
-
onChange: (e) =>
|
|
336
|
+
value: R,
|
|
337
|
+
onChange: (e) => z(e.target.value),
|
|
334
338
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
|
|
335
339
|
})] })]
|
|
336
340
|
})]
|
|
@@ -338,8 +342,10 @@ function C() {
|
|
|
338
342
|
]
|
|
339
343
|
}), /* @__PURE__ */ y("div", {
|
|
340
344
|
className: "lg:col-span-1",
|
|
341
|
-
children: /* @__PURE__ */ b(
|
|
342
|
-
|
|
345
|
+
children: /* @__PURE__ */ b(x, {
|
|
346
|
+
treatment: "glass",
|
|
347
|
+
glow: !0,
|
|
348
|
+
className: "sticky top-6 p-5",
|
|
343
349
|
children: [
|
|
344
350
|
/* @__PURE__ */ y("h2", {
|
|
345
351
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
@@ -350,25 +356,25 @@ function C() {
|
|
|
350
356
|
children: [/* @__PURE__ */ y("div", {
|
|
351
357
|
className: "h-12 w-12 rounded-md bg-bg-sunken overflow-hidden",
|
|
352
358
|
children: /* @__PURE__ */ y("img", {
|
|
353
|
-
src:
|
|
354
|
-
alt:
|
|
359
|
+
src: D.cartImage,
|
|
360
|
+
alt: D.cartName,
|
|
355
361
|
className: "h-full w-full object-cover"
|
|
356
362
|
})
|
|
357
363
|
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
358
364
|
className: "text-sm font-medium text-text-primary",
|
|
359
|
-
children:
|
|
365
|
+
children: D.cartName
|
|
360
366
|
}), /* @__PURE__ */ b("p", {
|
|
361
367
|
className: "text-xs text-text-secondary",
|
|
362
368
|
children: [
|
|
363
|
-
|
|
369
|
+
D.items.length,
|
|
364
370
|
" item",
|
|
365
|
-
|
|
371
|
+
D.items.length === 1 ? "" : "s"
|
|
366
372
|
]
|
|
367
373
|
})] })]
|
|
368
374
|
}),
|
|
369
375
|
/* @__PURE__ */ y("div", {
|
|
370
376
|
className: "space-y-2 mb-4",
|
|
371
|
-
children:
|
|
377
|
+
children: D.items.map((e) => /* @__PURE__ */ b("div", {
|
|
372
378
|
className: "flex justify-between items-start",
|
|
373
379
|
children: [/* @__PURE__ */ b("div", {
|
|
374
380
|
className: "flex-1 min-w-0",
|
|
@@ -405,12 +411,12 @@ function C() {
|
|
|
405
411
|
className: "text-text-secondary",
|
|
406
412
|
children: [
|
|
407
413
|
"Subtotal (",
|
|
408
|
-
|
|
414
|
+
U,
|
|
409
415
|
" items)"
|
|
410
416
|
]
|
|
411
417
|
}), /* @__PURE__ */ y("span", {
|
|
412
418
|
className: "text-text-primary",
|
|
413
|
-
children: a(
|
|
419
|
+
children: a(H.subtotal, { minimumFractionDigits: 0 })
|
|
414
420
|
})]
|
|
415
421
|
}),
|
|
416
422
|
/* @__PURE__ */ b("div", {
|
|
@@ -420,7 +426,7 @@ function C() {
|
|
|
420
426
|
children: "Delivery Fee"
|
|
421
427
|
}), /* @__PURE__ */ y("span", {
|
|
422
428
|
className: "text-text-primary",
|
|
423
|
-
children:
|
|
429
|
+
children: H.deliveryFee === 0 ? "FREE" : a(H.deliveryFee, { minimumFractionDigits: 0 })
|
|
424
430
|
})]
|
|
425
431
|
}),
|
|
426
432
|
/* @__PURE__ */ b("div", {
|
|
@@ -430,27 +436,27 @@ function C() {
|
|
|
430
436
|
children: "Tax"
|
|
431
437
|
}), /* @__PURE__ */ y("span", {
|
|
432
438
|
className: "text-text-primary",
|
|
433
|
-
children: a(
|
|
439
|
+
children: a(H.tax, { minimumFractionDigits: 0 })
|
|
434
440
|
})]
|
|
435
441
|
}),
|
|
436
|
-
|
|
442
|
+
P > 0 && /* @__PURE__ */ b("div", {
|
|
437
443
|
className: "flex justify-between",
|
|
438
444
|
children: [/* @__PURE__ */ y("span", {
|
|
439
445
|
className: "text-text-secondary",
|
|
440
446
|
children: "Tip"
|
|
441
447
|
}), /* @__PURE__ */ y("span", {
|
|
442
448
|
className: "text-text-primary",
|
|
443
|
-
children: a(
|
|
449
|
+
children: a(P, { minimumFractionDigits: 0 })
|
|
444
450
|
})]
|
|
445
451
|
}),
|
|
446
|
-
|
|
452
|
+
H.discount && H.discount > 0 && /* @__PURE__ */ b("div", {
|
|
447
453
|
className: "flex justify-between",
|
|
448
454
|
children: [/* @__PURE__ */ y("span", {
|
|
449
455
|
className: "text-status-success-text",
|
|
450
456
|
children: "Discount"
|
|
451
457
|
}), /* @__PURE__ */ b("span", {
|
|
452
458
|
className: "text-status-success-text",
|
|
453
|
-
children: ["-", a(
|
|
459
|
+
children: ["-", a(H.discount, { minimumFractionDigits: 0 })]
|
|
454
460
|
})]
|
|
455
461
|
})
|
|
456
462
|
]
|
|
@@ -462,37 +468,37 @@ function C() {
|
|
|
462
468
|
children: "Total"
|
|
463
469
|
}), /* @__PURE__ */ y("span", {
|
|
464
470
|
className: "text-base font-bold text-text-primary",
|
|
465
|
-
children: a(
|
|
471
|
+
children: a(H.total, { minimumFractionDigits: 0 })
|
|
466
472
|
})]
|
|
467
473
|
}),
|
|
468
474
|
/* @__PURE__ */ b("button", {
|
|
469
475
|
type: "button",
|
|
470
476
|
onClick: async () => {
|
|
471
|
-
if (!(!
|
|
472
|
-
let e = await
|
|
473
|
-
providerId:
|
|
477
|
+
if (!(!K() || !D)) try {
|
|
478
|
+
let e = await E.mutateAsync({
|
|
479
|
+
providerId: D.cartId,
|
|
474
480
|
customerId: _?.id,
|
|
475
|
-
items:
|
|
481
|
+
items: D.items.map((e) => ({
|
|
476
482
|
offeringId: e.id,
|
|
477
483
|
quantity: e.quantity,
|
|
478
484
|
customizations: e.customizations
|
|
479
485
|
})),
|
|
480
|
-
deliveryAddress: `${
|
|
481
|
-
paymentMethod:
|
|
482
|
-
notes:
|
|
483
|
-
deliveryFee:
|
|
484
|
-
tax:
|
|
485
|
-
tip:
|
|
486
|
-
total:
|
|
486
|
+
deliveryAddress: `${O.addressLine1}, ${O.addressLine2}, ${O.city}, ${O.state} - ${O.pincode}`,
|
|
487
|
+
paymentMethod: A.toUpperCase(),
|
|
488
|
+
notes: R,
|
|
489
|
+
deliveryFee: H.deliveryFee,
|
|
490
|
+
tax: H.tax,
|
|
491
|
+
tip: P,
|
|
492
|
+
total: H.total
|
|
487
493
|
});
|
|
488
494
|
alert("Order placed successfully!"), u(`/customer/order/${e.id}`);
|
|
489
495
|
} catch {
|
|
490
496
|
alert("Failed to place order. Please try again.");
|
|
491
497
|
}
|
|
492
498
|
},
|
|
493
|
-
disabled:
|
|
494
|
-
className: t("mt-6 flex w-full items-center justify-center gap-2 rounded-lg py-3 text-sm font-medium transition-opacity", "bg-foreground text-background",
|
|
495
|
-
children: [
|
|
499
|
+
disabled: E.isPending,
|
|
500
|
+
className: t("mt-6 flex w-full items-center justify-center gap-2 rounded-lg py-3 text-sm font-medium transition-opacity", "bg-foreground text-background", E.isPending ? "opacity-60 cursor-not-allowed" : "hover:opacity-90"),
|
|
501
|
+
children: [E.isPending ? /* @__PURE__ */ y(m, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ y(g, { className: "h-4 w-4" }), E.isPending ? "Placing Order..." : `Place Order - ${a(H.total, { minimumFractionDigits: 0 })}`]
|
|
496
502
|
}),
|
|
497
503
|
/* @__PURE__ */ y("p", {
|
|
498
504
|
className: "mt-3 text-center text-xs text-text-secondary",
|
|
@@ -501,7 +507,7 @@ function C() {
|
|
|
501
507
|
]
|
|
502
508
|
})
|
|
503
509
|
})]
|
|
504
|
-
})
|
|
510
|
+
})]
|
|
505
511
|
}) : /* @__PURE__ */ y(n, {
|
|
506
512
|
title: "Checkout",
|
|
507
513
|
children: /* @__PURE__ */ b("div", {
|
|
@@ -527,6 +533,6 @@ function C() {
|
|
|
527
533
|
});
|
|
528
534
|
}
|
|
529
535
|
//#endregion
|
|
530
|
-
export {
|
|
536
|
+
export { T as CheckoutPage };
|
|
531
537
|
|
|
532
538
|
//# sourceMappingURL=CheckoutPage.js.map
|