@burdenoff/microfe-billing 2026.514.6 → 2026.515.2

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