import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { CancelEditDialog } from "../../cancelEditDialog/CancelEditDialog.js";
import { useCancelEditDialog } from "../../cancelEditDialog/DefaultCancelEditDialog.js";
import { useDeleteDialogProps } from "../../deleteDialog/DefaultDeleteDialog.js";
import { DeleteDialog } from "../../deleteDialog/DeleteDialog.js";
import { ExportCsvDialogProvider } from "../../dialogs/ExportCsvDialogProvider.js";
import { ExportTabularPdfDialogProvider } from "../../dialogs/ExportTabularPdfDialogProvider.js";
import { ExportTemplateDialogProvider } from "../../dialogs/ExportTemplateDialogProvider.js";
import { ExportXlsxDialogProvider } from "../../dialogs/ExportXlsxDialogProvider.js";
import { useFilterBarProps } from "../../filterBar/filterBar/DefaultFilterBar.js";
import { FilterBar } from "../../filterBar/filterBar/FilterBar.js";
import { useKpiDeleteDialogProps } from "../../kpiDeleteDialog/DefaultKpiDeleteDialog.js";
import { KpiDeleteDialog } from "../../kpiDeleteDialog/KpiDeleteDialog.js";
import { useSaveAsDialogProps } from "../../saveAs/DefaultSaveAsDialog/index.js";
import { SaveAsDialog } from "../../saveAs/SaveAsDialog.js";
import { useTopBarProps } from "../../topBar/topBar/DefaultTopBar.js";
import { TopBar } from "../../topBar/topBar/TopBar.js";
import { useWidgetDeleteDialogProps } from "../../widgetDeleteDialog/DefaultWidgetDeleteDialog.js";
import { WidgetDeleteDialog } from "../../widgetDeleteDialog/WidgetDeleteDialog.js";
import { ToastMessages } from "../components/ToastMessages.js";
import { AlertingDialogProvider } from "./AlertingDialogProvider.js";
import { DashboardTabs, useDashboardTabsProps } from "./DashboardTabs.js";
import { DensityDialogProvider } from "./DensityDialogProvider.js";
import { ScheduledEmailDialogProvider } from "./ScheduledEmailDialogProvider.js";
import { SettingsDialogProvider } from "./SettingsDialogProvider.js";
import { ShareDialogDashboardHeader } from "./ShareDialogDashboardHeader.js";
// these wrapper components are here to prevent the whole DashboardHeader from re-rendering whenever some
// of the sub-components' props change. by isolating the hooks more, we make sure only the really changed component re-renders.
function DeleteDialogWrapper() {
    const deleteDialogProps = useDeleteDialogProps();
    return _jsx(DeleteDialog, { ...deleteDialogProps });
}
function WidgetDeleteDialogWrapper() {
    const widgetDeleteDialogProps = useWidgetDeleteDialogProps();
    return _jsx(WidgetDeleteDialog, { ...widgetDeleteDialogProps });
}
function KpiDeleteDialogWrapper() {
    const kpiDeleteDialogProps = useKpiDeleteDialogProps();
    return _jsx(KpiDeleteDialog, { ...kpiDeleteDialogProps });
}
function SaveAsDialogWrapper() {
    const saveAsDialogProps = useSaveAsDialogProps();
    return _jsx(SaveAsDialog, { ...saveAsDialogProps });
}
function TopBarWrapper() {
    const topBarProps = useTopBarProps();
    return _jsx(TopBar, { ...topBarProps });
}
function FilterBarWrapper() {
    const filterBarProps = useFilterBarProps();
    return _jsx(FilterBar, { ...filterBarProps });
}
function CancelEditDialogWrapper() {
    const cancelEditDialogProps = useCancelEditDialog();
    return _jsx(CancelEditDialog, { ...cancelEditDialogProps });
}
export function DashboardTabsWrapper() {
    const dashboardTabsProps = useDashboardTabsProps();
    return _jsx(DashboardTabs, { ...dashboardTabsProps });
}
// split the header parts of the dashboard so that changes to their state
// (e.g. opening email dialog) do not re-render the dashboard body
export function DashboardHeader() {
    return (_jsxs(_Fragment, { children: [
            _jsx(ToastMessages, {}), _jsx(ExportXlsxDialogProvider, {}), _jsx(ExportCsvDialogProvider, {}), _jsx(ExportTabularPdfDialogProvider, {}), _jsx(ExportTemplateDialogProvider, {}), _jsx(ScheduledEmailDialogProvider, {}), _jsx(AlertingDialogProvider, {}), _jsx(ShareDialogDashboardHeader, {}), _jsx(SettingsDialogProvider, {}), _jsx(DensityDialogProvider, {}), _jsx(DeleteDialogWrapper, {}), _jsx(WidgetDeleteDialogWrapper, {}), _jsx(KpiDeleteDialogWrapper, {}), _jsx(SaveAsDialogWrapper, {}), _jsx(TopBarWrapper, {}), _jsx(DashboardTabsWrapper, {}), _jsx(FilterBarWrapper, {}), _jsx(CancelEditDialogWrapper, {})
        ] }));
}
//# sourceMappingURL=DashboardHeader.js.map