import{r,j as n}from"./iframe-B8FSoBNY.js";import{r as d}from"./index-DaXC_qY_.js";import{u as x}from"./normalize-props-D7NI5JRu.js";import{x as f,g as l}from"./factory-BR3bc_RM.js";const j=t=>{const{children:e,disabled:o}=t,[s,a]=r.useState(t.container?.current),c=r.useSyncExternalStore(E,()=>!1,()=>!0),{getRootNode:i}=x();if(r.useEffect(()=>{a(()=>t.container?.current)},[t.container]),c||o)return n.jsx(n.Fragment,{children:e});const m=s??g(i);return n.jsx(n.Fragment,{children:r.Children.map(e,u=>d.createPortal(u,m))})},g=t=>{const e=t?.(),o=e.getRootNode();return f(o)?o:l(e).body},E=()=>()=>{};export{j as P};
