@burdenoff/microfe-billing 2026.601.5 → 2026.601.6

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.
@@ -3,20 +3,20 @@ import { statusTokens as t } from "../../../shared/utils/tokens.js";
3
3
  import { formatDateTime as n, formatNumber as r, formatRelativeTime as i } from "../../../shared/utils/format.js";
4
4
  import { useBillingPermissions as a } from "../../../hooks/useBillingPermissions.js";
5
5
  import { useBillingAccountsForUsage as o, useEnhancedUsagePage as s, useQuotaUsageDetails as c, useWorkspaceQuotaHistory as l } from "../hooks/useUsage.js";
6
- import { useCallback as u, useDeferredValue as ee, useMemo as d, useState as f } from "react";
7
- import { AlertCircle as p, AlertTriangle as m, CheckCircle as h, ChevronDown as g, ChevronLeft as _, ChevronRight as v, Clock as y, Info as b, Layers as x, Package as S, RefreshCw as C, Search as w, X as T, XCircle as E } from "lucide-react";
8
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
9
- import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
+ import { useCallback as u, useDeferredValue as d, useMemo as f, useState as p } from "react";
7
+ import { AlertCircle as m, AlertTriangle as h, CheckCircle as g, ChevronDown as _, ChevronLeft as v, ChevronRight as y, Clock as b, Info as x, Layers as S, Package as C, RefreshCw as w, Search as T, X as E, XCircle as D } from "lucide-react";
8
+ import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
9
+ import { useI18n as ee } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
10
10
  //#region src/billing/modules/usage/pages/UsagePage.tsx
11
- var A = ({ status: e, className: n = "size-4" }) => {
11
+ var te = ({ status: e, className: n = "size-4" }) => {
12
12
  switch (e) {
13
- case "EXHAUSTED": return /* @__PURE__ */ O(E, { className: `${n} ${t.error.icon}` });
14
- case "CRITICAL": return /* @__PURE__ */ O(m, { className: `${n} ${t.error.icon}` });
15
- case "WARNING": return /* @__PURE__ */ O(p, { className: `${n} ${t.warning.icon}` });
16
- case "HEALTHY": return /* @__PURE__ */ O(h, { className: `${n} ${t.success.icon}` });
17
- default: return /* @__PURE__ */ O(b, { className: `${n} ${t.neutral.icon}` });
13
+ case "EXHAUSTED": return /* @__PURE__ */ k(D, { className: `${n} ${t.error.icon}` });
14
+ case "CRITICAL": return /* @__PURE__ */ k(h, { className: `${n} ${t.error.icon}` });
15
+ case "WARNING": return /* @__PURE__ */ k(m, { className: `${n} ${t.warning.icon}` });
16
+ case "HEALTHY": return /* @__PURE__ */ k(g, { className: `${n} ${t.success.icon}` });
17
+ default: return /* @__PURE__ */ k(x, { className: `${n} ${t.neutral.icon}` });
18
18
  }
19
- }, j = ({ status: e }) => /* @__PURE__ */ O("span", {
19
+ }, j = ({ status: e }) => /* @__PURE__ */ k("span", {
20
20
  className: `px-2 py-0.5 text-xs font-medium rounded ${{
21
21
  EXHAUSTED: `${t.error.bg} ${t.error.text}`,
22
22
  CRITICAL: `${t.error.bg} ${t.error.text}`,
@@ -27,9 +27,9 @@ var A = ({ status: e, className: n = "size-4" }) => {
27
27
  children: e
28
28
  }), M = ({ percentage: e, status: n }) => {
29
29
  let r = Math.min(100, Math.max(0, e));
30
- return /* @__PURE__ */ O("div", {
30
+ return /* @__PURE__ */ k("div", {
31
31
  className: "w-full bg-muted rounded-full h-2.5 overflow-hidden",
32
- children: /* @__PURE__ */ O("div", {
32
+ children: /* @__PURE__ */ k("div", {
33
33
  className: `h-full rounded-full transition-all duration-300 ${{
34
34
  EXHAUSTED: t.error.dot,
35
35
  CRITICAL: t.error.dot,
@@ -66,60 +66,60 @@ var A = ({ status: e, className: n = "size-4" }) => {
66
66
  red: t.error.icon,
67
67
  gray: t.neutral.icon
68
68
  };
69
- return /* @__PURE__ */ k("button", {
69
+ return /* @__PURE__ */ A("button", {
70
70
  type: "button",
71
71
  onClick: o,
72
72
  className: `border rounded-lg p-4 w-full text-left transition-all ${c[i]} ${o ? "cursor-pointer hover:shadow-md" : ""} ${a ? l[i] : ""}`,
73
- children: [/* @__PURE__ */ k("div", {
73
+ children: [/* @__PURE__ */ A("div", {
74
74
  className: "flex items-center gap-2 mb-2",
75
- children: [/* @__PURE__ */ O("span", {
75
+ children: [/* @__PURE__ */ k("span", {
76
76
  className: u[i],
77
77
  children: r
78
- }), /* @__PURE__ */ O("span", {
78
+ }), /* @__PURE__ */ k("span", {
79
79
  className: "text-sm text-muted-foreground",
80
80
  children: e
81
81
  })]
82
- }), /* @__PURE__ */ O("p", {
82
+ }), /* @__PURE__ */ k("p", {
83
83
  className: "text-2xl font-bold text-foreground",
84
84
  children: n
85
85
  })]
86
86
  });
87
87
  }, P = ({ quota: e, planLabel: t, onClick: n }) => {
88
88
  let i = e.totalLimit != null && e.totalLimit > 0 && !e.noLimit;
89
- return /* @__PURE__ */ k("tr", {
89
+ return /* @__PURE__ */ A("tr", {
90
90
  onClick: n,
91
91
  className: "cursor-pointer hover:bg-muted/40 transition-colors border-b border-border last:border-b-0",
92
92
  children: [
93
- /* @__PURE__ */ k("td", {
93
+ /* @__PURE__ */ A("td", {
94
94
  className: "px-4 py-3",
95
95
  children: [
96
- /* @__PURE__ */ O("span", {
96
+ /* @__PURE__ */ k("span", {
97
97
  className: "text-sm font-medium text-primary hover:underline capitalize",
98
98
  children: e.displayName || e.name.replace(/_/g, " ")
99
99
  }),
100
- /* @__PURE__ */ O("span", {
100
+ /* @__PURE__ */ k("span", {
101
101
  className: "block text-xs font-mono text-muted-foreground mt-0.5",
102
102
  children: e.name
103
103
  }),
104
- e.description && /* @__PURE__ */ O("span", {
104
+ e.description && /* @__PURE__ */ k("span", {
105
105
  className: "block text-xs text-muted-foreground mt-0.5 max-w-[220px] truncate",
106
106
  children: e.description
107
107
  }),
108
- e.quotaCount > 1 && /* @__PURE__ */ k("span", {
108
+ e.quotaCount > 1 && /* @__PURE__ */ A("span", {
109
109
  className: "block text-xs text-muted-foreground mt-0.5",
110
110
  children: [e.quotaCount, " assignments"]
111
111
  })
112
112
  ]
113
113
  }),
114
- t !== void 0 && /* @__PURE__ */ O("td", {
114
+ t !== void 0 && /* @__PURE__ */ k("td", {
115
115
  className: "px-4 py-3 text-sm text-muted-foreground whitespace-nowrap",
116
116
  children: t
117
117
  }),
118
- /* @__PURE__ */ O("td", {
118
+ /* @__PURE__ */ k("td", {
119
119
  className: "px-4 py-3",
120
- children: /* @__PURE__ */ k("div", {
120
+ children: /* @__PURE__ */ A("div", {
121
121
  className: "space-y-1.5",
122
- children: [/* @__PURE__ */ k("span", {
122
+ children: [/* @__PURE__ */ A("span", {
123
123
  className: "text-sm text-foreground tabular-nums",
124
124
  children: [
125
125
  r(e.totalUsed),
@@ -127,58 +127,58 @@ var A = ({ status: e, className: n = "size-4" }) => {
127
127
  i ? r(e.totalLimit) : "∞",
128
128
  e.unit ? ` ${e.unit}` : ""
129
129
  ]
130
- }), /* @__PURE__ */ O(M, {
130
+ }), /* @__PURE__ */ k(M, {
131
131
  percentage: i ? e.usagePercentage : 0,
132
132
  status: e.status
133
133
  })]
134
134
  })
135
135
  }),
136
- /* @__PURE__ */ O("td", {
136
+ /* @__PURE__ */ k("td", {
137
137
  className: "px-4 py-3 text-sm text-muted-foreground tabular-nums whitespace-nowrap",
138
138
  children: i ? r(e.totalLimit) : "∞"
139
139
  }),
140
- /* @__PURE__ */ O("td", {
140
+ /* @__PURE__ */ k("td", {
141
141
  className: "px-4 py-3",
142
- children: /* @__PURE__ */ O(j, { status: e.status })
142
+ children: /* @__PURE__ */ k(j, { status: e.status })
143
143
  })
144
144
  ]
145
145
  });
146
- }, ne = ({ quotas: e, planLabel: t, showPlanColumn: n = !0, onQuotaClick: r }) => /* @__PURE__ */ O("div", {
146
+ }, ne = ({ quotas: e, planLabel: t, showPlanColumn: n = !0, onQuotaClick: r }) => /* @__PURE__ */ k("div", {
147
147
  className: "overflow-x-auto rounded-lg border border-border bg-card",
148
- children: /* @__PURE__ */ k("table", {
148
+ children: /* @__PURE__ */ A("table", {
149
149
  className: "w-full text-left",
150
- children: [/* @__PURE__ */ O("thead", { children: /* @__PURE__ */ k("tr", {
150
+ children: [/* @__PURE__ */ k("thead", { children: /* @__PURE__ */ A("tr", {
151
151
  className: "border-b border-border bg-muted/30",
152
152
  children: [
153
- /* @__PURE__ */ O("th", {
153
+ /* @__PURE__ */ k("th", {
154
154
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
155
155
  children: "Quotas"
156
156
  }),
157
- n && /* @__PURE__ */ O("th", {
157
+ n && /* @__PURE__ */ k("th", {
158
158
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
159
159
  children: "Plan"
160
160
  }),
161
- /* @__PURE__ */ O("th", {
161
+ /* @__PURE__ */ k("th", {
162
162
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
163
163
  children: "Current Usage"
164
164
  }),
165
- /* @__PURE__ */ O("th", {
165
+ /* @__PURE__ */ k("th", {
166
166
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
167
167
  children: "Limit"
168
168
  }),
169
- /* @__PURE__ */ O("th", {
169
+ /* @__PURE__ */ k("th", {
170
170
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
171
171
  children: "Status"
172
172
  })
173
173
  ]
174
- }) }), /* @__PURE__ */ O("tbody", { children: e.map((e) => /* @__PURE__ */ O(P, {
174
+ }) }), /* @__PURE__ */ k("tbody", { children: e.map((e) => /* @__PURE__ */ k(P, {
175
175
  quota: e,
176
176
  planLabel: n ? t : void 0,
177
177
  onClick: () => r(e)
178
178
  }, e.name)) })]
179
179
  })
180
- }), re = ({ subscription: e, onQuotaClick: n, defaultExpanded: r = !0 }) => {
181
- let [i, a] = f(r), o = {
180
+ }), F = ({ subscription: e, onQuotaClick: n, defaultExpanded: r = !0 }) => {
181
+ let [i, a] = p(r), o = {
182
182
  active: `${t.success.bg} ${t.success.text}`,
183
183
  trialing: `${t.info.bg} ${t.info.text}`,
184
184
  past_due: `${t.warning.bg} ${t.warning.text}`,
@@ -186,27 +186,27 @@ var A = ({ status: e, className: n = "size-4" }) => {
186
186
  expired: `${t.neutral.bg} ${t.neutral.text}`,
187
187
  upgraded: `${t.primary.bg} ${t.primary.text}`
188
188
  };
189
- return /* @__PURE__ */ k("div", {
189
+ return /* @__PURE__ */ A("div", {
190
190
  className: "border border-border rounded-lg bg-card overflow-hidden",
191
191
  children: [
192
- /* @__PURE__ */ k("button", {
192
+ /* @__PURE__ */ A("button", {
193
193
  type: "button",
194
194
  onClick: () => a(!i),
195
195
  className: "w-full flex items-center justify-between p-4 hover:bg-muted/50 transition-colors",
196
- children: [/* @__PURE__ */ k("div", {
196
+ children: [/* @__PURE__ */ A("div", {
197
197
  className: "flex items-center gap-3",
198
- children: [/* @__PURE__ */ O(S, { className: "size-5 text-primary" }), /* @__PURE__ */ k("div", {
198
+ children: [/* @__PURE__ */ k(C, { className: "size-5 text-primary" }), /* @__PURE__ */ A("div", {
199
199
  className: "text-left",
200
- children: [/* @__PURE__ */ k("div", {
200
+ children: [/* @__PURE__ */ A("div", {
201
201
  className: "flex items-center gap-2",
202
- children: [/* @__PURE__ */ O("span", {
202
+ children: [/* @__PURE__ */ k("span", {
203
203
  className: "font-medium text-foreground",
204
204
  children: "Subscription"
205
- }), /* @__PURE__ */ O("span", {
205
+ }), /* @__PURE__ */ k("span", {
206
206
  className: `px-2 py-0.5 text-xs font-medium rounded capitalize ${o[e.status.toLowerCase()] || o.active}`,
207
207
  children: e.status
208
208
  })]
209
- }), /* @__PURE__ */ k("p", {
209
+ }), /* @__PURE__ */ A("p", {
210
210
  className: "text-xs text-muted-foreground",
211
211
  children: [
212
212
  e.aggregatedQuotas.length,
@@ -215,65 +215,65 @@ var A = ({ status: e, className: n = "size-4" }) => {
215
215
  ]
216
216
  })]
217
217
  })]
218
- }), O(i ? g : v, { className: "size-5 text-muted-foreground" })]
218
+ }), k(i ? _ : y, { className: "size-5 text-muted-foreground" })]
219
219
  }),
220
- i && e.aggregatedQuotas.length > 0 && /* @__PURE__ */ O("div", {
220
+ i && e.aggregatedQuotas.length > 0 && /* @__PURE__ */ k("div", {
221
221
  className: "border-t border-border",
222
- children: /* @__PURE__ */ O(ne, {
222
+ children: /* @__PURE__ */ k(ne, {
223
223
  quotas: e.aggregatedQuotas,
224
224
  planLabel: e.planName || e.productId || void 0,
225
225
  showPlanColumn: !!(e.planName || e.productId),
226
226
  onQuotaClick: n
227
227
  })
228
228
  }),
229
- i && e.aggregatedQuotas.length === 0 && /* @__PURE__ */ O("div", {
229
+ i && e.aggregatedQuotas.length === 0 && /* @__PURE__ */ k("div", {
230
230
  className: "border-t border-border p-6 text-center",
231
- children: /* @__PURE__ */ O("p", {
231
+ children: /* @__PURE__ */ k("p", {
232
232
  className: "text-sm text-muted-foreground",
233
233
  children: "No quotas assigned to this subscription"
234
234
  })
235
235
  })
236
236
  ]
237
237
  });
238
- }, ie = ({ quota: a, onClose: o }) => {
239
- let [s, u] = f([null]), ee = s[s.length - 1] ?? null, d = s.length, { workspaceId: p } = e(), m = a.quotaAssignments[0]?.id, { usages: h, hasNextPage: g, nextCursor: y, isLoading: b } = c(m, 10, ee, p), { snapshots: x, isLoading: S } = l(p, a.name, 24), C = () => {
240
- y && u((e) => [...e, y]);
241
- }, w = () => {
238
+ }, re = ({ quota: a, onClose: o }) => {
239
+ let [s, u] = p([null]), d = s[s.length - 1] ?? null, f = s.length, { workspaceId: m } = e(), h = a.quotaAssignments[0]?.id, { usages: g, hasNextPage: _, nextCursor: b, isLoading: x } = c(h, 10, d, m), { snapshots: S, isLoading: C } = l(m, a.name, 24), w = () => {
240
+ b && u((e) => [...e, b]);
241
+ }, T = () => {
242
242
  s.length > 1 && u((e) => e.slice(0, -1));
243
243
  };
244
- return /* @__PURE__ */ k("div", {
244
+ return /* @__PURE__ */ A("div", {
245
245
  className: "fixed inset-0 z-50 flex items-center justify-center",
246
- children: [/* @__PURE__ */ O("div", {
246
+ children: [/* @__PURE__ */ k("div", {
247
247
  className: "absolute inset-0 bg-overlay-scrim",
248
248
  onClick: o
249
- }), /* @__PURE__ */ k("div", {
249
+ }), /* @__PURE__ */ A("div", {
250
250
  className: "relative bg-background border border-border rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-auto",
251
251
  role: "dialog",
252
252
  "aria-modal": "true",
253
253
  "aria-labelledby": "quota-detail-title",
254
254
  children: [
255
- /* @__PURE__ */ k("div", {
255
+ /* @__PURE__ */ A("div", {
256
256
  className: "sticky top-0 bg-background border-b border-border p-4 flex items-center justify-between",
257
- children: [/* @__PURE__ */ k("div", {
257
+ children: [/* @__PURE__ */ A("div", {
258
258
  className: "flex items-center gap-3",
259
- children: [/* @__PURE__ */ O(A, {
259
+ children: [/* @__PURE__ */ k(te, {
260
260
  status: a.status,
261
261
  className: "size-5"
262
- }), /* @__PURE__ */ k("div", { children: [
263
- /* @__PURE__ */ O("h2", {
262
+ }), /* @__PURE__ */ A("div", { children: [
263
+ /* @__PURE__ */ k("h2", {
264
264
  id: "quota-detail-title",
265
265
  className: "text-lg font-semibold capitalize",
266
266
  children: a.displayName || a.name.replace(/_/g, " ")
267
267
  }),
268
- /* @__PURE__ */ O("p", {
268
+ /* @__PURE__ */ k("p", {
269
269
  className: "text-xs font-mono text-muted-foreground",
270
270
  children: a.name
271
271
  }),
272
- a.description && /* @__PURE__ */ O("p", {
272
+ a.description && /* @__PURE__ */ k("p", {
273
273
  className: "text-sm text-muted-foreground mt-0.5",
274
274
  children: a.description
275
275
  }),
276
- /* @__PURE__ */ k("p", {
276
+ /* @__PURE__ */ A("p", {
277
277
  className: "text-sm text-muted-foreground mt-0.5",
278
278
  children: [
279
279
  a.quotaCount,
@@ -282,33 +282,33 @@ var A = ({ status: e, className: n = "size-4" }) => {
282
282
  ]
283
283
  })
284
284
  ] })]
285
- }), /* @__PURE__ */ O("button", {
285
+ }), /* @__PURE__ */ k("button", {
286
286
  type: "button",
287
287
  onClick: o,
288
288
  className: "p-1 rounded-md hover:bg-muted/50 transition-colors",
289
289
  "aria-label": "Close quota details",
290
- children: /* @__PURE__ */ O(T, { className: "size-5" })
290
+ children: /* @__PURE__ */ k(E, { className: "size-5" })
291
291
  })]
292
292
  }),
293
- /* @__PURE__ */ k("div", {
293
+ /* @__PURE__ */ A("div", {
294
294
  className: "p-4 border-b border-border",
295
- children: [/* @__PURE__ */ k("div", {
295
+ children: [/* @__PURE__ */ A("div", {
296
296
  className: "mb-4",
297
297
  children: [
298
- /* @__PURE__ */ k("div", {
298
+ /* @__PURE__ */ A("div", {
299
299
  className: "flex items-center justify-between mb-2",
300
- children: [/* @__PURE__ */ O("span", {
300
+ children: [/* @__PURE__ */ k("span", {
301
301
  className: "text-sm text-muted-foreground",
302
302
  children: "Usage"
303
- }), /* @__PURE__ */ O(j, { status: a.status })]
303
+ }), /* @__PURE__ */ k(j, { status: a.status })]
304
304
  }),
305
- /* @__PURE__ */ O(M, {
305
+ /* @__PURE__ */ k(M, {
306
306
  percentage: a.usagePercentage,
307
307
  status: a.status
308
308
  }),
309
- /* @__PURE__ */ k("div", {
309
+ /* @__PURE__ */ A("div", {
310
310
  className: "flex items-center justify-between mt-2 text-sm",
311
- children: [/* @__PURE__ */ k("span", {
311
+ children: [/* @__PURE__ */ A("span", {
312
312
  className: "font-medium",
313
313
  children: [
314
314
  r(a.totalUsed),
@@ -317,44 +317,44 @@ var A = ({ status: e, className: n = "size-4" }) => {
317
317
  a.totalLimit != null && a.totalLimit > 0 ? r(a.totalLimit) : "∞",
318
318
  a.unit && ` ${a.unit}`
319
319
  ]
320
- }), /* @__PURE__ */ O("span", {
320
+ }), /* @__PURE__ */ k("span", {
321
321
  className: "text-muted-foreground",
322
322
  children: a.totalLimit != null && a.totalLimit > 0 ? `${Math.round(a.usagePercentage)}% used` : "Unlimited"
323
323
  })]
324
324
  })
325
325
  ]
326
- }), a.quotaCount > 1 && /* @__PURE__ */ k("div", {
326
+ }), a.quotaCount > 1 && /* @__PURE__ */ A("div", {
327
327
  className: "mt-4",
328
- children: [/* @__PURE__ */ O("h3", {
328
+ children: [/* @__PURE__ */ k("h3", {
329
329
  className: "text-sm font-medium text-foreground mb-3",
330
330
  children: "Quota Breakdown"
331
- }), /* @__PURE__ */ O("div", {
331
+ }), /* @__PURE__ */ k("div", {
332
332
  className: "border border-border rounded-lg overflow-hidden divide-y divide-border",
333
333
  children: [...a.quotaAssignments].sort((e, t) => (e.endtime ? new Date(e.endtime).getTime() : Infinity) - (t.endtime ? new Date(t.endtime).getTime() : Infinity)).map((e) => {
334
334
  let n = e.endtime ? new Date(e.endtime) : null, i = /* @__PURE__ */ new Date(), a = n && n < i, o = n ? Math.ceil((n.getTime() - i.getTime()) / (1440 * 60 * 1e3)) : null, s = o !== null && o > 0 && o <= 7;
335
- return /* @__PURE__ */ k("div", {
335
+ return /* @__PURE__ */ A("div", {
336
336
  className: `flex items-center justify-between px-3 py-2.5 ${a ? "bg-muted/30" : s ? t.warning.bg : "bg-background"}`,
337
- children: [/* @__PURE__ */ k("div", {
337
+ children: [/* @__PURE__ */ A("div", {
338
338
  className: "flex items-center gap-2",
339
- children: [s && !a && /* @__PURE__ */ O("span", { className: `size-2 rounded-full ${t.warning.dot} animate-pulse` }), /* @__PURE__ */ k("div", {
339
+ children: [s && !a && /* @__PURE__ */ k("span", { className: `size-2 rounded-full ${t.warning.dot} animate-pulse` }), /* @__PURE__ */ A("div", {
340
340
  className: "flex flex-col",
341
- children: [/* @__PURE__ */ O("span", {
341
+ children: [/* @__PURE__ */ k("span", {
342
342
  className: `text-sm ${a ? "text-muted-foreground" : "text-foreground"}`,
343
343
  children: n ? n.toLocaleDateString("en-US", {
344
344
  month: "short",
345
345
  day: "numeric",
346
346
  year: "numeric"
347
347
  }) : "No expiry"
348
- }), /* @__PURE__ */ O("span", {
348
+ }), /* @__PURE__ */ k("span", {
349
349
  className: `text-xs ${a ? "text-destructive" : s ? t.warning.text : "text-muted-foreground"}`,
350
350
  children: a ? "Expired" : o === null ? "Never expires" : o === 0 ? "Expires today" : o === 1 ? "Expires tomorrow" : `${o} days left`
351
351
  })]
352
352
  })]
353
- }), /* @__PURE__ */ O("div", {
353
+ }), /* @__PURE__ */ k("div", {
354
354
  className: "text-right",
355
- children: /* @__PURE__ */ k("span", {
355
+ children: /* @__PURE__ */ A("span", {
356
356
  className: `text-sm font-semibold ${a ? "text-muted-foreground" : "text-foreground"}`,
357
- children: [r(e.used), /* @__PURE__ */ k("span", {
357
+ children: [r(e.used), /* @__PURE__ */ A("span", {
358
358
  className: "text-muted-foreground font-normal",
359
359
  children: [
360
360
  " / ",
@@ -369,34 +369,34 @@ var A = ({ status: e, className: n = "size-4" }) => {
369
369
  })]
370
370
  })]
371
371
  }),
372
- (S || x.length > 0) && /* @__PURE__ */ k("div", {
372
+ (C || S.length > 0) && /* @__PURE__ */ A("div", {
373
373
  className: "p-4 border-t border-border",
374
- children: [/* @__PURE__ */ O("h3", {
374
+ children: [/* @__PURE__ */ k("h3", {
375
375
  className: "text-sm font-medium text-foreground mb-3",
376
376
  children: "Live Value History"
377
- }), S ? /* @__PURE__ */ O("div", {
377
+ }), C ? /* @__PURE__ */ k("div", {
378
378
  className: "space-y-1.5",
379
379
  children: [
380
380
  1,
381
381
  2,
382
382
  3
383
- ].map((e) => /* @__PURE__ */ O("div", { className: "h-8 bg-muted animate-pulse rounded" }, e))
384
- }) : /* @__PURE__ */ O("div", {
383
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-8 bg-muted animate-pulse rounded" }, e))
384
+ }) : /* @__PURE__ */ k("div", {
385
385
  className: "space-y-1.5",
386
- children: x.map((e) => /* @__PURE__ */ k("div", {
386
+ children: S.map((e) => /* @__PURE__ */ A("div", {
387
387
  className: "flex items-center justify-between px-3 py-2 bg-muted/30 rounded-md",
388
- children: [/* @__PURE__ */ O("span", {
388
+ children: [/* @__PURE__ */ k("span", {
389
389
  className: "text-xs text-muted-foreground",
390
390
  children: n(e.snapshotAt)
391
- }), /* @__PURE__ */ k("span", {
391
+ }), /* @__PURE__ */ A("span", {
392
392
  className: "text-sm font-medium text-foreground tabular-nums",
393
393
  children: [
394
394
  r(e.value),
395
- a.unit && /* @__PURE__ */ O("span", {
395
+ a.unit && /* @__PURE__ */ k("span", {
396
396
  className: "text-xs text-muted-foreground ml-1",
397
397
  children: a.unit
398
398
  }),
399
- !e.noLimit && e.limit != null && /* @__PURE__ */ k("span", {
399
+ !e.noLimit && e.limit != null && /* @__PURE__ */ A("span", {
400
400
  className: "text-xs text-muted-foreground ml-1",
401
401
  children: ["/ ", r(e.limit)]
402
402
  })
@@ -405,36 +405,36 @@ var A = ({ status: e, className: n = "size-4" }) => {
405
405
  }, e.id))
406
406
  })]
407
407
  }),
408
- /* @__PURE__ */ k("div", {
408
+ /* @__PURE__ */ A("div", {
409
409
  className: "p-4",
410
410
  children: [
411
- /* @__PURE__ */ O("h3", {
411
+ /* @__PURE__ */ k("h3", {
412
412
  className: "text-sm font-medium text-foreground mb-3",
413
413
  children: "Recent Usage"
414
414
  }),
415
- a.isCollectorBased ? /* @__PURE__ */ O("p", {
415
+ a.isCollectorBased ? /* @__PURE__ */ k("p", {
416
416
  className: "text-sm text-muted-foreground text-center py-6",
417
417
  children: "Usage is tracked via system metrics, individual event records are not available for this quota."
418
- }) : b ? /* @__PURE__ */ O("div", {
418
+ }) : x ? /* @__PURE__ */ k("div", {
419
419
  className: "space-y-2",
420
420
  children: [
421
421
  1,
422
422
  2,
423
423
  3
424
- ].map((e) => /* @__PURE__ */ O("div", { className: "h-12 bg-muted animate-pulse rounded" }, e))
425
- }) : h.length === 0 ? /* @__PURE__ */ O("p", {
424
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-12 bg-muted animate-pulse rounded" }, e))
425
+ }) : g.length === 0 ? /* @__PURE__ */ k("p", {
426
426
  className: "text-sm text-muted-foreground text-center py-6",
427
427
  children: "No usage records found"
428
- }) : /* @__PURE__ */ O("div", {
428
+ }) : /* @__PURE__ */ k("div", {
429
429
  className: "space-y-2",
430
- children: h.map((e) => /* @__PURE__ */ k("div", {
430
+ children: g.map((e) => /* @__PURE__ */ A("div", {
431
431
  className: "flex items-center justify-between p-3 border border-border rounded-lg",
432
- children: [/* @__PURE__ */ k("div", {
432
+ children: [/* @__PURE__ */ A("div", {
433
433
  className: "flex-1 min-w-0",
434
- children: [/* @__PURE__ */ O("p", {
434
+ children: [/* @__PURE__ */ k("p", {
435
435
  className: "text-sm font-medium text-foreground",
436
436
  children: e.description || "Usage recorded"
437
- }), /* @__PURE__ */ k("p", {
437
+ }), /* @__PURE__ */ A("p", {
438
438
  className: "text-xs text-muted-foreground",
439
439
  children: [
440
440
  i(e.timestamp),
@@ -442,42 +442,42 @@ var A = ({ status: e, className: n = "size-4" }) => {
442
442
  n(e.timestamp)
443
443
  ]
444
444
  })]
445
- }), /* @__PURE__ */ O("span", {
445
+ }), /* @__PURE__ */ k("span", {
446
446
  className: "text-sm font-medium text-foreground ml-4",
447
447
  children: r(e.amount)
448
448
  })]
449
449
  }, e.id))
450
450
  }),
451
- !a.isCollectorBased && (s.length > 1 || g) && /* @__PURE__ */ k("div", {
451
+ !a.isCollectorBased && (s.length > 1 || _) && /* @__PURE__ */ A("div", {
452
452
  className: "flex items-center justify-center gap-2 mt-4",
453
453
  children: [
454
- /* @__PURE__ */ O("button", {
454
+ /* @__PURE__ */ k("button", {
455
455
  type: "button",
456
- onClick: w,
456
+ onClick: T,
457
457
  disabled: s.length === 1,
458
458
  className: "px-3 py-1.5 text-sm border border-border rounded-md disabled:opacity-50",
459
459
  "aria-label": "Previous usage page",
460
- children: /* @__PURE__ */ O(_, { className: "size-4" })
460
+ children: /* @__PURE__ */ k(v, { className: "size-4" })
461
461
  }),
462
- /* @__PURE__ */ k("span", {
462
+ /* @__PURE__ */ A("span", {
463
463
  className: "text-sm text-muted-foreground",
464
- children: ["Page ", d]
464
+ children: ["Page ", f]
465
465
  }),
466
- /* @__PURE__ */ O("button", {
466
+ /* @__PURE__ */ k("button", {
467
467
  type: "button",
468
- onClick: C,
469
- disabled: !g,
468
+ onClick: w,
469
+ disabled: !_,
470
470
  className: "px-3 py-1.5 text-sm border border-border rounded-md disabled:opacity-50",
471
471
  "aria-label": "Next usage page",
472
- children: /* @__PURE__ */ O(v, { className: "size-4" })
472
+ children: /* @__PURE__ */ k(y, { className: "size-4" })
473
473
  })
474
474
  ]
475
475
  })
476
476
  ]
477
477
  }),
478
- /* @__PURE__ */ O("div", {
478
+ /* @__PURE__ */ k("div", {
479
479
  className: "sticky bottom-0 bg-background border-t border-border p-4",
480
- children: /* @__PURE__ */ O("button", {
480
+ children: /* @__PURE__ */ k("button", {
481
481
  type: "button",
482
482
  onClick: o,
483
483
  className: "w-full py-2 px-4 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
@@ -487,107 +487,103 @@ var A = ({ status: e, className: n = "size-4" }) => {
487
487
  ]
488
488
  })]
489
489
  });
490
- }, F = () => {
491
- let { t: n } = te(), r = (e, t) => {
490
+ }, I = () => {
491
+ let { t: n } = ee(), r = (e, t) => {
492
492
  let r = n(e);
493
493
  return r === e ? t : r;
494
- }, i = a(), [c, l] = f(() => {
494
+ }, i = a(), [c, l] = p(() => {
495
495
  if (!(typeof window > "u")) return new URLSearchParams(window.location.search).get("billingAccountId") || void 0;
496
- }), [_, v] = f(null), [b, j] = f(""), [M, P] = f("all"), [F, I] = f("active"), L = ee(b), { billingAccounts: R, isLoading: ae } = o(), oe = (R.find((e) => e.isDefault) ?? R[0])?.id, z = c ?? oe, { workspaceId: se, navigate: B, basePath: V } = e();
497
- u((e) => {
498
- B(`${V}${e}`);
499
- }, [B, V]);
500
- let { dashboard: H, pooledQuotas: U, activeSubscriptions: W, pastSubscriptions: G, isLoading: ce, isPastSubscriptionsLoading: K, error: le, refetch: ue, loadMorePastSubscriptions: de, hasMorePastSubscriptions: fe, isLoadingMorePast: pe, pastSubscriptionsCount: me } = s({
496
+ }), [v, y] = p(null), [x, j] = p(""), [M, P] = p("all"), [I, L] = p("active"), ie = d(x), { billingAccounts: R, isLoading: ae } = o(), oe = (R.find((e) => e.isDefault) ?? R[0])?.id, z = c ?? oe, { workspaceId: se, navigate: ce } = e(), { dashboard: B, pooledQuotas: V, activeSubscriptions: H, pastSubscriptions: U, isLoading: le, isPastSubscriptionsLoading: W, error: G, refetch: ue, loadMorePastSubscriptions: de, hasMorePastSubscriptions: fe, isLoadingMorePast: pe, pastSubscriptionsCount: K } = s({
501
497
  billingAccountId: z,
502
498
  workspaceId: se,
503
- searchQuery: L || void 0,
504
- viewMode: F
505
- }), q = u((e) => M === "all" ? !0 : M === "healthy" ? e.status === "HEALTHY" : M === "warning" ? e.status === "WARNING" : M === "critical" ? e.status === "CRITICAL" || e.status === "EXHAUSTED" : !0, [M]), J = d(() => U.filter(q), [U, q]), Y = d(() => M === "all" ? W : W.map((e) => ({
499
+ searchQuery: ie || void 0,
500
+ viewMode: I
501
+ }), q = u((e) => M === "all" ? !0 : M === "healthy" ? e.status === "HEALTHY" : M === "warning" ? e.status === "WARNING" : M === "critical" ? e.status === "CRITICAL" || e.status === "EXHAUSTED" : !0, [M]), J = f(() => V.filter(q), [V, q]), Y = f(() => M === "all" ? H : H.map((e) => ({
506
502
  ...e,
507
503
  aggregatedQuotas: e.aggregatedQuotas.filter(q)
508
504
  })).filter((e) => e.aggregatedQuotas.length > 0), [
509
- W,
505
+ H,
510
506
  M,
511
507
  q
512
- ]), X = d(() => M === "all" ? G : G.map((e) => ({
508
+ ]), X = f(() => M === "all" ? U : U.map((e) => ({
513
509
  ...e,
514
510
  aggregatedQuotas: e.aggregatedQuotas.filter(q)
515
511
  })).filter((e) => e.aggregatedQuotas.length > 0), [
516
- G,
512
+ U,
517
513
  M,
518
514
  q
519
- ]), Z = d(() => F === "active" ? {
515
+ ]), Z = f(() => I === "active" ? {
520
516
  active: Y,
521
517
  past: []
522
- } : F === "past" ? {
518
+ } : I === "past" ? {
523
519
  active: [],
524
520
  past: X
525
521
  } : {
526
522
  active: Y,
527
523
  past: X
528
524
  }, [
529
- F,
525
+ I,
530
526
  Y,
531
527
  X
532
- ]), Q = b !== "" || M !== "all", he = L !== b, ge = () => {
528
+ ]), Q = x !== "" || M !== "all", me = ie !== x, he = () => {
533
529
  j(""), P("all");
534
530
  }, $ = (e) => {
535
531
  P((t) => t === e ? "all" : e);
536
532
  };
537
- if (!i.canViewUsage) return /* @__PURE__ */ O("div", {
533
+ if (!i.canViewUsage) return /* @__PURE__ */ k("div", {
538
534
  className: "flex items-center justify-center h-full min-h-[400px]",
539
- children: /* @__PURE__ */ k("div", {
535
+ children: /* @__PURE__ */ A("div", {
540
536
  className: "text-center space-y-2",
541
537
  children: [
542
- /* @__PURE__ */ O("div", {
538
+ /* @__PURE__ */ k("div", {
543
539
  className: "size-12 mx-auto rounded-full bg-muted flex items-center justify-center",
544
- children: /* @__PURE__ */ O(m, { className: "size-6 text-muted-foreground" })
540
+ children: /* @__PURE__ */ k(h, { className: "size-6 text-muted-foreground" })
545
541
  }),
546
- /* @__PURE__ */ O("h2", {
542
+ /* @__PURE__ */ k("h2", {
547
543
  className: "text-lg font-semibold text-foreground",
548
544
  children: "Access Denied"
549
545
  }),
550
- /* @__PURE__ */ O("p", {
546
+ /* @__PURE__ */ k("p", {
551
547
  className: "text-sm text-muted-foreground max-w-sm",
552
548
  children: "You don't have permission to view usage data."
553
549
  })
554
550
  ]
555
551
  })
556
552
  });
557
- if ((ae || ce) && !H) return /* @__PURE__ */ k("div", {
553
+ if ((ae || le) && !B) return /* @__PURE__ */ A("div", {
558
554
  className: "space-y-6 p-6",
559
555
  children: [
560
- /* @__PURE__ */ O("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }),
561
- /* @__PURE__ */ O("div", {
556
+ /* @__PURE__ */ k("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }),
557
+ /* @__PURE__ */ k("div", {
562
558
  className: "grid grid-cols-2 sm:grid-cols-4 gap-4",
563
559
  children: [
564
560
  1,
565
561
  2,
566
562
  3,
567
563
  4
568
- ].map((e) => /* @__PURE__ */ O("div", { className: "h-24 bg-muted animate-pulse rounded-lg" }, e))
564
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-24 bg-muted animate-pulse rounded-lg" }, e))
569
565
  }),
570
- /* @__PURE__ */ O("div", { className: "h-64 bg-muted animate-pulse rounded-lg" })
566
+ /* @__PURE__ */ k("div", { className: "h-64 bg-muted animate-pulse rounded-lg" })
571
567
  ]
572
568
  });
573
- if (le) return /* @__PURE__ */ O("div", {
569
+ if (G) return /* @__PURE__ */ k("div", {
574
570
  className: "flex items-center justify-center h-full min-h-[400px]",
575
- children: /* @__PURE__ */ k("div", {
571
+ children: /* @__PURE__ */ A("div", {
576
572
  className: "text-center space-y-4",
577
573
  children: [
578
- /* @__PURE__ */ O("div", {
574
+ /* @__PURE__ */ k("div", {
579
575
  className: "size-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",
580
- children: /* @__PURE__ */ O(m, { className: "size-6 text-destructive" })
576
+ children: /* @__PURE__ */ k(h, { className: "size-6 text-destructive" })
581
577
  }),
582
- /* @__PURE__ */ O("h2", {
578
+ /* @__PURE__ */ k("h2", {
583
579
  className: "text-lg font-semibold text-foreground",
584
580
  children: "Failed to load usage data"
585
581
  }),
586
- /* @__PURE__ */ O("p", {
582
+ /* @__PURE__ */ k("p", {
587
583
  className: "text-sm text-muted-foreground",
588
- children: le.message
584
+ children: G.message
589
585
  }),
590
- /* @__PURE__ */ O("button", {
586
+ /* @__PURE__ */ k("button", {
591
587
  type: "button",
592
588
  onClick: () => ue(),
593
589
  className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
@@ -596,349 +592,349 @@ var A = ({ status: e, className: n = "size-4" }) => {
596
592
  ]
597
593
  })
598
594
  });
599
- let _e = R.find((e) => e.id === z);
600
- return /* @__PURE__ */ k("div", {
595
+ let ge = R.find((e) => e.id === z);
596
+ return /* @__PURE__ */ A("div", {
601
597
  className: "space-y-6 p-6",
602
598
  children: [
603
- /* @__PURE__ */ k("div", {
599
+ /* @__PURE__ */ A("div", {
604
600
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
605
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h1", {
601
+ children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h1", {
606
602
  className: "text-2xl font-bold text-foreground",
607
603
  children: r("billing.usage.title", "Usage")
608
- }), /* @__PURE__ */ O("p", {
604
+ }), /* @__PURE__ */ k("p", {
609
605
  className: "text-sm text-muted-foreground mt-1",
610
606
  children: "Monitor your resource consumption and quota usage"
611
- })] }), /* @__PURE__ */ k("div", {
607
+ })] }), /* @__PURE__ */ A("div", {
612
608
  className: "flex items-center gap-3",
613
- children: [R.length > 1 && /* @__PURE__ */ O("select", {
609
+ children: [R.length > 1 && /* @__PURE__ */ k("select", {
614
610
  value: z || "",
615
611
  onChange: (e) => l(e.target.value),
616
612
  className: "px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary w-full sm:min-w-[200px]",
617
- children: R.map((e) => /* @__PURE__ */ O("option", {
613
+ children: R.map((e) => /* @__PURE__ */ k("option", {
618
614
  value: e.id,
619
615
  children: e.name
620
616
  }, e.id))
621
- }), /* @__PURE__ */ O("button", {
617
+ }), /* @__PURE__ */ k("button", {
622
618
  type: "button",
623
619
  onClick: () => ue(),
624
620
  className: "p-2 border border-border rounded-md hover:bg-muted/50 transition-colors",
625
621
  title: "Refresh",
626
- children: /* @__PURE__ */ O(C, { className: "size-4" })
622
+ children: /* @__PURE__ */ k(w, { className: "size-4" })
627
623
  })]
628
624
  })]
629
625
  }),
630
- /* @__PURE__ */ k("div", {
626
+ /* @__PURE__ */ A("div", {
631
627
  className: "flex flex-col gap-3 sm:flex-row sm:items-center",
632
628
  children: [
633
- /* @__PURE__ */ k("div", {
629
+ /* @__PURE__ */ A("div", {
634
630
  className: "relative flex-1 max-w-md",
635
631
  children: [
636
- /* @__PURE__ */ O(w, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
637
- /* @__PURE__ */ O("input", {
632
+ /* @__PURE__ */ k(T, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
633
+ /* @__PURE__ */ k("input", {
638
634
  type: "text",
639
- value: b,
635
+ value: x,
640
636
  onChange: (e) => j(e.target.value),
641
- placeholder: `Search ${F === "past" ? "past" : F === "all" ? "all" : "active"} quotas...`,
637
+ placeholder: `Search ${I === "past" ? "past" : I === "all" ? "all" : "active"} quotas...`,
642
638
  className: "w-full pl-9 pr-3 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"
643
639
  }),
644
- (b || he) && /* @__PURE__ */ O("button", {
640
+ (x || me) && /* @__PURE__ */ k("button", {
645
641
  type: "button",
646
642
  onClick: () => j(""),
647
643
  className: "absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted/50",
648
- children: he ? /* @__PURE__ */ O(C, { className: "size-3 text-muted-foreground animate-spin" }) : /* @__PURE__ */ O(T, { className: "size-3 text-muted-foreground" })
644
+ children: me ? /* @__PURE__ */ k(w, { className: "size-3 text-muted-foreground animate-spin" }) : /* @__PURE__ */ k(E, { className: "size-3 text-muted-foreground" })
649
645
  })
650
646
  ]
651
647
  }),
652
- /* @__PURE__ */ k("div", {
648
+ /* @__PURE__ */ A("div", {
653
649
  className: "flex items-center bg-muted/50 rounded-lg p-1 border border-border",
654
- children: [/* @__PURE__ */ k("button", {
650
+ children: [/* @__PURE__ */ A("button", {
655
651
  type: "button",
656
- onClick: () => I("active"),
657
- className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${F === "active" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"}`,
658
- children: [/* @__PURE__ */ O(S, { className: "size-3.5" }), "Active"]
659
- }), /* @__PURE__ */ k("button", {
652
+ onClick: () => L("active"),
653
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${I === "active" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"}`,
654
+ children: [/* @__PURE__ */ k(C, { className: "size-3.5" }), "Active"]
655
+ }), /* @__PURE__ */ A("button", {
660
656
  type: "button",
661
- onClick: () => I("past"),
662
- disabled: K && F !== "past",
663
- className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${F === "past" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"} ${K && F !== "past" ? "opacity-70" : ""}`,
664
- children: [K && F === "past" ? /* @__PURE__ */ O(C, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ O(y, { className: "size-3.5" }), "Past"]
657
+ onClick: () => L("past"),
658
+ disabled: W && I !== "past",
659
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${I === "past" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"} ${W && I !== "past" ? "opacity-70" : ""}`,
660
+ children: [W && I === "past" ? /* @__PURE__ */ k(w, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ k(b, { className: "size-3.5" }), "Past"]
665
661
  })]
666
662
  }),
667
- Q && /* @__PURE__ */ k("button", {
663
+ Q && /* @__PURE__ */ A("button", {
668
664
  type: "button",
669
- onClick: ge,
665
+ onClick: he,
670
666
  className: "flex items-center gap-1.5 px-3 py-1.5 text-sm text-muted-foreground hover:text-foreground border border-border rounded-md hover:bg-muted/50 transition-colors",
671
- children: [/* @__PURE__ */ O(T, { className: "size-3" }), "Clear filters"]
667
+ children: [/* @__PURE__ */ k(E, { className: "size-3" }), "Clear filters"]
672
668
  })
673
669
  ]
674
670
  }),
675
- _e && /* @__PURE__ */ k("div", {
671
+ ge && /* @__PURE__ */ A("div", {
676
672
  className: "text-sm text-muted-foreground",
677
673
  children: [
678
674
  "Viewing usage for",
679
675
  " ",
680
- /* @__PURE__ */ O("span", {
676
+ /* @__PURE__ */ k("span", {
681
677
  className: "font-medium text-foreground",
682
- children: _e.name
678
+ children: ge.name
683
679
  })
684
680
  ]
685
681
  }),
686
- H && /* @__PURE__ */ k("div", {
682
+ B && /* @__PURE__ */ A("div", {
687
683
  className: "grid grid-cols-2 sm:grid-cols-4 gap-4",
688
684
  children: [
689
- /* @__PURE__ */ O(N, {
685
+ /* @__PURE__ */ k(N, {
690
686
  label: "Total Quotas",
691
- value: H.totalQuotas,
692
- icon: /* @__PURE__ */ O(x, { className: "size-5" }),
687
+ value: B.totalQuotas,
688
+ icon: /* @__PURE__ */ k(S, { className: "size-5" }),
693
689
  color: "blue",
694
690
  isActive: M === "all",
695
691
  onClick: () => P("all")
696
692
  }),
697
- /* @__PURE__ */ O(N, {
693
+ /* @__PURE__ */ k(N, {
698
694
  label: "Healthy",
699
- value: H.healthyQuotas,
700
- icon: /* @__PURE__ */ O(h, { className: "size-5" }),
695
+ value: B.healthyQuotas,
696
+ icon: /* @__PURE__ */ k(g, { className: "size-5" }),
701
697
  color: "emerald",
702
698
  isActive: M === "healthy",
703
699
  onClick: () => $("healthy")
704
700
  }),
705
- /* @__PURE__ */ O(N, {
701
+ /* @__PURE__ */ k(N, {
706
702
  label: "Warning",
707
- value: H.warningQuotas,
708
- icon: /* @__PURE__ */ O(p, { className: "size-5" }),
703
+ value: B.warningQuotas,
704
+ icon: /* @__PURE__ */ k(m, { className: "size-5" }),
709
705
  color: "amber",
710
706
  isActive: M === "warning",
711
707
  onClick: () => $("warning")
712
708
  }),
713
- /* @__PURE__ */ O(N, {
709
+ /* @__PURE__ */ k(N, {
714
710
  label: "Critical / Exhausted",
715
- value: H.criticalQuotas + H.exhaustedQuotas,
716
- icon: /* @__PURE__ */ O(m, { className: "size-5" }),
711
+ value: B.criticalQuotas + B.exhaustedQuotas,
712
+ icon: /* @__PURE__ */ k(h, { className: "size-5" }),
717
713
  color: "red",
718
714
  isActive: M === "critical",
719
715
  onClick: () => $("critical")
720
716
  })
721
717
  ]
722
718
  }),
723
- H && (H.warningQuotas > 0 || H.criticalQuotas > 0 || H.exhaustedQuotas > 0) && /* @__PURE__ */ k("div", {
724
- className: `flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between p-4 rounded-lg border ${H.criticalQuotas > 0 || H.exhaustedQuotas > 0 ? `${t.error.bg} ${t.error.border}` : `${t.warning.bg} ${t.warning.border}`}`,
725
- children: [/* @__PURE__ */ k("div", {
719
+ B && (B.warningQuotas > 0 || B.criticalQuotas > 0 || B.exhaustedQuotas > 0) && /* @__PURE__ */ A("div", {
720
+ className: `flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between p-4 rounded-lg border ${B.criticalQuotas > 0 || B.exhaustedQuotas > 0 ? `${t.error.bg} ${t.error.border}` : `${t.warning.bg} ${t.warning.border}`}`,
721
+ children: [/* @__PURE__ */ A("div", {
726
722
  className: "flex items-center gap-3",
727
- children: [H.criticalQuotas > 0 || H.exhaustedQuotas > 0 ? /* @__PURE__ */ O(E, { className: `size-5 shrink-0 ${t.error.icon}` }) : /* @__PURE__ */ O(p, { className: `size-5 shrink-0 ${t.warning.icon}` }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
728
- className: `text-sm font-medium ${H.criticalQuotas > 0 || H.exhaustedQuotas > 0 ? t.error.text : t.warning.text}`,
729
- children: H.criticalQuotas > 0 || H.exhaustedQuotas > 0 ? `${H.criticalQuotas + H.exhaustedQuotas} quota${H.criticalQuotas + H.exhaustedQuotas === 1 ? "" : "s"} exhausted or critical` : `${H.warningQuotas} quota${H.warningQuotas === 1 ? "" : "s"} approaching the limit`
730
- }), /* @__PURE__ */ O("p", {
723
+ children: [B.criticalQuotas > 0 || B.exhaustedQuotas > 0 ? /* @__PURE__ */ k(D, { className: `size-5 shrink-0 ${t.error.icon}` }) : /* @__PURE__ */ k(m, { className: `size-5 shrink-0 ${t.warning.icon}` }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
724
+ className: `text-sm font-medium ${B.criticalQuotas > 0 || B.exhaustedQuotas > 0 ? t.error.text : t.warning.text}`,
725
+ children: B.criticalQuotas > 0 || B.exhaustedQuotas > 0 ? `${B.criticalQuotas + B.exhaustedQuotas} quota${B.criticalQuotas + B.exhaustedQuotas === 1 ? "" : "s"} exhausted or critical` : `${B.warningQuotas} quota${B.warningQuotas === 1 ? "" : "s"} approaching the limit`
726
+ }), /* @__PURE__ */ k("p", {
731
727
  className: "text-xs text-muted-foreground mt-0.5",
732
728
  children: "Contact support to request a quota increase for your plan."
733
729
  })] })]
734
- }), /* @__PURE__ */ O("button", {
730
+ }), /* @__PURE__ */ k("button", {
735
731
  type: "button",
736
- onClick: () => B("/support/tickets"),
737
- className: `shrink-0 px-4 py-2 text-sm font-medium rounded-md border transition-colors ${H.criticalQuotas > 0 || H.exhaustedQuotas > 0 ? "bg-destructive text-destructive-foreground border-destructive hover:bg-destructive/90" : "border-status-warning-border text-status-warning-text hover:bg-status-warning-bg-subtle"}`,
732
+ onClick: () => ce("/support/tickets"),
733
+ className: `shrink-0 px-4 py-2 text-sm font-medium rounded-md border transition-colors ${B.criticalQuotas > 0 || B.exhaustedQuotas > 0 ? "bg-destructive text-destructive-foreground border-destructive hover:bg-destructive/90" : "border-status-warning-border text-status-warning-text hover:bg-status-warning-bg-subtle"}`,
738
734
  children: "Request more quota"
739
735
  })]
740
736
  }),
741
- (Q || F !== "active") && /* @__PURE__ */ k("div", {
737
+ (Q || I !== "active") && /* @__PURE__ */ A("div", {
742
738
  className: "flex items-center gap-2 text-sm text-muted-foreground flex-wrap",
743
739
  children: [
744
- /* @__PURE__ */ k("span", { children: [
740
+ /* @__PURE__ */ A("span", { children: [
745
741
  "Showing",
746
742
  " ",
747
- Z.active.reduce((e, t) => e + t.aggregatedQuotas.length, 0) + Z.past.reduce((e, t) => e + t.aggregatedQuotas.length, 0) + (F === "past" ? 0 : J.length),
743
+ Z.active.reduce((e, t) => e + t.aggregatedQuotas.length, 0) + Z.past.reduce((e, t) => e + t.aggregatedQuotas.length, 0) + (I === "past" ? 0 : J.length),
748
744
  " ",
749
745
  "quotas"
750
746
  ] }),
751
- /* @__PURE__ */ k("span", {
747
+ /* @__PURE__ */ A("span", {
752
748
  className: "px-2 py-0.5 bg-primary/10 text-primary rounded text-xs capitalize",
753
- children: [F === "active" ? "Active" : F === "past" ? "Past" : "All", " subscriptions"]
749
+ children: [I === "active" ? "Active" : I === "past" ? "Past" : "All", " subscriptions"]
754
750
  }),
755
- M !== "all" && /* @__PURE__ */ O("span", {
751
+ M !== "all" && /* @__PURE__ */ k("span", {
756
752
  className: "px-2 py-0.5 bg-muted rounded text-xs capitalize",
757
753
  children: M === "critical" ? "Critical / Exhausted" : M
758
754
  }),
759
- b && /* @__PURE__ */ k("span", {
755
+ x && /* @__PURE__ */ A("span", {
760
756
  className: "px-2 py-0.5 bg-muted rounded text-xs",
761
757
  children: [
762
758
  "“",
763
- b,
759
+ x,
764
760
  "”"
765
761
  ]
766
762
  })
767
763
  ]
768
764
  }),
769
- Z.active.length > 0 && /* @__PURE__ */ k("section", { children: [/* @__PURE__ */ k("h2", {
765
+ Z.active.length > 0 && /* @__PURE__ */ A("section", { children: [/* @__PURE__ */ A("h2", {
770
766
  className: "text-lg font-semibold text-foreground mb-4 flex items-center gap-2",
771
- children: [/* @__PURE__ */ O(S, { className: "size-5 text-primary" }), F === "all" ? "Active Subscription Quotas" : "Subscription Quotas"]
772
- }), /* @__PURE__ */ O("div", {
767
+ children: [/* @__PURE__ */ k(C, { className: "size-5 text-primary" }), I === "all" ? "Active Subscription Quotas" : "Subscription Quotas"]
768
+ }), /* @__PURE__ */ k("div", {
773
769
  className: "space-y-4",
774
- children: Z.active.map((e) => /* @__PURE__ */ O(re, {
770
+ children: Z.active.map((e) => /* @__PURE__ */ k(F, {
775
771
  subscription: e,
776
- onQuotaClick: v,
772
+ onQuotaClick: y,
777
773
  defaultExpanded: !0
778
774
  }, e.id))
779
775
  })] }),
780
- Z.past.length > 0 && /* @__PURE__ */ k("section", { children: [/* @__PURE__ */ k("h2", {
776
+ Z.past.length > 0 && /* @__PURE__ */ A("section", { children: [/* @__PURE__ */ A("h2", {
781
777
  className: "text-lg font-semibold text-foreground mb-4 flex items-center gap-2",
782
778
  children: [
783
- /* @__PURE__ */ O(y, { className: "size-5 text-muted-foreground" }),
779
+ /* @__PURE__ */ k(b, { className: "size-5 text-muted-foreground" }),
784
780
  "Past Subscription Quotas",
785
- /* @__PURE__ */ O("span", {
781
+ /* @__PURE__ */ k("span", {
786
782
  className: "text-xs font-normal text-muted-foreground",
787
783
  children: "(Canceled / Expired / Upgraded)"
788
784
  }),
789
- me > 0 && /* @__PURE__ */ k("span", {
785
+ K > 0 && /* @__PURE__ */ A("span", {
790
786
  className: "text-xs font-normal px-2 py-0.5 bg-muted rounded-full",
791
787
  children: [
792
788
  Z.past.length,
793
789
  fe ? "+" : "",
794
790
  " of ",
795
- me
791
+ K
796
792
  ]
797
793
  })
798
794
  ]
799
- }), /* @__PURE__ */ k("div", {
795
+ }), /* @__PURE__ */ A("div", {
800
796
  className: "space-y-4",
801
- children: [Z.past.map((e) => /* @__PURE__ */ O(re, {
797
+ children: [Z.past.map((e) => /* @__PURE__ */ k(F, {
802
798
  subscription: e,
803
- onQuotaClick: v,
804
- defaultExpanded: F === "past"
805
- }, e.id)), fe && /* @__PURE__ */ O("div", {
799
+ onQuotaClick: y,
800
+ defaultExpanded: I === "past"
801
+ }, e.id)), fe && /* @__PURE__ */ k("div", {
806
802
  className: "flex justify-center pt-2",
807
- children: /* @__PURE__ */ O("button", {
803
+ children: /* @__PURE__ */ k("button", {
808
804
  type: "button",
809
805
  onClick: de,
810
806
  disabled: pe,
811
807
  className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground border border-border rounded-md hover:bg-muted/50 transition-colors disabled:opacity-50",
812
- children: pe ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(C, { className: "size-4 animate-spin" }), "Loading…"] }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(g, { className: "size-4" }), "Load more past subscriptions"] })
808
+ children: pe ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(w, { className: "size-4 animate-spin" }), "Loading…"] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(_, { className: "size-4" }), "Load more past subscriptions"] })
813
809
  })
814
810
  })]
815
811
  })] }),
816
- F !== "past" && J.length > 0 && /* @__PURE__ */ k("section", { children: [/* @__PURE__ */ k("h2", {
812
+ I !== "past" && J.length > 0 && /* @__PURE__ */ A("section", { children: [/* @__PURE__ */ A("h2", {
817
813
  className: "text-lg font-semibold text-foreground mb-4 flex items-center gap-2",
818
814
  children: [
819
- /* @__PURE__ */ O(x, { className: `size-5 ${t.info.icon}` }),
815
+ /* @__PURE__ */ k(S, { className: `size-5 ${t.info.icon}` }),
820
816
  "Pooled Quotas",
821
- /* @__PURE__ */ O("span", {
817
+ /* @__PURE__ */ k("span", {
822
818
  className: "text-xs font-normal text-muted-foreground",
823
819
  children: "(Shared across all products)"
824
820
  })
825
821
  ]
826
- }), /* @__PURE__ */ O(ne, {
822
+ }), /* @__PURE__ */ k(ne, {
827
823
  quotas: J,
828
824
  showPlanColumn: !1,
829
- onQuotaClick: v
825
+ onQuotaClick: y
830
826
  })] }),
831
- F === "active" && W.length === 0 && U.length === 0 && !Q && /* @__PURE__ */ k("div", {
827
+ I === "active" && H.length === 0 && V.length === 0 && !Q && /* @__PURE__ */ A("div", {
832
828
  className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
833
829
  children: [
834
- /* @__PURE__ */ O("div", {
830
+ /* @__PURE__ */ k("div", {
835
831
  className: "size-12 rounded-full bg-muted flex items-center justify-center mb-4",
836
- children: /* @__PURE__ */ O(x, { className: "size-6 text-muted-foreground" })
832
+ children: /* @__PURE__ */ k(S, { className: "size-6 text-muted-foreground" })
837
833
  }),
838
- /* @__PURE__ */ O("h3", {
834
+ /* @__PURE__ */ k("h3", {
839
835
  className: "text-lg font-medium text-foreground",
840
836
  children: "No active quotas found"
841
837
  }),
842
- /* @__PURE__ */ O("p", {
838
+ /* @__PURE__ */ k("p", {
843
839
  className: "text-sm text-muted-foreground mt-1 text-center max-w-sm",
844
840
  children: "Quotas will appear here once you have active subscriptions or pooled allocations."
845
841
  })
846
842
  ]
847
843
  }),
848
- F === "past" && G.length === 0 && !Q && !K && /* @__PURE__ */ k("div", {
844
+ I === "past" && U.length === 0 && !Q && !W && /* @__PURE__ */ A("div", {
849
845
  className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
850
846
  children: [
851
- /* @__PURE__ */ O("div", {
847
+ /* @__PURE__ */ k("div", {
852
848
  className: "size-12 rounded-full bg-muted flex items-center justify-center mb-4",
853
- children: /* @__PURE__ */ O(y, { className: "size-6 text-muted-foreground" })
849
+ children: /* @__PURE__ */ k(b, { className: "size-6 text-muted-foreground" })
854
850
  }),
855
- /* @__PURE__ */ O("h3", {
851
+ /* @__PURE__ */ k("h3", {
856
852
  className: "text-lg font-medium text-foreground",
857
853
  children: "No past subscriptions"
858
854
  }),
859
- /* @__PURE__ */ O("p", {
855
+ /* @__PURE__ */ k("p", {
860
856
  className: "text-sm text-muted-foreground mt-1 text-center max-w-sm",
861
857
  children: "You don't have any canceled, expired, or upgraded subscriptions yet."
862
858
  }),
863
- /* @__PURE__ */ O("button", {
859
+ /* @__PURE__ */ k("button", {
864
860
  type: "button",
865
- onClick: () => I("active"),
861
+ onClick: () => L("active"),
866
862
  className: "mt-4 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
867
863
  children: "View active subscriptions"
868
864
  })
869
865
  ]
870
866
  }),
871
- F === "past" && K && /* @__PURE__ */ O("div", {
867
+ I === "past" && W && /* @__PURE__ */ k("div", {
872
868
  className: "space-y-4",
873
869
  children: [
874
870
  1,
875
871
  2,
876
872
  3
877
- ].map((e) => /* @__PURE__ */ O("div", { className: "h-24 bg-muted animate-pulse rounded-lg" }, e))
873
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-24 bg-muted animate-pulse rounded-lg" }, e))
878
874
  }),
879
- Q && Z.active.length === 0 && Z.past.length === 0 && (F === "past" || J.length === 0) && /* @__PURE__ */ k("div", {
875
+ Q && Z.active.length === 0 && Z.past.length === 0 && (I === "past" || J.length === 0) && /* @__PURE__ */ A("div", {
880
876
  className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
881
877
  children: [
882
- /* @__PURE__ */ O("div", {
878
+ /* @__PURE__ */ k("div", {
883
879
  className: "size-12 rounded-full bg-muted flex items-center justify-center mb-4",
884
- children: M !== "all" && !b ? /* @__PURE__ */ O(A, {
880
+ children: M !== "all" && !x ? /* @__PURE__ */ k(te, {
885
881
  status: M === "healthy" ? "HEALTHY" : M === "warning" ? "WARNING" : "CRITICAL",
886
882
  className: "size-6"
887
- }) : /* @__PURE__ */ O(w, { className: "size-6 text-muted-foreground" })
883
+ }) : /* @__PURE__ */ k(T, { className: "size-6 text-muted-foreground" })
888
884
  }),
889
- /* @__PURE__ */ O("h3", {
885
+ /* @__PURE__ */ k("h3", {
890
886
  className: "text-lg font-medium text-foreground",
891
- children: M !== "all" && !b ? `No ${M === "critical" ? "critical or exhausted" : M} quotas` : "No matching quotas"
887
+ children: M !== "all" && !x ? `No ${M === "critical" ? "critical or exhausted" : M} quotas` : "No matching quotas"
892
888
  }),
893
- /* @__PURE__ */ O("p", {
889
+ /* @__PURE__ */ k("p", {
894
890
  className: "text-sm text-muted-foreground mt-1 text-center max-w-sm",
895
- children: M !== "all" && !b ? /* @__PURE__ */ k(D, { children: ["All your quotas are in a different status.", H && /* @__PURE__ */ k("span", {
891
+ children: M !== "all" && !x ? /* @__PURE__ */ A(O, { children: ["All your quotas are in a different status.", B && /* @__PURE__ */ A("span", {
896
892
  className: "block mt-1",
897
893
  children: [
898
894
  "You have ",
899
- H.healthyQuotas,
895
+ B.healthyQuotas,
900
896
  " healthy, ",
901
- H.warningQuotas,
897
+ B.warningQuotas,
902
898
  " warning, and ",
903
- H.criticalQuotas + H.exhaustedQuotas,
899
+ B.criticalQuotas + B.exhaustedQuotas,
904
900
  " critical quotas."
905
901
  ]
906
- })] }) : /* @__PURE__ */ k(D, { children: [
902
+ })] }) : /* @__PURE__ */ A(O, { children: [
907
903
  "No quotas match your current search or filter criteria in",
908
904
  " ",
909
- F === "past" ? "past" : F === "all" ? "any" : "active",
905
+ I === "past" ? "past" : I === "all" ? "any" : "active",
910
906
  " ",
911
907
  "subscriptions.",
912
- F === "active" && !M.includes("all") && /* @__PURE__ */ O("span", {
908
+ I === "active" && !M.includes("all") && /* @__PURE__ */ k("span", {
913
909
  className: "block mt-1",
914
910
  children: "Try switching to “Past” or “All” to search across more subscriptions."
915
911
  })
916
912
  ] })
917
913
  }),
918
- /* @__PURE__ */ k("div", {
914
+ /* @__PURE__ */ A("div", {
919
915
  className: "flex gap-2 mt-4",
920
- children: [/* @__PURE__ */ O("button", {
916
+ children: [/* @__PURE__ */ k("button", {
921
917
  type: "button",
922
- onClick: ge,
918
+ onClick: he,
923
919
  className: "px-4 py-2 text-sm font-medium border border-border rounded-md hover:bg-muted/50 transition-colors",
924
920
  children: M === "all" ? "Clear filters" : "Show all quotas"
925
- }), F === "active" && b && /* @__PURE__ */ O("button", {
921
+ }), I === "active" && x && /* @__PURE__ */ k("button", {
926
922
  type: "button",
927
- onClick: () => I("all"),
923
+ onClick: () => L("all"),
928
924
  className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
929
925
  children: "Search all"
930
926
  })]
931
927
  })
932
928
  ]
933
929
  }),
934
- _ && /* @__PURE__ */ O(ie, {
935
- quota: _,
936
- onClose: () => v(null)
930
+ v && /* @__PURE__ */ k(re, {
931
+ quota: v,
932
+ onClose: () => y(null)
937
933
  })
938
934
  ]
939
935
  });
940
936
  };
941
937
  //#endregion
942
- export { F as UsagePage };
938
+ export { I as UsagePage };
943
939
 
944
940
  //# sourceMappingURL=UsagePage.js.map