analytica-frontend-lib 1.2.18 → 1.2.21
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/AlertManager/index.css +10 -0
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/AlertManager/index.d.mts +2 -1
- package/dist/AlertManager/index.d.ts +2 -1
- package/dist/AlertManager/index.js +49 -5
- package/dist/AlertManager/index.js.map +1 -1
- package/dist/AlertManager/index.mjs +49 -5
- package/dist/AlertManager/index.mjs.map +1 -1
- package/dist/AlertManagerView/index.d.mts +2 -1
- package/dist/AlertManagerView/index.d.ts +2 -1
- package/dist/CheckBoxGroup-9n5C0OH4.d.mts +24 -0
- package/dist/CheckBoxGroup-9n5C0OH4.d.ts +24 -0
- package/dist/DropdownMenu/index.d.mts +7 -1
- package/dist/DropdownMenu/index.d.ts +7 -1
- package/dist/DropdownMenu/index.js +51 -5
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +50 -5
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +49 -5
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +49 -5
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/Radio/index.d.mts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Search/index.js +49 -5
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/index.mjs +49 -5
- package/dist/Search/index.mjs.map +1 -1
- package/dist/TableProvider/index.css +19143 -0
- package/dist/TableProvider/index.css.map +1 -0
- package/dist/TableProvider/index.d.mts +4 -0
- package/dist/TableProvider/index.d.ts +4 -0
- package/dist/TableProvider/index.js +5365 -0
- package/dist/TableProvider/index.js.map +1 -0
- package/dist/TableProvider/index.mjs +5387 -0
- package/dist/TableProvider/index.mjs.map +1 -0
- package/dist/TableProvider-CDcL1tDj.d.mts +192 -0
- package/dist/TableProvider-D4Ak7ofz.d.ts +192 -0
- package/dist/index.css +10 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +7 -44
- package/dist/index.d.ts +7 -44
- package/dist/index.js +1120 -785
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1038 -705
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +10 -0
- package/dist/styles.css.map +1 -1
- package/dist/{types-BXzeefgf.d.mts → types-DqZRjqxh.d.ts} +2 -23
- package/dist/{types-BXzeefgf.d.ts → types-pd3QVhSu.d.mts} +2 -23
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -4493,10 +4493,13 @@ var ProfileMenuHeader = forwardRef10(({ className, name, email, photoUrl, store:
|
|
|
4493
4493
|
{
|
|
4494
4494
|
ref,
|
|
4495
4495
|
"data-component": "ProfileMenuHeader",
|
|
4496
|
-
className: cn(
|
|
4496
|
+
className: cn(
|
|
4497
|
+
"flex flex-row gap-4 items-center min-w-[280px]",
|
|
4498
|
+
className
|
|
4499
|
+
),
|
|
4497
4500
|
...props,
|
|
4498
4501
|
children: [
|
|
4499
|
-
/* @__PURE__ */ jsx30("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden", children: photoUrl ? /* @__PURE__ */ jsx30(
|
|
4502
|
+
/* @__PURE__ */ jsx30("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0", children: photoUrl ? /* @__PURE__ */ jsx30(
|
|
4500
4503
|
"img",
|
|
4501
4504
|
{
|
|
4502
4505
|
src: photoUrl,
|
|
@@ -4504,15 +4507,56 @@ var ProfileMenuHeader = forwardRef10(({ className, name, email, photoUrl, store:
|
|
|
4504
4507
|
className: "w-full h-full object-cover"
|
|
4505
4508
|
}
|
|
4506
4509
|
) : /* @__PURE__ */ jsx30(User2, { size: 34, className: "text-primary-800" }) }),
|
|
4507
|
-
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col ", children: [
|
|
4508
|
-
/* @__PURE__ */ jsx30(
|
|
4509
|
-
|
|
4510
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col min-w-0", children: [
|
|
4511
|
+
/* @__PURE__ */ jsx30(
|
|
4512
|
+
Text_default,
|
|
4513
|
+
{
|
|
4514
|
+
size: "xl",
|
|
4515
|
+
weight: "bold",
|
|
4516
|
+
color: "text-text-950",
|
|
4517
|
+
className: "truncate",
|
|
4518
|
+
children: name
|
|
4519
|
+
}
|
|
4520
|
+
),
|
|
4521
|
+
/* @__PURE__ */ jsx30(Text_default, { size: "md", color: "text-text-600", className: "truncate", children: email })
|
|
4510
4522
|
] })
|
|
4511
4523
|
]
|
|
4512
4524
|
}
|
|
4513
4525
|
);
|
|
4514
4526
|
});
|
|
4515
4527
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
4528
|
+
var ProfileMenuInfo = forwardRef10(
|
|
4529
|
+
({
|
|
4530
|
+
className,
|
|
4531
|
+
schoolName,
|
|
4532
|
+
classYearName,
|
|
4533
|
+
schoolYearName,
|
|
4534
|
+
store: _store,
|
|
4535
|
+
...props
|
|
4536
|
+
}, ref) => {
|
|
4537
|
+
return /* @__PURE__ */ jsxs23(
|
|
4538
|
+
"div",
|
|
4539
|
+
{
|
|
4540
|
+
ref,
|
|
4541
|
+
"data-component": "ProfileMenuInfo",
|
|
4542
|
+
className: cn("flex flex-row gap-4 items-center", className),
|
|
4543
|
+
...props,
|
|
4544
|
+
children: [
|
|
4545
|
+
/* @__PURE__ */ jsx30("span", { className: "w-16 h-16" }),
|
|
4546
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col ", children: [
|
|
4547
|
+
/* @__PURE__ */ jsx30(Text_default, { size: "md", color: "text-text-600", children: schoolName }),
|
|
4548
|
+
/* @__PURE__ */ jsxs23("span", { className: "flex flex-row items-center gap-2", children: [
|
|
4549
|
+
/* @__PURE__ */ jsx30(Text_default, { size: "md", color: "text-text-600", children: classYearName }),
|
|
4550
|
+
/* @__PURE__ */ jsx30("p", { className: "text-text-600 text-xs align-middle", children: "\u25CF" }),
|
|
4551
|
+
/* @__PURE__ */ jsx30(Text_default, { size: "md", color: "text-text-600", children: schoolYearName })
|
|
4552
|
+
] })
|
|
4553
|
+
] })
|
|
4554
|
+
]
|
|
4555
|
+
}
|
|
4556
|
+
);
|
|
4557
|
+
}
|
|
4558
|
+
);
|
|
4559
|
+
ProfileMenuInfo.displayName = "ProfileMenuInfo";
|
|
4516
4560
|
var ProfileToggleTheme = ({
|
|
4517
4561
|
store: externalStore,
|
|
4518
4562
|
...props
|
|
@@ -8176,10 +8220,297 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8176
8220
|
};
|
|
8177
8221
|
};
|
|
8178
8222
|
|
|
8223
|
+
// src/components/TableProvider/TableProvider.tsx
|
|
8224
|
+
import { useState as useState17, useEffect as useEffect18, useMemo as useMemo10, useCallback as useCallback4 } from "react";
|
|
8225
|
+
import { Funnel } from "phosphor-react";
|
|
8226
|
+
import { Fragment as Fragment7, jsx as jsx49, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8227
|
+
function TableProvider({
|
|
8228
|
+
data,
|
|
8229
|
+
headers,
|
|
8230
|
+
loading = false,
|
|
8231
|
+
variant = "default",
|
|
8232
|
+
enableSearch = false,
|
|
8233
|
+
enableFilters = false,
|
|
8234
|
+
enableTableSort = false,
|
|
8235
|
+
enablePagination = false,
|
|
8236
|
+
enableRowClick = false,
|
|
8237
|
+
initialFilters = [],
|
|
8238
|
+
paginationConfig = {},
|
|
8239
|
+
searchPlaceholder = "Buscar...",
|
|
8240
|
+
noSearchResultImage,
|
|
8241
|
+
rowKey,
|
|
8242
|
+
onParamsChange,
|
|
8243
|
+
onRowClick,
|
|
8244
|
+
children
|
|
8245
|
+
}) {
|
|
8246
|
+
const [searchQuery, setSearchQuery] = useState17("");
|
|
8247
|
+
const sortResultRaw = useTableSort(data, { syncWithUrl: true });
|
|
8248
|
+
const sortResult = enableTableSort ? sortResultRaw : {
|
|
8249
|
+
sortedData: data,
|
|
8250
|
+
sortColumn: null,
|
|
8251
|
+
sortDirection: null,
|
|
8252
|
+
handleSort: () => {
|
|
8253
|
+
}
|
|
8254
|
+
};
|
|
8255
|
+
const { sortedData, sortColumn, sortDirection, handleSort } = sortResult;
|
|
8256
|
+
const filterResultRaw = useTableFilter(initialFilters, { syncWithUrl: true });
|
|
8257
|
+
const disabledFilterResult = useMemo10(
|
|
8258
|
+
() => ({
|
|
8259
|
+
filterConfigs: [],
|
|
8260
|
+
activeFilters: {},
|
|
8261
|
+
hasActiveFilters: false,
|
|
8262
|
+
updateFilters: () => {
|
|
8263
|
+
},
|
|
8264
|
+
applyFilters: () => {
|
|
8265
|
+
},
|
|
8266
|
+
clearFilters: () => {
|
|
8267
|
+
}
|
|
8268
|
+
}),
|
|
8269
|
+
[]
|
|
8270
|
+
);
|
|
8271
|
+
const filterResult = enableFilters ? filterResultRaw : disabledFilterResult;
|
|
8272
|
+
const {
|
|
8273
|
+
filterConfigs,
|
|
8274
|
+
activeFilters,
|
|
8275
|
+
hasActiveFilters,
|
|
8276
|
+
updateFilters,
|
|
8277
|
+
applyFilters,
|
|
8278
|
+
clearFilters
|
|
8279
|
+
} = filterResult;
|
|
8280
|
+
const {
|
|
8281
|
+
defaultItemsPerPage = 10,
|
|
8282
|
+
itemsPerPageOptions = [10, 20, 50, 100],
|
|
8283
|
+
itemLabel = "itens",
|
|
8284
|
+
totalItems,
|
|
8285
|
+
totalPages
|
|
8286
|
+
} = paginationConfig;
|
|
8287
|
+
const [currentPage, setCurrentPage] = useState17(1);
|
|
8288
|
+
const [itemsPerPage, setItemsPerPage] = useState17(defaultItemsPerPage);
|
|
8289
|
+
const [isFilterModalOpen, setIsFilterModalOpen] = useState17(false);
|
|
8290
|
+
const combinedParams = useMemo10(() => {
|
|
8291
|
+
const params = {
|
|
8292
|
+
page: currentPage,
|
|
8293
|
+
limit: itemsPerPage
|
|
8294
|
+
};
|
|
8295
|
+
if (enableSearch && searchQuery) {
|
|
8296
|
+
params.search = searchQuery;
|
|
8297
|
+
}
|
|
8298
|
+
if (enableFilters) {
|
|
8299
|
+
Object.assign(params, activeFilters);
|
|
8300
|
+
}
|
|
8301
|
+
if (enableTableSort && sortColumn && sortDirection) {
|
|
8302
|
+
params.sortBy = sortColumn;
|
|
8303
|
+
params.sortOrder = sortDirection;
|
|
8304
|
+
}
|
|
8305
|
+
return params;
|
|
8306
|
+
}, [
|
|
8307
|
+
currentPage,
|
|
8308
|
+
itemsPerPage,
|
|
8309
|
+
searchQuery,
|
|
8310
|
+
activeFilters,
|
|
8311
|
+
sortColumn,
|
|
8312
|
+
sortDirection,
|
|
8313
|
+
enableSearch,
|
|
8314
|
+
enableFilters,
|
|
8315
|
+
enableTableSort
|
|
8316
|
+
]);
|
|
8317
|
+
useEffect18(() => {
|
|
8318
|
+
onParamsChange?.(combinedParams);
|
|
8319
|
+
}, [combinedParams]);
|
|
8320
|
+
const handleSearchChange = useCallback4((value) => {
|
|
8321
|
+
setSearchQuery(value);
|
|
8322
|
+
setCurrentPage(1);
|
|
8323
|
+
}, []);
|
|
8324
|
+
const handleFilterApply = useCallback4(() => {
|
|
8325
|
+
applyFilters();
|
|
8326
|
+
setIsFilterModalOpen(false);
|
|
8327
|
+
setCurrentPage(1);
|
|
8328
|
+
}, [applyFilters]);
|
|
8329
|
+
const handlePageChange = useCallback4((page) => {
|
|
8330
|
+
setCurrentPage(page);
|
|
8331
|
+
}, []);
|
|
8332
|
+
const handleItemsPerPageChange = useCallback4((items) => {
|
|
8333
|
+
setItemsPerPage(items);
|
|
8334
|
+
setCurrentPage(1);
|
|
8335
|
+
}, []);
|
|
8336
|
+
const handleRowClickInternal = useCallback4(
|
|
8337
|
+
(row, index) => {
|
|
8338
|
+
if (enableRowClick && onRowClick) {
|
|
8339
|
+
onRowClick(row, index);
|
|
8340
|
+
}
|
|
8341
|
+
},
|
|
8342
|
+
[enableRowClick, onRowClick]
|
|
8343
|
+
);
|
|
8344
|
+
const useInternalPagination = useMemo10(
|
|
8345
|
+
() => enablePagination && !onParamsChange && totalItems === void 0 && totalPages === void 0,
|
|
8346
|
+
[enablePagination, onParamsChange, totalItems, totalPages]
|
|
8347
|
+
);
|
|
8348
|
+
const calculatedTotalPages = totalPages ?? Math.ceil(
|
|
8349
|
+
(totalItems ?? (useInternalPagination ? sortedData.length : data.length)) / itemsPerPage
|
|
8350
|
+
);
|
|
8351
|
+
const calculatedTotalItems = totalItems ?? (useInternalPagination ? sortedData.length : data.length);
|
|
8352
|
+
const displayData = useMemo10(() => {
|
|
8353
|
+
if (!useInternalPagination) {
|
|
8354
|
+
return sortedData;
|
|
8355
|
+
}
|
|
8356
|
+
const start = (currentPage - 1) * itemsPerPage;
|
|
8357
|
+
return sortedData.slice(start, start + itemsPerPage);
|
|
8358
|
+
}, [useInternalPagination, sortedData, currentPage, itemsPerPage]);
|
|
8359
|
+
const isEmpty = sortedData.length === 0;
|
|
8360
|
+
const controls = (enableSearch || enableFilters) && /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-4", children: [
|
|
8361
|
+
enableFilters && /* @__PURE__ */ jsxs38(
|
|
8362
|
+
Button_default,
|
|
8363
|
+
{
|
|
8364
|
+
variant: "outline",
|
|
8365
|
+
size: "medium",
|
|
8366
|
+
onClick: () => setIsFilterModalOpen(true),
|
|
8367
|
+
children: [
|
|
8368
|
+
/* @__PURE__ */ jsx49(Funnel, { size: 20 }),
|
|
8369
|
+
"Filtros",
|
|
8370
|
+
hasActiveFilters && /* @__PURE__ */ jsx49("span", { className: "ml-2 rounded-full bg-primary-500 px-2 py-0.5 text-xs text-white", children: Object.keys(activeFilters).length })
|
|
8371
|
+
]
|
|
8372
|
+
}
|
|
8373
|
+
),
|
|
8374
|
+
enableSearch && /* @__PURE__ */ jsx49("div", { className: "flex-1", children: /* @__PURE__ */ jsx49(
|
|
8375
|
+
Search_default,
|
|
8376
|
+
{
|
|
8377
|
+
value: searchQuery,
|
|
8378
|
+
onSearch: handleSearchChange,
|
|
8379
|
+
onClear: () => handleSearchChange(""),
|
|
8380
|
+
options: [],
|
|
8381
|
+
placeholder: searchPlaceholder
|
|
8382
|
+
}
|
|
8383
|
+
) })
|
|
8384
|
+
] });
|
|
8385
|
+
const table = /* @__PURE__ */ jsx49("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs38(
|
|
8386
|
+
Table_default,
|
|
8387
|
+
{
|
|
8388
|
+
variant,
|
|
8389
|
+
searchTerm: enableSearch ? searchQuery : void 0,
|
|
8390
|
+
noSearchResultImage,
|
|
8391
|
+
children: [
|
|
8392
|
+
/* @__PURE__ */ jsx49("thead", { children: /* @__PURE__ */ jsx49(
|
|
8393
|
+
TableRow,
|
|
8394
|
+
{
|
|
8395
|
+
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
8396
|
+
children: headers.map((header, index) => /* @__PURE__ */ jsx49(
|
|
8397
|
+
TableHead,
|
|
8398
|
+
{
|
|
8399
|
+
sortable: enableTableSort && header.sortable,
|
|
8400
|
+
sortDirection: enableTableSort && sortColumn === header.key ? sortDirection : null,
|
|
8401
|
+
onSort: () => enableTableSort && header.sortable && handleSort(header.key),
|
|
8402
|
+
className: header.className,
|
|
8403
|
+
style: header.width ? { width: header.width } : void 0,
|
|
8404
|
+
children: header.label
|
|
8405
|
+
},
|
|
8406
|
+
`header-${header.key}-${index}`
|
|
8407
|
+
))
|
|
8408
|
+
}
|
|
8409
|
+
) }),
|
|
8410
|
+
/* @__PURE__ */ jsx49(TableBody, { children: loading ? /* @__PURE__ */ jsx49(TableRow, { children: /* @__PURE__ */ jsx49(TableCell, { colSpan: headers.length, className: "text-center py-8", children: /* @__PURE__ */ jsx49("span", { className: "text-text-400 text-sm", children: "Carregando..." }) }) }) : displayData.map((row, rowIndex) => {
|
|
8411
|
+
const effectiveIndex = useInternalPagination ? (currentPage - 1) * itemsPerPage + rowIndex : rowIndex;
|
|
8412
|
+
const rowKeyValue = rowKey ? (() => {
|
|
8413
|
+
const keyValue = row[rowKey];
|
|
8414
|
+
if (keyValue === null || keyValue === void 0) {
|
|
8415
|
+
return `row-${effectiveIndex}`;
|
|
8416
|
+
}
|
|
8417
|
+
if (typeof keyValue === "object") {
|
|
8418
|
+
return JSON.stringify(keyValue);
|
|
8419
|
+
}
|
|
8420
|
+
return String(keyValue);
|
|
8421
|
+
})() : `row-${effectiveIndex}`;
|
|
8422
|
+
return /* @__PURE__ */ jsx49(
|
|
8423
|
+
TableRow,
|
|
8424
|
+
{
|
|
8425
|
+
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
8426
|
+
clickable: enableRowClick,
|
|
8427
|
+
onClick: () => handleRowClickInternal(row, effectiveIndex),
|
|
8428
|
+
children: headers.map((header, cellIndex) => {
|
|
8429
|
+
const value = row[header.key];
|
|
8430
|
+
let defaultContent = "";
|
|
8431
|
+
if (value !== null && value !== void 0) {
|
|
8432
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
8433
|
+
defaultContent = String(value);
|
|
8434
|
+
} else if (typeof value === "object") {
|
|
8435
|
+
defaultContent = JSON.stringify(value);
|
|
8436
|
+
} else if (typeof value === "function") {
|
|
8437
|
+
defaultContent = "[Function]";
|
|
8438
|
+
} else if (typeof value === "symbol") {
|
|
8439
|
+
defaultContent = String(value);
|
|
8440
|
+
}
|
|
8441
|
+
}
|
|
8442
|
+
const content = header.render ? header.render(value, row, effectiveIndex) : defaultContent;
|
|
8443
|
+
return /* @__PURE__ */ jsx49(
|
|
8444
|
+
TableCell,
|
|
8445
|
+
{
|
|
8446
|
+
className: header.className,
|
|
8447
|
+
style: {
|
|
8448
|
+
textAlign: header.align
|
|
8449
|
+
},
|
|
8450
|
+
children: content
|
|
8451
|
+
},
|
|
8452
|
+
`cell-${effectiveIndex}-${cellIndex}`
|
|
8453
|
+
);
|
|
8454
|
+
})
|
|
8455
|
+
},
|
|
8456
|
+
rowKeyValue
|
|
8457
|
+
);
|
|
8458
|
+
}) })
|
|
8459
|
+
]
|
|
8460
|
+
}
|
|
8461
|
+
) });
|
|
8462
|
+
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ jsx49("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx49(
|
|
8463
|
+
TablePagination_default,
|
|
8464
|
+
{
|
|
8465
|
+
currentPage,
|
|
8466
|
+
totalPages: calculatedTotalPages,
|
|
8467
|
+
totalItems: calculatedTotalItems,
|
|
8468
|
+
itemsPerPage,
|
|
8469
|
+
itemsPerPageOptions,
|
|
8470
|
+
onPageChange: handlePageChange,
|
|
8471
|
+
onItemsPerPageChange: handleItemsPerPageChange,
|
|
8472
|
+
itemLabel
|
|
8473
|
+
}
|
|
8474
|
+
) });
|
|
8475
|
+
if (children) {
|
|
8476
|
+
return /* @__PURE__ */ jsxs38(Fragment7, { children: [
|
|
8477
|
+
children({ controls, table, pagination }),
|
|
8478
|
+
enableFilters && /* @__PURE__ */ jsx49(
|
|
8479
|
+
FilterModal,
|
|
8480
|
+
{
|
|
8481
|
+
isOpen: isFilterModalOpen,
|
|
8482
|
+
onClose: () => setIsFilterModalOpen(false),
|
|
8483
|
+
filterConfigs,
|
|
8484
|
+
onFiltersChange: updateFilters,
|
|
8485
|
+
onApply: handleFilterApply,
|
|
8486
|
+
onClear: clearFilters
|
|
8487
|
+
}
|
|
8488
|
+
)
|
|
8489
|
+
] });
|
|
8490
|
+
}
|
|
8491
|
+
return /* @__PURE__ */ jsxs38("div", { className: "w-full space-y-4", children: [
|
|
8492
|
+
controls,
|
|
8493
|
+
table,
|
|
8494
|
+
pagination,
|
|
8495
|
+
enableFilters && /* @__PURE__ */ jsx49(
|
|
8496
|
+
FilterModal,
|
|
8497
|
+
{
|
|
8498
|
+
isOpen: isFilterModalOpen,
|
|
8499
|
+
onClose: () => setIsFilterModalOpen(false),
|
|
8500
|
+
filterConfigs,
|
|
8501
|
+
onFiltersChange: updateFilters,
|
|
8502
|
+
onApply: handleFilterApply,
|
|
8503
|
+
onClear: clearFilters
|
|
8504
|
+
}
|
|
8505
|
+
)
|
|
8506
|
+
] });
|
|
8507
|
+
}
|
|
8508
|
+
var TableProvider_default = TableProvider;
|
|
8509
|
+
|
|
8179
8510
|
// src/components/Select/Select.tsx
|
|
8180
8511
|
import { create as create8, useStore as useStore4 } from "zustand";
|
|
8181
8512
|
import {
|
|
8182
|
-
useEffect as
|
|
8513
|
+
useEffect as useEffect19,
|
|
8183
8514
|
useRef as useRef8,
|
|
8184
8515
|
forwardRef as forwardRef15,
|
|
8185
8516
|
isValidElement as isValidElement5,
|
|
@@ -8188,7 +8519,7 @@ import {
|
|
|
8188
8519
|
useId as useId8
|
|
8189
8520
|
} from "react";
|
|
8190
8521
|
import { CaretDown as CaretDown3, Check as Check4, WarningCircle as WarningCircle5 } from "phosphor-react";
|
|
8191
|
-
import { Fragment as
|
|
8522
|
+
import { Fragment as Fragment8, jsx as jsx50, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8192
8523
|
var VARIANT_CLASSES4 = {
|
|
8193
8524
|
outlined: "border-2 rounded-lg focus:border-primary-950",
|
|
8194
8525
|
underlined: "border-b-2 focus:border-primary-950",
|
|
@@ -8248,7 +8579,7 @@ function getLabelAsNode(children) {
|
|
|
8248
8579
|
}
|
|
8249
8580
|
const flattened = Children5.toArray(children);
|
|
8250
8581
|
if (flattened.length === 1) return flattened[0];
|
|
8251
|
-
return /* @__PURE__ */
|
|
8582
|
+
return /* @__PURE__ */ jsx50(Fragment8, { children: flattened });
|
|
8252
8583
|
}
|
|
8253
8584
|
var injectStore4 = (children, store, size, selectId) => {
|
|
8254
8585
|
return Children5.map(children, (child) => {
|
|
@@ -8310,13 +8641,13 @@ var Select = ({
|
|
|
8310
8641
|
search(children2);
|
|
8311
8642
|
return found;
|
|
8312
8643
|
};
|
|
8313
|
-
|
|
8644
|
+
useEffect19(() => {
|
|
8314
8645
|
if (!selectedLabel && defaultValue) {
|
|
8315
8646
|
const label2 = findLabelForValue(children, defaultValue);
|
|
8316
8647
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
8317
8648
|
}
|
|
8318
8649
|
}, [children, defaultValue, selectedLabel]);
|
|
8319
|
-
|
|
8650
|
+
useEffect19(() => {
|
|
8320
8651
|
const handleClickOutside = (event) => {
|
|
8321
8652
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
8322
8653
|
setOpen(false);
|
|
@@ -8351,7 +8682,7 @@ var Select = ({
|
|
|
8351
8682
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
8352
8683
|
};
|
|
8353
8684
|
}, [open]);
|
|
8354
|
-
|
|
8685
|
+
useEffect19(() => {
|
|
8355
8686
|
if (propValue) {
|
|
8356
8687
|
setValue(propValue);
|
|
8357
8688
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -8359,8 +8690,8 @@ var Select = ({
|
|
|
8359
8690
|
}
|
|
8360
8691
|
}, [propValue]);
|
|
8361
8692
|
const sizeClasses = SIZE_CLASSES12[size];
|
|
8362
|
-
return /* @__PURE__ */
|
|
8363
|
-
label && /* @__PURE__ */
|
|
8693
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("w-full", className), children: [
|
|
8694
|
+
label && /* @__PURE__ */ jsx50(
|
|
8364
8695
|
"label",
|
|
8365
8696
|
{
|
|
8366
8697
|
htmlFor: selectId,
|
|
@@ -8368,11 +8699,11 @@ var Select = ({
|
|
|
8368
8699
|
children: label
|
|
8369
8700
|
}
|
|
8370
8701
|
),
|
|
8371
|
-
/* @__PURE__ */
|
|
8372
|
-
(helperText || errorMessage) && /* @__PURE__ */
|
|
8373
|
-
helperText && /* @__PURE__ */
|
|
8374
|
-
errorMessage && /* @__PURE__ */
|
|
8375
|
-
/* @__PURE__ */
|
|
8702
|
+
/* @__PURE__ */ jsx50("div", { className: cn("relative w-full"), ref: selectRef, children: injectStore4(children, store, size, selectId) }),
|
|
8703
|
+
(helperText || errorMessage) && /* @__PURE__ */ jsxs39("div", { className: "mt-1.5 gap-1.5", children: [
|
|
8704
|
+
helperText && /* @__PURE__ */ jsx50("p", { className: "text-sm text-text-500", children: helperText }),
|
|
8705
|
+
errorMessage && /* @__PURE__ */ jsxs39("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
|
|
8706
|
+
/* @__PURE__ */ jsx50(WarningCircle5, { size: 16 }),
|
|
8376
8707
|
" ",
|
|
8377
8708
|
errorMessage
|
|
8378
8709
|
] })
|
|
@@ -8386,7 +8717,7 @@ var SelectValue = ({
|
|
|
8386
8717
|
const store = useSelectStore(externalStore);
|
|
8387
8718
|
const selectedLabel = useStore4(store, (s) => s.selectedLabel);
|
|
8388
8719
|
const value = useStore4(store, (s) => s.value);
|
|
8389
|
-
return /* @__PURE__ */
|
|
8720
|
+
return /* @__PURE__ */ jsx50("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
|
|
8390
8721
|
};
|
|
8391
8722
|
var SelectTrigger = forwardRef15(
|
|
8392
8723
|
({
|
|
@@ -8405,7 +8736,7 @@ var SelectTrigger = forwardRef15(
|
|
|
8405
8736
|
const variantClasses = VARIANT_CLASSES4[variant];
|
|
8406
8737
|
const heightClasses = HEIGHT_CLASSES[size];
|
|
8407
8738
|
const paddingClasses = PADDING_CLASSES[size];
|
|
8408
|
-
return /* @__PURE__ */
|
|
8739
|
+
return /* @__PURE__ */ jsxs39(
|
|
8409
8740
|
"button",
|
|
8410
8741
|
{
|
|
8411
8742
|
ref,
|
|
@@ -8427,7 +8758,7 @@ var SelectTrigger = forwardRef15(
|
|
|
8427
8758
|
...props,
|
|
8428
8759
|
children: [
|
|
8429
8760
|
props.children,
|
|
8430
|
-
/* @__PURE__ */
|
|
8761
|
+
/* @__PURE__ */ jsx50(
|
|
8431
8762
|
CaretDown3,
|
|
8432
8763
|
{
|
|
8433
8764
|
className: cn(
|
|
@@ -8455,7 +8786,7 @@ var SelectContent = forwardRef15(
|
|
|
8455
8786
|
const open = useStore4(store, (s) => s.open);
|
|
8456
8787
|
if (!open) return null;
|
|
8457
8788
|
const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
|
|
8458
|
-
return /* @__PURE__ */
|
|
8789
|
+
return /* @__PURE__ */ jsx50(
|
|
8459
8790
|
"div",
|
|
8460
8791
|
{
|
|
8461
8792
|
role: "menu",
|
|
@@ -8499,7 +8830,7 @@ var SelectItem = forwardRef15(
|
|
|
8499
8830
|
}
|
|
8500
8831
|
props.onClick?.(e);
|
|
8501
8832
|
};
|
|
8502
|
-
return /* @__PURE__ */
|
|
8833
|
+
return /* @__PURE__ */ jsxs39(
|
|
8503
8834
|
"div",
|
|
8504
8835
|
{
|
|
8505
8836
|
role: "menuitem",
|
|
@@ -8519,7 +8850,7 @@ var SelectItem = forwardRef15(
|
|
|
8519
8850
|
tabIndex: disabled ? -1 : 0,
|
|
8520
8851
|
...props,
|
|
8521
8852
|
children: [
|
|
8522
|
-
/* @__PURE__ */
|
|
8853
|
+
/* @__PURE__ */ jsx50("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ jsx50(Check4, { className: "" }) }),
|
|
8523
8854
|
children
|
|
8524
8855
|
]
|
|
8525
8856
|
}
|
|
@@ -8532,16 +8863,16 @@ var Select_default = Select;
|
|
|
8532
8863
|
// src/components/Menu/Menu.tsx
|
|
8533
8864
|
import { create as create9, useStore as useStore5 } from "zustand";
|
|
8534
8865
|
import {
|
|
8535
|
-
useEffect as
|
|
8866
|
+
useEffect as useEffect20,
|
|
8536
8867
|
useRef as useRef9,
|
|
8537
8868
|
forwardRef as forwardRef16,
|
|
8538
8869
|
isValidElement as isValidElement6,
|
|
8539
8870
|
Children as Children6,
|
|
8540
8871
|
cloneElement as cloneElement6,
|
|
8541
|
-
useState as
|
|
8872
|
+
useState as useState18
|
|
8542
8873
|
} from "react";
|
|
8543
8874
|
import { CaretLeft as CaretLeft4, CaretRight as CaretRight5 } from "phosphor-react";
|
|
8544
|
-
import { jsx as
|
|
8875
|
+
import { jsx as jsx51, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
8545
8876
|
var createMenuStore = (onValueChange) => create9((set) => ({
|
|
8546
8877
|
value: "",
|
|
8547
8878
|
setValue: (value) => {
|
|
@@ -8574,12 +8905,12 @@ var Menu = forwardRef16(
|
|
|
8574
8905
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
8575
8906
|
const store = storeRef.current;
|
|
8576
8907
|
const { setValue } = useStore5(store, (s) => s);
|
|
8577
|
-
|
|
8908
|
+
useEffect20(() => {
|
|
8578
8909
|
setValue(propValue ?? defaultValue);
|
|
8579
8910
|
}, [defaultValue, propValue, setValue]);
|
|
8580
8911
|
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";
|
|
8581
8912
|
const variantClasses = VARIANT_CLASSES5[variant];
|
|
8582
|
-
return /* @__PURE__ */
|
|
8913
|
+
return /* @__PURE__ */ jsx51(
|
|
8583
8914
|
"div",
|
|
8584
8915
|
{
|
|
8585
8916
|
ref,
|
|
@@ -8599,7 +8930,7 @@ var MenuContent = forwardRef16(
|
|
|
8599
8930
|
({ className, children, variant = "menu", ...props }, ref) => {
|
|
8600
8931
|
const baseClasses = "w-full flex flex-row items-center gap-2";
|
|
8601
8932
|
const variantClasses = variant === "menu2" || variant === "menu-overflow" ? "overflow-x-auto scroll-smooth" : "";
|
|
8602
|
-
return /* @__PURE__ */
|
|
8933
|
+
return /* @__PURE__ */ jsx51(
|
|
8603
8934
|
"ul",
|
|
8604
8935
|
{
|
|
8605
8936
|
ref,
|
|
@@ -8651,7 +8982,7 @@ var MenuItem = forwardRef16(
|
|
|
8651
8982
|
...props
|
|
8652
8983
|
};
|
|
8653
8984
|
const variants = {
|
|
8654
|
-
menu: /* @__PURE__ */
|
|
8985
|
+
menu: /* @__PURE__ */ jsx51(
|
|
8655
8986
|
"li",
|
|
8656
8987
|
{
|
|
8657
8988
|
"data-variant": "menu",
|
|
@@ -8666,7 +8997,7 @@ var MenuItem = forwardRef16(
|
|
|
8666
8997
|
children
|
|
8667
8998
|
}
|
|
8668
8999
|
),
|
|
8669
|
-
menu2: /* @__PURE__ */
|
|
9000
|
+
menu2: /* @__PURE__ */ jsxs40(
|
|
8670
9001
|
"li",
|
|
8671
9002
|
{
|
|
8672
9003
|
"data-variant": "menu2",
|
|
@@ -8677,7 +9008,7 @@ var MenuItem = forwardRef16(
|
|
|
8677
9008
|
`,
|
|
8678
9009
|
...commonProps,
|
|
8679
9010
|
children: [
|
|
8680
|
-
/* @__PURE__ */
|
|
9011
|
+
/* @__PURE__ */ jsx51(
|
|
8681
9012
|
"span",
|
|
8682
9013
|
{
|
|
8683
9014
|
className: cn(
|
|
@@ -8687,11 +9018,11 @@ var MenuItem = forwardRef16(
|
|
|
8687
9018
|
children
|
|
8688
9019
|
}
|
|
8689
9020
|
),
|
|
8690
|
-
selectedValue === value && /* @__PURE__ */
|
|
9021
|
+
selectedValue === value && /* @__PURE__ */ jsx51("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
8691
9022
|
]
|
|
8692
9023
|
}
|
|
8693
9024
|
),
|
|
8694
|
-
"menu-overflow": /* @__PURE__ */
|
|
9025
|
+
"menu-overflow": /* @__PURE__ */ jsxs40(
|
|
8695
9026
|
"li",
|
|
8696
9027
|
{
|
|
8697
9028
|
"data-variant": "menu-overflow",
|
|
@@ -8702,7 +9033,7 @@ var MenuItem = forwardRef16(
|
|
|
8702
9033
|
`,
|
|
8703
9034
|
...commonProps,
|
|
8704
9035
|
children: [
|
|
8705
|
-
/* @__PURE__ */
|
|
9036
|
+
/* @__PURE__ */ jsx51(
|
|
8706
9037
|
"span",
|
|
8707
9038
|
{
|
|
8708
9039
|
className: cn(
|
|
@@ -8712,11 +9043,11 @@ var MenuItem = forwardRef16(
|
|
|
8712
9043
|
children
|
|
8713
9044
|
}
|
|
8714
9045
|
),
|
|
8715
|
-
selectedValue === value && /* @__PURE__ */
|
|
9046
|
+
selectedValue === value && /* @__PURE__ */ jsx51("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
8716
9047
|
]
|
|
8717
9048
|
}
|
|
8718
9049
|
),
|
|
8719
|
-
breadcrumb: /* @__PURE__ */
|
|
9050
|
+
breadcrumb: /* @__PURE__ */ jsxs40(
|
|
8720
9051
|
"li",
|
|
8721
9052
|
{
|
|
8722
9053
|
"data-variant": "breadcrumb",
|
|
@@ -8728,7 +9059,7 @@ var MenuItem = forwardRef16(
|
|
|
8728
9059
|
`,
|
|
8729
9060
|
...commonProps,
|
|
8730
9061
|
children: [
|
|
8731
|
-
/* @__PURE__ */
|
|
9062
|
+
/* @__PURE__ */ jsx51(
|
|
8732
9063
|
"span",
|
|
8733
9064
|
{
|
|
8734
9065
|
className: cn(
|
|
@@ -8738,7 +9069,7 @@ var MenuItem = forwardRef16(
|
|
|
8738
9069
|
children
|
|
8739
9070
|
}
|
|
8740
9071
|
),
|
|
8741
|
-
separator && /* @__PURE__ */
|
|
9072
|
+
separator && /* @__PURE__ */ jsx51(
|
|
8742
9073
|
CaretRight5,
|
|
8743
9074
|
{
|
|
8744
9075
|
size: 16,
|
|
@@ -8776,9 +9107,9 @@ var MenuOverflow = ({
|
|
|
8776
9107
|
...props
|
|
8777
9108
|
}) => {
|
|
8778
9109
|
const containerRef = useRef9(null);
|
|
8779
|
-
const [showLeftArrow, setShowLeftArrow] =
|
|
8780
|
-
const [showRightArrow, setShowRightArrow] =
|
|
8781
|
-
|
|
9110
|
+
const [showLeftArrow, setShowLeftArrow] = useState18(false);
|
|
9111
|
+
const [showRightArrow, setShowRightArrow] = useState18(false);
|
|
9112
|
+
useEffect20(() => {
|
|
8782
9113
|
const checkScroll = () => internalCheckScroll(
|
|
8783
9114
|
containerRef.current,
|
|
8784
9115
|
setShowLeftArrow,
|
|
@@ -8793,25 +9124,25 @@ var MenuOverflow = ({
|
|
|
8793
9124
|
window.removeEventListener("resize", checkScroll);
|
|
8794
9125
|
};
|
|
8795
9126
|
}, []);
|
|
8796
|
-
return /* @__PURE__ */
|
|
9127
|
+
return /* @__PURE__ */ jsxs40(
|
|
8797
9128
|
"div",
|
|
8798
9129
|
{
|
|
8799
9130
|
"data-testid": "menu-overflow-wrapper",
|
|
8800
9131
|
className: cn("relative w-full overflow-hidden", className),
|
|
8801
9132
|
children: [
|
|
8802
|
-
showLeftArrow && /* @__PURE__ */
|
|
9133
|
+
showLeftArrow && /* @__PURE__ */ jsxs40(
|
|
8803
9134
|
"button",
|
|
8804
9135
|
{
|
|
8805
9136
|
onClick: () => internalScroll(containerRef.current, "left"),
|
|
8806
9137
|
className: "absolute left-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
8807
9138
|
"data-testid": "scroll-left-button",
|
|
8808
9139
|
children: [
|
|
8809
|
-
/* @__PURE__ */
|
|
8810
|
-
/* @__PURE__ */
|
|
9140
|
+
/* @__PURE__ */ jsx51(CaretLeft4, { size: 16 }),
|
|
9141
|
+
/* @__PURE__ */ jsx51("span", { className: "sr-only", children: "Scroll left" })
|
|
8811
9142
|
]
|
|
8812
9143
|
}
|
|
8813
9144
|
),
|
|
8814
|
-
/* @__PURE__ */
|
|
9145
|
+
/* @__PURE__ */ jsx51(
|
|
8815
9146
|
Menu,
|
|
8816
9147
|
{
|
|
8817
9148
|
defaultValue,
|
|
@@ -8819,18 +9150,18 @@ var MenuOverflow = ({
|
|
|
8819
9150
|
value,
|
|
8820
9151
|
variant: "menu2",
|
|
8821
9152
|
...props,
|
|
8822
|
-
children: /* @__PURE__ */
|
|
9153
|
+
children: /* @__PURE__ */ jsx51(MenuContent, { ref: containerRef, variant: "menu2", children })
|
|
8823
9154
|
}
|
|
8824
9155
|
),
|
|
8825
|
-
showRightArrow && /* @__PURE__ */
|
|
9156
|
+
showRightArrow && /* @__PURE__ */ jsxs40(
|
|
8826
9157
|
"button",
|
|
8827
9158
|
{
|
|
8828
9159
|
onClick: () => internalScroll(containerRef.current, "right"),
|
|
8829
9160
|
className: "absolute right-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
8830
9161
|
"data-testid": "scroll-right-button",
|
|
8831
9162
|
children: [
|
|
8832
|
-
/* @__PURE__ */
|
|
8833
|
-
/* @__PURE__ */
|
|
9163
|
+
/* @__PURE__ */ jsx51(CaretRight5, { size: 16 }),
|
|
9164
|
+
/* @__PURE__ */ jsx51("span", { className: "sr-only", children: "Scroll right" })
|
|
8834
9165
|
]
|
|
8835
9166
|
}
|
|
8836
9167
|
)
|
|
@@ -8852,10 +9183,10 @@ var Menu_default = Menu;
|
|
|
8852
9183
|
// src/components/Card/Card.tsx
|
|
8853
9184
|
import {
|
|
8854
9185
|
forwardRef as forwardRef17,
|
|
8855
|
-
Fragment as
|
|
8856
|
-
useState as
|
|
9186
|
+
Fragment as Fragment9,
|
|
9187
|
+
useState as useState19,
|
|
8857
9188
|
useRef as useRef10,
|
|
8858
|
-
useEffect as
|
|
9189
|
+
useEffect as useEffect21
|
|
8859
9190
|
} from "react";
|
|
8860
9191
|
import {
|
|
8861
9192
|
CaretRight as CaretRight6,
|
|
@@ -8873,7 +9204,7 @@ import {
|
|
|
8873
9204
|
// src/components/IconRender/IconRender.tsx
|
|
8874
9205
|
import { cloneElement as cloneElement7 } from "react";
|
|
8875
9206
|
import * as PhosphorIcons from "phosphor-react";
|
|
8876
|
-
import { jsx as
|
|
9207
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
8877
9208
|
var IconRender = ({
|
|
8878
9209
|
iconName,
|
|
8879
9210
|
color = "#000000",
|
|
@@ -8883,14 +9214,14 @@ var IconRender = ({
|
|
|
8883
9214
|
if (typeof iconName === "string") {
|
|
8884
9215
|
switch (iconName) {
|
|
8885
9216
|
case "Chat_PT":
|
|
8886
|
-
return /* @__PURE__ */
|
|
9217
|
+
return /* @__PURE__ */ jsx52(ChatPT, { size, color });
|
|
8887
9218
|
case "Chat_EN":
|
|
8888
|
-
return /* @__PURE__ */
|
|
9219
|
+
return /* @__PURE__ */ jsx52(ChatEN, { size, color });
|
|
8889
9220
|
case "Chat_ES":
|
|
8890
|
-
return /* @__PURE__ */
|
|
9221
|
+
return /* @__PURE__ */ jsx52(ChatES, { size, color });
|
|
8891
9222
|
default: {
|
|
8892
9223
|
const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
|
|
8893
|
-
return /* @__PURE__ */
|
|
9224
|
+
return /* @__PURE__ */ jsx52(IconComponent, { size, color, weight });
|
|
8894
9225
|
}
|
|
8895
9226
|
}
|
|
8896
9227
|
} else {
|
|
@@ -8903,7 +9234,7 @@ var IconRender = ({
|
|
|
8903
9234
|
var IconRender_default = IconRender;
|
|
8904
9235
|
|
|
8905
9236
|
// src/components/Card/Card.tsx
|
|
8906
|
-
import { Fragment as
|
|
9237
|
+
import { Fragment as Fragment10, jsx as jsx53, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
8907
9238
|
var CARD_BASE_CLASSES = {
|
|
8908
9239
|
default: "w-full bg-background border border-border-50 rounded-xl",
|
|
8909
9240
|
compact: "w-full bg-background border border-border-50 rounded-lg",
|
|
@@ -8945,7 +9276,7 @@ var CardBase = forwardRef17(
|
|
|
8945
9276
|
const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
|
|
8946
9277
|
const layoutClasses = CARD_LAYOUT_CLASSES[layout];
|
|
8947
9278
|
const cursorClasses = CARD_CURSOR_CLASSES[cursor];
|
|
8948
|
-
return /* @__PURE__ */
|
|
9279
|
+
return /* @__PURE__ */ jsx53(
|
|
8949
9280
|
"div",
|
|
8950
9281
|
{
|
|
8951
9282
|
ref,
|
|
@@ -9003,7 +9334,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9003
9334
|
const actionIconClasses = ACTION_ICON_CLASSES[action];
|
|
9004
9335
|
const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
|
|
9005
9336
|
const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
|
|
9006
|
-
return /* @__PURE__ */
|
|
9337
|
+
return /* @__PURE__ */ jsxs41(
|
|
9007
9338
|
"div",
|
|
9008
9339
|
{
|
|
9009
9340
|
ref,
|
|
@@ -9013,7 +9344,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9013
9344
|
),
|
|
9014
9345
|
...props,
|
|
9015
9346
|
children: [
|
|
9016
|
-
/* @__PURE__ */
|
|
9347
|
+
/* @__PURE__ */ jsxs41(
|
|
9017
9348
|
"div",
|
|
9018
9349
|
{
|
|
9019
9350
|
className: cn(
|
|
@@ -9022,7 +9353,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9022
9353
|
extended ? "rounded-t-xl" : "rounded-xl"
|
|
9023
9354
|
),
|
|
9024
9355
|
children: [
|
|
9025
|
-
/* @__PURE__ */
|
|
9356
|
+
/* @__PURE__ */ jsx53(
|
|
9026
9357
|
"span",
|
|
9027
9358
|
{
|
|
9028
9359
|
className: cn(
|
|
@@ -9032,7 +9363,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9032
9363
|
children: icon
|
|
9033
9364
|
}
|
|
9034
9365
|
),
|
|
9035
|
-
/* @__PURE__ */
|
|
9366
|
+
/* @__PURE__ */ jsx53(
|
|
9036
9367
|
Text_default,
|
|
9037
9368
|
{
|
|
9038
9369
|
size: "2xs",
|
|
@@ -9041,7 +9372,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9041
9372
|
children: title
|
|
9042
9373
|
}
|
|
9043
9374
|
),
|
|
9044
|
-
/* @__PURE__ */
|
|
9375
|
+
/* @__PURE__ */ jsx53(
|
|
9045
9376
|
"p",
|
|
9046
9377
|
{
|
|
9047
9378
|
className: cn("text-lg font-bold truncate", actionSubTitleClasses),
|
|
@@ -9051,8 +9382,8 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9051
9382
|
]
|
|
9052
9383
|
}
|
|
9053
9384
|
),
|
|
9054
|
-
extended && /* @__PURE__ */
|
|
9055
|
-
/* @__PURE__ */
|
|
9385
|
+
extended && /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
|
|
9386
|
+
/* @__PURE__ */ jsx53(
|
|
9056
9387
|
"p",
|
|
9057
9388
|
{
|
|
9058
9389
|
className: cn(
|
|
@@ -9062,7 +9393,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9062
9393
|
children: header
|
|
9063
9394
|
}
|
|
9064
9395
|
),
|
|
9065
|
-
/* @__PURE__ */
|
|
9396
|
+
/* @__PURE__ */ jsx53(Badge_default, { size: "large", action: "info", children: description })
|
|
9066
9397
|
] })
|
|
9067
9398
|
]
|
|
9068
9399
|
}
|
|
@@ -9081,7 +9412,7 @@ var CardQuestions = forwardRef17(
|
|
|
9081
9412
|
const isDone = state === "done";
|
|
9082
9413
|
const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
|
|
9083
9414
|
const buttonLabel = isDone ? "Ver Resultado" : "Responder";
|
|
9084
|
-
return /* @__PURE__ */
|
|
9415
|
+
return /* @__PURE__ */ jsxs41(
|
|
9085
9416
|
CardBase,
|
|
9086
9417
|
{
|
|
9087
9418
|
ref,
|
|
@@ -9091,9 +9422,9 @@ var CardQuestions = forwardRef17(
|
|
|
9091
9422
|
className: cn("justify-between gap-4", className),
|
|
9092
9423
|
...props,
|
|
9093
9424
|
children: [
|
|
9094
|
-
/* @__PURE__ */
|
|
9095
|
-
/* @__PURE__ */
|
|
9096
|
-
/* @__PURE__ */
|
|
9425
|
+
/* @__PURE__ */ jsxs41("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
9426
|
+
/* @__PURE__ */ jsx53("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
|
|
9427
|
+
/* @__PURE__ */ jsx53("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ jsx53(
|
|
9097
9428
|
Badge_default,
|
|
9098
9429
|
{
|
|
9099
9430
|
size: "medium",
|
|
@@ -9103,7 +9434,7 @@ var CardQuestions = forwardRef17(
|
|
|
9103
9434
|
}
|
|
9104
9435
|
) })
|
|
9105
9436
|
] }),
|
|
9106
|
-
/* @__PURE__ */
|
|
9437
|
+
/* @__PURE__ */ jsx53("span", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx53(
|
|
9107
9438
|
Button_default,
|
|
9108
9439
|
{
|
|
9109
9440
|
size: "extra-small",
|
|
@@ -9134,19 +9465,19 @@ var CardProgress = forwardRef17(
|
|
|
9134
9465
|
}, ref) => {
|
|
9135
9466
|
const isHorizontal = direction === "horizontal";
|
|
9136
9467
|
const contentComponent = {
|
|
9137
|
-
horizontal: /* @__PURE__ */
|
|
9138
|
-
showDates && /* @__PURE__ */
|
|
9139
|
-
initialDate && /* @__PURE__ */
|
|
9140
|
-
/* @__PURE__ */
|
|
9141
|
-
/* @__PURE__ */
|
|
9468
|
+
horizontal: /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
9469
|
+
showDates && /* @__PURE__ */ jsxs41("div", { className: "flex flex-row gap-6 items-center", children: [
|
|
9470
|
+
initialDate && /* @__PURE__ */ jsxs41("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
9471
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
|
|
9472
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-600", children: initialDate })
|
|
9142
9473
|
] }),
|
|
9143
|
-
endDate && /* @__PURE__ */
|
|
9144
|
-
/* @__PURE__ */
|
|
9145
|
-
/* @__PURE__ */
|
|
9474
|
+
endDate && /* @__PURE__ */ jsxs41("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
9475
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-800 font-semibold", children: "Fim" }),
|
|
9476
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-600", children: endDate })
|
|
9146
9477
|
] })
|
|
9147
9478
|
] }),
|
|
9148
|
-
/* @__PURE__ */
|
|
9149
|
-
/* @__PURE__ */
|
|
9479
|
+
/* @__PURE__ */ jsxs41("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
9480
|
+
/* @__PURE__ */ jsx53(
|
|
9150
9481
|
ProgressBar_default,
|
|
9151
9482
|
{
|
|
9152
9483
|
size: "small",
|
|
@@ -9155,7 +9486,7 @@ var CardProgress = forwardRef17(
|
|
|
9155
9486
|
"data-testid": "progress-bar"
|
|
9156
9487
|
}
|
|
9157
9488
|
),
|
|
9158
|
-
/* @__PURE__ */
|
|
9489
|
+
/* @__PURE__ */ jsxs41(
|
|
9159
9490
|
Text_default,
|
|
9160
9491
|
{
|
|
9161
9492
|
size: "xs",
|
|
@@ -9171,9 +9502,9 @@ var CardProgress = forwardRef17(
|
|
|
9171
9502
|
)
|
|
9172
9503
|
] })
|
|
9173
9504
|
] }),
|
|
9174
|
-
vertical: /* @__PURE__ */
|
|
9505
|
+
vertical: /* @__PURE__ */ jsx53("p", { className: "text-sm text-text-800", children: subhead })
|
|
9175
9506
|
};
|
|
9176
|
-
return /* @__PURE__ */
|
|
9507
|
+
return /* @__PURE__ */ jsxs41(
|
|
9177
9508
|
CardBase,
|
|
9178
9509
|
{
|
|
9179
9510
|
ref,
|
|
@@ -9184,7 +9515,7 @@ var CardProgress = forwardRef17(
|
|
|
9184
9515
|
className: cn(isHorizontal ? "h-20" : "", className),
|
|
9185
9516
|
...props,
|
|
9186
9517
|
children: [
|
|
9187
|
-
/* @__PURE__ */
|
|
9518
|
+
/* @__PURE__ */ jsx53(
|
|
9188
9519
|
"div",
|
|
9189
9520
|
{
|
|
9190
9521
|
className: cn(
|
|
@@ -9197,7 +9528,7 @@ var CardProgress = forwardRef17(
|
|
|
9197
9528
|
children: icon
|
|
9198
9529
|
}
|
|
9199
9530
|
),
|
|
9200
|
-
/* @__PURE__ */
|
|
9531
|
+
/* @__PURE__ */ jsxs41(
|
|
9201
9532
|
"div",
|
|
9202
9533
|
{
|
|
9203
9534
|
className: cn(
|
|
@@ -9205,7 +9536,7 @@ var CardProgress = forwardRef17(
|
|
|
9205
9536
|
!isHorizontal && "gap-4"
|
|
9206
9537
|
),
|
|
9207
9538
|
children: [
|
|
9208
|
-
/* @__PURE__ */
|
|
9539
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
|
|
9209
9540
|
contentComponent[direction]
|
|
9210
9541
|
]
|
|
9211
9542
|
}
|
|
@@ -9225,7 +9556,7 @@ var CardTopic = forwardRef17(
|
|
|
9225
9556
|
className = "",
|
|
9226
9557
|
...props
|
|
9227
9558
|
}, ref) => {
|
|
9228
|
-
return /* @__PURE__ */
|
|
9559
|
+
return /* @__PURE__ */ jsxs41(
|
|
9229
9560
|
CardBase,
|
|
9230
9561
|
{
|
|
9231
9562
|
ref,
|
|
@@ -9236,13 +9567,13 @@ var CardTopic = forwardRef17(
|
|
|
9236
9567
|
className: cn("justify-center gap-2 py-2 px-4", className),
|
|
9237
9568
|
...props,
|
|
9238
9569
|
children: [
|
|
9239
|
-
subHead && /* @__PURE__ */
|
|
9240
|
-
/* @__PURE__ */
|
|
9241
|
-
index < subHead.length - 1 && /* @__PURE__ */
|
|
9570
|
+
subHead && /* @__PURE__ */ jsx53("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
9571
|
+
/* @__PURE__ */ jsx53("p", { children: text }),
|
|
9572
|
+
index < subHead.length - 1 && /* @__PURE__ */ jsx53("p", { children: "\u2022" })
|
|
9242
9573
|
] }, `${text} - ${index}`)) }),
|
|
9243
|
-
/* @__PURE__ */
|
|
9244
|
-
/* @__PURE__ */
|
|
9245
|
-
/* @__PURE__ */
|
|
9574
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
|
|
9575
|
+
/* @__PURE__ */ jsxs41("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
9576
|
+
/* @__PURE__ */ jsx53(
|
|
9246
9577
|
ProgressBar_default,
|
|
9247
9578
|
{
|
|
9248
9579
|
size: "small",
|
|
@@ -9251,7 +9582,7 @@ var CardTopic = forwardRef17(
|
|
|
9251
9582
|
"data-testid": "progress-bar"
|
|
9252
9583
|
}
|
|
9253
9584
|
),
|
|
9254
|
-
showPercentage && /* @__PURE__ */
|
|
9585
|
+
showPercentage && /* @__PURE__ */ jsxs41(
|
|
9255
9586
|
Text_default,
|
|
9256
9587
|
{
|
|
9257
9588
|
size: "xs",
|
|
@@ -9285,7 +9616,7 @@ var CardPerformance = forwardRef17(
|
|
|
9285
9616
|
...props
|
|
9286
9617
|
}, ref) => {
|
|
9287
9618
|
const hasProgress = progress !== void 0;
|
|
9288
|
-
return /* @__PURE__ */
|
|
9619
|
+
return /* @__PURE__ */ jsxs41(
|
|
9289
9620
|
CardBase,
|
|
9290
9621
|
{
|
|
9291
9622
|
ref,
|
|
@@ -9299,10 +9630,10 @@ var CardPerformance = forwardRef17(
|
|
|
9299
9630
|
onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
|
|
9300
9631
|
...props,
|
|
9301
9632
|
children: [
|
|
9302
|
-
/* @__PURE__ */
|
|
9303
|
-
/* @__PURE__ */
|
|
9304
|
-
/* @__PURE__ */
|
|
9305
|
-
actionVariant === "button" && /* @__PURE__ */
|
|
9633
|
+
/* @__PURE__ */ jsxs41("div", { className: "w-full flex flex-col justify-between gap-2", children: [
|
|
9634
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-row justify-between items-center gap-2", children: [
|
|
9635
|
+
/* @__PURE__ */ jsx53("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
9636
|
+
actionVariant === "button" && /* @__PURE__ */ jsx53(
|
|
9306
9637
|
Button_default,
|
|
9307
9638
|
{
|
|
9308
9639
|
variant: "outline",
|
|
@@ -9313,16 +9644,16 @@ var CardPerformance = forwardRef17(
|
|
|
9313
9644
|
}
|
|
9314
9645
|
)
|
|
9315
9646
|
] }),
|
|
9316
|
-
/* @__PURE__ */
|
|
9647
|
+
/* @__PURE__ */ jsx53("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ jsx53(
|
|
9317
9648
|
ProgressBar_default,
|
|
9318
9649
|
{
|
|
9319
9650
|
value: progress,
|
|
9320
9651
|
label: `${progress}% ${labelProgress}`,
|
|
9321
9652
|
variant: progressVariant
|
|
9322
9653
|
}
|
|
9323
|
-
) : /* @__PURE__ */
|
|
9654
|
+
) : /* @__PURE__ */ jsx53("p", { className: "text-xs text-text-600 truncate", children: description }) })
|
|
9324
9655
|
] }),
|
|
9325
|
-
actionVariant == "caret" && /* @__PURE__ */
|
|
9656
|
+
actionVariant == "caret" && /* @__PURE__ */ jsx53(
|
|
9326
9657
|
CaretRight6,
|
|
9327
9658
|
{
|
|
9328
9659
|
className: "size-4.5 text-text-800 cursor-pointer",
|
|
@@ -9346,7 +9677,7 @@ var CardResults = forwardRef17(
|
|
|
9346
9677
|
...props
|
|
9347
9678
|
}, ref) => {
|
|
9348
9679
|
const isRow = direction == "row";
|
|
9349
|
-
return /* @__PURE__ */
|
|
9680
|
+
return /* @__PURE__ */ jsxs41(
|
|
9350
9681
|
CardBase,
|
|
9351
9682
|
{
|
|
9352
9683
|
ref,
|
|
@@ -9356,7 +9687,7 @@ var CardResults = forwardRef17(
|
|
|
9356
9687
|
className: cn("items-stretch cursor-pointer pr-4", className),
|
|
9357
9688
|
...props,
|
|
9358
9689
|
children: [
|
|
9359
|
-
/* @__PURE__ */
|
|
9690
|
+
/* @__PURE__ */ jsx53(
|
|
9360
9691
|
"div",
|
|
9361
9692
|
{
|
|
9362
9693
|
className: cn(
|
|
@@ -9365,11 +9696,11 @@ var CardResults = forwardRef17(
|
|
|
9365
9696
|
style: {
|
|
9366
9697
|
backgroundColor: color
|
|
9367
9698
|
},
|
|
9368
|
-
children: /* @__PURE__ */
|
|
9699
|
+
children: /* @__PURE__ */ jsx53(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
|
|
9369
9700
|
}
|
|
9370
9701
|
),
|
|
9371
|
-
/* @__PURE__ */
|
|
9372
|
-
/* @__PURE__ */
|
|
9702
|
+
/* @__PURE__ */ jsxs41("div", { className: "w-full flex flex-row justify-between items-center", children: [
|
|
9703
|
+
/* @__PURE__ */ jsxs41(
|
|
9373
9704
|
"div",
|
|
9374
9705
|
{
|
|
9375
9706
|
className: cn(
|
|
@@ -9377,28 +9708,28 @@ var CardResults = forwardRef17(
|
|
|
9377
9708
|
isRow ? "flex-row items-center gap-2" : "flex-col"
|
|
9378
9709
|
),
|
|
9379
9710
|
children: [
|
|
9380
|
-
/* @__PURE__ */
|
|
9381
|
-
/* @__PURE__ */
|
|
9382
|
-
/* @__PURE__ */
|
|
9711
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
|
|
9712
|
+
/* @__PURE__ */ jsxs41("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
|
|
9713
|
+
/* @__PURE__ */ jsxs41(
|
|
9383
9714
|
Badge_default,
|
|
9384
9715
|
{
|
|
9385
9716
|
action: "success",
|
|
9386
9717
|
variant: "solid",
|
|
9387
9718
|
size: "large",
|
|
9388
|
-
iconLeft: /* @__PURE__ */
|
|
9719
|
+
iconLeft: /* @__PURE__ */ jsx53(CheckCircle3, {}),
|
|
9389
9720
|
children: [
|
|
9390
9721
|
correct_answers,
|
|
9391
9722
|
" Corretas"
|
|
9392
9723
|
]
|
|
9393
9724
|
}
|
|
9394
9725
|
),
|
|
9395
|
-
/* @__PURE__ */
|
|
9726
|
+
/* @__PURE__ */ jsxs41(
|
|
9396
9727
|
Badge_default,
|
|
9397
9728
|
{
|
|
9398
9729
|
action: "error",
|
|
9399
9730
|
variant: "solid",
|
|
9400
9731
|
size: "large",
|
|
9401
|
-
iconLeft: /* @__PURE__ */
|
|
9732
|
+
iconLeft: /* @__PURE__ */ jsx53(XCircle2, {}),
|
|
9402
9733
|
children: [
|
|
9403
9734
|
incorrect_answers,
|
|
9404
9735
|
" Incorretas"
|
|
@@ -9409,7 +9740,7 @@ var CardResults = forwardRef17(
|
|
|
9409
9740
|
]
|
|
9410
9741
|
}
|
|
9411
9742
|
),
|
|
9412
|
-
/* @__PURE__ */
|
|
9743
|
+
/* @__PURE__ */ jsx53(CaretRight6, { className: "min-w-6 min-h-6 text-text-800" })
|
|
9413
9744
|
] })
|
|
9414
9745
|
]
|
|
9415
9746
|
}
|
|
@@ -9435,13 +9766,13 @@ var CardStatus = forwardRef17(
|
|
|
9435
9766
|
const getIconBadge = (status2) => {
|
|
9436
9767
|
switch (status2) {
|
|
9437
9768
|
case "correct":
|
|
9438
|
-
return /* @__PURE__ */
|
|
9769
|
+
return /* @__PURE__ */ jsx53(CheckCircle3, {});
|
|
9439
9770
|
case "incorrect":
|
|
9440
|
-
return /* @__PURE__ */
|
|
9771
|
+
return /* @__PURE__ */ jsx53(XCircle2, {});
|
|
9441
9772
|
case "pending":
|
|
9442
|
-
return /* @__PURE__ */
|
|
9773
|
+
return /* @__PURE__ */ jsx53(Clock, {});
|
|
9443
9774
|
default:
|
|
9444
|
-
return /* @__PURE__ */
|
|
9775
|
+
return /* @__PURE__ */ jsx53(XCircle2, {});
|
|
9445
9776
|
}
|
|
9446
9777
|
};
|
|
9447
9778
|
const getActionBadge = (status2) => {
|
|
@@ -9456,7 +9787,7 @@ var CardStatus = forwardRef17(
|
|
|
9456
9787
|
return "info";
|
|
9457
9788
|
}
|
|
9458
9789
|
};
|
|
9459
|
-
return /* @__PURE__ */
|
|
9790
|
+
return /* @__PURE__ */ jsx53(
|
|
9460
9791
|
CardBase,
|
|
9461
9792
|
{
|
|
9462
9793
|
ref,
|
|
@@ -9465,10 +9796,10 @@ var CardStatus = forwardRef17(
|
|
|
9465
9796
|
minHeight: "medium",
|
|
9466
9797
|
className: cn("items-center cursor-pointer", className),
|
|
9467
9798
|
...props,
|
|
9468
|
-
children: /* @__PURE__ */
|
|
9469
|
-
/* @__PURE__ */
|
|
9470
|
-
/* @__PURE__ */
|
|
9471
|
-
status && /* @__PURE__ */
|
|
9799
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
|
|
9800
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
9801
|
+
/* @__PURE__ */ jsxs41("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
|
|
9802
|
+
status && /* @__PURE__ */ jsx53(
|
|
9472
9803
|
Badge_default,
|
|
9473
9804
|
{
|
|
9474
9805
|
action: getActionBadge(status),
|
|
@@ -9478,9 +9809,9 @@ var CardStatus = forwardRef17(
|
|
|
9478
9809
|
children: getLabelBadge(status)
|
|
9479
9810
|
}
|
|
9480
9811
|
),
|
|
9481
|
-
label && /* @__PURE__ */
|
|
9812
|
+
label && /* @__PURE__ */ jsx53("p", { className: "text-sm text-text-800", children: label })
|
|
9482
9813
|
] }),
|
|
9483
|
-
/* @__PURE__ */
|
|
9814
|
+
/* @__PURE__ */ jsx53(CaretRight6, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
|
|
9484
9815
|
] })
|
|
9485
9816
|
}
|
|
9486
9817
|
);
|
|
@@ -9488,7 +9819,7 @@ var CardStatus = forwardRef17(
|
|
|
9488
9819
|
);
|
|
9489
9820
|
var CardSettings = forwardRef17(
|
|
9490
9821
|
({ header, className, icon, ...props }, ref) => {
|
|
9491
|
-
return /* @__PURE__ */
|
|
9822
|
+
return /* @__PURE__ */ jsxs41(
|
|
9492
9823
|
CardBase,
|
|
9493
9824
|
{
|
|
9494
9825
|
ref,
|
|
@@ -9501,9 +9832,9 @@ var CardSettings = forwardRef17(
|
|
|
9501
9832
|
),
|
|
9502
9833
|
...props,
|
|
9503
9834
|
children: [
|
|
9504
|
-
/* @__PURE__ */
|
|
9505
|
-
/* @__PURE__ */
|
|
9506
|
-
/* @__PURE__ */
|
|
9835
|
+
/* @__PURE__ */ jsx53("span", { className: "[&>svg]:size-6", children: icon }),
|
|
9836
|
+
/* @__PURE__ */ jsx53("p", { className: "w-full text-sm truncate", children: header }),
|
|
9837
|
+
/* @__PURE__ */ jsx53(CaretRight6, { size: 24, className: "cursor-pointer" })
|
|
9507
9838
|
]
|
|
9508
9839
|
}
|
|
9509
9840
|
);
|
|
@@ -9511,7 +9842,7 @@ var CardSettings = forwardRef17(
|
|
|
9511
9842
|
);
|
|
9512
9843
|
var CardSupport = forwardRef17(
|
|
9513
9844
|
({ header, className, direction = "col", children, ...props }, ref) => {
|
|
9514
|
-
return /* @__PURE__ */
|
|
9845
|
+
return /* @__PURE__ */ jsxs41(
|
|
9515
9846
|
CardBase,
|
|
9516
9847
|
{
|
|
9517
9848
|
ref,
|
|
@@ -9524,7 +9855,7 @@ var CardSupport = forwardRef17(
|
|
|
9524
9855
|
),
|
|
9525
9856
|
...props,
|
|
9526
9857
|
children: [
|
|
9527
|
-
/* @__PURE__ */
|
|
9858
|
+
/* @__PURE__ */ jsxs41(
|
|
9528
9859
|
"div",
|
|
9529
9860
|
{
|
|
9530
9861
|
className: cn(
|
|
@@ -9532,12 +9863,12 @@ var CardSupport = forwardRef17(
|
|
|
9532
9863
|
direction == "col" ? "flex-col" : "flex-row items-center"
|
|
9533
9864
|
),
|
|
9534
9865
|
children: [
|
|
9535
|
-
/* @__PURE__ */
|
|
9536
|
-
/* @__PURE__ */
|
|
9866
|
+
/* @__PURE__ */ jsx53("span", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx53("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
|
|
9867
|
+
/* @__PURE__ */ jsx53("span", { className: "flex flex-row gap-1", children })
|
|
9537
9868
|
]
|
|
9538
9869
|
}
|
|
9539
9870
|
),
|
|
9540
|
-
/* @__PURE__ */
|
|
9871
|
+
/* @__PURE__ */ jsx53(CaretRight6, { className: "text-text-800 cursor-pointer", size: 24 })
|
|
9541
9872
|
]
|
|
9542
9873
|
}
|
|
9543
9874
|
);
|
|
@@ -9557,7 +9888,7 @@ var CardForum = forwardRef17(
|
|
|
9557
9888
|
hour,
|
|
9558
9889
|
...props
|
|
9559
9890
|
}, ref) => {
|
|
9560
|
-
return /* @__PURE__ */
|
|
9891
|
+
return /* @__PURE__ */ jsxs41(
|
|
9561
9892
|
CardBase,
|
|
9562
9893
|
{
|
|
9563
9894
|
ref,
|
|
@@ -9568,7 +9899,7 @@ var CardForum = forwardRef17(
|
|
|
9568
9899
|
className: cn("w-auto h-auto gap-3", className),
|
|
9569
9900
|
...props,
|
|
9570
9901
|
children: [
|
|
9571
|
-
/* @__PURE__ */
|
|
9902
|
+
/* @__PURE__ */ jsx53(
|
|
9572
9903
|
"button",
|
|
9573
9904
|
{
|
|
9574
9905
|
type: "button",
|
|
@@ -9577,18 +9908,18 @@ var CardForum = forwardRef17(
|
|
|
9577
9908
|
className: "min-w-8 h-8 rounded-full bg-background-950"
|
|
9578
9909
|
}
|
|
9579
9910
|
),
|
|
9580
|
-
/* @__PURE__ */
|
|
9581
|
-
/* @__PURE__ */
|
|
9582
|
-
/* @__PURE__ */
|
|
9583
|
-
/* @__PURE__ */
|
|
9911
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
|
|
9912
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
|
|
9913
|
+
/* @__PURE__ */ jsx53("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
|
|
9914
|
+
/* @__PURE__ */ jsxs41("p", { className: "text-xs text-text-600", children: [
|
|
9584
9915
|
"\u2022 ",
|
|
9585
9916
|
date,
|
|
9586
9917
|
" \u2022 ",
|
|
9587
9918
|
hour
|
|
9588
9919
|
] })
|
|
9589
9920
|
] }),
|
|
9590
|
-
/* @__PURE__ */
|
|
9591
|
-
/* @__PURE__ */
|
|
9921
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
|
|
9922
|
+
/* @__PURE__ */ jsxs41(
|
|
9592
9923
|
"button",
|
|
9593
9924
|
{
|
|
9594
9925
|
type: "button",
|
|
@@ -9596,8 +9927,8 @@ var CardForum = forwardRef17(
|
|
|
9596
9927
|
onClick: () => onClickComments?.(valueComments),
|
|
9597
9928
|
className: "text-text-600 flex flex-row gap-2 items-center",
|
|
9598
9929
|
children: [
|
|
9599
|
-
/* @__PURE__ */
|
|
9600
|
-
/* @__PURE__ */
|
|
9930
|
+
/* @__PURE__ */ jsx53(ChatCircleText, { "aria-hidden": "true", size: 16 }),
|
|
9931
|
+
/* @__PURE__ */ jsxs41("p", { className: "text-xs", children: [
|
|
9601
9932
|
comments,
|
|
9602
9933
|
" respostas"
|
|
9603
9934
|
] })
|
|
@@ -9624,13 +9955,13 @@ var CardAudio = forwardRef17(
|
|
|
9624
9955
|
className,
|
|
9625
9956
|
...props
|
|
9626
9957
|
}, ref) => {
|
|
9627
|
-
const [isPlaying, setIsPlaying] =
|
|
9628
|
-
const [currentTime, setCurrentTime] =
|
|
9629
|
-
const [duration, setDuration] =
|
|
9630
|
-
const [volume, setVolume] =
|
|
9631
|
-
const [showVolumeControl, setShowVolumeControl] =
|
|
9632
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
9633
|
-
const [playbackRate, setPlaybackRate] =
|
|
9958
|
+
const [isPlaying, setIsPlaying] = useState19(false);
|
|
9959
|
+
const [currentTime, setCurrentTime] = useState19(0);
|
|
9960
|
+
const [duration, setDuration] = useState19(0);
|
|
9961
|
+
const [volume, setVolume] = useState19(1);
|
|
9962
|
+
const [showVolumeControl, setShowVolumeControl] = useState19(false);
|
|
9963
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState19(false);
|
|
9964
|
+
const [playbackRate, setPlaybackRate] = useState19(1);
|
|
9634
9965
|
const audioRef = useRef10(null);
|
|
9635
9966
|
const volumeControlRef = useRef10(null);
|
|
9636
9967
|
const speedMenuRef = useRef10(null);
|
|
@@ -9700,14 +10031,14 @@ var CardAudio = forwardRef17(
|
|
|
9700
10031
|
};
|
|
9701
10032
|
const getVolumeIcon = () => {
|
|
9702
10033
|
if (volume === 0) {
|
|
9703
|
-
return /* @__PURE__ */
|
|
10034
|
+
return /* @__PURE__ */ jsx53(SpeakerSimpleX, { size: 24 });
|
|
9704
10035
|
}
|
|
9705
10036
|
if (volume < 0.5) {
|
|
9706
|
-
return /* @__PURE__ */
|
|
10037
|
+
return /* @__PURE__ */ jsx53(SpeakerLow, { size: 24 });
|
|
9707
10038
|
}
|
|
9708
|
-
return /* @__PURE__ */
|
|
10039
|
+
return /* @__PURE__ */ jsx53(SpeakerHigh, { size: 24 });
|
|
9709
10040
|
};
|
|
9710
|
-
|
|
10041
|
+
useEffect21(() => {
|
|
9711
10042
|
const handleClickOutside = (event) => {
|
|
9712
10043
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
9713
10044
|
setShowVolumeControl(false);
|
|
@@ -9721,7 +10052,7 @@ var CardAudio = forwardRef17(
|
|
|
9721
10052
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
9722
10053
|
};
|
|
9723
10054
|
}, []);
|
|
9724
|
-
return /* @__PURE__ */
|
|
10055
|
+
return /* @__PURE__ */ jsxs41(
|
|
9725
10056
|
CardBase,
|
|
9726
10057
|
{
|
|
9727
10058
|
ref,
|
|
@@ -9734,7 +10065,7 @@ var CardAudio = forwardRef17(
|
|
|
9734
10065
|
),
|
|
9735
10066
|
...props,
|
|
9736
10067
|
children: [
|
|
9737
|
-
/* @__PURE__ */
|
|
10068
|
+
/* @__PURE__ */ jsx53(
|
|
9738
10069
|
"audio",
|
|
9739
10070
|
{
|
|
9740
10071
|
ref: audioRef,
|
|
@@ -9746,7 +10077,7 @@ var CardAudio = forwardRef17(
|
|
|
9746
10077
|
onEnded: handleEnded,
|
|
9747
10078
|
"data-testid": "audio-element",
|
|
9748
10079
|
"aria-label": title,
|
|
9749
|
-
children: tracks ? tracks.map((track) => /* @__PURE__ */
|
|
10080
|
+
children: tracks ? tracks.map((track) => /* @__PURE__ */ jsx53(
|
|
9750
10081
|
"track",
|
|
9751
10082
|
{
|
|
9752
10083
|
kind: track.kind,
|
|
@@ -9756,7 +10087,7 @@ var CardAudio = forwardRef17(
|
|
|
9756
10087
|
default: track.default
|
|
9757
10088
|
},
|
|
9758
10089
|
track.src
|
|
9759
|
-
)) : /* @__PURE__ */
|
|
10090
|
+
)) : /* @__PURE__ */ jsx53(
|
|
9760
10091
|
"track",
|
|
9761
10092
|
{
|
|
9762
10093
|
kind: "captions",
|
|
@@ -9767,7 +10098,7 @@ var CardAudio = forwardRef17(
|
|
|
9767
10098
|
)
|
|
9768
10099
|
}
|
|
9769
10100
|
),
|
|
9770
|
-
/* @__PURE__ */
|
|
10101
|
+
/* @__PURE__ */ jsx53(
|
|
9771
10102
|
"button",
|
|
9772
10103
|
{
|
|
9773
10104
|
type: "button",
|
|
@@ -9775,14 +10106,14 @@ var CardAudio = forwardRef17(
|
|
|
9775
10106
|
disabled: !src,
|
|
9776
10107
|
className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
|
|
9777
10108
|
"aria-label": isPlaying ? "Pausar" : "Reproduzir",
|
|
9778
|
-
children: isPlaying ? /* @__PURE__ */
|
|
9779
|
-
/* @__PURE__ */
|
|
9780
|
-
/* @__PURE__ */
|
|
9781
|
-
] }) }) : /* @__PURE__ */
|
|
10109
|
+
children: isPlaying ? /* @__PURE__ */ jsx53("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ jsxs41("div", { className: "flex gap-0.5", children: [
|
|
10110
|
+
/* @__PURE__ */ jsx53("div", { className: "w-1 h-4 bg-current rounded-sm" }),
|
|
10111
|
+
/* @__PURE__ */ jsx53("div", { className: "w-1 h-4 bg-current rounded-sm" })
|
|
10112
|
+
] }) }) : /* @__PURE__ */ jsx53(Play, { size: 24 })
|
|
9782
10113
|
}
|
|
9783
10114
|
),
|
|
9784
|
-
/* @__PURE__ */
|
|
9785
|
-
/* @__PURE__ */
|
|
10115
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(currentTime) }),
|
|
10116
|
+
/* @__PURE__ */ jsx53("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ jsx53(
|
|
9786
10117
|
"button",
|
|
9787
10118
|
{
|
|
9788
10119
|
type: "button",
|
|
@@ -9797,7 +10128,7 @@ var CardAudio = forwardRef17(
|
|
|
9797
10128
|
}
|
|
9798
10129
|
},
|
|
9799
10130
|
"aria-label": "Barra de progresso do \xE1udio",
|
|
9800
|
-
children: /* @__PURE__ */
|
|
10131
|
+
children: /* @__PURE__ */ jsx53(
|
|
9801
10132
|
"div",
|
|
9802
10133
|
{
|
|
9803
10134
|
className: "h-full bg-primary-600 rounded-full transition-all duration-100",
|
|
@@ -9808,19 +10139,19 @@ var CardAudio = forwardRef17(
|
|
|
9808
10139
|
)
|
|
9809
10140
|
}
|
|
9810
10141
|
) }),
|
|
9811
|
-
/* @__PURE__ */
|
|
9812
|
-
/* @__PURE__ */
|
|
9813
|
-
/* @__PURE__ */
|
|
10142
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(duration) }),
|
|
10143
|
+
/* @__PURE__ */ jsxs41("div", { className: "relative h-6", ref: volumeControlRef, children: [
|
|
10144
|
+
/* @__PURE__ */ jsx53(
|
|
9814
10145
|
"button",
|
|
9815
10146
|
{
|
|
9816
10147
|
type: "button",
|
|
9817
10148
|
onClick: toggleVolumeControl,
|
|
9818
10149
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
9819
10150
|
"aria-label": "Controle de volume",
|
|
9820
|
-
children: /* @__PURE__ */
|
|
10151
|
+
children: /* @__PURE__ */ jsx53("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
|
|
9821
10152
|
}
|
|
9822
10153
|
),
|
|
9823
|
-
showVolumeControl && /* @__PURE__ */
|
|
10154
|
+
showVolumeControl && /* @__PURE__ */ jsx53(
|
|
9824
10155
|
"button",
|
|
9825
10156
|
{
|
|
9826
10157
|
type: "button",
|
|
@@ -9830,7 +10161,7 @@ var CardAudio = forwardRef17(
|
|
|
9830
10161
|
setShowVolumeControl(false);
|
|
9831
10162
|
}
|
|
9832
10163
|
},
|
|
9833
|
-
children: /* @__PURE__ */
|
|
10164
|
+
children: /* @__PURE__ */ jsx53(
|
|
9834
10165
|
"input",
|
|
9835
10166
|
{
|
|
9836
10167
|
type: "range",
|
|
@@ -9871,22 +10202,22 @@ var CardAudio = forwardRef17(
|
|
|
9871
10202
|
}
|
|
9872
10203
|
)
|
|
9873
10204
|
] }),
|
|
9874
|
-
/* @__PURE__ */
|
|
9875
|
-
/* @__PURE__ */
|
|
10205
|
+
/* @__PURE__ */ jsxs41("div", { className: "relative h-6", ref: speedMenuRef, children: [
|
|
10206
|
+
/* @__PURE__ */ jsx53(
|
|
9876
10207
|
"button",
|
|
9877
10208
|
{
|
|
9878
10209
|
type: "button",
|
|
9879
10210
|
onClick: toggleSpeedMenu,
|
|
9880
10211
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
9881
10212
|
"aria-label": "Op\xE7\xF5es de velocidade",
|
|
9882
|
-
children: /* @__PURE__ */
|
|
10213
|
+
children: /* @__PURE__ */ jsx53(DotsThreeVertical2, { size: 24 })
|
|
9883
10214
|
}
|
|
9884
10215
|
),
|
|
9885
|
-
showSpeedMenu && /* @__PURE__ */
|
|
10216
|
+
showSpeedMenu && /* @__PURE__ */ jsx53("div", { className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg min-w-24 z-10", children: /* @__PURE__ */ jsx53("div", { className: "flex flex-col gap-1", children: [
|
|
9886
10217
|
{ speed: 1, label: "1x" },
|
|
9887
10218
|
{ speed: 1.5, label: "1.5x" },
|
|
9888
10219
|
{ speed: 2, label: "2x" }
|
|
9889
|
-
].map(({ speed, label }) => /* @__PURE__ */
|
|
10220
|
+
].map(({ speed, label }) => /* @__PURE__ */ jsx53(
|
|
9890
10221
|
"button",
|
|
9891
10222
|
{
|
|
9892
10223
|
type: "button",
|
|
@@ -9914,7 +10245,7 @@ var SIMULADO_BACKGROUND_CLASSES = {
|
|
|
9914
10245
|
var CardSimulado = forwardRef17(
|
|
9915
10246
|
({ title, duration, info, backgroundColor, className, ...props }, ref) => {
|
|
9916
10247
|
const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
|
|
9917
|
-
return /* @__PURE__ */
|
|
10248
|
+
return /* @__PURE__ */ jsx53(
|
|
9918
10249
|
CardBase,
|
|
9919
10250
|
{
|
|
9920
10251
|
ref,
|
|
@@ -9927,18 +10258,18 @@ var CardSimulado = forwardRef17(
|
|
|
9927
10258
|
className
|
|
9928
10259
|
),
|
|
9929
10260
|
...props,
|
|
9930
|
-
children: /* @__PURE__ */
|
|
9931
|
-
/* @__PURE__ */
|
|
9932
|
-
/* @__PURE__ */
|
|
9933
|
-
/* @__PURE__ */
|
|
9934
|
-
duration && /* @__PURE__ */
|
|
9935
|
-
/* @__PURE__ */
|
|
9936
|
-
/* @__PURE__ */
|
|
10261
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex justify-between items-center w-full gap-4", children: [
|
|
10262
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
10263
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
|
|
10264
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-4 text-text-700", children: [
|
|
10265
|
+
duration && /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1", children: [
|
|
10266
|
+
/* @__PURE__ */ jsx53(Clock, { size: 16, className: "flex-shrink-0" }),
|
|
10267
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "sm", children: duration })
|
|
9937
10268
|
] }),
|
|
9938
|
-
/* @__PURE__ */
|
|
10269
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "sm", className: "truncate", children: info })
|
|
9939
10270
|
] })
|
|
9940
10271
|
] }),
|
|
9941
|
-
/* @__PURE__ */
|
|
10272
|
+
/* @__PURE__ */ jsx53(
|
|
9942
10273
|
CaretRight6,
|
|
9943
10274
|
{
|
|
9944
10275
|
size: 24,
|
|
@@ -9983,7 +10314,7 @@ var CardTest = forwardRef17(
|
|
|
9983
10314
|
const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
|
|
9984
10315
|
const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
|
|
9985
10316
|
if (isSelectable) {
|
|
9986
|
-
return /* @__PURE__ */
|
|
10317
|
+
return /* @__PURE__ */ jsx53(
|
|
9987
10318
|
"button",
|
|
9988
10319
|
{
|
|
9989
10320
|
ref,
|
|
@@ -9995,8 +10326,8 @@ var CardTest = forwardRef17(
|
|
|
9995
10326
|
onKeyDown: handleKeyDown,
|
|
9996
10327
|
"aria-pressed": selected,
|
|
9997
10328
|
...props,
|
|
9998
|
-
children: /* @__PURE__ */
|
|
9999
|
-
/* @__PURE__ */
|
|
10329
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
10330
|
+
/* @__PURE__ */ jsx53(
|
|
10000
10331
|
Text_default,
|
|
10001
10332
|
{
|
|
10002
10333
|
size: "md",
|
|
@@ -10005,10 +10336,10 @@ var CardTest = forwardRef17(
|
|
|
10005
10336
|
children: title
|
|
10006
10337
|
}
|
|
10007
10338
|
),
|
|
10008
|
-
/* @__PURE__ */
|
|
10009
|
-
duration && /* @__PURE__ */
|
|
10010
|
-
/* @__PURE__ */
|
|
10011
|
-
/* @__PURE__ */
|
|
10339
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
10340
|
+
duration && /* @__PURE__ */ jsxs41("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
10341
|
+
/* @__PURE__ */ jsx53(Clock, { size: 16, className: "text-text-700" }),
|
|
10342
|
+
/* @__PURE__ */ jsx53(
|
|
10012
10343
|
Text_default,
|
|
10013
10344
|
{
|
|
10014
10345
|
size: "sm",
|
|
@@ -10017,7 +10348,7 @@ var CardTest = forwardRef17(
|
|
|
10017
10348
|
}
|
|
10018
10349
|
)
|
|
10019
10350
|
] }),
|
|
10020
|
-
/* @__PURE__ */
|
|
10351
|
+
/* @__PURE__ */ jsx53(
|
|
10021
10352
|
Text_default,
|
|
10022
10353
|
{
|
|
10023
10354
|
size: "sm",
|
|
@@ -10030,14 +10361,14 @@ var CardTest = forwardRef17(
|
|
|
10030
10361
|
}
|
|
10031
10362
|
);
|
|
10032
10363
|
}
|
|
10033
|
-
return /* @__PURE__ */
|
|
10364
|
+
return /* @__PURE__ */ jsx53(
|
|
10034
10365
|
"div",
|
|
10035
10366
|
{
|
|
10036
10367
|
ref,
|
|
10037
10368
|
className: cn(`${baseClasses} ${className}`.trim()),
|
|
10038
10369
|
...props,
|
|
10039
|
-
children: /* @__PURE__ */
|
|
10040
|
-
/* @__PURE__ */
|
|
10370
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
10371
|
+
/* @__PURE__ */ jsx53(
|
|
10041
10372
|
Text_default,
|
|
10042
10373
|
{
|
|
10043
10374
|
size: "md",
|
|
@@ -10046,10 +10377,10 @@ var CardTest = forwardRef17(
|
|
|
10046
10377
|
children: title
|
|
10047
10378
|
}
|
|
10048
10379
|
),
|
|
10049
|
-
/* @__PURE__ */
|
|
10050
|
-
duration && /* @__PURE__ */
|
|
10051
|
-
/* @__PURE__ */
|
|
10052
|
-
/* @__PURE__ */
|
|
10380
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
10381
|
+
duration && /* @__PURE__ */ jsxs41("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
10382
|
+
/* @__PURE__ */ jsx53(Clock, { size: 16, className: "text-text-700" }),
|
|
10383
|
+
/* @__PURE__ */ jsx53(
|
|
10053
10384
|
Text_default,
|
|
10054
10385
|
{
|
|
10055
10386
|
size: "sm",
|
|
@@ -10058,7 +10389,7 @@ var CardTest = forwardRef17(
|
|
|
10058
10389
|
}
|
|
10059
10390
|
)
|
|
10060
10391
|
] }),
|
|
10061
|
-
/* @__PURE__ */
|
|
10392
|
+
/* @__PURE__ */ jsx53(
|
|
10062
10393
|
Text_default,
|
|
10063
10394
|
{
|
|
10064
10395
|
size: "sm",
|
|
@@ -10095,14 +10426,14 @@ var SIMULATION_TYPE_STYLES = {
|
|
|
10095
10426
|
}
|
|
10096
10427
|
};
|
|
10097
10428
|
var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className, ...props }, ref) => {
|
|
10098
|
-
return /* @__PURE__ */
|
|
10429
|
+
return /* @__PURE__ */ jsx53(
|
|
10099
10430
|
"div",
|
|
10100
10431
|
{
|
|
10101
10432
|
ref,
|
|
10102
10433
|
className: cn("w-full max-w-[992px] h-auto", className),
|
|
10103
10434
|
...props,
|
|
10104
|
-
children: /* @__PURE__ */
|
|
10105
|
-
data.map((section, sectionIndex) => /* @__PURE__ */
|
|
10435
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-0", children: [
|
|
10436
|
+
data.map((section, sectionIndex) => /* @__PURE__ */ jsx53("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs41(
|
|
10106
10437
|
"div",
|
|
10107
10438
|
{
|
|
10108
10439
|
className: cn(
|
|
@@ -10110,7 +10441,7 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10110
10441
|
sectionIndex === 0 ? "rounded-t-3xl" : ""
|
|
10111
10442
|
),
|
|
10112
10443
|
children: [
|
|
10113
|
-
/* @__PURE__ */
|
|
10444
|
+
/* @__PURE__ */ jsx53(
|
|
10114
10445
|
Text_default,
|
|
10115
10446
|
{
|
|
10116
10447
|
size: "xs",
|
|
@@ -10119,9 +10450,9 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10119
10450
|
children: section.date
|
|
10120
10451
|
}
|
|
10121
10452
|
),
|
|
10122
|
-
/* @__PURE__ */
|
|
10453
|
+
/* @__PURE__ */ jsx53("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
|
|
10123
10454
|
const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
|
|
10124
|
-
return /* @__PURE__ */
|
|
10455
|
+
return /* @__PURE__ */ jsx53(
|
|
10125
10456
|
CardBase,
|
|
10126
10457
|
{
|
|
10127
10458
|
layout: "horizontal",
|
|
@@ -10133,9 +10464,9 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10133
10464
|
transition-shadow duration-200 h-auto min-h-[61px]`
|
|
10134
10465
|
),
|
|
10135
10466
|
onClick: () => onSimulationClick?.(simulation),
|
|
10136
|
-
children: /* @__PURE__ */
|
|
10137
|
-
/* @__PURE__ */
|
|
10138
|
-
/* @__PURE__ */
|
|
10467
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex justify-between items-center w-full gap-2", children: [
|
|
10468
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
|
|
10469
|
+
/* @__PURE__ */ jsx53(
|
|
10139
10470
|
Text_default,
|
|
10140
10471
|
{
|
|
10141
10472
|
size: "lg",
|
|
@@ -10144,8 +10475,8 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10144
10475
|
children: simulation.title
|
|
10145
10476
|
}
|
|
10146
10477
|
),
|
|
10147
|
-
/* @__PURE__ */
|
|
10148
|
-
/* @__PURE__ */
|
|
10478
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
10479
|
+
/* @__PURE__ */ jsx53(
|
|
10149
10480
|
Badge_default,
|
|
10150
10481
|
{
|
|
10151
10482
|
variant: "examsOutlined",
|
|
@@ -10154,10 +10485,10 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10154
10485
|
children: typeStyles.text
|
|
10155
10486
|
}
|
|
10156
10487
|
),
|
|
10157
|
-
/* @__PURE__ */
|
|
10488
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
|
|
10158
10489
|
] })
|
|
10159
10490
|
] }),
|
|
10160
|
-
/* @__PURE__ */
|
|
10491
|
+
/* @__PURE__ */ jsx53(
|
|
10161
10492
|
CaretRight6,
|
|
10162
10493
|
{
|
|
10163
10494
|
size: 24,
|
|
@@ -10173,7 +10504,7 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10173
10504
|
]
|
|
10174
10505
|
}
|
|
10175
10506
|
) }, section.date)),
|
|
10176
|
-
data.length > 0 && /* @__PURE__ */
|
|
10507
|
+
data.length > 0 && /* @__PURE__ */ jsx53("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
|
|
10177
10508
|
] })
|
|
10178
10509
|
}
|
|
10179
10510
|
);
|
|
@@ -10181,7 +10512,7 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10181
10512
|
|
|
10182
10513
|
// src/components/StatisticsCard/StatisticsCard.tsx
|
|
10183
10514
|
import { Plus } from "phosphor-react";
|
|
10184
|
-
import { jsx as
|
|
10515
|
+
import { jsx as jsx54, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
10185
10516
|
var VARIANT_STYLES = {
|
|
10186
10517
|
high: "bg-success-background",
|
|
10187
10518
|
medium: "bg-warning-background",
|
|
@@ -10195,12 +10526,12 @@ var VALUE_TEXT_COLORS = {
|
|
|
10195
10526
|
total: "text-info-700"
|
|
10196
10527
|
};
|
|
10197
10528
|
var StatCard = ({ item, showPlaceholder = false }) => {
|
|
10198
|
-
return /* @__PURE__ */
|
|
10529
|
+
return /* @__PURE__ */ jsxs42(
|
|
10199
10530
|
"div",
|
|
10200
10531
|
{
|
|
10201
10532
|
className: `rounded-xl py-[17px] px-6 min-h-[105px] flex flex-col justify-center items-start gap-1 ${VARIANT_STYLES[item.variant]}`,
|
|
10202
10533
|
children: [
|
|
10203
|
-
/* @__PURE__ */
|
|
10534
|
+
/* @__PURE__ */ jsx54(
|
|
10204
10535
|
Text_default,
|
|
10205
10536
|
{
|
|
10206
10537
|
size: "4xl",
|
|
@@ -10209,7 +10540,7 @@ var StatCard = ({ item, showPlaceholder = false }) => {
|
|
|
10209
10540
|
children: showPlaceholder ? "-" : item.value
|
|
10210
10541
|
}
|
|
10211
10542
|
),
|
|
10212
|
-
/* @__PURE__ */
|
|
10543
|
+
/* @__PURE__ */ jsx54(
|
|
10213
10544
|
Text_default,
|
|
10214
10545
|
{
|
|
10215
10546
|
size: "xs",
|
|
@@ -10244,13 +10575,13 @@ var StatisticsCard = ({
|
|
|
10244
10575
|
}) => {
|
|
10245
10576
|
const hasData = data && data.length > 0;
|
|
10246
10577
|
const gridColumnsClass = hasData ? getGridColumnsClass(data.length) : "";
|
|
10247
|
-
return /* @__PURE__ */
|
|
10578
|
+
return /* @__PURE__ */ jsxs42(
|
|
10248
10579
|
"div",
|
|
10249
10580
|
{
|
|
10250
10581
|
className: `bg-background rounded-xl p-4 h-auto lg:h-[185px] flex flex-col gap-2 ${className}`,
|
|
10251
10582
|
children: [
|
|
10252
|
-
/* @__PURE__ */
|
|
10253
|
-
/* @__PURE__ */
|
|
10583
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex flex-row justify-between items-center gap-4", children: [
|
|
10584
|
+
/* @__PURE__ */ jsx54(
|
|
10254
10585
|
Text_default,
|
|
10255
10586
|
{
|
|
10256
10587
|
as: "h3",
|
|
@@ -10261,22 +10592,22 @@ var StatisticsCard = ({
|
|
|
10261
10592
|
children: title
|
|
10262
10593
|
}
|
|
10263
10594
|
),
|
|
10264
|
-
dropdownOptions && dropdownOptions.length > 0 && /* @__PURE__ */
|
|
10595
|
+
dropdownOptions && dropdownOptions.length > 0 && /* @__PURE__ */ jsx54("div", { className: "w-[120px] min-w-[90px] sm:shrink-0", children: /* @__PURE__ */ jsxs42(
|
|
10265
10596
|
Select_default,
|
|
10266
10597
|
{
|
|
10267
10598
|
value: selectedDropdownValue,
|
|
10268
10599
|
onValueChange: onDropdownChange,
|
|
10269
10600
|
size: "medium",
|
|
10270
10601
|
children: [
|
|
10271
|
-
/* @__PURE__ */
|
|
10602
|
+
/* @__PURE__ */ jsx54(
|
|
10272
10603
|
SelectTrigger,
|
|
10273
10604
|
{
|
|
10274
10605
|
className: "border border-border-300 rounded [&>span]:whitespace-nowrap [&>span]:overflow-hidden [&>span]:text-ellipsis",
|
|
10275
10606
|
"aria-label": dropdownAriaLabel,
|
|
10276
|
-
children: /* @__PURE__ */
|
|
10607
|
+
children: /* @__PURE__ */ jsx54(SelectValue, { placeholder: selectPlaceholder })
|
|
10277
10608
|
}
|
|
10278
10609
|
),
|
|
10279
|
-
/* @__PURE__ */
|
|
10610
|
+
/* @__PURE__ */ jsx54(SelectContent, { className: "min-w-[120px]", children: dropdownOptions.map((option) => /* @__PURE__ */ jsx54(
|
|
10280
10611
|
SelectItem,
|
|
10281
10612
|
{
|
|
10282
10613
|
value: option.value,
|
|
@@ -10289,11 +10620,11 @@ var StatisticsCard = ({
|
|
|
10289
10620
|
}
|
|
10290
10621
|
) })
|
|
10291
10622
|
] }),
|
|
10292
|
-
hasData ? /* @__PURE__ */
|
|
10623
|
+
hasData ? /* @__PURE__ */ jsx54(
|
|
10293
10624
|
"div",
|
|
10294
10625
|
{
|
|
10295
10626
|
className: `grid grid-cols-1 sm:grid-cols-2 gap-[13px] ${gridColumnsClass}`,
|
|
10296
|
-
children: data.map((item, index) => /* @__PURE__ */
|
|
10627
|
+
children: data.map((item, index) => /* @__PURE__ */ jsx54(
|
|
10297
10628
|
StatCard,
|
|
10298
10629
|
{
|
|
10299
10630
|
item,
|
|
@@ -10302,8 +10633,8 @@ var StatisticsCard = ({
|
|
|
10302
10633
|
`${item.variant}-${item.label}-${index}`
|
|
10303
10634
|
))
|
|
10304
10635
|
}
|
|
10305
|
-
) : /* @__PURE__ */
|
|
10306
|
-
/* @__PURE__ */
|
|
10636
|
+
) : /* @__PURE__ */ jsxs42("div", { className: "border border-dashed border-border-300 rounded-lg p-6 min-h-[105px] flex flex-col items-center justify-center gap-2", children: [
|
|
10637
|
+
/* @__PURE__ */ jsx54(
|
|
10307
10638
|
Text_default,
|
|
10308
10639
|
{
|
|
10309
10640
|
size: "sm",
|
|
@@ -10312,14 +10643,14 @@ var StatisticsCard = ({
|
|
|
10312
10643
|
children: emptyStateMessage
|
|
10313
10644
|
}
|
|
10314
10645
|
),
|
|
10315
|
-
onEmptyStateButtonClick && /* @__PURE__ */
|
|
10646
|
+
onEmptyStateButtonClick && /* @__PURE__ */ jsx54(
|
|
10316
10647
|
Button_default,
|
|
10317
10648
|
{
|
|
10318
10649
|
variant: "outline",
|
|
10319
10650
|
action: "primary",
|
|
10320
10651
|
size: "small",
|
|
10321
10652
|
onClick: onEmptyStateButtonClick,
|
|
10322
|
-
iconLeft: /* @__PURE__ */
|
|
10653
|
+
iconLeft: /* @__PURE__ */ jsx54(Plus, { size: 16, weight: "bold" }),
|
|
10323
10654
|
children: emptyStateButtonText
|
|
10324
10655
|
}
|
|
10325
10656
|
)
|
|
@@ -10330,7 +10661,7 @@ var StatisticsCard = ({
|
|
|
10330
10661
|
};
|
|
10331
10662
|
|
|
10332
10663
|
// src/components/NotFound/NotFound.tsx
|
|
10333
|
-
import { jsx as
|
|
10664
|
+
import { jsx as jsx55, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
10334
10665
|
var NotFound = ({
|
|
10335
10666
|
title,
|
|
10336
10667
|
description,
|
|
@@ -10373,22 +10704,22 @@ var NotFound = ({
|
|
|
10373
10704
|
const errorTitle = title || getDefaultTitle();
|
|
10374
10705
|
const errorDescription = description || getDefaultDescription();
|
|
10375
10706
|
const errorCode = getErrorCode();
|
|
10376
|
-
return /* @__PURE__ */
|
|
10707
|
+
return /* @__PURE__ */ jsx55(
|
|
10377
10708
|
"div",
|
|
10378
10709
|
{
|
|
10379
10710
|
className: cn(
|
|
10380
10711
|
"flex flex-col w-full h-screen items-center justify-center bg-background-50 px-4",
|
|
10381
10712
|
className
|
|
10382
10713
|
),
|
|
10383
|
-
children: /* @__PURE__ */
|
|
10714
|
+
children: /* @__PURE__ */ jsx55(
|
|
10384
10715
|
"main",
|
|
10385
10716
|
{
|
|
10386
10717
|
role: "main",
|
|
10387
10718
|
"aria-labelledby": "error-title",
|
|
10388
10719
|
"aria-describedby": "error-description",
|
|
10389
10720
|
className: "flex flex-col items-center text-center max-w-md space-y-6",
|
|
10390
|
-
children: /* @__PURE__ */
|
|
10391
|
-
/* @__PURE__ */
|
|
10721
|
+
children: /* @__PURE__ */ jsxs43("section", { "aria-label": `Erro ${errorCode}`, children: [
|
|
10722
|
+
/* @__PURE__ */ jsx55(
|
|
10392
10723
|
"div",
|
|
10393
10724
|
{
|
|
10394
10725
|
className: "text-8xl font-bold text-primary-300 select-none",
|
|
@@ -10396,8 +10727,8 @@ var NotFound = ({
|
|
|
10396
10727
|
children: errorCode
|
|
10397
10728
|
}
|
|
10398
10729
|
),
|
|
10399
|
-
/* @__PURE__ */
|
|
10400
|
-
/* @__PURE__ */
|
|
10730
|
+
/* @__PURE__ */ jsxs43("header", { className: "space-y-2", children: [
|
|
10731
|
+
/* @__PURE__ */ jsx55(
|
|
10401
10732
|
Text_default,
|
|
10402
10733
|
{
|
|
10403
10734
|
size: "xl",
|
|
@@ -10408,9 +10739,9 @@ var NotFound = ({
|
|
|
10408
10739
|
children: errorTitle
|
|
10409
10740
|
}
|
|
10410
10741
|
),
|
|
10411
|
-
/* @__PURE__ */
|
|
10742
|
+
/* @__PURE__ */ jsx55(Text_default, { size: "md", className: "text-text-600", id: "error-description", children: errorDescription })
|
|
10412
10743
|
] }),
|
|
10413
|
-
onButtonClick && /* @__PURE__ */
|
|
10744
|
+
onButtonClick && /* @__PURE__ */ jsx55("nav", { "aria-label": "Navega\xE7\xE3o de erro", children: /* @__PURE__ */ jsx55(
|
|
10414
10745
|
Button_default,
|
|
10415
10746
|
{
|
|
10416
10747
|
onClick: handleButtonClick,
|
|
@@ -10433,9 +10764,9 @@ var NotFound_default = NotFound;
|
|
|
10433
10764
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
10434
10765
|
import {
|
|
10435
10766
|
useRef as useRef11,
|
|
10436
|
-
useState as
|
|
10437
|
-
useEffect as
|
|
10438
|
-
useCallback as
|
|
10767
|
+
useState as useState21,
|
|
10768
|
+
useEffect as useEffect22,
|
|
10769
|
+
useCallback as useCallback6
|
|
10439
10770
|
} from "react";
|
|
10440
10771
|
import { createPortal } from "react-dom";
|
|
10441
10772
|
import {
|
|
@@ -10450,9 +10781,9 @@ import {
|
|
|
10450
10781
|
} from "phosphor-react";
|
|
10451
10782
|
|
|
10452
10783
|
// src/components/DownloadButton/DownloadButton.tsx
|
|
10453
|
-
import { useCallback as
|
|
10784
|
+
import { useCallback as useCallback5, useState as useState20 } from "react";
|
|
10454
10785
|
import { DownloadSimple } from "phosphor-react";
|
|
10455
|
-
import { jsx as
|
|
10786
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
10456
10787
|
var getMimeType = (url) => {
|
|
10457
10788
|
const extension = getFileExtension(url);
|
|
10458
10789
|
const mimeTypes = {
|
|
@@ -10527,13 +10858,13 @@ var DownloadButton = ({
|
|
|
10527
10858
|
lessonTitle = "aula",
|
|
10528
10859
|
disabled = false
|
|
10529
10860
|
}) => {
|
|
10530
|
-
const [isDownloading, setIsDownloading] =
|
|
10531
|
-
const isValidUrl =
|
|
10861
|
+
const [isDownloading, setIsDownloading] = useState20(false);
|
|
10862
|
+
const isValidUrl = useCallback5((url) => {
|
|
10532
10863
|
return Boolean(
|
|
10533
10864
|
url && url.trim() !== "" && url !== "undefined" && url !== "null"
|
|
10534
10865
|
);
|
|
10535
10866
|
}, []);
|
|
10536
|
-
const getAvailableContent =
|
|
10867
|
+
const getAvailableContent = useCallback5(() => {
|
|
10537
10868
|
const downloads = [];
|
|
10538
10869
|
if (isValidUrl(content.urlDoc)) {
|
|
10539
10870
|
downloads.push({
|
|
@@ -10568,7 +10899,7 @@ var DownloadButton = ({
|
|
|
10568
10899
|
}
|
|
10569
10900
|
return downloads;
|
|
10570
10901
|
}, [content, isValidUrl]);
|
|
10571
|
-
const handleDownload =
|
|
10902
|
+
const handleDownload = useCallback5(async () => {
|
|
10572
10903
|
if (disabled || isDownloading) return;
|
|
10573
10904
|
const availableContent = getAvailableContent();
|
|
10574
10905
|
if (availableContent.length === 0) {
|
|
@@ -10609,10 +10940,10 @@ var DownloadButton = ({
|
|
|
10609
10940
|
if (!hasContent) {
|
|
10610
10941
|
return null;
|
|
10611
10942
|
}
|
|
10612
|
-
return /* @__PURE__ */
|
|
10943
|
+
return /* @__PURE__ */ jsx56("div", { className: cn("flex items-center", className), children: /* @__PURE__ */ jsx56(
|
|
10613
10944
|
IconButton_default,
|
|
10614
10945
|
{
|
|
10615
|
-
icon: /* @__PURE__ */
|
|
10946
|
+
icon: /* @__PURE__ */ jsx56(DownloadSimple, { size: 24 }),
|
|
10616
10947
|
onClick: handleDownload,
|
|
10617
10948
|
disabled: disabled || isDownloading,
|
|
10618
10949
|
"aria-label": (() => {
|
|
@@ -10633,7 +10964,7 @@ var DownloadButton = ({
|
|
|
10633
10964
|
var DownloadButton_default = DownloadButton;
|
|
10634
10965
|
|
|
10635
10966
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
10636
|
-
import { jsx as
|
|
10967
|
+
import { jsx as jsx57, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
10637
10968
|
var CONTROLS_HIDE_TIMEOUT = 3e3;
|
|
10638
10969
|
var LEAVE_HIDE_TIMEOUT = 1e3;
|
|
10639
10970
|
var INIT_DELAY = 100;
|
|
@@ -10649,7 +10980,7 @@ var ProgressBar2 = ({
|
|
|
10649
10980
|
progressPercentage,
|
|
10650
10981
|
onSeek,
|
|
10651
10982
|
className = "px-4 pb-2"
|
|
10652
|
-
}) => /* @__PURE__ */
|
|
10983
|
+
}) => /* @__PURE__ */ jsx57("div", { className, children: /* @__PURE__ */ jsx57(
|
|
10653
10984
|
"input",
|
|
10654
10985
|
{
|
|
10655
10986
|
type: "range",
|
|
@@ -10671,17 +11002,17 @@ var VolumeControls = ({
|
|
|
10671
11002
|
onToggleMute,
|
|
10672
11003
|
iconSize = 24,
|
|
10673
11004
|
showSlider = true
|
|
10674
|
-
}) => /* @__PURE__ */
|
|
10675
|
-
/* @__PURE__ */
|
|
11005
|
+
}) => /* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-2", children: [
|
|
11006
|
+
/* @__PURE__ */ jsx57(
|
|
10676
11007
|
IconButton_default,
|
|
10677
11008
|
{
|
|
10678
|
-
icon: isMuted ? /* @__PURE__ */
|
|
11009
|
+
icon: isMuted ? /* @__PURE__ */ jsx57(SpeakerSlash, { size: iconSize }) : /* @__PURE__ */ jsx57(SpeakerHigh2, { size: iconSize }),
|
|
10679
11010
|
onClick: onToggleMute,
|
|
10680
11011
|
"aria-label": isMuted ? "Unmute" : "Mute",
|
|
10681
11012
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
10682
11013
|
}
|
|
10683
11014
|
),
|
|
10684
|
-
showSlider && /* @__PURE__ */
|
|
11015
|
+
showSlider && /* @__PURE__ */ jsx57(
|
|
10685
11016
|
"input",
|
|
10686
11017
|
{
|
|
10687
11018
|
type: "range",
|
|
@@ -10722,7 +11053,7 @@ var SpeedMenu = ({
|
|
|
10722
11053
|
};
|
|
10723
11054
|
};
|
|
10724
11055
|
const position = getMenuPosition();
|
|
10725
|
-
|
|
11056
|
+
useEffect22(() => {
|
|
10726
11057
|
const handleClickOutside = (event) => {
|
|
10727
11058
|
const target = event.target;
|
|
10728
11059
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -10738,7 +11069,7 @@ var SpeedMenu = ({
|
|
|
10738
11069
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
10739
11070
|
};
|
|
10740
11071
|
}, [showSpeedMenu, onToggleMenu]);
|
|
10741
|
-
const menuContent = /* @__PURE__ */
|
|
11072
|
+
const menuContent = /* @__PURE__ */ jsx57(
|
|
10742
11073
|
"div",
|
|
10743
11074
|
{
|
|
10744
11075
|
ref: speedMenuRef,
|
|
@@ -10749,7 +11080,7 @@ var SpeedMenu = ({
|
|
|
10749
11080
|
top: `${position.top}px`,
|
|
10750
11081
|
left: `${position.left}px`
|
|
10751
11082
|
},
|
|
10752
|
-
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */
|
|
11083
|
+
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ jsxs44(
|
|
10753
11084
|
"button",
|
|
10754
11085
|
{
|
|
10755
11086
|
role: "menuitemradio",
|
|
@@ -10766,12 +11097,12 @@ var SpeedMenu = ({
|
|
|
10766
11097
|
}
|
|
10767
11098
|
);
|
|
10768
11099
|
const portalContent = showSpeedMenu && globalThis.window !== void 0 && globalThis.document !== void 0 && !!globalThis.document?.body ? createPortal(menuContent, globalThis.document.body) : null;
|
|
10769
|
-
return /* @__PURE__ */
|
|
10770
|
-
/* @__PURE__ */
|
|
11100
|
+
return /* @__PURE__ */ jsxs44("div", { className: "relative", ref: speedMenuContainerRef, children: [
|
|
11101
|
+
/* @__PURE__ */ jsx57(
|
|
10771
11102
|
IconButton_default,
|
|
10772
11103
|
{
|
|
10773
11104
|
ref: buttonRef,
|
|
10774
|
-
icon: /* @__PURE__ */
|
|
11105
|
+
icon: /* @__PURE__ */ jsx57(DotsThreeVertical3, { size: iconSize }),
|
|
10775
11106
|
onClick: onToggleMenu,
|
|
10776
11107
|
"aria-label": "Playback speed",
|
|
10777
11108
|
"aria-haspopup": "menu",
|
|
@@ -10803,26 +11134,26 @@ var VideoPlayer = ({
|
|
|
10803
11134
|
}) => {
|
|
10804
11135
|
const videoRef = useRef11(null);
|
|
10805
11136
|
const { isUltraSmallMobile, isTinyMobile } = useMobile();
|
|
10806
|
-
const [isPlaying, setIsPlaying] =
|
|
10807
|
-
const [currentTime, setCurrentTime] =
|
|
10808
|
-
const [duration, setDuration] =
|
|
10809
|
-
const [isMuted, setIsMuted] =
|
|
10810
|
-
const [volume, setVolume] =
|
|
10811
|
-
const [isFullscreen, setIsFullscreen] =
|
|
10812
|
-
const [showControls, setShowControls] =
|
|
10813
|
-
const [hasCompleted, setHasCompleted] =
|
|
10814
|
-
const [showCaptions, setShowCaptions] =
|
|
10815
|
-
const [subtitlesValidation, setSubtitlesValidation] =
|
|
10816
|
-
|
|
11137
|
+
const [isPlaying, setIsPlaying] = useState21(false);
|
|
11138
|
+
const [currentTime, setCurrentTime] = useState21(0);
|
|
11139
|
+
const [duration, setDuration] = useState21(0);
|
|
11140
|
+
const [isMuted, setIsMuted] = useState21(false);
|
|
11141
|
+
const [volume, setVolume] = useState21(1);
|
|
11142
|
+
const [isFullscreen, setIsFullscreen] = useState21(false);
|
|
11143
|
+
const [showControls, setShowControls] = useState21(true);
|
|
11144
|
+
const [hasCompleted, setHasCompleted] = useState21(false);
|
|
11145
|
+
const [showCaptions, setShowCaptions] = useState21(false);
|
|
11146
|
+
const [subtitlesValidation, setSubtitlesValidation] = useState21("idle");
|
|
11147
|
+
useEffect22(() => {
|
|
10817
11148
|
setHasCompleted(false);
|
|
10818
11149
|
}, [src]);
|
|
10819
|
-
const [playbackRate, setPlaybackRate] =
|
|
10820
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
11150
|
+
const [playbackRate, setPlaybackRate] = useState21(1);
|
|
11151
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState21(false);
|
|
10821
11152
|
const lastSaveTimeRef = useRef11(0);
|
|
10822
11153
|
const trackRef = useRef11(null);
|
|
10823
11154
|
const controlsTimeoutRef = useRef11(null);
|
|
10824
11155
|
const lastMousePositionRef = useRef11({ x: 0, y: 0 });
|
|
10825
|
-
const isUserInteracting =
|
|
11156
|
+
const isUserInteracting = useCallback6(() => {
|
|
10826
11157
|
if (showSpeedMenu) {
|
|
10827
11158
|
return true;
|
|
10828
11159
|
}
|
|
@@ -10839,13 +11170,13 @@ var VideoPlayer = ({
|
|
|
10839
11170
|
}
|
|
10840
11171
|
return false;
|
|
10841
11172
|
}, [showSpeedMenu]);
|
|
10842
|
-
const clearControlsTimeout =
|
|
11173
|
+
const clearControlsTimeout = useCallback6(() => {
|
|
10843
11174
|
if (controlsTimeoutRef.current) {
|
|
10844
11175
|
clearTimeout(controlsTimeoutRef.current);
|
|
10845
11176
|
controlsTimeoutRef.current = null;
|
|
10846
11177
|
}
|
|
10847
11178
|
}, []);
|
|
10848
|
-
const showControlsWithTimer =
|
|
11179
|
+
const showControlsWithTimer = useCallback6(() => {
|
|
10849
11180
|
setShowControls(true);
|
|
10850
11181
|
clearControlsTimeout();
|
|
10851
11182
|
if (isFullscreen) {
|
|
@@ -10860,7 +11191,7 @@ var VideoPlayer = ({
|
|
|
10860
11191
|
}, CONTROLS_HIDE_TIMEOUT);
|
|
10861
11192
|
}
|
|
10862
11193
|
}, [isFullscreen, isPlaying, clearControlsTimeout]);
|
|
10863
|
-
const handleMouseMove =
|
|
11194
|
+
const handleMouseMove = useCallback6(
|
|
10864
11195
|
(event) => {
|
|
10865
11196
|
const currentX = event.clientX;
|
|
10866
11197
|
const currentY = event.clientY;
|
|
@@ -10873,10 +11204,10 @@ var VideoPlayer = ({
|
|
|
10873
11204
|
},
|
|
10874
11205
|
[showControlsWithTimer]
|
|
10875
11206
|
);
|
|
10876
|
-
const handleMouseEnter =
|
|
11207
|
+
const handleMouseEnter = useCallback6(() => {
|
|
10877
11208
|
showControlsWithTimer();
|
|
10878
11209
|
}, [showControlsWithTimer]);
|
|
10879
|
-
const handleMouseLeave =
|
|
11210
|
+
const handleMouseLeave = useCallback6(() => {
|
|
10880
11211
|
const userInteracting = isUserInteracting();
|
|
10881
11212
|
clearControlsTimeout();
|
|
10882
11213
|
if (!isFullscreen && !userInteracting) {
|
|
@@ -10885,13 +11216,13 @@ var VideoPlayer = ({
|
|
|
10885
11216
|
}, LEAVE_HIDE_TIMEOUT);
|
|
10886
11217
|
}
|
|
10887
11218
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
10888
|
-
|
|
11219
|
+
useEffect22(() => {
|
|
10889
11220
|
if (videoRef.current) {
|
|
10890
11221
|
videoRef.current.volume = volume;
|
|
10891
11222
|
videoRef.current.muted = isMuted;
|
|
10892
11223
|
}
|
|
10893
11224
|
}, [volume, isMuted]);
|
|
10894
|
-
|
|
11225
|
+
useEffect22(() => {
|
|
10895
11226
|
const video = videoRef.current;
|
|
10896
11227
|
if (!video) return;
|
|
10897
11228
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -10906,13 +11237,13 @@ var VideoPlayer = ({
|
|
|
10906
11237
|
video.removeEventListener("ended", onEnded);
|
|
10907
11238
|
};
|
|
10908
11239
|
}, []);
|
|
10909
|
-
|
|
11240
|
+
useEffect22(() => {
|
|
10910
11241
|
const video = videoRef.current;
|
|
10911
11242
|
if (!video) return;
|
|
10912
11243
|
video.setAttribute("playsinline", "");
|
|
10913
11244
|
video.setAttribute("webkit-playsinline", "");
|
|
10914
11245
|
}, []);
|
|
10915
|
-
|
|
11246
|
+
useEffect22(() => {
|
|
10916
11247
|
if (isPlaying) {
|
|
10917
11248
|
showControlsWithTimer();
|
|
10918
11249
|
} else {
|
|
@@ -10924,7 +11255,7 @@ var VideoPlayer = ({
|
|
|
10924
11255
|
}
|
|
10925
11256
|
}
|
|
10926
11257
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
10927
|
-
|
|
11258
|
+
useEffect22(() => {
|
|
10928
11259
|
const video = videoRef.current;
|
|
10929
11260
|
if (!video) return;
|
|
10930
11261
|
const handleFullscreenChange = () => {
|
|
@@ -10959,7 +11290,7 @@ var VideoPlayer = ({
|
|
|
10959
11290
|
);
|
|
10960
11291
|
};
|
|
10961
11292
|
}, [showControlsWithTimer]);
|
|
10962
|
-
|
|
11293
|
+
useEffect22(() => {
|
|
10963
11294
|
const init = () => {
|
|
10964
11295
|
if (!isFullscreen) {
|
|
10965
11296
|
showControlsWithTimer();
|
|
@@ -10981,7 +11312,7 @@ var VideoPlayer = ({
|
|
|
10981
11312
|
};
|
|
10982
11313
|
}
|
|
10983
11314
|
}, []);
|
|
10984
|
-
const getInitialTime =
|
|
11315
|
+
const getInitialTime = useCallback6(() => {
|
|
10985
11316
|
if (!autoSave || !storageKey) {
|
|
10986
11317
|
return Number.isFinite(initialTime) && initialTime >= 0 ? initialTime : void 0;
|
|
10987
11318
|
}
|
|
@@ -10994,14 +11325,14 @@ var VideoPlayer = ({
|
|
|
10994
11325
|
if (hasValidSaved) return saved;
|
|
10995
11326
|
return void 0;
|
|
10996
11327
|
}, [autoSave, storageKey, src, initialTime]);
|
|
10997
|
-
|
|
11328
|
+
useEffect22(() => {
|
|
10998
11329
|
const start = getInitialTime();
|
|
10999
11330
|
if (start !== void 0 && videoRef.current) {
|
|
11000
11331
|
videoRef.current.currentTime = start;
|
|
11001
11332
|
setCurrentTime(start);
|
|
11002
11333
|
}
|
|
11003
11334
|
}, [getInitialTime]);
|
|
11004
|
-
const saveProgress =
|
|
11335
|
+
const saveProgress = useCallback6(
|
|
11005
11336
|
(time) => {
|
|
11006
11337
|
if (!autoSave || !storageKey) return;
|
|
11007
11338
|
const now = Date.now();
|
|
@@ -11012,7 +11343,7 @@ var VideoPlayer = ({
|
|
|
11012
11343
|
},
|
|
11013
11344
|
[autoSave, storageKey, src]
|
|
11014
11345
|
);
|
|
11015
|
-
const togglePlayPause =
|
|
11346
|
+
const togglePlayPause = useCallback6(async () => {
|
|
11016
11347
|
const video = videoRef.current;
|
|
11017
11348
|
if (!video) return;
|
|
11018
11349
|
if (!video.paused) {
|
|
@@ -11024,7 +11355,7 @@ var VideoPlayer = ({
|
|
|
11024
11355
|
} catch {
|
|
11025
11356
|
}
|
|
11026
11357
|
}, []);
|
|
11027
|
-
const handleVolumeChange =
|
|
11358
|
+
const handleVolumeChange = useCallback6(
|
|
11028
11359
|
(newVolume) => {
|
|
11029
11360
|
const video = videoRef.current;
|
|
11030
11361
|
if (!video) return;
|
|
@@ -11043,7 +11374,7 @@ var VideoPlayer = ({
|
|
|
11043
11374
|
},
|
|
11044
11375
|
[isMuted]
|
|
11045
11376
|
);
|
|
11046
|
-
const toggleMute =
|
|
11377
|
+
const toggleMute = useCallback6(() => {
|
|
11047
11378
|
const video = videoRef.current;
|
|
11048
11379
|
if (!video) return;
|
|
11049
11380
|
if (isMuted) {
|
|
@@ -11057,20 +11388,20 @@ var VideoPlayer = ({
|
|
|
11057
11388
|
setIsMuted(true);
|
|
11058
11389
|
}
|
|
11059
11390
|
}, [isMuted, volume]);
|
|
11060
|
-
const handleSeek =
|
|
11391
|
+
const handleSeek = useCallback6((newTime) => {
|
|
11061
11392
|
const video = videoRef.current;
|
|
11062
11393
|
if (video) {
|
|
11063
11394
|
video.currentTime = newTime;
|
|
11064
11395
|
}
|
|
11065
11396
|
}, []);
|
|
11066
|
-
const isSafariIOS =
|
|
11397
|
+
const isSafariIOS = useCallback6(() => {
|
|
11067
11398
|
const ua = navigator.userAgent;
|
|
11068
11399
|
const isIOS = /iPad|iPhone|iPod/.test(ua);
|
|
11069
11400
|
const isWebKit = /WebKit/.test(ua);
|
|
11070
11401
|
const isNotChrome = !/CriOS|Chrome/.test(ua);
|
|
11071
11402
|
return isIOS && isWebKit && isNotChrome;
|
|
11072
11403
|
}, []);
|
|
11073
|
-
const toggleFullscreen =
|
|
11404
|
+
const toggleFullscreen = useCallback6(() => {
|
|
11074
11405
|
const video = videoRef.current;
|
|
11075
11406
|
const container = video?.parentElement;
|
|
11076
11407
|
if (!video || !container) return;
|
|
@@ -11087,24 +11418,24 @@ var VideoPlayer = ({
|
|
|
11087
11418
|
document.exitFullscreen();
|
|
11088
11419
|
}
|
|
11089
11420
|
}, [isFullscreen, isSafariIOS]);
|
|
11090
|
-
const handleSpeedChange =
|
|
11421
|
+
const handleSpeedChange = useCallback6((speed) => {
|
|
11091
11422
|
if (videoRef.current) {
|
|
11092
11423
|
videoRef.current.playbackRate = speed;
|
|
11093
11424
|
setPlaybackRate(speed);
|
|
11094
11425
|
setShowSpeedMenu(false);
|
|
11095
11426
|
}
|
|
11096
11427
|
}, []);
|
|
11097
|
-
const toggleSpeedMenu =
|
|
11428
|
+
const toggleSpeedMenu = useCallback6(() => {
|
|
11098
11429
|
setShowSpeedMenu(!showSpeedMenu);
|
|
11099
11430
|
}, [showSpeedMenu]);
|
|
11100
|
-
const toggleCaptions =
|
|
11431
|
+
const toggleCaptions = useCallback6(() => {
|
|
11101
11432
|
if (!trackRef.current?.track || !subtitles || subtitlesValidation !== "valid")
|
|
11102
11433
|
return;
|
|
11103
11434
|
const newShowCaptions = !showCaptions;
|
|
11104
11435
|
setShowCaptions(newShowCaptions);
|
|
11105
11436
|
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
11106
11437
|
}, [showCaptions, subtitles, subtitlesValidation]);
|
|
11107
|
-
const checkVideoCompletion =
|
|
11438
|
+
const checkVideoCompletion = useCallback6(
|
|
11108
11439
|
(progressPercent) => {
|
|
11109
11440
|
if (progressPercent >= 95 && !hasCompleted) {
|
|
11110
11441
|
setHasCompleted(true);
|
|
@@ -11113,7 +11444,7 @@ var VideoPlayer = ({
|
|
|
11113
11444
|
},
|
|
11114
11445
|
[hasCompleted, onVideoComplete]
|
|
11115
11446
|
);
|
|
11116
|
-
const handleTimeUpdate =
|
|
11447
|
+
const handleTimeUpdate = useCallback6(() => {
|
|
11117
11448
|
const video = videoRef.current;
|
|
11118
11449
|
if (!video) return;
|
|
11119
11450
|
const current = video.currentTime;
|
|
@@ -11126,12 +11457,12 @@ var VideoPlayer = ({
|
|
|
11126
11457
|
checkVideoCompletion(progressPercent);
|
|
11127
11458
|
}
|
|
11128
11459
|
}, [duration, saveProgress, onTimeUpdate, onProgress, checkVideoCompletion]);
|
|
11129
|
-
const handleLoadedMetadata =
|
|
11460
|
+
const handleLoadedMetadata = useCallback6(() => {
|
|
11130
11461
|
if (videoRef.current) {
|
|
11131
11462
|
setDuration(videoRef.current.duration);
|
|
11132
11463
|
}
|
|
11133
11464
|
}, []);
|
|
11134
|
-
|
|
11465
|
+
useEffect22(() => {
|
|
11135
11466
|
const controller = new AbortController();
|
|
11136
11467
|
const validateSubtitles = async () => {
|
|
11137
11468
|
if (!subtitles) {
|
|
@@ -11178,12 +11509,12 @@ var VideoPlayer = ({
|
|
|
11178
11509
|
controller.abort();
|
|
11179
11510
|
};
|
|
11180
11511
|
}, [subtitles]);
|
|
11181
|
-
|
|
11512
|
+
useEffect22(() => {
|
|
11182
11513
|
if (trackRef.current?.track) {
|
|
11183
11514
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
11184
11515
|
}
|
|
11185
11516
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
11186
|
-
|
|
11517
|
+
useEffect22(() => {
|
|
11187
11518
|
const handleVisibilityChange = () => {
|
|
11188
11519
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
11189
11520
|
videoRef.current.pause();
|
|
@@ -11205,54 +11536,54 @@ var VideoPlayer = ({
|
|
|
11205
11536
|
};
|
|
11206
11537
|
}, [isPlaying, clearControlsTimeout]);
|
|
11207
11538
|
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
11208
|
-
const getIconSize2 =
|
|
11539
|
+
const getIconSize2 = useCallback6(() => {
|
|
11209
11540
|
if (isTinyMobile) return 18;
|
|
11210
11541
|
if (isUltraSmallMobile) return 20;
|
|
11211
11542
|
return 24;
|
|
11212
11543
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11213
|
-
const getControlsPadding =
|
|
11544
|
+
const getControlsPadding = useCallback6(() => {
|
|
11214
11545
|
if (isTinyMobile) return "px-2 pb-2 pt-1";
|
|
11215
11546
|
if (isUltraSmallMobile) return "px-3 pb-3 pt-1";
|
|
11216
11547
|
return "px-4 pb-4";
|
|
11217
11548
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11218
|
-
const getControlsGap =
|
|
11549
|
+
const getControlsGap = useCallback6(() => {
|
|
11219
11550
|
if (isTinyMobile) return "gap-1";
|
|
11220
11551
|
if (isUltraSmallMobile) return "gap-2";
|
|
11221
11552
|
return "gap-4";
|
|
11222
11553
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11223
|
-
const getProgressBarPadding =
|
|
11554
|
+
const getProgressBarPadding = useCallback6(() => {
|
|
11224
11555
|
if (isTinyMobile) return "px-2 pb-1";
|
|
11225
11556
|
if (isUltraSmallMobile) return "px-3 pb-1";
|
|
11226
11557
|
return "px-4 pb-2";
|
|
11227
11558
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11228
|
-
const getCenterPlayButtonPosition =
|
|
11559
|
+
const getCenterPlayButtonPosition = useCallback6(() => {
|
|
11229
11560
|
if (isTinyMobile) return "items-center justify-center -translate-y-12";
|
|
11230
11561
|
if (isUltraSmallMobile) return "items-center justify-center -translate-y-8";
|
|
11231
11562
|
return "items-center justify-center";
|
|
11232
11563
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11233
|
-
const getTopControlsOpacity =
|
|
11564
|
+
const getTopControlsOpacity = useCallback6(() => {
|
|
11234
11565
|
return showControls ? "opacity-100" : "opacity-0";
|
|
11235
11566
|
}, [showControls]);
|
|
11236
|
-
const getBottomControlsOpacity =
|
|
11567
|
+
const getBottomControlsOpacity = useCallback6(() => {
|
|
11237
11568
|
return showControls ? "opacity-100" : "opacity-0";
|
|
11238
11569
|
}, [showControls]);
|
|
11239
|
-
const seekBackward =
|
|
11570
|
+
const seekBackward = useCallback6(() => {
|
|
11240
11571
|
if (videoRef.current) {
|
|
11241
11572
|
videoRef.current.currentTime -= 10;
|
|
11242
11573
|
}
|
|
11243
11574
|
}, []);
|
|
11244
|
-
const seekForward =
|
|
11575
|
+
const seekForward = useCallback6(() => {
|
|
11245
11576
|
if (videoRef.current) {
|
|
11246
11577
|
videoRef.current.currentTime += 10;
|
|
11247
11578
|
}
|
|
11248
11579
|
}, []);
|
|
11249
|
-
const increaseVolume =
|
|
11580
|
+
const increaseVolume = useCallback6(() => {
|
|
11250
11581
|
handleVolumeChange(Math.min(100, volume * 100 + 10));
|
|
11251
11582
|
}, [handleVolumeChange, volume]);
|
|
11252
|
-
const decreaseVolume =
|
|
11583
|
+
const decreaseVolume = useCallback6(() => {
|
|
11253
11584
|
handleVolumeChange(Math.max(0, volume * 100 - 10));
|
|
11254
11585
|
}, [handleVolumeChange, volume]);
|
|
11255
|
-
const handleVideoKeyDown =
|
|
11586
|
+
const handleVideoKeyDown = useCallback6(
|
|
11256
11587
|
(e) => {
|
|
11257
11588
|
if (!e.key) return;
|
|
11258
11589
|
e.stopPropagation();
|
|
@@ -11287,10 +11618,10 @@ var VideoPlayer = ({
|
|
|
11287
11618
|
]
|
|
11288
11619
|
);
|
|
11289
11620
|
const groupedSubTitleValid = subtitles && subtitlesValidation === "valid";
|
|
11290
|
-
return /* @__PURE__ */
|
|
11291
|
-
(title || subtitleText) && /* @__PURE__ */
|
|
11292
|
-
/* @__PURE__ */
|
|
11293
|
-
title && /* @__PURE__ */
|
|
11621
|
+
return /* @__PURE__ */ jsxs44("div", { className: cn("flex flex-col", className), children: [
|
|
11622
|
+
(title || subtitleText) && /* @__PURE__ */ jsxs44("div", { className: "bg-subject-1 px-8 py-4 flex items-end justify-between min-h-20", children: [
|
|
11623
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-1", children: [
|
|
11624
|
+
title && /* @__PURE__ */ jsx57(
|
|
11294
11625
|
Text_default,
|
|
11295
11626
|
{
|
|
11296
11627
|
as: "h2",
|
|
@@ -11301,7 +11632,7 @@ var VideoPlayer = ({
|
|
|
11301
11632
|
children: title
|
|
11302
11633
|
}
|
|
11303
11634
|
),
|
|
11304
|
-
subtitleText && /* @__PURE__ */
|
|
11635
|
+
subtitleText && /* @__PURE__ */ jsx57(
|
|
11305
11636
|
Text_default,
|
|
11306
11637
|
{
|
|
11307
11638
|
as: "p",
|
|
@@ -11313,7 +11644,7 @@ var VideoPlayer = ({
|
|
|
11313
11644
|
}
|
|
11314
11645
|
)
|
|
11315
11646
|
] }),
|
|
11316
|
-
showDownloadButton && downloadContent && /* @__PURE__ */
|
|
11647
|
+
showDownloadButton && downloadContent && /* @__PURE__ */ jsx57(
|
|
11317
11648
|
DownloadButton_default,
|
|
11318
11649
|
{
|
|
11319
11650
|
content: downloadContent,
|
|
@@ -11325,7 +11656,7 @@ var VideoPlayer = ({
|
|
|
11325
11656
|
}
|
|
11326
11657
|
)
|
|
11327
11658
|
] }),
|
|
11328
|
-
/* @__PURE__ */
|
|
11659
|
+
/* @__PURE__ */ jsxs44(
|
|
11329
11660
|
"section",
|
|
11330
11661
|
{
|
|
11331
11662
|
className: cn(
|
|
@@ -11340,7 +11671,7 @@ var VideoPlayer = ({
|
|
|
11340
11671
|
onTouchStart: handleMouseEnter,
|
|
11341
11672
|
onMouseLeave: handleMouseLeave,
|
|
11342
11673
|
children: [
|
|
11343
|
-
/* @__PURE__ */
|
|
11674
|
+
/* @__PURE__ */ jsx57(
|
|
11344
11675
|
"video",
|
|
11345
11676
|
{
|
|
11346
11677
|
ref: videoRef,
|
|
@@ -11355,7 +11686,7 @@ var VideoPlayer = ({
|
|
|
11355
11686
|
onKeyDown: handleVideoKeyDown,
|
|
11356
11687
|
tabIndex: 0,
|
|
11357
11688
|
"aria-label": title ? `Video: ${title}` : "Video player",
|
|
11358
|
-
children: /* @__PURE__ */
|
|
11689
|
+
children: /* @__PURE__ */ jsx57(
|
|
11359
11690
|
"track",
|
|
11360
11691
|
{
|
|
11361
11692
|
ref: trackRef,
|
|
@@ -11368,17 +11699,17 @@ var VideoPlayer = ({
|
|
|
11368
11699
|
)
|
|
11369
11700
|
}
|
|
11370
11701
|
),
|
|
11371
|
-
!isPlaying && /* @__PURE__ */
|
|
11702
|
+
!isPlaying && /* @__PURE__ */ jsx57(
|
|
11372
11703
|
"div",
|
|
11373
11704
|
{
|
|
11374
11705
|
className: cn(
|
|
11375
11706
|
"absolute inset-0 flex bg-black/30 transition-opacity",
|
|
11376
11707
|
getCenterPlayButtonPosition()
|
|
11377
11708
|
),
|
|
11378
|
-
children: /* @__PURE__ */
|
|
11709
|
+
children: /* @__PURE__ */ jsx57(
|
|
11379
11710
|
IconButton_default,
|
|
11380
11711
|
{
|
|
11381
|
-
icon: /* @__PURE__ */
|
|
11712
|
+
icon: /* @__PURE__ */ jsx57(Play2, { size: 32, weight: "regular", className: "ml-1" }),
|
|
11382
11713
|
onClick: togglePlayPause,
|
|
11383
11714
|
"aria-label": "Play video",
|
|
11384
11715
|
className: "!bg-transparent !text-white !w-auto !h-auto hover:!bg-transparent hover:!text-gray-200"
|
|
@@ -11386,17 +11717,17 @@ var VideoPlayer = ({
|
|
|
11386
11717
|
)
|
|
11387
11718
|
}
|
|
11388
11719
|
),
|
|
11389
|
-
/* @__PURE__ */
|
|
11720
|
+
/* @__PURE__ */ jsx57(
|
|
11390
11721
|
"div",
|
|
11391
11722
|
{
|
|
11392
11723
|
className: cn(
|
|
11393
11724
|
"absolute top-0 left-0 right-0 p-4 bg-gradient-to-b from-black/70 to-transparent transition-opacity",
|
|
11394
11725
|
getTopControlsOpacity()
|
|
11395
11726
|
),
|
|
11396
|
-
children: /* @__PURE__ */
|
|
11727
|
+
children: /* @__PURE__ */ jsx57("div", { className: "flex justify-start", children: /* @__PURE__ */ jsx57(
|
|
11397
11728
|
IconButton_default,
|
|
11398
11729
|
{
|
|
11399
|
-
icon: isFullscreen ? /* @__PURE__ */
|
|
11730
|
+
icon: isFullscreen ? /* @__PURE__ */ jsx57(ArrowsInSimple, { size: 24 }) : /* @__PURE__ */ jsx57(ArrowsOutSimple, { size: 24 }),
|
|
11400
11731
|
onClick: toggleFullscreen,
|
|
11401
11732
|
"aria-label": isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
11402
11733
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
@@ -11404,7 +11735,7 @@ var VideoPlayer = ({
|
|
|
11404
11735
|
) })
|
|
11405
11736
|
}
|
|
11406
11737
|
),
|
|
11407
|
-
/* @__PURE__ */
|
|
11738
|
+
/* @__PURE__ */ jsxs44(
|
|
11408
11739
|
"div",
|
|
11409
11740
|
{
|
|
11410
11741
|
className: cn(
|
|
@@ -11412,7 +11743,7 @@ var VideoPlayer = ({
|
|
|
11412
11743
|
getBottomControlsOpacity()
|
|
11413
11744
|
),
|
|
11414
11745
|
children: [
|
|
11415
|
-
/* @__PURE__ */
|
|
11746
|
+
/* @__PURE__ */ jsx57(
|
|
11416
11747
|
ProgressBar2,
|
|
11417
11748
|
{
|
|
11418
11749
|
currentTime,
|
|
@@ -11422,7 +11753,7 @@ var VideoPlayer = ({
|
|
|
11422
11753
|
className: getProgressBarPadding()
|
|
11423
11754
|
}
|
|
11424
11755
|
),
|
|
11425
|
-
/* @__PURE__ */
|
|
11756
|
+
/* @__PURE__ */ jsxs44(
|
|
11426
11757
|
"div",
|
|
11427
11758
|
{
|
|
11428
11759
|
className: cn(
|
|
@@ -11430,17 +11761,17 @@ var VideoPlayer = ({
|
|
|
11430
11761
|
getControlsPadding()
|
|
11431
11762
|
),
|
|
11432
11763
|
children: [
|
|
11433
|
-
/* @__PURE__ */
|
|
11434
|
-
/* @__PURE__ */
|
|
11764
|
+
/* @__PURE__ */ jsxs44("div", { className: cn("flex items-center", getControlsGap()), children: [
|
|
11765
|
+
/* @__PURE__ */ jsx57(
|
|
11435
11766
|
IconButton_default,
|
|
11436
11767
|
{
|
|
11437
|
-
icon: isPlaying ? /* @__PURE__ */
|
|
11768
|
+
icon: isPlaying ? /* @__PURE__ */ jsx57(Pause, { size: getIconSize2() }) : /* @__PURE__ */ jsx57(Play2, { size: getIconSize2() }),
|
|
11438
11769
|
onClick: togglePlayPause,
|
|
11439
11770
|
"aria-label": isPlaying ? "Pause" : "Play",
|
|
11440
11771
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
11441
11772
|
}
|
|
11442
11773
|
),
|
|
11443
|
-
/* @__PURE__ */
|
|
11774
|
+
/* @__PURE__ */ jsx57(
|
|
11444
11775
|
VolumeControls,
|
|
11445
11776
|
{
|
|
11446
11777
|
volume,
|
|
@@ -11451,10 +11782,10 @@ var VideoPlayer = ({
|
|
|
11451
11782
|
showSlider: !isUltraSmallMobile
|
|
11452
11783
|
}
|
|
11453
11784
|
),
|
|
11454
|
-
groupedSubTitleValid && /* @__PURE__ */
|
|
11785
|
+
groupedSubTitleValid && /* @__PURE__ */ jsx57(
|
|
11455
11786
|
IconButton_default,
|
|
11456
11787
|
{
|
|
11457
|
-
icon: /* @__PURE__ */
|
|
11788
|
+
icon: /* @__PURE__ */ jsx57(ClosedCaptioning, { size: getIconSize2() }),
|
|
11458
11789
|
onClick: toggleCaptions,
|
|
11459
11790
|
"aria-label": showCaptions ? "Hide captions" : "Show captions",
|
|
11460
11791
|
className: cn(
|
|
@@ -11463,13 +11794,13 @@ var VideoPlayer = ({
|
|
|
11463
11794
|
)
|
|
11464
11795
|
}
|
|
11465
11796
|
),
|
|
11466
|
-
/* @__PURE__ */
|
|
11797
|
+
/* @__PURE__ */ jsxs44(Text_default, { size: "sm", weight: "medium", color: "text-white", children: [
|
|
11467
11798
|
formatTime(currentTime),
|
|
11468
11799
|
" / ",
|
|
11469
11800
|
formatTime(duration)
|
|
11470
11801
|
] })
|
|
11471
11802
|
] }),
|
|
11472
|
-
/* @__PURE__ */
|
|
11803
|
+
/* @__PURE__ */ jsx57("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsx57(
|
|
11473
11804
|
SpeedMenu,
|
|
11474
11805
|
{
|
|
11475
11806
|
showSpeedMenu,
|
|
@@ -11495,9 +11826,9 @@ var VideoPlayer = ({
|
|
|
11495
11826
|
var VideoPlayer_default = VideoPlayer;
|
|
11496
11827
|
|
|
11497
11828
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
11498
|
-
import { useCallback as
|
|
11829
|
+
import { useCallback as useCallback7, useState as useState22 } from "react";
|
|
11499
11830
|
import { ArrowsOut } from "phosphor-react";
|
|
11500
|
-
import { Fragment as
|
|
11831
|
+
import { Fragment as Fragment11, jsx as jsx58, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
11501
11832
|
var IMAGE_WIDTH = 225;
|
|
11502
11833
|
var IMAGE_HEIGHT = 90;
|
|
11503
11834
|
var Whiteboard = ({
|
|
@@ -11508,8 +11839,8 @@ var Whiteboard = ({
|
|
|
11508
11839
|
imagesPerRow = 2,
|
|
11509
11840
|
...rest
|
|
11510
11841
|
}) => {
|
|
11511
|
-
const [imageErrors, setImageErrors] =
|
|
11512
|
-
const handleDownload =
|
|
11842
|
+
const [imageErrors, setImageErrors] = useState22(/* @__PURE__ */ new Set());
|
|
11843
|
+
const handleDownload = useCallback7(
|
|
11513
11844
|
(image) => {
|
|
11514
11845
|
if (onDownload) {
|
|
11515
11846
|
onDownload(image);
|
|
@@ -11526,7 +11857,7 @@ var Whiteboard = ({
|
|
|
11526
11857
|
},
|
|
11527
11858
|
[onDownload]
|
|
11528
11859
|
);
|
|
11529
|
-
const handleImageError =
|
|
11860
|
+
const handleImageError = useCallback7((imageId) => {
|
|
11530
11861
|
setImageErrors((prev) => new Set(prev).add(imageId));
|
|
11531
11862
|
}, []);
|
|
11532
11863
|
const gridColsClass = images?.length === 1 ? "grid-cols-1" : {
|
|
@@ -11535,7 +11866,7 @@ var Whiteboard = ({
|
|
|
11535
11866
|
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
11536
11867
|
}[imagesPerRow];
|
|
11537
11868
|
if (!images || images.length === 0) {
|
|
11538
|
-
return /* @__PURE__ */
|
|
11869
|
+
return /* @__PURE__ */ jsx58(
|
|
11539
11870
|
"div",
|
|
11540
11871
|
{
|
|
11541
11872
|
className: cn(
|
|
@@ -11543,11 +11874,11 @@ var Whiteboard = ({
|
|
|
11543
11874
|
className
|
|
11544
11875
|
),
|
|
11545
11876
|
...rest,
|
|
11546
|
-
children: /* @__PURE__ */
|
|
11877
|
+
children: /* @__PURE__ */ jsx58("p", { className: "text-gray-400 text-sm", children: "Nenhuma imagem dispon\xEDvel" })
|
|
11547
11878
|
}
|
|
11548
11879
|
);
|
|
11549
11880
|
}
|
|
11550
|
-
return /* @__PURE__ */
|
|
11881
|
+
return /* @__PURE__ */ jsx58(
|
|
11551
11882
|
"div",
|
|
11552
11883
|
{
|
|
11553
11884
|
className: cn(
|
|
@@ -11555,7 +11886,7 @@ var Whiteboard = ({
|
|
|
11555
11886
|
className
|
|
11556
11887
|
),
|
|
11557
11888
|
...rest,
|
|
11558
|
-
children: /* @__PURE__ */
|
|
11889
|
+
children: /* @__PURE__ */ jsx58("div", { className: cn("grid gap-4", gridColsClass), children: images.map((image) => /* @__PURE__ */ jsxs45(
|
|
11559
11890
|
"div",
|
|
11560
11891
|
{
|
|
11561
11892
|
className: "relative group overflow-hidden bg-gray-100 rounded-lg",
|
|
@@ -11563,7 +11894,7 @@ var Whiteboard = ({
|
|
|
11563
11894
|
width: `${IMAGE_WIDTH}px`
|
|
11564
11895
|
},
|
|
11565
11896
|
children: [
|
|
11566
|
-
/* @__PURE__ */
|
|
11897
|
+
/* @__PURE__ */ jsx58(
|
|
11567
11898
|
"div",
|
|
11568
11899
|
{
|
|
11569
11900
|
className: "relative",
|
|
@@ -11571,8 +11902,8 @@ var Whiteboard = ({
|
|
|
11571
11902
|
width: `${IMAGE_WIDTH}px`,
|
|
11572
11903
|
height: `${IMAGE_HEIGHT}px`
|
|
11573
11904
|
},
|
|
11574
|
-
children: imageErrors.has(image.id) ? /* @__PURE__ */
|
|
11575
|
-
/* @__PURE__ */
|
|
11905
|
+
children: imageErrors.has(image.id) ? /* @__PURE__ */ jsx58("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-200", children: /* @__PURE__ */ jsx58("p", { className: "text-gray-500 text-sm text-center px-2", children: "Imagem indispon\xEDvel" }) }) : /* @__PURE__ */ jsxs45(Fragment11, { children: [
|
|
11906
|
+
/* @__PURE__ */ jsx58(
|
|
11576
11907
|
"img",
|
|
11577
11908
|
{
|
|
11578
11909
|
src: image.imageUrl,
|
|
@@ -11582,18 +11913,18 @@ var Whiteboard = ({
|
|
|
11582
11913
|
onError: () => handleImageError(image.id)
|
|
11583
11914
|
}
|
|
11584
11915
|
),
|
|
11585
|
-
/* @__PURE__ */
|
|
11916
|
+
/* @__PURE__ */ jsx58("div", { className: "absolute inset-0 bg-gradient-to-t from-black/20 to-transparent" })
|
|
11586
11917
|
] })
|
|
11587
11918
|
}
|
|
11588
11919
|
),
|
|
11589
|
-
showDownload && /* @__PURE__ */
|
|
11920
|
+
showDownload && /* @__PURE__ */ jsx58(
|
|
11590
11921
|
"button",
|
|
11591
11922
|
{
|
|
11592
11923
|
type: "button",
|
|
11593
11924
|
onClick: () => handleDownload(image),
|
|
11594
11925
|
className: "cursor-pointer absolute bottom-3 right-3 flex items-center justify-center bg-black/20 backdrop-blur-sm rounded hover:bg-black/30 transition-colors duration-200 group/button w-6 h-6",
|
|
11595
11926
|
"aria-label": `Download ${image.title || "imagem"}`,
|
|
11596
|
-
children: /* @__PURE__ */
|
|
11927
|
+
children: /* @__PURE__ */ jsx58(
|
|
11597
11928
|
ArrowsOut,
|
|
11598
11929
|
{
|
|
11599
11930
|
size: 24,
|
|
@@ -11616,13 +11947,13 @@ var Whiteboard_default = Whiteboard;
|
|
|
11616
11947
|
import {
|
|
11617
11948
|
createContext,
|
|
11618
11949
|
useContext,
|
|
11619
|
-
useEffect as
|
|
11620
|
-
useState as
|
|
11621
|
-
useCallback as
|
|
11622
|
-
useMemo as
|
|
11950
|
+
useEffect as useEffect23,
|
|
11951
|
+
useState as useState23,
|
|
11952
|
+
useCallback as useCallback8,
|
|
11953
|
+
useMemo as useMemo11
|
|
11623
11954
|
} from "react";
|
|
11624
11955
|
import { useLocation, Navigate } from "react-router-dom";
|
|
11625
|
-
import { Fragment as
|
|
11956
|
+
import { Fragment as Fragment12, jsx as jsx59 } from "react/jsx-runtime";
|
|
11626
11957
|
var AuthContext = createContext(void 0);
|
|
11627
11958
|
var AuthProvider = ({
|
|
11628
11959
|
children,
|
|
@@ -11633,12 +11964,12 @@ var AuthProvider = ({
|
|
|
11633
11964
|
getSessionFn,
|
|
11634
11965
|
getTokensFn
|
|
11635
11966
|
}) => {
|
|
11636
|
-
const [authState, setAuthState] =
|
|
11967
|
+
const [authState, setAuthState] = useState23({
|
|
11637
11968
|
isAuthenticated: false,
|
|
11638
11969
|
isLoading: true,
|
|
11639
11970
|
...initialAuthState
|
|
11640
11971
|
});
|
|
11641
|
-
const checkAuth =
|
|
11972
|
+
const checkAuth = useCallback8(async () => {
|
|
11642
11973
|
try {
|
|
11643
11974
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
11644
11975
|
if (!checkAuthFn) {
|
|
@@ -11669,7 +12000,7 @@ var AuthProvider = ({
|
|
|
11669
12000
|
return false;
|
|
11670
12001
|
}
|
|
11671
12002
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
11672
|
-
const signOut =
|
|
12003
|
+
const signOut = useCallback8(() => {
|
|
11673
12004
|
if (signOutFn) {
|
|
11674
12005
|
signOutFn();
|
|
11675
12006
|
}
|
|
@@ -11681,10 +12012,10 @@ var AuthProvider = ({
|
|
|
11681
12012
|
tokens: void 0
|
|
11682
12013
|
}));
|
|
11683
12014
|
}, [signOutFn]);
|
|
11684
|
-
|
|
12015
|
+
useEffect23(() => {
|
|
11685
12016
|
checkAuth();
|
|
11686
12017
|
}, [checkAuth]);
|
|
11687
|
-
const contextValue =
|
|
12018
|
+
const contextValue = useMemo11(
|
|
11688
12019
|
() => ({
|
|
11689
12020
|
...authState,
|
|
11690
12021
|
checkAuth,
|
|
@@ -11692,7 +12023,7 @@ var AuthProvider = ({
|
|
|
11692
12023
|
}),
|
|
11693
12024
|
[authState, checkAuth, signOut]
|
|
11694
12025
|
);
|
|
11695
|
-
return /* @__PURE__ */
|
|
12026
|
+
return /* @__PURE__ */ jsx59(AuthContext.Provider, { value: contextValue, children });
|
|
11696
12027
|
};
|
|
11697
12028
|
var useAuth = () => {
|
|
11698
12029
|
const context = useContext(AuthContext);
|
|
@@ -11708,9 +12039,9 @@ var ProtectedRoute = ({
|
|
|
11708
12039
|
additionalCheck
|
|
11709
12040
|
}) => {
|
|
11710
12041
|
const { isAuthenticated, isLoading, ...authState } = useAuth();
|
|
11711
|
-
const defaultLoadingComponent = /* @__PURE__ */
|
|
12042
|
+
const defaultLoadingComponent = /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsx59("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
11712
12043
|
if (isLoading) {
|
|
11713
|
-
return /* @__PURE__ */
|
|
12044
|
+
return /* @__PURE__ */ jsx59(Fragment12, { children: loadingComponent || defaultLoadingComponent });
|
|
11714
12045
|
}
|
|
11715
12046
|
if (!isAuthenticated) {
|
|
11716
12047
|
if (typeof window !== "undefined") {
|
|
@@ -11721,12 +12052,12 @@ var ProtectedRoute = ({
|
|
|
11721
12052
|
return null;
|
|
11722
12053
|
}
|
|
11723
12054
|
}
|
|
11724
|
-
return /* @__PURE__ */
|
|
12055
|
+
return /* @__PURE__ */ jsx59(Navigate, { to: redirectTo, replace: true });
|
|
11725
12056
|
}
|
|
11726
12057
|
if (additionalCheck && !additionalCheck({ isAuthenticated, isLoading, ...authState })) {
|
|
11727
|
-
return /* @__PURE__ */
|
|
12058
|
+
return /* @__PURE__ */ jsx59(Navigate, { to: redirectTo, replace: true });
|
|
11728
12059
|
}
|
|
11729
|
-
return /* @__PURE__ */
|
|
12060
|
+
return /* @__PURE__ */ jsx59(Fragment12, { children });
|
|
11730
12061
|
};
|
|
11731
12062
|
var PublicRoute = ({
|
|
11732
12063
|
children,
|
|
@@ -11736,15 +12067,15 @@ var PublicRoute = ({
|
|
|
11736
12067
|
}) => {
|
|
11737
12068
|
const { isAuthenticated, isLoading } = useAuth();
|
|
11738
12069
|
if (checkAuthBeforeRender && isLoading) {
|
|
11739
|
-
return /* @__PURE__ */
|
|
12070
|
+
return /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsx59("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
11740
12071
|
}
|
|
11741
12072
|
if (isAuthenticated && redirectIfAuthenticated) {
|
|
11742
|
-
return /* @__PURE__ */
|
|
12073
|
+
return /* @__PURE__ */ jsx59(Navigate, { to: redirectTo, replace: true });
|
|
11743
12074
|
}
|
|
11744
|
-
return /* @__PURE__ */
|
|
12075
|
+
return /* @__PURE__ */ jsx59(Fragment12, { children });
|
|
11745
12076
|
};
|
|
11746
12077
|
var withAuth = (Component, options = {}) => {
|
|
11747
|
-
return (props) => /* @__PURE__ */
|
|
12078
|
+
return (props) => /* @__PURE__ */ jsx59(ProtectedRoute, { ...options, children: /* @__PURE__ */ jsx59(Component, { ...props }) });
|
|
11748
12079
|
};
|
|
11749
12080
|
var useAuthGuard = (options = {}) => {
|
|
11750
12081
|
const authState = useAuth();
|
|
@@ -11759,7 +12090,7 @@ var useAuthGuard = (options = {}) => {
|
|
|
11759
12090
|
var useRouteAuth = (fallbackPath = "/") => {
|
|
11760
12091
|
const { isAuthenticated, isLoading } = useAuth();
|
|
11761
12092
|
const location = useLocation();
|
|
11762
|
-
const redirectToLogin = () => /* @__PURE__ */
|
|
12093
|
+
const redirectToLogin = () => /* @__PURE__ */ jsx59(Navigate, { to: fallbackPath, state: { from: location }, replace: true });
|
|
11763
12094
|
return {
|
|
11764
12095
|
isAuthenticated,
|
|
11765
12096
|
isLoading,
|
|
@@ -11796,11 +12127,11 @@ var getRootDomain = () => {
|
|
|
11796
12127
|
import {
|
|
11797
12128
|
forwardRef as forwardRef18,
|
|
11798
12129
|
useId as useId9,
|
|
11799
|
-
useState as
|
|
11800
|
-
useEffect as
|
|
12130
|
+
useState as useState24,
|
|
12131
|
+
useEffect as useEffect24
|
|
11801
12132
|
} from "react";
|
|
11802
12133
|
import { CaretRight as CaretRight7 } from "phosphor-react";
|
|
11803
|
-
import { jsx as
|
|
12134
|
+
import { jsx as jsx60, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
11804
12135
|
var CardAccordation = forwardRef18(
|
|
11805
12136
|
({
|
|
11806
12137
|
trigger,
|
|
@@ -11813,13 +12144,13 @@ var CardAccordation = forwardRef18(
|
|
|
11813
12144
|
disabled = false,
|
|
11814
12145
|
...props
|
|
11815
12146
|
}, ref) => {
|
|
11816
|
-
const [internalExpanded, setInternalExpanded] =
|
|
12147
|
+
const [internalExpanded, setInternalExpanded] = useState24(defaultExpanded);
|
|
11817
12148
|
const generatedId = useId9();
|
|
11818
12149
|
const contentId = value ? `accordion-content-${value}` : generatedId;
|
|
11819
12150
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
11820
12151
|
const isControlled = controlledExpanded !== void 0;
|
|
11821
12152
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
11822
|
-
|
|
12153
|
+
useEffect24(() => {
|
|
11823
12154
|
if (isControlled) {
|
|
11824
12155
|
setInternalExpanded(controlledExpanded);
|
|
11825
12156
|
}
|
|
@@ -11839,7 +12170,7 @@ var CardAccordation = forwardRef18(
|
|
|
11839
12170
|
handleToggle();
|
|
11840
12171
|
}
|
|
11841
12172
|
};
|
|
11842
|
-
return /* @__PURE__ */
|
|
12173
|
+
return /* @__PURE__ */ jsxs46(
|
|
11843
12174
|
CardBase,
|
|
11844
12175
|
{
|
|
11845
12176
|
ref,
|
|
@@ -11849,7 +12180,7 @@ var CardAccordation = forwardRef18(
|
|
|
11849
12180
|
className: cn("overflow-hidden", className),
|
|
11850
12181
|
...props,
|
|
11851
12182
|
children: [
|
|
11852
|
-
/* @__PURE__ */
|
|
12183
|
+
/* @__PURE__ */ jsxs46(
|
|
11853
12184
|
"button",
|
|
11854
12185
|
{
|
|
11855
12186
|
id: headerId,
|
|
@@ -11867,7 +12198,7 @@ var CardAccordation = forwardRef18(
|
|
|
11867
12198
|
"data-value": value,
|
|
11868
12199
|
children: [
|
|
11869
12200
|
trigger,
|
|
11870
|
-
/* @__PURE__ */
|
|
12201
|
+
/* @__PURE__ */ jsx60(
|
|
11871
12202
|
CaretRight7,
|
|
11872
12203
|
{
|
|
11873
12204
|
size: 20,
|
|
@@ -11882,7 +12213,7 @@ var CardAccordation = forwardRef18(
|
|
|
11882
12213
|
]
|
|
11883
12214
|
}
|
|
11884
12215
|
),
|
|
11885
|
-
/* @__PURE__ */
|
|
12216
|
+
/* @__PURE__ */ jsx60(
|
|
11886
12217
|
"section",
|
|
11887
12218
|
{
|
|
11888
12219
|
id: contentId,
|
|
@@ -11894,7 +12225,7 @@ var CardAccordation = forwardRef18(
|
|
|
11894
12225
|
),
|
|
11895
12226
|
"data-testid": "accordion-content",
|
|
11896
12227
|
"data-value": value,
|
|
11897
|
-
children: /* @__PURE__ */
|
|
12228
|
+
children: /* @__PURE__ */ jsx60("div", { className: "p-4 pt-0", children })
|
|
11898
12229
|
}
|
|
11899
12230
|
)
|
|
11900
12231
|
]
|
|
@@ -11910,12 +12241,12 @@ import {
|
|
|
11910
12241
|
cloneElement as cloneElement8,
|
|
11911
12242
|
forwardRef as forwardRef19,
|
|
11912
12243
|
isValidElement as isValidElement7,
|
|
11913
|
-
useEffect as
|
|
12244
|
+
useEffect as useEffect25,
|
|
11914
12245
|
useRef as useRef12,
|
|
11915
|
-
useState as
|
|
12246
|
+
useState as useState25
|
|
11916
12247
|
} from "react";
|
|
11917
12248
|
import { create as create10 } from "zustand";
|
|
11918
|
-
import { jsx as
|
|
12249
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
11919
12250
|
function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
11920
12251
|
return create10((set, get) => ({
|
|
11921
12252
|
type,
|
|
@@ -11981,7 +12312,7 @@ var AccordionGroup = forwardRef19(
|
|
|
11981
12312
|
className,
|
|
11982
12313
|
...props
|
|
11983
12314
|
}, ref) => {
|
|
11984
|
-
const [internalValue, setInternalValue] =
|
|
12315
|
+
const [internalValue, setInternalValue] = useState25(
|
|
11985
12316
|
defaultValue || (type === "single" ? "" : [])
|
|
11986
12317
|
);
|
|
11987
12318
|
const isControlled = controlledValue !== void 0;
|
|
@@ -12006,10 +12337,10 @@ var AccordionGroup = forwardRef19(
|
|
|
12006
12337
|
);
|
|
12007
12338
|
}
|
|
12008
12339
|
const store = storeRef.current;
|
|
12009
|
-
|
|
12340
|
+
useEffect25(() => {
|
|
12010
12341
|
store.setState({ value: currentValue });
|
|
12011
12342
|
}, [currentValue, store]);
|
|
12012
|
-
|
|
12343
|
+
useEffect25(() => {
|
|
12013
12344
|
if (!isControlled) {
|
|
12014
12345
|
setInternalValue((prev) => {
|
|
12015
12346
|
if (type === "single") {
|
|
@@ -12055,15 +12386,15 @@ var AccordionGroup = forwardRef19(
|
|
|
12055
12386
|
indexRef,
|
|
12056
12387
|
handleItemToggle
|
|
12057
12388
|
);
|
|
12058
|
-
return /* @__PURE__ */
|
|
12389
|
+
return /* @__PURE__ */ jsx61("div", { ref, className, ...props, children: enhancedChildren });
|
|
12059
12390
|
}
|
|
12060
12391
|
);
|
|
12061
12392
|
AccordionGroup.displayName = "AccordionGroup";
|
|
12062
12393
|
|
|
12063
12394
|
// src/components/Alternative/Alternative.tsx
|
|
12064
12395
|
import { CheckCircle as CheckCircle4, XCircle as XCircle3 } from "phosphor-react";
|
|
12065
|
-
import { forwardRef as forwardRef20, useId as useId10, useState as
|
|
12066
|
-
import { jsx as
|
|
12396
|
+
import { forwardRef as forwardRef20, useId as useId10, useState as useState26 } from "react";
|
|
12397
|
+
import { jsx as jsx62, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
12067
12398
|
var AlternativesList = ({
|
|
12068
12399
|
alternatives,
|
|
12069
12400
|
name,
|
|
@@ -12078,7 +12409,7 @@ var AlternativesList = ({
|
|
|
12078
12409
|
}) => {
|
|
12079
12410
|
const uniqueId = useId10();
|
|
12080
12411
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
12081
|
-
const [actualValue, setActualValue] =
|
|
12412
|
+
const [actualValue, setActualValue] = useState26(value);
|
|
12082
12413
|
const isReadonly = mode === "readonly";
|
|
12083
12414
|
const getStatusStyles2 = (status, isReadonly2) => {
|
|
12084
12415
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
@@ -12094,9 +12425,9 @@ var AlternativesList = ({
|
|
|
12094
12425
|
const getStatusBadge2 = (status) => {
|
|
12095
12426
|
switch (status) {
|
|
12096
12427
|
case "correct":
|
|
12097
|
-
return /* @__PURE__ */
|
|
12428
|
+
return /* @__PURE__ */ jsx62(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx62(CheckCircle4, {}), children: "Resposta correta" });
|
|
12098
12429
|
case "incorrect":
|
|
12099
|
-
return /* @__PURE__ */
|
|
12430
|
+
return /* @__PURE__ */ jsx62(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx62(XCircle3, {}), children: "Resposta incorreta" });
|
|
12100
12431
|
default:
|
|
12101
12432
|
return null;
|
|
12102
12433
|
}
|
|
@@ -12126,10 +12457,10 @@ var AlternativesList = ({
|
|
|
12126
12457
|
const renderRadio = () => {
|
|
12127
12458
|
const radioClasses = `w-6 h-6 rounded-full border-2 cursor-default transition-all duration-200 flex items-center justify-center ${isUserSelected ? "border-primary-950 bg-background" : "border-border-400 bg-background"}`;
|
|
12128
12459
|
const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
|
|
12129
|
-
return /* @__PURE__ */
|
|
12460
|
+
return /* @__PURE__ */ jsx62("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ jsx62("div", { className: dotClasses }) });
|
|
12130
12461
|
};
|
|
12131
12462
|
if (layout === "detailed") {
|
|
12132
|
-
return /* @__PURE__ */
|
|
12463
|
+
return /* @__PURE__ */ jsx62(
|
|
12133
12464
|
"div",
|
|
12134
12465
|
{
|
|
12135
12466
|
className: cn(
|
|
@@ -12137,11 +12468,11 @@ var AlternativesList = ({
|
|
|
12137
12468
|
statusStyles,
|
|
12138
12469
|
alternative.disabled ? "opacity-50" : ""
|
|
12139
12470
|
),
|
|
12140
|
-
children: /* @__PURE__ */
|
|
12141
|
-
/* @__PURE__ */
|
|
12142
|
-
/* @__PURE__ */
|
|
12143
|
-
/* @__PURE__ */
|
|
12144
|
-
/* @__PURE__ */
|
|
12471
|
+
children: /* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-3", children: [
|
|
12472
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
12473
|
+
/* @__PURE__ */ jsx62("div", { className: "mt-1", children: renderRadio() }),
|
|
12474
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex-1", children: [
|
|
12475
|
+
/* @__PURE__ */ jsx62(
|
|
12145
12476
|
"p",
|
|
12146
12477
|
{
|
|
12147
12478
|
className: cn(
|
|
@@ -12151,16 +12482,16 @@ var AlternativesList = ({
|
|
|
12151
12482
|
children: alternative.label
|
|
12152
12483
|
}
|
|
12153
12484
|
),
|
|
12154
|
-
alternative.description && /* @__PURE__ */
|
|
12485
|
+
alternative.description && /* @__PURE__ */ jsx62("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
12155
12486
|
] })
|
|
12156
12487
|
] }),
|
|
12157
|
-
statusBadge && /* @__PURE__ */
|
|
12488
|
+
statusBadge && /* @__PURE__ */ jsx62("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12158
12489
|
] })
|
|
12159
12490
|
},
|
|
12160
12491
|
alternativeId
|
|
12161
12492
|
);
|
|
12162
12493
|
}
|
|
12163
|
-
return /* @__PURE__ */
|
|
12494
|
+
return /* @__PURE__ */ jsxs47(
|
|
12164
12495
|
"div",
|
|
12165
12496
|
{
|
|
12166
12497
|
className: cn(
|
|
@@ -12169,9 +12500,9 @@ var AlternativesList = ({
|
|
|
12169
12500
|
alternative.disabled ? "opacity-50" : ""
|
|
12170
12501
|
),
|
|
12171
12502
|
children: [
|
|
12172
|
-
/* @__PURE__ */
|
|
12503
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
12173
12504
|
renderRadio(),
|
|
12174
|
-
/* @__PURE__ */
|
|
12505
|
+
/* @__PURE__ */ jsx62(
|
|
12175
12506
|
"span",
|
|
12176
12507
|
{
|
|
12177
12508
|
className: cn(
|
|
@@ -12182,14 +12513,14 @@ var AlternativesList = ({
|
|
|
12182
12513
|
}
|
|
12183
12514
|
)
|
|
12184
12515
|
] }),
|
|
12185
|
-
statusBadge && /* @__PURE__ */
|
|
12516
|
+
statusBadge && /* @__PURE__ */ jsx62("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12186
12517
|
]
|
|
12187
12518
|
},
|
|
12188
12519
|
alternativeId
|
|
12189
12520
|
);
|
|
12190
12521
|
};
|
|
12191
12522
|
if (isReadonly) {
|
|
12192
|
-
return /* @__PURE__ */
|
|
12523
|
+
return /* @__PURE__ */ jsx62(
|
|
12193
12524
|
"div",
|
|
12194
12525
|
{
|
|
12195
12526
|
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
@@ -12199,7 +12530,7 @@ var AlternativesList = ({
|
|
|
12199
12530
|
}
|
|
12200
12531
|
);
|
|
12201
12532
|
}
|
|
12202
|
-
return /* @__PURE__ */
|
|
12533
|
+
return /* @__PURE__ */ jsx62(
|
|
12203
12534
|
RadioGroup,
|
|
12204
12535
|
{
|
|
12205
12536
|
name: groupName,
|
|
@@ -12216,7 +12547,7 @@ var AlternativesList = ({
|
|
|
12216
12547
|
const statusStyles = getStatusStyles2(alternative.status, false);
|
|
12217
12548
|
const statusBadge = getStatusBadge2(alternative.status);
|
|
12218
12549
|
if (layout === "detailed") {
|
|
12219
|
-
return /* @__PURE__ */
|
|
12550
|
+
return /* @__PURE__ */ jsx62(
|
|
12220
12551
|
"div",
|
|
12221
12552
|
{
|
|
12222
12553
|
className: cn(
|
|
@@ -12224,9 +12555,9 @@ var AlternativesList = ({
|
|
|
12224
12555
|
statusStyles,
|
|
12225
12556
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
12226
12557
|
),
|
|
12227
|
-
children: /* @__PURE__ */
|
|
12228
|
-
/* @__PURE__ */
|
|
12229
|
-
/* @__PURE__ */
|
|
12558
|
+
children: /* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-3", children: [
|
|
12559
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
12560
|
+
/* @__PURE__ */ jsx62(
|
|
12230
12561
|
RadioGroupItem,
|
|
12231
12562
|
{
|
|
12232
12563
|
value: alternative.value,
|
|
@@ -12235,8 +12566,8 @@ var AlternativesList = ({
|
|
|
12235
12566
|
className: "mt-1"
|
|
12236
12567
|
}
|
|
12237
12568
|
),
|
|
12238
|
-
/* @__PURE__ */
|
|
12239
|
-
/* @__PURE__ */
|
|
12569
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex-1", children: [
|
|
12570
|
+
/* @__PURE__ */ jsx62(
|
|
12240
12571
|
"label",
|
|
12241
12572
|
{
|
|
12242
12573
|
htmlFor: alternativeId,
|
|
@@ -12248,16 +12579,16 @@ var AlternativesList = ({
|
|
|
12248
12579
|
children: alternative.label
|
|
12249
12580
|
}
|
|
12250
12581
|
),
|
|
12251
|
-
alternative.description && /* @__PURE__ */
|
|
12582
|
+
alternative.description && /* @__PURE__ */ jsx62("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
12252
12583
|
] })
|
|
12253
12584
|
] }),
|
|
12254
|
-
statusBadge && /* @__PURE__ */
|
|
12585
|
+
statusBadge && /* @__PURE__ */ jsx62("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12255
12586
|
] })
|
|
12256
12587
|
},
|
|
12257
12588
|
alternativeId
|
|
12258
12589
|
);
|
|
12259
12590
|
}
|
|
12260
|
-
return /* @__PURE__ */
|
|
12591
|
+
return /* @__PURE__ */ jsxs47(
|
|
12261
12592
|
"div",
|
|
12262
12593
|
{
|
|
12263
12594
|
className: cn(
|
|
@@ -12266,8 +12597,8 @@ var AlternativesList = ({
|
|
|
12266
12597
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
12267
12598
|
),
|
|
12268
12599
|
children: [
|
|
12269
|
-
/* @__PURE__ */
|
|
12270
|
-
/* @__PURE__ */
|
|
12600
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
12601
|
+
/* @__PURE__ */ jsx62(
|
|
12271
12602
|
RadioGroupItem,
|
|
12272
12603
|
{
|
|
12273
12604
|
value: alternative.value,
|
|
@@ -12275,7 +12606,7 @@ var AlternativesList = ({
|
|
|
12275
12606
|
disabled: alternative.disabled
|
|
12276
12607
|
}
|
|
12277
12608
|
),
|
|
12278
|
-
/* @__PURE__ */
|
|
12609
|
+
/* @__PURE__ */ jsx62(
|
|
12279
12610
|
"label",
|
|
12280
12611
|
{
|
|
12281
12612
|
htmlFor: alternativeId,
|
|
@@ -12288,7 +12619,7 @@ var AlternativesList = ({
|
|
|
12288
12619
|
}
|
|
12289
12620
|
)
|
|
12290
12621
|
] }),
|
|
12291
|
-
statusBadge && /* @__PURE__ */
|
|
12622
|
+
statusBadge && /* @__PURE__ */ jsx62("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12292
12623
|
]
|
|
12293
12624
|
},
|
|
12294
12625
|
alternativeId
|
|
@@ -12299,7 +12630,7 @@ var AlternativesList = ({
|
|
|
12299
12630
|
};
|
|
12300
12631
|
var HeaderAlternative = forwardRef20(
|
|
12301
12632
|
({ className, title, subTitle, content, ...props }, ref) => {
|
|
12302
|
-
return /* @__PURE__ */
|
|
12633
|
+
return /* @__PURE__ */ jsxs47(
|
|
12303
12634
|
"div",
|
|
12304
12635
|
{
|
|
12305
12636
|
ref,
|
|
@@ -12309,11 +12640,11 @@ var HeaderAlternative = forwardRef20(
|
|
|
12309
12640
|
),
|
|
12310
12641
|
...props,
|
|
12311
12642
|
children: [
|
|
12312
|
-
/* @__PURE__ */
|
|
12313
|
-
/* @__PURE__ */
|
|
12314
|
-
/* @__PURE__ */
|
|
12643
|
+
/* @__PURE__ */ jsxs47("span", { className: "flex flex-col", children: [
|
|
12644
|
+
/* @__PURE__ */ jsx62("p", { className: "text-text-950 font-bold text-lg", children: title }),
|
|
12645
|
+
/* @__PURE__ */ jsx62("p", { className: "text-text-700 text-sm ", children: subTitle })
|
|
12315
12646
|
] }),
|
|
12316
|
-
/* @__PURE__ */
|
|
12647
|
+
/* @__PURE__ */ jsx62("p", { className: "text-text-950 text-md", children: content })
|
|
12317
12648
|
]
|
|
12318
12649
|
}
|
|
12319
12650
|
);
|
|
@@ -12363,7 +12694,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
12363
12694
|
}
|
|
12364
12695
|
|
|
12365
12696
|
// src/components/Auth/useUrlAuthentication.ts
|
|
12366
|
-
import { useEffect as
|
|
12697
|
+
import { useEffect as useEffect26, useRef as useRef13 } from "react";
|
|
12367
12698
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
12368
12699
|
var getAuthParams = (location, extractParams) => {
|
|
12369
12700
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -12412,7 +12743,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
12412
12743
|
function useUrlAuthentication(options) {
|
|
12413
12744
|
const location = useLocation2();
|
|
12414
12745
|
const processedRef = useRef13(false);
|
|
12415
|
-
|
|
12746
|
+
useEffect26(() => {
|
|
12416
12747
|
const handleAuthentication = async () => {
|
|
12417
12748
|
if (processedRef.current) {
|
|
12418
12749
|
return;
|
|
@@ -12483,9 +12814,9 @@ function useUrlAuthentication(options) {
|
|
|
12483
12814
|
}
|
|
12484
12815
|
|
|
12485
12816
|
// src/components/Auth/useApiConfig.ts
|
|
12486
|
-
import { useMemo as
|
|
12817
|
+
import { useMemo as useMemo12 } from "react";
|
|
12487
12818
|
function useApiConfig(api) {
|
|
12488
|
-
return
|
|
12819
|
+
return useMemo12(
|
|
12489
12820
|
() => ({
|
|
12490
12821
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
12491
12822
|
}),
|
|
@@ -12503,8 +12834,8 @@ import {
|
|
|
12503
12834
|
} from "phosphor-react";
|
|
12504
12835
|
import {
|
|
12505
12836
|
forwardRef as forwardRef22,
|
|
12506
|
-
useEffect as
|
|
12507
|
-
useState as
|
|
12837
|
+
useEffect as useEffect29,
|
|
12838
|
+
useState as useState29
|
|
12508
12839
|
} from "react";
|
|
12509
12840
|
|
|
12510
12841
|
// src/components/Quiz/useQuizStore.ts
|
|
@@ -13117,18 +13448,18 @@ var useQuizStore = create11()(
|
|
|
13117
13448
|
// src/components/Quiz/QuizContent.tsx
|
|
13118
13449
|
import {
|
|
13119
13450
|
forwardRef as forwardRef21,
|
|
13120
|
-
useCallback as
|
|
13121
|
-
useEffect as
|
|
13451
|
+
useCallback as useCallback9,
|
|
13452
|
+
useEffect as useEffect28,
|
|
13122
13453
|
useId as useId11,
|
|
13123
|
-
useMemo as
|
|
13454
|
+
useMemo as useMemo13,
|
|
13124
13455
|
useRef as useRef14,
|
|
13125
|
-
useState as
|
|
13456
|
+
useState as useState28
|
|
13126
13457
|
} from "react";
|
|
13127
13458
|
|
|
13128
13459
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
13129
|
-
import { useEffect as
|
|
13460
|
+
import { useEffect as useEffect27, useState as useState27 } from "react";
|
|
13130
13461
|
import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check5 } from "phosphor-react";
|
|
13131
|
-
import { jsx as
|
|
13462
|
+
import { jsx as jsx63, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
13132
13463
|
var MultipleChoiceList = ({
|
|
13133
13464
|
disabled = false,
|
|
13134
13465
|
className = "",
|
|
@@ -13138,16 +13469,16 @@ var MultipleChoiceList = ({
|
|
|
13138
13469
|
onHandleSelectedValues,
|
|
13139
13470
|
mode = "interactive"
|
|
13140
13471
|
}) => {
|
|
13141
|
-
const [actualValue, setActualValue] =
|
|
13142
|
-
|
|
13472
|
+
const [actualValue, setActualValue] = useState27(selectedValues);
|
|
13473
|
+
useEffect27(() => {
|
|
13143
13474
|
setActualValue(selectedValues);
|
|
13144
13475
|
}, [selectedValues]);
|
|
13145
13476
|
const getStatusBadge2 = (status) => {
|
|
13146
13477
|
switch (status) {
|
|
13147
13478
|
case "correct":
|
|
13148
|
-
return /* @__PURE__ */
|
|
13479
|
+
return /* @__PURE__ */ jsx63(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx63(CheckCircle5, {}), children: "Resposta correta" });
|
|
13149
13480
|
case "incorrect":
|
|
13150
|
-
return /* @__PURE__ */
|
|
13481
|
+
return /* @__PURE__ */ jsx63(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx63(XCircle4, {}), children: "Resposta incorreta" });
|
|
13151
13482
|
default:
|
|
13152
13483
|
return null;
|
|
13153
13484
|
}
|
|
@@ -13168,14 +13499,14 @@ var MultipleChoiceList = ({
|
|
|
13168
13499
|
isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
|
|
13169
13500
|
isDisabled && "opacity-40 cursor-not-allowed"
|
|
13170
13501
|
);
|
|
13171
|
-
return /* @__PURE__ */
|
|
13502
|
+
return /* @__PURE__ */ jsx63("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ jsx63(Check5, { size: 16, weight: "bold" }) });
|
|
13172
13503
|
};
|
|
13173
13504
|
if (mode === "readonly") {
|
|
13174
|
-
return /* @__PURE__ */
|
|
13505
|
+
return /* @__PURE__ */ jsx63("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
|
|
13175
13506
|
const isSelected = actualValue?.includes(choice.value) || false;
|
|
13176
13507
|
const statusStyles = getStatusStyles2(choice.status);
|
|
13177
13508
|
const statusBadge = getStatusBadge2(choice.status);
|
|
13178
|
-
return /* @__PURE__ */
|
|
13509
|
+
return /* @__PURE__ */ jsxs48(
|
|
13179
13510
|
"div",
|
|
13180
13511
|
{
|
|
13181
13512
|
className: cn(
|
|
@@ -13184,9 +13515,9 @@ var MultipleChoiceList = ({
|
|
|
13184
13515
|
choice.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
13185
13516
|
),
|
|
13186
13517
|
children: [
|
|
13187
|
-
/* @__PURE__ */
|
|
13518
|
+
/* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
13188
13519
|
renderVisualCheckbox(isSelected, choice.disabled || disabled),
|
|
13189
|
-
/* @__PURE__ */
|
|
13520
|
+
/* @__PURE__ */ jsx63(
|
|
13190
13521
|
"span",
|
|
13191
13522
|
{
|
|
13192
13523
|
className: cn(
|
|
@@ -13198,14 +13529,14 @@ var MultipleChoiceList = ({
|
|
|
13198
13529
|
}
|
|
13199
13530
|
)
|
|
13200
13531
|
] }),
|
|
13201
|
-
statusBadge && /* @__PURE__ */
|
|
13532
|
+
statusBadge && /* @__PURE__ */ jsx63("div", { className: "flex-shrink-0", children: statusBadge })
|
|
13202
13533
|
]
|
|
13203
13534
|
},
|
|
13204
13535
|
`readonly-${choice.value}-${i}`
|
|
13205
13536
|
);
|
|
13206
13537
|
}) });
|
|
13207
13538
|
}
|
|
13208
|
-
return /* @__PURE__ */
|
|
13539
|
+
return /* @__PURE__ */ jsx63(
|
|
13209
13540
|
"div",
|
|
13210
13541
|
{
|
|
13211
13542
|
className: cn(
|
|
@@ -13213,7 +13544,7 @@ var MultipleChoiceList = ({
|
|
|
13213
13544
|
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
13214
13545
|
className
|
|
13215
13546
|
),
|
|
13216
|
-
children: /* @__PURE__ */
|
|
13547
|
+
children: /* @__PURE__ */ jsx63(
|
|
13217
13548
|
CheckboxList_default,
|
|
13218
13549
|
{
|
|
13219
13550
|
name,
|
|
@@ -13223,12 +13554,12 @@ var MultipleChoiceList = ({
|
|
|
13223
13554
|
onHandleSelectedValues?.(v);
|
|
13224
13555
|
},
|
|
13225
13556
|
disabled,
|
|
13226
|
-
children: choices.map((choice, i) => /* @__PURE__ */
|
|
13557
|
+
children: choices.map((choice, i) => /* @__PURE__ */ jsxs48(
|
|
13227
13558
|
"div",
|
|
13228
13559
|
{
|
|
13229
13560
|
className: "flex flex-row gap-2 items-center",
|
|
13230
13561
|
children: [
|
|
13231
|
-
/* @__PURE__ */
|
|
13562
|
+
/* @__PURE__ */ jsx63(
|
|
13232
13563
|
CheckboxListItem,
|
|
13233
13564
|
{
|
|
13234
13565
|
value: choice.value,
|
|
@@ -13236,7 +13567,7 @@ var MultipleChoiceList = ({
|
|
|
13236
13567
|
disabled: choice.disabled || disabled
|
|
13237
13568
|
}
|
|
13238
13569
|
),
|
|
13239
|
-
/* @__PURE__ */
|
|
13570
|
+
/* @__PURE__ */ jsx63(
|
|
13240
13571
|
"label",
|
|
13241
13572
|
{
|
|
13242
13573
|
htmlFor: `interactive-${choice.value}-${i}`,
|
|
@@ -13265,13 +13596,13 @@ import { CheckCircle as CheckCircle6, XCircle as XCircle5 } from "phosphor-react
|
|
|
13265
13596
|
var mock_image_question_default = "./mock-image-question-HEZCLFDL.png";
|
|
13266
13597
|
|
|
13267
13598
|
// src/components/Quiz/QuizContent.tsx
|
|
13268
|
-
import { Fragment as
|
|
13599
|
+
import { Fragment as Fragment13, jsx as jsx64, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
13269
13600
|
var getStatusBadge = (status) => {
|
|
13270
13601
|
switch (status) {
|
|
13271
13602
|
case "correct":
|
|
13272
|
-
return /* @__PURE__ */
|
|
13603
|
+
return /* @__PURE__ */ jsx64(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx64(CheckCircle6, {}), children: "Resposta correta" });
|
|
13273
13604
|
case "incorrect":
|
|
13274
|
-
return /* @__PURE__ */
|
|
13605
|
+
return /* @__PURE__ */ jsx64(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx64(XCircle5, {}), children: "Resposta incorreta" });
|
|
13275
13606
|
default:
|
|
13276
13607
|
return null;
|
|
13277
13608
|
}
|
|
@@ -13286,11 +13617,11 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
13286
13617
|
};
|
|
13287
13618
|
var QuizSubTitle = forwardRef21(
|
|
13288
13619
|
({ subTitle, ...props }, ref) => {
|
|
13289
|
-
return /* @__PURE__ */
|
|
13620
|
+
return /* @__PURE__ */ jsx64("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ jsx64("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
13290
13621
|
}
|
|
13291
13622
|
);
|
|
13292
13623
|
var QuizContainer = forwardRef21(({ children, className, ...props }, ref) => {
|
|
13293
|
-
return /* @__PURE__ */
|
|
13624
|
+
return /* @__PURE__ */ jsx64(
|
|
13294
13625
|
"div",
|
|
13295
13626
|
{
|
|
13296
13627
|
ref,
|
|
@@ -13343,10 +13674,10 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
13343
13674
|
};
|
|
13344
13675
|
});
|
|
13345
13676
|
if (!alternatives)
|
|
13346
|
-
return /* @__PURE__ */
|
|
13347
|
-
return /* @__PURE__ */
|
|
13348
|
-
/* @__PURE__ */
|
|
13349
|
-
/* @__PURE__ */
|
|
13677
|
+
return /* @__PURE__ */ jsx64("div", { children: /* @__PURE__ */ jsx64("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
13678
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13679
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13680
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64(
|
|
13350
13681
|
AlternativesList,
|
|
13351
13682
|
{
|
|
13352
13683
|
mode: variant === "default" ? "interactive" : "readonly",
|
|
@@ -13380,13 +13711,13 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13380
13711
|
);
|
|
13381
13712
|
const prevSelectedValuesRef = useRef14([]);
|
|
13382
13713
|
const prevQuestionIdRef = useRef14("");
|
|
13383
|
-
const allCurrentAnswerIds =
|
|
13714
|
+
const allCurrentAnswerIds = useMemo13(() => {
|
|
13384
13715
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
13385
13716
|
}, [allCurrentAnswers]);
|
|
13386
|
-
const selectedValues =
|
|
13717
|
+
const selectedValues = useMemo13(() => {
|
|
13387
13718
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
13388
13719
|
}, [allCurrentAnswerIds]);
|
|
13389
|
-
const stableSelectedValues =
|
|
13720
|
+
const stableSelectedValues = useMemo13(() => {
|
|
13390
13721
|
const currentQuestionId = currentQuestion?.id || "";
|
|
13391
13722
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
13392
13723
|
if (hasQuestionChanged) {
|
|
@@ -13410,7 +13741,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13410
13741
|
variant,
|
|
13411
13742
|
currentQuestionResult?.selectedOptions
|
|
13412
13743
|
]);
|
|
13413
|
-
const handleSelectedValues =
|
|
13744
|
+
const handleSelectedValues = useCallback9(
|
|
13414
13745
|
(values) => {
|
|
13415
13746
|
if (currentQuestion) {
|
|
13416
13747
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -13418,7 +13749,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13418
13749
|
},
|
|
13419
13750
|
[currentQuestion, selectMultipleAnswer]
|
|
13420
13751
|
);
|
|
13421
|
-
const questionKey =
|
|
13752
|
+
const questionKey = useMemo13(
|
|
13422
13753
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
13423
13754
|
[currentQuestion?.id]
|
|
13424
13755
|
);
|
|
@@ -13449,10 +13780,10 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13449
13780
|
};
|
|
13450
13781
|
});
|
|
13451
13782
|
if (!choices)
|
|
13452
|
-
return /* @__PURE__ */
|
|
13453
|
-
return /* @__PURE__ */
|
|
13454
|
-
/* @__PURE__ */
|
|
13455
|
-
/* @__PURE__ */
|
|
13783
|
+
return /* @__PURE__ */ jsx64("div", { children: /* @__PURE__ */ jsx64("p", { children: "N\xE3o h\xE1 Escolhas Multiplas" }) });
|
|
13784
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13785
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13786
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64(
|
|
13456
13787
|
MultipleChoiceList,
|
|
13457
13788
|
{
|
|
13458
13789
|
choices,
|
|
@@ -13486,7 +13817,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13486
13817
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
13487
13818
|
}
|
|
13488
13819
|
};
|
|
13489
|
-
const adjustTextareaHeight =
|
|
13820
|
+
const adjustTextareaHeight = useCallback9(() => {
|
|
13490
13821
|
if (textareaRef.current) {
|
|
13491
13822
|
textareaRef.current.style.height = "auto";
|
|
13492
13823
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -13496,16 +13827,16 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13496
13827
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
13497
13828
|
}
|
|
13498
13829
|
}, []);
|
|
13499
|
-
|
|
13830
|
+
useEffect28(() => {
|
|
13500
13831
|
adjustTextareaHeight();
|
|
13501
13832
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
13502
13833
|
if (!currentQuestion) {
|
|
13503
|
-
return /* @__PURE__ */
|
|
13834
|
+
return /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
13504
13835
|
}
|
|
13505
13836
|
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
13506
|
-
return /* @__PURE__ */
|
|
13507
|
-
/* @__PURE__ */
|
|
13508
|
-
/* @__PURE__ */
|
|
13837
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13838
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Resposta" }),
|
|
13839
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64(
|
|
13509
13840
|
TextArea_default,
|
|
13510
13841
|
{
|
|
13511
13842
|
ref: textareaRef,
|
|
@@ -13517,10 +13848,10 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13517
13848
|
maxLength: charLimit,
|
|
13518
13849
|
showCharacterCount: !!charLimit
|
|
13519
13850
|
}
|
|
13520
|
-
) }) : /* @__PURE__ */
|
|
13521
|
-
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */
|
|
13522
|
-
/* @__PURE__ */
|
|
13523
|
-
/* @__PURE__ */
|
|
13851
|
+
) }) : /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
13852
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13853
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
13854
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: currentQuestionResult?.teacherFeedback }) })
|
|
13524
13855
|
] })
|
|
13525
13856
|
] });
|
|
13526
13857
|
};
|
|
@@ -13546,16 +13877,16 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
13546
13877
|
];
|
|
13547
13878
|
const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
|
|
13548
13879
|
const isDefaultVariant = variant === "default";
|
|
13549
|
-
return /* @__PURE__ */
|
|
13550
|
-
/* @__PURE__ */
|
|
13551
|
-
/* @__PURE__ */
|
|
13880
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13881
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13882
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
13552
13883
|
const variantCorrect = option.isCorrect ? "correct" : "incorrect";
|
|
13553
|
-
return /* @__PURE__ */
|
|
13884
|
+
return /* @__PURE__ */ jsxs49(
|
|
13554
13885
|
"section",
|
|
13555
13886
|
{
|
|
13556
13887
|
className: "flex flex-col gap-2",
|
|
13557
13888
|
children: [
|
|
13558
|
-
/* @__PURE__ */
|
|
13889
|
+
/* @__PURE__ */ jsxs49(
|
|
13559
13890
|
"div",
|
|
13560
13891
|
{
|
|
13561
13892
|
className: cn(
|
|
@@ -13563,20 +13894,20 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
13563
13894
|
isDefaultVariant ? "" : getStatusStyles(variantCorrect)
|
|
13564
13895
|
),
|
|
13565
13896
|
children: [
|
|
13566
|
-
/* @__PURE__ */
|
|
13567
|
-
isDefaultVariant ? /* @__PURE__ */
|
|
13568
|
-
/* @__PURE__ */
|
|
13569
|
-
/* @__PURE__ */
|
|
13570
|
-
/* @__PURE__ */
|
|
13571
|
-
/* @__PURE__ */
|
|
13897
|
+
/* @__PURE__ */ jsx64("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
|
|
13898
|
+
isDefaultVariant ? /* @__PURE__ */ jsxs49(Select_default, { size: "medium", children: [
|
|
13899
|
+
/* @__PURE__ */ jsx64(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ jsx64(SelectValue, { placeholder: "Selecione opc\xE3o" }) }),
|
|
13900
|
+
/* @__PURE__ */ jsxs49(SelectContent, { children: [
|
|
13901
|
+
/* @__PURE__ */ jsx64(SelectItem, { value: "V", children: "Verdadeiro" }),
|
|
13902
|
+
/* @__PURE__ */ jsx64(SelectItem, { value: "F", children: "Falso" })
|
|
13572
13903
|
] })
|
|
13573
|
-
] }) : /* @__PURE__ */
|
|
13904
|
+
] }) : /* @__PURE__ */ jsx64("div", { className: "flex-shrink-0", children: getStatusBadge(variantCorrect) })
|
|
13574
13905
|
]
|
|
13575
13906
|
}
|
|
13576
13907
|
),
|
|
13577
|
-
!isDefaultVariant && /* @__PURE__ */
|
|
13578
|
-
/* @__PURE__ */
|
|
13579
|
-
!option.isCorrect && /* @__PURE__ */
|
|
13908
|
+
!isDefaultVariant && /* @__PURE__ */ jsxs49("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
13909
|
+
/* @__PURE__ */ jsx64("p", { className: "text-text-800 text-2xs", children: "Resposta selecionada: V" }),
|
|
13910
|
+
!option.isCorrect && /* @__PURE__ */ jsx64("p", { className: "text-text-800 text-2xs", children: "Resposta correta: F" })
|
|
13580
13911
|
] })
|
|
13581
13912
|
]
|
|
13582
13913
|
},
|
|
@@ -13637,7 +13968,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13637
13968
|
isCorrect: false
|
|
13638
13969
|
}
|
|
13639
13970
|
];
|
|
13640
|
-
const [userAnswers, setUserAnswers] =
|
|
13971
|
+
const [userAnswers, setUserAnswers] = useState28(() => {
|
|
13641
13972
|
if (variant === "result") {
|
|
13642
13973
|
return mockUserAnswers;
|
|
13643
13974
|
}
|
|
@@ -13666,13 +13997,13 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13666
13997
|
const assignedDots = new Set(
|
|
13667
13998
|
userAnswers.map((a) => a.dotOption).filter(Boolean)
|
|
13668
13999
|
);
|
|
13669
|
-
return /* @__PURE__ */
|
|
13670
|
-
/* @__PURE__ */
|
|
13671
|
-
/* @__PURE__ */
|
|
14000
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
14001
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
14002
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
13672
14003
|
const answer = userAnswers[index];
|
|
13673
14004
|
const variantCorrect = answer.isCorrect ? "correct" : "incorrect";
|
|
13674
|
-
return /* @__PURE__ */
|
|
13675
|
-
/* @__PURE__ */
|
|
14005
|
+
return /* @__PURE__ */ jsxs49("section", { className: "flex flex-col gap-2", children: [
|
|
14006
|
+
/* @__PURE__ */ jsxs49(
|
|
13676
14007
|
"div",
|
|
13677
14008
|
{
|
|
13678
14009
|
className: cn(
|
|
@@ -13680,30 +14011,30 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13680
14011
|
isDefaultVariant ? "" : getStatusStyles(variantCorrect)
|
|
13681
14012
|
),
|
|
13682
14013
|
children: [
|
|
13683
|
-
/* @__PURE__ */
|
|
13684
|
-
isDefaultVariant ? /* @__PURE__ */
|
|
14014
|
+
/* @__PURE__ */ jsx64("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
|
|
14015
|
+
isDefaultVariant ? /* @__PURE__ */ jsxs49(
|
|
13685
14016
|
Select_default,
|
|
13686
14017
|
{
|
|
13687
14018
|
size: "medium",
|
|
13688
14019
|
value: answer.dotOption || void 0,
|
|
13689
14020
|
onValueChange: (value) => handleSelectDot(index, value),
|
|
13690
14021
|
children: [
|
|
13691
|
-
/* @__PURE__ */
|
|
13692
|
-
/* @__PURE__ */
|
|
14022
|
+
/* @__PURE__ */ jsx64(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ jsx64(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
14023
|
+
/* @__PURE__ */ jsx64(SelectContent, { children: dotsOptions.filter(
|
|
13693
14024
|
(dot) => !assignedDots.has(dot.label) || answer.dotOption === dot.label
|
|
13694
|
-
).map((dot) => /* @__PURE__ */
|
|
14025
|
+
).map((dot) => /* @__PURE__ */ jsx64(SelectItem, { value: dot.label, children: dot.label }, dot.label)) })
|
|
13695
14026
|
]
|
|
13696
14027
|
}
|
|
13697
|
-
) : /* @__PURE__ */
|
|
14028
|
+
) : /* @__PURE__ */ jsx64("div", { className: "flex-shrink-0", children: answer.isCorrect === null ? null : getStatusBadge(variantCorrect) })
|
|
13698
14029
|
]
|
|
13699
14030
|
}
|
|
13700
14031
|
),
|
|
13701
|
-
!isDefaultVariant && /* @__PURE__ */
|
|
13702
|
-
/* @__PURE__ */
|
|
14032
|
+
!isDefaultVariant && /* @__PURE__ */ jsxs49("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
14033
|
+
/* @__PURE__ */ jsxs49("p", { className: "text-text-800 text-2xs", children: [
|
|
13703
14034
|
"Resposta selecionada: ",
|
|
13704
14035
|
answer.dotOption || "Nenhuma"
|
|
13705
14036
|
] }),
|
|
13706
|
-
!answer.isCorrect && /* @__PURE__ */
|
|
14037
|
+
!answer.isCorrect && /* @__PURE__ */ jsxs49("p", { className: "text-text-800 text-2xs", children: [
|
|
13707
14038
|
"Resposta correta: ",
|
|
13708
14039
|
answer.correctOption
|
|
13709
14040
|
] })
|
|
@@ -13756,7 +14087,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13756
14087
|
isCorrect: true
|
|
13757
14088
|
}
|
|
13758
14089
|
];
|
|
13759
|
-
const [answers, setAnswers] =
|
|
14090
|
+
const [answers, setAnswers] = useState28({});
|
|
13760
14091
|
const baseId = useId11();
|
|
13761
14092
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
13762
14093
|
const usedOptions = new Set(
|
|
@@ -13772,18 +14103,18 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13772
14103
|
const mockAnswer = mockUserAnswers.find(
|
|
13773
14104
|
(answer) => answer.selectId === selectId
|
|
13774
14105
|
);
|
|
13775
|
-
return /* @__PURE__ */
|
|
14106
|
+
return /* @__PURE__ */ jsx64("p", { className: "inline-flex mb-2.5 text-success-600 font-semibold text-md border-b-2 border-success-600", children: mockAnswer?.correctAnswer });
|
|
13776
14107
|
};
|
|
13777
14108
|
const renderDefaultElement = (selectId, startIndex, selectedValue, availableOptionsForThisSelect) => {
|
|
13778
|
-
return /* @__PURE__ */
|
|
14109
|
+
return /* @__PURE__ */ jsxs49(
|
|
13779
14110
|
Select_default,
|
|
13780
14111
|
{
|
|
13781
14112
|
value: selectedValue,
|
|
13782
14113
|
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
13783
14114
|
className: "inline-flex mb-2.5",
|
|
13784
14115
|
children: [
|
|
13785
|
-
/* @__PURE__ */
|
|
13786
|
-
/* @__PURE__ */
|
|
14116
|
+
/* @__PURE__ */ jsx64(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-background border-gray-300", children: /* @__PURE__ */ jsx64(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
14117
|
+
/* @__PURE__ */ jsx64(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ jsx64(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
13787
14118
|
]
|
|
13788
14119
|
},
|
|
13789
14120
|
`${selectId}-${startIndex}`
|
|
@@ -13795,8 +14126,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13795
14126
|
);
|
|
13796
14127
|
if (!mockAnswer) return null;
|
|
13797
14128
|
const action = mockAnswer.isCorrect ? "success" : "error";
|
|
13798
|
-
const icon = mockAnswer.isCorrect ? /* @__PURE__ */
|
|
13799
|
-
return /* @__PURE__ */
|
|
14129
|
+
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ jsx64(CheckCircle6, {}) : /* @__PURE__ */ jsx64(XCircle5, {});
|
|
14130
|
+
return /* @__PURE__ */ jsx64(
|
|
13800
14131
|
Badge_default,
|
|
13801
14132
|
{
|
|
13802
14133
|
variant: "solid",
|
|
@@ -13804,7 +14135,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13804
14135
|
iconRight: icon,
|
|
13805
14136
|
size: "large",
|
|
13806
14137
|
className: "py-3 w-[180px] justify-between mb-2.5",
|
|
13807
|
-
children: /* @__PURE__ */
|
|
14138
|
+
children: /* @__PURE__ */ jsx64("span", { className: "text-text-900", children: mockAnswer.userAnswer })
|
|
13808
14139
|
},
|
|
13809
14140
|
selectId
|
|
13810
14141
|
);
|
|
@@ -13860,25 +14191,25 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13860
14191
|
}
|
|
13861
14192
|
return elements;
|
|
13862
14193
|
};
|
|
13863
|
-
return /* @__PURE__ */
|
|
13864
|
-
/* @__PURE__ */
|
|
13865
|
-
/* @__PURE__ */
|
|
14194
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
14195
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
14196
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ jsx64("div", { className: "space-y-6 px-4 h-auto", children: /* @__PURE__ */ jsx64(
|
|
13866
14197
|
"div",
|
|
13867
14198
|
{
|
|
13868
14199
|
className: cn(
|
|
13869
14200
|
"text-lg text-text-900 leading-8 h-auto",
|
|
13870
14201
|
variant != "result" && paddingBottom
|
|
13871
14202
|
),
|
|
13872
|
-
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */
|
|
14203
|
+
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ jsx64("span", { children: element.element }, element.id))
|
|
13873
14204
|
}
|
|
13874
14205
|
) }) }),
|
|
13875
|
-
variant === "result" && /* @__PURE__ */
|
|
13876
|
-
/* @__PURE__ */
|
|
13877
|
-
/* @__PURE__ */
|
|
14206
|
+
variant === "result" && /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
14207
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Resultado" }),
|
|
14208
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ jsx64("div", { className: "space-y-6 px-4", children: /* @__PURE__ */ jsx64(
|
|
13878
14209
|
"div",
|
|
13879
14210
|
{
|
|
13880
14211
|
className: cn("text-lg text-text-900 leading-8", paddingBottom),
|
|
13881
|
-
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */
|
|
14212
|
+
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ jsx64("span", { children: element.element }, element.id))
|
|
13882
14213
|
}
|
|
13883
14214
|
) }) })
|
|
13884
14215
|
] })
|
|
@@ -13896,7 +14227,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13896
14227
|
};
|
|
13897
14228
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
13898
14229
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
13899
|
-
const [clickPositionRelative, setClickPositionRelative] =
|
|
14230
|
+
const [clickPositionRelative, setClickPositionRelative] = useState28(variant == "result" ? mockUserAnswerRelative : null);
|
|
13900
14231
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
13901
14232
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
13902
14233
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -13932,36 +14263,36 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13932
14263
|
}
|
|
13933
14264
|
return "bg-success-600/70 border-white";
|
|
13934
14265
|
};
|
|
13935
|
-
return /* @__PURE__ */
|
|
13936
|
-
/* @__PURE__ */
|
|
13937
|
-
/* @__PURE__ */
|
|
14266
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
14267
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Clique na \xE1rea correta" }),
|
|
14268
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsxs49(
|
|
13938
14269
|
"div",
|
|
13939
14270
|
{
|
|
13940
14271
|
"data-testid": "quiz-image-container",
|
|
13941
14272
|
className: "space-y-6 p-3 relative inline-block",
|
|
13942
14273
|
children: [
|
|
13943
|
-
variant == "result" && /* @__PURE__ */
|
|
14274
|
+
variant == "result" && /* @__PURE__ */ jsxs49(
|
|
13944
14275
|
"div",
|
|
13945
14276
|
{
|
|
13946
14277
|
"data-testid": "quiz-legend",
|
|
13947
14278
|
className: "flex items-center gap-4 text-xs",
|
|
13948
14279
|
children: [
|
|
13949
|
-
/* @__PURE__ */
|
|
13950
|
-
/* @__PURE__ */
|
|
13951
|
-
/* @__PURE__ */
|
|
14280
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-2", children: [
|
|
14281
|
+
/* @__PURE__ */ jsx64("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
14282
|
+
/* @__PURE__ */ jsx64("span", { className: "text-text-600 font-medium text-sm", children: "\xC1rea correta" })
|
|
13952
14283
|
] }),
|
|
13953
|
-
/* @__PURE__ */
|
|
13954
|
-
/* @__PURE__ */
|
|
13955
|
-
/* @__PURE__ */
|
|
14284
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-2", children: [
|
|
14285
|
+
/* @__PURE__ */ jsx64("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
14286
|
+
/* @__PURE__ */ jsx64("span", { className: "text-text-600 font-medium text-sm", children: "Resposta correta" })
|
|
13956
14287
|
] }),
|
|
13957
|
-
/* @__PURE__ */
|
|
13958
|
-
/* @__PURE__ */
|
|
13959
|
-
/* @__PURE__ */
|
|
14288
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-2", children: [
|
|
14289
|
+
/* @__PURE__ */ jsx64("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
14290
|
+
/* @__PURE__ */ jsx64("span", { className: "text-text-600 font-medium text-sm", children: "Resposta incorreta" })
|
|
13960
14291
|
] })
|
|
13961
14292
|
]
|
|
13962
14293
|
}
|
|
13963
14294
|
),
|
|
13964
|
-
/* @__PURE__ */
|
|
14295
|
+
/* @__PURE__ */ jsxs49(
|
|
13965
14296
|
"button",
|
|
13966
14297
|
{
|
|
13967
14298
|
"data-testid": "quiz-image-button",
|
|
@@ -13976,7 +14307,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13976
14307
|
},
|
|
13977
14308
|
"aria-label": "\xC1rea da imagem interativa",
|
|
13978
14309
|
children: [
|
|
13979
|
-
/* @__PURE__ */
|
|
14310
|
+
/* @__PURE__ */ jsx64(
|
|
13980
14311
|
"img",
|
|
13981
14312
|
{
|
|
13982
14313
|
"data-testid": "quiz-image",
|
|
@@ -13985,7 +14316,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13985
14316
|
className: "w-full h-auto rounded-md"
|
|
13986
14317
|
}
|
|
13987
14318
|
),
|
|
13988
|
-
variant === "result" && /* @__PURE__ */
|
|
14319
|
+
variant === "result" && /* @__PURE__ */ jsx64(
|
|
13989
14320
|
"div",
|
|
13990
14321
|
{
|
|
13991
14322
|
"data-testid": "quiz-correct-circle",
|
|
@@ -14000,7 +14331,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14000
14331
|
}
|
|
14001
14332
|
}
|
|
14002
14333
|
),
|
|
14003
|
-
clickPositionRelative && /* @__PURE__ */
|
|
14334
|
+
clickPositionRelative && /* @__PURE__ */ jsx64(
|
|
14004
14335
|
"div",
|
|
14005
14336
|
{
|
|
14006
14337
|
"data-testid": "quiz-user-circle",
|
|
@@ -14025,7 +14356,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14025
14356
|
};
|
|
14026
14357
|
|
|
14027
14358
|
// src/components/Quiz/Quiz.tsx
|
|
14028
|
-
import { Fragment as
|
|
14359
|
+
import { Fragment as Fragment14, jsx as jsx65, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
14029
14360
|
var getQuizTypeConfig = (type) => {
|
|
14030
14361
|
const QUIZ_TYPE_CONFIG = {
|
|
14031
14362
|
["SIMULADO" /* SIMULADO */]: {
|
|
@@ -14064,10 +14395,10 @@ var getFinishConfirmationText = (type) => {
|
|
|
14064
14395
|
};
|
|
14065
14396
|
var Quiz = forwardRef22(({ children, className, variant = "default", ...props }, ref) => {
|
|
14066
14397
|
const { setVariant } = useQuizStore();
|
|
14067
|
-
|
|
14398
|
+
useEffect29(() => {
|
|
14068
14399
|
setVariant(variant);
|
|
14069
14400
|
}, [variant, setVariant]);
|
|
14070
|
-
return /* @__PURE__ */
|
|
14401
|
+
return /* @__PURE__ */ jsx65("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
14071
14402
|
});
|
|
14072
14403
|
var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
14073
14404
|
const {
|
|
@@ -14079,7 +14410,7 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
|
14079
14410
|
formatTime: formatTime2,
|
|
14080
14411
|
isStarted
|
|
14081
14412
|
} = useQuizStore();
|
|
14082
|
-
const [showExitConfirmation, setShowExitConfirmation] =
|
|
14413
|
+
const [showExitConfirmation, setShowExitConfirmation] = useState29(false);
|
|
14083
14414
|
const totalQuestions = getTotalQuestions();
|
|
14084
14415
|
const quizTitle = getQuizTitle();
|
|
14085
14416
|
const handleBackClick = () => {
|
|
@@ -14103,8 +14434,8 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
|
14103
14434
|
const handleCancelExit = () => {
|
|
14104
14435
|
setShowExitConfirmation(false);
|
|
14105
14436
|
};
|
|
14106
|
-
return /* @__PURE__ */
|
|
14107
|
-
/* @__PURE__ */
|
|
14437
|
+
return /* @__PURE__ */ jsxs50(Fragment14, { children: [
|
|
14438
|
+
/* @__PURE__ */ jsxs50(
|
|
14108
14439
|
"div",
|
|
14109
14440
|
{
|
|
14110
14441
|
ref,
|
|
@@ -14114,24 +14445,24 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
|
14114
14445
|
),
|
|
14115
14446
|
...props,
|
|
14116
14447
|
children: [
|
|
14117
|
-
/* @__PURE__ */
|
|
14448
|
+
/* @__PURE__ */ jsx65(
|
|
14118
14449
|
IconButton_default,
|
|
14119
14450
|
{
|
|
14120
|
-
icon: /* @__PURE__ */
|
|
14451
|
+
icon: /* @__PURE__ */ jsx65(CaretLeft5, { size: 24 }),
|
|
14121
14452
|
size: "md",
|
|
14122
14453
|
"aria-label": "Voltar",
|
|
14123
14454
|
onClick: handleBackClick
|
|
14124
14455
|
}
|
|
14125
14456
|
),
|
|
14126
|
-
/* @__PURE__ */
|
|
14127
|
-
/* @__PURE__ */
|
|
14128
|
-
/* @__PURE__ */
|
|
14457
|
+
/* @__PURE__ */ jsxs50("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
14458
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
14459
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
14129
14460
|
] }),
|
|
14130
|
-
/* @__PURE__ */
|
|
14461
|
+
/* @__PURE__ */ jsx65("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ jsx65(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx65(Clock2, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
14131
14462
|
]
|
|
14132
14463
|
}
|
|
14133
14464
|
),
|
|
14134
|
-
/* @__PURE__ */
|
|
14465
|
+
/* @__PURE__ */ jsx65(
|
|
14135
14466
|
AlertDialog,
|
|
14136
14467
|
{
|
|
14137
14468
|
isOpen: showExitConfirmation,
|
|
@@ -14151,7 +14482,7 @@ var QuizHeader = () => {
|
|
|
14151
14482
|
const currentQuestion = getCurrentQuestion();
|
|
14152
14483
|
let currentId = currentQuestion && "questionId" in currentQuestion ? currentQuestion.questionId : currentQuestion?.id;
|
|
14153
14484
|
const questionIndex = getQuestionIndex(currentId);
|
|
14154
|
-
return /* @__PURE__ */
|
|
14485
|
+
return /* @__PURE__ */ jsx65(
|
|
14155
14486
|
HeaderAlternative,
|
|
14156
14487
|
{
|
|
14157
14488
|
title: currentQuestion ? `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}` : "Quest\xE3o",
|
|
@@ -14173,7 +14504,7 @@ var QuizContent = ({ paddingBottom }) => {
|
|
|
14173
14504
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
14174
14505
|
};
|
|
14175
14506
|
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
14176
|
-
return QuestionComponent ? /* @__PURE__ */
|
|
14507
|
+
return QuestionComponent ? /* @__PURE__ */ jsx65(QuestionComponent, { paddingBottom }) : null;
|
|
14177
14508
|
};
|
|
14178
14509
|
var QuizQuestionList = ({
|
|
14179
14510
|
filterType = "all",
|
|
@@ -14220,18 +14551,18 @@ var QuizQuestionList = ({
|
|
|
14220
14551
|
return "Em branco";
|
|
14221
14552
|
}
|
|
14222
14553
|
};
|
|
14223
|
-
return /* @__PURE__ */
|
|
14224
|
-
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */
|
|
14554
|
+
return /* @__PURE__ */ jsxs50("div", { className: "space-y-6 px-4 h-full", children: [
|
|
14555
|
+
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ jsx65("div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: /* @__PURE__ */ jsx65("p", { className: "text-lg", children: "Nenhum resultado" }) }),
|
|
14225
14556
|
Object.entries(filteredGroupedQuestions).map(
|
|
14226
|
-
([subjectId, questions]) => /* @__PURE__ */
|
|
14227
|
-
/* @__PURE__ */
|
|
14228
|
-
/* @__PURE__ */
|
|
14229
|
-
/* @__PURE__ */
|
|
14557
|
+
([subjectId, questions]) => /* @__PURE__ */ jsxs50("section", { className: "flex flex-col gap-2", children: [
|
|
14558
|
+
/* @__PURE__ */ jsxs50("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
14559
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ jsx65(BookOpen, { size: 17, className: "text-white" }) }),
|
|
14560
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
|
|
14230
14561
|
] }),
|
|
14231
|
-
/* @__PURE__ */
|
|
14562
|
+
/* @__PURE__ */ jsx65("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
14232
14563
|
const status = getQuestionStatus(question.id);
|
|
14233
14564
|
const questionNumber = getQuestionIndex(question.id);
|
|
14234
|
-
return /* @__PURE__ */
|
|
14565
|
+
return /* @__PURE__ */ jsx65(
|
|
14235
14566
|
CardStatus,
|
|
14236
14567
|
{
|
|
14237
14568
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -14282,8 +14613,8 @@ var QuizFooter = forwardRef22(
|
|
|
14282
14613
|
const currentAnswer = getCurrentAnswer();
|
|
14283
14614
|
const currentQuestion = getCurrentQuestion();
|
|
14284
14615
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
14285
|
-
const [activeModal, setActiveModal] =
|
|
14286
|
-
const [filterType, setFilterType] =
|
|
14616
|
+
const [activeModal, setActiveModal] = useState29(null);
|
|
14617
|
+
const [filterType, setFilterType] = useState29("all");
|
|
14287
14618
|
const openModal = (modalName) => setActiveModal(modalName);
|
|
14288
14619
|
const closeModal = () => setActiveModal(null);
|
|
14289
14620
|
const isModalOpen = (modalName) => activeModal === modalName;
|
|
@@ -14338,8 +14669,8 @@ var QuizFooter = forwardRef22(
|
|
|
14338
14669
|
return;
|
|
14339
14670
|
}
|
|
14340
14671
|
};
|
|
14341
|
-
return /* @__PURE__ */
|
|
14342
|
-
/* @__PURE__ */
|
|
14672
|
+
return /* @__PURE__ */ jsxs50(Fragment14, { children: [
|
|
14673
|
+
/* @__PURE__ */ jsx65(
|
|
14343
14674
|
"footer",
|
|
14344
14675
|
{
|
|
14345
14676
|
ref,
|
|
@@ -14348,17 +14679,17 @@ var QuizFooter = forwardRef22(
|
|
|
14348
14679
|
className
|
|
14349
14680
|
),
|
|
14350
14681
|
...props,
|
|
14351
|
-
children: variant === "default" ? /* @__PURE__ */
|
|
14352
|
-
/* @__PURE__ */
|
|
14353
|
-
/* @__PURE__ */
|
|
14682
|
+
children: variant === "default" ? /* @__PURE__ */ jsxs50(Fragment14, { children: [
|
|
14683
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-row items-center gap-1", children: [
|
|
14684
|
+
/* @__PURE__ */ jsx65(
|
|
14354
14685
|
IconButton_default,
|
|
14355
14686
|
{
|
|
14356
|
-
icon: /* @__PURE__ */
|
|
14687
|
+
icon: /* @__PURE__ */ jsx65(SquaresFour, { size: 24, className: "text-text-950" }),
|
|
14357
14688
|
size: "md",
|
|
14358
14689
|
onClick: () => openModal("modalNavigate")
|
|
14359
14690
|
}
|
|
14360
14691
|
),
|
|
14361
|
-
isFirstQuestion ? /* @__PURE__ */
|
|
14692
|
+
isFirstQuestion ? /* @__PURE__ */ jsx65(
|
|
14362
14693
|
Button_default,
|
|
14363
14694
|
{
|
|
14364
14695
|
variant: "outline",
|
|
@@ -14369,13 +14700,13 @@ var QuizFooter = forwardRef22(
|
|
|
14369
14700
|
},
|
|
14370
14701
|
children: "Pular"
|
|
14371
14702
|
}
|
|
14372
|
-
) : /* @__PURE__ */
|
|
14703
|
+
) : /* @__PURE__ */ jsx65(
|
|
14373
14704
|
Button_default,
|
|
14374
14705
|
{
|
|
14375
14706
|
size: "medium",
|
|
14376
14707
|
variant: "link",
|
|
14377
14708
|
action: "primary",
|
|
14378
|
-
iconLeft: /* @__PURE__ */
|
|
14709
|
+
iconLeft: /* @__PURE__ */ jsx65(CaretLeft5, { size: 18 }),
|
|
14379
14710
|
onClick: () => {
|
|
14380
14711
|
goToPreviousQuestion();
|
|
14381
14712
|
},
|
|
@@ -14383,7 +14714,7 @@ var QuizFooter = forwardRef22(
|
|
|
14383
14714
|
}
|
|
14384
14715
|
)
|
|
14385
14716
|
] }),
|
|
14386
|
-
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */
|
|
14717
|
+
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ jsx65(
|
|
14387
14718
|
Button_default,
|
|
14388
14719
|
{
|
|
14389
14720
|
size: "small",
|
|
@@ -14396,7 +14727,7 @@ var QuizFooter = forwardRef22(
|
|
|
14396
14727
|
children: "Pular"
|
|
14397
14728
|
}
|
|
14398
14729
|
),
|
|
14399
|
-
isLastQuestion ? /* @__PURE__ */
|
|
14730
|
+
isLastQuestion ? /* @__PURE__ */ jsx65(
|
|
14400
14731
|
Button_default,
|
|
14401
14732
|
{
|
|
14402
14733
|
size: "medium",
|
|
@@ -14405,13 +14736,13 @@ var QuizFooter = forwardRef22(
|
|
|
14405
14736
|
onClick: handleFinishQuiz,
|
|
14406
14737
|
children: "Finalizar"
|
|
14407
14738
|
}
|
|
14408
|
-
) : /* @__PURE__ */
|
|
14739
|
+
) : /* @__PURE__ */ jsx65(
|
|
14409
14740
|
Button_default,
|
|
14410
14741
|
{
|
|
14411
14742
|
size: "medium",
|
|
14412
14743
|
variant: "link",
|
|
14413
14744
|
action: "primary",
|
|
14414
|
-
iconRight: /* @__PURE__ */
|
|
14745
|
+
iconRight: /* @__PURE__ */ jsx65(CaretRight8, { size: 18 }),
|
|
14415
14746
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
14416
14747
|
onClick: () => {
|
|
14417
14748
|
goToNextQuestion();
|
|
@@ -14419,7 +14750,7 @@ var QuizFooter = forwardRef22(
|
|
|
14419
14750
|
children: "Avan\xE7ar"
|
|
14420
14751
|
}
|
|
14421
14752
|
)
|
|
14422
|
-
] }) : /* @__PURE__ */
|
|
14753
|
+
] }) : /* @__PURE__ */ jsx65("div", { className: "flex flex-row items-center justify-center w-full", children: /* @__PURE__ */ jsx65(
|
|
14423
14754
|
Button_default,
|
|
14424
14755
|
{
|
|
14425
14756
|
variant: "link",
|
|
@@ -14431,7 +14762,7 @@ var QuizFooter = forwardRef22(
|
|
|
14431
14762
|
) })
|
|
14432
14763
|
}
|
|
14433
14764
|
),
|
|
14434
|
-
/* @__PURE__ */
|
|
14765
|
+
/* @__PURE__ */ jsx65(
|
|
14435
14766
|
AlertDialog,
|
|
14436
14767
|
{
|
|
14437
14768
|
isOpen: isModalOpen("alertDialog"),
|
|
@@ -14443,7 +14774,7 @@ var QuizFooter = forwardRef22(
|
|
|
14443
14774
|
onSubmit: handleAlertSubmit
|
|
14444
14775
|
}
|
|
14445
14776
|
),
|
|
14446
|
-
/* @__PURE__ */
|
|
14777
|
+
/* @__PURE__ */ jsx65(
|
|
14447
14778
|
Modal_default,
|
|
14448
14779
|
{
|
|
14449
14780
|
isOpen: isModalOpen("modalResult"),
|
|
@@ -14452,11 +14783,11 @@ var QuizFooter = forwardRef22(
|
|
|
14452
14783
|
closeOnEscape: false,
|
|
14453
14784
|
hideCloseButton: true,
|
|
14454
14785
|
size: "md",
|
|
14455
|
-
children: /* @__PURE__ */
|
|
14456
|
-
resultImageComponent ? /* @__PURE__ */
|
|
14457
|
-
/* @__PURE__ */
|
|
14458
|
-
/* @__PURE__ */
|
|
14459
|
-
/* @__PURE__ */
|
|
14786
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14787
|
+
resultImageComponent ? /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx65("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14788
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14789
|
+
/* @__PURE__ */ jsx65("h2", { className: "text-text-950 font-bold text-lg", children: getCompletionTitle(quizType) }),
|
|
14790
|
+
/* @__PURE__ */ jsxs50("p", { className: "text-text-500 font-sm", children: [
|
|
14460
14791
|
"Voc\xEA acertou ",
|
|
14461
14792
|
correctAnswers ?? "--",
|
|
14462
14793
|
" de ",
|
|
@@ -14465,8 +14796,8 @@ var QuizFooter = forwardRef22(
|
|
|
14465
14796
|
"quest\xF5es."
|
|
14466
14797
|
] })
|
|
14467
14798
|
] }),
|
|
14468
|
-
/* @__PURE__ */
|
|
14469
|
-
/* @__PURE__ */
|
|
14799
|
+
/* @__PURE__ */ jsxs50("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
14800
|
+
/* @__PURE__ */ jsx65(
|
|
14470
14801
|
Button_default,
|
|
14471
14802
|
{
|
|
14472
14803
|
variant: "outline",
|
|
@@ -14476,38 +14807,38 @@ var QuizFooter = forwardRef22(
|
|
|
14476
14807
|
children: quizTypeLabel === "Question\xE1rio" ? "Ir para aulas" : `Ir para ${quizTypeLabel.toLocaleLowerCase()}s`
|
|
14477
14808
|
}
|
|
14478
14809
|
),
|
|
14479
|
-
/* @__PURE__ */
|
|
14810
|
+
/* @__PURE__ */ jsx65(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
14480
14811
|
] })
|
|
14481
14812
|
] })
|
|
14482
14813
|
}
|
|
14483
14814
|
),
|
|
14484
|
-
/* @__PURE__ */
|
|
14815
|
+
/* @__PURE__ */ jsx65(
|
|
14485
14816
|
Modal_default,
|
|
14486
14817
|
{
|
|
14487
14818
|
isOpen: isModalOpen("modalNavigate"),
|
|
14488
14819
|
onClose: closeModal,
|
|
14489
14820
|
title: "Quest\xF5es",
|
|
14490
14821
|
size: "lg",
|
|
14491
|
-
children: /* @__PURE__ */
|
|
14492
|
-
/* @__PURE__ */
|
|
14493
|
-
/* @__PURE__ */
|
|
14494
|
-
/* @__PURE__ */
|
|
14495
|
-
/* @__PURE__ */
|
|
14822
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col w-full not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] lg:h-[687px]", children: [
|
|
14823
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200 flex-shrink-0", children: [
|
|
14824
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
14825
|
+
/* @__PURE__ */ jsx65("span", { className: "max-w-[266px]", children: /* @__PURE__ */ jsxs50(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
14826
|
+
/* @__PURE__ */ jsx65(
|
|
14496
14827
|
SelectTrigger,
|
|
14497
14828
|
{
|
|
14498
14829
|
variant: "rounded",
|
|
14499
14830
|
className: "max-w-[266px] min-w-[160px]",
|
|
14500
|
-
children: /* @__PURE__ */
|
|
14831
|
+
children: /* @__PURE__ */ jsx65(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" })
|
|
14501
14832
|
}
|
|
14502
14833
|
),
|
|
14503
|
-
/* @__PURE__ */
|
|
14504
|
-
/* @__PURE__ */
|
|
14505
|
-
/* @__PURE__ */
|
|
14506
|
-
/* @__PURE__ */
|
|
14834
|
+
/* @__PURE__ */ jsxs50(SelectContent, { children: [
|
|
14835
|
+
/* @__PURE__ */ jsx65(SelectItem, { value: "all", children: "Todas" }),
|
|
14836
|
+
/* @__PURE__ */ jsx65(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
14837
|
+
/* @__PURE__ */ jsx65(SelectItem, { value: "answered", children: "Respondidas" })
|
|
14507
14838
|
] })
|
|
14508
14839
|
] }) })
|
|
14509
14840
|
] }),
|
|
14510
|
-
/* @__PURE__ */
|
|
14841
|
+
/* @__PURE__ */ jsx65("div", { className: "flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsx65(
|
|
14511
14842
|
QuizQuestionList,
|
|
14512
14843
|
{
|
|
14513
14844
|
filterType,
|
|
@@ -14517,7 +14848,7 @@ var QuizFooter = forwardRef22(
|
|
|
14517
14848
|
] })
|
|
14518
14849
|
}
|
|
14519
14850
|
),
|
|
14520
|
-
/* @__PURE__ */
|
|
14851
|
+
/* @__PURE__ */ jsx65(
|
|
14521
14852
|
Modal_default,
|
|
14522
14853
|
{
|
|
14523
14854
|
isOpen: isModalOpen("modalResolution"),
|
|
@@ -14527,7 +14858,7 @@ var QuizFooter = forwardRef22(
|
|
|
14527
14858
|
children: currentQuestion?.solutionExplanation
|
|
14528
14859
|
}
|
|
14529
14860
|
),
|
|
14530
|
-
/* @__PURE__ */
|
|
14861
|
+
/* @__PURE__ */ jsx65(
|
|
14531
14862
|
Modal_default,
|
|
14532
14863
|
{
|
|
14533
14864
|
isOpen: isModalOpen("modalQuestionnaireAllCorrect"),
|
|
@@ -14536,17 +14867,17 @@ var QuizFooter = forwardRef22(
|
|
|
14536
14867
|
closeOnEscape: false,
|
|
14537
14868
|
hideCloseButton: true,
|
|
14538
14869
|
size: "md",
|
|
14539
|
-
children: /* @__PURE__ */
|
|
14540
|
-
resultImageComponent ? /* @__PURE__ */
|
|
14541
|
-
/* @__PURE__ */
|
|
14542
|
-
/* @__PURE__ */
|
|
14543
|
-
/* @__PURE__ */
|
|
14870
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14871
|
+
resultImageComponent ? /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx65("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14872
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14873
|
+
/* @__PURE__ */ jsx65("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F389} Parab\xE9ns!" }),
|
|
14874
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-500 font-sm", children: "Voc\xEA concluiu o m\xF3dulo Movimento Uniforme." })
|
|
14544
14875
|
] }),
|
|
14545
|
-
/* @__PURE__ */
|
|
14876
|
+
/* @__PURE__ */ jsx65("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: /* @__PURE__ */ jsx65(Button_default, { className: "w-full", onClick: onGoToNextModule, children: "Pr\xF3ximo m\xF3dulo" }) })
|
|
14546
14877
|
] })
|
|
14547
14878
|
}
|
|
14548
14879
|
),
|
|
14549
|
-
/* @__PURE__ */
|
|
14880
|
+
/* @__PURE__ */ jsx65(
|
|
14550
14881
|
Modal_default,
|
|
14551
14882
|
{
|
|
14552
14883
|
isOpen: isModalOpen("modalQuestionnaireAllIncorrect"),
|
|
@@ -14555,16 +14886,16 @@ var QuizFooter = forwardRef22(
|
|
|
14555
14886
|
closeOnEscape: false,
|
|
14556
14887
|
hideCloseButton: true,
|
|
14557
14888
|
size: "md",
|
|
14558
|
-
children: /* @__PURE__ */
|
|
14559
|
-
resultIncorrectImageComponent ? /* @__PURE__ */
|
|
14560
|
-
/* @__PURE__ */
|
|
14561
|
-
/* @__PURE__ */
|
|
14562
|
-
/* @__PURE__ */
|
|
14563
|
-
/* @__PURE__ */
|
|
14564
|
-
/* @__PURE__ */
|
|
14889
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14890
|
+
resultIncorrectImageComponent ? /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-auto", children: resultIncorrectImageComponent }) : /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx65("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14891
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14892
|
+
/* @__PURE__ */ jsx65("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F615} N\xE3o foi dessa vez..." }),
|
|
14893
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-500 font-sm", children: "Voc\xEA tirou 0 no question\xE1rio, mas n\xE3o se preocupe! Isso \xE9 apenas uma oportunidade de aprendizado." }),
|
|
14894
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-500 font-sm", children: "Que tal tentar novamente para melhorar sua nota? Estamos aqui para te ajudar a entender o conte\xFAdo e evoluir." }),
|
|
14895
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-500 font-sm", children: "Clique em Repetir Question\xE1rio e mostre do que voc\xEA \xE9 capaz! \u{1F4AA}" })
|
|
14565
14896
|
] }),
|
|
14566
|
-
/* @__PURE__ */
|
|
14567
|
-
/* @__PURE__ */
|
|
14897
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-row justify-center items-center gap-2 w-full", children: [
|
|
14898
|
+
/* @__PURE__ */ jsx65(
|
|
14568
14899
|
Button_default,
|
|
14569
14900
|
{
|
|
14570
14901
|
type: "button",
|
|
@@ -14578,7 +14909,7 @@ var QuizFooter = forwardRef22(
|
|
|
14578
14909
|
children: "Tentar depois"
|
|
14579
14910
|
}
|
|
14580
14911
|
),
|
|
14581
|
-
/* @__PURE__ */
|
|
14912
|
+
/* @__PURE__ */ jsx65(
|
|
14582
14913
|
Button_default,
|
|
14583
14914
|
{
|
|
14584
14915
|
variant: "outline",
|
|
@@ -14588,7 +14919,7 @@ var QuizFooter = forwardRef22(
|
|
|
14588
14919
|
children: "Detalhar resultado"
|
|
14589
14920
|
}
|
|
14590
14921
|
),
|
|
14591
|
-
/* @__PURE__ */
|
|
14922
|
+
/* @__PURE__ */ jsx65(
|
|
14592
14923
|
Button_default,
|
|
14593
14924
|
{
|
|
14594
14925
|
className: "w-auto",
|
|
@@ -14601,7 +14932,7 @@ var QuizFooter = forwardRef22(
|
|
|
14601
14932
|
] })
|
|
14602
14933
|
}
|
|
14603
14934
|
),
|
|
14604
|
-
/* @__PURE__ */
|
|
14935
|
+
/* @__PURE__ */ jsx65(
|
|
14605
14936
|
AlertDialog,
|
|
14606
14937
|
{
|
|
14607
14938
|
isOpen: isModalOpen("alertDialogTryLater"),
|
|
@@ -14625,26 +14956,26 @@ var QuizFooter = forwardRef22(
|
|
|
14625
14956
|
);
|
|
14626
14957
|
|
|
14627
14958
|
// src/components/Quiz/QuizResult.tsx
|
|
14628
|
-
import { forwardRef as forwardRef23, useEffect as
|
|
14959
|
+
import { forwardRef as forwardRef23, useEffect as useEffect30, useState as useState30 } from "react";
|
|
14629
14960
|
import { Clock as Clock3 } from "phosphor-react";
|
|
14630
|
-
import { jsx as
|
|
14961
|
+
import { jsx as jsx66, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
14631
14962
|
var QuizBadge = ({
|
|
14632
14963
|
subtype
|
|
14633
14964
|
}) => {
|
|
14634
14965
|
switch (subtype) {
|
|
14635
14966
|
case "PROVA" /* PROVA */:
|
|
14636
|
-
return /* @__PURE__ */
|
|
14967
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "examsOutlined", action: "exam2", "data-testid": "quiz-badge", children: "Prova" });
|
|
14637
14968
|
case "ENEM_PROVA_1" /* ENEM_PROVA_1 */:
|
|
14638
14969
|
case "ENEM_PROVA_2" /* ENEM_PROVA_2 */:
|
|
14639
|
-
return /* @__PURE__ */
|
|
14970
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "examsOutlined", action: "exam1", "data-testid": "quiz-badge", children: "Enem" });
|
|
14640
14971
|
case "VESTIBULAR" /* VESTIBULAR */:
|
|
14641
|
-
return /* @__PURE__ */
|
|
14972
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "examsOutlined", action: "exam4", "data-testid": "quiz-badge", children: "Vestibular" });
|
|
14642
14973
|
case "SIMULADO" /* SIMULADO */:
|
|
14643
14974
|
case "SIMULADAO" /* SIMULADAO */:
|
|
14644
14975
|
case void 0:
|
|
14645
|
-
return /* @__PURE__ */
|
|
14976
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "examsOutlined", action: "exam3", "data-testid": "quiz-badge", children: "Simulad\xE3o" });
|
|
14646
14977
|
default:
|
|
14647
|
-
return /* @__PURE__ */
|
|
14978
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "solid", action: "info", "data-testid": "quiz-badge", children: subtype });
|
|
14648
14979
|
}
|
|
14649
14980
|
};
|
|
14650
14981
|
var QuizHeaderResult = forwardRef23(
|
|
@@ -14654,8 +14985,8 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14654
14985
|
getCurrentQuestion,
|
|
14655
14986
|
questionsResult
|
|
14656
14987
|
} = useQuizStore();
|
|
14657
|
-
const [status, setStatus] =
|
|
14658
|
-
|
|
14988
|
+
const [status, setStatus] = useState30(void 0);
|
|
14989
|
+
useEffect30(() => {
|
|
14659
14990
|
const cq = getCurrentQuestion();
|
|
14660
14991
|
if (!cq) {
|
|
14661
14992
|
setStatus(void 0);
|
|
@@ -14701,7 +15032,7 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14701
15032
|
return "N\xE3o foi dessa vez...voc\xEA deixou a resposta em branco";
|
|
14702
15033
|
}
|
|
14703
15034
|
};
|
|
14704
|
-
return /* @__PURE__ */
|
|
15035
|
+
return /* @__PURE__ */ jsxs51(
|
|
14705
15036
|
"div",
|
|
14706
15037
|
{
|
|
14707
15038
|
ref,
|
|
@@ -14712,8 +15043,8 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14712
15043
|
),
|
|
14713
15044
|
...props,
|
|
14714
15045
|
children: [
|
|
14715
|
-
/* @__PURE__ */
|
|
14716
|
-
/* @__PURE__ */
|
|
15046
|
+
/* @__PURE__ */ jsx66("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
15047
|
+
/* @__PURE__ */ jsx66("p", { className: "text-text-700 text-md", children: getLabelByAnswersStatus() })
|
|
14717
15048
|
]
|
|
14718
15049
|
}
|
|
14719
15050
|
);
|
|
@@ -14721,7 +15052,7 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14721
15052
|
);
|
|
14722
15053
|
var QuizResultHeaderTitle = forwardRef23(({ className, showBadge = true, onRepeat, canRetry, ...props }, ref) => {
|
|
14723
15054
|
const { quiz } = useQuizStore();
|
|
14724
|
-
return /* @__PURE__ */
|
|
15055
|
+
return /* @__PURE__ */ jsxs51(
|
|
14725
15056
|
"div",
|
|
14726
15057
|
{
|
|
14727
15058
|
ref,
|
|
@@ -14731,9 +15062,9 @@ var QuizResultHeaderTitle = forwardRef23(({ className, showBadge = true, onRepea
|
|
|
14731
15062
|
),
|
|
14732
15063
|
...props,
|
|
14733
15064
|
children: [
|
|
14734
|
-
/* @__PURE__ */
|
|
14735
|
-
/* @__PURE__ */
|
|
14736
|
-
canRetry && onRepeat && /* @__PURE__ */
|
|
15065
|
+
/* @__PURE__ */ jsx66("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
15066
|
+
/* @__PURE__ */ jsxs51("div", { className: "flex flex-row gap-3 items-center", children: [
|
|
15067
|
+
canRetry && onRepeat && /* @__PURE__ */ jsx66(
|
|
14737
15068
|
Button_default,
|
|
14738
15069
|
{
|
|
14739
15070
|
variant: "solid",
|
|
@@ -14743,7 +15074,7 @@ var QuizResultHeaderTitle = forwardRef23(({ className, showBadge = true, onRepea
|
|
|
14743
15074
|
children: "Repetir question\xE1rio"
|
|
14744
15075
|
}
|
|
14745
15076
|
),
|
|
14746
|
-
showBadge && /* @__PURE__ */
|
|
15077
|
+
showBadge && /* @__PURE__ */ jsx66(QuizBadge, { subtype: quiz?.subtype || void 0 })
|
|
14747
15078
|
] })
|
|
14748
15079
|
]
|
|
14749
15080
|
}
|
|
@@ -14752,7 +15083,7 @@ var QuizResultHeaderTitle = forwardRef23(({ className, showBadge = true, onRepea
|
|
|
14752
15083
|
var QuizResultTitle = forwardRef23(({ className, ...props }, ref) => {
|
|
14753
15084
|
const { getQuizTitle } = useQuizStore();
|
|
14754
15085
|
const quizTitle = getQuizTitle();
|
|
14755
|
-
return /* @__PURE__ */
|
|
15086
|
+
return /* @__PURE__ */ jsx66(
|
|
14756
15087
|
"p",
|
|
14757
15088
|
{
|
|
14758
15089
|
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
@@ -14813,7 +15144,7 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14813
15144
|
};
|
|
14814
15145
|
const percentage = totalQuestions > 0 ? Math.round(stats.correctAnswers / totalQuestions * 100) : 0;
|
|
14815
15146
|
const classesJustifyBetween = showDetails ? "justify-between" : "justify-center";
|
|
14816
|
-
return /* @__PURE__ */
|
|
15147
|
+
return /* @__PURE__ */ jsxs51(
|
|
14817
15148
|
"div",
|
|
14818
15149
|
{
|
|
14819
15150
|
className: cn(
|
|
@@ -14823,8 +15154,8 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14823
15154
|
ref,
|
|
14824
15155
|
...props,
|
|
14825
15156
|
children: [
|
|
14826
|
-
/* @__PURE__ */
|
|
14827
|
-
/* @__PURE__ */
|
|
15157
|
+
/* @__PURE__ */ jsxs51("div", { className: "relative", children: [
|
|
15158
|
+
/* @__PURE__ */ jsx66(
|
|
14828
15159
|
ProgressCircle_default,
|
|
14829
15160
|
{
|
|
14830
15161
|
size: "medium",
|
|
@@ -14834,24 +15165,24 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14834
15165
|
label: ""
|
|
14835
15166
|
}
|
|
14836
15167
|
),
|
|
14837
|
-
/* @__PURE__ */
|
|
14838
|
-
showDetails && /* @__PURE__ */
|
|
14839
|
-
/* @__PURE__ */
|
|
14840
|
-
/* @__PURE__ */
|
|
15168
|
+
/* @__PURE__ */ jsxs51("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
15169
|
+
showDetails && /* @__PURE__ */ jsxs51("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
15170
|
+
/* @__PURE__ */ jsx66(Clock3, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
15171
|
+
/* @__PURE__ */ jsx66("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(
|
|
14841
15172
|
(getQuestionResultStatistics()?.timeSpent ?? 0) * 60
|
|
14842
15173
|
) })
|
|
14843
15174
|
] }),
|
|
14844
|
-
/* @__PURE__ */
|
|
15175
|
+
/* @__PURE__ */ jsxs51("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
14845
15176
|
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
14846
15177
|
" de",
|
|
14847
15178
|
" ",
|
|
14848
15179
|
totalQuestions
|
|
14849
15180
|
] }),
|
|
14850
|
-
/* @__PURE__ */
|
|
15181
|
+
/* @__PURE__ */ jsx66("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
14851
15182
|
] })
|
|
14852
15183
|
] }),
|
|
14853
|
-
showDetails && /* @__PURE__ */
|
|
14854
|
-
/* @__PURE__ */
|
|
15184
|
+
showDetails && /* @__PURE__ */ jsxs51("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
15185
|
+
/* @__PURE__ */ jsx66(
|
|
14855
15186
|
ProgressBar_default,
|
|
14856
15187
|
{
|
|
14857
15188
|
className: "w-full",
|
|
@@ -14865,7 +15196,7 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14865
15196
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
14866
15197
|
}
|
|
14867
15198
|
),
|
|
14868
|
-
/* @__PURE__ */
|
|
15199
|
+
/* @__PURE__ */ jsx66(
|
|
14869
15200
|
ProgressBar_default,
|
|
14870
15201
|
{
|
|
14871
15202
|
className: "w-full",
|
|
@@ -14879,7 +15210,7 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14879
15210
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
14880
15211
|
}
|
|
14881
15212
|
),
|
|
14882
|
-
/* @__PURE__ */
|
|
15213
|
+
/* @__PURE__ */ jsx66(
|
|
14883
15214
|
ProgressBar_default,
|
|
14884
15215
|
{
|
|
14885
15216
|
className: "w-full",
|
|
@@ -14926,9 +15257,9 @@ var QuizListResult = forwardRef23(({ className, onSubjectClick, ...props }, ref)
|
|
|
14926
15257
|
};
|
|
14927
15258
|
}
|
|
14928
15259
|
);
|
|
14929
|
-
return /* @__PURE__ */
|
|
14930
|
-
/* @__PURE__ */
|
|
14931
|
-
/* @__PURE__ */
|
|
15260
|
+
return /* @__PURE__ */ jsxs51("section", { ref, className, ...props, children: [
|
|
15261
|
+
/* @__PURE__ */ jsx66("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
15262
|
+
/* @__PURE__ */ jsx66("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ jsx66("li", { children: /* @__PURE__ */ jsx66(
|
|
14932
15263
|
CardResults,
|
|
14933
15264
|
{
|
|
14934
15265
|
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
@@ -14952,16 +15283,16 @@ var QuizListResultByMateria = ({
|
|
|
14952
15283
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
14953
15284
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
14954
15285
|
const formattedQuestions = subject == "all" ? Object.values(groupedQuestions).flat() : answeredQuestions;
|
|
14955
|
-
return /* @__PURE__ */
|
|
14956
|
-
/* @__PURE__ */
|
|
14957
|
-
/* @__PURE__ */
|
|
14958
|
-
/* @__PURE__ */
|
|
14959
|
-
/* @__PURE__ */
|
|
15286
|
+
return /* @__PURE__ */ jsxs51("div", { className: "flex flex-col", children: [
|
|
15287
|
+
/* @__PURE__ */ jsx66("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ jsx66("p", { className: "text-text-950 font-bold text-2xl", children: subjectName || formattedQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name || "Sem mat\xE9ria" }) }),
|
|
15288
|
+
/* @__PURE__ */ jsxs51("section", { className: "flex flex-col ", children: [
|
|
15289
|
+
/* @__PURE__ */ jsx66("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
15290
|
+
/* @__PURE__ */ jsx66("ul", { className: "flex flex-col gap-2 pt-4", children: formattedQuestions.map((question) => {
|
|
14960
15291
|
const questionIndex = getQuestionIndex(
|
|
14961
15292
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14962
15293
|
question.questionId ?? question.id
|
|
14963
15294
|
);
|
|
14964
|
-
return /* @__PURE__ */
|
|
15295
|
+
return /* @__PURE__ */ jsx66("li", { children: /* @__PURE__ */ jsx66(
|
|
14965
15296
|
CardStatus,
|
|
14966
15297
|
{
|
|
14967
15298
|
className: "max-w-full",
|
|
@@ -14987,7 +15318,7 @@ var QuizListResultByMateria = ({
|
|
|
14987
15318
|
|
|
14988
15319
|
// src/components/BreadcrumbMenu/BreadcrumbMenu.tsx
|
|
14989
15320
|
import { useNavigate } from "react-router-dom";
|
|
14990
|
-
import { jsx as
|
|
15321
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
14991
15322
|
var BreadcrumbMenu = ({
|
|
14992
15323
|
breadcrumbs,
|
|
14993
15324
|
onBreadcrumbClick,
|
|
@@ -15000,17 +15331,17 @@ var BreadcrumbMenu = ({
|
|
|
15000
15331
|
}
|
|
15001
15332
|
navigate(breadcrumb.url);
|
|
15002
15333
|
};
|
|
15003
|
-
return /* @__PURE__ */
|
|
15334
|
+
return /* @__PURE__ */ jsx67(
|
|
15004
15335
|
Menu,
|
|
15005
15336
|
{
|
|
15006
15337
|
value: `breadcrumb-${breadcrumbs.length - 1}`,
|
|
15007
15338
|
defaultValue: "breadcrumb-0",
|
|
15008
15339
|
variant: "breadcrumb",
|
|
15009
15340
|
className,
|
|
15010
|
-
children: /* @__PURE__ */
|
|
15341
|
+
children: /* @__PURE__ */ jsx67(MenuContent, { className: "w-full flex flex-row flex-wrap gap-2 !px-0", children: breadcrumbs.map((breadcrumb, index) => {
|
|
15011
15342
|
const isLast = index === breadcrumbs.length - 1;
|
|
15012
15343
|
const hasSeparator = !isLast;
|
|
15013
|
-
return /* @__PURE__ */
|
|
15344
|
+
return /* @__PURE__ */ jsx67(
|
|
15014
15345
|
MenuItem,
|
|
15015
15346
|
{
|
|
15016
15347
|
variant: "breadcrumb",
|
|
@@ -15028,7 +15359,7 @@ var BreadcrumbMenu = ({
|
|
|
15028
15359
|
};
|
|
15029
15360
|
|
|
15030
15361
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
15031
|
-
import { useEffect as
|
|
15362
|
+
import { useEffect as useEffect31 } from "react";
|
|
15032
15363
|
|
|
15033
15364
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
15034
15365
|
import { create as create12 } from "zustand";
|
|
@@ -15157,7 +15488,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15157
15488
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
15158
15489
|
);
|
|
15159
15490
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
15160
|
-
|
|
15491
|
+
useEffect31(() => {
|
|
15161
15492
|
const newBreadcrumbs = [root];
|
|
15162
15493
|
const previousIds = [];
|
|
15163
15494
|
for (const level of levels) {
|
|
@@ -15189,11 +15520,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15189
15520
|
};
|
|
15190
15521
|
|
|
15191
15522
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
15192
|
-
import { useMemo as
|
|
15523
|
+
import { useMemo as useMemo14 } from "react";
|
|
15193
15524
|
import { useLocation as useLocation3 } from "react-router-dom";
|
|
15194
15525
|
var useUrlParams = (config) => {
|
|
15195
15526
|
const location = useLocation3();
|
|
15196
|
-
return
|
|
15527
|
+
return useMemo14(() => {
|
|
15197
15528
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
15198
15529
|
const params = {};
|
|
15199
15530
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -15204,15 +15535,15 @@ var useUrlParams = (config) => {
|
|
|
15204
15535
|
};
|
|
15205
15536
|
|
|
15206
15537
|
// src/hooks/useAppInitialization.ts
|
|
15207
|
-
import { useMemo as
|
|
15538
|
+
import { useMemo as useMemo15 } from "react";
|
|
15208
15539
|
|
|
15209
15540
|
// src/hooks/useInstitution.ts
|
|
15210
|
-
import { useEffect as
|
|
15541
|
+
import { useEffect as useEffect32, useState as useState31 } from "react";
|
|
15211
15542
|
function useInstitutionId() {
|
|
15212
|
-
const [institutionId, setInstitutionId] =
|
|
15543
|
+
const [institutionId, setInstitutionId] = useState31(() => {
|
|
15213
15544
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
15214
15545
|
});
|
|
15215
|
-
|
|
15546
|
+
useEffect32(() => {
|
|
15216
15547
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
15217
15548
|
if (!metaTag) return;
|
|
15218
15549
|
const observer = new MutationObserver(() => {
|
|
@@ -15379,7 +15710,7 @@ var useAuthStore = create14()(
|
|
|
15379
15710
|
function useAppInitialization() {
|
|
15380
15711
|
const getInstitutionId = useInstitutionId();
|
|
15381
15712
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
15382
|
-
const authFunctions =
|
|
15713
|
+
const authFunctions = useMemo15(
|
|
15383
15714
|
() => ({
|
|
15384
15715
|
checkAuth: async () => {
|
|
15385
15716
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -15416,7 +15747,7 @@ function useAppInitialization() {
|
|
|
15416
15747
|
}
|
|
15417
15748
|
|
|
15418
15749
|
// src/hooks/useAppContent.ts
|
|
15419
|
-
import { useCallback as
|
|
15750
|
+
import { useCallback as useCallback10, useEffect as useEffect33, useMemo as useMemo16 } from "react";
|
|
15420
15751
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
15421
15752
|
function useAppContent(config) {
|
|
15422
15753
|
const navigate = useNavigate2();
|
|
@@ -15442,20 +15773,20 @@ function useAppContent(config) {
|
|
|
15442
15773
|
navigate("/painel");
|
|
15443
15774
|
}
|
|
15444
15775
|
};
|
|
15445
|
-
const handleSetSelectedProfile =
|
|
15776
|
+
const handleSetSelectedProfile = useCallback10(
|
|
15446
15777
|
(profile) => {
|
|
15447
15778
|
setSelectedProfile(profile);
|
|
15448
15779
|
},
|
|
15449
15780
|
[setSelectedProfile]
|
|
15450
15781
|
);
|
|
15451
|
-
const handleClearParamsFromURL =
|
|
15782
|
+
const handleClearParamsFromURL = useCallback10(() => {
|
|
15452
15783
|
if (onClearParamsFromURL) {
|
|
15453
15784
|
onClearParamsFromURL();
|
|
15454
15785
|
} else {
|
|
15455
15786
|
globalThis.location.replace("/painel");
|
|
15456
15787
|
}
|
|
15457
15788
|
}, [onClearParamsFromURL]);
|
|
15458
|
-
const handleError =
|
|
15789
|
+
const handleError = useCallback10(
|
|
15459
15790
|
(error) => {
|
|
15460
15791
|
if (onError) {
|
|
15461
15792
|
onError(error);
|
|
@@ -15466,7 +15797,7 @@ function useAppContent(config) {
|
|
|
15466
15797
|
},
|
|
15467
15798
|
[navigate, onError]
|
|
15468
15799
|
);
|
|
15469
|
-
const urlAuthConfig =
|
|
15800
|
+
const urlAuthConfig = useMemo16(
|
|
15470
15801
|
() => ({
|
|
15471
15802
|
setTokens,
|
|
15472
15803
|
setSessionInfo,
|
|
@@ -15492,10 +15823,10 @@ function useAppContent(config) {
|
|
|
15492
15823
|
);
|
|
15493
15824
|
useUrlAuthentication(urlAuthConfig);
|
|
15494
15825
|
const { sessionInfo } = useAuth();
|
|
15495
|
-
const institutionIdToUse =
|
|
15826
|
+
const institutionIdToUse = useMemo16(() => {
|
|
15496
15827
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
15497
15828
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
15498
|
-
|
|
15829
|
+
useEffect33(() => {
|
|
15499
15830
|
if (institutionIdToUse && !initialized) {
|
|
15500
15831
|
initialize(institutionIdToUse);
|
|
15501
15832
|
}
|
|
@@ -15564,6 +15895,7 @@ export {
|
|
|
15564
15895
|
NotificationEntityType,
|
|
15565
15896
|
ProfileMenuFooter,
|
|
15566
15897
|
ProfileMenuHeader,
|
|
15898
|
+
ProfileMenuInfo,
|
|
15567
15899
|
ProfileMenuSection,
|
|
15568
15900
|
ProfileMenuTrigger,
|
|
15569
15901
|
ProfileToggleTheme,
|
|
@@ -15624,6 +15956,7 @@ export {
|
|
|
15624
15956
|
TableHead,
|
|
15625
15957
|
TableHeader,
|
|
15626
15958
|
TablePagination_default as TablePagination,
|
|
15959
|
+
TableProvider_default as TableProvider,
|
|
15627
15960
|
TableRow,
|
|
15628
15961
|
Text_default as Text,
|
|
15629
15962
|
TextArea_default as TextArea,
|