nuclo 0.2.21 → 0.2.22

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.
@@ -0,0 +1,2 @@
1
+ const e=typeof window<`u`&&typeof document<`u`;var t=class{nodeType=1;nodeName=``;nodeValue=null;parentNode=null;_childNodes=null;textContent=``;get childNodes(){let e=this._childNodes??[];return{...e,length:e.length,item:t=>e[t]||null,[Symbol.iterator]:function*(){for(let t of e)yield t},forEach:t=>{for(let n=0;n<e.length;n++)t(e[n],n,this.childNodes)},entries:function*(){for(let t=0;t<e.length;t++)yield[t,e[t]]},keys:function*(){for(let t=0;t<e.length;t++)yield t},values:function*(){for(let t of e)yield t}}}},n=class{get cssText(){let e=Object.entries(this);return e.length===0?``:e.map(([e,t])=>`${e}: ${t}`).join(`; `)}setProperty(e,t){this[e]=t}getPropertyValue(e){return this[e]||``}},r=class{_el;constructor(e){this._el=e}add(...e){let t=this._el.className?this._el.className.split(` `).filter(Boolean):[];for(let n of e)n&&!t.includes(n)&&t.push(n);this._el.className=t.join(` `)}remove(...e){this._el.className&&(this._el.className=this._el.className.split(` `).filter(t=>t&&!e.includes(t)).join(` `))}contains(e){return!!this._el.className&&this._el.className.split(` `).includes(e)}toggle(e,t){let n=this.contains(e);return t===void 0?n?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){return this.contains(e)?(this.remove(e),this.add(t),!0):!1}item(e){return this._el.className.split(` `).filter(Boolean)[e]??null}get length(){return this._el.className?this._el.className.split(` `).filter(Boolean).length:0}get value(){return this._el.className}set value(e){this._el.className=e}toString(){return this._el.className}supports(e){return!1}forEach(e){let t=this._el.className.split(` `).filter(Boolean);for(let n=0;n<t.length;n++)e(t[n],n,this)}[Symbol.iterator](){let e=this._el.className.split(` `).filter(Boolean),t=0;return{next(){return t<e.length?{value:e[t++],done:!1}:{value:``,done:!0}}}}entries(){let e=this._el.className.split(` `).filter(Boolean),t=0;return{next(){return t<e.length?{value:[t,e[t++]],done:!1}:{value:[0,``],done:!0}}}}keys(){let e=this.length,t=0;return{next(){return t<e?{value:t++,done:!1}:{value:0,done:!0}}}}values(){return this[Symbol.iterator]()}};function i(e){return typeof e==`object`&&!!e&&`tagName`in e}function a(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===3}function o(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===8}var s=class extends t{tagName;children;className=``;textContent=``;_innerHTML=``;parentNode=null;rawMods;mods;id=``;namespaceURI;sheet;_listeners;_style;_classList;_attributes;get attributes(){return this._attributes??=new Map}set attributes(e){this._attributes=e}get style(){return this._style??=new n}set style(e){this._style=e}get classList(){return this._classList??=new r(this)}set classList(e){this._classList=e}get innerHTML(){return this.serializeChildren()}set innerHTML(e){this._innerHTML=e}serializeChildren(){let e=``;for(let t of this.children)i(t)?e+=this.serializeElement(t):a(t)?e+=t.textContent||``:o(t)&&(e+=`<!--${t.data||``}-->`);return e}serializeElement(e){let t=e.tagName.toLowerCase(),n=`<${t}`;if(e.id&&(n+=` id="${e.id}"`),e.className&&(n+=` class="${e.className}"`),e._attributes)for(let[t,r]of e._attributes)t!==`id`&&t!==`class`&&(n+=` ${t}="${r}"`);if(n+=`>`,e.children&&e.children.length>0)for(let t of e.children)i(t)?n+=this.serializeElement(t):a(t)?n+=t.textContent||``:o(t)&&(n+=`<!--${t.data||``}-->`);return n+=`</${t}>`,n}constructor(t){if(super(),this.tagName=t.toLowerCase(),this.nodeType=1,this.nodeName=t.toUpperCase(),this.children=[],!e)this._listeners=null;else{this._listeners=new Map;let e={};if(this.style=new Proxy({},{get:(t,n)=>n===`setProperty`?(t,n)=>{e[t]=n}:n===`getPropertyValue`?t=>e[t]||``:n===`cssText`?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `):e[n],set:(t,n,r)=>(e[n]=r,!0)}),this.tagName===`style`){let e=[];this.sheet={cssRules:e,insertRule:(t,n)=>{let r=n??e.length,i;if(t.trim().startsWith(`@`)){let e=[],n=t.replace(/^@\w+\s+/,``).replace(/\s*\{[\s\S]*\}$/,``).trim();i={cssText:t,conditionText:n,media:{mediaText:n},cssRules:e,insertRule:(t,n)=>{let r=n??e.length;return e.splice(r,0,{cssText:t,selectorText:t.split(`{`)[0].trim(),style:{},type:1}),r},deleteRule:t=>{e.splice(t,1)},type:4}}else i={cssText:t,selectorText:t.split(`{`)[0].trim(),style:{},type:1};return e.splice(r,0,i),r},deleteRule:t=>{e.splice(t,1)}}}this.classList=c(this)}}appendChild(t){if(t?.nodeType===11){let e=t.childNodes;t.childNodes=[],t.children&&=[];for(let t=0;t<e.length;t++)this.appendChild(e[t]);return t}return this.children.push(t),e&&this._childNodes&&this._childNodes.push(t),typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this),t}setAttribute(e,t){(this._attributes??=new Map).set(e,t),e===`class`?this.className=t:e===`id`&&(this.id=t)}getAttribute(e){return this._attributes?.get(e)??null}removeAttribute(e){this._attributes?.delete(e),e===`class`&&(this.className=``)}hasAttribute(e){return this._attributes?.has(e)??!1}insertBefore(t,n){if(n===null)return this.appendChild(t);if(t?.nodeType===11){let e=t.childNodes;t.childNodes=[],t.children&&=[];for(let t=0;t<e.length;t++)this.insertBefore(e[t],n);return t}let r=this.children.indexOf(n);if(r!==-1){if(this.children.splice(r,0,t),e&&this._childNodes){let e=this._childNodes.indexOf(n);e!==-1&&this._childNodes.splice(e,0,t)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this)}return t}removeChild(t){let n=this.children.indexOf(t);if(n!==-1){if(this.children.splice(n,1),e&&this._childNodes){let e=this._childNodes.indexOf(t);e!==-1&&this._childNodes.splice(e,1)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=null)}return t}replaceChild(t,n){let r=this.children.indexOf(n);if(r!==-1){if(this.children[r]=t,e&&this._childNodes){let e=this._childNodes.indexOf(n);e!==-1&&(this._childNodes[e]=t)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this),typeof n==`object`&&n&&`parentNode`in n&&(n.parentNode=null)}return n}addEventListener(e,t){this._listeners&&(this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t))}removeEventListener(e,t){let n=this._listeners?.get(e);n&&n.delete(t)}dispatchEvent(e){let t=this._listeners?.get(e.type);if(t)for(let n of t)try{n(e)}catch(e){console.error(`Error in event listener:`,e)}return e.bubbles&&this.parentNode&&typeof this.parentNode==`object`&&`dispatchEvent`in this.parentNode&&typeof this.parentNode.dispatchEvent==`function`&&this.parentNode.dispatchEvent(e),!0}querySelector(e){if(e.startsWith(`#`)){let t=e.slice(1);return this.querySelectorById(t)}if(e.startsWith(`.`)){let t=e.slice(1);return this.querySelectorByClass(t)}return this.querySelectorByTag(e)}querySelectorById(e){if(this.id===e)return this;for(let t of this.children)if(i(t)){if(t.id===e)return t;let n=t.querySelector(`#${e}`);if(n)return n}return null}querySelectorByClass(e){if(this.classList.contains(e))return this;for(let t of this.children)if(i(t)){if(t.classList?.contains(e))return t;let n=t.querySelector(`.${e}`);if(n)return n}return null}querySelectorByTag(e){let t=e.toLowerCase();if(this.tagName.toLowerCase()===t)return this;for(let n of this.children)if(i(n)){if(n.tagName.toLowerCase()===t)return n;let r=n.querySelector(e);if(r)return r}return null}querySelectorAll(e){let t=[];if(e.startsWith(`#`)){let n=this.querySelector(e);n&&t.push(n)}else if(e.startsWith(`.`)){let n=e.slice(1);this.querySelectorAllByClass(n,t)}else{let n=e.toLowerCase();this.querySelectorAllByTag(n,t)}return t}querySelectorAllByClass(e,t){this.classList.contains(e)&&t.push(this);for(let n of this.children)i(n)&&n.querySelectorAllByClass(e,t)}querySelectorAllByTag(e,t){this.tagName.toLowerCase()===e&&t.push(this);for(let n of this.children)i(n)&&n.querySelectorAllByTag(e,t)}};function c(e){let t=()=>e.className.split(` `).filter(e=>e),n=t=>{e.className=t.join(` `)},r={add:(...e)=>{let r=t();for(let t of e)t&&!r.includes(t)&&r.push(t);n(r)},remove:(...e)=>{e.length!==0&&n(t().filter(t=>!e.includes(t)))},toggle:(e,t)=>{let n=r.contains(e);return t===void 0?n?(r.remove(e),!1):(r.add(e),!0):t?(r.add(e),!0):(r.remove(e),!1)},contains:e=>t().includes(e),replace:(e,r)=>{let i=t(),a=i.indexOf(e);return a!==-1&&(i[a]=r,n(i),!0)},item:e=>t()[e]||null,get length(){return t().length},toString:()=>e.className,[Symbol.iterator]:function*(){yield*t()},forEach:e=>{let n=t();for(let t=0;t<n.length;t++)e(n[t],t,r)},entries:function*(){let e=t();for(let t=0;t<e.length;t++)yield[t,e[t]]},keys:function*(){let e=t();for(let t=0;t<e.length;t++)yield t},values:function*(){yield*t()},get value(){return e.className},set value(t){e.className=t},supports:e=>!1};return r}export{t as n,s as t};
2
+ //# sourceMappingURL=Element-C3mU75-a.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Element-C3mU75-a.mjs","names":[],"sources":["../src/shared/environment.ts","../src/polyfill/Node.ts","../src/polyfill/Element.ts"],"sourcesContent":["/**\n * Simplified environment detection - minimal overhead for smaller bundle size\n */\n\n// Basic environment detection - no complex caching or edge cases\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n","/**\n * Base Node class for instanceof checks in Node.js polyfill\n */\nexport class NucloNode {\n nodeType: number = 1; // ELEMENT_NODE\n nodeName: string = '';\n nodeValue: string | null = null;\n parentNode: unknown = null;\n _childNodes: Node[] | null = null;\n textContent: string = '';\n\n get childNodes(): NodeListOf<ChildNode> {\n const nodes = this._childNodes ?? [];\n return {\n ...nodes,\n length: nodes.length,\n item: (index: number) => (nodes[index] as ChildNode) || null,\n [Symbol.iterator]: function* () {\n for (const node of nodes) {\n yield node as ChildNode;\n }\n },\n forEach: (callback: (value: ChildNode, key: number, parent: NodeListOf<ChildNode>) => void) => {\n for (let i = 0; i < nodes.length; i++) {\n callback(nodes[i] as ChildNode, i, this.childNodes);\n }\n },\n entries: function* () {\n for (let i = 0; i < nodes.length; i++) {\n yield [i, nodes[i] as ChildNode] as [number, ChildNode];\n }\n },\n keys: function* () {\n for (let i = 0; i < nodes.length; i++) {\n yield i;\n }\n },\n values: function* () {\n for (const node of nodes) {\n yield node as ChildNode;\n }\n }\n } as unknown as NodeListOf<ChildNode>;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { NucloNode } from './Node';\nimport { isBrowser } from '../shared/environment';\n\n/**\n * Lightweight style object for SSR — prototype methods instead of Object.defineProperty per element.\n * Stores CSS properties as own properties and provides cssText/setProperty/getPropertyValue via prototype.\n */\nclass SSRStyle {\n [key: string]: unknown;\n\n get cssText(): string {\n const entries = Object.entries(this);\n if (entries.length === 0) return '';\n return entries.map(([k, v]) => `${k}: ${v}`).join('; ');\n }\n\n setProperty(name: string, value: string): void {\n (this as Record<string, unknown>)[name] = value;\n }\n\n getPropertyValue(name: string): string {\n return ((this as Record<string, unknown>)[name] as string) || '';\n }\n}\n\n// Lightweight classList for SSR — prototype methods instead of per-element closures\nclass SSRClassList {\n private _el: NucloElement;\n constructor(el: NucloElement) { this._el = el; }\n\n add(...tokens: string[]): void {\n const classes = this._el.className ? this._el.className.split(' ').filter(Boolean) : [];\n for (const t of tokens) if (t && !classes.includes(t)) classes.push(t);\n this._el.className = classes.join(' ');\n }\n remove(...tokens: string[]): void {\n if (!this._el.className) return;\n this._el.className = this._el.className.split(' ').filter(c => c && !tokens.includes(c)).join(' ');\n }\n contains(token: string): boolean {\n return !!this._el.className && this._el.className.split(' ').includes(token);\n }\n toggle(token: string, force?: boolean): boolean {\n const has = this.contains(token);\n if (force === undefined) { if (has) { this.remove(token); return false; } this.add(token); return true; }\n if (force) { this.add(token); return true; }\n this.remove(token); return false;\n }\n replace(oldToken: string, newToken: string): boolean {\n if (!this.contains(oldToken)) return false;\n this.remove(oldToken); this.add(newToken); return true;\n }\n item(index: number): string | null { return (this._el.className.split(' ').filter(Boolean)[index]) ?? null; }\n get length(): number { return this._el.className ? this._el.className.split(' ').filter(Boolean).length : 0; }\n get value(): string { return this._el.className; }\n set value(v: string) { this._el.className = v; }\n toString(): string { return this._el.className; }\n supports(_token: string): boolean { return false; }\n forEach(cb: (value: string, key: number, parent: DOMTokenList) => void): void {\n const classes = this._el.className.split(' ').filter(Boolean);\n for (let i = 0; i < classes.length; i++) cb(classes[i], i, this as unknown as DOMTokenList);\n }\n [Symbol.iterator](): Iterator<string> {\n const classes = this._el.className.split(' ').filter(Boolean);\n let i = 0;\n return { next(): IteratorResult<string> { return i < classes.length ? { value: classes[i++], done: false } : { value: '', done: true }; } };\n }\n entries(): Iterator<[number, string]> {\n const classes = this._el.className.split(' ').filter(Boolean);\n let i = 0;\n return { next(): IteratorResult<[number, string]> { return i < classes.length ? { value: [i, classes[i++]], done: false } : { value: [0, ''], done: true }; } };\n }\n keys(): Iterator<number> {\n const len = this.length; let i = 0;\n return { next(): IteratorResult<number> { return i < len ? { value: i++, done: false } : { value: 0, done: true }; } };\n }\n values(): Iterator<string> { return this[Symbol.iterator](); }\n}\n\ninterface TextNode {\n nodeType: 3;\n textContent: string;\n}\n\ninterface CommentNode {\n nodeType: 8;\n data: string;\n}\n\nfunction isElementNode(node: unknown): node is NucloElement {\n return typeof node === 'object' && node !== null && 'tagName' in node;\n}\n\nfunction isTextNode(node: unknown): node is TextNode {\n return typeof node === 'object' && node !== null && 'nodeType' in node && (node as { nodeType: number }).nodeType === 3;\n}\n\nfunction isCommentNode(node: unknown): node is CommentNode {\n return typeof node === 'object' && node !== null && 'nodeType' in node && (node as { nodeType: number }).nodeType === 8;\n}\n\nexport class NucloElement extends NucloNode {\n tagName: string;\n children: unknown[];\n className: string = '';\n textContent: string = '';\n private _innerHTML: string = '';\n parentNode: unknown = null;\n rawMods?: unknown[];\n mods?: unknown[];\n id: string = '';\n namespaceURI?: string;\n sheet?: CSSStyleSheet | null;\n private _listeners: Map<string, Set<EventListener>> | null;\n\n // style/classList are allocated lazily: the vast majority of SSR elements\n // never touch either (className is stored on the .className string, and the\n // serializer reads the backing field directly), so eagerly constructing an\n // SSRStyle + SSRClassList per element was pure allocation churn. The browser\n // path assigns these in the constructor, so its getter never lazy-allocates.\n private _style?: CSSStyleDeclaration;\n private _classList?: DOMTokenList;\n\n // attributes is allocated lazily too — most elements carry their identity on\n // .className/.id (separate string fields) and never call setAttribute. Reads\n // short-circuit on the undefined backing map without allocating; the\n // serializer reads _attributes directly. The public getter still lazily\n // materializes a Map for any external `el.attributes` consumer.\n private _attributes?: Map<string, string>;\n\n get attributes(): Map<string, string> {\n return (this._attributes ??= new Map<string, string>());\n }\n set attributes(value: Map<string, string>) {\n this._attributes = value;\n }\n\n get style(): CSSStyleDeclaration {\n return (this._style ??= new SSRStyle() as unknown as CSSStyleDeclaration);\n }\n set style(value: CSSStyleDeclaration) {\n this._style = value;\n }\n\n get classList(): DOMTokenList {\n return (this._classList ??= new SSRClassList(this) as unknown as DOMTokenList);\n }\n set classList(value: DOMTokenList) {\n this._classList = value;\n }\n\n get innerHTML(): string {\n return this.serializeChildren();\n }\n\n set innerHTML(value: string) {\n this._innerHTML = value;\n }\n \n private serializeChildren(): string {\n let html = '';\n for (const child of this.children) {\n if (isElementNode(child)) {\n html += this.serializeElement(child);\n } else if (isTextNode(child)) {\n html += child.textContent || '';\n } else if (isCommentNode(child)) {\n html += `<!--${child.data || ''}-->`;\n }\n }\n return html;\n }\n \n private serializeElement(element: NucloElement): string {\n const tag = element.tagName.toLowerCase();\n let html = `<${tag}`;\n \n // Add attributes\n if (element.id) {\n html += ` id=\"${element.id}\"`;\n }\n if (element.className) {\n html += ` class=\"${element.className}\"`;\n }\n if (element._attributes) {\n for (const [name, value] of element._attributes) {\n if (name !== 'id' && name !== 'class') {\n html += ` ${name}=\"${value}\"`;\n }\n }\n }\n \n html += '>';\n \n // Add children\n if (element.children && element.children.length > 0) {\n for (const child of element.children) {\n if (isElementNode(child)) {\n html += this.serializeElement(child);\n } else if (isTextNode(child)) {\n html += child.textContent || '';\n } else if (isCommentNode(child)) {\n html += `<!--${child.data || ''}-->`;\n }\n }\n }\n \n html += `</${tag}>`;\n return html;\n }\n \n constructor(tagName: string) {\n super();\n this.tagName = tagName.toLowerCase();\n this.nodeType = 1; // ELEMENT_NODE\n this.nodeName = tagName.toUpperCase();\n this.children = [];\n\n if (!isBrowser) {\n // ── SSR path: minimal allocations, no Proxy, no event listeners ──\n // style and classList stay unallocated until first access (see getters).\n this._listeners = null;\n } else {\n // ── Browser path: full-featured Proxy style + DOMTokenList ──\n this._listeners = new Map();\n\n const styleProps: Record<string, string> = {};\n this.style = new Proxy({} as CSSStyleDeclaration, {\n get: (_target, prop: string) => {\n if (prop === 'setProperty') return (name: string, value: string) => { styleProps[name] = value; };\n if (prop === 'getPropertyValue') return (name: string) => styleProps[name] || '';\n if (prop === 'cssText') return Object.entries(styleProps).map(([k, v]) => `${k}: ${v}`).join('; ');\n return styleProps[prop];\n },\n set: (_target, prop: string, value: string) => { styleProps[prop] = value; return true; },\n });\n\n // CSSStyleSheet mock for style elements (browser only)\n if (this.tagName === 'style') {\n const cssRules: CSSRule[] = [];\n this.sheet = {\n cssRules: cssRules as unknown as CSSRuleList,\n insertRule: (rule: string, index?: number) => {\n const idx = index ?? cssRules.length;\n let mockRule: CSSRule;\n if (rule.trim().startsWith('@')) {\n const innerRules: CSSRule[] = [];\n const conditionText = rule.replace(/^@\\w+\\s+/, '').replace(/\\s*\\{[\\s\\S]*\\}$/, '').trim();\n mockRule = {\n cssText: rule, conditionText,\n media: { mediaText: conditionText } as MediaList,\n cssRules: innerRules as unknown as CSSRuleList,\n insertRule: (innerRule: string, innerIndex?: number) => {\n const innerIdx = innerIndex ?? innerRules.length;\n innerRules.splice(innerIdx, 0, { cssText: innerRule, selectorText: innerRule.split('{')[0].trim(), style: {} as CSSStyleDeclaration, type: 1 } as unknown as CSSRule);\n return innerIdx;\n },\n deleteRule: (i: number) => { innerRules.splice(i, 1); },\n type: 4,\n } as unknown as CSSRule;\n } else {\n mockRule = { cssText: rule, selectorText: rule.split('{')[0].trim(), style: {} as CSSStyleDeclaration, type: 1 } as unknown as CSSRule;\n }\n cssRules.splice(idx, 0, mockRule);\n return idx;\n },\n deleteRule: (index: number) => { cssRules.splice(index, 1); },\n } as unknown as CSSStyleSheet;\n }\n\n this.classList = createClassList(this);\n }\n }\n \n appendChild<T extends Node>(child: T): T {\n // Spec behaviour: appending a DocumentFragment moves its children into this\n // node and leaves the fragment empty. The list runtime relies on this to\n // batch row insertions.\n if ((child as any)?.nodeType === 11) {\n // Detach the fragment's backing array before iterating (instead of\n // slicing it) — the fragment is emptied either way, and reassigning\n // first means the loop never has to allocate a copy just to guard\n // against the array it's about to discard.\n const kids = (child as any).childNodes as Node[];\n (child as any).childNodes = [];\n if ((child as any).children) (child as any).children = [];\n for (let i = 0; i < kids.length; i++) this.appendChild(kids[i]);\n return child;\n }\n this.children.push(child);\n if (isBrowser && (this as any)['_childNodes']) {\n (this as any)['_childNodes'].push(child);\n }\n if (typeof child === 'object' && child !== null && 'parentNode' in child) {\n (child as { parentNode: unknown }).parentNode = this;\n }\n return child;\n }\n \n setAttribute(name: string, value: string): void {\n (this._attributes ??= new Map<string, string>()).set(name, value);\n if (name === 'class') {\n this.className = value;\n } else if (name === 'id') {\n this.id = value;\n }\n }\n\n getAttribute(name: string): string | null {\n return this._attributes?.get(name) ?? null;\n }\n\n removeAttribute(name: string): void {\n this._attributes?.delete(name);\n if (name === 'class') {\n this.className = '';\n }\n }\n\n hasAttribute(name: string): boolean {\n return this._attributes?.has(name) ?? false;\n }\n \n insertBefore<T extends Node>(newNode: T, referenceNode: Node | null): T {\n if (referenceNode === null) {\n return this.appendChild(newNode);\n }\n // Spec behaviour: inserting a DocumentFragment moves its children (in order)\n // before the reference node and empties the fragment.\n if ((newNode as any)?.nodeType === 11) {\n const kids = (newNode as any).childNodes as Node[];\n (newNode as any).childNodes = [];\n if ((newNode as any).children) (newNode as any).children = [];\n for (let i = 0; i < kids.length; i++) this.insertBefore(kids[i], referenceNode);\n return newNode;\n }\n const index = this.children.indexOf(referenceNode);\n if (index !== -1) {\n this.children.splice(index, 0, newNode);\n if (isBrowser && (this as any)['_childNodes']) {\n const childNodesIndex = (this as any)['_childNodes'].indexOf(referenceNode);\n if (childNodesIndex !== -1) {\n (this as any)['_childNodes'].splice(childNodesIndex, 0, newNode);\n }\n }\n if (typeof newNode === 'object' && newNode !== null && 'parentNode' in newNode) {\n (newNode as { parentNode: unknown }).parentNode = this;\n }\n }\n return newNode;\n }\n \n removeChild<T extends Node>(child: T): T {\n const index = this.children.indexOf(child);\n if (index !== -1) {\n this.children.splice(index, 1);\n if (isBrowser && (this as any)['_childNodes']) {\n const cnIndex = (this as any)['_childNodes'].indexOf(child);\n if (cnIndex !== -1) {\n (this as any)['_childNodes'].splice(cnIndex, 1);\n }\n }\n if (typeof child === 'object' && child !== null && 'parentNode' in child) {\n (child as { parentNode: unknown }).parentNode = null;\n }\n }\n return child;\n }\n\n replaceChild<T extends Node>(newChild: Node, oldChild: T): T {\n const index = this.children.indexOf(oldChild);\n if (index !== -1) {\n this.children[index] = newChild;\n if (isBrowser && (this as any)['_childNodes']) {\n const cnIndex = (this as any)['_childNodes'].indexOf(oldChild);\n if (cnIndex !== -1) {\n (this as any)['_childNodes'][cnIndex] = newChild;\n }\n }\n if (typeof newChild === 'object' && newChild !== null && 'parentNode' in newChild) {\n (newChild as { parentNode: unknown }).parentNode = this;\n }\n if (typeof oldChild === 'object' && oldChild !== null && 'parentNode' in oldChild) {\n (oldChild as { parentNode: unknown }).parentNode = null;\n }\n }\n return oldChild;\n }\n \n addEventListener(type: string, listener: EventListener): void {\n if (!this._listeners) return;\n if (!this._listeners.has(type)) {\n this._listeners.set(type, new Set());\n }\n this._listeners.get(type)!.add(listener);\n }\n\n removeEventListener(type: string, listener: EventListener): void {\n const listeners = this._listeners?.get(type);\n if (listeners) {\n listeners.delete(listener);\n }\n }\n\n dispatchEvent(event: Event): boolean {\n const listeners = this._listeners?.get(event.type);\n if (listeners) {\n for (const listener of listeners) {\n try {\n listener(event);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error in event listener:', error);\n }\n }\n }\n if (event.bubbles && this.parentNode && typeof this.parentNode === 'object' && 'dispatchEvent' in this.parentNode && typeof this.parentNode.dispatchEvent === 'function') {\n this.parentNode.dispatchEvent(event);\n }\n return true;\n }\n \n querySelector(selector: string): Element | null {\n // Simple implementation - supports basic selectors\n // #id, .class, tagName\n if (selector.startsWith('#')) {\n const id = selector.slice(1);\n return this.querySelectorById(id);\n } else if (selector.startsWith('.')) {\n const className = selector.slice(1);\n return this.querySelectorByClass(className);\n } else {\n // Tag name selector\n return this.querySelectorByTag(selector);\n }\n }\n \n private querySelectorById(id: string): Element | null {\n // Check self\n if (this.id === id) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.id === id) {\n return child as unknown as Element;\n }\n const found = child.querySelector(`#${id}`);\n if (found) return found;\n }\n }\n return null;\n }\n \n private querySelectorByClass(className: string): Element | null {\n // Check self\n if (this.classList.contains(className)) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.classList?.contains(className)) {\n return child as unknown as Element;\n }\n const found = child.querySelector(`.${className}`);\n if (found) return found;\n }\n }\n return null;\n }\n \n private querySelectorByTag(tagName: string): Element | null {\n const lowerTag = tagName.toLowerCase();\n // Check self\n if (this.tagName.toLowerCase() === lowerTag) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.tagName.toLowerCase() === lowerTag) {\n return child as unknown as Element;\n }\n const found = child.querySelector(tagName);\n if (found) return found;\n }\n }\n return null;\n }\n \n querySelectorAll(selector: string): NodeListOf<Element> {\n const results: Element[] = [];\n \n if (selector.startsWith('#')) {\n const found = this.querySelector(selector);\n if (found) results.push(found);\n } else if (selector.startsWith('.')) {\n const className = selector.slice(1);\n this.querySelectorAllByClass(className, results);\n } else {\n const tagName = selector.toLowerCase();\n this.querySelectorAllByTag(tagName, results);\n }\n \n return results as unknown as NodeListOf<Element>;\n }\n \n private querySelectorAllByClass(className: string, results: Element[]): void {\n if (this.classList.contains(className)) {\n results.push(this as unknown as Element);\n }\n // Recursion alone collects matching descendants — checking the child here\n // as well would push direct children twice.\n for (const child of this.children) {\n if (isElementNode(child)) {\n child.querySelectorAllByClass(className, results);\n }\n }\n }\n\n private querySelectorAllByTag(tagName: string, results: Element[]): void {\n if (this.tagName.toLowerCase() === tagName) {\n results.push(this as unknown as Element);\n }\n for (const child of this.children) {\n if (isElementNode(child)) {\n child.querySelectorAllByTag(tagName, results);\n }\n }\n }\n}\n\nfunction createClassList(owner: NucloElement): DOMTokenList {\n const getClasses = () => owner.className.split(' ').filter((c) => c);\n const setClasses = (classes: string[]) => {\n owner.className = classes.join(' ');\n };\n\n const classList = {\n add: (...tokens: string[]) => {\n const classes = getClasses();\n for (const token of tokens) {\n if (token && !classes.includes(token)) {\n classes.push(token);\n }\n }\n setClasses(classes);\n },\n remove: (...tokens: string[]) => {\n if (tokens.length === 0) return;\n setClasses(getClasses().filter((c) => !tokens.includes(c)));\n },\n toggle: (token: string, force?: boolean) => {\n const hasClass = classList.contains(token);\n if (force === undefined) {\n if (hasClass) {\n classList.remove(token);\n return false;\n }\n classList.add(token);\n return true;\n }\n if (force) {\n classList.add(token);\n return true;\n }\n classList.remove(token);\n return false;\n },\n contains: (token: string) => getClasses().includes(token),\n replace: (oldToken: string, newToken: string) => {\n const classes = getClasses();\n const index = classes.indexOf(oldToken);\n if (index === -1) return false;\n classes[index] = newToken;\n setClasses(classes);\n return true;\n },\n item: (index: number) => getClasses()[index] || null,\n get length() {\n return getClasses().length;\n },\n toString: () => owner.className,\n [Symbol.iterator]: function* () {\n yield* getClasses();\n },\n forEach: (callback: (value: string, key: number, parent: DOMTokenList) => void) => {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n callback(classes[i], i, classList as unknown as DOMTokenList);\n }\n },\n entries: function* () {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n yield [i, classes[i]] as [number, string];\n }\n },\n keys: function* () {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n yield i;\n }\n },\n values: function* () {\n yield* getClasses();\n },\n get value() {\n return owner.className;\n },\n set value(value: string) {\n owner.className = value;\n },\n supports: (_token: string) => false\n };\n\n return classList as unknown as DOMTokenList;\n}\n"],"mappings":"AAKA,MAAa,EAAY,OAAO,OAAW,KAAe,OAAO,SAAa,ICF9E,IAAa,EAAb,KAAuB,CACrB,SAAmB,EACnB,SAAmB,GACnB,UAA2B,KAC3B,WAAsB,KACtB,YAA6B,KAC7B,YAAsB,GAEtB,IAAI,YAAoC,CACtC,IAAM,EAAQ,KAAK,aAAe,CAAC,EACnC,MAAO,CACL,GAAG,EACH,OAAQ,EAAM,OACd,KAAO,GAAmB,EAAM,IAAwB,KACxD,CAAC,OAAO,UAAW,WAAa,CAC9B,IAAK,IAAM,KAAQ,EACjB,MAAM,CAEV,EACA,QAAU,GAAqF,CAC7F,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAChC,EAAS,EAAM,GAAiB,EAAG,KAAK,UAAU,CAEtD,EACA,QAAS,WAAa,CACpB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAChC,KAAM,CAAC,EAAG,EAAM,EAAe,CAEnC,EACA,KAAM,WAAa,CACjB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAChC,MAAM,CAEV,EACA,OAAQ,WAAa,CACnB,IAAK,IAAM,KAAQ,EACjB,MAAM,CAEV,CACF,CACF,CACF,ECpCM,EAAN,KAAe,CAGb,IAAI,SAAkB,CACpB,IAAM,EAAU,OAAO,QAAQ,IAAI,EAEnC,OADI,EAAQ,SAAW,EAAU,GAC1B,EAAQ,KAAK,CAAC,EAAG,KAAO,GAAG,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,IAAI,CACxD,CAEA,YAAY,EAAc,EAAqB,CAC7C,KAAkC,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,GACT,EACA,KAAO,GAAkB,EAAW,CAAC,CAAC,IAAU,KAChD,IAAI,QAAS,CACX,OAAO,EAAW,CAAC,CAAC,MACtB,EACA,aAAgB,EAAM,UACtB,CAAC,OAAO,UAAW,WAAa,CAC9B,MAAO,EAAW,CACpB,EACA,QAAU,GAAyE,CACjF,IAAM,EAAU,EAAW,EAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAClC,EAAS,EAAQ,GAAI,EAAG,CAAoC,CAEhE,EACA,QAAS,WAAa,CACpB,IAAM,EAAU,EAAW,EAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAClC,KAAM,CAAC,EAAG,EAAQ,EAAE,CAExB,EACA,KAAM,WAAa,CACjB,IAAM,EAAU,EAAW,EAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAClC,MAAM,CAEV,EACA,OAAQ,WAAa,CACnB,MAAO,EAAW,CACpB,EACA,IAAI,OAAQ,CACV,OAAO,EAAM,SACf,EACA,IAAI,MAAM,EAAe,CACvB,EAAM,UAAY,CACpB,EACA,SAAW,GAAmB,EAChC,EAEA,OAAO,CACT"}
@@ -0,0 +1,2 @@
1
+ const e=typeof window<`u`&&typeof document<`u`;var t=class{nodeType=1;nodeName=``;nodeValue=null;parentNode=null;_childNodes=null;textContent=``;get childNodes(){let e=this._childNodes??[];return{...e,length:e.length,item:t=>e[t]||null,[Symbol.iterator]:function*(){for(let t of e)yield t},forEach:t=>{for(let n=0;n<e.length;n++)t(e[n],n,this.childNodes)},entries:function*(){for(let t=0;t<e.length;t++)yield[t,e[t]]},keys:function*(){for(let t=0;t<e.length;t++)yield t},values:function*(){for(let t of e)yield t}}}},n=class{get cssText(){let e=Object.entries(this);return e.length===0?``:e.map(([e,t])=>`${e}: ${t}`).join(`; `)}setProperty(e,t){this[e]=t}getPropertyValue(e){return this[e]||``}},r=class{_el;constructor(e){this._el=e}add(...e){let t=this._el.className?this._el.className.split(` `).filter(Boolean):[];for(let n of e)n&&!t.includes(n)&&t.push(n);this._el.className=t.join(` `)}remove(...e){this._el.className&&(this._el.className=this._el.className.split(` `).filter(t=>t&&!e.includes(t)).join(` `))}contains(e){return!!this._el.className&&this._el.className.split(` `).includes(e)}toggle(e,t){let n=this.contains(e);return t===void 0?n?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){return this.contains(e)?(this.remove(e),this.add(t),!0):!1}item(e){return this._el.className.split(` `).filter(Boolean)[e]??null}get length(){return this._el.className?this._el.className.split(` `).filter(Boolean).length:0}get value(){return this._el.className}set value(e){this._el.className=e}toString(){return this._el.className}supports(e){return!1}forEach(e){let t=this._el.className.split(` `).filter(Boolean);for(let n=0;n<t.length;n++)e(t[n],n,this)}[Symbol.iterator](){let e=this._el.className.split(` `).filter(Boolean),t=0;return{next(){return t<e.length?{value:e[t++],done:!1}:{value:``,done:!0}}}}entries(){let e=this._el.className.split(` `).filter(Boolean),t=0;return{next(){return t<e.length?{value:[t,e[t++]],done:!1}:{value:[0,``],done:!0}}}}keys(){let e=this.length,t=0;return{next(){return t<e?{value:t++,done:!1}:{value:0,done:!0}}}}values(){return this[Symbol.iterator]()}};function i(e){return typeof e==`object`&&!!e&&`tagName`in e}function a(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===3}function o(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===8}var s=class extends t{tagName;children;className=``;textContent=``;_innerHTML=``;parentNode=null;rawMods;mods;id=``;namespaceURI;sheet;_listeners;_style;_classList;_attributes;get attributes(){return this._attributes??=new Map}set attributes(e){this._attributes=e}get style(){return this._style??=new n}set style(e){this._style=e}get classList(){return this._classList??=new r(this)}set classList(e){this._classList=e}get innerHTML(){return this.serializeChildren()}set innerHTML(e){this._innerHTML=e}serializeChildren(){let e=``;for(let t of this.children)i(t)?e+=this.serializeElement(t):a(t)?e+=t.textContent||``:o(t)&&(e+=`<!--${t.data||``}-->`);return e}serializeElement(e){let t=e.tagName.toLowerCase(),n=`<${t}`;if(e.id&&(n+=` id="${e.id}"`),e.className&&(n+=` class="${e.className}"`),e._attributes)for(let[t,r]of e._attributes)t!==`id`&&t!==`class`&&(n+=` ${t}="${r}"`);if(n+=`>`,e.children&&e.children.length>0)for(let t of e.children)i(t)?n+=this.serializeElement(t):a(t)?n+=t.textContent||``:o(t)&&(n+=`<!--${t.data||``}-->`);return n+=`</${t}>`,n}constructor(t){if(super(),this.tagName=t.toLowerCase(),this.nodeType=1,this.nodeName=t.toUpperCase(),this.children=[],!e)this._listeners=null;else{this._listeners=new Map;let e={};if(this.style=new Proxy({},{get:(t,n)=>n===`setProperty`?(t,n)=>{e[t]=n}:n===`getPropertyValue`?t=>e[t]||``:n===`cssText`?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `):e[n],set:(t,n,r)=>(e[n]=r,!0)}),this.tagName===`style`){let e=[];this.sheet={cssRules:e,insertRule:(t,n)=>{let r=n??e.length,i;if(t.trim().startsWith(`@`)){let e=[],n=t.replace(/^@\w+\s+/,``).replace(/\s*\{[\s\S]*\}$/,``).trim();i={cssText:t,conditionText:n,media:{mediaText:n},cssRules:e,insertRule:(t,n)=>{let r=n??e.length;return e.splice(r,0,{cssText:t,selectorText:t.split(`{`)[0].trim(),style:{},type:1}),r},deleteRule:t=>{e.splice(t,1)},type:4}}else i={cssText:t,selectorText:t.split(`{`)[0].trim(),style:{},type:1};return e.splice(r,0,i),r},deleteRule:t=>{e.splice(t,1)}}}this.classList=c(this)}}appendChild(t){if(t?.nodeType===11){let e=t.childNodes;t.childNodes=[],t.children&&=[];for(let t=0;t<e.length;t++)this.appendChild(e[t]);return t}return this.children.push(t),e&&this._childNodes&&this._childNodes.push(t),typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this),t}setAttribute(e,t){(this._attributes??=new Map).set(e,t),e===`class`?this.className=t:e===`id`&&(this.id=t)}getAttribute(e){return this._attributes?.get(e)??null}removeAttribute(e){this._attributes?.delete(e),e===`class`&&(this.className=``)}hasAttribute(e){return this._attributes?.has(e)??!1}insertBefore(t,n){if(n===null)return this.appendChild(t);if(t?.nodeType===11){let e=t.childNodes;t.childNodes=[],t.children&&=[];for(let t=0;t<e.length;t++)this.insertBefore(e[t],n);return t}let r=this.children.indexOf(n);if(r!==-1){if(this.children.splice(r,0,t),e&&this._childNodes){let e=this._childNodes.indexOf(n);e!==-1&&this._childNodes.splice(e,0,t)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this)}return t}removeChild(t){let n=this.children.indexOf(t);if(n!==-1){if(this.children.splice(n,1),e&&this._childNodes){let e=this._childNodes.indexOf(t);e!==-1&&this._childNodes.splice(e,1)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=null)}return t}replaceChild(t,n){let r=this.children.indexOf(n);if(r!==-1){if(this.children[r]=t,e&&this._childNodes){let e=this._childNodes.indexOf(n);e!==-1&&(this._childNodes[e]=t)}typeof t==`object`&&t&&`parentNode`in t&&(t.parentNode=this),typeof n==`object`&&n&&`parentNode`in n&&(n.parentNode=null)}return n}addEventListener(e,t){this._listeners&&(this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t))}removeEventListener(e,t){let n=this._listeners?.get(e);n&&n.delete(t)}dispatchEvent(e){let t=this._listeners?.get(e.type);if(t)for(let n of t)try{n(e)}catch(e){console.error(`Error in event listener:`,e)}return e.bubbles&&this.parentNode&&typeof this.parentNode==`object`&&`dispatchEvent`in this.parentNode&&typeof this.parentNode.dispatchEvent==`function`&&this.parentNode.dispatchEvent(e),!0}querySelector(e){if(e.startsWith(`#`)){let t=e.slice(1);return this.querySelectorById(t)}if(e.startsWith(`.`)){let t=e.slice(1);return this.querySelectorByClass(t)}return this.querySelectorByTag(e)}querySelectorById(e){if(this.id===e)return this;for(let t of this.children)if(i(t)){if(t.id===e)return t;let n=t.querySelector(`#${e}`);if(n)return n}return null}querySelectorByClass(e){if(this.classList.contains(e))return this;for(let t of this.children)if(i(t)){if(t.classList?.contains(e))return t;let n=t.querySelector(`.${e}`);if(n)return n}return null}querySelectorByTag(e){let t=e.toLowerCase();if(this.tagName.toLowerCase()===t)return this;for(let n of this.children)if(i(n)){if(n.tagName.toLowerCase()===t)return n;let r=n.querySelector(e);if(r)return r}return null}querySelectorAll(e){let t=[];if(e.startsWith(`#`)){let n=this.querySelector(e);n&&t.push(n)}else if(e.startsWith(`.`)){let n=e.slice(1);this.querySelectorAllByClass(n,t)}else{let n=e.toLowerCase();this.querySelectorAllByTag(n,t)}return t}querySelectorAllByClass(e,t){this.classList.contains(e)&&t.push(this);for(let n of this.children)i(n)&&n.querySelectorAllByClass(e,t)}querySelectorAllByTag(e,t){this.tagName.toLowerCase()===e&&t.push(this);for(let n of this.children)i(n)&&n.querySelectorAllByTag(e,t)}};function c(e){let t=()=>e.className.split(` `).filter(e=>e),n=t=>{e.className=t.join(` `)},r={add:(...e)=>{let r=t();for(let t of e)t&&!r.includes(t)&&r.push(t);n(r)},remove:(...e)=>{e.length!==0&&n(t().filter(t=>!e.includes(t)))},toggle:(e,t)=>{let n=r.contains(e);return t===void 0?n?(r.remove(e),!1):(r.add(e),!0):t?(r.add(e),!0):(r.remove(e),!1)},contains:e=>t().includes(e),replace:(e,r)=>{let i=t(),a=i.indexOf(e);return a!==-1&&(i[a]=r,n(i),!0)},item:e=>t()[e]||null,get length(){return t().length},toString:()=>e.className,[Symbol.iterator]:function*(){yield*t()},forEach:e=>{let n=t();for(let t=0;t<n.length;t++)e(n[t],t,r)},entries:function*(){let e=t();for(let t=0;t<e.length;t++)yield[t,e[t]]},keys:function*(){let e=t();for(let t=0;t<e.length;t++)yield t},values:function*(){yield*t()},get value(){return e.className},set value(t){e.className=t},supports:e=>!1};return r}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
2
+ //# sourceMappingURL=Element-DXd2npjS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Element-DXd2npjS.cjs","names":[],"sources":["../src/shared/environment.ts","../src/polyfill/Node.ts","../src/polyfill/Element.ts"],"sourcesContent":["/**\n * Simplified environment detection - minimal overhead for smaller bundle size\n */\n\n// Basic environment detection - no complex caching or edge cases\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n","/**\n * Base Node class for instanceof checks in Node.js polyfill\n */\nexport class NucloNode {\n nodeType: number = 1; // ELEMENT_NODE\n nodeName: string = '';\n nodeValue: string | null = null;\n parentNode: unknown = null;\n _childNodes: Node[] | null = null;\n textContent: string = '';\n\n get childNodes(): NodeListOf<ChildNode> {\n const nodes = this._childNodes ?? [];\n return {\n ...nodes,\n length: nodes.length,\n item: (index: number) => (nodes[index] as ChildNode) || null,\n [Symbol.iterator]: function* () {\n for (const node of nodes) {\n yield node as ChildNode;\n }\n },\n forEach: (callback: (value: ChildNode, key: number, parent: NodeListOf<ChildNode>) => void) => {\n for (let i = 0; i < nodes.length; i++) {\n callback(nodes[i] as ChildNode, i, this.childNodes);\n }\n },\n entries: function* () {\n for (let i = 0; i < nodes.length; i++) {\n yield [i, nodes[i] as ChildNode] as [number, ChildNode];\n }\n },\n keys: function* () {\n for (let i = 0; i < nodes.length; i++) {\n yield i;\n }\n },\n values: function* () {\n for (const node of nodes) {\n yield node as ChildNode;\n }\n }\n } as unknown as NodeListOf<ChildNode>;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { NucloNode } from './Node';\nimport { isBrowser } from '../shared/environment';\n\n/**\n * Lightweight style object for SSR — prototype methods instead of Object.defineProperty per element.\n * Stores CSS properties as own properties and provides cssText/setProperty/getPropertyValue via prototype.\n */\nclass SSRStyle {\n [key: string]: unknown;\n\n get cssText(): string {\n const entries = Object.entries(this);\n if (entries.length === 0) return '';\n return entries.map(([k, v]) => `${k}: ${v}`).join('; ');\n }\n\n setProperty(name: string, value: string): void {\n (this as Record<string, unknown>)[name] = value;\n }\n\n getPropertyValue(name: string): string {\n return ((this as Record<string, unknown>)[name] as string) || '';\n }\n}\n\n// Lightweight classList for SSR — prototype methods instead of per-element closures\nclass SSRClassList {\n private _el: NucloElement;\n constructor(el: NucloElement) { this._el = el; }\n\n add(...tokens: string[]): void {\n const classes = this._el.className ? this._el.className.split(' ').filter(Boolean) : [];\n for (const t of tokens) if (t && !classes.includes(t)) classes.push(t);\n this._el.className = classes.join(' ');\n }\n remove(...tokens: string[]): void {\n if (!this._el.className) return;\n this._el.className = this._el.className.split(' ').filter(c => c && !tokens.includes(c)).join(' ');\n }\n contains(token: string): boolean {\n return !!this._el.className && this._el.className.split(' ').includes(token);\n }\n toggle(token: string, force?: boolean): boolean {\n const has = this.contains(token);\n if (force === undefined) { if (has) { this.remove(token); return false; } this.add(token); return true; }\n if (force) { this.add(token); return true; }\n this.remove(token); return false;\n }\n replace(oldToken: string, newToken: string): boolean {\n if (!this.contains(oldToken)) return false;\n this.remove(oldToken); this.add(newToken); return true;\n }\n item(index: number): string | null { return (this._el.className.split(' ').filter(Boolean)[index]) ?? null; }\n get length(): number { return this._el.className ? this._el.className.split(' ').filter(Boolean).length : 0; }\n get value(): string { return this._el.className; }\n set value(v: string) { this._el.className = v; }\n toString(): string { return this._el.className; }\n supports(_token: string): boolean { return false; }\n forEach(cb: (value: string, key: number, parent: DOMTokenList) => void): void {\n const classes = this._el.className.split(' ').filter(Boolean);\n for (let i = 0; i < classes.length; i++) cb(classes[i], i, this as unknown as DOMTokenList);\n }\n [Symbol.iterator](): Iterator<string> {\n const classes = this._el.className.split(' ').filter(Boolean);\n let i = 0;\n return { next(): IteratorResult<string> { return i < classes.length ? { value: classes[i++], done: false } : { value: '', done: true }; } };\n }\n entries(): Iterator<[number, string]> {\n const classes = this._el.className.split(' ').filter(Boolean);\n let i = 0;\n return { next(): IteratorResult<[number, string]> { return i < classes.length ? { value: [i, classes[i++]], done: false } : { value: [0, ''], done: true }; } };\n }\n keys(): Iterator<number> {\n const len = this.length; let i = 0;\n return { next(): IteratorResult<number> { return i < len ? { value: i++, done: false } : { value: 0, done: true }; } };\n }\n values(): Iterator<string> { return this[Symbol.iterator](); }\n}\n\ninterface TextNode {\n nodeType: 3;\n textContent: string;\n}\n\ninterface CommentNode {\n nodeType: 8;\n data: string;\n}\n\nfunction isElementNode(node: unknown): node is NucloElement {\n return typeof node === 'object' && node !== null && 'tagName' in node;\n}\n\nfunction isTextNode(node: unknown): node is TextNode {\n return typeof node === 'object' && node !== null && 'nodeType' in node && (node as { nodeType: number }).nodeType === 3;\n}\n\nfunction isCommentNode(node: unknown): node is CommentNode {\n return typeof node === 'object' && node !== null && 'nodeType' in node && (node as { nodeType: number }).nodeType === 8;\n}\n\nexport class NucloElement extends NucloNode {\n tagName: string;\n children: unknown[];\n className: string = '';\n textContent: string = '';\n private _innerHTML: string = '';\n parentNode: unknown = null;\n rawMods?: unknown[];\n mods?: unknown[];\n id: string = '';\n namespaceURI?: string;\n sheet?: CSSStyleSheet | null;\n private _listeners: Map<string, Set<EventListener>> | null;\n\n // style/classList are allocated lazily: the vast majority of SSR elements\n // never touch either (className is stored on the .className string, and the\n // serializer reads the backing field directly), so eagerly constructing an\n // SSRStyle + SSRClassList per element was pure allocation churn. The browser\n // path assigns these in the constructor, so its getter never lazy-allocates.\n private _style?: CSSStyleDeclaration;\n private _classList?: DOMTokenList;\n\n // attributes is allocated lazily too — most elements carry their identity on\n // .className/.id (separate string fields) and never call setAttribute. Reads\n // short-circuit on the undefined backing map without allocating; the\n // serializer reads _attributes directly. The public getter still lazily\n // materializes a Map for any external `el.attributes` consumer.\n private _attributes?: Map<string, string>;\n\n get attributes(): Map<string, string> {\n return (this._attributes ??= new Map<string, string>());\n }\n set attributes(value: Map<string, string>) {\n this._attributes = value;\n }\n\n get style(): CSSStyleDeclaration {\n return (this._style ??= new SSRStyle() as unknown as CSSStyleDeclaration);\n }\n set style(value: CSSStyleDeclaration) {\n this._style = value;\n }\n\n get classList(): DOMTokenList {\n return (this._classList ??= new SSRClassList(this) as unknown as DOMTokenList);\n }\n set classList(value: DOMTokenList) {\n this._classList = value;\n }\n\n get innerHTML(): string {\n return this.serializeChildren();\n }\n\n set innerHTML(value: string) {\n this._innerHTML = value;\n }\n \n private serializeChildren(): string {\n let html = '';\n for (const child of this.children) {\n if (isElementNode(child)) {\n html += this.serializeElement(child);\n } else if (isTextNode(child)) {\n html += child.textContent || '';\n } else if (isCommentNode(child)) {\n html += `<!--${child.data || ''}-->`;\n }\n }\n return html;\n }\n \n private serializeElement(element: NucloElement): string {\n const tag = element.tagName.toLowerCase();\n let html = `<${tag}`;\n \n // Add attributes\n if (element.id) {\n html += ` id=\"${element.id}\"`;\n }\n if (element.className) {\n html += ` class=\"${element.className}\"`;\n }\n if (element._attributes) {\n for (const [name, value] of element._attributes) {\n if (name !== 'id' && name !== 'class') {\n html += ` ${name}=\"${value}\"`;\n }\n }\n }\n \n html += '>';\n \n // Add children\n if (element.children && element.children.length > 0) {\n for (const child of element.children) {\n if (isElementNode(child)) {\n html += this.serializeElement(child);\n } else if (isTextNode(child)) {\n html += child.textContent || '';\n } else if (isCommentNode(child)) {\n html += `<!--${child.data || ''}-->`;\n }\n }\n }\n \n html += `</${tag}>`;\n return html;\n }\n \n constructor(tagName: string) {\n super();\n this.tagName = tagName.toLowerCase();\n this.nodeType = 1; // ELEMENT_NODE\n this.nodeName = tagName.toUpperCase();\n this.children = [];\n\n if (!isBrowser) {\n // ── SSR path: minimal allocations, no Proxy, no event listeners ──\n // style and classList stay unallocated until first access (see getters).\n this._listeners = null;\n } else {\n // ── Browser path: full-featured Proxy style + DOMTokenList ──\n this._listeners = new Map();\n\n const styleProps: Record<string, string> = {};\n this.style = new Proxy({} as CSSStyleDeclaration, {\n get: (_target, prop: string) => {\n if (prop === 'setProperty') return (name: string, value: string) => { styleProps[name] = value; };\n if (prop === 'getPropertyValue') return (name: string) => styleProps[name] || '';\n if (prop === 'cssText') return Object.entries(styleProps).map(([k, v]) => `${k}: ${v}`).join('; ');\n return styleProps[prop];\n },\n set: (_target, prop: string, value: string) => { styleProps[prop] = value; return true; },\n });\n\n // CSSStyleSheet mock for style elements (browser only)\n if (this.tagName === 'style') {\n const cssRules: CSSRule[] = [];\n this.sheet = {\n cssRules: cssRules as unknown as CSSRuleList,\n insertRule: (rule: string, index?: number) => {\n const idx = index ?? cssRules.length;\n let mockRule: CSSRule;\n if (rule.trim().startsWith('@')) {\n const innerRules: CSSRule[] = [];\n const conditionText = rule.replace(/^@\\w+\\s+/, '').replace(/\\s*\\{[\\s\\S]*\\}$/, '').trim();\n mockRule = {\n cssText: rule, conditionText,\n media: { mediaText: conditionText } as MediaList,\n cssRules: innerRules as unknown as CSSRuleList,\n insertRule: (innerRule: string, innerIndex?: number) => {\n const innerIdx = innerIndex ?? innerRules.length;\n innerRules.splice(innerIdx, 0, { cssText: innerRule, selectorText: innerRule.split('{')[0].trim(), style: {} as CSSStyleDeclaration, type: 1 } as unknown as CSSRule);\n return innerIdx;\n },\n deleteRule: (i: number) => { innerRules.splice(i, 1); },\n type: 4,\n } as unknown as CSSRule;\n } else {\n mockRule = { cssText: rule, selectorText: rule.split('{')[0].trim(), style: {} as CSSStyleDeclaration, type: 1 } as unknown as CSSRule;\n }\n cssRules.splice(idx, 0, mockRule);\n return idx;\n },\n deleteRule: (index: number) => { cssRules.splice(index, 1); },\n } as unknown as CSSStyleSheet;\n }\n\n this.classList = createClassList(this);\n }\n }\n \n appendChild<T extends Node>(child: T): T {\n // Spec behaviour: appending a DocumentFragment moves its children into this\n // node and leaves the fragment empty. The list runtime relies on this to\n // batch row insertions.\n if ((child as any)?.nodeType === 11) {\n // Detach the fragment's backing array before iterating (instead of\n // slicing it) — the fragment is emptied either way, and reassigning\n // first means the loop never has to allocate a copy just to guard\n // against the array it's about to discard.\n const kids = (child as any).childNodes as Node[];\n (child as any).childNodes = [];\n if ((child as any).children) (child as any).children = [];\n for (let i = 0; i < kids.length; i++) this.appendChild(kids[i]);\n return child;\n }\n this.children.push(child);\n if (isBrowser && (this as any)['_childNodes']) {\n (this as any)['_childNodes'].push(child);\n }\n if (typeof child === 'object' && child !== null && 'parentNode' in child) {\n (child as { parentNode: unknown }).parentNode = this;\n }\n return child;\n }\n \n setAttribute(name: string, value: string): void {\n (this._attributes ??= new Map<string, string>()).set(name, value);\n if (name === 'class') {\n this.className = value;\n } else if (name === 'id') {\n this.id = value;\n }\n }\n\n getAttribute(name: string): string | null {\n return this._attributes?.get(name) ?? null;\n }\n\n removeAttribute(name: string): void {\n this._attributes?.delete(name);\n if (name === 'class') {\n this.className = '';\n }\n }\n\n hasAttribute(name: string): boolean {\n return this._attributes?.has(name) ?? false;\n }\n \n insertBefore<T extends Node>(newNode: T, referenceNode: Node | null): T {\n if (referenceNode === null) {\n return this.appendChild(newNode);\n }\n // Spec behaviour: inserting a DocumentFragment moves its children (in order)\n // before the reference node and empties the fragment.\n if ((newNode as any)?.nodeType === 11) {\n const kids = (newNode as any).childNodes as Node[];\n (newNode as any).childNodes = [];\n if ((newNode as any).children) (newNode as any).children = [];\n for (let i = 0; i < kids.length; i++) this.insertBefore(kids[i], referenceNode);\n return newNode;\n }\n const index = this.children.indexOf(referenceNode);\n if (index !== -1) {\n this.children.splice(index, 0, newNode);\n if (isBrowser && (this as any)['_childNodes']) {\n const childNodesIndex = (this as any)['_childNodes'].indexOf(referenceNode);\n if (childNodesIndex !== -1) {\n (this as any)['_childNodes'].splice(childNodesIndex, 0, newNode);\n }\n }\n if (typeof newNode === 'object' && newNode !== null && 'parentNode' in newNode) {\n (newNode as { parentNode: unknown }).parentNode = this;\n }\n }\n return newNode;\n }\n \n removeChild<T extends Node>(child: T): T {\n const index = this.children.indexOf(child);\n if (index !== -1) {\n this.children.splice(index, 1);\n if (isBrowser && (this as any)['_childNodes']) {\n const cnIndex = (this as any)['_childNodes'].indexOf(child);\n if (cnIndex !== -1) {\n (this as any)['_childNodes'].splice(cnIndex, 1);\n }\n }\n if (typeof child === 'object' && child !== null && 'parentNode' in child) {\n (child as { parentNode: unknown }).parentNode = null;\n }\n }\n return child;\n }\n\n replaceChild<T extends Node>(newChild: Node, oldChild: T): T {\n const index = this.children.indexOf(oldChild);\n if (index !== -1) {\n this.children[index] = newChild;\n if (isBrowser && (this as any)['_childNodes']) {\n const cnIndex = (this as any)['_childNodes'].indexOf(oldChild);\n if (cnIndex !== -1) {\n (this as any)['_childNodes'][cnIndex] = newChild;\n }\n }\n if (typeof newChild === 'object' && newChild !== null && 'parentNode' in newChild) {\n (newChild as { parentNode: unknown }).parentNode = this;\n }\n if (typeof oldChild === 'object' && oldChild !== null && 'parentNode' in oldChild) {\n (oldChild as { parentNode: unknown }).parentNode = null;\n }\n }\n return oldChild;\n }\n \n addEventListener(type: string, listener: EventListener): void {\n if (!this._listeners) return;\n if (!this._listeners.has(type)) {\n this._listeners.set(type, new Set());\n }\n this._listeners.get(type)!.add(listener);\n }\n\n removeEventListener(type: string, listener: EventListener): void {\n const listeners = this._listeners?.get(type);\n if (listeners) {\n listeners.delete(listener);\n }\n }\n\n dispatchEvent(event: Event): boolean {\n const listeners = this._listeners?.get(event.type);\n if (listeners) {\n for (const listener of listeners) {\n try {\n listener(event);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error in event listener:', error);\n }\n }\n }\n if (event.bubbles && this.parentNode && typeof this.parentNode === 'object' && 'dispatchEvent' in this.parentNode && typeof this.parentNode.dispatchEvent === 'function') {\n this.parentNode.dispatchEvent(event);\n }\n return true;\n }\n \n querySelector(selector: string): Element | null {\n // Simple implementation - supports basic selectors\n // #id, .class, tagName\n if (selector.startsWith('#')) {\n const id = selector.slice(1);\n return this.querySelectorById(id);\n } else if (selector.startsWith('.')) {\n const className = selector.slice(1);\n return this.querySelectorByClass(className);\n } else {\n // Tag name selector\n return this.querySelectorByTag(selector);\n }\n }\n \n private querySelectorById(id: string): Element | null {\n // Check self\n if (this.id === id) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.id === id) {\n return child as unknown as Element;\n }\n const found = child.querySelector(`#${id}`);\n if (found) return found;\n }\n }\n return null;\n }\n \n private querySelectorByClass(className: string): Element | null {\n // Check self\n if (this.classList.contains(className)) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.classList?.contains(className)) {\n return child as unknown as Element;\n }\n const found = child.querySelector(`.${className}`);\n if (found) return found;\n }\n }\n return null;\n }\n \n private querySelectorByTag(tagName: string): Element | null {\n const lowerTag = tagName.toLowerCase();\n // Check self\n if (this.tagName.toLowerCase() === lowerTag) {\n return this as unknown as Element;\n }\n // Check children recursively\n for (const child of this.children) {\n if (isElementNode(child)) {\n if (child.tagName.toLowerCase() === lowerTag) {\n return child as unknown as Element;\n }\n const found = child.querySelector(tagName);\n if (found) return found;\n }\n }\n return null;\n }\n \n querySelectorAll(selector: string): NodeListOf<Element> {\n const results: Element[] = [];\n \n if (selector.startsWith('#')) {\n const found = this.querySelector(selector);\n if (found) results.push(found);\n } else if (selector.startsWith('.')) {\n const className = selector.slice(1);\n this.querySelectorAllByClass(className, results);\n } else {\n const tagName = selector.toLowerCase();\n this.querySelectorAllByTag(tagName, results);\n }\n \n return results as unknown as NodeListOf<Element>;\n }\n \n private querySelectorAllByClass(className: string, results: Element[]): void {\n if (this.classList.contains(className)) {\n results.push(this as unknown as Element);\n }\n // Recursion alone collects matching descendants — checking the child here\n // as well would push direct children twice.\n for (const child of this.children) {\n if (isElementNode(child)) {\n child.querySelectorAllByClass(className, results);\n }\n }\n }\n\n private querySelectorAllByTag(tagName: string, results: Element[]): void {\n if (this.tagName.toLowerCase() === tagName) {\n results.push(this as unknown as Element);\n }\n for (const child of this.children) {\n if (isElementNode(child)) {\n child.querySelectorAllByTag(tagName, results);\n }\n }\n }\n}\n\nfunction createClassList(owner: NucloElement): DOMTokenList {\n const getClasses = () => owner.className.split(' ').filter((c) => c);\n const setClasses = (classes: string[]) => {\n owner.className = classes.join(' ');\n };\n\n const classList = {\n add: (...tokens: string[]) => {\n const classes = getClasses();\n for (const token of tokens) {\n if (token && !classes.includes(token)) {\n classes.push(token);\n }\n }\n setClasses(classes);\n },\n remove: (...tokens: string[]) => {\n if (tokens.length === 0) return;\n setClasses(getClasses().filter((c) => !tokens.includes(c)));\n },\n toggle: (token: string, force?: boolean) => {\n const hasClass = classList.contains(token);\n if (force === undefined) {\n if (hasClass) {\n classList.remove(token);\n return false;\n }\n classList.add(token);\n return true;\n }\n if (force) {\n classList.add(token);\n return true;\n }\n classList.remove(token);\n return false;\n },\n contains: (token: string) => getClasses().includes(token),\n replace: (oldToken: string, newToken: string) => {\n const classes = getClasses();\n const index = classes.indexOf(oldToken);\n if (index === -1) return false;\n classes[index] = newToken;\n setClasses(classes);\n return true;\n },\n item: (index: number) => getClasses()[index] || null,\n get length() {\n return getClasses().length;\n },\n toString: () => owner.className,\n [Symbol.iterator]: function* () {\n yield* getClasses();\n },\n forEach: (callback: (value: string, key: number, parent: DOMTokenList) => void) => {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n callback(classes[i], i, classList as unknown as DOMTokenList);\n }\n },\n entries: function* () {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n yield [i, classes[i]] as [number, string];\n }\n },\n keys: function* () {\n const classes = getClasses();\n for (let i = 0; i < classes.length; i++) {\n yield i;\n }\n },\n values: function* () {\n yield* getClasses();\n },\n get value() {\n return owner.className;\n },\n set value(value: string) {\n owner.className = value;\n },\n supports: (_token: string) => false\n };\n\n return classList as unknown as DOMTokenList;\n}\n"],"mappings":"AAKA,MAAa,EAAY,OAAO,OAAW,KAAe,OAAO,SAAa,ICF9E,IAAa,EAAb,KAAuB,CACrB,SAAmB,EACnB,SAAmB,GACnB,UAA2B,KAC3B,WAAsB,KACtB,YAA6B,KAC7B,YAAsB,GAEtB,IAAI,YAAoC,CACtC,IAAM,EAAQ,KAAK,aAAe,CAAC,EACnC,MAAO,CACL,GAAG,EACH,OAAQ,EAAM,OACd,KAAO,GAAmB,EAAM,IAAwB,KACxD,C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AAQ,IAClC,MAAM,CAEV,EACA,OAAQ,WAAa,CACnB,MAAO,EAAW,CACpB,EACA,IAAI,OAAQ,CACV,OAAO,EAAM,SACf,EACA,IAAI,MAAM,EAAe,CACvB,EAAM,UAAY,CACpB,EACA,SAAW,GAAmB,EAChC,EAEA,OAAO,CACT"}
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?n.push(t):l.set(e,[t])}function d(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function f(e,t){let n=l.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)d(e,n[t]);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}n.length=r,r===0&&l.delete(e)}function p(e,t,n){return function(r){if(!c||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){s(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),u(i,{type:e,wrapped:a,options:n})}}const m=new Set,h=new WeakMap,g=new Set,_=new WeakMap;function v(e,t){let n=h.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);m.add(r),h.set(e,{ref:r,info:t})}function y(e,t){let n=new WeakRef(e);g.add(n),_.set(e,{ref:n,info:t})}function b(e){m.delete(e)}function ee(e){g.delete(e)}function x(e){let t=h.get(e);t&&(m.delete(t.ref),h.delete(e))}function S(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}const C=new WeakMap,w=new Set,T=new WeakMap,E=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{w.delete(e)}):null;function D(e,t){C.set(e,t);let n=new WeakRef(e);w.add(n),T.set(e,n),E?.register(e,n)}function O(e){C.delete(e);let t=T.get(e);t&&(w.delete(t),T.delete(e))}function te(){let e=[],t=[];for(let n of w){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)w.delete(e);return e}function ne(e){return C.get(e)??null}const re=`http://www.w3.org/2000/svg`;function ie(e){return globalThis.document?document.createElement(e):null}function ae(e,t){return globalThis.document?document.createElementNS(e,t):null}function k(e){return globalThis.document?document.createTextNode(e):null}function oe(){return globalThis.document?document.createDocumentFragment():null}function se(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function ce(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),S(t),O(t)}else e.nodeType===Node.TEXT_NODE?x(e):e.nodeType===Node.COMMENT_NODE&&O(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ce(e.childNodes[t])}function A(e){if(!e?.parentNode)return!1;try{return ce(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function le(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 ue(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function de(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 fe(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;A(n),n=e}}function pe(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)le(n,e[r],t)}function me(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;se(e,t)}}return e}function M(e){return e?.isConnected===!0}function he(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 ge(e){return e}function _e(e,t,n){let r=ge(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 ve(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 ye={};let be=!1;function xe(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=_.get(n);e&&(M(n)?Ee(e.info):(ee(e.ref),_.delete(n)))}n=n.parentNode}}function Se(){be||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,xe,!0),be=!0)}function Ce(e){let t=_.get(e);if(t)return t.info;let n={attributeResolvers:[]};return y(e,n),n}function we(e){return typeof e!=`object`||!e}function Te(e){let t;try{t=e.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=we(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:ye}catch(t){s(`Failed to apply reactive attribute: ${e.key}`,t)}}function Ee(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Te(t[e])}function De(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:ye};if(!c){Te(i);return}Se();let a=Ce(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),Te(i)}function Oe(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}if(!M(r)){_.delete(r),t.push(n);continue}e&&!e.contains(r)||Ee(i.info)}for(let e of t)ee(e)}function ke(e,t){if(!(!e?.style||!t))for(let n in t)ve(e,n,t[n])||s(`Failed to set style property '${n}'`)}function Ae(e,t){e&&(a(t)?De(e,`style`,t,function(t){ke(e,t)}):ke(e,t))}const N=new WeakMap,je=new WeakSet;function Me(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 Ne(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Pe(e){if(e.className&&!N.has(e)){let t=new Set;Me(t,e.className),N.set(e,t)}je.add(e)}function Fe(e){return je.has(e)}function Ie(e,t){if(!t)return;let n=N.get(e);n||(n=new Set,N.set(e,n)),Me(n,t)}function Le(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=Ne(n);return}let r=Ne(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 Re(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;Me(r,n),Me(r,t),e.className=Ne(r)}else e.className=t}function ze(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&&v(a,{resolver:e,lastValue:i,sanitize:n}),a}function Be(e){let t=[];for(let n of m){let r=n.deref();if(r===void 0){t.push(n);continue}let i=h.get(r);if(!i){t.push(n);continue}let a=i.info;if(!M(r)){h.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)b(e)}function Ve(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){Re(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 He(e,t,n,r=!1){if(n!=null){if(t===`style`){Ae(e,n);return}if(a(n)){let r=String(t);if(r.charCodeAt(0)===111&&r.charCodeAt(1)===110){e[r]=n;return}if(n.length===0){let t=n;r===`className`&&e instanceof HTMLElement?(Pe(e),De(e,r,t,function(t){Le(e,String(t||``))})):De(e,r,t,function(t){Ve(e,r,t,!1)});return}}if(t===`className`&&e instanceof HTMLElement&&Fe(e)){let t=String(n||``);t&&(Ie(e,t),Re(e,t));return}Ve(e,String(t),n,r)}}function Ue(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];He(e,i,a,n&&i===`className`)}}let P=!1,We=new WeakMap;function F(){return P}function Ge(){return!1}function Ke(){P=!0,We=new WeakMap}function qe(){P=!1}function Je(e){let t=P;P=!1;try{return e()}finally{P=t}}function I(e){let t=We.get(e);return t===void 0?e.firstChild:t}function L(e,t){We.set(e,t)}function Ye(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function Xe(e){let t=I(e),n=!1;for(;t&&Ye(t);)t=t.nextSibling,n=!0;n&&L(e,t)}function R(e){let t=I(e);return t&&L(e,t.nextSibling),t}function Ze(e,t){if(!P)return null;Xe(e);let n=I(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?R(e):null}function Qe(e,t){if(!t)return;let n=I(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}L(e,null)}const z=new WeakMap;function $e(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function et(e){Xe(e);let t=I(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function tt(e,t){let n=I(e);if(n&&n.nodeType===3)return R(e),n.textContent!==t&&(n.textContent=t),n;let r=k(t);return r?(e.insertBefore(r,n),L(e,n),r):null}function B(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=z.get(i);if(t||(t={value:i(),error:!1},z.set(i,t)),t.error)return rt(c,()=>``);let n=t.value;if($e(n))return Ue(r,{className:()=>{let e=i();return $e(e)?e.className:``}}),null;if(e(n)){let e=i,t=n??``;if(F()&&et(r)){let n=r;R(n);let i=String(t),a=tt(n,i);return a&&v(a,{resolver:e,lastValue:i,sanitize:!0}),null}return rt(c,e,t,!0)}return null}catch(e){return z.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),rt(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?it(c,a):t(a)?a:(n(a)&&Ue(r,a),null)}let l=i;if(e(l)){if(F()&&et(r)){let e=r;return R(e),tt(e,String(l)),null}return it(c,l)}return t(l)?l:(Ue(r,l),null)}function nt(e,t){if(c&&!F()&&!Ge())return t;let n=oe();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=j(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function rt(e,t,n,r){return nt(e,ze(t,n,r))}function it(e,t){return nt(e,k(String(t)))}const at=Symbol(`nuclo.factory.tag`),ot=Symbol(`nuclo.factory.mods`);let V=0;const st=[];let ct=0;function lt(){return ct>=st.length&&st.push(()=>null),st[ct++]}function ut(e,t,n){e[at]=t,e[ot]=n}function H(e){return typeof e==`function`?e[ot]:void 0}function U(e){return typeof e==`function`?e[at]:void 0}function dt(){return V>0}function ft(e,t,n){let r=V===0;V++,r&&(ct=0);try{return e(t,n)}finally{V--}}function pt(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=B(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function mt(e,t){let n=ie(e);if(!n)throw Error(`Failed to create element: ${e}`);return pt(n,t,0),n}function ht(e,t){let n=ae(re,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return pt(n,t,0),n}function gt(e,t){if(dt()){let n=lt();return ut(n,e,t),n}let n=function(n,r=0){let i=n,a=i?Ze(i,e):null,o=a??ie(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return pt(o,t,r),a&&Qe(s,c),o};return ut(n,e,t),n}function _t(e,t){if(dt()){let n=lt();return ut(n,e,t),n}return function(n,r=0){let i=n,a=i?Ze(i,e):null,o=a??ae(`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 pt(o,t,r),a&&Qe(s,c),o}}function vt(e){return(...t)=>gt(e,t)}function yt(e){return(...t)=>_t(e,t)}const bt=`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(`.`),xt=`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(`.`),St=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function Ct(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 wt(e,t){t in e&&typeof e[t]!=`function`||(Ct(e,t,()=>vt(t)),t===`var`&&Ct(e,`var_`,()=>vt(t)))}function Tt(e,t){let n=`${t}Svg`;n in e||Ct(e,n,()=>yt(t))}function Et(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<xt.length;t++)Tt(e,xt[t]);for(let t=0;t<bt.length;t++)wt(e,bt[t]);e[t]=!0}}function Dt(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function Ot(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110}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=H(a);if(e!==void 0){let t=U(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(),z.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`){if(Ot(r)){o.push({key:r,kind:1,prop:!1});continue}if(r===`className`&&a.length===0){if(i++)return null;o.push({key:r,kind:2,prop:!1});continue}return null}if(s===`object`||r===`className`&&i++)return null;o.push({key:r,kind:0,prop:!1,value:a})}r.push({kind:0,keys:o});continue}r.push({kind:1})}return{tag:e,slots:r}}function 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;n[a.key]=o;break;case 2:{if(typeof o!=`function`||o.length!==0)return!1;let e=o,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),r.push({kind:1,node:n,fn:e,last:i});break}case 3:if(o!=null)return!1;break}}break}case 1:if(s==null||typeof s==`object`||typeof s==`function`||!a)return!1;a.nodeValue=String(s),a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||H(s)!==void 0||!a)return!1;let e;try{e=s()}catch{return!1}if(e!=null&&(typeof e==`object`||typeof e==`function`))return!1;let t=e==null?``:String(e),n=a;n.nodeValue=t,r.push({kind:0,node:n,fn:s,last:t}),a=n.nextSibling;break}case 3:{let e=H(s);if(e===void 0||U(s)!==o.child.tag||!a||!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;S(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;x(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=H(s);if(e===void 0||U(s)!==o.child.tag||!a||!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 Ft=new Set,It=new WeakMap,Lt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Ft.delete(e)}):null;let Rt=0;function zt(e,t){let n=new WeakRef(e);Ft.add(n),It.set(e,t),Lt?.register(e,n)}function Bt(e){return Array.isArray(e)?e:Array.from(e)}function Vt(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function Ht(e,t,n){let r=e.renderItem(t,n);return Vt(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):Dt(r,e.host,n)}function Ut(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=c&&!F()&&!Ge(),a=r&&i?ft(e.renderItem,t,n):e.renderItem(t,n);if(Vt(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=H(a);if(i!==void 0){if(r===void 0){let t=U(a),r=t?kt(t,i):null,o=Dt(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,Ht(e,t,n))}else if(r===void 0)e.template=null;else return e.template=null,Ht(e,t,n)}return Dt(a,e.host,n)}function Wt(e){A(e.element)}function Gt(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 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 qt(e,t,n,r,i,a,o){let s=oe(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Ut(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 Jt(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=Bt(e.itemsProvider());if(Pt(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!Gt(a,r,t,n))for(let e=0;e<o;e++)Wt(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)qt(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];qt(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++)Wt(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(!Gt(a,r,t,n))for(let e=0;e<o;e++)Wt(a[e]);let c=[];qt(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]||Wt(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=Kt(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=Ut(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||=oe(),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 Yt(e,t,n,r){return F()?Zt(e,t,n,r):Xt(e,t,n,r)}function Xt(e,t,n,r){let{start:i,end:a}=de(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Jt(o),c&&zt(i,o),o}function Zt(e,t,n,r){let i=n;Xe(i);let a=I(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return Xt(e,t,n,r);let o=R(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=j(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return Xt(e,t,n,r);let d=Bt(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=Vt(r)?r:null,a=i?i.element:Dt(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=I(i);for(;p&&p!==u;){let e=p.nextSibling;A(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}L(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return c&&zt(o,h),h}function Qt(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 $t(e){let t=[];Rt++;for(let n of Ft){let r=n.deref();if(!r){t.push(n);continue}let i=It.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){Qt(i),It.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=Rt;try{Jt(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===Rt)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===Rt)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&Nt(n)}}for(let e of t)Ft.delete(e)}function en(e,t){return function(n,r){return Yt(e,t,n,r).startMarker}}function tn(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function nn(e,t){return typeof e==`function`?tn(e,t):!!e}const rn=new Set,an=new WeakMap,on=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{rn.delete(e)}):null;function sn(e,t){for(let t=0;t<e.length;t++)if(nn(e[t].condition))return t;return t.length>0?-1:null}function cn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=sn(t,n);o!==e.activeIndex&&(fe(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&pe(fn(o>=0?t[o].content:n,r,i,a),a))}function ln(e){let t=new WeakRef(e.startMarker);rn.add(t),an.set(e.startMarker,e),on?.register(e.startMarker,t)}function un(e){let t=[];for(let n of rn){let r=n.deref();if(r===void 0){t.push(n);continue}let i=an.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){an.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),an.delete(r),t.push(n)}}for(let e of t)rn.delete(e)}function dn(e,t,n,r){return a(e)?o(e)?(z.delete(e),B(t,e,n)):_e(t,r,()=>{let r=B(t,e,n);return r&&!r.parentNode?r:null}):B(t,e,n)}function fn(e,t,n,r){let i=[];for(let a of e){let e=dn(a,t,n,r);e&&i.push(e)}return i}function pn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function mn(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var hn=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}=de(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=ge(e);return a.appendChild(n),a.appendChild(r),cn(i),n.textContent=pn(t,i.activeIndex),n}hydrateRender(e,t){let n=e;Xe(n);let r=I(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=R(n),a=0,o=I(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=j(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=sn(this.groups,this.elseContent),u=mn(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)B(e,r,t)}}else if(fe(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;Je(()=>{pe(fn(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(){cn(a)}};return c&&ln(a),a}};function gn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return gn(e.cloneWith({condition:t,content:n}))},else:function(...t){return gn(e.cloneWith(void 0,t))}})}function _n(e,...t){return gn(new hn(e,...t))}function vn(e){try{return e.isSvg?ht(e.tagName,e.modifiers):mt(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=ae(re,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=ie(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function yn(e){let t=ne(e);if(!t)return;let n=tn(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=vn(t);D(n,t),he(e,n)}else if(!n&&r){let n=ue(t.tagName);n&&(D(n,t),he(e,n))}}function bn(e){if(c)try{let t=te();for(let n of t){if(!n.isConnected){O(n);continue}e&&!e.contains(n)||yn(n)}}catch(e){s(`Error during conditional elements update`,e)}}const xn=new Map;function Sn(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 Cn(e,t){let n=xn.get(e);n||(n=new Set,xn.set(e,n)),n.add(new WeakRef(t))}function wn(e){let t=Sn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=xn.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&&xn.delete(e)}return Array.from(n)}function Tn(...e){let t=Sn(e);return function(e){if(c&&e instanceof Element)for(let n of t)Cn(n,e)}}const En=[$t,un,bn,Oe,Be,On];function Dn(...e){let t;if(e.length>0){let n=wn(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 En)e(t)}function On(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 kn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function An(e,t){let n=t||document.body,r=n;Ke();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=I(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),A(e),L(r,t)}else r.appendChild(i),L(r,null)}return t}finally{qe()}}let jn=null;function Mn(e){jn=e}const Nn=new Map,W=new Map,Pn=new Set,Fn=[],G=new Map;let In=0,K=null,q=null,Ln=null,J=0;const Y=new Map;let X=null,Rn=!1;function zn(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 Y.set(t,r),Y.set(Z(r),r),r}catch{return null}}function Z(e){let t=e.cssText,n=t.indexOf(`{`);return(n===-1?t:t.slice(0,n)).trim()}function Vn(e){return e instanceof CSSStyleRule?e.selectorText:Z(e)}function Hn(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function Un(e,t){if(!X)return;let n=Hn(t,Vn(e)),r=X.get(n);r||(r=new Set,X.set(n,r)),r.add(e.cssText)}function Wn(e,t){if(!X)return!1;let n=Hn(t,Vn(e)),r=X.get(n);return r?.delete(e.cssText)?(r.size===0&&X.delete(n),X.size===0&&(X=null),!0):!1}function Gn(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof CSSStyleRule){Un(n,void 0);continue}let r=Z(n);if(`cssRules`in n&&!r.startsWith(`@keyframes`)){let e=n;Rn=!0,Y.set(r,e);for(let t=0;t<e.cssRules.length;t++)Un(e.cssRules[t],r)}else Un(n,void 0)}}function Kn(e,t){try{e.insertRule(t,J);let n=e.cssRules[J];if(Wn(n,void 0)){e.deleteRule(J);return}J++}catch{}}function qn(e,t){try{let n=e.cssRules.length;e.insertRule(t,n);let r=e.cssRules[n];Wn(r,Z(e))&&e.deleteRule(n)}catch{}}function Jn(e,t){let n=Y.get(t);if(n)return n;if(!Rn)return Bn(e,t);try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=Z(e.cssRules[n]);e.deleteRule(n);let i=Y.get(r);if(i)return Y.set(t,i),i}catch{return null}return Bn(e,t)}function Yn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(q&&Ln===document&&q.ownerNode&&q.ownerNode.isConnected)return q;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)),q=t.sheet,Ln=document,Y.clear(),J=0,X=null,Rn=!1,!q)return null;if(q.cssRules.length>0){let e=0;for(;e<q.cssRules.length;){let t=q.cssRules[e];if(!(t instanceof CSSStyleRule)&&`cssRules`in t&&!Z(t).startsWith(`@keyframes`))break;e++}J=e,X=new Map,Gn(q.cssRules)}for(let e of Fn)Kn(q,e);for(let[e,t]of G){let n=Jn(q,e);if(n)for(let e of t)qn(n,e)}return q}function Xn(e,t){let n=Yn();if(t===void 0)Fn.push(e);else{let n=G.get(t);n||(n=[],G.set(t,n)),n.push(e)}if(K=null,n)if(t===void 0)Kn(n,e);else{let r=Jn(n,t);r&&qn(r,e)}jn?.(t===void 0?e:t+`{`+e+`}`)}function Zn(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 Qn(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function $n(e,t){return e+t.length+`:`+t}function er(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 tr(e,t){let n=`.`+e;return n+er(t,n)}function nr(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 rr(e,t,n,r,i=!1){let a=``,o=Qn(e,t);for(let[e,t]of n)a+=(a?`;`:``)+e+`:`+t,o=$n($n(o,e),t);r!==void 0&&!nr(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`+$n(``,r)+o,c=Nn.get(s);return c===void 0?(r===void 0?c=`n`+Zn(s):(c=i?r:r+`-`+Zn(s),W.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.`)),Nn.set(s,c),W.set(c,{query:e,suffix:t,decls:n,name:r}),Xn(tr(c,t)+`{`+a+`}`,e),c):(Yn(),c)}function ir(e,t,n,r,i=!1){return rr(e,t,n,r,i)}function ar(e,t){let n=W.get(e),r=W.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 rr(n.query,n.suffix,o,n.name??r.name)}function or(e){let t=W.get(e);return t===void 0?void 0:Qn(t.query,t.suffix)}function sr(){return In}function cr(e,t){if(Pn.has(e)){Yn();return}Pn.add(e),Xn(t,void 0)}function lr(){if(K!==null)return K;let e=Fn.join(``);for(let[t,n]of G)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return K=e,e}function ur(){Nn.clear(),W.clear(),Pn.clear(),Fn.length=0,G.clear(),Y.clear(),K=null,J=0,q=null,Ln=null,X=null,Rn=!1,In++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const dr={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`},fr={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`]},pr={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`}},mr={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`},hr=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`]),gr=new Map;function _r(e){let t=gr.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),gr.set(e,t)),t}function vr(e){return e.charCodeAt(0)===64?e:`@media `+e}function yr(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Q(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]=Q({...i},r):e[n]=r}return e}function br(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function xr(e,t){let n=or(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,ar(r,t))}function Sr(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&&xr(t,e.slice(n,r)),n=r+1)}}function Cr(e,t){for(let n of e)n&&(typeof n==`string`?Sr(n,t):Array.isArray(n)?Cr(n,t):Sr(n.className,t))}function wr(...e){let t=new Map;Cr(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return br(n)}function Tr(e={}){let t=e.screens??{};zn(Object.values(t).map(vr));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||hr.has(t)?String(n):n+`px`;let r=mr[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=dr[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,yr(n,vr(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,er(c,`&`+o).slice(1),s);continue}if(d===64){a(l,yr(n,c),o,s);continue}continue}if(l===!0){let e=pr[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=fr[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=_r(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 br(``);let s=sr(),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(ir(e.query,e.suffix,e.decls,o,t))}let d=br(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=pr[t];if(e)for(let t in e)n(t,e[t]);continue}let a=fr[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=_r(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`+Zn(t);return cr(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;cr(`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=Q(f,a));for(let e of r){let t=l[e];if(t!==void 0){let r=n[e][t];r&&(f=Q(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=Q(f,e.style))}let p=o(f);return c.set(u,p),p}}return{css:o,cx:wr,variants:u,keyframes:c,globalStyle:l,theme:e}}let Er;function $(){return Er??=Tr({})}const Dr=(e,t)=>typeof e==`string`?$().css(e,t):$().css(e),Or=e=>$().variants(e),kr=e=>$().keyframes(e),Ar=(e,t)=>$().globalStyle(e,t);function jr(){Et();let e=globalThis;e.list=en,e.update=Dn,e.when=_n,e.on=p,e.scope=Tn,e.render=kn,e.hydrate=An,e.createCss=Tr,e.css=Dr,e.cx=wr,e.variants=Or,e.keyframes=kr,e.globalStyle=Ar}jr(),exports.HTML_TAGS=bt,exports.SELF_CLOSING_TAGS=St,exports.SVG_TAGS=xt,exports.appendChildren=me,exports.applyAttributes=Ue,exports.applyNodeModifier=B,exports.createComment=j,exports.createConditionalComment=ue,exports.createCss=Tr,exports.createHtmlElementWithModifiers=mt,exports.createHtmlTagBuilder=vt,exports.createSvgElementWithModifiers=ht,exports.createSvgTagBuilder=yt,exports.css=Dr,exports.cx=wr,exports.getCssText=lr,exports.globalStyle=Ar,exports.hydrate=An,exports.initializeRuntime=jr,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=kr,exports.list=en,exports.on=p,exports.registerGlobalTagBuilders=Et,exports.render=kn,exports.replaceNodeSafely=he,exports.resetStyles=ur,exports.scope=Tn,exports.setSSRCollector=Mn,exports.update=Dn,exports.variants=Or,exports.when=_n;
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?n.push(t):l.set(e,[t])}function d(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function f(e,t){let n=l.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)d(e,n[t]);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}n.length=r,r===0&&l.delete(e)}function p(e,t,n){return function(r){if(!c||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){s(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),u(i,{type:e,wrapped:a,options:n})}}const m=new Set,h=new WeakMap,g=new Set,_=new WeakMap;function v(e,t){let n=h.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);m.add(r),h.set(e,{ref:r,info:t})}function y(e,t){let n=new WeakRef(e);g.add(n),_.set(e,{ref:n,info:t})}function b(e){m.delete(e)}function ee(e){g.delete(e)}function x(e){let t=h.get(e);t&&(m.delete(t.ref),h.delete(e))}function S(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}const C=new WeakMap,w=new Set,T=new WeakMap,E=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{w.delete(e)}):null;function D(e,t){C.set(e,t);let n=new WeakRef(e);w.add(n),T.set(e,n),E?.register(e,n)}function O(e){C.delete(e);let t=T.get(e);t&&(w.delete(t),T.delete(e))}function te(){let e=[],t=[];for(let n of w){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)w.delete(e);return e}function ne(e){return C.get(e)??null}const re=`http://www.w3.org/2000/svg`;function ie(e){return globalThis.document?document.createElement(e):null}function ae(e,t){return globalThis.document?document.createElementNS(e,t):null}function k(e){return globalThis.document?document.createTextNode(e):null}function oe(){return globalThis.document?document.createDocumentFragment():null}function se(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function ce(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),S(t),O(t)}else e.nodeType===Node.TEXT_NODE?x(e):e.nodeType===Node.COMMENT_NODE&&O(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ce(e.childNodes[t])}function A(e){if(!e?.parentNode)return!1;try{return ce(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function le(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 ue(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function de(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 fe(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;A(n),n=e}}function pe(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)le(n,e[r],t)}function me(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;se(e,t)}}return e}function M(e){return e?.isConnected===!0}function he(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 ge(e){return e}function _e(e,t,n){let r=ge(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 ve(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 ye={};let be=!1;function xe(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=_.get(n);e&&(M(n)?Ee(e.info):(ee(e.ref),_.delete(n)))}n=n.parentNode}}function Se(){be||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,xe,!0),be=!0)}function Ce(e){let t=_.get(e);if(t)return t.info;let n={attributeResolvers:[]};return y(e,n),n}function we(e){return typeof e!=`object`||!e}function Te(e){let t;try{t=e.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=we(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:ye}catch(t){s(`Failed to apply reactive attribute: ${e.key}`,t)}}function Ee(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Te(t[e])}function De(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:ye};if(!c){Te(i);return}Se();let a=Ce(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),Te(i)}function Oe(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}if(!M(r)){_.delete(r),t.push(n);continue}e&&!e.contains(r)||Ee(i.info)}for(let e of t)ee(e)}function ke(e,t){if(!(!e?.style||!t))for(let n in t)ve(e,n,t[n])||s(`Failed to set style property '${n}'`)}function Ae(e,t){e&&(a(t)?De(e,`style`,t,function(t){ke(e,t)}):ke(e,t))}const N=new WeakMap,je=new WeakSet;function Me(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 Ne(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Pe(e){if(e.className&&!N.has(e)){let t=new Set;Me(t,e.className),N.set(e,t)}je.add(e)}function Fe(e){return je.has(e)}function Ie(e,t){if(!t)return;let n=N.get(e);n||(n=new Set,N.set(e,n)),Me(n,t)}function Le(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=Ne(n);return}let r=Ne(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 Re(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;Me(r,n),Me(r,t),e.className=Ne(r)}else e.className=t}function ze(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&&v(a,{resolver:e,lastValue:i,sanitize:n}),a}function Be(e){let t=[];for(let n of m){let r=n.deref();if(r===void 0){t.push(n);continue}let i=h.get(r);if(!i){t.push(n);continue}let a=i.info;if(!M(r)){h.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)b(e)}function Ve(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){Re(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 He(e,t,n,r=!1){if(n!=null){if(t===`style`){Ae(e,n);return}if(a(n)){let r=String(t);if(r.charCodeAt(0)===111&&r.charCodeAt(1)===110){e[r]=n;return}if(n.length===0){let t=n;r===`className`&&e instanceof HTMLElement?(Pe(e),De(e,r,t,function(t){Le(e,String(t||``))})):De(e,r,t,function(t){Ve(e,r,t,!1)});return}}if(t===`className`&&e instanceof HTMLElement&&Fe(e)){let t=String(n||``);t&&(Ie(e,t),Re(e,t));return}Ve(e,String(t),n,r)}}function Ue(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];He(e,i,a,n&&i===`className`)}}let P=!1,We=new WeakMap;function F(){return P}function Ge(){return!1}function Ke(){P=!0,We=new WeakMap}function qe(){P=!1}function Je(e){let t=P;P=!1;try{return e()}finally{P=t}}function I(e){let t=We.get(e);return t===void 0?e.firstChild:t}function L(e,t){We.set(e,t)}function Ye(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function Xe(e){let t=I(e),n=!1;for(;t&&Ye(t);)t=t.nextSibling,n=!0;n&&L(e,t)}function R(e){let t=I(e);return t&&L(e,t.nextSibling),t}function Ze(e,t){if(!P)return null;Xe(e);let n=I(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?R(e):null}function Qe(e,t){if(!t)return;let n=I(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}L(e,null)}const z=new WeakMap;function $e(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function et(e){Xe(e);let t=I(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function tt(e,t){let n=I(e);if(n&&n.nodeType===3)return R(e),n.textContent!==t&&(n.textContent=t),n;let r=k(t);return r?(e.insertBefore(r,n),L(e,n),r):null}function B(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=z.get(i);if(t||(t={value:i(),error:!1},z.set(i,t)),t.error)return rt(c,()=>``);let n=t.value;if($e(n))return Ue(r,{className:()=>{let e=i();return $e(e)?e.className:``}}),null;if(e(n)){let e=i,t=n??``;if(F()&&et(r)){let n=r;R(n);let i=String(t),a=tt(n,i);return a&&v(a,{resolver:e,lastValue:i,sanitize:!0}),null}return rt(c,e,t,!0)}return null}catch(e){return z.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),rt(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?it(c,a):t(a)?a:(n(a)&&Ue(r,a),null)}let l=i;if(e(l)){if(F()&&et(r)){let e=r;return R(e),tt(e,String(l)),null}return it(c,l)}return t(l)?l:(Ue(r,l),null)}function nt(e,t){if(c&&!F()&&!Ge())return t;let n=oe();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=j(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function rt(e,t,n,r){return nt(e,ze(t,n,r))}function it(e,t){return nt(e,k(String(t)))}const at=Symbol(`nuclo.factory.tag`),ot=Symbol(`nuclo.factory.mods`);let V=0;const st=[];let ct=0;function lt(){return ct>=st.length&&st.push(()=>null),st[ct++]}function ut(e,t,n){e[at]=t,e[ot]=n}function H(e){return typeof e==`function`?e[ot]:void 0}function U(e){return typeof e==`function`?e[at]:void 0}function dt(){return V>0}function ft(e,t,n){let r=V===0;V++,r&&(ct=0);try{return e(t,n)}finally{V--}}function pt(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=B(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function mt(e,t){let n=ie(e);if(!n)throw Error(`Failed to create element: ${e}`);return pt(n,t,0),n}function ht(e,t){let n=ae(re,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return pt(n,t,0),n}function gt(e,t){if(dt()){let n=lt();return ut(n,e,t),n}let n=function(n,r=0){let i=n,a=i?Ze(i,e):null,o=a??ie(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return pt(o,t,r),a&&Qe(s,c),o};return ut(n,e,t),n}function _t(e,t){if(dt()){let n=lt();return ut(n,e,t),n}return function(n,r=0){let i=n,a=i?Ze(i,e):null,o=a??ae(`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 pt(o,t,r),a&&Qe(s,c),o}}function vt(e){return(...t)=>gt(e,t)}function yt(e){return(...t)=>_t(e,t)}const bt=`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(`.`),xt=`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(`.`),St=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function Ct(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 wt(e,t){t in e&&typeof e[t]!=`function`||(Ct(e,t,()=>vt(t)),t===`var`&&Ct(e,`var_`,()=>vt(t)))}function Tt(e,t){let n=`${t}Svg`;n in e||Ct(e,n,()=>yt(t))}function Et(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<xt.length;t++)Tt(e,xt[t]);for(let t=0;t<bt.length;t++)wt(e,bt[t]);e[t]=!0}}function Dt(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function Ot(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110}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=H(a);if(e!==void 0){let t=U(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(),z.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`){if(Ot(r)){o.push({key:r,kind:1,prop:!1});continue}if(r===`className`&&a.length===0){if(i++)return null;o.push({key:r,kind:2,prop:!1});continue}return null}if(s===`object`||r===`className`&&i++)return null;o.push({key:r,kind:0,prop:!1,value:a})}r.push({kind:0,keys:o});continue}r.push({kind:1})}return{tag:e,slots:r}}function 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}}}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;n[a.key]=o;break;case 2:{if(typeof o!=`function`||o.length!==0)return!1;let e=o,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),r.push({kind:1,node:n,fn:e,last:i});break}case 3:if(o!=null)return!1}}break}case 1:if(s==null||typeof s==`object`||typeof s==`function`||!a)return!1;a.nodeValue=String(s),a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||H(s)!==void 0||!a)return!1;let e;try{e=s()}catch{return!1}if(e!=null&&(typeof e==`object`||typeof e==`function`))return!1;let t=e==null?``:String(e),n=a;n.nodeValue=t,r.push({kind:0,node:n,fn:s,last:t}),a=n.nextSibling;break}case 3:{let e=H(s);if(e===void 0||U(s)!==o.child.tag||!a||!jt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1}}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;S(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;x(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=H(s);if(e===void 0||U(s)!==o.child.tag||!a||!Mt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1}}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 Ft=new Set,It=new WeakMap,Lt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Ft.delete(e)}):null;let Rt=0;function zt(e,t){let n=new WeakRef(e);Ft.add(n),It.set(e,t),Lt?.register(e,n)}function Bt(e){return Array.isArray(e)?e:Array.from(e)}function Vt(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function Ht(e,t,n){let r=e.renderItem(t,n);return Vt(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):Dt(r,e.host,n)}function Ut(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=c&&!F()&&!Ge(),a=r&&i?ft(e.renderItem,t,n):e.renderItem(t,n);if(Vt(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=H(a);if(i!==void 0){if(r===void 0){let t=U(a),r=t?kt(t,i):null,o=Dt(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,Ht(e,t,n))}if(r===void 0)e.template=null;else return e.template=null,Ht(e,t,n)}return Dt(a,e.host,n)}function Wt(e){A(e.element)}function Gt(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 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 qt(e,t,n,r,i,a,o){let s=oe(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Ut(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 Jt(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=Bt(e.itemsProvider());if(Pt(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!Gt(a,r,t,n))for(let e=0;e<o;e++)Wt(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)qt(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];qt(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++)Wt(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(!Gt(a,r,t,n))for(let e=0;e<o;e++)Wt(a[e]);let c=[];qt(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]||Wt(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=Kt(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=Ut(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||=oe(),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 Yt(e,t,n,r){return F()?Zt(e,t,n,r):Xt(e,t,n,r)}function Xt(e,t,n,r){let{start:i,end:a}=de(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Jt(o),c&&zt(i,o),o}function Zt(e,t,n,r){let i=n;Xe(i);let a=I(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return Xt(e,t,n,r);let o=R(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=j(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return Xt(e,t,n,r);let d=Bt(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=Vt(r)?r:null,a=i?i.element:Dt(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=I(i);for(;p&&p!==u;){let e=p.nextSibling;A(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}L(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return c&&zt(o,h),h}function Qt(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 $t(e){let t=[];Rt++;for(let n of Ft){let r=n.deref();if(!r){t.push(n);continue}let i=It.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){Qt(i),It.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=Rt;try{Jt(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===Rt)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===Rt)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&Nt(n)}}for(let e of t)Ft.delete(e)}function en(e,t){return function(n,r){return Yt(e,t,n,r).startMarker}}function tn(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function nn(e,t){return typeof e==`function`?tn(e,t):!!e}const rn=new Set,an=new WeakMap,on=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{rn.delete(e)}):null;function sn(e,t){for(let t=0;t<e.length;t++)if(nn(e[t].condition))return t;return t.length>0?-1:null}function cn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=sn(t,n);o===e.activeIndex||(fe(e.startMarker,e.endMarker),e.activeIndex=o,o===null)||pe(fn(o>=0?t[o].content:n,r,i,a),a)}function ln(e){let t=new WeakRef(e.startMarker);rn.add(t),an.set(e.startMarker,e),on?.register(e.startMarker,t)}function un(e){let t=[];for(let n of rn){let r=n.deref();if(r===void 0){t.push(n);continue}let i=an.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){an.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),an.delete(r),t.push(n)}}for(let e of t)rn.delete(e)}function dn(e,t,n,r){return a(e)?o(e)?(z.delete(e),B(t,e,n)):_e(t,r,()=>{let r=B(t,e,n);return r&&!r.parentNode?r:null}):B(t,e,n)}function fn(e,t,n,r){let i=[];for(let a of e){let e=dn(a,t,n,r);e&&i.push(e)}return i}function pn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function mn(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var hn=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}=de(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=ge(e);return a.appendChild(n),a.appendChild(r),cn(i),n.textContent=pn(t,i.activeIndex),n}hydrateRender(e,t){let n=e;Xe(n);let r=I(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=R(n),a=0,o=I(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=j(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=sn(this.groups,this.elseContent),u=mn(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)B(e,r,t)}}else if(fe(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;Je(()=>{pe(fn(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(){cn(a)}};return c&&ln(a),a}};function gn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return gn(e.cloneWith({condition:t,content:n}))},else:function(...t){return gn(e.cloneWith(void 0,t))}})}function _n(e,...t){return gn(new hn(e,...t))}function vn(e){try{return e.isSvg?ht(e.tagName,e.modifiers):mt(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=ae(re,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=ie(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function yn(e){let t=ne(e);if(!t)return;let n=tn(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=vn(t);D(n,t),he(e,n)}else if(!n&&r){let n=ue(t.tagName);n&&(D(n,t),he(e,n))}}function bn(e){if(c)try{let t=te();for(let n of t){if(!n.isConnected){O(n);continue}e&&!e.contains(n)||yn(n)}}catch(e){s(`Error during conditional elements update`,e)}}const xn=new Map;function Sn(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 Cn(e,t){let n=xn.get(e);n||(n=new Set,xn.set(e,n)),n.add(new WeakRef(t))}function wn(e){let t=Sn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=xn.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&&xn.delete(e)}return Array.from(n)}function Tn(...e){let t=Sn(e);return function(e){if(c&&e instanceof Element)for(let n of t)Cn(n,e)}}const En=[$t,un,bn,Oe,Be,On];function Dn(...e){let t;if(e.length>0){let n=wn(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 En)e(t)}function On(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 kn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function An(e,t){let n=t||document.body,r=n;Ke();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=I(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),A(e),L(r,t)}else r.appendChild(i),L(r,null)}return t}finally{qe()}}let jn=null;function Mn(e){jn=e}const Nn=new Map,W=new Map,Pn=new Set,Fn=[],G=new Map;let In=0,K=null,q=null,Ln=null,J=0;const Y=new Map;let X=null,Rn=!1;function zn(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 Y.set(t,r),Y.set(Z(r),r),r}catch{return null}}function Z(e){let t=e.cssText,n=t.indexOf(`{`);return(n===-1?t:t.slice(0,n)).trim()}function Vn(e){return e instanceof CSSStyleRule?e.selectorText:Z(e)}function Hn(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function Un(e,t){if(!X)return;let n=Hn(t,Vn(e)),r=X.get(n);r||(r=new Set,X.set(n,r)),r.add(e.cssText)}function Wn(e,t){if(!X)return!1;let n=Hn(t,Vn(e)),r=X.get(n);return r?.delete(e.cssText)?(r.size===0&&X.delete(n),X.size===0&&(X=null),!0):!1}function Gn(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof CSSStyleRule){Un(n,void 0);continue}let r=Z(n);if(`cssRules`in n&&!r.startsWith(`@keyframes`)){let e=n;Rn=!0,Y.set(r,e);for(let t=0;t<e.cssRules.length;t++)Un(e.cssRules[t],r)}else Un(n,void 0)}}function Kn(e,t){try{e.insertRule(t,J);let n=e.cssRules[J];if(Wn(n,void 0)){e.deleteRule(J);return}J++}catch{}}function qn(e,t){try{let n=e.cssRules.length;e.insertRule(t,n);let r=e.cssRules[n];Wn(r,Z(e))&&e.deleteRule(n)}catch{}}function Jn(e,t){let n=Y.get(t);if(n)return n;if(!Rn)return Bn(e,t);try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=Z(e.cssRules[n]);e.deleteRule(n);let i=Y.get(r);if(i)return Y.set(t,i),i}catch{return null}return Bn(e,t)}function Yn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(q&&Ln===document&&q.ownerNode&&q.ownerNode.isConnected)return q;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)),q=t.sheet,Ln=document,Y.clear(),J=0,X=null,Rn=!1,!q)return null;if(q.cssRules.length>0){let e=0;for(;e<q.cssRules.length;){let t=q.cssRules[e];if(!(t instanceof CSSStyleRule)&&`cssRules`in t&&!Z(t).startsWith(`@keyframes`))break;e++}J=e,X=new Map,Gn(q.cssRules)}for(let e of Fn)Kn(q,e);for(let[e,t]of G){let n=Jn(q,e);if(n)for(let e of t)qn(n,e)}return q}function Xn(e,t){let n=Yn();if(t===void 0)Fn.push(e);else{let n=G.get(t);n||(n=[],G.set(t,n)),n.push(e)}if(K=null,n)if(t===void 0)Kn(n,e);else{let r=Jn(n,t);r&&qn(r,e)}jn?.(t===void 0?e:t+`{`+e+`}`)}function Zn(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 Qn(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function $n(e,t){return e+t.length+`:`+t}function er(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 tr(e,t){let n=`.`+e;return n+er(t,n)}function nr(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 rr(e,t,n,r,i=!1){let a=``,o=Qn(e,t);for(let[e,t]of n)a+=(a?`;`:``)+e+`:`+t,o=$n($n(o,e),t);r!==void 0&&!nr(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`+$n(``,r)+o,c=Nn.get(s);return c===void 0?(r===void 0?c=`n`+Zn(s):(c=i?r:r+`-`+Zn(s),W.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.`)),Nn.set(s,c),W.set(c,{query:e,suffix:t,decls:n,name:r}),Xn(tr(c,t)+`{`+a+`}`,e),c):(Yn(),c)}function ir(e,t,n,r,i=!1){return rr(e,t,n,r,i)}function ar(e,t){let n=W.get(e),r=W.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 rr(n.query,n.suffix,o,n.name??r.name)}function or(e){let t=W.get(e);return t===void 0?void 0:Qn(t.query,t.suffix)}function sr(){return In}function cr(e,t){if(Pn.has(e)){Yn();return}Pn.add(e),Xn(t,void 0)}function lr(){if(K!==null)return K;let e=Fn.join(``);for(let[t,n]of G)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return K=e,e}function ur(){Nn.clear(),W.clear(),Pn.clear(),Fn.length=0,G.clear(),Y.clear(),K=null,J=0,q=null,Ln=null,X=null,Rn=!1,In++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const dr={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`},fr={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`]},pr={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`}},mr={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`},hr=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`]),gr=new Map;function _r(e){let t=gr.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),gr.set(e,t)),t}function vr(e){return e.charCodeAt(0)===64?e:`@media `+e}function yr(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Q(e,t){for(let n in t){let r=t[n],i=e[n];e[n]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof i==`object`&&i&&!Array.isArray(i)?Q({...i},r):r}return e}function br(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function xr(e,t){let n=or(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,ar(r,t))}function Sr(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&&xr(t,e.slice(n,r)),n=r+1)}}function Cr(e,t){for(let n of e)n&&(typeof n==`string`?Sr(n,t):Array.isArray(n)?Cr(n,t):Sr(n.className,t))}function wr(...e){let t=new Map;Cr(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return br(n)}function Tr(e={}){let t=e.screens??{};zn(Object.values(t).map(vr));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||hr.has(t)?String(n):n+`px`;let r=mr[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=dr[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,yr(n,vr(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,er(c,`&`+o).slice(1),s);continue}if(d===64){a(l,yr(n,c),o,s);continue}continue}if(l===!0){let e=pr[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=fr[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=_r(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 br(``);let s=sr(),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(ir(e.query,e.suffix,e.decls,o,t))}let d=br(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=pr[t];if(e)for(let t in e)n(t,e[t]);continue}let a=fr[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=_r(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`+Zn(t);return cr(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;cr(`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=Q(f,a));for(let e of r){let t=l[e];if(t!==void 0){let r=n[e][t];r&&(f=Q(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=Q(f,e.style))}let p=o(f);return c.set(u,p),p}}return{css:o,cx:wr,variants:u,keyframes:c,globalStyle:l,theme:e}}let Er;function $(){return Er??=Tr({})}const Dr=(e,t)=>typeof e==`string`?$().css(e,t):$().css(e),Or=e=>$().variants(e),kr=e=>$().keyframes(e),Ar=(e,t)=>$().globalStyle(e,t);function jr(){Et();let e=globalThis;e.list=en,e.update=Dn,e.when=_n,e.on=p,e.scope=Tn,e.render=kn,e.hydrate=An,e.createCss=Tr,e.css=Dr,e.cx=wr,e.variants=Or,e.keyframes=kr,e.globalStyle=Ar}jr(),exports.HTML_TAGS=bt,exports.SELF_CLOSING_TAGS=St,exports.SVG_TAGS=xt,exports.appendChildren=me,exports.applyAttributes=Ue,exports.applyNodeModifier=B,exports.createComment=j,exports.createConditionalComment=ue,exports.createCss=Tr,exports.createHtmlElementWithModifiers=mt,exports.createHtmlTagBuilder=vt,exports.createSvgElementWithModifiers=ht,exports.createSvgTagBuilder=yt,exports.css=Dr,exports.cx=wr,exports.getCssText=lr,exports.globalStyle=Ar,exports.hydrate=An,exports.initializeRuntime=jr,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=kr,exports.list=en,exports.on=p,exports.registerGlobalTagBuilders=Et,exports.render=kn,exports.replaceNodeSafely=he,exports.resetStyles=ur,exports.scope=Tn,exports.setSSRCollector=Mn,exports.update=Dn,exports.variants=Or,exports.when=_n;
2
2
  //# sourceMappingURL=nuclo.cjs.map