@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.
Files changed (96) hide show
  1. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
  2. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  7. package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  9. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
  10. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  11. package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
  12. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  13. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
  14. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  15. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
  16. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
  20. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
  22. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  31. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
  32. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  33. package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
  34. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  35. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
  36. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  37. package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
  38. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  39. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
  42. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  43. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
  44. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  45. package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
  46. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  47. package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
  48. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
  52. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  53. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
  54. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  55. package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
  56. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  57. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
  58. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  59. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
  60. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  61. package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
  64. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
  66. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  67. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
  68. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  69. package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
  70. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  71. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  73. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
  74. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  75. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
  76. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
  77. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  78. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
  79. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  80. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
  81. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  82. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
  83. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  84. package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
  85. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  86. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
  87. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  88. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
  89. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  90. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
  91. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  92. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
  93. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  94. package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
  95. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  96. package/package.json +2 -2
@@ -9,63 +9,63 @@ import { useBillingPermissions as ne } from "../../../hooks/useBillingPermission
9
9
  import { ArchiveBillingAccountSettingsDocument as re, useGetBillingAccountSettingsQuery as ie, useGetBillingAccountsSettingsQuery as ae, useGetDefaultBillingAccountSettingsQuery as oe, useSetDefaultBillingAccountSettingsMutation as se, useUpdateBillingAccountSettingsMutation as ce } from "../../../../generated/global-operations.js";
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
- import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
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";
12
+ import { useI18n as ue } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
+ import { AlertDialog as de, AlertDialogAction as fe, AlertDialogCancel as pe, AlertDialogContent as me, AlertDialogDescription as he, AlertDialogFooter as ge, AlertDialogHeader as _e, AlertDialogTitle as l, OptionalFields as u, PagePurpose as ve } from "@burdenoff/fe-libs/ui";
14
14
  //#region src/billing/modules/settings/pages/SettingsPage.tsx
15
- var ve = () => {
15
+ var ye = () => {
16
16
  if (!(typeof window > "u")) return new URLSearchParams(window.location.search).get("billingAccountId") || void 0;
17
17
  }, d = () => {
18
- let { t: d } = l(), f = (e, t) => {
18
+ let { t: d } = ue(), f = (e, t) => {
19
19
  let n = d(e);
20
20
  return n === e ? t : n;
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({
21
+ }, p = ne(), { apiGatewayUrl: m, authToken: h, orgId: g } = e(), { emit: _ } = ee(), [v, y] = a(ye), [b, x] = a(!1), [S, C] = a(!1), [w, T] = a(!1), [be, E] = a(!1), [D, O] = a(null), [xe, 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: 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({
28
+ }), { data: I, loading: Se, refetch: L } = ae({}), R = i(() => I?.getBillingAccountsByOrg || [], [I?.getBillingAccountsByOrg]), { data: Ce, loading: we, refetch: z } = oe({}), B = Ce?.getDefaultBillingAccount || null, { data: Te, loading: V, refetch: H } = ie({
29
29
  variables: { id: v },
30
30
  skip: !v
31
- }), W = V?.getBillingAccount || null, [G] = ce(), [K] = se(), q = i(() => {
31
+ }), U = Te?.getBillingAccount || null, [W] = ce(), [G] = se(), K = i(() => {
32
32
  if (v) {
33
- if (W) return W;
33
+ if (U) return U;
34
34
  let e = R.find((e) => e.id === v);
35
35
  if (e) return e;
36
- if (H) return null;
36
+ if (V) return null;
37
37
  }
38
38
  return B;
39
39
  }, [
40
40
  v,
41
- W,
41
+ U,
42
42
  R,
43
- H,
43
+ V,
44
44
  B
45
- ]), we = xe || Ce || v && H;
45
+ ]), Ee = Se || we || v && V;
46
46
  le(() => {
47
- q && F({
48
- name: q.name || "",
49
- email: q.email || "",
50
- billingEmail: q.billingEmail || "",
51
- currency: q.currency || "USD",
52
- taxId: q.taxId || "",
53
- isDefault: q.isDefault || !1
47
+ K && F({
48
+ name: K.name || "",
49
+ email: K.email || "",
50
+ billingEmail: K.billingEmail || "",
51
+ currency: K.currency || "USD",
52
+ taxId: K.taxId || "",
53
+ isDefault: K.isDefault || !1
54
54
  });
55
- }, [q]);
56
- let Te = (e) => {
55
+ }, [K]);
56
+ let De = (e) => {
57
57
  y(e.id), x(!1), k(!1), O(null);
58
- }, J = (e, t) => {
58
+ }, q = (e, t) => {
59
59
  F((n) => ({
60
60
  ...n,
61
61
  [e]: t
62
62
  })), k(!1), O(null);
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
- if (q?.id) {
63
+ }, J = i(() => R.find((e) => e.isDefault) || null, [R]), Y = i(() => K ? P.name !== (K.name || "") || P.email !== (K.email || "") || P.billingEmail !== (K.billingEmail || "") || P.currency !== (K.currency || "USD") || P.taxId !== (K.taxId || "") || P.isDefault !== (K.isDefault || !1) : !1, [P, K]), X = P.isDefault && !K?.isDefault, Z = X && J && J.id !== K?.id, Q = r(async () => {
64
+ if (K?.id) {
65
65
  C(!0), O(null), k(!1), j(!1), N(!1);
66
66
  try {
67
- await G({ variables: { input: {
68
- id: q.id,
67
+ await W({ variables: { input: {
68
+ id: K.id,
69
69
  name: P.name,
70
70
  email: P.email,
71
71
  billingEmail: P.billingEmail || null,
@@ -73,16 +73,16 @@ var ve = () => {
73
73
  taxId: P.taxId || null
74
74
  } } }), _("billing.billing_account.updated", {
75
75
  route: "/billing/settings",
76
- entityId: q.id,
76
+ entityId: K.id,
77
77
  source: "settings"
78
- }), X && (await K({
79
- variables: { id: q.id },
78
+ }), X && (await G({
79
+ variables: { id: K.id },
80
80
  refetchQueries: ["GetBillingAccountsByTenant", "GetDefaultBillingAccount"]
81
81
  }), _("billing.billing_account.updated", {
82
82
  route: "/billing/settings",
83
- entityId: q.id,
83
+ entityId: K.id,
84
84
  source: "settings.default"
85
- })), v ? await U() : await z(), k(!0), setTimeout(() => k(!1), 3e3);
85
+ })), v ? await H() : 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 {
@@ -90,23 +90,23 @@ var ve = () => {
90
90
  }
91
91
  }
92
92
  }, [
93
- q?.id,
93
+ K?.id,
94
94
  P,
95
95
  X,
96
+ W,
96
97
  G,
97
- K,
98
98
  v,
99
- U,
99
+ H,
100
100
  z,
101
101
  _
102
- ]), De = r(() => {
103
- q?.id && (Z ? (N(!0), j(!0)) : Q());
102
+ ]), Oe = r(() => {
103
+ K?.id && (Z ? (N(!0), j(!0)) : Q());
104
104
  }, [
105
- q?.id,
105
+ K?.id,
106
106
  Z,
107
107
  Q
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)) {
108
+ ]), $ = i(() => K ? R.find((e) => e.id !== K.id && e.isActive) : void 0, [K, R]), ke = K ? K.isDefault ? `Archive ${K.name}? ${$ ? `${$.name} will become the default account.` : "No replacement default account is available."}` : `Archive ${K.name}?` : "", Ae = r(async () => {
109
+ if (!(!K?.id || !K.isActive)) {
110
110
  T(!0), O(null), k(!1);
111
111
  try {
112
112
  await te({
@@ -115,13 +115,13 @@ var ve = () => {
115
115
  orgId: g,
116
116
  query: re,
117
117
  variables: {
118
- id: q.id,
118
+ id: K.id,
119
119
  reason: "Archived from billing settings",
120
- replacementDefaultBillingAccountId: q.isDefault ? $?.id ?? null : null
120
+ replacementDefaultBillingAccountId: K.isDefault ? $?.id ?? null : null
121
121
  }
122
122
  }), _("billing.billing_account.archived", {
123
123
  route: "/billing/settings",
124
- entityId: q.id,
124
+ entityId: K.id,
125
125
  source: "settings"
126
126
  }), await Promise.all([L(), z()]), y($?.id), k(!0), setTimeout(() => k(!1), 3e3);
127
127
  } catch (e) {
@@ -133,14 +133,14 @@ var ve = () => {
133
133
  }, [
134
134
  m,
135
135
  h,
136
- q,
136
+ K,
137
137
  $,
138
138
  g,
139
139
  L,
140
140
  z,
141
141
  _
142
142
  ]);
143
- return p.canManageBillingAccount ? we && !q ? /* @__PURE__ */ c("div", {
143
+ return p.canManageBillingAccount ? Ee && !K ? /* @__PURE__ */ c("div", {
144
144
  className: "space-y-6 p-6",
145
145
  children: [/* @__PURE__ */ s("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ s("div", {
146
146
  className: "border border-border-subtle rounded-lg p-6 space-y-4",
@@ -157,6 +157,7 @@ var ve = () => {
157
157
  title: f("billing.settings.billingSettings", "Billing Settings"),
158
158
  description: f("billing.settings.description", "Manage your billing account configuration")
159
159
  }),
160
+ /* @__PURE__ */ s(ve, { children: f("billing.settings.purpose", "Configure how a billing account behaves — its name and contact details, default currency, tax information and whether it's your default account. Changes here affect how invoices are generated and which account new purchases bill to.") }),
160
161
  R.length > 1 && /* @__PURE__ */ c("div", {
161
162
  className: "relative",
162
163
  children: [/* @__PURE__ */ c("button", {
@@ -183,10 +184,10 @@ var ve = () => {
183
184
  className: "text-left",
184
185
  children: [/* @__PURE__ */ s("p", {
185
186
  className: "text-sm font-medium text-text-primary",
186
- children: q?.name || f("billing.settings.selectAccount", "Select Account")
187
+ children: K?.name || f("billing.settings.selectAccount", "Select Account")
187
188
  }), /* @__PURE__ */ s("p", {
188
189
  className: "text-xs text-text-secondary",
189
- children: q?.email
190
+ children: K?.email
190
191
  })]
191
192
  })]
192
193
  }), /* @__PURE__ */ s("svg", {
@@ -208,7 +209,7 @@ var ve = () => {
208
209
  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
210
  children: R.map((e) => /* @__PURE__ */ c("button", {
210
211
  type: "button",
211
- onClick: () => Te(e),
212
+ onClick: () => De(e),
212
213
  className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
213
214
  children: [/* @__PURE__ */ c("div", {
214
215
  className: "flex items-center gap-3 min-w-0",
@@ -236,7 +237,7 @@ var ve = () => {
236
237
  children: e.email
237
238
  })]
238
239
  })]
239
- }), q?.id === e.id && /* @__PURE__ */ s("svg", {
240
+ }), K?.id === e.id && /* @__PURE__ */ s("svg", {
240
241
  className: "size-4 text-primary flex-shrink-0",
241
242
  fill: "none",
242
243
  viewBox: "0 0 24 24",
@@ -263,7 +264,7 @@ var ve = () => {
263
264
  }), /* @__PURE__ */ s("p", {
264
265
  className: "text-sm text-text-secondary mt-1",
265
266
  children: f("billing.settings.accountInfoDescription", "Update your billing contact details and tax information")
266
- })] }), q?.isDefault && /* @__PURE__ */ c("span", {
267
+ })] }), K?.isDefault && /* @__PURE__ */ c("span", {
267
268
  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",
268
269
  children: [/* @__PURE__ */ s("svg", {
269
270
  className: "size-3",
@@ -280,37 +281,37 @@ var ve = () => {
280
281
  }), /* @__PURE__ */ c("div", {
281
282
  className: "p-6 space-y-6",
282
283
  children: [
283
- q && /* @__PURE__ */ c("div", {
284
+ K && /* @__PURE__ */ c("div", {
284
285
  className: "grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm pb-4 border-b border-border-subtle",
285
286
  children: [
286
287
  /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
287
288
  className: "text-text-secondary",
288
289
  children: f("billing.settings.status", "Status")
289
290
  }), /* @__PURE__ */ s("p", {
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")
291
+ className: `font-medium ${K.isActive ? "text-status-success-text" : "text-status-error-text"}`,
292
+ children: K.isActive ? f("billing.settings.active", "Active") : f("billing.settings.inactive", "Inactive")
292
293
  })] }),
293
294
  /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
294
295
  className: "text-text-secondary",
295
296
  children: f("billing.settings.creditBalance", "Credit Balance")
296
297
  }), /* @__PURE__ */ c("p", {
297
298
  className: "font-medium text-text-primary",
298
- children: [(q.creditAmount || 0).toLocaleString(), " Credits"]
299
+ children: [(K.creditAmount || 0).toLocaleString(), " Credits"]
299
300
  })] }),
300
301
  /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
301
302
  className: "text-text-secondary",
302
303
  children: f("billing.settings.accountId", "Account ID")
303
304
  }), /* @__PURE__ */ s("p", {
304
305
  className: "font-mono text-xs text-text-primary truncate",
305
- title: q.id,
306
- children: q.id
306
+ title: K.id,
307
+ children: K.id
307
308
  })] }),
308
309
  /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
309
310
  className: "text-text-secondary",
310
311
  children: f("billing.settings.created", "Created")
311
312
  }), /* @__PURE__ */ s("p", {
312
313
  className: "font-medium text-text-primary",
313
- children: q.createdAt ? new Date(q.createdAt).toLocaleDateString() : f("billing.settings.notAvailable", "N/A")
314
+ children: K.createdAt ? new Date(K.createdAt).toLocaleDateString() : f("billing.settings.notAvailable", "N/A")
314
315
  })] })
315
316
  ]
316
317
  }),
@@ -334,7 +335,7 @@ var ve = () => {
334
335
  id: "billing-account-name",
335
336
  type: "text",
336
337
  value: P.name,
337
- onChange: (e) => J("name", e.target.value),
338
+ onChange: (e) => q("name", e.target.value),
338
339
  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"
339
340
  })] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("label", {
340
341
  htmlFor: "billing-account-email",
@@ -351,11 +352,11 @@ var ve = () => {
351
352
  id: "billing-account-email",
352
353
  type: "email",
353
354
  value: P.email,
354
- onChange: (e) => J("email", e.target.value),
355
+ onChange: (e) => q("email", e.target.value),
355
356
  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"
356
357
  })] })]
357
358
  })] }),
358
- /* @__PURE__ */ s(_e, {
359
+ /* @__PURE__ */ s(u, {
359
360
  title: f("billing.settings.advancedTitle", "Advanced settings"),
360
361
  description: f("billing.settings.advancedDescription", "Billing email override, currency, and tax identification."),
361
362
  children: /* @__PURE__ */ c("div", {
@@ -371,7 +372,7 @@ var ve = () => {
371
372
  id: "billing-account-billing-email",
372
373
  type: "email",
373
374
  value: P.billingEmail,
374
- onChange: (e) => J("billingEmail", e.target.value),
375
+ onChange: (e) => q("billingEmail", e.target.value),
375
376
  placeholder: f("billing.settings.billingEmailPlaceholder", "Optional - defaults to account email"),
376
377
  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"
377
378
  }),
@@ -387,7 +388,7 @@ var ve = () => {
387
388
  }), /* @__PURE__ */ c("select", {
388
389
  id: "billing-account-currency",
389
390
  value: P.currency,
390
- onChange: (e) => J("currency", e.target.value),
391
+ onChange: (e) => q("currency", e.target.value),
391
392
  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",
392
393
  children: [
393
394
  /* @__PURE__ */ s("option", {
@@ -420,7 +421,7 @@ var ve = () => {
420
421
  id: "billing-account-tax-id",
421
422
  type: "text",
422
423
  value: P.taxId,
423
- onChange: (e) => J("taxId", e.target.value),
424
+ onChange: (e) => q("taxId", e.target.value),
424
425
  placeholder: f("billing.settings.taxIdPlaceholder", "Enter your tax identification number"),
425
426
  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"
426
427
  }),
@@ -433,7 +434,7 @@ var ve = () => {
433
434
  ]
434
435
  })
435
436
  }),
436
- q?.isActive && R.length > 1 && /* @__PURE__ */ s("div", {
437
+ K?.isActive && R.length > 1 && /* @__PURE__ */ s("div", {
437
438
  className: "pt-4 border-t border-border-subtle",
438
439
  children: /* @__PURE__ */ c("div", {
439
440
  className: "flex items-start gap-3",
@@ -447,7 +448,7 @@ var ve = () => {
447
448
  ...t,
448
449
  isDefault: e.target.checked
449
450
  })),
450
- disabled: q?.isDefault,
451
+ disabled: K?.isDefault,
451
452
  className: "size-4 rounded border-border-subtle text-primary focus:ring-primary focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed"
452
453
  })
453
454
  }), /* @__PURE__ */ c("div", {
@@ -458,7 +459,7 @@ var ve = () => {
458
459
  children: f("billing.settings.setDefault", "Set as default billing account")
459
460
  }), /* @__PURE__ */ s("p", {
460
461
  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")
462
+ children: K?.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")
462
463
  })]
463
464
  })]
464
465
  })
@@ -467,7 +468,7 @@ var ve = () => {
467
468
  className: "pt-4 border-t border-border-subtle flex items-center justify-between",
468
469
  children: [/* @__PURE__ */ c("div", {
469
470
  className: "flex items-center gap-2",
470
- children: [be && /* @__PURE__ */ c("div", {
471
+ children: [xe && /* @__PURE__ */ c("div", {
471
472
  className: "flex items-center gap-2 text-sm text-status-success-text",
472
473
  children: [/* @__PURE__ */ s("svg", {
473
474
  className: "size-4",
@@ -498,7 +499,7 @@ var ve = () => {
498
499
  })]
499
500
  }), /* @__PURE__ */ c("div", {
500
501
  className: "flex items-center gap-3",
501
- children: [p.canArchiveBillingAccount && q?.isActive ? /* @__PURE__ */ s("button", {
502
+ children: [p.canArchiveBillingAccount && K?.isActive ? /* @__PURE__ */ s("button", {
502
503
  type: "button",
503
504
  onClick: () => E(!0),
504
505
  disabled: S || w,
@@ -506,8 +507,8 @@ var ve = () => {
506
507
  children: w ? "Archiving..." : "Archive Account"
507
508
  }) : null, /* @__PURE__ */ c("button", {
508
509
  type: "button",
509
- onClick: De,
510
- disabled: !Ee || S || w || !P.name || !P.email,
510
+ onClick: Oe,
511
+ disabled: !Y || S || w || !P.name || !P.email,
511
512
  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
513
  children: [S && /* @__PURE__ */ c("svg", {
513
514
  className: "size-4 animate-spin",
@@ -537,7 +538,7 @@ var ve = () => {
537
538
  onClick: () => {
538
539
  S || (j(!1), N(!1), F((e) => ({
539
540
  ...e,
540
- isDefault: q?.isDefault || !1
541
+ isDefault: K?.isDefault || !1
541
542
  })));
542
543
  }
543
544
  }), /* @__PURE__ */ s("div", {
@@ -556,12 +557,12 @@ var ve = () => {
556
557
  " ",
557
558
  /* @__PURE__ */ s("strong", {
558
559
  className: "text-text-primary",
559
- children: q?.name
560
+ children: K?.name
560
561
  }),
561
562
  " as your default billing account and save your changes."
562
563
  ]
563
564
  }),
564
- Y && Y.id !== q?.id && /* @__PURE__ */ s("div", {
565
+ J && J.id !== K?.id && /* @__PURE__ */ s("div", {
565
566
  className: "mb-4 p-3 bg-status-warning-bg-subtle border border-border-subtle rounded-md",
566
567
  children: /* @__PURE__ */ c("div", {
567
568
  className: "flex items-start gap-2",
@@ -583,7 +584,7 @@ var ve = () => {
583
584
  children: "Current default will change"
584
585
  }), /* @__PURE__ */ c("p", {
585
586
  className: "text-status-warning-text mt-0.5",
586
- children: [/* @__PURE__ */ s("strong", { children: Y.name }), " will no longer be the default account."]
587
+ children: [/* @__PURE__ */ s("strong", { children: J.name }), " will no longer be the default account."]
587
588
  })]
588
589
  })]
589
590
  })
@@ -595,7 +596,7 @@ var ve = () => {
595
596
  onClick: () => {
596
597
  j(!1), N(!1), F((e) => ({
597
598
  ...e,
598
- isDefault: q?.isDefault || !1
599
+ isDefault: K?.isDefault || !1
599
600
  }));
600
601
  },
601
602
  disabled: S,
@@ -628,12 +629,12 @@ var ve = () => {
628
629
  ]
629
630
  })
630
631
  })] }),
631
- /* @__PURE__ */ s(u, {
632
- open: ye,
632
+ /* @__PURE__ */ s(de, {
633
+ open: be,
633
634
  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
+ children: /* @__PURE__ */ c(me, { children: [/* @__PURE__ */ c(_e, { children: [/* @__PURE__ */ s(l, { children: "Archive billing account?" }), /* @__PURE__ */ s(he, { children: ke })] }), /* @__PURE__ */ c(ge, { children: [/* @__PURE__ */ s(pe, { children: "Cancel" }), /* @__PURE__ */ s(fe, {
635
636
  onClick: () => {
636
- E(!1), ke();
637
+ E(!1), Ae();
637
638
  },
638
639
  children: "Archive Account"
639
640
  })] })] })