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 y } 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";
function L(c) {
  const {
    sizePopupArrow: h,
    borderRadiusXS: r,
    borderRadiusOuter: t
  } = c, o = h / 2, e = 0, n = o, s = t * 1 / Math.sqrt(2), a = o - t * (1 - 1 / Math.sqrt(2)), p = o - r * (1 / Math.sqrt(2)), d = t * (Math.sqrt(2) - 1) + r * (1 / Math.sqrt(2)), u = 2 * o - p, $ = d, m = 2 * o - s, l = a, w = 2 * o - e, b = n, g = o * Math.sqrt(2) + t * (Math.sqrt(2) - 2), i = t * (Math.sqrt(2) - 1), x = `polygon(${i}px 100%, 50% ${i}px, ${2 * o - i}px 100%, ${i}px 100%)`, f = `path('M ${e} ${n} A ${t} ${t} 0 0 0 ${s} ${a} L ${p} ${d} A ${r} ${r} 0 0 1 ${u} ${$} L ${m} ${l} A ${t} ${t} 0 0 0 ${w} ${b} Z')`;
  return {
    arrowShadowWidth: g,
    arrowPath: f,
    arrowPolygon: x
  };
}
const O = (c, h, r) => {
  const {
    sizePopupArrow: t,
    arrowPolygon: o,
    arrowPath: e,
    arrowShadowWidth: n,
    borderRadiusXS: s,
    calc: a
  } = c;
  return {
    pointerEvents: "none",
    width: t,
    height: t,
    overflow: "hidden",
    "&::before": {
      position: "absolute",
      bottom: 0,
      insetInlineStart: 0,
      width: t,
      height: a(t).div(2).equal(),
      background: h,
      clipPath: {
        _multi_value_: !0,
        value: [o, e]
      },
      content: '""'
    },
    "&::after": {
      content: '""',
      position: "absolute",
      width: n,
      height: n,
      bottom: 0,
      insetInline: 0,
      margin: "auto",
      borderRadius: {
        _skip_check_: !0,
        value: `0 0 ${y(s)} 0`
      },
      transform: "translateY(50%) rotate(-135deg)",
      boxShadow: r,
      zIndex: 0,
      background: "transparent"
    }
  };
};
export {
  O as genRoundedArrow,
  L as getArrowToken
};
