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