"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
const getDefaultZIndex = require("../../core/utils/get-default-z-index/get-default-z-index.cjs");
const createVarsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const useStyles = require("../../core/styles-api/use-styles/use-styles.cjs");
const Box = require("../../core/Box/Box.cjs");
const factory = require("../../core/factory/factory.cjs");
const AppShell_context = require("./AppShell.context.cjs");
const AppShellAside = require("./AppShellAside/AppShellAside.cjs");
const AppShellFooter = require("./AppShellFooter/AppShellFooter.cjs");
const AppShellHeader = require("./AppShellHeader/AppShellHeader.cjs");
const AppShellMain = require("./AppShellMain/AppShellMain.cjs");
const AppShellMediaStyles = require("./AppShellMediaStyles/AppShellMediaStyles.cjs");
const AppShellNavbar = require("./AppShellNavbar/AppShellNavbar.cjs");
const AppShellSection = require("./AppShellSection/AppShellSection.cjs");
const useResizing = require("./use-resizing/use-resizing.cjs");
const AppShell_module_css = require("./AppShell.module.css.cjs");
const defaultProps = {
  withBorder: true,
  padding: 0,
  transitionDuration: 200,
  transitionTimingFunction: "ease",
  zIndex: getDefaultZIndex.getDefaultZIndex("app")
};
const varsResolver = createVarsResolver.createVarsResolver(
  (_, { transitionDuration, transitionTimingFunction }) => ({
    root: {
      "--app-shell-transition-duration": `${transitionDuration}ms`,
      "--app-shell-transition-timing-function": transitionTimingFunction
    }
  })
);
const AppShell = factory.factory((_props, ref) => {
  const props = useProps.useProps("AppShell", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    navbar,
    withBorder,
    padding,
    transitionDuration,
    transitionTimingFunction,
    header,
    zIndex,
    layout,
    disabled,
    aside,
    footer,
    offsetScrollbars = layout !== "alt",
    mod,
    ...others
  } = props;
  const getStyles = useStyles.useStyles({
    name: "AppShell",
    classes: AppShell_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver
  });
  const resizing = useResizing.useResizing({ disabled, transitionDuration });
  return /* @__PURE__ */ jsxRuntime.jsxs(AppShell_context.AppShellProvider, { value: { getStyles, withBorder, zIndex, disabled, offsetScrollbars }, children: [
    /* @__PURE__ */ jsxRuntime.jsx(
      AppShellMediaStyles.AppShellMediaStyles,
      {
        navbar,
        header,
        aside,
        footer,
        padding
      }
    ),
    /* @__PURE__ */ jsxRuntime.jsx(
      Box.Box,
      {
        ref,
        ...getStyles("root"),
        mod: [{ resizing, layout, disabled }, mod],
        ...others
      }
    )
  ] });
});
AppShell.classes = AppShell_module_css.default;
AppShell.displayName = "@mantine/core/AppShell";
AppShell.Navbar = AppShellNavbar.AppShellNavbar;
AppShell.Header = AppShellHeader.AppShellHeader;
AppShell.Main = AppShellMain.AppShellMain;
AppShell.Aside = AppShellAside.AppShellAside;
AppShell.Footer = AppShellFooter.AppShellFooter;
AppShell.Section = AppShellSection.AppShellSection;
exports.AppShell = AppShell;
