@mx-cartographer/experiences 8.0.0-alpha.sms2 → 9.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 (139) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/dist/{Account-Cp30A3ad.mjs → Account-BIKn4XEZ.mjs} +1 -1
  3. package/dist/Account-CMjOp7S2.mjs +118 -0
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/AccountDetailsHeader-BOV91g1o.mjs +95 -0
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-CW6cIthP.mjs → AccountFields-BRRH37K1.mjs} +10 -11
  8. package/dist/{AccountListItem-DxmAs98Z.mjs → AccountListItem-Ds5C0mOT.mjs} +4 -4
  9. package/dist/{AccountStore-hIs-yA6W.mjs → AccountStore-BFKvXJSD.mjs} +79 -69
  10. package/dist/{Accounts-DUHkUyK4.mjs → Accounts-CuE8aSZN.mjs} +1 -1
  11. package/dist/{BudgetUtil-CIDAPPPT.mjs → BudgetUtil-CDSOZXem.mjs} +4 -4
  12. package/dist/CategorySelectorDrawer-C4aZYP4N.mjs +418 -0
  13. package/dist/CategoryStore-DEqAnHbi.mjs +186 -0
  14. package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-CFHBvaV4.mjs} +1 -1
  15. package/dist/{ConnectionsDrawer-CSo6AFkG.mjs → ConnectionsDrawer-BExzgE16.mjs} +5 -5
  16. package/dist/{CurrencyInput-BrGvhgVK.mjs → CurrencyInput-DDQ4DBrE.mjs} +1 -1
  17. package/dist/{CurrencyText-Dr0EZ7bp.mjs → CurrencyText-C-85TnUF.mjs} +3 -3
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CVsMhbZU.mjs} +3 -3
  19. package/dist/{DebtsStore-hi1cqrRk.mjs → DebtsStore-Dv_T7Dts.mjs} +12 -12
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-CWymUiuO.mjs} +32 -35
  21. package/dist/Drawer-Bet2ZPJo.mjs +176 -0
  22. package/dist/{ExportCsvAction-CQ1grpwo.mjs → ExportCsvAction-oG_Mn66T.mjs} +3 -3
  23. package/dist/{FinstrongStore-dKZOZ2hM.mjs → FinstrongStore-BjFkMTIL.mjs} +6 -6
  24. package/dist/GlobalAccountFilter-BpWlPAl5.mjs +316 -0
  25. package/dist/{GoalStore-CFeAJloA.mjs → GoalStore-Dbjgft2i.mjs} +155 -137
  26. package/dist/{Help-i4OasOO-.mjs → Help-BW_ar-4B.mjs} +2 -2
  27. package/dist/LineChart-DHj-Bufi.mjs +580 -0
  28. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-Cbr3417C.mjs} +10 -10
  29. package/dist/{ManageIncome-D_qVX5dN.mjs → ManageIncome-DIIyqDTp.mjs} +85 -85
  30. package/dist/{MicroWidgetContainer-BGpNl5ZS.mjs → MicroWidgetContainer-DSyYwRCU.mjs} +2 -2
  31. package/dist/{MiniWidgetContainer-D7MkHG15.mjs → MiniWidgetContainer-DKn7ndO6.mjs} +1 -1
  32. package/dist/NetWorthStore-B6ziBtaH.mjs +168 -0
  33. package/dist/NotificationSettings-e789PcRb.mjs +676 -0
  34. package/dist/{OriginalBalanceAction-62e0mU_3.mjs → OriginalBalanceAction-DFoG79Ba.mjs} +3 -3
  35. package/dist/{RecurringSettings-RfZ8Wuhh.mjs → RecurringSettings-BpCUcE8w.mjs} +4 -4
  36. package/dist/{RecurringTransactionsStore-D3EOKZ2B.mjs → RecurringTransactionsStore-D_--5PWH.mjs} +1 -1
  37. package/dist/{RecurringTransactions-Bhx56aA3.mjs → RepeatingTransaction-C2txVA9O.mjs} +3 -3
  38. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-CInvh-rQ.mjs} +1 -1
  39. package/dist/SpendingData-B7NuTQ9s.mjs +53 -0
  40. package/dist/SpendingLegend-BxefXiQd.mjs +193 -0
  41. package/dist/TransactionDetails-CPwv9xtZ.mjs +1374 -0
  42. package/dist/{TransactionStore-DgLrYW4C.mjs → TransactionStore-D2aMUClq.mjs} +128 -111
  43. package/dist/TrendsStore-BdsYfCc7.mjs +183 -0
  44. package/dist/{User-DqNX2GAK.mjs → User-CulNdZUr.mjs} +21 -20
  45. package/dist/ViewMoreMicroCard-CDWR16_h.mjs +1147 -0
  46. package/dist/WidgetContainer-mzejMmz2.mjs +555 -0
  47. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +1 -0
  48. package/dist/accounts/index.es.js +933 -232
  49. package/dist/accounts/stores/AccountStore.d.ts +6 -2
  50. package/dist/accounts/utils/AccountDetails.d.ts +5 -0
  51. package/dist/analytics/index.es.js +2 -2
  52. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  53. package/dist/budgets/index.es.js +561 -522
  54. package/dist/cashflow/index.es.js +397 -396
  55. package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
  56. package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
  57. package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
  58. package/dist/categories/components/SubcategoryRow.d.ts +1 -0
  59. package/dist/categories/index.es.js +2 -2
  60. package/dist/categories/stores/CategoryStore.d.ts +5 -3
  61. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  62. package/dist/common/components/WidgetContainer.d.ts +7 -6
  63. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  64. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  65. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  66. package/dist/common/components/index.d.ts +2 -2
  67. package/dist/common/hooks/index.d.ts +1 -0
  68. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  69. package/dist/common/index.es.js +325 -306
  70. package/dist/common/stores/GlobalUiStore.d.ts +7 -4
  71. package/dist/common/types/localization/AccountsCopy.d.ts +6 -0
  72. package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
  73. package/dist/common/types/localization/CommonCopy.d.ts +3 -0
  74. package/dist/common/types/localization/GoalsCopy.d.ts +3 -1
  75. package/dist/common/types/localization/MicroInsightsCopy.d.ts +1 -0
  76. package/dist/common/types/localization/TransactionsCopy.d.ts +4 -0
  77. package/dist/common/types/localization/TrendsCopy.d.ts +4 -0
  78. package/dist/dashboard/index.es.js +95 -125
  79. package/dist/debts/index.es.js +466 -460
  80. package/dist/{exportTransactionsToCSV-BFpuIAXW.mjs → exportTransactionsToCSV-BU1jTY0Q.mjs} +4 -4
  81. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  82. package/dist/finstrong/index.es.js +1660 -1553
  83. package/dist/goals/index.es.js +716 -677
  84. package/dist/goals/stores/GoalStore.d.ts +2 -0
  85. package/dist/help/index.es.js +14 -10
  86. package/dist/{hooks-C41HAxM5.mjs → hooks-fY_n74f7.mjs} +16 -16
  87. package/dist/investments/index.es.js +464 -457
  88. package/dist/merchants/index.es.js +1 -1
  89. package/dist/microinsights/MicroCardTemplate.d.ts +23 -0
  90. package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +8 -0
  91. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +1 -2
  92. package/dist/microinsights/beaticons/index.d.ts +1 -0
  93. package/dist/microinsights/cards/InsightCard.d.ts +0 -2
  94. package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
  95. package/dist/microinsights/index.d.ts +2 -2
  96. package/dist/microinsights/index.es.js +824 -14
  97. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  98. package/dist/networth/components/NetWorthList.d.ts +3 -3
  99. package/dist/networth/index.es.js +433 -438
  100. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  101. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  102. package/dist/notifications/index.es.js +5 -5
  103. package/dist/recurringtransactions/index.es.js +331 -325
  104. package/dist/settings/index.es.js +293 -285
  105. package/dist/spending/components/SpendingChart.d.ts +1 -1
  106. package/dist/spending/components/SpendingList.d.ts +1 -1
  107. package/dist/spending/components/SpendingTabLabel.d.ts +1 -0
  108. package/dist/spending/index.es.js +250 -235
  109. package/dist/transactions/index.es.js +288 -281
  110. package/dist/transactions/stores/TransactionStore.d.ts +5 -0
  111. package/dist/trends/components/TrendsTable.d.ts +0 -2
  112. package/dist/trends/index.es.js +876 -802
  113. package/dist/trends/utils/TrendsData.d.ts +1 -0
  114. package/dist/trends/utils/TrendsTable.d.ts +12 -0
  115. package/dist/{useAccountDisplayName-usSZCQ7I.mjs → useAccountDisplayName-DbkgGLdg.mjs} +2 -2
  116. package/dist/useAriaLive-B3_pRUio.mjs +35 -0
  117. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-dhmXeSyF.mjs} +1 -1
  118. package/dist/useWidgetLoadTimer-CrUzxN-P.mjs +19 -0
  119. package/package.json +26 -21
  120. package/dist/AccountDetailsContent-C1HumFnW.mjs +0 -683
  121. package/dist/AccountDetailsHeader-NMx79DGs.mjs +0 -87
  122. package/dist/CategorySelectorDrawer-DqDAA_5I.mjs +0 -399
  123. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  124. package/dist/ConnectDrawer-Dn1MlqLz.mjs +0 -545
  125. package/dist/Drawer-Dqe5EqvA.mjs +0 -163
  126. package/dist/LineChart-bc1D9xBE.mjs +0 -581
  127. package/dist/NetWorthStore-8FFC1Bs0.mjs +0 -150
  128. package/dist/NotificationSettings-BsWiYD94.mjs +0 -672
  129. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  130. package/dist/SpendingLegend-CZzDb-7d.mjs +0 -193
  131. package/dist/TransactionDetails-Duv1X9ec.mjs +0 -1379
  132. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  133. package/dist/ViewMoreMicroCard-CH9E-jOx.mjs +0 -1930
  134. package/dist/WidgetContainer-B1Jzb4XA.mjs +0 -565
  135. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  136. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  137. package/dist/common/components/accountfilter/index.d.ts +0 -1
  138. package/dist/microinsights/cards/BaseCard.d.ts +0 -13
  139. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -0,0 +1,676 @@
1
+ import { jsxs as c, jsx as e, Fragment as M } from "react/jsx-runtime";
2
+ import p 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 L from "@mui/material/ListItemText";
8
+ import V from "@mui/material/ListItemButton";
9
+ import h from "@mui/material/Stack";
10
+ import { ChevronRight as w, ExpandMore as ee, Star as te } from "@mxenabled/mx-icons";
11
+ import { Text as x, InstitutionLogo as ne, H3 as F } from "@mxenabled/mxui";
12
+ import { endOfMonth as ie } from "date-fns/endOfMonth";
13
+ import { startOfMonth as oe } from "date-fns/startOfMonth";
14
+ import { DateCalendar as se } from "@mui/x-date-pickers/DateCalendar";
15
+ import { LocalizationProvider as ae } from "@mui/x-date-pickers/LocalizationProvider";
16
+ import { AdapterDateFns as ce } from "@mui/x-date-pickers/AdapterDateFnsV3";
17
+ import { A as le, T as R, a as D, N as b } from "./Notification-Bs1fdbzI.mjs";
18
+ import { a as N } from "./Dialog-CWymUiuO.mjs";
19
+ import { C as re } from "./CurrencyInput-DDQ4DBrE.mjs";
20
+ import { u as S, r as T, o as A, d as J, g as de, a as X, b as me } from "./hooks-fY_n74f7.mjs";
21
+ import { b as he } from "./Localization-2MODESHW.mjs";
22
+ import { b as _e, f as ue } from "./NumberFormatting-DjTD0t3W.mjs";
23
+ import { u as pe } from "./useScreenSize-B6JyS_Lj.mjs";
24
+ import { D as q } from "./Drawer-Bet2ZPJo.mjs";
25
+ import fe from "@mui/material/Collapse";
26
+ import ge from "@mui/material/Card";
27
+ import ye from "@mui/material/CardContent";
28
+ import H from "@mui/material/Box";
29
+ import j from "@mui/material/Button";
30
+ import U from "@mui/material/TextField";
31
+ import { u as be } from "./useDimensions-27p2evRx.mjs";
32
+ import K from "@mui/material/styles/useTheme";
33
+ import { u as xe } from "./useInsightsEnabled-dhmXeSyF.mjs";
34
+ import { L as Ce } from "./Loader-BSWSYqvn.mjs";
35
+ import { u as ve } from "./useWidgetLoadTimer-CrUzxN-P.mjs";
36
+ const Te = C(() => {
37
+ const { common: n, settings: t } = S(), { sendEmailVerification: s } = T(), { user: l } = A(), i = K(), [r, a] = p.useState(!1), o = () => {
38
+ a(!1);
39
+ }, _ = () => {
40
+ a(!0);
41
+ };
42
+ return /* @__PURE__ */ c(p.Fragment, { children: [
43
+ /* @__PURE__ */ c(j, { onClick: _, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
44
+ /* @__PURE__ */ e(x, { variant: "Small", children: t.verify_email }),
45
+ /* @__PURE__ */ e(w, {})
46
+ ] }),
47
+ /* @__PURE__ */ e(
48
+ N,
49
+ {
50
+ copy: { title: "" },
51
+ isOpen: r,
52
+ onClose: o,
53
+ onPrimaryAction: s,
54
+ onSecondaryAction: o,
55
+ primaryText: t.send_verification,
56
+ secondaryText: n.back,
57
+ sx: {
58
+ "& .MuiDialogContent-root": { pt: 0, width: 400 },
59
+ "& .MuiToolbar-root:last-child": {
60
+ gap: 16,
61
+ padding: "32px 60px 48px",
62
+ justifyContent: "center"
63
+ }
64
+ },
65
+ children: /* @__PURE__ */ c(h, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
66
+ /* @__PURE__ */ e(x, { bold: !0, truncate: !1, variant: "Body", children: t.confirm_your_email }),
67
+ /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.confirm_email }),
68
+ /* @__PURE__ */ e(
69
+ x,
70
+ {
71
+ sx: {
72
+ border: `1px solid ${i.palette.border.light}`,
73
+ borderRadius: "4px",
74
+ p: "16px 32px"
75
+ },
76
+ variant: "H3",
77
+ children: l.email
78
+ }
79
+ ),
80
+ /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.verification_notice_email })
81
+ ] })
82
+ }
83
+ )
84
+ ] });
85
+ }), Pe = C(
86
+ ({ handleClose: n, handleVerify: t, isOpen: s }) => {
87
+ const { common: l, settings: i } = S(), [r, a] = p.useState("");
88
+ return /* @__PURE__ */ e(
89
+ N,
90
+ {
91
+ copy: { title: i.enter_verification_code },
92
+ isOpen: s,
93
+ onClose: n,
94
+ onPrimaryAction: () => t(r),
95
+ onSecondaryAction: n,
96
+ primaryText: i.verify,
97
+ secondaryText: l.cancel_button,
98
+ sx: {
99
+ "& .MuiDialogContent-root": { pt: 0, width: 400 },
100
+ "& .MuiToolbar-root:last-child": {
101
+ gap: 8,
102
+ padding: 24,
103
+ justifyContent: "flex-end"
104
+ }
105
+ },
106
+ children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(U, { onChange: (o) => a(o.target.value), sx: { width: 352 }, value: r }) })
107
+ }
108
+ );
109
+ }
110
+ ), De = C(() => {
111
+ const { common: n, settings: t } = S(), { sendPhoneVerification: s, verifyPhoneToken: l } = T(), { user: i } = A(), r = K(), [a, o] = p.useState(!1), [_, d] = p.useState(!1), f = () => {
112
+ o(!1);
113
+ }, u = () => {
114
+ o(!0);
115
+ }, y = () => {
116
+ s().finally(() => {
117
+ d(!0);
118
+ });
119
+ }, m = (g) => {
120
+ l(g).finally(() => {
121
+ d(!1);
122
+ });
123
+ };
124
+ return /* @__PURE__ */ c(p.Fragment, { children: [
125
+ /* @__PURE__ */ c(j, { onClick: u, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
126
+ /* @__PURE__ */ e(x, { variant: "Small", children: t.verify_phone }),
127
+ /* @__PURE__ */ e(w, {})
128
+ ] }),
129
+ /* @__PURE__ */ e(
130
+ N,
131
+ {
132
+ copy: { title: "" },
133
+ isOpen: a,
134
+ onClose: f,
135
+ onPrimaryAction: y,
136
+ onSecondaryAction: f,
137
+ primaryText: t.send_verification,
138
+ secondaryText: n.back,
139
+ sx: {
140
+ "& .MuiDialogContent-root": { pt: 0, width: 400 },
141
+ "& .MuiToolbar-root:last-child": {
142
+ gap: 16,
143
+ padding: "32px 60px 48px",
144
+ justifyContent: "center"
145
+ }
146
+ },
147
+ children: /* @__PURE__ */ c(h, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
148
+ /* @__PURE__ */ e(x, { bold: !0, truncate: !1, variant: "Body", children: t.confirm_your_phone }),
149
+ /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.confirm_phone }),
150
+ /* @__PURE__ */ e(
151
+ x,
152
+ {
153
+ sx: {
154
+ border: `1px solid ${r.palette.border.light}`,
155
+ borderRadius: "4px",
156
+ p: "16px 32px"
157
+ },
158
+ variant: "H3",
159
+ children: i.phone
160
+ }
161
+ ),
162
+ /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.verification_notice_phone })
163
+ ] })
164
+ }
165
+ ),
166
+ /* @__PURE__ */ e(
167
+ Pe,
168
+ {
169
+ handleClose: () => d(!1),
170
+ handleVerify: m,
171
+ isOpen: _
172
+ }
173
+ )
174
+ ] });
175
+ }), Se = C(
176
+ ({ onProfileUpdated: n, profile: t }) => {
177
+ const { common: s, recurring: l, settings: i } = S(), { updateAccount: r } = J(), a = t.notification_type === le.DebtPaymentReminder, [o, _] = p.useState(!1), [d, f] = p.useState(t.threshold || 0), [u, y] = p.useState(
178
+ t.account?.day_payment_is_due || 0
179
+ ), m = t.account?.name || t.account?.feed_name || "", g = t.account?.day_payment_is_due ? he(
180
+ i.notification_debt_payment_date,
181
+ _e(t.account?.day_payment_is_due)
182
+ ) : i.notification_debt_payment_zero_state, P = a ? g : ue(t.threshold ?? 0, "0,0"), I = async () => {
183
+ a && t.account ? await r({ ...t.account, day_payment_is_due: u }) : n({ ...t, threshold: d });
184
+ };
185
+ return /* @__PURE__ */ c(h, { children: [
186
+ /* @__PURE__ */ e(
187
+ R,
188
+ {
189
+ avatar: t.account?.institution_guid ? /* @__PURE__ */ e(
190
+ ne,
191
+ {
192
+ alt: t.label,
193
+ institutionGuid: t.account?.institution_guid
194
+ }
195
+ ) : void 0,
196
+ endIcon: /* @__PURE__ */ e(w, {}),
197
+ isChecked: t.is_enabled,
198
+ isDisabled: !t.is_enabled,
199
+ isPrimaryTextBold: !0,
200
+ onClick: () => _(!0),
201
+ onToggle: () => n({
202
+ ...t,
203
+ is_enabled: !t.is_enabled
204
+ }),
205
+ primaryText: m,
206
+ secondaryText: t.is_enabled ? P : i.notification_disabled
207
+ }
208
+ ),
209
+ /* @__PURE__ */ e(
210
+ N,
211
+ {
212
+ copy: {
213
+ title: a ? l.day_of_the_month : i.notification_threshold_label,
214
+ close_aria: s.close_aria
215
+ },
216
+ disablePrimaryButton: a && u === 0,
217
+ isOpen: o,
218
+ onClose: () => _(!1),
219
+ onPrimaryAction: I,
220
+ primaryText: s.save_button,
221
+ children: a ? /* @__PURE__ */ e(ae, { dateAdapter: ce, children: /* @__PURE__ */ e(
222
+ se,
223
+ {
224
+ maxDate: ie(/* @__PURE__ */ new Date()),
225
+ minDate: oe(/* @__PURE__ */ new Date()),
226
+ onChange: (k) => {
227
+ y(k.getDate());
228
+ },
229
+ slots: {
230
+ // Hides the arrows
231
+ leftArrowIcon: () => null,
232
+ rightArrowIcon: () => null
233
+ },
234
+ sx: {
235
+ // TODO: Needs to be updated in MXUI
236
+ "& .MuiPickersDay-today": {
237
+ color: "primary.main"
238
+ }
239
+ },
240
+ views: ["day"]
241
+ }
242
+ ) }) : /* @__PURE__ */ e(
243
+ re,
244
+ {
245
+ amount: d,
246
+ autoFocus: !0,
247
+ fullWidth: !0,
248
+ minAmount: 0,
249
+ setAmount: (k) => f(Number(k) || 0),
250
+ sx: { ".MuiTypography-Body": { p: 0 } }
251
+ }
252
+ )
253
+ }
254
+ )
255
+ ] });
256
+ }
257
+ ), ke = C(
258
+ ({ onUpdateProfile: n, profile: t }) => {
259
+ const { settings: s } = S(), { user: l } = A(), { clientCommunicationProfile: i, userCommunicationsProfile: r } = T(), { isMobile: a } = pe(), o = t.notification_type > 2, {
260
+ opted_out_of_email_notifications: _,
261
+ opted_out_of_push_notifications: d,
262
+ opted_out_of_sms_notifications: f
263
+ } = r, {
264
+ email_notifications_enabled: u,
265
+ push_notifications_enabled: y,
266
+ sms_notifications_enabled: m
267
+ } = i;
268
+ return /* @__PURE__ */ c(h, { children: [
269
+ (u || m || y) && /* @__PURE__ */ c(M, { children: [
270
+ /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.delivery_method_title }),
271
+ /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
272
+ u && /* @__PURE__ */ e(h, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
273
+ D,
274
+ {
275
+ isChecked: !_ && t.email_channel && !!l.email,
276
+ isDisabled: _ || !l.email,
277
+ onToggle: () => n({ ...t, email_channel: !t.email_channel }),
278
+ primaryText: s.delivery_method_email_label,
279
+ secondaryText: _ || !t.email_channel || !l.email ? s.notification_disabled : s.notification_enabled,
280
+ useExtraPadding: !1
281
+ }
282
+ ) }),
283
+ u && (m || y) && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
284
+ m && /* @__PURE__ */ e(h, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
285
+ D,
286
+ {
287
+ isChecked: !f && t.sms_channel && !!l.phone,
288
+ isDisabled: f || !l.phone,
289
+ onToggle: () => n({ ...t, sms_channel: !t.sms_channel }),
290
+ primaryText: `${s.delivery_method_sms_label}`,
291
+ secondaryText: f || !t.sms_channel || !l.phone ? s.notification_disabled : s.notification_enabled,
292
+ useExtraPadding: !1
293
+ }
294
+ ) }),
295
+ m && y && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
296
+ y && /* @__PURE__ */ e(h, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
297
+ D,
298
+ {
299
+ isChecked: !d && t.push_channel,
300
+ isDisabled: d,
301
+ onToggle: () => n({ ...t, push_channel: !t.push_channel }),
302
+ primaryText: s.delivery_method_push_label,
303
+ secondaryText: s.delivery_method_push_subtitle,
304
+ useExtraPadding: !1
305
+ }
306
+ ) }),
307
+ /* @__PURE__ */ e(v, {})
308
+ ] })
309
+ ] }),
310
+ o && !!t.children?.length && /* @__PURE__ */ c(h, { children: [
311
+ /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.accounts_threshold_title }),
312
+ /* @__PURE__ */ e(E, { sx: { bgcolor: "background.paper" }, children: t.children?.map((g) => /* @__PURE__ */ e(
313
+ Se,
314
+ {
315
+ onProfileUpdated: n,
316
+ profile: g
317
+ },
318
+ g.guid
319
+ )) })
320
+ ] })
321
+ ] });
322
+ }
323
+ ), W = C(() => {
324
+ const { accountProfiles: n, updateNotificationProfile: t } = T(), [s, l] = p.useState(""), i = p.useMemo(
325
+ () => n.find((o) => o.guid === s),
326
+ [n, s]
327
+ ), r = async (o) => {
328
+ await t({
329
+ ...o,
330
+ is_enabled: !o.is_enabled
331
+ });
332
+ }, a = async (o) => {
333
+ await t(o);
334
+ };
335
+ return /* @__PURE__ */ c(h, { sx: { backgroundColor: "background.paper" }, children: [
336
+ n.filter((o) => o.children && o.children.length > 0).map((o) => /* @__PURE__ */ e(
337
+ R,
338
+ {
339
+ endIcon: /* @__PURE__ */ e(w, {}),
340
+ isChecked: o.is_enabled,
341
+ isDisabled: !o.is_enabled,
342
+ onClick: () => l(o.guid),
343
+ onToggle: () => r(o),
344
+ primaryText: o.label,
345
+ secondaryText: o.is_enabled ? o.deliveryMethodsLabel : void 0
346
+ },
347
+ o.guid
348
+ )),
349
+ /* @__PURE__ */ e(
350
+ q,
351
+ {
352
+ isOpen: !!i,
353
+ onClose: () => l(""),
354
+ title: i ? i.label : "",
355
+ children: i && /* @__PURE__ */ e(
356
+ ke,
357
+ {
358
+ onUpdateProfile: a,
359
+ profile: i
360
+ }
361
+ )
362
+ }
363
+ )
364
+ ] });
365
+ }), Q = C(({ profile: n }) => {
366
+ const { settings: t } = S(), {
367
+ clientCommunicationProfile: {
368
+ email_notifications_enabled: s,
369
+ push_notifications_enabled: l,
370
+ sms_notifications_enabled: i
371
+ },
372
+ updateNotificationProfile: r,
373
+ userCommunicationsProfile: {
374
+ opted_out_of_email_notifications: a,
375
+ opted_out_of_push_notifications: o,
376
+ opted_out_of_sms_notifications: _
377
+ }
378
+ } = T(), { user: d } = A(), [f, u] = p.useState(!1), y = async () => {
379
+ await m({ ...n, is_enabled: !n.is_enabled }), n.is_enabled && u(!1);
380
+ }, m = async (P) => {
381
+ await r(P);
382
+ }, g = s || i || l;
383
+ return /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
384
+ /* @__PURE__ */ e(
385
+ R,
386
+ {
387
+ endIcon: g ? /* @__PURE__ */ e(
388
+ ee,
389
+ {
390
+ sx: {
391
+ transition: "transform 0.3s ease-in-out",
392
+ transform: f ? "rotate(180deg)" : "rotate(0deg)"
393
+ }
394
+ }
395
+ ) : void 0,
396
+ isChecked: n.is_enabled,
397
+ isDisabled: !n.is_enabled,
398
+ onClick: () => u(!f),
399
+ onToggle: () => y(),
400
+ primaryText: n.label,
401
+ secondaryText: n.is_enabled ? n.deliveryMethodsLabel : void 0
402
+ },
403
+ n.guid
404
+ ),
405
+ g && /* @__PURE__ */ e(fe, { in: f, children: /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
406
+ s && /* @__PURE__ */ e(
407
+ D,
408
+ {
409
+ isChecked: !a && n.email_channel && !!d.email,
410
+ isDisabled: a || !d.email,
411
+ onToggle: () => m({
412
+ ...n,
413
+ email_channel: !n.email_channel
414
+ }),
415
+ primaryText: t.delivery_method_email_label
416
+ }
417
+ ),
418
+ s && (i || l) && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
419
+ i && /* @__PURE__ */ e(
420
+ D,
421
+ {
422
+ isChecked: !_ && n.sms_channel && !!d.phone,
423
+ isDisabled: _ || !d.phone,
424
+ onToggle: () => m({
425
+ ...n,
426
+ sms_channel: !n.sms_channel
427
+ }),
428
+ primaryText: t.delivery_method_sms_label
429
+ }
430
+ ),
431
+ i && l && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
432
+ l && /* @__PURE__ */ e(
433
+ D,
434
+ {
435
+ isChecked: !o && n.push_channel,
436
+ isDisabled: o,
437
+ onToggle: () => m({
438
+ ...n,
439
+ push_channel: !n.push_channel
440
+ }),
441
+ primaryText: t.delivery_method_push_label
442
+ }
443
+ )
444
+ ] }) }),
445
+ /* @__PURE__ */ e(v, {})
446
+ ] }, n.guid);
447
+ }), z = C(() => {
448
+ const { budgetProfiles: n } = T();
449
+ return /* @__PURE__ */ e(h, { children: n.map((t) => /* @__PURE__ */ e(Q, { profile: t }, t.guid)) });
450
+ }), we = C(() => {
451
+ const { onEvent: n } = de(), { settings: t } = S(), {
452
+ clientCommunicationProfile: s,
453
+ updateUserCommunicationProfile: l,
454
+ userCommunicationsProfile: i
455
+ } = T(), { user: r } = A(), a = async (o, _) => {
456
+ const d = { ...i, [o]: _ };
457
+ if (n) {
458
+ const u = o.split("_")[3];
459
+ _ === !1 ? n("opt_in_notification_method", { notificationType: u }) : n("opt_out_notification_method", { notificationType: u });
460
+ }
461
+ await l(d);
462
+ };
463
+ return /* @__PURE__ */ c(h, { children: [
464
+ /* @__PURE__ */ e(F, { sx: { mt: 24 }, children: t.delivery_method_title }),
465
+ s.email_notifications_enabled && /* @__PURE__ */ c(M, { children: [
466
+ /* @__PURE__ */ e(
467
+ D,
468
+ {
469
+ isChecked: !!r.email && !i.opted_out_of_email_notifications,
470
+ isDisabled: !r.email,
471
+ onToggle: () => a(
472
+ "opted_out_of_email_notifications",
473
+ !i.opted_out_of_email_notifications
474
+ ),
475
+ primaryText: t.delivery_method_email_title,
476
+ secondaryText: r.email && !i.opted_out_of_email_notifications ? t.notification_enabled : t.notification_disabled,
477
+ useExtraPadding: !1
478
+ }
479
+ ),
480
+ (s.sms_notifications_enabled || s.push_notifications_enabled) && /* @__PURE__ */ e(v, {})
481
+ ] }),
482
+ s.sms_notifications_enabled && /* @__PURE__ */ c(M, { children: [
483
+ /* @__PURE__ */ e(
484
+ D,
485
+ {
486
+ isChecked: !!r.phone && !i.opted_out_of_sms_notifications,
487
+ isDisabled: !r.phone,
488
+ onToggle: () => a("opted_out_of_sms_notifications", !i.opted_out_of_sms_notifications),
489
+ primaryText: t.delivery_method_sms_title,
490
+ secondaryText: r.phone && !i.opted_out_of_sms_notifications ? t.notification_enabled : t.notification_disabled,
491
+ useExtraPadding: !1
492
+ }
493
+ ),
494
+ s.push_notifications_enabled && /* @__PURE__ */ e(v, {})
495
+ ] }),
496
+ s.push_notifications_enabled && /* @__PURE__ */ e(
497
+ D,
498
+ {
499
+ isChecked: !i.opted_out_of_push_notifications,
500
+ isDisabled: !0,
501
+ onToggle: () => {
502
+ },
503
+ primaryText: t.delivery_method_push_title,
504
+ secondaryText: t.delivery_method_push_subtitle,
505
+ useExtraPadding: !1
506
+ }
507
+ ),
508
+ s.sms_notifications_enabled && /* @__PURE__ */ e(ge, { sx: { backgroundColor: "background.default", mt: 12 }, variant: "outlined", children: /* @__PURE__ */ e(ye, { children: /* @__PURE__ */ c(h, { alignItems: "flex-start", direction: "row", gap: 6, children: [
509
+ /* @__PURE__ */ e(te, { color: "primary", filled: !0 }),
510
+ /* @__PURE__ */ e(x, { sx: { whiteSpace: "wrap" }, variant: "XSmall", children: t.delivery_method_sms_note_1 })
511
+ ] }) }) })
512
+ ] });
513
+ }), $ = C(() => {
514
+ const { insightsProfiles: n } = T();
515
+ return /* @__PURE__ */ e(h, { children: n.map((t) => /* @__PURE__ */ e(Q, { profile: t }, t.guid)) });
516
+ }), Ae = () => {
517
+ const { config: n } = X(), [t, { width: s }] = be(), { common: l, settings: i } = S(), { updateUser: r } = T(), { user: a } = A(), [o, _] = p.useState(!1), [d, f] = p.useState({
518
+ email: a.email,
519
+ phone: a.phone
520
+ }), u = d.email && !a.email_is_verified && !o, y = d.phone && !a.phone_is_verified && !o, m = (P) => {
521
+ const { name: I, value: k } = P.target, B = { ...d, [I]: k };
522
+ f(B), _(JSON.stringify({ ...a, ...B }) !== JSON.stringify(a));
523
+ }, g = async () => {
524
+ await r({ ...a, ...d }), _(!1);
525
+ };
526
+ return /* @__PURE__ */ c(h, { ref: t, children: [
527
+ /* @__PURE__ */ e(v, {}),
528
+ /* @__PURE__ */ c(h, { sx: { pt: 12 }, children: [
529
+ /* @__PURE__ */ e(F, { sx: { lineHeight: "20px", pb: 4, pt: 16 }, children: i.personal_details }),
530
+ /* @__PURE__ */ c(h, { sx: { flexDirection: s <= 768 ? "column" : "row", gap: 24, py: 16 }, children: [
531
+ n.display_email_edit_field_in_settings && /* @__PURE__ */ c(h, { sx: { flex: 1, pb: 14 }, children: [
532
+ /* @__PURE__ */ e(
533
+ U,
534
+ {
535
+ defaultValue: a.email,
536
+ fullWidth: !0,
537
+ label: i.email_address,
538
+ name: "email",
539
+ onChange: m
540
+ }
541
+ ),
542
+ u && /* @__PURE__ */ e(
543
+ H,
544
+ {
545
+ sx: {
546
+ height: 20,
547
+ ".MuiButton-root": {
548
+ px: 0,
549
+ ":hover": {
550
+ bgcolor: "transparent"
551
+ }
552
+ }
553
+ },
554
+ children: /* @__PURE__ */ e(Te, {})
555
+ }
556
+ )
557
+ ] }),
558
+ n.display_sms_edit_field_in_settings && /* @__PURE__ */ c(h, { sx: { flex: 1, pb: 14 }, children: [
559
+ /* @__PURE__ */ e(
560
+ U,
561
+ {
562
+ defaultValue: a.phone,
563
+ fullWidth: !0,
564
+ label: i.mobile_number,
565
+ name: "phone",
566
+ onChange: m
567
+ }
568
+ ),
569
+ y && /* @__PURE__ */ e(
570
+ H,
571
+ {
572
+ sx: {
573
+ height: 20,
574
+ ".MuiButton-root": {
575
+ px: 0,
576
+ ":hover": {
577
+ bgcolor: "transparent"
578
+ }
579
+ }
580
+ },
581
+ children: /* @__PURE__ */ e(De, {})
582
+ }
583
+ )
584
+ ] })
585
+ ] }),
586
+ /* @__PURE__ */ e(
587
+ j,
588
+ {
589
+ disabled: !o,
590
+ onClick: g,
591
+ sx: { width: 84 },
592
+ variant: "contained",
593
+ children: l.save_button
594
+ }
595
+ )
596
+ ] })
597
+ ] });
598
+ }, Ie = C(Ae), ht = C(
599
+ ({
600
+ notificationTypes: n = [b.Accounts, b.Budgets],
601
+ showPersonalDetails: t = !1,
602
+ view: s
603
+ }) => {
604
+ const { config: l } = X(), { settings: i } = S(), { isInitialized: r } = me(), { isAccountDataLoaded: a, loadAccountData: o } = J(), { clientCommunicationProfile: _, loadNotificationProfiles: d } = T(), f = xe(), [u, y] = p.useState(!1), [m, g] = p.useState(
605
+ void 0
606
+ );
607
+ if (n.length > 0 && f && n.push(b.Insights), ve({
608
+ widgetName: "NotificationSettingsWidget",
609
+ isLoaded: u
610
+ }), p.useEffect(() => {
611
+ a || o().finally();
612
+ }, []), p.useEffect(() => {
613
+ r && d().finally(() => y(!0));
614
+ }, [r]), !r)
615
+ return /* @__PURE__ */ e(Ce, {});
616
+ let P = i.manage_account_notifications;
617
+ m === b.Budgets ? P = i.manage_budget_notifications : m === b.Insights && (P = i.manage_insights_notifications);
618
+ const {
619
+ email_notifications_enabled: I,
620
+ sms_notifications_enabled: k,
621
+ push_notifications_enabled: B
622
+ } = _, G = I || k || B;
623
+ if (s === "accounts")
624
+ return /* @__PURE__ */ e(W, {});
625
+ if (s === "budgets")
626
+ return /* @__PURE__ */ e(z, {});
627
+ if (s === "insights")
628
+ return /* @__PURE__ */ e($, {});
629
+ const Y = l.display_email_edit_field_in_settings || l.display_sms_edit_field_in_settings, Z = t && _.can_edit_contact_info && Y;
630
+ return /* @__PURE__ */ c(h, { sx: { pt: G ? 0 : 24 }, children: [
631
+ /* @__PURE__ */ c(h, { sx: { px: 24 }, children: [
632
+ G && /* @__PURE__ */ c(M, { children: [
633
+ /* @__PURE__ */ e(we, {}),
634
+ /* @__PURE__ */ e(v, { sx: { my: 24 } })
635
+ ] }),
636
+ /* @__PURE__ */ e(F, { sx: { mb: 4 }, children: i.notification_types_title })
637
+ ] }),
638
+ /* @__PURE__ */ c(E, { children: [
639
+ n.includes(b.Accounts) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => g(b.Accounts), children: [
640
+ /* @__PURE__ */ e(L, { primary: i.accounts_title, secondary: i.accounts_subtitle }),
641
+ /* @__PURE__ */ e(w, {})
642
+ ] }) }),
643
+ n.includes(b.Budgets) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => g(b.Budgets), children: [
644
+ /* @__PURE__ */ e(L, { primary: i.budgets_title, secondary: i.budgets_subtitle }),
645
+ /* @__PURE__ */ e(w, {})
646
+ ] }) }),
647
+ n.includes(b.Insights) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => g(b.Insights), children: [
648
+ /* @__PURE__ */ e(L, { primary: i.insights_title, secondary: i.insights_subtitle }),
649
+ /* @__PURE__ */ e(w, {})
650
+ ] }) })
651
+ ] }),
652
+ Z && /* @__PURE__ */ e(h, { sx: { px: 24 }, children: /* @__PURE__ */ e(Ie, {}) }),
653
+ /* @__PURE__ */ e(
654
+ q,
655
+ {
656
+ isOpen: !!m,
657
+ onClose: () => g(void 0),
658
+ title: P,
659
+ children: /* @__PURE__ */ c(h, { children: [
660
+ m === b.Accounts && /* @__PURE__ */ e(W, {}),
661
+ m === b.Budgets && /* @__PURE__ */ e(z, {}),
662
+ m === b.Insights && /* @__PURE__ */ e($, {})
663
+ ] })
664
+ }
665
+ )
666
+ ] });
667
+ }
668
+ );
669
+ export {
670
+ W as A,
671
+ z as B,
672
+ $ as I,
673
+ ht as N,
674
+ Te as V,
675
+ De as a
676
+ };
@@ -2,10 +2,10 @@ import { jsx as o } from "react/jsx-runtime";
2
2
  import _ from "react";
3
3
  import { observer as p } from "mobx-react-lite";
4
4
  import v from "@mui/material/TextField";
5
- import { L as y } from "./ListItemAction-BNCWQAN_.mjs";
6
- import { u as h, l as b } from "./hooks-C41HAxM5.mjs";
5
+ import { L as y } from "./ListItemAction-Cbr3417C.mjs";
6
+ import { u as h, l as b } from "./hooks-fY_n74f7.mjs";
7
7
  import { a as T, f as S } from "./NumberFormatting-DjTD0t3W.mjs";
8
- import { C as f } from "./CurrencyInput-BrGvhgVK.mjs";
8
+ import { C as f } from "./CurrencyInput-DDQ4DBrE.mjs";
9
9
  const F = p(({ goal: e }) => {
10
10
  const { goals: a } = h(), { setAlert: r, setSelectedGoal: l, updateGoal: m } = b(), [t, s] = _.useState(e.interest_rate ?? 0), c = !e.guid, i = t < 0, d = async () => {
11
11
  const n = { ...e, interest_rate: t };