import { isFunction } from "../_utils/is.mjs";
import { useIntersectionObserver } from "../hooks/use-intersection-observer.mjs";
import "vue";
import "../_utils/global.mjs";
let io = null;
let listener = () => null;
const vIntersection = {
  beforeMount() {
    io = useIntersectionObserver();
  },
  mounted(el, binding) {
    if (isFunction(binding.value)) {
      listener = binding.value;
      io == null ? void 0 : io.observe(el, listener);
    }
  },
  unmounted(el) {
    if (listener) {
      io == null ? void 0 : io.unobserve(el, listener);
    }
  }
};
export {
  vIntersection
};
