/*!
 * Custom elements for Nanopore-Digital Web applications
 */
import"./index-BM3Om9WE.js";function t(e,n=!1,r=!1,i=!1){const a=[];if(e instanceof HTMLElement){if(function(t,e=!1){const n=t.tagName.toLowerCase();if(!["button","input","select","textarea","a","audio","video","summary"].includes(n))return!1;if("-1"===t.getAttribute("tabindex"))return!1;if(t.hasAttribute("disabled"))return!1;if(t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled"))return!1;if(t.hasAttribute("tabindex"))return!0;if(t.hasAttribute("contenteditable")&&"false"!==t.getAttribute("contenteditable"))return!0;if(("audio"===n||"video"===n)&&t.hasAttribute("controls"))return!0;if("input"===n&&"radio"===t.getAttribute("type")&&!t.hasAttribute("checked"))return!1;if("a"===n&&!t.hasAttribute("href"))return!1;if(!e){if(!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))return!1;if("function"==typeof t.checkVisibility&&!t.checkVisibility({opacityProperty:!0,visibilityProperty:!0}))return!1}return!0}(e,r)&&(a.push(e),n))return a;!i&&e.shadowRoot&&"open"===e.shadowRoot.mode&&t(e.shadowRoot,n,r).map((t=>{a.includes(t)||a.push(t)})),HTMLSlotElement&&e instanceof HTMLSlotElement&&e.assignedElements().map((e=>{t(e,n,r).map((t=>{a.includes(t)||a.push(t)}))}))}return Array.from(e.children).map((e=>{t(e,n,r).map((t=>{a.includes(t)||a.push(t)}))})),a}function e(e){const n=t(e,!0,!0);return n.length?n[0]:null}export{e as a,t as g}