/*!
 * Custom elements for Nanopore-Digital Web applications
 */
import{h as t,a as n,g as e}from"./index-BM3Om9WE.js";const o=(()=>{try{return!!new CSSStyleSheet}catch(t){return!1}})(),i=new WeakMap;function s(s={}){return(u,f)=>{s.cacheKeyProperty||(s.cacheKeyProperty=f);const{componentWillLoad:l,render:h,componentWillRender:a}=u;if(o){const t=t=>{if(!t[s.cacheKeyProperty]||i.get(t)&&i.get(t)===t[s.cacheKeyProperty])return;i.set(t,t[s.cacheKeyProperty]);const n=e(t),o="function"==typeof t[f]?t[f]():t[f],c=n.shadowRoot||document;c.adoptedStyleSheets=[...c.adoptedStyleSheets||[],r(t,u,o,s)]};u.componentWillLoad=function(){const n=l&&l.call(this);return t(this),n},u.componentWillRender=function(){const n=a&&a.call(this);return t(this),n}}else u.render=function(){const e="function"==typeof this[f]?this[f]():this[f];let o=h.call(this);if(function(t){for(const e in t)if(e in t&&t[e]===n)return!0;return!1}(o))c(o,u.constructor.name,e);else if(o=t(n,null,o),"attachShadow"in HTMLElement.prototype){if(!u.__constructableStyle){const t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("constructible-style",u.constructor.name),t.innerHTML=e,u.__constructableStyle=t,document.head.appendChild(t)}}else c(o,u.constructor.name,e);return o}}}function c(n,e,o){(function(t){for(const n in t)if(n in t&&Array.isArray(t[n]))return t[n]}(n)||[]).push(t("style",{type:"text/css","constructible-style":e},o))}function r(t,n,e,o){n.__constructableStyle||(n.__constructableStyle={});const i=t[o.cacheKeyProperty];return n.__constructableStyle[i]||(n.__constructableStyle[i]=new CSSStyleSheet,n.__constructableStyle[i].replace(e)),n.__constructableStyle[i]}export{s as C}