import{r as s}from"./vendor-react-wBh_31cN.js";import{p as i}from"./index-BKr2rJhV.js";const a=(n,r=!0)=>{const e=s.useCallback(o=>{const t=i(o.key,n);t&&(o.preventDefault(),o.stopPropagation(),t(o))},[n]);s.useEffect(()=>r?(window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}):window.removeEventListener("keydown",e),[e,r])};export{a as u};
