analytica-frontend-lib 1.0.83 → 1.0.85

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 (143) hide show
  1. package/dist/Accordation/index.js +163 -74
  2. package/dist/Accordation/index.js.map +1 -1
  3. package/dist/Accordation/index.mjs +163 -74
  4. package/dist/Accordation/index.mjs.map +1 -1
  5. package/dist/Alert/index.js +32 -32
  6. package/dist/Alert/index.js.map +1 -1
  7. package/dist/Alert/index.mjs +32 -32
  8. package/dist/Alert/index.mjs.map +1 -1
  9. package/dist/AlertDialog/index.js +13 -2
  10. package/dist/AlertDialog/index.js.map +1 -1
  11. package/dist/AlertDialog/index.mjs +13 -2
  12. package/dist/AlertDialog/index.mjs.map +1 -1
  13. package/dist/Alternative/index.js +86 -25
  14. package/dist/Alternative/index.js.map +1 -1
  15. package/dist/Alternative/index.mjs +86 -25
  16. package/dist/Alternative/index.mjs.map +1 -1
  17. package/dist/Badge/index.js +13 -4
  18. package/dist/Badge/index.js.map +1 -1
  19. package/dist/Badge/index.mjs +13 -4
  20. package/dist/Badge/index.mjs.map +1 -1
  21. package/dist/Button/index.js +10 -1
  22. package/dist/Button/index.js.map +1 -1
  23. package/dist/Button/index.mjs +8 -1
  24. package/dist/Button/index.mjs.map +1 -1
  25. package/dist/Calendar/index.js +11 -2
  26. package/dist/Calendar/index.js.map +1 -1
  27. package/dist/Calendar/index.mjs +11 -2
  28. package/dist/Calendar/index.mjs.map +1 -1
  29. package/dist/Card/index.js +154 -71
  30. package/dist/Card/index.js.map +1 -1
  31. package/dist/Card/index.mjs +154 -71
  32. package/dist/Card/index.mjs.map +1 -1
  33. package/dist/CheckBox/index.js +28 -5
  34. package/dist/CheckBox/index.js.map +1 -1
  35. package/dist/CheckBox/index.mjs +28 -5
  36. package/dist/CheckBox/index.mjs.map +1 -1
  37. package/dist/Chips/index.js +10 -1
  38. package/dist/Chips/index.js.map +1 -1
  39. package/dist/Chips/index.mjs +10 -1
  40. package/dist/Chips/index.mjs.map +1 -1
  41. package/dist/Divider/index.js +10 -1
  42. package/dist/Divider/index.js.map +1 -1
  43. package/dist/Divider/index.mjs +8 -1
  44. package/dist/Divider/index.mjs.map +1 -1
  45. package/dist/DropdownMenu/index.js +18 -22
  46. package/dist/DropdownMenu/index.js.map +1 -1
  47. package/dist/DropdownMenu/index.mjs +18 -22
  48. package/dist/DropdownMenu/index.mjs.map +1 -1
  49. package/dist/IconButton/index.js +10 -1
  50. package/dist/IconButton/index.js.map +1 -1
  51. package/dist/IconButton/index.mjs +10 -1
  52. package/dist/IconButton/index.mjs.map +1 -1
  53. package/dist/IconRoundedButton/index.js +10 -1
  54. package/dist/IconRoundedButton/index.js.map +1 -1
  55. package/dist/IconRoundedButton/index.mjs +8 -1
  56. package/dist/IconRoundedButton/index.mjs.map +1 -1
  57. package/dist/Menu/index.js +22 -10
  58. package/dist/Menu/index.js.map +1 -1
  59. package/dist/Menu/index.mjs +22 -10
  60. package/dist/Menu/index.mjs.map +1 -1
  61. package/dist/Modal/index.js +15 -1
  62. package/dist/Modal/index.js.map +1 -1
  63. package/dist/Modal/index.mjs +15 -1
  64. package/dist/Modal/index.mjs.map +1 -1
  65. package/dist/NavButton/index.js +10 -1
  66. package/dist/NavButton/index.js.map +1 -1
  67. package/dist/NavButton/index.mjs +10 -1
  68. package/dist/NavButton/index.mjs.map +1 -1
  69. package/dist/NotFound/index.js +13 -3
  70. package/dist/NotFound/index.js.map +1 -1
  71. package/dist/NotFound/index.mjs +13 -3
  72. package/dist/NotFound/index.mjs.map +1 -1
  73. package/dist/ProgressBar/index.js +63 -15
  74. package/dist/ProgressBar/index.js.map +1 -1
  75. package/dist/ProgressBar/index.mjs +63 -15
  76. package/dist/ProgressBar/index.mjs.map +1 -1
  77. package/dist/ProgressCircle/index.js +34 -7
  78. package/dist/ProgressCircle/index.js.map +1 -1
  79. package/dist/ProgressCircle/index.mjs +34 -7
  80. package/dist/ProgressCircle/index.mjs.map +1 -1
  81. package/dist/Quiz/index.d.mts +25 -2
  82. package/dist/Quiz/index.d.ts +25 -2
  83. package/dist/Quiz/index.js +972 -260
  84. package/dist/Quiz/index.js.map +1 -1
  85. package/dist/Quiz/index.mjs +968 -261
  86. package/dist/Quiz/index.mjs.map +1 -1
  87. package/dist/Quiz/useQuizStore/index.d.mts +44 -12
  88. package/dist/Quiz/useQuizStore/index.d.ts +44 -12
  89. package/dist/Quiz/useQuizStore/index.js +206 -85
  90. package/dist/Quiz/useQuizStore/index.js.map +1 -1
  91. package/dist/Quiz/useQuizStore/index.mjs +203 -85
  92. package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
  93. package/dist/Radio/index.js +36 -6
  94. package/dist/Radio/index.js.map +1 -1
  95. package/dist/Radio/index.mjs +36 -6
  96. package/dist/Radio/index.mjs.map +1 -1
  97. package/dist/Select/index.js +20 -4
  98. package/dist/Select/index.js.map +1 -1
  99. package/dist/Select/index.mjs +20 -4
  100. package/dist/Select/index.mjs.map +1 -1
  101. package/dist/SelectionButton/index.js +10 -1
  102. package/dist/SelectionButton/index.js.map +1 -1
  103. package/dist/SelectionButton/index.mjs +10 -1
  104. package/dist/SelectionButton/index.mjs.map +1 -1
  105. package/dist/Skeleton/index.js +18 -6
  106. package/dist/Skeleton/index.js.map +1 -1
  107. package/dist/Skeleton/index.mjs +18 -6
  108. package/dist/Skeleton/index.mjs.map +1 -1
  109. package/dist/Stepper/index.js +27 -18
  110. package/dist/Stepper/index.js.map +1 -1
  111. package/dist/Stepper/index.mjs +27 -18
  112. package/dist/Stepper/index.mjs.map +1 -1
  113. package/dist/Table/index.js +37 -13
  114. package/dist/Table/index.js.map +1 -1
  115. package/dist/Table/index.mjs +37 -13
  116. package/dist/Table/index.mjs.map +1 -1
  117. package/dist/Text/index.js +10 -1
  118. package/dist/Text/index.js.map +1 -1
  119. package/dist/Text/index.mjs +8 -1
  120. package/dist/Text/index.mjs.map +1 -1
  121. package/dist/TextArea/index.js +17 -3
  122. package/dist/TextArea/index.js.map +1 -1
  123. package/dist/TextArea/index.mjs +17 -3
  124. package/dist/TextArea/index.mjs.map +1 -1
  125. package/dist/Toast/Toaster/index.js +15 -1
  126. package/dist/Toast/Toaster/index.js.map +1 -1
  127. package/dist/Toast/Toaster/index.mjs +15 -1
  128. package/dist/Toast/Toaster/index.mjs.map +1 -1
  129. package/dist/Toast/index.js +15 -1
  130. package/dist/Toast/index.js.map +1 -1
  131. package/dist/Toast/index.mjs +15 -1
  132. package/dist/Toast/index.mjs.map +1 -1
  133. package/dist/index.css +8 -9
  134. package/dist/index.css.map +1 -1
  135. package/dist/index.d.mts +1 -1
  136. package/dist/index.d.ts +1 -1
  137. package/dist/index.js +903 -325
  138. package/dist/index.js.map +1 -1
  139. package/dist/index.mjs +901 -326
  140. package/dist/index.mjs.map +1 -1
  141. package/dist/styles.css +8 -9
  142. package/dist/styles.css.map +1 -1
  143. package/package.json +3 -1
@@ -4,11 +4,21 @@ import {
4
4
  CaretRight as CaretRight2,
5
5
  Clock as Clock2,
6
6
  SquaresFour,
7
- BookOpen
7
+ BookOpen,
8
+ Book
8
9
  } from "phosphor-react";
9
10
 
10
11
  // src/components/Badge/Badge.tsx
11
12
  import { Bell } from "phosphor-react";
13
+
14
+ // src/utils/utils.ts
15
+ import { clsx } from "clsx";
16
+ import { twMerge } from "tailwind-merge";
17
+ function cn(...inputs) {
18
+ return twMerge(clsx(inputs));
19
+ }
20
+
21
+ // src/components/Badge/Badge.tsx
12
22
  import { jsx, jsxs } from "react/jsx-runtime";
13
23
  var VARIANT_ACTION_CLASSES = {
14
24
  solid: {
@@ -74,7 +84,7 @@ var Badge = ({
74
84
  return /* @__PURE__ */ jsxs(
75
85
  "div",
76
86
  {
77
- className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
87
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
78
88
  ...props,
79
89
  children: [
80
90
  /* @__PURE__ */ jsx(Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
@@ -92,12 +102,12 @@ var Badge = ({
92
102
  return /* @__PURE__ */ jsxs(
93
103
  "div",
94
104
  {
95
- className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
105
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
96
106
  ...props,
97
107
  children: [
98
- iconLeft && /* @__PURE__ */ jsx("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconLeft }),
108
+ iconLeft && /* @__PURE__ */ jsx("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
99
109
  children,
100
- iconRight && /* @__PURE__ */ jsx("span", { className: `${baseClassesIcon} ${sizeClassesIcon}`, children: iconRight })
110
+ iconRight && /* @__PURE__ */ jsx("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
101
111
  ]
102
112
  }
103
113
  );
@@ -163,7 +173,7 @@ var Text = ({
163
173
  return /* @__PURE__ */ jsx2(
164
174
  Component,
165
175
  {
166
- className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
176
+ className: cn(baseClasses, sizeClasses, weightClasses, color, className),
167
177
  ...props,
168
178
  children
169
179
  }
@@ -284,8 +294,19 @@ var Radio = forwardRef(
284
294
  return sizeClasses.borderWidth;
285
295
  };
286
296
  const borderWidthClass = getBorderWidth();
287
- const radioClasses = `${BASE_RADIO_CLASSES} ${actualRadioSize} ${borderWidthClass} ${stylingClasses} ${className}`;
288
- const dotClasses = `${actualDotSize} rounded-full ${DOT_CLASSES[currentState]} transition-all duration-200`;
297
+ const radioClasses = cn(
298
+ BASE_RADIO_CLASSES,
299
+ actualRadioSize,
300
+ borderWidthClass,
301
+ stylingClasses,
302
+ className
303
+ );
304
+ const dotClasses = cn(
305
+ actualDotSize,
306
+ "rounded-full",
307
+ DOT_CLASSES[currentState],
308
+ "transition-all duration-200"
309
+ );
289
310
  const isWrapperNeeded = currentState === "focused" || currentState === "invalid";
290
311
  const wrapperBorderColor = currentState === "focused" ? "border-indicator-info" : "border-indicator-error";
291
312
  const getTextColor = () => {
@@ -304,7 +325,11 @@ var Radio = forwardRef(
304
325
  /* @__PURE__ */ jsxs2(
305
326
  "div",
306
327
  {
307
- className: `flex flex-row items-center ${isWrapperNeeded ? `p-1 border-2 ${wrapperBorderColor} rounded-lg gap-1.5` : sizeClasses.spacing} ${disabled ? "opacity-40" : ""}`,
328
+ className: cn(
329
+ "flex flex-row items-center",
330
+ isWrapperNeeded ? cn("p-1 border-2", wrapperBorderColor, "rounded-lg gap-1.5") : sizeClasses.spacing,
331
+ disabled ? "opacity-40" : ""
332
+ ),
308
333
  children: [
309
334
  /* @__PURE__ */ jsx3(
310
335
  "input",
@@ -361,7 +386,11 @@ var Radio = forwardRef(
361
386
  label && /* @__PURE__ */ jsx3(
362
387
  "div",
363
388
  {
364
- className: `flex flex-row items-center ${sizeClasses.labelHeight} flex-1 min-w-0`,
389
+ className: cn(
390
+ "flex flex-row items-center",
391
+ sizeClasses.labelHeight,
392
+ "flex-1 min-w-0"
393
+ ),
365
394
  children: /* @__PURE__ */ jsx3(
366
395
  Text_default,
367
396
  {
@@ -369,7 +398,11 @@ var Radio = forwardRef(
369
398
  htmlFor: inputId,
370
399
  size: sizeClasses.textSize,
371
400
  weight: "normal",
372
- className: `${getCursorClass()} select-none leading-normal flex items-center font-roboto truncate ${labelClassName}`,
401
+ className: cn(
402
+ getCursorClass(),
403
+ "select-none leading-normal flex items-center font-roboto truncate",
404
+ labelClassName
405
+ ),
373
406
  color: getTextColor(),
374
407
  children: label
375
408
  }
@@ -598,7 +631,11 @@ var AlternativesList = ({
598
631
  return /* @__PURE__ */ jsx4(
599
632
  "div",
600
633
  {
601
- className: `border-2 rounded-lg p-4 w-full ${statusStyles} ${alternative.disabled ? "opacity-50" : ""}`,
634
+ className: cn(
635
+ "border-2 rounded-lg p-4 w-full",
636
+ statusStyles,
637
+ alternative.disabled ? "opacity-50" : ""
638
+ ),
602
639
  children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start justify-between gap-3", children: [
603
640
  /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3 flex-1", children: [
604
641
  /* @__PURE__ */ jsx4("div", { className: "mt-1", children: renderRadio() }),
@@ -606,7 +643,10 @@ var AlternativesList = ({
606
643
  /* @__PURE__ */ jsx4(
607
644
  "p",
608
645
  {
609
- className: `block font-medium ${selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"}`,
646
+ className: cn(
647
+ "block font-medium",
648
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
649
+ ),
610
650
  children: alternative.label
611
651
  }
612
652
  ),
@@ -622,14 +662,21 @@ var AlternativesList = ({
622
662
  return /* @__PURE__ */ jsxs3(
623
663
  "div",
624
664
  {
625
- className: `flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full ${statusStyles} ${alternative.disabled ? "opacity-50" : ""}`,
665
+ className: cn(
666
+ "flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
667
+ statusStyles,
668
+ alternative.disabled ? "opacity-50" : ""
669
+ ),
626
670
  children: [
627
671
  /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 flex-1", children: [
628
672
  renderRadio(),
629
673
  /* @__PURE__ */ jsx4(
630
674
  "span",
631
675
  {
632
- className: `flex-1 ${selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"}`,
676
+ className: cn(
677
+ "flex-1",
678
+ selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
679
+ ),
633
680
  children: alternative.label
634
681
  }
635
682
  )
@@ -644,7 +691,7 @@ var AlternativesList = ({
644
691
  return /* @__PURE__ */ jsx4(
645
692
  "div",
646
693
  {
647
- className: `flex flex-col ${getLayoutClasses()} w-full ${className}`,
694
+ className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
648
695
  children: alternatives.map(
649
696
  (alternative) => renderReadonlyAlternative(alternative)
650
697
  )
@@ -662,7 +709,7 @@ var AlternativesList = ({
662
709
  onValueChange?.(value2);
663
710
  },
664
711
  disabled,
665
- className: `flex flex-col ${getLayoutClasses()} ${className}`,
712
+ className: cn("flex flex-col", getLayoutClasses(), className),
666
713
  children: alternatives.map((alternative, index) => {
667
714
  const alternativeId = alternative.value || `alt-${index}`;
668
715
  const statusStyles = getStatusStyles(alternative.status, false);
@@ -671,7 +718,11 @@ var AlternativesList = ({
671
718
  return /* @__PURE__ */ jsx4(
672
719
  "div",
673
720
  {
674
- className: `border-2 rounded-lg p-4 transition-all ${statusStyles} ${alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`,
721
+ className: cn(
722
+ "border-2 rounded-lg p-4 transition-all",
723
+ statusStyles,
724
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
725
+ ),
675
726
  children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start justify-between gap-3", children: [
676
727
  /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3 flex-1", children: [
677
728
  /* @__PURE__ */ jsx4(
@@ -688,9 +739,11 @@ var AlternativesList = ({
688
739
  "label",
689
740
  {
690
741
  htmlFor: alternativeId,
691
- className: `block font-medium
692
- ${actualValue === alternative.value ? "text-text-950" : "text-text-600"}
693
- ${alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"}`,
742
+ className: cn(
743
+ "block font-medium",
744
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
745
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
746
+ ),
694
747
  children: alternative.label
695
748
  }
696
749
  ),
@@ -706,7 +759,11 @@ var AlternativesList = ({
706
759
  return /* @__PURE__ */ jsxs3(
707
760
  "div",
708
761
  {
709
- className: `flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all ${statusStyles} ${alternative.disabled ? "opacity-50 cursor-not-allowed" : ""}`,
762
+ className: cn(
763
+ "flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
764
+ statusStyles,
765
+ alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
766
+ ),
710
767
  children: [
711
768
  /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 flex-1", children: [
712
769
  /* @__PURE__ */ jsx4(
@@ -721,9 +778,11 @@ var AlternativesList = ({
721
778
  "label",
722
779
  {
723
780
  htmlFor: alternativeId,
724
- className: `flex-1
725
- ${actualValue === alternative.value ? "text-text-950" : "text-text-600"}
726
- ${alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"}`,
781
+ className: cn(
782
+ "flex-1",
783
+ actualValue === alternative.value ? "text-text-950" : "text-text-600",
784
+ alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
785
+ ),
727
786
  children: alternative.label
728
787
  }
729
788
  )
@@ -743,7 +802,10 @@ var HeaderAlternative = forwardRef2(
743
802
  "div",
744
803
  {
745
804
  ref,
746
- className: `bg-background p-4 flex flex-col gap-4 rounded-xl ${className}`,
805
+ className: cn(
806
+ "bg-background p-4 flex flex-col gap-4 rounded-xl",
807
+ className
808
+ ),
747
809
  ...props,
748
810
  children: [
749
811
  /* @__PURE__ */ jsxs3("span", { className: "flex flex-col", children: [
@@ -801,7 +863,7 @@ var Button = ({
801
863
  return /* @__PURE__ */ jsxs4(
802
864
  "button",
803
865
  {
804
- className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
866
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
805
867
  disabled,
806
868
  type,
807
869
  ...props,
@@ -855,7 +917,7 @@ var IconButton = forwardRef3(
855
917
  {
856
918
  ref,
857
919
  type: "button",
858
- className: `${allClasses} ${className}`,
920
+ className: cn(allClasses, className),
859
921
  disabled,
860
922
  "aria-pressed": active,
861
923
  "aria-label": ariaLabel,
@@ -879,6 +941,9 @@ var useQuizStore = create2()(
879
941
  (set, get) => {
880
942
  let timerInterval = null;
881
943
  const startTimer = () => {
944
+ if (get().isFinished) {
945
+ return;
946
+ }
882
947
  if (timerInterval) {
883
948
  clearInterval(timerInterval);
884
949
  }
@@ -897,15 +962,17 @@ var useQuizStore = create2()(
897
962
  // Initial State
898
963
  currentQuestionIndex: 0,
899
964
  selectedAnswers: {},
900
- skippedQuestions: [],
901
965
  userAnswers: [],
902
966
  timeElapsed: 0,
903
967
  isStarted: false,
904
968
  isFinished: false,
969
+ userId: "",
905
970
  // Setters
906
- setBySimulado: (simulado) => set({ bySimulado: simulado }),
907
- setByAtividade: (atividade) => set({ byAtividade: atividade }),
908
- setByAula: (aula) => set({ byAula: aula }),
971
+ setBySimulated: (simulado) => set({ bySimulated: simulado }),
972
+ setByActivity: (atividade) => set({ byActivity: atividade }),
973
+ setByQuestionary: (aula) => set({ byQuestionary: aula }),
974
+ setUserId: (userId) => set({ userId }),
975
+ getUserId: () => get().userId,
909
976
  // Navigation
910
977
  goToNextQuestion: () => {
911
978
  const { currentQuestionIndex, getTotalQuestions } = get();
@@ -927,58 +994,107 @@ var useQuizStore = create2()(
927
994
  set({ currentQuestionIndex: index });
928
995
  }
929
996
  },
930
- // Quiz Actions
997
+ getActiveQuiz: () => {
998
+ const { bySimulated, byActivity, byQuestionary } = get();
999
+ if (bySimulated)
1000
+ return { quiz: bySimulated, type: "bySimulated" };
1001
+ if (byActivity)
1002
+ return { quiz: byActivity, type: "byActivity" };
1003
+ if (byQuestionary)
1004
+ return { quiz: byQuestionary, type: "byQuestionary" };
1005
+ return null;
1006
+ },
931
1007
  selectAnswer: (questionId, answerId) => {
932
- const { selectedAnswers, skippedQuestions, addUserAnswer } = get();
933
- const newSkippedQuestions = skippedQuestions.filter(
934
- (id) => id !== questionId
1008
+ const { getActiveQuiz, userAnswers } = get();
1009
+ const activeQuiz = getActiveQuiz();
1010
+ if (!activeQuiz) return;
1011
+ const updatedQuestions = activeQuiz.quiz.questions.map(
1012
+ (question) => question.id === questionId ? { ...question, answerKey: answerId } : question
935
1013
  );
1014
+ const updatedQuiz = {
1015
+ ...activeQuiz.quiz,
1016
+ questions: updatedQuestions
1017
+ };
1018
+ const activityId = activeQuiz.quiz.id;
1019
+ const userId = get().getUserId();
1020
+ if (!userId) {
1021
+ console.warn("selectAnswer called before userId is set");
1022
+ return;
1023
+ }
1024
+ const existingAnswerIndex = userAnswers.findIndex(
1025
+ (answer) => answer.questionId === questionId
1026
+ );
1027
+ const newUserAnswer = {
1028
+ questionId,
1029
+ activityId,
1030
+ userId,
1031
+ answer: answerId,
1032
+ optionId: answerId
1033
+ };
1034
+ let updatedUserAnswers;
1035
+ if (existingAnswerIndex !== -1) {
1036
+ updatedUserAnswers = [...userAnswers];
1037
+ updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
1038
+ } else {
1039
+ updatedUserAnswers = [...userAnswers, newUserAnswer];
1040
+ }
936
1041
  set({
937
- selectedAnswers: {
938
- ...selectedAnswers,
939
- [questionId]: answerId
940
- },
941
- skippedQuestions: newSkippedQuestions
1042
+ [activeQuiz.type]: updatedQuiz,
1043
+ userAnswers: updatedUserAnswers
942
1044
  });
943
- addUserAnswer(questionId, answerId);
944
1045
  },
945
1046
  skipQuestion: () => {
946
- const { getCurrentQuestion, skippedQuestions, addUserAnswer } = get();
1047
+ const { getCurrentQuestion, userAnswers, getActiveQuiz } = get();
947
1048
  const currentQuestion = getCurrentQuestion();
1049
+ const activeQuiz = getActiveQuiz();
1050
+ if (!activeQuiz) return;
948
1051
  if (currentQuestion) {
1052
+ const activityId = activeQuiz.quiz.id;
1053
+ const userId = get().getUserId();
1054
+ const existingAnswerIndex = userAnswers.findIndex(
1055
+ (answer) => answer.questionId === currentQuestion.id
1056
+ );
1057
+ const newUserAnswer = {
1058
+ questionId: currentQuestion.id,
1059
+ activityId,
1060
+ userId,
1061
+ answer: null,
1062
+ optionId: null
1063
+ };
1064
+ let updatedUserAnswers;
1065
+ if (existingAnswerIndex !== -1) {
1066
+ updatedUserAnswers = [...userAnswers];
1067
+ updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
1068
+ } else {
1069
+ updatedUserAnswers = [...userAnswers, newUserAnswer];
1070
+ }
949
1071
  set({
950
- skippedQuestions: [...skippedQuestions, currentQuestion.id]
1072
+ userAnswers: updatedUserAnswers
951
1073
  });
952
- addUserAnswer(currentQuestion.id);
953
1074
  }
954
1075
  },
955
1076
  addUserAnswer: (questionId, answerId) => {
956
- const { userAnswers, bySimulado, byAtividade, byAula } = get();
957
- const quiz = bySimulado || byAtividade || byAula;
958
- const question = quiz?.questions.find((q) => q.id === questionId);
959
- if (!question) return;
1077
+ const { getActiveQuiz, userAnswers } = get();
1078
+ const activeQuiz = getActiveQuiz();
1079
+ if (!activeQuiz) return;
1080
+ const activityId = activeQuiz.quiz.id;
1081
+ const userId = get().getUserId();
960
1082
  const existingAnswerIndex = userAnswers.findIndex(
961
- (answer) => answer.id === questionId
1083
+ (answer) => answer.questionId === questionId
962
1084
  );
1085
+ const newUserAnswer = {
1086
+ questionId,
1087
+ activityId,
1088
+ userId,
1089
+ answer: answerId || null,
1090
+ optionId: answerId || null
1091
+ };
963
1092
  if (existingAnswerIndex !== -1) {
964
- const updatedAnswers = [...userAnswers];
965
- updatedAnswers[existingAnswerIndex] = {
966
- ...question,
967
- answerKey: answerId || "",
968
- isSkipped: !answerId
969
- };
970
- set({ userAnswers: updatedAnswers });
1093
+ const updatedUserAnswers = [...userAnswers];
1094
+ updatedUserAnswers[existingAnswerIndex] = newUserAnswer;
1095
+ set({ userAnswers: updatedUserAnswers });
971
1096
  } else {
972
- set({
973
- userAnswers: [
974
- ...userAnswers,
975
- {
976
- ...question,
977
- answerKey: answerId || "",
978
- isSkipped: !answerId
979
- }
980
- ]
981
- });
1097
+ set({ userAnswers: [...userAnswers, newUserAnswer] });
982
1098
  }
983
1099
  },
984
1100
  startQuiz: () => {
@@ -994,11 +1110,11 @@ var useQuizStore = create2()(
994
1110
  set({
995
1111
  currentQuestionIndex: 0,
996
1112
  selectedAnswers: {},
997
- skippedQuestions: [],
998
1113
  userAnswers: [],
999
1114
  timeElapsed: 0,
1000
1115
  isStarted: false,
1001
- isFinished: false
1116
+ isFinished: false,
1117
+ userId: ""
1002
1118
  });
1003
1119
  },
1004
1120
  // Timer
@@ -1007,36 +1123,33 @@ var useQuizStore = create2()(
1007
1123
  stopTimer,
1008
1124
  // Getters
1009
1125
  getCurrentQuestion: () => {
1010
- const { bySimulado, byAtividade, byAula, currentQuestionIndex } = get();
1011
- const quiz = bySimulado || byAtividade || byAula;
1012
- if (!quiz) {
1126
+ const { currentQuestionIndex, getActiveQuiz } = get();
1127
+ const activeQuiz = getActiveQuiz();
1128
+ if (!activeQuiz) {
1013
1129
  return null;
1014
1130
  }
1015
- return quiz.questions[currentQuestionIndex];
1131
+ return activeQuiz.quiz.questions[currentQuestionIndex];
1016
1132
  },
1017
1133
  getTotalQuestions: () => {
1018
- const { bySimulado, byAtividade, byAula } = get();
1019
- const quiz = bySimulado || byAtividade || byAula;
1020
- return quiz?.questions?.length || 0;
1134
+ const { getActiveQuiz } = get();
1135
+ const activeQuiz = getActiveQuiz();
1136
+ return activeQuiz?.quiz?.questions?.length || 0;
1021
1137
  },
1022
1138
  getAnsweredQuestions: () => {
1023
- const { selectedAnswers } = get();
1024
- return Object.keys(selectedAnswers).length;
1139
+ const { userAnswers } = get();
1140
+ return userAnswers.filter((answer) => answer.answer !== null).length;
1025
1141
  },
1026
1142
  getUnansweredQuestions: () => {
1027
- const {
1028
- bySimulado,
1029
- byAtividade,
1030
- byAula,
1031
- selectedAnswers,
1032
- skippedQuestions
1033
- } = get();
1034
- const quiz = bySimulado || byAtividade || byAula;
1035
- if (!quiz) return [];
1143
+ const { getActiveQuiz, userAnswers } = get();
1144
+ const activeQuiz = getActiveQuiz();
1145
+ if (!activeQuiz) return [];
1036
1146
  const unansweredQuestions = [];
1037
- quiz.questions.forEach((question, index) => {
1038
- const isAnswered = question.id in selectedAnswers;
1039
- const isSkipped = skippedQuestions.includes(question.id);
1147
+ activeQuiz.quiz.questions.forEach((question, index) => {
1148
+ const userAnswer = userAnswers.find(
1149
+ (answer) => answer.questionId === question.id
1150
+ );
1151
+ const isAnswered = userAnswer && userAnswer.answer !== null;
1152
+ const isSkipped = userAnswer && userAnswer.answer === null;
1040
1153
  if (!isAnswered && !isSkipped) {
1041
1154
  unansweredQuestions.push(index + 1);
1042
1155
  }
@@ -1044,8 +1157,8 @@ var useQuizStore = create2()(
1044
1157
  return unansweredQuestions;
1045
1158
  },
1046
1159
  getSkippedQuestions: () => {
1047
- const { skippedQuestions } = get();
1048
- return skippedQuestions.length;
1160
+ const { userAnswers } = get();
1161
+ return userAnswers.filter((answer) => answer.answer === null).length;
1049
1162
  },
1050
1163
  getProgress: () => {
1051
1164
  const { getTotalQuestions, getAnsweredQuestions } = get();
@@ -1054,22 +1167,32 @@ var useQuizStore = create2()(
1054
1167
  return total > 0 ? answered / total * 100 : 0;
1055
1168
  },
1056
1169
  isQuestionAnswered: (questionId) => {
1057
- const { selectedAnswers } = get();
1058
- return questionId in selectedAnswers;
1170
+ const { userAnswers } = get();
1171
+ const userAnswer = userAnswers.find(
1172
+ (answer) => answer.questionId === questionId
1173
+ );
1174
+ return userAnswer ? userAnswer.answer !== null : false;
1059
1175
  },
1060
1176
  isQuestionSkipped: (questionId) => {
1061
- const { skippedQuestions } = get();
1062
- return skippedQuestions.includes(questionId);
1177
+ const { userAnswers } = get();
1178
+ const userAnswer = userAnswers.find(
1179
+ (answer) => answer.questionId === questionId
1180
+ );
1181
+ return userAnswer ? userAnswer.answer === null : false;
1063
1182
  },
1064
1183
  getCurrentAnswer: () => {
1065
- const { getCurrentQuestion, selectedAnswers } = get();
1184
+ const { getCurrentQuestion, userAnswers } = get();
1066
1185
  const currentQuestion = getCurrentQuestion();
1067
- return selectedAnswers[currentQuestion?.id || ""];
1186
+ if (!currentQuestion) return void 0;
1187
+ const userAnswer = userAnswers.find(
1188
+ (answer) => answer.questionId === currentQuestion.id
1189
+ );
1190
+ return userAnswer?.answer;
1068
1191
  },
1069
1192
  getQuizTitle: () => {
1070
- const { bySimulado, byAtividade, byAula } = get();
1071
- const quiz = bySimulado || byAtividade || byAula;
1072
- return quiz?.title || "Quiz";
1193
+ const { getActiveQuiz } = get();
1194
+ const activeQuiz = getActiveQuiz();
1195
+ return activeQuiz?.quiz?.title || "Quiz";
1073
1196
  },
1074
1197
  formatTime: (seconds) => {
1075
1198
  const minutes = Math.floor(seconds / 60);
@@ -1077,30 +1200,42 @@ var useQuizStore = create2()(
1077
1200
  return `${minutes.toString().padStart(2, "0")}:${remainingSeconds.toString().padStart(2, "0")}`;
1078
1201
  },
1079
1202
  getUserAnswers: () => {
1080
- const { userAnswers } = get();
1081
- return userAnswers;
1203
+ const { getActiveQuiz, userAnswers } = get();
1204
+ const activeQuiz = getActiveQuiz();
1205
+ if (!activeQuiz) return [];
1206
+ return activeQuiz.quiz.questions.map((question) => {
1207
+ const userAnswer = userAnswers.find(
1208
+ (answer) => answer.questionId === question.id
1209
+ );
1210
+ return {
1211
+ ...question,
1212
+ isSkipped: userAnswer ? userAnswer.answer === null : false
1213
+ };
1214
+ });
1082
1215
  },
1083
1216
  getUnansweredQuestionsFromUserAnswers: () => {
1084
- const { bySimulado, byAtividade, byAula, userAnswers } = get();
1085
- const quiz = bySimulado || byAtividade || byAula;
1086
- if (!quiz) return [];
1217
+ const { getActiveQuiz, userAnswers } = get();
1218
+ const activeQuiz = getActiveQuiz();
1219
+ if (!activeQuiz) return [];
1087
1220
  const unansweredQuestions = [];
1088
- quiz.questions.forEach((question, index) => {
1221
+ activeQuiz.quiz.questions.forEach((question, index) => {
1089
1222
  const userAnswer = userAnswers.find(
1090
- (answer) => answer.id === question.id
1223
+ (answer) => answer.questionId === question.id
1091
1224
  );
1092
- if (!userAnswer || userAnswer.isSkipped) {
1225
+ const hasAnswer = userAnswer && userAnswer.answer !== null;
1226
+ const isSkipped = userAnswer && userAnswer.answer === null;
1227
+ if (!hasAnswer || isSkipped) {
1093
1228
  unansweredQuestions.push(index + 1);
1094
1229
  }
1095
1230
  });
1096
1231
  return unansweredQuestions;
1097
1232
  },
1098
1233
  getQuestionsGroupedBySubject: () => {
1099
- const { bySimulado, byAtividade, byAula } = get();
1100
- const quiz = bySimulado || byAtividade || byAula;
1101
- if (!quiz) return {};
1234
+ const { getActiveQuiz } = get();
1235
+ const activeQuiz = getActiveQuiz();
1236
+ if (!activeQuiz) return {};
1102
1237
  const groupedQuestions = {};
1103
- quiz.questions.forEach((question) => {
1238
+ activeQuiz.quiz.questions.forEach((question) => {
1104
1239
  const subjectId = question.knowledgeMatrix?.[0]?.subjectId || "Sem mat\xE9ria";
1105
1240
  if (!groupedQuestions[subjectId]) {
1106
1241
  groupedQuestions[subjectId] = [];
@@ -1108,6 +1243,31 @@ var useQuizStore = create2()(
1108
1243
  groupedQuestions[subjectId].push(question);
1109
1244
  });
1110
1245
  return groupedQuestions;
1246
+ },
1247
+ // New methods for userAnswers
1248
+ getUserAnswerByQuestionId: (questionId) => {
1249
+ const { userAnswers } = get();
1250
+ return userAnswers.find((answer) => answer.questionId === questionId) || null;
1251
+ },
1252
+ isQuestionAnsweredByUserAnswers: (questionId) => {
1253
+ const { userAnswers } = get();
1254
+ const answer = userAnswers.find(
1255
+ (answer2) => answer2.questionId === questionId
1256
+ );
1257
+ return answer ? answer.answer !== null : false;
1258
+ },
1259
+ getQuestionStatusFromUserAnswers: (questionId) => {
1260
+ const { userAnswers } = get();
1261
+ const answer = userAnswers.find(
1262
+ (answer2) => answer2.questionId === questionId
1263
+ );
1264
+ if (!answer) return "unanswered";
1265
+ if (answer.answer === null) return "skipped";
1266
+ return "answered";
1267
+ },
1268
+ getUserAnswersForActivity: () => {
1269
+ const { userAnswers } = get();
1270
+ return userAnswers;
1111
1271
  }
1112
1272
  };
1113
1273
  },
@@ -1198,7 +1358,11 @@ var AlertDialog = forwardRef4(
1198
1358
  "div",
1199
1359
  {
1200
1360
  ref,
1201
- className: `bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3 ${sizeClasses} ${className}`,
1361
+ className: cn(
1362
+ "bg-background border border-border-100 rounded-lg shadow-lg p-6 m-3",
1363
+ sizeClasses,
1364
+ className
1365
+ ),
1202
1366
  ...props,
1203
1367
  children: [
1204
1368
  /* @__PURE__ */ jsx7(
@@ -1297,7 +1461,12 @@ var Modal = ({
1297
1461
  const sizeClasses = SIZE_CLASSES5[size];
1298
1462
  const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
1299
1463
  const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
1300
- const modalClasses = `${baseClasses} ${sizeClasses} ${dialogResetClasses} ${className}`;
1464
+ const modalClasses = cn(
1465
+ baseClasses,
1466
+ sizeClasses,
1467
+ dialogResetClasses,
1468
+ className
1469
+ );
1301
1470
  return /* @__PURE__ */ jsx8(
1302
1471
  "div",
1303
1472
  {
@@ -1518,11 +1687,11 @@ var Select = ({
1518
1687
  "label",
1519
1688
  {
1520
1689
  htmlFor: selectId,
1521
- className: `block font-bold text-text-900 mb-1.5 ${sizeClasses}`,
1690
+ className: cn("block font-bold text-text-900 mb-1.5", sizeClasses),
1522
1691
  children: label
1523
1692
  }
1524
1693
  ),
1525
- /* @__PURE__ */ jsx9("div", { className: `relative ${sizeClasses}`, ref: selectRef, children: injectStore2(children, store, size, selectId) }),
1694
+ /* @__PURE__ */ jsx9("div", { className: cn("relative", sizeClasses), ref: selectRef, children: injectStore2(children, store, size, selectId) }),
1526
1695
  /* @__PURE__ */ jsxs7("div", { className: "mt-1.5 gap-1.5", children: [
1527
1696
  helperText && /* @__PURE__ */ jsx9("p", { className: "text-sm text-text-500", children: helperText }),
1528
1697
  errorMessage && /* @__PURE__ */ jsxs7("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
@@ -1583,7 +1752,10 @@ var SelectTrigger = forwardRef5(
1583
1752
  /* @__PURE__ */ jsx9(
1584
1753
  CaretDown,
1585
1754
  {
1586
- className: `h-[1em] w-[1em] opacity-50 transition-transform ${open ? "rotate-180" : ""}`
1755
+ className: cn(
1756
+ "h-[1em] w-[1em] opacity-50 transition-transform",
1757
+ open ? "rotate-180" : ""
1758
+ )
1587
1759
  }
1588
1760
  )
1589
1761
  ]
@@ -1610,7 +1782,11 @@ var SelectContent = forwardRef5(
1610
1782
  {
1611
1783
  role: "menu",
1612
1784
  ref,
1613
- 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}`,
1785
+ className: cn(
1786
+ "bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100",
1787
+ getPositionClasses(),
1788
+ className
1789
+ ),
1614
1790
  ...props,
1615
1791
  children
1616
1792
  }
@@ -1799,7 +1975,10 @@ var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue,
1799
1975
  return /* @__PURE__ */ jsx10(
1800
1976
  "div",
1801
1977
  {
1802
- className: `text-xs font-medium leading-[14px] text-right ${percentageClassName}`,
1978
+ className: cn(
1979
+ "text-xs font-medium leading-[14px] text-right",
1980
+ percentageClassName
1981
+ ),
1803
1982
  children: displayPriority.type === "hitCount" ? /* @__PURE__ */ jsxs8(Fragment3, { children: [
1804
1983
  /* @__PURE__ */ jsx10("span", { className: "text-success-200", children: Math.round(clampedValue) }),
1805
1984
  /* @__PURE__ */ jsxs8("span", { className: "text-text-600", children: [
@@ -1824,7 +2003,11 @@ var ProgressBarBase = ({
1824
2003
  }) => /* @__PURE__ */ jsxs8(
1825
2004
  "div",
1826
2005
  {
1827
- className: `${containerClassName} ${variantClasses.background} overflow-hidden relative`,
2006
+ className: cn(
2007
+ containerClassName,
2008
+ variantClasses.background,
2009
+ "overflow-hidden relative"
2010
+ ),
1828
2011
  children: [
1829
2012
  /* @__PURE__ */ jsx10(
1830
2013
  "progress",
@@ -1838,7 +2021,11 @@ var ProgressBarBase = ({
1838
2021
  /* @__PURE__ */ jsx10(
1839
2022
  "div",
1840
2023
  {
1841
- className: `${fillClassName} ${variantClasses.fill} transition-all duration-300 ease-out`,
2024
+ className: cn(
2025
+ fillClassName,
2026
+ variantClasses.fill,
2027
+ "transition-all duration-300 ease-out"
2028
+ ),
1842
2029
  style: { width: `${percentage}%` }
1843
2030
  }
1844
2031
  )
@@ -1860,7 +2047,12 @@ var StackedLayout = ({
1860
2047
  }) => /* @__PURE__ */ jsxs8(
1861
2048
  "div",
1862
2049
  {
1863
- className: `flex flex-col items-start gap-2 ${dimensions.width} ${dimensions.height} ${className}`,
2050
+ className: cn(
2051
+ "flex flex-col items-start gap-2",
2052
+ dimensions.width,
2053
+ dimensions.height,
2054
+ className
2055
+ ),
1864
2056
  children: [
1865
2057
  shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsxs8("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
1866
2058
  label && /* @__PURE__ */ jsx10(
@@ -1869,7 +2061,7 @@ var StackedLayout = ({
1869
2061
  as: "div",
1870
2062
  size: "md",
1871
2063
  weight: "medium",
1872
- className: `text-text-600 leading-[19px] ${labelClassName}`,
2064
+ className: cn("text-text-600 leading-[19px]", labelClassName),
1873
2065
  children: label
1874
2066
  }
1875
2067
  ),
@@ -1927,7 +2119,12 @@ var CompactLayout = ({
1927
2119
  return /* @__PURE__ */ jsxs8(
1928
2120
  "div",
1929
2121
  {
1930
- className: `flex flex-col items-start gap-1 ${dimensions.width} ${dimensions.height} ${className}`,
2122
+ className: cn(
2123
+ "flex flex-col items-start gap-1",
2124
+ dimensions.width,
2125
+ dimensions.height,
2126
+ className
2127
+ ),
1931
2128
  children: [
1932
2129
  shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsx10(
1933
2130
  Text_default,
@@ -1936,7 +2133,7 @@ var CompactLayout = ({
1936
2133
  size: "sm",
1937
2134
  weight: "medium",
1938
2135
  color,
1939
- className: `leading-4 w-full ${compactClassName}`,
2136
+ className: cn("leading-4 w-full", compactClassName),
1940
2137
  children: content
1941
2138
  }
1942
2139
  ),
@@ -1976,7 +2173,7 @@ var DefaultLayout = ({
1976
2173
  label,
1977
2174
  showPercentage
1978
2175
  );
1979
- return /* @__PURE__ */ jsxs8("div", { className: `flex ${sizeClasses.layout} ${gapClass} ${className}`, children: [
2176
+ return /* @__PURE__ */ jsxs8("div", { className: cn("flex", sizeClasses.layout, gapClass, className), children: [
1980
2177
  displayConfig.showHeader && /* @__PURE__ */ jsxs8("div", { className: "flex flex-row items-center justify-between w-full", children: [
1981
2178
  label && /* @__PURE__ */ jsx10(
1982
2179
  Text_default,
@@ -1984,7 +2181,10 @@ var DefaultLayout = ({
1984
2181
  as: "div",
1985
2182
  size: "xs",
1986
2183
  weight: "medium",
1987
- className: `text-text-950 leading-none tracking-normal text-center ${labelClassName}`,
2184
+ className: cn(
2185
+ "text-text-950 leading-none tracking-normal text-center",
2186
+ labelClassName
2187
+ ),
1988
2188
  children: label
1989
2189
  }
1990
2190
  ),
@@ -1993,7 +2193,10 @@ var DefaultLayout = ({
1993
2193
  {
1994
2194
  size: "xs",
1995
2195
  weight: "medium",
1996
- className: `text-text-950 leading-none tracking-normal text-center ${percentageClassName}`,
2196
+ className: cn(
2197
+ "text-text-950 leading-none tracking-normal text-center",
2198
+ percentageClassName
2199
+ ),
1997
2200
  children: [
1998
2201
  Math.round(percentage),
1999
2202
  "%"
@@ -2009,8 +2212,16 @@ var DefaultLayout = ({
2009
2212
  percentage,
2010
2213
  label,
2011
2214
  variantClasses,
2012
- containerClassName: `${progressBarClass} ${sizeClasses.container} ${sizeClasses.borderRadius}`,
2013
- fillClassName: `${sizeClasses.bar} ${sizeClasses.borderRadius} shadow-hard-shadow-3`
2215
+ containerClassName: cn(
2216
+ progressBarClass,
2217
+ sizeClasses.container,
2218
+ sizeClasses.borderRadius
2219
+ ),
2220
+ fillClassName: cn(
2221
+ sizeClasses.bar,
2222
+ sizeClasses.borderRadius,
2223
+ "shadow-hard-shadow-3"
2224
+ )
2014
2225
  }
2015
2226
  ),
2016
2227
  displayConfig.showPercentage && /* @__PURE__ */ jsxs8(
@@ -2018,7 +2229,10 @@ var DefaultLayout = ({
2018
2229
  {
2019
2230
  size: "xs",
2020
2231
  weight: "medium",
2021
- className: `text-text-950 leading-none tracking-normal text-center flex-none ${percentageClassName}`,
2232
+ className: cn(
2233
+ "text-text-950 leading-none tracking-normal text-center flex-none",
2234
+ percentageClassName
2235
+ ),
2022
2236
  children: [
2023
2237
  Math.round(percentage),
2024
2238
  "%"
@@ -2031,7 +2245,10 @@ var DefaultLayout = ({
2031
2245
  as: "div",
2032
2246
  size: "xs",
2033
2247
  weight: "medium",
2034
- className: `text-text-950 leading-none tracking-normal text-center flex-none ${labelClassName}`,
2248
+ className: cn(
2249
+ "text-text-950 leading-none tracking-normal text-center flex-none",
2250
+ labelClassName
2251
+ ),
2035
2252
  children: label
2036
2253
  }
2037
2254
  )
@@ -2228,21 +2445,28 @@ var CardActivitiesResults = forwardRef6(
2228
2445
  "div",
2229
2446
  {
2230
2447
  ref,
2231
- className: `w-full flex flex-col border border-border-50 bg-background rounded-xl ${className}`,
2448
+ className: cn(
2449
+ "w-full flex flex-col border border-border-50 bg-background rounded-xl",
2450
+ className
2451
+ ),
2232
2452
  ...props,
2233
2453
  children: [
2234
2454
  /* @__PURE__ */ jsxs9(
2235
2455
  "div",
2236
2456
  {
2237
- className: `
2238
- flex flex-col gap-1 items-center justify-center p-4
2239
- ${actionCardClasses}
2240
- ${extended ? "rounded-t-xl" : "rounded-xl"}`,
2457
+ className: cn(
2458
+ "flex flex-col gap-1 items-center justify-center p-4",
2459
+ actionCardClasses,
2460
+ extended ? "rounded-t-xl" : "rounded-xl"
2461
+ ),
2241
2462
  children: [
2242
2463
  /* @__PURE__ */ jsx11(
2243
2464
  "span",
2244
2465
  {
2245
- className: `size-7.5 rounded-full flex items-center justify-center ${actionIconClasses}`,
2466
+ className: cn(
2467
+ "size-7.5 rounded-full flex items-center justify-center",
2468
+ actionIconClasses
2469
+ ),
2246
2470
  children: icon
2247
2471
  }
2248
2472
  ),
@@ -2255,7 +2479,13 @@ var CardActivitiesResults = forwardRef6(
2255
2479
  children: title
2256
2480
  }
2257
2481
  ),
2258
- /* @__PURE__ */ jsx11("p", { className: `text-lg font-bold truncate ${actionSubTitleClasses}`, children: subTitle })
2482
+ /* @__PURE__ */ jsx11(
2483
+ "p",
2484
+ {
2485
+ className: cn("text-lg font-bold truncate", actionSubTitleClasses),
2486
+ children: subTitle
2487
+ }
2488
+ )
2259
2489
  ]
2260
2490
  }
2261
2491
  ),
@@ -2263,7 +2493,10 @@ var CardActivitiesResults = forwardRef6(
2263
2493
  /* @__PURE__ */ jsx11(
2264
2494
  "p",
2265
2495
  {
2266
- className: `text-2xs font-medium uppercase truncate ${actionHeaderClasses}`,
2496
+ className: cn(
2497
+ "text-2xs font-medium uppercase truncate",
2498
+ actionHeaderClasses
2499
+ ),
2267
2500
  children: header
2268
2501
  }
2269
2502
  ),
@@ -2293,7 +2526,7 @@ var CardQuestions = forwardRef6(
2293
2526
  layout: "horizontal",
2294
2527
  padding: "medium",
2295
2528
  minHeight: "medium",
2296
- className: `justify-between gap-4 ${className}`,
2529
+ className: cn("justify-between gap-4", className),
2297
2530
  ...props,
2298
2531
  children: [
2299
2532
  /* @__PURE__ */ jsxs9("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
@@ -2371,7 +2604,9 @@ var CardProgress = forwardRef6(
2371
2604
  {
2372
2605
  size: "xs",
2373
2606
  weight: "medium",
2374
- className: `text-text-950 leading-none tracking-normal text-center flex-none`,
2607
+ className: cn(
2608
+ "text-text-950 leading-none tracking-normal text-center flex-none"
2609
+ ),
2375
2610
  children: [
2376
2611
  Math.round(progress),
2377
2612
  "%"
@@ -2390,17 +2625,17 @@ var CardProgress = forwardRef6(
2390
2625
  padding: "none",
2391
2626
  minHeight: "medium",
2392
2627
  cursor: "pointer",
2393
- className: `${isHorizontal ? "h-20" : ""} ${className}`,
2628
+ className: cn(isHorizontal ? "h-20" : "", className),
2394
2629
  ...props,
2395
2630
  children: [
2396
2631
  /* @__PURE__ */ jsx11(
2397
2632
  "div",
2398
2633
  {
2399
- className: `
2400
- flex justify-center items-center [&>svg]:size-6 text-text-950
2401
- ${isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl"}
2402
- ${!color.startsWith("#") ? `bg-${color}` : ""}
2403
- `,
2634
+ className: cn(
2635
+ "flex justify-center items-center [&>svg]:size-6 text-text-950",
2636
+ isHorizontal ? "min-w-[80px] min-h-[80px] rounded-l-xl" : "min-h-[50px] w-full rounded-t-xl",
2637
+ !color.startsWith("#") ? `bg-${color}` : ""
2638
+ ),
2404
2639
  style: color.startsWith("#") ? { backgroundColor: color } : void 0,
2405
2640
  "data-testid": "icon-container",
2406
2641
  children: icon
@@ -2409,10 +2644,10 @@ var CardProgress = forwardRef6(
2409
2644
  /* @__PURE__ */ jsxs9(
2410
2645
  "div",
2411
2646
  {
2412
- className: `
2413
- p-4 flex flex-col justify-between w-full h-full
2414
- ${!isHorizontal && "gap-4"}
2415
- `,
2647
+ className: cn(
2648
+ "p-4 flex flex-col justify-between w-full h-full",
2649
+ !isHorizontal && "gap-4"
2650
+ ),
2416
2651
  children: [
2417
2652
  /* @__PURE__ */ jsx11(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
2418
2653
  contentComponent[direction]
@@ -2442,7 +2677,7 @@ var CardTopic = forwardRef6(
2442
2677
  padding: "small",
2443
2678
  minHeight: "medium",
2444
2679
  cursor: "pointer",
2445
- className: `justify-center gap-2 py-2 px-4 ${className}`,
2680
+ className: cn("justify-center gap-2 py-2 px-4", className),
2446
2681
  ...props,
2447
2682
  children: [
2448
2683
  subHead && /* @__PURE__ */ jsx11("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ jsxs9(Fragment4, { children: [
@@ -2465,7 +2700,9 @@ var CardTopic = forwardRef6(
2465
2700
  {
2466
2701
  size: "xs",
2467
2702
  weight: "medium",
2468
- className: `text-text-950 leading-none tracking-normal text-center flex-none`,
2703
+ className: cn(
2704
+ "text-text-950 leading-none tracking-normal text-center flex-none"
2705
+ ),
2469
2706
  children: [
2470
2707
  Math.round(progress),
2471
2708
  "%"
@@ -2499,7 +2736,10 @@ var CardPerformance = forwardRef6(
2499
2736
  layout: "horizontal",
2500
2737
  padding: "medium",
2501
2738
  minHeight: "none",
2502
- className: `justify-between gap-2 ${actionVariant == "caret" ? "cursor-pointer" : ""} ${className}`,
2739
+ className: cn(
2740
+ actionVariant == "caret" ? "cursor-pointer" : "",
2741
+ className
2742
+ ),
2503
2743
  onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
2504
2744
  ...props,
2505
2745
  children: [
@@ -2557,15 +2797,15 @@ var CardResults = forwardRef6(
2557
2797
  layout: "horizontal",
2558
2798
  padding: "none",
2559
2799
  minHeight: "medium",
2560
- className: `items-center cursor-pointer pr-4 ${className}`,
2800
+ className: cn("items-center cursor-pointer pr-4", className),
2561
2801
  ...props,
2562
2802
  children: [
2563
2803
  /* @__PURE__ */ jsx11(
2564
2804
  "div",
2565
2805
  {
2566
- className: `
2567
- 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
2568
- `,
2806
+ className: cn(
2807
+ "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"
2808
+ ),
2569
2809
  style: {
2570
2810
  backgroundColor: color
2571
2811
  },
@@ -2575,10 +2815,10 @@ var CardResults = forwardRef6(
2575
2815
  /* @__PURE__ */ jsxs9(
2576
2816
  "div",
2577
2817
  {
2578
- className: `
2579
- p-4 flex justify-between w-full h-full
2580
- ${isRow ? "flex-row items-center gap-2" : "flex-col"}
2581
- `,
2818
+ className: cn(
2819
+ "p-4 flex justify-between w-full h-full",
2820
+ isRow ? "flex-row items-center gap-2" : "flex-col"
2821
+ ),
2582
2822
  children: [
2583
2823
  /* @__PURE__ */ jsx11("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
2584
2824
  /* @__PURE__ */ jsxs9("span", { className: "flex flex-row gap-1 items-center", children: [
@@ -2627,7 +2867,7 @@ var CardStatus = forwardRef6(
2627
2867
  layout: "horizontal",
2628
2868
  padding: "medium",
2629
2869
  minHeight: "medium",
2630
- className: `items-center cursor-pointer ${className}`,
2870
+ className: cn("items-center cursor-pointer", className),
2631
2871
  ...props,
2632
2872
  children: /* @__PURE__ */ jsxs9("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
2633
2873
  /* @__PURE__ */ jsx11("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
@@ -2659,7 +2899,10 @@ var CardSettings = forwardRef6(
2659
2899
  layout: "horizontal",
2660
2900
  padding: "small",
2661
2901
  minHeight: "none",
2662
- className: `border-none items-center gap-2 text-text-700 ${className}`,
2902
+ className: cn(
2903
+ "border-none items-center gap-2 text-text-700",
2904
+ className
2905
+ ),
2663
2906
  ...props,
2664
2907
  children: [
2665
2908
  /* @__PURE__ */ jsx11("span", { className: "[&>svg]:size-6", children: icon }),
@@ -2679,15 +2922,19 @@ var CardSupport = forwardRef6(
2679
2922
  layout: "horizontal",
2680
2923
  padding: "medium",
2681
2924
  minHeight: "none",
2682
- className: `border-none items-center gap-2 text-text-700 ${className}`,
2925
+ className: cn(
2926
+ "border-none items-center gap-2 text-text-700",
2927
+ className
2928
+ ),
2683
2929
  ...props,
2684
2930
  children: [
2685
2931
  /* @__PURE__ */ jsxs9(
2686
2932
  "div",
2687
2933
  {
2688
- className: `
2689
- w-full flex ${direction == "col" ? "flex-col" : "flex-row items-center"} gap-2
2690
- `,
2934
+ className: cn(
2935
+ "w-full flex",
2936
+ direction == "col" ? "flex-col" : "flex-row items-center"
2937
+ ),
2691
2938
  children: [
2692
2939
  /* @__PURE__ */ jsx11("span", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx11("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
2693
2940
  /* @__PURE__ */ jsx11("span", { className: "flex flex-row gap-1", children })
@@ -2722,7 +2969,7 @@ var CardForum = forwardRef6(
2722
2969
  padding: "medium",
2723
2970
  minHeight: "none",
2724
2971
  variant: "minimal",
2725
- className: `w-auto h-auto gap-3 ${className}`,
2972
+ className: cn("w-auto h-auto gap-3", className),
2726
2973
  ...props,
2727
2974
  children: [
2728
2975
  /* @__PURE__ */ jsx11(
@@ -2855,7 +3102,7 @@ var CardAudio = forwardRef6(
2855
3102
  layout: "horizontal",
2856
3103
  padding: "medium",
2857
3104
  minHeight: "none",
2858
- className: `w-auto h-14 items-center gap-2 ${className}`,
3105
+ className: cn("w-auto h-14 items-center gap-2", className),
2859
3106
  ...props,
2860
3107
  children: [
2861
3108
  /* @__PURE__ */ jsx11(
@@ -3024,7 +3271,10 @@ var CardSimulado = forwardRef6(
3024
3271
  padding: "medium",
3025
3272
  minHeight: "none",
3026
3273
  cursor: "pointer",
3027
- className: `${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200 ${className}`,
3274
+ className: cn(
3275
+ `${backgroundClass} hover:shadow-soft-shadow-2 transition-shadow duration-200`,
3276
+ className
3277
+ ),
3028
3278
  ...props,
3029
3279
  children: /* @__PURE__ */ jsxs9("div", { className: "flex justify-between items-center w-full gap-4", children: [
3030
3280
  /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
@@ -3087,7 +3337,9 @@ var CardTest = forwardRef6(
3087
3337
  {
3088
3338
  ref,
3089
3339
  type: "button",
3090
- className: `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim(),
3340
+ className: cn(
3341
+ `${baseClasses} ${interactiveClasses} ${selectedClasses} ${className}`.trim()
3342
+ ),
3091
3343
  onClick: handleClick,
3092
3344
  onKeyDown: handleKeyDown,
3093
3345
  "aria-pressed": selected,
@@ -3131,7 +3383,7 @@ var CardTest = forwardRef6(
3131
3383
  "div",
3132
3384
  {
3133
3385
  ref,
3134
- className: `${baseClasses} ${className}`.trim(),
3386
+ className: cn(`${baseClasses} ${className}`.trim()),
3135
3387
  ...props,
3136
3388
  children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
3137
3389
  /* @__PURE__ */ jsx11(
@@ -3196,16 +3448,16 @@ var CardSimulationHistory = forwardRef6(({ data, onSimulationClick, className, .
3196
3448
  "div",
3197
3449
  {
3198
3450
  ref,
3199
- className: `w-full max-w-[992px] h-auto ${className}`,
3451
+ className: cn("w-full max-w-[992px] h-auto", className),
3200
3452
  ...props,
3201
3453
  children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-0", children: [
3202
3454
  data.map((section, sectionIndex) => /* @__PURE__ */ jsx11("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs9(
3203
3455
  "div",
3204
3456
  {
3205
- className: `
3206
- flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-white
3207
- ${sectionIndex === 0 ? "rounded-t-3xl" : ""}
3208
- `,
3457
+ className: cn(
3458
+ "flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-white",
3459
+ sectionIndex === 0 ? "rounded-t-3xl" : ""
3460
+ ),
3209
3461
  children: [
3210
3462
  /* @__PURE__ */ jsx11(
3211
3463
  Text_default,
@@ -3225,10 +3477,10 @@ var CardSimulationHistory = forwardRef6(({ data, onSimulationClick, className, .
3225
3477
  padding: "medium",
3226
3478
  minHeight: "none",
3227
3479
  cursor: "pointer",
3228
- className: `
3229
- ${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
3230
- transition-shadow duration-200 h-auto min-h-[61px]
3231
- `,
3480
+ className: cn(
3481
+ `${typeStyles.background} rounded-xl hover:shadow-soft-shadow-2
3482
+ transition-shadow duration-200 h-auto min-h-[61px]`
3483
+ ),
3232
3484
  onClick: () => onSimulationClick?.(simulation),
3233
3485
  children: /* @__PURE__ */ jsxs9("div", { className: "flex justify-between items-center w-full gap-2", children: [
3234
3486
  /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
@@ -3276,19 +3528,236 @@ var CardSimulationHistory = forwardRef6(({ data, onSimulationClick, className, .
3276
3528
  );
3277
3529
  });
3278
3530
 
3531
+ // src/components/ProgressCircle/ProgressCircle.tsx
3532
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3533
+ var SIZE_CLASSES8 = {
3534
+ small: {
3535
+ container: "w-[90px] h-[90px]",
3536
+ // 90px circle from design specs
3537
+ strokeWidth: 4,
3538
+ // 4px stroke width - matches ProgressBar small (h-1)
3539
+ textSize: "2xl",
3540
+ // 24px for percentage (font-size: 24px)
3541
+ textWeight: "medium",
3542
+ // font-weight: 500
3543
+ labelSize: "2xs",
3544
+ // Will be overridden with custom 8px in className
3545
+ labelWeight: "bold",
3546
+ // font-weight: 700
3547
+ spacing: "gap-0",
3548
+ // Reduced gap between percentage and label for better spacing
3549
+ contentWidth: "max-w-[50px]"
3550
+ // Reduced width to fit text inside circle
3551
+ },
3552
+ medium: {
3553
+ container: "w-[152px] h-[152px]",
3554
+ // 151.67px ≈ 152px circle from design specs
3555
+ strokeWidth: 8,
3556
+ // 8px stroke width - matches ProgressBar medium (h-2)
3557
+ textSize: "2xl",
3558
+ // 24px for percentage (font-size: 24px)
3559
+ textWeight: "medium",
3560
+ // font-weight: 500
3561
+ labelSize: "xs",
3562
+ // 12px for status label (font-size: 12px)
3563
+ labelWeight: "medium",
3564
+ // font-weight: 500 (changed from bold)
3565
+ spacing: "gap-1",
3566
+ // 4px gap between percentage and label
3567
+ contentWidth: "max-w-[90px]"
3568
+ // Reduced width to fit text inside circle
3569
+ }
3570
+ };
3571
+ var VARIANT_CLASSES3 = {
3572
+ blue: {
3573
+ background: "stroke-primary-100",
3574
+ // Light blue background (#BBDCF7)
3575
+ fill: "stroke-primary-700",
3576
+ // Blue for activity progress (#2271C4)
3577
+ textColor: "text-primary-700",
3578
+ // Blue text color (#2271C4)
3579
+ labelColor: "text-text-700"
3580
+ // Gray text for label (#525252)
3581
+ },
3582
+ green: {
3583
+ background: "stroke-background-300",
3584
+ // Gray background (#D5D4D4 - matches design)
3585
+ fill: "stroke-success-200",
3586
+ // Green for performance (#84D3A2 - matches design)
3587
+ textColor: "text-text-800",
3588
+ // Dark gray text (#404040 - matches design)
3589
+ labelColor: "text-text-600"
3590
+ // Medium gray text for label (#737373 - matches design)
3591
+ }
3592
+ };
3593
+ var ProgressCircle = ({
3594
+ value,
3595
+ max = 100,
3596
+ size = "small",
3597
+ variant = "blue",
3598
+ label,
3599
+ showPercentage = true,
3600
+ className = "",
3601
+ labelClassName = "",
3602
+ percentageClassName = ""
3603
+ }) => {
3604
+ const safeValue = isNaN(value) ? 0 : value;
3605
+ const clampedValue = Math.max(0, Math.min(safeValue, max));
3606
+ const percentage = max === 0 ? 0 : clampedValue / max * 100;
3607
+ const sizeClasses = SIZE_CLASSES8[size];
3608
+ const variantClasses = VARIANT_CLASSES3[variant];
3609
+ const radius = size === "small" ? 37 : 64;
3610
+ const circumference = 2 * Math.PI * radius;
3611
+ const strokeDashoffset = circumference - percentage / 100 * circumference;
3612
+ const center = size === "small" ? 45 : 76;
3613
+ const svgSize = size === "small" ? 90 : 152;
3614
+ return /* @__PURE__ */ jsxs10(
3615
+ "div",
3616
+ {
3617
+ className: cn(
3618
+ "relative flex flex-col items-center justify-center",
3619
+ sizeClasses.container,
3620
+ "rounded-lg",
3621
+ className
3622
+ ),
3623
+ children: [
3624
+ /* @__PURE__ */ jsxs10(
3625
+ "svg",
3626
+ {
3627
+ className: "absolute inset-0 transform -rotate-90",
3628
+ width: svgSize,
3629
+ height: svgSize,
3630
+ viewBox: `0 0 ${svgSize} ${svgSize}`,
3631
+ "aria-hidden": "true",
3632
+ children: [
3633
+ /* @__PURE__ */ jsx12(
3634
+ "circle",
3635
+ {
3636
+ cx: center,
3637
+ cy: center,
3638
+ r: radius,
3639
+ fill: "none",
3640
+ strokeWidth: sizeClasses.strokeWidth,
3641
+ className: cn(variantClasses.background, "rounded-lg")
3642
+ }
3643
+ ),
3644
+ /* @__PURE__ */ jsx12(
3645
+ "circle",
3646
+ {
3647
+ cx: center,
3648
+ cy: center,
3649
+ r: radius,
3650
+ fill: "none",
3651
+ strokeWidth: sizeClasses.strokeWidth,
3652
+ strokeLinecap: "round",
3653
+ strokeDasharray: circumference,
3654
+ strokeDashoffset,
3655
+ className: cn(
3656
+ variantClasses.fill,
3657
+ "transition-all duration-500 ease-out shadow-soft-shadow-3 rounded-lg"
3658
+ )
3659
+ }
3660
+ )
3661
+ ]
3662
+ }
3663
+ ),
3664
+ /* @__PURE__ */ jsx12(
3665
+ "progress",
3666
+ {
3667
+ value: clampedValue,
3668
+ max,
3669
+ "aria-label": typeof label === "string" ? label : "Progress",
3670
+ className: "absolute opacity-0 w-0 h-0"
3671
+ }
3672
+ ),
3673
+ /* @__PURE__ */ jsxs10(
3674
+ "div",
3675
+ {
3676
+ className: cn(
3677
+ "relative z-10 flex flex-col items-center justify-center",
3678
+ sizeClasses.spacing,
3679
+ sizeClasses.contentWidth
3680
+ ),
3681
+ children: [
3682
+ showPercentage && /* @__PURE__ */ jsxs10(
3683
+ Text_default,
3684
+ {
3685
+ size: sizeClasses.textSize,
3686
+ weight: sizeClasses.textWeight,
3687
+ className: cn(
3688
+ "text-center w-full",
3689
+ variantClasses.textColor,
3690
+ percentageClassName
3691
+ ),
3692
+ children: [
3693
+ Math.round(percentage),
3694
+ "%"
3695
+ ]
3696
+ }
3697
+ ),
3698
+ label && /* @__PURE__ */ jsx12(
3699
+ Text_default,
3700
+ {
3701
+ as: "span",
3702
+ size: sizeClasses.labelSize,
3703
+ weight: sizeClasses.labelWeight,
3704
+ className: cn(
3705
+ variantClasses.labelColor,
3706
+ "text-center uppercase tracking-wide truncate w-full",
3707
+ labelClassName
3708
+ ),
3709
+ children: label
3710
+ }
3711
+ )
3712
+ ]
3713
+ }
3714
+ )
3715
+ ]
3716
+ }
3717
+ );
3718
+ };
3719
+ var ProgressCircle_default = ProgressCircle;
3720
+
3279
3721
  // src/components/Quiz/Quiz.tsx
3280
- import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3722
+ import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
3281
3723
  var Quiz = forwardRef7(({ children, className, ...props }, ref) => {
3282
- return /* @__PURE__ */ jsx12(
3724
+ return /* @__PURE__ */ jsx13(
3283
3725
  "div",
3284
3726
  {
3285
3727
  ref,
3286
- className: `w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6 ${className}`,
3728
+ className: cn(
3729
+ "w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6",
3730
+ className
3731
+ ),
3287
3732
  ...props,
3288
3733
  children
3289
3734
  }
3290
3735
  );
3291
3736
  });
3737
+ var QuizHeaderResult = forwardRef7(
3738
+ ({ className, ...props }, ref) => {
3739
+ const { getCurrentQuestion, getCurrentAnswer } = useQuizStore();
3740
+ const currentQuestion = getCurrentQuestion();
3741
+ const userAnswer = getCurrentAnswer();
3742
+ const isCorrect = userAnswer === currentQuestion?.correctOptionId;
3743
+ return /* @__PURE__ */ jsxs11(
3744
+ "div",
3745
+ {
3746
+ ref,
3747
+ className: cn(
3748
+ "flex flex-row items-center gap-10 p-3.5 rounded-xl",
3749
+ isCorrect ? "bg-success-background" : "bg-error-background",
3750
+ className
3751
+ ),
3752
+ ...props,
3753
+ children: [
3754
+ /* @__PURE__ */ jsx13("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
3755
+ /* @__PURE__ */ jsx13("p", { className: "text-text-700 text-md", children: isCorrect ? "\u{1F389} Parab\xE9ns!!" : "N\xE3o foi dessa vez..." })
3756
+ ]
3757
+ }
3758
+ );
3759
+ }
3760
+ );
3292
3761
  var QuizTitle = forwardRef7(
3293
3762
  ({ className, ...props }, ref) => {
3294
3763
  const {
@@ -3301,18 +3770,21 @@ var QuizTitle = forwardRef7(
3301
3770
  } = useQuizStore();
3302
3771
  const totalQuestions = getTotalQuestions();
3303
3772
  const quizTitle = getQuizTitle();
3304
- return /* @__PURE__ */ jsxs10(
3773
+ return /* @__PURE__ */ jsxs11(
3305
3774
  "div",
3306
3775
  {
3307
3776
  ref,
3308
- className: `flex flex-row justify-center items-center relative p-2 ${className}`,
3777
+ className: cn(
3778
+ "flex flex-row justify-center items-center relative p-2",
3779
+ className
3780
+ ),
3309
3781
  ...props,
3310
3782
  children: [
3311
- /* @__PURE__ */ jsxs10("span", { className: "flex flex-col gap-2 text-center", children: [
3312
- /* @__PURE__ */ jsx12("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
3313
- /* @__PURE__ */ jsx12("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
3783
+ /* @__PURE__ */ jsxs11("span", { className: "flex flex-col gap-2 text-center", children: [
3784
+ /* @__PURE__ */ jsx13("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
3785
+ /* @__PURE__ */ jsx13("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
3314
3786
  ] }),
3315
- /* @__PURE__ */ jsx12("span", { className: "absolute right-2", children: /* @__PURE__ */ jsx12(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx12(Clock2, {}), children: isStarted ? formatTime(timeElapsed) : "00:00" }) })
3787
+ /* @__PURE__ */ jsx13("span", { className: "absolute right-2", children: /* @__PURE__ */ jsx13(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx13(Clock2, {}), children: isStarted ? formatTime(timeElapsed) : "00:00" }) })
3316
3788
  ]
3317
3789
  }
3318
3790
  );
@@ -3321,7 +3793,7 @@ var QuizTitle = forwardRef7(
3321
3793
  var QuizHeader = () => {
3322
3794
  const { getCurrentQuestion } = useQuizStore();
3323
3795
  const currentQuestion = getCurrentQuestion();
3324
- return /* @__PURE__ */ jsx12(
3796
+ return /* @__PURE__ */ jsx13(
3325
3797
  HeaderAlternative,
3326
3798
  {
3327
3799
  title: currentQuestion ? `Quest\xE3o ${currentQuestion.id}` : "Quest\xE3o",
@@ -3331,36 +3803,52 @@ var QuizHeader = () => {
3331
3803
  );
3332
3804
  };
3333
3805
  var QuizContent = forwardRef7(({ type = "Alternativas", children, className, ...props }, ref) => {
3334
- return /* @__PURE__ */ jsxs10(Fragment6, { children: [
3335
- /* @__PURE__ */ jsx12("div", { className: "px-4 pb-2 pt-6", children: /* @__PURE__ */ jsx12("p", { className: "font-bold text-lg text-text-950", children: type }) }),
3336
- /* @__PURE__ */ jsx12(
3806
+ return /* @__PURE__ */ jsxs11(Fragment6, { children: [
3807
+ /* @__PURE__ */ jsx13("div", { className: "px-4 pb-2 pt-6", children: /* @__PURE__ */ jsx13("p", { className: "font-bold text-lg text-text-950", children: type }) }),
3808
+ /* @__PURE__ */ jsx13(
3337
3809
  "div",
3338
3810
  {
3339
3811
  ref,
3340
- className: `rounded-t-xl bg-background px-4 pt-4 pb-[80px] h-full flex flex-col gap-4 mb-auto ${className}`,
3812
+ className: cn(
3813
+ "rounded-t-xl px-4 pt-4 pb-[80px] h-full flex flex-col gap-4 mb-auto",
3814
+ className
3815
+ ),
3341
3816
  ...props,
3342
3817
  children
3343
3818
  }
3344
3819
  )
3345
3820
  ] });
3346
3821
  });
3347
- var QuizAlternative = () => {
3822
+ var QuizAlternative = ({ variant = "default" }) => {
3348
3823
  const { getCurrentQuestion, selectAnswer, getCurrentAnswer } = useQuizStore();
3349
3824
  const currentQuestion = getCurrentQuestion();
3350
3825
  const currentAnswer = getCurrentAnswer();
3351
- const alternatives = currentQuestion?.options?.map((option) => ({
3352
- label: option.option,
3353
- value: option.id
3354
- }));
3826
+ const alternatives = currentQuestion?.options?.map((option) => {
3827
+ let status = "neutral" /* NEUTRAL */;
3828
+ if (variant === "result") {
3829
+ if (option.id === currentQuestion.correctOptionId) {
3830
+ status = "correct" /* CORRECT */;
3831
+ } else if (currentAnswer === option.id && option.id !== currentQuestion.correctOptionId) {
3832
+ status = "incorrect" /* INCORRECT */;
3833
+ }
3834
+ }
3835
+ return {
3836
+ label: option.option,
3837
+ value: option.id,
3838
+ status
3839
+ };
3840
+ });
3355
3841
  if (!alternatives)
3356
- return /* @__PURE__ */ jsx12("div", { children: /* @__PURE__ */ jsx12("p", { children: "N\xE3o h\xE1 Alternativas" }) });
3357
- return /* @__PURE__ */ jsx12("div", { className: "space-y-4", children: /* @__PURE__ */ jsx12(
3842
+ return /* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsx13("p", { children: "N\xE3o h\xE1 Alternativas" }) });
3843
+ return /* @__PURE__ */ jsx13("div", { className: "space-y-4", children: /* @__PURE__ */ jsx13(
3358
3844
  AlternativesList,
3359
3845
  {
3846
+ mode: variant === "default" ? "interactive" : "readonly",
3360
3847
  name: `question-${currentQuestion?.id || "1"}`,
3361
- layout: "default",
3848
+ layout: "compact",
3362
3849
  alternatives,
3363
3850
  value: currentAnswer,
3851
+ selectedValue: currentAnswer,
3364
3852
  onValueChange: (value) => {
3365
3853
  if (currentQuestion) {
3366
3854
  selectAnswer(currentQuestion.id, value);
@@ -3377,18 +3865,11 @@ var QuizQuestionList = ({
3377
3865
  const {
3378
3866
  getQuestionsGroupedBySubject,
3379
3867
  goToQuestion,
3380
- isQuestionAnswered,
3381
- isQuestionSkipped
3868
+ getQuestionStatusFromUserAnswers
3382
3869
  } = useQuizStore();
3383
3870
  const groupedQuestions = getQuestionsGroupedBySubject();
3384
3871
  const getQuestionStatus = (questionId) => {
3385
- if (isQuestionSkipped(questionId)) {
3386
- return "skipped";
3387
- }
3388
- if (isQuestionAnswered(questionId)) {
3389
- return "answered";
3390
- }
3391
- return "unanswered";
3872
+ return getQuestionStatusFromUserAnswers(questionId);
3392
3873
  };
3393
3874
  const filteredGroupedQuestions = Object.entries(groupedQuestions).reduce(
3394
3875
  (acc, [subjectId, questions]) => {
@@ -3412,8 +3893,8 @@ var QuizQuestionList = ({
3412
3893
  {}
3413
3894
  );
3414
3895
  const getQuestionIndex = (questionId) => {
3415
- const { bySimulado, byAtividade, byAula } = useQuizStore.getState();
3416
- const quiz = bySimulado ?? byAtividade ?? byAula;
3896
+ const { bySimulated, byActivity, byQuestionary } = useQuizStore.getState();
3897
+ const quiz = bySimulated ?? byActivity ?? byQuestionary;
3417
3898
  if (!quiz) return 0;
3418
3899
  const index = quiz.questions.findIndex((q) => q.id === questionId);
3419
3900
  return index + 1;
@@ -3423,21 +3904,21 @@ var QuizQuestionList = ({
3423
3904
  case "answered":
3424
3905
  return "Respondida";
3425
3906
  case "skipped":
3426
- return "Pulada";
3907
+ return "N\xE3o respondida";
3427
3908
  default:
3428
3909
  return "Em branco";
3429
3910
  }
3430
3911
  };
3431
- return /* @__PURE__ */ jsx12("div", { className: "space-y-6 px-4", children: Object.entries(filteredGroupedQuestions).map(
3432
- ([subjectId, questions]) => /* @__PURE__ */ jsxs10("section", { className: "flex flex-col gap-2", children: [
3433
- /* @__PURE__ */ jsxs10("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
3434
- /* @__PURE__ */ jsx12("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ jsx12(BookOpen, { size: 17, className: "text-white" }) }),
3435
- /* @__PURE__ */ jsx12("p", { className: "text-text-800 font-bold text-lg", children: subjectId })
3912
+ return /* @__PURE__ */ jsx13("div", { className: "space-y-6 px-4", children: Object.entries(filteredGroupedQuestions).map(
3913
+ ([subjectId, questions]) => /* @__PURE__ */ jsxs11("section", { className: "flex flex-col gap-2", children: [
3914
+ /* @__PURE__ */ jsxs11("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
3915
+ /* @__PURE__ */ jsx13("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ jsx13(BookOpen, { size: 17, className: "text-white" }) }),
3916
+ /* @__PURE__ */ jsx13("p", { className: "text-text-800 font-bold text-lg", children: subjectId })
3436
3917
  ] }),
3437
- /* @__PURE__ */ jsx12("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
3918
+ /* @__PURE__ */ jsx13("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
3438
3919
  const status = getQuestionStatus(question.id);
3439
3920
  const questionNumber = getQuestionIndex(question.id);
3440
- return /* @__PURE__ */ jsx12(
3921
+ return /* @__PURE__ */ jsx13(
3441
3922
  CardStatus,
3442
3923
  {
3443
3924
  header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
@@ -3464,14 +3945,14 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3464
3945
  getCurrentAnswer,
3465
3946
  skipQuestion,
3466
3947
  getCurrentQuestion,
3467
- isQuestionSkipped
3948
+ getQuestionStatusFromUserAnswers
3468
3949
  } = useQuizStore();
3469
3950
  const totalQuestions = getTotalQuestions();
3470
3951
  const isFirstQuestion = currentQuestionIndex === 0;
3471
3952
  const isLastQuestion = currentQuestionIndex === totalQuestions - 1;
3472
3953
  const currentAnswer = getCurrentAnswer();
3473
3954
  const currentQuestion = getCurrentQuestion();
3474
- const isCurrentQuestionSkipped = currentQuestion ? isQuestionSkipped(currentQuestion.id) : false;
3955
+ const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
3475
3956
  const [alertDialogOpen, setAlertDialogOpen] = useState4(false);
3476
3957
  const [modalResultOpen, setModalResultOpen] = useState4(false);
3477
3958
  const [modalNavigateOpen, setModalNavigateOpen] = useState4(false);
@@ -3479,24 +3960,27 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3479
3960
  const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
3480
3961
  const userAnswers = getUserAnswers();
3481
3962
  const allQuestions = getTotalQuestions();
3482
- return /* @__PURE__ */ jsxs10(Fragment6, { children: [
3483
- /* @__PURE__ */ jsxs10(
3963
+ return /* @__PURE__ */ jsxs11(Fragment6, { children: [
3964
+ /* @__PURE__ */ jsxs11(
3484
3965
  "footer",
3485
3966
  {
3486
3967
  ref,
3487
- 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}`,
3968
+ className: cn(
3969
+ "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",
3970
+ className
3971
+ ),
3488
3972
  ...props,
3489
3973
  children: [
3490
- /* @__PURE__ */ jsxs10("div", { className: "flex flex-row items-center gap-1", children: [
3491
- /* @__PURE__ */ jsx12(
3974
+ /* @__PURE__ */ jsxs11("div", { className: "flex flex-row items-center gap-1", children: [
3975
+ /* @__PURE__ */ jsx13(
3492
3976
  IconButton_default,
3493
3977
  {
3494
- icon: /* @__PURE__ */ jsx12(SquaresFour, { size: 24, className: "text-text-950" }),
3978
+ icon: /* @__PURE__ */ jsx13(SquaresFour, { size: 24, className: "text-text-950" }),
3495
3979
  size: "md",
3496
3980
  onClick: () => setModalNavigateOpen(true)
3497
3981
  }
3498
3982
  ),
3499
- isFirstQuestion ? /* @__PURE__ */ jsx12(
3983
+ isFirstQuestion ? /* @__PURE__ */ jsx13(
3500
3984
  Button_default,
3501
3985
  {
3502
3986
  variant: "outline",
@@ -3507,13 +3991,13 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3507
3991
  },
3508
3992
  children: "Pular"
3509
3993
  }
3510
- ) : /* @__PURE__ */ jsx12(
3994
+ ) : /* @__PURE__ */ jsx13(
3511
3995
  Button_default,
3512
3996
  {
3513
3997
  size: "medium",
3514
3998
  variant: "link",
3515
3999
  action: "primary",
3516
- iconLeft: /* @__PURE__ */ jsx12(CaretLeft, { size: 18 }),
4000
+ iconLeft: /* @__PURE__ */ jsx13(CaretLeft, { size: 18 }),
3517
4001
  onClick: () => {
3518
4002
  goToPreviousQuestion();
3519
4003
  },
@@ -3521,7 +4005,7 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3521
4005
  }
3522
4006
  )
3523
4007
  ] }),
3524
- !isFirstQuestion && /* @__PURE__ */ jsx12(
4008
+ !isFirstQuestion && /* @__PURE__ */ jsx13(
3525
4009
  Button_default,
3526
4010
  {
3527
4011
  size: "small",
@@ -3534,7 +4018,7 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3534
4018
  children: "Pular"
3535
4019
  }
3536
4020
  ),
3537
- isLastQuestion ? /* @__PURE__ */ jsx12(
4021
+ isLastQuestion ? /* @__PURE__ */ jsx13(
3538
4022
  Button_default,
3539
4023
  {
3540
4024
  size: "medium",
@@ -3550,13 +4034,13 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3550
4034
  },
3551
4035
  children: "Finalizar"
3552
4036
  }
3553
- ) : /* @__PURE__ */ jsx12(
4037
+ ) : /* @__PURE__ */ jsx13(
3554
4038
  Button_default,
3555
4039
  {
3556
4040
  size: "medium",
3557
4041
  variant: "link",
3558
4042
  action: "primary",
3559
- iconRight: /* @__PURE__ */ jsx12(CaretRight2, { size: 18 }),
4043
+ iconRight: /* @__PURE__ */ jsx13(CaretRight2, { size: 18 }),
3560
4044
  disabled: !currentAnswer && !isCurrentQuestionSkipped,
3561
4045
  onClick: () => {
3562
4046
  goToNextQuestion();
@@ -3567,7 +4051,7 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3567
4051
  ]
3568
4052
  }
3569
4053
  ),
3570
- /* @__PURE__ */ jsx12(
4054
+ /* @__PURE__ */ jsx13(
3571
4055
  AlertDialog,
3572
4056
  {
3573
4057
  isOpen: alertDialogOpen,
@@ -3581,7 +4065,7 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3581
4065
  }
3582
4066
  }
3583
4067
  ),
3584
- /* @__PURE__ */ jsx12(
4068
+ /* @__PURE__ */ jsx13(
3585
4069
  Modal_default,
3586
4070
  {
3587
4071
  isOpen: modalResultOpen,
@@ -3591,8 +4075,8 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3591
4075
  closeOnEscape: false,
3592
4076
  hideCloseButton: true,
3593
4077
  size: "md",
3594
- children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
3595
- /* @__PURE__ */ jsx12(
4078
+ children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
4079
+ /* @__PURE__ */ jsx13(
3596
4080
  "img",
3597
4081
  {
3598
4082
  src: simulated_result_default,
@@ -3600,9 +4084,9 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3600
4084
  className: "w-[282px] h-auto object-cover"
3601
4085
  }
3602
4086
  ),
3603
- /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-2 text-center", children: [
3604
- /* @__PURE__ */ jsx12("h2", { className: "text-text-950 font-bold text-lg", children: "Voc\xEA concluiu o simulado!" }),
3605
- /* @__PURE__ */ jsxs10("p", { className: "text-text-500 font-sm", children: [
4087
+ /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 text-center", children: [
4088
+ /* @__PURE__ */ jsx13("h2", { className: "text-text-950 font-bold text-lg", children: "Voc\xEA concluiu o simulado!" }),
4089
+ /* @__PURE__ */ jsxs11("p", { className: "text-text-500 font-sm", children: [
3606
4090
  "Voc\xEA acertou",
3607
4091
  " ",
3608
4092
  userAnswers.filter(
@@ -3614,8 +4098,8 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3614
4098
  " quest\xF5es."
3615
4099
  ] })
3616
4100
  ] }),
3617
- /* @__PURE__ */ jsxs10("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
3618
- /* @__PURE__ */ jsx12(
4101
+ /* @__PURE__ */ jsxs11("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
4102
+ /* @__PURE__ */ jsx13(
3619
4103
  Button_default,
3620
4104
  {
3621
4105
  variant: "outline",
@@ -3625,31 +4109,31 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3625
4109
  children: "Ir para simulados"
3626
4110
  }
3627
4111
  ),
3628
- /* @__PURE__ */ jsx12(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
4112
+ /* @__PURE__ */ jsx13(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
3629
4113
  ] })
3630
4114
  ] })
3631
4115
  }
3632
4116
  ),
3633
- /* @__PURE__ */ jsx12(
4117
+ /* @__PURE__ */ jsx13(
3634
4118
  Modal_default,
3635
4119
  {
3636
4120
  isOpen: modalNavigateOpen,
3637
4121
  onClose: () => setModalNavigateOpen(false),
3638
4122
  title: "Quest\xF5es",
3639
4123
  size: "lg",
3640
- children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col w-full h-full", children: [
3641
- /* @__PURE__ */ jsxs10("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200", children: [
3642
- /* @__PURE__ */ jsx12("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
3643
- /* @__PURE__ */ jsx12("span", { className: "max-w-[266px]", children: /* @__PURE__ */ jsxs10(Select_default, { value: filterType, onValueChange: setFilterType, children: [
3644
- /* @__PURE__ */ jsx12(SelectTrigger, { variant: "rounded", className: "max-w-[266px]", children: /* @__PURE__ */ jsx12(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" }) }),
3645
- /* @__PURE__ */ jsxs10(SelectContent, { children: [
3646
- /* @__PURE__ */ jsx12(SelectItem, { value: "all", children: "Todas" }),
3647
- /* @__PURE__ */ jsx12(SelectItem, { value: "unanswered", children: "Em branco" }),
3648
- /* @__PURE__ */ jsx12(SelectItem, { value: "answered", children: "Respondidas" })
4124
+ children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col w-full h-full", children: [
4125
+ /* @__PURE__ */ jsxs11("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200", children: [
4126
+ /* @__PURE__ */ jsx13("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
4127
+ /* @__PURE__ */ jsx13("span", { className: "max-w-[266px]", children: /* @__PURE__ */ jsxs11(Select_default, { value: filterType, onValueChange: setFilterType, children: [
4128
+ /* @__PURE__ */ jsx13(SelectTrigger, { variant: "rounded", className: "max-w-[266px]", children: /* @__PURE__ */ jsx13(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" }) }),
4129
+ /* @__PURE__ */ jsxs11(SelectContent, { children: [
4130
+ /* @__PURE__ */ jsx13(SelectItem, { value: "all", children: "Todas" }),
4131
+ /* @__PURE__ */ jsx13(SelectItem, { value: "unanswered", children: "Em branco" }),
4132
+ /* @__PURE__ */ jsx13(SelectItem, { value: "answered", children: "Respondidas" })
3649
4133
  ] })
3650
4134
  ] }) })
3651
4135
  ] }),
3652
- /* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-2 not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] overflow-y-auto", children: /* @__PURE__ */ jsx12(
4136
+ /* @__PURE__ */ jsx13("div", { className: "flex flex-col gap-2 not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] overflow-y-auto", children: /* @__PURE__ */ jsx13(
3653
4137
  QuizQuestionList,
3654
4138
  {
3655
4139
  filterType,
@@ -3661,13 +4145,236 @@ var QuizFooter = forwardRef7(({ className, onGoToSimulated, onDetailResult, ...p
3661
4145
  )
3662
4146
  ] });
3663
4147
  });
4148
+ var QuizResultHeaderTitle = forwardRef7(({ className, ...props }, ref) => {
4149
+ const { bySimulated } = useQuizStore();
4150
+ return /* @__PURE__ */ jsxs11(
4151
+ "div",
4152
+ {
4153
+ ref,
4154
+ className: cn("flex flex-row pt-4 justify-between", className),
4155
+ ...props,
4156
+ children: [
4157
+ /* @__PURE__ */ jsx13("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
4158
+ bySimulated && /* @__PURE__ */ jsx13(Badge_default, { variant: "solid", action: "info", children: bySimulated.category })
4159
+ ]
4160
+ }
4161
+ );
4162
+ });
4163
+ var QuizResultTitle = forwardRef7(({ className, ...props }, ref) => {
4164
+ const { getQuizTitle } = useQuizStore();
4165
+ const quizTitle = getQuizTitle();
4166
+ return /* @__PURE__ */ jsx13(
4167
+ "p",
4168
+ {
4169
+ className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
4170
+ ref,
4171
+ ...props,
4172
+ children: quizTitle
4173
+ }
4174
+ );
4175
+ });
4176
+ var QuizResultPerformance = forwardRef7(
4177
+ ({ ...props }, ref) => {
4178
+ const {
4179
+ getTotalQuestions,
4180
+ timeElapsed,
4181
+ formatTime,
4182
+ bySimulated,
4183
+ byActivity,
4184
+ byQuestionary
4185
+ } = useQuizStore();
4186
+ const totalQuestions = getTotalQuestions();
4187
+ const quiz = bySimulated || byActivity || byQuestionary;
4188
+ let correctAnswers = 0;
4189
+ let correctEasyAnswers = 0;
4190
+ let correctMediumAnswers = 0;
4191
+ let correctDifficultAnswers = 0;
4192
+ let totalEasyQuestions = 0;
4193
+ let totalMediumQuestions = 0;
4194
+ let totalDifficultQuestions = 0;
4195
+ if (quiz) {
4196
+ quiz.questions.forEach((question) => {
4197
+ const userAnswer = question.answerKey;
4198
+ const isCorrect = userAnswer && userAnswer === question.correctOptionId;
4199
+ if (isCorrect) {
4200
+ correctAnswers++;
4201
+ }
4202
+ if (question.difficulty === "FACIL" /* FACIL */) {
4203
+ totalEasyQuestions++;
4204
+ if (isCorrect) {
4205
+ correctEasyAnswers++;
4206
+ }
4207
+ } else if (question.difficulty === "MEDIO" /* MEDIO */) {
4208
+ totalMediumQuestions++;
4209
+ if (isCorrect) {
4210
+ correctMediumAnswers++;
4211
+ }
4212
+ } else if (question.difficulty === "DIFICIL" /* DIFICIL */) {
4213
+ totalDifficultQuestions++;
4214
+ if (isCorrect) {
4215
+ correctDifficultAnswers++;
4216
+ }
4217
+ }
4218
+ });
4219
+ }
4220
+ const percentage = totalQuestions > 0 ? Math.round(correctAnswers / totalQuestions * 100) : 0;
4221
+ return /* @__PURE__ */ jsxs11(
4222
+ "div",
4223
+ {
4224
+ className: "flex flex-row gap-6 p-6 rounded-xl bg-background justify-between",
4225
+ ref,
4226
+ ...props,
4227
+ children: [
4228
+ /* @__PURE__ */ jsxs11("div", { className: "relative", children: [
4229
+ /* @__PURE__ */ jsx13(
4230
+ ProgressCircle_default,
4231
+ {
4232
+ size: "medium",
4233
+ variant: "green",
4234
+ value: percentage,
4235
+ showPercentage: false,
4236
+ label: ""
4237
+ }
4238
+ ),
4239
+ /* @__PURE__ */ jsxs11("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
4240
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1 mb-1", children: [
4241
+ /* @__PURE__ */ jsx13(Clock2, { size: 12, weight: "regular", className: "text-text-800" }),
4242
+ /* @__PURE__ */ jsx13("span", { className: "text-2xs font-medium text-text-800", children: formatTime(timeElapsed) })
4243
+ ] }),
4244
+ /* @__PURE__ */ jsxs11("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
4245
+ correctAnswers,
4246
+ " de ",
4247
+ totalQuestions
4248
+ ] }),
4249
+ /* @__PURE__ */ jsx13("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
4250
+ ] })
4251
+ ] }),
4252
+ /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-4 w-full", children: [
4253
+ /* @__PURE__ */ jsx13(
4254
+ ProgressBar_default,
4255
+ {
4256
+ className: "w-full",
4257
+ layout: "stacked",
4258
+ variant: "green",
4259
+ value: correctEasyAnswers,
4260
+ max: totalEasyQuestions,
4261
+ label: "F\xE1ceis",
4262
+ showHitCount: true,
4263
+ labelClassName: "text-base font-medium text-text-800 leading-none",
4264
+ percentageClassName: "text-xs font-medium leading-[14px] text-right"
4265
+ }
4266
+ ),
4267
+ /* @__PURE__ */ jsx13(
4268
+ ProgressBar_default,
4269
+ {
4270
+ className: "w-full",
4271
+ layout: "stacked",
4272
+ variant: "green",
4273
+ value: correctMediumAnswers,
4274
+ max: totalMediumQuestions,
4275
+ label: "M\xE9dias",
4276
+ showHitCount: true,
4277
+ labelClassName: "text-base font-medium text-text-800 leading-none",
4278
+ percentageClassName: "text-xs font-medium leading-[14px] text-right"
4279
+ }
4280
+ ),
4281
+ /* @__PURE__ */ jsx13(
4282
+ ProgressBar_default,
4283
+ {
4284
+ className: "w-full",
4285
+ layout: "stacked",
4286
+ variant: "green",
4287
+ value: correctDifficultAnswers,
4288
+ max: totalDifficultQuestions,
4289
+ label: "Dif\xEDceis",
4290
+ showHitCount: true,
4291
+ labelClassName: "text-base font-medium text-text-800 leading-none",
4292
+ percentageClassName: "text-xs font-medium leading-[14px] text-right"
4293
+ }
4294
+ )
4295
+ ] })
4296
+ ]
4297
+ }
4298
+ );
4299
+ }
4300
+ );
4301
+ var QuizListResult = forwardRef7(({ className, onSubjectClick, ...props }, ref) => {
4302
+ const { getQuestionsGroupedBySubject, isQuestionAnswered } = useQuizStore();
4303
+ const groupedQuestions = getQuestionsGroupedBySubject();
4304
+ const subjectsStats = Object.entries(groupedQuestions).map(
4305
+ ([subjectId, questions]) => {
4306
+ let correct = 0;
4307
+ let incorrect = 0;
4308
+ questions.forEach((question) => {
4309
+ if (isQuestionAnswered(question.id)) {
4310
+ const userAnswer = question.answerKey;
4311
+ if (userAnswer === question.correctOptionId) {
4312
+ correct++;
4313
+ } else {
4314
+ incorrect++;
4315
+ }
4316
+ }
4317
+ });
4318
+ return {
4319
+ subject: subjectId,
4320
+ correct,
4321
+ incorrect,
4322
+ total: questions.length
4323
+ };
4324
+ }
4325
+ );
4326
+ return /* @__PURE__ */ jsxs11("section", { ref, className, ...props, children: [
4327
+ /* @__PURE__ */ jsx13("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
4328
+ /* @__PURE__ */ jsx13("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13(
4329
+ CardResults,
4330
+ {
4331
+ onClick: () => onSubjectClick?.(subject.subject),
4332
+ className: "max-w-full",
4333
+ header: subject.subject,
4334
+ correct_answers: subject.correct,
4335
+ incorrect_answers: subject.incorrect,
4336
+ icon: /* @__PURE__ */ jsx13(Book, { size: 20 }),
4337
+ direction: "row"
4338
+ }
4339
+ ) }, subject.subject)) })
4340
+ ] });
4341
+ });
4342
+ var QuizListResultByMateria = ({
4343
+ subject,
4344
+ onQuestionClick
4345
+ }) => {
4346
+ const { getQuestionsGroupedBySubject } = useQuizStore();
4347
+ const groupedQuestions = getQuestionsGroupedBySubject();
4348
+ const answeredQuestions = groupedQuestions[subject] || [];
4349
+ return /* @__PURE__ */ jsxs11("div", { className: "w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6", children: [
4350
+ /* @__PURE__ */ jsx13("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ jsx13("p", { className: "text-text-950 font-bold text-2xl", children: subject }) }),
4351
+ /* @__PURE__ */ jsxs11("section", { className: "flex flex-col ", children: [
4352
+ /* @__PURE__ */ jsx13("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
4353
+ /* @__PURE__ */ jsx13("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13(
4354
+ CardStatus,
4355
+ {
4356
+ className: "max-w-full",
4357
+ header: `Quest\xE3o ${question.id}`,
4358
+ status: question.answerKey === question.correctOptionId ? "correct" : "incorrect",
4359
+ onClick: () => onQuestionClick?.(question)
4360
+ }
4361
+ ) }, question.id)) })
4362
+ ] })
4363
+ ] });
4364
+ };
3664
4365
  export {
3665
4366
  Quiz,
3666
4367
  QuizAlternative,
3667
4368
  QuizContent,
3668
4369
  QuizFooter,
3669
4370
  QuizHeader,
4371
+ QuizHeaderResult,
4372
+ QuizListResult,
4373
+ QuizListResultByMateria,
3670
4374
  QuizQuestionList,
4375
+ QuizResultHeaderTitle,
4376
+ QuizResultPerformance,
4377
+ QuizResultTitle,
3671
4378
  QuizTitle
3672
4379
  };
3673
4380
  //# sourceMappingURL=index.mjs.map