import { useContext as u, useEffect as s } from "react";
import { PresenceContext as f } from "../../context/PresenceContext.es.js";
import { useId as l } from "../../utils/use-id.es.js";
function a() {
  var e = u(f);
  if (e === null)
    return [!0, null];
  var n = e.isPresent, r = e.onExitComplete, o = e.register, t = l();
  s(function() {
    return o(t);
  }, []);
  var i = function() {
    return r == null ? void 0 : r(t);
  };
  return !n && r ? [!1, i] : [!0];
}
export {
  a as usePresence
};
//# sourceMappingURL=use-presence.es.js.map
