@burdenoff/microfe-brainyrich 2026.525.1 → 2026.706.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 +55 -90
- 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/components/ActorName.js +38 -0
- package/dist/brainyrich/components/ActorName.js.map +1 -0
- package/dist/brainyrich/components/ConfirmDialog.js +25 -0
- package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
- package/dist/brainyrich/components/LoadMore.js +24 -0
- package/dist/brainyrich/components/LoadMore.js.map +1 -0
- package/dist/brainyrich/components/index.js +5 -0
- package/dist/brainyrich/components/notify.js +38 -0
- package/dist/brainyrich/components/notify.js.map +1 -0
- package/dist/brainyrich/components/pickers.js +232 -0
- package/dist/brainyrich/components/pickers.js.map +1 -0
- package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
- package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
- package/dist/brainyrich/components/reuse/TagField.js +206 -0
- package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
- package/dist/brainyrich/components/reuse/transport.js +24 -0
- package/dist/brainyrich/components/reuse/transport.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js +815 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
- package/dist/brainyrich/index.js +0 -1
- package/dist/brainyrich/pages/AccountsPage.js +743 -160
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +556 -363
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +601 -268
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +375 -231
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +599 -337
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +810 -141
- 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 +867 -156
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +421 -251
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +557 -194
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +655 -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/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +3 -2
- 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,431 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useBrainyRich as e } from "../providers/BrainyRichProvider.js";
|
|
2
|
+
import { tWithFallback as t } from "../utils/i18n.js";
|
|
3
|
+
import { fetchAllAccounts as n, useAllTransactions as r, useNetWorthSummary as i } from "../hooks/useBrainyRichApi.js";
|
|
4
|
+
import { AllocationBars as a, EmptyState as o, ErrorState as s, KpiGrid as c, LoadingState as l, SectionShell as u, deltaToneClass as d, formatDate as f, formatMoney as p } from "./_shared.js";
|
|
5
|
+
import { useMemo as m, useState as h } from "react";
|
|
6
|
+
import { ChevronDown as g, Download as _, FileText as v, Layers as y, Printer as b, Receipt as x, Wallet as S } from "lucide-react";
|
|
7
|
+
import { useI18n as C } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { useQuery as w } from "@tanstack/react-query";
|
|
9
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
10
|
+
import { Badge as D, Button as ee, Card as O, CardContent as k, CardDescription as A, CardHeader as j, CardTitle as M, DropdownMenu as N, DropdownMenuContent as P, DropdownMenuItem as F, DropdownMenuTrigger as I, Table as L, TableBody as R, TableCell as z, TableHead as B, TableHeader as V, TableRow as H, Tabs as U, TabsList as W, TabsTrigger as G } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { graphqlFetch as K } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
12
|
//#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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
]
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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",
|
|
13
|
+
function q(e, t) {
|
|
14
|
+
let n = (e) => {
|
|
15
|
+
let t = String(e ?? "");
|
|
16
|
+
return /[",\n]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
|
|
17
|
+
};
|
|
18
|
+
return [e, ...t].map((e) => e.map(n).join(",")).join("\n");
|
|
19
|
+
}
|
|
20
|
+
function J(e, t) {
|
|
21
|
+
let n = new Blob([t], { type: "text/csv;charset=utf-8;" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
22
|
+
i.href = r, i.download = e, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
23
|
+
}
|
|
24
|
+
var Y = "query BraReportHoldings($accountId: ID) {\n braListHoldings(accountId: $accountId) {\n id workspaceId accountId portfolioId symbol name assetClass quantity lastPrice\n costBasis marketValue currency asOf createdAt updatedAt\n }\n}";
|
|
25
|
+
function X() {
|
|
26
|
+
let { apiGatewayUrl: t } = e(), r = w({
|
|
27
|
+
queryKey: [
|
|
28
|
+
"brainyrich",
|
|
29
|
+
"holdings",
|
|
30
|
+
"report-all"
|
|
31
|
+
],
|
|
32
|
+
queryFn: async () => {
|
|
33
|
+
let e = await n(t);
|
|
34
|
+
return (await Promise.all(e.map(async (e) => {
|
|
35
|
+
let n = await K({
|
|
36
|
+
gateway: "workspace",
|
|
37
|
+
baseUrl: t,
|
|
38
|
+
query: Y,
|
|
39
|
+
variables: { accountId: e.id },
|
|
40
|
+
workspaceToken: !0
|
|
41
|
+
});
|
|
42
|
+
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Failed to load holdings");
|
|
43
|
+
return n.data?.braListHoldings ?? [];
|
|
44
|
+
}))).flat();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
...r,
|
|
49
|
+
data: r.data ?? []
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function Z() {
|
|
53
|
+
let { t: e } = C(), n = (n, r, i) => t(e, n, r, i), [a, o] = h("networth"), s = i(), l = X(), d = r(), v = s.data, w = v?.currency ?? "USD", D = m(() => l.data.slice().sort((e, t) => t.marketValue - e.marketValue), [l.data]), O = m(() => d.data.slice().sort((e, t) => new Date(t.tradeDate).getTime() - new Date(e.tradeDate).getTime()), [d.data]), k = v ? [
|
|
54
|
+
{
|
|
55
|
+
label: n("brainyrich.reports.kpis.netWorth", "Net Worth"),
|
|
56
|
+
value: p(v.totalNetWorth, w)
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: n("brainyrich.reports.kpis.marketValue", "Invested Value"),
|
|
60
|
+
value: p(v.totalMarketValue, w)
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: n("brainyrich.reports.kpis.holdings", "Holdings on Schedule"),
|
|
64
|
+
value: String(D.length)
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: n("brainyrich.reports.kpis.transactions", "Ledger Entries"),
|
|
68
|
+
value: String(O.length)
|
|
69
|
+
}
|
|
70
|
+
] : [{
|
|
71
|
+
label: n("brainyrich.reports.kpis.holdings", "Holdings on Schedule"),
|
|
72
|
+
value: String(D.length)
|
|
73
|
+
}, {
|
|
74
|
+
label: n("brainyrich.reports.kpis.transactions", "Ledger Entries"),
|
|
75
|
+
value: String(O.length)
|
|
76
|
+
}], A = () => {
|
|
77
|
+
if (a === "networth") {
|
|
78
|
+
if (!v) return;
|
|
79
|
+
J("brainyrich-net-worth-statement.csv", q([
|
|
80
|
+
"Metric",
|
|
81
|
+
"Amount",
|
|
82
|
+
"Currency"
|
|
83
|
+
], [
|
|
84
|
+
[
|
|
85
|
+
"Total Net Worth",
|
|
86
|
+
v.totalNetWorth,
|
|
87
|
+
w
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"Total Market Value",
|
|
91
|
+
v.totalMarketValue,
|
|
92
|
+
w
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"Total Cash",
|
|
96
|
+
v.totalCash,
|
|
97
|
+
w
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"Account Count",
|
|
101
|
+
v.accountCount,
|
|
102
|
+
""
|
|
103
|
+
],
|
|
104
|
+
...v.byAssetClass.map((e) => [
|
|
105
|
+
`Asset Class: ${e.assetClass.replace(/_/g, " ")}`,
|
|
106
|
+
e.marketValue,
|
|
107
|
+
w
|
|
108
|
+
])
|
|
109
|
+
]));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (a === "holdings") {
|
|
113
|
+
J("brainyrich-holdings-schedule.csv", q([
|
|
114
|
+
"Symbol",
|
|
115
|
+
"Name",
|
|
116
|
+
"Asset Class",
|
|
117
|
+
"Quantity",
|
|
118
|
+
"Cost Basis",
|
|
119
|
+
"Market Value",
|
|
120
|
+
"Currency"
|
|
121
|
+
], D.map((e) => [
|
|
122
|
+
e.symbol,
|
|
123
|
+
e.name ?? "",
|
|
124
|
+
e.assetClass.replace(/_/g, " "),
|
|
125
|
+
e.quantity,
|
|
126
|
+
e.costBasis,
|
|
127
|
+
e.marketValue,
|
|
128
|
+
e.currency
|
|
129
|
+
])));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
J("brainyrich-transaction-ledger.csv", q([
|
|
133
|
+
"Trade Date",
|
|
134
|
+
"Type",
|
|
135
|
+
"Symbol",
|
|
136
|
+
"Quantity",
|
|
137
|
+
"Price",
|
|
138
|
+
"Amount",
|
|
139
|
+
"Fee",
|
|
140
|
+
"Currency"
|
|
141
|
+
], O.map((e) => [
|
|
142
|
+
f(e.tradeDate),
|
|
143
|
+
e.type,
|
|
144
|
+
e.symbol ?? "",
|
|
145
|
+
e.quantity,
|
|
146
|
+
e.price,
|
|
147
|
+
e.amount,
|
|
148
|
+
e.fee,
|
|
149
|
+
e.currency
|
|
150
|
+
])));
|
|
151
|
+
}, j = a === "networth" && (s.isLoading || !v) || a === "holdings" && (l.isLoading || D.length === 0) || a === "transactions" && (d.isLoading || O.length === 0);
|
|
152
|
+
return /* @__PURE__ */ E(u, {
|
|
153
|
+
title: n("brainyrich.reports.title", "Reports & Statements"),
|
|
154
|
+
description: n("brainyrich.reports.description", "Generate statements directly from your live portfolio data — no fabricated schedules."),
|
|
155
|
+
actions: /* @__PURE__ */ E(N, { children: [/* @__PURE__ */ T(I, {
|
|
156
|
+
asChild: !0,
|
|
157
|
+
children: /* @__PURE__ */ E(ee, {
|
|
158
|
+
size: "sm",
|
|
159
|
+
disabled: j,
|
|
160
|
+
"aria-label": n("brainyrich.reports.actions.export", "Print / Export"),
|
|
165
161
|
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
|
-
})] })
|
|
162
|
+
/* @__PURE__ */ T(_, {
|
|
163
|
+
className: "size-4",
|
|
164
|
+
"aria-hidden": "true"
|
|
165
|
+
}),
|
|
166
|
+
n("brainyrich.reports.actions.export", "Print / Export"),
|
|
167
|
+
/* @__PURE__ */ T(g, {
|
|
168
|
+
className: "size-4",
|
|
169
|
+
"aria-hidden": "true"
|
|
170
|
+
})
|
|
253
171
|
]
|
|
172
|
+
})
|
|
173
|
+
}), /* @__PURE__ */ E(P, {
|
|
174
|
+
align: "end",
|
|
175
|
+
children: [/* @__PURE__ */ E(F, {
|
|
176
|
+
onSelect: A,
|
|
177
|
+
children: [/* @__PURE__ */ T(_, {
|
|
178
|
+
className: "size-4",
|
|
179
|
+
"aria-hidden": "true"
|
|
180
|
+
}), n("brainyrich.reports.actions.downloadCsv", "Download CSV")]
|
|
181
|
+
}), /* @__PURE__ */ E(F, {
|
|
182
|
+
onSelect: () => window.print(),
|
|
183
|
+
children: [/* @__PURE__ */ T(b, {
|
|
184
|
+
className: "size-4",
|
|
185
|
+
"aria-hidden": "true"
|
|
186
|
+
}), n("brainyrich.reports.actions.print", "Print statement")]
|
|
187
|
+
})]
|
|
188
|
+
})] }),
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ T(c, { items: k }),
|
|
191
|
+
/* @__PURE__ */ T(U, {
|
|
192
|
+
value: a,
|
|
193
|
+
onValueChange: (e) => o(e),
|
|
194
|
+
children: /* @__PURE__ */ E(W, { children: [
|
|
195
|
+
/* @__PURE__ */ E(G, {
|
|
196
|
+
value: "networth",
|
|
197
|
+
children: [/* @__PURE__ */ T(S, {
|
|
198
|
+
className: "size-4",
|
|
199
|
+
"aria-hidden": "true"
|
|
200
|
+
}), n("brainyrich.reports.tabs.netWorth", "Net Worth")]
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ E(G, {
|
|
203
|
+
value: "holdings",
|
|
204
|
+
children: [/* @__PURE__ */ T(y, {
|
|
205
|
+
className: "size-4",
|
|
206
|
+
"aria-hidden": "true"
|
|
207
|
+
}), n("brainyrich.reports.tabs.holdings", "Holdings")]
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ E(G, {
|
|
210
|
+
value: "transactions",
|
|
211
|
+
children: [/* @__PURE__ */ T(x, {
|
|
212
|
+
className: "size-4",
|
|
213
|
+
"aria-hidden": "true"
|
|
214
|
+
}), n("brainyrich.reports.tabs.ledger", "Ledger")]
|
|
215
|
+
})
|
|
216
|
+
] })
|
|
217
|
+
}),
|
|
218
|
+
a === "networth" ? /* @__PURE__ */ T(Q, {
|
|
219
|
+
query: s,
|
|
220
|
+
translate: n
|
|
221
|
+
}) : a === "holdings" ? /* @__PURE__ */ T(te, {
|
|
222
|
+
query: l,
|
|
223
|
+
holdings: D,
|
|
224
|
+
translate: n
|
|
225
|
+
}) : /* @__PURE__ */ T(ne, {
|
|
226
|
+
query: d,
|
|
227
|
+
transactions: O,
|
|
228
|
+
translate: n
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function Q({ query: e, translate: t }) {
|
|
234
|
+
let n = e.data, r = n?.currency ?? "USD", i = m(() => {
|
|
235
|
+
if (!n) return [];
|
|
236
|
+
let e = n.byAssetClass.reduce((e, t) => e + t.marketValue, 0);
|
|
237
|
+
return e <= 0 ? [] : n.byAssetClass.slice().sort((e, t) => t.marketValue - e.marketValue).map((t) => ({
|
|
238
|
+
label: t.assetClass.replace(/_/g, " "),
|
|
239
|
+
value: t.marketValue / e * 100,
|
|
240
|
+
caption: p(t.marketValue, r)
|
|
241
|
+
}));
|
|
242
|
+
}, [n, r]);
|
|
243
|
+
return /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ E(j, { children: [/* @__PURE__ */ E(M, {
|
|
244
|
+
className: "flex items-center gap-2",
|
|
245
|
+
children: [/* @__PURE__ */ T(S, {
|
|
246
|
+
className: "size-5",
|
|
247
|
+
"aria-hidden": "true"
|
|
248
|
+
}), t("brainyrich.reports.netWorth.title", "Net Worth Statement")]
|
|
249
|
+
}), /* @__PURE__ */ T(A, { children: t("brainyrich.reports.netWorth.description", "Consolidated assets, cash, and asset-class allocation as of today.") })] }), /* @__PURE__ */ T(k, { children: e.isLoading ? /* @__PURE__ */ T(l, { rows: 3 }) : e.isError ? /* @__PURE__ */ T(s, { onRetry: () => e.refetch() }) : n ? /* @__PURE__ */ E("div", {
|
|
250
|
+
className: "space-y-6",
|
|
251
|
+
children: [/* @__PURE__ */ E("div", {
|
|
252
|
+
className: "grid gap-4 sm:grid-cols-3",
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ T($, {
|
|
255
|
+
label: t("brainyrich.reports.netWorth.total", "Total Net Worth"),
|
|
256
|
+
value: p(n.totalNetWorth, r),
|
|
257
|
+
emphasis: !0
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ T($, {
|
|
260
|
+
label: t("brainyrich.reports.netWorth.invested", "Invested Value"),
|
|
261
|
+
value: p(n.totalMarketValue, r)
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ T($, {
|
|
264
|
+
label: t("brainyrich.reports.netWorth.cash", "Cash & Liquidity"),
|
|
265
|
+
value: p(n.totalCash, r)
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
}), /* @__PURE__ */ E("div", {
|
|
269
|
+
className: "space-y-3",
|
|
270
|
+
children: [/* @__PURE__ */ T("p", {
|
|
271
|
+
className: "text-sm font-medium text-text-primary",
|
|
272
|
+
children: t("brainyrich.reports.netWorth.allocation", "Allocation by Asset Class")
|
|
273
|
+
}), i.length > 0 ? /* @__PURE__ */ T(a, { data: i }) : /* @__PURE__ */ T("p", {
|
|
274
|
+
className: "text-sm text-text-secondary",
|
|
275
|
+
children: t("brainyrich.reports.netWorth.noAllocation", "No holdings to allocate yet.")
|
|
254
276
|
})]
|
|
255
277
|
})]
|
|
278
|
+
}) : /* @__PURE__ */ T(o, {
|
|
279
|
+
icon: /* @__PURE__ */ T(S, {
|
|
280
|
+
className: "size-6",
|
|
281
|
+
"aria-hidden": "true"
|
|
282
|
+
}),
|
|
283
|
+
title: t("brainyrich.reports.netWorth.emptyTitle", "No net-worth data yet"),
|
|
284
|
+
description: t("brainyrich.reports.netWorth.emptyDesc", "Link an account and add holdings to generate a net-worth statement.")
|
|
285
|
+
}) })] });
|
|
286
|
+
}
|
|
287
|
+
function $({ label: e, value: t, emphasis: n }) {
|
|
288
|
+
return /* @__PURE__ */ E("div", {
|
|
289
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
290
|
+
children: [/* @__PURE__ */ T("p", {
|
|
291
|
+
className: "text-xs text-text-secondary",
|
|
292
|
+
children: e
|
|
293
|
+
}), /* @__PURE__ */ T("p", {
|
|
294
|
+
className: n ? "mt-1 text-2xl font-semibold text-text-primary" : "mt-1 text-xl font-semibold text-text-primary",
|
|
295
|
+
children: t
|
|
296
|
+
})]
|
|
256
297
|
});
|
|
257
298
|
}
|
|
299
|
+
function te({ query: e, holdings: t, translate: n }) {
|
|
300
|
+
return /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ E(j, { children: [/* @__PURE__ */ E(M, {
|
|
301
|
+
className: "flex items-center gap-2",
|
|
302
|
+
children: [/* @__PURE__ */ T(y, {
|
|
303
|
+
className: "size-5",
|
|
304
|
+
"aria-hidden": "true"
|
|
305
|
+
}), n("brainyrich.reports.holdings.title", "Holdings Schedule")]
|
|
306
|
+
}), /* @__PURE__ */ T(A, { children: n("brainyrich.reports.holdings.description", "Every position across your portfolios with cost basis and market value.") })] }), /* @__PURE__ */ T(k, { children: e.isLoading ? /* @__PURE__ */ T(l, { rows: 4 }) : e.isError ? /* @__PURE__ */ T(s, { onRetry: () => e.refetch() }) : t.length > 0 ? /* @__PURE__ */ T("div", {
|
|
307
|
+
className: "overflow-x-auto",
|
|
308
|
+
children: /* @__PURE__ */ E(L, { children: [/* @__PURE__ */ T(V, { children: /* @__PURE__ */ E(H, { children: [
|
|
309
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.holdings.symbol", "Symbol") }),
|
|
310
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.holdings.assetClass", "Asset Class") }),
|
|
311
|
+
/* @__PURE__ */ T(B, {
|
|
312
|
+
className: "text-right",
|
|
313
|
+
children: n("brainyrich.reports.holdings.quantity", "Quantity")
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ T(B, {
|
|
316
|
+
className: "text-right",
|
|
317
|
+
children: n("brainyrich.reports.holdings.costBasis", "Cost Basis")
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ T(B, {
|
|
320
|
+
className: "text-right",
|
|
321
|
+
children: n("brainyrich.reports.holdings.marketValue", "Market Value")
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ T(B, {
|
|
324
|
+
className: "text-right",
|
|
325
|
+
children: n("brainyrich.reports.holdings.gainLoss", "Unrealized")
|
|
326
|
+
})
|
|
327
|
+
] }) }), /* @__PURE__ */ T(R, { children: t.map((e) => {
|
|
328
|
+
let t = e.marketValue - e.costBasis;
|
|
329
|
+
return /* @__PURE__ */ E(H, { children: [
|
|
330
|
+
/* @__PURE__ */ E(z, { children: [/* @__PURE__ */ T("div", {
|
|
331
|
+
className: "font-medium text-text-primary",
|
|
332
|
+
children: e.symbol
|
|
333
|
+
}), e.name ? /* @__PURE__ */ T("div", {
|
|
334
|
+
className: "text-xs text-text-secondary",
|
|
335
|
+
children: e.name
|
|
336
|
+
}) : null] }),
|
|
337
|
+
/* @__PURE__ */ T(z, { children: /* @__PURE__ */ T(D, {
|
|
338
|
+
variant: "outline",
|
|
339
|
+
children: e.assetClass.replace(/_/g, " ")
|
|
340
|
+
}) }),
|
|
341
|
+
/* @__PURE__ */ T(z, {
|
|
342
|
+
className: "text-right tabular-nums text-text-primary",
|
|
343
|
+
children: e.quantity
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ T(z, {
|
|
346
|
+
className: "text-right tabular-nums text-text-primary",
|
|
347
|
+
children: p(e.costBasis, e.currency)
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ T(z, {
|
|
350
|
+
className: "text-right tabular-nums text-text-primary",
|
|
351
|
+
children: p(e.marketValue, e.currency)
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ E(z, {
|
|
354
|
+
className: `text-right tabular-nums font-medium ${d(t)}`,
|
|
355
|
+
children: [t > 0 ? "+" : "", p(t, e.currency)]
|
|
356
|
+
})
|
|
357
|
+
] }, e.id);
|
|
358
|
+
}) })] })
|
|
359
|
+
}) : /* @__PURE__ */ T(o, {
|
|
360
|
+
icon: /* @__PURE__ */ T(y, {
|
|
361
|
+
className: "size-6",
|
|
362
|
+
"aria-hidden": "true"
|
|
363
|
+
}),
|
|
364
|
+
title: n("brainyrich.reports.holdings.emptyTitle", "No holdings on file"),
|
|
365
|
+
description: n("brainyrich.reports.holdings.emptyDesc", "Add holdings to your portfolios to generate a holdings schedule.")
|
|
366
|
+
}) })] });
|
|
367
|
+
}
|
|
368
|
+
function ne({ query: e, transactions: t, translate: n }) {
|
|
369
|
+
return /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ E(j, { children: [/* @__PURE__ */ E(M, {
|
|
370
|
+
className: "flex items-center gap-2",
|
|
371
|
+
children: [/* @__PURE__ */ T(x, {
|
|
372
|
+
className: "size-5",
|
|
373
|
+
"aria-hidden": "true"
|
|
374
|
+
}), n("brainyrich.reports.ledger.title", "Transaction Ledger")]
|
|
375
|
+
}), /* @__PURE__ */ T(A, { children: n("brainyrich.reports.ledger.description", "Every recorded transaction across your accounts, newest first.") })] }), /* @__PURE__ */ T(k, { children: e.isLoading ? /* @__PURE__ */ T(l, { rows: 4 }) : e.isError ? /* @__PURE__ */ T(s, { onRetry: () => e.refetch() }) : t.length > 0 ? /* @__PURE__ */ T("div", {
|
|
376
|
+
className: "overflow-x-auto",
|
|
377
|
+
children: /* @__PURE__ */ E(L, { children: [/* @__PURE__ */ T(V, { children: /* @__PURE__ */ E(H, { children: [
|
|
378
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.ledger.date", "Trade Date") }),
|
|
379
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.ledger.type", "Type") }),
|
|
380
|
+
/* @__PURE__ */ T(B, { children: n("brainyrich.reports.ledger.symbol", "Symbol") }),
|
|
381
|
+
/* @__PURE__ */ T(B, {
|
|
382
|
+
className: "text-right",
|
|
383
|
+
children: n("brainyrich.reports.ledger.quantity", "Quantity")
|
|
384
|
+
}),
|
|
385
|
+
/* @__PURE__ */ T(B, {
|
|
386
|
+
className: "text-right",
|
|
387
|
+
children: n("brainyrich.reports.ledger.price", "Price")
|
|
388
|
+
}),
|
|
389
|
+
/* @__PURE__ */ T(B, {
|
|
390
|
+
className: "text-right",
|
|
391
|
+
children: n("brainyrich.reports.ledger.amount", "Amount")
|
|
392
|
+
})
|
|
393
|
+
] }) }), /* @__PURE__ */ T(R, { children: t.map((e) => /* @__PURE__ */ E(H, { children: [
|
|
394
|
+
/* @__PURE__ */ T(z, {
|
|
395
|
+
className: "text-text-primary",
|
|
396
|
+
children: f(e.tradeDate)
|
|
397
|
+
}),
|
|
398
|
+
/* @__PURE__ */ T(z, { children: /* @__PURE__ */ T(D, {
|
|
399
|
+
variant: "outline",
|
|
400
|
+
children: e.type
|
|
401
|
+
}) }),
|
|
402
|
+
/* @__PURE__ */ T(z, {
|
|
403
|
+
className: "text-text-primary",
|
|
404
|
+
children: e.symbol ?? "—"
|
|
405
|
+
}),
|
|
406
|
+
/* @__PURE__ */ T(z, {
|
|
407
|
+
className: "text-right tabular-nums text-text-primary",
|
|
408
|
+
children: e.quantity
|
|
409
|
+
}),
|
|
410
|
+
/* @__PURE__ */ T(z, {
|
|
411
|
+
className: "text-right tabular-nums text-text-primary",
|
|
412
|
+
children: p(e.price, e.currency)
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ T(z, {
|
|
415
|
+
className: "text-right tabular-nums text-text-primary",
|
|
416
|
+
children: p(e.amount, e.currency)
|
|
417
|
+
})
|
|
418
|
+
] }, e.id)) })] })
|
|
419
|
+
}) : /* @__PURE__ */ T(o, {
|
|
420
|
+
icon: /* @__PURE__ */ T(v, {
|
|
421
|
+
className: "size-6",
|
|
422
|
+
"aria-hidden": "true"
|
|
423
|
+
}),
|
|
424
|
+
title: n("brainyrich.reports.ledger.emptyTitle", "No transactions recorded"),
|
|
425
|
+
description: n("brainyrich.reports.ledger.emptyDesc", "Record transactions on your accounts to build a ledger statement.")
|
|
426
|
+
}) })] });
|
|
427
|
+
}
|
|
258
428
|
//#endregion
|
|
259
|
-
export {
|
|
429
|
+
export { Z as ReportsPage };
|
|
260
430
|
|
|
261
431
|
//# sourceMappingURL=ReportsPage.js.map
|