@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,389 +1,582 @@
|
|
|
1
1
|
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { useAccounts as t, useAcknowledgeInsight as n, useCreateInsight as r, useDismissInsight as i, useGoals as a, useHouseholds as o, usePagedInsights as s, usePortfolios as c, useResolveInsight as l } from "../hooks/useBrainyRichApi.js";
|
|
3
|
+
import { LoadMore as u } from "../components/LoadMore.js";
|
|
4
|
+
import { ConfirmDialog as d } from "../components/ConfirmDialog.js";
|
|
5
|
+
import { SubjectPicker as f, parseSubject as p } from "../components/pickers.js";
|
|
6
|
+
import "../components/index.js";
|
|
7
|
+
import { EmptyState as m, ErrorState as ee, KpiGrid as te, LoadingState as ne, SectionShell as re, formatDate as h, statusBadgeVariant as g } from "./_shared.js";
|
|
8
|
+
import { useMemo as _, useState as v } from "react";
|
|
9
|
+
import { AlertTriangle as y, BellRing as b, CheckCircle2 as x, Info as S, Lightbulb as C, MoreHorizontal as w, Plus as ie, ShieldAlert as ae, XCircle as oe } from "lucide-react";
|
|
10
|
+
import { useI18n as se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
11
|
+
import { Fragment as ce, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
12
|
+
import { Badge as D, Button as O, Card as le, CardContent as k, CardDescription as A, CardHeader as ue, CardTitle as de, Dialog as j, DialogContent as M, DialogDescription as N, DialogFooter as P, DialogHeader as fe, DialogTitle as F, DropdownMenu as I, DropdownMenuContent as L, DropdownMenuItem as R, DropdownMenuSeparator as z, DropdownMenuTrigger as B, Input as V, Label as H, Select as U, SelectContent as W, SelectItem as G, SelectTrigger as K, SelectValue as q, Textarea as J } from "@burdenoff/fe-libs/ui";
|
|
9
13
|
//#region src/brainyrich/pages/AiAssistantPage.tsx
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
var pe = [
|
|
15
|
+
"REBALANCE_DUE",
|
|
16
|
+
"DRIFT",
|
|
17
|
+
"CONCENTRATION_RISK",
|
|
18
|
+
"CASH_DRAG",
|
|
19
|
+
"FEE_ANOMALY",
|
|
20
|
+
"TAX_OPPORTUNITY",
|
|
21
|
+
"GOAL_AT_RISK"
|
|
22
|
+
], me = [
|
|
23
|
+
"INFO",
|
|
24
|
+
"LOW",
|
|
25
|
+
"MEDIUM",
|
|
26
|
+
"HIGH",
|
|
27
|
+
"CRITICAL"
|
|
28
|
+
], he = [
|
|
29
|
+
"OPEN",
|
|
30
|
+
"ACKNOWLEDGED",
|
|
31
|
+
"RESOLVED",
|
|
32
|
+
"DISMISSED"
|
|
33
|
+
], Y = "__all__";
|
|
34
|
+
function X(e) {
|
|
35
|
+
return e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
13
36
|
}
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
lastMessage: /* @__PURE__ */ new Date(Date.now() - 1e3 * 60 * 60 * 24),
|
|
37
|
-
messageCount: 15
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: "4",
|
|
41
|
-
titleKey: "brainyrich.aiAssistant.sessions.retirementCorpusReview",
|
|
42
|
-
titleFallback: "Retirement Corpus Review",
|
|
43
|
-
title: "Retirement Corpus Review",
|
|
44
|
-
lastMessage: /* @__PURE__ */ new Date(Date.now() - 1e3 * 60 * 60 * 48),
|
|
45
|
-
messageCount: 6
|
|
46
|
-
}
|
|
47
|
-
], P = [
|
|
48
|
-
{
|
|
49
|
-
key: "brainyrich.aiAssistant.suggestions.portfolioPerformance",
|
|
50
|
-
fallback: "Analyze my portfolio performance",
|
|
51
|
-
icon: v
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
key: "brainyrich.aiAssistant.suggestions.taxOptimization",
|
|
55
|
-
fallback: "Tax optimization strategies for FY 2026-27",
|
|
56
|
-
icon: c
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
key: "brainyrich.aiAssistant.suggestions.retirementCorpus",
|
|
60
|
-
fallback: "Review my retirement corpus projections",
|
|
61
|
-
icon: m
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
key: "brainyrich.aiAssistant.suggestions.estateChecklist",
|
|
65
|
-
fallback: "Estate planning checklist for nominees",
|
|
66
|
-
icon: u
|
|
37
|
+
function ge(e) {
|
|
38
|
+
switch (e) {
|
|
39
|
+
case "CRITICAL": return {
|
|
40
|
+
icon: ae,
|
|
41
|
+
tone: "text-status-error-text"
|
|
42
|
+
};
|
|
43
|
+
case "HIGH": return {
|
|
44
|
+
icon: y,
|
|
45
|
+
tone: "text-status-error-text"
|
|
46
|
+
};
|
|
47
|
+
case "MEDIUM": return {
|
|
48
|
+
icon: b,
|
|
49
|
+
tone: "text-status-warning-text"
|
|
50
|
+
};
|
|
51
|
+
case "LOW": return {
|
|
52
|
+
icon: C,
|
|
53
|
+
tone: "text-status-warning-text"
|
|
54
|
+
};
|
|
55
|
+
default: return {
|
|
56
|
+
icon: S,
|
|
57
|
+
tone: "text-text-secondary"
|
|
58
|
+
};
|
|
67
59
|
}
|
|
68
|
-
];
|
|
69
|
-
function F(e) {
|
|
70
|
-
let t = Date.now() - e.getTime(), n = Math.floor(t / 6e4);
|
|
71
|
-
if (n < 60) return `${n}m ago`;
|
|
72
|
-
let r = Math.floor(n / 60);
|
|
73
|
-
return r < 24 ? `${r}h ago` : `${Math.floor(r / 24)}d ago`;
|
|
74
60
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
function _e() {
|
|
62
|
+
return {
|
|
63
|
+
title: "",
|
|
64
|
+
type: "DRIFT",
|
|
65
|
+
severity: "MEDIUM",
|
|
66
|
+
subject: "",
|
|
67
|
+
detail: "",
|
|
68
|
+
metrics: "",
|
|
69
|
+
ownerId: ""
|
|
70
|
+
};
|
|
78
71
|
}
|
|
79
|
-
function
|
|
80
|
-
let { t:
|
|
81
|
-
...
|
|
82
|
-
|
|
83
|
-
})),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
id
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
72
|
+
function Z() {
|
|
73
|
+
let { t: d } = se(), f = (t, n, r) => e(d, t, n, r), [h, g] = v(Y), [y, x] = v(Y), [S, C] = v(Y), { items: w, hasMore: ae, loadMore: oe, isLoading: D, isFetchingNextPage: A, isError: ue, refetch: de } = s({
|
|
74
|
+
...h === Y ? {} : { severity: h },
|
|
75
|
+
...y === Y ? {} : { status: y }
|
|
76
|
+
}), j = t(), M = c(), N = a(), P = o(), fe = _(() => {
|
|
77
|
+
let e = /* @__PURE__ */ new Map();
|
|
78
|
+
for (let t of j.data) e.set(t.id, t.name);
|
|
79
|
+
for (let t of M.data) e.set(t.id, t.name);
|
|
80
|
+
for (let t of N.data) e.set(t.id, t.name);
|
|
81
|
+
for (let t of P.data) e.set(t.id, t.name);
|
|
82
|
+
return e;
|
|
83
|
+
}, [
|
|
84
|
+
j.data,
|
|
85
|
+
M.data,
|
|
86
|
+
N.data,
|
|
87
|
+
P.data
|
|
88
|
+
]), F = n(), I = i(), L = l(), R = r(), [z, B] = v(!1), [V, J] = v(_e), ge = (e, t) => J((n) => ({
|
|
89
|
+
...n,
|
|
90
|
+
[e]: t
|
|
91
|
+
})), Z = _(() => S === Y ? w : w.filter((e) => e.type === S), [w, S]), Q = _(() => ({
|
|
92
|
+
open: w.filter((e) => e.status === "OPEN").length,
|
|
93
|
+
urgent: w.filter((e) => e.severity === "HIGH" || e.severity === "CRITICAL").length,
|
|
94
|
+
resolved: w.filter((e) => e.status === "RESOLVED").length
|
|
95
|
+
}), [w]), be = _(() => {
|
|
96
|
+
if (!V.metrics.trim()) return !0;
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse(V.metrics), !0;
|
|
99
|
+
} catch {
|
|
100
|
+
return !1;
|
|
101
|
+
}
|
|
102
|
+
}, [V.metrics]), xe = V.title.trim().length > 0 && p(V.subject) !== null && be, Se = () => {
|
|
103
|
+
J(_e()), B(!0);
|
|
104
|
+
}, Ce = () => {
|
|
105
|
+
if (!xe) return;
|
|
106
|
+
let e = p(V.subject);
|
|
107
|
+
if (!e) return;
|
|
108
|
+
let t;
|
|
109
|
+
if (V.metrics.trim()) try {
|
|
110
|
+
t = JSON.parse(V.metrics);
|
|
111
|
+
} catch {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
let n = {
|
|
115
|
+
title: V.title.trim(),
|
|
116
|
+
type: V.type,
|
|
117
|
+
severity: V.severity,
|
|
118
|
+
subjectType: e.subjectType,
|
|
119
|
+
subjectId: e.subjectId,
|
|
120
|
+
detail: V.detail.trim() || null,
|
|
121
|
+
...t ? { metrics: t } : {},
|
|
122
|
+
...V.ownerId.trim() ? { ownerId: V.ownerId.trim() } : {}
|
|
108
123
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
R.mutate(n, { onSuccess: () => B(!1) });
|
|
125
|
+
}, $ = h !== Y || y !== Y || S !== Y;
|
|
126
|
+
return /* @__PURE__ */ E(ce, { children: [/* @__PURE__ */ T(re, {
|
|
127
|
+
title: f("brainyrich.insights.title", "Insights"),
|
|
128
|
+
description: f("brainyrich.insights.description", "Advisory insights across portfolios, accounts and goals — triage, acknowledge and resolve."),
|
|
129
|
+
badges: [f("brainyrich.insights.badges.advisory", "Advisory")],
|
|
130
|
+
actionLabel: f("brainyrich.insights.actions.create", "New insight"),
|
|
131
|
+
onAction: Se,
|
|
132
|
+
children: D ? /* @__PURE__ */ T(ne, { rows: 4 }) : ue ? /* @__PURE__ */ T(ee, {
|
|
133
|
+
title: f("brainyrich.insights.error.title", "Could not load insights"),
|
|
134
|
+
description: f("brainyrich.insights.error.description", "We could not reach the insights service. Please try again."),
|
|
135
|
+
onRetry: () => de()
|
|
136
|
+
}) : /* @__PURE__ */ E(ce, { children: [
|
|
137
|
+
/* @__PURE__ */ T(te, { items: [
|
|
138
|
+
{
|
|
139
|
+
label: f("brainyrich.insights.metrics.total", "Insights"),
|
|
140
|
+
value: String(w.length),
|
|
141
|
+
trend: f("brainyrich.insights.metrics.totalTrend", "In your inbox")
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: f("brainyrich.insights.metrics.open", "Open"),
|
|
145
|
+
value: String(Q.open),
|
|
146
|
+
trend: f("brainyrich.insights.metrics.openTrend", "Awaiting action"),
|
|
147
|
+
deltaTone: Q.open > 0 ? "negative" : "positive"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: f("brainyrich.insights.metrics.urgent", "High priority"),
|
|
151
|
+
value: String(Q.urgent),
|
|
152
|
+
trend: f("brainyrich.insights.metrics.urgentTrend", "High or critical"),
|
|
153
|
+
deltaTone: Q.urgent > 0 ? "negative" : "positive"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: f("brainyrich.insights.metrics.resolved", "Resolved"),
|
|
157
|
+
value: String(Q.resolved),
|
|
158
|
+
trend: f("brainyrich.insights.metrics.resolvedTrend", "Closed out"),
|
|
159
|
+
deltaTone: "positive"
|
|
127
160
|
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}, $ = (e) => {
|
|
132
|
-
G(e), Z.current?.focus();
|
|
133
|
-
};
|
|
134
|
-
return /* @__PURE__ */ x(n, {
|
|
135
|
-
title: L("brainyrich.aiAssistant.title", "AI Wealth Assistant"),
|
|
136
|
-
description: L("brainyrich.aiAssistant.description", "Personalized financial advice powered by artificial intelligence"),
|
|
137
|
-
badges: [L("brainyrich.aiAssistant.badges.aiPowered", "AI Powered")],
|
|
138
|
-
actionLabel: L("brainyrich.aiAssistant.actions.exportChat", "Export Chat"),
|
|
139
|
-
children: /* @__PURE__ */ S("div", {
|
|
140
|
-
className: "grid grid-cols-1 gap-6 lg:grid-cols-4",
|
|
141
|
-
style: { minHeight: "calc(100vh - 280px)" },
|
|
142
|
-
children: [/* @__PURE__ */ S("div", {
|
|
143
|
-
className: "space-y-3 lg:col-span-1",
|
|
161
|
+
] }),
|
|
162
|
+
/* @__PURE__ */ T(le, { children: /* @__PURE__ */ E(k, {
|
|
163
|
+
className: "flex flex-col gap-3 p-4 sm:flex-row sm:items-end",
|
|
144
164
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
165
|
+
/* @__PURE__ */ E("div", {
|
|
166
|
+
className: "w-full space-y-1.5 sm:w-48",
|
|
167
|
+
children: [/* @__PURE__ */ T(H, {
|
|
168
|
+
htmlFor: "insight-filter-severity",
|
|
169
|
+
children: f("brainyrich.insights.filters.severity", "Severity")
|
|
170
|
+
}), /* @__PURE__ */ E(U, {
|
|
171
|
+
value: h,
|
|
172
|
+
onValueChange: g,
|
|
173
|
+
children: [/* @__PURE__ */ T(K, {
|
|
174
|
+
id: "insight-filter-severity",
|
|
175
|
+
children: /* @__PURE__ */ T(q, {})
|
|
176
|
+
}), /* @__PURE__ */ E(W, { children: [/* @__PURE__ */ T(G, {
|
|
177
|
+
value: Y,
|
|
178
|
+
children: f("brainyrich.insights.filters.all", "All")
|
|
179
|
+
}), me.map((e) => /* @__PURE__ */ T(G, {
|
|
180
|
+
value: e,
|
|
181
|
+
children: X(e)
|
|
182
|
+
}, e))] })]
|
|
183
|
+
})]
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ E("div", {
|
|
186
|
+
className: "w-full space-y-1.5 sm:w-48",
|
|
187
|
+
children: [/* @__PURE__ */ T(H, {
|
|
188
|
+
htmlFor: "insight-filter-status",
|
|
189
|
+
children: f("brainyrich.insights.filters.status", "Status")
|
|
190
|
+
}), /* @__PURE__ */ E(U, {
|
|
191
|
+
value: y,
|
|
192
|
+
onValueChange: x,
|
|
193
|
+
children: [/* @__PURE__ */ T(K, {
|
|
194
|
+
id: "insight-filter-status",
|
|
195
|
+
children: /* @__PURE__ */ T(q, {})
|
|
196
|
+
}), /* @__PURE__ */ E(W, { children: [/* @__PURE__ */ T(G, {
|
|
197
|
+
value: Y,
|
|
198
|
+
children: f("brainyrich.insights.filters.all", "All")
|
|
199
|
+
}), he.map((e) => /* @__PURE__ */ T(G, {
|
|
200
|
+
value: e,
|
|
201
|
+
children: X(e)
|
|
202
|
+
}, e))] })]
|
|
203
|
+
})]
|
|
150
204
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
className: "
|
|
153
|
-
children: /* @__PURE__ */
|
|
154
|
-
|
|
155
|
-
children:
|
|
205
|
+
/* @__PURE__ */ E("div", {
|
|
206
|
+
className: "w-full space-y-1.5 sm:w-56",
|
|
207
|
+
children: [/* @__PURE__ */ T(H, {
|
|
208
|
+
htmlFor: "insight-filter-type",
|
|
209
|
+
children: f("brainyrich.insights.filters.type", "Type")
|
|
210
|
+
}), /* @__PURE__ */ E(U, {
|
|
211
|
+
value: S,
|
|
212
|
+
onValueChange: C,
|
|
213
|
+
children: [/* @__PURE__ */ T(K, {
|
|
214
|
+
id: "insight-filter-type",
|
|
215
|
+
children: /* @__PURE__ */ T(q, {})
|
|
216
|
+
}), /* @__PURE__ */ E(W, { children: [/* @__PURE__ */ T(G, {
|
|
217
|
+
value: Y,
|
|
218
|
+
children: f("brainyrich.insights.filters.all", "All")
|
|
219
|
+
}), pe.map((e) => /* @__PURE__ */ T(G, {
|
|
220
|
+
value: e,
|
|
221
|
+
children: X(e)
|
|
222
|
+
}, e))] })]
|
|
223
|
+
})]
|
|
224
|
+
})
|
|
225
|
+
]
|
|
226
|
+
}) }),
|
|
227
|
+
Z.length === 0 ? /* @__PURE__ */ T(m, {
|
|
228
|
+
icon: /* @__PURE__ */ T(b, {
|
|
229
|
+
className: "size-6",
|
|
230
|
+
"aria-hidden": "true"
|
|
231
|
+
}),
|
|
232
|
+
title: $ ? f("brainyrich.insights.empty.filteredTitle", "No matching insights") : f("brainyrich.insights.empty.title", "No advisory insights yet"),
|
|
233
|
+
description: $ ? f("brainyrich.insights.empty.filteredDescription", "No insights match the selected filters. Adjust or clear them to see more.") : f("brainyrich.insights.empty.description", "Advisory insights flag rebalancing, drift, concentration and other opportunities. Create one to get started."),
|
|
234
|
+
action: $ ? /* @__PURE__ */ T(O, {
|
|
235
|
+
variant: "outline",
|
|
236
|
+
size: "sm",
|
|
237
|
+
onClick: () => {
|
|
238
|
+
g(Y), x(Y), C(Y);
|
|
239
|
+
},
|
|
240
|
+
children: f("brainyrich.insights.actions.clearFilters", "Clear filters")
|
|
241
|
+
}) : /* @__PURE__ */ E(O, {
|
|
242
|
+
size: "sm",
|
|
243
|
+
onClick: Se,
|
|
244
|
+
children: [/* @__PURE__ */ T(ie, {
|
|
245
|
+
className: "size-4",
|
|
246
|
+
"aria-hidden": "true"
|
|
247
|
+
}), f("brainyrich.insights.actions.create", "New insight")]
|
|
248
|
+
})
|
|
249
|
+
}) : /* @__PURE__ */ T("div", {
|
|
250
|
+
className: "space-y-3",
|
|
251
|
+
children: Z.map((e) => /* @__PURE__ */ T(ve, {
|
|
252
|
+
insight: e,
|
|
253
|
+
subjectName: fe.get(e.subjectId),
|
|
254
|
+
translate: f,
|
|
255
|
+
onAcknowledge: () => F.mutate(e.id),
|
|
256
|
+
onDismiss: () => I.mutate(e.id),
|
|
257
|
+
onResolve: () => L.mutate(e.id),
|
|
258
|
+
acknowledgePending: F.isPending,
|
|
259
|
+
dismissPending: I.isPending,
|
|
260
|
+
resolvePending: L.isPending
|
|
261
|
+
}, e.id))
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ T(u, {
|
|
264
|
+
hasMore: ae,
|
|
265
|
+
onClick: oe,
|
|
266
|
+
loading: A,
|
|
267
|
+
label: f("brainyrich.insights.actions.loadMore", "Load more insights")
|
|
268
|
+
})
|
|
269
|
+
] })
|
|
270
|
+
}), /* @__PURE__ */ T(ye, {
|
|
271
|
+
open: z,
|
|
272
|
+
form: V,
|
|
273
|
+
setField: ge,
|
|
274
|
+
metricsValid: be,
|
|
275
|
+
valid: xe,
|
|
276
|
+
pending: R.isPending,
|
|
277
|
+
onSubmit: Ce,
|
|
278
|
+
onOpenChange: (e) => B(e),
|
|
279
|
+
translate: f
|
|
280
|
+
})] });
|
|
281
|
+
}
|
|
282
|
+
function ve({ insight: e, subjectName: t, translate: n, onAcknowledge: r, onDismiss: i, onResolve: a, acknowledgePending: o, dismissPending: s, resolvePending: c }) {
|
|
283
|
+
let l = ge(e.severity), u = l.icon, f = e.status === "RESOLVED" || e.status === "DISMISSED", [p, m] = v(!1);
|
|
284
|
+
return /* @__PURE__ */ E(le, { children: [
|
|
285
|
+
/* @__PURE__ */ T(ue, {
|
|
286
|
+
className: "pb-3",
|
|
287
|
+
children: /* @__PURE__ */ E("div", {
|
|
288
|
+
className: "flex items-start justify-between gap-3",
|
|
289
|
+
children: [/* @__PURE__ */ E("div", {
|
|
290
|
+
className: "flex min-w-0 items-start gap-3",
|
|
291
|
+
children: [/* @__PURE__ */ T("span", {
|
|
292
|
+
className: `mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-sunken ${l.tone}`,
|
|
293
|
+
children: /* @__PURE__ */ T(u, {
|
|
294
|
+
className: "size-5",
|
|
295
|
+
"aria-hidden": "true"
|
|
156
296
|
})
|
|
157
|
-
}), /* @__PURE__ */
|
|
158
|
-
className: "
|
|
159
|
-
children:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
297
|
+
}), /* @__PURE__ */ E("div", {
|
|
298
|
+
className: "min-w-0",
|
|
299
|
+
children: [/* @__PURE__ */ T(de, {
|
|
300
|
+
className: "text-base",
|
|
301
|
+
children: e.title
|
|
302
|
+
}), /* @__PURE__ */ E(A, {
|
|
303
|
+
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ T(D, {
|
|
306
|
+
variant: "outline",
|
|
307
|
+
children: X(e.type)
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ T(D, {
|
|
310
|
+
variant: g(e.severity),
|
|
311
|
+
children: /* @__PURE__ */ E("span", {
|
|
312
|
+
className: `inline-flex items-center gap-1 ${l.tone}`,
|
|
313
|
+
children: [/* @__PURE__ */ T(u, {
|
|
314
|
+
className: "size-3",
|
|
315
|
+
"aria-hidden": "true"
|
|
316
|
+
}), X(e.severity)]
|
|
317
|
+
})
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ T(D, {
|
|
320
|
+
variant: g(e.status),
|
|
321
|
+
children: X(e.status)
|
|
322
|
+
})
|
|
323
|
+
]
|
|
324
|
+
})]
|
|
325
|
+
})]
|
|
326
|
+
}), /* @__PURE__ */ E(I, { children: [/* @__PURE__ */ T(B, {
|
|
327
|
+
asChild: !0,
|
|
328
|
+
children: /* @__PURE__ */ T(O, {
|
|
329
|
+
variant: "ghost",
|
|
330
|
+
size: "icon",
|
|
331
|
+
"aria-label": n("brainyrich.insights.actions.menu", "Insight actions"),
|
|
332
|
+
children: /* @__PURE__ */ T(w, {
|
|
333
|
+
className: "size-4",
|
|
334
|
+
"aria-hidden": "true"
|
|
177
335
|
})
|
|
178
|
-
})
|
|
179
|
-
|
|
336
|
+
})
|
|
337
|
+
}), /* @__PURE__ */ E(L, {
|
|
338
|
+
align: "end",
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ E(R, {
|
|
341
|
+
disabled: o || e.status === "ACKNOWLEDGED" || f,
|
|
342
|
+
onSelect: r,
|
|
343
|
+
children: [/* @__PURE__ */ T(x, {
|
|
344
|
+
className: "size-4",
|
|
345
|
+
"aria-hidden": "true"
|
|
346
|
+
}), n("brainyrich.insights.actions.acknowledge", "Acknowledge")]
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ E(R, {
|
|
349
|
+
disabled: c || e.status === "RESOLVED",
|
|
350
|
+
onSelect: a,
|
|
351
|
+
children: [/* @__PURE__ */ T(x, {
|
|
352
|
+
className: "size-4",
|
|
353
|
+
"aria-hidden": "true"
|
|
354
|
+
}), n("brainyrich.insights.actions.resolve", "Resolve")]
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ T(z, {}),
|
|
357
|
+
/* @__PURE__ */ E(R, {
|
|
358
|
+
className: "text-status-error-text focus:text-status-error-text",
|
|
359
|
+
disabled: s || e.status === "DISMISSED",
|
|
360
|
+
onSelect: (e) => {
|
|
361
|
+
e.preventDefault(), m(!0);
|
|
362
|
+
},
|
|
363
|
+
children: [/* @__PURE__ */ T(oe, {
|
|
364
|
+
className: "size-4",
|
|
365
|
+
"aria-hidden": "true"
|
|
366
|
+
}), n("brainyrich.insights.actions.dismiss", "Dismiss")]
|
|
367
|
+
})
|
|
368
|
+
]
|
|
369
|
+
})] })]
|
|
370
|
+
})
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ E(k, {
|
|
373
|
+
className: "space-y-3",
|
|
374
|
+
children: [
|
|
375
|
+
e.detail ? /* @__PURE__ */ T("p", {
|
|
376
|
+
className: "text-sm text-text-secondary",
|
|
377
|
+
children: e.detail
|
|
378
|
+
}) : null,
|
|
379
|
+
/* @__PURE__ */ E("dl", {
|
|
380
|
+
className: "grid grid-cols-2 gap-3 rounded-lg bg-bg-sunken p-3 text-sm sm:grid-cols-3",
|
|
381
|
+
children: [
|
|
382
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
|
|
383
|
+
className: "text-xs text-text-secondary",
|
|
384
|
+
children: n("brainyrich.insights.card.subjectType", "Subject")
|
|
385
|
+
}), /* @__PURE__ */ T("dd", {
|
|
386
|
+
className: "font-medium text-text-primary",
|
|
387
|
+
children: X(e.subjectType)
|
|
388
|
+
})] }),
|
|
389
|
+
/* @__PURE__ */ E("div", {
|
|
390
|
+
className: "min-w-0",
|
|
391
|
+
children: [/* @__PURE__ */ T("dt", {
|
|
392
|
+
className: "text-xs text-text-secondary",
|
|
393
|
+
children: n("brainyrich.insights.card.subject", "Reference")
|
|
394
|
+
}), /* @__PURE__ */ T("dd", {
|
|
395
|
+
className: "truncate font-medium text-text-primary",
|
|
396
|
+
title: t ? `${t} (${e.subjectId})` : e.subjectId,
|
|
397
|
+
children: t ?? e.subjectId
|
|
398
|
+
})]
|
|
399
|
+
}),
|
|
400
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
|
|
401
|
+
className: "text-xs text-text-secondary",
|
|
402
|
+
children: n("brainyrich.insights.card.created", "Created")
|
|
403
|
+
}), /* @__PURE__ */ T("dd", {
|
|
404
|
+
className: "font-medium text-text-primary",
|
|
405
|
+
children: h(e.createdAt)
|
|
406
|
+
})] })
|
|
407
|
+
]
|
|
408
|
+
}),
|
|
409
|
+
/* @__PURE__ */ E("div", {
|
|
410
|
+
className: "flex flex-wrap items-center gap-2",
|
|
411
|
+
children: [/* @__PURE__ */ E(O, {
|
|
412
|
+
variant: "outline",
|
|
413
|
+
size: "sm",
|
|
414
|
+
disabled: o || e.status === "ACKNOWLEDGED" || f,
|
|
415
|
+
onClick: r,
|
|
416
|
+
children: [/* @__PURE__ */ T(x, {
|
|
417
|
+
className: "size-4",
|
|
418
|
+
"aria-hidden": "true"
|
|
419
|
+
}), n("brainyrich.insights.actions.acknowledge", "Acknowledge")]
|
|
420
|
+
}), /* @__PURE__ */ E(O, {
|
|
421
|
+
size: "sm",
|
|
422
|
+
disabled: c || e.status === "RESOLVED",
|
|
423
|
+
onClick: a,
|
|
424
|
+
children: [/* @__PURE__ */ T(x, {
|
|
425
|
+
className: "size-4",
|
|
426
|
+
"aria-hidden": "true"
|
|
427
|
+
}), n("brainyrich.insights.actions.resolve", "Resolve")]
|
|
428
|
+
})]
|
|
429
|
+
})
|
|
430
|
+
]
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ T(d, {
|
|
433
|
+
open: p,
|
|
434
|
+
onOpenChange: m,
|
|
435
|
+
title: n("brainyrich.insights.dismiss.title", "Dismiss this insight?"),
|
|
436
|
+
description: n("brainyrich.insights.dismiss.description", "Dismissing removes this insight from active triage. You can still find it by filtering for dismissed insights."),
|
|
437
|
+
confirmLabel: n("brainyrich.insights.actions.dismiss", "Dismiss"),
|
|
438
|
+
pendingLabel: n("brainyrich.insights.dismiss.pending", "Dismissing…"),
|
|
439
|
+
destructive: !0,
|
|
440
|
+
pending: s,
|
|
441
|
+
onConfirm: i
|
|
442
|
+
})
|
|
443
|
+
] });
|
|
444
|
+
}
|
|
445
|
+
function ye({ open: e, form: t, setField: n, metricsValid: r, valid: i, pending: a, onSubmit: o, onOpenChange: s, translate: c }) {
|
|
446
|
+
return /* @__PURE__ */ T(j, {
|
|
447
|
+
open: e,
|
|
448
|
+
onOpenChange: s,
|
|
449
|
+
children: /* @__PURE__ */ E(M, {
|
|
450
|
+
className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
|
|
451
|
+
children: [/* @__PURE__ */ E(fe, { children: [/* @__PURE__ */ T(F, { children: c("brainyrich.insights.form.createTitle", "New insight") }), /* @__PURE__ */ T(N, { children: c("brainyrich.insights.form.subtitle", "Flag an advisory insight against a portfolio, account, goal or household.") })] }), /* @__PURE__ */ E("form", {
|
|
452
|
+
className: "space-y-4",
|
|
453
|
+
onSubmit: (e) => {
|
|
454
|
+
e.preventDefault(), o();
|
|
455
|
+
},
|
|
456
|
+
children: [
|
|
457
|
+
/* @__PURE__ */ E("div", {
|
|
458
|
+
className: "space-y-1.5",
|
|
459
|
+
children: [/* @__PURE__ */ T(H, {
|
|
460
|
+
htmlFor: "insight-title",
|
|
461
|
+
children: c("brainyrich.insights.form.title", "Title")
|
|
462
|
+
}), /* @__PURE__ */ T(V, {
|
|
463
|
+
id: "insight-title",
|
|
464
|
+
value: t.title,
|
|
465
|
+
onChange: (e) => n("title", e.target.value),
|
|
466
|
+
placeholder: c("brainyrich.insights.form.titlePlaceholder", "e.g. Technology concentration above threshold"),
|
|
467
|
+
required: !0
|
|
468
|
+
})]
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ E("div", {
|
|
471
|
+
className: "grid grid-cols-2 gap-3",
|
|
472
|
+
children: [/* @__PURE__ */ E("div", {
|
|
473
|
+
className: "space-y-1.5",
|
|
474
|
+
children: [/* @__PURE__ */ T(H, {
|
|
475
|
+
htmlFor: "insight-type",
|
|
476
|
+
children: c("brainyrich.insights.form.type", "Type")
|
|
477
|
+
}), /* @__PURE__ */ E(U, {
|
|
478
|
+
value: t.type,
|
|
479
|
+
onValueChange: (e) => n("type", e),
|
|
480
|
+
children: [/* @__PURE__ */ T(K, {
|
|
481
|
+
id: "insight-type",
|
|
482
|
+
children: /* @__PURE__ */ T(q, {})
|
|
483
|
+
}), /* @__PURE__ */ T(W, { children: pe.map((e) => /* @__PURE__ */ T(G, {
|
|
484
|
+
value: e,
|
|
485
|
+
children: X(e)
|
|
486
|
+
}, e)) })]
|
|
487
|
+
})]
|
|
488
|
+
}), /* @__PURE__ */ E("div", {
|
|
489
|
+
className: "space-y-1.5",
|
|
490
|
+
children: [/* @__PURE__ */ T(H, {
|
|
491
|
+
htmlFor: "insight-severity",
|
|
492
|
+
children: c("brainyrich.insights.form.severity", "Severity")
|
|
493
|
+
}), /* @__PURE__ */ E(U, {
|
|
494
|
+
value: t.severity,
|
|
495
|
+
onValueChange: (e) => n("severity", e),
|
|
496
|
+
children: [/* @__PURE__ */ T(K, {
|
|
497
|
+
id: "insight-severity",
|
|
498
|
+
children: /* @__PURE__ */ T(q, {})
|
|
499
|
+
}), /* @__PURE__ */ T(W, { children: me.map((e) => /* @__PURE__ */ T(G, {
|
|
500
|
+
value: e,
|
|
501
|
+
children: X(e)
|
|
502
|
+
}, e)) })]
|
|
503
|
+
})]
|
|
504
|
+
})]
|
|
505
|
+
}),
|
|
506
|
+
/* @__PURE__ */ T(f, {
|
|
507
|
+
id: "insight-subject",
|
|
508
|
+
label: c("brainyrich.insights.form.subject", "Subject"),
|
|
509
|
+
placeholder: c("brainyrich.insights.form.subjectPlaceholder", "Select an account, portfolio, goal or household"),
|
|
510
|
+
value: t.subject,
|
|
511
|
+
onChange: (e) => n("subject", e)
|
|
512
|
+
}),
|
|
513
|
+
/* @__PURE__ */ E("div", {
|
|
514
|
+
className: "space-y-1.5",
|
|
515
|
+
children: [/* @__PURE__ */ T(H, {
|
|
516
|
+
htmlFor: "insight-owner",
|
|
517
|
+
children: c("brainyrich.insights.form.ownerId", "Owner ID (optional)")
|
|
518
|
+
}), /* @__PURE__ */ T(V, {
|
|
519
|
+
id: "insight-owner",
|
|
520
|
+
value: t.ownerId,
|
|
521
|
+
onChange: (e) => n("ownerId", e.target.value),
|
|
522
|
+
placeholder: c("brainyrich.insights.form.ownerIdPlaceholder", "Defaults to the current owner")
|
|
523
|
+
})]
|
|
524
|
+
}),
|
|
525
|
+
/* @__PURE__ */ E("div", {
|
|
526
|
+
className: "space-y-1.5",
|
|
527
|
+
children: [/* @__PURE__ */ T(H, {
|
|
528
|
+
htmlFor: "insight-detail",
|
|
529
|
+
children: c("brainyrich.insights.form.detail", "Detail")
|
|
530
|
+
}), /* @__PURE__ */ T(J, {
|
|
531
|
+
id: "insight-detail",
|
|
532
|
+
value: t.detail,
|
|
533
|
+
onChange: (e) => n("detail", e.target.value),
|
|
534
|
+
rows: 3,
|
|
535
|
+
placeholder: c("brainyrich.insights.form.detailPlaceholder", "Explain the finding and recommended action.")
|
|
536
|
+
})]
|
|
537
|
+
}),
|
|
538
|
+
/* @__PURE__ */ E("div", {
|
|
539
|
+
className: "space-y-1.5",
|
|
180
540
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
183
|
-
children:
|
|
184
|
-
className: "text-muted-foreground",
|
|
185
|
-
children: L("brainyrich.aiAssistant.context.netWorth", "Net Worth")
|
|
186
|
-
}), /* @__PURE__ */ x("span", {
|
|
187
|
-
className: "font-medium",
|
|
188
|
-
children: V
|
|
189
|
-
})]
|
|
190
|
-
}),
|
|
191
|
-
/* @__PURE__ */ S("div", {
|
|
192
|
-
className: "flex items-center justify-between text-sm",
|
|
193
|
-
children: [/* @__PURE__ */ x("span", {
|
|
194
|
-
className: "text-muted-foreground",
|
|
195
|
-
children: L("brainyrich.aiAssistant.context.invested", "Invested")
|
|
196
|
-
}), /* @__PURE__ */ x("span", {
|
|
197
|
-
className: "font-medium",
|
|
198
|
-
children: r(j)
|
|
199
|
-
})]
|
|
541
|
+
/* @__PURE__ */ T(H, {
|
|
542
|
+
htmlFor: "insight-metrics",
|
|
543
|
+
children: c("brainyrich.insights.form.metrics", "Metrics JSON (optional)")
|
|
200
544
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
})]
|
|
545
|
+
/* @__PURE__ */ T(J, {
|
|
546
|
+
id: "insight-metrics",
|
|
547
|
+
value: t.metrics,
|
|
548
|
+
onChange: (e) => n("metrics", e.target.value),
|
|
549
|
+
rows: 3,
|
|
550
|
+
className: "font-mono text-xs",
|
|
551
|
+
placeholder: "{ \"driftPct\": 8.2 }",
|
|
552
|
+
"aria-invalid": !r
|
|
210
553
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
className: "flex items-center
|
|
213
|
-
children: [/* @__PURE__ */
|
|
214
|
-
className: "
|
|
215
|
-
|
|
216
|
-
}),
|
|
217
|
-
variant: v.some((e) => e.severity === "High") ? "destructive" : "secondary",
|
|
218
|
-
className: "text-[10px]",
|
|
219
|
-
children: L("brainyrich.aiAssistant.context.activeAlerts", "{count} active", { count: v.length })
|
|
220
|
-
})]
|
|
554
|
+
r ? null : /* @__PURE__ */ E("p", {
|
|
555
|
+
className: "flex items-center gap-1 text-xs text-status-error-text",
|
|
556
|
+
children: [/* @__PURE__ */ T(y, {
|
|
557
|
+
className: "size-3.5",
|
|
558
|
+
"aria-hidden": "true"
|
|
559
|
+
}), c("brainyrich.insights.form.metricsInvalid", "Enter valid JSON or leave blank.")]
|
|
221
560
|
})
|
|
222
561
|
]
|
|
562
|
+
}),
|
|
563
|
+
/* @__PURE__ */ E(P, { children: [/* @__PURE__ */ T(O, {
|
|
564
|
+
type: "button",
|
|
565
|
+
variant: "outline",
|
|
566
|
+
onClick: () => s(!1),
|
|
567
|
+
disabled: a,
|
|
568
|
+
children: c("brainyrich.insights.form.cancel", "Cancel")
|
|
569
|
+
}), /* @__PURE__ */ T(O, {
|
|
570
|
+
type: "submit",
|
|
571
|
+
disabled: !i || a,
|
|
572
|
+
children: a ? c("brainyrich.insights.form.saving", "Saving…") : c("brainyrich.insights.form.create", "Create insight")
|
|
223
573
|
})] })
|
|
224
574
|
]
|
|
225
|
-
}), /* @__PURE__ */ x("div", {
|
|
226
|
-
className: "flex flex-col lg:col-span-3",
|
|
227
|
-
children: /* @__PURE__ */ S(T, {
|
|
228
|
-
className: "flex flex-1 flex-col",
|
|
229
|
-
children: [
|
|
230
|
-
/* @__PURE__ */ x(O, {
|
|
231
|
-
className: "border-b py-3",
|
|
232
|
-
children: /* @__PURE__ */ S("div", {
|
|
233
|
-
className: "flex items-center justify-between",
|
|
234
|
-
children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S(k, {
|
|
235
|
-
className: "flex items-center gap-2 text-base",
|
|
236
|
-
children: [/* @__PURE__ */ x(s, { className: "h-5 w-5 text-blue-600" }), L("brainyrich.aiAssistant.chat.title", "Financial AI Assistant")]
|
|
237
|
-
}), /* @__PURE__ */ x(D, { children: L("brainyrich.aiAssistant.chat.description", "Real-time analysis and personalized wealth recommendations") })] }), /* @__PURE__ */ S("div", {
|
|
238
|
-
className: "flex items-center gap-2",
|
|
239
|
-
children: [/* @__PURE__ */ x(C, {
|
|
240
|
-
variant: "outline",
|
|
241
|
-
className: "border-green-200 text-green-600",
|
|
242
|
-
children: L("brainyrich.aiAssistant.status.online", "Online")
|
|
243
|
-
}), /* @__PURE__ */ S("div", {
|
|
244
|
-
className: "flex items-center gap-1 text-sm text-muted-foreground",
|
|
245
|
-
children: [/* @__PURE__ */ x("div", { className: "h-2 w-2 animate-pulse rounded-full bg-green-500" }), L("brainyrich.aiAssistant.status.active", "Active")]
|
|
246
|
-
})]
|
|
247
|
-
})]
|
|
248
|
-
})
|
|
249
|
-
}),
|
|
250
|
-
/* @__PURE__ */ S(E, {
|
|
251
|
-
className: "flex-1 space-y-4 overflow-y-auto p-4",
|
|
252
|
-
style: {
|
|
253
|
-
maxHeight: "calc(100vh - 520px)",
|
|
254
|
-
minHeight: "300px"
|
|
255
|
-
},
|
|
256
|
-
children: [
|
|
257
|
-
H.map((e) => /* @__PURE__ */ x("div", {
|
|
258
|
-
className: `flex ${e.sender === "user" ? "justify-end" : "justify-start"}`,
|
|
259
|
-
children: /* @__PURE__ */ S("div", {
|
|
260
|
-
className: `flex max-w-[80%] items-start gap-2 ${e.sender === "user" ? "flex-row-reverse" : ""}`,
|
|
261
|
-
children: [/* @__PURE__ */ x("div", {
|
|
262
|
-
className: `rounded-full p-2 ${e.sender === "user" ? "bg-primary/10" : "bg-blue-100"}`,
|
|
263
|
-
children: e.sender === "user" ? /* @__PURE__ */ x(y, { className: "h-4 w-4" }) : /* @__PURE__ */ x(s, { className: "h-4 w-4 text-blue-600" })
|
|
264
|
-
}), /* @__PURE__ */ S("div", {
|
|
265
|
-
className: `space-y-1 rounded-lg p-3 ${e.sender === "user" ? "bg-primary text-primary-foreground" : "bg-muted"}`,
|
|
266
|
-
children: [
|
|
267
|
-
/* @__PURE__ */ x("p", {
|
|
268
|
-
className: "text-sm",
|
|
269
|
-
children: e.content
|
|
270
|
-
}),
|
|
271
|
-
e.metadata?.relatedTopics ? /* @__PURE__ */ x("div", {
|
|
272
|
-
className: "flex flex-wrap gap-1 pt-1",
|
|
273
|
-
children: e.metadata.relatedTopics.map((e) => /* @__PURE__ */ x(C, {
|
|
274
|
-
variant: "outline",
|
|
275
|
-
className: "text-[10px]",
|
|
276
|
-
children: e
|
|
277
|
-
}, e))
|
|
278
|
-
}) : null,
|
|
279
|
-
/* @__PURE__ */ S("p", {
|
|
280
|
-
className: "text-[10px] opacity-60",
|
|
281
|
-
children: [e.timestamp.toLocaleTimeString([], {
|
|
282
|
-
hour: "2-digit",
|
|
283
|
-
minute: "2-digit"
|
|
284
|
-
}), e.metadata?.confidence ? ` · ${Math.round(e.metadata.confidence * 100)}% confidence` : ""]
|
|
285
|
-
})
|
|
286
|
-
]
|
|
287
|
-
})]
|
|
288
|
-
})
|
|
289
|
-
}, e.id)),
|
|
290
|
-
K ? /* @__PURE__ */ S("div", {
|
|
291
|
-
className: "flex items-center gap-2",
|
|
292
|
-
children: [/* @__PURE__ */ x("div", {
|
|
293
|
-
className: "rounded-full bg-blue-100 p-2",
|
|
294
|
-
children: /* @__PURE__ */ x(s, { className: "h-4 w-4 text-blue-600" })
|
|
295
|
-
}), /* @__PURE__ */ x("div", {
|
|
296
|
-
className: "rounded-lg bg-muted p-3",
|
|
297
|
-
children: /* @__PURE__ */ S("div", {
|
|
298
|
-
className: "flex space-x-1",
|
|
299
|
-
children: [
|
|
300
|
-
/* @__PURE__ */ x("div", { className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40" }),
|
|
301
|
-
/* @__PURE__ */ x("div", {
|
|
302
|
-
className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40",
|
|
303
|
-
style: { animationDelay: "0.1s" }
|
|
304
|
-
}),
|
|
305
|
-
/* @__PURE__ */ x("div", {
|
|
306
|
-
className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40",
|
|
307
|
-
style: { animationDelay: "0.2s" }
|
|
308
|
-
})
|
|
309
|
-
]
|
|
310
|
-
})
|
|
311
|
-
})]
|
|
312
|
-
}) : null,
|
|
313
|
-
/* @__PURE__ */ x("div", { ref: X })
|
|
314
|
-
]
|
|
315
|
-
}),
|
|
316
|
-
H.length <= 1 ? /* @__PURE__ */ S("div", {
|
|
317
|
-
className: "border-t px-4 py-3",
|
|
318
|
-
children: [/* @__PURE__ */ S("p", {
|
|
319
|
-
className: "mb-2 flex items-center gap-1 text-xs text-muted-foreground",
|
|
320
|
-
children: [/* @__PURE__ */ x(_, { className: "h-3 w-3" }), L("brainyrich.aiAssistant.sections.suggestedQuestions", "Suggested questions")]
|
|
321
|
-
}), /* @__PURE__ */ x("div", {
|
|
322
|
-
className: "grid gap-2 sm:grid-cols-2",
|
|
323
|
-
children: B.map((e) => /* @__PURE__ */ S("button", {
|
|
324
|
-
type: "button",
|
|
325
|
-
className: "flex items-center gap-2 rounded-md border p-2 text-left text-sm transition-colors hover:bg-accent",
|
|
326
|
-
onClick: () => $(e.text),
|
|
327
|
-
children: [/* @__PURE__ */ x(e.icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), e.text]
|
|
328
|
-
}, e.text))
|
|
329
|
-
})]
|
|
330
|
-
}) : null,
|
|
331
|
-
/* @__PURE__ */ S("div", {
|
|
332
|
-
className: "border-t p-4",
|
|
333
|
-
children: [/* @__PURE__ */ S("div", {
|
|
334
|
-
className: "flex items-center gap-2",
|
|
335
|
-
children: [/* @__PURE__ */ S("div", {
|
|
336
|
-
className: "relative flex-1",
|
|
337
|
-
children: [/* @__PURE__ */ x(A, {
|
|
338
|
-
ref: Z,
|
|
339
|
-
value: W,
|
|
340
|
-
onChange: (e) => G(e.target.value),
|
|
341
|
-
onKeyDown: (e) => {
|
|
342
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q());
|
|
343
|
-
},
|
|
344
|
-
placeholder: L("brainyrich.aiAssistant.input.placeholder", "Ask about investments, taxes, retirement, estate planning..."),
|
|
345
|
-
className: "pr-20"
|
|
346
|
-
}), /* @__PURE__ */ S("div", {
|
|
347
|
-
className: "absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-1",
|
|
348
|
-
children: [/* @__PURE__ */ x(w, {
|
|
349
|
-
variant: "ghost",
|
|
350
|
-
size: "icon",
|
|
351
|
-
className: "h-7 w-7",
|
|
352
|
-
children: /* @__PURE__ */ x(p, { className: "h-4 w-4" })
|
|
353
|
-
}), /* @__PURE__ */ x(w, {
|
|
354
|
-
variant: "ghost",
|
|
355
|
-
size: "icon",
|
|
356
|
-
className: "h-7 w-7",
|
|
357
|
-
children: /* @__PURE__ */ x(f, { className: "h-4 w-4" })
|
|
358
|
-
})]
|
|
359
|
-
})]
|
|
360
|
-
}), /* @__PURE__ */ x(w, {
|
|
361
|
-
onClick: Q,
|
|
362
|
-
disabled: !W.trim() || K,
|
|
363
|
-
size: "sm",
|
|
364
|
-
children: /* @__PURE__ */ x(g, { className: "h-4 w-4" })
|
|
365
|
-
})]
|
|
366
|
-
}), /* @__PURE__ */ S("div", {
|
|
367
|
-
className: "mt-2 flex items-center justify-between text-xs text-muted-foreground",
|
|
368
|
-
children: [/* @__PURE__ */ S("span", {
|
|
369
|
-
className: "flex items-center gap-1",
|
|
370
|
-
children: [/* @__PURE__ */ x(d, { className: "h-3 w-3" }), L("brainyrich.aiAssistant.disclaimer", "AI can make mistakes. Always verify important financial information.")]
|
|
371
|
-
}), /* @__PURE__ */ S("span", {
|
|
372
|
-
className: "flex items-center gap-1",
|
|
373
|
-
children: [/* @__PURE__ */ x("kbd", {
|
|
374
|
-
className: "rounded bg-muted px-1.5 py-0.5 text-[10px]",
|
|
375
|
-
children: "Enter"
|
|
376
|
-
}), L("brainyrich.aiAssistant.input.toSend", "to send")]
|
|
377
|
-
})]
|
|
378
|
-
})]
|
|
379
|
-
})
|
|
380
|
-
]
|
|
381
|
-
})
|
|
382
575
|
})]
|
|
383
576
|
})
|
|
384
577
|
});
|
|
385
578
|
}
|
|
386
579
|
//#endregion
|
|
387
|
-
export {
|
|
580
|
+
export { Z as AiAssistantPage };
|
|
388
581
|
|
|
389
582
|
//# sourceMappingURL=AiAssistantPage.js.map
|