import C from "../../../@ant-design/icons/es/icons/LoadingOutlined.mjs";
import N from "../../../classnames/index.mjs";
import v from "../../../rc-motion/es/CSSMotion.mjs";
import "../../../rc-motion/es/CSSMotionList.mjs";
import o, { forwardRef as y } from "react";
import u from "./IconWrapper.mjs";
const m = /* @__PURE__ */ y((e, t) => {
  let {
    prefixCls: a,
    className: i,
    style: n,
    iconClassName: s
  } = e;
  const r = N(`${a}-loading-icon`, i);
  return /* @__PURE__ */ o.createElement(u, {
    prefixCls: a,
    className: r,
    style: n,
    ref: t
  }, /* @__PURE__ */ o.createElement(C, {
    className: s
  }));
}), l = () => ({
  width: 0,
  opacity: 0,
  transform: "scale(0)"
}), c = (e) => ({
  width: e.scrollWidth,
  opacity: 1,
  transform: "scale(1)"
}), L = (e) => {
  const {
    prefixCls: t,
    loading: a,
    existIcon: i,
    className: n,
    style: s
  } = e, r = !!a;
  return i ? /* @__PURE__ */ o.createElement(m, {
    prefixCls: t,
    className: n,
    style: s
  }) : /* @__PURE__ */ o.createElement(v, {
    visible: r,
    // We do not really use this motionName
    motionName: `${t}-loading-icon-motion`,
    motionLeave: r,
    removeOnLeave: !0,
    onAppearStart: l,
    onAppearActive: c,
    onEnterStart: l,
    onEnterActive: c,
    onLeaveStart: c,
    onLeaveActive: l
  }, (p, f) => {
    let {
      className: d,
      style: g
    } = p;
    return /* @__PURE__ */ o.createElement(m, {
      prefixCls: t,
      className: n,
      style: Object.assign(Object.assign({}, s), g),
      ref: f,
      iconClassName: d
    });
  });
}, b = L;
export {
  b as default
};
