@burdenoff/microfe-billing 2026.624.3 → 2026.625.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.
Files changed (95) hide show
  1. package/dist/billing/BillingAdminRoutes.js +1 -1
  2. package/dist/billing/BillingAdminRoutes.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonCreatePage.js +2 -2
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +4 -4
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  7. package/dist/billing/modules/addons/pages/AddonEditPage.js +2 -2
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  9. package/dist/billing/modules/addons/pages/AddonsListPage.js +1 -1
  10. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  11. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +98 -99
  12. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  13. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -85
  14. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  15. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +6 -6
  16. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  17. package/dist/billing/modules/billing/pages/InvoicesListPage.js +2 -2
  18. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/RefundsPage.js +360 -370
  20. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  21. package/dist/billing/modules/billing/pages/UserRefundsPage.js +2 -2
  22. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  23. package/dist/billing/modules/checkout/components/BillingAccountSelector.js +1 -1
  24. package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -1
  25. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +1 -1
  26. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
  27. package/dist/billing/modules/checkout/components/SubscriptionSelector.js +1 -1
  28. package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -1
  29. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +2 -2
  30. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
  31. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +102 -104
  32. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  33. package/dist/billing/modules/coupons/pages/CouponsListPage.js +5 -5
  34. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  35. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +1 -1
  36. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  37. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +1 -1
  38. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  39. package/dist/billing/modules/credits/pages/CreditsPage.js +29 -28
  40. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  41. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +2 -2
  42. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -1
  43. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +1 -1
  44. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
  45. package/dist/billing/modules/dashboard/components/BillingAccountCard.js +3 -3
  46. package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -1
  47. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +2 -2
  48. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
  49. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +1 -1
  50. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -1
  51. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +1 -1
  52. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
  53. package/dist/billing/modules/dashboard/pages/OverviewPage.js +139 -142
  54. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  55. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +6 -6
  56. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  57. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +4 -4
  58. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  59. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +1 -1
  60. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +142 -133
  62. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  63. package/dist/billing/modules/plans/pages/PlanCreatePage.js +2 -2
  64. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  65. package/dist/billing/modules/plans/pages/PlanDetailPage.js +4 -4
  66. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  67. package/dist/billing/modules/plans/pages/PlanEditPage.js +2 -2
  68. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  69. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +4 -4
  70. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  71. package/dist/billing/modules/plans/pages/PlansListPage.js +2 -2
  72. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  73. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +4 -4
  74. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  75. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +2 -2
  76. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  77. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +2 -2
  78. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  79. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +5 -5
  80. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  81. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +2 -2
  82. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  83. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +1 -1
  84. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  85. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +259 -265
  86. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  87. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +7 -7
  88. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  89. package/dist/billing/modules/usage/pages/UsagePage.js +13 -13
  90. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  91. package/dist/billing/shared/ui/Card.js +1 -1
  92. package/dist/billing/shared/ui/Card.js.map +1 -1
  93. package/dist/billing/shared/ui/MetricCard.js +28 -21
  94. package/dist/billing/shared/ui/MetricCard.js.map +1 -1
  95. package/package.json +2 -2
@@ -22,121 +22,122 @@ import { useAddonCartStore as me } from "../../addons/store/addonCartStore.js";
22
22
  import { FloatingCartDrawer as he } from "../../addons/components/FloatingCartDrawer.js";
23
23
  import { withBillingAccountId as i } from "../../../shared/utils/navigation.js";
24
24
  import { useCallback as a, useEffect as o, useState as s } from "react";
25
- import { Activity as ge, ArrowRight as _e, Building2 as c, Check as ve, ChevronDown as ye, Coins as be, Crown as l, Loader2 as xe, Plus as u, Receipt as Se, RefreshCw as d, Sparkles as Ce, Wallet as f } from "lucide-react";
25
+ import { Activity as ge, ArrowRight as _e, Building2 as c, Check as l, ChevronDown as u, Coins as ve, Crown as ye, Loader2 as be, Plus as xe, Receipt as Se, RefreshCw as d, Sparkles as Ce, Wallet as f } from "lucide-react";
26
26
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
27
27
  import { useI18n as we } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
28
+ import { Button as Te, CTAOverflowMenu as Ee, EmphasisPanel as De } from "@burdenoff/fe-libs/ui";
28
29
  //#region src/billing/modules/dashboard/pages/OverviewPage.tsx
29
30
  var g = () => {
30
31
  let { t: g } = we(), _ = (e, t) => {
31
32
  let n = g(e);
32
33
  return n === e ? t : n;
33
- }, { navigate: v, basePath: y, orgId: b, productId: Te } = e(), x = oe(), { emit: S } = ne(), [C, Ee] = s(() => re(b)), [w, T] = s(!1), [E, D] = s(null), [O, k] = s(!1), [De, A] = s(!1), [Oe, ke] = s(0), [j, M] = s(!1), { billingAccounts: N, currentAccount: P, paymentMethods: F, activeSubscriptions: I, hasActiveSubscription: L, recommendedAddons: Ae, isLoading: R, error: z, refetchAll: B } = ce(C, Te), V = P?.id, je = R, H = a((e) => {
34
- Ee(e), ie(b, e);
35
- }, [b]), { addToCart: U, isInCart: W, getCartItem: G, updateQuantity: K, removeFromCart: q } = me(), { createBillingAccount: J, setBillingAddress: Y, setDefaultPaymentMethod: X, deletePaymentMethod: Me, isCreatingAccount: Ne } = se();
34
+ }, { navigate: v, basePath: y, orgId: b, productId: Oe } = e(), x = oe(), { emit: S } = ne(), [C, ke] = s(() => re(b)), [w, T] = s(!1), [E, D] = s(null), [O, k] = s(!1), [Ae, A] = s(!1), [j, M] = s(0), [N, P] = s(!1), { billingAccounts: F, currentAccount: I, paymentMethods: L, activeSubscriptions: R, hasActiveSubscription: z, recommendedAddons: je, isLoading: B, error: V, refetchAll: H } = ce(C, Oe), U = I?.id, Me = B, W = a((e) => {
35
+ ke(e), ie(b, e);
36
+ }, [b]), { addToCart: G, isInCart: K, getCartItem: q, updateQuantity: J, removeFromCart: Y } = me(), { createBillingAccount: Ne, setBillingAddress: X, setDefaultPaymentMethod: Pe, deletePaymentMethod: Fe, isCreatingAccount: Ie } = se();
36
37
  o(() => {
37
- ke(0), M(!1);
38
- }, [V, I.length]), o(() => {
39
- C && N.length > 0 && (N.some((e) => e.id === C) || H(null));
38
+ M(0), P(!1);
39
+ }, [U, R.length]), o(() => {
40
+ C && F.length > 0 && (F.some((e) => e.id === C) || W(null));
40
41
  }, [
41
- N,
42
+ F,
42
43
  C,
43
- H
44
+ W
44
45
  ]), o(() => {
45
- !C && N.length > 0 && H((N.find((e) => e.isDefault) ?? N[0]).id);
46
+ !C && F.length > 0 && W((F.find((e) => e.isDefault) ?? F[0]).id);
46
47
  }, [
47
- N,
48
+ F,
48
49
  C,
49
- H
50
+ W
50
51
  ]);
51
- let Z = I[Oe] || I[0] || null, Q = a((e) => {
52
+ let Z = R[j] || R[0] || null, Q = a((e) => {
52
53
  let t = e;
53
54
  y && y !== "/" && (t = `${y.endsWith("/") ? y.slice(0, -1) : y}${e.startsWith("/") ? e : `/${e}`}`), v(t);
54
- }, [v, y]), Pe = a(async (e, t) => {
55
+ }, [v, y]), Le = a(async (e, t) => {
55
56
  D(null);
56
57
  try {
57
- let n = await J(e);
58
- t && n.id && await Y({
58
+ let n = await Ne(e);
59
+ t && n.id && await X({
59
60
  billingAccountId: n.id,
60
61
  ...t
61
- }), T(!1), H(n.id), S("billing.billing_account.created", {
62
+ }), T(!1), W(n.id), S("billing.billing_account.created", {
62
63
  route: "/billing/overview",
63
64
  entityId: n.id,
64
65
  source: "overview"
65
- }), await B();
66
+ }), await H();
66
67
  } catch (e) {
67
68
  D(e instanceof Error ? e.message : "Failed to create billing account");
68
69
  }
69
70
  }, [
70
- J,
71
+ Ne,
71
72
  S,
72
- B,
73
- Y,
74
- H
75
- ]), Fe = a(() => {
73
+ H,
74
+ X,
75
+ W
76
+ ]), Re = a(() => {
76
77
  A(!0);
77
78
  }, []), $ = a(async () => {
78
- await B();
79
- }, [B]), Ie = a(async () => {
79
+ await H();
80
+ }, [H]), ze = a(async () => {
80
81
  S("billing.payment_method.added", {
81
82
  route: "/billing/overview",
82
- entityId: V,
83
+ entityId: U,
83
84
  source: "overview"
84
85
  }), await $();
85
86
  }, [
86
- V,
87
+ U,
87
88
  S,
88
89
  $
89
- ]), Le = a(async (e) => {
90
- V && (await X(e, V), S("billing.payment_method.default_set", {
90
+ ]), Be = a(async (e) => {
91
+ U && (await Pe(e, U), S("billing.payment_method.default_set", {
91
92
  route: "/billing/overview",
92
93
  entityId: e,
93
94
  source: "overview"
94
95
  }), await $());
95
96
  }, [
96
- V,
97
+ U,
97
98
  S,
98
- X,
99
+ Pe,
99
100
  $
100
- ]), Re = a(async (e) => {
101
- V && (await Me(e, V), S("billing.payment_method.deleted", {
101
+ ]), Ve = a(async (e) => {
102
+ U && (await Fe(e, U), S("billing.payment_method.deleted", {
102
103
  route: "/billing/overview",
103
104
  entityId: e,
104
105
  source: "overview"
105
106
  }), await $());
106
107
  }, [
107
- V,
108
- Me,
108
+ U,
109
+ Fe,
109
110
  S,
110
111
  $
111
- ]), ze = a((e) => {
112
- H(e.id), k(!1);
113
- }, [H]), Be = a(async () => {
114
- await B();
115
- }, [B]), Ve = a((e) => {
116
- U(e);
117
- }, [U]), He = a((e) => W(e), [W]), Ue = a((e) => G(e)?.quantity || 0, [G]), We = a((e, t) => {
118
- t <= 0 ? q(e) : K(e, t);
119
- }, [K, q]), Ge = a((e) => {
120
- q(e);
121
- }, [q]);
122
- return x.canViewBillingAccount ? z && ae(z) && !R ? /* @__PURE__ */ m("div", {
112
+ ]), He = a((e) => {
113
+ W(e.id), k(!1);
114
+ }, [W]), Ue = a(async () => {
115
+ await H();
116
+ }, [H]), We = a((e) => {
117
+ G(e);
118
+ }, [G]), Ge = a((e) => K(e), [K]), Ke = a((e) => q(e)?.quantity || 0, [q]), qe = a((e, t) => {
119
+ t <= 0 ? Y(e) : J(e, t);
120
+ }, [J, Y]), Je = a((e) => {
121
+ Y(e);
122
+ }, [Y]);
123
+ return x.canViewBillingAccount ? V && ae(V) && !B ? /* @__PURE__ */ m("div", {
123
124
  className: "p-6",
124
125
  children: /* @__PURE__ */ m(te, {
125
126
  title: "Server Unavailable",
126
127
  message: "Unable to load billing overview. The server might be down or experiencing issues.",
127
- onRetry: Be,
128
+ onRetry: Ue,
128
129
  showRetry: !0
129
130
  })
130
- }) : R && !P ? /* @__PURE__ */ m("div", {
131
+ }) : B && !I ? /* @__PURE__ */ m("div", {
131
132
  className: "flex items-center justify-center min-h-[400px]",
132
133
  children: /* @__PURE__ */ h("div", {
133
134
  className: "flex flex-col items-center gap-3",
134
- children: [/* @__PURE__ */ m(xe, { className: "size-8 animate-spin text-text-link" }), /* @__PURE__ */ m("p", {
135
+ children: [/* @__PURE__ */ m(be, { className: "size-8 animate-spin text-text-link" }), /* @__PURE__ */ m("p", {
135
136
  className: "text-sm text-text-secondary",
136
137
  children: _("billing.overview.loadingInfo", "Loading billing information...")
137
138
  })]
138
139
  })
139
- }) : !R && N.length === 0 ? /* @__PURE__ */ h("div", {
140
+ }) : !B && F.length === 0 ? /* @__PURE__ */ h("div", {
140
141
  className: "px-6 lg:px-8 py-6",
141
142
  children: [
142
143
  /* @__PURE__ */ h("header", {
@@ -157,7 +158,7 @@ var g = () => {
157
158
  type: "button",
158
159
  onClick: () => T(!0),
159
160
  className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
160
- children: [/* @__PURE__ */ m(u, { className: "size-4" }), _("billing.overview.createBillingAccount", "Create Billing Account")]
161
+ children: [/* @__PURE__ */ m(xe, { className: "size-4" }), _("billing.overview.createBillingAccount", "Create Billing Account")]
161
162
  }) : void 0
162
163
  }),
163
164
  /* @__PURE__ */ m(r, {
@@ -165,8 +166,8 @@ var g = () => {
165
166
  onClose: () => {
166
167
  T(!1), D(null);
167
168
  },
168
- onSubmit: Pe,
169
- isSubmitting: Ne,
169
+ onSubmit: Le,
170
+ isSubmitting: Ie,
170
171
  error: E
171
172
  })
172
173
  ]
@@ -181,32 +182,28 @@ var g = () => {
181
182
  }), /* @__PURE__ */ m("p", {
182
183
  className: "text-sm text-text-secondary mt-1",
183
184
  children: _("billing.overview.description", "Manage your billing accounts, subscriptions, and payment methods")
184
- })] }), /* @__PURE__ */ h("div", {
185
- className: "flex items-center gap-2",
186
- children: [/* @__PURE__ */ m("button", {
187
- type: "button",
188
- onClick: Be,
189
- className: "p-2 rounded-button border border-border-subtle hover:bg-bg-sunken hover:border-border-strong text-text-secondary hover:text-text-primary transition-all duration-200",
190
- "aria-label": _("billing.overview.refresh", "Refresh"),
191
- children: /* @__PURE__ */ m(d, { className: `size-4 ${R ? "animate-spin" : ""}` })
192
- }), x.canManageBillingAccount && N.length > 0 && /* @__PURE__ */ h("button", {
193
- type: "button",
194
- onClick: () => T(!0),
195
- className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
196
- children: [/* @__PURE__ */ m(u, { className: "size-4" }), /* @__PURE__ */ m("span", {
197
- className: "hidden sm:inline",
198
- children: _("billing.overview.newAccount", "New Account")
199
- })]
200
- })]
185
+ })] }), /* @__PURE__ */ m(Ee, {
186
+ primary: x.canManageBillingAccount && F.length > 0 ? {
187
+ label: _("billing.overview.newAccount", "New Account"),
188
+ onSelect: () => T(!0),
189
+ icon: /* @__PURE__ */ m(xe, { className: "size-4" })
190
+ } : void 0,
191
+ actions: [{
192
+ label: _("billing.overview.refresh", "Refresh"),
193
+ onSelect: () => {
194
+ Ue();
195
+ },
196
+ icon: /* @__PURE__ */ m(d, { className: `size-4 ${B ? "animate-spin" : ""}` })
197
+ }]
201
198
  })]
202
199
  }),
203
- N.length > 1 && /* @__PURE__ */ h("div", {
200
+ F.length > 1 && /* @__PURE__ */ h("div", {
204
201
  className: "relative",
205
202
  "data-tour": "billing-overview-account-selector",
206
203
  children: [/* @__PURE__ */ h("button", {
207
204
  type: "button",
208
205
  onClick: () => k(!O),
209
- className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-subtle rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
206
+ className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-seam rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
210
207
  children: [/* @__PURE__ */ h("div", {
211
208
  className: "flex items-center gap-3",
212
209
  children: [/* @__PURE__ */ m("div", {
@@ -216,21 +213,21 @@ var g = () => {
216
213
  className: "text-left",
217
214
  children: [/* @__PURE__ */ m("p", {
218
215
  className: "text-sm font-medium text-text-primary",
219
- children: P?.name || _("billing.overview.selectAccount", "Select Account")
216
+ children: I?.name || _("billing.overview.selectAccount", "Select Account")
220
217
  }), /* @__PURE__ */ m("p", {
221
218
  className: "text-xs text-text-secondary",
222
- children: P?.email
219
+ children: I?.email
223
220
  })]
224
221
  })]
225
- }), /* @__PURE__ */ m(ye, { className: `size-4 text-text-muted transition-transform ${O ? "rotate-180" : ""}` })]
222
+ }), /* @__PURE__ */ m(u, { className: `size-4 text-text-muted transition-transform ${O ? "rotate-180" : ""}` })]
226
223
  }), O && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
227
224
  className: "fixed inset-0 z-10",
228
225
  onClick: () => k(!1)
229
226
  }), /* @__PURE__ */ m("div", {
230
- className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-subtle rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
231
- children: N.map((e) => /* @__PURE__ */ h("button", {
227
+ className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
228
+ children: F.map((e) => /* @__PURE__ */ h("button", {
232
229
  type: "button",
233
- onClick: () => ze(e),
230
+ onClick: () => He(e),
234
231
  className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
235
232
  children: [/* @__PURE__ */ h("div", {
236
233
  className: "flex items-center gap-3 min-w-0",
@@ -247,32 +244,32 @@ var g = () => {
247
244
  children: e.email
248
245
  })]
249
246
  })]
250
- }), P?.id === e.id && /* @__PURE__ */ m(ve, { className: "size-4 text-text-link flex-shrink-0" })]
247
+ }), I?.id === e.id && /* @__PURE__ */ m(l, { className: "size-4 text-text-link flex-shrink-0" })]
251
248
  }, e.id))
252
249
  })] })]
253
250
  }),
254
- P && /* @__PURE__ */ h("div", {
251
+ I && /* @__PURE__ */ h("div", {
255
252
  className: "grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4",
256
253
  "data-tour": "billing-overview-stats-row",
257
254
  children: [
258
255
  /* @__PURE__ */ m(n, {
259
256
  label: _("billing.overview.stats.creditBalance", "Credit Balance"),
260
- value: `${(P.creditAmount || 0).toLocaleString()} Credits`,
257
+ value: `${(I.creditAmount || 0).toLocaleString()} Credits`,
261
258
  icon: /* @__PURE__ */ m(f, { className: "size-5" })
262
259
  }),
263
260
  /* @__PURE__ */ m(n, {
264
261
  label: _("billing.overview.stats.activePlans", "Active Plans"),
265
- value: I.length > 0 ? I.length === 1 ? I[0]?.plan?.name || "1 Plan" : `${I.length} ${_("billing.overview.stats.plansSuffix", "Plans")}` : _("billing.overview.stats.none", "None"),
262
+ value: R.length > 0 ? R.length === 1 ? R[0]?.plan?.name || "1 Plan" : `${R.length} ${_("billing.overview.stats.plansSuffix", "Plans")}` : _("billing.overview.stats.none", "None"),
266
263
  icon: /* @__PURE__ */ m(d, { className: "size-5" })
267
264
  }),
268
265
  /* @__PURE__ */ m(n, {
269
266
  label: _("billing.overview.stats.paymentMethods", "Payment Methods"),
270
- value: F.length,
267
+ value: L.length,
271
268
  icon: /* @__PURE__ */ m(c, { className: "size-5" })
272
269
  }),
273
270
  /* @__PURE__ */ m(n, {
274
271
  label: _("billing.overview.stats.paymentCurrency", "Payment Currency"),
275
- value: P.currency || "USD",
272
+ value: I.currency || "USD",
276
273
  icon: /* @__PURE__ */ m(c, { className: "size-5" })
277
274
  })
278
275
  ]
@@ -282,27 +279,27 @@ var g = () => {
282
279
  children: [/* @__PURE__ */ h("div", {
283
280
  className: "lg:col-span-2 space-y-6",
284
281
  children: [
285
- P && /* @__PURE__ */ m(le, {
282
+ I && /* @__PURE__ */ m(le, {
286
283
  dataTour: "billing-overview-billing-account-card",
287
- account: P,
288
- isDefault: P.isDefault ?? !1,
289
- onEdit: () => P && Q(`/settings?billingAccountId=${P.id}`),
290
- onViewTransactions: () => Q(`/transactions/${P.id}`),
291
- onViewCreditTransactions: () => Q(`/creditTransactions/${P.id}`)
284
+ account: I,
285
+ isDefault: I.isDefault ?? !1,
286
+ onEdit: () => I && Q(`/settings?billingAccountId=${I.id}`),
287
+ onViewTransactions: () => Q(`/transactions/${I.id}`),
288
+ onViewCreditTransactions: () => Q(`/creditTransactions/${I.id}`)
292
289
  }),
293
290
  /* @__PURE__ */ h("div", {
294
291
  className: "space-y-3",
295
- children: [I.length > 1 && /* @__PURE__ */ h("div", {
292
+ children: [R.length > 1 && /* @__PURE__ */ h("div", {
296
293
  className: "relative",
297
294
  children: [/* @__PURE__ */ h("button", {
298
295
  type: "button",
299
- onClick: () => M(!j),
300
- className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-subtle rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
296
+ onClick: () => P(!N),
297
+ className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-seam rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
301
298
  children: [/* @__PURE__ */ h("div", {
302
299
  className: "flex items-center gap-3",
303
300
  children: [/* @__PURE__ */ m("div", {
304
301
  className: "size-9 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
305
- children: /* @__PURE__ */ m(l, { className: "size-4 text-text-link" })
302
+ children: /* @__PURE__ */ m(ye, { className: "size-4 text-text-link" })
306
303
  }), /* @__PURE__ */ h("div", {
307
304
  className: "text-left",
308
305
  children: [/* @__PURE__ */ h("p", {
@@ -318,29 +315,29 @@ var g = () => {
318
315
  }), /* @__PURE__ */ h("p", {
319
316
  className: "text-xs text-text-secondary",
320
317
  children: [
321
- I.length,
318
+ R.length,
322
319
  " ",
323
320
  _("billing.overview.activeSubscriptions", "active subscriptions")
324
321
  ]
325
322
  })]
326
323
  })]
327
- }), /* @__PURE__ */ m(ye, { className: `size-4 text-text-muted transition-transform ${j ? "rotate-180" : ""}` })]
328
- }), j && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
324
+ }), /* @__PURE__ */ m(u, { className: `size-4 text-text-muted transition-transform ${N ? "rotate-180" : ""}` })]
325
+ }), N && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
329
326
  className: "fixed inset-0 z-10",
330
- onClick: () => M(!1)
327
+ onClick: () => P(!1)
331
328
  }), /* @__PURE__ */ m("div", {
332
- className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-subtle rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
333
- children: I.map((e, t) => /* @__PURE__ */ h("button", {
329
+ className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
330
+ children: R.map((e, t) => /* @__PURE__ */ h("button", {
334
331
  type: "button",
335
332
  onClick: () => {
336
- ke(t), M(!1);
333
+ M(t), P(!1);
337
334
  },
338
335
  className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
339
336
  children: [/* @__PURE__ */ h("div", {
340
337
  className: "flex items-center gap-3 min-w-0",
341
338
  children: [/* @__PURE__ */ m("div", {
342
339
  className: "size-9 rounded-lg bg-bg-sunken flex items-center justify-center flex-shrink-0",
343
- children: /* @__PURE__ */ m(l, { className: "size-4 text-text-secondary" })
340
+ children: /* @__PURE__ */ m(ye, { className: "size-4 text-text-secondary" })
344
341
  }), /* @__PURE__ */ h("div", {
345
342
  className: "text-left min-w-0",
346
343
  children: [/* @__PURE__ */ m("p", {
@@ -358,32 +355,32 @@ var g = () => {
358
355
  ]
359
356
  })]
360
357
  })]
361
- }), Oe === t && /* @__PURE__ */ m(ve, { className: "size-4 text-text-link flex-shrink-0" })]
358
+ }), j === t && /* @__PURE__ */ m(l, { className: "size-4 text-text-link flex-shrink-0" })]
362
359
  }, e.id))
363
360
  })] })]
364
361
  }), /* @__PURE__ */ m(de, {
365
362
  dataTour: "billing-overview-active-subscription-card",
366
363
  subscription: Z,
367
- onViewDetails: () => Z && Q(i(`/subscriptions/${Z.id}`, Z.billingAccountId ?? P?.id)),
368
- onUpgrade: () => Z && Q(i(`/subscriptions/${Z.id}/upgrade`, Z.billingAccountId ?? P?.id)),
369
- onManage: () => P && Q(`/subscriptions?billingAccountId=${P.id}`),
364
+ onViewDetails: () => Z && Q(i(`/subscriptions/${Z.id}`, Z.billingAccountId ?? I?.id)),
365
+ onUpgrade: () => Z && Q(i(`/subscriptions/${Z.id}/upgrade`, Z.billingAccountId ?? I?.id)),
366
+ onManage: () => I && Q(`/subscriptions?billingAccountId=${I.id}`),
370
367
  onPurchasePlan: () => Q("/plans")
371
368
  })]
372
369
  }),
373
- P && /* @__PURE__ */ m(ue, {
370
+ I && /* @__PURE__ */ m(ue, {
374
371
  dataTour: "billing-overview-payment-methods-section",
375
- paymentMethods: F,
376
- billingAccountId: P.id,
377
- onAddPaymentMethod: Fe,
378
- onSetDefault: Le,
379
- onDelete: Re,
380
- isLoading: R
372
+ paymentMethods: L,
373
+ billingAccountId: I.id,
374
+ onAddPaymentMethod: Re,
375
+ onSetDefault: Be,
376
+ onDelete: Ve,
377
+ isLoading: B
381
378
  })
382
379
  ]
383
380
  }), /* @__PURE__ */ h("div", {
384
381
  className: "space-y-6",
385
382
  children: [/* @__PURE__ */ h("section", {
386
- className: "border border-border-subtle rounded-card bg-bg-surface shadow-elevation-1 p-5",
383
+ className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 p-5",
387
384
  "data-tour": "billing-overview-quick-actions",
388
385
  children: [/* @__PURE__ */ m("h3", {
389
386
  className: "font-semibold text-text-primary mb-4",
@@ -393,8 +390,8 @@ var g = () => {
393
390
  children: [
394
391
  /* @__PURE__ */ h("button", {
395
392
  type: "button",
396
- onClick: () => P && Q(`/transactions/${P.id}`),
397
- disabled: !P,
393
+ onClick: () => I && Q(`/transactions/${I.id}`),
394
+ disabled: !I,
398
395
  className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
399
396
  children: [/* @__PURE__ */ m("div", {
400
397
  className: "size-9 rounded-lg bg-status-info-bg-subtle flex items-center justify-center",
@@ -403,8 +400,8 @@ var g = () => {
403
400
  }),
404
401
  /* @__PURE__ */ h("button", {
405
402
  type: "button",
406
- onClick: () => P && Q(`/creditTransactions/${P.id}`),
407
- disabled: !P,
403
+ onClick: () => I && Q(`/creditTransactions/${I.id}`),
404
+ disabled: !I,
408
405
  className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
409
406
  children: [/* @__PURE__ */ m("div", {
410
407
  className: "size-9 rounded-lg bg-status-warning-bg-subtle flex items-center justify-center",
@@ -417,13 +414,13 @@ var g = () => {
417
414
  className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors",
418
415
  children: [/* @__PURE__ */ m("div", {
419
416
  className: "size-9 rounded-lg bg-status-success-bg-subtle flex items-center justify-center",
420
- children: /* @__PURE__ */ m(be, { className: "size-4 text-status-success-text" })
417
+ children: /* @__PURE__ */ m(ve, { className: "size-4 text-status-success-text" })
421
418
  }), "Purchase Credits"]
422
419
  }),
423
420
  /* @__PURE__ */ h("button", {
424
421
  type: "button",
425
- onClick: () => P && Q(`/usage?billingAccountId=${P.id}`),
426
- disabled: !P,
422
+ onClick: () => I && Q(`/usage?billingAccountId=${I.id}`),
423
+ disabled: !I,
427
424
  className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
428
425
  children: [/* @__PURE__ */ m("div", {
429
426
  className: "size-9 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
@@ -432,8 +429,8 @@ var g = () => {
432
429
  })
433
430
  ]
434
431
  })]
435
- }), !L && /* @__PURE__ */ h("section", {
436
- className: "border border-border-subtle rounded-card bg-[var(--color-accent-soft)] shadow-elevation-1 p-5",
432
+ }), !z && /* @__PURE__ */ h(De, {
433
+ className: "p-5",
437
434
  children: [/* @__PURE__ */ h("div", {
438
435
  className: "flex items-start gap-3 mb-4",
439
436
  children: [/* @__PURE__ */ m("div", {
@@ -446,10 +443,10 @@ var g = () => {
446
443
  className: "text-sm text-text-secondary mt-1",
447
444
  children: "Choose a plan that fits your needs to unlock all features"
448
445
  })] })]
449
- }), /* @__PURE__ */ h("button", {
446
+ }), /* @__PURE__ */ h(Te, {
450
447
  type: "button",
451
448
  onClick: () => Q("/plans"),
452
- className: "w-full flex items-center justify-center gap-2 px-4 py-2.5 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
449
+ className: "w-full",
453
450
  children: ["Browse Plans", /* @__PURE__ */ m(_e, { className: "size-4" })]
454
451
  })]
455
452
  })]
@@ -457,18 +454,18 @@ var g = () => {
457
454
  }),
458
455
  /* @__PURE__ */ m(fe, {
459
456
  dataTour: "billing-overview-recommended-addons",
460
- addons: Ae,
461
- hasSubscription: L,
457
+ addons: je,
458
+ hasSubscription: z,
462
459
  onViewAddon: (e) => Q(`/addons/${e}`),
463
460
  onPurchaseAddon: (e) => Q(`/addons/${e}?action=purchase`),
464
461
  onViewAllAddons: () => Q("/addons"),
465
- onAddToCart: Ve,
466
- isInCart: He,
467
- getCartQuantity: Ue,
468
- onUpdateQuantity: We,
469
- onRemoveFromCart: Ge,
462
+ onAddToCart: We,
463
+ isInCart: Ge,
464
+ getCartQuantity: Ke,
465
+ onUpdateQuantity: qe,
466
+ onRemoveFromCart: Je,
470
467
  maxAddons: 3,
471
- isLoading: je
468
+ isLoading: Me
472
469
  }),
473
470
  /* @__PURE__ */ m(he, {}),
474
471
  /* @__PURE__ */ m(r, {
@@ -476,17 +473,17 @@ var g = () => {
476
473
  onClose: () => {
477
474
  T(!1), D(null);
478
475
  },
479
- onSubmit: Pe,
480
- isSubmitting: Ne,
476
+ onSubmit: Le,
477
+ isSubmitting: Ie,
481
478
  error: E
482
479
  }),
483
- P && /* @__PURE__ */ m(pe, {
484
- isOpen: De,
480
+ I && /* @__PURE__ */ m(pe, {
481
+ isOpen: Ae,
485
482
  onClose: () => A(!1),
486
- billingAccountId: P.id,
487
- currency: P.currency,
488
- country: P.billingAddresses?.[0]?.country,
489
- onSuccess: Ie
483
+ billingAccountId: I.id,
484
+ currency: I.currency,
485
+ country: I.billingAddresses?.[0]?.country,
486
+ onSuccess: ze
490
487
  })
491
488
  ]
492
489
  }) : /* @__PURE__ */ m(t, { message: "You don't have permission to view billing information." });