import N from "../../../../@ant-design/icons/es/icons/CaretDownFilled.mjs";
import E from "../../../../@ant-design/icons/es/icons/FileOutlined.mjs";
import $ from "../../../../@ant-design/icons/es/icons/LoadingOutlined.mjs";
import C from "../../../../@ant-design/icons/es/icons/MinusSquareOutlined.mjs";
import I from "../../../../@ant-design/icons/es/icons/PlusSquareOutlined.mjs";
import l from "../../../../classnames/index.mjs";
import * as n from "react";
import { isValidElement as m, cloneElement as f } from "../../_util/reactNode.mjs";
const L = (u) => {
  const {
    prefixCls: e,
    switcherIcon: s,
    treeNodeProps: c,
    showLine: o
  } = u, {
    isLeaf: p,
    expanded: w,
    loading: d
  } = c;
  if (d)
    return /* @__PURE__ */ n.createElement($, {
      className: `${e}-switcher-loading-icon`
    });
  let t;
  if (o && typeof o == "object" && (t = o.showLeafIcon), p) {
    if (!o)
      return null;
    if (typeof t != "boolean" && t) {
      const i = typeof t == "function" ? t(c) : t, h = `${e}-switcher-line-custom-icon`;
      return m(i) ? f(i, {
        className: l(i.props.className || "", h)
      }) : i;
    }
    return t ? /* @__PURE__ */ n.createElement(E, {
      className: `${e}-switcher-line-icon`
    }) : /* @__PURE__ */ n.createElement("span", {
      className: `${e}-switcher-leaf-line`
    });
  }
  const a = `${e}-switcher-icon`, r = typeof s == "function" ? s(c) : s;
  return m(r) ? f(r, {
    className: l(r.props.className || "", a)
  }) : r !== void 0 ? r : o ? w ? /* @__PURE__ */ n.createElement(C, {
    className: `${e}-switcher-line-icon`
  }) : /* @__PURE__ */ n.createElement(I, {
    className: `${e}-switcher-line-icon`
  }) : /* @__PURE__ */ n.createElement(N, {
    className: a
  });
}, F = L;
export {
  F as default
};
