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