mario-education 2.0.218-staging → 2.0.219-staging

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1765 @@
1
+ import { jsxs as n, Fragment as Kt, jsx as e } from "react/jsx-runtime";
2
+ import { api as es, BASE_URL as ts, useTranslation as re, setLoading as E, setAlert as K, getFileUrl as at, utcToLocalTime as ss, getStaticFileUrl as as } from "mario-core";
3
+ import { s as t } from "./dashboard.module-BfiwxRLN.js";
4
+ import { Grid as d, Typography as N, Autocomplete as P, TextField as G, Chip as Nt, TableContainer as ns, Table as rs, TableHead as os, TableBody as ls, TableRow as is, TableCell as We, List as pt, ListItem as gt, Collapse as cs } from "@mui/material";
5
+ import { useState as C, useRef as wt, useEffect as W, useCallback as ne, useMemo as Ne, memo as ds } from "react";
6
+ import { useDispatch as nt, useSelector as rt } from "react-redux";
7
+ import { g as us, a as ms, b as hs, c as ps, d as Ct, e as gs, f as Cs } from "./surveyService-CaYOE76V.js";
8
+ import { useNavigate as St, useParams as ot } from "react-router-dom";
9
+ import { g as fs } from "./SurveyService-CSc5VmOu.js";
10
+ import { r as ee } from "./constantsFn-gH1I6RO1.js";
11
+ import { Q as Ie, t as Ke, r as st, D as $t, L as ft, M as et, F as De, g as vt } from "./constants-SOMz_L0J.js";
12
+ import k from "moment";
13
+ import { u as Le } from "./useFontStyles-BesOHek8.js";
14
+ import { A as vs } from "./ArrowBack-DytrysgX.js";
15
+ import { A as ys, O as bs, s as Ns, a as M, P as ws, C as Ss, c as $s, r as _s } from "./OverallDonutChart-DTl3yfM6.js";
16
+ import { A as xs } from "./ArrowForward-DxhjtaZw.js";
17
+ import { C as _t } from "./Clear-ZsidxAE2.js";
18
+ import xt from "react-apexcharts";
19
+ import { S as Rt } from "./SimpleDialog-ioNphHbB.js";
20
+ import { T as Rs, a as Os, C as Ds } from "./TableCells-BcPrTpL1.js";
21
+ import { f as Ot } from "./formatDate-BZ4G3WwO.js";
22
+ import { s as p, C as Is } from "./styles.module-D4SQKnAI.js";
23
+ import { d as Ls } from "./createSvgIcon-Bge4D-o7.js";
24
+ import { E as Ts } from "./ExpandMore-4zAb3mtz.js";
25
+ const As = `${ts}/api/ShareSurvey`, qs = (s) => es.put(`${As}/external-link`, s), Qs = () => {
26
+ const s = nt(), i = St(), { t: c } = re(), { id: o } = ot(), [g, _] = C(
27
+ null
28
+ ), [u, y] = C(!1), [m, $] = C(), [r, v] = C([]), [A, w] = C([]), [T, D] = C([]), [I, x] = C(
29
+ null
30
+ ), [q, Z] = C([]), [f, B] = C([]), [Y, we] = C([]), [oe, de] = C([]), [U, ue] = C([]), [me, h] = C([]), [R, J] = C([]), [te, he] = C([]), [z, Se] = C(null), [le, Ve] = C([]), [pe, Te] = C(""), [ze, Ue] = C([]), [Pe, ge] = C([]), [Ge, Ae] = C([]), [$e, qe] = C(""), [Ze, Qe] = C([]), [Ce, ie] = C([0]), [_e, Fe] = C(!1), [xe, Ee] = C(!1), ce = wt(null), fe = rt((a) => a.common?.user?.roles), [S, Ye] = C({
31
+ searchString: "",
32
+ startDate: null,
33
+ endDate: null,
34
+ optionDate: "",
35
+ grade: ["All"],
36
+ roles: fe || []
37
+ }), ae = (a) => {
38
+ Ye({
39
+ ...S,
40
+ ...a
41
+ }), ge([]), J([]), ve([]), h([]);
42
+ }, Je = (a) => {
43
+ ae({
44
+ ...S,
45
+ startDate: a?.valueOf(),
46
+ currentPage: 1,
47
+ optionDate: ""
48
+ });
49
+ }, ke = (a) => {
50
+ ae({
51
+ ...S,
52
+ endDate: a?.valueOf(),
53
+ currentPage: 1,
54
+ optionDate: ""
55
+ });
56
+ }, Me = (a) => {
57
+ ae({
58
+ currentPage: 1,
59
+ grade: a
60
+ });
61
+ }, Be = (a) => {
62
+ let l = null, b = null;
63
+ switch (a.toLocaleLowerCase()) {
64
+ case "weeks":
65
+ l = k().startOf("week").weekday(1).valueOf(), b = k().endOf("week").weekday(7).valueOf();
66
+ break;
67
+ case "months":
68
+ l = k().startOf("month").valueOf(), b = k().endOf("month").valueOf();
69
+ break;
70
+ }
71
+ ae({
72
+ ...S,
73
+ startDate: l,
74
+ endDate: b,
75
+ currentPage: 1,
76
+ optionDate: a
77
+ });
78
+ }, Xe = (a) => {
79
+ const l = a.target.value;
80
+ ce.current && clearTimeout(ce.current), ce.current = setTimeout(() => {
81
+ ae({
82
+ searchString: l,
83
+ currentPage: 1
84
+ });
85
+ }, 800);
86
+ };
87
+ W(() => {
88
+ const a = Array.from(new Set(le.map((l) => l.templateName))).sort((l, b) => l.localeCompare(b, void 0, { sensitivity: "base" }));
89
+ Ae(a), qe(a[0]);
90
+ }, [le]), W(() => {
91
+ const a = le.filter((l) => l.templateName === $e);
92
+ Qe(a);
93
+ }, [$e, le]);
94
+ const je = (a) => {
95
+ const l = Ce.includes(a);
96
+ ie(l ? Ce.filter((b) => b !== a) : [...Ce, a]);
97
+ }, [He, Re] = C(""), [Oe, ve] = C([]), [Q, H] = C(""), [V, ye] = C([]), [Dt, lt] = C(null);
98
+ W(() => {
99
+ H(V[0]);
100
+ const a = A.find((l) => l.templateName === V[0]);
101
+ a && (x(a), lt(a));
102
+ }, [A, V]);
103
+ const [It, it] = C(""), [Lt, Tt] = C([]);
104
+ W(() => {
105
+ const a = Array.from(new Set(te.map((b) => b.templateName))).sort((b, X) => b.localeCompare(X, void 0, { sensitivity: "base" }));
106
+ Tt(a), it(a[0]);
107
+ const l = te.find((b) => b.templateName === a[0]);
108
+ l && ct(l);
109
+ }, [te]);
110
+ const At = () => {
111
+ i("/admin/survey-dashboard/list-survey");
112
+ }, ct = (a) => {
113
+ Se(a);
114
+ }, dt = (a) => {
115
+ const l = [...me];
116
+ if (l[a] = !l[a], l.filter((b) => b == !0).length > 4) {
117
+ s(
118
+ K({
119
+ type: "danger",
120
+ message: c(Ke)
121
+ })
122
+ );
123
+ return;
124
+ }
125
+ h(l);
126
+ }, qt = (a) => {
127
+ const l = [...R];
128
+ if (l[a] = !l[a], l.filter((b) => b == !0).length > 4) {
129
+ s(
130
+ K({
131
+ type: "danger",
132
+ message: c(Ke)
133
+ })
134
+ );
135
+ return;
136
+ }
137
+ J(l);
138
+ }, Qt = () => {
139
+ s(
140
+ K({
141
+ type: "danger",
142
+ message: c(Ke)
143
+ })
144
+ );
145
+ }, Ft = () => {
146
+ y(!u);
147
+ }, Et = (a) => {
148
+ a ? _({
149
+ avatar: a.avatar,
150
+ studentId: a.studentId,
151
+ studentName: a.studentName,
152
+ isExternal: a?.isExternal
153
+ }) : (_(null), v([]));
154
+ }, kt = ne(() => {
155
+ const a = A.findIndex(
156
+ (b) => b.questionId == I?.questionId
157
+ ), l = a || a == 0 ? oe[a] : 0;
158
+ return parseFloat(l?.toFixed(2)?.replace(".00", "") || "0");
159
+ }, [I, A, oe]), Mt = ne(async () => {
160
+ s(E(!0));
161
+ try {
162
+ const a = await us(parseInt(o || "0"), fe || []);
163
+ $(a.data || null);
164
+ } catch (a) {
165
+ s(
166
+ K({
167
+ type: "danger",
168
+ message: a.response?.data?.title || a.message
169
+ })
170
+ );
171
+ }
172
+ s(E(!1));
173
+ }, [o, fe]), Bt = ne(async () => {
174
+ s(E(!0));
175
+ try {
176
+ const l = (g?.isExternal ? await qs({
177
+ token: "",
178
+ externalSurveyId: g.studentId
179
+ }) : await fs(
180
+ parseInt(o || "0"),
181
+ g?.studentId || 0
182
+ ))?.data?.studentResult;
183
+ if (l) {
184
+ const b = l.additionalQuestions || [], X = l.questions || [], se = [];
185
+ if (b.length > 0) {
186
+ const F = b.map((O) => ({
187
+ questionId: O.id,
188
+ question: O.text,
189
+ type: O.type,
190
+ category: "",
191
+ date: O.sendDate != "0001-01-01T00:00:00" ? O.sendDate : "",
192
+ answer: O.answer
193
+ }));
194
+ se.push(...F);
195
+ }
196
+ X.forEach((F) => {
197
+ F?.questions?.forEach((O) => {
198
+ const j = {
199
+ answer: O.answer,
200
+ category: F.templateName,
201
+ date: O.sendDate,
202
+ question: O.text,
203
+ questionId: O.id,
204
+ type: O.type
205
+ };
206
+ se.push(j);
207
+ });
208
+ }), v(se);
209
+ }
210
+ } catch (a) {
211
+ s(
212
+ K({
213
+ type: "danger",
214
+ message: a.response?.data?.title || a.message
215
+ })
216
+ );
217
+ }
218
+ s(E(!1));
219
+ }, [o, g]), Ht = ne(async () => {
220
+ s(E(!0));
221
+ try {
222
+ const l = (await ms(parseInt(o || "0"), { ...S, grade: S.grade?.includes("All") ? [] : S.grade })).data || [], b = l.questions.map((L) => ({
223
+ questionId: L.questionId,
224
+ templateName: L.templateName,
225
+ text: ee(L.text),
226
+ type: L.type
227
+ })) || [], X = [...b];
228
+ w(b), x(X.sort((L, be) => L.text.localeCompare(be.text))[0]), D(
229
+ l.questions.map(
230
+ (L, be) => `Q ${be + 1}`
231
+ )
232
+ ), de(l.avgQuestionSurvey || []);
233
+ const se = (L) => L && (L.type === "Rating" || L.type === 10 || L.type === Ie.Rating), F = b.filter(se), O = Array.from(new Set(b.map((L) => L.templateName))).sort((L, be) => L.localeCompare(be, void 0, { sensitivity: "base" }));
234
+ ye([...O]);
235
+ const j = Array.from(new Set(F.map((L) => L.templateName))), ut = j.length ? j[0] : O[0];
236
+ Re(ut);
237
+ const mt = (F.length ? F : b).filter((L) => L.templateName === ut);
238
+ if (mt.length) {
239
+ const L = mt.slice(0, 1);
240
+ if (JSON.stringify(Oe) === JSON.stringify(L) || !Oe.length) {
241
+ const ht = b.findIndex((jt) => jt.questionId === L[0].questionId);
242
+ ve(L), ht !== -1 && dt(ht);
243
+ } else
244
+ h([...me]);
245
+ }
246
+ } catch (a) {
247
+ s(
248
+ K({
249
+ type: "danger",
250
+ message: a.response?.data?.title || a.message
251
+ })
252
+ );
253
+ }
254
+ s(E(!1));
255
+ }, [o, g, S]), Wt = ne(
256
+ async (a) => {
257
+ s(E(!0));
258
+ try {
259
+ const b = (await hs(parseInt(o || "0"), { ...S, questionId: a, grade: S.grade?.includes("All") ? [] : S.grade })).data, X = [b.totalSent, b.numberOfResponses], se = X.reduce(
260
+ (O, j) => O + j,
261
+ 0
262
+ ), F = X.map(
263
+ (O) => parseFloat((O / se * 100).toFixed(1))
264
+ );
265
+ we(F), ue(b.studentQuestionResponses);
266
+ } catch (l) {
267
+ s(
268
+ K({
269
+ type: "danger",
270
+ message: l.response?.data?.title || l.message
271
+ })
272
+ );
273
+ }
274
+ s(E(!1));
275
+ },
276
+ [o, S]
277
+ ), Vt = ne(
278
+ async () => {
279
+ s(E(!0));
280
+ try {
281
+ const l = (await ps(parseInt(o || "0"), { ...S, grade: S.grade?.includes("All") ? [] : S.grade }))?.data || [];
282
+ B(
283
+ l.map((F, O) => `Q # ${O + 1}`) || []
284
+ ), Z(l);
285
+ const b = Array.from(new Set(l.map((F) => F.templateName))).sort((F, O) => F.localeCompare(O, void 0, { sensitivity: "base" }));
286
+ Ue(b);
287
+ const X = pe && b.includes(pe) ? pe : b[0] || "";
288
+ Te(X);
289
+ const se = l.filter((F) => F.templateName === X);
290
+ if (se.length) {
291
+ const F = se.slice(0, 1);
292
+ ge(F);
293
+ const O = l.findIndex((j) => j.questionText === F[0].questionText);
294
+ if (O !== -1) {
295
+ const j = new Array(l.length).fill(!1);
296
+ j[O] = !0, J(j);
297
+ }
298
+ } else
299
+ ge([]), J([]);
300
+ } catch (a) {
301
+ s(
302
+ K({
303
+ type: "danger",
304
+ message: a.response?.data?.title || a.message
305
+ })
306
+ );
307
+ }
308
+ s(E(!1));
309
+ },
310
+ [S]
311
+ ), zt = ne(async () => {
312
+ s(E(!0));
313
+ try {
314
+ const l = (await Ct(parseInt(o || "0"), { ...S, isQuestionDropDown: !0, grade: S.grade?.includes("All") ? [] : S.grade })).data ?? [];
315
+ he(l);
316
+ } catch (a) {
317
+ s(
318
+ K({
319
+ type: "danger",
320
+ message: a.response?.data?.title || a.message
321
+ })
322
+ );
323
+ }
324
+ s(E(!1));
325
+ }, [o, S]), Ut = ne(async () => {
326
+ s(E(!0));
327
+ try {
328
+ const l = (await Ct(parseInt(o || "0"), { ...S, isQuestionDropDown: !1, grade: S.grade?.includes("All") ? [] : S.grade })).data ?? [];
329
+ Ve(l);
330
+ } catch (a) {
331
+ s(
332
+ K({
333
+ type: "danger",
334
+ message: a.response?.data?.title || a.message
335
+ })
336
+ );
337
+ }
338
+ s(E(!1));
339
+ }, [o, S]), Pt = () => {
340
+ Fe(!_e);
341
+ }, Gt = () => {
342
+ Ee(!xe);
343
+ }, Zt = (a) => {
344
+ ae({
345
+ currentPage: 1,
346
+ studentId: a
347
+ });
348
+ }, Yt = (a) => {
349
+ ae({
350
+ currentPage: 1,
351
+ teacherId: a
352
+ });
353
+ }, Jt = Ne(() => S.teacherId ? m?.studentSurveyResults.filter((a) => a.teacherIds?.includes(S.teacherId)) || [] : m?.studentSurveyResults || [], [m?.studentSurveyResults, S.teacherId]), Xt = Ne(() => {
354
+ if (!S.studentId) return m?.teacherStudentSurveyResults || [];
355
+ const a = m?.studentSurveyResults.find((l) => l.id === S.studentId);
356
+ return a ? m?.teacherStudentSurveyResults.filter((l) => a.teacherIds?.includes(l.id)) || [] : m?.teacherStudentSurveyResults || [];
357
+ }, [m?.teacherStudentSurveyResults, m?.studentSurveyResults, S.studentId]);
358
+ return W(() => {
359
+ o && Mt();
360
+ }, [o]), W(() => {
361
+ o && (Ht(), Vt(), zt(), Ut());
362
+ }, [o, S]), W(() => {
363
+ I?.questionId && Wt(I.questionId);
364
+ }, [I, S]), W(() => {
365
+ g?.studentId && Bt();
366
+ }, [g]), W(() => {
367
+ if (V.length > 0) {
368
+ const a = V[0];
369
+ Re(a);
370
+ }
371
+ }, [V]), {
372
+ detailSurvey: m,
373
+ onHandleGoBack: At,
374
+ studentDetail: g,
375
+ handleToggleModelConduct: Et,
376
+ questionResponses: r,
377
+ avgQuestionRating: oe,
378
+ ratingQuestions: A,
379
+ selectQuestion: I,
380
+ totalByQuestion: Y,
381
+ openResponseModel: u,
382
+ setSelectQuestion: x,
383
+ handleToggleResponseModel: Ft,
384
+ generateAvrByQuestion: kt,
385
+ questionRatingConvert: T,
386
+ activeColumnQuestionRating: me,
387
+ handleActiveColumnQuestionRating: dt,
388
+ studentResponses: U,
389
+ distributionSeries: q,
390
+ distributionQuestions: f,
391
+ activeColumnDistribution: R,
392
+ handleActiveColumnDistribution: qt,
393
+ barChartQuestions: te,
394
+ response: z,
395
+ handelChangeOption: ct,
396
+ textInputQuestions: le,
397
+ setCategoryChose: Te,
398
+ categoryChose: pe,
399
+ categoryComparisonsOptions: ze,
400
+ handleStopSelect: Qt,
401
+ questionSelected: Pe,
402
+ setQuestionSelected: ge,
403
+ setActiveColumnQuestionRating: h,
404
+ handleClickCollapse: je,
405
+ openIndexField: Ce,
406
+ setOpenIndexField: ie,
407
+ questionsByCategoryField: Ze,
408
+ setQuestionsByCategoryField: Qe,
409
+ categoryFieldChose: $e,
410
+ setCategoryFieldChose: qe,
411
+ categoriesField: Ge,
412
+ setCategoriesField: Ae,
413
+ categoryRatingChose: He,
414
+ setCategoryRatingChose: Re,
415
+ questionRatingResponseSelected: Dt,
416
+ setQuestionRatingResponseSelected: lt,
417
+ categoriesOptions: V,
418
+ setCategoriesOptions: ye,
419
+ categoryRatingResponseChose: Q,
420
+ setCategoryRatingResponseChose: H,
421
+ questionRatingSelected: Oe,
422
+ setQuestionRatingSelected: ve,
423
+ categoryDropdownOptions: Lt,
424
+ categoryDropdownChose: It,
425
+ setCategoryDropdownChose: it,
426
+ filters: S,
427
+ handleChangeEndDate: ke,
428
+ handleChangeStartDate: Je,
429
+ handleChangeGrade: Me,
430
+ onChangeOptionDate: Be,
431
+ handleChangeInputSearch: Xe,
432
+ inputSearch: ce,
433
+ handleChangeStudent: Zt,
434
+ filteredStudents: Jt,
435
+ filteredTeachers: Xt,
436
+ isShowFilter: _e,
437
+ handleShowFilter: Pt,
438
+ isShowFilterCalendar: xe,
439
+ handleShowFilterCalendar: Gt,
440
+ handleChangeTeacher: Yt
441
+ };
442
+ }, Fs = ({
443
+ selectQuestion: s,
444
+ avgQuestionRating: i,
445
+ ratingQuestions: c,
446
+ totalByQuestion: o,
447
+ setSelectQuestion: g,
448
+ generateAvrByQuestion: _,
449
+ questionRatingConvert: u,
450
+ activeColumnQuestionRating: y,
451
+ onActiveColumnQuestionRating: m,
452
+ onToggleResponseModel: $,
453
+ isExternal: r,
454
+ categoryRatingChose: v,
455
+ setCategoryRatingChose: A,
456
+ questionRatingResponseSelected: w,
457
+ setQuestionRatingResponseSelected: T,
458
+ categoriesOptions: D,
459
+ categoryRatingResponseChose: I,
460
+ setCategoryRatingResponseChose: x,
461
+ questionRatingSelected: q,
462
+ setQuestionRatingSelected: Z
463
+ }) => {
464
+ const { t: f } = re(), { classFontSize: B } = Le(), Y = i.filter(
465
+ (h, R) => y[R] == !0
466
+ ) || [], we = u.filter((h, R) => y[R] == !0).map((h, R) => `Q${R + 1}`), oe = c.map((h) => h.text).filter(
467
+ (h, R) => y[R] == !0
468
+ ) || [], de = [
469
+ {
470
+ data: Y || [],
471
+ name: f("average")
472
+ }
473
+ ], U = (h) => h && (h.type === "Rating" || h.type === 10 || h.type === Ie.Rating), ue = c.some(U);
474
+ return c.length > 0 ? /* @__PURE__ */ n(d, { className: `${t["ratings-of-questions"]} ${t[B]}`, children: [
475
+ ue && /* @__PURE__ */ n(Kt, { children: [
476
+ /* @__PURE__ */ e(N, { className: `${t["title-chart"]}`, children: f("ratings_of_questions") }),
477
+ /* @__PURE__ */ n(d, { className: `${t["list-check-question"]}`, children: [
478
+ /* @__PURE__ */ e(
479
+ P,
480
+ {
481
+ disableCloseOnSelect: !0,
482
+ id: "combo-box-demo-1",
483
+ options: D || [],
484
+ className: `${t["dropdown-select-category"]}`,
485
+ value: v || null,
486
+ onChange: (h, R) => {
487
+ A(R || "");
488
+ },
489
+ getOptionLabel: (h) => h,
490
+ renderInput: (h) => /* @__PURE__ */ e(
491
+ G,
492
+ {
493
+ ...h,
494
+ label: f("select_category"),
495
+ variant: "outlined"
496
+ }
497
+ )
498
+ }
499
+ ),
500
+ /* @__PURE__ */ e(
501
+ P,
502
+ {
503
+ fullWidth: !0,
504
+ multiple: !0,
505
+ disableCloseOnSelect: !0,
506
+ id: "combo-box-demo",
507
+ options: c.filter((h) => h.templateName === v && U(h)) || [],
508
+ getOptionLabel: (h) => h.text && ee(h.text),
509
+ value: q,
510
+ getOptionDisabled: () => q.length >= 4,
511
+ onChange: (h, R) => {
512
+ if (R.length > 4) return;
513
+ const J = q.map((z) => z.text), te = R.map((z) => z.text), he = R.length > q.length ? R.find((z) => !J.includes(z.text)) : q.find((z) => !te.includes(z.text));
514
+ if (he) {
515
+ const z = c.findIndex((Se) => Se.text === he.text);
516
+ m(z);
517
+ }
518
+ Z(R);
519
+ },
520
+ renderTags: (h, R) => h.map((J, te) => /* @__PURE__ */ e(
521
+ Nt,
522
+ {
523
+ label: J.text ? ee(J.text) : "",
524
+ style: { background: "#316CD914", padding: "7px 12px" },
525
+ ...R({ index: te }),
526
+ deleteIcon: /* @__PURE__ */ e(_t, {})
527
+ }
528
+ )),
529
+ renderInput: (h) => /* @__PURE__ */ e(
530
+ G,
531
+ {
532
+ ...h,
533
+ label: f("select_ratings_of_questions"),
534
+ variant: "outlined"
535
+ }
536
+ )
537
+ }
538
+ )
539
+ ] }),
540
+ /* @__PURE__ */ e(
541
+ ys,
542
+ {
543
+ months: we,
544
+ activeColumn: [!0],
545
+ series: de || [],
546
+ dayOfWeek: oe,
547
+ colors: st
548
+ }
549
+ )
550
+ ] }),
551
+ /* @__PURE__ */ n(d, { className: `${t["show-result"]}`, children: [
552
+ /* @__PURE__ */ e(N, { className: `${t.title}`, children: f("responses_and_response_rates_per_question") }),
553
+ /* @__PURE__ */ e(
554
+ P,
555
+ {
556
+ disableCloseOnSelect: !0,
557
+ id: "combo-box-demo",
558
+ options: D || [],
559
+ className: `${t["dropdown-select-category"]}`,
560
+ value: I || null,
561
+ onChange: (h, R) => {
562
+ x(R || "");
563
+ },
564
+ getOptionLabel: (h) => h,
565
+ renderInput: (h) => /* @__PURE__ */ e(
566
+ G,
567
+ {
568
+ ...h,
569
+ label: f("select_category"),
570
+ variant: "outlined"
571
+ }
572
+ )
573
+ }
574
+ ),
575
+ /* @__PURE__ */ e(
576
+ P,
577
+ {
578
+ fullWidth: !0,
579
+ disableClearable: !0,
580
+ id: "combo-box-demo",
581
+ options: c.filter((h) => h.templateName === I) || [],
582
+ getOptionLabel: (h) => h.text,
583
+ value: w,
584
+ onChange: (h, R) => {
585
+ g(R), T(R);
586
+ },
587
+ renderInput: (h) => /* @__PURE__ */ e(
588
+ G,
589
+ {
590
+ ...h,
591
+ label: f("select_question"),
592
+ variant: "outlined"
593
+ }
594
+ )
595
+ }
596
+ ),
597
+ /* @__PURE__ */ n(d, { className: `${t["chart-result-for-question"]}`, children: [
598
+ U(w || s) ? /* @__PURE__ */ n(d, { className: `${t.parameter}`, children: [
599
+ /* @__PURE__ */ e(N, { className: `${t.percent}`, children: `${_() || 0}%` }),
600
+ /* @__PURE__ */ n(N, { className: `${t.description}`, children: [
601
+ "Avr. ",
602
+ f("question_rating").toLowerCase()
603
+ ] })
604
+ ] }) : /* @__PURE__ */ e(d, { className: `${t.parameter}` }),
605
+ /* @__PURE__ */ n(d, { className: `${t.chart}`, children: [
606
+ /* @__PURE__ */ e(
607
+ bs,
608
+ {
609
+ series: o ? [...o] : [],
610
+ colors: ["#D9EEE4", "#0F9655"],
611
+ textColors: ["#242424", "#FFFFFF"],
612
+ label: [
613
+ f("number_of_not_responses"),
614
+ f("number_of_responses")
615
+ ]
616
+ }
617
+ ),
618
+ /* @__PURE__ */ n(d, { className: `${t.legend}`, children: [
619
+ /* @__PURE__ */ n(d, { className: `${t["legend-item"]}`, children: [
620
+ /* @__PURE__ */ e(
621
+ d,
622
+ {
623
+ className: `${t["dot-not-response"]}`
624
+ }
625
+ ),
626
+ /* @__PURE__ */ e(N, { className: `${t.name}`, children: f("number_of_not_responses") })
627
+ ] }),
628
+ /* @__PURE__ */ n(N, { className: `${t.avr}`, children: [
629
+ "AVR. ",
630
+ o[0] || 0,
631
+ "%"
632
+ ] }),
633
+ /* @__PURE__ */ n(d, { className: `${t["legend-item"]}`, children: [
634
+ /* @__PURE__ */ e(d, { className: `${t["dot-response"]}` }),
635
+ /* @__PURE__ */ e(N, { className: `${t.name}`, children: f("number_of_responses") })
636
+ ] }),
637
+ /* @__PURE__ */ n(N, { className: `${t.avr}`, children: [
638
+ "AVR. ",
639
+ o[1] || 0,
640
+ "%"
641
+ ] }),
642
+ /* @__PURE__ */ n(
643
+ d,
644
+ {
645
+ onClick: () => $(),
646
+ className: `${t.action}`,
647
+ children: [
648
+ /* @__PURE__ */ e(N, { className: `${t.content}`, children: f(r ? "view_list_of_responses" : "view_list_of_students") }),
649
+ /* @__PURE__ */ e(
650
+ xs,
651
+ {
652
+ className: `${t.icon}`
653
+ }
654
+ )
655
+ ]
656
+ }
657
+ )
658
+ ] })
659
+ ] })
660
+ ] })
661
+ ] })
662
+ ] }) : null;
663
+ }, Es = ({ data: s, isPlp: i, print: c, disableSeriesName: o, colors: g, indexActive: _, isStudentResponses: u }) => {
664
+ const y = St(), { t: m } = re(), $ = wt(null), [r, v] = C(1e3);
665
+ W(() => {
666
+ const x = () => {
667
+ $.current && v($.current.offsetWidth);
668
+ };
669
+ return x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
670
+ }, []);
671
+ const w = rt((x) => x?.common?.user).roles.includes("Student"), T = (x) => {
672
+ i && y(`/student-detail/overview/${x}`);
673
+ }, D = Ns(s), I = s.map((x) => ee(x.questionText)) || [];
674
+ return /* @__PURE__ */ n("div", { className: `${M["size-100"]}`, children: [
675
+ !c && /* @__PURE__ */ n("div", { className: `${M["header-chart-container"]}`, children: [
676
+ /* @__PURE__ */ e(N, { className: `${M["title-chart"]}`, children: m("student_distribution") }),
677
+ /* @__PURE__ */ e(N, { className: `${M["header-chart-description"]}`, children: m("this_is_the_student_score_from_their_last_check_in") })
678
+ ] }),
679
+ /* @__PURE__ */ n("div", { className: `${M["bubble-chart-custom"]}`, children: [
680
+ /* @__PURE__ */ n("div", { className: M["chart-custom"], children: [
681
+ /* @__PURE__ */ e("div", { className: `${M["list-percent"]} ${o && M["percent-survey"]}`, children: ws.map((x, q) => /* @__PURE__ */ n(
682
+ "div",
683
+ {
684
+ className: `${M["percent-item"]}`,
685
+ children: [
686
+ x,
687
+ "%"
688
+ ]
689
+ },
690
+ q
691
+ )) }),
692
+ /* @__PURE__ */ e("div", { className: M["legend-wrap"], children: !o && D.map((x, q) => /* @__PURE__ */ n(
693
+ "div",
694
+ {
695
+ className: `${M.item}`,
696
+ children: [
697
+ /* @__PURE__ */ e(
698
+ "div",
699
+ {
700
+ className: `${M["mark-custom"]}`,
701
+ style: {
702
+ backgroundColor: Ss[q]
703
+ }
704
+ }
705
+ ),
706
+ /* @__PURE__ */ e(
707
+ "label",
708
+ {
709
+ className: `${M["label-legend-custom"]}`,
710
+ children: m(x.toLocaleLowerCase())
711
+ }
712
+ )
713
+ ]
714
+ },
715
+ q
716
+ )) }),
717
+ /* @__PURE__ */ e("div", { className: M["chart-buddle"], children: /* @__PURE__ */ e("div", { ref: $, id: "chart_survey_bubble_custom", children: /* @__PURE__ */ e(
718
+ xt,
719
+ {
720
+ options: _s(
721
+ D,
722
+ s,
723
+ T,
724
+ w,
725
+ g,
726
+ u
727
+ ),
728
+ type: "scatter",
729
+ series: $s(s, r, u),
730
+ width: "100%",
731
+ height: 250
732
+ }
733
+ ) }) })
734
+ ] }),
735
+ /* @__PURE__ */ e("div", { className: `${M["question-legend-custom"]}`, children: _ && I.map((x, q) => /* @__PURE__ */ e("p", { className: `${M.question}`, children: `${q + 1}. ${x}` })) })
736
+ ] })
737
+ ] });
738
+ };
739
+ function ks(s, i) {
740
+ return JSON.stringify(s) === JSON.stringify(i);
741
+ }
742
+ const Ms = ds(Es, ks), Bs = ({
743
+ open: s,
744
+ onClose: i,
745
+ student: c,
746
+ surveyName: o,
747
+ questionResponses: g
748
+ }) => {
749
+ const { classFontSize: _ } = Le();
750
+ return /* @__PURE__ */ n(Rt, { open: s, onClose: i, scroll: "body", maxWidth: "md", contentClassName: t[_], children: [
751
+ /* @__PURE__ */ n(d, { className: `${t["header-conduct"]}`, children: [
752
+ /* @__PURE__ */ e(
753
+ "img",
754
+ {
755
+ src: at(c?.avatar || "") || $t,
756
+ alt: c?.studentName,
757
+ className: `${t.avatar_user}`
758
+ }
759
+ ),
760
+ /* @__PURE__ */ n(d, { className: `${t["student-detail"]}`, children: [
761
+ /* @__PURE__ */ e(N, { className: `${t["student-name"]}`, children: c?.studentName }),
762
+ /* @__PURE__ */ e(N, { className: `${t["survey-name"]}`, children: o })
763
+ ] })
764
+ ] }),
765
+ /* @__PURE__ */ e(ns, { className: `${t["conduct-body"]}`, children: /* @__PURE__ */ n(
766
+ rs,
767
+ {
768
+ stickyHeader: !0,
769
+ "aria-label": "simple table",
770
+ className: `${t["table-border"]}`,
771
+ children: [
772
+ /* @__PURE__ */ e(os, { children: /* @__PURE__ */ e(
773
+ Rs,
774
+ {
775
+ listTableCell: Os,
776
+ filters: { currentPage: 1, pageSize: 10 }
777
+ }
778
+ ) }),
779
+ /* @__PURE__ */ e(ls, { children: g.map((u) => /* @__PURE__ */ n(
780
+ is,
781
+ {
782
+ className: `${t["table-row"]}`,
783
+ children: [
784
+ /* @__PURE__ */ e(
785
+ We,
786
+ {
787
+ align: "left",
788
+ className: `${t.row_name}`,
789
+ children: ee(u.question)
790
+ }
791
+ ),
792
+ /* @__PURE__ */ e(
793
+ We,
794
+ {
795
+ align: "center",
796
+ className: `${t.row_name}`,
797
+ children: u.category
798
+ }
799
+ ),
800
+ /* @__PURE__ */ e(
801
+ We,
802
+ {
803
+ align: "center",
804
+ className: `${t.row_name}`,
805
+ children: Ot(u.date)
806
+ }
807
+ ),
808
+ /* @__PURE__ */ e(
809
+ We,
810
+ {
811
+ align: "left",
812
+ className: `${t.row_name}`,
813
+ children: u.answer != "0" && (u.type == "Rating" && u.answer ? `${u.answer}%` : u.answer)
814
+ }
815
+ )
816
+ ]
817
+ },
818
+ u.questionId
819
+ )) })
820
+ ]
821
+ }
822
+ ) })
823
+ ] });
824
+ }, Hs = ({
825
+ open: s,
826
+ onClose: i,
827
+ questionName: c,
828
+ totalSent: o,
829
+ totalByQuestion: g,
830
+ questionRating: _,
831
+ studentResponses: u,
832
+ isHiddenContact: y
833
+ }) => {
834
+ const { t: m } = re(), { classFontSize: $ } = Le();
835
+ return /* @__PURE__ */ e(
836
+ Rt,
837
+ {
838
+ open: s,
839
+ onClose: i,
840
+ scroll: "body",
841
+ maxWidth: "md",
842
+ contentClassName: t[$],
843
+ children: /* @__PURE__ */ n(d, { className: `${t["response-question"]}`, children: [
844
+ /* @__PURE__ */ e(N, { className: `${t["title-model"]}`, children: m("question") }),
845
+ /* @__PURE__ */ e(
846
+ d,
847
+ {
848
+ className: `${t.question}`,
849
+ dangerouslySetInnerHTML: {
850
+ __html: c
851
+ }
852
+ }
853
+ ),
854
+ /* @__PURE__ */ n(d, { className: `${t["total-cards"]}`, children: [
855
+ /* @__PURE__ */ n(d, { className: `${t.card}`, children: [
856
+ /* @__PURE__ */ e(N, { className: `${t.title}`, children: m("number_of_not_responses") }),
857
+ /* @__PURE__ */ e(
858
+ N,
859
+ {
860
+ className: `${t.avr}`,
861
+ children: `AVR. ${o}%`
862
+ }
863
+ )
864
+ ] }),
865
+ /* @__PURE__ */ n(d, { className: `${t.card}`, children: [
866
+ /* @__PURE__ */ e(N, { className: `${t.title}`, children: m("number_of_responses") }),
867
+ /* @__PURE__ */ e(
868
+ N,
869
+ {
870
+ className: `${t.avr}`,
871
+ children: `AVR. ${g}%`
872
+ }
873
+ )
874
+ ] }),
875
+ /* @__PURE__ */ n(d, { className: `${t.card}`, children: [
876
+ /* @__PURE__ */ e(N, { className: `${t.title}`, children: m("question_rating") }),
877
+ /* @__PURE__ */ e(
878
+ N,
879
+ {
880
+ className: `${t.avr}`,
881
+ children: `AVR. ${_}%`
882
+ }
883
+ )
884
+ ] })
885
+ ] }),
886
+ /* @__PURE__ */ e(d, { className: `${t["response-body"]}`, children: u.map((r) => /* @__PURE__ */ n(d, { className: `${t.student} ${t[y ? "middle" : ""]}`, children: [
887
+ /* @__PURE__ */ n(
888
+ d,
889
+ {
890
+ hidden: !!y,
891
+ className: `${t["student-detail"]}`,
892
+ children: [
893
+ /* @__PURE__ */ e(
894
+ "img",
895
+ {
896
+ src: at(r.studentAvatar || "") || $t,
897
+ alt: r.studentName,
898
+ className: `${t.avatar_user}`
899
+ }
900
+ ),
901
+ /* @__PURE__ */ n(d, { children: [
902
+ /* @__PURE__ */ e(
903
+ N,
904
+ {
905
+ className: `${t["student-name"]}`,
906
+ children: r.studentName
907
+ }
908
+ ),
909
+ /* @__PURE__ */ e(N, { className: `${t.date}`, children: Ot(r.date) })
910
+ ] })
911
+ ]
912
+ }
913
+ ),
914
+ /* @__PURE__ */ e(
915
+ N,
916
+ {
917
+ hidden: !r.answer,
918
+ className: `${t.answer}`,
919
+ children: r.type == Ie.DropDown ? `${r.answer}` : `${r.answer}%`
920
+ }
921
+ ),
922
+ /* @__PURE__ */ e(
923
+ N,
924
+ {
925
+ hidden: !!r.answer,
926
+ className: `${t["none-answer"]}`,
927
+ children: m("no_response_yet")
928
+ }
929
+ )
930
+ ] }, r.id)) })
931
+ ] })
932
+ }
933
+ );
934
+ };
935
+ function Ws({ categoryChose: s, setCategoryChose: i, categories: c, questionsByCategory: o }) {
936
+ const { classFontSize: g } = Le(), { t: _ } = re();
937
+ return /* @__PURE__ */ n(d, { className: `${t["dropdown-chart-question"]}`, children: [
938
+ /* @__PURE__ */ e(d, { className: `${t["dropdown-chart-header"]} ${p["student-survey-questions-categories"]}`, children: /* @__PURE__ */ e(
939
+ P,
940
+ {
941
+ disableClearable: !0,
942
+ id: "combo-box-demo",
943
+ options: c ?? [],
944
+ className: `${t["dropdown-select-category-text-field"]}`,
945
+ onChange: (u, y) => {
946
+ i(y || "");
947
+ },
948
+ value: s,
949
+ getOptionLabel: (u) => u,
950
+ renderInput: (u) => /* @__PURE__ */ e(
951
+ G,
952
+ {
953
+ ...u,
954
+ label: _("select_category"),
955
+ variant: "outlined"
956
+ }
957
+ )
958
+ }
959
+ ) }),
960
+ /* @__PURE__ */ e(d, { className: `${p[g]} ${p["all-student-survey"]}`, children: o.map((u, y) => /* @__PURE__ */ n("div", { className: p["question-student-survey"], children: [
961
+ /* @__PURE__ */ n("div", { className: p["question-student-survey-number"], children: [
962
+ y + 1,
963
+ "."
964
+ ] }),
965
+ /* @__PURE__ */ e("div", { className: p["question-student-survey-content"], children: ee(u.text) })
966
+ ] }, u.id)) })
967
+ ] });
968
+ }
969
+ ft.Male, ft.Female;
970
+ et.Tier1, et.Tier2, et.Tier3;
971
+ const yt = () => {
972
+ const s = k().utc().quarter() - 1, i = s ? k().utc().quarter(s).startOf("quarter").valueOf() : k().add(-1, "years").utc().quarter(4).startOf("quarter").valueOf(), c = s ? k().utc().quarter(s).endOf("quarter").valueOf() : k().add(-1, "years").utc().quarter(4).endOf("quarter").valueOf();
973
+ return { start: i, end: c };
974
+ };
975
+ De.THIS_YEAR, k().utc().startOf("year").valueOf(), k().utc().endOf("day").valueOf(), De.LAST_YEAR, k().utc().add(-1, "years").startOf("year").valueOf(), k().utc().add(-1, "years").endOf("year").valueOf(), De.LAST_QUARTER, yt().start, yt().end, De.LAST_MONTH, k().utc().add(-30, "days").startOf("day").valueOf(), k().utc().endOf("day").valueOf(), De.LAST_DAY, k().utc().add(-1, "days").startOf("day").valueOf(), k().utc().add(-1, "days").endOf("day").valueOf();
976
+ const Vs = (s, i, c, o) => ({
977
+ legend: {
978
+ show: !1,
979
+ fontFamily: "Poppins-Regular !important"
980
+ },
981
+ chart: {
982
+ type: "bar",
983
+ toolbar: {
984
+ show: !1
985
+ }
986
+ },
987
+ noData: {
988
+ text: "No data",
989
+ align: "center",
990
+ verticalAlign: "middle"
991
+ },
992
+ grid: {
993
+ show: !0,
994
+ strokeDashArray: 5,
995
+ borderColor: "#D3D3D3"
996
+ },
997
+ plotOptions: {
998
+ bar: {
999
+ horizontal: !0,
1000
+ distributed: !0,
1001
+ borderRadius: 5,
1002
+ dataLabels: {
1003
+ position: "top"
1004
+ }
1005
+ }
1006
+ },
1007
+ stroke: {
1008
+ show: !1,
1009
+ width: 1,
1010
+ colors: ["#fff"]
1011
+ },
1012
+ colors: ["#316CD9", "#5a89e1", "#83a7e8", "#adc4f0", "#eaf0fb"],
1013
+ xaxis: {
1014
+ labels: {
1015
+ show: !1
1016
+ },
1017
+ axisTicks: {
1018
+ show: !1
1019
+ }
1020
+ },
1021
+ labels: s,
1022
+ tooltip: {
1023
+ x: {
1024
+ formatter: function(g) {
1025
+ return g.toString();
1026
+ }
1027
+ },
1028
+ y: {
1029
+ formatter: function(g, { seriesIndex: _, dataPointIndex: u }) {
1030
+ return (_ ? i[u] : g).toString();
1031
+ }
1032
+ }
1033
+ },
1034
+ yaxis: {
1035
+ min: 0,
1036
+ max: Math.max(...i) + 1,
1037
+ labels: {
1038
+ show: !0,
1039
+ align: "left",
1040
+ minWidth: c ? 400 : 0,
1041
+ maxWidth: o && !c ? 500 : 400,
1042
+ style: {
1043
+ fontSize: c ? "12px" : "14px",
1044
+ fontFamily: "Poppins-Regular !important",
1045
+ fontWeight: c ? 600 : 400,
1046
+ cssClass: "apexcharts-yaxis-label"
1047
+ },
1048
+ offsetX: c ? 280 : -5,
1049
+ offsetY: c ? -10 : 0,
1050
+ rotate: 0
1051
+ }
1052
+ },
1053
+ dataLabels: {
1054
+ enabled: !0,
1055
+ offsetX: 30,
1056
+ formatter: function(g) {
1057
+ return g ? `${g}` : "";
1058
+ },
1059
+ style: {
1060
+ colors: ["#242424"]
1061
+ }
1062
+ }
1063
+ }), tt = (s) => {
1064
+ var i = document.createElement("span");
1065
+ i.style.visibility = "hidden", i.style.position = "absolute", i.style.whiteSpace = "nowrap", i.innerHTML = s, document.body.appendChild(i);
1066
+ var c = i.offsetWidth;
1067
+ return document.body.removeChild(i), c;
1068
+ }, zs = (s, i) => {
1069
+ for (var c = s.split(" "), o = "", g = 0, _ = [], u = 0; u < c.length; u++) {
1070
+ var y = c[u], m = tt(y);
1071
+ g + m <= i ? (o += y + " ", g += m + tt(" ")) : (_.push(o.trim()), o = y + " ", g = m + tt(" "));
1072
+ }
1073
+ return _.push(o.trim()), _;
1074
+ }, Us = ({
1075
+ response: s,
1076
+ isFullScreen: i,
1077
+ onChangeOption: c,
1078
+ questionAnswers: o,
1079
+ categoryDropdownOptions: g,
1080
+ categoryDropdownChose: _,
1081
+ setCategoryDropdownChose: u
1082
+ }) => {
1083
+ const { t: y } = re(), $ = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) < 576, r = Ne(() => s?.answers.map((w) => w.name) || [], [s]), v = Ne(() => s?.answers.map((w) => w.numberAnswer) || [], [s]), A = Ne(() => r.map((w) => zs(w, i && !$ ? 250 : 150)), [r, i, $]);
1084
+ return /* @__PURE__ */ n(d, { className: `${t["dropdown-chart-question"]}`, children: [
1085
+ /* @__PURE__ */ e(N, { className: `${t["header-bar-description"]}`, children: y("you_can_only_select_1_question_at_a_time") }),
1086
+ /* @__PURE__ */ n(d, { className: `${t["dropdown-chart-header"]}`, children: [
1087
+ /* @__PURE__ */ e(
1088
+ P,
1089
+ {
1090
+ clearIcon: !1,
1091
+ id: "combo-box-demo",
1092
+ options: g || [],
1093
+ className: `${t["dropdown-select-category"]}`,
1094
+ value: _ || null,
1095
+ getOptionLabel: (w) => w,
1096
+ onChange: (w, T) => {
1097
+ c(null), u(T || "");
1098
+ },
1099
+ renderInput: (w) => /* @__PURE__ */ e(
1100
+ G,
1101
+ {
1102
+ ...w,
1103
+ label: y("select_category"),
1104
+ variant: "outlined"
1105
+ }
1106
+ )
1107
+ }
1108
+ ),
1109
+ /* @__PURE__ */ e(
1110
+ P,
1111
+ {
1112
+ fullWidth: !0,
1113
+ clearIcon: !1,
1114
+ id: "combo-box-demo",
1115
+ options: o.filter((w) => w.templateName === _) || [],
1116
+ getOptionLabel: (w) => {
1117
+ const T = document.createElement("div");
1118
+ return T.innerHTML = w.name, T.textContent || T.innerText || "";
1119
+ },
1120
+ value: s ?? null,
1121
+ onChange: (w, T) => c(T),
1122
+ renderOption: (w, T) => /* @__PURE__ */ e("li", { ...w, children: /* @__PURE__ */ e(
1123
+ "div",
1124
+ {
1125
+ dangerouslySetInnerHTML: {
1126
+ __html: T.name
1127
+ }
1128
+ }
1129
+ ) }),
1130
+ renderInput: (w) => /* @__PURE__ */ e(
1131
+ G,
1132
+ {
1133
+ ...w,
1134
+ label: y("select_question"),
1135
+ variant: "outlined"
1136
+ }
1137
+ )
1138
+ }
1139
+ )
1140
+ ] }),
1141
+ /* @__PURE__ */ e(
1142
+ xt,
1143
+ {
1144
+ options: Vs(
1145
+ $ ? r : A,
1146
+ v,
1147
+ $,
1148
+ i
1149
+ ),
1150
+ series: [
1151
+ {
1152
+ name: "",
1153
+ data: v
1154
+ }
1155
+ ],
1156
+ type: "bar",
1157
+ width: "100%",
1158
+ height: 400
1159
+ }
1160
+ ),
1161
+ /* @__PURE__ */ e(N, { className: `${t["title-bar-chart"]}`, children: y("number_of_answers") })
1162
+ ] });
1163
+ }, Ps = Ls(/* @__PURE__ */ e("path", {
1164
+ d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"
1165
+ }), "ExpandLess"), Gs = as("/images/image-default.png"), Zs = ({
1166
+ handleClickCollapse: s,
1167
+ openIndexField: i,
1168
+ setOpenIndexField: c,
1169
+ questionsByCategoryField: o,
1170
+ categoryFieldChose: g,
1171
+ setCategoryFieldChose: _,
1172
+ categoriesField: u
1173
+ }) => {
1174
+ const { t: y } = re();
1175
+ return /* @__PURE__ */ n(d, { className: `${t["dropdown-chart-question"]}`, children: [
1176
+ /* @__PURE__ */ e(d, { className: `${t["dropdown-chart-header"]}`, children: /* @__PURE__ */ e(
1177
+ P,
1178
+ {
1179
+ disableClearable: !0,
1180
+ id: "combo-box-demo",
1181
+ options: u ?? [],
1182
+ className: `${t["dropdown-select-category-text-field"]}`,
1183
+ onChange: (m, $) => {
1184
+ _($ || ""), c([0]);
1185
+ },
1186
+ value: g,
1187
+ getOptionLabel: (m) => m,
1188
+ renderInput: (m) => /* @__PURE__ */ e(
1189
+ G,
1190
+ {
1191
+ ...m,
1192
+ label: y("select_category"),
1193
+ variant: "outlined"
1194
+ }
1195
+ )
1196
+ }
1197
+ ) }),
1198
+ /* @__PURE__ */ e("div", { className: p["free-field-list-container"], children: o.length ? o.map((m, $) => /* @__PURE__ */ n(
1199
+ pt,
1200
+ {
1201
+ component: "nav",
1202
+ "aria-labelledby": "nested-list-subheader",
1203
+ className: p["free-field-list"],
1204
+ children: [
1205
+ /* @__PURE__ */ n(gt, { className: p.question, children: [
1206
+ /* @__PURE__ */ n("div", { className: p["question-text"], children: [
1207
+ /* @__PURE__ */ n("div", { className: p["number-index"], children: [
1208
+ $ + 1,
1209
+ "."
1210
+ ] }),
1211
+ /* @__PURE__ */ e("div", { className: p.content, children: ee(m.name) })
1212
+ ] }),
1213
+ /* @__PURE__ */ e("button", { type: "button", className: p["bottom-collapse"], onClick: () => s($), children: i.includes($) ? /* @__PURE__ */ e(Ps, { fontSize: "large" }) : /* @__PURE__ */ e(Ts, { fontSize: "large" }) })
1214
+ ] }),
1215
+ /* @__PURE__ */ e(cs, { in: i.includes($), timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ e(pt, { component: "div", disablePadding: !0, children: /* @__PURE__ */ e(gt, { children: /* @__PURE__ */ e("div", { className: t["list-answer-text"], children: m?.studentAnswers && m?.studentAnswers.length > 0 && m?.studentAnswers.map((r) => /* @__PURE__ */ n("div", { className: t["item-input-answer"], children: [
1216
+ /* @__PURE__ */ n("div", { className: t["answer-head"], children: [
1217
+ /* @__PURE__ */ e("img", { src: `${r.profileImageFileName ? at(r.profileImageFileName) : Gs}`, alt: "", style: { width: "24px", height: "24px" } }),
1218
+ /* @__PURE__ */ e("h6", { style: { fontWeight: 600 }, children: r.studentName }),
1219
+ /* @__PURE__ */ n("p", { children: [
1220
+ " | ",
1221
+ ss(r.createdAt, "MMMM do, yyyy")
1222
+ ] })
1223
+ ] }),
1224
+ /* @__PURE__ */ e("div", { className: t["answer-body"], children: /* @__PURE__ */ e("p", { children: r.answer }) })
1225
+ ] }, r.createdAt)) }) }) }) })
1226
+ ]
1227
+ },
1228
+ $
1229
+ )) : /* @__PURE__ */ e(N, { className: `${t["header-bar-description"]}`, children: y("please_select_a_category_to_view_data") }) })
1230
+ ] });
1231
+ }, Ys = () => /* @__PURE__ */ e("svg", { width: "32", height: "28", viewBox: "0 0 32 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { opacity: "0.24", "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M21.4373 5.4475C21.4365 2.42826 19.0066 -0.00250573 15.9925 1.93851e-06C12.9809 0.00250961 10.5577 2.43997 10.5635 5.46087C10.5685 8.45587 13.0018 10.895 15.9917 10.9025C18.9891 10.91 21.4373 8.45754 21.4373 5.4475ZM15.6346 27.9596L14.0195 27.9593H14.0194H14.0194H14.0193C12.6729 27.959 11.3265 27.9586 9.98064 27.9604C9.39232 27.9613 8.84234 27.8476 8.37735 27.4597C7.87903 27.0443 7.57737 26.511 7.57154 25.8615C7.56804 25.5027 7.56335 25.1437 7.55865 24.7846C7.53985 23.3472 7.52103 21.9088 7.57904 20.4742C7.70154 17.4391 9.10067 15.1713 11.8373 13.7929C12.7797 13.3181 13.7947 13.0883 14.8413 13.0264C16.1738 12.947 17.5129 12.9244 18.8171 13.2446C21.7045 13.9551 24.1577 16.7587 24.3569 19.7353C24.4611 21.2949 24.4442 22.8632 24.4274 24.4306L24.4274 24.4309C24.422 24.9325 24.4167 25.434 24.4152 25.9351C24.4145 26.1945 24.3065 26.4613 24.2042 26.7143L24.1702 26.7985C23.9469 27.3553 23.5194 27.7189 22.9311 27.7765C21.867 27.881 20.797 27.9554 19.7279 27.9822C18.7749 28.0061 17.8211 28.0007 16.8673 27.9952L16.8663 27.9952H16.8663H16.8662C16.456 27.9929 16.0457 27.9905 15.6355 27.9905C15.6346 27.9805 15.6346 27.9705 15.6346 27.9596ZM31.9772 24.4445C31.9849 24.4305 31.9925 24.4164 31.9995 24.4022C31.9995 21.8528 31.9995 19.3033 32.0003 16.7538L31.9956 16.7402L31.9933 16.7338C31.9888 16.7214 31.9839 16.7089 31.9791 16.6965C31.9643 16.6584 31.9495 16.6204 31.9428 16.5808C31.6586 14.8781 30.3703 13.4696 28.6854 13.1445C27.5671 12.9288 26.4255 12.9589 25.3013 13.162C24.6697 13.2757 24.1147 13.5691 23.6514 13.9837C23.767 14.1295 23.8826 14.2714 23.9968 14.4115C24.2478 14.7197 24.4921 15.0196 24.7155 15.3345C25.8563 16.9427 26.2613 18.7834 26.3063 20.7126C26.3321 21.8265 26.3255 22.9416 26.3189 24.0567V24.0568V24.0568V24.0569V24.057L26.3189 24.0579C26.3159 24.5608 26.313 25.0637 26.313 25.5666V25.9035C26.3483 25.9105 26.38 25.9183 26.4092 25.9254C26.4639 25.9389 26.5101 25.9503 26.5563 25.9503C26.8932 25.9501 27.2302 25.9518 27.5672 25.9536H27.5672H27.5672H27.5673H27.5673C28.448 25.9581 29.3288 25.9627 30.2087 25.9319C31.067 25.9018 31.6736 25.3643 31.9345 24.5368C31.9447 24.5044 31.961 24.4744 31.9772 24.4445ZM0.0480542 16.5528C0.0322213 16.6198 0.0163884 16.6869 0 16.7538V24.464C0.00583317 24.4721 0.0125922 24.4799 0.0193513 24.4877C0.0328695 24.5033 0.0463876 24.5189 0.0524985 24.5367C0.36249 25.4788 0.970806 25.9419 1.94828 25.9511C2.89404 25.9604 3.83979 25.9586 4.78555 25.9569L5.25819 25.9561C5.35357 25.9561 5.44896 25.944 5.54329 25.9321L5.54334 25.9321C5.58744 25.9266 5.63131 25.921 5.67484 25.9168C5.67484 25.7147 5.67558 25.5165 5.67631 25.3209L5.67631 25.3207C5.67791 24.8939 5.67946 24.4796 5.67317 24.0653L5.66725 23.7042C5.64269 22.2373 5.61814 20.7716 5.81067 19.3116C6.0665 17.3723 6.82231 15.6671 8.16311 14.2335C8.20925 14.1844 8.25349 14.1327 8.30045 14.0777L8.30048 14.0777C8.32305 14.0513 8.34626 14.0241 8.3706 13.9962C7.89478 13.5882 7.38063 13.2597 6.78814 13.1929C5.88317 13.0909 4.96569 13.0349 4.05489 13.0533C2.22077 13.09 0.633316 14.379 0.147496 16.1519C0.111386 16.2845 0.07972 16.4187 0.0480542 16.5528ZM4.98756 4.01217C6.88834 4.00464 8.4308 5.53767 8.43663 7.44015C8.44247 9.34013 6.91251 10.8874 5.01256 10.9016C3.13095 10.9166 1.56933 9.36019 1.56349 7.46523C1.55766 5.56107 3.08678 4.01885 4.98756 4.01217ZM26.9874 10.9016C28.8707 10.9149 30.429 9.36186 30.4357 7.46439C30.4423 5.5594 28.914 4.01969 27.0116 4.01217C25.1125 4.00464 23.5683 5.53934 23.5625 7.44015C23.5567 9.33846 25.09 10.8882 26.9874 10.9016Z", fill: "#242424" }) }), Js = () => /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1232
+ /* @__PURE__ */ e("rect", { width: "16", height: "16", rx: "8", fill: "white" }),
1233
+ /* @__PURE__ */ e("circle", { cx: "8", cy: "8", r: "8", fill: "#0F9655" }),
1234
+ /* @__PURE__ */ e("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12.7762 4.8349C13.0514 5.07952 13.0762 5.5009 12.8316 5.77609L7.49827 11.7761C7.37629 11.9133 7.20311 11.9942 7.01958 11.9996C6.83605 12.0049 6.65843 11.9344 6.5286 11.8046L4.19526 9.47125C3.93491 9.2109 3.93491 8.78879 4.19526 8.52844C4.45561 8.26809 4.87772 8.26809 5.13807 8.52844L6.97146 10.3618L11.8351 4.89027C12.0797 4.61508 12.5011 4.59029 12.7762 4.8349Z", fill: "white" })
1235
+ ] }), Xs = ({ data: s }) => /* @__PURE__ */ e("div", { className: p["total-student-head"], children: s.map((i, c) => /* @__PURE__ */ n("div", { className: p["item-static"], children: [
1236
+ /* @__PURE__ */ n("div", { className: p["item-static-icon"], children: [
1237
+ /* @__PURE__ */ e(Ys, {}),
1238
+ c !== 0 && /* @__PURE__ */ e("div", { className: p["item-static-icon-sent"], children: /* @__PURE__ */ e(Js, {}) })
1239
+ ] }),
1240
+ /* @__PURE__ */ n("div", { className: p["item-static-content"], children: [
1241
+ /* @__PURE__ */ e("div", { className: p.title, children: c === 0 ? "Total Students" : "Students Responded" }),
1242
+ /* @__PURE__ */ e("div", { className: p.content, children: i })
1243
+ ] })
1244
+ ] }, `${i}_${c}`)) }), js = ({ color: s = "#169490" }) => /* @__PURE__ */ n("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
1245
+ /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.38838 11.0656L8.38823 9.83087C8.38823 8.70618 8.39031 7.58148 8.38721 6.45678C8.38615 5.97909 8.05998 5.65762 7.5727 5.65053C7.18312 5.64448 6.79354 5.64448 6.40397 5.65053C5.91623 5.65762 5.59057 5.9786 5.59001 6.45728C5.58742 8.70062 5.58742 10.9439 5.59001 13.1873C5.59057 13.67 5.92922 13.9945 6.42426 13.9986C6.69346 14.0009 6.96267 14.0002 7.23187 13.9996L7.47612 13.9991C8.07296 13.9986 8.38823 13.6923 8.38823 13.1104C8.38858 12.4287 8.38848 11.7472 8.38838 11.0656Z", fill: s }),
1246
+ /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.978 9.8324C12.978 9.50406 12.9781 9.17567 12.9783 8.84726C12.9786 8.06998 12.9789 7.29258 12.9774 6.51543C12.9764 5.95587 12.6606 5.65157 12.0835 5.64954L12.0033 5.64917H11.9991C11.6704 5.64774 11.3412 5.64631 11.0125 5.65004C10.5065 5.65611 10.1829 5.969 10.1824 6.45678C10.1808 8.70013 10.1808 10.9429 10.1824 13.1863C10.1829 13.6705 10.5158 13.9945 11.0119 13.9986C11.2498 14.0003 11.4879 13.9999 11.726 13.9995L11.8223 13.9993C11.8962 13.9992 11.9701 13.9991 12.044 13.9991C12.6689 13.9986 12.9774 13.6998 12.978 13.0928C12.9782 12.7575 12.9782 12.4223 12.9782 12.087L12.978 9.8324Z", fill: s }),
1247
+ /* @__PURE__ */ e("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.79597 11.1303C3.79607 11.7965 3.79618 12.4627 3.79587 13.1286C3.79536 13.6882 3.48005 13.9965 2.90659 13.9986L2.74436 13.999C2.44787 14.0001 2.15137 14.001 1.85523 13.9981C1.33372 13.993 1.00283 13.6766 1.00232 13.166C0.999226 10.9358 0.999226 8.70566 1.00232 6.47547C1.00283 5.96039 1.32646 5.65357 1.85574 5.64903C2.0172 5.64764 2.17872 5.647 2.34028 5.64693C2.53583 5.64685 2.73143 5.64764 2.92683 5.64903C3.48213 5.65206 3.79536 5.95686 3.79638 6.4947L3.79597 11.1303Z", fill: s }),
1248
+ /* @__PURE__ */ e("path", { d: "M11.3653 2.93783H11.5918C11.6032 2.95653 11.6146 2.97574 11.6256 2.99395C11.4713 3.13397 10.9998 3.51148 10.8502 3.65604C10.6362 3.86278 10.6185 4.08318 10.7931 4.25554C10.9682 4.42841 11.1957 4.41276 11.4076 4.20802C11.7764 3.85216 12.4572 3.25326 12.8229 2.89436C13.0571 2.66487 13.0587 2.46722 12.8275 2.24027C12.4618 1.88137 11.7857 1.31146 11.4169 0.955596C11.205 0.751379 10.9733 0.73267 10.7993 0.901C10.6222 1.07185 10.6388 1.29628 10.8502 1.5C10.9314 1.57841 11.0148 1.65456 11.0987 1.73028C11.1636 1.7888 11.5376 2.0596 11.6022 2.11844C11.5968 2.12577 11.5912 2.1331 11.5855 2.14043C11.5799 2.14776 11.5743 2.15509 11.5689 2.16243H1.5641C1.49242 2.16243 1.42024 2.15788 1.35008 2.16748C1.14489 2.19528 0.997382 2.36765 1.00413 2.56276C1.01093 2.75333 1.15479 2.90651 1.35683 2.92976C1.44048 2.93936 1.52565 2.93733 1.6098 2.93733C4.79085 2.93783 8.18429 2.93783 11.3653 2.93783Z", fill: s, stroke: s, strokeWidth: "0.5" })
1249
+ ] }), Ks = ({ avr: s, color: i }) => /* @__PURE__ */ n("div", { className: p["avr-comparison"], style: { background: `${i}15` }, children: [
1250
+ /* @__PURE__ */ e(js, { color: i }),
1251
+ /* @__PURE__ */ n("div", { className: p["avr-comparison-content"], children: [
1252
+ "Avr. ",
1253
+ s,
1254
+ "%"
1255
+ ] })
1256
+ ] }, i), ea = /\s*\(\d+\s*questions?\)/i, bt = (s) => s?.replace(ea, "").trim(), ta = (s, i) => `${s} (${i} question${i > 1 ? "s" : ""})`, sa = () => {
1257
+ const [s, i] = C([]), [c, o] = C([]), [g, _] = C(""), [u, y] = C([]), [m, $] = C([]), [r, v] = C([]), A = nt(), { id: w } = ot(), T = ne(async () => {
1258
+ A(E(!0));
1259
+ try {
1260
+ const D = await gs(parseInt(w || "0"));
1261
+ i(D.data);
1262
+ const I = D.data.filter(
1263
+ (f) => f.type === Ie.MultipleChoice || f.type === Ie.SingleChoice
1264
+ ), x = I.reduce((f, B) => {
1265
+ const Y = bt(B.templateName);
1266
+ return Y && (f[Y] = (f[Y] || 0) + 1), f;
1267
+ }, {}), q = I.map((f) => {
1268
+ const B = bt(f.templateName), Y = x[B] || 1;
1269
+ return {
1270
+ text: f.text,
1271
+ id: f.id,
1272
+ category: B ? ta(B, Y) : f.templateName
1273
+ };
1274
+ });
1275
+ v(
1276
+ Array.from(new Set(q.map((f) => f.category))).sort((f, B) => f.localeCompare(B, void 0, { sensitivity: "base" }))
1277
+ ), $(q);
1278
+ const Z = Array.from(new Set(D.data.map((f) => f.templateName))).sort((f, B) => f.localeCompare(B, void 0, { sensitivity: "base" }));
1279
+ Z.length && (o(Z.filter((f) => f !== null && f !== "" && f !== void 0)), _(Z?.[0] || ""));
1280
+ } catch (D) {
1281
+ A(
1282
+ K({
1283
+ type: "danger",
1284
+ message: D.response?.data?.title || D.message
1285
+ })
1286
+ );
1287
+ }
1288
+ A(E(!1));
1289
+ }, [w]);
1290
+ return W(() => {
1291
+ const D = s.filter((I) => I.templateName === g);
1292
+ y(D);
1293
+ }, [g, s]), W(() => {
1294
+ T();
1295
+ }, []), {
1296
+ categoryChose: g,
1297
+ setCategoryChose: _,
1298
+ categories: c,
1299
+ questionsByCategory: u,
1300
+ questionSurveyDropdown: m,
1301
+ categoryDistributionOptions: r
1302
+ };
1303
+ }, aa = (s) => {
1304
+ const [i, c] = C(0), o = nt(), { id: g } = ot(), _ = rt((v) => v.common?.user?.roles), [u, y] = C([]), [m, $] = C(""), r = async () => {
1305
+ o(E(!0));
1306
+ try {
1307
+ const v = await Cs(Number(g), i, s, _), A = v.data.length, w = (D, I) => {
1308
+ if (I <= 5) {
1309
+ const q = I > 1 ? Math.round(D * (vt.length - 1) / (I - 1)) : 2;
1310
+ return vt[q];
1311
+ }
1312
+ return `hsl(${Math.round(D / (I - 1) * 140)}, 70%, 50%)`;
1313
+ }, T = v.data.map((D, I) => ({
1314
+ label: D.label,
1315
+ value: Math.round(D.value * 10) / 10,
1316
+ count: D.count,
1317
+ color: w(I, A)
1318
+ }));
1319
+ y(T);
1320
+ } catch (v) {
1321
+ console.log(v);
1322
+ }
1323
+ o(E(!1));
1324
+ };
1325
+ return W(() => {
1326
+ i && r();
1327
+ }, [i, s]), {
1328
+ questionSelectedId: i,
1329
+ setQuestionSelectedId: c,
1330
+ distributionData: u,
1331
+ categoryChose: m,
1332
+ setCategoryChose: $
1333
+ };
1334
+ }, na = ({ questionSurveyDropdown: s, filters: i, categoryDistributionOptions: c }) => {
1335
+ const { t: o } = re(), {
1336
+ questionSelectedId: g,
1337
+ setQuestionSelectedId: _,
1338
+ distributionData: u,
1339
+ categoryChose: y,
1340
+ setCategoryChose: m
1341
+ } = aa(i), $ = Ne(() => s.filter((r) => r.category === y) || [], [s, y]);
1342
+ return W(() => {
1343
+ $.length > 0 && _($[0].id);
1344
+ }, [$]), W(() => {
1345
+ c?.[0] && !y && m(c[0]);
1346
+ }, [c]), /* @__PURE__ */ n("div", { className: p["responses-distribution-container"], children: [
1347
+ /* @__PURE__ */ e(N, { className: `${p.title}`, style: { textTransform: "capitalize" }, children: o("responses_distribution") }),
1348
+ /* @__PURE__ */ e(d, { container: !0, sx: { mb: 4, pl: 1 }, alignItems: "center", children: /* @__PURE__ */ n(d, { item: !0, xs: 12, sm: 12, lg: 12, spacing: 3, children: [
1349
+ /* @__PURE__ */ e(
1350
+ P,
1351
+ {
1352
+ clearIcon: !1,
1353
+ id: "combo-box-demo",
1354
+ options: c || [],
1355
+ className: `${p["dropdown-select-category"]}`,
1356
+ value: y || null,
1357
+ getOptionLabel: (r) => r,
1358
+ onChange: (r, v) => {
1359
+ v && m(v);
1360
+ },
1361
+ renderInput: (r) => /* @__PURE__ */ e(
1362
+ G,
1363
+ {
1364
+ ...r,
1365
+ label: o("select_category"),
1366
+ variant: "outlined"
1367
+ }
1368
+ )
1369
+ }
1370
+ ),
1371
+ /* @__PURE__ */ e(
1372
+ P,
1373
+ {
1374
+ clearIcon: !1,
1375
+ id: "select-question-autocomplete",
1376
+ options: $,
1377
+ className: p["dropdown-select-large"],
1378
+ onChange: (r, v) => {
1379
+ v && _(v.id);
1380
+ },
1381
+ value: $.find((r) => r.id === g) || null,
1382
+ isOptionEqualToValue: (r, v) => r.id === v.id,
1383
+ renderOption: (r, v) => /* @__PURE__ */ e("li", { ...r, children: ee(v.text) }),
1384
+ getOptionLabel: (r) => ee(r.text) || "",
1385
+ renderInput: (r) => /* @__PURE__ */ e(
1386
+ G,
1387
+ {
1388
+ ...r,
1389
+ label: o("select_question"),
1390
+ variant: "outlined"
1391
+ }
1392
+ )
1393
+ }
1394
+ )
1395
+ ] }) }),
1396
+ u.length > 0 && /* @__PURE__ */ n("div", { className: p["distribution-chart-wrapper"], children: [
1397
+ /* @__PURE__ */ n("div", { className: p["marker-labels"], children: [
1398
+ u.map((r, v) => {
1399
+ if (r.value > 0 && r.value < 8) {
1400
+ const A = u.slice(0, v).reduce((w, T) => w + T.value, 0) + r.value / 2;
1401
+ return /* @__PURE__ */ n("div", { style: { left: `${A}%` }, className: p["top-marker"], children: [
1402
+ /* @__PURE__ */ n("span", { className: p["marker-value"], children: [
1403
+ r.value,
1404
+ "%"
1405
+ ] }),
1406
+ /* @__PURE__ */ e("div", { className: p["marker-line"] })
1407
+ ] }, v);
1408
+ }
1409
+ return null;
1410
+ }),
1411
+ /* @__PURE__ */ n("div", { style: { left: "50%" }, className: p["top-marker"], children: [
1412
+ /* @__PURE__ */ e("span", { className: p["marker-value-bottom"], children: "50%" }),
1413
+ /* @__PURE__ */ e("div", { className: p["marker-line-dashed"] })
1414
+ ] })
1415
+ ] }),
1416
+ /* @__PURE__ */ e("div", { className: p["distribution-bar"], children: u.map((r, v) => r.value > 0 && /* @__PURE__ */ e(
1417
+ "div",
1418
+ {
1419
+ className: p["bar-segment"],
1420
+ style: {
1421
+ width: `${r.value}%`,
1422
+ backgroundColor: r.color
1423
+ },
1424
+ children: r.value >= 8 && /* @__PURE__ */ n("span", { className: p["segment-percentage"], children: [
1425
+ r.value,
1426
+ "%"
1427
+ ] })
1428
+ },
1429
+ v
1430
+ )) })
1431
+ ] }),
1432
+ /* @__PURE__ */ e(d, { container: !0, className: p["legend-container"], justifyContent: "center", spacing: 2, children: u.map((r, v) => /* @__PURE__ */ n(d, { item: !0, className: p["legend-item"], children: [
1433
+ /* @__PURE__ */ e(
1434
+ "div",
1435
+ {
1436
+ className: p["legend-color-box"],
1437
+ style: { backgroundColor: r.color }
1438
+ }
1439
+ ),
1440
+ /* @__PURE__ */ n(N, { className: p["legend-text"], children: [
1441
+ r.label,
1442
+ " (",
1443
+ r.count,
1444
+ ")"
1445
+ ] })
1446
+ ] }, v)) })
1447
+ ] });
1448
+ }, Da = () => {
1449
+ const { t: s } = re(), { classFontSize: i } = Le(), {
1450
+ onHandleGoBack: c,
1451
+ detailSurvey: o,
1452
+ studentDetail: g,
1453
+ handleToggleModelConduct: _,
1454
+ questionResponses: u,
1455
+ avgQuestionRating: y,
1456
+ selectQuestion: m,
1457
+ setSelectQuestion: $,
1458
+ generateAvrByQuestion: r,
1459
+ ratingQuestions: v,
1460
+ totalByQuestion: A,
1461
+ questionRatingConvert: w,
1462
+ activeColumnQuestionRating: T,
1463
+ handleActiveColumnQuestionRating: D,
1464
+ openResponseModel: I,
1465
+ handleToggleResponseModel: x,
1466
+ studentResponses: q,
1467
+ distributionSeries: Z,
1468
+ barChartQuestions: f,
1469
+ response: B,
1470
+ handelChangeOption: Y,
1471
+ setCategoryChose: we,
1472
+ categoryChose: oe,
1473
+ categoryComparisonsOptions: de,
1474
+ questionSelected: U,
1475
+ setQuestionSelected: ue,
1476
+ setActiveColumnQuestionRating: me,
1477
+ handleClickCollapse: h,
1478
+ openIndexField: R,
1479
+ setOpenIndexField: J,
1480
+ questionsByCategoryField: te,
1481
+ setQuestionsByCategoryField: he,
1482
+ categoryFieldChose: z,
1483
+ setCategoryFieldChose: Se,
1484
+ categoriesField: le,
1485
+ setCategoriesField: Ve,
1486
+ categoryRatingChose: pe,
1487
+ setCategoryRatingChose: Te,
1488
+ questionRatingResponseSelected: ze,
1489
+ setQuestionRatingResponseSelected: Ue,
1490
+ categoriesOptions: Pe,
1491
+ setCategoriesOptions: ge,
1492
+ categoryRatingResponseChose: Ge,
1493
+ setCategoryRatingResponseChose: Ae,
1494
+ questionRatingSelected: $e,
1495
+ setQuestionRatingSelected: qe,
1496
+ categoryDropdownOptions: Ze,
1497
+ categoryDropdownChose: Qe,
1498
+ setCategoryDropdownChose: Ce,
1499
+ filters: ie,
1500
+ handleChangeEndDate: _e,
1501
+ handleChangeStartDate: Fe,
1502
+ handleChangeGrade: xe,
1503
+ onChangeOptionDate: Ee,
1504
+ handleChangeInputSearch: ce,
1505
+ // inputSearch,
1506
+ handleChangeStudent: fe,
1507
+ isShowFilter: S,
1508
+ handleShowFilter: Ye,
1509
+ isShowFilterCalendar: ae,
1510
+ handleShowFilterCalendar: Je,
1511
+ handleChangeTeacher: ke,
1512
+ filteredTeachers: Me,
1513
+ filteredStudents: Be
1514
+ } = Qs(), {
1515
+ categoryChose: Xe,
1516
+ setCategoryChose: je,
1517
+ categories: He,
1518
+ questionsByCategory: Re,
1519
+ questionSurveyDropdown: Oe,
1520
+ categoryDistributionOptions: ve
1521
+ } = sa();
1522
+ return /* @__PURE__ */ n("div", { className: t["survey-detail-container"], children: [
1523
+ /* @__PURE__ */ n("div", { className: t["header-survey-detail-container"], children: [
1524
+ /* @__PURE__ */ n(d, { className: `${t["header-survey-detail"]}`, children: [
1525
+ /* @__PURE__ */ e(
1526
+ vs,
1527
+ {
1528
+ className: `${t["icon-back-page"]}`,
1529
+ onClick: () => c()
1530
+ }
1531
+ ),
1532
+ /* @__PURE__ */ e(N, { className: `${t["content-header"]}`, children: s("surveys") })
1533
+ ] }),
1534
+ /* @__PURE__ */ n(d, { container: !0, children: [
1535
+ /* @__PURE__ */ e(d, { xs: 5, sm: 5, children: /* @__PURE__ */ e(N, { className: `${t["survey-title"]}`, children: o?.title }) }),
1536
+ /* @__PURE__ */ e(d, { xs: 7, sm: 7, children: /* @__PURE__ */ e(Xs, { data: [o?.allCount ?? 0, o?.completedCount ?? 0] }) })
1537
+ ] })
1538
+ ] }),
1539
+ /* @__PURE__ */ e(d, { className: `${t["filter-desktop"]} ${t["header-survey-detail-container"]}`, children: /* @__PURE__ */ e(
1540
+ Ds,
1541
+ {
1542
+ handleChangeInputSearch: ce,
1543
+ filters: ie,
1544
+ handleChangeStartDate: Fe,
1545
+ handleChangeEndDate: _e,
1546
+ onChangeGrade: xe,
1547
+ onChangeOptionDate: Ee,
1548
+ isSelectMulti: !0,
1549
+ studentList: Be,
1550
+ onSelectStudent: fe,
1551
+ teacherList: Me,
1552
+ onSelectTeacher: ke
1553
+ }
1554
+ ) }),
1555
+ /* @__PURE__ */ e(d, { className: `${t["filter-mobile"]}`, children: /* @__PURE__ */ e(
1556
+ Is,
1557
+ {
1558
+ handleChangeInputSearch: ce,
1559
+ filters: ie,
1560
+ handleChangeStartDate: Fe,
1561
+ handleChangeEndDate: _e,
1562
+ onChangeGrade: xe,
1563
+ onChangeOptionDate: Ee,
1564
+ isSelectMulti: !0,
1565
+ isDetailSurvey: !0,
1566
+ studentList: Be,
1567
+ onSelectStudent: fe,
1568
+ isShowCalendar: ae,
1569
+ onShowFilterCalendar: Je,
1570
+ onShowFilter: Ye,
1571
+ isShowFilter: S,
1572
+ teacherList: Me,
1573
+ onSelectTeacher: ke
1574
+ }
1575
+ ) }),
1576
+ /* @__PURE__ */ n(d, { className: `${t["survey-detail"]} ${t[i]}`, children: [
1577
+ He?.length > 0 && /* @__PURE__ */ n(d, { className: `${t["responses-distribution"]} ${p["student-survey-questions"]}`, children: [
1578
+ /* @__PURE__ */ e(N, { className: `${t.title} ${p["student-survey-questions-title"]}`, style: { textTransform: "capitalize" }, children: s("questions") }),
1579
+ /* @__PURE__ */ e(
1580
+ Ws,
1581
+ {
1582
+ categoryChose: Xe,
1583
+ setCategoryChose: je,
1584
+ categories: He,
1585
+ questionsByCategory: Re
1586
+ }
1587
+ )
1588
+ ] }),
1589
+ ve?.length > 0 && /* @__PURE__ */ e(d, { className: `${t["responses-distribution"]}`, children: /* @__PURE__ */ e(
1590
+ na,
1591
+ {
1592
+ questionSurveyDropdown: Oe,
1593
+ filters: ie,
1594
+ categoryDistributionOptions: ve
1595
+ }
1596
+ ) }),
1597
+ de?.length > 0 && Z?.length > 0 && /* @__PURE__ */ n(d, { className: `${t["responses-distribution"]}`, children: [
1598
+ /* @__PURE__ */ e(N, { className: `${t.title}`, children: s("responses_comparisons") }),
1599
+ /* @__PURE__ */ e(N, { className: `${t.description}`, children: s("you_can_only_select_number_kpis_at_a_time", { number: 4 }) }),
1600
+ /* @__PURE__ */ n(d, { className: `${t["list-check-question"]}`, children: [
1601
+ /* @__PURE__ */ e(
1602
+ P,
1603
+ {
1604
+ disableCloseOnSelect: !0,
1605
+ id: "combo-box-demo",
1606
+ options: de,
1607
+ className: `${t["dropdown-select-category"]}`,
1608
+ onChange: (Q, H) => {
1609
+ if (H) {
1610
+ we(H);
1611
+ const V = Z.filter((ye) => ye.templateName === H);
1612
+ ue(V.slice(0, 1));
1613
+ }
1614
+ },
1615
+ value: oe || "",
1616
+ getOptionLabel: (Q) => Q,
1617
+ renderInput: (Q) => /* @__PURE__ */ e(
1618
+ G,
1619
+ {
1620
+ ...Q,
1621
+ label: s("select_category"),
1622
+ variant: "outlined"
1623
+ }
1624
+ )
1625
+ }
1626
+ ),
1627
+ /* @__PURE__ */ e(
1628
+ P,
1629
+ {
1630
+ fullWidth: !0,
1631
+ multiple: !0,
1632
+ disableCloseOnSelect: !0,
1633
+ id: "combo-box-demo",
1634
+ options: Z.filter((Q) => Q.templateName === oe) || [],
1635
+ getOptionLabel: (Q) => Q.questionText && ee(Q.questionText),
1636
+ getOptionDisabled: () => U.length >= 4,
1637
+ value: U,
1638
+ onChange: (Q, H) => {
1639
+ H.length > 4 || ue(H);
1640
+ },
1641
+ renderTags: (Q, H) => Q.map((V, ye) => /* @__PURE__ */ e(
1642
+ Nt,
1643
+ {
1644
+ label: V.questionText ? ee(V.questionText) : "",
1645
+ style: { background: "#316CD914", padding: "7px 12px" },
1646
+ ...H({ index: ye }),
1647
+ deleteIcon: /* @__PURE__ */ e(_t, {})
1648
+ }
1649
+ )),
1650
+ renderInput: (Q) => /* @__PURE__ */ e(
1651
+ G,
1652
+ {
1653
+ ...Q,
1654
+ label: s("select_responses_distribution"),
1655
+ variant: "outlined"
1656
+ }
1657
+ )
1658
+ }
1659
+ )
1660
+ ] }),
1661
+ /* @__PURE__ */ e("div", { className: p["avr-comparison-container"], children: /* @__PURE__ */ e("div", { className: p["avr-comparison-list"], children: st.slice(0, U.length).map((Q, H) => {
1662
+ const V = U[H]?.avr;
1663
+ return /* @__PURE__ */ e(Ks, { color: Q, avr: V }, Q);
1664
+ }) }) }),
1665
+ /* @__PURE__ */ e(
1666
+ Ms,
1667
+ {
1668
+ print: !0,
1669
+ disableSeriesName: !0,
1670
+ colors: st,
1671
+ isStudentResponses: !1,
1672
+ data: U,
1673
+ indexActive: U.map((Q, H) => H + 1)
1674
+ }
1675
+ )
1676
+ ] }),
1677
+ f?.length > 0 && /* @__PURE__ */ n(d, { className: `${t["responses-distribution"]}`, children: [
1678
+ /* @__PURE__ */ e(N, { className: `${t.title}`, children: s("dropdown_and_verbal_questions_responses") }),
1679
+ /* @__PURE__ */ e(d, { container: !0, spacing: 2, children: /* @__PURE__ */ e(d, { item: !0, xs: 12, children: /* @__PURE__ */ e(
1680
+ Us,
1681
+ {
1682
+ isFullScreen: !1,
1683
+ response: B,
1684
+ onChangeOption: Y,
1685
+ questionAnswers: f,
1686
+ categoryDropdownOptions: Ze,
1687
+ categoryDropdownChose: Qe,
1688
+ setCategoryDropdownChose: Ce
1689
+ }
1690
+ ) }) })
1691
+ ] }),
1692
+ /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(
1693
+ Fs,
1694
+ {
1695
+ isExternal: !1,
1696
+ totalByQuestion: A,
1697
+ selectQuestion: m,
1698
+ setSelectQuestion: $,
1699
+ generateAvrByQuestion: r,
1700
+ ratingQuestions: v,
1701
+ onToggleResponseModel: x,
1702
+ avgQuestionRating: y,
1703
+ questionRatingConvert: w,
1704
+ activeColumnQuestionRating: T,
1705
+ onActiveColumnQuestionRating: D,
1706
+ setActiveColumnQuestionRating: me,
1707
+ categoryRatingChose: pe,
1708
+ setCategoryRatingChose: Te,
1709
+ questionRatingResponseSelected: ze,
1710
+ setQuestionRatingResponseSelected: Ue,
1711
+ categoriesOptions: Pe,
1712
+ setCategoriesOptions: ge,
1713
+ categoryRatingResponseChose: Ge,
1714
+ setCategoryRatingResponseChose: Ae,
1715
+ questionRatingSelected: $e,
1716
+ setQuestionRatingSelected: qe
1717
+ }
1718
+ ) }),
1719
+ le?.length > 0 && /* @__PURE__ */ n(d, { className: `${t["responses-distribution"]}`, children: [
1720
+ /* @__PURE__ */ e(N, { className: `${t.title}`, children: s("free_fields_responses") }),
1721
+ /* @__PURE__ */ e(d, { container: !0, spacing: 2, children: /* @__PURE__ */ e(d, { item: !0, xs: 12, children: /* @__PURE__ */ e(
1722
+ Zs,
1723
+ {
1724
+ isFullScreen: !0,
1725
+ handleClickCollapse: h,
1726
+ openIndexField: R,
1727
+ setOpenIndexField: J,
1728
+ questionsByCategoryField: te,
1729
+ setQuestionsByCategoryField: he,
1730
+ categoryFieldChose: z,
1731
+ setCategoryFieldChose: Se,
1732
+ categoriesField: le,
1733
+ setCategoriesField: Ve
1734
+ }
1735
+ ) }) })
1736
+ ] }),
1737
+ /* @__PURE__ */ e(
1738
+ Bs,
1739
+ {
1740
+ open: !!g,
1741
+ onClose: _,
1742
+ surveyName: o?.title || "",
1743
+ student: g,
1744
+ questionResponses: u
1745
+ }
1746
+ ),
1747
+ /* @__PURE__ */ e(
1748
+ Hs,
1749
+ {
1750
+ isHiddenContact: !1,
1751
+ open: I,
1752
+ onClose: x,
1753
+ questionName: m?.text || "",
1754
+ totalSent: A?.[0] || 0,
1755
+ totalByQuestion: A?.[1] || 0,
1756
+ questionRating: r() || 0,
1757
+ studentResponses: q
1758
+ }
1759
+ )
1760
+ ] })
1761
+ ] });
1762
+ };
1763
+ export {
1764
+ Da as default
1765
+ };