@burdenoff/microfe-billing 2026.901.1 → 2026.901.2

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