import { gold as l } from "../../../../@ant-design/colors/es/index.mjs";
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 a } 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 { operationUnit as d } from "../../style/operationUnit.mjs";
const c = (i, e, t, o) => {
  const {
    titleMarginBottom: n,
    fontWeightStrong: r
  } = o;
  return {
    marginBottom: n,
    color: t,
    fontWeight: r,
    fontSize: i,
    lineHeight: e
  };
}, T = (i) => {
  const e = [1, 2, 3, 4, 5], t = {};
  return e.forEach((o) => {
    t[`
      h${o}&,
      div&-h${o},
      div&-h${o} > textarea,
      h${o}
    `] = c(i[`fontSizeHeading${o}`], i[`lineHeightHeading${o}`], i.colorTextHeading, i);
  }), t;
}, k = (i) => {
  const {
    componentCls: e
  } = i;
  return {
    "a&, a": Object.assign(Object.assign({}, d(i)), {
      textDecoration: i.linkDecoration,
      "&:active, &:hover": {
        textDecoration: i.linkHoverDecoration
      },
      [`&[disabled], &${e}-disabled`]: {
        color: i.colorTextDisabled,
        cursor: "not-allowed",
        "&:active, &:hover": {
          color: i.colorTextDisabled
        },
        "&:active": {
          pointerEvents: "none"
        }
      }
    })
  };
}, D = (i) => ({
  code: {
    margin: "0 0.2em",
    paddingInline: "0.4em",
    paddingBlock: "0.2em 0.1em",
    fontSize: "85%",
    fontFamily: i.fontFamilyCode,
    background: "rgba(150, 150, 150, 0.1)",
    border: "1px solid rgba(100, 100, 100, 0.2)",
    borderRadius: 3
  },
  kbd: {
    margin: "0 0.2em",
    paddingInline: "0.4em",
    paddingBlock: "0.15em 0.1em",
    fontSize: "90%",
    fontFamily: i.fontFamilyCode,
    background: "rgba(150, 150, 150, 0.06)",
    border: "1px solid rgba(100, 100, 100, 0.2)",
    borderBottomWidth: 2,
    borderRadius: 3
  },
  mark: {
    padding: 0,
    // FIXME hardcode in v4
    backgroundColor: l[2]
  },
  "u, ins": {
    textDecoration: "underline",
    textDecorationSkipInk: "auto"
  },
  "s, del": {
    textDecoration: "line-through"
  },
  strong: {
    fontWeight: 600
  },
  // list
  "ul, ol": {
    marginInline: 0,
    marginBlock: "0 1em",
    padding: 0,
    li: {
      marginInline: "20px 0",
      marginBlock: 0,
      paddingInline: "4px 0",
      paddingBlock: 0
    }
  },
  ul: {
    listStyleType: "circle",
    ul: {
      listStyleType: "disc"
    }
  },
  ol: {
    listStyleType: "decimal"
  },
  // pre & block
  "pre, blockquote": {
    margin: "1em 0"
  },
  pre: {
    padding: "0.4em 0.6em",
    whiteSpace: "pre-wrap",
    wordWrap: "break-word",
    background: "rgba(150, 150, 150, 0.1)",
    border: "1px solid rgba(100, 100, 100, 0.2)",
    borderRadius: 3,
    fontFamily: i.fontFamilyCode,
    // Compatible for marked
    code: {
      display: "inline",
      margin: 0,
      padding: 0,
      fontSize: "inherit",
      fontFamily: "inherit",
      background: "transparent",
      border: 0
    }
  },
  blockquote: {
    paddingInline: "0.6em 0",
    paddingBlock: 0,
    borderInlineStart: "4px solid rgba(100, 100, 100, 0.2)",
    opacity: 0.85
  }
}), I = (i) => {
  const {
    componentCls: e,
    paddingSM: t
  } = i, o = t;
  return {
    "&-edit-content": {
      position: "relative",
      "div&": {
        insetInlineStart: i.calc(i.paddingSM).mul(-1).equal(),
        marginTop: i.calc(o).mul(-1).equal(),
        marginBottom: `calc(1em - ${a(o)})`
      },
      [`${e}-edit-content-confirm`]: {
        position: "absolute",
        insetInlineEnd: i.calc(i.marginXS).add(2).equal(),
        insetBlockEnd: i.marginXS,
        color: i.colorTextDescription,
        // default style
        fontWeight: "normal",
        fontSize: i.fontSize,
        fontStyle: "normal",
        pointerEvents: "none"
      },
      textarea: {
        margin: "0!important",
        // Fix Editable Textarea flash in Firefox
        MozTransition: "none",
        height: "1em"
      }
    }
  };
}, W = (i) => ({
  "&-copy-success": {
    "\n    &,\n    &:hover,\n    &:focus": {
      color: i.colorSuccess
    }
  }
}), $ = () => ({
  "\n  a&-ellipsis,\n  span&-ellipsis\n  ": {
    display: "inline-block",
    maxWidth: "100%"
  },
  "&-single-line": {
    whiteSpace: "nowrap"
  },
  "&-ellipsis-single-line": {
    overflow: "hidden",
    textOverflow: "ellipsis",
    // https://blog.csdn.net/iefreer/article/details/50421025
    "a&, span&": {
      verticalAlign: "bottom"
    },
    "> code": {
      paddingBlock: 0,
      maxWidth: "calc(100% - 1.2em)",
      display: "inline-block",
      overflow: "hidden",
      textOverflow: "ellipsis",
      verticalAlign: "bottom",
      // https://github.com/ant-design/ant-design/issues/45953
      boxSizing: "content-box"
    }
  },
  "&-ellipsis-multiple-line": {
    display: "-webkit-box",
    overflow: "hidden",
    WebkitLineClamp: 3,
    WebkitBoxOrient: "vertical"
  }
});
export {
  W as getCopyableStyles,
  I as getEditableStyles,
  $ as getEllipsisStyles,
  k as getLinkStyles,
  D as getResetStyles,
  T as getTitleStyles
};
