const i='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',o=t=>getComputedStyle(t).position==="fixed"?!1:t.offsetParent!==null,u=t=>Array.from(t.querySelectorAll(i)).filter(e=>d(e)&&o(e)),d=t=>{if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.disabled)return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return!(t.type==="hidden"||t.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},a=function(t,e,...r){let n;e.includes("mouse")||e.includes("click")?n="MouseEvents":e.includes("key")?n="KeyboardEvent":n="HTMLEvents";const s=document.createEvent(n);return s.initEvent(e,...r),t.dispatchEvent(s),t};export{u as o,a as t};
