@burdenoff/microfe-brainyrich 2026.1101.2 → 2026.1101.3

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 (65) hide show
  1. package/dist/brainyrich/BrainyRichRoot.d.ts.map +1 -1
  2. package/dist/brainyrich/BrainyRichRoot.js +22 -107
  3. package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
  4. package/dist/brainyrich/BrainyRichRoutes.d.ts.map +1 -1
  5. package/dist/brainyrich/BrainyRichRoutes.js +65 -46
  6. package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
  7. package/dist/brainyrich/components/mobile/MobilePage.d.ts +44 -0
  8. package/dist/brainyrich/components/mobile/MobilePage.d.ts.map +1 -0
  9. package/dist/brainyrich/components/mobile/MobilePage.js +45 -0
  10. package/dist/brainyrich/components/mobile/MobilePage.js.map +1 -0
  11. package/dist/brainyrich/components/mobile/MobileTabBar.d.ts +20 -0
  12. package/dist/brainyrich/components/mobile/MobileTabBar.d.ts.map +1 -0
  13. package/dist/brainyrich/components/mobile/MobileTabBar.js +139 -0
  14. package/dist/brainyrich/components/mobile/MobileTabBar.js.map +1 -0
  15. package/dist/brainyrich/components/mobile/index.d.ts +8 -0
  16. package/dist/brainyrich/components/mobile/index.d.ts.map +1 -0
  17. package/dist/brainyrich/components/mobile/index.js +2 -0
  18. package/dist/brainyrich/hooks/useBrainyRichApi.d.ts +48 -12
  19. package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -1
  20. package/dist/brainyrich/hooks/useBrainyRichApi.js +120 -108
  21. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
  22. package/dist/brainyrich/hooks/useIsMobileViewport.d.ts +14 -0
  23. package/dist/brainyrich/hooks/useIsMobileViewport.d.ts.map +1 -0
  24. package/dist/brainyrich/hooks/useIsMobileViewport.js +23 -0
  25. package/dist/brainyrich/hooks/useIsMobileViewport.js.map +1 -0
  26. package/dist/brainyrich/navItems.d.ts +36 -0
  27. package/dist/brainyrich/navItems.d.ts.map +1 -0
  28. package/dist/brainyrich/navItems.js +54 -0
  29. package/dist/brainyrich/navItems.js.map +1 -0
  30. package/dist/brainyrich/pages/AccountsPage.d.ts.map +1 -1
  31. package/dist/brainyrich/pages/AccountsPage.js +411 -390
  32. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  33. package/dist/brainyrich/pages/DashboardPage.d.ts.map +1 -1
  34. package/dist/brainyrich/pages/DashboardPage.js +220 -174
  35. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  36. package/dist/brainyrich/pages/GoalsPage.d.ts.map +1 -1
  37. package/dist/brainyrich/pages/GoalsPage.js +560 -551
  38. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  39. package/dist/brainyrich/pages/mobile/MobileAccountsView.d.ts +28 -0
  40. package/dist/brainyrich/pages/mobile/MobileAccountsView.d.ts.map +1 -0
  41. package/dist/brainyrich/pages/mobile/MobileAccountsView.js +139 -0
  42. package/dist/brainyrich/pages/mobile/MobileAccountsView.js.map +1 -0
  43. package/dist/brainyrich/pages/mobile/MobileDashboardView.d.ts +24 -0
  44. package/dist/brainyrich/pages/mobile/MobileDashboardView.d.ts.map +1 -0
  45. package/dist/brainyrich/pages/mobile/MobileDashboardView.js +245 -0
  46. package/dist/brainyrich/pages/mobile/MobileDashboardView.js.map +1 -0
  47. package/dist/brainyrich/pages/mobile/MobileGoalsView.d.ts +30 -0
  48. package/dist/brainyrich/pages/mobile/MobileGoalsView.d.ts.map +1 -0
  49. package/dist/brainyrich/pages/mobile/MobileGoalsView.js +180 -0
  50. package/dist/brainyrich/pages/mobile/MobileGoalsView.js.map +1 -0
  51. package/dist/brainyrich/pages/mobile/mobileShared.d.ts +24 -0
  52. package/dist/brainyrich/pages/mobile/mobileShared.d.ts.map +1 -0
  53. package/dist/brainyrich/pages/mobile/mobileShared.js +25 -0
  54. package/dist/brainyrich/pages/mobile/mobileShared.js.map +1 -0
  55. package/dist/brainyrich/utils/cn.js +10 -0
  56. package/dist/brainyrich/utils/cn.js.map +1 -0
  57. package/dist/brainyrich/utils/goalMetrics.d.ts +13 -0
  58. package/dist/brainyrich/utils/goalMetrics.d.ts.map +1 -0
  59. package/dist/brainyrich/utils/goalMetrics.js +20 -0
  60. package/dist/brainyrich/utils/goalMetrics.js.map +1 -0
  61. package/dist/test/brainyrichFixtures.d.ts +7 -0
  62. package/dist/test/brainyrichFixtures.d.ts.map +1 -0
  63. package/dist/test/viewport.d.ts +8 -0
  64. package/dist/test/viewport.d.ts.map +1 -0
  65. package/package.json +1 -1
@@ -5,16 +5,18 @@ import { ActorName as o } from "../components/ActorName.js";
5
5
  import { DonutChart as ie, FadeIn as s, GlassCard as ae, StatTile as c } from "../components/viz.js";
6
6
  import { HouseholdPicker as l } from "../components/pickers.js";
7
7
  import "../components/index.js";
8
- import { EmptyState as u, ErrorState as d, LoadingState as f, SectionShell as p, formatCompact as oe, formatDate as se, formatMoney as m, statusBadgeVariant as ce } from "./_shared.js";
9
- import { hapticSuccess as le, showToast as ue } from "../utils/nativeControls.js";
10
- import { useTrackBrainyRichPageView as de } from "../hooks/useBrainyRichAnalytics.js";
8
+ import { EmptyState as u, ErrorState as d, LoadingState as f, SectionShell as p, formatCompact as oe, formatDate as m, formatMoney as h, statusBadgeVariant as se } from "./_shared.js";
9
+ import { hapticSuccess as ce, showToast as le } from "../utils/nativeControls.js";
10
+ import { useTrackBrainyRichPageView as ue } from "../hooks/useBrainyRichAnalytics.js";
11
+ import { useIsMobileViewport as de } from "../hooks/useIsMobileViewport.js";
11
12
  import { AggregationPanel as fe } from "../components/AggregationPanel.js";
12
- import { DocumentsPanel as h } from "../components/reuse/DocumentsPanel.js";
13
+ import { DocumentsPanel as pe } from "../components/reuse/DocumentsPanel.js";
13
14
  import { TagField as g } from "../components/reuse/TagField.js";
14
- import { useEffect as pe, useMemo as me, useState as _ } from "react";
15
- import { Archive as he, ArrowDownRight as v, ArrowUpRight as y, Building2 as ge, CheckCircle2 as _e, ChevronRight as ve, Landmark as b, Layers as ye, MoreHorizontal as be, Pencil as xe, Plus as Se, Receipt as x, Wallet as Ce } from "lucide-react";
16
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
17
- import { Badge as w, Button as T, Card as we, CardContent as Te, CardDescription as Ee, CardHeader as De, CardTitle as Oe, DropdownMenu as ke, DropdownMenuContent as Ae, DropdownMenuItem as je, DropdownMenuTrigger as Me, Input as E, Label as D, ResponsiveDialog as O, ResponsiveDialogClose as Ne, ResponsiveDialogContent as k, ResponsiveDialogDescription as A, ResponsiveDialogFooter as j, ResponsiveDialogHeader as M, ResponsiveDialogTitle as N, Select as Pe, SelectContent as Fe, SelectItem as Ie, SelectTrigger as Le, SelectValue as Re, Sheet as P, SheetContent as F, SheetDescription as I, SheetHeader as L, SheetTitle as ze, Table as Be, TableBody as Ve, TableCell as R, TableHead as z, TableHeader as He, TableRow as B, Tabs as V, TabsContent as H, TabsList as U, TabsTrigger as W, Textarea as Ue } from "@burdenoff/fe-libs/ui";
15
+ import { MobileAccountsView as me } from "./mobile/MobileAccountsView.js";
16
+ import { useEffect as he, useMemo as ge, useState as _ } from "react";
17
+ import { Archive as _e, ArrowDownRight as v, ArrowUpRight as y, Building2 as ve, CheckCircle2 as ye, ChevronRight as be, Landmark as b, Layers as xe, MoreHorizontal as Se, Pencil as Ce, Plus as we, Receipt as x, Wallet as Te } from "lucide-react";
18
+ import { Fragment as Ee, jsx as S, jsxs as C } from "react/jsx-runtime";
19
+ import { Badge as w, Button as T, Card as De, CardContent as Oe, CardDescription as ke, CardHeader as Ae, CardTitle as je, DropdownMenu as Me, DropdownMenuContent as Ne, DropdownMenuItem as Pe, DropdownMenuTrigger as Fe, Input as E, Label as D, ResponsiveDialog as O, ResponsiveDialogClose as Ie, ResponsiveDialogContent as k, ResponsiveDialogDescription as A, ResponsiveDialogFooter as j, ResponsiveDialogHeader as M, ResponsiveDialogTitle as N, Select as Le, SelectContent as Re, SelectItem as ze, SelectTrigger as Be, SelectValue as Ve, Sheet as P, SheetContent as F, SheetDescription as I, SheetHeader as L, SheetTitle as R, Table as He, TableBody as Ue, TableCell as z, TableHead as B, TableHeader as We, TableRow as V, Tabs as Ge, TabsContent as H, TabsList as U, TabsTrigger as W, Textarea as Ke } from "@burdenoff/fe-libs/ui";
18
20
  //#region src/brainyrich/pages/AccountsPage.tsx
19
21
  var G = [
20
22
  "BANK",
@@ -25,7 +27,7 @@ var G = [
25
27
  "REAL_ESTATE",
26
28
  "ALTERNATIVE",
27
29
  "LIABILITY"
28
- ], We = [
30
+ ], qe = [
29
31
  "BUY",
30
32
  "SELL",
31
33
  "DIVIDEND",
@@ -34,7 +36,7 @@ var G = [
34
36
  "WITHDRAWAL",
35
37
  "FEE",
36
38
  "TRANSFER"
37
- ], Ge = {
39
+ ], Je = {
38
40
  BANK: "teal",
39
41
  BROKERAGE: "brand",
40
42
  RETIREMENT: "blue",
@@ -60,7 +62,7 @@ var J = {
60
62
  cashBalance: "",
61
63
  accountMask: "",
62
64
  householdId: null
63
- }, Ke = {
65
+ }, Ye = {
64
66
  type: "DEPOSIT",
65
67
  tradeDate: "",
66
68
  symbol: "",
@@ -71,43 +73,43 @@ var J = {
71
73
  notes: ""
72
74
  };
73
75
  function Y() {
74
- de("brainyrich.accounts.viewed");
75
- let e = t().data, a = i(), [o, l] = _(void 0), [se, h] = _(!1), [g, v] = _(J), [y, x] = _(null), [P, F] = _(J), [I, L] = _(null), [ze, V] = _(!1), [H, U] = _(void 0), [W, G] = _(void 0), [K, Y] = _(Ke), X = r(), Z = te(), Ye = n(), Xe = ee();
76
- pe(() => {
77
- if (!W) return;
76
+ ue("brainyrich.accounts.viewed");
77
+ let e = de(), a = t().data, o = i(), [l, m] = _(void 0), [pe, g] = _(!1), [v, y] = _(J), [x, P] = _(null), [F, I] = _(J), [L, R] = _(null), [Ge, H] = _(!1), [U, W] = _(void 0), [G, K] = _(void 0), [Y, X] = _(Ye), Qe = r(), $e = te(), et = n(), tt = ee();
78
+ he(() => {
79
+ if (!G) return;
78
80
  let e = window.setTimeout(() => {
79
- G(void 0), V(!0);
81
+ K(void 0), H(!0);
80
82
  }, 320);
81
83
  return () => window.clearTimeout(e);
82
- }, [W]);
83
- let Ze = e.reduce((e, t) => e + (t.cashBalance ?? 0), 0), Qe = e.filter((e) => e.status === "ACTIVE").length, $e = new Set(e.map((e) => e.institution).filter((e) => !!e)).size, et = e[0]?.currency ?? "USD", tt = me(() => {
84
- let t = /* @__PURE__ */ new Map();
85
- for (let n of e) {
86
- let e = n.cashBalance ?? 0;
87
- e <= 0 || t.set(n.type, (t.get(n.type) ?? 0) + e);
84
+ }, [G]);
85
+ let nt = a.reduce((e, t) => e + (t.cashBalance ?? 0), 0), rt = a.filter((e) => e.status === "ACTIVE").length, it = new Set(a.map((e) => e.institution).filter((e) => !!e)).size, Z = a[0]?.currency ?? "USD", at = ge(() => {
86
+ let e = /* @__PURE__ */ new Map();
87
+ for (let t of a) {
88
+ let n = t.cashBalance ?? 0;
89
+ n <= 0 || e.set(t.type, (e.get(t.type) ?? 0) + n);
88
90
  }
89
- return [...t.entries()].map(([e, t]) => ({
91
+ return [...e.entries()].map(([e, t]) => ({
90
92
  label: e.replace(/_/g, " "),
91
93
  value: t,
92
- tone: Ge[e]
94
+ tone: Je[e]
93
95
  })).sort((e, t) => t.value - e.value);
94
- }, [e]);
95
- function nt() {
96
- v(J), h(!0);
96
+ }, [a]);
97
+ function ot() {
98
+ y(J), g(!0);
97
99
  }
98
- function rt() {
99
- g.name.trim() && X.mutate({
100
- name: g.name.trim(),
101
- type: g.type,
102
- institution: g.institution.trim() || null,
103
- currency: g.currency.trim() || "USD",
104
- cashBalance: q(g.cashBalance) ?? 0,
105
- accountMask: g.accountMask.trim() || null,
106
- householdId: g.householdId
107
- }, { onSuccess: () => h(!1) });
100
+ function st() {
101
+ v.name.trim() && Qe.mutate({
102
+ name: v.name.trim(),
103
+ type: v.type,
104
+ institution: v.institution.trim() || null,
105
+ currency: v.currency.trim() || "USD",
106
+ cashBalance: q(v.cashBalance) ?? 0,
107
+ accountMask: v.accountMask.trim() || null,
108
+ householdId: v.householdId
109
+ }, { onSuccess: () => g(!1) });
108
110
  }
109
- function it(e) {
110
- x(e), F({
111
+ function ct(e) {
112
+ P(e), I({
111
113
  name: e.name,
112
114
  type: e.type,
113
115
  institution: e.institution ?? "",
@@ -117,60 +119,314 @@ function Y() {
117
119
  householdId: e.householdId
118
120
  });
119
121
  }
120
- function at() {
121
- !y || !P.name.trim() || Z.mutate({
122
- id: y.id,
122
+ function lt() {
123
+ !x || !F.name.trim() || $e.mutate({
124
+ id: x.id,
123
125
  input: {
124
- name: P.name.trim(),
125
- type: P.type,
126
- institution: P.institution.trim() || null,
127
- currency: P.currency.trim() || "USD",
128
- cashBalance: q(P.cashBalance) ?? 0,
129
- accountMask: P.accountMask.trim() || null,
130
- householdId: P.householdId
126
+ name: F.name.trim(),
127
+ type: F.type,
128
+ institution: F.institution.trim() || null,
129
+ currency: F.currency.trim() || "USD",
130
+ cashBalance: q(F.cashBalance) ?? 0,
131
+ accountMask: F.accountMask.trim() || null,
132
+ householdId: F.householdId
131
133
  }
132
- }, { onSuccess: () => x(null) });
134
+ }, { onSuccess: () => P(null) });
133
135
  }
134
- function ot() {
135
- if (!I) return;
136
- let e = I.id;
137
- Ye.mutate(e, { onSuccess: () => {
138
- le(), ue("Account archived"), L(null), o === e && l(void 0);
136
+ function ut() {
137
+ if (!L) return;
138
+ let e = L.id;
139
+ et.mutate(e, { onSuccess: () => {
140
+ ce(), le("Account archived"), R(null), l === e && m(void 0);
139
141
  } });
140
142
  }
141
- function st(e) {
142
- Y(Ke), U(e), l(void 0), G(e);
143
+ function dt(e) {
144
+ X(Ye), W(e), m(void 0), K(e);
143
145
  }
144
- function ct() {
145
- G(void 0), V(!1);
146
- let e = H;
147
- U(void 0), e && l(e);
146
+ function ft() {
147
+ K(void 0), H(!1);
148
+ let e = U;
149
+ W(void 0), e && m(e);
148
150
  }
149
- let Q = q(K.amount), $ = Q !== void 0 && Q > 0, lt = !!(H && K.tradeDate) && $;
150
- function ut() {
151
- if (!H || !K.tradeDate || !$) return;
152
- let e = new Date(K.tradeDate);
153
- Number.isNaN(e.getTime()) || Xe.mutate({
154
- accountId: H,
155
- type: K.type,
151
+ let Q = q(Y.amount), $ = Q !== void 0 && Q > 0, pt = !!(U && Y.tradeDate) && $;
152
+ function mt() {
153
+ if (!U || !Y.tradeDate || !$) return;
154
+ let e = new Date(Y.tradeDate);
155
+ Number.isNaN(e.getTime()) || tt.mutate({
156
+ accountId: U,
157
+ type: Y.type,
156
158
  tradeDate: e.toISOString(),
157
- symbol: K.symbol.trim() || null,
158
- quantity: q(K.quantity),
159
- price: q(K.price),
159
+ symbol: Y.symbol.trim() || null,
160
+ quantity: q(Y.quantity),
161
+ price: q(Y.price),
160
162
  amount: Q,
161
- fee: q(K.fee),
162
- notes: K.notes.trim() || null
163
- }, { onSuccess: ct });
163
+ fee: q(Y.fee),
164
+ notes: Y.notes.trim() || null
165
+ }, { onSuccess: ft });
164
166
  }
165
- return /* @__PURE__ */ S("div", {
167
+ let ht = (e) => h(e, Z), gt = /* @__PURE__ */ C(Ee, { children: [
168
+ /* @__PURE__ */ S(O, {
169
+ open: pe,
170
+ onOpenChange: g,
171
+ children: /* @__PURE__ */ C(k, {
172
+ className: "max-h-[90vh] overflow-y-auto",
173
+ children: [
174
+ /* @__PURE__ */ C(M, { children: [/* @__PURE__ */ S(N, { children: "New account" }), /* @__PURE__ */ S(A, { children: "Add a bank, brokerage or retirement account." })] }),
175
+ /* @__PURE__ */ S(Xe, {
176
+ form: v,
177
+ onChange: y
178
+ }),
179
+ /* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(Ie, {
180
+ asChild: !0,
181
+ children: /* @__PURE__ */ S(T, {
182
+ variant: "outline",
183
+ children: "Cancel"
184
+ })
185
+ }), /* @__PURE__ */ S(T, {
186
+ onClick: st,
187
+ disabled: !v.name.trim() || Qe.isPending,
188
+ children: Qe.isPending ? "Creating…" : "Create account"
189
+ })] })
190
+ ]
191
+ })
192
+ }),
193
+ /* @__PURE__ */ S(O, {
194
+ open: !!x,
195
+ onOpenChange: (e) => !e && P(null),
196
+ children: /* @__PURE__ */ C(k, {
197
+ className: "max-h-[90vh] overflow-y-auto",
198
+ children: [
199
+ /* @__PURE__ */ C(M, { children: [/* @__PURE__ */ S(N, { children: "Edit account" }), /* @__PURE__ */ S(A, { children: "Update account details." })] }),
200
+ /* @__PURE__ */ S(Xe, {
201
+ form: F,
202
+ onChange: I
203
+ }),
204
+ /* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(T, {
205
+ variant: "outline",
206
+ onClick: () => P(null),
207
+ children: "Cancel"
208
+ }), /* @__PURE__ */ S(T, {
209
+ onClick: lt,
210
+ disabled: !F.name.trim() || $e.isPending,
211
+ children: $e.isPending ? "Saving…" : "Save changes"
212
+ })] })
213
+ ]
214
+ })
215
+ }),
216
+ /* @__PURE__ */ S(re, {
217
+ open: !!L,
218
+ onOpenChange: (e) => !e && R(null),
219
+ title: "Archive account?",
220
+ description: L ? `“${L.name}” will be archived and hidden from active lists. This does not delete its history.` : void 0,
221
+ confirmLabel: "Archive account",
222
+ pendingLabel: "Archiving…",
223
+ destructive: !0,
224
+ pending: et.isPending,
225
+ onConfirm: ut
226
+ }),
227
+ /* @__PURE__ */ S(Ze, {
228
+ accountId: l,
229
+ onClose: () => {
230
+ m(void 0), K(void 0);
231
+ },
232
+ onRecordTransaction: dt
233
+ }),
234
+ /* @__PURE__ */ S(O, {
235
+ open: Ge,
236
+ onOpenChange: (e) => !e && ft(),
237
+ children: /* @__PURE__ */ C(k, {
238
+ className: "max-h-[90vh] overflow-y-auto",
239
+ children: [
240
+ /* @__PURE__ */ C(M, { children: [/* @__PURE__ */ S(N, { children: "Record transaction" }), /* @__PURE__ */ S(A, { children: "Log activity against the selected account." })] }),
241
+ /* @__PURE__ */ C("div", {
242
+ className: "grid gap-4",
243
+ children: [
244
+ /* @__PURE__ */ C("div", {
245
+ className: "grid grid-cols-2 gap-4",
246
+ children: [/* @__PURE__ */ C("div", {
247
+ className: "space-y-2",
248
+ children: [/* @__PURE__ */ S(D, {
249
+ htmlFor: "tx-type",
250
+ children: "Type"
251
+ }), /* @__PURE__ */ C(Le, {
252
+ value: Y.type,
253
+ onValueChange: (e) => X((t) => ({
254
+ ...t,
255
+ type: e
256
+ })),
257
+ children: [/* @__PURE__ */ S(Be, {
258
+ id: "tx-type",
259
+ children: /* @__PURE__ */ S(Ve, {})
260
+ }), /* @__PURE__ */ S(Re, { children: qe.map((e) => /* @__PURE__ */ S(ze, {
261
+ value: e,
262
+ children: e.replace(/_/g, " ")
263
+ }, e)) })]
264
+ })]
265
+ }), /* @__PURE__ */ C("div", {
266
+ className: "space-y-2",
267
+ children: [/* @__PURE__ */ S(D, {
268
+ htmlFor: "tx-date",
269
+ children: "Trade date"
270
+ }), /* @__PURE__ */ S(E, {
271
+ id: "tx-date",
272
+ type: "date",
273
+ value: Y.tradeDate,
274
+ onChange: (e) => X((t) => ({
275
+ ...t,
276
+ tradeDate: e.target.value
277
+ }))
278
+ })]
279
+ })]
280
+ }),
281
+ /* @__PURE__ */ C("div", {
282
+ className: "grid grid-cols-2 gap-4",
283
+ children: [/* @__PURE__ */ C("div", {
284
+ className: "space-y-2",
285
+ children: [/* @__PURE__ */ S(D, {
286
+ htmlFor: "tx-symbol",
287
+ children: "Symbol"
288
+ }), /* @__PURE__ */ S(E, {
289
+ id: "tx-symbol",
290
+ value: Y.symbol,
291
+ onChange: (e) => X((t) => ({
292
+ ...t,
293
+ symbol: e.target.value
294
+ })),
295
+ placeholder: "e.g. VOO"
296
+ })]
297
+ }), /* @__PURE__ */ C("div", {
298
+ className: "space-y-2",
299
+ children: [
300
+ /* @__PURE__ */ S(D, {
301
+ htmlFor: "tx-amount",
302
+ children: "Amount"
303
+ }),
304
+ /* @__PURE__ */ S(E, {
305
+ id: "tx-amount",
306
+ type: "number",
307
+ min: "0",
308
+ step: "any",
309
+ value: Y.amount,
310
+ onChange: (e) => X((t) => ({
311
+ ...t,
312
+ amount: e.target.value
313
+ })),
314
+ "aria-invalid": Y.amount.trim() !== "" && !$,
315
+ "aria-describedby": "tx-amount-hint"
316
+ }),
317
+ /* @__PURE__ */ S("p", {
318
+ id: "tx-amount-hint",
319
+ className: "text-xs text-text-secondary",
320
+ children: Y.amount.trim() !== "" && !$ ? "Enter an amount greater than 0." : "Positive amount; direction is set by the type."
321
+ })
322
+ ]
323
+ })]
324
+ }),
325
+ /* @__PURE__ */ C("div", {
326
+ className: "grid grid-cols-3 gap-4",
327
+ children: [
328
+ /* @__PURE__ */ C("div", {
329
+ className: "space-y-2",
330
+ children: [/* @__PURE__ */ S(D, {
331
+ htmlFor: "tx-qty",
332
+ children: "Quantity"
333
+ }), /* @__PURE__ */ S(E, {
334
+ id: "tx-qty",
335
+ type: "number",
336
+ value: Y.quantity,
337
+ onChange: (e) => X((t) => ({
338
+ ...t,
339
+ quantity: e.target.value
340
+ }))
341
+ })]
342
+ }),
343
+ /* @__PURE__ */ C("div", {
344
+ className: "space-y-2",
345
+ children: [/* @__PURE__ */ S(D, {
346
+ htmlFor: "tx-price",
347
+ children: "Price"
348
+ }), /* @__PURE__ */ S(E, {
349
+ id: "tx-price",
350
+ type: "number",
351
+ value: Y.price,
352
+ onChange: (e) => X((t) => ({
353
+ ...t,
354
+ price: e.target.value
355
+ }))
356
+ })]
357
+ }),
358
+ /* @__PURE__ */ C("div", {
359
+ className: "space-y-2",
360
+ children: [/* @__PURE__ */ S(D, {
361
+ htmlFor: "tx-fee",
362
+ children: "Fee"
363
+ }), /* @__PURE__ */ S(E, {
364
+ id: "tx-fee",
365
+ type: "number",
366
+ value: Y.fee,
367
+ onChange: (e) => X((t) => ({
368
+ ...t,
369
+ fee: e.target.value
370
+ }))
371
+ })]
372
+ })
373
+ ]
374
+ }),
375
+ /* @__PURE__ */ C("div", {
376
+ className: "space-y-2",
377
+ children: [/* @__PURE__ */ S(D, {
378
+ htmlFor: "tx-notes",
379
+ children: "Notes"
380
+ }), /* @__PURE__ */ S(Ke, {
381
+ id: "tx-notes",
382
+ value: Y.notes,
383
+ onChange: (e) => X((t) => ({
384
+ ...t,
385
+ notes: e.target.value
386
+ })),
387
+ placeholder: "Optional note"
388
+ })]
389
+ })
390
+ ]
391
+ }),
392
+ /* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(T, {
393
+ variant: "outline",
394
+ onClick: ft,
395
+ children: "Cancel"
396
+ }), /* @__PURE__ */ S(T, {
397
+ onClick: mt,
398
+ disabled: !pt || tt.isPending,
399
+ children: tt.isPending ? "Saving…" : "Record transaction"
400
+ })] })
401
+ ]
402
+ })
403
+ })
404
+ ] });
405
+ return e ? /* @__PURE__ */ C(Ee, { children: [/* @__PURE__ */ S(me, {
406
+ totalCash: nt,
407
+ accountCount: a.length,
408
+ currency: Z,
409
+ items: o.items,
410
+ isLoading: o.isLoading,
411
+ isError: o.isError,
412
+ refetch: () => o.refetch(),
413
+ hasMore: o.hasMore,
414
+ loadMore: o.loadMore,
415
+ isFetchingNextPage: o.isFetchingNextPage,
416
+ onCreate: ot,
417
+ onOpen: (e) => m(e.id),
418
+ onEdit: ct,
419
+ onArchive: R,
420
+ aggregation: /* @__PURE__ */ S(fe, {})
421
+ }), gt] }) : /* @__PURE__ */ S("div", {
166
422
  "data-tour": "brainyrich-page-accounts",
167
423
  className: "contents",
168
424
  children: /* @__PURE__ */ C(p, {
169
425
  title: "Accounts",
170
426
  description: "Linked bank, brokerage and retirement accounts with recent activity.",
171
- badges: [`${e.length} account${e.length === 1 ? "" : "s"}`],
427
+ badges: [`${a.length} account${a.length === 1 ? "" : "s"}`],
172
428
  actionLabel: "New account",
173
- onAction: nt,
429
+ onAction: ot,
174
430
  children: [
175
431
  /* @__PURE__ */ C("div", {
176
432
  className: "grid gap-4 lg:grid-cols-3",
@@ -181,9 +437,9 @@ function Y() {
181
437
  index: 0,
182
438
  children: /* @__PURE__ */ S(c, {
183
439
  label: "Total cash",
184
- value: m(Ze, et),
440
+ value: h(nt, Z),
185
441
  glow: !0,
186
- icon: /* @__PURE__ */ S(Ce, {
442
+ icon: /* @__PURE__ */ S(Te, {
187
443
  className: "size-4",
188
444
  "aria-hidden": "true"
189
445
  })
@@ -193,7 +449,7 @@ function Y() {
193
449
  index: 1,
194
450
  children: /* @__PURE__ */ S(c, {
195
451
  label: "Total accounts",
196
- value: String(e.length),
452
+ value: String(a.length),
197
453
  icon: /* @__PURE__ */ S(b, {
198
454
  className: "size-4",
199
455
  "aria-hidden": "true"
@@ -204,8 +460,8 @@ function Y() {
204
460
  index: 2,
205
461
  children: /* @__PURE__ */ S(c, {
206
462
  label: "Active",
207
- value: `${Qe}/${e.length}`,
208
- icon: /* @__PURE__ */ S(_e, {
463
+ value: `${rt}/${a.length}`,
464
+ icon: /* @__PURE__ */ S(ye, {
209
465
  className: "size-4",
210
466
  "aria-hidden": "true"
211
467
  })
@@ -215,8 +471,8 @@ function Y() {
215
471
  index: 3,
216
472
  children: /* @__PURE__ */ S(c, {
217
473
  label: "Institutions",
218
- value: String($e),
219
- icon: /* @__PURE__ */ S(ge, {
474
+ value: String(it),
475
+ icon: /* @__PURE__ */ S(ve, {
220
476
  className: "size-4",
221
477
  "aria-hidden": "true"
222
478
  })
@@ -230,22 +486,22 @@ function Y() {
230
486
  glow: !0,
231
487
  children: [/* @__PURE__ */ C("div", {
232
488
  className: "mb-2 flex items-center gap-2",
233
- children: [/* @__PURE__ */ S(ye, {
489
+ children: [/* @__PURE__ */ S(xe, {
234
490
  className: "size-4 text-text-secondary",
235
491
  "aria-hidden": "true"
236
492
  }), /* @__PURE__ */ S("h2", {
237
493
  className: "text-sm font-semibold text-text-primary",
238
494
  children: "Cash by account type"
239
495
  })]
240
- }), tt.length === 0 ? /* @__PURE__ */ S("p", {
496
+ }), at.length === 0 ? /* @__PURE__ */ S("p", {
241
497
  className: "py-8 text-center text-sm text-text-secondary",
242
498
  children: "No cash balances recorded yet."
243
499
  }) : /* @__PURE__ */ S(ie, {
244
- data: tt,
245
- centerValue: oe(Ze, et),
500
+ data: at,
501
+ centerValue: oe(nt, Z),
246
502
  centerLabel: "Total cash",
247
503
  height: 200,
248
- valueFormatter: (e) => m(e, et)
504
+ valueFormatter: ht
249
505
  })]
250
506
  })
251
507
  })]
@@ -253,15 +509,15 @@ function Y() {
253
509
  /* @__PURE__ */ S(s, {
254
510
  index: 5,
255
511
  as: "section",
256
- children: /* @__PURE__ */ C(we, {
512
+ children: /* @__PURE__ */ C(De, {
257
513
  className: "transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))]",
258
- children: [/* @__PURE__ */ C(De, { children: [/* @__PURE__ */ C(Oe, {
514
+ children: [/* @__PURE__ */ C(Ae, { children: [/* @__PURE__ */ C(je, {
259
515
  className: "flex items-center gap-2",
260
516
  children: [/* @__PURE__ */ S(b, {
261
517
  className: "h-5 w-5",
262
518
  "aria-hidden": "true"
263
519
  }), "Linked accounts"]
264
- }), /* @__PURE__ */ S(Ee, { children: "Select an account to view holdings and transactions." })] }), /* @__PURE__ */ S(Te, { children: a.isLoading ? /* @__PURE__ */ S(f, {}) : a.isError ? /* @__PURE__ */ S(d, { onRetry: () => a.refetch() }) : a.items.length === 0 ? /* @__PURE__ */ S(u, {
520
+ }), /* @__PURE__ */ S(ke, { children: "Select an account to view holdings and transactions." })] }), /* @__PURE__ */ S(Oe, { children: o.isLoading ? /* @__PURE__ */ S(f, {}) : o.isError ? /* @__PURE__ */ S(d, { onRetry: () => o.refetch() }) : o.items.length === 0 ? /* @__PURE__ */ S(u, {
265
521
  icon: /* @__PURE__ */ S(b, {
266
522
  className: "size-6",
267
523
  "aria-hidden": "true"
@@ -270,32 +526,32 @@ function Y() {
270
526
  description: "Add your first bank, brokerage or retirement account to start tracking net worth.",
271
527
  action: /* @__PURE__ */ C(T, {
272
528
  size: "sm",
273
- onClick: nt,
274
- children: [/* @__PURE__ */ S(Se, {
529
+ onClick: ot,
530
+ children: [/* @__PURE__ */ S(we, {
275
531
  className: "size-4",
276
532
  "aria-hidden": "true"
277
533
  }), "New account"]
278
534
  })
279
535
  }) : /* @__PURE__ */ C("div", {
280
536
  className: "overflow-x-auto",
281
- children: [/* @__PURE__ */ C(Be, { children: [/* @__PURE__ */ S(He, { children: /* @__PURE__ */ C(B, { children: [
282
- /* @__PURE__ */ S(z, { children: "Account" }),
283
- /* @__PURE__ */ S(z, { children: "Type" }),
284
- /* @__PURE__ */ S(z, { children: "Institution" }),
285
- /* @__PURE__ */ S(z, {
537
+ children: [/* @__PURE__ */ C(He, { children: [/* @__PURE__ */ S(We, { children: /* @__PURE__ */ C(V, { children: [
538
+ /* @__PURE__ */ S(B, { children: "Account" }),
539
+ /* @__PURE__ */ S(B, { children: "Type" }),
540
+ /* @__PURE__ */ S(B, { children: "Institution" }),
541
+ /* @__PURE__ */ S(B, {
286
542
  className: "text-right",
287
543
  children: "Cash balance"
288
544
  }),
289
- /* @__PURE__ */ S(z, { children: "Status" }),
290
- /* @__PURE__ */ S(z, {
545
+ /* @__PURE__ */ S(B, { children: "Status" }),
546
+ /* @__PURE__ */ S(B, {
291
547
  className: "w-12 text-right",
292
548
  children: "Actions"
293
549
  })
294
- ] }) }), /* @__PURE__ */ S(Ve, { children: a.items.map((e) => /* @__PURE__ */ C(B, {
550
+ ] }) }), /* @__PURE__ */ S(Ue, { children: o.items.map((e) => /* @__PURE__ */ C(V, {
295
551
  className: "group cursor-pointer transition-colors hover:bg-bg-elevated",
296
- onClick: () => l(e.id),
552
+ onClick: () => m(e.id),
297
553
  children: [
298
- /* @__PURE__ */ S(R, { children: /* @__PURE__ */ C("div", {
554
+ /* @__PURE__ */ S(z, { children: /* @__PURE__ */ C("div", {
299
555
  className: "flex items-center gap-3",
300
556
  children: [/* @__PURE__ */ S("div", {
301
557
  className: "flex h-9 w-9 items-center justify-center rounded-lg border border-border-subtle bg-bg-sunken text-xs font-semibold text-text-secondary transition-colors group-hover:border-[var(--color-action-primary-border)] group-hover:text-text-primary",
@@ -305,7 +561,7 @@ function Y() {
305
561
  className: "min-w-0",
306
562
  children: [/* @__PURE__ */ C("p", {
307
563
  className: "flex items-center gap-1 truncate font-medium text-text-primary",
308
- children: [e.name, /* @__PURE__ */ S(ve, {
564
+ children: [e.name, /* @__PURE__ */ S(be, {
309
565
  className: "size-3.5 shrink-0 text-text-secondary opacity-0 transition-opacity group-hover:opacity-100",
310
566
  "aria-hidden": "true"
311
567
  })]
@@ -319,48 +575,48 @@ function Y() {
319
575
  })]
320
576
  })]
321
577
  }) }),
322
- /* @__PURE__ */ S(R, { children: /* @__PURE__ */ S(w, {
578
+ /* @__PURE__ */ S(z, { children: /* @__PURE__ */ S(w, {
323
579
  variant: "outline",
324
580
  children: e.type.replace(/_/g, " ")
325
581
  }) }),
326
- /* @__PURE__ */ S(R, {
582
+ /* @__PURE__ */ S(z, {
327
583
  className: "text-sm text-text-secondary",
328
584
  children: e.institution ?? "—"
329
585
  }),
330
- /* @__PURE__ */ S(R, {
586
+ /* @__PURE__ */ S(z, {
331
587
  className: "text-right font-semibold tabular-nums text-text-primary",
332
- children: m(e.cashBalance, e.currency)
588
+ children: h(e.cashBalance, e.currency)
333
589
  }),
334
- /* @__PURE__ */ S(R, { children: /* @__PURE__ */ S(w, {
335
- variant: ce(e.status),
590
+ /* @__PURE__ */ S(z, { children: /* @__PURE__ */ S(w, {
591
+ variant: se(e.status),
336
592
  children: e.status
337
593
  }) }),
338
- /* @__PURE__ */ S(R, {
594
+ /* @__PURE__ */ S(z, {
339
595
  className: "text-right",
340
596
  onClick: (e) => e.stopPropagation(),
341
- children: /* @__PURE__ */ C(ke, { children: [/* @__PURE__ */ S(Me, {
597
+ children: /* @__PURE__ */ C(Me, { children: [/* @__PURE__ */ S(Fe, {
342
598
  asChild: !0,
343
599
  children: /* @__PURE__ */ S(T, {
344
600
  variant: "ghost",
345
601
  size: "sm",
346
602
  "aria-label": `Actions for ${e.name}`,
347
- children: /* @__PURE__ */ S(be, {
603
+ children: /* @__PURE__ */ S(Se, {
348
604
  className: "size-4",
349
605
  "aria-hidden": "true"
350
606
  })
351
607
  })
352
- }), /* @__PURE__ */ C(Ae, {
608
+ }), /* @__PURE__ */ C(Ne, {
353
609
  align: "end",
354
- children: [/* @__PURE__ */ C(je, {
355
- onClick: () => it(e),
356
- children: [/* @__PURE__ */ S(xe, {
610
+ children: [/* @__PURE__ */ C(Pe, {
611
+ onClick: () => ct(e),
612
+ children: [/* @__PURE__ */ S(Ce, {
357
613
  className: "size-4",
358
614
  "aria-hidden": "true"
359
615
  }), "Edit"]
360
- }), /* @__PURE__ */ C(je, {
616
+ }), /* @__PURE__ */ C(Pe, {
361
617
  className: "text-status-error-text",
362
- onClick: () => L(e),
363
- children: [/* @__PURE__ */ S(he, {
618
+ onClick: () => R(e),
619
+ children: [/* @__PURE__ */ S(_e, {
364
620
  className: "size-4",
365
621
  "aria-hidden": "true"
366
622
  }), "Archive"]
@@ -369,9 +625,9 @@ function Y() {
369
625
  })
370
626
  ]
371
627
  }, e.id)) })] }), /* @__PURE__ */ S(ne, {
372
- hasMore: a.hasMore,
373
- onClick: a.loadMore,
374
- loading: a.isFetchingNextPage,
628
+ hasMore: o.hasMore,
629
+ onClick: o.loadMore,
630
+ loading: o.isFetchingNextPage,
375
631
  className: "mt-4"
376
632
  })]
377
633
  }) })]
@@ -382,247 +638,12 @@ function Y() {
382
638
  as: "section",
383
639
  children: /* @__PURE__ */ S(fe, {})
384
640
  }),
385
- /* @__PURE__ */ S(O, {
386
- open: se,
387
- onOpenChange: h,
388
- children: /* @__PURE__ */ C(k, {
389
- className: "max-h-[90vh] overflow-y-auto",
390
- children: [
391
- /* @__PURE__ */ C(M, { children: [/* @__PURE__ */ S(N, { children: "New account" }), /* @__PURE__ */ S(A, { children: "Add a bank, brokerage or retirement account." })] }),
392
- /* @__PURE__ */ S(qe, {
393
- form: g,
394
- onChange: v
395
- }),
396
- /* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(Ne, {
397
- asChild: !0,
398
- children: /* @__PURE__ */ S(T, {
399
- variant: "outline",
400
- children: "Cancel"
401
- })
402
- }), /* @__PURE__ */ S(T, {
403
- onClick: rt,
404
- disabled: !g.name.trim() || X.isPending,
405
- children: X.isPending ? "Creating…" : "Create account"
406
- })] })
407
- ]
408
- })
409
- }),
410
- /* @__PURE__ */ S(O, {
411
- open: !!y,
412
- onOpenChange: (e) => !e && x(null),
413
- children: /* @__PURE__ */ C(k, {
414
- className: "max-h-[90vh] overflow-y-auto",
415
- children: [
416
- /* @__PURE__ */ C(M, { children: [/* @__PURE__ */ S(N, { children: "Edit account" }), /* @__PURE__ */ S(A, { children: "Update account details." })] }),
417
- /* @__PURE__ */ S(qe, {
418
- form: P,
419
- onChange: F
420
- }),
421
- /* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(T, {
422
- variant: "outline",
423
- onClick: () => x(null),
424
- children: "Cancel"
425
- }), /* @__PURE__ */ S(T, {
426
- onClick: at,
427
- disabled: !P.name.trim() || Z.isPending,
428
- children: Z.isPending ? "Saving…" : "Save changes"
429
- })] })
430
- ]
431
- })
432
- }),
433
- /* @__PURE__ */ S(re, {
434
- open: !!I,
435
- onOpenChange: (e) => !e && L(null),
436
- title: "Archive account?",
437
- description: I ? `“${I.name}” will be archived and hidden from active lists. This does not delete its history.` : void 0,
438
- confirmLabel: "Archive account",
439
- pendingLabel: "Archiving…",
440
- destructive: !0,
441
- pending: Ye.isPending,
442
- onConfirm: ot
443
- }),
444
- /* @__PURE__ */ S(Je, {
445
- accountId: o,
446
- onClose: () => {
447
- l(void 0), G(void 0);
448
- },
449
- onRecordTransaction: st
450
- }),
451
- /* @__PURE__ */ S(O, {
452
- open: ze,
453
- onOpenChange: (e) => !e && ct(),
454
- children: /* @__PURE__ */ C(k, {
455
- className: "max-h-[90vh] overflow-y-auto",
456
- children: [
457
- /* @__PURE__ */ C(M, { children: [/* @__PURE__ */ S(N, { children: "Record transaction" }), /* @__PURE__ */ S(A, { children: "Log activity against the selected account." })] }),
458
- /* @__PURE__ */ C("div", {
459
- className: "grid gap-4",
460
- children: [
461
- /* @__PURE__ */ C("div", {
462
- className: "grid grid-cols-2 gap-4",
463
- children: [/* @__PURE__ */ C("div", {
464
- className: "space-y-2",
465
- children: [/* @__PURE__ */ S(D, {
466
- htmlFor: "tx-type",
467
- children: "Type"
468
- }), /* @__PURE__ */ C(Pe, {
469
- value: K.type,
470
- onValueChange: (e) => Y((t) => ({
471
- ...t,
472
- type: e
473
- })),
474
- children: [/* @__PURE__ */ S(Le, {
475
- id: "tx-type",
476
- children: /* @__PURE__ */ S(Re, {})
477
- }), /* @__PURE__ */ S(Fe, { children: We.map((e) => /* @__PURE__ */ S(Ie, {
478
- value: e,
479
- children: e.replace(/_/g, " ")
480
- }, e)) })]
481
- })]
482
- }), /* @__PURE__ */ C("div", {
483
- className: "space-y-2",
484
- children: [/* @__PURE__ */ S(D, {
485
- htmlFor: "tx-date",
486
- children: "Trade date"
487
- }), /* @__PURE__ */ S(E, {
488
- id: "tx-date",
489
- type: "date",
490
- value: K.tradeDate,
491
- onChange: (e) => Y((t) => ({
492
- ...t,
493
- tradeDate: e.target.value
494
- }))
495
- })]
496
- })]
497
- }),
498
- /* @__PURE__ */ C("div", {
499
- className: "grid grid-cols-2 gap-4",
500
- children: [/* @__PURE__ */ C("div", {
501
- className: "space-y-2",
502
- children: [/* @__PURE__ */ S(D, {
503
- htmlFor: "tx-symbol",
504
- children: "Symbol"
505
- }), /* @__PURE__ */ S(E, {
506
- id: "tx-symbol",
507
- value: K.symbol,
508
- onChange: (e) => Y((t) => ({
509
- ...t,
510
- symbol: e.target.value
511
- })),
512
- placeholder: "e.g. VOO"
513
- })]
514
- }), /* @__PURE__ */ C("div", {
515
- className: "space-y-2",
516
- children: [
517
- /* @__PURE__ */ S(D, {
518
- htmlFor: "tx-amount",
519
- children: "Amount"
520
- }),
521
- /* @__PURE__ */ S(E, {
522
- id: "tx-amount",
523
- type: "number",
524
- min: "0",
525
- step: "any",
526
- value: K.amount,
527
- onChange: (e) => Y((t) => ({
528
- ...t,
529
- amount: e.target.value
530
- })),
531
- "aria-invalid": K.amount.trim() !== "" && !$,
532
- "aria-describedby": "tx-amount-hint"
533
- }),
534
- /* @__PURE__ */ S("p", {
535
- id: "tx-amount-hint",
536
- className: "text-xs text-text-secondary",
537
- children: K.amount.trim() !== "" && !$ ? "Enter an amount greater than 0." : "Positive amount; direction is set by the type."
538
- })
539
- ]
540
- })]
541
- }),
542
- /* @__PURE__ */ C("div", {
543
- className: "grid grid-cols-3 gap-4",
544
- children: [
545
- /* @__PURE__ */ C("div", {
546
- className: "space-y-2",
547
- children: [/* @__PURE__ */ S(D, {
548
- htmlFor: "tx-qty",
549
- children: "Quantity"
550
- }), /* @__PURE__ */ S(E, {
551
- id: "tx-qty",
552
- type: "number",
553
- value: K.quantity,
554
- onChange: (e) => Y((t) => ({
555
- ...t,
556
- quantity: e.target.value
557
- }))
558
- })]
559
- }),
560
- /* @__PURE__ */ C("div", {
561
- className: "space-y-2",
562
- children: [/* @__PURE__ */ S(D, {
563
- htmlFor: "tx-price",
564
- children: "Price"
565
- }), /* @__PURE__ */ S(E, {
566
- id: "tx-price",
567
- type: "number",
568
- value: K.price,
569
- onChange: (e) => Y((t) => ({
570
- ...t,
571
- price: e.target.value
572
- }))
573
- })]
574
- }),
575
- /* @__PURE__ */ C("div", {
576
- className: "space-y-2",
577
- children: [/* @__PURE__ */ S(D, {
578
- htmlFor: "tx-fee",
579
- children: "Fee"
580
- }), /* @__PURE__ */ S(E, {
581
- id: "tx-fee",
582
- type: "number",
583
- value: K.fee,
584
- onChange: (e) => Y((t) => ({
585
- ...t,
586
- fee: e.target.value
587
- }))
588
- })]
589
- })
590
- ]
591
- }),
592
- /* @__PURE__ */ C("div", {
593
- className: "space-y-2",
594
- children: [/* @__PURE__ */ S(D, {
595
- htmlFor: "tx-notes",
596
- children: "Notes"
597
- }), /* @__PURE__ */ S(Ue, {
598
- id: "tx-notes",
599
- value: K.notes,
600
- onChange: (e) => Y((t) => ({
601
- ...t,
602
- notes: e.target.value
603
- })),
604
- placeholder: "Optional note"
605
- })]
606
- })
607
- ]
608
- }),
609
- /* @__PURE__ */ C(j, { children: [/* @__PURE__ */ S(T, {
610
- variant: "outline",
611
- onClick: ct,
612
- children: "Cancel"
613
- }), /* @__PURE__ */ S(T, {
614
- onClick: ut,
615
- disabled: !lt || Xe.isPending,
616
- children: Xe.isPending ? "Saving…" : "Record transaction"
617
- })] })
618
- ]
619
- })
620
- })
641
+ gt
621
642
  ]
622
643
  })
623
644
  });
624
645
  }
625
- function qe({ form: e, onChange: t }) {
646
+ function Xe({ form: e, onChange: t }) {
626
647
  return /* @__PURE__ */ C("div", {
627
648
  className: "grid gap-4",
628
649
  children: [
@@ -648,16 +669,16 @@ function qe({ form: e, onChange: t }) {
648
669
  children: [/* @__PURE__ */ S(D, {
649
670
  htmlFor: "acct-type",
650
671
  children: "Type"
651
- }), /* @__PURE__ */ C(Pe, {
672
+ }), /* @__PURE__ */ C(Le, {
652
673
  value: e.type,
653
674
  onValueChange: (e) => t((t) => ({
654
675
  ...t,
655
676
  type: e
656
677
  })),
657
- children: [/* @__PURE__ */ S(Le, {
678
+ children: [/* @__PURE__ */ S(Be, {
658
679
  id: "acct-type",
659
- children: /* @__PURE__ */ S(Re, {})
660
- }), /* @__PURE__ */ S(Fe, { children: G.map((e) => /* @__PURE__ */ S(Ie, {
680
+ children: /* @__PURE__ */ S(Ve, {})
681
+ }), /* @__PURE__ */ S(Re, { children: G.map((e) => /* @__PURE__ */ S(ze, {
661
682
  value: e,
662
683
  children: e.replace(/_/g, " ")
663
684
  }, e)) })]
@@ -735,8 +756,8 @@ function qe({ form: e, onChange: t }) {
735
756
  ]
736
757
  });
737
758
  }
738
- function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
739
- let { data: i, isLoading: ee, isError: te, refetch: re } = e(t), s = a(t ? { accountId: t } : {}, { enabled: !!t }), c = t ? s.items : [], l = me(() => i ? i.holdings.filter((e) => Number.isFinite(e.marketValue) && e.marketValue > 0).map((e) => ({
759
+ function Ze({ accountId: t, onClose: n, onRecordTransaction: r }) {
760
+ let { data: i, isLoading: ee, isError: te, refetch: re } = e(t), s = a(t ? { accountId: t } : {}, { enabled: !!t }), c = t ? s.items : [], l = ge(() => i ? i.holdings.filter((e) => Number.isFinite(e.marketValue) && e.marketValue > 0).map((e) => ({
740
761
  label: e.symbol,
741
762
  value: e.marketValue
742
763
  })).sort((e, t) => t.value - e.value) : [], [i]), p = l.reduce((e, t) => e + t.value, 0);
@@ -747,7 +768,7 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
747
768
  className: "flex w-full flex-col overflow-y-auto p-0 sm:max-w-xl",
748
769
  children: [/* @__PURE__ */ C(L, {
749
770
  className: "border-b border-border-subtle px-6 pb-4 pt-6",
750
- children: [/* @__PURE__ */ S(ze, {
771
+ children: [/* @__PURE__ */ S(R, {
751
772
  className: "text-lg",
752
773
  children: i?.name ?? "Account"
753
774
  }), /* @__PURE__ */ S(I, { children: i ? `${i.institution ?? "Manual account"} · ${i.type.replace(/_/g, " ")}` : "Loading account details…" })]
@@ -772,10 +793,10 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
772
793
  children: "Cash balance"
773
794
  }), /* @__PURE__ */ S("p", {
774
795
  className: "mt-1 text-3xl font-semibold tracking-tight text-text-primary",
775
- children: m(i.cashBalance, i.currency)
796
+ children: h(i.cashBalance, i.currency)
776
797
  })]
777
798
  }), /* @__PURE__ */ S(w, {
778
- variant: ce(i.status),
799
+ variant: se(i.status),
779
800
  children: i.status
780
801
  })]
781
802
  }), /* @__PURE__ */ C("div", {
@@ -798,7 +819,7 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
798
819
  children: "Holdings value"
799
820
  }), /* @__PURE__ */ S("span", {
800
821
  className: "font-medium text-text-primary",
801
- children: p > 0 ? m(p, i.currency) : "—"
822
+ children: p > 0 ? h(p, i.currency) : "—"
802
823
  })]
803
824
  }),
804
825
  /* @__PURE__ */ C("div", {
@@ -824,7 +845,7 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
824
845
  centerValue: oe(p, i.currency),
825
846
  centerLabel: "Market value",
826
847
  height: 180,
827
- valueFormatter: (e) => m(e, i.currency)
848
+ valueFormatter: (e) => h(e, i.currency)
828
849
  })]
829
850
  }) : null,
830
851
  /* @__PURE__ */ S("div", {
@@ -834,7 +855,7 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
834
855
  entityId: i.id
835
856
  })
836
857
  }),
837
- /* @__PURE__ */ C(V, {
858
+ /* @__PURE__ */ C(Ge, {
838
859
  defaultValue: "holdings",
839
860
  className: "w-full",
840
861
  children: [
@@ -862,7 +883,7 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
862
883
  value: "holdings",
863
884
  className: "mt-4",
864
885
  children: i.holdings.length === 0 ? /* @__PURE__ */ S(u, {
865
- icon: /* @__PURE__ */ S(ye, {
886
+ icon: /* @__PURE__ */ S(xe, {
866
887
  className: "size-6",
867
888
  "aria-hidden": "true"
868
889
  }),
@@ -870,41 +891,41 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
870
891
  description: "This account has no positions recorded yet."
871
892
  }) : /* @__PURE__ */ S("div", {
872
893
  className: "overflow-x-auto rounded-lg border border-border-subtle",
873
- children: /* @__PURE__ */ C(Be, { children: [/* @__PURE__ */ S(He, { children: /* @__PURE__ */ C(B, { children: [
874
- /* @__PURE__ */ S(z, { children: "Holding" }),
875
- /* @__PURE__ */ S(z, {
894
+ children: /* @__PURE__ */ C(He, { children: [/* @__PURE__ */ S(We, { children: /* @__PURE__ */ C(V, { children: [
895
+ /* @__PURE__ */ S(B, { children: "Holding" }),
896
+ /* @__PURE__ */ S(B, {
876
897
  className: "text-right",
877
898
  children: "Qty"
878
899
  }),
879
- /* @__PURE__ */ S(z, {
900
+ /* @__PURE__ */ S(B, {
880
901
  className: "text-right",
881
902
  children: "Price"
882
903
  }),
883
- /* @__PURE__ */ S(z, {
904
+ /* @__PURE__ */ S(B, {
884
905
  className: "text-right",
885
906
  children: "Market value"
886
907
  })
887
- ] }) }), /* @__PURE__ */ S(Ve, { children: i.holdings.map((e) => /* @__PURE__ */ C(B, {
908
+ ] }) }), /* @__PURE__ */ S(Ue, { children: i.holdings.map((e) => /* @__PURE__ */ C(V, {
888
909
  className: "transition-colors hover:bg-bg-elevated",
889
910
  children: [
890
- /* @__PURE__ */ C(R, { children: [/* @__PURE__ */ S("p", {
911
+ /* @__PURE__ */ C(z, { children: [/* @__PURE__ */ S("p", {
891
912
  className: "font-medium text-text-primary",
892
913
  children: e.symbol
893
914
  }), e.name ? /* @__PURE__ */ S("p", {
894
915
  className: "truncate text-xs text-text-secondary",
895
916
  children: e.name
896
917
  }) : null] }),
897
- /* @__PURE__ */ S(R, {
918
+ /* @__PURE__ */ S(z, {
898
919
  className: "text-right tabular-nums text-text-secondary",
899
920
  children: e.quantity
900
921
  }),
901
- /* @__PURE__ */ S(R, {
922
+ /* @__PURE__ */ S(z, {
902
923
  className: "text-right tabular-nums text-text-secondary",
903
- children: m(e.lastPrice, e.currency)
924
+ children: h(e.lastPrice, e.currency)
904
925
  }),
905
- /* @__PURE__ */ S(R, {
926
+ /* @__PURE__ */ S(z, {
906
927
  className: "text-right font-semibold tabular-nums text-text-primary",
907
- children: m(e.marketValue, e.currency)
928
+ children: h(e.marketValue, e.currency)
908
929
  })
909
930
  ]
910
931
  }, e.id)) })] })
@@ -936,7 +957,7 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
936
957
  action: /* @__PURE__ */ C(T, {
937
958
  size: "sm",
938
959
  onClick: () => r(i.id),
939
- children: [/* @__PURE__ */ S(Se, {
960
+ children: [/* @__PURE__ */ S(we, {
940
961
  className: "size-4",
941
962
  "aria-hidden": "true"
942
963
  }), "Record transaction"]
@@ -967,12 +988,12 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
967
988
  }) : null]
968
989
  }), /* @__PURE__ */ S("p", {
969
990
  className: "mt-0.5 text-xs text-text-secondary",
970
- children: se(e.tradeDate)
991
+ children: m(e.tradeDate)
971
992
  })]
972
993
  })]
973
994
  }), /* @__PURE__ */ C("span", {
974
995
  className: `shrink-0 text-sm font-semibold tabular-nums ${r}`,
975
- children: [t ? "+" : "−", m(Math.abs(e.amount), e.currency)]
996
+ children: [t ? "+" : "−", h(Math.abs(e.amount), e.currency)]
976
997
  })]
977
998
  }, e.id);
978
999
  }), /* @__PURE__ */ S(ne, {
@@ -985,7 +1006,7 @@ function Je({ accountId: t, onClose: n, onRecordTransaction: r }) {
985
1006
  /* @__PURE__ */ S(H, {
986
1007
  value: "documents",
987
1008
  className: "mt-4",
988
- children: /* @__PURE__ */ S(h, {
1009
+ children: /* @__PURE__ */ S(pe, {
989
1010
  entityType: "brainyrich-account",
990
1011
  entityId: i.id
991
1012
  })