@burdenoff/microfe-billing 2026.625.3 → 2026.625.5

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 (98) hide show
  1. package/dist/billing/lib/native-purchases.js +2 -44
  2. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
  5. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
  7. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
  9. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  10. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
  11. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  12. package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
  13. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  14. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
  15. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  16. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
  17. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
  19. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  20. package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
  21. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  22. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
  23. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  24. package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
  25. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
  27. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
  29. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
  33. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  34. package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
  35. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  36. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
  37. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
  41. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  42. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
  43. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  44. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
  45. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  46. package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
  47. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  48. package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
  49. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
  51. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  52. package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
  53. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  54. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
  55. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  56. package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
  57. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  58. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
  59. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  60. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
  63. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  64. package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
  65. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  66. package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
  67. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  68. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
  69. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  70. package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
  71. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
  73. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  74. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
  75. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  76. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
  77. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
  78. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  79. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
  80. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  81. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
  82. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  83. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
  84. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  85. package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
  86. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  87. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
  88. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  89. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
  90. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  91. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
  92. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  93. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
  94. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  95. package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
  96. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  97. package/package.json +2 -2
  98. package/dist/billing/lib/native-purchases.js.map +0 -1
@@ -9,69 +9,69 @@ import { PricingModel as o } from "../../../shared/types/graphql.js";
9
9
  import { formatBytes as s, formatCurrency as c, formatDate as l, formatPercentage as u, formatPlanDuration as d, formatSubscriptionStatus as ee } from "../../../shared/utils/format.js";
10
10
  import { getQuotaProgressColor as f, getSubscriptionStatusColor as te } from "../../../shared/utils/status.js";
11
11
  import { useBillingPermissions as ne } from "../../../hooks/useBillingPermissions.js";
12
- import { useGetDefaultBillingAccountDashboardQuery as re } from "../../../../generated/global-operations.js";
13
- import { useBillingNavigate as ie } from "../../../hooks/useBillingNavigate.js";
14
- import { withBillingAccountId as p } from "../../../shared/utils/navigation.js";
15
- import { useWorkspaceQuotaOverview as ae } from "../../usage/hooks/useUsage.js";
16
- import { WorkspaceQuotaAssignmentModal as oe } from "../../checkout/components/WorkspaceQuotaAssignmentModal.js";
17
- import { useSubscription as se, useSubscriptionMutations as m } from "../hooks/useSubscriptions.js";
12
+ import { useGetDefaultBillingAccountDashboardQuery as p } from "../../../../generated/global-operations.js";
13
+ import { useBillingNavigate as re } from "../../../hooks/useBillingNavigate.js";
14
+ import { withBillingAccountId as m } from "../../../shared/utils/navigation.js";
15
+ import { useWorkspaceQuotaOverview as ie } from "../../usage/hooks/useUsage.js";
16
+ import { WorkspaceQuotaAssignmentModal as h } from "../../checkout/components/WorkspaceQuotaAssignmentModal.js";
17
+ import { useSubscription as g, useSubscriptionMutations as ae } from "../hooks/useSubscriptions.js";
18
18
  import "../hooks/index.js";
19
- import { ManageSeatsModal as h } from "../components/ManageSeatsModal.js";
20
- import { useState as g } from "react";
21
- import { useParams as ce } from "react-router-dom";
22
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
23
- import { useI18n as le } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
24
- import { CTAOverflowMenu as ue, EmphasisPanel as de } from "@burdenoff/fe-libs/ui";
19
+ import { ManageSeatsModal as oe } from "../components/ManageSeatsModal.js";
20
+ import { useState as _ } from "react";
21
+ import { useParams as se } from "react-router-dom";
22
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
23
+ import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
24
+ import { CTAOverflowMenu as ce, EmphasisPanel as le, NextSteps as ue, PagePurpose as x } from "@burdenoff/fe-libs/ui";
25
25
  //#region src/billing/modules/subscriptions/pages/SubscriptionDetailPage.tsx
26
- function y(e, t) {
26
+ function S(e, t) {
27
27
  if (t?.displayName && typeof t.displayName == "string") return t.displayName;
28
28
  if (t?.label && typeof t.label == "string") return t.label;
29
29
  let n = e.split(".");
30
30
  return (n.length > 1 ? n.slice(1) : n).map((e) => e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase())).join(" ");
31
31
  }
32
- function b(e) {
32
+ function C(e) {
33
33
  return e === "DAILY" ? "Resets daily" : e === "MONTHLY" ? "Resets monthly" : "";
34
34
  }
35
- var x = () => {
36
- let { t: s } = le(), u = (e, t) => {
35
+ var w = () => {
36
+ let { t: s } = b(), u = (e, t) => {
37
37
  let n = s(e);
38
38
  return n === e ? t : n;
39
- }, { subscriptionId: f } = ce(), y = ie(), { emit: b } = i(), { orgId: x } = e(), S = ne(), { selectedAccountId: _e } = a({
40
- orgId: x,
39
+ }, { subscriptionId: f } = se(), S = re(), { emit: C } = i(), { orgId: w } = e(), T = ne(), { selectedAccountId: ge } = a({
40
+ orgId: w,
41
41
  syncFromUrl: !0,
42
42
  urlParamName: "billingAccountId"
43
- }), { data: ve } = re({ fetchPolicy: "cache-first" }), C = _e ?? ve?.getDefaultBillingAccount?.id ?? void 0, { subscription: w, isLoading: ye, error: T, refetch: E } = se(f, C), { cancelSubscription: D, isCanceling: O, updateSubscriptionSeats: k, isUpdatingSeats: A } = m(), { workspaceId: j } = e(), { overview: M, refetch: N } = ae(j ?? void 0), [P, F] = g(!1), [I, L] = g(!1), [be, R] = g(!1), [z, B] = g(""), [V, H] = g(null), xe = async () => {
44
- if (w) {
43
+ }), { data: _e } = p({ fetchPolicy: "cache-first" }), E = ge ?? _e?.getDefaultBillingAccount?.id ?? void 0, { subscription: D, isLoading: ve, error: O, refetch: k } = g(f, E), { cancelSubscription: A, isCanceling: j, updateSubscriptionSeats: M, isUpdatingSeats: N } = ae(), { workspaceId: P } = e(), { overview: F, refetch: ye } = ie(P ?? void 0), [be, I] = _(!1), [xe, L] = _(!1), [Se, R] = _(!1), [z, B] = _(""), [V, H] = _(null), Ce = async () => {
44
+ if (D) {
45
45
  H(null);
46
46
  try {
47
- await D({
48
- billingAccountId: C ?? w.billingAccountId,
49
- subscriptionId: w.id,
47
+ await A({
48
+ billingAccountId: E ?? D.billingAccountId,
49
+ subscriptionId: D.id,
50
50
  reason: z || "User requested cancellation"
51
- }), b("billing.subscription.cancelled", {
51
+ }), C("billing.subscription.cancelled", {
52
52
  route: "/billing/subscriptions",
53
- entityId: w.id,
53
+ entityId: D.id,
54
54
  source: "subscription-detail",
55
55
  reason: z || "User requested cancellation"
56
- }), F(!1), B(""), await E();
56
+ }), I(!1), B(""), await k();
57
57
  } catch (e) {
58
58
  H(e instanceof Error ? e.message : "Failed to cancel subscription");
59
59
  }
60
60
  }
61
61
  };
62
- if (!S.canViewSubscriptions) return /* @__PURE__ */ _("div", {
62
+ if (!T.canViewSubscriptions) return /* @__PURE__ */ v("div", {
63
63
  className: "flex items-center justify-center h-full min-h-[400px]",
64
- children: /* @__PURE__ */ v("div", {
64
+ children: /* @__PURE__ */ y("div", {
65
65
  className: "text-center space-y-2",
66
66
  children: [
67
- /* @__PURE__ */ _("div", {
67
+ /* @__PURE__ */ v("div", {
68
68
  className: "size-12 mx-auto rounded-full bg-[var(--color-accent-soft)] flex items-center justify-center",
69
- children: /* @__PURE__ */ _("svg", {
69
+ children: /* @__PURE__ */ v("svg", {
70
70
  className: "size-6 text-text-secondary",
71
71
  fill: "none",
72
72
  viewBox: "0 0 24 24",
73
73
  stroke: "currentColor",
74
- children: /* @__PURE__ */ _("path", {
74
+ children: /* @__PURE__ */ v("path", {
75
75
  strokeLinecap: "round",
76
76
  strokeLinejoin: "round",
77
77
  strokeWidth: 2,
@@ -79,46 +79,46 @@ var x = () => {
79
79
  })
80
80
  })
81
81
  }),
82
- /* @__PURE__ */ _("h2", {
82
+ /* @__PURE__ */ v("h2", {
83
83
  className: "text-lg font-semibold text-text-primary",
84
84
  children: "Access Denied"
85
85
  }),
86
- /* @__PURE__ */ _("p", {
86
+ /* @__PURE__ */ v("p", {
87
87
  className: "text-sm text-text-secondary max-w-sm",
88
88
  children: "You don't have permission to view this subscription."
89
89
  })
90
90
  ]
91
91
  })
92
92
  });
93
- if (ye) return /* @__PURE__ */ v("div", {
93
+ if (ve) return /* @__PURE__ */ y("div", {
94
94
  className: "space-y-6 px-6 lg:px-8 py-6",
95
- children: [/* @__PURE__ */ v("div", {
95
+ children: [/* @__PURE__ */ y("div", {
96
96
  className: "flex items-center gap-4",
97
- children: [/* @__PURE__ */ _("div", { className: "size-10 bg-bg-sunken animate-pulse rounded-button" }), /* @__PURE__ */ _("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" })]
98
- }), /* @__PURE__ */ _("div", {
97
+ children: [/* @__PURE__ */ v("div", { className: "size-10 bg-bg-sunken animate-pulse rounded-button" }), /* @__PURE__ */ v("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" })]
98
+ }), /* @__PURE__ */ v("div", {
99
99
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
100
- children: /* @__PURE__ */ _("div", {
100
+ children: /* @__PURE__ */ v("div", {
101
101
  className: "lg:col-span-2 space-y-6",
102
- children: /* @__PURE__ */ v("div", {
102
+ children: /* @__PURE__ */ y("div", {
103
103
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 p-5 space-y-4",
104
- children: [/* @__PURE__ */ _("div", { className: "h-6 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ _("div", { className: "h-4 w-full bg-bg-sunken animate-pulse rounded" })]
104
+ children: [/* @__PURE__ */ v("div", { className: "h-6 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ v("div", { className: "h-4 w-full bg-bg-sunken animate-pulse rounded" })]
105
105
  })
106
106
  })
107
107
  })]
108
108
  });
109
- if (T || !w) return /* @__PURE__ */ _("div", {
109
+ if (O || !D) return /* @__PURE__ */ v("div", {
110
110
  className: "flex items-center justify-center h-full min-h-[400px]",
111
- children: /* @__PURE__ */ v("div", {
111
+ children: /* @__PURE__ */ y("div", {
112
112
  className: "text-center space-y-4",
113
113
  children: [
114
- /* @__PURE__ */ _("div", {
114
+ /* @__PURE__ */ v("div", {
115
115
  className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
116
- children: /* @__PURE__ */ _("svg", {
116
+ children: /* @__PURE__ */ v("svg", {
117
117
  className: "size-6 text-status-error-text",
118
118
  fill: "none",
119
119
  viewBox: "0 0 24 24",
120
120
  stroke: "currentColor",
121
- children: /* @__PURE__ */ _("path", {
121
+ children: /* @__PURE__ */ v("path", {
122
122
  strokeLinecap: "round",
123
123
  strokeLinejoin: "round",
124
124
  strokeWidth: 2,
@@ -126,121 +126,153 @@ var x = () => {
126
126
  })
127
127
  })
128
128
  }),
129
- /* @__PURE__ */ _("h2", {
129
+ /* @__PURE__ */ v("h2", {
130
130
  className: "text-lg font-semibold text-text-primary",
131
131
  children: u("billing.subscriptions.notFound", "Subscription not found")
132
132
  }),
133
- /* @__PURE__ */ _("p", {
133
+ /* @__PURE__ */ v("p", {
134
134
  className: "text-sm text-text-secondary",
135
- children: T?.message || "The subscription you are looking for does not exist."
135
+ children: O?.message || "The subscription you are looking for does not exist."
136
136
  }),
137
- /* @__PURE__ */ _("button", {
137
+ /* @__PURE__ */ v("button", {
138
138
  type: "button",
139
- onClick: () => y(p("/subscriptions", C)),
139
+ onClick: () => S(m("/subscriptions", E)),
140
140
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
141
141
  children: "Back to Subscriptions"
142
142
  })
143
143
  ]
144
144
  })
145
145
  });
146
- let U = w.plan, W = w.quotas || [], G = w.addonSubscriptions || [], K = w.transactions || [], q = w.history || [], Se = te(w.status), J = w.status === "active", Y = M.filter((e) => e.assignment.subscriptionId === w.id && e.assignment.isActive), X = !!w.assignedWorkspaceId || Y.length > 0, Z = new Date(w.endDate), Ce = new Date(w.startDate), we = /* @__PURE__ */ new Date(), Q = Math.ceil((Z.getTime() - Ce.getTime()) / (1e3 * 60 * 60 * 24)), $ = Math.max(0, Math.ceil((Z.getTime() - we.getTime()) / (1e3 * 60 * 60 * 24))), Te = Math.round((Q - $) / Q * 100);
147
- return /* @__PURE__ */ v("div", {
146
+ let U = D.plan, W = D.quotas || [], G = D.addonSubscriptions || [], K = D.transactions || [], q = D.history || [], we = te(D.status), J = D.status === "active", Y = F.filter((e) => e.assignment.subscriptionId === D.id && e.assignment.isActive), X = !!D.assignedWorkspaceId || Y.length > 0, Z = new Date(D.endDate), Te = new Date(D.startDate), Ee = /* @__PURE__ */ new Date(), Q = Math.ceil((Z.getTime() - Te.getTime()) / (1e3 * 60 * 60 * 24)), $ = Math.max(0, Math.ceil((Z.getTime() - Ee.getTime()) / (1e3 * 60 * 60 * 24))), De = Math.round((Q - $) / Q * 100), Oe = [
147
+ ...J && T.canUpdateSubscription ? [{
148
+ id: "change-plan",
149
+ label: "Review or change your plan",
150
+ description: "Upgrade, downgrade, or compare what each tier includes.",
151
+ onClick: () => S(m(`/subscriptions/${D.id}/upgrade`, E ?? D.billingAccountId))
152
+ }] : [],
153
+ ...J && P && !X ? [{
154
+ id: "activate-workspace",
155
+ label: "Activate quotas for your workspace",
156
+ description: "Turn on the workspace-scoped limits included in this plan.",
157
+ onClick: () => R(!0)
158
+ }] : [],
159
+ {
160
+ id: "track-usage",
161
+ label: "Track your usage",
162
+ description: "See how much of your included quota you have consumed.",
163
+ onClick: () => S(m("/usage", E ?? D.billingAccountId))
164
+ },
165
+ {
166
+ id: "view-invoices",
167
+ label: "Review invoices & payments",
168
+ description: "Check what has been billed for this subscription.",
169
+ onClick: () => S(m("/invoices", E ?? D.billingAccountId))
170
+ }
171
+ ];
172
+ return /* @__PURE__ */ y("div", {
148
173
  className: "space-y-6 px-6 lg:px-8 py-6",
149
174
  children: [
150
- /* @__PURE__ */ v("div", {
175
+ /* @__PURE__ */ y("div", {
151
176
  className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
152
- children: [/* @__PURE__ */ v("div", {
177
+ children: [/* @__PURE__ */ y("div", {
153
178
  className: "flex items-start gap-4",
154
- children: [/* @__PURE__ */ _("button", {
179
+ children: [/* @__PURE__ */ v("button", {
155
180
  type: "button",
156
181
  "aria-label": "Back to subscriptions",
157
- onClick: () => y(p("/subscriptions", C)),
182
+ onClick: () => S(m("/subscriptions", E)),
158
183
  className: "p-2 -ml-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
159
- children: /* @__PURE__ */ _("svg", {
184
+ children: /* @__PURE__ */ v("svg", {
160
185
  className: "size-5",
161
186
  fill: "none",
162
187
  viewBox: "0 0 24 24",
163
188
  stroke: "currentColor",
164
- children: /* @__PURE__ */ _("path", {
189
+ children: /* @__PURE__ */ v("path", {
165
190
  strokeLinecap: "round",
166
191
  strokeLinejoin: "round",
167
192
  strokeWidth: 2,
168
193
  d: "M15 19l-7-7 7-7"
169
194
  })
170
195
  })
171
- }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("div", {
172
- className: "flex items-center gap-3 flex-wrap",
173
- children: [/* @__PURE__ */ _("h1", {
174
- className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
175
- children: U?.name || "Subscription"
176
- }), /* @__PURE__ */ _(n, {
177
- status: Se,
178
- dot: !0,
179
- pulse: J,
180
- children: ee(w.status)
181
- })]
182
- }), /* @__PURE__ */ _("p", {
183
- className: "text-sm text-text-secondary mt-1",
184
- children: U?.pricingModel === o.PER_SEAT && U.pricePerSeat ? `${c(U.pricePerSeat, U.currency)} / seat / ${d(U.duration)} · ${w.seatCount ?? U.minSeats ?? 1} seats = ${c(U.pricePerSeat * (w.seatCount ?? U.minSeats ?? 1), U.currency)} / ${d(U.duration)}` : U ? `${c(U.price, U.currency)} / ${d(U.duration)}` : "Unknown plan"
185
- })] })]
186
- }), /* @__PURE__ */ v("div", {
196
+ }), /* @__PURE__ */ y("div", { children: [
197
+ /* @__PURE__ */ y("div", {
198
+ className: "flex items-center gap-3 flex-wrap",
199
+ children: [/* @__PURE__ */ v("h1", {
200
+ className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
201
+ children: U?.name || "Subscription"
202
+ }), /* @__PURE__ */ v(n, {
203
+ status: we,
204
+ dot: !0,
205
+ pulse: J,
206
+ children: ee(D.status)
207
+ })]
208
+ }),
209
+ /* @__PURE__ */ v("p", {
210
+ className: "text-sm text-text-secondary mt-1",
211
+ children: U?.pricingModel === o.PER_SEAT && U.pricePerSeat ? `${c(U.pricePerSeat, U.currency)} / seat / ${d(U.duration)} · ${D.seatCount ?? U.minSeats ?? 1} seats = ${c(U.pricePerSeat * (D.seatCount ?? U.minSeats ?? 1), U.currency)} / ${d(U.duration)}` : U ? `${c(U.price, U.currency)} / ${d(U.duration)}` : "Unknown plan"
212
+ }),
213
+ /* @__PURE__ */ v(x, {
214
+ className: "mt-3",
215
+ children: u("billing.subscriptions.detailPurpose", "Everything about this subscription in one view — its billing period, the quotas and add-ons it includes, recent charges and its full status history. Use it to track what you are getting, activate workspace quotas, change your plan, or cancel.")
216
+ })
217
+ ] })]
218
+ }), /* @__PURE__ */ y("div", {
187
219
  className: "flex items-center gap-2",
188
- children: [/* @__PURE__ */ _(ue, {
189
- primary: J && S.canUpdateSubscription ? {
220
+ children: [/* @__PURE__ */ v(ce, {
221
+ primary: J && T.canUpdateSubscription ? {
190
222
  label: "Change Plan",
191
- onSelect: () => y(p(`/subscriptions/${w.id}/upgrade`, C ?? w.billingAccountId))
223
+ onSelect: () => S(m(`/subscriptions/${D.id}/upgrade`, E ?? D.billingAccountId))
192
224
  } : void 0,
193
- actions: [...J && S.canUpdateSubscription && U?.pricingModel === o.PER_SEAT ? [{
225
+ actions: [...J && T.canUpdateSubscription && U?.pricingModel === o.PER_SEAT ? [{
194
226
  label: "Manage Seats",
195
227
  onSelect: () => L(!0)
196
- }] : [], ...J && S.canCancelSubscription && !w.canceledAt ? [{
197
- label: O ? "Canceling…" : "Cancel Subscription",
198
- onSelect: () => F(!0),
199
- disabled: O,
228
+ }] : [], ...J && T.canCancelSubscription && !D.canceledAt ? [{
229
+ label: j ? "Canceling…" : "Cancel Subscription",
230
+ onSelect: () => I(!0),
231
+ disabled: j,
200
232
  intent: "destructive"
201
233
  }] : []]
202
- }), w.canceledAt && /* @__PURE__ */ _("span", {
234
+ }), D.canceledAt && /* @__PURE__ */ v("span", {
203
235
  className: "px-4 py-2 text-sm font-medium text-status-warning-text bg-status-warning-bg-subtle rounded-button",
204
236
  children: "Cancellation Scheduled"
205
237
  })]
206
238
  })]
207
239
  }),
208
- /* @__PURE__ */ v("div", {
240
+ /* @__PURE__ */ y("div", {
209
241
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
210
- children: [/* @__PURE__ */ v("div", {
242
+ children: [/* @__PURE__ */ y("div", {
211
243
  className: "lg:col-span-2 space-y-6",
212
244
  children: [
213
- J && /* @__PURE__ */ v(de, {
245
+ J && /* @__PURE__ */ y(le, {
214
246
  className: "p-5",
215
- children: [/* @__PURE__ */ v("div", {
247
+ children: [/* @__PURE__ */ y("div", {
216
248
  className: "flex items-center justify-between mb-4",
217
- children: [/* @__PURE__ */ _("h2", {
249
+ children: [/* @__PURE__ */ v("h2", {
218
250
  className: "text-base font-semibold text-text-primary",
219
251
  children: "Current Period"
220
- }), /* @__PURE__ */ v("span", {
252
+ }), /* @__PURE__ */ y("span", {
221
253
  className: "text-sm text-text-secondary tabular-nums",
222
254
  children: [$, " days remaining"]
223
255
  })]
224
- }), /* @__PURE__ */ v("div", {
256
+ }), /* @__PURE__ */ y("div", {
225
257
  className: "space-y-2",
226
- children: [/* @__PURE__ */ _(r, {
227
- value: Te,
258
+ children: [/* @__PURE__ */ v(r, {
259
+ value: De,
228
260
  status: "primary",
229
261
  size: "md",
230
262
  "aria-label": "Billing period progress"
231
- }), /* @__PURE__ */ v("div", {
263
+ }), /* @__PURE__ */ y("div", {
232
264
  className: "flex items-center justify-between text-sm text-text-secondary",
233
- children: [/* @__PURE__ */ _("span", { children: l(w.startDate, "short") }), /* @__PURE__ */ _("span", { children: l(w.endDate, "short") })]
265
+ children: [/* @__PURE__ */ v("span", { children: l(D.startDate, "short") }), /* @__PURE__ */ v("span", { children: l(D.endDate, "short") })]
234
266
  })]
235
267
  })]
236
268
  }),
237
- /* @__PURE__ */ v(t, {
269
+ /* @__PURE__ */ y(t, {
238
270
  className: "overflow-hidden",
239
- children: [/* @__PURE__ */ v("div", {
271
+ children: [/* @__PURE__ */ y("div", {
240
272
  className: "p-5 border-b border-border-subtle",
241
- children: [/* @__PURE__ */ v("h2", {
273
+ children: [/* @__PURE__ */ y("h2", {
242
274
  className: "text-base font-semibold text-text-primary",
243
- children: ["Plan Quotas", W.length > 0 && /* @__PURE__ */ v("span", {
275
+ children: ["Plan Quotas", W.length > 0 && /* @__PURE__ */ y("span", {
244
276
  className: "ml-2 text-sm font-normal text-text-muted tabular-nums",
245
277
  children: [
246
278
  "(",
@@ -248,84 +280,84 @@ var x = () => {
248
280
  ")"
249
281
  ]
250
282
  })]
251
- }), /* @__PURE__ */ _("p", {
283
+ }), /* @__PURE__ */ v("p", {
252
284
  className: "text-sm text-text-secondary mt-0.5",
253
285
  children: "Limits included in your plan"
254
286
  })]
255
- }), /* @__PURE__ */ _("div", {
287
+ }), /* @__PURE__ */ v("div", {
256
288
  className: "p-5",
257
- children: W.length === 0 ? /* @__PURE__ */ _("p", {
289
+ children: W.length === 0 ? /* @__PURE__ */ v("p", {
258
290
  className: "text-sm text-text-secondary",
259
291
  children: "No quotas assigned to this subscription."
260
- }) : /* @__PURE__ */ _("div", {
292
+ }) : /* @__PURE__ */ v("div", {
261
293
  className: "space-y-3",
262
- children: W.map((e) => /* @__PURE__ */ _(fe, { quota: e }, e.id))
294
+ children: W.map((e) => /* @__PURE__ */ v(de, { quota: e }, e.id))
263
295
  })
264
296
  })]
265
297
  }),
266
- J && j && /* @__PURE__ */ v(t, {
298
+ J && P && /* @__PURE__ */ y(t, {
267
299
  className: "overflow-hidden",
268
300
  children: [
269
- /* @__PURE__ */ v("div", {
301
+ /* @__PURE__ */ y("div", {
270
302
  className: "p-5 border-b border-border-subtle flex items-center justify-between gap-4",
271
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h2", {
303
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h2", {
272
304
  className: "text-base font-semibold text-text-primary",
273
305
  children: "Workspace Quotas"
274
- }), /* @__PURE__ */ _("p", {
306
+ }), /* @__PURE__ */ v("p", {
275
307
  className: "text-sm text-text-secondary mt-0.5",
276
308
  children: "Active limits for your workspace"
277
- })] }), X ? /* @__PURE__ */ _(n, {
309
+ })] }), X ? /* @__PURE__ */ v(n, {
278
310
  status: "success",
279
311
  dot: !0,
280
312
  children: "Active"
281
- }) : /* @__PURE__ */ _("button", {
313
+ }) : /* @__PURE__ */ v("button", {
282
314
  type: "button",
283
315
  onClick: () => R(!0),
284
316
  className: "px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
285
317
  children: "Activate for Workspace"
286
318
  })]
287
319
  }),
288
- /* @__PURE__ */ _("div", {
320
+ /* @__PURE__ */ v("div", {
289
321
  className: "p-5",
290
- children: X ? Y.length > 0 ? /* @__PURE__ */ _("div", {
322
+ children: X ? Y.length > 0 ? /* @__PURE__ */ v("div", {
291
323
  className: "space-y-3",
292
- children: Y.map((e) => /* @__PURE__ */ _(pe, { item: e }, e.assignment.id))
293
- }) : /* @__PURE__ */ v("p", {
324
+ children: Y.map((e) => /* @__PURE__ */ v(fe, { item: e }, e.assignment.id))
325
+ }) : /* @__PURE__ */ y("p", {
294
326
  className: "text-sm text-text-secondary",
295
327
  children: [
296
328
  "Quotas are activated on workspace",
297
329
  " ",
298
- /* @__PURE__ */ _("span", {
330
+ /* @__PURE__ */ v("span", {
299
331
  className: "font-mono text-xs text-text-primary bg-bg-sunken/60 rounded px-1.5 py-0.5",
300
- children: w.assignedWorkspaceId
332
+ children: D.assignedWorkspaceId
301
333
  }),
302
334
  ". Usage data will appear here once quotas are consumed."
303
335
  ]
304
- }) : /* @__PURE__ */ v("div", {
336
+ }) : /* @__PURE__ */ y("div", {
305
337
  className: "flex items-start gap-3",
306
- children: [/* @__PURE__ */ _("div", {
338
+ children: [/* @__PURE__ */ v("div", {
307
339
  className: "size-8 rounded-full bg-status-warning-bg-subtle flex items-center justify-center shrink-0 mt-0.5",
308
- children: /* @__PURE__ */ _("svg", {
340
+ children: /* @__PURE__ */ v("svg", {
309
341
  className: "size-4 text-status-warning-text",
310
342
  fill: "none",
311
343
  viewBox: "0 0 24 24",
312
344
  stroke: "currentColor",
313
- children: /* @__PURE__ */ _("path", {
345
+ children: /* @__PURE__ */ v("path", {
314
346
  strokeLinecap: "round",
315
347
  strokeLinejoin: "round",
316
348
  strokeWidth: 2,
317
349
  d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
318
350
  })
319
351
  })
320
- }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
352
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
321
353
  className: "text-sm font-medium text-text-primary",
322
354
  children: "Workspace quotas not activated yet"
323
- }), /* @__PURE__ */ v("p", {
355
+ }), /* @__PURE__ */ y("p", {
324
356
  className: "text-sm text-text-secondary mt-0.5",
325
357
  children: [
326
358
  "Click",
327
359
  " ",
328
- /* @__PURE__ */ _("button", {
360
+ /* @__PURE__ */ v("button", {
329
361
  type: "button",
330
362
  onClick: () => R(!0),
331
363
  className: "text-text-link hover:underline font-medium",
@@ -337,32 +369,32 @@ var x = () => {
337
369
  })] })]
338
370
  })
339
371
  }),
340
- be && /* @__PURE__ */ _(oe, {
341
- billingAccountId: C ?? w.billingAccountId,
342
- subscriptionId: w.id,
372
+ Se && /* @__PURE__ */ v(h, {
373
+ billingAccountId: E ?? D.billingAccountId,
374
+ subscriptionId: D.id,
343
375
  quotas: [],
344
376
  workspaces: [{
345
- id: j,
377
+ id: P,
346
378
  name: "Current workspace"
347
379
  }],
348
- currentWorkspaceId: j,
380
+ currentWorkspaceId: P,
349
381
  onAssigned: () => {
350
- R(!1), E(), N();
382
+ R(!1), k(), ye();
351
383
  },
352
384
  onSkip: () => R(!1)
353
385
  })
354
386
  ]
355
387
  }),
356
- G.length > 0 && /* @__PURE__ */ v(t, {
388
+ G.length > 0 && /* @__PURE__ */ y(t, {
357
389
  className: "overflow-hidden",
358
- children: [/* @__PURE__ */ _("div", {
390
+ children: [/* @__PURE__ */ v("div", {
359
391
  className: "p-5 border-b border-border-subtle",
360
- children: /* @__PURE__ */ v("h2", {
392
+ children: /* @__PURE__ */ y("h2", {
361
393
  className: "text-base font-semibold text-text-primary",
362
394
  children: [
363
395
  "Addons",
364
396
  " ",
365
- /* @__PURE__ */ v("span", {
397
+ /* @__PURE__ */ y("span", {
366
398
  className: "text-sm font-normal text-text-muted tabular-nums",
367
399
  children: [
368
400
  "(",
@@ -372,31 +404,31 @@ var x = () => {
372
404
  })
373
405
  ]
374
406
  })
375
- }), /* @__PURE__ */ _("div", {
407
+ }), /* @__PURE__ */ v("div", {
376
408
  className: "p-5",
377
- children: /* @__PURE__ */ _("div", {
409
+ children: /* @__PURE__ */ v("div", {
378
410
  className: "space-y-3",
379
- children: G.map((e) => /* @__PURE__ */ _(me, { addonSubscription: e }, e.id))
411
+ children: G.map((e) => /* @__PURE__ */ v(pe, { addonSubscription: e }, e.id))
380
412
  })
381
413
  })]
382
414
  }),
383
- K.length > 0 && /* @__PURE__ */ v(t, {
415
+ K.length > 0 && /* @__PURE__ */ y(t, {
384
416
  className: "overflow-hidden",
385
417
  children: [
386
- /* @__PURE__ */ _("div", {
418
+ /* @__PURE__ */ v("div", {
387
419
  className: "p-5 border-b border-border-subtle",
388
- children: /* @__PURE__ */ _("h2", {
420
+ children: /* @__PURE__ */ v("h2", {
389
421
  className: "text-base font-semibold text-text-primary",
390
422
  children: "Recent Transactions"
391
423
  })
392
424
  }),
393
- /* @__PURE__ */ _("div", {
425
+ /* @__PURE__ */ v("div", {
394
426
  className: "divide-y divide-border-subtle",
395
- children: K.slice(0, 5).map((e) => /* @__PURE__ */ _(he, { transaction: e }, e.id))
427
+ children: K.slice(0, 5).map((e) => /* @__PURE__ */ v(me, { transaction: e }, e.id))
396
428
  }),
397
- K.length > 5 && /* @__PURE__ */ _("div", {
429
+ K.length > 5 && /* @__PURE__ */ v("div", {
398
430
  className: "p-4 text-center border-t border-border-subtle",
399
- children: /* @__PURE__ */ _("button", {
431
+ children: /* @__PURE__ */ v("button", {
400
432
  type: "button",
401
433
  className: "text-sm text-text-link hover:underline",
402
434
  children: "View all transactions"
@@ -405,140 +437,147 @@ var x = () => {
405
437
  ]
406
438
  })
407
439
  ]
408
- }), /* @__PURE__ */ v("div", {
440
+ }), /* @__PURE__ */ y("div", {
409
441
  className: "space-y-6 lg:sticky lg:top-6 lg:self-start",
410
- children: [/* @__PURE__ */ v(t, {
411
- className: "overflow-hidden",
412
- children: [/* @__PURE__ */ _("div", {
413
- className: "p-5 border-b border-border-subtle",
414
- children: /* @__PURE__ */ _("h2", {
415
- className: "text-base font-semibold text-text-primary",
416
- children: "Details"
417
- })
418
- }), /* @__PURE__ */ v("div", {
419
- className: "p-5 space-y-4",
420
- children: [
421
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
422
- className: "text-sm text-text-secondary",
423
- children: "Subscription ID"
424
- }), /* @__PURE__ */ _("p", {
425
- className: "font-mono text-sm text-text-primary mt-0.5 break-all",
426
- children: w.id
427
- })] }),
428
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
429
- className: "text-sm text-text-secondary",
430
- children: "Plan"
431
- }), /* @__PURE__ */ _("p", {
432
- className: "text-sm text-text-primary mt-0.5",
433
- children: U?.name || "Unknown"
434
- })] }),
435
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
436
- className: "text-sm text-text-secondary",
437
- children: "Billing Account"
438
- }), /* @__PURE__ */ _("p", {
439
- className: "text-sm text-text-primary mt-0.5",
440
- children: w.billingAccount?.name || "Unknown"
441
- })] }),
442
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
443
- className: "text-sm text-text-secondary",
444
- children: "Start Date"
445
- }), /* @__PURE__ */ _("p", {
446
- className: "text-sm text-text-primary mt-0.5",
447
- children: l(w.startDate)
448
- })] }),
449
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
450
- className: "text-sm text-text-secondary",
451
- children: "End Date"
452
- }), /* @__PURE__ */ _("p", {
453
- className: "text-sm text-text-primary mt-0.5",
454
- children: l(w.endDate)
455
- })] }),
456
- w.nextBillingDate && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
457
- className: "text-sm text-text-secondary",
458
- children: "Next Billing"
459
- }), /* @__PURE__ */ _("p", {
460
- className: "text-sm text-text-primary mt-0.5",
461
- children: l(w.nextBillingDate)
462
- })] }),
463
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
464
- className: "text-sm text-text-secondary",
465
- children: "Auto Renewal"
466
- }), /* @__PURE__ */ _("p", {
467
- className: "text-sm text-text-primary mt-0.5",
468
- children: w.autoRenewal ? "Enabled" : "Disabled"
469
- })] }),
470
- w.paymentGateway && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
471
- className: "text-sm text-text-secondary",
472
- children: "Payment Gateway"
473
- }), /* @__PURE__ */ _("p", {
474
- className: "text-sm text-text-primary mt-0.5 capitalize",
475
- children: w.paymentGateway
476
- })] })
477
- ]
478
- })]
479
- }), q.length > 0 && /* @__PURE__ */ v(t, {
480
- className: "overflow-hidden",
481
- children: [/* @__PURE__ */ _("div", {
482
- className: "p-5 border-b border-border-subtle",
483
- children: /* @__PURE__ */ _("h2", {
484
- className: "text-base font-semibold text-text-primary",
485
- children: "History"
486
- })
487
- }), /* @__PURE__ */ _("div", {
488
- className: "p-5",
489
- children: /* @__PURE__ */ _("div", {
490
- className: "space-y-3",
491
- children: q.slice(0, 5).map((e) => /* @__PURE__ */ _(ge, { item: e }, e.id))
492
- })
493
- })]
494
- })]
442
+ children: [
443
+ /* @__PURE__ */ v(ue, {
444
+ storageKey: "billing-subscription-detail",
445
+ steps: Oe
446
+ }),
447
+ /* @__PURE__ */ y(t, {
448
+ className: "overflow-hidden",
449
+ children: [/* @__PURE__ */ v("div", {
450
+ className: "p-5 border-b border-border-subtle",
451
+ children: /* @__PURE__ */ v("h2", {
452
+ className: "text-base font-semibold text-text-primary",
453
+ children: "Details"
454
+ })
455
+ }), /* @__PURE__ */ y("div", {
456
+ className: "p-5 space-y-4",
457
+ children: [
458
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
459
+ className: "text-sm text-text-secondary",
460
+ children: "Subscription ID"
461
+ }), /* @__PURE__ */ v("p", {
462
+ className: "font-mono text-sm text-text-primary mt-0.5 break-all",
463
+ children: D.id
464
+ })] }),
465
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
466
+ className: "text-sm text-text-secondary",
467
+ children: "Plan"
468
+ }), /* @__PURE__ */ v("p", {
469
+ className: "text-sm text-text-primary mt-0.5",
470
+ children: U?.name || "Unknown"
471
+ })] }),
472
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
473
+ className: "text-sm text-text-secondary",
474
+ children: "Billing Account"
475
+ }), /* @__PURE__ */ v("p", {
476
+ className: "text-sm text-text-primary mt-0.5",
477
+ children: D.billingAccount?.name || "Unknown"
478
+ })] }),
479
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
480
+ className: "text-sm text-text-secondary",
481
+ children: "Start Date"
482
+ }), /* @__PURE__ */ v("p", {
483
+ className: "text-sm text-text-primary mt-0.5",
484
+ children: l(D.startDate)
485
+ })] }),
486
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
487
+ className: "text-sm text-text-secondary",
488
+ children: "End Date"
489
+ }), /* @__PURE__ */ v("p", {
490
+ className: "text-sm text-text-primary mt-0.5",
491
+ children: l(D.endDate)
492
+ })] }),
493
+ D.nextBillingDate && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
494
+ className: "text-sm text-text-secondary",
495
+ children: "Next Billing"
496
+ }), /* @__PURE__ */ v("p", {
497
+ className: "text-sm text-text-primary mt-0.5",
498
+ children: l(D.nextBillingDate)
499
+ })] }),
500
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
501
+ className: "text-sm text-text-secondary",
502
+ children: "Auto Renewal"
503
+ }), /* @__PURE__ */ v("p", {
504
+ className: "text-sm text-text-primary mt-0.5",
505
+ children: D.autoRenewal ? "Enabled" : "Disabled"
506
+ })] }),
507
+ D.paymentGateway && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
508
+ className: "text-sm text-text-secondary",
509
+ children: "Payment Gateway"
510
+ }), /* @__PURE__ */ v("p", {
511
+ className: "text-sm text-text-primary mt-0.5 capitalize",
512
+ children: D.paymentGateway
513
+ })] })
514
+ ]
515
+ })]
516
+ }),
517
+ q.length > 0 && /* @__PURE__ */ y(t, {
518
+ className: "overflow-hidden",
519
+ children: [/* @__PURE__ */ v("div", {
520
+ className: "p-5 border-b border-border-subtle",
521
+ children: /* @__PURE__ */ v("h2", {
522
+ className: "text-base font-semibold text-text-primary",
523
+ children: "History"
524
+ })
525
+ }), /* @__PURE__ */ v("div", {
526
+ className: "p-5",
527
+ children: /* @__PURE__ */ v("div", {
528
+ className: "space-y-3",
529
+ children: q.slice(0, 5).map((e) => /* @__PURE__ */ v(he, { item: e }, e.id))
530
+ })
531
+ })]
532
+ })
533
+ ]
495
534
  })]
496
535
  }),
497
- I && w && /* @__PURE__ */ _(h, {
498
- subscription: w,
536
+ xe && D && /* @__PURE__ */ v(oe, {
537
+ subscription: D,
499
538
  onClose: () => L(!1),
500
539
  onConfirm: async (e) => {
501
- await k({
502
- subscriptionId: w.id,
540
+ await M({
541
+ subscriptionId: D.id,
503
542
  seatCount: e
504
- }), await E();
543
+ }), await k();
505
544
  },
506
- isLoading: A
545
+ isLoading: N
507
546
  }),
508
- P && /* @__PURE__ */ v("div", {
547
+ be && /* @__PURE__ */ y("div", {
509
548
  className: "fixed inset-0 z-50 flex items-center justify-center",
510
- children: [/* @__PURE__ */ _("div", {
549
+ children: [/* @__PURE__ */ v("div", {
511
550
  className: "absolute inset-0 bg-overlay-scrim",
512
- onClick: () => F(!1)
513
- }), /* @__PURE__ */ v("div", {
551
+ onClick: () => I(!1)
552
+ }), /* @__PURE__ */ y("div", {
514
553
  className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] w-full max-w-md mx-4 p-6",
515
554
  role: "dialog",
516
555
  "aria-modal": "true",
517
556
  "aria-labelledby": "cancel-subscription-title",
518
557
  children: [
519
- /* @__PURE__ */ _("h3", {
558
+ /* @__PURE__ */ v("h3", {
520
559
  id: "cancel-subscription-title",
521
560
  className: "text-lg font-semibold text-text-primary mb-2",
522
561
  children: "Cancel Subscription"
523
562
  }),
524
- /* @__PURE__ */ v("p", {
563
+ /* @__PURE__ */ y("p", {
525
564
  className: "text-sm text-text-secondary mb-4",
526
565
  children: [
527
566
  "Are you sure you want to cancel this subscription? Your subscription will remain active until",
528
567
  " ",
529
- /* @__PURE__ */ _("span", {
568
+ /* @__PURE__ */ v("span", {
530
569
  className: "font-medium text-text-primary",
531
- children: l(w.endDate)
570
+ children: l(D.endDate)
532
571
  }),
533
572
  ", but will not renew automatically."
534
573
  ]
535
574
  }),
536
- /* @__PURE__ */ v("div", {
575
+ /* @__PURE__ */ y("div", {
537
576
  className: "mb-4",
538
- children: [/* @__PURE__ */ _("label", {
577
+ children: [/* @__PURE__ */ v("label", {
539
578
  className: "block text-sm font-medium text-text-primary mb-1",
540
579
  children: "Reason for cancellation (optional)"
541
- }), /* @__PURE__ */ _("textarea", {
580
+ }), /* @__PURE__ */ v("textarea", {
542
581
  value: z,
543
582
  onChange: (e) => B(e.target.value),
544
583
  placeholder: "Please share why you're canceling...",
@@ -546,28 +585,28 @@ var x = () => {
546
585
  rows: 3
547
586
  })]
548
587
  }),
549
- V && /* @__PURE__ */ _("div", {
588
+ V && /* @__PURE__ */ v("div", {
550
589
  className: "mb-4 p-3 bg-status-error-bg-subtle border border-status-error-border rounded-card",
551
- children: /* @__PURE__ */ _("p", {
590
+ children: /* @__PURE__ */ v("p", {
552
591
  className: "text-sm text-status-error-text",
553
592
  children: V
554
593
  })
555
594
  }),
556
- /* @__PURE__ */ v("div", {
595
+ /* @__PURE__ */ y("div", {
557
596
  className: "flex items-center justify-end gap-3",
558
- children: [/* @__PURE__ */ _("button", {
597
+ children: [/* @__PURE__ */ v("button", {
559
598
  type: "button",
560
599
  onClick: () => {
561
- F(!1), B(""), H(null);
600
+ I(!1), B(""), H(null);
562
601
  },
563
602
  className: "px-4 py-2 text-sm font-medium text-text-secondary hover:text-text-primary transition-colors",
564
603
  children: "Keep Subscription"
565
- }), /* @__PURE__ */ _("button", {
604
+ }), /* @__PURE__ */ v("button", {
566
605
  type: "button",
567
- onClick: xe,
568
- disabled: O,
606
+ onClick: Ce,
607
+ disabled: j,
569
608
  className: "px-4 py-2 text-sm font-medium bg-action-danger-bg text-action-danger-text rounded-button hover:bg-action-danger-bgHover transition-colors duration-200 disabled:opacity-50",
570
- children: O ? "Canceling..." : "Confirm Cancellation"
609
+ children: j ? "Canceling..." : "Confirm Cancellation"
571
610
  })]
572
611
  })
573
612
  ]
@@ -575,23 +614,23 @@ var x = () => {
575
614
  })
576
615
  ]
577
616
  });
578
- }, fe = ({ quota: e }) => {
579
- let t = e.context, n = y(e.name, t), r = t?.description && typeof t.description == "string" ? t.description : null, i = e.limits?.value ?? 0, a = e.currentUsageSum ?? 0, o = i > 0 ? Math.min(100, a / i * 100) : 0, c = e.name.includes("bytes") || e.name.includes("storage"), d = e.quotaType === "POOLED";
580
- return /* @__PURE__ */ v("div", {
617
+ }, de = ({ quota: e }) => {
618
+ let t = e.context, n = S(e.name, t), r = t?.description && typeof t.description == "string" ? t.description : null, i = e.limits?.value ?? 0, a = e.currentUsageSum ?? 0, o = i > 0 ? Math.min(100, a / i * 100) : 0, c = e.name.includes("bytes") || e.name.includes("storage"), d = e.quotaType === "POOLED";
619
+ return /* @__PURE__ */ y("div", {
581
620
  className: "p-4 rounded-card border border-border-seam bg-bg-surface",
582
621
  children: [
583
- /* @__PURE__ */ v("div", {
622
+ /* @__PURE__ */ y("div", {
584
623
  className: "flex items-start justify-between gap-4 mb-2",
585
- children: [/* @__PURE__ */ v("div", {
624
+ children: [/* @__PURE__ */ y("div", {
586
625
  className: "min-w-0",
587
- children: [/* @__PURE__ */ _("p", {
626
+ children: [/* @__PURE__ */ v("p", {
588
627
  className: "font-medium text-text-primary truncate",
589
628
  children: n
590
- }), r && /* @__PURE__ */ _("p", {
629
+ }), r && /* @__PURE__ */ v("p", {
591
630
  className: "text-xs text-text-secondary mt-0.5 line-clamp-2",
592
631
  children: r
593
632
  })]
594
- }), /* @__PURE__ */ v("span", {
633
+ }), /* @__PURE__ */ y("span", {
595
634
  className: "text-sm font-medium text-text-primary shrink-0 tabular-nums",
596
635
  children: [
597
636
  c ? s(a) : a.toLocaleString(),
@@ -600,21 +639,21 @@ var x = () => {
600
639
  ]
601
640
  })]
602
641
  }),
603
- i > 0 && /* @__PURE__ */ _("div", {
642
+ i > 0 && /* @__PURE__ */ v("div", {
604
643
  className: "h-1.5 rounded-full bg-bg-sunken overflow-hidden mb-2",
605
- children: /* @__PURE__ */ _("div", {
644
+ children: /* @__PURE__ */ v("div", {
606
645
  className: `h-full rounded-full transition-all duration-300 ${f(o)}`,
607
646
  style: { width: `${o}%` }
608
647
  })
609
648
  }),
610
- /* @__PURE__ */ v("div", {
649
+ /* @__PURE__ */ y("div", {
611
650
  className: "flex items-center justify-between text-xs text-text-secondary",
612
- children: [/* @__PURE__ */ _("span", {
651
+ children: [/* @__PURE__ */ v("span", {
613
652
  className: "px-1.5 py-0.5 rounded bg-bg-sunken font-medium",
614
653
  children: d ? "Shared" : "Per Workspace"
615
- }), /* @__PURE__ */ v("div", {
654
+ }), /* @__PURE__ */ y("div", {
616
655
  className: "flex items-center gap-3",
617
- children: [e.endtime && /* @__PURE__ */ v("span", { children: ["Expires ", l(e.endtime, "short")] }), i > 0 && /* @__PURE__ */ v("span", {
656
+ children: [e.endtime && /* @__PURE__ */ y("span", { children: ["Expires ", l(e.endtime, "short")] }), i > 0 && /* @__PURE__ */ y("span", {
618
657
  className: o >= 90 ? "text-status-error-text font-medium" : o >= 70 ? "text-status-warning-text font-medium" : "",
619
658
  children: [u(o), " used"]
620
659
  })]
@@ -622,23 +661,23 @@ var x = () => {
622
661
  })
623
662
  ]
624
663
  });
625
- }, pe = ({ item: e }) => {
626
- let { assignment: t, effectiveUsed: n, usagePercentage: r } = e, i = y(t.quotaName), a = !t.noLimit && t.limit !== null, o = t.limit ?? 0, c = t.quotaName.includes("bytes") || t.quotaName.includes("storage"), d = b(t.resetPeriod);
627
- return /* @__PURE__ */ v("div", {
664
+ }, fe = ({ item: e }) => {
665
+ let { assignment: t, effectiveUsed: n, usagePercentage: r } = e, i = S(t.quotaName), a = !t.noLimit && t.limit !== null, o = t.limit ?? 0, c = t.quotaName.includes("bytes") || t.quotaName.includes("storage"), d = C(t.resetPeriod);
666
+ return /* @__PURE__ */ y("div", {
628
667
  className: "p-4 rounded-card border border-border-seam bg-bg-surface",
629
668
  children: [
630
- /* @__PURE__ */ v("div", {
669
+ /* @__PURE__ */ y("div", {
631
670
  className: "flex items-start justify-between gap-4 mb-2",
632
- children: [/* @__PURE__ */ v("div", {
671
+ children: [/* @__PURE__ */ y("div", {
633
672
  className: "min-w-0",
634
- children: [/* @__PURE__ */ _("p", {
673
+ children: [/* @__PURE__ */ v("p", {
635
674
  className: "font-medium text-text-primary truncate",
636
675
  children: i
637
- }), /* @__PURE__ */ v("p", {
676
+ }), /* @__PURE__ */ y("p", {
638
677
  className: "text-xs text-text-secondary mt-0.5",
639
678
  children: [t.quotaMode === "pooled" ? "Pooled across workspaces" : "Dedicated", d && ` · ${d}`]
640
679
  })]
641
- }), /* @__PURE__ */ v("span", {
680
+ }), /* @__PURE__ */ y("span", {
642
681
  className: "text-sm font-medium text-text-primary shrink-0 tabular-nums",
643
682
  children: [
644
683
  c ? s(n) : n.toLocaleString(),
@@ -647,83 +686,83 @@ var x = () => {
647
686
  ]
648
687
  })]
649
688
  }),
650
- a && /* @__PURE__ */ _("div", {
689
+ a && /* @__PURE__ */ v("div", {
651
690
  className: "h-1.5 rounded-full bg-bg-sunken overflow-hidden mb-2",
652
- children: /* @__PURE__ */ _("div", {
691
+ children: /* @__PURE__ */ v("div", {
653
692
  className: `h-full rounded-full transition-all duration-300 ${f(r)}`,
654
693
  style: { width: `${Math.min(100, r)}%` }
655
694
  })
656
695
  }),
657
- /* @__PURE__ */ v("div", {
696
+ /* @__PURE__ */ y("div", {
658
697
  className: "flex items-center justify-between text-xs text-text-secondary",
659
- children: [/* @__PURE__ */ v("span", { children: ["Since ", l(t.createdAt, "short")] }), a && /* @__PURE__ */ v("span", {
698
+ children: [/* @__PURE__ */ y("span", { children: ["Since ", l(t.createdAt, "short")] }), a && /* @__PURE__ */ y("span", {
660
699
  className: r >= 90 ? "text-status-error-text font-medium" : r >= 70 ? "text-status-warning-text font-medium" : "",
661
700
  children: [u(r), " used"]
662
701
  })]
663
702
  })
664
703
  ]
665
704
  });
666
- }, me = ({ addonSubscription: e }) => {
705
+ }, pe = ({ addonSubscription: e }) => {
667
706
  let t = e.addon;
668
- return /* @__PURE__ */ v("div", {
707
+ return /* @__PURE__ */ y("div", {
669
708
  className: "flex items-center justify-between p-3 rounded-card border border-border-seam bg-bg-sunken",
670
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
709
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
671
710
  className: "font-medium text-text-primary",
672
711
  children: t?.name || "Unknown Addon"
673
- }), /* @__PURE__ */ v("p", {
712
+ }), /* @__PURE__ */ y("p", {
674
713
  className: "text-sm text-text-secondary",
675
714
  children: ["Qty: ", e.quantity]
676
- })] }), t && /* @__PURE__ */ _("p", {
715
+ })] }), t && /* @__PURE__ */ v("p", {
677
716
  className: "text-sm font-medium text-text-primary tabular-nums",
678
717
  children: c(t.price * e.quantity, t.currency)
679
718
  })]
680
719
  });
681
- }, he = ({ transaction: e }) => /* @__PURE__ */ v("div", {
720
+ }, me = ({ transaction: e }) => /* @__PURE__ */ y("div", {
682
721
  className: "flex items-center justify-between px-5 py-4 hover:bg-bg-sunken transition-colors",
683
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
722
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
684
723
  className: "font-medium text-text-primary capitalize",
685
724
  children: e.type
686
- }), /* @__PURE__ */ _("p", {
725
+ }), /* @__PURE__ */ v("p", {
687
726
  className: "text-sm text-text-secondary",
688
727
  children: l(e.createdAt, "short")
689
- })] }), /* @__PURE__ */ v("div", {
728
+ })] }), /* @__PURE__ */ y("div", {
690
729
  className: "text-right",
691
- children: [/* @__PURE__ */ v("p", {
730
+ children: [/* @__PURE__ */ y("p", {
692
731
  className: `font-medium tabular-nums ${e.type === "refund" ? "text-status-error-text" : "text-text-primary"}`,
693
732
  children: [e.type === "refund" ? "-" : "", c(e.amount, e.currency)]
694
- }), /* @__PURE__ */ _("p", {
733
+ }), /* @__PURE__ */ v("p", {
695
734
  className: "text-sm text-text-secondary capitalize",
696
735
  children: e.status
697
736
  })]
698
737
  })]
699
- }), ge = ({ item: e }) => /* @__PURE__ */ v("div", {
738
+ }), he = ({ item: e }) => /* @__PURE__ */ y("div", {
700
739
  className: "flex items-start gap-3",
701
- children: [/* @__PURE__ */ _("div", { className: "size-2 rounded-full bg-text-muted mt-2 shrink-0" }), /* @__PURE__ */ v("div", { children: [
702
- /* @__PURE__ */ v("p", {
740
+ children: [/* @__PURE__ */ v("div", { className: "size-2 rounded-full bg-text-muted mt-2 shrink-0" }), /* @__PURE__ */ y("div", { children: [
741
+ /* @__PURE__ */ y("p", {
703
742
  className: "text-sm text-text-primary",
704
743
  children: [
705
- /* @__PURE__ */ _("span", {
744
+ /* @__PURE__ */ v("span", {
706
745
  className: "capitalize",
707
746
  children: e.fromStatus
708
747
  }),
709
748
  " → ",
710
- /* @__PURE__ */ _("span", {
749
+ /* @__PURE__ */ v("span", {
711
750
  className: "capitalize font-medium",
712
751
  children: e.toStatus
713
752
  })
714
753
  ]
715
754
  }),
716
- e.reason && /* @__PURE__ */ _("p", {
755
+ e.reason && /* @__PURE__ */ v("p", {
717
756
  className: "text-xs text-text-secondary mt-0.5",
718
757
  children: e.reason
719
758
  }),
720
- /* @__PURE__ */ _("p", {
759
+ /* @__PURE__ */ v("p", {
721
760
  className: "text-xs text-text-secondary mt-0.5",
722
761
  children: l(e.createdAt, "short")
723
762
  })
724
763
  ] })]
725
764
  });
726
765
  //#endregion
727
- export { x as SubscriptionDetailPage };
766
+ export { w as SubscriptionDetailPage };
728
767
 
729
768
  //# sourceMappingURL=SubscriptionDetailPage.js.map