import { o as e } from "./rolldown-runtime.js";
import { i as l } from "./vendor/react.js";
import { t as m } from "./useIsoLayoutEffect.js";
import { t as i } from "./owner.js";
import { n as p } from "./useOpenInteractionType.js";
var S = /* @__PURE__ */ e(l()), h = 20;
function k(t, r, o, f) {
  const [a, c] = S.useState(!1);
  m(() => {
    if (!t || !r || o == null) {
      c(!1);
      return;
    }
    const s = i(o).documentElement.clientWidth, u = o.offsetWidth;
    c(s > 0 && u > 0 && u >= s - h);
  }, [
    t,
    r,
    o
  ]), p(t && (!r || a), f);
}
export {
  k as t
};

//# sourceMappingURL=useAnchoredPopupScrollLock.js.map