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