mario-education 2.0.149-staging → 2.0.151-staging

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/DesignatedStaff-BhiGw0vU.js +432 -0
  2. package/dist/DesignatedStaff-DDCCl8MU.cjs +1 -0
  3. package/dist/FrequencyAndSetup-CQFQVjY5.js +1008 -0
  4. package/dist/FrequencyAndSetup-Df_kkGDb.cjs +9 -0
  5. package/dist/FrequencyAndSetupV2-BaTCYoNJ.js +2609 -0
  6. package/dist/FrequencyAndSetupV2-w3YY8usH.cjs +1 -0
  7. package/dist/MainLayoutAdmin-BU4ZRSZJ.cjs +6 -0
  8. package/dist/MainLayoutAdmin-CAoUvIWv.cjs +6 -0
  9. package/dist/MainLayoutAdmin-CJbLOkTL.js +1812 -0
  10. package/dist/MainLayoutAdmin-CbxRUkOn.js +1799 -0
  11. package/dist/OpenFieldWellbeingQuestion-BaqEYciQ.js +145 -0
  12. package/dist/OpenFieldWellbeingQuestion-D5p_BU_f.cjs +1 -0
  13. package/dist/QuestionDetail-DzctsPLm.js +718 -0
  14. package/dist/QuestionDetail-qXxqzg__.cjs +1 -0
  15. package/dist/SummarizeQuestion-Dzgs_Y6Z.js +1097 -0
  16. package/dist/SummarizeQuestion-WMSKIQWD.cjs +1 -0
  17. package/dist/SurveyDashboardContainer--BZ1LC8l.cjs +10 -0
  18. package/dist/SurveyDashboardContainer-CWpt_4Ra.js +2318 -0
  19. package/dist/WellBeingDashboard-CWK9Wd0T.cjs +5 -0
  20. package/dist/WellBeingDashboard-Cb3gf6e0.js +2259 -0
  21. package/dist/containers/FrequencyAndSetupV2/components/ComprehensiveTabContent.d.ts +12 -0
  22. package/dist/containers/FrequencyAndSetupV2/components/DeleteQuestionModal.d.ts +8 -0
  23. package/dist/containers/FrequencyAndSetupV2/components/EmailPreviewBox.d.ts +9 -0
  24. package/dist/containers/FrequencyAndSetupV2/components/LaunchModal.d.ts +7 -0
  25. package/dist/containers/FrequencyAndSetupV2/components/ModeTabs.d.ts +7 -0
  26. package/dist/containers/FrequencyAndSetupV2/components/OneOffTabContent.d.ts +14 -0
  27. package/dist/containers/FrequencyAndSetupV2/components/QuestionRow.d.ts +13 -0
  28. package/dist/containers/FrequencyAndSetupV2/components/QuestionSectionCard.d.ts +22 -0
  29. package/dist/containers/FrequencyAndSetupV2/components/RestoreDefaultsModal.d.ts +9 -0
  30. package/dist/containers/FrequencyAndSetupV2/components/ReviewQuestionsV2.d.ts +13 -0
  31. package/dist/containers/FrequencyAndSetupV2/components/RoutineTabContent.d.ts +12 -0
  32. package/dist/containers/FrequencyAndSetupV2/components/SavedView.d.ts +13 -0
  33. package/dist/containers/FrequencyAndSetupV2/components/SortableClusterCard.d.ts +19 -0
  34. package/dist/containers/FrequencyAndSetupV2/components/ViewOneOffModal.d.ts +11 -0
  35. package/dist/containers/FrequencyAndSetupV2/components/WellbeingSnackbar.d.ts +5 -0
  36. package/dist/containers/FrequencyAndSetupV2/constants.d.ts +28 -0
  37. package/dist/containers/FrequencyAndSetupV2/hooks/useFrequencyAndSetupV2.d.ts +49 -0
  38. package/dist/containers/FrequencyAndSetupV2/icons/index.d.ts +8 -0
  39. package/dist/containers/FrequencyAndSetupV2/index.d.ts +5 -0
  40. package/dist/containers/FrequencyAndSetupV2/types.d.ts +89 -0
  41. package/dist/containers/FrequencyAndSetupV2/views/FrequencyAndSetupV2.d.ts +3 -0
  42. package/dist/index-2bHN814N.cjs +1 -0
  43. package/dist/index-BqmjwJGC.js +31 -0
  44. package/dist/index-CKD70ECS.cjs +1 -0
  45. package/dist/index-CbXqJKkN.js +2474 -0
  46. package/dist/index-D7ZMk8b_.js +127 -0
  47. package/dist/index-cPRlZIiA.cjs +1 -0
  48. package/dist/index.d.ts +2 -1
  49. package/dist/index.js +1 -1
  50. package/dist/index.modern.js +32 -31
  51. package/dist/mario-education.css +1 -1
  52. package/dist/services/wellbeingService.d.ts +8 -0
  53. package/dist/wellbeingService-BlHKtcgg.cjs +1 -0
  54. package/dist/wellbeingService-DqKYLXnr.js +28 -0
  55. package/package.json +2 -2
@@ -0,0 +1,432 @@
1
+ import { jsx as e, jsxs as a, Fragment as J } from "react/jsx-runtime";
2
+ import { Dialog as A, TextField as E, Typography as m, Switch as L } from "@mui/material";
3
+ import { useTranslation as S, setAlert as I, setLoading as Z } from "mario-core";
4
+ import { G } from "./iconBase-DSKTHwal.js";
5
+ import { P as H } from "./PlusIcon-CVMl35jq.js";
6
+ import { b as D } from "./index-6W4WTTwy.js";
7
+ import { useState as q, useRef as y, useCallback as h, useEffect as k } from "react";
8
+ import { useDispatch as V } from "react-redux";
9
+ import { I as K } from "./constants-DLIHL-ek.js";
10
+ import { u as Q } from "./useDebounce-B7e4xA9G.js";
11
+ import { i as U, g as X, j as Y } from "./wellbeingService-DqKYLXnr.js";
12
+ function ee(i) {
13
+ return G({ attr: { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, child: [{ tag: "path", attr: { d: "M2.22 2.22a.75.75 0 0 1 1.06 0l6.783 6.782a1 1 0 0 1 .935.935l6.782 6.783a.75.75 0 1 1-1.06 1.06l-6.783-6.782a1 1 0 0 1-.935-.935L2.22 3.28a.75.75 0 0 1 0-1.06ZM3.636 16.364a9.004 9.004 0 0 1-1.39-10.936L3.349 6.53a7.503 7.503 0 0 0 1.348 8.773.75.75 0 0 1-1.061 1.061ZM6.464 13.536a5 5 0 0 1-1.213-5.103l1.262 1.262a3.493 3.493 0 0 0 1.012 2.78.75.75 0 0 1-1.06 1.06ZM16.364 3.636a9.004 9.004 0 0 1 1.39 10.937l-1.103-1.104a7.503 7.503 0 0 0-1.348-8.772.75.75 0 1 1 1.061-1.061ZM13.536 6.464a5 5 0 0 1 1.213 5.103l-1.262-1.262a3.493 3.493 0 0 0-1.012-2.78.75.75 0 0 1 1.06-1.06Z" }, child: [] }] })(i);
14
+ }
15
+ const t = {
16
+ "designated-staff-page": "_designated-staff-page_g4py7_1",
17
+ "designated-staff-page__header": "_designated-staff-page__header_g4py7_6",
18
+ "designated-staff-page__title": "_designated-staff-page__title_g4py7_12",
19
+ "designated-staff-card": "_designated-staff-card_g4py7_20",
20
+ "designated-staff-card__intro": "_designated-staff-card__intro_g4py7_29",
21
+ "designated-staff-card__heading": "_designated-staff-card__heading_g4py7_34",
22
+ "designated-staff-card__subheading": "_designated-staff-card__subheading_g4py7_41",
23
+ "toggle-panel": "_toggle-panel_g4py7_48",
24
+ "toggle-panel__content": "_toggle-panel__content_g4py7_58",
25
+ "toggle-panel__title": "_toggle-panel__title_g4py7_63",
26
+ "toggle-panel__description": "_toggle-panel__description_g4py7_69",
27
+ "contact-section": "_contact-section_g4py7_87",
28
+ "contact-section__title": "_contact-section__title_g4py7_92",
29
+ "disabled-contact-flow": "_disabled-contact-flow_g4py7_99",
30
+ "disabled-contact-flow__icon": "_disabled-contact-flow__icon_g4py7_109",
31
+ "disabled-contact-flow__title": "_disabled-contact-flow__title_g4py7_114",
32
+ "disabled-contact-flow__subtitle": "_disabled-contact-flow__subtitle_g4py7_120",
33
+ "disabled-contact-flow__list": "_disabled-contact-flow__list_g4py7_125",
34
+ "contact-flow-setup-information": "_contact-flow-setup-information_g4py7_140",
35
+ "contact-flow-setup-information__title": "_contact-flow-setup-information__title_g4py7_149",
36
+ "contact-flow-setup-information__description": "_contact-flow-setup-information__description_g4py7_154",
37
+ "contact-flow-setup-information__list": "_contact-flow-setup-information__list_g4py7_160",
38
+ "contact-flow-setup-information__list--item": "_contact-flow-setup-information__list--item_g4py7_178",
39
+ "contact-flow-setup-information__list--item-last": "_contact-flow-setup-information__list--item-last_g4py7_185",
40
+ "contact-flow-setup-information__list--content": "_contact-flow-setup-information__list--content_g4py7_188",
41
+ "contact-flow-setup-information__list--name": "_contact-flow-setup-information__list--name_g4py7_205",
42
+ "contact-flow-setup-information__list--role": "_contact-flow-setup-information__list--role_g4py7_208",
43
+ "contact-flow-setup-information__list--email": "_contact-flow-setup-information__list--email_g4py7_211",
44
+ "contact-flow-setup-information__list--delete-item-wrapper": "_contact-flow-setup-information__list--delete-item-wrapper_g4py7_214",
45
+ "contact-flow-setup-information__list--delete-item": "_contact-flow-setup-information__list--delete-item_g4py7_214",
46
+ "contact-flow-setup-information__list--add-item-wrapper": "_contact-flow-setup-information__list--add-item-wrapper_g4py7_226",
47
+ "contact-flow-setup-information__list--add-item": "_contact-flow-setup-information__list--add-item_g4py7_226",
48
+ "delete-question-modal": "_delete-question-modal_g4py7_238",
49
+ "delete-question-modal__header": "_delete-question-modal__header_g4py7_244",
50
+ "delete-question-modal__header--icon": "_delete-question-modal__header--icon_g4py7_249",
51
+ "delete-question-modal__header--content": "_delete-question-modal__header--content_g4py7_260",
52
+ "delete-question-modal__warning": "_delete-question-modal__warning_g4py7_279",
53
+ "delete-question-modal__impact-list": "_delete-question-modal__impact-list_g4py7_295",
54
+ "delete-question-modal__actions": "_delete-question-modal__actions_g4py7_301",
55
+ "delete-question-modal__actions--cancel": "_delete-question-modal__actions--cancel_g4py7_306",
56
+ "delete-question-modal__actions--delete": "_delete-question-modal__actions--delete_g4py7_322"
57
+ }, te = ({ color: i = "#242424", opacity: o = 0.4 }) => /* @__PURE__ */ e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("g", { opacity: o, children: /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.5005 5.59319C11.6636 5.59251 11.8267 5.59183 11.9897 5.59183V5.59434C12.1178 5.59434 12.2459 5.59437 12.3739 5.5944C12.7582 5.5945 13.1425 5.59459 13.5268 5.59384C13.5314 5.59381 13.536 5.59379 13.5406 5.59377C13.6357 5.59336 13.7304 5.59295 13.8236 5.56426C14.2001 5.44945 14.4423 5.08698 14.3956 4.70295C14.348 4.30939 14.0257 4.00608 13.6201 4.00357C12.7121 3.9981 11.8042 4.00005 10.8962 4.002C10.7233 4.00238 10.5503 4.00275 10.3774 4.00307C10.3037 4.00357 10.2275 4.01661 10.1573 4.03867C9.78828 4.15448 9.55716 4.51193 9.60228 4.89095C9.64791 5.27598 9.96676 5.58181 10.3593 5.58933C10.7394 5.59634 11.12 5.59477 11.5005 5.59319ZM19.0779 6.40139H12.0079C9.64507 6.40139 7.28223 6.40139 4.91939 6.40189C4.90568 6.40189 4.89198 6.40181 4.87828 6.40174C4.77369 6.40118 4.66928 6.40061 4.56644 6.43297C4.18191 6.55329 3.9568 6.90674 4.00694 7.31785C4.05156 7.68834 4.37392 7.98363 4.76497 7.99216C5.24025 8.00168 5.71552 8.00419 6.1903 7.99165C6.36527 7.98714 6.40387 8.03928 6.40337 8.20823C6.39854 10.4889 6.39909 12.7697 6.39964 15.0504C6.39972 15.3761 6.3998 15.7019 6.39986 16.0277C6.39986 16.1884 6.39896 16.3492 6.39806 16.5099C6.39581 16.9118 6.39356 17.3138 6.40537 17.7152C6.43796 18.8117 7.26568 19.7572 8.34458 19.9583C8.52456 19.9913 8.70454 19.9989 8.88553 19.9989C9.54096 19.999 10.1963 19.9989 10.8517 19.9987C12.2717 19.9984 13.6916 19.9981 15.1117 20.0009C15.5519 20.0019 15.9715 19.9277 16.3526 19.7046C17.1818 19.2183 17.5989 18.4928 17.5984 17.5277C17.5979 16.4381 17.5978 15.3485 17.5977 14.2589C17.5975 12.2357 17.5973 10.2124 17.5944 8.18918C17.5939 8.03577 17.629 7.98814 17.7879 7.99165C18.2752 8.00218 18.763 8.00218 19.2503 7.99065C19.6213 7.98213 19.9352 7.69235 19.9888 7.3369C20.0475 6.94685 19.8414 6.58688 19.4845 6.45002C19.358 6.40116 19.2275 6.40127 19.0963 6.40138C19.0901 6.40138 19.084 6.40139 19.0779 6.40139ZM14.4 12.6432C14.3999 12.8287 14.3998 13.0142 14.3998 13.1996C14.3998 13.3944 14.4 13.5892 14.4001 13.784C14.4004 14.2386 14.4007 14.6932 14.3993 15.1474C14.3983 15.6402 14.0569 16.0036 13.5997 16.0036C13.145 16.0042 12.7975 15.6397 12.7965 15.1484C12.7935 13.8499 12.7935 12.5509 12.7965 11.2524C12.7975 10.7606 13.144 10.3971 13.5992 10.3966C14.0564 10.3961 14.3983 10.7591 14.3993 11.2519C14.4004 11.7157 14.4002 12.1794 14.4 12.6432ZM9.59778 13.7562C9.59786 13.5706 9.59794 13.3851 9.59794 13.1996C9.59794 13.0048 9.5978 12.8101 9.59767 12.6153C9.59735 12.1608 9.59704 11.7064 9.59844 11.2519C9.59944 10.7591 9.94136 10.3961 10.3986 10.3966C10.8473 10.3976 11.1987 10.7546 11.2002 11.2339C11.2053 12.5449 11.2053 13.8559 11.2002 15.1669C11.1987 15.6457 10.8463 16.0031 10.3981 16.0036C9.94136 16.0042 9.59944 15.6402 9.59844 15.1474C9.59737 14.6836 9.59757 14.2199 9.59778 13.7562Z", fill: i }) }) }), ae = ({ open: i, onClose: o, onConfirm: c }) => {
58
+ const { t: l } = S();
59
+ return /* @__PURE__ */ e(
60
+ A,
61
+ {
62
+ open: i,
63
+ onClose: o,
64
+ maxWidth: "sm",
65
+ fullWidth: !0,
66
+ PaperProps: {
67
+ style: { borderRadius: "12px" }
68
+ },
69
+ children: /* @__PURE__ */ a("div", { className: t["delete-question-modal"], children: [
70
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__header"], children: [
71
+ /* @__PURE__ */ e("div", { className: t["delete-question-modal__header--icon"], children: /* @__PURE__ */ e(D, { size: 32 }) }),
72
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__header--content"], children: [
73
+ /* @__PURE__ */ e("h2", { children: "Delete contact" }),
74
+ /* @__PURE__ */ e("p", { children: "This action will permanently remove this contact from the list." })
75
+ ] })
76
+ ] }),
77
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__warning"], children: [
78
+ /* @__PURE__ */ e(D, { size: 30 }),
79
+ /* @__PURE__ */ a("span", { children: [
80
+ /* @__PURE__ */ e("strong", { children: "Warning:" }),
81
+ " This cannot be undone"
82
+ ] })
83
+ ] }),
84
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__actions"], children: [
85
+ /* @__PURE__ */ e(
86
+ "button",
87
+ {
88
+ className: t["delete-question-modal__actions--cancel"],
89
+ onClick: o,
90
+ children: l("cancel")
91
+ }
92
+ ),
93
+ /* @__PURE__ */ e(
94
+ "button",
95
+ {
96
+ className: t["delete-question-modal__actions--delete"],
97
+ onClick: c,
98
+ children: l("delete")
99
+ }
100
+ )
101
+ ] })
102
+ ] })
103
+ }
104
+ );
105
+ }, ne = ({
106
+ contacts: i,
107
+ handleAddContactFlow: o,
108
+ handleDeleteContactFlow: c,
109
+ handleChangeValueContact: l,
110
+ contactIdToDeleteRef: d,
111
+ openModalDelete: w,
112
+ setOpenModalDelete: _
113
+ }) => {
114
+ const { t: f } = S();
115
+ return /* @__PURE__ */ a("div", { className: t["contact-flow-setup-information"], children: [
116
+ /* @__PURE__ */ e("div", { className: t["contact-flow-setup-information__title"], children: "Designated Safe Staff Information Required" }),
117
+ /* @__PURE__ */ e("div", { className: t["contact-flow-setup-information__description"], children: "Add 1-3 special contacts for notifications and contact management" }),
118
+ /* @__PURE__ */ a("div", { className: t["contact-flow-setup-information__list"], children: [
119
+ i.map((s, p) => /* @__PURE__ */ a("div", { className: `${t["contact-flow-setup-information__list--item"]} ${p === i.length - 1 ? t["contact-flow-setup-information__list--item-last"] : ""}`, children: [
120
+ /* @__PURE__ */ a("div", { className: `${t["contact-flow-setup-information__list--content"]} ${t["contact-flow-setup-information__list--name"]}`, children: [
121
+ /* @__PURE__ */ e("p", { children: f("special_contact_name") }),
122
+ /* @__PURE__ */ e(
123
+ E,
124
+ {
125
+ variant: "outlined",
126
+ value: s.name,
127
+ placeholder: "Enter contact name",
128
+ onChange: (r) => {
129
+ l(s.id, "name", r.target.value);
130
+ }
131
+ }
132
+ )
133
+ ] }),
134
+ /* @__PURE__ */ a("div", { className: `${t["contact-flow-setup-information__list--content"]} ${t["contact-flow-setup-information__list--role"]}`, children: [
135
+ /* @__PURE__ */ e("p", { children: f("contact_role") }),
136
+ /* @__PURE__ */ e(
137
+ E,
138
+ {
139
+ variant: "outlined",
140
+ value: s.role,
141
+ placeholder: "Enter contact role",
142
+ onChange: (r) => {
143
+ l(s.id, "role", r.target.value);
144
+ }
145
+ }
146
+ )
147
+ ] }),
148
+ /* @__PURE__ */ a("div", { className: `${t["contact-flow-setup-information__list--content"]} ${t["contact-flow-setup-information__list--email"]}`, children: [
149
+ /* @__PURE__ */ e("p", { children: f("contact_email") }),
150
+ /* @__PURE__ */ e(
151
+ E,
152
+ {
153
+ variant: "outlined",
154
+ value: s.email,
155
+ placeholder: "Enter email",
156
+ onChange: (r) => {
157
+ l(s.id, "email", r.target.value);
158
+ }
159
+ }
160
+ )
161
+ ] }),
162
+ /* @__PURE__ */ e("div", { className: t["contact-flow-setup-information__list--delete-item-wrapper"], children: /* @__PURE__ */ e(
163
+ "button",
164
+ {
165
+ type: "button",
166
+ className: t["contact-flow-setup-information__list--delete-item"],
167
+ onClick: () => {
168
+ s.email.trim() !== "" || s.role.trim() !== "" || s.name.trim() !== "" ? (d.current = s.id, _(!0)) : c(s.id);
169
+ },
170
+ children: /* @__PURE__ */ e(te, { opacity: 1, color: "#C44140" })
171
+ }
172
+ ) })
173
+ ] }, p)),
174
+ i.length < 5 && /* @__PURE__ */ e("div", { className: t["contact-flow-setup-information__list--add-item-wrapper"], children: /* @__PURE__ */ a(
175
+ "button",
176
+ {
177
+ type: "button",
178
+ className: t["contact-flow-setup-information__list--add-item"],
179
+ onClick: () => o(),
180
+ children: [
181
+ /* @__PURE__ */ e(H, { color: "#316CD9" }),
182
+ f("add_contact")
183
+ ]
184
+ }
185
+ ) })
186
+ ] }),
187
+ /* @__PURE__ */ e(
188
+ ae,
189
+ {
190
+ open: w,
191
+ onClose: () => {
192
+ d.current = 0, _(!1);
193
+ },
194
+ onConfirm: () => {
195
+ c(d.current || 0), d.current = 0, _(!1);
196
+ }
197
+ }
198
+ )
199
+ ] });
200
+ }, ie = ({ open: i, onClose: o, onConfirm: c }) => {
201
+ const { t: l } = S();
202
+ return /* @__PURE__ */ e(
203
+ A,
204
+ {
205
+ open: i,
206
+ onClose: o,
207
+ maxWidth: "sm",
208
+ fullWidth: !0,
209
+ PaperProps: {
210
+ style: { borderRadius: "12px" }
211
+ },
212
+ children: /* @__PURE__ */ a("div", { className: t["delete-question-modal"], children: [
213
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__header"], children: [
214
+ /* @__PURE__ */ e("div", { className: t["delete-question-modal__header--icon"], children: /* @__PURE__ */ e(D, { size: 32 }) }),
215
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__header--content"], children: [
216
+ /* @__PURE__ */ e("h2", { children: "Disable Designated Safe Staff" }),
217
+ /* @__PURE__ */ e("p", { children: "Disabling this feature will have the following impacts:" }),
218
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__impact-list"], children: [
219
+ /* @__PURE__ */ e("p", { children: "Educators will not be able to request 1-1 meetings with designated safe staff" }),
220
+ /* @__PURE__ */ e("p", { children: "Individual risk assessments will be unavailable" }),
221
+ /* @__PURE__ */ e("p", { children: "Support contact information will be hidden from educators" })
222
+ ] })
223
+ ] })
224
+ ] }),
225
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__warning"], children: [
226
+ /* @__PURE__ */ e(D, { size: 30 }),
227
+ /* @__PURE__ */ a("span", { children: [
228
+ /* @__PURE__ */ e("strong", { children: "Warning:" }),
229
+ " Educators will no longer be able to access designated safe staff support"
230
+ ] })
231
+ ] }),
232
+ /* @__PURE__ */ a("div", { className: t["delete-question-modal__actions"], children: [
233
+ /* @__PURE__ */ e(
234
+ "button",
235
+ {
236
+ className: t["delete-question-modal__actions--cancel"],
237
+ onClick: o,
238
+ children: l("cancel")
239
+ }
240
+ ),
241
+ /* @__PURE__ */ e(
242
+ "button",
243
+ {
244
+ className: t["delete-question-modal__actions--delete"],
245
+ onClick: c,
246
+ children: "Disable Anyway"
247
+ }
248
+ )
249
+ ] })
250
+ ] })
251
+ }
252
+ );
253
+ }, oe = () => {
254
+ const i = V(), [o, c] = q(!1), [l, d] = q([]), [w, _] = q(!1), [f, s] = q(!1), p = y(0), r = y(!1), C = y(!1), b = y(!1), v = y(""), F = JSON.stringify({
255
+ contacts: l
256
+ }), x = Q(F, 800), N = h(async (n) => {
257
+ const u = o;
258
+ if (c(n), !b.current) {
259
+ b.current = !0;
260
+ try {
261
+ await U({
262
+ isContactFlowEnabled: n
263
+ });
264
+ } catch (g) {
265
+ c(u), i(
266
+ I({
267
+ type: "danger",
268
+ message: g.response?.data?.title || g.message
269
+ })
270
+ );
271
+ } finally {
272
+ b.current = !1;
273
+ }
274
+ }
275
+ }, [i, o]), $ = h((n) => {
276
+ if (!n && o) {
277
+ _(!0);
278
+ return;
279
+ }
280
+ N(n);
281
+ }, [o, N]), T = h(() => {
282
+ _(!1);
283
+ }, []), z = h(() => {
284
+ _(!1), N(!1);
285
+ }, [N]), R = h(async () => {
286
+ i(Z(!0));
287
+ try {
288
+ const n = await X();
289
+ if (n.data) {
290
+ const u = !!n.data.isContactFlowEnabled;
291
+ c(u), d(n.data.contacts || []), v.current = JSON.stringify({
292
+ contacts: n.data.contacts || []
293
+ }), r.current = !0;
294
+ }
295
+ } catch (n) {
296
+ i(
297
+ I({
298
+ type: "danger",
299
+ message: n.response?.data?.title || n.message
300
+ })
301
+ );
302
+ } finally {
303
+ i(Z(!1));
304
+ }
305
+ }, [i]), P = () => {
306
+ d((n) => [
307
+ ...n,
308
+ {
309
+ ...K,
310
+ id: (n?.[n.length - 1]?.id ?? 0) + 1
311
+ }
312
+ ]);
313
+ }, B = (n) => {
314
+ d((u) => u.filter((g) => g.id !== n)), p.current = 0, s(!1);
315
+ }, O = (n, u, g) => {
316
+ d(
317
+ (j) => j.map(
318
+ (M) => M.id === n ? { ...M, [u]: g } : M
319
+ )
320
+ );
321
+ }, W = h(async () => {
322
+ if (!C.current) {
323
+ C.current = !0;
324
+ try {
325
+ await Y({
326
+ contacts: l
327
+ }), v.current = JSON.stringify({
328
+ contacts: l
329
+ });
330
+ } catch (n) {
331
+ i(
332
+ I({
333
+ type: "danger",
334
+ message: n.response?.data?.title || n.message
335
+ })
336
+ );
337
+ } finally {
338
+ C.current = !1;
339
+ }
340
+ }
341
+ }, [l, i]);
342
+ return k(() => {
343
+ R();
344
+ }, [R]), k(() => {
345
+ !r.current || x === v.current || W();
346
+ }, [x, W]), {
347
+ isContactFlowEnabled: o,
348
+ contacts: l,
349
+ openDisableModal: w,
350
+ handleChangeContactFlowEnabled: $,
351
+ handleCloseDisableModal: T,
352
+ handleConfirmDisableContactFlow: z,
353
+ handleAddContactFlow: P,
354
+ handleDeleteContactFlow: B,
355
+ handleChangeValueContact: O,
356
+ openModalDelete: f,
357
+ setOpenModalDelete: s,
358
+ contactIdToDeleteRef: p
359
+ };
360
+ }, he = () => {
361
+ const { t: i } = S(), {
362
+ isContactFlowEnabled: o,
363
+ contacts: c,
364
+ openDisableModal: l,
365
+ handleChangeContactFlowEnabled: d,
366
+ handleCloseDisableModal: w,
367
+ handleConfirmDisableContactFlow: _,
368
+ handleAddContactFlow: f,
369
+ handleDeleteContactFlow: s,
370
+ handleChangeValueContact: p,
371
+ openModalDelete: r,
372
+ setOpenModalDelete: C,
373
+ contactIdToDeleteRef: b
374
+ } = oe();
375
+ return /* @__PURE__ */ a("div", { className: t["designated-staff-page"], children: [
376
+ /* @__PURE__ */ e("div", { className: t["designated-staff-page__header"], children: /* @__PURE__ */ e(m, { className: t["designated-staff-page__title"], children: "Teachers' Well-Being Setup" }) }),
377
+ /* @__PURE__ */ a("div", { className: t["designated-staff-card"], children: [
378
+ /* @__PURE__ */ a("div", { className: t["designated-staff-card__intro"], children: [
379
+ /* @__PURE__ */ e(m, { className: t["designated-staff-card__heading"], children: i("designated_staff") }),
380
+ /* @__PURE__ */ e(m, { className: t["designated-staff-card__subheading"], children: "Configure designated safe staff information that educators can reach out to for additional support and request 1-1 meetings." })
381
+ ] }),
382
+ /* @__PURE__ */ a("div", { className: t["toggle-panel"], children: [
383
+ /* @__PURE__ */ a("div", { className: t["toggle-panel__content"], children: [
384
+ /* @__PURE__ */ e(m, { className: t["toggle-panel__title"], children: "Enable Designated Safe Staff" }),
385
+ /* @__PURE__ */ e(m, { className: t["toggle-panel__description"], children: "Allow educators to see designated safe staff contacts and request 1-1 meetings for additional support." })
386
+ ] }),
387
+ /* @__PURE__ */ e(
388
+ L,
389
+ {
390
+ checked: o,
391
+ onChange: (v, F) => d(F)
392
+ }
393
+ )
394
+ ] }),
395
+ /* @__PURE__ */ e("div", { className: t["contact-section"], children: o ? /* @__PURE__ */ a(J, { children: [
396
+ /* @__PURE__ */ e(m, { className: t["contact-section__title"], children: "Contact Information" }),
397
+ /* @__PURE__ */ e(
398
+ ne,
399
+ {
400
+ contacts: c,
401
+ handleAddContactFlow: f,
402
+ handleDeleteContactFlow: s,
403
+ handleChangeValueContact: p,
404
+ contactIdToDeleteRef: b,
405
+ openModalDelete: r,
406
+ setOpenModalDelete: C
407
+ }
408
+ )
409
+ ] }) : /* @__PURE__ */ a("div", { className: t["disabled-contact-flow"], children: [
410
+ /* @__PURE__ */ e("div", { className: t["disabled-contact-flow__icon"], children: /* @__PURE__ */ e(ee, { size: 64 }) }),
411
+ /* @__PURE__ */ e(m, { className: t["disabled-contact-flow__title"], children: "Designated Safe Staff is currently disabled" }),
412
+ /* @__PURE__ */ e(m, { className: t["disabled-contact-flow__subtitle"], children: "Following impacts:" }),
413
+ /* @__PURE__ */ a("ul", { className: t["disabled-contact-flow__list"], children: [
414
+ /* @__PURE__ */ e("li", { children: "Educators will not be able to request 1-1 meetings with designated safe staff" }),
415
+ /* @__PURE__ */ e("li", { children: "Individual risk assessments will be unavailable" }),
416
+ /* @__PURE__ */ e("li", { children: "Support contact information will be hidden from educators" })
417
+ ] })
418
+ ] }) })
419
+ ] }),
420
+ /* @__PURE__ */ e(
421
+ ie,
422
+ {
423
+ open: l,
424
+ onClose: w,
425
+ onConfirm: _
426
+ }
427
+ )
428
+ ] });
429
+ };
430
+ export {
431
+ he as default
432
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@mui/material"),u=require("mario-core"),A=require("./iconBase-C4boY5mo.cjs"),Z=require("./PlusIcon-_uz1Gy5e.cjs"),b=require("./index-C1w5Kgl4.cjs"),i=require("react"),$=require("react-redux"),P=require("./constants-IRzF9_wu.cjs"),z=require("./useDebounce-Bp3c1B3v.cjs"),N=require("./wellbeingService-BlHKtcgg.cjs");function B(n){return A.GenIcon({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M2.22 2.22a.75.75 0 0 1 1.06 0l6.783 6.782a1 1 0 0 1 .935.935l6.782 6.783a.75.75 0 1 1-1.06 1.06l-6.783-6.782a1 1 0 0 1-.935-.935L2.22 3.28a.75.75 0 0 1 0-1.06ZM3.636 16.364a9.004 9.004 0 0 1-1.39-10.936L3.349 6.53a7.503 7.503 0 0 0 1.348 8.773.75.75 0 0 1-1.061 1.061ZM6.464 13.536a5 5 0 0 1-1.213-5.103l1.262 1.262a3.493 3.493 0 0 0 1.012 2.78.75.75 0 0 1-1.06 1.06ZM16.364 3.636a9.004 9.004 0 0 1 1.39 10.937l-1.103-1.104a7.503 7.503 0 0 0-1.348-8.772.75.75 0 1 1 1.061-1.061ZM13.536 6.464a5 5 0 0 1 1.213 5.103l-1.262-1.262a3.493 3.493 0 0 0-1.012-2.78.75.75 0 0 1 1.06-1.06Z"},child:[]}]})(n)}const t={"designated-staff-page":"_designated-staff-page_g4py7_1","designated-staff-page__header":"_designated-staff-page__header_g4py7_6","designated-staff-page__title":"_designated-staff-page__title_g4py7_12","designated-staff-card":"_designated-staff-card_g4py7_20","designated-staff-card__intro":"_designated-staff-card__intro_g4py7_29","designated-staff-card__heading":"_designated-staff-card__heading_g4py7_34","designated-staff-card__subheading":"_designated-staff-card__subheading_g4py7_41","toggle-panel":"_toggle-panel_g4py7_48","toggle-panel__content":"_toggle-panel__content_g4py7_58","toggle-panel__title":"_toggle-panel__title_g4py7_63","toggle-panel__description":"_toggle-panel__description_g4py7_69","contact-section":"_contact-section_g4py7_87","contact-section__title":"_contact-section__title_g4py7_92","disabled-contact-flow":"_disabled-contact-flow_g4py7_99","disabled-contact-flow__icon":"_disabled-contact-flow__icon_g4py7_109","disabled-contact-flow__title":"_disabled-contact-flow__title_g4py7_114","disabled-contact-flow__subtitle":"_disabled-contact-flow__subtitle_g4py7_120","disabled-contact-flow__list":"_disabled-contact-flow__list_g4py7_125","contact-flow-setup-information":"_contact-flow-setup-information_g4py7_140","contact-flow-setup-information__title":"_contact-flow-setup-information__title_g4py7_149","contact-flow-setup-information__description":"_contact-flow-setup-information__description_g4py7_154","contact-flow-setup-information__list":"_contact-flow-setup-information__list_g4py7_160","contact-flow-setup-information__list--item":"_contact-flow-setup-information__list--item_g4py7_178","contact-flow-setup-information__list--item-last":"_contact-flow-setup-information__list--item-last_g4py7_185","contact-flow-setup-information__list--content":"_contact-flow-setup-information__list--content_g4py7_188","contact-flow-setup-information__list--name":"_contact-flow-setup-information__list--name_g4py7_205","contact-flow-setup-information__list--role":"_contact-flow-setup-information__list--role_g4py7_208","contact-flow-setup-information__list--email":"_contact-flow-setup-information__list--email_g4py7_211","contact-flow-setup-information__list--delete-item-wrapper":"_contact-flow-setup-information__list--delete-item-wrapper_g4py7_214","contact-flow-setup-information__list--delete-item":"_contact-flow-setup-information__list--delete-item_g4py7_214","contact-flow-setup-information__list--add-item-wrapper":"_contact-flow-setup-information__list--add-item-wrapper_g4py7_226","contact-flow-setup-information__list--add-item":"_contact-flow-setup-information__list--add-item_g4py7_226","delete-question-modal":"_delete-question-modal_g4py7_238","delete-question-modal__header":"_delete-question-modal__header_g4py7_244","delete-question-modal__header--icon":"_delete-question-modal__header--icon_g4py7_249","delete-question-modal__header--content":"_delete-question-modal__header--content_g4py7_260","delete-question-modal__warning":"_delete-question-modal__warning_g4py7_279","delete-question-modal__impact-list":"_delete-question-modal__impact-list_g4py7_295","delete-question-modal__actions":"_delete-question-modal__actions_g4py7_301","delete-question-modal__actions--cancel":"_delete-question-modal__actions--cancel_g4py7_306","delete-question-modal__actions--delete":"_delete-question-modal__actions--delete_g4py7_322"},O=({color:n="#242424",opacity:s=.4})=>e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("g",{opacity:s,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5005 5.59319C11.6636 5.59251 11.8267 5.59183 11.9897 5.59183V5.59434C12.1178 5.59434 12.2459 5.59437 12.3739 5.5944C12.7582 5.5945 13.1425 5.59459 13.5268 5.59384C13.5314 5.59381 13.536 5.59379 13.5406 5.59377C13.6357 5.59336 13.7304 5.59295 13.8236 5.56426C14.2001 5.44945 14.4423 5.08698 14.3956 4.70295C14.348 4.30939 14.0257 4.00608 13.6201 4.00357C12.7121 3.9981 11.8042 4.00005 10.8962 4.002C10.7233 4.00238 10.5503 4.00275 10.3774 4.00307C10.3037 4.00357 10.2275 4.01661 10.1573 4.03867C9.78828 4.15448 9.55716 4.51193 9.60228 4.89095C9.64791 5.27598 9.96676 5.58181 10.3593 5.58933C10.7394 5.59634 11.12 5.59477 11.5005 5.59319ZM19.0779 6.40139H12.0079C9.64507 6.40139 7.28223 6.40139 4.91939 6.40189C4.90568 6.40189 4.89198 6.40181 4.87828 6.40174C4.77369 6.40118 4.66928 6.40061 4.56644 6.43297C4.18191 6.55329 3.9568 6.90674 4.00694 7.31785C4.05156 7.68834 4.37392 7.98363 4.76497 7.99216C5.24025 8.00168 5.71552 8.00419 6.1903 7.99165C6.36527 7.98714 6.40387 8.03928 6.40337 8.20823C6.39854 10.4889 6.39909 12.7697 6.39964 15.0504C6.39972 15.3761 6.3998 15.7019 6.39986 16.0277C6.39986 16.1884 6.39896 16.3492 6.39806 16.5099C6.39581 16.9118 6.39356 17.3138 6.40537 17.7152C6.43796 18.8117 7.26568 19.7572 8.34458 19.9583C8.52456 19.9913 8.70454 19.9989 8.88553 19.9989C9.54096 19.999 10.1963 19.9989 10.8517 19.9987C12.2717 19.9984 13.6916 19.9981 15.1117 20.0009C15.5519 20.0019 15.9715 19.9277 16.3526 19.7046C17.1818 19.2183 17.5989 18.4928 17.5984 17.5277C17.5979 16.4381 17.5978 15.3485 17.5977 14.2589C17.5975 12.2357 17.5973 10.2124 17.5944 8.18918C17.5939 8.03577 17.629 7.98814 17.7879 7.99165C18.2752 8.00218 18.763 8.00218 19.2503 7.99065C19.6213 7.98213 19.9352 7.69235 19.9888 7.3369C20.0475 6.94685 19.8414 6.58688 19.4845 6.45002C19.358 6.40116 19.2275 6.40127 19.0963 6.40138C19.0901 6.40138 19.084 6.40139 19.0779 6.40139ZM14.4 12.6432C14.3999 12.8287 14.3998 13.0142 14.3998 13.1996C14.3998 13.3944 14.4 13.5892 14.4001 13.784C14.4004 14.2386 14.4007 14.6932 14.3993 15.1474C14.3983 15.6402 14.0569 16.0036 13.5997 16.0036C13.145 16.0042 12.7975 15.6397 12.7965 15.1484C12.7935 13.8499 12.7935 12.5509 12.7965 11.2524C12.7975 10.7606 13.144 10.3971 13.5992 10.3966C14.0564 10.3961 14.3983 10.7591 14.3993 11.2519C14.4004 11.7157 14.4002 12.1794 14.4 12.6432ZM9.59778 13.7562C9.59786 13.5706 9.59794 13.3851 9.59794 13.1996C9.59794 13.0048 9.5978 12.8101 9.59767 12.6153C9.59735 12.1608 9.59704 11.7064 9.59844 11.2519C9.59944 10.7591 9.94136 10.3961 10.3986 10.3966C10.8473 10.3976 11.1987 10.7546 11.2002 11.2339C11.2053 12.5449 11.2053 13.8559 11.2002 15.1669C11.1987 15.6457 10.8463 16.0031 10.3981 16.0036C9.94136 16.0042 9.59944 15.6402 9.59844 15.1474C9.59737 14.6836 9.59757 14.2199 9.59778 13.7562Z",fill:n})})}),L=({open:n,onClose:s,onConfirm:d})=>{const{t:l}=u.useTranslation();return e.jsx(c.Dialog,{open:n,onClose:s,maxWidth:"sm",fullWidth:!0,PaperProps:{style:{borderRadius:"12px"}},children:e.jsxs("div",{className:t["delete-question-modal"],children:[e.jsxs("div",{className:t["delete-question-modal__header"],children:[e.jsx("div",{className:t["delete-question-modal__header--icon"],children:e.jsx(b.IoWarning,{size:32})}),e.jsxs("div",{className:t["delete-question-modal__header--content"],children:[e.jsx("h2",{children:"Delete contact"}),e.jsx("p",{children:"This action will permanently remove this contact from the list."})]})]}),e.jsxs("div",{className:t["delete-question-modal__warning"],children:[e.jsx(b.IoWarning,{size:30}),e.jsxs("span",{children:[e.jsx("strong",{children:"Warning:"})," This cannot be undone"]})]}),e.jsxs("div",{className:t["delete-question-modal__actions"],children:[e.jsx("button",{className:t["delete-question-modal__actions--cancel"],onClick:s,children:l("cancel")}),e.jsx("button",{className:t["delete-question-modal__actions--delete"],onClick:d,children:l("delete")})]})]})})},J=({contacts:n,handleAddContactFlow:s,handleDeleteContactFlow:d,handleChangeValueContact:l,contactIdToDeleteRef:r,openModalDelete:w,setOpenModalDelete:f})=>{const{t:p}=u.useTranslation();return e.jsxs("div",{className:t["contact-flow-setup-information"],children:[e.jsx("div",{className:t["contact-flow-setup-information__title"],children:"Designated Safe Staff Information Required"}),e.jsx("div",{className:t["contact-flow-setup-information__description"],children:"Add 1-3 special contacts for notifications and contact management"}),e.jsxs("div",{className:t["contact-flow-setup-information__list"],children:[n.map((o,m)=>e.jsxs("div",{className:`${t["contact-flow-setup-information__list--item"]} ${m===n.length-1?t["contact-flow-setup-information__list--item-last"]:""}`,children:[e.jsxs("div",{className:`${t["contact-flow-setup-information__list--content"]} ${t["contact-flow-setup-information__list--name"]}`,children:[e.jsx("p",{children:p("special_contact_name")}),e.jsx(c.TextField,{variant:"outlined",value:o.name,placeholder:"Enter contact name",onChange:_=>{l(o.id,"name",_.target.value)}})]}),e.jsxs("div",{className:`${t["contact-flow-setup-information__list--content"]} ${t["contact-flow-setup-information__list--role"]}`,children:[e.jsx("p",{children:p("contact_role")}),e.jsx(c.TextField,{variant:"outlined",value:o.role,placeholder:"Enter contact role",onChange:_=>{l(o.id,"role",_.target.value)}})]}),e.jsxs("div",{className:`${t["contact-flow-setup-information__list--content"]} ${t["contact-flow-setup-information__list--email"]}`,children:[e.jsx("p",{children:p("contact_email")}),e.jsx(c.TextField,{variant:"outlined",value:o.email,placeholder:"Enter email",onChange:_=>{l(o.id,"email",_.target.value)}})]}),e.jsx("div",{className:t["contact-flow-setup-information__list--delete-item-wrapper"],children:e.jsx("button",{type:"button",className:t["contact-flow-setup-information__list--delete-item"],onClick:()=>{o.email.trim()!==""||o.role.trim()!==""||o.name.trim()!==""?(r.current=o.id,f(!0)):d(o.id)},children:e.jsx(O,{opacity:1,color:"#C44140"})})})]},m)),n.length<5&&e.jsx("div",{className:t["contact-flow-setup-information__list--add-item-wrapper"],children:e.jsxs("button",{type:"button",className:t["contact-flow-setup-information__list--add-item"],onClick:()=>s(),children:[e.jsx(Z.PlusIcon,{color:"#316CD9"}),p("add_contact")]})})]}),e.jsx(L,{open:w,onClose:()=>{r.current=0,f(!1)},onConfirm:()=>{d(r.current||0),r.current=0,f(!1)}})]})},H=({open:n,onClose:s,onConfirm:d})=>{const{t:l}=u.useTranslation();return e.jsx(c.Dialog,{open:n,onClose:s,maxWidth:"sm",fullWidth:!0,PaperProps:{style:{borderRadius:"12px"}},children:e.jsxs("div",{className:t["delete-question-modal"],children:[e.jsxs("div",{className:t["delete-question-modal__header"],children:[e.jsx("div",{className:t["delete-question-modal__header--icon"],children:e.jsx(b.IoWarning,{size:32})}),e.jsxs("div",{className:t["delete-question-modal__header--content"],children:[e.jsx("h2",{children:"Disable Designated Safe Staff"}),e.jsx("p",{children:"Disabling this feature will have the following impacts:"}),e.jsxs("div",{className:t["delete-question-modal__impact-list"],children:[e.jsx("p",{children:"Educators will not be able to request 1-1 meetings with designated safe staff"}),e.jsx("p",{children:"Individual risk assessments will be unavailable"}),e.jsx("p",{children:"Support contact information will be hidden from educators"})]})]})]}),e.jsxs("div",{className:t["delete-question-modal__warning"],children:[e.jsx(b.IoWarning,{size:30}),e.jsxs("span",{children:[e.jsx("strong",{children:"Warning:"})," Educators will no longer be able to access designated safe staff support"]})]}),e.jsxs("div",{className:t["delete-question-modal__actions"],children:[e.jsx("button",{className:t["delete-question-modal__actions--cancel"],onClick:s,children:l("cancel")}),e.jsx("button",{className:t["delete-question-modal__actions--delete"],onClick:d,children:"Disable Anyway"})]})]})})},V=()=>{const n=$.useDispatch(),[s,d]=i.useState(!1),[l,r]=i.useState([]),[w,f]=i.useState(!1),[p,o]=i.useState(!1),m=i.useRef(0),_=i.useRef(!1),C=i.useRef(!1),x=i.useRef(!1),j=i.useRef(""),v=JSON.stringify({contacts:l}),D=z.useDebounce(v,800),y=i.useCallback(async a=>{const g=s;if(d(a),!x.current){x.current=!0;try{await N.updateContactFlowEnabledApi({isContactFlowEnabled:a})}catch(h){d(g),n(u.setAlert({type:"danger",message:h.response?.data?.title||h.message}))}finally{x.current=!1}}},[n,s]),M=i.useCallback(a=>{if(!a&&s){f(!0);return}y(a)},[s,y]),T=i.useCallback(()=>{f(!1)},[]),E=i.useCallback(()=>{f(!1),y(!1)},[y]),S=i.useCallback(async()=>{n(u.setLoading(!0));try{const a=await N.getWellBeingSetup();if(a.data){const g=!!a.data.isContactFlowEnabled;d(g),r(a.data.contacts||[]),j.current=JSON.stringify({contacts:a.data.contacts||[]}),_.current=!0}}catch(a){n(u.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}finally{n(u.setLoading(!1))}},[n]),R=()=>{r(a=>[...a,{...P.InitialContactFlow,id:(a?.[a.length-1]?.id??0)+1}])},I=a=>{r(g=>g.filter(h=>h.id!==a)),m.current=0,o(!1)},k=(a,g,h)=>{r(W=>W.map(q=>q.id===a?{...q,[g]:h}:q))},F=i.useCallback(async()=>{if(!C.current){C.current=!0;try{await N.updateContactFlowApi({contacts:l}),j.current=JSON.stringify({contacts:l})}catch(a){n(u.setAlert({type:"danger",message:a.response?.data?.title||a.message}))}finally{C.current=!1}}},[l,n]);return i.useEffect(()=>{S()},[S]),i.useEffect(()=>{!_.current||D===j.current||F()},[D,F]),{isContactFlowEnabled:s,contacts:l,openDisableModal:w,handleChangeContactFlowEnabled:M,handleCloseDisableModal:T,handleConfirmDisableContactFlow:E,handleAddContactFlow:R,handleDeleteContactFlow:I,handleChangeValueContact:k,openModalDelete:p,setOpenModalDelete:o,contactIdToDeleteRef:m}},G=()=>{const{t:n}=u.useTranslation(),{isContactFlowEnabled:s,contacts:d,openDisableModal:l,handleChangeContactFlowEnabled:r,handleCloseDisableModal:w,handleConfirmDisableContactFlow:f,handleAddContactFlow:p,handleDeleteContactFlow:o,handleChangeValueContact:m,openModalDelete:_,setOpenModalDelete:C,contactIdToDeleteRef:x}=V();return e.jsxs("div",{className:t["designated-staff-page"],children:[e.jsx("div",{className:t["designated-staff-page__header"],children:e.jsx(c.Typography,{className:t["designated-staff-page__title"],children:"Teachers' Well-Being Setup"})}),e.jsxs("div",{className:t["designated-staff-card"],children:[e.jsxs("div",{className:t["designated-staff-card__intro"],children:[e.jsx(c.Typography,{className:t["designated-staff-card__heading"],children:n("designated_staff")}),e.jsx(c.Typography,{className:t["designated-staff-card__subheading"],children:"Configure designated safe staff information that educators can reach out to for additional support and request 1-1 meetings."})]}),e.jsxs("div",{className:t["toggle-panel"],children:[e.jsxs("div",{className:t["toggle-panel__content"],children:[e.jsx(c.Typography,{className:t["toggle-panel__title"],children:"Enable Designated Safe Staff"}),e.jsx(c.Typography,{className:t["toggle-panel__description"],children:"Allow educators to see designated safe staff contacts and request 1-1 meetings for additional support."})]}),e.jsx(c.Switch,{checked:s,onChange:(j,v)=>r(v)})]}),e.jsx("div",{className:t["contact-section"],children:s?e.jsxs(e.Fragment,{children:[e.jsx(c.Typography,{className:t["contact-section__title"],children:"Contact Information"}),e.jsx(J,{contacts:d,handleAddContactFlow:p,handleDeleteContactFlow:o,handleChangeValueContact:m,contactIdToDeleteRef:x,openModalDelete:_,setOpenModalDelete:C})]}):e.jsxs("div",{className:t["disabled-contact-flow"],children:[e.jsx("div",{className:t["disabled-contact-flow__icon"],children:e.jsx(B,{size:64})}),e.jsx(c.Typography,{className:t["disabled-contact-flow__title"],children:"Designated Safe Staff is currently disabled"}),e.jsx(c.Typography,{className:t["disabled-contact-flow__subtitle"],children:"Following impacts:"}),e.jsxs("ul",{className:t["disabled-contact-flow__list"],children:[e.jsx("li",{children:"Educators will not be able to request 1-1 meetings with designated safe staff"}),e.jsx("li",{children:"Individual risk assessments will be unavailable"}),e.jsx("li",{children:"Support contact information will be hidden from educators"})]})]})})]}),e.jsx(H,{open:l,onClose:w,onConfirm:f})]})};exports.default=G;