@mx-cartographer/experiences 7.4.7 → 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.
Files changed (61) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/dist/{Account-01wOyrH1.mjs → Account-BrOTlmeK.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-COMjOzwr.mjs → AccountDetailsContent-B7FqH05C.mjs} +8 -8
  4. package/dist/{AccountDetailsHeader-Cbi5G6fJ.mjs → AccountDetailsHeader-C8MxsxhN.mjs} +4 -4
  5. package/dist/{AccountFields-Cd_nOWmf.mjs → AccountFields-BQZ-o6Kj.mjs} +2 -2
  6. package/dist/{AccountListItem-DxY4cCF1.mjs → AccountListItem-aIE9WWTO.mjs} +4 -4
  7. package/dist/{AccountStore-C1zMBzHq.mjs → AccountStore-DqO84Aer.mjs} +2 -2
  8. package/dist/{Accounts-D7QljYas.mjs → Accounts-DC_A4UCa.mjs} +1 -1
  9. package/dist/{BudgetUtil-Df2nII9u.mjs → BudgetUtil-BmZXkL0C.mjs} +1 -1
  10. package/dist/{CategorySelectorDrawer-DqJK_rrL.mjs → CategorySelectorDrawer-SUgfE5GN.mjs} +1 -1
  11. package/dist/{ConnectDrawer-CuUj16NH.mjs → ConnectDrawer-KL8t1qSC.mjs} +1 -1
  12. package/dist/{ConnectionsDrawer-Bz4uwdFE.mjs → ConnectionsDrawer-DaK5uIL5.mjs} +2 -2
  13. package/dist/{CurrencyInput-BFKcs-_K.mjs → CurrencyInput-itK0R3wV.mjs} +1 -1
  14. package/dist/{DebtsStore-Bu8rRRSL.mjs → DebtsStore-DVPZbv2C.mjs} +1 -1
  15. package/dist/{ExportCsvAction-DzTrtPzk.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
  16. package/dist/{GoalStore-CrNhjvNc.mjs → GoalStore-o4rrjGSJ.mjs} +2 -2
  17. package/dist/{Help-BnPXM_N2.mjs → Help-BjLMsuMS.mjs} +1 -1
  18. package/dist/{LineChart-bc1D9xBE.mjs → LineChart-BQRxZF3p.mjs} +1 -1
  19. package/dist/{ListItemAction-uobBrm_a.mjs → ListItemAction-BxTkF6Tz.mjs} +1 -1
  20. package/dist/{ManageIncome-A69EUO5u.mjs → ManageIncome-rcnDYsBJ.mjs} +75 -75
  21. package/dist/{MicroWidgetContainer-DEiRnYVa.mjs → MicroWidgetContainer-B2hO9rOG.mjs} +1 -1
  22. package/dist/{MiniWidgetContainer-CmXpTylX.mjs → MiniWidgetContainer-98-hKFqm.mjs} +1 -1
  23. package/dist/{NetWorthStore-CpL_kqvx.mjs → NetWorthStore-DG2X69jG.mjs} +2 -2
  24. package/dist/{NotificationSettings-CNmJWVeI.mjs → NotificationSettings-C7FYNM7I.mjs} +250 -248
  25. package/dist/{OriginalBalanceAction-DK8_LkPz.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +3 -3
  26. package/dist/{RecurringSettings-B0uObPlD.mjs → RecurringSettings-C81H1l38.mjs} +3 -3
  27. package/dist/{SpendingLegend-Bf-wbJvb.mjs → SpendingLegend-DqZxN_BZ.mjs} +2 -2
  28. package/dist/{TransactionDetails-COH0OKNG.mjs → TransactionDetails-BA_E5nQ-.mjs} +5 -5
  29. package/dist/{TransactionStore-Dz-G8Wd0.mjs → TransactionStore-PRlwE-TF.mjs} +2 -2
  30. package/dist/{User-wXzDI4M8.mjs → User-Cnlegl1N.mjs} +1 -1
  31. package/dist/{ViewMoreMicroCard-C0832BMe.mjs → ViewMoreMicroCard-DfPXJzbv.mjs} +105 -101
  32. package/dist/{WidgetContainer-6dsjtOVg.mjs → WidgetContainer-CaPjoWeE.mjs} +2 -2
  33. package/dist/accounts/index.es.js +148 -140
  34. package/dist/analytics/index.es.js +2 -2
  35. package/dist/budgets/index.es.js +483 -478
  36. package/dist/cashflow/index.es.js +367 -362
  37. package/dist/categories/index.es.js +1 -1
  38. package/dist/common/hooks/index.d.ts +1 -0
  39. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  40. package/dist/common/index.es.js +35 -33
  41. package/dist/dashboard/index.es.js +90 -88
  42. package/dist/debts/index.es.js +346 -342
  43. package/dist/{exportTransactionsToCSV-Cz2t0lmA.mjs → exportTransactionsToCSV-DuAaI5XA.mjs} +1 -1
  44. package/dist/finstrong/index.es.js +352 -350
  45. package/dist/goals/index.es.js +518 -511
  46. package/dist/help/index.es.js +13 -9
  47. package/dist/{hooks-C41HAxM5.mjs → hooks-ZMp65DFz.mjs} +11 -11
  48. package/dist/investments/index.es.js +395 -393
  49. package/dist/merchants/index.es.js +1 -1
  50. package/dist/microinsights/index.es.js +1 -1
  51. package/dist/networth/index.es.js +245 -240
  52. package/dist/notifications/index.es.js +2 -2
  53. package/dist/recurringtransactions/index.es.js +293 -285
  54. package/dist/settings/index.es.js +252 -249
  55. package/dist/spending/index.es.js +136 -124
  56. package/dist/transactions/index.es.js +77 -73
  57. package/dist/trends/index.es.js +601 -588
  58. package/dist/{useAccountDisplayName-CMMlIOXF.mjs → useAccountDisplayName-Cjx8YmKK.mjs} +2 -2
  59. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  60. package/dist/useWidgetLoadTimer-C1NBkyLd.mjs +23 -0
  61. package/package.json +1 -1
@@ -1,61 +1,62 @@
1
- import { jsxs as o, Fragment as U, jsx as e } from "react/jsx-runtime";
2
- import p, { useState as J } from "react";
3
- import { observer as L } from "mobx-react-lite";
4
- import { addMonths as Xe } from "date-fns/addMonths";
1
+ import { jsxs as o, Fragment as P, jsx as e } from "react/jsx-runtime";
2
+ import f, { useState as ee } from "react";
3
+ import { observer as T } from "mobx-react-lite";
4
+ import { addMonths as Ye } from "date-fns/addMonths";
5
5
  import { startOfToday as $ } from "date-fns/startOfToday";
6
- import v from "@mui/material/Box";
7
- import D from "@mui/material/Divider";
6
+ import D from "@mui/material/Box";
7
+ import v from "@mui/material/Divider";
8
8
  import s from "@mui/material/Stack";
9
- import ce from "@mui/material/styles/useTheme";
10
- import { Text as u, P as k, Icon as j, InstitutionLogo as ye, H1 as me, H2 as Ye } from "@mxenabled/mxui";
11
- import { G as Qe, v as ue, u as N, q as le, d as Ne, b as Y, j as P, g as ke, p as He, h as Fe, n as Ve, a as Ke } from "../hooks-C41HAxM5.mjs";
12
- import { C as O } from "../CurrencyText-Dr0EZ7bp.mjs";
13
- import { u as he } from "../useScreenSize-B6JyS_Lj.mjs";
14
- import { L as te } from "../Loader-DUaFpDGv.mjs";
15
- import { I as pe } from "../CashflowStore-D9Dpuz7X.mjs";
16
- import { C as zn } from "../CashflowStore-D9Dpuz7X.mjs";
9
+ import le from "@mui/material/styles/useTheme";
10
+ import { Text as u, P as O, Icon as j, InstitutionLogo as ye, H1 as ue, H2 as Qe } from "@mxenabled/mxui";
11
+ import { G as Ve, t as he, u as N, p as de, d as Oe, b as X, j as q, g as ke, o as He, h as Fe, a as Ke } from "../hooks-ZMp65DFz.mjs";
12
+ import { C as L } from "../CurrencyText-Dr0EZ7bp.mjs";
13
+ import { u as pe } from "../useScreenSize-B6JyS_Lj.mjs";
14
+ import { L as oe } from "../Loader-DUaFpDGv.mjs";
15
+ import { I as fe } from "../CashflowStore-D9Dpuz7X.mjs";
16
+ import { C as Bn } from "../CashflowStore-D9Dpuz7X.mjs";
17
17
  import { b as M } from "../Localization-2MODESHW.mjs";
18
- import { M as Je } from "../MiniWidgetContainer-CmXpTylX.mjs";
18
+ import { u as We } from "../useWidgetLoadTimer-C1NBkyLd.mjs";
19
+ import { M as Je } from "../MiniWidgetContainer-98-hKFqm.mjs";
19
20
  import { E as Ze } from "../EmptyState-DoxNUae-.mjs";
20
- import { R as et } from "../RecurringSettings-B0uObPlD.mjs";
21
+ import { R as et } from "../RecurringSettings-C81H1l38.mjs";
21
22
  import tt from "@mui/material/Tabs";
22
23
  import Ce from "@mui/material/Tab";
23
- import { getUnixTime as B } from "date-fns/getUnixTime";
24
- import ee from "@mui/material/List";
25
- import ne from "@mui/material/ListItem";
26
- import { A as nt } from "../AccountListItem-DxY4cCF1.mjs";
27
- import { f as Q, a as V } from "../Dialog-BPTr3qHE.mjs";
24
+ import { getUnixTime as U } from "date-fns/getUnixTime";
25
+ import ne from "@mui/material/List";
26
+ import ae from "@mui/material/ListItem";
27
+ import { A as nt } from "../AccountListItem-aIE9WWTO.mjs";
28
+ import { f as Y, a as Q } from "../Dialog-BPTr3qHE.mjs";
28
29
  import ot from "@mui/material/ListSubheader";
29
- import { f as Z } from "../NumberFormatting-DjTD0t3W.mjs";
30
- import { isAfter as We } from "date-fns/isAfter";
31
- import { isBefore as $e } from "date-fns/isBefore";
32
- import { isToday as Me } from "date-fns/isToday";
30
+ import { f as te } from "../NumberFormatting-DjTD0t3W.mjs";
31
+ import { isAfter as $e } from "date-fns/isAfter";
32
+ import { isBefore as Me } from "date-fns/isBefore";
33
+ import { isToday as Ge } from "date-fns/isToday";
33
34
  import { addDays as we } from "date-fns/addDays";
34
35
  import { alpha as at, keyframes as it } from "@mui/material/styles";
35
36
  import { DataGridPro as rt } from "@mui/x-data-grid-pro";
36
37
  import { T as Se } from "../TabContentContainer-j01JYR_7.mjs";
37
38
  import G from "@mui/material/Button";
38
- import { M as st, S as ct, i as lt, d as _e, c as dt } from "../ManageIncome-A69EUO5u.mjs";
39
- import { D as Ge } from "../Drawer-BEtCk82g.mjs";
39
+ import { M as st, S as ct, i as lt, d as _e, c as dt } from "../ManageIncome-rcnDYsBJ.mjs";
40
+ import { D as je } from "../Drawer-BEtCk82g.mjs";
40
41
  import { formatISO as mt } from "date-fns/formatISO";
41
42
  import { fromUnixTime as Ie } from "date-fns/fromUnixTime";
42
43
  import { startOfMonth as ut } from "date-fns/startOfMonth";
43
- import { subDays as je } from "date-fns/subDays";
44
- import { S as ht, c as pt } from "../TransactionDetails-COH0OKNG.mjs";
45
- import { F as ft, R as ve, e as De } from "../RecurringTransactions-BqijW_8S.mjs";
44
+ import { subDays as ze } from "date-fns/subDays";
45
+ import { S as ht, c as pt } from "../TransactionDetails-BA_E5nQ-.mjs";
46
+ import { F as ft, R as De, e as ve } from "../RecurringTransactions-BqijW_8S.mjs";
46
47
  import { h as gt } from "../DateUtil-CBdcsyuk.mjs";
47
48
  import { endOfToday as bt } from "date-fns/endOfToday";
48
- import { W as Ae, A as Ee } from "../WidgetContainer-6dsjtOVg.mjs";
49
- import { F as xt, A as z } from "../Fetch-DecPFeGU.mjs";
50
- const K = () => {
51
- if (!p.useContext(Qe))
49
+ import { W as Ae, A as Ee } from "../WidgetContainer-CaPjoWeE.mjs";
50
+ import { F as xt, A as B } from "../Fetch-DecPFeGU.mjs";
51
+ const V = () => {
52
+ if (!f.useContext(Ve))
52
53
  throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
53
- return ue().uiStore;
54
+ return he().uiStore;
54
55
  }, yt = ({ remaining: a }) => {
55
56
  const { cashflow: n } = N();
56
- return /* @__PURE__ */ o(U, { children: [
57
+ return /* @__PURE__ */ o(P, { children: [
57
58
  /* @__PURE__ */ e(
58
- v,
59
+ D,
59
60
  {
60
61
  sx: {
61
62
  borderRadius: "1px",
@@ -66,37 +67,37 @@ const K = () => {
66
67
  }
67
68
  ),
68
69
  /* @__PURE__ */ e(u, { bold: !0, sx: { flexGrow: 1, fontSize: 12 }, children: n.remaining_cash }),
69
- /* @__PURE__ */ e(O, { amount: a, bold: !0, sx: { fontSize: 12 } })
70
+ /* @__PURE__ */ e(L, { amount: a, bold: !0, sx: { fontSize: 12 } })
70
71
  ] });
71
- }, fe = L(yt), Ct = () => {
72
- const a = ce(), { availableWidth: n } = le(), { isMobile: t } = he(), { visibleCashAccounts: i, visibleCashBalance: g } = Ne(), { selectedAccounts: b, selectedAccountGuids: m, setSelectedAccounts: h } = Y(), { cashflow: l } = N(), {
72
+ }, ge = T(yt), Ct = () => {
73
+ const a = le(), { availableWidth: n } = de(), { isMobile: t } = pe(), { visibleCashAccounts: i, visibleCashBalance: g } = Oe(), { selectedAccounts: x, selectedAccountGuids: m, setSelectedAccounts: p } = X(), { cashflow: c } = N(), {
73
74
  daysUntilNextIncome: r,
74
- expensesTilNextIncome: c,
75
- selectedCashAccounts: d,
76
- setNextIncome: x,
75
+ expensesTilNextIncome: d,
76
+ selectedCashAccounts: l,
77
+ setNextIncome: b,
77
78
  setSelectedCashAccounts: C,
78
79
  setUpcomingExpenses: _
79
- } = K(), { isDataLoaded: H, nextIncomeRecurrence: A, upcomingExpenses: W } = P();
80
- p.useEffect(() => {
81
- h(i);
82
- }, [i]), p.useEffect(() => {
80
+ } = V(), { isDataLoaded: k, nextIncomeRecurrence: I, upcomingExpenses: F } = q();
81
+ f.useEffect(() => {
82
+ p(i);
83
+ }, [i]), f.useEffect(() => {
83
84
  C(
84
- i.filter((E) => m.includes(E.guid))
85
+ i.filter((S) => m.includes(S.guid))
85
86
  );
86
- }, [i, b]), p.useEffect(() => {
87
- A && x(A), _(W);
88
- }, [A, W]);
89
- const f = p.useMemo(
90
- () => i.filter((E) => m.includes(E.guid)).reduce((E, F) => E + (F?.balance || 0), 0),
91
- [m, W]
92
- ), w = p.useMemo(
93
- () => c.filter((E) => m.includes(E.accountGuid || "")).reduce((E, F) => E + F.amount, 0),
94
- [m, c]
95
- ), I = p.useMemo(
96
- () => f - w,
97
- [f, w]
87
+ }, [i, x]), f.useEffect(() => {
88
+ I && b(I), _(F);
89
+ }, [I, F]);
90
+ const h = f.useMemo(
91
+ () => i.filter((S) => m.includes(S.guid)).reduce((S, z) => S + (z?.balance || 0), 0),
92
+ [m, F]
93
+ ), w = f.useMemo(
94
+ () => d.filter((S) => m.includes(S.accountGuid || "")).reduce((S, z) => S + z.amount, 0),
95
+ [m, d]
96
+ ), A = f.useMemo(
97
+ () => h - w,
98
+ [h, w]
98
99
  );
99
- return H ? /* @__PURE__ */ e(v, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: n > 710 ? /* @__PURE__ */ o(
100
+ return k ? /* @__PURE__ */ e(D, { className: "mx-cashflow", pl: 16, pr: 16, pt: 16, children: n > 710 ? /* @__PURE__ */ o(
100
101
  s,
101
102
  {
102
103
  border: `1px solid ${a.palette.border.light}`,
@@ -106,45 +107,45 @@ const K = () => {
106
107
  px: 24,
107
108
  children: [
108
109
  /* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
109
- /* @__PURE__ */ e(O, { amount: f, variant: "H2" }),
110
- /* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: M(
111
- l.total_cash_accounts,
112
- d.length
110
+ /* @__PURE__ */ e(L, { amount: h, variant: "H2" }),
111
+ /* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: M(
112
+ c.total_cash_accounts,
113
+ l.length
113
114
  ) })
114
115
  ] }),
115
116
  /* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(j, { name: "remove" }) }),
116
117
  /* @__PURE__ */ o(s, { pb: 14, pt: 12, children: [
117
- /* @__PURE__ */ e(O, { amount: w, variant: "H2" }),
118
- /* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: M(l.expenses_due, c.length) })
118
+ /* @__PURE__ */ e(L, { amount: w, variant: "H2" }),
119
+ /* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: M(c.expenses_due, d.length) })
119
120
  ] }),
120
121
  /* @__PURE__ */ e(s, { pt: 18, children: /* @__PURE__ */ e(j, { name: "equal" }) }),
121
122
  /* @__PURE__ */ o(s, { pb: 14, pr: 24, pt: 12, children: [
122
- /* @__PURE__ */ e(O, { amount: I, variant: "H2" }),
123
+ /* @__PURE__ */ e(L, { amount: A, variant: "H2" }),
123
124
  /* @__PURE__ */ o(s, { alignItems: "center", direction: "row", gap: 8, children: [
124
- /* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: l.available_to_spend }),
125
- /* @__PURE__ */ e(pe, { body: l.tooltip_body, title: l.tooltip_title })
125
+ /* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: c.available_to_spend }),
126
+ /* @__PURE__ */ e(fe, { body: c.tooltip_body, title: c.tooltip_title })
126
127
  ] })
127
128
  ] }),
128
- /* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(U, { children: [
129
- /* @__PURE__ */ e(u, { variant: "H2", children: M(l.days, r) }),
130
- /* @__PURE__ */ e(k, { variant: "XSmall", whiteSpace: "nowrap", children: l.next_paycheck })
129
+ /* @__PURE__ */ e(s, { borderLeft: `1px solid ${a.palette.border.light}`, pb: 12, pl: 24, pt: 12, children: /* @__PURE__ */ o(P, { children: [
130
+ /* @__PURE__ */ e(u, { variant: "H2", children: M(c.days, r) }),
131
+ /* @__PURE__ */ e(O, { variant: "XSmall", whiteSpace: "nowrap", children: c.next_paycheck })
131
132
  ] }) })
132
133
  ]
133
134
  }
134
135
  ) : /* @__PURE__ */ o(s, { border: `1px solid ${a.palette.border.light}`, borderRadius: 1, children: [
135
136
  /* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
136
137
  /* @__PURE__ */ e(u, { variant: "Small", children: M(
137
- l.total_cash_accounts,
138
- d.length
138
+ c.total_cash_accounts,
139
+ l.length
139
140
  ) }),
140
- /* @__PURE__ */ e(O, { amount: g, bold: !0, variant: "XSmall" })
141
+ /* @__PURE__ */ e(L, { amount: g, bold: !0, variant: "XSmall" })
141
142
  ] }),
142
- /* @__PURE__ */ e(D, {}),
143
+ /* @__PURE__ */ e(v, {}),
143
144
  /* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
144
- /* @__PURE__ */ e(u, { variant: "Small", children: M(l.expenses_due, c.length) }),
145
- /* @__PURE__ */ e(O, { amount: w, bold: !0, symbol: "-", variant: "XSmall" })
145
+ /* @__PURE__ */ e(u, { variant: "Small", children: M(c.expenses_due, d.length) }),
146
+ /* @__PURE__ */ e(L, { amount: w, bold: !0, symbol: "-", variant: "XSmall" })
146
147
  ] }),
147
- /* @__PURE__ */ e(D, {}),
148
+ /* @__PURE__ */ e(v, {}),
148
149
  /* @__PURE__ */ e(
149
150
  s,
150
151
  {
@@ -156,37 +157,40 @@ const K = () => {
156
157
  justifyContent: "space-between",
157
158
  px: 16,
158
159
  sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
159
- children: /* @__PURE__ */ e(fe, { remaining: I })
160
+ children: /* @__PURE__ */ e(ge, { remaining: A })
160
161
  }
161
162
  ),
162
- /* @__PURE__ */ e(D, {}),
163
+ /* @__PURE__ */ e(v, {}),
163
164
  /* @__PURE__ */ o(s, { direction: "row", justifyContent: "space-between", p: 16, children: [
164
- /* @__PURE__ */ e(u, { variant: "Small", children: l.next_paycheck }),
165
- /* @__PURE__ */ e(u, { bold: !0, variant: "XSmall", children: M(l.days, r) })
165
+ /* @__PURE__ */ e(u, { variant: "Small", children: c.next_paycheck }),
166
+ /* @__PURE__ */ e(u, { bold: !0, variant: "XSmall", children: M(c.days, r) })
166
167
  ] })
167
- ] }) }) : /* @__PURE__ */ e(te, { height: t ? 210 : 120 });
168
- }, wt = L(Ct), St = ({
168
+ ] }) }) : /* @__PURE__ */ e(oe, { height: t ? 210 : 120 });
169
+ }, wt = T(Ct), St = ({
169
170
  onPrimaryCtaClick: a,
170
171
  onSecondaryCtaClick: n,
171
172
  sx: t = {}
172
173
  }) => {
173
- const { cashflow: i } = N(), { isCopyLoaded: g, isInitialized: b } = Y(), { loadRepeatingTransactions: m, income: h, isDataLoaded: l, setDateRange: r } = P();
174
- p.useEffect(() => {
175
- b && (r({ start: $(), end: Xe($(), 1) }), m().finally());
176
- }, [b]);
177
- const c = l && !h.length;
174
+ const { cashflow: i } = N(), { isCopyLoaded: g, isInitialized: x } = X(), { loadRepeatingTransactions: m, income: p, isDataLoaded: c, setDateRange: r } = q();
175
+ f.useEffect(() => {
176
+ x && (r({ start: $(), end: Ye($(), 1) }), m().finally());
177
+ }, [x]), We({
178
+ widgetName: "CashflowMiniWidget",
179
+ isLoaded: c
180
+ });
181
+ const d = c && !p.length;
178
182
  return g ? /* @__PURE__ */ o(
179
183
  Je,
180
184
  {
181
185
  className: "mx-exp-cashflow-miniwidget",
182
186
  onPrimaryCtaClick: a,
183
187
  primaryCtaLabel: i.primary_cta,
184
- subTitle: c || !l ? void 0 : i.sub_title,
188
+ subTitle: d || !c ? void 0 : i.sub_title,
185
189
  sx: { height: "100%", ...t },
186
190
  title: i.title,
187
191
  children: [
188
- !l && /* @__PURE__ */ e(te, {}),
189
- l && (c ? /* @__PURE__ */ e(
192
+ !c && /* @__PURE__ */ e(oe, {}),
193
+ c && (d ? /* @__PURE__ */ e(
190
194
  Ze,
191
195
  {
192
196
  header: i.create,
@@ -199,9 +203,9 @@ const K = () => {
199
203
  ) : /* @__PURE__ */ e(wt, {}))
200
204
  ]
201
205
  }
202
- ) : /* @__PURE__ */ e(te, {});
203
- }, Wn = L(St), _t = ({ remaining: a }) => /* @__PURE__ */ e(
204
- ne,
206
+ ) : /* @__PURE__ */ e(oe, {});
207
+ }, $n = T(St), _t = ({ remaining: a }) => /* @__PURE__ */ e(
208
+ ae,
205
209
  {
206
210
  sx: {
207
211
  alignItems: "center",
@@ -213,19 +217,19 @@ const K = () => {
213
217
  borderBottomRightRadius: "3px",
214
218
  minHeight: "auto"
215
219
  },
216
- children: /* @__PURE__ */ e(fe, { remaining: a })
220
+ children: /* @__PURE__ */ e(ge, { remaining: a })
217
221
  }
218
222
  );
219
- var oe = /* @__PURE__ */ ((a) => (a.EXPENSE = "expense", a.INCOME = "income", a))(oe || {});
220
- const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
221
- /* @__PURE__ */ o(ne, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
223
+ var ie = /* @__PURE__ */ ((a) => (a.EXPENSE = "expense", a.INCOME = "income", a))(ie || {});
224
+ const It = ({ recurrence: a }) => /* @__PURE__ */ o(P, { children: [
225
+ /* @__PURE__ */ o(ae, { sx: { display: "flex", alignItems: "center", gap: 16, px: 24, py: 12 }, children: [
222
226
  /* @__PURE__ */ o(s, { alignItems: "center", height: 32, width: 32, children: [
223
- /* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Q(a.expectedDate, V.MONTH) }),
224
- /* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Q(a.expectedDate, V.DAY) })
227
+ /* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Y(a.expectedDate, Q.MONTH) }),
228
+ /* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 11 }, children: Y(a.expectedDate, Q.DAY) })
225
229
  ] }),
226
230
  /* @__PURE__ */ e(u, { sx: { flexGrow: 1, fontSize: 13 }, children: a.name }),
227
231
  /* @__PURE__ */ e(
228
- O,
232
+ L,
229
233
  {
230
234
  amount: a.amount,
231
235
  bold: !0,
@@ -233,10 +237,10 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
233
237
  }
234
238
  )
235
239
  ] }),
236
- /* @__PURE__ */ e(D, {})
237
- ] }), Te = L(It), vt = ({ total: a, type: n }) => {
240
+ /* @__PURE__ */ e(v, {})
241
+ ] }), Te = T(It), Dt = ({ total: a, type: n }) => {
238
242
  const { cashflow: t } = N();
239
- return /* @__PURE__ */ o(U, { children: [
243
+ return /* @__PURE__ */ o(P, { children: [
240
244
  /* @__PURE__ */ o(
241
245
  ot,
242
246
  {
@@ -250,40 +254,40 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
250
254
  px: 24
251
255
  },
252
256
  children: [
253
- /* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 12 }, children: n === oe.EXPENSE ? t.expenses : t.income }),
257
+ /* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 12 }, children: n === ie.EXPENSE ? t.expenses : t.income }),
254
258
  /* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 13 }, children: [
255
- n === oe.EXPENSE ? "-" : "+",
256
- Z(a, "0,0.00")
259
+ n === ie.EXPENSE ? "-" : "+",
260
+ te(a, "0,0.00")
257
261
  ] })
258
262
  ]
259
263
  }
260
264
  ),
261
- /* @__PURE__ */ e(D, {})
265
+ /* @__PURE__ */ e(v, {})
262
266
  ] });
263
- }, Re = L(vt), se = (a, n) => (t) => t.accountGuid === a.guid && (Me(t.expectedDate) || We(t.expectedDate, n.start)) && $e(t.expectedDate, n.end), Dt = () => {
264
- const { availableWidth: a } = le(), { cashflow: n } = N(), { upcomingExpenses: t, upcomingIncome: i } = P(), { dateRange: g, selectedCashAccounts: b } = K();
267
+ }, Re = T(Dt), ce = (a, n) => (t) => t.accountGuid === a.guid && (Ge(t.expectedDate) || $e(t.expectedDate, n.start)) && Me(t.expectedDate, n.end), vt = () => {
268
+ const { availableWidth: a } = de(), { cashflow: n } = N(), { upcomingExpenses: t, upcomingIncome: i } = q(), { dateRange: g, selectedCashAccounts: x } = V();
265
269
  return /* @__PURE__ */ o(s, { children: [
266
270
  /* @__PURE__ */ o(s, { direction: a < 400 ? "column" : "row", justifyContent: "space-between", children: [
267
271
  /* @__PURE__ */ e(u, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: n.accounts_breakdown }),
268
272
  /* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 15, mb: 12, whiteSpace: "normal" }, children: [
269
- Q(g.start, V.FULL_MONTH_DAY),
273
+ Y(g.start, Q.FULL_MONTH_DAY),
270
274
  " -",
271
275
  " ",
272
- Q(g.end, V.FULL_MONTH_DAY)
276
+ Y(g.end, Q.FULL_MONTH_DAY)
273
277
  ] })
274
278
  ] }),
275
- /* @__PURE__ */ e(s, { children: b.map((m) => {
276
- const h = i.filter(se(m, g)).sort((d, x) => B(d.expectedDate) - B(x.expectedDate)), l = t.filter(
277
- se(m, g)
278
- ), r = h.reduce(
279
- (d, x) => d + x.amount,
279
+ /* @__PURE__ */ e(s, { children: x.map((m) => {
280
+ const p = i.filter(ce(m, g)).sort((l, b) => U(l.expectedDate) - U(b.expectedDate)), c = t.filter(
281
+ ce(m, g)
282
+ ), r = p.reduce(
283
+ (l, b) => l + b.amount,
280
284
  0
281
- ), c = l.reduce(
282
- (d, x) => d + x.amount,
285
+ ), d = c.reduce(
286
+ (l, b) => l + b.amount,
283
287
  0
284
288
  );
285
289
  return /* @__PURE__ */ o(
286
- ee,
290
+ ne,
287
291
  {
288
292
  sx: {
289
293
  border: "1px solid",
@@ -303,27 +307,27 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
303
307
  }
304
308
  }
305
309
  ),
306
- /* @__PURE__ */ e(D, {}),
307
- h.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
308
- ee,
310
+ /* @__PURE__ */ e(v, {}),
311
+ p.length > 0 && /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
312
+ ne,
309
313
  {
310
- subheader: /* @__PURE__ */ e(Re, { total: r, type: oe.INCOME }),
314
+ subheader: /* @__PURE__ */ e(Re, { total: r, type: ie.INCOME }),
311
315
  sx: { width: "100%" },
312
- children: h.map((d) => /* @__PURE__ */ e(Te, { recurrence: d }, d.repeatingTransactionGuid))
316
+ children: p.map((l) => /* @__PURE__ */ e(Te, { recurrence: l }, l.repeatingTransactionGuid))
313
317
  }
314
318
  ) }),
315
- l.length > 0 && /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
316
- ee,
319
+ c.length > 0 && /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
320
+ ne,
317
321
  {
318
- subheader: /* @__PURE__ */ e(Re, { total: c, type: oe.EXPENSE }),
322
+ subheader: /* @__PURE__ */ e(Re, { total: d, type: ie.EXPENSE }),
319
323
  sx: { width: "100%" },
320
- children: l.map((d) => /* @__PURE__ */ e(Te, { recurrence: d }, d.repeatingTransactionGuid))
324
+ children: c.map((l) => /* @__PURE__ */ e(Te, { recurrence: l }, l.repeatingTransactionGuid))
321
325
  }
322
326
  ) }),
323
327
  /* @__PURE__ */ e(
324
328
  _t,
325
329
  {
326
- remaining: (m.available_balance || m.balance || 0) + r - c
330
+ remaining: (m.available_balance || m.balance || 0) + r - d
327
331
  }
328
332
  )
329
333
  ]
@@ -332,24 +336,24 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
332
336
  );
333
337
  }) })
334
338
  ] });
335
- }, At = L(Dt), Et = () => {
336
- const { availableWidth: a } = le(), n = ce(), { cashflow: t } = N(), { upcomingExpenses: i, upcomingIncome: g } = P(), { dateRange: b, selectedCashAccounts: m } = K(), h = [
339
+ }, At = T(vt), Et = () => {
340
+ const { availableWidth: a } = de(), n = le(), { cashflow: t } = N(), { upcomingExpenses: i, upcomingIncome: g } = q(), { dateRange: x, selectedCashAccounts: m } = V(), p = [
337
341
  {
338
342
  field: "account",
339
343
  flex: 1.5,
340
344
  headerName: t.accounts,
341
- renderCell: ({ value: { name: r, nickname: c, institution_guid: d, account_number: x } }) => {
342
- const C = c || r;
345
+ renderCell: ({ value: { name: r, nickname: d, institution_guid: l, account_number: b } }) => {
346
+ const C = d || r;
343
347
  return /* @__PURE__ */ o(s, { alignItems: "center", flexDirection: "row", gap: 12, children: [
344
348
  /* @__PURE__ */ e(
345
349
  ye,
346
350
  {
347
351
  alt: t.institution_logo,
348
- institutionGuid: d || "",
352
+ institutionGuid: l || "",
349
353
  size: 16
350
354
  }
351
355
  ),
352
- /* @__PURE__ */ e(u, { variant: "body2", children: `${C} ${x ? `*${x}` : ""}` })
356
+ /* @__PURE__ */ e(u, { variant: "body2", children: `${C} ${b ? `*${b}` : ""}` })
353
357
  ] });
354
358
  }
355
359
  },
@@ -358,21 +362,21 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
358
362
  flex: 1,
359
363
  headerName: t.balance,
360
364
  type: "number",
361
- renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: Z(r.value, "0,0.00") })
365
+ renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: te(r.value, "0,0.00") })
362
366
  },
363
367
  {
364
368
  field: "income",
365
369
  flex: 1,
366
370
  headerName: t.projected_income,
367
371
  type: "number",
368
- renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: `+${Z(r.value, "0,0.00")}` })
372
+ renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: `+${te(r.value, "0,0.00")}` })
369
373
  },
370
374
  {
371
375
  field: "expenses",
372
376
  flex: 1.1,
373
377
  headerName: t.projected_expenses,
374
378
  type: "number",
375
- renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: `-${Z(r.value, "0,0.00")}` })
379
+ renderCell: (r) => /* @__PURE__ */ e(u, { color: n.palette.text.primary, variant: "Small", children: `-${te(r.value, "0,0.00")}` })
376
380
  },
377
381
  {
378
382
  field: "remaining",
@@ -380,34 +384,34 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
380
384
  headerName: t.remaining,
381
385
  type: "number",
382
386
  renderCell: (r) => {
383
- const c = r.row.balance + r.row.income - r.row.expenses;
387
+ const d = r.row.balance + r.row.income - r.row.expenses;
384
388
  return /* @__PURE__ */ e(
385
389
  u,
386
390
  {
387
- color: Math.sign(c) === -1 ? n.palette.error.main : n.palette.text.primary,
391
+ color: Math.sign(d) === -1 ? n.palette.error.main : n.palette.text.primary,
388
392
  variant: "Small",
389
- children: Z(c, "0,0.00")
393
+ children: te(d, "0,0.00")
390
394
  }
391
395
  );
392
396
  }
393
397
  }
394
- ], l = p.useMemo(() => m.map((r) => {
395
- const c = i.filter(
396
- se(r, { start: $(), end: we($(), 30) })
397
- ).reduce((C, _) => C + _.amount, 0), d = g.filter(
398
- se(r, { start: $(), end: we($(), 30) })
399
- ).reduce((C, _) => C + _.amount, 0), x = (r.balance || 0) + d - c;
398
+ ], c = f.useMemo(() => m.map((r) => {
399
+ const d = i.filter(
400
+ ce(r, { start: $(), end: we($(), 30) })
401
+ ).reduce((C, _) => C + _.amount, 0), l = g.filter(
402
+ ce(r, { start: $(), end: we($(), 30) })
403
+ ).reduce((C, _) => C + _.amount, 0), b = (r.balance || 0) + l - d;
400
404
  return {
401
405
  account: r,
402
406
  balance: r.balance || 0,
403
407
  id: r.guid,
404
- income: d,
405
- expenses: c,
406
- remaining: x
408
+ income: l,
409
+ expenses: d,
410
+ remaining: b
407
411
  };
408
412
  }), [m, i, g]);
409
413
  return /* @__PURE__ */ o(
410
- v,
414
+ D,
411
415
  {
412
416
  sx: {
413
417
  width: "100%"
@@ -433,7 +437,7 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
433
437
  }
434
438
  ),
435
439
  /* @__PURE__ */ e(
436
- pe,
440
+ fe,
437
441
  {
438
442
  body: t.table_tooltip_body,
439
443
  title: t.table_tooltip_title
@@ -441,10 +445,10 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
441
445
  )
442
446
  ] }),
443
447
  /* @__PURE__ */ o(u, { bold: !0, sx: { fontSize: 15, whiteSpace: "normal" }, children: [
444
- Q(b.start, V.FULL_MONTH_DAY),
448
+ Y(x.start, Q.FULL_MONTH_DAY),
445
449
  " -",
446
450
  " ",
447
- Q(b.end, V.FULL_MONTH_DAY)
451
+ Y(x.end, Q.FULL_MONTH_DAY)
448
452
  ] })
449
453
  ]
450
454
  }
@@ -453,13 +457,13 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
453
457
  rt,
454
458
  {
455
459
  columnHeaderHeight: 48,
456
- columns: h,
460
+ columns: p,
457
461
  density: "standard",
458
462
  disableColumnMenu: !0,
459
463
  disableRowSelectionOnClick: !0,
460
464
  hideFooter: !0,
461
465
  rowHeight: 48,
462
- rows: l,
466
+ rows: c,
463
467
  sx: {
464
468
  border: "1px solid",
465
469
  borderColor: "border.light",
@@ -479,10 +483,10 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
479
483
  }
480
484
  }
481
485
  }
482
- ) : l.map((r) => {
483
- const { name: c, nickname: d, institution_guid: x, account_number: C } = r.account, _ = d || c;
486
+ ) : c.map((r) => {
487
+ const { name: d, nickname: l, institution_guid: b, account_number: C } = r.account, _ = l || d;
484
488
  return /* @__PURE__ */ e(
485
- ee,
489
+ ne,
486
490
  {
487
491
  sx: {
488
492
  border: "1px solid",
@@ -490,7 +494,7 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
490
494
  borderRadius: 1,
491
495
  marginBottom: 24
492
496
  },
493
- children: /* @__PURE__ */ e(ne, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ o(s, { width: "100%", children: [
497
+ children: /* @__PURE__ */ e(ae, { sx: { minHeight: "auto" }, children: /* @__PURE__ */ o(s, { width: "100%", children: [
494
498
  /* @__PURE__ */ o(
495
499
  s,
496
500
  {
@@ -505,17 +509,17 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
505
509
  ye,
506
510
  {
507
511
  alt: t.institution_logo,
508
- institutionGuid: x || "",
512
+ institutionGuid: b || "",
509
513
  size: 16
510
514
  }
511
515
  ),
512
516
  /* @__PURE__ */ e(u, { variant: "Small", children: `${_} ${C ? `*${C}` : ""}` })
513
517
  ] }),
514
- /* @__PURE__ */ e(O, { amount: r.balance, bold: !0, variant: "Small" })
518
+ /* @__PURE__ */ e(L, { amount: r.balance, bold: !0, variant: "Small" })
515
519
  ]
516
520
  }
517
521
  ),
518
- /* @__PURE__ */ e(D, { sx: { width: "100%" } }),
522
+ /* @__PURE__ */ e(v, { sx: { width: "100%" } }),
519
523
  /* @__PURE__ */ o(
520
524
  s,
521
525
  {
@@ -526,11 +530,11 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
526
530
  py: 12,
527
531
  children: [
528
532
  /* @__PURE__ */ e(u, { variant: "Small", children: t.projected_income }),
529
- /* @__PURE__ */ e(O, { amount: r.income, bold: !0, symbol: "+", variant: "Small" })
533
+ /* @__PURE__ */ e(L, { amount: r.income, bold: !0, symbol: "+", variant: "Small" })
530
534
  ]
531
535
  }
532
536
  ),
533
- /* @__PURE__ */ e(D, { sx: { width: "100%" } }),
537
+ /* @__PURE__ */ e(v, { sx: { width: "100%" } }),
534
538
  /* @__PURE__ */ o(
535
539
  s,
536
540
  {
@@ -541,11 +545,11 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
541
545
  py: 12,
542
546
  children: [
543
547
  /* @__PURE__ */ e(u, { variant: "Small", children: t.projected_expenses }),
544
- /* @__PURE__ */ e(O, { amount: r.expenses, bold: !0, symbol: "-", variant: "Small" })
548
+ /* @__PURE__ */ e(L, { amount: r.expenses, bold: !0, symbol: "-", variant: "Small" })
545
549
  ]
546
550
  }
547
551
  ),
548
- /* @__PURE__ */ e(D, { sx: { width: "100%" } }),
552
+ /* @__PURE__ */ e(v, { sx: { width: "100%" } }),
549
553
  /* @__PURE__ */ e(
550
554
  s,
551
555
  {
@@ -557,7 +561,7 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
557
561
  px: 16,
558
562
  py: 12,
559
563
  sx: { borderBottomLeftRadius: "4px", borderBottomRightRadius: "4px" },
560
- children: /* @__PURE__ */ e(fe, { remaining: r.remaining })
564
+ children: /* @__PURE__ */ e(ge, { remaining: r.remaining })
561
565
  }
562
566
  )
563
567
  ] }) })
@@ -568,19 +572,19 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
568
572
  ]
569
573
  }
570
574
  );
571
- }, Tt = L(Et), Rt = () => {
572
- const { cashflow: a } = N(), { isDesktop: n } = he(), { onEvent: t } = ke(), [i, g] = p.useState(0), b = (m, h) => {
573
- g(h);
575
+ }, Tt = T(Et), Rt = () => {
576
+ const { cashflow: a } = N(), { isDesktop: n } = pe(), { onEvent: t } = ke(), [i, g] = f.useState(0), x = (m, p) => {
577
+ g(p);
574
578
  };
575
- return p.useEffect(() => {
579
+ return f.useEffect(() => {
576
580
  t(i === 0 ? "cash_flow_summary" : "cash_flow_details");
577
- }, [i]), /* @__PURE__ */ o(v, { children: [
581
+ }, [i]), /* @__PURE__ */ o(D, { children: [
578
582
  /* @__PURE__ */ o(
579
583
  tt,
580
584
  {
581
585
  "aria-label": a.cashflow_summary_and_details,
582
586
  centered: !0,
583
- onChange: b,
587
+ onChange: x,
584
588
  textColor: "primary",
585
589
  value: i,
586
590
  variant: "fullWidth",
@@ -610,17 +614,17 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
610
614
  ]
611
615
  }
612
616
  ),
613
- /* @__PURE__ */ e(v, { sx: { mb: 32 } }),
614
- /* @__PURE__ */ e(Se, { index: 0, name: "cashflow", value: i, children: /* @__PURE__ */ e(v, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Tt, {}) }) }),
615
- /* @__PURE__ */ e(Se, { index: 1, name: "cashflow", value: i, children: /* @__PURE__ */ e(v, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(At, {}) }) })
617
+ /* @__PURE__ */ e(D, { sx: { mb: 32 } }),
618
+ /* @__PURE__ */ e(Se, { index: 0, name: "cashflow", value: i, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(Tt, {}) }) }),
619
+ /* @__PURE__ */ e(Se, { index: 1, name: "cashflow", value: i, children: /* @__PURE__ */ e(D, { sx: { m: n ? 48 : 16 }, children: /* @__PURE__ */ e(At, {}) }) })
616
620
  ] });
617
- }, Lt = L(Rt), re = ({
621
+ }, Lt = T(Rt), se = ({
618
622
  amount: a,
619
623
  isMobile: n = !1,
620
624
  isTotal: t = !1,
621
625
  label: i,
622
626
  symbol: g,
623
- tooltip: b
627
+ tooltip: x
624
628
  }) => /* @__PURE__ */ o(
625
629
  s,
626
630
  {
@@ -630,85 +634,85 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
630
634
  padding: n ? "14px 16px" : 0,
631
635
  sx: { borderBottomLeftRadius: 4, borderBottomRightRadius: 4 },
632
636
  children: [
633
- !n && /* @__PURE__ */ e(O, { amount: a, component: "h2", variant: "H2" }),
637
+ !n && /* @__PURE__ */ e(L, { amount: a, component: "h2", variant: "H2" }),
634
638
  /* @__PURE__ */ o(s, { alignItems: "center", component: "span", direction: "row", gap: 8, mt: 2, children: [
635
639
  /* @__PURE__ */ e(u, { bold: t, variant: "Small", children: i }),
636
- b
640
+ x
637
641
  ] }),
638
- n && /* @__PURE__ */ e(O, { amount: a, component: "h2", symbol: g, variant: "Small" })
642
+ n && /* @__PURE__ */ e(L, { amount: a, component: "h2", symbol: g, variant: "Small" })
639
643
  ]
640
644
  }
641
- ), Le = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && (Me(t.expectedDate) || We(t.expectedDate, n.start)) && $e(t.expectedDate, n.end), Ot = () => {
642
- const { availableWidth: a } = le(), { cashflow: n } = N(), { income: t, isDataLoaded: i, upcomingExpenses: g, upcomingIncome: b } = P(), { selectedAccountGuids: m } = Y(), { dateRange: h, selectedCashAccounts: l } = K(), [r, c] = p.useState(!1), d = p.useMemo(
643
- () => g.filter(Le(m, h)),
644
- [h, m, g]
645
- ), x = p.useMemo(
646
- () => b.filter(Le(m, h)),
647
- [h, m, b]
648
- ), C = p.useMemo(
649
- () => l.reduce((w, I) => w + (I?.balance || 0), 0),
650
- [l]
651
- ), _ = d.reduce((w, I) => w + I.amount, 0), H = x.reduce((w, I) => w + I.amount, 0), A = C - _ + H, W = i && t.length > 0, f = a < 725;
652
- return /* @__PURE__ */ o(s, { sx: { mx: f ? 16 : 0, my: f ? 24 : 42 }, children: [
645
+ ), Le = (a, n) => (t) => t.accountGuid && a.includes(t.accountGuid) && (Ge(t.expectedDate) || $e(t.expectedDate, n.start)) && Me(t.expectedDate, n.end), Nt = () => {
646
+ const { availableWidth: a } = de(), { cashflow: n } = N(), { income: t, isDataLoaded: i, upcomingExpenses: g, upcomingIncome: x } = q(), { selectedAccountGuids: m } = X(), { dateRange: p, selectedCashAccounts: c } = V(), [r, d] = f.useState(!1), l = f.useMemo(
647
+ () => g.filter(Le(m, p)),
648
+ [p, m, g]
649
+ ), b = f.useMemo(
650
+ () => x.filter(Le(m, p)),
651
+ [p, m, x]
652
+ ), C = f.useMemo(
653
+ () => c.reduce((w, A) => w + (A?.balance || 0), 0),
654
+ [c]
655
+ ), _ = l.reduce((w, A) => w + A.amount, 0), k = b.reduce((w, A) => w + A.amount, 0), I = C - _ + k, F = i && t.length > 0, h = a < 725;
656
+ return /* @__PURE__ */ o(s, { sx: { mx: h ? 16 : 0, my: h ? 24 : 42 }, children: [
653
657
  /* @__PURE__ */ o(
654
658
  s,
655
659
  {
656
- border: f ? "1px solid" : "none",
660
+ border: h ? "1px solid" : "none",
657
661
  borderColor: "border.light",
658
662
  borderRadius: 2,
659
- flexDirection: f ? "column" : "row",
660
- gap: f ? 0 : 24,
663
+ flexDirection: h ? "column" : "row",
664
+ gap: h ? 0 : 24,
661
665
  justifyContent: "center",
662
666
  children: [
663
667
  /* @__PURE__ */ e(
664
- re,
668
+ se,
665
669
  {
666
670
  amount: C,
667
- isMobile: f,
668
- label: M(n.cash_and_bank, l.length)
671
+ isMobile: h,
672
+ label: M(n.cash_and_bank, c.length)
669
673
  }
670
674
  ),
671
- f && /* @__PURE__ */ e(D, {}),
672
- W ? /* @__PURE__ */ o(U, { children: [
673
- !f && /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
675
+ h && /* @__PURE__ */ e(v, {}),
676
+ F ? /* @__PURE__ */ o(P, { children: [
677
+ !h && /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "+" }),
674
678
  /* @__PURE__ */ e(
675
- re,
679
+ se,
676
680
  {
677
- amount: H,
678
- isMobile: f,
681
+ amount: k,
682
+ isMobile: h,
679
683
  label: n.to_be_received,
680
- symbol: f ? "+" : void 0
684
+ symbol: h ? "+" : void 0
681
685
  }
682
686
  )
683
687
  ] }) : /* @__PURE__ */ e(
684
688
  G,
685
689
  {
686
- onClick: () => c(!0),
690
+ onClick: () => d(!0),
687
691
  startIcon: /* @__PURE__ */ e(j, { name: "add" }),
688
692
  sx: { fontSize: 13 },
689
693
  children: n.add_income
690
694
  }
691
695
  ),
692
- f ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
696
+ h ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "-" }),
693
697
  /* @__PURE__ */ e(
694
- re,
698
+ se,
695
699
  {
696
700
  amount: _,
697
- isMobile: f,
698
- label: M(n.to_be_paid_out, d.length),
699
- symbol: f ? "-" : void 0
701
+ isMobile: h,
702
+ label: M(n.to_be_paid_out, l.length),
703
+ symbol: h ? "-" : void 0
700
704
  }
701
705
  ),
702
- f ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
706
+ h ? /* @__PURE__ */ e(v, {}) : /* @__PURE__ */ e(u, { sx: { fontSize: 25, lineHeight: 1 }, children: "=" }),
703
707
  /* @__PURE__ */ e(
704
- re,
708
+ se,
705
709
  {
706
- amount: A,
707
- isMobile: f,
708
- isTotal: f,
710
+ amount: I,
711
+ isMobile: h,
712
+ isTotal: h,
709
713
  label: n.remaining_cash,
710
714
  tooltip: /* @__PURE__ */ e(
711
- pe,
715
+ fe,
712
716
  {
713
717
  body: n.remaining_income_tooltip_body,
714
718
  title: n.remaining_income_tooltip_title
@@ -720,23 +724,23 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
720
724
  }
721
725
  ),
722
726
  /* @__PURE__ */ e(
723
- Ge,
727
+ je,
724
728
  {
725
729
  ariaLabelClose: n.close_manage_income_aria,
726
730
  isOpen: r,
727
- onClose: () => c(!1),
731
+ onClose: () => d(!1),
728
732
  shouldShowHeaderBorders: !1,
729
733
  title: n.manage_income,
730
734
  children: /* @__PURE__ */ e(st, {})
731
735
  }
732
736
  )
733
737
  ] });
734
- }, Nt = L(Ot), kt = ({ handleNextStep: a }) => {
735
- const { completeOnboarding: n } = ue(), { cashflow: t } = N(), i = ce();
738
+ }, Ot = T(Nt), kt = ({ handleNextStep: a }) => {
739
+ const { completeOnboarding: n } = he(), { cashflow: t } = N(), i = le();
736
740
  return /* @__PURE__ */ o(s, { children: [
737
- /* @__PURE__ */ e(me, { pb: 12, children: t.welcome_title }),
741
+ /* @__PURE__ */ e(ue, { pb: 12, children: t.welcome_title }),
738
742
  /* @__PURE__ */ e(
739
- Ye,
743
+ Qe,
740
744
  {
741
745
  color: i.palette.primary.light,
742
746
  pb: 8,
@@ -745,11 +749,11 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
745
749
  children: t.welcome_sub_title
746
750
  }
747
751
  ),
748
- /* @__PURE__ */ e(k, { pb: 32, children: t.welcome_description }),
752
+ /* @__PURE__ */ e(O, { pb: 32, children: t.welcome_description }),
749
753
  /* @__PURE__ */ o(s, { direction: "column", mb: 32, spacing: 32, children: [
750
- /* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
754
+ /* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
751
755
  /* @__PURE__ */ e(
752
- v,
756
+ D,
753
757
  {
754
758
  bgcolor: i.palette.primary.lighter,
755
759
  borderRadius: 1,
@@ -763,9 +767,9 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
763
767
  ),
764
768
  t.bullet_one
765
769
  ] }),
766
- /* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
770
+ /* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
767
771
  /* @__PURE__ */ e(
768
- v,
772
+ D,
769
773
  {
770
774
  bgcolor: i.palette.primary.lighter,
771
775
  borderRadius: 1,
@@ -779,9 +783,9 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
779
783
  ),
780
784
  t.bullet_two
781
785
  ] }),
782
- /* @__PURE__ */ o(k, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
786
+ /* @__PURE__ */ o(O, { sx: { display: "flex", alignItems: "center", fontSize: 18 }, children: [
783
787
  /* @__PURE__ */ e(
784
- v,
788
+ D,
785
789
  {
786
790
  bgcolor: i.palette.primary.lighter,
787
791
  borderRadius: 1,
@@ -801,17 +805,17 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
801
805
  /* @__PURE__ */ e(G, { onClick: n, variant: "outlined", children: t.skip_button })
802
806
  ] })
803
807
  ] });
804
- }, Ht = L(kt), Oe = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", ze = {
805
- CASHFLOW_ONBOARDING: `${Oe}/cashflow-onboarding.png`,
806
- CASHFLOW_LOADING_ANIMATION: `${Oe}/loading-animation.gif`
808
+ }, Ht = T(kt), Ne = "https://content.moneydesktop.com/storage/MD_Assets/md/cashflow", Be = {
809
+ CASHFLOW_ONBOARDING: `${Ne}/cashflow-onboarding.png`,
810
+ CASHFLOW_LOADING_ANIMATION: `${Ne}/loading-animation.gif`
807
811
  }, Ft = () => {
808
812
  const { cashflow: a } = N();
809
- return /* @__PURE__ */ o(p.Fragment, { children: [
810
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: ze.CASHFLOW_LOADING_ANIMATION }) }),
811
- /* @__PURE__ */ e(me, { pb: 12, children: a.loading_title }),
812
- /* @__PURE__ */ e(k, { children: a.loading_description })
813
+ return /* @__PURE__ */ o(f.Fragment, { children: [
814
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("img", { alt: "Loading", src: Be.CASHFLOW_LOADING_ANIMATION }) }),
815
+ /* @__PURE__ */ e(ue, { pb: 12, children: a.loading_title }),
816
+ /* @__PURE__ */ e(O, { children: a.loading_description })
813
817
  ] });
814
- }, Wt = L(Ft), $t = it`
818
+ }, Wt = T(Ft), $t = it`
815
819
  from {
816
820
  transform: rotate(0deg);
817
821
  }
@@ -819,142 +823,142 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
819
823
  transform: rotate(360deg);
820
824
  }
821
825
  `, Mt = () => {
822
- const { addRepeatingTransaction: a, repeatingTransactions: n } = P(), { cashflow: t, common: i } = N(), { user: g } = He(), { completeOnboarding: b } = ue(), { isDirty: m } = K(), { isMobile: h } = he(), { isCopyLoaded: l, setDisplayedDate: r } = Y(), { filter: c, setFilter: d, transactions: x } = Fe(), C = ce(), [_, H] = J(!0), [A, W] = p.useState(ft.EveryMonth), [f, w] = p.useState(1), [I, E] = p.useState(15), [F, ge] = J(!1), [q, ae] = J(1), [T, de] = J([]), [ie, X] = J(""), S = p.useMemo(
823
- () => x.find((y) => y.guid === ie),
824
- [ie, x]
825
- ), Be = !!n.filter(
826
- (y) => y.repeating_transaction_type === ve.Income
826
+ const { addRepeatingTransaction: a, repeatingTransactions: n } = q(), { cashflow: t, common: i } = N(), { user: g } = He(), { completeOnboarding: x } = he(), { isDirty: m } = V(), { isMobile: p } = pe(), { isCopyLoaded: c, setDisplayedDate: r } = X(), { filter: d, setFilter: l, transactions: b } = Fe(), C = le(), [_, k] = ee(!0), [I, F] = f.useState(ft.EveryMonth), [h, w] = f.useState(1), [A, S] = f.useState(15), [z, re] = ee(!1), [K, J] = ee(1), [R, me] = ee([]), [Z, H] = ee(""), W = f.useMemo(
827
+ () => b.find((y) => y.guid === Z),
828
+ [Z, b]
829
+ ), Ue = !!n.filter(
830
+ (y) => y.repeating_transaction_type === De.Income
827
831
  ).length, be = async () => {
828
- ae(2), r(
832
+ J(2), r(
829
833
  // Beginning of the month, 90 days before today
830
- ut(je($(), 90)),
834
+ ut(ze($(), 90)),
831
835
  $()
832
- ), d({ ...c, custom: _e }), ae(3);
833
- }, Ue = async () => {
834
- if (!(T.length < 1)) {
835
- ge(!0);
836
- for (let y = 0; y < T.length; y++) {
837
- const R = T[y], xe = De(A, Ie(R.date)), qe = {
838
- account_guid: R.account_guid,
839
- amount: R.amount,
836
+ ), l({ ...d, custom: _e }), J(3);
837
+ }, Pe = async () => {
838
+ if (!(R.length < 1)) {
839
+ re(!0);
840
+ for (let y = 0; y < R.length; y++) {
841
+ const E = R[y], xe = ve(I, Ie(E.date)), Xe = {
842
+ account_guid: E.account_guid,
843
+ amount: E.amount,
840
844
  created_by: 0,
841
845
  //user
842
- merchant_guid: R.merchant_guid,
843
- description: R.feed_description || R.description,
846
+ merchant_guid: E.merchant_guid,
847
+ description: E.feed_description || E.description,
844
848
  predicted_occurs_on: mt(xe, { representation: "date" }),
845
849
  recurrence_day: xe.getDay(),
846
- recurrence_type: A,
847
- repeating_transaction_type: ve.Income,
848
- second_recurrence_day: I,
849
- transaction_type: R.transaction_type,
850
+ recurrence_type: I,
851
+ repeating_transaction_type: De.Income,
852
+ second_recurrence_day: A,
853
+ transaction_type: E.transaction_type,
850
854
  user_guid: g.guid
851
855
  };
852
- await a(qe, R);
856
+ await a(Xe, E);
853
857
  }
854
- await b();
858
+ await x();
855
859
  }
856
- }, Pe = !S && _ || !S && T.length < 1;
857
- return l ? /* @__PURE__ */ o(
858
- v,
860
+ }, qe = !W && _ || !W && R.length < 1;
861
+ return c ? /* @__PURE__ */ o(
862
+ D,
859
863
  {
860
864
  sx: {
861
865
  display: "flex",
862
- alignItems: h ? "flex-start" : "center",
866
+ alignItems: p ? "flex-start" : "center",
863
867
  backgroundColor: C.palette.background.paper,
864
- backgroundImage: h ? null : `url(${ze.CASHFLOW_ONBOARDING})`,
868
+ backgroundImage: p ? null : `url(${Be.CASHFLOW_ONBOARDING})`,
865
869
  backgroundRepeat: "no-repeat",
866
870
  backgroundPosition: "left 100px",
867
871
  backgroundSize: "35%",
868
872
  py: 24
869
873
  },
870
874
  children: [
871
- q === 1 && /* @__PURE__ */ e(
872
- v,
875
+ K === 1 && /* @__PURE__ */ e(
876
+ D,
873
877
  {
874
878
  sx: {
875
- ...h ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
879
+ ...p ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
876
880
  },
877
881
  children: /* @__PURE__ */ e(Ht, { handleNextStep: be })
878
882
  }
879
883
  ),
880
- q === 2 && /* @__PURE__ */ e(
881
- v,
884
+ K === 2 && /* @__PURE__ */ e(
885
+ D,
882
886
  {
883
887
  sx: {
884
- ...h ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
888
+ ...p ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
885
889
  },
886
890
  children: /* @__PURE__ */ e(Wt, {})
887
891
  }
888
892
  ),
889
- q === 3 && /* @__PURE__ */ o(
890
- v,
893
+ K === 3 && /* @__PURE__ */ o(
894
+ D,
891
895
  {
892
896
  sx: {
893
- ...h ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
897
+ ...p ? { display: "flex", flexDirection: "column", maxWidth: "100%", padding: "0 16px" } : { maxWidth: 590, ml: "40%", mr: 90 }
894
898
  },
895
899
  children: [
896
- /* @__PURE__ */ e(me, { pb: 12, children: t.add_income_title }),
897
- /* @__PURE__ */ e(k, { mb: 24, children: t.add_income_description }),
898
- T.length > 0 && !S && /* @__PURE__ */ o(U, { children: [
899
- /* @__PURE__ */ e(ee, { children: T.map((y, R) => /* @__PURE__ */ o(p.Fragment, { children: [
900
+ /* @__PURE__ */ e(ue, { pb: 12, children: t.add_income_title }),
901
+ /* @__PURE__ */ e(O, { mb: 24, children: t.add_income_description }),
902
+ R.length > 0 && !W && /* @__PURE__ */ o(P, { children: [
903
+ /* @__PURE__ */ e(ne, { children: R.map((y, E) => /* @__PURE__ */ o(f.Fragment, { children: [
900
904
  /* @__PURE__ */ e(ht, { bgcolor: "background.paper", children: gt(
901
- B(y.nextDate || y.date)
905
+ U(y.nextDate || y.date)
902
906
  ) }),
903
907
  /* @__PURE__ */ e(pt, { transaction: y }),
904
- R !== T.length - 1 && /* @__PURE__ */ e(D, {})
908
+ E !== R.length - 1 && /* @__PURE__ */ e(v, {})
905
909
  ] }, y.guid)) }),
906
910
  /* @__PURE__ */ o(s, { alignItems: "center", direction: "row", children: [
907
- /* @__PURE__ */ e(D, { sx: { flexGrow: 1 } }),
911
+ /* @__PURE__ */ e(v, { sx: { flexGrow: 1 } }),
908
912
  /* @__PURE__ */ e(
909
913
  G,
910
914
  {
911
- onClick: () => H(!0),
915
+ onClick: () => k(!0),
912
916
  startIcon: /* @__PURE__ */ e(j, { name: "add", size: 20 }),
913
917
  children: t.add_income
914
918
  }
915
919
  )
916
920
  ] })
917
921
  ] }),
918
- Pe && /* @__PURE__ */ e(
922
+ qe && /* @__PURE__ */ e(
919
923
  ct,
920
924
  {
921
925
  bgcolor: "background.paper",
922
- onSearch: (y) => d({
923
- ...c,
924
- custom: (R) => y ? lt(R, y) : _e(R)
926
+ onSearch: (y) => l({
927
+ ...d,
928
+ custom: (E) => y ? lt(E, y) : _e(E)
925
929
  }),
926
930
  onSelected: (y) => {
927
- X(y), H(!1);
931
+ H(y), k(!1);
928
932
  }
929
933
  }
930
934
  ),
931
- !Be && m && /* @__PURE__ */ e(k, { color: "error", mt: 16, children: t.confirm_error }),
932
- S && /* @__PURE__ */ o(U, { children: [
935
+ !Ue && m && /* @__PURE__ */ e(O, { color: "error", mt: 16, children: t.confirm_error }),
936
+ W && /* @__PURE__ */ o(P, { children: [
933
937
  /* @__PURE__ */ e(
934
938
  dt,
935
939
  {
936
940
  bgcolor: "background.paper",
937
- firstDay: f,
938
- frequency: A,
941
+ firstDay: h,
942
+ frequency: I,
939
943
  onFirstDayChange: w,
940
- onFrequencyChange: W,
941
- onSecondDayChange: E,
942
- secondDay: I,
943
- transaction: S
944
+ onFrequencyChange: F,
945
+ onSecondDayChange: S,
946
+ secondDay: A,
947
+ transaction: W
944
948
  }
945
949
  ),
946
950
  /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
947
951
  /* @__PURE__ */ e(
948
952
  G,
949
953
  {
950
- "aria-disabled": !S,
954
+ "aria-disabled": !W,
951
955
  onClick: () => {
952
- const y = [...T];
956
+ const y = [...R];
953
957
  y.push({
954
- ...S,
955
- nextDate: De(A, Ie(S.date)),
956
- frequency: A
957
- }), de(y), X("");
958
+ ...W,
959
+ nextDate: ve(I, Ie(W.date)),
960
+ frequency: I
961
+ }), me(y), H("");
958
962
  },
959
963
  variant: "contained",
960
964
  children: i.confirm_button
@@ -964,7 +968,7 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
964
968
  G,
965
969
  {
966
970
  onClick: () => {
967
- X(""), H(!0), be().finally();
971
+ H(""), k(!0), be().finally();
968
972
  },
969
973
  variant: "outlined",
970
974
  children: i.cancel_button
@@ -972,13 +976,13 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
972
976
  )
973
977
  ] })
974
978
  ] }),
975
- T.length > 0 && !S && /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
979
+ R.length > 0 && !W && /* @__PURE__ */ o(s, { direction: "row", gap: 16, ml: 24, mt: 32, children: [
976
980
  /* @__PURE__ */ e(
977
981
  G,
978
982
  {
979
- "aria-disabled": T.length < 1 || F,
980
- onClick: Ue,
981
- startIcon: F ? /* @__PURE__ */ e(
983
+ "aria-disabled": R.length < 1 || z,
984
+ onClick: Pe,
985
+ startIcon: z ? /* @__PURE__ */ e(
982
986
  j,
983
987
  {
984
988
  name: "progress_activity",
@@ -991,113 +995,114 @@ const It = ({ recurrence: a }) => /* @__PURE__ */ o(U, { children: [
991
995
  children: t.confirm_income_button
992
996
  }
993
997
  ),
994
- /* @__PURE__ */ e(G, { onClick: b, variant: "outlined", children: t.skip_button })
998
+ /* @__PURE__ */ e(G, { onClick: x, variant: "outlined", children: t.skip_button })
995
999
  ] })
996
1000
  ]
997
1001
  }
998
1002
  )
999
1003
  ]
1000
1004
  }
1001
- ) : /* @__PURE__ */ e(te, {});
1002
- }, Gt = L(Mt), jt = ({ onBackClick: a, sx: n = {} }) => {
1005
+ ) : /* @__PURE__ */ e(oe, {});
1006
+ }, Gt = T(Mt), jt = ({ onBackClick: a, sx: n = {} }) => {
1003
1007
  const {
1004
1008
  selectedAccounts: t,
1005
1009
  selectedAccountGuids: i,
1006
1010
  setSelectedAccounts: g,
1007
- shouldDisableNextDate: b,
1011
+ shouldDisableNextDate: x,
1008
1012
  shouldDisablePrevDate: m
1009
- } = Y(), { onEvent: h } = ke(), { onLoad: l } = Ve(), { clientConfig: r } = Ke(), { visibleCashAccounts: c } = Ne(), { setFilter: d } = Fe(), { userProfile: x } = He(), { dateRange: C, setSelectedCashAccounts: _ } = K(), { loadRepeatingTransactions: H, income: A, isDataLoaded: W, setDateRange: f } = P(), { cashflow: w, recurring: I } = N(), { isCopyLoaded: E, isInitialized: F } = Y(), q = r?.master?.deep_link_params?.view === "manage_income", [ae, T] = p.useState(q);
1010
- p.useEffect(() => {
1011
- F && (f(C), H().finally(() => {
1012
- l?.("CashflowWidget");
1013
- }));
1014
- }, [F]), p.useEffect(() => {
1015
- g(c);
1016
- }, [c]), p.useEffect(() => {
1017
- const ie = c.map((S) => S.guid), X = t.filter(
1018
- (S) => i.includes(S.guid) && ie.includes(S.guid)
1013
+ } = X(), { onEvent: p } = ke(), { clientConfig: c } = Ke(), { visibleCashAccounts: r } = Oe(), { setFilter: d } = Fe(), { userProfile: l } = He(), { dateRange: b, setSelectedCashAccounts: C } = V(), { loadRepeatingTransactions: _, income: k, isDataLoaded: I, setDateRange: F } = q(), { cashflow: h, recurring: w } = N(), { isCopyLoaded: A, isInitialized: S } = X(), re = c?.master?.deep_link_params?.view === "manage_income", [K, J] = f.useState(re);
1014
+ f.useEffect(() => {
1015
+ S && (F(b), _().finally());
1016
+ }, [S]), f.useEffect(() => {
1017
+ g(r);
1018
+ }, [r]), f.useEffect(() => {
1019
+ const me = r.map((H) => H.guid), Z = t.filter(
1020
+ (H) => i.includes(H.guid) && me.includes(H.guid)
1019
1021
  );
1020
- _(X), d({
1021
- dateRange: { start: je($(), 90), end: bt() },
1022
- accounts: X.map((S) => S.guid)
1022
+ C(Z), d({
1023
+ dateRange: { start: ze($(), 90), end: bt() },
1024
+ accounts: Z.map((H) => H.guid)
1023
1025
  });
1024
- }, [c, t]);
1025
- const de = W && !x?.has_completed_cash_flow_onboarding && !A.length;
1026
- return !E || !F ? /* @__PURE__ */ e(te, {}) : de ? /* @__PURE__ */ e(
1026
+ }, [r, t]), We({
1027
+ widgetName: "CashflowWidget",
1028
+ isLoaded: I
1029
+ });
1030
+ const R = I && !l?.has_completed_cash_flow_onboarding && !k.length;
1031
+ return !A || !S ? /* @__PURE__ */ e(oe, {}) : R ? /* @__PURE__ */ e(
1027
1032
  Ae,
1028
1033
  {
1029
1034
  onBackClick: a,
1030
1035
  sx: { height: "100%", overflow: "auto" },
1031
- title: w.title,
1036
+ title: h.title,
1032
1037
  children: /* @__PURE__ */ e(Gt, {})
1033
1038
  }
1034
1039
  ) : /* @__PURE__ */ o(
1035
1040
  Ae,
1036
1041
  {
1037
- accountOptions: c,
1042
+ accountOptions: r,
1038
1043
  actions: [
1039
1044
  {
1040
- label: I.action_title,
1045
+ label: w.action_title,
1041
1046
  iconName: "credit_card_gear",
1042
1047
  onClick: () => {
1043
- T(!0), h(Ee.CASH_FLOW_CLICK_SETTINGS);
1048
+ J(!0), p(Ee.CASH_FLOW_CLICK_SETTINGS);
1044
1049
  }
1045
1050
  }
1046
1051
  ],
1047
1052
  calendarActions: {
1048
- shouldDisableNext: b,
1053
+ shouldDisableNext: x,
1049
1054
  shouldDisablePrevious: m,
1050
1055
  shouldDisablePicker: !0,
1051
1056
  onRangeChanged: () => {
1052
1057
  }
1053
1058
  },
1054
- dateRange: C,
1059
+ dateRange: b,
1055
1060
  dateRangeVariant: "readonly",
1056
- onAccountsFilterClick: () => h(Ee.CASH_FLOW_CLICK_FILTER),
1061
+ onAccountsFilterClick: () => p(Ee.CASH_FLOW_CLICK_FILTER),
1057
1062
  onBackClick: a,
1058
1063
  sx: n,
1059
- title: w.title,
1064
+ title: h.title,
1060
1065
  children: [
1061
- /* @__PURE__ */ e(Nt, {}),
1066
+ /* @__PURE__ */ e(Ot, {}),
1062
1067
  /* @__PURE__ */ e(Lt, {}),
1063
1068
  /* @__PURE__ */ e(
1064
- Ge,
1069
+ je,
1065
1070
  {
1066
- ariaLabelClose: w.close_settings_aria,
1067
- isOpen: ae,
1068
- onClose: () => T(!1),
1071
+ ariaLabelClose: h.close_settings_aria,
1072
+ isOpen: K,
1073
+ onClose: () => J(!1),
1069
1074
  shouldShowHeaderBorders: !1,
1070
- title: I.action_title,
1071
- children: /* @__PURE__ */ e(et, { defaultSelectedTab: q ? 1 : 0 })
1075
+ title: w.action_title,
1076
+ children: /* @__PURE__ */ e(et, { defaultSelectedTab: re ? 1 : 0 })
1072
1077
  }
1073
1078
  )
1074
1079
  ]
1075
1080
  }
1076
1081
  );
1077
- }, $n = L(jt);
1078
- class Mn {
1082
+ }, Mn = T(jt);
1083
+ class Gn {
1079
1084
  fetchInstance;
1080
1085
  constructor(n, t, i) {
1081
1086
  this.fetchInstance = new xt(n, t, void 0, i);
1082
1087
  }
1083
- addCashflowEvent = async (n) => this.fetchInstance.post(z.CASHFLOW_EVENTS, { ...n }).then((t) => t);
1084
- addCashflowSequence = async (n) => this.fetchInstance.post(z.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
1085
- getCashflowSequences = async () => this.fetchInstance.get(z.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
1088
+ addCashflowEvent = async (n) => this.fetchInstance.post(B.CASHFLOW_EVENTS, { ...n }).then((t) => t);
1089
+ addCashflowSequence = async (n) => this.fetchInstance.post(B.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
1090
+ getCashflowSequences = async () => this.fetchInstance.get(B.CASHFLOW_SEQUENCES).then((n) => n.cashflow_sequences);
1086
1091
  getCashflowEventsByDateRange = async (n, t) => this.fetchInstance.get(
1087
- `${z.CASHFLOW_EVENTS}/from/${B(n)}/to/${B(t)}`
1092
+ `${B.CASHFLOW_EVENTS}/from/${U(n)}/to/${U(t)}`
1088
1093
  ).then((i) => i.cashflow_events);
1089
- deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${z.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
1094
+ deleteCashflowSequence = async (n) => this.fetchInstance.delete(`${B.CASHFLOW_SEQUENCES}/${n}`).then((t) => t);
1090
1095
  getProjectedCashflowEvents = async (n, t) => this.fetchInstance.get(
1091
- `${z.CASHFLOW_SEQUENCES}/projected_events/from/${B(
1096
+ `${B.CASHFLOW_SEQUENCES}/projected_events/from/${U(
1092
1097
  n
1093
- )}/to/${B(t)}`
1098
+ )}/to/${U(t)}`
1094
1099
  ).then((i) => i.cashflow_events);
1095
- updateCashflowSequence = async (n) => this.fetchInstance.put(`${z.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
1100
+ updateCashflowSequence = async (n) => this.fetchInstance.put(`${B.CASHFLOW_SEQUENCES}/${n.guid}`, n).then((t) => t.cashflow_sequence);
1096
1101
  }
1097
1102
  export {
1098
- Mn as CashflowApi,
1099
- Wn as CashflowMiniWidget,
1103
+ Gn as CashflowApi,
1104
+ $n as CashflowMiniWidget,
1100
1105
  Gt as CashflowOnboarding,
1101
- zn as CashflowStore,
1102
- $n as CashflowWidget
1106
+ Bn as CashflowStore,
1107
+ Mn as CashflowWidget
1103
1108
  };