"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/hooks/useRecommendedLessonsPage.ts
var useRecommendedLessonsPage_exports = {};
__export(useRecommendedLessonsPage_exports, {
  createRecommendedLessonsPageHook: () => createRecommendedLessonsPageHook,
  createUseRecommendedLessonsPage: () => createUseRecommendedLessonsPage
});
module.exports = __toCommonJS(useRecommendedLessonsPage_exports);
var import_react2 = require("react");

// src/utils/categoryDataUtils.ts
async function fetchStudentsByFilters(apiClient, filters) {
  if ((!filters.schoolIds || filters.schoolIds.length === 0) && (!filters.schoolYearIds || filters.schoolYearIds.length === 0) && (!filters.classIds || filters.classIds.length === 0)) {
    return [];
  }
  const response = await apiClient.post("/students/filters", {
    ...filters.schoolIds && filters.schoolIds.length > 0 && {
      schoolIds: filters.schoolIds
    },
    ...filters.schoolYearIds && filters.schoolYearIds.length > 0 && {
      schoolYearIds: filters.schoolYearIds
    },
    ...filters.classIds && filters.classIds.length > 0 && {
      classIds: filters.classIds
    }
  });
  return response.data.data.students || [];
}
async function loadCategoriesData(apiClient, existingCategories) {
  if (existingCategories.length > 0) {
    return existingCategories;
  }
  const [schoolsResponse, schoolYearsResponse, classesResponse] = await Promise.all([
    apiClient.get(
      "/school"
    ),
    apiClient.get("/schoolYear"),
    apiClient.get("/classes")
  ]);
  const schools = schoolsResponse.data.data.schools;
  const schoolYears = schoolYearsResponse.data.data.schoolYears;
  const classes = classesResponse.data.data.classes;
  const transformedCategories = [
    {
      key: "escola",
      label: "Escola",
      itens: schools.map((s) => ({ id: s.id, name: s.companyName })),
      selectedIds: []
    },
    {
      key: "serie",
      label: "S\xE9rie",
      dependsOn: ["escola"],
      filteredBy: [{ key: "escola", internalField: "schoolId" }],
      itens: schoolYears.map((sy) => ({
        id: sy.id,
        name: sy.name,
        schoolId: sy.schoolId
      })),
      selectedIds: []
    },
    {
      key: "turma",
      label: "Turma",
      dependsOn: ["serie"],
      filteredBy: [{ key: "serie", internalField: "schoolYearId" }],
      itens: classes.map((c) => ({
        id: c.id,
        name: c.name,
        schoolYearId: c.schoolYearId
      })),
      selectedIds: []
    },
    {
      key: "students",
      label: "Alunos",
      dependsOn: ["turma"],
      filteredBy: [
        { key: "escola", internalField: "escolaId" },
        { key: "serie", internalField: "serieId" },
        { key: "turma", internalField: "turmaId" }
      ],
      // Students will be loaded dynamically based on selections
      itens: [],
      selectedIds: []
    }
  ];
  return transformedCategories;
}

// src/utils/useDynamicStudentFetching.ts
var import_react = require("react");
function extractSelectedIds(updatedCategories) {
  const escolaCategory = updatedCategories.find((c) => c.key === "escola");
  const serieCategory = updatedCategories.find((c) => c.key === "serie");
  const turmaCategory = updatedCategories.find((c) => c.key === "turma");
  const studentsCategory = updatedCategories.find((c) => c.key === "students");
  return {
    schoolIds: escolaCategory?.selectedIds || [],
    schoolYearIds: serieCategory?.selectedIds || [],
    classIds: turmaCategory?.selectedIds || [],
    studentsCategory
  };
}
function detectSelectionChanges(previousSelections, currentSelections) {
  const isInitialState = previousSelections.schoolIds.length === 0 && previousSelections.schoolYearIds.length === 0 && previousSelections.classIds.length === 0;
  const arraysEqual = (a, b) => {
    if (a.length !== b.length) return false;
    return a.every((id) => b.includes(id)) && b.every((id) => a.includes(id));
  };
  const schoolIdsChanged = isInitialState || !arraysEqual(previousSelections.schoolIds, currentSelections.schoolIds);
  const schoolYearIdsChanged = isInitialState || !arraysEqual(
    previousSelections.schoolYearIds,
    currentSelections.schoolYearIds
  );
  const classIdsChanged = isInitialState || !arraysEqual(previousSelections.classIds, currentSelections.classIds);
  const shouldFetchStudents = schoolIdsChanged || schoolYearIdsChanged || classIdsChanged;
  return {
    schoolIdsChanged,
    schoolYearIdsChanged,
    classIdsChanged,
    shouldFetchStudents
  };
}
function transformStudentsToItems(students) {
  return students.map((s) => ({
    id: `${s.userInstitutionId}-${s.class.id}`,
    name: s.name,
    classId: String(s.class.id),
    schoolId: String(s.school.id),
    schoolYearId: String(s.schoolYear.id),
    studentId: s.id,
    userInstitutionId: s.userInstitutionId,
    escolaId: String(s.school.id),
    serieId: String(s.schoolYear.id),
    turmaId: String(s.class.id)
  }));
}
function updateCategoriesWithStudents(updatedCategories, studentItems) {
  return updatedCategories.map(
    (cat) => cat.key === "students" ? { ...cat, itens: studentItems } : cat
  );
}
function clearStudentsFromCategories(updatedCategories) {
  return updatedCategories.map(
    (cat) => cat.key === "students" ? { ...cat, itens: [] } : cat
  );
}
function useDynamicStudentFetching(setCategories, options = {}) {
  const {
    apiClient,
    fetchStudentsByFilters: customFetchStudents,
    onError
  } = options;
  const previousSelectionsRef = (0, import_react.useRef)({
    schoolIds: [],
    schoolYearIds: [],
    classIds: []
  });
  const fetchRequestId = (0, import_react.useRef)(0);
  const buildStudentFilters = (0, import_react.useCallback)(
    (selectedSchoolIds, selectedSchoolYearIds, selectedClassIds) => ({
      schoolIds: selectedSchoolIds.length > 0 ? selectedSchoolIds : void 0,
      schoolYearIds: selectedSchoolYearIds.length > 0 ? selectedSchoolYearIds : void 0,
      classIds: selectedClassIds.length > 0 ? selectedClassIds : void 0
    }),
    []
  );
  const fetchWithCustomFunction = (0, import_react.useCallback)(
    async (selectedSchoolIds, selectedSchoolYearIds, selectedClassIds, localRequestId) => {
      if (!customFetchStudents) {
        return null;
      }
      const filters = buildStudentFilters(
        selectedSchoolIds,
        selectedSchoolYearIds,
        selectedClassIds
      );
      const students = await customFetchStudents(filters);
      if (localRequestId !== fetchRequestId.current) {
        return null;
      }
      return students;
    },
    [customFetchStudents, buildStudentFilters]
  );
  const fetchWithApiClient = (0, import_react.useCallback)(
    async (selectedSchoolIds, selectedSchoolYearIds, selectedClassIds, localRequestId) => {
      if (!apiClient) {
        return null;
      }
      const filters = buildStudentFilters(
        selectedSchoolIds,
        selectedSchoolYearIds,
        selectedClassIds
      );
      const students = await fetchStudentsByFilters(apiClient, filters);
      if (localRequestId !== fetchRequestId.current) {
        return null;
      }
      return students;
    },
    [apiClient, buildStudentFilters]
  );
  const performStudentFetch = (0, import_react.useCallback)(
    async (selectedSchoolIds, selectedSchoolYearIds, selectedClassIds, localRequestId) => {
      const students = await fetchWithCustomFunction(
        selectedSchoolIds,
        selectedSchoolYearIds,
        selectedClassIds,
        localRequestId
      );
      if (students !== null) {
        return students;
      }
      return fetchWithApiClient(
        selectedSchoolIds,
        selectedSchoolYearIds,
        selectedClassIds,
        localRequestId
      );
    },
    [fetchWithCustomFunction, fetchWithApiClient]
  );
  const handleSuccessfulFetch = (0, import_react.useCallback)(
    (students, updatedCategories, localRequestId) => {
      if (localRequestId !== fetchRequestId.current) {
        return false;
      }
      const studentItems = transformStudentsToItems(students);
      const finalCategories = updateCategoriesWithStudents(
        updatedCategories,
        studentItems
      );
      setCategories(finalCategories);
      return true;
    },
    [setCategories]
  );
  const handleFetchError = (0, import_react.useCallback)(
    (error, updatedCategories, localRequestId) => {
      console.error("Error fetching students:", error);
      if (onError && error instanceof Error) {
        onError(error);
      }
      if (localRequestId !== fetchRequestId.current) {
        return false;
      }
      const finalCategories = clearStudentsFromCategories(updatedCategories);
      setCategories(finalCategories);
      return true;
    },
    [onError, setCategories]
  );
  const handleCategoriesChange = (0, import_react.useCallback)(
    async (updatedCategories) => {
      if (!customFetchStudents && !apiClient) {
        setCategories(updatedCategories);
        return;
      }
      const {
        schoolIds: selectedSchoolIds,
        schoolYearIds: selectedSchoolYearIds,
        classIds: selectedClassIds,
        studentsCategory
      } = extractSelectedIds(updatedCategories);
      const previousSelections = previousSelectionsRef.current;
      const { shouldFetchStudents } = detectSelectionChanges(
        previousSelections,
        {
          schoolIds: selectedSchoolIds,
          schoolYearIds: selectedSchoolYearIds,
          classIds: selectedClassIds
        }
      );
      previousSelectionsRef.current = {
        schoolIds: [...selectedSchoolIds],
        schoolYearIds: [...selectedSchoolYearIds],
        classIds: [...selectedClassIds]
      };
      if (shouldFetchStudents && selectedClassIds.length > 0 && studentsCategory) {
        fetchRequestId.current += 1;
        const localRequestId = fetchRequestId.current;
        try {
          const students = await performStudentFetch(
            selectedSchoolIds,
            selectedSchoolYearIds,
            selectedClassIds,
            localRequestId
          );
          if (students === null) {
            return;
          }
          handleSuccessfulFetch(students, updatedCategories, localRequestId);
        } catch (error) {
          handleFetchError(error, updatedCategories, localRequestId);
        }
      } else if (shouldFetchStudents && studentsCategory) {
        fetchRequestId.current += 1;
        const finalCategories = clearStudentsFromCategories(updatedCategories);
        setCategories(finalCategories);
      } else {
        setCategories(updatedCategories);
      }
    },
    [
      apiClient,
      customFetchStudents,
      setCategories,
      performStudentFetch,
      handleSuccessfulFetch,
      handleFetchError
    ]
  );
  return {
    handleCategoriesChange
  };
}

// src/hooks/useRecommendedLessonsPage.ts
var buildQueryParams = (filters) => {
  if (!filters) return {};
  const params = {};
  for (const key in filters) {
    const value = filters[key];
    if (value !== void 0 && value !== null) {
      if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
        params[key] = value;
      }
    }
  }
  return params;
};
var getSchoolOptions = (userData) => {
  if (!userData?.userInstitutions) return [];
  const schoolMap = /* @__PURE__ */ new Map();
  userData.userInstitutions.forEach((inst) => {
    if (inst.school?.id && inst.school?.name) {
      schoolMap.set(inst.school.id, inst.school.name);
    }
  });
  return Array.from(schoolMap.entries()).map(([id, name]) => ({ id, name }));
};
var getClassOptions = (userData) => {
  if (!userData?.userInstitutions) return [];
  const classMap = /* @__PURE__ */ new Map();
  userData.userInstitutions.forEach((inst) => {
    if (inst.class?.id && inst.class?.name) {
      classMap.set(inst.class.id, inst.class.name);
    }
  });
  return Array.from(classMap.entries()).map(([id, name]) => ({ id, name }));
};
var getSubjectOptions = (userData) => {
  if (!userData?.subTeacherTopicClasses) return [];
  const subjectMap = /* @__PURE__ */ new Map();
  userData.subTeacherTopicClasses.forEach((stc) => {
    if (stc.subject?.id && stc.subject?.name) {
      subjectMap.set(stc.subject.id, stc.subject.name);
    }
  });
  return Array.from(subjectMap.entries()).map(([id, name]) => ({ id, name }));
};
var getSchoolYearOptions = (userData) => {
  if (!userData?.userInstitutions) return [];
  const yearMap = /* @__PURE__ */ new Map();
  userData.userInstitutions.forEach((inst) => {
    if (inst.schoolYear?.id && inst.schoolYear?.name) {
      yearMap.set(inst.schoolYear.id, inst.schoolYear.name);
    }
  });
  return Array.from(yearMap.entries()).map(([id, name]) => ({ id, name }));
};
var toFilterArray = (m) => Array.from(m.entries()).map(([id, name]) => ({ id, name }));
var collectBreakdownData = (b, schoolMap, classMap, schoolYearMap) => {
  if (b.schoolId && b.schoolName) {
    schoolMap.set(b.schoolId, b.schoolName);
  }
  if (b.classId && b.className) {
    classMap.set(b.classId, b.className);
  }
  if (b.schoolYearId && b.schoolYearName) {
    schoolYearMap.set(b.schoolYearId, b.schoolYearName);
  }
};
var extractMapsFromItems = (items) => {
  const schoolMap = /* @__PURE__ */ new Map();
  const classMap = /* @__PURE__ */ new Map();
  const subjectMap = /* @__PURE__ */ new Map();
  const schoolYearMap = /* @__PURE__ */ new Map();
  for (const item of items) {
    if (item.subject?.id && item.subject?.name) {
      subjectMap.set(item.subject.id, item.subject.name);
    }
    for (const b of item.breakdown) {
      collectBreakdownData(b, schoolMap, classMap, schoolYearMap);
    }
  }
  return { schoolMap, classMap, subjectMap, schoolYearMap };
};
var extractSubjectsFromDraftItems = (drafts) => {
  const subjectMap = /* @__PURE__ */ new Map();
  for (const draft of drafts) {
    if (draft.subject?.id && draft.subject?.name) {
      subjectMap.set(draft.subject.id, draft.subject.name);
    }
  }
  return Array.from(subjectMap.entries()).map(([id, name]) => ({ id, name }));
};
var hasMapChanged = (merged, prev) => {
  if (merged.size !== prev.length) return true;
  return prev.some((item) => merged.get(item.id) !== item.name);
};
var mergeFilterData = (prev, maps) => {
  const mergedSchools = new Map([
    ...prev.schools.map((s) => [s.id, s.name]),
    ...maps.schoolMap
  ]);
  const mergedClasses = new Map([
    ...prev.classes.map((c) => [c.id, c.name]),
    ...maps.classMap
  ]);
  const mergedSubjects = new Map([
    ...prev.subjects.map((s) => [s.id, s.name]),
    ...maps.subjectMap
  ]);
  const mergedSchoolYears = new Map([
    ...prev.schoolYears.map((y) => [y.id, y.name]),
    ...maps.schoolYearMap
  ]);
  if (!hasMapChanged(mergedSchools, prev.schools) && !hasMapChanged(mergedClasses, prev.classes) && !hasMapChanged(mergedSubjects, prev.subjects) && !hasMapChanged(mergedSchoolYears, prev.schoolYears)) {
    return prev;
  }
  return {
    schools: toFilterArray(mergedSchools),
    classes: toFilterArray(mergedClasses),
    subjects: toFilterArray(mergedSubjects),
    schoolYears: toFilterArray(mergedSchoolYears)
  };
};
var mergeFilterOptions = (base, extra) => {
  if (extra.length === 0) return base;
  const baseIds = new Set(base.map((item) => item.id));
  const hasNew = extra.some((item) => !baseIds.has(item.id));
  if (!hasNew) return base;
  const map = new Map(base.map((item) => [item.id, item.name]));
  extra.forEach((item) => {
    if (!map.has(item.id)) {
      map.set(item.id, item.name);
    }
  });
  return Array.from(map.entries()).map(([id, name]) => ({ id, name }));
};
var createUseRecommendedLessonsPage = (config) => {
  const {
    api,
    navigate,
    userData,
    paths,
    endpoints,
    texts,
    emptyStateImage,
    noSearchImage,
    mapSubjectNameToEnum,
    extraFilterCategories
  } = config;
  return () => {
    const recommendedClassMapRef = (0, import_react2.useRef)(/* @__PURE__ */ new Map());
    const [historyFilterData, setHistoryFilterData] = (0, import_react2.useState)(
      {
        schools: [],
        classes: [],
        subjects: [],
        schoolYears: []
      }
    );
    const [sendModalOpen, setSendModalOpen] = (0, import_react2.useState)(false);
    const [selectedModel, setSelectedModel] = (0, import_react2.useState)(null);
    const [sendModalLoading, setSendModalLoading] = (0, import_react2.useState)(false);
    const [sendModalCategories, setSendModalCategories] = (0, import_react2.useState)([]);
    const userFilterData = (0, import_react2.useMemo)(() => {
      const baseSchools = getSchoolOptions(userData);
      const baseClasses = getClassOptions(userData);
      const baseSubjects = getSubjectOptions(userData);
      const baseSchoolYears = getSchoolYearOptions(userData);
      return {
        schools: mergeFilterOptions(baseSchools, historyFilterData.schools),
        classes: mergeFilterOptions(baseClasses, historyFilterData.classes),
        subjects: mergeFilterOptions(baseSubjects, historyFilterData.subjects),
        schoolYears: mergeFilterOptions(
          baseSchoolYears,
          historyFilterData.schoolYears
        )
      };
    }, [userData, historyFilterData]);
    const subjectsMap = (0, import_react2.useMemo)(() => {
      const map = /* @__PURE__ */ new Map();
      userFilterData.subjects.forEach((s) => {
        map.set(s.id, s.name);
      });
      return map;
    }, [userFilterData.subjects]);
    const extractFilterDataFromHistory = (0, import_react2.useCallback)(
      (items) => {
        const maps = extractMapsFromItems(items);
        setHistoryFilterData((prev) => mergeFilterData(prev, maps));
      },
      []
    );
    const fetchRecommendedClassHistory = (0, import_react2.useCallback)(
      async (filters) => {
        const params = buildQueryParams(filters);
        const response = await api.get(
          endpoints.recommendedClassHistory,
          { params }
        );
        const items = response.data.data.recommendedClass;
        items.forEach((item) => {
          recommendedClassMapRef.current.set(item.recommendedClass.id, item);
        });
        extractFilterDataFromHistory(items);
        return response.data;
      },
      [api, endpoints.recommendedClassHistory, extractFilterDataFromHistory]
    );
    const fetchRecommendedClassModels = (0, import_react2.useCallback)(
      async (filters) => {
        const params = buildQueryParams({
          ...filters,
          type: "MODELO" /* MODELO */
        });
        const response = await api.get(
          endpoints.recommendedClassDrafts,
          { params }
        );
        const subjects = extractSubjectsFromDraftItems(
          response.data.data.drafts
        );
        if (subjects.length > 0) {
          setHistoryFilterData((prev) => ({
            ...prev,
            subjects: mergeFilterOptions(prev.subjects, subjects)
          }));
        }
        return response.data;
      },
      [api, endpoints.recommendedClassDrafts]
    );
    const deleteRecommendedClassModel = (0, import_react2.useCallback)(
      async (id) => {
        await api.delete(`${endpoints.recommendedClassDrafts}/${id}`);
      },
      [api, endpoints.recommendedClassDrafts]
    );
    const fetchRecommendedClassDrafts = (0, import_react2.useCallback)(
      async (filters) => {
        const params = buildQueryParams({
          ...filters,
          type: "RASCUNHO" /* RASCUNHO */
        });
        const response = await api.get(
          endpoints.recommendedClassDrafts,
          { params }
        );
        const subjects = extractSubjectsFromDraftItems(
          response.data.data.drafts
        );
        if (subjects.length > 0) {
          setHistoryFilterData((prev) => ({
            ...prev,
            subjects: mergeFilterOptions(prev.subjects, subjects)
          }));
        }
        return response.data;
      },
      [api, endpoints.recommendedClassDrafts]
    );
    const deleteRecommendedClassDraft = (0, import_react2.useCallback)(
      async (id) => {
        await api.delete(`${endpoints.recommendedClassDrafts}/${id}`);
      },
      [api, endpoints.recommendedClassDrafts]
    );
    const handleCreateLesson = (0, import_react2.useCallback)(() => {
      navigate(paths.createLesson);
    }, []);
    const handleCreateModel = (0, import_react2.useCallback)(() => {
      navigate(paths.createModel);
    }, []);
    const handleRowClick = (0, import_react2.useCallback)((row) => {
      const originalData = recommendedClassMapRef.current.get(row.id);
      navigate(`${paths.lessonDetails}/${row.id}`, {
        state: { recommendedClassData: originalData }
      });
    }, []);
    const deleteRecommendedClass = (0, import_react2.useCallback)(
      async (id) => {
        await api.delete(`${endpoints.submitRecommendedClass}/${id}`);
      },
      [api, endpoints.submitRecommendedClass]
    );
    const updateRecommendedClass = (0, import_react2.useCallback)(
      async (id, data) => {
        await api.patch(`${endpoints.submitRecommendedClass}/${id}`, data);
      },
      [api, endpoints.submitRecommendedClass]
    );
    const fetchRecommendedClassById = (0, import_react2.useCallback)(
      async (id) => {
        const response = await api.get(
          `${endpoints.submitRecommendedClass}/${id}`
        );
        return response.data.data;
      },
      [api, endpoints.submitRecommendedClass]
    );
    const handleEditModel = (0, import_react2.useCallback)(
      (model) => {
        navigate(`${paths.editModel}${model.id}`);
      },
      []
    );
    const handleSendLesson = (0, import_react2.useCallback)(
      async (model) => {
        setSelectedModel(model);
        try {
          const categories = await loadCategoriesData(api, []);
          setSendModalCategories(categories);
        } catch (error) {
          console.error("Erro ao carregar destinat\xE1rios:", error);
          setSendModalCategories([]);
        }
        setSendModalOpen(true);
      },
      [api]
    );
    const handleSendLessonSubmit = (0, import_react2.useCallback)(
      async (formData) => {
        if (!selectedModel) return;
        setSendModalLoading(true);
        try {
          const draftResponse = await api.get(`${endpoints.recommendedClassDrafts}/${selectedModel.id}`);
          const draft = draftResponse.data.data;
          const lessonIds = (draft.lessons ?? []).map((lesson, index) => ({
            lessonId: lesson.lessonId,
            sequence: index + 1
          }));
          const activityDraftIds = (draft.activityDrafts ?? []).map(
            (activity, index) => ({
              activityDraftId: activity.activityDraftId,
              sequence: index + 1
            })
          );
          const hasAttachedActivities = activityDraftIds.length > 0;
          await api.post(endpoints.submitRecommendedClass, {
            title: formData.title || selectedModel.title,
            startDate: (/* @__PURE__ */ new Date(
              `${formData.startDate}T${formData.startTime}`
            )).toISOString(),
            finalDate: (/* @__PURE__ */ new Date(
              `${formData.finalDate}T${formData.finalTime}`
            )).toISOString(),
            lessonIds,
            ...hasAttachedActivities && { activityDraftIds },
            targetStudentIds: formData.students.map((s) => s.userInstitutionId),
            ...formData.notification && {
              notification: formData.notification
            },
            ...hasAttachedActivities && {
              canRetry: formData.canRetry ?? false
            }
          });
          setSendModalOpen(false);
          setSelectedModel(null);
        } finally {
          setSendModalLoading(false);
        }
      },
      [
        api,
        endpoints.recommendedClassDrafts,
        endpoints.submitRecommendedClass,
        selectedModel
      ]
    );
    const handleSendModalClose = (0, import_react2.useCallback)(() => {
      setSendModalOpen(false);
      setSelectedModel(null);
    }, []);
    const { handleCategoriesChange } = useDynamicStudentFetching(
      setSendModalCategories,
      { apiClient: api }
    );
    return {
      historyProps: {
        fetchRecommendedClassHistory,
        fetchRecommendedClassModels,
        deleteRecommendedClassModel,
        onCreateLesson: handleCreateLesson,
        onCreateModel: handleCreateModel,
        onRowClick: handleRowClick,
        deleteRecommendedClass,
        updateRecommendedClass,
        fetchRecommendedClassById,
        onEditModel: handleEditModel,
        onSendLesson: handleSendLesson,
        fetchRecommendedClassDrafts,
        deleteRecommendedClassDraft,
        onSendDraft: handleSendLesson,
        onEditDraft: handleEditModel,
        emptyStateImage,
        noSearchImage,
        mapSubjectNameToEnum,
        userFilterData,
        subjectsMap,
        title: texts.title,
        createButtonText: texts.createButtonText,
        searchPlaceholder: texts.searchPlaceholder,
        extraFilterCategories
      },
      modalProps: {
        isOpen: sendModalOpen,
        onClose: handleSendModalClose,
        onSubmit: handleSendLessonSubmit,
        categories: sendModalCategories,
        onCategoriesChange: handleCategoriesChange,
        isLoading: sendModalLoading,
        modalTitle: selectedModel?.title,
        hasAttachedActivities: (selectedModel?.activityDraftsCount ?? 0) > 0
      },
      navigate
    };
  };
};
var createRecommendedLessonsPageHook = createUseRecommendedLessonsPage;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  createRecommendedLessonsPageHook,
  createUseRecommendedLessonsPage
});
//# sourceMappingURL=index.js.map