import * as o from "react";
import d from "../../../classnames/index.mjs";
import { getRenderPropValue as p } from "../_util/getRenderPropValue.mjs";
import { getTransitionName as b } from "../_util/motion.mjs";
import "../config-provider/index.mjs";
import E from "../tooltip/index.mjs";
import h from "./PurePanel.mjs";
import D from "./style/index.mjs";
import { ConfigContext as S } from "../config-provider/context.mjs";
var j = globalThis && globalThis.__rest || function(t, l) {
  var a = {};
  for (var e in t)
    Object.prototype.hasOwnProperty.call(t, e) && l.indexOf(e) < 0 && (a[e] = t[e]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
    for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
      l.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (a[e[r]] = t[e[r]]);
  return a;
};
const _ = (t) => {
  let {
    title: l,
    content: a,
    prefixCls: e
  } = t;
  return /* @__PURE__ */ o.createElement(o.Fragment, null, l && /* @__PURE__ */ o.createElement("div", {
    className: `${e}-title`
  }, p(l)), /* @__PURE__ */ o.createElement("div", {
    className: `${e}-inner-content`
  }, p(a)));
}, s = /* @__PURE__ */ o.forwardRef((t, l) => {
  const {
    prefixCls: a,
    title: e,
    content: r,
    overlayClassName: c,
    placement: f = "top",
    trigger: y = "hover",
    mouseEnterDelay: v = 0.1,
    mouseLeaveDelay: u = 0.1,
    overlayStyle: g = {}
  } = t, i = j(t, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle"]), {
    getPrefixCls: m
  } = o.useContext(S), n = m("popover", a), [C, P, x] = D(n), N = m(), O = d(c, P, x);
  return C(/* @__PURE__ */ o.createElement(E, Object.assign({
    placement: f,
    trigger: y,
    mouseEnterDelay: v,
    mouseLeaveDelay: u,
    overlayStyle: g
  }, i, {
    prefixCls: n,
    overlayClassName: O,
    ref: l,
    overlay: e || r ? /* @__PURE__ */ o.createElement(_, {
      prefixCls: n,
      title: e,
      content: r
    }) : null,
    transitionName: b(N, "zoom-big", i.transitionName),
    "data-popover-inject": !0
  })));
});
process.env.NODE_ENV !== "production" && (s.displayName = "Popover");
s._InternalPanelDoNotUseOrYouWillBeFired = h;
const F = s;
export {
  F as default
};
