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