analytica-frontend-lib 1.2.34 → 1.2.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActivityFilters/index.d.ts +6 -19
- package/dist/ActivityFilters/index.d.ts.map +1 -1
- package/dist/ActivityFilters/index.js +566 -52
- package/dist/ActivityFilters/index.js.map +1 -1
- package/dist/ActivityFilters/index.mjs +566 -52
- package/dist/ActivityFilters/index.mjs.map +1 -1
- package/dist/Support/TicketModal/index.js +1 -23
- package/dist/Support/TicketModal/index.js.map +1 -1
- package/dist/Support/TicketModal/index.mjs +1 -52
- package/dist/Support/TicketModal/index.mjs.map +1 -1
- package/dist/Support/index.js +1 -23
- package/dist/Support/index.js.map +1 -1
- package/dist/Support/index.mjs +1 -52
- package/dist/Support/index.mjs.map +1 -1
- package/dist/hooks/useActivityFiltersData.d.ts +76 -0
- package/dist/hooks/useActivityFiltersData.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +848 -326
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +817 -327
- package/dist/index.mjs.map +1 -1
- package/dist/store/questionFiltersStore.d.ts +13 -0
- package/dist/store/questionFiltersStore.d.ts.map +1 -0
- package/dist/types/api.d.ts +22 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/notifications.d.ts +3 -13
- package/dist/types/notifications.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,54 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
-
});
|
|
13
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
-
for (let key of __getOwnPropNames(from))
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
-
mod
|
|
31
|
-
));
|
|
32
|
-
|
|
33
|
-
// node_modules/dayjs/locale/pt-br.js
|
|
34
|
-
var require_pt_br = __commonJS({
|
|
35
|
-
"node_modules/dayjs/locale/pt-br.js"(exports, module) {
|
|
36
|
-
"use strict";
|
|
37
|
-
!function(e, o) {
|
|
38
|
-
"object" == typeof exports && "undefined" != typeof module ? module.exports = o(__require("dayjs")) : "function" == typeof define && define.amd ? define(["dayjs"], o) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_locale_pt_br = o(e.dayjs);
|
|
39
|
-
}(exports, function(e) {
|
|
40
|
-
"use strict";
|
|
41
|
-
function o(e2) {
|
|
42
|
-
return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
|
|
43
|
-
}
|
|
44
|
-
var a = o(e), s = { name: "pt-br", weekdays: "domingo_segunda-feira_ter\xE7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xE1bado".split("_"), weekdaysShort: "dom_seg_ter_qua_qui_sex_s\xE1b".split("_"), weekdaysMin: "Do_2\xAA_3\xAA_4\xAA_5\xAA_6\xAA_S\xE1".split("_"), months: "janeiro_fevereiro_mar\xE7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"), monthsShort: "jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"), ordinal: function(e2) {
|
|
45
|
-
return e2 + "\xBA";
|
|
46
|
-
}, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY [\xE0s] HH:mm", LLLL: "dddd, D [de] MMMM [de] YYYY [\xE0s] HH:mm" }, relativeTime: { future: "em %s", past: "h\xE1 %s", s: "poucos segundos", m: "um minuto", mm: "%d minutos", h: "uma hora", hh: "%d horas", d: "um dia", dd: "%d dias", M: "um m\xEAs", MM: "%d meses", y: "um ano", yy: "%d anos" } };
|
|
47
|
-
return a.default.locale(s, null, true), s;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
1
|
// src/utils/utils.ts
|
|
53
2
|
import { clsx } from "clsx";
|
|
54
3
|
import { twMerge } from "tailwind-merge";
|
|
@@ -11257,6 +11206,503 @@ var questionTypeLabels = {
|
|
|
11257
11206
|
["PREENCHER" /* PREENCHER */]: "Preencher Lacunas"
|
|
11258
11207
|
};
|
|
11259
11208
|
|
|
11209
|
+
// src/hooks/useActivityFiltersData.ts
|
|
11210
|
+
import { useState as useState21, useEffect as useEffect21, useCallback as useCallback3, useMemo as useMemo9, useRef as useRef12 } from "react";
|
|
11211
|
+
var mapQuestionTypeToEnum = (type) => {
|
|
11212
|
+
const upperType = type.toUpperCase();
|
|
11213
|
+
const typeMap = {
|
|
11214
|
+
ALTERNATIVA: "ALTERNATIVA" /* ALTERNATIVA */,
|
|
11215
|
+
DISSERTATIVA: "DISSERTATIVA" /* DISSERTATIVA */,
|
|
11216
|
+
MULTIPLA_ESCOLHA: "MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */,
|
|
11217
|
+
VERDADEIRO_FALSO: "VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */,
|
|
11218
|
+
IMAGEM: "IMAGEM" /* IMAGEM */,
|
|
11219
|
+
LIGAR_PONTOS: "LIGAR_PONTOS" /* LIGAR_PONTOS */,
|
|
11220
|
+
PREENCHER: "PREENCHER" /* PREENCHER */
|
|
11221
|
+
};
|
|
11222
|
+
return typeMap[upperType] || null;
|
|
11223
|
+
};
|
|
11224
|
+
var areCategoriesSame = (prev, current) => {
|
|
11225
|
+
if (prev.length !== current.length) return false;
|
|
11226
|
+
return current.every((category) => {
|
|
11227
|
+
const prevCategory = prev.find((c) => c.key === category.key);
|
|
11228
|
+
if (!prevCategory) return false;
|
|
11229
|
+
const prevIds = (prevCategory.itens || []).map(
|
|
11230
|
+
(item) => item.id
|
|
11231
|
+
);
|
|
11232
|
+
const currentIds = (category.itens || []).map(
|
|
11233
|
+
(item) => item.id
|
|
11234
|
+
);
|
|
11235
|
+
if (prevIds.length !== currentIds.length) return false;
|
|
11236
|
+
return currentIds.every((id) => prevIds.includes(id));
|
|
11237
|
+
});
|
|
11238
|
+
};
|
|
11239
|
+
var mergeCategoriesWithSelection = (prev, current) => {
|
|
11240
|
+
return current.map((category) => {
|
|
11241
|
+
const prevCategory = prev.find((c) => c.key === category.key);
|
|
11242
|
+
if (!prevCategory) {
|
|
11243
|
+
return category;
|
|
11244
|
+
}
|
|
11245
|
+
const validSelectedIds = (prevCategory.selectedIds || []).filter(
|
|
11246
|
+
(id) => category.itens?.some((item) => item.id === id)
|
|
11247
|
+
);
|
|
11248
|
+
return {
|
|
11249
|
+
...category,
|
|
11250
|
+
selectedIds: validSelectedIds
|
|
11251
|
+
};
|
|
11252
|
+
});
|
|
11253
|
+
};
|
|
11254
|
+
var mapSelectedNames = (ids, items) => {
|
|
11255
|
+
return ids.map((id) => {
|
|
11256
|
+
const item = items.find((t) => t.id === id);
|
|
11257
|
+
return item ? item.name : null;
|
|
11258
|
+
}).filter((name) => name !== null);
|
|
11259
|
+
};
|
|
11260
|
+
var useActivityFiltersDataImpl = (apiClient, options) => {
|
|
11261
|
+
const { selectedSubjects, institutionId } = options;
|
|
11262
|
+
const [banksState, setBanksState] = useState21({
|
|
11263
|
+
banks: [],
|
|
11264
|
+
bankYears: [],
|
|
11265
|
+
loading: false,
|
|
11266
|
+
error: null
|
|
11267
|
+
});
|
|
11268
|
+
const loadBanks = useCallback3(async () => {
|
|
11269
|
+
setBanksState((prev) => ({ ...prev, loading: true, error: null }));
|
|
11270
|
+
try {
|
|
11271
|
+
const response = await apiClient.get(
|
|
11272
|
+
"/questions/exam-institutions"
|
|
11273
|
+
);
|
|
11274
|
+
const banksMap = /* @__PURE__ */ new Map();
|
|
11275
|
+
const bankYearsArray = [];
|
|
11276
|
+
for (const item of response.data.data) {
|
|
11277
|
+
if (!item.questionBankName) continue;
|
|
11278
|
+
const existingBank = banksMap.get(item.questionBankName);
|
|
11279
|
+
if (existingBank) {
|
|
11280
|
+
if (!existingBank.years.includes(item.year)) {
|
|
11281
|
+
existingBank.years.push(item.year);
|
|
11282
|
+
}
|
|
11283
|
+
existingBank.questionsCount += item.questionsCount;
|
|
11284
|
+
} else {
|
|
11285
|
+
banksMap.set(item.questionBankName, {
|
|
11286
|
+
id: item.questionBankName,
|
|
11287
|
+
name: item.questionBankName,
|
|
11288
|
+
examInstitution: item.questionBankName,
|
|
11289
|
+
years: [item.year],
|
|
11290
|
+
questionsCount: item.questionsCount
|
|
11291
|
+
});
|
|
11292
|
+
}
|
|
11293
|
+
bankYearsArray.push({
|
|
11294
|
+
id: `${item.questionBankYearId}-${item.questionBankName}`,
|
|
11295
|
+
name: item.year,
|
|
11296
|
+
bankId: item.questionBankName
|
|
11297
|
+
});
|
|
11298
|
+
}
|
|
11299
|
+
const banks = Array.from(banksMap.values()).map((bank) => ({
|
|
11300
|
+
id: bank.id,
|
|
11301
|
+
name: bank.name,
|
|
11302
|
+
examInstitution: bank.examInstitution
|
|
11303
|
+
}));
|
|
11304
|
+
setBanksState({
|
|
11305
|
+
banks,
|
|
11306
|
+
bankYears: bankYearsArray,
|
|
11307
|
+
loading: false,
|
|
11308
|
+
error: null
|
|
11309
|
+
});
|
|
11310
|
+
} catch (error) {
|
|
11311
|
+
console.error("Erro ao carregar bancas de vestibular:", error);
|
|
11312
|
+
setBanksState((prev) => ({
|
|
11313
|
+
...prev,
|
|
11314
|
+
loading: false,
|
|
11315
|
+
error: "Erro ao carregar bancas de vestibular"
|
|
11316
|
+
}));
|
|
11317
|
+
}
|
|
11318
|
+
}, [apiClient]);
|
|
11319
|
+
const [areasState, setAreasState] = useState21({
|
|
11320
|
+
knowledgeAreas: [],
|
|
11321
|
+
loading: false,
|
|
11322
|
+
error: null
|
|
11323
|
+
});
|
|
11324
|
+
const loadKnowledgeAreas = useCallback3(async () => {
|
|
11325
|
+
setAreasState((prev) => ({ ...prev, loading: true, error: null }));
|
|
11326
|
+
try {
|
|
11327
|
+
const response = await apiClient.get(
|
|
11328
|
+
"/knowledge/subjects"
|
|
11329
|
+
);
|
|
11330
|
+
setAreasState({
|
|
11331
|
+
knowledgeAreas: response.data.data,
|
|
11332
|
+
loading: false,
|
|
11333
|
+
error: null
|
|
11334
|
+
});
|
|
11335
|
+
} catch (error) {
|
|
11336
|
+
console.error("Erro ao carregar \xE1reas de conhecimento:", error);
|
|
11337
|
+
setAreasState((prev) => ({
|
|
11338
|
+
...prev,
|
|
11339
|
+
loading: false,
|
|
11340
|
+
error: "Erro ao carregar \xE1reas de conhecimento"
|
|
11341
|
+
}));
|
|
11342
|
+
}
|
|
11343
|
+
}, [apiClient]);
|
|
11344
|
+
const [questionTypesState, setQuestionTypesState] = useState21({
|
|
11345
|
+
questionTypes: [],
|
|
11346
|
+
loading: false,
|
|
11347
|
+
error: null
|
|
11348
|
+
});
|
|
11349
|
+
const loadQuestionTypes = useCallback3(async () => {
|
|
11350
|
+
if (!institutionId) {
|
|
11351
|
+
setQuestionTypesState((prev) => ({
|
|
11352
|
+
...prev,
|
|
11353
|
+
questionTypes: [],
|
|
11354
|
+
loading: false,
|
|
11355
|
+
error: null
|
|
11356
|
+
}));
|
|
11357
|
+
return;
|
|
11358
|
+
}
|
|
11359
|
+
setQuestionTypesState((prev) => ({
|
|
11360
|
+
...prev,
|
|
11361
|
+
loading: true,
|
|
11362
|
+
error: null
|
|
11363
|
+
}));
|
|
11364
|
+
try {
|
|
11365
|
+
const response = await apiClient.get(
|
|
11366
|
+
`/institutions/${institutionId}/question-types`
|
|
11367
|
+
);
|
|
11368
|
+
const mappedTypes = response.data.data.questionTypes.map(mapQuestionTypeToEnum).filter((type) => type !== null);
|
|
11369
|
+
setQuestionTypesState({
|
|
11370
|
+
questionTypes: mappedTypes,
|
|
11371
|
+
loading: false,
|
|
11372
|
+
error: null
|
|
11373
|
+
});
|
|
11374
|
+
} catch (error) {
|
|
11375
|
+
console.error("Erro ao carregar tipos de quest\xF5es:", error);
|
|
11376
|
+
setQuestionTypesState((prev) => ({
|
|
11377
|
+
...prev,
|
|
11378
|
+
loading: false,
|
|
11379
|
+
error: "Erro ao carregar tipos de quest\xF5es"
|
|
11380
|
+
}));
|
|
11381
|
+
}
|
|
11382
|
+
}, [apiClient, institutionId]);
|
|
11383
|
+
const [knowledgeStructure, setKnowledgeStructure] = useState21({
|
|
11384
|
+
topics: [],
|
|
11385
|
+
subtopics: [],
|
|
11386
|
+
contents: [],
|
|
11387
|
+
loading: false,
|
|
11388
|
+
error: null
|
|
11389
|
+
});
|
|
11390
|
+
const [knowledgeCategories, setKnowledgeCategories] = useState21([]);
|
|
11391
|
+
const previousSubjectsRef = useRef12(null);
|
|
11392
|
+
const loadTopics = useCallback3(
|
|
11393
|
+
async (subjectIds) => {
|
|
11394
|
+
if (subjectIds.length === 0) {
|
|
11395
|
+
setKnowledgeStructure({
|
|
11396
|
+
topics: [],
|
|
11397
|
+
subtopics: [],
|
|
11398
|
+
contents: [],
|
|
11399
|
+
loading: false,
|
|
11400
|
+
error: null
|
|
11401
|
+
});
|
|
11402
|
+
setKnowledgeCategories([]);
|
|
11403
|
+
return;
|
|
11404
|
+
}
|
|
11405
|
+
setKnowledgeStructure((prev) => ({
|
|
11406
|
+
...prev,
|
|
11407
|
+
loading: true,
|
|
11408
|
+
error: null
|
|
11409
|
+
}));
|
|
11410
|
+
try {
|
|
11411
|
+
const response = await apiClient.post(
|
|
11412
|
+
"/knowledge/topics",
|
|
11413
|
+
{ subjectIds }
|
|
11414
|
+
);
|
|
11415
|
+
const topics = response.data.data.map((topic) => ({
|
|
11416
|
+
id: topic.id,
|
|
11417
|
+
name: topic.name
|
|
11418
|
+
}));
|
|
11419
|
+
setKnowledgeStructure((prev) => ({
|
|
11420
|
+
...prev,
|
|
11421
|
+
topics,
|
|
11422
|
+
subtopics: [],
|
|
11423
|
+
contents: [],
|
|
11424
|
+
loading: false,
|
|
11425
|
+
error: null
|
|
11426
|
+
}));
|
|
11427
|
+
} catch (error) {
|
|
11428
|
+
console.error("Erro ao carregar temas:", error);
|
|
11429
|
+
setKnowledgeStructure((prev) => ({
|
|
11430
|
+
...prev,
|
|
11431
|
+
topics: [],
|
|
11432
|
+
subtopics: [],
|
|
11433
|
+
contents: [],
|
|
11434
|
+
loading: false,
|
|
11435
|
+
error: "Erro ao carregar temas"
|
|
11436
|
+
}));
|
|
11437
|
+
}
|
|
11438
|
+
},
|
|
11439
|
+
[apiClient]
|
|
11440
|
+
);
|
|
11441
|
+
const loadSubtopics = useCallback3(
|
|
11442
|
+
async (topicIds, options2 = {}) => {
|
|
11443
|
+
const { forceApi = false } = options2;
|
|
11444
|
+
if (topicIds.length === 0 && !forceApi) {
|
|
11445
|
+
setKnowledgeStructure((prev) => ({
|
|
11446
|
+
...prev,
|
|
11447
|
+
subtopics: [],
|
|
11448
|
+
contents: [],
|
|
11449
|
+
loading: false,
|
|
11450
|
+
error: null
|
|
11451
|
+
}));
|
|
11452
|
+
return;
|
|
11453
|
+
}
|
|
11454
|
+
setKnowledgeStructure((prev) => ({
|
|
11455
|
+
...prev,
|
|
11456
|
+
loading: topicIds.length > 0,
|
|
11457
|
+
error: null
|
|
11458
|
+
}));
|
|
11459
|
+
try {
|
|
11460
|
+
const response = await apiClient.post(
|
|
11461
|
+
"/knowledge/subtopics",
|
|
11462
|
+
{ topicIds }
|
|
11463
|
+
);
|
|
11464
|
+
const subtopics = response.data.data.map(
|
|
11465
|
+
(subtopic) => ({
|
|
11466
|
+
id: subtopic.id,
|
|
11467
|
+
name: subtopic.name,
|
|
11468
|
+
topicId: subtopic.topicId || topicIds[0]
|
|
11469
|
+
})
|
|
11470
|
+
);
|
|
11471
|
+
setKnowledgeStructure((prev) => ({
|
|
11472
|
+
...prev,
|
|
11473
|
+
subtopics,
|
|
11474
|
+
contents: [],
|
|
11475
|
+
loading: false,
|
|
11476
|
+
error: null
|
|
11477
|
+
}));
|
|
11478
|
+
} catch (error) {
|
|
11479
|
+
console.error("Erro ao carregar subtemas:", error);
|
|
11480
|
+
setKnowledgeStructure((prev) => ({
|
|
11481
|
+
...prev,
|
|
11482
|
+
subtopics: [],
|
|
11483
|
+
contents: [],
|
|
11484
|
+
loading: false,
|
|
11485
|
+
error: "Erro ao carregar subtemas"
|
|
11486
|
+
}));
|
|
11487
|
+
}
|
|
11488
|
+
},
|
|
11489
|
+
[apiClient]
|
|
11490
|
+
);
|
|
11491
|
+
const loadContents = useCallback3(
|
|
11492
|
+
async (subtopicIds) => {
|
|
11493
|
+
if (subtopicIds.length === 0) {
|
|
11494
|
+
setKnowledgeStructure((prev) => ({
|
|
11495
|
+
...prev,
|
|
11496
|
+
contents: [],
|
|
11497
|
+
loading: false,
|
|
11498
|
+
error: null
|
|
11499
|
+
}));
|
|
11500
|
+
return;
|
|
11501
|
+
}
|
|
11502
|
+
setKnowledgeStructure((prev) => ({
|
|
11503
|
+
...prev,
|
|
11504
|
+
loading: true,
|
|
11505
|
+
error: null
|
|
11506
|
+
}));
|
|
11507
|
+
try {
|
|
11508
|
+
const response = await apiClient.post(
|
|
11509
|
+
"/knowledge/contents",
|
|
11510
|
+
{ subtopicIds }
|
|
11511
|
+
);
|
|
11512
|
+
const contents = response.data.data.map(
|
|
11513
|
+
(content) => ({
|
|
11514
|
+
id: content.id,
|
|
11515
|
+
name: content.name,
|
|
11516
|
+
subtopicId: content.subtopicId || subtopicIds[0]
|
|
11517
|
+
})
|
|
11518
|
+
);
|
|
11519
|
+
setKnowledgeStructure((prev) => ({
|
|
11520
|
+
...prev,
|
|
11521
|
+
contents,
|
|
11522
|
+
loading: false,
|
|
11523
|
+
error: null
|
|
11524
|
+
}));
|
|
11525
|
+
} catch (error) {
|
|
11526
|
+
console.error("Erro ao carregar conte\xFAdos:", error);
|
|
11527
|
+
setKnowledgeStructure((prev) => ({
|
|
11528
|
+
...prev,
|
|
11529
|
+
contents: [],
|
|
11530
|
+
loading: false,
|
|
11531
|
+
error: "Erro ao carregar conte\xFAdos"
|
|
11532
|
+
}));
|
|
11533
|
+
}
|
|
11534
|
+
},
|
|
11535
|
+
[apiClient]
|
|
11536
|
+
);
|
|
11537
|
+
useEffect21(() => {
|
|
11538
|
+
const previousSubjects = previousSubjectsRef.current;
|
|
11539
|
+
const subjectsChanged = !previousSubjects || previousSubjects.length !== selectedSubjects.length || selectedSubjects.some((id, index) => id !== previousSubjects[index]);
|
|
11540
|
+
if (!subjectsChanged) return;
|
|
11541
|
+
previousSubjectsRef.current = selectedSubjects;
|
|
11542
|
+
if (selectedSubjects.length > 0) {
|
|
11543
|
+
loadTopics(selectedSubjects);
|
|
11544
|
+
return;
|
|
11545
|
+
}
|
|
11546
|
+
setKnowledgeStructure({
|
|
11547
|
+
topics: [],
|
|
11548
|
+
subtopics: [],
|
|
11549
|
+
contents: [],
|
|
11550
|
+
loading: false,
|
|
11551
|
+
error: null
|
|
11552
|
+
});
|
|
11553
|
+
setKnowledgeCategories([]);
|
|
11554
|
+
}, [selectedSubjects, loadTopics]);
|
|
11555
|
+
const handleCategoriesChange = useCallback3(
|
|
11556
|
+
(updatedCategories) => {
|
|
11557
|
+
const isFirstChange = knowledgeCategories.length === 0;
|
|
11558
|
+
const currentTemaCategory = knowledgeCategories.find(
|
|
11559
|
+
(c) => c.key === "tema"
|
|
11560
|
+
);
|
|
11561
|
+
const currentSubtemaCategory = knowledgeCategories.find(
|
|
11562
|
+
(c) => c.key === "subtema"
|
|
11563
|
+
);
|
|
11564
|
+
const currentSelectedTopicIds = currentTemaCategory?.selectedIds || [];
|
|
11565
|
+
const currentSelectedSubtopicIds = currentSubtemaCategory?.selectedIds || [];
|
|
11566
|
+
const temaCategory = updatedCategories.find((c) => c.key === "tema");
|
|
11567
|
+
const selectedTopicIds = temaCategory?.selectedIds || [];
|
|
11568
|
+
const subtemaCategory = updatedCategories.find(
|
|
11569
|
+
(c) => c.key === "subtema"
|
|
11570
|
+
);
|
|
11571
|
+
const selectedSubtopicIds = subtemaCategory?.selectedIds || [];
|
|
11572
|
+
setKnowledgeCategories(updatedCategories);
|
|
11573
|
+
const topicIdsChanged = isFirstChange || currentSelectedTopicIds.length !== selectedTopicIds.length || currentSelectedTopicIds.some(
|
|
11574
|
+
(id) => !selectedTopicIds.includes(id)
|
|
11575
|
+
) || selectedTopicIds.some(
|
|
11576
|
+
(id) => !currentSelectedTopicIds.includes(id)
|
|
11577
|
+
);
|
|
11578
|
+
if (topicIdsChanged) {
|
|
11579
|
+
loadSubtopics(selectedTopicIds, {
|
|
11580
|
+
forceApi: selectedTopicIds.length === 0
|
|
11581
|
+
});
|
|
11582
|
+
}
|
|
11583
|
+
const subtopicIdsChanged = isFirstChange || currentSelectedSubtopicIds.length !== selectedSubtopicIds.length || currentSelectedSubtopicIds.some(
|
|
11584
|
+
(id) => !selectedSubtopicIds.includes(id)
|
|
11585
|
+
) || selectedSubtopicIds.some(
|
|
11586
|
+
(id) => !currentSelectedSubtopicIds.includes(id)
|
|
11587
|
+
);
|
|
11588
|
+
if (subtopicIdsChanged) {
|
|
11589
|
+
if (selectedSubtopicIds.length > 0) {
|
|
11590
|
+
loadContents(selectedSubtopicIds);
|
|
11591
|
+
} else {
|
|
11592
|
+
loadContents([]);
|
|
11593
|
+
}
|
|
11594
|
+
}
|
|
11595
|
+
},
|
|
11596
|
+
[knowledgeCategories, loadSubtopics, loadContents]
|
|
11597
|
+
);
|
|
11598
|
+
useEffect21(() => {
|
|
11599
|
+
if (knowledgeStructure.topics.length === 0) {
|
|
11600
|
+
setKnowledgeCategories((prev) => {
|
|
11601
|
+
if (prev.length === 0) {
|
|
11602
|
+
return prev;
|
|
11603
|
+
}
|
|
11604
|
+
return [];
|
|
11605
|
+
});
|
|
11606
|
+
return;
|
|
11607
|
+
}
|
|
11608
|
+
const categories = [
|
|
11609
|
+
{
|
|
11610
|
+
key: "tema",
|
|
11611
|
+
label: "Tema",
|
|
11612
|
+
dependsOn: [],
|
|
11613
|
+
itens: knowledgeStructure.topics,
|
|
11614
|
+
selectedIds: []
|
|
11615
|
+
},
|
|
11616
|
+
{
|
|
11617
|
+
key: "subtema",
|
|
11618
|
+
label: "Subtema",
|
|
11619
|
+
dependsOn: ["tema"],
|
|
11620
|
+
itens: knowledgeStructure.subtopics,
|
|
11621
|
+
filteredBy: [{ key: "tema", internalField: "topicId" }],
|
|
11622
|
+
selectedIds: []
|
|
11623
|
+
},
|
|
11624
|
+
{
|
|
11625
|
+
key: "assunto",
|
|
11626
|
+
label: "Assunto",
|
|
11627
|
+
dependsOn: ["subtema"],
|
|
11628
|
+
itens: knowledgeStructure.contents,
|
|
11629
|
+
filteredBy: [{ key: "subtema", internalField: "subtopicId" }],
|
|
11630
|
+
selectedIds: []
|
|
11631
|
+
}
|
|
11632
|
+
];
|
|
11633
|
+
setKnowledgeCategories(
|
|
11634
|
+
(prev) => areCategoriesSame(prev, categories) ? prev : mergeCategoriesWithSelection(prev, categories)
|
|
11635
|
+
);
|
|
11636
|
+
}, [
|
|
11637
|
+
selectedSubjects,
|
|
11638
|
+
knowledgeStructure.topics,
|
|
11639
|
+
knowledgeStructure.subtopics,
|
|
11640
|
+
knowledgeStructure.contents
|
|
11641
|
+
]);
|
|
11642
|
+
const selectedKnowledgeSummary = useMemo9(() => {
|
|
11643
|
+
const temaCategory = knowledgeCategories.find((c) => c.key === "tema");
|
|
11644
|
+
const subtemaCategory = knowledgeCategories.find(
|
|
11645
|
+
(c) => c.key === "subtema"
|
|
11646
|
+
);
|
|
11647
|
+
const assuntoCategory = knowledgeCategories.find(
|
|
11648
|
+
(c) => c.key === "assunto"
|
|
11649
|
+
);
|
|
11650
|
+
const selectedTopics = mapSelectedNames(
|
|
11651
|
+
temaCategory?.selectedIds || [],
|
|
11652
|
+
knowledgeStructure.topics
|
|
11653
|
+
);
|
|
11654
|
+
const selectedSubtopics = mapSelectedNames(
|
|
11655
|
+
subtemaCategory?.selectedIds || [],
|
|
11656
|
+
knowledgeStructure.subtopics
|
|
11657
|
+
);
|
|
11658
|
+
const selectedContents = mapSelectedNames(
|
|
11659
|
+
assuntoCategory?.selectedIds || [],
|
|
11660
|
+
knowledgeStructure.contents
|
|
11661
|
+
);
|
|
11662
|
+
return {
|
|
11663
|
+
topics: selectedTopics,
|
|
11664
|
+
subtopics: selectedSubtopics,
|
|
11665
|
+
contents: selectedContents
|
|
11666
|
+
};
|
|
11667
|
+
}, [knowledgeCategories, knowledgeStructure]);
|
|
11668
|
+
const enableSummary = useMemo9(() => {
|
|
11669
|
+
return knowledgeStructure.topics.length === 1 || knowledgeStructure.subtopics.length === 1 || knowledgeStructure.contents.length === 1;
|
|
11670
|
+
}, [knowledgeStructure]);
|
|
11671
|
+
return {
|
|
11672
|
+
// Vestibular Banks
|
|
11673
|
+
banks: banksState.banks,
|
|
11674
|
+
bankYears: banksState.bankYears,
|
|
11675
|
+
loadingBanks: banksState.loading,
|
|
11676
|
+
banksError: banksState.error,
|
|
11677
|
+
loadBanks,
|
|
11678
|
+
// Knowledge Areas
|
|
11679
|
+
knowledgeAreas: areasState.knowledgeAreas,
|
|
11680
|
+
loadingSubjects: areasState.loading,
|
|
11681
|
+
subjectsError: areasState.error,
|
|
11682
|
+
loadKnowledgeAreas,
|
|
11683
|
+
// Knowledge Structure
|
|
11684
|
+
knowledgeStructure,
|
|
11685
|
+
knowledgeCategories,
|
|
11686
|
+
handleCategoriesChange,
|
|
11687
|
+
selectedKnowledgeSummary,
|
|
11688
|
+
enableSummary,
|
|
11689
|
+
loadTopics,
|
|
11690
|
+
loadSubtopics,
|
|
11691
|
+
loadContents,
|
|
11692
|
+
// Question Types
|
|
11693
|
+
questionTypes: questionTypesState.questionTypes,
|
|
11694
|
+
loadingQuestionTypes: questionTypesState.loading,
|
|
11695
|
+
questionTypesError: questionTypesState.error,
|
|
11696
|
+
loadQuestionTypes
|
|
11697
|
+
};
|
|
11698
|
+
};
|
|
11699
|
+
var createUseActivityFiltersData = (apiClient) => {
|
|
11700
|
+
return (options) => useActivityFiltersDataImpl(apiClient, options);
|
|
11701
|
+
};
|
|
11702
|
+
var createActivityFiltersDataHook = (apiClient) => {
|
|
11703
|
+
return createUseActivityFiltersData(apiClient);
|
|
11704
|
+
};
|
|
11705
|
+
|
|
11260
11706
|
// src/components/Filter/FilterModal.tsx
|
|
11261
11707
|
import { jsx as jsx57, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
11262
11708
|
var FilterModal = ({
|
|
@@ -11400,10 +11846,10 @@ var FilterModal = ({
|
|
|
11400
11846
|
};
|
|
11401
11847
|
|
|
11402
11848
|
// src/components/Filter/useTableFilter.ts
|
|
11403
|
-
import { useEffect as
|
|
11849
|
+
import { useEffect as useEffect22, useState as useState22, useCallback as useCallback4, useMemo as useMemo10 } from "react";
|
|
11404
11850
|
var useTableFilter = (initialConfigs, options = {}) => {
|
|
11405
11851
|
const { syncWithUrl = false } = options;
|
|
11406
|
-
const getInitialState =
|
|
11852
|
+
const getInitialState = useCallback4(() => {
|
|
11407
11853
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
11408
11854
|
return initialConfigs;
|
|
11409
11855
|
}
|
|
@@ -11421,8 +11867,8 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
11421
11867
|
}));
|
|
11422
11868
|
return configsWithUrlState;
|
|
11423
11869
|
}, [initialConfigs, syncWithUrl]);
|
|
11424
|
-
const [filterConfigs, setFilterConfigs] =
|
|
11425
|
-
const activeFilters =
|
|
11870
|
+
const [filterConfigs, setFilterConfigs] = useState22(getInitialState);
|
|
11871
|
+
const activeFilters = useMemo10(() => {
|
|
11426
11872
|
const filters = {};
|
|
11427
11873
|
for (const config of filterConfigs) {
|
|
11428
11874
|
for (const category of config.categories) {
|
|
@@ -11434,10 +11880,10 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
11434
11880
|
return filters;
|
|
11435
11881
|
}, [filterConfigs]);
|
|
11436
11882
|
const hasActiveFilters = Object.keys(activeFilters).length > 0;
|
|
11437
|
-
const updateFilters =
|
|
11883
|
+
const updateFilters = useCallback4((configs) => {
|
|
11438
11884
|
setFilterConfigs(configs);
|
|
11439
11885
|
}, []);
|
|
11440
|
-
const applyFilters =
|
|
11886
|
+
const applyFilters = useCallback4(() => {
|
|
11441
11887
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
11442
11888
|
return;
|
|
11443
11889
|
}
|
|
@@ -11455,7 +11901,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
11455
11901
|
}
|
|
11456
11902
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
11457
11903
|
}, [filterConfigs, syncWithUrl]);
|
|
11458
|
-
const clearFilters =
|
|
11904
|
+
const clearFilters = useCallback4(() => {
|
|
11459
11905
|
const clearedConfigs = filterConfigs.map((config) => ({
|
|
11460
11906
|
...config,
|
|
11461
11907
|
categories: config.categories.map((category) => ({
|
|
@@ -11475,7 +11921,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
11475
11921
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
11476
11922
|
}
|
|
11477
11923
|
}, [filterConfigs, syncWithUrl]);
|
|
11478
|
-
|
|
11924
|
+
useEffect22(() => {
|
|
11479
11925
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
11480
11926
|
return;
|
|
11481
11927
|
}
|
|
@@ -11496,9 +11942,9 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
11496
11942
|
};
|
|
11497
11943
|
|
|
11498
11944
|
// src/components/ActivityFilters/ActivityFilters.tsx
|
|
11499
|
-
import { useState as
|
|
11945
|
+
import { useState as useState23, useEffect as useEffect23, useMemo as useMemo11, useCallback as useCallback5, useRef as useRef13 } from "react";
|
|
11500
11946
|
import { jsx as jsx58, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
11501
|
-
var
|
|
11947
|
+
var questionTypesFallback = [
|
|
11502
11948
|
"ALTERNATIVA" /* ALTERNATIVA */,
|
|
11503
11949
|
"VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */,
|
|
11504
11950
|
"DISSERTATIVA" /* DISSERTATIVA */,
|
|
@@ -11512,7 +11958,7 @@ var QuestionTypeFilter = ({
|
|
|
11512
11958
|
onToggleType,
|
|
11513
11959
|
allowedQuestionTypes
|
|
11514
11960
|
}) => {
|
|
11515
|
-
const availableQuestionTypes = allowedQuestionTypes ||
|
|
11961
|
+
const availableQuestionTypes = allowedQuestionTypes || questionTypesFallback;
|
|
11516
11962
|
return /* @__PURE__ */ jsxs45("div", { children: [
|
|
11517
11963
|
/* @__PURE__ */ jsx58(Text_default, { size: "sm", weight: "bold", className: "mb-3 block", children: "Tipo de quest\xE3o" }),
|
|
11518
11964
|
/* @__PURE__ */ jsx58("div", { className: "grid grid-cols-2 gap-2", children: availableQuestionTypes.map((questionType) => /* @__PURE__ */ jsx58(
|
|
@@ -11637,45 +12083,42 @@ var FilterActions = ({
|
|
|
11637
12083
|
] });
|
|
11638
12084
|
};
|
|
11639
12085
|
var ActivityFilters = ({
|
|
12086
|
+
apiClient,
|
|
11640
12087
|
onFiltersChange,
|
|
11641
12088
|
variant = "default",
|
|
11642
|
-
|
|
11643
|
-
banks = [],
|
|
11644
|
-
bankYears = [],
|
|
11645
|
-
knowledgeAreas = [],
|
|
11646
|
-
knowledgeStructure = {
|
|
11647
|
-
topics: [],
|
|
11648
|
-
subtopics: [],
|
|
11649
|
-
contents: [],
|
|
11650
|
-
loading: false,
|
|
11651
|
-
error: null
|
|
11652
|
-
},
|
|
11653
|
-
knowledgeCategories = [],
|
|
12089
|
+
institutionId = null,
|
|
11654
12090
|
// Question types
|
|
11655
12091
|
allowedQuestionTypes,
|
|
11656
|
-
// Loading states
|
|
11657
|
-
loadingBanks = false,
|
|
11658
|
-
loadingKnowledge: _loadingKnowledge = false,
|
|
11659
|
-
loadingSubjects = false,
|
|
11660
|
-
// Errors
|
|
11661
|
-
banksError = null,
|
|
11662
|
-
subjectsError = null,
|
|
11663
|
-
// Load functions
|
|
11664
|
-
loadBanks,
|
|
11665
|
-
loadKnowledge,
|
|
11666
|
-
loadTopics,
|
|
11667
|
-
loadSubtopics: _loadSubtopics,
|
|
11668
|
-
loadContents: _loadContents,
|
|
11669
|
-
// Handlers
|
|
11670
|
-
handleCategoriesChange,
|
|
11671
12092
|
// Action buttons
|
|
11672
12093
|
onClearFilters,
|
|
11673
12094
|
onApplyFilters
|
|
11674
12095
|
}) => {
|
|
11675
|
-
const
|
|
11676
|
-
const [
|
|
11677
|
-
const
|
|
11678
|
-
|
|
12096
|
+
const useActivityFiltersData = createUseActivityFiltersData(apiClient);
|
|
12097
|
+
const [selectedQuestionTypes, setSelectedQuestionTypes] = useState23([]);
|
|
12098
|
+
const [selectedSubject, setSelectedSubject] = useState23(null);
|
|
12099
|
+
const {
|
|
12100
|
+
banks,
|
|
12101
|
+
bankYears,
|
|
12102
|
+
loadingBanks,
|
|
12103
|
+
banksError,
|
|
12104
|
+
knowledgeAreas,
|
|
12105
|
+
loadingSubjects,
|
|
12106
|
+
subjectsError,
|
|
12107
|
+
knowledgeStructure,
|
|
12108
|
+
knowledgeCategories,
|
|
12109
|
+
handleCategoriesChange,
|
|
12110
|
+
loadBanks,
|
|
12111
|
+
loadKnowledgeAreas,
|
|
12112
|
+
loadQuestionTypes,
|
|
12113
|
+
questionTypes,
|
|
12114
|
+
loadingQuestionTypes,
|
|
12115
|
+
questionTypesError
|
|
12116
|
+
} = useActivityFiltersData({
|
|
12117
|
+
selectedSubjects: selectedSubject ? [selectedSubject] : [],
|
|
12118
|
+
institutionId
|
|
12119
|
+
});
|
|
12120
|
+
const prevAllowedQuestionTypesRef = useRef13(null);
|
|
12121
|
+
useEffect23(() => {
|
|
11679
12122
|
if (!allowedQuestionTypes || allowedQuestionTypes.length === 0) {
|
|
11680
12123
|
prevAllowedQuestionTypesRef.current = null;
|
|
11681
12124
|
return;
|
|
@@ -11708,8 +12151,8 @@ var ActivityFilters = ({
|
|
|
11708
12151
|
return prev;
|
|
11709
12152
|
});
|
|
11710
12153
|
}, [allowedQuestionTypes]);
|
|
11711
|
-
const [bankCategories, setBankCategories] =
|
|
11712
|
-
const selectedSubjects =
|
|
12154
|
+
const [bankCategories, setBankCategories] = useState23([]);
|
|
12155
|
+
const selectedSubjects = useMemo11(
|
|
11713
12156
|
() => selectedSubject ? [selectedSubject] : [],
|
|
11714
12157
|
[selectedSubject]
|
|
11715
12158
|
);
|
|
@@ -11722,7 +12165,7 @@ var ActivityFilters = ({
|
|
|
11722
12165
|
const handleBankCategoriesChange = (updatedCategories) => {
|
|
11723
12166
|
setBankCategories(updatedCategories);
|
|
11724
12167
|
};
|
|
11725
|
-
|
|
12168
|
+
useEffect23(() => {
|
|
11726
12169
|
setBankCategories((prevCategories) => {
|
|
11727
12170
|
const bankCategory = {
|
|
11728
12171
|
key: "banca",
|
|
@@ -11748,37 +12191,42 @@ var ActivityFilters = ({
|
|
|
11748
12191
|
return [bankCategory, yearCategory];
|
|
11749
12192
|
});
|
|
11750
12193
|
}, [banks, bankYears]);
|
|
11751
|
-
|
|
12194
|
+
useEffect23(() => {
|
|
11752
12195
|
if (loadBanks) {
|
|
11753
12196
|
loadBanks();
|
|
11754
12197
|
}
|
|
11755
|
-
if (
|
|
11756
|
-
|
|
12198
|
+
if (loadKnowledgeAreas) {
|
|
12199
|
+
loadKnowledgeAreas();
|
|
11757
12200
|
}
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
12201
|
+
if (loadQuestionTypes) {
|
|
12202
|
+
loadQuestionTypes();
|
|
12203
|
+
}
|
|
12204
|
+
}, [loadBanks, loadKnowledgeAreas, loadQuestionTypes, institutionId]);
|
|
12205
|
+
const availableQuestionTypes = useMemo11(() => {
|
|
12206
|
+
const source = questionTypes && questionTypes.length > 0 ? questionTypes : questionTypesFallback;
|
|
12207
|
+
if (!allowedQuestionTypes || allowedQuestionTypes.length === 0) {
|
|
12208
|
+
return source;
|
|
11762
12209
|
}
|
|
11763
|
-
|
|
11764
|
-
|
|
12210
|
+
return source.filter((type) => allowedQuestionTypes.includes(type));
|
|
12211
|
+
}, [questionTypes, allowedQuestionTypes]);
|
|
12212
|
+
const getSelectedKnowledgeIds = useCallback5(() => {
|
|
11765
12213
|
return getSelectedIdsFromCategories(knowledgeCategories, {
|
|
11766
12214
|
topicIds: "tema",
|
|
11767
12215
|
subtopicIds: "subtema",
|
|
11768
12216
|
contentIds: "assunto"
|
|
11769
12217
|
});
|
|
11770
12218
|
}, [knowledgeCategories]);
|
|
11771
|
-
const getSelectedBankIds =
|
|
12219
|
+
const getSelectedBankIds = useCallback5(() => {
|
|
11772
12220
|
return getSelectedIdsFromCategories(bankCategories, {
|
|
11773
12221
|
bankIds: "banca",
|
|
11774
12222
|
yearIds: "ano"
|
|
11775
12223
|
});
|
|
11776
12224
|
}, [bankCategories]);
|
|
11777
|
-
const onFiltersChangeRef =
|
|
11778
|
-
|
|
12225
|
+
const onFiltersChangeRef = useRef13(onFiltersChange);
|
|
12226
|
+
useEffect23(() => {
|
|
11779
12227
|
onFiltersChangeRef.current = onFiltersChange;
|
|
11780
12228
|
}, [onFiltersChange]);
|
|
11781
|
-
|
|
12229
|
+
useEffect23(() => {
|
|
11782
12230
|
const knowledgeIds = getSelectedKnowledgeIds();
|
|
11783
12231
|
const bankIds = getSelectedBankIds();
|
|
11784
12232
|
const filters = {
|
|
@@ -11809,7 +12257,25 @@ var ActivityFilters = ({
|
|
|
11809
12257
|
{
|
|
11810
12258
|
selectedTypes: selectedQuestionTypes,
|
|
11811
12259
|
onToggleType: toggleQuestionType,
|
|
11812
|
-
allowedQuestionTypes
|
|
12260
|
+
allowedQuestionTypes: availableQuestionTypes
|
|
12261
|
+
}
|
|
12262
|
+
),
|
|
12263
|
+
loadingQuestionTypes && /* @__PURE__ */ jsx58(
|
|
12264
|
+
Text_default,
|
|
12265
|
+
{
|
|
12266
|
+
size: "sm",
|
|
12267
|
+
className: "text-text-600",
|
|
12268
|
+
"data-testid": "question-types-loading",
|
|
12269
|
+
children: "Carregando tipos de quest\xE3o..."
|
|
12270
|
+
}
|
|
12271
|
+
),
|
|
12272
|
+
questionTypesError && /* @__PURE__ */ jsx58(
|
|
12273
|
+
Text_default,
|
|
12274
|
+
{
|
|
12275
|
+
size: "sm",
|
|
12276
|
+
className: "text-error-500",
|
|
12277
|
+
"data-testid": "question-types-error",
|
|
12278
|
+
children: questionTypesError
|
|
11813
12279
|
}
|
|
11814
12280
|
),
|
|
11815
12281
|
/* @__PURE__ */ jsxs45("div", { children: [
|
|
@@ -11862,7 +12328,7 @@ var ActivityFiltersPopover = ({
|
|
|
11862
12328
|
triggerLabel = "Filtro de quest\xF5es",
|
|
11863
12329
|
...activityFiltersProps
|
|
11864
12330
|
}) => {
|
|
11865
|
-
const [open, setOpen] =
|
|
12331
|
+
const [open, setOpen] = useState23(false);
|
|
11866
12332
|
return /* @__PURE__ */ jsxs45(DropdownMenu_default, { open, onOpenChange: setOpen, children: [
|
|
11867
12333
|
/* @__PURE__ */ jsx58(DropdownMenuTrigger, { children: /* @__PURE__ */ jsx58(Button_default, { variant: "outline", children: triggerLabel }) }),
|
|
11868
12334
|
/* @__PURE__ */ jsx58(
|
|
@@ -11884,7 +12350,7 @@ var ActivityFiltersPopover = ({
|
|
|
11884
12350
|
};
|
|
11885
12351
|
|
|
11886
12352
|
// src/components/TableProvider/TableProvider.tsx
|
|
11887
|
-
import { useState as
|
|
12353
|
+
import { useState as useState24, useEffect as useEffect24, useMemo as useMemo12, useCallback as useCallback6 } from "react";
|
|
11888
12354
|
import { Funnel } from "phosphor-react";
|
|
11889
12355
|
import { Fragment as Fragment11, jsx as jsx59, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
11890
12356
|
function TableProvider({
|
|
@@ -11908,7 +12374,7 @@ function TableProvider({
|
|
|
11908
12374
|
onRowClick,
|
|
11909
12375
|
children
|
|
11910
12376
|
}) {
|
|
11911
|
-
const [searchQuery, setSearchQuery] =
|
|
12377
|
+
const [searchQuery, setSearchQuery] = useState24("");
|
|
11912
12378
|
const sortResultRaw = useTableSort(data, { syncWithUrl: true });
|
|
11913
12379
|
const sortResult = enableTableSort ? sortResultRaw : {
|
|
11914
12380
|
sortedData: data,
|
|
@@ -11919,7 +12385,7 @@ function TableProvider({
|
|
|
11919
12385
|
};
|
|
11920
12386
|
const { sortedData, sortColumn, sortDirection, handleSort } = sortResult;
|
|
11921
12387
|
const filterResultRaw = useTableFilter(initialFilters, { syncWithUrl: true });
|
|
11922
|
-
const disabledFilterResult =
|
|
12388
|
+
const disabledFilterResult = useMemo12(
|
|
11923
12389
|
() => ({
|
|
11924
12390
|
filterConfigs: [],
|
|
11925
12391
|
activeFilters: {},
|
|
@@ -11949,10 +12415,10 @@ function TableProvider({
|
|
|
11949
12415
|
totalItems,
|
|
11950
12416
|
totalPages
|
|
11951
12417
|
} = paginationConfig;
|
|
11952
|
-
const [currentPage, setCurrentPage] =
|
|
11953
|
-
const [itemsPerPage, setItemsPerPage] =
|
|
11954
|
-
const [isFilterModalOpen, setIsFilterModalOpen] =
|
|
11955
|
-
const combinedParams =
|
|
12418
|
+
const [currentPage, setCurrentPage] = useState24(1);
|
|
12419
|
+
const [itemsPerPage, setItemsPerPage] = useState24(defaultItemsPerPage);
|
|
12420
|
+
const [isFilterModalOpen, setIsFilterModalOpen] = useState24(false);
|
|
12421
|
+
const combinedParams = useMemo12(() => {
|
|
11956
12422
|
const params = {
|
|
11957
12423
|
page: currentPage,
|
|
11958
12424
|
limit: itemsPerPage
|
|
@@ -11979,26 +12445,26 @@ function TableProvider({
|
|
|
11979
12445
|
enableFilters,
|
|
11980
12446
|
enableTableSort
|
|
11981
12447
|
]);
|
|
11982
|
-
|
|
12448
|
+
useEffect24(() => {
|
|
11983
12449
|
onParamsChange?.(combinedParams);
|
|
11984
12450
|
}, [combinedParams]);
|
|
11985
|
-
const handleSearchChange =
|
|
12451
|
+
const handleSearchChange = useCallback6((value) => {
|
|
11986
12452
|
setSearchQuery(value);
|
|
11987
12453
|
setCurrentPage(1);
|
|
11988
12454
|
}, []);
|
|
11989
|
-
const handleFilterApply =
|
|
12455
|
+
const handleFilterApply = useCallback6(() => {
|
|
11990
12456
|
applyFilters();
|
|
11991
12457
|
setIsFilterModalOpen(false);
|
|
11992
12458
|
setCurrentPage(1);
|
|
11993
12459
|
}, [applyFilters]);
|
|
11994
|
-
const handlePageChange =
|
|
12460
|
+
const handlePageChange = useCallback6((page) => {
|
|
11995
12461
|
setCurrentPage(page);
|
|
11996
12462
|
}, []);
|
|
11997
|
-
const handleItemsPerPageChange =
|
|
12463
|
+
const handleItemsPerPageChange = useCallback6((items) => {
|
|
11998
12464
|
setItemsPerPage(items);
|
|
11999
12465
|
setCurrentPage(1);
|
|
12000
12466
|
}, []);
|
|
12001
|
-
const handleRowClickInternal =
|
|
12467
|
+
const handleRowClickInternal = useCallback6(
|
|
12002
12468
|
(row, index) => {
|
|
12003
12469
|
if (enableRowClick && onRowClick) {
|
|
12004
12470
|
onRowClick(row, index);
|
|
@@ -12006,7 +12472,7 @@ function TableProvider({
|
|
|
12006
12472
|
},
|
|
12007
12473
|
[enableRowClick, onRowClick]
|
|
12008
12474
|
);
|
|
12009
|
-
const useInternalPagination =
|
|
12475
|
+
const useInternalPagination = useMemo12(
|
|
12010
12476
|
() => enablePagination && !onParamsChange && totalItems === void 0 && totalPages === void 0,
|
|
12011
12477
|
[enablePagination, onParamsChange, totalItems, totalPages]
|
|
12012
12478
|
);
|
|
@@ -12014,7 +12480,7 @@ function TableProvider({
|
|
|
12014
12480
|
(totalItems ?? (useInternalPagination ? sortedData.length : data.length)) / itemsPerPage
|
|
12015
12481
|
);
|
|
12016
12482
|
const calculatedTotalItems = totalItems ?? (useInternalPagination ? sortedData.length : data.length);
|
|
12017
|
-
const displayData =
|
|
12483
|
+
const displayData = useMemo12(() => {
|
|
12018
12484
|
if (!useInternalPagination) {
|
|
12019
12485
|
return sortedData;
|
|
12020
12486
|
}
|
|
@@ -12182,8 +12648,8 @@ var TableProvider_default = TableProvider;
|
|
|
12182
12648
|
// src/components/Select/Select.tsx
|
|
12183
12649
|
import { create as create10, useStore as useStore4 } from "zustand";
|
|
12184
12650
|
import {
|
|
12185
|
-
useEffect as
|
|
12186
|
-
useRef as
|
|
12651
|
+
useEffect as useEffect25,
|
|
12652
|
+
useRef as useRef14,
|
|
12187
12653
|
forwardRef as forwardRef19,
|
|
12188
12654
|
isValidElement as isValidElement6,
|
|
12189
12655
|
Children as Children6,
|
|
@@ -12289,10 +12755,10 @@ var Select = ({
|
|
|
12289
12755
|
errorMessage,
|
|
12290
12756
|
id
|
|
12291
12757
|
}) => {
|
|
12292
|
-
const storeRef =
|
|
12758
|
+
const storeRef = useRef14(null);
|
|
12293
12759
|
storeRef.current ??= createSelectStore(onValueChange);
|
|
12294
12760
|
const store = storeRef.current;
|
|
12295
|
-
const selectRef =
|
|
12761
|
+
const selectRef = useRef14(null);
|
|
12296
12762
|
const { open, setOpen, setValue, selectedLabel } = useStore4(store, (s) => s);
|
|
12297
12763
|
const generatedId = useId10();
|
|
12298
12764
|
const selectId = id ?? `select-${generatedId}`;
|
|
@@ -12313,13 +12779,13 @@ var Select = ({
|
|
|
12313
12779
|
search(children2);
|
|
12314
12780
|
return found;
|
|
12315
12781
|
};
|
|
12316
|
-
|
|
12782
|
+
useEffect25(() => {
|
|
12317
12783
|
if (!selectedLabel && defaultValue) {
|
|
12318
12784
|
const label2 = findLabelForValue(children, defaultValue);
|
|
12319
12785
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
12320
12786
|
}
|
|
12321
12787
|
}, [children, defaultValue, selectedLabel]);
|
|
12322
|
-
|
|
12788
|
+
useEffect25(() => {
|
|
12323
12789
|
const handleClickOutside = (event) => {
|
|
12324
12790
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
12325
12791
|
setOpen(false);
|
|
@@ -12354,7 +12820,7 @@ var Select = ({
|
|
|
12354
12820
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
12355
12821
|
};
|
|
12356
12822
|
}, [open]);
|
|
12357
|
-
|
|
12823
|
+
useEffect25(() => {
|
|
12358
12824
|
if (propValue) {
|
|
12359
12825
|
setValue(propValue);
|
|
12360
12826
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -12535,13 +13001,13 @@ var Select_default = Select;
|
|
|
12535
13001
|
// src/components/Menu/Menu.tsx
|
|
12536
13002
|
import { create as create11, useStore as useStore5 } from "zustand";
|
|
12537
13003
|
import {
|
|
12538
|
-
useEffect as
|
|
12539
|
-
useRef as
|
|
13004
|
+
useEffect as useEffect26,
|
|
13005
|
+
useRef as useRef15,
|
|
12540
13006
|
forwardRef as forwardRef20,
|
|
12541
13007
|
isValidElement as isValidElement7,
|
|
12542
13008
|
Children as Children7,
|
|
12543
13009
|
cloneElement as cloneElement7,
|
|
12544
|
-
useState as
|
|
13010
|
+
useState as useState25
|
|
12545
13011
|
} from "react";
|
|
12546
13012
|
import { CaretLeft as CaretLeft4, CaretRight as CaretRight7 } from "phosphor-react";
|
|
12547
13013
|
import { jsx as jsx61, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
@@ -12573,11 +13039,11 @@ var Menu = forwardRef20(
|
|
|
12573
13039
|
onValueChange,
|
|
12574
13040
|
...props
|
|
12575
13041
|
}, ref) => {
|
|
12576
|
-
const storeRef =
|
|
13042
|
+
const storeRef = useRef15(null);
|
|
12577
13043
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
12578
13044
|
const store = storeRef.current;
|
|
12579
13045
|
const { setValue } = useStore5(store, (s) => s);
|
|
12580
|
-
|
|
13046
|
+
useEffect26(() => {
|
|
12581
13047
|
setValue(propValue ?? defaultValue);
|
|
12582
13048
|
}, [defaultValue, propValue, setValue]);
|
|
12583
13049
|
const baseClasses = variant === "menu-overflow" ? "w-fit py-2 flex flex-row items-center justify-center" : "w-full py-2 flex flex-row items-center justify-center";
|
|
@@ -12778,10 +13244,10 @@ var MenuOverflow = ({
|
|
|
12778
13244
|
onValueChange,
|
|
12779
13245
|
...props
|
|
12780
13246
|
}) => {
|
|
12781
|
-
const containerRef =
|
|
12782
|
-
const [showLeftArrow, setShowLeftArrow] =
|
|
12783
|
-
const [showRightArrow, setShowRightArrow] =
|
|
12784
|
-
|
|
13247
|
+
const containerRef = useRef15(null);
|
|
13248
|
+
const [showLeftArrow, setShowLeftArrow] = useState25(false);
|
|
13249
|
+
const [showRightArrow, setShowRightArrow] = useState25(false);
|
|
13250
|
+
useEffect26(() => {
|
|
12785
13251
|
const checkScroll = () => internalCheckScroll(
|
|
12786
13252
|
containerRef.current,
|
|
12787
13253
|
setShowLeftArrow,
|
|
@@ -13105,10 +13571,10 @@ var NotFound_default = NotFound;
|
|
|
13105
13571
|
|
|
13106
13572
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
13107
13573
|
import {
|
|
13108
|
-
useRef as
|
|
13109
|
-
useState as
|
|
13110
|
-
useEffect as
|
|
13111
|
-
useCallback as
|
|
13574
|
+
useRef as useRef16,
|
|
13575
|
+
useState as useState27,
|
|
13576
|
+
useEffect as useEffect27,
|
|
13577
|
+
useCallback as useCallback8
|
|
13112
13578
|
} from "react";
|
|
13113
13579
|
import { createPortal } from "react-dom";
|
|
13114
13580
|
import {
|
|
@@ -13123,7 +13589,7 @@ import {
|
|
|
13123
13589
|
} from "phosphor-react";
|
|
13124
13590
|
|
|
13125
13591
|
// src/components/DownloadButton/DownloadButton.tsx
|
|
13126
|
-
import { useCallback as
|
|
13592
|
+
import { useCallback as useCallback7, useState as useState26 } from "react";
|
|
13127
13593
|
import { DownloadSimple } from "phosphor-react";
|
|
13128
13594
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
13129
13595
|
var getMimeType = (url) => {
|
|
@@ -13200,13 +13666,13 @@ var DownloadButton = ({
|
|
|
13200
13666
|
lessonTitle = "aula",
|
|
13201
13667
|
disabled = false
|
|
13202
13668
|
}) => {
|
|
13203
|
-
const [isDownloading, setIsDownloading] =
|
|
13204
|
-
const isValidUrl =
|
|
13669
|
+
const [isDownloading, setIsDownloading] = useState26(false);
|
|
13670
|
+
const isValidUrl = useCallback7((url) => {
|
|
13205
13671
|
return Boolean(
|
|
13206
13672
|
url && url.trim() !== "" && url !== "undefined" && url !== "null"
|
|
13207
13673
|
);
|
|
13208
13674
|
}, []);
|
|
13209
|
-
const getAvailableContent =
|
|
13675
|
+
const getAvailableContent = useCallback7(() => {
|
|
13210
13676
|
const downloads = [];
|
|
13211
13677
|
if (isValidUrl(content.urlDoc)) {
|
|
13212
13678
|
downloads.push({
|
|
@@ -13241,7 +13707,7 @@ var DownloadButton = ({
|
|
|
13241
13707
|
}
|
|
13242
13708
|
return downloads;
|
|
13243
13709
|
}, [content, isValidUrl]);
|
|
13244
|
-
const handleDownload =
|
|
13710
|
+
const handleDownload = useCallback7(async () => {
|
|
13245
13711
|
if (disabled || isDownloading) return;
|
|
13246
13712
|
const availableContent = getAvailableContent();
|
|
13247
13713
|
if (availableContent.length === 0) {
|
|
@@ -13379,9 +13845,9 @@ var SpeedMenu = ({
|
|
|
13379
13845
|
iconSize = 24,
|
|
13380
13846
|
isTinyMobile = false
|
|
13381
13847
|
}) => {
|
|
13382
|
-
const buttonRef =
|
|
13383
|
-
const speedMenuContainerRef =
|
|
13384
|
-
const speedMenuRef =
|
|
13848
|
+
const buttonRef = useRef16(null);
|
|
13849
|
+
const speedMenuContainerRef = useRef16(null);
|
|
13850
|
+
const speedMenuRef = useRef16(null);
|
|
13385
13851
|
const getMenuPosition = () => {
|
|
13386
13852
|
if (!buttonRef.current) return { top: 0, left: 0 };
|
|
13387
13853
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
@@ -13395,7 +13861,7 @@ var SpeedMenu = ({
|
|
|
13395
13861
|
};
|
|
13396
13862
|
};
|
|
13397
13863
|
const position = getMenuPosition();
|
|
13398
|
-
|
|
13864
|
+
useEffect27(() => {
|
|
13399
13865
|
const handleClickOutside = (event) => {
|
|
13400
13866
|
const target = event.target;
|
|
13401
13867
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -13474,28 +13940,28 @@ var VideoPlayer = ({
|
|
|
13474
13940
|
onDownloadComplete,
|
|
13475
13941
|
onDownloadError
|
|
13476
13942
|
}) => {
|
|
13477
|
-
const videoRef =
|
|
13943
|
+
const videoRef = useRef16(null);
|
|
13478
13944
|
const { isUltraSmallMobile, isTinyMobile } = useMobile();
|
|
13479
|
-
const [isPlaying, setIsPlaying] =
|
|
13480
|
-
const [currentTime, setCurrentTime] =
|
|
13481
|
-
const [duration, setDuration] =
|
|
13482
|
-
const [isMuted, setIsMuted] =
|
|
13483
|
-
const [volume, setVolume] =
|
|
13484
|
-
const [isFullscreen, setIsFullscreen] =
|
|
13485
|
-
const [showControls, setShowControls] =
|
|
13486
|
-
const [hasCompleted, setHasCompleted] =
|
|
13487
|
-
const [showCaptions, setShowCaptions] =
|
|
13488
|
-
const [subtitlesValidation, setSubtitlesValidation] =
|
|
13489
|
-
|
|
13945
|
+
const [isPlaying, setIsPlaying] = useState27(false);
|
|
13946
|
+
const [currentTime, setCurrentTime] = useState27(0);
|
|
13947
|
+
const [duration, setDuration] = useState27(0);
|
|
13948
|
+
const [isMuted, setIsMuted] = useState27(false);
|
|
13949
|
+
const [volume, setVolume] = useState27(1);
|
|
13950
|
+
const [isFullscreen, setIsFullscreen] = useState27(false);
|
|
13951
|
+
const [showControls, setShowControls] = useState27(true);
|
|
13952
|
+
const [hasCompleted, setHasCompleted] = useState27(false);
|
|
13953
|
+
const [showCaptions, setShowCaptions] = useState27(false);
|
|
13954
|
+
const [subtitlesValidation, setSubtitlesValidation] = useState27("idle");
|
|
13955
|
+
useEffect27(() => {
|
|
13490
13956
|
setHasCompleted(false);
|
|
13491
13957
|
}, [src]);
|
|
13492
|
-
const [playbackRate, setPlaybackRate] =
|
|
13493
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
13494
|
-
const lastSaveTimeRef =
|
|
13495
|
-
const trackRef =
|
|
13496
|
-
const controlsTimeoutRef =
|
|
13497
|
-
const lastMousePositionRef =
|
|
13498
|
-
const isUserInteracting =
|
|
13958
|
+
const [playbackRate, setPlaybackRate] = useState27(1);
|
|
13959
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState27(false);
|
|
13960
|
+
const lastSaveTimeRef = useRef16(0);
|
|
13961
|
+
const trackRef = useRef16(null);
|
|
13962
|
+
const controlsTimeoutRef = useRef16(null);
|
|
13963
|
+
const lastMousePositionRef = useRef16({ x: 0, y: 0 });
|
|
13964
|
+
const isUserInteracting = useCallback8(() => {
|
|
13499
13965
|
if (showSpeedMenu) {
|
|
13500
13966
|
return true;
|
|
13501
13967
|
}
|
|
@@ -13512,13 +13978,13 @@ var VideoPlayer = ({
|
|
|
13512
13978
|
}
|
|
13513
13979
|
return false;
|
|
13514
13980
|
}, [showSpeedMenu]);
|
|
13515
|
-
const clearControlsTimeout =
|
|
13981
|
+
const clearControlsTimeout = useCallback8(() => {
|
|
13516
13982
|
if (controlsTimeoutRef.current) {
|
|
13517
13983
|
clearTimeout(controlsTimeoutRef.current);
|
|
13518
13984
|
controlsTimeoutRef.current = null;
|
|
13519
13985
|
}
|
|
13520
13986
|
}, []);
|
|
13521
|
-
const showControlsWithTimer =
|
|
13987
|
+
const showControlsWithTimer = useCallback8(() => {
|
|
13522
13988
|
setShowControls(true);
|
|
13523
13989
|
clearControlsTimeout();
|
|
13524
13990
|
if (isFullscreen) {
|
|
@@ -13533,7 +13999,7 @@ var VideoPlayer = ({
|
|
|
13533
13999
|
}, CONTROLS_HIDE_TIMEOUT);
|
|
13534
14000
|
}
|
|
13535
14001
|
}, [isFullscreen, isPlaying, clearControlsTimeout]);
|
|
13536
|
-
const handleMouseMove =
|
|
14002
|
+
const handleMouseMove = useCallback8(
|
|
13537
14003
|
(event) => {
|
|
13538
14004
|
const currentX = event.clientX;
|
|
13539
14005
|
const currentY = event.clientY;
|
|
@@ -13546,10 +14012,10 @@ var VideoPlayer = ({
|
|
|
13546
14012
|
},
|
|
13547
14013
|
[showControlsWithTimer]
|
|
13548
14014
|
);
|
|
13549
|
-
const handleMouseEnter =
|
|
14015
|
+
const handleMouseEnter = useCallback8(() => {
|
|
13550
14016
|
showControlsWithTimer();
|
|
13551
14017
|
}, [showControlsWithTimer]);
|
|
13552
|
-
const handleMouseLeave =
|
|
14018
|
+
const handleMouseLeave = useCallback8(() => {
|
|
13553
14019
|
const userInteracting = isUserInteracting();
|
|
13554
14020
|
clearControlsTimeout();
|
|
13555
14021
|
if (!isFullscreen && !userInteracting) {
|
|
@@ -13558,13 +14024,13 @@ var VideoPlayer = ({
|
|
|
13558
14024
|
}, LEAVE_HIDE_TIMEOUT);
|
|
13559
14025
|
}
|
|
13560
14026
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
13561
|
-
|
|
14027
|
+
useEffect27(() => {
|
|
13562
14028
|
if (videoRef.current) {
|
|
13563
14029
|
videoRef.current.volume = volume;
|
|
13564
14030
|
videoRef.current.muted = isMuted;
|
|
13565
14031
|
}
|
|
13566
14032
|
}, [volume, isMuted]);
|
|
13567
|
-
|
|
14033
|
+
useEffect27(() => {
|
|
13568
14034
|
const video = videoRef.current;
|
|
13569
14035
|
if (!video) return;
|
|
13570
14036
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -13579,13 +14045,13 @@ var VideoPlayer = ({
|
|
|
13579
14045
|
video.removeEventListener("ended", onEnded);
|
|
13580
14046
|
};
|
|
13581
14047
|
}, []);
|
|
13582
|
-
|
|
14048
|
+
useEffect27(() => {
|
|
13583
14049
|
const video = videoRef.current;
|
|
13584
14050
|
if (!video) return;
|
|
13585
14051
|
video.setAttribute("playsinline", "");
|
|
13586
14052
|
video.setAttribute("webkit-playsinline", "");
|
|
13587
14053
|
}, []);
|
|
13588
|
-
|
|
14054
|
+
useEffect27(() => {
|
|
13589
14055
|
if (isPlaying) {
|
|
13590
14056
|
showControlsWithTimer();
|
|
13591
14057
|
} else {
|
|
@@ -13597,7 +14063,7 @@ var VideoPlayer = ({
|
|
|
13597
14063
|
}
|
|
13598
14064
|
}
|
|
13599
14065
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
13600
|
-
|
|
14066
|
+
useEffect27(() => {
|
|
13601
14067
|
const video = videoRef.current;
|
|
13602
14068
|
if (!video) return;
|
|
13603
14069
|
const handleFullscreenChange = () => {
|
|
@@ -13632,7 +14098,7 @@ var VideoPlayer = ({
|
|
|
13632
14098
|
);
|
|
13633
14099
|
};
|
|
13634
14100
|
}, [showControlsWithTimer]);
|
|
13635
|
-
|
|
14101
|
+
useEffect27(() => {
|
|
13636
14102
|
const init = () => {
|
|
13637
14103
|
if (!isFullscreen) {
|
|
13638
14104
|
showControlsWithTimer();
|
|
@@ -13654,7 +14120,7 @@ var VideoPlayer = ({
|
|
|
13654
14120
|
};
|
|
13655
14121
|
}
|
|
13656
14122
|
}, []);
|
|
13657
|
-
const getInitialTime =
|
|
14123
|
+
const getInitialTime = useCallback8(() => {
|
|
13658
14124
|
if (!autoSave || !storageKey) {
|
|
13659
14125
|
return Number.isFinite(initialTime) && initialTime >= 0 ? initialTime : void 0;
|
|
13660
14126
|
}
|
|
@@ -13667,14 +14133,14 @@ var VideoPlayer = ({
|
|
|
13667
14133
|
if (hasValidSaved) return saved;
|
|
13668
14134
|
return void 0;
|
|
13669
14135
|
}, [autoSave, storageKey, src, initialTime]);
|
|
13670
|
-
|
|
14136
|
+
useEffect27(() => {
|
|
13671
14137
|
const start = getInitialTime();
|
|
13672
14138
|
if (start !== void 0 && videoRef.current) {
|
|
13673
14139
|
videoRef.current.currentTime = start;
|
|
13674
14140
|
setCurrentTime(start);
|
|
13675
14141
|
}
|
|
13676
14142
|
}, [getInitialTime]);
|
|
13677
|
-
const saveProgress =
|
|
14143
|
+
const saveProgress = useCallback8(
|
|
13678
14144
|
(time) => {
|
|
13679
14145
|
if (!autoSave || !storageKey) return;
|
|
13680
14146
|
const now = Date.now();
|
|
@@ -13685,7 +14151,7 @@ var VideoPlayer = ({
|
|
|
13685
14151
|
},
|
|
13686
14152
|
[autoSave, storageKey, src]
|
|
13687
14153
|
);
|
|
13688
|
-
const togglePlayPause =
|
|
14154
|
+
const togglePlayPause = useCallback8(async () => {
|
|
13689
14155
|
const video = videoRef.current;
|
|
13690
14156
|
if (!video) return;
|
|
13691
14157
|
if (!video.paused) {
|
|
@@ -13697,7 +14163,7 @@ var VideoPlayer = ({
|
|
|
13697
14163
|
} catch {
|
|
13698
14164
|
}
|
|
13699
14165
|
}, []);
|
|
13700
|
-
const handleVolumeChange =
|
|
14166
|
+
const handleVolumeChange = useCallback8(
|
|
13701
14167
|
(newVolume) => {
|
|
13702
14168
|
const video = videoRef.current;
|
|
13703
14169
|
if (!video) return;
|
|
@@ -13716,7 +14182,7 @@ var VideoPlayer = ({
|
|
|
13716
14182
|
},
|
|
13717
14183
|
[isMuted]
|
|
13718
14184
|
);
|
|
13719
|
-
const toggleMute =
|
|
14185
|
+
const toggleMute = useCallback8(() => {
|
|
13720
14186
|
const video = videoRef.current;
|
|
13721
14187
|
if (!video) return;
|
|
13722
14188
|
if (isMuted) {
|
|
@@ -13730,20 +14196,20 @@ var VideoPlayer = ({
|
|
|
13730
14196
|
setIsMuted(true);
|
|
13731
14197
|
}
|
|
13732
14198
|
}, [isMuted, volume]);
|
|
13733
|
-
const handleSeek =
|
|
14199
|
+
const handleSeek = useCallback8((newTime) => {
|
|
13734
14200
|
const video = videoRef.current;
|
|
13735
14201
|
if (video) {
|
|
13736
14202
|
video.currentTime = newTime;
|
|
13737
14203
|
}
|
|
13738
14204
|
}, []);
|
|
13739
|
-
const isSafariIOS =
|
|
14205
|
+
const isSafariIOS = useCallback8(() => {
|
|
13740
14206
|
const ua = navigator.userAgent;
|
|
13741
14207
|
const isIOS = /iPad|iPhone|iPod/.test(ua);
|
|
13742
14208
|
const isWebKit = /WebKit/.test(ua);
|
|
13743
14209
|
const isNotChrome = !/CriOS|Chrome/.test(ua);
|
|
13744
14210
|
return isIOS && isWebKit && isNotChrome;
|
|
13745
14211
|
}, []);
|
|
13746
|
-
const toggleFullscreen =
|
|
14212
|
+
const toggleFullscreen = useCallback8(() => {
|
|
13747
14213
|
const video = videoRef.current;
|
|
13748
14214
|
const container = video?.parentElement;
|
|
13749
14215
|
if (!video || !container) return;
|
|
@@ -13760,24 +14226,24 @@ var VideoPlayer = ({
|
|
|
13760
14226
|
document.exitFullscreen();
|
|
13761
14227
|
}
|
|
13762
14228
|
}, [isFullscreen, isSafariIOS]);
|
|
13763
|
-
const handleSpeedChange =
|
|
14229
|
+
const handleSpeedChange = useCallback8((speed) => {
|
|
13764
14230
|
if (videoRef.current) {
|
|
13765
14231
|
videoRef.current.playbackRate = speed;
|
|
13766
14232
|
setPlaybackRate(speed);
|
|
13767
14233
|
setShowSpeedMenu(false);
|
|
13768
14234
|
}
|
|
13769
14235
|
}, []);
|
|
13770
|
-
const toggleSpeedMenu =
|
|
14236
|
+
const toggleSpeedMenu = useCallback8(() => {
|
|
13771
14237
|
setShowSpeedMenu(!showSpeedMenu);
|
|
13772
14238
|
}, [showSpeedMenu]);
|
|
13773
|
-
const toggleCaptions =
|
|
14239
|
+
const toggleCaptions = useCallback8(() => {
|
|
13774
14240
|
if (!trackRef.current?.track || !subtitles || subtitlesValidation !== "valid")
|
|
13775
14241
|
return;
|
|
13776
14242
|
const newShowCaptions = !showCaptions;
|
|
13777
14243
|
setShowCaptions(newShowCaptions);
|
|
13778
14244
|
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
13779
14245
|
}, [showCaptions, subtitles, subtitlesValidation]);
|
|
13780
|
-
const checkVideoCompletion =
|
|
14246
|
+
const checkVideoCompletion = useCallback8(
|
|
13781
14247
|
(progressPercent) => {
|
|
13782
14248
|
if (progressPercent >= 95 && !hasCompleted) {
|
|
13783
14249
|
setHasCompleted(true);
|
|
@@ -13786,7 +14252,7 @@ var VideoPlayer = ({
|
|
|
13786
14252
|
},
|
|
13787
14253
|
[hasCompleted, onVideoComplete]
|
|
13788
14254
|
);
|
|
13789
|
-
const handleTimeUpdate =
|
|
14255
|
+
const handleTimeUpdate = useCallback8(() => {
|
|
13790
14256
|
const video = videoRef.current;
|
|
13791
14257
|
if (!video) return;
|
|
13792
14258
|
const current = video.currentTime;
|
|
@@ -13799,12 +14265,12 @@ var VideoPlayer = ({
|
|
|
13799
14265
|
checkVideoCompletion(progressPercent);
|
|
13800
14266
|
}
|
|
13801
14267
|
}, [duration, saveProgress, onTimeUpdate, onProgress, checkVideoCompletion]);
|
|
13802
|
-
const handleLoadedMetadata =
|
|
14268
|
+
const handleLoadedMetadata = useCallback8(() => {
|
|
13803
14269
|
if (videoRef.current) {
|
|
13804
14270
|
setDuration(videoRef.current.duration);
|
|
13805
14271
|
}
|
|
13806
14272
|
}, []);
|
|
13807
|
-
|
|
14273
|
+
useEffect27(() => {
|
|
13808
14274
|
const controller = new AbortController();
|
|
13809
14275
|
const validateSubtitles = async () => {
|
|
13810
14276
|
if (!subtitles) {
|
|
@@ -13851,12 +14317,12 @@ var VideoPlayer = ({
|
|
|
13851
14317
|
controller.abort();
|
|
13852
14318
|
};
|
|
13853
14319
|
}, [subtitles]);
|
|
13854
|
-
|
|
14320
|
+
useEffect27(() => {
|
|
13855
14321
|
if (trackRef.current?.track) {
|
|
13856
14322
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
13857
14323
|
}
|
|
13858
14324
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
13859
|
-
|
|
14325
|
+
useEffect27(() => {
|
|
13860
14326
|
const handleVisibilityChange = () => {
|
|
13861
14327
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
13862
14328
|
videoRef.current.pause();
|
|
@@ -13878,54 +14344,54 @@ var VideoPlayer = ({
|
|
|
13878
14344
|
};
|
|
13879
14345
|
}, [isPlaying, clearControlsTimeout]);
|
|
13880
14346
|
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
13881
|
-
const getIconSize2 =
|
|
14347
|
+
const getIconSize2 = useCallback8(() => {
|
|
13882
14348
|
if (isTinyMobile) return 18;
|
|
13883
14349
|
if (isUltraSmallMobile) return 20;
|
|
13884
14350
|
return 24;
|
|
13885
14351
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
13886
|
-
const getControlsPadding =
|
|
14352
|
+
const getControlsPadding = useCallback8(() => {
|
|
13887
14353
|
if (isTinyMobile) return "px-2 pb-2 pt-1";
|
|
13888
14354
|
if (isUltraSmallMobile) return "px-3 pb-3 pt-1";
|
|
13889
14355
|
return "px-4 pb-4";
|
|
13890
14356
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
13891
|
-
const getControlsGap =
|
|
14357
|
+
const getControlsGap = useCallback8(() => {
|
|
13892
14358
|
if (isTinyMobile) return "gap-1";
|
|
13893
14359
|
if (isUltraSmallMobile) return "gap-2";
|
|
13894
14360
|
return "gap-4";
|
|
13895
14361
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
13896
|
-
const getProgressBarPadding =
|
|
14362
|
+
const getProgressBarPadding = useCallback8(() => {
|
|
13897
14363
|
if (isTinyMobile) return "px-2 pb-1";
|
|
13898
14364
|
if (isUltraSmallMobile) return "px-3 pb-1";
|
|
13899
14365
|
return "px-4 pb-2";
|
|
13900
14366
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
13901
|
-
const getCenterPlayButtonPosition =
|
|
14367
|
+
const getCenterPlayButtonPosition = useCallback8(() => {
|
|
13902
14368
|
if (isTinyMobile) return "items-center justify-center -translate-y-12";
|
|
13903
14369
|
if (isUltraSmallMobile) return "items-center justify-center -translate-y-8";
|
|
13904
14370
|
return "items-center justify-center";
|
|
13905
14371
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
13906
|
-
const getTopControlsOpacity =
|
|
14372
|
+
const getTopControlsOpacity = useCallback8(() => {
|
|
13907
14373
|
return showControls ? "opacity-100" : "opacity-0";
|
|
13908
14374
|
}, [showControls]);
|
|
13909
|
-
const getBottomControlsOpacity =
|
|
14375
|
+
const getBottomControlsOpacity = useCallback8(() => {
|
|
13910
14376
|
return showControls ? "opacity-100" : "opacity-0";
|
|
13911
14377
|
}, [showControls]);
|
|
13912
|
-
const seekBackward =
|
|
14378
|
+
const seekBackward = useCallback8(() => {
|
|
13913
14379
|
if (videoRef.current) {
|
|
13914
14380
|
videoRef.current.currentTime -= 10;
|
|
13915
14381
|
}
|
|
13916
14382
|
}, []);
|
|
13917
|
-
const seekForward =
|
|
14383
|
+
const seekForward = useCallback8(() => {
|
|
13918
14384
|
if (videoRef.current) {
|
|
13919
14385
|
videoRef.current.currentTime += 10;
|
|
13920
14386
|
}
|
|
13921
14387
|
}, []);
|
|
13922
|
-
const increaseVolume =
|
|
14388
|
+
const increaseVolume = useCallback8(() => {
|
|
13923
14389
|
handleVolumeChange(Math.min(100, volume * 100 + 10));
|
|
13924
14390
|
}, [handleVolumeChange, volume]);
|
|
13925
|
-
const decreaseVolume =
|
|
14391
|
+
const decreaseVolume = useCallback8(() => {
|
|
13926
14392
|
handleVolumeChange(Math.max(0, volume * 100 - 10));
|
|
13927
14393
|
}, [handleVolumeChange, volume]);
|
|
13928
|
-
const handleVideoKeyDown =
|
|
14394
|
+
const handleVideoKeyDown = useCallback8(
|
|
13929
14395
|
(e) => {
|
|
13930
14396
|
if (!e.key) return;
|
|
13931
14397
|
e.stopPropagation();
|
|
@@ -14168,7 +14634,7 @@ var VideoPlayer = ({
|
|
|
14168
14634
|
var VideoPlayer_default = VideoPlayer;
|
|
14169
14635
|
|
|
14170
14636
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
14171
|
-
import { useCallback as
|
|
14637
|
+
import { useCallback as useCallback9, useState as useState28 } from "react";
|
|
14172
14638
|
import { ArrowsOut } from "phosphor-react";
|
|
14173
14639
|
import { Fragment as Fragment13, jsx as jsx66, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
14174
14640
|
var IMAGE_WIDTH = 225;
|
|
@@ -14181,8 +14647,8 @@ var Whiteboard = ({
|
|
|
14181
14647
|
imagesPerRow = 2,
|
|
14182
14648
|
...rest
|
|
14183
14649
|
}) => {
|
|
14184
|
-
const [imageErrors, setImageErrors] =
|
|
14185
|
-
const handleDownload =
|
|
14650
|
+
const [imageErrors, setImageErrors] = useState28(/* @__PURE__ */ new Set());
|
|
14651
|
+
const handleDownload = useCallback9(
|
|
14186
14652
|
(image) => {
|
|
14187
14653
|
if (onDownload) {
|
|
14188
14654
|
onDownload(image);
|
|
@@ -14199,7 +14665,7 @@ var Whiteboard = ({
|
|
|
14199
14665
|
},
|
|
14200
14666
|
[onDownload]
|
|
14201
14667
|
);
|
|
14202
|
-
const handleImageError =
|
|
14668
|
+
const handleImageError = useCallback9((imageId) => {
|
|
14203
14669
|
setImageErrors((prev) => new Set(prev).add(imageId));
|
|
14204
14670
|
}, []);
|
|
14205
14671
|
const gridColsClass = images?.length === 1 ? "grid-cols-1" : {
|
|
@@ -14289,10 +14755,10 @@ var Whiteboard_default = Whiteboard;
|
|
|
14289
14755
|
import {
|
|
14290
14756
|
createContext,
|
|
14291
14757
|
useContext,
|
|
14292
|
-
useEffect as
|
|
14293
|
-
useState as
|
|
14294
|
-
useCallback as
|
|
14295
|
-
useMemo as
|
|
14758
|
+
useEffect as useEffect28,
|
|
14759
|
+
useState as useState29,
|
|
14760
|
+
useCallback as useCallback10,
|
|
14761
|
+
useMemo as useMemo13
|
|
14296
14762
|
} from "react";
|
|
14297
14763
|
import { useLocation, Navigate } from "react-router-dom";
|
|
14298
14764
|
import { Fragment as Fragment14, jsx as jsx67 } from "react/jsx-runtime";
|
|
@@ -14306,12 +14772,12 @@ var AuthProvider = ({
|
|
|
14306
14772
|
getSessionFn,
|
|
14307
14773
|
getTokensFn
|
|
14308
14774
|
}) => {
|
|
14309
|
-
const [authState, setAuthState] =
|
|
14775
|
+
const [authState, setAuthState] = useState29({
|
|
14310
14776
|
isAuthenticated: false,
|
|
14311
14777
|
isLoading: true,
|
|
14312
14778
|
...initialAuthState
|
|
14313
14779
|
});
|
|
14314
|
-
const checkAuth =
|
|
14780
|
+
const checkAuth = useCallback10(async () => {
|
|
14315
14781
|
try {
|
|
14316
14782
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
14317
14783
|
if (!checkAuthFn) {
|
|
@@ -14342,7 +14808,7 @@ var AuthProvider = ({
|
|
|
14342
14808
|
return false;
|
|
14343
14809
|
}
|
|
14344
14810
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
14345
|
-
const signOut =
|
|
14811
|
+
const signOut = useCallback10(() => {
|
|
14346
14812
|
if (signOutFn) {
|
|
14347
14813
|
signOutFn();
|
|
14348
14814
|
}
|
|
@@ -14354,10 +14820,10 @@ var AuthProvider = ({
|
|
|
14354
14820
|
tokens: void 0
|
|
14355
14821
|
}));
|
|
14356
14822
|
}, [signOutFn]);
|
|
14357
|
-
|
|
14823
|
+
useEffect28(() => {
|
|
14358
14824
|
checkAuth();
|
|
14359
14825
|
}, [checkAuth]);
|
|
14360
|
-
const contextValue =
|
|
14826
|
+
const contextValue = useMemo13(
|
|
14361
14827
|
() => ({
|
|
14362
14828
|
...authState,
|
|
14363
14829
|
checkAuth,
|
|
@@ -14508,7 +14974,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
14508
14974
|
}
|
|
14509
14975
|
|
|
14510
14976
|
// src/components/Auth/useUrlAuthentication.ts
|
|
14511
|
-
import { useEffect as
|
|
14977
|
+
import { useEffect as useEffect29, useRef as useRef17 } from "react";
|
|
14512
14978
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
14513
14979
|
var getAuthParams = (location, extractParams) => {
|
|
14514
14980
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -14556,8 +15022,8 @@ var handleUserData = (responseData, setUser) => {
|
|
|
14556
15022
|
};
|
|
14557
15023
|
function useUrlAuthentication(options) {
|
|
14558
15024
|
const location = useLocation2();
|
|
14559
|
-
const processedRef =
|
|
14560
|
-
|
|
15025
|
+
const processedRef = useRef17(false);
|
|
15026
|
+
useEffect29(() => {
|
|
14561
15027
|
const handleAuthentication = async () => {
|
|
14562
15028
|
if (processedRef.current) {
|
|
14563
15029
|
return;
|
|
@@ -14628,9 +15094,9 @@ function useUrlAuthentication(options) {
|
|
|
14628
15094
|
}
|
|
14629
15095
|
|
|
14630
15096
|
// src/components/Auth/useApiConfig.ts
|
|
14631
|
-
import { useMemo as
|
|
15097
|
+
import { useMemo as useMemo14 } from "react";
|
|
14632
15098
|
function useApiConfig(api) {
|
|
14633
|
-
return
|
|
15099
|
+
return useMemo14(
|
|
14634
15100
|
() => ({
|
|
14635
15101
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
14636
15102
|
}),
|
|
@@ -14648,23 +15114,23 @@ import {
|
|
|
14648
15114
|
} from "phosphor-react";
|
|
14649
15115
|
import {
|
|
14650
15116
|
forwardRef as forwardRef22,
|
|
14651
|
-
useEffect as
|
|
14652
|
-
useState as
|
|
15117
|
+
useEffect as useEffect32,
|
|
15118
|
+
useState as useState32
|
|
14653
15119
|
} from "react";
|
|
14654
15120
|
|
|
14655
15121
|
// src/components/Quiz/QuizContent.tsx
|
|
14656
15122
|
import {
|
|
14657
15123
|
forwardRef as forwardRef21,
|
|
14658
|
-
useCallback as
|
|
14659
|
-
useEffect as
|
|
15124
|
+
useCallback as useCallback11,
|
|
15125
|
+
useEffect as useEffect31,
|
|
14660
15126
|
useId as useId11,
|
|
14661
|
-
useMemo as
|
|
14662
|
-
useRef as
|
|
14663
|
-
useState as
|
|
15127
|
+
useMemo as useMemo15,
|
|
15128
|
+
useRef as useRef18,
|
|
15129
|
+
useState as useState31
|
|
14664
15130
|
} from "react";
|
|
14665
15131
|
|
|
14666
15132
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
14667
|
-
import { useEffect as
|
|
15133
|
+
import { useEffect as useEffect30, useState as useState30 } from "react";
|
|
14668
15134
|
import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check5 } from "phosphor-react";
|
|
14669
15135
|
import { jsx as jsx68, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
14670
15136
|
var MultipleChoiceList = ({
|
|
@@ -14676,8 +15142,8 @@ var MultipleChoiceList = ({
|
|
|
14676
15142
|
onHandleSelectedValues,
|
|
14677
15143
|
mode = "interactive"
|
|
14678
15144
|
}) => {
|
|
14679
|
-
const [actualValue, setActualValue] =
|
|
14680
|
-
|
|
15145
|
+
const [actualValue, setActualValue] = useState30(selectedValues);
|
|
15146
|
+
useEffect30(() => {
|
|
14681
15147
|
setActualValue(selectedValues);
|
|
14682
15148
|
}, [selectedValues]);
|
|
14683
15149
|
const getStatusBadge2 = (status) => {
|
|
@@ -14916,15 +15382,15 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
14916
15382
|
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
14917
15383
|
currentQuestion?.id || ""
|
|
14918
15384
|
);
|
|
14919
|
-
const prevSelectedValuesRef =
|
|
14920
|
-
const prevQuestionIdRef =
|
|
14921
|
-
const allCurrentAnswerIds =
|
|
15385
|
+
const prevSelectedValuesRef = useRef18([]);
|
|
15386
|
+
const prevQuestionIdRef = useRef18("");
|
|
15387
|
+
const allCurrentAnswerIds = useMemo15(() => {
|
|
14922
15388
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
14923
15389
|
}, [allCurrentAnswers]);
|
|
14924
|
-
const selectedValues =
|
|
15390
|
+
const selectedValues = useMemo15(() => {
|
|
14925
15391
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
14926
15392
|
}, [allCurrentAnswerIds]);
|
|
14927
|
-
const stableSelectedValues =
|
|
15393
|
+
const stableSelectedValues = useMemo15(() => {
|
|
14928
15394
|
const currentQuestionId = currentQuestion?.id || "";
|
|
14929
15395
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
14930
15396
|
if (hasQuestionChanged) {
|
|
@@ -14948,7 +15414,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
14948
15414
|
variant,
|
|
14949
15415
|
currentQuestionResult?.selectedOptions
|
|
14950
15416
|
]);
|
|
14951
|
-
const handleSelectedValues =
|
|
15417
|
+
const handleSelectedValues = useCallback11(
|
|
14952
15418
|
(values) => {
|
|
14953
15419
|
if (currentQuestion) {
|
|
14954
15420
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -14956,7 +15422,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
14956
15422
|
},
|
|
14957
15423
|
[currentQuestion, selectMultipleAnswer]
|
|
14958
15424
|
);
|
|
14959
|
-
const questionKey =
|
|
15425
|
+
const questionKey = useMemo15(
|
|
14960
15426
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
14961
15427
|
[currentQuestion?.id]
|
|
14962
15428
|
);
|
|
@@ -15017,14 +15483,14 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
15017
15483
|
currentQuestion?.id || ""
|
|
15018
15484
|
);
|
|
15019
15485
|
const currentAnswer = getCurrentAnswer();
|
|
15020
|
-
const textareaRef =
|
|
15486
|
+
const textareaRef = useRef18(null);
|
|
15021
15487
|
const charLimit = getDissertativeCharLimit();
|
|
15022
15488
|
const handleAnswerChange = (value) => {
|
|
15023
15489
|
if (currentQuestion) {
|
|
15024
15490
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
15025
15491
|
}
|
|
15026
15492
|
};
|
|
15027
|
-
const adjustTextareaHeight =
|
|
15493
|
+
const adjustTextareaHeight = useCallback11(() => {
|
|
15028
15494
|
if (textareaRef.current) {
|
|
15029
15495
|
textareaRef.current.style.height = "auto";
|
|
15030
15496
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -15034,7 +15500,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
15034
15500
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
15035
15501
|
}
|
|
15036
15502
|
}, []);
|
|
15037
|
-
|
|
15503
|
+
useEffect31(() => {
|
|
15038
15504
|
adjustTextareaHeight();
|
|
15039
15505
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
15040
15506
|
if (!currentQuestion) {
|
|
@@ -15175,7 +15641,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
15175
15641
|
isCorrect: false
|
|
15176
15642
|
}
|
|
15177
15643
|
];
|
|
15178
|
-
const [userAnswers, setUserAnswers] =
|
|
15644
|
+
const [userAnswers, setUserAnswers] = useState31(() => {
|
|
15179
15645
|
if (variant === "result") {
|
|
15180
15646
|
return mockUserAnswers;
|
|
15181
15647
|
}
|
|
@@ -15294,7 +15760,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
15294
15760
|
isCorrect: true
|
|
15295
15761
|
}
|
|
15296
15762
|
];
|
|
15297
|
-
const [answers, setAnswers] =
|
|
15763
|
+
const [answers, setAnswers] = useState31({});
|
|
15298
15764
|
const baseId = useId11();
|
|
15299
15765
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
15300
15766
|
const usedOptions = new Set(
|
|
@@ -15434,7 +15900,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
15434
15900
|
};
|
|
15435
15901
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
15436
15902
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
15437
|
-
const [clickPositionRelative, setClickPositionRelative] =
|
|
15903
|
+
const [clickPositionRelative, setClickPositionRelative] = useState31(variant == "result" ? mockUserAnswerRelative : null);
|
|
15438
15904
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
15439
15905
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
15440
15906
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -15602,7 +16068,7 @@ var getFinishConfirmationText = (type) => {
|
|
|
15602
16068
|
};
|
|
15603
16069
|
var Quiz = forwardRef22(({ children, className, variant = "default", ...props }, ref) => {
|
|
15604
16070
|
const { setVariant } = useQuizStore();
|
|
15605
|
-
|
|
16071
|
+
useEffect32(() => {
|
|
15606
16072
|
setVariant(variant);
|
|
15607
16073
|
}, [variant, setVariant]);
|
|
15608
16074
|
return /* @__PURE__ */ jsx70("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
@@ -15617,7 +16083,7 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
|
15617
16083
|
formatTime: formatTime2,
|
|
15618
16084
|
isStarted
|
|
15619
16085
|
} = useQuizStore();
|
|
15620
|
-
const [showExitConfirmation, setShowExitConfirmation] =
|
|
16086
|
+
const [showExitConfirmation, setShowExitConfirmation] = useState32(false);
|
|
15621
16087
|
const totalQuestions = getTotalQuestions();
|
|
15622
16088
|
const quizTitle = getQuizTitle();
|
|
15623
16089
|
const handleBackClick = () => {
|
|
@@ -15820,8 +16286,8 @@ var QuizFooter = forwardRef22(
|
|
|
15820
16286
|
const currentAnswer = getCurrentAnswer();
|
|
15821
16287
|
const currentQuestion = getCurrentQuestion();
|
|
15822
16288
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
15823
|
-
const [activeModal, setActiveModal] =
|
|
15824
|
-
const [filterType, setFilterType] =
|
|
16289
|
+
const [activeModal, setActiveModal] = useState32(null);
|
|
16290
|
+
const [filterType, setFilterType] = useState32("all");
|
|
15825
16291
|
const openModal = (modalName) => setActiveModal(modalName);
|
|
15826
16292
|
const closeModal = () => setActiveModal(null);
|
|
15827
16293
|
const isModalOpen = (modalName) => activeModal === modalName;
|
|
@@ -16163,7 +16629,7 @@ var QuizFooter = forwardRef22(
|
|
|
16163
16629
|
);
|
|
16164
16630
|
|
|
16165
16631
|
// src/components/Quiz/QuizResult.tsx
|
|
16166
|
-
import { forwardRef as forwardRef23, useEffect as
|
|
16632
|
+
import { forwardRef as forwardRef23, useEffect as useEffect33, useState as useState33 } from "react";
|
|
16167
16633
|
import { Clock as Clock3 } from "phosphor-react";
|
|
16168
16634
|
import { jsx as jsx71, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
16169
16635
|
var QuizBadge = ({
|
|
@@ -16192,8 +16658,8 @@ var QuizHeaderResult = forwardRef23(
|
|
|
16192
16658
|
getCurrentQuestion,
|
|
16193
16659
|
questionsResult
|
|
16194
16660
|
} = useQuizStore();
|
|
16195
|
-
const [status, setStatus] =
|
|
16196
|
-
|
|
16661
|
+
const [status, setStatus] = useState33(void 0);
|
|
16662
|
+
useEffect33(() => {
|
|
16197
16663
|
const cq = getCurrentQuestion();
|
|
16198
16664
|
if (!cq) {
|
|
16199
16665
|
setStatus(void 0);
|
|
@@ -16566,7 +17032,7 @@ var BreadcrumbMenu = ({
|
|
|
16566
17032
|
};
|
|
16567
17033
|
|
|
16568
17034
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
16569
|
-
import { useEffect as
|
|
17035
|
+
import { useEffect as useEffect34 } from "react";
|
|
16570
17036
|
|
|
16571
17037
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
16572
17038
|
import { create as create12 } from "zustand";
|
|
@@ -16695,7 +17161,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
16695
17161
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
16696
17162
|
);
|
|
16697
17163
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
16698
|
-
|
|
17164
|
+
useEffect34(() => {
|
|
16699
17165
|
const newBreadcrumbs = [root];
|
|
16700
17166
|
const previousIds = [];
|
|
16701
17167
|
for (const level of levels) {
|
|
@@ -16727,11 +17193,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
16727
17193
|
};
|
|
16728
17194
|
|
|
16729
17195
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
16730
|
-
import { useMemo as
|
|
17196
|
+
import { useMemo as useMemo16 } from "react";
|
|
16731
17197
|
import { useLocation as useLocation3 } from "react-router-dom";
|
|
16732
17198
|
var useUrlParams = (config) => {
|
|
16733
17199
|
const location = useLocation3();
|
|
16734
|
-
return
|
|
17200
|
+
return useMemo16(() => {
|
|
16735
17201
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
16736
17202
|
const params = {};
|
|
16737
17203
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -16742,15 +17208,15 @@ var useUrlParams = (config) => {
|
|
|
16742
17208
|
};
|
|
16743
17209
|
|
|
16744
17210
|
// src/hooks/useAppInitialization.ts
|
|
16745
|
-
import { useMemo as
|
|
17211
|
+
import { useMemo as useMemo17 } from "react";
|
|
16746
17212
|
|
|
16747
17213
|
// src/hooks/useInstitution.ts
|
|
16748
|
-
import { useEffect as
|
|
17214
|
+
import { useEffect as useEffect35, useState as useState34 } from "react";
|
|
16749
17215
|
function useInstitutionId() {
|
|
16750
|
-
const [institutionId, setInstitutionId] =
|
|
17216
|
+
const [institutionId, setInstitutionId] = useState34(() => {
|
|
16751
17217
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
16752
17218
|
});
|
|
16753
|
-
|
|
17219
|
+
useEffect35(() => {
|
|
16754
17220
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
16755
17221
|
if (!metaTag) return;
|
|
16756
17222
|
const observer = new MutationObserver(() => {
|
|
@@ -16917,7 +17383,7 @@ var useAuthStore = create14()(
|
|
|
16917
17383
|
function useAppInitialization() {
|
|
16918
17384
|
const getInstitutionId = useInstitutionId();
|
|
16919
17385
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
16920
|
-
const authFunctions =
|
|
17386
|
+
const authFunctions = useMemo17(
|
|
16921
17387
|
() => ({
|
|
16922
17388
|
checkAuth: async () => {
|
|
16923
17389
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -16954,7 +17420,7 @@ function useAppInitialization() {
|
|
|
16954
17420
|
}
|
|
16955
17421
|
|
|
16956
17422
|
// src/hooks/useAppContent.ts
|
|
16957
|
-
import { useCallback as
|
|
17423
|
+
import { useCallback as useCallback12, useEffect as useEffect36, useMemo as useMemo18 } from "react";
|
|
16958
17424
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
16959
17425
|
function useAppContent(config) {
|
|
16960
17426
|
const navigate = useNavigate2();
|
|
@@ -16980,20 +17446,20 @@ function useAppContent(config) {
|
|
|
16980
17446
|
navigate("/painel");
|
|
16981
17447
|
}
|
|
16982
17448
|
};
|
|
16983
|
-
const handleSetSelectedProfile =
|
|
17449
|
+
const handleSetSelectedProfile = useCallback12(
|
|
16984
17450
|
(profile) => {
|
|
16985
17451
|
setSelectedProfile(profile);
|
|
16986
17452
|
},
|
|
16987
17453
|
[setSelectedProfile]
|
|
16988
17454
|
);
|
|
16989
|
-
const handleClearParamsFromURL =
|
|
17455
|
+
const handleClearParamsFromURL = useCallback12(() => {
|
|
16990
17456
|
if (onClearParamsFromURL) {
|
|
16991
17457
|
onClearParamsFromURL();
|
|
16992
17458
|
} else {
|
|
16993
17459
|
globalThis.location.replace("/painel");
|
|
16994
17460
|
}
|
|
16995
17461
|
}, [onClearParamsFromURL]);
|
|
16996
|
-
const handleError =
|
|
17462
|
+
const handleError = useCallback12(
|
|
16997
17463
|
(error) => {
|
|
16998
17464
|
if (onError) {
|
|
16999
17465
|
onError(error);
|
|
@@ -17004,7 +17470,7 @@ function useAppContent(config) {
|
|
|
17004
17470
|
},
|
|
17005
17471
|
[navigate, onError]
|
|
17006
17472
|
);
|
|
17007
|
-
const urlAuthConfig =
|
|
17473
|
+
const urlAuthConfig = useMemo18(
|
|
17008
17474
|
() => ({
|
|
17009
17475
|
setTokens,
|
|
17010
17476
|
setSessionInfo,
|
|
@@ -17030,10 +17496,10 @@ function useAppContent(config) {
|
|
|
17030
17496
|
);
|
|
17031
17497
|
useUrlAuthentication(urlAuthConfig);
|
|
17032
17498
|
const { sessionInfo } = useAuth();
|
|
17033
|
-
const institutionIdToUse =
|
|
17499
|
+
const institutionIdToUse = useMemo18(() => {
|
|
17034
17500
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
17035
17501
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
17036
|
-
|
|
17502
|
+
useEffect36(() => {
|
|
17037
17503
|
if (institutionIdToUse && !initialized) {
|
|
17038
17504
|
initialize(institutionIdToUse);
|
|
17039
17505
|
}
|
|
@@ -17045,9 +17511,30 @@ function useAppContent(config) {
|
|
|
17045
17511
|
};
|
|
17046
17512
|
}
|
|
17047
17513
|
|
|
17514
|
+
// src/store/questionFiltersStore.ts
|
|
17515
|
+
import { create as create15 } from "zustand";
|
|
17516
|
+
var useQuestionFiltersStore = create15((set) => ({
|
|
17517
|
+
draftFilters: null,
|
|
17518
|
+
appliedFilters: null,
|
|
17519
|
+
setDraftFilters: (filters) => {
|
|
17520
|
+
set({ draftFilters: filters });
|
|
17521
|
+
},
|
|
17522
|
+
applyFilters: () => {
|
|
17523
|
+
set((state) => ({
|
|
17524
|
+
appliedFilters: state.draftFilters
|
|
17525
|
+
}));
|
|
17526
|
+
},
|
|
17527
|
+
clearFilters: () => {
|
|
17528
|
+
set({
|
|
17529
|
+
draftFilters: null,
|
|
17530
|
+
appliedFilters: null
|
|
17531
|
+
});
|
|
17532
|
+
}
|
|
17533
|
+
}));
|
|
17534
|
+
|
|
17048
17535
|
// src/components/ActivityCardQuestionBanks/ActivityCardQuestionBanks.tsx
|
|
17049
17536
|
import { Plus as Plus2, CheckCircle as CheckCircle7, XCircle as XCircle6 } from "phosphor-react";
|
|
17050
|
-
import { useMemo as
|
|
17537
|
+
import { useMemo as useMemo19 } from "react";
|
|
17051
17538
|
import { jsx as jsx73, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
17052
17539
|
var ActivityCardQuestionBanks = ({
|
|
17053
17540
|
question,
|
|
@@ -17059,7 +17546,7 @@ var ActivityCardQuestionBanks = ({
|
|
|
17059
17546
|
assunto,
|
|
17060
17547
|
enunciado
|
|
17061
17548
|
} = {}) => {
|
|
17062
|
-
const alternatives =
|
|
17549
|
+
const alternatives = useMemo19(() => {
|
|
17063
17550
|
if (!question?.options || questionType !== "ALTERNATIVA" /* ALTERNATIVA */)
|
|
17064
17551
|
return [];
|
|
17065
17552
|
const correctOptionIds2 = question.correctOptionIds || [];
|
|
@@ -17073,13 +17560,13 @@ var ActivityCardQuestionBanks = ({
|
|
|
17073
17560
|
};
|
|
17074
17561
|
});
|
|
17075
17562
|
}, [question, questionType]);
|
|
17076
|
-
const correctOptionId =
|
|
17563
|
+
const correctOptionId = useMemo19(() => {
|
|
17077
17564
|
if (!question?.correctOptionIds || question.correctOptionIds.length === 0) {
|
|
17078
17565
|
return void 0;
|
|
17079
17566
|
}
|
|
17080
17567
|
return question.correctOptionIds[0];
|
|
17081
17568
|
}, [question]);
|
|
17082
|
-
const multipleChoices =
|
|
17569
|
+
const multipleChoices = useMemo19(() => {
|
|
17083
17570
|
if (!question?.options || questionType !== "MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */)
|
|
17084
17571
|
return [];
|
|
17085
17572
|
const correctOptionIds2 = question.correctOptionIds || [];
|
|
@@ -17093,7 +17580,7 @@ var ActivityCardQuestionBanks = ({
|
|
|
17093
17580
|
};
|
|
17094
17581
|
});
|
|
17095
17582
|
}, [question, questionType]);
|
|
17096
|
-
const correctOptionIds =
|
|
17583
|
+
const correctOptionIds = useMemo19(() => {
|
|
17097
17584
|
return question?.correctOptionIds || [];
|
|
17098
17585
|
}, [question]);
|
|
17099
17586
|
const getStatusBadge2 = (status) => {
|
|
@@ -17276,7 +17763,7 @@ var formatDateToBrazilian = (dateString) => {
|
|
|
17276
17763
|
};
|
|
17277
17764
|
|
|
17278
17765
|
// src/components/ActivityDetails/ActivityDetails.tsx
|
|
17279
|
-
import { useState as
|
|
17766
|
+
import { useState as useState35, useMemo as useMemo20, useCallback as useCallback13, useEffect as useEffect37 } from "react";
|
|
17280
17767
|
import { Medal as Medal2, Star as Star2, File as File2, CaretRight as CaretRight9, WarningCircle as WarningCircle7 } from "phosphor-react";
|
|
17281
17768
|
import { Fragment as Fragment17, jsx as jsx74, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
17282
17769
|
var createTableColumns = (onCorrectActivity) => [
|
|
@@ -17374,20 +17861,20 @@ var ActivityDetails = ({
|
|
|
17374
17861
|
mapSubjectNameToEnum
|
|
17375
17862
|
}) => {
|
|
17376
17863
|
const { isMobile } = useMobile();
|
|
17377
|
-
const [page, setPage] =
|
|
17378
|
-
const [limit, setLimit] =
|
|
17379
|
-
const [sortBy, setSortBy] =
|
|
17380
|
-
const [sortOrder, setSortOrder] =
|
|
17864
|
+
const [page, setPage] = useState35(1);
|
|
17865
|
+
const [limit, setLimit] = useState35(10);
|
|
17866
|
+
const [sortBy, setSortBy] = useState35(void 0);
|
|
17867
|
+
const [sortOrder, setSortOrder] = useState35(
|
|
17381
17868
|
void 0
|
|
17382
17869
|
);
|
|
17383
|
-
const [data, setData] =
|
|
17384
|
-
const [correctionData, setCorrectionData] =
|
|
17385
|
-
const [loading, setLoading] =
|
|
17386
|
-
const [error, setError] =
|
|
17387
|
-
const [isModalOpen, setIsModalOpen] =
|
|
17388
|
-
const [isViewOnlyModal, setIsViewOnlyModal] =
|
|
17389
|
-
const [correctionError, setCorrectionError] =
|
|
17390
|
-
|
|
17870
|
+
const [data, setData] = useState35(null);
|
|
17871
|
+
const [correctionData, setCorrectionData] = useState35(null);
|
|
17872
|
+
const [loading, setLoading] = useState35(true);
|
|
17873
|
+
const [error, setError] = useState35(null);
|
|
17874
|
+
const [isModalOpen, setIsModalOpen] = useState35(false);
|
|
17875
|
+
const [isViewOnlyModal, setIsViewOnlyModal] = useState35(false);
|
|
17876
|
+
const [correctionError, setCorrectionError] = useState35(null);
|
|
17877
|
+
useEffect37(() => {
|
|
17391
17878
|
const loadData = async () => {
|
|
17392
17879
|
if (!activityId) return;
|
|
17393
17880
|
setLoading(true);
|
|
@@ -17410,7 +17897,7 @@ var ActivityDetails = ({
|
|
|
17410
17897
|
};
|
|
17411
17898
|
loadData();
|
|
17412
17899
|
}, [activityId, page, limit, sortBy, sortOrder, fetchActivityDetails]);
|
|
17413
|
-
const handleCorrectActivity =
|
|
17900
|
+
const handleCorrectActivity = useCallback13(
|
|
17414
17901
|
async (studentId) => {
|
|
17415
17902
|
const student = data?.students.find((s) => s.studentId === studentId);
|
|
17416
17903
|
if (!student || !activityId) return;
|
|
@@ -17430,10 +17917,10 @@ var ActivityDetails = ({
|
|
|
17430
17917
|
},
|
|
17431
17918
|
[data?.students, activityId, fetchStudentCorrection]
|
|
17432
17919
|
);
|
|
17433
|
-
const handleCloseModal =
|
|
17920
|
+
const handleCloseModal = useCallback13(() => {
|
|
17434
17921
|
setIsModalOpen(false);
|
|
17435
17922
|
}, []);
|
|
17436
|
-
const handleObservationSubmit =
|
|
17923
|
+
const handleObservationSubmit = useCallback13(
|
|
17437
17924
|
async (observation, files) => {
|
|
17438
17925
|
if (!activityId || !correctionData?.studentId) return;
|
|
17439
17926
|
try {
|
|
@@ -17450,7 +17937,7 @@ var ActivityDetails = ({
|
|
|
17450
17937
|
},
|
|
17451
17938
|
[activityId, correctionData?.studentId, submitObservation]
|
|
17452
17939
|
);
|
|
17453
|
-
const tableData =
|
|
17940
|
+
const tableData = useMemo20(() => {
|
|
17454
17941
|
if (!data?.students) return [];
|
|
17455
17942
|
return data.students.map((student) => ({
|
|
17456
17943
|
id: student.studentId,
|
|
@@ -17462,7 +17949,7 @@ var ActivityDetails = ({
|
|
|
17462
17949
|
score: student.score
|
|
17463
17950
|
}));
|
|
17464
17951
|
}, [data?.students]);
|
|
17465
|
-
const columns =
|
|
17952
|
+
const columns = useMemo20(
|
|
17466
17953
|
() => createTableColumns(handleCorrectActivity),
|
|
17467
17954
|
[handleCorrectActivity]
|
|
17468
17955
|
);
|
|
@@ -17719,7 +18206,7 @@ var ActivityDetails = ({
|
|
|
17719
18206
|
};
|
|
17720
18207
|
|
|
17721
18208
|
// src/components/Support/Support.tsx
|
|
17722
|
-
import { useState as
|
|
18209
|
+
import { useState as useState37, useEffect as useEffect39 } from "react";
|
|
17723
18210
|
import { useForm } from "react-hook-form";
|
|
17724
18211
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
17725
18212
|
import {
|
|
@@ -17750,9 +18237,9 @@ var supportSchema = z.object({
|
|
|
17750
18237
|
});
|
|
17751
18238
|
|
|
17752
18239
|
// src/components/Support/components/TicketModal.tsx
|
|
17753
|
-
|
|
17754
|
-
import { useState as useState35, useEffect as useEffect37, useCallback as useCallback13 } from "react";
|
|
18240
|
+
import { useState as useState36, useEffect as useEffect38, useCallback as useCallback14 } from "react";
|
|
17755
18241
|
import dayjs from "dayjs";
|
|
18242
|
+
import "dayjs/locale/pt-br";
|
|
17756
18243
|
|
|
17757
18244
|
// src/types/support.ts
|
|
17758
18245
|
var SupportStatus = /* @__PURE__ */ ((SupportStatus2) => {
|
|
@@ -17872,17 +18359,17 @@ var TicketModal = ({
|
|
|
17872
18359
|
apiClient,
|
|
17873
18360
|
userId
|
|
17874
18361
|
}) => {
|
|
17875
|
-
const [showCloseConfirmation, setShowCloseConfirmation] =
|
|
17876
|
-
const [responseText, setResponseText] =
|
|
17877
|
-
const [answers, setAnswers] =
|
|
17878
|
-
const [isSubmittingAnswer, setIsSubmittingAnswer] =
|
|
17879
|
-
const [isLoadingAnswers, setIsLoadingAnswers] =
|
|
18362
|
+
const [showCloseConfirmation, setShowCloseConfirmation] = useState36(false);
|
|
18363
|
+
const [responseText, setResponseText] = useState36("");
|
|
18364
|
+
const [answers, setAnswers] = useState36([]);
|
|
18365
|
+
const [isSubmittingAnswer, setIsSubmittingAnswer] = useState36(false);
|
|
18366
|
+
const [isLoadingAnswers, setIsLoadingAnswers] = useState36(false);
|
|
17880
18367
|
const handleCloseTicket = () => {
|
|
17881
18368
|
onTicketClose?.(ticket.id);
|
|
17882
18369
|
setShowCloseConfirmation(false);
|
|
17883
18370
|
onClose();
|
|
17884
18371
|
};
|
|
17885
|
-
const fetchAnswers =
|
|
18372
|
+
const fetchAnswers = useCallback14(async () => {
|
|
17886
18373
|
if (!ticket.id || ticket.status !== "respondido" /* RESPONDIDO */) return;
|
|
17887
18374
|
setIsLoadingAnswers(true);
|
|
17888
18375
|
try {
|
|
@@ -17921,7 +18408,7 @@ var TicketModal = ({
|
|
|
17921
18408
|
}
|
|
17922
18409
|
};
|
|
17923
18410
|
const canCloseTicket = ticket.status !== "encerrado" /* ENCERRADO */;
|
|
17924
|
-
|
|
18411
|
+
useEffect38(() => {
|
|
17925
18412
|
if (isOpen) {
|
|
17926
18413
|
setResponseText("");
|
|
17927
18414
|
(async () => {
|
|
@@ -18304,21 +18791,21 @@ var Support = ({
|
|
|
18304
18791
|
onTicketCreated,
|
|
18305
18792
|
onTicketClosed
|
|
18306
18793
|
}) => {
|
|
18307
|
-
const [activeTab, setActiveTab] =
|
|
18308
|
-
const [selectedProblem, setSelectedProblem] =
|
|
18309
|
-
const [statusFilter, setStatusFilter] =
|
|
18310
|
-
const [categoryFilter, setCategoryFilter] =
|
|
18311
|
-
const [selectedTicket, setSelectedTicket] =
|
|
18794
|
+
const [activeTab, setActiveTab] = useState37("criar-pedido");
|
|
18795
|
+
const [selectedProblem, setSelectedProblem] = useState37(null);
|
|
18796
|
+
const [statusFilter, setStatusFilter] = useState37("todos");
|
|
18797
|
+
const [categoryFilter, setCategoryFilter] = useState37("todos");
|
|
18798
|
+
const [selectedTicket, setSelectedTicket] = useState37(
|
|
18312
18799
|
null
|
|
18313
18800
|
);
|
|
18314
|
-
const [isModalOpen, setIsModalOpen] =
|
|
18315
|
-
const [submitError, setSubmitError] =
|
|
18316
|
-
const [showSuccessToast, setShowSuccessToast] =
|
|
18317
|
-
const [showCloseSuccessToast, setShowCloseSuccessToast] =
|
|
18318
|
-
const [showCloseErrorToast, setShowCloseErrorToast] =
|
|
18319
|
-
const [allTickets, setAllTickets] =
|
|
18320
|
-
const [loadingTickets, setLoadingTickets] =
|
|
18321
|
-
const [currentPage, setCurrentPage] =
|
|
18801
|
+
const [isModalOpen, setIsModalOpen] = useState37(false);
|
|
18802
|
+
const [submitError, setSubmitError] = useState37(null);
|
|
18803
|
+
const [showSuccessToast, setShowSuccessToast] = useState37(false);
|
|
18804
|
+
const [showCloseSuccessToast, setShowCloseSuccessToast] = useState37(false);
|
|
18805
|
+
const [showCloseErrorToast, setShowCloseErrorToast] = useState37(false);
|
|
18806
|
+
const [allTickets, setAllTickets] = useState37([]);
|
|
18807
|
+
const [loadingTickets, setLoadingTickets] = useState37(false);
|
|
18808
|
+
const [currentPage, setCurrentPage] = useState37(1);
|
|
18322
18809
|
const ITEMS_PER_PAGE = 10;
|
|
18323
18810
|
const handlePrevPage = () => {
|
|
18324
18811
|
if (currentPage > 1) {
|
|
@@ -18331,13 +18818,13 @@ var Support = ({
|
|
|
18331
18818
|
setCurrentPage(currentPage + 1);
|
|
18332
18819
|
}
|
|
18333
18820
|
};
|
|
18334
|
-
|
|
18821
|
+
useEffect39(() => {
|
|
18335
18822
|
if (activeTab === "historico") {
|
|
18336
18823
|
fetchTickets(statusFilter);
|
|
18337
18824
|
setCurrentPage(1);
|
|
18338
18825
|
}
|
|
18339
18826
|
}, [activeTab, statusFilter]);
|
|
18340
|
-
|
|
18827
|
+
useEffect39(() => {
|
|
18341
18828
|
setCurrentPage(1);
|
|
18342
18829
|
}, [categoryFilter]);
|
|
18343
18830
|
const convertApiTicketToComponent = (apiTicket) => {
|
|
@@ -18847,8 +19334,10 @@ export {
|
|
|
18847
19334
|
VideoPlayer_default as VideoPlayer,
|
|
18848
19335
|
Whiteboard_default as Whiteboard,
|
|
18849
19336
|
cn,
|
|
19337
|
+
createActivityFiltersDataHook,
|
|
18850
19338
|
createNotificationStore,
|
|
18851
19339
|
createNotificationsHook,
|
|
19340
|
+
createUseActivityFiltersData,
|
|
18852
19341
|
createUseNotificationStore,
|
|
18853
19342
|
createUseNotifications,
|
|
18854
19343
|
createZustandAuthAdapter,
|
|
@@ -18892,6 +19381,7 @@ export {
|
|
|
18892
19381
|
useBreadcrumbBuilder,
|
|
18893
19382
|
useInstitutionId,
|
|
18894
19383
|
useMobile,
|
|
19384
|
+
useQuestionFiltersStore,
|
|
18895
19385
|
useQuizStore,
|
|
18896
19386
|
useRouteAuth,
|
|
18897
19387
|
useTableFilter,
|