import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t}from"./jsx-runtime-CiQ1k8xo.js";import{lt as n}from"./vscode-api-DjORcpSo.js";var r=n(),i=e(t(),1);function a(e){let t=(0,r.c)(4),{anchorRef:n,isActive:a}=e,l;t[0]===a?l=t[1]:(l=e=>!a||typeof window>`u`?s:(window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}),t[0]=a,t[1]=l);let u=l,d;return t[2]===n?d=t[3]:(d=()=>c(n.current),t[2]=n,t[3]=d),(0,i.useSyncExternalStore)(u,d,o)}function o(){return`bottom`}function s(){}function c(e){if(typeof window>`u`||e==null)return`bottom`;let t=e.getBoundingClientRect(),n=t.top,r=window.innerHeight-t.bottom;return r<240&&n>r?`top`:`bottom`}export{a as t};
//# sourceMappingURL=use-autocomplete-overlay-placement-DMMhSkr_.js.map