import { g as e } from "./floating-ui.utils.dom-5U5b4xPf.js";
//#region ../../node_modules/.bun/@base-ui+react@1.5.0+f4ada88178b00e6f/node_modules/@base-ui/react/esm/internals/shadowDom.js
function t(e) {
	let t = e.activeElement;
	for (; t?.shadowRoot?.activeElement != null;) t = t.shadowRoot.activeElement;
	return t;
}
function n(t, n) {
	if (!t || !n) return !1;
	let r = n.getRootNode?.();
	if (t.contains(n)) return !0;
	if (r && e(r)) {
		let e = n;
		for (; e;) {
			if (t === e) return !0;
			e = e.parentNode || e.host;
		}
	}
	return !1;
}
function r(e) {
	return "composedPath" in e ? e.composedPath()[0] : e.target;
}
//#endregion
export { n, r, t };
