import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
const useNiceDropdownMaxHeight = function() {
    let deps = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
    const heightRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(0);
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        const handler = (e)=>{
            const { clientY } = e;
            const h = Math.max(clientY, window.innerHeight - clientY);
            heightRef.current = h;
        };
        window.addEventListener('mousemove', handler);
        return ()=>{
            window.removeEventListener('mousemove', handler);
        };
    }, []);
    return (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>heightRef.current - 40, deps);
};
export { useNiceDropdownMaxHeight };
