@burdenoff/microfe-billing 2026.623.3 → 2026.624.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.
- package/dist/billing/BillingUserRoutes.js +3 -3
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +34 -34
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +94 -94
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +162 -187
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +146 -153
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +10 -10
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +62 -62
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +164 -179
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +8 -8
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +243 -305
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +73 -78
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +173 -179
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +4 -4
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +4 -4
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +181 -173
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +111 -99
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +68 -83
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
- package/dist/billing/shared/components/AccessDenied.js +4 -4
- package/dist/billing/shared/components/AccessDenied.js.map +1 -1
- package/dist/billing/shared/components/ActorIdentity.js +8 -8
- package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +11 -11
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.js +1 -1
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,41 +10,41 @@ import { ArchiveBillingAccountSettingsDocument as re, useGetBillingAccountSettin
|
|
|
10
10
|
import { useCallback as r, useEffect as le, useMemo as i, useState as a } from "react";
|
|
11
11
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
12
12
|
import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
|
-
import {
|
|
13
|
+
import { AlertDialog as u, AlertDialogAction as ue, AlertDialogCancel as de, AlertDialogContent as fe, AlertDialogDescription as pe, AlertDialogFooter as me, AlertDialogHeader as he, AlertDialogTitle as ge, OptionalFields as _e } from "@burdenoff/fe-libs/ui";
|
|
14
14
|
//#region src/billing/modules/settings/pages/SettingsPage.tsx
|
|
15
|
-
var
|
|
15
|
+
var ve = () => {
|
|
16
16
|
if (!(typeof window > "u")) return new URLSearchParams(window.location.search).get("billingAccountId") || void 0;
|
|
17
|
-
},
|
|
18
|
-
let { t:
|
|
19
|
-
let n =
|
|
17
|
+
}, d = () => {
|
|
18
|
+
let { t: d } = l(), f = (e, t) => {
|
|
19
|
+
let n = d(e);
|
|
20
20
|
return n === e ? t : n;
|
|
21
|
-
},
|
|
21
|
+
}, p = ne(), { apiGatewayUrl: m, authToken: h, orgId: g } = e(), { emit: _ } = ee(), [v, y] = a(ve), [b, x] = a(!1), [S, C] = a(!1), [w, T] = a(!1), [ye, E] = a(!1), [D, O] = a(null), [be, k] = a(!1), [A, j] = a(!1), [M, N] = a(!1), [P, F] = a({
|
|
22
22
|
name: "",
|
|
23
23
|
email: "",
|
|
24
24
|
billingEmail: "",
|
|
25
25
|
currency: "USD",
|
|
26
26
|
taxId: "",
|
|
27
27
|
isDefault: !1
|
|
28
|
-
}), { data:
|
|
29
|
-
variables: { id:
|
|
30
|
-
skip: !
|
|
31
|
-
}), W =
|
|
32
|
-
if (
|
|
28
|
+
}), { data: I, loading: xe, refetch: L } = ae({}), R = i(() => I?.getBillingAccountsByOrg || [], [I?.getBillingAccountsByOrg]), { data: Se, loading: Ce, refetch: z } = oe({}), B = Se?.getDefaultBillingAccount || null, { data: V, loading: H, refetch: U } = ie({
|
|
29
|
+
variables: { id: v },
|
|
30
|
+
skip: !v
|
|
31
|
+
}), W = V?.getBillingAccount || null, [G] = ce(), [K] = se(), q = i(() => {
|
|
32
|
+
if (v) {
|
|
33
33
|
if (W) return W;
|
|
34
|
-
let e =
|
|
34
|
+
let e = R.find((e) => e.id === v);
|
|
35
35
|
if (e) return e;
|
|
36
36
|
if (H) return null;
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return B;
|
|
39
39
|
}, [
|
|
40
|
-
|
|
40
|
+
v,
|
|
41
41
|
W,
|
|
42
|
-
|
|
42
|
+
R,
|
|
43
43
|
H,
|
|
44
|
-
|
|
45
|
-
]),
|
|
44
|
+
B
|
|
45
|
+
]), we = xe || Ce || v && H;
|
|
46
46
|
le(() => {
|
|
47
|
-
q &&
|
|
47
|
+
q && F({
|
|
48
48
|
name: q.name || "",
|
|
49
49
|
email: q.email || "",
|
|
50
50
|
billingEmail: q.billingEmail || "",
|
|
@@ -53,122 +53,120 @@ var d = () => {
|
|
|
53
53
|
isDefault: q.isDefault || !1
|
|
54
54
|
});
|
|
55
55
|
}, [q]);
|
|
56
|
-
let
|
|
57
|
-
|
|
56
|
+
let Te = (e) => {
|
|
57
|
+
y(e.id), x(!1), k(!1), O(null);
|
|
58
58
|
}, J = (e, t) => {
|
|
59
|
-
|
|
59
|
+
F((n) => ({
|
|
60
60
|
...n,
|
|
61
61
|
[e]: t
|
|
62
62
|
})), k(!1), O(null);
|
|
63
|
-
}, Y = i(() =>
|
|
63
|
+
}, Y = i(() => R.find((e) => e.isDefault) || null, [R]), Ee = i(() => q ? P.name !== (q.name || "") || P.email !== (q.email || "") || P.billingEmail !== (q.billingEmail || "") || P.currency !== (q.currency || "USD") || P.taxId !== (q.taxId || "") || P.isDefault !== (q.isDefault || !1) : !1, [P, q]), X = P.isDefault && !q?.isDefault, Z = X && Y && Y.id !== q?.id, Q = r(async () => {
|
|
64
64
|
if (q?.id) {
|
|
65
|
-
|
|
65
|
+
C(!0), O(null), k(!1), j(!1), N(!1);
|
|
66
66
|
try {
|
|
67
67
|
await G({ variables: { input: {
|
|
68
68
|
id: q.id,
|
|
69
|
-
name:
|
|
70
|
-
email:
|
|
71
|
-
billingEmail:
|
|
72
|
-
currency:
|
|
73
|
-
taxId:
|
|
74
|
-
} } }),
|
|
69
|
+
name: P.name,
|
|
70
|
+
email: P.email,
|
|
71
|
+
billingEmail: P.billingEmail || null,
|
|
72
|
+
currency: P.currency,
|
|
73
|
+
taxId: P.taxId || null
|
|
74
|
+
} } }), _("billing.billing_account.updated", {
|
|
75
75
|
route: "/billing/settings",
|
|
76
76
|
entityId: q.id,
|
|
77
77
|
source: "settings"
|
|
78
78
|
}), X && (await K({
|
|
79
79
|
variables: { id: q.id },
|
|
80
80
|
refetchQueries: ["GetBillingAccountsByTenant", "GetDefaultBillingAccount"]
|
|
81
|
-
}),
|
|
81
|
+
}), _("billing.billing_account.updated", {
|
|
82
82
|
route: "/billing/settings",
|
|
83
83
|
entityId: q.id,
|
|
84
84
|
source: "settings.default"
|
|
85
|
-
})),
|
|
85
|
+
})), v ? await U() : await z(), k(!0), setTimeout(() => k(!1), 3e3);
|
|
86
86
|
} catch (e) {
|
|
87
87
|
O(e instanceof Error ? e.message : "Failed to save changes");
|
|
88
88
|
} finally {
|
|
89
|
-
|
|
89
|
+
C(!1);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}, [
|
|
93
93
|
q?.id,
|
|
94
|
-
|
|
94
|
+
P,
|
|
95
95
|
X,
|
|
96
96
|
G,
|
|
97
97
|
K,
|
|
98
|
-
|
|
98
|
+
v,
|
|
99
99
|
U,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
]),
|
|
103
|
-
q?.id && (Z ? (
|
|
100
|
+
z,
|
|
101
|
+
_
|
|
102
|
+
]), De = r(() => {
|
|
103
|
+
q?.id && (Z ? (N(!0), j(!0)) : Q());
|
|
104
104
|
}, [
|
|
105
105
|
q?.id,
|
|
106
106
|
Z,
|
|
107
107
|
Q
|
|
108
|
-
]),
|
|
109
|
-
if (!q?.id || !q.isActive)
|
|
110
|
-
|
|
111
|
-
if (window.confirm(q.isDefault ? `Archive ${q.name}? ${e ? `${e.name} will become the default account.` : "No replacement default account is available."}` : `Archive ${q.name}?`)) {
|
|
112
|
-
E(!0), O(null), k(!1);
|
|
108
|
+
]), $ = i(() => q ? R.find((e) => e.id !== q.id && e.isActive) : void 0, [q, R]), Oe = q ? q.isDefault ? `Archive ${q.name}? ${$ ? `${$.name} will become the default account.` : "No replacement default account is available."}` : `Archive ${q.name}?` : "", ke = r(async () => {
|
|
109
|
+
if (!(!q?.id || !q.isActive)) {
|
|
110
|
+
T(!0), O(null), k(!1);
|
|
113
111
|
try {
|
|
114
112
|
await te({
|
|
115
|
-
apiGatewayUrl:
|
|
116
|
-
authToken:
|
|
117
|
-
orgId:
|
|
113
|
+
apiGatewayUrl: m,
|
|
114
|
+
authToken: h,
|
|
115
|
+
orgId: g,
|
|
118
116
|
query: re,
|
|
119
117
|
variables: {
|
|
120
118
|
id: q.id,
|
|
121
119
|
reason: "Archived from billing settings",
|
|
122
|
-
replacementDefaultBillingAccountId: q.isDefault ?
|
|
120
|
+
replacementDefaultBillingAccountId: q.isDefault ? $?.id ?? null : null
|
|
123
121
|
}
|
|
124
|
-
}),
|
|
122
|
+
}), _("billing.billing_account.archived", {
|
|
125
123
|
route: "/billing/settings",
|
|
126
124
|
entityId: q.id,
|
|
127
125
|
source: "settings"
|
|
128
|
-
}), await Promise.all([
|
|
126
|
+
}), await Promise.all([L(), z()]), y($?.id), k(!0), setTimeout(() => k(!1), 3e3);
|
|
129
127
|
} catch (e) {
|
|
130
128
|
O(e instanceof Error ? e.message : "Failed to archive billing account");
|
|
131
129
|
} finally {
|
|
132
|
-
|
|
130
|
+
T(!1);
|
|
133
131
|
}
|
|
134
132
|
}
|
|
135
133
|
}, [
|
|
134
|
+
m,
|
|
136
135
|
h,
|
|
137
|
-
g,
|
|
138
136
|
q,
|
|
137
|
+
$,
|
|
138
|
+
g,
|
|
139
139
|
L,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
B,
|
|
143
|
-
v
|
|
140
|
+
z,
|
|
141
|
+
_
|
|
144
142
|
]);
|
|
145
|
-
return
|
|
143
|
+
return p.canManageBillingAccount ? we && !q ? /* @__PURE__ */ c("div", {
|
|
146
144
|
className: "space-y-6 p-6",
|
|
147
|
-
children: [/* @__PURE__ */ s("div", { className: "h-8 w-48 bg-
|
|
148
|
-
className: "border border-border rounded-lg p-6 space-y-4",
|
|
145
|
+
children: [/* @__PURE__ */ s("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ s("div", {
|
|
146
|
+
className: "border border-border-subtle rounded-lg p-6 space-y-4",
|
|
149
147
|
children: [
|
|
150
148
|
1,
|
|
151
149
|
2,
|
|
152
150
|
3
|
|
153
|
-
].map((e) => /* @__PURE__ */ s("div", { className: "h-10 bg-
|
|
151
|
+
].map((e) => /* @__PURE__ */ s("div", { className: "h-10 bg-bg-sunken animate-pulse rounded" }, e))
|
|
154
152
|
})]
|
|
155
153
|
}) : /* @__PURE__ */ c("div", {
|
|
156
154
|
className: "space-y-6 p-6",
|
|
157
155
|
children: [
|
|
158
156
|
/* @__PURE__ */ s(n, {
|
|
159
|
-
title:
|
|
160
|
-
description:
|
|
157
|
+
title: f("billing.settings.billingSettings", "Billing Settings"),
|
|
158
|
+
description: f("billing.settings.description", "Manage your billing account configuration")
|
|
161
159
|
}),
|
|
162
|
-
|
|
160
|
+
R.length > 1 && /* @__PURE__ */ c("div", {
|
|
163
161
|
className: "relative",
|
|
164
162
|
children: [/* @__PURE__ */ c("button", {
|
|
165
163
|
type: "button",
|
|
166
|
-
onClick: () =>
|
|
167
|
-
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border rounded-lg bg-
|
|
164
|
+
onClick: () => x(!b),
|
|
165
|
+
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-subtle rounded-lg bg-bg-surface hover:bg-bg-sunken/50 transition-colors",
|
|
168
166
|
children: [/* @__PURE__ */ c("div", {
|
|
169
167
|
className: "flex items-center gap-3",
|
|
170
168
|
children: [/* @__PURE__ */ s("div", {
|
|
171
|
-
className: "size-8 rounded-lg bg-primary/10 flex items-center justify-center",
|
|
169
|
+
className: "size-8 rounded-lg bg-action-primary-bg/10 flex items-center justify-center",
|
|
172
170
|
children: /* @__PURE__ */ s("svg", {
|
|
173
171
|
className: "size-4 text-primary",
|
|
174
172
|
fill: "none",
|
|
@@ -184,15 +182,15 @@ var d = () => {
|
|
|
184
182
|
}), /* @__PURE__ */ c("div", {
|
|
185
183
|
className: "text-left",
|
|
186
184
|
children: [/* @__PURE__ */ s("p", {
|
|
187
|
-
className: "text-sm font-medium text-
|
|
188
|
-
children: q?.name ||
|
|
185
|
+
className: "text-sm font-medium text-text-primary",
|
|
186
|
+
children: q?.name || f("billing.settings.selectAccount", "Select Account")
|
|
189
187
|
}), /* @__PURE__ */ s("p", {
|
|
190
|
-
className: "text-xs text-
|
|
188
|
+
className: "text-xs text-text-secondary",
|
|
191
189
|
children: q?.email
|
|
192
190
|
})]
|
|
193
191
|
})]
|
|
194
192
|
}), /* @__PURE__ */ s("svg", {
|
|
195
|
-
className: `size-4 text-
|
|
193
|
+
className: `size-4 text-text-secondary transition-transform ${b ? "rotate-180" : ""}`,
|
|
196
194
|
fill: "none",
|
|
197
195
|
viewBox: "0 0 24 24",
|
|
198
196
|
stroke: "currentColor",
|
|
@@ -203,21 +201,21 @@ var d = () => {
|
|
|
203
201
|
d: "M19 9l-7 7-7-7"
|
|
204
202
|
})
|
|
205
203
|
})]
|
|
206
|
-
}),
|
|
204
|
+
}), b && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
|
|
207
205
|
className: "fixed inset-0 z-10",
|
|
208
|
-
onClick: () =>
|
|
206
|
+
onClick: () => x(!1)
|
|
209
207
|
}), /* @__PURE__ */ s("div", {
|
|
210
|
-
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-popover border border-border rounded-lg shadow-lg z-20 py-1 max-h-60 overflow-y-auto",
|
|
211
|
-
children:
|
|
208
|
+
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-popover border border-border-subtle rounded-lg shadow-lg z-20 py-1 max-h-60 overflow-y-auto",
|
|
209
|
+
children: R.map((e) => /* @__PURE__ */ c("button", {
|
|
212
210
|
type: "button",
|
|
213
|
-
onClick: () =>
|
|
214
|
-
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-
|
|
211
|
+
onClick: () => Te(e),
|
|
212
|
+
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
215
213
|
children: [/* @__PURE__ */ c("div", {
|
|
216
214
|
className: "flex items-center gap-3 min-w-0",
|
|
217
215
|
children: [/* @__PURE__ */ s("div", {
|
|
218
|
-
className: "size-8 rounded-lg bg-
|
|
216
|
+
className: "size-8 rounded-lg bg-bg-sunken flex items-center justify-center flex-shrink-0",
|
|
219
217
|
children: /* @__PURE__ */ s("svg", {
|
|
220
|
-
className: "size-4 text-
|
|
218
|
+
className: "size-4 text-text-secondary",
|
|
221
219
|
fill: "none",
|
|
222
220
|
viewBox: "0 0 24 24",
|
|
223
221
|
stroke: "currentColor",
|
|
@@ -231,10 +229,10 @@ var d = () => {
|
|
|
231
229
|
}), /* @__PURE__ */ c("div", {
|
|
232
230
|
className: "text-left min-w-0",
|
|
233
231
|
children: [/* @__PURE__ */ s("p", {
|
|
234
|
-
className: "text-sm font-medium text-
|
|
232
|
+
className: "text-sm font-medium text-text-primary truncate",
|
|
235
233
|
children: e.name
|
|
236
234
|
}), /* @__PURE__ */ s("p", {
|
|
237
|
-
className: "text-xs text-
|
|
235
|
+
className: "text-xs text-text-secondary truncate",
|
|
238
236
|
children: e.email
|
|
239
237
|
})]
|
|
240
238
|
})]
|
|
@@ -254,19 +252,19 @@ var d = () => {
|
|
|
254
252
|
})] })]
|
|
255
253
|
}),
|
|
256
254
|
/* @__PURE__ */ c("div", {
|
|
257
|
-
className: "border border-border rounded-lg bg-
|
|
255
|
+
className: "border border-border-subtle rounded-lg bg-bg-surface",
|
|
258
256
|
children: [/* @__PURE__ */ s("div", {
|
|
259
|
-
className: "p-6 border-b border-border",
|
|
257
|
+
className: "p-6 border-b border-border-subtle",
|
|
260
258
|
children: /* @__PURE__ */ c("div", {
|
|
261
259
|
className: "flex items-center justify-between",
|
|
262
260
|
children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h2", {
|
|
263
|
-
className: "text-lg font-semibold text-
|
|
264
|
-
children:
|
|
261
|
+
className: "text-lg font-semibold text-text-primary",
|
|
262
|
+
children: f("billing.settings.accountInfo", "Account Information")
|
|
265
263
|
}), /* @__PURE__ */ s("p", {
|
|
266
|
-
className: "text-sm text-
|
|
267
|
-
children:
|
|
264
|
+
className: "text-sm text-text-secondary mt-1",
|
|
265
|
+
children: f("billing.settings.accountInfoDescription", "Update your billing contact details and tax information")
|
|
268
266
|
})] }), q?.isDefault && /* @__PURE__ */ c("span", {
|
|
269
|
-
className: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium bg-primary/10 text-primary rounded-full",
|
|
267
|
+
className: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium bg-action-primary-bg/10 text-primary rounded-full",
|
|
270
268
|
children: [/* @__PURE__ */ s("svg", {
|
|
271
269
|
className: "size-3",
|
|
272
270
|
fill: "currentColor",
|
|
@@ -276,121 +274,121 @@ var d = () => {
|
|
|
276
274
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
|
277
275
|
clipRule: "evenodd"
|
|
278
276
|
})
|
|
279
|
-
}),
|
|
277
|
+
}), f("billing.settings.defaultAccount", "Default Account")]
|
|
280
278
|
})]
|
|
281
279
|
})
|
|
282
280
|
}), /* @__PURE__ */ c("div", {
|
|
283
281
|
className: "p-6 space-y-6",
|
|
284
282
|
children: [
|
|
285
283
|
q && /* @__PURE__ */ c("div", {
|
|
286
|
-
className: "grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm pb-4 border-b border-border",
|
|
284
|
+
className: "grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm pb-4 border-b border-border-subtle",
|
|
287
285
|
children: [
|
|
288
286
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
289
|
-
className: "text-
|
|
290
|
-
children:
|
|
287
|
+
className: "text-text-secondary",
|
|
288
|
+
children: f("billing.settings.status", "Status")
|
|
291
289
|
}), /* @__PURE__ */ s("p", {
|
|
292
|
-
className: `font-medium ${q.isActive ? "text-status-success-text" : "text-
|
|
293
|
-
children: q.isActive ?
|
|
290
|
+
className: `font-medium ${q.isActive ? "text-status-success-text" : "text-status-error-text"}`,
|
|
291
|
+
children: q.isActive ? f("billing.settings.active", "Active") : f("billing.settings.inactive", "Inactive")
|
|
294
292
|
})] }),
|
|
295
293
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
296
|
-
className: "text-
|
|
297
|
-
children:
|
|
294
|
+
className: "text-text-secondary",
|
|
295
|
+
children: f("billing.settings.creditBalance", "Credit Balance")
|
|
298
296
|
}), /* @__PURE__ */ c("p", {
|
|
299
|
-
className: "font-medium text-
|
|
297
|
+
className: "font-medium text-text-primary",
|
|
300
298
|
children: [(q.creditAmount || 0).toLocaleString(), " Credits"]
|
|
301
299
|
})] }),
|
|
302
300
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
303
|
-
className: "text-
|
|
304
|
-
children:
|
|
301
|
+
className: "text-text-secondary",
|
|
302
|
+
children: f("billing.settings.accountId", "Account ID")
|
|
305
303
|
}), /* @__PURE__ */ s("p", {
|
|
306
|
-
className: "font-mono text-xs text-
|
|
304
|
+
className: "font-mono text-xs text-text-primary truncate",
|
|
307
305
|
title: q.id,
|
|
308
306
|
children: q.id
|
|
309
307
|
})] }),
|
|
310
308
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
311
|
-
className: "text-
|
|
312
|
-
children:
|
|
309
|
+
className: "text-text-secondary",
|
|
310
|
+
children: f("billing.settings.created", "Created")
|
|
313
311
|
}), /* @__PURE__ */ s("p", {
|
|
314
|
-
className: "font-medium text-
|
|
315
|
-
children: q.createdAt ? new Date(q.createdAt).toLocaleDateString() :
|
|
312
|
+
className: "font-medium text-text-primary",
|
|
313
|
+
children: q.createdAt ? new Date(q.createdAt).toLocaleDateString() : f("billing.settings.notAvailable", "N/A")
|
|
316
314
|
})] })
|
|
317
315
|
]
|
|
318
316
|
}),
|
|
319
317
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h3", {
|
|
320
|
-
className: "text-sm font-medium text-
|
|
321
|
-
children:
|
|
318
|
+
className: "text-sm font-medium text-text-primary mb-4",
|
|
319
|
+
children: f("billing.settings.contactDetails", "Contact Details")
|
|
322
320
|
}), /* @__PURE__ */ c("div", {
|
|
323
321
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
324
322
|
children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("label", {
|
|
325
323
|
htmlFor: "billing-account-name",
|
|
326
|
-
className: "block text-sm font-medium text-
|
|
324
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
327
325
|
children: [
|
|
328
|
-
|
|
326
|
+
f("billing.settings.accountName", "Account Name"),
|
|
329
327
|
" ",
|
|
330
328
|
/* @__PURE__ */ s("span", {
|
|
331
|
-
className: "text-
|
|
329
|
+
className: "text-status-error-text",
|
|
332
330
|
children: "*"
|
|
333
331
|
})
|
|
334
332
|
]
|
|
335
333
|
}), /* @__PURE__ */ s("input", {
|
|
336
334
|
id: "billing-account-name",
|
|
337
335
|
type: "text",
|
|
338
|
-
value:
|
|
336
|
+
value: P.name,
|
|
339
337
|
onChange: (e) => J("name", e.target.value),
|
|
340
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
338
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
341
339
|
})] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("label", {
|
|
342
340
|
htmlFor: "billing-account-email",
|
|
343
|
-
className: "block text-sm font-medium text-
|
|
341
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
344
342
|
children: [
|
|
345
|
-
|
|
343
|
+
f("billing.settings.email", "Email"),
|
|
346
344
|
" ",
|
|
347
345
|
/* @__PURE__ */ s("span", {
|
|
348
|
-
className: "text-
|
|
346
|
+
className: "text-status-error-text",
|
|
349
347
|
children: "*"
|
|
350
348
|
})
|
|
351
349
|
]
|
|
352
350
|
}), /* @__PURE__ */ s("input", {
|
|
353
351
|
id: "billing-account-email",
|
|
354
352
|
type: "email",
|
|
355
|
-
value:
|
|
353
|
+
value: P.email,
|
|
356
354
|
onChange: (e) => J("email", e.target.value),
|
|
357
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
355
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
358
356
|
})] })]
|
|
359
357
|
})] }),
|
|
360
|
-
/* @__PURE__ */ s(
|
|
361
|
-
title:
|
|
362
|
-
description:
|
|
358
|
+
/* @__PURE__ */ s(_e, {
|
|
359
|
+
title: f("billing.settings.advancedTitle", "Advanced settings"),
|
|
360
|
+
description: f("billing.settings.advancedDescription", "Billing email override, currency, and tax identification."),
|
|
363
361
|
children: /* @__PURE__ */ c("div", {
|
|
364
362
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
365
363
|
children: [
|
|
366
364
|
/* @__PURE__ */ c("div", { children: [
|
|
367
365
|
/* @__PURE__ */ s("label", {
|
|
368
366
|
htmlFor: "billing-account-billing-email",
|
|
369
|
-
className: "block text-sm font-medium text-
|
|
370
|
-
children:
|
|
367
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
368
|
+
children: f("billing.settings.billingEmail", "Billing Email")
|
|
371
369
|
}),
|
|
372
370
|
/* @__PURE__ */ s("input", {
|
|
373
371
|
id: "billing-account-billing-email",
|
|
374
372
|
type: "email",
|
|
375
|
-
value:
|
|
373
|
+
value: P.billingEmail,
|
|
376
374
|
onChange: (e) => J("billingEmail", e.target.value),
|
|
377
|
-
placeholder:
|
|
378
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
375
|
+
placeholder: f("billing.settings.billingEmailPlaceholder", "Optional - defaults to account email"),
|
|
376
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
379
377
|
}),
|
|
380
378
|
/* @__PURE__ */ s("p", {
|
|
381
|
-
className: "text-xs text-
|
|
382
|
-
children:
|
|
379
|
+
className: "text-xs text-text-secondary mt-1",
|
|
380
|
+
children: f("billing.settings.billingEmailHelp", "Invoices will be sent to this email if provided")
|
|
383
381
|
})
|
|
384
382
|
] }),
|
|
385
383
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
|
|
386
384
|
htmlFor: "billing-account-currency",
|
|
387
|
-
className: "block text-sm font-medium text-
|
|
388
|
-
children:
|
|
385
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
386
|
+
children: f("billing.settings.currency", "Currency")
|
|
389
387
|
}), /* @__PURE__ */ c("select", {
|
|
390
388
|
id: "billing-account-currency",
|
|
391
|
-
value:
|
|
389
|
+
value: P.currency,
|
|
392
390
|
onChange: (e) => J("currency", e.target.value),
|
|
393
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
391
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",
|
|
394
392
|
children: [
|
|
395
393
|
/* @__PURE__ */ s("option", {
|
|
396
394
|
value: "USD",
|
|
@@ -415,28 +413,28 @@ var d = () => {
|
|
|
415
413
|
children: [
|
|
416
414
|
/* @__PURE__ */ s("label", {
|
|
417
415
|
htmlFor: "billing-account-tax-id",
|
|
418
|
-
className: "block text-sm font-medium text-
|
|
419
|
-
children:
|
|
416
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
417
|
+
children: f("billing.settings.taxId", "Tax ID / VAT Number")
|
|
420
418
|
}),
|
|
421
419
|
/* @__PURE__ */ s("input", {
|
|
422
420
|
id: "billing-account-tax-id",
|
|
423
421
|
type: "text",
|
|
424
|
-
value:
|
|
422
|
+
value: P.taxId,
|
|
425
423
|
onChange: (e) => J("taxId", e.target.value),
|
|
426
|
-
placeholder:
|
|
427
|
-
className: "w-full px-3 py-2 text-sm border border-border rounded-md bg-
|
|
424
|
+
placeholder: f("billing.settings.taxIdPlaceholder", "Enter your tax identification number"),
|
|
425
|
+
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
428
426
|
}),
|
|
429
427
|
/* @__PURE__ */ s("p", {
|
|
430
|
-
className: "text-xs text-
|
|
431
|
-
children:
|
|
428
|
+
className: "text-xs text-text-secondary mt-1",
|
|
429
|
+
children: f("billing.settings.taxIdHelp", "Used for invoices and tax compliance (e.g., GST, VAT number)")
|
|
432
430
|
})
|
|
433
431
|
]
|
|
434
432
|
})
|
|
435
433
|
]
|
|
436
434
|
})
|
|
437
435
|
}),
|
|
438
|
-
q?.isActive &&
|
|
439
|
-
className: "pt-4 border-t border-border",
|
|
436
|
+
q?.isActive && R.length > 1 && /* @__PURE__ */ s("div", {
|
|
437
|
+
className: "pt-4 border-t border-border-subtle",
|
|
440
438
|
children: /* @__PURE__ */ c("div", {
|
|
441
439
|
className: "flex items-start gap-3",
|
|
442
440
|
children: [/* @__PURE__ */ s("div", {
|
|
@@ -444,32 +442,32 @@ var d = () => {
|
|
|
444
442
|
children: /* @__PURE__ */ s("input", {
|
|
445
443
|
type: "checkbox",
|
|
446
444
|
id: "isDefault",
|
|
447
|
-
checked:
|
|
448
|
-
onChange: (e) =>
|
|
445
|
+
checked: P.isDefault,
|
|
446
|
+
onChange: (e) => F((t) => ({
|
|
449
447
|
...t,
|
|
450
448
|
isDefault: e.target.checked
|
|
451
449
|
})),
|
|
452
450
|
disabled: q?.isDefault,
|
|
453
|
-
className: "size-4 rounded border-border text-primary focus:ring-primary focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
451
|
+
className: "size-4 rounded border-border-subtle text-primary focus:ring-primary focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
454
452
|
})
|
|
455
453
|
}), /* @__PURE__ */ c("div", {
|
|
456
454
|
className: "flex-1",
|
|
457
455
|
children: [/* @__PURE__ */ s("label", {
|
|
458
456
|
htmlFor: "isDefault",
|
|
459
|
-
className: "text-sm font-medium text-
|
|
460
|
-
children:
|
|
457
|
+
className: "text-sm font-medium text-text-primary cursor-pointer",
|
|
458
|
+
children: f("billing.settings.setDefault", "Set as default billing account")
|
|
461
459
|
}), /* @__PURE__ */ s("p", {
|
|
462
|
-
className: "text-xs text-
|
|
463
|
-
children: q?.isDefault ?
|
|
460
|
+
className: "text-xs text-text-secondary mt-0.5",
|
|
461
|
+
children: q?.isDefault ? f("billing.settings.currentDefaultDescription", "This is currently your default billing account") : f("billing.settings.makePrimaryDescription", "Make this your primary billing account for new subscriptions")
|
|
464
462
|
})]
|
|
465
463
|
})]
|
|
466
464
|
})
|
|
467
465
|
}),
|
|
468
466
|
/* @__PURE__ */ c("div", {
|
|
469
|
-
className: "pt-4 border-t border-border flex items-center justify-between",
|
|
467
|
+
className: "pt-4 border-t border-border-subtle flex items-center justify-between",
|
|
470
468
|
children: [/* @__PURE__ */ c("div", {
|
|
471
469
|
className: "flex items-center gap-2",
|
|
472
|
-
children: [
|
|
470
|
+
children: [be && /* @__PURE__ */ c("div", {
|
|
473
471
|
className: "flex items-center gap-2 text-sm text-status-success-text",
|
|
474
472
|
children: [/* @__PURE__ */ s("svg", {
|
|
475
473
|
className: "size-4",
|
|
@@ -482,9 +480,9 @@ var d = () => {
|
|
|
482
480
|
strokeWidth: 2,
|
|
483
481
|
d: "M5 13l4 4L19 7"
|
|
484
482
|
})
|
|
485
|
-
}),
|
|
483
|
+
}), f("billing.settings.saveSuccess", "Changes saved successfully")]
|
|
486
484
|
}), D && /* @__PURE__ */ c("div", {
|
|
487
|
-
className: "flex items-center gap-2 text-sm text-
|
|
485
|
+
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
488
486
|
children: [/* @__PURE__ */ s("svg", {
|
|
489
487
|
className: "size-4",
|
|
490
488
|
fill: "none",
|
|
@@ -500,18 +498,18 @@ var d = () => {
|
|
|
500
498
|
})]
|
|
501
499
|
}), /* @__PURE__ */ c("div", {
|
|
502
500
|
className: "flex items-center gap-3",
|
|
503
|
-
children: [
|
|
501
|
+
children: [p.canArchiveBillingAccount && q?.isActive ? /* @__PURE__ */ s("button", {
|
|
504
502
|
type: "button",
|
|
505
|
-
onClick:
|
|
506
|
-
disabled:
|
|
507
|
-
className: "px-4 py-2 text-sm font-medium border border-border text-status-error-text rounded-md hover:bg-status-error-bg-subtle disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
508
|
-
children:
|
|
503
|
+
onClick: () => E(!0),
|
|
504
|
+
disabled: S || w,
|
|
505
|
+
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-status-error-text rounded-md hover:bg-status-error-bg-subtle disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
506
|
+
children: w ? "Archiving..." : "Archive Account"
|
|
509
507
|
}) : null, /* @__PURE__ */ c("button", {
|
|
510
508
|
type: "button",
|
|
511
|
-
onClick:
|
|
512
|
-
disabled: !
|
|
513
|
-
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-
|
|
514
|
-
children: [
|
|
509
|
+
onClick: De,
|
|
510
|
+
disabled: !Ee || S || w || !P.name || !P.email,
|
|
511
|
+
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2",
|
|
512
|
+
children: [S && /* @__PURE__ */ c("svg", {
|
|
515
513
|
className: "size-4 animate-spin",
|
|
516
514
|
fill: "none",
|
|
517
515
|
viewBox: "0 0 24 24",
|
|
@@ -527,17 +525,17 @@ var d = () => {
|
|
|
527
525
|
fill: "currentColor",
|
|
528
526
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
529
527
|
})]
|
|
530
|
-
}),
|
|
528
|
+
}), S ? "Saving..." : "Save Changes"]
|
|
531
529
|
})]
|
|
532
530
|
})]
|
|
533
531
|
})
|
|
534
532
|
]
|
|
535
533
|
})]
|
|
536
534
|
}),
|
|
537
|
-
|
|
535
|
+
A && M && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
|
|
538
536
|
className: "fixed inset-0 bg-overlay-scrim z-40",
|
|
539
537
|
onClick: () => {
|
|
540
|
-
|
|
538
|
+
S || (j(!1), N(!1), F((e) => ({
|
|
541
539
|
...e,
|
|
542
540
|
isDefault: q?.isDefault || !1
|
|
543
541
|
})));
|
|
@@ -545,19 +543,19 @@ var d = () => {
|
|
|
545
543
|
}), /* @__PURE__ */ s("div", {
|
|
546
544
|
className: "fixed inset-0 flex items-center justify-center z-50 p-4",
|
|
547
545
|
children: /* @__PURE__ */ c("div", {
|
|
548
|
-
className: "bg-
|
|
546
|
+
className: "bg-bg-surface border border-border-subtle rounded-lg shadow-xl max-w-md w-full p-6",
|
|
549
547
|
children: [
|
|
550
548
|
/* @__PURE__ */ s("h3", {
|
|
551
|
-
className: "text-lg font-semibold text-
|
|
549
|
+
className: "text-lg font-semibold text-text-primary mb-2",
|
|
552
550
|
children: "Confirm Default Account Change"
|
|
553
551
|
}),
|
|
554
552
|
/* @__PURE__ */ c("p", {
|
|
555
|
-
className: "text-sm text-
|
|
553
|
+
className: "text-sm text-text-secondary mb-4",
|
|
556
554
|
children: [
|
|
557
555
|
"You are about to set",
|
|
558
556
|
" ",
|
|
559
557
|
/* @__PURE__ */ s("strong", {
|
|
560
|
-
className: "text-
|
|
558
|
+
className: "text-text-primary",
|
|
561
559
|
children: q?.name
|
|
562
560
|
}),
|
|
563
561
|
" as your default billing account and save your changes."
|
|
@@ -595,20 +593,20 @@ var d = () => {
|
|
|
595
593
|
children: [/* @__PURE__ */ s("button", {
|
|
596
594
|
type: "button",
|
|
597
595
|
onClick: () => {
|
|
598
|
-
|
|
596
|
+
j(!1), N(!1), F((e) => ({
|
|
599
597
|
...e,
|
|
600
598
|
isDefault: q?.isDefault || !1
|
|
601
599
|
}));
|
|
602
600
|
},
|
|
603
|
-
disabled:
|
|
604
|
-
className: "px-4 py-2 text-sm font-medium text-
|
|
601
|
+
disabled: S,
|
|
602
|
+
className: "px-4 py-2 text-sm font-medium text-text-primary border border-border-subtle rounded-md hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
605
603
|
children: "Cancel"
|
|
606
604
|
}), /* @__PURE__ */ c("button", {
|
|
607
605
|
type: "button",
|
|
608
606
|
onClick: Q,
|
|
609
|
-
disabled:
|
|
610
|
-
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-
|
|
611
|
-
children: [
|
|
607
|
+
disabled: S,
|
|
608
|
+
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 transition-colors flex items-center gap-2",
|
|
609
|
+
children: [S && /* @__PURE__ */ c("svg", {
|
|
612
610
|
className: "size-4 animate-spin",
|
|
613
611
|
fill: "none",
|
|
614
612
|
viewBox: "0 0 24 24",
|
|
@@ -624,16 +622,26 @@ var d = () => {
|
|
|
624
622
|
fill: "currentColor",
|
|
625
623
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
626
624
|
})]
|
|
627
|
-
}),
|
|
625
|
+
}), S ? "Saving..." : "Save Changes"]
|
|
628
626
|
})]
|
|
629
627
|
})
|
|
630
628
|
]
|
|
631
629
|
})
|
|
632
|
-
})] })
|
|
630
|
+
})] }),
|
|
631
|
+
/* @__PURE__ */ s(u, {
|
|
632
|
+
open: ye,
|
|
633
|
+
onOpenChange: E,
|
|
634
|
+
children: /* @__PURE__ */ c(fe, { children: [/* @__PURE__ */ c(he, { children: [/* @__PURE__ */ s(ge, { children: "Archive billing account?" }), /* @__PURE__ */ s(pe, { children: Oe })] }), /* @__PURE__ */ c(me, { children: [/* @__PURE__ */ s(de, { children: "Cancel" }), /* @__PURE__ */ s(ue, {
|
|
635
|
+
onClick: () => {
|
|
636
|
+
E(!1), ke();
|
|
637
|
+
},
|
|
638
|
+
children: "Archive Account"
|
|
639
|
+
})] })] })
|
|
640
|
+
})
|
|
633
641
|
]
|
|
634
642
|
}) : /* @__PURE__ */ s(t, { message: "You don't have permission to manage billing settings." });
|
|
635
643
|
};
|
|
636
644
|
//#endregion
|
|
637
|
-
export {
|
|
645
|
+
export { d as SettingsPage };
|
|
638
646
|
|
|
639
647
|
//# sourceMappingURL=SettingsPage.js.map
|