import { defineComponent as s, ref as c, computed as i, onMounted as u, nextTick as p, onBeforeUnmount as f, createElementBlock as d, openBlock as m, normalizeClass as E } from "vue";
const y = /* @__PURE__ */ s({
  __name: "index",
  props: {
    disabled: { type: Boolean, default: !1 }
  },
  setup(l) {
    const r = l, t = c(), n = c(!1), a = i(() => ({
      active: ["focus", "mouseenter"],
      inactive: ["blur", "mouseleave"]
    })), o = () => {
      r.disabled || (n.value = !0);
    }, v = () => {
      n.value = !1;
    };
    return u(() => {
      p(() => {
        a.value.active.forEach((e) => {
          t.value?.parentElement?.addEventListener(e, o);
        }), a.value.inactive.forEach((e) => {
          t.value?.parentElement?.addEventListener(e, v);
        });
      });
    }), f(() => {
      a.value.active.forEach((e) => {
        t.value?.parentElement?.removeEventListener(e, o);
      }), a.value.inactive.forEach((e) => {
        t.value?.parentElement?.removeEventListener(e, v);
      });
    }), (e, _) => (m(), d("div", {
      ref_key: "focusHelper",
      ref: t,
      class: E(["vpdf:pointer-events-none vpdf:absolute vpdf:inset-0 vpdf:transition-opacity", {
        "vpdf:opacity-0": !n.value,
        "vpdf:opacity-20": n.value
      }])
    }, null, 2));
  }
});
export {
  y as _
};
