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 S } 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 { resetComponent as f } from "../../style/index.mjs";
import { genStyleHooks as b } from "../../theme/util/genComponentStyleHook.mjs";
const s = (n, o, i, r, t) => ({
  background: n,
  border: `${S(r.lineWidth)} ${r.lineType} ${o}`,
  [`${t}-icon`]: {
    color: i
  }
}), h = (n) => {
  const {
    componentCls: o,
    motionDurationSlow: i,
    marginXS: r,
    marginSM: t,
    fontSize: a,
    fontSizeLG: c,
    lineHeight: l,
    borderRadiusLG: p,
    motionEaseInOutCirc: e,
    withDescriptionIconSize: g,
    colorText: m,
    colorTextHeading: d,
    withDescriptionPadding: $,
    defaultPadding: u
  } = n;
  return {
    [o]: Object.assign(Object.assign({}, f(n)), {
      position: "relative",
      display: "flex",
      alignItems: "center",
      padding: u,
      wordWrap: "break-word",
      borderRadius: p,
      [`&${o}-rtl`]: {
        direction: "rtl"
      },
      [`${o}-content`]: {
        flex: 1,
        minWidth: 0
      },
      [`${o}-icon`]: {
        marginInlineEnd: r,
        lineHeight: 0
      },
      "&-description": {
        display: "none",
        fontSize: a,
        lineHeight: l
      },
      "&-message": {
        color: d
      },
      [`&${o}-motion-leave`]: {
        overflow: "hidden",
        opacity: 1,
        transition: `max-height ${i} ${e}, opacity ${i} ${e},
        padding-top ${i} ${e}, padding-bottom ${i} ${e},
        margin-bottom ${i} ${e}`
      },
      [`&${o}-motion-leave-active`]: {
        maxHeight: 0,
        marginBottom: "0 !important",
        paddingTop: 0,
        paddingBottom: 0,
        opacity: 0
      }
    }),
    [`${o}-with-description`]: {
      alignItems: "flex-start",
      padding: $,
      [`${o}-icon`]: {
        marginInlineEnd: t,
        fontSize: g,
        lineHeight: 0
      },
      [`${o}-message`]: {
        display: "block",
        marginBottom: r,
        color: d,
        fontSize: c
      },
      [`${o}-description`]: {
        display: "block",
        color: m
      }
    },
    [`${o}-banner`]: {
      marginBottom: 0,
      border: "0 !important",
      borderRadius: 0
    }
  };
}, y = (n) => {
  const {
    componentCls: o,
    colorSuccess: i,
    colorSuccessBorder: r,
    colorSuccessBg: t,
    colorWarning: a,
    colorWarningBorder: c,
    colorWarningBg: l,
    colorError: p,
    colorErrorBorder: e,
    colorErrorBg: g,
    colorInfo: m,
    colorInfoBorder: d,
    colorInfoBg: $
  } = n;
  return {
    [o]: {
      "&-success": s(t, r, i, n, o),
      "&-info": s($, d, m, n, o),
      "&-warning": s(l, c, a, n, o),
      "&-error": Object.assign(Object.assign({}, s(g, e, p, n, o)), {
        [`${o}-description > pre`]: {
          margin: 0,
          padding: 0
        }
      })
    }
  };
}, I = (n) => {
  const {
    componentCls: o,
    iconCls: i,
    motionDurationMid: r,
    marginXS: t,
    fontSizeIcon: a,
    colorIcon: c,
    colorIconHover: l
  } = n;
  return {
    [o]: {
      "&-action": {
        marginInlineStart: t
      },
      [`${o}-close-icon`]: {
        marginInlineStart: t,
        padding: 0,
        overflow: "hidden",
        fontSize: a,
        lineHeight: S(a),
        backgroundColor: "transparent",
        border: "none",
        outline: "none",
        cursor: "pointer",
        [`${i}-close`]: {
          color: c,
          transition: `color ${r}`,
          "&:hover": {
            color: l
          }
        }
      },
      "&-close-text": {
        color: c,
        transition: `color ${r}`,
        "&:hover": {
          color: l
        }
      }
    }
  };
}, x = (n) => ({
  withDescriptionIconSize: n.fontSizeHeading3,
  defaultPadding: `${n.paddingContentVerticalSM}px 12px`,
  withDescriptionPadding: `${n.paddingMD}px ${n.paddingContentHorizontalLG}px`
}), A = b("Alert", (n) => [h(n), y(n), I(n)], x);
export {
  A as default,
  I as genActionStyle,
  h as genBaseStyle,
  y as genTypeStyle,
  x as prepareComponentToken
};
