nuclo 0.2.16 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nuclo.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Nuclo={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function n(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function r(e){return typeof e==`object`&&!!e}function i(e){return r(e)&&`tagName`in e}function a(e){return typeof e==`boolean`}function o(e){return typeof e==`function`}function s(e){return o(e)&&e.length===0}function c(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}let l=typeof window<`u`&&typeof document<`u`,u=new WeakMap;function d(e,t){let n=u.get(e);n?n.push(t):u.set(e,[t])}function f(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function p(e,t){let n=u.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)f(e,n[t]);u.delete(e);return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?f(e,a):n[r++]=a}n.length=r,r===0&&u.delete(e)}function m(e,t,n){return function(r){if(!l||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){c(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),d(i,{type:e,wrapped:a,options:n})}}let h=new Set,g=new WeakMap,_=new Set,v=new WeakMap;function y(e,t){let n=g.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue,n.info.sanitize=t.sanitize;return}let r=new WeakRef(e);h.add(r),g.set(e,{ref:r,info:t})}function b(e,t){let n=new WeakRef(e);_.add(n),v.set(e,{ref:n,info:t})}function ee(e){h.delete(e)}function x(e){_.delete(e)}function S(e){let t=g.get(e);t&&(h.delete(t.ref),g.delete(e))}function C(e){let t=v.get(e);t&&(_.delete(t.ref),v.delete(e))}let w=new WeakMap,T=new Set,E=new WeakMap,D=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{T.delete(e)}):null;function O(e,t){w.set(e,t);let n=new WeakRef(e);T.add(n),E.set(e,n),D?.register(e,n)}function te(e){w.delete(e);let t=E.get(e);t&&(T.delete(t),E.delete(e))}function ne(){let e=[],t=[];for(let n of T){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)T.delete(e);return e}function re(e){return w.get(e)??null}let ie=`http://www.w3.org/2000/svg`;function ae(e){return globalThis.document?document.createElement(e):null}function oe(e,t){return globalThis.document?document.createElementNS(e,t):null}function k(e){return globalThis.document?document.createTextNode(e):null}function se(){return globalThis.document?document.createDocumentFragment():null}function ce(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function le(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;p(t),C(t),te(t)}else e.nodeType===Node.TEXT_NODE?S(e):e.nodeType===Node.COMMENT_NODE&&te(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)le(e.childNodes[t])}function ue(e){if(!e?.parentNode)return!1;try{return le(e),e.parentNode.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function de(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function A(e){return globalThis.document?globalThis.document.createComment(e):null}function fe(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function pe(e,t){let n=A(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=A(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function me(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;ue(n),n=e}}function he(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)de(n,e[r],t)}function ge(e,...t){if(!e)return e;for(let n=0;n<t.length;n++){let r=t[n];if(r!=null){let t;if(typeof r==`string`){let e=k(r);if(e)t=e;else continue}else t=r;ce(e,t)}}return e}function j(e){return e?.isConnected===!0}function _e(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return c(`Error replacing conditional node`,e),!1}}function ve(e){return e}function ye(e,t,n){let r=ve(e),i=r.appendChild.bind(r),a=r.insertBefore.bind(r);r.appendChild=function(e){return a(e,t)};try{return n()}finally{r.appendChild=i}}function be(e,t,n){try{if(n==null||n===``)return e.style[t]=``,!0;let r=String(n);return e.style[t]=r,!0}catch{return!1}}let xe={},Se=!1;function Ce(e){let t=e.target;if(!t||typeof Node>`u`||!(t instanceof Node))return;let n=t;for(;n;){if(n instanceof Element){let e=v.get(n);e&&(j(n)?Oe(e.info):(x(e.ref),v.delete(n)))}n=n.parentNode}}function we(){Se||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,Ce,!0),Se=!0)}function Te(e){let t=v.get(e);if(t)return t.info;let n={attributeResolvers:[]};return b(e,n),n}function Ee(e){return typeof e!=`object`||!e}function De(e){let t;try{t=e.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=Ee(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:xe}catch(t){c(`Failed to apply reactive attribute: ${e.key}`,t)}}function Oe(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)De(t[e])}function ke(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){c(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:xe};if(!l){De(i);return}we();let a=Te(e).attributeResolvers,o=!1;for(let e=0;e<a.length;e++)if(a[e].key===t){a[e]=i,o=!0;break}o||a.push(i),De(i)}function Ae(e){let t=[];for(let n of _){let r=n.deref();if(r===void 0){t.push(n);continue}let i=v.get(r);if(!i){t.push(n);continue}if(!j(r)){v.delete(r),t.push(n);continue}e&&!e.contains(r)||Oe(i.info)}for(let e of t)x(e)}function je(e,t){if(!(!e?.style||!t))for(let n in t)be(e,n,t[n])||c(`Failed to set style property '${n}'`)}function Me(e,t){e&&(o(t)?ke(e,`style`,t,function(t){je(e,t)}):je(e,t))}let M=new WeakMap,Ne=new WeakSet;function N(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function Pe(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Fe(e){if(e.className&&!M.has(e)){let t=new Set;N(t,e.className),M.set(e,t)}Ne.add(e)}function Ie(e){return Ne.has(e)}function Le(e,t){if(!t)return;let n=M.get(e);n||(n=new Set,M.set(e,n)),N(n,t)}function Re(e,t){let n=M.get(e);if(!n||n.size===0){let n=t||``;e.className!==n&&(e.className=n);return}if(!t){e.className=Pe(n);return}let r=Pe(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}e.className=r}function ze(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;N(r,n),N(r,t),e.className=Pe(r)}else e.className=t}function Be(e,t,n){if(typeof e!=`function`){c(`Invalid resolver provided to createReactiveTextNode`);let e=k(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let r;if(arguments.length>1)r=t;else try{r=e()}catch(e){c(`Failed to evaluate reactive text resolver`,e),r=``}let i=r===void 0?``:String(r),a=k(i);if(!a)throw Error(`Failed to create text node: document not available`);return l&&y(a,{resolver:e,lastValue:i,sanitize:n}),a}function Ve(e){let t=[];for(let n of h){let r=n.deref();if(r===void 0){t.push(n);continue}let i=g.get(r);if(!i){t.push(n);continue}let a=i.info;if(!j(r)){g.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){c(`Failed to update reactive text node`,e),o=void 0}let s=a.sanitize?o==null||typeof o==`object`||typeof o==`function`?``:String(o):o===void 0?``:String(o);s!==a.lastValue&&(r.textContent=s,a.lastValue=s)}for(let e of t)ee(e)}function He(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){ze(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(t,String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(t,String(n))}else e instanceof Element&&e.setAttribute(t,String(n))}}function Ue(e,t,n,r=!1){if(n!=null){if(t===`style`){Me(e,n);return}if(o(n)){let r=String(t);if(r.charCodeAt(0)===111&&r.charCodeAt(1)===110){e[r]=n;return}if(n.length===0){let t=n;r===`className`&&e instanceof HTMLElement?(Fe(e),ke(e,r,t,function(t){Re(e,String(t||``))})):ke(e,r,t,function(t){He(e,r,t,!1)});return}}if(t===`className`&&e instanceof HTMLElement&&Ie(e)){let t=String(n||``);t&&(Le(e,t),ze(e,t));return}He(e,String(t),n,r)}}function We(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];Ue(e,r,i,n&&r===`className`)}}let P=!1,Ge=new WeakMap;function F(){return P}function Ke(){return!1}function qe(){P=!0,Ge=new WeakMap}function Je(){P=!1}function Ye(e){let t=P;P=!1;try{return e()}finally{P=t}}function I(e){let t=Ge.get(e);return t===void 0?e.firstChild:t}function L(e,t){Ge.set(e,t)}function Xe(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function R(e){let t=I(e),n=!1;for(;t&&Xe(t);)t=t.nextSibling,n=!0;n&&L(e,t)}function z(e){let t=I(e);return t&&L(e,t.nextSibling),t}function Ze(e,t){if(!P)return null;R(e);let n=I(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?z(e):null}function Qe(e,t){if(!t)return;let n=I(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}L(e,null)}let B=new WeakMap;function $e(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function et(e){R(e);let t=I(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function tt(e,t){let n=I(e);if(n&&n.nodeType===3)return z(e),n.textContent!==t&&(n.textContent=t),n;let r=k(t);return r?(e.insertBefore(r,n),L(e,n),r):null}function V(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=B.get(i);if(n||(n={value:i(),error:!1},B.set(i,n)),n.error)return rt(a,()=>``);let r=n.value;if($e(r))return We(e,{className:()=>{let e=i();return $e(e)?e.className:``}}),null;if(t(r)){let t=i,n=r??``;if(F()&&et(e)){let r=e;z(r);let i=String(n),a=tt(r,i);return a&&y(a,{resolver:t,lastValue:i,sanitize:!0}),null}return rt(a,t,n,!0)}return null}catch(e){return B.set(i,{value:void 0,error:!0}),c(`Error evaluating reactive text function:`,e),rt(a,()=>``)}let o=i(e,a);return o==null?null:t(o)?it(a,o):n(o)?o:(r(o)&&We(e,o),null)}let l=i;if(t(l)){if(F()&&et(e)){let t=e;return z(t),tt(t,String(l)),null}return it(a,l)}return n(l)?l:(We(e,l),null)}function nt(e,t){if(l&&!F()&&!Ke())return t;let n=se();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=A(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function rt(e,t,n,r){return nt(e,Be(t,n,r))}function it(e,t){return nt(e,k(String(t)))}let at=Symbol(`nuclo.factory.tag`),ot=Symbol(`nuclo.factory.mods`),st=0;function ct(e,t,n){e[at]=t,e[ot]=n}function H(e){return typeof e==`function`?e[ot]:void 0}function U(e){return typeof e==`function`?e[at]:void 0}function lt(){return st>0}function ut(e){st++;try{return e()}finally{st--}}function W(e,t,n=0){if(!t||t.length===0)return;let r=n,i=e;for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;let o=V(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function dt(e,t){let n=ae(e);return W(n,t,0),n}function ft(e,t){let n=oe(ie,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return W(n,t,0),n}function pt(e,...t){if(lt()){let n=function(){return null};return ct(n,e,t),n}let n=function(n,r=0){let i=n,a=i?Ze(i,e):null,o=a??ae(e),s=o,c=a?s.lastChild:null;return W(o,t,r),a&&Qe(s,c),o};return ct(n,e,t),n}function mt(e,...t){if(lt()){let n=function(){return null};return ct(n,e,t),n}return function(n,r=0){let i=n,a=i?Ze(i,e):null,o=a??oe(`http://www.w3.org/2000/svg`,e);if(!o)throw Error(`Failed to create SVG element: ${e}`);let s=o,c=a?s.lastChild:null;return W(o,t,r),a&&Qe(s,c),o}}function ht(e){return(...t)=>pt(e,...t)}function gt(e){return(...t)=>mt(e,...t)}let _t=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),vt=`a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),yt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function bt(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let r=n();return Object.defineProperty(e,t,{value:r,configurable:!0,enumerable:!0,writable:!0}),r},set(n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}})}function xt(e,t){t in e&&typeof e[t]!=`function`||(bt(e,t,()=>ht(t)),t===`var`&&bt(e,`var_`,()=>ht(t)))}function St(e,t){let n=`${t}Svg`;n in e||bt(e,n,()=>gt(t))}function Ct(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<vt.length;t++)St(e,vt[t]);for(let t=0;t<_t.length;t++)xt(e,_t[t]);e[t]=!0}}function G(e,t,n){if(o(e)){let r=e(t,n);return r&&i(r)?r:null}return e&&i(e)?e:null}function wt(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110}function Tt(e,t){let r=[],i=0;for(let e=0;e<t.length;e++){let a=t[e];if(a==null){r.push({kind:4});continue}let o=typeof a;if(o===`function`){let e=H(a);if(e!==void 0){let t=U(a);if(!t)return null;let n=Tt(t,e);if(!n)return null;r.push({kind:3,child:n});continue}if(a.length===0){let e;try{e=a(),B.set(a,{value:e,error:!1})}catch{return null}if(e==null||typeof e!=`object`&&typeof e!=`function`){r.push({kind:2});continue}return null}return null}if(o===`object`){if(n(a))return null;let e=a,t=Object.keys(e),o=[];for(let n=0;n<t.length;n++){let r=t[n],a=e[r];if(a==null){o.push({key:r,kind:3,prop:!1});continue}if(r===`style`)return null;let s=typeof a;if(s===`function`){if(wt(r)){o.push({key:r,kind:1,prop:!1});continue}if(r===`className`&&a.length===0){if(i++)return null;o.push({key:r,kind:2,prop:!1});continue}return null}if(s===`object`||r===`className`&&i++)return null;o.push({key:r,kind:0,prop:!1,value:a})}r.push({kind:0,keys:o});continue}r.push({kind:1})}return{tag:e,slots:r}}function Et(e,t){let n=e.slots,r=t.firstChild;for(let e=0;e<n.length;e++){let i=n[e];switch(i.kind){case 0:{let e=i.keys;for(let n=0;n<e.length;n++){let r=e[n];r.kind===0?r.prop=r.key in t:r.kind===2&&(t.className=``)}break}case 1:case 2:r&&=r.nextSibling;break;case 3:if(!r)return;Et(i.child,r),r=r.nextSibling;break}}}function Dt(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys;if(Object.keys(e).length!==t.length)return!1;for(let i=0;i<t.length;i++){let a=t[i],o=e[a.key];switch(a.kind){case 0:if(o==null||typeof o==`object`||typeof o==`function`)return!1;if(o===a.value)break;if(a.prop){let e=n;e[a.key]!==o&&(e[a.key]=o)}else{let e=String(o);n.getAttribute(a.key)!==e&&n.setAttribute(a.key,e)}break;case 1:if(typeof o!=`function`)return!1;n[a.key]=o;break;case 2:{if(typeof o!=`function`||o.length!==0)return!1;let e=o,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),r.push({kind:1,node:n,fn:e,last:i});break}case 3:if(o!=null)return!1;break}}break}case 1:if(s==null||typeof s==`object`||typeof s==`function`||!a)return!1;a.nodeValue=String(s),a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||H(s)!==void 0||!a)return!1;let e;try{e=s()}catch{return!1}if(e!=null&&(typeof e==`object`||typeof e==`function`))return!1;let t=e==null?``:String(e),n=a;n.nodeValue=t,r.push({kind:0,node:n,fn:s,last:t}),a=n.nextSibling;break}case 3:{let e=H(s);if(e===void 0||U(s)!==o.child.tag||!a||!Dt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function Ot(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let a in e){if(i>=t.length)return!1;let o=t[i];if(o.key!==a)return!1;i++;let s=e[a];if(o.kind===2){if(typeof s!=`function`||s.length!==0)return!1;C(n),r.push({kind:1,node:n,fn:s,last:n.className})}}if(i!==t.length)return!1;break}case 1:if(!a)return!1;a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||!a||a.nodeType!==3)return!1;let e=a;S(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=H(s);if(e===void 0||U(s)!==o.child.tag||!a||!Ot(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function kt(e){for(let t=0;t<e.length;t++){let n=e[t],r;try{r=n.fn()}catch{continue}if(n.kind===0){let e=r==null||typeof r==`object`||typeof r==`function`?``:String(r);e!==n.last&&(n.node.nodeValue=e,n.last=e)}else{let e=r?String(r):``;e!==n.last&&(n.node.className=e,n.last=e)}}}function At(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}let K=new Set,jt=new WeakMap,Mt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{K.delete(e)}):null,q=0;function Nt(e,t){let n=new WeakRef(e);K.add(n),jt.set(e,t),Mt?.register(e,n)}function Pt(e){return Array.isArray(e)?e:Array.from(e)}function J(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function Ft(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=l&&!F()&&!Ke(),a=r&&i?ut(()=>e.renderItem(t,n)):e.renderItem(t,n);if(J(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=H(a);if(i!==void 0){if(r===void 0){let t=U(a),r=t?Tt(t,i):null,o=G(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);Et(r,t);let n=[];if(Ot(r,i,o,n))n.length>0&&(e.lastRenderLeaves=n);else return e.template=null,e.lastRenderLeaves=null,o;e.template={tmpl:r,skeleton:t}}else e.template=null;return o}let o=r.skeleton.cloneNode(!0),s=[];if(Dt(r.tmpl,i,o,s))return s.length>0&&(e.lastRenderLeaves=s),o;e.template=null,e.lastRenderLeaves=null;let c=e.renderItem(t,n);return J(c)?(e.lastRenderRefresh=typeof c.update==`function`?c.update:null,c.element):G(c,e.host,n)}else if(r===void 0)e.template=null;else{e.template=null;let r=e.renderItem(t,n);return J(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):G(r,e.host,n)}}return G(a,e.host,n)}function Y(e){ue(e.element)}function It(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(l&&t.firstChild===n&&t.lastChild===r)return t.textContent=``,t.appendChild(n),t.appendChild(r),!0;for(let n=0;n<e.length;n++){let r=e[n].element;r&&r.parentNode===t&&t.removeChild(r)}return!0}function Lt(e){let t=e.length;if(t===0)return[];let n=Array(t),r=[];for(let i=0;i<t;i++){let t=e[i],a=0,o=r.length;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}n[i]=a>0?r[a-1]:-1,a===r.length?r.push(i):r[a]=i}let i=r.length,a=r[i-1],o=Array(i);for(;i>0;)o[--i]=a,a=n[a];return o}function Rt(e,t,n,r,i,a,o){let s=se(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Ft(e,r,l);if(!i)continue;let u=e.lastRenderLeaves;o.push({item:r,element:i,dyn:u,refresh:e.lastRenderRefresh,dynCreatedAt:u?e.currentFlushEpoch:void 0});let d=i;s?(s.appendChild(d),c++):t.insertBefore(d,a)}s&&c>0&&t.insertBefore(s,a)}function zt(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=Pt(e.itemsProvider());if(At(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!It(a,r,t,n))for(let e=0;e<o;e++)Y(a[e]);e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0;return}let c=0,l=Math.min(o,s);for(;c<l&&a[c].item===i[c];)c++;let u=0,d=l-c;for(;u<d&&a[o-1-u].item===i[s-1-u];)u++;let f=c,p=o-u,m=c,h=s-u;if(f===p){let t=p<o?a[p].element:n;if(p===o)Rt(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];Rt(e,r,i,m,h,t,n),e.records=a.slice(0,f).concat(n,a.slice(f)),e.allRecordsCreatedAt=void 0}e.lastSyncedItems=i.slice();return}if(m===h){for(let e=f;e<p;e++)Y(a[e]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice();return}let g=p-f,_=h-m,v=Array(_).fill(-1),y=new Uint8Array(g),b=0,ee=Math.min(p,h);for(let e=c;e<ee;e++)a[e].item===i[e]&&(v[e-m]=e,y[e-f]=1,b++);let x=new Map;for(let e=f;e<p;e++){if(y[e-f])continue;let t=a[e].item,n=x.get(t);n===void 0?x.set(t,e):typeof n==`number`?x.set(t,[n,e]):n.push(e)}for(let e=0;e<_;e++){if(v[e]!==-1)continue;let t=x.get(i[m+e]);if(t===void 0)continue;let n;typeof t==`number`?(n=t,x.delete(i[m+e])):(n=t.shift(),t.length===0&&x.delete(i[m+e])),v[e]=n,y[n-f]=1,b++}if(b===0&&f===0&&p===o){if(!It(a,r,t,n))for(let e=0;e<o;e++)Y(a[e]);let c=[];Rt(e,r,i,0,s,n,c),e.records=c,e.allRecordsCreatedAt=e.currentFlushEpoch,e.lastSyncedItems=i.slice();return}for(let e=f;e<p;e++)y[e-f]||Y(a[e]);let S=null;if(b>0){let e=[],t=[];for(let n=0;n<_;n++)v[n]!==-1&&(e.push(v[n]),t.push(n));S=new Uint8Array(_);let n=Lt(e);for(let e=0;e<n.length;e++)S[t[n[e]]]=1}let C=Array(_),w=0,T=p<o?a[p].element:n,E=null;for(let t=_-1;t>=0;t--){let n=v[t];if(n===-1){let n=i[m+t],a=Ft(e,n,m+t);if(!a){C[t]=null,w++;continue}let o=e.lastRenderLeaves;C[t]={item:n,element:a,dyn:o,refresh:e.lastRenderRefresh,dynCreatedAt:o?e.currentFlushEpoch:void 0};let s=a;E||=se(),E?E.insertBefore(s,E.firstChild):(r.insertBefore(s,T),T=s);continue}let o=a[n];C[t]=o;let s=o.element;if(E&&E.firstChild){let e=E.firstChild;r.insertBefore(E,T),T=e,E=null}(!S||!S[t])&&r.insertBefore(s,T),T=s}E&&E.firstChild&&r.insertBefore(E,T);let D=Array(f+(_-w)+(o-p)),O=0;for(let e=0;e<f;e++)D[O++]=a[e];for(let e=0;e<_;e++){let t=C[e];t&&(D[O++]=t)}for(let e=p;e<o;e++)D[O++]=a[e];e.records=D,e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice()}function Bt(e,t,n,r){return F()?Ht(e,t,n,r):Vt(e,t,n,r)}function Vt(e,t,n,r){let{start:i,end:a}=pe(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),zt(o),l&&Nt(i,o),o}function Ht(e,t,n,r){let i=n;R(i);let a=I(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return Vt(e,t,n,r);let o=z(i),s=0,c=I(i);for(;c;){if(c.nodeType===8){let e=c.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}c=c.nextSibling}let u=c;if(!u){let e=A(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return Vt(e,t,n,r);let d=Pt(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=J(r)?r:null,a=i?i.element:G(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=I(i);for(;p&&p!==u;){let e=p.nextSibling;ue(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}L(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return l&&Nt(o,h),h}function Ut(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null,n.dyn=null,n.refresh=null,delete n.dynCreatedAt}e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0}function Wt(e){let t=[];q++;for(let n of K){let r=n.deref();if(!r){t.push(n);continue}let i=jt.get(r);if(!i){t.push(n);continue}if(!j(r)||!j(i.endMarker)){Ut(i),jt.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=q;try{zt(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===q)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===q)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&kt(n)}}for(let e of t)K.delete(e)}function Gt(e,t){return function(n,r){return Bt(e,t,n,r).startMarker}}function Kt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function qt(e,t){return typeof e==`function`?Kt(e,t):!!e}let Jt=new Set,Yt=new WeakMap,Xt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Jt.delete(e)}):null;function Zt(e,t){for(let t=0;t<e.length;t++)if(qt(e[t].condition))return t;return t.length>0?-1:null}function Qt(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Zt(t,n);o!==e.activeIndex&&(me(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&he(nn(o>=0?t[o].content:n,r,i,a),a))}function $t(e){let t=new WeakRef(e.startMarker);Jt.add(t),Yt.set(e.startMarker,e),Xt?.register(e.startMarker,t)}function en(e){let t=[];for(let n of Jt){let r=n.deref();if(r===void 0){t.push(n);continue}let i=Yt.get(r);if(!i){t.push(n);continue}if(!j(r)||!j(i.endMarker)){Yt.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch(e){c(`when() branch threw during update; unregistering this conditional`,e),Yt.delete(r),t.push(n)}}for(let e of t)Jt.delete(e)}function tn(e,t,n,r){return o(e)?s(e)?(B.delete(e),V(t,e,n)):ye(t,r,()=>{let r=V(t,e,n);return r&&!r.parentNode?r:null}):V(t,e,n)}function nn(e,t,n,r){let i=[];for(let a of e){let e=tn(a,t,n,r);e&&i.push(e)}return i}function rn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function an(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var on=class e{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}cloneWith(t,n){let r=Object.create(e.prototype);return r.groups=[...this.groups],t&&r.groups.push(t),r.elseContent=n??[...this.elseContent],r}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){return globalThis.document?F()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=pe(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=ve(e);return a.appendChild(n),a.appendChild(r),Qt(i),n.textContent=rn(t,i.activeIndex),n}hydrateRender(e,t){let n=e;R(n);let r=I(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=z(n),a=0,o=I(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=A(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=Zt(this.groups,this.elseContent),u=an(i.textContent);if(!c&&(u===void 0||u===l)){if(l!==null){let n=l>=0?this.groups[l].content:this.elseContent;for(let r of n)V(e,r,t)}}else if(me(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;Ye(()=>{he(nn(n,e,t,r),r)})}return L(n,s.nextSibling),this.createRuntimeFromMarkers(e,t,i,s,l),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:i,update:function(){Qt(a)}};return l&&$t(a),a}};function sn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return sn(e.cloneWith({condition:t,content:n}))},else:function(...t){return sn(e.cloneWith(void 0,t))}})}function cn(e,...t){return sn(new on(e,...t))}function ln(e){try{return e.isSvg?ft(e.tagName,e.modifiers):dt(e.tagName,e.modifiers)}catch(t){if(c(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=oe(ie,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=ae(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function un(e){let t=re(e);if(!t)return;let n=Kt(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=ln(t);O(n,t),_e(e,n)}else if(!n&&r){let n=fe(t.tagName);n&&(O(n,t),_e(e,n))}}function dn(e){if(l)try{let t=ne();for(let n of t){if(!n.isConnected){te(n);continue}e&&!e.contains(n)||un(n)}}catch(e){c(`Error during conditional elements update`,e)}}let fn=new Map;function pn(e){let t=[],n=new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}function mn(e,t){let n=fn.get(e);n||(n=new Set,fn.set(e,n)),n.add(new WeakRef(t))}function hn(e){let t=pn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=fn.get(e);if(!t)continue;let r=[];for(let e of t){let t=e.deref();if(t===void 0){r.push(e);continue}if(!j(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&fn.delete(e)}return Array.from(n)}function gn(...e){let t=pn(e);return function(e){if(l&&e instanceof Element)for(let n of t)mn(n,e)}}let _n=[Wt,en,dn,Ae,Ve,yn];function vn(...e){let t;if(e.length>0){let n=hn(e);if(n.length===1){let e=n[0];t={roots:n,contains:t=>e.contains(t)}}else t={roots:n,contains:e=>{for(let t of n)if(t.contains(e))return!0;return!1}}}for(let e of _n)e(t)}function yn(e){if(typeof document>`u`)return;let t=e?e.roots:[document.body??document];for(let e of t)try{e.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){c(`Error dispatching global update event`,e)}}function bn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function xn(e,t){let n=t||document.body,r=n;qe();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=I(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),ue(e),L(r,t)}else r.appendChild(i),L(r,null)}return t}finally{Je()}}let Sn=null;function Cn(e){Sn=e}let wn=new Map,Tn=new Map,En=new Set,Dn=[],X=new Map,Z=null,Q=null,On=null,kn=0,An=new Map;function jn(e){for(let t of e)X.has(t)||X.set(t,[])}function Mn(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return An.set(t,r),r}catch{return null}}function Nn(e,t){try{e.insertRule(t,kn),kn++}catch{}}function Pn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Q&&On===document&&Q.ownerNode&&Q.ownerNode.isConnected)return Q;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),Q=e.sheet,On=document,An.clear(),kn=0,!Q)return null;for(let e of Dn)Nn(Q,e);for(let[e,t]of X){let n=Mn(Q,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Q}function Fn(e,t){if(t===void 0)Dn.push(e);else{let n=X.get(t);n||(n=[],X.set(t,n)),n.push(e)}Z=null,Sn?.(t===void 0?e:t+`{`+e+`}`);let n=Pn();if(n)if(t===void 0)Nn(n,e);else{let r=An.get(t)??Mn(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function In(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function Ln(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=wn.get(i);return a===void 0?(a=`n`+In(i),wn.set(i,a),Tn.set(a,(e??``)+`|`+t+`|`+n),Fn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(Pn(),a)}function Rn(e){return Tn.get(e)}function zn(e,t){if(En.has(e)){Pn();return}En.add(e),Fn(t,void 0)}function Bn(){if(Z!==null)return Z;let e=Dn.join(``);for(let[t,n]of X)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return Z=e,e}function Vn(){wn.clear(),Tn.clear(),En.clear(),Dn.length=0,X.clear(),An.clear(),Z=null,kn=0,Q=null,On=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}let Hn={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},Un={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},Wn={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},Gn={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},Kn=new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),qn=new Map;function Jn(e){let t=qn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),qn.set(e,t)),t}function Yn(e){return e.charCodeAt(0)===64?e:`@media `+e}function Xn(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Zn(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function Qn(e,t){for(let n of e)if(n)if(typeof n==`string`)for(let e of n.split(` `))e&&t.set(Rn(e)??e,e);else if(Array.isArray(n))Qn(n,t);else for(let e of n.className.split(` `))e&&t.set(Rn(e)??e,e)}function $n(...e){let t=new Map;Qn(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Zn(n)}function er(e={}){let t=e.screens??{};jn(Object.values(t).map(Yn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Kn.has(t)?String(n):n+`px`;let r=Gn[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,n,a,o){for(let s in e){let c=e[s];if(c==null||c===!1)continue;if(typeof c==`object`){if(s===`raw`){let e=c;for(let t in e)o.push(Ln(n,a,t,r(t,e[t])));continue}let e=Hn[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,Xn(n,Yn(l)),a,o);continue}let u=s.charCodeAt(0);if(u===38){i(c,n,a+s.slice(1),o);continue}if(u===64){i(c,Xn(n,s),a,o);continue}continue}if(c===!0){let e=Wn[s];if(e)for(let t in e)o.push(Ln(n,a,t,e[t]));continue}let l=Un[s];if(l!==void 0)for(let e of l)o.push(Ln(n,a,e,r(e,c)));else{let e=Jn(s);o.push(Ln(n,a,e,r(e,c)))}}}function a(e){let t=n.get(e);if(t)return t;let r=[];i(e,void 0,``,r);let a=Zn(r.join(` `));return n.set(e,a),a}function o(e){let t=``,n=(e,n)=>{t+=(t?`;`:``)+e+`:`+n};for(let t in e){let i=e[t];if(i==null||i===!1)continue;if(t===`raw`&&typeof i==`object`){let e=i;for(let t in e)n(t,r(t,e[t]));continue}if(typeof i==`object`)continue;if(i===!0){let e=Wn[t];if(e)for(let t in e)n(t,e[t]);continue}let a=Un[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Jn(t);n(e,r(e,i))}}return t}function s(e){let t=``;for(let n in e)t+=n+`{`+o(e[n])+`}`;let n=`nk`+In(t);return zn(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;zn(`g|`+n,n)}function l(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},o=e.base?a(e.base):null,s={};for(let e of r){let t=n[e],r={};for(let e in t)r[e]=a(t[e]);s[e]=r}let c=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,result:a(n)}}),l=new Map;return function(e){let n={};for(let a of r){let r=(e?e[a]:void 0)??i[a];r!=null&&(n[a]=t(r))}let a=``;for(let e of r)a+=e+`=`+(n[e]??``)+`;`;let u=l.get(a);if(u)return u;let d=[];o&&d.push(o);for(let e of r){let t=n[e];if(t!==void 0){let n=s[e][t];n&&d.push(n)}}for(let e of c){let t=!0;for(let r in e.conditions)if(n[r]!==e.conditions[r]){t=!1;break}t&&d.push(e.result)}let f=$n(...d);return l.set(a,f),f}}return{css:a,cx:$n,variants:l,keyframes:s,globalStyle:c,theme:e}}let tr;function $(){return tr??=er({})}let nr=e=>$().css(e),rr=e=>$().variants(e),ir=e=>$().keyframes(e),ar=(e,t)=>$().globalStyle(e,t);function or(){Ct();let e=globalThis;e.list=Gt,e.update=vn,e.when=cn,e.on=m,e.scope=gn,e.render=bn,e.hydrate=xn,e.createCss=er,e.css=nr,e.cx=$n,e.variants=rr,e.keyframes=ir,e.globalStyle=ar}or(),e.HTML_TAGS=_t,e.SELF_CLOSING_TAGS=yt,e.SVG_TAGS=vt,e.appendChildren=ge,e.applyAttributes=We,e.applyNodeModifier=V,e.createComment=A,e.createConditionalComment=fe,e.createCss=er,e.createHtmlElementWithModifiers=dt,e.createHtmlTagBuilder=ht,e.createSvgElementWithModifiers=ft,e.createSvgTagBuilder=gt,e.css=nr,e.cx=$n,e.getCssText=Bn,e.globalStyle=ar,e.hydrate=xn,e.initializeRuntime=or,e.isBoolean=a,e.isBrowser=l,e.isFunction=o,e.isNode=n,e.isObject=r,e.isPrimitive=t,e.isTagLike=i,e.isZeroArityFunction=s,e.keyframes=ir,e.list=Gt,e.on=m,e.registerGlobalTagBuilders=Ct,e.render=bn,e.replaceNodeSafely=_e,e.resetStyles=Vn,e.scope=gn,e.setSSRCollector=Cn,e.update=vn,e.variants=rr,e.when=cn});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Nuclo={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function n(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function r(e){return typeof e==`object`&&!!e}function i(e){return r(e)&&`tagName`in e}function a(e){return typeof e==`boolean`}function o(e){return typeof e==`function`}function s(e){return o(e)&&e.length===0}function c(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}let l=typeof window<`u`&&typeof document<`u`,u=new WeakMap;function d(e,t){let n=u.get(e);n?n.push(t):u.set(e,[t])}function f(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function p(e,t){let n=u.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)f(e,n[t]);u.delete(e);return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?f(e,a):n[r++]=a}n.length=r,r===0&&u.delete(e)}function m(e,t,n){return function(r){if(!l||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){c(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),d(i,{type:e,wrapped:a,options:n})}}let h=new Set,g=new WeakMap,_=new Set,v=new WeakMap;function y(e,t){let n=g.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue,n.info.sanitize=t.sanitize;return}let r=new WeakRef(e);h.add(r),g.set(e,{ref:r,info:t})}function b(e,t){let n=new WeakRef(e);_.add(n),v.set(e,{ref:n,info:t})}function ee(e){h.delete(e)}function x(e){_.delete(e)}function S(e){let t=g.get(e);t&&(h.delete(t.ref),g.delete(e))}function C(e){let t=v.get(e);t&&(_.delete(t.ref),v.delete(e))}let w=new WeakMap,T=new Set,E=new WeakMap,D=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{T.delete(e)}):null;function O(e,t){w.set(e,t);let n=new WeakRef(e);T.add(n),E.set(e,n),D?.register(e,n)}function te(e){w.delete(e);let t=E.get(e);t&&(T.delete(t),E.delete(e))}function ne(){let e=[],t=[];for(let n of T){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)T.delete(e);return e}function re(e){return w.get(e)??null}let ie=`http://www.w3.org/2000/svg`;function ae(e){return globalThis.document?document.createElement(e):null}function oe(e,t){return globalThis.document?document.createElementNS(e,t):null}function k(e){return globalThis.document?document.createTextNode(e):null}function se(){return globalThis.document?document.createDocumentFragment():null}function ce(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function le(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;p(t),C(t),te(t)}else e.nodeType===Node.TEXT_NODE?S(e):e.nodeType===Node.COMMENT_NODE&&te(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)le(e.childNodes[t])}function A(e){if(!e?.parentNode)return!1;try{return le(e),e.parentNode.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function ue(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function j(e){return globalThis.document?globalThis.document.createComment(e):null}function de(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function fe(e,t){let n=j(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=j(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function pe(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;A(n),n=e}}function me(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)ue(n,e[r],t)}function he(e,...t){if(!e)return e;for(let n=0;n<t.length;n++){let r=t[n];if(r!=null){let t;if(typeof r==`string`){let e=k(r);if(e)t=e;else continue}else t=r;ce(e,t)}}return e}function M(e){return e?.isConnected===!0}function ge(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return c(`Error replacing conditional node`,e),!1}}function _e(e){return e}function ve(e,t,n){let r=_e(e),i=r.appendChild.bind(r),a=r.insertBefore.bind(r);r.appendChild=function(e){return a(e,t)};try{return n()}finally{r.appendChild=i}}function ye(e,t,n){try{if(n==null||n===``)return e.style[t]=``,!0;let r=String(n);return e.style[t]=r,!0}catch{return!1}}let be={},xe=!1;function Se(e){let t=e.target;if(!t||typeof Node>`u`||!(t instanceof Node))return;let n=t;for(;n;){if(n instanceof Element){let e=v.get(n);e&&(M(n)?De(e.info):(x(e.ref),v.delete(n)))}n=n.parentNode}}function Ce(){xe||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,Se,!0),xe=!0)}function we(e){let t=v.get(e);if(t)return t.info;let n={attributeResolvers:[]};return b(e,n),n}function Te(e){return typeof e!=`object`||!e}function Ee(e){let t;try{t=e.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=Te(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:be}catch(t){c(`Failed to apply reactive attribute: ${e.key}`,t)}}function De(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Ee(t[e])}function Oe(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){c(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:be};if(!l){Ee(i);return}Ce();let a=we(e).attributeResolvers,o=!1;for(let e=0;e<a.length;e++)if(a[e].key===t){a[e]=i,o=!0;break}o||a.push(i),Ee(i)}function ke(e){let t=[];for(let n of _){let r=n.deref();if(r===void 0){t.push(n);continue}let i=v.get(r);if(!i){t.push(n);continue}if(!M(r)){v.delete(r),t.push(n);continue}e&&!e.contains(r)||De(i.info)}for(let e of t)x(e)}function Ae(e,t){if(!(!e?.style||!t))for(let n in t)ye(e,n,t[n])||c(`Failed to set style property '${n}'`)}function je(e,t){e&&(o(t)?Oe(e,`style`,t,function(t){Ae(e,t)}):Ae(e,t))}let N=new WeakMap,Me=new WeakSet;function Ne(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function Pe(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Fe(e){if(e.className&&!N.has(e)){let t=new Set;Ne(t,e.className),N.set(e,t)}Me.add(e)}function Ie(e){return Me.has(e)}function Le(e,t){if(!t)return;let n=N.get(e);n||(n=new Set,N.set(e,n)),Ne(n,t)}function Re(e,t){let n=N.get(e);if(!n||n.size===0){let n=t||``;e.className!==n&&(e.className=n);return}if(!t){e.className=Pe(n);return}let r=Pe(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}e.className=r}function ze(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;Ne(r,n),Ne(r,t),e.className=Pe(r)}else e.className=t}function Be(e,t,n){if(typeof e!=`function`){c(`Invalid resolver provided to createReactiveTextNode`);let e=k(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let r;if(arguments.length>1)r=t;else try{r=e()}catch(e){c(`Failed to evaluate reactive text resolver`,e),r=``}let i=r===void 0?``:String(r),a=k(i);if(!a)throw Error(`Failed to create text node: document not available`);return l&&y(a,{resolver:e,lastValue:i,sanitize:n}),a}function Ve(e){let t=[];for(let n of h){let r=n.deref();if(r===void 0){t.push(n);continue}let i=g.get(r);if(!i){t.push(n);continue}let a=i.info;if(!M(r)){g.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){c(`Failed to update reactive text node`,e),o=void 0}let s=a.sanitize?o==null||typeof o==`object`||typeof o==`function`?``:String(o):o===void 0?``:String(o);s!==a.lastValue&&(r.textContent=s,a.lastValue=s)}for(let e of t)ee(e)}function He(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){ze(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(t,String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(t,String(n))}else e instanceof Element&&e.setAttribute(t,String(n))}}function Ue(e,t,n,r=!1){if(n!=null){if(t===`style`){je(e,n);return}if(o(n)){let r=String(t);if(r.charCodeAt(0)===111&&r.charCodeAt(1)===110){e[r]=n;return}if(n.length===0){let t=n;r===`className`&&e instanceof HTMLElement?(Fe(e),Oe(e,r,t,function(t){Re(e,String(t||``))})):Oe(e,r,t,function(t){He(e,r,t,!1)});return}}if(t===`className`&&e instanceof HTMLElement&&Ie(e)){let t=String(n||``);t&&(Le(e,t),ze(e,t));return}He(e,String(t),n,r)}}function We(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];Ue(e,i,a,n&&i===`className`)}}let P=!1,Ge=new WeakMap;function F(){return P}function Ke(){return!1}function qe(){P=!0,Ge=new WeakMap}function Je(){P=!1}function Ye(e){let t=P;P=!1;try{return e()}finally{P=t}}function I(e){let t=Ge.get(e);return t===void 0?e.firstChild:t}function L(e,t){Ge.set(e,t)}function Xe(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function R(e){let t=I(e),n=!1;for(;t&&Xe(t);)t=t.nextSibling,n=!0;n&&L(e,t)}function z(e){let t=I(e);return t&&L(e,t.nextSibling),t}function Ze(e,t){if(!P)return null;R(e);let n=I(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?z(e):null}function Qe(e,t){if(!t)return;let n=I(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}L(e,null)}let B=new WeakMap;function $e(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function et(e){R(e);let t=I(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function tt(e,t){let n=I(e);if(n&&n.nodeType===3)return z(e),n.textContent!==t&&(n.textContent=t),n;let r=k(t);return r?(e.insertBefore(r,n),L(e,n),r):null}function V(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=B.get(i);if(n||(n={value:i(),error:!1},B.set(i,n)),n.error)return rt(a,()=>``);let r=n.value;if($e(r))return We(e,{className:()=>{let e=i();return $e(e)?e.className:``}}),null;if(t(r)){let t=i,n=r??``;if(F()&&et(e)){let r=e;z(r);let i=String(n),a=tt(r,i);return a&&y(a,{resolver:t,lastValue:i,sanitize:!0}),null}return rt(a,t,n,!0)}return null}catch(e){return B.set(i,{value:void 0,error:!0}),c(`Error evaluating reactive text function:`,e),rt(a,()=>``)}let o=i(e,a);return o==null?null:t(o)?it(a,o):n(o)?o:(r(o)&&We(e,o),null)}let l=i;if(t(l)){if(F()&&et(e)){let t=e;return z(t),tt(t,String(l)),null}return it(a,l)}return n(l)?l:(We(e,l),null)}function nt(e,t){if(l&&!F()&&!Ke())return t;let n=se();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=j(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function rt(e,t,n,r){return nt(e,Be(t,n,r))}function it(e,t){return nt(e,k(String(t)))}let at=Symbol(`nuclo.factory.tag`),ot=Symbol(`nuclo.factory.mods`),H=0,st=[],ct=0;function lt(){return ct>=st.length&&st.push(()=>null),st[ct++]}function ut(e,t,n){e[at]=t,e[ot]=n}function U(e){return typeof e==`function`?e[ot]:void 0}function W(e){return typeof e==`function`?e[at]:void 0}function dt(){return H>0}function ft(e,t,n){let r=H===0;H++,r&&(ct=0);try{return e(t,n)}finally{H--}}function G(e,t,n=0){if(!t||t.length===0)return;let r=n,i=e;for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;let o=V(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function pt(e,t){let n=ae(e);if(!n)throw Error(`Failed to create element: ${e}`);return G(n,t,0),n}function mt(e,t){let n=oe(ie,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return G(n,t,0),n}function ht(e,t){if(dt()){let n=lt();return ut(n,e,t),n}let n=function(n,r=0){let i=n,a=i?Ze(i,e):null,o=a??ae(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return G(o,t,r),a&&Qe(s,c),o};return ut(n,e,t),n}function gt(e,t){if(dt()){let n=lt();return ut(n,e,t),n}return function(n,r=0){let i=n,a=i?Ze(i,e):null,o=a??oe(`http://www.w3.org/2000/svg`,e);if(!o)throw Error(`Failed to create SVG element: ${e}`);let s=o,c=a?s.lastChild:null;return G(o,t,r),a&&Qe(s,c),o}}function _t(e){return(...t)=>ht(e,t)}function vt(e){return(...t)=>gt(e,t)}let yt=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),bt=`a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),xt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function St(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let r=n();return Object.defineProperty(e,t,{value:r,configurable:!0,enumerable:!0,writable:!0}),r},set(n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}})}function Ct(e,t){t in e&&typeof e[t]!=`function`||(St(e,t,()=>_t(t)),t===`var`&&St(e,`var_`,()=>_t(t)))}function wt(e,t){let n=`${t}Svg`;n in e||St(e,n,()=>vt(t))}function Tt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<bt.length;t++)wt(e,bt[t]);for(let t=0;t<yt.length;t++)Ct(e,yt[t]);e[t]=!0}}function K(e,t,n){if(o(e)){let r=e(t,n);return r&&i(r)?r:null}return e&&i(e)?e:null}function Et(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110}function Dt(e,t){let r=[],i=0;for(let e=0;e<t.length;e++){let a=t[e];if(a==null){r.push({kind:4});continue}let o=typeof a;if(o===`function`){let e=U(a);if(e!==void 0){let t=W(a);if(!t)return null;let n=Dt(t,e);if(!n)return null;r.push({kind:3,child:n});continue}if(a.length===0){let e;try{e=a(),B.set(a,{value:e,error:!1})}catch{return null}if(e==null||typeof e!=`object`&&typeof e!=`function`){r.push({kind:2});continue}return null}return null}if(o===`object`){if(n(a))return null;let e=a,t=Object.keys(e),o=[];for(let n=0;n<t.length;n++){let r=t[n],a=e[r];if(a==null){o.push({key:r,kind:3,prop:!1});continue}if(r===`style`)return null;let s=typeof a;if(s===`function`){if(Et(r)){o.push({key:r,kind:1,prop:!1});continue}if(r===`className`&&a.length===0){if(i++)return null;o.push({key:r,kind:2,prop:!1});continue}return null}if(s===`object`||r===`className`&&i++)return null;o.push({key:r,kind:0,prop:!1,value:a})}r.push({kind:0,keys:o});continue}r.push({kind:1})}return{tag:e,slots:r}}function Ot(e,t){let n=e.slots,r=t.firstChild;for(let e=0;e<n.length;e++){let i=n[e];switch(i.kind){case 0:{let e=i.keys;for(let n=0;n<e.length;n++){let r=e[n];r.kind===0?r.prop=r.key in t:r.kind===2&&(t.className=``)}break}case 1:case 2:r&&=r.nextSibling;break;case 3:if(!r)return;Ot(i.child,r),r=r.nextSibling;break}}}function kt(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let t in e)i++;if(i!==t.length)return!1;for(let i=0;i<t.length;i++){let a=t[i],o=e[a.key];switch(a.kind){case 0:if(o==null||typeof o==`object`||typeof o==`function`)return!1;if(o===a.value)break;if(a.prop){let e=n;e[a.key]!==o&&(e[a.key]=o)}else{let e=String(o);n.getAttribute(a.key)!==e&&n.setAttribute(a.key,e)}break;case 1:if(typeof o!=`function`)return!1;n[a.key]=o;break;case 2:{if(typeof o!=`function`||o.length!==0)return!1;let e=o,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),r.push({kind:1,node:n,fn:e,last:i});break}case 3:if(o!=null)return!1;break}}break}case 1:if(s==null||typeof s==`object`||typeof s==`function`||!a)return!1;a.nodeValue=String(s),a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||U(s)!==void 0||!a)return!1;let e;try{e=s()}catch{return!1}if(e!=null&&(typeof e==`object`||typeof e==`function`))return!1;let t=e==null?``:String(e),n=a;n.nodeValue=t,r.push({kind:0,node:n,fn:s,last:t}),a=n.nextSibling;break}case 3:{let e=U(s);if(e===void 0||W(s)!==o.child.tag||!a||!kt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function At(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let a in e){if(i>=t.length)return!1;let o=t[i];if(o.key!==a)return!1;i++;let s=e[a];if(o.kind===2){if(typeof s!=`function`||s.length!==0)return!1;C(n),r.push({kind:1,node:n,fn:s,last:n.className})}}if(i!==t.length)return!1;break}case 1:if(!a)return!1;a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||!a||a.nodeType!==3)return!1;let e=a;S(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=U(s);if(e===void 0||W(s)!==o.child.tag||!a||!At(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function jt(e){for(let t=0;t<e.length;t++){let n=e[t],r;try{r=n.fn()}catch{continue}if(n.kind===0){let e=r==null||typeof r==`object`||typeof r==`function`?``:String(r);e!==n.last&&(n.node.nodeValue=e,n.last=e)}else{let e=r?String(r):``;e!==n.last&&(n.node.className=e,n.last=e)}}}function Mt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}let Nt=new Set,Pt=new WeakMap,Ft=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Nt.delete(e)}):null,q=0;function It(e,t){let n=new WeakRef(e);Nt.add(n),Pt.set(e,t),Ft?.register(e,n)}function Lt(e){return Array.isArray(e)?e:Array.from(e)}function Rt(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function zt(e,t,n){let r=e.renderItem(t,n);return Rt(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):K(r,e.host,n)}function Bt(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=l&&!F()&&!Ke(),a=r&&i?ft(e.renderItem,t,n):e.renderItem(t,n);if(Rt(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=U(a);if(i!==void 0){if(r===void 0){let t=W(a),r=t?Dt(t,i):null,o=K(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);Ot(r,t);let n=[];if(At(r,i,o,n))n.length>0&&(e.lastRenderLeaves=n);else return e.template=null,e.lastRenderLeaves=null,o;e.template={tmpl:r,skeleton:t}}else e.template=null;return o}let o=r.skeleton.cloneNode(!0),s=[];return kt(r.tmpl,i,o,s)?(s.length>0&&(e.lastRenderLeaves=s),o):(e.template=null,zt(e,t,n))}else if(r===void 0)e.template=null;else return e.template=null,zt(e,t,n)}return K(a,e.host,n)}function J(e){A(e.element)}function Vt(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(l&&t.firstChild===n&&t.lastChild===r)return t.textContent=``,t.appendChild(n),t.appendChild(r),!0;for(let n=0;n<e.length;n++){let r=e[n].element;r&&r.parentNode===t&&t.removeChild(r)}return!0}function Ht(e){let t=e.length;if(t===0)return[];let n=Array(t),r=[];for(let i=0;i<t;i++){let t=e[i],a=0,o=r.length;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}n[i]=a>0?r[a-1]:-1,a===r.length?r.push(i):r[a]=i}let i=r.length,a=r[i-1],o=Array(i);for(;i>0;)o[--i]=a,a=n[a];return o}function Ut(e,t,n,r,i,a,o){let s=se(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Bt(e,r,l);if(!i)continue;let u=e.lastRenderLeaves;o.push({item:r,element:i,dyn:u,refresh:e.lastRenderRefresh,dynCreatedAt:u?e.currentFlushEpoch:void 0});let d=i;s?(s.appendChild(d),c++):t.insertBefore(d,a)}s&&c>0&&t.insertBefore(s,a)}function Wt(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=Lt(e.itemsProvider());if(Mt(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!Vt(a,r,t,n))for(let e=0;e<o;e++)J(a[e]);e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0;return}let c=0,l=Math.min(o,s);for(;c<l&&a[c].item===i[c];)c++;let u=0,d=l-c;for(;u<d&&a[o-1-u].item===i[s-1-u];)u++;let f=c,p=o-u,m=c,h=s-u;if(f===p){let t=p<o?a[p].element:n;if(p===o)Ut(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];Ut(e,r,i,m,h,t,n),e.records=a.slice(0,f).concat(n,a.slice(f)),e.allRecordsCreatedAt=void 0}e.lastSyncedItems=i.slice();return}if(m===h){for(let e=f;e<p;e++)J(a[e]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice();return}let g=p-f,_=h-m,v=Array(_).fill(-1),y=new Uint8Array(g),b=0,ee=Math.min(p,h);for(let e=c;e<ee;e++)a[e].item===i[e]&&(v[e-m]=e,y[e-f]=1,b++);let x=new Map;for(let e=f;e<p;e++){if(y[e-f])continue;let t=a[e].item,n=x.get(t);n===void 0?x.set(t,e):typeof n==`number`?x.set(t,[n,e]):n.push(e)}for(let e=0;e<_;e++){if(v[e]!==-1)continue;let t=x.get(i[m+e]);if(t===void 0)continue;let n;typeof t==`number`?(n=t,x.delete(i[m+e])):(n=t.shift(),t.length===0&&x.delete(i[m+e])),v[e]=n,y[n-f]=1,b++}if(b===0&&f===0&&p===o){if(!Vt(a,r,t,n))for(let e=0;e<o;e++)J(a[e]);let c=[];Ut(e,r,i,0,s,n,c),e.records=c,e.allRecordsCreatedAt=e.currentFlushEpoch,e.lastSyncedItems=i.slice();return}for(let e=f;e<p;e++)y[e-f]||J(a[e]);let S=null;if(b>0){let e=[],t=[];for(let n=0;n<_;n++)v[n]!==-1&&(e.push(v[n]),t.push(n));S=new Uint8Array(_);let n=Ht(e);for(let e=0;e<n.length;e++)S[t[n[e]]]=1}let C=Array(_),w=0,T=p<o?a[p].element:n,E=null;for(let t=_-1;t>=0;t--){let n=v[t];if(n===-1){let n=i[m+t],a=Bt(e,n,m+t);if(!a){C[t]=null,w++;continue}let o=e.lastRenderLeaves;C[t]={item:n,element:a,dyn:o,refresh:e.lastRenderRefresh,dynCreatedAt:o?e.currentFlushEpoch:void 0};let s=a;E||=se(),E?E.insertBefore(s,E.firstChild):(r.insertBefore(s,T),T=s);continue}let o=a[n];C[t]=o;let s=o.element;if(E&&E.firstChild){let e=E.firstChild;r.insertBefore(E,T),T=e,E=null}(!S||!S[t])&&r.insertBefore(s,T),T=s}E&&E.firstChild&&r.insertBefore(E,T);let D=Array(f+(_-w)+(o-p)),O=0;for(let e=0;e<f;e++)D[O++]=a[e];for(let e=0;e<_;e++){let t=C[e];t&&(D[O++]=t)}for(let e=p;e<o;e++)D[O++]=a[e];e.records=D,e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice()}function Gt(e,t,n,r){return F()?qt(e,t,n,r):Kt(e,t,n,r)}function Kt(e,t,n,r){let{start:i,end:a}=fe(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Wt(o),l&&It(i,o),o}function qt(e,t,n,r){let i=n;R(i);let a=I(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return Kt(e,t,n,r);let o=z(i),s=0,c=I(i);for(;c;){if(c.nodeType===8){let e=c.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}c=c.nextSibling}let u=c;if(!u){let e=j(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return Kt(e,t,n,r);let d=Lt(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=Rt(r)?r:null,a=i?i.element:K(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=I(i);for(;p&&p!==u;){let e=p.nextSibling;A(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}L(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return l&&It(o,h),h}function Jt(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null,n.dyn=null,n.refresh=null,delete n.dynCreatedAt}e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0}function Yt(e){let t=[];q++;for(let n of Nt){let r=n.deref();if(!r){t.push(n);continue}let i=Pt.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){Jt(i),Pt.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=q;try{Wt(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===q)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===q)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&jt(n)}}for(let e of t)Nt.delete(e)}function Xt(e,t){return function(n,r){return Gt(e,t,n,r).startMarker}}function Zt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Qt(e,t){return typeof e==`function`?Zt(e,t):!!e}let $t=new Set,en=new WeakMap,tn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{$t.delete(e)}):null;function nn(e,t){for(let t=0;t<e.length;t++)if(Qt(e[t].condition))return t;return t.length>0?-1:null}function rn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=nn(t,n);o!==e.activeIndex&&(pe(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&me(cn(o>=0?t[o].content:n,r,i,a),a))}function an(e){let t=new WeakRef(e.startMarker);$t.add(t),en.set(e.startMarker,e),tn?.register(e.startMarker,t)}function on(e){let t=[];for(let n of $t){let r=n.deref();if(r===void 0){t.push(n);continue}let i=en.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){en.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch(e){c(`when() branch threw during update; unregistering this conditional`,e),en.delete(r),t.push(n)}}for(let e of t)$t.delete(e)}function sn(e,t,n,r){return o(e)?s(e)?(B.delete(e),V(t,e,n)):ve(t,r,()=>{let r=V(t,e,n);return r&&!r.parentNode?r:null}):V(t,e,n)}function cn(e,t,n,r){let i=[];for(let a of e){let e=sn(a,t,n,r);e&&i.push(e)}return i}function ln(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function un(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var dn=class e{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}cloneWith(t,n){let r=Object.create(e.prototype);return r.groups=[...this.groups],t&&r.groups.push(t),r.elseContent=n??[...this.elseContent],r}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){return globalThis.document?F()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=fe(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=_e(e);return a.appendChild(n),a.appendChild(r),rn(i),n.textContent=ln(t,i.activeIndex),n}hydrateRender(e,t){let n=e;R(n);let r=I(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=z(n),a=0,o=I(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=j(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=nn(this.groups,this.elseContent),u=un(i.textContent);if(!c&&(u===void 0||u===l)){if(l!==null){let n=l>=0?this.groups[l].content:this.elseContent;for(let r of n)V(e,r,t)}}else if(pe(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;Ye(()=>{me(cn(n,e,t,r),r)})}return L(n,s.nextSibling),this.createRuntimeFromMarkers(e,t,i,s,l),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:i,update:function(){rn(a)}};return l&&an(a),a}};function fn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return fn(e.cloneWith({condition:t,content:n}))},else:function(...t){return fn(e.cloneWith(void 0,t))}})}function pn(e,...t){return fn(new dn(e,...t))}function mn(e){try{return e.isSvg?mt(e.tagName,e.modifiers):pt(e.tagName,e.modifiers)}catch(t){if(c(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=oe(ie,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=ae(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function hn(e){let t=re(e);if(!t)return;let n=Zt(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=mn(t);O(n,t),ge(e,n)}else if(!n&&r){let n=de(t.tagName);n&&(O(n,t),ge(e,n))}}function gn(e){if(l)try{let t=ne();for(let n of t){if(!n.isConnected){te(n);continue}e&&!e.contains(n)||hn(n)}}catch(e){c(`Error during conditional elements update`,e)}}let _n=new Map;function vn(e){let t=[],n=new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}function yn(e,t){let n=_n.get(e);n||(n=new Set,_n.set(e,n)),n.add(new WeakRef(t))}function bn(e){let t=vn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=_n.get(e);if(!t)continue;let r=[];for(let e of t){let t=e.deref();if(t===void 0){r.push(e);continue}if(!M(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&_n.delete(e)}return Array.from(n)}function xn(...e){let t=vn(e);return function(e){if(l&&e instanceof Element)for(let n of t)yn(n,e)}}let Sn=[Yt,on,gn,ke,Ve,wn];function Cn(...e){let t;if(e.length>0){let n=bn(e);if(n.length===1){let e=n[0];t={roots:n,contains:t=>e.contains(t)}}else t={roots:n,contains:e=>{for(let t of n)if(t.contains(e))return!0;return!1}}}for(let e of Sn)e(t)}function wn(e){if(typeof document>`u`)return;let t=e?e.roots:[document.body??document];for(let e of t)try{e.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){c(`Error dispatching global update event`,e)}}function Tn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function En(e,t){let n=t||document.body,r=n;qe();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=I(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),A(e),L(r,t)}else r.appendChild(i),L(r,null)}return t}finally{Je()}}let Dn=null;function On(e){Dn=e}let kn=new Map,An=new Map,jn=new Set,Mn=[],Y=new Map,X=null,Z=null,Nn=null,Q=0,Pn=new Map;function Fn(e){for(let t of e)Y.has(t)||Y.set(t,[])}function In(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return Pn.set(t,r),r}catch{return null}}function Ln(e,t){try{e.insertRule(t,Q),Q++}catch{}}function Rn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Z&&Nn===document&&Z.ownerNode&&Z.ownerNode.isConnected)return Z;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),Z=e.sheet,Nn=document,Pn.clear(),Q=0,!Z)return null;for(let e of Mn)Ln(Z,e);for(let[e,t]of Y){let n=In(Z,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Z}function zn(e,t){if(t===void 0)Mn.push(e);else{let n=Y.get(t);n||(n=[],Y.set(t,n)),n.push(e)}X=null,Dn?.(t===void 0?e:t+`{`+e+`}`);let n=Rn();if(n)if(t===void 0)Ln(n,e);else{let r=Pn.get(t)??In(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function Bn(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function Vn(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=kn.get(i);return a===void 0?(a=`n`+Bn(i),kn.set(i,a),An.set(a,(e??``)+`|`+t+`|`+n),zn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(Rn(),a)}function Hn(e){return An.get(e)}function Un(e,t){if(jn.has(e)){Rn();return}jn.add(e),zn(t,void 0)}function Wn(){if(X!==null)return X;let e=Mn.join(``);for(let[t,n]of Y)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return X=e,e}function Gn(){kn.clear(),An.clear(),jn.clear(),Mn.length=0,Y.clear(),Pn.clear(),X=null,Q=0,Z=null,Nn=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}let Kn={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},qn={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},Jn={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},Yn={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},Xn=new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),Zn=new Map;function Qn(e){let t=Zn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Zn.set(e,t)),t}function $n(e){return e.charCodeAt(0)===64?e:`@media `+e}function er(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function tr(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function nr(e,t){for(let n of e)if(n)if(typeof n==`string`)for(let e of n.split(` `))e&&t.set(Hn(e)??e,e);else if(Array.isArray(n))nr(n,t);else for(let e of n.className.split(` `))e&&t.set(Hn(e)??e,e)}function rr(...e){let t=new Map;nr(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return tr(n)}function ir(e={}){let t=e.screens??{};Fn(Object.values(t).map($n));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Xn.has(t)?String(n):n+`px`;let r=Yn[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,n,a,o){for(let s in e){let c=e[s];if(c==null||c===!1)continue;if(typeof c==`object`){if(s===`raw`){let e=c;for(let t in e)o.push(Vn(n,a,t,r(t,e[t])));continue}let e=Kn[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,er(n,$n(l)),a,o);continue}let u=s.charCodeAt(0);if(u===38){i(c,n,a+s.slice(1),o);continue}if(u===64){i(c,er(n,s),a,o);continue}continue}if(c===!0){let e=Jn[s];if(e)for(let t in e)o.push(Vn(n,a,t,e[t]));continue}let l=qn[s];if(l!==void 0)for(let e of l)o.push(Vn(n,a,e,r(e,c)));else{let e=Qn(s);o.push(Vn(n,a,e,r(e,c)))}}}function a(e){let t=n.get(e);if(t)return t;let r=[];i(e,void 0,``,r);let a=tr(r.join(` `));return n.set(e,a),a}function o(e){let t=``,n=(e,n)=>{t+=(t?`;`:``)+e+`:`+n};for(let t in e){let i=e[t];if(i==null||i===!1)continue;if(t===`raw`&&typeof i==`object`){let e=i;for(let t in e)n(t,r(t,e[t]));continue}if(typeof i==`object`)continue;if(i===!0){let e=Jn[t];if(e)for(let t in e)n(t,e[t]);continue}let a=qn[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Qn(t);n(e,r(e,i))}}return t}function s(e){let t=``;for(let n in e)t+=n+`{`+o(e[n])+`}`;let n=`nk`+Bn(t);return Un(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;Un(`g|`+n,n)}function l(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},o=e.base?a(e.base):null,s={};for(let e of r){let t=n[e],r={};for(let e in t)r[e]=a(t[e]);s[e]=r}let c=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,result:a(n)}}),l=new Map;return function(e){let n={};for(let a of r){let r=(e?e[a]:void 0)??i[a];r!=null&&(n[a]=t(r))}let a=``;for(let e of r)a+=e+`=`+(n[e]??``)+`;`;let u=l.get(a);if(u)return u;let d=[];o&&d.push(o);for(let e of r){let t=n[e];if(t!==void 0){let n=s[e][t];n&&d.push(n)}}for(let e of c){let t=!0;for(let r in e.conditions)if(n[r]!==e.conditions[r]){t=!1;break}t&&d.push(e.result)}let f=rr(...d);return l.set(a,f),f}}return{css:a,cx:rr,variants:l,keyframes:s,globalStyle:c,theme:e}}let ar;function $(){return ar??=ir({})}let or=e=>$().css(e),sr=e=>$().variants(e),cr=e=>$().keyframes(e),lr=(e,t)=>$().globalStyle(e,t);function ur(){Tt();let e=globalThis;e.list=Xt,e.update=Cn,e.when=pn,e.on=m,e.scope=xn,e.render=Tn,e.hydrate=En,e.createCss=ir,e.css=or,e.cx=rr,e.variants=sr,e.keyframes=cr,e.globalStyle=lr}ur(),e.HTML_TAGS=yt,e.SELF_CLOSING_TAGS=xt,e.SVG_TAGS=bt,e.appendChildren=he,e.applyAttributes=We,e.applyNodeModifier=V,e.createComment=j,e.createConditionalComment=de,e.createCss=ir,e.createHtmlElementWithModifiers=pt,e.createHtmlTagBuilder=_t,e.createSvgElementWithModifiers=mt,e.createSvgTagBuilder=vt,e.css=or,e.cx=rr,e.getCssText=Wn,e.globalStyle=lr,e.hydrate=En,e.initializeRuntime=ur,e.isBoolean=a,e.isBrowser=l,e.isFunction=o,e.isNode=n,e.isObject=r,e.isPrimitive=t,e.isTagLike=i,e.isZeroArityFunction=s,e.keyframes=cr,e.list=Xt,e.on=m,e.registerGlobalTagBuilders=Tt,e.render=Tn,e.replaceNodeSafely=ge,e.resetStyles=Gn,e.scope=xn,e.setSSRCollector=On,e.update=Cn,e.variants=sr,e.when=pn});
2
2
  //# sourceMappingURL=nuclo.umd.js.map