@burdenoff/microfe-brainyrich 2026.525.1 → 2026.705.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.js +53 -88
- package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
- package/dist/brainyrich/BrainyRichRoutes.js +15 -35
- package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js +543 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
- package/dist/brainyrich/index.js +0 -1
- package/dist/brainyrich/pages/AccountsPage.js +690 -160
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +537 -363
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +587 -268
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +350 -232
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +550 -337
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +775 -142
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js +410 -311
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +823 -154
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +388 -251
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +411 -196
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +622 -221
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.js +222 -41
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/index.js +2 -3
- package/package.json +1 -1
- package/dist/brainyrich/pages/AdvisorsPage.js +0 -375
- package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
- package/dist/brainyrich/pages/AssistantPage.js +0 -332
- package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
- package/dist/brainyrich/pages/EstatePage.js +0 -269
- package/dist/brainyrich/pages/EstatePage.js.map +0 -1
- package/dist/brainyrich/pages/InsurancePage.js +0 -181
- package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
- package/dist/brainyrich/pages/MarketplacePage.js +0 -450
- package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
- package/dist/brainyrich/store/brainyrichStore.js +0 -272
- package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
|
@@ -1,261 +1,398 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
+
import { useNetWorthSummary as t, usePortfolios as n, useTransactions as r } from "../hooks/useBrainyRichApi.js";
|
|
3
|
+
import { AllocationBars as i, EmptyState as a, ErrorState as o, KpiGrid as s, LoadingState as c, SectionShell as l, deltaToneClass as u, formatDate as d, formatMoney as f } from "./_shared.js";
|
|
4
|
+
import { useMemo as p, useState as m } from "react";
|
|
5
|
+
import { ChevronDown as h, Download as g, FileText as _, Layers as v, Printer as y, Receipt as b, Wallet as x } from "lucide-react";
|
|
6
|
+
import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
8
|
+
import { Badge as T, Button as E, Card as D, CardContent as O, CardDescription as k, CardHeader as A, CardTitle as j, DropdownMenu as M, DropdownMenuContent as N, DropdownMenuItem as P, DropdownMenuTrigger as F, Table as I, TableBody as L, TableCell as R, TableHead as z, TableHeader as B, TableRow as V, Tabs as H, TabsList as U, TabsTrigger as W } from "@burdenoff/fe-libs/ui";
|
|
6
9
|
//#region src/brainyrich/pages/ReportsPage.tsx
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
last: "2025-12-31"
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
category: "Risk Reports",
|
|
56
|
-
items: [{
|
|
57
|
-
name: "Risk Assessment",
|
|
58
|
-
desc: "Portfolio risk metrics",
|
|
59
|
-
frequency: "Monthly",
|
|
60
|
-
last: "2026-06-01"
|
|
61
|
-
}, {
|
|
62
|
-
name: "Stress Test Results",
|
|
63
|
-
desc: "Crisis scenario analysis",
|
|
64
|
-
frequency: "Quarterly",
|
|
65
|
-
last: "2026-04-01"
|
|
66
|
-
}]
|
|
67
|
-
}
|
|
68
|
-
], g = [
|
|
69
|
-
{
|
|
70
|
-
name: "Weekly Holdings Summary",
|
|
71
|
-
nextRun: "2026-06-15",
|
|
72
|
-
frequency: "Weekly",
|
|
73
|
-
recipients: "you@brainyrich.com"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: "Monthly Performance Report",
|
|
77
|
-
nextRun: "2026-07-01",
|
|
78
|
-
frequency: "Monthly",
|
|
79
|
-
recipients: "you@brainyrich.com"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: "Quarterly Tax Summary",
|
|
83
|
-
nextRun: "2026-10-01",
|
|
84
|
-
frequency: "Quarterly",
|
|
85
|
-
recipients: "you@brainyrich.com, advisor@firm.com"
|
|
86
|
-
}
|
|
87
|
-
];
|
|
88
|
-
function _() {
|
|
89
|
-
let { reports: _ } = e();
|
|
90
|
-
return /* @__PURE__ */ c(n, {
|
|
91
|
-
title: "Reports & Documents",
|
|
92
|
-
description: "Generate, schedule, and download your financial reports",
|
|
93
|
-
actionLabel: "Generate Custom Report",
|
|
94
|
-
badges: [`${_.length} Recent Reports`],
|
|
95
|
-
children: [/* @__PURE__ */ s(t, { items: [
|
|
96
|
-
{
|
|
97
|
-
label: "Total Reports",
|
|
98
|
-
value: "127",
|
|
99
|
-
trend: "Generated this year"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
label: "Scheduled Reports",
|
|
103
|
-
value: String(g.length),
|
|
104
|
-
trend: "Active schedules"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
label: "Ready to Download",
|
|
108
|
-
value: String(_.length)
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
label: "Report Formats",
|
|
112
|
-
value: "3",
|
|
113
|
-
trend: "PDF, Excel, CSV"
|
|
114
|
-
}
|
|
115
|
-
] }), /* @__PURE__ */ c("div", {
|
|
116
|
-
className: "grid gap-4 lg:grid-cols-3",
|
|
117
|
-
children: [/* @__PURE__ */ s("div", {
|
|
118
|
-
className: "lg:col-span-2 space-y-4",
|
|
119
|
-
children: h.map((e) => /* @__PURE__ */ c(d, { children: [/* @__PURE__ */ s(p, { children: /* @__PURE__ */ s(m, {
|
|
120
|
-
className: "text-base",
|
|
121
|
-
children: e.category
|
|
122
|
-
}) }), /* @__PURE__ */ s(f, {
|
|
123
|
-
className: "space-y-2",
|
|
124
|
-
children: e.items.map((e) => /* @__PURE__ */ c("div", {
|
|
125
|
-
className: "flex items-center justify-between rounded-lg border p-3",
|
|
126
|
-
children: [
|
|
127
|
-
/* @__PURE__ */ c("div", {
|
|
128
|
-
className: "flex-1",
|
|
129
|
-
children: [/* @__PURE__ */ s("p", {
|
|
130
|
-
className: "font-medium text-sm",
|
|
131
|
-
children: e.name
|
|
132
|
-
}), /* @__PURE__ */ s("p", {
|
|
133
|
-
className: "text-xs text-muted-foreground",
|
|
134
|
-
children: e.desc
|
|
135
|
-
})]
|
|
136
|
-
}),
|
|
137
|
-
/* @__PURE__ */ c("div", {
|
|
138
|
-
className: "text-center mx-4",
|
|
139
|
-
children: [/* @__PURE__ */ s(l, {
|
|
140
|
-
variant: "outline",
|
|
141
|
-
className: "text-[10px]",
|
|
142
|
-
children: e.frequency
|
|
143
|
-
}), /* @__PURE__ */ c("p", {
|
|
144
|
-
className: "text-[10px] text-muted-foreground mt-0.5",
|
|
145
|
-
children: ["Last: ", e.last]
|
|
146
|
-
})]
|
|
147
|
-
}),
|
|
148
|
-
/* @__PURE__ */ c("div", {
|
|
149
|
-
className: "flex gap-1",
|
|
150
|
-
children: [/* @__PURE__ */ s(u, {
|
|
151
|
-
variant: "outline",
|
|
152
|
-
size: "sm",
|
|
153
|
-
children: "Generate"
|
|
154
|
-
}), /* @__PURE__ */ s(u, {
|
|
155
|
-
variant: "outline",
|
|
156
|
-
size: "sm",
|
|
157
|
-
children: /* @__PURE__ */ s(r, { className: "h-3 w-3" })
|
|
158
|
-
})]
|
|
159
|
-
})
|
|
160
|
-
]
|
|
161
|
-
}, e.name))
|
|
162
|
-
})] }, e.category))
|
|
163
|
-
}), /* @__PURE__ */ c("div", {
|
|
164
|
-
className: "space-y-4",
|
|
10
|
+
function G(e, t) {
|
|
11
|
+
let n = (e) => {
|
|
12
|
+
let t = String(e ?? "");
|
|
13
|
+
return /[",\n]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
|
|
14
|
+
};
|
|
15
|
+
return [e, ...t].map((e) => e.map(n).join(",")).join("\n");
|
|
16
|
+
}
|
|
17
|
+
function K(e, t) {
|
|
18
|
+
let n = new Blob([t], { type: "text/csv;charset=utf-8;" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
19
|
+
i.href = r, i.download = e, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
20
|
+
}
|
|
21
|
+
function q() {
|
|
22
|
+
let { t: i } = S(), a = (t, n, r) => e(i, t, n, r), [o, c] = m("networth"), u = t(), _ = n(), T = r(), D = u.data, O = D?.currency ?? "USD", k = p(() => _.data.flatMap((e) => e.holdings ?? []).slice().sort((e, t) => t.marketValue - e.marketValue), [_.data]), A = p(() => T.data.slice().sort((e, t) => new Date(t.tradeDate).getTime() - new Date(e.tradeDate).getTime()), [T.data]), j = D ? [
|
|
23
|
+
{
|
|
24
|
+
label: a("brainyrich.reports.kpis.netWorth", "Net Worth"),
|
|
25
|
+
value: f(D.totalNetWorth, O)
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: a("brainyrich.reports.kpis.marketValue", "Invested Value"),
|
|
29
|
+
value: f(D.totalMarketValue, O)
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: a("brainyrich.reports.kpis.holdings", "Holdings on Schedule"),
|
|
33
|
+
value: String(k.length)
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: a("brainyrich.reports.kpis.transactions", "Ledger Entries"),
|
|
37
|
+
value: String(A.length)
|
|
38
|
+
}
|
|
39
|
+
] : [{
|
|
40
|
+
label: a("brainyrich.reports.kpis.holdings", "Holdings on Schedule"),
|
|
41
|
+
value: String(k.length)
|
|
42
|
+
}, {
|
|
43
|
+
label: a("brainyrich.reports.kpis.transactions", "Ledger Entries"),
|
|
44
|
+
value: String(A.length)
|
|
45
|
+
}];
|
|
46
|
+
return /* @__PURE__ */ w(l, {
|
|
47
|
+
title: a("brainyrich.reports.title", "Reports & Statements"),
|
|
48
|
+
description: a("brainyrich.reports.description", "Generate statements directly from your live portfolio data — no fabricated schedules."),
|
|
49
|
+
actions: /* @__PURE__ */ w(M, { children: [/* @__PURE__ */ C(F, {
|
|
50
|
+
asChild: !0,
|
|
51
|
+
children: /* @__PURE__ */ w(E, {
|
|
52
|
+
size: "sm",
|
|
165
53
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
className: "
|
|
168
|
-
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
className: "font-medium text-sm",
|
|
176
|
-
children: e.title
|
|
177
|
-
}),
|
|
178
|
-
/* @__PURE__ */ c("p", {
|
|
179
|
-
className: "text-xs text-muted-foreground",
|
|
180
|
-
children: [
|
|
181
|
-
e.period,
|
|
182
|
-
" · Generated ",
|
|
183
|
-
e.generatedAt
|
|
184
|
-
]
|
|
185
|
-
}),
|
|
186
|
-
/* @__PURE__ */ c(u, {
|
|
187
|
-
variant: "outline",
|
|
188
|
-
size: "sm",
|
|
189
|
-
className: "mt-2 w-full",
|
|
190
|
-
children: [/* @__PURE__ */ s(a, { className: "mr-1 h-3 w-3" }), "Download"]
|
|
191
|
-
})
|
|
192
|
-
]
|
|
193
|
-
}, e.id))
|
|
194
|
-
})] }),
|
|
195
|
-
/* @__PURE__ */ c(d, { children: [/* @__PURE__ */ s(p, { children: /* @__PURE__ */ c(m, {
|
|
196
|
-
className: "flex items-center gap-2 text-base",
|
|
197
|
-
children: [/* @__PURE__ */ s(i, { className: "h-4 w-4" }), "Scheduled Reports"]
|
|
198
|
-
}) }), /* @__PURE__ */ s(f, {
|
|
199
|
-
className: "space-y-3",
|
|
200
|
-
children: g.map((e) => /* @__PURE__ */ c("div", {
|
|
201
|
-
className: "rounded-lg border p-3",
|
|
202
|
-
children: [
|
|
203
|
-
/* @__PURE__ */ s("p", {
|
|
204
|
-
className: "font-medium text-sm",
|
|
205
|
-
children: e.name
|
|
206
|
-
}),
|
|
207
|
-
/* @__PURE__ */ c("p", {
|
|
208
|
-
className: "text-xs text-muted-foreground",
|
|
209
|
-
children: [
|
|
210
|
-
"Next: ",
|
|
211
|
-
e.nextRun,
|
|
212
|
-
" · ",
|
|
213
|
-
e.frequency
|
|
214
|
-
]
|
|
215
|
-
}),
|
|
216
|
-
/* @__PURE__ */ s("p", {
|
|
217
|
-
className: "text-xs text-muted-foreground",
|
|
218
|
-
children: e.recipients
|
|
219
|
-
})
|
|
220
|
-
]
|
|
221
|
-
}, e.name))
|
|
222
|
-
})] }),
|
|
223
|
-
/* @__PURE__ */ c(d, { children: [/* @__PURE__ */ s(p, { children: /* @__PURE__ */ s(m, {
|
|
224
|
-
className: "text-base",
|
|
225
|
-
children: "Export Formats"
|
|
226
|
-
}) }), /* @__PURE__ */ s(f, {
|
|
227
|
-
className: "space-y-2",
|
|
228
|
-
children: [
|
|
229
|
-
{
|
|
230
|
-
format: "PDF",
|
|
231
|
-
status: "Available"
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
format: "Excel (.xlsx)",
|
|
235
|
-
status: "Available"
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
format: "CSV",
|
|
239
|
-
status: "Available"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
format: "Interactive Dashboard",
|
|
243
|
-
status: "Coming Soon"
|
|
244
|
-
}
|
|
245
|
-
].map((e) => /* @__PURE__ */ c("div", {
|
|
246
|
-
className: "flex justify-between text-sm",
|
|
247
|
-
children: [/* @__PURE__ */ s("span", { children: e.format }), /* @__PURE__ */ s("span", {
|
|
248
|
-
className: e.status === "Available" ? "text-emerald-600" : "text-yellow-600",
|
|
249
|
-
children: e.status === "Available" ? "Available" : "Coming Soon"
|
|
250
|
-
})]
|
|
251
|
-
}, e.format))
|
|
252
|
-
})] })
|
|
54
|
+
/* @__PURE__ */ C(g, {
|
|
55
|
+
className: "size-4",
|
|
56
|
+
"aria-hidden": "true"
|
|
57
|
+
}),
|
|
58
|
+
a("brainyrich.reports.actions.export", "Print / Export"),
|
|
59
|
+
/* @__PURE__ */ C(h, {
|
|
60
|
+
className: "size-4",
|
|
61
|
+
"aria-hidden": "true"
|
|
62
|
+
})
|
|
253
63
|
]
|
|
64
|
+
})
|
|
65
|
+
}), /* @__PURE__ */ w(N, {
|
|
66
|
+
align: "end",
|
|
67
|
+
children: [/* @__PURE__ */ w(P, {
|
|
68
|
+
onSelect: () => {
|
|
69
|
+
if (o === "networth") {
|
|
70
|
+
if (!D) return;
|
|
71
|
+
K("brainyrich-net-worth-statement.csv", G([
|
|
72
|
+
"Metric",
|
|
73
|
+
"Amount",
|
|
74
|
+
"Currency"
|
|
75
|
+
], [
|
|
76
|
+
[
|
|
77
|
+
"Total Net Worth",
|
|
78
|
+
D.totalNetWorth,
|
|
79
|
+
O
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"Total Market Value",
|
|
83
|
+
D.totalMarketValue,
|
|
84
|
+
O
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
"Total Cash",
|
|
88
|
+
D.totalCash,
|
|
89
|
+
O
|
|
90
|
+
],
|
|
91
|
+
[
|
|
92
|
+
"Account Count",
|
|
93
|
+
D.accountCount,
|
|
94
|
+
""
|
|
95
|
+
],
|
|
96
|
+
...D.byAssetClass.map((e) => [
|
|
97
|
+
`Asset Class: ${e.assetClass.replace(/_/g, " ")}`,
|
|
98
|
+
e.marketValue,
|
|
99
|
+
O
|
|
100
|
+
])
|
|
101
|
+
]));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (o === "holdings") {
|
|
105
|
+
K("brainyrich-holdings-schedule.csv", G([
|
|
106
|
+
"Symbol",
|
|
107
|
+
"Name",
|
|
108
|
+
"Asset Class",
|
|
109
|
+
"Quantity",
|
|
110
|
+
"Cost Basis",
|
|
111
|
+
"Market Value",
|
|
112
|
+
"Currency"
|
|
113
|
+
], k.map((e) => [
|
|
114
|
+
e.symbol,
|
|
115
|
+
e.name ?? "",
|
|
116
|
+
e.assetClass.replace(/_/g, " "),
|
|
117
|
+
e.quantity,
|
|
118
|
+
e.costBasis,
|
|
119
|
+
e.marketValue,
|
|
120
|
+
e.currency
|
|
121
|
+
])));
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
K("brainyrich-transaction-ledger.csv", G([
|
|
125
|
+
"Trade Date",
|
|
126
|
+
"Type",
|
|
127
|
+
"Symbol",
|
|
128
|
+
"Quantity",
|
|
129
|
+
"Price",
|
|
130
|
+
"Amount",
|
|
131
|
+
"Fee",
|
|
132
|
+
"Currency"
|
|
133
|
+
], A.map((e) => [
|
|
134
|
+
d(e.tradeDate),
|
|
135
|
+
e.type,
|
|
136
|
+
e.symbol ?? "",
|
|
137
|
+
e.quantity,
|
|
138
|
+
e.price,
|
|
139
|
+
e.amount,
|
|
140
|
+
e.fee,
|
|
141
|
+
e.currency
|
|
142
|
+
])));
|
|
143
|
+
},
|
|
144
|
+
children: [/* @__PURE__ */ C(g, {
|
|
145
|
+
className: "size-4",
|
|
146
|
+
"aria-hidden": "true"
|
|
147
|
+
}), a("brainyrich.reports.actions.downloadCsv", "Download CSV")]
|
|
148
|
+
}), /* @__PURE__ */ w(P, {
|
|
149
|
+
onSelect: () => window.print(),
|
|
150
|
+
children: [/* @__PURE__ */ C(y, {
|
|
151
|
+
className: "size-4",
|
|
152
|
+
"aria-hidden": "true"
|
|
153
|
+
}), a("brainyrich.reports.actions.print", "Print statement")]
|
|
154
|
+
})]
|
|
155
|
+
})] }),
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ C(s, { items: j }),
|
|
158
|
+
/* @__PURE__ */ C(H, {
|
|
159
|
+
value: o,
|
|
160
|
+
onValueChange: (e) => c(e),
|
|
161
|
+
children: /* @__PURE__ */ w(U, { children: [
|
|
162
|
+
/* @__PURE__ */ w(W, {
|
|
163
|
+
value: "networth",
|
|
164
|
+
children: [/* @__PURE__ */ C(x, {
|
|
165
|
+
className: "size-4",
|
|
166
|
+
"aria-hidden": "true"
|
|
167
|
+
}), a("brainyrich.reports.tabs.netWorth", "Net Worth")]
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ w(W, {
|
|
170
|
+
value: "holdings",
|
|
171
|
+
children: [/* @__PURE__ */ C(v, {
|
|
172
|
+
className: "size-4",
|
|
173
|
+
"aria-hidden": "true"
|
|
174
|
+
}), a("brainyrich.reports.tabs.holdings", "Holdings")]
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ w(W, {
|
|
177
|
+
value: "transactions",
|
|
178
|
+
children: [/* @__PURE__ */ C(b, {
|
|
179
|
+
className: "size-4",
|
|
180
|
+
"aria-hidden": "true"
|
|
181
|
+
}), a("brainyrich.reports.tabs.ledger", "Ledger")]
|
|
182
|
+
})
|
|
183
|
+
] })
|
|
184
|
+
}),
|
|
185
|
+
o === "networth" ? /* @__PURE__ */ C(J, {
|
|
186
|
+
query: u,
|
|
187
|
+
translate: a
|
|
188
|
+
}) : o === "holdings" ? /* @__PURE__ */ C(X, {
|
|
189
|
+
query: _,
|
|
190
|
+
holdings: k,
|
|
191
|
+
translate: a
|
|
192
|
+
}) : /* @__PURE__ */ C(Z, {
|
|
193
|
+
query: T,
|
|
194
|
+
transactions: A,
|
|
195
|
+
translate: a
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function J({ query: e, translate: t }) {
|
|
201
|
+
let n = e.data, r = n?.currency ?? "USD", s = p(() => {
|
|
202
|
+
if (!n) return [];
|
|
203
|
+
let e = n.byAssetClass.reduce((e, t) => e + t.marketValue, 0);
|
|
204
|
+
return e <= 0 ? [] : n.byAssetClass.slice().sort((e, t) => t.marketValue - e.marketValue).map((t) => ({
|
|
205
|
+
label: t.assetClass.replace(/_/g, " "),
|
|
206
|
+
value: t.marketValue / e * 100,
|
|
207
|
+
caption: f(t.marketValue, r)
|
|
208
|
+
}));
|
|
209
|
+
}, [n, r]);
|
|
210
|
+
return /* @__PURE__ */ w(D, { children: [/* @__PURE__ */ w(A, { children: [/* @__PURE__ */ w(j, {
|
|
211
|
+
className: "flex items-center gap-2",
|
|
212
|
+
children: [/* @__PURE__ */ C(x, {
|
|
213
|
+
className: "size-5",
|
|
214
|
+
"aria-hidden": "true"
|
|
215
|
+
}), t("brainyrich.reports.netWorth.title", "Net Worth Statement")]
|
|
216
|
+
}), /* @__PURE__ */ C(k, { children: t("brainyrich.reports.netWorth.description", "Consolidated assets, cash, and asset-class allocation as of today.") })] }), /* @__PURE__ */ C(O, { children: e.isLoading ? /* @__PURE__ */ C(c, { rows: 3 }) : e.isError ? /* @__PURE__ */ C(o, { onRetry: () => e.refetch() }) : n ? /* @__PURE__ */ w("div", {
|
|
217
|
+
className: "space-y-6",
|
|
218
|
+
children: [/* @__PURE__ */ w("div", {
|
|
219
|
+
className: "grid gap-4 sm:grid-cols-3",
|
|
220
|
+
children: [
|
|
221
|
+
/* @__PURE__ */ C(Y, {
|
|
222
|
+
label: t("brainyrich.reports.netWorth.total", "Total Net Worth"),
|
|
223
|
+
value: f(n.totalNetWorth, r),
|
|
224
|
+
emphasis: !0
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ C(Y, {
|
|
227
|
+
label: t("brainyrich.reports.netWorth.invested", "Invested Value"),
|
|
228
|
+
value: f(n.totalMarketValue, r)
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ C(Y, {
|
|
231
|
+
label: t("brainyrich.reports.netWorth.cash", "Cash & Liquidity"),
|
|
232
|
+
value: f(n.totalCash, r)
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
}), /* @__PURE__ */ w("div", {
|
|
236
|
+
className: "space-y-3",
|
|
237
|
+
children: [/* @__PURE__ */ C("p", {
|
|
238
|
+
className: "text-sm font-medium text-text-primary",
|
|
239
|
+
children: t("brainyrich.reports.netWorth.allocation", "Allocation by Asset Class")
|
|
240
|
+
}), s.length > 0 ? /* @__PURE__ */ C(i, { data: s }) : /* @__PURE__ */ C("p", {
|
|
241
|
+
className: "text-sm text-text-secondary",
|
|
242
|
+
children: t("brainyrich.reports.netWorth.noAllocation", "No holdings to allocate yet.")
|
|
254
243
|
})]
|
|
255
244
|
})]
|
|
245
|
+
}) : /* @__PURE__ */ C(a, {
|
|
246
|
+
icon: /* @__PURE__ */ C(x, {
|
|
247
|
+
className: "size-6",
|
|
248
|
+
"aria-hidden": "true"
|
|
249
|
+
}),
|
|
250
|
+
title: t("brainyrich.reports.netWorth.emptyTitle", "No net-worth data yet"),
|
|
251
|
+
description: t("brainyrich.reports.netWorth.emptyDesc", "Link an account and add holdings to generate a net-worth statement.")
|
|
252
|
+
}) })] });
|
|
253
|
+
}
|
|
254
|
+
function Y({ label: e, value: t, emphasis: n }) {
|
|
255
|
+
return /* @__PURE__ */ w("div", {
|
|
256
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
257
|
+
children: [/* @__PURE__ */ C("p", {
|
|
258
|
+
className: "text-xs text-text-secondary",
|
|
259
|
+
children: e
|
|
260
|
+
}), /* @__PURE__ */ C("p", {
|
|
261
|
+
className: n ? "mt-1 text-2xl font-semibold text-text-primary" : "mt-1 text-xl font-semibold text-text-primary",
|
|
262
|
+
children: t
|
|
263
|
+
})]
|
|
256
264
|
});
|
|
257
265
|
}
|
|
266
|
+
function X({ query: e, holdings: t, translate: n }) {
|
|
267
|
+
return /* @__PURE__ */ w(D, { children: [/* @__PURE__ */ w(A, { children: [/* @__PURE__ */ w(j, {
|
|
268
|
+
className: "flex items-center gap-2",
|
|
269
|
+
children: [/* @__PURE__ */ C(v, {
|
|
270
|
+
className: "size-5",
|
|
271
|
+
"aria-hidden": "true"
|
|
272
|
+
}), n("brainyrich.reports.holdings.title", "Holdings Schedule")]
|
|
273
|
+
}), /* @__PURE__ */ C(k, { children: n("brainyrich.reports.holdings.description", "Every position across your portfolios with cost basis and market value.") })] }), /* @__PURE__ */ C(O, { children: e.isLoading ? /* @__PURE__ */ C(c, { rows: 4 }) : e.isError ? /* @__PURE__ */ C(o, { onRetry: () => e.refetch() }) : t.length > 0 ? /* @__PURE__ */ C("div", {
|
|
274
|
+
className: "overflow-x-auto",
|
|
275
|
+
children: /* @__PURE__ */ w(I, { children: [/* @__PURE__ */ C(B, { children: /* @__PURE__ */ w(V, { children: [
|
|
276
|
+
/* @__PURE__ */ C(z, { children: n("brainyrich.reports.holdings.symbol", "Symbol") }),
|
|
277
|
+
/* @__PURE__ */ C(z, { children: n("brainyrich.reports.holdings.assetClass", "Asset Class") }),
|
|
278
|
+
/* @__PURE__ */ C(z, {
|
|
279
|
+
className: "text-right",
|
|
280
|
+
children: n("brainyrich.reports.holdings.quantity", "Quantity")
|
|
281
|
+
}),
|
|
282
|
+
/* @__PURE__ */ C(z, {
|
|
283
|
+
className: "text-right",
|
|
284
|
+
children: n("brainyrich.reports.holdings.costBasis", "Cost Basis")
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ C(z, {
|
|
287
|
+
className: "text-right",
|
|
288
|
+
children: n("brainyrich.reports.holdings.marketValue", "Market Value")
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ C(z, {
|
|
291
|
+
className: "text-right",
|
|
292
|
+
children: n("brainyrich.reports.holdings.gainLoss", "Unrealized")
|
|
293
|
+
})
|
|
294
|
+
] }) }), /* @__PURE__ */ C(L, { children: t.map((e) => {
|
|
295
|
+
let t = e.marketValue - e.costBasis;
|
|
296
|
+
return /* @__PURE__ */ w(V, { children: [
|
|
297
|
+
/* @__PURE__ */ w(R, { children: [/* @__PURE__ */ C("div", {
|
|
298
|
+
className: "font-medium text-text-primary",
|
|
299
|
+
children: e.symbol
|
|
300
|
+
}), e.name ? /* @__PURE__ */ C("div", {
|
|
301
|
+
className: "text-xs text-text-secondary",
|
|
302
|
+
children: e.name
|
|
303
|
+
}) : null] }),
|
|
304
|
+
/* @__PURE__ */ C(R, { children: /* @__PURE__ */ C(T, {
|
|
305
|
+
variant: "outline",
|
|
306
|
+
children: e.assetClass.replace(/_/g, " ")
|
|
307
|
+
}) }),
|
|
308
|
+
/* @__PURE__ */ C(R, {
|
|
309
|
+
className: "text-right tabular-nums text-text-primary",
|
|
310
|
+
children: e.quantity
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ C(R, {
|
|
313
|
+
className: "text-right tabular-nums text-text-primary",
|
|
314
|
+
children: f(e.costBasis, e.currency)
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ C(R, {
|
|
317
|
+
className: "text-right tabular-nums text-text-primary",
|
|
318
|
+
children: f(e.marketValue, e.currency)
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ w(R, {
|
|
321
|
+
className: `text-right tabular-nums font-medium ${u(t)}`,
|
|
322
|
+
children: [t > 0 ? "+" : "", f(t, e.currency)]
|
|
323
|
+
})
|
|
324
|
+
] }, e.id);
|
|
325
|
+
}) })] })
|
|
326
|
+
}) : /* @__PURE__ */ C(a, {
|
|
327
|
+
icon: /* @__PURE__ */ C(v, {
|
|
328
|
+
className: "size-6",
|
|
329
|
+
"aria-hidden": "true"
|
|
330
|
+
}),
|
|
331
|
+
title: n("brainyrich.reports.holdings.emptyTitle", "No holdings on file"),
|
|
332
|
+
description: n("brainyrich.reports.holdings.emptyDesc", "Add holdings to your portfolios to generate a holdings schedule.")
|
|
333
|
+
}) })] });
|
|
334
|
+
}
|
|
335
|
+
function Z({ query: e, transactions: t, translate: n }) {
|
|
336
|
+
return /* @__PURE__ */ w(D, { children: [/* @__PURE__ */ w(A, { children: [/* @__PURE__ */ w(j, {
|
|
337
|
+
className: "flex items-center gap-2",
|
|
338
|
+
children: [/* @__PURE__ */ C(b, {
|
|
339
|
+
className: "size-5",
|
|
340
|
+
"aria-hidden": "true"
|
|
341
|
+
}), n("brainyrich.reports.ledger.title", "Transaction Ledger")]
|
|
342
|
+
}), /* @__PURE__ */ C(k, { children: n("brainyrich.reports.ledger.description", "Every recorded transaction across your accounts, newest first.") })] }), /* @__PURE__ */ C(O, { children: e.isLoading ? /* @__PURE__ */ C(c, { rows: 4 }) : e.isError ? /* @__PURE__ */ C(o, { onRetry: () => e.refetch() }) : t.length > 0 ? /* @__PURE__ */ C("div", {
|
|
343
|
+
className: "overflow-x-auto",
|
|
344
|
+
children: /* @__PURE__ */ w(I, { children: [/* @__PURE__ */ C(B, { children: /* @__PURE__ */ w(V, { children: [
|
|
345
|
+
/* @__PURE__ */ C(z, { children: n("brainyrich.reports.ledger.date", "Trade Date") }),
|
|
346
|
+
/* @__PURE__ */ C(z, { children: n("brainyrich.reports.ledger.type", "Type") }),
|
|
347
|
+
/* @__PURE__ */ C(z, { children: n("brainyrich.reports.ledger.symbol", "Symbol") }),
|
|
348
|
+
/* @__PURE__ */ C(z, {
|
|
349
|
+
className: "text-right",
|
|
350
|
+
children: n("brainyrich.reports.ledger.quantity", "Quantity")
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ C(z, {
|
|
353
|
+
className: "text-right",
|
|
354
|
+
children: n("brainyrich.reports.ledger.price", "Price")
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ C(z, {
|
|
357
|
+
className: "text-right",
|
|
358
|
+
children: n("brainyrich.reports.ledger.amount", "Amount")
|
|
359
|
+
})
|
|
360
|
+
] }) }), /* @__PURE__ */ C(L, { children: t.map((e) => /* @__PURE__ */ w(V, { children: [
|
|
361
|
+
/* @__PURE__ */ C(R, {
|
|
362
|
+
className: "text-text-primary",
|
|
363
|
+
children: d(e.tradeDate)
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ C(R, { children: /* @__PURE__ */ C(T, {
|
|
366
|
+
variant: "outline",
|
|
367
|
+
children: e.type
|
|
368
|
+
}) }),
|
|
369
|
+
/* @__PURE__ */ C(R, {
|
|
370
|
+
className: "text-text-primary",
|
|
371
|
+
children: e.symbol ?? "—"
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ C(R, {
|
|
374
|
+
className: "text-right tabular-nums text-text-primary",
|
|
375
|
+
children: e.quantity
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ C(R, {
|
|
378
|
+
className: "text-right tabular-nums text-text-primary",
|
|
379
|
+
children: f(e.price, e.currency)
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ C(R, {
|
|
382
|
+
className: "text-right tabular-nums text-text-primary",
|
|
383
|
+
children: f(e.amount, e.currency)
|
|
384
|
+
})
|
|
385
|
+
] }, e.id)) })] })
|
|
386
|
+
}) : /* @__PURE__ */ C(a, {
|
|
387
|
+
icon: /* @__PURE__ */ C(_, {
|
|
388
|
+
className: "size-6",
|
|
389
|
+
"aria-hidden": "true"
|
|
390
|
+
}),
|
|
391
|
+
title: n("brainyrich.reports.ledger.emptyTitle", "No transactions recorded"),
|
|
392
|
+
description: n("brainyrich.reports.ledger.emptyDesc", "Record transactions on your accounts to build a ledger statement.")
|
|
393
|
+
}) })] });
|
|
394
|
+
}
|
|
258
395
|
//#endregion
|
|
259
|
-
export {
|
|
396
|
+
export { q as ReportsPage };
|
|
260
397
|
|
|
261
398
|
//# sourceMappingURL=ReportsPage.js.map
|