@mx-cartographer/experiences 7.0.58-alpha.mm8 → 7.0.58-alpha.mm9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/trends/index.es.js +282 -284
- package/package.json +1 -1
package/dist/trends/index.es.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as e, jsxs as C, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as C, Fragment as Je } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
3
|
import { observer as v } from "mobx-react-lite";
|
|
4
|
-
import { Icon as ae, Text as q, CategoryIcon as fe, P as X, H3 as Le, ChevronRightIcon as
|
|
4
|
+
import { Icon as ae, Text as q, CategoryIcon as fe, P as X, H3 as Le, ChevronRightIcon as Qe } from "@mxenabled/mxui";
|
|
5
5
|
import W from "@mui/material/Box";
|
|
6
|
-
import
|
|
6
|
+
import y from "@mui/material/Stack";
|
|
7
7
|
import me from "@mui/material/Button";
|
|
8
8
|
import { addSeconds as ve } from "date-fns/addSeconds";
|
|
9
9
|
import { differenceInCalendarMonths as pe } from "date-fns/differenceInCalendarMonths";
|
|
10
|
-
import { a as
|
|
10
|
+
import { a as et, g as tt, S as nt, L as Me } from "../TrendsStore-BKBnNQba.mjs";
|
|
11
11
|
import { T as go } from "../TrendsStore-BKBnNQba.mjs";
|
|
12
|
-
import { i as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { u as R, m as $, g as H, b as ee, h as ie, d as ce, v as te, f as
|
|
12
|
+
import { i as ot, c as st, d as rt, e as at, f as it, h as ct, b as Ae, g as Re, j as De } from "../SpendingData-D5vsfYKo.mjs";
|
|
13
|
+
import lt from "@mui/material/ToggleButton";
|
|
14
|
+
import dt from "@mui/material/ToggleButtonGroup";
|
|
15
|
+
import { u as R, m as $, g as H, b as ee, h as ie, d as ce, v as te, f as Te, p as ht, a as ut } from "../hooks-CE2TKk4a.mjs";
|
|
16
16
|
import { u as P } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
17
|
import { f as J, D as F } from "../Dialog-CWW597AF.mjs";
|
|
18
18
|
import { DataGridPro as gt } from "@mui/x-data-grid-pro";
|
|
19
19
|
import { C as mt } from "../CurrencyText-YUhH2caW.mjs";
|
|
20
|
-
import { c as
|
|
20
|
+
import { c as ke } from "../Category-CevNQ03n.mjs";
|
|
21
21
|
import { b as pt } from "../Localization-2MODESHW.mjs";
|
|
22
22
|
import { H as Ie } from "../HeaderCell-DjuifqHJ.mjs";
|
|
23
23
|
import { T as A, b as Ct } from "../ViewMoreMicroCard-BAz2NyEO.mjs";
|
|
24
|
-
import { A as
|
|
25
|
-
import { a as
|
|
24
|
+
import { A as _, W as He } from "../WidgetContainer-B8MRJ5Y1.mjs";
|
|
25
|
+
import { a as Ne, T as We } from "../TransactionDetails-DAp_CPCP.mjs";
|
|
26
26
|
import { D as Ce } from "../Drawer-kEE73B87.mjs";
|
|
27
27
|
import { L as Q } from "../Loader-DUaFpDGv.mjs";
|
|
28
|
-
import { useTheme as
|
|
29
|
-
import { L as
|
|
28
|
+
import { useTheme as Oe } from "@mui/material/styles";
|
|
29
|
+
import { L as _e } from "../LineChart-B2Y7zwMu.mjs";
|
|
30
30
|
import { M as ft } from "../MiniWidgetContainer-DTQdRK-3.mjs";
|
|
31
|
-
import { subMonths as
|
|
32
|
-
import { TrendingUp as
|
|
31
|
+
import { subMonths as Tt } from "date-fns";
|
|
32
|
+
import { TrendingUp as _t, TrendingDown as yt, MultilineChart as bt, ExpandLess as wt, ExpandMore as St } from "@mxenabled/mx-icons";
|
|
33
33
|
import { a as Dt, f as Z } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
34
34
|
import { M as It } from "../MicroWidgetContainer-C4QQHfD7.mjs";
|
|
35
35
|
import Et from "@mui/material/Collapse";
|
|
@@ -38,7 +38,7 @@ import Lt from "@mui/material/ListItem";
|
|
|
38
38
|
import vt from "@mui/material/ListItemButton";
|
|
39
39
|
import Mt from "@mui/material/ListItemIcon";
|
|
40
40
|
import At from "@mui/material/ListItemText";
|
|
41
|
-
import
|
|
41
|
+
import Ge from "@mui/material/styles/useTheme";
|
|
42
42
|
import Rt from "@mui/material/Divider";
|
|
43
43
|
import { useTheme as kt, Stack as Ht } from "@mui/material";
|
|
44
44
|
import Nt from "@mui/material/Paper";
|
|
@@ -47,25 +47,25 @@ import { E as Ot } from "../ExportCsvAction-CBJAfyAw.mjs";
|
|
|
47
47
|
import { u as Gt } from "../useInsightsEnabled-DSnpkUq0.mjs";
|
|
48
48
|
import { E as zt } from "../EmptyState-w2yYDuKG.mjs";
|
|
49
49
|
import { k as Bt } from "../ConnectDrawer-DJA_S-rX.mjs";
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
const ze = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
51
|
+
dt,
|
|
52
52
|
{
|
|
53
53
|
exclusive: !0,
|
|
54
54
|
onChange: o,
|
|
55
55
|
orientation: "horizontal",
|
|
56
56
|
value: t,
|
|
57
|
-
children: ["Chart", "Table"].map((n) => /* @__PURE__ */ e(
|
|
57
|
+
children: ["Chart", "Table"].map((n) => /* @__PURE__ */ e(lt, { color: "primary", sx: { width: 56 }, value: n, children: n === "Chart" ? /* @__PURE__ */ e(ae, { name: "table_chart_view" }) : /* @__PURE__ */ e(ae, { name: "format_list_bulleted" }) }, n))
|
|
58
58
|
}
|
|
59
|
-
),
|
|
60
|
-
const { trends: n } = R(), { isMobile: s, isDesktop: a } = P(), { getCategoryName:
|
|
61
|
-
const
|
|
59
|
+
), Be = ({ selectedDateRange: t, selectedCategoryGuid: o }) => {
|
|
60
|
+
const { trends: n } = R(), { isMobile: s, isDesktop: a } = P(), { getCategoryName: h } = $(), u = i.useMemo(() => {
|
|
61
|
+
const d = J(
|
|
62
62
|
t.start,
|
|
63
63
|
s ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
|
|
64
|
-
),
|
|
64
|
+
), l = J(
|
|
65
65
|
t.end,
|
|
66
66
|
s ? F.MONTH_SHORT_YEAR : F.MONTH_YEAR
|
|
67
67
|
);
|
|
68
|
-
return `${
|
|
68
|
+
return `${d} - ${l}`;
|
|
69
69
|
}, [t, s]);
|
|
70
70
|
return /* @__PURE__ */ C(W, { sx: { mr: 10, minWidth: "60%" }, children: [
|
|
71
71
|
/* @__PURE__ */ e(
|
|
@@ -79,17 +79,17 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
79
79
|
textOverflow: "unset"
|
|
80
80
|
},
|
|
81
81
|
variant: a ? "H3" : "Body",
|
|
82
|
-
children:
|
|
82
|
+
children: h(o) || n.sub_title
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
|
-
/* @__PURE__ */ e(q, { variant: a ? "Body" : "Small", children:
|
|
85
|
+
/* @__PURE__ */ e(q, { variant: a ? "Body" : "Small", children: u })
|
|
86
86
|
] });
|
|
87
87
|
}, Ft = (t) => {
|
|
88
88
|
const o = t.row[t.field];
|
|
89
|
-
return /* @__PURE__ */ e(
|
|
89
|
+
return /* @__PURE__ */ e(y, { alignItems: "flex-end", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(mt, { amount: o, variant: "Small" }) });
|
|
90
90
|
}, Kt = ({ categoryGuid: t, topLevelCategoryGuid: o }) => {
|
|
91
|
-
const { categories: n } = R(), s = n.default_categories[t]?.replace(/&/g, "&") ??
|
|
92
|
-
return /* @__PURE__ */ C(
|
|
91
|
+
const { categories: n } = R(), s = n.default_categories[t]?.replace(/&/g, "&") ?? ke[t];
|
|
92
|
+
return /* @__PURE__ */ C(y, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
93
93
|
/* @__PURE__ */ e(
|
|
94
94
|
W,
|
|
95
95
|
{
|
|
@@ -100,7 +100,7 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
100
100
|
),
|
|
101
101
|
/* @__PURE__ */ e(q, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
|
|
102
102
|
] });
|
|
103
|
-
}, Vt = (t) => /* @__PURE__ */ e(
|
|
103
|
+
}, Vt = (t) => /* @__PURE__ */ e(y, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
|
|
104
104
|
Kt,
|
|
105
105
|
{
|
|
106
106
|
categoryGuid: t.row.category,
|
|
@@ -113,17 +113,17 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
113
113
|
n.push(a), s.setMonth(s.getMonth() + 1);
|
|
114
114
|
}
|
|
115
115
|
return n;
|
|
116
|
-
},
|
|
116
|
+
}, Fe = ({
|
|
117
117
|
monthlyCategoryTotals: t,
|
|
118
118
|
selectedDateRange: o,
|
|
119
119
|
selectedCategory: n,
|
|
120
120
|
onClickRow: s,
|
|
121
121
|
height: a = "100dvh",
|
|
122
|
-
sx:
|
|
122
|
+
sx: h = {}
|
|
123
123
|
}) => {
|
|
124
|
-
const { onEvent:
|
|
125
|
-
{ field:
|
|
126
|
-
]), f = i.useMemo(() => $t(o.start, o.end), [o]),
|
|
124
|
+
const { onEvent: u } = H(), d = J(/* @__PURE__ */ new Date(), F.MONTH_SHORT), [l, m] = i.useState([
|
|
125
|
+
{ field: d, sort: "desc" }
|
|
126
|
+
]), f = i.useMemo(() => $t(o.start, o.end), [o]), c = [
|
|
127
127
|
{
|
|
128
128
|
field: "category",
|
|
129
129
|
flex: 1,
|
|
@@ -147,50 +147,50 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
147
147
|
sortable: !0,
|
|
148
148
|
hideSortIcons: !1,
|
|
149
149
|
type: "number",
|
|
150
|
-
sortComparator:
|
|
150
|
+
sortComparator: et
|
|
151
151
|
})
|
|
152
152
|
)
|
|
153
|
-
],
|
|
153
|
+
], b = i.useMemo(() => {
|
|
154
154
|
const r = t.filter(
|
|
155
|
-
(p) => !
|
|
156
|
-
),
|
|
155
|
+
(p) => !ot(p) && !st(p)
|
|
156
|
+
), T = (n ? r.filter(
|
|
157
157
|
(p) => p.category_guid === n || p.top_level_category_guid === n
|
|
158
158
|
) : r).reduce(
|
|
159
|
-
(p,
|
|
160
|
-
const { category_guid: S, top_level_category_guid:
|
|
159
|
+
(p, D) => {
|
|
160
|
+
const { category_guid: S, top_level_category_guid: I, month: k, total: E, year: O } = D, M = n ? S : I;
|
|
161
161
|
p[M] || (p[M] = {
|
|
162
162
|
id: M,
|
|
163
163
|
category: M,
|
|
164
164
|
category_guid: S,
|
|
165
|
-
top_level_category_guid:
|
|
165
|
+
top_level_category_guid: I
|
|
166
166
|
});
|
|
167
167
|
const x = J(new Date(O, k - 1), F.MONTH_SHORT);
|
|
168
|
-
return p[M][x] || (p[M][x] = 0), p[M][x] = p[M][x] + Math.abs(
|
|
168
|
+
return p[M][x] || (p[M][x] = 0), p[M][x] = p[M][x] + Math.abs(E), p;
|
|
169
169
|
},
|
|
170
170
|
{}
|
|
171
171
|
);
|
|
172
|
-
return Object.values(
|
|
172
|
+
return Object.values(T);
|
|
173
173
|
}, [t, n]);
|
|
174
|
-
return /* @__PURE__ */ e(W, { sx: { height: a, width: "100%", overflowX: "auto", boxShadow: "none", ...
|
|
174
|
+
return /* @__PURE__ */ e(W, { sx: { height: a, width: "100%", overflowX: "auto", boxShadow: "none", ...h }, children: /* @__PURE__ */ e(
|
|
175
175
|
gt,
|
|
176
176
|
{
|
|
177
|
-
columns:
|
|
177
|
+
columns: c,
|
|
178
178
|
disableColumnFilter: !0,
|
|
179
179
|
disableColumnMenu: !0,
|
|
180
180
|
hideFooter: !0,
|
|
181
|
-
initialState: { sorting: { sortModel:
|
|
181
|
+
initialState: { sorting: { sortModel: l } },
|
|
182
182
|
onRowClick: (r) => {
|
|
183
|
-
s?.(r.row.category),
|
|
183
|
+
s?.(r.row.category), u(_.TRENDS_CLICK_LIST_ITEM, {
|
|
184
184
|
...A,
|
|
185
|
-
listItem:
|
|
185
|
+
listItem: ke[r.row.category]
|
|
186
186
|
});
|
|
187
187
|
},
|
|
188
188
|
onSortModelChange: (r) => {
|
|
189
|
-
m(r),
|
|
189
|
+
m(r), u(_.TRENDS_CLICK_TABLE_SORT, A);
|
|
190
190
|
},
|
|
191
|
-
rows:
|
|
191
|
+
rows: b,
|
|
192
192
|
slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
|
|
193
|
-
sortModel:
|
|
193
|
+
sortModel: l,
|
|
194
194
|
sortingOrder: ["asc", "desc"]
|
|
195
195
|
}
|
|
196
196
|
) });
|
|
@@ -202,97 +202,97 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
202
202
|
isOpen: n,
|
|
203
203
|
onClose: s
|
|
204
204
|
}) => {
|
|
205
|
-
const { onEvent: a } = H(), { selectedAccountGuids:
|
|
206
|
-
() =>
|
|
207
|
-
[m,
|
|
205
|
+
const { onEvent: a } = H(), { selectedAccountGuids: h } = ee(), { common: u } = R(), { setFilter: d, sortedTransactions: l } = ie(), [m, f] = i.useState(""), c = i.useMemo(
|
|
206
|
+
() => l.find((r) => r.guid === m),
|
|
207
|
+
[m, l]
|
|
208
208
|
);
|
|
209
209
|
i.useEffect(() => {
|
|
210
|
-
|
|
211
|
-
accounts:
|
|
210
|
+
d({
|
|
211
|
+
accounts: h,
|
|
212
212
|
dateRange: o,
|
|
213
213
|
custom: (r) => t === "" || t === r.category_guid || t === r.top_level_category_guid,
|
|
214
214
|
showSplits: !!t
|
|
215
215
|
});
|
|
216
|
-
}, [
|
|
217
|
-
const
|
|
216
|
+
}, [h, t, o]), i.useEffect(() => a(_.TRENDS_VIEW_TRANSACTIONS), []);
|
|
217
|
+
const b = () => {
|
|
218
218
|
f(""), s();
|
|
219
219
|
};
|
|
220
220
|
return /* @__PURE__ */ C(
|
|
221
221
|
Ce,
|
|
222
222
|
{
|
|
223
|
-
ariaLabelClose:
|
|
223
|
+
ariaLabelClose: u.close_aria,
|
|
224
224
|
isOpen: n,
|
|
225
|
-
onClose:
|
|
225
|
+
onClose: b,
|
|
226
226
|
title: Pt.title,
|
|
227
227
|
children: [
|
|
228
|
-
|
|
229
|
-
!
|
|
228
|
+
c && /* @__PURE__ */ e(Ne, { transaction: c }),
|
|
229
|
+
!c && /* @__PURE__ */ e(We, { onClick: f })
|
|
230
230
|
]
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}, Yt = v(jt), Ut = ({ onBackClick: t, sx: o }) => {
|
|
234
|
-
const { onEvent: n } = H(), { isDesktop: s, isTablet: a, isMobile:
|
|
234
|
+
const { onEvent: n } = H(), { isDesktop: s, isTablet: a, isMobile: h } = P(), { visibleAccounts: u } = ce(), { loadMonthlyCategoryTotals: d, monthlyCategoryTotals: l, getCategoryName: m } = $(), { sortedTransactions: f } = ie(), { selectedDateRange: c, setSelectedDateRange: b } = te(), { isCopyLoaded: r, isInitialized: g, selectedAccounts: T, setSelectedAccounts: p } = ee(), { trends: D } = R(), [S, I] = i.useState(!1), [k, E] = i.useState(!1), [O, M] = i.useState("Chart"), [x, K] = i.useState(""), [z, le] = i.useState(window.innerHeight), j = z - (h ? 315 : 345);
|
|
235
235
|
i.useEffect(() => {
|
|
236
236
|
const w = () => le(window.innerHeight);
|
|
237
237
|
return window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
|
|
238
238
|
}, []), i.useEffect(() => {
|
|
239
|
-
p(
|
|
240
|
-
}, [
|
|
241
|
-
g &&
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
p(u);
|
|
240
|
+
}, [u]), i.useEffect(() => {
|
|
241
|
+
g && d(
|
|
242
|
+
T,
|
|
243
|
+
c.start,
|
|
244
|
+
c.end
|
|
245
245
|
).finally(() => {
|
|
246
|
-
|
|
246
|
+
I(!0);
|
|
247
247
|
});
|
|
248
|
-
}, [g,
|
|
248
|
+
}, [g, T, c]);
|
|
249
249
|
const ne = i.useMemo(() => {
|
|
250
250
|
if (!S) return { stackedDatasets: [], unstackedDatasets: [] };
|
|
251
|
-
const w =
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
const w = tt(
|
|
252
|
+
l,
|
|
253
|
+
c.start,
|
|
254
|
+
c.end
|
|
255
255
|
), N = x.length ? w.filter(
|
|
256
256
|
(B) => B.top_level_category_guid === x || B.category_guid === x
|
|
257
|
-
) :
|
|
257
|
+
) : rt(w);
|
|
258
258
|
return {
|
|
259
|
-
stackedDatasets: N.filter(
|
|
260
|
-
unstackedDatasets: N.filter(
|
|
259
|
+
stackedDatasets: N.filter(at),
|
|
260
|
+
unstackedDatasets: N.filter(it)
|
|
261
261
|
};
|
|
262
|
-
}, [
|
|
263
|
-
M(N ?? O), n(
|
|
262
|
+
}, [l, x, c]), V = (w, N) => {
|
|
263
|
+
M(N ?? O), n(_.TRENDS_CLICK_TOGGLE_VIEW);
|
|
264
264
|
}, de = (w) => {
|
|
265
265
|
const N = ve(w?.[0], 1), B = w?.[1], ge = pe(B, N);
|
|
266
|
-
|
|
266
|
+
b({ start: N, end: B }), n(_.TRENDS_CLICK_TIME_WINDOW, {
|
|
267
267
|
time_period: ge + "M"
|
|
268
268
|
});
|
|
269
269
|
}, Y = () => {
|
|
270
|
-
n(
|
|
270
|
+
n(_.TRENDS_CLICK_FILTER);
|
|
271
271
|
}, oe = (w) => {
|
|
272
272
|
K(w);
|
|
273
273
|
}, he = (w) => {
|
|
274
|
-
K(w), n(
|
|
274
|
+
K(w), n(_.TRENDS_CLICK_LEGEND, { category: m(w) });
|
|
275
275
|
}, se = (w) => {
|
|
276
|
-
n(
|
|
276
|
+
n(_.TRENDS_HOVER_LEGEND, { category: m(w) });
|
|
277
277
|
}, re = (w) => {
|
|
278
|
-
n(
|
|
278
|
+
n(_.TRENDS_HOVER_AREA, { category: w });
|
|
279
279
|
}, ue = (w) => {
|
|
280
|
-
n(
|
|
280
|
+
n(_.TRENDS_HOVER_POINT, { category: w });
|
|
281
281
|
};
|
|
282
282
|
return !r || !g || !S ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ C(
|
|
283
|
-
|
|
283
|
+
He,
|
|
284
284
|
{
|
|
285
|
-
accountOptions:
|
|
285
|
+
accountOptions: u,
|
|
286
286
|
calendarActions: { onRangeChanged: de },
|
|
287
|
-
dateRange:
|
|
287
|
+
dateRange: c,
|
|
288
288
|
dateRangeVariant: "timeframebuttons",
|
|
289
289
|
onAccountsFilterClick: Y,
|
|
290
290
|
onBackClick: t,
|
|
291
291
|
sx: o,
|
|
292
|
-
title:
|
|
292
|
+
title: D.title,
|
|
293
293
|
children: [
|
|
294
294
|
/* @__PURE__ */ C(
|
|
295
|
-
|
|
295
|
+
y,
|
|
296
296
|
{
|
|
297
297
|
sx: {
|
|
298
298
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -300,33 +300,33 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
300
300
|
},
|
|
301
301
|
children: [
|
|
302
302
|
/* @__PURE__ */ C(
|
|
303
|
-
|
|
303
|
+
y,
|
|
304
304
|
{
|
|
305
305
|
flexDirection: "row",
|
|
306
306
|
justifyContent: "space-between",
|
|
307
|
-
sx: { pb:
|
|
307
|
+
sx: { pb: h ? 12 : 24, pt: h ? 24 : 48 },
|
|
308
308
|
children: [
|
|
309
309
|
/* @__PURE__ */ e(
|
|
310
|
-
|
|
310
|
+
Be,
|
|
311
311
|
{
|
|
312
312
|
selectedCategoryGuid: x,
|
|
313
|
-
selectedDateRange:
|
|
313
|
+
selectedDateRange: c
|
|
314
314
|
}
|
|
315
315
|
),
|
|
316
|
-
/* @__PURE__ */ e(
|
|
316
|
+
/* @__PURE__ */ e(ze, { onTabChange: V, selectedTab: O })
|
|
317
317
|
]
|
|
318
318
|
}
|
|
319
319
|
),
|
|
320
|
-
/* @__PURE__ */ C(
|
|
320
|
+
/* @__PURE__ */ C(y, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
321
321
|
/* @__PURE__ */ e(W, { flexGrow: 1, children: x && /* @__PURE__ */ C(me, { onClick: () => K(""), sx: { p: 0, pr: 5 }, children: [
|
|
322
322
|
/* @__PURE__ */ e(ae, { name: "arrow_back" }),
|
|
323
|
-
|
|
323
|
+
D.all_categories
|
|
324
324
|
] }) }),
|
|
325
|
-
/* @__PURE__ */ e(me, { onClick: () =>
|
|
325
|
+
/* @__PURE__ */ e(me, { onClick: () => E(!0), sx: { px: 5 }, children: `${D.view_transactions} (${f.length})` })
|
|
326
326
|
] }),
|
|
327
327
|
/* @__PURE__ */ C(W, { children: [
|
|
328
328
|
O === "Chart" && /* @__PURE__ */ e(
|
|
329
|
-
|
|
329
|
+
nt,
|
|
330
330
|
{
|
|
331
331
|
availableHeight: j,
|
|
332
332
|
onClickLegend: he,
|
|
@@ -338,12 +338,12 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
338
338
|
}
|
|
339
339
|
),
|
|
340
340
|
O === "Table" && /* @__PURE__ */ e(
|
|
341
|
-
|
|
341
|
+
Fe,
|
|
342
342
|
{
|
|
343
|
-
monthlyCategoryTotals:
|
|
343
|
+
monthlyCategoryTotals: l,
|
|
344
344
|
onClickRow: oe,
|
|
345
345
|
selectedCategory: x,
|
|
346
|
-
selectedDateRange:
|
|
346
|
+
selectedDateRange: c
|
|
347
347
|
}
|
|
348
348
|
)
|
|
349
349
|
] })
|
|
@@ -354,18 +354,18 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
354
354
|
Yt,
|
|
355
355
|
{
|
|
356
356
|
categoryGuid: x,
|
|
357
|
-
dateRange:
|
|
357
|
+
dateRange: c,
|
|
358
358
|
isOpen: k,
|
|
359
|
-
onClose: () =>
|
|
359
|
+
onClose: () => E(!1)
|
|
360
360
|
}
|
|
361
361
|
)
|
|
362
362
|
]
|
|
363
363
|
}
|
|
364
364
|
);
|
|
365
365
|
}, ao = v(Ut), Xt = () => {
|
|
366
|
-
const t =
|
|
366
|
+
const t = Oe(), { monthlyCategoryTotals: o } = $(), { trends: n } = R(), s = ct(o);
|
|
367
367
|
return /* @__PURE__ */ e(
|
|
368
|
-
|
|
368
|
+
_e,
|
|
369
369
|
{
|
|
370
370
|
baseline: "min",
|
|
371
371
|
colors: [t.palette.primary.main],
|
|
@@ -381,19 +381,19 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
381
381
|
}
|
|
382
382
|
);
|
|
383
383
|
}, Zt = v(Xt), qt = ({ onPrimaryCtaClick: t, sx: o }) => {
|
|
384
|
-
const { visibleAccounts: n } = ce(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: a } = $(), { isInitialized:
|
|
384
|
+
const { visibleAccounts: n } = ce(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: a } = $(), { isInitialized: h } = Te(), { trends: u } = R(), { isCopyLoaded: d, selectedAccounts: l, setSelectedAccounts: m } = ee();
|
|
385
385
|
return i.useEffect(() => {
|
|
386
386
|
m(n);
|
|
387
387
|
}, [n]), i.useEffect(() => {
|
|
388
|
-
|
|
389
|
-
}, [
|
|
388
|
+
h && s(l).finally();
|
|
389
|
+
}, [h, l]), !d || !h ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e(
|
|
390
390
|
ft,
|
|
391
391
|
{
|
|
392
392
|
onPrimaryCtaClick: t,
|
|
393
|
-
primaryCtaLabel:
|
|
394
|
-
subTitle:
|
|
393
|
+
primaryCtaLabel: u.primary_cta,
|
|
394
|
+
subTitle: u.sub_title,
|
|
395
395
|
sx: o,
|
|
396
|
-
title:
|
|
396
|
+
title: u.mini_title,
|
|
397
397
|
children: a ? /* @__PURE__ */ e(Zt, {}) : /* @__PURE__ */ e(Q, {})
|
|
398
398
|
}
|
|
399
399
|
);
|
|
@@ -403,14 +403,14 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
403
403
|
transactionType: n,
|
|
404
404
|
percentage: s,
|
|
405
405
|
secondaryLabel: a,
|
|
406
|
-
shouldDisplayPercentage:
|
|
406
|
+
shouldDisplayPercentage: h
|
|
407
407
|
}) => {
|
|
408
|
-
const { availableWidth:
|
|
408
|
+
const { availableWidth: u } = ht(), d = i.useRef(null), l = i.useRef(null), m = Dt(Number(Math.abs(s)), {
|
|
409
409
|
style: "percent",
|
|
410
410
|
minimumIntegerDigits: 1
|
|
411
|
-
}), f =
|
|
411
|
+
}), f = u === 288 && Z(o, "0,0.00").length > 10 ? Z(o, "0,0") : Z(o, "0,0.00"), c = n === "spending" ? s > 0 : s >= 0, b = n === "spending" ? "error.main" : "success.main", r = n === "spending" ? "success.main" : "text.secondary", g = d?.current, T = l?.current, p = g && T ? g.scrollWidth > T.clientWidth - Jt : !1;
|
|
412
412
|
return /* @__PURE__ */ C(
|
|
413
|
-
|
|
413
|
+
y,
|
|
414
414
|
{
|
|
415
415
|
sx: {
|
|
416
416
|
border: 1,
|
|
@@ -423,7 +423,7 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
423
423
|
},
|
|
424
424
|
children: [
|
|
425
425
|
/* @__PURE__ */ C(
|
|
426
|
-
|
|
426
|
+
y,
|
|
427
427
|
{
|
|
428
428
|
sx: {
|
|
429
429
|
alignItems: "center",
|
|
@@ -432,13 +432,13 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
432
432
|
},
|
|
433
433
|
children: [
|
|
434
434
|
/* @__PURE__ */ e(X, { color: "text.secondary", variant: "caption", children: t }),
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
h && /* @__PURE__ */ C(y, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
436
|
+
c ? /* @__PURE__ */ e(_t, { size: 20, sx: { color: b } }) : /* @__PURE__ */ e(yt, { size: 20, sx: { color: r } }),
|
|
437
437
|
/* @__PURE__ */ e(
|
|
438
438
|
X,
|
|
439
439
|
{
|
|
440
440
|
sx: {
|
|
441
|
-
color:
|
|
441
|
+
color: c ? b : r,
|
|
442
442
|
fontWeight: 600
|
|
443
443
|
},
|
|
444
444
|
variant: "body2",
|
|
@@ -450,9 +450,9 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
452
|
/* @__PURE__ */ C(
|
|
453
|
-
|
|
453
|
+
y,
|
|
454
454
|
{
|
|
455
|
-
ref:
|
|
455
|
+
ref: l,
|
|
456
456
|
sx: {
|
|
457
457
|
alignItems: "center",
|
|
458
458
|
flexDirection: "row",
|
|
@@ -462,15 +462,15 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
462
462
|
/* @__PURE__ */ e(
|
|
463
463
|
W,
|
|
464
464
|
{
|
|
465
|
-
ref:
|
|
465
|
+
ref: d,
|
|
466
466
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
467
467
|
children: /* @__PURE__ */ e(Le, { children: f })
|
|
468
468
|
}
|
|
469
469
|
),
|
|
470
|
-
|
|
470
|
+
h && u >= 450 && !p && /* @__PURE__ */ e(
|
|
471
471
|
X,
|
|
472
472
|
{
|
|
473
|
-
color:
|
|
473
|
+
color: c ? b : r,
|
|
474
474
|
variant: "caption",
|
|
475
475
|
children: a
|
|
476
476
|
}
|
|
@@ -483,48 +483,48 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
483
483
|
);
|
|
484
484
|
}, Qt = v(() => {
|
|
485
485
|
const { trends: t } = R();
|
|
486
|
-
return /* @__PURE__ */ C(
|
|
486
|
+
return /* @__PURE__ */ C(y, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
487
487
|
/* @__PURE__ */ e(bt, { size: 32 }),
|
|
488
|
-
/* @__PURE__ */ C(
|
|
488
|
+
/* @__PURE__ */ C(y, { children: [
|
|
489
489
|
/* @__PURE__ */ e(X, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
|
|
490
490
|
/* @__PURE__ */ e(X, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
|
|
491
491
|
] })
|
|
492
492
|
] });
|
|
493
493
|
}), co = v(({ onCtaClick: t }) => {
|
|
494
|
-
const { visibleAccounts: o } = ce(), { onEvent: n } = H(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded:
|
|
495
|
-
start:
|
|
494
|
+
const { visibleAccounts: o } = ce(), { onEvent: n } = H(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: h } = $(), u = {
|
|
495
|
+
start: Tt(/* @__PURE__ */ new Date(), 1),
|
|
496
496
|
end: /* @__PURE__ */ new Date()
|
|
497
|
-
}, { trends:
|
|
497
|
+
}, { trends: d } = R(), { selectedAccounts: l, setSelectedAccounts: m, isInitialized: f } = ee();
|
|
498
498
|
i.useEffect(() => {
|
|
499
499
|
m(o);
|
|
500
500
|
}, [o]), i.useEffect(() => {
|
|
501
|
-
f && a(
|
|
502
|
-
n(
|
|
501
|
+
f && a(l, u.start).then(() => {
|
|
502
|
+
n(_.TRENDS_LOAD_WIDGET, {
|
|
503
503
|
state: o?.length ? "default" : "zeroState"
|
|
504
504
|
});
|
|
505
505
|
});
|
|
506
|
-
}, [f,
|
|
507
|
-
const { spendingData:
|
|
506
|
+
}, [f, l]);
|
|
507
|
+
const { spendingData: c, incomeData: b } = i.useMemo(
|
|
508
508
|
() => ({
|
|
509
|
-
spendingData: Ae(s,
|
|
510
|
-
incomeData: Re(s,
|
|
509
|
+
spendingData: Ae(s, u),
|
|
510
|
+
incomeData: Re(s, u)
|
|
511
511
|
}),
|
|
512
|
-
[s,
|
|
513
|
-
), [r, g] =
|
|
512
|
+
[s, u]
|
|
513
|
+
), [r, g] = c, [T, p] = b, D = De(g.y, r.y), S = De(p.y, T.y), I = f && !o?.length, k = () => {
|
|
514
514
|
n(
|
|
515
|
-
|
|
515
|
+
I ? _.TRENDS_CLICK_GET_STARTED : _.TRENDS_CLICK_VIEW_MORE
|
|
516
516
|
), t();
|
|
517
517
|
};
|
|
518
|
-
return !
|
|
518
|
+
return !h || !f ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ e(
|
|
519
519
|
It,
|
|
520
520
|
{
|
|
521
521
|
className: "mx-trends-microwidget",
|
|
522
|
-
ctaLabel:
|
|
522
|
+
ctaLabel: d.micro_primary_cta_label,
|
|
523
523
|
onCTAClick: k,
|
|
524
|
-
subHeader:
|
|
525
|
-
title:
|
|
526
|
-
children:
|
|
527
|
-
|
|
524
|
+
subHeader: I ? void 0 : d.micro_subheader,
|
|
525
|
+
title: d.title,
|
|
526
|
+
children: I ? /* @__PURE__ */ e(Qt, {}) : /* @__PURE__ */ C(
|
|
527
|
+
y,
|
|
528
528
|
{
|
|
529
529
|
sx: {
|
|
530
530
|
alignItems: "stretch",
|
|
@@ -535,10 +535,10 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
535
535
|
/* @__PURE__ */ e(
|
|
536
536
|
Ee,
|
|
537
537
|
{
|
|
538
|
-
percentage:
|
|
539
|
-
secondaryLabel:
|
|
538
|
+
percentage: D,
|
|
539
|
+
secondaryLabel: d.micro_secondary_label,
|
|
540
540
|
shouldDisplayPercentage: g.y !== 0 && r.y !== 0,
|
|
541
|
-
title:
|
|
541
|
+
title: d.spending_label,
|
|
542
542
|
totalAmount: g.y,
|
|
543
543
|
transactionType: "spending"
|
|
544
544
|
}
|
|
@@ -547,9 +547,9 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
547
547
|
Ee,
|
|
548
548
|
{
|
|
549
549
|
percentage: S,
|
|
550
|
-
secondaryLabel:
|
|
551
|
-
shouldDisplayPercentage: p.y !== 0 &&
|
|
552
|
-
title:
|
|
550
|
+
secondaryLabel: d.micro_secondary_label,
|
|
551
|
+
shouldDisplayPercentage: p.y !== 0 && T.y !== 0,
|
|
552
|
+
title: d.income_label,
|
|
553
553
|
totalAmount: p.y,
|
|
554
554
|
transactionType: "income"
|
|
555
555
|
}
|
|
@@ -561,9 +561,9 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
561
561
|
);
|
|
562
562
|
}), en = v(
|
|
563
563
|
({ isExpanded: t, onClick: o }) => {
|
|
564
|
-
const n =
|
|
564
|
+
const n = Ge();
|
|
565
565
|
return /* @__PURE__ */ e(Lt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(vt, { onClick: o, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
|
|
566
|
-
|
|
566
|
+
y,
|
|
567
567
|
{
|
|
568
568
|
sx: { color: n.palette.primary.main, flexDirection: "row", alignItems: "center" },
|
|
569
569
|
children: [
|
|
@@ -588,11 +588,11 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
588
588
|
name: n,
|
|
589
589
|
transactions: s,
|
|
590
590
|
onClick: a,
|
|
591
|
-
isLastItem:
|
|
592
|
-
showDivider:
|
|
591
|
+
isLastItem: h = !1,
|
|
592
|
+
showDivider: u = !0
|
|
593
593
|
}) => {
|
|
594
|
-
const { trends:
|
|
595
|
-
a?.(),
|
|
594
|
+
const { trends: d } = R(), { onEvent: l } = H(), m = `${s.length} ${s.length === 1 ? d.transaction : d.transactions}`, f = () => {
|
|
595
|
+
a?.(), l(_.TRENDS_CLICK_LIST_ITEM, {
|
|
596
596
|
...A,
|
|
597
597
|
listItem: n
|
|
598
598
|
});
|
|
@@ -604,33 +604,33 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
604
604
|
leftIcon: o ? /* @__PURE__ */ e(fe, { categoryGuid: o }) : void 0,
|
|
605
605
|
onClick: f,
|
|
606
606
|
rightContent: Z(Math.abs(t), "0,0.00"),
|
|
607
|
-
rightIcon: a ? /* @__PURE__ */ e(
|
|
607
|
+
rightIcon: a ? /* @__PURE__ */ e(Qe, {}) : void 0,
|
|
608
608
|
subtitle: m,
|
|
609
609
|
title: n
|
|
610
610
|
}
|
|
611
611
|
),
|
|
612
|
-
|
|
612
|
+
u && /* @__PURE__ */ e(Rt, { sx: { ml: h ? 24 : 68 } })
|
|
613
613
|
] }, o);
|
|
614
614
|
}
|
|
615
615
|
), tn = v(
|
|
616
616
|
({ availableHeight: t = 0, onCategoryClick: o }) => {
|
|
617
|
-
const { collapsedCategories: n, visibleCategories: s, setVisibleListLength: a } = te(), { isLargeDesktop:
|
|
617
|
+
const { collapsedCategories: n, visibleCategories: s, setVisibleListLength: a } = te(), { isLargeDesktop: h, isDesktop: u } = P(), { trends: d } = R(), { onEvent: l } = H(), [m, f] = i.useState(!1), c = u || h;
|
|
618
618
|
i.useEffect(() => {
|
|
619
|
-
const g = Math.floor(t / 64) - 1,
|
|
620
|
-
g !== s.length && (a(
|
|
619
|
+
const g = Math.floor(t / 64) - 1, T = s.length + n.length;
|
|
620
|
+
g !== s.length && (a(c ? Math.max(g, 5) : 5), f(g >= T));
|
|
621
621
|
}, [t]);
|
|
622
|
-
const
|
|
623
|
-
f(!m),
|
|
622
|
+
const b = () => {
|
|
623
|
+
f(!m), l(_.TRENDS_CLICK_VIEW_MORE, {
|
|
624
624
|
...A
|
|
625
625
|
});
|
|
626
626
|
}, r = s.length + (m ? n.length : 0);
|
|
627
|
-
return /* @__PURE__ */ e(
|
|
628
|
-
/* @__PURE__ */ e(
|
|
629
|
-
s.map((g,
|
|
627
|
+
return /* @__PURE__ */ e(y, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ C(xt, { children: [
|
|
628
|
+
/* @__PURE__ */ e(y, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Le, { children: d.categories }) }),
|
|
629
|
+
s.map((g, T) => /* @__PURE__ */ e(
|
|
630
630
|
xe,
|
|
631
631
|
{
|
|
632
632
|
...g,
|
|
633
|
-
isLastItem:
|
|
633
|
+
isLastItem: T === r - 1,
|
|
634
634
|
onClick: g.transactions.length > 0 ? () => o(g) : void 0,
|
|
635
635
|
showDivider: !0
|
|
636
636
|
},
|
|
@@ -641,8 +641,8 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
641
641
|
{
|
|
642
642
|
in: m,
|
|
643
643
|
sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
|
|
644
|
-
children: n.map((g,
|
|
645
|
-
const p = s.length +
|
|
644
|
+
children: n.map((g, T) => {
|
|
645
|
+
const p = s.length + T;
|
|
646
646
|
return /* @__PURE__ */ e(
|
|
647
647
|
xe,
|
|
648
648
|
{
|
|
@@ -656,43 +656,41 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
656
656
|
})
|
|
657
657
|
}
|
|
658
658
|
),
|
|
659
|
-
n.length > 0 && /* @__PURE__ */ e(en, { isExpanded: m, onClick:
|
|
659
|
+
n.length > 0 && /* @__PURE__ */ e(en, { isExpanded: m, onClick: b })
|
|
660
660
|
] }) });
|
|
661
661
|
}
|
|
662
662
|
), nn = ({ beats: t, onInsightCardClick: o }) => {
|
|
663
|
-
const n = kt(), { onEvent: s } = H(), { isMobile: a, isDesktop:
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}, p = _ ? 200 : 170, I = _ ? 170 : 124, S = _ ? 56 : 0, E = t.length > 0 ? p + S : I, k = _ && t.length > 0 ? p : void 0;
|
|
668
|
-
return /* @__PURE__ */ e(Ht, { sx: { height: E }, children: /* @__PURE__ */ e(
|
|
663
|
+
const n = kt(), { onEvent: s } = H(), { isMobile: a, isDesktop: h, isLargeDesktop: u } = P(), { beatStore: d, endpoint: l, sessionToken: m } = Te(), f = n.palette.mode === "dark", c = h || u, b = c || a ? 1 : 2, r = () => null, g = (k) => {
|
|
664
|
+
o?.(k), s(_.TRENDS_CLICK_INSIGHT, A);
|
|
665
|
+
}, T = c ? 200 : 170, p = c ? 170 : 124, D = c ? 56 : 0, S = t.length > 0 ? T + D : p, I = c && t.length > 0 ? T : void 0;
|
|
666
|
+
return /* @__PURE__ */ e(Ht, { sx: { height: S }, children: /* @__PURE__ */ e(
|
|
669
667
|
Ct,
|
|
670
668
|
{
|
|
671
|
-
areBeatsLoading:
|
|
669
|
+
areBeatsLoading: d.isLoading,
|
|
672
670
|
beats: t,
|
|
673
|
-
endpoint:
|
|
674
|
-
heightOverrides:
|
|
675
|
-
logOutUser:
|
|
676
|
-
onCardClick:
|
|
671
|
+
endpoint: l,
|
|
672
|
+
heightOverrides: I,
|
|
673
|
+
logOutUser: r,
|
|
674
|
+
onCardClick: g,
|
|
677
675
|
showBorder: !0,
|
|
678
|
-
showCTAColocatedWithText: !
|
|
676
|
+
showCTAColocatedWithText: !0,
|
|
679
677
|
showCarouselControls: !0,
|
|
680
|
-
showHeader:
|
|
678
|
+
showHeader: c,
|
|
681
679
|
showIcon: !0,
|
|
682
680
|
showWithMargin: !1,
|
|
683
681
|
token: m,
|
|
684
|
-
useDarkMode:
|
|
682
|
+
useDarkMode: f,
|
|
685
683
|
userHasFullInsightFeedBeats: !1,
|
|
686
684
|
variant: "outlined",
|
|
687
|
-
visibleCardsCount:
|
|
685
|
+
visibleCardsCount: b
|
|
688
686
|
}
|
|
689
687
|
) });
|
|
690
688
|
}, on = v(nn), sn = v(({ chartLabel: t, chartColor: o }) => {
|
|
691
689
|
const { onEvent: n } = H(), {
|
|
692
690
|
categoryDetailsChartData: { monthlyAmounts: s, tooltipLabels: a }
|
|
693
691
|
} = te();
|
|
694
|
-
return /* @__PURE__ */ e(
|
|
695
|
-
|
|
692
|
+
return /* @__PURE__ */ e(y, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
693
|
+
_e,
|
|
696
694
|
{
|
|
697
695
|
baseline: "min",
|
|
698
696
|
colors: [o],
|
|
@@ -705,7 +703,7 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
705
703
|
stroke: o
|
|
706
704
|
}),
|
|
707
705
|
onItemClick: () => {
|
|
708
|
-
n(
|
|
706
|
+
n(_.TRENDS_CLICK_CHART, A);
|
|
709
707
|
},
|
|
710
708
|
showArea: !0,
|
|
711
709
|
showAverage: !0,
|
|
@@ -721,14 +719,14 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
721
719
|
}
|
|
722
720
|
) });
|
|
723
721
|
}), rn = v(({ onClose: t }) => {
|
|
724
|
-
const o =
|
|
725
|
-
if (!
|
|
722
|
+
const o = Ge(), { onEvent: n } = H(), { common: s, trends: a } = R(), { selectedCategoryData: h, selectedDateRangeMonthRange: u } = te(), { sortedTransactions: d } = ie(), [l, m] = i.useState(null);
|
|
723
|
+
if (!h)
|
|
726
724
|
return null;
|
|
727
|
-
const { guid: f, name:
|
|
728
|
-
() =>
|
|
729
|
-
[
|
|
730
|
-
),
|
|
731
|
-
t?.(), n(
|
|
725
|
+
const { guid: f, name: c, is_income: b, totalAmount: r } = h, g = b ? a.category_income : a.category_spending, T = Wt(f, o), p = b ? a.income_label : a.spending_label, D = ` ${h.transactions.length === 1 ? a.transaction : a.transactions} (${h.transactions.length})`, S = i.useMemo(
|
|
726
|
+
() => d.find((E) => E.guid === l),
|
|
727
|
+
[l, d]
|
|
728
|
+
), I = (E) => E.category_guid === f || E.top_level_category_guid === f, k = () => {
|
|
729
|
+
t?.(), n(_.TRENDS_CLICK_BACK, A);
|
|
732
730
|
};
|
|
733
731
|
return /* @__PURE__ */ C(
|
|
734
732
|
Ce,
|
|
@@ -739,28 +737,28 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
739
737
|
shouldShowHeaderShadow: !0,
|
|
740
738
|
title: g,
|
|
741
739
|
children: [
|
|
742
|
-
/* @__PURE__ */ C(
|
|
740
|
+
/* @__PURE__ */ C(y, { sx: { alignItems: "center", height: "100%" }, children: [
|
|
743
741
|
/* @__PURE__ */ C(Nt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
|
|
744
742
|
/* @__PURE__ */ e(
|
|
745
743
|
Me,
|
|
746
744
|
{
|
|
747
745
|
leftIcon: /* @__PURE__ */ e(fe, { categoryGuid: f }),
|
|
748
746
|
rightContent: Z(Math.abs(r), "0,0.00"),
|
|
749
|
-
subtitle:
|
|
750
|
-
title:
|
|
747
|
+
subtitle: u,
|
|
748
|
+
title: c
|
|
751
749
|
}
|
|
752
750
|
),
|
|
753
|
-
/* @__PURE__ */ e(sn, { chartColor:
|
|
754
|
-
/* @__PURE__ */ C(
|
|
755
|
-
/* @__PURE__ */ e(q, { bold: !0, variant: "body1", children:
|
|
756
|
-
/* @__PURE__ */ e(Ot, { filter:
|
|
751
|
+
/* @__PURE__ */ e(sn, { chartColor: T, chartLabel: p }),
|
|
752
|
+
/* @__PURE__ */ C(y, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
|
|
753
|
+
/* @__PURE__ */ e(q, { bold: !0, variant: "body1", children: D }),
|
|
754
|
+
/* @__PURE__ */ e(Ot, { filter: I })
|
|
757
755
|
] })
|
|
758
756
|
] }),
|
|
759
757
|
/* @__PURE__ */ e(
|
|
760
|
-
|
|
758
|
+
We,
|
|
761
759
|
{
|
|
762
760
|
bgcolor: "transparent",
|
|
763
|
-
filter:
|
|
761
|
+
filter: I,
|
|
764
762
|
height: "calc(100vh - 475px)",
|
|
765
763
|
onClick: m
|
|
766
764
|
}
|
|
@@ -773,7 +771,7 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
773
771
|
isOpen: !!S,
|
|
774
772
|
onClose: () => m(""),
|
|
775
773
|
title: a.transaction,
|
|
776
|
-
children: S && /* @__PURE__ */ e(
|
|
774
|
+
children: S && /* @__PURE__ */ e(Ne, { transaction: S })
|
|
777
775
|
}
|
|
778
776
|
)
|
|
779
777
|
]
|
|
@@ -783,37 +781,37 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
783
781
|
const n = Re(t, o), s = Ae(t, o);
|
|
784
782
|
return [n, s].filter((a) => a.length > 0);
|
|
785
783
|
}, cn = (t, o) => {
|
|
786
|
-
const [n, s] = t, a = n,
|
|
784
|
+
const [n, s] = t, a = n, h = s ?? n, u = [];
|
|
787
785
|
if (a) {
|
|
788
|
-
const
|
|
789
|
-
|
|
786
|
+
const d = a.reduce((l, m) => l + m.y, 0);
|
|
787
|
+
u.push({ label: o.income_label, amount: d });
|
|
790
788
|
}
|
|
791
|
-
if (
|
|
792
|
-
const
|
|
793
|
-
|
|
789
|
+
if (h) {
|
|
790
|
+
const d = h.reduce((l, m) => l + m.y, 0);
|
|
791
|
+
u.push({ label: o.spending_label, amount: d });
|
|
794
792
|
}
|
|
795
|
-
return
|
|
793
|
+
return u;
|
|
796
794
|
}, ln = ({
|
|
797
795
|
availableHeight: t = 0,
|
|
798
796
|
minHeight: o = 500,
|
|
799
797
|
selectedDateRange: n,
|
|
800
798
|
totals: s
|
|
801
799
|
}) => {
|
|
802
|
-
const a =
|
|
800
|
+
const a = Oe(), { onEvent: h } = H(), { trends: u } = R(), { isSmallMobile: d, isMobile: l, isSmallTablet: m, isTablet: f } = P(), c = [a.palette.chart?.chart1, a.palette.chart?.chart2], b = an(s, n), r = cn(b, u), [g, T] = i.useState(0), p = 458, D = 195, S = 56, I = l || d ? D : m || f ? p : g;
|
|
803
801
|
return i.useEffect(() => {
|
|
804
|
-
const
|
|
805
|
-
|
|
802
|
+
const E = Math.max(t - S, o);
|
|
803
|
+
T(E);
|
|
806
804
|
}, [t]), /* @__PURE__ */ e(
|
|
807
|
-
|
|
805
|
+
_e,
|
|
808
806
|
{
|
|
809
807
|
baseline: "min",
|
|
810
|
-
colors:
|
|
808
|
+
colors: c,
|
|
811
809
|
curveType: "bump",
|
|
812
|
-
datasets:
|
|
813
|
-
height:
|
|
810
|
+
datasets: b,
|
|
811
|
+
height: I,
|
|
814
812
|
labels: r,
|
|
815
813
|
onItemClick: () => {
|
|
816
|
-
|
|
814
|
+
h(_.TRENDS_CLICK_CHART, A);
|
|
817
815
|
},
|
|
818
816
|
showArea: !0,
|
|
819
817
|
showAxisHighlight: !0,
|
|
@@ -827,144 +825,144 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
827
825
|
}
|
|
828
826
|
);
|
|
829
827
|
}, dn = v(ln), hn = ({ onBackClick: t, onInsightCardClick: o, sx: n }) => {
|
|
830
|
-
const { onEvent: s } = H(), { config: a } =
|
|
828
|
+
const { onEvent: s } = H(), { config: a } = ut(), { isLargeDesktop: h, isDesktop: u, isMobile: d } = P(), { visibleAccounts: l } = ce(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: f, monthlyCategoryTotals: c } = $(), { setFilter: b } = ie(), { selectedDateRange: r, setSelectedCategoryData: g, setSelectedDateRange: T } = te(), {
|
|
831
829
|
isCopyLoaded: p,
|
|
832
|
-
isInitialized:
|
|
830
|
+
isInitialized: D,
|
|
833
831
|
selectedAccounts: S,
|
|
834
|
-
selectedAccountGuids:
|
|
832
|
+
selectedAccountGuids: I,
|
|
835
833
|
setSelectedAccounts: k
|
|
836
|
-
} = ee(), { trends:
|
|
837
|
-
() =>
|
|
838
|
-
[
|
|
834
|
+
} = ee(), { trends: E, connect: O } = R(), { beatStore: M } = Te(), K = Gt() && a.show_insights_widget_in_master, z = u || h, [le, ye] = i.useState(!1), [j, ne] = i.useState(!1), [V, de] = i.useState("Chart"), [Y, oe] = i.useState(""), [he, se] = i.useState(!1), [re, ue] = i.useState(window.innerHeight), w = z ? 56 : 0, N = re - 208, B = re - (K ? 550 + w : 266), [ge, be] = i.useState(!1), Ke = a.show_connections_widget_in_master ? "buttons" : "no-buttons", we = i.useMemo(
|
|
835
|
+
() => l && l.length === 0 || c.length === 0,
|
|
836
|
+
[l, c]
|
|
839
837
|
);
|
|
840
838
|
i.useEffect(() => {
|
|
841
|
-
|
|
842
|
-
}, [
|
|
839
|
+
D && M.loadBeats().finally(() => ne(!0));
|
|
840
|
+
}, [D]);
|
|
843
841
|
const Se = i.useMemo(() => j ? M.beats : [], [j]);
|
|
844
842
|
i.useEffect(() => {
|
|
845
843
|
const L = () => ue(window.innerHeight);
|
|
846
844
|
return window.addEventListener("resize", L), () => window.removeEventListener("resize", L);
|
|
847
845
|
}, []), i.useEffect(() => {
|
|
848
|
-
k(
|
|
849
|
-
}, [
|
|
850
|
-
|
|
846
|
+
k(l);
|
|
847
|
+
}, [l]), i.useEffect(() => {
|
|
848
|
+
D && m(S, r.start, r.end).then(() => {
|
|
851
849
|
f(
|
|
852
850
|
S,
|
|
853
851
|
r.start,
|
|
854
852
|
r.end
|
|
855
853
|
);
|
|
856
854
|
}).finally(() => {
|
|
857
|
-
ye(!0), s(
|
|
855
|
+
ye(!0), s(_.TRENDS_LOAD_WIDGET, {
|
|
858
856
|
...A,
|
|
859
857
|
time_period: `${pe(r.end, r.start)}M`
|
|
860
858
|
});
|
|
861
859
|
});
|
|
862
|
-
}, [
|
|
863
|
-
if (
|
|
860
|
+
}, [D, S, r]), i.useEffect(() => {
|
|
861
|
+
if (c.length !== 0) {
|
|
864
862
|
const L = {
|
|
865
|
-
accounts:
|
|
863
|
+
accounts: I,
|
|
866
864
|
dateRange: { start: r.start, end: r.end }
|
|
867
865
|
};
|
|
868
|
-
|
|
866
|
+
b({
|
|
869
867
|
...L,
|
|
870
|
-
custom: (G) => !!
|
|
868
|
+
custom: (G) => !!c.find(
|
|
871
869
|
(U) => U.top_level_category_guid === G.top_level_category_guid || U.category_guid === G.category_guid
|
|
872
870
|
)
|
|
873
871
|
});
|
|
874
872
|
}
|
|
875
|
-
}, [
|
|
876
|
-
const
|
|
873
|
+
}, [c]);
|
|
874
|
+
const Ve = (L) => {
|
|
877
875
|
g(L), se(!0);
|
|
878
|
-
},
|
|
876
|
+
}, $e = () => {
|
|
879
877
|
g(null), se(!1);
|
|
880
|
-
},
|
|
881
|
-
be(!0), s(
|
|
882
|
-
},
|
|
883
|
-
de(G ?? V), s(
|
|
878
|
+
}, Pe = () => {
|
|
879
|
+
be(!0), s(_.TRENDS_CLICK_CONNECT_ACCOUNTS);
|
|
880
|
+
}, je = (L, G) => {
|
|
881
|
+
de(G ?? V), s(_.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
884
882
|
...A,
|
|
885
883
|
toggleView: G
|
|
886
884
|
});
|
|
887
|
-
},
|
|
888
|
-
const G = ve(L?.[0], 1), U = L?.[1],
|
|
889
|
-
|
|
885
|
+
}, Ye = (L) => {
|
|
886
|
+
const G = ve(L?.[0], 1), U = L?.[1], qe = pe(U, G);
|
|
887
|
+
T({ start: G, end: U }), s(_.TRENDS_CLICK_TIME_WINDOW, {
|
|
890
888
|
...A,
|
|
891
|
-
time_period:
|
|
889
|
+
time_period: qe + "M"
|
|
892
890
|
});
|
|
893
|
-
},
|
|
894
|
-
s(
|
|
891
|
+
}, Ue = (L) => {
|
|
892
|
+
s(_.TRENDS_CLICK_FILTER, {
|
|
895
893
|
...A,
|
|
896
894
|
filterValue: L
|
|
897
895
|
});
|
|
898
|
-
},
|
|
896
|
+
}, Xe = (L) => {
|
|
899
897
|
oe(L);
|
|
900
|
-
},
|
|
901
|
-
oe(""), s(
|
|
898
|
+
}, Ze = () => {
|
|
899
|
+
oe(""), s(_.TRENDS_CLICK_ALL_CATEGORIES, A);
|
|
902
900
|
};
|
|
903
901
|
return !p || !le ? /* @__PURE__ */ e(Q, {}) : /* @__PURE__ */ C(
|
|
904
|
-
|
|
902
|
+
He,
|
|
905
903
|
{
|
|
906
|
-
accountOptions:
|
|
907
|
-
calendarActions: { onRangeChanged:
|
|
904
|
+
accountOptions: l,
|
|
905
|
+
calendarActions: { onRangeChanged: Ye },
|
|
908
906
|
dateRange: r,
|
|
909
|
-
dateRangeVariant:
|
|
910
|
-
onAccountsFilterClick:
|
|
907
|
+
dateRangeVariant: d ? "timeframetabs" : "timeframebuttons",
|
|
908
|
+
onAccountsFilterClick: Ue,
|
|
911
909
|
onBackClick: t,
|
|
912
910
|
sx: n,
|
|
913
|
-
title:
|
|
911
|
+
title: E.title,
|
|
914
912
|
children: [
|
|
915
913
|
we && /* @__PURE__ */ e(
|
|
916
914
|
zt,
|
|
917
915
|
{
|
|
918
|
-
header:
|
|
916
|
+
header: E.zero_state_content_header,
|
|
919
917
|
icon: "",
|
|
920
|
-
onClick:
|
|
921
|
-
primaryButton:
|
|
922
|
-
subText:
|
|
918
|
+
onClick: Pe,
|
|
919
|
+
primaryButton: E.empty_state_primary,
|
|
920
|
+
subText: E.empty_state_sub_text,
|
|
923
921
|
sx: { height: N },
|
|
924
|
-
variant:
|
|
922
|
+
variant: Ke
|
|
925
923
|
}
|
|
926
924
|
),
|
|
927
925
|
!we && /* @__PURE__ */ C(
|
|
928
|
-
|
|
926
|
+
y,
|
|
929
927
|
{
|
|
930
928
|
sx: {
|
|
931
|
-
px:
|
|
929
|
+
px: d ? 0 : 48
|
|
932
930
|
},
|
|
933
931
|
children: [
|
|
934
932
|
/* @__PURE__ */ C(
|
|
935
|
-
|
|
933
|
+
y,
|
|
936
934
|
{
|
|
937
935
|
flexDirection: "row",
|
|
938
936
|
justifyContent: "space-between",
|
|
939
|
-
sx: { pb:
|
|
937
|
+
sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
|
|
940
938
|
children: [
|
|
941
939
|
/* @__PURE__ */ e(
|
|
942
|
-
|
|
940
|
+
Be,
|
|
943
941
|
{
|
|
944
942
|
selectedCategoryGuid: Y,
|
|
945
943
|
selectedDateRange: r
|
|
946
944
|
}
|
|
947
945
|
),
|
|
948
|
-
/* @__PURE__ */ e(
|
|
946
|
+
/* @__PURE__ */ e(ze, { onTabChange: je, selectedTab: V })
|
|
949
947
|
]
|
|
950
948
|
}
|
|
951
949
|
),
|
|
952
|
-
/* @__PURE__ */ e(
|
|
950
|
+
/* @__PURE__ */ e(y, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: Y && /* @__PURE__ */ C(me, { onClick: Ze, sx: { p: 0, pr: 5 }, children: [
|
|
953
951
|
/* @__PURE__ */ e(ae, { name: "arrow_back" }),
|
|
954
|
-
|
|
952
|
+
E.all_categories
|
|
955
953
|
] }) }) }),
|
|
956
|
-
/* @__PURE__ */ C(
|
|
957
|
-
V === "Chart" && /* @__PURE__ */ C(
|
|
954
|
+
/* @__PURE__ */ C(y, { flexDirection: z ? "row" : "column", gap: z ? 48 : 16, children: [
|
|
955
|
+
V === "Chart" && /* @__PURE__ */ C(Je, { children: [
|
|
958
956
|
/* @__PURE__ */ e(W, { sx: { width: z ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
959
957
|
dn,
|
|
960
958
|
{
|
|
961
959
|
availableHeight: N,
|
|
962
960
|
minHeight: 450,
|
|
963
961
|
selectedDateRange: r,
|
|
964
|
-
totals:
|
|
962
|
+
totals: c
|
|
965
963
|
}
|
|
966
964
|
) }),
|
|
967
|
-
/* @__PURE__ */ C(
|
|
965
|
+
/* @__PURE__ */ C(y, { gap: 16, sx: { width: z ? "32%" : "100%" }, children: [
|
|
968
966
|
K && j && Se.length > 0 && /* @__PURE__ */ e(
|
|
969
967
|
on,
|
|
970
968
|
{
|
|
@@ -976,23 +974,23 @@ const Be = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
976
974
|
tn,
|
|
977
975
|
{
|
|
978
976
|
availableHeight: B,
|
|
979
|
-
onCategoryClick:
|
|
977
|
+
onCategoryClick: Ve
|
|
980
978
|
}
|
|
981
979
|
)
|
|
982
980
|
] })
|
|
983
981
|
] }),
|
|
984
982
|
V === "Table" && /* @__PURE__ */ e(W, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
985
|
-
|
|
983
|
+
Fe,
|
|
986
984
|
{
|
|
987
985
|
height: "unset",
|
|
988
|
-
monthlyCategoryTotals:
|
|
989
|
-
onClickRow:
|
|
986
|
+
monthlyCategoryTotals: c,
|
|
987
|
+
onClickRow: Xe,
|
|
990
988
|
selectedCategory: Y,
|
|
991
989
|
selectedDateRange: r
|
|
992
990
|
}
|
|
993
991
|
) })
|
|
994
992
|
] }),
|
|
995
|
-
he && /* @__PURE__ */ e(rn, { onClose:
|
|
993
|
+
he && /* @__PURE__ */ e(rn, { onClose: $e })
|
|
996
994
|
]
|
|
997
995
|
}
|
|
998
996
|
),
|