"use client";
import * as r from "react";
import s from "react-dom";
import { Primitive as c } from "../../../../../@radix-ui_react-primitive@2.1.2_@types_react-dom@19.0.4_@types_react@19.0.10__@types_react@19_yaprehzj3zhubujdvl7w24j6pq/node_modules/@radix-ui/react-primitive/dist/index.js";
import { useLayoutEffect as u } from "../../../../../@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js";
import { jsx as l } from "react/jsx-runtime";
var p = "Portal", d = r.forwardRef((e, a) => {
  var o;
  const { container: f, ...i } = e, [m, n] = r.useState(!1);
  u(() => n(!0), []);
  const t = f || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
  return t ? s.createPortal(/* @__PURE__ */ l(c.div, { ...i, ref: a }), t) : null;
});
d.displayName = p;
export {
  d as Portal
};
//# sourceMappingURL=index.js.map
