@mx-cartographer/experiences 7.0.27-alpha.sms4 → 7.0.27-alpha.sms6

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 (55) hide show
  1. package/dist/{Account-BW3-oYEs.mjs → Account-CK-DrCEa.mjs} +1 -1
  2. package/dist/{AccountDetailsContent-UxSEMBo_.mjs → AccountDetailsContent-BZAbCT6q.mjs} +8 -8
  3. package/dist/{AccountDetailsHeader-Eb3WvBGm.mjs → AccountDetailsHeader-DXTi1p0V.mjs} +11 -11
  4. package/dist/{AccountFields-CIz-r3gP.mjs → AccountFields-Bxvi1C4Z.mjs} +2 -2
  5. package/dist/{AccountListItem-B-ZjJ4Gp.mjs → AccountListItem-CnE3rCVZ.mjs} +3 -3
  6. package/dist/{AccountStore-BaMynkQT.mjs → AccountStore-DiGbJBUT.mjs} +2 -2
  7. package/dist/{Accounts-CA-nqAjT.mjs → Accounts-BBkQjUmS.mjs} +1 -1
  8. package/dist/{BudgetUtil-CeSLAcsl.mjs → BudgetUtil-D5jO0box.mjs} +1 -1
  9. package/dist/{CategorySelectorDrawer-BJ9jlCyt.mjs → CategorySelectorDrawer-joMax4Fb.mjs} +1 -1
  10. package/dist/{ConnectDrawer-phFH6OHt.mjs → ConnectDrawer-D86nRDxQ.mjs} +1 -1
  11. package/dist/{ConnectionsDrawer-ihxkAi1P.mjs → ConnectionsDrawer-BkNr5Up0.mjs} +2 -2
  12. package/dist/{CurrencyInput-bEx2Mbd0.mjs → CurrencyInput-BkflFU_-.mjs} +1 -1
  13. package/dist/{DebtsStore-VkyMADzd.mjs → DebtsStore-qrqY9Abz.mjs} +1 -1
  14. package/dist/{ExportCsvAction-CbdFfDV5.mjs → ExportCsvAction-DRfdZis1.mjs} +3 -3
  15. package/dist/{GoalStore-eSOkI6uE.mjs → GoalStore-BQRcowCN.mjs} +2 -2
  16. package/dist/{Help-KAAMEubC.mjs → Help-B3dFeYi2.mjs} +1 -1
  17. package/dist/{LineChart-BWWmmJxV.mjs → LineChart-Dyps2sOy.mjs} +1 -1
  18. package/dist/{ListItemAction-DNZZ5fSa.mjs → ListItemAction-BgKx_n6d.mjs} +1 -1
  19. package/dist/{ManageIncome-DbsiKUoO.mjs → ManageIncome-CFh-N0KK.mjs} +4 -4
  20. package/dist/{MicroWidgetContainer-Dxz8uBN9.mjs → MicroWidgetContainer-DPDsZIiS.mjs} +1 -1
  21. package/dist/{MiniWidgetContainer-CTyjmE1h.mjs → MiniWidgetContainer-BzW7V_04.mjs} +1 -1
  22. package/dist/{NetWorthStore-B6xF9eGH.mjs → NetWorthStore-DWG9Mkuu.mjs} +2 -2
  23. package/dist/NotificationSettings-BaG4tpPe.mjs +671 -0
  24. package/dist/{OriginalBalanceAction-DepsKiJz.mjs → OriginalBalanceAction-B--pIAF0.mjs} +3 -3
  25. package/dist/{RecurringSettings-Dj29piAQ.mjs → RecurringSettings-C9TjSuS_.mjs} +3 -3
  26. package/dist/{TransactionDetails-C-z3HGTT.mjs → TransactionDetails-C2gYzV0z.mjs} +37 -37
  27. package/dist/{TransactionStore-Cep_Eeql.mjs → TransactionStore-CZOvxcSw.mjs} +2 -2
  28. package/dist/{TrendsStore-WrHxzdbQ.mjs → TrendsStore-pvzHAX6B.mjs} +225 -231
  29. package/dist/{User-Dq9Qj764.mjs → User-D-O9EHMb.mjs} +1 -1
  30. package/dist/{WidgetContainer-CdBs9WOZ.mjs → WidgetContainer-Bn6JPnY3.mjs} +2 -2
  31. package/dist/accounts/index.es.js +12 -12
  32. package/dist/analytics/index.es.js +11 -11
  33. package/dist/budgets/index.es.js +10 -10
  34. package/dist/cashflow/index.es.js +7 -7
  35. package/dist/categories/index.es.js +1 -1
  36. package/dist/common/index.es.js +105 -104
  37. package/dist/dashboard/index.es.js +2 -2
  38. package/dist/debts/index.es.js +9 -9
  39. package/dist/{exportTransactionsToCSV-B5qAKd6C.mjs → exportTransactionsToCSV-zyHeWfQo.mjs} +1 -1
  40. package/dist/finstrong/index.es.js +6 -6
  41. package/dist/goals/index.es.js +11 -11
  42. package/dist/help/index.es.js +3 -3
  43. package/dist/{hooks-DkUqN6JE.mjs → hooks-DlI63qSB.mjs} +8 -8
  44. package/dist/investments/index.es.js +3 -3
  45. package/dist/merchants/index.es.js +1 -1
  46. package/dist/networth/index.es.js +7 -7
  47. package/dist/notifications/index.es.js +2 -2
  48. package/dist/recurringtransactions/index.es.js +8 -8
  49. package/dist/settings/index.es.js +7 -7
  50. package/dist/spending/index.es.js +14 -14
  51. package/dist/transactions/index.es.js +13 -13
  52. package/dist/trends/index.es.js +70 -69
  53. package/dist/useInsightsEnabled-fGr6xrSj.mjs +11 -0
  54. package/package.json +1 -1
  55. package/dist/NotificationSettings-ClJT-Sg3.mjs +0 -664
@@ -1,664 +0,0 @@
1
- import { jsxs as c, jsx as e, Fragment as M } from "react/jsx-runtime";
2
- import f from "react";
3
- import { observer as x } from "mobx-react-lite";
4
- import v from "@mui/material/Divider";
5
- import E from "@mui/material/List";
6
- import N from "@mui/material/ListItem";
7
- import O from "@mui/material/ListItemText";
8
- import V from "@mui/material/ListItemButton";
9
- import h from "@mui/material/Stack";
10
- import { ChevronRight as k, ExpandMore as K, Star as Q } from "@mxenabled/mx-icons";
11
- import { Text as b, 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 C } from "./Notification-ByMBpJ5u.mjs";
18
- import { u as D, r as T, o as w, c as se, e as ae, m as W, a as ce } from "./hooks-DkUqN6JE.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-bEx2Mbd0.mjs";
23
- import { u as he } from "./useScreenSize-B6JyS_Lj.mjs";
24
- import { D as J } from "./Drawer-kEE73B87.mjs";
25
- import _e 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-DUaFpDGv.mjs";
34
- const ye = x(() => {
35
- const { common: n, settings: t } = D(), { sendEmailVerification: o } = T(), { user: l } = w(), i = X(), [r, a] = f.useState(!1), s = () => {
36
- a(!1);
37
- }, d = () => {
38
- a(!0);
39
- };
40
- return /* @__PURE__ */ c(f.Fragment, { children: [
41
- /* @__PURE__ */ c(R, { onClick: d, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
42
- /* @__PURE__ */ e(b, { 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: s,
51
- onPrimaryAction: o,
52
- onSecondaryAction: s,
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(h, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
64
- /* @__PURE__ */ e(b, { bold: !0, truncate: !1, variant: "Body", children: t.confirm_your_email }),
65
- /* @__PURE__ */ e(b, { truncate: !1, variant: "Small", children: t.confirm_email }),
66
- /* @__PURE__ */ e(
67
- b,
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(b, { truncate: !1, variant: "Small", children: t.verification_notice_email })
79
- ] })
80
- }
81
- )
82
- ] });
83
- }), be = x(
84
- ({ handleClose: n, handleVerify: t, isOpen: o }) => {
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: o,
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(h, { children: /* @__PURE__ */ e(L, { onChange: (s) => a(s.target.value), sx: { width: 352 }, value: r }) })
105
- }
106
- );
107
- }
108
- ), xe = x(() => {
109
- const { common: n, settings: t } = D(), { sendPhoneVerification: o, verifyPhoneToken: l } = T(), { user: i } = w(), r = X(), [a, s] = f.useState(!1), [d, m] = f.useState(!1), _ = () => {
110
- s(!1);
111
- }, u = () => {
112
- s(!0);
113
- }, g = () => {
114
- o().finally(() => {
115
- m(!0);
116
- });
117
- }, p = (y) => {
118
- l(y).finally(() => {
119
- m(!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(b, { 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: _,
133
- onPrimaryAction: g,
134
- onSecondaryAction: _,
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(h, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
146
- /* @__PURE__ */ e(b, { bold: !0, truncate: !1, variant: "Body", children: t.confirm_your_phone }),
147
- /* @__PURE__ */ e(b, { truncate: !1, variant: "Small", children: t.confirm_phone }),
148
- /* @__PURE__ */ e(
149
- b,
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(b, { truncate: !1, variant: "Small", children: t.verification_notice_phone })
161
- ] })
162
- }
163
- ),
164
- /* @__PURE__ */ e(
165
- be,
166
- {
167
- handleClose: () => m(!1),
168
- handleVerify: p,
169
- isOpen: d
170
- }
171
- )
172
- ] });
173
- }), Ce = x(
174
- ({ onProfileUpdated: n, profile: t }) => {
175
- const { common: o, recurring: l, settings: i } = D(), { updateAccount: r } = se(), a = t.notification_type === oe.DebtPaymentReminder, [s, d] = f.useState(!1), [m, _] = 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: m });
182
- };
183
- return /* @__PURE__ */ c(h, { 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
- isPrimaryTextBold: !0,
197
- onClick: () => d(!0),
198
- onToggle: () => n({
199
- ...t,
200
- is_enabled: !t.is_enabled
201
- }),
202
- primaryText: p,
203
- secondaryText: S
204
- }
205
- ),
206
- /* @__PURE__ */ e(
207
- B,
208
- {
209
- copy: {
210
- title: a ? l.day_of_the_month : i.notification_threshold_label,
211
- close_aria: o.close_aria
212
- },
213
- disablePrimaryButton: a && u === 0,
214
- isOpen: s,
215
- onClose: () => d(!1),
216
- onPrimaryAction: A,
217
- primaryText: o.save_button,
218
- children: a ? /* @__PURE__ */ e(ne, { dateAdapter: ie, children: /* @__PURE__ */ e(
219
- te,
220
- {
221
- maxDate: Z(/* @__PURE__ */ new Date()),
222
- minDate: ee(/* @__PURE__ */ new Date()),
223
- onChange: (I) => {
224
- g(I.getDate());
225
- },
226
- slots: {
227
- // Hides the arrows
228
- leftArrowIcon: () => null,
229
- rightArrowIcon: () => null
230
- },
231
- sx: {
232
- // TODO: Needs to be updated in MXUI
233
- "& .MuiPickersDay-today": {
234
- color: "primary.main"
235
- }
236
- },
237
- views: ["day"]
238
- }
239
- ) }) : /* @__PURE__ */ e(
240
- me,
241
- {
242
- amount: m,
243
- autoFocus: !0,
244
- fullWidth: !0,
245
- minAmount: 0,
246
- setAmount: (I) => _(Number(I) || 0),
247
- sx: { ".MuiTypography-Body": { p: 0 } }
248
- }
249
- )
250
- }
251
- )
252
- ] });
253
- }
254
- ), ve = x(
255
- ({ onUpdateProfile: n, profile: t }) => {
256
- const { settings: o } = D(), { user: l } = w(), { clientCommunicationProfile: i, userCommunicationsProfile: r } = T(), { isMobile: a } = he(), s = t.notification_type > 2, {
257
- opted_out_of_email_notifications: d,
258
- opted_out_of_push_notifications: m,
259
- opted_out_of_sms_notifications: _
260
- } = r, {
261
- email_notifications_enabled: u,
262
- push_notifications_enabled: g,
263
- sms_notifications_enabled: p
264
- } = i;
265
- return /* @__PURE__ */ c(h, { children: [
266
- (u || p || g) && /* @__PURE__ */ c(M, { children: [
267
- /* @__PURE__ */ e(b, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: o.delivery_method_title }),
268
- /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
269
- u && /* @__PURE__ */ e(h, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
270
- P,
271
- {
272
- isChecked: !d && t.email_channel && !!l.email,
273
- isDisabled: d || !l.email,
274
- onToggle: () => n({ ...t, email_channel: !t.email_channel }),
275
- primaryText: o.delivery_method_email_label,
276
- secondaryText: d || !t.email_channel || !l.email ? o.notification_disabled : o.notification_enabled,
277
- useExtraPadding: !1
278
- }
279
- ) }),
280
- u && (p || g) && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
281
- p && /* @__PURE__ */ e(h, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
282
- P,
283
- {
284
- isChecked: !_ && t.sms_channel && !!l.phone,
285
- isDisabled: _ || !l.phone,
286
- onToggle: () => n({ ...t, sms_channel: !t.sms_channel }),
287
- primaryText: `${o.delivery_method_sms_label}`,
288
- secondaryText: _ || !t.sms_channel || !l.phone ? o.notification_disabled : o.notification_enabled,
289
- useExtraPadding: !1
290
- }
291
- ) }),
292
- p && g && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
293
- g && /* @__PURE__ */ e(h, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
294
- P,
295
- {
296
- isChecked: !m && t.push_channel,
297
- isDisabled: m,
298
- onToggle: () => n({ ...t, push_channel: !t.push_channel }),
299
- primaryText: o.delivery_method_push_label,
300
- secondaryText: o.delivery_method_push_subtitle,
301
- useExtraPadding: !1
302
- }
303
- ) }),
304
- /* @__PURE__ */ e(v, {})
305
- ] })
306
- ] }),
307
- s && !!t.children?.length && /* @__PURE__ */ c(h, { children: [
308
- /* @__PURE__ */ e(b, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: o.accounts_threshold_title }),
309
- /* @__PURE__ */ e(E, { sx: { bgcolor: "background.paper" }, children: t.children?.map((y) => /* @__PURE__ */ e(
310
- Ce,
311
- {
312
- onProfileUpdated: n,
313
- profile: y
314
- },
315
- y.guid
316
- )) })
317
- ] })
318
- ] });
319
- }
320
- ), H = x(() => {
321
- const { accountProfiles: n, updateNotificationProfile: t } = T(), [o, l] = f.useState(""), i = f.useMemo(
322
- () => n.find((s) => s.guid === o),
323
- [n, o]
324
- ), r = async (s) => {
325
- await t({
326
- ...s,
327
- is_enabled: !s.is_enabled
328
- });
329
- }, a = async (s) => {
330
- await t(s);
331
- };
332
- return /* @__PURE__ */ c(h, { sx: { backgroundColor: "background.paper" }, children: [
333
- n.filter((s) => s.children && s.children.length > 0).map((s) => /* @__PURE__ */ e(
334
- F,
335
- {
336
- endIcon: /* @__PURE__ */ e(k, {}),
337
- isChecked: s.is_enabled,
338
- isDisabled: !s.is_enabled,
339
- onClick: () => l(s.guid),
340
- onToggle: () => r(s),
341
- primaryText: s.label,
342
- secondaryText: s.is_enabled ? s.deliveryMethodsLabel : void 0
343
- },
344
- s.guid
345
- )),
346
- /* @__PURE__ */ e(
347
- J,
348
- {
349
- isOpen: !!i,
350
- onClose: () => l(""),
351
- title: i ? i.label : "",
352
- children: i && /* @__PURE__ */ e(
353
- ve,
354
- {
355
- onUpdateProfile: a,
356
- profile: i
357
- }
358
- )
359
- }
360
- )
361
- ] });
362
- }), q = x(({ profile: n }) => {
363
- const { settings: t } = D(), {
364
- clientCommunicationProfile: {
365
- email_notifications_enabled: o,
366
- push_notifications_enabled: l,
367
- sms_notifications_enabled: i
368
- },
369
- updateNotificationProfile: r,
370
- userCommunicationsProfile: {
371
- opted_out_of_email_notifications: a,
372
- opted_out_of_push_notifications: s,
373
- opted_out_of_sms_notifications: d
374
- }
375
- } = T(), { user: m } = w(), [_, u] = f.useState(!1), g = async () => {
376
- await p({ ...n, is_enabled: !n.is_enabled }), n.is_enabled && u(!1);
377
- }, p = async (S) => {
378
- await r(S);
379
- }, y = o || i || l;
380
- return /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
381
- /* @__PURE__ */ e(
382
- F,
383
- {
384
- endIcon: y ? /* @__PURE__ */ e(
385
- K,
386
- {
387
- sx: {
388
- transition: "transform 0.3s ease-in-out",
389
- transform: _ ? "rotate(180deg)" : "rotate(0deg)"
390
- }
391
- }
392
- ) : void 0,
393
- isChecked: n.is_enabled,
394
- isDisabled: !n.is_enabled,
395
- onClick: () => u(!_),
396
- onToggle: () => g(),
397
- primaryText: n.label,
398
- secondaryText: n.is_enabled ? n.deliveryMethodsLabel : void 0
399
- },
400
- n.guid
401
- ),
402
- y && /* @__PURE__ */ e(_e, { in: _, children: /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
403
- o && /* @__PURE__ */ e(
404
- P,
405
- {
406
- isChecked: !a && n.email_channel && !!m.email,
407
- isDisabled: a || !m.email,
408
- onToggle: () => p({
409
- ...n,
410
- email_channel: !n.email_channel
411
- }),
412
- primaryText: t.delivery_method_email_label
413
- }
414
- ),
415
- o && (i || l) && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
416
- i && /* @__PURE__ */ e(
417
- P,
418
- {
419
- isChecked: !d && n.sms_channel && !!m.phone,
420
- isDisabled: d || !m.phone,
421
- onToggle: () => p({
422
- ...n,
423
- sms_channel: !n.sms_channel
424
- }),
425
- primaryText: t.delivery_method_sms_label
426
- }
427
- ),
428
- i && l && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
429
- l && /* @__PURE__ */ e(
430
- P,
431
- {
432
- isChecked: !s && n.push_channel,
433
- isDisabled: s,
434
- onToggle: () => p({
435
- ...n,
436
- push_channel: !n.push_channel
437
- }),
438
- primaryText: t.delivery_method_push_label
439
- }
440
- )
441
- ] }) }),
442
- /* @__PURE__ */ e(v, {})
443
- ] }, n.guid);
444
- }), z = x(() => {
445
- const { budgetProfiles: n } = T();
446
- return /* @__PURE__ */ e(h, { children: n.map((t) => /* @__PURE__ */ e(q, { profile: t }, t.guid)) });
447
- }), Te = x(() => {
448
- const { onEvent: n } = ae(), { settings: t } = D(), {
449
- clientCommunicationProfile: o,
450
- updateUserCommunicationProfile: l,
451
- userCommunicationsProfile: i
452
- } = T(), { user: r } = w(), a = async (s, d) => {
453
- const m = { ...i, [s]: d };
454
- if (n) {
455
- const u = s.split("_")[3];
456
- d === !1 ? n("opt_in_notification_method", { notificationType: u }) : n("opt_out_notification_method", { notificationType: u });
457
- }
458
- await l(m);
459
- };
460
- return /* @__PURE__ */ c(h, { children: [
461
- /* @__PURE__ */ e(U, { sx: { mt: 24 }, children: t.delivery_method_title }),
462
- o.email_notifications_enabled && /* @__PURE__ */ c(M, { children: [
463
- /* @__PURE__ */ e(
464
- P,
465
- {
466
- isChecked: !!r.email && !i.opted_out_of_email_notifications,
467
- isDisabled: !r.email,
468
- onToggle: () => a(
469
- "opted_out_of_email_notifications",
470
- !i.opted_out_of_email_notifications
471
- ),
472
- primaryText: t.delivery_method_email_title,
473
- secondaryText: r.email && !i.opted_out_of_email_notifications ? t.notification_enabled : t.notification_disabled,
474
- useExtraPadding: !1
475
- }
476
- ),
477
- (o.sms_notifications_enabled || o.push_notifications_enabled) && /* @__PURE__ */ e(v, {})
478
- ] }),
479
- o.sms_notifications_enabled && /* @__PURE__ */ c(M, { children: [
480
- /* @__PURE__ */ e(
481
- P,
482
- {
483
- isChecked: !!r.phone && !i.opted_out_of_sms_notifications,
484
- isDisabled: !r.phone,
485
- onToggle: () => a("opted_out_of_sms_notifications", !i.opted_out_of_sms_notifications),
486
- primaryText: t.delivery_method_sms_title,
487
- secondaryText: r.phone && !i.opted_out_of_sms_notifications ? t.notification_enabled : t.notification_disabled,
488
- useExtraPadding: !1
489
- }
490
- ),
491
- o.push_notifications_enabled && /* @__PURE__ */ e(v, {})
492
- ] }),
493
- o.push_notifications_enabled && /* @__PURE__ */ e(
494
- P,
495
- {
496
- isChecked: !i.opted_out_of_push_notifications,
497
- isDisabled: !0,
498
- onToggle: () => {
499
- },
500
- primaryText: t.delivery_method_push_title,
501
- secondaryText: t.delivery_method_push_subtitle,
502
- useExtraPadding: !1
503
- }
504
- ),
505
- o.sms_notifications_enabled && /* @__PURE__ */ e(ue, { sx: { backgroundColor: "background.default", mt: 12 }, variant: "outlined", children: /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ c(h, { alignItems: "flex-start", direction: "row", gap: 6, children: [
506
- /* @__PURE__ */ e(Q, { color: "primary", filled: !0 }),
507
- /* @__PURE__ */ e(b, { sx: { whiteSpace: "wrap" }, variant: "XSmall", children: t.delivery_method_sms_note_1 })
508
- ] }) }) })
509
- ] });
510
- }), $ = x(() => {
511
- const { insightsProfiles: n } = T();
512
- return /* @__PURE__ */ e(h, { children: n.map((t) => /* @__PURE__ */ e(q, { profile: t }, t.guid)) });
513
- }), Pe = () => {
514
- const { config: n } = W(), [t, { width: o }] = fe(), { common: l, settings: i } = D(), { updateUser: r } = T(), { user: a } = w(), [s, d] = f.useState(!1), [m, _] = f.useState({
515
- email: a.email,
516
- phone: a.phone
517
- }), u = m.email && !a.email_is_verified && !s, g = m.phone && !a.phone_is_verified && !s, p = (S) => {
518
- const { name: A, value: I } = S.target, j = { ...m, [A]: I };
519
- _(j), d(JSON.stringify({ ...a, ...j }) !== JSON.stringify(a));
520
- }, y = async () => {
521
- await r({ ...a, ...m }), d(!1);
522
- };
523
- return /* @__PURE__ */ c(h, { ref: t, children: [
524
- /* @__PURE__ */ e(v, {}),
525
- /* @__PURE__ */ c(h, { sx: { pt: 12 }, children: [
526
- /* @__PURE__ */ e(U, { sx: { lineHeight: "20px", pb: 4, pt: 16 }, children: i.personal_details }),
527
- /* @__PURE__ */ c(h, { sx: { flexDirection: o <= 768 ? "column" : "row", gap: 24, py: 16 }, children: [
528
- n.display_email_edit_field_in_settings && /* @__PURE__ */ c(h, { sx: { flex: 1, pb: 14 }, children: [
529
- /* @__PURE__ */ e(
530
- L,
531
- {
532
- defaultValue: a.email,
533
- fullWidth: !0,
534
- label: i.email_address,
535
- name: "email",
536
- onChange: p
537
- }
538
- ),
539
- u && /* @__PURE__ */ e(
540
- G,
541
- {
542
- sx: {
543
- height: 20,
544
- ".MuiButton-root": {
545
- px: 0,
546
- ":hover": {
547
- bgcolor: "transparent"
548
- }
549
- }
550
- },
551
- children: /* @__PURE__ */ e(ye, {})
552
- }
553
- )
554
- ] }),
555
- n.display_sms_edit_field_in_settings && /* @__PURE__ */ c(h, { sx: { flex: 1, pb: 14 }, children: [
556
- /* @__PURE__ */ e(
557
- L,
558
- {
559
- defaultValue: a.phone,
560
- fullWidth: !0,
561
- label: i.mobile_number,
562
- name: "phone",
563
- onChange: p
564
- }
565
- ),
566
- g && /* @__PURE__ */ e(
567
- G,
568
- {
569
- sx: {
570
- height: 20,
571
- ".MuiButton-root": {
572
- px: 0,
573
- ":hover": {
574
- bgcolor: "transparent"
575
- }
576
- }
577
- },
578
- children: /* @__PURE__ */ e(xe, {})
579
- }
580
- )
581
- ] })
582
- ] }),
583
- /* @__PURE__ */ e(
584
- R,
585
- {
586
- disabled: !s,
587
- onClick: y,
588
- sx: { width: 84 },
589
- variant: "contained",
590
- children: l.save_button
591
- }
592
- )
593
- ] })
594
- ] });
595
- }, De = x(Pe), st = x(
596
- ({ notificationTypes: n = [], showPersonalDetails: t = !1, view: o }) => {
597
- const { config: l } = W(), { settings: i } = D(), { isInitialized: r } = ce(), { clientCommunicationProfile: a, loadNotificationProfiles: s } = T(), [d, m] = f.useState(
598
- void 0
599
- );
600
- if (console.log("view from NotificationSettings component", o, typeof o), f.useEffect(() => {
601
- r && s().finally();
602
- }, [r]), !r)
603
- return /* @__PURE__ */ e(ge, {});
604
- let _ = i.manage_account_notifications;
605
- d === C.Budgets ? _ = i.manage_budget_notifications : d === C.Insights && (_ = i.manage_insights_notifications);
606
- const {
607
- email_notifications_enabled: u,
608
- sms_notifications_enabled: g,
609
- push_notifications_enabled: p
610
- } = a, y = u || g || p;
611
- if (o === "accounts")
612
- return /* @__PURE__ */ e(H, {});
613
- if (o === "budgets")
614
- return /* @__PURE__ */ e(z, {});
615
- if (o === "insights")
616
- return console.log("view is insights"), /* @__PURE__ */ e($, {});
617
- const S = l.display_email_edit_field_in_settings || l.display_sms_edit_field_in_settings, A = t && a.can_edit_contact_info && S;
618
- return /* @__PURE__ */ c(h, { sx: { pt: y ? 0 : 24 }, children: [
619
- /* @__PURE__ */ c(h, { sx: { px: 24 }, children: [
620
- y && /* @__PURE__ */ c(M, { children: [
621
- /* @__PURE__ */ e(Te, {}),
622
- /* @__PURE__ */ e(v, { sx: { my: 24 } })
623
- ] }),
624
- /* @__PURE__ */ e(U, { sx: { mb: 4 }, children: i.notification_types_title })
625
- ] }),
626
- /* @__PURE__ */ c(E, { children: [
627
- n.includes(C.Accounts) && /* @__PURE__ */ e(N, { children: /* @__PURE__ */ c(V, { onClick: () => m(C.Accounts), children: [
628
- /* @__PURE__ */ e(O, { primary: i.accounts_title, secondary: i.accounts_subtitle }),
629
- /* @__PURE__ */ e(k, {})
630
- ] }) }),
631
- n.includes(C.Budgets) && /* @__PURE__ */ e(N, { children: /* @__PURE__ */ c(V, { onClick: () => m(C.Budgets), children: [
632
- /* @__PURE__ */ e(O, { primary: i.budgets_title, secondary: i.budgets_subtitle }),
633
- /* @__PURE__ */ e(k, {})
634
- ] }) }),
635
- n.includes(C.Insights) && /* @__PURE__ */ e(N, { children: /* @__PURE__ */ c(V, { onClick: () => m(C.Insights), children: [
636
- /* @__PURE__ */ e(O, { primary: i.insights_title, secondary: i.insights_subtitle }),
637
- /* @__PURE__ */ e(k, {})
638
- ] }) })
639
- ] }),
640
- A && /* @__PURE__ */ e(h, { sx: { px: 24 }, children: /* @__PURE__ */ e(De, {}) }),
641
- /* @__PURE__ */ e(
642
- J,
643
- {
644
- isOpen: !!d,
645
- onClose: () => m(void 0),
646
- title: _,
647
- children: /* @__PURE__ */ c(h, { children: [
648
- d === C.Accounts && /* @__PURE__ */ e(H, {}),
649
- d === C.Budgets && /* @__PURE__ */ e(z, {}),
650
- d === C.Insights && /* @__PURE__ */ e($, {})
651
- ] })
652
- }
653
- )
654
- ] });
655
- }
656
- );
657
- export {
658
- H as A,
659
- z as B,
660
- $ as I,
661
- st as N,
662
- ye as V,
663
- xe as a
664
- };