analytica-frontend-lib 1.0.82 → 1.0.83

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 (40) hide show
  1. package/dist/Accordation/index.js +2 -2
  2. package/dist/Accordation/index.js.map +1 -1
  3. package/dist/Accordation/index.mjs +2 -2
  4. package/dist/Accordation/index.mjs.map +1 -1
  5. package/dist/AlertDialog/index.js +1 -1
  6. package/dist/AlertDialog/index.js.map +1 -1
  7. package/dist/AlertDialog/index.mjs +1 -1
  8. package/dist/AlertDialog/index.mjs.map +1 -1
  9. package/dist/Card/index.js +2 -2
  10. package/dist/Card/index.js.map +1 -1
  11. package/dist/Card/index.mjs +2 -2
  12. package/dist/Card/index.mjs.map +1 -1
  13. package/dist/Modal/index.js +1 -1
  14. package/dist/Modal/index.js.map +1 -1
  15. package/dist/Modal/index.mjs +1 -1
  16. package/dist/Modal/index.mjs.map +1 -1
  17. package/dist/Quiz/index.d.mts +29 -0
  18. package/dist/Quiz/index.d.ts +29 -0
  19. package/dist/Quiz/index.js +3662 -0
  20. package/dist/Quiz/index.js.map +1 -0
  21. package/dist/Quiz/index.mjs +3673 -0
  22. package/dist/Quiz/index.mjs.map +1 -0
  23. package/dist/Quiz/useQuizStore/index.d.mts +108 -0
  24. package/dist/Quiz/useQuizStore/index.d.ts +108 -0
  25. package/dist/Quiz/useQuizStore/index.js +274 -0
  26. package/dist/Quiz/useQuizStore/index.js.map +1 -0
  27. package/dist/Quiz/useQuizStore/index.mjs +249 -0
  28. package/dist/Quiz/useQuizStore/index.mjs.map +1 -0
  29. package/dist/index.css +53 -0
  30. package/dist/index.css.map +1 -1
  31. package/dist/index.d.mts +2 -0
  32. package/dist/index.d.ts +2 -0
  33. package/dist/index.js +659 -4
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +657 -4
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/simulated-result-QN5HCUY5.png +0 -0
  38. package/dist/styles.css +53 -0
  39. package/dist/styles.css.map +1 -1
  40. package/package.json +2 -1
@@ -0,0 +1,3662 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/Quiz/Quiz.tsx
21
+ var Quiz_exports = {};
22
+ __export(Quiz_exports, {
23
+ Quiz: () => Quiz,
24
+ QuizAlternative: () => QuizAlternative,
25
+ QuizContent: () => QuizContent,
26
+ QuizFooter: () => QuizFooter,
27
+ QuizHeader: () => QuizHeader,
28
+ QuizQuestionList: () => QuizQuestionList,
29
+ QuizTitle: () => QuizTitle
30
+ });
31
+ module.exports = __toCommonJS(Quiz_exports);
32
+ var import_phosphor_react6 = require("phosphor-react");
33
+
34
+ // src/components/Badge/Badge.tsx
35
+ var import_phosphor_react = require("phosphor-react");
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var VARIANT_ACTION_CLASSES = {
38
+ solid: {
39
+ error: "bg-error-background text-error-700 focus-visible:outline-none",
40
+ warning: "bg-warning text-warning-800 focus-visible:outline-none",
41
+ success: "bg-success text-success-800 focus-visible:outline-none",
42
+ info: "bg-info text-info-800 focus-visible:outline-none",
43
+ muted: "bg-background-muted text-background-800 focus-visible:outline-none"
44
+ },
45
+ outlined: {
46
+ error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
47
+ warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
48
+ success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
49
+ info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
50
+ muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
51
+ },
52
+ exams: {
53
+ exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
54
+ exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
55
+ exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
56
+ exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
57
+ },
58
+ examsOutlined: {
59
+ exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
60
+ exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
61
+ exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
62
+ exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
63
+ },
64
+ resultStatus: {
65
+ negative: "bg-error text-error-800 focus-visible:outline-none",
66
+ positive: "bg-success text-success-800 focus-visible:outline-none"
67
+ },
68
+ notification: "text-primary"
69
+ };
70
+ var SIZE_CLASSES = {
71
+ small: "text-2xs px-2 py-1",
72
+ medium: "text-xs px-2 py-1",
73
+ large: "text-sm px-2 py-1"
74
+ };
75
+ var SIZE_CLASSES_ICON = {
76
+ small: "size-3",
77
+ medium: "size-3.5",
78
+ large: "size-4"
79
+ };
80
+ var Badge = ({
81
+ children,
82
+ iconLeft,
83
+ iconRight,
84
+ size = "medium",
85
+ variant = "solid",
86
+ action = "error",
87
+ className = "",
88
+ notificationActive = false,
89
+ ...props
90
+ }) => {
91
+ const sizeClasses = SIZE_CLASSES[size];
92
+ const sizeClassesIcon = SIZE_CLASSES_ICON[size];
93
+ const variantActionMap = VARIANT_ACTION_CLASSES[variant] || {};
94
+ const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
95
+ const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
96
+ const baseClassesIcon = "flex items-center";
97
+ if (variant === "notification") {
98
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
99
+ "div",
100
+ {
101
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
102
+ ...props,
103
+ children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_phosphor_react.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
105
+ notificationActive && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
+ "span",
107
+ {
108
+ "data-testid": "notification-dot",
109
+ className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
110
+ }
111
+ )
112
+ ]
113
+ }
114
+ );
115
+ }
116
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
117
+ "div",
118
+ {
119
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
120
+ ...props,
121
+ children: [
122
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
123
+ children,
124
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
125
+ ]
126
+ }
127
+ );
128
+ };
129
+ var Badge_default = Badge;
130
+
131
+ // src/components/Alternative/Alternative.tsx
132
+ var import_phosphor_react2 = require("phosphor-react");
133
+
134
+ // src/components/Radio/Radio.tsx
135
+ var import_react = require("react");
136
+ var import_zustand = require("zustand");
137
+
138
+ // src/components/Text/Text.tsx
139
+ var import_jsx_runtime2 = require("react/jsx-runtime");
140
+ var Text = ({
141
+ children,
142
+ size = "md",
143
+ weight = "normal",
144
+ color = "text-text-950",
145
+ as,
146
+ className = "",
147
+ ...props
148
+ }) => {
149
+ let sizeClasses = "";
150
+ let weightClasses = "";
151
+ const sizeClassMap = {
152
+ "2xs": "text-2xs",
153
+ xs: "text-xs",
154
+ sm: "text-sm",
155
+ md: "text-md",
156
+ lg: "text-lg",
157
+ xl: "text-xl",
158
+ "2xl": "text-2xl",
159
+ "3xl": "text-3xl",
160
+ "4xl": "text-4xl",
161
+ "5xl": "text-5xl",
162
+ "6xl": "text-6xl"
163
+ };
164
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
165
+ const weightClassMap = {
166
+ hairline: "font-hairline",
167
+ light: "font-light",
168
+ normal: "font-normal",
169
+ medium: "font-medium",
170
+ semibold: "font-semibold",
171
+ bold: "font-bold",
172
+ extrabold: "font-extrabold",
173
+ black: "font-black"
174
+ };
175
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
176
+ const baseClasses = "font-primary";
177
+ const Component = as ?? "p";
178
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
179
+ Component,
180
+ {
181
+ className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
182
+ ...props,
183
+ children
184
+ }
185
+ );
186
+ };
187
+ var Text_default = Text;
188
+
189
+ // src/components/Radio/Radio.tsx
190
+ var import_jsx_runtime3 = require("react/jsx-runtime");
191
+ var SIZE_CLASSES2 = {
192
+ small: {
193
+ radio: "w-5 h-5",
194
+ textSize: "sm",
195
+ spacing: "gap-1.5",
196
+ borderWidth: "border-2",
197
+ dotSize: "w-2.5 h-2.5",
198
+ labelHeight: "h-5"
199
+ },
200
+ medium: {
201
+ radio: "w-6 h-6",
202
+ textSize: "md",
203
+ spacing: "gap-2",
204
+ borderWidth: "border-2",
205
+ dotSize: "w-3 h-3",
206
+ labelHeight: "h-6"
207
+ },
208
+ large: {
209
+ radio: "w-7 h-7",
210
+ textSize: "lg",
211
+ spacing: "gap-2",
212
+ borderWidth: "border-2",
213
+ dotSize: "w-3.5 h-3.5",
214
+ labelHeight: "h-7"
215
+ },
216
+ extraLarge: {
217
+ radio: "w-8 h-8",
218
+ textSize: "xl",
219
+ spacing: "gap-3",
220
+ borderWidth: "border-2",
221
+ dotSize: "w-4 h-4",
222
+ labelHeight: "h-8"
223
+ }
224
+ };
225
+ var BASE_RADIO_CLASSES = "rounded-full border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
226
+ var STATE_CLASSES = {
227
+ default: {
228
+ unchecked: "border-border-400 bg-background hover:border-border-500",
229
+ checked: "border-primary-950 bg-background hover:border-primary-800"
230
+ },
231
+ hovered: {
232
+ unchecked: "border-border-500 bg-background",
233
+ checked: "border-info-700 bg-background"
234
+ },
235
+ focused: {
236
+ unchecked: "border-border-400 bg-background",
237
+ checked: "border-primary-950 bg-background"
238
+ },
239
+ invalid: {
240
+ unchecked: "border-border-400 bg-background",
241
+ checked: "border-primary-950 bg-background"
242
+ },
243
+ disabled: {
244
+ unchecked: "border-border-400 bg-background cursor-not-allowed",
245
+ checked: "border-primary-950 bg-background cursor-not-allowed"
246
+ }
247
+ };
248
+ var DOT_CLASSES = {
249
+ default: "bg-primary-950",
250
+ hovered: "bg-info-700",
251
+ focused: "bg-primary-950",
252
+ invalid: "bg-primary-950",
253
+ disabled: "bg-primary-950"
254
+ };
255
+ var Radio = (0, import_react.forwardRef)(
256
+ ({
257
+ label,
258
+ size = "medium",
259
+ state = "default",
260
+ errorMessage,
261
+ helperText,
262
+ className = "",
263
+ labelClassName = "",
264
+ checked: checkedProp,
265
+ defaultChecked = false,
266
+ disabled,
267
+ id,
268
+ name,
269
+ value,
270
+ onChange,
271
+ ...props
272
+ }, ref) => {
273
+ const generatedId = (0, import_react.useId)();
274
+ const inputId = id ?? `radio-${generatedId}`;
275
+ const inputRef = (0, import_react.useRef)(null);
276
+ const [internalChecked, setInternalChecked] = (0, import_react.useState)(defaultChecked);
277
+ const isControlled = checkedProp !== void 0;
278
+ const checked = isControlled ? checkedProp : internalChecked;
279
+ const handleChange = (event) => {
280
+ const newChecked = event.target.checked;
281
+ if (!isControlled) {
282
+ setInternalChecked(newChecked);
283
+ }
284
+ if (event.target) {
285
+ event.target.blur();
286
+ }
287
+ onChange?.(event);
288
+ };
289
+ const currentState = disabled ? "disabled" : state;
290
+ const sizeClasses = SIZE_CLASSES2[size];
291
+ const actualRadioSize = sizeClasses.radio;
292
+ const actualDotSize = sizeClasses.dotSize;
293
+ const radioVariant = checked ? "checked" : "unchecked";
294
+ const stylingClasses = STATE_CLASSES[currentState][radioVariant];
295
+ const getBorderWidth = () => {
296
+ if (currentState === "focused") {
297
+ return "border-2";
298
+ }
299
+ return sizeClasses.borderWidth;
300
+ };
301
+ const borderWidthClass = getBorderWidth();
302
+ const radioClasses = `${BASE_RADIO_CLASSES} ${actualRadioSize} ${borderWidthClass} ${stylingClasses} ${className}`;
303
+ const dotClasses = `${actualDotSize} rounded-full ${DOT_CLASSES[currentState]} transition-all duration-200`;
304
+ const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
305
+ const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
306
+ const getTextColor = () => {
307
+ if (currentState === "disabled") {
308
+ return checked ? "text-text-900" : "text-text-600";
309
+ }
310
+ if (currentState === "focused") {
311
+ return "text-text-900";
312
+ }
313
+ return checked ? "text-text-900" : "text-text-600";
314
+ };
315
+ const getCursorClass = () => {
316
+ return currentState === "disabled" ? "cursor-not-allowed" : "cursor-pointer";
317
+ };
318
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col", children: [
319
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
320
+ "div",
321
+ {
322
+ className: `flex flex-row items-center ${isWrapperNeeded ? `p-1 border-2 ${wrapperBorderColor} rounded-lg gap-1.5` : sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
323
+ children: [
324
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
325
+ "input",
326
+ {
327
+ ref: (node) => {
328
+ inputRef.current = node;
329
+ if (typeof ref === "function") ref(node);
330
+ else if (ref) ref.current = node;
331
+ },
332
+ type: "radio",
333
+ id: inputId,
334
+ checked,
335
+ disabled,
336
+ name,
337
+ value,
338
+ onChange: handleChange,
339
+ className: "sr-only",
340
+ style: {
341
+ position: "absolute",
342
+ left: "-9999px",
343
+ visibility: "hidden"
344
+ },
345
+ ...props
346
+ }
347
+ ),
348
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
349
+ "button",
350
+ {
351
+ type: "button",
352
+ className: radioClasses,
353
+ disabled,
354
+ "aria-pressed": checked,
355
+ onClick: (e) => {
356
+ e.preventDefault();
357
+ if (!disabled) {
358
+ if (inputRef.current) {
359
+ inputRef.current.click();
360
+ inputRef.current.blur();
361
+ }
362
+ }
363
+ },
364
+ onKeyDown: (e) => {
365
+ if ((e.key === "Enter" || e.key === " ") && !disabled) {
366
+ e.preventDefault();
367
+ if (inputRef.current) {
368
+ inputRef.current.click();
369
+ inputRef.current.blur();
370
+ }
371
+ }
372
+ },
373
+ children: checked && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: dotClasses })
374
+ }
375
+ ),
376
+ label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
377
+ "div",
378
+ {
379
+ className: `flex flex-row items-center ${sizeClasses.labelHeight} flex-1 min-w-0`,
380
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
381
+ Text_default,
382
+ {
383
+ as: "label",
384
+ htmlFor: inputId,
385
+ size: sizeClasses.textSize,
386
+ weight: "normal",
387
+ className: `${getCursorClass()} select-none leading-normal flex items-center font-roboto truncate ${labelClassName}`,
388
+ color: getTextColor(),
389
+ children: label
390
+ }
391
+ )
392
+ }
393
+ )
394
+ ]
395
+ }
396
+ ),
397
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
398
+ Text_default,
399
+ {
400
+ size: "sm",
401
+ weight: "normal",
402
+ className: "mt-1.5 truncate",
403
+ color: "text-error-600",
404
+ children: errorMessage
405
+ }
406
+ ),
407
+ helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
408
+ Text_default,
409
+ {
410
+ size: "sm",
411
+ weight: "normal",
412
+ className: "mt-1.5 truncate",
413
+ color: "text-text-500",
414
+ children: helperText
415
+ }
416
+ )
417
+ ] });
418
+ }
419
+ );
420
+ Radio.displayName = "Radio";
421
+ var createRadioGroupStore = (name, defaultValue, disabled, onValueChange) => (0, import_zustand.create)((set, get) => ({
422
+ value: defaultValue,
423
+ setValue: (value) => {
424
+ if (!get().disabled) {
425
+ set({ value });
426
+ get().onValueChange?.(value);
427
+ }
428
+ },
429
+ onValueChange,
430
+ disabled,
431
+ name
432
+ }));
433
+ var useRadioGroupStore = (externalStore) => {
434
+ if (!externalStore) {
435
+ throw new Error("RadioGroupItem must be used within a RadioGroup");
436
+ }
437
+ return externalStore;
438
+ };
439
+ var injectStore = (children, store) => import_react.Children.map(children, (child) => {
440
+ if (!(0, import_react.isValidElement)(child)) return child;
441
+ const typedChild = child;
442
+ const shouldInject = typedChild.type === RadioGroupItem;
443
+ return (0, import_react.cloneElement)(typedChild, {
444
+ ...shouldInject ? { store } : {},
445
+ ...typedChild.props.children ? { children: injectStore(typedChild.props.children, store) } : {}
446
+ });
447
+ });
448
+ var RadioGroup = (0, import_react.forwardRef)(
449
+ ({
450
+ value: propValue,
451
+ defaultValue = "",
452
+ onValueChange,
453
+ name: propName,
454
+ disabled = false,
455
+ className = "",
456
+ children,
457
+ ...props
458
+ }, ref) => {
459
+ const generatedId = (0, import_react.useId)();
460
+ const name = propName || `radio-group-${generatedId}`;
461
+ const storeRef = (0, import_react.useRef)(null);
462
+ storeRef.current ??= createRadioGroupStore(
463
+ name,
464
+ defaultValue,
465
+ disabled,
466
+ onValueChange
467
+ );
468
+ const store = storeRef.current;
469
+ const { setValue } = (0, import_zustand.useStore)(store, (s) => s);
470
+ (0, import_react.useEffect)(() => {
471
+ const currentValue = store.getState().value;
472
+ if (currentValue && onValueChange) {
473
+ onValueChange(currentValue);
474
+ }
475
+ }, []);
476
+ (0, import_react.useEffect)(() => {
477
+ if (propValue !== void 0) {
478
+ setValue(propValue);
479
+ }
480
+ }, [propValue, setValue]);
481
+ (0, import_react.useEffect)(() => {
482
+ store.setState({ disabled });
483
+ }, [disabled, store]);
484
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
485
+ "div",
486
+ {
487
+ ref,
488
+ className,
489
+ role: "radiogroup",
490
+ "aria-label": name,
491
+ ...props,
492
+ children: injectStore(children, store)
493
+ }
494
+ );
495
+ }
496
+ );
497
+ RadioGroup.displayName = "RadioGroup";
498
+ var RadioGroupItem = (0, import_react.forwardRef)(
499
+ ({
500
+ value,
501
+ store: externalStore,
502
+ disabled: itemDisabled,
503
+ size = "medium",
504
+ state = "default",
505
+ className = "",
506
+ id,
507
+ ...props
508
+ }, ref) => {
509
+ const store = useRadioGroupStore(externalStore);
510
+ const {
511
+ value: groupValue,
512
+ setValue,
513
+ disabled: groupDisabled,
514
+ name
515
+ } = (0, import_zustand.useStore)(store);
516
+ const generatedId = (0, import_react.useId)();
517
+ const inputId = id ?? `radio-item-${generatedId}`;
518
+ const isChecked = groupValue === value;
519
+ const isDisabled = groupDisabled || itemDisabled;
520
+ const currentState = isDisabled ? "disabled" : state;
521
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
522
+ Radio,
523
+ {
524
+ ref,
525
+ id: inputId,
526
+ name,
527
+ value,
528
+ checked: isChecked,
529
+ disabled: isDisabled,
530
+ size,
531
+ state: currentState,
532
+ className,
533
+ onChange: (e) => {
534
+ if (e.target.checked && !isDisabled) {
535
+ setValue(value);
536
+ }
537
+ },
538
+ ...props
539
+ }
540
+ );
541
+ }
542
+ );
543
+ RadioGroupItem.displayName = "RadioGroupItem";
544
+
545
+ // src/components/Alternative/Alternative.tsx
546
+ var import_react2 = require("react");
547
+ var import_jsx_runtime4 = require("react/jsx-runtime");
548
+ var AlternativesList = ({
549
+ alternatives,
550
+ name,
551
+ defaultValue,
552
+ value,
553
+ onValueChange,
554
+ disabled = false,
555
+ layout = "default",
556
+ className = "",
557
+ mode = "interactive",
558
+ selectedValue
559
+ }) => {
560
+ const uniqueId = (0, import_react2.useId)();
561
+ const groupName = name || `alternatives-${uniqueId}`;
562
+ const [actualValue, setActualValue] = (0, import_react2.useState)(value);
563
+ const isReadonly = mode === "readonly";
564
+ const getStatusStyles = (status, isReadonly2) => {
565
+ const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
566
+ switch (status) {
567
+ case "correct":
568
+ return "bg-success-background border-success-300";
569
+ case "incorrect":
570
+ return "bg-error-background border-error-300";
571
+ default:
572
+ return `bg-background border-border-100 ${hoverClass}`;
573
+ }
574
+ };
575
+ const getStatusBadge = (status) => {
576
+ switch (status) {
577
+ case "correct":
578
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.CheckCircle, {}), children: "Resposta correta" });
579
+ case "incorrect":
580
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_phosphor_react2.XCircle, {}), children: "Resposta incorreta" });
581
+ default:
582
+ return null;
583
+ }
584
+ };
585
+ const getLayoutClasses = () => {
586
+ switch (layout) {
587
+ case "compact":
588
+ return "gap-2";
589
+ case "detailed":
590
+ return "gap-4";
591
+ default:
592
+ return "gap-3.5";
593
+ }
594
+ };
595
+ const renderReadonlyAlternative = (alternative) => {
596
+ const alternativeId = alternative.value;
597
+ const isUserSelected = selectedValue === alternative.value;
598
+ const isCorrectAnswer = alternative.status === "correct";
599
+ let displayStatus = void 0;
600
+ if (isUserSelected && !isCorrectAnswer) {
601
+ displayStatus = "incorrect";
602
+ } else if (isCorrectAnswer) {
603
+ displayStatus = "correct";
604
+ }
605
+ const statusStyles = getStatusStyles(displayStatus, true);
606
+ const statusBadge = getStatusBadge(displayStatus);
607
+ const renderRadio = () => {
608
+ 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"}`;
609
+ const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
610
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: dotClasses }) });
611
+ };
612
+ if (layout === "detailed") {
613
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
614
+ "div",
615
+ {
616
+ className: `border-2 rounded-lg p-4 w-full ${statusStyles} ${alternative.disabled ? "opacity-50" : ""}`,
617
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
618
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
619
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "mt-1", children: renderRadio() }),
620
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex-1", children: [
621
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
622
+ "p",
623
+ {
624
+ className: `block font-medium ${selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"}`,
625
+ children: alternative.label
626
+ }
627
+ ),
628
+ alternative.description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
629
+ ] })
630
+ ] }),
631
+ statusBadge && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
632
+ ] })
633
+ },
634
+ alternativeId
635
+ );
636
+ }
637
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
638
+ "div",
639
+ {
640
+ className: `flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full ${statusStyles} ${alternative.disabled ? "opacity-50" : ""}`,
641
+ children: [
642
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
643
+ renderRadio(),
644
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
645
+ "span",
646
+ {
647
+ className: `flex-1 ${selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"}`,
648
+ children: alternative.label
649
+ }
650
+ )
651
+ ] }),
652
+ statusBadge && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
653
+ ]
654
+ },
655
+ alternativeId
656
+ );
657
+ };
658
+ if (isReadonly) {
659
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
660
+ "div",
661
+ {
662
+ className: `flex flex-col ${getLayoutClasses()} w-full ${className}`,
663
+ children: alternatives.map(
664
+ (alternative) => renderReadonlyAlternative(alternative)
665
+ )
666
+ }
667
+ );
668
+ }
669
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
670
+ RadioGroup,
671
+ {
672
+ name: groupName,
673
+ defaultValue,
674
+ value,
675
+ onValueChange: (value2) => {
676
+ setActualValue(value2);
677
+ onValueChange?.(value2);
678
+ },
679
+ disabled,
680
+ className: `flex flex-col ${getLayoutClasses()} ${className}`,
681
+ children: alternatives.map((alternative, index) => {
682
+ const alternativeId = alternative.value || `alt-${index}`;
683
+ const statusStyles = getStatusStyles(alternative.status, false);
684
+ const statusBadge = getStatusBadge(alternative.status);
685
+ if (layout === "detailed") {
686
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
687
+ "div",
688
+ {
689
+ className: `border-2 rounded-lg p-4 transition-all ${statusStyles} ${alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`,
690
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
691
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
692
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
693
+ RadioGroupItem,
694
+ {
695
+ value: alternative.value,
696
+ id: alternativeId,
697
+ disabled: alternative.disabled,
698
+ className: "mt-1"
699
+ }
700
+ ),
701
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex-1", children: [
702
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
703
+ "label",
704
+ {
705
+ htmlFor: alternativeId,
706
+ className: `block font-medium
707
+ ${actualValue === alternative.value ? "text-text-950" : "text-text-600"}
708
+ ${alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"}`,
709
+ children: alternative.label
710
+ }
711
+ ),
712
+ alternative.description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
713
+ ] })
714
+ ] }),
715
+ statusBadge && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
716
+ ] })
717
+ },
718
+ alternativeId
719
+ );
720
+ }
721
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
722
+ "div",
723
+ {
724
+ className: `flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all ${statusStyles} ${alternative.disabled ? "opacity-50 cursor-not-allowed" : ""}`,
725
+ children: [
726
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
727
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
728
+ RadioGroupItem,
729
+ {
730
+ value: alternative.value,
731
+ id: alternativeId,
732
+ disabled: alternative.disabled
733
+ }
734
+ ),
735
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
736
+ "label",
737
+ {
738
+ htmlFor: alternativeId,
739
+ className: `flex-1
740
+ ${actualValue === alternative.value ? "text-text-950" : "text-text-600"}
741
+ ${alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"}`,
742
+ children: alternative.label
743
+ }
744
+ )
745
+ ] }),
746
+ statusBadge && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
747
+ ]
748
+ },
749
+ alternativeId
750
+ );
751
+ })
752
+ }
753
+ );
754
+ };
755
+ var HeaderAlternative = (0, import_react2.forwardRef)(
756
+ ({ className, title, subTitle, content, ...props }, ref) => {
757
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
758
+ "div",
759
+ {
760
+ ref,
761
+ className: `bg-background p-4 flex flex-col gap-4 rounded-xl ${className}`,
762
+ ...props,
763
+ children: [
764
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "flex flex-col", children: [
765
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-text-950 font-bold text-lg", children: title }),
766
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-text-700 text-sm ", children: subTitle })
767
+ ] }),
768
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-text-950 text-md", children: content })
769
+ ]
770
+ }
771
+ );
772
+ }
773
+ );
774
+
775
+ // src/components/Button/Button.tsx
776
+ var import_jsx_runtime5 = require("react/jsx-runtime");
777
+ var VARIANT_ACTION_CLASSES2 = {
778
+ solid: {
779
+ primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
780
+ positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
781
+ negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
782
+ },
783
+ outline: {
784
+ primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
785
+ positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
786
+ negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
787
+ },
788
+ link: {
789
+ primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
790
+ positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
791
+ negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
792
+ }
793
+ };
794
+ var SIZE_CLASSES3 = {
795
+ "extra-small": "text-xs px-3.5 py-2",
796
+ small: "text-sm px-4 py-2.5",
797
+ medium: "text-md px-5 py-2.5",
798
+ large: "text-lg px-6 py-3",
799
+ "extra-large": "text-lg px-7 py-3.5"
800
+ };
801
+ var Button = ({
802
+ children,
803
+ iconLeft,
804
+ iconRight,
805
+ size = "medium",
806
+ variant = "solid",
807
+ action = "primary",
808
+ className = "",
809
+ disabled,
810
+ type = "button",
811
+ ...props
812
+ }) => {
813
+ const sizeClasses = SIZE_CLASSES3[size];
814
+ const variantClasses = VARIANT_ACTION_CLASSES2[variant][action];
815
+ const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
816
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
817
+ "button",
818
+ {
819
+ className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
820
+ disabled,
821
+ type,
822
+ ...props,
823
+ children: [
824
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
825
+ children,
826
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
827
+ ]
828
+ }
829
+ );
830
+ };
831
+ var Button_default = Button;
832
+
833
+ // src/components/IconButton/IconButton.tsx
834
+ var import_react3 = require("react");
835
+ var import_jsx_runtime6 = require("react/jsx-runtime");
836
+ var IconButton = (0, import_react3.forwardRef)(
837
+ ({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
838
+ const baseClasses = [
839
+ "inline-flex",
840
+ "items-center",
841
+ "justify-center",
842
+ "rounded-lg",
843
+ "font-medium",
844
+ "bg-transparent",
845
+ "text-text-950",
846
+ "cursor-pointer",
847
+ "hover:bg-primary-600",
848
+ "hover:text-text",
849
+ "focus-visible:outline-none",
850
+ "focus-visible:ring-2",
851
+ "focus-visible:ring-offset-0",
852
+ "focus-visible:ring-indicator-info",
853
+ "disabled:opacity-50",
854
+ "disabled:cursor-not-allowed",
855
+ "disabled:pointer-events-none"
856
+ ];
857
+ const sizeClasses = {
858
+ sm: ["w-6", "h-6", "text-sm"],
859
+ md: ["w-10", "h-10", "text-base"]
860
+ };
861
+ const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
862
+ const allClasses = [
863
+ ...baseClasses,
864
+ ...sizeClasses[size],
865
+ ...activeClasses
866
+ ].join(" ");
867
+ const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
868
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
869
+ "button",
870
+ {
871
+ ref,
872
+ type: "button",
873
+ className: `${allClasses} ${className}`,
874
+ disabled,
875
+ "aria-pressed": active,
876
+ "aria-label": ariaLabel,
877
+ ...props,
878
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "flex items-center justify-center", children: icon })
879
+ }
880
+ );
881
+ }
882
+ );
883
+ IconButton.displayName = "IconButton";
884
+ var IconButton_default = IconButton;
885
+
886
+ // src/components/Quiz/Quiz.tsx
887
+ var import_react8 = require("react");
888
+
889
+ // src/components/Quiz/useQuizStore.ts
890
+ var import_zustand2 = require("zustand");
891
+ var import_middleware = require("zustand/middleware");
892
+ var useQuizStore = (0, import_zustand2.create)()(
893
+ (0, import_middleware.devtools)(
894
+ (set, get) => {
895
+ let timerInterval = null;
896
+ const startTimer = () => {
897
+ if (timerInterval) {
898
+ clearInterval(timerInterval);
899
+ }
900
+ timerInterval = setInterval(() => {
901
+ const { timeElapsed } = get();
902
+ set({ timeElapsed: timeElapsed + 1 });
903
+ }, 1e3);
904
+ };
905
+ const stopTimer = () => {
906
+ if (timerInterval) {
907
+ clearInterval(timerInterval);
908
+ timerInterval = null;
909
+ }
910
+ };
911
+ return {
912
+ // Initial State
913
+ currentQuestionIndex: 0,
914
+ selectedAnswers: {},
915
+ skippedQuestions: [],
916
+ userAnswers: [],
917
+ timeElapsed: 0,
918
+ isStarted: false,
919
+ isFinished: false,
920
+ // Setters
921
+ setBySimulado: (simulado) => set({ bySimulado: simulado }),
922
+ setByAtividade: (atividade) => set({ byAtividade: atividade }),
923
+ setByAula: (aula) => set({ byAula: aula }),
924
+ // Navigation
925
+ goToNextQuestion: () => {
926
+ const { currentQuestionIndex, getTotalQuestions } = get();
927
+ const totalQuestions = getTotalQuestions();
928
+ if (currentQuestionIndex < totalQuestions - 1) {
929
+ set({ currentQuestionIndex: currentQuestionIndex + 1 });
930
+ }
931
+ },
932
+ goToPreviousQuestion: () => {
933
+ const { currentQuestionIndex } = get();
934
+ if (currentQuestionIndex > 0) {
935
+ set({ currentQuestionIndex: currentQuestionIndex - 1 });
936
+ }
937
+ },
938
+ goToQuestion: (index) => {
939
+ const { getTotalQuestions } = get();
940
+ const totalQuestions = getTotalQuestions();
941
+ if (index >= 0 && index < totalQuestions) {
942
+ set({ currentQuestionIndex: index });
943
+ }
944
+ },
945
+ // Quiz Actions
946
+ selectAnswer: (questionId, answerId) => {
947
+ const { selectedAnswers, skippedQuestions, addUserAnswer } = get();
948
+ const newSkippedQuestions = skippedQuestions.filter(
949
+ (id) => id !== questionId
950
+ );
951
+ set({
952
+ selectedAnswers: {
953
+ ...selectedAnswers,
954
+ [questionId]: answerId
955
+ },
956
+ skippedQuestions: newSkippedQuestions
957
+ });
958
+ addUserAnswer(questionId, answerId);
959
+ },
960
+ skipQuestion: () => {
961
+ const { getCurrentQuestion, skippedQuestions, addUserAnswer } = get();
962
+ const currentQuestion = getCurrentQuestion();
963
+ if (currentQuestion) {
964
+ set({
965
+ skippedQuestions: [...skippedQuestions, currentQuestion.id]
966
+ });
967
+ addUserAnswer(currentQuestion.id);
968
+ }
969
+ },
970
+ addUserAnswer: (questionId, answerId) => {
971
+ const { userAnswers, bySimulado, byAtividade, byAula } = get();
972
+ const quiz = bySimulado || byAtividade || byAula;
973
+ const question = quiz?.questions.find((q) => q.id === questionId);
974
+ if (!question) return;
975
+ const existingAnswerIndex = userAnswers.findIndex(
976
+ (answer) => answer.id === questionId
977
+ );
978
+ if (existingAnswerIndex !== -1) {
979
+ const updatedAnswers = [...userAnswers];
980
+ updatedAnswers[existingAnswerIndex] = {
981
+ ...question,
982
+ answerKey: answerId || "",
983
+ isSkipped: !answerId
984
+ };
985
+ set({ userAnswers: updatedAnswers });
986
+ } else {
987
+ set({
988
+ userAnswers: [
989
+ ...userAnswers,
990
+ {
991
+ ...question,
992
+ answerKey: answerId || "",
993
+ isSkipped: !answerId
994
+ }
995
+ ]
996
+ });
997
+ }
998
+ },
999
+ startQuiz: () => {
1000
+ set({ isStarted: true, timeElapsed: 0 });
1001
+ startTimer();
1002
+ },
1003
+ finishQuiz: () => {
1004
+ set({ isFinished: true });
1005
+ stopTimer();
1006
+ },
1007
+ resetQuiz: () => {
1008
+ stopTimer();
1009
+ set({
1010
+ currentQuestionIndex: 0,
1011
+ selectedAnswers: {},
1012
+ skippedQuestions: [],
1013
+ userAnswers: [],
1014
+ timeElapsed: 0,
1015
+ isStarted: false,
1016
+ isFinished: false
1017
+ });
1018
+ },
1019
+ // Timer
1020
+ updateTime: (time) => set({ timeElapsed: time }),
1021
+ startTimer,
1022
+ stopTimer,
1023
+ // Getters
1024
+ getCurrentQuestion: () => {
1025
+ const { bySimulado, byAtividade, byAula, currentQuestionIndex } = get();
1026
+ const quiz = bySimulado || byAtividade || byAula;
1027
+ if (!quiz) {
1028
+ return null;
1029
+ }
1030
+ return quiz.questions[currentQuestionIndex];
1031
+ },
1032
+ getTotalQuestions: () => {
1033
+ const { bySimulado, byAtividade, byAula } = get();
1034
+ const quiz = bySimulado || byAtividade || byAula;
1035
+ return quiz?.questions?.length || 0;
1036
+ },
1037
+ getAnsweredQuestions: () => {
1038
+ const { selectedAnswers } = get();
1039
+ return Object.keys(selectedAnswers).length;
1040
+ },
1041
+ getUnansweredQuestions: () => {
1042
+ const {
1043
+ bySimulado,
1044
+ byAtividade,
1045
+ byAula,
1046
+ selectedAnswers,
1047
+ skippedQuestions
1048
+ } = get();
1049
+ const quiz = bySimulado || byAtividade || byAula;
1050
+ if (!quiz) return [];
1051
+ const unansweredQuestions = [];
1052
+ quiz.questions.forEach((question, index) => {
1053
+ const isAnswered = question.id in selectedAnswers;
1054
+ const isSkipped = skippedQuestions.includes(question.id);
1055
+ if (!isAnswered && !isSkipped) {
1056
+ unansweredQuestions.push(index + 1);
1057
+ }
1058
+ });
1059
+ return unansweredQuestions;
1060
+ },
1061
+ getSkippedQuestions: () => {
1062
+ const { skippedQuestions } = get();
1063
+ return skippedQuestions.length;
1064
+ },
1065
+ getProgress: () => {
1066
+ const { getTotalQuestions, getAnsweredQuestions } = get();
1067
+ const total = getTotalQuestions();
1068
+ const answered = getAnsweredQuestions();
1069
+ return total > 0 ? answered / total * 100 : 0;
1070
+ },
1071
+ isQuestionAnswered: (questionId) => {
1072
+ const { selectedAnswers } = get();
1073
+ return questionId in selectedAnswers;
1074
+ },
1075
+ isQuestionSkipped: (questionId) => {
1076
+ const { skippedQuestions } = get();
1077
+ return skippedQuestions.includes(questionId);
1078
+ },
1079
+ getCurrentAnswer: () => {
1080
+ const { getCurrentQuestion, selectedAnswers } = get();
1081
+ const currentQuestion = getCurrentQuestion();
1082
+ return selectedAnswers[currentQuestion?.id || ""];
1083
+ },
1084
+ getQuizTitle: () => {
1085
+ const { bySimulado, byAtividade, byAula } = get();
1086
+ const quiz = bySimulado || byAtividade || byAula;
1087
+ return quiz?.title || "Quiz";
1088
+ },
1089
+ formatTime: (seconds) => {
1090
+ const minutes = Math.floor(seconds / 60);
1091
+ const remainingSeconds = seconds % 60;
1092
+ return `${minutes.toString().padStart(2, "0")}:${remainingSeconds.toString().padStart(2, "0")}`;
1093
+ },
1094
+ getUserAnswers: () => {
1095
+ const { userAnswers } = get();
1096
+ return userAnswers;
1097
+ },
1098
+ getUnansweredQuestionsFromUserAnswers: () => {
1099
+ const { bySimulado, byAtividade, byAula, userAnswers } = get();
1100
+ const quiz = bySimulado || byAtividade || byAula;
1101
+ if (!quiz) return [];
1102
+ const unansweredQuestions = [];
1103
+ quiz.questions.forEach((question, index) => {
1104
+ const userAnswer = userAnswers.find(
1105
+ (answer) => answer.id === question.id
1106
+ );
1107
+ if (!userAnswer || userAnswer.isSkipped) {
1108
+ unansweredQuestions.push(index + 1);
1109
+ }
1110
+ });
1111
+ return unansweredQuestions;
1112
+ },
1113
+ getQuestionsGroupedBySubject: () => {
1114
+ const { bySimulado, byAtividade, byAula } = get();
1115
+ const quiz = bySimulado || byAtividade || byAula;
1116
+ if (!quiz) return {};
1117
+ const groupedQuestions = {};
1118
+ quiz.questions.forEach((question) => {
1119
+ const subjectId = question.knowledgeMatrix?.[0]?.subjectId || "Sem mat\xE9ria";
1120
+ if (!groupedQuestions[subjectId]) {
1121
+ groupedQuestions[subjectId] = [];
1122
+ }
1123
+ groupedQuestions[subjectId].push(question);
1124
+ });
1125
+ return groupedQuestions;
1126
+ }
1127
+ };
1128
+ },
1129
+ {
1130
+ name: "quiz-store"
1131
+ }
1132
+ )
1133
+ );
1134
+
1135
+ // src/components/AlertDialog/AlertDialog.tsx
1136
+ var import_react4 = require("react");
1137
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1138
+ var SIZE_CLASSES4 = {
1139
+ "extra-small": "w-screen max-w-[324px]",
1140
+ small: "w-screen max-w-[378px]",
1141
+ medium: "w-screen max-w-[459px]",
1142
+ large: "w-screen max-w-[578px]",
1143
+ "extra-large": "w-screen max-w-[912px]"
1144
+ };
1145
+ var AlertDialog = (0, import_react4.forwardRef)(
1146
+ ({
1147
+ description,
1148
+ cancelButtonLabel = "Cancelar",
1149
+ submitButtonLabel = "Deletar",
1150
+ title,
1151
+ isOpen,
1152
+ closeOnBackdropClick = true,
1153
+ closeOnEscape = true,
1154
+ className = "",
1155
+ onSubmit,
1156
+ onChangeOpen,
1157
+ submitValue,
1158
+ onCancel,
1159
+ cancelValue,
1160
+ size = "medium",
1161
+ ...props
1162
+ }, ref) => {
1163
+ (0, import_react4.useEffect)(() => {
1164
+ if (!isOpen || !closeOnEscape) return;
1165
+ const handleEscape = (event) => {
1166
+ if (event.key === "Escape") {
1167
+ onChangeOpen(false);
1168
+ }
1169
+ };
1170
+ document.addEventListener("keydown", handleEscape);
1171
+ return () => document.removeEventListener("keydown", handleEscape);
1172
+ }, [isOpen, closeOnEscape]);
1173
+ (0, import_react4.useEffect)(() => {
1174
+ if (isOpen) {
1175
+ document.body.style.overflow = "hidden";
1176
+ } else {
1177
+ document.body.style.overflow = "unset";
1178
+ }
1179
+ return () => {
1180
+ document.body.style.overflow = "unset";
1181
+ };
1182
+ }, [isOpen]);
1183
+ const handleBackdropClick = (event) => {
1184
+ if (event.target === event.currentTarget && closeOnBackdropClick) {
1185
+ onChangeOpen(false);
1186
+ }
1187
+ };
1188
+ const handleBackdropKeyDown = (event) => {
1189
+ if (event.key === "Escape" && closeOnEscape) {
1190
+ onChangeOpen(false);
1191
+ }
1192
+ };
1193
+ const handleSubmit = () => {
1194
+ onChangeOpen(false);
1195
+ onSubmit?.(submitValue);
1196
+ };
1197
+ const handleCancel = () => {
1198
+ onChangeOpen(false);
1199
+ onCancel?.(cancelValue);
1200
+ };
1201
+ const sizeClasses = SIZE_CLASSES4[size];
1202
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1203
+ "div",
1204
+ {
1205
+ className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",
1206
+ onClick: handleBackdropClick,
1207
+ onKeyDown: handleBackdropKeyDown,
1208
+ "data-testid": "alert-dialog-overlay",
1209
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1210
+ "div",
1211
+ {
1212
+ ref,
1213
+ className: `bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`,
1214
+ ...props,
1215
+ children: [
1216
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1217
+ "h2",
1218
+ {
1219
+ id: "alert-dialog-title",
1220
+ className: "pb-3 text-xl font-semibold text-text-950",
1221
+ children: title
1222
+ }
1223
+ ),
1224
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1225
+ "p",
1226
+ {
1227
+ id: "alert-dialog-description",
1228
+ className: "text-text-700 text-sm",
1229
+ children: description
1230
+ }
1231
+ ),
1232
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-row items-center justify-end pt-4 gap-3", children: [
1233
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button_default, { variant: "outline", size: "small", onClick: handleCancel, children: cancelButtonLabel }),
1234
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1235
+ Button_default,
1236
+ {
1237
+ variant: "solid",
1238
+ size: "small",
1239
+ action: "negative",
1240
+ onClick: handleSubmit,
1241
+ children: submitButtonLabel
1242
+ }
1243
+ )
1244
+ ] })
1245
+ ]
1246
+ }
1247
+ )
1248
+ }
1249
+ ) });
1250
+ }
1251
+ );
1252
+ AlertDialog.displayName = "AlertDialog";
1253
+
1254
+ // src/components/Modal/Modal.tsx
1255
+ var import_react5 = require("react");
1256
+ var import_phosphor_react3 = require("phosphor-react");
1257
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1258
+ var SIZE_CLASSES5 = {
1259
+ xs: "max-w-[360px]",
1260
+ sm: "max-w-[420px]",
1261
+ md: "max-w-[510px]",
1262
+ lg: "max-w-[640px]",
1263
+ xl: "max-w-[970px]"
1264
+ };
1265
+ var Modal = ({
1266
+ isOpen,
1267
+ onClose,
1268
+ title,
1269
+ children,
1270
+ size = "md",
1271
+ className = "",
1272
+ closeOnBackdropClick = true,
1273
+ closeOnEscape = true,
1274
+ footer,
1275
+ hideCloseButton = false
1276
+ }) => {
1277
+ (0, import_react5.useEffect)(() => {
1278
+ if (!isOpen || !closeOnEscape) return;
1279
+ const handleEscape = (event) => {
1280
+ if (event.key === "Escape") {
1281
+ onClose();
1282
+ }
1283
+ };
1284
+ document.addEventListener("keydown", handleEscape);
1285
+ return () => document.removeEventListener("keydown", handleEscape);
1286
+ }, [isOpen, closeOnEscape, onClose]);
1287
+ (0, import_react5.useEffect)(() => {
1288
+ const originalOverflow = document.body.style.overflow;
1289
+ if (isOpen) {
1290
+ document.body.style.overflow = "hidden";
1291
+ } else {
1292
+ document.body.style.overflow = originalOverflow;
1293
+ }
1294
+ return () => {
1295
+ document.body.style.overflow = originalOverflow;
1296
+ };
1297
+ }, [isOpen]);
1298
+ const handleBackdropClick = (event) => {
1299
+ if (closeOnBackdropClick && event.target === event.currentTarget) {
1300
+ onClose();
1301
+ }
1302
+ };
1303
+ const handleBackdropKeyDown = (event) => {
1304
+ if (closeOnBackdropClick && (event.key === "Enter" || event.key === " ")) {
1305
+ onClose();
1306
+ }
1307
+ };
1308
+ if (!isOpen) return null;
1309
+ const sizeClasses = SIZE_CLASSES5[size];
1310
+ const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
1311
+ const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
1312
+ const modalClasses = `${baseClasses} ${sizeClasses} ${dialogResetClasses} ${className}`;
1313
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1314
+ "div",
1315
+ {
1316
+ className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs",
1317
+ onClick: handleBackdropClick,
1318
+ onKeyDown: handleBackdropKeyDown,
1319
+ role: "button",
1320
+ tabIndex: closeOnBackdropClick ? 0 : -1,
1321
+ "aria-label": "Fechar modal clicando no fundo",
1322
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("dialog", { className: modalClasses, "aria-labelledby": "modal-title", open: true, children: [
1323
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center justify-between px-6 py-6", children: [
1324
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h2", { id: "modal-title", className: "text-lg font-semibold text-text-950", children: title }),
1325
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1326
+ "button",
1327
+ {
1328
+ onClick: onClose,
1329
+ 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",
1330
+ "aria-label": "Fechar modal",
1331
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_phosphor_react3.X, { size: 18 })
1332
+ }
1333
+ )
1334
+ ] }),
1335
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "px-6 pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
1336
+ footer && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
1337
+ ] })
1338
+ }
1339
+ );
1340
+ };
1341
+ var Modal_default = Modal;
1342
+
1343
+ // src/assets/img/simulated-result.png
1344
+ var simulated_result_default = "../simulated-result-QN5HCUY5.png";
1345
+
1346
+ // src/components/Select/Select.tsx
1347
+ var import_zustand3 = require("zustand");
1348
+ var import_react6 = require("react");
1349
+ var import_phosphor_react4 = require("phosphor-react");
1350
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1351
+ var VARIANT_CLASSES = {
1352
+ outlined: "border rounded-lg focus:border-primary-950",
1353
+ underlined: "border-b focus:border-primary-950",
1354
+ rounded: "border rounded-full focus:border-primary-950"
1355
+ };
1356
+ var SIZE_CLASSES6 = {
1357
+ small: "text-sm",
1358
+ medium: "text-md",
1359
+ large: "text-lg",
1360
+ "extra-large": "text-lg"
1361
+ };
1362
+ var HEIGHT_CLASSES = {
1363
+ small: "h-8",
1364
+ medium: "h-9",
1365
+ large: "h-10",
1366
+ "extra-large": "h-12"
1367
+ };
1368
+ var PADDING_CLASSES = {
1369
+ small: "px-2 py-1",
1370
+ medium: "px-3 py-2",
1371
+ large: "px-4 py-3",
1372
+ "extra-large": "px-5 py-4"
1373
+ };
1374
+ var SIDE_CLASSES = {
1375
+ top: "bottom-full -translate-y-1",
1376
+ right: "top-full translate-y-1",
1377
+ bottom: "top-full translate-y-1",
1378
+ left: "top-full translate-y-1"
1379
+ };
1380
+ var ALIGN_CLASSES = {
1381
+ start: "left-0",
1382
+ center: "left-1/2 -translate-x-1/2",
1383
+ end: "right-0"
1384
+ };
1385
+ function createSelectStore(onValueChange) {
1386
+ return (0, import_zustand3.create)((set) => ({
1387
+ open: false,
1388
+ setOpen: (open) => set({ open }),
1389
+ value: "",
1390
+ setValue: (value) => set({ value }),
1391
+ selectedLabel: "",
1392
+ setSelectedLabel: (label) => set({ selectedLabel: label }),
1393
+ onValueChange
1394
+ }));
1395
+ }
1396
+ var useSelectStore = (externalStore) => {
1397
+ if (!externalStore) {
1398
+ throw new Error(
1399
+ "Component must be used within a Select (store is missing)"
1400
+ );
1401
+ }
1402
+ return externalStore;
1403
+ };
1404
+ function getLabelAsNode(children) {
1405
+ if (typeof children === "string" || typeof children === "number") {
1406
+ return children;
1407
+ }
1408
+ const flattened = import_react6.Children.toArray(children);
1409
+ if (flattened.length === 1) return flattened[0];
1410
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: flattened });
1411
+ }
1412
+ var injectStore2 = (children, store, size, selectId) => {
1413
+ return import_react6.Children.map(children, (child) => {
1414
+ if ((0, import_react6.isValidElement)(child)) {
1415
+ const typedChild = child;
1416
+ const newProps = {
1417
+ store
1418
+ };
1419
+ if (typedChild.type === SelectTrigger) {
1420
+ newProps.size = size;
1421
+ newProps.selectId = selectId;
1422
+ }
1423
+ if (typedChild.props.children) {
1424
+ newProps.children = injectStore2(
1425
+ typedChild.props.children,
1426
+ store,
1427
+ size,
1428
+ selectId
1429
+ );
1430
+ }
1431
+ return (0, import_react6.cloneElement)(typedChild, newProps);
1432
+ }
1433
+ return child;
1434
+ });
1435
+ };
1436
+ var Select = ({
1437
+ children,
1438
+ defaultValue = "",
1439
+ value: propValue,
1440
+ onValueChange,
1441
+ size = "small",
1442
+ label,
1443
+ helperText,
1444
+ errorMessage,
1445
+ id
1446
+ }) => {
1447
+ const storeRef = (0, import_react6.useRef)(null);
1448
+ storeRef.current ??= createSelectStore(onValueChange);
1449
+ const store = storeRef.current;
1450
+ const selectRef = (0, import_react6.useRef)(null);
1451
+ const { open, setOpen, setValue, selectedLabel } = (0, import_zustand3.useStore)(store, (s) => s);
1452
+ const generatedId = (0, import_react6.useId)();
1453
+ const selectId = id ?? `select-${generatedId}`;
1454
+ const findLabelForValue = (children2, targetValue) => {
1455
+ let found = null;
1456
+ const search = (nodes) => {
1457
+ import_react6.Children.forEach(nodes, (child) => {
1458
+ if (!(0, import_react6.isValidElement)(child)) return;
1459
+ const typedChild = child;
1460
+ if (typedChild.type === SelectItem && typedChild.props.value === targetValue) {
1461
+ if (typeof typedChild.props.children === "string")
1462
+ found = typedChild.props.children;
1463
+ }
1464
+ if (typedChild.props.children && !found)
1465
+ search(typedChild.props.children);
1466
+ });
1467
+ };
1468
+ search(children2);
1469
+ return found;
1470
+ };
1471
+ (0, import_react6.useEffect)(() => {
1472
+ if (!selectedLabel && defaultValue) {
1473
+ const label2 = findLabelForValue(children, defaultValue);
1474
+ if (label2) store.setState({ selectedLabel: label2 });
1475
+ }
1476
+ }, [children, defaultValue, selectedLabel]);
1477
+ (0, import_react6.useEffect)(() => {
1478
+ const handleClickOutside = (event) => {
1479
+ if (selectRef.current && !selectRef.current.contains(event.target)) {
1480
+ setOpen(false);
1481
+ }
1482
+ };
1483
+ const handleArrowKeys = (event) => {
1484
+ const selectContent = selectRef.current?.querySelector('[role="menu"]');
1485
+ if (selectContent) {
1486
+ event.preventDefault();
1487
+ const items = Array.from(
1488
+ selectContent.querySelectorAll(
1489
+ '[role="menuitem"]:not([aria-disabled="true"])'
1490
+ )
1491
+ ).filter((el) => el instanceof HTMLElement);
1492
+ const focused = document.activeElement;
1493
+ const currentIndex = items.findIndex((item) => item === focused);
1494
+ let nextIndex = 0;
1495
+ if (event.key === "ArrowDown") {
1496
+ nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;
1497
+ } else {
1498
+ nextIndex = currentIndex === -1 ? items.length - 1 : (currentIndex - 1 + items.length) % items.length;
1499
+ }
1500
+ items[nextIndex]?.focus();
1501
+ }
1502
+ };
1503
+ if (open) {
1504
+ document.addEventListener("mousedown", handleClickOutside);
1505
+ document.addEventListener("keydown", handleArrowKeys);
1506
+ }
1507
+ return () => {
1508
+ document.removeEventListener("mousedown", handleClickOutside);
1509
+ document.removeEventListener("keydown", handleArrowKeys);
1510
+ };
1511
+ }, [open]);
1512
+ (0, import_react6.useEffect)(() => {
1513
+ if (propValue) {
1514
+ setValue(propValue);
1515
+ const label2 = findLabelForValue(children, propValue);
1516
+ if (label2) store.setState({ selectedLabel: label2 });
1517
+ }
1518
+ }, [propValue]);
1519
+ const sizeClasses = SIZE_CLASSES6[size];
1520
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w-full", children: [
1521
+ label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1522
+ "label",
1523
+ {
1524
+ htmlFor: selectId,
1525
+ className: `block font-bold text-text-900 mb-1.5 ${sizeClasses}`,
1526
+ children: label
1527
+ }
1528
+ ),
1529
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `relative ${sizeClasses}`, ref: selectRef, children: injectStore2(children, store, size, selectId) }),
1530
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
1531
+ helperText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
1532
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
1533
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_phosphor_react4.WarningCircle, { size: 16 }),
1534
+ " ",
1535
+ errorMessage
1536
+ ] })
1537
+ ] })
1538
+ ] });
1539
+ };
1540
+ var SelectValue = ({
1541
+ placeholder,
1542
+ store: externalStore
1543
+ }) => {
1544
+ const store = useSelectStore(externalStore);
1545
+ const selectedLabel = (0, import_zustand3.useStore)(store, (s) => s.selectedLabel);
1546
+ const value = (0, import_zustand3.useStore)(store, (s) => s.value);
1547
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
1548
+ };
1549
+ var SelectTrigger = (0, import_react6.forwardRef)(
1550
+ ({
1551
+ className,
1552
+ invalid = false,
1553
+ variant = "outlined",
1554
+ store: externalStore,
1555
+ disabled,
1556
+ size = "medium",
1557
+ selectId,
1558
+ ...props
1559
+ }, ref) => {
1560
+ const store = useSelectStore(externalStore);
1561
+ const open = (0, import_zustand3.useStore)(store, (s) => s.open);
1562
+ const toggleOpen = () => store.setState({ open: !open });
1563
+ const variantClasses = VARIANT_CLASSES[variant];
1564
+ const heightClasses = HEIGHT_CLASSES[size];
1565
+ const paddingClasses = PADDING_CLASSES[size];
1566
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1567
+ "button",
1568
+ {
1569
+ ref,
1570
+ id: selectId,
1571
+ className: `
1572
+ flex min-w-[220px] w-full items-center justify-between border-border-300
1573
+ ${heightClasses} ${paddingClasses}
1574
+ ${invalid && `${variant == "underlined" ? "border-b-2" : "border-2"} border-indicator-error text-text-600`}
1575
+ ${disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
1576
+ ${!invalid && !disabled ? "text-text-700" : ""}
1577
+ ${variantClasses}
1578
+ ${className}
1579
+ `,
1580
+ onClick: toggleOpen,
1581
+ "aria-expanded": open,
1582
+ "aria-haspopup": "listbox",
1583
+ "aria-controls": open ? "select-content" : void 0,
1584
+ ...props,
1585
+ children: [
1586
+ props.children,
1587
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1588
+ import_phosphor_react4.CaretDown,
1589
+ {
1590
+ className: `h-[1em] w-[1em] opacity-50 transition-transform ${open ? "rotate-180" : ""}`
1591
+ }
1592
+ )
1593
+ ]
1594
+ }
1595
+ );
1596
+ }
1597
+ );
1598
+ SelectTrigger.displayName = "SelectTrigger";
1599
+ var SelectContent = (0, import_react6.forwardRef)(
1600
+ ({
1601
+ children,
1602
+ className,
1603
+ align = "start",
1604
+ side = "bottom",
1605
+ store: externalStore,
1606
+ ...props
1607
+ }, ref) => {
1608
+ const store = useSelectStore(externalStore);
1609
+ const open = (0, import_zustand3.useStore)(store, (s) => s.open);
1610
+ if (!open) return null;
1611
+ const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES[side]} ${ALIGN_CLASSES[align]}`;
1612
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1613
+ "div",
1614
+ {
1615
+ role: "menu",
1616
+ ref,
1617
+ className: `bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100 ${getPositionClasses()} ${className}`,
1618
+ ...props,
1619
+ children
1620
+ }
1621
+ );
1622
+ }
1623
+ );
1624
+ SelectContent.displayName = "SelectContent";
1625
+ var SelectItem = (0, import_react6.forwardRef)(
1626
+ ({
1627
+ className,
1628
+ children,
1629
+ value,
1630
+ disabled = false,
1631
+ store: externalStore,
1632
+ ...props
1633
+ }, ref) => {
1634
+ const store = useSelectStore(externalStore);
1635
+ const {
1636
+ value: selectedValue,
1637
+ setValue,
1638
+ setOpen,
1639
+ setSelectedLabel,
1640
+ onValueChange
1641
+ } = (0, import_zustand3.useStore)(store, (s) => s);
1642
+ const handleClick = (e) => {
1643
+ const labelNode = getLabelAsNode(children);
1644
+ if (!disabled) {
1645
+ setValue(value);
1646
+ setSelectedLabel(labelNode);
1647
+ setOpen(false);
1648
+ onValueChange?.(value);
1649
+ }
1650
+ props.onClick?.(e);
1651
+ };
1652
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1653
+ "div",
1654
+ {
1655
+ role: "menuitem",
1656
+ "aria-disabled": disabled,
1657
+ ref,
1658
+ className: `
1659
+ focus-visible:bg-background-50
1660
+ relative flex select-none items-center gap-2 rounded-sm p-3 outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0
1661
+ ${className}
1662
+ ${disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
1663
+ ${selectedValue === value && "bg-background-50"}
1664
+ `,
1665
+ onClick: handleClick,
1666
+ onKeyDown: (e) => {
1667
+ if (e.key === "Enter" || e.key === " ") handleClick(e);
1668
+ },
1669
+ tabIndex: disabled ? -1 : 0,
1670
+ ...props,
1671
+ children: [
1672
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_phosphor_react4.Check, { className: "" }) }),
1673
+ children
1674
+ ]
1675
+ }
1676
+ );
1677
+ }
1678
+ );
1679
+ SelectItem.displayName = "SelectItem";
1680
+ var Select_default = Select;
1681
+
1682
+ // src/components/Card/Card.tsx
1683
+ var import_react7 = require("react");
1684
+
1685
+ // src/components/ProgressBar/ProgressBar.tsx
1686
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1687
+ var SIZE_CLASSES7 = {
1688
+ small: {
1689
+ container: "h-1",
1690
+ // 4px height (h-1 = 4px in Tailwind)
1691
+ bar: "h-1",
1692
+ // 4px height for the fill bar
1693
+ spacing: "gap-2",
1694
+ // 8px gap between label and progress bar
1695
+ layout: "flex-col",
1696
+ // vertical layout for small
1697
+ borderRadius: "rounded-full"
1698
+ // 9999px border radius
1699
+ },
1700
+ medium: {
1701
+ container: "h-2",
1702
+ // 8px height (h-2 = 8px in Tailwind)
1703
+ bar: "h-2",
1704
+ // 8px height for the fill bar
1705
+ spacing: "gap-2",
1706
+ // 8px gap between progress bar and label
1707
+ layout: "flex-row items-center",
1708
+ // horizontal layout for medium
1709
+ borderRadius: "rounded-lg"
1710
+ // 8px border radius
1711
+ }
1712
+ };
1713
+ var VARIANT_CLASSES2 = {
1714
+ blue: {
1715
+ background: "bg-background-300",
1716
+ // Background track color (#D5D4D4)
1717
+ fill: "bg-primary-700"
1718
+ // Blue for activity progress (#2271C4)
1719
+ },
1720
+ green: {
1721
+ background: "bg-background-300",
1722
+ // Background track color (#D5D4D4)
1723
+ fill: "bg-success-200"
1724
+ // Green for performance (#84D3A2)
1725
+ }
1726
+ };
1727
+ var calculateProgressValues = (value, max) => {
1728
+ const safeValue = isNaN(value) ? 0 : value;
1729
+ const clampedValue = Math.max(0, Math.min(safeValue, max));
1730
+ const percentage = max === 0 ? 0 : clampedValue / max * 100;
1731
+ return { clampedValue, percentage };
1732
+ };
1733
+ var shouldShowHeader = (label, showPercentage, showHitCount) => {
1734
+ return !!(label || showPercentage || showHitCount);
1735
+ };
1736
+ var getDisplayPriority = (showHitCount, showPercentage, label, clampedValue, max, percentage) => {
1737
+ if (showHitCount) {
1738
+ return {
1739
+ type: "hitCount",
1740
+ content: `${Math.round(clampedValue)} de ${max}`,
1741
+ hasMetrics: true
1742
+ };
1743
+ }
1744
+ if (showPercentage) {
1745
+ return {
1746
+ type: "percentage",
1747
+ content: `${Math.round(percentage)}%`,
1748
+ hasMetrics: true
1749
+ };
1750
+ }
1751
+ return {
1752
+ type: "label",
1753
+ content: label,
1754
+ hasMetrics: false
1755
+ };
1756
+ };
1757
+ var getCompactLayoutConfig = ({
1758
+ showPercentage,
1759
+ showHitCount,
1760
+ percentage,
1761
+ clampedValue,
1762
+ max,
1763
+ label,
1764
+ percentageClassName,
1765
+ labelClassName
1766
+ }) => {
1767
+ const displayPriority = getDisplayPriority(
1768
+ showHitCount,
1769
+ showPercentage,
1770
+ label,
1771
+ clampedValue,
1772
+ max,
1773
+ percentage
1774
+ );
1775
+ return {
1776
+ color: displayPriority.hasMetrics ? "text-primary-600" : "text-primary-700",
1777
+ className: displayPriority.hasMetrics ? percentageClassName : labelClassName,
1778
+ content: displayPriority.content
1779
+ };
1780
+ };
1781
+ var getDefaultLayoutDisplayConfig = (size, label, showPercentage) => ({
1782
+ showHeader: size === "small" && !!(label || showPercentage),
1783
+ showPercentage: size === "medium" && showPercentage,
1784
+ showLabel: size === "medium" && !!label && !showPercentage
1785
+ // Only show label when percentage is not shown
1786
+ });
1787
+ var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue, max, percentage, percentageClassName) => {
1788
+ if (!showHitCount && !showPercentage) return null;
1789
+ const displayPriority = getDisplayPriority(
1790
+ showHitCount,
1791
+ showPercentage,
1792
+ null,
1793
+ // label is not relevant for stacked layout metrics display
1794
+ clampedValue,
1795
+ max,
1796
+ percentage
1797
+ );
1798
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1799
+ "div",
1800
+ {
1801
+ className: `text-xs font-medium leading-[14px] text-right ${percentageClassName}`,
1802
+ children: displayPriority.type === "hitCount" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1803
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-success-200", children: Math.round(clampedValue) }),
1804
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-text-600", children: [
1805
+ " de ",
1806
+ max
1807
+ ] })
1808
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text_default, { size: "xs", weight: "medium", className: "text-success-200", children: [
1809
+ Math.round(percentage),
1810
+ "%"
1811
+ ] })
1812
+ }
1813
+ );
1814
+ };
1815
+ var ProgressBarBase = ({
1816
+ clampedValue,
1817
+ max,
1818
+ percentage,
1819
+ label,
1820
+ variantClasses,
1821
+ containerClassName,
1822
+ fillClassName
1823
+ }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1824
+ "div",
1825
+ {
1826
+ className: `${containerClassName} ${variantClasses.background} overflow-hidden relative`,
1827
+ children: [
1828
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1829
+ "progress",
1830
+ {
1831
+ value: clampedValue,
1832
+ max,
1833
+ "aria-label": typeof label === "string" ? `${label}: ${Math.round(percentage)}% complete` : `Progress: ${Math.round(percentage)}% of ${max}`,
1834
+ className: "absolute inset-0 w-full h-full opacity-0"
1835
+ }
1836
+ ),
1837
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1838
+ "div",
1839
+ {
1840
+ className: `${fillClassName} ${variantClasses.fill} transition-all duration-300 ease-out`,
1841
+ style: { width: `${percentage}%` }
1842
+ }
1843
+ )
1844
+ ]
1845
+ }
1846
+ );
1847
+ var StackedLayout = ({
1848
+ className,
1849
+ label,
1850
+ showPercentage,
1851
+ showHitCount,
1852
+ labelClassName,
1853
+ percentageClassName,
1854
+ clampedValue,
1855
+ max,
1856
+ percentage,
1857
+ variantClasses,
1858
+ dimensions
1859
+ }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1860
+ "div",
1861
+ {
1862
+ className: `flex flex-col items-start gap-2 ${dimensions.width} ${dimensions.height} ${className}`,
1863
+ children: [
1864
+ shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
1865
+ label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1866
+ Text_default,
1867
+ {
1868
+ as: "div",
1869
+ size: "md",
1870
+ weight: "medium",
1871
+ className: `text-text-600 leading-[19px] ${labelClassName}`,
1872
+ children: label
1873
+ }
1874
+ ),
1875
+ renderStackedHitCountDisplay(
1876
+ showHitCount,
1877
+ showPercentage,
1878
+ clampedValue,
1879
+ max,
1880
+ percentage,
1881
+ percentageClassName
1882
+ )
1883
+ ] }),
1884
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1885
+ ProgressBarBase,
1886
+ {
1887
+ clampedValue,
1888
+ max,
1889
+ percentage,
1890
+ label,
1891
+ variantClasses,
1892
+ containerClassName: "w-full h-2 rounded-lg",
1893
+ fillClassName: "h-2 rounded-lg shadow-hard-shadow-3"
1894
+ }
1895
+ )
1896
+ ]
1897
+ }
1898
+ );
1899
+ var CompactLayout = ({
1900
+ className,
1901
+ label,
1902
+ showPercentage,
1903
+ showHitCount,
1904
+ labelClassName,
1905
+ percentageClassName,
1906
+ clampedValue,
1907
+ max,
1908
+ percentage,
1909
+ variantClasses,
1910
+ dimensions
1911
+ }) => {
1912
+ const {
1913
+ color,
1914
+ className: compactClassName,
1915
+ content
1916
+ } = getCompactLayoutConfig({
1917
+ showPercentage,
1918
+ showHitCount,
1919
+ percentage,
1920
+ clampedValue,
1921
+ max,
1922
+ label,
1923
+ percentageClassName,
1924
+ labelClassName
1925
+ });
1926
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1927
+ "div",
1928
+ {
1929
+ className: `flex flex-col items-start gap-1 ${dimensions.width} ${dimensions.height} ${className}`,
1930
+ children: [
1931
+ shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1932
+ Text_default,
1933
+ {
1934
+ as: "div",
1935
+ size: "sm",
1936
+ weight: "medium",
1937
+ color,
1938
+ className: `leading-4 w-full ${compactClassName}`,
1939
+ children: content
1940
+ }
1941
+ ),
1942
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1943
+ ProgressBarBase,
1944
+ {
1945
+ clampedValue,
1946
+ max,
1947
+ percentage,
1948
+ label,
1949
+ variantClasses,
1950
+ containerClassName: "w-full h-1 rounded-full",
1951
+ fillClassName: "h-1 rounded-full"
1952
+ }
1953
+ )
1954
+ ]
1955
+ }
1956
+ );
1957
+ };
1958
+ var DefaultLayout = ({
1959
+ className,
1960
+ size,
1961
+ sizeClasses,
1962
+ variantClasses,
1963
+ label,
1964
+ showPercentage,
1965
+ labelClassName,
1966
+ percentageClassName,
1967
+ clampedValue,
1968
+ max,
1969
+ percentage
1970
+ }) => {
1971
+ const gapClass = size === "medium" ? "gap-2" : sizeClasses.spacing;
1972
+ const progressBarClass = size === "medium" ? "flex-grow" : "w-full";
1973
+ const displayConfig = getDefaultLayoutDisplayConfig(
1974
+ size,
1975
+ label,
1976
+ showPercentage
1977
+ );
1978
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex ${sizeClasses.layout} ${gapClass} ${className}`, children: [
1979
+ displayConfig.showHeader && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-row items-center justify-between w-full", children: [
1980
+ label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1981
+ Text_default,
1982
+ {
1983
+ as: "div",
1984
+ size: "xs",
1985
+ weight: "medium",
1986
+ className: `text-text-950 leading-none tracking-normal text-center ${labelClassName}`,
1987
+ children: label
1988
+ }
1989
+ ),
1990
+ showPercentage && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1991
+ Text_default,
1992
+ {
1993
+ size: "xs",
1994
+ weight: "medium",
1995
+ className: `text-text-950 leading-none tracking-normal text-center ${percentageClassName}`,
1996
+ children: [
1997
+ Math.round(percentage),
1998
+ "%"
1999
+ ]
2000
+ }
2001
+ )
2002
+ ] }),
2003
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2004
+ ProgressBarBase,
2005
+ {
2006
+ clampedValue,
2007
+ max,
2008
+ percentage,
2009
+ label,
2010
+ variantClasses,
2011
+ containerClassName: `${progressBarClass} ${sizeClasses.container} ${sizeClasses.borderRadius}`,
2012
+ fillClassName: `${sizeClasses.bar} ${sizeClasses.borderRadius} shadow-hard-shadow-3`
2013
+ }
2014
+ ),
2015
+ displayConfig.showPercentage && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2016
+ Text_default,
2017
+ {
2018
+ size: "xs",
2019
+ weight: "medium",
2020
+ className: `text-text-950 leading-none tracking-normal text-center flex-none ${percentageClassName}`,
2021
+ children: [
2022
+ Math.round(percentage),
2023
+ "%"
2024
+ ]
2025
+ }
2026
+ ),
2027
+ displayConfig.showLabel && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2028
+ Text_default,
2029
+ {
2030
+ as: "div",
2031
+ size: "xs",
2032
+ weight: "medium",
2033
+ className: `text-text-950 leading-none tracking-normal text-center flex-none ${labelClassName}`,
2034
+ children: label
2035
+ }
2036
+ )
2037
+ ] });
2038
+ };
2039
+ var ProgressBar = ({
2040
+ value,
2041
+ max = 100,
2042
+ size = "medium",
2043
+ variant = "blue",
2044
+ layout = "default",
2045
+ label,
2046
+ showPercentage = false,
2047
+ showHitCount = false,
2048
+ className = "",
2049
+ labelClassName = "",
2050
+ percentageClassName = "",
2051
+ stackedWidth,
2052
+ stackedHeight,
2053
+ compactWidth,
2054
+ compactHeight
2055
+ }) => {
2056
+ const { clampedValue, percentage } = calculateProgressValues(value, max);
2057
+ const sizeClasses = SIZE_CLASSES7[size];
2058
+ const variantClasses = VARIANT_CLASSES2[variant];
2059
+ if (layout === "stacked") {
2060
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2061
+ StackedLayout,
2062
+ {
2063
+ className,
2064
+ label,
2065
+ showPercentage,
2066
+ showHitCount,
2067
+ labelClassName,
2068
+ percentageClassName,
2069
+ clampedValue,
2070
+ max,
2071
+ percentage,
2072
+ variantClasses,
2073
+ dimensions: {
2074
+ width: stackedWidth ?? "w-[380px]",
2075
+ height: stackedHeight ?? "h-[35px]"
2076
+ }
2077
+ }
2078
+ );
2079
+ }
2080
+ if (layout === "compact") {
2081
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2082
+ CompactLayout,
2083
+ {
2084
+ className,
2085
+ label,
2086
+ showPercentage,
2087
+ showHitCount,
2088
+ labelClassName,
2089
+ percentageClassName,
2090
+ clampedValue,
2091
+ max,
2092
+ percentage,
2093
+ variantClasses,
2094
+ dimensions: {
2095
+ width: compactWidth ?? "w-[131px]",
2096
+ height: compactHeight ?? "h-[24px]"
2097
+ }
2098
+ }
2099
+ );
2100
+ }
2101
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2102
+ DefaultLayout,
2103
+ {
2104
+ className,
2105
+ size,
2106
+ sizeClasses,
2107
+ variantClasses,
2108
+ label,
2109
+ showPercentage,
2110
+ labelClassName,
2111
+ percentageClassName,
2112
+ clampedValue,
2113
+ max,
2114
+ percentage
2115
+ }
2116
+ );
2117
+ };
2118
+ var ProgressBar_default = ProgressBar;
2119
+
2120
+ // src/components/Card/Card.tsx
2121
+ var import_phosphor_react5 = require("phosphor-react");
2122
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2123
+ var CARD_BASE_CLASSES = {
2124
+ default: "w-full bg-background border border-border-50 rounded-xl",
2125
+ compact: "w-full bg-background border border-border-50 rounded-lg",
2126
+ minimal: "w-full bg-background border border-border-100 rounded-md"
2127
+ };
2128
+ var CARD_PADDING_CLASSES = {
2129
+ none: "",
2130
+ small: "p-2",
2131
+ medium: "p-4",
2132
+ large: "p-6"
2133
+ };
2134
+ var CARD_MIN_HEIGHT_CLASSES = {
2135
+ none: "",
2136
+ small: "min-h-16",
2137
+ medium: "min-h-20",
2138
+ large: "min-h-24"
2139
+ };
2140
+ var CARD_LAYOUT_CLASSES = {
2141
+ horizontal: "flex flex-row",
2142
+ vertical: "flex flex-col"
2143
+ };
2144
+ var CARD_CURSOR_CLASSES = {
2145
+ default: "",
2146
+ pointer: "cursor-pointer"
2147
+ };
2148
+ var CardBase = (0, import_react7.forwardRef)(
2149
+ ({
2150
+ children,
2151
+ variant = "default",
2152
+ layout = "horizontal",
2153
+ padding = "medium",
2154
+ minHeight = "medium",
2155
+ cursor = "default",
2156
+ className = "",
2157
+ ...props
2158
+ }, ref) => {
2159
+ const baseClasses = CARD_BASE_CLASSES[variant];
2160
+ const paddingClasses = CARD_PADDING_CLASSES[padding];
2161
+ const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
2162
+ const layoutClasses = CARD_LAYOUT_CLASSES[layout];
2163
+ const cursorClasses = CARD_CURSOR_CLASSES[cursor];
2164
+ const combinedClasses = [
2165
+ baseClasses,
2166
+ paddingClasses,
2167
+ minHeightClasses,
2168
+ layoutClasses,
2169
+ cursorClasses,
2170
+ className
2171
+ ].filter(Boolean).join(" ");
2172
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref, className: combinedClasses, ...props, children });
2173
+ }
2174
+ );
2175
+ var ACTION_CARD_CLASSES = {
2176
+ warning: "bg-warning-background",
2177
+ success: "bg-success-300",
2178
+ error: "bg-error-100",
2179
+ info: "bg-info-background"
2180
+ };
2181
+ var ACTION_ICON_CLASSES = {
2182
+ warning: "bg-warning-300 text-text",
2183
+ success: "bg-yellow-300 text-text-950",
2184
+ error: "bg-error-500 text-text",
2185
+ info: "bg-info-500 text-text"
2186
+ };
2187
+ var ACTION_SUBTITLE_CLASSES = {
2188
+ warning: "text-warning-600",
2189
+ success: "text-success-700",
2190
+ error: "text-error-700",
2191
+ info: "text-info-700"
2192
+ };
2193
+ var ACTION_HEADER_CLASSES = {
2194
+ warning: "text-warning-300",
2195
+ success: "text-success-300",
2196
+ error: "text-error-300",
2197
+ info: "text-info-300"
2198
+ };
2199
+ var CardActivitiesResults = (0, import_react7.forwardRef)(
2200
+ ({
2201
+ icon,
2202
+ title,
2203
+ subTitle,
2204
+ header,
2205
+ extended = false,
2206
+ action = "success",
2207
+ description,
2208
+ className,
2209
+ ...props
2210
+ }, ref) => {
2211
+ const actionCardClasses = ACTION_CARD_CLASSES[action];
2212
+ const actionIconClasses = ACTION_ICON_CLASSES[action];
2213
+ const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
2214
+ const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
2215
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2216
+ "div",
2217
+ {
2218
+ ref,
2219
+ className: `w-full flex flex-col border border-border-50 bg-background rounded-xl ${className}`,
2220
+ ...props,
2221
+ children: [
2222
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2223
+ "div",
2224
+ {
2225
+ className: `
2226
+ flex flex-col gap-1 items-center justify-center p-4
2227
+ ${actionCardClasses}
2228
+ ${extended ? "rounded-t-xl" : "rounded-xl"}`,
2229
+ children: [
2230
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2231
+ "span",
2232
+ {
2233
+ className: `size-7.5 rounded-full flex items-center justify-center ${actionIconClasses}`,
2234
+ children: icon
2235
+ }
2236
+ ),
2237
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2238
+ Text_default,
2239
+ {
2240
+ size: "2xs",
2241
+ weight: "medium",
2242
+ className: "text-text-800 uppercase truncate",
2243
+ children: title
2244
+ }
2245
+ ),
2246
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: `text-lg font-bold truncate ${actionSubTitleClasses}`, children: subTitle })
2247
+ ]
2248
+ }
2249
+ ),
2250
+ extended && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
2251
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2252
+ "p",
2253
+ {
2254
+ className: `text-2xs font-medium uppercase truncate ${actionHeaderClasses}`,
2255
+ children: header
2256
+ }
2257
+ ),
2258
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Badge_default, { size: "large", action: "info", children: description })
2259
+ ] })
2260
+ ]
2261
+ }
2262
+ );
2263
+ }
2264
+ );
2265
+ var CardQuestions = (0, import_react7.forwardRef)(
2266
+ ({
2267
+ header,
2268
+ state = "undone",
2269
+ className,
2270
+ onClickButton,
2271
+ valueButton,
2272
+ ...props
2273
+ }, ref) => {
2274
+ const isDone = state === "done";
2275
+ const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
2276
+ const buttonLabel = isDone ? "Ver Quest\xE3o" : "Responder";
2277
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2278
+ CardBase,
2279
+ {
2280
+ ref,
2281
+ layout: "horizontal",
2282
+ padding: "medium",
2283
+ minHeight: "medium",
2284
+ className: `justify-between gap-4 ${className}`,
2285
+ ...props,
2286
+ children: [
2287
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
2288
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
2289
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
2290
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2291
+ Badge_default,
2292
+ {
2293
+ size: "medium",
2294
+ variant: "solid",
2295
+ action: isDone ? "success" : "error",
2296
+ children: stateLabel
2297
+ }
2298
+ ),
2299
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-row items-center gap-1 text-text-700 text-xs", children: [
2300
+ isDone ? "Nota" : "Sem nota",
2301
+ isDone && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Badge_default, { size: "medium", action: "success", children: "00" })
2302
+ ] })
2303
+ ] })
2304
+ ] }),
2305
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2306
+ Button_default,
2307
+ {
2308
+ size: "extra-small",
2309
+ onClick: () => onClickButton?.(valueButton),
2310
+ className: "min-w-fit",
2311
+ children: buttonLabel
2312
+ }
2313
+ ) })
2314
+ ]
2315
+ }
2316
+ );
2317
+ }
2318
+ );
2319
+ var CardProgress = (0, import_react7.forwardRef)(
2320
+ ({
2321
+ header,
2322
+ subhead,
2323
+ initialDate,
2324
+ endDate,
2325
+ progress = 0,
2326
+ direction = "horizontal",
2327
+ icon,
2328
+ color = "#B7DFFF",
2329
+ progressVariant = "blue",
2330
+ showDates = true,
2331
+ className,
2332
+ ...props
2333
+ }, ref) => {
2334
+ const isHorizontal = direction === "horizontal";
2335
+ const contentComponent = {
2336
+ horizontal: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
2337
+ showDates && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
2338
+ initialDate && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
2339
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
2340
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-600", children: initialDate })
2341
+ ] }),
2342
+ endDate && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
2343
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-800 font-semibold", children: "Fim" }),
2344
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-600", children: endDate })
2345
+ ] })
2346
+ ] }),
2347
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
2348
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2349
+ ProgressBar_default,
2350
+ {
2351
+ size: "small",
2352
+ value: progress,
2353
+ variant: progressVariant,
2354
+ "data-testid": "progress-bar"
2355
+ }
2356
+ ),
2357
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2358
+ Text_default,
2359
+ {
2360
+ size: "xs",
2361
+ weight: "medium",
2362
+ className: `text-text-950 leading-none tracking-normal text-center flex-none`,
2363
+ children: [
2364
+ Math.round(progress),
2365
+ "%"
2366
+ ]
2367
+ }
2368
+ )
2369
+ ] })
2370
+ ] }),
2371
+ vertical: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-text-800", children: subhead })
2372
+ };
2373
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2374
+ CardBase,
2375
+ {
2376
+ ref,
2377
+ layout: isHorizontal ? "horizontal" : "vertical",
2378
+ padding: "none",
2379
+ minHeight: "medium",
2380
+ cursor: "pointer",
2381
+ className: `${isHorizontal ? "h-20" : ""} ${className}`,
2382
+ ...props,
2383
+ children: [
2384
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2385
+ "div",
2386
+ {
2387
+ className: `
2388
+ flex justify-center items-center [&>svg]:size-6 text-text-950
2389
+ ${isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl"}
2390
+ ${!color.startsWith("#") ? `bg-${color}` : ""}
2391
+ `,
2392
+ style: color.startsWith("#") ? { backgroundColor: color } : void 0,
2393
+ "data-testid": "icon-container",
2394
+ children: icon
2395
+ }
2396
+ ),
2397
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2398
+ "div",
2399
+ {
2400
+ className: `
2401
+ p-4 flex flex-col justify-between w-full h-full
2402
+ ${!isHorizontal && "gap-4"}
2403
+ `,
2404
+ children: [
2405
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
2406
+ contentComponent[direction]
2407
+ ]
2408
+ }
2409
+ )
2410
+ ]
2411
+ }
2412
+ );
2413
+ }
2414
+ );
2415
+ var CardTopic = (0, import_react7.forwardRef)(
2416
+ ({
2417
+ header,
2418
+ subHead,
2419
+ progress,
2420
+ showPercentage = false,
2421
+ progressVariant = "blue",
2422
+ className = "",
2423
+ ...props
2424
+ }, ref) => {
2425
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2426
+ CardBase,
2427
+ {
2428
+ ref,
2429
+ layout: "vertical",
2430
+ padding: "small",
2431
+ minHeight: "medium",
2432
+ cursor: "pointer",
2433
+ className: `justify-center gap-2 py-2 px-4 ${className}`,
2434
+ ...props,
2435
+ children: [
2436
+ subHead && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react7.Fragment, { children: [
2437
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: text }),
2438
+ index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: "\u2022" })
2439
+ ] }, `${text} - ${index}`)) }),
2440
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
2441
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
2442
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2443
+ ProgressBar_default,
2444
+ {
2445
+ size: "small",
2446
+ value: progress,
2447
+ variant: progressVariant,
2448
+ "data-testid": "progress-bar"
2449
+ }
2450
+ ),
2451
+ showPercentage && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2452
+ Text_default,
2453
+ {
2454
+ size: "xs",
2455
+ weight: "medium",
2456
+ className: `text-text-950 leading-none tracking-normal text-center flex-none`,
2457
+ children: [
2458
+ Math.round(progress),
2459
+ "%"
2460
+ ]
2461
+ }
2462
+ )
2463
+ ] })
2464
+ ]
2465
+ }
2466
+ );
2467
+ }
2468
+ );
2469
+ var CardPerformance = (0, import_react7.forwardRef)(
2470
+ ({
2471
+ header,
2472
+ progress,
2473
+ description = "Sem dados ainda! Voc\xEA ainda n\xE3o fez um question\xE1rio neste assunto.",
2474
+ actionVariant = "button",
2475
+ progressVariant = "blue",
2476
+ labelProgress = "",
2477
+ className = "",
2478
+ onClickButton,
2479
+ valueButton,
2480
+ ...props
2481
+ }, ref) => {
2482
+ const hasProgress = progress !== void 0;
2483
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2484
+ CardBase,
2485
+ {
2486
+ ref,
2487
+ layout: "horizontal",
2488
+ padding: "medium",
2489
+ minHeight: "none",
2490
+ className: `justify-between gap-2 ${actionVariant == "caret" ? "cursor-pointer" : ""} ${className}`,
2491
+ onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
2492
+ ...props,
2493
+ children: [
2494
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
2495
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-row justify-between items-center gap-2", children: [
2496
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
2497
+ actionVariant === "button" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2498
+ Button_default,
2499
+ {
2500
+ variant: "outline",
2501
+ size: "extra-small",
2502
+ onClick: () => onClickButton?.(valueButton),
2503
+ className: "min-w-fit flex-shrink-0",
2504
+ children: "Ver Aula"
2505
+ }
2506
+ )
2507
+ ] }),
2508
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2509
+ ProgressBar_default,
2510
+ {
2511
+ value: progress,
2512
+ label: `${progress}% ${labelProgress}`,
2513
+ variant: progressVariant
2514
+ }
2515
+ ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-xs text-text-600 truncate", children: description }) })
2516
+ ] }),
2517
+ actionVariant == "caret" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2518
+ import_phosphor_react5.CaretRight,
2519
+ {
2520
+ className: "size-4.5 text-text-800 cursor-pointer",
2521
+ "data-testid": "caret-icon"
2522
+ }
2523
+ )
2524
+ ]
2525
+ }
2526
+ );
2527
+ }
2528
+ );
2529
+ var CardResults = (0, import_react7.forwardRef)(
2530
+ ({
2531
+ header,
2532
+ correct_answers,
2533
+ incorrect_answers,
2534
+ icon,
2535
+ direction = "col",
2536
+ color = "#B7DFFF",
2537
+ className,
2538
+ ...props
2539
+ }, ref) => {
2540
+ const isRow = direction == "row";
2541
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2542
+ CardBase,
2543
+ {
2544
+ ref,
2545
+ layout: "horizontal",
2546
+ padding: "none",
2547
+ minHeight: "medium",
2548
+ className: `items-center cursor-pointer pr-4 ${className}`,
2549
+ ...props,
2550
+ children: [
2551
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2552
+ "div",
2553
+ {
2554
+ className: `
2555
+ flex justify-center items-center [&>svg]:size-8 text-text-950 min-w-20 max-w-20 min-h-20 h-full rounded-l-xl
2556
+ `,
2557
+ style: {
2558
+ backgroundColor: color
2559
+ },
2560
+ children: icon
2561
+ }
2562
+ ),
2563
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2564
+ "div",
2565
+ {
2566
+ className: `
2567
+ p-4 flex justify-between w-full h-full
2568
+ ${isRow ? "flex-row items-center gap-2" : "flex-col"}
2569
+ `,
2570
+ children: [
2571
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
2572
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-row gap-1 items-center", children: [
2573
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2574
+ Badge_default,
2575
+ {
2576
+ action: "success",
2577
+ variant: "solid",
2578
+ size: "large",
2579
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.CheckCircle, {}),
2580
+ children: [
2581
+ correct_answers,
2582
+ " Corretas"
2583
+ ]
2584
+ }
2585
+ ),
2586
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2587
+ Badge_default,
2588
+ {
2589
+ action: "error",
2590
+ variant: "solid",
2591
+ size: "large",
2592
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.XCircle, {}),
2593
+ children: [
2594
+ incorrect_answers,
2595
+ " Incorretas"
2596
+ ]
2597
+ }
2598
+ )
2599
+ ] })
2600
+ ]
2601
+ }
2602
+ ),
2603
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
2604
+ ]
2605
+ }
2606
+ );
2607
+ }
2608
+ );
2609
+ var CardStatus = (0, import_react7.forwardRef)(
2610
+ ({ header, className, status, label, ...props }, ref) => {
2611
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2612
+ CardBase,
2613
+ {
2614
+ ref,
2615
+ layout: "horizontal",
2616
+ padding: "medium",
2617
+ minHeight: "medium",
2618
+ className: `items-center cursor-pointer ${className}`,
2619
+ ...props,
2620
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
2621
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
2622
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
2623
+ status && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2624
+ Badge_default,
2625
+ {
2626
+ action: status == "correct" ? "success" : "error",
2627
+ variant: "solid",
2628
+ size: "medium",
2629
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.CheckCircle, {}),
2630
+ children: status == "correct" ? "Correta" : "Incorreta"
2631
+ }
2632
+ ),
2633
+ label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-text-800", children: label })
2634
+ ] }),
2635
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
2636
+ ] })
2637
+ }
2638
+ );
2639
+ }
2640
+ );
2641
+ var CardSettings = (0, import_react7.forwardRef)(
2642
+ ({ header, className, icon, ...props }, ref) => {
2643
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2644
+ CardBase,
2645
+ {
2646
+ ref,
2647
+ layout: "horizontal",
2648
+ padding: "small",
2649
+ minHeight: "none",
2650
+ className: `border-none items-center gap-2 text-text-700 ${className}`,
2651
+ ...props,
2652
+ children: [
2653
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
2654
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "w-full text-sm truncate", children: header }),
2655
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.CaretRight, { size: 24, className: "cursor-pointer" })
2656
+ ]
2657
+ }
2658
+ );
2659
+ }
2660
+ );
2661
+ var CardSupport = (0, import_react7.forwardRef)(
2662
+ ({ header, className, direction = "col", children, ...props }, ref) => {
2663
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2664
+ CardBase,
2665
+ {
2666
+ ref,
2667
+ layout: "horizontal",
2668
+ padding: "medium",
2669
+ minHeight: "none",
2670
+ className: `border-none items-center gap-2 text-text-700 ${className}`,
2671
+ ...props,
2672
+ children: [
2673
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2674
+ "div",
2675
+ {
2676
+ className: `
2677
+ w-full flex ${direction == "col" ? "flex-col" : "flex-row items-center"} gap-2
2678
+ `,
2679
+ children: [
2680
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
2681
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex flex-row gap-1", children })
2682
+ ]
2683
+ }
2684
+ ),
2685
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
2686
+ ]
2687
+ }
2688
+ );
2689
+ }
2690
+ );
2691
+ var CardForum = (0, import_react7.forwardRef)(
2692
+ ({
2693
+ title,
2694
+ content,
2695
+ comments,
2696
+ onClickComments,
2697
+ valueComments,
2698
+ onClickProfile,
2699
+ valueProfile,
2700
+ className = "",
2701
+ date,
2702
+ hour,
2703
+ ...props
2704
+ }, ref) => {
2705
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2706
+ CardBase,
2707
+ {
2708
+ ref,
2709
+ layout: "horizontal",
2710
+ padding: "medium",
2711
+ minHeight: "none",
2712
+ variant: "minimal",
2713
+ className: `w-auto h-auto gap-3 ${className}`,
2714
+ ...props,
2715
+ children: [
2716
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2717
+ "button",
2718
+ {
2719
+ type: "button",
2720
+ "aria-label": "Ver perfil",
2721
+ onClick: () => onClickProfile?.(valueProfile),
2722
+ className: "min-w-8 h-8 rounded-full bg-background-950"
2723
+ }
2724
+ ),
2725
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
2726
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
2727
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
2728
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "text-xs text-text-600", children: [
2729
+ "\u2022 ",
2730
+ date,
2731
+ " \u2022 ",
2732
+ hour
2733
+ ] })
2734
+ ] }),
2735
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
2736
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2737
+ "button",
2738
+ {
2739
+ type: "button",
2740
+ "aria-label": "Ver coment\xE1rios",
2741
+ onClick: () => onClickComments?.(valueComments),
2742
+ className: "text-text-600 flex flex-row gap-2 items-center",
2743
+ children: [
2744
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.ChatCircleText, { "aria-hidden": "true", size: 16 }),
2745
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "text-xs", children: [
2746
+ comments,
2747
+ " respostas"
2748
+ ] })
2749
+ ]
2750
+ }
2751
+ )
2752
+ ] })
2753
+ ]
2754
+ }
2755
+ );
2756
+ }
2757
+ );
2758
+ var CardAudio = (0, import_react7.forwardRef)(
2759
+ ({
2760
+ src,
2761
+ title,
2762
+ onPlay,
2763
+ onPause,
2764
+ onEnded,
2765
+ onAudioTimeUpdate,
2766
+ loop = false,
2767
+ preload = "metadata",
2768
+ tracks,
2769
+ className,
2770
+ ...props
2771
+ }, ref) => {
2772
+ const [isPlaying, setIsPlaying] = (0, import_react7.useState)(false);
2773
+ const [currentTime, setCurrentTime] = (0, import_react7.useState)(0);
2774
+ const [duration, setDuration] = (0, import_react7.useState)(0);
2775
+ const [volume, setVolume] = (0, import_react7.useState)(1);
2776
+ const [showVolumeControl, setShowVolumeControl] = (0, import_react7.useState)(false);
2777
+ const audioRef = (0, import_react7.useRef)(null);
2778
+ const formatTime = (time) => {
2779
+ const minutes = Math.floor(time / 60);
2780
+ const seconds = Math.floor(time % 60);
2781
+ return `${minutes}:${seconds.toString().padStart(2, "0")}`;
2782
+ };
2783
+ const handlePlayPause = () => {
2784
+ if (isPlaying) {
2785
+ audioRef.current?.pause();
2786
+ setIsPlaying(false);
2787
+ onPause?.();
2788
+ } else {
2789
+ audioRef.current?.play();
2790
+ setIsPlaying(true);
2791
+ onPlay?.();
2792
+ }
2793
+ };
2794
+ const handleTimeUpdate = () => {
2795
+ const current = audioRef.current?.currentTime ?? 0;
2796
+ const total = audioRef.current?.duration ?? 0;
2797
+ setCurrentTime(current);
2798
+ setDuration(total);
2799
+ onAudioTimeUpdate?.(current, total);
2800
+ };
2801
+ const handleLoadedMetadata = () => {
2802
+ setDuration(audioRef.current?.duration ?? 0);
2803
+ };
2804
+ const handleEnded = () => {
2805
+ setIsPlaying(false);
2806
+ setCurrentTime(0);
2807
+ onEnded?.();
2808
+ };
2809
+ const handleProgressClick = (e) => {
2810
+ const rect = e.currentTarget.getBoundingClientRect();
2811
+ const clickX = e.clientX - rect.left;
2812
+ const width = rect.width;
2813
+ const percentage = clickX / width;
2814
+ const newTime = percentage * duration;
2815
+ if (audioRef.current) {
2816
+ audioRef.current.currentTime = newTime;
2817
+ }
2818
+ setCurrentTime(newTime);
2819
+ };
2820
+ const handleVolumeChange = (e) => {
2821
+ const newVolume = parseFloat(e.target.value);
2822
+ setVolume(newVolume);
2823
+ if (audioRef.current) {
2824
+ audioRef.current.volume = newVolume;
2825
+ }
2826
+ };
2827
+ const toggleVolumeControl = () => {
2828
+ setShowVolumeControl(!showVolumeControl);
2829
+ };
2830
+ const getVolumeIcon = () => {
2831
+ if (volume === 0) {
2832
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.SpeakerSimpleX, {});
2833
+ }
2834
+ if (volume < 0.5) {
2835
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.SpeakerLow, {});
2836
+ }
2837
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.SpeakerHigh, {});
2838
+ };
2839
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2840
+ CardBase,
2841
+ {
2842
+ ref,
2843
+ layout: "horizontal",
2844
+ padding: "medium",
2845
+ minHeight: "none",
2846
+ className: `w-auto h-14 items-center gap-2 ${className}`,
2847
+ ...props,
2848
+ children: [
2849
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2850
+ "audio",
2851
+ {
2852
+ ref: audioRef,
2853
+ src,
2854
+ loop,
2855
+ preload,
2856
+ onTimeUpdate: handleTimeUpdate,
2857
+ onLoadedMetadata: handleLoadedMetadata,
2858
+ onEnded: handleEnded,
2859
+ "data-testid": "audio-element",
2860
+ "aria-label": title,
2861
+ children: tracks ? tracks.map((track) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2862
+ "track",
2863
+ {
2864
+ kind: track.kind,
2865
+ src: track.src,
2866
+ srcLang: track.srcLang,
2867
+ label: track.label,
2868
+ default: track.default
2869
+ },
2870
+ track.src
2871
+ )) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2872
+ "track",
2873
+ {
2874
+ kind: "captions",
2875
+ src: "data:text/vtt;base64,",
2876
+ srcLang: "pt",
2877
+ label: "Sem legendas dispon\xEDveis"
2878
+ }
2879
+ )
2880
+ }
2881
+ ),
2882
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2883
+ "button",
2884
+ {
2885
+ type: "button",
2886
+ onClick: handlePlayPause,
2887
+ disabled: !src,
2888
+ className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
2889
+ "aria-label": isPlaying ? "Pausar" : "Reproduzir",
2890
+ children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex gap-0.5", children: [
2891
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" }),
2892
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" })
2893
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.Play, { size: 24 })
2894
+ }
2895
+ ),
2896
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
2897
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2898
+ "button",
2899
+ {
2900
+ type: "button",
2901
+ className: "w-full h-2 bg-border-100 rounded-full cursor-pointer",
2902
+ onClick: handleProgressClick,
2903
+ onKeyDown: (e) => {
2904
+ if (e.key === "Enter" || e.key === " ") {
2905
+ e.preventDefault();
2906
+ handleProgressClick(
2907
+ e
2908
+ );
2909
+ }
2910
+ },
2911
+ "aria-label": "Barra de progresso do \xE1udio",
2912
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2913
+ "div",
2914
+ {
2915
+ className: "h-full bg-primary-600 rounded-full transition-all duration-100",
2916
+ style: {
2917
+ width: duration > 0 ? `${currentTime / duration * 100}%` : "0%"
2918
+ }
2919
+ }
2920
+ )
2921
+ }
2922
+ ) }),
2923
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime(duration) }),
2924
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative", children: [
2925
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2926
+ "button",
2927
+ {
2928
+ type: "button",
2929
+ onClick: toggleVolumeControl,
2930
+ className: "cursor-pointer text-text-950 hover:text-primary-600",
2931
+ "aria-label": "Controle de volume",
2932
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
2933
+ }
2934
+ ),
2935
+ showVolumeControl && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2936
+ "button",
2937
+ {
2938
+ type: "button",
2939
+ 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",
2940
+ onKeyDown: (e) => {
2941
+ if (e.key === "Escape") {
2942
+ setShowVolumeControl(false);
2943
+ }
2944
+ },
2945
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2946
+ "input",
2947
+ {
2948
+ type: "range",
2949
+ min: "0",
2950
+ max: "1",
2951
+ step: "0.1",
2952
+ value: volume,
2953
+ onChange: handleVolumeChange,
2954
+ onKeyDown: (e) => {
2955
+ if (e.key === "ArrowUp" || e.key === "ArrowRight") {
2956
+ e.preventDefault();
2957
+ const newVolume = Math.min(
2958
+ 1,
2959
+ Math.round((volume + 0.1) * 10) / 10
2960
+ );
2961
+ setVolume(newVolume);
2962
+ if (audioRef.current) audioRef.current.volume = newVolume;
2963
+ } else if (e.key === "ArrowDown" || e.key === "ArrowLeft") {
2964
+ e.preventDefault();
2965
+ const newVolume = Math.max(
2966
+ 0,
2967
+ Math.round((volume - 0.1) * 10) / 10
2968
+ );
2969
+ setVolume(newVolume);
2970
+ if (audioRef.current) audioRef.current.volume = newVolume;
2971
+ }
2972
+ },
2973
+ className: "w-20 h-2 bg-border-100 rounded-lg appearance-none cursor-pointer",
2974
+ style: {
2975
+ background: `linear-gradient(to right, #3b82f6 0%, #3b82f6 ${volume * 100}%, #e5e7eb ${volume * 100}%, #e5e7eb 100%)`
2976
+ },
2977
+ "aria-label": "Volume",
2978
+ "aria-valuenow": Math.round(volume * 100),
2979
+ "aria-valuemin": 0,
2980
+ "aria-valuemax": 100
2981
+ }
2982
+ )
2983
+ }
2984
+ )
2985
+ ] }),
2986
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2987
+ import_phosphor_react5.DotsThreeVertical,
2988
+ {
2989
+ size: 24,
2990
+ className: "text-text-950 cursor-pointer hover:text-primary-600"
2991
+ }
2992
+ )
2993
+ ]
2994
+ }
2995
+ );
2996
+ }
2997
+ );
2998
+ var SIMULADO_BACKGROUND_CLASSES = {
2999
+ enem: "bg-exam-1",
3000
+ prova: "bg-exam-2",
3001
+ simuladao: "bg-exam-3",
3002
+ vestibular: "bg-exam-4"
3003
+ };
3004
+ var CardSimulado = (0, import_react7.forwardRef)(
3005
+ ({ title, duration, info, backgroundColor, className, ...props }, ref) => {
3006
+ const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
3007
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3008
+ CardBase,
3009
+ {
3010
+ ref,
3011
+ layout: "horizontal",
3012
+ padding: "medium",
3013
+ minHeight: "none",
3014
+ cursor: "pointer",
3015
+ className: `${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200 ${className}`,
3016
+ ...props,
3017
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between items-center w-full gap-4", children: [
3018
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
3019
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
3020
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-4 text-text-700", children: [
3021
+ duration && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-1", children: [
3022
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.Clock, { size: 16, className: "flex-shrink-0" }),
3023
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { size: "sm", children: duration })
3024
+ ] }),
3025
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { size: "sm", className: "truncate", children: info })
3026
+ ] })
3027
+ ] }),
3028
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3029
+ import_phosphor_react5.CaretRight,
3030
+ {
3031
+ size: 24,
3032
+ className: "text-text-800 flex-shrink-0",
3033
+ "data-testid": "caret-icon"
3034
+ }
3035
+ )
3036
+ ] })
3037
+ }
3038
+ );
3039
+ }
3040
+ );
3041
+ var CardTest = (0, import_react7.forwardRef)(
3042
+ ({
3043
+ title,
3044
+ duration,
3045
+ questionsCount,
3046
+ additionalInfo,
3047
+ selected = false,
3048
+ onSelect,
3049
+ className = "",
3050
+ ...props
3051
+ }, ref) => {
3052
+ const handleClick = () => {
3053
+ if (onSelect) {
3054
+ onSelect(!selected);
3055
+ }
3056
+ };
3057
+ const handleKeyDown = (event) => {
3058
+ if ((event.key === "Enter" || event.key === " ") && onSelect) {
3059
+ event.preventDefault();
3060
+ onSelect(!selected);
3061
+ }
3062
+ };
3063
+ const isSelectable = !!onSelect;
3064
+ const getQuestionsText = (count) => {
3065
+ const singular = count === 1 ? "quest\xE3o" : "quest\xF5es";
3066
+ return `${count} ${singular}`;
3067
+ };
3068
+ const displayInfo = questionsCount ? getQuestionsText(questionsCount) : additionalInfo || "";
3069
+ 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";
3070
+ const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
3071
+ const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
3072
+ if (isSelectable) {
3073
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3074
+ "button",
3075
+ {
3076
+ ref,
3077
+ type: "button",
3078
+ className: `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim(),
3079
+ onClick: handleClick,
3080
+ onKeyDown: handleKeyDown,
3081
+ "aria-pressed": selected,
3082
+ ...props,
3083
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3084
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3085
+ Text_default,
3086
+ {
3087
+ size: "md",
3088
+ weight: "bold",
3089
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
3090
+ children: title
3091
+ }
3092
+ ),
3093
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
3094
+ duration && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
3095
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.Clock, { size: 16, className: "text-text-700" }),
3096
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3097
+ Text_default,
3098
+ {
3099
+ size: "sm",
3100
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
3101
+ children: duration
3102
+ }
3103
+ )
3104
+ ] }),
3105
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3106
+ Text_default,
3107
+ {
3108
+ size: "sm",
3109
+ className: "text-text-700 leading-[21px] flex-grow truncate",
3110
+ children: displayInfo
3111
+ }
3112
+ )
3113
+ ] })
3114
+ ] })
3115
+ }
3116
+ );
3117
+ }
3118
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3119
+ "div",
3120
+ {
3121
+ ref,
3122
+ className: `${baseClasses} ${className}`.trim(),
3123
+ ...props,
3124
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3125
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3126
+ Text_default,
3127
+ {
3128
+ size: "md",
3129
+ weight: "bold",
3130
+ className: "text-text-950 tracking-[0.2px] leading-[19px] truncate",
3131
+ children: title
3132
+ }
3133
+ ),
3134
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
3135
+ duration && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
3136
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.Clock, { size: 16, className: "text-text-700" }),
3137
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3138
+ Text_default,
3139
+ {
3140
+ size: "sm",
3141
+ className: "text-text-700 leading-[21px] whitespace-nowrap",
3142
+ children: duration
3143
+ }
3144
+ )
3145
+ ] }),
3146
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3147
+ Text_default,
3148
+ {
3149
+ size: "sm",
3150
+ className: "text-text-700 leading-[21px] flex-grow truncate min-w-0",
3151
+ children: displayInfo
3152
+ }
3153
+ )
3154
+ ] })
3155
+ ] })
3156
+ }
3157
+ );
3158
+ }
3159
+ );
3160
+ var SIMULATION_TYPE_STYLES = {
3161
+ enem: {
3162
+ background: "bg-exam-1",
3163
+ badge: "exam1",
3164
+ text: "Enem"
3165
+ },
3166
+ prova: {
3167
+ background: "bg-exam-2",
3168
+ badge: "exam2",
3169
+ text: "Prova"
3170
+ },
3171
+ simulado: {
3172
+ background: "bg-exam-3",
3173
+ badge: "exam3",
3174
+ text: "Simulado"
3175
+ },
3176
+ vestibular: {
3177
+ background: "bg-exam-4",
3178
+ badge: "exam4",
3179
+ text: "Vestibular"
3180
+ }
3181
+ };
3182
+ var CardSimulationHistory = (0, import_react7.forwardRef)(({ data, onSimulationClick, className, ...props }, ref) => {
3183
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3184
+ "div",
3185
+ {
3186
+ ref,
3187
+ className: `w-full max-w-[992px] h-auto ${className}`,
3188
+ ...props,
3189
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-0", children: [
3190
+ data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3191
+ "div",
3192
+ {
3193
+ className: `
3194
+ flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-white
3195
+ ${sectionIndex === 0 ? "rounded-t-3xl" : ""}
3196
+ `,
3197
+ children: [
3198
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3199
+ Text_default,
3200
+ {
3201
+ size: "xs",
3202
+ weight: "bold",
3203
+ className: "text-text-800 w-11 flex-shrink-0",
3204
+ children: section.date
3205
+ }
3206
+ ),
3207
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
3208
+ const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
3209
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3210
+ CardBase,
3211
+ {
3212
+ layout: "horizontal",
3213
+ padding: "medium",
3214
+ minHeight: "none",
3215
+ cursor: "pointer",
3216
+ className: `
3217
+ ${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
3218
+ transition-shadow duration-200 h-auto min-h-[61px]
3219
+ `,
3220
+ onClick: () => onSimulationClick?.(simulation),
3221
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-between items-center w-full gap-2", children: [
3222
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
3223
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3224
+ Text_default,
3225
+ {
3226
+ size: "lg",
3227
+ weight: "bold",
3228
+ className: "text-text-950 truncate",
3229
+ children: simulation.title
3230
+ }
3231
+ ),
3232
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2", children: [
3233
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3234
+ Badge_default,
3235
+ {
3236
+ variant: "examsOutlined",
3237
+ action: typeStyles.badge,
3238
+ size: "medium",
3239
+ children: typeStyles.text
3240
+ }
3241
+ ),
3242
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
3243
+ ] })
3244
+ ] }),
3245
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3246
+ import_phosphor_react5.CaretRight,
3247
+ {
3248
+ size: 24,
3249
+ className: "text-text-800 flex-shrink-0",
3250
+ "data-testid": "caret-icon"
3251
+ }
3252
+ )
3253
+ ] })
3254
+ },
3255
+ simulation.id
3256
+ );
3257
+ }) })
3258
+ ]
3259
+ }
3260
+ ) }, section.date)),
3261
+ data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "w-full h-6 bg-white rounded-b-3xl" })
3262
+ ] })
3263
+ }
3264
+ );
3265
+ });
3266
+
3267
+ // src/components/Quiz/Quiz.tsx
3268
+ var import_jsx_runtime12 = require("react/jsx-runtime");
3269
+ var Quiz = (0, import_react8.forwardRef)(({ children, className, ...props }, ref) => {
3270
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3271
+ "div",
3272
+ {
3273
+ ref,
3274
+ className: `w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6 ${className}`,
3275
+ ...props,
3276
+ children
3277
+ }
3278
+ );
3279
+ });
3280
+ var QuizTitle = (0, import_react8.forwardRef)(
3281
+ ({ className, ...props }, ref) => {
3282
+ const {
3283
+ currentQuestionIndex,
3284
+ getTotalQuestions,
3285
+ getQuizTitle,
3286
+ timeElapsed,
3287
+ formatTime,
3288
+ isStarted
3289
+ } = useQuizStore();
3290
+ const totalQuestions = getTotalQuestions();
3291
+ const quizTitle = getQuizTitle();
3292
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3293
+ "div",
3294
+ {
3295
+ ref,
3296
+ className: `flex flex-row justify-center items-center relative p-2 ${className}`,
3297
+ ...props,
3298
+ children: [
3299
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex flex-col gap-2 text-center", children: [
3300
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
3301
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
3302
+ ] }),
3303
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "absolute right-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react6.Clock, {}), children: isStarted ? formatTime(timeElapsed) : "00:00" }) })
3304
+ ]
3305
+ }
3306
+ );
3307
+ }
3308
+ );
3309
+ var QuizHeader = () => {
3310
+ const { getCurrentQuestion } = useQuizStore();
3311
+ const currentQuestion = getCurrentQuestion();
3312
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3313
+ HeaderAlternative,
3314
+ {
3315
+ title: currentQuestion ? `Quest\xE3o ${currentQuestion.id}` : "Quest\xE3o",
3316
+ subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topicId ?? "",
3317
+ content: currentQuestion?.questionText ?? ""
3318
+ }
3319
+ );
3320
+ };
3321
+ var QuizContent = (0, import_react8.forwardRef)(({ type = "Alternativas", children, className, ...props }, ref) => {
3322
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
3323
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "px-4 pb-2 pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "font-bold text-lg text-text-950", children: type }) }),
3324
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3325
+ "div",
3326
+ {
3327
+ ref,
3328
+ className: `rounded-t-xl bg-background px-4 pt-4 pb-[80px] h-full flex flex-col gap-4 mb-auto ${className}`,
3329
+ ...props,
3330
+ children
3331
+ }
3332
+ )
3333
+ ] });
3334
+ });
3335
+ var QuizAlternative = () => {
3336
+ const { getCurrentQuestion, selectAnswer, getCurrentAnswer } = useQuizStore();
3337
+ const currentQuestion = getCurrentQuestion();
3338
+ const currentAnswer = getCurrentAnswer();
3339
+ const alternatives = currentQuestion?.options?.map((option) => ({
3340
+ label: option.option,
3341
+ value: option.id
3342
+ }));
3343
+ if (!alternatives)
3344
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "N\xE3o h\xE1 Alternativas" }) });
3345
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3346
+ AlternativesList,
3347
+ {
3348
+ name: `question-${currentQuestion?.id || "1"}`,
3349
+ layout: "default",
3350
+ alternatives,
3351
+ value: currentAnswer,
3352
+ onValueChange: (value) => {
3353
+ if (currentQuestion) {
3354
+ selectAnswer(currentQuestion.id, value);
3355
+ }
3356
+ }
3357
+ },
3358
+ `question-${currentQuestion?.id || "1"}`
3359
+ ) });
3360
+ };
3361
+ var QuizQuestionList = ({
3362
+ filterType = "all",
3363
+ onQuestionClick
3364
+ } = {}) => {
3365
+ const {
3366
+ getQuestionsGroupedBySubject,
3367
+ goToQuestion,
3368
+ isQuestionAnswered,
3369
+ isQuestionSkipped
3370
+ } = useQuizStore();
3371
+ const groupedQuestions = getQuestionsGroupedBySubject();
3372
+ const getQuestionStatus = (questionId) => {
3373
+ if (isQuestionSkipped(questionId)) {
3374
+ return "skipped";
3375
+ }
3376
+ if (isQuestionAnswered(questionId)) {
3377
+ return "answered";
3378
+ }
3379
+ return "unanswered";
3380
+ };
3381
+ const filteredGroupedQuestions = Object.entries(groupedQuestions).reduce(
3382
+ (acc, [subjectId, questions]) => {
3383
+ const filteredQuestions = questions.filter((question) => {
3384
+ const status = getQuestionStatus(question.id);
3385
+ switch (filterType) {
3386
+ case "answered":
3387
+ return status === "answered";
3388
+ case "unanswered":
3389
+ return status === "unanswered";
3390
+ default:
3391
+ return true;
3392
+ }
3393
+ });
3394
+ if (filteredQuestions.length > 0) {
3395
+ acc[subjectId] = filteredQuestions;
3396
+ }
3397
+ return acc;
3398
+ },
3399
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3400
+ {}
3401
+ );
3402
+ const getQuestionIndex = (questionId) => {
3403
+ const { bySimulado, byAtividade, byAula } = useQuizStore.getState();
3404
+ const quiz = bySimulado ?? byAtividade ?? byAula;
3405
+ if (!quiz) return 0;
3406
+ const index = quiz.questions.findIndex((q) => q.id === questionId);
3407
+ return index + 1;
3408
+ };
3409
+ const getStatusLabel = (status) => {
3410
+ switch (status) {
3411
+ case "answered":
3412
+ return "Respondida";
3413
+ case "skipped":
3414
+ return "Pulada";
3415
+ default:
3416
+ return "Em branco";
3417
+ }
3418
+ };
3419
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-6 px-4", children: Object.entries(filteredGroupedQuestions).map(
3420
+ ([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "flex flex-col gap-2", children: [
3421
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
3422
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react6.BookOpen, { size: 17, className: "text-white" }) }),
3423
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-800 font-bold text-lg", children: subjectId })
3424
+ ] }),
3425
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
3426
+ const status = getQuestionStatus(question.id);
3427
+ const questionNumber = getQuestionIndex(question.id);
3428
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3429
+ CardStatus,
3430
+ {
3431
+ header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
3432
+ label: getStatusLabel(status),
3433
+ onClick: () => {
3434
+ goToQuestion(questionNumber - 1);
3435
+ onQuestionClick?.();
3436
+ }
3437
+ },
3438
+ question.id
3439
+ );
3440
+ }) })
3441
+ ] }, subjectId)
3442
+ ) });
3443
+ };
3444
+ var QuizFooter = (0, import_react8.forwardRef)(({ className, onGoToSimulated, onDetailResult, ...props }, ref) => {
3445
+ const {
3446
+ currentQuestionIndex,
3447
+ getUserAnswers,
3448
+ getTotalQuestions,
3449
+ goToNextQuestion,
3450
+ goToPreviousQuestion,
3451
+ getUnansweredQuestionsFromUserAnswers,
3452
+ getCurrentAnswer,
3453
+ skipQuestion,
3454
+ getCurrentQuestion,
3455
+ isQuestionSkipped
3456
+ } = useQuizStore();
3457
+ const totalQuestions = getTotalQuestions();
3458
+ const isFirstQuestion = currentQuestionIndex === 0;
3459
+ const isLastQuestion = currentQuestionIndex === totalQuestions - 1;
3460
+ const currentAnswer = getCurrentAnswer();
3461
+ const currentQuestion = getCurrentQuestion();
3462
+ const isCurrentQuestionSkipped = currentQuestion ? isQuestionSkipped(currentQuestion.id) : false;
3463
+ const [alertDialogOpen, setAlertDialogOpen] = (0, import_react8.useState)(false);
3464
+ const [modalResultOpen, setModalResultOpen] = (0, import_react8.useState)(false);
3465
+ const [modalNavigateOpen, setModalNavigateOpen] = (0, import_react8.useState)(false);
3466
+ const [filterType, setFilterType] = (0, import_react8.useState)("all");
3467
+ const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
3468
+ const userAnswers = getUserAnswers();
3469
+ const allQuestions = getTotalQuestions();
3470
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
3471
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3472
+ "footer",
3473
+ {
3474
+ ref,
3475
+ className: `w-full px-2 bg-background lg:max-w-[1000px] not-lg:max-w-[calc(100vw-32px)] border-t border-border-50 fixed bottom-0 min-h-[80px] flex flex-row justify-between items-center ${className}`,
3476
+ ...props,
3477
+ children: [
3478
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
3479
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3480
+ IconButton_default,
3481
+ {
3482
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react6.SquaresFour, { size: 24, className: "text-text-950" }),
3483
+ size: "md",
3484
+ onClick: () => setModalNavigateOpen(true)
3485
+ }
3486
+ ),
3487
+ isFirstQuestion ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3488
+ Button_default,
3489
+ {
3490
+ variant: "outline",
3491
+ size: "small",
3492
+ onClick: () => {
3493
+ skipQuestion();
3494
+ goToNextQuestion();
3495
+ },
3496
+ children: "Pular"
3497
+ }
3498
+ ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3499
+ Button_default,
3500
+ {
3501
+ size: "medium",
3502
+ variant: "link",
3503
+ action: "primary",
3504
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react6.CaretLeft, { size: 18 }),
3505
+ onClick: () => {
3506
+ goToPreviousQuestion();
3507
+ },
3508
+ children: "Voltar"
3509
+ }
3510
+ )
3511
+ ] }),
3512
+ !isFirstQuestion && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3513
+ Button_default,
3514
+ {
3515
+ size: "small",
3516
+ variant: "outline",
3517
+ action: "primary",
3518
+ onClick: () => {
3519
+ skipQuestion();
3520
+ goToNextQuestion();
3521
+ },
3522
+ children: "Pular"
3523
+ }
3524
+ ),
3525
+ isLastQuestion ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3526
+ Button_default,
3527
+ {
3528
+ size: "medium",
3529
+ variant: "solid",
3530
+ action: "primary",
3531
+ disabled: !currentAnswer && !isCurrentQuestionSkipped,
3532
+ onClick: () => {
3533
+ if (unansweredQuestions.length > 0) {
3534
+ setAlertDialogOpen(true);
3535
+ } else {
3536
+ setModalResultOpen(true);
3537
+ }
3538
+ },
3539
+ children: "Finalizar"
3540
+ }
3541
+ ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3542
+ Button_default,
3543
+ {
3544
+ size: "medium",
3545
+ variant: "link",
3546
+ action: "primary",
3547
+ iconRight: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react6.CaretRight, { size: 18 }),
3548
+ disabled: !currentAnswer && !isCurrentQuestionSkipped,
3549
+ onClick: () => {
3550
+ goToNextQuestion();
3551
+ },
3552
+ children: "Avan\xE7ar"
3553
+ }
3554
+ )
3555
+ ]
3556
+ }
3557
+ ),
3558
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3559
+ AlertDialog,
3560
+ {
3561
+ isOpen: alertDialogOpen,
3562
+ onChangeOpen: setAlertDialogOpen,
3563
+ title: "Finalizar simulado?",
3564
+ description: unansweredQuestions.length > 0 ? `Voc\xEA deixou as quest\xF5es ${unansweredQuestions.join(", ")} sem resposta. Finalizar agora pode impactar seu desempenho.` : "Tem certeza que deseja finalizar o simulado?",
3565
+ cancelButtonLabel: "Voltar e revisar",
3566
+ submitButtonLabel: "Finalizar Mesmo Assim",
3567
+ onSubmit: () => {
3568
+ setModalResultOpen(true);
3569
+ }
3570
+ }
3571
+ ),
3572
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3573
+ Modal_default,
3574
+ {
3575
+ isOpen: modalResultOpen,
3576
+ onClose: () => setModalResultOpen(false),
3577
+ title: "",
3578
+ closeOnBackdropClick: false,
3579
+ closeOnEscape: false,
3580
+ hideCloseButton: true,
3581
+ size: "md",
3582
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
3583
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3584
+ "img",
3585
+ {
3586
+ src: simulated_result_default,
3587
+ alt: "Simulated Result",
3588
+ className: "w-[282px] h-auto object-cover"
3589
+ }
3590
+ ),
3591
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
3592
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: "Voc\xEA concluiu o simulado!" }),
3593
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "text-text-500 font-sm", children: [
3594
+ "Voc\xEA acertou",
3595
+ " ",
3596
+ userAnswers.filter(
3597
+ (answer) => answer.answerKey === answer.correctOptionId
3598
+ ).length,
3599
+ " ",
3600
+ "de ",
3601
+ allQuestions,
3602
+ " quest\xF5es."
3603
+ ] })
3604
+ ] }),
3605
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
3606
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3607
+ Button_default,
3608
+ {
3609
+ variant: "outline",
3610
+ className: "w-full",
3611
+ size: "small",
3612
+ onClick: onGoToSimulated,
3613
+ children: "Ir para simulados"
3614
+ }
3615
+ ),
3616
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
3617
+ ] })
3618
+ ] })
3619
+ }
3620
+ ),
3621
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3622
+ Modal_default,
3623
+ {
3624
+ isOpen: modalNavigateOpen,
3625
+ onClose: () => setModalNavigateOpen(false),
3626
+ title: "Quest\xF5es",
3627
+ size: "lg",
3628
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col w-full h-full", children: [
3629
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200", children: [
3630
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
3631
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Select_default, { value: filterType, onValueChange: setFilterType, children: [
3632
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectTrigger, { variant: "rounded", className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" }) }),
3633
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SelectContent, { children: [
3634
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectItem, { value: "all", children: "Todas" }),
3635
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectItem, { value: "unanswered", children: "Em branco" }),
3636
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SelectItem, { value: "answered", children: "Respondidas" })
3637
+ ] })
3638
+ ] }) })
3639
+ ] }),
3640
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-col gap-2 not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3641
+ QuizQuestionList,
3642
+ {
3643
+ filterType,
3644
+ onQuestionClick: () => setModalNavigateOpen(false)
3645
+ }
3646
+ ) })
3647
+ ] })
3648
+ }
3649
+ )
3650
+ ] });
3651
+ });
3652
+ // Annotate the CommonJS export names for ESM import in node:
3653
+ 0 && (module.exports = {
3654
+ Quiz,
3655
+ QuizAlternative,
3656
+ QuizContent,
3657
+ QuizFooter,
3658
+ QuizHeader,
3659
+ QuizQuestionList,
3660
+ QuizTitle
3661
+ });
3662
+ //# sourceMappingURL=index.js.map