@symbo.ls/element 3.14.786 → 3.14.788

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.
@@ -1,6 +1,6 @@
1
- "use strict";var Ct=Object.defineProperty;var po=Object.getOwnPropertyDescriptor;var yo=Object.getOwnPropertyNames;var ho=Object.prototype.hasOwnProperty;var _o=(t,e)=>{for(var s in e)Ct(t,s,{get:e[s],enumerable:!0})},go=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of yo(e))!ho.call(t,n)&&n!==s&&Ct(t,n,{get:()=>e[n],enumerable:!(r=po(e,n))||r.enumerable});return t};var bo=t=>go(Ct({},"__esModule",{value:!0}),t);var Wo={};_o(Wo,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>gt,acquireBeforeUpdateGuard:()=>co,create:()=>W,default:()=>Ho,flushMounts:()=>_t,reconcileAttrProp:()=>Bo,releaseBeforeUpdateGuard:()=>ut,writeElementText:()=>at});module.exports=bo(Wo);var R=require("@symbo.ls/signal"),E=require("@symbo.ls/signal"),q=require("./cache.js"),U=require("./registry.js"),ot=require("./delegate.js"),eo=require("./extends.js"),no=require("./methods.js"),Zo=require("./dispose.js"),m=require("./devRuntime.js"),I=require("./mountScheduler.js"),H=require("@symbo.ls/utils"),K=require("@symbo.ls/utils/function.js"),tt=require("@symbo.ls/state"),A=require("css-in-props"),G=require("@symbo.ls/css"),k=require("@symbo.ls/scratch"),S=require("attrs-in-props"),ro=require("./engineRegistry.js"),io=require("./version.js");const Ft=(0,ro.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},io.VERSION),rt=[];let kt=!1;function It(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function xo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Ao=250;function Ut(){if(!kt){if(kt=!0,typeof requestAnimationFrame!="function"){setTimeout(_t,0);return}xo()?setTimeout(_t,Ao):requestAnimationFrame(_t)}}const Co=300,ko=15e4;function _t(){if(kt=!1,!rt.length)return;const t=rt.splice(0,rt.length);for(let e=0;e<t.length;e++){const s=t[e];if(s.node){if(!s.node.isConnected){const r=s.__ref||(s.__ref={});r.__mountAttempts=(r.__mountAttempts||0)+1,r.__mountFirstAttemptAt==null&&(r.__mountFirstAttemptAt=It());const n=It()-r.__mountFirstAttemptAt;r.__mountAttempts<=Co&&n<ko?(rt.push(s),Ut()):console.warn("[DOMQL] onMounted dropped after",r.__mountAttempts,"attempts /",n,"ms \u2014 node never connected:",s.key||s.tag||s);continue}N("Mounted",s,s.__ref?.__mountOptions||{})}}}function St(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,rt.push(t),Ut())}function Bt(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,K.runPluginHook)("contentUpdate",t,e);const s=t.context?.designSystem;s&&(0,k.pushConfig)(s);try{t.onContentUpdate(t,t.state,t.context,e)}catch(r){if(t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onContentUpdate",error:r})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',r),t.context?.strictMode)throw r}finally{s&&(0,k.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 So(t){return t.charAt(2).toLowerCase()+t.slice(3)}function vo(t){return t.toLowerCase()}function vt(t){const e=t.charCodeAt(0);return e===58||e===64||e===38||e===91}function it(t,e){const s={...t};for(const r in e){const n=s[r],o=e[r];n&&o&&typeof n=="object"&&typeof o=="object"&&!Array.isArray(n)&&!Array.isArray(o)&&typeof n!="function"&&typeof o!="function"?s[r]=it(n,o):s[r]=o}return s}function W(t,e,s,r={},n){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=s||t.key||`_${Ft.uniqId++}`,o.parent=e||null,o.context=t.context||e?.context||r.context||{},o.context.__create||(o.context.__create=W);const i=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:e?.__ref?.root||o,path:e?.__ref?.path?[...e.__ref.path,o.key]:[o.key],origin:t};if(s&&!t.extends&&!t.extend){const _=s.indexOf("_"),p=s.indexOf(".");let h=_>0?_:-1;if(p>0&&(h<0||p<h)&&(h=p),h>0){const b=s.substring(0,h),x=o.context?.components;x&&(x[b]||x["smbls."+b])?t={...t,extends:b}:x&&(0,m.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${b}" but neither "${b}" nor "smbls.${b}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,eo.applyExtends)(o,t,r);const a=new Set(["childProps","attr","style","scope","data"]),c=o.props&&typeof o.props=="object"?o.props:null;for(const _ in t){if(_==="parent"||_==="node"||_==="__ref"||_==="extends"||_==="context"||_==="props")continue;const p=t[_],h=o[_],b=h&&p&&typeof h=="object"&&typeof p=="object"&&!Array.isArray(h)&&!Array.isArray(p)&&typeof h!="function"&&typeof p!="function";b&&_.charCodeAt(0)>=65&&_.charCodeAt(0)<=90?o[_]=it(h,p):b&&a.has(_)?o[_]={...h,...p}:b&&vt(_)?o[_]=it(h,p):o[_]=p}function u(_){for(const p in _){const h=_[p],b=o[p],x=b&&h&&typeof b=="object"&&typeof h=="object"&&!Array.isArray(b)&&!Array.isArray(h)&&typeof b!="function"&&typeof h!="function";x&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?o[p]=it(b,h):x&&a.has(p)?o[p]={...b,...h}:x&&vt(p)?o[p]=it(b,h):o[p]=h}}c&&u(c),t.props&&typeof t.props=="object"&&u(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,f=e?.scope,l=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=f||l||null;if(t.scope!==void 0||d){const _={};d&&Object.assign(_,d),t.scope!==void 0&&Object.assign(_,t.scope),o.scope=(0,R.createScopeStore)(_,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),(0,no.addMethods)(o),wo(o,e,t),o.if!=null){let _;if(typeof o.if=="function")try{_=o.if(o,o.state,o.context)}catch(p){if(_=!1,i.__ifError=p,typeof console<"u"&&console.warn){const h=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${h} \u2014 treating as false:`,p?.message||p)}}else _=o.if;i.__if=!!_}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&Ht(o,i,o.if),o;o.tag||(o.tag=(0,q.detectTag)(o)),N("Init",o,r);const g=o.node=(0,q.cacheNode)(o);if(!g)return o;if(o.tag==="fragment"){const p=(o.context?.document||globalThis.document).createComment("");g.appendChild(p),i.__fragmentAnchor=p}N("AttachNode",o,r),g.setAttribute&&o.key&&g.setAttribute("data-key",o.key),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),g.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&g.setAttribute("data-smbls-app",o.context.key),o.id&&g.setAttribute&&(g.id=o.id),to(o,r),Vt(o),jt(o),Jt(o),Vo(o);try{oo(o,r)}catch(_){if(typeof console<"u"&&console.error){const p=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${p}:`,_?.message||_,_?.stack?`
2
- `+_.stack.split(`
1
+ "use strict";var St=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var Co=Object.getOwnPropertyNames;var vo=Object.prototype.hasOwnProperty;var So=(t,e)=>{for(var s in e)St(t,s,{get:e[s],enumerable:!0})},wo=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Co(e))!vo.call(t,r)&&r!==s&&St(t,r,{get:()=>e[r],enumerable:!(n=Ao(e,r))||n.enumerable});return t};var ko=t=>wo(St({},"__esModule",{value:!0}),t);var Jo={};So(Jo,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>xt,acquireBeforeUpdateGuard:()=>ho,create:()=>Y,default:()=>Xo,flushMounts:()=>bt,reconcileAttrProp:()=>Yo,releaseBeforeUpdateGuard:()=>dt,writeElementText:()=>ut});module.exports=ko(Jo);var R=require("@symbo.ls/signal"),j=require("@symbo.ls/signal"),Q=require("./cache.js"),U=require("./registry.js"),st=require("./delegate.js"),uo=require("./extends.js"),lo=require("./methods.js"),ss=require("./dispose.js"),q=require("./devRuntime.js"),B=require("./mountScheduler.js"),D=require("@symbo.ls/utils"),G=require("@symbo.ls/utils/function.js"),ot=require("@symbo.ls/state"),A=require("css-in-props"),W=require("@symbo.ls/css"),w=require("@symbo.ls/scratch"),S=require("attrs-in-props"),po=require("./engineRegistry.js"),yo=require("./version.js");const Ut=(0,po.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},yo.VERSION),it=[];let wt=!1;function Bt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function jo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Eo=250;function Kt(){if(!wt){if(wt=!0,typeof requestAnimationFrame!="function"){setTimeout(bt,0);return}jo()?setTimeout(bt,Eo):requestAnimationFrame(bt)}}const Po=300,To=15e4;function bt(){if(wt=!1,!it.length)return;const t=it.splice(0,it.length);for(let e=0;e<t.length;e++){const s=t[e];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=Bt());const r=Bt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Po&&r<To?(it.push(s),Kt()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}$("Mounted",s,s.__ref?.__mountOptions||{})}}}function kt(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,it.push(t),Kt())}function Vt(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,G.runPluginHook)("contentUpdate",t,e);const s=t.context?.designSystem;s&&(0,w.pushConfig)(s);try{t.onContentUpdate(t,t.state,t.context,e)}catch(n){if(t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&(0,w.popConfig)()}}function z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Lo(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Do(t){return t.toLowerCase()}function jt(t){const e=t.charCodeAt(0);return e===58||e===64||e===38||e===91}function ct(t,e){const s={...t};for(const n in e){const r=s[n],f=e[n];r&&f&&typeof r=="object"&&typeof f=="object"&&!Array.isArray(r)&&!Array.isArray(f)&&typeof r!="function"&&typeof f!="function"?s[n]=ct(r,f):s[n]=f}return s}function pt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Gt(t,e,s){return pt(t)||(e&&typeof e=="object"?pt(e.key):void 0)||String(s)}function Y(t,e,s,n={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=pt(s);const f=pt(t.key),o=Object.create(null);o.key=s||f||`_${Ut.uniqId++}`,o.parent=e||null,o.context=t.context||e?.context||n.context||{},o.context.__create||(o.context.__create=Y);const c=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:e?.__ref?.root||o,path:e?.__ref?.path?[...e.__ref.path,o.key]:[o.key],origin:t};if(s&&!t.extends&&!t.extend){const h=s.indexOf("_"),p=s.indexOf(".");let x=h>0?h:-1;if(p>0&&(x<0||p<x)&&(x=p),x>0){const b=s.substring(0,x),v=o.context?.components;v&&(v[b]||v["smbls."+b])?t={...t,extends:b}:v&&(0,q.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${b}" but neither "${b}" nor "smbls.${b}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,uo.applyExtends)(o,t,n);const u=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(const h in t){if(h==="parent"||h==="node"||h==="__ref"||h==="extends"||h==="context"||h==="props")continue;if(h==="key"){f&&(o.key=f);continue}const p=t[h],x=o[h],b=x&&p&&typeof x=="object"&&typeof p=="object"&&!Array.isArray(x)&&!Array.isArray(p)&&typeof x!="function"&&typeof p!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=ct(x,p):b&&u.has(h)?o[h]={...x,...p}:b&&jt(h)?o[h]=ct(x,p):o[h]=p}function d(h){for(const p in h){const x=h[p],b=o[p],v=b&&x&&typeof b=="object"&&typeof x=="object"&&!Array.isArray(b)&&!Array.isArray(x)&&typeof b!="function"&&typeof x!="function";v&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?o[p]=ct(b,x):v&&u.has(p)?o[p]={...b,...x}:v&&jt(p)?o[p]=ct(b,x):o[p]=x}}a&&d(a),t.props&&typeof t.props=="object"&&d(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 i=o.scope&&typeof o.scope=="object"?o.scope:null,l=e?.scope,y=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,_=l||y||null;if(t.scope!==void 0||i){const h={};i&&Object.assign(h,i),t.scope!==void 0&&Object.assign(h,t.scope),o.scope=(0,R.createScopeStore)(h,_)}else _&&(o.scope=_);if(t.if!==void 0&&(o.if=t.if),(0,lo.addMethods)(o),Oo(o,e,t),o.if!=null){let h;if(typeof o.if=="function")try{h=o.if(o,o.state,o.context)}catch(p){if(h=!1,c.__ifError=p,typeof console<"u"&&console.warn){const x=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${x} \u2014 treating as false:`,p?.message||p)}}else h=o.if;c.__if=!!h}if(c.__if)typeof o.if=="function"&&(c.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&Zt(o,c,o.if),o;o.tag||(o.tag=(0,Q.detectTag)(o)),$("Init",o,n);const g=o.node=(0,Q.cacheNode)(o);if(!g)return o;if(o.tag==="fragment"){const p=(o.context?.document||globalThis.document).createComment("");g.appendChild(p),c.__fragmentAnchor=p}$("AttachNode",o,n),g.setAttribute&&o.key&&g.setAttribute("data-key",o.key),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),g.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&g.setAttribute("data-smbls-app",o.context.key),o.id&&g.setAttribute&&(g.id=o.id),co(o,n),zt(o),Pt(o),ro(o),qo(o);try{fo(o,n)}catch(h){if(typeof console<"u"&&console.error){const p=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${p}:`,h?.message||h,h?.stack?`
2
+ `+h.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(ht(o,!0),so(o,e,n),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const _=o.context?.designSystem;_&&(0,k.pushConfig)(_);try{const p=o.html(o,o.state,o.context);p!=null&&typeof p!="function"&&(o.node.innerHTML=p)}catch{}finally{_&&(0,k.popConfig)()}}if(N("Create",o,r),N("Complete",o,r),N("Render",o,r),N("RenderRouter",o,r),St(o,r),typeof o.onFrame=="function"){const _=o.onFrame,p=o.context?.designSystem,h=()=>{if(o.node){if(o.node.isConnected){p&&(0,k.pushConfig)(p);try{_(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{p&&(0,k.popConfig)()}}requestAnimationFrame(h)}};requestAnimationFrame(h)}return o}function wo(t,e,s){const r=!e,n=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,o=r&&n&&t.context?.state,i=s.state!==void 0&&!o?s.state:t.state&&!(0,R.isStore)(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,(0,tt.applyStateMethods)(t,t.state);else if(t.context?.state){const a=t.context.state,c={...a},u=t.context?.polyglot;if(u?.translations){const d=t.context,f=a.lang||u.defaultLang||"en",l=new Set,y=(p,h)=>{l.has(p)||(0,H.isPolyglotWritableKey)(d,p,c)&&(c[p]=h,l.add(p),(0,H.markPolyglotSeeded)(d,p))},g=u.translations[f];if(g&&typeof g=="object")for(const p in g)y(p,g[p]);const _=new Set(u.languages||[]);for(const p in u.translations)_.has(p)||y(p,u.translations[p])}t.state=(0,R.isStore)(c)?c:(0,R.createStore)(c),t.state.__element=t,t.state.root=t.state,(0,tt.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,tt.applyStateMethods)(t,t.state);return}if(typeof i=="string"){if(t.state=Kt(i,e),t.state&&typeof t.state=="object"&&!(0,R.isStore)(t.state)){const a=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:a,enumerable:!1,configurable:!0,writable:!0})}(0,tt.applyStateMethods)(t,t.state);return}if(typeof i=="function"){const a=i(t,e?.state);t.state=(0,R.isStore)(a)?a:(0,R.createStore)(a||{})}else(0,R.isStore)(i)?t.state=i:t.state=(0,R.createStore)({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,(0,tt.applyStateMethods)(t,t.state)}function wt(t,e){if(!e)return t;const s=e.split("/");let r=t;for(const n of s){if(r==null)return{};r=r[n]}return r??{}}function Kt(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){const n=t.slice(3);return n?wt(e.state,n):e.state??{}}if(t.startsWith("~/")){const n=e.state?.root||e.state,o=t.slice(2);return o?wt(n,o):n??{}}if(e.state?.[t]!==void 0)return e.state[t];const s=wt(e.state,t);if(s!=null&&Object.keys(s).length>0)return s;const r=e.context?.polyglot;if(r?.translations){const n=e.state?.root?.lang||r.defaultLang||"en",o=r.translations[n];if(o?.[t]!==void 0)return o[t];if(r.translations[t]!==void 0)return r.translations[t]}return{}}const jo=new Set(["s","state","ctx","context"]);function Eo(t){try{const s=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(r=>r.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function Po(t){if(typeof t!="function"||t.length!==2)return!1;const e=Eo(t);if(e.length<2)return!1;const s=e[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!jo.has(s)}function To(t){const e=t.__ref,s=t.tag||"div",r=t.context?.designSystem,n=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const a=o[i];if(typeof t[a]!="function"||U.REGISTRY.has(a))continue;const c=a.charCodeAt(0);c>=65&&c<=90||Y(a)||A.CSS_PROPS_REGISTRY[a]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(a)||(0,S.checkAttributeByTagName)(s,a)||((0,m.isLoudDevRuntime)()&&Po(t[a])&&console.warn(`[smbls] custom prop "${a}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${a}', \u2026) instead of reading el.${a}(\u2026) directly (see RULES.md Rule 8).`),n.push({prop:a,fn:t[a]}))}for(let i=0;i<n.length;i++){const{prop:a,fn:c}=n[i];e.__exec[a]=c,Object.defineProperty(t,a,{get(){r&&(0,k.pushConfig)(r);try{return c(t,t.state,t.context)}catch{return}finally{r&&(0,k.popConfig)()}},set(u){delete e.__exec[a],Object.defineProperty(t,a,{value:u,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Do(t,e){if(!(!Array.isArray(e)||e.length===0))for(let s=0;s<e.length;s++){const r=e[s];try{typeof r=="function"?r(t,t.state,t.context):typeof r=="string"&&t.state?.[r]}catch{}}}function O(t,e,s){return!Array.isArray(e)||e.length===0?s:function(...r){return Do(t,e),s.apply(this,r)}}function ct(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function T(t,e){return()=>t.path.join(".")+"::"+e}function Vt(t,e){const s=t.__ref,r=!!(e&&e.skipIfEffect);if(To(t),typeof t.text=="function"){const o=t.text,i=O(t,t.textDeps,o),a=(0,E.createEffect)(()=>{if(!s.contentManaged)try{let c=i(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&typeof c!="object"&&(typeof c=="string"&&c.includes("{{")&&(c=H.replaceLiteralsWithObjectFields.call(t,c,t.state)),at(t,c))}catch{}},{depth:s.path.length,label:T(s,"text")});s.__effects.push(a),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,i=(0,E.createEffect)(()=>{if(s.contentManaged)return;const a=H.replaceLiteralsWithObjectFields.call(t,o,t.state);a!=null&&(t.text=a),t.node&&at(t,a??"")},{depth:s.path.length,label:T(s,"text")});s.__effects.push(i),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!U.REGISTRY.has(o)&&!Y(o)&&!s.__exec[o]){if(A.CSS_PROPS_REGISTRY[o]){const i=t[o],a=O(t,t[o+"Deps"],i),c=o;let u,d=null,f=null,l;const y=(0,E.createEffect)(()=>{const g=t.context?.designSystem;g&&(0,k.pushConfig)(g);try{const _=a(t,t.state,t.context);(0,A.pushStaticCssPass)();let p;try{p=A.CSS_PROPS_REGISTRY[c](_,t,t.state,t.context)}finally{(0,A.popStaticCssPass)()}if(Array.isArray(p)){const b={};for(const x of p)if(x)for(const v in x)b[v]=x[v];p=b}const h=c==="show"||c==="hide";if(p&&t.node&&Lo(p)){const b=lt(p);if(b===null||b!==l){l=b;const x=(0,G.css)(p,null,t.context?.cssPrefix),v=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(f)for(const C of f)t.node.classList.remove(C);if(v&&v.length)for(const C of v)t.node.classList.add(C);f=v}}u=void 0,d=null}else if(p&&t.node){if(f){for(const x of f)t.node.classList.remove(x);f=null,l=void 0}const b=lt(p);(b===null||b!==u||!yt(t.node,d))&&(u=b,X(t.node,p),d=pt(t.node,p))}else if(t.node&&h){u=void 0,d=null;const b=s.__explicitDisplay;t.node.style.display=typeof b=="string"?b:""}}finally{g&&(0,k.popConfig)()}},{depth:s.path.length,label:T(s,c)});s.__effects.push(y),s.__exec[o]=i}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const i=t[o],a=O(t,t[o+"Deps"],i),c=o;let u,d=null;const f=(0,E.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,k.pushConfig)(l);try{const y=a(t,t.state,t.context);if(t.node)if(y!=null){const g=c+":"+String(y);if(g!==u||!yt(t.node,d)){u=g;const _={[c]:y};X(t.node,_),d=pt(t.node,_)}}else u=void 0,d=null,t.node.style[c]=""}finally{l&&(0,k.popConfig)()}},{depth:s.path.length,label:T(s,c)});s.__effects.push(f),s.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=O(t,t.htmlDeps,o),a=(0,E.createEffect)(()=>{const c=t.context?.designSystem;c&&(0,k.pushConfig)(c);try{const u=i(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)}finally{c&&(0,k.popConfig)()}},{depth:s.path.length,label:T(s,"html")});s.__effects.push(a),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=O(t,t.valueDeps,o),a=(0,E.createEffect)(()=>{try{const c=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const u=c==null?"":String(c);if(t.node.value===u)return;const d=typeof document<"u"&&document.activeElement===t.node,f=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,l=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=u,d&&f!=null&&l!=null)try{t.node.setSelectionRange(f,l)}catch{}}catch{}},{depth:s.path.length,label:T(s,"value")});s.__effects.push(a),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,i=O(t,t.styleDeps,o);let a,c=null;const u=(0,E.createEffect)(()=>{const d=i(t,t.state,t.context),f=lt(d);(f===null||f!==a||!yt(t.node,c))&&(a=f,X(t.node,d),c=pt(t.node,d))},{depth:s.path.length,label:T(s,"style")});s.__effects.push(u),s.__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 a=O(t,ct(t.styleDeps,o),i);let c,u=null;const d=(0,E.createEffect)(()=>{try{const f=a(t,t.state,t.context);if(t.node){const l=o+":"+String(f);if(l!==c||!yt(t.node,u)){c=l;const y={[o]:f};X(t.node,y),u=pt(t.node,y)}}}catch{}},{depth:s.path.length,label:T(s,"style."+o)});s.__effects.push(d)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=O(t,ct(t.attrDeps,o),t.attr[o]),a=o,c=(0,E.createEffect)(()=>{try{const u=i(t,t.state,t.context);t.node?.setAttribute&&(u==null||u===!1&&!(0,S.isEnumeratedTrueFalseAttr)(a)?t.node.removeAttribute(a):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(a,(0,S.serializeAttrValue)(a,u)))}catch{}},{depth:s.path.length,label:T(s,"attr."+a)});c._attrName=a.toLowerCase(),s.__effects.push(c)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const i=O(t,ct(t.ariaDeps,o),t.aria[o]),a="aria-"+o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),c=(0,E.createEffect)(()=>{try{const u=i(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null?t.node.removeAttribute(a):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(a,(0,S.serializeAttrValue)(a,u))}catch{}},{depth:s.path.length,label:T(s,"aria."+o)});c._attrName=a,s.__effects.push(c)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const i=O(t,ct(t.dataDeps,o),t.data[o]),c="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),u=(0,E.createEffect)(()=>{try{const d=i(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(c):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(c,d===!0?"":d)}catch{}},{depth:s.path.length,label:T(s,"data."+o)});u._attrName=c,s.__effects.push(u)}const n=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(n)for(const o in n){if(typeof n[o]!="function")continue;const i=O(t,ct(t.classDeps,o),n[o]),a=(0,E.createEffect)(()=>{try{const c=i(t,t.state,t.context);if(!t.node?.classList)return;typeof c=="string"?t.node.classList.add(c):c?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:s.path.length,label:T(s,"class."+o)});s.__effects.push(a)}!r&&typeof t.if=="function"&&Ht(t,s,t.if);for(const o of Object.keys(t)){if(U.REGISTRY.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||Y(o))continue;const a=t[o];s.__exec[o]=a;const c=t.tag||"div";if((0,S.checkAttributeByTagName)(c,o)&&!A.CSS_PROPS_REGISTRY[o]&&!(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const u=(0,S.camelToAttr)(o)||o,d=O(t,t[o+"Deps"],a),f=(0,E.createEffect)(()=>{try{const l=d(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1&&!(0,S.isEnumeratedTrueFalseAttr)(u)?t.node.removeAttribute(u):typeof l!="function"&&typeof l!="object"&&(u==="src"&&"src"in t.node?t.node.src=l:t.node.setAttribute(u,(0,S.serializeAttrValue)(u,l))))}catch{}},{depth:s.path.length,label:T(s,o)});f._attrName=u.toLowerCase(),s.__effects.push(f)}}if(Mo(t),Fo(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let a=!1,c=[];const u=(0,E.createEffect)(()=>{const d=[];for(let g=0;g<i.length;g++){const _=i[g];try{d[g]=typeof _=="function"?_(t,t.state,t.context):t.state?.[_]}catch{d[g]=void 0}}if(!a){a=!0,c=d;return}let f=d.length!==c.length;for(let g=0;!f&&g<d.length;g++)d[g]!==c[g]&&(f=!0);const l=c;if(c=d,!f)return;const y=t.context?.designSystem;y&&(0,k.pushConfig)(y);try{o(t,t.state,t.context,{prev:l,next:d})}catch(g){if(t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{y&&(0,k.popConfig)()}},{depth:s.path.length,label:T(s,"onStateUpdate")});s.__effects.push(u)}$o(t)}function Gt(t){const e=t.parent,s=e?.node;if(!s||!t.node){so(t,t.parent);return}let r=null;const n=Object.keys(e),o=n.indexOf(t.key);for(let i=o+1;i<n.length;i++){const a=e[n[i]];if(a?.node?.parentNode===s){r=a.node;break}}r?s.insertBefore(t.node,r):s.appendChild(t.node)}function Ht(t,e,s){const r=O(t,t.ifDeps,s),n=(0,E.createEffect)(()=>{let o;try{o=r(t,t.state,t.context)}catch(a){if(o=!1,e.__ifError=a,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,a?.message||a)}return}const i=e.__if;if(e.__if=!!o,i&&!e.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(a){console.error("[smbls] onRemove error:",a)}}else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=(0,q.cacheNode)(t)),t.node&&(t.node.ref=t),Gt(t),jt(t),N("Render",t,{}),St(t,{});else{if(e.__ifInitialized=!0,t.tag||(t.tag=(0,q.detectTag)(t)),N("Init",t,{}),t.node||(t.node=(0,q.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"&&!e.__fragmentAnchor){const c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),e.__fragmentAnchor=c}N("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),to(t,{}),Vt(t,{skipIfEffect:!0}),jt(t),Jt(t),oo(t,{}),Gt(t),N("Create",t,{}),N("Complete",t,{}),N("Render",t,{}),N("RenderRouter",t,{}),St(t,{})}},{depth:e.path.length,label:T(e,"if")});e.__effects.push(n)}function at(t,e){const s=t.node;if(!s)return;const r=e==null||typeof e=="object"?"":String(e);if(t.tag==="string"){s.nodeValue!==r&&(s.nodeValue=r);return}const n=t.__ref;let o=n?n.__textNode:null;if(o&&o.parentNode!==s&&(o=null),!o){const i=s.firstChild;i&&i.nodeType===3&&(o=i)}o?o.nodeValue!==r&&(o.nodeValue=r):s.firstChild?(o=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(r),s.insertBefore(o,s.firstChild)):(s.textContent=r,o=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),n&&(n.__textNode=o||null)}function jt(t){const{node:e}=t;if(e){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&at(t,t.text),Uo(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){const s=String(t.value);e.value!==s&&(e.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const r in t.style)if(typeof t.style[r]=="function"){s={};for(const n in t.style)typeof t.style[n]!="function"&&(s[n]=t.style[n]);break}X(e,s)}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const r=t.attr[s];typeof r=="function"||typeof r=="object"||r!=null&&(r===!1&&!(0,S.isEnumeratedTrueFalseAttr)(s)||e.setAttribute&&e.setAttribute(s,(0,S.serializeAttrValue)(s,r)))}if(t.data&&typeof t.data=="object")for(const s in t.data){const r=t.data[s];typeof r=="function"||typeof r=="object"||r==null||r===!1||e.dataset&&(e.dataset[s]=r===!0?"":r)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(r=>r&&e.classList.add(r));else if(typeof s=="object")for(const r in s){const n=typeof s[r]=="function"?s[r](t,t.state,t.context):s[r];n&&e.classList.add(typeof n=="string"?n:r)}}}}function lt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Lo(t){if(!t||typeof t!="object")return!1;for(const e in t){const s=t[e];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function pt(t,e){if(!t||!t.style||!e)return null;const s=[];for(const r in e){if(e[r]==null||r.charAt(0)==="&")continue;const o=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.push(o,t.style.getPropertyValue(o),t.style.getPropertyPriority(o))}return s}function yt(t,e){if(!e||!t||!t.style)return!1;for(let s=0;s<e.length;s+=3)if(t.style.getPropertyValue(e[s])!==e[s+1]||t.style.getPropertyPriority(e[s])!==e[s+2])return!1;return!0}const Et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function X(t,e){if(!t||!e||!t.style)return;let s=null;for(const r in e){const n=e[r];if(n!=null){if(r.charAt(0)==="&"&&typeof n=="object"){s||(s={}),s[r]=n;continue}try{const o=String(n),i=Et(r)?r:r.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),a=o.trim(),c=/\s*!important\s*$/.test(a),u=a.replace(/\s*!important\s*$/,"");t.style.setProperty(i,u,c?"important":"")}catch{}}}s&&Oo(t,s)}function Oo(t,e){const s=`_ds${Ft.scopedStyleId++}`;t.classList.add(s);const r=t.ownerDocument;let n=r.querySelector("style[data-smbls-scoped]");n||(n=r.createElement("style"),n.setAttribute("data-smbls-scoped",""),r.head.appendChild(n));let o="";for(const i in e){const a="."+s,c=i.replace(/&/g,a).split(",").map(d=>{const f=d.trim();return f.includes(a)?f:a+f}).join(", "),u=e[i];if(typeof u=="object"){let d="",f="";for(const l in u){const y=u[l];if(typeof y=="object"){const g=l.includes("&")?c.split(", ").map(p=>l.replace(/&/g,p)).join(", "):c.split(", ").map(p=>`${p} ${l}`).join(", ");let _="";for(const p in y)_+=`${p.replace(/[A-Z]/g,h=>"-"+h.toLowerCase())}: ${y[p]};`;f+=(0,G.wrapHoverRule)(`${g} { ${_} }`,g)+`
5
- `}else d+=`${l.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y};`}d&&(o+=(0,G.wrapHoverRule)(`${c} { ${d} }`,c)+`
6
- `),f&&(o+=f)}}o&&(n.textContent+=o)}const Wt=new Set;function zt(t){if(!Array.isArray(t))return"";const e=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&e.push(t[s]);return e.sort(),e.join("|")}function Ro(t,e,s){const r=zt(s);queueMicrotask(()=>{if(!t.__ref)return;let n;try{n=e(t,t.state,t.context)}catch{return}if(zt(n)===r)return;const o=t.__ref.path?t.__ref.path.join("."):t.key||"?";Wt.has(o)||(Wt.add(o),console.warn(`[smbls] subscribeTo function at "${o}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(n)?n.join(", "):String(n)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Mo(t){const e=t.subscribeTo,s=typeof e=="function";let r=e;if(s)try{r=e(t,t.state,t.context)}catch{r=null}if(s&&(0,m.isLoudDevRuntime)()&&Ro(t,e,Array.isArray(r)?r:[]),!Array.isArray(r)||r.length===0)return;const n=t.__ref;for(let o=0;o<r.length;o++){const i=r[o];if(typeof i!="string"||i.length===0)continue;const a=i.split("."),c=a[0],u=a.slice(1),d={value:!1},f=(0,E.createEffect)(()=>{const l=t.state&&((0,R.isStore)(t.state)?t.state.root:null);if(!l||!(0,R.isStore)(l))return;let y=l;y=y[c];for(let _=0;_<u.length&&!(y==null||typeof y!="object");_++)if((0,R.isStore)(y))y=y[u[_]];else break;if(!d.value)return;let g=!1;if(typeof t.onBeforeUpdate=="function"){const _=t.context?.designSystem;_&&(0,k.pushConfig)(_);try{if(co(n)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>ut(n,!1),h=>{ut(n,!0),t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:h})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",h)}):(ut(n,!1),p===!1&&(g=!0))}}catch(p){ut(n,!0),t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}finally{_&&(0,k.popConfig)()}}if(!g&&t.node&&n.__effects)for(let _=0;_<n.__effects.length;_++){const p=n.__effects[_];p&&p!==f&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}if(!g&&typeof t.onUpdate=="function"){const _=t.context?.designSystem;_&&(0,k.pushConfig)(_);try{t.onUpdate(t,t.state,t.context)}catch(p){t.context?.plugins?.length&&(0,K.runPluginHook)("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}finally{_&&(0,k.popConfig)()}}},{depth:n.path.length,label:T(n,"subscribeTo("+i+")")});d.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function Pt(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}function Tt(t,e){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=e.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const Yt=new Set;function No(t,e){const s=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",r=s+"::"+t;Yt.has(r)||(Yt.add(r),console.warn(`[smbls/css] "${t}" at ${s} 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 J(t,e,s){const r={},n=new Set,o=(i,a,c)=>{const u=c?new Set(Object.keys(r)):null;if(A.CSS_PROPS_REGISTRY[i]){const d=A.CSS_PROPS_REGISTRY[i](a,e,e.state,e.context);if(d){const f=Array.isArray(d)?d:[d];for(const l of f)l&&Object.assign(r,l)}}else r[i]=a;if(c)for(const d in r)u.has(d)||n.add(d)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let a=t[i];if(typeof a=="function"&&(a=a(e,e.state,e.context)),a==null||typeof a=="function")continue;if(typeof a=="object"&&!Array.isArray(a)){if(i==="style"){for(const f in a){let l=a[f];if(typeof l=="function"&&(l=l(e,e.state,e.context)),l==null||typeof l=="function")continue;const y=typeof e[f]=="function"&&(A.CSS_PROPS_REGISTRY[f]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(f));o(f,l,y)}continue}if(Pt(i,e)){const f=J(a,e,!1);Object.keys(f).length&&(r[`[data-theme="${i.slice(1)}"] &`]=f);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){(0,m.isLoudDevRuntime)()&&No(i,e);continue}const u=Tt(i,e),d=J(a,e,!1);Object.keys(d).length&&(r[u]=d);continue}const c=typeof e[i]=="function"&&(A.CSS_PROPS_REGISTRY[i]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i));o(i,a,c)}if(s)for(const i in r)n.add(i);for(const i of n){const a=r[i];typeof a=="string"&&!a.includes("!important")&&(r[i]=a+" !important")}return r}function Dt(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&Dt(t[s],e+1))return!0}return!1}function qt(t,e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Pt(t,s)){const o=J(e,s,!1);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}const r=Tt(t,s),n=J(e,s,!1);return Object.keys(n).length?{cssProp:r,block:n}:null}function $o(t){const e=t.__ref;for(const s of Object.keys(t)){if(!vt(s))continue;const r=t[s];if(!r||typeof r!="object"||Array.isArray(r)||!Dt(r))continue;let n=null,o;const i=(0,E.createEffect)(()=>{if(!t.node)return;const a=t.context?.designSystem;a&&(0,k.pushConfig)(a);let c,u=!1;try{const d=qt(s,r,t),f=d?lt(d.block)+"::"+d.cssProp:null;if(f!==null&&f===o)u=!0;else if(o=f,d){const l=(0,G.css)({[d.cssProp]:d.block},null,t.context?.cssPrefix);c=l?l.split(" ").filter(Boolean):null}else c=null}finally{a&&(0,k.popConfig)()}if(!(u||!t.node.classList)){if(n)for(const d of n)t.node.classList.remove(d);if(c&&c.length)for(const d of c)t.node.classList.add(d);n=c}},{depth:e.path.length,label:T(e,"cssBlock("+s+")")});e.__effects.push(i)}}function Fo(t){const e=t.__ref;e.__conditionalRunners=[];const s=new Map;for(const r of Object.keys(t)){const n=r.charAt(0);if(n!=="."&&n!=="!")continue;const o=r.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const y=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${n}\` is read as one prop name. Nest the selector inside instead: \`${n}${y}: { '${o.slice(y.length)}': {...} }\`.`)}continue}const i=t[r];if(!i||typeof i!="object")continue;const a=n==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},u=()=>{let y;const g=t[o];if(g===void 0){const h=!!t.state&&o in t.state,b=t.state?t.state[o]:void 0;if(h||b!==void 0)y=b;else{const x=t.context?.cases?.[o];if(x===void 0)return;try{y=typeof x=="function"?x.call(t,t):x}catch(v){y=!1,e.__conditionalError=v,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,v?.message||v)}}}else if(typeof g=="function")try{y=g(t,t.state,t.context)}catch(h){y=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else y=g;const _=a?!y:!!y;if(!t.node||_===c.lastMatch)return;c.lastMatch=_;const p=t.context?.designSystem;p&&(0,k.pushConfig)(p);try{if(_){const h={},b={};let x=!1;for(const C in i){if(!Object.prototype.hasOwnProperty.call(i,C))continue;const P=i[C],z=C.charAt(0);if((z===":"||z==="@"||z==="&"||z==="[")&&P&&typeof P=="object"&&!Array.isArray(P)){if(Pt(C,t)){const D=J(P,t,!1);Object.keys(D).length&&(b[`[data-theme="${C.slice(1)}"] &`]=D,x=!0)}else{const D=Tt(C,t),L=J(P,t,!1);Object.keys(L).length&&(b[D]=L,x=!0)}continue}const Z=typeof P=="function"?P(t,t.state,t.context):P;if(Z!=null)if(A.CSS_PROPS_REGISTRY[C]){const D=A.CSS_PROPS_REGISTRY[C](Z,t,t.state,t.context);if(D){const L=Array.isArray(D)?D:[D];for(const st of L)st&&Object.assign(h,st)}}else(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(C)||Et(C))&&(h[C]=Z)}const v=Object.keys(h);if(v.length){X(t.node,h);for(const C of v)s.set(C,r);c.appliedKeys=v}else c.appliedKeys=null;if(x){const C=(0,G.css)(b,null,t.context?.cssPrefix),P=C?C.split(" ").filter(Boolean):[];if(P.length&&t.node.classList){for(const z of P)t.node.classList.add(z);c.appliedClasses=P}else c.appliedClasses=null}else if(c.appliedClasses){for(const C of c.appliedClasses)t.node.classList.remove(C);c.appliedClasses=null}}else{if(c.appliedKeys){for(const h of c.appliedKeys)s.get(h)===r&&(Et(h)?t.node.style.removeProperty(h):t.node.style[h]="",s.delete(h));c.appliedKeys=null}if(c.appliedClasses){for(const h of c.appliedClasses)t.node.classList.remove(h);c.appliedClasses=null}}}finally{p&&(0,k.popConfig)()}};e.__conditionalRunners.push(u);const d=O(t,t[o+"Deps"],u),f=(0,E.createEffect)(d,{depth:e.path.length,label:T(e,"conditional("+r+")")}),l=e.__exec&&e.__exec[o]||t[o];f._sources.size===0&&typeof l=="function"&&(0,m.isLoudDevRuntime)()&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${o}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),e.__effects.push(f)}}const Lt=new WeakSet;function Io(t){const e=t.ownerDocument;!e||Lt.has(e)||(Lt.add(e),queueMicrotask(()=>{Lt.delete(e);const s=e.body||e.documentElement;s&&s.offsetWidth}))}const Ot=new WeakSet;let Zt=!1;function Qt(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Rt(t,e){const s={...t};for(const r in e){const n=e[r],o=s[r];s[r]=n&&typeof n=="object"&&o&&typeof o=="object"?Rt(o,n):n}return s}function Xt(t,e){const s={};for(const r in t){const n=t[r];if(n&&typeof n=="object"){const o=Xt(n,e);Object.keys(o).length&&(s[r]=o)}else e.has(r)||(s[r]=n)}return s}function Uo(t){const{node:e}=t;if(!e)return;if(Zt||(Zt=!0,(0,G.css)({display:"none"})),Ot.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Ot.add(t);const s=t.context?.designSystem;s&&(0,k.pushConfig)(s),(0,A.pushStaticCssPass)();try{const r={};let n=!1,o=null,i=null,a=null;const c=(u,d)=>{if(d&&typeof d=="object"&&Qt(u)){i||(i={});const f=i[u];f&&(d=Rt(f,d)),i[u]=d}else(d===null||typeof d!="object")&&(a||(a=new Set),a.add(u));r[u]=d};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&A.CSS_PROPS_REGISTRY.theme){const u=A.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(u){const d=f=>{for(const l in f){const y=f[l];y&&typeof y=="object"&&Qt(l)&&(o||(o={}),o[l]=y),r[l]=y}};if(Array.isArray(u))for(const f of u)f&&d(f);else d(u);n=!0}}for(const u of Object.keys(t)){if(typeof t[u]=="function"||U.REGISTRY.has(u)||u==="theme")continue;const d=u.charCodeAt(0);if(!(d>=65&&d<=90)&&!Y(u)){if(A.CSS_PROPS_REGISTRY[u]){const f=t[u],l=A.CSS_PROPS_REGISTRY[u](f,t,t.state,t.context);if(l){if(Array.isArray(l)){for(const y of l)if(y)for(const g in y)c(g,y[g])}else for(const y in l)c(y,l[y]);n=!0}}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(u)){const f=t[u];f!=null&&typeof f!="object"&&(c(u,f),n=!0)}else if(u.charCodeAt(0)===45){const f=t[u];f!=null&&typeof f!="object"&&(c(u,f),n=!0)}else if(u.charAt(0)==="&"||u.charAt(0)==="@"||u.charAt(0)===":"||u.charAt(0)==="["){const f=t[u];if(f&&typeof f=="object"&&!Array.isArray(f)){if(Dt(f))continue;const l=qt(u,f,t);l&&(c(l.cssProp,l.block),n=!0)}}}}if(o)for(const u in o){let d=a?Xt(o[u],a):o[u];i&&i[u]&&(d=Rt(d,i[u])),Object.keys(d).length?r[u]=d:delete r[u]}if(n){r.display&&String(r.display).includes("!important")&&(e.style.setProperty("display",String(r.display).replace(/\s*!important\s*$/,""),"important"),delete r.display);const u=(0,G.css)(r,null,t.context?.cssPrefix);if(u&&e.classList){const f=u.split(" ").filter(Boolean);let l=!1;for(const y of f)e.classList.add(y),l||(y.charCodeAt(0)===95&&y.charCodeAt(1)===99||y.charCodeAt(0)===95&&y.indexOf("_c",1)!==-1)&&(l=!0);l&&Io(e)}const d=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(d!=null){const f=r.display;if(f&&f!==d)if(d==="none"){const l=[];for(const y of e.classList)y.startsWith("_d-")&&y!=="_d-none"&&l.push(y);for(const y of l)e.classList.remove(y);e.classList.add("_d-none")}else e.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(e.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}}finally{(0,A.popStaticCssPass)(),s&&(0,k.popConfig)(),Ot.delete(t)}}function Jt(t){const{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const o=t.aria[n];if(typeof o=="function"||typeof o=="object"||o==null)continue;const i="aria-"+n.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,(0,S.serializeAttrValue)(i,o))}const s=(0,S.applyAttrTransforms)(t);for(const n in s){const o=s[n];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&e.setAttribute(n,o===!0?"":o)}const r=t.tag||"div";for(const n of Object.keys(t)){if(typeof t[n]=="function"||U.REGISTRY.has(n)||n==="on"||s[n]!==void 0)continue;const o=n.charCodeAt(0);if(!(o>=65&&o<=90)&&!Y(n)&&!(A.CSS_PROPS_REGISTRY[n]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(n))&&(0,S.checkAttributeByTagName)(r,n)){let i=t[n];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=(0,H.replaceLiteralsWithObjectFields)(i,t,t.state,t.context),t[n]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!(0,S.isEnumeratedTrueFalseAttr)((0,S.camelToAttr)(n)||n))continue;const a=(0,S.camelToAttr)(n)||n;e.setAttribute(a,(0,S.serializeAttrValue)(a,i))}}}function Bo(t,e){const{node:s}=t;if(!s||!s.setAttribute)return;const r=e.charCodeAt(0);if(r>=65&&r<=90||Y(e)||A.CSS_PROPS_REGISTRY[e]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(e)||!(0,S.checkAttributeByTagName)(t.tag||"div",e))return;const n=(0,S.camelToAttr)(e)||e,o=n.toLowerCase(),i=t.__ref&&t.__ref.__effects;let a=!1;if(i)for(let d=0;d<i.length;d++){const f=i[d];f&&f._attrName===o&&!f._disposed&&typeof f._execute=="function"&&(a=!0,f._execute())}if(a)return;let c=t[e];const u=S.ATTR_TRANSFORMS[e];if(u&&c!=null){const d=u(t);d!==void 0&&(c=d)}typeof c=="string"&&c.includes("{{")&&(c=(0,H.replaceLiteralsWithObjectFields)(c,t,t.state,t.context)),c==null||c===!1&&!(0,S.isEnumeratedTrueFalseAttr)(n)?s.removeAttribute(n):typeof c!="function"&&typeof c!="object"&&s.setAttribute(n,(0,S.serializeAttrValue)(n,c))}function Ko(t,e){const s=t.node,r=t.__ref;let n=r.__autoGrow;if(!e){if(n&&n.active){try{s.removeEventListener("input",n.resize)}catch{}s.style.height="",n.appliedMax!=null&&s.style.maxHeight===n.appliedMax&&(s.style.maxHeight=""),n.active=!1,n.appliedMax=null,n.lastMeasure=0}return}n||(n=r.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(s.scrollHeight===0&&n.lastMeasure>0)return;s.style.height="auto";const i=s.scrollHeight;s.style.height=i+"px",i>0&&(n.lastMeasure=i)}},r.__eventCleanup||(r.__eventCleanup=[]),r.__eventCleanup.push(()=>{try{s.removeEventListener("input",n.resize)}catch{}})),n.active||(s.addEventListener("input",n.resize),n.active=!0);const o=typeof e=="object"&&e.max!=null?String(e.max):null;o!==n.appliedMax&&(o==null?n.appliedMax!=null&&s.style.maxHeight===n.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=o,n.appliedMax=o),n.resize()}function Vo(t){if(!t.autoGrow)return;const e=t.node;if(!e||e.tagName!=="TEXTAREA")return;const s=t.__ref,r=t.autoGrow,n=typeof r=="function"?O(t,t.autoGrowDeps,r):null,o=(0,E.createEffect)(()=>{const i=t.autoGrow;let a=i;if(typeof i=="function")try{a=(i===r&&n?n:i)(t,t.state,t.context)}catch{a=null}Ko(t,a)},{depth:s.path.length,label:T(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(o),n&&(s.__exec.autoGrow=r)}const mt=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function to(t,e){for(const s of Object.keys(t)){if(!Y(s)||mt.has(s))continue;const r=(0,ot.globalEventKeyInfo)(s);if(r){(0,ot.registerGlobalEvent)(r,t,t[s]);continue}let n=t[s];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){const i=n;n=function(c){return t.call(i,c)}}if(typeof n!="function")continue;const o=So(s);U.LIFECYCLE_EVENTS.has(o)||(0,ot.registerEvent)(vo(o),t,n)}Go(t)}function Go(t){const e=t.node;if(!e||!e.addEventListener)return;const s={};let r=!1;for(const l of mt){const y=t[l];typeof y=="function"&&(s[l]=y,r=!0)}if(!r)return;const n=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,a=0,c=0,u=!1;const d=l=>{const y=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];y&&(i=y.clientX,a=y.clientY,c=Date.now(),u=!0)},f=l=>{if(!u)return;u=!1;const y=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!y)return;const g=y.clientX-i,_=y.clientY-a,p=Date.now()-c;if(p>o)return;const h=Math.abs(g),b=Math.abs(_);if(Math.max(h,b)<n)return;let x;if(h>b*1.2)x=g<0?"left":"right";else if(b>h*1.2)x=_<0?"up":"down";else return;const v="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),C=s[v],P=s.onSwipe;C&&C.call(t,l,t,t.state,t.context),P&&P.call(t,{direction:x,dx:g,dy:_,dt:p,event:l},t,t.state,t.context)};e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",d)}catch{}try{e.removeEventListener("touchend",f)}catch{}})}function ft(t,e){const s={...t};for(const r in e){const n=s[r],o=e[r];n&&o&&typeof n=="object"&&typeof o=="object"&&!Array.isArray(n)&&!Array.isArray(o)&&typeof n!="function"&&typeof o!="function"?s[r]=ft(n,o):s[r]=o}return s}function Mt(t,e,s,r){if(!e||!t.node)return;const n=t.childExtends;if(Array.isArray(e)){const o=t.tag==="fragment",i=t.context?.document||globalThis.document,a=o?null:i?.createDocumentFragment();if(!o&&!a)return;const c=t.childProps,u=t.childrenAs,d=p=>{let h=e[p];const b=h;(typeof h=="string"||typeof h=="number")&&(h={text:h});let x=c;if(typeof c=="function")try{x=c(t,h)}catch{x=null}if(u==="state"){let C=b;(typeof b=="string"||typeof b=="number")&&(C={value:b,text:b}),h=x?{...x,state:C}:{state:C}}else x&&(h=ft(x,h));if(n&&!h.ignoreChildExtends)if(h.extends){const C=Array.isArray(h.extends)?h.extends:[h.extends],P=Array.isArray(n)?n:[n];h={...h,extends:[...P,...C]}}else h={...h,extends:n};const v=h?.key||b&&typeof b=="object"&&b.key||`${p}`;try{return W(h,t,v,s)}catch(C){if(typeof console<"u"&&console.error){const P=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to construct at ${P} (initial render, skipping this row):`,C?.message||C)}return null}},f=t.__ref;if(!(r===!0&&!o&&!!f&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let p=0;p<e.length;p++){const h=d(p);!o&&h?.node&&a.appendChild(h.node)}return o||t.node.appendChild(a),!0}const y=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;(0,I.openMountBudget)();let g=null;const _=p=>{if(f.__disposed||f.__childrenChunkGen!==y){g&&g.parentNode&&g.remove();return}for(let h=p;h<e.length;h++){const b=d(h);if(b?.node&&(g?t.node.insertBefore(b.node,g):a.appendChild(b.node)),h+1<e.length&&(0,I.mountBudgetExhausted)()){g||(g=i.createComment("smbls-mount"),a.appendChild(g),t.node.appendChild(a));const x=h+1;(0,I.enqueueMountWork)(()=>_(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&ht(t,!0)):t.node.appendChild(a)};return _(0),(0,I.closeMountBudget)(),!0}if(typeof e=="string"){const o=Kt(e,t);if(Array.isArray(o))return Mt(t,o,s,r)}if(typeof e=="object")for(const o in e){if(U.REGISTRY.has(o))continue;let i=e[o];if(!(i==null||i===!1)){if((typeof i=="string"||typeof i=="number")&&(i={text:i}),t.childProps&&(i=ft(t.childProps,i)),n&&!i.ignoreChildExtends)if(i.extends){const a=Array.isArray(i.extends)?i.extends:[i.extends],c=Array.isArray(n)?n:[n];i={...i,extends:[...c,...a]}}else i={...i,extends:n};W(i,t,o,s)}}}function ht(t,e){const s=t.node;if(!s||s.tagName!=="SELECT")return;const r=s.options;if(!r||!r.length)return;const n=t.__ref,o=n&&n.__exec&&n.__exec.value,i=typeof o=="function",a=t.value!=null&&typeof t.value!="function";if(i||a){let d;if(i)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const f=d==null?"":String(d);s.value!==f&&(s.value=f);return}const c=e||!(n&&n.__selectSynced);if(n&&(n.__selectSynced=!0),!c)return;let u=-1;for(let d=0;d<r.length;d++)r[d].defaultSelected&&(u=d);u>=0&&s.selectedIndex!==u&&(s.selectedIndex=u)}function oo(t,e){let{children:s,content:r}=t;const n=t.childExtends;if(typeof s=="function"){const f=s;try{s=f(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${h} (initial run, treating as empty):`,p?.message||p)}}t.children=s;const l=t.__ref;let y=!1;const g=O(t,t.childrenDeps,f),_=(0,E.createEffect)(()=>{const p=y;y=!0;let h;try{h=g(t,t.state,t.context)}catch(D){if(typeof console<"u"&&console.error){const L=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${L}${p?"":" (initial tracking run)"}:`,D?.message||D)}return}if(!p||h===t.children)return;t.children=h,l.__childrenChunkGen!=null&&l.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",x=b?[]:null,v=b?[]:null,C=b?[]:null;if(Array.isArray(h)&&t.childrenAs==="state"){const D=t.childProps,L=[],st=new Map;for(let w=0;w<h.length;w++){const $=h[w];let j=D;if(typeof D=="function")try{j=D(t,$)}catch{j=null}const V=j&&j.key||$&&$.key||`${w}`;L.push(V),st.set(V,{rawChild:$,childProps:j})}const fo=new Set(L),ao=l.__children.slice();for(const w of ao)if(!fo.has(w)){const $=t[w];$?.remove&&$.remove(),delete t[w],v&&v.push(w)}const et=t.childExtends,dt=t.tag==="fragment",uo=t.context?.document||globalThis.document,nt=dt?null:uo?.createDocumentFragment(),bt=new Set;for(const w of L){const $=st.get(w),j=$.rawChild,V=t[w];if(V&&V.state){if(j&&typeof j=="object"){const M=V.state,Q=M.$replace||M.replace,$t=M.$update||M.update;try{if(typeof Q=="function")Q.call(M,j);else if(typeof $t=="function"){for(const F in M)if(!(F==="__element"||F==="root"||F==="parent"||F==="update")&&!Object.prototype.hasOwnProperty.call(j,F))try{M[F]=void 0}catch{}$t.call(M,j)}else for(const F in j)M[F]=j[F]}catch(F){if(typeof console<"u"&&console.error){const lo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${w}" failed to patch at ${lo} (reconcile, keeping its previous data for this pass):`,F?.message||F)}}}C&&C.push(w);continue}let xt=j;(typeof j=="string"||typeof j=="number")&&(xt={value:j,text:j});const Nt=$.childProps;let B=Nt?{...Nt,state:xt}:{state:xt};if(et&&!B.ignoreChildExtends)if(B.extends){const M=Array.isArray(B.extends)?B.extends:[B.extends],Q=Array.isArray(et)?et:[et];B={...B,extends:[...Q,...M]}}else B={...B,extends:et};let At;try{At=W(B,t,w,e)}catch(M){if(typeof console<"u"&&console.error){const Q=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${w}" failed to construct at ${Q} (reconcile, skipping this row):`,M?.message||M)}bt.add(w);continue}!dt&&At?.node&&nt&&nt.appendChild(At.node),x&&x.push(w)}if(!dt&&nt&&nt.childNodes.length&&t.node&&t.node.appendChild(nt),!dt&&t.node){let w=null;for(const $ of L){const j=t[$]?.node;if(!j)continue;const V=w?w.nextSibling:t.node.firstChild;j!==V&&t.node.insertBefore(j,V),w=j}}l.__children=bt.size?L.filter(w=>!bt.has(w)):L,b&&(x.length||v.length)&&Bt(t,{added:x,removed:v,kept:C}),ht(t,!1);return}const Z=b?[...l.__children]:null;for(const D of[...l.__children]){const L=t[D];L?.remove&&L.remove(),delete t[D]}l.__children=[],Mt(t,h,e),ht(t,!1),b&&Bt(t,{added:[...l.__children],removed:Z,kept:[]})},{depth:l.path.length,label:T(l,"children")});l.__effects.push(_)}const o=Mt(t,s,e,!0);if(r!=null&&!(r&&r.__ref)){let f=r;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=ft(t.childProps,f)),n&&!f.ignoreChildExtends)if(f.extends){const l=Array.isArray(f.extends)?f.extends:[f.extends],y=Array.isArray(n)?n:[n];f={...f,extends:[...y,...l]}}else f={...f,extends:n};W(f,t,"content",e)}if(s&&!o)return;const i=t.context?.components||{};{const f=Object.keys(t);for(let l=0;l<f.length;l++){const y=f[l];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const g=y.slice(0,-7);if(!g||g.charCodeAt(0)<65||g.charCodeAt(0)>90)continue;const _={extends:t[y]};delete t[y];for(let p=l+1;p<f.length;p++){const h=f[p],b=h.charCodeAt(0);if(b>=65&&b<=90||U.REGISTRY.has(h)||typeof t[h]=="function"&&(h.startsWith("on")||h.startsWith(".")))break;const x=t[h];x!==void 0&&(_[h]=x,delete t[h])}t[g]&&typeof t[g]=="object"?t[g]={..._,...t[g]}:t[g]=_}}const a=e?.mountYield===!0||t.yieldChildren===!0,c=Object.keys(t),u=f=>{if(U.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return;const l=f.charCodeAt(0);if(l<65||l>90)return;let y=t[f];if(!y.__ref){if(!y.extends&&!y.extend){const g=i[f]||i[`smbls.${f}`];g&&(y={...y,extends:g})}if(t.childProps&&(y=ft(t.childProps,y)),n&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],_=Array.isArray(n)?n:[n];y={...y,extends:[..._,...g]}}else y={...y,extends:n};W(y,t,f,e)}};if(!a){for(const f of c)u(f);return}(0,I.openMountBudget)();const d=f=>{for(let l=f;l<c.length;l++)if(u(c[l]),l+1<c.length&&(0,I.mountBudgetExhausted)()){const y=l+1;(0,I.enqueueMountWork)(()=>d(y));return}};d(0),(0,I.closeMountBudget)()}function so(t,e,s){const{node:r}=t;if(!r)return;r.ref=t;const n=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(n){const i=n.parentNode;if(i){if(s?.position==="before"&&s.node)i.insertBefore(r,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;i.insertBefore(r,a||n)}else i.insertBefore(r,n);return}}const o=e?.node||(e?.nodeType?e:null);if(o)if(s?.position==="before"&&s.node)o.insertBefore(r,s.node);else if(s?.position==="after"&&s.node){const i=s.node.nextSibling;i?o.insertBefore(r,i):o.appendChild(r)}else o.appendChild(r)}const gt=3;function co(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=gt?!1:(t.__inBeforeUpdate=!0,!0)}function ut(t,e){t&&(t.__inBeforeUpdate=!1,e?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===gt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${gt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function N(t,e,s){const r=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&(0,K.runPluginHook)(r,e,s);const n="on"+t,o=e[n];if(typeof o=="function"){const c=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(c){if(e.__ref[c])return!0;e.__ref[c]=!0}const u=e.context?.designSystem;u&&(0,k.pushConfig)(u);let d=!!c;try{const f=o(e,e.state,e.context,s);if(f&&typeof f.then=="function"){const l=e.__ref;return f.catch(y=>{e.context?.plugins?.length&&(0,K.runPluginHook)("error",e,{hook:n,error:y})||console.error(`[DOMQL] Lifecycle "${n}" error:`,y)}).finally(()=>{c&&l&&(l[c]=!1)}),d=!1,!0}if(f===!1)return!1}catch(f){if(e.context?.plugins?.length&&(0,K.runPluginHook)("error",e,{hook:n,error:f})||console.error(`[DOMQL] Lifecycle "${n}" error:`,f),e.context?.strictMode)throw f}finally{u&&(0,k.popConfig)(),d&&e.__ref&&(e.__ref[c]=!1)}}return!0}var Ho=W;
4
+ `):"")}}if(gt(o,!0),ao(o,e,r),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const h=o.context?.designSystem;h&&(0,w.pushConfig)(h);try{const p=o.html(o,o.state,o.context);p!=null&&typeof p!="function"&&(o.node.innerHTML=p)}catch{}finally{h&&(0,w.popConfig)()}}if($("Create",o,n),$("Complete",o,n),$("Render",o,n),$("RenderRouter",o,n),kt(o,n),typeof o.onFrame=="function"){const h=o.onFrame,p=o.context?.designSystem,x=()=>{if(o.node){if(o.node.isConnected){p&&(0,w.pushConfig)(p);try{h(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{p&&(0,w.popConfig)()}}requestAnimationFrame(x)}};requestAnimationFrame(x)}return o}function Oo(t,e,s){const n=!e,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,f=n&&r&&t.context?.state,o=s.state!==void 0&&!f?s.state:t.state&&!(0,R.isStore)(t.state)?t.state:void 0;if(o==null){if(e?.state)t.state=e.state,(0,ot.applyStateMethods)(t,t.state);else if(t.context?.state){const c=t.context.state,u={...c},a=t.context?.polyglot;if(a?.translations){const d=t.context,i=c.lang||a.defaultLang||"en",l=new Set,y=(h,p)=>{l.has(h)||(0,D.isPolyglotWritableKey)(d,h,u)&&(u[h]=p,l.add(h),(0,D.markPolyglotSeeded)(d,h))},_=a.translations[i];if(_&&typeof _=="object")for(const h in _)y(h,_[h]);const g=new Set(a.languages||[]);for(const h in a.translations)g.has(h)||y(h,a.translations[h])}t.state=(0,R.isStore)(u)?u:(0,R.createStore)(u),t.state.__element=t,t.state.root=t.state,(0,ot.applyStateMethods)(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,ot.applyStateMethods)(t,t.state);return}if(typeof o=="string"){if(t.state=Ht(o,e),t.state&&typeof t.state=="object"&&!(0,R.isStore)(t.state)){const c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}(0,ot.applyStateMethods)(t,t.state);return}if(typeof o=="function"){const c=o(t,e?.state);t.state=(0,R.isStore)(c)?c:(0,R.createStore)(c||{})}else(0,R.isStore)(o)?t.state=o:t.state=(0,R.createStore)({...o});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,(0,ot.applyStateMethods)(t,t.state)}function Et(t,e){if(!e)return t;const s=e.split("/");let n=t;for(const r of s){if(n==null)return{};n=n[r]}return n??{}}function Ht(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?Et(e.state,r):e.state??{}}if(t.startsWith("~/")){const r=e.state?.root||e.state,f=t.slice(2);return f?Et(r,f):r??{}}if(e.state?.[t]!==void 0)return e.state[t];const s=Et(e.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=e.context?.polyglot;if(n?.translations){const r=e.state?.root?.lang||n.defaultLang||"en",f=n.translations[r];if(f?.[t]!==void 0)return f[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const No=new Set(["s","state","ctx","context"]);function Ro(t){try{const s=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function Mo(t){if(typeof t!="function"||t.length!==2)return!1;const e=Ro(t);if(e.length<2)return!1;const s=e[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!No.has(s)}function $o(t){const e=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],f=Object.keys(t);for(let o=0;o<f.length;o++){const c=f[o];if(typeof t[c]!="function"||U.REGISTRY.has(c))continue;const u=c.charCodeAt(0);u>=65&&u<=90||z(c)||A.CSS_PROPS_REGISTRY[c]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(c)||(0,S.checkAttributeByTagName)(s,c)||((0,q.isLoudDevRuntime)()&&Mo(t[c])&&console.warn(`[smbls] custom prop "${c}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${c}', \u2026) instead of reading el.${c}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:c,fn:t[c]}))}for(let o=0;o<r.length;o++){const{prop:c,fn:u}=r[o];e.__exec[c]=u,Object.defineProperty(t,c,{get(){n&&(0,w.pushConfig)(n);try{return u(t,t.state,t.context)}catch{return}finally{n&&(0,w.popConfig)()}},set(a){delete e.__exec[c],Object.defineProperty(t,c,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Fo(t,e){if(!(!Array.isArray(e)||e.length===0))for(let s=0;s<e.length;s++){const n=e[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function N(t,e,s){return!Array.isArray(e)||e.length===0?s:function(...n){return Fo(t,e),s.apply(this,n)}}function ft(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function k(t,e){return()=>t.path.join(".")+"::"+e}const Wt=new Set;function F(t,e,s){if(!(0,q.isLoudDevRuntime)())return;const n=k(t,e)();Wt.has(n)||(Wt.add(n),console.warn(`[smbls] "${e}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}function zt(t,e){const s=t.__ref,n=!!(e&&e.skipIfEffect);if($o(t),typeof t.text=="function"){const o=t.text,c=N(t,t.textDeps,o),u=(0,j.createEffect)(()=>{if(!s.contentManaged)try{let a=c(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=D.replaceLiteralsWithObjectFields.call(t,a,t.state)),ut(t,a))}catch(a){F(s,"text",a)}},{depth:s.path.length,label:k(s,"text")});s.__effects.push(u),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,c=(0,j.createEffect)(()=>{if(s.contentManaged)return;const u=D.replaceLiteralsWithObjectFields.call(t,o,t.state);u!=null&&(t.text=u),t.node&&ut(t,u??"")},{depth:s.path.length,label:k(s,"text")});s.__effects.push(c),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!U.REGISTRY.has(o)&&!z(o)&&!s.__exec[o]){if(A.CSS_PROPS_REGISTRY[o]){const c=t[o],u=N(t,t[o+"Deps"],c),a=o;let d,i=null,l=null,y;const _=(0,j.createEffect)(()=>{const g=t.context?.designSystem;g&&(0,w.pushConfig)(g);try{const h=u(t,t.state,t.context);(0,A.pushStaticCssPass)();let p;try{p=A.CSS_PROPS_REGISTRY[a](h,t,t.state,t.context)}finally{(0,A.popStaticCssPass)()}if(Array.isArray(p)){const b={};for(const v of p)if(v)for(const C in v)b[C]=v[C];p=b}const x=a==="show"||a==="hide";if(p&&t.node&&Io(p)){const b=yt(p);if(b===null||b!==y){y=b;const v=(0,W.css)(p,null,t.context?.cssPrefix),C=v?v.split(" ").filter(Boolean):null;if(t.node.classList){if(l)for(const E of l)t.node.classList.remove(E);if(C&&C.length)for(const E of C)t.node.classList.add(E);l=C}}d=void 0,i=null}else if(p&&t.node){if(l){for(const v of l)t.node.classList.remove(v);l=null,y=void 0}const b=yt(p);(b===null||b!==d||!_t(t.node,i))&&(d=b,m(t.node,p),i=ht(t.node,p))}else if(t.node&&x){d=void 0,i=null;const b=s.__explicitDisplay;t.node.style.display=typeof b=="string"?b:""}}finally{g&&(0,w.popConfig)()}},{depth:s.path.length,label:k(s,a)});s.__effects.push(_),s.__exec[o]=c}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)){const c=t[o],u=N(t,t[o+"Deps"],c),a=o;let d,i=null;const l=(0,j.createEffect)(()=>{const y=t.context?.designSystem;y&&(0,w.pushConfig)(y);try{const _=u(t,t.state,t.context);if(t.node)if(_!=null){const g=a+":"+String(_);if(g!==d||!_t(t.node,i)){d=g;const h={[a]:_};m(t.node,h),i=ht(t.node,h)}}else d=void 0,i=null,t.node.style[a]=""}finally{y&&(0,w.popConfig)()}},{depth:s.path.length,label:k(s,a)});s.__effects.push(l),s.__exec[o]=c}}if(typeof t.html=="function"){const o=t.html,c=N(t,t.htmlDeps,o),u=(0,j.createEffect)(()=>{const a=t.context?.designSystem;a&&(0,w.pushConfig)(a);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{a&&(0,w.popConfig)()}},{depth:s.path.length,label:k(s,"html")});s.__effects.push(u),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,c=N(t,t.valueDeps,o),u=(0,j.createEffect)(()=>{try{let a=c(t,t.state,t.context);typeof a=="string"&&a.includes("{{")&&(a=D.replaceLiteralsWithObjectFields.call(t,a,t.state)),qt(t,a)}catch(a){F(s,"value",a)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(u),s.__exec.value=o}else if(typeof t.value=="string"&&t.value.includes("{{")){const o=t.value,c=(0,j.createEffect)(()=>{try{qt(t,D.replaceLiteralsWithObjectFields.call(t,o,t.state))}catch(u){F(s,"value",u)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(c),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,c=N(t,t.styleDeps,o);let u,a=null;const d=(0,j.createEffect)(()=>{const i=c(t,t.state,t.context),l=yt(i);(l===null||l!==u||!_t(t.node,a))&&(u=l,m(t.node,i),a=ht(t.node,i))},{depth:s.path.length,label:k(s,"style")});s.__effects.push(d),s.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const c=t.style[o];if(typeof c!="function")continue;const u=N(t,ft(t.styleDeps,o),c);let a,d=null;const i=(0,j.createEffect)(()=>{try{const l=u(t,t.state,t.context);if(t.node){const y=o+":"+String(l);if(y!==a||!_t(t.node,d)){a=y;const _={[o]:l};m(t.node,_),d=ht(t.node,_)}}}catch(l){F(s,"style."+o,l)}},{depth:s.path.length,label:k(s,"style."+o)});s.__effects.push(i)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const c=N(t,ft(t.attrDeps,o),t.attr[o]),u=o,a=(0,j.createEffect)(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=D.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!(0,S.isEnumeratedTrueFalseAttr)(u)?t.node.removeAttribute(u):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(u,(0,S.serializeAttrValue)(u,d)))}catch(d){F(s,"attr."+u,d)}},{depth:s.path.length,label:k(s,"attr."+u)});a._attrName=u.toLowerCase(),s.__effects.push(a)}else if(typeof t.attr[o]=="string"&&t.attr[o].includes("{{")){const c=t.attr[o],u=o,a=(0,j.createEffect)(()=>{try{const d=D.replaceLiteralsWithObjectFields.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,S.serializeAttrValue)(u,d??""))}catch(d){F(s,"attr."+u,d)}},{depth:s.path.length,label:k(s,"attr."+u)});a._attrName=u.toLowerCase(),s.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){const c=t.aria[o];if(typeof c=="string"&&c.includes("{{")){const i=c,l="aria-"+o.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),y=(0,j.createEffect)(()=>{try{const _=D.replaceLiteralsWithObjectFields.call(t,i,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,(0,S.serializeAttrValue)(l,_??""))}catch(_){F(s,"aria."+o,_)}},{depth:s.path.length,label:k(s,"aria."+o)});y._attrName=l,s.__effects.push(y);continue}if(typeof c!="function")continue;const u=N(t,ft(t.ariaDeps,o),t.aria[o]),a="aria-"+o.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),d=(0,j.createEffect)(()=>{try{const i=u(t,t.state,t.context);if(!t.node?.setAttribute)return;i==null?t.node.removeAttribute(a):typeof i!="function"&&typeof i!="object"&&t.node.setAttribute(a,(0,S.serializeAttrValue)(a,i))}catch(i){F(s,"aria."+o,i)}},{depth:s.path.length,label:k(s,"aria."+o)});d._attrName=a,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const o in t.data){const c=t.data[o];if(typeof c=="string"&&c.includes("{{")){const l=c,y="data-"+o.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),_=(0,j.createEffect)(()=>{try{const g=D.replaceLiteralsWithObjectFields.call(t,l,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,g??"")}catch(g){F(s,"data."+o,g)}},{depth:s.path.length,label:k(s,"data."+o)});_._attrName=y,s.__effects.push(_);continue}if(typeof c!="function")continue;const u=N(t,ft(t.dataDeps,o),t.data[o]),d="data-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),i=(0,j.createEffect)(()=>{try{const l=u(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(d):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(d,l===!0?"":l)}catch(l){F(s,"data."+o,l)}},{depth:s.path.length,label:k(s,"data."+o)});i._attrName=d,s.__effects.push(i)}const r=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(r)for(const o in r){if(typeof r[o]!="function")continue;const c=N(t,ft(t.classDeps,o),r[o]),u=(0,j.createEffect)(()=>{try{const a=c(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch(a){F(s,"class."+o,a)}},{depth:s.path.length,label:k(s,"class."+o)});s.__effects.push(u)}!n&&typeof t.if=="function"&&Zt(t,s,t.if);for(const o of Object.keys(t)){if(U.REGISTRY.has(o)||typeof t[o]!="function")continue;const c=o.charCodeAt(0);if(c>=65&&c<=90||z(o))continue;const u=t[o];s.__exec[o]=u;const a=t.tag||"div";if((0,S.checkAttributeByTagName)(a,o)&&!A.CSS_PROPS_REGISTRY[o]&&!(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o))){const d=(0,S.camelToAttr)(o)||o,i=N(t,t[o+"Deps"],u),l=(0,j.createEffect)(()=>{try{let y=i(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=D.replaceLiteralsWithObjectFields.call(t,y,t.state)),t.node?.setAttribute&&(y==null||y===!1&&!(0,S.isEnumeratedTrueFalseAttr)(d)?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&(d==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(d,(0,S.serializeAttrValue)(d,y))))}catch(y){F(s,o,y)}},{depth:s.path.length,label:k(s,o)});l._attrName=d.toLowerCase(),s.__effects.push(l)}}const f=t.tag||"div";for(const o of Object.keys(t)){if(U.REGISTRY.has(o))continue;const c=t[o];if(typeof c!="string"||!c.includes("{{"))continue;const u=o.charCodeAt(0);if(u>=65&&u<=90||z(o)||A.CSS_PROPS_REGISTRY[o]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o)||S.ATTR_TRANSFORMS[o]||!(0,S.checkAttributeByTagName)(f,o))continue;const a=(0,S.camelToAttr)(o)||o,d=(0,j.createEffect)(()=>{try{const i=D.replaceLiteralsWithObjectFields.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,(0,S.serializeAttrValue)(a,i??""))}catch(i){F(s,o,i)}},{depth:s.path.length,label:k(s,o)});d._attrName=a.toLowerCase(),s.__effects.push(d)}if(Ko(t),Ho(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,c=t.stateDeps;let u=!1,a=[];const d=(0,j.createEffect)(()=>{const i=[];for(let g=0;g<c.length;g++){const h=c[g];try{i[g]=typeof h=="function"?h(t,t.state,t.context):t.state?.[h]}catch{i[g]=void 0}}if(!u){u=!0,a=i;return}let l=i.length!==a.length;for(let g=0;!l&&g<i.length;g++)i[g]!==a[g]&&(l=!0);const y=a;if(a=i,!l)return;const _=t.context?.designSystem;_&&(0,w.pushConfig)(_);try{o(t,t.state,t.context,{prev:y,next:i})}catch(g){if(t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{_&&(0,w.popConfig)()}},{depth:s.path.length,label:k(s,"onStateUpdate")});s.__effects.push(d)}Go(t)}function Yt(t){const e=t.parent,s=e?.node;if(!s||!t.node){ao(t,t.parent);return}let n=null;const r=Object.keys(e),f=r.indexOf(t.key);for(let o=f+1;o<r.length;o++){const c=e[r[o]];if(c?.node?.parentNode===s){n=c.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Zt(t,e,s){const n=N(t,t.ifDeps,s),r=(0,j.createEffect)(()=>{let f;try{f=n(t,t.state,t.context)}catch(c){if(f=!1,e.__ifError=c,typeof console<"u"&&console.warn){const u=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${u} \u2014 treating as false:`,c?.message||c)}return}const o=e.__if;if(e.__if=!!f,o&&!e.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(c){console.error("[smbls] onRemove error:",c)}}else if(!o&&e.__if)if(e.__ifInitialized)t.node||(t.node=(0,Q.cacheNode)(t)),t.node&&(t.node.ref=t),Yt(t),Pt(t),$("Render",t,{}),kt(t,{});else{if(e.__ifInitialized=!0,t.tag||(t.tag=(0,Q.detectTag)(t)),$("Init",t,{}),t.node||(t.node=(0,Q.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"&&!e.__fragmentAnchor){const u=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(u),e.__fragmentAnchor=u}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),co(t,{}),zt(t,{skipIfEffect:!0}),Pt(t),ro(t),fo(t,{}),Yt(t),$("Create",t,{}),$("Complete",t,{}),$("Render",t,{}),$("RenderRouter",t,{}),kt(t,{})}},{depth:e.path.length,label:k(e,"if")});e.__effects.push(r)}function ut(t,e){const s=t.node;if(!s)return;const n=e==null||typeof e=="object"?"":String(e);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const r=t.__ref;let f=r?r.__textNode:null;if(f&&f.parentNode!==s&&(f=null),!f){const o=s.firstChild;o&&o.nodeType===3&&(f=o)}f?f.nodeValue!==n&&(f.nodeValue=n):s.firstChild?(f=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(f,s.firstChild)):(s.textContent=n,f=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=f||null)}function qt(t,e){const s=t.node;if(!s||!("value"in s))return;const n=e==null?"":String(e);if(s.value===n)return;const r=typeof document<"u"&&document.activeElement===s,f=r&&typeof s.selectionStart=="number"?s.selectionStart:null,o=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,r&&f!=null&&o!=null)try{s.setSelectionRange(f,o)}catch{}}function Pt(t){const{node:e}=t;if(e){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&ut(t,t.text),zo(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in e){const s=String(t.value);e.value!==s&&(e.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}m(e,s)}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const n=t.attr[s];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!(0,S.isEnumeratedTrueFalseAttr)(s)||e.setAttribute&&e.setAttribute(s,(0,S.serializeAttrValue)(s,n)))}if(t.data&&typeof t.data=="object")for(const s in t.data){const n=t.data[s];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||e.dataset&&(e.dataset[s]=n===!0?"":n)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof s=="object")for(const n in s){const r=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];r&&e.classList.add(typeof r=="string"?r:n)}}}}function yt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Io(t){if(!t||typeof t!="object")return!1;for(const e in t){const s=t[e];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function ht(t,e){if(!t||!t.style||!e)return null;const s=t.style,n=[];for(const r in e){if(e[r]==null||r.charAt(0)==="&")continue;const o=r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());n.push(o,Qt(s,o),Xt(s,o))}return n}function Qt(t,e){return typeof t.getPropertyValue=="function"?t.getPropertyValue(e):""}function Xt(t,e){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(e):""}function _t(t,e){if(!e||!t||!t.style)return!1;const s=t.style;for(let n=0;n<e.length;n+=3)if(Qt(s,e[n])!==e[n+1]||Xt(s,e[n])!==e[n+2])return!1;return!0}const Tt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function m(t,e){if(!t||!e||!t.style)return;let s=null;for(const n in e){const r=e[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[n]=r;continue}try{const f=String(r),o=Tt(n)?n:n.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),c=f.trim(),u=/\s*!important\s*$/.test(c),a=c.replace(/\s*!important\s*$/,"");t.style.setProperty(o,a,u?"important":"")}catch{}}}s&&Uo(t,s)}function Uo(t,e){const s=`_ds${Ut.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let f="";for(const o in e){const c="."+s,u=o.replace(/&/g,c).split(",").map(d=>{const i=d.trim();return i.includes(c)?i:c+i}).join(", "),a=e[o];if(typeof a=="object"){let d="",i="";for(const l in a){const y=a[l];if(typeof y=="object"){const _=l.includes("&")?u.split(", ").map(h=>l.replace(/&/g,h)).join(", "):u.split(", ").map(h=>`${h} ${l}`).join(", ");let g="";for(const h in y)g+=`${h.replace(/[A-Z]/g,p=>"-"+p.toLowerCase())}: ${y[h]};`;i+=(0,W.wrapHoverRule)(`${_} { ${g} }`,_)+`
5
+ `}else d+=`${l.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(f+=(0,W.wrapHoverRule)(`${u} { ${d} }`,u)+`
6
+ `),i&&(f+=i)}}f&&(r.textContent+=f)}const Jt=new Set;function mt(t){if(!Array.isArray(t))return"";const e=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&e.push(t[s]);return e.sort(),e.join("|")}function Bo(t,e,s){const n=mt(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=e(t,t.state,t.context)}catch{return}if(mt(r)===n)return;const f=t.__ref.path?t.__ref.path.join("."):t.key||"?";Jt.has(f)||(Jt.add(f),console.warn(`[smbls] subscribeTo function at "${f}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Ko(t){const e=t.subscribeTo,s=typeof e=="function";let n=e;if(s)try{n=e(t,t.state,t.context)}catch{n=null}if(s&&(0,q.isLoudDevRuntime)()&&Bo(t,e,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let f=0;f<n.length;f++){const o=n[f];if(typeof o!="string"||o.length===0)continue;const c=o.split("."),u=c[0],a=c.slice(1),d={value:!1},i=(0,j.createEffect)(()=>{const l=t.state&&((0,R.isStore)(t.state)?t.state.root:null);if(!l||!(0,R.isStore)(l))return;let y=l;y=y[u];for(let g=0;g<a.length&&!(y==null||typeof y!="object");g++)if((0,R.isStore)(y))y=y[a[g]];else break;if(!d.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"){const g=t.context?.designSystem;g&&(0,w.pushConfig)(g);try{if(ho(r)){const h=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});h&&typeof h.then=="function"?h.then(()=>dt(r,!1),p=>{dt(r,!0),t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}):(dt(r,!1),h===!1&&(_=!0))}}catch(h){dt(r,!0),t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:h})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",h)}finally{g&&(0,w.popConfig)()}}if(!_&&t.node&&r.__effects)for(let g=0;g<r.__effects.length;g++){const h=r.__effects[g];h&&h!==i&&!h._disposed&&!h._isSubscribeToEffect&&typeof h._execute=="function"&&h._execute()}if(!_&&typeof t.onUpdate=="function"){const g=t.context?.designSystem;g&&(0,w.pushConfig)(g);try{t.onUpdate(t,t.state,t.context)}catch(h){t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onUpdate",error:h})||console.error("[DOMQL] subscribeTo onUpdate error:",h)}finally{g&&(0,w.popConfig)()}}},{depth:r.path.length,label:k(r,"subscribeTo("+o+")")});d.value=!0,i._isSubscribeToEffect=!0,r.__effects.push(i)}}function Lt(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}function Dt(t,e){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=e.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const to=new Set;function Vo(t,e){const s=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=s+"::"+t;to.has(n)||(to.add(n),console.warn(`[smbls/css] "${t}" at ${s} 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 tt(t,e,s){const n={},r=new Set,f=(o,c,u)=>{const a=u?new Set(Object.keys(n)):null;if(A.CSS_PROPS_REGISTRY[o]){const d=A.CSS_PROPS_REGISTRY[o](c,e,e.state,e.context);if(d){const i=Array.isArray(d)?d:[d];for(const l of i)l&&Object.assign(n,l)}}else n[o]=c;if(u)for(const d in n)a.has(d)||r.add(d)};for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let c=t[o];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(o==="style"){for(const i in c){let l=c[i];if(typeof l=="function"&&(l=l(e,e.state,e.context)),l==null||typeof l=="function")continue;const y=typeof e[i]=="function"&&(A.CSS_PROPS_REGISTRY[i]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i));f(i,l,y)}continue}if(Lt(o,e)){const i=tt(c,e,!1);Object.keys(i).length&&(n[`[data-theme="${o.slice(1)}"] &`]=i);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(o)){(0,q.isLoudDevRuntime)()&&Vo(o,e);continue}const a=Dt(o,e),d=tt(c,e,!1);Object.keys(d).length&&(n[a]=d);continue}const u=typeof e[o]=="function"&&(A.CSS_PROPS_REGISTRY[o]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(o));f(o,c,u)}if(s)for(const o in n)r.add(o);for(const o of r){const c=n[o];typeof c=="string"&&!c.includes("!important")&&(n[o]=c+" !important")}return n}function Ot(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&Ot(t[s],e+1))return!0}return!1}function oo(t,e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Lt(t,s)){const f=tt(e,s,!1);return Object.keys(f).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:f}:null}const n=Dt(t,s),r=tt(e,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function Go(t){const e=t.__ref;for(const s of Object.keys(t)){if(!jt(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!Ot(n))continue;let r=null,f;const o=(0,j.createEffect)(()=>{if(!t.node)return;const c=t.context?.designSystem;c&&(0,w.pushConfig)(c);let u,a=!1;try{const d=oo(s,n,t),i=d?yt(d.block)+"::"+d.cssProp:null;if(i!==null&&i===f)a=!0;else if(f=i,d){const l=(0,W.css)({[d.cssProp]:d.block},null,t.context?.cssPrefix);u=l?l.split(" ").filter(Boolean):null}else u=null}finally{c&&(0,w.popConfig)()}if(!(a||!t.node.classList)){if(r)for(const d of r)t.node.classList.remove(d);if(u&&u.length)for(const d of u)t.node.classList.add(d);r=u}},{depth:e.path.length,label:k(e,"cssBlock("+s+")")});e.__effects.push(o)}}function Ho(t){const e=t.__ref;e.__conditionalRunners=[];const s=new Map;for(const n of Object.keys(t)){const r=n.charAt(0);if(r!=="."&&r!=="!")continue;const f=n.slice(1);if(!f)continue;if(/[:@\s>~+[\]]/.test(f)){if(typeof console<"u"&&console.warn){const y=f.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${y}: { '${f.slice(y.length)}': {...} }\`.`)}continue}const o=t[n];if(!o||typeof o!="object")continue;const c=r==="!",u={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{let y;const _=t[f];if(_===void 0){const p=!!t.state&&f in t.state,x=t.state?t.state[f]:void 0;if(p||x!==void 0)y=x;else{const b=t.context?.cases?.[f];if(b===void 0)return;try{y=typeof b=="function"?b.call(t,t):b}catch(v){y=!1,e.__conditionalError=v,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,v?.message||v)}}}else if(typeof _=="function")try{y=_(t,t.state,t.context)}catch(p){y=!1,e.__conditionalError=p,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,p?.message||p)}else y=_;const g=c?!y:!!y;if(!t.node||g===u.lastMatch)return;u.lastMatch=g;const h=t.context?.designSystem;h&&(0,w.pushConfig)(h);try{if(g){const p={},x={};let b=!1;for(const C in o){if(!Object.prototype.hasOwnProperty.call(o,C))continue;const E=o[C],Z=C.charAt(0);if((Z===":"||Z==="@"||Z==="&"||Z==="[")&&E&&typeof E=="object"&&!Array.isArray(E)){if(Lt(C,t)){const L=tt(E,t,!1);Object.keys(L).length&&(x[`[data-theme="${C.slice(1)}"] &`]=L,b=!0)}else{const L=Dt(C,t),O=tt(E,t,!1);Object.keys(O).length&&(x[L]=O,b=!0)}continue}const X=typeof E=="function"?E(t,t.state,t.context):E;if(X!=null)if(A.CSS_PROPS_REGISTRY[C]){const L=A.CSS_PROPS_REGISTRY[C](X,t,t.state,t.context);if(L){const O=Array.isArray(L)?L:[L];for(const et of O)et&&Object.assign(p,et)}}else(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(C)||Tt(C))&&(p[C]=X)}const v=Object.keys(p);if(v.length){m(t.node,p);for(const C of v)s.set(C,n);u.appliedKeys=v}else u.appliedKeys=null;if(b){const C=(0,W.css)(x,null,t.context?.cssPrefix),E=C?C.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const Z of E)t.node.classList.add(Z);u.appliedClasses=E}else u.appliedClasses=null}else if(u.appliedClasses){for(const C of u.appliedClasses)t.node.classList.remove(C);u.appliedClasses=null}}else{if(u.appliedKeys){for(const p of u.appliedKeys)s.get(p)===n&&(Tt(p)?t.node.style.removeProperty(p):t.node.style[p]="",s.delete(p));u.appliedKeys=null}if(u.appliedClasses){for(const p of u.appliedClasses)t.node.classList.remove(p);u.appliedClasses=null}}}finally{h&&(0,w.popConfig)()}};e.__conditionalRunners.push(a);const d=N(t,t[f+"Deps"],a),i=(0,j.createEffect)(d,{depth:e.path.length,label:k(e,"conditional("+n+")")}),l=e.__exec&&e.__exec[f]||t[f];i._sources.size===0&&typeof l=="function"&&(0,q.isLoudDevRuntime)()&&console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${f}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),e.__effects.push(i)}}const Nt=new WeakSet;function Wo(t){const e=t.ownerDocument;!e||Nt.has(e)||(Nt.add(e),queueMicrotask(()=>{Nt.delete(e);const s=e.body||e.documentElement;s&&s.offsetWidth}))}const Rt=new WeakSet;let so=!1;function eo(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Mt(t,e){const s={...t};for(const n in e){const r=e[n],f=s[n];s[n]=r&&typeof r=="object"&&f&&typeof f=="object"?Mt(f,r):r}return s}function no(t,e){const s={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const f=no(r,e);Object.keys(f).length&&(s[n]=f)}else e.has(n)||(s[n]=r)}return s}function zo(t){const{node:e}=t;if(!e)return;if(so||(so=!0,(0,W.css)({display:"none"})),Rt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Rt.add(t);const s=t.context?.designSystem;s&&(0,w.pushConfig)(s),(0,A.pushStaticCssPass)();try{const n={};let r=!1,f=null,o=null,c=null;const u=(a,d)=>{if(d&&typeof d=="object"&&eo(a)){o||(o={});const i=o[a];i&&(d=Mt(i,d)),o[a]=d}else(d===null||typeof d!="object")&&(c||(c=new Set),c.add(a));n[a]=d};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&A.CSS_PROPS_REGISTRY.theme){const a=A.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(a){const d=i=>{for(const l in i){const y=i[l];y&&typeof y=="object"&&eo(l)&&(f||(f={}),f[l]=y),n[l]=y}};if(Array.isArray(a))for(const i of a)i&&d(i);else d(a);r=!0}}for(const a of Object.keys(t)){if(typeof t[a]=="function"||U.REGISTRY.has(a)||a==="theme")continue;const d=a.charCodeAt(0);if(!(d>=65&&d<=90)&&!z(a)){if(A.CSS_PROPS_REGISTRY[a]){const i=t[a],l=A.CSS_PROPS_REGISTRY[a](i,t,t.state,t.context);if(l){if(Array.isArray(l)){for(const y of l)if(y)for(const _ in y)u(_,y[_])}else for(const y in l)u(y,l[y]);r=!0}}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(a)){const i=t[a];i!=null&&typeof i!="object"&&(u(a,i),r=!0)}else if(a.charCodeAt(0)===45){const i=t[a];i!=null&&typeof i!="object"&&(u(a,i),r=!0)}else if(a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="["){const i=t[a];if(i&&typeof i=="object"&&!Array.isArray(i)){if(Ot(i))continue;const l=oo(a,i,t);l&&(u(l.cssProp,l.block),r=!0)}}}}if(f)for(const a in f){let d=c?no(f[a],c):f[a];o&&o[a]&&(d=Mt(d,o[a])),Object.keys(d).length?n[a]=d:delete n[a]}if(r){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const a=(0,W.css)(n,null,t.context?.cssPrefix);if(a&&e.classList){const i=a.split(" ").filter(Boolean);let l=!1;for(const y of i)e.classList.add(y),l||(y.charCodeAt(0)===95&&y.charCodeAt(1)===99||y.charCodeAt(0)===95&&y.indexOf("_c",1)!==-1)&&(l=!0);l&&Wo(e)}const d=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(d!=null){const i=n.display;if(i&&i!==d)if(d==="none"){const l=[];for(const y of e.classList)y.startsWith("_d-")&&y!=="_d-none"&&l.push(y);for(const y of l)e.classList.remove(y);e.classList.add("_d-none")}else e.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(e.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}}finally{(0,A.popStaticCssPass)(),s&&(0,w.popConfig)(),Rt.delete(t)}}function ro(t){const{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const f=t.aria[r];if(typeof f=="function"||typeof f=="object"||f==null||typeof f=="string"&&f.includes("{{"))continue;const o="aria-"+r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(o,(0,S.serializeAttrValue)(o,f))}const s=(0,S.applyAttrTransforms)(t);for(const r in s){const f=s[r];f!=null&&f!==!1&&typeof f!="function"&&typeof f!="object"&&e.setAttribute(r,f===!0?"":f)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||U.REGISTRY.has(r)||r==="on"||s[r]!==void 0)continue;const f=r.charCodeAt(0);if(!(f>=65&&f<=90)&&!z(r)&&!(A.CSS_PROPS_REGISTRY[r]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(r))&&(0,S.checkAttributeByTagName)(n,r)){let o=t[r];if(o==null)continue;if(typeof o=="string"&&o.includes("{{")){if(!S.ATTR_TRANSFORMS[r])continue;o=D.replaceLiteralsWithObjectFields.call(t,o,t.state)}if(o==null||typeof o=="function"||typeof o=="object"||o===!1&&!(0,S.isEnumeratedTrueFalseAttr)((0,S.camelToAttr)(r)||r))continue;const c=(0,S.camelToAttr)(r)||r;e.setAttribute(c,(0,S.serializeAttrValue)(c,o))}}}function Yo(t,e){const{node:s}=t;if(!s||!s.setAttribute)return;const n=e.charCodeAt(0);if(n>=65&&n<=90||z(e)||A.CSS_PROPS_REGISTRY[e]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(e)||!(0,S.checkAttributeByTagName)(t.tag||"div",e))return;const r=(0,S.camelToAttr)(e)||e,f=r.toLowerCase(),o=t.__ref&&t.__ref.__effects;let c=!1;if(o)for(let d=0;d<o.length;d++){const i=o[d];i&&i._attrName===f&&!i._disposed&&typeof i._execute=="function"&&(c=!0,i._execute())}if(c)return;let u=t[e];const a=S.ATTR_TRANSFORMS[e];if(a&&u!=null){const d=a(t);d!==void 0&&(u=d)}typeof u=="string"&&u.includes("{{")&&(u=D.replaceLiteralsWithObjectFields.call(t,u,t.state)),u==null||u===!1&&!(0,S.isEnumeratedTrueFalseAttr)(r)?s.removeAttribute(r):typeof u!="function"&&typeof u!="object"&&s.setAttribute(r,(0,S.serializeAttrValue)(r,u))}function Zo(t,e){const s=t.node,n=t.__ref;let r=n.__autoGrow;if(!e){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(s.scrollHeight===0&&r.lastMeasure>0)return;s.style.height="auto";const o=s.scrollHeight;s.style.height=o+"px",o>0&&(r.lastMeasure=o)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}})),r.active||(s.addEventListener("input",r.resize),r.active=!0);const f=typeof e=="object"&&e.max!=null?String(e.max):null;f!==r.appliedMax&&(f==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=f,r.appliedMax=f),r.resize()}function qo(t){if(!t.autoGrow)return;const e=t.node;if(!e||e.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,r=typeof n=="function"?N(t,t.autoGrowDeps,n):null,f=(0,j.createEffect)(()=>{const o=t.autoGrow;let c=o;if(typeof o=="function")try{c=(o===n&&r?r:o)(t,t.state,t.context)}catch{c=null}Zo(t,c)},{depth:s.path.length,label:k(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(f),r&&(s.__exec.autoGrow=n)}const io=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function co(t,e){for(const s of Object.keys(t)){if(!z(s)||io.has(s))continue;const n=(0,st.globalEventKeyInfo)(s);if(n){(0,st.registerGlobalEvent)(n,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const o=r;r=function(u){return t.call(o,u)}}if(typeof r!="function")continue;const f=Lo(s);U.LIFECYCLE_EVENTS.has(f)||(0,st.registerEvent)(Do(f),t,r)}Qo(t)}function Qo(t){const e=t.node;if(!e||!e.addEventListener)return;const s={};let n=!1;for(const l of io){const y=t[l];typeof y=="function"&&(s[l]=y,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,f=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let o=0,c=0,u=0,a=!1;const d=l=>{const y=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];y&&(o=y.clientX,c=y.clientY,u=Date.now(),a=!0)},i=l=>{if(!a)return;a=!1;const y=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!y)return;const _=y.clientX-o,g=y.clientY-c,h=Date.now()-u;if(h>f)return;const p=Math.abs(_),x=Math.abs(g);if(Math.max(p,x)<r)return;let b;if(p>x*1.2)b=_<0?"left":"right";else if(x>p*1.2)b=g<0?"up":"down";else return;const v="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),C=s[v],E=s.onSwipe;C&&C.call(t,l,t,t.state,t.context),E&&E.call(t,{direction:b,dx:_,dy:g,dt:h,event:l},t,t.state,t.context)};e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",i,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",d)}catch{}try{e.removeEventListener("touchend",i)}catch{}})}function at(t,e){const s={...t};for(const n in e){const r=s[n],f=e[n];r&&f&&typeof r=="object"&&typeof f=="object"&&!Array.isArray(r)&&!Array.isArray(f)&&typeof r!="function"&&typeof f!="function"?s[n]=at(r,f):s[n]=f}return s}function $t(t,e,s,n){if(!e||!t.node)return;const r=t.childExtends;if(Array.isArray(e)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,c=f?null:o?.createDocumentFragment();if(!f&&!c)return;const u=t.childProps,a=t.childrenAs,d=h=>{let p=e[h];const x=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let b=u;if(typeof u=="function")try{b=u(t,p)}catch{b=null}if(a==="state"){let C=x;(typeof x=="string"||typeof x=="number")&&(C={value:x,text:x}),p=b?{...b,state:C}:{state:C}}else b&&(p=at(b,p));if(r&&!p.ignoreChildExtends)if(p.extends){const C=Array.isArray(p.extends)?p.extends:[p.extends],E=Array.isArray(r)?r:[r];p={...p,extends:[...E,...C]}}else p={...p,extends:r};const v=Gt(p?.key,x,h);try{return Y(p,t,v,s)}catch(C){if(typeof console<"u"&&console.error){const E=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to construct at ${E} (initial render, skipping this row):`,C?.message||C)}return null}},i=t.__ref;if(!(n===!0&&!f&&!!i&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let h=0;h<e.length;h++){const p=d(h);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const y=i.__childrenChunkGen=(i.__childrenChunkGen||0)+1;(0,B.openMountBudget)();let _=null;const g=h=>{if(i.__disposed||i.__childrenChunkGen!==y){_&&_.parentNode&&_.remove();return}for(let p=h;p<e.length;p++){const x=d(p);if(x?.node&&(_?t.node.insertBefore(x.node,_):c.appendChild(x.node)),p+1<e.length&&(0,B.mountBudgetExhausted)()){_||(_=o.createComment("smbls-mount"),c.appendChild(_),t.node.appendChild(c));const b=p+1;(0,B.enqueueMountWork)(()=>g(b));return}}_?(_.remove(),t.node.tagName==="SELECT"&&gt(t,!0)):t.node.appendChild(c)};return g(0),(0,B.closeMountBudget)(),!0}if(typeof e=="string"){const f=Ht(e,t);if(Array.isArray(f))return $t(t,f,s,n)}if(typeof e=="object")for(const f in e){if(U.REGISTRY.has(f))continue;let o=e[f];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=at(t.childProps,o)),r&&!o.ignoreChildExtends)if(o.extends){const c=Array.isArray(o.extends)?o.extends:[o.extends],u=Array.isArray(r)?r:[r];o={...o,extends:[...u,...c]}}else o={...o,extends:r};Y(o,t,f,s)}}}function gt(t,e){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const r=t.__ref,f=r&&r.__exec&&r.__exec.value,o=typeof f=="function",c=t.value!=null&&typeof t.value!="function";if(o||c){let d;if(o)try{d=f(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=D.replaceLiteralsWithObjectFields.call(t,d,t.state));const i=d==null?"":String(d);s.value!==i&&(s.value=i);return}const u=e||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!u)return;let a=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(a=d);a>=0&&s.selectedIndex!==a&&(s.selectedIndex=a)}function fo(t,e){let{children:s,content:n}=t;const r=t.childExtends;if(typeof s=="function"){const i=s;try{s=i(t,t.state,t.context)}catch(h){if(s=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):`,h?.message||h)}}t.children=s;const l=t.__ref;let y=!1;const _=N(t,t.childrenDeps,i),g=(0,j.createEffect)(()=>{const h=y;y=!0;let p;try{p=_(t,t.state,t.context)}catch(L){if(typeof console<"u"&&console.error){const O=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${O}${h?"":" (initial tracking run)"}:`,L?.message||L)}return}if(!h||p===t.children)return;t.children=p,l.__childrenChunkGen!=null&&l.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",b=x?[]:null,v=x?[]:null,C=x?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const L=t.childProps,O=[],et=new Map;for(let P=0;P<p.length;P++){const K=p[P];let T=L;if(typeof L=="function")try{T=L(t,K)}catch{T=null}const H=Gt(T&&T.key,K,P);O.push(H),et.set(H,{rawChild:K,childProps:T})}const _o=new Set(O),go=l.__children.slice();for(const P of go)if(!_o.has(P)){const K=t[P];K?.remove&&K.remove(),delete t[P],v&&v.push(P)}const nt=t.childExtends,lt=t.tag==="fragment",bo=t.context?.document||globalThis.document,rt=lt?null:bo?.createDocumentFragment(),At=new Set;for(const P of O){const K=et.get(P),T=K.rawChild,H=t[P];if(H&&H.state){if(T&&typeof T=="object"){const M=H.state,J=M.$replace||M.replace,It=M.$update||M.update;try{if(typeof J=="function")J.call(M,T);else if(typeof It=="function"){for(const I in M)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(T,I))try{M[I]=void 0}catch{}It.call(M,T)}else for(const I in T)M[I]=T[I]}catch(I){if(typeof console<"u"&&console.error){const xo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${P}" failed to patch at ${xo} (reconcile, keeping its previous data for this pass):`,I?.message||I)}}}C&&C.push(P);continue}let Ct=T;(typeof T=="string"||typeof T=="number")&&(Ct={value:T,text:T});const Ft=K.childProps;let V=Ft?{...Ft,state:Ct}:{state:Ct};if(nt&&!V.ignoreChildExtends)if(V.extends){const M=Array.isArray(V.extends)?V.extends:[V.extends],J=Array.isArray(nt)?nt:[nt];V={...V,extends:[...J,...M]}}else V={...V,extends:nt};let vt;try{vt=Y(V,t,P,e)}catch(M){if(typeof console<"u"&&console.error){const J=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${P}" failed to construct at ${J} (reconcile, skipping this row):`,M?.message||M)}At.add(P);continue}!lt&&vt?.node&&rt&&rt.appendChild(vt.node),b&&b.push(P)}if(!lt&&rt&&rt.childNodes.length&&t.node&&t.node.appendChild(rt),!lt&&t.node){let P=null;for(const K of O){const T=t[K]?.node;if(!T)continue;const H=P?P.nextSibling:t.node.firstChild;T!==H&&t.node.insertBefore(T,H),P=T}}l.__children=At.size?O.filter(P=>!At.has(P)):O,x&&(b.length||v.length)&&Vt(t,{added:b,removed:v,kept:C}),gt(t,!1);return}const X=x?[...l.__children]:null;for(const L of[...l.__children]){const O=t[L];O?.remove&&O.remove(),delete t[L]}l.__children=[],$t(t,p,e),gt(t,!1),x&&Vt(t,{added:[...l.__children],removed:X,kept:[]})},{depth:l.path.length,label:k(l,"children")});l.__effects.push(g)}const f=$t(t,s,e,!0);if(n!=null&&!(n&&n.__ref)){let i=n;if(typeof i=="string"||typeof i=="number"?i={text:i}:typeof i!="object"&&(i={}),t.childProps&&(i=at(t.childProps,i)),r&&!i.ignoreChildExtends)if(i.extends){const l=Array.isArray(i.extends)?i.extends:[i.extends],y=Array.isArray(r)?r:[r];i={...i,extends:[...y,...l]}}else i={...i,extends:r};Y(i,t,"content",e)}if(s&&!f)return;const o=t.context?.components||{};{const i=Object.keys(t);for(let l=0;l<i.length;l++){const y=i[l];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const _=y.slice(0,-7);if(!_||_.charCodeAt(0)<65||_.charCodeAt(0)>90)continue;const g={extends:t[y]};delete t[y];for(let h=l+1;h<i.length;h++){const p=i[h],x=p.charCodeAt(0);if(x>=65&&x<=90||U.REGISTRY.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const b=t[p];b!==void 0&&(g[p]=b,delete t[p])}t[_]&&typeof t[_]=="object"?t[_]={...g,...t[_]}:t[_]=g}}const c=e?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),a=i=>{if(U.REGISTRY.has(i)||typeof t[i]!="object"||t[i]===null)return;const l=i.charCodeAt(0);if(l<65||l>90)return;let y=t[i];if(!y.__ref){if(!y.extends&&!y.extend){const _=o[i]||o[`smbls.${i}`];_&&(y={...y,extends:_})}if(t.childProps&&(y=at(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const _=Array.isArray(y.extends)?y.extends:[y.extends],g=Array.isArray(r)?r:[r];y={...y,extends:[...g,..._]}}else y={...y,extends:r};Y(y,t,i,e)}};if(!c){for(const i of u)a(i);return}(0,B.openMountBudget)();const d=i=>{for(let l=i;l<u.length;l++)if(a(u[l]),l+1<u.length&&(0,B.mountBudgetExhausted)()){const y=l+1;(0,B.enqueueMountWork)(()=>d(y));return}};d(0),(0,B.closeMountBudget)()}function ao(t,e,s){const{node:n}=t;if(!n)return;n.ref=t;const r=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(r){const o=r.parentNode;if(o){if(s?.position==="before"&&s.node)o.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;o.insertBefore(n,c||r)}else o.insertBefore(n,r);return}}const f=e?.node||(e?.nodeType?e:null);if(f)if(s?.position==="before"&&s.node)f.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const o=s.node.nextSibling;o?f.insertBefore(n,o):f.appendChild(n)}else f.appendChild(n)}const xt=3;function ho(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=xt?!1:(t.__inBeforeUpdate=!0,!0)}function dt(t,e){t&&(t.__inBeforeUpdate=!1,e?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===xt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${xt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function $(t,e,s){const n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&(0,G.runPluginHook)(n,e,s);const r="on"+t,f=e[r];if(typeof f=="function"){const u=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(u){if(e.__ref[u])return!0;e.__ref[u]=!0}const a=e.context?.designSystem;a&&(0,w.pushConfig)(a);let d=!!u;try{const i=f(e,e.state,e.context,s);if(i&&typeof i.then=="function"){const l=e.__ref;return i.catch(y=>{e.context?.plugins?.length&&(0,G.runPluginHook)("error",e,{hook:r,error:y})||console.error(`[DOMQL] Lifecycle "${r}" error:`,y)}).finally(()=>{u&&l&&(l[u]=!1)}),d=!1,!0}if(i===!1)return!1}catch(i){if(e.context?.plugins?.length&&(0,G.runPluginHook)("error",e,{hook:r,error:i})||console.error(`[DOMQL] Lifecycle "${r}" error:`,i),e.context?.strictMode)throw i}finally{a&&(0,w.popConfig)(),d&&e.__ref&&(e.__ref[u]=!1)}}return!0}var Xo=Y;
@@ -1 +1 @@
1
- var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},I=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of s(o))!x.call(t,c)&&c!==e&&n(t,c,{get:()=>o[c],enumerable:!(p=r(o,c))||p.enumerable});return t};var N=t=>I(n({},"__esModule",{value:!0}),t);var R={};E(R,{VERSION:()=>O});module.exports=N(R);const O="3.14.786";
1
+ var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},I=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of s(o))!x.call(t,c)&&c!==e&&n(t,c,{get:()=>o[c],enumerable:!(p=r(o,c))||p.enumerable});return t};var N=t=>I(n({},"__esModule",{value:!0}),t);var R={};E(R,{VERSION:()=>O});module.exports=N(R);const O="3.14.788";
@@ -1,6 +1,6 @@
1
- import{createStore as Ct,createScopeStore as xo,isStore as K}from"@symbo.ls/signal";import{createEffect as w}from"@symbo.ls/signal";import{cacheNode as kt,detectTag as Bt}from"./cache.js";import{REGISTRY as V,LIFECYCLE_EVENTS as Ao}from"./registry.js";import{registerEvent as Co,registerGlobalEvent as ko,globalEventKeyInfo as So}from"./delegate.js";import{applyExtends as vo}from"./extends.js";import{addMethods as wo}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as tt}from"./devRuntime.js";import{mountBudgetExhausted as Kt,openMountBudget as Vt,closeMountBudget as Gt,enqueueMountWork as Ht}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as at,isPolyglotWritableKey as jo,markPolyglotSeeded as Eo}from"@symbo.ls/utils";import{runPluginHook as B}from"@symbo.ls/utils/function.js";import{applyStateMethods as ot}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as D,DEFAULT_CSS_PROPERTIES_LIST as P,pushStaticCssPass as Wt,popStaticCssPass as zt}from"css-in-props";import{css as st,wrapHoverRule as Yt}from"@symbo.ls/css";import{pushConfig as R,popConfig as M}from"@symbo.ls/scratch";import{checkAttributeByTagName as ut,applyAttrTransforms as Po,ATTR_TRANSFORMS as To,camelToAttr as dt,serializeAttrValue as H,isEnumeratedTrueFalseAttr as et}from"attrs-in-props";import{resolveElementIdEngine as Do}from"./engineRegistry.js";import{VERSION as Lo}from"./version.js";const qt=Do({uniqId:1,scopedStyleId:0},Lo),nt=[];let St=!1;function Zt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Oo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Ro=250;function Qt(){if(!St){if(St=!0,typeof requestAnimationFrame!="function"){setTimeout(vt,0);return}Oo()?setTimeout(vt,Ro):requestAnimationFrame(vt)}}const Mo=300,No=15e4;function vt(){if(St=!1,!nt.length)return;const t=nt.splice(0,nt.length);for(let e=0;e<t.length;e++){const s=t[e];if(s.node){if(!s.node.isConnected){const r=s.__ref||(s.__ref={});r.__mountAttempts=(r.__mountAttempts||0)+1,r.__mountFirstAttemptAt==null&&(r.__mountFirstAttemptAt=Zt());const n=Zt()-r.__mountFirstAttemptAt;r.__mountAttempts<=Mo&&n<No?(nt.push(s),Qt()):console.warn("[DOMQL] onMounted dropped after",r.__mountAttempts,"attempts /",n,"ms \u2014 node never connected:",s.key||s.tag||s);continue}N("Mounted",s,s.__ref?.__mountOptions||{})}}}function wt(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,nt.push(t),Qt())}function Xt(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&B("contentUpdate",t,e);const s=t.context?.designSystem;s&&R(s);try{t.onContentUpdate(t,t.state,t.context,e)}catch(r){if(t.context?.plugins?.length&&B("error",t,{hook:"onContentUpdate",error:r})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',r),t.context?.strictMode)throw r}finally{s&&M()}}function W(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function $o(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Fo(t){return t.toLowerCase()}function jt(t){const e=t.charCodeAt(0);return e===58||e===64||e===38||e===91}function rt(t,e){const s={...t};for(const r in e){const n=s[r],o=e[r];n&&o&&typeof n=="object"&&typeof o=="object"&&!Array.isArray(n)&&!Array.isArray(o)&&typeof n!="function"&&typeof o!="function"?s[r]=rt(n,o):s[r]=o}return s}function z(t,e,s,r={},n){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});const o=Object.create(null);o.key=s||t.key||`_${qt.uniqId++}`,o.parent=e||null,o.context=t.context||e?.context||r.context||{},o.context.__create||(o.context.__create=z);const i=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:e?.__ref?.root||o,path:e?.__ref?.path?[...e.__ref.path,o.key]:[o.key],origin:t};if(s&&!t.extends&&!t.extend){const _=s.indexOf("_"),p=s.indexOf(".");let h=_>0?_:-1;if(p>0&&(h<0||p<h)&&(h=p),h>0){const b=s.substring(0,h),x=o.context?.components;x&&(x[b]||x["smbls."+b])?t={...t,extends:b}:x&&tt()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${b}" but neither "${b}" nor "smbls.${b}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}vo(o,t,r);const a=new Set(["childProps","attr","style","scope","data"]),c=o.props&&typeof o.props=="object"?o.props:null;for(const _ in t){if(_==="parent"||_==="node"||_==="__ref"||_==="extends"||_==="context"||_==="props")continue;const p=t[_],h=o[_],b=h&&p&&typeof h=="object"&&typeof p=="object"&&!Array.isArray(h)&&!Array.isArray(p)&&typeof h!="function"&&typeof p!="function";b&&_.charCodeAt(0)>=65&&_.charCodeAt(0)<=90?o[_]=rt(h,p):b&&a.has(_)?o[_]={...h,...p}:b&&jt(_)?o[_]=rt(h,p):o[_]=p}function u(_){for(const p in _){const h=_[p],b=o[p],x=b&&h&&typeof b=="object"&&typeof h=="object"&&!Array.isArray(b)&&!Array.isArray(h)&&typeof b!="function"&&typeof h!="function";x&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?o[p]=rt(b,h):x&&a.has(p)?o[p]={...b,...h}:x&&jt(p)?o[p]=rt(b,h):o[p]=h}}c&&u(c),t.props&&typeof t.props=="object"&&u(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,f=e?.scope,l=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,y=f||l||null;if(t.scope!==void 0||d){const _={};d&&Object.assign(_,d),t.scope!==void 0&&Object.assign(_,t.scope),o.scope=xo(_,y)}else y&&(o.scope=y);if(t.if!==void 0&&(o.if=t.if),wo(o),Io(o,e,t),o.if!=null){let _;if(typeof o.if=="function")try{_=o.if(o,o.state,o.context)}catch(p){if(_=!1,i.__ifError=p,typeof console<"u"&&console.warn){const h=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${h} \u2014 treating as false:`,p?.message||p)}}else _=o.if;i.__if=!!_}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&oo(o,i,o.if),o;o.tag||(o.tag=Bt(o)),N("Init",o,r);const g=o.node=kt(o);if(!g)return o;if(o.tag==="fragment"){const p=(o.context?.document||globalThis.document).createComment("");g.appendChild(p),i.__fragmentAnchor=p}N("AttachNode",o,r),g.setAttribute&&o.key&&g.setAttribute("data-key",o.key),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),g.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&g.setAttribute("data-smbls-app",o.context.key),o.id&&g.setAttribute&&(g.id=o.id),lo(o,r),mt(o),Pt(o),ao(o),ts(o);try{po(o,r)}catch(_){if(typeof console<"u"&&console.error){const p=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${p}:`,_?.message||_,_?.stack?`
2
- `+_.stack.split(`
1
+ import{createStore as St,createScopeStore as Eo,isStore as W}from"@symbo.ls/signal";import{createEffect as S}from"@symbo.ls/signal";import{cacheNode as wt,detectTag as Gt}from"./cache.js";import{REGISTRY as G,LIFECYCLE_EVENTS as Po}from"./registry.js";import{registerEvent as To,registerGlobalEvent as Lo,globalEventKeyInfo as Do}from"./delegate.js";import{applyExtends as Oo}from"./extends.js";import{addMethods as No}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as X}from"./devRuntime.js";import{mountBudgetExhausted as Ht,openMountBudget as Wt,closeMountBudget as zt,enqueueMountWork as Yt}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as $,isPolyglotWritableKey as Ro,markPolyglotSeeded as Mo}from"@symbo.ls/utils";import{runPluginHook as H}from"@symbo.ls/utils/function.js";import{applyStateMethods as et}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as T,DEFAULT_CSS_PROPERTIES_LIST as E,pushStaticCssPass as Zt,popStaticCssPass as qt}from"css-in-props";import{css as nt,wrapHoverRule as Qt}from"@symbo.ls/css";import{pushConfig as N,popConfig as R}from"@symbo.ls/scratch";import{checkAttributeByTagName as rt,applyAttrTransforms as $o,ATTR_TRANSFORMS as kt,camelToAttr as it,serializeAttrValue as K,isEnumeratedTrueFalseAttr as ct}from"attrs-in-props";import{resolveElementIdEngine as Fo}from"./engineRegistry.js";import{VERSION as Io}from"./version.js";const Xt=Fo({uniqId:1,scopedStyleId:0},Io),ft=[];let jt=!1;function Jt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Uo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Bo=250;function mt(){if(!jt){if(jt=!0,typeof requestAnimationFrame!="function"){setTimeout(Et,0);return}Uo()?setTimeout(Et,Bo):requestAnimationFrame(Et)}}const Ko=300,Vo=15e4;function Et(){if(jt=!1,!ft.length)return;const t=ft.splice(0,ft.length);for(let e=0;e<t.length;e++){const s=t[e];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=Jt());const r=Jt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Ko&&r<Vo?(ft.push(s),mt()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}M("Mounted",s,s.__ref?.__mountOptions||{})}}}function Pt(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,ft.push(t),mt())}function to(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&H("contentUpdate",t,e);const s=t.context?.designSystem;s&&N(s);try{t.onContentUpdate(t,t.state,t.context,e)}catch(n){if(t.context?.plugins?.length&&H("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&R()}}function z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Go(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Ho(t){return t.toLowerCase()}function Tt(t){const e=t.charCodeAt(0);return e===58||e===64||e===38||e===91}function at(t,e){const s={...t};for(const n in e){const r=s[n],f=e[n];r&&f&&typeof r=="object"&&typeof f=="object"&&!Array.isArray(r)&&!Array.isArray(f)&&typeof r!="function"&&typeof f!="function"?s[n]=at(r,f):s[n]=f}return s}function pt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function oo(t,e,s){return pt(t)||(e&&typeof e=="object"?pt(e.key):void 0)||String(s)}function Z(t,e,s,n={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=pt(s);const f=pt(t.key),o=Object.create(null);o.key=s||f||`_${Xt.uniqId++}`,o.parent=e||null,o.context=t.context||e?.context||n.context||{},o.context.__create||(o.context.__create=Z);const c=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:e?.__ref?.root||o,path:e?.__ref?.path?[...e.__ref.path,o.key]:[o.key],origin:t};if(s&&!t.extends&&!t.extend){const h=s.indexOf("_"),p=s.indexOf(".");let x=h>0?h:-1;if(p>0&&(x<0||p<x)&&(x=p),x>0){const b=s.substring(0,x),C=o.context?.components;C&&(C[b]||C["smbls."+b])?t={...t,extends:b}:C&&X()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${b}" but neither "${b}" nor "smbls.${b}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}Oo(o,t,n);const u=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(const h in t){if(h==="parent"||h==="node"||h==="__ref"||h==="extends"||h==="context"||h==="props")continue;if(h==="key"){f&&(o.key=f);continue}const p=t[h],x=o[h],b=x&&p&&typeof x=="object"&&typeof p=="object"&&!Array.isArray(x)&&!Array.isArray(p)&&typeof x!="function"&&typeof p!="function";b&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?o[h]=at(x,p):b&&u.has(h)?o[h]={...x,...p}:b&&Tt(h)?o[h]=at(x,p):o[h]=p}function d(h){for(const p in h){const x=h[p],b=o[p],C=b&&x&&typeof b=="object"&&typeof x=="object"&&!Array.isArray(b)&&!Array.isArray(x)&&typeof b!="function"&&typeof x!="function";C&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?o[p]=at(b,x):C&&u.has(p)?o[p]={...b,...x}:C&&Tt(p)?o[p]=at(b,x):o[p]=x}}a&&d(a),t.props&&typeof t.props=="object"&&d(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 i=o.scope&&typeof o.scope=="object"?o.scope:null,l=e?.scope,y=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,_=l||y||null;if(t.scope!==void 0||i){const h={};i&&Object.assign(h,i),t.scope!==void 0&&Object.assign(h,t.scope),o.scope=Eo(h,_)}else _&&(o.scope=_);if(t.if!==void 0&&(o.if=t.if),No(o),Wo(o,e,t),o.if!=null){let h;if(typeof o.if=="function")try{h=o.if(o,o.state,o.context)}catch(p){if(h=!1,c.__ifError=p,typeof console<"u"&&console.warn){const x=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${x} \u2014 treating as false:`,p?.message||p)}}else h=o.if;c.__if=!!h}if(c.__if)typeof o.if=="function"&&(c.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&io(o,c,o.if),o;o.tag||(o.tag=Gt(o)),M("Init",o,n);const g=o.node=wt(o);if(!g)return o;if(o.tag==="fragment"){const p=(o.context?.document||globalThis.document).createComment("");g.appendChild(p),c.__fragmentAnchor=p}M("AttachNode",o,n),g.setAttribute&&o.key&&g.setAttribute("data-key",o.key),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),g.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&g.setAttribute("data-smbls-app",o.context.key),o.id&&g.setAttribute&&(g.id=o.id),Ao(o,n),no(o),Dt(o),bo(o),cs(o);try{Co(o,n)}catch(h){if(typeof console<"u"&&console.error){const p=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${p}:`,h?.message||h,h?.stack?`
2
+ `+h.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(_t(o,!0),yo(o,e,n),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const _=o.context?.designSystem;_&&R(_);try{const p=o.html(o,o.state,o.context);p!=null&&typeof p!="function"&&(o.node.innerHTML=p)}catch{}finally{_&&M()}}if(N("Create",o,r),N("Complete",o,r),N("Render",o,r),N("RenderRouter",o,r),wt(o,r),typeof o.onFrame=="function"){const _=o.onFrame,p=o.context?.designSystem,h=()=>{if(o.node){if(o.node.isConnected){p&&R(p);try{_(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{p&&M()}}requestAnimationFrame(h)}};requestAnimationFrame(h)}return o}function Io(t,e,s){const r=!e,n=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,o=r&&n&&t.context?.state,i=s.state!==void 0&&!o?s.state:t.state&&!K(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,ot(t,t.state);else if(t.context?.state){const a=t.context.state,c={...a},u=t.context?.polyglot;if(u?.translations){const d=t.context,f=a.lang||u.defaultLang||"en",l=new Set,y=(p,h)=>{l.has(p)||jo(d,p,c)&&(c[p]=h,l.add(p),Eo(d,p))},g=u.translations[f];if(g&&typeof g=="object")for(const p in g)y(p,g[p]);const _=new Set(u.languages||[]);for(const p in u.translations)_.has(p)||y(p,u.translations[p])}t.state=K(c)?c:Ct(c),t.state.__element=t,t.state.root=t.state,ot(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),ot(t,t.state);return}if(typeof i=="string"){if(t.state=Jt(i,e),t.state&&typeof t.state=="object"&&!K(t.state)){const a=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:a,enumerable:!1,configurable:!0,writable:!0})}ot(t,t.state);return}if(typeof i=="function"){const a=i(t,e?.state);t.state=K(a)?a:Ct(a||{})}else K(i)?t.state=i:t.state=Ct({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,ot(t,t.state)}function Et(t,e){if(!e)return t;const s=e.split("/");let r=t;for(const n of s){if(r==null)return{};r=r[n]}return r??{}}function Jt(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){const n=t.slice(3);return n?Et(e.state,n):e.state??{}}if(t.startsWith("~/")){const n=e.state?.root||e.state,o=t.slice(2);return o?Et(n,o):n??{}}if(e.state?.[t]!==void 0)return e.state[t];const s=Et(e.state,t);if(s!=null&&Object.keys(s).length>0)return s;const r=e.context?.polyglot;if(r?.translations){const n=e.state?.root?.lang||r.defaultLang||"en",o=r.translations[n];if(o?.[t]!==void 0)return o[t];if(r.translations[t]!==void 0)return r.translations[t]}return{}}const Uo=new Set(["s","state","ctx","context"]);function Bo(t){try{const s=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(r=>r.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function Ko(t){if(typeof t!="function"||t.length!==2)return!1;const e=Bo(t);if(e.length<2)return!1;const s=e[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!Uo.has(s)}function Vo(t){const e=t.__ref,s=t.tag||"div",r=t.context?.designSystem,n=[],o=Object.keys(t);for(let i=0;i<o.length;i++){const a=o[i];if(typeof t[a]!="function"||V.has(a))continue;const c=a.charCodeAt(0);c>=65&&c<=90||W(a)||D[a]||P&&P.has(a)||ut(s,a)||(tt()&&Ko(t[a])&&console.warn(`[smbls] custom prop "${a}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${a}', \u2026) instead of reading el.${a}(\u2026) directly (see RULES.md Rule 8).`),n.push({prop:a,fn:t[a]}))}for(let i=0;i<n.length;i++){const{prop:a,fn:c}=n[i];e.__exec[a]=c,Object.defineProperty(t,a,{get(){r&&R(r);try{return c(t,t.state,t.context)}catch{return}finally{r&&M()}},set(u){delete e.__exec[a],Object.defineProperty(t,a,{value:u,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Go(t,e){if(!(!Array.isArray(e)||e.length===0))for(let s=0;s<e.length;s++){const r=e[s];try{typeof r=="function"?r(t,t.state,t.context):typeof r=="string"&&t.state?.[r]}catch{}}}function L(t,e,s){return!Array.isArray(e)||e.length===0?s:function(...r){return Go(t,e),s.apply(this,r)}}function it(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function j(t,e){return()=>t.path.join(".")+"::"+e}function mt(t,e){const s=t.__ref,r=!!(e&&e.skipIfEffect);if(Vo(t),typeof t.text=="function"){const o=t.text,i=L(t,t.textDeps,o),a=w(()=>{if(!s.contentManaged)try{let c=i(t,t.state,t.context);t.node&&c!=null&&typeof c!="function"&&typeof c!="object"&&(typeof c=="string"&&c.includes("{{")&&(c=at.call(t,c,t.state)),lt(t,c))}catch{}},{depth:s.path.length,label:j(s,"text")});s.__effects.push(a),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,i=w(()=>{if(s.contentManaged)return;const a=at.call(t,o,t.state);a!=null&&(t.text=a),t.node&&lt(t,a??"")},{depth:s.path.length,label:j(s,"text")});s.__effects.push(i),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!V.has(o)&&!W(o)&&!s.__exec[o]){if(D[o]){const i=t[o],a=L(t,t[o+"Deps"],i),c=o;let u,d=null,f=null,l;const y=w(()=>{const g=t.context?.designSystem;g&&R(g);try{const _=a(t,t.state,t.context);Wt();let p;try{p=D[c](_,t,t.state,t.context)}finally{zt()}if(Array.isArray(p)){const b={};for(const x of p)if(x)for(const C in x)b[C]=x[C];p=b}const h=c==="show"||c==="hide";if(p&&t.node&&Ho(p)){const b=pt(p);if(b===null||b!==l){l=b;const x=st(p,null,t.context?.cssPrefix),C=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(f)for(const A of f)t.node.classList.remove(A);if(C&&C.length)for(const A of C)t.node.classList.add(A);f=C}}u=void 0,d=null}else if(p&&t.node){if(f){for(const x of f)t.node.classList.remove(x);f=null,l=void 0}const b=pt(p);(b===null||b!==u||!ht(t.node,d))&&(u=b,Z(t.node,p),d=yt(t.node,p))}else if(t.node&&h){u=void 0,d=null;const b=s.__explicitDisplay;t.node.style.display=typeof b=="string"?b:""}}finally{g&&M()}},{depth:s.path.length,label:j(s,c)});s.__effects.push(y),s.__exec[o]=i}else if(P&&P.has(o)){const i=t[o],a=L(t,t[o+"Deps"],i),c=o;let u,d=null;const f=w(()=>{const l=t.context?.designSystem;l&&R(l);try{const y=a(t,t.state,t.context);if(t.node)if(y!=null){const g=c+":"+String(y);if(g!==u||!ht(t.node,d)){u=g;const _={[c]:y};Z(t.node,_),d=yt(t.node,_)}}else u=void 0,d=null,t.node.style[c]=""}finally{l&&M()}},{depth:s.path.length,label:j(s,c)});s.__effects.push(f),s.__exec[o]=i}}if(typeof t.html=="function"){const o=t.html,i=L(t,t.htmlDeps,o),a=w(()=>{const c=t.context?.designSystem;c&&R(c);try{const u=i(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)}finally{c&&M()}},{depth:s.path.length,label:j(s,"html")});s.__effects.push(a),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,i=L(t,t.valueDeps,o),a=w(()=>{try{const c=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;const u=c==null?"":String(c);if(t.node.value===u)return;const d=typeof document<"u"&&document.activeElement===t.node,f=d&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,l=d&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=u,d&&f!=null&&l!=null)try{t.node.setSelectionRange(f,l)}catch{}}catch{}},{depth:s.path.length,label:j(s,"value")});s.__effects.push(a),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,i=L(t,t.styleDeps,o);let a,c=null;const u=w(()=>{const d=i(t,t.state,t.context),f=pt(d);(f===null||f!==a||!ht(t.node,c))&&(a=f,Z(t.node,d),c=yt(t.node,d))},{depth:s.path.length,label:j(s,"style")});s.__effects.push(u),s.__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 a=L(t,it(t.styleDeps,o),i);let c,u=null;const d=w(()=>{try{const f=a(t,t.state,t.context);if(t.node){const l=o+":"+String(f);if(l!==c||!ht(t.node,u)){c=l;const y={[o]:f};Z(t.node,y),u=yt(t.node,y)}}}catch{}},{depth:s.path.length,label:j(s,"style."+o)});s.__effects.push(d)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const i=L(t,it(t.attrDeps,o),t.attr[o]),a=o,c=w(()=>{try{const u=i(t,t.state,t.context);t.node?.setAttribute&&(u==null||u===!1&&!et(a)?t.node.removeAttribute(a):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(a,H(a,u)))}catch{}},{depth:s.path.length,label:j(s,"attr."+a)});c._attrName=a.toLowerCase(),s.__effects.push(c)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){if(typeof t.aria[o]!="function")continue;const i=L(t,it(t.ariaDeps,o),t.aria[o]),a="aria-"+o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),c=w(()=>{try{const u=i(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null?t.node.removeAttribute(a):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(a,H(a,u))}catch{}},{depth:s.path.length,label:j(s,"aria."+o)});c._attrName=a,s.__effects.push(c)}if(t.data&&typeof t.data=="object")for(const o in t.data){if(typeof t.data[o]!="function")continue;const i=L(t,it(t.dataDeps,o),t.data[o]),c="data-"+o.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),u=w(()=>{try{const d=i(t,t.state,t.context);if(!t.node?.setAttribute)return;d==null||d===!1?t.node.removeAttribute(c):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(c,d===!0?"":d)}catch{}},{depth:s.path.length,label:j(s,"data."+o)});u._attrName=c,s.__effects.push(u)}const n=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(n)for(const o in n){if(typeof n[o]!="function")continue;const i=L(t,it(t.classDeps,o),n[o]),a=w(()=>{try{const c=i(t,t.state,t.context);if(!t.node?.classList)return;typeof c=="string"?t.node.classList.add(c):c?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:s.path.length,label:j(s,"class."+o)});s.__effects.push(a)}!r&&typeof t.if=="function"&&oo(t,s,t.if);for(const o of Object.keys(t)){if(V.has(o)||typeof t[o]!="function")continue;const i=o.charCodeAt(0);if(i>=65&&i<=90||W(o))continue;const a=t[o];s.__exec[o]=a;const c=t.tag||"div";if(ut(c,o)&&!D[o]&&!(P&&P.has(o))){const u=dt(o)||o,d=L(t,t[o+"Deps"],a),f=w(()=>{try{const l=d(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1&&!et(u)?t.node.removeAttribute(u):typeof l!="function"&&typeof l!="object"&&(u==="src"&&"src"in t.node?t.node.src=l:t.node.setAttribute(u,H(u,l))))}catch{}},{depth:s.path.length,label:j(s,o)});f._attrName=u.toLowerCase(),s.__effects.push(f)}}if(Yo(t),Qo(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,i=t.stateDeps;let a=!1,c=[];const u=w(()=>{const d=[];for(let g=0;g<i.length;g++){const _=i[g];try{d[g]=typeof _=="function"?_(t,t.state,t.context):t.state?.[_]}catch{d[g]=void 0}}if(!a){a=!0,c=d;return}let f=d.length!==c.length;for(let g=0;!f&&g<d.length;g++)d[g]!==c[g]&&(f=!0);const l=c;if(c=d,!f)return;const y=t.context?.designSystem;y&&R(y);try{o(t,t.state,t.context,{prev:l,next:d})}catch(g){if(t.context?.plugins?.length&&B("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{y&&M()}},{depth:s.path.length,label:j(s,"onStateUpdate")});s.__effects.push(u)}Zo(t)}function to(t){const e=t.parent,s=e?.node;if(!s||!t.node){yo(t,t.parent);return}let r=null;const n=Object.keys(e),o=n.indexOf(t.key);for(let i=o+1;i<n.length;i++){const a=e[n[i]];if(a?.node?.parentNode===s){r=a.node;break}}r?s.insertBefore(t.node,r):s.appendChild(t.node)}function oo(t,e,s){const r=L(t,t.ifDeps,s),n=w(()=>{let o;try{o=r(t,t.state,t.context)}catch(a){if(o=!1,e.__ifError=a,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,a?.message||a)}return}const i=e.__if;if(e.__if=!!o,i&&!e.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(a){console.error("[smbls] onRemove error:",a)}}else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=kt(t)),t.node&&(t.node.ref=t),to(t),Pt(t),N("Render",t,{}),wt(t,{});else{if(e.__ifInitialized=!0,t.tag||(t.tag=Bt(t)),N("Init",t,{}),t.node||(t.node=kt(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"&&!e.__fragmentAnchor){const c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),e.__fragmentAnchor=c}N("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),lo(t,{}),mt(t,{skipIfEffect:!0}),Pt(t),ao(t),po(t,{}),to(t),N("Create",t,{}),N("Complete",t,{}),N("Render",t,{}),N("RenderRouter",t,{}),wt(t,{})}},{depth:e.path.length,label:j(e,"if")});e.__effects.push(n)}function lt(t,e){const s=t.node;if(!s)return;const r=e==null||typeof e=="object"?"":String(e);if(t.tag==="string"){s.nodeValue!==r&&(s.nodeValue=r);return}const n=t.__ref;let o=n?n.__textNode:null;if(o&&o.parentNode!==s&&(o=null),!o){const i=s.firstChild;i&&i.nodeType===3&&(o=i)}o?o.nodeValue!==r&&(o.nodeValue=r):s.firstChild?(o=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(r),s.insertBefore(o,s.firstChild)):(s.textContent=r,o=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),n&&(n.__textNode=o||null)}function Pt(t){const{node:e}=t;if(e){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&lt(t,t.text),Jo(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){const s=String(t.value);e.value!==s&&(e.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const r in t.style)if(typeof t.style[r]=="function"){s={};for(const n in t.style)typeof t.style[n]!="function"&&(s[n]=t.style[n]);break}Z(e,s)}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const r=t.attr[s];typeof r=="function"||typeof r=="object"||r!=null&&(r===!1&&!et(s)||e.setAttribute&&e.setAttribute(s,H(s,r)))}if(t.data&&typeof t.data=="object")for(const s in t.data){const r=t.data[s];typeof r=="function"||typeof r=="object"||r==null||r===!1||e.dataset&&(e.dataset[s]=r===!0?"":r)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(r=>r&&e.classList.add(r));else if(typeof s=="object")for(const r in s){const n=typeof s[r]=="function"?s[r](t,t.state,t.context):s[r];n&&e.classList.add(typeof n=="string"?n:r)}}}}function pt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Ho(t){if(!t||typeof t!="object")return!1;for(const e in t){const s=t[e];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function yt(t,e){if(!t||!t.style||!e)return null;const s=[];for(const r in e){if(e[r]==null||r.charAt(0)==="&")continue;const o=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.push(o,t.style.getPropertyValue(o),t.style.getPropertyPriority(o))}return s}function ht(t,e){if(!e||!t||!t.style)return!1;for(let s=0;s<e.length;s+=3)if(t.style.getPropertyValue(e[s])!==e[s+1]||t.style.getPropertyPriority(e[s])!==e[s+2])return!1;return!0}const Tt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function Z(t,e){if(!t||!e||!t.style)return;let s=null;for(const r in e){const n=e[r];if(n!=null){if(r.charAt(0)==="&"&&typeof n=="object"){s||(s={}),s[r]=n;continue}try{const o=String(n),i=Tt(r)?r:r.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),a=o.trim(),c=/\s*!important\s*$/.test(a),u=a.replace(/\s*!important\s*$/,"");t.style.setProperty(i,u,c?"important":"")}catch{}}}s&&Wo(t,s)}function Wo(t,e){const s=`_ds${qt.scopedStyleId++}`;t.classList.add(s);const r=t.ownerDocument;let n=r.querySelector("style[data-smbls-scoped]");n||(n=r.createElement("style"),n.setAttribute("data-smbls-scoped",""),r.head.appendChild(n));let o="";for(const i in e){const a="."+s,c=i.replace(/&/g,a).split(",").map(d=>{const f=d.trim();return f.includes(a)?f:a+f}).join(", "),u=e[i];if(typeof u=="object"){let d="",f="";for(const l in u){const y=u[l];if(typeof y=="object"){const g=l.includes("&")?c.split(", ").map(p=>l.replace(/&/g,p)).join(", "):c.split(", ").map(p=>`${p} ${l}`).join(", ");let _="";for(const p in y)_+=`${p.replace(/[A-Z]/g,h=>"-"+h.toLowerCase())}: ${y[p]};`;f+=Yt(`${g} { ${_} }`,g)+`
5
- `}else d+=`${l.replace(/[A-Z]/g,g=>"-"+g.toLowerCase())}: ${y};`}d&&(o+=Yt(`${c} { ${d} }`,c)+`
6
- `),f&&(o+=f)}}o&&(n.textContent+=o)}const so=new Set;function eo(t){if(!Array.isArray(t))return"";const e=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&e.push(t[s]);return e.sort(),e.join("|")}function zo(t,e,s){const r=eo(s);queueMicrotask(()=>{if(!t.__ref)return;let n;try{n=e(t,t.state,t.context)}catch{return}if(eo(n)===r)return;const o=t.__ref.path?t.__ref.path.join("."):t.key||"?";so.has(o)||(so.add(o),console.warn(`[smbls] subscribeTo function at "${o}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(n)?n.join(", "):String(n)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Yo(t){const e=t.subscribeTo,s=typeof e=="function";let r=e;if(s)try{r=e(t,t.state,t.context)}catch{r=null}if(s&&tt()&&zo(t,e,Array.isArray(r)?r:[]),!Array.isArray(r)||r.length===0)return;const n=t.__ref;for(let o=0;o<r.length;o++){const i=r[o];if(typeof i!="string"||i.length===0)continue;const a=i.split("."),c=a[0],u=a.slice(1),d={value:!1},f=w(()=>{const l=t.state&&(K(t.state)?t.state.root:null);if(!l||!K(l))return;let y=l;y=y[c];for(let _=0;_<u.length&&!(y==null||typeof y!="object");_++)if(K(y))y=y[u[_]];else break;if(!d.value)return;let g=!1;if(typeof t.onBeforeUpdate=="function"){const _=t.context?.designSystem;_&&R(_);try{if(ss(n)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>gt(n,!1),h=>{gt(n,!0),t.context?.plugins?.length&&B("error",t,{hook:"onBeforeUpdate",error:h})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",h)}):(gt(n,!1),p===!1&&(g=!0))}}catch(p){gt(n,!0),t.context?.plugins?.length&&B("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}finally{_&&M()}}if(!g&&t.node&&n.__effects)for(let _=0;_<n.__effects.length;_++){const p=n.__effects[_];p&&p!==f&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}if(!g&&typeof t.onUpdate=="function"){const _=t.context?.designSystem;_&&R(_);try{t.onUpdate(t,t.state,t.context)}catch(p){t.context?.plugins?.length&&B("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}finally{_&&M()}}},{depth:n.path.length,label:j(n,"subscribeTo("+i+")")});d.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function Dt(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}function Lt(t,e){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=e.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const no=new Set;function qo(t,e){const s=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",r=s+"::"+t;no.has(r)||(no.add(r),console.warn(`[smbls/css] "${t}" at ${s} 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 Q(t,e,s){const r={},n=new Set,o=(i,a,c)=>{const u=c?new Set(Object.keys(r)):null;if(D[i]){const d=D[i](a,e,e.state,e.context);if(d){const f=Array.isArray(d)?d:[d];for(const l of f)l&&Object.assign(r,l)}}else r[i]=a;if(c)for(const d in r)u.has(d)||n.add(d)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let a=t[i];if(typeof a=="function"&&(a=a(e,e.state,e.context)),a==null||typeof a=="function")continue;if(typeof a=="object"&&!Array.isArray(a)){if(i==="style"){for(const f in a){let l=a[f];if(typeof l=="function"&&(l=l(e,e.state,e.context)),l==null||typeof l=="function")continue;const y=typeof e[f]=="function"&&(D[f]||P&&P.has(f));o(f,l,y)}continue}if(Dt(i,e)){const f=Q(a,e,!1);Object.keys(f).length&&(r[`[data-theme="${i.slice(1)}"] &`]=f);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){tt()&&qo(i,e);continue}const u=Lt(i,e),d=Q(a,e,!1);Object.keys(d).length&&(r[u]=d);continue}const c=typeof e[i]=="function"&&(D[i]||P&&P.has(i));o(i,a,c)}if(s)for(const i in r)n.add(i);for(const i of n){const a=r[i];typeof a=="string"&&!a.includes("!important")&&(r[i]=a+" !important")}return r}function Ot(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&Ot(t[s],e+1))return!0}return!1}function ro(t,e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Dt(t,s)){const o=Q(e,s,!1);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}const r=Lt(t,s),n=Q(e,s,!1);return Object.keys(n).length?{cssProp:r,block:n}:null}function Zo(t){const e=t.__ref;for(const s of Object.keys(t)){if(!jt(s))continue;const r=t[s];if(!r||typeof r!="object"||Array.isArray(r)||!Ot(r))continue;let n=null,o;const i=w(()=>{if(!t.node)return;const a=t.context?.designSystem;a&&R(a);let c,u=!1;try{const d=ro(s,r,t),f=d?pt(d.block)+"::"+d.cssProp:null;if(f!==null&&f===o)u=!0;else if(o=f,d){const l=st({[d.cssProp]:d.block},null,t.context?.cssPrefix);c=l?l.split(" ").filter(Boolean):null}else c=null}finally{a&&M()}if(!(u||!t.node.classList)){if(n)for(const d of n)t.node.classList.remove(d);if(c&&c.length)for(const d of c)t.node.classList.add(d);n=c}},{depth:e.path.length,label:j(e,"cssBlock("+s+")")});e.__effects.push(i)}}function Qo(t){const e=t.__ref;e.__conditionalRunners=[];const s=new Map;for(const r of Object.keys(t)){const n=r.charAt(0);if(n!=="."&&n!=="!")continue;const o=r.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){const y=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${n}\` is read as one prop name. Nest the selector inside instead: \`${n}${y}: { '${o.slice(y.length)}': {...} }\`.`)}continue}const i=t[r];if(!i||typeof i!="object")continue;const a=n==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null},u=()=>{let y;const g=t[o];if(g===void 0){const h=!!t.state&&o in t.state,b=t.state?t.state[o]:void 0;if(h||b!==void 0)y=b;else{const x=t.context?.cases?.[o];if(x===void 0)return;try{y=typeof x=="function"?x.call(t,t):x}catch(C){y=!1,e.__conditionalError=C,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,C?.message||C)}}}else if(typeof g=="function")try{y=g(t,t.state,t.context)}catch(h){y=!1,e.__conditionalError=h,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,h?.message||h)}else y=g;const _=a?!y:!!y;if(!t.node||_===c.lastMatch)return;c.lastMatch=_;const p=t.context?.designSystem;p&&R(p);try{if(_){const h={},b={};let x=!1;for(const A in i){if(!Object.prototype.hasOwnProperty.call(i,A))continue;const v=i[A],G=A.charAt(0);if((G===":"||G==="@"||G==="&"||G==="[")&&v&&typeof v=="object"&&!Array.isArray(v)){if(Dt(A,t)){const E=Q(v,t,!1);Object.keys(E).length&&(b[`[data-theme="${A.slice(1)}"] &`]=E,x=!0)}else{const E=Lt(A,t),T=Q(v,t,!1);Object.keys(T).length&&(b[E]=T,x=!0)}continue}const Y=typeof v=="function"?v(t,t.state,t.context):v;if(Y!=null)if(D[A]){const E=D[A](Y,t,t.state,t.context);if(E){const T=Array.isArray(E)?E:[E];for(const X of T)X&&Object.assign(h,X)}}else(P&&P.has(A)||Tt(A))&&(h[A]=Y)}const C=Object.keys(h);if(C.length){Z(t.node,h);for(const A of C)s.set(A,r);c.appliedKeys=C}else c.appliedKeys=null;if(x){const A=st(b,null,t.context?.cssPrefix),v=A?A.split(" ").filter(Boolean):[];if(v.length&&t.node.classList){for(const G of v)t.node.classList.add(G);c.appliedClasses=v}else c.appliedClasses=null}else if(c.appliedClasses){for(const A of c.appliedClasses)t.node.classList.remove(A);c.appliedClasses=null}}else{if(c.appliedKeys){for(const h of c.appliedKeys)s.get(h)===r&&(Tt(h)?t.node.style.removeProperty(h):t.node.style[h]="",s.delete(h));c.appliedKeys=null}if(c.appliedClasses){for(const h of c.appliedClasses)t.node.classList.remove(h);c.appliedClasses=null}}}finally{p&&M()}};e.__conditionalRunners.push(u);const d=L(t,t[o+"Deps"],u),f=w(d,{depth:e.path.length,label:j(e,"conditional("+r+")")}),l=e.__exec&&e.__exec[o]||t[o];f._sources.size===0&&typeof l=="function"&&tt()&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${o}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),e.__effects.push(f)}}const Rt=new WeakSet;function Xo(t){const e=t.ownerDocument;!e||Rt.has(e)||(Rt.add(e),queueMicrotask(()=>{Rt.delete(e);const s=e.body||e.documentElement;s&&s.offsetWidth}))}const Mt=new WeakSet;let io=!1;function co(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Nt(t,e){const s={...t};for(const r in e){const n=e[r],o=s[r];s[r]=n&&typeof n=="object"&&o&&typeof o=="object"?Nt(o,n):n}return s}function fo(t,e){const s={};for(const r in t){const n=t[r];if(n&&typeof n=="object"){const o=fo(n,e);Object.keys(o).length&&(s[r]=o)}else e.has(r)||(s[r]=n)}return s}function Jo(t){const{node:e}=t;if(!e)return;if(io||(io=!0,st({display:"none"})),Mt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Mt.add(t);const s=t.context?.designSystem;s&&R(s),Wt();try{const r={};let n=!1,o=null,i=null,a=null;const c=(u,d)=>{if(d&&typeof d=="object"&&co(u)){i||(i={});const f=i[u];f&&(d=Nt(f,d)),i[u]=d}else(d===null||typeof d!="object")&&(a||(a=new Set),a.add(u));r[u]=d};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&D.theme){const u=D.theme(t.theme,t,t.state,t.context);if(u){const d=f=>{for(const l in f){const y=f[l];y&&typeof y=="object"&&co(l)&&(o||(o={}),o[l]=y),r[l]=y}};if(Array.isArray(u))for(const f of u)f&&d(f);else d(u);n=!0}}for(const u of Object.keys(t)){if(typeof t[u]=="function"||V.has(u)||u==="theme")continue;const d=u.charCodeAt(0);if(!(d>=65&&d<=90)&&!W(u)){if(D[u]){const f=t[u],l=D[u](f,t,t.state,t.context);if(l){if(Array.isArray(l)){for(const y of l)if(y)for(const g in y)c(g,y[g])}else for(const y in l)c(y,l[y]);n=!0}}else if(P&&P.has(u)){const f=t[u];f!=null&&typeof f!="object"&&(c(u,f),n=!0)}else if(u.charCodeAt(0)===45){const f=t[u];f!=null&&typeof f!="object"&&(c(u,f),n=!0)}else if(u.charAt(0)==="&"||u.charAt(0)==="@"||u.charAt(0)===":"||u.charAt(0)==="["){const f=t[u];if(f&&typeof f=="object"&&!Array.isArray(f)){if(Ot(f))continue;const l=ro(u,f,t);l&&(c(l.cssProp,l.block),n=!0)}}}}if(o)for(const u in o){let d=a?fo(o[u],a):o[u];i&&i[u]&&(d=Nt(d,i[u])),Object.keys(d).length?r[u]=d:delete r[u]}if(n){r.display&&String(r.display).includes("!important")&&(e.style.setProperty("display",String(r.display).replace(/\s*!important\s*$/,""),"important"),delete r.display);const u=st(r,null,t.context?.cssPrefix);if(u&&e.classList){const f=u.split(" ").filter(Boolean);let l=!1;for(const y of f)e.classList.add(y),l||(y.charCodeAt(0)===95&&y.charCodeAt(1)===99||y.charCodeAt(0)===95&&y.indexOf("_c",1)!==-1)&&(l=!0);l&&Xo(e)}const d=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(d!=null){const f=r.display;if(f&&f!==d)if(d==="none"){const l=[];for(const y of e.classList)y.startsWith("_d-")&&y!=="_d-none"&&l.push(y);for(const y of l)e.classList.remove(y);e.classList.add("_d-none")}else e.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(e.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}}finally{zt(),s&&M(),Mt.delete(t)}}function ao(t){const{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const o=t.aria[n];if(typeof o=="function"||typeof o=="object"||o==null)continue;const i="aria-"+n.replace(/[A-Z]/g,a=>"-"+a.toLowerCase());e.setAttribute(i,H(i,o))}const s=Po(t);for(const n in s){const o=s[n];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&e.setAttribute(n,o===!0?"":o)}const r=t.tag||"div";for(const n of Object.keys(t)){if(typeof t[n]=="function"||V.has(n)||n==="on"||s[n]!==void 0)continue;const o=n.charCodeAt(0);if(!(o>=65&&o<=90)&&!W(n)&&!(D[n]||P&&P.has(n))&&ut(r,n)){let i=t[n];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=at(i,t,t.state,t.context),t[n]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!et(dt(n)||n))continue;const a=dt(n)||n;e.setAttribute(a,H(a,i))}}}function js(t,e){const{node:s}=t;if(!s||!s.setAttribute)return;const r=e.charCodeAt(0);if(r>=65&&r<=90||W(e)||D[e]||P&&P.has(e)||!ut(t.tag||"div",e))return;const n=dt(e)||e,o=n.toLowerCase(),i=t.__ref&&t.__ref.__effects;let a=!1;if(i)for(let d=0;d<i.length;d++){const f=i[d];f&&f._attrName===o&&!f._disposed&&typeof f._execute=="function"&&(a=!0,f._execute())}if(a)return;let c=t[e];const u=To[e];if(u&&c!=null){const d=u(t);d!==void 0&&(c=d)}typeof c=="string"&&c.includes("{{")&&(c=at(c,t,t.state,t.context)),c==null||c===!1&&!et(n)?s.removeAttribute(n):typeof c!="function"&&typeof c!="object"&&s.setAttribute(n,H(n,c))}function mo(t,e){const s=t.node,r=t.__ref;let n=r.__autoGrow;if(!e){if(n&&n.active){try{s.removeEventListener("input",n.resize)}catch{}s.style.height="",n.appliedMax!=null&&s.style.maxHeight===n.appliedMax&&(s.style.maxHeight=""),n.active=!1,n.appliedMax=null,n.lastMeasure=0}return}n||(n=r.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(s.scrollHeight===0&&n.lastMeasure>0)return;s.style.height="auto";const i=s.scrollHeight;s.style.height=i+"px",i>0&&(n.lastMeasure=i)}},r.__eventCleanup||(r.__eventCleanup=[]),r.__eventCleanup.push(()=>{try{s.removeEventListener("input",n.resize)}catch{}})),n.active||(s.addEventListener("input",n.resize),n.active=!0);const o=typeof e=="object"&&e.max!=null?String(e.max):null;o!==n.appliedMax&&(o==null?n.appliedMax!=null&&s.style.maxHeight===n.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=o,n.appliedMax=o),n.resize()}function ts(t){if(!t.autoGrow)return;const e=t.node;if(!e||e.tagName!=="TEXTAREA")return;const s=t.__ref,r=t.autoGrow,n=typeof r=="function"?L(t,t.autoGrowDeps,r):null,o=w(()=>{const i=t.autoGrow;let a=i;if(typeof i=="function")try{a=(i===r&&n?n:i)(t,t.state,t.context)}catch{a=null}mo(t,a)},{depth:s.path.length,label:j(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(o),n&&(s.__exec.autoGrow=r)}const uo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function lo(t,e){for(const s of Object.keys(t)){if(!W(s)||uo.has(s))continue;const r=So(s);if(r){ko(r,t,t[s]);continue}let n=t[s];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){const i=n;n=function(c){return t.call(i,c)}}if(typeof n!="function")continue;const o=$o(s);Ao.has(o)||Co(Fo(o),t,n)}os(t)}function os(t){const e=t.node;if(!e||!e.addEventListener)return;const s={};let r=!1;for(const l of uo){const y=t[l];typeof y=="function"&&(s[l]=y,r=!0)}if(!r)return;const n=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let i=0,a=0,c=0,u=!1;const d=l=>{const y=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];y&&(i=y.clientX,a=y.clientY,c=Date.now(),u=!0)},f=l=>{if(!u)return;u=!1;const y=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!y)return;const g=y.clientX-i,_=y.clientY-a,p=Date.now()-c;if(p>o)return;const h=Math.abs(g),b=Math.abs(_);if(Math.max(h,b)<n)return;let x;if(h>b*1.2)x=g<0?"left":"right";else if(b>h*1.2)x=_<0?"up":"down";else return;const C="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),A=s[C],v=s.onSwipe;A&&A.call(t,l,t,t.state,t.context),v&&v.call(t,{direction:x,dx:g,dy:_,dt:p,event:l},t,t.state,t.context)};e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",d)}catch{}try{e.removeEventListener("touchend",f)}catch{}})}function ct(t,e){const s={...t};for(const r in e){const n=s[r],o=e[r];n&&o&&typeof n=="object"&&typeof o=="object"&&!Array.isArray(n)&&!Array.isArray(o)&&typeof n!="function"&&typeof o!="function"?s[r]=ct(n,o):s[r]=o}return s}function $t(t,e,s,r){if(!e||!t.node)return;const n=t.childExtends;if(Array.isArray(e)){const o=t.tag==="fragment",i=t.context?.document||globalThis.document,a=o?null:i?.createDocumentFragment();if(!o&&!a)return;const c=t.childProps,u=t.childrenAs,d=p=>{let h=e[p];const b=h;(typeof h=="string"||typeof h=="number")&&(h={text:h});let x=c;if(typeof c=="function")try{x=c(t,h)}catch{x=null}if(u==="state"){let A=b;(typeof b=="string"||typeof b=="number")&&(A={value:b,text:b}),h=x?{...x,state:A}:{state:A}}else x&&(h=ct(x,h));if(n&&!h.ignoreChildExtends)if(h.extends){const A=Array.isArray(h.extends)?h.extends:[h.extends],v=Array.isArray(n)?n:[n];h={...h,extends:[...v,...A]}}else h={...h,extends:n};const C=h?.key||b&&typeof b=="object"&&b.key||`${p}`;try{return z(h,t,C,s)}catch(A){if(typeof console<"u"&&console.error){const v=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${v} (initial render, skipping this row):`,A?.message||A)}return null}},f=t.__ref;if(!(r===!0&&!o&&!!f&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let p=0;p<e.length;p++){const h=d(p);!o&&h?.node&&a.appendChild(h.node)}return o||t.node.appendChild(a),!0}const y=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;Vt();let g=null;const _=p=>{if(f.__disposed||f.__childrenChunkGen!==y){g&&g.parentNode&&g.remove();return}for(let h=p;h<e.length;h++){const b=d(h);if(b?.node&&(g?t.node.insertBefore(b.node,g):a.appendChild(b.node)),h+1<e.length&&Kt()){g||(g=i.createComment("smbls-mount"),a.appendChild(g),t.node.appendChild(a));const x=h+1;Ht(()=>_(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&_t(t,!0)):t.node.appendChild(a)};return _(0),Gt(),!0}if(typeof e=="string"){const o=Jt(e,t);if(Array.isArray(o))return $t(t,o,s,r)}if(typeof e=="object")for(const o in e){if(V.has(o))continue;let i=e[o];if(!(i==null||i===!1)){if((typeof i=="string"||typeof i=="number")&&(i={text:i}),t.childProps&&(i=ct(t.childProps,i)),n&&!i.ignoreChildExtends)if(i.extends){const a=Array.isArray(i.extends)?i.extends:[i.extends],c=Array.isArray(n)?n:[n];i={...i,extends:[...c,...a]}}else i={...i,extends:n};z(i,t,o,s)}}}function _t(t,e){const s=t.node;if(!s||s.tagName!=="SELECT")return;const r=s.options;if(!r||!r.length)return;const n=t.__ref,o=n&&n.__exec&&n.__exec.value,i=typeof o=="function",a=t.value!=null&&typeof t.value!="function";if(i||a){let d;if(i)try{d=o(t,t.state,t.context)}catch{return}else d=t.value;const f=d==null?"":String(d);s.value!==f&&(s.value=f);return}const c=e||!(n&&n.__selectSynced);if(n&&(n.__selectSynced=!0),!c)return;let u=-1;for(let d=0;d<r.length;d++)r[d].defaultSelected&&(u=d);u>=0&&s.selectedIndex!==u&&(s.selectedIndex=u)}function po(t,e){let{children:s,content:r}=t;const n=t.childExtends;if(typeof s=="function"){const f=s;try{s=f(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const h=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${h} (initial run, treating as empty):`,p?.message||p)}}t.children=s;const l=t.__ref;let y=!1;const g=L(t,t.childrenDeps,f),_=w(()=>{const p=y;y=!0;let h;try{h=g(t,t.state,t.context)}catch(E){if(typeof console<"u"&&console.error){const T=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${T}${p?"":" (initial tracking run)"}:`,E?.message||E)}return}if(!p||h===t.children)return;t.children=h,l.__childrenChunkGen!=null&&l.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",x=b?[]:null,C=b?[]:null,A=b?[]:null;if(Array.isArray(h)&&t.childrenAs==="state"){const E=t.childProps,T=[],X=new Map;for(let k=0;k<h.length;k++){const $=h[k];let S=E;if(typeof E=="function")try{S=E(t,$)}catch{S=null}const U=S&&S.key||$&&$.key||`${k}`;T.push(U),X.set(U,{rawChild:$,childProps:S})}const ho=new Set(T),_o=l.__children.slice();for(const k of _o)if(!ho.has(k)){const $=t[k];$?.remove&&$.remove(),delete t[k],C&&C.push(k)}const J=t.childExtends,ft=t.tag==="fragment",go=t.context?.document||globalThis.document,m=ft?null:go?.createDocumentFragment(),bt=new Set;for(const k of T){const $=X.get(k),S=$.rawChild,U=t[k];if(U&&U.state){if(S&&typeof S=="object"){const O=U.state,q=O.$replace||O.replace,Ut=O.$update||O.update;try{if(typeof q=="function")q.call(O,S);else if(typeof Ut=="function"){for(const F in O)if(!(F==="__element"||F==="root"||F==="parent"||F==="update")&&!Object.prototype.hasOwnProperty.call(S,F))try{O[F]=void 0}catch{}Ut.call(O,S)}else for(const F in S)O[F]=S[F]}catch(F){if(typeof console<"u"&&console.error){const bo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to patch at ${bo} (reconcile, keeping its previous data for this pass):`,F?.message||F)}}}A&&A.push(k);continue}let xt=S;(typeof S=="string"||typeof S=="number")&&(xt={value:S,text:S});const It=$.childProps;let I=It?{...It,state:xt}:{state:xt};if(J&&!I.ignoreChildExtends)if(I.extends){const O=Array.isArray(I.extends)?I.extends:[I.extends],q=Array.isArray(J)?J:[J];I={...I,extends:[...q,...O]}}else I={...I,extends:J};let At;try{At=z(I,t,k,e)}catch(O){if(typeof console<"u"&&console.error){const q=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${q} (reconcile, skipping this row):`,O?.message||O)}bt.add(k);continue}!ft&&At?.node&&m&&m.appendChild(At.node),x&&x.push(k)}if(!ft&&m&&m.childNodes.length&&t.node&&t.node.appendChild(m),!ft&&t.node){let k=null;for(const $ of T){const S=t[$]?.node;if(!S)continue;const U=k?k.nextSibling:t.node.firstChild;S!==U&&t.node.insertBefore(S,U),k=S}}l.__children=bt.size?T.filter(k=>!bt.has(k)):T,b&&(x.length||C.length)&&Xt(t,{added:x,removed:C,kept:A}),_t(t,!1);return}const Y=b?[...l.__children]:null;for(const E of[...l.__children]){const T=t[E];T?.remove&&T.remove(),delete t[E]}l.__children=[],$t(t,h,e),_t(t,!1),b&&Xt(t,{added:[...l.__children],removed:Y,kept:[]})},{depth:l.path.length,label:j(l,"children")});l.__effects.push(_)}const o=$t(t,s,e,!0);if(r!=null&&!(r&&r.__ref)){let f=r;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=ct(t.childProps,f)),n&&!f.ignoreChildExtends)if(f.extends){const l=Array.isArray(f.extends)?f.extends:[f.extends],y=Array.isArray(n)?n:[n];f={...f,extends:[...y,...l]}}else f={...f,extends:n};z(f,t,"content",e)}if(s&&!o)return;const i=t.context?.components||{};{const f=Object.keys(t);for(let l=0;l<f.length;l++){const y=f[l];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const g=y.slice(0,-7);if(!g||g.charCodeAt(0)<65||g.charCodeAt(0)>90)continue;const _={extends:t[y]};delete t[y];for(let p=l+1;p<f.length;p++){const h=f[p],b=h.charCodeAt(0);if(b>=65&&b<=90||V.has(h)||typeof t[h]=="function"&&(h.startsWith("on")||h.startsWith(".")))break;const x=t[h];x!==void 0&&(_[h]=x,delete t[h])}t[g]&&typeof t[g]=="object"?t[g]={..._,...t[g]}:t[g]=_}}const a=e?.mountYield===!0||t.yieldChildren===!0,c=Object.keys(t),u=f=>{if(V.has(f)||typeof t[f]!="object"||t[f]===null)return;const l=f.charCodeAt(0);if(l<65||l>90)return;let y=t[f];if(!y.__ref){if(!y.extends&&!y.extend){const g=i[f]||i[`smbls.${f}`];g&&(y={...y,extends:g})}if(t.childProps&&(y=ct(t.childProps,y)),n&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],_=Array.isArray(n)?n:[n];y={...y,extends:[..._,...g]}}else y={...y,extends:n};z(y,t,f,e)}};if(!a){for(const f of c)u(f);return}Vt();const d=f=>{for(let l=f;l<c.length;l++)if(u(c[l]),l+1<c.length&&Kt()){const y=l+1;Ht(()=>d(y));return}};d(0),Gt()}function yo(t,e,s){const{node:r}=t;if(!r)return;r.ref=t;const n=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(n){const i=n.parentNode;if(i){if(s?.position==="before"&&s.node)i.insertBefore(r,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;i.insertBefore(r,a||n)}else i.insertBefore(r,n);return}}const o=e?.node||(e?.nodeType?e:null);if(o)if(s?.position==="before"&&s.node)o.insertBefore(r,s.node);else if(s?.position==="after"&&s.node){const i=s.node.nextSibling;i?o.insertBefore(r,i):o.appendChild(r)}else o.appendChild(r)}const Ft=3;function ss(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Ft?!1:(t.__inBeforeUpdate=!0,!0)}function gt(t,e){t&&(t.__inBeforeUpdate=!1,e?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Ft&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Ft}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function N(t,e,s){const r=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&B(r,e,s);const n="on"+t,o=e[n];if(typeof o=="function"){const c=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(c){if(e.__ref[c])return!0;e.__ref[c]=!0}const u=e.context?.designSystem;u&&R(u);let d=!!c;try{const f=o(e,e.state,e.context,s);if(f&&typeof f.then=="function"){const l=e.__ref;return f.catch(y=>{e.context?.plugins?.length&&B("error",e,{hook:n,error:y})||console.error(`[DOMQL] Lifecycle "${n}" error:`,y)}).finally(()=>{c&&l&&(l[c]=!1)}),d=!1,!0}if(f===!1)return!1}catch(f){if(e.context?.plugins?.length&&B("error",e,{hook:n,error:f})||console.error(`[DOMQL] Lifecycle "${n}" error:`,f),e.context?.strictMode)throw f}finally{u&&M(),d&&e.__ref&&(e.__ref[c]=!1)}}return!0}var Es=z;export{Ft as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,ss as acquireBeforeUpdateGuard,z as create,Es as default,vt as flushMounts,js as reconcileAttrProp,gt as releaseBeforeUpdateGuard,lt as writeElementText};
4
+ `):"")}}if(bt(o,!0),vo(o,e,r),typeof o.html=="function"&&o.node&&!o.node.innerHTML){const h=o.context?.designSystem;h&&N(h);try{const p=o.html(o,o.state,o.context);p!=null&&typeof p!="function"&&(o.node.innerHTML=p)}catch{}finally{h&&R()}}if(M("Create",o,n),M("Complete",o,n),M("Render",o,n),M("RenderRouter",o,n),Pt(o,n),typeof o.onFrame=="function"){const h=o.onFrame,p=o.context?.designSystem,x=()=>{if(o.node){if(o.node.isConnected){p&&N(p);try{h(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{p&&R()}}requestAnimationFrame(x)}};requestAnimationFrame(x)}return o}function Wo(t,e,s){const n=!e,r=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,f=n&&r&&t.context?.state,o=s.state!==void 0&&!f?s.state:t.state&&!W(t.state)?t.state:void 0;if(o==null){if(e?.state)t.state=e.state,et(t,t.state);else if(t.context?.state){const c=t.context.state,u={...c},a=t.context?.polyglot;if(a?.translations){const d=t.context,i=c.lang||a.defaultLang||"en",l=new Set,y=(h,p)=>{l.has(h)||Ro(d,h,u)&&(u[h]=p,l.add(h),Mo(d,h))},_=a.translations[i];if(_&&typeof _=="object")for(const h in _)y(h,_[h]);const g=new Set(a.languages||[]);for(const h in a.translations)g.has(h)||y(h,a.translations[h])}t.state=W(u)?u:St(u),t.state.__element=t,t.state.root=t.state,et(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),et(t,t.state);return}if(typeof o=="string"){if(t.state=so(o,e),t.state&&typeof t.state=="object"&&!W(t.state)){const c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}et(t,t.state);return}if(typeof o=="function"){const c=o(t,e?.state);t.state=W(c)?c:St(c||{})}else W(o)?t.state=o:t.state=St({...o});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,et(t,t.state)}function Lt(t,e){if(!e)return t;const s=e.split("/");let n=t;for(const r of s){if(n==null)return{};n=n[r]}return n??{}}function so(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?Lt(e.state,r):e.state??{}}if(t.startsWith("~/")){const r=e.state?.root||e.state,f=t.slice(2);return f?Lt(r,f):r??{}}if(e.state?.[t]!==void 0)return e.state[t];const s=Lt(e.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=e.context?.polyglot;if(n?.translations){const r=e.state?.root?.lang||n.defaultLang||"en",f=n.translations[r];if(f?.[t]!==void 0)return f[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const zo=new Set(["s","state","ctx","context"]);function Yo(t){try{const s=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function Zo(t){if(typeof t!="function"||t.length!==2)return!1;const e=Yo(t);if(e.length<2)return!1;const s=e[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!zo.has(s)}function qo(t){const e=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],f=Object.keys(t);for(let o=0;o<f.length;o++){const c=f[o];if(typeof t[c]!="function"||G.has(c))continue;const u=c.charCodeAt(0);u>=65&&u<=90||z(c)||T[c]||E&&E.has(c)||rt(s,c)||(X()&&Zo(t[c])&&console.warn(`[smbls] custom prop "${c}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${c}', \u2026) instead of reading el.${c}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:c,fn:t[c]}))}for(let o=0;o<r.length;o++){const{prop:c,fn:u}=r[o];e.__exec[c]=u,Object.defineProperty(t,c,{get(){n&&N(n);try{return u(t,t.state,t.context)}catch{return}finally{n&&R()}},set(a){delete e.__exec[c],Object.defineProperty(t,c,{value:a,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Qo(t,e){if(!(!Array.isArray(e)||e.length===0))for(let s=0;s<e.length;s++){const n=e[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function D(t,e,s){return!Array.isArray(e)||e.length===0?s:function(...n){return Qo(t,e),s.apply(this,n)}}function ut(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function v(t,e){return()=>t.path.join(".")+"::"+e}const eo=new Set;function F(t,e,s){if(!X())return;const n=v(t,e)();eo.has(n)||(eo.add(n),console.warn(`[smbls] "${e}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}function no(t,e){const s=t.__ref,n=!!(e&&e.skipIfEffect);if(qo(t),typeof t.text=="function"){const o=t.text,c=D(t,t.textDeps,o),u=S(()=>{if(!s.contentManaged)try{let a=c(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=$.call(t,a,t.state)),yt(t,a))}catch(a){F(s,"text",a)}},{depth:s.path.length,label:v(s,"text")});s.__effects.push(u),s.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){const o=t.text,c=S(()=>{if(s.contentManaged)return;const u=$.call(t,o,t.state);u!=null&&(t.text=u),t.node&&yt(t,u??"")},{depth:s.path.length,label:v(s,"text")});s.__effects.push(c),s.__exec.text=o}for(const o of Object.keys(t))if(typeof t[o]=="function"&&!G.has(o)&&!z(o)&&!s.__exec[o]){if(T[o]){const c=t[o],u=D(t,t[o+"Deps"],c),a=o;let d,i=null,l=null,y;const _=S(()=>{const g=t.context?.designSystem;g&&N(g);try{const h=u(t,t.state,t.context);Zt();let p;try{p=T[a](h,t,t.state,t.context)}finally{qt()}if(Array.isArray(p)){const b={};for(const C of p)if(C)for(const A in C)b[A]=C[A];p=b}const x=a==="show"||a==="hide";if(p&&t.node&&Xo(p)){const b=ht(p);if(b===null||b!==y){y=b;const C=nt(p,null,t.context?.cssPrefix),A=C?C.split(" ").filter(Boolean):null;if(t.node.classList){if(l)for(const w of l)t.node.classList.remove(w);if(A&&A.length)for(const w of A)t.node.classList.add(w);l=A}}d=void 0,i=null}else if(p&&t.node){if(l){for(const C of l)t.node.classList.remove(C);l=null,y=void 0}const b=ht(p);(b===null||b!==d||!gt(t.node,i))&&(d=b,J(t.node,p),i=_t(t.node,p))}else if(t.node&&x){d=void 0,i=null;const b=s.__explicitDisplay;t.node.style.display=typeof b=="string"?b:""}}finally{g&&R()}},{depth:s.path.length,label:v(s,a)});s.__effects.push(_),s.__exec[o]=c}else if(E&&E.has(o)){const c=t[o],u=D(t,t[o+"Deps"],c),a=o;let d,i=null;const l=S(()=>{const y=t.context?.designSystem;y&&N(y);try{const _=u(t,t.state,t.context);if(t.node)if(_!=null){const g=a+":"+String(_);if(g!==d||!gt(t.node,i)){d=g;const h={[a]:_};J(t.node,h),i=_t(t.node,h)}}else d=void 0,i=null,t.node.style[a]=""}finally{y&&R()}},{depth:s.path.length,label:v(s,a)});s.__effects.push(l),s.__exec[o]=c}}if(typeof t.html=="function"){const o=t.html,c=D(t,t.htmlDeps,o),u=S(()=>{const a=t.context?.designSystem;a&&N(a);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{a&&R()}},{depth:s.path.length,label:v(s,"html")});s.__effects.push(u),s.__exec.html=o}if(typeof t.value=="function"){const o=t.value,c=D(t,t.valueDeps,o),u=S(()=>{try{let a=c(t,t.state,t.context);typeof a=="string"&&a.includes("{{")&&(a=$.call(t,a,t.state)),co(t,a)}catch(a){F(s,"value",a)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(u),s.__exec.value=o}else if(typeof t.value=="string"&&t.value.includes("{{")){const o=t.value,c=S(()=>{try{co(t,$.call(t,o,t.state))}catch(u){F(s,"value",u)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(c),s.__exec.value=o}if(typeof t.style=="function"){const o=t.style,c=D(t,t.styleDeps,o);let u,a=null;const d=S(()=>{const i=c(t,t.state,t.context),l=ht(i);(l===null||l!==u||!gt(t.node,a))&&(u=l,J(t.node,i),a=_t(t.node,i))},{depth:s.path.length,label:v(s,"style")});s.__effects.push(d),s.__exec.style=o}else if(t.style&&typeof t.style=="object")for(const o in t.style){const c=t.style[o];if(typeof c!="function")continue;const u=D(t,ut(t.styleDeps,o),c);let a,d=null;const i=S(()=>{try{const l=u(t,t.state,t.context);if(t.node){const y=o+":"+String(l);if(y!==a||!gt(t.node,d)){a=y;const _={[o]:l};J(t.node,_),d=_t(t.node,_)}}}catch(l){F(s,"style."+o,l)}},{depth:s.path.length,label:v(s,"style."+o)});s.__effects.push(i)}if(t.attr&&typeof t.attr=="object"){for(const o in t.attr)if(typeof t.attr[o]=="function"){const c=D(t,ut(t.attrDeps,o),t.attr[o]),u=o,a=S(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=$.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!ct(u)?t.node.removeAttribute(u):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(u,K(u,d)))}catch(d){F(s,"attr."+u,d)}},{depth:s.path.length,label:v(s,"attr."+u)});a._attrName=u.toLowerCase(),s.__effects.push(a)}else if(typeof t.attr[o]=="string"&&t.attr[o].includes("{{")){const c=t.attr[o],u=o,a=S(()=>{try{const d=$.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,K(u,d??""))}catch(d){F(s,"attr."+u,d)}},{depth:s.path.length,label:v(s,"attr."+u)});a._attrName=u.toLowerCase(),s.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const o in t.aria){const c=t.aria[o];if(typeof c=="string"&&c.includes("{{")){const i=c,l="aria-"+o.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),y=S(()=>{try{const _=$.call(t,i,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,K(l,_??""))}catch(_){F(s,"aria."+o,_)}},{depth:s.path.length,label:v(s,"aria."+o)});y._attrName=l,s.__effects.push(y);continue}if(typeof c!="function")continue;const u=D(t,ut(t.ariaDeps,o),t.aria[o]),a="aria-"+o.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),d=S(()=>{try{const i=u(t,t.state,t.context);if(!t.node?.setAttribute)return;i==null?t.node.removeAttribute(a):typeof i!="function"&&typeof i!="object"&&t.node.setAttribute(a,K(a,i))}catch(i){F(s,"aria."+o,i)}},{depth:s.path.length,label:v(s,"aria."+o)});d._attrName=a,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const o in t.data){const c=t.data[o];if(typeof c=="string"&&c.includes("{{")){const l=c,y="data-"+o.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),_=S(()=>{try{const g=$.call(t,l,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,g??"")}catch(g){F(s,"data."+o,g)}},{depth:s.path.length,label:v(s,"data."+o)});_._attrName=y,s.__effects.push(_);continue}if(typeof c!="function")continue;const u=D(t,ut(t.dataDeps,o),t.data[o]),d="data-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),i=S(()=>{try{const l=u(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(d):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(d,l===!0?"":l)}catch(l){F(s,"data."+o,l)}},{depth:s.path.length,label:v(s,"data."+o)});i._attrName=d,s.__effects.push(i)}const r=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(r)for(const o in r){if(typeof r[o]!="function")continue;const c=D(t,ut(t.classDeps,o),r[o]),u=S(()=>{try{const a=c(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch(a){F(s,"class."+o,a)}},{depth:s.path.length,label:v(s,"class."+o)});s.__effects.push(u)}!n&&typeof t.if=="function"&&io(t,s,t.if);for(const o of Object.keys(t)){if(G.has(o)||typeof t[o]!="function")continue;const c=o.charCodeAt(0);if(c>=65&&c<=90||z(o))continue;const u=t[o];s.__exec[o]=u;const a=t.tag||"div";if(rt(a,o)&&!T[o]&&!(E&&E.has(o))){const d=it(o)||o,i=D(t,t[o+"Deps"],u),l=S(()=>{try{let y=i(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=$.call(t,y,t.state)),t.node?.setAttribute&&(y==null||y===!1&&!ct(d)?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&(d==="src"&&"src"in t.node?t.node.src=y:t.node.setAttribute(d,K(d,y))))}catch(y){F(s,o,y)}},{depth:s.path.length,label:v(s,o)});l._attrName=d.toLowerCase(),s.__effects.push(l)}}const f=t.tag||"div";for(const o of Object.keys(t)){if(G.has(o))continue;const c=t[o];if(typeof c!="string"||!c.includes("{{"))continue;const u=o.charCodeAt(0);if(u>=65&&u<=90||z(o)||T[o]||E&&E.has(o)||kt[o]||!rt(f,o))continue;const a=it(o)||o,d=S(()=>{try{const i=$.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,K(a,i??""))}catch(i){F(s,o,i)}},{depth:s.path.length,label:v(s,o)});d._attrName=a.toLowerCase(),s.__effects.push(d)}if(ts(t),es(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const o=t.onStateUpdate,c=t.stateDeps;let u=!1,a=[];const d=S(()=>{const i=[];for(let g=0;g<c.length;g++){const h=c[g];try{i[g]=typeof h=="function"?h(t,t.state,t.context):t.state?.[h]}catch{i[g]=void 0}}if(!u){u=!0,a=i;return}let l=i.length!==a.length;for(let g=0;!l&&g<i.length;g++)i[g]!==a[g]&&(l=!0);const y=a;if(a=i,!l)return;const _=t.context?.designSystem;_&&N(_);try{o(t,t.state,t.context,{prev:y,next:i})}catch(g){if(t.context?.plugins?.length&&H("error",t,{hook:"onStateUpdate",error:g})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',g),t.context?.strictMode)throw g}finally{_&&R()}},{depth:s.path.length,label:v(s,"onStateUpdate")});s.__effects.push(d)}ss(t)}function ro(t){const e=t.parent,s=e?.node;if(!s||!t.node){vo(t,t.parent);return}let n=null;const r=Object.keys(e),f=r.indexOf(t.key);for(let o=f+1;o<r.length;o++){const c=e[r[o]];if(c?.node?.parentNode===s){n=c.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function io(t,e,s){const n=D(t,t.ifDeps,s),r=S(()=>{let f;try{f=n(t,t.state,t.context)}catch(c){if(f=!1,e.__ifError=c,typeof console<"u"&&console.warn){const u=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${u} \u2014 treating as false:`,c?.message||c)}return}const o=e.__if;if(e.__if=!!f,o&&!e.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(c){console.error("[smbls] onRemove error:",c)}}else if(!o&&e.__if)if(e.__ifInitialized)t.node||(t.node=wt(t)),t.node&&(t.node.ref=t),ro(t),Dt(t),M("Render",t,{}),Pt(t,{});else{if(e.__ifInitialized=!0,t.tag||(t.tag=Gt(t)),M("Init",t,{}),t.node||(t.node=wt(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"&&!e.__fragmentAnchor){const u=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(u),e.__fragmentAnchor=u}M("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ao(t,{}),no(t,{skipIfEffect:!0}),Dt(t),bo(t),Co(t,{}),ro(t),M("Create",t,{}),M("Complete",t,{}),M("Render",t,{}),M("RenderRouter",t,{}),Pt(t,{})}},{depth:e.path.length,label:v(e,"if")});e.__effects.push(r)}function yt(t,e){const s=t.node;if(!s)return;const n=e==null||typeof e=="object"?"":String(e);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const r=t.__ref;let f=r?r.__textNode:null;if(f&&f.parentNode!==s&&(f=null),!f){const o=s.firstChild;o&&o.nodeType===3&&(f=o)}f?f.nodeValue!==n&&(f.nodeValue=n):s.firstChild?(f=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(f,s.firstChild)):(s.textContent=n,f=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=f||null)}function co(t,e){const s=t.node;if(!s||!("value"in s))return;const n=e==null?"":String(e);if(s.value===n)return;const r=typeof document<"u"&&document.activeElement===s,f=r&&typeof s.selectionStart=="number"?s.selectionStart:null,o=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,r&&f!=null&&o!=null)try{s.setSelectionRange(f,o)}catch{}}function Dt(t){const{node:e}=t;if(e){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&yt(t,t.text),rs(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in e){const s=String(t.value);e.value!==s&&(e.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}J(e,s)}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const n=t.attr[s];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!ct(s)||e.setAttribute&&e.setAttribute(s,K(s,n)))}if(t.data&&typeof t.data=="object")for(const s in t.data){const n=t.data[s];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||e.dataset&&(e.dataset[s]=n===!0?"":n)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof s=="object")for(const n in s){const r=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];r&&e.classList.add(typeof r=="string"?r:n)}}}}function ht(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Xo(t){if(!t||typeof t!="object")return!1;for(const e in t){const s=t[e];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function _t(t,e){if(!t||!t.style||!e)return null;const s=t.style,n=[];for(const r in e){if(e[r]==null||r.charAt(0)==="&")continue;const o=r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());n.push(o,fo(s,o),ao(s,o))}return n}function fo(t,e){return typeof t.getPropertyValue=="function"?t.getPropertyValue(e):""}function ao(t,e){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(e):""}function gt(t,e){if(!e||!t||!t.style)return!1;const s=t.style;for(let n=0;n<e.length;n+=3)if(fo(s,e[n])!==e[n+1]||ao(s,e[n])!==e[n+2])return!1;return!0}const Ot=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function J(t,e){if(!t||!e||!t.style)return;let s=null;for(const n in e){const r=e[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[n]=r;continue}try{const f=String(r),o=Ot(n)?n:n.replace(/[A-Z]/g,d=>"-"+d.toLowerCase()),c=f.trim(),u=/\s*!important\s*$/.test(c),a=c.replace(/\s*!important\s*$/,"");t.style.setProperty(o,a,u?"important":"")}catch{}}}s&&Jo(t,s)}function Jo(t,e){const s=`_ds${Xt.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let f="";for(const o in e){const c="."+s,u=o.replace(/&/g,c).split(",").map(d=>{const i=d.trim();return i.includes(c)?i:c+i}).join(", "),a=e[o];if(typeof a=="object"){let d="",i="";for(const l in a){const y=a[l];if(typeof y=="object"){const _=l.includes("&")?u.split(", ").map(h=>l.replace(/&/g,h)).join(", "):u.split(", ").map(h=>`${h} ${l}`).join(", ");let g="";for(const h in y)g+=`${h.replace(/[A-Z]/g,p=>"-"+p.toLowerCase())}: ${y[h]};`;i+=Qt(`${_} { ${g} }`,_)+`
5
+ `}else d+=`${l.replace(/[A-Z]/g,_=>"-"+_.toLowerCase())}: ${y};`}d&&(f+=Qt(`${u} { ${d} }`,u)+`
6
+ `),i&&(f+=i)}}f&&(r.textContent+=f)}const uo=new Set;function lo(t){if(!Array.isArray(t))return"";const e=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&e.push(t[s]);return e.sort(),e.join("|")}function mo(t,e,s){const n=lo(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=e(t,t.state,t.context)}catch{return}if(lo(r)===n)return;const f=t.__ref.path?t.__ref.path.join("."):t.key||"?";uo.has(f)||(uo.add(f),console.warn(`[smbls] subscribeTo function at "${f}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function ts(t){const e=t.subscribeTo,s=typeof e=="function";let n=e;if(s)try{n=e(t,t.state,t.context)}catch{n=null}if(s&&X()&&mo(t,e,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let f=0;f<n.length;f++){const o=n[f];if(typeof o!="string"||o.length===0)continue;const c=o.split("."),u=c[0],a=c.slice(1),d={value:!1},i=S(()=>{const l=t.state&&(W(t.state)?t.state.root:null);if(!l||!W(l))return;let y=l;y=y[u];for(let g=0;g<a.length&&!(y==null||typeof y!="object");g++)if(W(y))y=y[a[g]];else break;if(!d.value)return;let _=!1;if(typeof t.onBeforeUpdate=="function"){const g=t.context?.designSystem;g&&N(g);try{if(as(r)){const h=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});h&&typeof h.then=="function"?h.then(()=>xt(r,!1),p=>{xt(r,!0),t.context?.plugins?.length&&H("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}):(xt(r,!1),h===!1&&(_=!0))}}catch(h){xt(r,!0),t.context?.plugins?.length&&H("error",t,{hook:"onBeforeUpdate",error:h})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",h)}finally{g&&R()}}if(!_&&t.node&&r.__effects)for(let g=0;g<r.__effects.length;g++){const h=r.__effects[g];h&&h!==i&&!h._disposed&&!h._isSubscribeToEffect&&typeof h._execute=="function"&&h._execute()}if(!_&&typeof t.onUpdate=="function"){const g=t.context?.designSystem;g&&N(g);try{t.onUpdate(t,t.state,t.context)}catch(h){t.context?.plugins?.length&&H("error",t,{hook:"onUpdate",error:h})||console.error("[DOMQL] subscribeTo onUpdate error:",h)}finally{g&&R()}}},{depth:r.path.length,label:v(r,"subscribeTo("+o+")")});d.value=!0,i._isSubscribeToEffect=!0,r.__effects.push(i)}}function Nt(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}function Rt(t,e){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=e.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const po=new Set;function os(t,e){const s=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=s+"::"+t;po.has(n)||(po.add(n),console.warn(`[smbls/css] "${t}" at ${s} 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 m(t,e,s){const n={},r=new Set,f=(o,c,u)=>{const a=u?new Set(Object.keys(n)):null;if(T[o]){const d=T[o](c,e,e.state,e.context);if(d){const i=Array.isArray(d)?d:[d];for(const l of i)l&&Object.assign(n,l)}}else n[o]=c;if(u)for(const d in n)a.has(d)||r.add(d)};for(const o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;let c=t[o];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(o==="style"){for(const i in c){let l=c[i];if(typeof l=="function"&&(l=l(e,e.state,e.context)),l==null||typeof l=="function")continue;const y=typeof e[i]=="function"&&(T[i]||E&&E.has(i));f(i,l,y)}continue}if(Nt(o,e)){const i=m(c,e,!1);Object.keys(i).length&&(n[`[data-theme="${o.slice(1)}"] &`]=i);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(o)){X()&&os(o,e);continue}const a=Rt(o,e),d=m(c,e,!1);Object.keys(d).length&&(n[a]=d);continue}const u=typeof e[o]=="function"&&(T[o]||E&&E.has(o));f(o,c,u)}if(s)for(const o in n)r.add(o);for(const o of r){const c=n[o];typeof c=="string"&&!c.includes("!important")&&(n[o]=c+" !important")}return n}function Mt(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&Mt(t[s],e+1))return!0}return!1}function yo(t,e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Nt(t,s)){const f=m(e,s,!1);return Object.keys(f).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:f}:null}const n=Rt(t,s),r=m(e,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function ss(t){const e=t.__ref;for(const s of Object.keys(t)){if(!Tt(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!Mt(n))continue;let r=null,f;const o=S(()=>{if(!t.node)return;const c=t.context?.designSystem;c&&N(c);let u,a=!1;try{const d=yo(s,n,t),i=d?ht(d.block)+"::"+d.cssProp:null;if(i!==null&&i===f)a=!0;else if(f=i,d){const l=nt({[d.cssProp]:d.block},null,t.context?.cssPrefix);u=l?l.split(" ").filter(Boolean):null}else u=null}finally{c&&R()}if(!(a||!t.node.classList)){if(r)for(const d of r)t.node.classList.remove(d);if(u&&u.length)for(const d of u)t.node.classList.add(d);r=u}},{depth:e.path.length,label:v(e,"cssBlock("+s+")")});e.__effects.push(o)}}function es(t){const e=t.__ref;e.__conditionalRunners=[];const s=new Map;for(const n of Object.keys(t)){const r=n.charAt(0);if(r!=="."&&r!=="!")continue;const f=n.slice(1);if(!f)continue;if(/[:@\s>~+[\]]/.test(f)){if(typeof console<"u"&&console.warn){const y=f.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${y}: { '${f.slice(y.length)}': {...} }\`.`)}continue}const o=t[n];if(!o||typeof o!="object")continue;const c=r==="!",u={lastMatch:!1,appliedKeys:null,appliedClasses:null},a=()=>{let y;const _=t[f];if(_===void 0){const p=!!t.state&&f in t.state,x=t.state?t.state[f]:void 0;if(p||x!==void 0)y=x;else{const b=t.context?.cases?.[f];if(b===void 0)return;try{y=typeof b=="function"?b.call(t,t):b}catch(C){y=!1,e.__conditionalError=C,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,C?.message||C)}}}else if(typeof _=="function")try{y=_(t,t.state,t.context)}catch(p){y=!1,e.__conditionalError=p,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,p?.message||p)}else y=_;const g=c?!y:!!y;if(!t.node||g===u.lastMatch)return;u.lastMatch=g;const h=t.context?.designSystem;h&&N(h);try{if(g){const p={},x={};let b=!1;for(const A in o){if(!Object.prototype.hasOwnProperty.call(o,A))continue;const w=o[A],Y=A.charAt(0);if((Y===":"||Y==="@"||Y==="&"||Y==="[")&&w&&typeof w=="object"&&!Array.isArray(w)){if(Nt(A,t)){const P=m(w,t,!1);Object.keys(P).length&&(x[`[data-theme="${A.slice(1)}"] &`]=P,b=!0)}else{const P=Rt(A,t),L=m(w,t,!1);Object.keys(L).length&&(x[P]=L,b=!0)}continue}const q=typeof w=="function"?w(t,t.state,t.context):w;if(q!=null)if(T[A]){const P=T[A](q,t,t.state,t.context);if(P){const L=Array.isArray(P)?P:[P];for(const tt of L)tt&&Object.assign(p,tt)}}else(E&&E.has(A)||Ot(A))&&(p[A]=q)}const C=Object.keys(p);if(C.length){J(t.node,p);for(const A of C)s.set(A,n);u.appliedKeys=C}else u.appliedKeys=null;if(b){const A=nt(x,null,t.context?.cssPrefix),w=A?A.split(" ").filter(Boolean):[];if(w.length&&t.node.classList){for(const Y of w)t.node.classList.add(Y);u.appliedClasses=w}else u.appliedClasses=null}else if(u.appliedClasses){for(const A of u.appliedClasses)t.node.classList.remove(A);u.appliedClasses=null}}else{if(u.appliedKeys){for(const p of u.appliedKeys)s.get(p)===n&&(Ot(p)?t.node.style.removeProperty(p):t.node.style[p]="",s.delete(p));u.appliedKeys=null}if(u.appliedClasses){for(const p of u.appliedClasses)t.node.classList.remove(p);u.appliedClasses=null}}}finally{h&&R()}};e.__conditionalRunners.push(a);const d=D(t,t[f+"Deps"],a),i=S(d,{depth:e.path.length,label:v(e,"conditional("+n+")")}),l=e.__exec&&e.__exec[f]||t[f];i._sources.size===0&&typeof l=="function"&&X()&&console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${f}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),e.__effects.push(i)}}const $t=new WeakSet;function ns(t){const e=t.ownerDocument;!e||$t.has(e)||($t.add(e),queueMicrotask(()=>{$t.delete(e);const s=e.body||e.documentElement;s&&s.offsetWidth}))}const Ft=new WeakSet;let ho=!1;function _o(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function It(t,e){const s={...t};for(const n in e){const r=e[n],f=s[n];s[n]=r&&typeof r=="object"&&f&&typeof f=="object"?It(f,r):r}return s}function go(t,e){const s={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const f=go(r,e);Object.keys(f).length&&(s[n]=f)}else e.has(n)||(s[n]=r)}return s}function rs(t){const{node:e}=t;if(!e)return;if(ho||(ho=!0,nt({display:"none"})),Ft.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Ft.add(t);const s=t.context?.designSystem;s&&N(s),Zt();try{const n={};let r=!1,f=null,o=null,c=null;const u=(a,d)=>{if(d&&typeof d=="object"&&_o(a)){o||(o={});const i=o[a];i&&(d=It(i,d)),o[a]=d}else(d===null||typeof d!="object")&&(c||(c=new Set),c.add(a));n[a]=d};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&T.theme){const a=T.theme(t.theme,t,t.state,t.context);if(a){const d=i=>{for(const l in i){const y=i[l];y&&typeof y=="object"&&_o(l)&&(f||(f={}),f[l]=y),n[l]=y}};if(Array.isArray(a))for(const i of a)i&&d(i);else d(a);r=!0}}for(const a of Object.keys(t)){if(typeof t[a]=="function"||G.has(a)||a==="theme")continue;const d=a.charCodeAt(0);if(!(d>=65&&d<=90)&&!z(a)){if(T[a]){const i=t[a],l=T[a](i,t,t.state,t.context);if(l){if(Array.isArray(l)){for(const y of l)if(y)for(const _ in y)u(_,y[_])}else for(const y in l)u(y,l[y]);r=!0}}else if(E&&E.has(a)){const i=t[a];i!=null&&typeof i!="object"&&(u(a,i),r=!0)}else if(a.charCodeAt(0)===45){const i=t[a];i!=null&&typeof i!="object"&&(u(a,i),r=!0)}else if(a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="["){const i=t[a];if(i&&typeof i=="object"&&!Array.isArray(i)){if(Mt(i))continue;const l=yo(a,i,t);l&&(u(l.cssProp,l.block),r=!0)}}}}if(f)for(const a in f){let d=c?go(f[a],c):f[a];o&&o[a]&&(d=It(d,o[a])),Object.keys(d).length?n[a]=d:delete n[a]}if(r){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const a=nt(n,null,t.context?.cssPrefix);if(a&&e.classList){const i=a.split(" ").filter(Boolean);let l=!1;for(const y of i)e.classList.add(y),l||(y.charCodeAt(0)===95&&y.charCodeAt(1)===99||y.charCodeAt(0)===95&&y.indexOf("_c",1)!==-1)&&(l=!0);l&&ns(e)}const d=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(d!=null){const i=n.display;if(i&&i!==d)if(d==="none"){const l=[];for(const y of e.classList)y.startsWith("_d-")&&y!=="_d-none"&&l.push(y);for(const y of l)e.classList.remove(y);e.classList.add("_d-none")}else e.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(e.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}}finally{qt(),s&&R(),Ft.delete(t)}}function bo(t){const{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const f=t.aria[r];if(typeof f=="function"||typeof f=="object"||f==null||typeof f=="string"&&f.includes("{{"))continue;const o="aria-"+r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(o,K(o,f))}const s=$o(t);for(const r in s){const f=s[r];f!=null&&f!==!1&&typeof f!="function"&&typeof f!="object"&&e.setAttribute(r,f===!0?"":f)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.has(r)||r==="on"||s[r]!==void 0)continue;const f=r.charCodeAt(0);if(!(f>=65&&f<=90)&&!z(r)&&!(T[r]||E&&E.has(r))&&rt(n,r)){let o=t[r];if(o==null)continue;if(typeof o=="string"&&o.includes("{{")){if(!kt[r])continue;o=$.call(t,o,t.state)}if(o==null||typeof o=="function"||typeof o=="object"||o===!1&&!ct(it(r)||r))continue;const c=it(r)||r;e.setAttribute(c,K(c,o))}}}function Ns(t,e){const{node:s}=t;if(!s||!s.setAttribute)return;const n=e.charCodeAt(0);if(n>=65&&n<=90||z(e)||T[e]||E&&E.has(e)||!rt(t.tag||"div",e))return;const r=it(e)||e,f=r.toLowerCase(),o=t.__ref&&t.__ref.__effects;let c=!1;if(o)for(let d=0;d<o.length;d++){const i=o[d];i&&i._attrName===f&&!i._disposed&&typeof i._execute=="function"&&(c=!0,i._execute())}if(c)return;let u=t[e];const a=kt[e];if(a&&u!=null){const d=a(t);d!==void 0&&(u=d)}typeof u=="string"&&u.includes("{{")&&(u=$.call(t,u,t.state)),u==null||u===!1&&!ct(r)?s.removeAttribute(r):typeof u!="function"&&typeof u!="object"&&s.setAttribute(r,K(r,u))}function is(t,e){const s=t.node,n=t.__ref;let r=n.__autoGrow;if(!e){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(s.scrollHeight===0&&r.lastMeasure>0)return;s.style.height="auto";const o=s.scrollHeight;s.style.height=o+"px",o>0&&(r.lastMeasure=o)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}})),r.active||(s.addEventListener("input",r.resize),r.active=!0);const f=typeof e=="object"&&e.max!=null?String(e.max):null;f!==r.appliedMax&&(f==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=f,r.appliedMax=f),r.resize()}function cs(t){if(!t.autoGrow)return;const e=t.node;if(!e||e.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,r=typeof n=="function"?D(t,t.autoGrowDeps,n):null,f=S(()=>{const o=t.autoGrow;let c=o;if(typeof o=="function")try{c=(o===n&&r?r:o)(t,t.state,t.context)}catch{c=null}is(t,c)},{depth:s.path.length,label:v(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(f),r&&(s.__exec.autoGrow=n)}const xo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ao(t,e){for(const s of Object.keys(t)){if(!z(s)||xo.has(s))continue;const n=Do(s);if(n){Lo(n,t,t[s]);continue}let r=t[s];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const o=r;r=function(u){return t.call(o,u)}}if(typeof r!="function")continue;const f=Go(s);Po.has(f)||To(Ho(f),t,r)}fs(t)}function fs(t){const e=t.node;if(!e||!e.addEventListener)return;const s={};let n=!1;for(const l of xo){const y=t[l];typeof y=="function"&&(s[l]=y,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,f=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let o=0,c=0,u=0,a=!1;const d=l=>{const y=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];y&&(o=y.clientX,c=y.clientY,u=Date.now(),a=!0)},i=l=>{if(!a)return;a=!1;const y=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!y)return;const _=y.clientX-o,g=y.clientY-c,h=Date.now()-u;if(h>f)return;const p=Math.abs(_),x=Math.abs(g);if(Math.max(p,x)<r)return;let b;if(p>x*1.2)b=_<0?"left":"right";else if(x>p*1.2)b=g<0?"up":"down";else return;const C="onSwipe"+b.charAt(0).toUpperCase()+b.slice(1),A=s[C],w=s.onSwipe;A&&A.call(t,l,t,t.state,t.context),w&&w.call(t,{direction:b,dx:_,dy:g,dt:h,event:l},t,t.state,t.context)};e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",i,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",d)}catch{}try{e.removeEventListener("touchend",i)}catch{}})}function dt(t,e){const s={...t};for(const n in e){const r=s[n],f=e[n];r&&f&&typeof r=="object"&&typeof f=="object"&&!Array.isArray(r)&&!Array.isArray(f)&&typeof r!="function"&&typeof f!="function"?s[n]=dt(r,f):s[n]=f}return s}function Ut(t,e,s,n){if(!e||!t.node)return;const r=t.childExtends;if(Array.isArray(e)){const f=t.tag==="fragment",o=t.context?.document||globalThis.document,c=f?null:o?.createDocumentFragment();if(!f&&!c)return;const u=t.childProps,a=t.childrenAs,d=h=>{let p=e[h];const x=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let b=u;if(typeof u=="function")try{b=u(t,p)}catch{b=null}if(a==="state"){let A=x;(typeof x=="string"||typeof x=="number")&&(A={value:x,text:x}),p=b?{...b,state:A}:{state:A}}else b&&(p=dt(b,p));if(r&&!p.ignoreChildExtends)if(p.extends){const A=Array.isArray(p.extends)?p.extends:[p.extends],w=Array.isArray(r)?r:[r];p={...p,extends:[...w,...A]}}else p={...p,extends:r};const C=oo(p?.key,x,h);try{return Z(p,t,C,s)}catch(A){if(typeof console<"u"&&console.error){const w=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${C}" failed to construct at ${w} (initial render, skipping this row):`,A?.message||A)}return null}},i=t.__ref;if(!(n===!0&&!f&&!!i&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let h=0;h<e.length;h++){const p=d(h);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const y=i.__childrenChunkGen=(i.__childrenChunkGen||0)+1;Wt();let _=null;const g=h=>{if(i.__disposed||i.__childrenChunkGen!==y){_&&_.parentNode&&_.remove();return}for(let p=h;p<e.length;p++){const x=d(p);if(x?.node&&(_?t.node.insertBefore(x.node,_):c.appendChild(x.node)),p+1<e.length&&Ht()){_||(_=o.createComment("smbls-mount"),c.appendChild(_),t.node.appendChild(c));const b=p+1;Yt(()=>g(b));return}}_?(_.remove(),t.node.tagName==="SELECT"&&bt(t,!0)):t.node.appendChild(c)};return g(0),zt(),!0}if(typeof e=="string"){const f=so(e,t);if(Array.isArray(f))return Ut(t,f,s,n)}if(typeof e=="object")for(const f in e){if(G.has(f))continue;let o=e[f];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=dt(t.childProps,o)),r&&!o.ignoreChildExtends)if(o.extends){const c=Array.isArray(o.extends)?o.extends:[o.extends],u=Array.isArray(r)?r:[r];o={...o,extends:[...u,...c]}}else o={...o,extends:r};Z(o,t,f,s)}}}function bt(t,e){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const r=t.__ref,f=r&&r.__exec&&r.__exec.value,o=typeof f=="function",c=t.value!=null&&typeof t.value!="function";if(o||c){let d;if(o)try{d=f(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=$.call(t,d,t.state));const i=d==null?"":String(d);s.value!==i&&(s.value=i);return}const u=e||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!u)return;let a=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(a=d);a>=0&&s.selectedIndex!==a&&(s.selectedIndex=a)}function Co(t,e){let{children:s,content:n}=t;const r=t.childExtends;if(typeof s=="function"){const i=s;try{s=i(t,t.state,t.context)}catch(h){if(s=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):`,h?.message||h)}}t.children=s;const l=t.__ref;let y=!1;const _=D(t,t.childrenDeps,i),g=S(()=>{const h=y;y=!0;let p;try{p=_(t,t.state,t.context)}catch(P){if(typeof console<"u"&&console.error){const L=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${L}${h?"":" (initial tracking run)"}:`,P?.message||P)}return}if(!h||p===t.children)return;t.children=p,l.__childrenChunkGen!=null&&l.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",b=x?[]:null,C=x?[]:null,A=x?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){const P=t.childProps,L=[],tt=new Map;for(let k=0;k<p.length;k++){const U=p[k];let j=P;if(typeof P=="function")try{j=P(t,U)}catch{j=null}const V=oo(j&&j.key,U,k);L.push(V),tt.set(V,{rawChild:U,childProps:j})}const So=new Set(L),wo=l.__children.slice();for(const k of wo)if(!So.has(k)){const U=t[k];U?.remove&&U.remove(),delete t[k],C&&C.push(k)}const ot=t.childExtends,lt=t.tag==="fragment",ko=t.context?.document||globalThis.document,st=lt?null:ko?.createDocumentFragment(),At=new Set;for(const k of L){const U=tt.get(k),j=U.rawChild,V=t[k];if(V&&V.state){if(j&&typeof j=="object"){const O=V.state,Q=O.$replace||O.replace,Vt=O.$update||O.update;try{if(typeof Q=="function")Q.call(O,j);else if(typeof Vt=="function"){for(const I in O)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(j,I))try{O[I]=void 0}catch{}Vt.call(O,j)}else for(const I in j)O[I]=j[I]}catch(I){if(typeof console<"u"&&console.error){const jo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to patch at ${jo} (reconcile, keeping its previous data for this pass):`,I?.message||I)}}}A&&A.push(k);continue}let Ct=j;(typeof j=="string"||typeof j=="number")&&(Ct={value:j,text:j});const Kt=U.childProps;let B=Kt?{...Kt,state:Ct}:{state:Ct};if(ot&&!B.ignoreChildExtends)if(B.extends){const O=Array.isArray(B.extends)?B.extends:[B.extends],Q=Array.isArray(ot)?ot:[ot];B={...B,extends:[...Q,...O]}}else B={...B,extends:ot};let vt;try{vt=Z(B,t,k,e)}catch(O){if(typeof console<"u"&&console.error){const Q=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${Q} (reconcile, skipping this row):`,O?.message||O)}At.add(k);continue}!lt&&vt?.node&&st&&st.appendChild(vt.node),b&&b.push(k)}if(!lt&&st&&st.childNodes.length&&t.node&&t.node.appendChild(st),!lt&&t.node){let k=null;for(const U of L){const j=t[U]?.node;if(!j)continue;const V=k?k.nextSibling:t.node.firstChild;j!==V&&t.node.insertBefore(j,V),k=j}}l.__children=At.size?L.filter(k=>!At.has(k)):L,x&&(b.length||C.length)&&to(t,{added:b,removed:C,kept:A}),bt(t,!1);return}const q=x?[...l.__children]:null;for(const P of[...l.__children]){const L=t[P];L?.remove&&L.remove(),delete t[P]}l.__children=[],Ut(t,p,e),bt(t,!1),x&&to(t,{added:[...l.__children],removed:q,kept:[]})},{depth:l.path.length,label:v(l,"children")});l.__effects.push(g)}const f=Ut(t,s,e,!0);if(n!=null&&!(n&&n.__ref)){let i=n;if(typeof i=="string"||typeof i=="number"?i={text:i}:typeof i!="object"&&(i={}),t.childProps&&(i=dt(t.childProps,i)),r&&!i.ignoreChildExtends)if(i.extends){const l=Array.isArray(i.extends)?i.extends:[i.extends],y=Array.isArray(r)?r:[r];i={...i,extends:[...y,...l]}}else i={...i,extends:r};Z(i,t,"content",e)}if(s&&!f)return;const o=t.context?.components||{};{const i=Object.keys(t);for(let l=0;l<i.length;l++){const y=i[l];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const _=y.slice(0,-7);if(!_||_.charCodeAt(0)<65||_.charCodeAt(0)>90)continue;const g={extends:t[y]};delete t[y];for(let h=l+1;h<i.length;h++){const p=i[h],x=p.charCodeAt(0);if(x>=65&&x<=90||G.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;const b=t[p];b!==void 0&&(g[p]=b,delete t[p])}t[_]&&typeof t[_]=="object"?t[_]={...g,...t[_]}:t[_]=g}}const c=e?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),a=i=>{if(G.has(i)||typeof t[i]!="object"||t[i]===null)return;const l=i.charCodeAt(0);if(l<65||l>90)return;let y=t[i];if(!y.__ref){if(!y.extends&&!y.extend){const _=o[i]||o[`smbls.${i}`];_&&(y={...y,extends:_})}if(t.childProps&&(y=dt(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const _=Array.isArray(y.extends)?y.extends:[y.extends],g=Array.isArray(r)?r:[r];y={...y,extends:[...g,..._]}}else y={...y,extends:r};Z(y,t,i,e)}};if(!c){for(const i of u)a(i);return}Wt();const d=i=>{for(let l=i;l<u.length;l++)if(a(u[l]),l+1<u.length&&Ht()){const y=l+1;Yt(()=>d(y));return}};d(0),zt()}function vo(t,e,s){const{node:n}=t;if(!n)return;n.ref=t;const r=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(r){const o=r.parentNode;if(o){if(s?.position==="before"&&s.node)o.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const c=s.node.nextSibling;o.insertBefore(n,c||r)}else o.insertBefore(n,r);return}}const f=e?.node||(e?.nodeType?e:null);if(f)if(s?.position==="before"&&s.node)f.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const o=s.node.nextSibling;o?f.insertBefore(n,o):f.appendChild(n)}else f.appendChild(n)}const Bt=3;function as(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Bt?!1:(t.__inBeforeUpdate=!0,!0)}function xt(t,e){t&&(t.__inBeforeUpdate=!1,e?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Bt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Bt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function M(t,e,s){const n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&H(n,e,s);const r="on"+t,f=e[r];if(typeof f=="function"){const u=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(u){if(e.__ref[u])return!0;e.__ref[u]=!0}const a=e.context?.designSystem;a&&N(a);let d=!!u;try{const i=f(e,e.state,e.context,s);if(i&&typeof i.then=="function"){const l=e.__ref;return i.catch(y=>{e.context?.plugins?.length&&H("error",e,{hook:r,error:y})||console.error(`[DOMQL] Lifecycle "${r}" error:`,y)}).finally(()=>{u&&l&&(l[u]=!1)}),d=!1,!0}if(i===!1)return!1}catch(i){if(e.context?.plugins?.length&&H("error",e,{hook:r,error:i})||console.error(`[DOMQL] Lifecycle "${r}" error:`,i),e.context?.strictMode)throw i}finally{a&&R(),d&&e.__ref&&(e.__ref[u]=!1)}}return!0}var Rs=Z;export{Bt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,as as acquireBeforeUpdateGuard,Z as create,Rs as default,Et as flushMounts,Ns as reconcileAttrProp,xt as releaseBeforeUpdateGuard,yt as writeElementText};
@@ -1 +1 @@
1
- const o="3.14.786";export{o as VERSION};
1
+ const o="3.14.788";export{o as VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.786",
3
+ "version": "3.14.788",
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",