@burdenoff/microfe-subscriberbot 2026.706.2 → 2026.710.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 (140) hide show
  1. package/dist/generated/global-operations.d.ts +2 -0
  2. package/dist/generated/global-operations.d.ts.map +1 -0
  3. package/dist/generated/global-types.d.ts +23527 -0
  4. package/dist/generated/global-types.d.ts.map +1 -0
  5. package/dist/generated/wspace-operations.d.ts +2 -0
  6. package/dist/generated/wspace-operations.d.ts.map +1 -0
  7. package/dist/generated/wspace-types.d.ts +57851 -0
  8. package/dist/generated/wspace-types.d.ts.map +1 -0
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +2 -1
  12. package/dist/subscriberbot/SubscriberBotRoot.d.ts +5 -0
  13. package/dist/subscriberbot/SubscriberBotRoot.d.ts.map +1 -0
  14. package/dist/subscriberbot/SubscriberBotRoot.js +56 -40
  15. package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
  16. package/dist/subscriberbot/SubscriberBotRoutes.d.ts +4 -0
  17. package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +1 -0
  18. package/dist/subscriberbot/SubscriberBotRoutes.js +14 -6
  19. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  20. package/dist/subscriberbot/components/EmptyState.d.ts +18 -0
  21. package/dist/subscriberbot/components/EmptyState.d.ts.map +1 -0
  22. package/dist/subscriberbot/components/MetricsCard.d.ts +16 -0
  23. package/dist/subscriberbot/components/MetricsCard.d.ts.map +1 -0
  24. package/dist/subscriberbot/components/Modal.d.ts +13 -0
  25. package/dist/subscriberbot/components/Modal.d.ts.map +1 -0
  26. package/dist/subscriberbot/components/PageLayout.d.ts +23 -0
  27. package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -0
  28. package/dist/subscriberbot/components/StateViews.d.ts +24 -0
  29. package/dist/subscriberbot/components/StateViews.d.ts.map +1 -0
  30. package/dist/subscriberbot/components/StatusBadge.d.ts +9 -0
  31. package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -0
  32. package/dist/subscriberbot/components/index.d.ts +13 -0
  33. package/dist/subscriberbot/components/index.d.ts.map +1 -0
  34. package/dist/subscriberbot/components/index.js +7 -0
  35. package/dist/subscriberbot/components/viz.d.ts +58 -0
  36. package/dist/subscriberbot/components/viz.d.ts.map +1 -0
  37. package/dist/subscriberbot/components/viz.js +196 -0
  38. package/dist/subscriberbot/components/viz.js.map +1 -0
  39. package/dist/subscriberbot/config/assistantUsecases.d.ts +13 -0
  40. package/dist/subscriberbot/config/assistantUsecases.d.ts.map +1 -0
  41. package/dist/subscriberbot/context/SubscriberBotContext.d.ts +16 -0
  42. package/dist/subscriberbot/context/SubscriberBotContext.d.ts.map +1 -0
  43. package/dist/subscriberbot/context/index.d.ts +6 -0
  44. package/dist/subscriberbot/context/index.d.ts.map +1 -0
  45. package/dist/subscriberbot/hooks/index.d.ts +7 -0
  46. package/dist/subscriberbot/hooks/index.d.ts.map +1 -0
  47. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +105 -0
  48. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -0
  49. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +38 -30
  50. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  51. package/dist/subscriberbot/index.d.ts +12 -0
  52. package/dist/subscriberbot/index.d.ts.map +1 -0
  53. package/dist/subscriberbot/index.js +1 -0
  54. package/dist/subscriberbot/pages/AssetVaultPage.d.ts +4 -0
  55. package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -0
  56. package/dist/subscriberbot/pages/AssetVaultPage.js +182 -0
  57. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -0
  58. package/dist/subscriberbot/pages/DashboardPage.d.ts +12 -0
  59. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -0
  60. package/dist/subscriberbot/pages/DashboardPage.js +272 -199
  61. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  62. package/dist/subscriberbot/pages/InboxPage.d.ts +12 -0
  63. package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -0
  64. package/dist/subscriberbot/pages/InboxPage.js +517 -234
  65. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  66. package/dist/subscriberbot/pages/InsightsPage.d.ts +4 -0
  67. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -0
  68. package/dist/subscriberbot/pages/InsightsPage.js +220 -0
  69. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -0
  70. package/dist/subscriberbot/pages/InvoicesPage.d.ts +13 -0
  71. package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -0
  72. package/dist/subscriberbot/pages/InvoicesPage.js +325 -237
  73. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  74. package/dist/subscriberbot/pages/WorkflowsPage.d.ts +15 -0
  75. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -0
  76. package/dist/subscriberbot/pages/WorkflowsPage.js +301 -112
  77. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  78. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +11 -0
  79. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -0
  80. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +311 -165
  81. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  82. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +8 -0
  83. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -0
  84. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +11 -0
  85. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -0
  86. package/dist/subscriberbot/pages/agents/AgentsListPage.js +183 -93
  87. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  88. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +10 -0
  89. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -0
  90. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +426 -293
  91. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  92. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +10 -0
  93. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -0
  94. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +217 -153
  95. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  96. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +12 -0
  97. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -0
  98. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +215 -112
  99. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  100. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +13 -0
  101. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -0
  102. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +542 -428
  103. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  104. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +10 -0
  105. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -0
  106. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +242 -192
  107. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  108. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +10 -0
  109. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -0
  110. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +174 -133
  111. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  112. package/dist/subscriberbot/services/assistantApi.d.ts +66 -0
  113. package/dist/subscriberbot/services/assistantApi.d.ts.map +1 -0
  114. package/dist/subscriberbot/services/assistantApi.js +260 -0
  115. package/dist/subscriberbot/services/assistantApi.js.map +1 -0
  116. package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts +13 -0
  117. package/dist/subscriberbot/services/createSandboxAssistantTransport.d.ts.map +1 -0
  118. package/dist/subscriberbot/services/createSandboxAssistantTransport.js +120 -0
  119. package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -0
  120. package/dist/subscriberbot/store/index.d.ts +6 -0
  121. package/dist/subscriberbot/store/index.d.ts.map +1 -0
  122. package/dist/subscriberbot/store/subscriberbotStore.d.ts +60 -0
  123. package/dist/subscriberbot/store/subscriberbotStore.d.ts.map +1 -0
  124. package/dist/subscriberbot/types/assistant.d.ts +57 -0
  125. package/dist/subscriberbot/types/assistant.d.ts.map +1 -0
  126. package/dist/subscriberbot/types/index.d.ts +465 -0
  127. package/dist/subscriberbot/types/index.d.ts.map +1 -0
  128. package/dist/subscriberbot/utils/cn.d.ts +4 -0
  129. package/dist/subscriberbot/utils/cn.d.ts.map +1 -0
  130. package/dist/subscriberbot/utils/formatters.d.ts +53 -0
  131. package/dist/subscriberbot/utils/formatters.d.ts.map +1 -0
  132. package/dist/subscriberbot/utils/index.d.ts +8 -0
  133. package/dist/subscriberbot/utils/index.d.ts.map +1 -0
  134. package/dist/subscriberbot/utils/navigation.d.ts +20 -0
  135. package/dist/subscriberbot/utils/navigation.d.ts.map +1 -0
  136. package/dist/subscriberbot/utils/pageContext.d.ts +21 -0
  137. package/dist/subscriberbot/utils/pageContext.d.ts.map +1 -0
  138. package/dist/subscriberbot/utils/pageContext.js +47 -0
  139. package/dist/subscriberbot/utils/pageContext.js.map +1 -0
  140. package/package.json +5 -1
@@ -5,15 +5,16 @@ import { MetricsCard as r } from "../components/MetricsCard.js";
5
5
  import { formatCurrency as i, formatDate as a } from "../utils/formatters.js";
6
6
  import { StatusBadge as o } from "../components/StatusBadge.js";
7
7
  import { EmptyState as s } from "../components/EmptyState.js";
8
- import { ErrorView as c, LoadingView as l, Section as u } from "../components/StateViews.js";
9
- import { useCreateInvoice as d, useCreatePaymentInstrument as f, useInvoices as p, useMarkInvoicePaid as m, usePaymentInstruments as h, useRelationships as g, useRemovePaymentInstrument as _ } from "../hooks/useSubscriberBotApi.js";
10
- import { Modal as v } from "../components/Modal.js";
11
- import { useMemo as y, useState as b } from "react";
12
- import { CreditCard as x, FileText as S, Plus as C, Receipt as w, Star as T, Trash2 as E } from "lucide-react";
13
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
14
- import { PagePurpose as A } from "@burdenoff/fe-libs/ui";
8
+ import { Modal as c } from "../components/Modal.js";
9
+ import { ErrorView as l, LoadingView as u, Section as d } from "../components/StateViews.js";
10
+ import { CHART_COLORS as f, Donut as p, Legend as m } from "../components/viz.js";
11
+ import { useCreateInvoice as h, useCreatePaymentInstrument as g, useInvoices as _, useMarkInvoicePaid as v, usePaymentInstruments as y, useRelationships as b, useRemovePaymentInstrument as x } from "../hooks/useSubscriberBotApi.js";
12
+ import { useMemo as S, useState as C } from "react";
13
+ import { AlertTriangle as w, CheckCircle2 as T, CreditCard as E, FileText as D, Plus as O, Receipt as k, Star as A, Trash2 as j } from "lucide-react";
14
+ import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
15
+ import { GlassCard as F, PagePurpose as I } from "@burdenoff/fe-libs/ui";
15
16
  //#region src/subscriberbot/pages/InvoicesPage.tsx
16
- var j = 25, M = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", N = "mb-1 block text-xs font-medium text-text-secondary", P = [
17
+ var L = 25, R = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", z = "mb-1 block text-xs font-medium text-text-secondary", B = [
17
18
  {
18
19
  value: "",
19
20
  label: "All statuses"
@@ -46,7 +47,7 @@ var j = 25, M = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
46
47
  value: "REFUNDED",
47
48
  label: "Refunded"
48
49
  }
49
- ], F = [
50
+ ], V = [
50
51
  "ISSUED",
51
52
  "DRAFT",
52
53
  "OVERDUE",
@@ -54,28 +55,36 @@ var j = 25, M = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
54
55
  "FAILED",
55
56
  "CANCELLED",
56
57
  "REFUNDED"
57
- ], I = [
58
+ ], H = [
58
59
  "CARD",
59
60
  "BANK_ACCOUNT",
60
61
  "PAYPAL",
61
62
  "UPI",
62
63
  "WALLET",
63
64
  "OTHER"
64
- ], L = new Set([
65
+ ], U = new Set([
65
66
  "ISSUED",
66
67
  "OVERDUE",
67
68
  "FAILED"
68
- ]);
69
- function R({ onClose: e }) {
70
- let t = d(), n = g({ pagination: {
69
+ ]), W = {
70
+ PAID: "var(--color-status-success-text)",
71
+ OVERDUE: "var(--color-status-error-text)",
72
+ FAILED: "var(--color-status-error-text)",
73
+ ISSUED: "var(--color-chart-1)",
74
+ DRAFT: "var(--color-text-secondary)",
75
+ CANCELLED: "var(--color-chart-4)",
76
+ REFUNDED: "var(--color-status-warning-text)"
77
+ };
78
+ function G({ onClose: e }) {
79
+ let t = h(), n = b({ pagination: {
71
80
  limit: 100,
72
81
  offset: 0
73
- } }).data?.items ?? [], [r, i] = b(""), [a, o] = b(""), [s, c] = b("ISSUED"), [l, u] = b("USD"), [f, p] = b(""), [m, h] = b(""), [_, y] = b(""), [x, S] = b(""), [C, w] = b(""), [T, E] = b(null);
74
- return /* @__PURE__ */ O(v, {
82
+ } }).data?.items ?? [], [r, i] = C(""), [a, o] = C(""), [s, l] = C("ISSUED"), [u, d] = C("USD"), [f, p] = C(""), [m, g] = C(""), [_, v] = C(""), [y, x] = C(""), [S, w] = C(""), [T, E] = C(null);
83
+ return /* @__PURE__ */ N(c, {
75
84
  title: "Create invoice",
76
85
  onClose: e,
77
86
  maxWidthClassName: "max-w-xl",
78
- children: /* @__PURE__ */ k("form", {
87
+ children: /* @__PURE__ */ P("form", {
79
88
  onSubmit: (n) => {
80
89
  if (n.preventDefault(), E(null), !r) {
81
90
  E("Select the relationship this invoice belongs to.");
@@ -84,13 +93,13 @@ function R({ onClose: e }) {
84
93
  t.mutate({
85
94
  relationshipId: r,
86
95
  status: s,
87
- currency: l.trim() || "USD",
96
+ currency: u.trim() || "USD",
88
97
  ...a.trim() ? { number: a.trim() } : {},
89
98
  ...f.trim() ? { subtotal: Number(f) } : {},
90
99
  ...m.trim() ? { taxAmount: Number(m) } : {},
91
100
  ..._.trim() ? { total: Number(_) } : {},
92
- ...x ? { issueDate: new Date(x).toISOString() } : {},
93
- ...C ? { dueDate: new Date(C).toISOString() } : {}
101
+ ...y ? { issueDate: new Date(y).toISOString() } : {},
102
+ ...S ? { dueDate: new Date(S).toISOString() } : {}
94
103
  }, {
95
104
  onSuccess: () => e(),
96
105
  onError: (e) => E(e instanceof Error ? e.message : "Could not create invoice.")
@@ -98,150 +107,150 @@ function R({ onClose: e }) {
98
107
  },
99
108
  className: "space-y-4",
100
109
  children: [
101
- T && /* @__PURE__ */ O("div", {
110
+ T && /* @__PURE__ */ N("div", {
102
111
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
103
112
  children: T
104
113
  }),
105
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ k("label", {
114
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ P("label", {
106
115
  htmlFor: "inv-relationship",
107
- className: N,
108
- children: ["Relationship ", /* @__PURE__ */ O("span", {
116
+ className: z,
117
+ children: ["Relationship ", /* @__PURE__ */ N("span", {
109
118
  className: "text-status-error-text",
110
119
  children: "*"
111
120
  })]
112
- }), /* @__PURE__ */ k("select", {
121
+ }), /* @__PURE__ */ P("select", {
113
122
  id: "inv-relationship",
114
123
  value: r,
115
124
  onChange: (e) => i(e.target.value),
116
- className: M,
125
+ className: R,
117
126
  required: !0,
118
- children: [/* @__PURE__ */ O("option", {
127
+ children: [/* @__PURE__ */ N("option", {
119
128
  value: "",
120
129
  children: "— Select a relationship —"
121
- }), n.map((e) => /* @__PURE__ */ O("option", {
130
+ }), n.map((e) => /* @__PURE__ */ N("option", {
122
131
  value: e.id,
123
132
  children: e.label
124
133
  }, e.id))]
125
134
  })] }),
126
- /* @__PURE__ */ k("div", {
135
+ /* @__PURE__ */ P("div", {
127
136
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
128
137
  children: [
129
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
138
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
130
139
  htmlFor: "inv-number",
131
- className: N,
140
+ className: z,
132
141
  children: "Number"
133
- }), /* @__PURE__ */ O("input", {
142
+ }), /* @__PURE__ */ N("input", {
134
143
  id: "inv-number",
135
144
  type: "text",
136
145
  value: a,
137
146
  onChange: (e) => o(e.target.value),
138
147
  placeholder: "INV-0001",
139
- className: M
148
+ className: R
140
149
  })] }),
141
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
150
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
142
151
  htmlFor: "inv-status",
143
- className: N,
152
+ className: z,
144
153
  children: "Status"
145
- }), /* @__PURE__ */ O("select", {
154
+ }), /* @__PURE__ */ N("select", {
146
155
  id: "inv-status",
147
156
  value: s,
148
- onChange: (e) => c(e.target.value),
149
- className: M,
150
- children: F.map((e) => /* @__PURE__ */ O("option", {
157
+ onChange: (e) => l(e.target.value),
158
+ className: R,
159
+ children: V.map((e) => /* @__PURE__ */ N("option", {
151
160
  value: e,
152
161
  children: e.replace(/_/g, " ")
153
162
  }, e))
154
163
  })] }),
155
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
164
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
156
165
  htmlFor: "inv-currency",
157
- className: N,
166
+ className: z,
158
167
  children: "Currency"
159
- }), /* @__PURE__ */ O("input", {
168
+ }), /* @__PURE__ */ N("input", {
160
169
  id: "inv-currency",
161
170
  type: "text",
162
- value: l,
163
- onChange: (e) => u(e.target.value.toUpperCase()),
171
+ value: u,
172
+ onChange: (e) => d(e.target.value.toUpperCase()),
164
173
  maxLength: 3,
165
- className: M
174
+ className: R
166
175
  })] })
167
176
  ]
168
177
  }),
169
- /* @__PURE__ */ k("div", {
178
+ /* @__PURE__ */ P("div", {
170
179
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
171
180
  children: [
172
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
181
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
173
182
  htmlFor: "inv-subtotal",
174
- className: N,
183
+ className: z,
175
184
  children: "Subtotal"
176
- }), /* @__PURE__ */ O("input", {
185
+ }), /* @__PURE__ */ N("input", {
177
186
  id: "inv-subtotal",
178
187
  type: "number",
179
188
  min: "0",
180
189
  step: "0.01",
181
190
  value: f,
182
191
  onChange: (e) => p(e.target.value),
183
- className: M
192
+ className: R
184
193
  })] }),
185
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
194
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
186
195
  htmlFor: "inv-tax",
187
- className: N,
196
+ className: z,
188
197
  children: "Tax"
189
- }), /* @__PURE__ */ O("input", {
198
+ }), /* @__PURE__ */ N("input", {
190
199
  id: "inv-tax",
191
200
  type: "number",
192
201
  min: "0",
193
202
  step: "0.01",
194
203
  value: m,
195
- onChange: (e) => h(e.target.value),
196
- className: M
204
+ onChange: (e) => g(e.target.value),
205
+ className: R
197
206
  })] }),
198
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
207
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
199
208
  htmlFor: "inv-total",
200
- className: N,
209
+ className: z,
201
210
  children: "Total"
202
- }), /* @__PURE__ */ O("input", {
211
+ }), /* @__PURE__ */ N("input", {
203
212
  id: "inv-total",
204
213
  type: "number",
205
214
  min: "0",
206
215
  step: "0.01",
207
216
  value: _,
208
- onChange: (e) => y(e.target.value),
209
- className: M
217
+ onChange: (e) => v(e.target.value),
218
+ className: R
210
219
  })] })
211
220
  ]
212
221
  }),
213
- /* @__PURE__ */ k("div", {
222
+ /* @__PURE__ */ P("div", {
214
223
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
215
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
224
+ children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
216
225
  htmlFor: "inv-issue",
217
- className: N,
226
+ className: z,
218
227
  children: "Issue date"
219
- }), /* @__PURE__ */ O("input", {
228
+ }), /* @__PURE__ */ N("input", {
220
229
  id: "inv-issue",
221
230
  type: "date",
222
- value: x,
223
- onChange: (e) => S(e.target.value),
224
- className: M
225
- })] }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
231
+ value: y,
232
+ onChange: (e) => x(e.target.value),
233
+ className: R
234
+ })] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
226
235
  htmlFor: "inv-due",
227
- className: N,
236
+ className: z,
228
237
  children: "Due date"
229
- }), /* @__PURE__ */ O("input", {
238
+ }), /* @__PURE__ */ N("input", {
230
239
  id: "inv-due",
231
240
  type: "date",
232
- value: C,
241
+ value: S,
233
242
  onChange: (e) => w(e.target.value),
234
- className: M
243
+ className: R
235
244
  })] })]
236
245
  }),
237
- /* @__PURE__ */ k("div", {
246
+ /* @__PURE__ */ P("div", {
238
247
  className: "flex justify-end gap-3",
239
- children: [/* @__PURE__ */ O("button", {
248
+ children: [/* @__PURE__ */ N("button", {
240
249
  type: "button",
241
250
  onClick: e,
242
251
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
243
252
  children: "Cancel"
244
- }), /* @__PURE__ */ O("button", {
253
+ }), /* @__PURE__ */ N("button", {
245
254
  type: "submit",
246
255
  disabled: t.isPending,
247
256
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
@@ -252,14 +261,14 @@ function R({ onClose: e }) {
252
261
  })
253
262
  });
254
263
  }
255
- function z({ onClose: e }) {
256
- let t = f(), [n, r] = b(""), [i, a] = b("CARD"), [o, s] = b(""), [c, l] = b(""), [u, d] = b(""), [p, m] = b(""), [h, g] = b(!1), [_, y] = b(null);
257
- return /* @__PURE__ */ O(v, {
264
+ function K({ onClose: e }) {
265
+ let t = g(), [n, r] = C(""), [i, a] = C("CARD"), [o, s] = C(""), [l, u] = C(""), [d, f] = C(""), [p, m] = C(""), [h, _] = C(!1), [v, y] = C(null);
266
+ return /* @__PURE__ */ N(c, {
258
267
  title: "Add payment method",
259
268
  description: "A passive annotation of which external card/account pays for a subscription — no full card numbers or CVV.",
260
269
  onClose: e,
261
270
  maxWidthClassName: "max-w-xl",
262
- children: /* @__PURE__ */ k("form", {
271
+ children: /* @__PURE__ */ P("form", {
263
272
  onSubmit: (r) => {
264
273
  if (r.preventDefault(), y(null), !n.trim()) {
265
274
  y("A label is required.");
@@ -270,8 +279,8 @@ function z({ onClose: e }) {
270
279
  type: i,
271
280
  isDefault: h,
272
281
  ...o.trim() ? { brand: o.trim() } : {},
273
- ...c.trim() ? { last4: c.trim() } : {},
274
- ...u.trim() ? { expiryMonth: Number(u) } : {},
282
+ ...l.trim() ? { last4: l.trim() } : {},
283
+ ...d.trim() ? { expiryMonth: Number(d) } : {},
275
284
  ...p.trim() ? { expiryYear: Number(p) } : {}
276
285
  }, {
277
286
  onSuccess: () => e(),
@@ -280,91 +289,91 @@ function z({ onClose: e }) {
280
289
  },
281
290
  className: "space-y-4",
282
291
  children: [
283
- _ && /* @__PURE__ */ O("div", {
292
+ v && /* @__PURE__ */ N("div", {
284
293
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
285
- children: _
294
+ children: v
286
295
  }),
287
- /* @__PURE__ */ k("div", {
296
+ /* @__PURE__ */ P("div", {
288
297
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
289
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ k("label", {
298
+ children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ P("label", {
290
299
  htmlFor: "pm-label",
291
- className: N,
292
- children: ["Label ", /* @__PURE__ */ O("span", {
300
+ className: z,
301
+ children: ["Label ", /* @__PURE__ */ N("span", {
293
302
  className: "text-status-error-text",
294
303
  children: "*"
295
304
  })]
296
- }), /* @__PURE__ */ O("input", {
305
+ }), /* @__PURE__ */ N("input", {
297
306
  id: "pm-label",
298
307
  type: "text",
299
308
  value: n,
300
309
  onChange: (e) => r(e.target.value),
301
310
  placeholder: "e.g. Personal Visa",
302
- className: M,
311
+ className: R,
303
312
  required: !0
304
- })] }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
313
+ })] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
305
314
  htmlFor: "pm-type",
306
- className: N,
315
+ className: z,
307
316
  children: "Type"
308
- }), /* @__PURE__ */ O("select", {
317
+ }), /* @__PURE__ */ N("select", {
309
318
  id: "pm-type",
310
319
  value: i,
311
320
  onChange: (e) => a(e.target.value),
312
- className: M,
313
- children: I.map((e) => /* @__PURE__ */ O("option", {
321
+ className: R,
322
+ children: H.map((e) => /* @__PURE__ */ N("option", {
314
323
  value: e,
315
324
  children: e.replace(/_/g, " ")
316
325
  }, e))
317
326
  })] })]
318
327
  }),
319
- /* @__PURE__ */ k("div", {
328
+ /* @__PURE__ */ P("div", {
320
329
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
321
330
  children: [
322
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
331
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
323
332
  htmlFor: "pm-brand",
324
- className: N,
333
+ className: z,
325
334
  children: "Brand"
326
- }), /* @__PURE__ */ O("input", {
335
+ }), /* @__PURE__ */ N("input", {
327
336
  id: "pm-brand",
328
337
  type: "text",
329
338
  value: o,
330
339
  onChange: (e) => s(e.target.value),
331
340
  placeholder: "Visa, Amex…",
332
- className: M
341
+ className: R
333
342
  })] }),
334
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
343
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
335
344
  htmlFor: "pm-last4",
336
- className: N,
345
+ className: z,
337
346
  children: "Last 4"
338
- }), /* @__PURE__ */ O("input", {
347
+ }), /* @__PURE__ */ N("input", {
339
348
  id: "pm-last4",
340
349
  type: "text",
341
350
  inputMode: "numeric",
342
351
  maxLength: 4,
343
- value: c,
344
- onChange: (e) => l(e.target.value.replace(/\D/g, "")),
352
+ value: l,
353
+ onChange: (e) => u(e.target.value.replace(/\D/g, "")),
345
354
  placeholder: "4242",
346
- className: M
355
+ className: R
347
356
  })] }),
348
- /* @__PURE__ */ k("div", {
357
+ /* @__PURE__ */ P("div", {
349
358
  className: "grid grid-cols-2 gap-2",
350
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
359
+ children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
351
360
  htmlFor: "pm-exp-month",
352
- className: N,
361
+ className: z,
353
362
  children: "Exp. mo."
354
- }), /* @__PURE__ */ O("input", {
363
+ }), /* @__PURE__ */ N("input", {
355
364
  id: "pm-exp-month",
356
365
  type: "number",
357
366
  min: "1",
358
367
  max: "12",
359
- value: u,
360
- onChange: (e) => d(e.target.value),
368
+ value: d,
369
+ onChange: (e) => f(e.target.value),
361
370
  placeholder: "12",
362
- className: M
363
- })] }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
371
+ className: R
372
+ })] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
364
373
  htmlFor: "pm-exp-year",
365
- className: N,
374
+ className: z,
366
375
  children: "Exp. yr."
367
- }), /* @__PURE__ */ O("input", {
376
+ }), /* @__PURE__ */ N("input", {
368
377
  id: "pm-exp-year",
369
378
  type: "number",
370
379
  min: "2024",
@@ -372,28 +381,28 @@ function z({ onClose: e }) {
372
381
  value: p,
373
382
  onChange: (e) => m(e.target.value),
374
383
  placeholder: "2028",
375
- className: M
384
+ className: R
376
385
  })] })]
377
386
  })
378
387
  ]
379
388
  }),
380
- /* @__PURE__ */ k("label", {
389
+ /* @__PURE__ */ P("label", {
381
390
  className: "flex items-center gap-2 text-sm text-text-primary",
382
- children: [/* @__PURE__ */ O("input", {
391
+ children: [/* @__PURE__ */ N("input", {
383
392
  type: "checkbox",
384
393
  checked: h,
385
- onChange: (e) => g(e.target.checked),
394
+ onChange: (e) => _(e.target.checked),
386
395
  className: "size-4 rounded border-border-subtle"
387
396
  }), "Set as default"]
388
397
  }),
389
- /* @__PURE__ */ k("div", {
398
+ /* @__PURE__ */ P("div", {
390
399
  className: "flex justify-end gap-3",
391
- children: [/* @__PURE__ */ O("button", {
400
+ children: [/* @__PURE__ */ N("button", {
392
401
  type: "button",
393
402
  onClick: e,
394
403
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
395
404
  children: "Cancel"
396
- }), /* @__PURE__ */ O("button", {
405
+ }), /* @__PURE__ */ N("button", {
397
406
  type: "submit",
398
407
  disabled: t.isPending,
399
408
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
@@ -404,192 +413,271 @@ function z({ onClose: e }) {
404
413
  })
405
414
  });
406
415
  }
407
- function B() {
408
- let { data: e, isLoading: t, isError: n, refetch: r } = h(), i = _(), [a, d] = b(!1), f = e ?? [];
409
- return /* @__PURE__ */ k(u, {
416
+ function q() {
417
+ let { data: e, isLoading: t, isError: n, refetch: r } = y(), i = x(), [a, c] = C(!1), f = e ?? [];
418
+ return /* @__PURE__ */ P(d, {
410
419
  title: "Payment methods",
411
420
  description: "Which external cards and accounts pay for your subscriptions",
412
- action: /* @__PURE__ */ k("button", {
421
+ action: /* @__PURE__ */ P("button", {
413
422
  type: "button",
414
- onClick: () => d(!0),
423
+ onClick: () => c(!0),
415
424
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
416
- children: [/* @__PURE__ */ O(C, { className: "h-3.5 w-3.5" }), " Add payment method"]
425
+ children: [/* @__PURE__ */ N(O, { className: "h-3.5 w-3.5" }), " Add payment method"]
417
426
  }),
418
- children: [t ? /* @__PURE__ */ O(l, { label: "Loading payment methods…" }) : n ? /* @__PURE__ */ O(c, {
427
+ children: [t ? /* @__PURE__ */ N(u, { label: "Loading payment methods…" }) : n ? /* @__PURE__ */ N(l, {
419
428
  message: "Could not load payment methods.",
420
429
  onRetry: () => void r()
421
- }) : f.length === 0 ? /* @__PURE__ */ O(s, {
430
+ }) : f.length === 0 ? /* @__PURE__ */ N(s, {
422
431
  illustration: "empty-data",
423
- icon: /* @__PURE__ */ O(x, { className: "h-12 w-12" }),
432
+ icon: /* @__PURE__ */ N(E, { className: "h-12 w-12" }),
424
433
  title: "No payment methods",
425
434
  description: "Annotate which card or account pays for each subscription. No full card numbers are stored."
426
- }) : /* @__PURE__ */ O("div", {
427
- className: "divide-y divide-border-subtle rounded-lg border border-border-subtle bg-bg-surface",
428
- children: f.map((e) => /* @__PURE__ */ k("div", {
429
- className: "flex items-center justify-between gap-3 p-3",
430
- children: [/* @__PURE__ */ k("div", {
431
- className: "flex min-w-0 items-center gap-2",
432
- children: [/* @__PURE__ */ O(x, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ k("div", {
433
- className: "min-w-0",
434
- children: [/* @__PURE__ */ k("p", {
435
- className: "flex items-center gap-1.5 truncate text-sm font-medium text-text-primary",
436
- children: [e.label, e.isDefault && /* @__PURE__ */ O(T, { className: "h-3 w-3 fill-current text-status-warning-text" })]
437
- }), /* @__PURE__ */ O("p", {
438
- className: "text-xs text-text-secondary",
439
- children: [
440
- e.brand,
441
- e.last4 ? `•••• ${e.last4}` : null,
442
- e.expiryMonth && e.expiryYear ? `${e.expiryMonth}/${e.expiryYear}` : null
443
- ].filter(Boolean).join(" · ") || e.type.replace(/_/g, " ")
435
+ }) : /* @__PURE__ */ N("div", {
436
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
437
+ children: f.map((e) => {
438
+ let t = [e.expiryMonth && e.expiryYear ? `Exp ${String(e.expiryMonth).padStart(2, "0")}/${String(e.expiryYear).slice(-2)}` : null].filter(Boolean);
439
+ return /* @__PURE__ */ P(F, {
440
+ treatment: "metric",
441
+ className: "flex flex-col gap-4 p-4",
442
+ children: [/* @__PURE__ */ P("div", {
443
+ className: "flex items-start justify-between gap-2",
444
+ children: [/* @__PURE__ */ P("div", {
445
+ className: "flex items-center gap-3",
446
+ children: [/* @__PURE__ */ N("span", {
447
+ className: "grid h-9 w-12 place-items-center rounded-md bg-[var(--color-accent-soft)] text-text-primary",
448
+ children: /* @__PURE__ */ N(E, {
449
+ className: "h-4 w-4",
450
+ "aria-hidden": !0
451
+ })
452
+ }), /* @__PURE__ */ P("div", {
453
+ className: "min-w-0",
454
+ children: [/* @__PURE__ */ P("p", {
455
+ className: "flex items-center gap-1.5 truncate text-sm font-semibold text-text-primary",
456
+ children: [e.brand || e.label, e.isDefault && /* @__PURE__ */ P("span", {
457
+ className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-status-success-text",
458
+ children: [/* @__PURE__ */ N(A, {
459
+ className: "h-2.5 w-2.5 fill-current",
460
+ "aria-hidden": !0
461
+ }), "Default"]
462
+ })]
463
+ }), /* @__PURE__ */ N("p", {
464
+ className: "font-mono text-sm tracking-[0.15em] text-text-secondary",
465
+ children: e.last4 ? `•••• ${e.last4}` : e.type.replace(/_/g, " ")
466
+ })]
467
+ })]
468
+ }), /* @__PURE__ */ N(o, { status: e.status })]
469
+ }), /* @__PURE__ */ P("div", {
470
+ className: "mt-auto flex items-center justify-between border-t border-border-subtle pt-3",
471
+ children: [/* @__PURE__ */ N("p", {
472
+ className: "truncate text-xs text-text-secondary",
473
+ children: [e.label, ...t].filter(Boolean).join(" · ")
474
+ }), /* @__PURE__ */ P("button", {
475
+ type: "button",
476
+ "aria-label": `Remove ${e.label}`,
477
+ disabled: i.isPending,
478
+ onClick: () => i.mutate(e.id),
479
+ className: "inline-flex shrink-0 items-center gap-1 rounded-lg border border-border-subtle px-2.5 py-1 text-xs font-medium text-text-secondary hover:border-status-error-text/40 hover:bg-status-error-bg-subtle hover:text-status-error-text disabled:opacity-50",
480
+ children: [/* @__PURE__ */ N(j, {
481
+ className: "h-3.5 w-3.5",
482
+ "aria-hidden": !0
483
+ }), "Remove"]
444
484
  })]
445
485
  })]
446
- }), /* @__PURE__ */ k("div", {
447
- className: "flex shrink-0 items-center gap-2",
448
- children: [/* @__PURE__ */ O(o, { status: e.status }), /* @__PURE__ */ O("button", {
449
- type: "button",
450
- "aria-label": `Remove ${e.label}`,
451
- disabled: i.isPending,
452
- onClick: () => i.mutate(e.id),
453
- className: "rounded-lg border border-border-subtle p-1.5 text-text-secondary hover:bg-status-error-bg-subtle hover:text-status-error-text disabled:opacity-50",
454
- children: /* @__PURE__ */ O(E, { className: "h-4 w-4" })
455
- })]
456
- })]
457
- }, e.id))
458
- }), a && /* @__PURE__ */ O(z, { onClose: () => d(!1) })]
486
+ }, e.id);
487
+ })
488
+ }), a && /* @__PURE__ */ N(K, { onClose: () => c(!1) })]
459
489
  });
460
490
  }
461
- function V() {
462
- let { navigateTo: u } = e(), [d, f] = b(0), [h, g] = b(""), [_, v] = b(!1), { data: x, isLoading: T, isError: E, refetch: M, isFetching: N } = p({
463
- status: h || void 0,
491
+ function J() {
492
+ let { navigateTo: c } = e(), [d, h] = C(0), [g, y] = C(""), [b, x] = C(!1), { data: E, isLoading: A, isError: j, refetch: R, isFetching: z } = _({
493
+ status: g || void 0,
464
494
  pagination: {
465
- limit: j,
466
- offset: d * j
495
+ limit: L,
496
+ offset: d * L
467
497
  }
468
- }), F = m(), I = y(() => x?.items ?? [], [x]), z = x?.pageInfo.hasMore ?? !1, V = y(() => {
469
- let e = I.filter((e) => L.has(e.status)), t = I[0]?.currency ?? "USD";
498
+ }), V = v(), H = S(() => E?.items ?? [], [E]), K = E?.pageInfo.hasMore ?? !1, J = S(() => {
499
+ let e = H.filter((e) => U.has(e.status)), t = H[0]?.currency ?? "USD", n = /* @__PURE__ */ new Map();
500
+ for (let e of H) n.set(e.status, (n.get(e.status) ?? 0) + 1);
501
+ let r = Array.from(n.entries()).sort((e, t) => t[1] - e[1]).map(([e, t], n) => ({
502
+ label: e.charAt(0) + e.slice(1).toLowerCase(),
503
+ value: t,
504
+ color: W[e] ?? f[n % f.length]
505
+ }));
470
506
  return {
471
507
  outstandingCount: e.length,
472
508
  outstandingTotal: e.reduce((e, t) => e + t.total, 0),
509
+ paidCount: H.filter((e) => e.status === "PAID").length,
510
+ overdueCount: H.filter((e) => e.status === "OVERDUE").length,
511
+ distribution: r,
473
512
  currency: t
474
513
  };
475
- }, [I]);
476
- return /* @__PURE__ */ k(n, {
514
+ }, [H]);
515
+ return /* @__PURE__ */ P(n, {
477
516
  title: "Invoices",
478
517
  description: "Your billing ledger across every relationship",
479
- actions: /* @__PURE__ */ k("button", {
518
+ actions: /* @__PURE__ */ P("button", {
480
519
  type: "button",
481
- onClick: () => v(!0),
520
+ onClick: () => x(!0),
482
521
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
483
- children: [/* @__PURE__ */ O(C, { className: "h-4 w-4" }), " Create invoice"]
522
+ children: [/* @__PURE__ */ N(O, { className: "h-4 w-4" }), " Create invoice"]
484
523
  }),
485
524
  children: [
486
- /* @__PURE__ */ O(A, {
525
+ /* @__PURE__ */ N(I, {
487
526
  className: "mb-4",
488
527
  children: "Every invoice from your recurring relationships in one ledger. Filter by status and settle issued or overdue invoices directly."
489
528
  }),
490
- !T && !E && I.length > 0 && /* @__PURE__ */ k("div", {
491
- className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
492
- children: [/* @__PURE__ */ O(r, {
493
- featured: !0,
494
- icon: /* @__PURE__ */ O(w, {}),
495
- value: i(V.outstandingTotal, V.currency, { maximumFractionDigits: 0 }),
496
- label: "Outstanding (this page)"
497
- }), /* @__PURE__ */ O(r, {
498
- icon: /* @__PURE__ */ O(S, {}),
499
- value: V.outstandingCount,
500
- label: "Open invoices (this page)"
529
+ !A && !j && H.length > 0 && /* @__PURE__ */ P("div", {
530
+ className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
531
+ children: [/* @__PURE__ */ P("div", {
532
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:col-span-2",
533
+ children: [
534
+ /* @__PURE__ */ N(r, {
535
+ featured: !0,
536
+ icon: /* @__PURE__ */ N(k, {}),
537
+ value: i(J.outstandingTotal, J.currency, { maximumFractionDigits: 0 }),
538
+ label: "Outstanding · this page"
539
+ }),
540
+ /* @__PURE__ */ N(r, {
541
+ icon: /* @__PURE__ */ N(D, {}),
542
+ value: J.outstandingCount,
543
+ label: "Open invoices"
544
+ }),
545
+ /* @__PURE__ */ N(r, {
546
+ icon: /* @__PURE__ */ N(w, {}),
547
+ value: J.overdueCount,
548
+ label: "Overdue",
549
+ ...J.overdueCount > 0 ? { trend: "down" } : {}
550
+ }),
551
+ /* @__PURE__ */ N(r, {
552
+ icon: /* @__PURE__ */ N(T, {}),
553
+ value: J.paidCount,
554
+ label: "Paid",
555
+ ...J.paidCount > 0 ? { trend: "up" } : {}
556
+ })
557
+ ]
558
+ }), /* @__PURE__ */ P(F, {
559
+ treatment: "insight",
560
+ className: "p-6",
561
+ children: [
562
+ /* @__PURE__ */ N("p", {
563
+ className: "text-sm font-semibold text-text-primary",
564
+ children: "Status breakdown"
565
+ }),
566
+ /* @__PURE__ */ N("p", {
567
+ className: "text-xs text-text-secondary",
568
+ children: "Across the invoices on this page"
569
+ }),
570
+ /* @__PURE__ */ P("div", {
571
+ className: "mt-4 flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row",
572
+ children: [/* @__PURE__ */ N(p, {
573
+ data: J.distribution,
574
+ size: 132,
575
+ thickness: 16,
576
+ centerLabel: String(H.length),
577
+ centerSub: "invoices",
578
+ className: "shrink-0"
579
+ }), /* @__PURE__ */ N(m, {
580
+ data: J.distribution,
581
+ className: "w-full min-w-0 flex-1",
582
+ valueFormat: (e) => String(e)
583
+ })]
584
+ })
585
+ ]
501
586
  })]
502
587
  }),
503
- /* @__PURE__ */ O("div", {
588
+ /* @__PURE__ */ N("div", {
504
589
  className: "mt-6 flex flex-wrap items-center gap-3",
505
- children: /* @__PURE__ */ O("select", {
590
+ children: /* @__PURE__ */ N("select", {
506
591
  "aria-label": "Filter by status",
507
- value: h,
592
+ value: g,
508
593
  onChange: (e) => {
509
- g(e.target.value), f(0);
594
+ y(e.target.value), h(0);
510
595
  },
511
596
  className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
512
- children: P.map((e) => /* @__PURE__ */ O("option", {
597
+ children: B.map((e) => /* @__PURE__ */ N("option", {
513
598
  value: e.value,
514
599
  children: e.label
515
600
  }, e.value))
516
601
  })
517
602
  }),
518
- T ? /* @__PURE__ */ O(l, { label: "Loading invoices…" }) : E ? /* @__PURE__ */ O(c, {
603
+ A ? /* @__PURE__ */ N(u, { label: "Loading invoices…" }) : j ? /* @__PURE__ */ N(l, {
519
604
  message: "Could not load invoices.",
520
- onRetry: () => void M()
521
- }) : I.length === 0 ? /* @__PURE__ */ O("div", {
605
+ onRetry: () => void R()
606
+ }) : H.length === 0 ? /* @__PURE__ */ N("div", {
522
607
  className: "mt-6",
523
- children: /* @__PURE__ */ O(s, {
608
+ children: /* @__PURE__ */ N(s, {
524
609
  illustration: "empty-data",
525
- icon: /* @__PURE__ */ O(w, { className: "h-12 w-12" }),
610
+ icon: /* @__PURE__ */ N(k, { className: "h-12 w-12" }),
526
611
  title: "No invoices",
527
- description: h ? "No invoices match this status filter." : "Invoices from your relationships will appear here — or create one manually.",
528
- action: /* @__PURE__ */ O("button", {
612
+ description: g ? "No invoices match this status filter." : "Invoices from your relationships will appear here — or create one manually.",
613
+ action: /* @__PURE__ */ N("button", {
529
614
  type: "button",
530
- onClick: () => v(!0),
615
+ onClick: () => x(!0),
531
616
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
532
617
  children: "Create invoice"
533
618
  })
534
619
  })
535
- }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ k("div", {
620
+ }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P("div", {
536
621
  className: "mt-6 overflow-hidden rounded-lg border border-border-subtle bg-bg-surface",
537
- children: [/* @__PURE__ */ k("div", {
622
+ children: [/* @__PURE__ */ P("div", {
538
623
  className: "hidden grid-cols-[1.5fr_1fr_1fr_1fr_auto] gap-4 border-b border-border-subtle bg-bg-sunken px-4 py-2.5 text-xs font-medium text-text-secondary sm:grid",
539
624
  children: [
540
- /* @__PURE__ */ O("span", { children: "Invoice" }),
541
- /* @__PURE__ */ O("span", { children: "Status" }),
542
- /* @__PURE__ */ O("span", {
625
+ /* @__PURE__ */ N("span", { children: "Invoice" }),
626
+ /* @__PURE__ */ N("span", { children: "Status" }),
627
+ /* @__PURE__ */ N("span", {
543
628
  className: "text-right",
544
629
  children: "Total"
545
630
  }),
546
- /* @__PURE__ */ O("span", {
631
+ /* @__PURE__ */ N("span", {
547
632
  className: "text-right",
548
633
  children: "Due"
549
634
  }),
550
- /* @__PURE__ */ O("span", {
635
+ /* @__PURE__ */ N("span", {
551
636
  className: "text-right",
552
637
  children: "Action"
553
638
  })
554
639
  ]
555
- }), /* @__PURE__ */ O("div", {
640
+ }), /* @__PURE__ */ N("div", {
556
641
  className: "divide-y divide-border-subtle",
557
- children: I.map((e) => /* @__PURE__ */ k("div", {
558
- className: "grid grid-cols-1 gap-2 px-4 py-3 sm:grid-cols-[1.5fr_1fr_1fr_1fr_auto] sm:items-center sm:gap-4",
642
+ children: H.map((e) => /* @__PURE__ */ P("div", {
643
+ className: "grid grid-cols-1 gap-2 px-4 py-3 transition-colors hover:bg-bg-sunken/50 sm:grid-cols-[1.5fr_1fr_1fr_1fr_auto] sm:items-center sm:gap-4",
559
644
  children: [
560
- /* @__PURE__ */ k("button", {
645
+ /* @__PURE__ */ P("button", {
561
646
  type: "button",
562
- onClick: () => u(`/relationships/${e.relationshipId}`),
647
+ onClick: () => c(`/relationships/${e.relationshipId}`),
563
648
  className: "min-w-0 text-left",
564
- children: [/* @__PURE__ */ O("p", {
649
+ children: [/* @__PURE__ */ N("p", {
565
650
  className: "truncate text-sm font-medium text-text-primary",
566
651
  children: e.number || `Invoice ${e.id.slice(0, 8)}`
567
- }), /* @__PURE__ */ O("p", {
652
+ }), /* @__PURE__ */ N("p", {
568
653
  className: "text-xs text-text-secondary",
569
654
  children: e.issueDate ? `Issued ${a(e.issueDate)}` : "—"
570
655
  })]
571
656
  }),
572
- /* @__PURE__ */ O("span", { children: /* @__PURE__ */ O(o, { status: e.status }) }),
573
- /* @__PURE__ */ O("span", {
657
+ /* @__PURE__ */ N("span", { children: /* @__PURE__ */ N(o, { status: e.status }) }),
658
+ /* @__PURE__ */ N("span", {
574
659
  className: "text-sm font-semibold tabular-nums text-text-primary sm:text-right",
575
660
  children: i(e.total, e.currency)
576
661
  }),
577
- /* @__PURE__ */ O("span", {
662
+ /* @__PURE__ */ N("span", {
578
663
  className: "text-xs text-text-secondary sm:text-right",
579
664
  children: e.dueDate ? a(e.dueDate) : "—"
580
665
  }),
581
- /* @__PURE__ */ O("span", {
666
+ /* @__PURE__ */ N("span", {
582
667
  className: "sm:text-right",
583
- children: L.has(e.status) ? /* @__PURE__ */ O("button", {
668
+ children: U.has(e.status) ? /* @__PURE__ */ P("button", {
584
669
  type: "button",
585
- disabled: F.isPending,
586
- onClick: () => F.mutate(e.id),
587
- className: "rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
588
- children: "Mark paid"
589
- }) : e.paidAt ? /* @__PURE__ */ k("span", {
670
+ disabled: V.isPending,
671
+ onClick: () => V.mutate(e.id),
672
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle px-3 py-1.5 text-xs font-medium text-status-success-text hover:opacity-90 disabled:opacity-50",
673
+ children: [/* @__PURE__ */ N(T, {
674
+ className: "h-3.5 w-3.5",
675
+ "aria-hidden": !0
676
+ }), "Mark paid"]
677
+ }) : e.paidAt ? /* @__PURE__ */ P("span", {
590
678
  className: "text-xs text-text-secondary",
591
679
  children: ["Paid ", a(e.paidAt)]
592
- }) : /* @__PURE__ */ O("span", {
680
+ }) : /* @__PURE__ */ N("span", {
593
681
  className: "text-xs text-text-secondary",
594
682
  children: "—"
595
683
  })
@@ -597,38 +685,38 @@ function V() {
597
685
  ]
598
686
  }, e.id))
599
687
  })]
600
- }), /* @__PURE__ */ k("div", {
688
+ }), /* @__PURE__ */ P("div", {
601
689
  className: "mt-4 flex items-center justify-between",
602
- children: [/* @__PURE__ */ k("p", {
690
+ children: [/* @__PURE__ */ P("p", {
603
691
  className: "text-xs text-text-secondary",
604
692
  children: [
605
693
  "Page ",
606
694
  d + 1,
607
- N ? " · refreshing…" : ""
695
+ z ? " · refreshing…" : ""
608
696
  ]
609
- }), /* @__PURE__ */ k("div", {
697
+ }), /* @__PURE__ */ P("div", {
610
698
  className: "flex gap-2",
611
- children: [/* @__PURE__ */ O("button", {
699
+ children: [/* @__PURE__ */ N("button", {
612
700
  type: "button",
613
701
  disabled: d === 0,
614
- onClick: () => f((e) => Math.max(0, e - 1)),
702
+ onClick: () => h((e) => Math.max(0, e - 1)),
615
703
  className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", d === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
616
704
  children: "Previous"
617
- }), /* @__PURE__ */ O("button", {
705
+ }), /* @__PURE__ */ N("button", {
618
706
  type: "button",
619
- disabled: !z,
620
- onClick: () => f((e) => e + 1),
621
- className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", z ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
707
+ disabled: !K,
708
+ onClick: () => h((e) => e + 1),
709
+ className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", K ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
622
710
  children: "Next"
623
711
  })]
624
712
  })]
625
713
  })] }),
626
- /* @__PURE__ */ O(B, {}),
627
- _ && /* @__PURE__ */ O(R, { onClose: () => v(!1) })
714
+ /* @__PURE__ */ N(q, {}),
715
+ b && /* @__PURE__ */ N(G, { onClose: () => x(!1) })
628
716
  ]
629
717
  });
630
718
  }
631
719
  //#endregion
632
- export { V as InvoicesPage };
720
+ export { J as InvoicesPage };
633
721
 
634
722
  //# sourceMappingURL=InvoicesPage.js.map