@mx-cartographer/experiences 6.26.32 → 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.
Files changed (98) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/Account-DY6nxO7y.mjs +30 -0
  3. package/dist/AccountDetailsContent-DvPs81kL.mjs +677 -0
  4. package/dist/AccountDetailsHeader-W2U7ZVm_.mjs +119 -0
  5. package/dist/AccountFields-DAVcbZy5.mjs +135 -0
  6. package/dist/AccountListItem-DFlbdcmT.mjs +90 -0
  7. package/dist/AccountStore-CU7qV3vg.mjs +230 -0
  8. package/dist/Accounts-BLlrQA5m.mjs +9 -0
  9. package/dist/BeatApi-DLu87ijw.mjs +21 -0
  10. package/dist/BeatStore-By4aGoRM.mjs +81 -0
  11. package/dist/BudgetUtil-Ci1TN0J5.mjs +101 -0
  12. package/dist/CashflowStore-D9Dpuz7X.mjs +91 -0
  13. package/dist/Category-5S6uwuXz.mjs +301 -0
  14. package/dist/CategorySelectorDrawer-rHyHHYuh.mjs +397 -0
  15. package/dist/CategoryStore-B5EW6I1d.mjs +183 -0
  16. package/dist/CategoryUtil-DRyruNgi.mjs +78 -0
  17. package/dist/ConnectDrawer-D9cR5phc.mjs +508 -0
  18. package/dist/ConnectionsDrawer-BzGqljSp.mjs +52 -0
  19. package/dist/CurrencyInput-D74cemI2.mjs +83 -0
  20. package/dist/CurrencyText-YUhH2caW.mjs +20 -0
  21. package/dist/DateUtil-BcuH7ErC.mjs +48 -0
  22. package/dist/DebtsStore-S0l9kr0r.mjs +60 -0
  23. package/dist/Dialog-CWW597AF.mjs +123 -0
  24. package/dist/Donut-1UMNcG67.mjs +57 -0
  25. package/dist/Drawer-kEE73B87.mjs +113 -0
  26. package/dist/EmptyState-Dcb-o2tl.mjs +55 -0
  27. package/dist/Fetch-CkFKy79O.mjs +116 -0
  28. package/dist/FinstrongStore-mkALvztw.mjs +101 -0
  29. package/dist/GoalStore-DioeeL-s.mjs +263 -0
  30. package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
  31. package/dist/Help-DhcC-C05.mjs +320 -0
  32. package/dist/Help-DpYRO8oA.mjs +3181 -0
  33. package/dist/IconBacking-B9oC6uL2.mjs +39 -0
  34. package/dist/InvestmentUtil-jOyOgzIB.mjs +134 -0
  35. package/dist/LineChart-CcyX38kK.mjs +499 -0
  36. package/dist/ListItemAction-BabpYivr.mjs +69 -0
  37. package/dist/Loader-Dp1P2gNw.mjs +14 -0
  38. package/dist/Localization-2MODESHW.mjs +30 -0
  39. package/dist/ManageIncome-ndMuhJMG.mjs +535 -0
  40. package/dist/MerchantStore-DVH-QOf0.mjs +37 -0
  41. package/dist/MicroWidgetContainer-CsvHLYKX.mjs +45 -0
  42. package/dist/MiniWidgetContainer-BoOp-A05.mjs +39 -0
  43. package/dist/NetWorthStore-PD-RUe09.mjs +150 -0
  44. package/dist/Notification-AMGWM1Al.mjs +78 -0
  45. package/dist/NotificationSettings-VhHuMAFU.mjs +667 -0
  46. package/dist/NotificationStore-DHtSGySy.mjs +67 -0
  47. package/dist/NumberFormatting-CtWHhyBX.mjs +40 -0
  48. package/dist/OriginalBalanceAction-D39mx6uE.mjs +115 -0
  49. package/dist/RecurringSettings-D_HnMYZP.mjs +57 -0
  50. package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +263 -0
  51. package/dist/RepeatingTransaction-BPWfaB3f.mjs +282 -0
  52. package/dist/SearchBox-B2_zLv8-.mjs +42 -0
  53. package/dist/SettingsStore-CE7jDVFL.mjs +265 -0
  54. package/dist/SingleSegmentDonut-BgbLgwHi.mjs +69 -0
  55. package/dist/SpendingData-BkrxzHdr.mjs +55 -0
  56. package/dist/StatusBar-BK_uYHAB.mjs +30 -0
  57. package/dist/TabContentContainer-j01JYR_7.mjs +21 -0
  58. package/dist/Transaction-CA0FW2Ij.mjs +312 -0
  59. package/dist/TransactionApi-DbbcjI2L.mjs +86 -0
  60. package/dist/TransactionDetails-WBHFmbxL.mjs +1283 -0
  61. package/dist/TransactionStore-CeLdmVnC.mjs +669 -0
  62. package/dist/TrendsStore-BHJUapXF.mjs +487 -0
  63. package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +1959 -0
  64. package/dist/WidgetContainer-DWCusxYI.mjs +556 -0
  65. package/dist/accounts/index.es.js +752 -0
  66. package/dist/analytics/index.es.js +171 -0
  67. package/dist/budgets/index.es.js +1075 -0
  68. package/dist/cashflow/index.es.js +1098 -0
  69. package/dist/categories/index.es.js +9 -0
  70. package/dist/common/context/hooks.d.ts +13 -13
  71. package/dist/common/index.es.js +1451 -0
  72. package/dist/dashboard/index.es.js +181 -0
  73. package/dist/debts/index.es.js +1460 -0
  74. package/dist/exportTransactionsToCSV-CmwsKl2D.mjs +47 -0
  75. package/dist/finstrong/index.es.js +1455 -0
  76. package/dist/goals/index.es.js +1209 -0
  77. package/dist/help/components/content/section/index.d.ts +15 -15
  78. package/dist/help/index.es.js +14 -0
  79. package/dist/hooks-30y_BLwc.mjs +71 -0
  80. package/dist/index.d.ts +0 -22
  81. package/dist/insights/index.d.ts +1 -0
  82. package/dist/insights/index.es.js +4 -0
  83. package/dist/investments/index.es.js +1638 -0
  84. package/dist/merchants/index.es.js +79 -0
  85. package/dist/microinsights/index.es.js +16 -0
  86. package/dist/networth/index.es.js +576 -0
  87. package/dist/notifications/index.es.js +192 -0
  88. package/dist/recurringtransactions/index.es.js +879 -0
  89. package/dist/settings/index.es.js +879 -0
  90. package/dist/spending/index.es.js +570 -0
  91. package/dist/transactions/index.es.js +587 -0
  92. package/dist/trends/index.es.js +1086 -0
  93. package/dist/useCombineEvents-DaDBSR_1.mjs +92 -0
  94. package/dist/useDimensions-27p2evRx.mjs +36 -0
  95. package/dist/useScreenSize-B6JyS_Lj.mjs +36 -0
  96. package/package.json +155 -3
  97. package/dist/index.es.js +0 -30508
  98. package/dist/index.es.js.map +0 -1
@@ -0,0 +1,667 @@
1
+ import { jsxs as c, jsx as e, Fragment as M } from "react/jsx-runtime";
2
+ import f from "react";
3
+ import { observer as C } from "mobx-react-lite";
4
+ import v from "@mui/material/Divider";
5
+ import E from "@mui/material/List";
6
+ import O from "@mui/material/ListItem";
7
+ import N from "@mui/material/ListItemText";
8
+ import V from "@mui/material/ListItemButton";
9
+ import _ from "@mui/material/Stack";
10
+ import { ChevronRight as k, ExpandMore as K, Star as Q } from "@mxenabled/mx-icons";
11
+ import { Text as x, InstitutionLogo as Y, H3 as U } from "@mxenabled/mxui";
12
+ import { endOfMonth as Z } from "date-fns/endOfMonth";
13
+ import { startOfMonth as ee } from "date-fns/startOfMonth";
14
+ import { DateCalendar as te } from "@mui/x-date-pickers/DateCalendar";
15
+ import { LocalizationProvider as ne } from "@mui/x-date-pickers/LocalizationProvider";
16
+ import { AdapterDateFns as ie } from "@mui/x-date-pickers/AdapterDateFnsV3";
17
+ import { A as oe, T as F, a as P, N as b } from "./Notification-AMGWM1Al.mjs";
18
+ import { u as D, r as T, o as w, c as se, g as ae, j as W, a as ce } from "./hooks-30y_BLwc.mjs";
19
+ import { b as le } from "./Localization-2MODESHW.mjs";
20
+ import { b as re, f as de } from "./NumberFormatting-CtWHhyBX.mjs";
21
+ import { a as B } from "./Dialog-CWW597AF.mjs";
22
+ import { C as me } from "./CurrencyInput-D74cemI2.mjs";
23
+ import { u as _e } from "./useScreenSize-B6JyS_Lj.mjs";
24
+ import { D as J } from "./Drawer-kEE73B87.mjs";
25
+ import he from "@mui/material/Collapse";
26
+ import ue from "@mui/material/Card";
27
+ import pe from "@mui/material/CardContent";
28
+ import G from "@mui/material/Box";
29
+ import R from "@mui/material/Button";
30
+ import L from "@mui/material/TextField";
31
+ import { u as fe } from "./useDimensions-27p2evRx.mjs";
32
+ import X from "@mui/material/styles/useTheme";
33
+ import { L as ge } from "./Loader-Dp1P2gNw.mjs";
34
+ const ye = C(() => {
35
+ const { common: n, settings: t } = D(), { sendEmailVerification: s } = T(), { user: l } = w(), i = X(), [r, a] = f.useState(!1), o = () => {
36
+ a(!1);
37
+ }, m = () => {
38
+ a(!0);
39
+ };
40
+ return /* @__PURE__ */ c(f.Fragment, { children: [
41
+ /* @__PURE__ */ c(R, { onClick: m, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
42
+ /* @__PURE__ */ e(x, { variant: "Small", children: t.verify_email }),
43
+ /* @__PURE__ */ e(k, {})
44
+ ] }),
45
+ /* @__PURE__ */ e(
46
+ B,
47
+ {
48
+ copy: { title: "" },
49
+ isOpen: r,
50
+ onClose: o,
51
+ onPrimaryAction: s,
52
+ onSecondaryAction: o,
53
+ primaryText: t.send_verification,
54
+ secondaryText: n.back,
55
+ sx: {
56
+ "& .MuiDialogContent-root": { pt: 0, width: 400 },
57
+ "& .MuiToolbar-root:last-child": {
58
+ gap: 16,
59
+ padding: "32px 60px 48px",
60
+ justifyContent: "center"
61
+ }
62
+ },
63
+ children: /* @__PURE__ */ c(_, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
64
+ /* @__PURE__ */ e(x, { bold: !0, truncate: !1, variant: "Body", children: t.confirm_your_email }),
65
+ /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.confirm_email }),
66
+ /* @__PURE__ */ e(
67
+ x,
68
+ {
69
+ sx: {
70
+ border: `1px solid ${i.palette.border.light}`,
71
+ borderRadius: "4px",
72
+ p: "16px 32px"
73
+ },
74
+ variant: "H3",
75
+ children: l.email
76
+ }
77
+ ),
78
+ /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.verification_notice_email })
79
+ ] })
80
+ }
81
+ )
82
+ ] });
83
+ }), be = C(
84
+ ({ handleClose: n, handleVerify: t, isOpen: s }) => {
85
+ const { common: l, settings: i } = D(), [r, a] = f.useState("");
86
+ return /* @__PURE__ */ e(
87
+ B,
88
+ {
89
+ copy: { title: i.enter_verification_code },
90
+ isOpen: s,
91
+ onClose: n,
92
+ onPrimaryAction: () => t(r),
93
+ onSecondaryAction: n,
94
+ primaryText: i.verify,
95
+ secondaryText: l.cancel_button,
96
+ sx: {
97
+ "& .MuiDialogContent-root": { pt: 0, width: 400 },
98
+ "& .MuiToolbar-root:last-child": {
99
+ gap: 8,
100
+ padding: 24,
101
+ justifyContent: "flex-end"
102
+ }
103
+ },
104
+ children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(L, { onChange: (o) => a(o.target.value), sx: { width: 352 }, value: r }) })
105
+ }
106
+ );
107
+ }
108
+ ), xe = C(() => {
109
+ const { common: n, settings: t } = D(), { sendPhoneVerification: s, verifyPhoneToken: l } = T(), { user: i } = w(), r = X(), [a, o] = f.useState(!1), [m, d] = f.useState(!1), h = () => {
110
+ o(!1);
111
+ }, u = () => {
112
+ o(!0);
113
+ }, g = () => {
114
+ s().finally(() => {
115
+ d(!0);
116
+ });
117
+ }, p = (y) => {
118
+ l(y).finally(() => {
119
+ d(!1);
120
+ });
121
+ };
122
+ return /* @__PURE__ */ c(f.Fragment, { children: [
123
+ /* @__PURE__ */ c(R, { onClick: u, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
124
+ /* @__PURE__ */ e(x, { variant: "Small", children: t.verify_phone }),
125
+ /* @__PURE__ */ e(k, {})
126
+ ] }),
127
+ /* @__PURE__ */ e(
128
+ B,
129
+ {
130
+ copy: { title: "" },
131
+ isOpen: a,
132
+ onClose: h,
133
+ onPrimaryAction: g,
134
+ onSecondaryAction: h,
135
+ primaryText: t.send_verification,
136
+ secondaryText: n.back,
137
+ sx: {
138
+ "& .MuiDialogContent-root": { pt: 0, width: 400 },
139
+ "& .MuiToolbar-root:last-child": {
140
+ gap: 16,
141
+ padding: "32px 60px 48px",
142
+ justifyContent: "center"
143
+ }
144
+ },
145
+ children: /* @__PURE__ */ c(_, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
146
+ /* @__PURE__ */ e(x, { bold: !0, truncate: !1, variant: "Body", children: t.confirm_your_phone }),
147
+ /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.confirm_phone }),
148
+ /* @__PURE__ */ e(
149
+ x,
150
+ {
151
+ sx: {
152
+ border: `1px solid ${r.palette.border.light}`,
153
+ borderRadius: "4px",
154
+ p: "16px 32px"
155
+ },
156
+ variant: "H3",
157
+ children: i.phone
158
+ }
159
+ ),
160
+ /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.verification_notice_phone })
161
+ ] })
162
+ }
163
+ ),
164
+ /* @__PURE__ */ e(
165
+ be,
166
+ {
167
+ handleClose: () => d(!1),
168
+ handleVerify: p,
169
+ isOpen: m
170
+ }
171
+ )
172
+ ] });
173
+ }), Ce = C(
174
+ ({ onProfileUpdated: n, profile: t }) => {
175
+ const { common: s, recurring: l, settings: i } = D(), { updateAccount: r } = se(), a = t.notification_type === oe.DebtPaymentReminder, [o, m] = f.useState(!1), [d, h] = f.useState(t.threshold || 0), [u, g] = f.useState(
176
+ t.account?.day_payment_is_due || 0
177
+ ), p = t.account?.name || t.account?.feed_name || "", y = t.account?.day_payment_is_due ? le(
178
+ i.notification_debt_payment_date,
179
+ re(t.account?.day_payment_is_due)
180
+ ) : i.notification_debt_payment_zero_state, S = a ? y : de(t.threshold ?? 0, "0,0"), A = async () => {
181
+ a && t.account ? await r({ ...t.account, day_payment_is_due: u }) : n({ ...t, threshold: d });
182
+ };
183
+ return /* @__PURE__ */ c(_, { children: [
184
+ /* @__PURE__ */ e(
185
+ F,
186
+ {
187
+ avatar: t.account?.institution_guid ? /* @__PURE__ */ e(
188
+ Y,
189
+ {
190
+ alt: t.label,
191
+ institutionGuid: t.account?.institution_guid
192
+ }
193
+ ) : void 0,
194
+ endIcon: /* @__PURE__ */ e(k, {}),
195
+ isChecked: t.is_enabled,
196
+ onClick: () => m(!0),
197
+ onToggle: () => n({
198
+ ...t,
199
+ is_enabled: !t.is_enabled
200
+ }),
201
+ primaryText: p,
202
+ secondaryText: S
203
+ }
204
+ ),
205
+ /* @__PURE__ */ e(
206
+ B,
207
+ {
208
+ copy: {
209
+ title: a ? l.day_of_the_month : i.notification_threshold_label,
210
+ close_aria: s.close_aria
211
+ },
212
+ disablePrimaryButton: a && u === 0,
213
+ isOpen: o,
214
+ onClose: () => m(!1),
215
+ onPrimaryAction: A,
216
+ primaryText: s.save_button,
217
+ children: a ? /* @__PURE__ */ e(ne, { dateAdapter: ie, children: /* @__PURE__ */ e(
218
+ te,
219
+ {
220
+ maxDate: Z(/* @__PURE__ */ new Date()),
221
+ minDate: ee(/* @__PURE__ */ new Date()),
222
+ onChange: (I) => {
223
+ g(I.getDate());
224
+ },
225
+ slots: {
226
+ // Hides the arrows
227
+ leftArrowIcon: () => null,
228
+ rightArrowIcon: () => null
229
+ },
230
+ sx: {
231
+ // TODO: Needs to be updated in MXUI
232
+ "& .MuiPickersDay-today": {
233
+ color: "primary.main"
234
+ }
235
+ },
236
+ views: ["day"]
237
+ }
238
+ ) }) : /* @__PURE__ */ e(
239
+ me,
240
+ {
241
+ amount: d,
242
+ autoFocus: !0,
243
+ fullWidth: !0,
244
+ minAmount: 0,
245
+ setAmount: (I) => h(Number(I) || 0),
246
+ sx: { ".MuiTypography-Body": { p: 0 } }
247
+ }
248
+ )
249
+ }
250
+ )
251
+ ] });
252
+ }
253
+ ), ve = C(
254
+ ({ onUpdateProfile: n, profile: t }) => {
255
+ const { settings: s } = D(), { user: l } = w(), { clientCommunicationProfile: i, userCommunicationsProfile: r } = T(), { isMobile: a } = _e(), o = t.notification_type > 2, {
256
+ opted_out_of_email_notifications: m,
257
+ opted_out_of_push_notifications: d,
258
+ opted_out_of_sms_notifications: h
259
+ } = r, {
260
+ email_notifications_enabled: u,
261
+ push_notifications_enabled: g,
262
+ sms_notifications_enabled: p
263
+ } = i;
264
+ return /* @__PURE__ */ c(_, { children: [
265
+ (u || p || g) && /* @__PURE__ */ c(M, { children: [
266
+ /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.delivery_method_title }),
267
+ /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
268
+ u && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
269
+ P,
270
+ {
271
+ isChecked: !m && t.email_channel && !!l.email,
272
+ isDisabled: m || !l.email,
273
+ onToggle: () => n({ ...t, email_channel: !t.email_channel }),
274
+ primaryText: s.delivery_method_email_label,
275
+ secondaryText: t.email_channel ? s.notification_enabled : s.notification_disabled,
276
+ useExtraPadding: !1
277
+ }
278
+ ) }),
279
+ u && (p || g) && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
280
+ p && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
281
+ P,
282
+ {
283
+ isChecked: !h && t.sms_channel && !!l.phone,
284
+ isDisabled: h || !l.phone,
285
+ onToggle: () => n({ ...t, sms_channel: !t.sms_channel }),
286
+ primaryText: `${s.delivery_method_sms_label}`,
287
+ secondaryText: t.sms_channel ? s.notification_enabled : s.notification_disabled,
288
+ useExtraPadding: !1
289
+ }
290
+ ) }),
291
+ p && g && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
292
+ g && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
293
+ P,
294
+ {
295
+ isChecked: !d && t.push_channel,
296
+ isDisabled: d,
297
+ onToggle: () => n({ ...t, push_channel: !t.push_channel }),
298
+ primaryText: s.delivery_method_push_label,
299
+ secondaryText: s.delivery_method_push_subtitle,
300
+ useExtraPadding: !1
301
+ }
302
+ ) }),
303
+ /* @__PURE__ */ e(v, {})
304
+ ] })
305
+ ] }),
306
+ o && !!t.children?.length && /* @__PURE__ */ c(_, { children: [
307
+ /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.accounts_threshold_title }),
308
+ /* @__PURE__ */ e(E, { sx: { bgcolor: "background.paper" }, children: t.children?.map((y) => /* @__PURE__ */ e(
309
+ Ce,
310
+ {
311
+ onProfileUpdated: n,
312
+ profile: y
313
+ },
314
+ y.guid
315
+ )) })
316
+ ] })
317
+ ] });
318
+ }
319
+ ), H = C(() => {
320
+ const { accountProfiles: n, updateNotificationProfile: t } = T(), [s, l] = f.useState(""), i = f.useMemo(
321
+ () => n.find((o) => o.guid === s),
322
+ [n, s]
323
+ ), r = async (o) => {
324
+ await t({
325
+ ...o,
326
+ is_enabled: !o.is_enabled
327
+ });
328
+ }, a = async (o) => {
329
+ await t(o);
330
+ };
331
+ return /* @__PURE__ */ c(_, { sx: { backgroundColor: "background.paper" }, children: [
332
+ n.filter((o) => o.children && o.children.length > 0).map((o) => /* @__PURE__ */ e(
333
+ F,
334
+ {
335
+ endIcon: /* @__PURE__ */ e(k, {}),
336
+ isChecked: o.is_enabled,
337
+ isDisabled: !o.is_enabled,
338
+ onClick: () => l(o.guid),
339
+ onToggle: () => r(o),
340
+ primaryText: o.label,
341
+ secondaryText: o.is_enabled ? o.deliveryMethodsLabel : void 0
342
+ },
343
+ o.guid
344
+ )),
345
+ /* @__PURE__ */ e(
346
+ J,
347
+ {
348
+ isOpen: !!i,
349
+ onClose: () => l(""),
350
+ title: i ? i.label : "",
351
+ children: i && /* @__PURE__ */ e(
352
+ ve,
353
+ {
354
+ onUpdateProfile: a,
355
+ profile: i
356
+ }
357
+ )
358
+ }
359
+ )
360
+ ] });
361
+ }), q = C(({ profile: n }) => {
362
+ const { settings: t } = D(), {
363
+ clientCommunicationProfile: {
364
+ email_notifications_enabled: s,
365
+ push_notifications_enabled: l,
366
+ sms_notifications_enabled: i
367
+ },
368
+ updateNotificationProfile: r,
369
+ userCommunicationsProfile: {
370
+ opted_out_of_email_notifications: a,
371
+ opted_out_of_push_notifications: o,
372
+ opted_out_of_sms_notifications: m
373
+ }
374
+ } = T(), { user: d } = w(), [h, u] = f.useState(!1), g = async () => {
375
+ await p({ ...n, is_enabled: !n.is_enabled }), n.is_enabled && u(!1);
376
+ }, p = async (S) => {
377
+ await r(S);
378
+ }, y = s || i || l;
379
+ return /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
380
+ /* @__PURE__ */ e(
381
+ F,
382
+ {
383
+ endIcon: y ? /* @__PURE__ */ e(
384
+ K,
385
+ {
386
+ sx: {
387
+ transition: "transform 0.3s ease-in-out",
388
+ transform: h ? "rotate(180deg)" : "rotate(0deg)"
389
+ }
390
+ }
391
+ ) : void 0,
392
+ isChecked: n.is_enabled,
393
+ isDisabled: !n.is_enabled,
394
+ onClick: () => u(!h),
395
+ onToggle: () => g(),
396
+ primaryText: n.label,
397
+ secondaryText: n.is_enabled ? n.deliveryMethodsLabel : void 0
398
+ },
399
+ n.guid
400
+ ),
401
+ y && /* @__PURE__ */ e(he, { in: h, children: /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
402
+ s && /* @__PURE__ */ e(
403
+ P,
404
+ {
405
+ isChecked: !a && n.email_channel && !!d.email,
406
+ isDisabled: a || !d.email,
407
+ onToggle: () => p({
408
+ ...n,
409
+ email_channel: !n.email_channel
410
+ }),
411
+ primaryText: t.delivery_method_email_label
412
+ }
413
+ ),
414
+ s && (i || l) && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
415
+ i && /* @__PURE__ */ e(
416
+ P,
417
+ {
418
+ isChecked: !m && n.sms_channel && !!d.phone,
419
+ isDisabled: m || !d.phone,
420
+ onToggle: () => p({
421
+ ...n,
422
+ sms_channel: !n.sms_channel
423
+ }),
424
+ primaryText: t.delivery_method_sms_label
425
+ }
426
+ ),
427
+ i && l && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
428
+ l && /* @__PURE__ */ e(
429
+ P,
430
+ {
431
+ isChecked: !o && n.push_channel,
432
+ isDisabled: o,
433
+ onToggle: () => p({
434
+ ...n,
435
+ push_channel: !n.push_channel
436
+ }),
437
+ primaryText: t.delivery_method_push_label
438
+ }
439
+ )
440
+ ] }) }),
441
+ /* @__PURE__ */ e(v, {})
442
+ ] }, n.guid);
443
+ }), z = C(() => {
444
+ const { budgetProfiles: n } = T();
445
+ return /* @__PURE__ */ e(_, { children: n.map((t) => /* @__PURE__ */ e(q, { profile: t }, t.guid)) });
446
+ }), Te = C(() => {
447
+ const { onEvent: n } = ae(), { settings: t } = D(), {
448
+ clientCommunicationProfile: s,
449
+ updateUserCommunicationProfile: l,
450
+ userCommunicationsProfile: i
451
+ } = T(), { user: r } = w(), a = async (o, m) => {
452
+ const d = { ...i, [o]: m };
453
+ if (n) {
454
+ const u = o.split("_")[3];
455
+ m === !1 ? n("opt_in_notification_method", { notificationType: u }) : n("opt_out_notification_method", { notificationType: u });
456
+ }
457
+ await l(d);
458
+ };
459
+ return /* @__PURE__ */ c(_, { children: [
460
+ /* @__PURE__ */ e(U, { sx: { mt: 24 }, children: t.delivery_method_title }),
461
+ s.email_notifications_enabled && /* @__PURE__ */ c(M, { children: [
462
+ /* @__PURE__ */ e(
463
+ P,
464
+ {
465
+ isChecked: !!r.email && !i.opted_out_of_email_notifications,
466
+ isDisabled: !r.email,
467
+ onToggle: () => a(
468
+ "opted_out_of_email_notifications",
469
+ !i.opted_out_of_email_notifications
470
+ ),
471
+ primaryText: t.delivery_method_email_title,
472
+ secondaryText: r.email && !i.opted_out_of_email_notifications ? t.notification_enabled : t.notification_disabled,
473
+ useExtraPadding: !1
474
+ }
475
+ ),
476
+ (s.sms_notifications_enabled || s.push_notifications_enabled) && /* @__PURE__ */ e(v, {})
477
+ ] }),
478
+ s.sms_notifications_enabled && /* @__PURE__ */ c(M, { children: [
479
+ /* @__PURE__ */ e(
480
+ P,
481
+ {
482
+ isChecked: !!r.phone && !i.opted_out_of_sms_notifications,
483
+ isDisabled: !r.phone,
484
+ onToggle: () => a("opted_out_of_sms_notifications", !i.opted_out_of_sms_notifications),
485
+ primaryText: t.delivery_method_sms_title,
486
+ secondaryText: r.phone && !i.opted_out_of_sms_notifications ? t.notification_enabled : t.notification_disabled,
487
+ useExtraPadding: !1
488
+ }
489
+ ),
490
+ s.push_notifications_enabled && /* @__PURE__ */ e(v, {})
491
+ ] }),
492
+ s.push_notifications_enabled && /* @__PURE__ */ e(
493
+ P,
494
+ {
495
+ isChecked: !i.opted_out_of_push_notifications,
496
+ isDisabled: !0,
497
+ onToggle: () => {
498
+ },
499
+ primaryText: t.delivery_method_push_title,
500
+ secondaryText: t.delivery_method_push_subtitle,
501
+ useExtraPadding: !1
502
+ }
503
+ ),
504
+ s.sms_notifications_enabled && /* @__PURE__ */ e(ue, { sx: { backgroundColor: "background.default", mt: 12 }, variant: "outlined", children: /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ c(_, { alignItems: "flex-start", direction: "row", gap: 6, children: [
505
+ /* @__PURE__ */ e(Q, { color: "primary", filled: !0 }),
506
+ /* @__PURE__ */ e(x, { sx: { whiteSpace: "wrap" }, variant: "XSmall", children: t.delivery_method_sms_note_1 })
507
+ ] }) }) })
508
+ ] });
509
+ }), $ = C(() => {
510
+ const { insightsProfiles: n } = T();
511
+ return /* @__PURE__ */ e(_, { children: n.map((t) => /* @__PURE__ */ e(q, { profile: t }, t.guid)) });
512
+ }), Pe = () => {
513
+ const { config: n } = W(), [t, { width: s }] = fe(), { common: l, settings: i } = D(), { updateUser: r } = T(), { user: a } = w(), [o, m] = f.useState(!1), [d, h] = f.useState({
514
+ email: a.email,
515
+ phone: a.phone
516
+ }), u = d.email && !a.email_is_verified && !o, g = d.phone && !a.phone_is_verified && !o, p = (S) => {
517
+ const { name: A, value: I } = S.target, j = { ...d, [A]: I };
518
+ h(j), m(JSON.stringify({ ...a, ...j }) !== JSON.stringify(a));
519
+ }, y = async () => {
520
+ await r({ ...a, ...d }), m(!1);
521
+ };
522
+ return /* @__PURE__ */ c(_, { ref: t, children: [
523
+ /* @__PURE__ */ e(v, {}),
524
+ /* @__PURE__ */ c(_, { sx: { pt: 12 }, children: [
525
+ /* @__PURE__ */ e(U, { sx: { lineHeight: "20px", pb: 4, pt: 16 }, children: i.personal_details }),
526
+ /* @__PURE__ */ c(_, { sx: { flexDirection: s <= 768 ? "column" : "row", gap: 24, py: 16 }, children: [
527
+ n.display_email_edit_field_in_settings && /* @__PURE__ */ c(_, { sx: { flex: 1, pb: 14 }, children: [
528
+ /* @__PURE__ */ e(
529
+ L,
530
+ {
531
+ defaultValue: a.email,
532
+ fullWidth: !0,
533
+ label: i.email_address,
534
+ name: "email",
535
+ onChange: p
536
+ }
537
+ ),
538
+ u && /* @__PURE__ */ e(
539
+ G,
540
+ {
541
+ sx: {
542
+ height: 20,
543
+ ".MuiButton-root": {
544
+ px: 0,
545
+ ":hover": {
546
+ bgcolor: "transparent"
547
+ }
548
+ }
549
+ },
550
+ children: /* @__PURE__ */ e(ye, {})
551
+ }
552
+ )
553
+ ] }),
554
+ n.display_sms_edit_field_in_settings && /* @__PURE__ */ c(_, { sx: { flex: 1, pb: 14 }, children: [
555
+ /* @__PURE__ */ e(
556
+ L,
557
+ {
558
+ defaultValue: a.phone,
559
+ fullWidth: !0,
560
+ label: i.mobile_number,
561
+ name: "phone",
562
+ onChange: p
563
+ }
564
+ ),
565
+ g && /* @__PURE__ */ e(
566
+ G,
567
+ {
568
+ sx: {
569
+ height: 20,
570
+ ".MuiButton-root": {
571
+ px: 0,
572
+ ":hover": {
573
+ bgcolor: "transparent"
574
+ }
575
+ }
576
+ },
577
+ children: /* @__PURE__ */ e(xe, {})
578
+ }
579
+ )
580
+ ] })
581
+ ] }),
582
+ /* @__PURE__ */ e(
583
+ R,
584
+ {
585
+ disabled: !o,
586
+ onClick: y,
587
+ sx: { width: 84 },
588
+ variant: "contained",
589
+ children: l.save_button
590
+ }
591
+ )
592
+ ] })
593
+ ] });
594
+ }, De = C(Pe), st = C(
595
+ ({
596
+ notificationTypes: n = [b.Accounts, b.Budgets],
597
+ showPersonalDetails: t = !1,
598
+ view: s
599
+ }) => {
600
+ const { config: l } = W(), { settings: i } = D(), { isInitialized: r } = ce(), { clientCommunicationProfile: a, loadNotificationProfiles: o } = T(), [m, d] = f.useState(
601
+ void 0
602
+ );
603
+ if (f.useEffect(() => {
604
+ r && o().finally();
605
+ }, [r]), !r)
606
+ return /* @__PURE__ */ e(ge, {});
607
+ let h = i.manage_account_notifications;
608
+ m === b.Budgets ? h = i.manage_budget_notifications : m === b.Insights && (h = i.manage_insights_notifications);
609
+ const {
610
+ email_notifications_enabled: u,
611
+ sms_notifications_enabled: g,
612
+ push_notifications_enabled: p
613
+ } = a, y = u || g || p;
614
+ if (s === "accounts")
615
+ return /* @__PURE__ */ e(H, {});
616
+ if (s === "budgets")
617
+ return /* @__PURE__ */ e(z, {});
618
+ if (s === "insights")
619
+ return /* @__PURE__ */ e($, {});
620
+ const S = l.display_email_edit_field_in_settings || l.display_sms_edit_field_in_settings, A = t && a.can_edit_contact_info && S;
621
+ return /* @__PURE__ */ c(_, { sx: { pt: y ? 0 : 24 }, children: [
622
+ /* @__PURE__ */ c(_, { sx: { px: 24 }, children: [
623
+ y && /* @__PURE__ */ c(M, { children: [
624
+ /* @__PURE__ */ e(Te, {}),
625
+ /* @__PURE__ */ e(v, { sx: { my: 24 } })
626
+ ] }),
627
+ /* @__PURE__ */ e(U, { sx: { mb: 4 }, children: i.notification_types_title })
628
+ ] }),
629
+ /* @__PURE__ */ c(E, { children: [
630
+ n.includes(b.Accounts) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => d(b.Accounts), children: [
631
+ /* @__PURE__ */ e(N, { primary: i.accounts_title, secondary: i.accounts_subtitle }),
632
+ /* @__PURE__ */ e(k, {})
633
+ ] }) }),
634
+ n.includes(b.Budgets) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => d(b.Budgets), children: [
635
+ /* @__PURE__ */ e(N, { primary: i.budgets_title, secondary: i.budgets_subtitle }),
636
+ /* @__PURE__ */ e(k, {})
637
+ ] }) }),
638
+ n.includes(b.Insights) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => d(b.Insights), children: [
639
+ /* @__PURE__ */ e(N, { primary: i.insights_title, secondary: i.insights_subtitle }),
640
+ /* @__PURE__ */ e(k, {})
641
+ ] }) })
642
+ ] }),
643
+ A && /* @__PURE__ */ e(_, { sx: { px: 24 }, children: /* @__PURE__ */ e(De, {}) }),
644
+ /* @__PURE__ */ e(
645
+ J,
646
+ {
647
+ isOpen: !!m,
648
+ onClose: () => d(void 0),
649
+ title: h,
650
+ children: /* @__PURE__ */ c(_, { children: [
651
+ m === b.Accounts && /* @__PURE__ */ e(H, {}),
652
+ m === b.Budgets && /* @__PURE__ */ e(z, {}),
653
+ m === b.Insights && /* @__PURE__ */ e($, {})
654
+ ] })
655
+ }
656
+ )
657
+ ] });
658
+ }
659
+ );
660
+ export {
661
+ H as A,
662
+ z as B,
663
+ $ as I,
664
+ st as N,
665
+ ye as V,
666
+ xe as a
667
+ };