@burdenoff/microfe-kadaikodi 2026.719.2 → 2026.719.3

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.
@@ -1,263 +1,280 @@
1
- import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { EmptyState as r } from "../../components/EmptyState.js";
5
- import { useState as i } from "react";
6
- import { Banknote as a, CheckCircle2 as o, CreditCard as s, Plus as c, Shield as l, ShoppingCart as u, Smartphone as d, Trash2 as f, Wallet as p, X as m } from "lucide-react";
7
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
8
- import { EmphasisPanel as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
1
+ import { cn as e } from "../../utils/cn.js";
2
+ import { PageLayout as t } from "../../components/PageLayout.js";
3
+ import { EmptyState as n } from "../../components/EmptyState.js";
4
+ import { useAddPaymentMethod as r, useMyPaymentMethods as i, useRemovePaymentMethod as a, useSetDefaultPaymentMethod as o } from "../../hooks/useKadaikodiApi.js";
5
+ import { useState as s } from "react";
6
+ import { Banknote as c, CheckCircle2 as l, CreditCard as u, Loader2 as d, Plus as f, Shield as p, ShoppingCart as m, Smartphone as h, Trash2 as g, Wallet as _, X as v } from "lucide-react";
7
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
8
+ import { EmphasisPanel as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
9
9
  //#region src/kadaikodi/pages/customer/PaymentMethodsPage.tsx
10
- function y({ method: e, onRemove: n, onSetDefault: r }) {
11
- let i = e.icon;
12
- return /* @__PURE__ */ g("div", {
13
- className: t("flex items-center gap-4 rounded-lg border p-4", e.isDefault ? "border-foreground/30 bg-accent/50" : "border-border-subtle bg-bg-surface"),
10
+ var C = {
11
+ UPI: h,
12
+ CARD: u,
13
+ WALLET: _
14
+ };
15
+ function w({ method: t, onRemove: n, onSetDefault: r }) {
16
+ let i = C[t.type];
17
+ return /* @__PURE__ */ b("div", {
18
+ className: e("flex items-center gap-4 rounded-lg border p-4", t.isDefault ? "border-foreground/30 bg-accent/50" : "border-border-subtle bg-bg-surface"),
14
19
  children: [
15
- /* @__PURE__ */ h("div", {
20
+ /* @__PURE__ */ y("div", {
16
21
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
17
- children: /* @__PURE__ */ h(i, { className: "h-5 w-5 text-text-secondary" })
22
+ children: /* @__PURE__ */ y(i, { className: "h-5 w-5 text-text-secondary" })
18
23
  }),
19
- /* @__PURE__ */ g("div", {
24
+ /* @__PURE__ */ b("div", {
20
25
  className: "flex-1 min-w-0",
21
- children: [/* @__PURE__ */ g("div", {
26
+ children: [/* @__PURE__ */ b("div", {
22
27
  className: "flex items-center gap-2",
23
- children: [/* @__PURE__ */ h("p", {
28
+ children: [/* @__PURE__ */ y("p", {
24
29
  className: "text-sm font-medium text-text-primary",
25
- children: e.label
26
- }), e.isDefault && /* @__PURE__ */ g("span", {
30
+ children: t.label
31
+ }), t.isDefault && /* @__PURE__ */ b("span", {
27
32
  className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text",
28
- children: [/* @__PURE__ */ h(o, { className: "h-3 w-3" }), "Default"]
33
+ children: [/* @__PURE__ */ y(l, { className: "h-3 w-3" }), "Default"]
29
34
  })]
30
- }), /* @__PURE__ */ h("p", {
35
+ }), /* @__PURE__ */ y("p", {
31
36
  className: "mt-0.5 text-xs text-text-secondary font-mono",
32
- children: e.detail
37
+ children: t.detail
33
38
  })]
34
39
  }),
35
- /* @__PURE__ */ g("div", {
40
+ /* @__PURE__ */ b("div", {
36
41
  className: "flex items-center gap-1",
37
- children: [!e.isDefault && /* @__PURE__ */ h("button", {
42
+ children: [!t.isDefault && /* @__PURE__ */ y("button", {
38
43
  type: "button",
39
- onClick: () => r(e.id),
44
+ onClick: () => r(t.id),
40
45
  title: "Set as default",
41
46
  className: "rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
42
47
  children: "Set Default"
43
- }), /* @__PURE__ */ h("button", {
48
+ }), /* @__PURE__ */ y("button", {
44
49
  type: "button",
45
- onClick: () => n(e.id),
50
+ onClick: () => n(t.id),
46
51
  title: "Remove payment method",
47
52
  className: "rounded-md p-2 text-text-secondary hover:bg-status-error-bg/10 hover:text-status-error-text transition-colors",
48
- children: /* @__PURE__ */ h(f, { className: "h-4 w-4" })
53
+ children: /* @__PURE__ */ y(g, { className: "h-4 w-4" })
49
54
  })]
50
55
  })
51
56
  ]
52
57
  });
53
58
  }
54
- function b() {
55
- let { navigateTo: f } = e(), [b, x] = i([]), [S, C] = i(!1), [w, T] = i("card"), [E, D] = i(null), [O, k] = i({
59
+ function T() {
60
+ let { data: g = [], isLoading: C } = i(), T = r(), E = a(), D = o(), [O, k] = s(!1), [A, j] = s("card"), [M, N] = s(null), [P, F] = s({
56
61
  cardNumber: "",
57
62
  expiry: "",
58
63
  cvv: "",
59
64
  nameOnCard: ""
60
- }), [A, j] = i({ upiId: "" }), [M, N] = i({
65
+ }), [I, L] = s({ upiId: "" }), [R, z] = s({
61
66
  walletProvider: "Paytm",
62
67
  mobile: ""
63
- }), P = (e) => {
64
- D(e), setTimeout(() => D(null), 3e3);
65
- }, F = () => {
66
- k({
68
+ }), B = (e) => {
69
+ N(e), setTimeout(() => N(null), 3e3);
70
+ }, V = () => {
71
+ F({
67
72
  cardNumber: "",
68
73
  expiry: "",
69
74
  cvv: "",
70
75
  nameOnCard: ""
71
- }), j({ upiId: "" }), N({
76
+ }), L({ upiId: "" }), z({
72
77
  walletProvider: "Paytm",
73
78
  mobile: ""
74
- }), T("card");
75
- }, I = (e) => {
76
- x((t) => t.filter((t) => t.id !== e)), P("Payment method removed");
77
- }, L = (e) => {
78
- x((t) => t.map((t) => ({
79
- ...t,
80
- isDefault: t.id === e
81
- }))), P("Default payment method updated");
82
- }, R = () => {
83
- let e = "", t = "", n = s;
84
- if (w === "card") {
85
- if (!O.cardNumber.trim() || !O.expiry.trim() || !O.cvv.trim() || !O.nameOnCard.trim()) {
79
+ }), j("card");
80
+ }, H = async (e) => {
81
+ try {
82
+ await E.mutateAsync(e), B("Payment method removed");
83
+ } catch {
84
+ alert("Failed to remove payment method. Please try again.");
85
+ }
86
+ }, U = async (e) => {
87
+ try {
88
+ await D.mutateAsync(e), B("Default payment method updated");
89
+ } catch {
90
+ alert("Failed to set default payment method. Please try again.");
91
+ }
92
+ }, W = async () => {
93
+ let e = "", t = "", n = "CARD";
94
+ if (A === "card") {
95
+ if (!P.cardNumber.trim() || !P.expiry.trim() || !P.cvv.trim() || !P.nameOnCard.trim()) {
86
96
  alert("Please fill in all card fields.");
87
97
  return;
88
98
  }
89
- e = `${O.nameOnCard}'s Card`, t = `**** **** **** ${O.cardNumber.slice(-4)}`, n = s;
90
- } else if (w === "upi") {
91
- if (!A.upiId.trim()) {
99
+ e = `${P.nameOnCard}'s Card`, t = `**** **** **** ${P.cardNumber.slice(-4)}`, n = "CARD";
100
+ } else if (A === "upi") {
101
+ if (!I.upiId.trim()) {
92
102
  alert("Please enter a UPI ID.");
93
103
  return;
94
104
  }
95
- e = "UPI", t = A.upiId, n = d;
105
+ e = "UPI", t = I.upiId, n = "UPI";
96
106
  } else {
97
- if (!M.mobile.trim()) {
107
+ if (!R.mobile.trim()) {
98
108
  alert("Please enter mobile number.");
99
109
  return;
100
110
  }
101
- e = M.walletProvider, t = `Mobile: ${M.mobile}`, n = p;
111
+ e = R.walletProvider, t = `Mobile: ${R.mobile}`, n = "WALLET";
112
+ }
113
+ try {
114
+ await T.mutateAsync({
115
+ type: n,
116
+ label: e,
117
+ detail: t
118
+ }), V(), k(!1), B("Payment method added successfully");
119
+ } catch {
120
+ alert("Failed to save payment method. Please try again.");
102
121
  }
103
- let r = {
104
- id: `pm-${Date.now()}`,
105
- type: w,
106
- label: e,
107
- detail: t,
108
- icon: n,
109
- isDefault: !1
110
- };
111
- x((e) => [...e, r]), F(), C(!1), P("Payment method added successfully");
112
- }, z = {
113
- upi: b.filter((e) => e.type === "upi"),
114
- card: b.filter((e) => e.type === "card"),
115
- wallet: b.filter((e) => e.type === "wallet")
122
+ }, G = {
123
+ upi: g.filter((e) => e.type === "UPI"),
124
+ card: g.filter((e) => e.type === "CARD"),
125
+ wallet: g.filter((e) => e.type === "WALLET")
116
126
  };
117
- return /* @__PURE__ */ g(n, {
127
+ return C ? /* @__PURE__ */ y(t, {
128
+ title: "Payment Methods",
129
+ description: "Manage your saved payment options",
130
+ children: /* @__PURE__ */ y("div", {
131
+ className: "flex h-40 items-center justify-center",
132
+ children: /* @__PURE__ */ y(d, { className: "h-6 w-6 animate-spin text-text-secondary" })
133
+ })
134
+ }) : /* @__PURE__ */ b(t, {
118
135
  title: "Payment Methods",
119
136
  description: "Manage your saved payment options",
120
- actions: /* @__PURE__ */ g("button", {
137
+ actions: /* @__PURE__ */ b("button", {
121
138
  type: "button",
122
- onClick: () => C(!0),
123
- className: t("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-opacity", "bg-foreground text-background hover:opacity-90"),
124
- children: [/* @__PURE__ */ h(c, { className: "h-4 w-4" }), "Add Method"]
139
+ onClick: () => k(!0),
140
+ className: e("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-opacity", "bg-foreground text-background hover:opacity-90"),
141
+ children: [/* @__PURE__ */ y(f, { className: "h-4 w-4" }), "Add Method"]
125
142
  }),
126
143
  children: [
127
- /* @__PURE__ */ h(v, {
144
+ /* @__PURE__ */ y(S, {
128
145
  className: "mb-6",
129
146
  children: "Keep your cards and UPI handles ready so paying at checkout is instant and secure. Set a default method to skip a step every time you order — you can add or remove options here whenever you like."
130
147
  }),
131
- b.length > 0 && /* @__PURE__ */ h(_, {
148
+ g.length > 0 && /* @__PURE__ */ y(x, {
132
149
  className: "mb-6",
133
- children: /* @__PURE__ */ g("div", {
150
+ children: /* @__PURE__ */ b("div", {
134
151
  className: "flex items-center gap-2 text-sm text-text-secondary",
135
- children: [/* @__PURE__ */ h(s, { className: "h-4 w-4" }), /* @__PURE__ */ g("span", { children: [
136
- b.length,
152
+ children: [/* @__PURE__ */ y(u, { className: "h-4 w-4" }), /* @__PURE__ */ b("span", { children: [
153
+ g.length,
137
154
  " saved ",
138
- b.length === 1 ? "method" : "methods",
139
- b.some((e) => e.isDefault) ? " · a default is set for one-tap checkout" : " · set a default for faster checkout"
155
+ g.length === 1 ? "method" : "methods",
156
+ g.some((e) => e.isDefault) ? " · a default is set for one-tap checkout" : " · set a default for faster checkout"
140
157
  ] })]
141
158
  })
142
159
  }),
143
- E && /* @__PURE__ */ g("div", {
160
+ M && /* @__PURE__ */ b("div", {
144
161
  className: "mb-4 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3 flex items-center gap-2",
145
- children: [/* @__PURE__ */ h(o, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ h("p", {
162
+ children: [/* @__PURE__ */ y(l, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ y("p", {
146
163
  className: "text-sm text-status-success-text",
147
- children: E
164
+ children: M
148
165
  })]
149
166
  }),
150
- b.length > 0 ? /* @__PURE__ */ g("div", {
167
+ g.length > 0 ? /* @__PURE__ */ b("div", {
151
168
  className: "space-y-6",
152
169
  children: [
153
- z.upi.length > 0 && /* @__PURE__ */ g("section", { children: [/* @__PURE__ */ g("h3", {
170
+ G.upi.length > 0 && /* @__PURE__ */ b("section", { children: [/* @__PURE__ */ b("h3", {
154
171
  className: "text-sm font-semibold text-text-primary mb-3 flex items-center gap-2",
155
- children: [/* @__PURE__ */ h(d, { className: "h-4 w-4 text-text-secondary" }), "UPI"]
156
- }), /* @__PURE__ */ h("div", {
172
+ children: [/* @__PURE__ */ y(h, { className: "h-4 w-4 text-text-secondary" }), "UPI"]
173
+ }), /* @__PURE__ */ y("div", {
157
174
  className: "space-y-2",
158
- children: z.upi.map((e) => /* @__PURE__ */ h(y, {
175
+ children: G.upi.map((e) => /* @__PURE__ */ y(w, {
159
176
  method: e,
160
- onRemove: I,
161
- onSetDefault: L
177
+ onRemove: H,
178
+ onSetDefault: U
162
179
  }, e.id))
163
180
  })] }),
164
- z.card.length > 0 && /* @__PURE__ */ g("section", { children: [/* @__PURE__ */ g("h3", {
181
+ G.card.length > 0 && /* @__PURE__ */ b("section", { children: [/* @__PURE__ */ b("h3", {
165
182
  className: "text-sm font-semibold text-text-primary mb-3 flex items-center gap-2",
166
- children: [/* @__PURE__ */ h(s, { className: "h-4 w-4 text-text-secondary" }), "Cards"]
167
- }), /* @__PURE__ */ h("div", {
183
+ children: [/* @__PURE__ */ y(u, { className: "h-4 w-4 text-text-secondary" }), "Cards"]
184
+ }), /* @__PURE__ */ y("div", {
168
185
  className: "space-y-2",
169
- children: z.card.map((e) => /* @__PURE__ */ h(y, {
186
+ children: G.card.map((e) => /* @__PURE__ */ y(w, {
170
187
  method: e,
171
- onRemove: I,
172
- onSetDefault: L
188
+ onRemove: H,
189
+ onSetDefault: U
173
190
  }, e.id))
174
191
  })] }),
175
- z.wallet.length > 0 && /* @__PURE__ */ g("section", { children: [/* @__PURE__ */ g("h3", {
192
+ G.wallet.length > 0 && /* @__PURE__ */ b("section", { children: [/* @__PURE__ */ b("h3", {
176
193
  className: "text-sm font-semibold text-text-primary mb-3 flex items-center gap-2",
177
- children: [/* @__PURE__ */ h(p, { className: "h-4 w-4 text-text-secondary" }), "Wallets"]
178
- }), /* @__PURE__ */ h("div", {
194
+ children: [/* @__PURE__ */ y(_, { className: "h-4 w-4 text-text-secondary" }), "Wallets"]
195
+ }), /* @__PURE__ */ y("div", {
179
196
  className: "space-y-2",
180
- children: z.wallet.map((e) => /* @__PURE__ */ h(y, {
197
+ children: G.wallet.map((e) => /* @__PURE__ */ y(w, {
181
198
  method: e,
182
- onRemove: I,
183
- onSetDefault: L
199
+ onRemove: H,
200
+ onSetDefault: U
184
201
  }, e.id))
185
202
  })] }),
186
- /* @__PURE__ */ g("div", {
203
+ /* @__PURE__ */ b("div", {
187
204
  className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
188
- children: [/* @__PURE__ */ h(l, { className: "mt-0.5 h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
205
+ children: [/* @__PURE__ */ y(p, { className: "mt-0.5 h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
189
206
  className: "text-sm font-medium text-text-primary",
190
207
  children: "Secure Payments"
191
- }), /* @__PURE__ */ h("p", {
208
+ }), /* @__PURE__ */ y("p", {
192
209
  className: "mt-0.5 text-xs text-text-secondary",
193
210
  children: "Your payment information is encrypted and securely stored. We never share your financial details with third parties."
194
211
  })] })]
195
212
  })
196
213
  ]
197
- }) : /* @__PURE__ */ h(r, {
214
+ }) : /* @__PURE__ */ y(n, {
198
215
  illustration: "empty-files",
199
- icon: /* @__PURE__ */ h(s, { className: "h-12 w-12" }),
216
+ icon: /* @__PURE__ */ y(u, { className: "h-12 w-12" }),
200
217
  title: "No payment methods",
201
- description: "Add a card, UPI ID, or wallet for faster checkout. Saved-method sync is coming soon — for now, entries are kept for this session.",
202
- action: /* @__PURE__ */ h("button", {
218
+ description: "Add a card, UPI ID, or wallet for faster checkout — it's saved to your account for next time.",
219
+ action: /* @__PURE__ */ y("button", {
203
220
  type: "button",
204
- onClick: () => C(!0),
221
+ onClick: () => k(!0),
205
222
  className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
206
223
  children: "Add Payment Method"
207
224
  })
208
225
  }),
209
- /* @__PURE__ */ g("div", {
226
+ /* @__PURE__ */ b("div", {
210
227
  className: "mt-8",
211
- children: [/* @__PURE__ */ h("h2", {
228
+ children: [/* @__PURE__ */ y("h2", {
212
229
  className: "text-base font-semibold text-text-primary mb-4",
213
230
  children: "Quick Pay Options"
214
- }), /* @__PURE__ */ g("div", {
231
+ }), /* @__PURE__ */ b("div", {
215
232
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
216
- children: [/* @__PURE__ */ g("div", {
233
+ children: [/* @__PURE__ */ b("div", {
217
234
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
218
235
  children: [
219
- /* @__PURE__ */ g("div", {
236
+ /* @__PURE__ */ b("div", {
220
237
  className: "flex items-center gap-3 mb-2",
221
- children: [/* @__PURE__ */ h("div", {
238
+ children: [/* @__PURE__ */ y("div", {
222
239
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
223
- children: /* @__PURE__ */ h(a, { className: "h-5 w-5 text-text-secondary" })
224
- }), /* @__PURE__ */ h("h3", {
240
+ children: /* @__PURE__ */ y(c, { className: "h-5 w-5 text-text-secondary" })
241
+ }), /* @__PURE__ */ y("h3", {
225
242
  className: "text-sm font-semibold text-text-primary",
226
243
  children: "Cash on Delivery"
227
244
  })]
228
245
  }),
229
- /* @__PURE__ */ h("p", {
246
+ /* @__PURE__ */ y("p", {
230
247
  className: "text-xs text-text-secondary mb-3",
231
248
  children: "Pay when you receive your order"
232
249
  }),
233
- /* @__PURE__ */ g("div", {
250
+ /* @__PURE__ */ b("div", {
234
251
  className: "flex items-center gap-2 text-status-success-text",
235
- children: [/* @__PURE__ */ h(o, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ h("span", {
252
+ children: [/* @__PURE__ */ y(l, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ y("span", {
236
253
  className: "text-xs",
237
254
  children: "Available for all orders"
238
255
  })]
239
256
  })
240
257
  ]
241
- }), /* @__PURE__ */ g("div", {
258
+ }), /* @__PURE__ */ b("div", {
242
259
  className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
243
260
  children: [
244
- /* @__PURE__ */ g("div", {
261
+ /* @__PURE__ */ b("div", {
245
262
  className: "flex items-center gap-3 mb-2",
246
- children: [/* @__PURE__ */ h("div", {
263
+ children: [/* @__PURE__ */ y("div", {
247
264
  className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
248
- children: /* @__PURE__ */ h(u, { className: "h-5 w-5 text-text-secondary" })
249
- }), /* @__PURE__ */ h("h3", {
265
+ children: /* @__PURE__ */ y(m, { className: "h-5 w-5 text-text-secondary" })
266
+ }), /* @__PURE__ */ y("h3", {
250
267
  className: "text-sm font-semibold text-text-primary",
251
268
  children: "Pay at Cart"
252
269
  })]
253
270
  }),
254
- /* @__PURE__ */ h("p", {
271
+ /* @__PURE__ */ y("p", {
255
272
  className: "text-xs text-text-secondary mb-3",
256
273
  children: "Pay directly to the vendor"
257
274
  }),
258
- /* @__PURE__ */ g("div", {
275
+ /* @__PURE__ */ b("div", {
259
276
  className: "flex items-center gap-2 text-status-success-text",
260
- children: [/* @__PURE__ */ h(o, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ h("span", {
277
+ children: [/* @__PURE__ */ y(l, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ y("span", {
261
278
  className: "text-xs",
262
279
  children: "Supports all payment methods"
263
280
  })]
@@ -266,126 +283,126 @@ function b() {
266
283
  })]
267
284
  })]
268
285
  }),
269
- S && /* @__PURE__ */ h("div", {
286
+ O && /* @__PURE__ */ y("div", {
270
287
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
271
- children: /* @__PURE__ */ h("div", {
288
+ children: /* @__PURE__ */ y("div", {
272
289
  className: "w-full max-w-md max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-lg",
273
- children: /* @__PURE__ */ g("div", {
290
+ children: /* @__PURE__ */ b("div", {
274
291
  className: "p-5",
275
292
  children: [
276
- /* @__PURE__ */ g("div", {
293
+ /* @__PURE__ */ b("div", {
277
294
  className: "flex items-center justify-between mb-4",
278
- children: [/* @__PURE__ */ h("h2", {
295
+ children: [/* @__PURE__ */ y("h2", {
279
296
  className: "text-lg font-semibold text-text-primary",
280
297
  children: "Add Payment Method"
281
- }), /* @__PURE__ */ h("button", {
298
+ }), /* @__PURE__ */ y("button", {
282
299
  type: "button",
283
300
  onClick: () => {
284
- C(!1), F();
301
+ k(!1), V();
285
302
  },
286
303
  className: "rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
287
- children: /* @__PURE__ */ h(m, { className: "h-4 w-4" })
304
+ children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
288
305
  })]
289
306
  }),
290
- /* @__PURE__ */ h("p", {
307
+ /* @__PURE__ */ y("p", {
291
308
  className: "text-sm text-text-secondary mb-5",
292
309
  children: "Choose a payment method to add to your account"
293
310
  }),
294
- /* @__PURE__ */ h("div", {
311
+ /* @__PURE__ */ y("div", {
295
312
  className: "space-y-2 mb-5",
296
313
  children: [
297
314
  {
298
315
  value: "card",
299
316
  label: "Credit/Debit Card",
300
317
  sub: "Visa, Mastercard, Rupay",
301
- Icon: s
318
+ Icon: u
302
319
  },
303
320
  {
304
321
  value: "upi",
305
322
  label: "UPI",
306
323
  sub: "Google Pay, PhonePe, Paytm",
307
- Icon: d
324
+ Icon: h
308
325
  },
309
326
  {
310
327
  value: "wallet",
311
328
  label: "Wallet",
312
329
  sub: "Paytm, Amazon Pay, Mobikwik",
313
- Icon: p
330
+ Icon: _
314
331
  }
315
- ].map(({ value: e, label: n, sub: r, Icon: i }) => /* @__PURE__ */ g("label", {
316
- className: t("flex items-center gap-3 rounded-lg border p-3 cursor-pointer transition-colors", w === e ? "border-foreground bg-accent" : "border-border-subtle hover:bg-accent"),
332
+ ].map(({ value: t, label: n, sub: r, Icon: i }) => /* @__PURE__ */ b("label", {
333
+ className: e("flex items-center gap-3 rounded-lg border p-3 cursor-pointer transition-colors", A === t ? "border-foreground bg-accent" : "border-border-subtle hover:bg-accent"),
317
334
  children: [
318
- /* @__PURE__ */ h("input", {
335
+ /* @__PURE__ */ y("input", {
319
336
  type: "radio",
320
337
  name: "paymentType",
321
- value: e,
322
- checked: w === e,
323
- onChange: () => T(e),
338
+ value: t,
339
+ checked: A === t,
340
+ onChange: () => j(t),
324
341
  className: "h-4 w-4 shrink-0"
325
342
  }),
326
- /* @__PURE__ */ h(i, { className: "h-5 w-5 text-text-secondary shrink-0" }),
327
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
343
+ /* @__PURE__ */ y(i, { className: "h-5 w-5 text-text-secondary shrink-0" }),
344
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
328
345
  className: "text-sm font-medium text-text-primary",
329
346
  children: n
330
- }), /* @__PURE__ */ h("p", {
347
+ }), /* @__PURE__ */ y("p", {
331
348
  className: "text-xs text-text-secondary",
332
349
  children: r
333
350
  })] })
334
351
  ]
335
- }, e))
352
+ }, t))
336
353
  }),
337
- w === "card" && /* @__PURE__ */ g("div", {
354
+ A === "card" && /* @__PURE__ */ b("div", {
338
355
  className: "space-y-3",
339
356
  children: [
340
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
357
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
341
358
  className: "block text-sm font-medium text-text-primary mb-1",
342
359
  children: "Card Number"
343
- }), /* @__PURE__ */ h("input", {
360
+ }), /* @__PURE__ */ y("input", {
344
361
  type: "text",
345
362
  placeholder: "1234 5678 9012 3456",
346
- value: O.cardNumber,
347
- onChange: (e) => k((t) => ({
363
+ value: P.cardNumber,
364
+ onChange: (e) => F((t) => ({
348
365
  ...t,
349
366
  cardNumber: e.target.value
350
367
  })),
351
368
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
352
369
  })] }),
353
- /* @__PURE__ */ g("div", {
370
+ /* @__PURE__ */ b("div", {
354
371
  className: "grid grid-cols-2 gap-3",
355
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
372
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
356
373
  className: "block text-sm font-medium text-text-primary mb-1",
357
374
  children: "Expiry Date"
358
- }), /* @__PURE__ */ h("input", {
375
+ }), /* @__PURE__ */ y("input", {
359
376
  type: "text",
360
377
  placeholder: "MM/YY",
361
- value: O.expiry,
362
- onChange: (e) => k((t) => ({
378
+ value: P.expiry,
379
+ onChange: (e) => F((t) => ({
363
380
  ...t,
364
381
  expiry: e.target.value
365
382
  })),
366
383
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
367
- })] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
384
+ })] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
368
385
  className: "block text-sm font-medium text-text-primary mb-1",
369
386
  children: "CVV"
370
- }), /* @__PURE__ */ h("input", {
387
+ }), /* @__PURE__ */ y("input", {
371
388
  type: "password",
372
389
  placeholder: "123",
373
- value: O.cvv,
374
- onChange: (e) => k((t) => ({
390
+ value: P.cvv,
391
+ onChange: (e) => F((t) => ({
375
392
  ...t,
376
393
  cvv: e.target.value
377
394
  })),
378
395
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
379
396
  })] })]
380
397
  }),
381
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
398
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
382
399
  className: "block text-sm font-medium text-text-primary mb-1",
383
400
  children: "Name on Card"
384
- }), /* @__PURE__ */ h("input", {
401
+ }), /* @__PURE__ */ y("input", {
385
402
  type: "text",
386
403
  placeholder: "John Doe",
387
- value: O.nameOnCard,
388
- onChange: (e) => k((t) => ({
404
+ value: P.nameOnCard,
405
+ onChange: (e) => F((t) => ({
389
406
  ...t,
390
407
  nameOnCard: e.target.value
391
408
  })),
@@ -393,59 +410,59 @@ function b() {
393
410
  })] })
394
411
  ]
395
412
  }),
396
- w === "upi" && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
413
+ A === "upi" && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
397
414
  className: "block text-sm font-medium text-text-primary mb-1",
398
415
  children: "UPI ID"
399
- }), /* @__PURE__ */ h("input", {
416
+ }), /* @__PURE__ */ y("input", {
400
417
  type: "text",
401
418
  placeholder: "yourname@paytm",
402
- value: A.upiId,
403
- onChange: (e) => j({ upiId: e.target.value }),
419
+ value: I.upiId,
420
+ onChange: (e) => L({ upiId: e.target.value }),
404
421
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
405
422
  })] }),
406
- w === "wallet" && /* @__PURE__ */ g("div", {
423
+ A === "wallet" && /* @__PURE__ */ b("div", {
407
424
  className: "space-y-3",
408
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
425
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
409
426
  className: "block text-sm font-medium text-text-primary mb-1",
410
427
  children: "Select Wallet"
411
- }), /* @__PURE__ */ g("select", {
412
- value: M.walletProvider,
413
- onChange: (e) => N((t) => ({
428
+ }), /* @__PURE__ */ b("select", {
429
+ value: R.walletProvider,
430
+ onChange: (e) => z((t) => ({
414
431
  ...t,
415
432
  walletProvider: e.target.value
416
433
  })),
417
434
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
418
435
  children: [
419
- /* @__PURE__ */ h("option", { children: "Paytm" }),
420
- /* @__PURE__ */ h("option", { children: "Amazon Pay" }),
421
- /* @__PURE__ */ h("option", { children: "Mobikwik" }),
422
- /* @__PURE__ */ h("option", { children: "Freecharge" })
436
+ /* @__PURE__ */ y("option", { children: "Paytm" }),
437
+ /* @__PURE__ */ y("option", { children: "Amazon Pay" }),
438
+ /* @__PURE__ */ y("option", { children: "Mobikwik" }),
439
+ /* @__PURE__ */ y("option", { children: "Freecharge" })
423
440
  ]
424
- })] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
441
+ })] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
425
442
  className: "block text-sm font-medium text-text-primary mb-1",
426
443
  children: "Mobile Number"
427
- }), /* @__PURE__ */ h("input", {
444
+ }), /* @__PURE__ */ y("input", {
428
445
  type: "tel",
429
446
  placeholder: "9876543210",
430
- value: M.mobile,
431
- onChange: (e) => N((t) => ({
447
+ value: R.mobile,
448
+ onChange: (e) => z((t) => ({
432
449
  ...t,
433
450
  mobile: e.target.value
434
451
  })),
435
452
  className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
436
453
  })] })]
437
454
  }),
438
- /* @__PURE__ */ g("div", {
455
+ /* @__PURE__ */ b("div", {
439
456
  className: "flex items-center gap-3 pt-5",
440
- children: [/* @__PURE__ */ h("button", {
457
+ children: [/* @__PURE__ */ y("button", {
441
458
  type: "button",
442
- onClick: R,
459
+ onClick: W,
443
460
  className: "flex-1 rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
444
461
  children: "Add Payment Method"
445
- }), /* @__PURE__ */ h("button", {
462
+ }), /* @__PURE__ */ y("button", {
446
463
  type: "button",
447
464
  onClick: () => {
448
- C(!1), F();
465
+ k(!1), V();
449
466
  },
450
467
  className: "flex-1 rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
451
468
  children: "Cancel"
@@ -459,6 +476,6 @@ function b() {
459
476
  });
460
477
  }
461
478
  //#endregion
462
- export { b as PaymentMethodsPage };
479
+ export { T as PaymentMethodsPage };
463
480
 
464
481
  //# sourceMappingURL=PaymentMethodsPage.js.map