@burdenoff/microfe-kadaikodi 2026.1126.1 → 2026.1127.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +12 -0
  2. package/dist/kadaikodi/components/CourierLocationSharingCard.d.ts +10 -0
  3. package/dist/kadaikodi/components/CourierLocationSharingCard.js +52 -0
  4. package/dist/kadaikodi/components/CourierLocationSharingCard.js.map +1 -0
  5. package/dist/kadaikodi/components/DropoffPinField.d.ts +16 -0
  6. package/dist/kadaikodi/components/DropoffPinField.js +67 -0
  7. package/dist/kadaikodi/components/DropoffPinField.js.map +1 -0
  8. package/dist/kadaikodi/components/LiveTrackingMap.d.ts +27 -0
  9. package/dist/kadaikodi/components/LiveTrackingMap.js +74 -0
  10. package/dist/kadaikodi/components/LiveTrackingMap.js.map +1 -0
  11. package/dist/kadaikodi/hooks/useAppointmentsApi.js +42 -40
  12. package/dist/kadaikodi/hooks/useAppointmentsApi.js.map +1 -1
  13. package/dist/kadaikodi/hooks/useCourierLocationSharing.d.ts +24 -0
  14. package/dist/kadaikodi/hooks/useCourierLocationSharing.js +54 -0
  15. package/dist/kadaikodi/hooks/useCourierLocationSharing.js.map +1 -0
  16. package/dist/kadaikodi/hooks/useTrackingApi.d.ts +63 -0
  17. package/dist/kadaikodi/hooks/useTrackingApi.js +37 -0
  18. package/dist/kadaikodi/hooks/useTrackingApi.js.map +1 -0
  19. package/dist/kadaikodi/pages/customer/CheckoutPage.js +222 -213
  20. package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
  21. package/dist/kadaikodi/pages/customer/OrderTrackingPage.d.ts +4 -0
  22. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +274 -252
  23. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
  24. package/dist/kadaikodi/pages/customer/shared.d.ts +0 -13
  25. package/dist/kadaikodi/pages/customer/shared.js +16 -119
  26. package/dist/kadaikodi/pages/customer/shared.js.map +1 -1
  27. package/dist/kadaikodi/pages/worker/TaskDetailsPage.d.ts +3 -2
  28. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +67 -65
  29. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
  30. package/dist/kadaikodi/utils/deviceGeolocation.d.ts +46 -0
  31. package/dist/kadaikodi/utils/deviceGeolocation.js +71 -0
  32. package/dist/kadaikodi/utils/deviceGeolocation.js.map +1 -0
  33. package/dist/kadaikodi/utils/leaflet.d.ts +8 -0
  34. package/dist/kadaikodi/utils/leaflet.js +11 -0
  35. package/dist/kadaikodi/utils/leaflet.js.map +1 -0
  36. package/dist/node_modules/leaflet/dist/leaflet-src.js +4535 -0
  37. package/dist/node_modules/leaflet/dist/leaflet-src.js.map +1 -0
  38. package/package.json +4 -1
@@ -1,18 +1,19 @@
1
1
  import { PageLayout as e } from "../../components/PageLayout.js";
2
2
  import "../../components/viz/index.js";
3
- import { useKadaikodi as t } from "../../context/KadaikodiContext.js";
4
- import { useCreatePaymentIntent as n, useMyAddresses as r, useMyPaymentMethods as i, useOrders as ee, usePlaceOrder as a } from "../../hooks/useKadaikodiApi.js";
5
- import { loadRazorpayCheckout as o } from "../../utils/razorpay.js";
3
+ import { DropoffPinField as t } from "../../components/DropoffPinField.js";
4
+ import { useKadaikodi as n } from "../../context/KadaikodiContext.js";
5
+ import { useCreatePaymentIntent as r, useMyAddresses as i, useMyPaymentMethods as a, useOrders as o, usePlaceOrder as ee } from "../../hooks/useKadaikodiApi.js";
6
6
  import { SegmentedTabs as s } from "../../components/viz/SegmentedTabs.js";
7
+ import { loadRazorpayCheckout as te } from "../../utils/razorpay.js";
7
8
  import { cn as c } from "../../utils/cn.js";
8
9
  import { formatCurrency as l } from "../../utils/formatters.js";
9
- import { ProviderImage as te } from "./shared.js";
10
- import { useEffect as u, useMemo as d, useState as f } from "react";
11
- import { AlertCircle as p, ArrowLeft as m, Banknote as h, CheckCircle2 as g, CreditCard as _, Heart as v, Loader2 as y, MapPin as ne, ShoppingBag as b, Smartphone as x, Wallet as S } from "lucide-react";
12
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
13
- import { GlassCard as re, PagePurpose as T } from "@burdenoff/fe-libs/ui";
10
+ import { ProviderImage as u } from "./shared.js";
11
+ import { useEffect as d, useMemo as f, useState as p } from "react";
12
+ import { AlertCircle as m, ArrowLeft as ne, Banknote as h, CheckCircle2 as g, CreditCard as _, Heart as re, Loader2 as v, MapPin as ie, ShoppingBag as y, Smartphone as b, Wallet as x } from "lucide-react";
13
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
14
+ import { GlassCard as ae, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
14
15
  // src/kadaikodi/pages/customer/CheckoutPage.tsx
15
- var ie = [
16
+ var se = [
16
17
  {
17
18
  id: "cash",
18
19
  label: "Cash on Delivery",
@@ -28,88 +29,88 @@ var ie = [
28
29
  {
29
30
  id: "upi",
30
31
  label: "UPI",
31
- icon: x,
32
+ icon: b,
32
33
  description: "Google Pay, PhonePe, Paytm"
33
34
  },
34
35
  {
35
36
  id: "wallet",
36
37
  label: "Digital Wallet",
37
- icon: S,
38
+ icon: x,
38
39
  description: "Kadaikodi Wallet Balance"
39
40
  }
40
- ], E = [
41
+ ], w = [
41
42
  0,
42
43
  10,
43
44
  20,
44
45
  30
45
46
  ];
46
- function D() {
47
- let { navigateTo: h, currentUser: x } = t(), { data: S = [], isLoading: D } = ee({ customerId: x?.id }), O = a(), { data: k = [] } = r(), { data: A = [] } = i(), j = d(() => S.find((e) => e.status === "pending") || S[0], [S]), [M, N] = f({
47
+ function T() {
48
+ let { navigateTo: h, currentUser: b } = n(), { data: x = [], isLoading: T } = o({ customerId: b?.id }), E = ee(), { data: D = [] } = i(), { data: O = [] } = a(), k = f(() => x.find((e) => e.status === "pending") || x[0], [x]), [A, j] = p({
48
49
  addressLine1: "",
49
50
  addressLine2: "",
50
51
  city: "",
51
52
  state: "",
52
53
  pincode: ""
53
- }), [P, F] = f("delivery"), [I, L] = f("cash"), [R, ae] = f(""), z = n(), [B, V] = f(null), [H, U] = f(null), [W, G] = f(0), [K, q] = f(""), [J, oe] = f(""), [se, ce] = f(!1), [Y, le] = f(!1), [X, ue] = f(!1);
54
- u(() => {
55
- if (Y || k.length === 0) return;
56
- let e = k.find((e) => e.isDefault) ?? k[0];
57
- e && (N({
54
+ }), [M, N] = p("delivery"), [P, ce] = p(null), [F, I] = p("cash"), [L, le] = p(""), R = r(), [z, B] = p(null), [V, H] = p(null), [U, W] = p(0), [G, K] = p(""), [q, ue] = p(""), [de, fe] = p(!1), [J, pe] = p(!1), [Y, me] = p(!1);
55
+ d(() => {
56
+ if (J || D.length === 0) return;
57
+ let e = D.find((e) => e.isDefault) ?? D[0];
58
+ e && (j({
58
59
  addressLine1: e.addressLine1,
59
60
  addressLine2: e.addressLine2 ?? "",
60
61
  city: e.city,
61
62
  state: e.state,
62
63
  pincode: e.zipCode
63
- }), le(!0));
64
- }, [k, Y]), u(() => {
65
- if (X || A.length === 0) return;
66
- let e = A.find((e) => e.isDefault) ?? A[0];
67
- e && (e.type === "CARD" ? L("card") : e.type === "UPI" && L("upi"), ue(!0));
68
- }, [A, X]);
69
- let Z = d(() => {
70
- if (!j) return {
64
+ }), pe(!0));
65
+ }, [D, J]), d(() => {
66
+ if (Y || O.length === 0) return;
67
+ let e = O.find((e) => e.isDefault) ?? O[0];
68
+ e && (e.type === "CARD" ? I("card") : e.type === "UPI" && I("upi"), me(!0));
69
+ }, [O, Y]);
70
+ let X = f(() => {
71
+ if (!k) return {
71
72
  subtotal: 0,
72
73
  deliveryFee: 0,
73
74
  tax: 0,
74
75
  total: 0
75
76
  };
76
- let e = j.subtotal, t = P === "delivery" ? j.deliveryFee : 0, n = j.taxes, r = j.discount ?? 0;
77
+ let e = k.subtotal, t = M === "delivery" ? k.deliveryFee : 0, n = k.taxes, r = k.discount ?? 0;
77
78
  return {
78
79
  subtotal: e,
79
80
  deliveryFee: t,
80
81
  tax: n,
81
82
  discount: r,
82
- total: e + t + n + W - r
83
+ total: e + t + n + U - r
83
84
  };
84
85
  }, [
85
- j,
86
- W,
87
- P
88
- ]), de = d(() => j ? j.items.reduce((e, t) => e + t.quantity, 0) : 0, [j]), Q = (e, t) => {
89
- N((n) => ({
86
+ k,
87
+ U,
88
+ M
89
+ ]), Z = f(() => k ? k.items.reduce((e, t) => e + t.quantity, 0) : 0, [k]), Q = (e, t) => {
90
+ j((n) => ({
90
91
  ...n,
91
92
  [e]: t
92
93
  }));
93
- }, $ = P === "delivery" ? M.pincode : R, fe = () => {
94
- if (P === "delivery") {
95
- if (!M.addressLine1.trim()) return alert("Please enter delivery address"), !1;
96
- if (!M.pincode.trim() || M.pincode.length !== 6) return alert("Please enter a valid 6-digit pincode"), !1;
94
+ }, $ = M === "delivery" ? A.pincode : L, he = () => {
95
+ if (M === "delivery") {
96
+ if (!A.addressLine1.trim()) return alert("Please enter delivery address"), !1;
97
+ if (!A.pincode.trim() || A.pincode.length !== 6) return alert("Please enter a valid 6-digit pincode"), !1;
97
98
  }
98
- return I === "wallet" ? (alert("Digital wallet integration is coming soon. Please choose another payment method."), !1) : I !== "cash" && (!$.trim() || $.length !== 6) ? (alert("Please enter a valid 6-digit pincode for payment"), !1) : !0;
99
- }, pe = async (e) => {
99
+ return F === "wallet" ? (alert("Digital wallet integration is coming soon. Please choose another payment method."), !1) : F !== "cash" && (!$.trim() || $.length !== 6) ? (alert("Please enter a valid 6-digit pincode for payment"), !1) : !0;
100
+ }, ge = async (e) => {
100
101
  if (!e.gatewayOrderId || !e.providerKeyId) throw Error("Payment gateway did not return a checkout session");
101
- let t = await o();
102
+ let t = await te();
102
103
  return new Promise((n, r) => {
103
104
  let i = new t({
104
105
  key: e.providerKeyId,
105
106
  order_id: e.gatewayOrderId,
106
- amount: Math.round(Z.total * 100),
107
+ amount: Math.round(X.total * 100),
107
108
  currency: "INR",
108
109
  name: "Kadaikodi",
109
110
  description: "Order payment",
110
111
  prefill: {
111
- name: x?.name,
112
- email: x?.email
112
+ name: b?.name,
113
+ email: b?.email
113
114
  },
114
115
  handler: (e) => n("paid"),
115
116
  modal: { ondismiss: () => n("dismissed") }
@@ -120,39 +121,39 @@ function D() {
120
121
  }), i.open();
121
122
  });
122
123
  };
123
- return D ? /* @__PURE__ */ C(e, {
124
+ return T ? /* @__PURE__ */ S(e, {
124
125
  title: "Checkout",
125
- children: /* @__PURE__ */ C("div", {
126
+ children: /* @__PURE__ */ S("div", {
126
127
  className: "flex h-[60vh] items-center justify-center",
127
- children: /* @__PURE__ */ C(y, { className: "h-8 w-8 animate-spin text-primary" })
128
+ children: /* @__PURE__ */ S(v, { className: "h-8 w-8 animate-spin text-primary" })
128
129
  })
129
- }) : j ? /* @__PURE__ */ w(e, {
130
- title: /* @__PURE__ */ w("div", {
130
+ }) : k ? /* @__PURE__ */ C(e, {
131
+ title: /* @__PURE__ */ C("div", {
131
132
  className: "flex items-center gap-3",
132
- children: [/* @__PURE__ */ C("button", {
133
+ children: [/* @__PURE__ */ S("button", {
133
134
  type: "button",
134
135
  onClick: () => h("/customer/discover"),
135
136
  className: "rounded-md p-1 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
136
- children: /* @__PURE__ */ C(m, { className: "h-5 w-5" })
137
- }), /* @__PURE__ */ C("span", { children: "Checkout" })]
137
+ children: /* @__PURE__ */ S(ne, { className: "h-5 w-5" })
138
+ }), /* @__PURE__ */ S("span", { children: "Checkout" })]
138
139
  }),
139
140
  description: "Review your order and complete payment",
140
- children: [/* @__PURE__ */ C(T, {
141
+ children: [/* @__PURE__ */ S(oe, {
141
142
  className: "mb-6",
142
143
  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."
143
- }), /* @__PURE__ */ w("div", {
144
+ }), /* @__PURE__ */ C("div", {
144
145
  className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
145
- children: [/* @__PURE__ */ w("div", {
146
+ children: [/* @__PURE__ */ C("div", {
146
147
  className: "lg:col-span-2 space-y-6",
147
148
  children: [
148
- /* @__PURE__ */ w("section", {
149
+ /* @__PURE__ */ C("section", {
149
150
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
150
151
  children: [
151
- /* @__PURE__ */ C("h2", {
152
+ /* @__PURE__ */ S("h2", {
152
153
  className: "text-base font-semibold text-text-primary mb-4",
153
154
  children: "Fulfilment"
154
155
  }),
155
- /* @__PURE__ */ C(s, {
156
+ /* @__PURE__ */ S(s, {
156
157
  fill: !0,
157
158
  "aria-label": "Fulfilment method",
158
159
  tabs: [
@@ -169,269 +170,273 @@ function D() {
169
170
  label: "On-location"
170
171
  }
171
172
  ],
172
- value: P,
173
- onChange: (e) => F(e)
173
+ value: M,
174
+ onChange: (e) => N(e)
174
175
  }),
175
- /* @__PURE__ */ C("p", {
176
+ /* @__PURE__ */ S("p", {
176
177
  className: "mt-3 text-xs text-text-secondary",
177
- children: P === "delivery" ? "A delivery partner brings your order to the address below." : P === "pickup" ? "Collect your order from the cart — no delivery fee." : "The cart serves you at your location — no delivery fee."
178
+ children: M === "delivery" ? "A delivery partner brings your order to the address below." : M === "pickup" ? "Collect your order from the cart — no delivery fee." : "The cart serves you at your location — no delivery fee."
178
179
  })
179
180
  ]
180
181
  }),
181
- P === "delivery" && /* @__PURE__ */ w("section", {
182
+ M === "delivery" && /* @__PURE__ */ C("section", {
182
183
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
183
- children: [/* @__PURE__ */ w("h2", {
184
+ children: [/* @__PURE__ */ C("h2", {
184
185
  className: "text-base font-semibold text-text-primary mb-4 flex items-center gap-2",
185
- children: [/* @__PURE__ */ C(ne, { className: "h-4 w-4 text-text-secondary" }), "Delivery Address"]
186
- }), /* @__PURE__ */ w("div", {
186
+ children: [/* @__PURE__ */ S(ie, { className: "h-4 w-4 text-text-secondary" }), "Delivery Address"]
187
+ }), /* @__PURE__ */ C("div", {
187
188
  className: "space-y-4",
188
189
  children: [
189
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
190
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
190
191
  className: "block text-sm font-medium text-text-primary mb-1.5",
191
- children: ["Address Line 1 ", /* @__PURE__ */ C("span", {
192
+ children: ["Address Line 1 ", /* @__PURE__ */ S("span", {
192
193
  className: "text-status-error-text",
193
194
  children: "*"
194
195
  })]
195
- }), /* @__PURE__ */ C("input", {
196
+ }), /* @__PURE__ */ S("input", {
196
197
  type: "text",
197
198
  placeholder: "Building, Street, Area",
198
- value: M.addressLine1,
199
+ value: A.addressLine1,
199
200
  onChange: (e) => Q("addressLine1", e.target.value),
200
201
  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)]"
201
202
  })] }),
202
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
203
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
203
204
  className: "block text-sm font-medium text-text-primary mb-1.5",
204
205
  children: "Address Line 2"
205
- }), /* @__PURE__ */ C("input", {
206
+ }), /* @__PURE__ */ S("input", {
206
207
  type: "text",
207
208
  placeholder: "Apartment, Suite, Floor (Optional)",
208
- value: M.addressLine2,
209
+ value: A.addressLine2,
209
210
  onChange: (e) => Q("addressLine2", e.target.value),
210
211
  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)]"
211
212
  })] }),
212
- /* @__PURE__ */ w("div", {
213
+ /* @__PURE__ */ C("div", {
213
214
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
214
- children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
215
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
215
216
  className: "block text-sm font-medium text-text-primary mb-1.5",
216
- children: ["City ", /* @__PURE__ */ C("span", {
217
+ children: ["City ", /* @__PURE__ */ S("span", {
217
218
  className: "text-status-error-text",
218
219
  children: "*"
219
220
  })]
220
- }), /* @__PURE__ */ C("input", {
221
+ }), /* @__PURE__ */ S("input", {
221
222
  type: "text",
222
223
  placeholder: "City",
223
- value: M.city,
224
+ value: A.city,
224
225
  onChange: (e) => Q("city", e.target.value),
225
226
  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)]"
226
- })] }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
227
+ })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
227
228
  className: "block text-sm font-medium text-text-primary mb-1.5",
228
- children: ["State ", /* @__PURE__ */ C("span", {
229
+ children: ["State ", /* @__PURE__ */ S("span", {
229
230
  className: "text-status-error-text",
230
231
  children: "*"
231
232
  })]
232
- }), /* @__PURE__ */ C("input", {
233
+ }), /* @__PURE__ */ S("input", {
233
234
  type: "text",
234
235
  placeholder: "State",
235
- value: M.state,
236
+ value: A.state,
236
237
  onChange: (e) => Q("state", e.target.value),
237
238
  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)]"
238
239
  })] })]
239
240
  }),
240
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
241
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
241
242
  className: "block text-sm font-medium text-text-primary mb-1.5",
242
- children: ["Pincode ", /* @__PURE__ */ C("span", {
243
+ children: ["Pincode ", /* @__PURE__ */ S("span", {
243
244
  className: "text-status-error-text",
244
245
  children: "*"
245
246
  })]
246
- }), /* @__PURE__ */ C("input", {
247
+ }), /* @__PURE__ */ S("input", {
247
248
  type: "text",
248
249
  placeholder: "560001",
249
250
  maxLength: 6,
250
- value: M.pincode,
251
+ value: A.pincode,
251
252
  onChange: (e) => Q("pincode", e.target.value.replace(/\D/g, "")),
252
253
  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)]"
253
- })] })
254
+ })] }),
255
+ /* @__PURE__ */ S(t, {
256
+ value: P,
257
+ onChange: ce
258
+ })
254
259
  ]
255
260
  })]
256
261
  }),
257
- /* @__PURE__ */ w("section", {
262
+ /* @__PURE__ */ C("section", {
258
263
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
259
264
  children: [
260
- /* @__PURE__ */ w("h2", {
265
+ /* @__PURE__ */ C("h2", {
261
266
  className: "text-base font-semibold text-text-primary mb-4 flex items-center gap-2",
262
- children: [/* @__PURE__ */ C(_, { className: "h-4 w-4 text-text-secondary" }), "Payment Method"]
267
+ children: [/* @__PURE__ */ S(_, { className: "h-4 w-4 text-text-secondary" }), "Payment Method"]
263
268
  }),
264
- /* @__PURE__ */ C("div", {
269
+ /* @__PURE__ */ S("div", {
265
270
  className: "space-y-2",
266
- children: ie.map((e) => {
271
+ children: se.map((e) => {
267
272
  let t = e.icon;
268
- return /* @__PURE__ */ w("button", {
273
+ return /* @__PURE__ */ C("button", {
269
274
  type: "button",
270
- onClick: () => L(e.id),
271
- className: c("flex w-full items-center gap-4 rounded-lg border p-3 transition-colors text-left", I === e.id ? "border-foreground bg-accent" : "border-border-subtle bg-bg-surface hover:bg-accent"),
275
+ onClick: () => I(e.id),
276
+ className: c("flex w-full items-center gap-4 rounded-lg border p-3 transition-colors text-left", F === e.id ? "border-foreground bg-accent" : "border-border-subtle bg-bg-surface hover:bg-accent"),
272
277
  children: [
273
- /* @__PURE__ */ C("div", {
278
+ /* @__PURE__ */ S("div", {
274
279
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-bg-sunken",
275
- children: /* @__PURE__ */ C(t, { className: "h-4 w-4 text-text-secondary" })
280
+ children: /* @__PURE__ */ S(t, { className: "h-4 w-4 text-text-secondary" })
276
281
  }),
277
- /* @__PURE__ */ w("div", {
282
+ /* @__PURE__ */ C("div", {
278
283
  className: "flex-1 min-w-0",
279
- children: [/* @__PURE__ */ C("p", {
284
+ children: [/* @__PURE__ */ S("p", {
280
285
  className: "text-sm font-medium text-text-primary",
281
286
  children: e.label
282
- }), /* @__PURE__ */ C("p", {
287
+ }), /* @__PURE__ */ S("p", {
283
288
  className: "text-xs text-text-secondary",
284
289
  children: e.description
285
290
  })]
286
291
  }),
287
- I === e.id && /* @__PURE__ */ C(g, { className: "h-5 w-5 text-text-primary shrink-0" })
292
+ F === e.id && /* @__PURE__ */ S(g, { className: "h-5 w-5 text-text-primary shrink-0" })
288
293
  ]
289
294
  }, e.id);
290
295
  })
291
296
  }),
292
- (I === "card" || I === "upi") && /* @__PURE__ */ w("div", {
297
+ (F === "card" || F === "upi") && /* @__PURE__ */ C("div", {
293
298
  className: "mt-4 space-y-4 border-t border-border-subtle pt-4",
294
- children: [/* @__PURE__ */ w("div", {
299
+ children: [/* @__PURE__ */ C("div", {
295
300
  className: "flex items-start gap-3 rounded-lg bg-[var(--color-accent-soft)] p-4 border border-border-focus/20",
296
- children: [/* @__PURE__ */ C(_, { className: "h-4 w-4 text-text-primary mt-0.5 shrink-0" }), /* @__PURE__ */ w("p", {
301
+ children: [/* @__PURE__ */ S(_, { className: "h-4 w-4 text-text-primary mt-0.5 shrink-0" }), /* @__PURE__ */ C("p", {
297
302
  className: "text-sm text-text-primary",
298
303
  children: [
299
304
  "You'll enter your ",
300
- I === "card" ? "card" : "UPI",
305
+ F === "card" ? "card" : "UPI",
301
306
  " details securely in Razorpay's checkout window after placing the order."
302
307
  ]
303
308
  })]
304
- }), P !== "delivery" && /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
309
+ }), M !== "delivery" && /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
305
310
  className: "block text-sm font-medium text-text-primary mb-1.5",
306
- children: ["Pincode (for payment) ", /* @__PURE__ */ C("span", {
311
+ children: ["Pincode (for payment) ", /* @__PURE__ */ S("span", {
307
312
  className: "text-status-error-text",
308
313
  children: "*"
309
314
  })]
310
- }), /* @__PURE__ */ C("input", {
315
+ }), /* @__PURE__ */ S("input", {
311
316
  type: "text",
312
317
  placeholder: "600001",
313
318
  maxLength: 6,
314
- value: R,
315
- onChange: (e) => ae(e.target.value.replace(/\D/g, "")),
319
+ value: L,
320
+ onChange: (e) => le(e.target.value.replace(/\D/g, "")),
316
321
  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)]"
317
322
  })] })]
318
323
  }),
319
- B && /* @__PURE__ */ w("div", {
324
+ z && /* @__PURE__ */ C("div", {
320
325
  className: "mt-4 flex items-start gap-3 rounded-lg bg-status-error-bg-subtle p-4 border border-border-subtle",
321
- children: [/* @__PURE__ */ C(p, { className: "h-4 w-4 text-status-error-text mt-0.5 shrink-0" }), /* @__PURE__ */ C("p", {
326
+ children: [/* @__PURE__ */ S(m, { className: "h-4 w-4 text-status-error-text mt-0.5 shrink-0" }), /* @__PURE__ */ S("p", {
322
327
  className: "text-sm text-status-error-text",
323
- children: B
328
+ children: z
324
329
  })]
325
330
  }),
326
- I === "wallet" && /* @__PURE__ */ w("div", {
331
+ F === "wallet" && /* @__PURE__ */ C("div", {
327
332
  className: "mt-4 flex items-start gap-3 rounded-lg bg-[var(--color-accent-soft)] p-4 border border-border-focus/20",
328
- children: [/* @__PURE__ */ C(p, { className: "h-4 w-4 text-text-primary mt-0.5 shrink-0" }), /* @__PURE__ */ C("p", {
333
+ children: [/* @__PURE__ */ S(m, { className: "h-4 w-4 text-text-primary mt-0.5 shrink-0" }), /* @__PURE__ */ S("p", {
329
334
  className: "text-sm text-text-primary",
330
335
  children: "Digital wallet integration coming soon. Please choose another payment method."
331
336
  })]
332
337
  })
333
338
  ]
334
339
  }),
335
- /* @__PURE__ */ w("section", {
340
+ /* @__PURE__ */ C("section", {
336
341
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
337
- children: [/* @__PURE__ */ w("h2", {
342
+ children: [/* @__PURE__ */ C("h2", {
338
343
  className: "text-base font-semibold text-text-primary mb-4 flex items-center gap-2",
339
- children: [/* @__PURE__ */ C(v, { className: "h-4 w-4 text-text-secondary" }), "Additional Options"]
340
- }), /* @__PURE__ */ w("div", {
344
+ children: [/* @__PURE__ */ S(re, { className: "h-4 w-4 text-text-secondary" }), "Additional Options"]
345
+ }), /* @__PURE__ */ C("div", {
341
346
  className: "space-y-5",
342
- children: [/* @__PURE__ */ w("div", { children: [
343
- /* @__PURE__ */ C("label", {
347
+ children: [/* @__PURE__ */ C("div", { children: [
348
+ /* @__PURE__ */ S("label", {
344
349
  className: "block text-sm font-medium text-text-primary mb-2",
345
350
  children: "Tip for delivery partner"
346
351
  }),
347
- /* @__PURE__ */ C("div", {
352
+ /* @__PURE__ */ S("div", {
348
353
  className: "flex flex-wrap gap-2 mb-3",
349
- children: E.map((e) => /* @__PURE__ */ C("button", {
354
+ children: w.map((e) => /* @__PURE__ */ S("button", {
350
355
  type: "button",
351
356
  onClick: () => {
352
- G(e), q("");
357
+ W(e), K("");
353
358
  },
354
- className: c("flex-1 min-w-[64px] rounded-lg px-3 py-2.5 text-sm font-medium transition-colors", W === e && K === "" ? "bg-foreground text-background" : "bg-bg-sunken text-text-secondary hover:bg-accent hover:text-text-primary"),
359
+ className: c("flex-1 min-w-[64px] rounded-lg px-3 py-2.5 text-sm font-medium transition-colors", U === e && G === "" ? "bg-foreground text-background" : "bg-bg-sunken text-text-secondary hover:bg-accent hover:text-text-primary"),
355
360
  children: e === 0 ? "No Tip" : `₹${e}`
356
361
  }, e))
357
362
  }),
358
- /* @__PURE__ */ C("input", {
363
+ /* @__PURE__ */ S("input", {
359
364
  type: "number",
360
365
  placeholder: "Custom tip amount",
361
- value: K,
366
+ value: G,
362
367
  onChange: (e) => {
363
368
  let t = e.target.value;
364
- q(t), G(parseInt(t) || 0);
369
+ K(t), W(parseInt(t) || 0);
365
370
  },
366
371
  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)]"
367
372
  })
368
- ] }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
373
+ ] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
369
374
  className: "block text-sm font-medium text-text-primary mb-2",
370
375
  children: "Special Instructions"
371
- }), /* @__PURE__ */ C("textarea", {
376
+ }), /* @__PURE__ */ S("textarea", {
372
377
  rows: 3,
373
378
  placeholder: "Any special requests for your order...",
374
- value: J,
375
- onChange: (e) => oe(e.target.value),
379
+ value: q,
380
+ onChange: (e) => ue(e.target.value),
376
381
  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"
377
382
  })] })]
378
383
  })]
379
384
  })
380
385
  ]
381
- }), /* @__PURE__ */ C("div", {
386
+ }), /* @__PURE__ */ S("div", {
382
387
  className: "lg:col-span-1",
383
- children: /* @__PURE__ */ w(re, {
388
+ children: /* @__PURE__ */ C(ae, {
384
389
  treatment: "glass",
385
390
  glow: !0,
386
391
  className: "sticky top-6 p-5",
387
392
  children: [
388
- /* @__PURE__ */ C("h2", {
393
+ /* @__PURE__ */ S("h2", {
389
394
  className: "text-base font-semibold text-text-primary mb-4",
390
395
  children: "Order Summary"
391
396
  }),
392
- /* @__PURE__ */ w("div", {
397
+ /* @__PURE__ */ C("div", {
393
398
  className: "flex items-center gap-3 mb-4 pb-4 border-b border-border-subtle",
394
- children: [/* @__PURE__ */ C("div", {
399
+ children: [/* @__PURE__ */ S("div", {
395
400
  className: "h-12 w-12 rounded-md bg-bg-sunken overflow-hidden",
396
- children: /* @__PURE__ */ C(te, {
397
- src: j.cartImage,
398
- alt: j.cartName,
399
- seed: j.cartName
401
+ children: /* @__PURE__ */ S(u, {
402
+ src: k.cartImage,
403
+ alt: k.cartName,
404
+ seed: k.cartName
400
405
  })
401
- }), /* @__PURE__ */ w("div", {
406
+ }), /* @__PURE__ */ C("div", {
402
407
  className: "min-w-0",
403
- children: [/* @__PURE__ */ C("p", {
408
+ children: [/* @__PURE__ */ S("p", {
404
409
  className: "text-sm font-medium text-text-primary truncate",
405
- children: j.cartName
406
- }), /* @__PURE__ */ w("p", {
410
+ children: k.cartName
411
+ }), /* @__PURE__ */ C("p", {
407
412
  className: "text-xs text-text-secondary capitalize",
408
413
  children: [
409
- j.items.length,
414
+ k.items.length,
410
415
  " item",
411
- j.items.length === 1 ? "" : "s",
416
+ k.items.length === 1 ? "" : "s",
412
417
  " ·",
413
418
  " ",
414
- P.replace("_", "-")
419
+ M.replace("_", "-")
415
420
  ]
416
421
  })]
417
422
  })]
418
423
  }),
419
- /* @__PURE__ */ C("div", {
424
+ /* @__PURE__ */ S("div", {
420
425
  className: "space-y-2 mb-4",
421
- children: j.items.map((e) => /* @__PURE__ */ w("div", {
426
+ children: k.items.map((e) => /* @__PURE__ */ C("div", {
422
427
  className: "flex justify-between items-start",
423
- children: [/* @__PURE__ */ w("div", {
428
+ children: [/* @__PURE__ */ C("div", {
424
429
  className: "flex-1 min-w-0",
425
430
  children: [
426
- /* @__PURE__ */ C("p", {
431
+ /* @__PURE__ */ S("p", {
427
432
  className: "text-sm text-text-primary",
428
433
  children: e.name
429
434
  }),
430
- e.customizations && e.customizations.length > 0 && /* @__PURE__ */ C("p", {
435
+ e.customizations && e.customizations.length > 0 && /* @__PURE__ */ S("p", {
431
436
  className: "text-xs text-text-secondary mt-0.5",
432
437
  children: e.customizations.join(", ")
433
438
  }),
434
- /* @__PURE__ */ w("p", {
439
+ /* @__PURE__ */ C("p", {
435
440
  className: "text-xs text-text-secondary",
436
441
  children: [
437
442
  l(e.price, { minimumFractionDigits: 0 }),
@@ -440,126 +445,130 @@ function D() {
440
445
  ]
441
446
  })
442
447
  ]
443
- }), /* @__PURE__ */ C("span", {
448
+ }), /* @__PURE__ */ S("span", {
444
449
  className: "text-sm font-medium text-text-primary",
445
450
  children: l(e.price * e.quantity, { minimumFractionDigits: 0 })
446
451
  })]
447
452
  }, e.id))
448
453
  }),
449
- /* @__PURE__ */ w("div", {
454
+ /* @__PURE__ */ C("div", {
450
455
  className: "border-t border-border-subtle pt-4 space-y-2.5 text-sm",
451
456
  children: [
452
- /* @__PURE__ */ w("div", {
457
+ /* @__PURE__ */ C("div", {
453
458
  className: "flex justify-between",
454
- children: [/* @__PURE__ */ w("span", {
459
+ children: [/* @__PURE__ */ C("span", {
455
460
  className: "text-text-secondary",
456
461
  children: [
457
462
  "Subtotal (",
458
- de,
463
+ Z,
459
464
  " items)"
460
465
  ]
461
- }), /* @__PURE__ */ C("span", {
466
+ }), /* @__PURE__ */ S("span", {
462
467
  className: "text-text-primary",
463
- children: l(Z.subtotal, { minimumFractionDigits: 0 })
468
+ children: l(X.subtotal, { minimumFractionDigits: 0 })
464
469
  })]
465
470
  }),
466
- /* @__PURE__ */ w("div", {
471
+ /* @__PURE__ */ C("div", {
467
472
  className: "flex justify-between",
468
- children: [/* @__PURE__ */ C("span", {
473
+ children: [/* @__PURE__ */ S("span", {
469
474
  className: "text-text-secondary",
470
475
  children: "Delivery Fee"
471
- }), /* @__PURE__ */ C("span", {
476
+ }), /* @__PURE__ */ S("span", {
472
477
  className: "text-text-primary",
473
- children: Z.deliveryFee === 0 ? "FREE" : l(Z.deliveryFee, { minimumFractionDigits: 0 })
478
+ children: X.deliveryFee === 0 ? "FREE" : l(X.deliveryFee, { minimumFractionDigits: 0 })
474
479
  })]
475
480
  }),
476
- /* @__PURE__ */ w("div", {
481
+ /* @__PURE__ */ C("div", {
477
482
  className: "flex justify-between",
478
- children: [/* @__PURE__ */ C("span", {
483
+ children: [/* @__PURE__ */ S("span", {
479
484
  className: "text-text-secondary",
480
485
  children: "Tax"
481
- }), /* @__PURE__ */ C("span", {
486
+ }), /* @__PURE__ */ S("span", {
482
487
  className: "text-text-primary",
483
- children: l(Z.tax, { minimumFractionDigits: 0 })
488
+ children: l(X.tax, { minimumFractionDigits: 0 })
484
489
  })]
485
490
  }),
486
- W > 0 && /* @__PURE__ */ w("div", {
491
+ U > 0 && /* @__PURE__ */ C("div", {
487
492
  className: "flex justify-between",
488
- children: [/* @__PURE__ */ C("span", {
493
+ children: [/* @__PURE__ */ S("span", {
489
494
  className: "text-text-secondary",
490
495
  children: "Tip"
491
- }), /* @__PURE__ */ C("span", {
496
+ }), /* @__PURE__ */ S("span", {
492
497
  className: "text-text-primary",
493
- children: l(W, { minimumFractionDigits: 0 })
498
+ children: l(U, { minimumFractionDigits: 0 })
494
499
  })]
495
500
  }),
496
- Z.discount && Z.discount > 0 && /* @__PURE__ */ w("div", {
501
+ X.discount && X.discount > 0 && /* @__PURE__ */ C("div", {
497
502
  className: "flex justify-between",
498
- children: [/* @__PURE__ */ C("span", {
503
+ children: [/* @__PURE__ */ S("span", {
499
504
  className: "text-status-success-text",
500
505
  children: "Discount"
501
- }), /* @__PURE__ */ w("span", {
506
+ }), /* @__PURE__ */ C("span", {
502
507
  className: "text-status-success-text",
503
- children: ["-", l(Z.discount, { minimumFractionDigits: 0 })]
508
+ children: ["-", l(X.discount, { minimumFractionDigits: 0 })]
504
509
  })]
505
510
  })
506
511
  ]
507
512
  }),
508
- /* @__PURE__ */ w("div", {
513
+ /* @__PURE__ */ C("div", {
509
514
  className: "mt-4 flex justify-between border-t border-border-subtle pt-4",
510
- children: [/* @__PURE__ */ C("span", {
515
+ children: [/* @__PURE__ */ S("span", {
511
516
  className: "text-base font-semibold text-text-primary",
512
517
  children: "Total"
513
- }), /* @__PURE__ */ C("span", {
518
+ }), /* @__PURE__ */ S("span", {
514
519
  className: "text-base font-bold text-text-primary",
515
- children: l(Z.total, { minimumFractionDigits: 0 })
520
+ children: l(X.total, { minimumFractionDigits: 0 })
516
521
  })]
517
522
  }),
518
- /* @__PURE__ */ w("button", {
523
+ /* @__PURE__ */ C("button", {
519
524
  type: "button",
520
525
  onClick: async () => {
521
- if (fe() && j) {
522
- V(null);
526
+ if (he() && k) {
527
+ B(null);
523
528
  try {
524
- let e = H ?? (await O.mutateAsync({
525
- providerId: j.cartId,
526
- customerId: x?.id,
527
- fulfillmentType: P,
528
- items: j.items.map((e) => ({
529
+ let e = V ?? (await E.mutateAsync({
530
+ providerId: k.cartId,
531
+ customerId: b?.id,
532
+ fulfillmentType: M,
533
+ items: k.items.map((e) => ({
529
534
  offeringId: e.id,
530
535
  quantity: e.quantity,
531
536
  customizations: e.customizations
532
537
  })),
533
- deliveryAddress: P === "delivery" ? `${M.addressLine1}, ${M.addressLine2}, ${M.city}, ${M.state} - ${M.pincode}` : void 0,
534
- paymentMethod: I.toUpperCase(),
535
- notes: J,
536
- deliveryFee: Z.deliveryFee,
537
- tax: Z.tax,
538
- tip: W,
539
- total: Z.total
538
+ deliveryAddress: M === "delivery" ? `${A.addressLine1}, ${A.addressLine2}, ${A.city}, ${A.state} - ${A.pincode}` : void 0,
539
+ dropoffLocation: M === "delivery" && P ? {
540
+ latitude: P.latitude,
541
+ longitude: P.longitude
542
+ } : void 0,
543
+ paymentMethod: F.toUpperCase(),
544
+ notes: q,
545
+ deliveryFee: X.deliveryFee,
546
+ tax: X.tax,
547
+ tip: U,
548
+ total: X.total
540
549
  })).id;
541
- if (I === "cash") {
550
+ if (F === "cash") {
542
551
  alert("Order placed successfully!"), h(`/customer/orders/${e}/track`);
543
552
  return;
544
553
  }
545
- U(e);
546
- let t = await z.mutateAsync({
554
+ H(e);
555
+ let t = await R.mutateAsync({
547
556
  orderId: e,
548
557
  provider: "RAZORPAY",
549
- paymentMethod: I === "card" ? "CARD" : "UPI",
558
+ paymentMethod: F === "card" ? "CARD" : "UPI",
550
559
  postalCode: $
551
560
  });
552
- await pe(t) === "paid" ? (U(null), h(`/customer/orders/${e}/track`)) : V("Payment was not completed. Click \"Pay now\" to try again, or come back later from your orders.");
561
+ await ge(t) === "paid" ? (H(null), h(`/customer/orders/${e}/track`)) : B("Payment was not completed. Click \"Pay now\" to try again, or come back later from your orders.");
553
562
  } catch (e) {
554
- V(e instanceof Error ? e.message : "Payment failed. Please try again.");
563
+ B(e instanceof Error ? e.message : "Payment failed. Please try again.");
555
564
  }
556
565
  }
557
566
  },
558
- disabled: O.isPending || z.isPending,
559
- className: c("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", O.isPending || z.isPending ? "opacity-60 cursor-not-allowed" : "hover:opacity-90"),
560
- children: [O.isPending || z.isPending ? /* @__PURE__ */ C(y, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ C(b, { className: "h-4 w-4" }), O.isPending ? "Placing Order..." : z.isPending ? "Opening payment..." : H ? `Pay now - ${l(Z.total, { minimumFractionDigits: 0 })}` : `Place Order - ${l(Z.total, { minimumFractionDigits: 0 })}`]
567
+ disabled: E.isPending || R.isPending,
568
+ className: c("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 || R.isPending ? "opacity-60 cursor-not-allowed" : "hover:opacity-90"),
569
+ children: [E.isPending || R.isPending ? /* @__PURE__ */ S(v, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ S(y, { className: "h-4 w-4" }), E.isPending ? "Placing Order..." : R.isPending ? "Opening payment..." : V ? `Pay now - ${l(X.total, { minimumFractionDigits: 0 })}` : `Place Order - ${l(X.total, { minimumFractionDigits: 0 })}`]
561
570
  }),
562
- /* @__PURE__ */ C("p", {
571
+ /* @__PURE__ */ S("p", {
563
572
  className: "mt-3 text-center text-xs text-text-secondary",
564
573
  children: "By placing this order, you agree to our Terms of Service and Privacy Policy"
565
574
  })
@@ -567,21 +576,21 @@ function D() {
567
576
  })
568
577
  })]
569
578
  })]
570
- }) : /* @__PURE__ */ C(e, {
579
+ }) : /* @__PURE__ */ S(e, {
571
580
  title: "Checkout",
572
- children: /* @__PURE__ */ w("div", {
581
+ children: /* @__PURE__ */ C("div", {
573
582
  className: "flex flex-col items-center justify-center py-16 text-center",
574
583
  children: [
575
- /* @__PURE__ */ C(b, { className: "h-16 w-16 text-text-secondary/40 mb-4" }),
576
- /* @__PURE__ */ C("h3", {
584
+ /* @__PURE__ */ S(y, { className: "h-16 w-16 text-text-secondary/40 mb-4" }),
585
+ /* @__PURE__ */ S("h3", {
577
586
  className: "text-lg font-semibold text-text-primary mb-2",
578
587
  children: "Your cart is empty"
579
588
  }),
580
- /* @__PURE__ */ C("p", {
589
+ /* @__PURE__ */ S("p", {
581
590
  className: "text-sm text-text-secondary mb-6",
582
591
  children: "Add some items to proceed with checkout"
583
592
  }),
584
- /* @__PURE__ */ C("button", {
593
+ /* @__PURE__ */ S("button", {
585
594
  type: "button",
586
595
  onClick: () => h("/customer/discover"),
587
596
  className: "rounded-lg bg-foreground px-6 py-3 text-sm font-medium text-background hover:opacity-90 transition-opacity",
@@ -591,6 +600,6 @@ function D() {
591
600
  })
592
601
  });
593
602
  }
594
- export { D as CheckoutPage };
603
+ export { T as CheckoutPage };
595
604
 
596
605
  //# sourceMappingURL=CheckoutPage.js.map