@mx-cartographer/experiences 7.4.7-alpha.mega1 → 7.4.8-alpha.mm0
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 -2
- package/dist/{Account-01wOyrH1.mjs → Account-BrOTlmeK.mjs} +1 -1
- package/dist/{AccountDetailsContent-COMjOzwr.mjs → AccountDetailsContent-B7FqH05C.mjs} +8 -8
- package/dist/{AccountDetailsHeader-Cbi5G6fJ.mjs → AccountDetailsHeader-C8MxsxhN.mjs} +4 -4
- package/dist/{AccountFields-Cd_nOWmf.mjs → AccountFields-BQZ-o6Kj.mjs} +2 -2
- package/dist/{AccountListItem-DxY4cCF1.mjs → AccountListItem-aIE9WWTO.mjs} +4 -4
- package/dist/{AccountStore-C1zMBzHq.mjs → AccountStore-DqO84Aer.mjs} +2 -2
- package/dist/{Accounts-D7QljYas.mjs → Accounts-DC_A4UCa.mjs} +1 -1
- package/dist/{BudgetUtil-Df2nII9u.mjs → BudgetUtil-BmZXkL0C.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-DqJK_rrL.mjs → CategorySelectorDrawer-SUgfE5GN.mjs} +1 -1
- package/dist/{ConnectDrawer-CuUj16NH.mjs → ConnectDrawer-KL8t1qSC.mjs} +1 -1
- package/dist/{ConnectionsDrawer-Bz4uwdFE.mjs → ConnectionsDrawer-DaK5uIL5.mjs} +2 -2
- package/dist/{CurrencyInput-BFKcs-_K.mjs → CurrencyInput-itK0R3wV.mjs} +1 -1
- package/dist/{DebtsStore-Bu8rRRSL.mjs → DebtsStore-DVPZbv2C.mjs} +1 -1
- package/dist/{ExportCsvAction-DzTrtPzk.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
- package/dist/{GoalStore-CrNhjvNc.mjs → GoalStore-o4rrjGSJ.mjs} +2 -2
- package/dist/{Help-BnPXM_N2.mjs → Help-BjLMsuMS.mjs} +1 -1
- package/dist/{LineChart-bc1D9xBE.mjs → LineChart-BQRxZF3p.mjs} +1 -1
- package/dist/{ListItemAction-uobBrm_a.mjs → ListItemAction-BxTkF6Tz.mjs} +1 -1
- package/dist/{ManageIncome-A69EUO5u.mjs → ManageIncome-rcnDYsBJ.mjs} +75 -75
- package/dist/{MicroWidgetContainer-DEiRnYVa.mjs → MicroWidgetContainer-B2hO9rOG.mjs} +1 -1
- package/dist/{MiniWidgetContainer-CmXpTylX.mjs → MiniWidgetContainer-98-hKFqm.mjs} +1 -1
- package/dist/{NetWorthStore-CpL_kqvx.mjs → NetWorthStore-DG2X69jG.mjs} +2 -2
- package/dist/{NotificationSettings-CNmJWVeI.mjs → NotificationSettings-C7FYNM7I.mjs} +250 -248
- package/dist/{OriginalBalanceAction-DK8_LkPz.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +3 -3
- package/dist/{RecurringSettings-B0uObPlD.mjs → RecurringSettings-C81H1l38.mjs} +3 -3
- package/dist/{SpendingLegend-Bf-wbJvb.mjs → SpendingLegend-DqZxN_BZ.mjs} +2 -2
- package/dist/{TransactionDetails-COH0OKNG.mjs → TransactionDetails-BA_E5nQ-.mjs} +5 -5
- package/dist/{TransactionStore-Dz-G8Wd0.mjs → TransactionStore-PRlwE-TF.mjs} +2 -2
- package/dist/{User-wXzDI4M8.mjs → User-Cnlegl1N.mjs} +1 -1
- package/dist/{ViewMoreMicroCard-C0832BMe.mjs → ViewMoreMicroCard-DfPXJzbv.mjs} +105 -101
- package/dist/{WidgetContainer-6dsjtOVg.mjs → WidgetContainer-CaPjoWeE.mjs} +2 -2
- package/dist/accounts/index.es.js +148 -140
- package/dist/analytics/index.es.js +2 -2
- package/dist/budgets/index.es.js +483 -478
- package/dist/cashflow/index.es.js +367 -362
- package/dist/categories/index.es.js +1 -1
- package/dist/common/hooks/index.d.ts +1 -0
- package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
- package/dist/common/index.es.js +35 -33
- package/dist/dashboard/index.es.js +90 -88
- package/dist/debts/index.es.js +346 -342
- package/dist/{exportTransactionsToCSV-Cz2t0lmA.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +1 -1
- package/dist/finstrong/index.es.js +352 -350
- package/dist/goals/index.es.js +518 -511
- package/dist/help/index.es.js +13 -9
- package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
- package/dist/investments/index.es.js +395 -393
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +245 -240
- package/dist/notifications/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +293 -285
- package/dist/settings/index.es.js +252 -249
- package/dist/spending/index.es.js +136 -124
- package/dist/transactions/index.es.js +77 -73
- package/dist/trends/index.es.js +601 -588
- package/dist/{useAccountDisplayName-CMMlIOXF.mjs → useAccountDisplayName-Cjx8YmKK.mjs} +2 -2
- package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
- package/dist/useWidgetLoadTimer-C1NBkyLd.mjs +23 -0
- package/package.json +1 -1
package/dist/trends/index.es.js
CHANGED
|
@@ -1,110 +1,111 @@
|
|
|
1
1
|
import { jsxs as f, jsx as e, Fragment as rt } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { observer as
|
|
4
|
-
import { CategoryIcon as Se, Text as
|
|
5
|
-
import
|
|
2
|
+
import u, { useRef as at, useState as it, useEffect as ct } from "react";
|
|
3
|
+
import { observer as R } from "mobx-react-lite";
|
|
4
|
+
import { CategoryIcon as Se, Text as $, Icon as fe, P as he, H3 as Fe, ChevronRightIcon as lt } from "@mxenabled/mxui";
|
|
5
|
+
import H from "@mui/material/Box";
|
|
6
6
|
import b from "@mui/material/Stack";
|
|
7
7
|
import _e from "@mui/material/Button";
|
|
8
8
|
import { addSeconds as $e } from "date-fns/addSeconds";
|
|
9
|
-
import { differenceInCalendarMonths as
|
|
9
|
+
import { differenceInCalendarMonths as Re } from "date-fns/differenceInCalendarMonths";
|
|
10
10
|
import { useTheme as be } from "@mui/material/styles";
|
|
11
11
|
import { LineChart as dt } from "@mui/x-charts";
|
|
12
12
|
import { u as ee } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
13
13
|
import { u as ut } from "../useDimensions-27p2evRx.mjs";
|
|
14
14
|
import ht from "@mui/material/Card";
|
|
15
15
|
import gt from "@mui/material/CardContent";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { u as
|
|
19
|
-
import { b as
|
|
16
|
+
import ke from "@mui/material/Divider";
|
|
17
|
+
import Oe from "@mui/material/Grid";
|
|
18
|
+
import { u as N, m as U, g as V, b as me, h as xe, d as ve, v as pe, p as ze, f as Ne, a as mt } from "../hooks-ZMp65DFz.mjs";
|
|
19
|
+
import { b as Ke } from "../Localization-2MODESHW.mjs";
|
|
20
20
|
import { C as Te } from "../CurrencyText-Dr0EZ7bp.mjs";
|
|
21
|
-
import { useTheme as
|
|
22
|
-
import { f as J, a as
|
|
23
|
-
import { C as
|
|
24
|
-
import { f as
|
|
25
|
-
import { a as
|
|
21
|
+
import { useTheme as pt, Card as Ct, CardContent as yt, Box as ft, Stack as _t } from "@mui/material";
|
|
22
|
+
import { f as J, a as F } from "../Dialog-BPTr3qHE.mjs";
|
|
23
|
+
import { C as Ae, c as Tt } from "../Category-CevNQ03n.mjs";
|
|
24
|
+
import { f as se, a as St } from "../NumberFormatting-DjTD0t3W.mjs";
|
|
25
|
+
import { a as bt, g as xt, L as je } from "../TrendsStore-BW9FGQeE.mjs";
|
|
26
26
|
import { T as Gn } from "../TrendsStore-BW9FGQeE.mjs";
|
|
27
|
-
import { i as
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import { DataGridPro as
|
|
31
|
-
import { H as
|
|
32
|
-
import { T as G, b as
|
|
33
|
-
import { A as v, W as
|
|
34
|
-
import { a as
|
|
35
|
-
import { D as
|
|
27
|
+
import { i as vt, c as wt, d as Dt, e as It, f as Et, h as Lt, b as Ye, g as Ue, j as Ge } from "../SpendingData-BuJ03S9d.mjs";
|
|
28
|
+
import Mt from "@mui/material/ToggleButton";
|
|
29
|
+
import At from "@mui/material/ToggleButtonGroup";
|
|
30
|
+
import { DataGridPro as Rt } from "@mui/x-data-grid-pro";
|
|
31
|
+
import { H as Be } from "../HeaderCell-DjuifqHJ.mjs";
|
|
32
|
+
import { T as G, b as kt } from "../ViewMoreMicroCard-DfPXJzbv.mjs";
|
|
33
|
+
import { A as v, W as Xe } from "../WidgetContainer-CaPjoWeE.mjs";
|
|
34
|
+
import { a as Ze, T as Qe } from "../TransactionDetails-BA_E5nQ-.mjs";
|
|
35
|
+
import { D as He } from "../Drawer-BEtCk82g.mjs";
|
|
36
|
+
import { u as we } from "../useWidgetLoadTimer-C1NBkyLd.mjs";
|
|
36
37
|
import { L as ge } from "../Loader-DUaFpDGv.mjs";
|
|
37
|
-
import { L as
|
|
38
|
-
import { M as
|
|
39
|
-
import { subMonths as
|
|
40
|
-
import { TrendingUp as
|
|
41
|
-
import { M as
|
|
38
|
+
import { L as We } from "../LineChart-BQRxZF3p.mjs";
|
|
39
|
+
import { M as Ht } from "../MiniWidgetContainer-98-hKFqm.mjs";
|
|
40
|
+
import { subMonths as Nt } from "date-fns";
|
|
41
|
+
import { TrendingUp as Wt, TrendingDown as Ot, MultilineChart as Gt, ExpandLess as Bt, ExpandMore as Vt } from "@mxenabled/mx-icons";
|
|
42
|
+
import { M as Pt } from "../MicroWidgetContainer-B2hO9rOG.mjs";
|
|
42
43
|
import Ft from "@mui/material/Collapse";
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
44
|
+
import $t from "@mui/material/List";
|
|
45
|
+
import zt from "@mui/material/ListItem";
|
|
46
|
+
import Kt from "@mui/material/ListItemButton";
|
|
47
|
+
import jt from "@mui/material/ListItemIcon";
|
|
48
|
+
import Yt from "@mui/material/ListItemText";
|
|
48
49
|
import qe from "@mui/material/styles/useTheme";
|
|
49
|
-
import
|
|
50
|
-
import { b as
|
|
51
|
-
import { E as
|
|
52
|
-
import { u as Qt } from "../useInsightsEnabled-
|
|
53
|
-
import { E as
|
|
54
|
-
import { l as
|
|
55
|
-
const
|
|
56
|
-
const { categories: t } =
|
|
50
|
+
import Ut from "@mui/material/Paper";
|
|
51
|
+
import { b as Xt } from "../CategoryUtil-DUM8NuGO.mjs";
|
|
52
|
+
import { E as Zt } from "../ExportCsvAction-Cglo8Mca.mjs";
|
|
53
|
+
import { u as Qt } from "../useInsightsEnabled-B7dxpDrX.mjs";
|
|
54
|
+
import { E as qt } from "../EmptyState-DoxNUae-.mjs";
|
|
55
|
+
import { l as Jt } from "../ConnectDrawer-KL8t1qSC.mjs";
|
|
56
|
+
const Je = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
57
|
+
const { categories: t } = N(), { getCategoryName: n } = U(), s = n(o);
|
|
57
58
|
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
58
59
|
/* @__PURE__ */ e(
|
|
59
|
-
|
|
60
|
+
H,
|
|
60
61
|
{
|
|
61
|
-
"aria-label":
|
|
62
|
+
"aria-label": Ke(t.category_icon_label_aria, s),
|
|
62
63
|
mb: 4,
|
|
63
64
|
role: "img",
|
|
64
65
|
children: /* @__PURE__ */ e(Se, { categoryGuid: r })
|
|
65
66
|
}
|
|
66
67
|
),
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
+
/* @__PURE__ */ e($, { variant: "Body", children: s })
|
|
68
69
|
] });
|
|
69
|
-
},
|
|
70
|
+
}, eo = ({
|
|
70
71
|
categoryGuids: { guid: o, topLevelGuid: r },
|
|
71
72
|
hoveredAreaData: t,
|
|
72
73
|
cursorPosition: n,
|
|
73
74
|
chartContainerRef: s
|
|
74
75
|
}) => {
|
|
75
|
-
const
|
|
76
|
+
const h = be(), g = at(null), [d, c] = it({ x: n.x, y: n.y });
|
|
76
77
|
if (ct(() => {
|
|
77
78
|
(() => {
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
-
|
|
79
|
+
const l = g.current, T = s.current;
|
|
80
|
+
if (!l || !T) return;
|
|
81
|
+
const a = l.getBoundingClientRect(), p = T.getBoundingClientRect();
|
|
82
|
+
let _ = n.x, y = n.y;
|
|
83
|
+
_ + a.width * 2 > p.right ? _ = n.x - a.width : _ - a.width < p.left && (_ = n.x), y + a.height * 2 > p.bottom && (y = n.y - a.height), c({ x: _, y });
|
|
83
84
|
})();
|
|
84
85
|
}, [n, s]), !t) return null;
|
|
85
|
-
const
|
|
86
|
+
const m = t.reduce((C, l) => C + l.y, 0);
|
|
86
87
|
return /* @__PURE__ */ e(
|
|
87
88
|
ht,
|
|
88
89
|
{
|
|
89
|
-
ref:
|
|
90
|
+
ref: g,
|
|
90
91
|
sx: {
|
|
91
92
|
position: "absolute",
|
|
92
|
-
top:
|
|
93
|
-
left:
|
|
93
|
+
top: d.y,
|
|
94
|
+
left: d.x,
|
|
94
95
|
width: 250,
|
|
95
96
|
pointerEvents: "none"
|
|
96
97
|
},
|
|
97
98
|
children: /* @__PURE__ */ f(gt, { children: [
|
|
98
|
-
/* @__PURE__ */ f(
|
|
99
|
-
/* @__PURE__ */ e(
|
|
100
|
-
/* @__PURE__ */ e(
|
|
101
|
-
/* @__PURE__ */ e(Te, { amount:
|
|
99
|
+
/* @__PURE__ */ f(H, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
100
|
+
/* @__PURE__ */ e(Je, { categoryGuid: o, topLevelCategoryGuid: r }),
|
|
101
|
+
/* @__PURE__ */ e($, { variant: "Small", children: `${t.length}-month total` }),
|
|
102
|
+
/* @__PURE__ */ e(Te, { amount: m, bold: !0, formatString: "0,0", variant: "body2" })
|
|
102
103
|
] }),
|
|
103
|
-
/* @__PURE__ */ e(
|
|
104
|
-
/* @__PURE__ */ e(
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */ e(
|
|
107
|
-
/* @__PURE__ */ e(
|
|
104
|
+
/* @__PURE__ */ e(ke, { sx: { my: 16, width: "100%" } }),
|
|
105
|
+
/* @__PURE__ */ e(Oe, { container: !0, children: t.map((C, l) => /* @__PURE__ */ f(u.Fragment, { children: [
|
|
106
|
+
l > 0 && l % 3 === 0 && /* @__PURE__ */ e(ke, { sx: { my: 16, width: "100%" } }),
|
|
107
|
+
/* @__PURE__ */ e(Oe, { item: !0, xs: 4, children: /* @__PURE__ */ f(H, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
108
|
+
/* @__PURE__ */ e($, { color: h.palette.text.secondary, variant: "XSmall", children: C.x }),
|
|
108
109
|
/* @__PURE__ */ e(
|
|
109
110
|
Te,
|
|
110
111
|
{
|
|
@@ -115,46 +116,46 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
115
116
|
}
|
|
116
117
|
)
|
|
117
118
|
] }) })
|
|
118
|
-
] },
|
|
119
|
+
] }, l)) })
|
|
119
120
|
] })
|
|
120
121
|
}
|
|
121
122
|
);
|
|
122
|
-
},
|
|
123
|
+
}, to = R(eo), oo = ({
|
|
123
124
|
categoryGuids: { guid: o, topLevelGuid: r },
|
|
124
125
|
itemData: { dataIndex: t },
|
|
125
126
|
series: n,
|
|
126
127
|
xData: s
|
|
127
128
|
}) => {
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
/* @__PURE__ */ e(
|
|
131
|
-
/* @__PURE__ */ e(
|
|
132
|
-
/* @__PURE__ */ e(Te, { amount: String(
|
|
129
|
+
const h = pt(), g = n.data[t], d = s[t];
|
|
130
|
+
return g === void 0 || !d ? null : /* @__PURE__ */ e(Ct, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ e(yt, { children: /* @__PURE__ */ f(ft, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
131
|
+
/* @__PURE__ */ e(Je, { categoryGuid: o, topLevelCategoryGuid: r }),
|
|
132
|
+
/* @__PURE__ */ e($, { color: h.palette.text.secondary, variant: "Small", children: J(d, F.MONTH_SHORT_YEAR) }),
|
|
133
|
+
/* @__PURE__ */ e(Te, { amount: String(g), bold: !0, formatString: "0,0", variant: "Body" })
|
|
133
134
|
] }) }) });
|
|
134
|
-
},
|
|
135
|
+
}, no = ({
|
|
135
136
|
sx: o,
|
|
136
137
|
categoryGuids: r,
|
|
137
138
|
hoveredLegend: t,
|
|
138
139
|
legendRef: n,
|
|
139
140
|
onHoverLegend: s,
|
|
140
|
-
onClickLegend:
|
|
141
|
+
onClickLegend: h
|
|
141
142
|
}) => {
|
|
142
|
-
const { isMobile:
|
|
143
|
+
const { isMobile: g } = ee(), { getCategoryName: d } = U();
|
|
143
144
|
return /* @__PURE__ */ e(
|
|
144
145
|
b,
|
|
145
146
|
{
|
|
146
147
|
direction: "row",
|
|
147
148
|
flexWrap: "wrap",
|
|
148
|
-
gap:
|
|
149
|
+
gap: g ? 2 : 6,
|
|
149
150
|
justifyContent: "start",
|
|
150
151
|
ref: n,
|
|
151
152
|
sx: o,
|
|
152
|
-
children: r.map(({ guid: c, top_level_guid:
|
|
153
|
-
const C = t === c,
|
|
153
|
+
children: r.map(({ guid: c, top_level_guid: m }) => {
|
|
154
|
+
const C = t === c, l = Ae[c], T = Ae[m], a = l ?? T ?? Ae.default, p = a + "33";
|
|
154
155
|
return /* @__PURE__ */ f(
|
|
155
156
|
_e,
|
|
156
157
|
{
|
|
157
|
-
onClick: () =>
|
|
158
|
+
onClick: () => h(c),
|
|
158
159
|
onMouseEnter: () => s(c),
|
|
159
160
|
onMouseLeave: () => s(null),
|
|
160
161
|
sx: {
|
|
@@ -170,18 +171,18 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
170
171
|
},
|
|
171
172
|
children: [
|
|
172
173
|
/* @__PURE__ */ e(
|
|
173
|
-
|
|
174
|
+
H,
|
|
174
175
|
{
|
|
175
176
|
sx: {
|
|
176
177
|
width: 16,
|
|
177
178
|
height: 16,
|
|
178
|
-
marginRight:
|
|
179
|
+
marginRight: g ? 5 : 10,
|
|
179
180
|
borderRadius: "2px",
|
|
180
|
-
backgroundColor: t ? C ?
|
|
181
|
+
backgroundColor: t ? C ? a : p : a
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
),
|
|
184
|
-
/* @__PURE__ */ e(
|
|
185
|
+
/* @__PURE__ */ e($, { variant: "Body", children: d(c) })
|
|
185
186
|
]
|
|
186
187
|
},
|
|
187
188
|
c
|
|
@@ -189,111 +190,111 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
189
190
|
})
|
|
190
191
|
}
|
|
191
192
|
);
|
|
192
|
-
},
|
|
193
|
+
}, so = ({
|
|
193
194
|
onHoverArea: o,
|
|
194
195
|
onHoverPoint: r,
|
|
195
196
|
onHoverLegend: t,
|
|
196
197
|
onClickLegend: n,
|
|
197
198
|
stackedDatasets: s,
|
|
198
|
-
unstackedDatasets:
|
|
199
|
-
availableHeight:
|
|
200
|
-
minimumHeight:
|
|
199
|
+
unstackedDatasets: h = [],
|
|
200
|
+
availableHeight: g = 0,
|
|
201
|
+
minimumHeight: d = 350
|
|
201
202
|
}) => {
|
|
202
|
-
const c = be(), { isMobile:
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
i
|
|
206
|
-
}, [
|
|
207
|
-
const [
|
|
203
|
+
const c = be(), { isMobile: m } = ee(), [C, { height: l }] = ut(), T = u.useRef(null), [a, p] = u.useState(0);
|
|
204
|
+
u.useEffect(() => {
|
|
205
|
+
const i = Math.max(g - l, d);
|
|
206
|
+
p(i);
|
|
207
|
+
}, [g, l]);
|
|
208
|
+
const [_, y] = u.useState(null), [E, x] = u.useState({
|
|
208
209
|
hoveredSeriesId: null,
|
|
209
210
|
hoveredAreaData: null,
|
|
210
211
|
isAreaHovered: !1,
|
|
211
212
|
cursorPos: { x: 0, y: 0 }
|
|
212
|
-
}), { hoveredSeriesId:
|
|
213
|
-
(
|
|
214
|
-
) ?? [0],
|
|
215
|
-
...
|
|
216
|
-
),
|
|
213
|
+
}), { hoveredSeriesId: I, hoveredAreaData: W, isAreaHovered: L, cursorPos: O } = E, A = L && I && W, M = !A, P = [...s, ...h], z = P[0]?.dataset.length ?? 0, X = P.flatMap((i) => i.dataset.map((S) => S.x)), Ce = P.flatMap((i) => i.dataset.map((S) => S.y)), te = s[0]?.dataset?.map(
|
|
214
|
+
(i, S) => s.reduce((D, Y) => D + Y.dataset[S]?.y || 0, 0)
|
|
215
|
+
) ?? [0], re = Math.max(...te), Z = Math.max(
|
|
216
|
+
...h.flatMap((i) => i.dataset.map((S) => S.y))
|
|
217
|
+
), ce = Math.floor(Math.min(...Ce) / 100) * 100, oe = Math.ceil(Math.max(re, Z) / 100) * 100, K = s.map((i, S) => ({
|
|
217
218
|
id: `stacked-${S}`,
|
|
218
|
-
guid:
|
|
219
|
-
top_level_guid:
|
|
219
|
+
guid: i.category_guid,
|
|
220
|
+
top_level_guid: i.top_level_category_guid,
|
|
220
221
|
area: !0,
|
|
221
222
|
color: s[S].category_color ?? c.palette.primary.main,
|
|
222
|
-
data:
|
|
223
|
+
data: i.dataset.map((D) => D.y),
|
|
223
224
|
label: s[S].category_name,
|
|
224
225
|
stack: "total",
|
|
225
226
|
type: "line",
|
|
226
227
|
highlightScope: { highlight: "item" },
|
|
227
|
-
valueFormatter: (
|
|
228
|
-
})),
|
|
228
|
+
valueFormatter: (D) => se(D, "0,0")
|
|
229
|
+
})), ae = h.map((i, S) => ({
|
|
229
230
|
id: `unstacked-${S}`,
|
|
230
|
-
guid:
|
|
231
|
-
top_level_guid:
|
|
231
|
+
guid: i.category_guid,
|
|
232
|
+
top_level_guid: i.top_level_category_guid,
|
|
232
233
|
area: !1,
|
|
233
|
-
color:
|
|
234
|
-
data:
|
|
235
|
-
label:
|
|
234
|
+
color: i.category_color,
|
|
235
|
+
data: i.dataset.map((D) => D.y),
|
|
236
|
+
label: i.category_name,
|
|
236
237
|
type: "line",
|
|
237
|
-
valueFormatter: (
|
|
238
|
-
})),
|
|
239
|
-
|
|
240
|
-
guid:
|
|
238
|
+
valueFormatter: (D) => se(D, "0,0")
|
|
239
|
+
})), ne = [...K, ...ae], ie = [
|
|
240
|
+
...K.map(({ guid: i, top_level_guid: S }) => ({
|
|
241
|
+
guid: i,
|
|
241
242
|
top_level_guid: S
|
|
242
243
|
})),
|
|
243
|
-
...
|
|
244
|
-
guid:
|
|
244
|
+
...ae.map(({ guid: i, top_level_guid: S }) => ({
|
|
245
|
+
guid: i,
|
|
245
246
|
top_level_guid: S
|
|
246
247
|
}))
|
|
247
|
-
],
|
|
248
|
-
const
|
|
248
|
+
], Q = (i) => {
|
|
249
|
+
const D = i.startsWith("stacked-") ? s[parseInt(i.split("-")[1])] : h[parseInt(i.split("-")[1])];
|
|
249
250
|
return {
|
|
250
|
-
guid:
|
|
251
|
-
topLevelGuid:
|
|
251
|
+
guid: D?.category_guid,
|
|
252
|
+
topLevelGuid: D?.top_level_category_guid
|
|
252
253
|
};
|
|
253
|
-
}, w = (
|
|
254
|
-
y(
|
|
255
|
-
},
|
|
256
|
-
n?.(
|
|
257
|
-
},
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
}, le = (
|
|
261
|
-
const S = String(
|
|
262
|
-
if (
|
|
254
|
+
}, w = (i) => {
|
|
255
|
+
y(i), t?.(i ?? "");
|
|
256
|
+
}, B = (i) => {
|
|
257
|
+
n?.(i ?? "");
|
|
258
|
+
}, j = () => {
|
|
259
|
+
const i = Q(String(I)).guid;
|
|
260
|
+
i && n?.(i);
|
|
261
|
+
}, le = (i) => {
|
|
262
|
+
const S = String(i?.seriesId), D = Q(S).guid, Y = ne.find((de) => de.id === S), Ie = Y && i?.dataIndex !== void 0, Ee = Y && i?.dataIndex === void 0;
|
|
263
|
+
if (Ie)
|
|
263
264
|
x({
|
|
264
265
|
hoveredSeriesId: S,
|
|
265
266
|
hoveredAreaData: null,
|
|
266
267
|
isAreaHovered: !1,
|
|
267
|
-
cursorPos:
|
|
268
|
-
}), r?.(
|
|
269
|
-
else if (
|
|
270
|
-
const de = Y?.data.map((
|
|
271
|
-
x:
|
|
272
|
-
y:
|
|
268
|
+
cursorPos: O
|
|
269
|
+
}), r?.(D);
|
|
270
|
+
else if (Ee) {
|
|
271
|
+
const de = Y?.data.map((Le, Me) => ({
|
|
272
|
+
x: X[Me],
|
|
273
|
+
y: Le
|
|
273
274
|
})) ?? [];
|
|
274
275
|
x({
|
|
275
276
|
hoveredSeriesId: S,
|
|
276
277
|
hoveredAreaData: de,
|
|
277
278
|
isAreaHovered: !0,
|
|
278
|
-
cursorPos:
|
|
279
|
-
}), o?.(
|
|
279
|
+
cursorPos: O
|
|
280
|
+
}), o?.(D);
|
|
280
281
|
} else
|
|
281
282
|
x({
|
|
282
283
|
hoveredSeriesId: null,
|
|
283
284
|
hoveredAreaData: null,
|
|
284
285
|
isAreaHovered: !1,
|
|
285
|
-
cursorPos:
|
|
286
|
+
cursorPos: O
|
|
286
287
|
});
|
|
287
|
-
},
|
|
288
|
-
const S =
|
|
289
|
-
x((
|
|
290
|
-
...
|
|
288
|
+
}, ye = (i) => {
|
|
289
|
+
const S = i.currentTarget.getBoundingClientRect();
|
|
290
|
+
x((D) => ({
|
|
291
|
+
...D,
|
|
291
292
|
cursorPos: {
|
|
292
|
-
x:
|
|
293
|
-
y:
|
|
293
|
+
x: i.clientX - S.left,
|
|
294
|
+
y: i.clientY - S.top
|
|
294
295
|
}
|
|
295
296
|
}));
|
|
296
|
-
},
|
|
297
|
+
}, De = {
|
|
297
298
|
p: 4,
|
|
298
299
|
"& .MuiBarLabel-root": {
|
|
299
300
|
fontSize: 10,
|
|
@@ -309,18 +310,18 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
309
310
|
'& [class*="MuiLineElement-series-unstacked-"]': {
|
|
310
311
|
strokeWidth: 3
|
|
311
312
|
},
|
|
312
|
-
...
|
|
313
|
-
const Y = `.MuiAreaElement-series-stacked-${
|
|
314
|
-
return
|
|
315
|
-
opacity:
|
|
316
|
-
},
|
|
313
|
+
..._ && K.reduce((i, S, D) => {
|
|
314
|
+
const Y = `.MuiAreaElement-series-stacked-${D}`;
|
|
315
|
+
return i[Y] = {
|
|
316
|
+
opacity: K[D].guid === _ ? 0.9 : 0.2
|
|
317
|
+
}, i;
|
|
317
318
|
}, {})
|
|
318
319
|
};
|
|
319
320
|
return /* @__PURE__ */ e(
|
|
320
|
-
|
|
321
|
+
H,
|
|
321
322
|
{
|
|
322
|
-
onMouseMove:
|
|
323
|
-
ref:
|
|
323
|
+
onMouseMove: ye,
|
|
324
|
+
ref: T,
|
|
324
325
|
sx: {
|
|
325
326
|
position: "relative",
|
|
326
327
|
touchAction: "pan-y",
|
|
@@ -342,11 +343,11 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
342
343
|
/* @__PURE__ */ e(
|
|
343
344
|
dt,
|
|
344
345
|
{
|
|
345
|
-
height:
|
|
346
|
+
height: a,
|
|
346
347
|
margin: { bottom: 50 },
|
|
347
|
-
onAreaClick:
|
|
348
|
+
onAreaClick: j,
|
|
348
349
|
onHighlightChange: le,
|
|
349
|
-
series:
|
|
350
|
+
series: ne,
|
|
350
351
|
skipAnimation: !0,
|
|
351
352
|
slotProps: {
|
|
352
353
|
legend: {
|
|
@@ -354,56 +355,56 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
354
355
|
}
|
|
355
356
|
},
|
|
356
357
|
slots: {
|
|
357
|
-
itemContent: (
|
|
358
|
-
|
|
358
|
+
itemContent: (i) => M && I ? /* @__PURE__ */ e(
|
|
359
|
+
oo,
|
|
359
360
|
{
|
|
360
|
-
categoryGuids:
|
|
361
|
-
xData:
|
|
362
|
-
...
|
|
361
|
+
categoryGuids: Q(I),
|
|
362
|
+
xData: X,
|
|
363
|
+
...i
|
|
363
364
|
}
|
|
364
365
|
) : null
|
|
365
366
|
},
|
|
366
|
-
sx:
|
|
367
|
+
sx: De,
|
|
367
368
|
tooltip: {
|
|
368
|
-
trigger:
|
|
369
|
+
trigger: M ? "item" : "none"
|
|
369
370
|
},
|
|
370
371
|
xAxis: [
|
|
371
372
|
{
|
|
372
|
-
data:
|
|
373
|
+
data: X,
|
|
373
374
|
scaleType: "time",
|
|
374
|
-
valueFormatter: (
|
|
375
|
-
tickNumber:
|
|
375
|
+
valueFormatter: (i) => J(i, F.MONTH_SHORT_YEAR),
|
|
376
|
+
tickNumber: z
|
|
376
377
|
// How many ticks to show on the x-axis
|
|
377
378
|
}
|
|
378
379
|
],
|
|
379
380
|
yAxis: [
|
|
380
381
|
{
|
|
381
|
-
min:
|
|
382
|
-
max:
|
|
382
|
+
min: ce,
|
|
383
|
+
max: oe || 100
|
|
383
384
|
}
|
|
384
385
|
]
|
|
385
386
|
}
|
|
386
387
|
),
|
|
387
388
|
/* @__PURE__ */ e(
|
|
388
|
-
|
|
389
|
+
no,
|
|
389
390
|
{
|
|
390
|
-
categoryGuids:
|
|
391
|
-
hoveredLegend:
|
|
391
|
+
categoryGuids: ie,
|
|
392
|
+
hoveredLegend: _,
|
|
392
393
|
legendRef: C,
|
|
393
|
-
onClickLegend:
|
|
394
|
+
onClickLegend: B,
|
|
394
395
|
onHoverLegend: w,
|
|
395
|
-
sx: { px:
|
|
396
|
+
sx: { px: m ? 0 : 24 }
|
|
396
397
|
}
|
|
397
398
|
),
|
|
398
|
-
|
|
399
|
-
|
|
399
|
+
A && /* @__PURE__ */ e(
|
|
400
|
+
to,
|
|
400
401
|
{
|
|
401
|
-
categoryGuids:
|
|
402
|
-
chartContainerRef:
|
|
403
|
-
cursorPosition:
|
|
404
|
-
hoveredAreaData:
|
|
405
|
-
...
|
|
406
|
-
x: J(
|
|
402
|
+
categoryGuids: Q(I),
|
|
403
|
+
chartContainerRef: T,
|
|
404
|
+
cursorPosition: O,
|
|
405
|
+
hoveredAreaData: W.map((i) => ({
|
|
406
|
+
...i,
|
|
407
|
+
x: J(i.x, F.MONTH_SHORT_YEAR)
|
|
407
408
|
}))
|
|
408
409
|
}
|
|
409
410
|
)
|
|
@@ -412,29 +413,29 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
412
413
|
)
|
|
413
414
|
}
|
|
414
415
|
);
|
|
415
|
-
},
|
|
416
|
-
|
|
416
|
+
}, et = ({ selectedTab: o, onTabChange: r }) => /* @__PURE__ */ e(
|
|
417
|
+
At,
|
|
417
418
|
{
|
|
418
419
|
exclusive: !0,
|
|
419
420
|
onChange: r,
|
|
420
421
|
orientation: "horizontal",
|
|
421
422
|
value: o,
|
|
422
|
-
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(
|
|
423
|
+
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(Mt, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(fe, { name: "table_chart_view" }) : /* @__PURE__ */ e(fe, { name: "format_list_bulleted" }) }, t))
|
|
423
424
|
}
|
|
424
|
-
),
|
|
425
|
-
const { trends: t } =
|
|
426
|
-
const
|
|
425
|
+
), tt = ({ selectedDateRange: o, selectedCategoryGuid: r }) => {
|
|
426
|
+
const { trends: t } = N(), { isMobile: n, isDesktop: s } = ee(), { getCategoryName: h } = U(), g = u.useMemo(() => {
|
|
427
|
+
const d = J(
|
|
427
428
|
o.start,
|
|
428
|
-
n ?
|
|
429
|
+
n ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
|
|
429
430
|
), c = J(
|
|
430
431
|
o.end,
|
|
431
|
-
n ?
|
|
432
|
+
n ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
|
|
432
433
|
);
|
|
433
|
-
return `${
|
|
434
|
+
return `${d} - ${c}`;
|
|
434
435
|
}, [o, n]);
|
|
435
|
-
return /* @__PURE__ */ f(
|
|
436
|
+
return /* @__PURE__ */ f(H, { sx: { mr: 10, minWidth: "60%" }, children: [
|
|
436
437
|
/* @__PURE__ */ e(
|
|
437
|
-
|
|
438
|
+
$,
|
|
438
439
|
{
|
|
439
440
|
display: "block",
|
|
440
441
|
fontWeight: 700,
|
|
@@ -444,217 +445,220 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
444
445
|
textOverflow: "unset"
|
|
445
446
|
},
|
|
446
447
|
variant: s ? "H3" : "Body",
|
|
447
|
-
children:
|
|
448
|
+
children: h(r) || t.sub_title
|
|
448
449
|
}
|
|
449
450
|
),
|
|
450
|
-
/* @__PURE__ */ e(
|
|
451
|
+
/* @__PURE__ */ e($, { variant: s ? "Body" : "Small", children: g })
|
|
451
452
|
] });
|
|
452
|
-
},
|
|
453
|
+
}, ro = (o) => {
|
|
453
454
|
const r = o.row[o.field];
|
|
454
455
|
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: o.tabIndex, children: /* @__PURE__ */ e(Te, { amount: r, variant: "Small" }) });
|
|
455
|
-
},
|
|
456
|
-
const { getCategoryName: t } = U(), { categories: n } =
|
|
456
|
+
}, ao = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
457
|
+
const { getCategoryName: t } = U(), { categories: n } = N(), s = n.default_categories[o]?.replace(/&/g, "&") ?? t(o);
|
|
457
458
|
return /* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
458
459
|
/* @__PURE__ */ e(
|
|
459
|
-
|
|
460
|
+
H,
|
|
460
461
|
{
|
|
461
|
-
"aria-label":
|
|
462
|
+
"aria-label": Ke(n.category_icon_label_aria, s),
|
|
462
463
|
role: "img",
|
|
463
464
|
children: /* @__PURE__ */ e(Se, { categoryGuid: r })
|
|
464
465
|
}
|
|
465
466
|
),
|
|
466
|
-
/* @__PURE__ */ e(
|
|
467
|
+
/* @__PURE__ */ e($, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
|
|
467
468
|
] });
|
|
468
|
-
},
|
|
469
|
-
|
|
469
|
+
}, io = (o) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
|
|
470
|
+
ao,
|
|
470
471
|
{
|
|
471
472
|
categoryGuid: o.row.category,
|
|
472
473
|
topLevelCategoryGuid: o.row.top_level_category_guid
|
|
473
474
|
}
|
|
474
|
-
) }),
|
|
475
|
+
) }), co = (o, r) => {
|
|
475
476
|
const t = [], n = new Date(o);
|
|
476
477
|
for (; n <= r; ) {
|
|
477
|
-
const s = J(n,
|
|
478
|
+
const s = J(n, F.MONTH);
|
|
478
479
|
t.push(s), n.setMonth(n.getMonth() + 1);
|
|
479
480
|
}
|
|
480
481
|
return t;
|
|
481
|
-
},
|
|
482
|
+
}, ot = ({
|
|
482
483
|
monthlyCategoryTotals: o,
|
|
483
484
|
selectedDateRange: r,
|
|
484
485
|
selectedCategory: t,
|
|
485
486
|
onClickRow: n,
|
|
486
487
|
height: s = "100dvh",
|
|
487
|
-
sx:
|
|
488
|
+
sx: h = {}
|
|
488
489
|
}) => {
|
|
489
|
-
const { onEvent:
|
|
490
|
-
{ field:
|
|
491
|
-
]), C =
|
|
490
|
+
const { onEvent: g } = V(), d = J(/* @__PURE__ */ new Date(), F.MONTH_SHORT), [c, m] = u.useState([
|
|
491
|
+
{ field: d, sort: "desc" }
|
|
492
|
+
]), C = u.useMemo(() => co(r.start, r.end), [r]), l = [
|
|
492
493
|
{
|
|
493
494
|
field: "category",
|
|
494
495
|
flex: 1,
|
|
495
496
|
headerName: "Category",
|
|
496
497
|
minWidth: 175,
|
|
497
|
-
renderHeader:
|
|
498
|
-
renderCell:
|
|
498
|
+
renderHeader: Be,
|
|
499
|
+
renderCell: io,
|
|
499
500
|
sortable: !0,
|
|
500
501
|
type: "string"
|
|
501
502
|
},
|
|
502
503
|
...C.map(
|
|
503
|
-
(
|
|
504
|
-
field:
|
|
504
|
+
(a) => ({
|
|
505
|
+
field: a,
|
|
505
506
|
flex: 1,
|
|
506
|
-
headerName:
|
|
507
|
+
headerName: a,
|
|
507
508
|
minWidth: 100,
|
|
508
|
-
renderHeader:
|
|
509
|
-
renderCell:
|
|
509
|
+
renderHeader: Be,
|
|
510
|
+
renderCell: ro,
|
|
510
511
|
align: "right",
|
|
511
512
|
headerAlign: "right",
|
|
512
513
|
sortable: !0,
|
|
513
514
|
hideSortIcons: !1,
|
|
514
515
|
type: "number",
|
|
515
|
-
sortComparator:
|
|
516
|
+
sortComparator: bt
|
|
516
517
|
})
|
|
517
518
|
)
|
|
518
|
-
],
|
|
519
|
-
const
|
|
520
|
-
(y) => !
|
|
521
|
-
),
|
|
519
|
+
], T = u.useMemo(() => {
|
|
520
|
+
const a = o.filter(
|
|
521
|
+
(y) => !vt(y) && !wt(y)
|
|
522
|
+
), _ = (t ? a.filter(
|
|
522
523
|
(y) => y.category_guid === t || y.top_level_category_guid === t
|
|
523
|
-
) :
|
|
524
|
-
(y,
|
|
525
|
-
const { category_guid: x, top_level_category_guid:
|
|
526
|
-
y[
|
|
527
|
-
id:
|
|
528
|
-
category:
|
|
524
|
+
) : a).reduce(
|
|
525
|
+
(y, E) => {
|
|
526
|
+
const { category_guid: x, top_level_category_guid: I, month: W, total: L, year: O } = E, A = t ? x : I;
|
|
527
|
+
y[A] || (y[A] = {
|
|
528
|
+
id: A,
|
|
529
|
+
category: A,
|
|
529
530
|
category_guid: x,
|
|
530
|
-
top_level_category_guid:
|
|
531
|
+
top_level_category_guid: I
|
|
531
532
|
});
|
|
532
|
-
const
|
|
533
|
-
return y[
|
|
533
|
+
const M = J(new Date(O, W - 1), F.MONTH_SHORT);
|
|
534
|
+
return y[A][M] || (y[A][M] = 0), y[A][M] = y[A][M] + Math.abs(L), y;
|
|
534
535
|
},
|
|
535
536
|
{}
|
|
536
537
|
);
|
|
537
|
-
return Object.values(
|
|
538
|
+
return Object.values(_);
|
|
538
539
|
}, [o, t]);
|
|
539
|
-
return /* @__PURE__ */ e(
|
|
540
|
-
|
|
540
|
+
return /* @__PURE__ */ e(H, { sx: { height: s, width: "100%", overflowX: "auto", boxShadow: "none", ...h }, children: /* @__PURE__ */ e(
|
|
541
|
+
Rt,
|
|
541
542
|
{
|
|
542
|
-
columns:
|
|
543
|
+
columns: l,
|
|
543
544
|
disableColumnFilter: !0,
|
|
544
545
|
disableColumnMenu: !0,
|
|
545
546
|
hideFooter: !0,
|
|
546
547
|
initialState: { sorting: { sortModel: c } },
|
|
547
|
-
onRowClick: (
|
|
548
|
-
n?.(
|
|
548
|
+
onRowClick: (a) => {
|
|
549
|
+
n?.(a.row.category), g(v.TRENDS_CLICK_LIST_ITEM, {
|
|
549
550
|
...G,
|
|
550
|
-
listItem:
|
|
551
|
+
listItem: Tt[a.row.category]
|
|
551
552
|
});
|
|
552
553
|
},
|
|
553
|
-
onSortModelChange: (
|
|
554
|
-
|
|
554
|
+
onSortModelChange: (a) => {
|
|
555
|
+
m(a), g(v.TRENDS_CLICK_TABLE_SORT, G);
|
|
555
556
|
},
|
|
556
|
-
rows:
|
|
557
|
+
rows: T,
|
|
557
558
|
slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
|
|
558
559
|
sortModel: c,
|
|
559
560
|
sortingOrder: ["asc", "desc"]
|
|
560
561
|
}
|
|
561
562
|
) });
|
|
562
|
-
},
|
|
563
|
+
}, lo = {
|
|
563
564
|
title: "Transaction List"
|
|
564
|
-
},
|
|
565
|
+
}, uo = ({
|
|
565
566
|
categoryGuid: o,
|
|
566
567
|
dateRange: r,
|
|
567
568
|
isOpen: t,
|
|
568
569
|
onClose: n
|
|
569
570
|
}) => {
|
|
570
|
-
const { onEvent: s } =
|
|
571
|
-
() => c.find((
|
|
572
|
-
[
|
|
571
|
+
const { onEvent: s } = V(), { selectedAccountGuids: h } = me(), { common: g } = N(), { setFilter: d, sortedTransactions: c } = xe(), [m, C] = u.useState(""), l = u.useMemo(
|
|
572
|
+
() => c.find((a) => a.guid === m),
|
|
573
|
+
[m, c]
|
|
573
574
|
);
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
accounts:
|
|
575
|
+
u.useEffect(() => {
|
|
576
|
+
d({
|
|
577
|
+
accounts: h,
|
|
577
578
|
dateRange: r,
|
|
578
|
-
custom: (
|
|
579
|
+
custom: (a) => o === "" || o === a.category_guid || o === a.top_level_category_guid,
|
|
579
580
|
showSplits: !!o
|
|
580
581
|
});
|
|
581
|
-
}, [
|
|
582
|
-
const
|
|
582
|
+
}, [h, o, r]), u.useEffect(() => s(v.TRENDS_VIEW_TRANSACTIONS), []);
|
|
583
|
+
const T = () => {
|
|
583
584
|
C(""), n();
|
|
584
585
|
};
|
|
585
586
|
return /* @__PURE__ */ f(
|
|
586
|
-
|
|
587
|
+
He,
|
|
587
588
|
{
|
|
588
|
-
ariaLabelClose:
|
|
589
|
+
ariaLabelClose: g.close_aria,
|
|
589
590
|
isOpen: t,
|
|
590
|
-
onClose:
|
|
591
|
-
title:
|
|
591
|
+
onClose: T,
|
|
592
|
+
title: lo.title,
|
|
592
593
|
children: [
|
|
593
|
-
|
|
594
|
-
!
|
|
594
|
+
l && /* @__PURE__ */ e(Ze, { transaction: l }),
|
|
595
|
+
!l && /* @__PURE__ */ e(Qe, { onClick: C })
|
|
595
596
|
]
|
|
596
597
|
}
|
|
597
598
|
);
|
|
598
|
-
},
|
|
599
|
-
const { onEvent: t } =
|
|
600
|
-
|
|
601
|
-
|
|
599
|
+
}, ho = R(uo), go = ({ onBackClick: o, sx: r }) => {
|
|
600
|
+
const { onEvent: t } = V(), { isDesktop: n, isTablet: s, isMobile: h } = ee(), { visibleAccounts: g } = ve(), { loadMonthlyCategoryTotals: d, monthlyCategoryTotals: c, getCategoryName: m } = U(), { sortedTransactions: C } = xe(), { selectedDateRange: l, setSelectedDateRange: T } = pe(), { isCopyLoaded: a, isInitialized: p, selectedAccounts: _, setSelectedAccounts: y } = me(), { trends: E } = N(), [x, I] = u.useState(!1), [W, L] = u.useState(!1), [O, A] = u.useState("Chart"), [M, P] = u.useState(""), [z, X] = u.useState(window.innerHeight), te = z - (h ? 315 : 345);
|
|
601
|
+
we({
|
|
602
|
+
widgetName: "TrendsFullWidget",
|
|
603
|
+
isLoaded: x
|
|
604
|
+
}), u.useEffect(() => {
|
|
605
|
+
const w = () => X(window.innerHeight);
|
|
602
606
|
return window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
|
|
603
|
-
}, []),
|
|
604
|
-
y(
|
|
605
|
-
}, [
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
607
|
+
}, []), u.useEffect(() => {
|
|
608
|
+
y(g);
|
|
609
|
+
}, [g]), u.useEffect(() => {
|
|
610
|
+
p && d(
|
|
611
|
+
_,
|
|
612
|
+
l.start,
|
|
613
|
+
l.end
|
|
610
614
|
).finally(() => {
|
|
611
|
-
|
|
615
|
+
I(!0);
|
|
612
616
|
});
|
|
613
|
-
}, [
|
|
614
|
-
const
|
|
617
|
+
}, [p, _, l]);
|
|
618
|
+
const re = u.useMemo(() => {
|
|
615
619
|
if (!x) return { stackedDatasets: [], unstackedDatasets: [] };
|
|
616
|
-
const w =
|
|
620
|
+
const w = xt(
|
|
617
621
|
c,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
),
|
|
621
|
-
(
|
|
622
|
-
) :
|
|
622
|
+
l.start,
|
|
623
|
+
l.end
|
|
624
|
+
), B = M.length ? w.filter(
|
|
625
|
+
(j) => j.top_level_category_guid === M || j.category_guid === M
|
|
626
|
+
) : Dt(w);
|
|
623
627
|
return {
|
|
624
|
-
stackedDatasets:
|
|
625
|
-
unstackedDatasets:
|
|
628
|
+
stackedDatasets: B.filter(It),
|
|
629
|
+
unstackedDatasets: B.filter(Et)
|
|
626
630
|
};
|
|
627
|
-
}, [c,
|
|
628
|
-
|
|
629
|
-
},
|
|
630
|
-
const
|
|
631
|
-
|
|
631
|
+
}, [c, M, l]), Z = (w, B) => {
|
|
632
|
+
A(B ?? O), t(v.TRENDS_CLICK_TOGGLE_VIEW);
|
|
633
|
+
}, ce = (w) => {
|
|
634
|
+
const B = $e(w?.[0], 1), j = w?.[1], le = Re(j, B);
|
|
635
|
+
T({ start: B, end: j }), t(v.TRENDS_CLICK_TIME_WINDOW, {
|
|
632
636
|
time_period: le + "M"
|
|
633
637
|
});
|
|
634
|
-
},
|
|
638
|
+
}, oe = () => {
|
|
635
639
|
t(v.TRENDS_CLICK_FILTER);
|
|
636
|
-
},
|
|
637
|
-
|
|
638
|
-
},
|
|
639
|
-
|
|
640
|
-
},
|
|
641
|
-
t(v.TRENDS_HOVER_LEGEND, { category:
|
|
642
|
-
},
|
|
640
|
+
}, K = (w) => {
|
|
641
|
+
P(w);
|
|
642
|
+
}, ae = (w) => {
|
|
643
|
+
P(w), t(v.TRENDS_CLICK_LEGEND, { category: m(w) });
|
|
644
|
+
}, ne = (w) => {
|
|
645
|
+
t(v.TRENDS_HOVER_LEGEND, { category: m(w) });
|
|
646
|
+
}, ie = (w) => {
|
|
643
647
|
t(v.TRENDS_HOVER_AREA, { category: w });
|
|
644
|
-
},
|
|
648
|
+
}, Q = (w) => {
|
|
645
649
|
t(v.TRENDS_HOVER_POINT, { category: w });
|
|
646
650
|
};
|
|
647
|
-
return !
|
|
648
|
-
|
|
651
|
+
return !a || !p || !x ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
652
|
+
Xe,
|
|
649
653
|
{
|
|
650
|
-
accountOptions:
|
|
651
|
-
calendarActions: { onRangeChanged:
|
|
652
|
-
dateRange:
|
|
654
|
+
accountOptions: g,
|
|
655
|
+
calendarActions: { onRangeChanged: ce },
|
|
656
|
+
dateRange: l,
|
|
653
657
|
dateRangeVariant: "timeframebuttons",
|
|
654
|
-
onAccountsFilterClick:
|
|
658
|
+
onAccountsFilterClick: oe,
|
|
655
659
|
onBackClick: o,
|
|
656
660
|
sx: r,
|
|
657
|
-
title:
|
|
661
|
+
title: E.title,
|
|
658
662
|
children: [
|
|
659
663
|
/* @__PURE__ */ f(
|
|
660
664
|
b,
|
|
@@ -669,46 +673,46 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
669
673
|
{
|
|
670
674
|
flexDirection: "row",
|
|
671
675
|
justifyContent: "space-between",
|
|
672
|
-
sx: { pb:
|
|
676
|
+
sx: { pb: h ? 12 : 24, pt: h ? 24 : 48 },
|
|
673
677
|
children: [
|
|
674
678
|
/* @__PURE__ */ e(
|
|
675
|
-
|
|
679
|
+
tt,
|
|
676
680
|
{
|
|
677
|
-
selectedCategoryGuid:
|
|
678
|
-
selectedDateRange:
|
|
681
|
+
selectedCategoryGuid: M,
|
|
682
|
+
selectedDateRange: l
|
|
679
683
|
}
|
|
680
684
|
),
|
|
681
|
-
/* @__PURE__ */ e(
|
|
685
|
+
/* @__PURE__ */ e(et, { onTabChange: Z, selectedTab: O })
|
|
682
686
|
]
|
|
683
687
|
}
|
|
684
688
|
),
|
|
685
689
|
/* @__PURE__ */ f(b, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
686
|
-
/* @__PURE__ */ e(
|
|
690
|
+
/* @__PURE__ */ e(H, { flexGrow: 1, children: M && /* @__PURE__ */ f(_e, { onClick: () => P(""), sx: { p: 0, pr: 5 }, children: [
|
|
687
691
|
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
688
|
-
|
|
692
|
+
E.all_categories
|
|
689
693
|
] }) }),
|
|
690
|
-
/* @__PURE__ */ e(_e, { onClick: () =>
|
|
694
|
+
/* @__PURE__ */ e(_e, { onClick: () => L(!0), sx: { px: 5 }, children: `${E.view_transactions} (${C.length})` })
|
|
691
695
|
] }),
|
|
692
|
-
/* @__PURE__ */ f(
|
|
693
|
-
|
|
694
|
-
|
|
696
|
+
/* @__PURE__ */ f(H, { children: [
|
|
697
|
+
O === "Chart" && /* @__PURE__ */ e(
|
|
698
|
+
so,
|
|
695
699
|
{
|
|
696
|
-
availableHeight:
|
|
697
|
-
onClickLegend:
|
|
698
|
-
onHoverArea:
|
|
699
|
-
onHoverLegend:
|
|
700
|
-
onHoverPoint:
|
|
701
|
-
stackedDatasets:
|
|
702
|
-
unstackedDatasets:
|
|
700
|
+
availableHeight: te,
|
|
701
|
+
onClickLegend: ae,
|
|
702
|
+
onHoverArea: ie,
|
|
703
|
+
onHoverLegend: ne,
|
|
704
|
+
onHoverPoint: Q,
|
|
705
|
+
stackedDatasets: re.stackedDatasets,
|
|
706
|
+
unstackedDatasets: re.unstackedDatasets
|
|
703
707
|
}
|
|
704
708
|
),
|
|
705
|
-
|
|
706
|
-
|
|
709
|
+
O === "Table" && /* @__PURE__ */ e(
|
|
710
|
+
ot,
|
|
707
711
|
{
|
|
708
712
|
monthlyCategoryTotals: c,
|
|
709
|
-
onClickRow:
|
|
710
|
-
selectedCategory:
|
|
711
|
-
selectedDateRange:
|
|
713
|
+
onClickRow: K,
|
|
714
|
+
selectedCategory: M,
|
|
715
|
+
selectedDateRange: l
|
|
712
716
|
}
|
|
713
717
|
)
|
|
714
718
|
] })
|
|
@@ -716,21 +720,21 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
716
720
|
}
|
|
717
721
|
),
|
|
718
722
|
/* @__PURE__ */ e(
|
|
719
|
-
|
|
723
|
+
ho,
|
|
720
724
|
{
|
|
721
|
-
categoryGuid:
|
|
722
|
-
dateRange:
|
|
723
|
-
isOpen:
|
|
724
|
-
onClose: () =>
|
|
725
|
+
categoryGuid: M,
|
|
726
|
+
dateRange: l,
|
|
727
|
+
isOpen: W,
|
|
728
|
+
onClose: () => L(!1)
|
|
725
729
|
}
|
|
726
730
|
)
|
|
727
731
|
]
|
|
728
732
|
}
|
|
729
733
|
);
|
|
730
|
-
}, Rn =
|
|
731
|
-
const { monthlyCategoryTotals: o } = U(), { trends: r } =
|
|
734
|
+
}, Rn = R(go), mo = () => {
|
|
735
|
+
const { monthlyCategoryTotals: o } = U(), { trends: r } = N(), t = be(), { availableHeight: n = 300 } = ze(), s = Lt(o);
|
|
732
736
|
return /* @__PURE__ */ e(
|
|
733
|
-
|
|
737
|
+
We,
|
|
734
738
|
{
|
|
735
739
|
baseline: "min",
|
|
736
740
|
colors: [t.palette.primary.main],
|
|
@@ -745,36 +749,39 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
745
749
|
valueFormatterString: "0,0"
|
|
746
750
|
}
|
|
747
751
|
);
|
|
748
|
-
},
|
|
749
|
-
const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: s } = U(), { isInitialized:
|
|
750
|
-
return
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
752
|
+
}, po = R(mo), Co = ({ onPrimaryCtaClick: o, sx: r }) => {
|
|
753
|
+
const { visibleAccounts: t } = ve(), { loadMonthlyCategoryTotals: n, monthlyTotalsLoaded: s } = U(), { isInitialized: h } = Ne(), { trends: g } = N(), { isCopyLoaded: d, selectedAccounts: c, setSelectedAccounts: m } = me();
|
|
754
|
+
return we({
|
|
755
|
+
widgetName: "TrendsMiniWidget",
|
|
756
|
+
isLoaded: s
|
|
757
|
+
}), u.useEffect(() => {
|
|
758
|
+
m(t);
|
|
759
|
+
}, [t]), u.useEffect(() => {
|
|
760
|
+
h && n(c).finally();
|
|
761
|
+
}, [h, c]), !d || !h ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
762
|
+
Ht,
|
|
756
763
|
{
|
|
757
764
|
contentStyles: { height: "calc(100% - 72px)", ":last-child": { pb: 0 } },
|
|
758
765
|
onPrimaryCtaClick: o,
|
|
759
|
-
primaryCtaLabel:
|
|
760
|
-
subTitle:
|
|
766
|
+
primaryCtaLabel: g.primary_cta,
|
|
767
|
+
subTitle: g.sub_title,
|
|
761
768
|
sx: { height: "100%", ...r },
|
|
762
|
-
title:
|
|
763
|
-
children: s ? /* @__PURE__ */ e(
|
|
769
|
+
title: g.mini_title,
|
|
770
|
+
children: s ? /* @__PURE__ */ e(po, {}) : /* @__PURE__ */ e(ge, {})
|
|
764
771
|
}
|
|
765
772
|
);
|
|
766
|
-
}, kn =
|
|
773
|
+
}, kn = R(Co), yo = 70, Ve = ({
|
|
767
774
|
title: o,
|
|
768
775
|
totalAmount: r,
|
|
769
776
|
transactionType: t,
|
|
770
777
|
percentage: n,
|
|
771
778
|
secondaryLabel: s,
|
|
772
|
-
shouldDisplayPercentage:
|
|
779
|
+
shouldDisplayPercentage: h
|
|
773
780
|
}) => {
|
|
774
|
-
const { availableWidth:
|
|
781
|
+
const { availableWidth: g } = ze(), d = u.useRef(null), c = u.useRef(null), m = St(Number(Math.abs(n)), {
|
|
775
782
|
style: "percent",
|
|
776
783
|
minimumIntegerDigits: 1
|
|
777
|
-
}), C =
|
|
784
|
+
}), C = g === 288 && se(r, "0,0.00").length > 10 ? se(r, "0,0") : se(r, "0,0.00"), l = t === "spending" ? n > 0 : n >= 0, T = t === "spending" ? "error.main" : "success.main", a = t === "spending" ? "success.main" : "text.secondary", p = d?.current, _ = c?.current, y = p && _ ? p.scrollWidth > _.clientWidth - yo : !1;
|
|
778
785
|
return /* @__PURE__ */ f(
|
|
779
786
|
b,
|
|
780
787
|
{
|
|
@@ -798,17 +805,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
798
805
|
},
|
|
799
806
|
children: [
|
|
800
807
|
/* @__PURE__ */ e(he, { color: "text.secondary", variant: "caption", children: o }),
|
|
801
|
-
|
|
802
|
-
|
|
808
|
+
h && /* @__PURE__ */ f(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
809
|
+
l ? /* @__PURE__ */ e(Wt, { size: 20, sx: { color: T } }) : /* @__PURE__ */ e(Ot, { size: 20, sx: { color: a } }),
|
|
803
810
|
/* @__PURE__ */ e(
|
|
804
811
|
he,
|
|
805
812
|
{
|
|
806
813
|
sx: {
|
|
807
|
-
color:
|
|
814
|
+
color: l ? T : a,
|
|
808
815
|
fontWeight: 600
|
|
809
816
|
},
|
|
810
817
|
variant: "body2",
|
|
811
|
-
children:
|
|
818
|
+
children: m
|
|
812
819
|
}
|
|
813
820
|
)
|
|
814
821
|
] })
|
|
@@ -826,17 +833,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
826
833
|
},
|
|
827
834
|
children: [
|
|
828
835
|
/* @__PURE__ */ e(
|
|
829
|
-
|
|
836
|
+
H,
|
|
830
837
|
{
|
|
831
|
-
ref:
|
|
838
|
+
ref: d,
|
|
832
839
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
833
|
-
children: /* @__PURE__ */ e(
|
|
840
|
+
children: /* @__PURE__ */ e(Fe, { children: C })
|
|
834
841
|
}
|
|
835
842
|
),
|
|
836
|
-
|
|
843
|
+
h && g >= 450 && !y && /* @__PURE__ */ e(
|
|
837
844
|
he,
|
|
838
845
|
{
|
|
839
|
-
color:
|
|
846
|
+
color: l ? T : a,
|
|
840
847
|
variant: "caption",
|
|
841
848
|
children: s
|
|
842
849
|
}
|
|
@@ -847,49 +854,52 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
847
854
|
]
|
|
848
855
|
}
|
|
849
856
|
);
|
|
850
|
-
},
|
|
851
|
-
const { trends: o } =
|
|
857
|
+
}, fo = R(() => {
|
|
858
|
+
const { trends: o } = N();
|
|
852
859
|
return /* @__PURE__ */ f(b, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
853
|
-
/* @__PURE__ */ e(
|
|
860
|
+
/* @__PURE__ */ e(Gt, { size: 32 }),
|
|
854
861
|
/* @__PURE__ */ f(b, { children: [
|
|
855
862
|
/* @__PURE__ */ e(he, { fontWeight: 600, variant: "body1", children: o.zero_state_content_header }),
|
|
856
863
|
/* @__PURE__ */ e(he, { color: "text.secondary", variant: "subtitle2", children: o.zero_state_content_description })
|
|
857
864
|
] })
|
|
858
865
|
] });
|
|
859
|
-
}), Hn =
|
|
860
|
-
const { visibleAccounts: r } = ve(), { onEvent: t } =
|
|
861
|
-
start:
|
|
866
|
+
}), Hn = R(({ onCtaClick: o }) => {
|
|
867
|
+
const { visibleAccounts: r } = ve(), { onEvent: t } = V(), { monthlyCategoryTotals: n, loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: h } = U(), g = {
|
|
868
|
+
start: Nt(/* @__PURE__ */ new Date(), 1),
|
|
862
869
|
end: /* @__PURE__ */ new Date()
|
|
863
|
-
}, { trends:
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
870
|
+
}, { trends: d } = N(), { selectedAccounts: c, setSelectedAccounts: m, isInitialized: C } = me();
|
|
871
|
+
we({
|
|
872
|
+
widgetName: "TrendsMicroWidget",
|
|
873
|
+
isLoaded: h
|
|
874
|
+
}), u.useEffect(() => {
|
|
875
|
+
m(r);
|
|
876
|
+
}, [r]), u.useEffect(() => {
|
|
877
|
+
C && s(c, g.start).then(() => {
|
|
868
878
|
t(v.TRENDS_LOAD_WIDGET, {
|
|
869
879
|
state: r?.length ? "default" : "zeroState"
|
|
870
880
|
});
|
|
871
881
|
});
|
|
872
882
|
}, [C, c]);
|
|
873
|
-
const { spendingData:
|
|
883
|
+
const { spendingData: l, incomeData: T } = u.useMemo(
|
|
874
884
|
() => ({
|
|
875
|
-
spendingData:
|
|
876
|
-
incomeData:
|
|
885
|
+
spendingData: Ye(n, g),
|
|
886
|
+
incomeData: Ue(n, g)
|
|
877
887
|
}),
|
|
878
|
-
[n,
|
|
879
|
-
), [
|
|
888
|
+
[n, g]
|
|
889
|
+
), [a, p] = l, [_, y] = T, E = Ge(p.y, a.y), x = Ge(y.y, _.y), I = C && !r?.length, W = () => {
|
|
880
890
|
t(
|
|
881
|
-
|
|
891
|
+
I ? v.TRENDS_CLICK_GET_STARTED : v.TRENDS_CLICK_VIEW_MORE
|
|
882
892
|
), o();
|
|
883
893
|
};
|
|
884
|
-
return !
|
|
885
|
-
|
|
894
|
+
return !h || !C ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
895
|
+
Pt,
|
|
886
896
|
{
|
|
887
897
|
className: "mx-trends-microwidget",
|
|
888
|
-
ctaLabel:
|
|
889
|
-
onCTAClick:
|
|
890
|
-
subHeader:
|
|
891
|
-
title:
|
|
892
|
-
children:
|
|
898
|
+
ctaLabel: d.micro_primary_cta_label,
|
|
899
|
+
onCTAClick: W,
|
|
900
|
+
subHeader: I ? void 0 : d.micro_subheader,
|
|
901
|
+
title: d.title,
|
|
902
|
+
children: I ? /* @__PURE__ */ e(fo, {}) : /* @__PURE__ */ f(
|
|
893
903
|
b,
|
|
894
904
|
{
|
|
895
905
|
sx: {
|
|
@@ -899,23 +909,23 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
899
909
|
},
|
|
900
910
|
children: [
|
|
901
911
|
/* @__PURE__ */ e(
|
|
902
|
-
|
|
912
|
+
Ve,
|
|
903
913
|
{
|
|
904
|
-
percentage:
|
|
905
|
-
secondaryLabel:
|
|
906
|
-
shouldDisplayPercentage:
|
|
907
|
-
title:
|
|
908
|
-
totalAmount:
|
|
914
|
+
percentage: E,
|
|
915
|
+
secondaryLabel: d.micro_secondary_label,
|
|
916
|
+
shouldDisplayPercentage: p.y !== 0 && a.y !== 0,
|
|
917
|
+
title: d.spending_label,
|
|
918
|
+
totalAmount: p.y,
|
|
909
919
|
transactionType: "spending"
|
|
910
920
|
}
|
|
911
921
|
),
|
|
912
922
|
/* @__PURE__ */ e(
|
|
913
|
-
|
|
923
|
+
Ve,
|
|
914
924
|
{
|
|
915
925
|
percentage: x,
|
|
916
|
-
secondaryLabel:
|
|
917
|
-
shouldDisplayPercentage: y.y !== 0 &&
|
|
918
|
-
title:
|
|
926
|
+
secondaryLabel: d.micro_secondary_label,
|
|
927
|
+
shouldDisplayPercentage: y.y !== 0 && _.y !== 0,
|
|
928
|
+
title: d.income_label,
|
|
919
929
|
totalAmount: y.y,
|
|
920
930
|
transactionType: "income"
|
|
921
931
|
}
|
|
@@ -925,17 +935,17 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
925
935
|
)
|
|
926
936
|
}
|
|
927
937
|
);
|
|
928
|
-
}),
|
|
938
|
+
}), _o = R(
|
|
929
939
|
({ isExpanded: o, onClick: r }) => {
|
|
930
940
|
const t = qe();
|
|
931
|
-
return /* @__PURE__ */ e(
|
|
941
|
+
return /* @__PURE__ */ e(zt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Kt, { onClick: r, sx: { justifyContent: "center" }, children: /* @__PURE__ */ f(
|
|
932
942
|
b,
|
|
933
943
|
{
|
|
934
944
|
sx: { color: t.palette.primary.main, flexDirection: "row", alignItems: "center" },
|
|
935
945
|
children: [
|
|
936
|
-
/* @__PURE__ */ e(
|
|
937
|
-
/* @__PURE__ */ e(
|
|
938
|
-
|
|
946
|
+
/* @__PURE__ */ e(Yt, { children: /* @__PURE__ */ e($, { bold: !0, variant: "body2", children: o ? "View less" : "View more" }) }),
|
|
947
|
+
/* @__PURE__ */ e(jt, { sx: { color: t.palette.primary.main }, children: o ? /* @__PURE__ */ e(Bt, {}) : /* @__PURE__ */ e(
|
|
948
|
+
Vt,
|
|
939
949
|
{
|
|
940
950
|
sx: {
|
|
941
951
|
transition: "transform 0.3s ease-in-out",
|
|
@@ -947,101 +957,101 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
947
957
|
}
|
|
948
958
|
) }) });
|
|
949
959
|
}
|
|
950
|
-
),
|
|
960
|
+
), Pe = R(
|
|
951
961
|
({
|
|
952
962
|
totalAmount: o,
|
|
953
963
|
guid: r,
|
|
954
964
|
name: t,
|
|
955
965
|
transactions: n,
|
|
956
966
|
onClick: s,
|
|
957
|
-
isLastItem:
|
|
958
|
-
showDivider:
|
|
967
|
+
isLastItem: h = !1,
|
|
968
|
+
showDivider: g = !0
|
|
959
969
|
}) => {
|
|
960
|
-
const { trends:
|
|
970
|
+
const { trends: d } = N(), { onEvent: c } = V(), m = `${n.length} ${n.length === 1 ? d.transaction : d.transactions}`, C = () => {
|
|
961
971
|
s?.(), c(v.TRENDS_CLICK_LIST_ITEM, {
|
|
962
972
|
...G,
|
|
963
973
|
listItem: t
|
|
964
974
|
});
|
|
965
975
|
};
|
|
966
|
-
return /* @__PURE__ */ f(
|
|
976
|
+
return /* @__PURE__ */ f(u.Fragment, { children: [
|
|
967
977
|
/* @__PURE__ */ e(
|
|
968
|
-
|
|
978
|
+
je,
|
|
969
979
|
{
|
|
970
980
|
leftIcon: r ? /* @__PURE__ */ e(Se, { categoryGuid: r }) : void 0,
|
|
971
981
|
onClick: C,
|
|
972
|
-
rightContent:
|
|
982
|
+
rightContent: se(Math.abs(o), "0,0.00"),
|
|
973
983
|
rightIcon: s ? /* @__PURE__ */ e(lt, {}) : void 0,
|
|
974
|
-
subtitle:
|
|
984
|
+
subtitle: m,
|
|
975
985
|
title: t
|
|
976
986
|
}
|
|
977
987
|
),
|
|
978
|
-
|
|
988
|
+
g && /* @__PURE__ */ e(ke, { sx: { ml: h ? 24 : 68 } })
|
|
979
989
|
] }, r);
|
|
980
990
|
}
|
|
981
|
-
),
|
|
991
|
+
), To = R(
|
|
982
992
|
({ availableHeight: o = 0, onCategoryClick: r }) => {
|
|
983
|
-
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = pe(), { isLargeDesktop:
|
|
984
|
-
|
|
985
|
-
const
|
|
986
|
-
|
|
993
|
+
const { collapsedCategories: t, visibleCategories: n, setVisibleListLength: s } = pe(), { isLargeDesktop: h, isDesktop: g } = ee(), { trends: d } = N(), { onEvent: c } = V(), [m, C] = u.useState(!1), l = g || h;
|
|
994
|
+
u.useEffect(() => {
|
|
995
|
+
const p = Math.floor(o / 64) - 1, _ = n.length + t.length;
|
|
996
|
+
p !== n.length && (s(l ? Math.max(p, 5) : 5), C(p >= _));
|
|
987
997
|
}, [o]);
|
|
988
|
-
const
|
|
989
|
-
C(!
|
|
998
|
+
const T = () => {
|
|
999
|
+
C(!m), c(v.TRENDS_CLICK_VIEW_MORE, {
|
|
990
1000
|
...G
|
|
991
1001
|
});
|
|
992
|
-
},
|
|
993
|
-
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f(
|
|
994
|
-
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(
|
|
995
|
-
n.map((
|
|
996
|
-
|
|
1002
|
+
}, a = n.length + (m ? t.length : 0);
|
|
1003
|
+
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ f($t, { children: [
|
|
1004
|
+
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Fe, { children: d.categories }) }),
|
|
1005
|
+
n.map((p, _) => /* @__PURE__ */ e(
|
|
1006
|
+
Pe,
|
|
997
1007
|
{
|
|
998
|
-
...
|
|
999
|
-
isLastItem:
|
|
1000
|
-
onClick:
|
|
1008
|
+
...p,
|
|
1009
|
+
isLastItem: _ === a - 1,
|
|
1010
|
+
onClick: p.transactions.length > 0 ? () => r(p) : void 0,
|
|
1001
1011
|
showDivider: !0
|
|
1002
1012
|
},
|
|
1003
|
-
|
|
1013
|
+
p.guid
|
|
1004
1014
|
)),
|
|
1005
1015
|
/* @__PURE__ */ e(
|
|
1006
1016
|
Ft,
|
|
1007
1017
|
{
|
|
1008
|
-
in:
|
|
1018
|
+
in: m,
|
|
1009
1019
|
sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
|
|
1010
|
-
children: t.map((
|
|
1011
|
-
const y = n.length +
|
|
1020
|
+
children: t.map((p, _) => {
|
|
1021
|
+
const y = n.length + _;
|
|
1012
1022
|
return /* @__PURE__ */ e(
|
|
1013
|
-
|
|
1023
|
+
Pe,
|
|
1014
1024
|
{
|
|
1015
|
-
...
|
|
1016
|
-
isLastItem: y ===
|
|
1017
|
-
onClick:
|
|
1025
|
+
...p,
|
|
1026
|
+
isLastItem: y === a - 1,
|
|
1027
|
+
onClick: p.transactions.length > 0 ? () => r(p) : void 0,
|
|
1018
1028
|
showDivider: !0
|
|
1019
1029
|
},
|
|
1020
|
-
|
|
1030
|
+
p.guid
|
|
1021
1031
|
);
|
|
1022
1032
|
})
|
|
1023
1033
|
}
|
|
1024
1034
|
),
|
|
1025
|
-
t.length > 0 && /* @__PURE__ */ e(
|
|
1035
|
+
t.length > 0 && /* @__PURE__ */ e(_o, { isExpanded: m, onClick: T })
|
|
1026
1036
|
] }) });
|
|
1027
1037
|
}
|
|
1028
|
-
),
|
|
1029
|
-
const { onEvent: t } =
|
|
1038
|
+
), So = ({ beats: o, onInsightCardClick: r }) => {
|
|
1039
|
+
const { onEvent: t } = V(), { isMobile: n, isDesktop: s, isLargeDesktop: h } = ee(), { beatStore: g, endpoint: d, sessionToken: c } = Ne(), m = s || h, C = m || n ? 1 : 2, l = () => null, T = (x) => {
|
|
1030
1040
|
r?.(x), t(v.TRENDS_CLICK_INSIGHT, G);
|
|
1031
|
-
},
|
|
1032
|
-
return /* @__PURE__ */ e(
|
|
1033
|
-
|
|
1041
|
+
}, a = m ? 200 : 170, p = m ? 170 : 124, _ = m ? 56 : 0, y = o.length > 0 ? a + _ : p, E = m && o.length > 0 ? a : void 0;
|
|
1042
|
+
return /* @__PURE__ */ e(_t, { sx: { height: y }, children: /* @__PURE__ */ e(
|
|
1043
|
+
kt,
|
|
1034
1044
|
{
|
|
1035
|
-
areBeatsLoading:
|
|
1045
|
+
areBeatsLoading: g.isLoading,
|
|
1036
1046
|
beats: o,
|
|
1037
|
-
endpoint:
|
|
1038
|
-
heightOverrides:
|
|
1039
|
-
logOutUser:
|
|
1040
|
-
onCardClick:
|
|
1047
|
+
endpoint: d,
|
|
1048
|
+
heightOverrides: E,
|
|
1049
|
+
logOutUser: l,
|
|
1050
|
+
onCardClick: T,
|
|
1041
1051
|
showBorder: !0,
|
|
1042
1052
|
showCTAColocatedWithText: !1,
|
|
1043
1053
|
showCarouselControls: !0,
|
|
1044
|
-
showHeader:
|
|
1054
|
+
showHeader: m,
|
|
1045
1055
|
showIcon: !0,
|
|
1046
1056
|
showWithMargin: !1,
|
|
1047
1057
|
token: c,
|
|
@@ -1050,12 +1060,12 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1050
1060
|
visibleCardsCount: C
|
|
1051
1061
|
}
|
|
1052
1062
|
) });
|
|
1053
|
-
},
|
|
1054
|
-
const { onEvent: t } =
|
|
1063
|
+
}, bo = R(So), xo = R(({ chartLabel: o, chartColor: r }) => {
|
|
1064
|
+
const { onEvent: t } = V(), {
|
|
1055
1065
|
categoryDetailsChartData: { monthlyAmounts: n, tooltipLabels: s }
|
|
1056
1066
|
} = pe();
|
|
1057
1067
|
return /* @__PURE__ */ e(b, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
1058
|
-
|
|
1068
|
+
We,
|
|
1059
1069
|
{
|
|
1060
1070
|
baseline: "min",
|
|
1061
1071
|
colors: [r],
|
|
@@ -1083,100 +1093,100 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1083
1093
|
valueFormatterString: "0,0"
|
|
1084
1094
|
}
|
|
1085
1095
|
) });
|
|
1086
|
-
}),
|
|
1087
|
-
const r = qe(), { onEvent: t } =
|
|
1088
|
-
if (!
|
|
1096
|
+
}), vo = R(({ onClose: o }) => {
|
|
1097
|
+
const r = qe(), { onEvent: t } = V(), { common: n, trends: s } = N(), { selectedCategoryData: h, selectedDateRangeMonthRange: g } = pe(), { sortedTransactions: d } = xe(), [c, m] = u.useState(null);
|
|
1098
|
+
if (!h)
|
|
1089
1099
|
return null;
|
|
1090
|
-
const { guid: C, name:
|
|
1091
|
-
() =>
|
|
1092
|
-
[c,
|
|
1093
|
-
),
|
|
1100
|
+
const { guid: C, name: l, is_income: T, totalAmount: a } = h, p = T ? s.category_income : s.category_spending, _ = Xt(C, r), y = T ? s.income_label : s.spending_label, E = ` ${h.transactions.length === 1 ? s.transaction : s.transactions} (${h.transactions.length})`, x = u.useMemo(
|
|
1101
|
+
() => d.find((L) => L.guid === c),
|
|
1102
|
+
[c, d]
|
|
1103
|
+
), I = (L) => L.category_guid === C || L.top_level_category_guid === C, W = () => {
|
|
1094
1104
|
o?.(), t(v.TRENDS_CLICK_BACK, G);
|
|
1095
1105
|
};
|
|
1096
1106
|
return /* @__PURE__ */ f(
|
|
1097
|
-
|
|
1107
|
+
He,
|
|
1098
1108
|
{
|
|
1099
1109
|
ariaLabelClose: s.close_category_details,
|
|
1100
1110
|
isOpen: !0,
|
|
1101
|
-
onClose:
|
|
1111
|
+
onClose: W,
|
|
1102
1112
|
shouldShowHeaderShadow: !0,
|
|
1103
|
-
title:
|
|
1113
|
+
title: p,
|
|
1104
1114
|
children: [
|
|
1105
1115
|
/* @__PURE__ */ f(b, { sx: { alignItems: "center", height: "100%" }, children: [
|
|
1106
|
-
/* @__PURE__ */ f(
|
|
1116
|
+
/* @__PURE__ */ f(Ut, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
|
|
1107
1117
|
/* @__PURE__ */ e(
|
|
1108
|
-
|
|
1118
|
+
je,
|
|
1109
1119
|
{
|
|
1110
1120
|
leftIcon: /* @__PURE__ */ e(Se, { categoryGuid: C }),
|
|
1111
|
-
rightContent:
|
|
1112
|
-
subtitle:
|
|
1113
|
-
title:
|
|
1121
|
+
rightContent: se(Math.abs(a), "0,0.00"),
|
|
1122
|
+
subtitle: g,
|
|
1123
|
+
title: l
|
|
1114
1124
|
}
|
|
1115
1125
|
),
|
|
1116
|
-
/* @__PURE__ */ e(
|
|
1126
|
+
/* @__PURE__ */ e(xo, { chartColor: _, chartLabel: y }),
|
|
1117
1127
|
/* @__PURE__ */ f(b, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
|
|
1118
|
-
/* @__PURE__ */ e(
|
|
1119
|
-
/* @__PURE__ */ e(
|
|
1128
|
+
/* @__PURE__ */ e($, { bold: !0, variant: "body1", children: E }),
|
|
1129
|
+
/* @__PURE__ */ e(Zt, { filter: I })
|
|
1120
1130
|
] })
|
|
1121
1131
|
] }),
|
|
1122
1132
|
/* @__PURE__ */ e(
|
|
1123
|
-
|
|
1133
|
+
Qe,
|
|
1124
1134
|
{
|
|
1125
1135
|
bgcolor: "transparent",
|
|
1126
|
-
filter:
|
|
1136
|
+
filter: I,
|
|
1127
1137
|
height: "calc(100vh - 475px)",
|
|
1128
|
-
onClick:
|
|
1138
|
+
onClick: m
|
|
1129
1139
|
}
|
|
1130
1140
|
)
|
|
1131
1141
|
] }),
|
|
1132
1142
|
/* @__PURE__ */ e(
|
|
1133
|
-
|
|
1143
|
+
He,
|
|
1134
1144
|
{
|
|
1135
1145
|
ariaLabelClose: n.close_aria,
|
|
1136
1146
|
isOpen: !!x,
|
|
1137
|
-
onClose: () =>
|
|
1147
|
+
onClose: () => m(""),
|
|
1138
1148
|
title: s.transaction,
|
|
1139
|
-
children: x && /* @__PURE__ */ e(
|
|
1149
|
+
children: x && /* @__PURE__ */ e(Ze, { transaction: x })
|
|
1140
1150
|
}
|
|
1141
1151
|
)
|
|
1142
1152
|
]
|
|
1143
1153
|
}
|
|
1144
1154
|
);
|
|
1145
|
-
}),
|
|
1146
|
-
const t =
|
|
1155
|
+
}), wo = (o, r) => {
|
|
1156
|
+
const t = Ue(o, r), n = Ye(o, r);
|
|
1147
1157
|
return [t, n].filter((s) => s.length > 0);
|
|
1148
|
-
},
|
|
1149
|
-
const [t, n] = o, s = t,
|
|
1158
|
+
}, Do = (o, r) => {
|
|
1159
|
+
const [t, n] = o, s = t, h = n ?? t, g = [];
|
|
1150
1160
|
if (s) {
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1161
|
+
const d = s.reduce((c, m) => c + m.y, 0);
|
|
1162
|
+
g.push({ label: r.income_label, amount: d });
|
|
1153
1163
|
}
|
|
1154
|
-
if (
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1164
|
+
if (h) {
|
|
1165
|
+
const d = h.reduce((c, m) => c + m.y, 0);
|
|
1166
|
+
g.push({ label: r.spending_label, amount: d });
|
|
1157
1167
|
}
|
|
1158
|
-
return
|
|
1159
|
-
},
|
|
1168
|
+
return g;
|
|
1169
|
+
}, Io = ({
|
|
1160
1170
|
availableHeight: o = 0,
|
|
1161
1171
|
minHeight: r = 500,
|
|
1162
1172
|
selectedDateRange: t,
|
|
1163
1173
|
totals: n
|
|
1164
1174
|
}) => {
|
|
1165
|
-
const s = be(), { onEvent:
|
|
1166
|
-
return
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1175
|
+
const s = be(), { onEvent: h } = V(), { trends: g } = N(), { isSmallMobile: d, isMobile: c, isSmallTablet: m, isTablet: C } = ee(), l = [s.palette.chart?.chart1, s.palette.chart?.chart2], T = wo(n, t), a = Do(T, g), [p, _] = u.useState(0), y = 458, E = 195, x = 56, I = c || d ? E : m || C ? y : p;
|
|
1176
|
+
return u.useEffect(() => {
|
|
1177
|
+
const L = Math.max(o - x, r);
|
|
1178
|
+
_(L);
|
|
1169
1179
|
}, [o]), /* @__PURE__ */ e(
|
|
1170
|
-
|
|
1180
|
+
We,
|
|
1171
1181
|
{
|
|
1172
1182
|
baseline: "min",
|
|
1173
|
-
colors:
|
|
1183
|
+
colors: l,
|
|
1174
1184
|
curveType: "bump",
|
|
1175
|
-
datasets:
|
|
1176
|
-
height:
|
|
1177
|
-
labels:
|
|
1185
|
+
datasets: T,
|
|
1186
|
+
height: I,
|
|
1187
|
+
labels: a,
|
|
1178
1188
|
onItemClick: () => {
|
|
1179
|
-
|
|
1189
|
+
h(v.TRENDS_CLICK_CHART, G);
|
|
1180
1190
|
},
|
|
1181
1191
|
showArea: !0,
|
|
1182
1192
|
showAxisHighlight: !0,
|
|
@@ -1189,7 +1199,7 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1189
1199
|
valueFormatterString: "0.0a"
|
|
1190
1200
|
}
|
|
1191
1201
|
);
|
|
1192
|
-
},
|
|
1202
|
+
}, Eo = R(Io), Lo = [
|
|
1193
1203
|
"BillAmountNotStandard",
|
|
1194
1204
|
"CategorySpendingV2",
|
|
1195
1205
|
"CostOfLivingToIncome",
|
|
@@ -1223,109 +1233,112 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1223
1233
|
"WeeklyNewMerchantsV2",
|
|
1224
1234
|
"WeeklyNoSpendDays",
|
|
1225
1235
|
"WeeklySmallPurchasesSummary"
|
|
1226
|
-
],
|
|
1227
|
-
const { onEvent: n } =
|
|
1228
|
-
isCopyLoaded:
|
|
1229
|
-
isInitialized:
|
|
1230
|
-
selectedAccounts:
|
|
1231
|
-
selectedAccountGuids:
|
|
1232
|
-
setSelectedAccounts:
|
|
1233
|
-
} = me(), { trends:
|
|
1234
|
-
() =>
|
|
1235
|
-
[
|
|
1236
|
+
], Mo = ({ onBackClick: o, onInsightCardClick: r, sx: t }) => {
|
|
1237
|
+
const { onEvent: n } = V(), { config: s } = mt(), { isLargeDesktop: h, isDesktop: g, isMobile: d } = ee(), { visibleAccounts: c } = ve(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: C, monthlyCategoryTotals: l } = U(), { setFilter: T } = xe(), { selectedDateRange: a, setSelectedCategoryData: p, setSelectedDateRange: _ } = pe(), {
|
|
1238
|
+
isCopyLoaded: y,
|
|
1239
|
+
isInitialized: E,
|
|
1240
|
+
selectedAccounts: x,
|
|
1241
|
+
selectedAccountGuids: I,
|
|
1242
|
+
setSelectedAccounts: W
|
|
1243
|
+
} = me(), { trends: L, connect: O } = N(), { beatStore: A } = Ne(), P = Qt() && s.show_insights_widget_in_master, z = g || h, [X, Ce] = u.useState(!1), [te, re] = u.useState(!1), [Z, ce] = u.useState("Chart"), [oe, K] = u.useState(""), [ae, ne] = u.useState(!1), [ie, Q] = u.useState(window.innerHeight), w = z ? 56 : 0, B = ie - 208, j = ie - (P ? 550 + w : 266), [le, ye] = u.useState(!1), De = s.show_connections_widget_in_master ? "buttons" : "no-buttons", i = u.useMemo(
|
|
1244
|
+
() => c && c.length === 0 || l.length === 0,
|
|
1245
|
+
[c, l]
|
|
1236
1246
|
);
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1247
|
+
we({
|
|
1248
|
+
widgetName: "TrendsWidget",
|
|
1249
|
+
isLoaded: X
|
|
1250
|
+
}), u.useEffect(() => {
|
|
1251
|
+
E && A.loadBeats().finally(() => re(!0));
|
|
1252
|
+
}, [E]);
|
|
1253
|
+
const S = u.useMemo(() => te ? A.getFilteredBeats({ templates: Lo }) : [], [te]);
|
|
1254
|
+
u.useEffect(() => {
|
|
1255
|
+
const k = () => Q(window.innerHeight);
|
|
1256
|
+
return window.addEventListener("resize", k), () => window.removeEventListener("resize", k);
|
|
1257
|
+
}, []), u.useEffect(() => {
|
|
1258
|
+
W(c);
|
|
1259
|
+
}, [c]), u.useEffect(() => {
|
|
1260
|
+
E && m(x, a.start, a.end).then(() => {
|
|
1261
|
+
C(
|
|
1262
|
+
x,
|
|
1263
|
+
a.start,
|
|
1264
|
+
a.end
|
|
1252
1265
|
);
|
|
1253
1266
|
}).finally(() => {
|
|
1254
|
-
|
|
1267
|
+
Ce(!0), n(v.TRENDS_LOAD_WIDGET, {
|
|
1255
1268
|
...G,
|
|
1256
|
-
time_period: `${
|
|
1257
|
-
})
|
|
1269
|
+
time_period: `${Re(a.end, a.start)}M`
|
|
1270
|
+
});
|
|
1258
1271
|
});
|
|
1259
|
-
}, [
|
|
1260
|
-
if (
|
|
1261
|
-
const
|
|
1262
|
-
accounts:
|
|
1263
|
-
dateRange: { start:
|
|
1272
|
+
}, [E, x, a]), u.useEffect(() => {
|
|
1273
|
+
if (l.length !== 0) {
|
|
1274
|
+
const k = {
|
|
1275
|
+
accounts: I,
|
|
1276
|
+
dateRange: { start: a.start, end: a.end }
|
|
1264
1277
|
};
|
|
1265
|
-
|
|
1266
|
-
...
|
|
1267
|
-
custom: (
|
|
1268
|
-
(ue) => ue.top_level_category_guid ===
|
|
1278
|
+
T({
|
|
1279
|
+
...k,
|
|
1280
|
+
custom: (q) => !!l.find(
|
|
1281
|
+
(ue) => ue.top_level_category_guid === q.top_level_category_guid || ue.category_guid === q.category_guid
|
|
1269
1282
|
)
|
|
1270
1283
|
});
|
|
1271
1284
|
}
|
|
1272
|
-
}, [
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1275
|
-
},
|
|
1276
|
-
|
|
1285
|
+
}, [l]);
|
|
1286
|
+
const D = (k) => {
|
|
1287
|
+
p(k), ne(!0);
|
|
1288
|
+
}, Y = () => {
|
|
1289
|
+
p(null), ne(!1);
|
|
1277
1290
|
}, Ie = () => {
|
|
1278
1291
|
ye(!0), n(v.TRENDS_CLICK_CONNECT_ACCOUNTS);
|
|
1279
|
-
},
|
|
1280
|
-
ce(
|
|
1292
|
+
}, Ee = (k, q) => {
|
|
1293
|
+
ce(q ?? Z), n(v.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
1281
1294
|
...G,
|
|
1282
|
-
toggleView:
|
|
1295
|
+
toggleView: q
|
|
1283
1296
|
});
|
|
1284
|
-
},
|
|
1285
|
-
const
|
|
1286
|
-
|
|
1297
|
+
}, de = (k) => {
|
|
1298
|
+
const q = $e(k?.[0], 1), ue = k?.[1], st = Re(ue, q);
|
|
1299
|
+
_({ start: q, end: ue }), n(v.TRENDS_CLICK_TIME_WINDOW, {
|
|
1287
1300
|
...G,
|
|
1288
1301
|
time_period: st + "M"
|
|
1289
1302
|
});
|
|
1290
|
-
}, Le = (
|
|
1303
|
+
}, Le = (k) => {
|
|
1291
1304
|
n(v.TRENDS_CLICK_FILTER, {
|
|
1292
1305
|
...G,
|
|
1293
|
-
filterValue:
|
|
1306
|
+
filterValue: k
|
|
1294
1307
|
});
|
|
1295
|
-
},
|
|
1296
|
-
|
|
1308
|
+
}, Me = (k) => {
|
|
1309
|
+
K(k);
|
|
1297
1310
|
}, nt = () => {
|
|
1298
|
-
|
|
1311
|
+
K(""), n(v.TRENDS_CLICK_ALL_CATEGORIES, G);
|
|
1299
1312
|
};
|
|
1300
|
-
return !
|
|
1301
|
-
|
|
1313
|
+
return !y || !X ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ f(
|
|
1314
|
+
Xe,
|
|
1302
1315
|
{
|
|
1303
|
-
accountOptions:
|
|
1304
|
-
calendarActions: { onRangeChanged:
|
|
1305
|
-
dateRange:
|
|
1306
|
-
dateRangeVariant:
|
|
1316
|
+
accountOptions: c,
|
|
1317
|
+
calendarActions: { onRangeChanged: de },
|
|
1318
|
+
dateRange: a,
|
|
1319
|
+
dateRangeVariant: d ? "timeframetabs" : "timeframebuttons",
|
|
1307
1320
|
onAccountsFilterClick: Le,
|
|
1308
1321
|
onBackClick: o,
|
|
1309
1322
|
sx: t,
|
|
1310
|
-
title:
|
|
1323
|
+
title: L.title,
|
|
1311
1324
|
children: [
|
|
1312
|
-
|
|
1313
|
-
|
|
1325
|
+
i && /* @__PURE__ */ e(
|
|
1326
|
+
qt,
|
|
1314
1327
|
{
|
|
1315
|
-
header:
|
|
1328
|
+
header: L.zero_state_content_header,
|
|
1316
1329
|
icon: "",
|
|
1317
1330
|
onClick: Ie,
|
|
1318
|
-
primaryButton:
|
|
1319
|
-
subText:
|
|
1320
|
-
sx: { height:
|
|
1321
|
-
variant:
|
|
1331
|
+
primaryButton: L.empty_state_primary,
|
|
1332
|
+
subText: L.empty_state_sub_text,
|
|
1333
|
+
sx: { height: B },
|
|
1334
|
+
variant: De
|
|
1322
1335
|
}
|
|
1323
1336
|
),
|
|
1324
|
-
!
|
|
1337
|
+
!i && /* @__PURE__ */ f(
|
|
1325
1338
|
b,
|
|
1326
1339
|
{
|
|
1327
1340
|
sx: {
|
|
1328
|
-
px:
|
|
1341
|
+
px: d ? 0 : 48
|
|
1329
1342
|
},
|
|
1330
1343
|
children: [
|
|
1331
1344
|
/* @__PURE__ */ f(
|
|
@@ -1333,78 +1346,78 @@ const Qe = ({ categoryGuid: o, topLevelCategoryGuid: r }) => {
|
|
|
1333
1346
|
{
|
|
1334
1347
|
flexDirection: "row",
|
|
1335
1348
|
justifyContent: "space-between",
|
|
1336
|
-
sx: { pb:
|
|
1349
|
+
sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
|
|
1337
1350
|
children: [
|
|
1338
1351
|
/* @__PURE__ */ e(
|
|
1339
|
-
|
|
1352
|
+
tt,
|
|
1340
1353
|
{
|
|
1341
|
-
selectedCategoryGuid:
|
|
1342
|
-
selectedDateRange:
|
|
1354
|
+
selectedCategoryGuid: oe,
|
|
1355
|
+
selectedDateRange: a
|
|
1343
1356
|
}
|
|
1344
1357
|
),
|
|
1345
|
-
/* @__PURE__ */ e(
|
|
1358
|
+
/* @__PURE__ */ e(et, { onTabChange: Ee, selectedTab: Z })
|
|
1346
1359
|
]
|
|
1347
1360
|
}
|
|
1348
1361
|
),
|
|
1349
|
-
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(
|
|
1362
|
+
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(H, { flexGrow: 1, children: oe && /* @__PURE__ */ f(_e, { onClick: nt, sx: { p: 0, pr: 5 }, children: [
|
|
1350
1363
|
/* @__PURE__ */ e(fe, { name: "arrow_back" }),
|
|
1351
|
-
|
|
1364
|
+
L.all_categories
|
|
1352
1365
|
] }) }) }),
|
|
1353
|
-
/* @__PURE__ */ f(b, { flexDirection:
|
|
1354
|
-
|
|
1355
|
-
/* @__PURE__ */ e(
|
|
1356
|
-
|
|
1366
|
+
/* @__PURE__ */ f(b, { flexDirection: z ? "row" : "column", gap: z ? 48 : 16, children: [
|
|
1367
|
+
Z === "Chart" && /* @__PURE__ */ f(rt, { children: [
|
|
1368
|
+
/* @__PURE__ */ e(H, { sx: { width: z ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
1369
|
+
Eo,
|
|
1357
1370
|
{
|
|
1358
|
-
availableHeight:
|
|
1371
|
+
availableHeight: B,
|
|
1359
1372
|
minHeight: 450,
|
|
1360
|
-
selectedDateRange:
|
|
1361
|
-
totals:
|
|
1373
|
+
selectedDateRange: a,
|
|
1374
|
+
totals: l
|
|
1362
1375
|
}
|
|
1363
1376
|
) }),
|
|
1364
|
-
/* @__PURE__ */ f(b, { gap: 16, sx: { width:
|
|
1365
|
-
|
|
1366
|
-
|
|
1377
|
+
/* @__PURE__ */ f(b, { gap: 16, sx: { width: z ? "32%" : "100%" }, children: [
|
|
1378
|
+
P && te && S.length > 0 && /* @__PURE__ */ e(
|
|
1379
|
+
bo,
|
|
1367
1380
|
{
|
|
1368
|
-
beats:
|
|
1381
|
+
beats: S,
|
|
1369
1382
|
onInsightCardClick: r
|
|
1370
1383
|
}
|
|
1371
1384
|
),
|
|
1372
1385
|
/* @__PURE__ */ e(
|
|
1373
|
-
|
|
1386
|
+
To,
|
|
1374
1387
|
{
|
|
1375
|
-
availableHeight:
|
|
1376
|
-
onCategoryClick:
|
|
1388
|
+
availableHeight: j,
|
|
1389
|
+
onCategoryClick: D
|
|
1377
1390
|
}
|
|
1378
1391
|
)
|
|
1379
1392
|
] })
|
|
1380
1393
|
] }),
|
|
1381
|
-
|
|
1382
|
-
|
|
1394
|
+
Z === "Table" && /* @__PURE__ */ e(H, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1395
|
+
ot,
|
|
1383
1396
|
{
|
|
1384
1397
|
height: "unset",
|
|
1385
|
-
monthlyCategoryTotals:
|
|
1386
|
-
onClickRow:
|
|
1387
|
-
selectedCategory:
|
|
1388
|
-
selectedDateRange:
|
|
1398
|
+
monthlyCategoryTotals: l,
|
|
1399
|
+
onClickRow: Me,
|
|
1400
|
+
selectedCategory: oe,
|
|
1401
|
+
selectedDateRange: a
|
|
1389
1402
|
}
|
|
1390
1403
|
) })
|
|
1391
1404
|
] }),
|
|
1392
|
-
|
|
1405
|
+
ae && /* @__PURE__ */ e(vo, { onClose: Y })
|
|
1393
1406
|
]
|
|
1394
1407
|
}
|
|
1395
1408
|
),
|
|
1396
1409
|
/* @__PURE__ */ e(
|
|
1397
|
-
|
|
1410
|
+
Jt,
|
|
1398
1411
|
{
|
|
1399
1412
|
onClose: () => ye(!1),
|
|
1400
|
-
showConnectWidget:
|
|
1401
|
-
title:
|
|
1413
|
+
showConnectWidget: le,
|
|
1414
|
+
title: O.mini_title
|
|
1402
1415
|
}
|
|
1403
1416
|
)
|
|
1404
1417
|
]
|
|
1405
1418
|
}
|
|
1406
1419
|
);
|
|
1407
|
-
}, Nn =
|
|
1420
|
+
}, Nn = R(Mo);
|
|
1408
1421
|
export {
|
|
1409
1422
|
Rn as TrendsFullWidget,
|
|
1410
1423
|
Hn as TrendsMicroWidget,
|