// (C) 2022-2026 GoodData Corporation
import { useDashboardScheduledExportFilters } from "./useDashboardScheduledExportFilters.js";
import { useWidgetScheduledExportFilters } from "./useWidgetScheduledExportFilters.js";
/**
 * Returns filters for scheduled export.
 *
 * If scheduledExportToEdit is provided, it returns its saved filters as is.
 * If scheduledExportToEdit is not provided, it returns sanitized filters ready to be saved in new scheduled export.
 *
 * @deprecated - can be removed, once `enableAutomationFilterContext` is removed
 * @alpha
 */
export const useScheduledExportFilters = ({ scheduledExportToEdit, widget, insight, }) => {
    const { result: widgetFilters, error: widgetFiltersError, status, } = useWidgetScheduledExportFilters({ scheduledExportToEdit, widget, insight });
    const dashboardFilters = useDashboardScheduledExportFilters({ scheduledExportToEdit });
    const widgetFiltersLoading = widget ? status === "pending" || status === "running" : false;
    return {
        widgetFilters,
        widgetFiltersLoading,
        widgetFiltersError,
        dashboardFilters,
    };
};
//# sourceMappingURL=useScheduledExportFilters.js.map