import { createTheme } from "@mui/material/styles";
import { darkPalette, futureDarkPalette, futureLightPalette, lightPalette } from "@uipath/apollo-core";
import { darkHighContrastPalette, lightHighContrastPalette } from "@uipath/apollo-core/tokens/jss/palette";
import defaultsDeep from "lodash/defaultsDeep";
import breakpoints from "./breakpoints.js";
import { darkHighContrastOverrides, darkOverrides, futureDarkOverrides, futureLightOverrides, lightHighContrastOverrides, lightOverrides } from "./overrides/index.js";
import spacing from "./spacing.js";
import typography from "./typography.js";
const globalPropOverrides = {
    MuiTextField: {
        defaultProps: {
            InputLabelProps: {
                shrink: true
            }
        }
    },
    MuiButtonBase: {
        defaultProps: {
            disableRipple: true,
            disableTouchRipple: true
        }
    }
};
const getGlobalVariantOverrides = (palette)=>({
        MuiTypography: {
            variants: [
                {
                    props: {
                        color: 'primary'
                    },
                    style: {
                        color: palette.semantic.colorPrimary
                    }
                },
                {
                    props: {
                        color: 'textPrimary'
                    },
                    style: {
                        color: palette.semantic.colorForegroundDeEmp
                    }
                },
                {
                    props: {
                        color: 'textSecondary'
                    },
                    style: {
                        color: palette.semantic.colorForegroundDeEmp
                    }
                }
            ]
        },
        MuiIconButton: {
            variants: [
                {
                    props: {
                        color: 'default'
                    },
                    style: {
                        color: palette.semantic.colorIconDefault
                    }
                }
            ]
        }
    });
const apolloMaterialUiThemeLight = createTheme({
    palette: {
        ...lightPalette,
        mode: 'light'
    },
    spacing: spacing,
    breakpoints: breakpoints,
    components: defaultsDeep(lightOverrides, globalPropOverrides, getGlobalVariantOverrides(lightPalette)),
    typography: typography
});
const apolloMaterialUiThemeLightHC = createTheme({
    palette: {
        ...lightHighContrastPalette,
        mode: 'light'
    },
    spacing: spacing,
    breakpoints: breakpoints,
    components: defaultsDeep(lightHighContrastOverrides, globalPropOverrides, getGlobalVariantOverrides(lightHighContrastPalette)),
    typography: typography
});
const apolloMaterialUiThemeDark = createTheme({
    palette: {
        ...darkPalette,
        mode: 'dark'
    },
    spacing: spacing,
    breakpoints: breakpoints,
    components: defaultsDeep(darkOverrides, globalPropOverrides, getGlobalVariantOverrides(darkPalette)),
    typography: typography
});
const apolloMaterialUiThemeDarkHC = createTheme({
    palette: {
        ...darkHighContrastPalette,
        mode: 'dark'
    },
    spacing: spacing,
    breakpoints: breakpoints,
    components: defaultsDeep(darkHighContrastOverrides, globalPropOverrides, getGlobalVariantOverrides(darkHighContrastPalette)),
    typography: typography
});
const apolloMaterialUiThemeFutureDark = createTheme({
    palette: {
        ...futureDarkPalette,
        mode: 'dark'
    },
    spacing: spacing,
    breakpoints: breakpoints,
    components: defaultsDeep(futureDarkOverrides, globalPropOverrides, getGlobalVariantOverrides(futureDarkPalette)),
    typography: typography
});
const apolloMaterialUiThemeFutureLight = createTheme({
    palette: {
        ...futureLightPalette,
        mode: 'light'
    },
    spacing: spacing,
    breakpoints: breakpoints,
    components: defaultsDeep(futureLightOverrides, globalPropOverrides, getGlobalVariantOverrides(futureLightPalette)),
    typography: typography
});
export { apolloMaterialUiThemeDark, apolloMaterialUiThemeDarkHC, apolloMaterialUiThemeFutureDark, apolloMaterialUiThemeFutureLight, apolloMaterialUiThemeLight, apolloMaterialUiThemeLightHC };
