@mx-cartographer/experiences 6.26.33-alpha.mm0 → 7.0.0-alpha.mega1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -3
- package/dist/Account-DY6nxO7y.mjs +30 -0
- package/dist/AccountDetailsContent-DvPs81kL.mjs +677 -0
- package/dist/AccountDetailsHeader-W2U7ZVm_.mjs +119 -0
- package/dist/AccountFields-DAVcbZy5.mjs +135 -0
- package/dist/AccountListItem-DFlbdcmT.mjs +90 -0
- package/dist/AccountStore-CU7qV3vg.mjs +230 -0
- package/dist/Accounts-BLlrQA5m.mjs +9 -0
- package/dist/BeatApi-DLu87ijw.mjs +21 -0
- package/dist/BeatStore-By4aGoRM.mjs +81 -0
- package/dist/BudgetUtil-Ci1TN0J5.mjs +101 -0
- package/dist/CashflowStore-D9Dpuz7X.mjs +91 -0
- package/dist/Category-5S6uwuXz.mjs +301 -0
- package/dist/CategorySelectorDrawer-rHyHHYuh.mjs +397 -0
- package/dist/CategoryStore-B5EW6I1d.mjs +183 -0
- package/dist/CategoryUtil-DRyruNgi.mjs +78 -0
- package/dist/ConnectDrawer-D9cR5phc.mjs +508 -0
- package/dist/ConnectionsDrawer-BzGqljSp.mjs +52 -0
- package/dist/CurrencyInput-D74cemI2.mjs +83 -0
- package/dist/CurrencyText-YUhH2caW.mjs +20 -0
- package/dist/DateUtil-BcuH7ErC.mjs +48 -0
- package/dist/DebtsStore-S0l9kr0r.mjs +60 -0
- package/dist/Dialog-CWW597AF.mjs +123 -0
- package/dist/Donut-1UMNcG67.mjs +57 -0
- package/dist/Drawer-kEE73B87.mjs +113 -0
- package/dist/EmptyState-Dcb-o2tl.mjs +55 -0
- package/dist/Fetch-CkFKy79O.mjs +116 -0
- package/dist/FinstrongStore-mkALvztw.mjs +101 -0
- package/dist/GoalStore-DioeeL-s.mjs +263 -0
- package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
- package/dist/Help-DhcC-C05.mjs +320 -0
- package/dist/Help-DpYRO8oA.mjs +3181 -0
- package/dist/IconBacking-B9oC6uL2.mjs +39 -0
- package/dist/InvestmentUtil-jOyOgzIB.mjs +134 -0
- package/dist/LineChart-CcyX38kK.mjs +499 -0
- package/dist/ListItemAction-BabpYivr.mjs +69 -0
- package/dist/Loader-Dp1P2gNw.mjs +14 -0
- package/dist/Localization-2MODESHW.mjs +30 -0
- package/dist/ManageIncome-ndMuhJMG.mjs +535 -0
- package/dist/MerchantStore-DVH-QOf0.mjs +37 -0
- package/dist/MicroWidgetContainer-CsvHLYKX.mjs +45 -0
- package/dist/MiniWidgetContainer-BoOp-A05.mjs +39 -0
- package/dist/NetWorthStore-PD-RUe09.mjs +150 -0
- package/dist/Notification-AMGWM1Al.mjs +78 -0
- package/dist/NotificationSettings-VhHuMAFU.mjs +667 -0
- package/dist/NotificationStore-DHtSGySy.mjs +67 -0
- package/dist/NumberFormatting-CtWHhyBX.mjs +40 -0
- package/dist/OriginalBalanceAction-D39mx6uE.mjs +115 -0
- package/dist/RecurringSettings-D_HnMYZP.mjs +57 -0
- package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +263 -0
- package/dist/RepeatingTransaction-BPWfaB3f.mjs +282 -0
- package/dist/SearchBox-B2_zLv8-.mjs +42 -0
- package/dist/SettingsStore-CE7jDVFL.mjs +265 -0
- package/dist/SingleSegmentDonut-BgbLgwHi.mjs +69 -0
- package/dist/SpendingData-BkrxzHdr.mjs +55 -0
- package/dist/StatusBar-BK_uYHAB.mjs +30 -0
- package/dist/TabContentContainer-j01JYR_7.mjs +21 -0
- package/dist/Transaction-CA0FW2Ij.mjs +312 -0
- package/dist/TransactionApi-DbbcjI2L.mjs +86 -0
- package/dist/TransactionDetails-WBHFmbxL.mjs +1283 -0
- package/dist/TransactionStore-CeLdmVnC.mjs +669 -0
- package/dist/TrendsStore-BHJUapXF.mjs +487 -0
- package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +1959 -0
- package/dist/WidgetContainer-DWCusxYI.mjs +556 -0
- package/dist/accounts/index.es.js +752 -0
- package/dist/analytics/index.es.js +171 -0
- package/dist/budgets/index.es.js +1075 -0
- package/dist/cashflow/index.es.js +1098 -0
- package/dist/categories/index.es.js +9 -0
- package/dist/common/components/WidgetContainer.d.ts +1 -1
- package/dist/common/components/charts/LineChart.d.ts +0 -1
- package/dist/common/constants/Analytics.d.ts +10 -20
- package/dist/common/context/hooks.d.ts +13 -13
- package/dist/common/index.es.js +1451 -0
- package/dist/dashboard/index.es.js +181 -0
- package/dist/debts/index.es.js +1460 -0
- package/dist/exportTransactionsToCSV-CmwsKl2D.mjs +47 -0
- package/dist/finstrong/index.es.js +1455 -0
- package/dist/goals/index.es.js +1209 -0
- package/dist/help/components/content/section/index.d.ts +15 -15
- package/dist/help/index.es.js +14 -0
- package/dist/hooks-30y_BLwc.mjs +71 -0
- package/dist/index.d.ts +0 -22
- package/dist/insights/index.d.ts +1 -0
- package/dist/insights/index.es.js +4 -0
- package/dist/investments/index.es.js +1638 -0
- package/dist/merchants/index.es.js +79 -0
- package/dist/microinsights/components/carouselheader/CarouselHeader.d.ts +0 -1
- package/dist/microinsights/components/microBeatCarousel/MicroBeatCarousel.d.ts +0 -1
- package/dist/microinsights/index.es.js +16 -0
- package/dist/networth/index.es.js +576 -0
- package/dist/notifications/index.es.js +192 -0
- package/dist/recurringtransactions/index.es.js +879 -0
- package/dist/settings/index.es.js +879 -0
- package/dist/spending/index.es.js +570 -0
- package/dist/transactions/index.es.js +587 -0
- package/dist/trends/index.es.js +1086 -0
- package/dist/useCombineEvents-DaDBSR_1.mjs +92 -0
- package/dist/useDimensions-27p2evRx.mjs +36 -0
- package/dist/useScreenSize-B6JyS_Lj.mjs +36 -0
- package/package.json +155 -3
- package/dist/index.es.js +0 -30564
- package/dist/index.es.js.map +0 -1
- package/dist/trends/constants/TrendsWidget.d.ts +0 -3
@@ -0,0 +1,282 @@
|
|
1
|
+
import { jsxs as O, Fragment as Y, jsx as d } from "react/jsx-runtime";
|
2
|
+
import B from "@mui/material/Avatar";
|
3
|
+
import M from "@mui/material/ListItem";
|
4
|
+
import P from "@mui/material/ListItemAvatar";
|
5
|
+
import L from "@mui/material/ListItemButton";
|
6
|
+
import U from "@mui/material/ListItemText";
|
7
|
+
import { Icon as w, IconWeight as G } from "@mxenabled/mxui";
|
8
|
+
import S from "@mui/material/ListItemIcon";
|
9
|
+
import C from "@mui/material/MenuItem";
|
10
|
+
import $ from "@mui/material/TextField";
|
11
|
+
import { ExpandMore as j } from "@mxenabled/mx-icons";
|
12
|
+
import { addDays as W } from "date-fns/addDays";
|
13
|
+
import { addMonths as z } from "date-fns/addMonths";
|
14
|
+
import { addQuarters as Q } from "date-fns/addQuarters";
|
15
|
+
import { addYears as K } from "date-fns/addYears";
|
16
|
+
import { formatISO as H } from "date-fns/formatISO";
|
17
|
+
import { fromUnixTime as V } from "date-fns/fromUnixTime";
|
18
|
+
import { getUnixTime as y } from "date-fns/getUnixTime";
|
19
|
+
import { isAfter as l } from "date-fns/isAfter";
|
20
|
+
import { isBefore as u } from "date-fns/isBefore";
|
21
|
+
import { isSameDay as X } from "date-fns/isSameDay";
|
22
|
+
import { nextDay as k } from "date-fns/nextDay";
|
23
|
+
import { parseISO as J } from "date-fns/parseISO";
|
24
|
+
import { setDate as E } from "date-fns/setDate";
|
25
|
+
import { startOfToday as g } from "date-fns/startOfToday";
|
26
|
+
import { subDays as p } from "date-fns/subDays";
|
27
|
+
import { subMonths as Z } from "date-fns/subMonths";
|
28
|
+
import { subQuarters as A } from "date-fns/subQuarters";
|
29
|
+
import { subYears as T } from "date-fns/subYears";
|
30
|
+
import { lastDayOfMonth as q } from "date-fns/lastDayOfMonth";
|
31
|
+
import { setDayOfYear as F } from "date-fns/setDayOfYear";
|
32
|
+
import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./DateUtil-BcuH7ErC.mjs";
|
33
|
+
import { b as I } from "./NumberFormatting-CtWHhyBX.mjs";
|
34
|
+
import { f as x, D as v } from "./Dialog-CWW597AF.mjs";
|
35
|
+
import { b as h } from "./Localization-2MODESHW.mjs";
|
36
|
+
const se = ({ iconName: e, label: o, onClick: t, value: n }) => {
|
37
|
+
const a = /* @__PURE__ */ O(Y, { children: [
|
38
|
+
/* @__PURE__ */ d(P, { children: /* @__PURE__ */ d(B, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ d(w, { name: e, sx: { color: "text.primary" }, weight: G.Dark }) }) }),
|
39
|
+
/* @__PURE__ */ d(
|
40
|
+
U,
|
41
|
+
{
|
42
|
+
primary: o,
|
43
|
+
primaryTypographyProps: { variant: "XSmall" },
|
44
|
+
secondary: n,
|
45
|
+
secondaryTypographyProps: { color: "text.default", variant: "Body", fontWeight: 600 }
|
46
|
+
}
|
47
|
+
)
|
48
|
+
] });
|
49
|
+
return t ? /* @__PURE__ */ d(M, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ O(L, { onClick: t, children: [
|
50
|
+
a,
|
51
|
+
/* @__PURE__ */ d(S, { children: /* @__PURE__ */ d(w, { name: "chevron_right", size: 24 }) })
|
52
|
+
] }) }) : /* @__PURE__ */ d(M, { disableGutters: !1, disablePadding: !1, children: a });
|
53
|
+
}, Fe = se, Re = ({ label: e, onChange: o, options: t, value: n }) => /* @__PURE__ */ d(
|
54
|
+
$,
|
55
|
+
{
|
56
|
+
InputLabelProps: { shrink: !0 },
|
57
|
+
SelectProps: {
|
58
|
+
IconComponent: (r) => /* @__PURE__ */ d(j, { size: 20, sx: { mr: 4 }, ...r })
|
59
|
+
},
|
60
|
+
defaultValue: 0,
|
61
|
+
label: e,
|
62
|
+
onChange: (r) => {
|
63
|
+
o(Number(r.target.value));
|
64
|
+
},
|
65
|
+
select: !0,
|
66
|
+
value: n,
|
67
|
+
variant: "outlined",
|
68
|
+
children: t.map((r) => /* @__PURE__ */ d(C, { value: r.id, children: r.label }, r.id))
|
69
|
+
}
|
70
|
+
), ce = (e) => {
|
71
|
+
if (!e) return "";
|
72
|
+
let o = e.user_name || e.feed_name || "";
|
73
|
+
return e.account_number && (o = `${o} *${e.account_number}`), o;
|
74
|
+
}, ie = (e, o) => {
|
75
|
+
const t = [], n = e.transactions.find(
|
76
|
+
(m) => m.repeating_transaction_guid === e.guid
|
77
|
+
);
|
78
|
+
if (!n) return [];
|
79
|
+
const a = J(e.predicted_occurs_on), r = {
|
80
|
+
accountGuid: e.account?.guid || "",
|
81
|
+
amount: e.amount,
|
82
|
+
categoryGuid: n.category_guid || "",
|
83
|
+
expectedDate: a,
|
84
|
+
frequency: e.recurrence_type,
|
85
|
+
institutionGuid: e.account?.institution_guid || "",
|
86
|
+
institutionName: ce(e.account),
|
87
|
+
merchantGuid: e.merchant_guid,
|
88
|
+
name: e.description,
|
89
|
+
recurrenceDay: e.recurrence_day,
|
90
|
+
repeatingTransactionGuid: e.guid,
|
91
|
+
secondRecurrenceDay: e.second_recurrence_day,
|
92
|
+
status: f.Upcoming,
|
93
|
+
type: e.repeating_transaction_type === N.Income ? b.Income : b.Expense,
|
94
|
+
transaction: void 0
|
95
|
+
}, i = o.start, c = o.end;
|
96
|
+
switch (e.recurrence_type) {
|
97
|
+
case s.EveryWeek:
|
98
|
+
t.push(...ue(r, i, c));
|
99
|
+
break;
|
100
|
+
case s.EveryOtherWeek:
|
101
|
+
t.push(...de(r, i, c));
|
102
|
+
break;
|
103
|
+
case s.TwiceAMonth:
|
104
|
+
t.push(...me(r, i));
|
105
|
+
break;
|
106
|
+
case s.EveryMonth:
|
107
|
+
t.push(...he(r, i));
|
108
|
+
break;
|
109
|
+
case s.EveryOtherMonth:
|
110
|
+
t.push(...le(r, i, c));
|
111
|
+
break;
|
112
|
+
case s.EveryQuarter:
|
113
|
+
t.push(...fe(r, i, c));
|
114
|
+
break;
|
115
|
+
case s.EveryOtherQuarter:
|
116
|
+
t.push(...ye(r, i, c));
|
117
|
+
break;
|
118
|
+
case s.EveryYear:
|
119
|
+
t.push(...pe(r, i, c));
|
120
|
+
break;
|
121
|
+
}
|
122
|
+
for (const m of t) {
|
123
|
+
const D = e.transactions.find(
|
124
|
+
(_) => _.repeating_transaction_guid === e.guid && _.date > y(p(m.expectedDate, 5)) && _.date < y(W(m.expectedDate, 5))
|
125
|
+
);
|
126
|
+
D ? (m.transaction = D, m.status = f.Paid, m.occurredOnDate = V(D.date)) : u(m.expectedDate, p(g(), 3)) && (m.status = f.Missed);
|
127
|
+
}
|
128
|
+
return t;
|
129
|
+
}, ue = (e, o, t) => {
|
130
|
+
const n = [];
|
131
|
+
let a = k(o, e.recurrenceDay);
|
132
|
+
for (; u(a, t); )
|
133
|
+
n.push({ ...e, expectedDate: a }), a = k(a, e.recurrenceDay);
|
134
|
+
return n;
|
135
|
+
}, de = (e, o, t) => {
|
136
|
+
const n = [], a = e.expectedDate;
|
137
|
+
if (u(a, t)) {
|
138
|
+
let r = p(a, 14);
|
139
|
+
for (; l(r, o) || X(r, o); )
|
140
|
+
n.push({ ...e, expectedDate: r }), r = p(r, 14);
|
141
|
+
for (r = a; l(r, o) && u(r, t); )
|
142
|
+
n.push({ ...e, expectedDate: r }), r = W(r, 14);
|
143
|
+
}
|
144
|
+
return n;
|
145
|
+
}, me = (e, o) => {
|
146
|
+
const t = [], n = E(o, e.recurrenceDay), a = e.secondRecurrenceDay && e.secondRecurrenceDay < 28 ? E(o, e.secondRecurrenceDay) : q(o);
|
147
|
+
return t.push({ ...e, expectedDate: n }), t.push({ ...e, expectedDate: a }), t;
|
148
|
+
}, he = (e, o) => {
|
149
|
+
const t = [], n = E(o, e.recurrenceDay);
|
150
|
+
return t.push({ ...e, expectedDate: n }), t;
|
151
|
+
}, le = (e, o, t) => {
|
152
|
+
const n = [], a = e.expectedDate;
|
153
|
+
let r = u(a, t) ? a : Z(a, 2);
|
154
|
+
for (; u(r, t); )
|
155
|
+
l(r, o) && n.push({ ...e, expectedDate: r }), r = z(r, 2);
|
156
|
+
return n;
|
157
|
+
}, fe = (e, o, t) => {
|
158
|
+
const n = [], a = e.expectedDate;
|
159
|
+
let r = u(a, t) ? a : A(a, 1);
|
160
|
+
for (; u(r, t); )
|
161
|
+
l(r, o) && n.push({ ...e, expectedDate: r }), r = Q(r, 1);
|
162
|
+
return n;
|
163
|
+
}, ye = (e, o, t) => {
|
164
|
+
const n = [], a = e.expectedDate;
|
165
|
+
let r = u(a, t) ? a : A(a, 2);
|
166
|
+
for (; u(r, t); )
|
167
|
+
l(r, o) && n.push({ ...e, expectedDate: r }), r = Q(r, 2);
|
168
|
+
return n;
|
169
|
+
}, pe = (e, o, t) => {
|
170
|
+
const n = [], a = e.expectedDate;
|
171
|
+
let r = u(a, t) ? a : T(a, 1);
|
172
|
+
for (; u(r, t); )
|
173
|
+
l(r, o) && n.push({ ...e, expectedDate: r }), r = K(r, 1);
|
174
|
+
return n;
|
175
|
+
}, et = (e, o) => {
|
176
|
+
const t = [];
|
177
|
+
for (const n of e) {
|
178
|
+
const a = ie(n, o);
|
179
|
+
t.push(...a);
|
180
|
+
}
|
181
|
+
return t.sort(
|
182
|
+
(n, a) => y(n.occurredOnDate || n.expectedDate) - y(a.occurredOnDate || a.expectedDate)
|
183
|
+
);
|
184
|
+
}, tt = (e, o, t) => {
|
185
|
+
const n = [];
|
186
|
+
for (const a of o) {
|
187
|
+
const r = t.filter(
|
188
|
+
(i) => i.repeating_transaction_guid === a.guid
|
189
|
+
);
|
190
|
+
t.length > 0 && n.push({
|
191
|
+
...a,
|
192
|
+
account: e.find((i) => i.guid === a.account_guid),
|
193
|
+
transactions: r
|
194
|
+
});
|
195
|
+
}
|
196
|
+
return n;
|
197
|
+
}, rt = (e) => e.reduce((o, t) => {
|
198
|
+
const n = H(t.expectedDate, { representation: "date" }), a = o.find(
|
199
|
+
(r) => r.date.toString() === t.expectedDate.toString()
|
200
|
+
);
|
201
|
+
return a ? a.recurrences.push(t) : o.push({
|
202
|
+
date: t.expectedDate,
|
203
|
+
id: `date-${n}`,
|
204
|
+
recurrences: [t]
|
205
|
+
}), o;
|
206
|
+
}, []), ot = (e, o, t) => {
|
207
|
+
const n = k(g(), o.recurrence_day), a = F(g(), o.recurrence_day), r = I(o.recurrence_day), i = o.second_recurrence_day ? I(o.second_recurrence_day) : "";
|
208
|
+
let c = t ? h(e.monthly_ordinal, r) : e.monthly;
|
209
|
+
switch (o.recurrence_type) {
|
210
|
+
case s.EveryQuarter:
|
211
|
+
c = t ? h(e.quarterly_ordinal, r) : e.quarterly;
|
212
|
+
break;
|
213
|
+
case s.EveryWeek:
|
214
|
+
c = t ? h(
|
215
|
+
e.weekly_ordinal,
|
216
|
+
x(n, v.DAY_OF_WEEK)
|
217
|
+
) : e.weekly;
|
218
|
+
break;
|
219
|
+
case s.EveryYear:
|
220
|
+
c = t ? h(
|
221
|
+
e.anually_ordinal,
|
222
|
+
x(a, v.MONTH_DAY)
|
223
|
+
) : e.anually;
|
224
|
+
break;
|
225
|
+
case s.EveryOtherWeek:
|
226
|
+
c = t ? h(
|
227
|
+
e.every_other_week_ordinal,
|
228
|
+
x(n, v.DAY_OF_WEEK)
|
229
|
+
) : e.every_other_week;
|
230
|
+
break;
|
231
|
+
case s.EveryOtherMonth:
|
232
|
+
c = t ? h(e.every_other_month_ordinal, r) : e.every_other_month;
|
233
|
+
break;
|
234
|
+
case s.EveryOtherQuarter:
|
235
|
+
c = t ? h(e.every_other_quarter_ordinal, r) : e.every_other_quarter;
|
236
|
+
break;
|
237
|
+
case s.TwiceAMonth:
|
238
|
+
c = t ? h(e.twice_a_month_ordinal, r, i) : e.twice_a_month;
|
239
|
+
break;
|
240
|
+
}
|
241
|
+
return c;
|
242
|
+
}, at = (e, o) => {
|
243
|
+
let t = o;
|
244
|
+
switch (e) {
|
245
|
+
case s.EveryWeek:
|
246
|
+
t = ne(o);
|
247
|
+
break;
|
248
|
+
case s.EveryOtherWeek:
|
249
|
+
t = ae(o);
|
250
|
+
break;
|
251
|
+
case s.EveryMonth:
|
252
|
+
t = oe(o);
|
253
|
+
break;
|
254
|
+
case s.EveryOtherMonth:
|
255
|
+
t = re(o);
|
256
|
+
break;
|
257
|
+
case s.EveryQuarter:
|
258
|
+
t = te(o);
|
259
|
+
break;
|
260
|
+
case s.EveryOtherQuarter:
|
261
|
+
t = ee(o);
|
262
|
+
break;
|
263
|
+
case s.EveryYear:
|
264
|
+
t = R(o);
|
265
|
+
break;
|
266
|
+
}
|
267
|
+
return t;
|
268
|
+
};
|
269
|
+
var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), f = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(f || {}), b = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(b || {}), N = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(N || {});
|
270
|
+
export {
|
271
|
+
Fe as D,
|
272
|
+
s as F,
|
273
|
+
N as R,
|
274
|
+
Re as S,
|
275
|
+
f as a,
|
276
|
+
et as b,
|
277
|
+
b as c,
|
278
|
+
tt as d,
|
279
|
+
at as e,
|
280
|
+
rt as f,
|
281
|
+
ot as g
|
282
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
2
|
+
import { observer as p } from "mobx-react-lite";
|
3
|
+
import d from "@mui/material/Box";
|
4
|
+
import h from "@mui/material/IconButton";
|
5
|
+
import a from "@mui/material/InputAdornment";
|
6
|
+
import { useTokens as x, TextField as u, Icon as c } from "@mxenabled/mxui";
|
7
|
+
const b = ({
|
8
|
+
ariaLabel: t = "Search",
|
9
|
+
cancelAriaLabel: s = "Cancel Search",
|
10
|
+
onChange: e,
|
11
|
+
placeholder: i = "Search",
|
12
|
+
searchValue: o
|
13
|
+
}) => {
|
14
|
+
const n = x(), m = /* @__PURE__ */ r(
|
15
|
+
h,
|
16
|
+
{
|
17
|
+
"aria-label": s,
|
18
|
+
className: "mx-cat-cancel-search-button",
|
19
|
+
color: "primary",
|
20
|
+
onClick: () => e(""),
|
21
|
+
children: /* @__PURE__ */ r(c, { name: "cancel", size: 24 })
|
22
|
+
}
|
23
|
+
);
|
24
|
+
return /* @__PURE__ */ r(d, { className: "mx-cmn-search-box", px: n.Spacing.Large, py: n.Spacing.Medium, children: /* @__PURE__ */ r(
|
25
|
+
u,
|
26
|
+
{
|
27
|
+
InputProps: {
|
28
|
+
startAdornment: /* @__PURE__ */ r(a, { position: "start", children: /* @__PURE__ */ r(c, { color: "disabled", name: "search", size: 26 }) }),
|
29
|
+
endAdornment: /* @__PURE__ */ r(a, { position: "end", sx: { p: 0 }, children: o ? m : null })
|
30
|
+
},
|
31
|
+
"aria-label": t,
|
32
|
+
name: "search",
|
33
|
+
onChange: (l) => e(l.target.value),
|
34
|
+
placeholder: i,
|
35
|
+
sx: { bgcolor: "background.paper", width: "100%" },
|
36
|
+
value: o
|
37
|
+
}
|
38
|
+
) });
|
39
|
+
}, v = p(b);
|
40
|
+
export {
|
41
|
+
v as S
|
42
|
+
};
|
@@ -0,0 +1,265 @@
|
|
1
|
+
import { makeAutoObservable as N, runInAction as l } from "mobx";
|
2
|
+
import { F as D, A as o } from "./Fetch-CkFKy79O.mjs";
|
3
|
+
import { B as f, A as n, I as i } from "./Notification-AMGWM1Al.mjs";
|
4
|
+
import { T as m } from "./TransactionApi-DbbcjI2L.mjs";
|
5
|
+
class y {
|
6
|
+
fetchInstance;
|
7
|
+
constructor(e, t) {
|
8
|
+
this.fetchInstance = new D(e, t);
|
9
|
+
}
|
10
|
+
deleteDevice = async (e) => this.fetchInstance.delete(`${o.DEVICES}/${e}`).then((t) => t);
|
11
|
+
generateDeviceToken = async () => this.fetchInstance.get(`${o.USER}/mobile_token`).then((e) => e.mobile_token);
|
12
|
+
getDevices = async () => this.fetchInstance.get(o.DEVICES).then((e) => e.map((t) => t.device));
|
13
|
+
getNotificationProfiles = async () => this.fetchInstance.get(o.NOTIFICATION_PROFILES).then((e) => e.notification_profiles);
|
14
|
+
// verifications endpoints respond with HTTP status codes; they error otherwise
|
15
|
+
sendEmailVerification = async () => this.fetchInstance.post(o.EMAIL_VERIFICATIONS);
|
16
|
+
sendPhoneVerification = async () => this.fetchInstance.post(o.PHONE_VERIFICATIONS + "/deliver");
|
17
|
+
verifyPhoneToken = async (e) => this.fetchInstance.post(o.PHONE_VERIFICATIONS + "/verify", { sms_verification_token: e }).then((t) => ({ verified: t.verified }));
|
18
|
+
updateDevice = async (e) => this.fetchInstance.put(`${o.DEVICES}/${e.guid}`, e).then((t) => t.device);
|
19
|
+
updateNotificationProfile = async (e) => this.fetchInstance.put(`${o.NOTIFICATION_PROFILES}/${e.guid}`, e).then((t) => t.notification_profile);
|
20
|
+
updateUserCommunicationProfile = async (e) => this.fetchInstance.put(o.USER_COMMUNICATION_PROFILE, e).then((t) => t.user_communication_profile);
|
21
|
+
getInsightsNotificationProfiles = async () => this.fetchInstance.get(`${o.NOTIFICATION_PROFILES}/${o.INSIGHTS_NOTIFICATION_PROFILES}`).then((e) => e);
|
22
|
+
}
|
23
|
+
const v = "PARENT-ENTITY", C = (s, e) => ({
|
24
|
+
[f.BudgetExceeded]: e.notification_budget_exceeded,
|
25
|
+
[f.BudgetOffTarget]: e.notification_budget_off_target,
|
26
|
+
[n.DebtPaymentReminder]: e.notification_debt_payment_reminder,
|
27
|
+
[n.AccountBalanceLow]: e.notification_low_balance,
|
28
|
+
[n.AccountDepositLargePosted]: e.notification_large_deposit,
|
29
|
+
[n.AccountDepositLarge]: e.notification_large_deposit,
|
30
|
+
[n.TransactionExpenseLarge]: e.notification_large_expense,
|
31
|
+
[n.TransactionFeeCharge]: e.notification_transaction_fee,
|
32
|
+
[n.InternationalTransaction]: e.notification_transaction_is_international,
|
33
|
+
[i.AccountBalanceLow]: e.account_balance_low,
|
34
|
+
[i.BillAmountNotStandard]: e.bill_amount_not_standard,
|
35
|
+
[i.CategorySpending]: e.category_spending,
|
36
|
+
[i.CreditCardCloseToLimit]: e.credit_card_close_to_limit,
|
37
|
+
[i.DebtPaymentReminder]: e.debt_payment_reminder,
|
38
|
+
[i.DuplicatePayment]: e.duplicate_payment,
|
39
|
+
[i.MonthlySpendComparison]: e.monthly_spend_comparison,
|
40
|
+
[i.MonthlySpendToIncomeComparison]: e.monthly_spend_to_income_comparison,
|
41
|
+
[i.MonthlySubscriptionAggregate]: e.monthly_subscription_aggregate,
|
42
|
+
[i.MonthlyTopMerchantSpending]: e.monthly_top_merchant_spending,
|
43
|
+
[i.SaveAnExtra100Dollars]: e.save_an_extra_100_dollars,
|
44
|
+
[i.SavingsOpportunity]: e.savings_opportunity,
|
45
|
+
[i.SetUpDirectDeposit]: e.set_up_direct_deposit,
|
46
|
+
[i.SwitchDirectDeposit]: e.switch_direct_deposit,
|
47
|
+
[i.UncategorizedTransactions]: e.uncategorized_transactions,
|
48
|
+
[i.UnifiedDeposit]: e.unified_deposit,
|
49
|
+
[i.UpcomingBill]: e.upcoming_bill,
|
50
|
+
[i.WeekendSpendingSummary]: e.weekend_spending_summary,
|
51
|
+
[i.WeeklyNewMerchants]: e.weekly_new_merchants,
|
52
|
+
[i.DiscoveredAccounts]: e.discovered_account,
|
53
|
+
[i.TransactionExpenseLarge]: e.large_transaction,
|
54
|
+
[i.PromotionalCampaignMessages]: e.promotional_campaign_messages,
|
55
|
+
[i.TransparentOverdraft]: e.transparent_overdraft
|
56
|
+
})[s] || "", R = (s, e, t, r, d, p) => {
|
57
|
+
const g = [], {
|
58
|
+
email_notifications_enabled: I,
|
59
|
+
sms_notifications_enabled: P,
|
60
|
+
push_notifications_enabled: T
|
61
|
+
} = e, {
|
62
|
+
opted_out_of_email_notifications: b,
|
63
|
+
opted_out_of_sms_notifications: E,
|
64
|
+
opted_out_of_push_notifications: S
|
65
|
+
} = d;
|
66
|
+
for (const a of r.filter((u) => u.entity_guid === v)) {
|
67
|
+
const u = C(a.notification_type, t), A = r.filter(
|
68
|
+
(c) => c.entity_guid !== v && c.notification_type === a.notification_type && s.some((h) => h.guid === c.entity_guid)
|
69
|
+
), _ = [];
|
70
|
+
I && !b && a.email_channel && p.email && _.push(t.delivery_method_email_label), P && !E && a.sms_channel && p.phone && _.push(t.delivery_method_sms_label), T && !S && a.push_channel && _.push(t.delivery_method_push_label), g.push({
|
71
|
+
...a,
|
72
|
+
children: A.map((c) => ({
|
73
|
+
...c,
|
74
|
+
account: s.find((h) => h.guid === c.entity_guid),
|
75
|
+
label: u
|
76
|
+
})),
|
77
|
+
deliveryMethodsLabel: _.join(", "),
|
78
|
+
label: u
|
79
|
+
});
|
80
|
+
}
|
81
|
+
return g;
|
82
|
+
};
|
83
|
+
class x {
|
84
|
+
globalStore;
|
85
|
+
api = new y("/", "");
|
86
|
+
transactionApi = new m("/", "");
|
87
|
+
alert = { message: "", severity: void 0 };
|
88
|
+
devices = [];
|
89
|
+
notificationProfiles = [];
|
90
|
+
selectedRule = void 0;
|
91
|
+
transactionRules = [];
|
92
|
+
constructor(e) {
|
93
|
+
this.globalStore = e, this.api = new y(e.endpoint, e.sessionToken), this.transactionApi = new m(e.endpoint, e.sessionToken), N(this);
|
94
|
+
}
|
95
|
+
get accountProfiles() {
|
96
|
+
const e = this.globalStore.appDataStore.clientCommunicationProfile;
|
97
|
+
return this.detailedNotificationProfiles.filter(
|
98
|
+
(t) => t.notification_type === n.DebtPaymentReminder && e.debt_payment_reminder_notifications_enabled || t.notification_type === n.AccountBalanceLow && e.low_balance_notifications_enabled || t.notification_type === n.AccountDepositLarge && e.large_deposit_notifications_enabled || t.notification_type === n.TransactionExpenseLarge && e.large_expense_notifications_enabled || t.notification_type === n.TransactionFeeCharge && e.transaction_fee_notifications_enabled || t.notification_type === n.InternationalTransaction && e.transaction_is_international_notifications_enabled || t.notification_type === n.AccountDepositLargePosted && e.large_deposit_notifications_enabled
|
99
|
+
);
|
100
|
+
}
|
101
|
+
get budgetProfiles() {
|
102
|
+
const e = this.globalStore.appDataStore.clientCommunicationProfile;
|
103
|
+
return this.detailedNotificationProfiles.filter(
|
104
|
+
(t) => t.notification_type === f.BudgetExceeded && e.budget_exceeded_notifications_enabled || t.notification_type === f.BudgetOffTarget && e.budget_off_target_notifications_enabled
|
105
|
+
);
|
106
|
+
}
|
107
|
+
get insightsProfiles() {
|
108
|
+
return this.detailedNotificationProfiles.filter(
|
109
|
+
(e) => Object.values(i).includes(e.notification_type)
|
110
|
+
);
|
111
|
+
}
|
112
|
+
get clientCommunicationProfile() {
|
113
|
+
return this.globalStore.appDataStore.clientCommunicationProfile;
|
114
|
+
}
|
115
|
+
get copy() {
|
116
|
+
return this.globalStore.copyStore.copy.settings;
|
117
|
+
}
|
118
|
+
get detailedNotificationProfiles() {
|
119
|
+
return this.globalStore.isInitialized ? R(
|
120
|
+
this.globalStore.accountStore.accounts,
|
121
|
+
this.clientCommunicationProfile,
|
122
|
+
this.copy,
|
123
|
+
this.notificationProfiles,
|
124
|
+
this.userCommunicationsProfile,
|
125
|
+
this.globalStore.userStore.user
|
126
|
+
) : [];
|
127
|
+
}
|
128
|
+
get userCommunicationsProfile() {
|
129
|
+
return this.globalStore.appDataStore.userCommunicationProfile;
|
130
|
+
}
|
131
|
+
deleteDevice = async (e) => {
|
132
|
+
try {
|
133
|
+
await this.api.deleteDevice(e);
|
134
|
+
const t = this.devices.findIndex((r) => r.guid === e);
|
135
|
+
return t >= 0 && l(() => {
|
136
|
+
this.devices.splice(t, 1);
|
137
|
+
}), { success: !0 };
|
138
|
+
} catch {
|
139
|
+
return console.error(`Error deleting device: ${e}`), { success: !1 };
|
140
|
+
}
|
141
|
+
};
|
142
|
+
deleteTransactionRule = async () => {
|
143
|
+
this.selectedRule && this.transactionApi.removeTransactionRule(this.selectedRule?.guid).then(() => {
|
144
|
+
this.setAlert(this.copy.delete_rule_success, "success"), this.loadTransactionRules();
|
145
|
+
}).catch(() => {
|
146
|
+
this.setAlert(this.copy.delete_rule_error, "error");
|
147
|
+
});
|
148
|
+
};
|
149
|
+
generateDeviceToken = async () => {
|
150
|
+
try {
|
151
|
+
return await this.api.generateDeviceToken();
|
152
|
+
} catch (e) {
|
153
|
+
console.error(`Error generating device token: ${e}`);
|
154
|
+
}
|
155
|
+
};
|
156
|
+
loadDevices = async () => {
|
157
|
+
try {
|
158
|
+
const e = await this.api.getDevices();
|
159
|
+
l(() => {
|
160
|
+
this.devices = e;
|
161
|
+
});
|
162
|
+
} catch (e) {
|
163
|
+
console.error(`Error loading devices: ${e}`);
|
164
|
+
}
|
165
|
+
};
|
166
|
+
loadNotificationProfiles = async () => {
|
167
|
+
try {
|
168
|
+
const e = await this.api.getNotificationProfiles();
|
169
|
+
l(() => {
|
170
|
+
this.notificationProfiles = e;
|
171
|
+
});
|
172
|
+
} catch (e) {
|
173
|
+
console.error(`Error loading notification profiles: ${e}`);
|
174
|
+
}
|
175
|
+
};
|
176
|
+
loadTransactionRules = async () => {
|
177
|
+
try {
|
178
|
+
const e = await this.transactionApi.getTransactionRules();
|
179
|
+
l(() => {
|
180
|
+
this.transactionRules = e;
|
181
|
+
});
|
182
|
+
} catch (e) {
|
183
|
+
console.error(`Error loading transaction rules: ${e}`);
|
184
|
+
}
|
185
|
+
};
|
186
|
+
sendEmailVerification = async () => {
|
187
|
+
try {
|
188
|
+
await this.api.sendEmailVerification(), this.setAlert(this.copy.verification_sent_success, "success");
|
189
|
+
} catch (e) {
|
190
|
+
console.error(`Error sending email verification: ${e}`), this.setAlert(this.copy.verification_sent_error, "error");
|
191
|
+
}
|
192
|
+
};
|
193
|
+
sendPhoneVerification = async () => {
|
194
|
+
try {
|
195
|
+
await this.api.sendPhoneVerification(), this.setAlert(this.copy.verification_sent_success, "success");
|
196
|
+
} catch (e) {
|
197
|
+
console.error(`Error sending phone verification: ${e}`), this.setAlert(this.copy.verification_sent_error, "error");
|
198
|
+
}
|
199
|
+
};
|
200
|
+
setAlert = (e, t = void 0) => this.alert = { message: e, severity: t };
|
201
|
+
setSelectedRule = (e) => {
|
202
|
+
this.selectedRule = e;
|
203
|
+
};
|
204
|
+
updateDevice = async (e) => {
|
205
|
+
try {
|
206
|
+
const t = await this.api.updateDevice(e), r = this.devices.findIndex((d) => d.guid === e.guid);
|
207
|
+
return r >= 0 && l(() => {
|
208
|
+
this.devices[r] = t;
|
209
|
+
}), { success: !0 };
|
210
|
+
} catch (t) {
|
211
|
+
return console.error(`Error updating device: ${t}`), { success: !1 };
|
212
|
+
}
|
213
|
+
};
|
214
|
+
updateNotificationProfile = async (e) => {
|
215
|
+
try {
|
216
|
+
const t = await this.api.updateNotificationProfile(e), r = this.notificationProfiles.findIndex((d) => d.guid === e.guid);
|
217
|
+
r >= 0 && l(() => {
|
218
|
+
this.notificationProfiles[r] = t;
|
219
|
+
});
|
220
|
+
} catch (t) {
|
221
|
+
console.error(`Error updating notification profile: ${t}`);
|
222
|
+
}
|
223
|
+
};
|
224
|
+
updateRuleCategory = async (e) => {
|
225
|
+
this.transactionApi.updateTransactionRule(e).then(() => {
|
226
|
+
this.loadTransactionRules();
|
227
|
+
});
|
228
|
+
};
|
229
|
+
updateRulePayee = async (e) => {
|
230
|
+
this.transactionApi.updateTransactionRule(e).then(() => {
|
231
|
+
this.setAlert(this.copy.edit_payee_success, "success"), this.loadTransactionRules();
|
232
|
+
}).catch(() => {
|
233
|
+
this.setAlert(this.copy.edit_payee_error, "error");
|
234
|
+
});
|
235
|
+
};
|
236
|
+
updateUser = async (e) => {
|
237
|
+
this.globalStore.userStore.updateUser(e).then(() => {
|
238
|
+
this.setAlert(this.copy.information_updated_success, "success");
|
239
|
+
}).catch(() => {
|
240
|
+
this.setAlert(this.copy.information_updated_error, "error");
|
241
|
+
});
|
242
|
+
};
|
243
|
+
updateUserCommunicationProfile = async (e) => {
|
244
|
+
try {
|
245
|
+
const t = await this.api.updateUserCommunicationProfile(e);
|
246
|
+
this.globalStore.appDataStore.setUserCommunicationProfile(t);
|
247
|
+
} catch (t) {
|
248
|
+
console.error(`Error occurred while updating user communication profile: ${t}`);
|
249
|
+
}
|
250
|
+
};
|
251
|
+
verifyPhoneToken = async (e) => {
|
252
|
+
try {
|
253
|
+
const { verified: t } = await this.api.verifyPhoneToken(e);
|
254
|
+
if (!t)
|
255
|
+
throw new Error();
|
256
|
+
this.setAlert(this.copy.verified_phone_success, "success");
|
257
|
+
} catch (t) {
|
258
|
+
console.error(`Error verifying phone token: ${t}`), this.setAlert(this.copy.verified_phone_error, "error");
|
259
|
+
}
|
260
|
+
};
|
261
|
+
}
|
262
|
+
export {
|
263
|
+
y as S,
|
264
|
+
x as a
|
265
|
+
};
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
2
|
+
import l from "@mui/material/Box";
|
3
|
+
import D from "@mui/material/styles/useTheme";
|
4
|
+
const p = 48, u = 4, S = ({
|
5
|
+
color: m = "",
|
6
|
+
percent: r = 0,
|
7
|
+
size: t = p,
|
8
|
+
strokeWidth: s = u,
|
9
|
+
children: i,
|
10
|
+
backgroundStrokeColor: c
|
11
|
+
}) => {
|
12
|
+
const h = D(), n = (t - s) / 2, f = -90, g = r > 100 ? 100 : r, x = 2 * Math.PI * n * (1 - g / 100), e = t / 2;
|
13
|
+
return /* @__PURE__ */ a(
|
14
|
+
l,
|
15
|
+
{
|
16
|
+
className: "mx-cmn-single-segment-donut",
|
17
|
+
height: t,
|
18
|
+
mt: -8,
|
19
|
+
position: "relative",
|
20
|
+
width: t,
|
21
|
+
children: [
|
22
|
+
/* @__PURE__ */ a("svg", { height: t, width: t, children: [
|
23
|
+
/* @__PURE__ */ o(
|
24
|
+
"circle",
|
25
|
+
{
|
26
|
+
cx: e,
|
27
|
+
cy: e,
|
28
|
+
fill: "none",
|
29
|
+
r: n,
|
30
|
+
stroke: c || h.palette.grey[300],
|
31
|
+
strokeWidth: s
|
32
|
+
}
|
33
|
+
),
|
34
|
+
/* @__PURE__ */ o(
|
35
|
+
"circle",
|
36
|
+
{
|
37
|
+
cx: e,
|
38
|
+
cy: e,
|
39
|
+
fill: "none",
|
40
|
+
r: n,
|
41
|
+
stroke: m,
|
42
|
+
strokeDasharray: 2 * Math.PI * n,
|
43
|
+
strokeDashoffset: x,
|
44
|
+
strokeWidth: s,
|
45
|
+
transform: `rotate(${f}, ${e}, ${e})`
|
46
|
+
}
|
47
|
+
)
|
48
|
+
] }),
|
49
|
+
/* @__PURE__ */ o(
|
50
|
+
l,
|
51
|
+
{
|
52
|
+
className: "mx-cmn-single-segment-donut-children",
|
53
|
+
left: "50%",
|
54
|
+
position: "absolute",
|
55
|
+
sx: { transform: "translate(-50%, -50%)" },
|
56
|
+
textAlign: "center",
|
57
|
+
top: "50%",
|
58
|
+
children: i
|
59
|
+
}
|
60
|
+
)
|
61
|
+
]
|
62
|
+
}
|
63
|
+
);
|
64
|
+
}, E = S;
|
65
|
+
export {
|
66
|
+
p as D,
|
67
|
+
E as S,
|
68
|
+
u as a
|
69
|
+
};
|