@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
@@ -11,56 +11,59 @@ import { withBillingAccountId as d } from "../../../shared/utils/navigation.js";
11
11
  import { useBillingAccounts as f, usePaginatedSubscriptions as p } from "../hooks/useSubscriptions.js";
12
12
  import "../hooks/index.js";
13
13
  import { useEffect as m, useRef as h, useState as g } from "react";
14
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
15
- import { EmphasisPanel as b, IllustratedEmptyState as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
14
+ import { useSearchParams as _ } from "react-router";
15
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
16
+ import { EmphasisPanel as x, IllustratedEmptyState as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
16
17
  //#region src/billing/modules/subscriptions/pages/SubscriptionsListPage.tsx
17
- var C = ["expired", "upgraded"], w = 10, T = () => {
18
- let n = t(), i = u(), a = l(), { orgId: o } = e(), { billingAccounts: s, isLoading: c } = f(), { selectedAccountId: T, setSelectedAccountId: D } = r({
18
+ var w = ["expired", "upgraded"], T = 10, E = () => {
19
+ let n = t(), i = u(), a = l(), { orgId: o } = e(), [s, c] = _(), { billingAccounts: E, isLoading: O } = f(), { selectedAccountId: k, setSelectedAccountId: A } = r({
19
20
  orgId: o,
20
- billingAccounts: s,
21
+ billingAccounts: E,
21
22
  syncFromUrl: !0,
22
23
  urlParamName: "billingAccountId"
23
- }), [O, k] = g(!1), [A, j] = g("all"), [M, N] = g(""), [P, F] = g(""), [I, L] = g(1), R = h(void 0);
24
- m(() => (clearTimeout(R.current), R.current = setTimeout(() => {
25
- F(M), L(1);
26
- }, 400), () => clearTimeout(R.current)), [M]);
27
- let { subscriptions: z, activeSubscriptions: B, totalCount: V, totalPages: H, isLoading: U, error: W, refetch: G } = p(T ?? void 0, I, w, P || void 0), K = s.find((e) => e.id === T), q = (e) => {
28
- D(e.id), k(!1), L(1);
29
- }, J = (e) => {
30
- L(e);
31
- }, Y = z.filter((e) => A === "all" ? !0 : A === "inactive" ? C.includes(e.status) : e.status === A), X = c || U;
32
- return a.canViewSubscriptions ? X && !K ? /* @__PURE__ */ y("div", {
24
+ }), [j, M] = g(!1), [N, P] = g("all"), [F, I] = g(""), [L, R] = g(""), [z, B] = g(1), V = h(void 0);
25
+ m(() => (clearTimeout(V.current), V.current = setTimeout(() => {
26
+ R(F), B(1);
27
+ }, 400), () => clearTimeout(V.current)), [F]);
28
+ let { subscriptions: H, activeSubscriptions: U, totalCount: W, totalPages: G, isLoading: K, error: q, refetch: J } = p(k ?? void 0, z, T, L || void 0), Y = E.find((e) => e.id === k), X = (e) => {
29
+ A(e.id);
30
+ let t = new URLSearchParams(s);
31
+ t.set("billingAccountId", e.id), c(t, { replace: !0 }), M(!1), B(1);
32
+ }, Z = (e) => {
33
+ B(e);
34
+ }, Q = H.filter((e) => N === "all" ? !0 : N === "inactive" ? w.includes(e.status) : e.status === N), $ = O || K;
35
+ return a.canViewSubscriptions ? $ && !Y ? /* @__PURE__ */ b("div", {
33
36
  className: "space-y-6 p-6",
34
- children: [/* @__PURE__ */ v("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ v("div", {
37
+ children: [/* @__PURE__ */ y("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", {
35
38
  className: "space-y-4",
36
39
  children: [
37
40
  1,
38
41
  2,
39
42
  3
40
- ].map((e) => /* @__PURE__ */ v("div", {
43
+ ].map((e) => /* @__PURE__ */ y("div", {
41
44
  className: "border border-border-subtle rounded-lg p-6",
42
- children: /* @__PURE__ */ y("div", {
45
+ children: /* @__PURE__ */ b("div", {
43
46
  className: "flex items-center gap-4",
44
- children: [/* @__PURE__ */ v("div", { className: "size-12 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", {
47
+ children: [/* @__PURE__ */ y("div", { className: "size-12 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ b("div", {
45
48
  className: "flex-1 space-y-2",
46
- children: [/* @__PURE__ */ v("div", { className: "h-5 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ v("div", { className: "h-4 w-48 bg-bg-sunken animate-pulse rounded" })]
49
+ children: [/* @__PURE__ */ y("div", { className: "h-5 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", { className: "h-4 w-48 bg-bg-sunken animate-pulse rounded" })]
47
50
  })]
48
51
  })
49
52
  }, e))
50
53
  })]
51
- }) : W ? /* @__PURE__ */ v("div", {
54
+ }) : q ? /* @__PURE__ */ y("div", {
52
55
  className: "flex items-center justify-center h-full min-h-[400px]",
53
- children: /* @__PURE__ */ y("div", {
56
+ children: /* @__PURE__ */ b("div", {
54
57
  className: "text-center space-y-4",
55
58
  children: [
56
- /* @__PURE__ */ v("div", {
59
+ /* @__PURE__ */ y("div", {
57
60
  className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
58
- children: /* @__PURE__ */ v("svg", {
61
+ children: /* @__PURE__ */ y("svg", {
59
62
  className: "size-6 text-status-error-text",
60
63
  fill: "none",
61
64
  viewBox: "0 0 24 24",
62
65
  stroke: "currentColor",
63
- children: /* @__PURE__ */ v("path", {
66
+ children: /* @__PURE__ */ y("path", {
64
67
  strokeLinecap: "round",
65
68
  strokeLinejoin: "round",
66
69
  strokeWidth: 2,
@@ -68,50 +71,50 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
68
71
  })
69
72
  })
70
73
  }),
71
- /* @__PURE__ */ v("h2", {
74
+ /* @__PURE__ */ y("h2", {
72
75
  className: "text-lg font-semibold text-text-primary",
73
76
  children: n("billing.subscriptions.failedToLoad", "Failed to load subscriptions")
74
77
  }),
75
- /* @__PURE__ */ v("p", {
78
+ /* @__PURE__ */ y("p", {
76
79
  className: "text-sm text-text-secondary",
77
- children: W.message
80
+ children: q.message
78
81
  }),
79
- /* @__PURE__ */ v("button", {
82
+ /* @__PURE__ */ y("button", {
80
83
  type: "button",
81
- onClick: () => G(),
84
+ onClick: () => J(),
82
85
  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",
83
86
  children: n("billing.common.tryAgain", "Try Again")
84
87
  })
85
88
  ]
86
89
  })
87
- }) : /* @__PURE__ */ y("div", {
90
+ }) : /* @__PURE__ */ b("div", {
88
91
  className: "space-y-6 px-6 lg:px-8 py-6",
89
92
  children: [
90
- /* @__PURE__ */ y("div", {
93
+ /* @__PURE__ */ b("div", {
91
94
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
92
- children: [/* @__PURE__ */ y("div", { children: [
93
- /* @__PURE__ */ v("h1", {
95
+ children: [/* @__PURE__ */ b("div", { children: [
96
+ /* @__PURE__ */ y("h1", {
94
97
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
95
98
  children: n("billing.subscriptions.title", "Subscriptions")
96
99
  }),
97
- /* @__PURE__ */ v("p", {
100
+ /* @__PURE__ */ y("p", {
98
101
  className: "text-sm text-text-secondary mt-1",
99
102
  children: n("billing.subscriptions.subtitle", "Manage your active and past subscriptions")
100
103
  }),
101
- /* @__PURE__ */ v(S, {
104
+ /* @__PURE__ */ y(C, {
102
105
  className: "mt-3",
103
106
  children: n("billing.subscriptions.purpose", "See every plan a billing account is subscribed to — active, canceled and expired — in one place. Use it to review what you are paying for, when each plan renews or ends, upgrade or cancel a subscription, and start a new one by browsing plans.")
104
107
  })
105
- ] }), a.canCreateSubscription && /* @__PURE__ */ y("button", {
108
+ ] }), a.canCreateSubscription && /* @__PURE__ */ b("button", {
106
109
  type: "button",
107
110
  onClick: () => i("/plans"),
108
111
  className: "inline-flex items-center gap-2 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",
109
- children: [/* @__PURE__ */ v("svg", {
112
+ children: [/* @__PURE__ */ y("svg", {
110
113
  className: "size-4",
111
114
  fill: "none",
112
115
  viewBox: "0 0 24 24",
113
116
  stroke: "currentColor",
114
- children: /* @__PURE__ */ v("path", {
117
+ children: /* @__PURE__ */ y("path", {
115
118
  strokeLinecap: "round",
116
119
  strokeLinejoin: "round",
117
120
  strokeWidth: 2,
@@ -120,91 +123,91 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
120
123
  }), n("billing.subscriptions.newSubscription", "New Subscription")]
121
124
  })]
122
125
  }),
123
- s.length > 1 && /* @__PURE__ */ y("div", {
126
+ E.length > 1 && /* @__PURE__ */ b("div", {
124
127
  className: "relative",
125
- children: [/* @__PURE__ */ y("button", {
128
+ children: [/* @__PURE__ */ b("button", {
126
129
  type: "button",
127
- onClick: () => k(!O),
130
+ onClick: () => M(!j),
128
131
  className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-seam rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
129
- children: [/* @__PURE__ */ y("div", {
132
+ children: [/* @__PURE__ */ b("div", {
130
133
  className: "flex items-center gap-3",
131
- children: [/* @__PURE__ */ v("div", {
134
+ children: [/* @__PURE__ */ y("div", {
132
135
  className: "size-9 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
133
- children: /* @__PURE__ */ v("svg", {
136
+ children: /* @__PURE__ */ y("svg", {
134
137
  className: "size-4 text-text-link",
135
138
  fill: "none",
136
139
  viewBox: "0 0 24 24",
137
140
  stroke: "currentColor",
138
- children: /* @__PURE__ */ v("path", {
141
+ children: /* @__PURE__ */ y("path", {
139
142
  strokeLinecap: "round",
140
143
  strokeLinejoin: "round",
141
144
  strokeWidth: 2,
142
145
  d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
143
146
  })
144
147
  })
145
- }), /* @__PURE__ */ y("div", {
148
+ }), /* @__PURE__ */ b("div", {
146
149
  className: "text-left",
147
- children: [/* @__PURE__ */ v("p", {
150
+ children: [/* @__PURE__ */ y("p", {
148
151
  className: "text-sm font-medium text-text-primary",
149
- children: K?.name || n("billing.subscriptions.selectAccount", "Select Account")
150
- }), /* @__PURE__ */ v("p", {
152
+ children: Y?.name || n("billing.subscriptions.selectAccount", "Select Account")
153
+ }), /* @__PURE__ */ y("p", {
151
154
  className: "text-xs text-text-secondary",
152
- children: K?.email
155
+ children: Y?.email
153
156
  })]
154
157
  })]
155
- }), /* @__PURE__ */ v("svg", {
156
- className: `size-4 text-text-secondary transition-transform ${O ? "rotate-180" : ""}`,
158
+ }), /* @__PURE__ */ y("svg", {
159
+ className: `size-4 text-text-secondary transition-transform ${j ? "rotate-180" : ""}`,
157
160
  fill: "none",
158
161
  viewBox: "0 0 24 24",
159
162
  stroke: "currentColor",
160
- children: /* @__PURE__ */ v("path", {
163
+ children: /* @__PURE__ */ y("path", {
161
164
  strokeLinecap: "round",
162
165
  strokeLinejoin: "round",
163
166
  strokeWidth: 2,
164
167
  d: "M19 9l-7 7-7-7"
165
168
  })
166
169
  })]
167
- }), O && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("div", {
170
+ }), j && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
168
171
  className: "fixed inset-0 z-10",
169
- onClick: () => k(!1)
170
- }), /* @__PURE__ */ v("div", {
172
+ onClick: () => M(!1)
173
+ }), /* @__PURE__ */ y("div", {
171
174
  className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
172
- children: s.map((e) => /* @__PURE__ */ y("button", {
175
+ children: E.map((e) => /* @__PURE__ */ b("button", {
173
176
  type: "button",
174
- onClick: () => q(e),
177
+ onClick: () => X(e),
175
178
  className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
176
- children: [/* @__PURE__ */ y("div", {
179
+ children: [/* @__PURE__ */ b("div", {
177
180
  className: "flex items-center gap-3 min-w-0",
178
- children: [/* @__PURE__ */ v("div", {
181
+ children: [/* @__PURE__ */ y("div", {
179
182
  className: "size-9 rounded-lg bg-bg-sunken flex items-center justify-center flex-shrink-0",
180
- children: /* @__PURE__ */ v("svg", {
183
+ children: /* @__PURE__ */ y("svg", {
181
184
  className: "size-4 text-text-secondary",
182
185
  fill: "none",
183
186
  viewBox: "0 0 24 24",
184
187
  stroke: "currentColor",
185
- children: /* @__PURE__ */ v("path", {
188
+ children: /* @__PURE__ */ y("path", {
186
189
  strokeLinecap: "round",
187
190
  strokeLinejoin: "round",
188
191
  strokeWidth: 2,
189
192
  d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
190
193
  })
191
194
  })
192
- }), /* @__PURE__ */ y("div", {
195
+ }), /* @__PURE__ */ b("div", {
193
196
  className: "text-left min-w-0",
194
- children: [/* @__PURE__ */ v("p", {
197
+ children: [/* @__PURE__ */ y("p", {
195
198
  className: "text-sm font-medium text-text-primary truncate",
196
199
  children: e.name
197
- }), /* @__PURE__ */ v("p", {
200
+ }), /* @__PURE__ */ y("p", {
198
201
  className: "text-xs text-text-secondary truncate",
199
202
  children: e.email
200
203
  })]
201
204
  })]
202
- }), K?.id === e.id && /* @__PURE__ */ v("svg", {
205
+ }), Y?.id === e.id && /* @__PURE__ */ y("svg", {
203
206
  className: "size-4 text-text-link flex-shrink-0",
204
207
  fill: "none",
205
208
  viewBox: "0 0 24 24",
206
209
  stroke: "currentColor",
207
- children: /* @__PURE__ */ v("path", {
210
+ children: /* @__PURE__ */ y("path", {
208
211
  strokeLinecap: "round",
209
212
  strokeLinejoin: "round",
210
213
  strokeWidth: 2,
@@ -214,32 +217,32 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
214
217
  }, e.id))
215
218
  })] })]
216
219
  }),
217
- K && /* @__PURE__ */ v(b, {
220
+ Y && /* @__PURE__ */ y(x, {
218
221
  className: "p-5",
219
- children: /* @__PURE__ */ y("div", {
222
+ children: /* @__PURE__ */ b("div", {
220
223
  className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
221
224
  children: [
222
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
225
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
223
226
  className: "text-sm text-text-secondary",
224
227
  children: n("billing.subscriptions.account", "Account")
225
- }), /* @__PURE__ */ v("p", {
228
+ }), /* @__PURE__ */ y("p", {
226
229
  className: "text-lg font-semibold text-text-primary mt-1",
227
- children: K.name
230
+ children: Y.name
228
231
  })] }),
229
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
232
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
230
233
  className: "text-sm text-text-secondary",
231
234
  children: n("billing.subscriptions.activeSubscriptions", "Active Subscriptions")
232
- }), /* @__PURE__ */ v("p", {
235
+ }), /* @__PURE__ */ y("p", {
233
236
  className: "text-lg font-semibold tabular-nums text-status-success-text mt-1",
234
- children: B.length
237
+ children: U.length
235
238
  })] }),
236
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
239
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
237
240
  className: "text-sm text-text-secondary",
238
241
  children: n("billing.subscriptions.creditBalance", "Credit Balance")
239
- }), /* @__PURE__ */ y("p", {
242
+ }), /* @__PURE__ */ b("p", {
240
243
  className: "text-lg font-semibold tabular-nums text-text-primary mt-1",
241
244
  children: [
242
- (K.creditAmount || 0).toLocaleString(),
245
+ (Y.creditAmount || 0).toLocaleString(),
243
246
  " ",
244
247
  n("billing.common.credits", "Credits")
245
248
  ]
@@ -247,85 +250,85 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
247
250
  ]
248
251
  })
249
252
  }),
250
- /* @__PURE__ */ y("div", {
253
+ /* @__PURE__ */ b("div", {
251
254
  className: "flex flex-col sm:flex-row flex-wrap items-stretch sm:items-center gap-3 sm:gap-4 pb-4 border-b border-border-subtle",
252
255
  children: [
253
- /* @__PURE__ */ v("div", {
256
+ /* @__PURE__ */ y("div", {
254
257
  className: "inline-flex rounded-lg border border-border-subtle p-1 bg-bg-sunken flex-wrap",
255
258
  children: [
256
259
  "all",
257
260
  "active",
258
261
  "canceled",
259
262
  "inactive"
260
- ].map((e) => /* @__PURE__ */ v("button", {
263
+ ].map((e) => /* @__PURE__ */ y("button", {
261
264
  type: "button",
262
- onClick: () => j(e),
263
- className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors capitalize ${A === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
265
+ onClick: () => P(e),
266
+ className: `px-3 py-1.5 text-sm font-medium rounded-button transition-colors capitalize ${N === e ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
264
267
  children: e === "all" ? n("billing.subscriptions.statusAll", "All") : e === "active" ? n("billing.subscriptions.statusActive", "Active") : e === "canceled" ? n("billing.subscriptions.statusCanceled", "Canceled") : n("billing.subscriptions.statusInactive", "Inactive")
265
268
  }, e))
266
269
  }),
267
- /* @__PURE__ */ y("div", {
270
+ /* @__PURE__ */ b("div", {
268
271
  className: "relative flex-1 min-w-0 w-full sm:max-w-md",
269
- children: [/* @__PURE__ */ v("svg", {
272
+ children: [/* @__PURE__ */ y("svg", {
270
273
  className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-secondary",
271
274
  fill: "none",
272
275
  viewBox: "0 0 24 24",
273
276
  stroke: "currentColor",
274
- children: /* @__PURE__ */ v("path", {
277
+ children: /* @__PURE__ */ y("path", {
275
278
  strokeLinecap: "round",
276
279
  strokeLinejoin: "round",
277
280
  strokeWidth: 2,
278
281
  d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
279
282
  })
280
- }), /* @__PURE__ */ v("input", {
283
+ }), /* @__PURE__ */ y("input", {
281
284
  type: "text",
282
285
  placeholder: n("billing.subscriptions.searchPlaceholder", "Search subscriptions..."),
283
- value: M,
284
- onChange: (e) => N(e.target.value),
286
+ value: F,
287
+ onChange: (e) => I(e.target.value),
285
288
  className: "w-full pl-[3.25rem] pr-4 py-2 text-sm border border-border-subtle rounded-button 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"
286
289
  })]
287
290
  }),
288
- /* @__PURE__ */ v("div", {
291
+ /* @__PURE__ */ y("div", {
289
292
  className: "text-sm text-text-secondary",
290
293
  children: n("billing.subscriptions.totalCount", "{{count}} subscription{{plural}} total", {
291
- count: V,
292
- plural: V === 1 ? "" : "s"
294
+ count: W,
295
+ plural: W === 1 ? "" : "s"
293
296
  })
294
297
  })
295
298
  ]
296
299
  }),
297
- Y.length === 0 ? /* @__PURE__ */ v(x, {
298
- illustration: A !== "all" || P ? "empty-search" : "empty-data",
300
+ Q.length === 0 ? /* @__PURE__ */ y(S, {
301
+ illustration: N !== "all" || L ? "empty-search" : "empty-data",
299
302
  title: n("billing.subscriptions.noSubscriptionsFound", "No subscriptions found"),
300
- description: A !== "all" || P ? n("billing.subscriptions.noSubscriptionsMatchFilters", "No subscriptions match your filters.") : n("billing.subscriptions.noSubscriptionsYet", "You don't have any subscriptions yet."),
301
- action: a.canCreateSubscription && A === "all" && !P ? /* @__PURE__ */ v("button", {
303
+ description: N !== "all" || L ? n("billing.subscriptions.noSubscriptionsMatchFilters", "No subscriptions match your filters.") : n("billing.subscriptions.noSubscriptionsYet", "You don't have any subscriptions yet."),
304
+ action: a.canCreateSubscription && N === "all" && !L ? /* @__PURE__ */ y("button", {
302
305
  type: "button",
303
306
  onClick: () => i("/plans"),
304
307
  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",
305
308
  children: n("billing.subscriptions.browsePlans", "Browse Plans")
306
309
  }) : void 0
307
- }) : /* @__PURE__ */ v("div", {
310
+ }) : /* @__PURE__ */ y("div", {
308
311
  className: "space-y-4",
309
- children: Y.map((e) => /* @__PURE__ */ v(E, {
312
+ children: Q.map((e) => /* @__PURE__ */ y(D, {
310
313
  subscription: e,
311
314
  onView: () => i(d(`/subscriptions/${e.id}`, e.billingAccountId)),
312
315
  canCancel: a.canCancelSubscription
313
316
  }, e.id))
314
317
  }),
315
- H > 1 && /* @__PURE__ */ y("div", {
318
+ G > 1 && /* @__PURE__ */ b("div", {
316
319
  className: "flex items-center justify-center gap-2 pt-4",
317
320
  children: [
318
- /* @__PURE__ */ v("button", {
321
+ /* @__PURE__ */ y("button", {
319
322
  type: "button",
320
- onClick: () => J(I - 1),
321
- disabled: I === 1,
323
+ onClick: () => Z(z - 1),
324
+ disabled: z === 1,
322
325
  className: "px-3 py-1.5 text-sm border border-border-subtle rounded-button disabled:opacity-50 disabled:cursor-not-allowed hover:bg-bg-sunken transition-colors",
323
- children: /* @__PURE__ */ v("svg", {
326
+ children: /* @__PURE__ */ y("svg", {
324
327
  className: "size-4",
325
328
  fill: "none",
326
329
  viewBox: "0 0 24 24",
327
330
  stroke: "currentColor",
328
- children: /* @__PURE__ */ v("path", {
331
+ children: /* @__PURE__ */ y("path", {
329
332
  strokeLinecap: "round",
330
333
  strokeLinejoin: "round",
331
334
  strokeWidth: 2,
@@ -333,32 +336,32 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
333
336
  })
334
337
  })
335
338
  }),
336
- /* @__PURE__ */ v("div", {
339
+ /* @__PURE__ */ y("div", {
337
340
  className: "flex items-center gap-1",
338
- children: Array.from({ length: H }, (e, t) => t + 1).map((e) => {
339
- let t = e === 1 || e === H || Math.abs(e - I) <= 1, n = e === I - 2 && I > 3, r = e === I + 2 && I < H - 2;
340
- return n || r ? /* @__PURE__ */ v("span", {
341
+ children: Array.from({ length: G }, (e, t) => t + 1).map((e) => {
342
+ let t = e === 1 || e === G || Math.abs(e - z) <= 1, n = e === z - 2 && z > 3, r = e === z + 2 && z < G - 2;
343
+ return n || r ? /* @__PURE__ */ y("span", {
341
344
  className: "px-2 text-text-secondary",
342
345
  children: "..."
343
- }, e) : t ? /* @__PURE__ */ v("button", {
346
+ }, e) : t ? /* @__PURE__ */ y("button", {
344
347
  type: "button",
345
- onClick: () => J(e),
346
- className: `px-3 py-1.5 text-sm rounded-button transition-colors ${e === I ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle hover:bg-bg-sunken"}`,
348
+ onClick: () => Z(e),
349
+ className: `px-3 py-1.5 text-sm rounded-button transition-colors ${e === z ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle hover:bg-bg-sunken"}`,
347
350
  children: e
348
351
  }, e) : null;
349
352
  })
350
353
  }),
351
- /* @__PURE__ */ v("button", {
354
+ /* @__PURE__ */ y("button", {
352
355
  type: "button",
353
- onClick: () => J(I + 1),
354
- disabled: I === H,
356
+ onClick: () => Z(z + 1),
357
+ disabled: z === G,
355
358
  className: "px-3 py-1.5 text-sm border border-border-subtle rounded-button disabled:opacity-50 disabled:cursor-not-allowed hover:bg-bg-sunken transition-colors",
356
- children: /* @__PURE__ */ v("svg", {
359
+ children: /* @__PURE__ */ y("svg", {
357
360
  className: "size-4",
358
361
  fill: "none",
359
362
  viewBox: "0 0 24 24",
360
363
  stroke: "currentColor",
361
- children: /* @__PURE__ */ v("path", {
364
+ children: /* @__PURE__ */ y("path", {
362
365
  strokeLinecap: "round",
363
366
  strokeLinejoin: "round",
364
367
  strokeWidth: 2,
@@ -369,19 +372,19 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
369
372
  ]
370
373
  })
371
374
  ]
372
- }) : /* @__PURE__ */ v("div", {
375
+ }) : /* @__PURE__ */ y("div", {
373
376
  className: "flex items-center justify-center h-full min-h-[400px]",
374
- children: /* @__PURE__ */ y("div", {
377
+ children: /* @__PURE__ */ b("div", {
375
378
  className: "text-center space-y-2",
376
379
  children: [
377
- /* @__PURE__ */ v("div", {
380
+ /* @__PURE__ */ y("div", {
378
381
  className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
379
- children: /* @__PURE__ */ v("svg", {
382
+ children: /* @__PURE__ */ y("svg", {
380
383
  className: "size-6 text-text-secondary",
381
384
  fill: "none",
382
385
  viewBox: "0 0 24 24",
383
386
  stroke: "currentColor",
384
- children: /* @__PURE__ */ v("path", {
387
+ children: /* @__PURE__ */ y("path", {
385
388
  strokeLinecap: "round",
386
389
  strokeLinejoin: "round",
387
390
  strokeWidth: 2,
@@ -389,36 +392,36 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
389
392
  })
390
393
  })
391
394
  }),
392
- /* @__PURE__ */ v("h2", {
395
+ /* @__PURE__ */ y("h2", {
393
396
  className: "text-lg font-semibold text-text-primary",
394
397
  children: n("billing.accessDenied.title", "Access Denied")
395
398
  }),
396
- /* @__PURE__ */ v("p", {
399
+ /* @__PURE__ */ y("p", {
397
400
  className: "text-sm text-text-secondary max-w-sm",
398
401
  children: n("billing.subscriptions.noViewPermission", "You don't have permission to view subscriptions.")
399
402
  })
400
403
  ]
401
404
  })
402
405
  });
403
- }, E = ({ subscription: e, onView: r, canCancel: l }) => {
406
+ }, D = ({ subscription: e, onView: r, canCancel: l }) => {
404
407
  let u = t(), d = e.plan, f = c(e.status), p = e.status === "active", m = new Date(e.endDate), h = /* @__PURE__ */ new Date(), g = Math.max(0, Math.ceil((m.getTime() - h.getTime()) / (1e3 * 60 * 60 * 24)));
405
- return /* @__PURE__ */ v("div", {
408
+ return /* @__PURE__ */ y("div", {
406
409
  className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 hover:border-border-strong hover:shadow-elevation-2 transition-all duration-200 cursor-pointer",
407
410
  onClick: r,
408
- children: /* @__PURE__ */ y("div", {
411
+ children: /* @__PURE__ */ b("div", {
409
412
  className: "p-5",
410
413
  children: [
411
- /* @__PURE__ */ y("div", {
414
+ /* @__PURE__ */ b("div", {
412
415
  className: "flex flex-col sm:flex-row sm:items-center gap-4",
413
416
  children: [
414
- /* @__PURE__ */ v("div", {
417
+ /* @__PURE__ */ y("div", {
415
418
  className: "size-12 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center shrink-0",
416
- children: /* @__PURE__ */ v("svg", {
419
+ children: /* @__PURE__ */ y("svg", {
417
420
  className: "size-6 text-text-link",
418
421
  fill: "none",
419
422
  viewBox: "0 0 24 24",
420
423
  stroke: "currentColor",
421
- children: /* @__PURE__ */ v("path", {
424
+ children: /* @__PURE__ */ y("path", {
422
425
  strokeLinecap: "round",
423
426
  strokeLinejoin: "round",
424
427
  strokeWidth: 2,
@@ -426,51 +429,51 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
426
429
  })
427
430
  })
428
431
  }),
429
- /* @__PURE__ */ y("div", {
432
+ /* @__PURE__ */ b("div", {
430
433
  className: "flex-1 min-w-0",
431
- children: [/* @__PURE__ */ y("div", {
434
+ children: [/* @__PURE__ */ b("div", {
432
435
  className: "flex items-center gap-2 flex-wrap",
433
- children: [/* @__PURE__ */ v("h3", {
436
+ children: [/* @__PURE__ */ y("h3", {
434
437
  className: "font-semibold text-text-primary",
435
438
  children: d?.name || u("billing.common.unknownPlan", "Unknown Plan")
436
- }), /* @__PURE__ */ v(n, {
439
+ }), /* @__PURE__ */ y(n, {
437
440
  status: f,
438
441
  dot: !0,
439
442
  pulse: p,
440
443
  children: s(e.status)
441
444
  })]
442
- }), /* @__PURE__ */ y("div", {
445
+ }), /* @__PURE__ */ b("div", {
443
446
  className: "flex items-center gap-4 mt-1 text-sm text-text-secondary",
444
447
  children: [
445
- /* @__PURE__ */ y("span", { children: [
448
+ /* @__PURE__ */ b("span", { children: [
446
449
  d ? i(d.price, d.currency) : "—",
447
450
  " /",
448
451
  " ",
449
452
  d ? o(d.duration) : "—"
450
453
  ] }),
451
- /* @__PURE__ */ v("span", {
454
+ /* @__PURE__ */ y("span", {
452
455
  className: "hidden sm:inline",
453
456
  children: "•"
454
457
  }),
455
- /* @__PURE__ */ v("span", {
458
+ /* @__PURE__ */ y("span", {
456
459
  className: "hidden sm:inline",
457
460
  children: u("billing.subscriptions.started", "Started {{date}}", { date: a(e.startDate, "short") })
458
461
  })
459
462
  ]
460
463
  })]
461
464
  }),
462
- /* @__PURE__ */ y("div", {
465
+ /* @__PURE__ */ b("div", {
463
466
  className: "flex items-center gap-4",
464
- children: [p && /* @__PURE__ */ y("div", {
467
+ children: [p && /* @__PURE__ */ b("div", {
465
468
  className: "text-right",
466
- children: [/* @__PURE__ */ v("p", {
469
+ children: [/* @__PURE__ */ y("p", {
467
470
  className: "text-sm font-medium text-text-primary",
468
471
  children: u("billing.subscriptions.daysRemaining", "{{count}} days", { count: g })
469
- }), /* @__PURE__ */ v("p", {
472
+ }), /* @__PURE__ */ y("p", {
470
473
  className: "text-xs text-text-secondary",
471
474
  children: u("billing.subscriptions.remaining", "remaining")
472
475
  })]
473
- }), /* @__PURE__ */ v("button", {
476
+ }), /* @__PURE__ */ y("button", {
474
477
  type: "button",
475
478
  onClick: (e) => {
476
479
  e.stopPropagation(), r();
@@ -481,9 +484,9 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
481
484
  })
482
485
  ]
483
486
  }),
484
- e.addonSubscriptions && e.addonSubscriptions.length > 0 && /* @__PURE__ */ v("div", {
487
+ e.addonSubscriptions && e.addonSubscriptions.length > 0 && /* @__PURE__ */ y("div", {
485
488
  className: "mt-4 pt-4 border-t border-border-subtle",
486
- children: /* @__PURE__ */ v("p", {
489
+ children: /* @__PURE__ */ y("p", {
487
490
  className: "text-sm text-text-secondary",
488
491
  children: u("billing.subscriptions.addonsAttached", "{{count}} addon{{plural}} attached", {
489
492
  count: e.addonSubscriptions.length,
@@ -491,11 +494,11 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
491
494
  })
492
495
  })
493
496
  }),
494
- e.canceledAt && /* @__PURE__ */ v("div", {
497
+ e.canceledAt && /* @__PURE__ */ y("div", {
495
498
  className: "mt-4 pt-4 border-t border-border-subtle",
496
- children: /* @__PURE__ */ y("p", {
499
+ children: /* @__PURE__ */ b("p", {
497
500
  className: "text-sm text-text-secondary",
498
- children: [u("billing.subscriptions.canceledOn", "Canceled on {{date}}", { date: a(e.canceledAt) }), e.cancellationReason && /* @__PURE__ */ y("span", { children: [": ", e.cancellationReason] })]
501
+ children: [u("billing.subscriptions.canceledOn", "Canceled on {{date}}", { date: a(e.canceledAt) }), e.cancellationReason && /* @__PURE__ */ b("span", { children: [": ", e.cancellationReason] })]
499
502
  })
500
503
  })
501
504
  ]
@@ -503,6 +506,6 @@ var C = ["expired", "upgraded"], w = 10, T = () => {
503
506
  });
504
507
  };
505
508
  //#endregion
506
- export { T as SubscriptionsListPage };
509
+ export { E as SubscriptionsListPage };
507
510
 
508
511
  //# sourceMappingURL=SubscriptionsListPage.js.map