/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@biotope/element@4.3.0/lib/esm/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const kebabToCamel=e=>{const t=e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase())).replace(/-/g,"");return(t[0]||"").toLowerCase()+t.slice(1)},camelToKebab=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),contentToString=e=>"string"==typeof e?e:e&&"function"==typeof e.toString?e.toString():`${e}`,stringToTemplateLiteral=e=>Object.freeze(Object.defineProperties([e],{raw:{value:Object.freeze([e])}})),getComponentName=e=>e.componentName||camelToKebab(e.name||e.toString().match(/^function\s*([^\s(]+)/)[1]),isRegistered=e=>{switch(document.createElement(e).constructor){case HTMLElement:case HTMLUnknownElement:return!1;default:return!0}},parseOrUndefined=e=>{try{return JSON.parse(e)}catch(e){return}},toBoolean=e=>"boolean"==typeof e?e:!!e&&"false"!==e||""===e,toNumber=e=>{if("number"==typeof e)return e;let t=+e;if(t!=t){const r=parseFloat(e);t=r||0===r?r:t}return t},toArray=e=>{if(Array.isArray(e))return e;if("string"==typeof e){const t=parseOrUndefined(e);return"object"!=typeof t?null:Object.keys(t).reduce(((e,r)=>[...e,t[r]]),[])}if(e)try{return Object.keys(e).reduce(((t,r)=>[...t,e[r]]),[])}catch(e){}return[...new Array(e)]},toObject=e=>{if("object"==typeof e&&!Array.isArray(e))return e;if("string"==typeof e){const t=parseOrUndefined(e);return"object"!=typeof t?null:Object.keys(t).reduce(((e,r)=>Object.assign(Object.assign({},e),{[r]:t[r]})),{})}if(e)try{return Object.keys(e).reduce(((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]})),{})}catch(e){}return[...new Array(e)].reduce(((e,t,r)=>Object.assign(Object.assign({},e),{[r]:t})),{})},toFunction=e=>{if("function"==typeof e)return e;try{return new Function(`return ${e};`)()}catch(e){return null}},toString=e=>"string"==typeof e?e:e&&"function"==typeof e.toString?e.toString():null,attributeName=e=>"string"==typeof e?e:e.name,attributeValue=(e,t)=>{if("string"==typeof e)return t;if("function"==typeof e.converter)return e.converter(t);switch(e.type||"string"){case"boolean":return toBoolean(t);case"number":return toNumber(t);case"array":return toArray(t);case"object":return toObject(t);case"function":return toFunction(t);default:return toString(t)}},register=(e,t)=>{const r=getComponentName(e);if(e.componentName||(t&&console.warn(`Static property "componentName" missing. Setting it to "${r}"…`),e.componentName=r),isRegistered(e.componentName))return t&&console.warn(`Attempt to re-register component "${e.componentName}". Skipping…`),!1;e.dependencies.forEach((e=>e.register(t)));const n=(e.attributes&&e.attributes.length?e.attributes:[]).filter((e=>e));e.observedAttributes=n.map(attributeName),n.forEach((t=>{const r=attributeName(t),n=kebabToCamel(r),a={get(){return this.props[n]},set(e){null==e||!1===e||"false"===e?this.removeAttribute(r):"string"==typeof e&&this.setAttribute(r,e),this.attributeChangedCallback(r,this.props[n],e)}};Object.defineProperty(e.prototype,r,a),Object.defineProperty(e.prototype,n,a)}));const a=e.prototype.connectedCallback;e.prototype.connectedCallback=function(){const e=this;for(a.bind(e)();e.__attributeChangedCallbackStack.length;)e.__attributeChangedCallbackStack.pop()();e.__created=!0,e.render(),e.emit("connected",void 0,!0)};const o=e.prototype.attributeChangedCallback;e.prototype.attributeChangedCallback=function(...e){const t=this,r=()=>{o.bind(t)(...e),t.emit("attributechanged",void 0,!0)};t.__created?r():t.__attributeChangedCallbackStack.unshift(r)};const i=e.prototype.disconnectedCallback;return e.prototype.disconnectedCallback=function(){i.bind(this)(),this.emit("disconnected",void 0,!0)},customElements.define(e.componentName,e),!0};
/*! (c) Andrea Giammarchi - ISC */
var self={};try{self.WeakMap=WeakMap}catch(e){self.WeakMap=function(e,t){var r=t.defineProperty,n=t.hasOwnProperty,a=o.prototype;return a.delete=function(e){return this.has(e)&&delete e[this._]},a.get=function(e){return this.has(e)?e[this._]:void 0},a.has=function(e){return n.call(e,this._)},a.set=function(e,t){return r(e,this._,{configurable:!0,value:t}),this},o;function o(t){r(this,"_",{value:"_@ungap/weakmap"+e++}),t&&t.forEach(i,this)}function i(e){this.set(e[0],e[1])}}(Math.random(),Object)}var WeakMap$1=self.WeakMap,isNoOp="object"!=typeof document,templateLiteral=function(e){var t,r="raw",n=(t=(document.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(t)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(t)),a=!(r in e)||e.propertyIsEnumerable(r)||!Object.isFrozen(e[r]);if(n||a){var o={},i=function(e){for(var t=".",r=0;r<e.length;r++)t+=e[r].length+"."+e[r];return o[t]||(o[t]=e)};if(a)templateLiteral=i;else{var s=new WeakMap$1;templateLiteral=function(e){return s.get(e)||function(e,t){return s.set(e,t),t}(e,i(e))}}}else isNoOp=!0;return TL(e)};function TL(e){return isNoOp?e:templateLiteral(e)}function tta(e){for(var t=arguments.length,r=[TL(e)],n=1;n<t;)r.push(arguments[n++]);return r}
/*! (c) Andrea Giammarchi - ISC */var UID="-"+Math.random().toFixed(6)+"%",UID_IE=!1;try{(function(e,t,r){return t in e&&(e.innerHTML="<p "+r+'="'+UID+'"></p>',e[t].childNodes[0].getAttribute(r)==UID)})(document.createElement("template"),"content","tabindex")||(UID="_dt: "+UID.slice(1,-1)+";",UID_IE=!0)}catch(e){}var UIDC="\x3c!--"+UID+"--\x3e",COMMENT_NODE=8,ELEMENT_NODE=1,TEXT_NODE=3,SHOULD_USE_TEXT_CONTENT=/^(?:style|textarea)$/i,VOID_ELEMENTS=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
/*! (c) Andrea Giammarchi - ISC */
function domsanitizer(e){return e.join(UIDC).replace(selfClosing,fullClosing).replace(attrSeeker,attrReplacer)}var spaces=" \\f\\n\\r\\t",almostEverything="[^"+spaces+"\\/>\"'=]+",attrName="["+spaces+"]+"+almostEverything,tagName="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",attrPartials="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+almostEverything.replace("\\/","")+"))?)",attrSeeker=new RegExp(tagName+attrName+attrPartials+"+)(["+spaces+"]*/?>)","g"),selfClosing=new RegExp(tagName+attrName+attrPartials+"*)(["+spaces+"]*/>)","g"),findAttributes=new RegExp("("+attrName+"\\s*=\\s*)(['\"]?)"+UIDC+"\\2","gi");function attrReplacer(e,t,r,n){return"<"+t+r.replace(findAttributes,replaceAttributes)+n}function replaceAttributes(e,t,r){return t+(r||'"')+UID+(r||'"')}function fullClosing(e,t,r){return VOID_ELEMENTS.test(t)?e:"<"+t+r+"></"+t+">"}
/*! (c) Andrea Giammarchi - ISC */var createContent=function(e){var t="fragment",r="template",n="content"in o(r)?function(e){var t=o(r);return t.innerHTML=e,t.content}:function(e){var n=o(t),i=o(r),s=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;i.innerHTML="<table>"+e+"</table>",s=i.querySelectorAll(c)}else i.innerHTML=e,s=i.childNodes;return a(n,s),n};return function(e,t){return("svg"===t?i:n)(e)};function a(e,t){for(var r=t.length;r--;)e.appendChild(t[0])}function o(r){return r===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",r)}function i(e){var r=o(t),n=o("div");return n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",a(r,n.firstChild.childNodes),r}}(document);const{indexOf:iOF}=[],append=(e,t,r,n,a,o)=>{const i="selectedIndex"in t;let s=i;for(;n<a;){const a=e(r[n],1);if(t.insertBefore(a,o),i&&s&&a.selected){s=!s;let{selectedIndex:e}=t;t.selectedIndex=e<0?n:iOF.call(t.querySelectorAll("option"),a)}n++}},eqeq=(e,t)=>e==t,identity=e=>e,indexOf=(e,t,r,n,a,o,i)=>{const s=o-a;if(s<1)return-1;for(;r-t>=s;){let s=t,c=a;for(;s<r&&c<o&&i(e[s],n[c]);)s++,c++;if(c===o)return t;t=s+1}return-1},isReversed=(e,t,r,n,a,o)=>{for(;n<a&&o(r[n],e[t-1]);)n++,t--;return 0===t},next=(e,t,r,n,a)=>r<n?e(t[r],0):0<r?e(t[r-1],-0).nextSibling:a,remove=(e,t,r,n)=>{for(;r<n;)drop(e(t[r++],-1))},DELETION=-1,INSERTION=1,SKIP=0,SKIP_OND=50,HS=(e,t,r,n,a,o,i,s)=>{let c=0,l=n<s?n:s;const u=Array(l++),f=Array(l);f[0]=-1;for(let e=1;e<l;e++)f[e]=i;const d=a.slice(o,i);for(let n=t;n<r;n++){const t=d.indexOf(e[n]);if(-1<t){const e=t+o;c=findK(f,l,e),-1<c&&(f[c]=e,u[c]={newi:n,oldi:e,prev:u[c-1]})}}for(c=--l,--i;f[c]>i;)--c;l=s+n-c;const p=Array(l);let h=u[c];for(--r;h;){const{newi:e,oldi:t}=h;for(;r>e;)p[--l]=1,--r;for(;i>t;)p[--l]=-1,--i;p[--l]=0,--r,--i,h=h.prev}for(;r>=t;)p[--l]=1,--r;for(;i>=o;)p[--l]=-1,--i;return p},OND=(e,t,r,n,a,o,i)=>{const s=r+o,c=[];let l,u,f,d,p,h,m;e:for(l=0;l<=s;l++){if(l>50)return null;for(m=l-1,p=l?c[l-1]:[0,0],h=c[l]=[],u=-l;u<=l;u+=2){for(d=u===-l||u!==l&&p[m+u-1]<p[m+u+1]?p[m+u+1]:p[m+u-1]+1,f=d-u;d<o&&f<r&&i(n[a+d],e[t+f]);)d++,f++;if(d===o&&f===r)break e;h[l+u]=d}}const g=Array(l/2+s/2);let y=g.length-1;for(l=c.length-1;l>=0;l--){for(;d>0&&f>0&&i(n[a+d-1],e[t+f-1]);)g[y--]=0,d--,f--;if(!l)break;m=l-1,p=l?c[l-1]:[0,0],u=d-f,u===-l||u!==l&&p[m+u-1]<p[m+u+1]?(f--,g[y--]=1):(d--,g[y--]=-1)}return g},applyDiff=(e,t,r,n,a,o,i,s,c)=>{const l=[],u=e.length;let f=i,d=0;for(;d<u;)switch(e[d++]){case 0:a++,f++;break;case 1:l.push(n[a]),append(t,r,n,a++,a,f<s?t(o[f],0):c);break;case-1:f++}for(d=0;d<u;)switch(e[d++]){case 0:i++;break;case-1:-1<l.indexOf(o[i])?i++:remove(t,o,i++,i)}},findK=(e,t,r)=>{let n=1,a=t;for(;n<a;){const t=(n+a)/2>>>0;r<e[t]?a=t:n=t+1}return n},smartDiff=(e,t,r,n,a,o,i,s,c,l,u,f,d)=>{applyDiff(OND(r,n,o,i,s,l,f)||HS(r,n,a,o,i,s,c,l),e,t,r,n,i,s,u,d)},drop=e=>(e.remove||dropChild).call(e);function dropChild(){const{parentNode:e}=this;e&&e.removeChild(this)}
/*! (c) 2018 Andrea Giammarchi (ISC) */const domdiff=(e,t,r,n)=>{n||(n={});const a=n.compare||eqeq,o=n.node||identity,i=null==n.before?null:o(n.before,0),s=t.length;let c=s,l=0,u=r.length,f=0;for(;l<c&&f<u&&a(t[l],r[f]);)l++,f++;for(;l<c&&f<u&&a(t[c-1],r[u-1]);)c--,u--;const d=l===c,p=f===u;if(d&&p)return r;if(d&&f<u)return append(o,e,r,f,u,next(o,t,l,s,i)),r;if(p&&l<c)return remove(o,t,l,c),r;const h=c-l,m=u-f;let g=-1;if(h<m){if(g=indexOf(r,f,u,t,l,c,a),-1<g)return append(o,e,r,f,g,o(t[l],0)),append(o,e,r,g+h,u,next(o,t,c,s,i)),r}else if(m<h&&(g=indexOf(t,l,c,r,f,u,a),-1<g))return remove(o,t,l,g),remove(o,t,g+m,c),r;return h<2||m<2?(append(o,e,r,f,u,o(t[l],0)),remove(o,t,l,c),r):h===m&&isReversed(r,u,t,l,c,a)?(append(o,e,r,f,u,next(o,t,c,s,i)),r):(smartDiff(o,e,r,f,u,m,t,l,c,h,s,a,i),r)};
/*! (c) Andrea Giammarchi - ISC */var importNode=function(e,t,r,n,a){var o=a in e,i=e.createDocumentFragment();return i[t](e[n]("g")),i[t](e[n]("")),(o?e[a](i,!0):i[r](!0)).childNodes.length<2?function e(n,a){for(var o=n[r](),i=n.childNodes||[],s=i.length,c=0;a&&c<s;c++)o[t](e(i[c],a));return o}:o?e[a]:function(e,t){return e[r](!!t)}}(document,"appendChild","cloneNode","createTextNode","importNode"),trim="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},normalizeAttributes=UID_IE?function(e,t){var r=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return r.indexOf(e.name)<=r.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function find(e,t){for(var r=t.length,n=0;n<r;)e=e.childNodes[t[n++]];return e}function parse(e,t,r,n){for(var a=e.childNodes,o=a.length,i=0;i<o;){var s=a[i];switch(s.nodeType){case ELEMENT_NODE:var c=n.concat(i);parseAttributes(s,t,r,c),parse(s,t,r,c);break;case COMMENT_NODE:var l=s.textContent;if(l===UID)r.shift(),t.push(SHOULD_USE_TEXT_CONTENT.test(e.nodeName)?Text(e,n):Any(s,n.concat(i)));else switch(l.slice(0,2)){case"/*":if("*/"!==l.slice(-2))break;case"👻":e.removeChild(s),i--,o--}break;case TEXT_NODE:SHOULD_USE_TEXT_CONTENT.test(e.nodeName)&&trim.call(s.textContent)===UIDC&&(r.shift(),t.push(Text(e,n)))}i++}}function parseAttributes(e,t,r,n){for(var a=e.attributes,o=[],i=[],s=normalizeAttributes(a,r),c=s.length,l=0;l<c;){var u,f=s[l++],d=f.value===UID;if(d||1<(u=f.value.split(UIDC)).length){var p=f.name;if(o.indexOf(p)<0){o.push(p);var h=r.shift().replace(d?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+p+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),m=a[h]||a[h.toLowerCase()];if(d)t.push(Attr(m,n,h,null));else{for(var g=u.length-2;g--;)r.shift();t.push(Attr(m,n,h,u))}}i.push(f)}}l=0;for(var y=(0<(c=i.length)&&UID_IE&&!("ownerSVGElement"in e));l<c;){var b=i[l++];y&&(b.value=""),e.removeAttribute(b.name)}var v=e.nodeName;if(/^script$/i.test(v)){var N=document.createElement(v);for(c=a.length,l=0;l<c;)N.setAttributeNode(a[l++].cloneNode(!0));N.textContent=e.textContent,e.parentNode.replaceChild(N,e)}}function Any(e,t){return{type:"any",node:e,path:t}}function Attr(e,t,r,n){return{type:"attr",node:e,path:t,name:r,sparse:n}}function Text(e,t){return{type:"text",node:e,path:t}}var parsed=new WeakMap$1;function createInfo(e,t){var r=(e.convert||domsanitizer)(t),n=e.transform;n&&(r=n(r));var a=createContent(r,e.type);cleanContent(a);var o=[];parse(a,o,t.slice(0),[]);var i={content:a,updates:function(r){for(var n=[],a=o.length,i=0,s=0;i<a;){var c=o[i++],l=find(r,c.path);switch(c.type){case"any":n.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,f=e.attribute(l,c.name,c.node);null===u?n.push({fn:f,sparse:!1}):(s+=u.length-2,n.push({fn:f,sparse:!0,values:u}));break;case"text":n.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return a+=s,function(){var e=arguments.length;if(a!==e-1)throw new Error(e-1+" values instead of "+a+"\n"+t.join("${value}"));for(var o=1,i=1;o<e;){var s=n[o-i];if(s.sparse){var c=s.values,l=c[0],u=1,f=c.length;for(i+=f-2;u<f;)l+=arguments[o++]+c[u++];s.fn(l)}else s.fn(arguments[o++])}return r}}};return parsed.set(t,i),i}function createDetails(e,t){var r=parsed.get(t)||createInfo(e,t);return r.updates(importNode.call(document,r.content,!0))}var empty=[];function domtagger(e){var t=empty,r=cleanContent;return function(n){return t!==n&&(r=createDetails(e,t=n)),r.apply(null,arguments)}}function cleanContent(e){for(var t=e.childNodes,r=t.length;r--;){var n=t[r];1!==n.nodeType&&0===trim.call(n.textContent).length&&e.removeChild(n)}}
/*! (c) Andrea Giammarchi - ISC */var hyperStyle=function(){var e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,t=/([^A-Z])([A-Z]+)/g;return function(e,t){return"ownerSVGElement"in e?function(e,t){var r;t?r=t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),r=e.getAttributeNode("style"));return r.value="",e.setAttributeNode(r),n(r,!0)}(e,t):n(e.style,!1)};function r(e,t,r){return t+"-"+r.toLowerCase()}function n(n,a){var o,i;return function(s){var c,l,u,f;switch(typeof s){case"object":if(s){if("object"===o){if(!a&&i!==s)for(l in i)l in s||(n[l]="")}else a?n.value="":n.cssText="";for(l in c=a?{}:n,s)u="number"!=typeof(f=s[l])||e.test(l)?f:f+"px",!a&&/^--/.test(l)?c.setProperty(l,u):c[l]=u;o="object",a?n.value=function(e){var n,a=[];for(n in e)a.push(n.replace(t,r),":",e[n],";");return a.join("")}(i=c):i=s;break}default:i!=s&&(o="string",i=s,a?n.value=s||"":n.cssText=s||"")}}}}(),Wire=function(e,t){return(t=r.prototype).ELEMENT_NODE=1,t.nodeType=111,t.remove=function(e){var t=this.childNodes,r=this.firstChild,n=this.lastChild;if(this._=null,e&&2===t.length)n.parentNode.removeChild(n);else{var a=this.ownerDocument.createRange();a.setStartBefore(e?t[1]:r),a.setEndAfter(n),a.deleteContents()}return r},t.valueOf=function(e){var t=this._,r=null==t;if(r&&(t=this._=this.ownerDocument.createDocumentFragment()),r||e)for(var n=this.childNodes,a=0,o=n.length;a<o;a++)t.appendChild(n[a]);return t},r;function r(t){var r=this.childNodes=e.call(t,0);this.firstChild=r[0],this.lastChild=r[r.length-1],this.ownerDocument=r[0].ownerDocument,this._=null}}([].slice);
/*! (c) Andrea Giammarchi - ISC */const{isArray:isArray}=Array,{create:create,freeze:freeze,keys:keys}=Object,wireType=Wire.prototype.nodeType,asNode=(e,t)=>e.nodeType===wireType?1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild:e,canDiff=e=>"ELEMENT_NODE"in e,hyperAttribute=(e,t)=>{let r,n=!1;const a=t.cloneNode(!0);return t=>{r!==t&&(r=t,a.value!==t&&(null==t?(n&&(n=!1,e.removeAttributeNode(a)),a.value=t):(a.value=t,n||(n=!0,e.setAttributeNode(a)))))}},hyperEvent=(e,t)=>{let r,n=t.slice(2);return t.toLowerCase()in e&&(n=n.toLowerCase()),t=>{r!==t&&(r&&e.removeEventListener(n,r,!1),r=t,t&&e.addEventListener(n,t,!1))}},hyperProperty=(e,t)=>{let r;return n=>{r!==n&&(r=n,e[t]!==n&&(null==n?(e[t]="",e.removeAttribute(t)):e[t]=n))}},hyperRef=e=>t=>{t.current=e},hyperSetter=(e,t,r)=>r?r=>{try{e[t]=r}catch(n){e.setAttribute(t,r)}}:r=>{e[t]=r},readOnly=/^(?:form|list)$/i,slice=[].slice,text=(e,t)=>e.ownerDocument.createTextNode(t);function Tagger(e){return this.type=e,domtagger(this)}function invoke(e){return e(this)}Tagger.prototype={attribute(e,t,r){const n="svg"===this.type;switch(t){case"class":if(n)return hyperAttribute(e,r);t="className";case"data":case"props":return hyperProperty(e,t);case"style":return hyperStyle(e,r,n);case"ref":return hyperRef(e);default:return"."===t.slice(0,1)?hyperSetter(e,t.slice(1),n):"on"===t.slice(0,2)?hyperEvent(e,t):!(t in e)||n||readOnly.test(t)?hyperAttribute(e,r):hyperProperty(e,t)}},any(e,t){const r={node:asNode,before:e},{type:n}=this;let a,o=!1;const i=s=>{switch(typeof s){case"string":case"number":case"boolean":o?a!==s&&(a=s,t[0].textContent=s):(o=!0,a=s,t=domdiff(e.parentNode,t,[text(e,s)],r));break;case"function":i(s(e));break;case"object":case"undefined":if(null==s){o=!1,t=domdiff(e.parentNode,t,[],r);break}default:if(o=!1,a=s,isArray(s))if(0===s.length)t.length&&(t=domdiff(e.parentNode,t,[],r));else switch(typeof s[0]){case"string":case"number":case"boolean":i(String(s));break;case"function":i(s.map(invoke,e));break;case"object":isArray(s[0])&&(s=s.concat.apply([],s));default:t=domdiff(e.parentNode,t,s,r)}else canDiff(s)?t=domdiff(e.parentNode,t,11===s.nodeType?slice.call(s.childNodes):[s],r):"text"in s?i(String(s.text)):"any"in s?i(s.any):"html"in s?t=domdiff(e.parentNode,t,slice.call(createContent([].concat(s.html).join(""),n).childNodes),r):"length"in s&&i(slice.call(s))}};return i},text(e){let t;const r=n=>{if(t!==n){t=n;const a=typeof n;"object"===a&&n?"text"in n?r(String(n.text)):"any"in n?r(n.any):"html"in n?r([].concat(n.html).join("")):"length"in n&&r(slice.call(n).join("")):"function"===a?r(n(e)):e.textContent=null==n?"":n}};return r}};const cache=new WeakMap$1,createRender=e=>({html:outer("html",e),svg:outer("svg",e),render(t,r){const n="function"==typeof r?r():r,a=cache.get(t)||setCache(t),o=n instanceof Hole?retrieve(e,a,n):n;return o!==a.wire&&(a.wire=o,t.textContent="",t.appendChild(o.valueOf(!0))),t}}),newInfo=()=>({sub:[],stack:[],wire:null}),outer=(e,t)=>{const r=new WeakMap$1;return n.for=(e,a)=>{const o=r.get(e)||(e=>{const t=create(null);return r.set(e,t),t})(e);return o[a]||(o[a]=(i=newInfo(),function(){return retrieve(t,i,n.apply(null,arguments))}));var i},n.node=function(){return retrieve(t,newInfo(),n.apply(null,arguments)).valueOf(!0)},n;function n(){return new Hole(e,tta.apply(null,arguments))}},retrieve=(e,t,r)=>{const{sub:n,stack:a}=t,o={a:0,aLength:n.length,i:0,iLength:a.length},i=unroll(e,t,r,o),{a:s,i:c,aLength:l,iLength:u}=o;return s<l&&n.splice(s),c<u&&a.splice(c),i},setCache=e=>{const t=newInfo();return cache.set(e,t),t},unroll=(e,t,r,n)=>{const{stack:a}=t,{i:o,iLength:i}=n,{type:s,args:c}=r,l=o===i;l&&(n.iLength=a.push({type:s,id:c[0],tag:null,wire:null})),n.i++,unrollArray(e,t,c,n);const u=a[o];return l||u.id!==c[0]||u.type!==s?(u.type=s,u.id=c[0],u.tag=new e(s),u.wire=wiredContent(u.tag.apply(null,c))):u.tag.apply(null,c),u.wire},unrollArray=(e,t,r,n)=>{for(let a=1,{length:o}=r;a<o;a++){const o=r[a];if("object"==typeof o&&o)if(o instanceof Hole)r[a]=unroll(e,t,o,n);else if(isArray(o))for(let r=0,{length:a}=o;r<a;r++){const a=o[r];if("object"==typeof a&&a&&a instanceof Hole){const{sub:i}=t,{a:s,aLength:c}=n;s===c&&(n.aLength=i.push(newInfo())),n.a++,o[r]=retrieve(e,i[s],a)}}}},wiredContent=e=>{const t=e.childNodes,{length:r}=t;return 1===r?t[0]:r?new Wire(t):e};function Hole(e,t){this.type=e,this.args=t}freeze(Hole);const{render:render,html:html,svg:svg}=createRender(Tagger),createRender$1=(e,t,r)=>{const n=render.bind(e,e.shadowRoot||e,(()=>{let n=t();return e.styles&&(n=e.html`
          ${n}
          ${e.createStyle(e.styles)}
        `),setTimeout(r),n}));return()=>e.__created?n():null},createPartial=()=>html,createStyle=e=>html`
  <style>${contentToString(e)}</style>
`,createRaw=e=>html(stringToTemplateLiteral(contentToString(e))),attributeChangedCallback=(e,t,r,n)=>{const a=e.constructor.attributes.filter((e=>attributeName(e)===t))[0];if(a){const r=kebabToCamel(t),o=attributeValue(a,n);o!==e.props[r]&&(e.__currentProps=Object.assign(Object.assign({},e.props),{[r]:o}),e.render())}},emit=(e,t,r,n)=>{if(!t)throw Error("No event name defined. Please provide a name.");return e.dispatchEvent(new CustomEvent(t,Object.assign({bubbles:!n},void 0!==r&&{detail:r})))},emitRendered=(e,t)=>{t.length&&t.some((e=>!e.__rendered))?setTimeout((()=>emitRendered(e,t))):(e.__rendered=!0,e.emit("rendered",void 0,!0))},ready=e=>{e.__ready||(e.__ready=!0,e.ready(),e.emit("ready",void 0,!0))},rendered=e=>{e.rendered();const t=[...(e.shadowRoot||e).querySelectorAll("*")].filter((e=>"boolean"==typeof e.__rendered));emitRendered(e,t)},render$1=(e,t)=>(e.__rendered=!1,t()),createRef=()=>({current:null}),createRefCallback=e=>({get current(){return e()}});class Component extends HTMLElement{constructor(e=!0){super(),this.__created=!1,this.__rendered=!1,this.__ready=!1,this.__attributeChangedCallbackStack=[],this.createStyle=createStyle,this.createRaw=createRaw,e&&this.attachShadow({mode:"open"});const t=this.render.bind(this);this.render=createRender$1(this,(()=>render$1(this,t)),(()=>{rendered(this),ready(this)}))}get props(){return this.__currentProps||(this.__currentProps=this.defaultProps||{}),this.__currentProps}get state(){return this.__currentState||(this.__currentState=this.defaultState||{}),this.__currentState}get html(){return this.__html||(this.__html=createPartial()),this.__html}get styles(){return this.__styles}set styles(e){this.__styles!==e&&(this.__styles=e,this.render())}static register(e=!1){return register(this,e)}connectedCallback(){}disconnectedCallback(){}attributeChangedCallback(e,t,r){return attributeChangedCallback(this,e,0,r)}render(){return null}rendered(){}ready(){}addEventListener(e,t,r){"ready"===e&&this.__ready?t():super.addEventListener(e,t,r)}emit(e,t,r=!1){return emit(this,e,t,r)}setState(e){this.__currentState=Object.assign(Object.assign({},this.state),"function"==typeof e?e.call(this,this.state):e),this.render()}}Component.dependencies=[],Component.attributes=[];export default Component;export{createRaw,createRef,createRefCallback,createStyle,html,toArray,toBoolean,toFunction,toNumber,toObject,toString};
//# sourceMappingURL=/sm/3ac3185ec32fb9e095b6b8445872adcebf27569a45863afd63f4edaaef0f3fa4.map