import { onDocumentReady as d } from "./document-ready.js";
import { focusableSelector as u } from "./focus-management.js";
let n = [];
d(() => {
  function e(t) {
    if (!(t.target instanceof HTMLElement) || t.target === document.body || n[0] === t.target) return;
    let r = t.target;
    r = r.closest(u), n.unshift(r ?? t.target), n = n.filter((o) => o != null && o.isConnected), n.splice(10);
  }
  window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
});
export {
  n as history
};
