@burdenoff/microfe-billing 2026.516.1 → 2026.517.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 (59) hide show
  1. package/dist/billing/BillingUserRoutes.js +1 -1
  2. package/dist/billing/BillingUserRoutes.js.map +1 -1
  3. package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -1
  4. package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +1 -1
  5. package/dist/billing/modules/billing/hooks/useInvoices.js +20 -26
  6. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  7. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +1 -1
  8. package/dist/billing/modules/billing/pages/InvoicesListPage.js +176 -170
  9. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  10. package/dist/billing/modules/billing/pages/RefundsPage.js +1 -1
  11. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  12. package/dist/billing/modules/checkout/components/OrderSummary.js +4 -4
  13. package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
  14. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +1 -1
  15. package/dist/billing/modules/checkout/pages/CheckoutPage.js +2 -2
  16. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  17. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +1 -1
  18. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +178 -209
  19. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  20. package/dist/billing/modules/dashboard/pages/OverviewPage.js +2 -2
  21. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  22. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +2 -2
  23. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  24. package/dist/billing/modules/earnings/api.d.ts +0 -4
  25. package/dist/billing/modules/earnings/api.d.ts.map +1 -1
  26. package/dist/billing/modules/earnings/api.js +10 -14
  27. package/dist/billing/modules/earnings/api.js.map +1 -1
  28. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +1 -1
  29. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +233 -523
  30. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  31. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  32. package/dist/billing/modules/quota/pages/QuotaPage.js.map +1 -1
  33. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +1 -1
  34. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +44 -101
  35. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  36. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +1 -1
  37. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +46 -105
  38. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  39. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +1 -1
  40. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +1 -1
  41. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +15 -16
  42. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
  43. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +1 -1
  44. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +165 -158
  45. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  46. package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +1 -1
  47. package/dist/billing/modules/usage/pages/UsagePage.js +3 -3
  48. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  49. package/dist/billing/shared/types/graphql.d.ts +0 -2
  50. package/dist/billing/shared/types/graphql.d.ts.map +1 -1
  51. package/dist/billing/shared/types/graphql.js.map +1 -1
  52. package/dist/generated/global-operations.d.ts +0 -48
  53. package/dist/generated/global-operations.d.ts.map +1 -1
  54. package/dist/generated/global-operations.js +293 -310
  55. package/dist/generated/global-operations.js.map +1 -1
  56. package/dist/generated/global-types.d.ts +0 -9
  57. package/dist/generated/global-types.d.ts.map +1 -1
  58. package/dist/generated/global-types.js.map +1 -1
  59. package/package.json +1 -1
@@ -4,36 +4,63 @@ import { useBillingPermissions as o } from "../../../hooks/useBillingPermissions
4
4
  import { useGetBillingAccountsByOrgQuery as s } from "../../../../generated/global-operations.js";
5
5
  import { useBillingNavigate as c } from "../../../hooks/useBillingNavigate.js";
6
6
  import { withBillingAccountId as l } from "../../../shared/utils/navigation.js";
7
- import { usePaginatedInvoices as u } from "../hooks/useInvoices.js";
8
- import { useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
9
- import { useSearchParams as h } from "react-router-dom";
10
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
11
- import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { useInvoices as u } from "../hooks/useInvoices.js";
8
+ import { useEffect as d, useMemo as f, useState as p } from "react";
9
+ import { useSearchParams as m } from "react-router-dom";
10
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
11
+ import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
12
  //#region src/billing/modules/billing/pages/InvoicesListPage.tsx
13
- var b = () => {
14
- let { t: e } = y(), t = (t, n) => {
15
- let r = e(t);
16
- return r === t ? n : r;
17
- }, n = c(), i = o(), [a] = h(), b = a.get("billingAccountId") ?? void 0, { data: S } = s({ fetchPolicy: "cache-first" }), C = S?.getBillingAccountsByOrg ?? [], [w, T] = m(b);
13
+ var v = () => {
14
+ let { t } = _(), n = (e, n) => {
15
+ let r = t(e);
16
+ return r === e ? n : r;
17
+ }, i = c(), a = o(), [v] = m(), b = v.get("billingAccountId") ?? void 0, { data: x } = s({ fetchPolicy: "cache-first" }), S = x?.getBillingAccountsByOrg ?? [], [C, w] = p(b);
18
18
  d(() => {
19
- T(b);
19
+ w(b);
20
20
  }, [b]);
21
- let E = f(() => (C.find((e) => e.isDefault) ?? C[0])?.id ?? void 0, [C]), D = w === void 0 ? E ?? null : w, [O, k] = m("all"), [A, j] = m(""), [M, N] = m(""), [P, F] = m(1), I = p(null);
22
- d(() => (I.current && clearTimeout(I.current), I.current = setTimeout(() => {
23
- N(A), F(1);
24
- }, 400), () => {
25
- I.current && clearTimeout(I.current);
26
- }), [A]);
27
- let { invoices: L, totalPages: R, isLoading: z, error: B, refetch: V } = u({
28
- billingAccountId: D ?? void 0,
29
- status: O === "all" ? void 0 : O,
30
- search: M || void 0,
31
- page: P,
32
- pageSize: 20
21
+ let T = f(() => (S.find((e) => e.isDefault) ?? S[0])?.id ?? void 0, [S]), E = C === void 0 ? T ?? null : C, { invoices: D, isLoading: O, error: k, refetch: A } = u({ billingAccountId: E ?? void 0 }), [j, M] = p("all"), [N, P] = p("");
22
+ if (!a.canViewInvoices) return /* @__PURE__ */ h("div", {
23
+ className: "flex items-center justify-center h-full min-h-[400px]",
24
+ children: /* @__PURE__ */ g("div", {
25
+ className: "text-center space-y-2",
26
+ children: [
27
+ /* @__PURE__ */ h("div", {
28
+ className: "w-12 h-12 mx-auto rounded-full bg-muted flex items-center justify-center",
29
+ children: /* @__PURE__ */ h("svg", {
30
+ className: "w-6 h-6 text-muted-foreground",
31
+ fill: "none",
32
+ viewBox: "0 0 24 24",
33
+ stroke: "currentColor",
34
+ children: /* @__PURE__ */ h("path", {
35
+ strokeLinecap: "round",
36
+ strokeLinejoin: "round",
37
+ strokeWidth: 2,
38
+ d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
39
+ })
40
+ })
41
+ }),
42
+ /* @__PURE__ */ h("h2", {
43
+ className: "text-lg font-semibold text-foreground",
44
+ children: n("billing.accessDenied.title", "Access Denied")
45
+ }),
46
+ /* @__PURE__ */ h("p", {
47
+ className: "text-sm text-muted-foreground max-w-sm",
48
+ children: n("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
49
+ })
50
+ ]
51
+ })
33
52
  });
34
- return i.canViewInvoices ? z && L.length === 0 ? /* @__PURE__ */ v("div", {
53
+ let F = D.filter((e) => {
54
+ if (j !== "all" && e.status !== j) return !1;
55
+ if (N) {
56
+ let t = N.toLowerCase();
57
+ return e.invoiceNumber.toLowerCase().includes(t) || e.id.toLowerCase().includes(t);
58
+ }
59
+ return !0;
60
+ }), I = F.reduce((e, t) => e + t.total, 0), L = F.filter((e) => e.status === "PAID").reduce((e, t) => e + t.total, 0), R = F.filter((e) => e.status === "OPEN").reduce((e, t) => e + t.total, 0);
61
+ return O && D.length === 0 ? /* @__PURE__ */ g("div", {
35
62
  className: "space-y-6 p-6",
36
- children: [/* @__PURE__ */ _("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ _("div", {
63
+ children: [/* @__PURE__ */ h("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ h("div", {
37
64
  className: "space-y-3",
38
65
  children: [
39
66
  1,
@@ -41,30 +68,30 @@ var b = () => {
41
68
  3,
42
69
  4,
43
70
  5
44
- ].map((e) => /* @__PURE__ */ _("div", {
71
+ ].map((e) => /* @__PURE__ */ h("div", {
45
72
  className: "border border-border rounded-lg p-4",
46
- children: /* @__PURE__ */ v("div", {
73
+ children: /* @__PURE__ */ g("div", {
47
74
  className: "flex items-center gap-4",
48
- children: [/* @__PURE__ */ _("div", { className: "h-10 w-10 bg-muted animate-pulse rounded" }), /* @__PURE__ */ v("div", {
75
+ children: [/* @__PURE__ */ h("div", { className: "h-10 w-10 bg-muted animate-pulse rounded" }), /* @__PURE__ */ g("div", {
49
76
  className: "flex-1 space-y-2",
50
- children: [/* @__PURE__ */ _("div", { className: "h-4 w-32 bg-muted animate-pulse rounded" }), /* @__PURE__ */ _("div", { className: "h-3 w-48 bg-muted animate-pulse rounded" })]
77
+ children: [/* @__PURE__ */ h("div", { className: "h-4 w-32 bg-muted animate-pulse rounded" }), /* @__PURE__ */ h("div", { className: "h-3 w-48 bg-muted animate-pulse rounded" })]
51
78
  })]
52
79
  })
53
80
  }, e))
54
81
  })]
55
- }) : B ? /* @__PURE__ */ _("div", {
82
+ }) : k ? /* @__PURE__ */ h("div", {
56
83
  className: "flex items-center justify-center h-full min-h-[400px]",
57
- children: /* @__PURE__ */ v("div", {
84
+ children: /* @__PURE__ */ g("div", {
58
85
  className: "text-center space-y-4",
59
86
  children: [
60
- /* @__PURE__ */ _("div", {
87
+ /* @__PURE__ */ h("div", {
61
88
  className: "w-12 h-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",
62
- children: /* @__PURE__ */ _("svg", {
89
+ children: /* @__PURE__ */ h("svg", {
63
90
  className: "w-6 h-6 text-destructive",
64
91
  fill: "none",
65
92
  viewBox: "0 0 24 24",
66
93
  stroke: "currentColor",
67
- children: /* @__PURE__ */ _("path", {
94
+ children: /* @__PURE__ */ h("path", {
68
95
  strokeLinecap: "round",
69
96
  strokeLinejoin: "round",
70
97
  strokeWidth: 2,
@@ -72,54 +99,89 @@ var b = () => {
72
99
  })
73
100
  })
74
101
  }),
75
- /* @__PURE__ */ _("h2", {
102
+ /* @__PURE__ */ h("h2", {
76
103
  className: "text-lg font-semibold text-foreground",
77
- children: t("billing.invoices.failedToLoad", "Failed to load invoices")
104
+ children: n("billing.invoices.failedToLoad", "Failed to load invoices")
78
105
  }),
79
- /* @__PURE__ */ _("p", {
106
+ /* @__PURE__ */ h("p", {
80
107
  className: "text-sm text-muted-foreground",
81
- children: B.message
108
+ children: k.message
82
109
  }),
83
- /* @__PURE__ */ _("button", {
84
- onClick: () => V(),
110
+ /* @__PURE__ */ h("button", {
111
+ onClick: () => A(),
85
112
  className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
86
113
  children: "Try Again"
87
114
  })
88
115
  ]
89
116
  })
90
- }) : /* @__PURE__ */ v("div", {
117
+ }) : /* @__PURE__ */ g("div", {
91
118
  className: "space-y-6 p-6",
92
119
  children: [
93
- /* @__PURE__ */ v("div", {
120
+ /* @__PURE__ */ g("div", {
94
121
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
95
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h1", {
122
+ children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
96
123
  className: "text-2xl font-bold text-foreground",
97
- children: t("billing.invoices.title", "Invoices")
98
- }), /* @__PURE__ */ _("p", {
124
+ children: n("billing.invoices.title", "Invoices")
125
+ }), /* @__PURE__ */ h("p", {
99
126
  className: "text-sm text-muted-foreground mt-1",
100
- children: t("billing.invoices.subtitle", "View and manage your billing invoices")
101
- })] }), C.length > 1 && /* @__PURE__ */ v("div", {
127
+ children: n("billing.invoices.subtitle", "View and manage your billing invoices")
128
+ })] }), S.length > 1 && /* @__PURE__ */ g("div", {
102
129
  className: "flex items-center gap-2",
103
- children: [/* @__PURE__ */ _("label", {
130
+ children: [/* @__PURE__ */ h("label", {
104
131
  className: "text-sm text-muted-foreground whitespace-nowrap",
105
132
  children: "Billing Account"
106
- }), /* @__PURE__ */ v("select", {
107
- value: D ?? "",
108
- onChange: (e) => T(e.target.value || null),
133
+ }), /* @__PURE__ */ g("select", {
134
+ value: E ?? "",
135
+ onChange: (e) => w(e.target.value || null),
109
136
  className: "text-sm border border-border rounded-md bg-background text-foreground px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary",
110
- children: [/* @__PURE__ */ _("option", {
137
+ children: [/* @__PURE__ */ h("option", {
111
138
  value: "",
112
139
  children: "All Accounts"
113
- }), C.map((e) => /* @__PURE__ */ v("option", {
140
+ }), S.map((e) => /* @__PURE__ */ g("option", {
114
141
  value: e.id ?? "",
115
142
  children: [e.name ?? e.email ?? e.id, e.isDefault ? " (Default)" : ""]
116
143
  }, e.id ?? ""))]
117
144
  })]
118
145
  })]
119
146
  }),
120
- /* @__PURE__ */ v("div", {
147
+ /* @__PURE__ */ g("div", {
148
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
149
+ children: [
150
+ /* @__PURE__ */ g("div", {
151
+ className: "border border-border rounded-lg bg-card p-4",
152
+ children: [/* @__PURE__ */ h("p", {
153
+ className: "text-sm text-muted-foreground",
154
+ children: n("billing.invoices.totalInvoiced", "Total Invoiced")
155
+ }), /* @__PURE__ */ h("p", {
156
+ className: "text-xl font-semibold text-foreground mt-1",
157
+ children: e(I)
158
+ })]
159
+ }),
160
+ /* @__PURE__ */ g("div", {
161
+ className: "border border-border rounded-lg bg-card p-4",
162
+ children: [/* @__PURE__ */ h("p", {
163
+ className: "text-sm text-muted-foreground",
164
+ children: n("billing.invoices.paid", "Paid")
165
+ }), /* @__PURE__ */ h("p", {
166
+ className: "text-xl font-semibold text-status-success-text mt-1",
167
+ children: e(L)
168
+ })]
169
+ }),
170
+ /* @__PURE__ */ g("div", {
171
+ className: "border border-border rounded-lg bg-card p-4",
172
+ children: [/* @__PURE__ */ h("p", {
173
+ className: "text-sm text-muted-foreground",
174
+ children: n("billing.invoices.outstanding", "Outstanding")
175
+ }), /* @__PURE__ */ h("p", {
176
+ className: "text-xl font-semibold text-status-warning-text mt-1",
177
+ children: e(R)
178
+ })]
179
+ })
180
+ ]
181
+ }),
182
+ /* @__PURE__ */ g("div", {
121
183
  className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border",
122
- children: [/* @__PURE__ */ _("div", {
184
+ children: [/* @__PURE__ */ h("div", {
123
185
  className: "inline-flex rounded-lg border border-border p-1 bg-muted/50 flex-wrap",
124
186
  children: [
125
187
  "all",
@@ -127,46 +189,44 @@ var b = () => {
127
189
  "PAID",
128
190
  "DRAFT",
129
191
  "VOID"
130
- ].map((e) => /* @__PURE__ */ _("button", {
131
- onClick: () => {
132
- k(e), F(1);
133
- },
134
- className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${O === e ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
192
+ ].map((e) => /* @__PURE__ */ h("button", {
193
+ onClick: () => M(e),
194
+ className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${j === e ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
135
195
  children: e === "all" ? "All" : r(e)
136
196
  }, e))
137
- }), /* @__PURE__ */ v("div", {
138
- className: "relative flex-1 min-w-0 w-full sm:max-w-md",
139
- children: [/* @__PURE__ */ _("svg", {
197
+ }), /* @__PURE__ */ g("div", {
198
+ className: "relative flex-1 min-w-[200px] max-w-md",
199
+ children: [/* @__PURE__ */ h("svg", {
140
200
  className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground",
141
201
  fill: "none",
142
202
  viewBox: "0 0 24 24",
143
203
  stroke: "currentColor",
144
- children: /* @__PURE__ */ _("path", {
204
+ children: /* @__PURE__ */ h("path", {
145
205
  strokeLinecap: "round",
146
206
  strokeLinejoin: "round",
147
207
  strokeWidth: 2,
148
208
  d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
149
209
  })
150
- }), /* @__PURE__ */ _("input", {
210
+ }), /* @__PURE__ */ h("input", {
151
211
  type: "text",
152
- placeholder: t("billing.invoices.searchPlaceholder", "Search by invoice number..."),
153
- value: A,
154
- onChange: (e) => j(e.target.value),
212
+ placeholder: n("billing.invoices.searchPlaceholder", "Search by invoice number..."),
213
+ value: N,
214
+ onChange: (e) => P(e.target.value),
155
215
  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"
156
216
  })]
157
217
  })]
158
218
  }),
159
- !z && L.length === 0 ? /* @__PURE__ */ v("div", {
219
+ F.length === 0 ? /* @__PURE__ */ g("div", {
160
220
  className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
161
221
  children: [
162
- /* @__PURE__ */ _("div", {
222
+ /* @__PURE__ */ h("div", {
163
223
  className: "w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-4",
164
- children: /* @__PURE__ */ _("svg", {
224
+ children: /* @__PURE__ */ h("svg", {
165
225
  className: "w-6 h-6 text-muted-foreground",
166
226
  fill: "none",
167
227
  viewBox: "0 0 24 24",
168
228
  stroke: "currentColor",
169
- children: /* @__PURE__ */ _("path", {
229
+ children: /* @__PURE__ */ h("path", {
170
230
  strokeLinecap: "round",
171
231
  strokeLinejoin: "round",
172
232
  strokeWidth: 2,
@@ -174,193 +234,139 @@ var b = () => {
174
234
  })
175
235
  })
176
236
  }),
177
- /* @__PURE__ */ _("h3", {
237
+ /* @__PURE__ */ h("h3", {
178
238
  className: "text-lg font-medium text-foreground",
179
- children: t("billing.invoices.noInvoicesFound", "No invoices found")
239
+ children: n("billing.invoices.noInvoicesFound", "No invoices found")
180
240
  }),
181
- /* @__PURE__ */ _("p", {
241
+ /* @__PURE__ */ h("p", {
182
242
  className: "text-sm text-muted-foreground mt-1",
183
- children: O !== "all" || M ? t("billing.invoices.noInvoicesFiltered", "No invoices match your filters.") : t("billing.invoices.noInvoicesYet", "You don't have any invoices yet.")
243
+ children: j !== "all" || N ? n("billing.invoices.noInvoicesFiltered", "No invoices match your filters.") : n("billing.invoices.noInvoicesYet", "You don't have any invoices yet.")
184
244
  })
185
245
  ]
186
- }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
246
+ }) : /* @__PURE__ */ h("div", {
187
247
  className: "border border-border rounded-lg overflow-hidden",
188
- children: /* @__PURE__ */ v("table", {
248
+ children: /* @__PURE__ */ g("table", {
189
249
  className: "w-full",
190
- children: [/* @__PURE__ */ _("thead", {
250
+ children: [/* @__PURE__ */ h("thead", {
191
251
  className: "bg-muted/50",
192
- children: /* @__PURE__ */ v("tr", { children: [
193
- /* @__PURE__ */ _("th", {
252
+ children: /* @__PURE__ */ g("tr", { children: [
253
+ /* @__PURE__ */ h("th", {
194
254
  className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground",
195
255
  children: "Invoice"
196
256
  }),
197
- /* @__PURE__ */ _("th", {
257
+ /* @__PURE__ */ h("th", {
198
258
  className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground",
199
259
  children: "Status"
200
260
  }),
201
- !D && C.length > 1 && /* @__PURE__ */ _("th", {
261
+ !E && S.length > 1 && /* @__PURE__ */ h("th", {
202
262
  className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground hidden lg:table-cell",
203
263
  children: "Account"
204
264
  }),
205
- /* @__PURE__ */ _("th", {
265
+ /* @__PURE__ */ h("th", {
206
266
  className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground hidden sm:table-cell",
207
267
  children: "Date"
208
268
  }),
209
- /* @__PURE__ */ _("th", {
269
+ /* @__PURE__ */ h("th", {
210
270
  className: "text-left px-4 py-3 text-sm font-medium text-muted-foreground hidden md:table-cell",
211
271
  children: "Due Date"
212
272
  }),
213
- /* @__PURE__ */ _("th", {
273
+ /* @__PURE__ */ h("th", {
214
274
  className: "text-right px-4 py-3 text-sm font-medium text-muted-foreground",
215
275
  children: "Amount"
216
276
  }),
217
- /* @__PURE__ */ _("th", {
277
+ /* @__PURE__ */ h("th", {
218
278
  className: "text-right px-4 py-3 text-sm font-medium text-muted-foreground",
219
279
  children: "Actions"
220
280
  })
221
281
  ] })
222
- }), /* @__PURE__ */ _("tbody", {
282
+ }), /* @__PURE__ */ h("tbody", {
223
283
  className: "divide-y divide-border",
224
- children: L.map((e) => /* @__PURE__ */ _(x, {
284
+ children: F.map((e) => /* @__PURE__ */ h(y, {
225
285
  invoice: e,
226
- onView: () => n(l(`/invoices/${e.id}`, e.billingAccountId)),
227
- canPay: i.canPayInvoice,
228
- canVoid: i.canVoidInvoice,
229
- showAccount: !D && C.length > 1,
230
- accountName: C.find((t) => t.id === e.billingAccountId)?.name ?? null
286
+ onView: () => i(l(`/invoices/${e.id}`, e.billingAccountId)),
287
+ canPay: a.canPayInvoice,
288
+ canVoid: a.canVoidInvoice,
289
+ showAccount: !E && S.length > 1,
290
+ accountName: S.find((t) => t.id === e.billingAccountId)?.name ?? null
231
291
  }, e.id))
232
292
  })]
233
293
  })
234
- }), R > 1 && /* @__PURE__ */ v("div", {
235
- className: "flex items-center justify-between pt-2",
236
- children: [/* @__PURE__ */ v("p", {
237
- className: "text-sm text-muted-foreground",
238
- children: [
239
- "Page ",
240
- P,
241
- " of ",
242
- R
243
- ]
244
- }), /* @__PURE__ */ v("div", {
245
- className: "flex items-center gap-2",
246
- children: [/* @__PURE__ */ _("button", {
247
- onClick: () => F((e) => Math.max(1, e - 1)),
248
- disabled: P <= 1,
249
- className: "px-3 py-1.5 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
250
- children: "Previous"
251
- }), /* @__PURE__ */ _("button", {
252
- onClick: () => F((e) => Math.min(R, e + 1)),
253
- disabled: P >= R,
254
- className: "px-3 py-1.5 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
255
- children: "Next"
256
- })]
257
- })]
258
- })] })
294
+ })
259
295
  ]
260
- }) : /* @__PURE__ */ _("div", {
261
- className: "flex items-center justify-center h-full min-h-[400px]",
262
- children: /* @__PURE__ */ v("div", {
263
- className: "text-center space-y-2",
264
- children: [
265
- /* @__PURE__ */ _("div", {
266
- className: "w-12 h-12 mx-auto rounded-full bg-muted flex items-center justify-center",
267
- children: /* @__PURE__ */ _("svg", {
268
- className: "w-6 h-6 text-muted-foreground",
269
- fill: "none",
270
- viewBox: "0 0 24 24",
271
- stroke: "currentColor",
272
- children: /* @__PURE__ */ _("path", {
273
- strokeLinecap: "round",
274
- strokeLinejoin: "round",
275
- strokeWidth: 2,
276
- d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
277
- })
278
- })
279
- }),
280
- /* @__PURE__ */ _("h2", {
281
- className: "text-lg font-semibold text-foreground",
282
- children: t("billing.accessDenied.title", "Access Denied")
283
- }),
284
- /* @__PURE__ */ _("p", {
285
- className: "text-sm text-muted-foreground max-w-sm",
286
- children: t("billing.invoices.noViewPermission", "You don't have permission to view invoices.")
287
- })
288
- ]
289
- })
290
296
  });
291
- }, x = ({ invoice: o, onView: s, canPay: c, canVoid: l, showAccount: u = !1, accountName: d }) => {
297
+ }, y = ({ invoice: o, onView: s, canPay: c, canVoid: l, showAccount: u = !1, accountName: d }) => {
292
298
  let f = i(o.status), p = o.status === "OPEN", m = o.status === "DRAFT";
293
- return /* @__PURE__ */ v("tr", {
299
+ return /* @__PURE__ */ g("tr", {
294
300
  className: "hover:bg-muted/30 transition-colors",
295
301
  children: [
296
- /* @__PURE__ */ v("td", {
302
+ /* @__PURE__ */ g("td", {
297
303
  className: "px-4 py-4",
298
- children: [/* @__PURE__ */ _("button", {
304
+ children: [/* @__PURE__ */ h("button", {
299
305
  onClick: s,
300
306
  className: "font-medium text-foreground hover:text-primary transition-colors",
301
307
  children: n(o.invoiceNumber)
302
- }), (o.itemDescription ?? o.subscription?.plan?.name) && /* @__PURE__ */ _("p", {
308
+ }), (o.itemDescription ?? o.subscription?.plan?.name) && /* @__PURE__ */ h("p", {
303
309
  className: "text-sm text-muted-foreground mt-0.5",
304
310
  children: o.itemDescription ?? o.subscription?.plan?.name
305
311
  })]
306
312
  }),
307
- /* @__PURE__ */ _("td", {
313
+ /* @__PURE__ */ h("td", {
308
314
  className: "px-4 py-4",
309
- children: /* @__PURE__ */ _("span", {
315
+ children: /* @__PURE__ */ h("span", {
310
316
  className: `inline-flex px-2 py-1 text-xs font-medium rounded ${a(f)}`,
311
317
  children: r(o.status)
312
318
  })
313
319
  }),
314
- u && /* @__PURE__ */ _("td", {
320
+ u && /* @__PURE__ */ h("td", {
315
321
  className: "px-4 py-4 hidden lg:table-cell",
316
- children: d ? /* @__PURE__ */ _("span", {
322
+ children: d ? /* @__PURE__ */ h("span", {
317
323
  className: "inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full bg-muted text-muted-foreground border border-border",
318
324
  children: d
319
- }) : /* @__PURE__ */ _("span", {
325
+ }) : /* @__PURE__ */ h("span", {
320
326
  className: "text-sm text-muted-foreground",
321
327
  children: "—"
322
328
  })
323
329
  }),
324
- /* @__PURE__ */ _("td", {
330
+ /* @__PURE__ */ h("td", {
325
331
  className: "px-4 py-4 text-sm text-muted-foreground hidden sm:table-cell",
326
332
  children: t(o.createdAt, "short")
327
333
  }),
328
- /* @__PURE__ */ _("td", {
334
+ /* @__PURE__ */ h("td", {
329
335
  className: "px-4 py-4 text-sm text-muted-foreground hidden md:table-cell",
330
336
  children: o.dueDate ? t(o.dueDate, "short") : "—"
331
337
  }),
332
- /* @__PURE__ */ _("td", {
338
+ /* @__PURE__ */ h("td", {
333
339
  className: "px-4 py-4 text-right font-medium text-foreground",
334
340
  children: e(o.total, o.currency)
335
341
  }),
336
- /* @__PURE__ */ _("td", {
342
+ /* @__PURE__ */ h("td", {
337
343
  className: "px-4 py-4 text-right",
338
- children: /* @__PURE__ */ v("div", {
344
+ children: /* @__PURE__ */ g("div", {
339
345
  className: "flex items-center justify-end gap-2",
340
346
  children: [
341
- o.invoiceUrl ? /* @__PURE__ */ _("a", {
347
+ o.invoiceUrl ? /* @__PURE__ */ h("a", {
342
348
  href: o.invoiceUrl,
343
349
  target: "_blank",
344
350
  rel: "noopener noreferrer",
345
351
  className: "px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",
346
352
  children: "View"
347
- }) : /* @__PURE__ */ _("button", {
353
+ }) : /* @__PURE__ */ h("button", {
348
354
  onClick: s,
349
355
  className: "px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",
350
356
  children: "View"
351
357
  }),
352
- o.pdfUrl && /* @__PURE__ */ _("a", {
358
+ o.pdfUrl && /* @__PURE__ */ h("a", {
353
359
  href: o.pdfUrl,
354
360
  target: "_blank",
355
361
  rel: "noopener noreferrer",
356
362
  className: "px-3 py-1.5 text-sm font-medium text-primary hover:bg-primary/10 rounded-md transition-colors",
357
363
  children: "PDF"
358
364
  }),
359
- p && c && /* @__PURE__ */ _("button", {
365
+ p && c && /* @__PURE__ */ h("button", {
360
366
  className: "px-3 py-1.5 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
361
367
  children: "Pay"
362
368
  }),
363
- (p || m) && l && /* @__PURE__ */ _("button", {
369
+ (p || m) && l && /* @__PURE__ */ h("button", {
364
370
  className: "px-3 py-1.5 text-sm font-medium text-destructive hover:bg-destructive/10 rounded-md transition-colors",
365
371
  children: "Void"
366
372
  })
@@ -371,6 +377,6 @@ var b = () => {
371
377
  });
372
378
  };
373
379
  //#endregion
374
- export { b as InvoicesListPage };
380
+ export { v as InvoicesListPage };
375
381
 
376
382
  //# sourceMappingURL=InvoicesListPage.js.map