smbls 3.14.340 → 3.14.342

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # smbls
2
2
 
3
+ ## 3.14.342
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-generated cross-repo patch release.
8
+
3
9
  ## 3.14.340
4
10
 
5
11
  ### Patch Changes
package/dist/smbls.cjs CHANGED
@@ -38,7 +38,7 @@ FROM ${a}${l}`},OS=t=>{let e=[],r=(n,o)=>{for(let s in n){let i=o?`${o}/${s}`:s;
38
38
  `).slice(0,6).join(`
39
39
  `):"")}}if(Hp(s,e,o),e&&(e[s.key]=s,e.__ref?.__children&&(e.__ref.__children.includes(s.key)||e.__ref.__children.push(s.key))),typeof s.html=="function"&&s.node&&!s.node.innerHTML){let g=s.context?.designSystem;g&&ct(g);try{let m=s.html(s,s.state,s.context);m!=null&&typeof m!="function"&&(s.node.innerHTML=m)}catch{}finally{g&&ot()}}if(Ze("Create",s,n),Ze("Complete",s,n),Ze("Render",s,n),Ze("RenderRouter",s,n),typeof s.onFrame=="function"){let g=s.onFrame,m=s.context?.designSystem,y=()=>{if(s.node){if(s.node.isConnected){m&&ct(m);try{g(s,s.state,s.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{m&&ot()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return s}function a0(t,e,r){let n=!e,o=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)&&Object.keys(r.state).length===0,s=n&&o&&t.context?.state,i=r.state!==void 0&&!s?r.state:t.state&&!et(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Dt(t,t.state);else if(t.context?.state){let a=t.context.state,c={...a},l=t.context?.polyglot;if(l?.translations){let f=a.lang||l.defaultLang||"en",p=l.translations[f];if(p&&typeof p=="object")for(let d in p)c[d]===void 0&&(c[d]=p[d]);let u=new Set(l.languages||[]);for(let d in l.translations)!u.has(d)&&c[d]===void 0&&(c[d]=l.translations[d])}t.state=et(c)?c:Pt(c),t.state.__element=t,t.state.root=t.state,Dt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Dt(t,t.state);return}if(typeof i=="string"){if(t.state=wm(i,e),t.state&&typeof t.state=="object"&&!et(t.state)){let a=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:a,enumerable:!1,configurable:!0,writable:!0})}Dt(t,t.state);return}if(typeof i=="function"){let a=i(t,e?.state);t.state=et(a)?a:Pt(a||{})}else et(i)?t.state=i:t.state=Pt({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,Dt(t,t.state)}function Mp(t,e){if(!e)return t;let r=e.split("/"),n=t;for(let o of r){if(n==null)return{};n=n[o]}return n??{}}function wm(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let o=t.slice(3);return o?Mp(e.state,o):e.state??{}}if(t.startsWith("~/")){let o=e.state?.root||e.state,s=t.slice(2);return s?Mp(o,s):o??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=Mp(e.state,t);if(r!=null&&Object.keys(r).length>0)return r;let n=e.context?.polyglot;if(n?.translations){let o=e.state?.root?.lang||n.defaultLang||"en",s=n.translations[o];if(s?.[t]!==void 0)return s[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function c0(t){let e=t.__ref,r=t.tag||"div",n=t.context?.designSystem,o=[],s=Object.keys(t);for(let i=0;i<s.length;i++){let a=s[i];if(typeof t[a]!="function"||_t.has(a))continue;let c=a.charCodeAt(0);c>=65&&c<=90||dn(a)||pt[a]||yt&&yt.has(a)||Xe(r,a)||o.push({prop:a,fn:t[a]})}for(let i=0;i<o.length;i++){let{prop:a,fn:c}=o[i];e.__exec[a]=c,Object.defineProperty(t,a,{get(){n&&ct(n);try{return c(t,t.state,t.context)}catch{return}finally{n&&ot()}},set(l){delete e.__exec[a],Object.defineProperty(t,a,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Vp(t,e){let r=t.__ref;if(c0(t),typeof t.text=="function"){let o=t.text,s=at(()=>{if(!r.contentManaged)try{let i=o(t,t.state,t.context);t.node&&i!=null&&typeof i!="function"&&typeof i!="object"&&(typeof i=="string"&&i.includes("{{")&&(i=lr.call(t,i,t.state)),t.tag==="string"?t.node.nodeValue=i:t.node.textContent=i)}catch{}},{depth:r.path.length});r.__effects.push(s),r.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){let o=t.text,s=at(()=>{if(r.contentManaged)return;let i=lr.call(t,o,t.state);i!=null&&(t.text=i),t.node&&(t.tag==="string"?t.node.nodeValue=i??"":t.node.textContent=i??"")},{depth:r.path.length});r.__effects.push(s),r.__exec.text=o}for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!_t.has(o)&&!dn(o)&&!r.__exec[o]){if(pt[o]){let s=t[o],i=o,a,c=at(()=>{let l=t.context?.designSystem;l&&ct(l);try{let f=s(t,t.state,t.context),p=pt[i](f,t,t.state,t.context);if(p&&t.node){let u=Sm(p);(u===null||u!==a)&&(a=u,pn(t.node,p))}else t.node&&(i==="show"||i==="hide")&&(a=void 0,t.node.style.display="")}finally{l&&ot()}},{depth:r.path.length});r.__effects.push(c),r.__exec[o]=s}else if(yt&&yt.has(o)){let s=t[o],i=o,a,c=at(()=>{let l=t.context?.designSystem;l&&ct(l);try{let f=s(t,t.state,t.context);if(t.node)if(f!=null){let p=i+":"+String(f);p!==a&&(a=p,pn(t.node,{[i]:f}))}else a=void 0,t.node.style[i]=""}finally{l&&ot()}},{depth:r.path.length});r.__effects.push(c),r.__exec[o]=s}}if(typeof e.html=="function"){let o=e.html,s=at(()=>{let i=t.context?.designSystem;i&&ct(i);try{let a=o(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&(t.node.innerHTML=a)}finally{i&&ot()}},{depth:r.path.length});r.__effects.push(s),r.__exec.html=o}if(typeof e.value=="function"){let o=e.value,s=at(()=>{try{let i=o(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let a=i==null?"":String(i);if(t.node.value===a)return;let c=typeof document<"u"&&document.activeElement===t.node,l=c&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,f=c&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=a,c&&l!=null&&f!=null)try{t.node.setSelectionRange(l,f)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(s),r.__exec.value=o}if(typeof e.style=="function"){let o=e.style,s,i=at(()=>{let a=o(t,t.state,t.context),c=Sm(a);(c===null||c!==s)&&(s=c,pn(t.node,a))},{depth:r.path.length});r.__effects.push(i),r.__exec.style=o}else if(t.style&&typeof t.style=="object")for(let o in t.style){let s=t.style[o];if(typeof s!="function")continue;let i,a=at(()=>{try{let c=s(t,t.state,t.context);if(t.node){let l=o+":"+String(c);l!==i&&(i=l,pn(t.node,{[o]:c}))}}catch{}},{depth:r.path.length});r.__effects.push(a)}if(t.attr&&typeof t.attr=="object"){for(let o in t.attr)if(typeof t.attr[o]=="function"){let s=t.attr[o],i=o,a=at(()=>{try{let c=s(t,t.state,t.context);t.node?.setAttribute&&(c==null||c===!1?t.node.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&t.node.setAttribute(i,c===!0?"":c))}catch{}},{depth:r.path.length});r.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s!="function")continue;let i="aria-"+o.replace(/[A-Z]/g,c=>"-"+c.toLowerCase()),a=at(()=>{try{let c=s(t,t.state,t.context);if(!t.node?.setAttribute)return;c==null||c===!1?t.node.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&t.node.setAttribute(i,c===!0?"":c)}catch{}},{depth:r.path.length});r.__effects.push(a)}if(t.data&&typeof t.data=="object")for(let o in t.data){let s=t.data[o];if(typeof s!="function")continue;let a="data-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),c=at(()=>{try{let l=s(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(a):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(a,l===!0?"":l)}catch{}},{depth:r.path.length});r.__effects.push(c)}let n=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(n)for(let o in n){let s=n[o];if(typeof s!="function")continue;let i=at(()=>{try{let a=s(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:r.path.length});r.__effects.push(i)}if(typeof e.if=="function"){let o=e.if,s=at(()=>{let i;try{i=o(t,t.state,t.context)}catch(c){if(i=!1,r.__ifError=c,typeof console<"u"&&console.warn){let l=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${l} \u2014 treating as false:`,c?.message||c)}return}let a=r.__if;if(r.__if=!!i,a&&!r.__if&&t.node)t.node.remove();else if(!a&&r.__if)if(r.__ifInitialized){t.node||(t.node=Ge(t)),t.node&&(t.node.ref=t);let c=t.parent,l=c?.node;if(l&&t.node){let f=null,p=Object.keys(c),u=p.indexOf(t.key);for(let d=u+1;d<p.length;d++){let h=c[p[d]];if(h?.node?.parentNode===l){f=h.node;break}}f?l.insertBefore(t.node,f):l.appendChild(t.node)}else Hp(t,t.parent);Up(t)}else{if(r.__ifInitialized=!0,t.tag||(t.tag=He(t)),Ze("Init",t,{}),t.node||(t.node=Ge(t)),!t.node)return;Ze("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Cm(t,{});let c=e.if;delete e.if;try{Vp(t,e)}finally{e.if=c}Up(t),km(t),Am(t,{}),Hp(t,t.parent)}},{depth:r.path.length});r.__effects.push(s)}for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||_t.has(o)||typeof t[o]!="function")continue;let s=o.charCodeAt(0);if(s>=65&&s<=90||dn(o))continue;let i=t[o];r.__exec[o]=i;let a=t.tag||"div";if(Xe(a,o)&&!pt[o]&&!(yt&&yt.has(o))){let c=o,l=at(()=>{try{let f=i(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1?t.node.removeAttribute(c):typeof f!="function"&&typeof f!="object"&&(c==="src"&&"src"in t.node?t.node.src=f:t.node.setAttribute(c,f===!0?"":f)))}catch{}},{depth:r.path.length});r.__effects.push(l)}}u0(t),p0(t)}function Up(t){let{node:e}=t;if(e){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?e.nodeValue=t.text:e.textContent=t.text:typeof t.text=="number"&&(e.textContent=t.text),h0(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){let r=String(t.value);e.value!==r&&(e.value=r)}if(t.style&&typeof t.style=="object"&&pn(e,t.style),t.attr&&typeof t.attr=="object")for(let r in t.attr){let n=t.attr[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.setAttribute&&e.setAttribute(r,n===!0?"":n)}if(t.data&&typeof t.data=="object")for(let r in t.data){let n=t.data[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.dataset&&(e.dataset[r]=n===!0?"":n)}if(t.classlist||t.class){let r=t.classlist||t.class;if(typeof r=="string")r.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof r=="object")for(let n in r){let o=typeof r[n]=="function"?r[n](t,t.state,t.context):r[n];o&&e.classList.add(typeof o=="string"?o:n)}}}}function Sm(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function pn(t,e){if(!t||!e||!t.style)return;let r=null;for(let n in e){let o=e[n];if(o!=null){if(n.charAt(0)==="&"&&typeof o=="object"){r||(r={}),r[n]=o;continue}try{let s=String(o),i=n.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),a=s.trim(),c=/\s*!important\s*$/.test(a),l=a.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,c?"important":"")}catch{}}}r&&f0(t,r)}var l0=0;function f0(t,e){let r=`_ds${l0++}`;t.classList.add(r);let n=t.ownerDocument,o=n.querySelector("style[data-smbls-scoped]");o||(o=n.createElement("style"),o.setAttribute("data-smbls-scoped",""),n.head.appendChild(o));let s="";for(let i in e){let a="."+r,c=i.replace(/&/g,a).split(",").map(f=>{let p=f.trim();return p.includes(a)?p:a+p}).join(", "),l=e[i];if(typeof l=="object"){let f="",p="";for(let u in l){let d=l[u];if(typeof d=="object"){let h=u.includes("&")?c.split(", ").map(m=>u.replace(/&/g,m)).join(", "):c.split(", ").map(m=>`${m} ${u}`).join(", "),g="";for(let m in d)g+=`${m.replace(/[A-Z]/g,y=>"-"+y.toLowerCase())}: ${d[m]};`;p+=`${h} { ${g} }
40
40
  `}else f+=`${u.replace(/[A-Z]/g,h=>"-"+h.toLowerCase())}: ${d};`}f&&(s+=`${c} { ${f} }
41
- `),p&&(s+=p)}}s&&(o.textContent+=s)}function u0(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],a=s.slice(1),c={value:!1},l=at(()=>{let f=t.state&&(et(t.state)?t.state.root:null);if(!f||!et(f))return;let p=f;p=p[i];for(let u=0;u<a.length&&!(p==null||typeof p!="object");u++)if(et(p))p=p[a[u]];else break;if(c.value&&typeof t.onUpdate=="function"){let u=t.context?.designSystem;u&&ct(u);try{t.onUpdate(t,t.state,t.context)}catch(d){t.context?.plugins?.length&&Mt("error",t,{hook:"onUpdate",error:d})||console.error("[DOMQL] subscribeTo onUpdate error:",d)}finally{u&&ot()}}},{depth:r.path.length});c.value=!0,r.__effects.push(l)}}function p0(t){let e=t.__ref;e.__conditionalRunners=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=r.charAt(0);if(n!=="."&&n!=="!")continue;let o=r.slice(1);if(!o)continue;let s=t[r];if(!s||typeof s!="object")continue;let i=n==="!",a={lastMatch:!1,appliedKeys:null},c=()=>{if(!t.node)return;let f,p=t[o];if(p===void 0)if(t.state&&o in t.state)f=t.state[o];else{let h=t.context?.cases?.[o];if(h===void 0)return;try{f=typeof h=="function"?h.call(t,t):h}catch(g){f=!1,e.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}}else if(typeof p=="function")try{f=p(t,t.state,t.context)}catch(h){f=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else f=p;let u=i?!f:!!f;if(u===a.lastMatch)return;a.lastMatch=u;let d=t.context?.designSystem;d&&ct(d);try{if(u){let h={};for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m))continue;let y=typeof s[m]=="function"?s[m](t,t.state,t.context):s[m];if(y!=null)if(pt[m]){let b=pt[m](y,t,t.state,t.context);if(b){let w=Array.isArray(b)?b:[b];for(let x of w)x&&Object.assign(h,x)}}else yt&&yt.has(m)&&(h[m]=y)}let g=Object.keys(h);g.length?(pn(t.node,h),a.appliedKeys=g):a.appliedKeys=null}else if(a.appliedKeys){for(let h of a.appliedKeys)t.node.style[h]="";a.appliedKeys=null}}finally{d&&ot()}};e.__conditionalRunners.push(c);let l=at(c,{depth:e.path.length});e.__effects.push(l)}}var Np=new WeakSet;function d0(t){let e=t.ownerDocument;!e||Np.has(e)||(Np.add(e),queueMicrotask(()=>{Np.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var jp=new WeakSet;function h0(t){let{node:e}=t;if(!e)return;if(jp.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}jp.add(t);let r=t.context?.designSystem;r&&ct(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||_t.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!dn(s)){if(pt[s]){let a=t[s],c=pt[s](a,t,t.state,t.context);if(c){if(Array.isArray(c))for(let l of c)l&&Object.assign(n,l);else Object.assign(n,c);o=!0}}else if(yt&&yt.has(s)){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charCodeAt(0)===45){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="&"){let a=t[s];a&&typeof a=="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"){let c={};for(let l in a){let f=a[l];if(typeof f=="function"&&(f=f(t,t.state,t.context)),!(f==null||typeof f=="function"))if(pt[l]){let p=pt[l](f,t,t.state,t.context);if(p)if(Array.isArray(p))for(let u of p)u&&Object.assign(c,u);else Object.assign(c,p)}else c[l]=f}if(Object.keys(c).length){if(s.length>1&&s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")&&!s.startsWith("@supports")&&(s==="@dark"||s==="@light"||!t.context?.designSystem?.media?.[s.slice(1)])){let f={};for(let u in c){let d=c[u];f[u]=typeof d=="string"&&!d.includes("!important")?d+" !important":d}let p=s.slice(1);n[`[data-theme="${p}"] &`]=f}else{let f=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let u=s.slice(1),d=t.context?.designSystem?.media?.[u]||t.context?.designSystem?.media?.[u];d&&(f=`@media ${d}`)}let p={};for(let u in c){let d=c[u];if(d&&typeof d=="object"&&!Array.isArray(d)){let h={};for(let m in d)if(pt[m]){let y=pt[m](d[m],t,t.state,t.context);if(y)if(Array.isArray(y))for(let b of y)b&&Object.assign(h,b);else Object.assign(h,y)}else h[m]=d[m];let g=u.startsWith(":")?"":" ";if(f.includes(",")){let m=f.split(",").map(y=>`${y.trim()}${g}${u}`).join(", ");n[m]=h}else n[`${f}${g}${u}`]=h}else p[u]=d}Object.keys(p).length&&(n[f]=p)}o=!0}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=ke(n,null,t.context?.cssPrefix);if(s&&e.classList){let a=s.split(" ").filter(Boolean),c=!1;for(let l of a)e.classList.add(l),c||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(c=!0);c&&d0(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let a=n.display;if(a&&a!==i)if(i==="none"){let c=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&c.push(l);for(let l of c)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&ot(),jp.delete(t)}}function km(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=Lp(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||_t.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!dn(o)&&!(pt[o]||yt&&yt.has(o))&&Xe(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=lr(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function g0(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var vm=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Cm(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!dn(r)||vm.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(a){return t.call(s,a)}}if(typeof n!="function")continue;let o=s0(r);qe.has(o)||an(i0(o),t,n)}m0(t)}function m0(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let u of vm){let d=t[u];typeof d=="function"&&(r[u]=d,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,a=0,c=0,l=!1,f=u=>{let d=u.touches&&u.touches[0]||u.changedTouches&&u.changedTouches[0];d&&(i=d.clientX,a=d.clientY,c=Date.now(),l=!0)},p=u=>{if(!l)return;l=!1;let d=u.changedTouches&&u.changedTouches[0]||u.touches&&u.touches[0];if(!d)return;let h=d.clientX-i,g=d.clientY-a,m=Date.now()-c;if(m>s)return;let y=Math.abs(h),b=Math.abs(g);if(Math.max(y,b)<o)return;let w;if(y>b*1.2)w=h<0?"left":"right";else if(b>y*1.2)w=g<0?"up":"down";else return;let x="onSwipe"+w.charAt(0).toUpperCase()+w.slice(1),v=r[x],A=r.onSwipe;v&&v.call(t,u,t,t.state,t.context),A&&A.call(t,{direction:w,dx:h,dy:g,dt:m,event:u},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",p)}catch{}})}function zp(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=zp(o,s):r[n]=s}return r}function Wp(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=(t.context?.document||globalThis.document)?.createDocumentFragment();if(!s)return;let i=t.childProps,a=t.childrenAs;for(let c=0;c<e.length;c++){let l=e[c],f=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let p=i;if(typeof i=="function")try{p=i(t,l)}catch{p=null}if(a==="state"){let h=f;(typeof f=="string"||typeof f=="number")&&(h={value:f,text:f}),l=p?{...p,state:h}:{state:h}}else p&&(l=zp(p,l));if(n&&!l.ignoreChildExtends)if(l.extends){let h=Array.isArray(l.extends)?l.extends:[l.extends],g=Array.isArray(n)?n:[n];l={...l,extends:[...g,...h]}}else l={extends:n,...l};let u=l?.key||`${c}`,d=Wt(l,t,u,r);d?.node&&s.appendChild(d.node)}t.node.appendChild(s);return}if(typeof e=="string"){let o=wm(e,t);if(Array.isArray(o)){Wp(t,o,r);return}}if(typeof e=="object")for(let o in e){if(_t.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=zp(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],a=Array.isArray(n)?n:[n];s={...s,extends:[...a,...i]}}else s={extends:n,...s};Wt(s,t,o,r)}}}function Am(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let a=t.__ref,c=!1,l=at(()=>{let f=i(t,t.state,t.context);if(!c){c=!0;return}if(f===t.children)return;if(t.children=f,Array.isArray(f)&&t.childrenAs==="state"){let d=t.childProps,h=[],g=new Map;for(let v=0;v<f.length;v++){let A=f[v],P=d;if(typeof d=="function")try{P=d(t,A)}catch{P=null}let H=P&&P.key||A&&A.key||`${v}`;h.push(H),g.set(H,{rawChild:A,childProps:P})}let m=new Set(h),y=a.__children.slice();for(let v of y)if(!m.has(v)){let A=t[v];A?.remove&&A.remove(),delete t[v]}let b=t.childExtends,x=(t.context?.document||globalThis.document)?.createDocumentFragment();for(let v of h){let A=g.get(v),P=A.rawChild,H=t[v];if(H&&H.state){if(P&&typeof P=="object"){let N=H.state;if(typeof N.replace=="function")N.replace(P);else if(typeof N.update=="function"){for(let $ in N)if(!($==="__element"||$==="root"||$==="parent"||$==="update")&&!Object.prototype.hasOwnProperty.call(P,$))try{N[$]=void 0}catch{}N.update(P)}else for(let $ in P)N[$]=P[$]}continue}let O=P;(typeof P=="string"||typeof P=="number")&&(O={value:P,text:P});let M=A.childProps,V=M?{...M,state:O}:{state:O};if(b&&!V.ignoreChildExtends)if(V.extends){let N=Array.isArray(V.extends)?V.extends:[V.extends],$=Array.isArray(b)?b:[b];V={...V,extends:[...$,...N]}}else V={extends:b,...V};let tt=Wt(V,t,v,e);tt?.node&&x&&x.appendChild(tt.node)}x&&x.childNodes.length&&t.node&&t.node.appendChild(x),a.__children=h;return}for(let d of[...a.__children]){let h=t[d];h?.remove&&h.remove(),delete t[d]}a.__children=[],Wp(t,f,e)},{depth:a.path.length});a.__effects.push(l)}if(Wp(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let a=0;a<i.length;a++){let c=i[a];if(!c.endsWith("Extends")||typeof t[c]!="string")continue;let l=c.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[c]};delete t[c];for(let p=a+1;p<i.length;p++){let u=i[p],d=u.charCodeAt(0);if(d>=65&&d<=90||_t.has(u)||typeof t[u]=="function"&&(u.startsWith("on")||u.startsWith(".")))break;let h=t[u];h!==void 0&&(f[u]=h,delete t[u])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||_t.has(i)||typeof t[i]!="object"||t[i]===null)continue;let a=i.charCodeAt(0);if(a<65||a>90)continue;let c=t[i];if(!c.__ref){if(!c.extends&&!c.extend){let l=s[i]||s[`smbls.${i}`];l&&(c={extends:l,...c})}if(t.childProps&&(c={...t.childProps,...c}),o&&!c.ignoreChildExtends)if(c.extends){let l=Array.isArray(c.extends)?c.extends:[c.extends],f=Array.isArray(o)?o:[o];c={...c,extends:[...f,...l]}}else c={extends:o,...c};Wt(c,t,i,e)}}}function Hp(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let s=r.node.nextSibling;s?o.insertBefore(n,s):o.appendChild(n)}else o.appendChild(n)}function Ze(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Mt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let a=e.context?.designSystem;a&&ct(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&Mt("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&ot(),i&&(e.__ref.__inRender=!1)}}return!0}var Em={blue:"#213eb0",green:"#389d34",red:"#e15c55",yellow:"#EDCB38",orange:"#e97c16",transparent:"rgba(0, 0, 0, 0)",black:"black",gray:"#4e4e50",white:"white",title:["--gray 1 -168","--gray 1 +168"],caption:["--gray 1 -68","--gray 1 +68"],paragraph:["--gray 1 -42","--gray 1 +42"],disabled:["--gray 1 -26","--gray 1 +26"],line:["--gray 1 -16","--gray 1 +16"]},Tm={"gradient-blue-light":`linear-gradient(to right,
41
+ `),p&&(s+=p)}}s&&(o.textContent+=s)}function u0(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],a=s.slice(1),c={value:!1},l=at(()=>{let f=t.state&&(et(t.state)?t.state.root:null);if(!f||!et(f))return;let p=f;p=p[i];for(let u=0;u<a.length&&!(p==null||typeof p!="object");u++)if(et(p))p=p[a[u]];else break;if(c.value&&typeof t.onUpdate=="function"){let u=t.context?.designSystem;u&&ct(u);try{t.onUpdate(t,t.state,t.context)}catch(d){t.context?.plugins?.length&&Mt("error",t,{hook:"onUpdate",error:d})||console.error("[DOMQL] subscribeTo onUpdate error:",d)}finally{u&&ot()}}},{depth:r.path.length});c.value=!0,r.__effects.push(l)}}function p0(t){let e=t.__ref;e.__conditionalRunners=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=r.charAt(0);if(n!=="."&&n!=="!")continue;let o=r.slice(1);if(!o)continue;let s=t[r];if(!s||typeof s!="object")continue;let i=n==="!",a={lastMatch:!1,appliedKeys:null},c=()=>{if(!t.node)return;let f,p=t[o];if(p===void 0)if(t.state&&o in t.state)f=t.state[o];else{let h=t.context?.cases?.[o];if(h===void 0)return;try{f=typeof h=="function"?h.call(t,t):h}catch(g){f=!1,e.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}}else if(typeof p=="function")try{f=p(t,t.state,t.context)}catch(h){f=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else f=p;let u=i?!f:!!f;if(u===a.lastMatch)return;a.lastMatch=u;let d=t.context?.designSystem;d&&ct(d);try{if(u){let h={};for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m))continue;let y=typeof s[m]=="function"?s[m](t,t.state,t.context):s[m];if(y!=null)if(pt[m]){let b=pt[m](y,t,t.state,t.context);if(b){let w=Array.isArray(b)?b:[b];for(let x of w)x&&Object.assign(h,x)}}else yt&&yt.has(m)&&(h[m]=y)}let g=Object.keys(h);g.length?(pn(t.node,h),a.appliedKeys=g):a.appliedKeys=null}else if(a.appliedKeys){for(let h of a.appliedKeys)t.node.style[h]="";a.appliedKeys=null}}finally{d&&ot()}};e.__conditionalRunners.push(c);let l=at(c,{depth:e.path.length});e.__effects.push(l)}}var Np=new WeakSet;function d0(t){let e=t.ownerDocument;!e||Np.has(e)||(Np.add(e),queueMicrotask(()=>{Np.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var jp=new WeakSet;function h0(t){let{node:e}=t;if(!e)return;if(jp.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}jp.add(t);let r=t.context?.designSystem;r&&ct(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||_t.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!dn(s)){if(pt[s]){let a=t[s],c=pt[s](a,t,t.state,t.context);if(c){if(Array.isArray(c))for(let l of c)l&&Object.assign(n,l);else Object.assign(n,c);o=!0}}else if(yt&&yt.has(s)){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charCodeAt(0)===45){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="&"){let a=t[s];a&&typeof a=="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"){let c={};for(let l in a){let f=a[l];if(typeof f=="function"&&(f=f(t,t.state,t.context)),!(f==null||typeof f=="function"))if(pt[l]){let p=pt[l](f,t,t.state,t.context);if(p)if(Array.isArray(p))for(let u of p)u&&Object.assign(c,u);else Object.assign(c,p)}else c[l]=f}if(Object.keys(c).length){if(s.length>1&&s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")&&!s.startsWith("@supports")&&(s==="@dark"||s==="@light"||!t.context?.designSystem?.media?.[s.slice(1)])){let f={};for(let u in c){let d=c[u];f[u]=typeof d=="string"&&!d.includes("!important")?d+" !important":d}let p=s.slice(1);n[`[data-theme="${p}"] &`]=f}else{let f=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let u=s.slice(1),d=t.context?.designSystem?.media?.[u]||t.context?.designSystem?.media?.[u];d&&(f=`@media ${d}`)}let p={};for(let u in c){let d=c[u];if(d&&typeof d=="object"&&!Array.isArray(d)){let h={};for(let m in d)if(pt[m]){let y=pt[m](d[m],t,t.state,t.context);if(y)if(Array.isArray(y))for(let b of y)b&&Object.assign(h,b);else Object.assign(h,y)}else h[m]=d[m];let g=u.startsWith(":")?"":" ";if(f.includes(",")){let m=f.split(",").map(y=>`${y.trim()}${g}${u}`).join(", ");n[m]=h}else n[`${f}${g}${u}`]=h}else p[u]=d}Object.keys(p).length&&(n[f]=p)}o=!0}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=ke(n,null,t.context?.cssPrefix);if(s&&e.classList){let a=s.split(" ").filter(Boolean),c=!1;for(let l of a)e.classList.add(l),c||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(c=!0);c&&d0(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let a=n.display;if(a&&a!==i)if(i==="none"){let c=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&c.push(l);for(let l of c)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&ot(),jp.delete(t)}}function km(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=Lp(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||_t.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!dn(o)&&!(pt[o]||yt&&yt.has(o))&&Xe(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=lr(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function g0(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var vm=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Cm(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!dn(r)||vm.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(a){return t.call(s,a)}}if(typeof n!="function")continue;let o=s0(r);qe.has(o)||an(i0(o),t,n)}m0(t)}function m0(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let u of vm){let d=t[u];typeof d=="function"&&(r[u]=d,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,a=0,c=0,l=!1,f=u=>{let d=u.touches&&u.touches[0]||u.changedTouches&&u.changedTouches[0];d&&(i=d.clientX,a=d.clientY,c=Date.now(),l=!0)},p=u=>{if(!l)return;l=!1;let d=u.changedTouches&&u.changedTouches[0]||u.touches&&u.touches[0];if(!d)return;let h=d.clientX-i,g=d.clientY-a,m=Date.now()-c;if(m>s)return;let y=Math.abs(h),b=Math.abs(g);if(Math.max(y,b)<o)return;let w;if(y>b*1.2)w=h<0?"left":"right";else if(b>y*1.2)w=g<0?"up":"down";else return;let x="onSwipe"+w.charAt(0).toUpperCase()+w.slice(1),v=r[x],A=r.onSwipe;v&&v.call(t,u,t,t.state,t.context),A&&A.call(t,{direction:w,dx:h,dy:g,dt:m,event:u},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",p)}catch{}})}function zp(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=zp(o,s):r[n]=s}return r}function Wp(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=(t.context?.document||globalThis.document)?.createDocumentFragment();if(!s)return;let i=t.childProps,a=t.childrenAs;for(let c=0;c<e.length;c++){let l=e[c],f=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let p=i;if(typeof i=="function")try{p=i(t,l)}catch{p=null}if(a==="state"){let h=f;(typeof f=="string"||typeof f=="number")&&(h={value:f,text:f}),l=p?{...p,state:h}:{state:h}}else p&&(l=zp(p,l));if(n&&!l.ignoreChildExtends)if(l.extends){let h=Array.isArray(l.extends)?l.extends:[l.extends],g=Array.isArray(n)?n:[n];l={...l,extends:[...g,...h]}}else l={extends:n,...l};let u=l?.key||f&&typeof f=="object"&&f.key||`${c}`,d=Wt(l,t,u,r);d?.node&&s.appendChild(d.node)}t.node.appendChild(s);return}if(typeof e=="string"){let o=wm(e,t);if(Array.isArray(o)){Wp(t,o,r);return}}if(typeof e=="object")for(let o in e){if(_t.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=zp(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],a=Array.isArray(n)?n:[n];s={...s,extends:[...a,...i]}}else s={extends:n,...s};Wt(s,t,o,r)}}}function Am(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let a=t.__ref,c=!1,l=at(()=>{let f=i(t,t.state,t.context);if(!c){c=!0;return}if(f===t.children)return;if(t.children=f,Array.isArray(f)&&t.childrenAs==="state"){let d=t.childProps,h=[],g=new Map;for(let v=0;v<f.length;v++){let A=f[v],P=d;if(typeof d=="function")try{P=d(t,A)}catch{P=null}let H=P&&P.key||A&&A.key||`${v}`;h.push(H),g.set(H,{rawChild:A,childProps:P})}let m=new Set(h),y=a.__children.slice();for(let v of y)if(!m.has(v)){let A=t[v];A?.remove&&A.remove(),delete t[v]}let b=t.childExtends,x=(t.context?.document||globalThis.document)?.createDocumentFragment();for(let v of h){let A=g.get(v),P=A.rawChild,H=t[v];if(H&&H.state){if(P&&typeof P=="object"){let N=H.state;if(typeof N.replace=="function")N.replace(P);else if(typeof N.update=="function"){for(let $ in N)if(!($==="__element"||$==="root"||$==="parent"||$==="update")&&!Object.prototype.hasOwnProperty.call(P,$))try{N[$]=void 0}catch{}N.update(P)}else for(let $ in P)N[$]=P[$]}continue}let O=P;(typeof P=="string"||typeof P=="number")&&(O={value:P,text:P});let M=A.childProps,V=M?{...M,state:O}:{state:O};if(b&&!V.ignoreChildExtends)if(V.extends){let N=Array.isArray(V.extends)?V.extends:[V.extends],$=Array.isArray(b)?b:[b];V={...V,extends:[...$,...N]}}else V={extends:b,...V};let tt=Wt(V,t,v,e);tt?.node&&x&&x.appendChild(tt.node)}x&&x.childNodes.length&&t.node&&t.node.appendChild(x),a.__children=h;return}for(let d of[...a.__children]){let h=t[d];h?.remove&&h.remove(),delete t[d]}a.__children=[],Wp(t,f,e)},{depth:a.path.length});a.__effects.push(l)}if(Wp(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let a=0;a<i.length;a++){let c=i[a];if(!c.endsWith("Extends")||typeof t[c]!="string")continue;let l=c.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[c]};delete t[c];for(let p=a+1;p<i.length;p++){let u=i[p],d=u.charCodeAt(0);if(d>=65&&d<=90||_t.has(u)||typeof t[u]=="function"&&(u.startsWith("on")||u.startsWith(".")))break;let h=t[u];h!==void 0&&(f[u]=h,delete t[u])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||_t.has(i)||typeof t[i]!="object"||t[i]===null)continue;let a=i.charCodeAt(0);if(a<65||a>90)continue;let c=t[i];if(!c.__ref){if(!c.extends&&!c.extend){let l=s[i]||s[`smbls.${i}`];l&&(c={extends:l,...c})}if(t.childProps&&(c={...t.childProps,...c}),o&&!c.ignoreChildExtends)if(c.extends){let l=Array.isArray(c.extends)?c.extends:[c.extends],f=Array.isArray(o)?o:[o];c={...c,extends:[...f,...l]}}else c={extends:o,...c};Wt(c,t,i,e)}}}function Hp(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let s=r.node.nextSibling;s?o.insertBefore(n,s):o.appendChild(n)}else o.appendChild(n)}function Ze(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Mt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let a=e.context?.designSystem;a&&ct(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&Mt("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&ot(),i&&(e.__ref.__inRender=!1)}}return!0}var Em={blue:"#213eb0",green:"#389d34",red:"#e15c55",yellow:"#EDCB38",orange:"#e97c16",transparent:"rgba(0, 0, 0, 0)",black:"black",gray:"#4e4e50",white:"white",title:["--gray 1 -168","--gray 1 +168"],caption:["--gray 1 -68","--gray 1 +68"],paragraph:["--gray 1 -42","--gray 1 +42"],disabled:["--gray 1 -26","--gray 1 +26"],line:["--gray 1 -16","--gray 1 +16"]},Tm={"gradient-blue-light":`linear-gradient(to right,
42
42
  rgba(4, 116, 242, 1),
43
43
  rgba(0, 48, 103, 1)
44
44
  )`,"gradient-blue-dark":`linear-gradient(to right,
@@ -13,4 +13,4 @@ FROM ${c}${l}`},_i=t=>{let e=[],r=(n,o)=>{for(let s in n){let i=o?`${o}/${s}`:s;
13
13
  `).slice(0,6).join(`
14
14
  `):"")}}if(Qr(s,e,o),e&&(e[s.key]=s,e.__ref?.__children&&(e.__ref.__children.includes(s.key)||e.__ref.__children.push(s.key))),typeof s.html=="function"&&s.node&&!s.node.innerHTML){let g=s.context?.designSystem;g&&Q(g);try{let b=s.html(s,s.state,s.context);b!=null&&typeof b!="function"&&(s.node.innerHTML=b)}catch{}finally{g&&z()}}if(kt("Create",s,n),kt("Complete",s,n),kt("Render",s,n),kt("RenderRouter",s,n),typeof s.onFrame=="function"){let g=s.onFrame,b=s.context?.designSystem,m=()=>{if(s.node){if(s.node.isConnected){b&&Q(b);try{g(s,s.state,s.context)}catch(y){console.error("[DOMQL] onFrame error:",y)}finally{b&&z()}}requestAnimationFrame(m)}};requestAnimationFrame(m)}return s}function zc(t,e,r){let n=!e,o=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)&&Object.keys(r.state).length===0,s=n&&o&&t.context?.state,i=r.state!==void 0&&!s?r.state:t.state&&!G(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,vt(t,t.state);else if(t.context?.state){let c=t.context.state,a={...c},l=t.context?.polyglot;if(l?.translations){let f=c.lang||l.defaultLang||"en",u=l.translations[f];if(u&&typeof u=="object")for(let h in u)a[h]===void 0&&(a[h]=u[h]);let p=new Set(l.languages||[]);for(let h in l.translations)!p.has(h)&&a[h]===void 0&&(a[h]=l.translations[h])}t.state=G(a)?a:et(a),t.state.__element=t,t.state.root=t.state,vt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),vt(t,t.state);return}if(typeof i=="string"){if(t.state=ws(i,e),t.state&&typeof t.state=="object"&&!G(t.state)){let c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}vt(t,t.state);return}if(typeof i=="function"){let c=i(t,e?.state);t.state=G(c)?c:et(c||{})}else G(i)?t.state=i:t.state=et({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,vt(t,t.state)}function Br(t,e){if(!e)return t;let r=e.split("/"),n=t;for(let o of r){if(n==null)return{};n=n[o]}return n??{}}function ws(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let o=t.slice(3);return o?Br(e.state,o):e.state??{}}if(t.startsWith("~/")){let o=e.state?.root||e.state,s=t.slice(2);return s?Br(o,s):o??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=Br(e.state,t);if(r!=null&&Object.keys(r).length>0)return r;let n=e.context?.polyglot;if(n?.translations){let o=e.state?.root?.lang||n.defaultLang||"en",s=n.translations[o];if(s?.[t]!==void 0)return s[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function Hc(t){let e=t.__ref,r=t.tag||"div",n=t.context?.designSystem,o=[],s=Object.keys(t);for(let i=0;i<s.length;i++){let c=s[i];if(typeof t[c]!="function"||J.has(c))continue;let a=c.charCodeAt(0);a>=65&&a<=90||zt(c)||X[c]||tt&&tt.has(c)||he(r,c)||o.push({prop:c,fn:t[c]})}for(let i=0;i<o.length;i++){let{prop:c,fn:a}=o[i];e.__exec[c]=a,Object.defineProperty(t,c,{get(){n&&Q(n);try{return a(t,t.state,t.context)}catch{return}finally{n&&z()}},set(l){delete e.__exec[c],Object.defineProperty(t,c,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function zr(t,e){let r=t.__ref;if(Hc(t),typeof t.text=="function"){let o=t.text,s=F(()=>{if(!r.contentManaged)try{let i=o(t,t.state,t.context);t.node&&i!=null&&typeof i!="function"&&typeof i!="object"&&(typeof i=="string"&&i.includes("{{")&&(i=ve.call(t,i,t.state)),t.tag==="string"?t.node.nodeValue=i:t.node.textContent=i)}catch{}},{depth:r.path.length});r.__effects.push(s),r.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){let o=t.text,s=F(()=>{if(r.contentManaged)return;let i=ve.call(t,o,t.state);i!=null&&(t.text=i),t.node&&(t.tag==="string"?t.node.nodeValue=i??"":t.node.textContent=i??"")},{depth:r.path.length});r.__effects.push(s),r.__exec.text=o}for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!J.has(o)&&!zt(o)&&!r.__exec[o]){if(X[o]){let s=t[o],i=o,c,a=F(()=>{let l=t.context?.designSystem;l&&Q(l);try{let f=s(t,t.state,t.context),u=X[i](f,t,t.state,t.context);if(u&&t.node){let p=Ss(u);(p===null||p!==c)&&(c=p,Wt(t.node,u))}else t.node&&(i==="show"||i==="hide")&&(c=void 0,t.node.style.display="")}finally{l&&z()}},{depth:r.path.length});r.__effects.push(a),r.__exec[o]=s}else if(tt&&tt.has(o)){let s=t[o],i=o,c,a=F(()=>{let l=t.context?.designSystem;l&&Q(l);try{let f=s(t,t.state,t.context);if(t.node)if(f!=null){let u=i+":"+String(f);u!==c&&(c=u,Wt(t.node,{[i]:f}))}else c=void 0,t.node.style[i]=""}finally{l&&z()}},{depth:r.path.length});r.__effects.push(a),r.__exec[o]=s}}if(typeof e.html=="function"){let o=e.html,s=F(()=>{let i=t.context?.designSystem;i&&Q(i);try{let c=o(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&(t.node.innerHTML=c)}finally{i&&z()}},{depth:r.path.length});r.__effects.push(s),r.__exec.html=o}if(typeof e.value=="function"){let o=e.value,s=F(()=>{try{let i=o(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let c=i==null?"":String(i);if(t.node.value===c)return;let a=typeof document<"u"&&document.activeElement===t.node,l=a&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,f=a&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=c,a&&l!=null&&f!=null)try{t.node.setSelectionRange(l,f)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(s),r.__exec.value=o}if(typeof e.style=="function"){let o=e.style,s,i=F(()=>{let c=o(t,t.state,t.context),a=Ss(c);(a===null||a!==s)&&(s=a,Wt(t.node,c))},{depth:r.path.length});r.__effects.push(i),r.__exec.style=o}else if(t.style&&typeof t.style=="object")for(let o in t.style){let s=t.style[o];if(typeof s!="function")continue;let i,c=F(()=>{try{let a=s(t,t.state,t.context);if(t.node){let l=o+":"+String(a);l!==i&&(i=l,Wt(t.node,{[o]:a}))}}catch{}},{depth:r.path.length});r.__effects.push(c)}if(t.attr&&typeof t.attr=="object"){for(let o in t.attr)if(typeof t.attr[o]=="function"){let s=t.attr[o],i=o,c=F(()=>{try{let a=s(t,t.state,t.context);t.node?.setAttribute&&(a==null||a===!1?t.node.removeAttribute(i):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(i,a===!0?"":a))}catch{}},{depth:r.path.length});r.__effects.push(c)}}if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s!="function")continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),c=F(()=>{try{let a=s(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(i):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(i,a===!0?"":a)}catch{}},{depth:r.path.length});r.__effects.push(c)}if(t.data&&typeof t.data=="object")for(let o in t.data){let s=t.data[o];if(typeof s!="function")continue;let c="data-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=F(()=>{try{let l=s(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,l===!0?"":l)}catch{}},{depth:r.path.length});r.__effects.push(a)}let n=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(n)for(let o in n){let s=n[o];if(typeof s!="function")continue;let i=F(()=>{try{let c=s(t,t.state,t.context);if(!t.node?.classList)return;typeof c=="string"?t.node.classList.add(c):c?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:r.path.length});r.__effects.push(i)}if(typeof e.if=="function"){let o=e.if,s=F(()=>{let i;try{i=o(t,t.state,t.context)}catch(a){if(i=!1,r.__ifError=a,typeof console<"u"&&console.warn){let l=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${l} \u2014 treating as false:`,a?.message||a)}return}let c=r.__if;if(r.__if=!!i,c&&!r.__if&&t.node)t.node.remove();else if(!c&&r.__if)if(r.__ifInitialized){t.node||(t.node=Kt(t)),t.node&&(t.node.ref=t);let a=t.parent,l=a?.node;if(l&&t.node){let f=null,u=Object.keys(a),p=u.indexOf(t.key);for(let h=p+1;h<u.length;h++){let d=a[u[h]];if(d?.node?.parentNode===l){f=d.node;break}}f?l.insertBefore(t.node,f):l.appendChild(t.node)}else Qr(t,t.parent);Hr(t)}else{if(r.__ifInitialized=!0,t.tag||(t.tag=Ht(t)),kt("Init",t,{}),t.node||(t.node=Kt(t)),!t.node)return;kt("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),ks(t,{});let a=e.if;delete e.if;try{zr(t,e)}finally{e.if=a}Hr(t),Cs(t),As(t,{}),Qr(t,t.parent)}},{depth:r.path.length});r.__effects.push(s)}for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||J.has(o)||typeof t[o]!="function")continue;let s=o.charCodeAt(0);if(s>=65&&s<=90||zt(o))continue;let i=t[o];r.__exec[o]=i;let c=t.tag||"div";if(he(c,o)&&!X[o]&&!(tt&&tt.has(o))){let a=o,l=F(()=>{try{let f=i(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1?t.node.removeAttribute(a):typeof f!="function"&&typeof f!="object"&&(a==="src"&&"src"in t.node?t.node.src=f:t.node.setAttribute(a,f===!0?"":f)))}catch{}},{depth:r.path.length});r.__effects.push(l)}}Qc(t),Jc(t)}function Hr(t){let{node:e}=t;if(e){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?e.nodeValue=t.text:e.textContent=t.text:typeof t.text=="number"&&(e.textContent=t.text),Yc(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){let r=String(t.value);e.value!==r&&(e.value=r)}if(t.style&&typeof t.style=="object"&&Wt(e,t.style),t.attr&&typeof t.attr=="object")for(let r in t.attr){let n=t.attr[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.setAttribute&&e.setAttribute(r,n===!0?"":n)}if(t.data&&typeof t.data=="object")for(let r in t.data){let n=t.data[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.dataset&&(e.dataset[r]=n===!0?"":n)}if(t.classlist||t.class){let r=t.classlist||t.class;if(typeof r=="string")r.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof r=="object")for(let n in r){let o=typeof r[n]=="function"?r[n](t,t.state,t.context):r[n];o&&e.classList.add(typeof o=="string"?o:n)}}}}function Ss(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Wt(t,e){if(!t||!e||!t.style)return;let r=null;for(let n in e){let o=e[n];if(o!=null){if(n.charAt(0)==="&"&&typeof o=="object"){r||(r={}),r[n]=o;continue}try{let s=String(o),i=n.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),c=s.trim(),a=/\s*!important\s*$/.test(c),l=c.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,a?"important":"")}catch{}}}r&&qc(t,r)}var Kc=0;function qc(t,e){let r=`_ds${Kc++}`;t.classList.add(r);let n=t.ownerDocument,o=n.querySelector("style[data-smbls-scoped]");o||(o=n.createElement("style"),o.setAttribute("data-smbls-scoped",""),n.head.appendChild(o));let s="";for(let i in e){let c="."+r,a=i.replace(/&/g,c).split(",").map(f=>{let u=f.trim();return u.includes(c)?u:c+u}).join(", "),l=e[i];if(typeof l=="object"){let f="",u="";for(let p in l){let h=l[p];if(typeof h=="object"){let d=p.includes("&")?a.split(", ").map(b=>p.replace(/&/g,b)).join(", "):a.split(", ").map(b=>`${b} ${p}`).join(", "),g="";for(let b in h)g+=`${b.replace(/[A-Z]/g,m=>"-"+m.toLowerCase())}: ${h[b]};`;u+=`${d} { ${g} }
15
15
  `}else f+=`${p.replace(/[A-Z]/g,d=>"-"+d.toLowerCase())}: ${h};`}f&&(s+=`${a} { ${f} }
16
- `),u&&(s+=u)}}s&&(o.textContent+=s)}function Qc(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],c=s.slice(1),a={value:!1},l=F(()=>{let f=t.state&&(G(t.state)?t.state.root:null);if(!f||!G(f))return;let u=f;u=u[i];for(let p=0;p<c.length&&!(u==null||typeof u!="object");p++)if(G(u))u=u[c[p]];else break;if(a.value&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&Q(p);try{t.onUpdate(t,t.state,t.context)}catch(h){t.context?.plugins?.length&&Nt("error",t,{hook:"onUpdate",error:h})||console.error("[DOMQL] subscribeTo onUpdate error:",h)}finally{p&&z()}}},{depth:r.path.length});a.value=!0,r.__effects.push(l)}}function Jc(t){let e=t.__ref;e.__conditionalRunners=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=r.charAt(0);if(n!=="."&&n!=="!")continue;let o=r.slice(1);if(!o)continue;let s=t[r];if(!s||typeof s!="object")continue;let i=n==="!",c={lastMatch:!1,appliedKeys:null},a=()=>{if(!t.node)return;let f,u=t[o];if(u===void 0)if(t.state&&o in t.state)f=t.state[o];else{let d=t.context?.cases?.[o];if(d===void 0)return;try{f=typeof d=="function"?d.call(t,t):d}catch(g){f=!1,e.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}}else if(typeof u=="function")try{f=u(t,t.state,t.context)}catch(d){f=!1,e.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else f=u;let p=i?!f:!!f;if(p===c.lastMatch)return;c.lastMatch=p;let h=t.context?.designSystem;h&&Q(h);try{if(p){let d={};for(let b in s){if(!Object.prototype.hasOwnProperty.call(s,b))continue;let m=typeof s[b]=="function"?s[b](t,t.state,t.context):s[b];if(m!=null)if(X[b]){let y=X[b](m,t,t.state,t.context);if(y){let x=Array.isArray(y)?y:[y];for(let _ of x)_&&Object.assign(d,_)}}else tt&&tt.has(b)&&(d[b]=m)}let g=Object.keys(d);g.length?(Wt(t.node,d),c.appliedKeys=g):c.appliedKeys=null}else if(c.appliedKeys){for(let d of c.appliedKeys)t.node.style[d]="";c.appliedKeys=null}}finally{h&&z()}};e.__conditionalRunners.push(a);let l=F(a,{depth:e.path.length});e.__effects.push(l)}}var Ur=new WeakSet;function Xc(t){let e=t.ownerDocument;!e||Ur.has(e)||(Ur.add(e),queueMicrotask(()=>{Ur.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var Gr=new WeakSet;function Yc(t){let{node:e}=t;if(!e)return;if(Gr.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Gr.add(t);let r=t.context?.designSystem;r&&Q(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||J.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!zt(s)){if(X[s]){let c=t[s],a=X[s](c,t,t.state,t.context);if(a){if(Array.isArray(a))for(let l of a)l&&Object.assign(n,l);else Object.assign(n,a);o=!0}}else if(tt&&tt.has(s)){let c=t[s];c!=null&&typeof c!="object"&&(n[s]=c,o=!0)}else if(s.charCodeAt(0)===45){let c=t[s];c!=null&&typeof c!="object"&&(n[s]=c,o=!0)}else if(s.charAt(0)==="&"){let c=t[s];c&&typeof c=="object"&&(n[s]=c,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let c=t[s];if(c&&typeof c=="object"){let a={};for(let l in c){let f=c[l];if(typeof f=="function"&&(f=f(t,t.state,t.context)),!(f==null||typeof f=="function"))if(X[l]){let u=X[l](f,t,t.state,t.context);if(u)if(Array.isArray(u))for(let p of u)p&&Object.assign(a,p);else Object.assign(a,u)}else a[l]=f}if(Object.keys(a).length){if(s.length>1&&s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")&&!s.startsWith("@supports")&&(s==="@dark"||s==="@light"||!t.context?.designSystem?.media?.[s.slice(1)])){let f={};for(let p in a){let h=a[p];f[p]=typeof h=="string"&&!h.includes("!important")?h+" !important":h}let u=s.slice(1);n[`[data-theme="${u}"] &`]=f}else{let f=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let p=s.slice(1),h=t.context?.designSystem?.media?.[p]||t.context?.designSystem?.media?.[p];h&&(f=`@media ${h}`)}let u={};for(let p in a){let h=a[p];if(h&&typeof h=="object"&&!Array.isArray(h)){let d={};for(let b in h)if(X[b]){let m=X[b](h[b],t,t.state,t.context);if(m)if(Array.isArray(m))for(let y of m)y&&Object.assign(d,y);else Object.assign(d,m)}else d[b]=h[b];let g=p.startsWith(":")?"":" ";if(f.includes(",")){let b=f.split(",").map(m=>`${m.trim()}${g}${p}`).join(", ");n[b]=d}else n[`${f}${g}${p}`]=d}else u[p]=h}Object.keys(u).length&&(n[f]=u)}o=!0}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=Mr(n,null,t.context?.cssPrefix);if(s&&e.classList){let c=s.split(" ").filter(Boolean),a=!1;for(let l of c)e.classList.add(l),a||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(a=!0);a&&Xc(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let c=n.display;if(c&&c!==i)if(i==="none"){let a=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&a.push(l);for(let l of a)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&z(),Gr.delete(t)}}function Cs(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=_s(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||J.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!zt(o)&&!(X[o]||tt&&tt.has(o))&&he(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=ve(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function Zc(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var vs=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function ks(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!zt(r)||vs.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(c){return t.call(s,c)}}if(typeof n!="function")continue;let o=Gc(r);qt.has(o)||ue(Wc(o),t,n)}ta(t)}function ta(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let p of vs){let h=t[p];typeof h=="function"&&(r[p]=h,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,c=0,a=0,l=!1,f=p=>{let h=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];h&&(i=h.clientX,c=h.clientY,a=Date.now(),l=!0)},u=p=>{if(!l)return;l=!1;let h=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!h)return;let d=h.clientX-i,g=h.clientY-c,b=Date.now()-a;if(b>s)return;let m=Math.abs(d),y=Math.abs(g);if(Math.max(m,y)<o)return;let x;if(m>y*1.2)x=d<0?"left":"right";else if(y>m*1.2)x=g<0?"up":"down";else return;let _="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),w=r[_],v=r.onSwipe;w&&w.call(t,p,t,t.state,t.context),v&&v.call(t,{direction:x,dx:d,dy:g,dt:b,event:p},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function Kr(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=Kr(o,s):r[n]=s}return r}function qr(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=(t.context?.document||globalThis.document)?.createDocumentFragment();if(!s)return;let i=t.childProps,c=t.childrenAs;for(let a=0;a<e.length;a++){let l=e[a],f=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let u=i;if(typeof i=="function")try{u=i(t,l)}catch{u=null}if(c==="state"){let d=f;(typeof f=="string"||typeof f=="number")&&(d={value:f,text:f}),l=u?{...u,state:d}:{state:d}}else u&&(l=Kr(u,l));if(n&&!l.ignoreChildExtends)if(l.extends){let d=Array.isArray(l.extends)?l.extends:[l.extends],g=Array.isArray(n)?n:[n];l={...l,extends:[...g,...d]}}else l={extends:n,...l};let p=l?.key||`${a}`,h=ot(l,t,p,r);h?.node&&s.appendChild(h.node)}t.node.appendChild(s);return}if(typeof e=="string"){let o=ws(e,t);if(Array.isArray(o)){qr(t,o,r);return}}if(typeof e=="object")for(let o in e){if(J.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=Kr(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],c=Array.isArray(n)?n:[n];s={...s,extends:[...c,...i]}}else s={extends:n,...s};ot(s,t,o,r)}}}function As(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let c=t.__ref,a=!1,l=F(()=>{let f=i(t,t.state,t.context);if(!a){a=!0;return}if(f===t.children)return;if(t.children=f,Array.isArray(f)&&t.childrenAs==="state"){let h=t.childProps,d=[],g=new Map;for(let w=0;w<f.length;w++){let v=f[w],T=h;if(typeof h=="function")try{T=h(t,v)}catch{T=null}let Y=T&&T.key||v&&v.key||`${w}`;d.push(Y),g.set(Y,{rawChild:v,childProps:T})}let b=new Set(d),m=c.__children.slice();for(let w of m)if(!b.has(w)){let v=t[w];v?.remove&&v.remove(),delete t[w]}let y=t.childExtends,_=(t.context?.document||globalThis.document)?.createDocumentFragment();for(let w of d){let v=g.get(w),T=v.rawChild,Y=t[w];if(Y&&Y.state){if(T&&typeof T=="object"){let N=Y.state;if(typeof N.replace=="function")N.replace(T);else if(typeof N.update=="function"){for(let D in N)if(!(D==="__element"||D==="root"||D==="parent"||D==="update")&&!Object.prototype.hasOwnProperty.call(T,D))try{N[D]=void 0}catch{}N.update(T)}else for(let D in T)N[D]=T[D]}continue}let B=T;(typeof T=="string"||typeof T=="number")&&(B={value:T,text:T});let Z=v.childProps,U=Z?{...Z,state:B}:{state:B};if(y&&!U.ignoreChildExtends)if(U.extends){let N=Array.isArray(U.extends)?U.extends:[U.extends],D=Array.isArray(y)?y:[y];U={...U,extends:[...D,...N]}}else U={extends:y,...U};let gt=ot(U,t,w,e);gt?.node&&_&&_.appendChild(gt.node)}_&&_.childNodes.length&&t.node&&t.node.appendChild(_),c.__children=d;return}for(let h of[...c.__children]){let d=t[h];d?.remove&&d.remove(),delete t[h]}c.__children=[],qr(t,f,e)},{depth:c.path.length});c.__effects.push(l)}if(qr(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let c=0;c<i.length;c++){let a=i[c];if(!a.endsWith("Extends")||typeof t[a]!="string")continue;let l=a.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[a]};delete t[a];for(let u=c+1;u<i.length;u++){let p=i[u],h=p.charCodeAt(0);if(h>=65&&h<=90||J.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;let d=t[p];d!==void 0&&(f[p]=d,delete t[p])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||J.has(i)||typeof t[i]!="object"||t[i]===null)continue;let c=i.charCodeAt(0);if(c<65||c>90)continue;let a=t[i];if(!a.__ref){if(!a.extends&&!a.extend){let l=s[i]||s[`smbls.${i}`];l&&(a={extends:l,...a})}if(t.childProps&&(a={...t.childProps,...a}),o&&!a.ignoreChildExtends)if(a.extends){let l=Array.isArray(a.extends)?a.extends:[a.extends],f=Array.isArray(o)?o:[o];a={...a,extends:[...f,...l]}}else a={extends:o,...a};ot(a,t,i,e)}}}function Qr(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let s=r.node.nextSibling;s?o.insertBefore(n,s):o.appendChild(n)}else o.appendChild(n)}function kt(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Nt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let c=e.context?.designSystem;c&&Q(c);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(a){if(e.context?.plugins?.length&&Nt("error",e,{hook:o,error:a})||console.error(`[DOMQL] Lifecycle "${o}" error:`,a),e.context?.strictMode)throw a}finally{c&&z(),i&&(e.__ref.__inRender=!1)}}return!0}var ea=ot;var ra=(t,e,r={})=>{if(!t||typeof t!="object")throw new Error("[SymbolsEmbed.mount] rootDef must be an object");if(typeof Node>"u"||!(e instanceof Node))throw new Error("[SymbolsEmbed.mount] host must be a DOM element");let n=r.state?et(r.state):void 0;return ot(t,e,"Root",{state:n,context:r.context||{}})};return Is(na);})();
16
+ `),u&&(s+=u)}}s&&(o.textContent+=s)}function Qc(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],c=s.slice(1),a={value:!1},l=F(()=>{let f=t.state&&(G(t.state)?t.state.root:null);if(!f||!G(f))return;let u=f;u=u[i];for(let p=0;p<c.length&&!(u==null||typeof u!="object");p++)if(G(u))u=u[c[p]];else break;if(a.value&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&Q(p);try{t.onUpdate(t,t.state,t.context)}catch(h){t.context?.plugins?.length&&Nt("error",t,{hook:"onUpdate",error:h})||console.error("[DOMQL] subscribeTo onUpdate error:",h)}finally{p&&z()}}},{depth:r.path.length});a.value=!0,r.__effects.push(l)}}function Jc(t){let e=t.__ref;e.__conditionalRunners=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=r.charAt(0);if(n!=="."&&n!=="!")continue;let o=r.slice(1);if(!o)continue;let s=t[r];if(!s||typeof s!="object")continue;let i=n==="!",c={lastMatch:!1,appliedKeys:null},a=()=>{if(!t.node)return;let f,u=t[o];if(u===void 0)if(t.state&&o in t.state)f=t.state[o];else{let d=t.context?.cases?.[o];if(d===void 0)return;try{f=typeof d=="function"?d.call(t,t):d}catch(g){f=!1,e.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}}else if(typeof u=="function")try{f=u(t,t.state,t.context)}catch(d){f=!1,e.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else f=u;let p=i?!f:!!f;if(p===c.lastMatch)return;c.lastMatch=p;let h=t.context?.designSystem;h&&Q(h);try{if(p){let d={};for(let b in s){if(!Object.prototype.hasOwnProperty.call(s,b))continue;let m=typeof s[b]=="function"?s[b](t,t.state,t.context):s[b];if(m!=null)if(X[b]){let y=X[b](m,t,t.state,t.context);if(y){let x=Array.isArray(y)?y:[y];for(let _ of x)_&&Object.assign(d,_)}}else tt&&tt.has(b)&&(d[b]=m)}let g=Object.keys(d);g.length?(Wt(t.node,d),c.appliedKeys=g):c.appliedKeys=null}else if(c.appliedKeys){for(let d of c.appliedKeys)t.node.style[d]="";c.appliedKeys=null}}finally{h&&z()}};e.__conditionalRunners.push(a);let l=F(a,{depth:e.path.length});e.__effects.push(l)}}var Ur=new WeakSet;function Xc(t){let e=t.ownerDocument;!e||Ur.has(e)||(Ur.add(e),queueMicrotask(()=>{Ur.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var Gr=new WeakSet;function Yc(t){let{node:e}=t;if(!e)return;if(Gr.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Gr.add(t);let r=t.context?.designSystem;r&&Q(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||J.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!zt(s)){if(X[s]){let c=t[s],a=X[s](c,t,t.state,t.context);if(a){if(Array.isArray(a))for(let l of a)l&&Object.assign(n,l);else Object.assign(n,a);o=!0}}else if(tt&&tt.has(s)){let c=t[s];c!=null&&typeof c!="object"&&(n[s]=c,o=!0)}else if(s.charCodeAt(0)===45){let c=t[s];c!=null&&typeof c!="object"&&(n[s]=c,o=!0)}else if(s.charAt(0)==="&"){let c=t[s];c&&typeof c=="object"&&(n[s]=c,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let c=t[s];if(c&&typeof c=="object"){let a={};for(let l in c){let f=c[l];if(typeof f=="function"&&(f=f(t,t.state,t.context)),!(f==null||typeof f=="function"))if(X[l]){let u=X[l](f,t,t.state,t.context);if(u)if(Array.isArray(u))for(let p of u)p&&Object.assign(a,p);else Object.assign(a,u)}else a[l]=f}if(Object.keys(a).length){if(s.length>1&&s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")&&!s.startsWith("@supports")&&(s==="@dark"||s==="@light"||!t.context?.designSystem?.media?.[s.slice(1)])){let f={};for(let p in a){let h=a[p];f[p]=typeof h=="string"&&!h.includes("!important")?h+" !important":h}let u=s.slice(1);n[`[data-theme="${u}"] &`]=f}else{let f=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let p=s.slice(1),h=t.context?.designSystem?.media?.[p]||t.context?.designSystem?.media?.[p];h&&(f=`@media ${h}`)}let u={};for(let p in a){let h=a[p];if(h&&typeof h=="object"&&!Array.isArray(h)){let d={};for(let b in h)if(X[b]){let m=X[b](h[b],t,t.state,t.context);if(m)if(Array.isArray(m))for(let y of m)y&&Object.assign(d,y);else Object.assign(d,m)}else d[b]=h[b];let g=p.startsWith(":")?"":" ";if(f.includes(",")){let b=f.split(",").map(m=>`${m.trim()}${g}${p}`).join(", ");n[b]=d}else n[`${f}${g}${p}`]=d}else u[p]=h}Object.keys(u).length&&(n[f]=u)}o=!0}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=Mr(n,null,t.context?.cssPrefix);if(s&&e.classList){let c=s.split(" ").filter(Boolean),a=!1;for(let l of c)e.classList.add(l),a||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(a=!0);a&&Xc(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let c=n.display;if(c&&c!==i)if(i==="none"){let a=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&a.push(l);for(let l of a)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&z(),Gr.delete(t)}}function Cs(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=_s(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||J.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!zt(o)&&!(X[o]||tt&&tt.has(o))&&he(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=ve(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function Zc(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var vs=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function ks(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!zt(r)||vs.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(c){return t.call(s,c)}}if(typeof n!="function")continue;let o=Gc(r);qt.has(o)||ue(Wc(o),t,n)}ta(t)}function ta(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let p of vs){let h=t[p];typeof h=="function"&&(r[p]=h,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,c=0,a=0,l=!1,f=p=>{let h=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];h&&(i=h.clientX,c=h.clientY,a=Date.now(),l=!0)},u=p=>{if(!l)return;l=!1;let h=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!h)return;let d=h.clientX-i,g=h.clientY-c,b=Date.now()-a;if(b>s)return;let m=Math.abs(d),y=Math.abs(g);if(Math.max(m,y)<o)return;let x;if(m>y*1.2)x=d<0?"left":"right";else if(y>m*1.2)x=g<0?"up":"down";else return;let _="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),w=r[_],v=r.onSwipe;w&&w.call(t,p,t,t.state,t.context),v&&v.call(t,{direction:x,dx:d,dy:g,dt:b,event:p},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function Kr(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=Kr(o,s):r[n]=s}return r}function qr(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=(t.context?.document||globalThis.document)?.createDocumentFragment();if(!s)return;let i=t.childProps,c=t.childrenAs;for(let a=0;a<e.length;a++){let l=e[a],f=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let u=i;if(typeof i=="function")try{u=i(t,l)}catch{u=null}if(c==="state"){let d=f;(typeof f=="string"||typeof f=="number")&&(d={value:f,text:f}),l=u?{...u,state:d}:{state:d}}else u&&(l=Kr(u,l));if(n&&!l.ignoreChildExtends)if(l.extends){let d=Array.isArray(l.extends)?l.extends:[l.extends],g=Array.isArray(n)?n:[n];l={...l,extends:[...g,...d]}}else l={extends:n,...l};let p=l?.key||f&&typeof f=="object"&&f.key||`${a}`,h=ot(l,t,p,r);h?.node&&s.appendChild(h.node)}t.node.appendChild(s);return}if(typeof e=="string"){let o=ws(e,t);if(Array.isArray(o)){qr(t,o,r);return}}if(typeof e=="object")for(let o in e){if(J.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=Kr(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],c=Array.isArray(n)?n:[n];s={...s,extends:[...c,...i]}}else s={extends:n,...s};ot(s,t,o,r)}}}function As(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let c=t.__ref,a=!1,l=F(()=>{let f=i(t,t.state,t.context);if(!a){a=!0;return}if(f===t.children)return;if(t.children=f,Array.isArray(f)&&t.childrenAs==="state"){let h=t.childProps,d=[],g=new Map;for(let w=0;w<f.length;w++){let v=f[w],T=h;if(typeof h=="function")try{T=h(t,v)}catch{T=null}let Y=T&&T.key||v&&v.key||`${w}`;d.push(Y),g.set(Y,{rawChild:v,childProps:T})}let b=new Set(d),m=c.__children.slice();for(let w of m)if(!b.has(w)){let v=t[w];v?.remove&&v.remove(),delete t[w]}let y=t.childExtends,_=(t.context?.document||globalThis.document)?.createDocumentFragment();for(let w of d){let v=g.get(w),T=v.rawChild,Y=t[w];if(Y&&Y.state){if(T&&typeof T=="object"){let N=Y.state;if(typeof N.replace=="function")N.replace(T);else if(typeof N.update=="function"){for(let D in N)if(!(D==="__element"||D==="root"||D==="parent"||D==="update")&&!Object.prototype.hasOwnProperty.call(T,D))try{N[D]=void 0}catch{}N.update(T)}else for(let D in T)N[D]=T[D]}continue}let B=T;(typeof T=="string"||typeof T=="number")&&(B={value:T,text:T});let Z=v.childProps,U=Z?{...Z,state:B}:{state:B};if(y&&!U.ignoreChildExtends)if(U.extends){let N=Array.isArray(U.extends)?U.extends:[U.extends],D=Array.isArray(y)?y:[y];U={...U,extends:[...D,...N]}}else U={extends:y,...U};let gt=ot(U,t,w,e);gt?.node&&_&&_.appendChild(gt.node)}_&&_.childNodes.length&&t.node&&t.node.appendChild(_),c.__children=d;return}for(let h of[...c.__children]){let d=t[h];d?.remove&&d.remove(),delete t[h]}c.__children=[],qr(t,f,e)},{depth:c.path.length});c.__effects.push(l)}if(qr(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let c=0;c<i.length;c++){let a=i[c];if(!a.endsWith("Extends")||typeof t[a]!="string")continue;let l=a.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[a]};delete t[a];for(let u=c+1;u<i.length;u++){let p=i[u],h=p.charCodeAt(0);if(h>=65&&h<=90||J.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;let d=t[p];d!==void 0&&(f[p]=d,delete t[p])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||J.has(i)||typeof t[i]!="object"||t[i]===null)continue;let c=i.charCodeAt(0);if(c<65||c>90)continue;let a=t[i];if(!a.__ref){if(!a.extends&&!a.extend){let l=s[i]||s[`smbls.${i}`];l&&(a={extends:l,...a})}if(t.childProps&&(a={...t.childProps,...a}),o&&!a.ignoreChildExtends)if(a.extends){let l=Array.isArray(a.extends)?a.extends:[a.extends],f=Array.isArray(o)?o:[o];a={...a,extends:[...f,...l]}}else a={extends:o,...a};ot(a,t,i,e)}}}function Qr(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let s=r.node.nextSibling;s?o.insertBefore(n,s):o.appendChild(n)}else o.appendChild(n)}function kt(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Nt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let c=e.context?.designSystem;c&&Q(c);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(a){if(e.context?.plugins?.length&&Nt("error",e,{hook:o,error:a})||console.error(`[DOMQL] Lifecycle "${o}" error:`,a),e.context?.strictMode)throw a}finally{c&&z(),i&&(e.__ref.__inRender=!1)}}return!0}var ea=ot;var ra=(t,e,r={})=>{if(!t||typeof t!="object")throw new Error("[SymbolsEmbed.mount] rootDef must be an object");if(typeof Node>"u"||!(e instanceof Node))throw new Error("[SymbolsEmbed.mount] host must be a DOM element");let n=r.state?et(r.state):void 0;return ot(t,e,"Root",{state:n,context:r.context||{}})};return Is(na);})();
package/dist/smbls.esm.js CHANGED
@@ -38,7 +38,7 @@ FROM ${a}${l}`},TS=t=>{let e=[],r=(n,o)=>{for(let s in n){let i=o?`${o}/${s}`:s;
38
38
  `).slice(0,6).join(`
39
39
  `):"")}}if(Hp(s,e,o),e&&(e[s.key]=s,e.__ref?.__children&&(e.__ref.__children.includes(s.key)||e.__ref.__children.push(s.key))),typeof s.html=="function"&&s.node&&!s.node.innerHTML){let g=s.context?.designSystem;g&&ct(g);try{let m=s.html(s,s.state,s.context);m!=null&&typeof m!="function"&&(s.node.innerHTML=m)}catch{}finally{g&&ot()}}if(Ze("Create",s,n),Ze("Complete",s,n),Ze("Render",s,n),Ze("RenderRouter",s,n),typeof s.onFrame=="function"){let g=s.onFrame,m=s.context?.designSystem,y=()=>{if(s.node){if(s.node.isConnected){m&&ct(m);try{g(s,s.state,s.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{m&&ot()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return s}function i0(t,e,r){let n=!e,o=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)&&Object.keys(r.state).length===0,s=n&&o&&t.context?.state,i=r.state!==void 0&&!s?r.state:t.state&&!et(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Dt(t,t.state);else if(t.context?.state){let a=t.context.state,c={...a},l=t.context?.polyglot;if(l?.translations){let f=a.lang||l.defaultLang||"en",p=l.translations[f];if(p&&typeof p=="object")for(let d in p)c[d]===void 0&&(c[d]=p[d]);let u=new Set(l.languages||[]);for(let d in l.translations)!u.has(d)&&c[d]===void 0&&(c[d]=l.translations[d])}t.state=et(c)?c:Pt(c),t.state.__element=t,t.state.root=t.state,Dt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Dt(t,t.state);return}if(typeof i=="string"){if(t.state=Sm(i,e),t.state&&typeof t.state=="object"&&!et(t.state)){let a=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:a,enumerable:!1,configurable:!0,writable:!0})}Dt(t,t.state);return}if(typeof i=="function"){let a=i(t,e?.state);t.state=et(a)?a:Pt(a||{})}else et(i)?t.state=i:t.state=Pt({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,Dt(t,t.state)}function Mp(t,e){if(!e)return t;let r=e.split("/"),n=t;for(let o of r){if(n==null)return{};n=n[o]}return n??{}}function Sm(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let o=t.slice(3);return o?Mp(e.state,o):e.state??{}}if(t.startsWith("~/")){let o=e.state?.root||e.state,s=t.slice(2);return s?Mp(o,s):o??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=Mp(e.state,t);if(r!=null&&Object.keys(r).length>0)return r;let n=e.context?.polyglot;if(n?.translations){let o=e.state?.root?.lang||n.defaultLang||"en",s=n.translations[o];if(s?.[t]!==void 0)return s[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function a0(t){let e=t.__ref,r=t.tag||"div",n=t.context?.designSystem,o=[],s=Object.keys(t);for(let i=0;i<s.length;i++){let a=s[i];if(typeof t[a]!="function"||_t.has(a))continue;let c=a.charCodeAt(0);c>=65&&c<=90||dn(a)||pt[a]||yt&&yt.has(a)||Xe(r,a)||o.push({prop:a,fn:t[a]})}for(let i=0;i<o.length;i++){let{prop:a,fn:c}=o[i];e.__exec[a]=c,Object.defineProperty(t,a,{get(){n&&ct(n);try{return c(t,t.state,t.context)}catch{return}finally{n&&ot()}},set(l){delete e.__exec[a],Object.defineProperty(t,a,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Vp(t,e){let r=t.__ref;if(a0(t),typeof t.text=="function"){let o=t.text,s=at(()=>{if(!r.contentManaged)try{let i=o(t,t.state,t.context);t.node&&i!=null&&typeof i!="function"&&typeof i!="object"&&(typeof i=="string"&&i.includes("{{")&&(i=lr.call(t,i,t.state)),t.tag==="string"?t.node.nodeValue=i:t.node.textContent=i)}catch{}},{depth:r.path.length});r.__effects.push(s),r.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){let o=t.text,s=at(()=>{if(r.contentManaged)return;let i=lr.call(t,o,t.state);i!=null&&(t.text=i),t.node&&(t.tag==="string"?t.node.nodeValue=i??"":t.node.textContent=i??"")},{depth:r.path.length});r.__effects.push(s),r.__exec.text=o}for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!_t.has(o)&&!dn(o)&&!r.__exec[o]){if(pt[o]){let s=t[o],i=o,a,c=at(()=>{let l=t.context?.designSystem;l&&ct(l);try{let f=s(t,t.state,t.context),p=pt[i](f,t,t.state,t.context);if(p&&t.node){let u=_m(p);(u===null||u!==a)&&(a=u,pn(t.node,p))}else t.node&&(i==="show"||i==="hide")&&(a=void 0,t.node.style.display="")}finally{l&&ot()}},{depth:r.path.length});r.__effects.push(c),r.__exec[o]=s}else if(yt&&yt.has(o)){let s=t[o],i=o,a,c=at(()=>{let l=t.context?.designSystem;l&&ct(l);try{let f=s(t,t.state,t.context);if(t.node)if(f!=null){let p=i+":"+String(f);p!==a&&(a=p,pn(t.node,{[i]:f}))}else a=void 0,t.node.style[i]=""}finally{l&&ot()}},{depth:r.path.length});r.__effects.push(c),r.__exec[o]=s}}if(typeof e.html=="function"){let o=e.html,s=at(()=>{let i=t.context?.designSystem;i&&ct(i);try{let a=o(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&(t.node.innerHTML=a)}finally{i&&ot()}},{depth:r.path.length});r.__effects.push(s),r.__exec.html=o}if(typeof e.value=="function"){let o=e.value,s=at(()=>{try{let i=o(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let a=i==null?"":String(i);if(t.node.value===a)return;let c=typeof document<"u"&&document.activeElement===t.node,l=c&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,f=c&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=a,c&&l!=null&&f!=null)try{t.node.setSelectionRange(l,f)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(s),r.__exec.value=o}if(typeof e.style=="function"){let o=e.style,s,i=at(()=>{let a=o(t,t.state,t.context),c=_m(a);(c===null||c!==s)&&(s=c,pn(t.node,a))},{depth:r.path.length});r.__effects.push(i),r.__exec.style=o}else if(t.style&&typeof t.style=="object")for(let o in t.style){let s=t.style[o];if(typeof s!="function")continue;let i,a=at(()=>{try{let c=s(t,t.state,t.context);if(t.node){let l=o+":"+String(c);l!==i&&(i=l,pn(t.node,{[o]:c}))}}catch{}},{depth:r.path.length});r.__effects.push(a)}if(t.attr&&typeof t.attr=="object"){for(let o in t.attr)if(typeof t.attr[o]=="function"){let s=t.attr[o],i=o,a=at(()=>{try{let c=s(t,t.state,t.context);t.node?.setAttribute&&(c==null||c===!1?t.node.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&t.node.setAttribute(i,c===!0?"":c))}catch{}},{depth:r.path.length});r.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s!="function")continue;let i="aria-"+o.replace(/[A-Z]/g,c=>"-"+c.toLowerCase()),a=at(()=>{try{let c=s(t,t.state,t.context);if(!t.node?.setAttribute)return;c==null||c===!1?t.node.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&t.node.setAttribute(i,c===!0?"":c)}catch{}},{depth:r.path.length});r.__effects.push(a)}if(t.data&&typeof t.data=="object")for(let o in t.data){let s=t.data[o];if(typeof s!="function")continue;let a="data-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),c=at(()=>{try{let l=s(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(a):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(a,l===!0?"":l)}catch{}},{depth:r.path.length});r.__effects.push(c)}let n=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(n)for(let o in n){let s=n[o];if(typeof s!="function")continue;let i=at(()=>{try{let a=s(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:r.path.length});r.__effects.push(i)}if(typeof e.if=="function"){let o=e.if,s=at(()=>{let i;try{i=o(t,t.state,t.context)}catch(c){if(i=!1,r.__ifError=c,typeof console<"u"&&console.warn){let l=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${l} \u2014 treating as false:`,c?.message||c)}return}let a=r.__if;if(r.__if=!!i,a&&!r.__if&&t.node)t.node.remove();else if(!a&&r.__if)if(r.__ifInitialized){t.node||(t.node=Ge(t)),t.node&&(t.node.ref=t);let c=t.parent,l=c?.node;if(l&&t.node){let f=null,p=Object.keys(c),u=p.indexOf(t.key);for(let d=u+1;d<p.length;d++){let h=c[p[d]];if(h?.node?.parentNode===l){f=h.node;break}}f?l.insertBefore(t.node,f):l.appendChild(t.node)}else Hp(t,t.parent);Up(t)}else{if(r.__ifInitialized=!0,t.tag||(t.tag=He(t)),Ze("Init",t,{}),t.node||(t.node=Ge(t)),!t.node)return;Ze("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),vm(t,{});let c=e.if;delete e.if;try{Vp(t,e)}finally{e.if=c}Up(t),wm(t),Cm(t,{}),Hp(t,t.parent)}},{depth:r.path.length});r.__effects.push(s)}for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||_t.has(o)||typeof t[o]!="function")continue;let s=o.charCodeAt(0);if(s>=65&&s<=90||dn(o))continue;let i=t[o];r.__exec[o]=i;let a=t.tag||"div";if(Xe(a,o)&&!pt[o]&&!(yt&&yt.has(o))){let c=o,l=at(()=>{try{let f=i(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1?t.node.removeAttribute(c):typeof f!="function"&&typeof f!="object"&&(c==="src"&&"src"in t.node?t.node.src=f:t.node.setAttribute(c,f===!0?"":f)))}catch{}},{depth:r.path.length});r.__effects.push(l)}}f0(t),u0(t)}function Up(t){let{node:e}=t;if(e){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?e.nodeValue=t.text:e.textContent=t.text:typeof t.text=="number"&&(e.textContent=t.text),d0(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){let r=String(t.value);e.value!==r&&(e.value=r)}if(t.style&&typeof t.style=="object"&&pn(e,t.style),t.attr&&typeof t.attr=="object")for(let r in t.attr){let n=t.attr[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.setAttribute&&e.setAttribute(r,n===!0?"":n)}if(t.data&&typeof t.data=="object")for(let r in t.data){let n=t.data[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.dataset&&(e.dataset[r]=n===!0?"":n)}if(t.classlist||t.class){let r=t.classlist||t.class;if(typeof r=="string")r.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof r=="object")for(let n in r){let o=typeof r[n]=="function"?r[n](t,t.state,t.context):r[n];o&&e.classList.add(typeof o=="string"?o:n)}}}}function _m(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function pn(t,e){if(!t||!e||!t.style)return;let r=null;for(let n in e){let o=e[n];if(o!=null){if(n.charAt(0)==="&"&&typeof o=="object"){r||(r={}),r[n]=o;continue}try{let s=String(o),i=n.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),a=s.trim(),c=/\s*!important\s*$/.test(a),l=a.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,c?"important":"")}catch{}}}r&&l0(t,r)}var c0=0;function l0(t,e){let r=`_ds${c0++}`;t.classList.add(r);let n=t.ownerDocument,o=n.querySelector("style[data-smbls-scoped]");o||(o=n.createElement("style"),o.setAttribute("data-smbls-scoped",""),n.head.appendChild(o));let s="";for(let i in e){let a="."+r,c=i.replace(/&/g,a).split(",").map(f=>{let p=f.trim();return p.includes(a)?p:a+p}).join(", "),l=e[i];if(typeof l=="object"){let f="",p="";for(let u in l){let d=l[u];if(typeof d=="object"){let h=u.includes("&")?c.split(", ").map(m=>u.replace(/&/g,m)).join(", "):c.split(", ").map(m=>`${m} ${u}`).join(", "),g="";for(let m in d)g+=`${m.replace(/[A-Z]/g,y=>"-"+y.toLowerCase())}: ${d[m]};`;p+=`${h} { ${g} }
40
40
  `}else f+=`${u.replace(/[A-Z]/g,h=>"-"+h.toLowerCase())}: ${d};`}f&&(s+=`${c} { ${f} }
41
- `),p&&(s+=p)}}s&&(o.textContent+=s)}function f0(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],a=s.slice(1),c={value:!1},l=at(()=>{let f=t.state&&(et(t.state)?t.state.root:null);if(!f||!et(f))return;let p=f;p=p[i];for(let u=0;u<a.length&&!(p==null||typeof p!="object");u++)if(et(p))p=p[a[u]];else break;if(c.value&&typeof t.onUpdate=="function"){let u=t.context?.designSystem;u&&ct(u);try{t.onUpdate(t,t.state,t.context)}catch(d){t.context?.plugins?.length&&Mt("error",t,{hook:"onUpdate",error:d})||console.error("[DOMQL] subscribeTo onUpdate error:",d)}finally{u&&ot()}}},{depth:r.path.length});c.value=!0,r.__effects.push(l)}}function u0(t){let e=t.__ref;e.__conditionalRunners=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=r.charAt(0);if(n!=="."&&n!=="!")continue;let o=r.slice(1);if(!o)continue;let s=t[r];if(!s||typeof s!="object")continue;let i=n==="!",a={lastMatch:!1,appliedKeys:null},c=()=>{if(!t.node)return;let f,p=t[o];if(p===void 0)if(t.state&&o in t.state)f=t.state[o];else{let h=t.context?.cases?.[o];if(h===void 0)return;try{f=typeof h=="function"?h.call(t,t):h}catch(g){f=!1,e.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}}else if(typeof p=="function")try{f=p(t,t.state,t.context)}catch(h){f=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else f=p;let u=i?!f:!!f;if(u===a.lastMatch)return;a.lastMatch=u;let d=t.context?.designSystem;d&&ct(d);try{if(u){let h={};for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m))continue;let y=typeof s[m]=="function"?s[m](t,t.state,t.context):s[m];if(y!=null)if(pt[m]){let b=pt[m](y,t,t.state,t.context);if(b){let w=Array.isArray(b)?b:[b];for(let x of w)x&&Object.assign(h,x)}}else yt&&yt.has(m)&&(h[m]=y)}let g=Object.keys(h);g.length?(pn(t.node,h),a.appliedKeys=g):a.appliedKeys=null}else if(a.appliedKeys){for(let h of a.appliedKeys)t.node.style[h]="";a.appliedKeys=null}}finally{d&&ot()}};e.__conditionalRunners.push(c);let l=at(c,{depth:e.path.length});e.__effects.push(l)}}var Np=new WeakSet;function p0(t){let e=t.ownerDocument;!e||Np.has(e)||(Np.add(e),queueMicrotask(()=>{Np.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var jp=new WeakSet;function d0(t){let{node:e}=t;if(!e)return;if(jp.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}jp.add(t);let r=t.context?.designSystem;r&&ct(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||_t.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!dn(s)){if(pt[s]){let a=t[s],c=pt[s](a,t,t.state,t.context);if(c){if(Array.isArray(c))for(let l of c)l&&Object.assign(n,l);else Object.assign(n,c);o=!0}}else if(yt&&yt.has(s)){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charCodeAt(0)===45){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="&"){let a=t[s];a&&typeof a=="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"){let c={};for(let l in a){let f=a[l];if(typeof f=="function"&&(f=f(t,t.state,t.context)),!(f==null||typeof f=="function"))if(pt[l]){let p=pt[l](f,t,t.state,t.context);if(p)if(Array.isArray(p))for(let u of p)u&&Object.assign(c,u);else Object.assign(c,p)}else c[l]=f}if(Object.keys(c).length){if(s.length>1&&s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")&&!s.startsWith("@supports")&&(s==="@dark"||s==="@light"||!t.context?.designSystem?.media?.[s.slice(1)])){let f={};for(let u in c){let d=c[u];f[u]=typeof d=="string"&&!d.includes("!important")?d+" !important":d}let p=s.slice(1);n[`[data-theme="${p}"] &`]=f}else{let f=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let u=s.slice(1),d=t.context?.designSystem?.media?.[u]||t.context?.designSystem?.media?.[u];d&&(f=`@media ${d}`)}let p={};for(let u in c){let d=c[u];if(d&&typeof d=="object"&&!Array.isArray(d)){let h={};for(let m in d)if(pt[m]){let y=pt[m](d[m],t,t.state,t.context);if(y)if(Array.isArray(y))for(let b of y)b&&Object.assign(h,b);else Object.assign(h,y)}else h[m]=d[m];let g=u.startsWith(":")?"":" ";if(f.includes(",")){let m=f.split(",").map(y=>`${y.trim()}${g}${u}`).join(", ");n[m]=h}else n[`${f}${g}${u}`]=h}else p[u]=d}Object.keys(p).length&&(n[f]=p)}o=!0}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=ke(n,null,t.context?.cssPrefix);if(s&&e.classList){let a=s.split(" ").filter(Boolean),c=!1;for(let l of a)e.classList.add(l),c||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(c=!0);c&&p0(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let a=n.display;if(a&&a!==i)if(i==="none"){let c=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&c.push(l);for(let l of c)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&ot(),jp.delete(t)}}function wm(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=Lp(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||_t.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!dn(o)&&!(pt[o]||yt&&yt.has(o))&&Xe(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=lr(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function h0(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var km=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function vm(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!dn(r)||km.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(a){return t.call(s,a)}}if(typeof n!="function")continue;let o=o0(r);qe.has(o)||an(s0(o),t,n)}g0(t)}function g0(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let u of km){let d=t[u];typeof d=="function"&&(r[u]=d,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,a=0,c=0,l=!1,f=u=>{let d=u.touches&&u.touches[0]||u.changedTouches&&u.changedTouches[0];d&&(i=d.clientX,a=d.clientY,c=Date.now(),l=!0)},p=u=>{if(!l)return;l=!1;let d=u.changedTouches&&u.changedTouches[0]||u.touches&&u.touches[0];if(!d)return;let h=d.clientX-i,g=d.clientY-a,m=Date.now()-c;if(m>s)return;let y=Math.abs(h),b=Math.abs(g);if(Math.max(y,b)<o)return;let w;if(y>b*1.2)w=h<0?"left":"right";else if(b>y*1.2)w=g<0?"up":"down";else return;let x="onSwipe"+w.charAt(0).toUpperCase()+w.slice(1),v=r[x],A=r.onSwipe;v&&v.call(t,u,t,t.state,t.context),A&&A.call(t,{direction:w,dx:h,dy:g,dt:m,event:u},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",p)}catch{}})}function zp(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=zp(o,s):r[n]=s}return r}function Wp(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=(t.context?.document||globalThis.document)?.createDocumentFragment();if(!s)return;let i=t.childProps,a=t.childrenAs;for(let c=0;c<e.length;c++){let l=e[c],f=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let p=i;if(typeof i=="function")try{p=i(t,l)}catch{p=null}if(a==="state"){let h=f;(typeof f=="string"||typeof f=="number")&&(h={value:f,text:f}),l=p?{...p,state:h}:{state:h}}else p&&(l=zp(p,l));if(n&&!l.ignoreChildExtends)if(l.extends){let h=Array.isArray(l.extends)?l.extends:[l.extends],g=Array.isArray(n)?n:[n];l={...l,extends:[...g,...h]}}else l={extends:n,...l};let u=l?.key||`${c}`,d=Wt(l,t,u,r);d?.node&&s.appendChild(d.node)}t.node.appendChild(s);return}if(typeof e=="string"){let o=Sm(e,t);if(Array.isArray(o)){Wp(t,o,r);return}}if(typeof e=="object")for(let o in e){if(_t.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=zp(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],a=Array.isArray(n)?n:[n];s={...s,extends:[...a,...i]}}else s={extends:n,...s};Wt(s,t,o,r)}}}function Cm(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let a=t.__ref,c=!1,l=at(()=>{let f=i(t,t.state,t.context);if(!c){c=!0;return}if(f===t.children)return;if(t.children=f,Array.isArray(f)&&t.childrenAs==="state"){let d=t.childProps,h=[],g=new Map;for(let v=0;v<f.length;v++){let A=f[v],P=d;if(typeof d=="function")try{P=d(t,A)}catch{P=null}let H=P&&P.key||A&&A.key||`${v}`;h.push(H),g.set(H,{rawChild:A,childProps:P})}let m=new Set(h),y=a.__children.slice();for(let v of y)if(!m.has(v)){let A=t[v];A?.remove&&A.remove(),delete t[v]}let b=t.childExtends,x=(t.context?.document||globalThis.document)?.createDocumentFragment();for(let v of h){let A=g.get(v),P=A.rawChild,H=t[v];if(H&&H.state){if(P&&typeof P=="object"){let N=H.state;if(typeof N.replace=="function")N.replace(P);else if(typeof N.update=="function"){for(let $ in N)if(!($==="__element"||$==="root"||$==="parent"||$==="update")&&!Object.prototype.hasOwnProperty.call(P,$))try{N[$]=void 0}catch{}N.update(P)}else for(let $ in P)N[$]=P[$]}continue}let O=P;(typeof P=="string"||typeof P=="number")&&(O={value:P,text:P});let M=A.childProps,V=M?{...M,state:O}:{state:O};if(b&&!V.ignoreChildExtends)if(V.extends){let N=Array.isArray(V.extends)?V.extends:[V.extends],$=Array.isArray(b)?b:[b];V={...V,extends:[...$,...N]}}else V={extends:b,...V};let tt=Wt(V,t,v,e);tt?.node&&x&&x.appendChild(tt.node)}x&&x.childNodes.length&&t.node&&t.node.appendChild(x),a.__children=h;return}for(let d of[...a.__children]){let h=t[d];h?.remove&&h.remove(),delete t[d]}a.__children=[],Wp(t,f,e)},{depth:a.path.length});a.__effects.push(l)}if(Wp(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let a=0;a<i.length;a++){let c=i[a];if(!c.endsWith("Extends")||typeof t[c]!="string")continue;let l=c.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[c]};delete t[c];for(let p=a+1;p<i.length;p++){let u=i[p],d=u.charCodeAt(0);if(d>=65&&d<=90||_t.has(u)||typeof t[u]=="function"&&(u.startsWith("on")||u.startsWith(".")))break;let h=t[u];h!==void 0&&(f[u]=h,delete t[u])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||_t.has(i)||typeof t[i]!="object"||t[i]===null)continue;let a=i.charCodeAt(0);if(a<65||a>90)continue;let c=t[i];if(!c.__ref){if(!c.extends&&!c.extend){let l=s[i]||s[`smbls.${i}`];l&&(c={extends:l,...c})}if(t.childProps&&(c={...t.childProps,...c}),o&&!c.ignoreChildExtends)if(c.extends){let l=Array.isArray(c.extends)?c.extends:[c.extends],f=Array.isArray(o)?o:[o];c={...c,extends:[...f,...l]}}else c={extends:o,...c};Wt(c,t,i,e)}}}function Hp(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let s=r.node.nextSibling;s?o.insertBefore(n,s):o.appendChild(n)}else o.appendChild(n)}function Ze(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Mt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let a=e.context?.designSystem;a&&ct(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&Mt("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&ot(),i&&(e.__ref.__inRender=!1)}}return!0}var Am={blue:"#213eb0",green:"#389d34",red:"#e15c55",yellow:"#EDCB38",orange:"#e97c16",transparent:"rgba(0, 0, 0, 0)",black:"black",gray:"#4e4e50",white:"white",title:["--gray 1 -168","--gray 1 +168"],caption:["--gray 1 -68","--gray 1 +68"],paragraph:["--gray 1 -42","--gray 1 +42"],disabled:["--gray 1 -26","--gray 1 +26"],line:["--gray 1 -16","--gray 1 +16"]},Em={"gradient-blue-light":`linear-gradient(to right,
41
+ `),p&&(s+=p)}}s&&(o.textContent+=s)}function f0(t){let e=t.subscribeTo;if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o!="string"||o.length===0)continue;let s=o.split("."),i=s[0],a=s.slice(1),c={value:!1},l=at(()=>{let f=t.state&&(et(t.state)?t.state.root:null);if(!f||!et(f))return;let p=f;p=p[i];for(let u=0;u<a.length&&!(p==null||typeof p!="object");u++)if(et(p))p=p[a[u]];else break;if(c.value&&typeof t.onUpdate=="function"){let u=t.context?.designSystem;u&&ct(u);try{t.onUpdate(t,t.state,t.context)}catch(d){t.context?.plugins?.length&&Mt("error",t,{hook:"onUpdate",error:d})||console.error("[DOMQL] subscribeTo onUpdate error:",d)}finally{u&&ot()}}},{depth:r.path.length});c.value=!0,r.__effects.push(l)}}function u0(t){let e=t.__ref;e.__conditionalRunners=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let n=r.charAt(0);if(n!=="."&&n!=="!")continue;let o=r.slice(1);if(!o)continue;let s=t[r];if(!s||typeof s!="object")continue;let i=n==="!",a={lastMatch:!1,appliedKeys:null},c=()=>{if(!t.node)return;let f,p=t[o];if(p===void 0)if(t.state&&o in t.state)f=t.state[o];else{let h=t.context?.cases?.[o];if(h===void 0)return;try{f=typeof h=="function"?h.call(t,t):h}catch(g){f=!1,e.__conditionalError=g,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,g?.message||g)}}else if(typeof p=="function")try{f=p(t,t.state,t.context)}catch(h){f=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else f=p;let u=i?!f:!!f;if(u===a.lastMatch)return;a.lastMatch=u;let d=t.context?.designSystem;d&&ct(d);try{if(u){let h={};for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m))continue;let y=typeof s[m]=="function"?s[m](t,t.state,t.context):s[m];if(y!=null)if(pt[m]){let b=pt[m](y,t,t.state,t.context);if(b){let w=Array.isArray(b)?b:[b];for(let x of w)x&&Object.assign(h,x)}}else yt&&yt.has(m)&&(h[m]=y)}let g=Object.keys(h);g.length?(pn(t.node,h),a.appliedKeys=g):a.appliedKeys=null}else if(a.appliedKeys){for(let h of a.appliedKeys)t.node.style[h]="";a.appliedKeys=null}}finally{d&&ot()}};e.__conditionalRunners.push(c);let l=at(c,{depth:e.path.length});e.__effects.push(l)}}var Np=new WeakSet;function p0(t){let e=t.ownerDocument;!e||Np.has(e)||(Np.add(e),queueMicrotask(()=>{Np.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var jp=new WeakSet;function d0(t){let{node:e}=t;if(!e)return;if(jp.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}jp.add(t);let r=t.context?.designSystem;r&&ct(r);try{let n={},o=!1;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||_t.has(s))continue;let i=s.charCodeAt(0);if(!(i>=65&&i<=90)&&!dn(s)){if(pt[s]){let a=t[s],c=pt[s](a,t,t.state,t.context);if(c){if(Array.isArray(c))for(let l of c)l&&Object.assign(n,l);else Object.assign(n,c);o=!0}}else if(yt&&yt.has(s)){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charCodeAt(0)===45){let a=t[s];a!=null&&typeof a!="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="&"){let a=t[s];a&&typeof a=="object"&&(n[s]=a,o=!0)}else if(s.charAt(0)==="@"||s.charAt(0)===":"){let a=t[s];if(a&&typeof a=="object"){let c={};for(let l in a){let f=a[l];if(typeof f=="function"&&(f=f(t,t.state,t.context)),!(f==null||typeof f=="function"))if(pt[l]){let p=pt[l](f,t,t.state,t.context);if(p)if(Array.isArray(p))for(let u of p)u&&Object.assign(c,u);else Object.assign(c,p)}else c[l]=f}if(Object.keys(c).length){if(s.length>1&&s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")&&!s.startsWith("@supports")&&(s==="@dark"||s==="@light"||!t.context?.designSystem?.media?.[s.slice(1)])){let f={};for(let u in c){let d=c[u];f[u]=typeof d=="string"&&!d.includes("!important")?d+" !important":d}let p=s.slice(1);n[`[data-theme="${p}"] &`]=f}else{let f=s;if(s.charAt(0)==="@"&&!s.startsWith("@media")&&!s.startsWith("@keyframes")){let u=s.slice(1),d=t.context?.designSystem?.media?.[u]||t.context?.designSystem?.media?.[u];d&&(f=`@media ${d}`)}let p={};for(let u in c){let d=c[u];if(d&&typeof d=="object"&&!Array.isArray(d)){let h={};for(let m in d)if(pt[m]){let y=pt[m](d[m],t,t.state,t.context);if(y)if(Array.isArray(y))for(let b of y)b&&Object.assign(h,b);else Object.assign(h,y)}else h[m]=d[m];let g=u.startsWith(":")?"":" ";if(f.includes(",")){let m=f.split(",").map(y=>`${y.trim()}${g}${u}`).join(", ");n[m]=h}else n[`${f}${g}${u}`]=h}else p[u]=d}Object.keys(p).length&&(n[f]=p)}o=!0}o=!0}}}}if(o){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let s=ke(n,null,t.context?.cssPrefix);if(s&&e.classList){let a=s.split(" ").filter(Boolean),c=!1;for(let l of a)e.classList.add(l),c||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(c=!0);c&&p0(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let a=n.display;if(a&&a!==i)if(i==="none"){let c=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&c.push(l);for(let l of c)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&ot(),jp.delete(t)}}function wm(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let o in t.aria){let s=t.aria[o];if(typeof s=="function"||typeof s=="object"||s==null||s===!1)continue;let i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,s===!0?"":s)}let r=Lp(t);for(let o in r){let s=r[o];s!=null&&s!==!1&&typeof s!="function"&&typeof s!="object"&&e.setAttribute(o,s===!0?"":s)}let n=t.tag||"div";for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||_t.has(o)||o==="on"||r[o]!==void 0)continue;let s=o.charCodeAt(0);if(!(s>=65&&s<=90)&&!dn(o)&&!(pt[o]||yt&&yt.has(o))&&Xe(n,o)){let i=t[o];if(i==null||i===!1||(typeof i=="string"&&i.includes("{{")&&(i=lr(i,t,t.state,t.context),t[o]=i),i==null||i===!1||typeof i=="function"||typeof i=="object"))continue;e.setAttribute(o,i===!0?"":i)}}}function h0(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let o=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};o(),e.addEventListener("input",o),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",o)}catch{}})}var km=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function vm(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!dn(r)||km.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let s=n;n=function(a){return t.call(s,a)}}if(typeof n!="function")continue;let o=o0(r);qe.has(o)||an(s0(o),t,n)}g0(t)}function g0(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let u of km){let d=t[u];typeof d=="function"&&(r[u]=d,n=!0)}if(!n)return;let o=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,s=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,a=0,c=0,l=!1,f=u=>{let d=u.touches&&u.touches[0]||u.changedTouches&&u.changedTouches[0];d&&(i=d.clientX,a=d.clientY,c=Date.now(),l=!0)},p=u=>{if(!l)return;l=!1;let d=u.changedTouches&&u.changedTouches[0]||u.touches&&u.touches[0];if(!d)return;let h=d.clientX-i,g=d.clientY-a,m=Date.now()-c;if(m>s)return;let y=Math.abs(h),b=Math.abs(g);if(Math.max(y,b)<o)return;let w;if(y>b*1.2)w=h<0?"left":"right";else if(b>y*1.2)w=g<0?"up":"down";else return;let x="onSwipe"+w.charAt(0).toUpperCase()+w.slice(1),v=r[x],A=r.onSwipe;v&&v.call(t,u,t,t.state,t.context),A&&A.call(t,{direction:w,dx:h,dy:g,dt:m,event:u},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",p,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",p)}catch{}})}function zp(t,e){let r={...t};for(let n in e){let o=r[n],s=e[n];o&&s&&typeof o=="object"&&typeof s=="object"&&!Array.isArray(o)&&!Array.isArray(s)&&typeof o!="function"&&typeof s!="function"?r[n]=zp(o,s):r[n]=s}return r}function Wp(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=(t.context?.document||globalThis.document)?.createDocumentFragment();if(!s)return;let i=t.childProps,a=t.childrenAs;for(let c=0;c<e.length;c++){let l=e[c],f=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let p=i;if(typeof i=="function")try{p=i(t,l)}catch{p=null}if(a==="state"){let h=f;(typeof f=="string"||typeof f=="number")&&(h={value:f,text:f}),l=p?{...p,state:h}:{state:h}}else p&&(l=zp(p,l));if(n&&!l.ignoreChildExtends)if(l.extends){let h=Array.isArray(l.extends)?l.extends:[l.extends],g=Array.isArray(n)?n:[n];l={...l,extends:[...g,...h]}}else l={extends:n,...l};let u=l?.key||f&&typeof f=="object"&&f.key||`${c}`,d=Wt(l,t,u,r);d?.node&&s.appendChild(d.node)}t.node.appendChild(s);return}if(typeof e=="string"){let o=Sm(e,t);if(Array.isArray(o)){Wp(t,o,r);return}}if(typeof e=="object")for(let o in e){if(_t.has(o))continue;let s=e[o];if(!(s==null||s===!1)){if((typeof s=="string"||typeof s=="number")&&(s={text:s}),t.childProps&&(s=zp(t.childProps,s)),n&&!s.ignoreChildExtends)if(s.extends){let i=Array.isArray(s.extends)?s.extends:[s.extends],a=Array.isArray(n)?n:[n];s={...s,extends:[...a,...i]}}else s={extends:n,...s};Wt(s,t,o,r)}}}function Cm(t,e){let{children:r,content:n}=t,o=t.childExtends;if(typeof r=="function"){let i=r;r=i(t,t.state,t.context),t.children=r;let a=t.__ref,c=!1,l=at(()=>{let f=i(t,t.state,t.context);if(!c){c=!0;return}if(f===t.children)return;if(t.children=f,Array.isArray(f)&&t.childrenAs==="state"){let d=t.childProps,h=[],g=new Map;for(let v=0;v<f.length;v++){let A=f[v],P=d;if(typeof d=="function")try{P=d(t,A)}catch{P=null}let H=P&&P.key||A&&A.key||`${v}`;h.push(H),g.set(H,{rawChild:A,childProps:P})}let m=new Set(h),y=a.__children.slice();for(let v of y)if(!m.has(v)){let A=t[v];A?.remove&&A.remove(),delete t[v]}let b=t.childExtends,x=(t.context?.document||globalThis.document)?.createDocumentFragment();for(let v of h){let A=g.get(v),P=A.rawChild,H=t[v];if(H&&H.state){if(P&&typeof P=="object"){let N=H.state;if(typeof N.replace=="function")N.replace(P);else if(typeof N.update=="function"){for(let $ in N)if(!($==="__element"||$==="root"||$==="parent"||$==="update")&&!Object.prototype.hasOwnProperty.call(P,$))try{N[$]=void 0}catch{}N.update(P)}else for(let $ in P)N[$]=P[$]}continue}let O=P;(typeof P=="string"||typeof P=="number")&&(O={value:P,text:P});let M=A.childProps,V=M?{...M,state:O}:{state:O};if(b&&!V.ignoreChildExtends)if(V.extends){let N=Array.isArray(V.extends)?V.extends:[V.extends],$=Array.isArray(b)?b:[b];V={...V,extends:[...$,...N]}}else V={extends:b,...V};let tt=Wt(V,t,v,e);tt?.node&&x&&x.appendChild(tt.node)}x&&x.childNodes.length&&t.node&&t.node.appendChild(x),a.__children=h;return}for(let d of[...a.__children]){let h=t[d];h?.remove&&h.remove(),delete t[d]}a.__children=[],Wp(t,f,e)},{depth:a.path.length});a.__effects.push(l)}if(Wp(t,r||n,e),r||n)return;let s=t.context?.components||{};{let i=Object.keys(t);for(let a=0;a<i.length;a++){let c=i[a];if(!c.endsWith("Extends")||typeof t[c]!="string")continue;let l=c.slice(0,-7);if(!l||l.charCodeAt(0)<65||l.charCodeAt(0)>90)continue;let f={extends:t[c]};delete t[c];for(let p=a+1;p<i.length;p++){let u=i[p],d=u.charCodeAt(0);if(d>=65&&d<=90||_t.has(u)||typeof t[u]=="function"&&(u.startsWith("on")||u.startsWith(".")))break;let h=t[u];h!==void 0&&(f[u]=h,delete t[u])}t[l]&&typeof t[l]=="object"?t[l]={...f,...t[l]}:t[l]=f}}for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||_t.has(i)||typeof t[i]!="object"||t[i]===null)continue;let a=i.charCodeAt(0);if(a<65||a>90)continue;let c=t[i];if(!c.__ref){if(!c.extends&&!c.extend){let l=s[i]||s[`smbls.${i}`];l&&(c={extends:l,...c})}if(t.childProps&&(c={...t.childProps,...c}),o&&!c.ignoreChildExtends)if(c.extends){let l=Array.isArray(c.extends)?c.extends:[c.extends],f=Array.isArray(o)?o:[o];c={...c,extends:[...f,...l]}}else c={extends:o,...c};Wt(c,t,i,e)}}}function Hp(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let s=r.node.nextSibling;s?o.insertBefore(n,s):o.appendChild(n)}else o.appendChild(n)}function Ze(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&Mt(n,e,r);let o="on"+t,s=e[o];if(typeof s=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let a=e.context?.designSystem;a&&ct(a);try{if(s(e,e.state,e.context,r)===!1)return!1}catch(c){if(e.context?.plugins?.length&&Mt("error",e,{hook:o,error:c})||console.error(`[DOMQL] Lifecycle "${o}" error:`,c),e.context?.strictMode)throw c}finally{a&&ot(),i&&(e.__ref.__inRender=!1)}}return!0}var Am={blue:"#213eb0",green:"#389d34",red:"#e15c55",yellow:"#EDCB38",orange:"#e97c16",transparent:"rgba(0, 0, 0, 0)",black:"black",gray:"#4e4e50",white:"white",title:["--gray 1 -168","--gray 1 +168"],caption:["--gray 1 -68","--gray 1 +68"],paragraph:["--gray 1 -42","--gray 1 +42"],disabled:["--gray 1 -26","--gray 1 +26"],line:["--gray 1 -16","--gray 1 +16"]},Em={"gradient-blue-light":`linear-gradient(to right,
42
42
  rgba(4, 116, 242, 1),
43
43
  rgba(0, 48, 103, 1)
44
44
  )`,"gradient-blue-dark":`linear-gradient(to right,