mario-core 2.0.32-release → 2.0.33-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 (187) hide show
  1. package/dist/Dashboard-BIhv8car.js +1 -0
  2. package/dist/Dashboard-BY5BVLIW.mjs +206 -0
  3. package/dist/Dashboard-BYXh-LYm.mjs +206 -0
  4. package/dist/Dashboard-Bp0ko4Nx.js +1 -0
  5. package/dist/Dashboard-BxX4EZkL.mjs +206 -0
  6. package/dist/Dashboard-CLvLdCvD.mjs +206 -0
  7. package/dist/Dashboard-CjDPZlwI.js +1 -0
  8. package/dist/Dashboard-D4yeROnn.mjs +206 -0
  9. package/dist/Dashboard-D6igZd4M.js +1 -0
  10. package/dist/Dashboard-D7X8bg8t.mjs +206 -0
  11. package/dist/Dashboard-DRaSlZLc.js +1 -0
  12. package/dist/Dashboard-DbI4E9od.js +1 -0
  13. package/dist/EmailTemplateDetail-B-Kab5TK.mjs +443 -0
  14. package/dist/EmailTemplateDetail-BJGaN7uh.js +1 -0
  15. package/dist/EmailTemplateDetail-BOqn4rkr.mjs +417 -0
  16. package/dist/EmailTemplateDetail-BlhCa_EF.mjs +443 -0
  17. package/dist/EmailTemplateDetail-CW0ymDWF.mjs +443 -0
  18. package/dist/EmailTemplateDetail-CZKvX-_q.js +1 -0
  19. package/dist/EmailTemplateDetail-D4EupjNO.js +1 -0
  20. package/dist/EmailTemplateDetail-DDbJbMWn.js +1 -0
  21. package/dist/EmailTemplateDetail-DP04M6QH.js +1 -0
  22. package/dist/EmailTemplateDetail-DSeAyn-F.mjs +443 -0
  23. package/dist/EmailTemplateDetail-J5R0X631.mjs +443 -0
  24. package/dist/EmailTemplateDetail-c2RcFzG5.js +1 -0
  25. package/dist/EmailTemplateList-BAVOo58z.js +1 -0
  26. package/dist/EmailTemplateList-BMCpm7sf.js +1 -0
  27. package/dist/EmailTemplateList-BQCcXdif.mjs +170 -0
  28. package/dist/EmailTemplateList-BVB1lsW7.mjs +170 -0
  29. package/dist/EmailTemplateList-BVfQCPzA.js +1 -0
  30. package/dist/EmailTemplateList-C-aj1Pl0.mjs +170 -0
  31. package/dist/EmailTemplateList-C5c2T4_M.mjs +170 -0
  32. package/dist/EmailTemplateList-D3G-A7Jo.js +1 -0
  33. package/dist/EmailTemplateList-DPQTaV4-.js +1 -0
  34. package/dist/EmailTemplateList-JRLV6pZW.mjs +170 -0
  35. package/dist/EmailTemplateList-ZTs0DmjS.js +1 -0
  36. package/dist/EmailTemplateList-gwkheOgx.mjs +168 -0
  37. package/dist/GalleryList-BU1m_MP_.js +1 -0
  38. package/dist/GalleryList-BftIdfu8.js +1 -0
  39. package/dist/GalleryList-Bl4FojYJ.mjs +329 -0
  40. package/dist/GalleryList-ByJ1_7Qx.mjs +329 -0
  41. package/dist/GalleryList-CVzc1xGW.js +1 -0
  42. package/dist/GalleryList-D5E7p3kE.mjs +329 -0
  43. package/dist/GalleryList-D5ZydfSV.js +1 -0
  44. package/dist/GalleryList-DHblERzG.js +1 -0
  45. package/dist/GalleryList-DXnU-Aou.mjs +329 -0
  46. package/dist/GalleryList-DpM906eg.mjs +329 -0
  47. package/dist/GalleryList-ZJ_mdpVZ.js +1 -0
  48. package/dist/GalleryList-oJNXivHy.mjs +329 -0
  49. package/dist/Login-A2cXwovI.mjs +1380 -0
  50. package/dist/Login-B69XhtIm.mjs +1380 -0
  51. package/dist/Login-BLyikyni.mjs +1380 -0
  52. package/dist/Login-Bwr0h4GC.js +1 -0
  53. package/dist/Login-C12Whvdx.js +1 -0
  54. package/dist/Login-CIcbHD7-.mjs +1380 -0
  55. package/dist/Login-D7gUoYyV.js +1 -0
  56. package/dist/Login-DEMe7ra6.js +1 -0
  57. package/dist/Login-Dcwb-HaZ.js +1 -0
  58. package/dist/Login-Rwbmk--s.js +1 -0
  59. package/dist/Login-h3o1lUKK.mjs +1380 -0
  60. package/dist/Login-xn2j4Jqq.mjs +1380 -0
  61. package/dist/NotificationList--DZcYUS5.js +2 -0
  62. package/dist/NotificationList-D26jJ6Wc.mjs +3969 -0
  63. package/dist/NotificationList-DZ1epO3L.mjs +3969 -0
  64. package/dist/NotificationList-D_lGCmIS.js +2 -0
  65. package/dist/NotificationList-Da-pWu35.js +2 -0
  66. package/dist/NotificationList-Dogczlgr.mjs +3969 -0
  67. package/dist/NotificationList-Dv0JIP69.js +2 -0
  68. package/dist/NotificationList-DygQSzwE.mjs +3969 -0
  69. package/dist/NotificationList-Ku1m25fI.mjs +3969 -0
  70. package/dist/NotificationList-Ml4QiyAE.mjs +3969 -0
  71. package/dist/NotificationList-_AHdv4bs.js +2 -0
  72. package/dist/NotificationList-rKx7xooX.js +2 -0
  73. package/dist/SkillList-BUDiP8Ba.mjs +386 -0
  74. package/dist/SkillList-Btum0zIE.js +1 -0
  75. package/dist/SkillList-C-dw1122.js +1 -0
  76. package/dist/SkillList-C0ZfIxCl.js +1 -0
  77. package/dist/SkillList-CZTd0oz_.mjs +386 -0
  78. package/dist/SkillList-DPU-l8aA.js +1 -0
  79. package/dist/SkillList-DTxT0Hbn.js +1 -0
  80. package/dist/SkillList-DVXAACsz.mjs +386 -0
  81. package/dist/SkillList-DX530KHp.mjs +386 -0
  82. package/dist/SkillList-DahOq8Os.mjs +386 -0
  83. package/dist/SkillList-DivkFIrP.mjs +386 -0
  84. package/dist/SkillList-yosFFVsc.js +1 -0
  85. package/dist/TeacherSelector-5UVov2Wf.mjs +30 -0
  86. package/dist/TeacherSelector-Bi582rEx.mjs +30 -0
  87. package/dist/TeacherSelector-BmmfQxU8.js +1 -0
  88. package/dist/TeacherSelector-BngXAzRe.mjs +30 -0
  89. package/dist/TeacherSelector-C7-XuXfb.mjs +30 -0
  90. package/dist/TeacherSelector-C9Z5JX-P.js +1 -0
  91. package/dist/TeacherSelector-CZ1DrLUk.js +1 -0
  92. package/dist/TeacherSelector-CbJ1kPyV.js +1 -0
  93. package/dist/TeacherSelector-CkGdl96R.js +1 -0
  94. package/dist/TeacherSelector-CxDiVyno.mjs +30 -0
  95. package/dist/TeacherSelector-DomtJIQi.js +1 -0
  96. package/dist/TeacherSelector-mjBcHGJF.mjs +30 -0
  97. package/dist/TheContent-B42qwDUV.mjs +38 -0
  98. package/dist/TheContent-BW03X6oT.mjs +38 -0
  99. package/dist/TheContent-CayaQR9C.js +1 -0
  100. package/dist/TheContent-CiU0FBTA.mjs +38 -0
  101. package/dist/TheContent-D5Qx4QXe.js +1 -0
  102. package/dist/TheContent-DHWnB8WX.js +1 -0
  103. package/dist/TheContent-DPy5BFuN.js +1 -0
  104. package/dist/TheContent-Dl7_h11H.mjs +38 -0
  105. package/dist/TheContent-DxN9-GIu.mjs +38 -0
  106. package/dist/TheContent-H-Hg7kIq.js +1 -0
  107. package/dist/TheContent-aEfXKW_H.mjs +38 -0
  108. package/dist/TheContent-xUKaH5bl.js +1 -0
  109. package/dist/UserContainer-3dOz3yZF.js +5 -0
  110. package/dist/UserContainer-B-abn6--.js +5 -0
  111. package/dist/UserContainer-BIl8c0yJ.js +5 -0
  112. package/dist/UserContainer-BjYrV0kt.mjs +2783 -0
  113. package/dist/UserContainer-BoJ73Ko9.js +5 -0
  114. package/dist/UserContainer-CFnSfW2A.js +5 -0
  115. package/dist/UserContainer-CGlDCED1.mjs +2771 -0
  116. package/dist/UserContainer-CqTUtCe6.mjs +2770 -0
  117. package/dist/UserContainer-CtYpysOo.mjs +2771 -0
  118. package/dist/UserContainer-Cu6koTiw.mjs +2771 -0
  119. package/dist/UserContainer-Dz991Fto.mjs +2770 -0
  120. package/dist/UserContainer-d3ywqdWh.js +5 -0
  121. package/dist/UserDetail-BCLssfN6.mjs +902 -0
  122. package/dist/UserDetail-BRCOabYu.mjs +902 -0
  123. package/dist/UserDetail-BsWWKLof.js +1 -0
  124. package/dist/UserDetail-CkMU6eej.js +1 -0
  125. package/dist/UserDetail-Cl6y6AtA.js +1 -0
  126. package/dist/UserDetail-CqBaMe5l.mjs +902 -0
  127. package/dist/UserDetail-D36q7Em-.mjs +902 -0
  128. package/dist/UserDetail-DFjYZZOc.js +1 -0
  129. package/dist/UserDetail-DIGlXdot.mjs +914 -0
  130. package/dist/UserDetail-DizNdqsR.mjs +902 -0
  131. package/dist/UserDetail-DwNEJ0kC.js +1 -0
  132. package/dist/UserDetail-Wn1wTs2Z.js +1 -0
  133. package/dist/UserList-4XLAsuI5.mjs +1205 -0
  134. package/dist/UserList-B9_Ok-O-.js +5 -0
  135. package/dist/UserList-BAirPxDM.js +7 -0
  136. package/dist/UserList-BFRsUwHp.js +5 -0
  137. package/dist/UserList-BgtFj_YA.mjs +1171 -0
  138. package/dist/UserList-BjEBqEMi.mjs +1205 -0
  139. package/dist/UserList-C6MCzl4Q.js +7 -0
  140. package/dist/UserList-CLDgmfZl.mjs +1171 -0
  141. package/dist/UserList-CRqA2Kvb.js +7 -0
  142. package/dist/UserList-D-5W9tzb.mjs +1205 -0
  143. package/dist/UserList-D63-z7TV.mjs +1205 -0
  144. package/dist/UserList-DX_DRp8l.js +7 -0
  145. package/dist/constants-1VW88-cg.mjs +320 -0
  146. package/dist/constants-B09dcc2W.js +1 -0
  147. package/dist/constants-BSg1aI4R.js +1 -0
  148. package/dist/constants-BXFDJA-1.js +1 -0
  149. package/dist/constants-BdoFiMvT.mjs +320 -0
  150. package/dist/constants-BrOUFw2c.js +1 -0
  151. package/dist/constants-ClfPwBI0.mjs +320 -0
  152. package/dist/constants-D3RqPPqz.mjs +320 -0
  153. package/dist/constants-D5ZWXomx.js +1 -0
  154. package/dist/constants-DiRwIQ5M.mjs +320 -0
  155. package/dist/constants-bWeajrBe.js +1 -0
  156. package/dist/constants-dgRR32rI.mjs +320 -0
  157. package/dist/containers/EmailTemplate/hooks/useEmailTemplateDetail.d.ts +1 -0
  158. package/dist/containers/User/constants/types.d.ts +1 -0
  159. package/dist/containers/User/hooks/useExportUsersCsv.d.ts +1 -0
  160. package/dist/index-B3Kqv7dj.mjs +17787 -0
  161. package/dist/index-BTWI5jDz.js +15 -0
  162. package/dist/index-C1gw45bw.mjs +17792 -0
  163. package/dist/index-CFAFmJ4F.mjs +17782 -0
  164. package/dist/index-D6pNkzlV.mjs +17787 -0
  165. package/dist/index-DDw_4X4u.js +15 -0
  166. package/dist/index-DVZt7HdB.js +15 -0
  167. package/dist/index-Di2zNE1O.mjs +17792 -0
  168. package/dist/index-DzHydV61.js +15 -0
  169. package/dist/index-Ihdym4EQ.js +15 -0
  170. package/dist/index-UpEZLqQV.js +15 -0
  171. package/dist/index-cuQPyXoT.mjs +17772 -0
  172. package/dist/index.js +1 -1
  173. package/dist/index.modern.js +1 -1
  174. package/dist/mailCategoryService-BbqIjbpT.mjs +11 -0
  175. package/dist/mailCategoryService-C1sorb9h.js +1 -0
  176. package/dist/mailCategoryService-CZ9m51K4.js +1 -0
  177. package/dist/mailCategoryService-C_Lq0Uks.mjs +11 -0
  178. package/dist/mailCategoryService-DcwLjTWD.mjs +11 -0
  179. package/dist/mailCategoryService-DexSxwen.js +1 -0
  180. package/dist/mailCategoryService-DrZXrEp2.js +1 -0
  181. package/dist/mailCategoryService-DyLMoDxP.mjs +11 -0
  182. package/dist/mailCategoryService-LumZqQLL.mjs +11 -0
  183. package/dist/mailCategoryService-MyMGdKSl.mjs +11 -0
  184. package/dist/mailCategoryService-Pl31B1JT.js +1 -0
  185. package/dist/mailCategoryService-lvLdr9b4.js +1 -0
  186. package/dist/mario-core.css +1 -1
  187. package/package.json +1 -1
@@ -0,0 +1,2783 @@
1
+ import { jsxs as u, jsx as e, Fragment as tt } from "react/jsx-runtime";
2
+ import { b as F, c as C, J as nt, G as St, s as x, X as Q, _ as gt, Q as ft, $ as bt, D as Nt, a0 as wt, a1 as ot, Y as Ut, i as rt, L as $t, P as Et, B as vt, a2 as lt, a3 as it, U as Le, E as at, a4 as kt } from "./index-C1gw45bw.mjs";
3
+ import { T as Dt, v as Mt, A as dt, U as xt } from "./UserList-BjEBqEMi.mjs";
4
+ import { useState as I, useMemo as Be, useCallback as G, useEffect as te, forwardRef as yt, Fragment as Je, useRef as Ot } from "react";
5
+ import { Modal as Ce, ModalHeader as Se, ModalBody as be, ModalFooter as Ne, Button as J, Collapse as At, Card as Rt, CardBody as Lt, Row as ae, Col as j, Nav as Bt, NavItem as Ft, NavLink as Pt, TabContent as Jt, TabPane as jt, CardText as zt, Table as Tt, Tooltip as Ee, Alert as ke, Label as Vt, Input as De } from "reactstrap";
6
+ import { useTranslation as Y } from "react-i18next";
7
+ import { D as qt, i as Wt, g as Gt, a as Ht, b as Kt, c as Qt, d as Xt, T as B, e as Fe, f as ht, r as Yt, h as Me, j as Zt, u as ea, k as ta, l as aa, m as sa, n as na, G as ut, S as _e, U as Ie, o as _t } from "./constants-D3RqPPqz.mjs";
8
+ import { T as Oe } from "./TeacherSelector-Bi582rEx.mjs";
9
+ import { useDispatch as re, useSelector as ra } from "react-redux";
10
+ import la from "react-select";
11
+ import { Formik as ca } from "formik";
12
+ import * as xe from "yup";
13
+ import oa from "papaparse";
14
+ const ia = () => {
15
+ const s = re(), [l, c] = I([]), [r, a] = I(qt), [d, b] = I(0), [g, n] = I(!1), [i, _] = I([]), [o, S] = I([]), [$, O] = I(Wt), T = "", h = (D) => {
16
+ const E = {
17
+ ...r,
18
+ ...D
19
+ };
20
+ E.searchString && D.searchString && D.searchString != r.searchString && (E.currentPage = 1), a(E);
21
+ }, N = Be(() => {
22
+ const D = l.filter((y) => i.includes(y.id)).flatMap((y) => y.teachers), E = /* @__PURE__ */ new Map();
23
+ return D.forEach((y) => {
24
+ E.has(y.teacherUserId) || E.set(y.teacherUserId, y);
25
+ }), Array.from(E.values()).map((y) => ({
26
+ value: y.teacherUserId,
27
+ label: y.mainTeacherEmail
28
+ }));
29
+ }, [o, i]), R = Be(() => {
30
+ const D = l.filter((y) => i.includes(y.id)).flatMap((y) => y.counselors), E = /* @__PURE__ */ new Map();
31
+ return D.forEach((y) => {
32
+ E.has(y.counselorUserId) || E.set(y.counselorUserId, y);
33
+ }), Array.from(E.values()).map((y) => ({
34
+ value: y.counselorUserId,
35
+ label: y.counselorEmail
36
+ }));
37
+ }, [o, i]), z = Be(() => {
38
+ const D = l.filter((y) => i.includes(y.id) && y.assistantUserId).map((y) => ({
39
+ value: y.assistantUserId,
40
+ label: y.assistantEmail
41
+ })), E = /* @__PURE__ */ new Map();
42
+ return D.forEach((y) => {
43
+ E.has(y.value) || E.set(y.value, y);
44
+ }), Array.from(E.values());
45
+ }, [l, i]), W = Be(() => {
46
+ const D = l.filter((y) => i.includes(y.id) && y.secondaryTeacherUserId).map((y) => ({
47
+ value: y.secondaryTeacherUserId,
48
+ label: y.secondaryTeacherEmail
49
+ })), E = /* @__PURE__ */ new Map();
50
+ return D.forEach((y) => {
51
+ E.has(y.value) || E.set(y.value, y);
52
+ }), Array.from(E.values());
53
+ }, [l, i]), de = G((D) => {
54
+ D !== r.sortBy ? h({
55
+ sortBy: D,
56
+ orderBy: "ASC",
57
+ currentPage: 1
58
+ }) : h({
59
+ sortBy: D,
60
+ orderBy: r.orderBy !== "DESC" ? "DESC" : "ASC",
61
+ currentPage: 1
62
+ });
63
+ }, [JSON.stringify(r)]), se = async () => {
64
+ s(F(!0));
65
+ try {
66
+ const D = Object.entries(r).filter(([w, M]) => M !== void 0).reduce((w, [M, L]) => (w[M] = L, w), {}), E = {};
67
+ for (const w in D) {
68
+ const M = w.charAt(0).toLowerCase() + w.slice(1);
69
+ E[M] = D[w];
70
+ }
71
+ const y = await Gt(E);
72
+ c(y?.data?.items), b(y?.data?.totalItems);
73
+ } catch (D) {
74
+ s(
75
+ C({
76
+ type: "danger",
77
+ message: D.response?.data?.title || D.message
78
+ })
79
+ );
80
+ }
81
+ s(F(!1));
82
+ }, X = () => {
83
+ n(!g), _(l.map((D) => D.id)), S(l), g && (_([]), S([]));
84
+ }, he = (D) => {
85
+ const { id: E, checked: y } = D.target;
86
+ if (y) {
87
+ _((M) => [...M, E]);
88
+ const w = l.find((M) => M.id === E);
89
+ w && S((M) => [...M, w]);
90
+ } else
91
+ _((w) => w.filter((M) => M !== E)), S((w) => w.filter((M) => M.id !== E));
92
+ }, ue = G(() => {
93
+ r.currentPage == 1 ? se() : h({ currentPage: 1 }), _([]), S([]), n(!1);
94
+ }, [JSON.stringify(r)]);
95
+ return te(() => {
96
+ se();
97
+ }, [JSON.stringify(r)]), te(() => {
98
+ document.title = "User | Assign student";
99
+ }, []), te(() => {
100
+ h({
101
+ ...r,
102
+ searchString: T
103
+ });
104
+ }, [T]), {
105
+ handelSort: de,
106
+ handleRetrievedData: ue,
107
+ totalItem: d,
108
+ userList: l,
109
+ filters: r,
110
+ changeFilters: h,
111
+ handleSelectAll: X,
112
+ handleClickCheck: he,
113
+ isCheckAll: g,
114
+ isCheck: i,
115
+ fullName: T,
116
+ selectedUser: $,
117
+ setSelectedUser: O,
118
+ userSelected: o,
119
+ getDataUserList: se,
120
+ studentTeacherSelected: N,
121
+ studentCounselorSelected: R,
122
+ studentAssistantSelected: z,
123
+ studentSecondaryTeacherSelected: W
124
+ };
125
+ }, da = () => {
126
+ const s = re(), [l, c] = I([]), [r, a] = I(), d = async () => {
127
+ try {
128
+ const n = await Ht();
129
+ n.data.items && c(n.data.items.map?.((i) => ({
130
+ label: i.email,
131
+ value: i.id
132
+ })) || []);
133
+ } catch (n) {
134
+ s(
135
+ C({
136
+ type: "danger",
137
+ message: n.response?.data?.title || n.message
138
+ })
139
+ );
140
+ }
141
+ }, b = G((n, i) => {
142
+ let _ = l.find((o) => o.value === n);
143
+ a({
144
+ ...r,
145
+ [i]: _
146
+ });
147
+ }, [JSON.stringify(r), JSON.stringify(l)]), g = G((n, i, _) => {
148
+ c([
149
+ ...l,
150
+ n
151
+ ]), _ && a({
152
+ ...r,
153
+ [i]: n
154
+ });
155
+ }, [JSON.stringify(l), JSON.stringify(r)]);
156
+ return te(() => {
157
+ d();
158
+ }, []), {
159
+ selectedCounselors: r,
160
+ counselorOptions: l,
161
+ handleSelectCounselor: b,
162
+ handleCreateCounselorOption: g,
163
+ setSelectedCounselors: a
164
+ };
165
+ }, ha = () => {
166
+ const s = re(), [l, c] = I([]), [r, a] = I(), d = async () => {
167
+ try {
168
+ const n = await Kt();
169
+ n.data.items && c(n.data.items.map?.((i) => ({
170
+ label: i.email,
171
+ value: i.id
172
+ })) || []);
173
+ } catch (n) {
174
+ s(
175
+ C({
176
+ type: "danger",
177
+ message: n.response?.data?.title || n.message
178
+ })
179
+ );
180
+ }
181
+ }, b = G((n, i) => {
182
+ let _ = l.find((o) => o.value === n);
183
+ a({
184
+ ...r,
185
+ [i]: _
186
+ });
187
+ }, [JSON.stringify(r), JSON.stringify(l)]), g = G((n, i, _) => {
188
+ c([
189
+ ...l,
190
+ n
191
+ ]), _ && a({
192
+ ...r,
193
+ [i]: n
194
+ });
195
+ }, [JSON.stringify(l), JSON.stringify(r)]);
196
+ return te(() => {
197
+ d();
198
+ }, []), {
199
+ selectedAssistants: r,
200
+ assistantOptions: l,
201
+ handleSelectAssistant: b,
202
+ handleCreateAssistantOption: g,
203
+ setSelectedAssistants: a
204
+ };
205
+ }, ua = () => {
206
+ const s = re(), [l, c] = I([]), [r, a] = I(), d = async () => {
207
+ try {
208
+ const n = await Qt();
209
+ n.data.items && c(n.data.items.map?.((i) => ({
210
+ label: i.email,
211
+ value: i.id,
212
+ id: i.secondaryTeacherId
213
+ })) || []);
214
+ } catch (n) {
215
+ s(
216
+ C({
217
+ type: "danger",
218
+ message: n.response?.data?.title || n.message
219
+ })
220
+ );
221
+ }
222
+ }, b = G((n, i) => {
223
+ let _ = l.find((o) => o.value === n);
224
+ a({
225
+ ...r,
226
+ [i]: _
227
+ });
228
+ }, [JSON.stringify(r), JSON.stringify(l)]), g = G((n, i, _) => {
229
+ c([
230
+ ...l,
231
+ n
232
+ ]), _ && a({
233
+ ...r,
234
+ [i]: n
235
+ });
236
+ }, [JSON.stringify(l), JSON.stringify(r)]);
237
+ return te(() => {
238
+ d();
239
+ }, []), {
240
+ selectedSecondaryTeachers: r,
241
+ secondaryTeacherOptions: l,
242
+ handleSelectSecondaryTeacher: b,
243
+ handleCreateSecondaryTeacherOption: g,
244
+ setSelectedSecondaryTeachers: a
245
+ };
246
+ }, ma = () => {
247
+ const s = re(), [l, c] = I([]), [r, a] = I(), d = async () => {
248
+ try {
249
+ const n = await Xt({
250
+ sortBy: "Email"
251
+ });
252
+ n.data && c(n.data.map?.((i) => ({
253
+ label: i.email,
254
+ value: i.id
255
+ })) || []);
256
+ } catch (n) {
257
+ s(
258
+ C({
259
+ type: "danger",
260
+ message: n.response?.data?.title || n.message
261
+ })
262
+ );
263
+ }
264
+ }, b = G((n, i) => {
265
+ let _ = l.filter((o) => n.includes(o.value));
266
+ a({
267
+ ...r,
268
+ [i]: _
269
+ });
270
+ }, [JSON.stringify(r), JSON.stringify(l)]), g = G((n, i, _) => {
271
+ c([
272
+ ...l,
273
+ n
274
+ ]), _ && a({
275
+ ...r,
276
+ [i]: n
277
+ });
278
+ }, [JSON.stringify(l), JSON.stringify(r)]);
279
+ return te(() => {
280
+ d();
281
+ }, []), {
282
+ selectedTeachers: r,
283
+ teacherOptions: l,
284
+ handleSelectTeacher: b,
285
+ handleCreateTeacherOption: g,
286
+ setSelectedTeachers: a
287
+ };
288
+ }, pa = (s, l) => {
289
+ const c = [];
290
+ if (l === B.Teacher)
291
+ for (const a of s)
292
+ for (const d of a.teachers || [])
293
+ c.push({
294
+ label: d.mainTeacherEmail,
295
+ value: d.teacherUserId,
296
+ name: d.mainTeacherName
297
+ });
298
+ else if (l === B.Assistant)
299
+ for (const a of s)
300
+ a.assistantEmail && a.assistantUserId && c.push({
301
+ label: a.assistantEmail,
302
+ value: a.assistantUserId,
303
+ name: a.assistantName || ""
304
+ });
305
+ else if (l === B.Counselor)
306
+ for (const a of s)
307
+ for (const d of a.counselors || [])
308
+ c.push({
309
+ label: d.counselorEmail,
310
+ value: d.counselorUserId,
311
+ name: d.counselorName
312
+ });
313
+ const r = /* @__PURE__ */ new Map();
314
+ for (const a of c)
315
+ r.has(a.value) || r.set(a.value, a);
316
+ return Array.from(r.values()).sort(
317
+ (a, d) => a.label.localeCompare(d.label)
318
+ );
319
+ }, ga = (s, l, c, r, a, d, b, g) => {
320
+ const n = re(), [i, _] = I(!1), [o, S] = I(Fe), [$, O] = I(!1), [T, h] = I(!1), [N, R] = I(B.Teacher), [z, W] = I([]), [de, se] = I([]), [X, he] = I([]), [ue, D] = I({
321
+ header: "",
322
+ titleSelect: "",
323
+ selectPlaceholder: "",
324
+ changeTitle: "",
325
+ changePlaceholder: ""
326
+ }), [E, y] = I(""), [w, M] = I(""), [L, Z] = I(!1), [H, ee] = I(0), [K, me] = I([]), [ne, pe] = I(""), [ge, le] = I(!1), [ce, oe] = I(!1), [V, ie] = I(ht), q = (m) => {
327
+ ie({
328
+ ...V,
329
+ ...m
330
+ });
331
+ }, fe = (m) => {
332
+ if (m && m.length === 0) {
333
+ n(
334
+ C({
335
+ type: "danger",
336
+ message: "Please select students!"
337
+ })
338
+ );
339
+ return;
340
+ }
341
+ oe(!ce), S({ ...Fe }), ie({ ...ht });
342
+ }, ye = () => {
343
+ le(!ge), pe("");
344
+ }, we = (m) => {
345
+ K.includes(m) ? me(K.filter((p) => p !== m)) : me([...K, m]);
346
+ }, Ue = (m) => {
347
+ ee((p) => p === m ? -1 : m);
348
+ }, Ae = (m) => {
349
+ if (m && m.length === 0) {
350
+ n(
351
+ C({
352
+ type: "danger",
353
+ message: "Please select students!"
354
+ })
355
+ );
356
+ return;
357
+ }
358
+ _(!i), S({ ...Fe });
359
+ }, je = (m, p, f) => {
360
+ if (m && m.length === 0) {
361
+ n(
362
+ C({
363
+ type: "danger",
364
+ message: "Please select students!"
365
+ })
366
+ );
367
+ return;
368
+ }
369
+ switch (he(m), se(pa(m, p)), R(p), p) {
370
+ case B.Teacher:
371
+ D({
372
+ header: "switch_teacher",
373
+ titleSelect: "current_teacher_name",
374
+ selectPlaceholder: "select_teacher",
375
+ changeTitle: "select_teacher_change",
376
+ changePlaceholder: "select_teacher_change"
377
+ });
378
+ break;
379
+ case B.Assistant:
380
+ D({
381
+ header: "switch_assistant",
382
+ titleSelect: "current_assistant_name",
383
+ selectPlaceholder: "",
384
+ changeTitle: "",
385
+ changePlaceholder: "select_assistant_change"
386
+ });
387
+ break;
388
+ case B.Counselor:
389
+ D({
390
+ header: "switch_counselor",
391
+ titleSelect: "current_counselor_name",
392
+ selectPlaceholder: "select_counselor",
393
+ changeTitle: "select_counselor_change",
394
+ changePlaceholder: "select_counselor_change"
395
+ });
396
+ break;
397
+ case B.SecondaryTeacher:
398
+ D({
399
+ header: "switch_support_teacher",
400
+ titleSelect: "current_assistant_name",
401
+ selectPlaceholder: "",
402
+ changeTitle: "",
403
+ changePlaceholder: "select_support_teacher_change"
404
+ });
405
+ break;
406
+ }
407
+ h(!T), W(f);
408
+ }, Te = () => {
409
+ W([]), h(!1), Z(!1), R(B.Teacher), se([]), y(""), M(""), D({
410
+ header: "",
411
+ titleSelect: "",
412
+ selectPlaceholder: "",
413
+ changeTitle: "",
414
+ changePlaceholder: ""
415
+ }), me([]);
416
+ }, ze = () => {
417
+ Z(!1), ee(0), me([]);
418
+ }, Ve = async (m, p) => {
419
+ n(
420
+ nt({
421
+ isOpen: !0,
422
+ type: "warning",
423
+ message: `Do you want to change ${p === B.Teacher ? "teacher" : p === B.Assistant ? "assistant" : p === B.SecondaryTeacher ? "support teacher" : "counselor"} for ${m.length} student(s)?`,
424
+ onConfirm: async () => {
425
+ n(F(!0));
426
+ try {
427
+ const f = p === B.Teacher ? await ta(m) : p === B.Assistant ? await aa(m) : p === B.Counselor ? await sa(m) : await na(m);
428
+ f && f?.data && (Te(), a?.(), await b(), n(
429
+ C({
430
+ type: "success",
431
+ message: `Change ${p === B.Teacher ? "teacher" : p === B.Assistant ? "assistant" : p === B.SecondaryTeacher ? "support teacher" : "counselor"} successfully`
432
+ })
433
+ ));
434
+ } catch (f) {
435
+ n(
436
+ C({
437
+ type: "danger",
438
+ message: f.response?.data?.title || f.message
439
+ })
440
+ );
441
+ }
442
+ n(F(!1));
443
+ }
444
+ })
445
+ );
446
+ }, qe = () => {
447
+ let m = [];
448
+ switch (N) {
449
+ case B.Teacher:
450
+ m = X.filter((p) => {
451
+ const f = p.teachers.map((A) => A.teacherUserId);
452
+ return f.includes(w) && !f.includes(E);
453
+ }).map((p) => ({
454
+ studentId: p.studentId,
455
+ teacher: w,
456
+ teacherChange: E
457
+ }));
458
+ break;
459
+ case B.Counselor:
460
+ m = X.filter((p) => {
461
+ const f = p.counselors.map((A) => A.counselorUserId);
462
+ return f.includes(w) && !f.includes(E);
463
+ }).map((p) => ({
464
+ studentId: p.studentId,
465
+ counselor: w,
466
+ counselorChange: E
467
+ }));
468
+ break;
469
+ case B.Assistant:
470
+ m = X.filter((p) => p?.assistantUserId && p?.teachers?.length > 0).map((p) => ({
471
+ studentId: p.studentId,
472
+ assistantUserId: E
473
+ }));
474
+ break;
475
+ case B.SecondaryTeacher:
476
+ m = X.filter((p) => p?.secondaryTeacherUserId && p?.teachers?.length > 0).map((p) => ({
477
+ studentId: p.studentId,
478
+ secondaryTeacherId: E
479
+ }));
480
+ break;
481
+ }
482
+ if (m.length === 0) {
483
+ n(
484
+ C({
485
+ type: "danger",
486
+ message: "No change to update!"
487
+ })
488
+ );
489
+ return;
490
+ }
491
+ Ve(m || [], N);
492
+ }, We = (m) => {
493
+ if (m && m.length === 0) {
494
+ n(
495
+ C({
496
+ type: "danger",
497
+ message: "Please select student(s)!"
498
+ })
499
+ );
500
+ return;
501
+ }
502
+ O(!$);
503
+ }, Ge = (m, p) => {
504
+ switch (m) {
505
+ case "assistant":
506
+ S({
507
+ ...o,
508
+ assistantId: p.value,
509
+ assistantEmail: p.label
510
+ });
511
+ break;
512
+ case "secondary":
513
+ S({
514
+ ...o,
515
+ secondaryTeacherId: p.value,
516
+ secondaryTeacherEmail: p.label
517
+ });
518
+ break;
519
+ case "grade":
520
+ S({
521
+ ...o,
522
+ gradeLevel: p.value
523
+ });
524
+ break;
525
+ }
526
+ }, He = (m) => {
527
+ S({
528
+ ...o,
529
+ teacher: m
530
+ });
531
+ }, Ke = (m) => {
532
+ S({
533
+ ...o,
534
+ counselors: m
535
+ });
536
+ }, $e = async (m) => {
537
+ n(F(!0));
538
+ try {
539
+ await Me(m), n(
540
+ C({
541
+ type: "success",
542
+ message: "Student assigned successfully"
543
+ })
544
+ ), a?.(), Te();
545
+ } catch (p) {
546
+ n(
547
+ C({
548
+ type: "danger",
549
+ message: p.response?.data?.title || p.message
550
+ })
551
+ );
552
+ }
553
+ n(F(!1));
554
+ }, Qe = G((m) => {
555
+ if (m.length === 0) {
556
+ n(
557
+ C({
558
+ type: "danger",
559
+ message: "Not found selected student."
560
+ })
561
+ );
562
+ return;
563
+ }
564
+ if (m.some((A) => {
565
+ const U = s?.[A], t = l?.[A], v = c?.[A], k = r?.[A];
566
+ return !U && !t && !v && !k;
567
+ })) {
568
+ n(
569
+ C({
570
+ type: "danger",
571
+ message: "Please select/add teacher for all selected student first."
572
+ })
573
+ );
574
+ return;
575
+ }
576
+ const f = m.map((A) => {
577
+ const U = s?.[A], t = l?.[A], v = c?.[A], k = r?.[A], P = {
578
+ id: A
579
+ };
580
+ return U && (P.mainTeacherUserId = U ? U.map((ve) => ve.value) : void 0, P.mainTeacherEmail = U ? U.map((ve) => ve.label) : void 0), t && (P.assistantUserId = t?.value && typeof t?.value == "string" ? t?.value : void 0, P.assistantEmail = t?.value && typeof t?.value == "number" ? t?.label : void 0), v && (P.counselorUserIds = v ? v.map((ve) => ve.value) : void 0, P.counselorEmails = v ? v.map((ve) => ve.label) : void 0), k && (P.secondaryTeacherUserId = k?.value && typeof k?.value == "string" ? k?.value : void 0, P.secondaryTeacherEmail = k?.value && typeof k?.value == "number" ? k?.label : void 0), P;
581
+ });
582
+ $e([...f]);
583
+ }, [JSON.stringify(s), JSON.stringify(l), JSON.stringify(c), JSON.stringify(r)]), Xe = G((m) => {
584
+ const p = s?.[m], f = l?.[m], A = c?.[m], U = r?.[m];
585
+ if (!p && !f && !A && !U) {
586
+ n(
587
+ C({
588
+ type: "danger",
589
+ message: "Please select/add teacher for selected student first."
590
+ })
591
+ );
592
+ return;
593
+ }
594
+ const t = {
595
+ id: m
596
+ };
597
+ p && (t.mainTeacherUserId = p ? p.map((v) => v.value) : void 0, t.mainTeacherEmail = p ? p.map((v) => v.label) : void 0), f && (t.assistantUserId = f?.value && typeof f?.value == "string" ? f?.value : void 0, t.assistantEmail = f?.value && typeof f?.value == "number" ? f?.label : void 0), A && (t.counselorUserIds = A ? A.map((v) => v.value) : void 0, t.counselorEmails = A ? A.map((v) => v.label) : void 0), U && (t.secondaryTeacherUserId = U?.value && typeof U?.value == "string" ? U?.value : void 0, t.secondaryTeacherEmail = U?.value && typeof U?.value == "number" ? U?.label : void 0), $e([t]);
598
+ }, [JSON.stringify(s), JSON.stringify(l), JSON.stringify(c), JSON.stringify(r)]), Re = async (m) => {
599
+ if (m.length === 0) {
600
+ n(
601
+ C({
602
+ type: "danger",
603
+ message: "Not found selected student."
604
+ })
605
+ );
606
+ return;
607
+ }
608
+ if (o.teacher.length === 0 && o.counselors.length === 0 && !o.assistantId && !o.secondaryTeacherId) {
609
+ n(
610
+ C({
611
+ type: "danger",
612
+ message: "No change to assign!"
613
+ })
614
+ );
615
+ return;
616
+ }
617
+ const p = g?.filter((f) => m?.includes(f.id))?.every((f) => Array.isArray(f.teachers) && f.teachers.length > 0) ?? !1;
618
+ if (o.teacher.length === 0 && !p) {
619
+ n(
620
+ C({
621
+ type: "danger",
622
+ message: "Please assign a teacher to each student before giving other educators access to them"
623
+ })
624
+ );
625
+ return;
626
+ }
627
+ n(F(!0));
628
+ try {
629
+ if (o.teacher.length > 0 && g && g.length > 0) {
630
+ const U = g.filter((t) => m.includes(t.id)).map((t) => {
631
+ const v = t.teachers?.map((P) => P.teacherUserId) || [], k = o.teacher.filter(
632
+ (P) => !v.includes(P.id)
633
+ );
634
+ return {
635
+ id: t.id,
636
+ mainTeacherUserId: k.map((P) => P.id),
637
+ mainTeacherEmail: k.map((P) => P.email)
638
+ };
639
+ }).filter((t) => t.mainTeacherUserId.length > 0 || t.mainTeacherEmail.length > 0);
640
+ U.length > 0 && await Me(U);
641
+ }
642
+ if (o.counselors.length > 0 && g && g.length > 0) {
643
+ const U = g.filter((t) => m.includes(t.id)).map((t) => {
644
+ const v = t.counselors?.map((P) => P.counselorUserId) || [], k = o.counselors.filter(
645
+ (P) => !v.includes(P.id)
646
+ );
647
+ return {
648
+ id: t.id,
649
+ counselorUserIds: k.map((P) => P.id),
650
+ counselorEmails: k.map((P) => P.email)
651
+ };
652
+ }).filter((t) => t.counselorUserIds.length > 0 || t.counselorEmails.length > 0);
653
+ U.length > 0 && await Me(U);
654
+ }
655
+ const f = g?.filter((U) => !U.assistantUserId);
656
+ if (f && f?.length > 0 && o.assistantId) {
657
+ const U = f.map((t) => ({
658
+ id: t.id,
659
+ assistantUserId: o.assistantId,
660
+ assistantEmail: o.assistantEmail
661
+ }));
662
+ await Me(U.filter((t) => t !== void 0));
663
+ }
664
+ const A = g?.filter((U) => !U.secondaryTeacherUserId);
665
+ if (A && A?.length > 0 && o.secondaryTeacherId) {
666
+ const U = A.map((t) => ({
667
+ id: t.id,
668
+ secondaryTeacherUserId: o.secondaryTeacherId,
669
+ secondaryTeacherEmail: o.secondaryTeacherEmail
670
+ }));
671
+ await Me(U.filter((t) => t !== void 0));
672
+ }
673
+ n(
674
+ C({
675
+ type: "success",
676
+ message: "Student assigned successfully"
677
+ })
678
+ ), a?.(), Te(), Ae();
679
+ } catch (f) {
680
+ n(
681
+ C({
682
+ type: "danger",
683
+ message: f.response?.data?.title || f.message
684
+ })
685
+ );
686
+ }
687
+ n(F(!1));
688
+ }, Ye = async (m) => {
689
+ if (o.teacher.length === 0) {
690
+ n(
691
+ C({
692
+ type: "danger",
693
+ message: "Please select teacher before assign!"
694
+ })
695
+ );
696
+ return;
697
+ }
698
+ if (K.length > 0 && !m) {
699
+ le(!0);
700
+ return;
701
+ }
702
+ const p = {
703
+ id: d?.id || "",
704
+ mainTeacherUserId: o.teacher.filter((f) => !d?.teachers?.some((A) => A.teacherUserId === f.id)).map((f) => f.id) || [],
705
+ mainTeacherEmail: o.teacher.filter((f) => !d?.teachers?.some((A) => A.teacherUserId === f.id)).map((f) => f.email) || [],
706
+ assistantUserId: o?.assistantId ? o?.assistantId : void 0,
707
+ assistantEmail: o?.assistantEmail ? o?.assistantEmail : void 0,
708
+ counselorUserIds: o.counselors.map((f) => f.id) || [],
709
+ counselorEmails: o.counselors.map((f) => f.email) || [],
710
+ secondaryTeacherUserId: o?.secondaryTeacherId ? o?.secondaryTeacherId : void 0,
711
+ secondaryTeacherEmail: o?.secondaryTeacherEmail ? o?.secondaryTeacherEmail : void 0,
712
+ removeTeacherUserIds: K,
713
+ teacherSwitchUserId: m || ""
714
+ };
715
+ o?.gradeLevel && o.gradeLevel !== d?.gradeLevel && await Zt(d?.id || "", o?.gradeLevel), $e([p]);
716
+ }, Ze = async (m, p) => {
717
+ n(F(!0));
718
+ try {
719
+ (await ea(m)).status == 200 && (n(
720
+ C({
721
+ type: "success",
722
+ message: `Inactive ${m.length} Students successfully`
723
+ })
724
+ ), p());
725
+ } catch (f) {
726
+ n(
727
+ C({
728
+ type: "danger",
729
+ message: f.response?.data?.title || f.message
730
+ })
731
+ );
732
+ }
733
+ O(!$), n(F(!1));
734
+ }, et = G(async (m) => {
735
+ if (V.assistantRemoveUserId.length && !V.assistantSwitchDataUserId) {
736
+ n(
737
+ C({
738
+ type: "danger",
739
+ message: "Please select an assistant to transfer data!"
740
+ })
741
+ );
742
+ return;
743
+ }
744
+ if (V.teacherRemoveUserIds.length && !V.teacherSwitchDataUserId) {
745
+ n(
746
+ C({
747
+ type: "danger",
748
+ message: "Please select a teacher to transfer data!"
749
+ })
750
+ );
751
+ return;
752
+ }
753
+ if (V.counselorRemoveUserIds.length && !V.counselorSwitchDataUserId) {
754
+ n(
755
+ C({
756
+ type: "danger",
757
+ message: "Please select a counselor to transfer data!"
758
+ })
759
+ );
760
+ return;
761
+ }
762
+ if (V.supportTeacherRemoveUserIds.length && !V.supportTeacherSwitchDataUserId) {
763
+ n(
764
+ C({
765
+ type: "danger",
766
+ message: "Please select a support teacher to transfer data!"
767
+ })
768
+ );
769
+ return;
770
+ }
771
+ n(F(!0));
772
+ try {
773
+ await Yt({ ...V, studentUserIds: m || [] }), a?.(), await b();
774
+ } catch (p) {
775
+ n(
776
+ C({
777
+ type: "danger",
778
+ message: p.response?.data?.title || p.message
779
+ })
780
+ );
781
+ }
782
+ fe(), n(F(!1));
783
+ }, [V]);
784
+ return te(() => (d?.id && S({
785
+ teacher: d?.teachers?.map((m) => ({
786
+ id: m.teacherUserId,
787
+ email: m.mainTeacherEmail
788
+ })),
789
+ assistantId: d?.assistantUserId,
790
+ assistantEmail: d?.assistantEmail,
791
+ counselors: d?.counselors?.map((m) => ({
792
+ id: m.counselorUserId,
793
+ email: m.counselorEmail
794
+ })),
795
+ secondaryTeacherEmail: d?.secondaryTeacherEmail,
796
+ secondaryTeacherId: d?.secondaryTeacherUserId,
797
+ gradeLevel: d?.gradeLevel
798
+ }), () => {
799
+ S(Fe);
800
+ }), [d]), {
801
+ handleAssignSingleStudent: Xe,
802
+ handleAssignMultiStudent: Qe,
803
+ openModelBulk: i,
804
+ handleToggleModel: Ae,
805
+ handleChangeStaffBulk: Ge,
806
+ staffBulkAssign: o,
807
+ onAssignStaffToStudents: Re,
808
+ handleToggleInactiveModal: We,
809
+ openInactiveModal: $,
810
+ handleInactiveStudents: Ze,
811
+ handleChangeTeacherBulk: He,
812
+ handleEditAssignForStudents: Ye,
813
+ handleToggleSwitchModel: je,
814
+ openSwitchModal: T,
815
+ optionsSwitch: z,
816
+ modalType: N,
817
+ textModal: ue,
818
+ teacherSwitchList: de,
819
+ onCloseSwitchModal: Te,
820
+ handleUpdateSwitch: qe,
821
+ setTeacherChangeUserId: y,
822
+ setTeacherSelectForChangeUserId: M,
823
+ teacherSelectForChangeUserId: w,
824
+ openDetailModal: L,
825
+ setOpenDetailModal: Z,
826
+ toggleCollapse: Ue,
827
+ activeIndex: H,
828
+ handleChangeCounselorBulk: Ke,
829
+ onClose: ze,
830
+ removeTeacherUserIds: K,
831
+ onSelectRemoveTeacher: we,
832
+ openModelSwitchDataTeacher: ge,
833
+ onToggleModelSwitchDataTeacher: ye,
834
+ teacherSwitchUserId: ne,
835
+ setTeacherSwitchUserId: pe,
836
+ onToggleModelDeleteBulk: fe,
837
+ openModelDeleteBulk: ce,
838
+ handelChangeStaffRemove: q,
839
+ switchStaffUsers: V,
840
+ handleRemoveBulkStaff: et
841
+ };
842
+ };
843
+ function fa(s) {
844
+ return St({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M228.9 79.9L51.8 403.1C40.6 423.3 55.5 448 78.9 448h354.3c23.3 0 38.2-24.7 27.1-44.9L283.1 79.9c-11.7-21.2-42.5-21.2-54.2 0zM273.6 214L270 336h-28l-3.6-122h35.2zM256 402.4c-10.7 0-19.1-8.1-19.1-18.4s8.4-18.4 19.1-18.4 19.1 8.1 19.1 18.4-8.4 18.4-19.1 18.4z" } }] })(s);
845
+ }
846
+ const va = (s) => {
847
+ const {
848
+ textModal: l,
849
+ isOpen: c,
850
+ teachers: r,
851
+ options: a,
852
+ onClose: d,
853
+ onSave: b,
854
+ modalType: g,
855
+ setTeacherChangeUserId: n,
856
+ setTeacherSelectForChangeUserId: i,
857
+ teacherSelectForChangeUserId: _
858
+ } = s, { t: o } = Y();
859
+ return /* @__PURE__ */ u(
860
+ Ce,
861
+ {
862
+ centered: !0,
863
+ isOpen: c,
864
+ toggle: d,
865
+ zIndex: 1201,
866
+ children: [
867
+ /* @__PURE__ */ e(Se, { className: x["header-assign-for-student"], children: o(l.header) }),
868
+ /* @__PURE__ */ u(be, { children: [
869
+ g !== B.Assistant || g !== B.SecondaryTeacher && /* @__PURE__ */ u(Je, { children: [
870
+ /* @__PURE__ */ e("div", { children: o(l.titleSelect) }),
871
+ /* @__PURE__ */ e("ul", { style: { maxHeight: 200, overflow: "auto" }, children: r.map((S) => /* @__PURE__ */ u("li", { children: [
872
+ S.name,
873
+ "-",
874
+ S.label
875
+ ] }, S.label)) })
876
+ ] }),
877
+ (g === B.Teacher || g === B.Counselor) && /* @__PURE__ */ u(Je, { children: [
878
+ /* @__PURE__ */ e("div", { children: o(l.selectPlaceholder) }),
879
+ /* @__PURE__ */ e(
880
+ Q,
881
+ {
882
+ options: r,
883
+ value: r.filter((S) => S.value === _),
884
+ placeholder: o(l.selectPlaceholder),
885
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
886
+ onChange: (S) => {
887
+ i(S.value);
888
+ },
889
+ isClearable: !0,
890
+ style: { maxWidth: 120 }
891
+ }
892
+ )
893
+ ] }),
894
+ /* @__PURE__ */ e("div", { children: o(l.changeTitle) }),
895
+ /* @__PURE__ */ e(
896
+ Oe,
897
+ {
898
+ options: a,
899
+ onChange: (S) => {
900
+ g !== B.SecondaryTeacher ? n(S.value) : n(S.id);
901
+ },
902
+ placeholder: o(l.changePlaceholder),
903
+ className: "flex-grow-1 mb-3"
904
+ }
905
+ )
906
+ ] }),
907
+ /* @__PURE__ */ u(Ne, { className: "textModal-right", children: [
908
+ /* @__PURE__ */ e(J, { onClick: () => d(!1), children: o("cancel") }),
909
+ /* @__PURE__ */ e(J, { color: "primary", onClick: () => {
910
+ b();
911
+ }, children: o("save") })
912
+ ] })
913
+ ]
914
+ }
915
+ );
916
+ }, ya = yt(va), Ta = ({
917
+ openDetailModal: s,
918
+ onClose: l,
919
+ selectedUser: c,
920
+ staffBulkAssign: r,
921
+ teacherOptions: a,
922
+ handleChangeTeacherBulk: d,
923
+ handleChangeCounselorBulk: b,
924
+ assistantOptions: g,
925
+ counselorOptions: n,
926
+ secondaryTeacherOptions: i,
927
+ handleChangeStaffBulk: _,
928
+ handleEditAssignForStudents: o,
929
+ toggleCollapse: S,
930
+ activeIndex: $
931
+ }) => {
932
+ const { t: O } = Y(), T = [
933
+ c?.teachers || [],
934
+ c?.counselors || []
935
+ ];
936
+ return /* @__PURE__ */ u(
937
+ Ce,
938
+ {
939
+ centered: !0,
940
+ isOpen: s,
941
+ toggle: () => l(),
942
+ zIndex: 1201,
943
+ children: [
944
+ /* @__PURE__ */ u(Se, { className: x["header-assign-for-student"], children: [
945
+ /* @__PURE__ */ u("div", { children: [
946
+ "Assign student ",
947
+ c?.fullName
948
+ ] }),
949
+ /* @__PURE__ */ u("div", { children: [
950
+ "Grade ",
951
+ c?.gradeLevel
952
+ ] })
953
+ ] }),
954
+ /* @__PURE__ */ u(be, { children: [
955
+ T.map((h, N) => /* @__PURE__ */ u("div", { children: [
956
+ /* @__PURE__ */ u(
957
+ "button",
958
+ {
959
+ type: "button",
960
+ className: `btn ${x["btn-collapse"]} ${$ === N ? "btn-link " : ""}`,
961
+ onClick: () => S(N),
962
+ children: [
963
+ O(N === 0 ? "current_teacher_name" : "current_counselor_name"),
964
+ " ",
965
+ `(${h.length})`,
966
+ " ",
967
+ /* @__PURE__ */ e("i", { className: `fa fa-angle-${$ === N ? "up" : "down"}` })
968
+ ]
969
+ }
970
+ ),
971
+ /* @__PURE__ */ e(At, { isOpen: $ === N, children: /* @__PURE__ */ e(Rt, { children: /* @__PURE__ */ e(Lt, { children: h.length > 0 ? h.map((R) => N === 0 ? /* @__PURE__ */ u("li", { children: [
972
+ R.mainTeacherName,
973
+ " - ",
974
+ R.mainTeacherEmail
975
+ ] }, R.mainTeacherEmail) : /* @__PURE__ */ u("li", { children: [
976
+ R.counselorName,
977
+ " - ",
978
+ R.counselorEmail
979
+ ] }, R.counselorUserId)) : /* @__PURE__ */ e("div", { children: O("no_data") }) }) }) })
980
+ ] }, N)),
981
+ /* @__PURE__ */ e("div", { children: O("teacher_email") }),
982
+ /* @__PURE__ */ e(
983
+ Q,
984
+ {
985
+ isMulti: !0,
986
+ value: r.teacher.filter((h) => !c.teachers?.some((N) => N.teacherUserId === h.id)).map((h) => ({ label: h.email, value: h.id })),
987
+ options: a.filter((h) => !c.teachers?.some((N) => N.teacherUserId === h.value)),
988
+ placeholder: O("select_teacher"),
989
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
990
+ onChange: (h) => {
991
+ const N = h.map((R) => ({
992
+ id: R.value,
993
+ email: R.label
994
+ }));
995
+ d(N);
996
+ },
997
+ isClearable: !0,
998
+ style: { maxWidth: 120 }
999
+ }
1000
+ ),
1001
+ /* @__PURE__ */ e("div", { children: O("assistant_email") }),
1002
+ /* @__PURE__ */ e(
1003
+ Oe,
1004
+ {
1005
+ value: g.find((h) => h.value == r.assistantId || h.label == r.assistantEmail) || null,
1006
+ options: g,
1007
+ onChange: (h) => {
1008
+ _("assistant", h);
1009
+ },
1010
+ placeholder: O("select_assistant"),
1011
+ className: "flex-grow-1 mb-3"
1012
+ }
1013
+ ),
1014
+ /* @__PURE__ */ e("div", { children: O("counselor_email") }),
1015
+ /* @__PURE__ */ e(
1016
+ Q,
1017
+ {
1018
+ isMulti: !0,
1019
+ value: r.counselors.filter((h) => !c.counselors?.some((N) => N.counselorUserId === h.id)).map((h) => ({ label: h.email, value: h.id })),
1020
+ options: n.filter((h) => !c.counselors?.some((N) => N.counselorUserId === h.value)),
1021
+ placeholder: O("select_counselor"),
1022
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1023
+ onChange: (h) => {
1024
+ const N = h.map((R) => ({
1025
+ id: R.value,
1026
+ email: R.label
1027
+ }));
1028
+ b(N);
1029
+ },
1030
+ isClearable: !0,
1031
+ style: { maxWidth: 120 }
1032
+ }
1033
+ ),
1034
+ /* @__PURE__ */ e("div", { children: O("support_teacher_email") }),
1035
+ /* @__PURE__ */ e(
1036
+ Oe,
1037
+ {
1038
+ value: i.find((h) => h.value == r.secondaryTeacherId || h.label == r.secondaryTeacherEmail) || null,
1039
+ options: i,
1040
+ onChange: (h) => {
1041
+ _("secondary", h);
1042
+ },
1043
+ placeholder: O("select_support_teacher"),
1044
+ className: "flex-grow-1"
1045
+ }
1046
+ ),
1047
+ /* @__PURE__ */ e("div", { children: O("grade") }),
1048
+ /* @__PURE__ */ e(
1049
+ la,
1050
+ {
1051
+ value: ut.find((h) => h.value === r.gradeLevel),
1052
+ options: ut,
1053
+ placeholder: O("select_grade"),
1054
+ className: "flex-grow-1 mb-3",
1055
+ onChange: (h) => {
1056
+ _("grade", h);
1057
+ },
1058
+ styles: {
1059
+ container: (h) => ({ ...h, maxWidth: 120 })
1060
+ }
1061
+ }
1062
+ )
1063
+ ] }),
1064
+ /* @__PURE__ */ u(Ne, { className: "text-right", children: [
1065
+ /* @__PURE__ */ e(J, { onClick: () => l(), children: O("cancel") }),
1066
+ /* @__PURE__ */ e(J, { color: "primary", onClick: () => {
1067
+ o();
1068
+ }, children: O("save") })
1069
+ ] })
1070
+ ]
1071
+ }
1072
+ );
1073
+ }, _a = ({
1074
+ open: s,
1075
+ onClose: l,
1076
+ teachers: c,
1077
+ onConfirm: r,
1078
+ teacherSwitchUserId: a,
1079
+ setTeacherSwitchUserId: d
1080
+ }) => {
1081
+ const { t: b } = Y();
1082
+ return /* @__PURE__ */ u(Ce, { centered: !0, isOpen: s, toggle: () => l(), zIndex: 1201, children: [
1083
+ /* @__PURE__ */ e(Se, { className: x["header-assign-for-student"], children: /* @__PURE__ */ e("div", { children: "Select teacher switch data" }) }),
1084
+ /* @__PURE__ */ e(be, { className: "p-0", children: /* @__PURE__ */ e("div", { className: x["switch-data-teachers"], children: c.map((g) => /* @__PURE__ */ e(
1085
+ "p",
1086
+ {
1087
+ onClick: () => d(g.teacherUserId),
1088
+ className: `${x["switch-data-teacher-item"]} ${g.teacherUserId == a ? x["item-checked"] : ""}`,
1089
+ children: g.mainTeacherName
1090
+ }
1091
+ )) }) }),
1092
+ /* @__PURE__ */ u(Ne, { className: "text-right", children: [
1093
+ /* @__PURE__ */ e(J, { onClick: () => l(), children: b("cancel") }),
1094
+ /* @__PURE__ */ e(
1095
+ J,
1096
+ {
1097
+ disabled: !a,
1098
+ color: "primary",
1099
+ onClick: async () => {
1100
+ await r(a), l();
1101
+ },
1102
+ children: b("save")
1103
+ }
1104
+ )
1105
+ ] })
1106
+ ] });
1107
+ }, Ia = ({
1108
+ teachers: s,
1109
+ onChangeStaffRemove: l,
1110
+ switchStaffUsers: c
1111
+ }) => {
1112
+ const { t: r } = Y();
1113
+ return /* @__PURE__ */ u("div", { children: [
1114
+ /* @__PURE__ */ e("h6", { children: "Select teacher to remove" }),
1115
+ /* @__PURE__ */ e(
1116
+ Q,
1117
+ {
1118
+ isMulti: !0,
1119
+ value: s.filter(
1120
+ (a) => c.teacherRemoveUserIds.includes(a.value)
1121
+ ) || [],
1122
+ options: s.filter(
1123
+ (a) => !c.teacherRemoveUserIds.includes(
1124
+ a.value
1125
+ ) && a.value !== c.teacherSwitchDataUserId
1126
+ ) || [],
1127
+ placeholder: r("select_teacher"),
1128
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1129
+ onChange: (a) => {
1130
+ l({
1131
+ teacherRemoveUserIds: a.map((d) => d.value)
1132
+ });
1133
+ },
1134
+ isClearable: !0
1135
+ }
1136
+ ),
1137
+ /* @__PURE__ */ e("h6", { className: "mt-3", children: "Select the teacher to transfer data to" }),
1138
+ /* @__PURE__ */ e(
1139
+ Q,
1140
+ {
1141
+ value: s.find(
1142
+ (a) => c.teacherSwitchDataUserId == a.value
1143
+ ) || null,
1144
+ options: s.filter(
1145
+ (a) => !c.teacherRemoveUserIds.includes(
1146
+ a.value
1147
+ ) && a.value !== c.teacherSwitchDataUserId
1148
+ ) || [],
1149
+ placeholder: r("select_teacher"),
1150
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1151
+ onChange: (a) => {
1152
+ console.log("value", a), l({
1153
+ teacherSwitchDataUserId: a?.value
1154
+ });
1155
+ },
1156
+ isClearable: !0
1157
+ }
1158
+ )
1159
+ ] });
1160
+ }, Ca = ({
1161
+ counselors: s,
1162
+ onChangeStaffRemove: l,
1163
+ switchStaffUsers: c
1164
+ }) => {
1165
+ const { t: r } = Y();
1166
+ return /* @__PURE__ */ u("div", { children: [
1167
+ /* @__PURE__ */ e("h6", { children: "Select counselor to remove" }),
1168
+ /* @__PURE__ */ e(
1169
+ Q,
1170
+ {
1171
+ isMulti: !0,
1172
+ value: s.filter(
1173
+ (a) => c.counselorRemoveUserIds.includes(a.value)
1174
+ ) || [],
1175
+ options: s.filter(
1176
+ (a) => !c.counselorRemoveUserIds.includes(
1177
+ a.value
1178
+ ) && a.value !== c.counselorSwitchDataUserId
1179
+ ) || [],
1180
+ placeholder: r("select_counselor"),
1181
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1182
+ onChange: (a) => {
1183
+ l({
1184
+ counselorRemoveUserIds: a.map((d) => d.value)
1185
+ });
1186
+ },
1187
+ isClearable: !0
1188
+ }
1189
+ ),
1190
+ /* @__PURE__ */ e("h6", { className: "mt-3", children: "Select the counselor to transfer data to" }),
1191
+ /* @__PURE__ */ e(
1192
+ Q,
1193
+ {
1194
+ value: s.find(
1195
+ (a) => c.counselorSwitchDataUserId == a.value
1196
+ ) || null,
1197
+ options: s.filter(
1198
+ (a) => !c.counselorRemoveUserIds.includes(
1199
+ a.value
1200
+ ) && a.value !== c.counselorSwitchDataUserId
1201
+ ) || [],
1202
+ placeholder: r("select_counselor"),
1203
+ className: `flex-grow-1 mb-3 ${x["custom-chip-counselor-select"]}`,
1204
+ onChange: (a) => {
1205
+ l({
1206
+ counselorSwitchDataUserId: a?.value
1207
+ });
1208
+ },
1209
+ isClearable: !0
1210
+ }
1211
+ )
1212
+ ] });
1213
+ }, Sa = ({ tabs: s }) => {
1214
+ const { t: l } = Y(), [c, r] = I(0), a = (b) => {
1215
+ r(b);
1216
+ };
1217
+ return /* @__PURE__ */ e("div", { className: "animated fadeIn", children: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ u(j, { xl: 12, children: [
1218
+ /* @__PURE__ */ e(Bt, { tabs: !0, children: s.map((b, g) => {
1219
+ const n = g === c;
1220
+ return /* @__PURE__ */ e(Ft, { children: /* @__PURE__ */ e(
1221
+ Pt,
1222
+ {
1223
+ className: `${n ? "active" : ""} cursor-pointer`,
1224
+ onClick: () => a(g),
1225
+ style: {
1226
+ color: n ? "#316CD9" : "#242424"
1227
+ },
1228
+ children: l(b.title)
1229
+ }
1230
+ ) }, g);
1231
+ }) }),
1232
+ /* @__PURE__ */ e(
1233
+ Jt,
1234
+ {
1235
+ activeTab: c,
1236
+ className: "border-bottom-0 border-left-0 border-right-0 p-3",
1237
+ children: s.map((b, g) => /* @__PURE__ */ e(jt, { tabId: g, children: /* @__PURE__ */ e(b.component, {}) }, g))
1238
+ }
1239
+ )
1240
+ ] }) }) });
1241
+ }, ba = ({
1242
+ assistants: s,
1243
+ onChangeStaffRemove: l,
1244
+ switchStaffUsers: c
1245
+ }) => {
1246
+ const { t: r } = Y();
1247
+ return /* @__PURE__ */ u("div", { children: [
1248
+ /* @__PURE__ */ e("h6", { children: "Select assistant to remove" }),
1249
+ /* @__PURE__ */ e(
1250
+ Q,
1251
+ {
1252
+ isMulti: !0,
1253
+ value: s.filter(
1254
+ (a) => c.assistantRemoveUserId.includes(a.value)
1255
+ ) || [],
1256
+ options: s.filter(
1257
+ (a) => !c.assistantRemoveUserId.includes(
1258
+ a.value
1259
+ ) && a.value !== c.assistantSwitchDataUserId
1260
+ ) || [],
1261
+ placeholder: r("select_assistant"),
1262
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1263
+ onChange: (a) => {
1264
+ l({
1265
+ assistantRemoveUserId: a.map((d) => d.value)
1266
+ });
1267
+ },
1268
+ isClearable: !0
1269
+ }
1270
+ ),
1271
+ /* @__PURE__ */ e("h6", { className: "mt-3", children: "Select the assistant to transfer data to" }),
1272
+ /* @__PURE__ */ e(
1273
+ Q,
1274
+ {
1275
+ value: s.find(
1276
+ (a) => c.assistantSwitchDataUserId == a.value
1277
+ ) || null,
1278
+ options: s.filter(
1279
+ (a) => !c.assistantRemoveUserId.includes(
1280
+ a.value
1281
+ ) && a.value !== c.assistantSwitchDataUserId
1282
+ ) || [],
1283
+ placeholder: r("select_assistant"),
1284
+ className: `flex-grow-1 mb-3 ${x["custom-chip-assistant-select"]}`,
1285
+ onChange: (a) => {
1286
+ console.log("value", a), l({
1287
+ assistantSwitchDataUserId: a?.value
1288
+ });
1289
+ },
1290
+ isClearable: !0
1291
+ }
1292
+ )
1293
+ ] });
1294
+ }, Na = ({
1295
+ secondaryTeachers: s,
1296
+ onChangeStaffRemove: l,
1297
+ switchStaffUsers: c
1298
+ }) => {
1299
+ const { t: r } = Y();
1300
+ return /* @__PURE__ */ u("div", { children: [
1301
+ /* @__PURE__ */ e("h6", { children: "Select support teacher to remove" }),
1302
+ /* @__PURE__ */ e(
1303
+ Q,
1304
+ {
1305
+ isMulti: !0,
1306
+ value: s.filter(
1307
+ (a) => c.supportTeacherRemoveUserIds.includes(a.value)
1308
+ ) || [],
1309
+ options: s.filter(
1310
+ (a) => !c.supportTeacherRemoveUserIds.includes(
1311
+ a.value
1312
+ ) && a.value !== c.supportTeacherSwitchDataUserId
1313
+ ) || [],
1314
+ placeholder: r("select_support_teacher"),
1315
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1316
+ onChange: (a) => {
1317
+ l({
1318
+ supportTeacherRemoveUserIds: a.map((d) => d.value)
1319
+ });
1320
+ },
1321
+ isClearable: !0
1322
+ }
1323
+ ),
1324
+ /* @__PURE__ */ e("h6", { className: "mt-3", children: "Select the support teacher to transfer data to" }),
1325
+ /* @__PURE__ */ e(
1326
+ Q,
1327
+ {
1328
+ value: s.find(
1329
+ (a) => c.supportTeacherSwitchDataUserId == a.value
1330
+ ) || null,
1331
+ options: s.filter(
1332
+ (a) => !c.supportTeacherRemoveUserIds.includes(
1333
+ a.value
1334
+ ) && a.value !== c.supportTeacherSwitchDataUserId
1335
+ ) || [],
1336
+ placeholder: r("select_support_teacher"),
1337
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1338
+ onChange: (a) => {
1339
+ l({
1340
+ supportTeacherSwitchDataUserId: a?.value
1341
+ });
1342
+ },
1343
+ isClearable: !0
1344
+ }
1345
+ )
1346
+ ] });
1347
+ }, wa = ({
1348
+ open: s,
1349
+ onClose: l,
1350
+ teachers: c,
1351
+ onChangeStaffRemove: r,
1352
+ switchStaffUsers: a,
1353
+ assistants: d,
1354
+ onRemoveBulkStaff: b,
1355
+ counselors: g,
1356
+ studentUserIds: n,
1357
+ secondaryTeachers: i
1358
+ }) => {
1359
+ const { t: _ } = Y(), o = [
1360
+ {
1361
+ title: "Remove Teacher",
1362
+ component: () => /* @__PURE__ */ e(
1363
+ Ia,
1364
+ {
1365
+ teachers: c,
1366
+ onChangeStaffRemove: r,
1367
+ switchStaffUsers: a
1368
+ }
1369
+ )
1370
+ },
1371
+ {
1372
+ title: "Remove Assistant",
1373
+ component: () => /* @__PURE__ */ e(
1374
+ ba,
1375
+ {
1376
+ assistants: d,
1377
+ onChangeStaffRemove: r,
1378
+ switchStaffUsers: a
1379
+ }
1380
+ )
1381
+ },
1382
+ {
1383
+ title: "Remove Counselor",
1384
+ component: () => /* @__PURE__ */ e(
1385
+ Ca,
1386
+ {
1387
+ counselors: g,
1388
+ onChangeStaffRemove: r,
1389
+ switchStaffUsers: a
1390
+ }
1391
+ )
1392
+ },
1393
+ {
1394
+ title: "Remove Support Teacher",
1395
+ component: () => /* @__PURE__ */ e(
1396
+ Na,
1397
+ {
1398
+ secondaryTeachers: i,
1399
+ onChangeStaffRemove: r,
1400
+ switchStaffUsers: a
1401
+ }
1402
+ )
1403
+ }
1404
+ ];
1405
+ return /* @__PURE__ */ u(Ce, { size: "lg", centered: !0, isOpen: s, toggle: () => l(), zIndex: 1201, children: [
1406
+ /* @__PURE__ */ e(
1407
+ Se,
1408
+ {
1409
+ className: `${x["header-assign-for-student"]} border-0`,
1410
+ children: /* @__PURE__ */ e("div", { children: "Remove Bulk" })
1411
+ }
1412
+ ),
1413
+ /* @__PURE__ */ e(be, { className: "p-0", children: /* @__PURE__ */ e(Sa, { tabs: o }) }),
1414
+ /* @__PURE__ */ u(Ne, { className: "text-right", children: [
1415
+ /* @__PURE__ */ e(J, { onClick: () => l(), children: _("cancel") }),
1416
+ /* @__PURE__ */ e(
1417
+ J,
1418
+ {
1419
+ disabled: !a.teacherRemoveUserIds.length && !a.assistantRemoveUserId && !a.counselorRemoveUserIds.length,
1420
+ color: "primary",
1421
+ onClick: async () => {
1422
+ await b(n);
1423
+ },
1424
+ children: "Remove"
1425
+ }
1426
+ )
1427
+ ] })
1428
+ ] });
1429
+ }, Ua = () => {
1430
+ const { t: s } = Y(), {
1431
+ selectedTeachers: l,
1432
+ teacherOptions: c,
1433
+ setSelectedTeachers: r
1434
+ } = ma(), {
1435
+ selectedAssistants: a,
1436
+ assistantOptions: d,
1437
+ setSelectedAssistants: b
1438
+ } = ha(), {
1439
+ selectedCounselors: g,
1440
+ counselorOptions: n,
1441
+ setSelectedCounselors: i
1442
+ } = da(), {
1443
+ selectedSecondaryTeachers: _,
1444
+ secondaryTeacherOptions: o,
1445
+ setSelectedSecondaryTeachers: S
1446
+ } = ua(), {
1447
+ isCheck: $,
1448
+ isCheckAll: O,
1449
+ userList: T,
1450
+ filters: h,
1451
+ totalItem: N,
1452
+ handleClickCheck: R,
1453
+ handleSelectAll: z,
1454
+ changeFilters: W,
1455
+ fullName: de,
1456
+ handleRetrievedData: se,
1457
+ selectedUser: X,
1458
+ setSelectedUser: he,
1459
+ getDataUserList: ue,
1460
+ userSelected: D,
1461
+ studentTeacherSelected: E,
1462
+ studentCounselorSelected: y,
1463
+ studentAssistantSelected: w,
1464
+ studentSecondaryTeacherSelected: M
1465
+ } = ia(), L = () => {
1466
+ se(), r(void 0), b(void 0), i(void 0), S(void 0);
1467
+ }, {
1468
+ openModelBulk: Z,
1469
+ handleToggleModel: H,
1470
+ staffBulkAssign: ee,
1471
+ handleChangeStaffBulk: K,
1472
+ onAssignStaffToStudents: me,
1473
+ handleToggleInactiveModal: ne,
1474
+ openInactiveModal: pe,
1475
+ handleInactiveStudents: ge,
1476
+ handleChangeTeacherBulk: le,
1477
+ handleChangeCounselorBulk: ce,
1478
+ handleEditAssignForStudents: oe,
1479
+ // handleToggleSwitchModel,
1480
+ modalType: V,
1481
+ openSwitchModal: ie,
1482
+ optionsSwitch: q,
1483
+ textModal: fe,
1484
+ teacherSwitchList: ye,
1485
+ onCloseSwitchModal: we,
1486
+ handleUpdateSwitch: Ue,
1487
+ setTeacherChangeUserId: Ae,
1488
+ setTeacherSelectForChangeUserId: je,
1489
+ teacherSelectForChangeUserId: Te,
1490
+ openDetailModal: ze,
1491
+ setOpenDetailModal: Ve,
1492
+ toggleCollapse: qe,
1493
+ activeIndex: We,
1494
+ onClose: Ge,
1495
+ removeTeacherUserIds: He,
1496
+ // onSelectRemoveTeacher,
1497
+ openModelSwitchDataTeacher: Ke,
1498
+ onToggleModelSwitchDataTeacher: $e,
1499
+ teacherSwitchUserId: Qe,
1500
+ setTeacherSwitchUserId: Xe,
1501
+ onToggleModelDeleteBulk: Re,
1502
+ openModelDeleteBulk: Ye,
1503
+ handelChangeStaffRemove: Ze,
1504
+ switchStaffUsers: et,
1505
+ handleRemoveBulkStaff: m
1506
+ } = ga(
1507
+ l,
1508
+ a,
1509
+ g,
1510
+ _,
1511
+ L,
1512
+ X,
1513
+ ue,
1514
+ D
1515
+ ), p = [
1516
+ {
1517
+ name: "",
1518
+ isCenter: !0,
1519
+ onSelectAll: z,
1520
+ isCheckAll: O,
1521
+ className: `align-top ${x["fixed-width-40"]}`
1522
+ },
1523
+ {
1524
+ name: "student_name",
1525
+ isCenter: !0,
1526
+ sortBy: Ie.Name,
1527
+ searchBy: _e.Name,
1528
+ className: `align-top ${x["fixed-width"]}`,
1529
+ getOption: (t) => ({
1530
+ label: t || "empty",
1531
+ value: t
1532
+ })
1533
+ },
1534
+ {
1535
+ name: "grade",
1536
+ isCenter: !0,
1537
+ sortBy: Ie.Grade,
1538
+ searchBy: _e.Grade,
1539
+ className: `align-center justify-center ${x["fixed-width-80"]}`,
1540
+ getOption: (t) => ({
1541
+ label: t || "empty",
1542
+ value: t
1543
+ })
1544
+ },
1545
+ {
1546
+ name: "teacher_emails",
1547
+ isCenter: !0,
1548
+ className: "align-center justify-center",
1549
+ sortBy: Ie.Teacher,
1550
+ searchBy: _e.Teacher,
1551
+ getOption: (t) => ({
1552
+ label: t || "empty",
1553
+ value: t
1554
+ })
1555
+ },
1556
+ {
1557
+ name: "assistant_email",
1558
+ isCenter: !0,
1559
+ className: "align-center justify-center",
1560
+ sortBy: Ie.Assistant,
1561
+ searchBy: _e.Assistant,
1562
+ getOption: (t) => ({
1563
+ label: t || "empty",
1564
+ value: t
1565
+ })
1566
+ },
1567
+ {
1568
+ name: "counselor_emails",
1569
+ isCenter: !0,
1570
+ className: "align-center justify-center",
1571
+ sortBy: Ie.Counselor,
1572
+ searchBy: _e.Counselor,
1573
+ getOption: (t) => ({
1574
+ label: t || "empty",
1575
+ value: t
1576
+ })
1577
+ },
1578
+ {
1579
+ name: "support_teacher_email",
1580
+ isCenter: !0,
1581
+ className: "align-center justify-center",
1582
+ sortBy: Ie.SecondaryTeacher,
1583
+ searchBy: _e.SecondaryTeacher,
1584
+ getOption: (t) => ({
1585
+ label: t || "empty",
1586
+ value: t
1587
+ })
1588
+ }
1589
+ ], [f, A] = I(null), U = (t) => {
1590
+ A((v) => v === t ? null : t);
1591
+ };
1592
+ return /* @__PURE__ */ u("div", { className: "fadeIn animated", children: [
1593
+ /* @__PURE__ */ e("h5", { className: "mt-4 mb-2", children: s("assign_student") }),
1594
+ /* @__PURE__ */ u(ae, { className: "my-2", children: [
1595
+ /* @__PURE__ */ e(j, { md: 3, children: /* @__PURE__ */ e(
1596
+ gt,
1597
+ {
1598
+ initValue: h?.searchString || "",
1599
+ onSearch: (t) => W({ searchString: t }),
1600
+ placeholder: s("type_something_to_search_students")
1601
+ }
1602
+ ) }),
1603
+ /* @__PURE__ */ e(j, { md: 8, className: "d-flex justify-content-end align-items-center", children: /* @__PURE__ */ e(ae, { className: "mb-2", children: /* @__PURE__ */ u(j, { style: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 4 }, children: [
1604
+ /* @__PURE__ */ e(J, { onClick: () => H($), color: "primary", style: { background: "#316cd9" }, children: s("assign_bulk") }),
1605
+ /* @__PURE__ */ e(J, { onClick: () => Re($), color: "primary", style: { background: "#316cd9" }, children: s("delete_bulk") }),
1606
+ /* @__PURE__ */ e(J, { onClick: () => ne($), color: "primary", style: { background: "#316cd9" }, children: s("inactive_students") })
1607
+ ] }) }) }),
1608
+ /* @__PURE__ */ u(
1609
+ j,
1610
+ {
1611
+ md: 1,
1612
+ className: "d-flex justify-content-end align-items-center",
1613
+ style: { whiteSpace: "nowrap", flexWrap: "nowrap" },
1614
+ children: [
1615
+ s("total_of_users"),
1616
+ ": ",
1617
+ N
1618
+ ]
1619
+ }
1620
+ )
1621
+ ] }),
1622
+ /* @__PURE__ */ u(Ce, { centered: !0, isOpen: Z, toggle: () => H(), zIndex: 1201, children: [
1623
+ /* @__PURE__ */ e(Se, { children: s("assign_bulk_student") }),
1624
+ /* @__PURE__ */ u(be, { children: [
1625
+ /* @__PURE__ */ e(
1626
+ Q,
1627
+ {
1628
+ isMulti: !0,
1629
+ value: ee.teacher.map((t) => ({ label: t.email, value: t.id })),
1630
+ options: c,
1631
+ placeholder: s("select_teacher"),
1632
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1633
+ onChange: (t) => {
1634
+ const v = t.map((k) => ({
1635
+ id: k.value,
1636
+ email: k.label
1637
+ }));
1638
+ le(v);
1639
+ },
1640
+ isClearable: !0,
1641
+ style: { maxWidth: 120 }
1642
+ }
1643
+ ),
1644
+ /* @__PURE__ */ e(
1645
+ Oe,
1646
+ {
1647
+ value: d.find((t) => t.value == ee.assistantId || t.label == ee.assistantEmail) || null,
1648
+ options: d,
1649
+ onChange: (t) => K("assistant", t),
1650
+ placeholder: s("select_assistant"),
1651
+ className: "flex-grow-1 mb-3"
1652
+ }
1653
+ ),
1654
+ /* @__PURE__ */ e(
1655
+ Q,
1656
+ {
1657
+ isMulti: !0,
1658
+ value: ee.counselors.map((t) => ({ label: t.email, value: t.id })),
1659
+ options: n,
1660
+ placeholder: s("select_counselor"),
1661
+ className: `flex-grow-1 mb-3 ${x["custom-chip-teacher-select"]}`,
1662
+ onChange: (t) => {
1663
+ const v = t.map((k) => ({
1664
+ id: k.value,
1665
+ email: k.label
1666
+ }));
1667
+ ce(v);
1668
+ },
1669
+ isClearable: !0,
1670
+ style: { maxWidth: 120 }
1671
+ }
1672
+ ),
1673
+ /* @__PURE__ */ e(
1674
+ Oe,
1675
+ {
1676
+ value: o.find((t) => t.value == ee.secondaryTeacherId || t.label == ee.secondaryTeacherEmail) || null,
1677
+ options: o,
1678
+ onChange: (t) => K("secondary", t),
1679
+ placeholder: s("select_support_teacher"),
1680
+ className: "flex-grow-1"
1681
+ }
1682
+ )
1683
+ ] }),
1684
+ /* @__PURE__ */ u(Ne, { className: "text-right", children: [
1685
+ /* @__PURE__ */ e(J, { onClick: () => H(), children: s("cancel") }),
1686
+ /* @__PURE__ */ e(J, { color: "primary", onClick: () => me($), children: s("assign") })
1687
+ ] })
1688
+ ] }),
1689
+ /* @__PURE__ */ u(Ce, { centered: !0, isOpen: pe, toggle: () => ne(), zIndex: 1201, children: [
1690
+ /* @__PURE__ */ e(Se, { children: s("inactive_students") }),
1691
+ /* @__PURE__ */ u(be, { style: { display: "flex", gap: 12 }, children: [
1692
+ /* @__PURE__ */ e(fa, { color: "red", size: 30 }),
1693
+ /* @__PURE__ */ e(zt, { style: { fontSize: 20, margin: 0, display: "flex", alignItems: "center" }, children: s("are_you_sure_you_want_to_inactive_students", { number: $.length }) })
1694
+ ] }),
1695
+ /* @__PURE__ */ u(Ne, { className: "text-right", children: [
1696
+ /* @__PURE__ */ e(J, { onClick: () => ne(), children: s("cancel") }),
1697
+ /* @__PURE__ */ e(J, { color: "primary", onClick: () => ge($, L), children: s("confirm") })
1698
+ ] })
1699
+ ] }),
1700
+ /* @__PURE__ */ u(ae, { className: "mb-2", children: [
1701
+ /* @__PURE__ */ e(j, { md: 12, children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ u(Tt, { bordered: !0, hover: !0, striped: !0, size: "sm", className: `${x["table-fixed"]}`, children: [
1702
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e(
1703
+ Dt,
1704
+ {
1705
+ headers: p,
1706
+ filters: h,
1707
+ fullName: de,
1708
+ onChangeFilters: W,
1709
+ teacherOptions: c,
1710
+ assistantOptions: d,
1711
+ counselorOptions: n,
1712
+ secondaryTeacherOptions: o
1713
+ }
1714
+ ) }),
1715
+ T && T.length > 0 ? /* @__PURE__ */ e("tbody", { children: T.map((t, v) => /* @__PURE__ */ u("tr", { children: [
1716
+ /* @__PURE__ */ e("td", { className: `align-middle text-center ${x["fixed-width-40"]}`, children: /* @__PURE__ */ e(
1717
+ "input",
1718
+ {
1719
+ id: t.id,
1720
+ type: "checkbox",
1721
+ onChange: R,
1722
+ checked: $.includes(
1723
+ t.id
1724
+ )
1725
+ }
1726
+ ) }),
1727
+ /* @__PURE__ */ u(
1728
+ "td",
1729
+ {
1730
+ className: `align-middle ${x["fixed-width"]}`,
1731
+ id: `student_name_${t.id}_${v}`,
1732
+ onMouseEnter: () => U(`student_name_${t.id}_${v}`),
1733
+ onMouseLeave: () => U(`student_name_${t.id}_${v}`),
1734
+ children: [
1735
+ /* @__PURE__ */ e(
1736
+ "button",
1737
+ {
1738
+ type: "button",
1739
+ className: `${x["button-user-name"]} btn-link`,
1740
+ onClick: () => {
1741
+ he(t), Ve(!0);
1742
+ },
1743
+ children: t.fullName
1744
+ }
1745
+ ),
1746
+ /* @__PURE__ */ e(
1747
+ Ee,
1748
+ {
1749
+ placement: "top",
1750
+ isOpen: f === `student_name_${t.id}_${v}`,
1751
+ target: `student_name_${t.id}_${v}`,
1752
+ children: t.fullName
1753
+ }
1754
+ )
1755
+ ]
1756
+ }
1757
+ ),
1758
+ /* @__PURE__ */ e(
1759
+ "td",
1760
+ {
1761
+ className: `align-middle ${x["fixed-width"]}`,
1762
+ id: `student_email_${t.id}_${v}`,
1763
+ onMouseEnter: () => U(`student_email_${t.id}_${v}`),
1764
+ onMouseLeave: () => U(`student_email_${t.id}_${v}`),
1765
+ children: /* @__PURE__ */ e("p", { children: t.gradeLevel })
1766
+ }
1767
+ ),
1768
+ /* @__PURE__ */ u(
1769
+ "td",
1770
+ {
1771
+ className: `align-middle ${x["equal-width"]}`,
1772
+ id: `student_teacher_${t.id}_${v}`,
1773
+ onMouseEnter: () => U(`student_teacher_${t.id}_${v}`),
1774
+ onMouseLeave: () => U(`student_teacher_${t.id}_${v}`),
1775
+ children: [
1776
+ !!t.teachers && t.teachers.length > 0 && /* @__PURE__ */ e(Je, { children: t.teachers.map((k) => /* @__PURE__ */ u("p", { className: "mb-0", children: [
1777
+ k.mainTeacherName,
1778
+ " - ",
1779
+ k.mainTeacherEmail
1780
+ ] }, k.mainTeacherEmail)) }),
1781
+ !!t.teachers && t.teachers.length > 0 && /* @__PURE__ */ e(
1782
+ Ee,
1783
+ {
1784
+ placement: "top",
1785
+ isOpen: f === `student_teacher_${t.id}_${v}`,
1786
+ target: `student_teacher_${t.id}_${v}`,
1787
+ children: t.teachers.map((k) => /* @__PURE__ */ u("p", { className: "mb-0", children: [
1788
+ k.mainTeacherName,
1789
+ " - ",
1790
+ k.mainTeacherEmail
1791
+ ] }, k.mainTeacherEmail))
1792
+ }
1793
+ )
1794
+ ]
1795
+ }
1796
+ ),
1797
+ /* @__PURE__ */ u(
1798
+ "td",
1799
+ {
1800
+ className: `align-middle ${x["equal-width"]}`,
1801
+ id: `student_assistant_${t.id}_${v}`,
1802
+ onMouseEnter: () => U(`student_assistant_${t.id}_${v}`),
1803
+ onMouseLeave: () => U(`student_assistant_${t.id}_${v}`),
1804
+ children: [
1805
+ !!t.assistantEmail && /* @__PURE__ */ u("p", { className: "mb-0", children: [
1806
+ t.assistantName,
1807
+ " - ",
1808
+ t.assistantEmail
1809
+ ] }),
1810
+ !!t.assistantEmail && /* @__PURE__ */ u(
1811
+ Ee,
1812
+ {
1813
+ placement: "top",
1814
+ isOpen: f === `student_assistant_${t.id}_${v}`,
1815
+ target: `student_assistant_${t.id}_${v}`,
1816
+ children: [
1817
+ t.assistantName,
1818
+ "-",
1819
+ t.assistantEmail
1820
+ ]
1821
+ }
1822
+ )
1823
+ ]
1824
+ }
1825
+ ),
1826
+ /* @__PURE__ */ u(
1827
+ "td",
1828
+ {
1829
+ className: `align-middle ${x["equal-width"]}`,
1830
+ id: `student_counselor_${t.id}_${v}`,
1831
+ onMouseEnter: () => U(`student_counselor_${t.id}_${v}`),
1832
+ onMouseLeave: () => U(`student_counselor_${t.id}_${v}`),
1833
+ children: [
1834
+ !!t.counselors && t.counselors.length > 0 && /* @__PURE__ */ e(Je, { children: t.counselors.map((k) => /* @__PURE__ */ u("p", { className: "mb-0", children: [
1835
+ k.counselorName,
1836
+ " - ",
1837
+ k.counselorEmail
1838
+ ] }, k.counselorUserId)) }),
1839
+ !!t.counselors && t.counselors.length > 0 && /* @__PURE__ */ e(
1840
+ Ee,
1841
+ {
1842
+ placement: "top",
1843
+ isOpen: f === `student_counselor_${t.id}_${v}`,
1844
+ target: `student_counselor_${t.id}_${v}`,
1845
+ children: t.counselors.map((k) => /* @__PURE__ */ u("p", { className: "mb-0", children: [
1846
+ k.counselorName,
1847
+ " - ",
1848
+ k.counselorEmail
1849
+ ] }, k.counselorUserId))
1850
+ }
1851
+ )
1852
+ ]
1853
+ }
1854
+ ),
1855
+ /* @__PURE__ */ u(
1856
+ "td",
1857
+ {
1858
+ className: `align-middle ${x["equal-width"]}`,
1859
+ id: `student_secondary_teacher_${t.id}_${v}`,
1860
+ onMouseEnter: () => U(`student_secondary_teacher_${t.id}_${v}`),
1861
+ onMouseLeave: () => U(`student_secondary_teacher_${t.id}_${v}`),
1862
+ children: [
1863
+ !!t.secondaryTeacherEmail && /* @__PURE__ */ u("p", { className: "mb-0", children: [
1864
+ t.secondaryTeacherName,
1865
+ " - ",
1866
+ t.secondaryTeacherEmail
1867
+ ] }),
1868
+ !!t.secondaryTeacherEmail && /* @__PURE__ */ u(
1869
+ Ee,
1870
+ {
1871
+ placement: "top",
1872
+ isOpen: f === `student_secondary_teacher_${t.id}_${v}`,
1873
+ target: `student_secondary_teacher_${t.id}_${v}`,
1874
+ children: [
1875
+ t.secondaryTeacherName,
1876
+ " - ",
1877
+ t.secondaryTeacherEmail
1878
+ ]
1879
+ }
1880
+ )
1881
+ ]
1882
+ }
1883
+ )
1884
+ ] }, t.id)) }) : /* @__PURE__ */ e("div", { style: { width: "max-content", padding: 20 }, children: s("no_data") })
1885
+ ] }) }) }),
1886
+ /* @__PURE__ */ e(j, { md: 12, children: /* @__PURE__ */ e(
1887
+ ft,
1888
+ {
1889
+ filters: h,
1890
+ totalRecordCount: N,
1891
+ changePageSize: (t) => W({ pageSize: t }),
1892
+ changePage: (t) => W({ currentPage: t })
1893
+ }
1894
+ ) })
1895
+ ] }),
1896
+ /* @__PURE__ */ e(
1897
+ Ta,
1898
+ {
1899
+ openDetailModal: ze,
1900
+ onClose: Ge,
1901
+ selectedUser: X,
1902
+ staffBulkAssign: ee,
1903
+ teacherOptions: c,
1904
+ handleChangeTeacherBulk: le,
1905
+ handleChangeCounselorBulk: ce,
1906
+ assistantOptions: d,
1907
+ counselorOptions: n,
1908
+ secondaryTeacherOptions: o,
1909
+ handleChangeStaffBulk: K,
1910
+ handleEditAssignForStudents: oe,
1911
+ toggleCollapse: qe,
1912
+ activeIndex: We
1913
+ }
1914
+ ),
1915
+ /* @__PURE__ */ e(
1916
+ ya,
1917
+ {
1918
+ textModal: fe,
1919
+ isOpen: ie,
1920
+ teachers: ye,
1921
+ options: q,
1922
+ onClose: we,
1923
+ onSave: Ue,
1924
+ modalType: V,
1925
+ setTeacherChangeUserId: Ae,
1926
+ setTeacherSelectForChangeUserId: je,
1927
+ teacherSelectForChangeUserId: Te
1928
+ }
1929
+ ),
1930
+ /* @__PURE__ */ e(
1931
+ _a,
1932
+ {
1933
+ open: Ke,
1934
+ onClose: $e,
1935
+ teachers: X?.teachers?.filter((t) => !He.includes(t.teacherUserId)) || [],
1936
+ onConfirm: oe,
1937
+ teacherSwitchUserId: Qe,
1938
+ setTeacherSwitchUserId: Xe
1939
+ }
1940
+ ),
1941
+ /* @__PURE__ */ e(
1942
+ wa,
1943
+ {
1944
+ open: Ye,
1945
+ onClose: Re,
1946
+ teachers: E,
1947
+ onChangeStaffRemove: Ze,
1948
+ switchStaffUsers: et,
1949
+ counselors: y,
1950
+ assistants: w,
1951
+ onRemoveBulkStaff: m,
1952
+ studentUserIds: $,
1953
+ secondaryTeachers: M
1954
+ }
1955
+ )
1956
+ ] });
1957
+ }, $a = () => {
1958
+ const s = re(), [l, c] = I(
1959
+ _t
1960
+ ), [r, a] = I([]), [d, b] = I(""), g = async () => {
1961
+ try {
1962
+ const i = await bt();
1963
+ a(i.data);
1964
+ } catch (i) {
1965
+ s(
1966
+ C({
1967
+ type: "danger",
1968
+ message: i.response?.data?.title || i.message
1969
+ })
1970
+ );
1971
+ }
1972
+ }, n = r.map((i) => ({
1973
+ label: `${i.name} - ${i.email}`,
1974
+ value: i.id
1975
+ }));
1976
+ return te(() => {
1977
+ l.roles?.includes("Teacher") && g();
1978
+ }, [l]), {
1979
+ userChoiced: l,
1980
+ setUserChoiced: c,
1981
+ teacherList: r,
1982
+ options: n,
1983
+ setTeacherChangeId: b,
1984
+ teacherChangeId: d
1985
+ };
1986
+ }, Ea = "User deleted list", ka = () => {
1987
+ const {
1988
+ userChoiced: s,
1989
+ setUserChoiced: l,
1990
+ options: c,
1991
+ teacherChangeId: r,
1992
+ setTeacherChangeId: a
1993
+ } = $a(), [d, b] = I([]), [g, n] = I(0), { filters: i, changeFilters: _ } = Nt(), o = re(), S = Ot(null), $ = () => {
1994
+ S && S.current && S.current.toggle();
1995
+ }, O = () => {
1996
+ a(""), l(_t);
1997
+ }, T = G(async () => {
1998
+ o(F(!0));
1999
+ try {
2000
+ const N = await wt(i), { items: R, totalItems: z } = N.data;
2001
+ b(R), n(z);
2002
+ } catch (N) {
2003
+ o(
2004
+ C({
2005
+ type: "danger",
2006
+ message: N.response?.data?.title || N.message
2007
+ })
2008
+ );
2009
+ }
2010
+ o(F(!1));
2011
+ }, [o, i]);
2012
+ te(() => {
2013
+ document.title = Ea;
2014
+ }, []), te(() => {
2015
+ T();
2016
+ }, [i]);
2017
+ const h = G(
2018
+ (N) => {
2019
+ o(
2020
+ nt({
2021
+ isOpen: !0,
2022
+ type: "warning",
2023
+ message: "Do you want to remove this user?",
2024
+ onConfirm: async () => {
2025
+ o(F(!0));
2026
+ try {
2027
+ s.roles.includes("Teacher") ? await ot(N, r) : await ot(N), o(
2028
+ C({
2029
+ type: "success",
2030
+ message: "Remove user successfully"
2031
+ })
2032
+ ), $(), O(), _({ currentPage: 1 });
2033
+ } catch (R) {
2034
+ o(
2035
+ C({
2036
+ type: "danger",
2037
+ message: R.response?.data?.title || R.message
2038
+ })
2039
+ );
2040
+ }
2041
+ o(F(!1));
2042
+ }
2043
+ })
2044
+ );
2045
+ },
2046
+ [i, r, s]
2047
+ );
2048
+ return {
2049
+ userList: d,
2050
+ totalItems: g,
2051
+ filters: i,
2052
+ getData: T,
2053
+ removeData: h,
2054
+ changeFilters: _,
2055
+ modal: S,
2056
+ openModal: $,
2057
+ userChoiced: s,
2058
+ setUserChoiced: l,
2059
+ options: c,
2060
+ teacherChangeId: r,
2061
+ setTeacherChangeId: a,
2062
+ resetData: O
2063
+ };
2064
+ }, Da = (s, l) => {
2065
+ const {
2066
+ header: c,
2067
+ removeData: r,
2068
+ resetData: a,
2069
+ userChoiced: d,
2070
+ options: b,
2071
+ teacherChangeId: g,
2072
+ setTeacherChangeId: n
2073
+ } = s, { t: i } = Y(), _ = async () => {
2074
+ try {
2075
+ const o = await rt.get("/api/ExportDataUser/" + d.id, {
2076
+ responseType: "blob"
2077
+ }), S = o.headers["content-disposition"];
2078
+ let $ = `${d.fullName || "Data"}.xlsx`;
2079
+ if (S) {
2080
+ const h = S.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
2081
+ h && h[1] && ($ = h[1].replace(/['"]/g, ""));
2082
+ }
2083
+ const O = window.URL.createObjectURL(new Blob([o.data])), T = document.createElement("a");
2084
+ T.href = O, T.setAttribute("download", $), document.body.appendChild(T), T.click(), T.remove(), window.URL.revokeObjectURL(O);
2085
+ } catch (o) {
2086
+ console.error("Failed to download user data", o);
2087
+ }
2088
+ };
2089
+ return /* @__PURE__ */ e(
2090
+ Ut,
2091
+ {
2092
+ header: c,
2093
+ ref: l,
2094
+ onCancel: () => {
2095
+ a();
2096
+ },
2097
+ children: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ u(j, { md: 12, className: "mb-2", children: [
2098
+ /* @__PURE__ */ e("p", { children: i("export_user_data") }),
2099
+ /* @__PURE__ */ e("div", { className: "pb-3", children: /* @__PURE__ */ e(
2100
+ J,
2101
+ {
2102
+ color: "success",
2103
+ onClick: () => {
2104
+ _();
2105
+ },
2106
+ style: { color: "#fff" },
2107
+ children: i("download_users_data")
2108
+ }
2109
+ ) }),
2110
+ /* @__PURE__ */ e("p", { children: "Delete user" }),
2111
+ !!d && /* @__PURE__ */ u("div", { children: [
2112
+ d.roles.includes("Student") && /* @__PURE__ */ u("div", { children: [
2113
+ /* @__PURE__ */ e(ke, { color: "danger", children: i("alert_delete_user") }),
2114
+ /* @__PURE__ */ e(
2115
+ J,
2116
+ {
2117
+ color: "danger",
2118
+ onClick: () => r(d.id),
2119
+ style: { color: "#fff" },
2120
+ children: i("delete_user")
2121
+ }
2122
+ )
2123
+ ] }),
2124
+ d.roles.includes("Admin") && /* @__PURE__ */ u("div", { children: [
2125
+ /* @__PURE__ */ e(ke, { color: "danger", children: i("alert_delete_user") }),
2126
+ /* @__PURE__ */ e(
2127
+ J,
2128
+ {
2129
+ color: "danger",
2130
+ onClick: () => r(d.id),
2131
+ children: i("delete_user")
2132
+ }
2133
+ )
2134
+ ] }),
2135
+ d.roles.includes("Teacher") && /* @__PURE__ */ u("div", { children: [
2136
+ /* @__PURE__ */ e(ke, { color: "warning", children: i("alert_delete_user") }),
2137
+ /* @__PURE__ */ e(
2138
+ Q,
2139
+ {
2140
+ options: b,
2141
+ defaultValue: g,
2142
+ placeholder: "select_teacher_change",
2143
+ onChange: (o) => n(o.value)
2144
+ }
2145
+ ),
2146
+ !!g && /* @__PURE__ */ u("div", { className: "mt-2", children: [
2147
+ /* @__PURE__ */ e(ke, { color: "danger", children: i("alert_delete_user") }),
2148
+ /* @__PURE__ */ e(
2149
+ J,
2150
+ {
2151
+ color: "danger",
2152
+ onClick: () => r(d.id),
2153
+ children: i("delete_user")
2154
+ }
2155
+ )
2156
+ ] })
2157
+ ] }),
2158
+ (d.roles.includes("Parent") || d.roles.includes("Counselor") || d.roles.includes("SecondaryTeacher")) && /* @__PURE__ */ u("div", { children: [
2159
+ /* @__PURE__ */ e(ke, { color: "danger", children: i("alert_delete_user") }),
2160
+ /* @__PURE__ */ e(
2161
+ J,
2162
+ {
2163
+ color: "danger",
2164
+ onClick: () => r(d.id),
2165
+ children: i("delete_user")
2166
+ }
2167
+ )
2168
+ ] })
2169
+ ] })
2170
+ ] }) })
2171
+ }
2172
+ );
2173
+ }, Ma = yt(Da), xa = "user_deleted", Oa = () => {
2174
+ const {
2175
+ userList: s,
2176
+ totalItems: l,
2177
+ filters: c,
2178
+ changeFilters: r,
2179
+ removeData: a,
2180
+ openModal: d,
2181
+ modal: b,
2182
+ userChoiced: g,
2183
+ setUserChoiced: n,
2184
+ options: i,
2185
+ teacherChangeId: _,
2186
+ setTeacherChangeId: o,
2187
+ resetData: S
2188
+ } = ka(), { t: $ } = Y(), O = (T) => {
2189
+ T && n(T), d();
2190
+ };
2191
+ return /* @__PURE__ */ u("div", { className: "fadeIn animated", children: [
2192
+ /* @__PURE__ */ e("h5", { className: "mt-4 mb-2", children: $(xa) }),
2193
+ /* @__PURE__ */ u(ae, { className: "my-2", children: [
2194
+ /* @__PURE__ */ e(j, { md: 8, children: /* @__PURE__ */ e(
2195
+ gt,
2196
+ {
2197
+ initValue: c.searchString,
2198
+ onSearch: (T) => r({ searchString: T }),
2199
+ placeholder: $("type_something_to_search_reflection_result")
2200
+ }
2201
+ ) }),
2202
+ /* @__PURE__ */ u(
2203
+ j,
2204
+ {
2205
+ md: 4,
2206
+ className: "d-flex justify-content-end align-items-center",
2207
+ children: [
2208
+ $("total_of_users"),
2209
+ ": ",
2210
+ l
2211
+ ]
2212
+ }
2213
+ )
2214
+ ] }),
2215
+ /* @__PURE__ */ u(ae, { className: "mb-2", children: [
2216
+ /* @__PURE__ */ e(j, { md: 12, children: s && s.length > 0 ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ u(Tt, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
2217
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ u("tr", { children: [
2218
+ /* @__PURE__ */ e("th", { className: "align-top", children: $("name") }),
2219
+ /* @__PURE__ */ e("th", { className: "align-top", children: $("email") }),
2220
+ /* @__PURE__ */ e("th", { className: "align-top", children: $("role") })
2221
+ ] }) }),
2222
+ /* @__PURE__ */ e("tbody", { children: s.map((T) => /* @__PURE__ */ u("tr", { children: [
2223
+ /* @__PURE__ */ e("td", { className: "align-middle", children: /* @__PURE__ */ e(
2224
+ $t,
2225
+ {
2226
+ label: `${T.fullName}`,
2227
+ onClick: () => O(T)
2228
+ }
2229
+ ) }),
2230
+ /* @__PURE__ */ e("td", { className: "align-middle", children: T.email }),
2231
+ /* @__PURE__ */ e("td", { className: "align-middle", children: !!T.roles && T.roles.map((h) => h === "SecondaryTeacher" ? "SupportTeacher" : h).join(", ") })
2232
+ ] }, T.id)) })
2233
+ ] }) }) : /* @__PURE__ */ e(Et, { label: $("user") }) }),
2234
+ /* @__PURE__ */ e(j, { md: 12, children: /* @__PURE__ */ e(
2235
+ ft,
2236
+ {
2237
+ filters: c,
2238
+ totalRecordCount: l,
2239
+ changePageSize: (T) => r({ pageSize: T }),
2240
+ changePage: (T) => r({ currentPage: T })
2241
+ }
2242
+ ) })
2243
+ ] }),
2244
+ /* @__PURE__ */ e(
2245
+ Ma,
2246
+ {
2247
+ ref: b,
2248
+ header: g.fullName,
2249
+ onCancel: () => {
2250
+ },
2251
+ userChoiced: g,
2252
+ removeData: a,
2253
+ options: i,
2254
+ teacherChangeId: _,
2255
+ setTeacherChangeId: o,
2256
+ resetData: S
2257
+ }
2258
+ )
2259
+ ] });
2260
+ }, Aa = {
2261
+ padding: "4px 8px",
2262
+ marginBottom: 0,
2263
+ borderRadius: "4px",
2264
+ color: "#fff",
2265
+ fontWeight: 500,
2266
+ fontSize: "14px",
2267
+ height: "56px",
2268
+ justifyContent: "center"
2269
+ }, Pe = ({
2270
+ htmlFor: s,
2271
+ isDisabled: l,
2272
+ text: c,
2273
+ backgroundColor: r,
2274
+ onClick: a,
2275
+ isClassReflection: d
2276
+ }) => /* @__PURE__ */ u(
2277
+ Vt,
2278
+ {
2279
+ htmlFor: s,
2280
+ role: "button",
2281
+ tabIndex: 0,
2282
+ className: `d-flex align-items-center justfy-content-center mr-2
2283
+ ${d ? "w-25" : ""}
2284
+ ${l ? "" : "cursor-pointer hover-opacity"}`,
2285
+ style: {
2286
+ ...Aa,
2287
+ backgroundColor: r,
2288
+ opacity: l ? 0.5 : 1,
2289
+ gap: "8px"
2290
+ },
2291
+ onClick: (b) => a(),
2292
+ children: [
2293
+ /* @__PURE__ */ e("i", { className: "fa fa-paperclip mr-1", "aria-hidden": "true" }),
2294
+ c
2295
+ ]
2296
+ }
2297
+ ), It = `${vt}/api/ImportCsv/csv`, ct = `${vt}/api/Teacher`, Ra = (s, l) => lt.post(`${It}/${l}`, s), mt = (s) => lt.post(`${It}/importClassReflection`, s), La = (s, l) => lt.post(`${ct}/adminImportStudentByTeacherId/${s}`, l), Ba = (s) => rt.post(`${ct}/adminImportChunkUser`, s), Fa = () => rt.get(`${ct}/download-template-file-user`);
2298
+ var Ct = /* @__PURE__ */ ((s) => (s.Students = "students", s.Subjects = "subjects", s.Grades = "grades", s.Attendances = "attendances", s.ClassReflection = "classReflection", s.Others = "others", s.AllUser = "allUser", s))(Ct || {});
2299
+ const Pa = [
2300
+ {
2301
+ text: "import_users",
2302
+ backgroundColor: "#0abde3",
2303
+ type: "allUser"
2304
+ /* AllUser */
2305
+ }
2306
+ ], Ja = [
2307
+ // {
2308
+ // text: "Import students",
2309
+ // backgroundColor: "#0abde3",
2310
+ // type: CSVType.Students
2311
+ // },
2312
+ // {
2313
+ // text: "Import subjects",
2314
+ // backgroundColor: "#1dd1a1",
2315
+ // type: CSVType.Subjects
2316
+ // },
2317
+ // { text: "Import grades", backgroundColor: "#54a0ff", type: CSVType.Grades },
2318
+ // {
2319
+ // text: "Import attendances",
2320
+ // backgroundColor: "#feca57",
2321
+ // type: CSVType.Attendances
2322
+ // },
2323
+ {
2324
+ text: "import_class_reflection",
2325
+ backgroundColor: "#e74c3c",
2326
+ type: "classReflection"
2327
+ /* ClassReflection */
2328
+ }
2329
+ // { text: "Import others", backgroundColor: "#8395a7", type: CSVType.Others }
2330
+ ], ja = "CSV Import", st = "csvupload", pt = {
2331
+ teacherName: "",
2332
+ teacherEmail: "",
2333
+ studentIds: [],
2334
+ file: ""
2335
+ }, za = () => {
2336
+ const s = re(), l = ra((w) => w.common.isLoading), [c, r] = I(null), [a, d] = I(), [b, g] = I([]), [n, i] = I(pt), [_, o] = I(), [S, $] = I([]), T = window.location.hostname.includes("isb"), [h, N] = I(0), [R, z] = I("");
2337
+ te(() => {
2338
+ document.title = ja;
2339
+ }, []);
2340
+ const W = T ? Pa : Ja, de = async () => {
2341
+ s(F(!0));
2342
+ try {
2343
+ const L = await Fa();
2344
+ var w = new Blob([L.data.content], { type: "text/csv" });
2345
+ const Z = window.URL.createObjectURL(w);
2346
+ var M = document.createElement("a");
2347
+ M.href = Z, M.setAttribute("download", L.data.nameFile), M.click(), s(
2348
+ C({
2349
+ type: "success",
2350
+ message: "Download successfully"
2351
+ })
2352
+ );
2353
+ } catch (L) {
2354
+ s(
2355
+ C({
2356
+ type: "danger",
2357
+ message: L.message
2358
+ })
2359
+ );
2360
+ }
2361
+ s(F(!1));
2362
+ }, se = G(
2363
+ async (w) => {
2364
+ if (!c || !w) return;
2365
+ s(F(!0));
2366
+ try {
2367
+ const H = new FormData();
2368
+ H.append("file", w, w.name);
2369
+ const ee = c === "allUser" ? it.Admin : it.Teacher, K = await Mt(H, ee);
2370
+ if (K.data && K.data.length > 0) {
2371
+ $(K.data), s(F(!1)), s(
2372
+ C({
2373
+ type: "danger",
2374
+ message: "Please use the file as per the template."
2375
+ })
2376
+ );
2377
+ return;
2378
+ }
2379
+ if (c == "allUser") {
2380
+ let ne = (await w.text()).trim();
2381
+ const pe = ne.split(`
2382
+ `).map((q) => q.trim()), ge = pe.findIndex((q) => q.split(",").includes("First Name"));
2383
+ if (ge === 0)
2384
+ throw new Error("Invalid CSV: Missing header row.");
2385
+ ne = pe.slice(ge).join(`
2386
+ `);
2387
+ const le = oa.parse(ne, { header: !0, skipEmptyLines: !0 }), ce = le.meta.fields, oe = le.data;
2388
+ if (!oe.length) {
2389
+ s(F(!1)), s(
2390
+ C({
2391
+ type: "danger",
2392
+ message: "The file has no data or some column names are misformed."
2393
+ })
2394
+ );
2395
+ return;
2396
+ }
2397
+ const V = 10, ie = [];
2398
+ for (let q = 0; q < oe.length; q += V) {
2399
+ const ye = oe.slice(q, q + V).map(
2400
+ (we) => Object.values(we).map((Ue) => (Ue ?? "").toString().trim())
2401
+ );
2402
+ ce && ye.unshift(ce), ie.push(ye);
2403
+ }
2404
+ for (let q = 0; q < ie.length; q++)
2405
+ await Ba({
2406
+ index: q,
2407
+ chunks: ie[q]
2408
+ }), await new Promise((fe) => setTimeout(fe, 500));
2409
+ } else
2410
+ T ? c == "classReflection" && await mt(H) : await Ra(H, c.toString());
2411
+ s(
2412
+ C({
2413
+ type: "success",
2414
+ message: "Import CSV successfully"
2415
+ })
2416
+ );
2417
+ } catch (H) {
2418
+ console.error("❌ Upload failed", H), s(
2419
+ C({
2420
+ type: "danger",
2421
+ message: H.response?.data?.title || H.message
2422
+ })
2423
+ );
2424
+ }
2425
+ s(F(!1));
2426
+ const M = document.getElementById(st), L = document.getElementById("import-student"), Z = document.getElementById("import-classReflection");
2427
+ M && (M.value = ""), L && (L.value = ""), Z && (Z.value = "");
2428
+ },
2429
+ [c]
2430
+ ), X = async (w) => {
2431
+ if (!h) {
2432
+ s(
2433
+ C({
2434
+ type: "danger",
2435
+ message: "Select teacher before import csv"
2436
+ })
2437
+ );
2438
+ return;
2439
+ }
2440
+ if (!c || !w) return;
2441
+ s(F(!0));
2442
+ try {
2443
+ const L = new FormData();
2444
+ L.append("file", w, w.name), await La(h, L), s(
2445
+ C({
2446
+ type: "success",
2447
+ message: "Import CSV successfully"
2448
+ })
2449
+ );
2450
+ } catch (L) {
2451
+ s(
2452
+ C({
2453
+ type: "danger",
2454
+ message: L.response?.data?.title || L.message
2455
+ })
2456
+ );
2457
+ }
2458
+ s(F(!1));
2459
+ const M = document.getElementById("teacherSelector");
2460
+ M && (M.value = "");
2461
+ }, he = async (w) => {
2462
+ if (!a || !a) return;
2463
+ s(F(!0));
2464
+ try {
2465
+ const L = new FormData();
2466
+ L.append("file", a, a.name), L.append("teacherName", w.teacherName), L.append("teacherEmail", w.teacherEmail), w.studentIds.forEach((Z) => {
2467
+ L.append("studentIds", Z);
2468
+ }), await mt(L), s(
2469
+ C({
2470
+ type: "success",
2471
+ message: "Import CSV successfully"
2472
+ })
2473
+ ), i(pt);
2474
+ } catch (L) {
2475
+ s(
2476
+ C({
2477
+ type: "danger",
2478
+ message: L.response?.data?.title || L.message
2479
+ })
2480
+ );
2481
+ }
2482
+ s(F(!1));
2483
+ const M = document.getElementById(st);
2484
+ M && (M.value = "");
2485
+ }, ue = (w) => {
2486
+ N(w.value);
2487
+ }, D = (w) => {
2488
+ o(w), z(w?.name || "");
2489
+ }, E = () => {
2490
+ if (!_) {
2491
+ s(
2492
+ C({
2493
+ type: "danger",
2494
+ message: "Select CSV to import"
2495
+ })
2496
+ );
2497
+ return;
2498
+ }
2499
+ X(_);
2500
+ };
2501
+ return {
2502
+ isLoading: l,
2503
+ buttons: W,
2504
+ id: st,
2505
+ setType: r,
2506
+ upload: se,
2507
+ initImportReflection: n,
2508
+ setInitImportReflection: i,
2509
+ onConfirm: he,
2510
+ CSVType: Ct,
2511
+ dataFile: a,
2512
+ setDataFile: d,
2513
+ setArrStudent: g,
2514
+ arrStudent: b,
2515
+ isCheckDomainIBS: T,
2516
+ onChangeTeacher: ue,
2517
+ uploadByTeacherId: X,
2518
+ setDataFileImportStudent: D,
2519
+ onUpLoadStudentFile: E,
2520
+ defaultTeacher: h,
2521
+ fileName: R,
2522
+ onStudentSubmit: () => {
2523
+ s(
2524
+ nt({
2525
+ isOpen: !0,
2526
+ type: "warning",
2527
+ message: "Are you sure upload this file?",
2528
+ onConfirm: () => {
2529
+ E();
2530
+ }
2531
+ })
2532
+ );
2533
+ },
2534
+ downloadTemplateUser: de,
2535
+ errorsValidate: S,
2536
+ setErrorsValidate: $
2537
+ };
2538
+ }, Va = xe.object({
2539
+ teacherName: xe.string()?.trim().required(),
2540
+ teacherEmail: xe.string()?.trim().email("Invalid email").required(),
2541
+ studentIds: xe.array().required().test(
2542
+ "test students",
2543
+ "Please choose student",
2544
+ function() {
2545
+ return !!this.parent.studentIds && !!this.parent.studentIds.length;
2546
+ }
2547
+ ),
2548
+ file: xe.string()?.trim().required()
2549
+ }), qa = () => {
2550
+ const {
2551
+ initImportReflection: s,
2552
+ onConfirm: l,
2553
+ isLoading: c,
2554
+ setType: r,
2555
+ id: a,
2556
+ CSVType: d,
2557
+ dataFile: b,
2558
+ setDataFile: g,
2559
+ setArrStudent: n,
2560
+ buttons: i,
2561
+ upload: _,
2562
+ isCheckDomainIBS: o,
2563
+ downloadTemplateUser: S,
2564
+ errorsValidate: $,
2565
+ setErrorsValidate: O
2566
+ } = za(), { t: T } = Y();
2567
+ return /* @__PURE__ */ e("div", { className: "animated fadeIn pt-3", children: o ? /* @__PURE__ */ u(tt, { children: [
2568
+ /* @__PURE__ */ e(
2569
+ De,
2570
+ {
2571
+ className: "d-none",
2572
+ type: "file",
2573
+ id: "import-user",
2574
+ onChange: (h) => _(h.target.files[0]),
2575
+ accept: "text/csv"
2576
+ }
2577
+ ),
2578
+ /* @__PURE__ */ e(
2579
+ De,
2580
+ {
2581
+ className: "d-none",
2582
+ type: "file",
2583
+ id: "import-classReflection",
2584
+ onChange: (h) => _(h.target.files[0]),
2585
+ accept: "text/csv"
2586
+ }
2587
+ ),
2588
+ /* @__PURE__ */ e("div", { className: "class-reflection", children: /* @__PURE__ */ e(
2589
+ ca,
2590
+ {
2591
+ initialValues: s,
2592
+ enableReinitialize: !0,
2593
+ validationSchema: Va,
2594
+ onSubmit: (h, N) => {
2595
+ l(h), g(""), n([]), N.resetForm();
2596
+ },
2597
+ children: (h) => {
2598
+ const {
2599
+ // values,
2600
+ touched: N,
2601
+ errors: R
2602
+ // handleSubmit,
2603
+ // handleChange
2604
+ } = h;
2605
+ return /* @__PURE__ */ u(ae, { className: "mb-2", children: [
2606
+ /* @__PURE__ */ e(
2607
+ De,
2608
+ {
2609
+ className: "d-none",
2610
+ type: "file",
2611
+ id: a,
2612
+ onChange: (z) => {
2613
+ g(z.target.files[0]), h.setFieldValue("file", "imported");
2614
+ const W = document.getElementById(a);
2615
+ W && (W.value = "");
2616
+ },
2617
+ accept: "text/csv"
2618
+ }
2619
+ ),
2620
+ /* @__PURE__ */ e(j, { md: 6, className: "mb-2 d-flex mt-5", children: /* @__PURE__ */ u(ae, { className: "w-100 flex-column", children: [
2621
+ /* @__PURE__ */ u(j, { md: 12, className: "", children: [
2622
+ /* @__PURE__ */ e(Le, { text: T("import_class_reflection") }),
2623
+ /* @__PURE__ */ e(
2624
+ Pe,
2625
+ {
2626
+ htmlFor: "import-classReflection",
2627
+ text: T("import_class_reflection"),
2628
+ isDisabled: c,
2629
+ backgroundColor: "#e74c3c",
2630
+ onClick: () => {
2631
+ r(d.ClassReflection);
2632
+ }
2633
+ },
2634
+ "Import class reflections"
2635
+ ),
2636
+ !!b && /* @__PURE__ */ e("p", { style: { color: "#007bff", fontStyle: "italic", marginTop: "5px" }, children: b.name })
2637
+ ] }),
2638
+ !b && /* @__PURE__ */ e(j, { md: 12, className: "mb-2", children: N.file && R.file && /* @__PURE__ */ e(
2639
+ at,
2640
+ {
2641
+ text: R.file
2642
+ }
2643
+ ) })
2644
+ ] }) }),
2645
+ /* @__PURE__ */ e(j, { md: 6, className: "mb-2", children: /* @__PURE__ */ u(ae, { className: "flex-column", children: [
2646
+ /* @__PURE__ */ e(j, { md: 12, className: "mb-2 text-right", style: { textAlign: "right" }, children: /* @__PURE__ */ e(
2647
+ J,
2648
+ {
2649
+ role: "button",
2650
+ color: "primary",
2651
+ onClick: () => S(),
2652
+ children: /* @__PURE__ */ u("p", { className: "d-flex align-items-center mb-0", children: [
2653
+ T("download_template"),
2654
+ " ",
2655
+ /* @__PURE__ */ e(dt, { size: 20, className: "ml-2" })
2656
+ ] })
2657
+ }
2658
+ ) }),
2659
+ /* @__PURE__ */ u(j, { md: 12, className: "mb-2", children: [
2660
+ /* @__PURE__ */ e(Le, { text: T("import_users") }),
2661
+ i.map((z) => /* @__PURE__ */ e(
2662
+ Pe,
2663
+ {
2664
+ htmlFor: "import-user",
2665
+ text: z.text,
2666
+ isDisabled: c,
2667
+ backgroundColor: z.backgroundColor,
2668
+ onClick: () => r(z.type)
2669
+ },
2670
+ z.text
2671
+ ))
2672
+ ] }),
2673
+ $?.length > 0 && $.map((z, W) => /* @__PURE__ */ e(
2674
+ at,
2675
+ {
2676
+ text: z
2677
+ },
2678
+ W
2679
+ ))
2680
+ ] }) })
2681
+ ] });
2682
+ }
2683
+ }
2684
+ ) })
2685
+ ] }) : /* @__PURE__ */ e(tt, { children: /* @__PURE__ */ u(ae, { children: [
2686
+ /* @__PURE__ */ e(j, { md: 12, className: "mt-2 mb-2 text-left", children: /* @__PURE__ */ e(
2687
+ J,
2688
+ {
2689
+ role: "button",
2690
+ color: "primary",
2691
+ onClick: () => S(),
2692
+ children: /* @__PURE__ */ u("p", { className: "d-flex align-items-center mb-0", children: [
2693
+ T("download_template"),
2694
+ " ",
2695
+ /* @__PURE__ */ e(dt, { size: 20, className: "ml-2" })
2696
+ ] })
2697
+ }
2698
+ ) }),
2699
+ /* @__PURE__ */ u(j, { md: 6, className: "mb-3", children: [
2700
+ /* @__PURE__ */ e(
2701
+ De,
2702
+ {
2703
+ id: "import-user",
2704
+ className: "d-none",
2705
+ type: "file",
2706
+ onChange: (h) => _(h.target.files[0]),
2707
+ accept: "text/csv"
2708
+ }
2709
+ ),
2710
+ /* @__PURE__ */ e(Le, { text: T("import_users") }),
2711
+ /* @__PURE__ */ e(
2712
+ Pe,
2713
+ {
2714
+ htmlFor: "import-user",
2715
+ text: T("import_users"),
2716
+ isDisabled: c,
2717
+ backgroundColor: "#0abde3",
2718
+ onClick: () => {
2719
+ r(d.AllUser), $.length > 0 && O([]);
2720
+ }
2721
+ },
2722
+ "import-users"
2723
+ )
2724
+ ] }),
2725
+ $.length > 0 && $.map((h, N) => /* @__PURE__ */ e(
2726
+ at,
2727
+ {
2728
+ text: h
2729
+ },
2730
+ N
2731
+ )),
2732
+ /* @__PURE__ */ u(j, { md: 6, className: "mb-3", children: [
2733
+ /* @__PURE__ */ e(
2734
+ De,
2735
+ {
2736
+ className: "d-none",
2737
+ type: "file",
2738
+ id: a,
2739
+ onChange: (h) => _(h.target.files[0]),
2740
+ accept: "text/csv"
2741
+ }
2742
+ ),
2743
+ i.map((h) => /* @__PURE__ */ u(tt, { children: [
2744
+ /* @__PURE__ */ e(Le, { text: T(h.text) }),
2745
+ /* @__PURE__ */ e(
2746
+ Pe,
2747
+ {
2748
+ htmlFor: a,
2749
+ text: T(h.text),
2750
+ isDisabled: c,
2751
+ backgroundColor: h.backgroundColor,
2752
+ onClick: () => r(h.type)
2753
+ },
2754
+ h.text
2755
+ )
2756
+ ] }))
2757
+ ] })
2758
+ ] }) }) });
2759
+ }, Wa = [
2760
+ {
2761
+ path: "/admin/users/user-list",
2762
+ title: "user_list",
2763
+ component: xt
2764
+ },
2765
+ {
2766
+ path: "/admin/users/assign-student",
2767
+ title: "assign_student",
2768
+ component: Ua
2769
+ },
2770
+ {
2771
+ path: "/admin/users/user-deleted",
2772
+ title: "user_deleted",
2773
+ component: Oa
2774
+ },
2775
+ {
2776
+ path: "/admin/users/import-csv",
2777
+ title: "csv_import",
2778
+ component: qa
2779
+ }
2780
+ ], rs = () => /* @__PURE__ */ e(kt, { tabs: Wa });
2781
+ export {
2782
+ rs as default
2783
+ };