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