import { useStore } from "../../xyflow/react.js";
import { createPortal } from "react-dom";
const reactFlowPortalSelector = (state)=>state.domNode?.querySelector('.react-flow__renderer');
function CanvasPortal({ children }) {
    const wrapperRef = useStore(reactFlowPortalSelector);
    if (!wrapperRef) return null;
    return /*#__PURE__*/ createPortal(children, wrapperRef);
}
export { CanvasPortal };
