import { e as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-cvK1vxO7.js";
import { useEffect } from "react";
function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {
  let handleEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(handler);
  let isDisabled = handler == null;
  useEffect(() => {
    if (isDisabled || !ref.current) return;
    let element = ref.current;
    element.addEventListener(event, handleEvent, options);
    return () => {
      element.removeEventListener(event, handleEvent, options);
    };
  }, [
    ref,
    event,
    options,
    isDisabled,
    handleEvent
  ]);
}
export {
  $e9faafb641e167db$export$90fc3a17d93f704c as $
};
