"use client";
import { useMantineEnv } from "../../core/MantineProvider/Mantine.context.mjs";
import { factory } from "../../core/factory/factory.mjs";
import { Portal } from "./Portal.mjs";
import { Fragment, jsx } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Portal/OptionalPortal.tsx
const OptionalPortal = factory(({ withinPortal = true, children, ...others }) => {
	if (useMantineEnv() === "test" || !withinPortal) return /* @__PURE__ */ jsx(Fragment, { children });
	return /* @__PURE__ */ jsx(Portal, {
		...others,
		children
	});
});
OptionalPortal.displayName = "@mantine/core/OptionalPortal";
//#endregion
export { OptionalPortal };

//# sourceMappingURL=OptionalPortal.mjs.map