nuclo 0.2.24 → 0.2.26
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/README.md +19 -19
- package/dist/nuclo.cjs +1 -1
- package/dist/nuclo.cjs.map +1 -1
- package/dist/nuclo.mjs +1 -1
- package/dist/nuclo.mjs.map +1 -1
- package/dist/nuclo.umd.js +1 -1
- package/dist/nuclo.umd.js.map +1 -1
- package/dist/ssr/nuclo.ssr.cjs +1 -1
- package/dist/ssr/nuclo.ssr.cjs.map +1 -1
- package/dist/ssr/nuclo.ssr.mjs +1 -1
- package/dist/ssr/nuclo.ssr.mjs.map +1 -1
- package/dist/style/engine.d.ts +16 -1
- package/dist/style/engine.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,10 +17,10 @@ let count = 0;
|
|
|
17
17
|
|
|
18
18
|
const counter = div(
|
|
19
19
|
h1(() => `Count: ${count}`),
|
|
20
|
-
button('Increment',
|
|
20
|
+
button('Increment', { onClick: () => {
|
|
21
21
|
count++;
|
|
22
22
|
update();
|
|
23
|
-
})
|
|
23
|
+
} })
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
render(counter, document.body);
|
|
@@ -92,7 +92,7 @@ import 'nuclo';
|
|
|
92
92
|
let count = 0;
|
|
93
93
|
const app = div(
|
|
94
94
|
h1(() => `Count: ${count}`),
|
|
95
|
-
button('Click',
|
|
95
|
+
button('Click', { onClick: () => { count++; update(); } })
|
|
96
96
|
);
|
|
97
97
|
render(app, document.body);
|
|
98
98
|
```
|
|
@@ -128,8 +128,8 @@ let count = 0;
|
|
|
128
128
|
|
|
129
129
|
const app = div(
|
|
130
130
|
h1(() => `Count: ${count}`),
|
|
131
|
-
button('Increment',
|
|
132
|
-
button('Reset',
|
|
131
|
+
button('Increment', { onClick: () => { count++; update(); } }),
|
|
132
|
+
button('Reset', { onClick: () => { count = 0; update(); } })
|
|
133
133
|
);
|
|
134
134
|
|
|
135
135
|
render(app, document.body);
|
|
@@ -162,7 +162,7 @@ const app = div(
|
|
|
162
162
|
on('input', e => { inputValue = e.target.value; update(); }),
|
|
163
163
|
on('keydown', e => e.key === 'Enter' && addTodo())
|
|
164
164
|
),
|
|
165
|
-
button('Add',
|
|
165
|
+
button('Add', { onClick: addTodo })
|
|
166
166
|
),
|
|
167
167
|
|
|
168
168
|
// List
|
|
@@ -174,10 +174,10 @@ const app = div(
|
|
|
174
174
|
on('change', () => { todo.done = !todo.done; update(); })
|
|
175
175
|
),
|
|
176
176
|
span(() => todo.text),
|
|
177
|
-
button('×',
|
|
177
|
+
button('×', { onClick: () => {
|
|
178
178
|
todos = todos.filter(t => t.id !== todo.id);
|
|
179
179
|
update();
|
|
180
|
-
})
|
|
180
|
+
} })
|
|
181
181
|
)
|
|
182
182
|
)
|
|
183
183
|
).else(
|
|
@@ -283,7 +283,7 @@ const app = div(
|
|
|
283
283
|
}),
|
|
284
284
|
on('keydown', e => e.key === 'Enter' && fetchProducts())
|
|
285
285
|
),
|
|
286
|
-
button('Search',
|
|
286
|
+
button('Search', { onClick: fetchProducts })
|
|
287
287
|
),
|
|
288
288
|
|
|
289
289
|
when(() => state.status === 'loading',
|
|
@@ -445,26 +445,26 @@ when(() => count > 10,
|
|
|
445
445
|
|
|
446
446
|
First matching condition wins. DOM is preserved if the active branch doesn't change.
|
|
447
447
|
|
|
448
|
-
####
|
|
448
|
+
#### Events
|
|
449
449
|
|
|
450
|
-
Attach event
|
|
450
|
+
Attach strongly typed handlers directly as camel-cased `on*` attribute props such as `onClick`, `onInput`, and `onChange`. The event and `currentTarget` types are inferred from the attribute and element:
|
|
451
451
|
|
|
452
452
|
```ts
|
|
453
|
-
button('
|
|
454
|
-
on('click', () => console.log('clicked')),
|
|
455
|
-
on('mouseenter', handleHover, { passive: true })
|
|
456
|
-
)
|
|
453
|
+
button('Remove', { className: 'remove', onClick: () => doDelete(row.id) })
|
|
457
454
|
```
|
|
458
455
|
|
|
459
|
-
|
|
456
|
+
This is the preferred way to wire up events — it reads naturally inside object literals (e.g. row templates in a `list()`).
|
|
460
457
|
|
|
461
|
-
|
|
458
|
+
Use the `on(event, handler, options?)` helper instead when you need multiple listeners for the same event type on one element, or want to pass listener `options` such as `{ passive: true }`:
|
|
462
459
|
|
|
463
460
|
```ts
|
|
464
|
-
button('
|
|
461
|
+
button('Click me',
|
|
462
|
+
on('click', trackClick),
|
|
463
|
+
on('click', logClick, { passive: true })
|
|
464
|
+
)
|
|
465
465
|
```
|
|
466
466
|
|
|
467
|
-
|
|
467
|
+
Standard names are inferred from the common HTML, media, video, and body event maps. Custom events can provide their event type explicitly with `on<"app:ready", CustomEvent<Detail>>(...)`.
|
|
468
468
|
|
|
469
469
|
#### `scope(...ids)`
|
|
470
470
|
|
package/dist/nuclo.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function t(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&`tagName`in e}function i(e){return typeof e==`boolean`}function a(e){return typeof e==`function`}function o(e){return a(e)&&e.length===0}function s(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const c=typeof window<`u`&&typeof document<`u`,l=new WeakMap;function u(e,t){let n=l.get(e);n?Array.isArray(n)?n.includes(t)||n.push(t):n!==t&&l.set(e,[n,t]):l.set(e,t)}function d(e,t){e.removeEventListener(t.type,t.wrapped,t.capture)}function f(e,t){let n=l.get(e);if(!n)return;if(t===void 0){if(Array.isArray(n))for(let t=0;t<n.length;t++)d(e,n[t]);else d(e,n);l.delete(e);return}if(!Array.isArray(n)){n.type===t&&(d(e,n),l.delete(e));return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?d(e,a):n[r++]=a}r===0?l.delete(e):r===1?l.set(e,n[0]):n.length=r}function p(e){}function m(e,t,n){return{type:e,wrapped:function(n){let r=this;try{t.call(r,n)}catch(t){s(`Error in '${e}' listener`,t)}},capture:n}}function h(e,t,n){if(!c)return p;let r=m(e,t,n===!0||typeof n==`object`&&!!n&&n.capture===!0);return function(t){if(!t||typeof t.addEventListener!=`function`)return;let i=t;i.addEventListener(e,r.wrapped,n),u(i,r)}}const g=new Set,_=new WeakMap,v=new Set,y=new WeakMap;function b(e,t){let n=_.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);g.add(r),_.set(e,{ref:r,info:t})}function ee(e,t){let n=new WeakRef(e);v.add(n),y.set(e,{ref:n,info:t})}function x(e){g.delete(e)}function S(e){v.delete(e)}function C(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}function w(e){let t=y.get(e);t&&(v.delete(t.ref),y.delete(e))}const T=new WeakMap,E=new Set,D=new WeakMap,te=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{E.delete(e)}):null;function ne(e,t){T.set(e,t);let n=new WeakRef(e);E.add(n),D.set(e,n),te?.register(e,n)}function re(e){T.delete(e);let t=D.get(e);t&&(E.delete(t),D.delete(e))}function ie(){let e=[],t=[];for(let n of E){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)E.delete(e);return e}function ae(e){return T.get(e)??null}const oe=`http://www.w3.org/2000/svg`;function se(e){return globalThis.document?document.createElement(e):null}function ce(e,t){return globalThis.document?document.createElementNS(e,t):null}function O(e){return globalThis.document?document.createTextNode(e):null}function le(){return globalThis.document?document.createDocumentFragment():null}function ue(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function de(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),w(t),re(t)}else e.nodeType===Node.TEXT_NODE?C(e):e.nodeType===Node.COMMENT_NODE&&re(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)de(e.childNodes[t])}function k(e){if(!e?.parentNode)return!1;try{return de(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function fe(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return s(`Failed to insert node before reference`,e),!1}}function A(e){return globalThis.document?globalThis.document.createComment(e):null}function pe(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function me(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 he(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;k(n),n=e}}function ge(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)fe(n,e[r],t)}function _e(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=O(r);if(e)t=e;else continue}else t=r;ue(e,t)}}return e}function j(e){return e?.isConnected===!0}function ve(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return s(`Error replacing conditional node`,e),!1}}function ye(e){return e}function be(e,t,n){let r=ye(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 xe(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}}const Se={};let Ce=!1;function we(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=y.get(n);e&&(j(n)?ke(e.info):(S(e.ref),y.delete(n)))}n=n.parentNode}}function Te(){Ce||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,we,!0),Ce=!0)}function Ee(e){let t=y.get(e);if(t)return t.info;let n={attributeResolvers:[]};return ee(e,n),n}function De(e){return typeof e!=`object`||!e}function Oe(e){let t;try{t=e.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=De(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:Se}catch(t){s(`Failed to apply reactive attribute: ${e.key}`,t)}}function ke(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Oe(t[e])}function Ae(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){s(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:Se};if(!c){Oe(i);return}Te();let a=Ee(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),Oe(i)}function je(e){let t=[];for(let n of v){let r=n.deref();if(r===void 0){t.push(n);continue}let i=y.get(r);if(!i){t.push(n);continue}if(!j(r)){y.delete(r),t.push(n);continue}e&&!e.contains(r)||ke(i.info)}for(let e of t)S(e)}function Me(e,t){if(!(!e?.style||!t))for(let n in t)xe(e,n,t[n])||s(`Failed to set style property '${n}'`)}function Ne(e,t){e&&(a(t)?Ae(e,`style`,t,function(t){Me(e,t)}):Me(e,t))}const Pe=new WeakMap;function Fe(e){if(e.length<=2||e.charCodeAt(0)!==111||e.charCodeAt(1)!==110)return null;let t=e.charCodeAt(2);return t<65||t>90?null:e===`onDoubleClick`?`ondblclick`:e.toLowerCase()}function Ie(e,t,n){if(t in e){e[t]=n;return}let r=t.slice(2),i=Pe.get(e);if(i){for(let t=0;t<i.length;t+=2){if(i[t]!==r)continue;let a=i[t+1];if(a===n)return;e.removeEventListener(r,a),e.addEventListener(r,n),i[t+1]=n;return}e.addEventListener(r,n),i.push(r,n);return}e.addEventListener(r,n),Pe.set(e,[r,n])}const M=new WeakMap,Le=new WeakSet;function Re(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 ze(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Be(e){if(e.className&&!M.has(e)){let t=new Set;Re(t,e.className),M.set(e,t)}Le.add(e)}function Ve(e){return Le.has(e)}function He(e,t){if(!t)return;let n=M.get(e);n||(n=new Set,M.set(e,n)),Re(n,t)}function Ue(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=ze(n);return}let r=ze(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 We(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;Re(r,n),Re(r,t),e.className=ze(r)}else e.className=t}function Ge(e,t,n){if(typeof e!=`function`){s(`Invalid resolver provided to createReactiveTextNode`);let e=O(``);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){s(`Failed to evaluate reactive text resolver`,e),r=``}let i=r===void 0?``:String(r),a=O(i);if(!a)throw Error(`Failed to create text node: document not available`);return c&&b(a,{resolver:e,lastValue:i,sanitize:n}),a}function Ke(e){let t=[];for(let n of g){let r=n.deref();if(r===void 0){t.push(n);continue}let i=_.get(r);if(!i){t.push(n);continue}let a=i.info;if(!j(r)){_.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){s(`Failed to update reactive text node`,e),o=void 0}let c=a.sanitize?o==null||typeof o==`object`||typeof o==`function`?``:String(o):o===void 0?``:String(o);c!==a.lastValue&&(r.textContent=c,a.lastValue=c)}for(let e of t)x(e)}function qe(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){We(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 Je(e,t,n,r=!1){if(n==null)return;let i=t;if(i===`style`){Ne(e,n);return}if(a(n)){if(i===`onClick`){e.onclick=n;return}if(i.charCodeAt(0)===111&&i.charCodeAt(1)===110){let t=Fe(i);if(t){Ie(e,t,n);return}if(i in e){e[i]=n;return}}if(n.length===0){let t=n;i===`className`&&e instanceof HTMLElement?(Be(e),Ae(e,i,t,function(t){Ue(e,String(t||``))})):Ae(e,i,t,function(t){qe(e,i,t,!1)});return}}if(i===`className`&&e instanceof HTMLElement&&Ve(e)){let t=String(n||``);t&&(He(e,t),We(e,t));return}qe(e,i,n,r)}function N(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];Je(e,i,a,n&&i===`className`)}}let P=!1,Ye=new WeakMap;function F(){return P}function Xe(){return!1}function Ze(){P=!0,Ye=new WeakMap}function Qe(){P=!1}function $e(e){let t=P;P=!1;try{return e()}finally{P=t}}function I(e){let t=Ye.get(e);return t===void 0?e.firstChild:t}function L(e,t){Ye.set(e,t)}function et(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function R(e){let t=I(e),n=!1;for(;t&&et(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 tt(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 nt(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)}const B=new WeakMap;function rt(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function it(e){R(e);let t=I(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function at(e,t){let n=I(e);if(n&&n.nodeType===3)return z(e),n.textContent!==t&&(n.textContent=t),n;let r=O(t);return r?(e.insertBefore(r,n),L(e,n),r):null}function V(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=B.get(i);if(t||(t={value:i(),error:!1},B.set(i,t)),t.error)return st(c,()=>``);let n=t.value;if(rt(n))return N(r,{className:()=>{let e=i();return rt(e)?e.className:``}}),null;if(e(n)){let e=i,t=n??``;if(F()&&it(r)){let n=r;z(n);let i=String(t),a=at(n,i);return a&&b(a,{resolver:e,lastValue:i,sanitize:!0}),null}return st(c,e,t,!0)}return null}catch(e){return B.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),st(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?ct(c,a):t(a)?a:(n(a)&&N(r,a),null)}let l=i;if(e(l)){if(F()&&it(r)){let e=r;return z(e),at(e,String(l)),null}return ct(c,l)}return t(l)?l:(N(r,l),null)}function ot(e,t){if(c&&!F()&&!Xe())return t;let n=le();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 st(e,t,n,r){return ot(e,Ge(t,n,r))}function ct(e,t){return ot(e,O(String(t)))}const lt=Symbol(`nuclo.factory.tag`),ut=Symbol(`nuclo.factory.mods`);let H=0;const dt=[];let ft=0;function pt(){return ft>=dt.length&&dt.push(()=>null),dt[ft++]}function mt(e,t,n){e[lt]=t,e[ut]=n}function U(e){return typeof e==`function`?e[ut]:void 0}function W(e){return typeof e==`function`?e[lt]:void 0}function ht(){return H>0}function gt(e,t,n){let r=H===0;H++,r&&(ft=0);try{return e(t,n)}finally{H--}}function _t(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 vt(e,t){let n=se(e);if(!n)throw Error(`Failed to create element: ${e}`);return _t(n,t,0),n}function yt(e,t){let n=ce(oe,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return _t(n,t,0),n}function bt(e,t){if(ht()){let n=pt();return mt(n,e,t),n}let n=function(n,r=0){let i=n,a=i?tt(i,e):null,o=a??se(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return _t(o,t,r),a&&nt(s,c),o};return mt(n,e,t),n}function xt(e,t){if(ht()){let n=pt();return mt(n,e,t),n}return function(n,r=0){let i=n,a=i?tt(i,e):null,o=a??ce(`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 _t(o,t,r),a&&nt(s,c),o}}function St(e){return(...t)=>bt(e,t)}function Ct(e){return(...t)=>xt(e,t)}const wt=`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(`.`),Tt=`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(`.`),Et=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function Dt(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 Ot(e,t){t in e&&typeof e[t]!=`function`||(Dt(e,t,()=>St(t)),t===`var`&&Dt(e,`var_`,()=>St(t)))}function kt(e,t){let n=`${t}Svg`;n in e||Dt(e,n,()=>Ct(t))}function At(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<Tt.length;t++)kt(e,Tt[t]);for(let t=0;t<wt.length;t++)Ot(e,wt[t]);e[t]=!0}}function jt(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function Mt(e,n){let r=[],i=0;for(let e=0;e<n.length;e++){let a=n[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=Mt(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(t(a))return null;let e=a,n=Object.keys(e),o=[];for(let t=0;t<n.length;t++){let r=n[t],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`){let e=Fe(r);if(e){o.push({key:r,kind:1,prop:!1,value:e});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 Nt(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;Nt(i.child,r),r=r.nextSibling;break}}}function Pt(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;let e=a.value;e===`onclick`?n.onclick=o:Ie(n,e,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||!Pt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function Ft(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;w(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;C(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||!Ft(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function It(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 Lt(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}const Rt=new Set,zt=new WeakMap,Bt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Rt.delete(e)}):null;let Vt=0;function Ht(e,t){let n=new WeakRef(e);Rt.add(n),zt.set(e,t),Bt?.register(e,n)}function Ut(e){return Array.isArray(e)?e:Array.from(e)}function Wt(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function Gt(e,t,n){let r=e.renderItem(t,n);return Wt(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):jt(r,e.host,n)}function Kt(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=c&&!F()&&!Xe(),a=r&&i?gt(e.renderItem,t,n):e.renderItem(t,n);if(Wt(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?Mt(t,i):null,o=jt(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);Nt(r,t);let n=[];if(Ft(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 Pt(r.tmpl,i,o,s)?(s.length>0&&(e.lastRenderLeaves=s),o):(e.template=null,Gt(e,t,n))}else if(r===void 0)e.template=null;else return e.template=null,Gt(e,t,n)}return jt(a,e.host,n)}function qt(e){k(e.element)}function Jt(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(c&&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 Yt(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 Xt(e,t,n,r,i,a,o){let s=le(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Kt(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=Ut(e.itemsProvider());if(Lt(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!Jt(a,r,t,n))for(let e=0;e<o;e++)qt(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)Xt(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];Xt(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++)qt(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(!Jt(a,r,t,n))for(let e=0;e<o;e++)qt(a[e]);let c=[];Xt(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]||qt(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=Yt(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=Kt(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||=le(),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)),te=0;for(let e=0;e<f;e++)D[te++]=a[e];for(let e=0;e<_;e++){let t=C[e];t&&(D[te++]=t)}for(let e=p;e<o;e++)D[te++]=a[e];e.records=D,e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice()}function Qt(e,t,n,r){return F()?en(e,t,n,r):$t(e,t,n,r)}function $t(e,t,n,r){let{start:i,end:a}=me(`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),c&&Ht(i,o),o}function en(e,t,n,r){let i=n;R(i);let a=I(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return $t(e,t,n,r);let o=z(i),s=0,l=I(i);for(;l;){if(l.nodeType===8){let e=l.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}l=l.nextSibling}let u=l;if(!u){let e=A(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return $t(e,t,n,r);let d=Ut(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=Wt(r)?r:null,a=i?i.element:jt(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;k(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 c&&Ht(o,h),h}function tn(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 nn(e){let t=[];Vt++;for(let n of Rt){let r=n.deref();if(!r){t.push(n);continue}let i=zt.get(r);if(!i){t.push(n);continue}if(!j(r)||!j(i.endMarker)){tn(i),zt.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=Vt;try{Zt(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===Vt)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===Vt)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&It(n)}}for(let e of t)Rt.delete(e)}function rn(e,t){return function(n,r){return Qt(e,t,n,r).startMarker}}function an(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function on(e,t){return typeof e==`function`?an(e,t):!!e}const sn=new Set,cn=new WeakMap,ln=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{sn.delete(e)}):null;function un(e,t){for(let t=0;t<e.length;t++)if(on(e[t].condition))return t;return t.length>0?-1:null}function dn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=un(t,n);o!==e.activeIndex&&(he(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&ge(hn(o>=0?t[o].content:n,r,i,a),a))}function fn(e){let t=new WeakRef(e.startMarker);sn.add(t),cn.set(e.startMarker,e),ln?.register(e.startMarker,t)}function pn(e){let t=[];for(let n of sn){let r=n.deref();if(r===void 0){t.push(n);continue}let i=cn.get(r);if(!i){t.push(n);continue}if(!j(r)||!j(i.endMarker)){cn.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch(e){s(`when() branch threw during update; unregistering this conditional`,e),cn.delete(r),t.push(n)}}for(let e of t)sn.delete(e)}function mn(e,t,n,r){return a(e)?o(e)?(B.delete(e),V(t,e,n)):be(t,r,()=>{let r=V(t,e,n);return r&&!r.parentNode?r:null}):V(t,e,n)}function hn(e,t,n,r){let i=[];for(let a of e){let e=mn(a,t,n,r);e&&i.push(e)}return i}function gn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function _n(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var vn=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}=me(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=ye(e);return a.appendChild(n),a.appendChild(r),dn(i),n.textContent=gn(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=un(this.groups,this.elseContent),u=_n(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(he(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;$e(()=>{ge(hn(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(){dn(a)}};return c&&fn(a),a}};function yn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return yn(e.cloneWith({condition:t,content:n}))},else:function(...t){return yn(e.cloneWith(void 0,t))}})}function bn(e,...t){return yn(new vn(e,...t))}function xn(e){try{return e.isSvg?yt(e.tagName,e.modifiers):vt(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=ce(oe,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=se(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function Sn(e){let t=ae(e);if(!t)return;let n=an(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=xn(t);ne(n,t),ve(e,n)}else if(!n&&r){let n=pe(t.tagName);n&&(ne(n,t),ve(e,n))}}function Cn(e){if(c)try{let t=ie();for(let n of t){if(!n.isConnected){re(n);continue}e&&!e.contains(n)||Sn(n)}}catch(e){s(`Error during conditional elements update`,e)}}const wn=new Map;function Tn(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 En(e,t){let n=wn.get(e);n||(n=new Set,wn.set(e,n)),n.add(new WeakRef(t))}function Dn(e){let t=Tn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=wn.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&&wn.delete(e)}return Array.from(n)}function On(...e){let t=Tn(e);return function(e){if(c&&e instanceof Element)for(let n of t)En(n,e)}}const kn=[nn,pn,Cn,je,Ke,jn];function An(...e){let t;if(e.length>0){let n=Dn(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 kn)e(t)}function jn(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){s(`Error dispatching global update event`,e)}}function Mn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function Nn(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=I(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),k(e),L(r,t)}else r.appendChild(i),L(r,null)}return t}finally{Qe()}}let Pn=null;function Fn(e){Pn=e}const In=new Map,G=new Map,Ln=new Set,Rn=[],K=new Map;let zn=0,q=null,J=null,Bn=null,Y=0;const X=new Map;let Z=null,Vn=!1;function Hn(e){for(let t of e)K.has(t)||K.set(t,[])}function Un(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return X.set(t,r),X.set(Q(r),r),r}catch{return null}}function Q(e){let t=e.cssText,n=t.indexOf(`{`);return(n===-1?t:t.slice(0,n)).trim()}function Wn(e){return e instanceof CSSStyleRule?e.selectorText:Q(e)}function Gn(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function Kn(e,t){if(!Z)return;let n=Gn(t,Wn(e)),r=Z.get(n);r||(r=new Set,Z.set(n,r)),r.add(e.cssText)}function qn(e,t){if(!Z)return!1;let n=Gn(t,Wn(e)),r=Z.get(n);return r?.delete(e.cssText)?(r.size===0&&Z.delete(n),Z.size===0&&(Z=null),!0):!1}function Jn(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof CSSStyleRule){Kn(n,void 0);continue}let r=Q(n);if(`cssRules`in n&&!r.startsWith(`@keyframes`)){let e=n;Vn=!0,X.set(r,e);for(let t=0;t<e.cssRules.length;t++)Kn(e.cssRules[t],r)}else Kn(n,void 0)}}function Yn(e,t){try{e.insertRule(t,Y);let n=e.cssRules[Y];if(qn(n,void 0)){e.deleteRule(Y);return}Y++}catch{}}function Xn(e,t){try{let n=e.cssRules.length;e.insertRule(t,n);let r=e.cssRules[n];qn(r,Q(e))&&e.deleteRule(n)}catch{}}function Zn(e,t){let n=X.get(t);if(n)return n;if(!Vn)return Un(e,t);try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=Q(e.cssRules[n]);e.deleteRule(n);let i=X.get(r);if(i)return X.set(t,i),i}catch{return null}return Un(e,t)}function Qn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(J&&Bn===document&&J.ownerNode&&J.ownerNode.isConnected)return J;let e=document.getElementById(`nuclo-styles`),t;if(e?.tagName===`STYLE`?t=e:(t=document.createElement(`style`),t.id=`nuclo-styles`,e?e.replaceWith(t):document.head.appendChild(t)),J=t.sheet,Bn=document,X.clear(),Y=0,Z=null,Vn=!1,!J)return null;if(J.cssRules.length>0){let e=0;for(;e<J.cssRules.length;){let t=J.cssRules[e];if(!(t instanceof CSSStyleRule)&&`cssRules`in t&&!Q(t).startsWith(`@keyframes`))break;e++}Y=e,Z=new Map,Jn(J.cssRules)}for(let e of Rn)Yn(J,e);for(let[e,t]of K){let n=Zn(J,e);if(n)for(let e of t)Xn(n,e)}return J}function $n(e,t){let n=Qn();if(t===void 0)Rn.push(e);else{let n=K.get(t);n||(n=[],K.set(t,n)),n.push(e)}if(q=null,n)if(t===void 0)Yn(n,e);else{let r=Zn(n,t);r&&Xn(r,e)}Pn?.(t===void 0?e:t+`{`+e+`}`)}function er(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 tr(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function nr(e,t){return e+t.length+`:`+t}function rr(e,t){let n=``,r=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===92&&i+1<e.length){n+=e[i]+e[++i];continue}if(r!==0){n+=e[i],a===r&&(r=0);continue}a===34||a===39?(r=a,n+=e[i]):n+=a===38?t:e[i]}return n}function ir(e,t){let n=`.`+e;return n+rr(t,n)}function ar(e){if(e.length===0||e===`-`)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n===45||n===95||t>0&&n>=48&&n<=57))return!1}if(e.charCodeAt(0)===45&&e.length>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return!1}return!0}function or(e,t,n,r,i=!1){let a=``,o=tr(e,t);for(let[e,t]of n)a+=(a?`;`:``)+e+`:`+t,o=nr(nr(o,e),t);r!==void 0&&!ar(r)&&(console.warn(`[nuclo] css() name ${JSON.stringify(r)} is not a valid CSS class name (letters, digits, - and _ only, not starting with a digit); falling back to a generated name.`),r=void 0);let s=r===void 0?`a`+o:`n`+nr(``,r)+o,c=In.get(s);return c===void 0?(r===void 0?c=`n`+er(s):(c=i?r:r+`-`+er(s),G.has(c)&&console.warn(`[nuclo] css() name ${JSON.stringify(c)} is already used by a different style. Both rules are emitted under the same class, so they will override each other — rename one.`)),In.set(s,c),G.set(c,{query:e,suffix:t,decls:n,name:r}),$n(ir(c,t)+`{`+a+`}`,e),c):(Qn(),c)}function sr(e,t,n,r,i=!1){return or(e,t,n,r,i)}function cr(e,t){let n=G.get(e),r=G.get(t);if(!n||!r)return t;let i=[...n.decls,...r.decls],a=new Map;for(let e=0;e<i.length;e++)a.set(i[e][0],e);let o=i.filter((e,t)=>a.get(e[0])===t);return or(n.query,n.suffix,o,n.name??r.name)}function lr(e){let t=G.get(e);return t===void 0?void 0:tr(t.query,t.suffix)}function ur(){return zn}function dr(e,t){if(Ln.has(e)){Qn();return}Ln.add(e),$n(t,void 0)}function fr(){if(q!==null)return q;let e=Rn.join(``);for(let[t,n]of K)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return q=e,e}function pr(){In.clear(),G.clear(),Ln.clear(),Rn.length=0,K.clear(),X.clear(),q=null,Y=0,J=null,Bn=null,Z=null,Vn=!1,zn++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const mr={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`},hr={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`]},gr={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`}},_r={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`},vr=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`]),yr=new Map;function br(e){let t=yr.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),yr.set(e,t)),t}function xr(e){return e.charCodeAt(0)===64?e:`@media `+e}function Sr(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Cr(e,t){for(let n in t){let r=t[n],i=e[n];typeof r==`object`&&r&&!Array.isArray(r)&&typeof i==`object`&&i&&!Array.isArray(i)?e[n]=Cr({...i},r):e[n]=r}return e}function wr(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function Tr(e,t){let n=lr(t);if(n===void 0){e.set(t,t);return}let r=e.get(n);r===void 0||r===t?e.set(n,t):e.set(n,cr(r,t))}function Er(e,t){let n=0;for(let r=0;r<=e.length;r++){let i=r===e.length?32:e.charCodeAt(r);(i===32||i===9||i===10||i===12||i===13)&&(r>n&&Tr(t,e.slice(n,r)),n=r+1)}}function Dr(e,t){for(let n of e)n&&(typeof n==`string`?Er(n,t):Array.isArray(n)?Dr(n,t):Er(n.className,t))}function Or(...e){let t=new Map;Dr(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return wr(n)}function kr(e={}){let t=e.screens??{};Hn(Object.values(t).map(xr));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||vr.has(t)?String(n):n+`px`;let r=_r[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,t,n){let r=(t===void 0?`-`:`+`+t.length+`:`+t)+n.length+`:`+n,i=e.get(r);return i||(i={query:t,suffix:n,decls:[]},e.set(r,i)),i}function a(e,n,o,s){for(let c in e){let l=e[c];if(l==null||l===!1)continue;if(typeof l==`object`){if(c===`raw`){let e=l,t=i(s,n,o).decls;for(let n in e)t.push([n,r(n,e[n])]);continue}let e=mr[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,Sr(n,xr(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,rr(c,`&`+o).slice(1),s);continue}if(d===64){a(l,Sr(n,c),o,s);continue}continue}if(l===!0){let e=gr[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=hr[c];if(u!==void 0){let e=i(s,n,o).decls;for(let t of u)e.push([t,r(t,l)])}else{let e=br(c);i(s,n,o).decls.push([e,r(e,l)])}}}function o(e,t){let r=typeof e==`string`,i=r?t:e,o=r?e:void 0;if(i==null)return wr(``);let s=ur(),c=n.get(i);if(c!==void 0&&c.epoch===s&&c.name===o)return c.result;let l=new Map;a(i,void 0,``,l);let u=[];for(let e of l.values()){if(e.decls.length===0)continue;let t=e.query===void 0&&e.suffix===``;u.push(sr(e.query,e.suffix,e.decls,o,t))}let d=wr(u.join(` `));return n.set(i,{epoch:s,name:o,result:d}),d}function s(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=gr[t];if(e)for(let t in e)n(t,e[t]);continue}let a=hr[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=br(t);n(e,r(e,i))}}return t}function c(e){let t=``;for(let n in e)t+=n+`{`+s(e[n])+`}`;let n=`nk`+er(t);return dr(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;dr(`g|`+n,n)}function u(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},a=e.base??null,s=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,style:n}}),c=new Map;return function(e){let l={};for(let n of r){let r=(e?e[n]:void 0)??i[n];r!=null&&(l[n]=t(r))}let u=``;for(let e of r){let t=l[e];u+=e.length+`:`+e,u+=t===void 0?`-`:`+`+t.length+`:`+t}let d=c.get(u);if(d)return d;let f={};a&&(f=Cr(f,a));for(let e of r){let t=l[e];if(t!==void 0){let r=n[e][t];r&&(f=Cr(f,r))}}for(let e of s){let t=!0;for(let n in e.conditions)if(l[n]!==e.conditions[n]){t=!1;break}t&&(f=Cr(f,e.style))}let p=o(f);return c.set(u,p),p}}return{css:o,cx:Or,variants:u,keyframes:c,globalStyle:l,theme:e}}let Ar;function $(){return Ar??=kr({})}const jr=(e,t)=>typeof e==`string`?$().css(e,t):$().css(e),Mr=e=>$().variants(e),Nr=e=>$().keyframes(e),Pr=(e,t)=>$().globalStyle(e,t);function Fr(){At();let e=globalThis;e.list=rn,e.update=An,e.when=bn,e.on=h,e.scope=On,e.render=Mn,e.hydrate=Nn,e.createCss=kr,e.css=jr,e.cx=Or,e.variants=Mr,e.keyframes=Nr,e.globalStyle=Pr}Fr(),exports.HTML_TAGS=wt,exports.SELF_CLOSING_TAGS=Et,exports.SVG_TAGS=Tt,exports.appendChildren=_e,exports.applyAttributes=N,exports.applyNodeModifier=V,exports.createComment=A,exports.createConditionalComment=pe,exports.createCss=kr,exports.createHtmlElementWithModifiers=vt,exports.createHtmlTagBuilder=St,exports.createSvgElementWithModifiers=yt,exports.createSvgTagBuilder=Ct,exports.css=jr,exports.cx=Or,exports.getCssText=fr,exports.globalStyle=Pr,exports.hydrate=Nn,exports.initializeRuntime=Fr,exports.isBoolean=i,exports.isBrowser=c,exports.isFunction=a,exports.isNode=t,exports.isObject=n,exports.isPrimitive=e,exports.isTagLike=r,exports.isZeroArityFunction=o,exports.keyframes=Nr,exports.list=rn,exports.on=h,exports.registerGlobalTagBuilders=At,exports.render=Mn,exports.replaceNodeSafely=ve,exports.resetStyles=pr,exports.scope=On,exports.setSSRCollector=Fn,exports.update=An,exports.variants=Mr,exports.when=bn;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function t(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&`tagName`in e}function i(e){return typeof e==`boolean`}function a(e){return typeof e==`function`}function o(e){return a(e)&&e.length===0}function s(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const c=typeof window<`u`&&typeof document<`u`,l=new WeakMap;function u(e,t){let n=l.get(e);n?Array.isArray(n)?n.includes(t)||n.push(t):n!==t&&l.set(e,[n,t]):l.set(e,t)}function d(e,t){e.removeEventListener(t.type,t.wrapped,t.capture)}function f(e,t){let n=l.get(e);if(!n)return;if(t===void 0){if(Array.isArray(n))for(let t=0;t<n.length;t++)d(e,n[t]);else d(e,n);l.delete(e);return}if(!Array.isArray(n)){n.type===t&&(d(e,n),l.delete(e));return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?d(e,a):n[r++]=a}r===0?l.delete(e):r===1?l.set(e,n[0]):n.length=r}function p(e){}function m(e,t,n){return{type:e,wrapped:function(n){let r=this;try{t.call(r,n)}catch(t){s(`Error in '${e}' listener`,t)}},capture:n}}function h(e,t,n){if(!c)return p;let r=m(e,t,n===!0||typeof n==`object`&&!!n&&n.capture===!0);return function(t){if(!t||typeof t.addEventListener!=`function`)return;let i=t;i.addEventListener(e,r.wrapped,n),u(i,r)}}const g=new Set,_=new WeakMap,v=new Set,y=new WeakMap;function b(e,t){let n=_.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);g.add(r),_.set(e,{ref:r,info:t})}function ee(e,t){let n=new WeakRef(e);v.add(n),y.set(e,{ref:n,info:t})}function x(e){g.delete(e)}function S(e){v.delete(e)}function C(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}function w(e){let t=y.get(e);t&&(v.delete(t.ref),y.delete(e))}const T=new WeakMap,E=new Set,D=new WeakMap,O=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{E.delete(e)}):null;function te(e,t){T.set(e,t);let n=new WeakRef(e);E.add(n),D.set(e,n),O?.register(e,n)}function ne(e){T.delete(e);let t=D.get(e);t&&(E.delete(t),D.delete(e))}function re(){let e=[],t=[];for(let n of E){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)E.delete(e);return e}function ie(e){return T.get(e)??null}const ae=`http://www.w3.org/2000/svg`;function oe(e){return globalThis.document?document.createElement(e):null}function se(e,t){return globalThis.document?document.createElementNS(e,t):null}function k(e){return globalThis.document?document.createTextNode(e):null}function ce(){return globalThis.document?document.createDocumentFragment():null}function le(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function ue(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),w(t),ne(t)}else e.nodeType===Node.TEXT_NODE?C(e):e.nodeType===Node.COMMENT_NODE&&ne(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ue(e.childNodes[t])}function A(e){if(!e?.parentNode)return!1;try{return ue(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function de(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return s(`Failed to insert node before reference`,e),!1}}function j(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=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 me(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;A(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;le(e,t)}}return e}function M(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 s(`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}}const xe={};let 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=y.get(n);e&&(M(n)?Oe(e.info):(S(e.ref),y.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=y.get(e);if(t)return t.info;let n={attributeResolvers:[]};return ee(e,n),n}function Ee(e){return typeof e!=`object`||!e}function De(e){let t;try{t=e.resolver()}catch(t){s(`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){s(`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`){s(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:xe};if(!c){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 v){let r=n.deref();if(r===void 0){t.push(n);continue}let i=y.get(r);if(!i){t.push(n);continue}if(!M(r)){y.delete(r),t.push(n);continue}e&&!e.contains(r)||Oe(i.info)}for(let e of t)S(e)}function je(e,t){if(!(!e?.style||!t))for(let n in t)be(e,n,t[n])||s(`Failed to set style property '${n}'`)}function Me(e,t){e&&(a(t)?ke(e,`style`,t,function(t){je(e,t)}):je(e,t))}const Ne=new WeakMap;function Pe(e){if(e.length<=2||e.charCodeAt(0)!==111||e.charCodeAt(1)!==110)return null;let t=e.charCodeAt(2);return t<65||t>90?null:e===`onDoubleClick`?`ondblclick`:e.toLowerCase()}function Fe(e,t,n){if(t in e){e[t]=n;return}let r=t.slice(2),i=Ne.get(e);if(i){for(let t=0;t<i.length;t+=2){if(i[t]!==r)continue;let a=i[t+1];if(a===n)return;e.removeEventListener(r,a),e.addEventListener(r,n),i[t+1]=n;return}e.addEventListener(r,n),i.push(r,n);return}e.addEventListener(r,n),Ne.set(e,[r,n])}const N=new WeakMap,Ie=new WeakSet;function Le(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 Re(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function ze(e){if(e.className&&!N.has(e)){let t=new Set;Le(t,e.className),N.set(e,t)}Ie.add(e)}function Be(e){return Ie.has(e)}function Ve(e,t){if(!t)return;let n=N.get(e);n||(n=new Set,N.set(e,n)),Le(n,t)}function He(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=Re(n);return}let r=Re(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 Ue(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;Le(r,n),Le(r,t),e.className=Re(r)}else e.className=t}function We(e,t,n){if(typeof e!=`function`){s(`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){s(`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 c&&b(a,{resolver:e,lastValue:i,sanitize:n}),a}function Ge(e){let t=[];for(let n of g){let r=n.deref();if(r===void 0){t.push(n);continue}let i=_.get(r);if(!i){t.push(n);continue}let a=i.info;if(!M(r)){_.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){s(`Failed to update reactive text node`,e),o=void 0}let c=a.sanitize?o==null||typeof o==`object`||typeof o==`function`?``:String(o):o===void 0?``:String(o);c!==a.lastValue&&(r.textContent=c,a.lastValue=c)}for(let e of t)x(e)}function Ke(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){Ue(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 qe(e,t,n,r=!1){if(n==null)return;let i=t;if(i===`style`){Me(e,n);return}if(a(n)){if(i===`onClick`){e.onclick=n;return}if(i.charCodeAt(0)===111&&i.charCodeAt(1)===110){let t=Pe(i);if(t){Fe(e,t,n);return}if(i in e){e[i]=n;return}}if(n.length===0){let t=n;i===`className`&&e instanceof HTMLElement?(ze(e),ke(e,i,t,function(t){He(e,String(t||``))})):ke(e,i,t,function(t){Ke(e,i,t,!1)});return}}if(i===`className`&&e instanceof HTMLElement&&Be(e)){let t=String(n||``);t&&(Ve(e,t),Ue(e,t));return}Ke(e,i,n,r)}function P(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];qe(e,i,a,n&&i===`className`)}}let F=!1,Je=new WeakMap;function I(){return F}function Ye(){return!1}function Xe(){F=!0,Je=new WeakMap}function Ze(){F=!1}function Qe(e){let t=F;F=!1;try{return e()}finally{F=t}}function L(e){let t=Je.get(e);return t===void 0?e.firstChild:t}function R(e,t){Je.set(e,t)}function $e(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function z(e){let t=L(e),n=!1;for(;t&&$e(t);)t=t.nextSibling,n=!0;n&&R(e,t)}function B(e){let t=L(e);return t&&R(e,t.nextSibling),t}function et(e,t){if(!F)return null;z(e);let n=L(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?B(e):null}function tt(e,t){if(!t)return;let n=L(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}R(e,null)}const V=new WeakMap;function nt(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function rt(e){z(e);let t=L(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function it(e,t){let n=L(e);if(n&&n.nodeType===3)return B(e),n.textContent!==t&&(n.textContent=t),n;let r=k(t);return r?(e.insertBefore(r,n),R(e,n),r):null}function H(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=V.get(i);if(t||(t={value:i(),error:!1},V.set(i,t)),t.error)return ot(c,()=>``);let n=t.value;if(nt(n))return P(r,{className:()=>{let e=i();return nt(e)?e.className:``}}),null;if(e(n)){let e=i,t=n??``;if(I()&&rt(r)){let n=r;B(n);let i=String(t),a=it(n,i);return a&&b(a,{resolver:e,lastValue:i,sanitize:!0}),null}return ot(c,e,t,!0)}return null}catch(e){return V.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),ot(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?st(c,a):t(a)?a:(n(a)&&P(r,a),null)}let l=i;if(e(l)){if(I()&&rt(r)){let e=r;return B(e),it(e,String(l)),null}return st(c,l)}return t(l)?l:(P(r,l),null)}function at(e,t){if(c&&!I()&&!Ye())return t;let n=ce();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 ot(e,t,n,r){return at(e,We(t,n,r))}function st(e,t){return at(e,k(String(t)))}const ct=Symbol(`nuclo.factory.tag`),lt=Symbol(`nuclo.factory.mods`);let U=0;const ut=[];let dt=0;function ft(){return dt>=ut.length&&ut.push(()=>null),ut[dt++]}function pt(e,t,n){e[ct]=t,e[lt]=n}function W(e){return typeof e==`function`?e[lt]:void 0}function G(e){return typeof e==`function`?e[ct]:void 0}function mt(){return U>0}function ht(e,t,n){let r=U===0;U++,r&&(dt=0);try{return e(t,n)}finally{U--}}function K(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=H(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function gt(e,t){let n=oe(e);if(!n)throw Error(`Failed to create element: ${e}`);return K(n,t,0),n}function _t(e,t){let n=se(ae,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return K(n,t,0),n}function vt(e,t){if(mt()){let n=ft();return pt(n,e,t),n}let n=function(n,r=0){let i=n,a=i?et(i,e):null,o=a??oe(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return K(o,t,r),a&&tt(s,c),o};return pt(n,e,t),n}function yt(e,t){if(mt()){let n=ft();return pt(n,e,t),n}return function(n,r=0){let i=n,a=i?et(i,e):null,o=a??se(`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 K(o,t,r),a&&tt(s,c),o}}function bt(e){return(...t)=>vt(e,t)}function xt(e){return(...t)=>yt(e,t)}const St=`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(`.`),Ct=`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(`.`),wt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function Tt(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 Et(e,t){t in e&&typeof e[t]!=`function`||(Tt(e,t,()=>bt(t)),t===`var`&&Tt(e,`var_`,()=>bt(t)))}function Dt(e,t){let n=`${t}Svg`;n in e||Tt(e,n,()=>xt(t))}function Ot(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<Ct.length;t++)Dt(e,Ct[t]);for(let t=0;t<St.length;t++)Et(e,St[t]);e[t]=!0}}function q(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function kt(e,n){let r=[],i=0;for(let e=0;e<n.length;e++){let a=n[e];if(a==null){r.push({kind:4});continue}let o=typeof a;if(o===`function`){let e=W(a);if(e!==void 0){let t=G(a);if(!t)return null;let n=kt(t,e);if(!n)return null;r.push({kind:3,child:n});continue}if(a.length===0){let e;try{e=a(),V.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(t(a))return null;let e=a,n=Object.keys(e),o=[];for(let t=0;t<n.length;t++){let r=n[t],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`){let e=Pe(r);if(e){o.push({key:r,kind:1,prop:!1,value:e});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 At(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;At(i.child,r),r=r.nextSibling;break}}}function jt(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;let e=a.value;e===`onclick`?n.onclick=o:Fe(n,e,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||W(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=W(s);if(e===void 0||G(s)!==o.child.tag||!a||!jt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function Mt(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;w(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;C(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=W(s);if(e===void 0||G(s)!==o.child.tag||!a||!Mt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function Nt(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 Pt(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}const J=new Set,Ft=new WeakMap,It=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{J.delete(e)}):null;let Y=0;function Lt(e,t){let n=new WeakRef(e);J.add(n),Ft.set(e,t),It?.register(e,n)}function Rt(e){return Array.isArray(e)?e:Array.from(e)}function zt(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function Bt(e,t,n){let r=e.renderItem(t,n);return zt(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):q(r,e.host,n)}function Vt(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=c&&!I()&&!Ye(),a=r&&i?ht(e.renderItem,t,n):e.renderItem(t,n);if(zt(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=W(a);if(i!==void 0){if(r===void 0){let t=G(a),r=t?kt(t,i):null,o=q(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);At(r,t);let n=[];if(Mt(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 jt(r.tmpl,i,o,s)?(s.length>0&&(e.lastRenderLeaves=s),o):(e.template=null,Bt(e,t,n))}else if(r===void 0)e.template=null;else return e.template=null,Bt(e,t,n)}return q(a,e.host,n)}function X(e){A(e.element)}function Ht(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(c&&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 Ut(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 Wt(e,t,n,r,i,a,o){let s=ce(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Vt(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 Gt(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=Rt(e.itemsProvider());if(Pt(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!Ht(a,r,t,n))for(let e=0;e<o;e++)X(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)Wt(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];Wt(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++)X(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(!Ht(a,r,t,n))for(let e=0;e<o;e++)X(a[e]);let c=[];Wt(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]||X(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=Ut(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=Vt(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||=ce(),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 Kt(e,t,n,r){return I()?Jt(e,t,n,r):qt(e,t,n,r)}function qt(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),Gt(o),c&&Lt(i,o),o}function Jt(e,t,n,r){let i=n;z(i);let a=L(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return qt(e,t,n,r);let o=B(i),s=0,l=L(i);for(;l;){if(l.nodeType===8){let e=l.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}l=l.nextSibling}let u=l;if(!u){let e=j(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return qt(e,t,n,r);let d=Rt(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=zt(r)?r:null,a=i?i.element:q(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=L(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}R(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return c&&Lt(o,h),h}function Yt(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 Xt(e){let t=[];Y++;for(let n of J){let r=n.deref();if(!r){t.push(n);continue}let i=Ft.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){Yt(i),Ft.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=Y;try{Gt(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===Y)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===Y)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&Nt(n)}}for(let e of t)J.delete(e)}function Zt(e,t){return function(n,r){return Kt(e,t,n,r).startMarker}}function Qt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function $t(e,t){return typeof e==`function`?Qt(e,t):!!e}const en=new Set,tn=new WeakMap,nn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{en.delete(e)}):null;function rn(e,t){for(let t=0;t<e.length;t++)if($t(e[t].condition))return t;return t.length>0?-1:null}function an(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=rn(t,n);o!==e.activeIndex&&(me(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&he(ln(o>=0?t[o].content:n,r,i,a),a))}function on(e){let t=new WeakRef(e.startMarker);en.add(t),tn.set(e.startMarker,e),nn?.register(e.startMarker,t)}function sn(e){let t=[];for(let n of en){let r=n.deref();if(r===void 0){t.push(n);continue}let i=tn.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){tn.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch(e){s(`when() branch threw during update; unregistering this conditional`,e),tn.delete(r),t.push(n)}}for(let e of t)en.delete(e)}function cn(e,t,n,r){return a(e)?o(e)?(V.delete(e),H(t,e,n)):ye(t,r,()=>{let r=H(t,e,n);return r&&!r.parentNode?r:null}):H(t,e,n)}function ln(e,t,n,r){let i=[];for(let a of e){let e=cn(a,t,n,r);e&&i.push(e)}return i}function un(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function dn(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var fn=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?I()?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),an(i),n.textContent=un(t,i.activeIndex),n}hydrateRender(e,t){let n=e;z(n);let r=L(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=B(n),a=0,o=L(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=rn(this.groups,this.elseContent),u=dn(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)H(e,r,t)}}else if(me(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;Qe(()=>{he(ln(n,e,t,r),r)})}return R(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(){an(a)}};return c&&on(a),a}};function pn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return pn(e.cloneWith({condition:t,content:n}))},else:function(...t){return pn(e.cloneWith(void 0,t))}})}function mn(e,...t){return pn(new fn(e,...t))}function hn(e){try{return e.isSvg?_t(e.tagName,e.modifiers):gt(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=se(ae,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=oe(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function gn(e){let t=ie(e);if(!t)return;let n=Qt(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=hn(t);te(n,t),_e(e,n)}else if(!n&&r){let n=fe(t.tagName);n&&(te(n,t),_e(e,n))}}function _n(e){if(c)try{let t=re();for(let n of t){if(!n.isConnected){ne(n);continue}e&&!e.contains(n)||gn(n)}}catch(e){s(`Error during conditional elements update`,e)}}const vn=new Map;function yn(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 bn(e,t){let n=vn.get(e);n||(n=new Set,vn.set(e,n)),n.add(new WeakRef(t))}function xn(e){let t=yn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=vn.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&&vn.delete(e)}return Array.from(n)}function Sn(...e){let t=yn(e);return function(e){if(c&&e instanceof Element)for(let n of t)bn(n,e)}}const Cn=[Xt,sn,_n,Ae,Ge,Tn];function wn(...e){let t;if(e.length>0){let n=xn(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 Cn)e(t)}function Tn(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){s(`Error dispatching global update event`,e)}}function En(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function Dn(e,t){let n=t||document.body,r=n;Xe();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=L(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),A(e),R(r,t)}else r.appendChild(i),R(r,null)}return t}finally{Ze()}}function On(){return{ssrCollector:null,atomCache:new Map,atomMeta:new Map,rawKeys:new Set,baseRules:[],queryRules:new Map,styleEpoch:0,cssTextCache:null,sheet:null,sheetDocument:null,baseRuleCount:0,groupRules:new Map,externalRules:null,hasExternalGroups:!1}}const kn=Symbol.for(`nuclo.style.engine.v1`),An=globalThis,Z=An[kn]??(An[kn]=On());function jn(e){Z.ssrCollector=e}function Mn(e){for(let t of e)Z.queryRules.has(t)||Z.queryRules.set(t,[])}function Nn(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return Z.groupRules.set(t,r),Z.groupRules.set(Q(r),r),r}catch{return null}}function Q(e){let t=e.cssText,n=t.indexOf(`{`);return(n===-1?t:t.slice(0,n)).trim()}function Pn(e){return e instanceof CSSStyleRule?e.selectorText:Q(e)}function Fn(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function In(e,t){if(!Z.externalRules)return;let n=Fn(t,Pn(e)),r=Z.externalRules.get(n);r||(r=new Set,Z.externalRules.set(n,r)),r.add(e.cssText)}function Ln(e,t){if(!Z.externalRules)return!1;let n=Fn(t,Pn(e)),r=Z.externalRules.get(n);return r?.delete(e.cssText)?(r.size===0&&Z.externalRules.delete(n),Z.externalRules.size===0&&(Z.externalRules=null),!0):!1}function Rn(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof CSSStyleRule){In(n,void 0);continue}let r=Q(n);if(`cssRules`in n&&!r.startsWith(`@keyframes`)){let e=n;Z.hasExternalGroups=!0,Z.groupRules.set(r,e);for(let t=0;t<e.cssRules.length;t++)In(e.cssRules[t],r)}else In(n,void 0)}}function zn(e,t){try{e.insertRule(t,Z.baseRuleCount);let n=e.cssRules[Z.baseRuleCount];if(Ln(n,void 0)){e.deleteRule(Z.baseRuleCount);return}Z.baseRuleCount++}catch{}}function Bn(e,t){try{let n=e.cssRules.length;e.insertRule(t,n);let r=e.cssRules[n];Ln(r,Q(e))&&e.deleteRule(n)}catch{}}function Vn(e,t){let n=Z.groupRules.get(t);if(n)return n;if(!Z.hasExternalGroups)return Nn(e,t);try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=Q(e.cssRules[n]);e.deleteRule(n);let i=Z.groupRules.get(r);if(i)return Z.groupRules.set(t,i),i}catch{return null}return Nn(e,t)}function Hn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Z.sheet&&Z.sheetDocument===document&&Z.sheet.ownerNode&&Z.sheet.ownerNode.isConnected)return Z.sheet;let e=document.getElementById(`nuclo-styles`),t;if(e?.tagName===`STYLE`?t=e:(t=document.createElement(`style`),t.id=`nuclo-styles`,e?e.replaceWith(t):document.head.appendChild(t)),Z.sheet=t.sheet,Z.sheetDocument=document,Z.groupRules.clear(),Z.baseRuleCount=0,Z.externalRules=null,Z.hasExternalGroups=!1,!Z.sheet)return null;if(Z.sheet.cssRules.length>0){let e=0;for(;e<Z.sheet.cssRules.length;){let t=Z.sheet.cssRules[e];if(!(t instanceof CSSStyleRule)&&`cssRules`in t&&!Q(t).startsWith(`@keyframes`))break;e++}Z.baseRuleCount=e,Z.externalRules=new Map,Rn(Z.sheet.cssRules)}for(let e of Z.baseRules)zn(Z.sheet,e);for(let[e,t]of Z.queryRules){let n=Vn(Z.sheet,e);if(n)for(let e of t)Bn(n,e)}return Z.sheet}function Un(e,t){let n=Hn();if(t===void 0)Z.baseRules.push(e);else{let n=Z.queryRules.get(t);n||(n=[],Z.queryRules.set(t,n)),n.push(e)}if(Z.cssTextCache=null,n)if(t===void 0)zn(n,e);else{let r=Vn(n,t);r&&Bn(r,e)}Z.ssrCollector?.(t===void 0?e:t+`{`+e+`}`)}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 Gn(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function Kn(e,t){return e+t.length+`:`+t}function qn(e,t){let n=``,r=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===92&&i+1<e.length){n+=e[i]+e[++i];continue}if(r!==0){n+=e[i],a===r&&(r=0);continue}a===34||a===39?(r=a,n+=e[i]):n+=a===38?t:e[i]}return n}function Jn(e,t){let n=`.`+e;return n+qn(t,n)}function Yn(e){if(e.length===0||e===`-`)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n===45||n===95||t>0&&n>=48&&n<=57))return!1}if(e.charCodeAt(0)===45&&e.length>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return!1}return!0}function Xn(e,t,n,r,i=!1){let a=``,o=Gn(e,t);for(let[e,t]of n)a+=(a?`;`:``)+e+`:`+t,o=Kn(Kn(o,e),t);r!==void 0&&!Yn(r)&&(console.warn(`[nuclo] css() name ${JSON.stringify(r)} is not a valid CSS class name (letters, digits, - and _ only, not starting with a digit); falling back to a generated name.`),r=void 0);let s=r===void 0?`a`+o:`n`+Kn(``,r)+o,c=Z.atomCache.get(s);return c===void 0?(r===void 0?c=`n`+Wn(s):(c=i?r:r+`-`+Wn(s),Z.atomMeta.has(c)&&console.warn(`[nuclo] css() name ${JSON.stringify(c)} is already used by a different style. Both rules are emitted under the same class, so they will override each other — rename one.`)),Z.atomCache.set(s,c),Z.atomMeta.set(c,{query:e,suffix:t,decls:n,name:r}),Un(Jn(c,t)+`{`+a+`}`,e),c):(Hn(),c)}function Zn(e,t,n,r,i=!1){return Xn(e,t,n,r,i)}function Qn(e,t){let n=Z.atomMeta.get(e),r=Z.atomMeta.get(t);if(!n||!r)return t;let i=[...n.decls,...r.decls],a=new Map;for(let e=0;e<i.length;e++)a.set(i[e][0],e);let o=i.filter((e,t)=>a.get(e[0])===t);return Xn(n.query,n.suffix,o,n.name??r.name)}function $n(e){let t=Z.atomMeta.get(e);return t===void 0?void 0:Gn(t.query,t.suffix)}function er(){return Z.styleEpoch}function tr(e,t){if(Z.rawKeys.has(e)){Hn();return}Z.rawKeys.add(e),Un(t,void 0)}function nr(){if(Z.cssTextCache!==null)return Z.cssTextCache;let e=Z.baseRules.join(``);for(let[t,n]of Z.queryRules)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return Z.cssTextCache=e,e}function rr(){Z.atomCache.clear(),Z.atomMeta.clear(),Z.rawKeys.clear(),Z.baseRules.length=0,Z.queryRules.clear(),Z.groupRules.clear(),Z.cssTextCache=null,Z.baseRuleCount=0,Z.sheet=null,Z.sheetDocument=null,Z.externalRules=null,Z.hasExternalGroups=!1,Z.styleEpoch++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const ir={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`},ar={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`]},or={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`}},sr={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`},cr=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`]),lr=new Map;function ur(e){let t=lr.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),lr.set(e,t)),t}function dr(e){return e.charCodeAt(0)===64?e:`@media `+e}function fr(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function pr(e,t){for(let n in t){let r=t[n],i=e[n];typeof r==`object`&&r&&!Array.isArray(r)&&typeof i==`object`&&i&&!Array.isArray(i)?e[n]=pr({...i},r):e[n]=r}return e}function mr(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function hr(e,t){let n=$n(t);if(n===void 0){e.set(t,t);return}let r=e.get(n);r===void 0||r===t?e.set(n,t):e.set(n,Qn(r,t))}function gr(e,t){let n=0;for(let r=0;r<=e.length;r++){let i=r===e.length?32:e.charCodeAt(r);(i===32||i===9||i===10||i===12||i===13)&&(r>n&&hr(t,e.slice(n,r)),n=r+1)}}function _r(e,t){for(let n of e)n&&(typeof n==`string`?gr(n,t):Array.isArray(n)?_r(n,t):gr(n.className,t))}function vr(...e){let t=new Map;_r(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return mr(n)}function yr(e={}){let t=e.screens??{};Mn(Object.values(t).map(dr));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||cr.has(t)?String(n):n+`px`;let r=sr[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,t,n){let r=(t===void 0?`-`:`+`+t.length+`:`+t)+n.length+`:`+n,i=e.get(r);return i||(i={query:t,suffix:n,decls:[]},e.set(r,i)),i}function a(e,n,o,s){for(let c in e){let l=e[c];if(l==null||l===!1)continue;if(typeof l==`object`){if(c===`raw`){let e=l,t=i(s,n,o).decls;for(let n in e)t.push([n,r(n,e[n])]);continue}let e=ir[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,fr(n,dr(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,qn(c,`&`+o).slice(1),s);continue}if(d===64){a(l,fr(n,c),o,s);continue}continue}if(l===!0){let e=or[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=ar[c];if(u!==void 0){let e=i(s,n,o).decls;for(let t of u)e.push([t,r(t,l)])}else{let e=ur(c);i(s,n,o).decls.push([e,r(e,l)])}}}function o(e,t){let r=typeof e==`string`,i=r?t:e,o=r?e:void 0;if(i==null)return mr(``);let s=er(),c=n.get(i);if(c!==void 0&&c.epoch===s&&c.name===o)return c.result;let l=new Map;a(i,void 0,``,l);let u=[];for(let e of l.values()){if(e.decls.length===0)continue;let t=e.query===void 0&&e.suffix===``;u.push(Zn(e.query,e.suffix,e.decls,o,t))}let d=mr(u.join(` `));return n.set(i,{epoch:s,name:o,result:d}),d}function s(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=or[t];if(e)for(let t in e)n(t,e[t]);continue}let a=ar[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=ur(t);n(e,r(e,i))}}return t}function c(e){let t=``;for(let n in e)t+=n+`{`+s(e[n])+`}`;let n=`nk`+Wn(t);return tr(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;tr(`g|`+n,n)}function u(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},a=e.base??null,s=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,style:n}}),c=new Map;return function(e){let l={};for(let n of r){let r=(e?e[n]:void 0)??i[n];r!=null&&(l[n]=t(r))}let u=``;for(let e of r){let t=l[e];u+=e.length+`:`+e,u+=t===void 0?`-`:`+`+t.length+`:`+t}let d=c.get(u);if(d)return d;let f={};a&&(f=pr(f,a));for(let e of r){let t=l[e];if(t!==void 0){let r=n[e][t];r&&(f=pr(f,r))}}for(let e of s){let t=!0;for(let n in e.conditions)if(l[n]!==e.conditions[n]){t=!1;break}t&&(f=pr(f,e.style))}let p=o(f);return c.set(u,p),p}}return{css:o,cx:vr,variants:u,keyframes:c,globalStyle:l,theme:e}}let br;function $(){return br??=yr({})}const xr=(e,t)=>typeof e==`string`?$().css(e,t):$().css(e),Sr=e=>$().variants(e),Cr=e=>$().keyframes(e),wr=(e,t)=>$().globalStyle(e,t);function Tr(){Ot();let e=globalThis;e.list=Zt,e.update=wn,e.when=mn,e.on=h,e.scope=Sn,e.render=En,e.hydrate=Dn,e.createCss=yr,e.css=xr,e.cx=vr,e.variants=Sr,e.keyframes=Cr,e.globalStyle=wr}Tr(),exports.HTML_TAGS=St,exports.SELF_CLOSING_TAGS=wt,exports.SVG_TAGS=Ct,exports.appendChildren=ge,exports.applyAttributes=P,exports.applyNodeModifier=H,exports.createComment=j,exports.createConditionalComment=fe,exports.createCss=yr,exports.createHtmlElementWithModifiers=gt,exports.createHtmlTagBuilder=bt,exports.createSvgElementWithModifiers=_t,exports.createSvgTagBuilder=xt,exports.css=xr,exports.cx=vr,exports.getCssText=nr,exports.globalStyle=wr,exports.hydrate=Dn,exports.initializeRuntime=Tr,exports.isBoolean=i,exports.isBrowser=c,exports.isFunction=a,exports.isNode=t,exports.isObject=n,exports.isPrimitive=e,exports.isTagLike=r,exports.isZeroArityFunction=o,exports.keyframes=Cr,exports.list=Zt,exports.on=h,exports.registerGlobalTagBuilders=Ot,exports.render=En,exports.replaceNodeSafely=_e,exports.resetStyles=rr,exports.scope=Sn,exports.setSSRCollector=jn,exports.update=wn,exports.variants=Sr,exports.when=mn;
|
|
2
2
|
//# sourceMappingURL=nuclo.cjs.map
|