@mx-cartographer/experiences 6.26.33-alpha.mm0 → 7.0.0-alpha.mega1
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/CHANGELOG.md +2 -3
- package/dist/Account-DY6nxO7y.mjs +30 -0
- package/dist/AccountDetailsContent-DvPs81kL.mjs +677 -0
- package/dist/AccountDetailsHeader-W2U7ZVm_.mjs +119 -0
- package/dist/AccountFields-DAVcbZy5.mjs +135 -0
- package/dist/AccountListItem-DFlbdcmT.mjs +90 -0
- package/dist/AccountStore-CU7qV3vg.mjs +230 -0
- package/dist/Accounts-BLlrQA5m.mjs +9 -0
- package/dist/BeatApi-DLu87ijw.mjs +21 -0
- package/dist/BeatStore-By4aGoRM.mjs +81 -0
- package/dist/BudgetUtil-Ci1TN0J5.mjs +101 -0
- package/dist/CashflowStore-D9Dpuz7X.mjs +91 -0
- package/dist/Category-5S6uwuXz.mjs +301 -0
- package/dist/CategorySelectorDrawer-rHyHHYuh.mjs +397 -0
- package/dist/CategoryStore-B5EW6I1d.mjs +183 -0
- package/dist/CategoryUtil-DRyruNgi.mjs +78 -0
- package/dist/ConnectDrawer-D9cR5phc.mjs +508 -0
- package/dist/ConnectionsDrawer-BzGqljSp.mjs +52 -0
- package/dist/CurrencyInput-D74cemI2.mjs +83 -0
- package/dist/CurrencyText-YUhH2caW.mjs +20 -0
- package/dist/DateUtil-BcuH7ErC.mjs +48 -0
- package/dist/DebtsStore-S0l9kr0r.mjs +60 -0
- package/dist/Dialog-CWW597AF.mjs +123 -0
- package/dist/Donut-1UMNcG67.mjs +57 -0
- package/dist/Drawer-kEE73B87.mjs +113 -0
- package/dist/EmptyState-Dcb-o2tl.mjs +55 -0
- package/dist/Fetch-CkFKy79O.mjs +116 -0
- package/dist/FinstrongStore-mkALvztw.mjs +101 -0
- package/dist/GoalStore-DioeeL-s.mjs +263 -0
- package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
- package/dist/Help-DhcC-C05.mjs +320 -0
- package/dist/Help-DpYRO8oA.mjs +3181 -0
- package/dist/IconBacking-B9oC6uL2.mjs +39 -0
- package/dist/InvestmentUtil-jOyOgzIB.mjs +134 -0
- package/dist/LineChart-CcyX38kK.mjs +499 -0
- package/dist/ListItemAction-BabpYivr.mjs +69 -0
- package/dist/Loader-Dp1P2gNw.mjs +14 -0
- package/dist/Localization-2MODESHW.mjs +30 -0
- package/dist/ManageIncome-ndMuhJMG.mjs +535 -0
- package/dist/MerchantStore-DVH-QOf0.mjs +37 -0
- package/dist/MicroWidgetContainer-CsvHLYKX.mjs +45 -0
- package/dist/MiniWidgetContainer-BoOp-A05.mjs +39 -0
- package/dist/NetWorthStore-PD-RUe09.mjs +150 -0
- package/dist/Notification-AMGWM1Al.mjs +78 -0
- package/dist/NotificationSettings-VhHuMAFU.mjs +667 -0
- package/dist/NotificationStore-DHtSGySy.mjs +67 -0
- package/dist/NumberFormatting-CtWHhyBX.mjs +40 -0
- package/dist/OriginalBalanceAction-D39mx6uE.mjs +115 -0
- package/dist/RecurringSettings-D_HnMYZP.mjs +57 -0
- package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +263 -0
- package/dist/RepeatingTransaction-BPWfaB3f.mjs +282 -0
- package/dist/SearchBox-B2_zLv8-.mjs +42 -0
- package/dist/SettingsStore-CE7jDVFL.mjs +265 -0
- package/dist/SingleSegmentDonut-BgbLgwHi.mjs +69 -0
- package/dist/SpendingData-BkrxzHdr.mjs +55 -0
- package/dist/StatusBar-BK_uYHAB.mjs +30 -0
- package/dist/TabContentContainer-j01JYR_7.mjs +21 -0
- package/dist/Transaction-CA0FW2Ij.mjs +312 -0
- package/dist/TransactionApi-DbbcjI2L.mjs +86 -0
- package/dist/TransactionDetails-WBHFmbxL.mjs +1283 -0
- package/dist/TransactionStore-CeLdmVnC.mjs +669 -0
- package/dist/TrendsStore-BHJUapXF.mjs +487 -0
- package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +1959 -0
- package/dist/WidgetContainer-DWCusxYI.mjs +556 -0
- package/dist/accounts/index.es.js +752 -0
- package/dist/analytics/index.es.js +171 -0
- package/dist/budgets/index.es.js +1075 -0
- package/dist/cashflow/index.es.js +1098 -0
- package/dist/categories/index.es.js +9 -0
- package/dist/common/components/WidgetContainer.d.ts +1 -1
- package/dist/common/components/charts/LineChart.d.ts +0 -1
- package/dist/common/constants/Analytics.d.ts +10 -20
- package/dist/common/context/hooks.d.ts +13 -13
- package/dist/common/index.es.js +1451 -0
- package/dist/dashboard/index.es.js +181 -0
- package/dist/debts/index.es.js +1460 -0
- package/dist/exportTransactionsToCSV-CmwsKl2D.mjs +47 -0
- package/dist/finstrong/index.es.js +1455 -0
- package/dist/goals/index.es.js +1209 -0
- package/dist/help/components/content/section/index.d.ts +15 -15
- package/dist/help/index.es.js +14 -0
- package/dist/hooks-30y_BLwc.mjs +71 -0
- package/dist/index.d.ts +0 -22
- package/dist/insights/index.d.ts +1 -0
- package/dist/insights/index.es.js +4 -0
- package/dist/investments/index.es.js +1638 -0
- package/dist/merchants/index.es.js +79 -0
- package/dist/microinsights/components/carouselheader/CarouselHeader.d.ts +0 -1
- package/dist/microinsights/components/microBeatCarousel/MicroBeatCarousel.d.ts +0 -1
- package/dist/microinsights/index.es.js +16 -0
- package/dist/networth/index.es.js +576 -0
- package/dist/notifications/index.es.js +192 -0
- package/dist/recurringtransactions/index.es.js +879 -0
- package/dist/settings/index.es.js +879 -0
- package/dist/spending/index.es.js +570 -0
- package/dist/transactions/index.es.js +587 -0
- package/dist/trends/index.es.js +1086 -0
- package/dist/useCombineEvents-DaDBSR_1.mjs +92 -0
- package/dist/useDimensions-27p2evRx.mjs +36 -0
- package/dist/useScreenSize-B6JyS_Lj.mjs +36 -0
- package/package.json +155 -3
- package/dist/index.es.js +0 -30564
- package/dist/index.es.js.map +0 -1
- package/dist/trends/constants/TrendsWidget.d.ts +0 -3
@@ -0,0 +1,79 @@
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
2
|
+
import s from "react";
|
3
|
+
import { observer as y } from "mobx-react-lite";
|
4
|
+
import { useVirtualizer as _ } from "@tanstack/react-virtual";
|
5
|
+
import m from "@mui/material/Box";
|
6
|
+
import I from "@mui/material/Divider";
|
7
|
+
import z from "@mui/material/List";
|
8
|
+
import E from "@mui/material/ListItem";
|
9
|
+
import G from "@mui/material/ListItemAvatar";
|
10
|
+
import T from "@mui/material/ListItemButton";
|
11
|
+
import k from "@mui/material/ListItemText";
|
12
|
+
import A from "@mui/material/Paper";
|
13
|
+
import d from "@mui/material/Stack";
|
14
|
+
import { MerchantLogo as V, Text as R } from "@mxenabled/mxui";
|
15
|
+
import { b as v, u as w, a as C } from "../hooks-30y_BLwc.mjs";
|
16
|
+
import { L as p } from "../Loader-Dp1P2gNw.mjs";
|
17
|
+
import { S as N } from "../SearchBox-B2_zLv8-.mjs";
|
18
|
+
import { M as ne } from "../MerchantStore-DVH-QOf0.mjs";
|
19
|
+
const B = /^[ a-zA-ZÀ-ÿ0-9]+$/, H = 50, u = 65, P = ({
|
20
|
+
height: f = "calc(100dvh - 120px)",
|
21
|
+
onSelect: g
|
22
|
+
}) => {
|
23
|
+
const { isLoading: l, merchants: o, loadMerchants: c } = v(), { common: a } = w(), { isCopyLoaded: L } = C(), [x, S] = s.useState("");
|
24
|
+
s.useEffect(() => {
|
25
|
+
c().finally();
|
26
|
+
}, [c]);
|
27
|
+
const b = (t) => {
|
28
|
+
g(t);
|
29
|
+
}, M = async (t) => {
|
30
|
+
(!t || B.test(t)) && t.length <= H && (S(t), await c(t));
|
31
|
+
}, h = s.useRef(null), i = _({
|
32
|
+
count: o.length,
|
33
|
+
getScrollElement: () => h.current,
|
34
|
+
estimateSize: () => u,
|
35
|
+
overscan: 5
|
36
|
+
});
|
37
|
+
return s.useEffect(() => i.measure(), [o]), L ? /* @__PURE__ */ r(d, { className: "mx-mrt-lookup", children: [
|
38
|
+
/* @__PURE__ */ e(
|
39
|
+
N,
|
40
|
+
{
|
41
|
+
ariaLabel: a.search_aria,
|
42
|
+
cancelAriaLabel: a.cancel_search_aria,
|
43
|
+
onChange: M,
|
44
|
+
placeholder: a.search_placeholder,
|
45
|
+
searchValue: x
|
46
|
+
}
|
47
|
+
),
|
48
|
+
/* @__PURE__ */ e(A, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(z, { children: /* @__PURE__ */ r(m, { height: f, overflow: "auto", ref: h, children: [
|
49
|
+
/* @__PURE__ */ r(m, { height: i.getTotalSize(), position: "relative", children: [
|
50
|
+
l && /* @__PURE__ */ e(p, { label: "Loading...", size: 32 }),
|
51
|
+
!l && i.getVirtualItems().length > 0 && i.getVirtualItems().map((t) => {
|
52
|
+
const n = o[t.index];
|
53
|
+
return /* @__PURE__ */ r(
|
54
|
+
m,
|
55
|
+
{
|
56
|
+
height: u,
|
57
|
+
position: "absolute",
|
58
|
+
sx: { transform: `translateY(${t.start}px)` },
|
59
|
+
width: "100%",
|
60
|
+
children: [
|
61
|
+
/* @__PURE__ */ e(E, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ r(T, { onClick: () => b(n.guid), children: [
|
62
|
+
/* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(V, { categoryGuid: "", merchantGuid: n.guid }) }),
|
63
|
+
/* @__PURE__ */ e(k, { primary: n.name })
|
64
|
+
] }) }),
|
65
|
+
/* @__PURE__ */ e(I, { sx: { ml: 24 } })
|
66
|
+
]
|
67
|
+
},
|
68
|
+
n.guid
|
69
|
+
);
|
70
|
+
})
|
71
|
+
] }),
|
72
|
+
!o.length && /* @__PURE__ */ e(d, { alignItems: "center", my: 24, children: /* @__PURE__ */ e(R, { bold: !0, color: "secondary", variant: "Small", children: a.search_zero_state }) })
|
73
|
+
] }) }) })
|
74
|
+
] }) : /* @__PURE__ */ e(p, {});
|
75
|
+
}, oe = y(P);
|
76
|
+
export {
|
77
|
+
oe as MerchantLookup,
|
78
|
+
ne as MerchantStore
|
79
|
+
};
|
@@ -2,7 +2,6 @@ import { default as React } from 'react';
|
|
2
2
|
import { Beat } from '../../../common/types/Beat';
|
3
3
|
import { clientColorSchemeProps, TheWholeHog } from '../../interfaces';
|
4
4
|
export interface CarouselHeaderProps {
|
5
|
-
analyticsMetadata?: object;
|
6
5
|
clientColorScheme?: clientColorSchemeProps;
|
7
6
|
onCardClick: (beat?: Beat | undefined) => void;
|
8
7
|
posthog?: TheWholeHog;
|
@@ -2,7 +2,6 @@ import { default as React } from 'react';
|
|
2
2
|
import { MicroWidgetProps } from '../../';
|
3
3
|
import { Beat } from '../../../common/types/Beat';
|
4
4
|
export interface MicroBeatCarouselProps extends MicroWidgetProps {
|
5
|
-
analyticsMetadata?: object;
|
6
5
|
beats?: Beat[];
|
7
6
|
showCarouselControls?: boolean;
|
8
7
|
visibleCardsCount?: number;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { A as s, B as e, C as o, c as t, b as i, I as d, M as n, a as C, d as c, N as I, V as M, Z as g, e as h } from "../ViewMoreMicroCard-CAPFNz-J.mjs";
|
2
|
+
export {
|
3
|
+
s as AppStore,
|
4
|
+
e as BeatCard,
|
5
|
+
o as CarouselHeader,
|
6
|
+
t as ChartFilledIcon,
|
7
|
+
i as InsightsMicroWidget,
|
8
|
+
d as InsightsMicroWidgetDataProvider,
|
9
|
+
n as MicroBeatCarousel,
|
10
|
+
C as MicroInsightCard,
|
11
|
+
c as MonthlySpendComparisonIcon,
|
12
|
+
I as NoRelevantInsightsCard,
|
13
|
+
M as ViewMoreMicroCard,
|
14
|
+
g as ZeroStateCard,
|
15
|
+
h as ZeroStateIcon
|
16
|
+
};
|
@@ -0,0 +1,576 @@
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as v } from "react/jsx-runtime";
|
2
|
+
import { fromUnixTime as Se } from "date-fns/fromUnixTime";
|
3
|
+
import { observer as w } from "mobx-react-lite";
|
4
|
+
import { useTheme as z } from "@mui/material/styles";
|
5
|
+
import { u as Z } from "../useScreenSize-B6JyS_Lj.mjs";
|
6
|
+
import { p as _e, u as T, c as J, g as Q, a as P, q as ee } from "../hooks-30y_BLwc.mjs";
|
7
|
+
import { f as we, D as be } from "../Dialog-CWW597AF.mjs";
|
8
|
+
import { L as We } from "../LineChart-CcyX38kK.mjs";
|
9
|
+
import W from "@mui/material/Divider";
|
10
|
+
import B from "@mui/material/List";
|
11
|
+
import E from "@mui/material/ListSubheader";
|
12
|
+
import h from "@mui/material/Stack";
|
13
|
+
import { Text as m, Icon as H, H1 as ve, P as Ie } from "@mxenabled/mxui";
|
14
|
+
import d from "react";
|
15
|
+
import k from "@mui/material/ListItem";
|
16
|
+
import te from "@mui/material/ListItemButton";
|
17
|
+
import _ from "@mui/material/ListItemText";
|
18
|
+
import { i as ne } from "../DateUtil-BcuH7ErC.mjs";
|
19
|
+
import { C as y } from "../CurrencyText-YUhH2caW.mjs";
|
20
|
+
import { Button as Te, Stack as Le } from "@mui/material";
|
21
|
+
import { format as Ne, fromUnixTime as De, differenceInMonths as Ee } from "date-fns";
|
22
|
+
import { g as K } from "../NetWorthStore-PD-RUe09.mjs";
|
23
|
+
import { N as Ot } from "../NetWorthStore-PD-RUe09.mjs";
|
24
|
+
import { Icon as oe } from "@mxenabled/mx-icons";
|
25
|
+
import { f as U } from "../NumberFormatting-CtWHhyBX.mjs";
|
26
|
+
import { A as b, W as ke } from "../WidgetContainer-DWCusxYI.mjs";
|
27
|
+
import { L as O } from "../Loader-Dp1P2gNw.mjs";
|
28
|
+
import { M as Ae } from "../MicroWidgetContainer-CsvHLYKX.mjs";
|
29
|
+
import re from "@mui/material/Box";
|
30
|
+
import { C as Me } from "../ConnectionsDrawer-BzGqljSp.mjs";
|
31
|
+
import He from "@mui/material/Collapse";
|
32
|
+
import V from "@mui/material/ListItemIcon";
|
33
|
+
import ie from "@mui/material/styles/useTheme";
|
34
|
+
import { E as Be } from "../EmptyState-Dcb-o2tl.mjs";
|
35
|
+
import { D as Y } from "../Drawer-kEE73B87.mjs";
|
36
|
+
const Oe = ({
|
37
|
+
chartData: t,
|
38
|
+
hoveredData: l,
|
39
|
+
onDataClick: i,
|
40
|
+
onMouseEnter: n,
|
41
|
+
onMouseLeave: a,
|
42
|
+
selectedData: o
|
43
|
+
}) => {
|
44
|
+
const { isMobile: s } = Z(), { availableWidth: c } = _e(), u = z(), C = c - 320, x = t.map((f) => ({
|
45
|
+
x: we(Se(f.x), be.MONTH_SHORT),
|
46
|
+
y: f.y
|
47
|
+
})), g = o ? { index: t.findIndex((f) => f.x === o.x) } : void 0, S = l ? { index: t.findIndex((f) => f.x === l.x) } : void 0, p = (f) => ({
|
48
|
+
fill: f === g?.index ? u.palette.success.main : "",
|
49
|
+
filter: f === S?.index ? `drop-shadow(0px 0px 10px ${u.palette.success.main})` : "none",
|
50
|
+
stroke: u.palette.success.main
|
51
|
+
});
|
52
|
+
return /* @__PURE__ */ e(
|
53
|
+
We,
|
54
|
+
{
|
55
|
+
baseline: "min",
|
56
|
+
colors: [u.palette.success.main],
|
57
|
+
datasets: [x],
|
58
|
+
height: 350,
|
59
|
+
labels: [],
|
60
|
+
margin: { right: 20 },
|
61
|
+
markHandlers: { onMarkClick: i, onMouseEnter: n, onMouseLeave: a },
|
62
|
+
markStyles: p,
|
63
|
+
showArea: !0,
|
64
|
+
useCustomMark: !0,
|
65
|
+
valueFormatterString: "0,0a",
|
66
|
+
width: s ? 320 : C
|
67
|
+
}
|
68
|
+
);
|
69
|
+
}, ze = w(Oe), Re = ({
|
70
|
+
item: t,
|
71
|
+
getStyles: l,
|
72
|
+
isHovered: i = !1,
|
73
|
+
isSelected: n = !1,
|
74
|
+
onItemClick: a,
|
75
|
+
onMouseEnter: o,
|
76
|
+
onMouseLeave: s
|
77
|
+
}) => {
|
78
|
+
const [c, u] = d.useState({
|
79
|
+
color: ""
|
80
|
+
});
|
81
|
+
return d.useEffect(() => {
|
82
|
+
u(l(t));
|
83
|
+
}, [i, n]), /* @__PURE__ */ r(d.Fragment, { children: [
|
84
|
+
/* @__PURE__ */ e(
|
85
|
+
k,
|
86
|
+
{
|
87
|
+
sx: {
|
88
|
+
...c,
|
89
|
+
minHeight: 44,
|
90
|
+
"&:hover": { color: n ? "inherit" : c.color }
|
91
|
+
},
|
92
|
+
children: /* @__PURE__ */ e(
|
93
|
+
te,
|
94
|
+
{
|
95
|
+
onClick: (C) => a?.(C, t.x),
|
96
|
+
onMouseEnter: () => o(t.x),
|
97
|
+
onMouseLeave: () => s(),
|
98
|
+
sx: { minHeight: 20, padding: 12 },
|
99
|
+
children: /* @__PURE__ */ e(
|
100
|
+
_,
|
101
|
+
{
|
102
|
+
primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", sx: { fontWeight: 400 }, children: [
|
103
|
+
/* @__PURE__ */ e(m, { variant: "Body", children: ne(t.x) }),
|
104
|
+
/* @__PURE__ */ e(y, { amount: t.y, sx: { color: "inherit" }, variant: "Body" })
|
105
|
+
] })
|
106
|
+
}
|
107
|
+
)
|
108
|
+
}
|
109
|
+
)
|
110
|
+
}
|
111
|
+
),
|
112
|
+
/* @__PURE__ */ e(W, {})
|
113
|
+
] }, t.x);
|
114
|
+
}, je = w(Re), $e = ({
|
115
|
+
chartData: t,
|
116
|
+
hoveredData: l,
|
117
|
+
onDataClick: i,
|
118
|
+
onButtonClick: n,
|
119
|
+
onMouseEnter: a,
|
120
|
+
onMouseLeave: o,
|
121
|
+
selectedData: s
|
122
|
+
}) => {
|
123
|
+
const { net_worth: c } = T(), u = z(), C = (x) => {
|
124
|
+
const g = x.x === l?.x, S = x.x === s?.x, p = {
|
125
|
+
backgroundColor: "inherit",
|
126
|
+
borderBottom: "inherit",
|
127
|
+
color: "inherit"
|
128
|
+
};
|
129
|
+
return g && (p.color = S ? "inherit" : p.color, p.backgroundColor = u.palette.action.hover), S && (p.backgroundColor = u.palette.primary.main, p.borderBottom = u.palette.border.light, p.color = u.palette.common.white), p;
|
130
|
+
};
|
131
|
+
return /* @__PURE__ */ r(h, { direction: "column", sx: { width: 320 }, children: [
|
132
|
+
/* @__PURE__ */ r(B, { children: [
|
133
|
+
/* @__PURE__ */ e(E, { sx: { backgroundColor: "transparent", mb: 8, mt: 12, px: 12 }, children: /* @__PURE__ */ e(m, { bold: !0, component: "h2", variant: "Body", children: c.monthly_totals }) }),
|
134
|
+
/* @__PURE__ */ e(W, {}),
|
135
|
+
t.map((x, g) => /* @__PURE__ */ e(
|
136
|
+
je,
|
137
|
+
{
|
138
|
+
getStyles: C,
|
139
|
+
isHovered: x.x === l?.x,
|
140
|
+
isSelected: x.x === s?.x,
|
141
|
+
item: x,
|
142
|
+
onItemClick: (S) => i(S, g),
|
143
|
+
onMouseEnter: () => a(g),
|
144
|
+
onMouseLeave: () => o()
|
145
|
+
},
|
146
|
+
x.x
|
147
|
+
))
|
148
|
+
] }),
|
149
|
+
/* @__PURE__ */ e(
|
150
|
+
Te,
|
151
|
+
{
|
152
|
+
onClick: () => n(),
|
153
|
+
sx: { alignSelf: "center", marginTop: 16, width: "fit-content" },
|
154
|
+
variant: "outlined",
|
155
|
+
children: c.view_assets_and_liabilities
|
156
|
+
}
|
157
|
+
)
|
158
|
+
] });
|
159
|
+
}, Ge = w($e), Fe = ({
|
160
|
+
currencyLabel: t,
|
161
|
+
currencyVariant: l = "Small",
|
162
|
+
iconSize: i,
|
163
|
+
netWorth: n,
|
164
|
+
theme: a
|
165
|
+
}) => {
|
166
|
+
let o = a.palette.secondary.main, s = a.palette.secondary.main, c = "trending_flat";
|
167
|
+
return n.change < 0 ? c = "trending_down" : n.change > 0 && (o = a.palette.success.main, s = a.palette.success.main, c = "trending_up"), /* @__PURE__ */ r(Le, { alignItems: "center", direction: "row", spacing: 4, children: [
|
168
|
+
/* @__PURE__ */ e(
|
169
|
+
H,
|
170
|
+
{
|
171
|
+
name: c,
|
172
|
+
size: i,
|
173
|
+
sx: {
|
174
|
+
color: o
|
175
|
+
}
|
176
|
+
}
|
177
|
+
),
|
178
|
+
/* @__PURE__ */ e(y, { amount: n.change, color: s, variant: l }),
|
179
|
+
/* @__PURE__ */ e(m, { variant: "Small", children: t })
|
180
|
+
] });
|
181
|
+
}, R = w(Fe), Xe = ({ hoveredData: t, selectedData: l }) => {
|
182
|
+
const { net_worth: i } = T(), n = z(), a = t || l, o = Ne(De(a.x), "MMMM");
|
183
|
+
return /* @__PURE__ */ r(h, { alignItems: "center", direction: "column", m: 24, children: [
|
184
|
+
/* @__PURE__ */ e(m, { color: n.palette.secondary.main, variant: "Small", children: `${o} ${i.net_worth}` }),
|
185
|
+
/* @__PURE__ */ e(y, { amount: a.y, variant: "H2" }),
|
186
|
+
/* @__PURE__ */ e(R, { currencyLabel: i.this_month, netWorth: a, theme: n })
|
187
|
+
] });
|
188
|
+
}, Ke = w(Xe), Ue = ({ amount: t, copy: l, trendValue: i }) => {
|
189
|
+
const n = i > 0, o = i === 0 ? "trending_flat" : n ? "trending_up" : "trending_down";
|
190
|
+
return /* @__PURE__ */ r(h, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
|
191
|
+
/* @__PURE__ */ e(ve, { children: U(t, "0,0") }),
|
192
|
+
t !== 0 && /* @__PURE__ */ r(h, { sx: { color: n ? "success.main" : "text.secondary" }, children: [
|
193
|
+
/* @__PURE__ */ r(h, { sx: { flexDirection: "row", gap: 8 }, children: [
|
194
|
+
/* @__PURE__ */ e(oe, { name: o, size: 20 }),
|
195
|
+
/* @__PURE__ */ e(m, { sx: { fontWeight: 600, textAlign: "right" }, variant: "body1", children: U(i, "0,0.00") })
|
196
|
+
] }),
|
197
|
+
/* @__PURE__ */ e(m, { sx: { display: "block", textAlign: "right" }, variant: "caption", children: l.this_month })
|
198
|
+
] })
|
199
|
+
] });
|
200
|
+
}, Ve = ({ copy: t }) => /* @__PURE__ */ r(h, { sx: { flexDirection: "row", gap: 12 }, children: [
|
201
|
+
/* @__PURE__ */ e(oe, { name: "elevation", size: 32, sx: { color: "text.primary" } }),
|
202
|
+
/* @__PURE__ */ r(h, { children: [
|
203
|
+
/* @__PURE__ */ e(m, { sx: { display: "block", fontWeight: 600 }, variant: "body1", children: t.empty_widget_header }),
|
204
|
+
/* @__PURE__ */ e(Ie, { sx: { color: "text.secondary" }, variant: "body2", children: t.zero_state_description })
|
205
|
+
] })
|
206
|
+
] }), At = w(({ onCTAClick: t }) => {
|
207
|
+
const [l, i] = d.useState(!1), { visibleAccounts: n } = J(), { onEvent: a } = Q(), { net_worth: o, common: s } = T(), { isInitialized: c, selectedAccounts: u, setSelectedAccounts: C } = P(), { loadChartData: x, loadNetWorthData: g, netWorthData: S, selectedData: p } = ee(), f = async () => {
|
208
|
+
await g(u), await x(1), i(!0);
|
209
|
+
};
|
210
|
+
if (d.useEffect(() => C(n), [n]), d.useEffect(() => {
|
211
|
+
c && f().finally(), a(b.NET_WORTH_LOAD_WIDGET, {
|
212
|
+
state: n?.length ? "default" : "zeroState"
|
213
|
+
});
|
214
|
+
}, [c]), !l) return /* @__PURE__ */ e(O, { height: 100 });
|
215
|
+
const L = () => {
|
216
|
+
a(
|
217
|
+
n.length ? b.NET_WORTH_CLICK_VIEW_DETAILS : b.NET_WORTH_CLICK_GET_STARTED
|
218
|
+
), t();
|
219
|
+
};
|
220
|
+
return /* @__PURE__ */ e(
|
221
|
+
Ae,
|
222
|
+
{
|
223
|
+
className: "mx-networth-microwidget",
|
224
|
+
ctaLabel: s.see_details,
|
225
|
+
onCTAClick: L,
|
226
|
+
title: o.net_worth,
|
227
|
+
children: S.accounts.length ? /* @__PURE__ */ e(
|
228
|
+
Ue,
|
229
|
+
{
|
230
|
+
amount: p?.y,
|
231
|
+
copy: o,
|
232
|
+
trendValue: p?.change
|
233
|
+
}
|
234
|
+
) : /* @__PURE__ */ e(Ve, { copy: o })
|
235
|
+
}
|
236
|
+
);
|
237
|
+
}), Ye = ({ accounts: t, name: l, icon: i }) => {
|
238
|
+
const [n, a] = d.useState(!1);
|
239
|
+
return /* @__PURE__ */ r(v, { children: [
|
240
|
+
/* @__PURE__ */ e(k, { sx: (o) => ({ backgroundColor: o.palette.background.paper }), children: /* @__PURE__ */ r(te, { onClick: () => a(!n), children: [
|
241
|
+
i && /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(H, { name: i, size: 24, sx: { mr: 12 } }) }),
|
242
|
+
/* @__PURE__ */ e(
|
243
|
+
_,
|
244
|
+
{
|
245
|
+
primary: /* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "Body", children: l })
|
246
|
+
}
|
247
|
+
),
|
248
|
+
/* @__PURE__ */ e(V, { children: n ? /* @__PURE__ */ e(H, { name: "expand_less", size: 24 }) : /* @__PURE__ */ e(H, { name: "expand_more", size: 24 }) })
|
249
|
+
] }) }),
|
250
|
+
/* @__PURE__ */ e(W, {}),
|
251
|
+
/* @__PURE__ */ e(He, { in: n, timeout: "auto", unmountOnExit: !0, children: t.map((o, s) => /* @__PURE__ */ r(B, { children: [
|
252
|
+
/* @__PURE__ */ e(k, { sx: () => ({ py: 14 }), children: /* @__PURE__ */ e(
|
253
|
+
_,
|
254
|
+
{
|
255
|
+
primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", sx: { fontWeight: 400 }, children: [
|
256
|
+
/* @__PURE__ */ e(
|
257
|
+
m,
|
258
|
+
{
|
259
|
+
sx: {
|
260
|
+
marginRight: 10
|
261
|
+
},
|
262
|
+
variant: "Body",
|
263
|
+
children: o.accountName
|
264
|
+
}
|
265
|
+
),
|
266
|
+
/* @__PURE__ */ e(
|
267
|
+
y,
|
268
|
+
{
|
269
|
+
amount: o.balance,
|
270
|
+
sx: {
|
271
|
+
flexShrink: 0
|
272
|
+
},
|
273
|
+
variant: "Small"
|
274
|
+
}
|
275
|
+
)
|
276
|
+
] }),
|
277
|
+
sx: { pl: 72, pr: 16 }
|
278
|
+
}
|
279
|
+
) }),
|
280
|
+
s < t.length - 1 ? /* @__PURE__ */ e(W, { variant: "inset" }) : /* @__PURE__ */ e(W, {})
|
281
|
+
] }, o.accountName)) })
|
282
|
+
] });
|
283
|
+
}, q = ({ groupedAccounts: t }) => /* @__PURE__ */ e(v, { children: t.map(({ accounts: l, icon: i, name: n }) => /* @__PURE__ */ e(Ye, { accounts: l, icon: i, name: n }, n)) }), qe = ({
|
284
|
+
netWorth: t,
|
285
|
+
assets: l,
|
286
|
+
liabilities: i,
|
287
|
+
totalAssets: n,
|
288
|
+
totalLiabilities: a
|
289
|
+
}) => {
|
290
|
+
const { net_worth: o } = T(), s = ie();
|
291
|
+
return /* @__PURE__ */ r(v, { children: [
|
292
|
+
/* @__PURE__ */ r(
|
293
|
+
re,
|
294
|
+
{
|
295
|
+
sx: {
|
296
|
+
alignItems: "center",
|
297
|
+
display: "flex",
|
298
|
+
flexDirection: "column",
|
299
|
+
justifyContent: "space-between",
|
300
|
+
paddingTop: 24,
|
301
|
+
marginBottom: 8
|
302
|
+
},
|
303
|
+
children: [
|
304
|
+
/* @__PURE__ */ e(m, { variant: "Body", children: o.current_net_worth }),
|
305
|
+
/* @__PURE__ */ e(y, { amount: t?.y ?? 0, variant: "H1" }),
|
306
|
+
t && /* @__PURE__ */ e(
|
307
|
+
R,
|
308
|
+
{
|
309
|
+
currencyLabel: o.this_month,
|
310
|
+
iconSize: 20,
|
311
|
+
netWorth: t,
|
312
|
+
theme: s
|
313
|
+
}
|
314
|
+
)
|
315
|
+
]
|
316
|
+
}
|
317
|
+
),
|
318
|
+
/* @__PURE__ */ r(B, { children: [
|
319
|
+
/* @__PURE__ */ e(E, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
|
320
|
+
_,
|
321
|
+
{
|
322
|
+
primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
|
323
|
+
/* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: o.assets }),
|
324
|
+
/* @__PURE__ */ e(y, { amount: n, sx: { fontWeight: 400 }, variant: "XSmall" })
|
325
|
+
] })
|
326
|
+
}
|
327
|
+
) }),
|
328
|
+
/* @__PURE__ */ e(q, { groupedAccounts: K(l) }),
|
329
|
+
/* @__PURE__ */ e(E, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
|
330
|
+
_,
|
331
|
+
{
|
332
|
+
primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
|
333
|
+
/* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: o.liabilities }),
|
334
|
+
/* @__PURE__ */ e(y, { amount: a, sx: { fontWeight: 400 }, variant: "XSmall" })
|
335
|
+
] })
|
336
|
+
}
|
337
|
+
) }),
|
338
|
+
/* @__PURE__ */ e(q, { groupedAccounts: K(i) })
|
339
|
+
] })
|
340
|
+
] });
|
341
|
+
}, Ze = w(qe), Je = ({
|
342
|
+
netWorth: t,
|
343
|
+
gains: l,
|
344
|
+
losses: i,
|
345
|
+
totalGains: n,
|
346
|
+
totalLosses: a
|
347
|
+
}) => {
|
348
|
+
const { net_worth: o } = T(), s = ie();
|
349
|
+
return /* @__PURE__ */ r(v, { children: [
|
350
|
+
/* @__PURE__ */ r(h, { alignItems: "center", justifyContent: "space-between", mb: 8, pt: 24, children: [
|
351
|
+
/* @__PURE__ */ e(m, { variant: "Small", children: ne(t?.x) }),
|
352
|
+
/* @__PURE__ */ e(m, { variant: "Body", children: o.total_change }),
|
353
|
+
t && /* @__PURE__ */ e(R, { currencyVariant: "H1", iconSize: 32, netWorth: t, theme: s })
|
354
|
+
] }),
|
355
|
+
/* @__PURE__ */ r(B, { children: [
|
356
|
+
/* @__PURE__ */ e(E, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
|
357
|
+
_,
|
358
|
+
{
|
359
|
+
primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
|
360
|
+
/* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: o.gains }),
|
361
|
+
/* @__PURE__ */ e(y, { amount: n, sx: { fontWeight: 400 }, variant: "XSmall" })
|
362
|
+
] })
|
363
|
+
}
|
364
|
+
) }),
|
365
|
+
l?.map((c) => /* @__PURE__ */ r(d.Fragment, { children: [
|
366
|
+
/* @__PURE__ */ e(k, { sx: { backgroundColor: s.palette.background.paper, py: 14 }, children: /* @__PURE__ */ e(
|
367
|
+
_,
|
368
|
+
{
|
369
|
+
primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
|
370
|
+
/* @__PURE__ */ e(m, { sx: { mr: 10 }, variant: "Body", children: c.accountName }),
|
371
|
+
/* @__PURE__ */ e(
|
372
|
+
y,
|
373
|
+
{
|
374
|
+
amount: c.gain,
|
375
|
+
sx: { color: s.palette.success.main, flexShrink: 0, fontWeight: 700 },
|
376
|
+
variant: "Body"
|
377
|
+
}
|
378
|
+
)
|
379
|
+
] }),
|
380
|
+
sx: { px: 16 }
|
381
|
+
}
|
382
|
+
) }),
|
383
|
+
/* @__PURE__ */ e(W, {})
|
384
|
+
] }, c.accountName)),
|
385
|
+
/* @__PURE__ */ e(E, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
|
386
|
+
_,
|
387
|
+
{
|
388
|
+
primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
|
389
|
+
/* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: o.losses }),
|
390
|
+
/* @__PURE__ */ e(y, { amount: a, sx: { fontWeight: 400 }, variant: "XSmall" })
|
391
|
+
] })
|
392
|
+
}
|
393
|
+
) }),
|
394
|
+
i?.map((c) => /* @__PURE__ */ r(v, { children: [
|
395
|
+
/* @__PURE__ */ e(
|
396
|
+
k,
|
397
|
+
{
|
398
|
+
sx: { backgroundColor: s.palette.background.paper, py: 14 },
|
399
|
+
children: /* @__PURE__ */ e(
|
400
|
+
_,
|
401
|
+
{
|
402
|
+
primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
|
403
|
+
/* @__PURE__ */ e(
|
404
|
+
m,
|
405
|
+
{
|
406
|
+
sx: {
|
407
|
+
mr: 10
|
408
|
+
},
|
409
|
+
variant: "Body",
|
410
|
+
children: c.accountName
|
411
|
+
}
|
412
|
+
),
|
413
|
+
/* @__PURE__ */ e(
|
414
|
+
y,
|
415
|
+
{
|
416
|
+
amount: c.loss,
|
417
|
+
sx: { flexShrink: 0, fontWeight: 700 },
|
418
|
+
variant: "Body"
|
419
|
+
}
|
420
|
+
)
|
421
|
+
] }),
|
422
|
+
sx: { px: 16 }
|
423
|
+
}
|
424
|
+
)
|
425
|
+
},
|
426
|
+
c.accountName
|
427
|
+
),
|
428
|
+
/* @__PURE__ */ e(W, {})
|
429
|
+
] }))
|
430
|
+
] })
|
431
|
+
] });
|
432
|
+
}, Qe = w(Je), Mt = w(({ onBackClick: t }) => {
|
433
|
+
const { isCopyLoaded: l, isInitialized: i, selectedAccounts: n, setSelectedAccounts: a } = P(), { accounts: o, net_worth: s } = T(), { visibleAccounts: c } = J(), {
|
434
|
+
assetsLiabilities: u,
|
435
|
+
gainsLosses: C,
|
436
|
+
hoveredData: x,
|
437
|
+
loadChartData: g,
|
438
|
+
loadNetWorthData: S,
|
439
|
+
netWorthChartData: p,
|
440
|
+
selectedData: f,
|
441
|
+
setHoveredData: L,
|
442
|
+
setSelectedData: se
|
443
|
+
} = ee(), { isMobile: N } = Z(), { onEvent: D } = Q(), [ae, ce] = d.useState(!1), [A, le] = d.useState(6), [me, j] = d.useState(!1), [de, $] = d.useState(!1), [he, G] = d.useState(!1), ue = async () => {
|
444
|
+
await S(n), await g(A), ce(!0);
|
445
|
+
};
|
446
|
+
d.useEffect(() => {
|
447
|
+
D(b.NET_WORTH_VIEW);
|
448
|
+
}, []), d.useEffect(() => {
|
449
|
+
a(c);
|
450
|
+
}, [c]), d.useEffect(() => {
|
451
|
+
i && ue().finally();
|
452
|
+
}, [i, n]), d.useEffect(() => {
|
453
|
+
D(b.NET_WORTH_WIDGET_CLICK_TIMEFRAME, { time_period: A + "M" }), g(A).finally();
|
454
|
+
}, [A]);
|
455
|
+
const pe = (I, M) => {
|
456
|
+
se(M), I.currentTarget instanceof HTMLDivElement && j(!0);
|
457
|
+
}, fe = (I) => {
|
458
|
+
L(I);
|
459
|
+
}, xe = () => {
|
460
|
+
L(null);
|
461
|
+
}, ge = () => {
|
462
|
+
D(b.NET_WORTH_WIDGET_CLICK_ASSETS_LIABILITIES), $(!0);
|
463
|
+
}, ye = async (I) => {
|
464
|
+
const M = I[0], X = I[1];
|
465
|
+
M && X && le(Ee(X, M));
|
466
|
+
}, F = {
|
467
|
+
chartData: p,
|
468
|
+
hoveredData: x,
|
469
|
+
onButtonClick: ge,
|
470
|
+
onDataClick: pe,
|
471
|
+
onMouseEnter: fe,
|
472
|
+
onMouseLeave: xe,
|
473
|
+
selectedData: f
|
474
|
+
}, Ce = () => {
|
475
|
+
G(!0), D(b.ACCOUNTS_CLICK_CONNECT);
|
476
|
+
};
|
477
|
+
return l ? /* @__PURE__ */ e(
|
478
|
+
ke,
|
479
|
+
{
|
480
|
+
accountOptions: c,
|
481
|
+
calendarActions: {
|
482
|
+
onRangeChanged: ye
|
483
|
+
},
|
484
|
+
dateRangeVariant: N ? "timeframetabs" : "timeframebuttons",
|
485
|
+
onAccountsFilterClick: () => D(b.NET_WORTH_WIDGET_CLICK_FILTER),
|
486
|
+
onBackClick: t,
|
487
|
+
showDividerAboveDateSelector: !1,
|
488
|
+
sx: {
|
489
|
+
p: N ? 0 : 48,
|
490
|
+
"& .MuiCardHeader-root": {
|
491
|
+
px: 16,
|
492
|
+
py: 12
|
493
|
+
},
|
494
|
+
"& .MuiBox-root": {
|
495
|
+
m: 0
|
496
|
+
},
|
497
|
+
"& .MuiTabs-root": {
|
498
|
+
width: "100%"
|
499
|
+
}
|
500
|
+
},
|
501
|
+
title: s.net_worth,
|
502
|
+
children: ae ? /* @__PURE__ */ r(v, { children: [
|
503
|
+
p.length ? /* @__PURE__ */ r(v, { children: [
|
504
|
+
f && /* @__PURE__ */ e(Ke, { hoveredData: x, selectedData: f }),
|
505
|
+
/* @__PURE__ */ r(
|
506
|
+
h,
|
507
|
+
{
|
508
|
+
alignItems: N ? "center" : "flex-start",
|
509
|
+
direction: N ? "column" : "row",
|
510
|
+
spacing: N ? 0 : 48,
|
511
|
+
children: [
|
512
|
+
/* @__PURE__ */ e(ze, { ...F }),
|
513
|
+
/* @__PURE__ */ e(Ge, { ...F })
|
514
|
+
]
|
515
|
+
}
|
516
|
+
)
|
517
|
+
] }) : /* @__PURE__ */ e(re, { sx: { justifyItems: "center" }, children: /* @__PURE__ */ e(
|
518
|
+
Be,
|
519
|
+
{
|
520
|
+
header: s.empty_widget_header,
|
521
|
+
icon: "elevation",
|
522
|
+
onClick: Ce,
|
523
|
+
primaryButton: s.empty_widget_button,
|
524
|
+
subText: s.empty_widget_description,
|
525
|
+
sx: {
|
526
|
+
width: { sm: 432 },
|
527
|
+
".buttons-footer": {
|
528
|
+
width: 167
|
529
|
+
}
|
530
|
+
}
|
531
|
+
}
|
532
|
+
) }),
|
533
|
+
/* @__PURE__ */ e(
|
534
|
+
Me,
|
535
|
+
{
|
536
|
+
onClose: () => G(!1),
|
537
|
+
showConnectionsWidget: he,
|
538
|
+
title: o.manage_connections
|
539
|
+
}
|
540
|
+
),
|
541
|
+
/* @__PURE__ */ e(
|
542
|
+
Y,
|
543
|
+
{
|
544
|
+
ariaLabelClose: "Close",
|
545
|
+
isOpen: me,
|
546
|
+
onClose: () => j(!1),
|
547
|
+
shouldShowHeaderBorders: !1,
|
548
|
+
shouldShowHeaderShadow: !0,
|
549
|
+
title: s.gains_and_losses,
|
550
|
+
children: C && /* @__PURE__ */ e(Qe, { ...C })
|
551
|
+
}
|
552
|
+
),
|
553
|
+
/* @__PURE__ */ e(
|
554
|
+
Y,
|
555
|
+
{
|
556
|
+
ariaLabelClose: "Close",
|
557
|
+
isOpen: de,
|
558
|
+
onClose: () => $(!1),
|
559
|
+
shouldShowHeaderBorders: !1,
|
560
|
+
shouldShowHeaderShadow: !0,
|
561
|
+
title: s.assets_and_liabilities,
|
562
|
+
children: u && /* @__PURE__ */ e(Ze, { ...u })
|
563
|
+
}
|
564
|
+
)
|
565
|
+
] }) : /* @__PURE__ */ e(O, {})
|
566
|
+
}
|
567
|
+
) : /* @__PURE__ */ e(O, {});
|
568
|
+
});
|
569
|
+
export {
|
570
|
+
ze as NetWorthChart,
|
571
|
+
Ge as NetWorthList,
|
572
|
+
At as NetWorthMicroWidget,
|
573
|
+
Ot as NetWorthStore,
|
574
|
+
Ke as NetWorthSummary,
|
575
|
+
Mt as NetWorthWidget
|
576
|
+
};
|