@symbo.ls/element 3.14.692 → 3.14.702

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,13 @@
1
1
  # @symbo.ls/element
2
2
 
3
+ ## 3.14.702
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-generated cross-repo patch release.
8
+ - Updated dependencies
9
+ - @symbo.ls/utils@3.14.702
10
+
3
11
  ## 3.14.692
4
12
 
5
13
  ### Patch Changes
@@ -1,6 +1,6 @@
1
- "use strict";var it=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var Kt=Object.prototype.hasOwnProperty;var Ut=(t,s)=>{for(var n in s)it(t,n,{get:s[n],enumerable:!0})},Vt=(t,s,n,c)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of It(s))!Kt.call(t,a)&&a!==n&&it(t,a,{get:()=>s[a],enumerable:!(c=Mt(s,a))||c.enumerable});return t};var Wt=t=>Vt(it({},"__esModule",{value:!0}),t);var io={};Ut(io,{create:()=>V,default:()=>ro,flushMounts:()=>gt});module.exports=Wt(io);var E=require("@symbo.ls/signal"),j=require("@symbo.ls/signal"),W=require("./cache.js"),R=require("./registry.js"),Tt=require("./delegate.js"),Rt=require("./extends.js"),Nt=require("./methods.js"),uo=require("./dispose.js"),_t=require("./devRuntime.js"),st=require("@symbo.ls/utils"),U=require("@symbo.ls/utils/function.js"),q=require("@symbo.ls/state"),A=require("css-in-props"),B=require("@symbo.ls/css"),b=require("@symbo.ls/scratch"),L=require("attrs-in-props");let Bt=1;const tt=[];let et=!1;function Ht(){et||(et=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(gt):setTimeout(gt,0))}function gt(){if(et=!1,!tt.length)return;const t=tt.splice(0,tt.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||K("Mounted",n,n.__ref?.__mountOptions||{})}}function At(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,tt.push(t),Ht())}function vt(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,U.runPluginHook)("contentUpdate",t,s);const n=t.context?.designSystem;n&&(0,b.pushConfig)(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(c){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onContentUpdate",error:c})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',c),t.context?.strictMode)throw c}finally{n&&(0,b.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function zt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Yt(t){return t.toLowerCase()}function Ct(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function X(t,s){const n={...t};for(const c in s){const a=n[c],o=s[c];a&&o&&typeof a=="object"&&typeof o=="object"&&!Array.isArray(a)&&!Array.isArray(o)&&typeof a!="function"&&typeof o!="function"?n[c]=X(a,o):n[c]=o}return n}function V(t,s,n,c={},a){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=n||t.key||`_${Bt++}`,o.parent=s||null,o.context=t.context||s?.context||c.context||{},o.context.__create||(o.context.__create=V);const i=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||o,path:s?.__ref?.path?[...s.__ref.path,o.key]:[o.key]};if(n&&!t.extends&&!t.extend){const u=n.indexOf("_");if(u>0){const h=n.substring(0,u),g=o.context?.components;g&&(g[h]||g["smbls."+h])?t={...t,extends:h}:g&&(0,_t.isLoudDevRuntime)()&&/^[A-Z]\w*_\d+$/.test(n)&&console.warn(`[smbls] auto-extend: key "${n}" looks like a multi-instance (${h}_N) but neither "${h}" nor "smbls.${h}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,Rt.applyExtends)(o,t,c);const e=new Set(["childProps","attr","style","scope","data"]),r=o.props&&typeof o.props=="object"?o.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;const h=t[u],g=o[u],k=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";k&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?o[u]=X(g,h):k&&e.has(u)?o[u]={...g,...h}:k&&Ct(u)?o[u]=X(g,h):o[u]=h}function f(u){for(const h in u){const g=u[h],k=o[h],x=k&&g&&typeof k=="object"&&typeof g=="object"&&!Array.isArray(k)&&!Array.isArray(g)&&typeof k!="function"&&typeof g!="function";x&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=X(k,g):x&&e.has(h)?o[h]={...k,...g}:x&&Ct(h)?o[h]=X(k,g):o[h]=g}}r&&f(r),t.props&&typeof t.props=="object"&&f(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const d=o.scope&&typeof o.scope=="object"?o.scope:null,l=s?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=l||p||null;if(t.scope!==void 0||d){const u={};d&&Object.assign(u,d),t.scope!==void 0&&Object.assign(u,t.scope),o.scope=(0,E.createScopeStore)(u,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),(0,Nt.addMethods)(o),Gt(o,s,t),o.if!=null){let u;if(typeof o.if=="function")try{u=o.if(o,o.state,o.context)}catch(h){if(u=!1,i.__ifError=h,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,h?.message||h)}}else u=o.if;i.__if=!!u}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&wt(o,i,o.if),o;o.tag||(o.tag=(0,W.detectTag)(o)),K("Init",o,c);const _=o.node=(0,W.cacheNode)(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),i.__fragmentAnchor=h}K("AttachNode",o,c),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),$t(o,c),kt(o),ft(o),Ot(o),no(o);try{Dt(o,c)}catch(u){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,u?.message||u,u?.stack?`
2
- `+u.stack.split(`
1
+ "use strict";var it=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var Ut=Object.prototype.hasOwnProperty;var Vt=(t,s)=>{for(var n in s)it(t,n,{get:s[n],enumerable:!0})},Wt=(t,s,n,c)=>{if(s&&typeof s=="object"||typeof s=="function")for(let f of Kt(s))!Ut.call(t,f)&&f!==n&&it(t,f,{get:()=>s[f],enumerable:!(c=It(s,f))||c.enumerable});return t};var Bt=t=>Wt(it({},"__esModule",{value:!0}),t);var eo={};Vt(eo,{create:()=>V,default:()=>io,flushMounts:()=>_t});module.exports=Bt(eo);var E=require("@symbo.ls/signal"),j=require("@symbo.ls/signal"),W=require("./cache.js"),R=require("./registry.js"),Rt=require("./delegate.js"),Nt=require("./extends.js"),Ft=require("./methods.js"),po=require("./dispose.js"),ht=require("./devRuntime.js"),st=require("@symbo.ls/utils"),U=require("@symbo.ls/utils/function.js"),q=require("@symbo.ls/state"),x=require("css-in-props"),B=require("@symbo.ls/css"),A=require("@symbo.ls/scratch"),L=require("attrs-in-props");let Ht=1;const tt=[];let et=!1;function zt(){et||(et=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(_t):setTimeout(_t,0))}function _t(){if(et=!1,!tt.length)return;const t=tt.splice(0,tt.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||K("Mounted",n,n.__ref?.__mountOptions||{})}}function xt(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,tt.push(t),zt())}function At(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,U.runPluginHook)("contentUpdate",t,s);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(c){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onContentUpdate",error:c})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',c),t.context?.strictMode)throw c}finally{n&&(0,A.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Yt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Gt(t){return t.toLowerCase()}function vt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function X(t,s){const n={...t};for(const c in s){const f=n[c],o=s[c];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[c]=X(f,o):n[c]=o}return n}function V(t,s,n,c={},f){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=n||t.key||`_${Ht++}`,o.parent=s||null,o.context=t.context||s?.context||c.context||{},o.context.__create||(o.context.__create=V);const r=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||o,path:s?.__ref?.path?[...s.__ref.path,o.key]:[o.key]};if(n&&!t.extends&&!t.extend){const l=n.indexOf("_");if(l>0){const h=n.substring(0,l),g=o.context?.components;g&&(g[h]||g["smbls."+h])?t={...t,extends:h}:g&&(0,ht.isLoudDevRuntime)()&&/^[A-Z]\w*_\d+$/.test(n)&&console.warn(`[smbls] auto-extend: key "${n}" looks like a multi-instance (${h}_N) but neither "${h}" nor "smbls.${h}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,Nt.applyExtends)(o,t,c);const i=new Set(["childProps","attr","style","scope","data"]),e=o.props&&typeof o.props=="object"?o.props:null;for(const l in t){if(l==="parent"||l==="node"||l==="__ref"||l==="extends"||l==="context"||l==="props")continue;const h=t[l],g=o[l],k=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";k&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?o[l]=X(g,h):k&&i.has(l)?o[l]={...g,...h}:k&&vt(l)?o[l]=X(g,h):o[l]=h}function a(l){for(const h in l){const g=l[h],k=o[h],b=k&&g&&typeof k=="object"&&typeof g=="object"&&!Array.isArray(k)&&!Array.isArray(g)&&typeof k!="function"&&typeof g!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=X(k,g):b&&i.has(h)?o[h]={...k,...g}:b&&vt(h)?o[h]=X(k,g):o[h]=g}}e&&a(e),t.props&&typeof t.props=="object"&&a(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const d=o.scope&&typeof o.scope=="object"?o.scope:null,u=s?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=u||p||null;if(t.scope!==void 0||d){const l={};d&&Object.assign(l,d),t.scope!==void 0&&Object.assign(l,t.scope),o.scope=(0,E.createScopeStore)(l,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),(0,Ft.addMethods)(o),Zt(o,s,t),o.if!=null){let l;if(typeof o.if=="function")try{l=o.if(o,o.state,o.context)}catch(h){if(l=!1,r.__ifError=h,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,h?.message||h)}}else l=o.if;r.__if=!!l}if(r.__if)typeof o.if=="function"&&(r.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&wt(o,r,o.if),o;o.tag||(o.tag=(0,W.detectTag)(o)),K("Init",o,c);const _=o.node=(0,W.cacheNode)(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),r.__fragmentAnchor=h}K("AttachNode",o,c),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),$t(o,c),St(o),at(o),Ot(o),co(o);try{Dt(o,c)}catch(l){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,l?.message||l,l?.stack?`
2
+ `+l.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(yt(o,!0),ht(o,s,a),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const u=o.context?.designSystem;u&&(0,b.pushConfig)(u);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{u&&(0,b.popConfig)()}}if(K("Create",o,c),K("Complete",o,c),K("Render",o,c),K("RenderRouter",o,c),At(o,c),typeof o.onFrame=="function"){const u=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&(0,b.pushConfig)(h);try{u(o,o.state,o.context)}catch(k){console.error("[DOMQL] onFrame error:",k)}finally{h&&(0,b.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Gt(t,s,n){const c=!s,a=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=c&&a&&t.context?.state,i=n.state!==void 0&&!o?n.state:t.state&&!(0,E.isStore)(t.state)?t.state:void 0;if(i==null){if(s?.state)t.state=s.state,(0,q.applyStateMethods)(t,t.state);else if(t.context?.state){const e=t.context.state,r={...e},f=t.context?.polyglot;if(f?.translations){const d=e.lang||f.defaultLang||"en",l=f.translations[d];if(l&&typeof l=="object")for(const y in l)r[y]===void 0&&(r[y]=l[y]);const p=new Set(f.languages||[]);for(const y in f.translations)!p.has(y)&&r[y]===void 0&&(r[y]=f.translations[y])}t.state=(0,E.isStore)(r)?r:(0,E.createStore)(r),t.state.__element=t,t.state.root=t.state,(0,q.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,q.applyStateMethods)(t,t.state);return}if(typeof i=="string"){if(t.state=St(i,s),t.state&&typeof t.state=="object"&&!(0,E.isStore)(t.state)){const e=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:e,enumerable:!1,configurable:!0,writable:!0})}(0,q.applyStateMethods)(t,t.state);return}if(typeof i=="function"){const e=i(t,s?.state);t.state=(0,E.isStore)(e)?e:(0,E.createStore)(e||{})}else(0,E.isStore)(i)?t.state=i:t.state=(0,E.createStore)({...i});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,q.applyStateMethods)(t,t.state)}function at(t,s){if(!s)return t;const n=s.split("/");let c=t;for(const a of n){if(c==null)return{};c=c[a]}return c??{}}function St(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const a=t.slice(3);return a?at(s.state,a):s.state??{}}if(t.startsWith("~/")){const a=s.state?.root||s.state,o=t.slice(2);return o?at(a,o):a??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=at(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const c=s.context?.polyglot;if(c?.translations){const a=s.state?.root?.lang||c.defaultLang||"en",o=c.translations[a];if(o?.[t]!==void 0)return o[t];if(c.translations[t]!==void 0)return c.translations[t]}return{}}function Zt(t){const s=t.__ref,n=t.tag||"div",c=t.context?.designSystem,a=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const e=o[i];if(typeof t[e]!="function"||R.REGISTRY.has(e))continue;const r=e.charCodeAt(0);r>=65&&r<=90||Y(e)||A.CSS_PROPS_REGISTRY[e]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(e)||(0,L.checkAttributeByTagName)(n,e)||a.push({prop:e,fn:t[e]})}for(let i=0;i<a.length;i++){const{prop:e,fn:r}=a[i];s.__exec[e]=r,Object.defineProperty(t,e,{get(){c&&(0,b.pushConfig)(c);try{return r(t,t.state,t.context)}catch{return}finally{c&&(0,b.popConfig)()}},set(f){delete s.__exec[e],Object.defineProperty(t,e,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function qt(t,s){if(!(!Array.isArray(s)||s.length===0))for(let n=0;n<s.length;n++){const c=s[n];try{typeof c=="function"?c(t,t.state,t.context):typeof c=="string"&&t.state?.[c]}catch{}}}function O(t,s,n){return!Array.isArray(s)||s.length===0?n:function(...c){return qt(t,s),n.apply(this,c)}}function J(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function kt(t,s){const n=t.__ref,c=!!(s&&s.skipIfEffect);if(Zt(t),typeof t.text=="function"){const o=t.text,i=O(t,t.textDeps,o),e=(0,j.createEffect)(()=>{if(!n.contentManaged)try{let r=i(t,t.state,t.context);t.node&&r!=null&&typeof r!="function"&&typeof r!="object"&&(typeof r=="string"&&r.includes("{{")&&(r=st.replaceLiteralsWithObjectFields.call(t,r,t.state)),t.tag==="string"?t.node.nodeValue=r:t.node.textContent=r)}catch{}},{depth:n.path.length});n.__effects.push(e),n.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,i=(0,j.createEffect)(()=>{if(n.contentManaged)return;const e=st.replaceLiteralsWithObjectFields.call(t,o,t.state);e!=null&&(t.text=e),t.node&&(t.tag==="string"?t.node.nodeValue=e??"":t.node.textContent=e??"")},{depth:n.path.length});n.__effects.push(i),n.__exec.text=o}for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!R.REGISTRY.has(o)&&!Y(o)&&!n.__exec[o]){if(A.CSS_PROPS_REGISTRY[o]){const i=t[o],e=O(t,t[o+"Deps"],i),r=o;let f;const d=(0,j.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,b.pushConfig)(l);try{const p=e(t,t.state,t.context),y=A.CSS_PROPS_REGISTRY[r](p,t,t.state,t.context);if(y&&t.node){const _=jt(y);(_===null||_!==f)&&(f=_,G(t.node,y))}else t.node&&(r==="show"||r==="hide")&&(f=void 0,t.node.style.display="")}finally{l&&(0,b.popConfig)()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=i}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const i=t[o],e=O(t,t[o+"Deps"],i),r=o;let f;const d=(0,j.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,b.pushConfig)(l);try{const p=e(t,t.state,t.context);if(t.node)if(p!=null){const y=r+":"+String(p);y!==f&&(f=y,G(t.node,{[r]:p}))}else f=void 0,t.node.style[r]=""}finally{l&&(0,b.popConfig)()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=O(t,t.htmlDeps,o),e=(0,j.createEffect)(()=>{const r=t.context?.designSystem;r&&(0,b.pushConfig)(r);try{const f=i(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&(t.node.innerHTML=f)}finally{r&&(0,b.popConfig)()}},{depth:n.path.length});n.__effects.push(e),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=O(t,t.valueDeps,o),e=(0,j.createEffect)(()=>{try{const r=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const f=r==null?"":String(r);if(t.node.value===f)return;const d=typeof document<"u"&&document.activeElement===t.node,l=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=f,d&&l!=null&&p!=null)try{t.node.setSelectionRange(l,p)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(e),n.__exec.value=o}if(typeof t.style=="function"){const o=t.style,i=O(t,t.styleDeps,o);let e;const r=(0,j.createEffect)(()=>{const f=i(t,t.state,t.context),d=jt(f);(d===null||d!==e)&&(e=d,G(t.node,f))},{depth:n.path.length});n.__effects.push(r),n.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const i=t.style[o];if(typeof i!="function")continue;const e=O(t,J(t.styleDeps,o),i);let r;const f=(0,j.createEffect)(()=>{try{const d=e(t,t.state,t.context);if(t.node){const l=o+":"+String(d);l!==r&&(r=l,G(t.node,{[o]:d}))}}catch{}},{depth:n.path.length});n.__effects.push(f)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=O(t,J(t.attrDeps,o),t.attr[o]),e=o,r=(0,j.createEffect)(()=>{try{const f=i(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1?t.node.removeAttribute(e):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(e,f===!0?"":f))}catch{}},{depth:n.path.length});n.__effects.push(r)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const i=O(t,J(t.ariaDeps,o),t.aria[o]),e="aria-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),r=(0,j.createEffect)(()=>{try{const f=i(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(e):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(e,f===!0?"":f)}catch{}},{depth:n.path.length});n.__effects.push(r)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const i=O(t,J(t.dataDeps,o),t.data[o]),r="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),f=(0,j.createEffect)(()=>{try{const d=i(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(r):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(r,d===!0?"":d)}catch{}},{depth:n.path.length});n.__effects.push(f)}const a=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(a)for(const o in a){if(typeof a[o]!="function")continue;const i=O(t,J(t.classDeps,o),a[o]),e=(0,j.createEffect)(()=>{try{const r=i(t,t.state,t.context);if(!t.node?.classList)return;typeof r=="string"?t.node.classList.add(r):r?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:n.path.length});n.__effects.push(e)}!c&&typeof t.if=="function"&&wt(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||R.REGISTRY.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||Y(o))continue;const e=t[o];n.__exec[o]=e;const r=t.tag||"div";if((0,L.checkAttributeByTagName)(r,o)&&!A.CSS_PROPS_REGISTRY[o]&&!(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const f=(0,L.camelToAttr)(o)||o,d=O(t,t[o+"Deps"],e),l=(0,j.createEffect)(()=>{try{const p=d(t,t.state,t.context);t.node?.setAttribute&&(p==null||p===!1?t.node.removeAttribute(f):typeof p!="function"&&typeof p!="object"&&(f==="src"&&"src"in t.node?t.node.src=p:t.node.setAttribute(f,p===!0?"":p)))}catch{}},{depth:n.path.length});n.__effects.push(l)}}if(Jt(t),to(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let e=!1,r=[];const f=(0,j.createEffect)(()=>{const d=[];for(let _=0;_<i.length;_++){const u=i[_];try{d[_]=typeof u=="function"?u(t,t.state,t.context):t.state?.[u]}catch{d[_]=void 0}}if(!e){e=!0,r=d;return}let l=d.length!==r.length;for(let _=0;!l&&_<d.length;_++)d[_]!==r[_]&&(l=!0);const p=r;if(r=d,!l)return;const y=t.context?.designSystem;y&&(0,b.pushConfig)(y);try{o(t,t.state,t.context,{prev:p,next:d})}catch(_){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{y&&(0,b.popConfig)()}},{depth:n.path.length});n.__effects.push(f)}}function wt(t,s,n){const c=O(t,t.ifDeps,n),a=(0,j.createEffect)(()=>{let o;try{o=c(t,t.state,t.context)}catch(e){if(o=!1,s.__ifError=e,typeof console<"u"&&console.warn){const r=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${r} \u2014 treating as false:`,e?.message||e)}return}const i=s.__if;if(s.__if=!!o,i&&!s.__if&&t.node)t.node.remove();else if(!i&&s.__if)if(s.__ifInitialized){t.node||(t.node=(0,W.cacheNode)(t)),t.node&&(t.node.ref=t);const e=t.parent,r=e?.node;if(r&&t.node){let f=null;const d=Object.keys(e),l=d.indexOf(t.key);for(let p=l+1;p<d.length;p++){const y=e[d[p]];if(y?.node?.parentNode===r){f=y.node;break}}f?r.insertBefore(t.node,f):r.appendChild(t.node)}else ht(t,t.parent);ft(t)}else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,W.detectTag)(t)),K("Init",t,{}),t.node||(t.node=(0,W.cacheNode)(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const r=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(r),s.__fragmentAnchor=r}K("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),$t(t,{}),kt(t,{skipIfEffect:!0}),ft(t),Ot(t),Dt(t,{}),ht(t,t.parent),At(t,{})}},{depth:s.path.length});s.__effects.push(a)}function ft(t){const{node:s}=t;if(s){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?s.nodeValue=t.text:s.textContent=t.text:typeof t.text=="number"&&(s.textContent=t.text),so(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in s){const n=String(t.value);s.value!==n&&(s.value=n)}if(t.style&&typeof t.style=="object"&&G(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const c=t.attr[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.setAttribute&&s.setAttribute(n,c===!0?"":c)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.dataset&&(s.dataset[n]=c===!0?"":c)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(c=>c&&s.classList.add(c));else if(typeof n=="object")for(const c in n){const a=typeof n[c]=="function"?n[c](t,t.state,t.context):n[c];a&&s.classList.add(typeof a=="string"?a:c)}}}}function jt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function G(t,s){if(!t||!s||!t.style)return;let n=null;for(const c in s){const a=s[c];if(a!=null){if(c.charAt(0)==="&"&&typeof a=="object"){n||(n={}),n[c]=a;continue}try{const o=String(a),i=c.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),e=o.trim(),r=/\s*!important\s*$/.test(e),f=e.replace(/\s*!important\s*$/,"");t.style.setProperty(i,f,r?"important":"")}catch{}}}n&&Xt(t,n)}let Qt=0;function Xt(t,s){const n=`_ds${Qt++}`;t.classList.add(n);const c=t.ownerDocument;let a=c.querySelector("style[data-smbls-scoped]");a||(a=c.createElement("style"),a.setAttribute("data-smbls-scoped",""),c.head.appendChild(a));let o="";for(const i in s){const e="."+n,r=i.replace(/&/g,e).split(",").map(d=>{const l=d.trim();return l.includes(e)?l:e+l}).join(", "),f=s[i];if(typeof f=="object"){let d="",l="";for(const p in f){const y=f[p];if(typeof y=="object"){const _=p.includes("&")?r.split(", ").map(h=>p.replace(/&/g,h)).join(", "):r.split(", ").map(h=>`${h} ${p}`).join(", ");let u="";for(const h in y)u+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[h]};`;l+=(0,B.wrapHoverRule)(`${_} { ${u} }`,_)+`
5
- `}else d+=`${p.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(o+=(0,B.wrapHoverRule)(`${r} { ${d} }`,r)+`
6
- `),l&&(o+=l)}}o&&(a.textContent+=o)}function Jt(t){let s=t.subscribeTo;if(typeof s=="function")try{s=s(t,t.state,t.context)}catch{s=null}if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let c=0;c<s.length;c++){const a=s[c];if(typeof a!="string"||a.length===0)continue;const o=a.split("."),i=o[0],e=o.slice(1),r={value:!1},f=(0,j.createEffect)(()=>{const d=t.state&&((0,E.isStore)(t.state)?t.state.root:null);if(!d||!(0,E.isStore)(d))return;let l=d;l=l[i];for(let y=0;y<e.length&&!(l==null||typeof l!="object");y++)if((0,E.isStore)(l))l=l[e[y]];else break;if(!r.value)return;let p=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&(0,b.pushConfig)(y);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(p=!0)}catch(_){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&(0,b.popConfig)()}}if(!p&&t.node&&n.__effects)for(let y=0;y<n.__effects.length;y++){const _=n.__effects[y];_&&_!==f&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!p&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&(0,b.pushConfig)(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&(0,b.popConfig)()}}},{depth:n.path.length});r.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function dt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}const Et=new Set;function mt(t,s){const n=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",c=n+"::"+t;Et.has(c)||(Et.add(c),console.warn(`[smbls/css] "${t}" at ${n} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function Z(t,s,n){const c={},a=(o,i)=>{if(A.CSS_PROPS_REGISTRY[o]){const e=A.CSS_PROPS_REGISTRY[o](i,s,s.state,s.context);if(e){const r=Array.isArray(e)?e:[e];for(const f of r)f&&Object.assign(c,f)}}else c[o]=i};for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let i=t[o];if(typeof i=="function"&&(i=i(s,s.state,s.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(o==="style"){for(const f in i){let d=i[f];typeof d=="function"&&(d=d(s,s.state,s.context)),!(d==null||typeof d=="function")&&a(f,d)}continue}if(dt(o,s)){const f=Z(i,s,!0);Object.keys(f).length&&(c[`[data-theme="${o.slice(1)}"] &`]=f);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(o)){(0,_t.isLoudDevRuntime)()&&mt(o,s);continue}let e=o;if(o.charCodeAt(0)===64&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const f=s.context?.designSystem?.media?.[o.slice(1)];f&&(e=`@media ${f}`)}const r=Z(i,s,!1);Object.keys(r).length&&(c[e]=r);continue}a(o,i)}}if(n)for(const o in c){const i=c[o];typeof i=="string"&&!i.includes("!important")&&(c[o]=i+" !important")}return c}function to(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;const a=c.charAt(0);if(a!=="."&&a!=="!")continue;const o=c.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const l=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${c}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${a}\` is read as one prop name. Nest the selector inside instead: \`${a}${l}: { '${o.slice(l.length)}': {...} }\`.`)}continue}const i=t[c];if(!i||typeof i!="object")continue;const e=a==="!",r={lastMatch:!1,appliedKeys:null,appliedClasses:null},f=()=>{if(!t.node)return;let l;const p=t[o];if(p===void 0)if(t.state&&o in t.state)l=t.state[o];else{const u=t.context?.cases?.[o];if(u===void 0)return;try{l=typeof u=="function"?u.call(t,t):u}catch(h){l=!1,s.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof p=="function")try{l=p(t,t.state,t.context)}catch(u){l=!1,s.__conditionalError=u,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,u?.message||u)}else l=p;const y=e?!l:!!l;if(y===r.lastMatch)return;r.lastMatch=y;const _=t.context?.designSystem;_&&(0,b.pushConfig)(_);try{if(y){const u={},h={};let g=!1;for(const x in i){if(!Object.prototype.hasOwnProperty.call(i,x))continue;const v=i[x],w=x.charAt(0);if((w===":"||w==="@"||w==="&")&&v&&typeof v=="object"&&!Array.isArray(v)){if(dt(x,t)){const $=Z(v,t,!0);Object.keys($).length&&(h[`[data-theme="${x.slice(1)}"] &`]=$,g=!0)}else{let $=x;if(w==="@"&&!x.startsWith("@media")&&!x.startsWith("@keyframes")){const T=t.context?.designSystem?.media?.[x.slice(1)];T&&($=`@media ${T}`)}const H=Z(v,t,!1);Object.keys(H).length&&(h[$]=H,g=!0)}continue}const F=typeof v=="function"?v(t,t.state,t.context):v;if(F!=null)if(A.CSS_PROPS_REGISTRY[x]){const $=A.CSS_PROPS_REGISTRY[x](F,t,t.state,t.context);if($){const H=Array.isArray($)?$:[$];for(const T of H)T&&Object.assign(u,T)}}else A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(x)&&(u[x]=F)}const k=Object.keys(u);if(k.length){G(t.node,u);for(const x of k)n.set(x,c);r.appliedKeys=k}else r.appliedKeys=null;if(g){const x=(0,B.css)(h,null,t.context?.cssPrefix),v=x?x.split(" ").filter(Boolean):[];if(v.length&&t.node.classList){for(const w of v)t.node.classList.add(w);r.appliedClasses=v}else r.appliedClasses=null}else if(r.appliedClasses){for(const x of r.appliedClasses)t.node.classList.remove(x);r.appliedClasses=null}}else{if(r.appliedKeys){for(const u of r.appliedKeys)n.get(u)===c&&(t.node.style[u]="",n.delete(u));r.appliedKeys=null}if(r.appliedClasses){for(const u of r.appliedClasses)t.node.classList.remove(u);r.appliedClasses=null}}}finally{_&&(0,b.popConfig)()}};s.__conditionalRunners.push(f);const d=(0,j.createEffect)(f,{depth:s.path.length});s.__effects.push(d)}}const ut=new WeakSet;function oo(t){const s=t.ownerDocument;!s||ut.has(s)||(ut.add(s),queueMicrotask(()=>{ut.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const pt=new WeakSet;let Pt=!1;function so(t){const{node:s}=t;if(!s)return;if(Pt||(Pt=!0,(0,B.css)({display:"none"})),pt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}pt.add(t);const n=t.context?.designSystem;n&&(0,b.pushConfig)(n);try{const c={};let a=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||R.REGISTRY.has(o))continue;const i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!Y(o)){if(A.CSS_PROPS_REGISTRY[o]){const e=t[o],r=A.CSS_PROPS_REGISTRY[o](e,t,t.state,t.context);if(r){if(Array.isArray(r))for(const f of r)f&&Object.assign(c,f);else Object.assign(c,r);a=!0}}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const e=t[o];e!=null&&typeof e!="object"&&(c[o]=e,a=!0)}else if(o.charCodeAt(0)===45){const e=t[o];e!=null&&typeof e!="object"&&(c[o]=e,a=!0)}else if(o.charAt(0)==="&"){const e=t[o];e&&typeof e=="object"&&(c[o]=e,a=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const e=t[o];if(e&&typeof e=="object"){if(dt(o,t)){const r=Z(e,t,!0);Object.keys(r).length&&(c[`[data-theme="${o.slice(1)}"] &`]=r,a=!0)}else{let r=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const d=t.context?.designSystem?.media?.[o.slice(1)];d&&(r=`@media ${d}`)}const f=Z(e,t,!1);Object.keys(f).length&&(c[r]=f,a=!0)}a=!0}}}}if(a){c.display&&String(c.display).includes("!important")&&(s.style.setProperty("display",String(c.display).replace(/\s*!important\s*$/,""),"important"),delete c.display);const o=(0,B.css)(c,null,t.context?.cssPrefix);if(o&&s.classList){const e=o.split(" ").filter(Boolean);let r=!1;for(const f of e)s.classList.add(f),r||(f.charCodeAt(0)===95&&f.charCodeAt(1)===99||f.charCodeAt(0)===95&&f.indexOf("_c",1)!==-1)&&(r=!0);r&&oo(s)}const i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){const e=c.display;if(e&&e!==i)if(i==="none"){const r=[];for(const f of s.classList)f.startsWith("_d-")&&f!=="_d-none"&&r.push(f);for(const f of r)s.classList.remove(f);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&(0,b.popConfig)(),pt.delete(t)}}function Ot(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const a in t.aria){const o=t.aria[a];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const i="aria-"+a.replace(/[A-Z]/g,e=>"-"+e.toLowerCase());s.setAttribute(i,o===!0?"":o)}const n=(0,L.applyAttrTransforms)(t);for(const a in n){const o=n[a];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(a,o===!0?"":o)}const c=t.tag||"div";for(const a in t){if(!Object.prototype.hasOwnProperty.call(t,a)||typeof t[a]=="function"||R.REGISTRY.has(a)||a==="on"||n[a]!==void 0)continue;const o=a.charCodeAt(0);if(!(o>=65&&o<=90)&&!Y(a)&&!(A.CSS_PROPS_REGISTRY[a]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(a))&&(0,L.checkAttributeByTagName)(c,a)){let i=t[a];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=(0,st.replaceLiteralsWithObjectFields)(i,t,t.state,t.context),t[a]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!(0,L.isEnumeratedTrueFalseAttr)((0,L.camelToAttr)(a)||a))continue;const e=(0,L.camelToAttr)(a)||a;s.setAttribute(e,(0,L.serializeAttrValue)(e,i))}}}function no(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,c=n&&typeof n=="object"&&n.max?String(n.max):null;c&&(s.style.maxHeight=c);const a=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};a(),s.addEventListener("input",a),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",a)}catch{}})}const Lt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function $t(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!Y(n)||Lt.has(n))continue;let c=t[n];if(typeof c=="string"&&/^[A-Za-z_$][\w$]*$/.test(c)){const o=c;c=function(e){return t.call(o,e)}}if(typeof c!="function")continue;const a=zt(n);R.LIFECYCLE_EVENTS.has(a)||(0,Tt.registerEvent)(Yt(a),t,c)}co(t)}function co(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let c=!1;for(const p of Lt){const y=t[p];typeof y=="function"&&(n[p]=y,c=!0)}if(!c)return;const a=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,e=0,r=0,f=!1;const d=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(i=y.clientX,e=y.clientY,r=Date.now(),f=!0)},l=p=>{if(!f)return;f=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const _=y.clientX-i,u=y.clientY-e,h=Date.now()-r;if(h>o)return;const g=Math.abs(_),k=Math.abs(u);if(Math.max(g,k)<a)return;let x;if(g>k*1.2)x=_<0?"left":"right";else if(k>g*1.2)x=u<0?"up":"down";else return;const v="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),w=n[v],F=n.onSwipe;w&&w.call(t,p,t,t.state,t.context),F&&F.call(t,{direction:x,dx:_,dy:u,dt:h,event:p},t,t.state,t.context)};s.addEventListener("touchstart",d,{passive:!0}),s.addEventListener("touchend",l,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",d)}catch{}try{s.removeEventListener("touchend",l)}catch{}})}function ot(t,s){const n={...t};for(const c in s){const a=n[c],o=s[c];a&&o&&typeof a=="object"&&typeof o=="object"&&!Array.isArray(a)&&!Array.isArray(o)&&typeof a!="function"&&typeof o!="function"?n[c]=ot(a,o):n[c]=o}return n}function lt(t,s,n){if(!s||!t.node)return;const c=t.childExtends;if(Array.isArray(s)){const a=t.tag==="fragment",o=t.context?.document||globalThis.document,i=a?null:o?.createDocumentFragment();if(!a&&!i)return;const e=t.childProps,r=t.childrenAs;for(let f=0;f<s.length;f++){let d=s[f];const l=d;(typeof d=="string"||typeof d=="number")&&(d={text:d});let p=e;if(typeof e=="function")try{p=e(t,d)}catch{p=null}if(r==="state"){let u=l;(typeof l=="string"||typeof l=="number")&&(u={value:l,text:l}),d=p?{...p,state:u}:{state:u}}else p&&(d=ot(p,d));if(c&&!d.ignoreChildExtends)if(d.extends){const u=Array.isArray(d.extends)?d.extends:[d.extends],h=Array.isArray(c)?c:[c];d={...d,extends:[...h,...u]}}else d={...d,extends:c};const y=d?.key||l&&typeof l=="object"&&l.key||`${f}`;let _;try{_=V(d,t,y,n)}catch(u){if(typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y}" failed to construct at ${h} (initial render, skipping this row):`,u?.message||u)}continue}!a&&_?.node&&i.appendChild(_.node)}a||t.node.appendChild(i);return}if(typeof s=="string"){const a=St(s,t);if(Array.isArray(a)){lt(t,a,n);return}}if(typeof s=="object")for(const a in s){if(R.REGISTRY.has(a))continue;let o=s[a];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=ot(t.childProps,o)),c&&!o.ignoreChildExtends)if(o.extends){const i=Array.isArray(o.extends)?o.extends:[o.extends],e=Array.isArray(c)?c:[c];o={...o,extends:[...e,...i]}}else o={...o,extends:c};V(o,t,a,n)}}}function yt(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const c=n.options;if(!c||!c.length)return;const a=t.__ref,o=a&&a.__exec&&a.__exec.value,i=typeof o=="function",e=t.value!=null&&typeof t.value!="function";if(i||e){let d;if(i)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const l=d==null?"":String(d);n.value!==l&&(n.value=l);return}const r=s||!(a&&a.__selectSynced);if(a&&(a.__selectSynced=!0),!r)return;let f=-1;for(let d=0;d<c.length;d++)c[d].defaultSelected&&(f=d);f>=0&&n.selectedIndex!==f&&(n.selectedIndex=f)}function Dt(t,s){let{children:n,content:c}=t;const a=t.childExtends;if(typeof n=="function"){const i=n;try{n=i(t,t.state,t.context)}catch(l){if(n=void 0,typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,l?.message||l)}}t.children=n;const e=t.__ref;let r=!1;const f=O(t,t.childrenDeps,i),d=(0,j.createEffect)(()=>{const l=r;r=!0;let p;try{p=f(t,t.state,t.context)}catch(v){if(typeof console<"u"&&console.error){const w=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${w}${l?"":" (initial tracking run)"}:`,v?.message||v)}return}if(!l||p===t.children)return;t.children=p;const y=typeof t.onContentUpdate=="function",_=y?[]:null,u=y?[]:null,h=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const v=t.childProps,w=[],F=new Map;for(let C=0;C<p.length;C++){const D=p[C];let S=v;if(typeof v=="function")try{S=v(t,D)}catch{S=null}const M=S&&S.key||D&&D.key||`${C}`;w.push(M),F.set(M,{rawChild:D,childProps:S})}const $=new Set(w),H=e.__children.slice();for(const C of H)if(!$.has(C)){const D=t[C];D?.remove&&D.remove(),delete t[C],u&&u.push(C)}const T=t.childExtends,m=t.tag==="fragment",Ft=t.context?.document||globalThis.document,Q=m?null:Ft?.createDocumentFragment(),nt=new Set;for(const C of w){const D=F.get(C),S=D.rawChild,M=t[C];if(M&&M.state){if(S&&typeof S=="object"){const P=M.state,z=P.$replace||P.replace,bt=P.$update||P.update;if(typeof z=="function")z.call(P,S);else if(typeof bt=="function"){for(const I in P)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(S,I))try{P[I]=void 0}catch{}bt.call(P,S)}else for(const I in S)P[I]=S[I]}h&&h.push(C);continue}let ct=S;(typeof S=="string"||typeof S=="number")&&(ct={value:S,text:S});const xt=D.childProps;let N=xt?{...xt,state:ct}:{state:ct};if(T&&!N.ignoreChildExtends)if(N.extends){const P=Array.isArray(N.extends)?N.extends:[N.extends],z=Array.isArray(T)?T:[T];N={...N,extends:[...z,...P]}}else N={...N,extends:T};let rt;try{rt=V(N,t,C,s)}catch(P){if(typeof console<"u"&&console.error){const z=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${z} (reconcile, skipping this row):`,P?.message||P)}nt.add(C);continue}!m&&rt?.node&&Q&&Q.appendChild(rt.node),_&&_.push(C)}if(!m&&Q&&Q.childNodes.length&&t.node&&t.node.appendChild(Q),!m&&t.node){let C=null;for(const D of w){const S=t[D]?.node;if(!S)continue;const M=C?C.nextSibling:t.node.firstChild;S!==M&&t.node.insertBefore(S,M),C=S}}e.__children=nt.size?w.filter(C=>!nt.has(C)):w,y&&(_.length||u.length)&&vt(t,{added:_,removed:u,kept:h}),yt(t,!1);return}const x=y?[...e.__children]:null;for(const v of[...e.__children]){const w=t[v];w?.remove&&w.remove(),delete t[v]}e.__children=[],lt(t,p,s),yt(t,!1),y&&vt(t,{added:[...e.__children],removed:x,kept:[]})},{depth:e.path.length});e.__effects.push(d)}if(lt(t,n||c,s),n||c)return;const o=t.context?.components||{};{const i=Object.keys(t);for(let e=0;e<i.length;e++){const r=i[e];if(!r.endsWith("Extends")||typeof t[r]!="string")continue;const f=r.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;const d={extends:t[r]};delete t[r];for(let l=e+1;l<i.length;l++){const p=i[l],y=p.charCodeAt(0);if(y>=65&&y<=90||R.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const _=t[p];_!==void 0&&(d[p]=_,delete t[p])}t[f]&&typeof t[f]=="object"?t[f]={...d,...t[f]}:t[f]=d}}for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||R.REGISTRY.has(i)||typeof t[i]!="object"||t[i]===null)continue;const e=i.charCodeAt(0);if(e<65||e>90)continue;let r=t[i];if(!r.__ref){if(!r.extends&&!r.extend){const f=o[i]||o[`smbls.${i}`];f&&(r={...r,extends:f})}if(t.childProps&&(r=ot(t.childProps,r)),a&&!r.ignoreChildExtends)if(r.extends){const f=Array.isArray(r.extends)?r.extends:[r.extends],d=Array.isArray(a)?a:[a];r={...r,extends:[...d,...f]}}else r={...r,extends:a};V(r,t,i,s)}}}function ht(t,s,n){const{node:c}=t;if(!c)return;c.ref=t;const a=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(a){const i=a.parentNode;if(i){if(n?.position==="before"&&n.node)i.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const e=n.node.nextSibling;i.insertBefore(c,e||a)}else i.insertBefore(c,a);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;i?o.insertBefore(c,i):o.appendChild(c)}else o.appendChild(c)}function K(t,s,n){const c=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,U.runPluginHook)(c,s,n);const a="on"+t,o=s[a];if(typeof o=="function"){const i=t==="Render"||t==="RenderRouter";if(i){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const e=s.context?.designSystem;e&&(0,b.pushConfig)(e);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(r){if(s.context?.plugins?.length&&(0,U.runPluginHook)("error",s,{hook:a,error:r})||console.error(`[DOMQL] Lifecycle "${a}" error:`,r),s.context?.strictMode)throw r}finally{e&&(0,b.popConfig)(),i&&(s.__ref.__inRender=!1)}}return!0}var ro=V;
4
+ `):"")}}if(yt(o,!0),Tt(o,s,f),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const l=o.context?.designSystem;l&&(0,A.pushConfig)(l);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{l&&(0,A.popConfig)()}}if(K("Create",o,c),K("Complete",o,c),K("Render",o,c),K("RenderRouter",o,c),xt(o,c),typeof o.onFrame=="function"){const l=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&(0,A.pushConfig)(h);try{l(o,o.state,o.context)}catch(k){console.error("[DOMQL] onFrame error:",k)}finally{h&&(0,A.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Zt(t,s,n){const c=!s,f=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=c&&f&&t.context?.state,r=n.state!==void 0&&!o?n.state:t.state&&!(0,E.isStore)(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,(0,q.applyStateMethods)(t,t.state);else if(t.context?.state){const i=t.context.state,e={...i},a=t.context?.polyglot;if(a?.translations){const d=i.lang||a.defaultLang||"en",u=a.translations[d];if(u&&typeof u=="object")for(const y in u)e[y]===void 0&&(e[y]=u[y]);const p=new Set(a.languages||[]);for(const y in a.translations)!p.has(y)&&e[y]===void 0&&(e[y]=a.translations[y])}t.state=(0,E.isStore)(e)?e:(0,E.createStore)(e),t.state.__element=t,t.state.root=t.state,(0,q.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,q.applyStateMethods)(t,t.state);return}if(typeof r=="string"){if(t.state=Ct(r,s),t.state&&typeof t.state=="object"&&!(0,E.isStore)(t.state)){const i=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}(0,q.applyStateMethods)(t,t.state);return}if(typeof r=="function"){const i=r(t,s?.state);t.state=(0,E.isStore)(i)?i:(0,E.createStore)(i||{})}else(0,E.isStore)(r)?t.state=r:t.state=(0,E.createStore)({...r});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,q.applyStateMethods)(t,t.state)}function ft(t,s){if(!s)return t;const n=s.split("/");let c=t;for(const f of n){if(c==null)return{};c=c[f]}return c??{}}function Ct(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const f=t.slice(3);return f?ft(s.state,f):s.state??{}}if(t.startsWith("~/")){const f=s.state?.root||s.state,o=t.slice(2);return o?ft(f,o):f??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=ft(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const c=s.context?.polyglot;if(c?.translations){const f=s.state?.root?.lang||c.defaultLang||"en",o=c.translations[f];if(o?.[t]!==void 0)return o[t];if(c.translations[t]!==void 0)return c.translations[t]}return{}}function qt(t){const s=t.__ref,n=t.tag||"div",c=t.context?.designSystem,f=[],o=Object.keys(t);for(let r=0;r<o.length;r++){const i=o[r];if(typeof t[i]!="function"||R.REGISTRY.has(i))continue;const e=i.charCodeAt(0);e>=65&&e<=90||Y(i)||x.CSS_PROPS_REGISTRY[i]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(i)||(0,L.checkAttributeByTagName)(n,i)||f.push({prop:i,fn:t[i]})}for(let r=0;r<f.length;r++){const{prop:i,fn:e}=f[r];s.__exec[i]=e,Object.defineProperty(t,i,{get(){c&&(0,A.pushConfig)(c);try{return e(t,t.state,t.context)}catch{return}finally{c&&(0,A.popConfig)()}},set(a){delete s.__exec[i],Object.defineProperty(t,i,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Qt(t,s){if(!(!Array.isArray(s)||s.length===0))for(let n=0;n<s.length;n++){const c=s[n];try{typeof c=="function"?c(t,t.state,t.context):typeof c=="string"&&t.state?.[c]}catch{}}}function O(t,s,n){return!Array.isArray(s)||s.length===0?n:function(...c){return Qt(t,s),n.apply(this,c)}}function J(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function St(t,s){const n=t.__ref,c=!!(s&&s.skipIfEffect);if(qt(t),typeof t.text=="function"){const o=t.text,r=O(t,t.textDeps,o),i=(0,j.createEffect)(()=>{if(!n.contentManaged)try{let e=r(t,t.state,t.context);t.node&&e!=null&&typeof e!="function"&&typeof e!="object"&&(typeof e=="string"&&e.includes("{{")&&(e=st.replaceLiteralsWithObjectFields.call(t,e,t.state)),t.tag==="string"?t.node.nodeValue=e:t.node.textContent=e)}catch{}},{depth:n.path.length});n.__effects.push(i),n.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,r=(0,j.createEffect)(()=>{if(n.contentManaged)return;const i=st.replaceLiteralsWithObjectFields.call(t,o,t.state);i!=null&&(t.text=i),t.node&&(t.tag==="string"?t.node.nodeValue=i??"":t.node.textContent=i??"")},{depth:n.path.length});n.__effects.push(r),n.__exec.text=o}for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!R.REGISTRY.has(o)&&!Y(o)&&!n.__exec[o]){if(x.CSS_PROPS_REGISTRY[o]){const r=t[o],i=O(t,t[o+"Deps"],r),e=o;let a;const d=(0,j.createEffect)(()=>{const u=t.context?.designSystem;u&&(0,A.pushConfig)(u);try{const p=i(t,t.state,t.context),y=x.CSS_PROPS_REGISTRY[e](p,t,t.state,t.context);if(y&&t.node){const _=jt(y);(_===null||_!==a)&&(a=_,G(t.node,y))}else t.node&&(e==="show"||e==="hide")&&(a=void 0,t.node.style.display="")}finally{u&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=r}else if(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const r=t[o],i=O(t,t[o+"Deps"],r),e=o;let a;const d=(0,j.createEffect)(()=>{const u=t.context?.designSystem;u&&(0,A.pushConfig)(u);try{const p=i(t,t.state,t.context);if(t.node)if(p!=null){const y=e+":"+String(p);y!==a&&(a=y,G(t.node,{[e]:p}))}else a=void 0,t.node.style[e]=""}finally{u&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=r}}if(typeof t.html=="function"){const o=t.html,r=O(t,t.htmlDeps,o),i=(0,j.createEffect)(()=>{const e=t.context?.designSystem;e&&(0,A.pushConfig)(e);try{const a=r(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&(t.node.innerHTML=a)}finally{e&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(i),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,r=O(t,t.valueDeps,o),i=(0,j.createEffect)(()=>{try{const e=r(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const a=e==null?"":String(e);if(t.node.value===a)return;const d=typeof document<"u"&&document.activeElement===t.node,u=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=a,d&&u!=null&&p!=null)try{t.node.setSelectionRange(u,p)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(i),n.__exec.value=o}if(typeof t.style=="function"){const o=t.style,r=O(t,t.styleDeps,o);let i;const e=(0,j.createEffect)(()=>{const a=r(t,t.state,t.context),d=jt(a);(d===null||d!==i)&&(i=d,G(t.node,a))},{depth:n.path.length});n.__effects.push(e),n.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const r=t.style[o];if(typeof r!="function")continue;const i=O(t,J(t.styleDeps,o),r);let e;const a=(0,j.createEffect)(()=>{try{const d=i(t,t.state,t.context);if(t.node){const u=o+":"+String(d);u!==e&&(e=u,G(t.node,{[o]:d}))}}catch{}},{depth:n.path.length});n.__effects.push(a)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const r=O(t,J(t.attrDeps,o),t.attr[o]),i=o,e=(0,j.createEffect)(()=>{try{const a=r(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:n.path.length});n.__effects.push(e)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const r=O(t,J(t.ariaDeps,o),t.aria[o]),i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),e=(0,j.createEffect)(()=>{try{const a=r(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:n.path.length});n.__effects.push(e)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const r=O(t,J(t.dataDeps,o),t.data[o]),e="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),a=(0,j.createEffect)(()=>{try{const d=r(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(e):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(e,d===!0?"":d)}catch{}},{depth:n.path.length});n.__effects.push(a)}const f=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(f)for(const o in f){if(typeof f[o]!="function")continue;const r=O(t,J(t.classDeps,o),f[o]),i=(0,j.createEffect)(()=>{try{const e=r(t,t.state,t.context);if(!t.node?.classList)return;typeof e=="string"?t.node.classList.add(e):e?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:n.path.length});n.__effects.push(i)}!c&&typeof t.if=="function"&&wt(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||R.REGISTRY.has(o)||typeof t[o]!="function")continue;const r=o.charCodeAt(0);if(r>=65&&r<=90||Y(o))continue;const i=t[o];n.__exec[o]=i;const e=t.tag||"div";if((0,L.checkAttributeByTagName)(e,o)&&!x.CSS_PROPS_REGISTRY[o]&&!(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const a=(0,L.camelToAttr)(o)||o,d=O(t,t[o+"Deps"],i),u=(0,j.createEffect)(()=>{try{const p=d(t,t.state,t.context);t.node?.setAttribute&&(p==null||p===!1?t.node.removeAttribute(a):typeof p!="function"&&typeof p!="object"&&(a==="src"&&"src"in t.node?t.node.src=p:t.node.setAttribute(a,p===!0?"":p)))}catch{}},{depth:n.path.length});n.__effects.push(u)}}if(mt(t),oo(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,r=t.stateDeps;let i=!1,e=[];const a=(0,j.createEffect)(()=>{const d=[];for(let _=0;_<r.length;_++){const l=r[_];try{d[_]=typeof l=="function"?l(t,t.state,t.context):t.state?.[l]}catch{d[_]=void 0}}if(!i){i=!0,e=d;return}let u=d.length!==e.length;for(let _=0;!u&&_<d.length;_++)d[_]!==e[_]&&(u=!0);const p=e;if(e=d,!u)return;const y=t.context?.designSystem;y&&(0,A.pushConfig)(y);try{o(t,t.state,t.context,{prev:p,next:d})}catch(_){if(t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{y&&(0,A.popConfig)()}},{depth:n.path.length});n.__effects.push(a)}}function kt(t){const s=t.parent,n=s?.node;if(!n||!t.node){Tt(t,t.parent);return}let c=null;const f=Object.keys(s),o=f.indexOf(t.key);for(let r=o+1;r<f.length;r++){const i=s[f[r]];if(i?.node?.parentNode===n){c=i.node;break}}c?n.insertBefore(t.node,c):n.appendChild(t.node)}function wt(t,s,n){const c=O(t,t.ifDeps,n),f=(0,j.createEffect)(()=>{let o;try{o=c(t,t.state,t.context)}catch(i){if(o=!1,s.__ifError=i,typeof console<"u"&&console.warn){const e=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${e} \u2014 treating as false:`,i?.message||i)}return}const r=s.__if;if(s.__if=!!o,r&&!s.__if&&t.node)t.node.remove();else if(!r&&s.__if)if(s.__ifInitialized)t.node||(t.node=(0,W.cacheNode)(t)),t.node&&(t.node.ref=t),kt(t),at(t);else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,W.detectTag)(t)),K("Init",t,{}),t.node||(t.node=(0,W.cacheNode)(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const e=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(e),s.__fragmentAnchor=e}K("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),$t(t,{}),St(t,{skipIfEffect:!0}),at(t),Ot(t),Dt(t,{}),kt(t),xt(t,{})}},{depth:s.path.length});s.__effects.push(f)}function at(t){const{node:s}=t;if(s){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?s.nodeValue=t.text:s.textContent=t.text:typeof t.text=="number"&&(s.textContent=t.text),no(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in s){const n=String(t.value);s.value!==n&&(s.value=n)}if(t.style&&typeof t.style=="object"&&G(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const c=t.attr[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.setAttribute&&s.setAttribute(n,c===!0?"":c)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.dataset&&(s.dataset[n]=c===!0?"":c)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(c=>c&&s.classList.add(c));else if(typeof n=="object")for(const c in n){const f=typeof n[c]=="function"?n[c](t,t.state,t.context):n[c];f&&s.classList.add(typeof f=="string"?f:c)}}}}function jt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function G(t,s){if(!t||!s||!t.style)return;let n=null;for(const c in s){const f=s[c];if(f!=null){if(c.charAt(0)==="&"&&typeof f=="object"){n||(n={}),n[c]=f;continue}try{const o=String(f),r=c.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),i=o.trim(),e=/\s*!important\s*$/.test(i),a=i.replace(/\s*!important\s*$/,"");t.style.setProperty(r,a,e?"important":"")}catch{}}}n&&Jt(t,n)}let Xt=0;function Jt(t,s){const n=`_ds${Xt++}`;t.classList.add(n);const c=t.ownerDocument;let f=c.querySelector("style[data-smbls-scoped]");f||(f=c.createElement("style"),f.setAttribute("data-smbls-scoped",""),c.head.appendChild(f));let o="";for(const r in s){const i="."+n,e=r.replace(/&/g,i).split(",").map(d=>{const u=d.trim();return u.includes(i)?u:i+u}).join(", "),a=s[r];if(typeof a=="object"){let d="",u="";for(const p in a){const y=a[p];if(typeof y=="object"){const _=p.includes("&")?e.split(", ").map(h=>p.replace(/&/g,h)).join(", "):e.split(", ").map(h=>`${h} ${p}`).join(", ");let l="";for(const h in y)l+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[h]};`;u+=(0,B.wrapHoverRule)(`${_} { ${l} }`,_)+`
5
+ `}else d+=`${p.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(o+=(0,B.wrapHoverRule)(`${e} { ${d} }`,e)+`
6
+ `),u&&(o+=u)}}o&&(f.textContent+=o)}function mt(t){let s=t.subscribeTo;if(typeof s=="function")try{s=s(t,t.state,t.context)}catch{s=null}if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let c=0;c<s.length;c++){const f=s[c];if(typeof f!="string"||f.length===0)continue;const o=f.split("."),r=o[0],i=o.slice(1),e={value:!1},a=(0,j.createEffect)(()=>{const d=t.state&&((0,E.isStore)(t.state)?t.state.root:null);if(!d||!(0,E.isStore)(d))return;let u=d;u=u[r];for(let y=0;y<i.length&&!(u==null||typeof u!="object");y++)if((0,E.isStore)(u))u=u[i[y]];else break;if(!e.value)return;let p=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&(0,A.pushConfig)(y);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(p=!0)}catch(_){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&(0,A.popConfig)()}}if(!p&&t.node&&n.__effects)for(let y=0;y<n.__effects.length;y++){const _=n.__effects[y];_&&_!==a&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!p&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&(0,A.pushConfig)(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&(0,U.runPluginHook)("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&(0,A.popConfig)()}}},{depth:n.path.length});e.value=!0,a._isSubscribeToEffect=!0,n.__effects.push(a)}}function dt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}const Et=new Set;function to(t,s){const n=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",c=n+"::"+t;Et.has(c)||(Et.add(c),console.warn(`[smbls/css] "${t}" at ${n} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function Z(t,s,n){const c={},f=new Set,o=(r,i,e)=>{const a=e?new Set(Object.keys(c)):null;if(x.CSS_PROPS_REGISTRY[r]){const d=x.CSS_PROPS_REGISTRY[r](i,s,s.state,s.context);if(d){const u=Array.isArray(d)?d:[d];for(const p of u)p&&Object.assign(c,p)}}else c[r]=i;if(e)for(const d in c)a.has(d)||f.add(d)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let p=i[u];if(typeof p=="function"&&(p=p(s,s.state,s.context)),p==null||typeof p=="function")continue;const y=typeof s[u]=="function"&&(x.CSS_PROPS_REGISTRY[u]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(u));o(u,p,y)}continue}if(dt(r,s)){const u=Z(i,s,!0);Object.keys(u).length&&(c[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){(0,ht.isLoudDevRuntime)()&&to(r,s);continue}let a=r;if(r.charCodeAt(0)===64&&!r.startsWith("@media")&&!r.startsWith("@keyframes")){const u=s.context?.designSystem?.media?.[r.slice(1)];u&&(a=`@media ${u}`)}const d=Z(i,s,!1);Object.keys(d).length&&(c[a]=d);continue}const e=typeof s[r]=="function"&&(x.CSS_PROPS_REGISTRY[r]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(r));o(r,i,e)}if(n)for(const r in c)f.add(r);for(const r of f){const i=c[r];typeof i=="string"&&!i.includes("!important")&&(c[r]=i+" !important")}return c}function oo(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;const f=c.charAt(0);if(f!=="."&&f!=="!")continue;const o=c.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const u=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${c}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${f}\` is read as one prop name. Nest the selector inside instead: \`${f}${u}: { '${o.slice(u.length)}': {...} }\`.`)}continue}const r=t[c];if(!r||typeof r!="object")continue;const i=f==="!",e={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{if(!t.node)return;let u;const p=t[o];if(p===void 0)if(t.state&&o in t.state)u=t.state[o];else{const l=t.context?.cases?.[o];if(l===void 0)return;try{u=typeof l=="function"?l.call(t,t):l}catch(h){u=!1,s.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof p=="function")try{u=p(t,t.state,t.context)}catch(l){u=!1,s.__conditionalError=l,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,l?.message||l)}else u=p;const y=i?!u:!!u;if(y===e.lastMatch)return;e.lastMatch=y;const _=t.context?.designSystem;_&&(0,A.pushConfig)(_);try{if(y){const l={},h={};let g=!1;for(const b in r){if(!Object.prototype.hasOwnProperty.call(r,b))continue;const v=r[b],w=b.charAt(0);if((w===":"||w==="@"||w==="&")&&v&&typeof v=="object"&&!Array.isArray(v)){if(dt(b,t)){const $=Z(v,t,!0);Object.keys($).length&&(h[`[data-theme="${b.slice(1)}"] &`]=$,g=!0)}else{let $=b;if(w==="@"&&!b.startsWith("@media")&&!b.startsWith("@keyframes")){const T=t.context?.designSystem?.media?.[b.slice(1)];T&&($=`@media ${T}`)}const H=Z(v,t,!1);Object.keys(H).length&&(h[$]=H,g=!0)}continue}const F=typeof v=="function"?v(t,t.state,t.context):v;if(F!=null)if(x.CSS_PROPS_REGISTRY[b]){const $=x.CSS_PROPS_REGISTRY[b](F,t,t.state,t.context);if($){const H=Array.isArray($)?$:[$];for(const T of H)T&&Object.assign(l,T)}}else x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(b)&&(l[b]=F)}const k=Object.keys(l);if(k.length){G(t.node,l);for(const b of k)n.set(b,c);e.appliedKeys=k}else e.appliedKeys=null;if(g){const b=(0,B.css)(h,null,t.context?.cssPrefix),v=b?b.split(" ").filter(Boolean):[];if(v.length&&t.node.classList){for(const w of v)t.node.classList.add(w);e.appliedClasses=v}else e.appliedClasses=null}else if(e.appliedClasses){for(const b of e.appliedClasses)t.node.classList.remove(b);e.appliedClasses=null}}else{if(e.appliedKeys){for(const l of e.appliedKeys)n.get(l)===c&&(t.node.style[l]="",n.delete(l));e.appliedKeys=null}if(e.appliedClasses){for(const l of e.appliedClasses)t.node.classList.remove(l);e.appliedClasses=null}}}finally{_&&(0,A.popConfig)()}};s.__conditionalRunners.push(a);const d=(0,j.createEffect)(a,{depth:s.path.length});s.__effects.push(d)}}const ut=new WeakSet;function so(t){const s=t.ownerDocument;!s||ut.has(s)||(ut.add(s),queueMicrotask(()=>{ut.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const pt=new WeakSet;let Pt=!1;function no(t){const{node:s}=t;if(!s)return;if(Pt||(Pt=!0,(0,B.css)({display:"none"})),pt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}pt.add(t);const n=t.context?.designSystem;n&&(0,A.pushConfig)(n);try{const c={};let f=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||R.REGISTRY.has(o))continue;const r=o.charCodeAt(0);if(!(r>=65&&r<=90)&&!Y(o)){if(x.CSS_PROPS_REGISTRY[o]){const i=t[o],e=x.CSS_PROPS_REGISTRY[o](i,t,t.state,t.context);if(e){if(Array.isArray(e))for(const a of e)a&&Object.assign(c,a);else Object.assign(c,e);f=!0}}else if(x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const i=t[o];i!=null&&typeof i!="object"&&(c[o]=i,f=!0)}else if(o.charCodeAt(0)===45){const i=t[o];i!=null&&typeof i!="object"&&(c[o]=i,f=!0)}else if(o.charAt(0)==="&"){const i=t[o];i&&typeof i=="object"&&(c[o]=i,f=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const i=t[o];if(i&&typeof i=="object"){if(dt(o,t)){const e=Z(i,t,!0);Object.keys(e).length&&(c[`[data-theme="${o.slice(1)}"] &`]=e,f=!0)}else{let e=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const d=t.context?.designSystem?.media?.[o.slice(1)];d&&(e=`@media ${d}`)}const a=Z(i,t,!1);Object.keys(a).length&&(c[e]=a,f=!0)}f=!0}}}}if(f){c.display&&String(c.display).includes("!important")&&(s.style.setProperty("display",String(c.display).replace(/\s*!important\s*$/,""),"important"),delete c.display);const o=(0,B.css)(c,null,t.context?.cssPrefix);if(o&&s.classList){const i=o.split(" ").filter(Boolean);let e=!1;for(const a of i)s.classList.add(a),e||(a.charCodeAt(0)===95&&a.charCodeAt(1)===99||a.charCodeAt(0)===95&&a.indexOf("_c",1)!==-1)&&(e=!0);e&&so(s)}const r=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(r!=null){const i=c.display;if(i&&i!==r)if(r==="none"){const e=[];for(const a of s.classList)a.startsWith("_d-")&&a!=="_d-none"&&e.push(a);for(const a of e)s.classList.remove(a);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&(0,A.popConfig)(),pt.delete(t)}}function Ot(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const f in t.aria){const o=t.aria[f];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const r="aria-"+f.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.setAttribute(r,o===!0?"":o)}const n=(0,L.applyAttrTransforms)(t);for(const f in n){const o=n[f];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(f,o===!0?"":o)}const c=t.tag||"div";for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f)||typeof t[f]=="function"||R.REGISTRY.has(f)||f==="on"||n[f]!==void 0)continue;const o=f.charCodeAt(0);if(!(o>=65&&o<=90)&&!Y(f)&&!(x.CSS_PROPS_REGISTRY[f]||x.DEFAULT_CSS_PROPERTIES_LIST&&x.DEFAULT_CSS_PROPERTIES_LIST.has(f))&&(0,L.checkAttributeByTagName)(c,f)){let r=t[f];if(r==null||(typeof r=="string"&&r.includes("{{")&&(r=(0,st.replaceLiteralsWithObjectFields)(r,t,t.state,t.context),t[f]=r),r==null||typeof r=="function"||typeof r=="object")||r===!1&&!(0,L.isEnumeratedTrueFalseAttr)((0,L.camelToAttr)(f)||f))continue;const i=(0,L.camelToAttr)(f)||f;s.setAttribute(i,(0,L.serializeAttrValue)(i,r))}}}function co(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,c=n&&typeof n=="object"&&n.max?String(n.max):null;c&&(s.style.maxHeight=c);const f=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};f(),s.addEventListener("input",f),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",f)}catch{}})}const Lt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function $t(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!Y(n)||Lt.has(n))continue;let c=t[n];if(typeof c=="string"&&/^[A-Za-z_$][\w$]*$/.test(c)){const o=c;c=function(i){return t.call(o,i)}}if(typeof c!="function")continue;const f=Yt(n);R.LIFECYCLE_EVENTS.has(f)||(0,Rt.registerEvent)(Gt(f),t,c)}ro(t)}function ro(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let c=!1;for(const p of Lt){const y=t[p];typeof y=="function"&&(n[p]=y,c=!0)}if(!c)return;const f=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,i=0,e=0,a=!1;const d=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,i=y.clientY,e=Date.now(),a=!0)},u=p=>{if(!a)return;a=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const _=y.clientX-r,l=y.clientY-i,h=Date.now()-e;if(h>o)return;const g=Math.abs(_),k=Math.abs(l);if(Math.max(g,k)<f)return;let b;if(g>k*1.2)b=_<0?"left":"right";else if(k>g*1.2)b=l<0?"up":"down";else return;const v="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),w=n[v],F=n.onSwipe;w&&w.call(t,p,t,t.state,t.context),F&&F.call(t,{direction:b,dx:_,dy:l,dt:h,event:p},t,t.state,t.context)};s.addEventListener("touchstart",d,{passive:!0}),s.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",d)}catch{}try{s.removeEventListener("touchend",u)}catch{}})}function ot(t,s){const n={...t};for(const c in s){const f=n[c],o=s[c];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[c]=ot(f,o):n[c]=o}return n}function lt(t,s,n){if(!s||!t.node)return;const c=t.childExtends;if(Array.isArray(s)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,r=f?null:o?.createDocumentFragment();if(!f&&!r)return;const i=t.childProps,e=t.childrenAs;for(let a=0;a<s.length;a++){let d=s[a];const u=d;(typeof d=="string"||typeof d=="number")&&(d={text:d});let p=i;if(typeof i=="function")try{p=i(t,d)}catch{p=null}if(e==="state"){let l=u;(typeof u=="string"||typeof u=="number")&&(l={value:u,text:u}),d=p?{...p,state:l}:{state:l}}else p&&(d=ot(p,d));if(c&&!d.ignoreChildExtends)if(d.extends){const l=Array.isArray(d.extends)?d.extends:[d.extends],h=Array.isArray(c)?c:[c];d={...d,extends:[...h,...l]}}else d={...d,extends:c};const y=d?.key||u&&typeof u=="object"&&u.key||`${a}`;let _;try{_=V(d,t,y,n)}catch(l){if(typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y}" failed to construct at ${h} (initial render, skipping this row):`,l?.message||l)}continue}!f&&_?.node&&r.appendChild(_.node)}f||t.node.appendChild(r);return}if(typeof s=="string"){const f=Ct(s,t);if(Array.isArray(f)){lt(t,f,n);return}}if(typeof s=="object")for(const f in s){if(R.REGISTRY.has(f))continue;let o=s[f];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=ot(t.childProps,o)),c&&!o.ignoreChildExtends)if(o.extends){const r=Array.isArray(o.extends)?o.extends:[o.extends],i=Array.isArray(c)?c:[c];o={...o,extends:[...i,...r]}}else o={...o,extends:c};V(o,t,f,n)}}}function yt(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const c=n.options;if(!c||!c.length)return;const f=t.__ref,o=f&&f.__exec&&f.__exec.value,r=typeof o=="function",i=t.value!=null&&typeof t.value!="function";if(r||i){let d;if(r)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const u=d==null?"":String(d);n.value!==u&&(n.value=u);return}const e=s||!(f&&f.__selectSynced);if(f&&(f.__selectSynced=!0),!e)return;let a=-1;for(let d=0;d<c.length;d++)c[d].defaultSelected&&(a=d);a>=0&&n.selectedIndex!==a&&(n.selectedIndex=a)}function Dt(t,s){let{children:n,content:c}=t;const f=t.childExtends;if(typeof n=="function"){const r=n;try{n=r(t,t.state,t.context)}catch(u){if(n=void 0,typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,u?.message||u)}}t.children=n;const i=t.__ref;let e=!1;const a=O(t,t.childrenDeps,r),d=(0,j.createEffect)(()=>{const u=e;e=!0;let p;try{p=a(t,t.state,t.context)}catch(v){if(typeof console<"u"&&console.error){const w=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${w}${u?"":" (initial tracking run)"}:`,v?.message||v)}return}if(!u||p===t.children)return;t.children=p;const y=typeof t.onContentUpdate=="function",_=y?[]:null,l=y?[]:null,h=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const v=t.childProps,w=[],F=new Map;for(let C=0;C<p.length;C++){const D=p[C];let S=v;if(typeof v=="function")try{S=v(t,D)}catch{S=null}const M=S&&S.key||D&&D.key||`${C}`;w.push(M),F.set(M,{rawChild:D,childProps:S})}const $=new Set(w),H=i.__children.slice();for(const C of H)if(!$.has(C)){const D=t[C];D?.remove&&D.remove(),delete t[C],l&&l.push(C)}const T=t.childExtends,m=t.tag==="fragment",Mt=t.context?.document||globalThis.document,Q=m?null:Mt?.createDocumentFragment(),nt=new Set;for(const C of w){const D=F.get(C),S=D.rawChild,M=t[C];if(M&&M.state){if(S&&typeof S=="object"){const P=M.state,z=P.$replace||P.replace,bt=P.$update||P.update;if(typeof z=="function")z.call(P,S);else if(typeof bt=="function"){for(const I in P)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(S,I))try{P[I]=void 0}catch{}bt.call(P,S)}else for(const I in S)P[I]=S[I]}h&&h.push(C);continue}let ct=S;(typeof S=="string"||typeof S=="number")&&(ct={value:S,text:S});const gt=D.childProps;let N=gt?{...gt,state:ct}:{state:ct};if(T&&!N.ignoreChildExtends)if(N.extends){const P=Array.isArray(N.extends)?N.extends:[N.extends],z=Array.isArray(T)?T:[T];N={...N,extends:[...z,...P]}}else N={...N,extends:T};let rt;try{rt=V(N,t,C,s)}catch(P){if(typeof console<"u"&&console.error){const z=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${z} (reconcile, skipping this row):`,P?.message||P)}nt.add(C);continue}!m&&rt?.node&&Q&&Q.appendChild(rt.node),_&&_.push(C)}if(!m&&Q&&Q.childNodes.length&&t.node&&t.node.appendChild(Q),!m&&t.node){let C=null;for(const D of w){const S=t[D]?.node;if(!S)continue;const M=C?C.nextSibling:t.node.firstChild;S!==M&&t.node.insertBefore(S,M),C=S}}i.__children=nt.size?w.filter(C=>!nt.has(C)):w,y&&(_.length||l.length)&&At(t,{added:_,removed:l,kept:h}),yt(t,!1);return}const b=y?[...i.__children]:null;for(const v of[...i.__children]){const w=t[v];w?.remove&&w.remove(),delete t[v]}i.__children=[],lt(t,p,s),yt(t,!1),y&&At(t,{added:[...i.__children],removed:b,kept:[]})},{depth:i.path.length});i.__effects.push(d)}if(lt(t,n||c,s),n||c)return;const o=t.context?.components||{};{const r=Object.keys(t);for(let i=0;i<r.length;i++){const e=r[i];if(!e.endsWith("Extends")||typeof t[e]!="string")continue;const a=e.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const d={extends:t[e]};delete t[e];for(let u=i+1;u<r.length;u++){const p=r[u],y=p.charCodeAt(0);if(y>=65&&y<=90||R.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const _=t[p];_!==void 0&&(d[p]=_,delete t[p])}t[a]&&typeof t[a]=="object"?t[a]={...d,...t[a]}:t[a]=d}}for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||R.REGISTRY.has(r)||typeof t[r]!="object"||t[r]===null)continue;const i=r.charCodeAt(0);if(i<65||i>90)continue;let e=t[r];if(!e.__ref){if(!e.extends&&!e.extend){const a=o[r]||o[`smbls.${r}`];a&&(e={...e,extends:a})}if(t.childProps&&(e=ot(t.childProps,e)),f&&!e.ignoreChildExtends)if(e.extends){const a=Array.isArray(e.extends)?e.extends:[e.extends],d=Array.isArray(f)?f:[f];e={...e,extends:[...d,...a]}}else e={...e,extends:f};V(e,t,r,s)}}}function Tt(t,s,n){const{node:c}=t;if(!c)return;c.ref=t;const f=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(f){const r=f.parentNode;if(r){if(n?.position==="before"&&n.node)r.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;r.insertBefore(c,i||f)}else r.insertBefore(c,f);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const r=n.node.nextSibling;r?o.insertBefore(c,r):o.appendChild(c)}else o.appendChild(c)}function K(t,s,n){const c=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,U.runPluginHook)(c,s,n);const f="on"+t,o=s[f];if(typeof o=="function"){const r=t==="Render"||t==="RenderRouter";if(r){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const i=s.context?.designSystem;i&&(0,A.pushConfig)(i);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(e){if(s.context?.plugins?.length&&(0,U.runPluginHook)("error",s,{hook:f,error:e})||console.error(`[DOMQL] Lifecycle "${f}" error:`,e),s.context?.strictMode)throw e}finally{i&&(0,A.popConfig)(),r&&(s.__ref.__inRender=!1)}}return!0}var io=V;
@@ -1 +1 @@
1
- "use strict";var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var a=(n,t)=>{for(var e in t)s(n,e,{get:t[e],enumerable:!0})},p=(n,t,e,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of i(t))!f.call(n,o)&&o!==e&&s(n,o,{get:()=>t[o],enumerable:!(u=c(t,o))||u.enumerable});return n};var h=n=>p(s({},"__esModule",{value:!0}),n);var d={};a(d,{isLoudDevRuntime:()=>l});module.exports=h(d);function l(n){const t=n&&"env"in n?n.env:typeof process<"u"&&process.env?"production":void 0;if(t&&t!=="production")return!0;const e=n&&"hostname"in n?n.hostname:typeof location<"u"?location.hostname:void 0;return typeof e=="string"&&e?e==="localhost"||e==="127.0.0.1"||e.endsWith(".localhost"):!1}
1
+ "use strict";var r=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},n=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!d.call(t,i)&&i!==o&&r(t,i,{get:()=>e[i],enumerable:!(s=m(e,i))||s.enumerable});return t};var p=t=>n(r({},"__esModule",{value:!0}),t);var v={};f(v,{isLoudDevRuntime:()=>u.isLoudDevRuntime});module.exports=p(v);var u=require("@symbo.ls/utils");
@@ -1,6 +1,6 @@
1
- import{createStore as ct,createScopeStore as Kt,isStore as K}from"@symbo.ls/signal";import{createEffect as k}from"@symbo.ls/signal";import{cacheNode as rt,detectTag as vt}from"./cache.js";import{REGISTRY as U,LIFECYCLE_EVENTS as Ut}from"./registry.js";import{registerEvent as Vt}from"./delegate.js";import{applyExtends as Wt}from"./extends.js";import{addMethods as Bt}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as Ct}from"./devRuntime.js";import{replaceLiteralsWithObjectFields as it}from"@symbo.ls/utils";import{runPluginHook as V}from"@symbo.ls/utils/function.js";import{applyStateMethods as q}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as T,DEFAULT_CSS_PROPERTIES_LIST as $}from"css-in-props";import{css as et,wrapHoverRule as St}from"@symbo.ls/css";import{pushConfig as E,popConfig as P}from"@symbo.ls/scratch";import{checkAttributeByTagName as at,applyAttrTransforms as Ht,camelToAttr as ft,serializeAttrValue as zt,isEnumeratedTrueFalseAttr as Yt}from"attrs-in-props";let Gt=1;const m=[];let dt=!1;function Zt(){dt||(dt=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(kt):setTimeout(kt,0))}function kt(){if(dt=!1,!m.length)return;const t=m.splice(0,m.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||I("Mounted",n,n.__ref?.__mountOptions||{})}}function wt(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,m.push(t),Zt())}function jt(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&V("contentUpdate",t,s);const n=t.context?.designSystem;n&&E(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(c){if(t.context?.plugins?.length&&V("error",t,{hook:"onContentUpdate",error:c})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',c),t.context?.strictMode)throw c}finally{n&&P()}}function H(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function qt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Qt(t){return t.toLowerCase()}function Et(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function Q(t,s){const n={...t};for(const c in s){const a=n[c],o=s[c];a&&o&&typeof a=="object"&&typeof o=="object"&&!Array.isArray(a)&&!Array.isArray(o)&&typeof a!="function"&&typeof o!="function"?n[c]=Q(a,o):n[c]=o}return n}function z(t,s,n,c={},a){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=n||t.key||`_${Gt++}`,o.parent=s||null,o.context=t.context||s?.context||c.context||{},o.context.__create||(o.context.__create=z);const i=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||o,path:s?.__ref?.path?[...s.__ref.path,o.key]:[o.key]};if(n&&!t.extends&&!t.extend){const u=n.indexOf("_");if(u>0){const h=n.substring(0,u),g=o.context?.components;g&&(g[h]||g["smbls."+h])?t={...t,extends:h}:g&&Ct()&&/^[A-Z]\w*_\d+$/.test(n)&&console.warn(`[smbls] auto-extend: key "${n}" looks like a multi-instance (${h}_N) but neither "${h}" nor "smbls.${h}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}Wt(o,t,c);const e=new Set(["childProps","attr","style","scope","data"]),r=o.props&&typeof o.props=="object"?o.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;const h=t[u],g=o[u],C=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";C&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?o[u]=Q(g,h):C&&e.has(u)?o[u]={...g,...h}:C&&Et(u)?o[u]=Q(g,h):o[u]=h}function f(u){for(const h in u){const g=u[h],C=o[h],x=C&&g&&typeof C=="object"&&typeof g=="object"&&!Array.isArray(C)&&!Array.isArray(g)&&typeof C!="function"&&typeof g!="function";x&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=Q(C,g):x&&e.has(h)?o[h]={...C,...g}:x&&Et(h)?o[h]=Q(C,g):o[h]=g}}r&&f(r),t.props&&typeof t.props=="object"&&f(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const d=o.scope&&typeof o.scope=="object"?o.scope:null,l=s?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=l||p||null;if(t.scope!==void 0||d){const u={};d&&Object.assign(u,d),t.scope!==void 0&&Object.assign(u,t.scope),o.scope=Kt(u,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),Bt(o),Xt(o,s,t),o.if!=null){let u;if(typeof o.if=="function")try{u=o.if(o,o.state,o.context)}catch(h){if(u=!1,i.__ifError=h,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,h?.message||h)}}else u=o.if;i.__if=!!u}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&Lt(o,i,o.if),o;o.tag||(o.tag=vt(o)),I("Init",o,c);const _=o.node=rt(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),i.__fragmentAnchor=h}I("AttachNode",o,c),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Ft(o,c),Ot(o),pt(o),Rt(o),eo(o);try{Mt(o,c)}catch(u){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,u?.message||u,u?.stack?`
2
- `+u.stack.split(`
1
+ import{createStore as ct,createScopeStore as Ut,isStore as K}from"@symbo.ls/signal";import{createEffect as k}from"@symbo.ls/signal";import{cacheNode as rt,detectTag as At}from"./cache.js";import{REGISTRY as U,LIFECYCLE_EVENTS as Vt}from"./registry.js";import{registerEvent as Wt}from"./delegate.js";import{applyExtends as Bt}from"./extends.js";import{addMethods as Ht}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as vt}from"./devRuntime.js";import{replaceLiteralsWithObjectFields as it}from"@symbo.ls/utils";import{runPluginHook as V}from"@symbo.ls/utils/function.js";import{applyStateMethods as q}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as P,DEFAULT_CSS_PROPERTIES_LIST as w}from"css-in-props";import{css as et,wrapHoverRule as Ct}from"@symbo.ls/css";import{pushConfig as O,popConfig as L}from"@symbo.ls/scratch";import{checkAttributeByTagName as ft,applyAttrTransforms as zt,camelToAttr as at,serializeAttrValue as Yt,isEnumeratedTrueFalseAttr as Gt}from"attrs-in-props";let Zt=1;const m=[];let dt=!1;function qt(){dt||(dt=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(St):setTimeout(St,0))}function St(){if(dt=!1,!m.length)return;const t=m.splice(0,m.length);for(let s=0;s<t.length;s++){const n=t[s];!n.node||!n.node.isConnected||I("Mounted",n,n.__ref?.__mountOptions||{})}}function kt(t,s){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,m.push(t),qt())}function wt(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&V("contentUpdate",t,s);const n=t.context?.designSystem;n&&O(n);try{t.onContentUpdate(t,t.state,t.context,s)}catch(c){if(t.context?.plugins?.length&&V("error",t,{hook:"onContentUpdate",error:c})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',c),t.context?.strictMode)throw c}finally{n&&L()}}function H(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Qt(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Xt(t){return t.toLowerCase()}function jt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38}function Q(t,s){const n={...t};for(const c in s){const f=n[c],o=s[c];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[c]=Q(f,o):n[c]=o}return n}function z(t,s,n,c={},f){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=n||t.key||`_${Zt++}`,o.parent=s||null,o.context=t.context||s?.context||c.context||{},o.context.__create||(o.context.__create=z);const r=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||o,path:s?.__ref?.path?[...s.__ref.path,o.key]:[o.key]};if(n&&!t.extends&&!t.extend){const l=n.indexOf("_");if(l>0){const h=n.substring(0,l),g=o.context?.components;g&&(g[h]||g["smbls."+h])?t={...t,extends:h}:g&&vt()&&/^[A-Z]\w*_\d+$/.test(n)&&console.warn(`[smbls] auto-extend: key "${n}" looks like a multi-instance (${h}_N) but neither "${h}" nor "smbls.${h}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}Bt(o,t,c);const i=new Set(["childProps","attr","style","scope","data"]),e=o.props&&typeof o.props=="object"?o.props:null;for(const l in t){if(l==="parent"||l==="node"||l==="__ref"||l==="extends"||l==="context"||l==="props")continue;const h=t[l],g=o[l],C=g&&h&&typeof g=="object"&&typeof h=="object"&&!Array.isArray(g)&&!Array.isArray(h)&&typeof g!="function"&&typeof h!="function";C&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?o[l]=Q(g,h):C&&i.has(l)?o[l]={...g,...h}:C&&jt(l)?o[l]=Q(g,h):o[l]=h}function a(l){for(const h in l){const g=l[h],C=o[h],b=C&&g&&typeof C=="object"&&typeof g=="object"&&!Array.isArray(C)&&!Array.isArray(g)&&typeof C!="function"&&typeof g!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=Q(C,g):b&&i.has(h)?o[h]={...C,...g}:b&&jt(h)?o[h]=Q(C,g):o[h]=g}}e&&a(e),t.props&&typeof t.props=="object"&&a(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);const d=o.scope&&typeof o.scope=="object"?o.scope:null,u=s?.scope,p=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=u||p||null;if(t.scope!==void 0||d){const l={};d&&Object.assign(l,d),t.scope!==void 0&&Object.assign(l,t.scope),o.scope=Ut(l,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),Ht(o),Jt(o,s,t),o.if!=null){let l;if(typeof o.if=="function")try{l=o.if(o,o.state,o.context)}catch(h){if(l=!1,r.__ifError=h,typeof console<"u"&&console.warn){const g=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,h?.message||h)}}else l=o.if;r.__if=!!l}if(r.__if)typeof o.if=="function"&&(r.__ifInitialized=!0);else return s&&(s[o.key]=o),typeof o.if=="function"&&Lt(o,r,o.if),o;o.tag||(o.tag=At(o)),I("Init",o,c);const _=o.node=rt(o);if(!_)return o;if(o.tag==="fragment"){const h=(o.context?.document||globalThis.document).createComment("");_.appendChild(h),r.__fragmentAnchor=h}I("AttachNode",o,c),_.setAttribute&&o.key&&_.setAttribute("data-key",o.key),s&&(s[o.key]=o,s.__ref?.__children&&(s.__ref.__children.includes(o.key)||s.__ref.__children.push(o.key))),_.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&_.setAttribute("data-smbls-app",o.context.key),o.id&&_.setAttribute&&(_.id=o.id),Ft(o,c),Pt(o),pt(o),Rt(o),fo(o);try{Mt(o,c)}catch(l){if(typeof console<"u"&&console.error){const h=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,l?.message||l,l?.stack?`
2
+ `+l.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(gt(o,!0),xt(o,s,a),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const u=o.context?.designSystem;u&&E(u);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{u&&P()}}if(I("Create",o,c),I("Complete",o,c),I("Render",o,c),I("RenderRouter",o,c),wt(o,c),typeof o.onFrame=="function"){const u=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&E(h);try{u(o,o.state,o.context)}catch(C){console.error("[DOMQL] onFrame error:",C)}finally{h&&P()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Xt(t,s,n){const c=!s,a=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=c&&a&&t.context?.state,i=n.state!==void 0&&!o?n.state:t.state&&!K(t.state)?t.state:void 0;if(i==null){if(s?.state)t.state=s.state,q(t,t.state);else if(t.context?.state){const e=t.context.state,r={...e},f=t.context?.polyglot;if(f?.translations){const d=e.lang||f.defaultLang||"en",l=f.translations[d];if(l&&typeof l=="object")for(const y in l)r[y]===void 0&&(r[y]=l[y]);const p=new Set(f.languages||[]);for(const y in f.translations)!p.has(y)&&r[y]===void 0&&(r[y]=f.translations[y])}t.state=K(r)?r:ct(r),t.state.__element=t,t.state.root=t.state,q(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),q(t,t.state);return}if(typeof i=="string"){if(t.state=Pt(i,s),t.state&&typeof t.state=="object"&&!K(t.state)){const e=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:e,enumerable:!1,configurable:!0,writable:!0})}q(t,t.state);return}if(typeof i=="function"){const e=i(t,s?.state);t.state=K(e)?e:ct(e||{})}else K(i)?t.state=i:t.state=ct({...i});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,q(t,t.state)}function ut(t,s){if(!s)return t;const n=s.split("/");let c=t;for(const a of n){if(c==null)return{};c=c[a]}return c??{}}function Pt(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const a=t.slice(3);return a?ut(s.state,a):s.state??{}}if(t.startsWith("~/")){const a=s.state?.root||s.state,o=t.slice(2);return o?ut(a,o):a??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=ut(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const c=s.context?.polyglot;if(c?.translations){const a=s.state?.root?.lang||c.defaultLang||"en",o=c.translations[a];if(o?.[t]!==void 0)return o[t];if(c.translations[t]!==void 0)return c.translations[t]}return{}}function Jt(t){const s=t.__ref,n=t.tag||"div",c=t.context?.designSystem,a=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const e=o[i];if(typeof t[e]!="function"||U.has(e))continue;const r=e.charCodeAt(0);r>=65&&r<=90||H(e)||T[e]||$&&$.has(e)||at(n,e)||a.push({prop:e,fn:t[e]})}for(let i=0;i<a.length;i++){const{prop:e,fn:r}=a[i];s.__exec[e]=r,Object.defineProperty(t,e,{get(){c&&E(c);try{return r(t,t.state,t.context)}catch{return}finally{c&&P()}},set(f){delete s.__exec[e],Object.defineProperty(t,e,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function mt(t,s){if(!(!Array.isArray(s)||s.length===0))for(let n=0;n<s.length;n++){const c=s[n];try{typeof c=="function"?c(t,t.state,t.context):typeof c=="string"&&t.state?.[c]}catch{}}}function j(t,s,n){return!Array.isArray(s)||s.length===0?n:function(...c){return mt(t,s),n.apply(this,c)}}function X(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function Ot(t,s){const n=t.__ref,c=!!(s&&s.skipIfEffect);if(Jt(t),typeof t.text=="function"){const o=t.text,i=j(t,t.textDeps,o),e=k(()=>{if(!n.contentManaged)try{let r=i(t,t.state,t.context);t.node&&r!=null&&typeof r!="function"&&typeof r!="object"&&(typeof r=="string"&&r.includes("{{")&&(r=it.call(t,r,t.state)),t.tag==="string"?t.node.nodeValue=r:t.node.textContent=r)}catch{}},{depth:n.path.length});n.__effects.push(e),n.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,i=k(()=>{if(n.contentManaged)return;const e=it.call(t,o,t.state);e!=null&&(t.text=e),t.node&&(t.tag==="string"?t.node.nodeValue=e??"":t.node.textContent=e??"")},{depth:n.path.length});n.__effects.push(i),n.__exec.text=o}for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!U.has(o)&&!H(o)&&!n.__exec[o]){if(T[o]){const i=t[o],e=j(t,t[o+"Deps"],i),r=o;let f;const d=k(()=>{const l=t.context?.designSystem;l&&E(l);try{const p=e(t,t.state,t.context),y=T[r](p,t,t.state,t.context);if(y&&t.node){const _=$t(y);(_===null||_!==f)&&(f=_,Y(t.node,y))}else t.node&&(r==="show"||r==="hide")&&(f=void 0,t.node.style.display="")}finally{l&&P()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=i}else if($&&$.has(o)){const i=t[o],e=j(t,t[o+"Deps"],i),r=o;let f;const d=k(()=>{const l=t.context?.designSystem;l&&E(l);try{const p=e(t,t.state,t.context);if(t.node)if(p!=null){const y=r+":"+String(p);y!==f&&(f=y,Y(t.node,{[r]:p}))}else f=void 0,t.node.style[r]=""}finally{l&&P()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=j(t,t.htmlDeps,o),e=k(()=>{const r=t.context?.designSystem;r&&E(r);try{const f=i(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&(t.node.innerHTML=f)}finally{r&&P()}},{depth:n.path.length});n.__effects.push(e),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=j(t,t.valueDeps,o),e=k(()=>{try{const r=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const f=r==null?"":String(r);if(t.node.value===f)return;const d=typeof document<"u"&&document.activeElement===t.node,l=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=f,d&&l!=null&&p!=null)try{t.node.setSelectionRange(l,p)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(e),n.__exec.value=o}if(typeof t.style=="function"){const o=t.style,i=j(t,t.styleDeps,o);let e;const r=k(()=>{const f=i(t,t.state,t.context),d=$t(f);(d===null||d!==e)&&(e=d,Y(t.node,f))},{depth:n.path.length});n.__effects.push(r),n.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const i=t.style[o];if(typeof i!="function")continue;const e=j(t,X(t.styleDeps,o),i);let r;const f=k(()=>{try{const d=e(t,t.state,t.context);if(t.node){const l=o+":"+String(d);l!==r&&(r=l,Y(t.node,{[o]:d}))}}catch{}},{depth:n.path.length});n.__effects.push(f)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=j(t,X(t.attrDeps,o),t.attr[o]),e=o,r=k(()=>{try{const f=i(t,t.state,t.context);t.node?.setAttribute&&(f==null||f===!1?t.node.removeAttribute(e):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(e,f===!0?"":f))}catch{}},{depth:n.path.length});n.__effects.push(r)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const i=j(t,X(t.ariaDeps,o),t.aria[o]),e="aria-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),r=k(()=>{try{const f=i(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(e):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(e,f===!0?"":f)}catch{}},{depth:n.path.length});n.__effects.push(r)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const i=j(t,X(t.dataDeps,o),t.data[o]),r="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),f=k(()=>{try{const d=i(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(r):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(r,d===!0?"":d)}catch{}},{depth:n.path.length});n.__effects.push(f)}const a=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(a)for(const o in a){if(typeof a[o]!="function")continue;const i=j(t,X(t.classDeps,o),a[o]),e=k(()=>{try{const r=i(t,t.state,t.context);if(!t.node?.classList)return;typeof r=="string"?t.node.classList.add(r):r?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:n.path.length});n.__effects.push(e)}!c&&typeof t.if=="function"&&Lt(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||U.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||H(o))continue;const e=t[o];n.__exec[o]=e;const r=t.tag||"div";if(at(r,o)&&!T[o]&&!($&&$.has(o))){const f=ft(o)||o,d=j(t,t[o+"Deps"],e),l=k(()=>{try{const p=d(t,t.state,t.context);t.node?.setAttribute&&(p==null||p===!1?t.node.removeAttribute(f):typeof p!="function"&&typeof p!="object"&&(f==="src"&&"src"in t.node?t.node.src=p:t.node.setAttribute(f,p===!0?"":p)))}catch{}},{depth:n.path.length});n.__effects.push(l)}}if(so(t),co(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let e=!1,r=[];const f=k(()=>{const d=[];for(let _=0;_<i.length;_++){const u=i[_];try{d[_]=typeof u=="function"?u(t,t.state,t.context):t.state?.[u]}catch{d[_]=void 0}}if(!e){e=!0,r=d;return}let l=d.length!==r.length;for(let _=0;!l&&_<d.length;_++)d[_]!==r[_]&&(l=!0);const p=r;if(r=d,!l)return;const y=t.context?.designSystem;y&&E(y);try{o(t,t.state,t.context,{prev:p,next:d})}catch(_){if(t.context?.plugins?.length&&V("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{y&&P()}},{depth:n.path.length});n.__effects.push(f)}}function Lt(t,s,n){const c=j(t,t.ifDeps,n),a=k(()=>{let o;try{o=c(t,t.state,t.context)}catch(e){if(o=!1,s.__ifError=e,typeof console<"u"&&console.warn){const r=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${r} \u2014 treating as false:`,e?.message||e)}return}const i=s.__if;if(s.__if=!!o,i&&!s.__if&&t.node)t.node.remove();else if(!i&&s.__if)if(s.__ifInitialized){t.node||(t.node=rt(t)),t.node&&(t.node.ref=t);const e=t.parent,r=e?.node;if(r&&t.node){let f=null;const d=Object.keys(e),l=d.indexOf(t.key);for(let p=l+1;p<d.length;p++){const y=e[d[p]];if(y?.node?.parentNode===r){f=y.node;break}}f?r.insertBefore(t.node,f):r.appendChild(t.node)}else xt(t,t.parent);pt(t)}else{if(s.__ifInitialized=!0,t.tag||(t.tag=vt(t)),I("Init",t,{}),t.node||(t.node=rt(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const r=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(r),s.__fragmentAnchor=r}I("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ft(t,{}),Ot(t,{skipIfEffect:!0}),pt(t),Rt(t),Mt(t,{}),xt(t,t.parent),wt(t,{})}},{depth:s.path.length});s.__effects.push(a)}function pt(t){const{node:s}=t;if(s){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?s.nodeValue=t.text:s.textContent=t.text:typeof t.text=="number"&&(s.textContent=t.text),io(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in s){const n=String(t.value);s.value!==n&&(s.value=n)}if(t.style&&typeof t.style=="object"&&Y(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const c=t.attr[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.setAttribute&&s.setAttribute(n,c===!0?"":c)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.dataset&&(s.dataset[n]=c===!0?"":c)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(c=>c&&s.classList.add(c));else if(typeof n=="object")for(const c in n){const a=typeof n[c]=="function"?n[c](t,t.state,t.context):n[c];a&&s.classList.add(typeof a=="string"?a:c)}}}}function $t(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Y(t,s){if(!t||!s||!t.style)return;let n=null;for(const c in s){const a=s[c];if(a!=null){if(c.charAt(0)==="&"&&typeof a=="object"){n||(n={}),n[c]=a;continue}try{const o=String(a),i=c.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),e=o.trim(),r=/\s*!important\s*$/.test(e),f=e.replace(/\s*!important\s*$/,"");t.style.setProperty(i,f,r?"important":"")}catch{}}}n&&oo(t,n)}let to=0;function oo(t,s){const n=`_ds${to++}`;t.classList.add(n);const c=t.ownerDocument;let a=c.querySelector("style[data-smbls-scoped]");a||(a=c.createElement("style"),a.setAttribute("data-smbls-scoped",""),c.head.appendChild(a));let o="";for(const i in s){const e="."+n,r=i.replace(/&/g,e).split(",").map(d=>{const l=d.trim();return l.includes(e)?l:e+l}).join(", "),f=s[i];if(typeof f=="object"){let d="",l="";for(const p in f){const y=f[p];if(typeof y=="object"){const _=p.includes("&")?r.split(", ").map(h=>p.replace(/&/g,h)).join(", "):r.split(", ").map(h=>`${h} ${p}`).join(", ");let u="";for(const h in y)u+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[h]};`;l+=St(`${_} { ${u} }`,_)+`
5
- `}else d+=`${p.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(o+=St(`${r} { ${d} }`,r)+`
6
- `),l&&(o+=l)}}o&&(a.textContent+=o)}function so(t){let s=t.subscribeTo;if(typeof s=="function")try{s=s(t,t.state,t.context)}catch{s=null}if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let c=0;c<s.length;c++){const a=s[c];if(typeof a!="string"||a.length===0)continue;const o=a.split("."),i=o[0],e=o.slice(1),r={value:!1},f=k(()=>{const d=t.state&&(K(t.state)?t.state.root:null);if(!d||!K(d))return;let l=d;l=l[i];for(let y=0;y<e.length&&!(l==null||typeof l!="object");y++)if(K(l))l=l[e[y]];else break;if(!r.value)return;let p=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&E(y);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(p=!0)}catch(_){t.context?.plugins?.length&&V("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&P()}}if(!p&&t.node&&n.__effects)for(let y=0;y<n.__effects.length;y++){const _=n.__effects[y];_&&_!==f&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!p&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&E(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&V("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&P()}}},{depth:n.path.length});r.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function lt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}const Dt=new Set;function no(t,s){const n=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",c=n+"::"+t;Dt.has(c)||(Dt.add(c),console.warn(`[smbls/css] "${t}" at ${n} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function G(t,s,n){const c={},a=(o,i)=>{if(T[o]){const e=T[o](i,s,s.state,s.context);if(e){const r=Array.isArray(e)?e:[e];for(const f of r)f&&Object.assign(c,f)}}else c[o]=i};for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let i=t[o];if(typeof i=="function"&&(i=i(s,s.state,s.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(o==="style"){for(const f in i){let d=i[f];typeof d=="function"&&(d=d(s,s.state,s.context)),!(d==null||typeof d=="function")&&a(f,d)}continue}if(lt(o,s)){const f=G(i,s,!0);Object.keys(f).length&&(c[`[data-theme="${o.slice(1)}"] &`]=f);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(o)){Ct()&&no(o,s);continue}let e=o;if(o.charCodeAt(0)===64&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const f=s.context?.designSystem?.media?.[o.slice(1)];f&&(e=`@media ${f}`)}const r=G(i,s,!1);Object.keys(r).length&&(c[e]=r);continue}a(o,i)}}if(n)for(const o in c){const i=c[o];typeof i=="string"&&!i.includes("!important")&&(c[o]=i+" !important")}return c}function co(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;const a=c.charAt(0);if(a!=="."&&a!=="!")continue;const o=c.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const l=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${c}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${a}\` is read as one prop name. Nest the selector inside instead: \`${a}${l}: { '${o.slice(l.length)}': {...} }\`.`)}continue}const i=t[c];if(!i||typeof i!="object")continue;const e=a==="!",r={lastMatch:!1,appliedKeys:null,appliedClasses:null},f=()=>{if(!t.node)return;let l;const p=t[o];if(p===void 0)if(t.state&&o in t.state)l=t.state[o];else{const u=t.context?.cases?.[o];if(u===void 0)return;try{l=typeof u=="function"?u.call(t,t):u}catch(h){l=!1,s.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof p=="function")try{l=p(t,t.state,t.context)}catch(u){l=!1,s.__conditionalError=u,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,u?.message||u)}else l=p;const y=e?!l:!!l;if(y===r.lastMatch)return;r.lastMatch=y;const _=t.context?.designSystem;_&&E(_);try{if(y){const u={},h={};let g=!1;for(const x in i){if(!Object.prototype.hasOwnProperty.call(i,x))continue;const b=i[x],S=x.charAt(0);if((S===":"||S==="@"||S==="&")&&b&&typeof b=="object"&&!Array.isArray(b)){if(lt(x,t)){const O=G(b,t,!0);Object.keys(O).length&&(h[`[data-theme="${x.slice(1)}"] &`]=O,g=!0)}else{let O=x;if(S==="@"&&!x.startsWith("@media")&&!x.startsWith("@keyframes")){const D=t.context?.designSystem?.media?.[x.slice(1)];D&&(O=`@media ${D}`)}const W=G(b,t,!1);Object.keys(W).length&&(h[O]=W,g=!0)}continue}const N=typeof b=="function"?b(t,t.state,t.context):b;if(N!=null)if(T[x]){const O=T[x](N,t,t.state,t.context);if(O){const W=Array.isArray(O)?O:[O];for(const D of W)D&&Object.assign(u,D)}}else $&&$.has(x)&&(u[x]=N)}const C=Object.keys(u);if(C.length){Y(t.node,u);for(const x of C)n.set(x,c);r.appliedKeys=C}else r.appliedKeys=null;if(g){const x=et(h,null,t.context?.cssPrefix),b=x?x.split(" ").filter(Boolean):[];if(b.length&&t.node.classList){for(const S of b)t.node.classList.add(S);r.appliedClasses=b}else r.appliedClasses=null}else if(r.appliedClasses){for(const x of r.appliedClasses)t.node.classList.remove(x);r.appliedClasses=null}}else{if(r.appliedKeys){for(const u of r.appliedKeys)n.get(u)===c&&(t.node.style[u]="",n.delete(u));r.appliedKeys=null}if(r.appliedClasses){for(const u of r.appliedClasses)t.node.classList.remove(u);r.appliedClasses=null}}}finally{_&&P()}};s.__conditionalRunners.push(f);const d=k(f,{depth:s.path.length});s.__effects.push(d)}}const yt=new WeakSet;function ro(t){const s=t.ownerDocument;!s||yt.has(s)||(yt.add(s),queueMicrotask(()=>{yt.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const ht=new WeakSet;let Tt=!1;function io(t){const{node:s}=t;if(!s)return;if(Tt||(Tt=!0,et({display:"none"})),ht.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}ht.add(t);const n=t.context?.designSystem;n&&E(n);try{const c={};let a=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||U.has(o))continue;const i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!H(o)){if(T[o]){const e=t[o],r=T[o](e,t,t.state,t.context);if(r){if(Array.isArray(r))for(const f of r)f&&Object.assign(c,f);else Object.assign(c,r);a=!0}}else if($&&$.has(o)){const e=t[o];e!=null&&typeof e!="object"&&(c[o]=e,a=!0)}else if(o.charCodeAt(0)===45){const e=t[o];e!=null&&typeof e!="object"&&(c[o]=e,a=!0)}else if(o.charAt(0)==="&"){const e=t[o];e&&typeof e=="object"&&(c[o]=e,a=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const e=t[o];if(e&&typeof e=="object"){if(lt(o,t)){const r=G(e,t,!0);Object.keys(r).length&&(c[`[data-theme="${o.slice(1)}"] &`]=r,a=!0)}else{let r=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const d=t.context?.designSystem?.media?.[o.slice(1)];d&&(r=`@media ${d}`)}const f=G(e,t,!1);Object.keys(f).length&&(c[r]=f,a=!0)}a=!0}}}}if(a){c.display&&String(c.display).includes("!important")&&(s.style.setProperty("display",String(c.display).replace(/\s*!important\s*$/,""),"important"),delete c.display);const o=et(c,null,t.context?.cssPrefix);if(o&&s.classList){const e=o.split(" ").filter(Boolean);let r=!1;for(const f of e)s.classList.add(f),r||(f.charCodeAt(0)===95&&f.charCodeAt(1)===99||f.charCodeAt(0)===95&&f.indexOf("_c",1)!==-1)&&(r=!0);r&&ro(s)}const i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){const e=c.display;if(e&&e!==i)if(i==="none"){const r=[];for(const f of s.classList)f.startsWith("_d-")&&f!=="_d-none"&&r.push(f);for(const f of r)s.classList.remove(f);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&P(),ht.delete(t)}}function Rt(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const a in t.aria){const o=t.aria[a];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const i="aria-"+a.replace(/[A-Z]/g,e=>"-"+e.toLowerCase());s.setAttribute(i,o===!0?"":o)}const n=Ht(t);for(const a in n){const o=n[a];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(a,o===!0?"":o)}const c=t.tag||"div";for(const a in t){if(!Object.prototype.hasOwnProperty.call(t,a)||typeof t[a]=="function"||U.has(a)||a==="on"||n[a]!==void 0)continue;const o=a.charCodeAt(0);if(!(o>=65&&o<=90)&&!H(a)&&!(T[a]||$&&$.has(a))&&at(c,a)){let i=t[a];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=it(i,t,t.state,t.context),t[a]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!Yt(ft(a)||a))continue;const e=ft(a)||a;s.setAttribute(e,zt(e,i))}}}function eo(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,c=n&&typeof n=="object"&&n.max?String(n.max):null;c&&(s.style.maxHeight=c);const a=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};a(),s.addEventListener("input",a),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",a)}catch{}})}const Nt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ft(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!H(n)||Nt.has(n))continue;let c=t[n];if(typeof c=="string"&&/^[A-Za-z_$][\w$]*$/.test(c)){const o=c;c=function(e){return t.call(o,e)}}if(typeof c!="function")continue;const a=qt(n);Ut.has(a)||Vt(Qt(a),t,c)}ao(t)}function ao(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let c=!1;for(const p of Nt){const y=t[p];typeof y=="function"&&(n[p]=y,c=!0)}if(!c)return;const a=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,e=0,r=0,f=!1;const d=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(i=y.clientX,e=y.clientY,r=Date.now(),f=!0)},l=p=>{if(!f)return;f=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const _=y.clientX-i,u=y.clientY-e,h=Date.now()-r;if(h>o)return;const g=Math.abs(_),C=Math.abs(u);if(Math.max(g,C)<a)return;let x;if(g>C*1.2)x=_<0?"left":"right";else if(C>g*1.2)x=u<0?"up":"down";else return;const b="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),S=n[b],N=n.onSwipe;S&&S.call(t,p,t,t.state,t.context),N&&N.call(t,{direction:x,dx:_,dy:u,dt:h,event:p},t,t.state,t.context)};s.addEventListener("touchstart",d,{passive:!0}),s.addEventListener("touchend",l,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",d)}catch{}try{s.removeEventListener("touchend",l)}catch{}})}function tt(t,s){const n={...t};for(const c in s){const a=n[c],o=s[c];a&&o&&typeof a=="object"&&typeof o=="object"&&!Array.isArray(a)&&!Array.isArray(o)&&typeof a!="function"&&typeof o!="function"?n[c]=tt(a,o):n[c]=o}return n}function _t(t,s,n){if(!s||!t.node)return;const c=t.childExtends;if(Array.isArray(s)){const a=t.tag==="fragment",o=t.context?.document||globalThis.document,i=a?null:o?.createDocumentFragment();if(!a&&!i)return;const e=t.childProps,r=t.childrenAs;for(let f=0;f<s.length;f++){let d=s[f];const l=d;(typeof d=="string"||typeof d=="number")&&(d={text:d});let p=e;if(typeof e=="function")try{p=e(t,d)}catch{p=null}if(r==="state"){let u=l;(typeof l=="string"||typeof l=="number")&&(u={value:l,text:l}),d=p?{...p,state:u}:{state:u}}else p&&(d=tt(p,d));if(c&&!d.ignoreChildExtends)if(d.extends){const u=Array.isArray(d.extends)?d.extends:[d.extends],h=Array.isArray(c)?c:[c];d={...d,extends:[...h,...u]}}else d={...d,extends:c};const y=d?.key||l&&typeof l=="object"&&l.key||`${f}`;let _;try{_=z(d,t,y,n)}catch(u){if(typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y}" failed to construct at ${h} (initial render, skipping this row):`,u?.message||u)}continue}!a&&_?.node&&i.appendChild(_.node)}a||t.node.appendChild(i);return}if(typeof s=="string"){const a=Pt(s,t);if(Array.isArray(a)){_t(t,a,n);return}}if(typeof s=="object")for(const a in s){if(U.has(a))continue;let o=s[a];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=tt(t.childProps,o)),c&&!o.ignoreChildExtends)if(o.extends){const i=Array.isArray(o.extends)?o.extends:[o.extends],e=Array.isArray(c)?c:[c];o={...o,extends:[...e,...i]}}else o={...o,extends:c};z(o,t,a,n)}}}function gt(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const c=n.options;if(!c||!c.length)return;const a=t.__ref,o=a&&a.__exec&&a.__exec.value,i=typeof o=="function",e=t.value!=null&&typeof t.value!="function";if(i||e){let d;if(i)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const l=d==null?"":String(d);n.value!==l&&(n.value=l);return}const r=s||!(a&&a.__selectSynced);if(a&&(a.__selectSynced=!0),!r)return;let f=-1;for(let d=0;d<c.length;d++)c[d].defaultSelected&&(f=d);f>=0&&n.selectedIndex!==f&&(n.selectedIndex=f)}function Mt(t,s){let{children:n,content:c}=t;const a=t.childExtends;if(typeof n=="function"){const i=n;try{n=i(t,t.state,t.context)}catch(l){if(n=void 0,typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,l?.message||l)}}t.children=n;const e=t.__ref;let r=!1;const f=j(t,t.childrenDeps,i),d=k(()=>{const l=r;r=!0;let p;try{p=f(t,t.state,t.context)}catch(b){if(typeof console<"u"&&console.error){const S=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${S}${l?"":" (initial tracking run)"}:`,b?.message||b)}return}if(!l||p===t.children)return;t.children=p;const y=typeof t.onContentUpdate=="function",_=y?[]:null,u=y?[]:null,h=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const b=t.childProps,S=[],N=new Map;for(let A=0;A<p.length;A++){const L=p[A];let v=b;if(typeof b=="function")try{v=b(t,L)}catch{v=null}const F=v&&v.key||L&&L.key||`${A}`;S.push(F),N.set(F,{rawChild:L,childProps:v})}const O=new Set(S),W=e.__children.slice();for(const A of W)if(!O.has(A)){const L=t[A];L?.remove&&L.remove(),delete t[A],u&&u.push(A)}const D=t.childExtends,J=t.tag==="fragment",It=t.context?.document||globalThis.document,Z=J?null:It?.createDocumentFragment(),ot=new Set;for(const A of S){const L=N.get(A),v=L.rawChild,F=t[A];if(F&&F.state){if(v&&typeof v=="object"){const w=F.state,B=w.$replace||w.replace,At=w.$update||w.update;if(typeof B=="function")B.call(w,v);else if(typeof At=="function"){for(const M in w)if(!(M==="__element"||M==="root"||M==="parent"||M==="update")&&!Object.prototype.hasOwnProperty.call(v,M))try{w[M]=void 0}catch{}At.call(w,v)}else for(const M in v)w[M]=v[M]}h&&h.push(A);continue}let st=v;(typeof v=="string"||typeof v=="number")&&(st={value:v,text:v});const bt=L.childProps;let R=bt?{...bt,state:st}:{state:st};if(D&&!R.ignoreChildExtends)if(R.extends){const w=Array.isArray(R.extends)?R.extends:[R.extends],B=Array.isArray(D)?D:[D];R={...R,extends:[...B,...w]}}else R={...R,extends:D};let nt;try{nt=z(R,t,A,s)}catch(w){if(typeof console<"u"&&console.error){const B=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to construct at ${B} (reconcile, skipping this row):`,w?.message||w)}ot.add(A);continue}!J&&nt?.node&&Z&&Z.appendChild(nt.node),_&&_.push(A)}if(!J&&Z&&Z.childNodes.length&&t.node&&t.node.appendChild(Z),!J&&t.node){let A=null;for(const L of S){const v=t[L]?.node;if(!v)continue;const F=A?A.nextSibling:t.node.firstChild;v!==F&&t.node.insertBefore(v,F),A=v}}e.__children=ot.size?S.filter(A=>!ot.has(A)):S,y&&(_.length||u.length)&&jt(t,{added:_,removed:u,kept:h}),gt(t,!1);return}const x=y?[...e.__children]:null;for(const b of[...e.__children]){const S=t[b];S?.remove&&S.remove(),delete t[b]}e.__children=[],_t(t,p,s),gt(t,!1),y&&jt(t,{added:[...e.__children],removed:x,kept:[]})},{depth:e.path.length});e.__effects.push(d)}if(_t(t,n||c,s),n||c)return;const o=t.context?.components||{};{const i=Object.keys(t);for(let e=0;e<i.length;e++){const r=i[e];if(!r.endsWith("Extends")||typeof t[r]!="string")continue;const f=r.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;const d={extends:t[r]};delete t[r];for(let l=e+1;l<i.length;l++){const p=i[l],y=p.charCodeAt(0);if(y>=65&&y<=90||U.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const _=t[p];_!==void 0&&(d[p]=_,delete t[p])}t[f]&&typeof t[f]=="object"?t[f]={...d,...t[f]}:t[f]=d}}for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||U.has(i)||typeof t[i]!="object"||t[i]===null)continue;const e=i.charCodeAt(0);if(e<65||e>90)continue;let r=t[i];if(!r.__ref){if(!r.extends&&!r.extend){const f=o[i]||o[`smbls.${i}`];f&&(r={...r,extends:f})}if(t.childProps&&(r=tt(t.childProps,r)),a&&!r.ignoreChildExtends)if(r.extends){const f=Array.isArray(r.extends)?r.extends:[r.extends],d=Array.isArray(a)?a:[a];r={...r,extends:[...d,...f]}}else r={...r,extends:a};z(r,t,i,s)}}}function xt(t,s,n){const{node:c}=t;if(!c)return;c.ref=t;const a=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(a){const i=a.parentNode;if(i){if(n?.position==="before"&&n.node)i.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const e=n.node.nextSibling;i.insertBefore(c,e||a)}else i.insertBefore(c,a);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;i?o.insertBefore(c,i):o.appendChild(c)}else o.appendChild(c)}function I(t,s,n){const c=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&V(c,s,n);const a="on"+t,o=s[a];if(typeof o=="function"){const i=t==="Render"||t==="RenderRouter";if(i){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const e=s.context?.designSystem;e&&E(e);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(r){if(s.context?.plugins?.length&&V("error",s,{hook:a,error:r})||console.error(`[DOMQL] Lifecycle "${a}" error:`,r),s.context?.strictMode)throw r}finally{e&&P(),i&&(s.__ref.__inRender=!1)}}return!0}var Lo=z;export{z as create,Lo as default,kt as flushMounts};
4
+ `):"")}}if(gt(o,!0),It(o,s,f),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const l=o.context?.designSystem;l&&O(l);try{const h=o.html(o,o.state,o.context);h!=null&&typeof h!="function"&&(o.node.innerHTML=h)}catch{}finally{l&&L()}}if(I("Create",o,c),I("Complete",o,c),I("Render",o,c),I("RenderRouter",o,c),kt(o,c),typeof o.onFrame=="function"){const l=o.onFrame,h=o.context?.designSystem,g=()=>{if(o.node){if(o.node.isConnected){h&&O(h);try{l(o,o.state,o.context)}catch(C){console.error("[DOMQL] onFrame error:",C)}finally{h&&L()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return o}function Jt(t,s,n){const c=!s,f=n.state&&typeof n.state=="object"&&!Array.isArray(n.state)&&Object.keys(n.state).length===0,o=c&&f&&t.context?.state,r=n.state!==void 0&&!o?n.state:t.state&&!K(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,q(t,t.state);else if(t.context?.state){const i=t.context.state,e={...i},a=t.context?.polyglot;if(a?.translations){const d=i.lang||a.defaultLang||"en",u=a.translations[d];if(u&&typeof u=="object")for(const y in u)e[y]===void 0&&(e[y]=u[y]);const p=new Set(a.languages||[]);for(const y in a.translations)!p.has(y)&&e[y]===void 0&&(e[y]=a.translations[y])}t.state=K(e)?e:ct(e),t.state.__element=t,t.state.root=t.state,q(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),q(t,t.state);return}if(typeof r=="string"){if(t.state=Et(r,s),t.state&&typeof t.state=="object"&&!K(t.state)){const i=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}q(t,t.state);return}if(typeof r=="function"){const i=r(t,s?.state);t.state=K(i)?i:ct(i||{})}else K(r)?t.state=r:t.state=ct({...r});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,q(t,t.state)}function ut(t,s){if(!s)return t;const n=s.split("/");let c=t;for(const f of n){if(c==null)return{};c=c[f]}return c??{}}function Et(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const f=t.slice(3);return f?ut(s.state,f):s.state??{}}if(t.startsWith("~/")){const f=s.state?.root||s.state,o=t.slice(2);return o?ut(f,o):f??{}}if(s.state?.[t]!==void 0)return s.state[t];const n=ut(s.state,t);if(n!=null&&Object.keys(n).length>0)return n;const c=s.context?.polyglot;if(c?.translations){const f=s.state?.root?.lang||c.defaultLang||"en",o=c.translations[f];if(o?.[t]!==void 0)return o[t];if(c.translations[t]!==void 0)return c.translations[t]}return{}}function mt(t){const s=t.__ref,n=t.tag||"div",c=t.context?.designSystem,f=[],o=Object.keys(t);for(let r=0;r<o.length;r++){const i=o[r];if(typeof t[i]!="function"||U.has(i))continue;const e=i.charCodeAt(0);e>=65&&e<=90||H(i)||P[i]||w&&w.has(i)||ft(n,i)||f.push({prop:i,fn:t[i]})}for(let r=0;r<f.length;r++){const{prop:i,fn:e}=f[r];s.__exec[i]=e,Object.defineProperty(t,i,{get(){c&&O(c);try{return e(t,t.state,t.context)}catch{return}finally{c&&L()}},set(a){delete s.__exec[i],Object.defineProperty(t,i,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function to(t,s){if(!(!Array.isArray(s)||s.length===0))for(let n=0;n<s.length;n++){const c=s[n];try{typeof c=="function"?c(t,t.state,t.context):typeof c=="string"&&t.state?.[c]}catch{}}}function E(t,s,n){return!Array.isArray(s)||s.length===0?n:function(...c){return to(t,s),n.apply(this,c)}}function X(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function Pt(t,s){const n=t.__ref,c=!!(s&&s.skipIfEffect);if(mt(t),typeof t.text=="function"){const o=t.text,r=E(t,t.textDeps,o),i=k(()=>{if(!n.contentManaged)try{let e=r(t,t.state,t.context);t.node&&e!=null&&typeof e!="function"&&typeof e!="object"&&(typeof e=="string"&&e.includes("{{")&&(e=it.call(t,e,t.state)),t.tag==="string"?t.node.nodeValue=e:t.node.textContent=e)}catch{}},{depth:n.path.length});n.__effects.push(i),n.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,r=k(()=>{if(n.contentManaged)return;const i=it.call(t,o,t.state);i!=null&&(t.text=i),t.node&&(t.tag==="string"?t.node.nodeValue=i??"":t.node.textContent=i??"")},{depth:n.path.length});n.__effects.push(r),n.__exec.text=o}for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!U.has(o)&&!H(o)&&!n.__exec[o]){if(P[o]){const r=t[o],i=E(t,t[o+"Deps"],r),e=o;let a;const d=k(()=>{const u=t.context?.designSystem;u&&O(u);try{const p=i(t,t.state,t.context),y=P[e](p,t,t.state,t.context);if(y&&t.node){const _=$t(y);(_===null||_!==a)&&(a=_,Y(t.node,y))}else t.node&&(e==="show"||e==="hide")&&(a=void 0,t.node.style.display="")}finally{u&&L()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=r}else if(w&&w.has(o)){const r=t[o],i=E(t,t[o+"Deps"],r),e=o;let a;const d=k(()=>{const u=t.context?.designSystem;u&&O(u);try{const p=i(t,t.state,t.context);if(t.node)if(p!=null){const y=e+":"+String(p);y!==a&&(a=y,Y(t.node,{[e]:p}))}else a=void 0,t.node.style[e]=""}finally{u&&L()}},{depth:n.path.length});n.__effects.push(d),n.__exec[o]=r}}if(typeof t.html=="function"){const o=t.html,r=E(t,t.htmlDeps,o),i=k(()=>{const e=t.context?.designSystem;e&&O(e);try{const a=r(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&(t.node.innerHTML=a)}finally{e&&L()}},{depth:n.path.length});n.__effects.push(i),n.__exec.html=o}if(typeof t.value=="function"){const o=t.value,r=E(t,t.valueDeps,o),i=k(()=>{try{const e=r(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const a=e==null?"":String(e);if(t.node.value===a)return;const d=typeof document<"u"&&document.activeElement===t.node,u=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,p=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=a,d&&u!=null&&p!=null)try{t.node.setSelectionRange(u,p)}catch{}}catch{}},{depth:n.path.length});n.__effects.push(i),n.__exec.value=o}if(typeof t.style=="function"){const o=t.style,r=E(t,t.styleDeps,o);let i;const e=k(()=>{const a=r(t,t.state,t.context),d=$t(a);(d===null||d!==i)&&(i=d,Y(t.node,a))},{depth:n.path.length});n.__effects.push(e),n.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const r=t.style[o];if(typeof r!="function")continue;const i=E(t,X(t.styleDeps,o),r);let e;const a=k(()=>{try{const d=i(t,t.state,t.context);if(t.node){const u=o+":"+String(d);u!==e&&(e=u,Y(t.node,{[o]:d}))}}catch{}},{depth:n.path.length});n.__effects.push(a)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const r=E(t,X(t.attrDeps,o),t.attr[o]),i=o,e=k(()=>{try{const a=r(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:n.path.length});n.__effects.push(e)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const r=E(t,X(t.ariaDeps,o),t.aria[o]),i="aria-"+o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),e=k(()=>{try{const a=r(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:n.path.length});n.__effects.push(e)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const r=E(t,X(t.dataDeps,o),t.data[o]),e="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),a=k(()=>{try{const d=r(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(e):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(e,d===!0?"":d)}catch{}},{depth:n.path.length});n.__effects.push(a)}const f=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(f)for(const o in f){if(typeof f[o]!="function")continue;const r=E(t,X(t.classDeps,o),f[o]),i=k(()=>{try{const e=r(t,t.state,t.context);if(!t.node?.classList)return;typeof e=="string"?t.node.classList.add(e):e?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:n.path.length});n.__effects.push(i)}!c&&typeof t.if=="function"&&Lt(t,n,t.if);for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||U.has(o)||typeof t[o]!="function")continue;const r=o.charCodeAt(0);if(r>=65&&r<=90||H(o))continue;const i=t[o];n.__exec[o]=i;const e=t.tag||"div";if(ft(e,o)&&!P[o]&&!(w&&w.has(o))){const a=at(o)||o,d=E(t,t[o+"Deps"],i),u=k(()=>{try{const p=d(t,t.state,t.context);t.node?.setAttribute&&(p==null||p===!1?t.node.removeAttribute(a):typeof p!="function"&&typeof p!="object"&&(a==="src"&&"src"in t.node?t.node.src=p:t.node.setAttribute(a,p===!0?"":p)))}catch{}},{depth:n.path.length});n.__effects.push(u)}}if(no(t),ro(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,r=t.stateDeps;let i=!1,e=[];const a=k(()=>{const d=[];for(let _=0;_<r.length;_++){const l=r[_];try{d[_]=typeof l=="function"?l(t,t.state,t.context):t.state?.[l]}catch{d[_]=void 0}}if(!i){i=!0,e=d;return}let u=d.length!==e.length;for(let _=0;!u&&_<d.length;_++)d[_]!==e[_]&&(u=!0);const p=e;if(e=d,!u)return;const y=t.context?.designSystem;y&&O(y);try{o(t,t.state,t.context,{prev:p,next:d})}catch(_){if(t.context?.plugins?.length&&V("error",t,{hook:"onStateUpdate",error:_})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',_),t.context?.strictMode)throw _}finally{y&&L()}},{depth:n.path.length});n.__effects.push(a)}}function Ot(t){const s=t.parent,n=s?.node;if(!n||!t.node){It(t,t.parent);return}let c=null;const f=Object.keys(s),o=f.indexOf(t.key);for(let r=o+1;r<f.length;r++){const i=s[f[r]];if(i?.node?.parentNode===n){c=i.node;break}}c?n.insertBefore(t.node,c):n.appendChild(t.node)}function Lt(t,s,n){const c=E(t,t.ifDeps,n),f=k(()=>{let o;try{o=c(t,t.state,t.context)}catch(i){if(o=!1,s.__ifError=i,typeof console<"u"&&console.warn){const e=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${e} \u2014 treating as false:`,i?.message||i)}return}const r=s.__if;if(s.__if=!!o,r&&!s.__if&&t.node)t.node.remove();else if(!r&&s.__if)if(s.__ifInitialized)t.node||(t.node=rt(t)),t.node&&(t.node.ref=t),Ot(t),pt(t);else{if(s.__ifInitialized=!0,t.tag||(t.tag=At(t)),I("Init",t,{}),t.node||(t.node=rt(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const e=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(e),s.__fragmentAnchor=e}I("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ft(t,{}),Pt(t,{skipIfEffect:!0}),pt(t),Rt(t),Mt(t,{}),Ot(t),kt(t,{})}},{depth:s.path.length});s.__effects.push(f)}function pt(t){const{node:s}=t;if(s){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?s.nodeValue=t.text:s.textContent=t.text:typeof t.text=="number"&&(s.textContent=t.text),eo(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in s){const n=String(t.value);s.value!==n&&(s.value=n)}if(t.style&&typeof t.style=="object"&&Y(s,t.style),t.attr&&typeof t.attr=="object")for(const n in t.attr){const c=t.attr[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.setAttribute&&s.setAttribute(n,c===!0?"":c)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];typeof c=="function"||typeof c=="object"||c==null||c===!1||s.dataset&&(s.dataset[n]=c===!0?"":c)}if(t.classlist||t.class){const n=t.classlist||t.class;if(typeof n=="string")n.split(" ").forEach(c=>c&&s.classList.add(c));else if(typeof n=="object")for(const c in n){const f=typeof n[c]=="function"?n[c](t,t.state,t.context):n[c];f&&s.classList.add(typeof f=="string"?f:c)}}}}function $t(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Y(t,s){if(!t||!s||!t.style)return;let n=null;for(const c in s){const f=s[c];if(f!=null){if(c.charAt(0)==="&"&&typeof f=="object"){n||(n={}),n[c]=f;continue}try{const o=String(f),r=c.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),i=o.trim(),e=/\s*!important\s*$/.test(i),a=i.replace(/\s*!important\s*$/,"");t.style.setProperty(r,a,e?"important":"")}catch{}}}n&&so(t,n)}let oo=0;function so(t,s){const n=`_ds${oo++}`;t.classList.add(n);const c=t.ownerDocument;let f=c.querySelector("style[data-smbls-scoped]");f||(f=c.createElement("style"),f.setAttribute("data-smbls-scoped",""),c.head.appendChild(f));let o="";for(const r in s){const i="."+n,e=r.replace(/&/g,i).split(",").map(d=>{const u=d.trim();return u.includes(i)?u:i+u}).join(", "),a=s[r];if(typeof a=="object"){let d="",u="";for(const p in a){const y=a[p];if(typeof y=="object"){const _=p.includes("&")?e.split(", ").map(h=>p.replace(/&/g,h)).join(", "):e.split(", ").map(h=>`${h} ${p}`).join(", ");let l="";for(const h in y)l+=`${h.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y[h]};`;u+=Ct(`${_} { ${l} }`,_)+`
5
+ `}else d+=`${p.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(o+=Ct(`${e} { ${d} }`,e)+`
6
+ `),u&&(o+=u)}}o&&(f.textContent+=o)}function no(t){let s=t.subscribeTo;if(typeof s=="function")try{s=s(t,t.state,t.context)}catch{s=null}if(!Array.isArray(s)||s.length===0)return;const n=t.__ref;for(let c=0;c<s.length;c++){const f=s[c];if(typeof f!="string"||f.length===0)continue;const o=f.split("."),r=o[0],i=o.slice(1),e={value:!1},a=k(()=>{const d=t.state&&(K(t.state)?t.state.root:null);if(!d||!K(d))return;let u=d;u=u[r];for(let y=0;y<i.length&&!(u==null||typeof u!="object");y++)if(K(u))u=u[i[y]];else break;if(!e.value)return;let p=!1;if(typeof t.onBeforeUpdate=="function"){const y=t.context?.designSystem;y&&O(y);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(p=!0)}catch(_){t.context?.plugins?.length&&V("error",t,{hook:"onBeforeUpdate",error:_})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",_)}finally{y&&L()}}if(!p&&t.node&&n.__effects)for(let y=0;y<n.__effects.length;y++){const _=n.__effects[y];_&&_!==a&&!_._disposed&&!_._isSubscribeToEffect&&typeof _._execute=="function"&&_._execute()}if(!p&&typeof t.onUpdate=="function"){const y=t.context?.designSystem;y&&O(y);try{t.onUpdate(t,t.state,t.context)}catch(_){t.context?.plugins?.length&&V("error",t,{hook:"onUpdate",error:_})||console.error("[DOMQL] subscribeTo onUpdate error:",_)}finally{y&&L()}}},{depth:n.path.length});e.value=!0,a._isSubscribeToEffect=!0,n.__effects.push(a)}}function lt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}const Dt=new Set;function co(t,s){const n=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",c=n+"::"+t;Dt.has(c)||(Dt.add(c),console.warn(`[smbls/css] "${t}" at ${n} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function G(t,s,n){const c={},f=new Set,o=(r,i,e)=>{const a=e?new Set(Object.keys(c)):null;if(P[r]){const d=P[r](i,s,s.state,s.context);if(d){const u=Array.isArray(d)?d:[d];for(const p of u)p&&Object.assign(c,p)}}else c[r]=i;if(e)for(const d in c)a.has(d)||f.add(d)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let p=i[u];if(typeof p=="function"&&(p=p(s,s.state,s.context)),p==null||typeof p=="function")continue;const y=typeof s[u]=="function"&&(P[u]||w&&w.has(u));o(u,p,y)}continue}if(lt(r,s)){const u=G(i,s,!0);Object.keys(u).length&&(c[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){vt()&&co(r,s);continue}let a=r;if(r.charCodeAt(0)===64&&!r.startsWith("@media")&&!r.startsWith("@keyframes")){const u=s.context?.designSystem?.media?.[r.slice(1)];u&&(a=`@media ${u}`)}const d=G(i,s,!1);Object.keys(d).length&&(c[a]=d);continue}const e=typeof s[r]=="function"&&(P[r]||w&&w.has(r));o(r,i,e)}if(n)for(const r in c)f.add(r);for(const r of f){const i=c[r];typeof i=="string"&&!i.includes("!important")&&(c[r]=i+" !important")}return c}function ro(t){const s=t.__ref;s.__conditionalRunners=[];const n=new Map;for(const c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;const f=c.charAt(0);if(f!=="."&&f!=="!")continue;const o=c.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const u=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${c}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${f}\` is read as one prop name. Nest the selector inside instead: \`${f}${u}: { '${o.slice(u.length)}': {...} }\`.`)}continue}const r=t[c];if(!r||typeof r!="object")continue;const i=f==="!",e={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{if(!t.node)return;let u;const p=t[o];if(p===void 0)if(t.state&&o in t.state)u=t.state[o];else{const l=t.context?.cases?.[o];if(l===void 0)return;try{u=typeof l=="function"?l.call(t,t):l}catch(h){u=!1,s.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}}else if(typeof p=="function")try{u=p(t,t.state,t.context)}catch(l){u=!1,s.__conditionalError=l,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${c}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,l?.message||l)}else u=p;const y=i?!u:!!u;if(y===e.lastMatch)return;e.lastMatch=y;const _=t.context?.designSystem;_&&O(_);try{if(y){const l={},h={};let g=!1;for(const b in r){if(!Object.prototype.hasOwnProperty.call(r,b))continue;const x=r[b],S=b.charAt(0);if((S===":"||S==="@"||S==="&")&&x&&typeof x=="object"&&!Array.isArray(x)){if(lt(b,t)){const $=G(x,t,!0);Object.keys($).length&&(h[`[data-theme="${b.slice(1)}"] &`]=$,g=!0)}else{let $=b;if(S==="@"&&!b.startsWith("@media")&&!b.startsWith("@keyframes")){const T=t.context?.designSystem?.media?.[b.slice(1)];T&&($=`@media ${T}`)}const W=G(x,t,!1);Object.keys(W).length&&(h[$]=W,g=!0)}continue}const N=typeof x=="function"?x(t,t.state,t.context):x;if(N!=null)if(P[b]){const $=P[b](N,t,t.state,t.context);if($){const W=Array.isArray($)?$:[$];for(const T of W)T&&Object.assign(l,T)}}else w&&w.has(b)&&(l[b]=N)}const C=Object.keys(l);if(C.length){Y(t.node,l);for(const b of C)n.set(b,c);e.appliedKeys=C}else e.appliedKeys=null;if(g){const b=et(h,null,t.context?.cssPrefix),x=b?b.split(" ").filter(Boolean):[];if(x.length&&t.node.classList){for(const S of x)t.node.classList.add(S);e.appliedClasses=x}else e.appliedClasses=null}else if(e.appliedClasses){for(const b of e.appliedClasses)t.node.classList.remove(b);e.appliedClasses=null}}else{if(e.appliedKeys){for(const l of e.appliedKeys)n.get(l)===c&&(t.node.style[l]="",n.delete(l));e.appliedKeys=null}if(e.appliedClasses){for(const l of e.appliedClasses)t.node.classList.remove(l);e.appliedClasses=null}}}finally{_&&L()}};s.__conditionalRunners.push(a);const d=k(a,{depth:s.path.length});s.__effects.push(d)}}const yt=new WeakSet;function io(t){const s=t.ownerDocument;!s||yt.has(s)||(yt.add(s),queueMicrotask(()=>{yt.delete(s);const n=s.body||s.documentElement;n&&n.offsetWidth}))}const ht=new WeakSet;let Tt=!1;function eo(t){const{node:s}=t;if(!s)return;if(Tt||(Tt=!0,et({display:"none"})),ht.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}ht.add(t);const n=t.context?.designSystem;n&&O(n);try{const c={};let f=!1;for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||U.has(o))continue;const r=o.charCodeAt(0);if(!(r>=65&&r<=90)&&!H(o)){if(P[o]){const i=t[o],e=P[o](i,t,t.state,t.context);if(e){if(Array.isArray(e))for(const a of e)a&&Object.assign(c,a);else Object.assign(c,e);f=!0}}else if(w&&w.has(o)){const i=t[o];i!=null&&typeof i!="object"&&(c[o]=i,f=!0)}else if(o.charCodeAt(0)===45){const i=t[o];i!=null&&typeof i!="object"&&(c[o]=i,f=!0)}else if(o.charAt(0)==="&"){const i=t[o];i&&typeof i=="object"&&(c[o]=i,f=!0)}else if(o.charAt(0)==="@"||o.charAt(0)===":"){const i=t[o];if(i&&typeof i=="object"){if(lt(o,t)){const e=G(i,t,!0);Object.keys(e).length&&(c[`[data-theme="${o.slice(1)}"] &`]=e,f=!0)}else{let e=o;if(o.charAt(0)==="@"&&!o.startsWith("@media")&&!o.startsWith("@keyframes")){const d=t.context?.designSystem?.media?.[o.slice(1)];d&&(e=`@media ${d}`)}const a=G(i,t,!1);Object.keys(a).length&&(c[e]=a,f=!0)}f=!0}}}}if(f){c.display&&String(c.display).includes("!important")&&(s.style.setProperty("display",String(c.display).replace(/\s*!important\s*$/,""),"important"),delete c.display);const o=et(c,null,t.context?.cssPrefix);if(o&&s.classList){const i=o.split(" ").filter(Boolean);let e=!1;for(const a of i)s.classList.add(a),e||(a.charCodeAt(0)===95&&a.charCodeAt(1)===99||a.charCodeAt(0)===95&&a.indexOf("_c",1)!==-1)&&(e=!0);e&&io(s)}const r=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(r!=null){const i=c.display;if(i&&i!==r)if(r==="none"){const e=[];for(const a of s.classList)a.startsWith("_d-")&&a!=="_d-none"&&e.push(a);for(const a of e)s.classList.remove(a);s.classList.add("_d-none")}else s.style.display=t.display}}}finally{n&&L(),ht.delete(t)}}function Rt(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const f in t.aria){const o=t.aria[f];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;const r="aria-"+f.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.setAttribute(r,o===!0?"":o)}const n=zt(t);for(const f in n){const o=n[f];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&s.setAttribute(f,o===!0?"":o)}const c=t.tag||"div";for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f)||typeof t[f]=="function"||U.has(f)||f==="on"||n[f]!==void 0)continue;const o=f.charCodeAt(0);if(!(o>=65&&o<=90)&&!H(f)&&!(P[f]||w&&w.has(f))&&ft(c,f)){let r=t[f];if(r==null||(typeof r=="string"&&r.includes("{{")&&(r=it(r,t,t.state,t.context),t[f]=r),r==null||typeof r=="function"||typeof r=="object")||r===!1&&!Gt(at(f)||f))continue;const i=at(f)||f;s.setAttribute(i,Yt(i,r))}}}function fo(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const n=t.autoGrow,c=n&&typeof n=="object"&&n.max?String(n.max):null;c&&(s.style.maxHeight=c);const f=()=>{s.style.height="auto",s.style.height=s.scrollHeight+"px"};f(),s.addEventListener("input",f),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("input",f)}catch{}})}const Nt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ft(t,s){for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n)||!H(n)||Nt.has(n))continue;let c=t[n];if(typeof c=="string"&&/^[A-Za-z_$][\w$]*$/.test(c)){const o=c;c=function(i){return t.call(o,i)}}if(typeof c!="function")continue;const f=Qt(n);Vt.has(f)||Wt(Xt(f),t,c)}ao(t)}function ao(t){const s=t.node;if(!s||!s.addEventListener)return;const n={};let c=!1;for(const p of Nt){const y=t[p];typeof y=="function"&&(n[p]=y,c=!0)}if(!c)return;const f=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,i=0,e=0,a=!1;const d=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,i=y.clientY,e=Date.now(),a=!0)},u=p=>{if(!a)return;a=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const _=y.clientX-r,l=y.clientY-i,h=Date.now()-e;if(h>o)return;const g=Math.abs(_),C=Math.abs(l);if(Math.max(g,C)<f)return;let b;if(g>C*1.2)b=_<0?"left":"right";else if(C>g*1.2)b=l<0?"up":"down";else return;const x="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),S=n[x],N=n.onSwipe;S&&S.call(t,p,t,t.state,t.context),N&&N.call(t,{direction:b,dx:_,dy:l,dt:h,event:p},t,t.state,t.context)};s.addEventListener("touchstart",d,{passive:!0}),s.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",d)}catch{}try{s.removeEventListener("touchend",u)}catch{}})}function tt(t,s){const n={...t};for(const c in s){const f=n[c],o=s[c];f&&o&&typeof f=="object"&&typeof o=="object"&&!Array.isArray(f)&&!Array.isArray(o)&&typeof f!="function"&&typeof o!="function"?n[c]=tt(f,o):n[c]=o}return n}function _t(t,s,n){if(!s||!t.node)return;const c=t.childExtends;if(Array.isArray(s)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,r=f?null:o?.createDocumentFragment();if(!f&&!r)return;const i=t.childProps,e=t.childrenAs;for(let a=0;a<s.length;a++){let d=s[a];const u=d;(typeof d=="string"||typeof d=="number")&&(d={text:d});let p=i;if(typeof i=="function")try{p=i(t,d)}catch{p=null}if(e==="state"){let l=u;(typeof u=="string"||typeof u=="number")&&(l={value:u,text:u}),d=p?{...p,state:l}:{state:l}}else p&&(d=tt(p,d));if(c&&!d.ignoreChildExtends)if(d.extends){const l=Array.isArray(d.extends)?d.extends:[d.extends],h=Array.isArray(c)?c:[c];d={...d,extends:[...h,...l]}}else d={...d,extends:c};const y=d?.key||u&&typeof u=="object"&&u.key||`${a}`;let _;try{_=z(d,t,y,n)}catch(l){if(typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${y}" failed to construct at ${h} (initial render, skipping this row):`,l?.message||l)}continue}!f&&_?.node&&r.appendChild(_.node)}f||t.node.appendChild(r);return}if(typeof s=="string"){const f=Et(s,t);if(Array.isArray(f)){_t(t,f,n);return}}if(typeof s=="object")for(const f in s){if(U.has(f))continue;let o=s[f];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=tt(t.childProps,o)),c&&!o.ignoreChildExtends)if(o.extends){const r=Array.isArray(o.extends)?o.extends:[o.extends],i=Array.isArray(c)?c:[c];o={...o,extends:[...i,...r]}}else o={...o,extends:c};z(o,t,f,n)}}}function gt(t,s){const n=t.node;if(!n||n.tagName!=="SELECT")return;const c=n.options;if(!c||!c.length)return;const f=t.__ref,o=f&&f.__exec&&f.__exec.value,r=typeof o=="function",i=t.value!=null&&typeof t.value!="function";if(r||i){let d;if(r)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const u=d==null?"":String(d);n.value!==u&&(n.value=u);return}const e=s||!(f&&f.__selectSynced);if(f&&(f.__selectSynced=!0),!e)return;let a=-1;for(let d=0;d<c.length;d++)c[d].defaultSelected&&(a=d);a>=0&&n.selectedIndex!==a&&(n.selectedIndex=a)}function Mt(t,s){let{children:n,content:c}=t;const f=t.childExtends;if(typeof n=="function"){const r=n;try{n=r(t,t.state,t.context)}catch(u){if(n=void 0,typeof console<"u"&&console.error){const p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,u?.message||u)}}t.children=n;const i=t.__ref;let e=!1;const a=E(t,t.childrenDeps,r),d=k(()=>{const u=e;e=!0;let p;try{p=a(t,t.state,t.context)}catch(x){if(typeof console<"u"&&console.error){const S=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${S}${u?"":" (initial tracking run)"}:`,x?.message||x)}return}if(!u||p===t.children)return;t.children=p;const y=typeof t.onContentUpdate=="function",_=y?[]:null,l=y?[]:null,h=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const x=t.childProps,S=[],N=new Map;for(let A=0;A<p.length;A++){const D=p[A];let v=x;if(typeof x=="function")try{v=x(t,D)}catch{v=null}const F=v&&v.key||D&&D.key||`${A}`;S.push(F),N.set(F,{rawChild:D,childProps:v})}const $=new Set(S),W=i.__children.slice();for(const A of W)if(!$.has(A)){const D=t[A];D?.remove&&D.remove(),delete t[A],l&&l.push(A)}const T=t.childExtends,J=t.tag==="fragment",Kt=t.context?.document||globalThis.document,Z=J?null:Kt?.createDocumentFragment(),ot=new Set;for(const A of S){const D=N.get(A),v=D.rawChild,F=t[A];if(F&&F.state){if(v&&typeof v=="object"){const j=F.state,B=j.$replace||j.replace,xt=j.$update||j.update;if(typeof B=="function")B.call(j,v);else if(typeof xt=="function"){for(const M in j)if(!(M==="__element"||M==="root"||M==="parent"||M==="update")&&!Object.prototype.hasOwnProperty.call(v,M))try{j[M]=void 0}catch{}xt.call(j,v)}else for(const M in v)j[M]=v[M]}h&&h.push(A);continue}let st=v;(typeof v=="string"||typeof v=="number")&&(st={value:v,text:v});const bt=D.childProps;let R=bt?{...bt,state:st}:{state:st};if(T&&!R.ignoreChildExtends)if(R.extends){const j=Array.isArray(R.extends)?R.extends:[R.extends],B=Array.isArray(T)?T:[T];R={...R,extends:[...B,...j]}}else R={...R,extends:T};let nt;try{nt=z(R,t,A,s)}catch(j){if(typeof console<"u"&&console.error){const B=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to construct at ${B} (reconcile, skipping this row):`,j?.message||j)}ot.add(A);continue}!J&&nt?.node&&Z&&Z.appendChild(nt.node),_&&_.push(A)}if(!J&&Z&&Z.childNodes.length&&t.node&&t.node.appendChild(Z),!J&&t.node){let A=null;for(const D of S){const v=t[D]?.node;if(!v)continue;const F=A?A.nextSibling:t.node.firstChild;v!==F&&t.node.insertBefore(v,F),A=v}}i.__children=ot.size?S.filter(A=>!ot.has(A)):S,y&&(_.length||l.length)&&wt(t,{added:_,removed:l,kept:h}),gt(t,!1);return}const b=y?[...i.__children]:null;for(const x of[...i.__children]){const S=t[x];S?.remove&&S.remove(),delete t[x]}i.__children=[],_t(t,p,s),gt(t,!1),y&&wt(t,{added:[...i.__children],removed:b,kept:[]})},{depth:i.path.length});i.__effects.push(d)}if(_t(t,n||c,s),n||c)return;const o=t.context?.components||{};{const r=Object.keys(t);for(let i=0;i<r.length;i++){const e=r[i];if(!e.endsWith("Extends")||typeof t[e]!="string")continue;const a=e.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const d={extends:t[e]};delete t[e];for(let u=i+1;u<r.length;u++){const p=r[u],y=p.charCodeAt(0);if(y>=65&&y<=90||U.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const _=t[p];_!==void 0&&(d[p]=_,delete t[p])}t[a]&&typeof t[a]=="object"?t[a]={...d,...t[a]}:t[a]=d}}for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||U.has(r)||typeof t[r]!="object"||t[r]===null)continue;const i=r.charCodeAt(0);if(i<65||i>90)continue;let e=t[r];if(!e.__ref){if(!e.extends&&!e.extend){const a=o[r]||o[`smbls.${r}`];a&&(e={...e,extends:a})}if(t.childProps&&(e=tt(t.childProps,e)),f&&!e.ignoreChildExtends)if(e.extends){const a=Array.isArray(e.extends)?e.extends:[e.extends],d=Array.isArray(f)?f:[f];e={...e,extends:[...d,...a]}}else e={...e,extends:f};z(e,t,r,s)}}}function It(t,s,n){const{node:c}=t;if(!c)return;c.ref=t;const f=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(f){const r=f.parentNode;if(r){if(n?.position==="before"&&n.node)r.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const i=n.node.nextSibling;r.insertBefore(c,i||f)}else r.insertBefore(c,f);return}}const o=s?.node||(s?.nodeType?s:null);if(o)if(n?.position==="before"&&n.node)o.insertBefore(c,n.node);else if(n?.position==="after"&&n.node){const r=n.node.nextSibling;r?o.insertBefore(c,r):o.appendChild(c)}else o.appendChild(c)}function I(t,s,n){const c=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&V(c,s,n);const f="on"+t,o=s[f];if(typeof o=="function"){const r=t==="Render"||t==="RenderRouter";if(r){if(s.__ref.__inRender)return!0;s.__ref.__inRender=!0}const i=s.context?.designSystem;i&&O(i);try{if(o(s,s.state,s.context,n)===!1)return!1}catch(e){if(s.context?.plugins?.length&&V("error",s,{hook:f,error:e})||console.error(`[DOMQL] Lifecycle "${f}" error:`,e),s.context?.strictMode)throw e}finally{i&&L(),r&&(s.__ref.__inRender=!1)}}return!0}var $o=z;export{z as create,$o as default,St as flushMounts};
@@ -1 +1 @@
1
- function o(n){const e=n&&"env"in n?n.env:typeof process<"u"&&process.env?"production":void 0;if(e&&e!=="production")return!0;const t=n&&"hostname"in n?n.hostname:typeof location<"u"?location.hostname:void 0;return typeof t=="string"&&t?t==="localhost"||t==="127.0.0.1"||t.endsWith(".localhost"):!1}export{o as isLoudDevRuntime};
1
+ import{isLoudDevRuntime as i}from"@symbo.ls/utils";export{i as isLoudDevRuntime};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.692",
3
+ "version": "3.14.702",
4
4
  "description": "Core element creation, update, and disposal engine for smbls v3.14",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@symbo.ls/signal": "^3.14.628",
25
25
  "@symbo.ls/state": "^3.14.678",
26
- "@symbo.ls/utils": "^3.14.599",
26
+ "@symbo.ls/utils": "^3.14.702",
27
27
  "css-in-props": "^3.14.612",
28
28
  "attrs-in-props": "^3.14.692"
29
29
  },