analytica-frontend-lib 1.2.84 → 1.2.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -26061,7 +26061,7 @@ var SendLessonModal = ({
26061
26061
  var SendLessonModal_default = SendLessonModal;
26062
26062
 
26063
26063
  // src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
26064
- import { useState as useState49, useCallback as useCallback28, useMemo as useMemo28, useRef as useRef32, useEffect as useEffect51 } from "react";
26064
+ import { useState as useState50, useCallback as useCallback29, useMemo as useMemo28, useRef as useRef32, useEffect as useEffect51 } from "react";
26065
26065
  import { Plus as Plus5, CaretRight as CaretRight10, Trash as Trash4, PencilSimple as PencilSimple4 } from "phosphor-react";
26066
26066
 
26067
26067
  // src/types/recommendedLessons.ts
@@ -26667,8 +26667,161 @@ var GoalModelsTab = ({
26667
26667
  }
26668
26668
  );
26669
26669
 
26670
+ // src/components/RecommendedLessonsHistory/config/draftsFiltersConfig.ts
26671
+ var getSubjectOptions2 = (data) => {
26672
+ if (!data?.subjects) return [];
26673
+ return data.subjects.map((subject) => ({
26674
+ id: subject.id,
26675
+ name: subject.name
26676
+ }));
26677
+ };
26678
+ var createGoalDraftsFiltersConfig = (userData) => [
26679
+ {
26680
+ key: "content",
26681
+ label: "CONTE\xDADO",
26682
+ categories: [
26683
+ {
26684
+ key: "subject",
26685
+ label: "Mat\xE9ria",
26686
+ selectedIds: [],
26687
+ itens: getSubjectOptions2(userData)
26688
+ }
26689
+ ]
26690
+ }
26691
+ ];
26692
+
26693
+ // src/hooks/useGoalDrafts.ts
26694
+ import { useState as useState49, useCallback as useCallback28 } from "react";
26695
+ var DEFAULT_GOAL_DRAFTS_PAGINATION = {
26696
+ total: 0,
26697
+ page: 1,
26698
+ limit: 10,
26699
+ totalPages: 0
26700
+ };
26701
+ var handleGoalDraftFetchError = createFetchErrorHandler(
26702
+ "Erro ao validar dados de rascunhos de aulas",
26703
+ "Erro ao carregar rascunhos de aulas"
26704
+ );
26705
+ var createUseGoalDrafts = (fetchGoalDrafts, deleteGoalDraft) => {
26706
+ return () => {
26707
+ const [state, setState] = useState49({
26708
+ models: [],
26709
+ loading: false,
26710
+ error: null,
26711
+ pagination: DEFAULT_GOAL_DRAFTS_PAGINATION
26712
+ });
26713
+ const fetchModels = useCallback28(
26714
+ async (filters, subjectsMap) => {
26715
+ setState((prev) => ({ ...prev, loading: true, error: null }));
26716
+ try {
26717
+ const responseData = await fetchGoalDrafts(filters);
26718
+ const validatedData = goalModelsApiResponseSchema.parse(responseData);
26719
+ const tableItems = validatedData.data.drafts.map(
26720
+ (draft) => transformGoalModelToTableItem(draft, subjectsMap)
26721
+ );
26722
+ const limit = filters?.limit || 10;
26723
+ const page = filters?.page || 1;
26724
+ const total = validatedData.data.total;
26725
+ const totalPages = Math.ceil(total / limit);
26726
+ setState({
26727
+ models: tableItems,
26728
+ loading: false,
26729
+ error: null,
26730
+ pagination: {
26731
+ total,
26732
+ page,
26733
+ limit,
26734
+ totalPages
26735
+ }
26736
+ });
26737
+ } catch (error) {
26738
+ const errorMessage = handleGoalDraftFetchError(error);
26739
+ setState((prev) => ({
26740
+ ...prev,
26741
+ loading: false,
26742
+ error: errorMessage
26743
+ }));
26744
+ }
26745
+ },
26746
+ [fetchGoalDrafts]
26747
+ );
26748
+ const deleteModel = useCallback28(
26749
+ async (id) => {
26750
+ try {
26751
+ await deleteGoalDraft(id);
26752
+ return true;
26753
+ } catch (error) {
26754
+ console.error("Erro ao deletar rascunho:", error);
26755
+ return false;
26756
+ }
26757
+ },
26758
+ [deleteGoalDraft]
26759
+ );
26760
+ return {
26761
+ ...state,
26762
+ fetchModels,
26763
+ deleteModel
26764
+ };
26765
+ };
26766
+ };
26767
+ var createGoalDraftsHook = createUseGoalDrafts;
26768
+
26769
+ // src/components/RecommendedLessonsHistory/tabs/DraftsTab.tsx
26770
+ import { jsx as jsx119 } from "react/jsx-runtime";
26771
+ var GOAL_DRAFTS_CONFIG = {
26772
+ entityName: "rascunho",
26773
+ entityNamePlural: "rascunhos",
26774
+ testId: "goal-drafts-tab",
26775
+ emptyStateTitle: "Voc\xEA n\xE3o tem aulas recomendadas em rascunho",
26776
+ emptyStateDescription: "As aulas recomendadas que voc\xEA come\xE7ar a criar, aparecer\xE3o aqui automaticamente como rascunhos. Tudo \xE9 salvo enquanto voc\xEA cria, continue de onde parou quando quiser!",
26777
+ searchPlaceholder: "Buscar rascunho"
26778
+ };
26779
+ var GOAL_DRAFTS_COLUMNS_CONFIG = {
26780
+ sendButtonLabel: "Enviar aula",
26781
+ sendButtonAriaLabel: "Enviar rascunho",
26782
+ deleteButtonAriaLabel: "Deletar rascunho",
26783
+ editButtonAriaLabel: "Editar rascunho"
26784
+ };
26785
+ var GoalDraftsTab = ({
26786
+ fetchGoalDrafts,
26787
+ deleteGoalDraft,
26788
+ onCreateDraft,
26789
+ onSendDraft,
26790
+ onEditDraft,
26791
+ emptyStateImage,
26792
+ noSearchImage,
26793
+ mapSubjectNameToEnum: mapSubjectNameToEnum2,
26794
+ userFilterData,
26795
+ subjectsMap
26796
+ }) => /* @__PURE__ */ jsx119(
26797
+ ModelsTabBase,
26798
+ {
26799
+ fetchModels: fetchGoalDrafts,
26800
+ deleteModel: deleteGoalDraft,
26801
+ onCreateModel: onCreateDraft,
26802
+ onSend: onSendDraft,
26803
+ onEditModel: onEditDraft,
26804
+ emptyStateImage,
26805
+ noSearchImage,
26806
+ mapSubjectNameToEnum: mapSubjectNameToEnum2,
26807
+ userFilterData,
26808
+ subjectsMap,
26809
+ config: GOAL_DRAFTS_CONFIG,
26810
+ createTableColumns: (mapSubject, send, edit, del) => createModelsTableColumnsBase(
26811
+ mapSubject,
26812
+ send,
26813
+ edit,
26814
+ del,
26815
+ GOAL_DRAFTS_COLUMNS_CONFIG
26816
+ ),
26817
+ createFiltersConfig: createGoalDraftsFiltersConfig,
26818
+ buildFiltersFromParams: buildGoalModelsFiltersFromParams,
26819
+ createUseModels: createUseGoalDrafts
26820
+ }
26821
+ );
26822
+
26670
26823
  // src/components/RecommendedLessonsHistory/RecommendedLessonsHistory.tsx
26671
- import { Fragment as Fragment26, jsx as jsx119, jsxs as jsxs94 } from "react/jsx-runtime";
26824
+ import { Fragment as Fragment26, jsx as jsx120, jsxs as jsxs94 } from "react/jsx-runtime";
26672
26825
  var GoalPageTab = /* @__PURE__ */ ((GoalPageTab2) => {
26673
26826
  GoalPageTab2["HISTORY"] = "history";
26674
26827
  GoalPageTab2["DRAFTS"] = "drafts";
@@ -26714,7 +26867,7 @@ var getSchoolOptions = (data) => {
26714
26867
  name: school.name
26715
26868
  }));
26716
26869
  };
26717
- var getSubjectOptions2 = (data) => {
26870
+ var getSubjectOptions3 = (data) => {
26718
26871
  if (!data?.subjects) return [];
26719
26872
  return data.subjects.map((subject) => ({
26720
26873
  id: subject.id,
@@ -26780,7 +26933,7 @@ var createGoalFiltersConfig = (userData) => [
26780
26933
  key: "subject",
26781
26934
  label: "Mat\xE9ria",
26782
26935
  selectedIds: [],
26783
- itens: getSubjectOptions2(userData)
26936
+ itens: getSubjectOptions3(userData)
26784
26937
  },
26785
26938
  {
26786
26939
  key: "theme",
@@ -26833,7 +26986,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
26833
26986
  className: "max-w-[200px] truncate",
26834
26987
  render: (value) => {
26835
26988
  const title = typeof value === "string" ? value : "";
26836
- return /* @__PURE__ */ jsx119(Text_default, { size: "sm", title, children: title });
26989
+ return /* @__PURE__ */ jsx120(Text_default, { size: "sm", title, children: title });
26837
26990
  }
26838
26991
  },
26839
26992
  {
@@ -26843,7 +26996,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
26843
26996
  className: "max-w-[150px] truncate",
26844
26997
  render: (value) => {
26845
26998
  const school = typeof value === "string" ? value : "";
26846
- return /* @__PURE__ */ jsx119(Text_default, { size: "sm", title: school, children: school });
26999
+ return /* @__PURE__ */ jsx120(Text_default, { size: "sm", title: school, children: school });
26847
27000
  }
26848
27001
  },
26849
27002
  {
@@ -26860,11 +27013,11 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
26860
27013
  const subjectName = typeof value === "string" ? value : "";
26861
27014
  const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
26862
27015
  if (!subjectEnum) {
26863
- return /* @__PURE__ */ jsx119(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
27016
+ return /* @__PURE__ */ jsx120(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
26864
27017
  }
26865
27018
  const subjectInfo = getSubjectInfo(subjectEnum);
26866
27019
  return /* @__PURE__ */ jsxs94("div", { className: "flex items-center gap-2", title: subjectName, children: [
26867
- /* @__PURE__ */ jsx119(
27020
+ /* @__PURE__ */ jsx120(
26868
27021
  "span",
26869
27022
  {
26870
27023
  className: cn(
@@ -26874,7 +27027,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
26874
27027
  children: subjectInfo.icon
26875
27028
  }
26876
27029
  ),
26877
- /* @__PURE__ */ jsx119(Text_default, { size: "sm", className: "truncate", children: subjectName })
27030
+ /* @__PURE__ */ jsx120(Text_default, { size: "sm", className: "truncate", children: subjectName })
26878
27031
  ] });
26879
27032
  }
26880
27033
  },
@@ -26890,9 +27043,9 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
26890
27043
  render: (value) => {
26891
27044
  const status = typeof value === "string" ? value : "";
26892
27045
  if (!status) {
26893
- return /* @__PURE__ */ jsx119(Text_default, { size: "sm", color: "text-text-500", children: "-" });
27046
+ return /* @__PURE__ */ jsx120(Text_default, { size: "sm", color: "text-text-500", children: "-" });
26894
27047
  }
26895
- return /* @__PURE__ */ jsx119(
27048
+ return /* @__PURE__ */ jsx120(
26896
27049
  Badge_default,
26897
27050
  {
26898
27051
  variant: "solid",
@@ -26907,7 +27060,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
26907
27060
  key: "completionPercentage",
26908
27061
  label: "Conclus\xE3o",
26909
27062
  sortable: true,
26910
- render: (value) => /* @__PURE__ */ jsx119(
27063
+ render: (value) => /* @__PURE__ */ jsx120(
26911
27064
  ProgressBar_default,
26912
27065
  {
26913
27066
  value: Number(value),
@@ -26934,19 +27087,19 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
26934
27087
  onEditGoal?.(row.id);
26935
27088
  };
26936
27089
  return /* @__PURE__ */ jsxs94("div", { className: "flex justify-center gap-2", children: [
26937
- /* @__PURE__ */ jsx119(
27090
+ /* @__PURE__ */ jsx120(
26938
27091
  IconButton_default,
26939
27092
  {
26940
- icon: /* @__PURE__ */ jsx119(Trash4, { size: 20 }),
27093
+ icon: /* @__PURE__ */ jsx120(Trash4, { size: 20 }),
26941
27094
  size: "sm",
26942
27095
  title: "Excluir",
26943
27096
  onClick: handleDelete
26944
27097
  }
26945
27098
  ),
26946
- /* @__PURE__ */ jsx119(
27099
+ /* @__PURE__ */ jsx120(
26947
27100
  IconButton_default,
26948
27101
  {
26949
- icon: /* @__PURE__ */ jsx119(PencilSimple4, { size: 20 }),
27102
+ icon: /* @__PURE__ */ jsx120(PencilSimple4, { size: 20 }),
26950
27103
  size: "sm",
26951
27104
  title: "Editar",
26952
27105
  onClick: handleEdit
@@ -26960,7 +27113,7 @@ var createTableColumns2 = (mapSubjectNameToEnum2, onDeleteGoal, onEditGoal) => [
26960
27113
  label: "",
26961
27114
  sortable: false,
26962
27115
  className: "w-12",
26963
- render: () => /* @__PURE__ */ jsx119("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx119(CaretRight10, { size: 20, className: "text-text-600" }) })
27116
+ render: () => /* @__PURE__ */ jsx120("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx120(CaretRight10, { size: 20, className: "text-text-600" }) })
26964
27117
  }
26965
27118
  ];
26966
27119
  var RecommendedLessonsHistory = ({
@@ -26982,10 +27135,14 @@ var RecommendedLessonsHistory = ({
26982
27135
  onSendLesson,
26983
27136
  onEditModel,
26984
27137
  subjectsMap,
27138
+ fetchGoalDrafts,
27139
+ deleteGoalDraft,
27140
+ onSendDraft,
27141
+ onEditDraft,
26985
27142
  defaultTab,
26986
27143
  onTabChange
26987
27144
  }) => {
26988
- const [activeTab, setActiveTab] = useState49(
27145
+ const [activeTab, setActiveTab] = useState50(
26989
27146
  defaultTab ?? "history" /* HISTORY */
26990
27147
  );
26991
27148
  useEffect51(() => {
@@ -26993,7 +27150,7 @@ var RecommendedLessonsHistory = ({
26993
27150
  setActiveTab(defaultTab);
26994
27151
  }
26995
27152
  }, [defaultTab]);
26996
- const handleTabChange = useCallback28(
27153
+ const handleTabChange = useCallback29(
26997
27154
  (value) => {
26998
27155
  const newTab = value;
26999
27156
  setActiveTab(newTab);
@@ -27024,7 +27181,7 @@ var RecommendedLessonsHistory = ({
27024
27181
  () => createTableColumns2(mapSubjectNameToEnum2, onDeleteGoal, onEditGoal),
27025
27182
  [mapSubjectNameToEnum2, onDeleteGoal, onEditGoal]
27026
27183
  );
27027
- const handleParamsChange = useCallback28(
27184
+ const handleParamsChange = useCallback29(
27028
27185
  (params) => {
27029
27186
  const filters = buildFiltersFromParams(params);
27030
27187
  fetchGoals(filters);
@@ -27037,10 +27194,10 @@ var RecommendedLessonsHistory = ({
27037
27194
  "data-testid": "recommended-lessons-history",
27038
27195
  className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
27039
27196
  children: [
27040
- /* @__PURE__ */ jsx119("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
27197
+ /* @__PURE__ */ jsx120("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
27041
27198
  /* @__PURE__ */ jsxs94("div", { className: "flex flex-col w-full h-full max-w-[1350px] mx-auto z-10 lg:px-0 px-4 pt-4 sm:pt-0", children: [
27042
27199
  /* @__PURE__ */ jsxs94("div", { className: "flex flex-col sm:flex-row w-full mb-6 items-start sm:items-center sm:justify-between gap-0 sm:gap-4", children: [
27043
- /* @__PURE__ */ jsx119(
27200
+ /* @__PURE__ */ jsx120(
27044
27201
  Text_default,
27045
27202
  {
27046
27203
  as: "h1",
@@ -27049,7 +27206,7 @@ var RecommendedLessonsHistory = ({
27049
27206
  children: title
27050
27207
  }
27051
27208
  ),
27052
- /* @__PURE__ */ jsx119("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx119(
27209
+ /* @__PURE__ */ jsx120("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx120(
27053
27210
  Menu,
27054
27211
  {
27055
27212
  defaultValue: "history" /* HISTORY */,
@@ -27063,7 +27220,7 @@ var RecommendedLessonsHistory = ({
27063
27220
  variant: "menu2",
27064
27221
  className: "w-full lg:w-auto max-w-full min-w-0",
27065
27222
  children: [
27066
- /* @__PURE__ */ jsx119(
27223
+ /* @__PURE__ */ jsx120(
27067
27224
  MenuItem,
27068
27225
  {
27069
27226
  variant: "menu2",
@@ -27073,7 +27230,7 @@ var RecommendedLessonsHistory = ({
27073
27230
  children: "Hist\xF3rico"
27074
27231
  }
27075
27232
  ),
27076
- /* @__PURE__ */ jsx119(
27233
+ /* @__PURE__ */ jsx120(
27077
27234
  MenuItem,
27078
27235
  {
27079
27236
  variant: "menu2",
@@ -27083,7 +27240,7 @@ var RecommendedLessonsHistory = ({
27083
27240
  children: "Rascunhos"
27084
27241
  }
27085
27242
  ),
27086
- /* @__PURE__ */ jsx119(
27243
+ /* @__PURE__ */ jsx120(
27087
27244
  MenuItem,
27088
27245
  {
27089
27246
  variant: "menu2",
@@ -27100,7 +27257,7 @@ var RecommendedLessonsHistory = ({
27100
27257
  ) })
27101
27258
  ] }),
27102
27259
  /* @__PURE__ */ jsxs94("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
27103
- activeTab === "history" /* HISTORY */ && /* @__PURE__ */ jsx119(Fragment26, { children: error ? /* @__PURE__ */ jsx119("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx119(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ jsx119("div", { className: "w-full", children: /* @__PURE__ */ jsx119(
27260
+ activeTab === "history" /* HISTORY */ && /* @__PURE__ */ jsx120(Fragment26, { children: error ? /* @__PURE__ */ jsx120("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx120(Text_default, { size: "lg", color: "text-error-500", children: error }) }) : /* @__PURE__ */ jsx120("div", { className: "w-full", children: /* @__PURE__ */ jsx120(
27104
27261
  TableProvider,
27105
27262
  {
27106
27263
  data: goals,
@@ -27125,14 +27282,14 @@ var RecommendedLessonsHistory = ({
27125
27282
  image: noSearchImage
27126
27283
  },
27127
27284
  emptyState: {
27128
- component: /* @__PURE__ */ jsx119(
27285
+ component: /* @__PURE__ */ jsx120(
27129
27286
  EmptyState_default,
27130
27287
  {
27131
27288
  image: emptyStateImage,
27132
27289
  title: "Crie uma nova aula",
27133
27290
  description: "Selecione um conjunto de aulas organizadas por tema e ajude seus alunos a estudarem de forma estruturada e eficiente!",
27134
27291
  buttonText: createButtonText,
27135
- buttonIcon: /* @__PURE__ */ jsx119(Plus5, { size: 18 }),
27292
+ buttonIcon: /* @__PURE__ */ jsx120(Plus5, { size: 18 }),
27136
27293
  buttonVariant: "outline",
27137
27294
  buttonAction: "primary",
27138
27295
  onButtonClick: onCreateLesson
@@ -27149,14 +27306,14 @@ var RecommendedLessonsHistory = ({
27149
27306
  } = renderProps;
27150
27307
  return /* @__PURE__ */ jsxs94("div", { className: "space-y-4", children: [
27151
27308
  /* @__PURE__ */ jsxs94("div", { className: "flex items-center justify-between gap-4", children: [
27152
- /* @__PURE__ */ jsx119(
27309
+ /* @__PURE__ */ jsx120(
27153
27310
  Button_default,
27154
27311
  {
27155
27312
  variant: "solid",
27156
27313
  action: "primary",
27157
27314
  size: "medium",
27158
27315
  onClick: onCreateLesson,
27159
- iconLeft: /* @__PURE__ */ jsx119(Plus5, { size: 18, weight: "bold" }),
27316
+ iconLeft: /* @__PURE__ */ jsx120(Plus5, { size: 18, weight: "bold" }),
27160
27317
  children: createButtonText
27161
27318
  }
27162
27319
  ),
@@ -27170,8 +27327,22 @@ var RecommendedLessonsHistory = ({
27170
27327
  }
27171
27328
  }
27172
27329
  ) }) }),
27173
- activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ jsx119("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx119(Text_default, { size: "lg", color: "text-text-600", children: "Rascunhos em desenvolvimento" }) }),
27174
- activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ jsx119(
27330
+ activeTab === "drafts" /* DRAFTS */ && fetchGoalDrafts && deleteGoalDraft && onCreateLesson && /* @__PURE__ */ jsx120(
27331
+ GoalDraftsTab,
27332
+ {
27333
+ fetchGoalDrafts,
27334
+ deleteGoalDraft,
27335
+ onCreateDraft: onCreateLesson,
27336
+ onSendDraft,
27337
+ onEditDraft,
27338
+ emptyStateImage,
27339
+ noSearchImage,
27340
+ mapSubjectNameToEnum: mapSubjectNameToEnum2,
27341
+ userFilterData,
27342
+ subjectsMap
27343
+ }
27344
+ ),
27345
+ activeTab === "models" /* MODELS */ && fetchGoalModels && deleteGoalModel && onCreateModel && /* @__PURE__ */ jsx120(
27175
27346
  GoalModelsTab,
27176
27347
  {
27177
27348
  fetchGoalModels,
@@ -27194,19 +27365,19 @@ var RecommendedLessonsHistory = ({
27194
27365
  };
27195
27366
 
27196
27367
  // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
27197
- import { useMemo as useMemo30, useState as useState50, useCallback as useCallback30 } from "react";
27368
+ import { useMemo as useMemo30, useState as useState51, useCallback as useCallback31 } from "react";
27198
27369
 
27199
27370
  // src/components/RecommendedLessonDetails/components/Breadcrumb.tsx
27200
27371
  import { CaretRightIcon as CaretRightIcon2 } from "@phosphor-icons/react";
27201
- import { jsx as jsx120, jsxs as jsxs95 } from "react/jsx-runtime";
27202
- var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ jsx120("nav", { className: "flex items-center gap-2 text-sm", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ jsxs95(
27372
+ import { jsx as jsx121, jsxs as jsxs95 } from "react/jsx-runtime";
27373
+ var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ jsx121("nav", { className: "flex items-center gap-2 text-sm", "aria-label": "Breadcrumb", children: items.map((item, index) => /* @__PURE__ */ jsxs95(
27203
27374
  Text_default,
27204
27375
  {
27205
27376
  as: "span",
27206
27377
  className: "flex items-center gap-2",
27207
27378
  children: [
27208
- index > 0 && /* @__PURE__ */ jsx120(CaretRightIcon2, { size: 14, className: "text-text-500" }),
27209
- item.path ? /* @__PURE__ */ jsx120(
27379
+ index > 0 && /* @__PURE__ */ jsx121(CaretRightIcon2, { size: 14, className: "text-text-500" }),
27380
+ item.path ? /* @__PURE__ */ jsx121(
27210
27381
  "button",
27211
27382
  {
27212
27383
  type: "button",
@@ -27214,7 +27385,7 @@ var Breadcrumb = ({ items, onItemClick }) => /* @__PURE__ */ jsx120("nav", { cla
27214
27385
  className: "text-text-600 hover:text-primary-700 transition-colors",
27215
27386
  children: item.label
27216
27387
  }
27217
- ) : /* @__PURE__ */ jsx120(Text_default, { as: "span", className: "text-text-950 font-medium", children: item.label })
27388
+ ) : /* @__PURE__ */ jsx121(Text_default, { as: "span", className: "text-text-950 font-medium", children: item.label })
27218
27389
  ]
27219
27390
  },
27220
27391
  item.path ?? item.label
@@ -27243,7 +27414,7 @@ var transformStudentForDisplay = (student, deadline) => ({
27243
27414
  });
27244
27415
 
27245
27416
  // src/components/RecommendedLessonDetails/components/LessonHeader.tsx
27246
- import { Fragment as Fragment27, jsx as jsx121, jsxs as jsxs96 } from "react/jsx-runtime";
27417
+ import { Fragment as Fragment27, jsx as jsx122, jsxs as jsxs96 } from "react/jsx-runtime";
27247
27418
  var LessonHeader = ({
27248
27419
  data,
27249
27420
  onViewLesson,
@@ -27254,9 +27425,9 @@ var LessonHeader = ({
27254
27425
  const subjectName = goal.lessonsGoals[0]?.supLessonsProgress?.lesson?.subject?.name || "";
27255
27426
  const subjectEnum = mapSubjectNameToEnum2?.(subjectName);
27256
27427
  const subjectInfo = subjectEnum ? getSubjectInfo(subjectEnum) : null;
27257
- return /* @__PURE__ */ jsx121("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs96("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
27428
+ return /* @__PURE__ */ jsx122("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs96("div", { className: "flex flex-col lg:flex-row lg:items-start lg:justify-between gap-4", children: [
27258
27429
  /* @__PURE__ */ jsxs96("div", { className: "flex flex-col gap-2", children: [
27259
- /* @__PURE__ */ jsx121(
27430
+ /* @__PURE__ */ jsx122(
27260
27431
  Text_default,
27261
27432
  {
27262
27433
  as: "h1",
@@ -27271,19 +27442,19 @@ var LessonHeader = ({
27271
27442
  "In\xEDcio em ",
27272
27443
  formatDate(goal.startDate)
27273
27444
  ] }),
27274
- /* @__PURE__ */ jsx121(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
27445
+ /* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
27275
27446
  /* @__PURE__ */ jsxs96(Text_default, { as: "span", size: "sm", className: "text-text-600", children: [
27276
27447
  "Prazo final ",
27277
27448
  formatDate(goal.finalDate)
27278
27449
  ] }),
27279
27450
  breakdown?.schoolName && /* @__PURE__ */ jsxs96(Fragment27, { children: [
27280
- /* @__PURE__ */ jsx121(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
27281
- /* @__PURE__ */ jsx121(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.schoolName })
27451
+ /* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
27452
+ /* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.schoolName })
27282
27453
  ] }),
27283
27454
  subjectName && /* @__PURE__ */ jsxs96(Fragment27, { children: [
27284
- /* @__PURE__ */ jsx121(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
27455
+ /* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
27285
27456
  /* @__PURE__ */ jsxs96(Text_default, { as: "span", size: "sm", className: "flex items-center gap-1", children: [
27286
- subjectInfo && /* @__PURE__ */ jsx121(
27457
+ subjectInfo && /* @__PURE__ */ jsx122(
27287
27458
  Text_default,
27288
27459
  {
27289
27460
  as: "span",
@@ -27298,18 +27469,18 @@ var LessonHeader = ({
27298
27469
  ] })
27299
27470
  ] }),
27300
27471
  breakdown?.className && /* @__PURE__ */ jsxs96(Fragment27, { children: [
27301
- /* @__PURE__ */ jsx121(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
27302
- /* @__PURE__ */ jsx121(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.className })
27472
+ /* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-400", children: "\u2022" }),
27473
+ /* @__PURE__ */ jsx122(Text_default, { as: "span", size: "sm", className: "text-text-600", children: breakdown.className })
27303
27474
  ] })
27304
27475
  ] })
27305
27476
  ] }),
27306
- onViewLesson && /* @__PURE__ */ jsx121(
27477
+ onViewLesson && /* @__PURE__ */ jsx122(
27307
27478
  Button_default,
27308
27479
  {
27309
27480
  variant: "solid",
27310
27481
  action: "primary",
27311
27482
  size: "small",
27312
- iconLeft: /* @__PURE__ */ jsx121(BookBookmarkIcon, { size: 16 }),
27483
+ iconLeft: /* @__PURE__ */ jsx122(BookBookmarkIcon, { size: 16 }),
27313
27484
  onClick: onViewLesson,
27314
27485
  children: viewLessonLabel
27315
27486
  }
@@ -27318,34 +27489,34 @@ var LessonHeader = ({
27318
27489
  };
27319
27490
 
27320
27491
  // src/components/RecommendedLessonDetails/components/LoadingSkeleton.tsx
27321
- import { jsx as jsx122, jsxs as jsxs97 } from "react/jsx-runtime";
27492
+ import { jsx as jsx123, jsxs as jsxs97 } from "react/jsx-runtime";
27322
27493
  var LoadingSkeleton = () => /* @__PURE__ */ jsxs97("div", { className: "flex flex-col gap-6", children: [
27323
- /* @__PURE__ */ jsx122(SkeletonText, { width: 256 }),
27324
- /* @__PURE__ */ jsx122("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs97("div", { className: "flex flex-col gap-3", children: [
27325
- /* @__PURE__ */ jsx122(SkeletonText, { width: "75%", height: 28 }),
27326
- /* @__PURE__ */ jsx122(SkeletonText, { width: "50%" })
27494
+ /* @__PURE__ */ jsx123(SkeletonText, { width: 256 }),
27495
+ /* @__PURE__ */ jsx123("div", { className: "bg-background rounded-xl border border-border-50 p-6", children: /* @__PURE__ */ jsxs97("div", { className: "flex flex-col gap-3", children: [
27496
+ /* @__PURE__ */ jsx123(SkeletonText, { width: "75%", height: 28 }),
27497
+ /* @__PURE__ */ jsx123(SkeletonText, { width: "50%" })
27327
27498
  ] }) }),
27328
27499
  /* @__PURE__ */ jsxs97("div", { className: "flex flex-col gap-4", children: [
27329
- /* @__PURE__ */ jsx122(SkeletonText, { width: 192, height: 20 }),
27500
+ /* @__PURE__ */ jsx123(SkeletonText, { width: 192, height: 20 }),
27330
27501
  /* @__PURE__ */ jsxs97("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
27331
- /* @__PURE__ */ jsx122(SkeletonRounded, { height: 140 }),
27332
- /* @__PURE__ */ jsx122(SkeletonRounded, { height: 140 }),
27333
- /* @__PURE__ */ jsx122(SkeletonRounded, { height: 140 })
27502
+ /* @__PURE__ */ jsx123(SkeletonRounded, { height: 140 }),
27503
+ /* @__PURE__ */ jsx123(SkeletonRounded, { height: 140 }),
27504
+ /* @__PURE__ */ jsx123(SkeletonRounded, { height: 140 })
27334
27505
  ] })
27335
27506
  ] }),
27336
- /* @__PURE__ */ jsx122("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ jsx122(SkeletonTable, { rows: 4, columns: 5 }) })
27507
+ /* @__PURE__ */ jsx123("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ jsx123(SkeletonTable, { rows: 4, columns: 5 }) })
27337
27508
  ] });
27338
27509
 
27339
27510
  // src/components/RecommendedLessonDetails/components/ResultsSection.tsx
27340
27511
  import { TrophyIcon, WarningIcon } from "@phosphor-icons/react";
27341
- import { jsx as jsx123, jsxs as jsxs98 } from "react/jsx-runtime";
27512
+ import { jsx as jsx124, jsxs as jsxs98 } from "react/jsx-runtime";
27342
27513
  var ResultsSection = ({ data, labels }) => {
27343
27514
  const { details } = data;
27344
27515
  const { aggregated, contentPerformance } = details;
27345
27516
  return /* @__PURE__ */ jsxs98("div", { className: "flex flex-col gap-4", children: [
27346
- /* @__PURE__ */ jsx123(Text_default, { as: "h2", size: "md", weight: "semibold", className: "text-text-950", children: labels.resultsTitle }),
27347
- /* @__PURE__ */ jsx123("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ jsxs98("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
27348
- /* @__PURE__ */ jsx123("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-primary-50", children: /* @__PURE__ */ jsx123(
27517
+ /* @__PURE__ */ jsx124(Text_default, { as: "h2", size: "md", weight: "semibold", className: "text-text-950", children: labels.resultsTitle }),
27518
+ /* @__PURE__ */ jsx124("div", { className: "bg-background rounded-xl border border-border-50 p-4", children: /* @__PURE__ */ jsxs98("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
27519
+ /* @__PURE__ */ jsx124("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-primary-50", children: /* @__PURE__ */ jsx124(
27349
27520
  ProgressCircle_default,
27350
27521
  {
27351
27522
  value: aggregated.completionPercentage,
@@ -27356,15 +27527,15 @@ var ResultsSection = ({ data, labels }) => {
27356
27527
  }
27357
27528
  ) }),
27358
27529
  /* @__PURE__ */ jsxs98("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-success-200", children: [
27359
- /* @__PURE__ */ jsx123(
27530
+ /* @__PURE__ */ jsx124(
27360
27531
  Text_default,
27361
27532
  {
27362
27533
  as: "span",
27363
27534
  className: "size-8 rounded-full flex items-center justify-center bg-warning-300 mb-2",
27364
- children: /* @__PURE__ */ jsx123(TrophyIcon, { size: 18, weight: "fill", className: "text-white" })
27535
+ children: /* @__PURE__ */ jsx124(TrophyIcon, { size: 18, weight: "fill", className: "text-white" })
27365
27536
  }
27366
27537
  ),
27367
- /* @__PURE__ */ jsx123(
27538
+ /* @__PURE__ */ jsx124(
27368
27539
  Text_default,
27369
27540
  {
27370
27541
  size: "2xs",
@@ -27373,7 +27544,7 @@ var ResultsSection = ({ data, labels }) => {
27373
27544
  children: labels.bestResultLabel
27374
27545
  }
27375
27546
  ),
27376
- /* @__PURE__ */ jsx123(
27547
+ /* @__PURE__ */ jsx124(
27377
27548
  Text_default,
27378
27549
  {
27379
27550
  size: "xl",
@@ -27384,15 +27555,15 @@ var ResultsSection = ({ data, labels }) => {
27384
27555
  )
27385
27556
  ] }),
27386
27557
  /* @__PURE__ */ jsxs98("div", { className: "flex flex-col items-center justify-center rounded-xl p-4 min-h-28 bg-error-100", children: [
27387
- /* @__PURE__ */ jsx123(
27558
+ /* @__PURE__ */ jsx124(
27388
27559
  Text_default,
27389
27560
  {
27390
27561
  as: "span",
27391
27562
  className: "size-8 rounded-full flex items-center justify-center bg-error-300 mb-2",
27392
- children: /* @__PURE__ */ jsx123(WarningIcon, { size: 18, weight: "fill", className: "text-error-700" })
27563
+ children: /* @__PURE__ */ jsx124(WarningIcon, { size: 18, weight: "fill", className: "text-error-700" })
27393
27564
  }
27394
27565
  ),
27395
- /* @__PURE__ */ jsx123(
27566
+ /* @__PURE__ */ jsx124(
27396
27567
  Text_default,
27397
27568
  {
27398
27569
  size: "2xs",
@@ -27401,7 +27572,7 @@ var ResultsSection = ({ data, labels }) => {
27401
27572
  children: labels.hardestTopicLabel
27402
27573
  }
27403
27574
  ),
27404
- /* @__PURE__ */ jsx123(
27575
+ /* @__PURE__ */ jsx124(
27405
27576
  Text_default,
27406
27577
  {
27407
27578
  size: "xl",
@@ -27416,9 +27587,9 @@ var ResultsSection = ({ data, labels }) => {
27416
27587
  };
27417
27588
 
27418
27589
  // src/components/RecommendedLessonDetails/components/StudentsTable.tsx
27419
- import { useCallback as useCallback29 } from "react";
27590
+ import { useCallback as useCallback30 } from "react";
27420
27591
  import { UserIcon } from "@phosphor-icons/react";
27421
- import { jsx as jsx124, jsxs as jsxs99 } from "react/jsx-runtime";
27592
+ import { jsx as jsx125, jsxs as jsxs99 } from "react/jsx-runtime";
27422
27593
  var StudentsTable = ({
27423
27594
  students,
27424
27595
  onViewPerformance,
@@ -27426,12 +27597,12 @@ var StudentsTable = ({
27426
27597
  emptyMessage = "Nenhum aluno encontrado"
27427
27598
  }) => {
27428
27599
  const { sortedData, sortColumn, sortDirection, handleSort } = useTableSort(students);
27429
- const canViewPerformance = useCallback29((student) => {
27600
+ const canViewPerformance = useCallback30((student) => {
27430
27601
  return student.status === "CONCLU\xCDDO" /* CONCLUIDO */ || student.status === "N\xC3O FINALIZADO" /* NAO_FINALIZADO */;
27431
27602
  }, []);
27432
- return /* @__PURE__ */ jsx124("div", { className: "bg-background rounded-xl border border-border-50 overflow-hidden", children: /* @__PURE__ */ jsxs99(Table_default, { children: [
27433
- /* @__PURE__ */ jsx124(TableHeader, { children: /* @__PURE__ */ jsxs99(TableRow, { children: [
27434
- /* @__PURE__ */ jsx124(
27603
+ return /* @__PURE__ */ jsx125("div", { className: "bg-background rounded-xl border border-border-50 overflow-hidden", children: /* @__PURE__ */ jsxs99(Table_default, { children: [
27604
+ /* @__PURE__ */ jsx125(TableHeader, { children: /* @__PURE__ */ jsxs99(TableRow, { children: [
27605
+ /* @__PURE__ */ jsx125(
27435
27606
  TableHead,
27436
27607
  {
27437
27608
  sortable: true,
@@ -27440,7 +27611,7 @@ var StudentsTable = ({
27440
27611
  children: labels.studentColumn
27441
27612
  }
27442
27613
  ),
27443
- /* @__PURE__ */ jsx124(
27614
+ /* @__PURE__ */ jsx125(
27444
27615
  TableHead,
27445
27616
  {
27446
27617
  sortable: true,
@@ -27449,7 +27620,7 @@ var StudentsTable = ({
27449
27620
  children: labels.statusColumn
27450
27621
  }
27451
27622
  ),
27452
- /* @__PURE__ */ jsx124(
27623
+ /* @__PURE__ */ jsx125(
27453
27624
  TableHead,
27454
27625
  {
27455
27626
  sortable: true,
@@ -27458,22 +27629,22 @@ var StudentsTable = ({
27458
27629
  children: labels.completionColumn
27459
27630
  }
27460
27631
  ),
27461
- /* @__PURE__ */ jsx124(TableHead, { children: labels.durationColumn }),
27462
- /* @__PURE__ */ jsx124(TableHead, { className: "w-[140px]" })
27632
+ /* @__PURE__ */ jsx125(TableHead, { children: labels.durationColumn }),
27633
+ /* @__PURE__ */ jsx125(TableHead, { className: "w-[140px]" })
27463
27634
  ] }) }),
27464
- /* @__PURE__ */ jsx124(TableBody, { children: sortedData.length === 0 ? /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsx124(TableCell, { colSpan: 5, className: "text-center py-8", children: /* @__PURE__ */ jsx124(Text_default, { size: "sm", className: "text-text-500", children: emptyMessage }) }) }) : sortedData.map((student) => /* @__PURE__ */ jsxs99(TableRow, { children: [
27465
- /* @__PURE__ */ jsx124(TableCell, { children: /* @__PURE__ */ jsxs99("div", { className: "flex items-center gap-2", children: [
27466
- /* @__PURE__ */ jsx124(
27635
+ /* @__PURE__ */ jsx125(TableBody, { children: sortedData.length === 0 ? /* @__PURE__ */ jsx125(TableRow, { children: /* @__PURE__ */ jsx125(TableCell, { colSpan: 5, className: "text-center py-8", children: /* @__PURE__ */ jsx125(Text_default, { size: "sm", className: "text-text-500", children: emptyMessage }) }) }) : sortedData.map((student) => /* @__PURE__ */ jsxs99(TableRow, { children: [
27636
+ /* @__PURE__ */ jsx125(TableCell, { children: /* @__PURE__ */ jsxs99("div", { className: "flex items-center gap-2", children: [
27637
+ /* @__PURE__ */ jsx125(
27467
27638
  Text_default,
27468
27639
  {
27469
27640
  as: "span",
27470
27641
  className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
27471
- children: /* @__PURE__ */ jsx124(UserIcon, { size: 16, className: "text-text-500" })
27642
+ children: /* @__PURE__ */ jsx125(UserIcon, { size: 16, className: "text-text-500" })
27472
27643
  }
27473
27644
  ),
27474
- /* @__PURE__ */ jsx124(Text_default, { size: "sm", className: "text-text-950", children: student.name })
27645
+ /* @__PURE__ */ jsx125(Text_default, { size: "sm", className: "text-text-950", children: student.name })
27475
27646
  ] }) }),
27476
- /* @__PURE__ */ jsx124(TableCell, { children: /* @__PURE__ */ jsx124(
27647
+ /* @__PURE__ */ jsx125(TableCell, { children: /* @__PURE__ */ jsx125(
27477
27648
  Badge_default,
27478
27649
  {
27479
27650
  variant: "solid",
@@ -27482,12 +27653,12 @@ var StudentsTable = ({
27482
27653
  children: student.status
27483
27654
  }
27484
27655
  ) }),
27485
- /* @__PURE__ */ jsx124(TableCell, { children: /* @__PURE__ */ jsxs99("div", { className: "flex flex-col gap-1 min-w-[120px]", children: [
27656
+ /* @__PURE__ */ jsx125(TableCell, { children: /* @__PURE__ */ jsxs99("div", { className: "flex flex-col gap-1 min-w-[120px]", children: [
27486
27657
  /* @__PURE__ */ jsxs99(Text_default, { size: "sm", className: "text-primary-700 font-medium", children: [
27487
27658
  student.completionPercentage,
27488
27659
  "%"
27489
27660
  ] }),
27490
- /* @__PURE__ */ jsx124(
27661
+ /* @__PURE__ */ jsx125(
27491
27662
  ProgressBar_default,
27492
27663
  {
27493
27664
  value: student.completionPercentage,
@@ -27497,8 +27668,8 @@ var StudentsTable = ({
27497
27668
  }
27498
27669
  )
27499
27670
  ] }) }),
27500
- /* @__PURE__ */ jsx124(TableCell, { children: /* @__PURE__ */ jsx124(Text_default, { size: "sm", className: "text-text-700", children: student.duration ?? "-" }) }),
27501
- /* @__PURE__ */ jsx124(TableCell, { children: canViewPerformance(student) ? /* @__PURE__ */ jsx124(
27671
+ /* @__PURE__ */ jsx125(TableCell, { children: /* @__PURE__ */ jsx125(Text_default, { size: "sm", className: "text-text-700", children: student.duration ?? "-" }) }),
27672
+ /* @__PURE__ */ jsx125(TableCell, { children: canViewPerformance(student) ? /* @__PURE__ */ jsx125(
27502
27673
  Button_default,
27503
27674
  {
27504
27675
  variant: "outline",
@@ -27506,7 +27677,7 @@ var StudentsTable = ({
27506
27677
  onClick: () => onViewPerformance?.(student.id),
27507
27678
  children: labels.viewPerformance
27508
27679
  }
27509
- ) : /* @__PURE__ */ jsx124(Button_default, { variant: "outline", size: "extra-small", disabled: true, children: labels.viewPerformance }) })
27680
+ ) : /* @__PURE__ */ jsx125(Button_default, { variant: "outline", size: "extra-small", disabled: true, children: labels.viewPerformance }) })
27510
27681
  ] }, student.id)) })
27511
27682
  ] }) });
27512
27683
  };
@@ -27544,7 +27715,7 @@ var DEFAULT_PERFORMANCE_LABELS = {
27544
27715
  };
27545
27716
 
27546
27717
  // src/components/RecommendedLessonDetails/components/StudentPerformanceModal.tsx
27547
- import { jsx as jsx125, jsxs as jsxs100 } from "react/jsx-runtime";
27718
+ import { jsx as jsx126, jsxs as jsxs100 } from "react/jsx-runtime";
27548
27719
  var PerformanceCard = ({
27549
27720
  icon,
27550
27721
  label,
@@ -27575,7 +27746,7 @@ var PerformanceCard = ({
27575
27746
  {
27576
27747
  className: `flex flex-col items-center justify-center p-4 gap-1 ${headerBgColor}`,
27577
27748
  children: [
27578
- /* @__PURE__ */ jsx125(
27749
+ /* @__PURE__ */ jsx126(
27579
27750
  Text_default,
27580
27751
  {
27581
27752
  as: "span",
@@ -27583,7 +27754,7 @@ var PerformanceCard = ({
27583
27754
  children: icon
27584
27755
  }
27585
27756
  ),
27586
- /* @__PURE__ */ jsx125(
27757
+ /* @__PURE__ */ jsx126(
27587
27758
  Text_default,
27588
27759
  {
27589
27760
  size: "2xs",
@@ -27592,12 +27763,12 @@ var PerformanceCard = ({
27592
27763
  children: label
27593
27764
  }
27594
27765
  ),
27595
- /* @__PURE__ */ jsx125(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
27766
+ /* @__PURE__ */ jsx126(Text_default, { size: "xl", weight: "bold", className: `${valueColor} text-center`, children: value })
27596
27767
  ]
27597
27768
  }
27598
27769
  ),
27599
27770
  /* @__PURE__ */ jsxs100("div", { className: "flex flex-col items-center gap-2 px-4 py-3", children: [
27600
- /* @__PURE__ */ jsx125(
27771
+ /* @__PURE__ */ jsx126(
27601
27772
  Text_default,
27602
27773
  {
27603
27774
  size: "2xs",
@@ -27606,7 +27777,7 @@ var PerformanceCard = ({
27606
27777
  children: secondaryLabel
27607
27778
  }
27608
27779
  ),
27609
- /* @__PURE__ */ jsx125(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
27780
+ /* @__PURE__ */ jsx126(Badge_default, { size: "large", action: "info", children: secondaryValue || "-" })
27610
27781
  ] })
27611
27782
  ] });
27612
27783
  };
@@ -27633,7 +27804,7 @@ var getSelectedValue = (question) => {
27633
27804
  var QuestionAccordionItem = ({
27634
27805
  question,
27635
27806
  index
27636
- }) => /* @__PURE__ */ jsx125(
27807
+ }) => /* @__PURE__ */ jsx126(
27637
27808
  CardAccordation,
27638
27809
  {
27639
27810
  value: question.id,
@@ -27645,28 +27816,28 @@ var QuestionAccordionItem = ({
27645
27816
  "Quest\xE3o ",
27646
27817
  index + 1
27647
27818
  ] }),
27648
- /* @__PURE__ */ jsx125(
27819
+ /* @__PURE__ */ jsx126(
27649
27820
  Badge_default,
27650
27821
  {
27651
27822
  size: "small",
27652
27823
  action: question.isCorrect ? "success" : "error",
27653
27824
  variant: "solid",
27654
- iconLeft: question.isCorrect ? /* @__PURE__ */ jsx125(CheckCircleIcon, {}) : /* @__PURE__ */ jsx125(XCircleIcon, {}),
27825
+ iconLeft: question.isCorrect ? /* @__PURE__ */ jsx126(CheckCircleIcon, {}) : /* @__PURE__ */ jsx126(XCircleIcon, {}),
27655
27826
  children: question.isCorrect ? "Correta" : "Incorreta"
27656
27827
  }
27657
27828
  )
27658
27829
  ] }),
27659
27830
  children: /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-3", children: [
27660
- /* @__PURE__ */ jsx125(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
27661
- /* @__PURE__ */ jsx125(
27831
+ /* @__PURE__ */ jsx126(Text_default, { size: "sm", className: "text-text-700", children: question.statement }),
27832
+ /* @__PURE__ */ jsx126(
27662
27833
  CardAccordation,
27663
27834
  {
27664
27835
  value: `${question.id}-alternatives`,
27665
27836
  className: "bg-background rounded-lg border border-border-50",
27666
27837
  triggerClassName: "py-5 px-5",
27667
27838
  contentClassName: "px-5 py-5",
27668
- trigger: /* @__PURE__ */ jsx125(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
27669
- children: /* @__PURE__ */ jsx125(
27839
+ trigger: /* @__PURE__ */ jsx126(Text_default, { size: "sm", weight: "medium", className: "text-text-800", children: "Alternativas" }),
27840
+ children: /* @__PURE__ */ jsx126(
27670
27841
  AlternativesList,
27671
27842
  {
27672
27843
  mode: "readonly",
@@ -27680,7 +27851,7 @@ var QuestionAccordionItem = ({
27680
27851
  ] })
27681
27852
  }
27682
27853
  );
27683
- var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx125(
27854
+ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx126(
27684
27855
  CardAccordation,
27685
27856
  {
27686
27857
  value: lesson.id,
@@ -27688,8 +27859,8 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx125(
27688
27859
  triggerClassName: "py-5 px-5",
27689
27860
  contentClassName: "px-5 pb-5",
27690
27861
  trigger: /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-1 flex-1", children: [
27691
- /* @__PURE__ */ jsx125(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
27692
- /* @__PURE__ */ jsx125(
27862
+ /* @__PURE__ */ jsx126(Text_default, { size: "sm", weight: "semibold", className: "text-text-950", children: lesson.title }),
27863
+ /* @__PURE__ */ jsx126(
27693
27864
  ProgressBar_default,
27694
27865
  {
27695
27866
  value: lesson.progress,
@@ -27700,7 +27871,7 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx125(
27700
27871
  }
27701
27872
  )
27702
27873
  ] }),
27703
- children: /* @__PURE__ */ jsx125("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ jsx125(
27874
+ children: /* @__PURE__ */ jsx126("div", { className: "flex flex-col gap-2", children: lesson.questions.map((question, index) => /* @__PURE__ */ jsx126(
27704
27875
  QuestionAccordionItem,
27705
27876
  {
27706
27877
  question,
@@ -27711,43 +27882,43 @@ var LessonAccordionItem = ({ lesson }) => /* @__PURE__ */ jsx125(
27711
27882
  }
27712
27883
  );
27713
27884
  var LoadingSkeleton2 = () => /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-4 animate-pulse", children: [
27714
- /* @__PURE__ */ jsx125("div", { className: "h-6 bg-background-200 rounded w-48" }),
27885
+ /* @__PURE__ */ jsx126("div", { className: "h-6 bg-background-200 rounded w-48" }),
27715
27886
  /* @__PURE__ */ jsxs100("div", { className: "grid grid-cols-2 gap-3", children: [
27716
- /* @__PURE__ */ jsx125("div", { className: "h-44 bg-background-200 rounded-xl" }),
27717
- /* @__PURE__ */ jsx125("div", { className: "h-44 bg-background-200 rounded-xl" })
27887
+ /* @__PURE__ */ jsx126("div", { className: "h-44 bg-background-200 rounded-xl" }),
27888
+ /* @__PURE__ */ jsx126("div", { className: "h-44 bg-background-200 rounded-xl" })
27718
27889
  ] })
27719
27890
  ] });
27720
27891
  var ErrorContent = ({ message }) => /* @__PURE__ */ jsxs100("div", { className: "flex flex-col items-center justify-center py-8 gap-3", children: [
27721
- /* @__PURE__ */ jsx125(
27892
+ /* @__PURE__ */ jsx126(
27722
27893
  Text_default,
27723
27894
  {
27724
27895
  as: "span",
27725
27896
  className: "size-12 rounded-full bg-error-100 flex items-center justify-center",
27726
- children: /* @__PURE__ */ jsx125(WarningCircleIcon2, { size: 24, className: "text-error-700" })
27897
+ children: /* @__PURE__ */ jsx126(WarningCircleIcon2, { size: 24, className: "text-error-700" })
27727
27898
  }
27728
27899
  ),
27729
- /* @__PURE__ */ jsx125(Text_default, { size: "md", className: "text-error-700 text-center", children: message })
27900
+ /* @__PURE__ */ jsx126(Text_default, { size: "md", className: "text-error-700 text-center", children: message })
27730
27901
  ] });
27731
27902
  var PerformanceContent = ({
27732
27903
  data,
27733
27904
  labels
27734
27905
  }) => /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-5", children: [
27735
27906
  /* @__PURE__ */ jsxs100("div", { className: "flex items-center gap-2", children: [
27736
- /* @__PURE__ */ jsx125(
27907
+ /* @__PURE__ */ jsx126(
27737
27908
  Text_default,
27738
27909
  {
27739
27910
  as: "span",
27740
27911
  className: "size-8 rounded-full bg-background-100 flex items-center justify-center",
27741
- children: /* @__PURE__ */ jsx125(UserIcon2, { size: 16, className: "text-text-500" })
27912
+ children: /* @__PURE__ */ jsx126(UserIcon2, { size: 16, className: "text-text-500" })
27742
27913
  }
27743
27914
  ),
27744
- /* @__PURE__ */ jsx125(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
27915
+ /* @__PURE__ */ jsx126(Text_default, { size: "md", weight: "medium", className: "text-text-950", children: data.studentName })
27745
27916
  ] }),
27746
27917
  /* @__PURE__ */ jsxs100("div", { className: "grid grid-cols-2 gap-3", children: [
27747
- /* @__PURE__ */ jsx125(
27918
+ /* @__PURE__ */ jsx126(
27748
27919
  PerformanceCard,
27749
27920
  {
27750
- icon: /* @__PURE__ */ jsx125(
27921
+ icon: /* @__PURE__ */ jsx126(
27751
27922
  LightbulbFilamentIcon,
27752
27923
  {
27753
27924
  size: 18,
@@ -27762,10 +27933,10 @@ var PerformanceContent = ({
27762
27933
  variant: "success"
27763
27934
  }
27764
27935
  ),
27765
- /* @__PURE__ */ jsx125(
27936
+ /* @__PURE__ */ jsx126(
27766
27937
  PerformanceCard,
27767
27938
  {
27768
- icon: /* @__PURE__ */ jsx125(
27939
+ icon: /* @__PURE__ */ jsx126(
27769
27940
  WarningCircleIcon2,
27770
27941
  {
27771
27942
  size: 18,
@@ -27782,19 +27953,19 @@ var PerformanceContent = ({
27782
27953
  )
27783
27954
  ] }),
27784
27955
  data.lessons.length > 0 && /* @__PURE__ */ jsxs100("div", { className: "flex flex-col gap-3", children: [
27785
- /* @__PURE__ */ jsx125(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
27786
- /* @__PURE__ */ jsx125("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ jsx125(LessonAccordionItem, { lesson }, lesson.id)) })
27956
+ /* @__PURE__ */ jsx126(Text_default, { size: "md", weight: "semibold", className: "text-text-950", children: labels.lessonsTitle }),
27957
+ /* @__PURE__ */ jsx126("div", { className: "flex flex-col gap-2", children: data.lessons.map((lesson) => /* @__PURE__ */ jsx126(LessonAccordionItem, { lesson }, lesson.id)) })
27787
27958
  ] })
27788
27959
  ] });
27789
27960
  var renderModalContent = (loading, error, data, labels) => {
27790
27961
  if (loading) {
27791
- return /* @__PURE__ */ jsx125(LoadingSkeleton2, {});
27962
+ return /* @__PURE__ */ jsx126(LoadingSkeleton2, {});
27792
27963
  }
27793
27964
  if (error) {
27794
- return /* @__PURE__ */ jsx125(ErrorContent, { message: error });
27965
+ return /* @__PURE__ */ jsx126(ErrorContent, { message: error });
27795
27966
  }
27796
27967
  if (data) {
27797
- return /* @__PURE__ */ jsx125(PerformanceContent, { data, labels });
27968
+ return /* @__PURE__ */ jsx126(PerformanceContent, { data, labels });
27798
27969
  }
27799
27970
  return null;
27800
27971
  };
@@ -27813,7 +27984,7 @@ var StudentPerformanceModal = ({
27813
27984
  if (!data && !loading && !error) {
27814
27985
  return null;
27815
27986
  }
27816
- return /* @__PURE__ */ jsx125(
27987
+ return /* @__PURE__ */ jsx126(
27817
27988
  Modal_default,
27818
27989
  {
27819
27990
  isOpen,
@@ -27827,7 +27998,7 @@ var StudentPerformanceModal = ({
27827
27998
  };
27828
27999
 
27829
28000
  // src/components/RecommendedLessonDetails/RecommendedLessonDetails.tsx
27830
- import { Fragment as Fragment28, jsx as jsx126, jsxs as jsxs101 } from "react/jsx-runtime";
28001
+ import { Fragment as Fragment28, jsx as jsx127, jsxs as jsxs101 } from "react/jsx-runtime";
27831
28002
  var RecommendedLessonDetails = ({
27832
28003
  goalId,
27833
28004
  data,
@@ -27845,11 +28016,11 @@ var RecommendedLessonDetails = ({
27845
28016
  () => ({ ...DEFAULT_LABELS, ...customLabels }),
27846
28017
  [customLabels]
27847
28018
  );
27848
- const [performanceModalOpen, setPerformanceModalOpen] = useState50(false);
27849
- const [performanceData, setPerformanceData] = useState50(null);
27850
- const [performanceLoading, setPerformanceLoading] = useState50(false);
27851
- const [performanceError, setPerformanceError] = useState50(null);
27852
- const handleViewStudentPerformance = useCallback30(
28019
+ const [performanceModalOpen, setPerformanceModalOpen] = useState51(false);
28020
+ const [performanceData, setPerformanceData] = useState51(null);
28021
+ const [performanceLoading, setPerformanceLoading] = useState51(false);
28022
+ const [performanceError, setPerformanceError] = useState51(null);
28023
+ const handleViewStudentPerformance = useCallback31(
27853
28024
  async (studentId) => {
27854
28025
  if (!fetchStudentPerformance || !goalId) return;
27855
28026
  setPerformanceModalOpen(true);
@@ -27870,7 +28041,7 @@ var RecommendedLessonDetails = ({
27870
28041
  },
27871
28042
  [fetchStudentPerformance, goalId]
27872
28043
  );
27873
- const handleClosePerformanceModal = useCallback30(() => {
28044
+ const handleClosePerformanceModal = useCallback31(() => {
27874
28045
  setPerformanceModalOpen(false);
27875
28046
  setPerformanceData(null);
27876
28047
  setPerformanceError(null);
@@ -27891,17 +28062,17 @@ var RecommendedLessonDetails = ({
27891
28062
  );
27892
28063
  }, [data?.details.students, data?.goal.finalDate]);
27893
28064
  if (loading) {
27894
- return /* @__PURE__ */ jsx126(
28065
+ return /* @__PURE__ */ jsx127(
27895
28066
  "div",
27896
28067
  {
27897
28068
  className: cn("flex flex-col gap-6", className),
27898
28069
  "data-testid": "lesson-details-loading",
27899
- children: /* @__PURE__ */ jsx126(LoadingSkeleton, {})
28070
+ children: /* @__PURE__ */ jsx127(LoadingSkeleton, {})
27900
28071
  }
27901
28072
  );
27902
28073
  }
27903
28074
  if (error) {
27904
- return /* @__PURE__ */ jsx126(
28075
+ return /* @__PURE__ */ jsx127(
27905
28076
  "div",
27906
28077
  {
27907
28078
  className: cn(
@@ -27909,7 +28080,7 @@ var RecommendedLessonDetails = ({
27909
28080
  className
27910
28081
  ),
27911
28082
  "data-testid": "lesson-details-error",
27912
- children: /* @__PURE__ */ jsx126(Text_default, { size: "md", className: "text-error-700", children: error })
28083
+ children: /* @__PURE__ */ jsx127(Text_default, { size: "md", className: "text-error-700", children: error })
27913
28084
  }
27914
28085
  );
27915
28086
  }
@@ -27923,8 +28094,8 @@ var RecommendedLessonDetails = ({
27923
28094
  className: cn("flex flex-col gap-6", className),
27924
28095
  "data-testid": "recommended-lesson-details",
27925
28096
  children: [
27926
- /* @__PURE__ */ jsx126(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
27927
- /* @__PURE__ */ jsx126(
28097
+ /* @__PURE__ */ jsx127(Breadcrumb, { items: breadcrumbItems, onItemClick: onBreadcrumbClick }),
28098
+ /* @__PURE__ */ jsx127(
27928
28099
  LessonHeader,
27929
28100
  {
27930
28101
  data,
@@ -27933,8 +28104,8 @@ var RecommendedLessonDetails = ({
27933
28104
  viewLessonLabel: labels.viewLesson
27934
28105
  }
27935
28106
  ),
27936
- /* @__PURE__ */ jsx126(ResultsSection, { data, labels }),
27937
- /* @__PURE__ */ jsx126(
28107
+ /* @__PURE__ */ jsx127(ResultsSection, { data, labels }),
28108
+ /* @__PURE__ */ jsx127(
27938
28109
  StudentsTable,
27939
28110
  {
27940
28111
  students: displayStudents,
@@ -27945,7 +28116,7 @@ var RecommendedLessonDetails = ({
27945
28116
  ]
27946
28117
  }
27947
28118
  ),
27948
- fetchStudentPerformance && /* @__PURE__ */ jsx126(
28119
+ fetchStudentPerformance && /* @__PURE__ */ jsx127(
27949
28120
  StudentPerformanceModal,
27950
28121
  {
27951
28122
  isOpen: performanceModalOpen,
@@ -27960,7 +28131,7 @@ var RecommendedLessonDetails = ({
27960
28131
  var RecommendedLessonDetails_default = RecommendedLessonDetails;
27961
28132
 
27962
28133
  // src/hooks/useRecommendedLessonsPage.ts
27963
- import { useCallback as useCallback31, useRef as useRef33, useMemo as useMemo31, useState as useState51 } from "react";
28134
+ import { useCallback as useCallback32, useRef as useRef33, useMemo as useMemo31, useState as useState52 } from "react";
27964
28135
  var buildQueryParams2 = (filters) => {
27965
28136
  if (!filters) return {};
27966
28137
  const params = {};
@@ -27994,7 +28165,7 @@ var getClassOptions2 = (userData) => {
27994
28165
  });
27995
28166
  return Array.from(classMap.entries()).map(([id, name]) => ({ id, name }));
27996
28167
  };
27997
- var getSubjectOptions3 = (userData) => {
28168
+ var getSubjectOptions4 = (userData) => {
27998
28169
  if (!userData?.subTeacherTopicClasses) return [];
27999
28170
  const subjectMap = /* @__PURE__ */ new Map();
28000
28171
  userData.subTeacherTopicClasses.forEach((stc) => {
@@ -28018,25 +28189,25 @@ var createUseRecommendedLessonsPage = (config) => {
28018
28189
  } = config;
28019
28190
  return () => {
28020
28191
  const goalsMapRef = useRef33(/* @__PURE__ */ new Map());
28021
- const [sendModalOpen, setSendModalOpen] = useState51(false);
28022
- const [selectedModel, setSelectedModel] = useState51(null);
28023
- const [sendModalLoading, setSendModalLoading] = useState51(false);
28024
- const [sendModalCategories, setSendModalCategories] = useState51([]);
28192
+ const [sendModalOpen, setSendModalOpen] = useState52(false);
28193
+ const [selectedModel, setSelectedModel] = useState52(null);
28194
+ const [sendModalLoading, setSendModalLoading] = useState52(false);
28195
+ const [sendModalCategories, setSendModalCategories] = useState52([]);
28025
28196
  const userFilterData = useMemo31(
28026
28197
  () => ({
28027
28198
  schools: getSchoolOptions2(userData),
28028
28199
  classes: getClassOptions2(userData),
28029
- subjects: getSubjectOptions3(userData)
28200
+ subjects: getSubjectOptions4(userData)
28030
28201
  }),
28031
28202
  [userData]
28032
28203
  );
28033
28204
  const subjectsMap = useMemo31(() => {
28034
28205
  const map = /* @__PURE__ */ new Map();
28035
- const subjects = getSubjectOptions3(userData);
28206
+ const subjects = getSubjectOptions4(userData);
28036
28207
  subjects.forEach((s) => map.set(s.id, s.name));
28037
28208
  return map;
28038
28209
  }, [userData]);
28039
- const fetchGoalsHistory = useCallback31(
28210
+ const fetchGoalsHistory = useCallback32(
28040
28211
  async (filters) => {
28041
28212
  const params = buildQueryParams2(filters);
28042
28213
  const response = await api.get(
@@ -28051,7 +28222,7 @@ var createUseRecommendedLessonsPage = (config) => {
28051
28222
  },
28052
28223
  [api, endpoints.goalsHistory]
28053
28224
  );
28054
- const fetchGoalModels = useCallback31(
28225
+ const fetchGoalModels = useCallback32(
28055
28226
  async (filters) => {
28056
28227
  const params = buildQueryParams2({
28057
28228
  ...filters,
@@ -28065,31 +28236,51 @@ var createUseRecommendedLessonsPage = (config) => {
28065
28236
  },
28066
28237
  [api, endpoints.goalDrafts]
28067
28238
  );
28068
- const deleteGoalModel = useCallback31(
28239
+ const deleteGoalModel = useCallback32(
28069
28240
  async (id) => {
28070
28241
  await api.delete(`${endpoints.goalDrafts}/${id}`);
28071
28242
  },
28072
28243
  [api, endpoints.goalDrafts]
28073
28244
  );
28074
- const handleCreateLesson = useCallback31(() => {
28245
+ const fetchGoalDrafts = useCallback32(
28246
+ async (filters) => {
28247
+ const params = buildQueryParams2({
28248
+ ...filters,
28249
+ type: "RASCUNHO" /* RASCUNHO */
28250
+ });
28251
+ const response = await api.get(
28252
+ endpoints.goalDrafts,
28253
+ { params }
28254
+ );
28255
+ return response.data;
28256
+ },
28257
+ [api, endpoints.goalDrafts]
28258
+ );
28259
+ const deleteGoalDraft = useCallback32(
28260
+ async (id) => {
28261
+ await api.delete(`${endpoints.goalDrafts}/${id}`);
28262
+ },
28263
+ [api, endpoints.goalDrafts]
28264
+ );
28265
+ const handleCreateLesson = useCallback32(() => {
28075
28266
  navigate(paths.createLesson);
28076
28267
  }, []);
28077
- const handleCreateModel = useCallback31(() => {
28268
+ const handleCreateModel = useCallback32(() => {
28078
28269
  navigate(paths.createModel);
28079
28270
  }, []);
28080
- const handleRowClick = useCallback31((row) => {
28271
+ const handleRowClick = useCallback32((row) => {
28081
28272
  const originalData = goalsMapRef.current.get(row.id);
28082
28273
  navigate(`${paths.lessonDetails}/${row.id}`, {
28083
28274
  state: { goalData: originalData }
28084
28275
  });
28085
28276
  }, []);
28086
- const handleEditGoal = useCallback31((id) => {
28277
+ const handleEditGoal = useCallback32((id) => {
28087
28278
  navigate(`${paths.editLesson}/${id}/editar`);
28088
28279
  }, []);
28089
- const handleEditModel = useCallback31((model) => {
28280
+ const handleEditModel = useCallback32((model) => {
28090
28281
  navigate(`${paths.editModel}${model.id}`);
28091
28282
  }, []);
28092
- const handleSendLesson = useCallback31(
28283
+ const handleSendLesson = useCallback32(
28093
28284
  (model) => {
28094
28285
  setSelectedModel(model);
28095
28286
  const classes = getClassOptions2(userData);
@@ -28112,7 +28303,7 @@ var createUseRecommendedLessonsPage = (config) => {
28112
28303
  },
28113
28304
  [userData]
28114
28305
  );
28115
- const handleSendLessonSubmit = useCallback31(
28306
+ const handleSendLessonSubmit = useCallback32(
28116
28307
  async (formData) => {
28117
28308
  if (!selectedModel) return;
28118
28309
  setSendModalLoading(true);
@@ -28131,11 +28322,11 @@ var createUseRecommendedLessonsPage = (config) => {
28131
28322
  },
28132
28323
  [api, endpoints.submitGoal, selectedModel]
28133
28324
  );
28134
- const handleSendModalClose = useCallback31(() => {
28325
+ const handleSendModalClose = useCallback32(() => {
28135
28326
  setSendModalOpen(false);
28136
28327
  setSelectedModel(null);
28137
28328
  }, []);
28138
- const handleCategoriesChange = useCallback31(
28329
+ const handleCategoriesChange = useCallback32(
28139
28330
  (categories) => {
28140
28331
  setSendModalCategories(categories);
28141
28332
  },
@@ -28152,6 +28343,10 @@ var createUseRecommendedLessonsPage = (config) => {
28152
28343
  onEditGoal: handleEditGoal,
28153
28344
  onEditModel: handleEditModel,
28154
28345
  onSendLesson: handleSendLesson,
28346
+ fetchGoalDrafts,
28347
+ deleteGoalDraft,
28348
+ onSendDraft: handleSendLesson,
28349
+ onEditDraft: handleEditModel,
28155
28350
  emptyStateImage,
28156
28351
  noSearchImage,
28157
28352
  mapSubjectNameToEnum: mapSubjectNameToEnum2,
@@ -28177,7 +28372,7 @@ var createUseRecommendedLessonsPage = (config) => {
28177
28372
  var createRecommendedLessonsPageHook = createUseRecommendedLessonsPage;
28178
28373
 
28179
28374
  // src/hooks/useRecommendedLessonDetails.ts
28180
- import { useState as useState52, useCallback as useCallback32, useEffect as useEffect52 } from "react";
28375
+ import { useState as useState53, useCallback as useCallback33, useEffect as useEffect52 } from "react";
28181
28376
  import { z as z7 } from "zod";
28182
28377
  var goalLessonSubjectSchema = z7.object({
28183
28378
  id: z7.string(),
@@ -28280,12 +28475,12 @@ var handleLessonDetailsFetchError = (error) => {
28280
28475
  };
28281
28476
  var createUseRecommendedLessonDetails = (apiClient) => {
28282
28477
  return (lessonId) => {
28283
- const [state, setState] = useState52({
28478
+ const [state, setState] = useState53({
28284
28479
  data: null,
28285
28480
  loading: true,
28286
28481
  error: null
28287
28482
  });
28288
- const fetchLessonDetails = useCallback32(async () => {
28483
+ const fetchLessonDetails = useCallback33(async () => {
28289
28484
  if (!lessonId) {
28290
28485
  setState({
28291
28486
  data: null,
@@ -28343,20 +28538,20 @@ var createUseRecommendedLessonDetails = (apiClient) => {
28343
28538
  var createRecommendedLessonDetailsHook = createUseRecommendedLessonDetails;
28344
28539
 
28345
28540
  // src/components/ActivitiesHistory/ActivitiesHistory.tsx
28346
- import { useState as useState55 } from "react";
28541
+ import { useState as useState56 } from "react";
28347
28542
 
28348
28543
  // src/components/ActivitiesHistory/tabs/HistoryTab.tsx
28349
- import { useCallback as useCallback34, useMemo as useMemo32, useRef as useRef34 } from "react";
28544
+ import { useCallback as useCallback35, useMemo as useMemo32, useRef as useRef34 } from "react";
28350
28545
  import { Plus as Plus6 } from "phosphor-react";
28351
28546
 
28352
28547
  // src/components/ActivitiesHistory/config/historyTableColumns.tsx
28353
28548
  import { CaretRight as CaretRight11 } from "phosphor-react";
28354
28549
 
28355
28550
  // src/components/ActivitiesHistory/utils/renderTruncatedText.tsx
28356
- import { jsx as jsx127 } from "react/jsx-runtime";
28551
+ import { jsx as jsx128 } from "react/jsx-runtime";
28357
28552
  var renderTruncatedText = (value) => {
28358
28553
  const text = typeof value === "string" ? value : "";
28359
- return /* @__PURE__ */ jsx127(Text_default, { size: "sm", title: text, children: text });
28554
+ return /* @__PURE__ */ jsx128(Text_default, { size: "sm", title: text, children: text });
28360
28555
  };
28361
28556
 
28362
28557
  // src/components/ActivitiesHistory/utils/filterBuilders.ts
@@ -28402,7 +28597,7 @@ var getSchoolOptions3 = (data) => {
28402
28597
  name: school.name
28403
28598
  }));
28404
28599
  };
28405
- var getSubjectOptions4 = (data) => {
28600
+ var getSubjectOptions5 = (data) => {
28406
28601
  if (!data?.subjects) return [];
28407
28602
  return data.subjects.map((subject) => ({
28408
28603
  id: subject.id,
@@ -28411,7 +28606,7 @@ var getSubjectOptions4 = (data) => {
28411
28606
  };
28412
28607
 
28413
28608
  // src/components/ActivitiesHistory/config/historyTableColumns.tsx
28414
- import { jsx as jsx128 } from "react/jsx-runtime";
28609
+ import { jsx as jsx129 } from "react/jsx-runtime";
28415
28610
  var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
28416
28611
  {
28417
28612
  key: "startDate",
@@ -28464,9 +28659,9 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
28464
28659
  render: (value) => {
28465
28660
  const status = typeof value === "string" ? value : "";
28466
28661
  if (!status) {
28467
- return /* @__PURE__ */ jsx128(Text_default, { size: "sm", color: "text-text-500", children: "-" });
28662
+ return /* @__PURE__ */ jsx129(Text_default, { size: "sm", color: "text-text-500", children: "-" });
28468
28663
  }
28469
- return /* @__PURE__ */ jsx128(
28664
+ return /* @__PURE__ */ jsx129(
28470
28665
  Badge_default,
28471
28666
  {
28472
28667
  variant: "solid",
@@ -28481,7 +28676,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
28481
28676
  key: "completionPercentage",
28482
28677
  label: "Conclus\xE3o",
28483
28678
  sortable: true,
28484
- render: (value) => /* @__PURE__ */ jsx128(
28679
+ render: (value) => /* @__PURE__ */ jsx129(
28485
28680
  ProgressBar_default,
28486
28681
  {
28487
28682
  value: Number(value),
@@ -28498,7 +28693,7 @@ var createHistoryTableColumns = (mapSubjectNameToEnum2) => [
28498
28693
  label: "",
28499
28694
  sortable: false,
28500
28695
  className: "w-12",
28501
- render: () => /* @__PURE__ */ jsx128("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx128(CaretRight11, { size: 20, className: "text-text-600" }) })
28696
+ render: () => /* @__PURE__ */ jsx129("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx129(CaretRight11, { size: 20, className: "text-text-600" }) })
28502
28697
  }
28503
28698
  ];
28504
28699
 
@@ -28536,14 +28731,14 @@ var createHistoryFiltersConfig = (userData) => [
28536
28731
  key: "subject",
28537
28732
  label: "Mat\xE9ria",
28538
28733
  selectedIds: [],
28539
- itens: getSubjectOptions4(userData)
28734
+ itens: getSubjectOptions5(userData)
28540
28735
  }
28541
28736
  ]
28542
28737
  }
28543
28738
  ];
28544
28739
 
28545
28740
  // src/hooks/useActivitiesHistory.ts
28546
- import { useState as useState53, useCallback as useCallback33 } from "react";
28741
+ import { useState as useState54, useCallback as useCallback34 } from "react";
28547
28742
  import { z as z8 } from "zod";
28548
28743
  import dayjs6 from "dayjs";
28549
28744
  var activityHistoryResponseSchema = z8.object({
@@ -28602,13 +28797,13 @@ var handleActivityFetchError = createFetchErrorHandler(
28602
28797
  );
28603
28798
  var createUseActivitiesHistory = (fetchActivitiesHistory) => {
28604
28799
  return () => {
28605
- const [state, setState] = useState53({
28800
+ const [state, setState] = useState54({
28606
28801
  activities: [],
28607
28802
  loading: false,
28608
28803
  error: null,
28609
28804
  pagination: DEFAULT_ACTIVITIES_PAGINATION
28610
28805
  });
28611
- const fetchActivities = useCallback33(
28806
+ const fetchActivities = useCallback34(
28612
28807
  async (filters) => {
28613
28808
  setState((prev) => ({ ...prev, loading: true, error: null }));
28614
28809
  try {
@@ -28643,7 +28838,7 @@ var createUseActivitiesHistory = (fetchActivitiesHistory) => {
28643
28838
  var createActivitiesHistoryHook = createUseActivitiesHistory;
28644
28839
 
28645
28840
  // src/components/ActivitiesHistory/tabs/HistoryTab.tsx
28646
- import { jsx as jsx129, jsxs as jsxs102 } from "react/jsx-runtime";
28841
+ import { jsx as jsx130, jsxs as jsxs102 } from "react/jsx-runtime";
28647
28842
  var HistoryTab = ({
28648
28843
  fetchActivitiesHistory,
28649
28844
  onCreateActivity,
@@ -28676,7 +28871,7 @@ var HistoryTab = ({
28676
28871
  () => createHistoryTableColumns(mapSubjectNameToEnum2),
28677
28872
  [mapSubjectNameToEnum2]
28678
28873
  );
28679
- const handleParamsChange = useCallback34(
28874
+ const handleParamsChange = useCallback35(
28680
28875
  (params) => {
28681
28876
  const filters = buildHistoryFiltersFromParams(params);
28682
28877
  fetchActivities(filters);
@@ -28684,9 +28879,9 @@ var HistoryTab = ({
28684
28879
  [fetchActivities]
28685
28880
  );
28686
28881
  if (error) {
28687
- return /* @__PURE__ */ jsx129(ErrorDisplay, { error });
28882
+ return /* @__PURE__ */ jsx130(ErrorDisplay, { error });
28688
28883
  }
28689
- return /* @__PURE__ */ jsx129("div", { className: "w-full", children: /* @__PURE__ */ jsx129(
28884
+ return /* @__PURE__ */ jsx130("div", { className: "w-full", children: /* @__PURE__ */ jsx130(
28690
28885
  TableProvider,
28691
28886
  {
28692
28887
  data: activities,
@@ -28711,14 +28906,14 @@ var HistoryTab = ({
28711
28906
  image: noSearchImage
28712
28907
  },
28713
28908
  emptyState: {
28714
- component: /* @__PURE__ */ jsx129(
28909
+ component: /* @__PURE__ */ jsx130(
28715
28910
  EmptyState_default,
28716
28911
  {
28717
28912
  image: emptyStateImage,
28718
28913
  title: "Incentive sua turma ao aprendizado",
28719
28914
  description: "Crie uma nova atividade e ajude seus alunos a colocarem o conte\xFAdo em pr\xE1tica!",
28720
28915
  buttonText: "Criar atividade",
28721
- buttonIcon: /* @__PURE__ */ jsx129(Plus6, { size: 18 }),
28916
+ buttonIcon: /* @__PURE__ */ jsx130(Plus6, { size: 18 }),
28722
28917
  buttonVariant: "outline",
28723
28918
  buttonAction: "primary",
28724
28919
  onButtonClick: onCreateActivity
@@ -28735,14 +28930,14 @@ var HistoryTab = ({
28735
28930
  } = renderProps;
28736
28931
  return /* @__PURE__ */ jsxs102("div", { className: "space-y-4", children: [
28737
28932
  /* @__PURE__ */ jsxs102("div", { className: "flex items-center justify-between gap-4", children: [
28738
- /* @__PURE__ */ jsx129(
28933
+ /* @__PURE__ */ jsx130(
28739
28934
  Button_default,
28740
28935
  {
28741
28936
  variant: "solid",
28742
28937
  action: "primary",
28743
28938
  size: "medium",
28744
28939
  onClick: onCreateActivity,
28745
- iconLeft: /* @__PURE__ */ jsx129(Plus6, { size: 18, weight: "bold" }),
28940
+ iconLeft: /* @__PURE__ */ jsx130(Plus6, { size: 18, weight: "bold" }),
28746
28941
  children: "Criar atividade"
28747
28942
  }
28748
28943
  ),
@@ -28768,14 +28963,14 @@ var createModelsFiltersConfig = (userData) => [
28768
28963
  key: "subject",
28769
28964
  label: "Mat\xE9ria",
28770
28965
  selectedIds: [],
28771
- itens: getSubjectOptions4(userData)
28966
+ itens: getSubjectOptions5(userData)
28772
28967
  }
28773
28968
  ]
28774
28969
  }
28775
28970
  ];
28776
28971
 
28777
28972
  // src/hooks/useActivityModels.ts
28778
- import { useState as useState54, useCallback as useCallback35 } from "react";
28973
+ import { useState as useState55, useCallback as useCallback36 } from "react";
28779
28974
  import { z as z9 } from "zod";
28780
28975
  import dayjs7 from "dayjs";
28781
28976
  var activityDraftFiltersSchema = z9.object({
@@ -28836,13 +29031,13 @@ var handleModelFetchError = createFetchErrorHandler(
28836
29031
  );
28837
29032
  var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
28838
29033
  return () => {
28839
- const [state, setState] = useState54({
29034
+ const [state, setState] = useState55({
28840
29035
  models: [],
28841
29036
  loading: false,
28842
29037
  error: null,
28843
29038
  pagination: DEFAULT_MODELS_PAGINATION
28844
29039
  });
28845
- const fetchModels = useCallback35(
29040
+ const fetchModels = useCallback36(
28846
29041
  async (filters, subjectsMap) => {
28847
29042
  setState((prev) => ({ ...prev, loading: true, error: null }));
28848
29043
  try {
@@ -28877,7 +29072,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
28877
29072
  },
28878
29073
  [fetchActivityModels]
28879
29074
  );
28880
- const deleteModel = useCallback35(
29075
+ const deleteModel = useCallback36(
28881
29076
  async (id) => {
28882
29077
  try {
28883
29078
  await deleteActivityModel(id);
@@ -28899,7 +29094,7 @@ var createUseActivityModels = (fetchActivityModels, deleteActivityModel) => {
28899
29094
  var createActivityModelsHook = createUseActivityModels;
28900
29095
 
28901
29096
  // src/components/ActivitiesHistory/tabs/ModelsTab.tsx
28902
- import { jsx as jsx130 } from "react/jsx-runtime";
29097
+ import { jsx as jsx131 } from "react/jsx-runtime";
28903
29098
  var ACTIVITY_MODELS_CONFIG = {
28904
29099
  entityName: "atividade",
28905
29100
  entityNamePlural: "atividades",
@@ -28925,7 +29120,7 @@ var ModelsTab = ({
28925
29120
  mapSubjectNameToEnum: mapSubjectNameToEnum2,
28926
29121
  userFilterData,
28927
29122
  subjectsMap
28928
- }) => /* @__PURE__ */ jsx130(
29123
+ }) => /* @__PURE__ */ jsx131(
28929
29124
  ModelsTabBase,
28930
29125
  {
28931
29126
  fetchModels: fetchActivityModels,
@@ -28953,13 +29148,13 @@ var ModelsTab = ({
28953
29148
  );
28954
29149
 
28955
29150
  // src/components/ActivitiesHistory/tabs/DraftsTab.tsx
28956
- import { jsx as jsx131 } from "react/jsx-runtime";
29151
+ import { jsx as jsx132 } from "react/jsx-runtime";
28957
29152
  var DraftsTab = () => {
28958
- return /* @__PURE__ */ jsx131("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx131(Text_default, { size: "lg", color: "text-text-600", children: "Rascunhos em desenvolvimento" }) });
29153
+ return /* @__PURE__ */ jsx132("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ jsx132(Text_default, { size: "lg", color: "text-text-600", children: "Rascunhos em desenvolvimento" }) });
28959
29154
  };
28960
29155
 
28961
29156
  // src/components/ActivitiesHistory/ActivitiesHistory.tsx
28962
- import { jsx as jsx132, jsxs as jsxs103 } from "react/jsx-runtime";
29157
+ import { jsx as jsx133, jsxs as jsxs103 } from "react/jsx-runtime";
28963
29158
  var PAGE_TITLES = {
28964
29159
  ["history" /* HISTORY */]: "Hist\xF3rico de atividades",
28965
29160
  ["drafts" /* DRAFTS */]: "Rascunhos",
@@ -28980,17 +29175,17 @@ var ActivitiesHistory = ({
28980
29175
  userFilterData,
28981
29176
  subjectsMap
28982
29177
  }) => {
28983
- const [activeTab, setActiveTab] = useState55("history" /* HISTORY */);
29178
+ const [activeTab, setActiveTab] = useState56("history" /* HISTORY */);
28984
29179
  return /* @__PURE__ */ jsxs103(
28985
29180
  "div",
28986
29181
  {
28987
29182
  "data-testid": "activities-history",
28988
29183
  className: "flex flex-col w-full h-auto relative justify-center items-center mb-5 overflow-hidden",
28989
29184
  children: [
28990
- /* @__PURE__ */ jsx132("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
29185
+ /* @__PURE__ */ jsx133("span", { className: "absolute top-0 left-0 h-[150px] w-full z-0" }),
28991
29186
  /* @__PURE__ */ jsxs103("div", { className: "flex flex-col w-full h-full max-w-[1350px] mx-auto z-10 lg:px-0 px-4 pt-4 sm:pt-0", children: [
28992
29187
  /* @__PURE__ */ jsxs103("div", { className: "flex flex-col sm:flex-row w-full mb-6 items-start sm:items-center sm:justify-between gap-0 sm:gap-4", children: [
28993
- /* @__PURE__ */ jsx132(
29188
+ /* @__PURE__ */ jsx133(
28994
29189
  Text_default,
28995
29190
  {
28996
29191
  as: "h1",
@@ -28999,7 +29194,7 @@ var ActivitiesHistory = ({
28999
29194
  children: PAGE_TITLES[activeTab]
29000
29195
  }
29001
29196
  ),
29002
- /* @__PURE__ */ jsx132("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx132(
29197
+ /* @__PURE__ */ jsx133("div", { className: "flex-shrink-0 lg:w-auto self-center sm:self-auto", children: /* @__PURE__ */ jsx133(
29003
29198
  Menu,
29004
29199
  {
29005
29200
  defaultValue: "history" /* HISTORY */,
@@ -29013,7 +29208,7 @@ var ActivitiesHistory = ({
29013
29208
  variant: "menu2",
29014
29209
  className: "w-full lg:w-auto max-w-full min-w-0",
29015
29210
  children: [
29016
- /* @__PURE__ */ jsx132(
29211
+ /* @__PURE__ */ jsx133(
29017
29212
  MenuItem,
29018
29213
  {
29019
29214
  variant: "menu2",
@@ -29023,7 +29218,7 @@ var ActivitiesHistory = ({
29023
29218
  children: "Hist\xF3rico"
29024
29219
  }
29025
29220
  ),
29026
- /* @__PURE__ */ jsx132(
29221
+ /* @__PURE__ */ jsx133(
29027
29222
  MenuItem,
29028
29223
  {
29029
29224
  variant: "menu2",
@@ -29033,7 +29228,7 @@ var ActivitiesHistory = ({
29033
29228
  children: "Rascunhos"
29034
29229
  }
29035
29230
  ),
29036
- /* @__PURE__ */ jsx132(
29231
+ /* @__PURE__ */ jsx133(
29037
29232
  MenuItem,
29038
29233
  {
29039
29234
  variant: "menu2",
@@ -29050,7 +29245,7 @@ var ActivitiesHistory = ({
29050
29245
  ) })
29051
29246
  ] }),
29052
29247
  /* @__PURE__ */ jsxs103("div", { className: "flex flex-col items-center w-full min-h-0 flex-1", children: [
29053
- activeTab === "history" /* HISTORY */ && /* @__PURE__ */ jsx132(
29248
+ activeTab === "history" /* HISTORY */ && /* @__PURE__ */ jsx133(
29054
29249
  HistoryTab,
29055
29250
  {
29056
29251
  fetchActivitiesHistory,
@@ -29062,8 +29257,8 @@ var ActivitiesHistory = ({
29062
29257
  userFilterData
29063
29258
  }
29064
29259
  ),
29065
- activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ jsx132(DraftsTab, {}),
29066
- activeTab === "models" /* MODELS */ && /* @__PURE__ */ jsx132(
29260
+ activeTab === "drafts" /* DRAFTS */ && /* @__PURE__ */ jsx133(DraftsTab, {}),
29261
+ activeTab === "models" /* MODELS */ && /* @__PURE__ */ jsx133(
29067
29262
  ModelsTab,
29068
29263
  {
29069
29264
  fetchActivityModels,
@@ -29219,7 +29414,7 @@ var buildUserFilterData = (userData) => ({
29219
29414
  });
29220
29415
 
29221
29416
  // src/hooks/useChat.ts
29222
- import { useState as useState56, useEffect as useEffect53, useCallback as useCallback36, useRef as useRef35 } from "react";
29417
+ import { useState as useState57, useEffect as useEffect53, useCallback as useCallback37, useRef as useRef35 } from "react";
29223
29418
  var WS_STATES = {
29224
29419
  CONNECTING: 0,
29225
29420
  OPEN: 1,
@@ -29238,10 +29433,10 @@ function useChat({
29238
29433
  reconnectInterval = 3e3,
29239
29434
  maxReconnectAttempts = 5
29240
29435
  }) {
29241
- const [isConnected, setIsConnected] = useState56(false);
29242
- const [messages, setMessages] = useState56([]);
29243
- const [participants, setParticipants] = useState56([]);
29244
- const [error, setError] = useState56(null);
29436
+ const [isConnected, setIsConnected] = useState57(false);
29437
+ const [messages, setMessages] = useState57([]);
29438
+ const [participants, setParticipants] = useState57([]);
29439
+ const [error, setError] = useState57(null);
29245
29440
  const wsRef = useRef35(null);
29246
29441
  const reconnectAttemptsRef = useRef35(0);
29247
29442
  const reconnectTimeoutRef = useRef35(
@@ -29251,12 +29446,12 @@ function useChat({
29251
29446
  const isConnectingRef = useRef35(false);
29252
29447
  const connectRef = useRef35(() => {
29253
29448
  });
29254
- const sendWsMessage = useCallback36((message) => {
29449
+ const sendWsMessage = useCallback37((message) => {
29255
29450
  if (wsRef.current?.readyState === WS_STATES.OPEN) {
29256
29451
  wsRef.current.send(JSON.stringify(message));
29257
29452
  }
29258
29453
  }, []);
29259
- const sendMessage = useCallback36(
29454
+ const sendMessage = useCallback37(
29260
29455
  (content) => {
29261
29456
  const trimmedContent = content.trim();
29262
29457
  if (!trimmedContent) return;
@@ -29267,12 +29462,12 @@ function useChat({
29267
29462
  },
29268
29463
  [sendWsMessage]
29269
29464
  );
29270
- const leave = useCallback36(() => {
29465
+ const leave = useCallback37(() => {
29271
29466
  isManualDisconnectRef.current = true;
29272
29467
  sendWsMessage({ type: "leave" });
29273
29468
  wsRef.current?.close(1e3, "User left");
29274
29469
  }, [sendWsMessage]);
29275
- const handleMessage = useCallback36(
29470
+ const handleMessage = useCallback37(
29276
29471
  (event) => {
29277
29472
  try {
29278
29473
  const data = JSON.parse(event.data);
@@ -29340,7 +29535,7 @@ function useChat({
29340
29535
  },
29341
29536
  [onError]
29342
29537
  );
29343
- const connect = useCallback36(() => {
29538
+ const connect = useCallback37(() => {
29344
29539
  if (isConnectingRef.current) {
29345
29540
  return;
29346
29541
  }
@@ -29394,7 +29589,7 @@ function useChat({
29394
29589
  maxReconnectAttempts
29395
29590
  ]);
29396
29591
  connectRef.current = connect;
29397
- const reconnect = useCallback36(() => {
29592
+ const reconnect = useCallback37(() => {
29398
29593
  isManualDisconnectRef.current = false;
29399
29594
  reconnectAttemptsRef.current = 0;
29400
29595
  connectRef.current();
@@ -29443,15 +29638,15 @@ function createUseChat(baseWsUrl) {
29443
29638
  }
29444
29639
 
29445
29640
  // src/hooks/useChatRooms.ts
29446
- import { useState as useState57, useCallback as useCallback37 } from "react";
29641
+ import { useState as useState58, useCallback as useCallback38 } from "react";
29447
29642
  function useChatRooms({
29448
29643
  apiClient
29449
29644
  }) {
29450
- const [rooms, setRooms] = useState57([]);
29451
- const [availableUsers, setAvailableUsers] = useState57([]);
29452
- const [loading, setLoading] = useState57(false);
29453
- const [error, setError] = useState57(null);
29454
- const fetchRooms = useCallback37(async () => {
29645
+ const [rooms, setRooms] = useState58([]);
29646
+ const [availableUsers, setAvailableUsers] = useState58([]);
29647
+ const [loading, setLoading] = useState58(false);
29648
+ const [error, setError] = useState58(null);
29649
+ const fetchRooms = useCallback38(async () => {
29455
29650
  setLoading(true);
29456
29651
  setError(null);
29457
29652
  try {
@@ -29467,7 +29662,7 @@ function useChatRooms({
29467
29662
  setLoading(false);
29468
29663
  }
29469
29664
  }, [apiClient]);
29470
- const fetchAvailableUsers = useCallback37(async () => {
29665
+ const fetchAvailableUsers = useCallback38(async () => {
29471
29666
  setLoading(true);
29472
29667
  setError(null);
29473
29668
  try {
@@ -29483,7 +29678,7 @@ function useChatRooms({
29483
29678
  setLoading(false);
29484
29679
  }
29485
29680
  }, [apiClient]);
29486
- const createRoom = useCallback37(
29681
+ const createRoom = useCallback38(
29487
29682
  async (participantIds) => {
29488
29683
  setLoading(true);
29489
29684
  setError(null);
@@ -29507,7 +29702,7 @@ function useChatRooms({
29507
29702
  },
29508
29703
  [apiClient, fetchRooms]
29509
29704
  );
29510
- const clearError = useCallback37(() => {
29705
+ const clearError = useCallback38(() => {
29511
29706
  setError(null);
29512
29707
  }, []);
29513
29708
  return {
@@ -29541,19 +29736,19 @@ var CHAT_MESSAGE_TYPES = {
29541
29736
  };
29542
29737
 
29543
29738
  // src/components/Chat/Chat.tsx
29544
- import { useState as useState58, useEffect as useEffect54, useCallback as useCallback38, useRef as useRef36 } from "react";
29739
+ import { useState as useState59, useEffect as useEffect54, useCallback as useCallback39, useRef as useRef36 } from "react";
29545
29740
  import {
29546
29741
  PaperPlaneTiltIcon as PaperPlaneTiltIcon2,
29547
29742
  XIcon,
29548
29743
  PlusIcon,
29549
29744
  UsersIcon
29550
29745
  } from "@phosphor-icons/react";
29551
- import { jsx as jsx133, jsxs as jsxs104 } from "react/jsx-runtime";
29746
+ import { jsx as jsx134, jsxs as jsxs104 } from "react/jsx-runtime";
29552
29747
  var RoomItem = ({
29553
29748
  room,
29554
29749
  onClick,
29555
29750
  isActive
29556
- }) => /* @__PURE__ */ jsx133(
29751
+ }) => /* @__PURE__ */ jsx134(
29557
29752
  Button_default,
29558
29753
  {
29559
29754
  variant: "link",
@@ -29564,9 +29759,9 @@ var RoomItem = ({
29564
29759
  isActive && "bg-primary-50 border-l-4 border-primary-500"
29565
29760
  ),
29566
29761
  children: /* @__PURE__ */ jsxs104("div", { className: "flex items-start gap-3 w-full", children: [
29567
- /* @__PURE__ */ jsx133("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx133(UsersIcon, { size: 20, className: "text-primary-600" }) }),
29762
+ /* @__PURE__ */ jsx134("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx134(UsersIcon, { size: 20, className: "text-primary-600" }) }),
29568
29763
  /* @__PURE__ */ jsxs104("div", { className: "flex-1 min-w-0", children: [
29569
- /* @__PURE__ */ jsx133(Text_default, { size: "sm", weight: "semibold", className: "text-text-900 truncate", children: room.name }),
29764
+ /* @__PURE__ */ jsx134(Text_default, { size: "sm", weight: "semibold", className: "text-text-900 truncate", children: room.name }),
29570
29765
  room.lastMessage && /* @__PURE__ */ jsxs104(Text_default, { size: "xs", className: "text-text-500 truncate mt-1", children: [
29571
29766
  room.lastMessage.senderName,
29572
29767
  ": ",
@@ -29584,27 +29779,27 @@ var MessageBubble = ({
29584
29779
  message,
29585
29780
  isOwn
29586
29781
  }) => /* @__PURE__ */ jsxs104("div", { className: cn("flex gap-2 mb-3", isOwn && "flex-row-reverse"), children: [
29587
- !isOwn && /* @__PURE__ */ jsx133("div", { className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center flex-shrink-0", children: message.senderPhoto ? /* @__PURE__ */ jsx133(
29782
+ !isOwn && /* @__PURE__ */ jsx134("div", { className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center flex-shrink-0", children: message.senderPhoto ? /* @__PURE__ */ jsx134(
29588
29783
  "img",
29589
29784
  {
29590
29785
  src: message.senderPhoto,
29591
29786
  alt: message.senderName,
29592
29787
  className: "w-8 h-8 rounded-full object-cover"
29593
29788
  }
29594
- ) : /* @__PURE__ */ jsx133(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: message.senderName.charAt(0).toUpperCase() }) }),
29789
+ ) : /* @__PURE__ */ jsx134(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: message.senderName.charAt(0).toUpperCase() }) }),
29595
29790
  /* @__PURE__ */ jsxs104("div", { className: cn("max-w-[70%]", isOwn && "items-end"), children: [
29596
- !isOwn && /* @__PURE__ */ jsx133(Text_default, { size: "xs", className: "text-text-500 mb-1", children: message.senderName }),
29597
- /* @__PURE__ */ jsx133(
29791
+ !isOwn && /* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500 mb-1", children: message.senderName }),
29792
+ /* @__PURE__ */ jsx134(
29598
29793
  "div",
29599
29794
  {
29600
29795
  className: cn(
29601
29796
  "px-4 py-2 rounded-2xl",
29602
29797
  isOwn ? "bg-primary-500 text-white rounded-br-md" : "bg-background-100 text-text-900 rounded-bl-md"
29603
29798
  ),
29604
- children: /* @__PURE__ */ jsx133(Text_default, { size: "sm", children: message.content })
29799
+ children: /* @__PURE__ */ jsx134(Text_default, { size: "sm", children: message.content })
29605
29800
  }
29606
29801
  ),
29607
- /* @__PURE__ */ jsx133(
29802
+ /* @__PURE__ */ jsx134(
29608
29803
  Text_default,
29609
29804
  {
29610
29805
  size: "xs",
@@ -29619,26 +29814,26 @@ var MessageBubble = ({
29619
29814
  ] });
29620
29815
  var ParticipantItem = ({ participant }) => /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-2 py-2", children: [
29621
29816
  /* @__PURE__ */ jsxs104("div", { className: "relative", children: [
29622
- /* @__PURE__ */ jsx133("div", { className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center", children: participant.photo ? /* @__PURE__ */ jsx133(
29817
+ /* @__PURE__ */ jsx134("div", { className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center", children: participant.photo ? /* @__PURE__ */ jsx134(
29623
29818
  "img",
29624
29819
  {
29625
29820
  src: participant.photo,
29626
29821
  alt: participant.name,
29627
29822
  className: "w-8 h-8 rounded-full object-cover"
29628
29823
  }
29629
- ) : /* @__PURE__ */ jsx133(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: participant.name.charAt(0).toUpperCase() }) }),
29630
- participant.isOnline && /* @__PURE__ */ jsx133("div", { className: "absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white" })
29824
+ ) : /* @__PURE__ */ jsx134(Text_default, { size: "xs", weight: "bold", className: "text-gray-600", children: participant.name.charAt(0).toUpperCase() }) }),
29825
+ participant.isOnline && /* @__PURE__ */ jsx134("div", { className: "absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white" })
29631
29826
  ] }),
29632
29827
  /* @__PURE__ */ jsxs104("div", { className: "flex-1 min-w-0", children: [
29633
- /* @__PURE__ */ jsx133(Text_default, { size: "sm", className: "text-text-900 truncate", children: participant.name }),
29634
- /* @__PURE__ */ jsx133(Text_default, { size: "xs", className: "text-text-500", children: participant.role })
29828
+ /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-900 truncate", children: participant.name }),
29829
+ /* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500", children: participant.role })
29635
29830
  ] })
29636
29831
  ] });
29637
29832
  var UserSelector = ({
29638
29833
  users,
29639
29834
  selectedIds,
29640
29835
  onToggle
29641
- }) => /* @__PURE__ */ jsx133("div", { className: "space-y-2 max-h-64 overflow-y-auto", children: users.map((user) => /* @__PURE__ */ jsxs104(
29836
+ }) => /* @__PURE__ */ jsx134("div", { className: "space-y-2 max-h-64 overflow-y-auto", children: users.map((user) => /* @__PURE__ */ jsxs104(
29642
29837
  Button_default,
29643
29838
  {
29644
29839
  variant: "link",
@@ -29648,26 +29843,26 @@ var UserSelector = ({
29648
29843
  selectedIds.has(user.userInstitutionId) ? "bg-primary-50 border border-primary-500" : "bg-background-50 hover:bg-background-100 border border-transparent"
29649
29844
  ),
29650
29845
  children: [
29651
- /* @__PURE__ */ jsx133("div", { className: "w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center", children: user.photo ? /* @__PURE__ */ jsx133(
29846
+ /* @__PURE__ */ jsx134("div", { className: "w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center", children: user.photo ? /* @__PURE__ */ jsx134(
29652
29847
  "img",
29653
29848
  {
29654
29849
  src: user.photo,
29655
29850
  alt: user.name,
29656
29851
  className: "w-10 h-10 rounded-full object-cover"
29657
29852
  }
29658
- ) : /* @__PURE__ */ jsx133(Text_default, { size: "sm", weight: "bold", className: "text-gray-600", children: user.name.charAt(0).toUpperCase() }) }),
29853
+ ) : /* @__PURE__ */ jsx134(Text_default, { size: "sm", weight: "bold", className: "text-gray-600", children: user.name.charAt(0).toUpperCase() }) }),
29659
29854
  /* @__PURE__ */ jsxs104("div", { className: "flex-1 text-left", children: [
29660
- /* @__PURE__ */ jsx133(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: user.name }),
29661
- /* @__PURE__ */ jsx133(Text_default, { size: "xs", className: "text-text-500", children: user.profileName })
29855
+ /* @__PURE__ */ jsx134(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: user.name }),
29856
+ /* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500", children: user.profileName })
29662
29857
  ] }),
29663
- /* @__PURE__ */ jsx133(
29858
+ /* @__PURE__ */ jsx134(
29664
29859
  "div",
29665
29860
  {
29666
29861
  className: cn(
29667
29862
  "w-5 h-5 rounded-full border-2 flex items-center justify-center",
29668
29863
  selectedIds.has(user.userInstitutionId) ? "bg-primary-500 border-primary-500" : "border-gray-300"
29669
29864
  ),
29670
- children: selectedIds.has(user.userInstitutionId) && /* @__PURE__ */ jsx133("div", { className: "w-2 h-2 bg-white rounded-full" })
29865
+ children: selectedIds.has(user.userInstitutionId) && /* @__PURE__ */ jsx134("div", { className: "w-2 h-2 bg-white rounded-full" })
29671
29866
  }
29672
29867
  )
29673
29868
  ]
@@ -29677,9 +29872,9 @@ var UserSelector = ({
29677
29872
  function Chat(props) {
29678
29873
  const { userId, token } = props;
29679
29874
  if (!userId || !token) {
29680
- return /* @__PURE__ */ jsx133("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ jsx133(Text_default, { size: "sm", className: "text-text-500", children: "Carregando..." }) });
29875
+ return /* @__PURE__ */ jsx134("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-500", children: "Carregando..." }) });
29681
29876
  }
29682
- return /* @__PURE__ */ jsx133(ChatContent, { ...props });
29877
+ return /* @__PURE__ */ jsx134(ChatContent, { ...props });
29683
29878
  }
29684
29879
  function ChatContent({
29685
29880
  apiClient,
@@ -29694,15 +29889,15 @@ function ChatContent({
29694
29889
  onRoomChange,
29695
29890
  onBackToList
29696
29891
  }) {
29697
- const [view, setView] = useState58("list");
29698
- const [selectedRoom, setSelectedRoom] = useState58(
29892
+ const [view, setView] = useState59("list");
29893
+ const [selectedRoom, setSelectedRoom] = useState59(
29699
29894
  null
29700
29895
  );
29701
- const [selectedUserIds, setSelectedUserIds] = useState58(
29896
+ const [selectedUserIds, setSelectedUserIds] = useState59(
29702
29897
  /* @__PURE__ */ new Set()
29703
29898
  );
29704
- const [messageInput, setMessageInput] = useState58("");
29705
- const [showCreateModal, setShowCreateModal] = useState58(false);
29899
+ const [messageInput, setMessageInput] = useState59("");
29900
+ const [showCreateModal, setShowCreateModal] = useState59(false);
29706
29901
  const hasHandledInitialRoomRef = useRef36(false);
29707
29902
  const {
29708
29903
  rooms,
@@ -29756,7 +29951,7 @@ function ChatContent({
29756
29951
  onBackToList?.();
29757
29952
  }
29758
29953
  }, [initialRoomId, rooms, roomsLoading, onBackToList]);
29759
- const handleSelectRoom = useCallback38(
29954
+ const handleSelectRoom = useCallback39(
29760
29955
  (room) => {
29761
29956
  setSelectedRoom(room);
29762
29957
  setView("room");
@@ -29764,12 +29959,12 @@ function ChatContent({
29764
29959
  },
29765
29960
  [onRoomChange]
29766
29961
  );
29767
- const handleOpenCreateModal = useCallback38(async () => {
29962
+ const handleOpenCreateModal = useCallback39(async () => {
29768
29963
  await fetchAvailableUsers();
29769
29964
  setSelectedUserIds(/* @__PURE__ */ new Set());
29770
29965
  setShowCreateModal(true);
29771
29966
  }, [fetchAvailableUsers]);
29772
- const handleToggleUser = useCallback38((id) => {
29967
+ const handleToggleUser = useCallback39((id) => {
29773
29968
  setSelectedUserIds((prev) => {
29774
29969
  const next = new Set(prev);
29775
29970
  if (next.has(id)) {
@@ -29780,7 +29975,7 @@ function ChatContent({
29780
29975
  return next;
29781
29976
  });
29782
29977
  }, []);
29783
- const handleCreateRoom = useCallback38(async () => {
29978
+ const handleCreateRoom = useCallback39(async () => {
29784
29979
  if (selectedUserIds.size === 0) return;
29785
29980
  const room = await createRoom(Array.from(selectedUserIds));
29786
29981
  if (room) {
@@ -29789,30 +29984,30 @@ function ChatContent({
29789
29984
  onRoomChange?.(room.id);
29790
29985
  }
29791
29986
  }, [selectedUserIds, createRoom, onRoomChange]);
29792
- const handleSendMessage = useCallback38(() => {
29987
+ const handleSendMessage = useCallback39(() => {
29793
29988
  if (!messageInput.trim()) return;
29794
29989
  sendMessage(messageInput);
29795
29990
  setMessageInput("");
29796
29991
  }, [messageInput, sendMessage]);
29797
- const handleBackToList = useCallback38(() => {
29992
+ const handleBackToList = useCallback39(() => {
29798
29993
  setSelectedRoom(null);
29799
29994
  setView("list");
29800
29995
  onBackToList?.();
29801
29996
  }, [onBackToList]);
29802
29997
  const renderMessagesContent = () => {
29803
29998
  if (chatError) {
29804
- return /* @__PURE__ */ jsx133("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsxs104("div", { className: "text-center", children: [
29805
- /* @__PURE__ */ jsx133(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro de conexao com o chat" }),
29806
- /* @__PURE__ */ jsx133(Text_default, { size: "xs", className: "text-text-500", children: "Tentando reconectar..." })
29999
+ return /* @__PURE__ */ jsx134("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsxs104("div", { className: "text-center", children: [
30000
+ /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro de conexao com o chat" }),
30001
+ /* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500", children: "Tentando reconectar..." })
29807
30002
  ] }) });
29808
30003
  }
29809
30004
  const userMessages = messages?.filter(
29810
30005
  (message) => message.messageType !== CHAT_MESSAGE_TYPES.SYSTEM
29811
30006
  );
29812
30007
  if (!userMessages?.length) {
29813
- return /* @__PURE__ */ jsx133("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx133(Text_default, { size: "sm", className: "text-text-500", children: "Nenhuma mensagem ainda. Comece a conversa!" }) });
30008
+ return /* @__PURE__ */ jsx134("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-500", children: "Nenhuma mensagem ainda. Comece a conversa!" }) });
29814
30009
  }
29815
- return userMessages.map((message) => /* @__PURE__ */ jsx133(
30010
+ return userMessages.map((message) => /* @__PURE__ */ jsx134(
29816
30011
  MessageBubble,
29817
30012
  {
29818
30013
  message,
@@ -29824,16 +30019,16 @@ function ChatContent({
29824
30019
  const renderRoomList = () => /* @__PURE__ */ jsxs104("div", { className: "flex flex-col h-full", children: [
29825
30020
  /* @__PURE__ */ jsxs104("div", { className: "p-4 border-b border-background-200 flex items-center justify-between", children: [
29826
30021
  /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-3", children: [
29827
- /* @__PURE__ */ jsx133("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: userPhoto ? /* @__PURE__ */ jsx133(
30022
+ /* @__PURE__ */ jsx134("div", { className: "w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center flex-shrink-0", children: userPhoto ? /* @__PURE__ */ jsx134(
29828
30023
  "img",
29829
30024
  {
29830
30025
  src: userPhoto,
29831
30026
  alt: userName,
29832
30027
  className: "w-10 h-10 rounded-full object-cover"
29833
30028
  }
29834
- ) : /* @__PURE__ */ jsx133(Text_default, { size: "sm", weight: "bold", className: "text-primary-600", children: userName.charAt(0).toUpperCase() }) }),
30029
+ ) : /* @__PURE__ */ jsx134(Text_default, { size: "sm", weight: "bold", className: "text-primary-600", children: userName.charAt(0).toUpperCase() }) }),
29835
30030
  /* @__PURE__ */ jsxs104("div", { children: [
29836
- /* @__PURE__ */ jsx133(Text_default, { size: "lg", weight: "bold", className: "text-text-900", children: "Conversas" }),
30031
+ /* @__PURE__ */ jsx134(Text_default, { size: "lg", weight: "bold", className: "text-text-900", children: "Conversas" }),
29837
30032
  /* @__PURE__ */ jsxs104(Text_default, { size: "xs", className: "text-text-500", children: [
29838
30033
  userName,
29839
30034
  " - ",
@@ -29841,37 +30036,37 @@ function ChatContent({
29841
30036
  ] })
29842
30037
  ] })
29843
30038
  ] }),
29844
- /* @__PURE__ */ jsx133(
30039
+ /* @__PURE__ */ jsx134(
29845
30040
  Button_default,
29846
30041
  {
29847
30042
  variant: "solid",
29848
30043
  size: "small",
29849
30044
  onClick: handleOpenCreateModal,
29850
- iconLeft: /* @__PURE__ */ jsx133(PlusIcon, { size: 16 }),
30045
+ iconLeft: /* @__PURE__ */ jsx134(PlusIcon, { size: 16 }),
29851
30046
  children: "Nova conversa"
29852
30047
  }
29853
30048
  )
29854
30049
  ] }),
29855
30050
  /* @__PURE__ */ jsxs104("div", { className: "flex-1 overflow-y-auto p-2", children: [
29856
30051
  roomsError && /* @__PURE__ */ jsxs104("div", { className: "p-4 text-center", children: [
29857
- /* @__PURE__ */ jsx133(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro ao carregar conversas" }),
29858
- /* @__PURE__ */ jsx133(Button_default, { variant: "outline", size: "small", onClick: fetchRooms, children: "Tentar novamente" })
30052
+ /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-red-500 mb-2", children: "Erro ao carregar conversas" }),
30053
+ /* @__PURE__ */ jsx134(Button_default, { variant: "outline", size: "small", onClick: fetchRooms, children: "Tentar novamente" })
29859
30054
  ] }),
29860
- !roomsError && roomsLoading && /* @__PURE__ */ jsx133("div", { className: "space-y-3 p-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-3", children: [
29861
- /* @__PURE__ */ jsx133(SkeletonRounded, { className: "w-10 h-10" }),
30055
+ !roomsError && roomsLoading && /* @__PURE__ */ jsx134("div", { className: "space-y-3 p-2", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-3", children: [
30056
+ /* @__PURE__ */ jsx134(SkeletonRounded, { className: "w-10 h-10" }),
29862
30057
  /* @__PURE__ */ jsxs104("div", { className: "flex-1", children: [
29863
- /* @__PURE__ */ jsx133(SkeletonText, { className: "w-3/4 h-4 mb-2" }),
29864
- /* @__PURE__ */ jsx133(SkeletonText, { className: "w-1/2 h-3" })
30058
+ /* @__PURE__ */ jsx134(SkeletonText, { className: "w-3/4 h-4 mb-2" }),
30059
+ /* @__PURE__ */ jsx134(SkeletonText, { className: "w-1/2 h-3" })
29865
30060
  ] })
29866
30061
  ] }, i)) }),
29867
- !roomsError && !roomsLoading && !rooms?.length && /* @__PURE__ */ jsx133(
30062
+ !roomsError && !roomsLoading && !rooms?.length && /* @__PURE__ */ jsx134(
29868
30063
  EmptyState_default,
29869
30064
  {
29870
30065
  title: "Nenhuma conversa",
29871
30066
  description: "Comece uma nova conversa clicando no botao acima"
29872
30067
  }
29873
30068
  ),
29874
- !roomsError && !roomsLoading && !!rooms?.length && /* @__PURE__ */ jsx133("div", { className: "space-y-1", children: rooms.map((room) => /* @__PURE__ */ jsx133(
30069
+ !roomsError && !roomsLoading && !!rooms?.length && /* @__PURE__ */ jsx134("div", { className: "space-y-1", children: rooms.map((room) => /* @__PURE__ */ jsx134(
29875
30070
  RoomItem,
29876
30071
  {
29877
30072
  room,
@@ -29887,15 +30082,15 @@ function ChatContent({
29887
30082
  return /* @__PURE__ */ jsxs104("div", { className: "flex h-full", children: [
29888
30083
  /* @__PURE__ */ jsxs104("div", { className: "flex-1 flex flex-col", children: [
29889
30084
  /* @__PURE__ */ jsxs104("div", { className: "p-4 border-b border-background-200 flex items-center gap-3", children: [
29890
- /* @__PURE__ */ jsx133(Button_default, { variant: "link", size: "small", onClick: handleBackToList, children: /* @__PURE__ */ jsx133(XIcon, { size: 20 }) }),
30085
+ /* @__PURE__ */ jsx134(Button_default, { variant: "link", size: "small", onClick: handleBackToList, children: /* @__PURE__ */ jsx134(XIcon, { size: 20 }) }),
29891
30086
  /* @__PURE__ */ jsxs104("div", { className: "flex-1", children: [
29892
- /* @__PURE__ */ jsx133(Text_default, { size: "md", weight: "semibold", className: "text-text-900", children: selectedRoom.name }),
29893
- /* @__PURE__ */ jsx133(Text_default, { size: "xs", className: "text-text-500", children: isConnected ? "Conectado" : "Conectando..." })
30087
+ /* @__PURE__ */ jsx134(Text_default, { size: "md", weight: "semibold", className: "text-text-900", children: selectedRoom.name }),
30088
+ /* @__PURE__ */ jsx134(Text_default, { size: "xs", className: "text-text-500", children: isConnected ? "Conectado" : "Conectando..." })
29894
30089
  ] })
29895
30090
  ] }),
29896
- /* @__PURE__ */ jsx133("div", { className: "flex-1 overflow-y-auto p-4", children: renderMessagesContent() }),
29897
- /* @__PURE__ */ jsx133("div", { className: "p-4 border-t border-background-200", children: /* @__PURE__ */ jsxs104("div", { className: "flex gap-2", children: [
29898
- /* @__PURE__ */ jsx133(
30091
+ /* @__PURE__ */ jsx134("div", { className: "flex-1 overflow-y-auto p-4", children: renderMessagesContent() }),
30092
+ /* @__PURE__ */ jsx134("div", { className: "p-4 border-t border-background-200", children: /* @__PURE__ */ jsxs104("div", { className: "flex gap-2", children: [
30093
+ /* @__PURE__ */ jsx134(
29899
30094
  Input_default,
29900
30095
  {
29901
30096
  placeholder: "Digite sua mensagem...",
@@ -29910,13 +30105,13 @@ function ChatContent({
29910
30105
  className: "flex-1"
29911
30106
  }
29912
30107
  ),
29913
- /* @__PURE__ */ jsx133(
30108
+ /* @__PURE__ */ jsx134(
29914
30109
  Button_default,
29915
30110
  {
29916
30111
  variant: "solid",
29917
30112
  onClick: handleSendMessage,
29918
30113
  disabled: !messageInput.trim() || !isConnected,
29919
- children: /* @__PURE__ */ jsx133(PaperPlaneTiltIcon2, { size: 20 })
30114
+ children: /* @__PURE__ */ jsx134(PaperPlaneTiltIcon2, { size: 20 })
29920
30115
  }
29921
30116
  )
29922
30117
  ] }) })
@@ -29927,7 +30122,7 @@ function ChatContent({
29927
30122
  participants?.length ?? 0,
29928
30123
  ")"
29929
30124
  ] }),
29930
- /* @__PURE__ */ jsx133("div", { className: "space-y-1", children: participants?.map((participant) => /* @__PURE__ */ jsx133(
30125
+ /* @__PURE__ */ jsx134("div", { className: "space-y-1", children: participants?.map((participant) => /* @__PURE__ */ jsx134(
29931
30126
  ParticipantItem,
29932
30127
  {
29933
30128
  participant
@@ -29947,20 +30142,20 @@ function ChatContent({
29947
30142
  children: [
29948
30143
  view === "list" && renderRoomList(),
29949
30144
  view === "room" && renderChatRoom(),
29950
- /* @__PURE__ */ jsx133(
30145
+ /* @__PURE__ */ jsx134(
29951
30146
  Modal_default,
29952
30147
  {
29953
30148
  isOpen: showCreateModal,
29954
30149
  onClose: () => setShowCreateModal(false),
29955
30150
  title: "Nova conversa",
29956
30151
  children: /* @__PURE__ */ jsxs104("div", { className: "p-4", children: [
29957
- /* @__PURE__ */ jsx133(Text_default, { size: "sm", className: "text-text-600 mb-4", children: "Selecione os participantes para iniciar uma conversa" }),
29958
- roomsLoading && /* @__PURE__ */ jsx133("div", { className: "space-y-3", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-3", children: [
29959
- /* @__PURE__ */ jsx133(SkeletonRounded, { className: "w-10 h-10" }),
29960
- /* @__PURE__ */ jsx133(SkeletonText, { className: "flex-1 h-4" })
30152
+ /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-600 mb-4", children: "Selecione os participantes para iniciar uma conversa" }),
30153
+ roomsLoading && /* @__PURE__ */ jsx134("div", { className: "space-y-3", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs104("div", { className: "flex items-center gap-3", children: [
30154
+ /* @__PURE__ */ jsx134(SkeletonRounded, { className: "w-10 h-10" }),
30155
+ /* @__PURE__ */ jsx134(SkeletonText, { className: "flex-1 h-4" })
29961
30156
  ] }, i)) }),
29962
- !roomsLoading && !availableUsers?.length && /* @__PURE__ */ jsx133(Text_default, { size: "sm", className: "text-text-500 text-center py-4", children: "Nenhum usuario disponivel para chat" }),
29963
- !roomsLoading && !!availableUsers?.length && /* @__PURE__ */ jsx133(
30157
+ !roomsLoading && !availableUsers?.length && /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-500 text-center py-4", children: "Nenhum usuario disponivel para chat" }),
30158
+ !roomsLoading && !!availableUsers?.length && /* @__PURE__ */ jsx134(
29964
30159
  UserSelector,
29965
30160
  {
29966
30161
  users: availableUsers,
@@ -29969,8 +30164,8 @@ function ChatContent({
29969
30164
  }
29970
30165
  ),
29971
30166
  /* @__PURE__ */ jsxs104("div", { className: "flex justify-end gap-2 mt-6", children: [
29972
- /* @__PURE__ */ jsx133(Button_default, { variant: "outline", onClick: () => setShowCreateModal(false), children: "Cancelar" }),
29973
- /* @__PURE__ */ jsx133(
30167
+ /* @__PURE__ */ jsx134(Button_default, { variant: "outline", onClick: () => setShowCreateModal(false), children: "Cancelar" }),
30168
+ /* @__PURE__ */ jsx134(
29974
30169
  Button_default,
29975
30170
  {
29976
30171
  variant: "solid",
@@ -29989,9 +30184,9 @@ function ChatContent({
29989
30184
  }
29990
30185
 
29991
30186
  // src/components/Chat/ChatLoading.tsx
29992
- import { jsx as jsx134 } from "react/jsx-runtime";
30187
+ import { jsx as jsx135 } from "react/jsx-runtime";
29993
30188
  function ChatLoading() {
29994
- return /* @__PURE__ */ jsx134("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ jsx134(Text_default, { size: "sm", className: "text-text-500", children: "Carregando..." }) });
30189
+ return /* @__PURE__ */ jsx135("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ jsx135(Text_default, { size: "sm", className: "text-text-500", children: "Carregando..." }) });
29995
30190
  }
29996
30191
 
29997
30192
  // src/utils/chatUtils.ts
@@ -30040,7 +30235,7 @@ var CalendarActivityStatus = /* @__PURE__ */ ((CalendarActivityStatus2) => {
30040
30235
  })(CalendarActivityStatus || {});
30041
30236
 
30042
30237
  // src/hooks/useSendActivity.ts
30043
- import { useState as useState59, useCallback as useCallback39, useMemo as useMemo33, useRef as useRef37 } from "react";
30238
+ import { useState as useState60, useCallback as useCallback40, useMemo as useMemo33, useRef as useRef37 } from "react";
30044
30239
  import dayjs8 from "dayjs";
30045
30240
  function transformToCategoryConfig(data) {
30046
30241
  return [
@@ -30095,13 +30290,13 @@ function useSendActivity(config) {
30095
30290
  onSuccess,
30096
30291
  onError
30097
30292
  } = config;
30098
- const [isOpen, setIsOpen] = useState59(false);
30099
- const [selectedModel, setSelectedModel] = useState59(
30293
+ const [isOpen, setIsOpen] = useState60(false);
30294
+ const [selectedModel, setSelectedModel] = useState60(
30100
30295
  null
30101
30296
  );
30102
- const [categories, setCategories] = useState59([]);
30103
- const [isLoading, setIsLoading] = useState59(false);
30104
- const [isCategoriesLoading, setIsCategoriesLoading] = useState59(false);
30297
+ const [categories, setCategories] = useState60([]);
30298
+ const [isLoading, setIsLoading] = useState60(false);
30299
+ const [isCategoriesLoading, setIsCategoriesLoading] = useState60(false);
30105
30300
  const categoriesLoadedRef = useRef37(false);
30106
30301
  const initialData = useMemo33(() => {
30107
30302
  if (!selectedModel) return void 0;
@@ -30109,7 +30304,7 @@ function useSendActivity(config) {
30109
30304
  title: selectedModel.title
30110
30305
  };
30111
30306
  }, [selectedModel]);
30112
- const loadCategories = useCallback39(async () => {
30307
+ const loadCategories = useCallback40(async () => {
30113
30308
  if (categoriesLoadedRef.current) return;
30114
30309
  setIsCategoriesLoading(true);
30115
30310
  try {
@@ -30124,7 +30319,7 @@ function useSendActivity(config) {
30124
30319
  setIsCategoriesLoading(false);
30125
30320
  }
30126
30321
  }, [fetchCategories, onError]);
30127
- const openModal = useCallback39(
30322
+ const openModal = useCallback40(
30128
30323
  (model) => {
30129
30324
  setSelectedModel(model);
30130
30325
  setIsOpen(true);
@@ -30132,17 +30327,17 @@ function useSendActivity(config) {
30132
30327
  },
30133
30328
  [loadCategories]
30134
30329
  );
30135
- const closeModal = useCallback39(() => {
30330
+ const closeModal = useCallback40(() => {
30136
30331
  setIsOpen(false);
30137
30332
  setSelectedModel(null);
30138
30333
  }, []);
30139
- const onCategoriesChange = useCallback39(
30334
+ const onCategoriesChange = useCallback40(
30140
30335
  (updatedCategories) => {
30141
30336
  setCategories(updatedCategories);
30142
30337
  },
30143
30338
  []
30144
30339
  );
30145
- const handleSubmit = useCallback39(
30340
+ const handleSubmit = useCallback40(
30146
30341
  async (data) => {
30147
30342
  if (!selectedModel) return;
30148
30343
  setIsLoading(true);
@@ -30250,6 +30445,7 @@ export {
30250
30445
  CorrectActivityModal_default as CorrectActivityModal,
30251
30446
  CreateActivity,
30252
30447
  DEFAULT_ACTIVITIES_PAGINATION,
30448
+ DEFAULT_GOAL_DRAFTS_PAGINATION,
30253
30449
  DEFAULT_GOAL_MODELS_PAGINATION,
30254
30450
  DEFAULT_MODELS_PAGINATION,
30255
30451
  DIFFICULTY_LEVEL_ENUM,
@@ -30273,6 +30469,7 @@ export {
30273
30469
  BadgeActionType as GoalBadgeActionType,
30274
30470
  GenericDisplayStatus as GoalDisplayStatus,
30275
30471
  GoalDraftType,
30472
+ GoalDraftsTab,
30276
30473
  GoalPageTab,
30277
30474
  IconButton_default as IconButton,
30278
30475
  IconRender_default as IconRender,
@@ -30394,6 +30591,7 @@ export {
30394
30591
  createActivitiesHistoryHook,
30395
30592
  createActivityFiltersDataHook,
30396
30593
  createActivityModelsHook,
30594
+ createGoalDraftsHook,
30397
30595
  createGoalModelsHook,
30398
30596
  createNotificationStore,
30399
30597
  createNotificationsHook,
@@ -30406,6 +30604,7 @@ export {
30406
30604
  createUseActivityModels,
30407
30605
  createUseChat,
30408
30606
  createUseChatRooms,
30607
+ createUseGoalDrafts,
30409
30608
  createUseGoalModels,
30410
30609
  createUseNotificationStore,
30411
30610
  createUseNotifications,
@@ -30452,6 +30651,7 @@ export {
30452
30651
  goalModelsApiResponseSchema,
30453
30652
  goalsHistoryApiResponseSchema,
30454
30653
  handleActivityFetchError,
30654
+ handleGoalDraftFetchError,
30455
30655
  handleGoalFetchError,
30456
30656
  handleGoalModelFetchError,
30457
30657
  handleLessonDetailsFetchError,