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 d } 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 { prepareComponentToken as s, prepareToken as f } from "./index.mjs";
import { clearFix as g } from "../../style/index.mjs";
import { genSubStyleComponent as $ } from "../../theme/util/genComponentStyleHook.mjs";
const C = (o) => {
  const {
    componentCls: r,
    titleFontSize: l,
    titleLineHeight: a,
    modalConfirmIconSize: n,
    fontSize: c,
    lineHeight: t,
    modalTitleHeight: m,
    fontHeight: e,
    confirmBodyPadding: p
  } = o, i = `${r}-confirm`;
  return {
    [i]: {
      "&-rtl": {
        direction: "rtl"
      },
      [`${o.antCls}-modal-header`]: {
        display: "none"
      },
      [`${i}-body-wrapper`]: Object.assign({}, g()),
      [`&${r} ${r}-body`]: {
        padding: p
      },
      // ====================== Body ======================
      [`${i}-body`]: {
        display: "flex",
        flexWrap: "nowrap",
        alignItems: "start",
        [`> ${o.iconCls}`]: {
          flex: "none",
          fontSize: n,
          marginInlineEnd: o.confirmIconMarginInlineEnd,
          marginTop: o.calc(o.calc(e).sub(n).equal()).div(2).equal()
        },
        [`&-has-title > ${o.iconCls}`]: {
          marginTop: o.calc(o.calc(m).sub(n).equal()).div(2).equal()
        }
      },
      [`${i}-paragraph`]: {
        display: "flex",
        flexDirection: "column",
        flex: "auto",
        rowGap: o.marginXS,
        maxWidth: `calc(100% - ${d(o.calc(o.modalConfirmIconSize).add(o.marginSM).equal())})`
      },
      [`${i}-title`]: {
        color: o.colorTextHeading,
        fontWeight: o.fontWeightStrong,
        fontSize: l,
        lineHeight: a
      },
      [`${i}-content`]: {
        color: o.colorText,
        fontSize: c,
        lineHeight: t
      },
      // ===================== Footer =====================
      [`${i}-btns`]: {
        textAlign: "end",
        marginTop: o.confirmBtnsMarginTop,
        [`${o.antCls}-btn + ${o.antCls}-btn`]: {
          marginBottom: 0,
          marginInlineStart: o.marginXS
        }
      }
    },
    [`${i}-error ${i}-body > ${o.iconCls}`]: {
      color: o.colorError
    },
    [`${i}-warning ${i}-body > ${o.iconCls},
        ${i}-confirm ${i}-body > ${o.iconCls}`]: {
      color: o.colorWarning
    },
    [`${i}-info ${i}-body > ${o.iconCls}`]: {
      color: o.colorInfo
    },
    [`${i}-success ${i}-body > ${o.iconCls}`]: {
      color: o.colorSuccess
    }
  };
}, E = $(["Modal", "confirm"], (o) => {
  const r = f(o);
  return [C(r)];
}, s, {
  // confirm is weak than modal since no conflict here
  order: -1e3
});
export {
  E as default
};
