analytica-frontend-lib 1.2.50 → 1.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/ActivityCardQuestionBanks/index.css +12 -0
  2. package/dist/ActivityCardQuestionBanks/index.css.map +1 -1
  3. package/dist/ActivityCardQuestionPreview/index.css +12 -0
  4. package/dist/ActivityCardQuestionPreview/index.css.map +1 -1
  5. package/dist/ActivityDetails/index.css +12 -0
  6. package/dist/ActivityDetails/index.css.map +1 -1
  7. package/dist/ActivityFilters/index.css +12 -0
  8. package/dist/ActivityFilters/index.css.map +1 -1
  9. package/dist/ActivityPreview/index.css +12 -0
  10. package/dist/ActivityPreview/index.css.map +1 -1
  11. package/dist/AlertManager/index.css +12 -0
  12. package/dist/AlertManager/index.css.map +1 -1
  13. package/dist/RecommendedLessonDetails/index.d.ts +2 -1
  14. package/dist/RecommendedLessonDetails/index.d.ts.map +1 -1
  15. package/dist/RecommendedLessonDetails/index.js +2632 -28
  16. package/dist/RecommendedLessonDetails/index.js.map +1 -1
  17. package/dist/RecommendedLessonDetails/index.mjs +2668 -38
  18. package/dist/RecommendedLessonDetails/index.mjs.map +1 -1
  19. package/dist/RecommendedLessonsHistory/index.css +12 -0
  20. package/dist/RecommendedLessonsHistory/index.css.map +1 -1
  21. package/dist/SendActivityModal/SendActivityModal.css +12 -0
  22. package/dist/SendActivityModal/SendActivityModal.css.map +1 -1
  23. package/dist/SendActivityModal/index.css +12 -0
  24. package/dist/SendActivityModal/index.css.map +1 -1
  25. package/dist/TableProvider/index.css +12 -0
  26. package/dist/TableProvider/index.css.map +1 -1
  27. package/dist/index.css +12 -0
  28. package/dist/index.css.map +1 -1
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +300 -18
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +301 -14
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/styles.css +12 -0
  36. package/dist/styles.css.map +1 -1
  37. package/package.json +1 -1
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,17 +17,26 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/components/RecommendedLessonDetails/index.ts
21
31
  var RecommendedLessonDetails_exports = {};
22
32
  __export(RecommendedLessonDetails_exports, {
23
- RecommendedLessonDetails: () => RecommendedLessonDetails_default
33
+ RecommendedLessonDetails: () => RecommendedLessonDetails_default,
34
+ StudentPerformanceModal: () => StudentPerformanceModal
24
35
  });
25
36
  module.exports = __toCommonJS(RecommendedLessonDetails_exports);
26
37
 
27
38
  // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
28
- var import_react8 = require("react");
39
+ var import_react16 = require("react");
29
40
 
30
41
  // src/utils/utils.ts
31
42
  var import_clsx = require("clsx");
@@ -2140,22 +2151,2614 @@ var StudentsTable = ({
2140
2151
  ] }) });
2141
2152
  };
2142
2153
 
2143
- // src/components/RecommendedLessonDetails/types.ts
2144
- var DEFAULT_LABELS = {
2145
- viewLesson: "Ver aula",
2146
- viewPerformance: "Ver desempenho",
2147
- resultsTitle: "Resultados da aula recomendada",
2148
- completedLabel: "CONCLU\xCDDO",
2149
- bestResultLabel: "MELHOR RESULTADO",
2150
- hardestTopicLabel: "MAIOR DIFICULDADE",
2151
- studentColumn: "Aluno",
2152
- statusColumn: "Status",
2153
- completionColumn: "Conclus\xE3o",
2154
- durationColumn: "Dura\xE7\xE3o"
2154
+ // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
2155
+ var import_react14 = require("react");
2156
+ var import_react15 = require("@phosphor-icons/react");
2157
+
2158
+ // src/components/Modal/Modal.tsx
2159
+ var import_react8 = require("react");
2160
+ var import_phosphor_react4 = require("phosphor-react");
2161
+
2162
+ // src/components/Modal/utils/videoUtils.ts
2163
+ var isYouTubeUrl = (url) => {
2164
+ const youtubeRegex = /^(https?:\/\/)?((www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/.+/i;
2165
+ return youtubeRegex.test(url);
2166
+ };
2167
+ var isValidYouTubeHost = (host) => {
2168
+ if (host === "youtu.be") return "youtu.be";
2169
+ const isValidYouTubeCom = host === "youtube.com" || host.endsWith(".youtube.com") && /^(www|m|music)\.youtube\.com$/.test(host);
2170
+ if (isValidYouTubeCom) return "youtube";
2171
+ const isValidNoCookie = host === "youtube-nocookie.com" || host.endsWith(".youtube-nocookie.com") && /^(www|m|music)\.youtube-nocookie\.com$/.test(host);
2172
+ if (isValidNoCookie) return "nocookie";
2173
+ return null;
2174
+ };
2175
+ var extractYoutuBeId = (pathname) => {
2176
+ const firstSeg = pathname.split("/").filter(Boolean)[0];
2177
+ return firstSeg || null;
2178
+ };
2179
+ var extractYouTubeId = (pathname, searchParams) => {
2180
+ const parts = pathname.split("/").filter(Boolean);
2181
+ const [first, second] = parts;
2182
+ if (first === "embed" && second) return second;
2183
+ if (first === "shorts" && second) return second;
2184
+ if (first === "live" && second) return second;
2185
+ const v = searchParams.get("v");
2186
+ if (v) return v;
2187
+ return null;
2188
+ };
2189
+ var getYouTubeVideoId = (url) => {
2190
+ try {
2191
+ const u = new URL(url);
2192
+ const hostType = isValidYouTubeHost(u.hostname.toLowerCase());
2193
+ if (!hostType) return null;
2194
+ if (hostType === "youtu.be") {
2195
+ return extractYoutuBeId(u.pathname);
2196
+ }
2197
+ return extractYouTubeId(u.pathname, u.searchParams);
2198
+ } catch {
2199
+ return null;
2200
+ }
2201
+ };
2202
+ var getYouTubeEmbedUrl = (videoId) => {
2203
+ return `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=0&rel=0&modestbranding=1`;
2155
2204
  };
2156
2205
 
2157
- // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
2206
+ // src/components/Modal/Modal.tsx
2158
2207
  var import_jsx_runtime22 = require("react/jsx-runtime");
2208
+ var SIZE_CLASSES5 = {
2209
+ xs: "max-w-[360px]",
2210
+ sm: "max-w-[420px]",
2211
+ md: "max-w-[510px]",
2212
+ lg: "max-w-[640px]",
2213
+ xl: "max-w-[970px]"
2214
+ };
2215
+ var Modal = ({
2216
+ isOpen,
2217
+ onClose,
2218
+ title,
2219
+ children,
2220
+ size = "md",
2221
+ className = "",
2222
+ closeOnEscape = true,
2223
+ footer,
2224
+ hideCloseButton = false,
2225
+ variant = "default",
2226
+ description,
2227
+ image,
2228
+ imageAlt,
2229
+ actionLink,
2230
+ actionLabel,
2231
+ contentClassName = ""
2232
+ }) => {
2233
+ const titleId = (0, import_react8.useId)();
2234
+ (0, import_react8.useEffect)(() => {
2235
+ if (!isOpen || !closeOnEscape) return;
2236
+ const handleEscape = (event) => {
2237
+ if (event.key === "Escape") {
2238
+ onClose();
2239
+ }
2240
+ };
2241
+ document.addEventListener("keydown", handleEscape);
2242
+ return () => document.removeEventListener("keydown", handleEscape);
2243
+ }, [isOpen, closeOnEscape, onClose]);
2244
+ (0, import_react8.useEffect)(() => {
2245
+ if (!isOpen) return;
2246
+ const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
2247
+ const originalOverflow = document.body.style.overflow;
2248
+ const originalPaddingRight = document.body.style.paddingRight;
2249
+ document.body.style.overflow = "hidden";
2250
+ if (scrollbarWidth > 0) {
2251
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
2252
+ const overlay = document.createElement("div");
2253
+ overlay.id = "modal-scrollbar-overlay";
2254
+ overlay.style.cssText = `
2255
+ position: fixed;
2256
+ top: 0;
2257
+ right: 0;
2258
+ width: ${scrollbarWidth}px;
2259
+ height: 100vh;
2260
+ background-color: rgb(0 0 0 / 0.6);
2261
+ z-index: 40;
2262
+ pointer-events: none;
2263
+ `;
2264
+ document.body.appendChild(overlay);
2265
+ }
2266
+ return () => {
2267
+ document.body.style.overflow = originalOverflow;
2268
+ document.body.style.paddingRight = originalPaddingRight;
2269
+ const overlay = document.getElementById("modal-scrollbar-overlay");
2270
+ if (overlay) {
2271
+ overlay.remove();
2272
+ }
2273
+ };
2274
+ }, [isOpen]);
2275
+ if (!isOpen) return null;
2276
+ const sizeClasses = SIZE_CLASSES5[size];
2277
+ const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
2278
+ const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
2279
+ const modalClasses = cn(
2280
+ baseClasses,
2281
+ sizeClasses,
2282
+ dialogResetClasses,
2283
+ className
2284
+ );
2285
+ const normalizeUrl = (href) => /^https?:\/\//i.test(href) ? href : `https://${href}`;
2286
+ const handleActionClick = () => {
2287
+ if (actionLink) {
2288
+ window.open(normalizeUrl(actionLink), "_blank", "noopener,noreferrer");
2289
+ }
2290
+ };
2291
+ if (variant === "activity") {
2292
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2293
+ "dialog",
2294
+ {
2295
+ className: modalClasses,
2296
+ "aria-labelledby": titleId,
2297
+ "aria-modal": "true",
2298
+ open: true,
2299
+ children: [
2300
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-end p-6 pb-0", children: !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2301
+ "button",
2302
+ {
2303
+ onClick: onClose,
2304
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
2305
+ "aria-label": "Fechar modal",
2306
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react4.X, { size: 18 })
2307
+ }
2308
+ ) }),
2309
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col items-center px-6 pb-6 gap-5", children: [
2310
+ image && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2311
+ "img",
2312
+ {
2313
+ src: image,
2314
+ alt: imageAlt ?? "",
2315
+ className: "w-[122px] h-[122px] object-contain"
2316
+ }
2317
+ ) }),
2318
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2319
+ "h2",
2320
+ {
2321
+ id: titleId,
2322
+ className: "text-lg font-semibold text-text-950 text-center",
2323
+ children: title
2324
+ }
2325
+ ),
2326
+ description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-normal text-text-400 text-center max-w-md leading-[21px]", children: description }),
2327
+ actionLink && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full", children: [
2328
+ (() => {
2329
+ const normalized = normalizeUrl(actionLink);
2330
+ const isYT = isYouTubeUrl(normalized);
2331
+ if (!isYT) return null;
2332
+ const id = getYouTubeVideoId(normalized);
2333
+ if (!id) {
2334
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2335
+ Button_default,
2336
+ {
2337
+ variant: "solid",
2338
+ action: "primary",
2339
+ size: "large",
2340
+ className: "w-full",
2341
+ onClick: handleActionClick,
2342
+ children: actionLabel || "Iniciar Atividade"
2343
+ }
2344
+ );
2345
+ }
2346
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2347
+ "iframe",
2348
+ {
2349
+ src: getYouTubeEmbedUrl(id),
2350
+ className: "w-full aspect-video rounded-lg",
2351
+ allowFullScreen: true,
2352
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
2353
+ title: "V\xEDdeo YouTube"
2354
+ }
2355
+ );
2356
+ })(),
2357
+ !isYouTubeUrl(normalizeUrl(actionLink)) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2358
+ Button_default,
2359
+ {
2360
+ variant: "solid",
2361
+ action: "primary",
2362
+ size: "large",
2363
+ className: "w-full",
2364
+ onClick: handleActionClick,
2365
+ children: actionLabel || "Iniciar Atividade"
2366
+ }
2367
+ )
2368
+ ] })
2369
+ ] })
2370
+ ]
2371
+ }
2372
+ ) });
2373
+ }
2374
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2375
+ "dialog",
2376
+ {
2377
+ className: modalClasses,
2378
+ "aria-labelledby": titleId,
2379
+ "aria-modal": "true",
2380
+ open: true,
2381
+ children: [
2382
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center justify-between px-6 py-6", children: [
2383
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { id: titleId, className: "text-lg font-semibold text-text-950", children: title }),
2384
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2385
+ "button",
2386
+ {
2387
+ onClick: onClose,
2388
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
2389
+ "aria-label": "Fechar modal",
2390
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react4.X, { size: 18 })
2391
+ }
2392
+ )
2393
+ ] }),
2394
+ children && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cn("px-6 pb-6", contentClassName), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
2395
+ footer && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
2396
+ ]
2397
+ }
2398
+ ) });
2399
+ };
2400
+ var Modal_default = Modal;
2401
+
2402
+ // src/components/Accordation/Accordation.tsx
2403
+ var import_react11 = require("react");
2404
+
2405
+ // src/components/Card/Card.tsx
2406
+ var import_react10 = require("react");
2407
+ var import_phosphor_react5 = require("phosphor-react");
2408
+
2409
+ // src/components/IconRender/IconRender.tsx
2410
+ var import_react9 = require("react");
2411
+ var PhosphorIcons = __toESM(require("phosphor-react"));
2412
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2413
+ var IconRender = ({
2414
+ iconName,
2415
+ color = "#000000",
2416
+ size = 24,
2417
+ weight = "regular"
2418
+ }) => {
2419
+ if (typeof iconName === "string") {
2420
+ switch (iconName) {
2421
+ case "Chat_PT":
2422
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatPT, { size, color });
2423
+ case "Chat_EN":
2424
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatEN, { size, color });
2425
+ case "Chat_ES":
2426
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatES, { size, color });
2427
+ default: {
2428
+ const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
2429
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconComponent, { size, color, weight });
2430
+ }
2431
+ }
2432
+ } else {
2433
+ return (0, import_react9.cloneElement)(iconName, {
2434
+ size,
2435
+ color: "currentColor"
2436
+ });
2437
+ }
2438
+ };
2439
+ var IconRender_default = IconRender;
2440
+
2441
+ // src/components/Card/Card.tsx
2442
+ var import_jsx_runtime24 = require("react/jsx-runtime");
2443
+ var CARD_BASE_CLASSES = {
2444
+ default: "w-full bg-background border border-border-50 rounded-xl",
2445
+ compact: "w-full bg-background border border-border-50 rounded-lg",
2446
+ minimal: "w-full bg-background border border-border-100 rounded-md"
2447
+ };
2448
+ var CARD_PADDING_CLASSES = {
2449
+ none: "",
2450
+ small: "p-2",
2451
+ medium: "p-4",
2452
+ large: "p-6"
2453
+ };
2454
+ var CARD_MIN_HEIGHT_CLASSES = {
2455
+ none: "",
2456
+ small: "min-h-16",
2457
+ medium: "min-h-20",
2458
+ large: "min-h-24"
2459
+ };
2460
+ var CARD_LAYOUT_CLASSES = {
2461
+ horizontal: "flex flex-row",
2462
+ vertical: "flex flex-col"
2463
+ };
2464
+ var CARD_CURSOR_CLASSES = {
2465
+ default: "",
2466
+ pointer: "cursor-pointer"
2467
+ };
2468
+ var CardBase = (0, import_react10.forwardRef)(
2469
+ ({
2470
+ children,
2471
+ variant = "default",
2472
+ layout = "horizontal",
2473
+ padding = "medium",
2474
+ minHeight = "medium",
2475
+ cursor = "default",
2476
+ className = "",
2477
+ ...props
2478
+ }, ref) => {
2479
+ const baseClasses = CARD_BASE_CLASSES[variant];
2480
+ const paddingClasses = CARD_PADDING_CLASSES[padding];
2481
+ const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
2482
+ const layoutClasses = CARD_LAYOUT_CLASSES[layout];
2483
+ const cursorClasses = CARD_CURSOR_CLASSES[cursor];
2484
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2485
+ "div",
2486
+ {
2487
+ ref,
2488
+ className: cn(
2489
+ baseClasses,
2490
+ paddingClasses,
2491
+ minHeightClasses,
2492
+ layoutClasses,
2493
+ cursorClasses,
2494
+ className
2495
+ ),
2496
+ ...props,
2497
+ children
2498
+ }
2499
+ );
2500
+ }
2501
+ );
2502
+ var ACTION_CARD_CLASSES = {
2503
+ warning: "bg-warning-background",
2504
+ success: "bg-success-200",
2505
+ error: "bg-error-100",
2506
+ info: "bg-info-background"
2507
+ };
2508
+ var ACTION_ICON_CLASSES = {
2509
+ warning: "bg-warning-300 text-text",
2510
+ success: "bg-indicator-positive text-text-950",
2511
+ error: "bg-indicator-negative text-text",
2512
+ info: "bg-info-500 text-text"
2513
+ };
2514
+ var ACTION_SUBTITLE_CLASSES = {
2515
+ warning: "text-warning-600",
2516
+ success: "text-success-700",
2517
+ error: "text-error-700",
2518
+ info: "text-info-700"
2519
+ };
2520
+ var ACTION_HEADER_CLASSES = {
2521
+ warning: "text-warning-300",
2522
+ success: "text-success-300",
2523
+ error: "text-error-300",
2524
+ info: "text-info-300"
2525
+ };
2526
+ var CardActivitiesResults = (0, import_react10.forwardRef)(
2527
+ ({
2528
+ icon,
2529
+ title,
2530
+ subTitle,
2531
+ header,
2532
+ extended = false,
2533
+ action = "success",
2534
+ description,
2535
+ className,
2536
+ ...props
2537
+ }, ref) => {
2538
+ const actionCardClasses = ACTION_CARD_CLASSES[action];
2539
+ const actionIconClasses = ACTION_ICON_CLASSES[action];
2540
+ const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
2541
+ const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
2542
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2543
+ "div",
2544
+ {
2545
+ ref,
2546
+ className: cn(
2547
+ "w-full flex flex-col border border-border-50 bg-background rounded-xl",
2548
+ className
2549
+ ),
2550
+ ...props,
2551
+ children: [
2552
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2553
+ "div",
2554
+ {
2555
+ className: cn(
2556
+ "flex flex-col gap-1 items-center justify-center p-4",
2557
+ actionCardClasses,
2558
+ extended ? "rounded-t-xl" : "rounded-xl"
2559
+ ),
2560
+ children: [
2561
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2562
+ "span",
2563
+ {
2564
+ className: cn(
2565
+ "size-7.5 rounded-full flex items-center justify-center",
2566
+ actionIconClasses
2567
+ ),
2568
+ children: icon
2569
+ }
2570
+ ),
2571
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2572
+ Text_default,
2573
+ {
2574
+ size: "2xs",
2575
+ weight: "medium",
2576
+ className: "text-text-800 uppercase truncate",
2577
+ children: title
2578
+ }
2579
+ ),
2580
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2581
+ "p",
2582
+ {
2583
+ className: cn("text-lg font-bold truncate", actionSubTitleClasses),
2584
+ children: subTitle
2585
+ }
2586
+ )
2587
+ ]
2588
+ }
2589
+ ),
2590
+ extended && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
2591
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2592
+ "p",
2593
+ {
2594
+ className: cn(
2595
+ "text-2xs font-medium uppercase truncate",
2596
+ actionHeaderClasses
2597
+ ),
2598
+ children: header
2599
+ }
2600
+ ),
2601
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Badge_default, { size: "large", action: "info", children: description })
2602
+ ] })
2603
+ ]
2604
+ }
2605
+ );
2606
+ }
2607
+ );
2608
+ var CardQuestions = (0, import_react10.forwardRef)(
2609
+ ({
2610
+ header,
2611
+ state = "undone",
2612
+ className,
2613
+ onClickButton,
2614
+ valueButton,
2615
+ ...props
2616
+ }, ref) => {
2617
+ const isDone = state === "done";
2618
+ const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
2619
+ const buttonLabel = isDone ? "Ver Resultado" : "Responder";
2620
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2621
+ CardBase,
2622
+ {
2623
+ ref,
2624
+ layout: "horizontal",
2625
+ padding: "medium",
2626
+ minHeight: "medium",
2627
+ className: cn("justify-between gap-4", className),
2628
+ ...props,
2629
+ children: [
2630
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
2631
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
2632
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2633
+ Badge_default,
2634
+ {
2635
+ size: "medium",
2636
+ variant: "solid",
2637
+ action: isDone ? "success" : "error",
2638
+ children: stateLabel
2639
+ }
2640
+ ) })
2641
+ ] }),
2642
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2643
+ Button_default,
2644
+ {
2645
+ size: "extra-small",
2646
+ onClick: () => onClickButton?.(valueButton),
2647
+ className: "min-w-fit",
2648
+ children: buttonLabel
2649
+ }
2650
+ ) })
2651
+ ]
2652
+ }
2653
+ );
2654
+ }
2655
+ );
2656
+ var CardProgress = (0, import_react10.forwardRef)(
2657
+ ({
2658
+ header,
2659
+ subhead,
2660
+ initialDate,
2661
+ endDate,
2662
+ progress = 0,
2663
+ direction = "horizontal",
2664
+ icon,
2665
+ color = "#B7DFFF",
2666
+ progressVariant = "blue",
2667
+ showDates = true,
2668
+ className,
2669
+ ...props
2670
+ }, ref) => {
2671
+ const isHorizontal = direction === "horizontal";
2672
+ const contentComponent = {
2673
+ horizontal: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2674
+ showDates && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
2675
+ initialDate && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
2676
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
2677
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-600", children: initialDate })
2678
+ ] }),
2679
+ endDate && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
2680
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-800 font-semibold", children: "Fim" }),
2681
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-600", children: endDate })
2682
+ ] })
2683
+ ] }),
2684
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
2685
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2686
+ ProgressBar_default,
2687
+ {
2688
+ size: "small",
2689
+ value: progress,
2690
+ variant: progressVariant,
2691
+ "data-testid": "progress-bar"
2692
+ }
2693
+ ),
2694
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2695
+ Text_default,
2696
+ {
2697
+ size: "xs",
2698
+ weight: "medium",
2699
+ className: cn(
2700
+ "text-text-950 leading-none tracking-normal text-center flex-none"
2701
+ ),
2702
+ children: [
2703
+ Math.round(progress),
2704
+ "%"
2705
+ ]
2706
+ }
2707
+ )
2708
+ ] })
2709
+ ] }),
2710
+ vertical: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-text-800", children: subhead })
2711
+ };
2712
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2713
+ CardBase,
2714
+ {
2715
+ ref,
2716
+ layout: isHorizontal ? "horizontal" : "vertical",
2717
+ padding: "none",
2718
+ minHeight: "medium",
2719
+ cursor: "pointer",
2720
+ className: cn(isHorizontal ? "h-20" : "", className),
2721
+ ...props,
2722
+ children: [
2723
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2724
+ "div",
2725
+ {
2726
+ className: cn(
2727
+ "flex justify-center items-center [&>svg]:size-6 text-text-950",
2728
+ isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl",
2729
+ !color.startsWith("#") ? `${color}` : ""
2730
+ ),
2731
+ style: color.startsWith("#") ? { backgroundColor: color } : void 0,
2732
+ "data-testid": "icon-container",
2733
+ children: icon
2734
+ }
2735
+ ),
2736
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2737
+ "div",
2738
+ {
2739
+ className: cn(
2740
+ "p-4 flex flex-col justify-between w-full h-full",
2741
+ !isHorizontal && "gap-4"
2742
+ ),
2743
+ children: [
2744
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
2745
+ contentComponent[direction]
2746
+ ]
2747
+ }
2748
+ )
2749
+ ]
2750
+ }
2751
+ );
2752
+ }
2753
+ );
2754
+ var CardTopic = (0, import_react10.forwardRef)(
2755
+ ({
2756
+ header,
2757
+ subHead,
2758
+ progress,
2759
+ showPercentage = false,
2760
+ progressVariant = "blue",
2761
+ className = "",
2762
+ ...props
2763
+ }, ref) => {
2764
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2765
+ CardBase,
2766
+ {
2767
+ ref,
2768
+ layout: "vertical",
2769
+ padding: "small",
2770
+ minHeight: "medium",
2771
+ cursor: "pointer",
2772
+ className: cn("justify-center gap-2 py-2 px-4", className),
2773
+ ...props,
2774
+ children: [
2775
+ subHead && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react10.Fragment, { children: [
2776
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: text }),
2777
+ index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: "\u2022" })
2778
+ ] }, `${text} - ${index}`)) }),
2779
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
2780
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
2781
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2782
+ ProgressBar_default,
2783
+ {
2784
+ size: "small",
2785
+ value: progress,
2786
+ variant: progressVariant,
2787
+ "data-testid": "progress-bar"
2788
+ }
2789
+ ),
2790
+ showPercentage && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2791
+ Text_default,
2792
+ {
2793
+ size: "xs",
2794
+ weight: "medium",
2795
+ className: cn(
2796
+ "text-text-950 leading-none tracking-normal text-center flex-none"
2797
+ ),
2798
+ children: [
2799
+ Math.round(progress),
2800
+ "%"
2801
+ ]
2802
+ }
2803
+ )
2804
+ ] })
2805
+ ]
2806
+ }
2807
+ );
2808
+ }
2809
+ );
2810
+ var CardPerformance = (0, import_react10.forwardRef)(
2811
+ ({
2812
+ header,
2813
+ progress,
2814
+ description = "Sem dados ainda! Voc\xEA ainda n\xE3o fez um question\xE1rio neste assunto.",
2815
+ actionVariant = "button",
2816
+ progressVariant = "blue",
2817
+ labelProgress = "",
2818
+ className = "",
2819
+ onClickButton,
2820
+ valueButton,
2821
+ ...props
2822
+ }, ref) => {
2823
+ const hasProgress = progress !== void 0;
2824
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2825
+ CardBase,
2826
+ {
2827
+ ref,
2828
+ layout: "horizontal",
2829
+ padding: "medium",
2830
+ minHeight: "none",
2831
+ className: cn(
2832
+ actionVariant == "caret" ? "cursor-pointer" : "",
2833
+ className
2834
+ ),
2835
+ onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
2836
+ ...props,
2837
+ children: [
2838
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
2839
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row justify-between items-center gap-2", children: [
2840
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
2841
+ actionVariant === "button" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2842
+ Button_default,
2843
+ {
2844
+ variant: "outline",
2845
+ size: "extra-small",
2846
+ onClick: () => onClickButton?.(valueButton),
2847
+ className: "min-w-fit flex-shrink-0",
2848
+ children: "Ver Aula"
2849
+ }
2850
+ )
2851
+ ] }),
2852
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2853
+ ProgressBar_default,
2854
+ {
2855
+ value: progress,
2856
+ label: `${progress}% ${labelProgress}`,
2857
+ variant: progressVariant
2858
+ }
2859
+ ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-xs text-text-600 truncate", children: description }) })
2860
+ ] }),
2861
+ actionVariant == "caret" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2862
+ import_phosphor_react5.CaretRight,
2863
+ {
2864
+ className: "size-4.5 text-text-800 cursor-pointer",
2865
+ "data-testid": "caret-icon"
2866
+ }
2867
+ )
2868
+ ]
2869
+ }
2870
+ );
2871
+ }
2872
+ );
2873
+ var CardResults = (0, import_react10.forwardRef)(
2874
+ ({
2875
+ header,
2876
+ correct_answers,
2877
+ incorrect_answers,
2878
+ icon,
2879
+ direction = "col",
2880
+ color = "#B7DFFF",
2881
+ className,
2882
+ ...props
2883
+ }, ref) => {
2884
+ const isRow = direction == "row";
2885
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2886
+ CardBase,
2887
+ {
2888
+ ref,
2889
+ layout: "horizontal",
2890
+ padding: "none",
2891
+ minHeight: "medium",
2892
+ className: cn("items-stretch cursor-pointer pr-4", className),
2893
+ ...props,
2894
+ children: [
2895
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2896
+ "div",
2897
+ {
2898
+ className: cn(
2899
+ "flex justify-center items-center [&>svg]:size-8 text-text-950 min-w-20 max-w-20 min-h-full rounded-l-xl"
2900
+ ),
2901
+ style: {
2902
+ backgroundColor: color
2903
+ },
2904
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
2905
+ }
2906
+ ),
2907
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "w-full flex flex-row justify-between items-center", children: [
2908
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2909
+ "div",
2910
+ {
2911
+ className: cn(
2912
+ "p-4 flex flex-wrap justify-between w-full h-full",
2913
+ isRow ? "flex-row items-center gap-2" : "flex-col"
2914
+ ),
2915
+ children: [
2916
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
2917
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
2918
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2919
+ Badge_default,
2920
+ {
2921
+ action: "success",
2922
+ variant: "solid",
2923
+ size: "large",
2924
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CheckCircle, {}),
2925
+ children: [
2926
+ correct_answers,
2927
+ " Corretas"
2928
+ ]
2929
+ }
2930
+ ),
2931
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2932
+ Badge_default,
2933
+ {
2934
+ action: "error",
2935
+ variant: "solid",
2936
+ size: "large",
2937
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.XCircle, {}),
2938
+ children: [
2939
+ incorrect_answers,
2940
+ " Incorretas"
2941
+ ]
2942
+ }
2943
+ )
2944
+ ] })
2945
+ ]
2946
+ }
2947
+ ),
2948
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
2949
+ ] })
2950
+ ]
2951
+ }
2952
+ );
2953
+ }
2954
+ );
2955
+ var CardStatus = (0, import_react10.forwardRef)(
2956
+ ({ header, className, status, label, ...props }, ref) => {
2957
+ const getLabelBadge = (status2) => {
2958
+ switch (status2) {
2959
+ case "correct":
2960
+ return "Correta";
2961
+ case "incorrect":
2962
+ return "Incorreta";
2963
+ case "unanswered":
2964
+ return "Em branco";
2965
+ case "pending":
2966
+ return "Avalia\xE7\xE3o pendente";
2967
+ default:
2968
+ return "Em branco";
2969
+ }
2970
+ };
2971
+ const getIconBadge = (status2) => {
2972
+ switch (status2) {
2973
+ case "correct":
2974
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CheckCircle, {});
2975
+ case "incorrect":
2976
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.XCircle, {});
2977
+ case "pending":
2978
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Clock, {});
2979
+ default:
2980
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.XCircle, {});
2981
+ }
2982
+ };
2983
+ const getActionBadge = (status2) => {
2984
+ switch (status2) {
2985
+ case "correct":
2986
+ return "success";
2987
+ case "incorrect":
2988
+ return "error";
2989
+ case "pending":
2990
+ return "info";
2991
+ default:
2992
+ return "info";
2993
+ }
2994
+ };
2995
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2996
+ CardBase,
2997
+ {
2998
+ ref,
2999
+ layout: "horizontal",
3000
+ padding: "medium",
3001
+ minHeight: "medium",
3002
+ className: cn("items-center cursor-pointer", className),
3003
+ ...props,
3004
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
3005
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
3006
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
3007
+ status && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3008
+ Badge_default,
3009
+ {
3010
+ action: getActionBadge(status),
3011
+ variant: "solid",
3012
+ size: "medium",
3013
+ iconLeft: getIconBadge(status),
3014
+ children: getLabelBadge(status)
3015
+ }
3016
+ ),
3017
+ label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-text-800", children: label })
3018
+ ] }),
3019
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
3020
+ ] })
3021
+ }
3022
+ );
3023
+ }
3024
+ );
3025
+ var CardSettings = (0, import_react10.forwardRef)(
3026
+ ({ header, className, icon, ...props }, ref) => {
3027
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3028
+ CardBase,
3029
+ {
3030
+ ref,
3031
+ layout: "horizontal",
3032
+ padding: "small",
3033
+ minHeight: "none",
3034
+ className: cn(
3035
+ "border-none items-center gap-2 text-text-700",
3036
+ className
3037
+ ),
3038
+ ...props,
3039
+ children: [
3040
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
3041
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "w-full text-sm truncate", children: header }),
3042
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CaretRight, { size: 24, className: "cursor-pointer" })
3043
+ ]
3044
+ }
3045
+ );
3046
+ }
3047
+ );
3048
+ var CardSupport = (0, import_react10.forwardRef)(
3049
+ ({ header, className, direction = "col", children, ...props }, ref) => {
3050
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3051
+ CardBase,
3052
+ {
3053
+ ref,
3054
+ layout: "horizontal",
3055
+ padding: "medium",
3056
+ minHeight: "none",
3057
+ className: cn(
3058
+ "border-none items-center gap-2 text-text-700",
3059
+ className
3060
+ ),
3061
+ ...props,
3062
+ children: [
3063
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3064
+ "div",
3065
+ {
3066
+ className: cn(
3067
+ "w-full flex",
3068
+ direction == "col" ? "flex-col" : "flex-row items-center"
3069
+ ),
3070
+ children: [
3071
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
3072
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex flex-row gap-1", children })
3073
+ ]
3074
+ }
3075
+ ),
3076
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
3077
+ ]
3078
+ }
3079
+ );
3080
+ }
3081
+ );
3082
+ var CardForum = (0, import_react10.forwardRef)(
3083
+ ({
3084
+ title,
3085
+ content,
3086
+ comments,
3087
+ onClickComments,
3088
+ valueComments,
3089
+ onClickProfile,
3090
+ valueProfile,
3091
+ className = "",
3092
+ date,
3093
+ hour,
3094
+ ...props
3095
+ }, ref) => {
3096
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3097
+ CardBase,
3098
+ {
3099
+ ref,
3100
+ layout: "horizontal",
3101
+ padding: "medium",
3102
+ minHeight: "none",
3103
+ variant: "minimal",
3104
+ className: cn("w-auto h-auto gap-3", className),
3105
+ ...props,
3106
+ children: [
3107
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3108
+ "button",
3109
+ {
3110
+ type: "button",
3111
+ "aria-label": "Ver perfil",
3112
+ onClick: () => onClickProfile?.(valueProfile),
3113
+ className: "min-w-8 h-8 rounded-full bg-background-950"
3114
+ }
3115
+ ),
3116
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
3117
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
3118
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
3119
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { className: "text-xs text-text-600", children: [
3120
+ "\u2022 ",
3121
+ date,
3122
+ " \u2022 ",
3123
+ hour
3124
+ ] })
3125
+ ] }),
3126
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
3127
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3128
+ "button",
3129
+ {
3130
+ type: "button",
3131
+ "aria-label": "Ver coment\xE1rios",
3132
+ onClick: () => onClickComments?.(valueComments),
3133
+ className: "text-text-600 flex flex-row gap-2 items-center",
3134
+ children: [
3135
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.ChatCircleText, { "aria-hidden": "true", size: 16 }),
3136
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { className: "text-xs", children: [
3137
+ comments,
3138
+ " respostas"
3139
+ ] })
3140
+ ]
3141
+ }
3142
+ )
3143
+ ] })
3144
+ ]
3145
+ }
3146
+ );
3147
+ }
3148
+ );
3149
+ var CardAudio = (0, import_react10.forwardRef)(
3150
+ ({
3151
+ src,
3152
+ title,
3153
+ onPlay,
3154
+ onPause,
3155
+ onEnded,
3156
+ onAudioTimeUpdate,
3157
+ loop = false,
3158
+ preload = "metadata",
3159
+ tracks,
3160
+ className,
3161
+ ...props
3162
+ }, ref) => {
3163
+ const [isPlaying, setIsPlaying] = (0, import_react10.useState)(false);
3164
+ const [currentTime, setCurrentTime] = (0, import_react10.useState)(0);
3165
+ const [duration, setDuration] = (0, import_react10.useState)(0);
3166
+ const [volume, setVolume] = (0, import_react10.useState)(1);
3167
+ const [showVolumeControl, setShowVolumeControl] = (0, import_react10.useState)(false);
3168
+ const [showSpeedMenu, setShowSpeedMenu] = (0, import_react10.useState)(false);
3169
+ const [playbackRate, setPlaybackRate] = (0, import_react10.useState)(1);
3170
+ const audioRef = (0, import_react10.useRef)(null);
3171
+ const volumeControlRef = (0, import_react10.useRef)(null);
3172
+ const speedMenuRef = (0, import_react10.useRef)(null);
3173
+ const formatTime = (time) => {
3174
+ const minutes = Math.floor(time / 60);
3175
+ const seconds = Math.floor(time % 60);
3176
+ return `${minutes}:${seconds.toString().padStart(2, "0")}`;
3177
+ };
3178
+ const handlePlayPause = () => {
3179
+ if (isPlaying) {
3180
+ audioRef.current?.pause();
3181
+ setIsPlaying(false);
3182
+ onPause?.();
3183
+ } else {
3184
+ audioRef.current?.play();
3185
+ setIsPlaying(true);
3186
+ onPlay?.();
3187
+ }
3188
+ };
3189
+ const handleTimeUpdate = () => {
3190
+ const current = audioRef.current?.currentTime ?? 0;
3191
+ const total = audioRef.current?.duration ?? 0;
3192
+ setCurrentTime(current);
3193
+ setDuration(total);
3194
+ onAudioTimeUpdate?.(current, total);
3195
+ };
3196
+ const handleLoadedMetadata = () => {
3197
+ setDuration(audioRef.current?.duration ?? 0);
3198
+ };
3199
+ const handleEnded = () => {
3200
+ setIsPlaying(false);
3201
+ setCurrentTime(0);
3202
+ onEnded?.();
3203
+ };
3204
+ const handleProgressClick = (e) => {
3205
+ const rect = e.currentTarget.getBoundingClientRect();
3206
+ const clickX = e.clientX - rect.left;
3207
+ const width = rect.width;
3208
+ const percentage = clickX / width;
3209
+ const newTime = percentage * duration;
3210
+ if (audioRef.current) {
3211
+ audioRef.current.currentTime = newTime;
3212
+ }
3213
+ setCurrentTime(newTime);
3214
+ };
3215
+ const handleVolumeChange = (e) => {
3216
+ const newVolume = parseFloat(e.target.value);
3217
+ setVolume(newVolume);
3218
+ if (audioRef.current) {
3219
+ audioRef.current.volume = newVolume;
3220
+ }
3221
+ };
3222
+ const toggleVolumeControl = () => {
3223
+ setShowVolumeControl(!showVolumeControl);
3224
+ setShowSpeedMenu(false);
3225
+ };
3226
+ const toggleSpeedMenu = () => {
3227
+ setShowSpeedMenu(!showSpeedMenu);
3228
+ setShowVolumeControl(false);
3229
+ };
3230
+ const handleSpeedChange = (speed) => {
3231
+ setPlaybackRate(speed);
3232
+ if (audioRef.current) {
3233
+ audioRef.current.playbackRate = speed;
3234
+ }
3235
+ setShowSpeedMenu(false);
3236
+ };
3237
+ const getVolumeIcon = () => {
3238
+ if (volume === 0) {
3239
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.SpeakerSimpleX, { size: 24 });
3240
+ }
3241
+ if (volume < 0.5) {
3242
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.SpeakerLow, { size: 24 });
3243
+ }
3244
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.SpeakerHigh, { size: 24 });
3245
+ };
3246
+ (0, import_react10.useEffect)(() => {
3247
+ const handleClickOutside = (event) => {
3248
+ if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
3249
+ setShowVolumeControl(false);
3250
+ }
3251
+ if (speedMenuRef.current && !speedMenuRef.current.contains(event.target)) {
3252
+ setShowSpeedMenu(false);
3253
+ }
3254
+ };
3255
+ document.addEventListener("mousedown", handleClickOutside);
3256
+ return () => {
3257
+ document.removeEventListener("mousedown", handleClickOutside);
3258
+ };
3259
+ }, []);
3260
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3261
+ CardBase,
3262
+ {
3263
+ ref,
3264
+ layout: "horizontal",
3265
+ padding: "medium",
3266
+ minHeight: "none",
3267
+ className: cn(
3268
+ "flex flex-row w-auto h-14 items-center gap-2",
3269
+ className
3270
+ ),
3271
+ ...props,
3272
+ children: [
3273
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3274
+ "audio",
3275
+ {
3276
+ ref: audioRef,
3277
+ src,
3278
+ loop,
3279
+ preload,
3280
+ onTimeUpdate: handleTimeUpdate,
3281
+ onLoadedMetadata: handleLoadedMetadata,
3282
+ onEnded: handleEnded,
3283
+ "data-testid": "audio-element",
3284
+ "aria-label": title,
3285
+ children: tracks ? tracks.map((track) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3286
+ "track",
3287
+ {
3288
+ kind: track.kind,
3289
+ src: track.src,
3290
+ srcLang: track.srcLang,
3291
+ label: track.label,
3292
+ default: track.default
3293
+ },
3294
+ track.src
3295
+ )) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3296
+ "track",
3297
+ {
3298
+ kind: "captions",
3299
+ src: "data:text/vtt;base64,",
3300
+ srcLang: "pt",
3301
+ label: "Sem legendas dispon\xEDveis"
3302
+ }
3303
+ )
3304
+ }
3305
+ ),
3306
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3307
+ "button",
3308
+ {
3309
+ type: "button",
3310
+ onClick: handlePlayPause,
3311
+ disabled: !src,
3312
+ className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
3313
+ "aria-label": isPlaying ? "Pausar" : "Reproduzir",
3314
+ children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex gap-0.5", children: [
3315
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" }),
3316
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" })
3317
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Play, { size: 24 })
3318
+ }
3319
+ ),
3320
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
3321
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3322
+ "button",
3323
+ {
3324
+ type: "button",
3325
+ className: "w-full h-2 bg-border-100 rounded-full cursor-pointer",
3326
+ onClick: handleProgressClick,
3327
+ onKeyDown: (e) => {
3328
+ if (e.key === "Enter" || e.key === " ") {
3329
+ e.preventDefault();
3330
+ handleProgressClick(
3331
+ e
3332
+ );
3333
+ }
3334
+ },
3335
+ "aria-label": "Barra de progresso do \xE1udio",
3336
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3337
+ "div",
3338
+ {
3339
+ className: "h-full bg-primary-600 rounded-full transition-all duration-100",
3340
+ style: {
3341
+ width: duration > 0 ? `${currentTime / duration * 100}%` : "0%"
3342
+ }
3343
+ }
3344
+ )
3345
+ }
3346
+ ) }),
3347
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(duration) }),
3348
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative h-6", ref: volumeControlRef, children: [
3349
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3350
+ "button",
3351
+ {
3352
+ type: "button",
3353
+ onClick: toggleVolumeControl,
3354
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
3355
+ "aria-label": "Controle de volume",
3356
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
3357
+ }
3358
+ ),
3359
+ showVolumeControl && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3360
+ "button",
3361
+ {
3362
+ type: "button",
3363
+ className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg focus:outline-none focus:ring-2 focus:ring-primary-500",
3364
+ onKeyDown: (e) => {
3365
+ if (e.key === "Escape") {
3366
+ setShowVolumeControl(false);
3367
+ }
3368
+ },
3369
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3370
+ "input",
3371
+ {
3372
+ type: "range",
3373
+ min: "0",
3374
+ max: "1",
3375
+ step: "0.1",
3376
+ value: volume,
3377
+ onChange: handleVolumeChange,
3378
+ onKeyDown: (e) => {
3379
+ if (e.key === "ArrowUp" || e.key === "ArrowRight") {
3380
+ e.preventDefault();
3381
+ const newVolume = Math.min(
3382
+ 1,
3383
+ Math.round((volume + 0.1) * 10) / 10
3384
+ );
3385
+ setVolume(newVolume);
3386
+ if (audioRef.current) audioRef.current.volume = newVolume;
3387
+ } else if (e.key === "ArrowDown" || e.key === "ArrowLeft") {
3388
+ e.preventDefault();
3389
+ const newVolume = Math.max(
3390
+ 0,
3391
+ Math.round((volume - 0.1) * 10) / 10
3392
+ );
3393
+ setVolume(newVolume);
3394
+ if (audioRef.current) audioRef.current.volume = newVolume;
3395
+ }
3396
+ },
3397
+ className: "w-20 h-2 bg-border-100 rounded-lg appearance-none cursor-pointer",
3398
+ style: {
3399
+ background: `linear-gradient(to right, #3b82f6 0%, #3b82f6 ${volume * 100}%, #e5e7eb ${volume * 100}%, #e5e7eb 100%)`
3400
+ },
3401
+ "aria-label": "Volume",
3402
+ "aria-valuenow": Math.round(volume * 100),
3403
+ "aria-valuemin": 0,
3404
+ "aria-valuemax": 100
3405
+ }
3406
+ )
3407
+ }
3408
+ )
3409
+ ] }),
3410
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative h-6", ref: speedMenuRef, children: [
3411
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3412
+ "button",
3413
+ {
3414
+ type: "button",
3415
+ onClick: toggleSpeedMenu,
3416
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
3417
+ "aria-label": "Op\xE7\xF5es de velocidade",
3418
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.DotsThreeVertical, { size: 24 })
3419
+ }
3420
+ ),
3421
+ showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-1", children: [
3422
+ { speed: 1, label: "1x" },
3423
+ { speed: 1.5, label: "1.5x" },
3424
+ { speed: 2, label: "2x" }
3425
+ ].map(({ speed, label }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3426
+ "button",
3427
+ {
3428
+ type: "button",
3429
+ onClick: () => handleSpeedChange(speed),
3430
+ className: cn(
3431
+ "px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
3432
+ playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
3433
+ ),
3434
+ children: label
3435
+ },
3436
+ speed
3437
+ )) }) })
3438
+ ] })
3439
+ ]
3440
+ }
3441
+ );
3442
+ }
3443
+ );
3444
+ var SIMULADO_BACKGROUND_CLASSES = {
3445
+ enem: "bg-exam-1",
3446
+ prova: "bg-exam-2",
3447
+ simuladao: "bg-exam-3",
3448
+ vestibular: "bg-exam-4"
3449
+ };
3450
+ var CardSimulado = (0, import_react10.forwardRef)(
3451
+ ({ title, duration, info, backgroundColor, className, ...props }, ref) => {
3452
+ const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
3453
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3454
+ CardBase,
3455
+ {
3456
+ ref,
3457
+ layout: "horizontal",
3458
+ padding: "medium",
3459
+ minHeight: "none",
3460
+ cursor: "pointer",
3461
+ className: cn(
3462
+ `${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200`,
3463
+ className
3464
+ ),
3465
+ ...props,
3466
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between items-center w-full gap-4", children: [
3467
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
3468
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
3469
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-4 text-text-700", children: [
3470
+ duration && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-1", children: [
3471
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Clock, { size: 16, className: "flex-shrink-0" }),
3472
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", children: duration })
3473
+ ] }),
3474
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", className: "truncate", children: info })
3475
+ ] })
3476
+ ] }),
3477
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3478
+ import_phosphor_react5.CaretRight,
3479
+ {
3480
+ size: 24,
3481
+ className: "text-text-800 flex-shrink-0",
3482
+ "data-testid": "caret-icon"
3483
+ }
3484
+ )
3485
+ ] })
3486
+ }
3487
+ );
3488
+ }
3489
+ );
3490
+ var CardTest = (0, import_react10.forwardRef)(
3491
+ ({
3492
+ title,
3493
+ duration,
3494
+ questionsCount,
3495
+ additionalInfo,
3496
+ selected = false,
3497
+ onSelect,
3498
+ className = "",
3499
+ ...props
3500
+ }, ref) => {
3501
+ const handleClick = () => {
3502
+ if (onSelect) {
3503
+ onSelect(!selected);
3504
+ }
3505
+ };
3506
+ const handleKeyDown = (event) => {
3507
+ if ((event.key === "Enter" || event.key === " ") && onSelect) {
3508
+ event.preventDefault();
3509
+ onSelect(!selected);
3510
+ }
3511
+ };
3512
+ const isSelectable = !!onSelect;
3513
+ const getQuestionsText = (count) => {
3514
+ const singular = count === 1 ? "quest\xE3o" : "quest\xF5es";
3515
+ return `${count} ${singular}`;
3516
+ };
3517
+ const displayInfo = questionsCount ? getQuestionsText(questionsCount) : additionalInfo || "";
3518
+ const baseClasses = "flex flex-row items-center p-4 gap-2 w-full max-w-full bg-background shadow-soft-shadow-1 rounded-xl isolate border-0 text-left";
3519
+ const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
3520
+ const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
3521
+ if (isSelectable) {
3522
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3523
+ "button",
3524
+ {
3525
+ ref,
3526
+ type: "button",
3527
+ className: cn(
3528
+ `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim()
3529
+ ),
3530
+ onClick: handleClick,
3531
+ onKeyDown: handleKeyDown,
3532
+ "aria-pressed": selected,
3533
+ ...props,
3534
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3535
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3536
+ Text_default,
3537
+ {
3538
+ size: "md",
3539
+ weight: "bold",
3540
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
3541
+ children: title
3542
+ }
3543
+ ),
3544
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
3545
+ duration && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
3546
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Clock, { size: 16, className: "text-text-700" }),
3547
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3548
+ Text_default,
3549
+ {
3550
+ size: "sm",
3551
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
3552
+ children: duration
3553
+ }
3554
+ )
3555
+ ] }),
3556
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3557
+ Text_default,
3558
+ {
3559
+ size: "sm",
3560
+ className: "text-text-700 leading-[21px] flex-grow truncate",
3561
+ children: displayInfo
3562
+ }
3563
+ )
3564
+ ] })
3565
+ ] })
3566
+ }
3567
+ );
3568
+ }
3569
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3570
+ "div",
3571
+ {
3572
+ ref,
3573
+ className: cn(`${baseClasses} ${className}`.trim()),
3574
+ ...props,
3575
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3576
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3577
+ Text_default,
3578
+ {
3579
+ size: "md",
3580
+ weight: "bold",
3581
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
3582
+ children: title
3583
+ }
3584
+ ),
3585
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
3586
+ duration && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
3587
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_phosphor_react5.Clock, { size: 16, className: "text-text-700" }),
3588
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3589
+ Text_default,
3590
+ {
3591
+ size: "sm",
3592
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
3593
+ children: duration
3594
+ }
3595
+ )
3596
+ ] }),
3597
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3598
+ Text_default,
3599
+ {
3600
+ size: "sm",
3601
+ className: "text-text-700 leading-[21px] flex-grow truncate min-w-0",
3602
+ children: displayInfo
3603
+ }
3604
+ )
3605
+ ] })
3606
+ ] })
3607
+ }
3608
+ );
3609
+ }
3610
+ );
3611
+ var SIMULATION_TYPE_STYLES = {
3612
+ enem: {
3613
+ background: "bg-exam-1",
3614
+ badge: "exam1",
3615
+ text: "Enem"
3616
+ },
3617
+ prova: {
3618
+ background: "bg-exam-2",
3619
+ badge: "exam2",
3620
+ text: "Prova"
3621
+ },
3622
+ simulado: {
3623
+ background: "bg-exam-3",
3624
+ badge: "exam3",
3625
+ text: "Simulad\xE3o"
3626
+ },
3627
+ vestibular: {
3628
+ background: "bg-exam-4",
3629
+ badge: "exam4",
3630
+ text: "Vestibular"
3631
+ }
3632
+ };
3633
+ var CardSimulationHistory = (0, import_react10.forwardRef)(({ data, onSimulationClick, className, ...props }, ref) => {
3634
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3635
+ "div",
3636
+ {
3637
+ ref,
3638
+ className: cn("w-full max-w-[992px] h-auto", className),
3639
+ ...props,
3640
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-0", children: [
3641
+ data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3642
+ "div",
3643
+ {
3644
+ className: cn(
3645
+ "flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-background",
3646
+ sectionIndex === 0 ? "rounded-t-3xl" : ""
3647
+ ),
3648
+ children: [
3649
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3650
+ Text_default,
3651
+ {
3652
+ size: "xs",
3653
+ weight: "bold",
3654
+ className: "text-text-800 w-11 flex-shrink-0",
3655
+ children: section.date
3656
+ }
3657
+ ),
3658
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
3659
+ const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
3660
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3661
+ CardBase,
3662
+ {
3663
+ layout: "horizontal",
3664
+ padding: "medium",
3665
+ minHeight: "none",
3666
+ cursor: "pointer",
3667
+ className: cn(
3668
+ `${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
3669
+ transition-shadow duration-200 h-auto min-h-[61px]`
3670
+ ),
3671
+ onClick: () => onSimulationClick?.(simulation),
3672
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between items-center w-full gap-2", children: [
3673
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
3674
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3675
+ Text_default,
3676
+ {
3677
+ size: "lg",
3678
+ weight: "bold",
3679
+ className: "text-text-950 truncate",
3680
+ children: simulation.title
3681
+ }
3682
+ ),
3683
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2", children: [
3684
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3685
+ Badge_default,
3686
+ {
3687
+ variant: "examsOutlined",
3688
+ action: typeStyles.badge,
3689
+ size: "medium",
3690
+ children: typeStyles.text
3691
+ }
3692
+ ),
3693
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
3694
+ ] })
3695
+ ] }),
3696
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3697
+ import_phosphor_react5.CaretRight,
3698
+ {
3699
+ size: 24,
3700
+ className: "text-text-800 flex-shrink-0",
3701
+ "data-testid": "caret-icon"
3702
+ }
3703
+ )
3704
+ ] })
3705
+ },
3706
+ simulation.id
3707
+ );
3708
+ }) })
3709
+ ]
3710
+ }
3711
+ ) }, section.date)),
3712
+ data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
3713
+ ] })
3714
+ }
3715
+ );
3716
+ });
3717
+
3718
+ // src/components/Accordation/Accordation.tsx
3719
+ var import_phosphor_react6 = require("phosphor-react");
3720
+ var import_jsx_runtime25 = require("react/jsx-runtime");
3721
+ var CardAccordation = (0, import_react11.forwardRef)(
3722
+ ({
3723
+ trigger,
3724
+ children,
3725
+ className,
3726
+ defaultExpanded = false,
3727
+ expanded: controlledExpanded,
3728
+ onToggleExpanded,
3729
+ value,
3730
+ disabled = false,
3731
+ triggerClassName,
3732
+ contentClassName,
3733
+ ...props
3734
+ }, ref) => {
3735
+ const [internalExpanded, setInternalExpanded] = (0, import_react11.useState)(defaultExpanded);
3736
+ const generatedId = (0, import_react11.useId)();
3737
+ const contentId = value ? `accordion-content-${value}` : generatedId;
3738
+ const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
3739
+ const isControlled = controlledExpanded !== void 0;
3740
+ const isExpanded = isControlled ? controlledExpanded : internalExpanded;
3741
+ (0, import_react11.useEffect)(() => {
3742
+ if (isControlled) {
3743
+ setInternalExpanded(controlledExpanded);
3744
+ }
3745
+ }, [isControlled, controlledExpanded]);
3746
+ const handleToggle = () => {
3747
+ if (disabled) return;
3748
+ const newExpanded = !isExpanded;
3749
+ if (!isControlled) {
3750
+ setInternalExpanded(newExpanded);
3751
+ }
3752
+ onToggleExpanded?.(newExpanded);
3753
+ };
3754
+ const handleKeyDown = (event) => {
3755
+ if (disabled) return;
3756
+ if (event.key === "Enter" || event.key === " ") {
3757
+ event.preventDefault();
3758
+ handleToggle();
3759
+ }
3760
+ };
3761
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3762
+ CardBase,
3763
+ {
3764
+ ref,
3765
+ layout: "vertical",
3766
+ padding: "none",
3767
+ minHeight: "none",
3768
+ className: cn("overflow-hidden", className),
3769
+ ...props,
3770
+ children: [
3771
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3772
+ "button",
3773
+ {
3774
+ id: headerId,
3775
+ type: "button",
3776
+ onClick: handleToggle,
3777
+ onKeyDown: handleKeyDown,
3778
+ disabled,
3779
+ className: cn(
3780
+ "w-full cursor-pointer not-aria-expanded:rounded-xl aria-expanded:rounded-t-xl flex items-center justify-between gap-3 text-left transition-colors duration-200 focus:outline-none focus:border-2 focus:border-primary-950 focus:ring-inset px-2",
3781
+ disabled && "cursor-not-allowed text-text-400",
3782
+ triggerClassName
3783
+ ),
3784
+ "aria-expanded": isExpanded,
3785
+ "aria-controls": contentId,
3786
+ "aria-disabled": disabled,
3787
+ "data-value": value,
3788
+ children: [
3789
+ trigger,
3790
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3791
+ import_phosphor_react6.CaretRight,
3792
+ {
3793
+ size: 20,
3794
+ className: cn(
3795
+ "transition-transform duration-200 flex-shrink-0",
3796
+ disabled ? "text-gray-400" : "text-text-700",
3797
+ isExpanded ? "rotate-90" : "rotate-0"
3798
+ ),
3799
+ "data-testid": "accordion-caret"
3800
+ }
3801
+ )
3802
+ ]
3803
+ }
3804
+ ),
3805
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3806
+ "section",
3807
+ {
3808
+ id: contentId,
3809
+ "aria-labelledby": headerId,
3810
+ "aria-hidden": !isExpanded,
3811
+ className: cn(
3812
+ "transition-all duration-300 ease-in-out overflow-hidden",
3813
+ isExpanded ? "max-h-screen opacity-100" : "max-h-0 opacity-0"
3814
+ ),
3815
+ "data-testid": "accordion-content",
3816
+ "data-value": value,
3817
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cn("p-4 pt-0", contentClassName), children })
3818
+ }
3819
+ )
3820
+ ]
3821
+ }
3822
+ );
3823
+ }
3824
+ );
3825
+ CardAccordation.displayName = "CardAccordation";
3826
+
3827
+ // src/components/Alternative/Alternative.tsx
3828
+ var import_phosphor_react7 = require("phosphor-react");
3829
+
3830
+ // src/components/Radio/Radio.tsx
3831
+ var import_react12 = require("react");
3832
+ var import_zustand = require("zustand");
3833
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3834
+ var SIZE_CLASSES6 = {
3835
+ small: {
3836
+ radio: "w-5 h-5",
3837
+ textSize: "sm",
3838
+ spacing: "gap-1.5",
3839
+ borderWidth: "border-2",
3840
+ dotSize: "w-2.5 h-2.5",
3841
+ labelHeight: "h-5"
3842
+ },
3843
+ medium: {
3844
+ radio: "w-6 h-6",
3845
+ textSize: "md",
3846
+ spacing: "gap-2",
3847
+ borderWidth: "border-2",
3848
+ dotSize: "w-3 h-3",
3849
+ labelHeight: "h-6"
3850
+ },
3851
+ large: {
3852
+ radio: "w-7 h-7",
3853
+ textSize: "lg",
3854
+ spacing: "gap-2",
3855
+ borderWidth: "border-2",
3856
+ dotSize: "w-3.5 h-3.5",
3857
+ labelHeight: "h-7"
3858
+ },
3859
+ extraLarge: {
3860
+ radio: "w-8 h-8",
3861
+ textSize: "xl",
3862
+ spacing: "gap-3",
3863
+ borderWidth: "border-2",
3864
+ dotSize: "w-4 h-4",
3865
+ labelHeight: "h-8"
3866
+ }
3867
+ };
3868
+ var BASE_RADIO_CLASSES = "rounded-full border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
3869
+ var STATE_CLASSES = {
3870
+ default: {
3871
+ unchecked: "border-border-400 bg-background hover:border-border-500",
3872
+ checked: "border-primary-950 bg-background hover:border-primary-800"
3873
+ },
3874
+ hovered: {
3875
+ unchecked: "border-border-500 bg-background",
3876
+ checked: "border-info-700 bg-background"
3877
+ },
3878
+ focused: {
3879
+ unchecked: "border-border-400 bg-background",
3880
+ checked: "border-primary-950 bg-background"
3881
+ },
3882
+ invalid: {
3883
+ unchecked: "border-border-400 bg-background",
3884
+ checked: "border-primary-950 bg-background"
3885
+ },
3886
+ disabled: {
3887
+ unchecked: "border-border-400 bg-background cursor-not-allowed",
3888
+ checked: "border-primary-950 bg-background cursor-not-allowed"
3889
+ }
3890
+ };
3891
+ var DOT_CLASSES = {
3892
+ default: "bg-primary-950",
3893
+ hovered: "bg-info-700",
3894
+ focused: "bg-primary-950",
3895
+ invalid: "bg-primary-950",
3896
+ disabled: "bg-primary-950"
3897
+ };
3898
+ var Radio = (0, import_react12.forwardRef)(
3899
+ ({
3900
+ label,
3901
+ size = "medium",
3902
+ state = "default",
3903
+ errorMessage,
3904
+ helperText,
3905
+ className = "",
3906
+ labelClassName = "",
3907
+ checked: checkedProp,
3908
+ defaultChecked = false,
3909
+ disabled,
3910
+ id,
3911
+ name,
3912
+ value,
3913
+ onChange,
3914
+ ...props
3915
+ }, ref) => {
3916
+ const generatedId = (0, import_react12.useId)();
3917
+ const inputId = id ?? `radio-${generatedId}`;
3918
+ const inputRef = (0, import_react12.useRef)(null);
3919
+ const [internalChecked, setInternalChecked] = (0, import_react12.useState)(defaultChecked);
3920
+ const isControlled = checkedProp !== void 0;
3921
+ const checked = isControlled ? checkedProp : internalChecked;
3922
+ const handleChange = (event) => {
3923
+ const newChecked = event.target.checked;
3924
+ if (!isControlled) {
3925
+ setInternalChecked(newChecked);
3926
+ }
3927
+ if (event.target) {
3928
+ event.target.blur();
3929
+ }
3930
+ onChange?.(event);
3931
+ };
3932
+ const currentState = disabled ? "disabled" : state;
3933
+ const sizeClasses = SIZE_CLASSES6[size];
3934
+ const actualRadioSize = sizeClasses.radio;
3935
+ const actualDotSize = sizeClasses.dotSize;
3936
+ const radioVariant = checked ? "checked" : "unchecked";
3937
+ const stylingClasses = STATE_CLASSES[currentState][radioVariant];
3938
+ const getBorderWidth = () => {
3939
+ if (currentState === "focused") {
3940
+ return "border-2";
3941
+ }
3942
+ return sizeClasses.borderWidth;
3943
+ };
3944
+ const borderWidthClass = getBorderWidth();
3945
+ const radioClasses = cn(
3946
+ BASE_RADIO_CLASSES,
3947
+ actualRadioSize,
3948
+ borderWidthClass,
3949
+ stylingClasses,
3950
+ className
3951
+ );
3952
+ const dotClasses = cn(
3953
+ actualDotSize,
3954
+ "rounded-full",
3955
+ DOT_CLASSES[currentState],
3956
+ "transition-all duration-200"
3957
+ );
3958
+ const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
3959
+ const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
3960
+ const getTextColor = () => {
3961
+ if (currentState === "disabled") {
3962
+ return checked ? "text-text-900" : "text-text-600";
3963
+ }
3964
+ if (currentState === "focused") {
3965
+ return "text-text-900";
3966
+ }
3967
+ return checked ? "text-text-900" : "text-text-600";
3968
+ };
3969
+ const getCursorClass = () => {
3970
+ return currentState === "disabled" ? "cursor-not-allowed" : "cursor-pointer";
3971
+ };
3972
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col", children: [
3973
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3974
+ "div",
3975
+ {
3976
+ className: cn(
3977
+ "flex flex-row items-center",
3978
+ isWrapperNeeded ? cn("p-1 border-2", wrapperBorderColor, "rounded-lg gap-1.5") : sizeClasses.spacing,
3979
+ disabled ? "opacity-40" : ""
3980
+ ),
3981
+ children: [
3982
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3983
+ "input",
3984
+ {
3985
+ ref: (node) => {
3986
+ inputRef.current = node;
3987
+ if (typeof ref === "function") ref(node);
3988
+ else if (ref) ref.current = node;
3989
+ },
3990
+ type: "radio",
3991
+ id: inputId,
3992
+ checked,
3993
+ disabled,
3994
+ name,
3995
+ value,
3996
+ onChange: handleChange,
3997
+ className: "sr-only",
3998
+ style: {
3999
+ position: "absolute",
4000
+ left: "-9999px",
4001
+ visibility: "hidden"
4002
+ },
4003
+ ...props
4004
+ }
4005
+ ),
4006
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4007
+ "button",
4008
+ {
4009
+ type: "button",
4010
+ className: radioClasses,
4011
+ disabled,
4012
+ "aria-pressed": checked,
4013
+ onClick: (e) => {
4014
+ e.preventDefault();
4015
+ if (!disabled) {
4016
+ if (inputRef.current) {
4017
+ inputRef.current.click();
4018
+ inputRef.current.blur();
4019
+ }
4020
+ }
4021
+ },
4022
+ onKeyDown: (e) => {
4023
+ if ((e.key === "Enter" || e.key === " ") && !disabled) {
4024
+ e.preventDefault();
4025
+ if (inputRef.current) {
4026
+ inputRef.current.click();
4027
+ inputRef.current.blur();
4028
+ }
4029
+ }
4030
+ },
4031
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: dotClasses })
4032
+ }
4033
+ ),
4034
+ label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4035
+ "div",
4036
+ {
4037
+ className: cn(
4038
+ "flex flex-row items-center",
4039
+ sizeClasses.labelHeight,
4040
+ "flex-1 min-w-0"
4041
+ ),
4042
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4043
+ Text_default,
4044
+ {
4045
+ as: "label",
4046
+ htmlFor: inputId,
4047
+ size: sizeClasses.textSize,
4048
+ weight: "normal",
4049
+ className: cn(
4050
+ getCursorClass(),
4051
+ "select-none leading-normal flex items-center font-roboto truncate",
4052
+ labelClassName
4053
+ ),
4054
+ color: getTextColor(),
4055
+ children: label
4056
+ }
4057
+ )
4058
+ }
4059
+ )
4060
+ ]
4061
+ }
4062
+ ),
4063
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4064
+ Text_default,
4065
+ {
4066
+ size: "sm",
4067
+ weight: "normal",
4068
+ className: "mt-1.5 truncate",
4069
+ color: "text-error-600",
4070
+ children: errorMessage
4071
+ }
4072
+ ),
4073
+ helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4074
+ Text_default,
4075
+ {
4076
+ size: "sm",
4077
+ weight: "normal",
4078
+ className: "mt-1.5 truncate",
4079
+ color: "text-text-500",
4080
+ children: helperText
4081
+ }
4082
+ )
4083
+ ] });
4084
+ }
4085
+ );
4086
+ Radio.displayName = "Radio";
4087
+ var createRadioGroupStore = (name, defaultValue, disabled, onValueChange) => (0, import_zustand.create)((set, get) => ({
4088
+ value: defaultValue,
4089
+ setValue: (value) => {
4090
+ if (!get().disabled) {
4091
+ set({ value });
4092
+ get().onValueChange?.(value);
4093
+ }
4094
+ },
4095
+ onValueChange,
4096
+ disabled,
4097
+ name
4098
+ }));
4099
+ var useRadioGroupStore = (externalStore) => {
4100
+ if (!externalStore) {
4101
+ throw new Error("RadioGroupItem must be used within a RadioGroup");
4102
+ }
4103
+ return externalStore;
4104
+ };
4105
+ var injectStore = (children, store) => import_react12.Children.map(children, (child) => {
4106
+ if (!(0, import_react12.isValidElement)(child)) return child;
4107
+ const typedChild = child;
4108
+ const shouldInject = typedChild.type === RadioGroupItem;
4109
+ return (0, import_react12.cloneElement)(typedChild, {
4110
+ ...shouldInject ? { store } : {},
4111
+ ...typedChild.props.children ? { children: injectStore(typedChild.props.children, store) } : {}
4112
+ });
4113
+ });
4114
+ var RadioGroup = (0, import_react12.forwardRef)(
4115
+ ({
4116
+ value: propValue,
4117
+ defaultValue = "",
4118
+ onValueChange,
4119
+ name: propName,
4120
+ disabled = false,
4121
+ className = "",
4122
+ children,
4123
+ ...props
4124
+ }, ref) => {
4125
+ const generatedId = (0, import_react12.useId)();
4126
+ const name = propName || `radio-group-${generatedId}`;
4127
+ const storeRef = (0, import_react12.useRef)(null);
4128
+ storeRef.current ??= createRadioGroupStore(
4129
+ name,
4130
+ defaultValue,
4131
+ disabled,
4132
+ onValueChange
4133
+ );
4134
+ const store = storeRef.current;
4135
+ const { setValue } = (0, import_zustand.useStore)(store, (s) => s);
4136
+ (0, import_react12.useEffect)(() => {
4137
+ const currentValue = store.getState().value;
4138
+ if (currentValue && onValueChange) {
4139
+ onValueChange(currentValue);
4140
+ }
4141
+ }, []);
4142
+ (0, import_react12.useEffect)(() => {
4143
+ if (propValue !== void 0) {
4144
+ setValue(propValue);
4145
+ }
4146
+ }, [propValue, setValue]);
4147
+ (0, import_react12.useEffect)(() => {
4148
+ store.setState({ disabled });
4149
+ }, [disabled, store]);
4150
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4151
+ "div",
4152
+ {
4153
+ ref,
4154
+ className,
4155
+ role: "radiogroup",
4156
+ "aria-label": name,
4157
+ ...props,
4158
+ children: injectStore(children, store)
4159
+ }
4160
+ );
4161
+ }
4162
+ );
4163
+ RadioGroup.displayName = "RadioGroup";
4164
+ var RadioGroupItem = (0, import_react12.forwardRef)(
4165
+ ({
4166
+ value,
4167
+ store: externalStore,
4168
+ disabled: itemDisabled,
4169
+ size = "medium",
4170
+ state = "default",
4171
+ className = "",
4172
+ id,
4173
+ ...props
4174
+ }, ref) => {
4175
+ const store = useRadioGroupStore(externalStore);
4176
+ const {
4177
+ value: groupValue,
4178
+ setValue,
4179
+ disabled: groupDisabled,
4180
+ name
4181
+ } = (0, import_zustand.useStore)(store);
4182
+ const generatedId = (0, import_react12.useId)();
4183
+ const inputId = id ?? `radio-item-${generatedId}`;
4184
+ const isChecked = groupValue === value;
4185
+ const isDisabled = groupDisabled || itemDisabled;
4186
+ const currentState = isDisabled ? "disabled" : state;
4187
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4188
+ Radio,
4189
+ {
4190
+ ref,
4191
+ id: inputId,
4192
+ name,
4193
+ value,
4194
+ checked: isChecked,
4195
+ disabled: isDisabled,
4196
+ size,
4197
+ state: currentState,
4198
+ className,
4199
+ onChange: (e) => {
4200
+ if (e.target.checked && !isDisabled) {
4201
+ setValue(value);
4202
+ }
4203
+ },
4204
+ ...props
4205
+ }
4206
+ );
4207
+ }
4208
+ );
4209
+ RadioGroupItem.displayName = "RadioGroupItem";
4210
+
4211
+ // src/components/Alternative/Alternative.tsx
4212
+ var import_react13 = require("react");
4213
+ var import_jsx_runtime27 = require("react/jsx-runtime");
4214
+ var AlternativesList = ({
4215
+ alternatives,
4216
+ name,
4217
+ defaultValue,
4218
+ value,
4219
+ onValueChange,
4220
+ disabled = false,
4221
+ layout = "default",
4222
+ className = "",
4223
+ mode = "interactive",
4224
+ selectedValue
4225
+ }) => {
4226
+ const uniqueId = (0, import_react13.useId)();
4227
+ const groupName = name || `alternatives-${uniqueId}`;
4228
+ const [actualValue, setActualValue] = (0, import_react13.useState)(value);
4229
+ const isReadonly = mode === "readonly";
4230
+ const getStatusStyles = (status, isReadonly2) => {
4231
+ const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
4232
+ switch (status) {
4233
+ case "correct":
4234
+ return "bg-success-background border-success-300";
4235
+ case "incorrect":
4236
+ return "bg-error-background border-error-300";
4237
+ default:
4238
+ return `bg-background border-border-100 ${hoverClass}`;
4239
+ }
4240
+ };
4241
+ const getStatusBadge = (status) => {
4242
+ switch (status) {
4243
+ case "correct":
4244
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_phosphor_react7.CheckCircle, {}), children: "Resposta correta" });
4245
+ case "incorrect":
4246
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_phosphor_react7.XCircle, {}), children: "Resposta incorreta" });
4247
+ default:
4248
+ return null;
4249
+ }
4250
+ };
4251
+ const getLayoutClasses = () => {
4252
+ switch (layout) {
4253
+ case "compact":
4254
+ return "gap-2";
4255
+ case "detailed":
4256
+ return "gap-4";
4257
+ default:
4258
+ return "gap-3.5";
4259
+ }
4260
+ };
4261
+ const renderReadonlyAlternative = (alternative) => {
4262
+ const alternativeId = alternative.value;
4263
+ const isUserSelected = selectedValue === alternative.value;
4264
+ const isCorrectAnswer = alternative.status === "correct";
4265
+ let displayStatus = void 0;
4266
+ if (isUserSelected && !isCorrectAnswer) {
4267
+ displayStatus = "incorrect";
4268
+ } else if (isCorrectAnswer) {
4269
+ displayStatus = "correct";
4270
+ }
4271
+ const statusStyles = getStatusStyles(displayStatus, true);
4272
+ const statusBadge = getStatusBadge(displayStatus);
4273
+ const renderRadio = () => {
4274
+ 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"}`;
4275
+ const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
4276
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: dotClasses }) });
4277
+ };
4278
+ if (layout === "detailed") {
4279
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4280
+ "div",
4281
+ {
4282
+ className: cn(
4283
+ "border-2 rounded-lg p-4 w-full",
4284
+ statusStyles,
4285
+ alternative.disabled ? "opacity-50" : ""
4286
+ ),
4287
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
4288
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
4289
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mt-1", children: renderRadio() }),
4290
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1", children: [
4291
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4292
+ "p",
4293
+ {
4294
+ className: cn(
4295
+ "block font-medium",
4296
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
4297
+ ),
4298
+ children: alternative.label
4299
+ }
4300
+ ),
4301
+ alternative.description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
4302
+ ] })
4303
+ ] }),
4304
+ statusBadge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
4305
+ ] })
4306
+ },
4307
+ alternativeId
4308
+ );
4309
+ }
4310
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4311
+ "div",
4312
+ {
4313
+ className: cn(
4314
+ "flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
4315
+ statusStyles,
4316
+ alternative.disabled ? "opacity-50" : ""
4317
+ ),
4318
+ children: [
4319
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
4320
+ renderRadio(),
4321
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4322
+ "span",
4323
+ {
4324
+ className: cn(
4325
+ "flex-1",
4326
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
4327
+ ),
4328
+ children: alternative.label
4329
+ }
4330
+ )
4331
+ ] }),
4332
+ statusBadge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
4333
+ ]
4334
+ },
4335
+ alternativeId
4336
+ );
4337
+ };
4338
+ if (isReadonly) {
4339
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4340
+ "div",
4341
+ {
4342
+ className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
4343
+ children: alternatives.map(
4344
+ (alternative) => renderReadonlyAlternative(alternative)
4345
+ )
4346
+ }
4347
+ );
4348
+ }
4349
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4350
+ RadioGroup,
4351
+ {
4352
+ name: groupName,
4353
+ defaultValue,
4354
+ value,
4355
+ onValueChange: (value2) => {
4356
+ setActualValue(value2);
4357
+ onValueChange?.(value2);
4358
+ },
4359
+ disabled,
4360
+ className: cn("flex flex-col", getLayoutClasses(), className),
4361
+ children: alternatives.map((alternative, index) => {
4362
+ const alternativeId = alternative.value || `alt-${index}`;
4363
+ const statusStyles = getStatusStyles(alternative.status, false);
4364
+ const statusBadge = getStatusBadge(alternative.status);
4365
+ if (layout === "detailed") {
4366
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4367
+ "div",
4368
+ {
4369
+ className: cn(
4370
+ "border-2 rounded-lg p-4 transition-all",
4371
+ statusStyles,
4372
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
4373
+ ),
4374
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
4375
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
4376
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4377
+ RadioGroupItem,
4378
+ {
4379
+ value: alternative.value,
4380
+ id: alternativeId,
4381
+ disabled: alternative.disabled,
4382
+ className: "mt-1"
4383
+ }
4384
+ ),
4385
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1", children: [
4386
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4387
+ "label",
4388
+ {
4389
+ htmlFor: alternativeId,
4390
+ className: cn(
4391
+ "block font-medium",
4392
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
4393
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
4394
+ ),
4395
+ children: alternative.label
4396
+ }
4397
+ ),
4398
+ alternative.description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
4399
+ ] })
4400
+ ] }),
4401
+ statusBadge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
4402
+ ] })
4403
+ },
4404
+ alternativeId
4405
+ );
4406
+ }
4407
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4408
+ "div",
4409
+ {
4410
+ className: cn(
4411
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
4412
+ statusStyles,
4413
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
4414
+ ),
4415
+ children: [
4416
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
4417
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4418
+ RadioGroupItem,
4419
+ {
4420
+ value: alternative.value,
4421
+ id: alternativeId,
4422
+ disabled: alternative.disabled
4423
+ }
4424
+ ),
4425
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4426
+ "label",
4427
+ {
4428
+ htmlFor: alternativeId,
4429
+ className: cn(
4430
+ "flex-1",
4431
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
4432
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
4433
+ ),
4434
+ children: alternative.label
4435
+ }
4436
+ )
4437
+ ] }),
4438
+ statusBadge && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
4439
+ ]
4440
+ },
4441
+ alternativeId
4442
+ );
4443
+ })
4444
+ }
4445
+ );
4446
+ };
4447
+ var HeaderAlternative = (0, import_react13.forwardRef)(
4448
+ ({ className, title, subTitle, content, ...props }, ref) => {
4449
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4450
+ "div",
4451
+ {
4452
+ ref,
4453
+ className: cn(
4454
+ "bg-background p-4 flex flex-col gap-4 rounded-xl",
4455
+ className
4456
+ ),
4457
+ ...props,
4458
+ children: [
4459
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "flex flex-col", children: [
4460
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-text-950 font-bold text-lg", children: title }),
4461
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-text-700 text-sm ", children: subTitle })
4462
+ ] }),
4463
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-text-950 text-md", children: content })
4464
+ ]
4465
+ }
4466
+ );
4467
+ }
4468
+ );
4469
+
4470
+ // src/components/RecommendedLessonDetails/types.ts
4471
+ var DEFAULT_LABELS = {
4472
+ viewLesson: "Ver aula",
4473
+ viewPerformance: "Ver desempenho",
4474
+ resultsTitle: "Resultados da aula recomendada",
4475
+ completedLabel: "CONCLU\xCDDO",
4476
+ bestResultLabel: "MELHOR RESULTADO",
4477
+ hardestTopicLabel: "MAIOR DIFICULDADE",
4478
+ studentColumn: "Aluno",
4479
+ statusColumn: "Status",
4480
+ completionColumn: "Conclus\xE3o",
4481
+ durationColumn: "Dura\xE7\xE3o"
4482
+ };
4483
+ var DEFAULT_PERFORMANCE_LABELS = {
4484
+ title: "Desempenho",
4485
+ correctAnswersLabel: "N\xB0 DE QUEST\xD5ES CORRETAS",
4486
+ incorrectAnswersLabel: "N\xB0 DE QUEST\xD5ES INCORRETAS",
4487
+ bestResultLabel: "MELHOR RESULTADO",
4488
+ hardestTopicLabel: "MAIOR DIFICULDADE",
4489
+ lessonsTitle: "Aulas"
4490
+ };
4491
+
4492
+ // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
4493
+ var import_jsx_runtime28 = require("react/jsx-runtime");
4494
+ var PerformanceCard = ({
4495
+ icon,
4496
+ label,
4497
+ value,
4498
+ secondaryLabel,
4499
+ secondaryValue,
4500
+ variant
4501
+ }) => {
4502
+ const headerBgColor = {
4503
+ success: "bg-success-200",
4504
+ error: "bg-error-100"
4505
+ }[variant];
4506
+ const valueColor = {
4507
+ success: "text-success-700",
4508
+ error: "text-error-700"
4509
+ }[variant];
4510
+ const iconBgColor = {
4511
+ success: "bg-warning-300",
4512
+ error: "bg-error-300"
4513
+ }[variant];
4514
+ const secondaryLabelColor = {
4515
+ success: "text-success-600",
4516
+ error: "text-error-600"
4517
+ }[variant];
4518
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col rounded-xl border border-border-50 bg-background overflow-hidden", children: [
4519
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4520
+ "div",
4521
+ {
4522
+ className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
4523
+ children: [
4524
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4525
+ Text_default,
4526
+ {
4527
+ as: "span",
4528
+ className: `size-8 rounded-full flex items-center justify-center ${iconBgColor}`,
4529
+ children: icon
4530
+ }
4531
+ ),
4532
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4533
+ Text_default,
4534
+ {
4535
+ size: "2xs",
4536
+ weight: "medium",
4537
+ className: "text-text-800 uppercase text-center leading-none",
4538
+ children: label
4539
+ }
4540
+ ),
4541
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
4542
+ ]
4543
+ }
4544
+ ),
4545
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
4546
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4547
+ Text_default,
4548
+ {
4549
+ size: "2xs",
4550
+ weight: "medium",
4551
+ className: `${secondaryLabelColor} uppercase text-center`,
4552
+ children: secondaryLabel
4553
+ }
4554
+ ),
4555
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
4556
+ ] })
4557
+ ] });
4558
+ };
4559
+ var getAlternativeStatus = (isCorrect, isSelected) => {
4560
+ if (isCorrect) {
4561
+ return "correct";
4562
+ }
4563
+ if (isSelected) {
4564
+ return "incorrect";
4565
+ }
4566
+ return void 0;
4567
+ };
4568
+ var mapAlternatives = (question) => {
4569
+ return question.alternatives.map((alt) => ({
4570
+ value: alt.id,
4571
+ label: alt.text,
4572
+ status: getAlternativeStatus(alt.isCorrect, alt.isSelected)
4573
+ }));
4574
+ };
4575
+ var getSelectedValue = (question) => {
4576
+ const selected = question.alternatives.find((alt) => alt.isSelected);
4577
+ return selected?.id;
4578
+ };
4579
+ var QuestionAccordionItem = ({
4580
+ question,
4581
+ index
4582
+ }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4583
+ CardAccordation,
4584
+ {
4585
+ value: question.id,
4586
+ className: "bg-background rounded-xl border border-border-50",
4587
+ triggerClassName: "py-5 px-5",
4588
+ contentClassName: "px-5 pb-5",
4589
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between flex-1", children: [
4590
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: [
4591
+ "Quest\xE3o ",
4592
+ index + 1
4593
+ ] }),
4594
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4595
+ Badge_default,
4596
+ {
4597
+ size: "small",
4598
+ action: question.isCorrect ? "success" : "error",
4599
+ variant: "solid",
4600
+ iconLeft: question.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react15.CheckCircleIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react15.XCircleIcon, {}),
4601
+ children: question.isCorrect ? "Correta" : "Incorreta"
4602
+ }
4603
+ )
4604
+ ] }),
4605
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-3", children: [
4606
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
4607
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4608
+ CardAccordation,
4609
+ {
4610
+ value: `${question.id}-alternatives`,
4611
+ className: "bg-background rounded-lg border border-border-50",
4612
+ triggerClassName: "py-5 px-5",
4613
+ contentClassName: "px-5 py-5",
4614
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
4615
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4616
+ AlternativesList,
4617
+ {
4618
+ mode: "readonly",
4619
+ alternatives: mapAlternatives(question),
4620
+ selectedValue: getSelectedValue(question),
4621
+ layout: "default"
4622
+ }
4623
+ )
4624
+ }
4625
+ )
4626
+ ] })
4627
+ }
4628
+ );
4629
+ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4630
+ CardAccordation,
4631
+ {
4632
+ value: lesson.id,
4633
+ className: "bg-background rounded-xl border border-border-50",
4634
+ triggerClassName: "py-5 px-5",
4635
+ contentClassName: "px-5 pb-5",
4636
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-1 flex-1", children: [
4637
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
4638
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4639
+ ProgressBar_default,
4640
+ {
4641
+ value: lesson.progress,
4642
+ variant: "blue",
4643
+ size: "medium",
4644
+ showPercentage: true,
4645
+ layout: "default"
4646
+ }
4647
+ )
4648
+ ] }),
4649
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4650
+ QuestionAccordionItem,
4651
+ {
4652
+ question,
4653
+ index
4654
+ },
4655
+ question.id
4656
+ )) })
4657
+ }
4658
+ );
4659
+ var LoadingSkeleton2 = () => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-4 animate-pulse", children: [
4660
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-6 bg-background-200 rounded w-48" }),
4661
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
4662
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" }),
4663
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-44 bg-background-200 rounded-xl" })
4664
+ ] })
4665
+ ] });
4666
+ var PerformanceContent = ({
4667
+ data,
4668
+ labels
4669
+ }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-5", children: [
4670
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
4671
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4672
+ Text_default,
4673
+ {
4674
+ as: "span",
4675
+ className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
4676
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react15.UserIcon, { size: 16, className: "text-text-500" })
4677
+ }
4678
+ ),
4679
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
4680
+ ] }),
4681
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
4682
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4683
+ PerformanceCard,
4684
+ {
4685
+ icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4686
+ import_react15.LightbulbFilamentIcon,
4687
+ {
4688
+ size: 18,
4689
+ weight: "fill",
4690
+ className: "text-white"
4691
+ }
4692
+ ),
4693
+ label: labels.correctAnswersLabel,
4694
+ value: data.correctAnswers,
4695
+ secondaryLabel: labels.bestResultLabel,
4696
+ secondaryValue: data.bestResult,
4697
+ variant: "success"
4698
+ }
4699
+ ),
4700
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4701
+ PerformanceCard,
4702
+ {
4703
+ icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4704
+ import_react15.WarningCircleIcon,
4705
+ {
4706
+ size: 18,
4707
+ weight: "fill",
4708
+ className: "text-error-700"
4709
+ }
4710
+ ),
4711
+ label: labels.incorrectAnswersLabel,
4712
+ value: data.incorrectAnswers,
4713
+ secondaryLabel: labels.hardestTopicLabel,
4714
+ secondaryValue: data.hardestTopic,
4715
+ variant: "error"
4716
+ }
4717
+ )
4718
+ ] }),
4719
+ data.lessons.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-3", children: [
4720
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
4721
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LessonAccordionItem, { lesson }, lesson.id)) })
4722
+ ] })
4723
+ ] });
4724
+ var renderModalContent = (loading, data, labels) => {
4725
+ if (loading) {
4726
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LoadingSkeleton2, {});
4727
+ }
4728
+ if (data) {
4729
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PerformanceContent, { data, labels });
4730
+ }
4731
+ return null;
4732
+ };
4733
+ var StudentPerformanceModal = ({
4734
+ isOpen,
4735
+ onClose,
4736
+ data,
4737
+ loading = false,
4738
+ labels: customLabels
4739
+ }) => {
4740
+ const labels = (0, import_react14.useMemo)(
4741
+ () => ({ ...DEFAULT_PERFORMANCE_LABELS, ...customLabels }),
4742
+ [customLabels]
4743
+ );
4744
+ if (!data && !loading) {
4745
+ return null;
4746
+ }
4747
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4748
+ Modal_default,
4749
+ {
4750
+ isOpen,
4751
+ onClose,
4752
+ title: labels.title,
4753
+ size: "lg",
4754
+ contentClassName: "max-h-[70vh] overflow-y-auto",
4755
+ children: renderModalContent(loading, data, labels)
4756
+ }
4757
+ );
4758
+ };
4759
+
4760
+ // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
4761
+ var import_jsx_runtime29 = require("react/jsx-runtime");
2159
4762
  var RecommendedLessonDetails = ({
2160
4763
  data,
2161
4764
  loading = false,
@@ -2168,11 +4771,11 @@ var RecommendedLessonDetails = ({
2168
4771
  labels: customLabels,
2169
4772
  className
2170
4773
  }) => {
2171
- const labels = (0, import_react8.useMemo)(
4774
+ const labels = (0, import_react16.useMemo)(
2172
4775
  () => ({ ...DEFAULT_LABELS, ...customLabels }),
2173
4776
  [customLabels]
2174
4777
  );
2175
- const defaultBreadcrumbs = (0, import_react8.useMemo)(
4778
+ const defaultBreadcrumbs = (0, import_react16.useMemo)(
2176
4779
  () => [
2177
4780
  { label: "Aulas recomendadas", path: "/aulas-recomendadas" },
2178
4781
  { label: data?.goal.title || "Detalhes" }
@@ -2180,7 +4783,7 @@ var RecommendedLessonDetails = ({
2180
4783
  [data?.goal.title]
2181
4784
  );
2182
4785
  const breadcrumbItems = breadcrumbs || defaultBreadcrumbs;
2183
- const displayStudents = (0, import_react8.useMemo)(() => {
4786
+ const displayStudents = (0, import_react16.useMemo)(() => {
2184
4787
  if (!data?.details.students) return [];
2185
4788
  const deadline = data?.goal.finalDate;
2186
4789
  return data.details.students.map(
@@ -2188,17 +4791,17 @@ var RecommendedLessonDetails = ({
2188
4791
  );
2189
4792
  }, [data?.details.students, data?.goal.finalDate]);
2190
4793
  if (loading) {
2191
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4794
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2192
4795
  "div",
2193
4796
  {
2194
4797
  className: cn("flex flex-col gap-6", className),
2195
4798
  "data-testid": "lesson-details-loading",
2196
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LoadingSkeleton, {})
4799
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LoadingSkeleton, {})
2197
4800
  }
2198
4801
  );
2199
4802
  }
2200
4803
  if (error) {
2201
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4804
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2202
4805
  "div",
2203
4806
  {
2204
4807
  className: cn(
@@ -2206,21 +4809,21 @@ var RecommendedLessonDetails = ({
2206
4809
  className
2207
4810
  ),
2208
4811
  "data-testid": "lesson-details-error",
2209
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text_default, { size: "md", className: "text-error-700", children: error })
4812
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { size: "md", className: "text-error-700", children: error })
2210
4813
  }
2211
4814
  );
2212
4815
  }
2213
4816
  if (!data) {
2214
4817
  return null;
2215
4818
  }
2216
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
4819
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2217
4820
  "div",
2218
4821
  {
2219
4822
  className: cn("flex flex-col gap-6", className),
2220
4823
  "data-testid": "recommended-lesson-details",
2221
4824
  children: [
2222
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
2223
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4825
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
4826
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2224
4827
  LessonHeader,
2225
4828
  {
2226
4829
  data,
@@ -2229,8 +4832,8 @@ var RecommendedLessonDetails = ({
2229
4832
  viewLessonLabel: labels.viewLesson
2230
4833
  }
2231
4834
  ),
2232
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ResultsSection, { data, labels }),
2233
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4835
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ResultsSection, { data, labels }),
4836
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2234
4837
  StudentsTable,
2235
4838
  {
2236
4839
  students: displayStudents,
@@ -2245,6 +4848,7 @@ var RecommendedLessonDetails = ({
2245
4848
  var RecommendedLessonDetails_default = RecommendedLessonDetails;
2246
4849
  // Annotate the CommonJS export names for ESM import in node:
2247
4850
  0 && (module.exports = {
2248
- RecommendedLessonDetails
4851
+ RecommendedLessonDetails,
4852
+ StudentPerformanceModal
2249
4853
  });
2250
4854
  //# sourceMappingURL=index.js.map