@burdenoff/microfe-billing 2026.913.1 → 2026.915.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 (45) hide show
  1. package/dist/billing/BillingAdminRoutes.js +84 -71
  2. package/dist/billing/BillingAdminRoutes.js.map +1 -1
  3. package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
  4. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +90 -87
  5. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  6. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +97 -58
  7. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -1
  8. package/dist/billing/modules/checkout/components/OrderSummary.js +22 -19
  9. package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
  10. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
  11. package/dist/billing/modules/checkout/components/StoreShippingSection.js +191 -177
  12. package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
  13. package/dist/billing/modules/checkout/hooks/useCheckout.js +174 -157
  14. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
  15. package/dist/billing/modules/checkout/pages/CheckoutPage.js +191 -184
  16. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  17. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +293 -274
  18. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  19. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +140 -250
  20. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
  21. package/dist/billing/modules/earnings/api.js +79 -42
  22. package/dist/billing/modules/earnings/api.js.map +1 -1
  23. package/dist/billing/modules/earnings/index.js +4 -3
  24. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +103 -310
  25. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
  26. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +545 -0
  27. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -0
  28. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +246 -196
  29. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  30. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +44 -28
  31. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
  32. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +317 -270
  33. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  34. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +153 -150
  35. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  36. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +1 -1
  37. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  38. package/dist/billing/modules/usage/hooks/useUsage.js +74 -48
  39. package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
  40. package/dist/generated/global-operations.js +220 -183
  41. package/dist/generated/global-operations.js.map +1 -1
  42. package/dist/generated/global-types.js.map +1 -1
  43. package/dist/node_modules/sonner/dist/index.js +163 -0
  44. package/dist/node_modules/sonner/dist/index.js.map +1 -0
  45. package/package.json +1 -1
@@ -4,398 +4,288 @@ import "../../../shared/utils/index.js";
4
4
  import { useDashboardMutations as n, usePaymentProviderConfig as r } from "../hooks/useDashboard.js";
5
5
  import "../hooks/index.js";
6
6
  import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
7
- import { AlertCircle as c, CheckCircle2 as l, CreditCard as u, Loader2 as d, X as ee } from "lucide-react";
8
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
9
- import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { AlertCircle as c, CheckCircle2 as l, CreditCard as u, Loader2 as d, X as f } from "lucide-react";
8
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
9
+ import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
10
10
  //#region src/billing/modules/dashboard/components/AddPaymentMethodModal.tsx
11
- var h = (e, t) => new Promise((n, r) => {
11
+ var _ = (e, t) => new Promise((n, r) => {
12
12
  if (document.getElementById(t)) {
13
13
  n();
14
14
  return;
15
15
  }
16
16
  let i = document.createElement("script");
17
17
  i.id = t, i.src = e, i.async = !0, i.onload = () => n(), i.onerror = () => r(/* @__PURE__ */ Error(`Failed to load ${e}`)), document.head.appendChild(i);
18
- }), g = ({ isOpen: g, onClose: _, billingAccountId: v, currency: y, country: b, onSuccess: x }) => {
19
- let { t: S } = te(), C = (e, t) => {
18
+ }), v = ({ isOpen: v, onClose: y, billingAccountId: b, onSuccess: x }) => {
19
+ let { t: S } = g(), C = (e, t) => {
20
20
  let n = S(e);
21
21
  return n === e ? t : n;
22
- }, ne = o(null), w = o(null), T = o(null), E = o(null), { stripeEnabled: D, stripePublishableKey: O, razorpayEnabled: k, isLoading: A } = r(!g), { isAddingPaymentMethod: j, verifyPaymentMethod: M } = n(), N = y?.toUpperCase() === "INR" || b?.toUpperCase() === "IN", P = k && N, F = D && !N, [I, L] = s("select-provider"), [R, z] = s(null), [B, V] = s(null), [H, U] = s(!1), [W, G] = s(!1), [K, q] = s(""), [J, Y] = s(!0), [re, X] = s(!1), Z = i((e) => {
23
- z(e), L("add-card"), V(null);
22
+ }, w = o(null), T = o(null), E = o(null), D = o(null), { stripeEnabled: O, stripePublishableKey: k, isLoading: A } = r(!v), { isAddingPaymentMethod: j, verifyPaymentMethod: M } = n(), N = O, [P, F] = s("select-provider"), [I, L] = s(null), [R, z] = s(null), [B, V] = s(!1), [H, U] = s(!1), [W, G] = s(""), [K, q] = s(!0), [J, Y] = s(!1), X = i((e) => {
23
+ L(e), F("add-card"), z(null);
24
24
  }, []);
25
25
  a(() => {
26
- g ? (L("select-provider"), z(null), V(null), q(""), Y(!0), X(!1)) : T.current &&= (T.current.destroy(), null);
27
- }, [g]), a(() => {
28
- I !== "select-provider" || A || (F && !P ? Z("stripe") : P && !F && Z("razorpay"));
26
+ v ? (F("select-provider"), L(null), z(null), G(""), q(!0), Y(!1)) : E.current &&= (E.current.destroy(), null);
27
+ }, [v]), a(() => {
28
+ P !== "select-provider" || A || N && X("stripe");
29
29
  }, [
30
- I,
31
- A,
32
- F,
33
30
  P,
34
- Z
31
+ A,
32
+ N,
33
+ X
35
34
  ]), a(() => {
36
- if (!(I !== "add-card" || R !== "stripe")) {
37
- if (!O && !A) {
38
- V("Stripe is not configured. Please contact support.");
35
+ if (!(P !== "add-card" || I !== "stripe")) {
36
+ if (!k && !A) {
37
+ z("Stripe is not configured. Please contact support.");
39
38
  return;
40
39
  }
41
- return O ? ((async () => {
42
- G(!0);
40
+ return k ? ((async () => {
41
+ U(!0);
43
42
  try {
44
- if (await h("https://js.stripe.com/v3/", "stripe-js"), !window.Stripe) throw Error("Stripe SDK failed to load");
45
- let e = window.Stripe(O);
46
- E.current = e;
43
+ if (await _("https://js.stripe.com/v3/", "stripe-js"), !window.Stripe) throw Error("Stripe SDK failed to load");
44
+ let e = window.Stripe(k);
45
+ D.current = e;
47
46
  let n = 0;
48
- for (; !w.current && n < 50;) await new Promise((e) => setTimeout(e, 100)), n++;
49
- if (!w.current) throw Error("Card element container not found after 5 seconds");
50
- if (T.current) return;
47
+ for (; !T.current && n < 50;) await new Promise((e) => setTimeout(e, 100)), n++;
48
+ if (!T.current) throw Error("Card element container not found after 5 seconds");
49
+ if (E.current) return;
51
50
  let r = e.elements().create("card", { style: t("system-ui, -apple-system, sans-serif") });
52
- r.mount(w.current), T.current = r, r.on("change", (e) => {
53
- X(e.complete), e.error ? V(e.error.message) : V(null);
51
+ r.mount(T.current), E.current = r, r.on("change", (e) => {
52
+ Y(e.complete), e.error ? z(e.error.message) : z(null);
54
53
  });
55
54
  } catch (e) {
56
- V(e instanceof Error ? e.message : "Failed to load Stripe");
55
+ z(e instanceof Error ? e.message : "Failed to load Stripe");
57
56
  } finally {
58
- G(!1);
57
+ U(!1);
59
58
  }
60
59
  })(), () => {
61
- if (T.current) try {
62
- T.current.destroy(), T.current = null;
60
+ if (E.current) try {
61
+ E.current.destroy(), E.current = null;
63
62
  } catch {}
64
63
  }) : void 0;
65
64
  }
66
65
  }, [
66
+ P,
67
67
  I,
68
- R,
69
- O,
68
+ k,
70
69
  A
71
70
  ]), a(() => {
72
71
  let e = (e) => {
73
- e.key === "Escape" && g && !H && _();
72
+ e.key === "Escape" && v && !B && y();
74
73
  };
75
74
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
76
75
  }, [
77
- g,
78
- H,
79
- _
76
+ v,
77
+ B,
78
+ y
80
79
  ]);
81
- let Q = i(async () => {
82
- if (!E.current || !T.current) {
83
- V("Stripe not initialized");
80
+ let Z = i(async () => {
81
+ if (!D.current || !E.current) {
82
+ z("Stripe not initialized");
84
83
  return;
85
84
  }
86
- if (!K.trim()) {
87
- V("Please enter the cardholder name");
85
+ if (!W.trim()) {
86
+ z("Please enter the cardholder name");
88
87
  return;
89
88
  }
90
- U(!0), V(null);
89
+ V(!0), z(null);
91
90
  try {
92
91
  let t = await M({
93
- billingAccountId: v,
92
+ billingAccountId: b,
94
93
  currency: "USD",
95
94
  provider: e.STRIPE,
96
- setAsDefault: J
95
+ setAsDefault: K
97
96
  });
98
97
  if (!t.clientSecret) throw Error("Failed to initiate card verification");
99
- let { setupIntent: n, error: r } = await E.current.confirmCardSetup(t.clientSecret, { payment_method: {
100
- card: T.current,
101
- billing_details: { name: K }
98
+ let { setupIntent: n, error: r } = await D.current.confirmCardSetup(t.clientSecret, { payment_method: {
99
+ card: E.current,
100
+ billing_details: { name: W }
102
101
  } });
103
102
  if (r) throw Error(r.message);
104
103
  if (n?.status !== "succeeded") throw Error("Card verification failed");
105
- L("success"), await new Promise((e) => setTimeout(e, 2e3)), x?.(), setTimeout(() => {
106
- _();
104
+ F("success"), await new Promise((e) => setTimeout(e, 2e3)), x?.(), setTimeout(() => {
105
+ y();
107
106
  }, 500);
108
107
  } catch (e) {
109
- V(e instanceof Error ? e.message : "Failed to add payment method"), U(!1);
108
+ z(e instanceof Error ? e.message : "Failed to add payment method"), V(!1);
110
109
  }
111
110
  }, [
111
+ W,
112
112
  K,
113
- J,
114
- v,
113
+ b,
115
114
  M,
116
115
  x,
117
- _
118
- ]), $ = i(async () => {
119
- U(!0), V(null);
120
- try {
121
- G(!0);
122
- try {
123
- await h("https://checkout.razorpay.com/v1/checkout.js", "razorpay-sdk");
124
- } catch {
125
- V("Failed to load Razorpay SDK"), U(!1), G(!1);
126
- return;
127
- }
128
- G(!1);
129
- let t = await M({
130
- billingAccountId: v,
131
- currency: "INR",
132
- provider: e.RAZORPAY,
133
- setAsDefault: J
134
- });
135
- if (!t.success || !t.orderId || !t.razorpayKeyId) {
136
- V(t.error || "Failed to initiate verification"), U(!1);
137
- return;
138
- }
139
- if (!window.Razorpay) {
140
- V("Razorpay SDK not loaded"), U(!1);
141
- return;
142
- }
143
- let n = {
144
- key: t.razorpayKeyId,
145
- amount: (t.amount ?? 0) * 100,
146
- currency: t.currency.toUpperCase(),
147
- order_id: t.orderId,
148
- customer_id: t.razorpayCustomerId,
149
- name: "Add Payment Method",
150
- description: `₹${t.amount} verification charge (refundable)`,
151
- prefill: {
152
- name: t.prefillName,
153
- email: t.prefillEmail,
154
- contact: t.prefillContact
155
- },
156
- notes: {
157
- purchaseType: "PAYMENT_METHOD_VERIFICATION",
158
- default_method: J.toString()
159
- },
160
- handler: async () => {
161
- L("success"), await new Promise((e) => setTimeout(e, 2e3)), x?.(), setTimeout(() => {
162
- _();
163
- }, 500);
164
- },
165
- modal: { ondismiss: () => {
166
- U(!1), V("Payment cancelled");
167
- } }
168
- };
169
- new window.Razorpay(n).open();
170
- } catch (e) {
171
- V(e instanceof Error ? e.message : "Failed to add payment method"), U(!1);
172
- }
173
- }, [
174
- J,
175
- v,
176
- M,
177
- x,
178
- _
179
- ]), ie = i(() => {
180
- R === "stripe" ? Q() : R === "razorpay" && $();
181
- }, [
182
- R,
183
- Q,
184
- $
185
- ]);
186
- return g ? /* @__PURE__ */ m("div", {
116
+ y
117
+ ]), Q = i(() => {
118
+ I === "stripe" && Z();
119
+ }, [I, Z]);
120
+ return v ? /* @__PURE__ */ h("div", {
187
121
  className: "fixed inset-0 z-50 flex items-center justify-center",
188
122
  role: "dialog",
189
123
  "aria-modal": "true",
190
124
  "aria-labelledby": "modal-title",
191
- children: [/* @__PURE__ */ p("div", {
125
+ children: [/* @__PURE__ */ m("div", {
192
126
  className: "absolute inset-0 bg-bg-overlay backdrop-blur-sm",
193
- onClick: H ? void 0 : _,
127
+ onClick: B ? void 0 : y,
194
128
  "aria-hidden": "true"
195
- }), /* @__PURE__ */ m("div", {
196
- ref: ne,
129
+ }), /* @__PURE__ */ h("div", {
130
+ ref: w,
197
131
  className: "relative w-full max-w-md max-h-[90vh] mx-4 bg-bg-surface border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] flex flex-col",
198
132
  children: [
199
- /* @__PURE__ */ m("header", {
133
+ /* @__PURE__ */ h("header", {
200
134
  className: "flex items-center justify-between p-4 border-b border-border-subtle flex-shrink-0",
201
- children: [/* @__PURE__ */ m("div", {
135
+ children: [/* @__PURE__ */ h("div", {
202
136
  className: "flex items-center gap-3",
203
- children: [/* @__PURE__ */ p("div", {
137
+ children: [/* @__PURE__ */ m("div", {
204
138
  className: "size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
205
- children: /* @__PURE__ */ p(u, { className: "size-5 text-text-link" })
206
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
139
+ children: /* @__PURE__ */ m(u, { className: "size-5 text-text-link" })
140
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
207
141
  id: "modal-title",
208
142
  className: "text-lg font-semibold text-text-primary",
209
- children: I === "success" ? "Payment Method Added" : "Add Payment Method"
210
- }), /* @__PURE__ */ m("p", {
143
+ children: P === "success" ? "Payment Method Added" : "Add Payment Method"
144
+ }), /* @__PURE__ */ h("p", {
211
145
  className: "text-sm text-text-secondary",
212
146
  children: [
213
- I === "select-provider" && "Choose a payment provider",
214
- I === "add-card" && (R === "stripe" ? "Add card via Stripe" : "Add payment method with ₹1 verification"),
215
- I === "processing" && "Processing...",
216
- I === "success" && "Your payment method has been saved"
147
+ P === "select-provider" && (N ? "Add card via Stripe" : "Standalone card save unavailable"),
148
+ P === "add-card" && "Add card via Stripe",
149
+ P === "processing" && "Processing...",
150
+ P === "success" && "Your payment method has been saved"
217
151
  ]
218
152
  })] })]
219
- }), /* @__PURE__ */ p("button", {
153
+ }), /* @__PURE__ */ m("button", {
220
154
  type: "button",
221
- onClick: _,
222
- disabled: H,
155
+ onClick: y,
156
+ disabled: B,
223
157
  className: "p-2 rounded-button hover:bg-bg-sunken text-text-secondary hover:text-text-primary transition-colors disabled:opacity-50",
224
158
  "aria-label": "Close modal",
225
- children: /* @__PURE__ */ p(ee, { className: "size-5" })
159
+ children: /* @__PURE__ */ m(f, { className: "size-5" })
226
160
  })]
227
161
  }),
228
- /* @__PURE__ */ p("div", {
162
+ /* @__PURE__ */ m("div", {
229
163
  className: "p-4 overflow-y-auto flex-1",
230
- children: A ? /* @__PURE__ */ p("div", {
164
+ children: A ? /* @__PURE__ */ m("div", {
231
165
  className: "flex items-center justify-center py-8",
232
- children: /* @__PURE__ */ p(d, { className: "size-6 animate-spin text-text-secondary" })
233
- }) : I === "select-provider" ? /* @__PURE__ */ m("div", {
166
+ children: /* @__PURE__ */ m(d, { className: "size-6 animate-spin text-text-secondary" })
167
+ }) : P === "select-provider" ? /* @__PURE__ */ m("div", {
234
168
  className: "space-y-3",
235
- children: [
236
- F && /* @__PURE__ */ m("button", {
237
- type: "button",
238
- onClick: () => Z("stripe"),
239
- className: "w-full flex items-center gap-4 p-4 border border-border-subtle rounded-lg hover:border-border-strong hover:bg-[var(--color-accent-soft)] transition-colors text-left",
240
- children: [/* @__PURE__ */ p("div", {
241
- className: "size-12 rounded-lg bg-accent-violet-subtle flex items-center justify-center",
242
- children: /* @__PURE__ */ p(u, { className: "size-6 text-accent-violet" })
243
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
244
- className: "font-medium text-text-primary",
245
- children: "Stripe"
246
- }), /* @__PURE__ */ p("p", {
247
- className: "text-sm text-text-secondary",
248
- children: "Cards, Apple Pay, Google Pay"
249
- })] })]
250
- }),
251
- P && /* @__PURE__ */ m("button", {
252
- type: "button",
253
- onClick: () => Z("razorpay"),
254
- className: "w-full flex items-center gap-4 p-4 border border-border-subtle rounded-lg hover:border-border-strong hover:bg-[var(--color-accent-soft)] transition-colors text-left",
255
- children: [/* @__PURE__ */ p("div", {
256
- className: "size-12 rounded-lg bg-status-info-bg-subtle flex items-center justify-center",
257
- children: /* @__PURE__ */ p(u, { className: "size-6 text-accent-blue" })
258
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
169
+ children: N ? /* @__PURE__ */ m("div", {
170
+ className: "flex items-center justify-center py-8",
171
+ children: /* @__PURE__ */ m(d, { className: "size-6 animate-spin text-text-secondary" })
172
+ }) : /* @__PURE__ */ h("div", {
173
+ className: "flex flex-col items-center py-8 text-center",
174
+ children: [
175
+ /* @__PURE__ */ m(c, { className: "size-12 text-status-warning-text mb-3" }),
176
+ /* @__PURE__ */ m("p", {
259
177
  className: "font-medium text-text-primary",
260
- children: "Razorpay"
261
- }), /* @__PURE__ */ p("p", {
262
- className: "text-sm text-text-secondary",
263
- children: "UPI, Netbanking, Cards"
264
- })] })]
265
- }),
266
- !F && !P && /* @__PURE__ */ m("div", {
267
- className: "flex flex-col items-center py-8 text-center",
268
- children: [
269
- /* @__PURE__ */ p(c, { className: "size-12 text-status-warning-text mb-3" }),
270
- /* @__PURE__ */ p("p", {
271
- className: "font-medium text-text-primary",
272
- children: C("billing.overview.noPaymentProviders", "No Payment Providers Available")
273
- }),
274
- /* @__PURE__ */ p("p", {
275
- className: "text-sm text-text-secondary mt-1",
276
- children: N ? "Razorpay is not configured for Indian accounts. Please contact support." : "Stripe is not configured for international accounts. Please contact support."
277
- })
278
- ]
279
- })
280
- ]
281
- }) : I === "add-card" ? /* @__PURE__ */ m("div", {
178
+ children: C("billing.overview.noPaymentProviders", "No Payment Providers Available")
179
+ }),
180
+ /* @__PURE__ */ m("p", {
181
+ className: "text-sm text-text-secondary mt-1",
182
+ children: "Card saving isn't configured for this account yet. Please contact support."
183
+ })
184
+ ]
185
+ })
186
+ }) : P === "add-card" ? /* @__PURE__ */ h("div", {
282
187
  className: "space-y-4",
283
188
  children: [
284
- B && /* @__PURE__ */ m("div", {
189
+ R && /* @__PURE__ */ h("div", {
285
190
  className: "flex items-center gap-2 p-3 rounded-lg bg-status-error-bg-subtle border border-status-error-border text-status-error-text",
286
- children: [/* @__PURE__ */ p(c, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ p("p", {
191
+ children: [/* @__PURE__ */ m(c, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ m("p", {
287
192
  className: "text-sm",
288
- children: B
193
+ children: R
289
194
  })]
290
195
  }),
291
- R === "stripe" && /* @__PURE__ */ m("div", {
196
+ I === "stripe" && /* @__PURE__ */ h("div", {
292
197
  className: "space-y-1.5",
293
- children: [/* @__PURE__ */ p("label", {
198
+ children: [/* @__PURE__ */ m("label", {
294
199
  htmlFor: "cardholderName",
295
200
  className: "block text-sm font-medium text-text-primary",
296
201
  children: "Cardholder Name"
297
- }), /* @__PURE__ */ p("input", {
202
+ }), /* @__PURE__ */ m("input", {
298
203
  type: "text",
299
204
  id: "cardholderName",
300
- value: K,
301
- onChange: (e) => q(e.target.value),
205
+ value: W,
206
+ onChange: (e) => G(e.target.value),
302
207
  className: "w-full px-3 py-2 border border-border-default rounded-input bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-border-strong",
303
208
  placeholder: "John Doe",
304
- disabled: H
209
+ disabled: B
305
210
  })]
306
211
  }),
307
- R === "stripe" && /* @__PURE__ */ m("div", {
212
+ I === "stripe" && /* @__PURE__ */ h("div", {
308
213
  className: "space-y-1.5",
309
- children: [/* @__PURE__ */ p("label", {
214
+ children: [/* @__PURE__ */ m("label", {
310
215
  className: "block text-sm font-medium text-text-primary",
311
216
  children: C("billing.overview.cardDetails", "Card Details")
312
- }), /* @__PURE__ */ m("div", {
217
+ }), /* @__PURE__ */ h("div", {
313
218
  className: "relative",
314
- children: [/* @__PURE__ */ p("div", {
315
- ref: w,
219
+ children: [/* @__PURE__ */ m("div", {
220
+ ref: T,
316
221
  className: "p-3 border border-border-default rounded-lg bg-bg-surface min-h-[56px]"
317
- }), W && /* @__PURE__ */ m("div", {
222
+ }), H && /* @__PURE__ */ h("div", {
318
223
  className: "absolute inset-0 flex items-center justify-center bg-bg-overlay rounded-lg",
319
- children: [/* @__PURE__ */ p(d, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ p("span", {
224
+ children: [/* @__PURE__ */ m(d, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ m("span", {
320
225
  className: "ml-2 text-sm text-text-secondary",
321
226
  children: "Loading Stripe…"
322
227
  })]
323
228
  })]
324
229
  })]
325
230
  }),
326
- R === "razorpay" && /* @__PURE__ */ p("div", {
327
- className: "p-3 border border-border-subtle rounded-lg bg-status-info-bg-subtle",
328
- children: /* @__PURE__ */ m("p", {
329
- className: "text-sm text-status-info-text",
330
- children: [/* @__PURE__ */ p("strong", { children: "Verification Process:" }), " A ₹1 charge will be made to verify your payment method. This amount will be refunded immediately after verification."]
331
- })
332
- }),
333
- /* @__PURE__ */ m("label", {
231
+ /* @__PURE__ */ h("label", {
334
232
  className: "flex items-center gap-2 cursor-pointer",
335
- children: [/* @__PURE__ */ p("input", {
233
+ children: [/* @__PURE__ */ m("input", {
336
234
  type: "checkbox",
337
- checked: J,
338
- onChange: (e) => Y(e.target.checked),
235
+ checked: K,
236
+ onChange: (e) => q(e.target.checked),
339
237
  className: "size-4 rounded border-border-default text-text-link focus:ring-[var(--color-focus-ring)]",
340
- disabled: H
341
- }), /* @__PURE__ */ p("span", {
238
+ disabled: B
239
+ }), /* @__PURE__ */ m("span", {
342
240
  className: "text-sm text-text-primary",
343
241
  children: C("billing.overview.setAsDefault", "Set as default payment method")
344
242
  })]
345
243
  }),
346
- /* @__PURE__ */ m("div", {
244
+ /* @__PURE__ */ h("div", {
347
245
  className: "flex items-center gap-2 pt-2 border-t border-border-subtle",
348
- children: [/* @__PURE__ */ p("span", {
246
+ children: [/* @__PURE__ */ m("span", {
349
247
  className: "text-xs text-text-secondary",
350
248
  children: "Secured by"
351
- }), /* @__PURE__ */ p("span", {
352
- className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${R === "stripe" ? "bg-accent-violet-subtle text-accent-violet" : "bg-status-info-bg-subtle text-status-info-text"}`,
353
- children: R === "stripe" ? "Stripe" : "Razorpay"
249
+ }), /* @__PURE__ */ m("span", {
250
+ className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-accent-violet-subtle text-accent-violet",
251
+ children: "Stripe"
354
252
  })]
355
253
  })
356
254
  ]
357
- }) : /* @__PURE__ */ m("div", {
255
+ }) : /* @__PURE__ */ h("div", {
358
256
  className: "flex flex-col items-center py-8 text-center",
359
257
  children: [
360
- /* @__PURE__ */ p("div", {
258
+ /* @__PURE__ */ m("div", {
361
259
  className: "size-16 rounded-full bg-status-success-bg-subtle flex items-center justify-center mb-4",
362
- children: /* @__PURE__ */ p(l, { className: "size-8 text-status-success-text" })
260
+ children: /* @__PURE__ */ m(l, { className: "size-8 text-status-success-text" })
363
261
  }),
364
- /* @__PURE__ */ p("p", {
262
+ /* @__PURE__ */ m("p", {
365
263
  className: "font-medium text-text-primary",
366
264
  children: C("billing.overview.paymentMethodAdded", "Payment method added successfully!")
367
265
  }),
368
- /* @__PURE__ */ p("p", {
266
+ /* @__PURE__ */ m("p", {
369
267
  className: "text-sm text-text-secondary mt-1",
370
268
  children: "Your payment method has been securely saved."
371
269
  })
372
270
  ]
373
271
  })
374
272
  }),
375
- I !== "success" && /* @__PURE__ */ m("footer", {
273
+ P !== "success" && /* @__PURE__ */ h("footer", {
376
274
  className: "flex items-center justify-between gap-3 p-4 border-t border-border-subtle bg-bg-sunken rounded-b-lg flex-shrink-0",
377
- children: [I === "add-card" && F && P ? /* @__PURE__ */ p("button", {
378
- type: "button",
379
- onClick: () => {
380
- L("select-provider"), z(null), V(null), T.current &&= (T.current.destroy(), null);
381
- },
382
- disabled: H,
383
- className: "px-4 py-2 text-sm font-medium text-text-primary hover:text-text-link transition-colors disabled:opacity-50",
384
- children: "Back"
385
- }) : /* @__PURE__ */ p("div", {}), /* @__PURE__ */ m("div", {
275
+ children: [/* @__PURE__ */ m("div", {}), /* @__PURE__ */ h("div", {
386
276
  className: "flex items-center gap-3",
387
- children: [/* @__PURE__ */ p("button", {
277
+ children: [/* @__PURE__ */ m("button", {
388
278
  type: "button",
389
- onClick: _,
390
- disabled: H,
279
+ onClick: y,
280
+ disabled: B,
391
281
  className: "px-4 py-2 text-sm font-medium text-text-primary border border-border-subtle rounded-lg hover:bg-bg-sunken transition-colors disabled:opacity-50",
392
282
  children: "Cancel"
393
- }), I === "add-card" && /* @__PURE__ */ p("button", {
283
+ }), P === "add-card" && /* @__PURE__ */ m("button", {
394
284
  type: "button",
395
- onClick: ie,
396
- disabled: H || j || W || R === "stripe" && !re,
285
+ onClick: Q,
286
+ disabled: B || j || H || !J,
397
287
  className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-lg hover:bg-action-primary-bgHover transition-colors disabled:opacity-50",
398
- children: H || j ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, { className: "size-4 animate-spin" }), R === "razorpay" ? "Processing..." : "Saving..."] }) : W ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, { className: "size-4 animate-spin" }), "Loading…"] }) : R === "stripe" ? "Add Card" : "Add Payment Method (₹1)"
288
+ children: B || j ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(d, { className: "size-4 animate-spin" }), "Saving..."] }) : H ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(d, { className: "size-4 animate-spin" }), "Loading…"] }) : "Add Card"
399
289
  })]
400
290
  })]
401
291
  })
@@ -404,6 +294,6 @@ var h = (e, t) => new Promise((n, r) => {
404
294
  }) : null;
405
295
  };
406
296
  //#endregion
407
- export { g as AddPaymentMethodModal };
297
+ export { v as AddPaymentMethodModal };
408
298
 
409
299
  //# sourceMappingURL=AddPaymentMethodModal.js.map