/*!
 * Custom elements for Nanopore-Digital Web applications
 */
function n(t=document){const c=t.activeElement;return c?c.shadowRoot&&c.shadowRoot.activeElement?n(c.shadowRoot):c:null}const t=n=>{const{activeElement:t}=document;t&&n.contains(t)&&document.activeElement?.blur()};function c(t,c,e){const o=n(),u=document.activeElement;if(e?.composedPath()?.length){return e.composedPath().includes(t)||e.composedPath().includes(c)}const r=n=>{const c=n.closest(t.tagName.toLowerCase());if(c)return c===t?c:r(c.parentElement);{const n=o.getRootNode().host;if(n&&n===t)return n}return null};return r(o)||o===c||u===c||r(u)}export{t as b,c as f,n as g}