@burdenoff/microfe-billing 2026.1120.1 → 2026.1123.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.
@@ -2,21 +2,23 @@ import { useBillingNavigate as e } from "../../../hooks/useBillingNavigate.js";
2
2
  import { useBilling as t } from "../../../providers/BillingProvider.js";
3
3
  import { useBillingAccountSelection as n } from "../../../hooks/useBillingAccountSelection.js";
4
4
  import "../hooks/index.js";
5
- import { useBillingPermissions as r } from "../../../hooks/useBillingPermissions.js";
6
- import { formatCurrency as i, formatPlanDuration as a } from "../../../shared/utils/format.js";
7
- import { useGetAllPlansQuery as o, useGetDefaultBillingAccountDashboardQuery as s } from "../../../../generated/global-operations.js";
8
- import { withBillingAccountId as c } from "../../../shared/utils/navigation.js";
9
- import { useSubscription as ee } from "../hooks/useSubscriptions.js";
10
- import { useIsFluidgridsVariant as l } from "../../../hooks/useBillingVariant.js";
11
- import { resolveUpgradeAccess as u } from "../utils/upgradeAccess.js";
12
- import { useMemo as d, useState as f } from "react";
13
- import { AccessGate as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
14
- import { AlertCircle as h, ArrowLeft as g, ArrowRight as _, CheckCircle as v, ChevronDown as y, ChevronUp as b, Infinity as x, Loader2 as S, Package as C, Sparkles as w } from "lucide-react";
15
- import { useParams as T } from "react-router";
16
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
17
- import { useI18n as k } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
5
+ import { PlanQuotaTermsNote as r } from "../../../shared/components/PlanQuotaTermsNote.js";
6
+ import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
7
+ import { formatCurrency as a, formatPlanDuration as o } from "../../../shared/utils/format.js";
8
+ import { useGetAllPlansQuery as s, useGetDefaultBillingAccountDashboardQuery as c } from "../../../../generated/global-operations.js";
9
+ import { withBillingAccountId as l } from "../../../shared/utils/navigation.js";
10
+ import "../../../shared/components/index.js";
11
+ import { useSubscription as u } from "../hooks/useSubscriptions.js";
12
+ import { useIsFluidgridsVariant as d } from "../../../hooks/useBillingVariant.js";
13
+ import { resolveUpgradeAccess as f } from "../utils/upgradeAccess.js";
14
+ import { useMemo as p, useState as m } from "react";
15
+ import { AccessGate as h, PagePurpose as g } from "@burdenoff/fe-libs/ui";
16
+ import { AlertCircle as _, ArrowLeft as v, ArrowRight as y, CheckCircle as b, ChevronDown as x, ChevronUp as S, Infinity as C, Loader2 as w, Package as T, Sparkles as E } from "lucide-react";
17
+ import { useParams as D } from "react-router";
18
+ import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
19
+ import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
18
20
  // src/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.tsx
19
- var A = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ? e === -1 || e === Infinity ? "Unlimited" : e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : e.toLocaleString() : String(e), j = (e) => e.replace(/_/g, " ").replace(/([A-Z])/g, " $1").replace(/^./, (e) => e.toUpperCase()).trim(), M = (e) => {
21
+ var M = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ? e === -1 || e === Infinity ? "Unlimited" : e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : e.toLocaleString() : String(e), N = (e) => e.replace(/_/g, " ").replace(/([A-Z])/g, " $1").replace(/^./, (e) => e.toUpperCase()).trim(), P = (e) => {
20
22
  let t = /* @__PURE__ */ new Map();
21
23
  for (let n of e) {
22
24
  let e = n.quotaId || n.quota?.id;
@@ -41,58 +43,58 @@ var A = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
41
43
  });
42
44
  }
43
45
  return Array.from(t.values());
44
- }, N = ({ features: e, isExpanded: t, onToggle: n, variant: r = "available" }) => {
45
- let i = d(() => M(e), [e]), a = i.length;
46
- return a === 0 ? /* @__PURE__ */ D("p", {
46
+ }, F = ({ features: e, isExpanded: t, onToggle: n, variant: r = "available" }) => {
47
+ let i = p(() => P(e), [e]), a = i.length;
48
+ return a === 0 ? /* @__PURE__ */ k("p", {
47
49
  className: "text-xs text-text-secondary italic",
48
50
  children: "No features defined"
49
- }) : /* @__PURE__ */ O("div", {
51
+ }) : /* @__PURE__ */ A("div", {
50
52
  className: "mt-2",
51
- children: [/* @__PURE__ */ O("button", {
53
+ children: [/* @__PURE__ */ A("button", {
52
54
  type: "button",
53
55
  onClick: (e) => {
54
56
  e.stopPropagation(), n();
55
57
  },
56
58
  className: `flex items-center gap-1.5 text-xs font-medium transition-colors ${r === "current" ? "text-text-secondary hover:text-text-primary" : "text-text-link hover:text-text-link"}`,
57
59
  children: [
58
- /* @__PURE__ */ D(w, { className: "size-3" }),
59
- /* @__PURE__ */ O("span", { children: [
60
+ /* @__PURE__ */ k(E, { className: "size-3" }),
61
+ /* @__PURE__ */ A("span", { children: [
60
62
  a,
61
63
  " feature",
62
64
  a === 1 ? "" : "s"
63
65
  ] }),
64
- D(t ? b : y, { className: "size-3" })
66
+ k(t ? S : x, { className: "size-3" })
65
67
  ]
66
- }), t && /* @__PURE__ */ D("div", {
68
+ }), t && /* @__PURE__ */ k("div", {
67
69
  className: `mt-2 space-y-2 ${r === "current" ? "pl-0" : "pl-1"}`,
68
70
  children: i.map((e) => {
69
71
  let t = e.quota;
70
72
  if (!t) return null;
71
73
  let n = t.limits || {}, i = Object.entries(n);
72
- return /* @__PURE__ */ O("div", {
74
+ return /* @__PURE__ */ A("div", {
73
75
  className: `rounded-button p-2 ${r === "current" ? "bg-bg-sunken" : "bg-[var(--color-accent-soft)]"}`,
74
76
  children: [
75
- /* @__PURE__ */ D("p", {
77
+ /* @__PURE__ */ k("p", {
76
78
  className: "text-xs font-medium text-text-primary",
77
79
  children: t.name
78
80
  }),
79
- i.length > 0 && /* @__PURE__ */ D("div", {
81
+ i.length > 0 && /* @__PURE__ */ k("div", {
80
82
  className: "mt-1 flex flex-wrap gap-x-3 gap-y-1",
81
- children: i.map(([e, t]) => /* @__PURE__ */ O("div", {
83
+ children: i.map(([e, t]) => /* @__PURE__ */ A("div", {
82
84
  className: "flex items-center gap-1 text-xs text-text-secondary",
83
- children: [/* @__PURE__ */ O("span", {
85
+ children: [/* @__PURE__ */ A("span", {
84
86
  className: "opacity-70",
85
- children: [j(e), ":"]
86
- }), /* @__PURE__ */ D("span", {
87
+ children: [N(e), ":"]
88
+ }), /* @__PURE__ */ k("span", {
87
89
  className: "font-medium text-text-primary flex items-center gap-0.5",
88
- children: t === -1 || t === Infinity ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(x, { className: "size-3" }), /* @__PURE__ */ D("span", {
90
+ children: t === -1 || t === Infinity ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(C, { className: "size-3" }), /* @__PURE__ */ k("span", {
89
91
  className: "sr-only",
90
92
  children: "Unlimited"
91
- })] }) : A(t)
93
+ })] }) : M(t)
92
94
  })]
93
95
  }, e))
94
96
  }),
95
- t.reusable && /* @__PURE__ */ D("span", {
97
+ t.reusable && /* @__PURE__ */ k("span", {
96
98
  className: "inline-block mt-1 text-[10px] px-1.5 py-0.5 rounded bg-status-success-bg-subtle text-status-success-text",
97
99
  children: "Reusable"
98
100
  })
@@ -101,265 +103,266 @@ var A = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
101
103
  })
102
104
  })]
103
105
  });
104
- }, P = () => {
105
- let { t: y } = k(), b = (e, t) => {
106
- let n = y(e);
106
+ }, I = () => {
107
+ let { t: x } = j(), S = (e, t) => {
108
+ let n = x(e);
107
109
  return n === e ? t : n;
108
- }, { subscriptionId: x } = T(), w = e(), { orgId: E } = t(), A = r(), j = l(), { selectedAccountId: P } = n({
109
- orgId: E,
110
+ }, { subscriptionId: C } = D(), E = e(), { orgId: O } = t(), M = i(), N = d(), { selectedAccountId: I } = n({
111
+ orgId: O,
110
112
  syncFromUrl: !0,
111
113
  urlParamName: "billingAccountId"
112
- }), { data: F } = s({ fetchPolicy: "cache-first" }), I = P ?? F?.getDefaultBillingAccount?.id ?? void 0, { subscription: L, isLoading: R } = ee(x, I), { data: z, loading: B } = o(), [V, H] = f(null), [U, W] = f({}), G = d(() => z?.getAllPlans || [], [z]), K = d(() => {
113
- let e = L?.planId;
114
- return G.find((t) => t.id === e) || null;
115
- }, [G, L?.planId]), q = d(() => {
116
- let e = L?.planId, t = L?.plan?.productID;
117
- return G.filter((n) => n.id === e || !n.isActive || n.isPurchasable === !1 || n.price === 0 ? !1 : !t || n.productID === t).sort((e, t) => e.price - t.price);
118
- }, [G, L]), J = d(() => q.find((e) => e.id === V) || null, [q, V]), Y = J !== null && J.price < (L?.plan?.price ?? 0), X = (e) => {
119
- W((t) => ({
114
+ }), { data: L } = c({ fetchPolicy: "cache-first" }), R = I ?? L?.getDefaultBillingAccount?.id ?? void 0, { subscription: z, isLoading: B } = u(C, R), { data: V, loading: H } = s(), [U, W] = m(null), [G, K] = m({}), q = p(() => V?.getAllPlans || [], [V]), J = p(() => {
115
+ let e = z?.planId;
116
+ return q.find((t) => t.id === e) || null;
117
+ }, [q, z?.planId]), Y = p(() => {
118
+ let e = z?.planId, t = z?.plan?.productID;
119
+ return q.filter((n) => n.id === e || !n.isActive || n.isPurchasable === !1 || n.price === 0 ? !1 : !t || n.productID === t).sort((e, t) => e.price - t.price);
120
+ }, [q, z]), X = p(() => Y.find((e) => e.id === U) || null, [Y, U]), ee = X !== null && X.price < (z?.plan?.price ?? 0), Z = (e) => {
121
+ K((t) => ({
120
122
  ...t,
121
123
  [e]: !t[e]
122
124
  }));
123
- }, Z = () => {
124
- if (!L || !J) return;
125
- let e = L.plan?.price ?? 0, t = J.price < e;
126
- w(`/checkout/${J.id}`, { state: {
125
+ }, te = () => {
126
+ if (!z || !X) return;
127
+ let e = z.plan?.price ?? 0, t = X.price < e;
128
+ E(`/checkout/${X.id}`, { state: {
127
129
  purchaseType: "PLAN",
128
- ...t ? { downgradeFromSubscriptionId: L.id } : { upgradeFromSubscriptionId: L.id },
129
- currentPlanName: L.plan?.name,
130
- billingAccountId: L.billingAccountId
130
+ ...t ? { downgradeFromSubscriptionId: z.id } : { upgradeFromSubscriptionId: z.id },
131
+ currentPlanName: z.plan?.name,
132
+ billingAccountId: z.billingAccountId
131
133
  } });
132
- }, Q = u(j, A.canCreateSubscription);
133
- if (Q === "gate") return /* @__PURE__ */ D(p, {
134
- message: b("billing.subscriptions.upgradeNeedAccess", "You need access to change this plan"),
135
- granterHint: b("billing.subscriptions.upgradeNeedAccessHint", "Ask a billing admin of this organization to give you access.")
134
+ }, Q = f(N, M.canCreateSubscription);
135
+ if (Q === "gate") return /* @__PURE__ */ k(h, {
136
+ message: S("billing.subscriptions.upgradeNeedAccess", "You need access to change this plan"),
137
+ granterHint: S("billing.subscriptions.upgradeNeedAccessHint", "Ask a billing admin of this organization to give you access.")
136
138
  });
137
- if (Q === "denied") return /* @__PURE__ */ D("div", {
139
+ if (Q === "denied") return /* @__PURE__ */ k("div", {
138
140
  className: "flex items-center justify-center h-full min-h-[400px]",
139
- children: /* @__PURE__ */ O("div", {
141
+ children: /* @__PURE__ */ A("div", {
140
142
  className: "text-center space-y-2",
141
143
  children: [
142
- /* @__PURE__ */ D("div", {
144
+ /* @__PURE__ */ k("div", {
143
145
  className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
144
- children: /* @__PURE__ */ D(h, { className: "size-6 text-text-secondary" })
146
+ children: /* @__PURE__ */ k(_, { className: "size-6 text-text-secondary" })
145
147
  }),
146
- /* @__PURE__ */ D("h2", {
148
+ /* @__PURE__ */ k("h2", {
147
149
  className: "text-lg font-semibold text-text-primary",
148
150
  children: "Access Denied"
149
151
  }),
150
- /* @__PURE__ */ D("p", {
152
+ /* @__PURE__ */ k("p", {
151
153
  className: "text-sm text-text-secondary max-w-sm",
152
154
  children: "You don't have permission to change subscriptions."
153
155
  })
154
156
  ]
155
157
  })
156
158
  });
157
- if (R || B) return /* @__PURE__ */ D("div", {
159
+ if (B || H) return /* @__PURE__ */ k("div", {
158
160
  className: "flex items-center justify-center min-h-[400px]",
159
- children: /* @__PURE__ */ O("div", {
161
+ children: /* @__PURE__ */ A("div", {
160
162
  className: "text-center space-y-4",
161
- children: [/* @__PURE__ */ D(S, { className: "size-8 animate-spin mx-auto text-text-link" }), /* @__PURE__ */ D("p", {
163
+ children: [/* @__PURE__ */ k(w, { className: "size-8 animate-spin mx-auto text-text-link" }), /* @__PURE__ */ k("p", {
162
164
  className: "text-text-secondary",
163
165
  children: "Loading plans…"
164
166
  })]
165
167
  })
166
168
  });
167
- if (!L) return /* @__PURE__ */ D("div", {
169
+ if (!z) return /* @__PURE__ */ k("div", {
168
170
  className: "flex items-center justify-center h-full min-h-[400px]",
169
- children: /* @__PURE__ */ O("div", {
171
+ children: /* @__PURE__ */ A("div", {
170
172
  className: "text-center space-y-4",
171
173
  children: [
172
- /* @__PURE__ */ D(h, { className: "size-12 mx-auto text-status-error-text" }),
173
- /* @__PURE__ */ D("h2", {
174
+ /* @__PURE__ */ k(_, { className: "size-12 mx-auto text-status-error-text" }),
175
+ /* @__PURE__ */ k("h2", {
174
176
  className: "text-lg font-semibold text-text-primary",
175
177
  children: "Subscription not found"
176
178
  }),
177
- /* @__PURE__ */ D("button", {
179
+ /* @__PURE__ */ k("button", {
178
180
  type: "button",
179
- onClick: () => w(c("/subscriptions", I)),
181
+ onClick: () => E(l("/subscriptions", R)),
180
182
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button",
181
- children: b("billing.subscriptions.backToSubscriptions", "Back to Subscriptions")
183
+ children: S("billing.subscriptions.backToSubscriptions", "Back to Subscriptions")
182
184
  })
183
185
  ]
184
186
  })
185
187
  });
186
- if (L.status !== "active") return /* @__PURE__ */ O("div", {
188
+ if (z.status !== "active") return /* @__PURE__ */ A("div", {
187
189
  className: "max-w-2xl mx-auto p-6 space-y-6",
188
- children: [/* @__PURE__ */ O("button", {
190
+ children: [/* @__PURE__ */ A("button", {
189
191
  type: "button",
190
- onClick: () => w(c(`/subscriptions/${x}`, I)),
192
+ onClick: () => E(l(`/subscriptions/${C}`, R)),
191
193
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary",
192
- children: [/* @__PURE__ */ D(g, { className: "size-4" }), b("billing.subscriptions.backToSubscription", "Back to Subscription")]
193
- }), /* @__PURE__ */ O("div", {
194
+ children: [/* @__PURE__ */ k(v, { className: "size-4" }), S("billing.subscriptions.backToSubscription", "Back to Subscription")]
195
+ }), /* @__PURE__ */ A("div", {
194
196
  className: "text-center space-y-4 py-12",
195
197
  children: [
196
- /* @__PURE__ */ D(h, { className: "size-12 mx-auto text-status-warning-text" }),
197
- /* @__PURE__ */ D("h2", {
198
+ /* @__PURE__ */ k(_, { className: "size-12 mx-auto text-status-warning-text" }),
199
+ /* @__PURE__ */ k("h2", {
198
200
  className: "text-lg font-semibold text-text-primary",
199
- children: b("billing.subscriptions.cannotChangePlan", "Cannot Change Plan")
201
+ children: S("billing.subscriptions.cannotChangePlan", "Cannot Change Plan")
200
202
  }),
201
- /* @__PURE__ */ D("p", {
203
+ /* @__PURE__ */ k("p", {
202
204
  className: "text-sm text-text-secondary max-w-md mx-auto",
203
- children: b("billing.subscriptions.notActiveMessage", "This subscription is no longer active. You can only change plans for active subscriptions.")
205
+ children: S("billing.subscriptions.notActiveMessage", "This subscription is no longer active. You can only change plans for active subscriptions.")
204
206
  }),
205
- /* @__PURE__ */ D("button", {
207
+ /* @__PURE__ */ k("button", {
206
208
  type: "button",
207
- onClick: () => w(c("/subscriptions", I)),
209
+ onClick: () => E(l("/subscriptions", R)),
208
210
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button",
209
- children: b("billing.subscriptions.viewAll", "View All Subscriptions")
211
+ children: S("billing.subscriptions.viewAll", "View All Subscriptions")
210
212
  })
211
213
  ]
212
214
  })]
213
215
  });
214
- if (q.length === 0) return /* @__PURE__ */ O("div", {
216
+ if (Y.length === 0) return /* @__PURE__ */ A("div", {
215
217
  className: "max-w-2xl mx-auto p-6 space-y-6",
216
- children: [/* @__PURE__ */ O("button", {
218
+ children: [/* @__PURE__ */ A("button", {
217
219
  type: "button",
218
- onClick: () => w(c(`/subscriptions/${x}`, I)),
220
+ onClick: () => E(l(`/subscriptions/${C}`, R)),
219
221
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary",
220
- children: [/* @__PURE__ */ D(g, { className: "size-4" }), b("billing.subscriptions.backToSubscription", "Back to Subscription")]
221
- }), /* @__PURE__ */ O("div", {
222
+ children: [/* @__PURE__ */ k(v, { className: "size-4" }), S("billing.subscriptions.backToSubscription", "Back to Subscription")]
223
+ }), /* @__PURE__ */ A("div", {
222
224
  className: "text-center space-y-4 py-12",
223
225
  children: [
224
- /* @__PURE__ */ D(C, { className: "size-12 mx-auto text-text-secondary" }),
225
- /* @__PURE__ */ D("h2", {
226
+ /* @__PURE__ */ k(T, { className: "size-12 mx-auto text-text-secondary" }),
227
+ /* @__PURE__ */ k("h2", {
226
228
  className: "text-lg font-semibold text-text-primary",
227
- children: b("billing.subscriptions.noPlansAvailable", "No Other Plans Available")
229
+ children: S("billing.subscriptions.noPlansAvailable", "No Other Plans Available")
228
230
  }),
229
- /* @__PURE__ */ D("p", {
231
+ /* @__PURE__ */ k("p", {
230
232
  className: "text-sm text-text-secondary max-w-md mx-auto",
231
- children: b("billing.subscriptions.noPlansMessage", "There are no other active plans available for this product.")
233
+ children: S("billing.subscriptions.noPlansMessage", "There are no other active plans available for this product.")
232
234
  })
233
235
  ]
234
236
  })]
235
237
  });
236
- let $ = K?.features || [];
237
- return /* @__PURE__ */ O("div", {
238
+ let $ = J?.features || [];
239
+ return /* @__PURE__ */ A("div", {
238
240
  className: "max-w-3xl mx-auto p-6 space-y-6",
239
241
  children: [
240
- /* @__PURE__ */ O("div", { children: [
241
- /* @__PURE__ */ O("button", {
242
+ /* @__PURE__ */ A("div", { children: [
243
+ /* @__PURE__ */ A("button", {
242
244
  type: "button",
243
- onClick: () => w(c(`/subscriptions/${x}`, I)),
245
+ onClick: () => E(l(`/subscriptions/${C}`, R)),
244
246
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary mb-4",
245
- children: [/* @__PURE__ */ D(g, { className: "size-4" }), b("billing.subscriptions.backToSubscription", "Back to Subscription")]
247
+ children: [/* @__PURE__ */ k(v, { className: "size-4" }), S("billing.subscriptions.backToSubscription", "Back to Subscription")]
246
248
  }),
247
- /* @__PURE__ */ D("h1", {
249
+ /* @__PURE__ */ k("h1", {
248
250
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
249
- children: b("billing.subscriptions.changeYourPlan", "Change Your Plan")
251
+ children: S("billing.subscriptions.changeYourPlan", "Change Your Plan")
250
252
  }),
251
- /* @__PURE__ */ O("p", {
253
+ /* @__PURE__ */ A("p", {
252
254
  className: "text-text-secondary mt-1",
253
255
  children: [
254
256
  "Switch from ",
255
- /* @__PURE__ */ D("span", {
257
+ /* @__PURE__ */ k("span", {
256
258
  className: "font-medium",
257
- children: L.plan?.name
259
+ children: z.plan?.name
258
260
  }),
259
261
  " to a different plan"
260
262
  ]
261
263
  }),
262
- /* @__PURE__ */ D(m, {
264
+ /* @__PURE__ */ k(g, {
263
265
  className: "mt-3",
264
- children: b("billing.subscriptions.upgradePurpose", "Move this subscription to a different plan — upgrade for more capacity or downgrade to save. Compare what each plan includes and see how the change affects your billing before you confirm.")
265
- })
266
+ children: S("billing.subscriptions.upgradePurpose", "Move this subscription to a different plan — upgrade for more capacity or downgrade to save. Compare what each plan includes and see how the change affects your billing before you confirm.")
267
+ }),
268
+ /* @__PURE__ */ k(r, { className: "mt-3" })
266
269
  ] }),
267
- /* @__PURE__ */ D("div", {
270
+ /* @__PURE__ */ k("div", {
268
271
  className: "bg-bg-sunken border border-border-subtle rounded-lg p-4",
269
- children: /* @__PURE__ */ O("div", {
272
+ children: /* @__PURE__ */ A("div", {
270
273
  className: "flex items-start justify-between",
271
- children: [/* @__PURE__ */ O("div", {
274
+ children: [/* @__PURE__ */ A("div", {
272
275
  className: "flex-1",
273
276
  children: [
274
- /* @__PURE__ */ D("p", {
277
+ /* @__PURE__ */ k("p", {
275
278
  className: "text-sm text-text-secondary",
276
279
  children: "Current Plan"
277
280
  }),
278
- /* @__PURE__ */ D("p", {
281
+ /* @__PURE__ */ k("p", {
279
282
  className: "font-semibold text-text-primary",
280
- children: L.plan?.name
283
+ children: z.plan?.name
281
284
  }),
282
- /* @__PURE__ */ D(N, {
285
+ /* @__PURE__ */ k(F, {
283
286
  features: $,
284
- isExpanded: U.current || !1,
285
- onToggle: () => X("current"),
287
+ isExpanded: G.current || !1,
288
+ onToggle: () => Z("current"),
286
289
  variant: "current"
287
290
  })
288
291
  ]
289
- }), /* @__PURE__ */ O("div", {
292
+ }), /* @__PURE__ */ A("div", {
290
293
  className: "text-right shrink-0 ml-4",
291
- children: [/* @__PURE__ */ D("p", {
294
+ children: [/* @__PURE__ */ k("p", {
292
295
  className: "text-sm text-text-secondary",
293
296
  children: "Price"
294
- }), /* @__PURE__ */ O("p", {
297
+ }), /* @__PURE__ */ A("p", {
295
298
  className: "font-semibold text-text-primary",
296
- children: [i(L.plan?.price || 0, L.plan?.currency || "USD"), /* @__PURE__ */ O("span", {
299
+ children: [a(z.plan?.price || 0, z.plan?.currency || "USD"), /* @__PURE__ */ A("span", {
297
300
  className: "text-sm font-normal text-text-secondary",
298
301
  children: [
299
302
  " ",
300
303
  "/ ",
301
- a(L.plan?.duration || "monthly")
304
+ o(z.plan?.duration || "monthly")
302
305
  ]
303
306
  })]
304
307
  })]
305
308
  })]
306
309
  })
307
310
  }),
308
- /* @__PURE__ */ O("div", {
311
+ /* @__PURE__ */ A("div", {
309
312
  className: "space-y-3",
310
- children: [/* @__PURE__ */ D("h2", {
313
+ children: [/* @__PURE__ */ k("h2", {
311
314
  className: "text-lg font-semibold text-text-primary",
312
315
  children: "Select New Plan"
313
- }), /* @__PURE__ */ D("div", {
316
+ }), /* @__PURE__ */ k("div", {
314
317
  className: "grid gap-3",
315
- children: q.map((e) => {
316
- let t = e.price - (L.plan?.price || 0), n = V === e.id, r = e.features || [], o = U[e.id] || !1;
317
- return /* @__PURE__ */ O("div", {
318
+ children: Y.map((e) => {
319
+ let t = e.price - (z.plan?.price || 0), n = U === e.id, r = e.features || [], i = G[e.id] || !1;
320
+ return /* @__PURE__ */ A("div", {
318
321
  className: `rounded-lg border transition-all ${n ? "border-border-strong bg-[var(--color-accent-soft)] ring-2 ring-[var(--color-focus-ring)]" : "border-border-subtle bg-bg-surface hover:border-border-strong"}`,
319
- children: [/* @__PURE__ */ D("button", {
322
+ children: [/* @__PURE__ */ k("button", {
320
323
  type: "button",
321
- onClick: () => H(e.id),
324
+ onClick: () => W(e.id),
322
325
  className: "w-full p-4 text-left",
323
- children: /* @__PURE__ */ O("div", {
326
+ children: /* @__PURE__ */ A("div", {
324
327
  className: "flex items-start justify-between",
325
- children: [/* @__PURE__ */ O("div", {
328
+ children: [/* @__PURE__ */ A("div", {
326
329
  className: "flex items-start gap-3",
327
- children: [/* @__PURE__ */ D("div", {
330
+ children: [/* @__PURE__ */ k("div", {
328
331
  className: `size-5 mt-0.5 rounded-full border-2 flex items-center justify-center shrink-0 ${n ? "border-border-strong bg-action-primary-bg" : "border-border-default"}`,
329
- children: n && /* @__PURE__ */ D(v, { className: "size-3 text-action-primary-text" })
330
- }), /* @__PURE__ */ O("div", {
332
+ children: n && /* @__PURE__ */ k(b, { className: "size-3 text-action-primary-text" })
333
+ }), /* @__PURE__ */ A("div", {
331
334
  className: "flex-1",
332
- children: [/* @__PURE__ */ D("p", {
335
+ children: [/* @__PURE__ */ k("p", {
333
336
  className: "font-semibold text-text-primary",
334
337
  children: e.name
335
- }), t !== 0 && /* @__PURE__ */ O("p", {
338
+ }), t !== 0 && /* @__PURE__ */ A("p", {
336
339
  className: `text-sm ${t > 0 ? "text-status-warning-text" : "text-status-success-text"}`,
337
340
  children: [
338
341
  t > 0 ? "+" : "",
339
- i(t, e.currency),
342
+ a(t, e.currency),
340
343
  " /",
341
344
  " ",
342
- a(e.duration)
345
+ o(e.duration)
343
346
  ]
344
347
  })]
345
348
  })]
346
- }), /* @__PURE__ */ O("div", {
349
+ }), /* @__PURE__ */ A("div", {
347
350
  className: "text-right shrink-0 ml-4",
348
- children: [/* @__PURE__ */ D("p", {
351
+ children: [/* @__PURE__ */ k("p", {
349
352
  className: "font-bold text-text-primary",
350
- children: i(e.price, e.currency)
351
- }), /* @__PURE__ */ O("p", {
353
+ children: a(e.price, e.currency)
354
+ }), /* @__PURE__ */ A("p", {
352
355
  className: "text-sm text-text-secondary",
353
- children: ["/ ", a(e.duration)]
356
+ children: ["/ ", o(e.duration)]
354
357
  })]
355
358
  })]
356
359
  })
357
- }), /* @__PURE__ */ D("div", {
360
+ }), /* @__PURE__ */ k("div", {
358
361
  className: "px-4 pb-4 pt-0 ml-8",
359
- children: /* @__PURE__ */ D(N, {
362
+ children: /* @__PURE__ */ k(F, {
360
363
  features: r,
361
- isExpanded: o,
362
- onToggle: () => X(e.id),
364
+ isExpanded: i,
365
+ onToggle: () => Z(e.id),
363
366
  variant: "available"
364
367
  })
365
368
  })]
@@ -367,26 +370,26 @@ var A = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
367
370
  })
368
371
  })]
369
372
  }),
370
- J && (() => {
371
- let e = M($).length, t = M(J.features || []).length;
372
- return /* @__PURE__ */ O("div", {
373
+ X && (() => {
374
+ let e = P($).length, t = P(X.features || []).length;
375
+ return /* @__PURE__ */ A("div", {
373
376
  className: "bg-bg-surface border border-border-subtle rounded-lg p-4 space-y-4",
374
377
  children: [
375
- /* @__PURE__ */ O("div", {
378
+ /* @__PURE__ */ A("div", {
376
379
  className: "flex items-center justify-center gap-4 py-2",
377
380
  children: [
378
- /* @__PURE__ */ O("div", {
381
+ /* @__PURE__ */ A("div", {
379
382
  className: "text-center",
380
383
  children: [
381
- /* @__PURE__ */ D("p", {
384
+ /* @__PURE__ */ k("p", {
382
385
  className: "text-xs text-text-secondary",
383
386
  children: "From"
384
387
  }),
385
- /* @__PURE__ */ D("p", {
388
+ /* @__PURE__ */ k("p", {
386
389
  className: "font-medium text-text-primary",
387
- children: L.plan?.name
390
+ children: z.plan?.name
388
391
  }),
389
- /* @__PURE__ */ O("p", {
392
+ /* @__PURE__ */ A("p", {
390
393
  className: "text-xs text-text-secondary",
391
394
  children: [
392
395
  e,
@@ -396,19 +399,19 @@ var A = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
396
399
  })
397
400
  ]
398
401
  }),
399
- /* @__PURE__ */ D(_, { className: "size-5 text-text-secondary" }),
400
- /* @__PURE__ */ O("div", {
402
+ /* @__PURE__ */ k(y, { className: "size-5 text-text-secondary" }),
403
+ /* @__PURE__ */ A("div", {
401
404
  className: "text-center",
402
405
  children: [
403
- /* @__PURE__ */ D("p", {
406
+ /* @__PURE__ */ k("p", {
404
407
  className: "text-xs text-text-secondary",
405
408
  children: "To"
406
409
  }),
407
- /* @__PURE__ */ D("p", {
410
+ /* @__PURE__ */ k("p", {
408
411
  className: "font-medium text-text-link",
409
- children: J.name
412
+ children: X.name
410
413
  }),
411
- /* @__PURE__ */ O("p", {
414
+ /* @__PURE__ */ A("p", {
412
415
  className: "text-xs text-text-secondary",
413
416
  children: [
414
417
  t,
@@ -420,22 +423,22 @@ var A = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
420
423
  })
421
424
  ]
422
425
  }),
423
- /* @__PURE__ */ D("p", {
426
+ /* @__PURE__ */ k("p", {
424
427
  className: "text-sm text-text-secondary text-center",
425
428
  children: "You'll be taken to checkout to select payment method and complete the change."
426
429
  }),
427
- /* @__PURE__ */ O("div", {
430
+ /* @__PURE__ */ A("div", {
428
431
  className: "flex items-center justify-end gap-3 pt-2 border-t border-border-subtle",
429
- children: [/* @__PURE__ */ D("button", {
432
+ children: [/* @__PURE__ */ k("button", {
430
433
  type: "button",
431
- onClick: () => w(c(`/subscriptions/${x}`, I)),
434
+ onClick: () => E(l(`/subscriptions/${C}`, R)),
432
435
  className: "px-4 py-2 text-sm font-medium text-text-secondary hover:text-text-primary",
433
436
  children: "Cancel"
434
- }), /* @__PURE__ */ D("button", {
437
+ }), /* @__PURE__ */ k("button", {
435
438
  type: "button",
436
- onClick: Z,
439
+ onClick: te,
437
440
  className: "px-6 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
438
- children: Y ? "Downgrade Plan" : "Upgrade Plan"
441
+ children: ee ? "Downgrade Plan" : "Upgrade Plan"
439
442
  })]
440
443
  })
441
444
  ]
@@ -444,6 +447,6 @@ var A = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
444
447
  ]
445
448
  });
446
449
  };
447
- export { P as UpgradeSubscriptionPage };
450
+ export { I as UpgradeSubscriptionPage };
448
451
 
449
452
  //# sourceMappingURL=UpgradeSubscriptionPage.js.map