mario-core 2.0.97-release → 2.0.98-release

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 (36) hide show
  1. package/dist/Dashboard-D2zLzwFR.mjs +206 -0
  2. package/dist/Dashboard-dOwpd3sn.js +1 -0
  3. package/dist/EmailTemplateDetail-D07dUCZL.js +1 -0
  4. package/dist/EmailTemplateDetail-uNlh3Otz.mjs +443 -0
  5. package/dist/EmailTemplateList-B5ee4Byb.js +1 -0
  6. package/dist/EmailTemplateList-EZ_sAp6W.mjs +170 -0
  7. package/dist/GalleryList-CdyApn-m.mjs +329 -0
  8. package/dist/GalleryList-DFuoYp_Q.js +1 -0
  9. package/dist/Login-8c69l-hn.js +1 -0
  10. package/dist/Login-MzPc2sA6.mjs +1684 -0
  11. package/dist/NotificationList-BP871ggG.mjs +3982 -0
  12. package/dist/NotificationList-CzX65qMV.js +2 -0
  13. package/dist/SkillList-C-aJeufd.mjs +386 -0
  14. package/dist/SkillList-hMvqDcsQ.js +1 -0
  15. package/dist/TeacherSelector-CV9c0Cn8.js +1 -0
  16. package/dist/TeacherSelector-XuYxdZgr.mjs +30 -0
  17. package/dist/TheContent-BfT4R2Gc.mjs +38 -0
  18. package/dist/TheContent-BicDxizL.js +1 -0
  19. package/dist/UserContainer-DR6lGYNl.js +5 -0
  20. package/dist/UserContainer-Ip-sYnrv.mjs +2902 -0
  21. package/dist/UserDetail-iw6l5L3a.mjs +903 -0
  22. package/dist/UserDetail-uR6dMDOB.js +1 -0
  23. package/dist/UserList-DLC9FDWG.mjs +1252 -0
  24. package/dist/UserList-DUiZTiTR.js +7 -0
  25. package/dist/constants-DUelcmx7.js +1 -0
  26. package/dist/constants-QjFnVl1d.mjs +286 -0
  27. package/dist/index--POWjYN0.mjs +19073 -0
  28. package/dist/index-KWXe_Hjz.js +15 -0
  29. package/dist/index.js +1 -1
  30. package/dist/index.modern.js +1 -1
  31. package/dist/mailCategoryService-B9Yboyna.mjs +11 -0
  32. package/dist/mailCategoryService-DAw3X_PE.js +1 -0
  33. package/dist/services/userService.d.ts +1 -0
  34. package/dist/userService-DEwtByu1.js +1 -0
  35. package/dist/userService-DxucAe6U.mjs +56 -0
  36. package/package.json +1 -1
@@ -0,0 +1,903 @@
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { useState as S, useEffect as K, useCallback as b } from "react";
3
+ import { useNavigate as pe, useParams as fe } from "react-router-dom";
4
+ import { Row as P, Col as m, FormGroup as D, Input as E, Label as re, Button as V, Modal as ge, ModalHeader as we, ModalBody as ye, ModalFooter as Ne } from "reactstrap";
5
+ import { Formik as ne } from "formik";
6
+ import De from "react-datepicker";
7
+ import { format as ce } from "date-fns";
8
+ import { y as Se, z as oe, d as ve, A as Te, B as Ce, C as Pe, D as Ee, E as be, F as xe, G as Ue, H as Re, t as _e } from "./userService-DxucAe6U.mjs";
9
+ import { useDispatch as de, useSelector as Ie } from "react-redux";
10
+ import { useTranslation as Ae } from "react-i18next";
11
+ import { b as w, c as y, aa as A, ah as me, ai as Be, $ as ue, s as J, X as Fe, Y as I, E as L, aj as He, ak as Oe, al as ke, _ as Le, ag as qe } from "./index--POWjYN0.mjs";
12
+ import * as x from "yup";
13
+ import { T as $e } from "./TeacherSelector-XuYxdZgr.mjs";
14
+ import { h as le } from "./constants-QjFnVl1d.mjs";
15
+ const Me = {
16
+ id: "",
17
+ firstName: "",
18
+ lastName: "",
19
+ email: "",
20
+ dateOfBirth: "",
21
+ roles: [],
22
+ isActive: !0,
23
+ profileImageFileName: "",
24
+ teacherUserId: []
25
+ }, ie = "/admin/users/user-list", je = "User detail", ze = (o) => {
26
+ const n = de(), t = pe(), [v, B] = S(Me), [N, g] = S(!1), [F, W] = S([]), [T, p] = S(null), [Y, H] = S(!1), [R, q] = S({
27
+ isHasAssistantData: !1,
28
+ isHasCounselorData: !1,
29
+ isHasEduTeacherData: !1,
30
+ isHasSecondaryTeacherData: !1,
31
+ isHasTeacherData: !1
32
+ }), Q = async () => {
33
+ localStorage.setItem(window.location.href, "true"), H(!0);
34
+ }, [$, u] = S([]), c = () => {
35
+ g(!N);
36
+ };
37
+ K(() => {
38
+ document.title = je, H(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
39
+ }, []), K(() => {
40
+ o && (h(), M()), !o && j();
41
+ }, [o]);
42
+ const h = b(async () => {
43
+ n(w(!0));
44
+ try {
45
+ const a = await Se(o);
46
+ q(a.data);
47
+ } catch (a) {
48
+ n(
49
+ y({
50
+ type: "danger",
51
+ message: a.response?.data?.title || a.message
52
+ })
53
+ );
54
+ }
55
+ n(w(!1));
56
+ }, [o]), M = b(async () => {
57
+ n(w(!0));
58
+ try {
59
+ const a = await oe(o);
60
+ B({
61
+ ...a.data,
62
+ dateOfBirth: ce(new Date(a.data.dateOfBirth), me),
63
+ roles: a.data.roles.map((l) => l != "EduTeacher" ? l : A.EDUTEACHER)
64
+ }), u(a?.data?.roles ?? []), document.title = a.data?.fullName;
65
+ } catch (a) {
66
+ n(
67
+ y({
68
+ type: "danger",
69
+ message: a.response?.data?.title || a.message
70
+ })
71
+ );
72
+ }
73
+ n(w(!1));
74
+ }, [o]), j = async () => {
75
+ try {
76
+ const a = await ve({
77
+ sortBy: "Email"
78
+ });
79
+ a.data && W(a.data.map?.((l) => ({
80
+ label: l.email,
81
+ value: l.id
82
+ })) || []);
83
+ } catch (a) {
84
+ n(
85
+ y({
86
+ type: "danger",
87
+ message: a.response?.data?.title || a.message
88
+ })
89
+ );
90
+ }
91
+ }, O = b((a) => {
92
+ t(a && typeof a == "string" ? ie + `?query=${a}` : ie);
93
+ }, []), z = b(
94
+ async (a) => {
95
+ n(w(!0));
96
+ try {
97
+ if (T) {
98
+ const C = new FormData(), { name: _ } = T;
99
+ C.append("file", T, _);
100
+ const ae = (await Be(C))?.data?.key;
101
+ a.profileImageFileName = ae;
102
+ }
103
+ const l = o ? Te : Ce;
104
+ !o && delete a.id, a.dateOfBirth === "" && delete a.dateOfBirth;
105
+ const d = await l(a);
106
+ d && oe(d.data.id).then((C) => {
107
+ O(C.data.fullName);
108
+ }), o || alert("Password of " + d.data.email + ` is "${d.data.password}"`), d.data.id && await Pe(d.data.id, a.gradeLevel), n(
109
+ y({
110
+ type: "success",
111
+ message: `${o ? "Update" : "Create"} user successfully`
112
+ })
113
+ );
114
+ } catch (l) {
115
+ n(
116
+ y({
117
+ type: "danger",
118
+ message: l.response?.data?.title || l.message
119
+ })
120
+ );
121
+ }
122
+ n(w(!1));
123
+ },
124
+ [o, T]
125
+ ), U = (a) => ["Student", "Parent", "EduTeacher"].includes(a), Z = async (a) => {
126
+ n(w(!0));
127
+ try {
128
+ await xe(a), n(
129
+ y({
130
+ type: "success",
131
+ message: "Change password successfully"
132
+ })
133
+ );
134
+ } catch (l) {
135
+ n(
136
+ y({
137
+ type: "danger",
138
+ message: l.response?.data?.title || l.message
139
+ })
140
+ );
141
+ }
142
+ n(w(!1));
143
+ }, f = b(async (a) => {
144
+ n(w(!0));
145
+ try {
146
+ await Ee(a), n(
147
+ y({
148
+ type: "success",
149
+ message: "Send forgot password link successfully"
150
+ })
151
+ );
152
+ } catch (l) {
153
+ n(
154
+ y({
155
+ type: "danger",
156
+ message: l.response?.data?.title || l.message || "Error occured"
157
+ })
158
+ );
159
+ }
160
+ n(w(!1));
161
+ }, []), r = b(
162
+ async (a) => {
163
+ n(w(!0));
164
+ try {
165
+ const d = await be({
166
+ userId: a
167
+ });
168
+ if (d.data) {
169
+ const C = `${v.firstName} ${v.lastName}`;
170
+ alert(`Password of ${C} is ${d.data}`), n(
171
+ y({
172
+ type: "success",
173
+ message: "Update user password successfully"
174
+ })
175
+ );
176
+ }
177
+ } catch (l) {
178
+ n(
179
+ y({
180
+ type: "danger",
181
+ message: l.response?.data?.title || l.message
182
+ })
183
+ );
184
+ }
185
+ n(w(!1));
186
+ },
187
+ [v]
188
+ );
189
+ return {
190
+ userDetail: v,
191
+ backToList: O,
192
+ confirmData: z,
193
+ file: T,
194
+ setFile: p,
195
+ edited: Y,
196
+ setEdited: H,
197
+ setEditedTrue: Q,
198
+ confirmChangePassword: Z,
199
+ forgotPasswordRequest: f,
200
+ currentRoles: $,
201
+ handleDisableRoles: U,
202
+ handleResetPassword: r,
203
+ teacherOptions: F,
204
+ openModel: N,
205
+ handleToggleModel: c,
206
+ userHasData: R
207
+ };
208
+ }, Ge = x.object({
209
+ firstName: x.string().required("First name is required"),
210
+ lastName: x.string().required("Last name is required"),
211
+ email: x.string().email("Email is invalid").required("Email is required"),
212
+ roles: x.array().of(x.string()).min(1, "Role is required")
213
+ }), Ve = x.object({
214
+ oldPassword: x.string().required("Current password is required"),
215
+ newPassword: x.string().required("New password is required"),
216
+ confirmedNewPassword: x.string().required("Confirm password is required")
217
+ }), Je = {
218
+ currentPage: 1,
219
+ pageSize: 100
220
+ }, We = (o, n) => {
221
+ const [t, v] = S([]), [B, N] = S(!1), [g, F] = S(Je), [W, T] = S(), p = de(), Y = b(async () => {
222
+ N(!0);
223
+ try {
224
+ const c = (await Ue(g)).data?.items || [];
225
+ v(R(c));
226
+ } catch {
227
+ p(y({
228
+ type: "error",
229
+ message: "Cannot get roster users"
230
+ }));
231
+ }
232
+ N(!1);
233
+ }, [JSON.stringify(g)]), H = b(async () => {
234
+ if (!n) return;
235
+ const u = t.find((c) => c.value === n);
236
+ if (u) {
237
+ T(u);
238
+ return;
239
+ }
240
+ N(!0);
241
+ try {
242
+ const h = (await Re(n)).data;
243
+ T({
244
+ label: q(h),
245
+ value: h.sourcedId
246
+ });
247
+ } catch (c) {
248
+ console.log("err:", c);
249
+ }
250
+ N(!1);
251
+ }, [n]), R = (u) => u.map((c) => ({
252
+ label: q(c),
253
+ value: c.sourcedId
254
+ })), q = (u) => {
255
+ const c = [], { givenName: h, middleName: M, familyName: j, email: O, role: z } = u, U = [];
256
+ return h && U.push(h), M && U.push(M), j && U.push(j), U.length && c.push(U.join(" ")), O && c.push(O), `${c.join(" - ")}${z ? ` (${z})` : ""}`;
257
+ }, Q = (u) => {
258
+ F((c) => ({ ...c, searchString: u }));
259
+ }, $ = b((u) => {
260
+ F({
261
+ ...g,
262
+ ...u
263
+ });
264
+ }, [JSON.stringify(g)]);
265
+ return K(() => {
266
+ g.roles?.length && Y();
267
+ }, [JSON.stringify(g)]), K(() => {
268
+ $({
269
+ roles: o
270
+ });
271
+ }, [JSON.stringify(o)]), K(() => {
272
+ H();
273
+ }, [n]), {
274
+ users: t,
275
+ isLoading: B,
276
+ user: W,
277
+ handleInputChange: Q
278
+ };
279
+ }, Ye = ({ value: o, roles: n, onChange: t }) => {
280
+ const {
281
+ users: v,
282
+ isLoading: B,
283
+ user: N,
284
+ handleInputChange: g
285
+ } = We(n, o);
286
+ return /* @__PURE__ */ e(
287
+ ue,
288
+ {
289
+ options: v,
290
+ value: N,
291
+ placeholder: "Select user",
292
+ onChange: t,
293
+ isLoading: B,
294
+ onInputChange: g
295
+ }
296
+ );
297
+ }, Qe = "create_user", Xe = "edit_user", Ke = "change_password", ua = () => {
298
+ const { id: o } = fe(), n = Ie((f) => f.common.user), { t } = Ae(), {
299
+ userDetail: v,
300
+ backToList: B,
301
+ confirmData: N,
302
+ file: g,
303
+ setFile: F,
304
+ edited: W,
305
+ setEdited: T,
306
+ setEditedTrue: p,
307
+ confirmChangePassword: Y,
308
+ forgotPasswordRequest: H,
309
+ currentRoles: R,
310
+ handleDisableRoles: q,
311
+ handleResetPassword: Q,
312
+ teacherOptions: $,
313
+ openModel: u,
314
+ handleToggleModel: c,
315
+ userHasData: h
316
+ } = ze(o), M = {
317
+ oldPassword: "",
318
+ newPassword: "",
319
+ confirmedNewPassword: ""
320
+ }, j = t(o ? `${Xe}` : `${Qe}`), O = t(o ? "update" : "create"), z = () => {
321
+ var f = window.location.origin + "/api/ExportDataUser/" + o;
322
+ window.open(f);
323
+ }, U = async (f) => {
324
+ var r = {
325
+ email: f
326
+ };
327
+ H(r);
328
+ }, Z = () => {
329
+ if (!o) return;
330
+ confirm("You want to reset this user's password") == !0 && Q(o);
331
+ };
332
+ return /* @__PURE__ */ e(
333
+ ne,
334
+ {
335
+ initialValues: v,
336
+ enableReinitialize: !0,
337
+ validationSchema: Ge,
338
+ onSubmit: (f) => {
339
+ N({
340
+ ...f,
341
+ roles: f.roles.map(
342
+ (r) => r != A.EDUTEACHER ? r : "EduTeacher"
343
+ )
344
+ }), T(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
345
+ },
346
+ children: (f) => {
347
+ const {
348
+ values: r,
349
+ touched: a,
350
+ errors: l,
351
+ setFieldValue: d,
352
+ handleChange: C,
353
+ handleBlur: _,
354
+ handleSubmit: ee
355
+ } = f, ae = b(
356
+ (s) => {
357
+ if (r.roles.includes(s)) {
358
+ d(
359
+ "roles",
360
+ r.roles.filter((k) => k !== s)
361
+ );
362
+ return;
363
+ }
364
+ if ([A.STUDENT, A.PARENT].includes(s)) {
365
+ d("roles", [s]);
366
+ return;
367
+ }
368
+ if (r.roles.includes(A.STUDENT) && A.STUDENT != s) {
369
+ d("roles", [s]);
370
+ return;
371
+ }
372
+ d("roles", [...r.roles, s]);
373
+ },
374
+ [r.roles]
375
+ );
376
+ return /* @__PURE__ */ i(
377
+ "div",
378
+ {
379
+ className: `animated fadeIn detail-buttons-padding ${qe <= 767 ? J["p-0-12"] : ""}`,
380
+ children: [
381
+ /* @__PURE__ */ e(Fe, { when: W }),
382
+ /* @__PURE__ */ e("h5", { className: "mb-2", children: j }),
383
+ /* @__PURE__ */ i(P, { className: "pt-2", children: [
384
+ /* @__PURE__ */ i(m, { md: 8, children: [
385
+ /* @__PURE__ */ i(P, { children: [
386
+ /* @__PURE__ */ e(m, { md: 6, children: /* @__PURE__ */ i(D, { children: [
387
+ /* @__PURE__ */ e(
388
+ I,
389
+ {
390
+ text: t("first_name"),
391
+ className: "text-capitalize"
392
+ }
393
+ ),
394
+ /* @__PURE__ */ e(
395
+ E,
396
+ {
397
+ name: "firstName",
398
+ value: r.firstName,
399
+ onChange: (s) => {
400
+ C(s), p();
401
+ },
402
+ onBlur: _("subject"),
403
+ placeholder: t("first_name"),
404
+ className: J["input-name"]
405
+ }
406
+ ),
407
+ a.firstName && l.firstName && /* @__PURE__ */ e(
408
+ L,
409
+ {
410
+ text: l.firstName
411
+ }
412
+ )
413
+ ] }) }),
414
+ /* @__PURE__ */ e(m, { md: 6, children: /* @__PURE__ */ i(D, { children: [
415
+ /* @__PURE__ */ e(re, { children: t("date_of_birth") }),
416
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
417
+ De,
418
+ {
419
+ value: r.dateOfBirth,
420
+ todayButton: "Today",
421
+ peekNextMonth: !0,
422
+ showMonthDropdown: !0,
423
+ showYearDropdown: !0,
424
+ dropdownMode: "select",
425
+ selected: r.dateOfBirth ? _e(
426
+ new Date(
427
+ r.dateOfBirth
428
+ )
429
+ ) : null,
430
+ onChange: (s) => {
431
+ f.setFieldValue(
432
+ "dateOfBirth",
433
+ ce(
434
+ s,
435
+ me
436
+ )
437
+ ), p();
438
+ },
439
+ placeholderText: t(
440
+ "date_of_birth"
441
+ ),
442
+ customInput: /* @__PURE__ */ e(
443
+ E,
444
+ {
445
+ type: "text",
446
+ style: {
447
+ width: "maxContent"
448
+ },
449
+ placeholder: t(
450
+ "date_of_birth"
451
+ )
452
+ }
453
+ )
454
+ }
455
+ ) })
456
+ ] }) })
457
+ ] }),
458
+ /* @__PURE__ */ i(P, { children: [
459
+ /* @__PURE__ */ e(m, { md: 6, children: /* @__PURE__ */ i(D, { children: [
460
+ /* @__PURE__ */ e(
461
+ I,
462
+ {
463
+ text: t("last_name"),
464
+ className: "text-capitalize"
465
+ }
466
+ ),
467
+ /* @__PURE__ */ e(
468
+ E,
469
+ {
470
+ name: "lastName",
471
+ value: r.lastName,
472
+ onChange: (s) => {
473
+ C(s), p();
474
+ },
475
+ onBlur: _("lastName"),
476
+ placeholder: t("last_name"),
477
+ className: J["input-name"]
478
+ }
479
+ ),
480
+ a.lastName && l.lastName && /* @__PURE__ */ e(
481
+ L,
482
+ {
483
+ text: l.lastName
484
+ }
485
+ )
486
+ ] }) }),
487
+ /* @__PURE__ */ e(m, { md: 6, children: /* @__PURE__ */ i(D, { children: [
488
+ /* @__PURE__ */ e(I, { text: t("roles") }),
489
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
490
+ m,
491
+ {
492
+ md: 12,
493
+ className: "d-flex flex-wrap align-items-center",
494
+ children: He.map(
495
+ (s) => /* @__PURE__ */ e(
496
+ "div",
497
+ {
498
+ className: "mr-3",
499
+ children: /* @__PURE__ */ e(
500
+ E,
501
+ {
502
+ type: "checkbox",
503
+ id: `role-checkbox-${s}`,
504
+ label: s === "SecondaryTeacher" ? "SupportTeacher" : `${s}`,
505
+ checked: r.roles.includes(
506
+ s
507
+ ),
508
+ onChange: () => {
509
+ o && (h.isHasTeacherData && s === "Teacher" || h.isHasAssistantData && s === "Assistant" || h.isHasCounselorData && s === "Counselor" || h.isHasSecondaryTeacherData && s === "SecondaryTeacher" || s == "Student" && (h.isHasAssistantData || h.isHasCounselorData || h.isHasSecondaryTeacherData || h.isHasTeacherData)) ? alert(
510
+ "Please switch data before removing the role"
511
+ ) : (ae(
512
+ s
513
+ ), p());
514
+ },
515
+ disabled: R.includes(
516
+ "Parent"
517
+ ) || R.includes(
518
+ "Student"
519
+ ) && o ? R.concat(
520
+ [
521
+ "Student",
522
+ "Parent"
523
+ ]
524
+ ).includes(
525
+ s
526
+ ) || R.every(
527
+ q
528
+ ) : [
529
+ "Parent"
530
+ ].includes(
531
+ s
532
+ )
533
+ }
534
+ )
535
+ },
536
+ s
537
+ )
538
+ )
539
+ }
540
+ ) }),
541
+ a.roles && l.roles && /* @__PURE__ */ e(
542
+ L,
543
+ {
544
+ text: l.roles
545
+ }
546
+ )
547
+ ] }) })
548
+ ] }),
549
+ /* @__PURE__ */ i(P, { children: [
550
+ /* @__PURE__ */ e(m, { md: 6, children: /* @__PURE__ */ i(D, { children: [
551
+ /* @__PURE__ */ e(I, { text: t("email") }),
552
+ /* @__PURE__ */ e(
553
+ E,
554
+ {
555
+ name: "email",
556
+ value: r.email,
557
+ onChange: (s) => {
558
+ C(s), p();
559
+ },
560
+ onBlur: _("email"),
561
+ placeholder: t("email")
562
+ }
563
+ ),
564
+ a.email && l.email && /* @__PURE__ */ e(
565
+ L,
566
+ {
567
+ text: l.email
568
+ }
569
+ )
570
+ ] }) }),
571
+ /* @__PURE__ */ e(m, { md: 6, children: /* @__PURE__ */ i(D, { children: [
572
+ /* @__PURE__ */ e(I, { text: t("status") }),
573
+ /* @__PURE__ */ i(P, { children: [
574
+ /* @__PURE__ */ e(m, { md: 3, children: /* @__PURE__ */ e(
575
+ E,
576
+ {
577
+ id: "role-checkbox-active",
578
+ type: "radio",
579
+ name: "active",
580
+ label: t("active"),
581
+ checked: !!r && !!r.isActive,
582
+ onChange: () => {
583
+ d(
584
+ "isActive",
585
+ !0
586
+ ), p();
587
+ }
588
+ }
589
+ ) }),
590
+ /* @__PURE__ */ e(m, { md: 3, children: /* @__PURE__ */ e(
591
+ E,
592
+ {
593
+ id: "role-checkbox-inActive",
594
+ type: "radio",
595
+ name: "active",
596
+ label: t("inactive"),
597
+ checked: !!r && !r.isActive,
598
+ onChange: () => d(
599
+ "isActive",
600
+ !1
601
+ )
602
+ }
603
+ ) })
604
+ ] })
605
+ ] }) })
606
+ ] }),
607
+ r.roles.includes(A.STUDENT) && /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(m, { md: 6, children: /* @__PURE__ */ i(D, { children: [
608
+ /* @__PURE__ */ e(re, { children: "Grade Level" }),
609
+ /* @__PURE__ */ e(
610
+ ue,
611
+ {
612
+ options: le,
613
+ value: le.find(
614
+ (s) => s.value == r.gradeLevel
615
+ ),
616
+ placeholder: "Grade Level",
617
+ onChange: (s) => {
618
+ d(
619
+ "gradeLevel",
620
+ s.value
621
+ );
622
+ }
623
+ }
624
+ )
625
+ ] }) }) }),
626
+ !!o && /* @__PURE__ */ i(P, { children: [
627
+ /* @__PURE__ */ e(m, { md: 6, children: (!r.roles.includes("Admin") || r.roles.length > 1) && !!r.roles.length && /* @__PURE__ */ i(D, { children: [
628
+ /* @__PURE__ */ e(re, { children: "Map from Roster" }),
629
+ /* @__PURE__ */ e(
630
+ Ye,
631
+ {
632
+ roles: r.roles,
633
+ value: r.sourcedId,
634
+ onChange: (s) => d(
635
+ "sourcedId",
636
+ s.value
637
+ )
638
+ }
639
+ )
640
+ ] }) }),
641
+ /* @__PURE__ */ i(m, { md: 6, children: [
642
+ /* @__PURE__ */ e(
643
+ V,
644
+ {
645
+ color: "primary",
646
+ className: "w-100",
647
+ onClick: () => {
648
+ U(
649
+ r.email || ""
650
+ );
651
+ },
652
+ children: t("send_forgot_password_link")
653
+ }
654
+ ),
655
+ /* @__PURE__ */ e(
656
+ V,
657
+ {
658
+ color: "primary",
659
+ className: "w-100 mt-3",
660
+ onClick: () => Z(),
661
+ children: t("reset_password")
662
+ }
663
+ ),
664
+ /* @__PURE__ */ e(
665
+ V,
666
+ {
667
+ color: "success",
668
+ className: "w-100 mt-3",
669
+ onClick: () => {
670
+ z();
671
+ },
672
+ children: t("download_user_data")
673
+ }
674
+ )
675
+ ] })
676
+ ] })
677
+ ] }),
678
+ /* @__PURE__ */ e(m, { md: 4, children: /* @__PURE__ */ e(P, { children: /* @__PURE__ */ i(m, { md: 8, children: [
679
+ /* @__PURE__ */ e(
680
+ Oe,
681
+ {
682
+ setFile: F,
683
+ fileName: r.profileImageFileName,
684
+ onAddImage: p,
685
+ canDelete: !0,
686
+ onDelete: () => {
687
+ F(null), d(
688
+ "profileImageFileName",
689
+ ""
690
+ ), p();
691
+ }
692
+ }
693
+ ),
694
+ !g && !r.profileImageFileName && /* @__PURE__ */ e(
695
+ "img",
696
+ {
697
+ src: ke,
698
+ style: { maxWidth: "100%" }
699
+ }
700
+ )
701
+ ] }) }) })
702
+ ] }),
703
+ n.id === o ? /* @__PURE__ */ i("div", { children: [
704
+ /* @__PURE__ */ e("h5", { className: "mt-3", children: t(`${Ke}`) }),
705
+ /* @__PURE__ */ e(
706
+ ne,
707
+ {
708
+ initialValues: M,
709
+ enableReinitialize: !0,
710
+ validationSchema: Ve,
711
+ onSubmit: (s) => {
712
+ Y(s);
713
+ },
714
+ children: (s) => {
715
+ const {
716
+ values: k,
717
+ touched: se,
718
+ errors: G,
719
+ handleChange: te,
720
+ handleSubmit: he
721
+ } = s;
722
+ return /* @__PURE__ */ i(P, { className: "pt-2 pb-5", children: [
723
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ i(D, { children: [
724
+ /* @__PURE__ */ e(
725
+ I,
726
+ {
727
+ text: t(
728
+ "current_password"
729
+ ),
730
+ className: "text-capitalize"
731
+ }
732
+ ),
733
+ /* @__PURE__ */ e(
734
+ E,
735
+ {
736
+ name: "oldPassword",
737
+ type: "password",
738
+ value: k.oldPassword,
739
+ onChange: (X) => {
740
+ te(X), p();
741
+ },
742
+ onBlur: _(
743
+ "subject"
744
+ ),
745
+ placeholder: t(
746
+ "current_password"
747
+ ),
748
+ className: J["input-name"]
749
+ }
750
+ ),
751
+ se.oldPassword && G.oldPassword && /* @__PURE__ */ e(
752
+ L,
753
+ {
754
+ text: G.oldPassword
755
+ }
756
+ )
757
+ ] }) }),
758
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ i(D, { children: [
759
+ /* @__PURE__ */ e(
760
+ I,
761
+ {
762
+ text: t(
763
+ "new_password"
764
+ ),
765
+ className: "text-capitalize"
766
+ }
767
+ ),
768
+ /* @__PURE__ */ e(
769
+ E,
770
+ {
771
+ name: "newPassword",
772
+ type: "password",
773
+ value: k.newPassword,
774
+ onChange: (X) => {
775
+ te(X), p();
776
+ },
777
+ onBlur: _(
778
+ "subject"
779
+ ),
780
+ placeholder: t(
781
+ "new_password"
782
+ ),
783
+ className: J["input-name"]
784
+ }
785
+ ),
786
+ se.newPassword && G.newPassword && /* @__PURE__ */ e(
787
+ L,
788
+ {
789
+ text: G.newPassword
790
+ }
791
+ )
792
+ ] }) }),
793
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ i(D, { children: [
794
+ /* @__PURE__ */ e(
795
+ I,
796
+ {
797
+ text: t(
798
+ "confirm_password"
799
+ ),
800
+ className: "text-capitalize"
801
+ }
802
+ ),
803
+ /* @__PURE__ */ e(
804
+ E,
805
+ {
806
+ name: "confirmedNewPassword",
807
+ type: "password",
808
+ value: k.confirmedNewPassword,
809
+ onChange: (X) => {
810
+ te(X), p();
811
+ },
812
+ onBlur: _(
813
+ "subject"
814
+ ),
815
+ placeholder: t(
816
+ "confirm_password"
817
+ ),
818
+ className: J["input-name"]
819
+ }
820
+ ),
821
+ se.confirmedNewPassword && G.confirmedNewPassword && /* @__PURE__ */ e(
822
+ L,
823
+ {
824
+ text: G.confirmedNewPassword
825
+ }
826
+ )
827
+ ] }) }),
828
+ /* @__PURE__ */ e(m, { md: 12, children: /* @__PURE__ */ e(
829
+ V,
830
+ {
831
+ color: "primary",
832
+ size: "sm",
833
+ className: "px-4 pl-1 mr-2 ml-3",
834
+ onClick: () => he(),
835
+ children: t("save")
836
+ }
837
+ ) })
838
+ ] });
839
+ }
840
+ }
841
+ )
842
+ ] }) : null,
843
+ /* @__PURE__ */ e(
844
+ Le,
845
+ {
846
+ confirmText: O,
847
+ onConfirm: r.roles.includes(A.STUDENT) && !o ? c : ee,
848
+ onCancel: B
849
+ }
850
+ ),
851
+ /* @__PURE__ */ i(
852
+ ge,
853
+ {
854
+ centered: !0,
855
+ isOpen: u,
856
+ toggle: () => c(),
857
+ children: [
858
+ /* @__PURE__ */ e(we, { children: "Assign Teacher" }),
859
+ /* @__PURE__ */ e(ye, { children: /* @__PURE__ */ e(
860
+ $e,
861
+ {
862
+ isMulti: !0,
863
+ value: $.filter(
864
+ (s) => r.teacherUserId?.includes(
865
+ s.value
866
+ )
867
+ ) || null,
868
+ options: $,
869
+ onChange: (s) => d(
870
+ "teacherUserId",
871
+ s.map((k) => k.value)
872
+ ),
873
+ placeholder: t("select_teacher"),
874
+ className: "flex-grow-1 mb-3"
875
+ }
876
+ ) }),
877
+ /* @__PURE__ */ i(Ne, { className: "text-right", children: [
878
+ /* @__PURE__ */ e(V, { onClick: () => c(), children: "Cancel" }),
879
+ /* @__PURE__ */ e(
880
+ V,
881
+ {
882
+ disabled: !r.teacherUserId,
883
+ color: "primary",
884
+ onClick: () => {
885
+ ee();
886
+ },
887
+ children: "Assign"
888
+ }
889
+ )
890
+ ] })
891
+ ]
892
+ }
893
+ )
894
+ ]
895
+ }
896
+ );
897
+ }
898
+ }
899
+ );
900
+ };
901
+ export {
902
+ ua as default
903
+ };