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