nuclo 0.2.5 → 0.2.7

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,n,r,i,a){let o=u.get(e);o||(o=new Map,u.set(e,o));let s=o.get(t);s||(s=new Set,o.set(t,s)),s.add({original:n,wrapped:r,options:i,controller:a})}function f(e,t,n){n.controller?n.controller.abort():e.removeEventListener(t,n.wrapped,n.options)}function p(e,t){let n=u.get(e);if(n)if(t){let r=n.get(t);if(r){for(let n of r)f(e,t,n);n.delete(t)}}else{for(let[t,r]of n)for(let n of r)f(e,t,n);u.delete(e)}}function m(e,t,n){return function(r){if(!l||!r||typeof r.addEventListener!=`function`)return;let i=r,a=new AbortController,o=function(n){try{t.call(i,n)}catch(t){c(`Error in '${e}' listener`,t)}},s=typeof n==`boolean`?{capture:n,signal:a.signal}:{...n||{},signal:a.signal};i.addEventListener(e,o,s),d(i,e,t,o,n,a)}}let h=new Set,g=new WeakMap,_=new Set,v=new WeakMap,y=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{h.delete(e)}):null,ee=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{_.delete(e)}):null;function te(e,t){let n=g.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue;return}let r=new WeakRef(e);h.add(r),g.set(e,{ref:r,info:t}),y?.register(e,r)}function ne(e,t){let n=new WeakRef(e);_.add(n),v.set(e,{ref:n,info:t}),ee?.register(e,n)}function re(e){h.delete(e)}function ie(e){_.delete(e)}function ae(e){let t=g.get(e);t&&(h.delete(t.ref),g.delete(e))}function oe(e){let t=v.get(e);t&&(_.delete(t.ref),v.delete(e))}let se=new WeakMap,b=new Set,ce=new WeakMap,le=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{b.delete(e)}):null;function ue(e,t){se.set(e,t);let n=new WeakRef(e);b.add(n),ce.set(e,n),le?.register(e,n)}function de(e){se.delete(e);let t=ce.get(e);t&&(b.delete(t),ce.delete(e))}function fe(){let e=[],t=[];for(let n of b){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)b.delete(e);return e}function pe(e){return se.get(e)??null}let me=`http://www.w3.org/2000/svg`;function he(e){return globalThis.document?document.createElement(e):null}function ge(e,t){return globalThis.document?document.createElementNS(e,t):null}function x(e){return globalThis.document?document.createTextNode(e):null}function _e(){return globalThis.document?document.createDocumentFragment():null}function ve(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function ye(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;p(t),oe(t),de(t)}else e.nodeType===Node.TEXT_NODE?ae(e):e.nodeType===Node.COMMENT_NODE&&de(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ye(e.childNodes[t])}function S(e){if(!e?.parentNode)return!1;try{return ye(e),e.parentNode.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function be(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function C(e){return globalThis.document?globalThis.document.createComment(e):null}function xe(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function Se(e,t){let n=C(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=C(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function Ce(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;S(n),n=e}}function we(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)be(n,e[r],t)}function Te(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=x(r);if(e)t=e;else continue}else t=r;ve(e,t)}}return e}function w(e){return e?.isConnected===!0}function Ee(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}}let De={},Oe=!1;function ke(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&&(w(n)?Ne(e.info):(ie(e.ref),v.delete(n)))}n=n.parentNode}}function Ae(){Oe||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,ke,!0),Oe=!0)}function je(e){let t=v.get(e);if(t)return t.info;let n={attributeResolvers:new Map};return ne(e,n),n}function Me(e){return typeof e!=`object`||!e}function T(e,t){let n;try{n=t.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e}`,t);return}let r=Me(n);if(!(r&&Object.is(n,t.lastValue)))try{t.applyValue(n),t.lastValue=r?n:De}catch(t){c(`Failed to apply reactive attribute: ${e}`,t)}}function Ne(e){for(let[t,n]of e.attributeResolvers)T(t,n)}function E(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){c(`Invalid parameters for registerAttributeResolver`);return}let i={resolver:n,applyValue:r,lastValue:De};if(!l){T(t,i);return}Ae(),je(e).attributeResolvers.set(t,i),T(t,i)}function Pe(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(!w(r)){v.delete(r),t.push(n);continue}e&&!e.contains(r)||Ne(i.info)}for(let e of t)ie(e)}function Fe(e){return e}function Ie(e,t,n){let r=Fe(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 Le(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}}function Re(e,t){if(!(!e?.style||!t))for(let n in t)Le(e,n,t[n])||c(`Failed to set style property '${n}'`)}function ze(e,t){e&&(o(t)?E(e,`style`,t,function(t){Re(e,t)}):Re(e,t))}let D=new WeakMap,Be=new WeakSet;function O(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 Ve(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function He(e){if(!D.has(e)){let t=new Set;e.className&&O(t,e.className),D.set(e,t)}Be.add(e)}function Ue(e){return Be.has(e)}function We(e,t){if(!t)return;let n=D.get(e);n||(n=new Set,D.set(e,n)),O(n,t)}function Ge(e,t){let n=D.get(e);if(!n||n.size===0){e.className=t||``;return}if(!t){e.className=Ve(n);return}let r=Ve(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 Ke(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;O(r,n),O(r,t),e.className=Ve(r)}else e.className=t}function qe(e,t){if(typeof e!=`function`){c(`Invalid resolver provided to createReactiveTextNode`);let e=x(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let n;if(arguments.length>1)n=t;else try{n=e()}catch(e){c(`Failed to evaluate reactive text resolver`,e),n=``}let r=n===void 0?``:String(n),i=x(r);if(!i)throw Error(`Failed to create text node: document not available`);return l&&te(i,{resolver:e,lastValue:r}),i}function Je(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(!w(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=o===void 0?``:String(o);s!==a.lastValue&&(r.textContent=s,a.lastValue=s)}for(let e of t)re(e)}function Ye(e,t,n,r=!1){if(n==null)return;if(t===`style`){ze(e,n);return}let i=(n,r=!1)=>{if(n!=null){if(t===`className`&&e instanceof HTMLElement&&r){Ke(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(String(t),String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(String(t),String(n))}else e instanceof Element&&e.setAttribute(String(t),String(n))}};if(o(n)&&n.length===0){let r=n;t===`className`&&e instanceof HTMLElement?(He(e),E(e,String(t),r,function(t){Ge(e,String(t||``))})):E(e,String(t),r,function(e){i(e,!1)})}else{if(t===`className`&&e instanceof HTMLElement&&Ue(e)){let t=String(n||``);t&&(We(e,t),Ke(e,t));return}i(n,r)}}function k(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];Ye(e,r,i,n&&r===`className`)}}let A=new WeakMap,j=!1,Xe=new WeakMap;function M(){return j}function Ze(){j=!0,Xe=new WeakMap}function Qe(){j=!1}function $e(e){let t=j;j=!1;try{return e()}finally{j=t}}function N(e){let t=Xe.get(e);return t===void 0?e.firstChild:t}function P(e,t){Xe.set(e,t)}function et(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function F(e){let t=N(e),n=!1;for(;t&&et(t);)t=t.nextSibling,n=!0;n&&P(e,t)}function I(e){let t=N(e);return t&&P(e,t.nextSibling),t}function tt(e,t){if(!j)return null;F(e);let n=N(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?I(e):null}function nt(e,t){if(!t)return;let n=N(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}P(e,null)}function rt(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function it(e){F(e);let t=N(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function at(e,t){let n=N(e);if(n&&n.nodeType===3)return I(e),n.textContent!==t&&(n.textContent=t),n;let r=x(t);return r?(e.insertBefore(r,n),P(e,n),r):null}function L(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=A.get(i);if(n||(n={value:i(),error:!1},A.set(i,n)),n.error)return st(a,()=>``);let r=n.value;if(rt(r))return k(e,{className:()=>{let e=i();return rt(e)?e.className:``}}),null;if(t(r)&&r!=null){if(M()&&it(e)){let t=e;I(t);let n=String(r),a=at(t,n);return a&&te(a,{resolver:i,lastValue:n}),null}return st(a,i,r)}return null}catch(e){return A.set(i,{value:void 0,error:!0}),c(`Error evaluating reactive text function:`,e),st(a,()=>``)}let o=i(e,a);return o==null?null:t(o)?ct(a,o):n(o)?o:(r(o)&&k(e,o),null)}let l=i;if(t(l)){if(M()&&it(e)){let t=e;return I(t),at(t,String(l)),null}return ct(a,l)}return n(l)?l:(k(e,l),null)}function ot(e,t){let n=_e();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=C(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function st(e,t,n){return ot(e,qe(t,n))}function ct(e,t){return ot(e,x(String(t)))}function R(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=L(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function lt(e,t){let n=he(e);return R(n,t,0),n}function ut(e,t){let n=ge(me,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return R(n,t,0),n}function dt(e,...t){return function(n,r=0){let i=n,a=i?tt(i,e):null,o=a??he(e),s=o,c=a?s.lastChild:null;return R(o,t,r),a&&nt(s,c),o}}function ft(e,...t){return function(n,r=0){let i=n,a=i?tt(i,e):null,o=a??ge(`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 R(o,t,r),a&&nt(s,c),o}}function pt(e){return(...t)=>dt(e,...t)}function mt(e){return(...t)=>ft(e,...t)}let ht=`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(`.`),gt=`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(`.`),_t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function vt(e,t){t in e&&typeof e[t]!=`function`||(e[t]=pt(t))}function yt(e,t){let n=`${t}Svg`;n in e||(e[n]=mt(t))}function bt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<gt.length;t++)yt(e,gt[t]);for(let t=0;t<ht.length;t++)vt(e,ht[t]);e[t]=!0}}function xt(e,t,n){if(o(e)){let r=e(t,n);return r&&i(r)?r:null}return e&&i(e)?e:null}function St(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 z=new Set,B=new WeakMap,Ct=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{z.delete(e)}):null;function wt(e,t){let n=new WeakRef(e);z.add(n),B.set(e,t),Ct?.register(e,n)}function Tt(e){return Array.isArray(e)?e:Array.from(e)}function Et(e,t,n){return xt(e.renderItem(t,n),e.host,n)}function Dt(e){let t=e;t.element=null,t.item=null}function V(e){S(e.element),Dt(e)}function Ot(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=r.element;i&&i.parentNode===t&&t.removeChild(i),Dt(r)}return!0}function kt(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 At(e,t,n,r,i,a,o){let s=_e(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Et(e,r,l);if(!i)continue;o.push({item:r,element:i});let u=i;s?(s.appendChild(u),c++):t.insertBefore(u,a)}s&&c>0&&t.insertBefore(s,a)}function jt(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Mt(e){let{host:t,startMarker:n,endMarker:r}=e,i=n.parentNode??t,a=Tt(e.itemsProvider());if(St(e.lastSyncedItems,a))return;let o=e.records,s=a.length;if(s===0){if(!Ot(o,i,n,r))for(let e=0;e<o.length;e++)V(o[e]);e.records=[],e.lastSyncedItems=[];return}if(o.length===0){let t=[];At(e,i,a,0,s,r,t),e.records=t,e.lastSyncedItems=a.slice();return}let c=e.lastSyncedItems;if(s>c.length&&jt(c,a)){At(e,i,a,c.length,s,r,o),e.records=o,e.lastSyncedItems=a.slice();return}let l=new Map,u=new Map,d=new Map;for(let e=0;e<o.length;e++){let t=o[e];d.set(t,e);let n=u.get(t.item);n?n.push(t):u.set(t.item,[t])}for(let e=0;e<s;e++){let t=a[e];if(e<c.length&&c[e]===t){let n=o[e];if(n&&n.item===t){l.set(e,n);let r=u.get(t);r.splice(r.indexOf(n),1),r.length===0&&u.delete(t)}}}let f=Array(s),p=new Set(o),m=0;for(let t=s-1;t>=0;t--){let n=a[t],r=l.get(t);if(!r){let e=u.get(n);e&&e.length>0&&(r=e.shift(),e.length===0&&u.delete(n))}if(r)p.delete(r),m++;else{let i=Et(e,n,t);if(!i){f[t]=null;continue}r={item:n,element:i}}f[t]=r}if(m===0){if(!Ot(o,i,n,r))for(let e of p)V(e)}else for(let e of p)V(e);let h=[],g=[];for(let e=0;e<s;e++){let t=f[e];if(!t)continue;let n=d.get(t);n!==void 0&&(h.push(e),g.push(n))}let _=new Set;if(g.length>0){let e=kt(g);for(let t=0;t<e.length;t++)_.add(h[e[t]])}let v=r,y=null;for(let e=s-1;e>=0;e--){let t=f[e];if(!t)continue;let n=t.element;if(!d.has(t)){y||=_e(),y?y.insertBefore(n,y.firstChild):(i.insertBefore(n,v),v=n);continue}if(y&&y.firstChild){let e=y.firstChild;i.insertBefore(y,v),v=e,y=null}_.has(e)||i.insertBefore(n,v),v=n}y&&y.firstChild&&i.insertBefore(y,v),e.records=f.filter(e=>e!==null),e.lastSyncedItems=a.slice()}function Nt(e,t,n,r){return M()?Pt(e,t,n,r):H(e,t,n,r)}function H(e,t,n,r){let{start:i,end:a}=Se(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Mt(o),l&&wt(i,o),o}function Pt(e,t,n,r){let i=n;F(i);let a=N(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return H(e,t,n,r);let o=I(i),s=0,c=N(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=C(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return H(e,t,n,r);let d=Tt(e()),f=[];for(let e=0;e<d.length;e++){let r=xt(t(d[e],e),n,e);r&&f.push({item:d[e],element:r})}let p=N(i);for(;p&&p!==u;){let e=p.nextSibling;S(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}P(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return l&&wt(o,h),h}function Ft(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null}e.records=[]}function It(e){let t=[];for(let n of z){let r=n.deref();if(!r){t.push(n);continue}let i=B.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){Ft(i),B.delete(r),t.push(n);continue}e&&!e.contains(r)||Mt(i)}for(let e of t)z.delete(e)}function Lt(e,t){return function(n,r){return Nt(e,t,n,r).startMarker}}function Rt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function zt(e,t){return typeof e==`function`?Rt(e,t):!!e}function Bt(e,t,n,r){return o(e)?s(e)?(A.delete(e),L(t,e,n)):Ie(t,r,()=>{let r=L(t,e,n);return r&&!r.parentNode?r:null}):L(t,e,n)}function Vt(e,t,n,r){let i=[];for(let a of e){let e=Bt(a,t,n,r);e&&i.push(e)}return i}let U=new Set,W=new WeakMap,Ht=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{U.delete(e)}):null;function Ut(e,t){for(let t=0;t<e.length;t++)if(zt(e[t].condition))return t;return t.length>0?-1:null}function Wt(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Ut(t,n);o!==e.activeIndex&&(Ce(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&we(Vt(o>=0?t[o].content:n,r,i,a),a))}function Gt(e){let t=new WeakRef(e.startMarker);U.add(t),W.set(e.startMarker,e),Ht?.register(e.startMarker,t)}function Kt(e){let t=[];for(let n of U){let r=n.deref();if(r===void 0){t.push(n);continue}let i=W.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){W.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch{W.delete(r),t.push(n)}}for(let e of t)U.delete(e)}function qt(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Jt(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Yt=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?M()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=Se(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Fe(e);return a.appendChild(n),a.appendChild(r),Wt(i),n.textContent=qt(t,i.activeIndex),n}hydrateRender(e,t){let n=e;F(n);let r=N(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=I(n),a=0,o=N(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=C(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=Ut(this.groups,this.elseContent),u=Jt(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)L(e,r,t)}}else if(Ce(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;$e(()=>{we(Vt(n,e,t,r),r)})}return P(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(){Wt(a)}};return l&&Gt(a),a}};function Xt(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Xt(e.cloneWith({condition:t,content:n}))},else:function(...t){return Xt(e.cloneWith(void 0,t))}})}function Zt(e,...t){return Xt(new Yt(e,...t))}function Qt(e){try{return e.isSvg?ut(e.tagName,e.modifiers):lt(e.tagName,e.modifiers)}catch(t){if(c(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=ge(me,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=he(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function $t(e){let t=pe(e);if(!t)return;let n=Rt(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=Qt(t);ue(n,t),Ee(e,n)}else if(!n&&r){let n=xe(t.tagName);n&&(ue(n,t),Ee(e,n))}}function en(e){if(l)try{let t=fe();for(let n of t){if(!n.isConnected){de(n);continue}e&&!e.contains(n)||$t(n)}}catch(e){c(`Error during conditional elements update`,e)}}function tn(){if(typeof document>`u`)return;let e=document.body?[document.body,document]:[document];for(let t of e)try{t.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){c(`Error dispatching global update event`,e)}}let G=new Map;function nn(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 rn(e,t){let n=G.get(e);n||(n=new Set,G.set(e,n)),n.add(new WeakRef(t))}function an(e){let t=nn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=G.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(!w(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&G.delete(e)}return Array.from(n)}function on(...e){let t=nn(e);return function(e){if(l&&e instanceof Element)for(let n of t)rn(n,e)}}let sn=[It,Kt,en,Pe,Je,tn];function cn(...e){let t;if(e.length>0){let n=an(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 ln(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function un(e,t){let n=t||document.body,r=n;Ze();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=N(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),S(e),P(r,t)}else r.appendChild(i),P(r,null)}return t}finally{Qe()}}let dn=null;function fn(e){dn=e}let pn=new Map,mn=new Map,hn=new Set,K=[],q=new Map,J=null,Y=null,X=null,Z=0,Q=new Map;function gn(e){for(let t of e)q.has(t)||q.set(t,[])}function _n(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return Q.set(t,r),r}catch{return null}}function vn(e,t){try{e.insertRule(t,Z),Z++}catch{}}function yn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Y&&X===document&&Y.ownerNode&&Y.ownerNode.isConnected)return Y;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),Y=e.sheet,X=document,Q.clear(),Z=0,!Y)return null;for(let e of K)vn(Y,e);for(let[e,t]of q){let n=_n(Y,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Y}function bn(e,t){if(t===void 0)K.push(e);else{let n=q.get(t);n||(n=[],q.set(t,n)),n.push(e)}J=null,dn?.(t===void 0?e:t+`{`+e+`}`);let n=yn();if(n)if(t===void 0)vn(n,e);else{let r=Q.get(t)??_n(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function xn(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 $(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=pn.get(i);return a===void 0?(a=`n`+xn(i),pn.set(i,a),mn.set(a,(e??``)+`|`+t+`|`+n),bn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(yn(),a)}function Sn(e){return mn.get(e)}function Cn(e,t){if(hn.has(e)){yn();return}hn.add(e),bn(t,void 0)}function wn(){if(J!==null)return J;let e=K.join(``);for(let[t,n]of q)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return J=e,e}function Tn(){pn.clear(),mn.clear(),hn.clear(),K.length=0,q.clear(),Q.clear(),J=null,Z=0,Y=null,X=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}let En={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`},Dn={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`]},On={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`}},kn={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`},An=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`]),jn=new Map;function Mn(e){let t=jn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),jn.set(e,t)),t}function Nn(e){return e.charCodeAt(0)===64?e:`@media `+e}function Pn(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Fn(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function In(...e){let t=new Map;for(let n of e){if(!n)continue;let e=(typeof n==`string`?n:n.className).split(` `);for(let n of e)n&&t.set(Sn(n)??n,n)}let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Fn(n)}function Ln(e={}){let t=e.screens??{};gn(Object.values(t).map(Nn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||An.has(t)?String(n):n+`px`;let r=kn[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($(n,a,t,r(t,e[t])));continue}let e=En[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,Pn(n,Nn(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,Pn(n,s),a,o);continue}continue}if(c===!0){let e=On[s];if(e)for(let t in e)o.push($(n,a,t,e[t]));continue}let l=Dn[s];if(l!==void 0)for(let e of l)o.push($(n,a,e,r(e,c)));else{let e=Mn(s);o.push($(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=Fn(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=On[t];if(e)for(let t in e)n(t,e[t]);continue}let a=Dn[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Mn(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`+xn(t);return Cn(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;Cn(`g|`+n,n)}return{css:a,cx:In,keyframes:s,globalStyle:c,theme:e}}let Rn=Ln({}),zn=Rn.css,Bn=Rn.keyframes,Vn=Rn.globalStyle;function Hn(){bt();let e=globalThis;e.list=Lt,e.update=cn,e.when=Zt,e.on=m,e.scope=on,e.render=ln,e.hydrate=un,e.createCss=Ln,e.css=zn,e.cx=In,e.keyframes=Bn,e.globalStyle=Vn}Hn(),e.HTML_TAGS=ht,e.SELF_CLOSING_TAGS=_t,e.SVG_TAGS=gt,e.appendChildren=Te,e.applyAttributes=k,e.applyNodeModifier=L,e.createComment=C,e.createConditionalComment=xe,e.createCss=Ln,e.createHtmlElementWithModifiers=lt,e.createHtmlTagBuilder=pt,e.createSvgElementWithModifiers=ut,e.createSvgTagBuilder=mt,e.css=zn,e.cx=In,e.getCssText=wn,e.globalStyle=Vn,e.hydrate=un,e.initializeRuntime=Hn,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=Bn,e.list=Lt,e.on=m,e.registerGlobalTagBuilders=bt,e.render=ln,e.replaceNodeSafely=Ee,e.resetStyles=Tn,e.scope=on,e.setSSRCollector=fn,e.update=cn,e.when=Zt});
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,y=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{h.delete(e)}):null,ee=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{_.delete(e)}):null;function te(e,t){let n=g.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue;return}let r=new WeakRef(e);h.add(r),g.set(e,{ref:r,info:t}),y?.register(e,r)}function ne(e,t){let n=new WeakRef(e);_.add(n),v.set(e,{ref:n,info:t}),ee?.register(e,n)}function re(e){h.delete(e)}function ie(e){_.delete(e)}function ae(e){let t=g.get(e);t&&(h.delete(t.ref),g.delete(e))}function oe(e){let t=v.get(e);t&&(_.delete(t.ref),v.delete(e))}let se=new WeakMap,b=new Set,ce=new WeakMap,le=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{b.delete(e)}):null;function ue(e,t){se.set(e,t);let n=new WeakRef(e);b.add(n),ce.set(e,n),le?.register(e,n)}function de(e){se.delete(e);let t=ce.get(e);t&&(b.delete(t),ce.delete(e))}function fe(){let e=[],t=[];for(let n of b){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)b.delete(e);return e}function pe(e){return se.get(e)??null}let me=`http://www.w3.org/2000/svg`;function he(e){return globalThis.document?document.createElement(e):null}function ge(e,t){return globalThis.document?document.createElementNS(e,t):null}function x(e){return globalThis.document?document.createTextNode(e):null}function _e(){return globalThis.document?document.createDocumentFragment():null}function ve(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function ye(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;p(t),oe(t),de(t)}else e.nodeType===Node.TEXT_NODE?ae(e):e.nodeType===Node.COMMENT_NODE&&de(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ye(e.childNodes[t])}function S(e){if(!e?.parentNode)return!1;try{return ye(e),e.parentNode.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function be(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function C(e){return globalThis.document?globalThis.document.createComment(e):null}function xe(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function Se(e,t){let n=C(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=C(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function Ce(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;S(n),n=e}}function we(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)be(n,e[r],t)}function Te(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=x(r);if(e)t=e;else continue}else t=r;ve(e,t)}}return e}function w(e){return e?.isConnected===!0}function Ee(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}}let De={},Oe=!1;function ke(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&&(w(n)?Ne(e.info):(ie(e.ref),v.delete(n)))}n=n.parentNode}}function Ae(){Oe||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,ke,!0),Oe=!0)}function je(e){let t=v.get(e);if(t)return t.info;let n={attributeResolvers:new Map};return ne(e,n),n}function Me(e){return typeof e!=`object`||!e}function T(e,t){let n;try{n=t.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e}`,t);return}let r=Me(n);if(!(r&&Object.is(n,t.lastValue)))try{t.applyValue(n),t.lastValue=r?n:De}catch(t){c(`Failed to apply reactive attribute: ${e}`,t)}}function Ne(e){for(let[t,n]of e.attributeResolvers)T(t,n)}function Pe(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){c(`Invalid parameters for registerAttributeResolver`);return}let i={resolver:n,applyValue:r,lastValue:De};if(!l){T(t,i);return}Ae(),je(e).attributeResolvers.set(t,i),T(t,i)}function Fe(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(!w(r)){v.delete(r),t.push(n);continue}e&&!e.contains(r)||Ne(i.info)}for(let e of t)ie(e)}function Ie(e){return e}function Le(e,t,n){let r=Ie(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 Re(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}}function ze(e,t){if(!(!e?.style||!t))for(let n in t)Re(e,n,t[n])||c(`Failed to set style property '${n}'`)}function Be(e,t){e&&(o(t)?Pe(e,`style`,t,function(t){ze(e,t)}):ze(e,t))}let E=new WeakMap,Ve=new WeakSet;function D(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 He(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Ue(e){if(e.className&&!E.has(e)){let t=new Set;D(t,e.className),E.set(e,t)}Ve.add(e)}function We(e){return Ve.has(e)}function Ge(e,t){if(!t)return;let n=E.get(e);n||(n=new Set,E.set(e,n)),D(n,t)}function Ke(e,t){let n=E.get(e);if(!n||n.size===0){e.className=t||``;return}if(!t){e.className=He(n);return}let r=He(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 qe(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;D(r,n),D(r,t),e.className=He(r)}else e.className=t}function Je(e,t){if(typeof e!=`function`){c(`Invalid resolver provided to createReactiveTextNode`);let e=x(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let n;if(arguments.length>1)n=t;else try{n=e()}catch(e){c(`Failed to evaluate reactive text resolver`,e),n=``}let r=n===void 0?``:String(n),i=x(r);if(!i)throw Error(`Failed to create text node: document not available`);return l&&te(i,{resolver:e,lastValue:r}),i}function Ye(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(!w(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=o===void 0?``:String(o);s!==a.lastValue&&(r.textContent=s,a.lastValue=s)}for(let e of t)re(e)}function Xe(e,t,n,r=!1){if(n==null)return;if(t===`style`){Be(e,n);return}let i=(n,r=!1)=>{if(n!=null){if(t===`className`&&e instanceof HTMLElement&&r){qe(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(String(t),String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(String(t),String(n))}else e instanceof Element&&e.setAttribute(String(t),String(n))}};if(o(n)&&n.length===0){let r=n;t===`className`&&e instanceof HTMLElement?(Ue(e),Pe(e,String(t),r,function(t){Ke(e,String(t||``))})):Pe(e,String(t),r,function(e){i(e,!1)})}else{if(t===`className`&&e instanceof HTMLElement&&We(e)){let t=String(n||``);t&&(Ge(e,t),qe(e,t));return}i(n,r)}}function O(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];Xe(e,r,i,n&&r===`className`)}}let k=new WeakMap,A=!1,Ze=new WeakMap;function j(){return A}function Qe(){return!1}function $e(){A=!0,Ze=new WeakMap}function et(){A=!1}function tt(e){let t=A;A=!1;try{return e()}finally{A=t}}function M(e){let t=Ze.get(e);return t===void 0?e.firstChild:t}function N(e,t){Ze.set(e,t)}function nt(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function P(e){let t=M(e),n=!1;for(;t&&nt(t);)t=t.nextSibling,n=!0;n&&N(e,t)}function F(e){let t=M(e);return t&&N(e,t.nextSibling),t}function rt(e,t){if(!A)return null;P(e);let n=M(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?F(e):null}function it(e,t){if(!t)return;let n=M(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}N(e,null)}function at(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function ot(e){P(e);let t=M(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function st(e,t){let n=M(e);if(n&&n.nodeType===3)return F(e),n.textContent!==t&&(n.textContent=t),n;let r=x(t);return r?(e.insertBefore(r,n),N(e,n),r):null}function I(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=k.get(i);if(n||(n={value:i(),error:!1},k.set(i,n)),n.error)return lt(a,()=>``);let r=n.value;if(at(r))return O(e,{className:()=>{let e=i();return at(e)?e.className:``}}),null;if(t(r)&&r!=null){if(j()&&ot(e)){let t=e;F(t);let n=String(r),a=st(t,n);return a&&te(a,{resolver:i,lastValue:n}),null}return lt(a,i,r)}return null}catch(e){return k.set(i,{value:void 0,error:!0}),c(`Error evaluating reactive text function:`,e),lt(a,()=>``)}let o=i(e,a);return o==null?null:t(o)?ut(a,o):n(o)?o:(r(o)&&O(e,o),null)}let l=i;if(t(l)){if(j()&&ot(e)){let t=e;return F(t),st(t,String(l)),null}return ut(a,l)}return n(l)?l:(O(e,l),null)}function ct(e,t){if(l&&!j()&&!Qe())return t;let n=_e();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=C(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function lt(e,t,n){return ct(e,Je(t,n))}function ut(e,t){return ct(e,x(String(t)))}function L(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=I(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function dt(e,t){let n=he(e);return L(n,t,0),n}function ft(e,t){let n=ge(me,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return L(n,t,0),n}function pt(e,...t){return function(n,r=0){let i=n,a=i?rt(i,e):null,o=a??he(e),s=o,c=a?s.lastChild:null;return L(o,t,r),a&&it(s,c),o}}function mt(e,...t){return function(n,r=0){let i=n,a=i?rt(i,e):null,o=a??ge(`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 L(o,t,r),a&&it(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){t in e&&typeof e[t]!=`function`||(e[t]=ht(t))}function xt(e,t){let n=`${t}Svg`;n in e||(e[n]=gt(t))}function St(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<vt.length;t++)xt(e,vt[t]);for(let t=0;t<_t.length;t++)bt(e,_t[t]);e[t]=!0}}function Ct(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,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 R=new Set,Tt=new WeakMap,Et=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{R.delete(e)}):null;function Dt(e,t){let n=new WeakRef(e);R.add(n),Tt.set(e,t),Et?.register(e,n)}function Ot(e){return Array.isArray(e)?e:Array.from(e)}function kt(e,t,n){return Ct(e.renderItem(t,n),e.host,n)}function At(e){let t=e;t.element=null,t.item=null}function z(e){S(e.element),At(e)}function jt(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=r.element;i&&i.parentNode===t&&t.removeChild(i),At(r)}return!0}function Mt(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 Nt(e,t,n,r,i,a,o){let s=_e(),c=0;for(let l=r;l<i;l++){let r=n[l],i=kt(e,r,l);if(!i)continue;o.push({item:r,element:i});let u=i;s?(s.appendChild(u),c++):t.insertBefore(u,a)}s&&c>0&&t.insertBefore(s,a)}function Pt(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ft(e){let{host:t,startMarker:n,endMarker:r}=e,i=n.parentNode??t,a=Ot(e.itemsProvider());if(wt(e.lastSyncedItems,a))return;let o=e.records,s=a.length;if(s===0){if(!jt(o,i,n,r))for(let e=0;e<o.length;e++)z(o[e]);e.records=[],e.lastSyncedItems=[];return}if(o.length===0){let t=[];Nt(e,i,a,0,s,r,t),e.records=t,e.lastSyncedItems=a.slice();return}let c=e.lastSyncedItems;if(s>c.length&&Pt(c,a)){Nt(e,i,a,c.length,s,r,o),e.records=o,e.lastSyncedItems=a.slice();return}let l=new Map,u=new Map,d=new Map;for(let e=0;e<o.length;e++){let t=o[e];d.set(t,e);let n=u.get(t.item);n?n.push(t):u.set(t.item,[t])}for(let e=0;e<s;e++){let t=a[e];if(e<c.length&&c[e]===t){let n=o[e];if(n&&n.item===t){l.set(e,n);let r=u.get(t);r.splice(r.indexOf(n),1),r.length===0&&u.delete(t)}}}let f=Array(s),p=new Set(o),m=0;for(let t=s-1;t>=0;t--){let n=a[t],r=l.get(t);if(!r){let e=u.get(n);e&&e.length>0&&(r=e.shift(),e.length===0&&u.delete(n))}if(r)p.delete(r),m++;else{let i=kt(e,n,t);if(!i){f[t]=null;continue}r={item:n,element:i}}f[t]=r}if(m===0){if(!jt(o,i,n,r))for(let e of p)z(e)}else for(let e of p)z(e);let h=[],g=[];for(let e=0;e<s;e++){let t=f[e];if(!t)continue;let n=d.get(t);n!==void 0&&(h.push(e),g.push(n))}let _=new Set;if(g.length>0){let e=Mt(g);for(let t=0;t<e.length;t++)_.add(h[e[t]])}let v=r,y=null;for(let e=s-1;e>=0;e--){let t=f[e];if(!t)continue;let n=t.element;if(!d.has(t)){y||=_e(),y?y.insertBefore(n,y.firstChild):(i.insertBefore(n,v),v=n);continue}if(y&&y.firstChild){let e=y.firstChild;i.insertBefore(y,v),v=e,y=null}_.has(e)||i.insertBefore(n,v),v=n}y&&y.firstChild&&i.insertBefore(y,v),e.records=f.filter(e=>e!==null),e.lastSyncedItems=a.slice()}function It(e,t,n,r){return j()?Lt(e,t,n,r):B(e,t,n,r)}function B(e,t,n,r){let{start:i,end:a}=Se(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Ft(o),l&&Dt(i,o),o}function Lt(e,t,n,r){let i=n;P(i);let a=M(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return B(e,t,n,r);let o=F(i),s=0,c=M(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=C(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return B(e,t,n,r);let d=Ot(e()),f=[];for(let e=0;e<d.length;e++){let r=Ct(t(d[e],e),n,e);r&&f.push({item:d[e],element:r})}let p=M(i);for(;p&&p!==u;){let e=p.nextSibling;S(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}N(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return l&&Dt(o,h),h}function Rt(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null}e.records=[]}function zt(e){let t=[];for(let n of R){let r=n.deref();if(!r){t.push(n);continue}let i=Tt.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){Rt(i),Tt.delete(r),t.push(n);continue}e&&!e.contains(r)||Ft(i)}for(let e of t)R.delete(e)}function Bt(e,t){return function(n,r){return It(e,t,n,r).startMarker}}function Vt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Ht(e,t){return typeof e==`function`?Vt(e,t):!!e}function Ut(e,t,n,r){return o(e)?s(e)?(k.delete(e),I(t,e,n)):Le(t,r,()=>{let r=I(t,e,n);return r&&!r.parentNode?r:null}):I(t,e,n)}function Wt(e,t,n,r){let i=[];for(let a of e){let e=Ut(a,t,n,r);e&&i.push(e)}return i}let V=new Set,H=new WeakMap,Gt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{V.delete(e)}):null;function Kt(e,t){for(let t=0;t<e.length;t++)if(Ht(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=Kt(t,n);o!==e.activeIndex&&(Ce(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&we(Wt(o>=0?t[o].content:n,r,i,a),a))}function Jt(e){let t=new WeakRef(e.startMarker);V.add(t),H.set(e.startMarker,e),Gt?.register(e.startMarker,t)}function Yt(e){let t=[];for(let n of V){let r=n.deref();if(r===void 0){t.push(n);continue}let i=H.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){H.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch{H.delete(r),t.push(n)}}for(let e of t)V.delete(e)}function Xt(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Zt(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Qt=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?j()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=Se(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Ie(e);return a.appendChild(n),a.appendChild(r),qt(i),n.textContent=Xt(t,i.activeIndex),n}hydrateRender(e,t){let n=e;P(n);let r=M(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=F(n),a=0,o=M(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=C(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=Kt(this.groups,this.elseContent),u=Zt(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)I(e,r,t)}}else if(Ce(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;tt(()=>{we(Wt(n,e,t,r),r)})}return N(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&&Jt(a),a}};function $t(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return $t(e.cloneWith({condition:t,content:n}))},else:function(...t){return $t(e.cloneWith(void 0,t))}})}function en(e,...t){return $t(new Qt(e,...t))}function tn(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=ge(me,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=he(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function nn(e){let t=pe(e);if(!t)return;let n=Vt(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=tn(t);ue(n,t),Ee(e,n)}else if(!n&&r){let n=xe(t.tagName);n&&(ue(n,t),Ee(e,n))}}function rn(e){if(l)try{let t=fe();for(let n of t){if(!n.isConnected){de(n);continue}e&&!e.contains(n)||nn(n)}}catch(e){c(`Error during conditional elements update`,e)}}function an(){if(typeof document>`u`)return;let e=document.body?[document.body,document]:[document];for(let t of e)try{t.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){c(`Error dispatching global update event`,e)}}let U=new Map;function on(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 sn(e,t){let n=U.get(e);n||(n=new Set,U.set(e,n)),n.add(new WeakRef(t))}function cn(e){let t=on(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=U.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(!w(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&U.delete(e)}return Array.from(n)}function ln(...e){let t=on(e);return function(e){if(l&&e instanceof Element)for(let n of t)sn(n,e)}}let un=[zt,Yt,rn,Fe,Ye,an];function dn(...e){let t;if(e.length>0){let n=cn(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 un)e(t)}function fn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function pn(e,t){let n=t||document.body,r=n;$e();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=M(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),S(e),N(r,t)}else r.appendChild(i),N(r,null)}return t}finally{et()}}let mn=null;function hn(e){mn=e}let gn=new Map,_n=new Map,vn=new Set,W=[],G=new Map,K=null,q=null,J=null,Y=0,X=new Map;function yn(e){for(let t of e)G.has(t)||G.set(t,[])}function bn(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return X.set(t,r),r}catch{return null}}function xn(e,t){try{e.insertRule(t,Y),Y++}catch{}}function Sn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(q&&J===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,J=document,X.clear(),Y=0,!q)return null;for(let e of W)xn(q,e);for(let[e,t]of G){let n=bn(q,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return q}function Cn(e,t){if(t===void 0)W.push(e);else{let n=G.get(t);n||(n=[],G.set(t,n)),n.push(e)}K=null,mn?.(t===void 0?e:t+`{`+e+`}`);let n=Sn();if(n)if(t===void 0)xn(n,e);else{let r=X.get(t)??bn(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function wn(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 Z(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=gn.get(i);return a===void 0?(a=`n`+wn(i),gn.set(i,a),_n.set(a,(e??``)+`|`+t+`|`+n),Cn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(Sn(),a)}function Tn(e){return _n.get(e)}function En(e,t){if(vn.has(e)){Sn();return}vn.add(e),Cn(t,void 0)}function Dn(){if(K!==null)return K;let e=W.join(``);for(let[t,n]of G)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return K=e,e}function On(){gn.clear(),_n.clear(),vn.clear(),W.length=0,G.clear(),X.clear(),K=null,Y=0,q=null,J=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`},An={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`}},Mn={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`},Nn=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`]),Pn=new Map;function Fn(e){let t=Pn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Pn.set(e,t)),t}function In(e){return e.charCodeAt(0)===64?e:`@media `+e}function Ln(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Rn(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function zn(e,t){for(let n of e)if(n)if(typeof n==`string`)for(let e of n.split(` `))e&&t.set(Tn(e)??e,e);else if(Array.isArray(n))zn(n,t);else for(let e of n.className.split(` `))e&&t.set(Tn(e)??e,e)}function Q(...e){let t=new Map;zn(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Rn(n)}function Bn(e={}){let t=e.screens??{};yn(Object.values(t).map(In));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Nn.has(t)?String(n):n+`px`;let r=Mn[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(Z(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,Ln(n,In(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,Ln(n,s),a,o);continue}continue}if(c===!0){let e=jn[s];if(e)for(let t in e)o.push(Z(n,a,t,e[t]));continue}let l=An[s];if(l!==void 0)for(let e of l)o.push(Z(n,a,e,r(e,c)));else{let e=Fn(s);o.push(Z(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=Rn(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=An[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Fn(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`+wn(t);return En(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;En(`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=Q(...d);return l.set(a,f),f}}return{css:a,cx:Q,variants:l,keyframes:s,globalStyle:c,theme:e}}let $=Bn({}),Vn=$.css,Hn=$.variants,Un=$.keyframes,Wn=$.globalStyle;function Gn(){St();let e=globalThis;e.list=Bt,e.update=dn,e.when=en,e.on=m,e.scope=ln,e.render=fn,e.hydrate=pn,e.createCss=Bn,e.css=Vn,e.cx=Q,e.variants=Hn,e.keyframes=Un,e.globalStyle=Wn}Gn(),e.HTML_TAGS=_t,e.SELF_CLOSING_TAGS=yt,e.SVG_TAGS=vt,e.appendChildren=Te,e.applyAttributes=O,e.applyNodeModifier=I,e.createComment=C,e.createConditionalComment=xe,e.createCss=Bn,e.createHtmlElementWithModifiers=dt,e.createHtmlTagBuilder=ht,e.createSvgElementWithModifiers=ft,e.createSvgTagBuilder=gt,e.css=Vn,e.cx=Q,e.getCssText=Dn,e.globalStyle=Wn,e.hydrate=pn,e.initializeRuntime=Gn,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=Un,e.list=Bt,e.on=m,e.registerGlobalTagBuilders=St,e.render=fn,e.replaceNodeSafely=Ee,e.resetStyles=On,e.scope=ln,e.setSSRCollector=hn,e.update=dn,e.variants=Hn,e.when=en});
2
2
  //# sourceMappingURL=nuclo.umd.js.map