analytica-frontend-lib 1.2.38 → 1.2.44

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