import { supportRef as p, fillRef as c, useComposeRef as l } from "../../../rc-util/es/ref.mjs";
import * as a from "react";
var s = /* @__PURE__ */ a.forwardRef(function(f, i) {
  var e = f.children, r = f.getTriggerDOMNode, t = p(e), g = a.useCallback(function(o) {
    c(i, r ? r(o) : o);
  }, [r]), n = l(g, e.ref);
  return t ? /* @__PURE__ */ a.cloneElement(e, {
    ref: n
  }) : e;
});
process.env.NODE_ENV !== "production" && (s.displayName = "TriggerWrapper");
export {
  s as default
};
