@mx-cartographer/experiences 9.2.9-alpha.al2 → 9.2.9-alpha.al4
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/dist/{NotificationSettings-CW7okUrk.mjs → NotificationSettings-DXYTQcTs.mjs} +117 -127
- package/dist/NotificationSettings-DXYTQcTs.mjs.map +1 -0
- package/dist/notifications/index.es.js +1 -1
- package/dist/settings/index.es.js +318 -299
- package/dist/settings/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/NotificationSettings-CW7okUrk.mjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e, Fragment as N } from "react/jsx-runtime";
|
|
2
2
|
import f from "react";
|
|
3
|
-
import { observer as
|
|
3
|
+
import { observer as x } from "mobx-react-lite";
|
|
4
4
|
import v from "@mui/material/Divider";
|
|
5
5
|
import E from "@mui/material/List";
|
|
6
6
|
import O from "@mui/material/ListItem";
|
|
7
7
|
import L from "@mui/material/ListItemText";
|
|
8
8
|
import V from "@mui/material/ListItemButton";
|
|
9
|
-
import
|
|
10
|
-
import { ChevronRight as
|
|
11
|
-
import { Text as
|
|
9
|
+
import _ from "@mui/material/Stack";
|
|
10
|
+
import { ChevronRight as S, ExpandMore as ee, Star as te } from "@mxenabled/mx-icons";
|
|
11
|
+
import { Text as C, InstitutionLogo as ne, H3 as F } from "@mxenabled/mxui";
|
|
12
12
|
import { endOfMonth as ie } from "date-fns/endOfMonth";
|
|
13
13
|
import { startOfMonth as oe } from "date-fns/startOfMonth";
|
|
14
14
|
import { DateCalendar as se } from "@mui/x-date-pickers/DateCalendar";
|
|
@@ -16,58 +16,49 @@ import { LocalizationProvider as ae } from "@mui/x-date-pickers/LocalizationProv
|
|
|
16
16
|
import { AdapterDateFns as ce } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
|
17
17
|
import { b as le } from "./Localization-DnoVyBNK.mjs";
|
|
18
18
|
import { b as re, f as de } from "./NumberFormatting--XMeeBfr.mjs";
|
|
19
|
-
import { u as k, A as T, C as
|
|
20
|
-
import { A as
|
|
19
|
+
import { u as k, A as T, C as w, c as J, f as me, i as q, a as _e } from "./hooks-97sNJ_lf.mjs";
|
|
20
|
+
import { A as he, N as b } from "./Notification-DTNYSd8P.mjs";
|
|
21
21
|
import { T as R, a as D } from "./ToggleListItem-Dl1lXNwj.mjs";
|
|
22
22
|
import { D as B } from "./Dialog-Bvd2n8hz.mjs";
|
|
23
|
-
import { C as
|
|
23
|
+
import { C as ue } from "./CurrencyInput-DaGEQaLW.mjs";
|
|
24
24
|
import { u as fe } from "./useScreenSize-mWpmnh5w.mjs";
|
|
25
25
|
import { D as K } from "./Drawer-DsnW2o0v.mjs";
|
|
26
26
|
import pe from "@mui/material/Collapse";
|
|
27
27
|
import ge from "@mui/material/Card";
|
|
28
28
|
import ye from "@mui/material/CardContent";
|
|
29
|
-
import
|
|
30
|
-
import
|
|
29
|
+
import j from "@mui/material/Box";
|
|
30
|
+
import G from "@mui/material/Button";
|
|
31
31
|
import U from "@mui/material/TextField";
|
|
32
32
|
import { u as be } from "./useDimensions-CeDR9V8N.mjs";
|
|
33
33
|
import { useTheme as Q } from "@mui/material/styles";
|
|
34
34
|
import { u as xe } from "./useInsightsEnabled-D5Sdm0TJ.mjs";
|
|
35
35
|
import { u as Ce } from "./useWidgetLoadTimer-B0tB-yzL.mjs";
|
|
36
36
|
import { L as ve } from "./Loader-CxeBwuPG.mjs";
|
|
37
|
-
const Te =
|
|
38
|
-
const { common: n, settings: t } = k(), { sendEmailVerification: s } = T(), { user: l } =
|
|
37
|
+
const Te = x(() => {
|
|
38
|
+
const { common: n, settings: t } = k(), { sendEmailVerification: s } = T(), { user: l } = w(), i = Q(), [r, a] = f.useState(!1), o = () => {
|
|
39
39
|
a(!1);
|
|
40
|
-
},
|
|
40
|
+
}, h = () => {
|
|
41
41
|
a(!0);
|
|
42
42
|
};
|
|
43
43
|
return /* @__PURE__ */ c(f.Fragment, { children: [
|
|
44
|
-
/* @__PURE__ */ c(
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
-
/* @__PURE__ */ e(
|
|
44
|
+
/* @__PURE__ */ c(G, { onClick: h, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
|
|
45
|
+
/* @__PURE__ */ e(C, { variant: "body2", children: t.verify_email }),
|
|
46
|
+
/* @__PURE__ */ e(S, {})
|
|
47
47
|
] }),
|
|
48
48
|
/* @__PURE__ */ e(
|
|
49
49
|
B,
|
|
50
50
|
{
|
|
51
|
-
copy: { title:
|
|
51
|
+
copy: { title: t.confirm_your_email },
|
|
52
52
|
isOpen: r,
|
|
53
53
|
onClose: o,
|
|
54
54
|
onPrimaryAction: s,
|
|
55
55
|
onSecondaryAction: o,
|
|
56
56
|
primaryText: t.send_verification,
|
|
57
57
|
secondaryText: n.back,
|
|
58
|
-
sx: {
|
|
59
|
-
|
|
60
|
-
"& .MuiToolbar-root:last-child": {
|
|
61
|
-
gap: 16,
|
|
62
|
-
padding: "32px 60px 48px",
|
|
63
|
-
justifyContent: "center"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
children: /* @__PURE__ */ c(h, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
|
|
67
|
-
/* @__PURE__ */ e(x, { bold: !0, truncate: !1, variant: "body1", children: t.confirm_your_email }),
|
|
68
|
-
/* @__PURE__ */ e(x, { truncate: !1, variant: "body2", children: t.confirm_email }),
|
|
58
|
+
children: /* @__PURE__ */ c(_, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
|
|
59
|
+
/* @__PURE__ */ e(C, { truncate: !1, variant: "body2", children: t.confirm_email }),
|
|
69
60
|
/* @__PURE__ */ e(
|
|
70
|
-
|
|
61
|
+
C,
|
|
71
62
|
{
|
|
72
63
|
sx: {
|
|
73
64
|
border: `1px solid ${i.palette.neutral.light}`,
|
|
@@ -78,12 +69,12 @@ const Te = C(() => {
|
|
|
78
69
|
children: l.email
|
|
79
70
|
}
|
|
80
71
|
),
|
|
81
|
-
/* @__PURE__ */ e(
|
|
72
|
+
/* @__PURE__ */ e(C, { truncate: !1, variant: "body2", children: t.verification_notice_email })
|
|
82
73
|
] })
|
|
83
74
|
}
|
|
84
75
|
)
|
|
85
76
|
] });
|
|
86
|
-
}), Pe =
|
|
77
|
+
}), Pe = x(
|
|
87
78
|
({ handleClose: n, handleVerify: t, isOpen: s }) => {
|
|
88
79
|
const { common: l, settings: i } = k(), [r, a] = f.useState("");
|
|
89
80
|
return /* @__PURE__ */ e(
|
|
@@ -104,14 +95,14 @@ const Te = C(() => {
|
|
|
104
95
|
justifyContent: "flex-end"
|
|
105
96
|
}
|
|
106
97
|
},
|
|
107
|
-
children: /* @__PURE__ */ e(
|
|
98
|
+
children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(U, { onChange: (o) => a(o.target.value), sx: { width: 352 }, value: r }) })
|
|
108
99
|
}
|
|
109
100
|
);
|
|
110
101
|
}
|
|
111
|
-
), De =
|
|
112
|
-
const { common: n, settings: t } = k(), { sendPhoneVerification: s, verifyPhoneToken: l } = T(), { user: i } =
|
|
102
|
+
), De = x(() => {
|
|
103
|
+
const { common: n, settings: t } = k(), { sendPhoneVerification: s, verifyPhoneToken: l } = T(), { user: i } = w(), r = Q(), [a, o] = f.useState(!1), [h, d] = f.useState(!1), p = () => {
|
|
113
104
|
o(!1);
|
|
114
|
-
},
|
|
105
|
+
}, u = () => {
|
|
115
106
|
o(!0);
|
|
116
107
|
}, y = () => {
|
|
117
108
|
s().finally(() => {
|
|
@@ -123,14 +114,14 @@ const Te = C(() => {
|
|
|
123
114
|
});
|
|
124
115
|
};
|
|
125
116
|
return /* @__PURE__ */ c(f.Fragment, { children: [
|
|
126
|
-
/* @__PURE__ */ c(
|
|
127
|
-
/* @__PURE__ */ e(
|
|
128
|
-
/* @__PURE__ */ e(
|
|
117
|
+
/* @__PURE__ */ c(G, { onClick: u, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
|
|
118
|
+
/* @__PURE__ */ e(C, { variant: "body2", children: t.verify_phone }),
|
|
119
|
+
/* @__PURE__ */ e(S, {})
|
|
129
120
|
] }),
|
|
130
121
|
/* @__PURE__ */ e(
|
|
131
122
|
B,
|
|
132
123
|
{
|
|
133
|
-
copy: { title:
|
|
124
|
+
copy: { title: t.confirm_your_phone },
|
|
134
125
|
isOpen: a,
|
|
135
126
|
onClose: p,
|
|
136
127
|
onPrimaryAction: y,
|
|
@@ -145,11 +136,10 @@ const Te = C(() => {
|
|
|
145
136
|
justifyContent: "center"
|
|
146
137
|
}
|
|
147
138
|
},
|
|
148
|
-
children: /* @__PURE__ */ c(
|
|
149
|
-
/* @__PURE__ */ e(
|
|
150
|
-
/* @__PURE__ */ e(x, { truncate: !1, variant: "body2", children: t.confirm_phone }),
|
|
139
|
+
children: /* @__PURE__ */ c(_, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
|
|
140
|
+
/* @__PURE__ */ e(C, { truncate: !1, variant: "body2", children: t.confirm_phone }),
|
|
151
141
|
/* @__PURE__ */ e(
|
|
152
|
-
|
|
142
|
+
C,
|
|
153
143
|
{
|
|
154
144
|
sx: {
|
|
155
145
|
border: `1px solid ${r.palette.neutral.light}`,
|
|
@@ -160,7 +150,7 @@ const Te = C(() => {
|
|
|
160
150
|
children: i.phone
|
|
161
151
|
}
|
|
162
152
|
),
|
|
163
|
-
/* @__PURE__ */ e(
|
|
153
|
+
/* @__PURE__ */ e(C, { truncate: !1, variant: "body2", children: t.verification_notice_phone })
|
|
164
154
|
] })
|
|
165
155
|
}
|
|
166
156
|
),
|
|
@@ -169,21 +159,21 @@ const Te = C(() => {
|
|
|
169
159
|
{
|
|
170
160
|
handleClose: () => d(!1),
|
|
171
161
|
handleVerify: m,
|
|
172
|
-
isOpen:
|
|
162
|
+
isOpen: h
|
|
173
163
|
}
|
|
174
164
|
)
|
|
175
165
|
] });
|
|
176
|
-
}), ke =
|
|
166
|
+
}), ke = x(
|
|
177
167
|
({ onProfileUpdated: n, profile: t }) => {
|
|
178
|
-
const { common: s, recurring: l, settings: i } = k(), { updateAccount: r } = J(), a = t.notification_type ===
|
|
168
|
+
const { common: s, recurring: l, settings: i } = k(), { updateAccount: r } = J(), a = t.notification_type === he.DebtPaymentReminder, [o, h] = f.useState(!1), [d, p] = f.useState(t.threshold || 0), [u, y] = f.useState(
|
|
179
169
|
t.account?.day_payment_is_due || 0
|
|
180
170
|
), m = t.account?.name || t.account?.feed_name || "", g = t.account?.day_payment_is_due ? le(
|
|
181
171
|
i.notification_debt_payment_date,
|
|
182
172
|
re(t.account?.day_payment_is_due)
|
|
183
173
|
) : i.notification_debt_payment_zero_state, P = a ? g : de(t.threshold ?? 0, "0,0"), I = async () => {
|
|
184
|
-
a && t.account ? await r({ ...t.account, day_payment_is_due:
|
|
174
|
+
a && t.account ? await r({ ...t.account, day_payment_is_due: u }) : n({ ...t, threshold: d });
|
|
185
175
|
};
|
|
186
|
-
return /* @__PURE__ */ c(
|
|
176
|
+
return /* @__PURE__ */ c(_, { children: [
|
|
187
177
|
/* @__PURE__ */ e(
|
|
188
178
|
R,
|
|
189
179
|
{
|
|
@@ -194,11 +184,11 @@ const Te = C(() => {
|
|
|
194
184
|
institutionGuid: t.account?.institution_guid
|
|
195
185
|
}
|
|
196
186
|
) : void 0,
|
|
197
|
-
endIcon: /* @__PURE__ */ e(
|
|
187
|
+
endIcon: /* @__PURE__ */ e(S, {}),
|
|
198
188
|
isChecked: t.is_enabled,
|
|
199
189
|
isDisabled: !t.is_enabled,
|
|
200
190
|
isPrimaryTextBold: !0,
|
|
201
|
-
onClick: () =>
|
|
191
|
+
onClick: () => h(!0),
|
|
202
192
|
onToggle: () => n({
|
|
203
193
|
...t,
|
|
204
194
|
is_enabled: !t.is_enabled
|
|
@@ -214,9 +204,9 @@ const Te = C(() => {
|
|
|
214
204
|
title: a ? l.day_of_the_month : i.notification_threshold_label,
|
|
215
205
|
close_aria: s.close_aria
|
|
216
206
|
},
|
|
217
|
-
disablePrimaryButton: a &&
|
|
207
|
+
disablePrimaryButton: a && u === 0,
|
|
218
208
|
isOpen: o,
|
|
219
|
-
onClose: () =>
|
|
209
|
+
onClose: () => h(!1),
|
|
220
210
|
onPrimaryAction: I,
|
|
221
211
|
primaryText: s.save_button,
|
|
222
212
|
children: a ? /* @__PURE__ */ e(ae, { dateAdapter: ce, children: /* @__PURE__ */ e(
|
|
@@ -224,8 +214,8 @@ const Te = C(() => {
|
|
|
224
214
|
{
|
|
225
215
|
maxDate: ie(/* @__PURE__ */ new Date()),
|
|
226
216
|
minDate: oe(/* @__PURE__ */ new Date()),
|
|
227
|
-
onChange: (
|
|
228
|
-
y(
|
|
217
|
+
onChange: (A) => {
|
|
218
|
+
y(A.getDate());
|
|
229
219
|
},
|
|
230
220
|
slots: {
|
|
231
221
|
// Hides the arrows
|
|
@@ -241,13 +231,13 @@ const Te = C(() => {
|
|
|
241
231
|
views: ["day"]
|
|
242
232
|
}
|
|
243
233
|
) }) : /* @__PURE__ */ e(
|
|
244
|
-
|
|
234
|
+
ue,
|
|
245
235
|
{
|
|
246
236
|
amount: d,
|
|
247
237
|
autoFocus: !0,
|
|
248
238
|
fullWidth: !0,
|
|
249
239
|
minAmount: 0,
|
|
250
|
-
setAmount: (
|
|
240
|
+
setAmount: (A) => p(Number(A) || 0),
|
|
251
241
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
252
242
|
}
|
|
253
243
|
)
|
|
@@ -255,34 +245,34 @@ const Te = C(() => {
|
|
|
255
245
|
)
|
|
256
246
|
] });
|
|
257
247
|
}
|
|
258
|
-
),
|
|
248
|
+
), Ae = x(
|
|
259
249
|
({ onUpdateProfile: n, profile: t }) => {
|
|
260
|
-
const { settings: s } = k(), { user: l } =
|
|
261
|
-
opted_out_of_email_notifications:
|
|
250
|
+
const { settings: s } = k(), { user: l } = w(), { clientCommunicationProfile: i, userCommunicationsProfile: r } = T(), { isMobile: a } = fe(), o = t.notification_type > 2, {
|
|
251
|
+
opted_out_of_email_notifications: h,
|
|
262
252
|
opted_out_of_push_notifications: d,
|
|
263
253
|
opted_out_of_sms_notifications: p
|
|
264
254
|
} = r, {
|
|
265
|
-
email_notifications_enabled:
|
|
255
|
+
email_notifications_enabled: u,
|
|
266
256
|
push_notifications_enabled: y,
|
|
267
257
|
sms_notifications_enabled: m
|
|
268
258
|
} = i;
|
|
269
|
-
return /* @__PURE__ */ c(
|
|
270
|
-
(
|
|
271
|
-
/* @__PURE__ */ e(
|
|
259
|
+
return /* @__PURE__ */ c(_, { children: [
|
|
260
|
+
(u || m || y) && /* @__PURE__ */ c(N, { children: [
|
|
261
|
+
/* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.delivery_method_title }),
|
|
272
262
|
/* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
|
|
273
|
-
|
|
263
|
+
u && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
|
|
274
264
|
D,
|
|
275
265
|
{
|
|
276
|
-
isChecked: !
|
|
277
|
-
isDisabled:
|
|
266
|
+
isChecked: !h && t.email_channel && !!l.email,
|
|
267
|
+
isDisabled: h || !l.email,
|
|
278
268
|
onToggle: () => n({ ...t, email_channel: !t.email_channel }),
|
|
279
269
|
primaryText: s.delivery_method_email_label,
|
|
280
|
-
secondaryText:
|
|
270
|
+
secondaryText: h || !t.email_channel || !l.email ? s.notification_disabled : s.notification_enabled,
|
|
281
271
|
useExtraPadding: !1
|
|
282
272
|
}
|
|
283
273
|
) }),
|
|
284
|
-
|
|
285
|
-
m && /* @__PURE__ */ e(
|
|
274
|
+
u && (m || y) && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
|
|
275
|
+
m && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
|
|
286
276
|
D,
|
|
287
277
|
{
|
|
288
278
|
isChecked: !p && t.sms_channel && !!l.phone,
|
|
@@ -294,7 +284,7 @@ const Te = C(() => {
|
|
|
294
284
|
}
|
|
295
285
|
) }),
|
|
296
286
|
m && y && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
|
|
297
|
-
y && /* @__PURE__ */ e(
|
|
287
|
+
y && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
|
|
298
288
|
D,
|
|
299
289
|
{
|
|
300
290
|
isChecked: !d && t.push_channel,
|
|
@@ -308,8 +298,8 @@ const Te = C(() => {
|
|
|
308
298
|
/* @__PURE__ */ e(v, {})
|
|
309
299
|
] })
|
|
310
300
|
] }),
|
|
311
|
-
o && !!t.children?.length && /* @__PURE__ */ c(
|
|
312
|
-
/* @__PURE__ */ e(
|
|
301
|
+
o && !!t.children?.length && /* @__PURE__ */ c(_, { children: [
|
|
302
|
+
/* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.accounts_threshold_title }),
|
|
313
303
|
/* @__PURE__ */ e(E, { sx: { bgcolor: "background.paper" }, children: t.children?.map((g) => /* @__PURE__ */ e(
|
|
314
304
|
ke,
|
|
315
305
|
{
|
|
@@ -321,7 +311,7 @@ const Te = C(() => {
|
|
|
321
311
|
] })
|
|
322
312
|
] });
|
|
323
313
|
}
|
|
324
|
-
), z =
|
|
314
|
+
), z = x(() => {
|
|
325
315
|
const { accountProfiles: n, updateNotificationProfile: t } = T(), [s, l] = f.useState(""), i = f.useMemo(
|
|
326
316
|
() => n.find((o) => o.guid === s),
|
|
327
317
|
[n, s]
|
|
@@ -333,11 +323,11 @@ const Te = C(() => {
|
|
|
333
323
|
}, a = async (o) => {
|
|
334
324
|
await t(o);
|
|
335
325
|
};
|
|
336
|
-
return /* @__PURE__ */ c(
|
|
326
|
+
return /* @__PURE__ */ c(_, { sx: { backgroundColor: "background.paper" }, children: [
|
|
337
327
|
n.filter((o) => o.children && o.children.length > 0).map((o) => /* @__PURE__ */ e(
|
|
338
328
|
R,
|
|
339
329
|
{
|
|
340
|
-
endIcon: /* @__PURE__ */ e(
|
|
330
|
+
endIcon: /* @__PURE__ */ e(S, {}),
|
|
341
331
|
isChecked: o.is_enabled,
|
|
342
332
|
isDisabled: !o.is_enabled,
|
|
343
333
|
onClick: () => l(o.guid),
|
|
@@ -354,7 +344,7 @@ const Te = C(() => {
|
|
|
354
344
|
onClose: () => l(""),
|
|
355
345
|
title: i ? i.label : "",
|
|
356
346
|
children: i && /* @__PURE__ */ e(
|
|
357
|
-
|
|
347
|
+
Ae,
|
|
358
348
|
{
|
|
359
349
|
onUpdateProfile: a,
|
|
360
350
|
profile: i
|
|
@@ -363,7 +353,7 @@ const Te = C(() => {
|
|
|
363
353
|
}
|
|
364
354
|
)
|
|
365
355
|
] });
|
|
366
|
-
}), X =
|
|
356
|
+
}), X = x(({ profile: n }) => {
|
|
367
357
|
const { settings: t } = k(), {
|
|
368
358
|
clientCommunicationProfile: {
|
|
369
359
|
email_notifications_enabled: s,
|
|
@@ -374,10 +364,10 @@ const Te = C(() => {
|
|
|
374
364
|
userCommunicationsProfile: {
|
|
375
365
|
opted_out_of_email_notifications: a,
|
|
376
366
|
opted_out_of_push_notifications: o,
|
|
377
|
-
opted_out_of_sms_notifications:
|
|
367
|
+
opted_out_of_sms_notifications: h
|
|
378
368
|
}
|
|
379
|
-
} = T(), { user: d } =
|
|
380
|
-
await m({ ...n, is_enabled: !n.is_enabled }), n.is_enabled &&
|
|
369
|
+
} = T(), { user: d } = w(), [p, u] = f.useState(!1), y = async () => {
|
|
370
|
+
await m({ ...n, is_enabled: !n.is_enabled }), n.is_enabled && u(!1);
|
|
381
371
|
}, m = async (P) => {
|
|
382
372
|
await r(P);
|
|
383
373
|
}, g = s || i || l;
|
|
@@ -396,7 +386,7 @@ const Te = C(() => {
|
|
|
396
386
|
) : void 0,
|
|
397
387
|
isChecked: n.is_enabled,
|
|
398
388
|
isDisabled: !n.is_enabled,
|
|
399
|
-
onClick: () =>
|
|
389
|
+
onClick: () => u(!p),
|
|
400
390
|
onToggle: () => y(),
|
|
401
391
|
primaryText: n.label,
|
|
402
392
|
secondaryText: n.is_enabled ? n.deliveryMethodsLabel : void 0
|
|
@@ -420,8 +410,8 @@ const Te = C(() => {
|
|
|
420
410
|
i && /* @__PURE__ */ e(
|
|
421
411
|
D,
|
|
422
412
|
{
|
|
423
|
-
isChecked: !
|
|
424
|
-
isDisabled:
|
|
413
|
+
isChecked: !h && n.sms_channel && !!d.phone,
|
|
414
|
+
isDisabled: h || !d.phone,
|
|
425
415
|
onToggle: () => m({
|
|
426
416
|
...n,
|
|
427
417
|
sms_channel: !n.sms_channel
|
|
@@ -445,23 +435,23 @@ const Te = C(() => {
|
|
|
445
435
|
] }) }),
|
|
446
436
|
/* @__PURE__ */ e(v, {})
|
|
447
437
|
] }, n.guid);
|
|
448
|
-
}), $ =
|
|
438
|
+
}), $ = x(() => {
|
|
449
439
|
const { budgetProfiles: n } = T();
|
|
450
|
-
return /* @__PURE__ */ e(
|
|
451
|
-
}),
|
|
440
|
+
return /* @__PURE__ */ e(_, { children: n.map((t) => /* @__PURE__ */ e(X, { profile: t }, t.guid)) });
|
|
441
|
+
}), Se = x(() => {
|
|
452
442
|
const { onEvent: n } = me(), { settings: t } = k(), {
|
|
453
443
|
clientCommunicationProfile: s,
|
|
454
444
|
updateUserCommunicationProfile: l,
|
|
455
445
|
userCommunicationsProfile: i
|
|
456
|
-
} = T(), { user: r } =
|
|
457
|
-
const d = { ...i, [o]:
|
|
446
|
+
} = T(), { user: r } = w(), a = async (o, h) => {
|
|
447
|
+
const d = { ...i, [o]: h };
|
|
458
448
|
if (n) {
|
|
459
|
-
const
|
|
460
|
-
|
|
449
|
+
const u = o.split("_")[3];
|
|
450
|
+
h === !1 ? n("opt_in_notification_method", { notificationType: u }) : n("opt_out_notification_method", { notificationType: u });
|
|
461
451
|
}
|
|
462
452
|
await l(d);
|
|
463
453
|
};
|
|
464
|
-
return /* @__PURE__ */ c(
|
|
454
|
+
return /* @__PURE__ */ c(_, { children: [
|
|
465
455
|
/* @__PURE__ */ e(F, { sx: { mt: 24 }, children: t.delivery_method_title }),
|
|
466
456
|
s.email_notifications_enabled && /* @__PURE__ */ c(N, { children: [
|
|
467
457
|
/* @__PURE__ */ e(
|
|
@@ -506,30 +496,30 @@ const Te = C(() => {
|
|
|
506
496
|
useExtraPadding: !1
|
|
507
497
|
}
|
|
508
498
|
),
|
|
509
|
-
s.sms_notifications_enabled && /* @__PURE__ */ e(ge, { sx: { backgroundColor: "background.default", mt: 12 }, variant: "outlined", children: /* @__PURE__ */ e(ye, { children: /* @__PURE__ */ c(
|
|
499
|
+
s.sms_notifications_enabled && /* @__PURE__ */ e(ge, { sx: { backgroundColor: "background.default", mt: 12 }, variant: "outlined", children: /* @__PURE__ */ e(ye, { children: /* @__PURE__ */ c(_, { alignItems: "flex-start", direction: "row", gap: 6, children: [
|
|
510
500
|
/* @__PURE__ */ e(te, { color: "primary", filled: !0 }),
|
|
511
|
-
/* @__PURE__ */ e(
|
|
501
|
+
/* @__PURE__ */ e(C, { variant: "caption", children: t.delivery_method_sms_note_1 })
|
|
512
502
|
] }) }) })
|
|
513
503
|
] });
|
|
514
|
-
}), H =
|
|
504
|
+
}), H = x(() => {
|
|
515
505
|
const { insightsProfiles: n } = T();
|
|
516
|
-
return /* @__PURE__ */ e(
|
|
517
|
-
}),
|
|
518
|
-
const { config: n } = q(), [t, { width: s }] = be(), { common: l, settings: i } = k(), { updateUser: r } = T(), { user: a } =
|
|
506
|
+
return /* @__PURE__ */ e(_, { children: n.map((t) => /* @__PURE__ */ e(X, { profile: t }, t.guid)) });
|
|
507
|
+
}), we = () => {
|
|
508
|
+
const { config: n } = q(), [t, { width: s }] = be(), { common: l, settings: i } = k(), { updateUser: r } = T(), { user: a } = w(), [o, h] = f.useState(!1), [d, p] = f.useState({
|
|
519
509
|
email: a.email,
|
|
520
510
|
phone: a.phone
|
|
521
|
-
}),
|
|
522
|
-
const { name: I, value:
|
|
523
|
-
p(M),
|
|
511
|
+
}), u = d.email && !a.email_is_verified && !o, y = d.phone && !a.phone_is_verified && !o, m = (P) => {
|
|
512
|
+
const { name: I, value: A } = P.target, M = { ...d, [I]: A };
|
|
513
|
+
p(M), h(JSON.stringify({ ...a, ...M }) !== JSON.stringify(a));
|
|
524
514
|
}, g = async () => {
|
|
525
|
-
await r({ ...a, ...d }),
|
|
515
|
+
await r({ ...a, ...d }), h(!1);
|
|
526
516
|
};
|
|
527
|
-
return /* @__PURE__ */ c(
|
|
517
|
+
return /* @__PURE__ */ c(_, { ref: t, children: [
|
|
528
518
|
/* @__PURE__ */ e(v, {}),
|
|
529
|
-
/* @__PURE__ */ c(
|
|
519
|
+
/* @__PURE__ */ c(_, { sx: { pt: 12 }, children: [
|
|
530
520
|
/* @__PURE__ */ e(F, { sx: { lineHeight: "20px", pb: 4, pt: 16 }, children: i.personal_details }),
|
|
531
|
-
/* @__PURE__ */ c(
|
|
532
|
-
n.display_email_edit_field_in_settings && /* @__PURE__ */ c(
|
|
521
|
+
/* @__PURE__ */ c(_, { sx: { flexDirection: s <= 768 ? "column" : "row", gap: 24, py: 16 }, children: [
|
|
522
|
+
n.display_email_edit_field_in_settings && /* @__PURE__ */ c(_, { sx: { flex: 1, pb: 14 }, children: [
|
|
533
523
|
/* @__PURE__ */ e(
|
|
534
524
|
U,
|
|
535
525
|
{
|
|
@@ -540,8 +530,8 @@ const Te = C(() => {
|
|
|
540
530
|
onChange: m
|
|
541
531
|
}
|
|
542
532
|
),
|
|
543
|
-
|
|
544
|
-
|
|
533
|
+
u && /* @__PURE__ */ e(
|
|
534
|
+
j,
|
|
545
535
|
{
|
|
546
536
|
sx: {
|
|
547
537
|
height: 20,
|
|
@@ -556,7 +546,7 @@ const Te = C(() => {
|
|
|
556
546
|
}
|
|
557
547
|
)
|
|
558
548
|
] }),
|
|
559
|
-
n.display_sms_edit_field_in_settings && /* @__PURE__ */ c(
|
|
549
|
+
n.display_sms_edit_field_in_settings && /* @__PURE__ */ c(_, { sx: { flex: 1, pb: 14 }, children: [
|
|
560
550
|
/* @__PURE__ */ e(
|
|
561
551
|
U,
|
|
562
552
|
{
|
|
@@ -568,7 +558,7 @@ const Te = C(() => {
|
|
|
568
558
|
}
|
|
569
559
|
),
|
|
570
560
|
y && /* @__PURE__ */ e(
|
|
571
|
-
|
|
561
|
+
j,
|
|
572
562
|
{
|
|
573
563
|
sx: {
|
|
574
564
|
height: 20,
|
|
@@ -585,7 +575,7 @@ const Te = C(() => {
|
|
|
585
575
|
] })
|
|
586
576
|
] }),
|
|
587
577
|
/* @__PURE__ */ e(
|
|
588
|
-
|
|
578
|
+
G,
|
|
589
579
|
{
|
|
590
580
|
disabled: !o,
|
|
591
581
|
onClick: g,
|
|
@@ -596,18 +586,18 @@ const Te = C(() => {
|
|
|
596
586
|
)
|
|
597
587
|
] })
|
|
598
588
|
] });
|
|
599
|
-
}, Ie =
|
|
589
|
+
}, Ie = x(we), ht = x(
|
|
600
590
|
({
|
|
601
591
|
notificationTypes: n = [b.Accounts, b.Budgets],
|
|
602
592
|
showPersonalDetails: t = !1,
|
|
603
593
|
view: s
|
|
604
594
|
}) => {
|
|
605
|
-
const { config: l } = q(), { settings: i } = k(), { isInitialized: r } =
|
|
595
|
+
const { config: l } = q(), { settings: i } = k(), { isInitialized: r } = _e(), { isAccountDataLoaded: a, loadAccountData: o } = J(), { clientCommunicationProfile: h, loadNotificationProfiles: d } = T(), p = xe(), [u, y] = f.useState(!1), [m, g] = f.useState(
|
|
606
596
|
void 0
|
|
607
597
|
);
|
|
608
598
|
if (n.length > 0 && p && n.push(b.Insights), Ce({
|
|
609
599
|
widgetName: "NotificationSettingsWidget",
|
|
610
|
-
isLoaded:
|
|
600
|
+
isLoaded: u
|
|
611
601
|
}), f.useEffect(() => {
|
|
612
602
|
a || o().finally();
|
|
613
603
|
}, []), f.useEffect(() => {
|
|
@@ -618,20 +608,20 @@ const Te = C(() => {
|
|
|
618
608
|
m === b.Budgets ? P = i.manage_budget_notifications : m === b.Insights && (P = i.manage_insights_notifications);
|
|
619
609
|
const {
|
|
620
610
|
email_notifications_enabled: I,
|
|
621
|
-
sms_notifications_enabled:
|
|
611
|
+
sms_notifications_enabled: A,
|
|
622
612
|
push_notifications_enabled: M
|
|
623
|
-
} =
|
|
613
|
+
} = h, W = I || A || M;
|
|
624
614
|
if (s === "accounts")
|
|
625
615
|
return /* @__PURE__ */ e(z, {});
|
|
626
616
|
if (s === "budgets")
|
|
627
617
|
return /* @__PURE__ */ e($, {});
|
|
628
618
|
if (s === "insights")
|
|
629
619
|
return /* @__PURE__ */ e(H, {});
|
|
630
|
-
const Y = l.display_email_edit_field_in_settings || l.display_sms_edit_field_in_settings, Z = t &&
|
|
631
|
-
return /* @__PURE__ */ c(
|
|
632
|
-
/* @__PURE__ */ c(
|
|
633
|
-
|
|
634
|
-
/* @__PURE__ */ e(
|
|
620
|
+
const Y = l.display_email_edit_field_in_settings || l.display_sms_edit_field_in_settings, Z = t && h.can_edit_contact_info && Y;
|
|
621
|
+
return /* @__PURE__ */ c(_, { sx: { pt: W ? 0 : 24 }, children: [
|
|
622
|
+
/* @__PURE__ */ c(_, { sx: { px: 24 }, children: [
|
|
623
|
+
W && /* @__PURE__ */ c(N, { children: [
|
|
624
|
+
/* @__PURE__ */ e(Se, {}),
|
|
635
625
|
/* @__PURE__ */ e(v, { sx: { my: 24 } })
|
|
636
626
|
] }),
|
|
637
627
|
/* @__PURE__ */ e(F, { sx: { mb: 4 }, children: i.notification_types_title })
|
|
@@ -639,25 +629,25 @@ const Te = C(() => {
|
|
|
639
629
|
/* @__PURE__ */ c(E, { children: [
|
|
640
630
|
n.includes(b.Accounts) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => g(b.Accounts), children: [
|
|
641
631
|
/* @__PURE__ */ e(L, { primary: i.accounts_title, secondary: i.accounts_subtitle }),
|
|
642
|
-
/* @__PURE__ */ e(
|
|
632
|
+
/* @__PURE__ */ e(S, {})
|
|
643
633
|
] }) }),
|
|
644
634
|
n.includes(b.Budgets) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => g(b.Budgets), children: [
|
|
645
635
|
/* @__PURE__ */ e(L, { primary: i.budgets_title, secondary: i.budgets_subtitle }),
|
|
646
|
-
/* @__PURE__ */ e(
|
|
636
|
+
/* @__PURE__ */ e(S, {})
|
|
647
637
|
] }) }),
|
|
648
638
|
n.includes(b.Insights) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => g(b.Insights), children: [
|
|
649
639
|
/* @__PURE__ */ e(L, { primary: i.insights_title, secondary: i.insights_subtitle }),
|
|
650
|
-
/* @__PURE__ */ e(
|
|
640
|
+
/* @__PURE__ */ e(S, {})
|
|
651
641
|
] }) })
|
|
652
642
|
] }),
|
|
653
|
-
Z && /* @__PURE__ */ e(
|
|
643
|
+
Z && /* @__PURE__ */ e(_, { sx: { px: 24 }, children: /* @__PURE__ */ e(Ie, {}) }),
|
|
654
644
|
/* @__PURE__ */ e(
|
|
655
645
|
K,
|
|
656
646
|
{
|
|
657
647
|
isOpen: !!m,
|
|
658
648
|
onClose: () => g(void 0),
|
|
659
649
|
title: P,
|
|
660
|
-
children: /* @__PURE__ */ c(
|
|
650
|
+
children: /* @__PURE__ */ c(_, { children: [
|
|
661
651
|
m === b.Accounts && /* @__PURE__ */ e(z, {}),
|
|
662
652
|
m === b.Budgets && /* @__PURE__ */ e($, {}),
|
|
663
653
|
m === b.Insights && /* @__PURE__ */ e(H, {})
|
|
@@ -671,8 +661,8 @@ export {
|
|
|
671
661
|
z as A,
|
|
672
662
|
$ as B,
|
|
673
663
|
H as I,
|
|
674
|
-
|
|
664
|
+
ht as N,
|
|
675
665
|
Te as V,
|
|
676
666
|
De as a
|
|
677
667
|
};
|
|
678
|
-
//# sourceMappingURL=NotificationSettings-
|
|
668
|
+
//# sourceMappingURL=NotificationSettings-DXYTQcTs.mjs.map
|