"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Vue = require("vue");
const aria = require("../../constants/aria.js");
const index = require("../../../../@vueuse/shared/index.js");
let e = [];
const r = (n) => {
  const o = n;
  o.key === aria.EVENT_CODE.esc && e.forEach((i) => i(o));
}, p = (n) => {
  Vue.onMounted(() => {
    e.length === 0 && document.addEventListener("keydown", r), index.isClient && e.push(n);
  }), Vue.onBeforeUnmount(() => {
    e = e.filter((o) => o !== n), e.length === 0 && index.isClient && document.removeEventListener("keydown", r);
  });
};
exports.useEscapeKeydown = p;
