@burdenoff/microfe-billing 2026.625.4 → 2026.626.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 (96) hide show
  1. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
  2. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  7. package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  9. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
  10. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  11. package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
  12. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  13. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
  14. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  15. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
  16. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
  20. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
  22. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  31. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
  32. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  33. package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
  34. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  35. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
  36. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  37. package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
  38. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  39. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
  42. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  43. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
  44. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  45. package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
  46. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  47. package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
  48. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
  52. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  53. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
  54. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  55. package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
  56. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  57. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
  58. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  59. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
  60. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  61. package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
  64. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
  66. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  67. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
  68. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  69. package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
  70. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  71. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  73. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
  74. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  75. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
  76. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
  77. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  78. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
  79. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  80. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
  81. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  82. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
  83. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  84. package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
  85. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  86. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
  87. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  88. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
  89. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  90. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
  91. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  92. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
  93. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  94. package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
  95. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  96. package/package.json +2 -2
@@ -30,24 +30,25 @@ import { WorkspaceQuotaAssignmentModal as Ee, isWorkspaceScopedQuota as De } fro
30
30
  import "../components/index.js";
31
31
  import { buildStoreOrderCheckoutItems as Oe, normalizeStoreOrderCurrency as ke } from "../utils/storeOrder.js";
32
32
  import { useCallback as s, useEffect as c, useMemo as l, useRef as Ae, useState as u } from "react";
33
- import { ArrowLeft as je, ArrowRight as Me, Blocks as Ne, CheckCircle as Pe, Coins as Fe, CreditCard as Ie, Loader2 as Le, Package as Re, Receipt as ze, RefreshCw as Be, ShoppingCart as Ve, Wallet as He, XCircle as Ue } from "lucide-react";
34
- import { useLocation as We, useParams as Ge } from "react-router-dom";
35
- import { useAppShell as Ke } from "@burdenoff/fe-libs/shared/providers/shell";
36
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
37
- import { useI18n as qe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
38
- import { getProfileScopedKey as Je } from "@burdenoff/fe-libs/shared/utils";
33
+ import { ArrowLeft as je, ArrowRight as Me, Blocks as Ne, CheckCircle as Pe, Coins as Fe, CreditCard as Ie, Loader2 as d, Package as Le, Receipt as Re, RefreshCw as ze, ShoppingCart as Be, Wallet as Ve, XCircle as He } from "lucide-react";
34
+ import { useLocation as Ue, useParams as We } from "react-router-dom";
35
+ import { useAppShell as Ge } from "@burdenoff/fe-libs/shared/providers/shell";
36
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
37
+ import { useI18n as Ke } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
38
+ import { getProfileScopedKey as qe } from "@burdenoff/fe-libs/shared/utils";
39
+ import { PagePurpose as Je } from "@burdenoff/fe-libs/ui";
39
40
  //#region src/billing/modules/checkout/pages/CheckoutPage.tsx
40
41
  var Ye = () => {
41
- let { t: Ye } = qe(), m = (e, t) => {
42
+ let { t: Ye } = Ke(), h = (e, t) => {
42
43
  let n = Ye(e);
43
44
  return n === e ? t : n;
44
- }, { planId: Xe, addonId: Ze, storeOrderId: h } = Ge(), g = se(), _ = We(), v = _.state, Qe = a(), { emit: y } = r(), { orgId: b, stripePublishableKey: $e, razorpayKey: et, apiGatewayUrl: tt, authToken: nt, currentUser: rt, workspaceId: x } = e(), { productSlug: it } = Ke(), at = Ae(null), ot = x ? [{
45
- id: x,
45
+ }, { planId: Xe, addonId: g, storeOrderId: _ } = We(), v = se(), y = Ue(), b = y.state, Ze = a(), { emit: x } = r(), { orgId: S, stripePublishableKey: Qe, razorpayKey: $e, apiGatewayUrl: et, authToken: tt, currentUser: nt, workspaceId: C } = e(), { productSlug: rt } = Ge(), w = Ae(null), it = C ? [{
46
+ id: C,
46
47
  name: "Current workspace"
47
- }] : [], { items: S, clearCart: st, _hasHydrated: C } = oe(), w = _.pathname.includes("/checkout/addons") && !Ze, T = _.pathname.includes("/checkout/store") && !!h, E = w ? "ADDON" : T ? "ORDER" : v?.purchaseType ?? (Xe ? "PLAN" : Ze ? "ADDON" : "CREDITS"), D = v?.itemId ?? Xe ?? Ze ?? h, [ct, lt] = u(!1), O = Ae(!1), [ut, k] = u(!1), [dt, ft] = u([]), [pt, mt] = u(null), [A, j] = u("select"), [M, N] = u(null), [ht, P] = u(null), [F, I] = u(null), [gt, _t] = u("card");
48
+ }] : [], { items: T, clearCart: at, _hasHydrated: E } = oe(), D = y.pathname.includes("/checkout/addons") && !g, O = y.pathname.includes("/checkout/store") && !!_, k = D ? "ADDON" : O ? "ORDER" : b?.purchaseType ?? (Xe ? "PLAN" : g ? "ADDON" : "CREDITS"), A = b?.itemId ?? Xe ?? g ?? _, [ot, st] = u(!1), ct = Ae(!1), [lt, j] = u(!1), [ut, dt] = u([]), [ft, pt] = u(null), [M, N] = u("select"), [P, mt] = u(null), [ht, F] = u(null), [I, gt] = u(null), [_t, vt] = u("card");
48
49
  c(() => {
49
- if (A !== "success" || !F) return;
50
- let e = typeof window < "u" ? window.localStorage.getItem(Je("boff-referral-attribution")) : null;
50
+ if (M !== "success" || !I) return;
51
+ let e = typeof window < "u" ? window.localStorage.getItem(qe("boff-referral-attribution")) : null;
51
52
  if (!e) return;
52
53
  let t;
53
54
  try {
@@ -56,59 +57,59 @@ var Ye = () => {
56
57
  return;
57
58
  }
58
59
  if (!t.journeyId && !t.codeId) return;
59
- let n = F.transactionId || M?.paymentId || M?.orderId || h || D || E, r = `${t.journeyId ?? "journey"}:${n}`;
60
- at.current !== r && (at.current = r, ce({
60
+ let n = I.transactionId || P?.paymentId || P?.orderId || _ || A || k, r = `${t.journeyId ?? "journey"}:${n}`;
61
+ w.current !== r && (w.current = r, ce({
61
62
  journeyId: t.journeyId,
62
63
  codeId: t.codeId,
63
- eventType: E === "ORDER" ? "STORE_PURCHASE" : "PAID_CONVERSION",
64
- productSlug: it,
65
- actorUserId: rt?.id,
66
- orderId: F.transactionId || M?.paymentId || M?.orderId,
67
- billingAccountId: F.billingAccountId,
68
- storeOrderId: E === "ORDER" ? h : void 0,
69
- valueAmount: F.total,
70
- currency: F.currency,
64
+ eventType: k === "ORDER" ? "STORE_PURCHASE" : "PAID_CONVERSION",
65
+ productSlug: rt,
66
+ actorUserId: nt?.id,
67
+ orderId: I.transactionId || P?.paymentId || P?.orderId,
68
+ billingAccountId: I.billingAccountId,
69
+ storeOrderId: k === "ORDER" ? _ : void 0,
70
+ valueAmount: I.total,
71
+ currency: I.currency,
71
72
  mode: "billing-checkout",
72
73
  metadata: {
73
- purchaseType: E,
74
- billingAccountName: F.billingAccountName
74
+ purchaseType: k,
75
+ billingAccountName: I.billingAccountName
75
76
  }
76
77
  }, {
77
- apiGatewayUrl: tt,
78
- authToken: nt,
79
- orgId: b
78
+ apiGatewayUrl: et,
79
+ authToken: tt,
80
+ orgId: S
80
81
  }).catch(() => {
81
- at.current = null;
82
+ w.current = null;
82
83
  }));
83
84
  }, [
85
+ et,
84
86
  tt,
85
- nt,
86
- rt?.id,
87
- D,
87
+ nt?.id,
88
88
  A,
89
- b,
90
- M?.orderId,
91
- M?.paymentId,
92
- it,
93
- F,
94
- E,
95
- h
89
+ M,
90
+ S,
91
+ P?.orderId,
92
+ P?.paymentId,
93
+ rt,
94
+ I,
95
+ k,
96
+ _
96
97
  ]);
97
98
  let [L, R] = u(1), z = le({
98
99
  defaultCurrency: "USD",
99
- upgradeFromSubscriptionId: v?.upgradeFromSubscriptionId,
100
- downgradeFromSubscriptionId: v?.downgradeFromSubscriptionId
101
- }), { config: vt, stripeEnabled: yt, razorpayEnabled: B } = fe(), { elapsedTime: V, error: bt } = pe({
102
- paymentId: A === "processing" ? M?.paymentId ?? null : null,
103
- billingAccountId: z.billingAccount?.id ?? F?.billingAccountId ?? null,
104
- paymentType: gt,
100
+ upgradeFromSubscriptionId: b?.upgradeFromSubscriptionId,
101
+ downgradeFromSubscriptionId: b?.downgradeFromSubscriptionId
102
+ }), { config: yt, stripeEnabled: bt, razorpayEnabled: B } = fe(), { elapsedTime: V, error: xt } = pe({
103
+ paymentId: M === "processing" ? P?.paymentId ?? null : null,
104
+ billingAccountId: z.billingAccount?.id ?? I?.billingAccountId ?? null,
105
+ paymentType: _t,
105
106
  pollingInterval: 5e3,
106
107
  maxPollingTime: 3e5,
107
108
  onSuccess: (e) => {
108
- if (e.transactionId && I((t) => t && {
109
+ if (e.transactionId && gt((t) => t && {
109
110
  ...t,
110
111
  transactionId: e.transactionId
111
- }), j("success"), w && st(), (E === "PLAN" || E === "ADDON") && x) {
112
+ }), N("success"), D && at(), (k === "PLAN" || k === "ADDON") && C) {
112
113
  let e = (H?.getPlan?.features ?? []).filter((e) => e != null).filter((e) => e.quota?.name && De(e.quota.name)).map((e) => {
113
114
  let t = e.quota?.limits, n = t && "value" in t ? Number(t.value) : null, r = t && "type" in t ? String(t.type) : "number";
114
115
  return {
@@ -120,52 +121,52 @@ var Ye = () => {
120
121
  quotaMode: "dedicated"
121
122
  };
122
123
  });
123
- e.length > 0 && (ft(e), At().then((e) => {
124
- let t = e.data?.getActiveSubscriptions?.find((e) => e.planId === D);
125
- t && mt(t.id);
126
- }), (ot.length === 1 || ot.length > 1) && k(!0));
124
+ e.length > 0 && (dt(e), jt().then((e) => {
125
+ let t = e.data?.getActiveSubscriptions?.find((e) => e.planId === A);
126
+ t && pt(t.id);
127
+ }), (it.length === 1 || it.length > 1) && j(!0));
127
128
  }
128
129
  },
129
130
  onFailure: (e) => {
130
- P(e.failureReason || "Payment failed"), j("error");
131
+ F(e.failureReason || "Payment failed"), N("error");
131
132
  },
132
133
  onTimeout: () => {
133
- P("Payment verification timed out. Please check your billing history for the payment status."), j("error");
134
+ F("Payment verification timed out. Please check your billing history for the payment status."), N("error");
134
135
  }
135
- }), { data: xt, loading: St, refetch: Ct } = ee({}), { data: H, loading: wt } = re({
136
- variables: { id: D },
137
- skip: E !== "PLAN" || !D
138
- }), { data: U, loading: Tt } = ie({
139
- variables: { addonIDs: D ? [D] : [] },
140
- skip: E !== "ADDON" || !D || T
136
+ }), { data: St, loading: Ct, refetch: wt } = ee({}), { data: H, loading: Tt } = re({
137
+ variables: { id: A },
138
+ skip: k !== "PLAN" || !A
139
+ }), { data: U, loading: Et } = ie({
140
+ variables: { addonIDs: A ? [A] : [] },
141
+ skip: k !== "ADDON" || !A || O
141
142
  }), { data: W } = ae({
142
- variables: { id: h },
143
- skip: !T || !h
144
- }), { data: Et, loading: Dt } = ne({
143
+ variables: { id: _ },
144
+ skip: !O || !_
145
+ }), { data: Dt, loading: Ot } = ne({
145
146
  variables: { billingAccountId: z.billingAccount?.id },
146
147
  skip: !z.billingAccount?.id
147
- }), { data: Ot, loading: kt, refetch: At } = o({
148
+ }), { data: kt, loading: At, refetch: jt } = o({
148
149
  variables: { billingAccountId: z.billingAccount?.id },
149
- skip: !z.billingAccount?.id || E !== "ADDON" && E !== "PLAN" || T
150
- }), G = l(() => Ot?.getActiveSubscriptions ?? [], [Ot]), K = l(() => !z.selectedSubscriptionId || G.length === 0 ? null : G.find((e) => e.id === z.selectedSubscriptionId) ?? null, [z.selectedSubscriptionId, G]), q = z.items[0]?.type === "CREDITS" ? z.items[0].quantity : 100, { data: jt, loading: Mt } = te({
150
+ skip: !z.billingAccount?.id || k !== "ADDON" && k !== "PLAN" || O
151
+ }), G = l(() => kt?.getActiveSubscriptions ?? [], [kt]), K = l(() => !z.selectedSubscriptionId || G.length === 0 ? null : G.find((e) => e.id === z.selectedSubscriptionId) ?? null, [z.selectedSubscriptionId, G]), q = z.items[0]?.type === "CREDITS" ? z.items[0].quantity : 100, { data: Mt, loading: Nt } = te({
151
152
  variables: {
152
153
  creditAmount: q,
153
154
  currency: z.selectedCurrency || "USD"
154
155
  },
155
- skip: E !== "CREDITS"
156
- }), J = l(() => jt?.getCostOfCredits?.amount && q > 0 ? jt.getCostOfCredits.amount / q : .01, [jt, q]), Y = l(() => Et?.getPaymentMethods ?? [], [Et]), X = l(() => xt?.getBillingAccountsByOrg ?? [], [xt]), Z = l(() => {
156
+ skip: k !== "CREDITS"
157
+ }), J = l(() => Mt?.getCostOfCredits?.amount && q > 0 ? Mt.getCostOfCredits.amount / q : .01, [Mt, q]), Y = l(() => Dt?.getPaymentMethods ?? [], [Dt]), X = l(() => St?.getBillingAccountsByOrg ?? [], [St]), Z = l(() => {
157
158
  if (!z.billingAccount) return;
158
159
  let e = X.find((e) => e.id === z.billingAccount?.id)?.billingAddresses;
159
160
  if (e && e.length > 0) return e[0]?.country || void 0;
160
- }, [z.billingAccount, X]), [Nt, Pt] = u(null);
161
+ }, [z.billingAccount, X]), [Pt, Ft] = u(null);
161
162
  c(() => {
162
- if (Z) if (Z === "IN") z.selectedCurrency !== "INR" && z.setCurrency("INR"), B && Nt !== Z && z.selectedProvider !== "CREDITS" && (z.setPaymentProvider("RAZORPAY"), Pt(Z));
163
+ if (Z) if (Z === "IN") z.selectedCurrency !== "INR" && z.setCurrency("INR"), B && Pt !== Z && z.selectedProvider !== "CREDITS" && (z.setPaymentProvider("RAZORPAY"), Ft(Z));
163
164
  else {
164
165
  if (z.selectedCurrency === "INR") {
165
166
  let e = z.billingAccount?.currency, t = e && e !== "INR" ? e : "USD";
166
167
  z.setCurrency(t);
167
168
  }
168
- z.selectedProvider === "RAZORPAY" && (z.setPaymentProvider("STRIPE"), Pt(Z));
169
+ z.selectedProvider === "RAZORPAY" && (z.setPaymentProvider("STRIPE"), Ft(Z));
169
170
  }
170
171
  }, [
171
172
  Z,
@@ -175,7 +176,7 @@ var Ye = () => {
175
176
  z.setPaymentProvider,
176
177
  z.billingAccount?.currency,
177
178
  B,
178
- Nt
179
+ Pt
179
180
  ]), c(() => {
180
181
  if (!z.billingAccount?.currency || Z === "IN") return;
181
182
  let e = z.billingAccount.currency;
@@ -208,27 +209,27 @@ var Ye = () => {
208
209
  ]);
209
210
  let [Q, $] = u(!1);
210
211
  c(() => {
211
- if (!T || Q || !W?.getStoreOrder) return;
212
+ if (!O || Q || !W?.getStoreOrder) return;
212
213
  let e = ke(W.getStoreOrder.currency);
213
214
  z.selectedCurrency !== e && z.setCurrency(e);
214
215
  }, [
215
- T,
216
+ O,
216
217
  Q,
217
218
  W,
218
219
  z.selectedCurrency,
219
220
  z.setCurrency
220
221
  ]), c(() => {
221
- if (E === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT") {
222
+ if (k === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT") {
222
223
  let e = H.getPlan.minSeats ?? 1;
223
224
  R((t) => t < e ? e : t);
224
225
  }
225
- }, [H, E]), c(() => {
226
- E === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT" && Q && $(!1);
226
+ }, [H, k]), c(() => {
227
+ k === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT" && Q && $(!1);
227
228
  }, [L]), c(() => {
228
229
  if (!Q) {
229
- if (w && C && S.length > 0) {
230
+ if (D && E && T.length > 0) {
230
231
  z.clearItems();
231
- for (let e of S) {
232
+ for (let e of T) {
232
233
  let t = e.addon, n = t.features?.map((e) => ({
233
234
  id: e.quota?.id || e.id,
234
235
  name: e.quota?.name || "Feature",
@@ -250,7 +251,7 @@ var Ye = () => {
250
251
  $(!0);
251
252
  return;
252
253
  }
253
- if (E === "PLAN" && H?.getPlan) {
254
+ if (k === "PLAN" && H?.getPlan) {
254
255
  let e = H.getPlan, t = e.features?.map((e) => ({
255
256
  id: e.quota?.id || e.id,
256
257
  name: e.quota?.name || "Feature",
@@ -280,7 +281,7 @@ var Ye = () => {
280
281
  }
281
282
  };
282
283
  z.addItem(ee), $(!0);
283
- } else if (E === "ADDON" && !w && U?.getSelectedAddons?.[0]) {
284
+ } else if (k === "ADDON" && !D && U?.getSelectedAddons?.[0]) {
284
285
  let e = U.getSelectedAddons[0], t = e.features?.map((e) => ({
285
286
  id: e.quota?.id || e.id,
286
287
  name: e.quota?.name || "Feature",
@@ -293,16 +294,16 @@ var Ye = () => {
293
294
  price: r,
294
295
  priceUSD: e.price,
295
296
  currency: n,
296
- quantity: v?.quantity ?? 1,
297
+ quantity: b?.quantity ?? 1,
297
298
  features: t,
298
299
  metadata: { addonId: e.id }
299
300
  };
300
301
  z.addItem(i), $(!0);
301
- } else if (T && W?.getStoreOrder) {
302
+ } else if (O && W?.getStoreOrder) {
302
303
  let e = W.getStoreOrder, t = Oe(e);
303
304
  for (let e of t) z.addItem(e);
304
305
  $(!0);
305
- } else if (E === "CREDITS") {
306
+ } else if (k === "CREDITS") {
306
307
  let e = {
307
308
  id: "credits-purchase",
308
309
  type: "CREDITS",
@@ -316,40 +317,40 @@ var Ye = () => {
316
317
  }
317
318
  }
318
319
  }, [
319
- E,
320
+ k,
320
321
  H,
321
322
  U,
322
323
  W,
323
324
  z.addItem,
324
325
  z.clearItems,
325
- v?.quantity,
326
+ b?.quantity,
326
327
  Q,
327
- w,
328
+ D,
329
+ O,
328
330
  T,
329
- S,
330
- C,
331
+ E,
331
332
  J,
332
333
  z.selectedCurrency
333
334
  ]), c(() => {
334
- if (!(!T || !Q || z.conversionRate <= 1)) {
335
+ if (!(!O || !Q || z.conversionRate <= 1)) {
335
336
  for (let e of z.items) if (e.type === "ORDER" && e.currency !== z.selectedCurrency) {
336
337
  let t = e.price * z.conversionRate;
337
338
  z.updateItemPrice(e.id, t, z.selectedCurrency);
338
339
  }
339
340
  }
340
341
  }, [
341
- T,
342
+ O,
342
343
  Q,
343
344
  z.conversionRate,
344
345
  z.selectedCurrency,
345
346
  z.updateItemPrice
346
347
  ]), c(() => {
347
- if (E === "CREDITS" && Q && J > 0) {
348
+ if (k === "CREDITS" && Q && J > 0) {
348
349
  let e = z.items.find((e) => e.id === "credits-purchase");
349
350
  e && e.price !== J && z.updateItemPrice("credits-purchase", J);
350
351
  }
351
352
  }, [
352
- E,
353
+ k,
353
354
  Q,
354
355
  J,
355
356
  z.items,
@@ -361,12 +362,12 @@ var Ye = () => {
361
362
  let n = H.getPlan.currencyPrices?.[e] ?? H.getPlan.price;
362
363
  (t.price !== n || t.currency !== e) && z.updateItemPrice(t.id, n, e);
363
364
  } else if (t.type === "ADDON") {
364
- if (!w && U?.getSelectedAddons?.[0]) {
365
+ if (!D && U?.getSelectedAddons?.[0]) {
365
366
  let n = U.getSelectedAddons[0], r = n.currencyPrices?.[e] ?? n.price;
366
367
  (t.price !== r || t.currency !== e) && z.updateItemPrice(t.id, r, e);
367
368
  }
368
- if (w) {
369
- let n = S.find((e) => e.addon.id === t.id);
369
+ if (D) {
370
+ let n = T.find((e) => e.addon.id === t.id);
370
371
  if (n) {
371
372
  let r = n.addon.currencyPrices?.[e] ?? n.addon.price;
372
373
  (t.price !== r || t.currency !== e) && z.updateItemPrice(t.id, r, e);
@@ -380,19 +381,19 @@ var Ye = () => {
380
381
  z.updateItemPrice,
381
382
  H,
382
383
  U,
383
- S,
384
- w
384
+ T,
385
+ D
385
386
  ]), c(() => {
386
387
  if (X.length > 0 && !z.billingAccount) {
387
- if (v?.billingAccountId) {
388
- let e = X.find((e) => e.id === v.billingAccountId);
388
+ if (b?.billingAccountId) {
389
+ let e = X.find((e) => e.id === b.billingAccountId);
389
390
  if (e) {
390
391
  z.setBillingAccount(e);
391
392
  return;
392
393
  }
393
394
  }
394
- if (b) {
395
- let e = i(b);
395
+ if (S) {
396
+ let e = i(S);
396
397
  if (e) {
397
398
  let t = X.find((t) => t.id === e);
398
399
  if (t) {
@@ -407,47 +408,47 @@ var Ye = () => {
407
408
  X,
408
409
  z.billingAccount,
409
410
  z.setBillingAccount,
410
- v?.billingAccountId,
411
- b
411
+ b?.billingAccountId,
412
+ S
412
413
  ]);
413
- let Ft = !!(v?.upgradeFromSubscriptionId || v?.downgradeFromSubscriptionId);
414
+ let It = !!(b?.upgradeFromSubscriptionId || b?.downgradeFromSubscriptionId);
414
415
  c(() => {
415
- w && C && S.length === 0 && !Q && g("/addons", { replace: !0 });
416
+ D && E && T.length === 0 && !Q && v("/addons", { replace: !0 });
416
417
  }, [
417
- C,
418
- S.length,
419
- w,
418
+ E,
419
+ T.length,
420
+ D,
420
421
  Q,
421
- g
422
+ v
422
423
  ]);
423
- let It = de({
424
+ let Lt = de({
424
425
  billingAccountId: z.billingAccount?.id,
425
- purchaseType: E,
426
- productId: D
427
- }), Lt = s(async () => {
426
+ purchaseType: k,
427
+ productId: A
428
+ }), Rt = s(async () => {
428
429
  if (!z.billingAccount) return;
429
- let e = O.current;
430
- if (O.current = !1, !e && !Te(z.billingAccount)) {
431
- lt(!0);
430
+ let e = ct.current;
431
+ if (ct.current = !1, !e && !Te(z.billingAccount)) {
432
+ st(!0);
432
433
  return;
433
434
  }
434
- P(null);
435
+ F(null);
435
436
  let t = z.billingAccount.creditAmount ?? 0, n = [...z.items], r = z.total, i = await z.initiatePayment();
436
437
  if (i.success) {
437
- if (y("billing.checkout.initiated", {
438
+ if (x("billing.checkout.initiated", {
438
439
  route: "/billing/checkout",
439
440
  entityId: i.paymentId ?? i.orderId,
440
441
  source: "checkout",
441
442
  amount: i.total || r,
442
443
  currency: i.currency || z.selectedCurrency
443
444
  }), z.selectedProvider === "CREDITS") {
444
- y("billing.credits.spent", {
445
+ x("billing.credits.spent", {
445
446
  route: "/billing/checkout",
446
447
  entityId: i.orderId,
447
448
  source: "checkout",
448
449
  amount: r,
449
450
  currency: "CREDITS"
450
- }), I({
451
+ }), gt({
451
452
  items: n,
452
453
  total: r,
453
454
  billingAccountName: z.billingAccount.name,
@@ -457,10 +458,10 @@ var Ye = () => {
457
458
  paymentMethod: "credits",
458
459
  currency: "Credits",
459
460
  transactionId: i.orderId
460
- }), _t("credits"), N({ paymentId: i.orderId }), j("processing");
461
+ }), vt("credits"), mt({ paymentId: i.orderId }), N("processing");
461
462
  return;
462
463
  }
463
- I({
464
+ gt({
464
465
  items: n,
465
466
  total: i.total || r,
466
467
  billingAccountName: z.billingAccount.name,
@@ -470,7 +471,7 @@ var Ye = () => {
470
471
  paymentMethod: "card",
471
472
  currency: i.currency || z.selectedCurrency,
472
473
  transactionId: i.paymentId
473
- }), _t("card"), N({
474
+ }), vt("card"), mt({
474
475
  clientSecret: i.clientSecret,
475
476
  orderId: i.orderId,
476
477
  razorpayKeyId: i.razorpayKeyId,
@@ -482,79 +483,79 @@ var Ye = () => {
482
483
  prefillContact: i.prefillContact,
483
484
  total: i.total,
484
485
  currency: i.currency
485
- }), i.paymentComplete ? j("processing") : j("payment");
486
- } else y("billing.checkout.failed", {
486
+ }), i.paymentComplete ? N("processing") : N("payment");
487
+ } else x("billing.checkout.failed", {
487
488
  route: "/billing/checkout",
488
489
  source: "checkout",
489
490
  reason: i.error || "Payment initiation failed"
490
- }), P(i.error || "Payment initiation failed"), j("error");
491
- }, [z, y]), Rt = s((e) => {
492
- y("billing.payment.succeeded", {
491
+ }), F(i.error || "Payment initiation failed"), N("error");
492
+ }, [z, x]), zt = s((e) => {
493
+ x("billing.payment.succeeded", {
493
494
  route: "/billing/checkout",
494
- entityId: M?.paymentId ?? M?.orderId,
495
+ entityId: P?.paymentId ?? P?.orderId,
495
496
  source: "checkout"
496
- }), N((e) => e), j("processing");
497
+ }), mt((e) => e), N("processing");
497
498
  }, [
498
- y,
499
- M?.orderId,
500
- M?.paymentId
501
- ]), zt = s((e) => {
502
- y("billing.payment.failed", {
499
+ x,
500
+ P?.orderId,
501
+ P?.paymentId
502
+ ]), Bt = s((e) => {
503
+ x("billing.payment.failed", {
503
504
  route: "/billing/checkout",
504
- entityId: M?.paymentId ?? M?.orderId,
505
+ entityId: P?.paymentId ?? P?.orderId,
505
506
  source: "checkout",
506
507
  reason: e
507
- }), P(e), j("error");
508
+ }), F(e), N("error");
508
509
  }, [
509
- y,
510
- M?.orderId,
511
- M?.paymentId
512
- ]), Bt = s((e) => {
510
+ x,
511
+ P?.orderId,
512
+ P?.paymentId
513
+ ]), Vt = s((e) => {
513
514
  z.updateItemQuantity("credits-purchase", e);
514
515
  }, [z]);
515
- if (!Qe.canProcessPayment) return /* @__PURE__ */ f(t, { message: "You don't have permission to make purchases." });
516
- if (ue()) return /* @__PURE__ */ f(me, {
517
- purchaseType: E,
518
- productId: D,
516
+ if (!Ze.canProcessPayment) return /* @__PURE__ */ p(t, { message: "You don't have permission to make purchases." });
517
+ if (ue()) return /* @__PURE__ */ p(me, {
518
+ purchaseType: k,
519
+ productId: A,
519
520
  billingAccountId: z.billingAccount?.id,
520
- nativeCheckout: It,
521
- onBack: () => g("dashboard")
521
+ nativeCheckout: Lt,
522
+ onBack: () => v("dashboard")
522
523
  });
523
- let Vt = St || wt && E === "PLAN" || Tt && E === "ADDON" && !w || w && !C;
524
- if (w && C && S.length === 0 && !Q) return null;
525
- let Ht = () => {
526
- if (w) {
524
+ let Ht = Ct || Tt && k === "PLAN" || Et && k === "ADDON" && !D || D && !E;
525
+ if (D && E && T.length === 0 && !Q) return null;
526
+ let Ut = () => {
527
+ if (D) {
527
528
  let e = z.items.length;
528
529
  return `Purchase ${e} Add-on${e === 1 ? "" : "s"}`;
529
530
  }
530
- switch (E) {
531
+ switch (k) {
531
532
  case "CREDITS": return "Buy Credits";
532
533
  case "PLAN": return "Subscribe to Plan";
533
534
  case "ADDON": return "Purchase Add-on";
534
535
  default: return "Checkout";
535
536
  }
536
- }, Ut = () => {
537
- switch (E) {
538
- case "CREDITS": return /* @__PURE__ */ f(Fe, { className: "size-6" });
539
- case "PLAN": return /* @__PURE__ */ f(Re, { className: "size-6" });
540
- case "ADDON": return /* @__PURE__ */ f(Ne, { className: "size-6" });
541
- default: return /* @__PURE__ */ f(Ve, { className: "size-6" });
537
+ }, Wt = () => {
538
+ switch (k) {
539
+ case "CREDITS": return /* @__PURE__ */ p(Fe, { className: "size-6" });
540
+ case "PLAN": return /* @__PURE__ */ p(Le, { className: "size-6" });
541
+ case "ADDON": return /* @__PURE__ */ p(Ne, { className: "size-6" });
542
+ default: return /* @__PURE__ */ p(Be, { className: "size-6" });
542
543
  }
543
544
  };
544
- if (Vt) return /* @__PURE__ */ f("div", {
545
+ if (Ht) return /* @__PURE__ */ p("div", {
545
546
  className: "flex items-center justify-center min-h-[400px]",
546
- children: /* @__PURE__ */ p("div", {
547
+ children: /* @__PURE__ */ m("div", {
547
548
  className: "text-center space-y-4",
548
- children: [/* @__PURE__ */ f(Le, { className: "size-8 animate-spin mx-auto text-text-link" }), /* @__PURE__ */ f("p", {
549
+ children: [/* @__PURE__ */ p(d, { className: "size-8 animate-spin mx-auto text-text-link" }), /* @__PURE__ */ p("p", {
549
550
  className: "text-text-secondary",
550
- children: m("billing.checkout.loadingCheckout", "Loading checkout...")
551
+ children: h("billing.checkout.loadingCheckout", "Loading checkout...")
551
552
  })]
552
553
  })
553
554
  });
554
- if (A === "success") {
555
+ if (M === "success") {
555
556
  let e = (e) => {
556
- if (!F) return `${e.toFixed(2)}`;
557
- let t = F.currency;
557
+ if (!I) return `${e.toFixed(2)}`;
558
+ let t = I.currency;
558
559
  return t === "Credits" ? `${e.toFixed(2)} Credits` : `${{
559
560
  INR: "₹",
560
561
  USD: "$",
@@ -562,225 +563,225 @@ var Ye = () => {
562
563
  GBP: "£"
563
564
  }[t] || t + " "}${e.toFixed(2)}`;
564
565
  }, t = (e) => `${e.toFixed(2)} Credits`;
565
- return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p("div", {
566
+ return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", {
566
567
  className: "max-w-2xl mx-auto p-6 space-y-6",
567
568
  children: [
568
- /* @__PURE__ */ p("div", {
569
+ /* @__PURE__ */ m("div", {
569
570
  className: "text-center space-y-4",
570
- children: [/* @__PURE__ */ f("div", {
571
+ children: [/* @__PURE__ */ p("div", {
571
572
  className: "inline-flex p-4 rounded-full bg-status-success-bg-subtle text-status-success-text",
572
- children: /* @__PURE__ */ f(Pe, { className: "size-12" })
573
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
573
+ children: /* @__PURE__ */ p(Pe, { className: "size-12" })
574
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
574
575
  className: "text-2xl font-bold text-text-primary",
575
- children: m("billing.checkout.paymentSuccessful", "Payment Successful!")
576
- }), /* @__PURE__ */ f("p", {
576
+ children: h("billing.checkout.paymentSuccessful", "Payment Successful!")
577
+ }), /* @__PURE__ */ p("p", {
577
578
  className: "text-text-secondary mt-2",
578
- children: m("billing.checkout.purchaseCompleted", "Your purchase has been completed successfully.")
579
+ children: h("billing.checkout.purchaseCompleted", "Your purchase has been completed successfully.")
579
580
  })] })]
580
581
  }),
581
- F && /* @__PURE__ */ p("div", {
582
+ I && /* @__PURE__ */ m("div", {
582
583
  className: "bg-bg-surface border border-border-subtle rounded-lg overflow-hidden",
583
584
  children: [
584
- /* @__PURE__ */ p("div", {
585
+ /* @__PURE__ */ m("div", {
585
586
  className: "p-4 border-b border-border-subtle",
586
- children: [/* @__PURE__ */ p("h3", {
587
+ children: [/* @__PURE__ */ m("h3", {
587
588
  className: "font-semibold text-text-primary mb-3 flex items-center gap-2",
588
- children: [/* @__PURE__ */ f(ze, { className: "size-4" }), m("billing.checkout.itemsPurchased", "Items Purchased")]
589
- }), /* @__PURE__ */ f("div", {
589
+ children: [/* @__PURE__ */ p(Re, { className: "size-4" }), h("billing.checkout.itemsPurchased", "Items Purchased")]
590
+ }), /* @__PURE__ */ p("div", {
590
591
  className: "space-y-2",
591
- children: F.items.map((t) => /* @__PURE__ */ p("div", {
592
+ children: I.items.map((t) => /* @__PURE__ */ m("div", {
592
593
  className: "flex items-center justify-between",
593
- children: [/* @__PURE__ */ p("div", {
594
+ children: [/* @__PURE__ */ m("div", {
594
595
  className: "flex items-center gap-2",
595
596
  children: [
596
- t.type === "PLAN" && /* @__PURE__ */ f(Re, { className: "size-4 text-accent-blue" }),
597
- t.type === "ADDON" && /* @__PURE__ */ f(Ne, { className: "size-4 text-accent-purple" }),
598
- t.type === "CREDITS" && /* @__PURE__ */ f(Fe, { className: "size-4 text-status-warning-text" }),
599
- t.type === "ORDER" && /* @__PURE__ */ f(Ve, { className: "size-4 text-status-success-text" }),
600
- /* @__PURE__ */ f("span", {
597
+ t.type === "PLAN" && /* @__PURE__ */ p(Le, { className: "size-4 text-accent-blue" }),
598
+ t.type === "ADDON" && /* @__PURE__ */ p(Ne, { className: "size-4 text-accent-purple" }),
599
+ t.type === "CREDITS" && /* @__PURE__ */ p(Fe, { className: "size-4 text-status-warning-text" }),
600
+ t.type === "ORDER" && /* @__PURE__ */ p(Be, { className: "size-4 text-status-success-text" }),
601
+ /* @__PURE__ */ p("span", {
601
602
  className: "text-text-primary",
602
603
  children: t.name
603
604
  }),
604
- t.quantity > 1 && /* @__PURE__ */ p("span", {
605
+ t.quantity > 1 && /* @__PURE__ */ m("span", {
605
606
  className: "text-xs text-text-secondary",
606
607
  children: ["x", t.quantity]
607
608
  })
608
609
  ]
609
- }), /* @__PURE__ */ f("span", {
610
+ }), /* @__PURE__ */ p("span", {
610
611
  className: "text-text-secondary",
611
612
  children: e(t.price * t.quantity)
612
613
  })]
613
614
  }, t.id))
614
615
  })]
615
616
  }),
616
- /* @__PURE__ */ f("div", {
617
+ /* @__PURE__ */ p("div", {
617
618
  className: "p-4 border-b border-border-subtle bg-bg-sunken",
618
- children: /* @__PURE__ */ p("div", {
619
+ children: /* @__PURE__ */ m("div", {
619
620
  className: "grid grid-cols-2 gap-4",
620
- children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
621
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
621
622
  className: "text-xs text-text-secondary mb-1",
622
- children: m("billing.checkout.paymentMethod", "Payment Method")
623
- }), /* @__PURE__ */ f("div", {
623
+ children: h("billing.checkout.paymentMethod", "Payment Method")
624
+ }), /* @__PURE__ */ p("div", {
624
625
  className: "flex items-center gap-2",
625
- children: F.paymentMethod === "credits" ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(He, { className: "size-4 text-status-warning-text" }), /* @__PURE__ */ f("span", {
626
+ children: I.paymentMethod === "credits" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Ve, { className: "size-4 text-status-warning-text" }), /* @__PURE__ */ p("span", {
626
627
  className: "font-medium text-text-primary",
627
- children: m("billing.checkout.credits", "Credits")
628
- })] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(Ie, { className: "size-4 text-accent-blue" }), /* @__PURE__ */ f("span", {
628
+ children: h("billing.checkout.credits", "Credits")
629
+ })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Ie, { className: "size-4 text-accent-blue" }), /* @__PURE__ */ p("span", {
629
630
  className: "font-medium text-text-primary",
630
- children: m("billing.checkout.card", "Card")
631
+ children: h("billing.checkout.card", "Card")
631
632
  })] })
632
- })] }), /* @__PURE__ */ p("div", {
633
+ })] }), /* @__PURE__ */ m("div", {
633
634
  className: "text-right",
634
- children: [/* @__PURE__ */ f("p", {
635
+ children: [/* @__PURE__ */ p("p", {
635
636
  className: "text-xs text-text-secondary mb-1",
636
- children: m("billing.checkout.totalPaid", "Total Paid")
637
- }), /* @__PURE__ */ f("p", {
637
+ children: h("billing.checkout.totalPaid", "Total Paid")
638
+ }), /* @__PURE__ */ p("p", {
638
639
  className: "font-bold text-lg text-text-primary",
639
- children: e(F.total)
640
+ children: e(I.total)
640
641
  })]
641
642
  })]
642
643
  })
643
644
  }),
644
- F.paymentMethod === "credits" && /* @__PURE__ */ p("div", {
645
+ I.paymentMethod === "credits" && /* @__PURE__ */ m("div", {
645
646
  className: "p-4 border-b border-border-subtle",
646
- children: [/* @__PURE__ */ p("h3", {
647
+ children: [/* @__PURE__ */ m("h3", {
647
648
  className: "font-semibold text-text-primary mb-3 flex items-center gap-2",
648
- children: [/* @__PURE__ */ f(He, { className: "size-4" }), m("billing.checkout.creditBalance", "Credit Balance")]
649
- }), /* @__PURE__ */ p("div", {
649
+ children: [/* @__PURE__ */ p(Ve, { className: "size-4" }), h("billing.checkout.creditBalance", "Credit Balance")]
650
+ }), /* @__PURE__ */ m("div", {
650
651
  className: "flex items-center gap-4",
651
652
  children: [
652
- /* @__PURE__ */ p("div", {
653
+ /* @__PURE__ */ m("div", {
653
654
  className: "flex-1 text-center p-3 rounded-lg bg-bg-sunken",
654
- children: [/* @__PURE__ */ f("p", {
655
+ children: [/* @__PURE__ */ p("p", {
655
656
  className: "text-xs text-text-secondary mb-1",
656
- children: m("billing.checkout.previousBalance", "Previous Balance")
657
- }), /* @__PURE__ */ f("p", {
657
+ children: h("billing.checkout.previousBalance", "Previous Balance")
658
+ }), /* @__PURE__ */ p("p", {
658
659
  className: "font-semibold text-text-primary",
659
- children: t(F.previousBalance)
660
+ children: t(I.previousBalance)
660
661
  })]
661
662
  }),
662
- /* @__PURE__ */ f(Me, { className: "size-5 text-text-secondary shrink-0" }),
663
- /* @__PURE__ */ p("div", {
663
+ /* @__PURE__ */ p(Me, { className: "size-5 text-text-secondary shrink-0" }),
664
+ /* @__PURE__ */ m("div", {
664
665
  className: "flex-1 text-center p-3 rounded-lg bg-status-success-bg-subtle",
665
- children: [/* @__PURE__ */ f("p", {
666
+ children: [/* @__PURE__ */ p("p", {
666
667
  className: "text-xs text-text-secondary mb-1",
667
- children: m("billing.checkout.newBalance", "New Balance")
668
- }), /* @__PURE__ */ f("p", {
668
+ children: h("billing.checkout.newBalance", "New Balance")
669
+ }), /* @__PURE__ */ p("p", {
669
670
  className: "font-semibold text-status-success-text",
670
- children: t(F.newBalance)
671
+ children: t(I.newBalance)
671
672
  })]
672
673
  })
673
674
  ]
674
675
  })]
675
676
  }),
676
- /* @__PURE__ */ f("div", {
677
+ /* @__PURE__ */ p("div", {
677
678
  className: "p-4 bg-bg-sunken",
678
- children: /* @__PURE__ */ p("div", {
679
+ children: /* @__PURE__ */ m("div", {
679
680
  className: "flex items-center justify-between",
680
- children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
681
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
681
682
  className: "text-xs text-text-secondary mb-1",
682
- children: m("billing.checkout.billingAccount", "Billing Account")
683
- }), /* @__PURE__ */ f("p", {
683
+ children: h("billing.checkout.billingAccount", "Billing Account")
684
+ }), /* @__PURE__ */ p("p", {
684
685
  className: "font-medium text-text-primary",
685
- children: F.billingAccountName
686
- })] }), F.transactionId && /* @__PURE__ */ p("div", {
686
+ children: I.billingAccountName
687
+ })] }), I.transactionId && /* @__PURE__ */ m("div", {
687
688
  className: "text-right",
688
- children: [/* @__PURE__ */ f("p", {
689
+ children: [/* @__PURE__ */ p("p", {
689
690
  className: "text-xs text-text-secondary mb-1",
690
- children: m("billing.checkout.transactionId", "Transaction ID")
691
- }), /* @__PURE__ */ p("p", {
691
+ children: h("billing.checkout.transactionId", "Transaction ID")
692
+ }), /* @__PURE__ */ m("p", {
692
693
  className: "font-mono text-xs text-text-secondary",
693
- children: [F.transactionId.slice(0, 8), "..."]
694
+ children: [I.transactionId.slice(0, 8), "..."]
694
695
  })]
695
696
  })]
696
697
  })
697
698
  })
698
699
  ]
699
700
  }),
700
- /* @__PURE__ */ p("div", {
701
+ /* @__PURE__ */ m("div", {
701
702
  className: "flex flex-col sm:flex-row gap-3 justify-center pt-2",
702
- children: [/* @__PURE__ */ f("button", {
703
+ children: [/* @__PURE__ */ p("button", {
703
704
  type: "button",
704
- onClick: () => g("/overview"),
705
+ onClick: () => v("/overview"),
705
706
  className: "px-6 py-3 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bgHover transition-colors",
706
- children: m("billing.checkout.backToOverview", "Back to Overview")
707
- }), /* @__PURE__ */ f("button", {
707
+ children: h("billing.checkout.backToOverview", "Back to Overview")
708
+ }), /* @__PURE__ */ p("button", {
708
709
  type: "button",
709
- onClick: () => g("/subscriptions"),
710
+ onClick: () => v("/subscriptions"),
710
711
  className: "px-6 py-3 text-sm font-medium border border-border-subtle text-text-primary rounded-lg hover:bg-bg-sunken transition-colors",
711
- children: m("billing.checkout.viewSubscriptions", "View Subscriptions")
712
+ children: h("billing.checkout.viewSubscriptions", "View Subscriptions")
712
713
  })]
713
714
  })
714
715
  ]
715
- }), ut && dt.length > 0 && x && pt && /* @__PURE__ */ f(Ee, {
716
- billingAccountId: F?.billingAccountId ?? "",
717
- subscriptionId: pt,
718
- quotas: dt,
719
- workspaces: ot,
720
- currentWorkspaceId: x,
721
- onAssigned: () => k(!1),
722
- onSkip: () => k(!1)
716
+ }), lt && ut.length > 0 && C && ft && /* @__PURE__ */ p(Ee, {
717
+ billingAccountId: I?.billingAccountId ?? "",
718
+ subscriptionId: ft,
719
+ quotas: ut,
720
+ workspaces: it,
721
+ currentWorkspaceId: C,
722
+ onAssigned: () => j(!1),
723
+ onSkip: () => j(!1)
723
724
  })] });
724
725
  }
725
- if (A === "error") return /* @__PURE__ */ f("div", {
726
+ if (M === "error") return /* @__PURE__ */ p("div", {
726
727
  className: "max-w-lg mx-auto p-6",
727
- children: /* @__PURE__ */ p("div", {
728
+ children: /* @__PURE__ */ m("div", {
728
729
  className: "text-center space-y-6",
729
730
  children: [
730
- /* @__PURE__ */ f("div", {
731
+ /* @__PURE__ */ p("div", {
731
732
  className: "inline-flex p-4 rounded-full bg-status-error-bg-subtle text-status-error-text",
732
- children: /* @__PURE__ */ f(Ue, { className: "size-12" })
733
+ children: /* @__PURE__ */ p(He, { className: "size-12" })
733
734
  }),
734
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
735
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
735
736
  className: "text-2xl font-bold text-text-primary",
736
- children: m("billing.checkout.paymentFailed", "Payment Failed")
737
- }), /* @__PURE__ */ f("p", {
737
+ children: h("billing.checkout.paymentFailed", "Payment Failed")
738
+ }), /* @__PURE__ */ p("p", {
738
739
  className: "text-text-secondary mt-2",
739
- children: ht || bt || z.error || m("billing.checkout.genericError", "Something went wrong. Please try again.")
740
+ children: ht || xt || z.error || h("billing.checkout.genericError", "Something went wrong. Please try again.")
740
741
  })] }),
741
- /* @__PURE__ */ p("div", {
742
+ /* @__PURE__ */ m("div", {
742
743
  className: "flex gap-3 justify-center",
743
- children: [/* @__PURE__ */ f("button", {
744
+ children: [/* @__PURE__ */ p("button", {
744
745
  type: "button",
745
- onClick: () => g(-1),
746
+ onClick: () => v(-1),
746
747
  className: "px-4 py-2 rounded-lg border border-border-subtle hover:bg-bg-sunken",
747
- children: m("billing.checkout.goBack", "Go Back")
748
- }), /* @__PURE__ */ f("button", {
748
+ children: h("billing.checkout.goBack", "Go Back")
749
+ }), /* @__PURE__ */ p("button", {
749
750
  type: "button",
750
751
  onClick: () => {
751
- j("select"), P(null), z.reset();
752
+ N("select"), F(null), z.reset();
752
753
  },
753
754
  className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover",
754
- children: m("billing.checkout.tryAgain", "Try Again")
755
+ children: h("billing.checkout.tryAgain", "Try Again")
755
756
  })]
756
757
  })
757
758
  ]
758
759
  })
759
760
  });
760
- if (A === "processing") return /* @__PURE__ */ f("div", {
761
+ if (M === "processing") return /* @__PURE__ */ p("div", {
761
762
  className: "max-w-lg mx-auto p-6",
762
- children: /* @__PURE__ */ p("div", {
763
+ children: /* @__PURE__ */ m("div", {
763
764
  className: "text-center space-y-6",
764
765
  children: [
765
- /* @__PURE__ */ f("div", {
766
+ /* @__PURE__ */ p("div", {
766
767
  className: "inline-flex p-4 rounded-full bg-[var(--color-accent-soft)] text-text-link",
767
- children: /* @__PURE__ */ f(Le, { className: "size-12 animate-spin" })
768
+ children: /* @__PURE__ */ p(d, { className: "size-12 animate-spin" })
768
769
  }),
769
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
770
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
770
771
  className: "text-2xl font-bold text-text-primary",
771
- children: m("billing.checkout.verifyingPayment", "Verifying Payment")
772
- }), /* @__PURE__ */ f("p", {
772
+ children: h("billing.checkout.verifyingPayment", "Verifying Payment")
773
+ }), /* @__PURE__ */ p("p", {
773
774
  className: "text-text-secondary mt-2",
774
- children: m("billing.checkout.verifyingPaymentDescription", "Please wait while we confirm your payment...")
775
+ children: h("billing.checkout.verifyingPaymentDescription", "Please wait while we confirm your payment...")
775
776
  })] }),
776
- /* @__PURE__ */ p("div", {
777
+ /* @__PURE__ */ m("div", {
777
778
  className: "bg-bg-sunken rounded-lg p-4",
778
- children: [/* @__PURE__ */ p("p", {
779
+ children: [/* @__PURE__ */ m("p", {
779
780
  className: "text-sm text-text-secondary",
780
781
  children: [
781
- m("billing.checkout.timeElapsed", "Time elapsed:"),
782
+ h("billing.checkout.timeElapsed", "Time elapsed:"),
782
783
  " ",
783
- /* @__PURE__ */ f("span", {
784
+ /* @__PURE__ */ p("span", {
784
785
  className: "font-mono font-medium text-text-primary",
785
786
  children: ((e) => {
786
787
  let t = Math.floor(e / 1e3);
@@ -788,134 +789,134 @@ var Ye = () => {
788
789
  })(V)
789
790
  })
790
791
  ]
791
- }), /* @__PURE__ */ f("p", {
792
+ }), /* @__PURE__ */ p("p", {
792
793
  className: "text-xs text-text-secondary mt-1",
793
- children: m("billing.checkout.keepPageOpen", "This may take a few moments. Please don't close this page.")
794
+ children: h("billing.checkout.keepPageOpen", "This may take a few moments. Please don't close this page.")
794
795
  })]
795
796
  }),
796
- /* @__PURE__ */ f("div", {
797
+ /* @__PURE__ */ p("div", {
797
798
  className: "w-full bg-bg-sunken rounded-full h-2 overflow-hidden",
798
- children: /* @__PURE__ */ f("div", {
799
+ children: /* @__PURE__ */ p("div", {
799
800
  className: "bg-action-primary-bg h-2 rounded-full transition-all duration-1000",
800
801
  style: { width: `${Math.min(V / 3e5 * 100, 100)}%` }
801
802
  })
802
803
  }),
803
- V > 3e4 && /* @__PURE__ */ f("button", {
804
+ V > 3e4 && /* @__PURE__ */ p("button", {
804
805
  type: "button",
805
806
  onClick: () => {
806
- j("error"), P("Payment verification was cancelled. Please check your billing history.");
807
+ N("error"), F("Payment verification was cancelled. Please check your billing history.");
807
808
  },
808
809
  className: "text-sm text-text-secondary hover:text-text-primary underline",
809
- children: m("billing.checkout.cancelAndCheckHistory", "Cancel and check billing history")
810
+ children: h("billing.checkout.cancelAndCheckHistory", "Cancel and check billing history")
810
811
  })
811
812
  ]
812
813
  })
813
814
  });
814
- if (A === "payment" && M) {
815
+ if (M === "payment" && P) {
815
816
  let e = (e, t) => `${{
816
817
  INR: "₹",
817
818
  USD: "$",
818
819
  EUR: "€",
819
820
  GBP: "£"
820
- }[t] || t + " "}${e.toFixed(2)}`, t = M.currency || z.selectedCurrency, r = M.total ?? z.total;
821
- return /* @__PURE__ */ p("div", {
821
+ }[t] || t + " "}${e.toFixed(2)}`, t = P.currency || z.selectedCurrency, r = P.total ?? z.total;
822
+ return /* @__PURE__ */ m("div", {
822
823
  className: "max-w-2xl mx-auto p-4 sm:p-6 space-y-6",
823
824
  children: [
824
- /* @__PURE__ */ p("button", {
825
+ /* @__PURE__ */ m("button", {
825
826
  type: "button",
826
- onClick: () => j("select"),
827
+ onClick: () => N("select"),
827
828
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary",
828
- children: [/* @__PURE__ */ f(je, { className: "size-4" }), m("billing.checkout.backToCheckout", "Back to checkout")]
829
+ children: [/* @__PURE__ */ p(je, { className: "size-4" }), h("billing.checkout.backToCheckout", "Back to checkout")]
829
830
  }),
830
- /* @__PURE__ */ f(n, {
831
- title: m("billing.checkout.completePayment", "Complete Payment"),
832
- description: m("billing.checkout.completePaymentDescription", "Enter your payment details to complete the purchase")
831
+ /* @__PURE__ */ p(n, {
832
+ title: h("billing.checkout.completePayment", "Complete Payment"),
833
+ description: h("billing.checkout.completePaymentDescription", "Enter your payment details to complete the purchase")
833
834
  }),
834
- /* @__PURE__ */ p("div", {
835
+ /* @__PURE__ */ m("div", {
835
836
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 space-y-4",
836
837
  children: [
837
- /* @__PURE__ */ p("h3", {
838
+ /* @__PURE__ */ m("h3", {
838
839
  className: "font-semibold text-text-primary flex items-center gap-2",
839
- children: [/* @__PURE__ */ f(ze, { className: "size-4" }), m("billing.checkout.paymentSummary", "Payment Summary")]
840
+ children: [/* @__PURE__ */ p(Re, { className: "size-4" }), h("billing.checkout.paymentSummary", "Payment Summary")]
840
841
  }),
841
- z.billingAccount && /* @__PURE__ */ p("div", {
842
+ z.billingAccount && /* @__PURE__ */ m("div", {
842
843
  className: "p-3 bg-bg-sunken rounded-lg space-y-1",
843
844
  children: [
844
- /* @__PURE__ */ f("div", {
845
+ /* @__PURE__ */ p("div", {
845
846
  className: "text-xs text-text-secondary uppercase tracking-wide",
846
- children: m("billing.checkout.billingAccount", "Billing Account")
847
+ children: h("billing.checkout.billingAccount", "Billing Account")
847
848
  }),
848
- /* @__PURE__ */ f("div", {
849
+ /* @__PURE__ */ p("div", {
849
850
  className: "font-medium text-text-primary",
850
851
  children: z.billingAccount.name
851
852
  }),
852
- /* @__PURE__ */ f("div", {
853
+ /* @__PURE__ */ p("div", {
853
854
  className: "text-sm text-text-secondary",
854
855
  children: z.billingAccount.email
855
856
  })
856
857
  ]
857
858
  }),
858
- E === "ADDON" && z.selectedSubscriptionId && K && /* @__PURE__ */ p("div", {
859
+ k === "ADDON" && z.selectedSubscriptionId && K && /* @__PURE__ */ m("div", {
859
860
  className: "p-3 bg-bg-sunken rounded-lg space-y-1",
860
861
  children: [
861
- /* @__PURE__ */ f("div", {
862
+ /* @__PURE__ */ p("div", {
862
863
  className: "text-xs text-text-secondary uppercase tracking-wide",
863
- children: m("billing.checkout.addingToSubscription", "Adding to Subscription")
864
+ children: h("billing.checkout.addingToSubscription", "Adding to Subscription")
864
865
  }),
865
- /* @__PURE__ */ f("div", {
866
+ /* @__PURE__ */ p("div", {
866
867
  className: "font-medium text-text-primary",
867
- children: K.plan?.name || m("billing.checkout.subscription", "Subscription")
868
+ children: K.plan?.name || h("billing.checkout.subscription", "Subscription")
868
869
  }),
869
- K.plan?.product?.name && /* @__PURE__ */ f("div", {
870
+ K.plan?.product?.name && /* @__PURE__ */ p("div", {
870
871
  className: "text-sm text-text-secondary",
871
872
  children: K.plan.product.name
872
873
  })
873
874
  ]
874
875
  }),
875
- /* @__PURE__ */ p("div", {
876
+ /* @__PURE__ */ m("div", {
876
877
  className: "space-y-2 text-sm",
877
878
  children: [
878
879
  (() => {
879
880
  let n = z.taxRate, i = n > 0 ? r / (1 + n) : r, a = n > 0 ? r - i : 0;
880
- return /* @__PURE__ */ p(d, { children: [
881
- /* @__PURE__ */ p("div", {
881
+ return /* @__PURE__ */ m(f, { children: [
882
+ /* @__PURE__ */ m("div", {
882
883
  className: "flex justify-between",
883
- children: [/* @__PURE__ */ f("span", {
884
+ children: [/* @__PURE__ */ p("span", {
884
885
  className: "text-text-secondary",
885
- children: m("billing.checkout.subtotal", "Subtotal")
886
- }), /* @__PURE__ */ f("span", {
886
+ children: h("billing.checkout.subtotal", "Subtotal")
887
+ }), /* @__PURE__ */ p("span", {
887
888
  className: "text-text-primary",
888
889
  children: e(i, t)
889
890
  })]
890
891
  }),
891
- z.discountAmount > 0 && /* @__PURE__ */ p("div", {
892
+ z.discountAmount > 0 && /* @__PURE__ */ m("div", {
892
893
  className: "flex justify-between text-status-success-text",
893
- children: [/* @__PURE__ */ f("span", { children: m("billing.checkout.discount", "Discount") }), /* @__PURE__ */ p("span", { children: ["-", e(z.discountAmount, t)] })]
894
+ children: [/* @__PURE__ */ p("span", { children: h("billing.checkout.discount", "Discount") }), /* @__PURE__ */ m("span", { children: ["-", e(z.discountAmount, t)] })]
894
895
  }),
895
- a > 0 && /* @__PURE__ */ p("div", {
896
+ a > 0 && /* @__PURE__ */ m("div", {
896
897
  className: "flex justify-between",
897
- children: [/* @__PURE__ */ p("span", {
898
+ children: [/* @__PURE__ */ m("span", {
898
899
  className: "text-text-secondary",
899
900
  children: [
900
- z.taxType || m("billing.checkout.tax", "Tax"),
901
+ z.taxType || h("billing.checkout.tax", "Tax"),
901
902
  " (",
902
903
  (n * 100).toFixed(0),
903
904
  "%)"
904
905
  ]
905
- }), /* @__PURE__ */ f("span", {
906
+ }), /* @__PURE__ */ p("span", {
906
907
  className: "text-text-primary",
907
908
  children: e(a, t)
908
909
  })]
909
910
  })
910
911
  ] });
911
912
  })(),
912
- /* @__PURE__ */ f("div", { className: "border-t border-border-subtle my-2" }),
913
- /* @__PURE__ */ p("div", {
913
+ /* @__PURE__ */ p("div", { className: "border-t border-border-subtle my-2" }),
914
+ /* @__PURE__ */ m("div", {
914
915
  className: "flex justify-between font-semibold",
915
- children: [/* @__PURE__ */ f("span", {
916
+ children: [/* @__PURE__ */ p("span", {
916
917
  className: "text-text-primary",
917
- children: m("billing.checkout.total", "Total")
918
- }), /* @__PURE__ */ f("span", {
918
+ children: h("billing.checkout.total", "Total")
919
+ }), /* @__PURE__ */ p("span", {
919
920
  className: "text-lg text-text-primary",
920
921
  children: e(r, t)
921
922
  })]
@@ -924,172 +925,176 @@ var Ye = () => {
924
925
  })
925
926
  ]
926
927
  }),
927
- z.selectedProvider === "STRIPE" && M.clientSecret && /* @__PURE__ */ f("div", {
928
+ z.selectedProvider === "STRIPE" && P.clientSecret && /* @__PURE__ */ p("div", {
928
929
  className: "rounded-lg border border-border-subtle bg-bg-surface overflow-hidden",
929
- children: /* @__PURE__ */ f("div", {
930
+ children: /* @__PURE__ */ p("div", {
930
931
  className: "p-4 space-y-4",
931
- children: /* @__PURE__ */ f(ye, {
932
- clientSecret: M.clientSecret,
933
- publishableKey: $e || vt?.stripePublishableKey || "",
934
- amount: Math.round((M.total ?? z.total) * 100),
935
- currency: M.currency || z.selectedCurrency,
936
- onSuccess: Rt,
937
- onError: zt,
938
- onCancel: () => j("select"),
932
+ children: /* @__PURE__ */ p(ye, {
933
+ clientSecret: P.clientSecret,
934
+ publishableKey: Qe || yt?.stripePublishableKey || "",
935
+ amount: Math.round((P.total ?? z.total) * 100),
936
+ currency: P.currency || z.selectedCurrency,
937
+ onSuccess: zt,
938
+ onError: Bt,
939
+ onCancel: () => N("select"),
939
940
  isCompletingExistingPayment: !!z.selectedPaymentMethodId
940
941
  })
941
942
  })
942
943
  }),
943
- z.selectedProvider === "RAZORPAY" && M.orderId && /* @__PURE__ */ f("div", {
944
+ z.selectedProvider === "RAZORPAY" && P.orderId && /* @__PURE__ */ p("div", {
944
945
  className: "rounded-lg border border-border-subtle bg-bg-surface overflow-hidden",
945
- children: /* @__PURE__ */ p("div", {
946
+ children: /* @__PURE__ */ m("div", {
946
947
  className: "p-4 space-y-4",
947
- children: [/* @__PURE__ */ p("label", {
948
+ children: [/* @__PURE__ */ m("label", {
948
949
  className: "flex items-center gap-2 cursor-pointer",
949
- children: [/* @__PURE__ */ f("input", {
950
+ children: [/* @__PURE__ */ p("input", {
950
951
  type: "checkbox",
951
952
  checked: z.saveCard,
952
953
  onChange: (e) => z.setSaveCard(e.target.checked),
953
954
  className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
954
- }), /* @__PURE__ */ f("span", {
955
+ }), /* @__PURE__ */ p("span", {
955
956
  className: "text-sm text-text-secondary",
956
957
  children: "Save card for future purchases"
957
958
  })]
958
- }), /* @__PURE__ */ f(be, {
959
- orderId: M.orderId,
960
- keyId: M.razorpayKeyId || et || "",
961
- amount: Math.round((M.total ?? z.total) * 100),
962
- currency: M.currency || "INR",
963
- customerId: M.razorpayCustomerId,
959
+ }), /* @__PURE__ */ p(be, {
960
+ orderId: P.orderId,
961
+ keyId: P.razorpayKeyId || $e || "",
962
+ amount: Math.round((P.total ?? z.total) * 100),
963
+ currency: P.currency || "INR",
964
+ customerId: P.razorpayCustomerId,
964
965
  prefill: {
965
- name: M.prefillName,
966
- email: M.prefillEmail,
967
- contact: M.prefillContact
966
+ name: P.prefillName,
967
+ email: P.prefillEmail,
968
+ contact: P.prefillContact
968
969
  },
969
- onSuccess: (e) => Rt(e.razorpay_payment_id),
970
- onError: zt,
971
- onCancel: () => j("select")
970
+ onSuccess: (e) => zt(e.razorpay_payment_id),
971
+ onError: Bt,
972
+ onCancel: () => N("select")
972
973
  })]
973
974
  })
974
975
  })
975
976
  ]
976
977
  });
977
978
  }
978
- return /* @__PURE__ */ p("div", {
979
+ return /* @__PURE__ */ m("div", {
979
980
  className: "max-w-6xl mx-auto p-4 sm:p-6",
980
981
  children: [
981
- /* @__PURE__ */ p("button", {
982
+ /* @__PURE__ */ m("button", {
982
983
  type: "button",
983
- onClick: () => g(-1),
984
+ onClick: () => v(-1),
984
985
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary mb-4",
985
- children: [/* @__PURE__ */ f(je, { className: "size-4" }), "Back"]
986
+ children: [/* @__PURE__ */ p(je, { className: "size-4" }), "Back"]
986
987
  }),
987
- /* @__PURE__ */ p("div", {
988
+ /* @__PURE__ */ m("div", {
988
989
  className: "flex items-center gap-3 mb-6",
989
- children: [/* @__PURE__ */ f("div", {
990
+ children: [/* @__PURE__ */ p("div", {
990
991
  className: "p-2 rounded-lg bg-[var(--color-accent-soft)] text-text-link",
991
- children: Ut()
992
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
992
+ children: Wt()
993
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
993
994
  className: "text-2xl font-bold text-text-primary",
994
- children: Ht()
995
- }), /* @__PURE__ */ f("p", {
995
+ children: Ut()
996
+ }), /* @__PURE__ */ p("p", {
996
997
  className: "text-sm text-text-secondary",
997
998
  children: "Complete your purchase securely"
998
999
  })] })]
999
1000
  }),
1000
- v?.upgradeFromSubscriptionId && v?.currentPlanName && /* @__PURE__ */ f("div", {
1001
+ /* @__PURE__ */ p(Je, {
1002
+ className: "mb-6",
1003
+ children: h("billing.checkout.purpose", "Review what you are buying — plan, add-ons or credits — pick the billing account and payment method, apply any discount code, and pay. Taxes and the final total are shown before you confirm.")
1004
+ }),
1005
+ b?.upgradeFromSubscriptionId && b?.currentPlanName && /* @__PURE__ */ p("div", {
1001
1006
  className: "mb-6 p-4 rounded-lg border border-border-subtle bg-status-info-bg-subtle",
1002
- children: /* @__PURE__ */ p("div", {
1007
+ children: /* @__PURE__ */ m("div", {
1003
1008
  className: "flex items-center gap-3",
1004
- children: [/* @__PURE__ */ f("div", {
1009
+ children: [/* @__PURE__ */ p("div", {
1005
1010
  className: "p-2 rounded-full bg-status-info-bg-subtle",
1006
- children: /* @__PURE__ */ f(Be, { className: "size-4 text-accent-blue" })
1007
- }), /* @__PURE__ */ p("div", {
1011
+ children: /* @__PURE__ */ p(ze, { className: "size-4 text-accent-blue" })
1012
+ }), /* @__PURE__ */ m("div", {
1008
1013
  className: "flex-1",
1009
- children: [/* @__PURE__ */ p("p", {
1014
+ children: [/* @__PURE__ */ m("p", {
1010
1015
  className: "text-sm font-medium text-status-info-text",
1011
1016
  children: [
1012
1017
  "Upgrading from:",
1013
1018
  " ",
1014
- /* @__PURE__ */ f("span", {
1019
+ /* @__PURE__ */ p("span", {
1015
1020
  className: "font-semibold",
1016
- children: v.currentPlanName
1021
+ children: b.currentPlanName
1017
1022
  })
1018
1023
  ]
1019
- }), /* @__PURE__ */ f("p", {
1024
+ }), /* @__PURE__ */ p("p", {
1020
1025
  className: "text-xs text-status-info-text mt-0.5",
1021
1026
  children: "Your current subscription will be marked as upgraded and quotas will transfer to the new plan."
1022
1027
  })]
1023
1028
  })]
1024
1029
  })
1025
1030
  }),
1026
- v?.downgradeFromSubscriptionId && v?.currentPlanName && /* @__PURE__ */ f("div", {
1031
+ b?.downgradeFromSubscriptionId && b?.currentPlanName && /* @__PURE__ */ p("div", {
1027
1032
  className: "mb-6 p-4 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle",
1028
- children: /* @__PURE__ */ p("div", {
1033
+ children: /* @__PURE__ */ m("div", {
1029
1034
  className: "flex items-center gap-3",
1030
- children: [/* @__PURE__ */ f("div", {
1035
+ children: [/* @__PURE__ */ p("div", {
1031
1036
  className: "p-2 rounded-full bg-status-warning-bg-subtle",
1032
- children: /* @__PURE__ */ f(Be, { className: "size-4 text-status-warning-text" })
1033
- }), /* @__PURE__ */ p("div", {
1037
+ children: /* @__PURE__ */ p(ze, { className: "size-4 text-status-warning-text" })
1038
+ }), /* @__PURE__ */ m("div", {
1034
1039
  className: "flex-1",
1035
- children: [/* @__PURE__ */ p("p", {
1040
+ children: [/* @__PURE__ */ m("p", {
1036
1041
  className: "text-sm font-medium text-status-warning-text",
1037
1042
  children: [
1038
1043
  "Downgrading from:",
1039
1044
  " ",
1040
- /* @__PURE__ */ f("span", {
1045
+ /* @__PURE__ */ p("span", {
1041
1046
  className: "font-semibold",
1042
- children: v.currentPlanName
1047
+ children: b.currentPlanName
1043
1048
  })
1044
1049
  ]
1045
- }), /* @__PURE__ */ f("p", {
1050
+ }), /* @__PURE__ */ p("p", {
1046
1051
  className: "text-xs text-status-warning-text mt-0.5",
1047
1052
  children: "Your current plan stays active until it expires, you keep all its features until then. After expiry, only the new plan applies."
1048
1053
  })]
1049
1054
  })]
1050
1055
  })
1051
1056
  }),
1052
- /* @__PURE__ */ p("div", {
1057
+ /* @__PURE__ */ m("div", {
1053
1058
  className: "grid gap-6 lg:grid-cols-5",
1054
- children: [/* @__PURE__ */ p("div", {
1059
+ children: [/* @__PURE__ */ m("div", {
1055
1060
  className: "lg:col-span-3 space-y-6 order-2 lg:order-1",
1056
1061
  children: [
1057
- E === "CREDITS" && z.items[0] && /* @__PURE__ */ f("div", {
1062
+ k === "CREDITS" && z.items[0] && /* @__PURE__ */ p("div", {
1058
1063
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 sm:p-6",
1059
- children: /* @__PURE__ */ f(ve, {
1064
+ children: /* @__PURE__ */ p(ve, {
1060
1065
  value: z.items[0].quantity,
1061
- onChange: Bt,
1066
+ onChange: Vt,
1062
1067
  costPerCredit: J,
1063
1068
  currency: z.selectedCurrency,
1064
- disabled: Mt
1069
+ disabled: Nt
1065
1070
  })
1066
1071
  }),
1067
- /* @__PURE__ */ p("div", {
1072
+ /* @__PURE__ */ m("div", {
1068
1073
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 sm:p-6 space-y-4",
1069
- children: [/* @__PURE__ */ f(he, {
1074
+ children: [/* @__PURE__ */ p(he, {
1070
1075
  accounts: X,
1071
1076
  selectedAccountId: z.billingAccount?.id ?? null,
1072
1077
  onSelect: z.setBillingAccount,
1073
- isLoading: St,
1074
- disabled: Ft,
1075
- disabledMessage: Ft ? "Billing account is locked for plan changes" : void 0
1076
- }), E === "ADDON" && !T && z.billingAccount && /* @__PURE__ */ f(xe, {
1078
+ isLoading: Ct,
1079
+ disabled: It,
1080
+ disabledMessage: It ? "Billing account is locked for plan changes" : void 0
1081
+ }), k === "ADDON" && !O && z.billingAccount && /* @__PURE__ */ p(xe, {
1077
1082
  subscriptions: G,
1078
1083
  selectedSubscriptionId: z.selectedSubscriptionId,
1079
1084
  onSelect: z.setSelectedSubscriptionId,
1080
- isLoading: kt
1085
+ isLoading: At
1081
1086
  })]
1082
1087
  }),
1083
- /* @__PURE__ */ p("div", {
1088
+ /* @__PURE__ */ m("div", {
1084
1089
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 sm:p-6 space-y-4",
1085
1090
  children: [
1086
- /* @__PURE__ */ f(Ce, {
1091
+ /* @__PURE__ */ p(Ce, {
1087
1092
  savedPaymentMethods: Y,
1088
1093
  selectedPaymentMethodId: z.selectedPaymentMethodId,
1089
1094
  onSelectSavedCard: z.setSelectedPaymentMethodId,
1090
1095
  selectedProvider: z.selectedProvider,
1091
1096
  onSelectProvider: z.setPaymentProvider,
1092
- stripeEnabled: yt,
1097
+ stripeEnabled: bt,
1093
1098
  razorpayEnabled: B,
1094
1099
  canPayWithCredits: z.canPayWithCredits && z.hasEnoughCredits,
1095
1100
  availableCredits: z.availableCredits,
@@ -1097,35 +1102,35 @@ var Ye = () => {
1097
1102
  billingCountry: Z,
1098
1103
  saveCard: z.saveCard,
1099
1104
  onSaveCardChange: z.setSaveCard,
1100
- autoRenewEnabled: E === "PLAN" && z.autoRenew,
1101
- isLoading: Dt
1105
+ autoRenewEnabled: k === "PLAN" && z.autoRenew,
1106
+ isLoading: Ot
1102
1107
  }),
1103
- z.selectedProvider !== "CREDITS" && z.selectedProvider !== "AUTO" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", { className: "border-t border-border-subtle" }), /* @__PURE__ */ f("div", {
1108
+ z.selectedProvider !== "CREDITS" && z.selectedProvider !== "AUTO" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "border-t border-border-subtle" }), /* @__PURE__ */ p("div", {
1104
1109
  className: "bg-bg-sunken p-4 rounded-button",
1105
- children: /* @__PURE__ */ p("div", {
1110
+ children: /* @__PURE__ */ m("div", {
1106
1111
  className: "flex items-start gap-3",
1107
- children: [/* @__PURE__ */ f("svg", {
1112
+ children: [/* @__PURE__ */ p("svg", {
1108
1113
  className: "size-5 text-text-secondary mt-0.5",
1109
1114
  fill: "none",
1110
1115
  stroke: "currentColor",
1111
1116
  viewBox: "0 0 24 24",
1112
- children: /* @__PURE__ */ f("path", {
1117
+ children: /* @__PURE__ */ p("path", {
1113
1118
  strokeLinecap: "round",
1114
1119
  strokeLinejoin: "round",
1115
1120
  strokeWidth: 2,
1116
1121
  d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1117
1122
  })
1118
- }), /* @__PURE__ */ p("div", {
1123
+ }), /* @__PURE__ */ m("div", {
1119
1124
  className: "flex-1 text-sm",
1120
- children: [/* @__PURE__ */ p("p", {
1125
+ children: [/* @__PURE__ */ m("p", {
1121
1126
  className: "font-medium text-text-primary mb-1",
1122
1127
  children: ["Currency: ", z.selectedCurrency]
1123
- }), /* @__PURE__ */ p("p", {
1128
+ }), /* @__PURE__ */ m("p", {
1124
1129
  className: "text-text-secondary text-xs",
1125
1130
  children: [
1126
1131
  "All prices are shown in",
1127
1132
  " ",
1128
- /* @__PURE__ */ f("strong", {
1133
+ /* @__PURE__ */ p("strong", {
1129
1134
  className: "text-text-primary",
1130
1135
  children: z.selectedCurrency
1131
1136
  }),
@@ -1137,14 +1142,14 @@ var Ye = () => {
1137
1142
  })]
1138
1143
  })
1139
1144
  })] }),
1140
- E === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT" && /* @__PURE__ */ f("div", {
1145
+ k === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT" && /* @__PURE__ */ p("div", {
1141
1146
  className: "border-t border-border-subtle pt-4",
1142
- children: /* @__PURE__ */ p("div", {
1147
+ children: /* @__PURE__ */ m("div", {
1143
1148
  className: "space-y-3",
1144
- children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
1149
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
1145
1150
  className: "text-sm font-medium text-text-primary",
1146
1151
  children: "Number of seats"
1147
- }), H.getPlan.minSeats && /* @__PURE__ */ p("p", {
1152
+ }), H.getPlan.minSeats && /* @__PURE__ */ m("p", {
1148
1153
  className: "text-xs text-text-secondary mt-0.5",
1149
1154
  children: [
1150
1155
  "Minimum ",
@@ -1153,17 +1158,17 @@ var Ye = () => {
1153
1158
  H.getPlan.minSeats === 1 ? "" : "s",
1154
1159
  " required"
1155
1160
  ]
1156
- })] }), /* @__PURE__ */ p("div", {
1161
+ })] }), /* @__PURE__ */ m("div", {
1157
1162
  className: "flex items-center gap-3",
1158
1163
  children: [
1159
- /* @__PURE__ */ f("button", {
1164
+ /* @__PURE__ */ p("button", {
1160
1165
  type: "button",
1161
1166
  onClick: () => R((e) => Math.max(H.getPlan?.minSeats ?? 1, e - 1)),
1162
1167
  disabled: L <= (H.getPlan.minSeats ?? 1),
1163
1168
  className: "size-9 rounded-button border border-border-subtle flex items-center justify-center hover:bg-action-ghost-bgHover disabled:opacity-40 disabled:cursor-not-allowed transition-colors text-text-primary",
1164
1169
  children: "−"
1165
1170
  }),
1166
- /* @__PURE__ */ f("input", {
1171
+ /* @__PURE__ */ p("input", {
1167
1172
  type: "number",
1168
1173
  value: L,
1169
1174
  min: H.getPlan.minSeats ?? 1,
@@ -1174,14 +1179,14 @@ var Ye = () => {
1174
1179
  },
1175
1180
  className: "w-20 h-9 text-center border border-border-subtle rounded-button bg-bg-surface text-text-primary text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
1176
1181
  }),
1177
- /* @__PURE__ */ f("button", {
1182
+ /* @__PURE__ */ p("button", {
1178
1183
  type: "button",
1179
1184
  onClick: () => R((e) => Math.min(H.getPlan?.maxSeats ?? 999, e + 1)),
1180
1185
  disabled: L >= (H.getPlan.maxSeats ?? 999),
1181
1186
  className: "size-9 rounded-button border border-border-subtle flex items-center justify-center hover:bg-action-ghost-bgHover disabled:opacity-40 disabled:cursor-not-allowed transition-colors text-text-primary",
1182
1187
  children: "+"
1183
1188
  }),
1184
- H.getPlan.pricePerSeat && /* @__PURE__ */ p("span", {
1189
+ H.getPlan.pricePerSeat && /* @__PURE__ */ m("span", {
1185
1190
  className: "text-sm text-text-secondary",
1186
1191
  children: [
1187
1192
  "×",
@@ -1207,17 +1212,17 @@ var Ye = () => {
1207
1212
  ]
1208
1213
  })
1209
1214
  ]
1210
- }), /* @__PURE__ */ f("div", {
1215
+ }), /* @__PURE__ */ p("div", {
1211
1216
  className: "lg:col-span-2 order-1 lg:order-2",
1212
- children: /* @__PURE__ */ p("div", {
1217
+ children: /* @__PURE__ */ m("div", {
1213
1218
  className: "lg:sticky lg:top-6 space-y-4",
1214
1219
  children: [
1215
- /* @__PURE__ */ p("div", {
1220
+ /* @__PURE__ */ m("div", {
1216
1221
  className: "rounded-lg border border-border-subtle bg-bg-surface",
1217
1222
  children: [
1218
- /* @__PURE__ */ f("div", {
1223
+ /* @__PURE__ */ p("div", {
1219
1224
  className: "p-4",
1220
- children: /* @__PURE__ */ f(ge, {
1225
+ children: /* @__PURE__ */ p(ge, {
1221
1226
  items: z.items,
1222
1227
  subtotal: z.subtotal,
1223
1228
  discountAmount: z.discountAmount,
@@ -1228,14 +1233,14 @@ var Ye = () => {
1228
1233
  currency: z.selectedCurrency,
1229
1234
  isCalculatingTax: z.isCalculatingTax,
1230
1235
  showInCredits: z.selectedProvider === "CREDITS",
1231
- onUpdateQuantity: E !== "PLAN" && E !== "ORDER" ? z.updateItemQuantity : void 0,
1236
+ onUpdateQuantity: k !== "PLAN" && k !== "ORDER" ? z.updateItemQuantity : void 0,
1232
1237
  onRemoveItem: z.removeItem,
1233
- isEditable: E !== "PLAN" && E !== "ORDER"
1238
+ isEditable: k !== "PLAN" && k !== "ORDER"
1234
1239
  })
1235
1240
  }),
1236
- /* @__PURE__ */ f("div", {
1241
+ /* @__PURE__ */ p("div", {
1237
1242
  className: "px-4 pb-4 border-t border-border-subtle pt-4",
1238
- children: /* @__PURE__ */ f(_e, {
1243
+ children: /* @__PURE__ */ p(_e, {
1239
1244
  value: z.promoCode,
1240
1245
  onChange: z.setPromoCode,
1241
1246
  onValidate: async () => await z.validatePromoCode(),
@@ -1246,15 +1251,15 @@ var Ye = () => {
1246
1251
  isValidating: z.isProcessing
1247
1252
  })
1248
1253
  }),
1249
- E === "PLAN" && z.selectedProvider !== "CREDITS" && z.selectedProvider !== "AUTO" && (() => {
1254
+ k === "PLAN" && z.selectedProvider !== "CREDITS" && z.selectedProvider !== "AUTO" && (() => {
1250
1255
  let e = "", t = !1, n = !1;
1251
1256
  if (z.selectedPaymentMethodId) {
1252
1257
  let r = Y.find((e) => e.id === z.selectedPaymentMethodId);
1253
1258
  r && (e = `${r.type === "CREDIT_CARD" || r.type === "DEBIT_CARD" ? "Card" : r.type}${r.last4 ? ` •••• ${r.last4}` : ""}`, t = !0, n = !1);
1254
1259
  } else (z.selectedProvider === "RAZORPAY" || z.selectedProvider === "STRIPE") && (e = z.selectedProvider === "RAZORPAY" ? "new card (Razorpay)" : "new card (Stripe)", t = !0, n = !0);
1255
- return /* @__PURE__ */ f("div", {
1260
+ return /* @__PURE__ */ p("div", {
1256
1261
  className: "px-4 pb-4",
1257
- children: /* @__PURE__ */ f(Se, {
1262
+ children: /* @__PURE__ */ p(Se, {
1258
1263
  enabled: z.autoRenew,
1259
1264
  onToggle: (e) => {
1260
1265
  z.setAutoRenew(e), e && z.selectedPaymentMethodId && z.setAutoRenewPaymentMethodId(z.selectedPaymentMethodId);
@@ -1267,14 +1272,14 @@ var Ye = () => {
1267
1272
  })()
1268
1273
  ]
1269
1274
  }),
1270
- /* @__PURE__ */ f("button", {
1275
+ /* @__PURE__ */ p("button", {
1271
1276
  type: "button",
1272
- onClick: Lt,
1273
- disabled: z.isProcessing || !z.billingAccount || z.items.length === 0 || E === "ADDON" && !T && kt || E === "ADDON" && !T && G.length === 0 || E === "ADDON" && !T && !z.selectedSubscriptionId,
1277
+ onClick: Rt,
1278
+ disabled: z.isProcessing || !z.billingAccount || z.items.length === 0 || k === "ADDON" && !O && At || k === "ADDON" && !O && G.length === 0 || k === "ADDON" && !O && !z.selectedSubscriptionId,
1274
1279
  className: "w-full px-6 py-4 rounded-lg bg-action-primary-bg text-action-primary-text font-semibold\n hover:bg-action-primary-bgHover disabled:opacity-50 disabled:cursor-not-allowed\n transition-colors flex items-center justify-center gap-2",
1275
- children: z.isProcessing ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(Le, { className: "size-5 animate-spin" }), "Processing…"] }) : z.selectedProvider === "CREDITS" ? "Pay with Credits" : "Proceed to Payment"
1280
+ children: z.isProcessing ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, { className: "size-5 animate-spin" }), "Processing…"] }) : z.selectedProvider === "CREDITS" ? "Pay with Credits" : "Proceed to Payment"
1276
1281
  }),
1277
- /* @__PURE__ */ f("p", {
1282
+ /* @__PURE__ */ p("p", {
1278
1283
  className: "text-center text-xs text-text-secondary",
1279
1284
  children: "🔒 Secure checkout with 256-bit SSL encryption"
1280
1285
  })
@@ -1282,17 +1287,17 @@ var Ye = () => {
1282
1287
  })
1283
1288
  })]
1284
1289
  }),
1285
- ct && z.billingAccount && /* @__PURE__ */ f(we, {
1290
+ ot && z.billingAccount && /* @__PURE__ */ p(we, {
1286
1291
  billingAccountId: z.billingAccount.id,
1287
1292
  hasPhone: !!z.billingAccount.contactNumber?.trim(),
1288
1293
  hasAddress: !!(z.billingAccount.billingAddresses?.[0]?.line1?.trim() && z.billingAccount.billingAddresses?.[0]?.postalCode?.trim()),
1289
1294
  onCompleted: () => {
1290
- O.current = !0, lt(!1), Lt(), Ct().then((e) => {
1295
+ ct.current = !0, st(!1), Rt(), wt().then((e) => {
1291
1296
  let t = (e.data?.getBillingAccountsByOrg ?? []).find((e) => e.id === z.billingAccount?.id);
1292
1297
  t && z.setBillingAccount(t);
1293
1298
  });
1294
1299
  },
1295
- onCancel: () => lt(!1)
1300
+ onCancel: () => st(!1)
1296
1301
  })
1297
1302
  ]
1298
1303
  });