var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};
import { mergeProps as _mergeProps, createVNode as _createVNode, Fragment as _Fragment } from "vue";
import { isNeedOpenHash, ProConfigProvider, ProProvider } from "@antdv/pro-provider";
import { arrayType, boolType, classNames, funcType, isBrowser, objectType, omit, omitUndefined, oneOfType, stringType, useBreakpoint, useDocumentTitle, useMountMergeState, useRequest, useState, warning } from "@antdv/pro-utils";
import { ConfigProvider, Layout } from "ant-design-vue";
import { useConfigContextInject } from "ant-design-vue/lib/config-provider/context";
import { computed, defineComponent, ref, toRef, watch, watchEffect } from "vue";
import { Logo } from "./assert/Logo.mjs";
import { DefaultFooter as Footer } from "./components/Footer.mjs";
import { DefaultHeader as Header, headerViewProps } from "./components/Header/index.mjs";
import { PageLoading } from "./components/PageLoading/index.mjs";
import { SiderMenu } from "./components/SiderMenu/index.mjs";
import { siderMenuProps } from "./components/SiderMenu/SiderMenu.mjs";
import { RouteContext } from "./context/RouteContext.mjs";
import { defaultSettings } from "./defaultSettings.mjs";
import { getPageTitleInfo } from "./getPageTitle.mjs";
import { gLocaleObject } from "./locales/index.mjs";
import { useStyle } from "./style/index.mjs";
import { getBreadcrumbProps } from "./utils/getBreadcrumbProps.mjs";
import { getMatchMenu } from "./utils/getMatchMenu.mjs";
import { getMenuData } from "./utils/getMenuData.mjs";
import { useCurrentMenuLayoutProps } from "./utils/useCurrentMenuLayoutProps.mjs";
import { clearMenuItem } from "./utils/utils.mjs";
import { WrapContent } from "./WrapContent.mjs";
const globalProps = __spreadValues({}, omit(__spreadProps(__spreadValues(__spreadValues({}, siderMenuProps), headerViewProps()), {
  token: objectType()
}), ["collapsed"]));
const proLayoutProps = __spreadProps(__spreadValues({}, globalProps), {
  stylish: objectType(),
  /** Layout 的品牌配置，表现为一张背景图片 */
  bgLayoutImgList: arrayType(),
  /**
   * @name 简约模式，设置了之后不渲染的任何 layout 的东西，但是会有 context，可以获取到当前菜单。
   *
   * @example pure={true}
   */
  pure: boolType().def(void 0),
  /**
   * @name logo 的配置，可以配置url，React 组件 和 false
   *
   * @example 设置 logo 为网络地址  logo="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4"
   * @example 设置 logo 为组件  logo={<img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4"/>}
   * @example 设置 logo 为 false 不显示 logo  logo={false}
   * */
  logo: oneOfType([Object, Boolean, Array]).def(void 0),
  /**
   * @name 页面切换的时候触发
   *
   * @example 获取切换的页面地址 onPageChange={(location) => { console.log("切换到："+location.pathname) }}
   *
   * */
  onPageChange: funcType(),
  /**
   * @name layout 的 loading 效果，设置完成之后只展示一个 loading
   *
   * @example loading={true}
   */
  loading: boolType(),
  /**
   * @name layout
   *
   * @description "zh-CN" | "zh-TW" | "en-US" | "it-IT" | "ko-KR"
   * @example 中文 layout="zh-CN"
   * @example 英文 layout="en-US"
   */
  locale: stringType(),
  /**
   * @name 是否收起 layout 是严格受控的，可以 设置为 true，一直收起
   *
   * @example collapsed={true}
   */
  collapsed: boolType().def(void 0),
  /**
   * @name 收起和展开的时候触发事件
   *
   * @example onCollapse=(collapsed)=>{ setCollapsed(collapsed) };
   */
  onCollapse: funcType(),
  /**
   * @name 页脚的配置
   *
   * @example 不展示dom footerRender={false}
   * @example 使用 layout 的  DefaultFooter   footerRender={() => (<DefaultFooter copyright="这是一条测试文案"/>}
   */
  footerRender: oneOfType([Function, Boolean]).def(void 0),
  /**
   * @name 设置 PageHeader 的面包屑，只能处理数据
   *
   * @example 手动设置 breadcrumbRender={(routers = []) => [ { path: '/', breadcrumbName: '主页'} ]
   * @example 增加一项 breadcrumbRender={(routers = []) => { return [{ path: '/', breadcrumbName: '主页'} ,...routers ]}
   * @example 删除首页 breadcrumbRender={(routers = []) => { return routers.filter(item => item.path !== '/')}
   * @example 不显示面包屑 breadcrumbRender={false}
   */
  breadcrumbRender: oneOfType([Function, Boolean]).def(void 0),
  /**
   * @name 设置页面的标题
   * @example 根据页面的路由设置标题 pageTitleRender={(props) => { return props.location.pathname }}
   * @example 不显示标题 pageTitleRender={false}
   * @example 根据默认的标题设置 pageTitleRender={(props,defaultPageTitle) => { return defaultPageTitle + '这是一个测试标题' }}
   * @example 根据 info 来自己组合标题 pageTitleRender={(props,defaultPageTitle,info) => { return info.title + "-" + info.pageName }
   */
  pageTitleRender: oneOfType([Function, Boolean]).def(void 0),
  /**
   * @name 处理 menuData 的数据，可以动态的控制数据
   * @see 尽量不要用异步数据来处理，否则可能造成更新不及时，如果异步数据推荐使用 menu.request 和 params。
   *
   * @example 删除一些菜单 menuDataRender=((menuData) => { return menuData.filter(item => item.name !== 'test') })
   * @example 增加一些菜单 menuDataRender={(menuData) => { return menuData.concat({ path: '/test', name: '测试', icon: 'smile' }) }}
   * @example 修改菜单 menuDataRender={(menuData) => { return menuData.map(item => { if (item.name === 'test') { item.name = '测试' } return item }) }}
   * @example 打平数据 menuDataRender={(menuData) => { return menuData.reduce((pre, item) => { return pre.concat(item.children || []) }, []) }}
   */
  menuDataRender: funcType(),
  /**
   * @name 处理每个面包屑的配置，需要直接返回 dom
   * @description (route: Route, params: any, routes: Array<Route>, paths: Array<string>) => React.ReactNode
   *
   * @example 设置 disabled： itemRender={(route, params, routes, paths) => { return <Button disabled>{route.breadcrumbName}</Button> }}
   * @example 拼接 path： itemRender={(route, params, routes, paths) => { return <a href={paths.join('/')}>{route.breadcrumbName}</a> }}
   */
  itemRender: funcType(),
  formatMessage: funcType(),
  /**
   * @name 是否禁用移动端模式
   *
   * @see 有的管理系统不需要移动端模式，此属性设置为true即可
   * @example disableMobile={true}
   *  */
  disableMobile: boolType(),
  /**
   * content 的样式
   *
   * @example 背景颜色为红色 contentStyle={{ backgroundColor: 'red '}}
   */
  contentStyle: objectType(),
  className: stringType(),
  /** PageHeader 的 BreadcrumbProps 配置，会透传下去 */
  breadcrumbProps: objectType(),
  /** @name 水印的相关配置 */
  waterMarkProps: objectType(),
  /**
   * @name  侧边菜单的类型, menu.type 的快捷方式
   * @type "sub" | "group"
   * @example group
   */
  siderMenuType: stringType(),
  isChildrenLayout: boolType()
});
function getPaddingInlineStart(hasLeftPadding, collapsed, siderWidth) {
  if (hasLeftPadding) {
    return collapsed ? 64 : siderWidth;
  }
  return 0;
}
function headerRender(props, matchMenuKeys) {
  var _a;
  if (props.headerRender === false || props.pure) {
    return null;
  }
  return _createVNode(Header, _mergeProps({
    "matchMenuKeys": matchMenuKeys
  }, props, {
    "stylish": (_a = props.stylish) == null ? void 0 : _a.header
  }), null);
}
function footerRender(props) {
  if (props.footerRender === false || props.pure) {
    return null;
  }
  if (props.footerRender) {
    return props.footerRender(__spreadValues({}, props), _createVNode(Footer, null, null));
  }
  return null;
}
function renderSiderMenu(props, matchMenuKeys) {
  var _a, _b, _c, _d;
  const {
    layout,
    isMobile,
    selectedKeys,
    openKeys,
    splitMenus,
    suppressSiderWhenMenuEmpty,
    menuRender,
    onCollapse
  } = props;
  if (props.menuRender === false || props.pure) {
    return null;
  }
  let {
    menuData
  } = props;
  if (splitMenus && (openKeys !== false || layout === "mix") && !isMobile) {
    const [key] = selectedKeys || matchMenuKeys;
    if (key) {
      menuData = ((_b = (_a = props.menuData) == null ? void 0 : _a.find((item) => item.key === key)) == null ? void 0 : _b.children) || [];
    } else {
      menuData = [];
    }
  }
  const clearMenuData = clearMenuItem(menuData || []);
  if (clearMenuData && (clearMenuData == null ? void 0 : clearMenuData.length) < 1 && (splitMenus || suppressSiderWhenMenuEmpty)) {
    return null;
  }
  if (layout === "top" && !isMobile) {
    return _createVNode(SiderMenu, _mergeProps({
      "matchMenuKeys": matchMenuKeys
    }, props, {
      "onCollapse": onCollapse,
      "hide": true,
      "stylish": (_c = props.stylish) == null ? void 0 : _c.sider
    }), null);
  }
  const defaultDom = _createVNode(SiderMenu, _mergeProps({
    "matchMenuKeys": matchMenuKeys
  }, props, {
    "onCollapse": onCollapse,
    "menuData": clearMenuData,
    "stylish": (_d = props.stylish) == null ? void 0 : _d.sider
  }), null);
  if (menuRender) {
    return menuRender(props, defaultDom);
  }
  return defaultDom;
}
const BaseProLayout = defineComponent({
  name: "BaseProLayout",
  props: proLayoutProps,
  inheritAttrs: false,
  setup(props, {
    slots,
    expose
  }) {
    var _a, _b, _c;
    const context = useConfigContextInject();
    const colSize = useBreakpoint();
    const {
      token
    } = ProProvider.useContext();
    const {
      isChildrenLayout: contextIsChildrenLayout
    } = RouteContext.useContext();
    const [hasFooterToolbar, setHasFooterToolbar] = useState(false);
    const [hasPageContainer, setHasPageContainer] = useState(0);
    const prefixCls = computed(() => {
      var _a2;
      return (_a2 = props.prefixCls) != null ? _a2 : context.getPrefixCls("pro");
    });
    const proLayoutClassName = computed(() => `${prefixCls.value}-layout`);
    const {
      wrapSSR,
      hashId
    } = useStyle(proLayoutClassName);
    const [menuLoading, setMenuLoading] = useMountMergeState(false, {
      value: ref((_b = (_a = props.menu) == null ? void 0 : _a.loading) != null ? _b : false),
      onChange: (_c = props.menu) == null ? void 0 : _c.onLoadingChange
    });
    const {
      state,
      execute,
      isLoading
    } = useRequest(() => __async(this, null, function* () {
      var _a2, _b2, _c2, _d, _e;
      setMenuLoading(true);
      const menuDataItems = yield (_e = (_a2 = props.menu) == null ? void 0 : _a2.request) == null ? void 0 : _e.call(_a2, ((_b2 = props.menu) == null ? void 0 : _b2.params) || {}, ((_c2 = props.route) == null ? void 0 : _c2.children) || ((_d = props.route) == null ? void 0 : _d.routes) || []);
      setMenuLoading(false);
      return menuDataItems;
    }), []);
    const formatMessage = (_d) => {
      var _e = _d, {
        id,
        defaultMessage
      } = _e, restParams = __objRest(_e, [
        "id",
        "defaultMessage"
      ]);
      if (props.formatMessage) {
        return props.formatMessage(__spreadValues({
          id,
          defaultMessage
        }, restParams));
      }
      const locales = gLocaleObject();
      return locales[id] ? locales[id] : defaultMessage;
    };
    const isChildrenLayout = computed(() => props.isChildrenLayout !== void 0 ? props.isChildrenLayout : contextIsChildrenLayout);
    const siderWidth = computed(() => {
      if (props.siderWidth) return props.siderWidth;
      if (props.layout === "mix") return 215;
      return 256;
    });
    watchEffect(() => {
      setMenuLoading(isLoading.value);
    });
    const menuInfoData = computed(() => {
      var _a2, _b2;
      return getMenuData(state.value || ((_a2 = props.route) == null ? void 0 : _a2.children) || ((_b2 = props.route) == null ? void 0 : _b2.routes) || [], props.menu, formatMessage, props.menuDataRender);
    });
    const matchMenus = computed(() => {
      var _a2;
      return getMatchMenu(((_a2 = props.location) == null ? void 0 : _a2.pathname) || "/", menuInfoData.value.menuData || [], true);
    });
    const matchMenuKeys = computed(() => Array.from(new Set(matchMenus.value.map((item) => item.key || item.path || ""))));
    const currentMenu = computed(() => {
      return matchMenus.value[matchMenus.value.length - 1] || {};
    });
    const currentMenuLayoutProps = useCurrentMenuLayoutProps(currentMenu);
    const isMobile = computed(() => {
      return (colSize.value === "sm" || colSize.value === "xs") && !props.disableMobile;
    });
    const hasLeftPadding = computed(() => props.layout !== "top" && !isMobile.value);
    const [collapsed, onCollapse] = useMountMergeState(() => {
      if (props.defaultCollapsed !== void 0) return props.defaultCollapsed;
      if (isMobile.value) return true;
      if (colSize.value === "md") return true;
      return false;
    }, {
      value: toRef(props, "collapsed"),
      onChange: props.onCollapse
    });
    const genLayoutStyle = computed(() => {
      const layoutStyle = {
        position: "relative"
      };
      if (isChildrenLayout.value || props.contentStyle && props.contentStyle.minHeight) {
        layoutStyle.minHeight = 0;
      }
      return layoutStyle;
    });
    const getDefaultProps = computed(() => {
      var _a2;
      return omit(__spreadProps(__spreadValues(__spreadProps(__spreadValues({
        // @ts-expect-error
        prefixCls: prefixCls.value
      }, omitUndefined(props)), {
        siderWidth: siderWidth.value
      }), omitUndefined(currentMenuLayoutProps.value)), {
        formatMessage,
        breadcrumb: menuInfoData.value.breadcrumb,
        menu: __spreadProps(__spreadValues({}, props.menu), {
          type: props.siderMenuType || ((_a2 = props.menu) == null ? void 0 : _a2.type),
          loading: menuLoading.value
        }),
        layout: props.layout
      }), ["className", "style", "breadcrumbRender", "isMobile", "collapsed"]);
    });
    const pageTitleInfo = computed(() => {
      var _a2;
      const pageProps = __spreadProps(__spreadValues({
        pathname: ((_a2 = props.location) == null ? void 0 : _a2.pathname) || "/"
      }, getDefaultProps.value), {
        breadcrumbMap: menuInfoData.value.breadcrumbMap
      });
      const _pageTitleInfo = getPageTitleInfo(pageProps);
      if (props.pageTitleRender === false) {
        return {
          title: props.title || "",
          id: "",
          pageName: ""
        };
      }
      if (props.pageTitleRender) {
        const title = props.pageTitleRender(pageProps, _pageTitleInfo.title, _pageTitleInfo);
        if (typeof title === "string") {
          return getPageTitleInfo(__spreadProps(__spreadValues({}, _pageTitleInfo), {
            title
          }));
        }
        warning(typeof title === "string", "pro-layout: renderPageTitle return value should be a string");
      }
      return _pageTitleInfo;
    });
    useDocumentTitle(computed(() => pageTitleInfo.value), props.title || false);
    watch(() => {
      var _a2, _b2, _c2;
      return [(_a2 = props.location) == null ? void 0 : _a2.pathname, (_c2 = (_b2 = props.location) == null ? void 0 : _b2.pathname) == null ? void 0 : _c2.search];
    }, () => {
      var _a2;
      (_a2 = props.onPageChange) == null ? void 0 : _a2.call(props, props.location);
    });
    expose({
      reload: () => {
        var _a2;
        if ((_a2 = props.menu) == null ? void 0 : _a2.request) execute();
      }
    });
    return () => {
      var _a2;
      const {
        children = (_a2 = slots.default) == null ? void 0 : _a2.call(slots),
        contentStyle,
        style,
        bgLayoutImgList,
        loading
      } = props || {};
      const {
        breadcrumbMap,
        menuData = []
      } = menuInfoData.value || {};
      const _b2 = __spreadValues(__spreadValues({}, props), currentMenuLayoutProps.value), {
        fixSiderbar,
        navTheme,
        layout: propsLayout
      } = _b2, rest = __objRest(_b2, [
        "fixSiderbar",
        "navTheme",
        "layout"
      ]);
      const breadcrumbProps = getBreadcrumbProps(__spreadProps(__spreadValues({}, getDefaultProps.value), {
        breadcrumbRender: props.breadcrumbRender,
        breadcrumbMap
      }), props);
      const siderMenuDom = renderSiderMenu(__spreadProps(__spreadValues({}, getDefaultProps.value), {
        menuData,
        onCollapse,
        isMobile: isMobile.value,
        collapsed: collapsed.value
      }), matchMenuKeys.value);
      const footerDom = footerRender(__spreadValues({
        isMobile: isMobile.value,
        collapsed: collapsed.value
      }, getDefaultProps.value));
      const headerDom = headerRender(__spreadProps(__spreadValues({}, getDefaultProps.value), {
        hasSiderMenu: !!siderMenuDom,
        menuData,
        isMobile: isMobile.value,
        collapsed: collapsed.value,
        onCollapse
      }), matchMenuKeys.value);
      const className = classNames(props.className, hashId.value, "ant-design-pro", proLayoutClassName.value, {
        [`screen-${colSize.value}`]: colSize.value,
        [`${proLayoutClassName.value}-top-menu`]: propsLayout === "top",
        [`${proLayoutClassName.value}-is-children`]: isChildrenLayout.value,
        [`${proLayoutClassName.value}-fix-siderbar`]: fixSiderbar,
        [`${proLayoutClassName.value}-${propsLayout}`]: propsLayout
      });
      const leftSiderWidth = getPaddingInlineStart(!!hasLeftPadding.value, collapsed.value, siderWidth.value);
      const renderBgImgStyleList = () => {
        if (bgLayoutImgList && bgLayoutImgList.length > 0) {
          return bgLayoutImgList == null ? void 0 : bgLayoutImgList.map((item, index) => {
            return _createVNode("img", {
              "key": index,
              "src": item.src,
              "style": __spreadValues({
                position: "absolute"
              }, item)
            }, null);
          });
        }
        return null;
      };
      const bgImgStyleList = renderBgImgStyleList();
      return wrapSSR(_createVNode(RouteContext.Provider, {
        "value": __spreadProps(__spreadValues({}, getDefaultProps.value), {
          breadcrumb: breadcrumbProps,
          menuData,
          isMobile: isMobile.value,
          collapsed: collapsed.value,
          hasPageContainer: hasPageContainer.value,
          isChildrenLayout: true,
          title: pageTitleInfo.value.pageName,
          hasSiderMenu: !!siderMenuDom,
          hasHeader: !!headerDom,
          siderWidth: leftSiderWidth,
          hasFooter: !!footerDom,
          hasFooterToolbar: hasFooterToolbar.value,
          setHasFooterToolbar,
          setHasPageContainer,
          pageTitleInfo: pageTitleInfo.value,
          matchMenus: matchMenus.value,
          matchMenuKeys: matchMenuKeys.value,
          currentMenu: currentMenu.value
        })
      }, {
        default: () => {
          var _a3;
          return [props.pure ? _createVNode(_Fragment, null, [children]) : _createVNode("div", {
            "class": className
          }, [bgImgStyleList || ((_a3 = token == null ? void 0 : token.layout) == null ? void 0 : _a3.bgLayout) ? _createVNode("div", {
            "class": classNames(`${proLayoutClassName.value}-bg-list`, hashId.value)
          }, [bgImgStyleList]) : null, _createVNode(Layout, {
            "style": __spreadValues({
              minHeight: "100%",
              // hack style
              flexDirection: siderMenuDom ? "row" : void 0
            }, style)
          }, {
            default: () => {
              var _a4, _b3, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
              return [_createVNode(ConfigProvider, {
                "theme": {
                  hashed: isNeedOpenHash(),
                  token: {
                    controlHeightLG: ((_b3 = (_a4 = token == null ? void 0 : token.layout) == null ? void 0 : _a4.sider) == null ? void 0 : _b3.menuHeight) || (token == null ? void 0 : token.controlHeightLG)
                  },
                  components: {
                    Menu: {
                      colorItemBg: ((_d = (_c2 = token == null ? void 0 : token.layout) == null ? void 0 : _c2.sider) == null ? void 0 : _d.colorMenuBackground) || "transparent",
                      colorSubItemBg: ((_f = (_e = token == null ? void 0 : token.layout) == null ? void 0 : _e.sider) == null ? void 0 : _f.colorMenuBackground) || "transparent",
                      radiusItem: token == null ? void 0 : token.borderRadius,
                      colorItemBgSelected: ((_h = (_g = token == null ? void 0 : token.layout) == null ? void 0 : _g.sider) == null ? void 0 : _h.colorBgMenuItemSelected) || (token == null ? void 0 : token.colorBgTextHover),
                      colorItemBgHover: ((_j = (_i = token == null ? void 0 : token.layout) == null ? void 0 : _i.sider) == null ? void 0 : _j.colorBgMenuItemHover) || (token == null ? void 0 : token.colorBgTextHover),
                      colorItemBgActive: ((_l = (_k = token == null ? void 0 : token.layout) == null ? void 0 : _k.sider) == null ? void 0 : _l.colorBgMenuItemActive) || (token == null ? void 0 : token.colorBgTextActive),
                      colorItemBgSelectedHorizontal: ((_n = (_m = token == null ? void 0 : token.layout) == null ? void 0 : _m.sider) == null ? void 0 : _n.colorBgMenuItemSelected) || (token == null ? void 0 : token.colorBgTextHover),
                      colorActiveBarWidth: 0,
                      colorActiveBarHeight: 0,
                      colorActiveBarBorderSize: 0,
                      colorItemText: ((_p = (_o = token == null ? void 0 : token.layout) == null ? void 0 : _o.sider) == null ? void 0 : _p.colorTextMenu) || (token == null ? void 0 : token.colorTextSecondary),
                      colorItemTextHover: ((_r = (_q = token == null ? void 0 : token.layout) == null ? void 0 : _q.sider) == null ? void 0 : _r.colorTextMenuItemHover) || "rgba(0, 0, 0, 0.85)",
                      // 悬浮态
                      colorItemTextSelected: ((_t = (_s = token == null ? void 0 : token.layout) == null ? void 0 : _s.sider) == null ? void 0 : _t.colorTextMenuSelected) || "rgba(0, 0, 0, 1)",
                      // @ts-expect-error
                      popupBg: token == null ? void 0 : token.colorBgElevated,
                      subMenuItemBg: token == null ? void 0 : token.colorBgElevated,
                      darkSubMenuItemBg: "transparent",
                      darkPopupBg: token == null ? void 0 : token.colorBgElevated
                    }
                  }
                }
              }, {
                default: () => [siderMenuDom]
              }), _createVNode("div", {
                "style": genLayoutStyle.value,
                "class": `${proLayoutClassName.value}-container ${hashId.value}`.trim()
              }, [headerDom, _createVNode(WrapContent, _mergeProps({
                "hasPageContainer": hasPageContainer.value,
                "isChildrenLayout": isChildrenLayout.value
              }, omit(rest, ["isChildrenLayout"]), {
                "hasHeader": !!headerDom,
                "prefixCls": proLayoutClassName.value,
                "style": contentStyle
              }), {
                default: () => [loading ? _createVNode(PageLoading, null, null) : children]
              }), footerDom, hasFooterToolbar && _createVNode("div", {
                "class": `${proLayoutClassName.value}-has-footer`,
                "style": {
                  height: `64px`,
                  marginBlockStart: (_v = (_u = token == null ? void 0 : token.layout) == null ? void 0 : _u.pageContainer) == null ? void 0 : _v.paddingBlockPageContainerContent
                }
              }, null)])];
            }
          })])];
        }
      }));
    };
  }
});
const ProLayout = defineComponent({
  name: "ProLayout",
  props: proLayoutProps,
  inheritAttrs: false,
  slots: Object,
  setup(props, {
    slots
  }) {
    return () => {
      var _a;
      const {
        colorPrimary,
        logo = (_a = slots.logo) == null ? void 0 : _a.call(slots)
      } = props;
      const getMergeProps = () => {
        var _a2;
        const filterUndefined = omitUndefined(props);
        return __spreadValues(__spreadProps(__spreadValues({}, defaultSettings), {
          location: (_a2 = props.location) != null ? _a2 : isBrowser() ? window.location : void 0
        }), omit(filterUndefined, ["logo", "location"]));
      };
      const darkProps = props.navTheme !== void 0 ? {
        dark: props.navTheme === "realDark"
      } : {};
      return _createVNode(ConfigProvider, {
        "theme": colorPrimary ? {
          token: {
            colorPrimary
          }
        } : void 0
      }, {
        default: () => [_createVNode(ProConfigProvider, _mergeProps(darkProps, {
          "token": props.token,
          "prefixCls": props.prefixCls
        }), {
          default: () => [_createVNode(BaseProLayout, _mergeProps({
            "logo": logo != null ? logo : _createVNode(Logo, null, null)
          }, getMergeProps()), slots)]
        })]
      });
    };
  }
});
export {
  ProLayout
};
