import "../../../../@ant-design/cssinjs/es/extractStyle.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useCacheToken.mjs";
import "react";
import "../../../../@ant-design/cssinjs/es/StyleContext.mjs";
import { unit as n } from "../../../../@ant-design/cssinjs/es/util/index.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useCompatibleInsertionEffect.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useEffectCleanupRegister.mjs";
import "../../../../@ant-design/cssinjs/es/hooks/useHMR.mjs";
import "../../../../rc-util/es/warning.mjs";
import "../../../../@ant-design/cssinjs/es/theme/createTheme.mjs";
import "../../../../@ant-design/cssinjs/es/theme/ThemeCache.mjs";
import "../../../../@ant-design/cssinjs/es/transformers/legacyLogicalProperties.mjs";
import { textEllipsis as f } from "../../style/index.mjs";
const $ = (e) => {
  const {
    componentCls: i,
    itemHeight: t,
    itemMarginInline: o,
    padding: l,
    menuArrowSize: r,
    marginXS: a,
    itemMarginBlock: d,
    itemWidth: m
  } = e, s = e.calc(r).add(l).add(a).equal();
  return {
    [`${i}-item`]: {
      position: "relative",
      overflow: "hidden"
    },
    [`${i}-item, ${i}-submenu-title`]: {
      height: t,
      lineHeight: n(t),
      paddingInline: l,
      overflow: "hidden",
      textOverflow: "ellipsis",
      marginInline: o,
      marginBlock: d,
      width: m
    },
    [`> ${i}-item,
            > ${i}-submenu > ${i}-submenu-title`]: {
      height: t,
      lineHeight: n(t)
    },
    [`${i}-item-group-list ${i}-submenu-title,
            ${i}-submenu-title`]: {
      paddingInlineEnd: s
    }
  };
}, v = (e) => {
  const {
    componentCls: i,
    iconCls: t,
    itemHeight: o,
    colorTextLightSolid: l,
    dropdownWidth: r,
    controlHeightLG: a,
    motionDurationMid: d,
    motionEaseOut: m,
    paddingXL: s,
    itemMarginInline: g,
    fontSizeLG: u,
    motionDurationSlow: p,
    paddingXS: b,
    boxShadowSecondary: h,
    collapsedWidth: S,
    collapsedIconSize: w
  } = e, c = {
    height: o,
    lineHeight: n(o),
    listStylePosition: "inside",
    listStyleType: "disc"
  };
  return [
    {
      [i]: {
        "&-inline, &-vertical": Object.assign({
          [`&${i}-root`]: {
            boxShadow: "none"
          }
        }, $(e))
      },
      [`${i}-submenu-popup`]: {
        [`${i}-vertical`]: Object.assign(Object.assign({}, $(e)), {
          boxShadow: h
        })
      }
    },
    // Vertical only
    {
      [`${i}-submenu-popup ${i}-vertical${i}-sub`]: {
        minWidth: r,
        maxHeight: `calc(100vh - ${n(e.calc(a).mul(2.5).equal())})`,
        padding: "0",
        overflow: "hidden",
        borderInlineEnd: 0,
        // https://github.com/ant-design/ant-design/issues/22244
        // https://github.com/ant-design/ant-design/issues/26812
        "&:not([class*='-active'])": {
          overflowX: "hidden",
          overflowY: "auto"
        }
      }
    },
    // Inline Only
    {
      [`${i}-inline`]: {
        width: "100%",
        // Motion enhance for first level
        [`&${i}-root`]: {
          [`${i}-item, ${i}-submenu-title`]: {
            display: "flex",
            alignItems: "center",
            transition: [`border-color ${p}`, `background ${p}`, `padding ${d} ${m}`].join(","),
            [`> ${i}-title-content`]: {
              flex: "auto",
              minWidth: 0,
              overflow: "hidden",
              textOverflow: "ellipsis"
            },
            "> *": {
              flex: "none"
            }
          }
        },
        // >>>>> Sub
        [`${i}-sub${i}-inline`]: {
          padding: 0,
          border: 0,
          borderRadius: 0,
          boxShadow: "none",
          [`& > ${i}-submenu > ${i}-submenu-title`]: c,
          [`& ${i}-item-group-title`]: {
            paddingInlineStart: s
          }
        },
        // >>>>> Item
        [`${i}-item`]: c
      }
    },
    // Inline Collapse Only
    {
      [`${i}-inline-collapsed`]: {
        width: S,
        [`&${i}-root`]: {
          [`${i}-item, ${i}-submenu ${i}-submenu-title`]: {
            [`> ${i}-inline-collapsed-noicon`]: {
              fontSize: u,
              textAlign: "center"
            }
          }
        },
        [`> ${i}-item,
          > ${i}-item-group > ${i}-item-group-list > ${i}-item,
          > ${i}-item-group > ${i}-item-group-list > ${i}-submenu > ${i}-submenu-title,
          > ${i}-submenu > ${i}-submenu-title`]: {
          insetInlineStart: 0,
          paddingInline: `calc(50% - ${n(e.calc(u).div(2).equal())} - ${n(g)})`,
          textOverflow: "clip",
          [`
            ${i}-submenu-arrow,
            ${i}-submenu-expand-icon
          `]: {
            opacity: 0
          },
          [`${i}-item-icon, ${t}`]: {
            margin: 0,
            fontSize: w,
            lineHeight: n(o),
            "+ span": {
              display: "inline-block",
              opacity: 0
            }
          }
        },
        [`${i}-item-icon, ${t}`]: {
          display: "inline-block"
        },
        "&-tooltip": {
          pointerEvents: "none",
          [`${i}-item-icon, ${t}`]: {
            display: "none"
          },
          "a, a:hover": {
            color: l
          }
        },
        [`${i}-item-group-title`]: Object.assign(Object.assign({}, f), {
          paddingInline: b
        })
      }
    }
  ];
}, A = v;
export {
  A as default
};
