@symbo.ls/element 3.14.803 → 3.14.804
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/src/create.js +4 -4
- package/dist/cjs/src/mountScheduler.js +1 -1
- package/dist/cjs/src/update.js +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/esm/src/create.js +4 -4
- package/dist/esm/src/mountScheduler.js +1 -1
- package/dist/esm/src/update.js +1 -1
- package/dist/esm/src/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @symbo.ls/element
|
|
2
2
|
|
|
3
|
+
## 3.14.804
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- A navigation skips the router's scroll-to-top when the scroll node is already at the origin (no forced layout after the swap; the first render keeps it). A yielding mount chunk ends before the next child would cross the 50 ms budget, so chunks are no longer long tasks. `el.update({ style })` keeps a custom property's name as written.
|
|
8
|
+
|
|
3
9
|
## 3.14.803
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/src/create.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Gs=Object.create;var Ht=Object.defineProperty;var Ks=Object.getOwnPropertyDescriptor;var Ws=Object.getOwnPropertyNames;var zs=Object.getPrototypeOf,Ys=Object.prototype.hasOwnProperty;var qs=(t,o)=>{for(var s in o)Ht(t,s,{get:o[s],enumerable:!0})},jo=(t,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of Ws(o))!Ys.call(t,e)&&e!==s&&Ht(t,e,{get:()=>o[e],enumerable:!(n=Ks(o,e))||n.enumerable});return t};var Zs=(t,o,s)=>(s=t!=null?Gs(zs(t)):{},jo(o||!t||!t.__esModule?Ht(s,"default",{value:t,enumerable:!0}):s,t)),Qs=t=>jo(Ht({},"__esModule",{value:!0}),t);var _e={};qs(_e,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>Qt,acquireBeforeUpdateGuard:()=>$s,create:()=>ot,default:()=>ye,flushMounts:()=>Zt,isStaticCssProp:()=>Jn,recompileStaticCss:()=>mn,reconcileAttrProp:()=>oe,releaseBeforeUpdateGuard:()=>It,resolveStyleBlock:()=>$t,writeAttr:()=>Ft,writeElementText:()=>Nt});module.exports=Qs(_e);var $=require("@symbo.ls/signal"),E=require("@symbo.ls/signal"),W=require("./runContext.js"),nt=require("./cache.js"),H=require("./registry.js"),At=require("./delegate.js"),Rs=require("./bridge.js"),xt=require("./extends.js"),Ms=require("./methods.js"),xe=require("./dispose.js"),it=require("./devRuntime.js"),U=require("./mountScheduler.js"),L=require("@symbo.ls/utils"),Ut=Zs(require("@symbo.ls/utils"),1),z=require("./pluginHooks.js"),ut=require("@symbo.ls/state"),k=require("css-in-props"),st=require("@symbo.ls/css"),M=require("@symbo.ls/scratch"),v=require("attrs-in-props"),Ns=require("./engineRegistry.js"),I=require("./cssLonghands.js"),Q=require("./attributeFirst.js"),Fs=require("./version.js");const Eo=(0,Ns.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},Fs.VERSION),Ct=[],ct=new Set;let oo=!1,Po=0,pt=null,kt=null;function ht(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Oo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Xs=250,Js=1e3;function ms(){return kt&&(kt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Oo())?!0:ht()-Po>=Js}function tn(){if(oo=!0,Po=ht(),kt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Zt,0);pt=t?()=>t(o):null;return}if(Oo()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Zt,Xs);pt=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;kt=requestAnimationFrame;const o=requestAnimationFrame(Zt);pt=t?()=>t(o):null}}function Vt(){if(oo){if(!ms())return;const t=pt;if(pt=null,t)try{t()}catch{}}tn()}const To=300,Do=15e4;function Zt(){if(oo=!1,pt=null,kt=null,ct.size&&ne(),!Ct.length)return;const t=Ct.splice(0,Ct.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=ht());const e=ht()-n.__mountFirstAttemptAt;n.__mountAttempts<=To&&e<Do?(Ct.push(s),Vt()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",e,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&(0,Rs.mountBridge)(s),typeof s.onMounted=="function"&&N("Mounted",s,s.__ref?.__mountOptions||{})}}}function so(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Rt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,Ct.push(t),Vt())}function Lo(t,o){typeof t.onContentUpdate=="function"&&((0,z.dispatchPluginHook)("contentUpdate",t,o),(0,W.withDesignSystem)(t,()=>{try{t.onContentUpdate(t,t.state,t.context,o)}catch(s){if((0,z.reportLifecycleError)(t,"onContentUpdate",s),t.context?.strictMode)throw s}}))}function m(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function on(t){return t.charAt(2).toLowerCase()+t.slice(3)}function sn(t){return t.toLowerCase()}function no(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function vt(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=vt(e,c):s[n]=c}return s}function Gt(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Ro(t,o,s,n){return Kt(n,Gt(t)||(o&&typeof o=="object"?Gt(o.key):void 0)||String(s))}function Kt(t,o){if(!t||typeof o!="string")return o;let s=o;for(;nn(t,s);)s="$"+s;return s!==o&&en(t,o,s),s}function nn(t,o){if(H.REGISTRY.has(o)&&o!=="content")return!0;if(!(o in t))return!1;const s=t[o];return!(s&&typeof s=="object"&&s.__ref&&s.parent===t)}const Mo=new Set;function en(t,o,s){if(!(0,it.isLoudDevRuntime)())return;const n=t.__ref&&t.__ref.path&&t.__ref.path.join(".")||t.key||"<root>",e=n+"::"+o;Mo.has(e)||(Mo.add(e),console.warn(`[smbls] a child keyed "${o}" at ${n} names a property of its parent; it lives at el["${s}"] (data-key="${s}") so the parent keeps its own "${o}". Prefix the data keys to keep plain el.<key> access.`))}function ot(t,o,s,n={},e){if((0,E.getObserver)())return(0,W.untrack)(()=>ot(t,o,s,n,e));if(t==null||t===!1)return null;const c=kn(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Gt(s);const a=Gt(t.key),r=Object.create(null);r.key=s||(a&&o?Kt(o,a):a)||`_${Eo.uniqId++}`,r.parent=o||null,r.context=t.context||o?.context||n.context||{},r.context.__create||(r.context.__create=ot);const i=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||r,path:o?.__ref?.path?[...o.__ref.path,r.key]:[r.key],origin:t};c&&(i.__runtimeSource=c);const f=t;if(t=Fo(r,t,s,a,o,n),r.if!=null){let u;if(typeof r.if=="function")try{u=r.if(r,r.state,r.context)}catch(l){if(u=!1,i.__ifError=l,typeof console<"u"&&console.warn){const g=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,l?.message||l)}}else u=r.if;i.__if=!!u}if(i.__if)typeof r.if=="function"&&(i.__ifInitialized=!0);else{o&&(o[r.key]=r);const u=fn(t,s,r.context?.components);return u.length&&(i.__ifLateMerge={definition:f,key:s,ownKey:a,names:u,options:n}),typeof r.if=="function"&&mo(r,i,r.if),r}r.tag||(r.tag=(0,nt.detectTag)(r)),N("Init",r,n);const d=r.node=(0,nt.adoptHydrationNode)(r)||(0,nt.cacheNode)(r);if(!d)return r;if(r.tag==="fragment"){const l=(r.context?.document||globalThis.document).createComment("");d.appendChild(l),i.__fragmentAnchor=l}N("AttachNode",r,n),d.setAttribute&&r.key&&d.setAttribute("data-key",r.key),o&&(o[r.key]=r,o.__ref?.__children&&(o.__ref.__children.includes(r.key)||o.__ref.__children.push(r.key))),d.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&d.setAttribute("data-smbls-app",r.context.key),r.id&&d.setAttribute&&(d.id=r.id),Ts(r,n),Qo(r),Jo(r);try{Ds(r,n)}catch(u){if(typeof console<"u"&&console.error){const l=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${l}:`,u?.message||u,u?.stack?`
|
|
2
2
|
`+u.stack.split(`
|
|
3
3
|
`).slice(0,6).join(`
|
|
4
|
-
`):"")}}if(qt(r,!0),Ds(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML&&(0,G.withDesignSystem)(r,()=>{try{const u=r.html(r,r.state,r.context);u!=null&&typeof u!="function"&&(r.node.innerHTML=u)}catch{}}),N("Create",r,n),N("Complete",r,n),N("Render",r,n),N("RenderRouter",r,n),so(r,n),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,_=()=>{if(r.node){if(r.node.isConnected){l&&(0,M.pushConfig)(l);try{u(r,r.state,r.context)}catch(g){console.error("[DOMQL] onFrame error:",g)}finally{l&&(0,M.popConfig)()}}requestAnimationFrame(_)}};requestAnimationFrame(_)}return r}const Mo=new Set(["childProps","attr","style","scope","data","vars"]);function No(t,o,s,n,e,c){if(s&&!o.extends&&!o.extend){const y=s.indexOf("_"),p=s.indexOf(".");let A=y>0?y:-1;if(p>0&&(A<0||p<A)&&(A=p),A>0){const w=s.substring(0,A),h=t.context?.components;h&&(h[w]||h["smbls."+w])?o={...o,extends:w}:h&&(0,et.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 "${w}" but neither "${w}" nor "smbls.${w}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),(0,At.applyExtends)(t,o,c);const a=(0,At.openMergeLayer)(t),r=t.props&&typeof t.props=="object"?t.props:null;for(const y in o){if(y==="parent"||y==="node"||y==="__ref"||y==="extends"||y==="context"||y==="props")continue;if(y==="key"){n&&(t.key=e?Kt(e,n):n);continue}const p=o[y];a&&a.mark(y);const A=t[y],w=A&&p&&typeof A=="object"&&typeof p=="object"&&!Array.isArray(A)&&!Array.isArray(p)&&typeof A!="function"&&typeof p!="function";w&&y.charCodeAt(0)>=65&&y.charCodeAt(0)<=90?t[y]=vt(A,p):w&&Mo.has(y)?t[y]={...A,...p}:w&&no(y)?t[y]=vt(A,p):t[y]=p}function i(y){for(const p in y){const A=y[p],w=t[p],h=w&&A&&typeof w=="object"&&typeof A=="object"&&!Array.isArray(w)&&!Array.isArray(A)&&typeof w!="function"&&typeof A!="function";h&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?t[p]=vt(w,A):h&&Mo.has(p)?t[p]={...w,...A}:h&&no(p)?t[p]=vt(w,A):t[p]=A}}if(r&&i(r),o.props&&typeof o.props=="object"&&(i(o.props),a))for(const y in o.props)a.mark(y);(0,At.closeMergeLayer)(t),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const f=t.scope&&typeof t.scope=="object"?t.scope:null,d=e?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,l=d||u||null;if(o.scope!==void 0||f){const y={};f&&Object.assign(y,f),o.scope!==void 0&&Object.assign(y,o.scope),t.scope=(0,I.createScopeStore)(y,l)}else l&&(t.scope=l);o.if!==void 0&&(t.if=o.if);const _=t.__ref,g=kn(t,_&&_.__runtimeSource);return _&&(_.__declaredArrays=g||void 0),(0,Rs.addMethods)(t),fn(t,e,o,c),o}const en=new Set(["key","parent","context","__ref"]);function rn(t,o){for(const n of Object.keys(t))en.has(n)||delete t[n];let s=o.definition;if(!s.extends&&!s.extend&&typeof o.key=="string"){const n=t.context?.components||{},e=n[o.key]||n["smbls."+o.key];e&&(s={...s,extends:e})}(0,G.untrack)(()=>No(t,s,o.key,o.ownKey,t.parent,o.options))}function cn(t,o,s){const n=s||{},e=r=>!!(n[r]||n["smbls."+r]),c=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const r of a){if(typeof r!="string")continue;const i=r.includes(">")?r.split(">")[0].trim():r;e(i)||c.push(i)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let r=-1;const i=o.indexOf("_"),f=o.indexOf(".");i>0&&(r=i),f>0&&(r<0||f<r)&&(r=f);const d=r>0?o.substring(0,r):o;e(d)||c.push(d)}return c}function eo(t,o,s){if(typeof t.onStateInit!="function"&&!(0,K.hasPluginHook)(t,"stateInit"))return;const n=t.state;t.state=o;try{N("StateInit",t,s)}finally{t.state=n}}const ro=t=>({isDataOnlyKey:o=>(0,L.polyglotSeededKeys)(t).has(o)});function fn(t,o,s,n){const e=!o,c=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&c&&t.context?.state,r=s.state!==void 0&&!a?s.state:t.state&&!(0,I.isStore)(t.state)?t.state:void 0;if(r==null){if(o?.state)t.state=o.state,(0,ut.applyStateMethods)(t,t.state);else if(t.context?.state){const i=t.context.state,f={...i},d=t.context?.polyglot;if(d?.translations){const u=t.context,l=i.lang||d.defaultLang||"en",_=new Set,g=(A,w)=>{_.has(A)||(0,L.isPolyglotWritableKey)(u,A,f)&&(f[A]=w,_.add(A),(0,L.markPolyglotSeeded)(u,A,w))},y=d.translations[l];if(y&&typeof y=="object")for(const A in y)g(A,y[A]);const p=new Set(d.languages||[]);for(const A in d.translations)p.has(A)||g(A,d.translations[A])}(0,I.isStore)(f)||eo(t,f,n),t.state=(0,I.isStore)(f)?f:(0,I.createStore)(f,ro(t.context)),t.state.__element=t,t.state.root=t.state,(0,ut.applyStateMethods)(t,t.state),Ut.promoteActiveRootState?.(i,t.state),N("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,ut.applyStateMethods)(t,t.state);return}if(typeof r=="string"){if(t.state=Io(r,o),t.state&&typeof t.state=="object"&&!(0,I.isStore)(t.state)){const i=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}(0,ut.applyStateMethods)(t,t.state),un(t,r,o),N("StateCreated",t,n);return}if(typeof r=="function"){const i=r(t,o?.state);if((0,I.isStore)(i))t.state=i;else{const f=i||{};eo(t,f,n),t.state=(0,I.createStore)(f,o?.state?void 0:ro(t.context))}}else if((0,I.isStore)(r))t.state=r;else{const i={...r};eo(t,i,n),t.state=(0,I.createStore)(i,o?.state?void 0:ro(t.context))}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,(0,ut.applyStateMethods)(t,t.state),Ut.promoteActiveRootState?.(r,t.state),N("StateCreated",t,n)}function Fo(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const e of s){if(n==null)return{};n=n[e]}return n??{}}function $o(t,o){const s=o.state;return t.startsWith("~/")?[s&&(s.root||s),t.slice(2)]:t.startsWith("../")?[s,t.slice(3)]:[s,t]}function Io(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[e,c]=$o(t,o);return c?Fo(e,c):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=Fo(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const e=o.state?.root?.lang||n.defaultLang||"en",c=n.translations[e];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function an(t,o){const[s,n]=$o(t,o);if(!n||!s||typeof s!="object")return;const e=s[n];if(e!==void 0||n.indexOf("/")===-1)return e;let c=s;for(const a of n.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function un(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!(0,I.isStore)(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const e=(0,G.untrack)(()=>(0,E.createEffect)(()=>{const c=an(o,s);!c||typeof c!="object"||c===t.state||(0,G.untrack)(()=>Bo(t,t.state,c,!0))},{depth:n.path?n.path.length:0,label:P(n,"state")}));e._isStateBinding=!0,n.__stateBinding=e,n.__effects&&n.__effects.push(e)}function Bo(t,o,s,n){const e=t.__ref;if(!e)return;if(n||t.state===o){t.state=s,n&&(0,ut.applyStateMethods)(t,s),Ho(e);const a=e.__children;if(a)for(let r=0;r<a.length;r++){const i=t[a[r]];i&&i.__ref&&i.parent===t&&Bo(i,o,s,!1)}return}if(e.__stateBinding){e.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=s,Ho(e))}function Ho(t){const o=t.__effects;if(o)for(let s=0;s<o.length;s++){const n=o[s];n&&!n._disposed&&!n._isStateBinding&&!n._isSubscribeToEffect&&typeof n._notify=="function"&&n._notify()}}const dn=new Set(["s","state","ctx","context"]),io=new WeakMap;function Uo(t){if(io.has(t))return io.get(t);let o=null;try{const s=typeof Ut.getFunctionSource=="function"?Ut.getFunctionSource(t):Function.prototype.toString.call(t);if(typeof s=="string"){const n=s.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||s.match(/^[^(]*\(([^)]*)\)/);n&&(o={params:n[1].split(",").map(e=>e.trim()),body:s.slice(n.index+n[0].length)})}}catch{}return io.set(t,o),o}function ln(t){const o=Uo(t);return o?o.params.map(s=>s.split("=")[0].trim()).filter(Boolean):[]}const Vo=new WeakMap;function pn(t){let o=Vo.get(t);return o===void 0&&(o=hn(Uo(t)),Vo.set(t,o)),o}function hn(t){if(!t)return!0;const o=t.body;if(/\bstate\b|\barguments\b|\bcall\s*\(/.test(o))return!0;const s=t.params[1];if(!s)return!1;if(!/^[A-Za-z_$][\w$]*$/.test(s.split("=")[0].trim()))return!0;const n=s.split("=")[0].trim();return new RegExp("(^|[^\\w$.])"+n.replace(/\$/g,"\\$")+"(?![\\w$])").test(o)}const yn=3,_n=/^(is|has)[A-Z0-9_$]/,gn=new Set(["routerOptions"]),Go=new WeakSet;function bn(t,o){if(typeof t!="function"||t.length!==2||o&&(_n.test(o)||gn.has(o))||Go.has(t))return!1;const s=ln(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<yn||dn.has(n)?!1:(Go.add(t),!0)}function An(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const r=c[a];if(typeof t[r]!="function"||U.REGISTRY.has(r))continue;const i=r.charCodeAt(0);i>=65&&i<=90||X(r)||v.CSS_PROPS_REGISTRY[r]||v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(r)||i!==45&&((0,j.checkAttributeByTagName)(s,r)||((0,et.isLoudDevRuntime)()&&bn(t[r],r)&&console.warn(`[smbls] custom prop "${r}"${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('${r}', \u2026) instead of reading el.${r}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:r,fn:t[r]})))}for(let a=0;a<e.length;a++){const{prop:r,fn:i}=e[a];o.__exec[r]=i,Object.defineProperty(t,r,{get(){n&&(0,M.pushConfig)(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&(0,M.popConfig)()}},set(f){delete o.__exec[r],Object.defineProperty(t,r,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function xn(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const n=o[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function R(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return xn(t,o),s.apply(this,n)}}function ht(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function P(t,o){return()=>t.path.join(".")+"::"+o}const Ko=new Set;function $(t,o,s){if(!(0,et.isLoudDevRuntime)())return;const n=P(t,o)();Ko.has(n)||(Ko.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Wo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,wn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;Wo.lastIndex=0;let n;for(;(n=Wo.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Sn=(t,o)=>!X(t)&&!(0,q.isCssProp)(o,t),co=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Sn(t,n)&&wn(o,s)},fo=new WeakMap,jt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Et=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?at(t,o):t},Pt=(t,o)=>t&&o?at(t,o):t||o||null,zo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&jt(s,o)},yt=(t,o)=>zo(t,o)?Et(t.__ref.__runtimeSource[o]):null,Ot=(t,o)=>(o&&t&&typeof t=="object"&&fo.set(t,o),t),Cn=t=>{if(!t||typeof t!="object")return;const o=fo.get(t);return o&&fo.delete(t),o},ao=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let n=0;n<t.length;n++)ao(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const e=Object.getOwnPropertyDescriptor(t,n);e&&"value"in e&&ao(e.value,o,s)}}},kn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(U.REGISTRY.has(n)||o&&jt(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),c=e&&e.value;if(!Array.isArray(c))continue;const a=new Set;ao(c,a,new Set),a.size&&(s||(s=new Map),s.set(c,a))}return s},Yo=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,e=n&&n.get(o);if(!e)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of e)c.__authoredTemplates.add(a);return}},qo=["attr","aria","data","metadata"],vn=t=>{if(qo.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},jn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,e),a=c&&c.value,r=!!o&&jt(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!vn(e))continue;const i=r?o[e]:null,f=i&&typeof i=="object"?i:null,d=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const l=r&&(!f||jt(f,u)),_=a[u];if(d&&_&&typeof _=="object"&&!Array.isArray(_)&&qo.includes(u)){for(const g in _)co(g,_[g],s,n,l);continue}co(u,_,s,n,l)}continue}co(e,a,s,n,r)}return s};function Zo(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=jn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const i of e)s.__authoredTemplates.add(i);else s.__authoredTemplates=e;if(An(t),typeof t.text=="function"){const i=t.text,f=R(t,t.textDeps,i),d=(0,E.createEffect)(()=>{if(!s.contentManaged)try{let u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=L.replaceLiteralsWithObjectFields.call(t,u,t.state)),Nt(t,u))}catch(u){$(s,"text",u)}},{depth:s.path.length,label:P(s,"text")});s.__effects.push(d),s.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,f=(0,E.createEffect)(()=>{if(s.contentManaged)return;const d=L.replaceLiteralsWithObjectFields.call(t,i,t.state);d!=null&&(t.text=d),t.node&&Nt(t,d??"")},{depth:s.path.length,label:P(s,"text")});s.__effects.push(f),s.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!U.REGISTRY.has(i)&&!X(i)&&!s.__exec[i]&&!(0,q.isAttributeFirst)(c,i)){if(v.CSS_PROPS_REGISTRY[i]){const f=t[i],d=R(t,t[i+"Deps"],f),u=i;let l,_=null,g=null,y;const p=(0,E.createEffect)(()=>{const A=t.context?.designSystem;A&&(0,M.pushConfig)(A);try{const w=d(t,t.state,t.context);(0,v.pushStaticCssPass)();let h;try{h=v.CSS_PROPS_REGISTRY[u](w,t,t.state,t.context)}finally{(0,v.popStaticCssPass)()}if(Array.isArray(h)){const x={};for(const S of h)if(S)for(const k in S)x[k]=S[k];h=x}const b=u==="show"||u==="hide";if(h&&t.node&&On(h)){const x=_t(h);if(x===null||x!==y){y=x;const S=(0,tt.css)(h,null,t.context?.cssPrefix),k=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(g)for(const C of g)t.node.classList.remove(C);if(k&&k.length)for(const C of k)t.node.classList.add(C);g=k}}l=void 0,_=null}else if(h&&t.node){if(g){for(const S of g)t.node.classList.remove(S);g=null,y=void 0}const x=_t(h);if(x===null||x!==l||!Dt(t.node,_)){l=x;const S=is(t,h);_=Tt(t.node,S)}}else t.node&&b&&(l=void 0,_=null,t.node.style.display="")}finally{A&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(p),s.__exec[i]=f}else if(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(i)){const f=t[i],d=R(t,t[i+"Deps"],f),u=i;let l,_=null;const g=(0,E.createEffect)(()=>{const y=t.context?.designSystem;y&&(0,M.pushConfig)(y);try{const p=d(t,t.state,t.context);if(t.node)if(p!=null){const A=u+":"+String(p);if(A!==l||!Dt(t.node,_)){l=A;const w={[u]:p},h=is(t,w);_=Tt(t.node,h)}}else l=void 0,_=null,t.node.style[u]=""}finally{y&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(g),s.__exec[i]=f}else if(i.charCodeAt(0)===45){const f=t[i];ns(t,i,f,t[i+"Deps"],i),s.__exec[i]=f}}if(Tn(t),typeof t.html=="function"){const i=t.html,f=R(t,t.htmlDeps,i),d=(0,E.createEffect)(()=>{(0,G.withDesignSystem)(t,()=>{const u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)})},{depth:s.path.length,label:P(s,"html")});s.__effects.push(d),s.__exec.html=i}if(typeof t.value=="function"){const i=t.value,f=R(t,t.valueDeps,i),d=(0,E.createEffect)(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=L.replaceLiteralsWithObjectFields.call(t,u,t.state)),mo(t,u)}catch(u){$(s,"value",u)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(d),s.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,f=(0,E.createEffect)(()=>{try{mo(t,L.replaceLiteralsWithObjectFields.call(t,i,t.state))}catch(d){$(s,"value",d)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(f),s.__exec.value=i}if(typeof t.style=="function"){const i=t.style,f=R(t,t.styleDeps,i);let d,u=null,l,_,g,y;const p=(0,E.createEffect)(()=>{const A=f(t,t.state,t.context),w=t.context&&t.context.designSystem;let h;if(A&&typeof A=="object"&&A===l&&w===g){const x=_t(A);h=x!==null&&x===_?y:$t(t,A),_=x}else h=$t(t,A),_=void 0;l=A,g=w,y=h;const b=_t(h);(b===null||b!==d||!Dt(t.node,u))&&(d=b,lo(t.node,u,h),st(t.node,h),u=Tt(t.node,h))},{depth:s.path.length,label:P(s,"style")});s.__effects.push(p),s.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const f=t.style[i];if(typeof f!="function")continue;const d=R(t,ht(t.styleDeps,i),f);let u,l=null;const _=(0,E.createEffect)(()=>{try{const g=d(t,t.state,t.context);if(t.node){const y=i+":"+String(g);if(y!==u||!Dt(t.node,l)){u=y;const p=$t(t,{[i]:g});lo(t.node,l,Object.assign({},p,{[i]:""})),st(t.node,p),l=Tt(t.node,p)}}}catch(g){$(s,"style."+i,g)}},{depth:s.path.length,label:P(s,"style."+i)});s.__effects.push(_)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const f=R(t,ht(t.attrDeps,i),t.attr[i]),d=i,u=(0,E.createEffect)(()=>{try{let l=f(t,t.state,t.context);typeof l=="string"&&l.includes("{{")&&(l=L.replaceLiteralsWithObjectFields.call(t,l,t.state)),t.node?.setAttribute&&Ft(t.node,d,l)}catch(l){$(s,"attr."+d,l)}},{depth:s.path.length,label:P(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const f=t.attr[i],d=i,u=(0,E.createEffect)(()=>{try{const l=L.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(d,(0,j.serializeAttrValue)(d,l??""))}catch(l){$(s,"attr."+d,l)}},{depth:s.path.length,label:P(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const f=t.aria[i];if(typeof f=="string"&&f.includes("{{")){const _=f,g="aria-"+i.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),y=(0,E.createEffect)(()=>{try{const p=L.replaceLiteralsWithObjectFields.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,(0,j.serializeAttrValue)(g,p??""))}catch(p){$(s,"aria."+i,p)}},{depth:s.path.length,label:P(s,"aria."+i)});y._attrName=g,s.__effects.push(y);continue}if(typeof f!="function")continue;const d=R(t,ht(t.ariaDeps,i),t.aria[i]),u="aria-"+i.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),l=(0,E.createEffect)(()=>{try{const _=d(t,t.state,t.context);if(!t.node?.setAttribute)return;Ft(t.node,u,_)}catch(_){$(s,"aria."+i,_)}},{depth:s.path.length,label:P(s,"aria."+i)});l._attrName=u,s.__effects.push(l)}if(t.data&&typeof t.data=="object")for(const i in t.data){const f=t.data[i];if(typeof f=="string"&&f.includes("{{")){const g=f,y="data-"+i.replace(/[A-Z]/g,A=>"-"+A.toLowerCase()),p=(0,E.createEffect)(()=>{try{const A=L.replaceLiteralsWithObjectFields.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,A??"")}catch(A){$(s,"data."+i,A)}},{depth:s.path.length,label:P(s,"data."+i)});p._attrName=y,s.__effects.push(p);continue}if(typeof f!="function")continue;const d=R(t,ht(t.dataDeps,i),t.data[i]),l="data-"+i.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),_=(0,E.createEffect)(()=>{try{const g=d(t,t.state,t.context);if(!t.node?.setAttribute)return;g==null||g===!1?t.node.removeAttribute(l):typeof g!="function"&&typeof g!="object"&&t.node.setAttribute(l,g===!0?"":g)}catch(g){$(s,"data."+i,g)}},{depth:s.path.length,label:P(s,"data."+i)});_._attrName=l,s.__effects.push(_)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const i in a){if(typeof a[i]!="function")continue;const f=R(t,ht(t.classDeps,i),a[i]),d=(0,E.createEffect)(()=>{try{const u=f(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(i):t.node.classList.remove(i)}catch(u){$(s,"class."+i,u)}},{depth:s.path.length,label:P(s,"class."+i)});s.__effects.push(d)}!n&&typeof t.if=="function"&&Jo(t,s,t.if);for(const i of Object.keys(t)){if(U.REGISTRY.has(i)||typeof t[i]!="function")continue;const f=i.charCodeAt(0);if(f>=65&&f<=90||X(i))continue;const d=t[i];s.__exec[i]=d;const u=t.tag||"div";if((0,j.checkAttributeByTagName)(u,i)&&!(0,q.isCssProp)(u,i)){const l=(0,j.camelToAttr)(i)||i,_=R(t,t[i+"Deps"],d),g=(0,E.createEffect)(()=>{try{let y=_(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=L.replaceLiteralsWithObjectFields.call(t,y,t.state)),t.node?.setAttribute&&Ft(t.node,l,y,!0)}catch(y){$(s,i,y)}},{depth:s.path.length,label:P(s,i)});g._attrName=l.toLowerCase(),s.__effects.push(g)}}const r=t.tag||"div";for(const i of Object.keys(t)){if(U.REGISTRY.has(i))continue;const f=t[i];if(typeof f!="string"||!f.includes("{{"))continue;const d=i.charCodeAt(0);if(d>=65&&d<=90||X(i)||(0,q.isCssProp)(r,i)||j.ATTR_TRANSFORMS[i]||!(0,j.checkAttributeByTagName)(r,i))continue;const u=(0,j.camelToAttr)(i)||i,l=(0,E.createEffect)(()=>{try{const _=L.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,j.serializeAttrValue)(u,_??""))}catch(_){$(s,i,_)}},{depth:s.path.length,label:P(s,i)});l._attrName=u.toLowerCase(),s.__effects.push(l)}if($n(t),zn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,f=t.stateDeps;let d=!1,u=[];const l=(0,E.createEffect)(()=>{const _=[];for(let p=0;p<f.length;p++){const A=f[p];try{_[p]=typeof A=="function"?A(t,t.state,t.context):t.state?.[A]}catch{_[p]=void 0}}if(!d){d=!0,u=_;return}let g=_.length!==u.length;for(let p=0;!g&&p<_.length;p++)_[p]!==u[p]&&(g=!0);const y=u;u=_,g&&(0,G.withDesignSystem)(t,()=>{try{i(t,t.state,t.context,{prev:y,next:_})}catch(p){if((0,K.reportLifecycleError)(t,"onStateUpdate",p),t.context?.strictMode)throw p}})},{depth:s.path.length,label:P(s,"onStateUpdate")});s.__effects.push(l)}Un(t)}function Qo(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ds(t,t.parent);return}let n=null;const e=Object.keys(o),c=e.indexOf(t.key);for(let a=c+1;a<e.length;a++){const r=o[e[a]];if(r?.node?.parentNode===s){n=r.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Xo(t){ts(t),mn(t),_s(t),le(t),de(t)}function Jo(t,o,s){let n=R(t,t.ifDeps,s);const e=(0,E.createEffect)(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const i=t.context?.components||{};c.names.some(f=>i[f]||i["smbls."+f])&&(o.__ifLateMerge=null,rn(t,c),n=R(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(i){if(a=!1,o.__ifError=i,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,i?.message||i)}return}const r=o.__if;if(o.__if=!!a,r&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(i){console.error("[smbls] onRemove error:",i)}}else if(!r&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),Qo(t),ts(t),_s(t),N("Render",t,{}),so(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,ot.detectTag)(t)),N("Init",t,{}),t.node||(t.node=(0,ot.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"&&!o.__fragmentAnchor){const f=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(f),o.__fragmentAnchor=f}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),Os(t,{}),Zo(t,{skipIfEffect:!0}),Xo(t),Ts(t,{}),Qo(t),N("Create",t,{}),N("Complete",t,{}),N("Render",t,{}),N("RenderRouter",t,{}),so(t,{})}},{depth:o.path.length,label:P(o,"if")});o.__effects.push(e)}function Nt(t,o){const s=t.node;if(!s)return;const n=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const e=t.__ref;let c=e?e.__textNode:null;if(c&&c.parentNode!==s&&(c=null),!c){const a=s.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):s.firstChild?(c=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(c,s.firstChild)):(s.textContent=n,c=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),e&&(e.__textNode=c||null)}function En(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function Pn(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function Ft(t,o,s,n){s==null||s===!1&&!(0,j.isEnumeratedTrueFalseAttr)(o)?Wt(t,o,null):typeof s=="function"||typeof s=="object"||(n&&o==="src"&&"src"in t?t.src=s:Wt(t,o,(0,j.serializeAttrValue)(o,s)))}function Wt(t,o,s){const n=En(t,o);s==null?t.removeAttribute(o):t.setAttribute(o,s),Pn(t,n)}function mo(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const e=typeof document<"u"&&document.activeElement===s,c=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&c!=null&&a!=null)try{s.setSelectionRange(c,a)}catch{}const r=t.__ref&&t.__ref.__autoGrow;r&&r.active&&r.resize()}function ts(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Nt(t,t.text),ws(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.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 e in t.style)typeof t.style[e]!="function"&&(s[e]=t.style[e]);break}st(o,$t(t,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,j.isEnumeratedTrueFalseAttr)(s)||o.setAttribute&&o.setAttribute(s,(0,j.serializeAttrValue)(s,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),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("{{")||o.dataset&&(o.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&&o.classList.add(n));else if(typeof s=="object")for(const n in s){const e=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];e&&o.classList.add(typeof e=="string"?e:n)}}}}function _t(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function On(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function Tt(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const e in o){if(o[e]==null||e.charAt(0)==="&")continue;const a=J(e);n.push(a,uo(s,a),os(s,a))}return n}function uo(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function os(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function J(t){return(0,H.cssPropName)(t)}function lo(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,e=new Set;if(s&&typeof s=="object")for(const c in s)s[c]==null||c.charAt(0)==="&"||e.add(J(c));for(let c=0;c<o.length;c+=3){const a=o[c];e.has(a)||uo(n,a)===o[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Dt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(uo(s,o[n])!==o[n+1]||os(s,o[n])!==o[n+2])return!1;return!0}const Lt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,ss=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",zt=t=>Lt(t)?t:"--"+t;function Yt(t,o){if(!nt(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let e=t[n];if(typeof e=="function"){if(!o)continue;e=e(o,o.state,o.context)}ss(e)&&(s||(s={}),s[zt(n)]=e)}return s}function ns(t,o,s,n,e){es(t,e,R(t,n,s),c=>ss(c)?{[o]:c}:null)}function es(t,o,s,n,e){const c=t.__ref;let a,r=null;const i=(0,E.createEffect)(()=>{(0,G.withDesignSystem)(t,()=>{try{const f=n(s(t,t.state,t.context)),d=t.node;if(!d||!d.style)return;const u=_t(f);(u===null||u!==a||!Dt(d,r))&&(a=u,lo(d,r,f),f&&st(d,f),r=f?Tt(d,f):null,e&&e(f))}catch(f){$(c,o,f)}})},{depth:c.path.length,label:P(c,o)});c.__effects.push(i)}function Tn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){Dn(t,s),o.__exec.vars=s;return}if(nt(s))for(const n of Object.keys(s)){const e=s[n];!n||typeof e!="function"||ns(t,zt(n),e,ht(t.varsDeps,n),"vars."+n)}}function Dn(t,o){const s=t.__ref;es(t,"vars",R(t,t.varsDeps,o),n=>Yt(n),n=>{s.__varsInline=n?new Set(Object.keys(n)):null})}function po(t,o){if(typeof t[o]=="function"&&((0,q.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Lt(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!nt(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&zt(n)===o)return!0;return!1}function Ln(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(J(s)));return o}function Rn(t,o,s,n){const e=t.__ref;if(!e)return;let c=null;if(s)for(const a of s){if(n&&n.has(a))continue;const r=o[a];if(r==null||typeof r=="object")continue;const i=J(a);H.CSS_LONGHAND_SHORTHANDS[i]&&(c||(c={}),c[i]=r)}e.__declaredLonghands=c}function rs(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const c in n){if(o.has(c))continue;const a=H.CSS_LONGHAND_SHORTHANDS[c];let r=!1;for(let i=0;i<a.length;i++)if(o.has(a[i])){r=!0;break}r&&(e||(e={}),e[c]=n[c])}return e}function is(t,o){const s=t.node;st(s,o);const n=Ln(o);if(!n)return o;const e=t.__ref;if(e)if(e.__inlineCssKeys)for(const a of n)e.__inlineCssKeys.add(a);else e.__inlineCssKeys=new Set(n);const c=rs(t,n);return c?(st(s,c),Object.assign({},o,c)):o}function Mn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=rs(t,o.__inlineCssKeys);s&&st(t.node,s)}function $t(t,o){return!o||typeof o!="object"?o:(0,G.withDesignSystem)(t,()=>{try{return(0,v.resolveStyleBlockTokens)(o,t)}catch{return o}})}function st(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const e=o[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){s||(s={}),s[n]=e;continue}try{const c=String(e),a=(0,H.cssPropName)(n),r=c.trim(),i=/\s*!important\s*$/.test(r),f=r.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,i?"important":"")}catch{}}}s&&Nn(t,s)}function Nn(t,o){const s=`_ds${jo.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let e=n.querySelector("style[data-smbls-scoped]");e||(e=n.createElement("style"),e.setAttribute("data-smbls-scoped",""),n.head.appendChild(e));let c="";for(const a in o){const r="."+s,i=a.replace(/&/g,r).split(",").map(d=>{const u=d.trim();return u.includes(r)?u:r+u}).join(", "),f=o[a];if(typeof f=="object"){let d="",u="";for(const l in f){const _=f[l];if(typeof _=="object"){const g=l.includes("&")?i.split(", ").map(p=>l.replace(/&/g,p)).join(", "):i.split(", ").map(p=>`${p} ${l}`).join(", ");let y="";for(const p in _)y+=`${J(p)}: ${_[p]};`;u+=(0,tt.wrapHoverRule)(`${g} { ${y} }`,g)+`
|
|
5
|
-
`}else d+=`${
|
|
6
|
-
`),u&&(c+=u)}}c&&(e.textContent+=c)}const cs=new Set;function fs(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function Fn(t,o,s){const n=fs(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(fs(e)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";cs.has(c)||(cs.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(e)?e.join(", "):String(e)}]. 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 $n(t){const o=t.subscribeTo,s=typeof o=="function";let n=o;if(s)try{n=o(t,t.state,t.context)}catch{n=null}if(s&&(0,et.isLoudDevRuntime)()&&Fn(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let c=0;c<n.length;c++){const a=n[c];if(typeof a!="string"||a.length===0)continue;const r=a.split("."),i=r[0],f=r.slice(1),d={value:!1},u=(0,E.createEffect)(()=>{const l=t.state&&((0,I.isStore)(t.state)?t.state.root:null);if(!l||!(0,I.isStore)(l))return;let _=l;_=_[i];for(let y=0;y<f.length&&!(_==null||typeof _!="object");y++)if((0,I.isStore)(_))_=_[f[y]];else break;if(!d.value)return;let g=!1;if(typeof t.onBeforeUpdate=="function"&&(0,G.withDesignSystem)(t,()=>{try{if(Fs(e)){const y=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});y&&typeof y.then=="function"?y.then(()=>It(e,!1),p=>{It(e,!0),(0,K.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}):(It(e,!1),y===!1&&(g=!0))}}catch(y){It(e,!0),(0,K.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}}),!g&&t.node&&e.__effects)for(let y=0;y<e.__effects.length;y++){const p=e.__effects[y];p&&p!==u&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}!g&&typeof t.onUpdate=="function"&&(0,G.withDesignSystem)(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(y){(0,K.dispatchPluginHook)("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}})},{depth:e.path.length,label:P(e,"subscribeTo("+a+")")});d.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function ho(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function yo(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const as=new Set;function In(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;as.has(n)||(as.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.`))}const us=new Map;function Bn(t){let o=us.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push((0,H.cssCamelName)(e))};return s(H.CSS_LONGHAND_SHORTHANDS[t]),s(H.CSS_SHORTHAND_LONGHANDS[t]),us.set(t,o),o}function ds(t,o,s){if(po(t,o)||s&&s.has(o))return!0;const n=Bn(J(o));for(let e=0;e<n.length;e++){const c=n[e];if(po(t,c)||s&&s.has(c))return!0}return!1}function gt(t,o,s,n){const e={},c=new Set,a=(r,i,f)=>{const d=f?new Set(Object.keys(e)):null;if(v.CSS_PROPS_REGISTRY[r]){const u=v.CSS_PROPS_REGISTRY[r](i,o,o.state,o.context);if(u){const l=Array.isArray(u)?u:[u];for(const _ of l)_&&Object.assign(e,_)}}else e[r]=i;if(f)for(const u in e)d.has(u)||c.add(u)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(o,o.state,o.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let l=i[u];typeof l=="function"&&(l=l(o,o.state,o.context)),!(l==null||typeof l=="function")&&a(u,l,ds(o,u,n))}continue}if(r==="vars"){const u=Yt(i,o);if(u)for(const l in u)a(l,u[l],po(o,l)||!!(n&&n.has(l)));continue}if(ho(r,o)){const u=gt(i,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){(0,et.isLoudDevRuntime)()&&In(r,o);continue}const f=yo(r,o),d=gt(i,o,!1,n);Object.keys(d).length&&(e[f]=d);continue}a(r,i,ds(o,r,n))}}if(s)for(const r in e)c.add(r);for(const r of c){const i=e[r];typeof i=="string"&&!i.includes("!important")&&(e[r]=i+" !important")}return e}const nt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function ls(t,o){for(const s in o){const n=o[s];t[s]=nt(n)?ls(nt(t[s])?t[s]:{},n):n}return t}function Hn(t,o){if(!nt(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;nt(e)&&(s=ls(s||{},e))}return s}function _o(t,o){if(o===void 0&&(o=0),o>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)&&_o(t[s],o+1))return!0}return!1}function ps(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(ho(t,s)){const c=gt(o,s,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=yo(t,s),e=gt(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function Un(t){const o=t.__ref;for(const s of Object.keys(t)){if(!no(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!_o(n))continue;let e=null,c;const a=(0,E.createEffect)(()=>{if(!t.node)return;const r=t.context?.designSystem;r&&(0,M.pushConfig)(r);let i,f=!1;try{const d=ps(s,n,t),u=d?_t(d.block)+"::"+d.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,d){const l=(0,tt.css)({[d.cssProp]:d.block},null,t.context?.cssPrefix);i=l?l.split(" ").filter(Boolean):null}else i=null}finally{r&&(0,M.popConfig)()}if(!(f||!t.node.classList)){if(e)for(const d of e)t.node.classList.remove(d);if(i&&i.length)for(const d of i)t.node.classList.add(d);e=i}},{depth:o.path.length,label:P(o,"cssBlock("+s+")")});o.__effects.push(a)}}const Vn=()=>!0,Gn=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!v.CSS_PROPS_REGISTRY[t]||!!(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(t))||Lt(t)||t==="vars"};function Kn(t,o,s){const n={};let e=!1;for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(r!=="data"&&r!=="aria"&&(Gn(r,s[r])||U.REGISTRY.has(r))?n[r]=!0:e=!0);if(!e)return null;const c=(0,j.extractConditionalAttrs)({[o]:s},t.tag||"div",n,Vn);let a=null;for(const r in c)/^on/i.test(r)||(a||(a={}),a[r]=c[r]);return a}function hs(t,o,s,n,e,c){const a=t.node;let r=null;const i=f=>{(r||(r=[])).push(f)};for(const f in n){const d=o.owners.get(f),u=d===s;if(!c&&d!==void 0&&!u)continue;let l;try{l=n[f](t)}catch(g){$(t.__ref,"conditional("+s+")."+f,g),u&&i(f);continue}if(typeof l=="string"&&l.includes("{{")&&(l=L.replaceLiteralsWithObjectFields.call(t,l,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){i(f);continue}if(l==null||typeof l=="object"||typeof l=="function"){u&&ys(a,o,f);continue}const _=l===!1&&!(0,j.isEnumeratedTrueFalseAttr)(f)?null:String((0,j.serializeAttrValue)(f,l));i(f),!(u&&_===o.written.get(f))&&(d===void 0&&o.base.set(f,a.getAttribute(f)),Wt(a,f,_),o.owners.set(f,s),o.written.set(f,_))}e.appliedAttrs=r}function ys(t,o,s){t.getAttribute(s)===o.written.get(s)&&Wt(t,s,o.base.get(s)),o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function Wn(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const c of e)o.owners.get(c)===s&&ys(t.node,o,c)}function _s(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const n of o.owners.keys()){const e=o.written.get(n),c=s.getAttribute(n);c!==e&&(o.base.set(n,c),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function zn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const c=e.charAt(0);if(c!=="."&&c!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const p=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${p}: { '${a.slice(p.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const i=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},d=Kn(t,e,r);d&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const p in r){if(!Object.prototype.hasOwnProperty.call(r,p))continue;const A=p.charAt(0),w=r[p];if(!((A===":"||A==="@"||A==="&"||A==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(p==="vars"&&nt(w)){for(const h of Object.keys(w))h&&u.add(zt(h));continue}u.add(p)}}const l=()=>{let p;const A=t[a];if(A===void 0){const b=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(b||x!==void 0)p=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{p=typeof S=="function"?S.call(t,t):S}catch(k){p=!1,o.__conditionalError=k,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,k?.message||k)}}}else if(typeof A=="function")try{p=A(t,t.state,t.context)}catch(b){p=!1,o.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else p=A;const w=i?!p:!!p;if(!t.node)return;const h=t.context?.designSystem;if(w===f.lastMatch){if(w&&d&&t.node.setAttribute){h&&(0,M.pushConfig)(h);try{hs(t,s,e,d,f,!1)}finally{h&&(0,M.popConfig)()}}return}f.lastMatch=w,h&&(0,M.pushConfig)(h);try{if(w){const b={},x={};let S=!1;for(const C in r){if(!Object.prototype.hasOwnProperty.call(r,C))continue;const F=r[C],rt=C.charAt(0);if((rt===":"||rt==="@"||rt==="&"||rt==="[")&&F&&typeof F=="object"&&!Array.isArray(F)){if(ho(C,t)){const T=gt(F,t,!1,u);Object.keys(T).length&&(x[`[data-theme="${C.slice(1)}"] &`]=T,S=!0)}else{const T=yo(C,t),B=gt(F,t,!1,u);Object.keys(B).length&&(x[T]=B,S=!0)}continue}const it=typeof F=="function"?F(t,t.state,t.context):F;if(it!=null){if(v.CSS_PROPS_REGISTRY[C]){const T=v.CSS_PROPS_REGISTRY[C](it,t,t.state,t.context);if(T){const B=Array.isArray(T)?T:[T];for(const xt of B)xt&&Object.assign(b,xt)}}else if(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(C))b[C]=it;else if(Lt(C))b[C]=it;else if(C==="vars"){const T=Yt(it,t);T&&Object.assign(b,T)}}}const k=Object.keys(b);if(k.length){st(t.node,b);for(const C of k)n.set(C,e);f.appliedKeys=k}else f.appliedKeys=null;if(S){const C=(0,tt.css)(x,null,t.context?.cssPrefix,{state:!0}),F=C?C.split(" ").filter(Boolean):[];if(F.length&&t.node.classList){for(const rt of F)t.node.classList.add(rt);f.appliedClasses=F}else f.appliedClasses=null}else if(f.appliedClasses){for(const C of f.appliedClasses)t.node.classList.remove(C);f.appliedClasses=null}d&&t.node.setAttribute&&hs(t,s,e,d,f,!0)}else{if(f.appliedAttrs&&Wn(t,s,e,f),f.appliedKeys){for(const b of f.appliedKeys)n.get(b)===e&&(Lt(b)?t.node.style.removeProperty(b):t.node.style[b]="",n.delete(b));f.appliedKeys=null}if(f.appliedClasses){for(const b of f.appliedClasses)t.node.classList.remove(b);f.appliedClasses=null}}}finally{h&&(0,M.popConfig)()}};o.__conditionalRunners.push(l);const _=R(t,t[a+"Deps"],l),g=(0,E.createEffect)(_,{depth:o.path.length,label:P(o,"conditional("+e+")")}),y=o.__exec&&o.__exec[a]||t[a];g._sources.size===0&&typeof y=="function"&&(0,et.isLoudDevRuntime)()&&pn(y)&&console.warn(`[smbls] conditional \`${e}\` 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 \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(g)}}const go=new WeakSet,bo=new WeakMap;function Yn(t){const o=bo.get(t);if(o==="painted")return!1;if(o===void 0){bo.set(t,"open");const s=t.defaultView,n=()=>{bo.set(t,"painted")};s&&typeof s.requestAnimationFrame=="function"?s.requestAnimationFrame(n):setTimeout(n,0)}return!0}function qn(t){const o=t.ownerDocument;!o||go.has(o)||Yn(o)||(go.add(o),queueMicrotask(()=>{go.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const Ao=new WeakSet;let gs=!1;function bs(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function xo(t,o){const s={...t};for(const n in o){const e=o[n],c=s[n];s[n]=e&&typeof e=="object"&&c&&typeof c=="object"?xo(c,e):e}return s}function As(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const c=As(e,o);Object.keys(c).length&&(s[n]=c)}else o.has(n)||(s[n]=e)}return s}function Zn(t,o,s){let n=1/0,e=-1/0;for(const a of o.values())a<n&&(n=a),a>e&&(e=a);if(s)for(const a of s.values())a>e&&(e=a);if(e<=n)return null;let c=null;for(const[a,r]of o){if(r===e)continue;const i=Qn(a);if(i)for(let f=0;f<i.length;f+=3){const d=i[f],u=i[f+1],l=i[f+2],_=t[u]!=null?o.get(u):void 0,g=s&&s.get(d),y=_!==void 0&&_>r&&(0,H.cssShorthandStatesLonghand)(d,t[u],l),p=!y&&g!==void 0&&g>r&&(0,H.cssShorthandStatesLonghand)(d,void 0,l);if(y||p){y&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const xs=new Map;function Qn(t){let o=xs.get(t);if(o!==void 0)return o;const s=J(t),n=H.CSS_LONGHAND_SHORTHANDS[s];if(o=null,Array.isArray(n)){o=[];for(const e of n)o.push(e,(0,H.cssCamelName)(e),s)}return xs.set(t,o),o}function ws(t){const{node:o}=t;if(!o)return;if(gs||(gs=!0,(0,tt.css)({display:"none"})),Ao.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Ao.add(t);const s=t.context?.designSystem;s&&(0,M.pushConfig)(s),(0,v.pushStaticCssPass)();try{const n={};let e=!1,c=[],a=null,r=null,i=null;const f=t.__ref&&t.__ref.__mergeLayer;let d,u=null,l=null;const _=(h,b)=>{if(b&&typeof b=="object"&&bs(h)){r||(r={});const x=r[h];x&&(b=xo(x,b)),r[h]=b}else(b===null||typeof b!="object")&&(i||(i=new Set),i.add(h),d!==void 0&&(u||(u=new Map),u.set(h,d)));n[h]=b};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&v.CSS_PROPS_REGISTRY.theme){const h=v.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(h){const b=x=>{for(const S in x){const k=x[S];k&&typeof k=="object"&&bs(S)&&(a||(a={}),a[S]=k),n[S]=k}};if(Array.isArray(h))for(const x of h)x&&b(x);else b(h);e=!0}}const g=(h,b)=>{if(h==="vars"){const x=Yt(b);if(x){for(const S in x)_(S,x[S]);e=!0}return}if(v.CSS_PROPS_REGISTRY[h]){const x=v.CSS_PROPS_REGISTRY[h](b,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const k in S)_(k,S[k])}else for(const S in x)_(S,x[S]);e=!0}}else if(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(h))b!=null&&typeof b!="object"&&(_(h,b),e=!0);else if(h.charCodeAt(0)===45)b!=null&&typeof b!="object"&&(_(h,b),e=!0);else if((h.charAt(0)==="&"||h.charAt(0)==="@"||h.charAt(0)===":"||h.charAt(0)==="[")&&b&&typeof b=="object"&&!Array.isArray(b)){if(_o(b))return;const x=ps(h,b,t);x&&(_(x.cssProp,x.block),e=!0)}};if(typeof t.class=="string"){const h=Hn(t.class,t.context?.designSystem?.class);if(h)for(const b in h)g(b,h[b])}const y=i?new Set(i):null,p=t.tag||"div";for(const h of Object.keys(t)){if(typeof t[h]=="function"){const x=f&&f.get(h);x!==void 0&&(0,q.isCssProp)(p,h)&&(l||(l=new Map),l.set(J(h),x));continue}if(d=f?f.get(h):void 0,h==="vars"){g(h,t[h]);continue}if(U.REGISTRY.has(h)||h==="theme")continue;const b=h.charCodeAt(0);b>=65&&b<=90||X(h)||(0,q.isAttributeFirst)(p,h)||g(h,t[h])}d=void 0;const A=u?Zn(n,u,l):null;if(a)for(const h in a){let b=i?As(a[h],i):a[h];r&&r[h]&&(b=xo(b,r[h])),Object.keys(b).length?n[h]=b:delete n[h]}if(Rn(t,n,i,A?new Set([...y||[],...A]):y),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const h=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof h=="string"&&h!==""&&n.display&&n.display!==h&&(n.display=h);const b=(0,tt.css)(n,null,t.context?.cssPrefix);if(c=b?b.split(" ").filter(Boolean):[],b&&o.classList){const x=c;let S=!1;for(const k of x)o.classList.add(k),S||(k.charCodeAt(0)===95&&k.charCodeAt(1)===99||k.charCodeAt(0)===95&&k.indexOf("_c",1)!==-1)&&(S=!0);S&&qn(o)}}const w=t.__ref;if(w){const h=w.__staticCssClasses;if(h&&o.classList){const b=new Set(c);for(const x of h)b.has(x)||o.classList.remove(x)}w.__staticCssClasses=c}Mn(t)}finally{(0,v.popStaticCssPass)(),s&&(0,M.popConfig)(),Ao.delete(t)}}const Xn=t=>!!v.CSS_PROPS_REGISTRY[t]||!!(v.DEFAULT_CSS_PROPERTIES_LIST&&v.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Jn(t){t&&t.node&&ws(t)}function mn(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const c=t.aria[e];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());o.setAttribute(a,(0,j.serializeAttrValue)(a,c))}const s=(0,j.applyAttrTransforms)(t);for(const e in s){const c=s[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(e,c===!0?"":c)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||U.REGISTRY.has(e)||e==="on"||s[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!X(e)&&!(0,q.isCssProp)(n,e)&&(0,j.checkAttributeByTagName)(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!j.ATTR_TRANSFORMS[e])continue;a=L.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,j.isEnumeratedTrueFalseAttr)((0,j.camelToAttr)(e)||e))continue;const r=(0,j.camelToAttr)(e)||e;o.setAttribute(r,(0,j.serializeAttrValue)(r,a))}}}function te(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||X(o))return;const e=t.tag||"div";if((0,q.isCssProp)(e,o)||!(0,j.checkAttributeByTagName)(e,o))return;const c=(0,j.camelToAttr)(o)||o,a=c.toLowerCase(),r=t.__ref&&t.__ref.__effects;let i=!1;if(r)for(let u=0;u<r.length;u++){const l=r[u];l&&l._attrName===a&&!l._disposed&&typeof l._execute=="function"&&(i=!0,l._execute())}if(i)return;let f=t[o];const d=j.ATTR_TRANSFORMS[o];if(d&&f!=null){const u=d(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=L.replaceLiteralsWithObjectFields.call(t,f,t.state)),Ft(s,c,f)}function oe(t,o){const s=t.node,n=t.__ref;let e=n.__autoGrow;if(!o){if(e&&e.active){try{s.removeEventListener("input",e.resize)}catch{}Cs(e),ct.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),js(s,e,!1),e.active=!1,e.appliedMax=null,e.lastMeasure=0}return}e||(e=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Rt(t,!0);return}if(!(s.scrollHeight>0)){e.awaitingLayout=!0,Ss(t,e);return}e.awaitingLayout=!1;const a=ee(s),r=re(a),i=s.style.height;s.style.height="0px",r&&So(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=i,r&&So(s);return}const d=ie(s,a),u=d!=null&&f<d?d:f,l=ae(a),_=l!=null&&u>l;s.style.height=fe(_?l:u,a)+"px",r&&So(s),js(s,e,_),e.lastMeasure=f,e.lastWidth=s.clientWidth,Ss(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}Cs(e),ct.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,ne(t,e));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=c,e.appliedMax=c),e.resize()}function Rt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),ct.add(t),Vt())}function se(){const t=Array.from(ct);ct.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,e=s.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=pt()),e.attachAttempts+=1,e.attachAttempts<=Oo&&pt()-e.firstAttemptAt<To&&(ct.add(s),Vt());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function Ss(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const c=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Rt(t,!0);return}const r=s.clientWidth;o.lastWidth!=null&&Math.abs(r-o.lastWidth)<.5||(o.lastWidth=r,Rt(t,!0))};let a;try{a=new e(c),a.observe(s)}catch{return}o.watch=a}function Cs(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function ne(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,n=s&&s.fonts&&s.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{o.active&&t.node&&Rt(t,!0)},()=>{})}function ee(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const ft=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,wo=t=>(ft(t.paddingTop)||0)+(ft(t.paddingBottom)||0),ks=t=>(ft(t.borderTopWidth)||0)+(ft(t.borderBottomWidth)||0);function re(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let n=0;n<o.length;n++){const e=o[n].trim();if(!(e!=="all"&&e!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function So(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const n=o[s];if(n&&n.transitionProperty==="height")try{n.cancel()}catch{}}}function ie(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const n=ft(o.lineHeight)||ce(t,o);return n>0?s*n+wo(o):null}const Mt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],vs=new WeakMap;function ce(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let e=vs.get(s);e||(e=new Map,vs.set(s,e));const c=Mt.map(f=>o[f]||"").join("|");if(e.has(c))return e.get(c);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const r=a.style;r.position="absolute",r.visibility="hidden",r.top="0",r.left="-9999px",r.height="auto",r.minHeight="0",r.maxHeight="none",r.padding="0",r.border="0",r.boxSizing="content-box",r.overflow="hidden";for(let f=0;f<Mt.length;f++)o[Mt[f]]&&(r[Mt[f]]=o[Mt[f]]);let i=0;try{n.appendChild(a),i=a.clientHeight}catch{i=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return i>0?(e.set(c,i),i):null}function fe(t,o){return o?o.boxSizing==="border-box"?t+ks(o):o.boxSizing==="content-box"?Math.max(0,t-wo(o)):t:t}function ae(t){if(!t)return null;const o=ft(t.maxHeight);if(o==null||!(o>0))return null;const s=wo(t),n=ks(t),e=t.boxSizing==="border-box"?o-n:o+s,c=ft(t.lineHeight);if(!(c>0))return e;const a=Math.floor((e-s)/c+1e-6);return a>=1?a*c+s:e}function js(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const Es=["srcObject","muted"],ue=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function de(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Es.length;n++){const e=Es[n],c=t[e];if(c===void 0||!(e in o))continue;const a=r=>{const i=ue(e,r);if(o[e]!==i)try{o[e]=i}catch(f){$(s,e,f)}};if(typeof c=="function"){const r=R(t,t[e+"Deps"],c),i=(0,E.createEffect)(()=>{try{a(r(t,t.state,t.context))}catch(f){$(s,e,f)}},{depth:s.path.length,label:P(s,e)});s.__effects.push(i),s.__exec[e]=c}else a(c);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function le(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,e=typeof n=="function"?R(t,t.autoGrowDeps,n):null,c=(0,E.createEffect)(()=>{const a=t.autoGrow;let r=a;if(typeof a=="function")try{r=(a===n&&e?e:a)(t,t.state,t.context)}catch{r=null}oe(t,r)},{depth:s.path.length,label:P(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(c),e&&(s.__exec.autoGrow=n)}const Ps=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Os(t,o){for(const s of Object.keys(t)){if(!X(s)||Ps.has(s))continue;const n=(0,bt.globalEventKeyInfo)(s);if(n){(0,bt.registerGlobalEvent)(n,t,t[s]);continue}let e=t[s],c=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(c=e,e=c.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const r=e;e=function(f){return t.call(r,f)}}if(typeof e!="function")continue;const a=tn(s);U.LIFECYCLE_EVENTS.has(a)||(0,bt.registerEvent)(on(a),t,e,c)}pe(t)}function pe(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const l of Ps){const _=t[l];typeof _=="function"&&(s[l]=_,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,r=0,i=0,f=!1;const d=l=>{const _=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];_&&(a=_.clientX,r=_.clientY,i=Date.now(),f=!0)},u=l=>{if(!f)return;f=!1;const _=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!_)return;const g=_.clientX-a,y=_.clientY-r,p=Date.now()-i;if(p>c)return;const A=Math.abs(g),w=Math.abs(y);if(Math.max(A,w)<e)return;let h;if(A>w*1.2)h=g<0?"left":"right";else if(w>A*1.2)h=y<0?"up":"down";else return;const b="onSwipe"+h.charAt(0).toUpperCase()+h.slice(1),x=s[b],S=s.onSwipe;x&&x.call(t,l,t,t.state,t.context),S&&S.call(t,{direction:h,dx:g,dy:y,dt:p,event:l},t,t.state,t.context)};o.addEventListener("touchstart",d,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",d)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function at(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=at(e,c):s[n]=c}return s}function Co(t,o,s,n,e){if(!o||!t.node)return;const c=t.childExtends,a=yt(t,"childProps");if(Array.isArray(o)){const r=t.tag==="fragment",i=t.context?.document||globalThis.document,f=r?null:i?.createDocumentFragment();if(!r&&!f)return;const d=t.childProps,u=t.childrenAs,l=w=>{let h=o[w];const b=h;(typeof h=="string"||typeof h=="number")&&(h={text:h});let x=d;if(typeof d=="function")try{x=d(t,h)}catch{x=null}let S=typeof d=="function"?Et(x):a;if(e&&u!=="state"&&(S=Pt(S,Et(b))),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=at(x,h));if(c&&!h.ignoreChildExtends)if(h.extends){const C=Array.isArray(h.extends)?h.extends:[h.extends],F=Array.isArray(c)?c:[c];h={...h,extends:[...F,...C]}}else h={...h,extends:c};const k=Lo(h?.key,b,w,t);try{return m(Ot(h,S),t,k,s)}catch(C){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${F} (initial render, skipping this row):`,C?.message||C)}return null}},_=t.__ref;if(!(n===!0&&!r&&!!_&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const h=l(w);!r&&h?.node&&f.appendChild(h.node)}return r||t.node.appendChild(f),!0}const y=_.__childrenChunkGen=(_.__childrenChunkGen||0)+1;(0,z.openMountBudget)();let p=null;const A=w=>{if(_.__disposed||_.__childrenChunkGen!==y){p&&p.parentNode&&p.remove();return}for(let h=w;h<o.length;h++){const b=l(h);if(b?.node&&(p?t.node.insertBefore(b.node,p):f.appendChild(b.node)),h+1<o.length&&(0,z.mountBudgetExhausted)()){p||(p=i.createComment("smbls-mount"),f.appendChild(p),t.node.appendChild(f));const x=h+1;(0,z.enqueueMountWork)(()=>A(x));return}}p?(p.remove(),t.node.tagName==="SELECT"&&qt(t,!0)):t.node.appendChild(f)};return A(0),(0,z.closeMountBudget)(),!0}if(typeof o=="string"){const r=Io(o,t);if(Array.isArray(r))return Co(t,r,s,n,!0)}if(typeof o=="object")for(const r in o){if(U.REGISTRY.has(r))continue;let i=o[r];if(i==null||i===!1)continue;const f=e?Pt(a,Et(i)):a;if((typeof i=="string"||typeof i=="number")&&(i={text:i}),t.childProps&&(i=at(t.childProps,i)),c&&!i.ignoreChildExtends)if(i.extends){const d=Array.isArray(i.extends)?i.extends:[i.extends],u=Array.isArray(c)?c:[c];i={...i,extends:[...u,...d]}}else i={...i,extends:c};m(Ot(i,f),t,Kt(t,r),s)}}function qt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const e=t.__ref,c=e&&e.__exec&&e.__exec.value,a=typeof c=="function",r=t.value!=null&&typeof t.value!="function";if(a||r){let d;if(a)try{d=c(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=L.replaceLiteralsWithObjectFields.call(t,d,t.state));const u=d==null?"":String(d);s.value!==u&&(s.value=u);return}const i=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!i)return;let f=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(f=d);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function Ts(t,o){let{children:s,content:n}=t;const e=t.childExtends,c=typeof s=="function"||zo(t,"children");if(typeof s=="function"){const g=s;try{s=g(t,t.state,t.context)}catch(h){if(s=void 0,typeof console<"u"&&console.error){const b=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${b} (initial run, treating as empty):`,h?.message||h)}}Yo(t,s),t.children=s;const y=t.__ref;let p=!1;const A=R(t,t.childrenDeps,g),w=(0,E.createEffect)(()=>{const h=p;p=!0;let b;try{b=A(t,t.state,t.context)}catch(T){if(typeof console<"u"&&console.error){const B=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${B}${h?"":" (initial tracking run)"}:`,T?.message||T)}return}if(!h||b===t.children)return;Yo(t,b),t.children=b,y.__childrenChunkGen!=null&&y.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,k=x?[]:null,C=x?[]:null;if(Array.isArray(b)&&t.childrenAs==="state"){const T=t.childProps,B=[],xt=new Map;for(let O=0;O<b.length;O++){const Y=b[O];let D=T;if(typeof T=="function")try{D=T(t,Y)}catch{D=null}const Q=Lo(D&&D.key,Y,O,t);B.push(Q),xt.set(Q,{rawChild:Y,childProps:D})}const $s=new Set(B),Is=y.__children.slice();for(const O of Is)if(!$s.has(O)){const Y=t[O];Y?.remove&&Y.remove(),delete t[O],k&&k.push(O)}const wt=t.childExtends,Bt=t.tag==="fragment",Bs=t.context?.document||globalThis.document,St=Bt?null:Bs?.createDocumentFragment(),Xt=new Set;for(const O of B){const Y=xt.get(O),D=Y.rawChild,Q=t[O];if(Q&&Q.state){if(D&&typeof D=="object"){const V=Q.state,dt=V.$replace||V.replace,ko=V.$update||V.update;try{if(typeof dt=="function")dt.call(V,D);else if(typeof ko=="function"){for(const W in V)if(!(W==="__element"||W==="root"||W==="parent"||W==="update")&&!Object.prototype.hasOwnProperty.call(D,W))try{V[W]=void 0}catch{}ko.call(V,D)}else for(const W in D)V[W]=D[W]}catch(W){if(typeof console<"u"&&console.error){const Us=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${O}" failed to patch at ${Us} (reconcile, keeping its previous data for this pass):`,W?.message||W)}}}C&&C.push(O);continue}let Jt=D;(typeof D=="string"||typeof D=="number")&&(Jt={value:D,text:D});const mt=Y.childProps;let Z=mt?{...mt,state:Jt}:{state:Jt};const Hs=typeof T=="function"?Et(mt):yt(t,"childProps");if(wt&&!Z.ignoreChildExtends)if(Z.extends){const V=Array.isArray(Z.extends)?Z.extends:[Z.extends],dt=Array.isArray(wt)?wt:[wt];Z={...Z,extends:[...dt,...V]}}else Z={...Z,extends:wt};let to;try{to=m(Ot(Z,Hs),t,O,o)}catch(V){if(typeof console<"u"&&console.error){const dt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${O}" failed to construct at ${dt} (reconcile, skipping this row):`,V?.message||V)}Xt.add(O);continue}!Bt&&to?.node&&St&&St.appendChild(to.node),S&&S.push(O)}if(!Bt&&St&&St.childNodes.length&&t.node&&t.node.appendChild(St),!Bt&&t.node){let O=null;for(const Y of B){const D=t[Y]?.node;if(!D)continue;const Q=O?O.nextSibling:t.node.firstChild;D!==Q&&t.node.insertBefore(D,Q),O=D}}y.__children=Xt.size?B.filter(O=>!Xt.has(O)):B,x&&(S.length||k.length)&&Do(t,{added:S,removed:k,kept:C}),qt(t,!1);return}const it=x?[...y.__children]:null;for(const T of[...y.__children]){const B=t[T];B?.remove&&B.remove(),delete t[T]}y.__children=[],Co(t,b,o,!1,!0),qt(t,!1),x&&Do(t,{added:[...y.__children],removed:it,kept:[]})},{depth:y.path.length,label:P(y,"children")});y.__effects.push(w)}const a=Co(t,s,o,!0,c);if(n!=null&&!(n&&n.__ref)){let g=n;if(typeof g=="string"||typeof g=="number"?g={text:g}:typeof g!="object"&&(g={}),t.childProps&&(g=at(t.childProps,g)),e&&!g.ignoreChildExtends)if(g.extends){const p=Array.isArray(g.extends)?g.extends:[g.extends],A=Array.isArray(e)?e:[e];g={...g,extends:[...A,...p]}}else g={...g,extends:e};const y=Pt(yt(t,"childProps"),yt(t,"content"));m(Ot(g,y),t,"content",o)}if(s&&!a)return;const r=t.context?.components||{},i=t.__ref&&t.__ref.__runtimeSource,f=i?{}:null;{const g=Object.keys(t);for(let y=0;y<g.length;y++){const p=g[y];if(!p.endsWith("Extends")||typeof t[p]!="string")continue;const A=p.slice(0,-7);if(!A||A.charCodeAt(0)<65||A.charCodeAt(0)>90)continue;const w={extends:t[p]};delete t[p];for(let h=y+1;h<g.length;h++){const b=g[h],x=b.charCodeAt(0);if(x>=65&&x<=90||U.REGISTRY.has(b)||typeof t[b]=="function"&&(b.startsWith("on")||b.startsWith(".")))break;const S=t[b];S!==void 0&&(w[b]=S,delete t[b],f&&jt(i,b)&&(f[A]||(f[A]={}),f[A][b]=i[b]))}t[A]&&typeof t[A]=="object"?t[A]={...w,...t[A]}:t[A]=w}}const d=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),l=g=>{if(U.REGISTRY.has(g)||typeof t[g]!="object"||t[g]===null)return;const y=g.charCodeAt(0);if(y<65||y>90)return;let p=t[g];if(p.__ref)return;if(!p.extends&&!p.extend){const w=r[g]||r[`smbls.${g}`];w&&(p={...p,extends:w})}if(t.childProps&&(p=at(t.childProps,p)),e&&!p.ignoreChildExtends)if(p.extends){const w=Array.isArray(p.extends)?p.extends:[p.extends],h=Array.isArray(e)?e:[e];p={...p,extends:[...h,...w]}}else p={...p,extends:e};const A=i?Pt(yt(t,"childProps"),Pt(f[g]||null,yt(t,g))):null;m(Ot(p,A),t,g,o)};if(!d){for(const g of u)l(g);return}(0,z.openMountBudget)();const _=g=>{for(let y=g;y<u.length;y++)if(l(u[y]),y+1<u.length&&(0,z.mountBudgetExhausted)()){const p=y+1;(0,z.enqueueMountWork)(()=>_(p));return}};_(0),(0,z.closeMountBudget)()}function Ds(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const e=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const r=s.node.nextSibling;a.insertBefore(n,r||e)}else a.insertBefore(n,e);return}}const c=o?.node||(o?.nodeType?o:null);if(c)if(s?.position==="before"&&s.node)c.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?c.insertBefore(n,a):c.appendChild(n)}else c.appendChild(n)}const Qt=3;function Fs(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Qt?!1:(t.__inBeforeUpdate=!0,!0)}function It(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Qt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Qt}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,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);(0,K.dispatchPluginHook)(n,o,s);const e="on"+t,c=o[e];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(o.__ref[i])return!0;o.__ref[i]=!0}const f=o.context?.designSystem;f&&(0,M.pushConfig)(f);let d=!!i;try{const u=c(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const l=o.__ref;return u.catch(_=>{(0,K.reportLifecycleError)(o,e,_)}).finally(()=>{i&&l&&(l[i]=!1)}),d=!1,!0}if(u===!1)return!1}catch(u){if((0,K.reportLifecycleError)(o,e,u),o.context?.strictMode)throw u}finally{f&&(0,M.popConfig)(),d&&o.__ref&&(o.__ref[i]=!1)}}return!0}var he=m;
|
|
4
|
+
`):"")}}if(qt(r,!0),Ls(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML&&(0,W.withDesignSystem)(r,()=>{try{const u=r.html(r,r.state,r.context);u!=null&&typeof u!="function"&&(r.node.innerHTML=u)}catch{}}),N("Create",r,n),N("Complete",r,n),N("Render",r,n),N("RenderRouter",r,n),so(r,n),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,g=()=>{if(r.node){if(r.node.isConnected){l&&(0,M.pushConfig)(l);try{u(r,r.state,r.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{l&&(0,M.popConfig)()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return r}const No=new Set(["childProps","attr","style","scope","data","vars"]);function Fo(t,o,s,n,e,c){if(s&&!o.extends&&!o.extend){const p=s.indexOf("_"),h=s.indexOf(".");let _=p>0?p:-1;if(h>0&&(_<0||h<_)&&(_=h),_>0){const w=s.substring(0,_),y=t.context?.components;y&&(y[w]||y["smbls."+w])?o={...o,extends:w}:y&&(0,it.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 "${w}" but neither "${w}" nor "smbls.${w}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),(0,xt.applyExtends)(t,o,c);const a=(0,xt.openMergeLayer)(t),r=t.props&&typeof t.props=="object"?t.props:null;for(const p in o){if(p==="parent"||p==="node"||p==="__ref"||p==="extends"||p==="context"||p==="props")continue;if(p==="key"){n&&(t.key=e?Kt(e,n):n);continue}const h=o[p];a&&a.mark(p);const _=t[p],w=_&&h&&typeof _=="object"&&typeof h=="object"&&!Array.isArray(_)&&!Array.isArray(h)&&typeof _!="function"&&typeof h!="function";w&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?t[p]=vt(_,h):w&&No.has(p)?t[p]={..._,...h}:w&&no(p)?t[p]=vt(_,h):t[p]=h}function i(p){for(const h in p){const _=p[h],w=t[h],y=w&&_&&typeof w=="object"&&typeof _=="object"&&!Array.isArray(w)&&!Array.isArray(_)&&typeof w!="function"&&typeof _!="function";y&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?t[h]=vt(w,_):y&&No.has(h)?t[h]={...w,..._}:y&&no(h)?t[h]=vt(w,_):t[h]=_}}if(r&&i(r),o.props&&typeof o.props=="object"&&(i(o.props),a))for(const p in o.props)a.mark(p);(0,xt.closeMergeLayer)(t),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const f=t.scope&&typeof t.scope=="object"?t.scope:null,d=e?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,l=d||u||null;if(o.scope!==void 0||f){const p={};f&&Object.assign(p,f),o.scope!==void 0&&Object.assign(p,o.scope),t.scope=(0,$.createScopeStore)(p,l)}else l&&(t.scope=l);o.if!==void 0&&(t.if=o.if);const g=t.__ref,x=vn(t,g&&g.__runtimeSource);return g&&(g.__declaredArrays=x||void 0),(0,Ms.addMethods)(t),an(t,e,o,c),o}const rn=new Set(["key","parent","context","__ref"]);function cn(t,o){for(const n of Object.keys(t))rn.has(n)||delete t[n];let s=o.definition;if(!s.extends&&!s.extend&&typeof o.key=="string"){const n=t.context?.components||{},e=n[o.key]||n["smbls."+o.key];e&&(s={...s,extends:e})}(0,W.untrack)(()=>Fo(t,s,o.key,o.ownKey,t.parent,o.options))}function fn(t,o,s){const n=s||{},e=r=>!!(n[r]||n["smbls."+r]),c=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const r of a){if(typeof r!="string")continue;const i=r.includes(">")?r.split(">")[0].trim():r;e(i)||c.push(i)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let r=-1;const i=o.indexOf("_"),f=o.indexOf(".");i>0&&(r=i),f>0&&(r<0||f<r)&&(r=f);const d=r>0?o.substring(0,r):o;e(d)||c.push(d)}return c}function eo(t,o,s){if(typeof t.onStateInit!="function"&&!(0,z.hasPluginHook)(t,"stateInit"))return;const n=t.state;t.state=o;try{N("StateInit",t,s)}finally{t.state=n}}const ro=t=>({isDataOnlyKey:o=>(0,L.polyglotSeededKeys)(t).has(o)});function an(t,o,s,n){const e=!o,c=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&c&&t.context?.state,r=s.state!==void 0&&!a?s.state:t.state&&!(0,$.isStore)(t.state)?t.state:void 0;if(r==null){if(o?.state)t.state=o.state,(0,ut.applyStateMethods)(t,t.state);else if(t.context?.state){const i=t.context.state,f={...i},d=t.context?.polyglot;if(d?.translations){const u=t.context,l=i.lang||d.defaultLang||"en",g=new Set,x=(_,w)=>{g.has(_)||(0,L.isPolyglotWritableKey)(u,_,f)&&(f[_]=w,g.add(_),(0,L.markPolyglotSeeded)(u,_,w))},p=d.translations[l];if(p&&typeof p=="object")for(const _ in p)x(_,p[_]);const h=new Set(d.languages||[]);for(const _ in d.translations)h.has(_)||x(_,d.translations[_])}(0,$.isStore)(f)||eo(t,f,n),t.state=(0,$.isStore)(f)?f:(0,$.createStore)(f,ro(t.context)),t.state.__element=t,t.state.root=t.state,(0,ut.applyStateMethods)(t,t.state),Ut.promoteActiveRootState?.(i,t.state),N("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,ut.applyStateMethods)(t,t.state);return}if(typeof r=="string"){if(t.state=Bo(r,o),t.state&&typeof t.state=="object"&&!(0,$.isStore)(t.state)){const i=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}(0,ut.applyStateMethods)(t,t.state),dn(t,r,o),N("StateCreated",t,n);return}if(typeof r=="function"){const i=r(t,o?.state);if((0,$.isStore)(i))t.state=i;else{const f=i||{};eo(t,f,n),t.state=(0,$.createStore)(f,o?.state?void 0:ro(t.context))}}else if((0,$.isStore)(r))t.state=r;else{const i={...r};eo(t,i,n),t.state=(0,$.createStore)(i,o?.state?void 0:ro(t.context))}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,(0,ut.applyStateMethods)(t,t.state),Ut.promoteActiveRootState?.(r,t.state),N("StateCreated",t,n)}function $o(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const e of s){if(n==null)return{};n=n[e]}return n??{}}function Io(t,o){const s=o.state;return t.startsWith("~/")?[s&&(s.root||s),t.slice(2)]:t.startsWith("../")?[s,t.slice(3)]:[s,t]}function Bo(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[e,c]=Io(t,o);return c?$o(e,c):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=$o(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const e=o.state?.root?.lang||n.defaultLang||"en",c=n.translations[e];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function un(t,o){const[s,n]=Io(t,o);if(!n||!s||typeof s!="object")return;const e=s[n];if(e!==void 0||n.indexOf("/")===-1)return e;let c=s;for(const a of n.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function dn(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!(0,$.isStore)(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const e=(0,W.untrack)(()=>(0,E.createEffect)(()=>{const c=un(o,s);!c||typeof c!="object"||c===t.state||(0,W.untrack)(()=>Ho(t,t.state,c,!0))},{depth:n.path?n.path.length:0,label:P(n,"state")}));e._isStateBinding=!0,n.__stateBinding=e,n.__effects&&n.__effects.push(e)}function Ho(t,o,s,n){const e=t.__ref;if(!e)return;if(n||t.state===o){t.state=s,n&&(0,ut.applyStateMethods)(t,s),Uo(e);const a=e.__children;if(a)for(let r=0;r<a.length;r++){const i=t[a[r]];i&&i.__ref&&i.parent===t&&Ho(i,o,s,!1)}return}if(e.__stateBinding){e.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=s,Uo(e))}function Uo(t){const o=t.__effects;if(o)for(let s=0;s<o.length;s++){const n=o[s];n&&!n._disposed&&!n._isStateBinding&&!n._isSubscribeToEffect&&typeof n._notify=="function"&&n._notify()}}const ln=new Set(["s","state","ctx","context"]),io=new WeakMap;function Vo(t){if(io.has(t))return io.get(t);let o=null;try{const s=typeof Ut.getFunctionSource=="function"?Ut.getFunctionSource(t):Function.prototype.toString.call(t);if(typeof s=="string"){const n=s.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||s.match(/^[^(]*\(([^)]*)\)/);n&&(o={params:n[1].split(",").map(e=>e.trim()),body:s.slice(n.index+n[0].length)})}}catch{}return io.set(t,o),o}function pn(t){const o=Vo(t);return o?o.params.map(s=>s.split("=")[0].trim()).filter(Boolean):[]}const Go=new WeakMap;function hn(t){let o=Go.get(t);return o===void 0&&(o=yn(Vo(t)),Go.set(t,o)),o}function yn(t){if(!t)return!0;const o=t.body;if(/\bstate\b|\barguments\b|\bcall\s*\(/.test(o))return!0;const s=t.params[1];if(!s)return!1;if(!/^[A-Za-z_$][\w$]*$/.test(s.split("=")[0].trim()))return!0;const n=s.split("=")[0].trim();return new RegExp("(^|[^\\w$.])"+n.replace(/\$/g,"\\$")+"(?![\\w$])").test(o)}const _n=3,gn=/^(is|has)[A-Z0-9_$]/,bn=new Set(["routerOptions"]),Ko=new WeakSet;function An(t,o){if(typeof t!="function"||t.length!==2||o&&(gn.test(o)||bn.has(o))||Ko.has(t))return!1;const s=pn(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<_n||ln.has(n)?!1:(Ko.add(t),!0)}function xn(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const r=c[a];if(typeof t[r]!="function"||H.REGISTRY.has(r))continue;const i=r.charCodeAt(0);i>=65&&i<=90||m(r)||k.CSS_PROPS_REGISTRY[r]||k.DEFAULT_CSS_PROPERTIES_LIST&&k.DEFAULT_CSS_PROPERTIES_LIST.has(r)||i!==45&&((0,v.checkAttributeByTagName)(s,r)||((0,it.isLoudDevRuntime)()&&An(t[r],r)&&console.warn(`[smbls] custom prop "${r}"${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('${r}', \u2026) instead of reading el.${r}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:r,fn:t[r]})))}for(let a=0;a<e.length;a++){const{prop:r,fn:i}=e[a];o.__exec[r]=i,Object.defineProperty(t,r,{get(){n&&(0,M.pushConfig)(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&(0,M.popConfig)()}},set(f){delete o.__exec[r],Object.defineProperty(t,r,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function wn(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const n=o[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function R(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return wn(t,o),s.apply(this,n)}}function yt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function P(t,o){return()=>t.path.join(".")+"::"+o}const Wo=new Set;function F(t,o,s){if(!(0,it.isLoudDevRuntime)())return;const n=P(t,o)();Wo.has(n)||(Wo.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const zo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,Sn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;zo.lastIndex=0;let n;for(;(n=zo.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Cn=(t,o)=>!m(t)&&!(0,Q.isCssProp)(o,t),co=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Cn(t,n)&&Sn(o,s)},fo=new WeakMap,jt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Et=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?at(t,o):t},Pt=(t,o)=>t&&o?at(t,o):t||o||null,Yo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&jt(s,o)},_t=(t,o)=>Yo(t,o)?Et(t.__ref.__runtimeSource[o]):null,Ot=(t,o)=>(o&&t&&typeof t=="object"&&fo.set(t,o),t),kn=t=>{if(!t||typeof t!="object")return;const o=fo.get(t);return o&&fo.delete(t),o},ao=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let n=0;n<t.length;n++)ao(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const e=Object.getOwnPropertyDescriptor(t,n);e&&"value"in e&&ao(e.value,o,s)}}},vn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(H.REGISTRY.has(n)||o&&jt(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),c=e&&e.value;if(!Array.isArray(c))continue;const a=new Set;ao(c,a,new Set),a.size&&(s||(s=new Map),s.set(c,a))}return s},qo=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,e=n&&n.get(o);if(!e)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of e)c.__authoredTemplates.add(a);return}},Zo=["attr","aria","data","metadata"],jn=t=>{if(Zo.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},En=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,e),a=c&&c.value,r=!!o&&jt(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!jn(e))continue;const i=r?o[e]:null,f=i&&typeof i=="object"?i:null,d=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const l=r&&(!f||jt(f,u)),g=a[u];if(d&&g&&typeof g=="object"&&!Array.isArray(g)&&Zo.includes(u)){for(const x in g)co(x,g[x],s,n,l);continue}co(u,g,s,n,l)}continue}co(e,a,s,n,r)}return s};function Qo(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=En(t,s.__runtimeSource);if(s.__authoredTemplates)for(const i of e)s.__authoredTemplates.add(i);else s.__authoredTemplates=e;if(xn(t),typeof t.text=="function"){const i=t.text,f=R(t,t.textDeps,i),d=(0,E.createEffect)(()=>{if(!s.contentManaged)try{let u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=L.replaceLiteralsWithObjectFields.call(t,u,t.state)),Nt(t,u))}catch(u){F(s,"text",u)}},{depth:s.path.length,label:P(s,"text")});s.__effects.push(d),s.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,f=(0,E.createEffect)(()=>{if(s.contentManaged)return;const d=L.replaceLiteralsWithObjectFields.call(t,i,t.state);d!=null&&(t.text=d),t.node&&Nt(t,d??"")},{depth:s.path.length,label:P(s,"text")});s.__effects.push(f),s.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!H.REGISTRY.has(i)&&!m(i)&&!s.__exec[i]&&!(0,Q.isAttributeFirst)(c,i)){if(k.CSS_PROPS_REGISTRY[i]){const f=t[i],d=R(t,t[i+"Deps"],f),u=i;let l,g=null,x=null,p;const h=(0,E.createEffect)(()=>{const _=t.context?.designSystem;_&&(0,M.pushConfig)(_);try{const w=d(t,t.state,t.context);(0,k.pushStaticCssPass)();let y;try{y=k.CSS_PROPS_REGISTRY[u](w,t,t.state,t.context)}finally{(0,k.popStaticCssPass)()}if(Array.isArray(y)){const A={};for(const S of y)if(S)for(const C in S)A[C]=S[C];y=A}const b=u==="show"||u==="hide";if(y&&t.node&&Tn(y)){const A=gt(y);if(A===null||A!==p){p=A;const S=(0,st.css)(y,null,t.context?.cssPrefix),C=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(x)for(const j of x)t.node.classList.remove(j);if(C&&C.length)for(const j of C)t.node.classList.add(j);x=C}}l=void 0,g=null}else if(y&&t.node){if(x){for(const S of x)t.node.classList.remove(S);x=null,p=void 0}const A=gt(y);if(A===null||A!==l||!Dt(t.node,g)){l=A;const S=cs(t,y);g=Tt(t.node,S)}}else t.node&&b&&(l=void 0,g=null,t.node.style.display="")}finally{_&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(h),s.__exec[i]=f}else if(k.DEFAULT_CSS_PROPERTIES_LIST&&k.DEFAULT_CSS_PROPERTIES_LIST.has(i)){const f=t[i],d=R(t,t[i+"Deps"],f),u=i;let l,g=null;const x=(0,E.createEffect)(()=>{const p=t.context?.designSystem;p&&(0,M.pushConfig)(p);try{const h=d(t,t.state,t.context);if(t.node)if(h!=null){const _=u+":"+String(h);if(_!==l||!Dt(t.node,g)){l=_;const w={[u]:h},y=cs(t,w);g=Tt(t.node,y)}}else l=void 0,g=null,t.node.style[u]=""}finally{p&&(0,M.popConfig)()}},{depth:s.path.length,label:P(s,u)});s.__effects.push(x),s.__exec[i]=f}else if(i.charCodeAt(0)===45){const f=t[i];es(t,i,f,t[i+"Deps"],i),s.__exec[i]=f}}if(Dn(t),typeof t.html=="function"){const i=t.html,f=R(t,t.htmlDeps,i),d=(0,E.createEffect)(()=>{(0,W.withDesignSystem)(t,()=>{const u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)})},{depth:s.path.length,label:P(s,"html")});s.__effects.push(d),s.__exec.html=i}if(typeof t.value=="function"){const i=t.value,f=R(t,t.valueDeps,i),d=(0,E.createEffect)(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=L.replaceLiteralsWithObjectFields.call(t,u,t.state)),ts(t,u)}catch(u){F(s,"value",u)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(d),s.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,f=(0,E.createEffect)(()=>{try{ts(t,L.replaceLiteralsWithObjectFields.call(t,i,t.state))}catch(d){F(s,"value",d)}},{depth:s.path.length,label:P(s,"value")});s.__effects.push(f),s.__exec.value=i}if(typeof t.style=="function"){const i=t.style,f=R(t,t.styleDeps,i);let d,u=null,l,g,x,p;const h=(0,E.createEffect)(()=>{const _=f(t,t.state,t.context),w=t.context&&t.context.designSystem;let y;if(_&&typeof _=="object"&&_===l&&w===x){const A=gt(_);y=A!==null&&A===g?p:$t(t,_),g=A}else y=$t(t,_),g=void 0;l=_,x=w,p=y;const b=gt(y);(b===null||b!==d||!Dt(t.node,u))&&(d=b,lo(t.node,u,y),et(t.node,y),u=Tt(t.node,y))},{depth:s.path.length,label:P(s,"style")});s.__effects.push(h),s.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const f=t.style[i];if(typeof f!="function")continue;const d=R(t,yt(t.styleDeps,i),f);let u,l=null;const g=(0,E.createEffect)(()=>{try{const x=d(t,t.state,t.context);if(t.node){const p=i+":"+String(x);if(p!==u||!Dt(t.node,l)){u=p;const h=$t(t,{[i]:x});lo(t.node,l,Object.assign({},h,{[i]:""})),et(t.node,h),l=Tt(t.node,h)}}}catch(x){F(s,"style."+i,x)}},{depth:s.path.length,label:P(s,"style."+i)});s.__effects.push(g)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const f=R(t,yt(t.attrDeps,i),t.attr[i]),d=i,u=(0,E.createEffect)(()=>{try{let l=f(t,t.state,t.context);typeof l=="string"&&l.includes("{{")&&(l=L.replaceLiteralsWithObjectFields.call(t,l,t.state)),t.node?.setAttribute&&Ft(t.node,d,l)}catch(l){F(s,"attr."+d,l)}},{depth:s.path.length,label:P(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const f=t.attr[i],d=i,u=(0,E.createEffect)(()=>{try{const l=L.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(d,(0,v.serializeAttrValue)(d,l??""))}catch(l){F(s,"attr."+d,l)}},{depth:s.path.length,label:P(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const f=t.aria[i];if(typeof f=="string"&&f.includes("{{")){const g=f,x="aria-"+i.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),p=(0,E.createEffect)(()=>{try{const h=L.replaceLiteralsWithObjectFields.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(x,(0,v.serializeAttrValue)(x,h??""))}catch(h){F(s,"aria."+i,h)}},{depth:s.path.length,label:P(s,"aria."+i)});p._attrName=x,s.__effects.push(p);continue}if(typeof f!="function")continue;const d=R(t,yt(t.ariaDeps,i),t.aria[i]),u="aria-"+i.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),l=(0,E.createEffect)(()=>{try{const g=d(t,t.state,t.context);if(!t.node?.setAttribute)return;Ft(t.node,u,g)}catch(g){F(s,"aria."+i,g)}},{depth:s.path.length,label:P(s,"aria."+i)});l._attrName=u,s.__effects.push(l)}if(t.data&&typeof t.data=="object")for(const i in t.data){const f=t.data[i];if(typeof f=="string"&&f.includes("{{")){const x=f,p="data-"+i.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),h=(0,E.createEffect)(()=>{try{const _=L.replaceLiteralsWithObjectFields.call(t,x,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(p,_??"")}catch(_){F(s,"data."+i,_)}},{depth:s.path.length,label:P(s,"data."+i)});h._attrName=p,s.__effects.push(h);continue}if(typeof f!="function")continue;const d=R(t,yt(t.dataDeps,i),t.data[i]),l="data-"+i.replace(/[A-Z]/g,x=>"-"+x.toLowerCase()),g=(0,E.createEffect)(()=>{try{const x=d(t,t.state,t.context);if(!t.node?.setAttribute)return;x==null||x===!1?t.node.removeAttribute(l):typeof x!="function"&&typeof x!="object"&&t.node.setAttribute(l,x===!0?"":x)}catch(x){F(s,"data."+i,x)}},{depth:s.path.length,label:P(s,"data."+i)});g._attrName=l,s.__effects.push(g)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const i in a){if(typeof a[i]!="function")continue;const f=R(t,yt(t.classDeps,i),a[i]),d=(0,E.createEffect)(()=>{try{const u=f(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(i):t.node.classList.remove(i)}catch(u){F(s,"class."+i,u)}},{depth:s.path.length,label:P(s,"class."+i)});s.__effects.push(d)}!n&&typeof t.if=="function"&&mo(t,s,t.if);for(const i of Object.keys(t)){if(H.REGISTRY.has(i)||typeof t[i]!="function")continue;const f=i.charCodeAt(0);if(f>=65&&f<=90||m(i))continue;const d=t[i];s.__exec[i]=d;const u=t.tag||"div";if((0,v.checkAttributeByTagName)(u,i)&&!(0,Q.isCssProp)(u,i)){const l=(0,v.camelToAttr)(i)||i,g=R(t,t[i+"Deps"],d),x=(0,E.createEffect)(()=>{try{let p=g(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=L.replaceLiteralsWithObjectFields.call(t,p,t.state)),t.node?.setAttribute&&Ft(t.node,l,p,!0)}catch(p){F(s,i,p)}},{depth:s.path.length,label:P(s,i)});x._attrName=l.toLowerCase(),s.__effects.push(x)}}const r=t.tag||"div";for(const i of Object.keys(t)){if(H.REGISTRY.has(i))continue;const f=t[i];if(typeof f!="string"||!f.includes("{{"))continue;const d=i.charCodeAt(0);if(d>=65&&d<=90||m(i)||(0,Q.isCssProp)(r,i)||v.ATTR_TRANSFORMS[i]||!(0,v.checkAttributeByTagName)(r,i))continue;const u=(0,v.camelToAttr)(i)||i,l=(0,E.createEffect)(()=>{try{const g=L.replaceLiteralsWithObjectFields.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,v.serializeAttrValue)(u,g??""))}catch(g){F(s,i,g)}},{depth:s.path.length,label:P(s,i)});l._attrName=u.toLowerCase(),s.__effects.push(l)}if(In(t),Yn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,f=t.stateDeps;let d=!1,u=[];const l=(0,E.createEffect)(()=>{const g=[];for(let h=0;h<f.length;h++){const _=f[h];try{g[h]=typeof _=="function"?_(t,t.state,t.context):t.state?.[_]}catch{g[h]=void 0}}if(!d){d=!0,u=g;return}let x=g.length!==u.length;for(let h=0;!x&&h<g.length;h++)g[h]!==u[h]&&(x=!0);const p=u;u=g,x&&(0,W.withDesignSystem)(t,()=>{try{i(t,t.state,t.context,{prev:p,next:g})}catch(h){if((0,z.reportLifecycleError)(t,"onStateUpdate",h),t.context?.strictMode)throw h}})},{depth:s.path.length,label:P(s,"onStateUpdate")});s.__effects.push(l)}Vn(t)}function Xo(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ls(t,t.parent);return}let n=null;const e=Object.keys(o),c=e.indexOf(t.key);for(let a=c+1;a<e.length;a++){const r=o[e[a]];if(r?.node?.parentNode===s){n=r.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Jo(t){os(t),te(t),gs(t),pe(t),le(t)}function mo(t,o,s){let n=R(t,t.ifDeps,s);const e=(0,E.createEffect)(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const i=t.context?.components||{};c.names.some(f=>i[f]||i["smbls."+f])&&(o.__ifLateMerge=null,cn(t,c),n=R(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(i){if(a=!1,o.__ifError=i,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,i?.message||i)}return}const r=o.__if;if(o.__if=!!a,r&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(i){console.error("[smbls] onRemove error:",i)}}else if(!r&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,nt.cacheNode)(t)),t.node&&(t.node.ref=t),Xo(t),os(t),gs(t),N("Render",t,{}),so(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,nt.detectTag)(t)),N("Init",t,{}),t.node||(t.node=(0,nt.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"&&!o.__fragmentAnchor){const f=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(f),o.__fragmentAnchor=f}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),Ts(t,{}),Qo(t,{skipIfEffect:!0}),Jo(t),Ds(t,{}),Xo(t),N("Create",t,{}),N("Complete",t,{}),N("Render",t,{}),N("RenderRouter",t,{}),so(t,{})}},{depth:o.path.length,label:P(o,"if")});o.__effects.push(e)}function Nt(t,o){const s=t.node;if(!s)return;const n=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const e=t.__ref;let c=e?e.__textNode:null;if(c&&c.parentNode!==s&&(c=null),!c){const a=s.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):s.firstChild?(c=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(c,s.firstChild)):(s.textContent=n,c=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),e&&(e.__textNode=c||null)}function Pn(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function On(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function Ft(t,o,s,n){s==null||s===!1&&!(0,v.isEnumeratedTrueFalseAttr)(o)?Wt(t,o,null):typeof s=="function"||typeof s=="object"||(n&&o==="src"&&"src"in t?t.src=s:Wt(t,o,(0,v.serializeAttrValue)(o,s)))}function Wt(t,o,s){const n=Pn(t,o);s==null?t.removeAttribute(o):t.setAttribute(o,s),On(t,n)}function ts(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const e=typeof document<"u"&&document.activeElement===s,c=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&c!=null&&a!=null)try{s.setSelectionRange(c,a)}catch{}const r=t.__ref&&t.__ref.__autoGrow;r&&r.active&&r.resize()}function os(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Nt(t,t.text),Ss(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.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 e in t.style)typeof t.style[e]!="function"&&(s[e]=t.style[e]);break}et(o,$t(t,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,v.isEnumeratedTrueFalseAttr)(s)||o.setAttribute&&o.setAttribute(s,(0,v.serializeAttrValue)(s,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),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("{{")||o.dataset&&(o.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&&o.classList.add(n));else if(typeof s=="object")for(const n in s){const e=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];e&&o.classList.add(typeof e=="string"?e:n)}}}}function gt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Tn(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function Tt(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const e in o){if(o[e]==null||e.charAt(0)==="&")continue;const a=tt(e);n.push(a,uo(s,a),ss(s,a))}return n}function uo(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function ss(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function tt(t){return(0,I.cssPropName)(t)}function lo(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,e=new Set;if(s&&typeof s=="object")for(const c in s)s[c]==null||c.charAt(0)==="&"||e.add(tt(c));for(let c=0;c<o.length;c+=3){const a=o[c];e.has(a)||uo(n,a)===o[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Dt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(uo(s,o[n])!==o[n+1]||ss(s,o[n])!==o[n+2])return!1;return!0}const Lt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,ns=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",zt=t=>Lt(t)?t:"--"+t;function Yt(t,o){if(!rt(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let e=t[n];if(typeof e=="function"){if(!o)continue;e=e(o,o.state,o.context)}ns(e)&&(s||(s={}),s[zt(n)]=e)}return s}function es(t,o,s,n,e){rs(t,e,R(t,n,s),c=>ns(c)?{[o]:c}:null)}function rs(t,o,s,n,e){const c=t.__ref;let a,r=null;const i=(0,E.createEffect)(()=>{(0,W.withDesignSystem)(t,()=>{try{const f=n(s(t,t.state,t.context)),d=t.node;if(!d||!d.style)return;const u=gt(f);(u===null||u!==a||!Dt(d,r))&&(a=u,lo(d,r,f),f&&et(d,f),r=f?Tt(d,f):null,e&&e(f))}catch(f){F(c,o,f)}})},{depth:c.path.length,label:P(c,o)});c.__effects.push(i)}function Dn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){Ln(t,s),o.__exec.vars=s;return}if(rt(s))for(const n of Object.keys(s)){const e=s[n];!n||typeof e!="function"||es(t,zt(n),e,yt(t.varsDeps,n),"vars."+n)}}function Ln(t,o){const s=t.__ref;rs(t,"vars",R(t,t.varsDeps,o),n=>Yt(n),n=>{s.__varsInline=n?new Set(Object.keys(n)):null})}function po(t,o){if(typeof t[o]=="function"&&((0,Q.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Lt(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!rt(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&zt(n)===o)return!0;return!1}function Rn(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(tt(s)));return o}function Mn(t,o,s,n){const e=t.__ref;if(!e)return;let c=null;if(s)for(const a of s){if(n&&n.has(a))continue;const r=o[a];if(r==null||typeof r=="object")continue;const i=tt(a);I.CSS_LONGHAND_SHORTHANDS[i]&&(c||(c={}),c[i]=r)}e.__declaredLonghands=c}function is(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const c in n){if(o.has(c))continue;const a=I.CSS_LONGHAND_SHORTHANDS[c];let r=!1;for(let i=0;i<a.length;i++)if(o.has(a[i])){r=!0;break}r&&(e||(e={}),e[c]=n[c])}return e}function cs(t,o){const s=t.node;et(s,o);const n=Rn(o);if(!n)return o;const e=t.__ref;if(e)if(e.__inlineCssKeys)for(const a of n)e.__inlineCssKeys.add(a);else e.__inlineCssKeys=new Set(n);const c=is(t,n);return c?(et(s,c),Object.assign({},o,c)):o}function Nn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=is(t,o.__inlineCssKeys);s&&et(t.node,s)}function $t(t,o){return!o||typeof o!="object"?o:(0,W.withDesignSystem)(t,()=>{try{return(0,k.resolveStyleBlockTokens)(o,t)}catch{return o}})}function et(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const e=o[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){s||(s={}),s[n]=e;continue}try{const c=String(e),a=(0,I.cssPropName)(n),r=c.trim(),i=/\s*!important\s*$/.test(r),f=r.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,i?"important":"")}catch{}}}s&&Fn(t,s)}function Fn(t,o){const s=`_ds${Eo.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let e=n.querySelector("style[data-smbls-scoped]");e||(e=n.createElement("style"),e.setAttribute("data-smbls-scoped",""),n.head.appendChild(e));let c="";for(const a in o){const r="."+s,i=a.replace(/&/g,r).split(",").map(d=>{const u=d.trim();return u.includes(r)?u:r+u}).join(", "),f=o[a];if(typeof f=="object"){let d="",u="";for(const l in f){const g=f[l];if(typeof g=="object"){const x=l.includes("&")?i.split(", ").map(h=>l.replace(/&/g,h)).join(", "):i.split(", ").map(h=>`${h} ${l}`).join(", ");let p="";for(const h in g)p+=`${tt(h)}: ${g[h]};`;u+=(0,st.wrapHoverRule)(`${x} { ${p} }`,x)+`
|
|
5
|
+
`}else d+=`${tt(l)}: ${g};`}d&&(c+=(0,st.wrapHoverRule)(`${i} { ${d} }`,i)+`
|
|
6
|
+
`),u&&(c+=u)}}c&&(e.textContent+=c)}const fs=new Set;function as(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function $n(t,o,s){const n=as(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(as(e)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";fs.has(c)||(fs.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(e)?e.join(", "):String(e)}]. 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 In(t){const o=t.subscribeTo,s=typeof o=="function";let n=o;if(s)try{n=o(t,t.state,t.context)}catch{n=null}if(s&&(0,it.isLoudDevRuntime)()&&$n(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let c=0;c<n.length;c++){const a=n[c];if(typeof a!="string"||a.length===0)continue;const r=a.split("."),i=r[0],f=r.slice(1),d={value:!1},u=(0,E.createEffect)(()=>{const l=t.state&&((0,$.isStore)(t.state)?t.state.root:null);if(!l||!(0,$.isStore)(l))return;let g=l;g=g[i];for(let p=0;p<f.length&&!(g==null||typeof g!="object");p++)if((0,$.isStore)(g))g=g[f[p]];else break;if(!d.value)return;let x=!1;if(typeof t.onBeforeUpdate=="function"&&(0,W.withDesignSystem)(t,()=>{try{if($s(e)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>It(e,!1),h=>{It(e,!0),(0,z.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:h})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",h)}):(It(e,!1),p===!1&&(x=!0))}}catch(p){It(e,!0),(0,z.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}}),!x&&t.node&&e.__effects)for(let p=0;p<e.__effects.length;p++){const h=e.__effects[p];h&&h!==u&&!h._disposed&&!h._isSubscribeToEffect&&typeof h._execute=="function"&&h._execute()}!x&&typeof t.onUpdate=="function"&&(0,W.withDesignSystem)(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(p){(0,z.dispatchPluginHook)("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}})},{depth:e.path.length,label:P(e,"subscribeTo("+a+")")});d.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function ho(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function yo(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const us=new Set;function Bn(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;us.has(n)||(us.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.`))}const ds=new Map;function Hn(t){let o=ds.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push((0,I.cssCamelName)(e))};return s(I.CSS_LONGHAND_SHORTHANDS[t]),s(I.CSS_SHORTHAND_LONGHANDS[t]),ds.set(t,o),o}function ls(t,o,s){if(po(t,o)||s&&s.has(o))return!0;const n=Hn(tt(o));for(let e=0;e<n.length;e++){const c=n[e];if(po(t,c)||s&&s.has(c))return!0}return!1}function bt(t,o,s,n){const e={},c=new Set,a=(r,i,f)=>{const d=f?new Set(Object.keys(e)):null;if(k.CSS_PROPS_REGISTRY[r]){const u=k.CSS_PROPS_REGISTRY[r](i,o,o.state,o.context);if(u){const l=Array.isArray(u)?u:[u];for(const g of l)g&&Object.assign(e,g)}}else e[r]=i;if(f)for(const u in e)d.has(u)||c.add(u)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(o,o.state,o.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let l=i[u];typeof l=="function"&&(l=l(o,o.state,o.context)),!(l==null||typeof l=="function")&&a(u,l,ls(o,u,n))}continue}if(r==="vars"){const u=Yt(i,o);if(u)for(const l in u)a(l,u[l],po(o,l)||!!(n&&n.has(l)));continue}if(ho(r,o)){const u=bt(i,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){(0,it.isLoudDevRuntime)()&&Bn(r,o);continue}const f=yo(r,o),d=bt(i,o,!1,n);Object.keys(d).length&&(e[f]=d);continue}a(r,i,ls(o,r,n))}}if(s)for(const r in e)c.add(r);for(const r of c){const i=e[r];typeof i=="string"&&!i.includes("!important")&&(e[r]=i+" !important")}return e}const rt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function ps(t,o){for(const s in o){const n=o[s];t[s]=rt(n)?ps(rt(t[s])?t[s]:{},n):n}return t}function Un(t,o){if(!rt(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;rt(e)&&(s=ps(s||{},e))}return s}function _o(t,o){if(o===void 0&&(o=0),o>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)&&_o(t[s],o+1))return!0}return!1}function hs(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(ho(t,s)){const c=bt(o,s,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=yo(t,s),e=bt(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function Vn(t){const o=t.__ref;for(const s of Object.keys(t)){if(!no(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!_o(n))continue;let e=null,c;const a=(0,E.createEffect)(()=>{if(!t.node)return;const r=t.context?.designSystem;r&&(0,M.pushConfig)(r);let i,f=!1;try{const d=hs(s,n,t),u=d?gt(d.block)+"::"+d.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,d){const l=(0,st.css)({[d.cssProp]:d.block},null,t.context?.cssPrefix);i=l?l.split(" ").filter(Boolean):null}else i=null}finally{r&&(0,M.popConfig)()}if(!(f||!t.node.classList)){if(e)for(const d of e)t.node.classList.remove(d);if(i&&i.length)for(const d of i)t.node.classList.add(d);e=i}},{depth:o.path.length,label:P(o,"cssBlock("+s+")")});o.__effects.push(a)}}const Gn=()=>!0,Kn=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!k.CSS_PROPS_REGISTRY[t]||!!(k.DEFAULT_CSS_PROPERTIES_LIST&&k.DEFAULT_CSS_PROPERTIES_LIST.has(t))||Lt(t)||t==="vars"};function Wn(t,o,s){const n={};let e=!1;for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(r!=="data"&&r!=="aria"&&(Kn(r,s[r])||H.REGISTRY.has(r))?n[r]=!0:e=!0);if(!e)return null;const c=(0,v.extractConditionalAttrs)({[o]:s},t.tag||"div",n,Gn);let a=null;for(const r in c)/^on/i.test(r)||(a||(a={}),a[r]=c[r]);return a}function ys(t,o,s,n,e,c){const a=t.node;let r=null;const i=f=>{(r||(r=[])).push(f)};for(const f in n){const d=o.owners.get(f),u=d===s;if(!c&&d!==void 0&&!u)continue;let l;try{l=n[f](t)}catch(x){F(t.__ref,"conditional("+s+")."+f,x),u&&i(f);continue}if(typeof l=="string"&&l.includes("{{")&&(l=L.replaceLiteralsWithObjectFields.call(t,l,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){i(f);continue}if(l==null||typeof l=="object"||typeof l=="function"){u&&_s(a,o,f);continue}const g=l===!1&&!(0,v.isEnumeratedTrueFalseAttr)(f)?null:String((0,v.serializeAttrValue)(f,l));i(f),!(u&&g===o.written.get(f))&&(d===void 0&&o.base.set(f,a.getAttribute(f)),Wt(a,f,g),o.owners.set(f,s),o.written.set(f,g))}e.appliedAttrs=r}function _s(t,o,s){t.getAttribute(s)===o.written.get(s)&&Wt(t,s,o.base.get(s)),o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function zn(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const c of e)o.owners.get(c)===s&&_s(t.node,o,c)}function gs(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const n of o.owners.keys()){const e=o.written.get(n),c=s.getAttribute(n);c!==e&&(o.base.set(n,c),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function Yn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const c=e.charAt(0);if(c!=="."&&c!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const h=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${h}: { '${a.slice(h.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const i=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},d=Wn(t,e,r);d&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const h in r){if(!Object.prototype.hasOwnProperty.call(r,h))continue;const _=h.charAt(0),w=r[h];if(!((_===":"||_==="@"||_==="&"||_==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(h==="vars"&&rt(w)){for(const y of Object.keys(w))y&&u.add(zt(y));continue}u.add(h)}}const l=()=>{let h;const _=t[a];if(_===void 0){const b=!!t.state&&a in t.state,A=t.state?t.state[a]:void 0;if(b||A!==void 0)h=A;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{h=typeof S=="function"?S.call(t,t):S}catch(C){h=!1,o.__conditionalError=C,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,C?.message||C)}}}else if(typeof _=="function")try{h=_(t,t.state,t.context)}catch(b){h=!1,o.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else h=_;const w=i?!h:!!h;if(!t.node)return;const y=t.context?.designSystem;if(w===f.lastMatch){if(w&&d&&t.node.setAttribute){y&&(0,M.pushConfig)(y);try{ys(t,s,e,d,f,!1)}finally{y&&(0,M.popConfig)()}}return}f.lastMatch=w,y&&(0,M.pushConfig)(y);try{if(w){const b={},A={};let S=!1;for(const j in r){if(!Object.prototype.hasOwnProperty.call(r,j))continue;const O=r[j],q=j.charAt(0);if((q===":"||q==="@"||q==="&"||q==="[")&&O&&typeof O=="object"&&!Array.isArray(O)){if(ho(j,t)){const V=bt(O,t,!1,u);Object.keys(V).length&&(A[`[data-theme="${j.slice(1)}"] &`]=V,S=!0)}else{const V=yo(j,t),B=bt(O,t,!1,u);Object.keys(B).length&&(A[V]=B,S=!0)}continue}const dt=typeof O=="function"?O(t,t.state,t.context):O;if(dt!=null){if(k.CSS_PROPS_REGISTRY[j]){const V=k.CSS_PROPS_REGISTRY[j](dt,t,t.state,t.context);if(V){const B=Array.isArray(V)?V:[V];for(const G of B)G&&Object.assign(b,G)}}else if(k.DEFAULT_CSS_PROPERTIES_LIST&&k.DEFAULT_CSS_PROPERTIES_LIST.has(j))b[j]=dt;else if(Lt(j))b[j]=dt;else if(j==="vars"){const V=Yt(dt,t);V&&Object.assign(b,V)}}}const C=Object.keys(b);if(C.length){et(t.node,b);for(const j of C)n.set(j,e);f.appliedKeys=C}else f.appliedKeys=null;if(S){const j=(0,st.css)(A,null,t.context?.cssPrefix,{state:!0}),O=j?j.split(" ").filter(Boolean):[];if(O.length&&t.node.classList){for(const q of O)t.node.classList.add(q);f.appliedClasses=O}else f.appliedClasses=null}else if(f.appliedClasses){for(const j of f.appliedClasses)t.node.classList.remove(j);f.appliedClasses=null}d&&t.node.setAttribute&&ys(t,s,e,d,f,!0)}else{if(f.appliedAttrs&&zn(t,s,e,f),f.appliedKeys){for(const b of f.appliedKeys)n.get(b)===e&&(Lt(b)?t.node.style.removeProperty(b):t.node.style[b]="",n.delete(b));f.appliedKeys=null}if(f.appliedClasses){for(const b of f.appliedClasses)t.node.classList.remove(b);f.appliedClasses=null}}}finally{y&&(0,M.popConfig)()}};o.__conditionalRunners.push(l);const g=R(t,t[a+"Deps"],l),x=(0,E.createEffect)(g,{depth:o.path.length,label:P(o,"conditional("+e+")")}),p=o.__exec&&o.__exec[a]||t[a];x._sources.size===0&&typeof p=="function"&&(0,it.isLoudDevRuntime)()&&hn(p)&&console.warn(`[smbls] conditional \`${e}\` 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 \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(x)}}const go=new WeakSet,bo=new WeakMap;function qn(t){const o=bo.get(t);if(o==="painted")return!1;if(o===void 0){bo.set(t,"open");const s=t.defaultView,n=()=>{bo.set(t,"painted")};s&&typeof s.requestAnimationFrame=="function"?s.requestAnimationFrame(n):setTimeout(n,0)}return!0}function Zn(t){const o=t.ownerDocument;!o||go.has(o)||qn(o)||(go.add(o),queueMicrotask(()=>{go.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const Ao=new WeakSet;let bs=!1;function As(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function xo(t,o){const s={...t};for(const n in o){const e=o[n],c=s[n];s[n]=e&&typeof e=="object"&&c&&typeof c=="object"?xo(c,e):e}return s}function xs(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const c=xs(e,o);Object.keys(c).length&&(s[n]=c)}else o.has(n)||(s[n]=e)}return s}function Qn(t,o,s){let n=1/0,e=-1/0;for(const a of o.values())a<n&&(n=a),a>e&&(e=a);if(s)for(const a of s.values())a>e&&(e=a);if(e<=n)return null;let c=null;for(const[a,r]of o){if(r===e)continue;const i=Xn(a);if(i)for(let f=0;f<i.length;f+=3){const d=i[f],u=i[f+1],l=i[f+2],g=t[u]!=null?o.get(u):void 0,x=s&&s.get(d),p=g!==void 0&&g>r&&(0,I.cssShorthandStatesLonghand)(d,t[u],l),h=!p&&x!==void 0&&x>r&&(0,I.cssShorthandStatesLonghand)(d,void 0,l);if(p||h){p&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const ws=new Map;function Xn(t){let o=ws.get(t);if(o!==void 0)return o;const s=tt(t),n=I.CSS_LONGHAND_SHORTHANDS[s];if(o=null,Array.isArray(n)){o=[];for(const e of n)o.push(e,(0,I.cssCamelName)(e),s)}return ws.set(t,o),o}function Ss(t){const{node:o}=t;if(!o)return;if(bs||(bs=!0,(0,st.css)({display:"none"})),Ao.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Ao.add(t);const s=t.context?.designSystem;s&&(0,M.pushConfig)(s),(0,k.pushStaticCssPass)();try{const n={};let e=!1,c=[],a=null,r=null,i=null;const f=t.__ref&&t.__ref.__mergeLayer;let d,u=null,l=null;const g=(y,b)=>{if(b&&typeof b=="object"&&As(y)){r||(r={});const A=r[y];A&&(b=xo(A,b)),r[y]=b}else(b===null||typeof b!="object")&&(i||(i=new Set),i.add(y),d!==void 0&&(u||(u=new Map),u.set(y,d)));n[y]=b};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&k.CSS_PROPS_REGISTRY.theme){const y=k.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(y){const b=A=>{for(const S in A){const C=A[S];C&&typeof C=="object"&&As(S)&&(a||(a={}),a[S]=C),n[S]=C}};if(Array.isArray(y))for(const A of y)A&&b(A);else b(y);e=!0}}const x=(y,b)=>{if(y==="vars"){const A=Yt(b);if(A){for(const S in A)g(S,A[S]);e=!0}return}if(k.CSS_PROPS_REGISTRY[y]){const A=k.CSS_PROPS_REGISTRY[y](b,t,t.state,t.context);if(A){if(Array.isArray(A)){for(const S of A)if(S)for(const C in S)g(C,S[C])}else for(const S in A)g(S,A[S]);e=!0}}else if(k.DEFAULT_CSS_PROPERTIES_LIST&&k.DEFAULT_CSS_PROPERTIES_LIST.has(y))b!=null&&typeof b!="object"&&(g(y,b),e=!0);else if(y.charCodeAt(0)===45)b!=null&&typeof b!="object"&&(g(y,b),e=!0);else if((y.charAt(0)==="&"||y.charAt(0)==="@"||y.charAt(0)===":"||y.charAt(0)==="[")&&b&&typeof b=="object"&&!Array.isArray(b)){if(_o(b))return;const A=hs(y,b,t);A&&(g(A.cssProp,A.block),e=!0)}};if(typeof t.class=="string"){const y=Un(t.class,t.context?.designSystem?.class);if(y)for(const b in y)x(b,y[b])}const p=i?new Set(i):null,h=t.tag||"div";for(const y of Object.keys(t)){if(typeof t[y]=="function"){const A=f&&f.get(y);A!==void 0&&(0,Q.isCssProp)(h,y)&&(l||(l=new Map),l.set(tt(y),A));continue}if(d=f?f.get(y):void 0,y==="vars"){x(y,t[y]);continue}if(H.REGISTRY.has(y)||y==="theme")continue;const b=y.charCodeAt(0);b>=65&&b<=90||m(y)||(0,Q.isAttributeFirst)(h,y)||x(y,t[y])}d=void 0;const _=u?Qn(n,u,l):null;if(a)for(const y in a){let b=i?xs(a[y],i):a[y];r&&r[y]&&(b=xo(b,r[y])),Object.keys(b).length?n[y]=b:delete n[y]}if(Mn(t,n,i,_?new Set([...p||[],..._]):p),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const y=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof y=="string"&&y!==""&&n.display&&n.display!==y&&(n.display=y);const b=(0,st.css)(n,null,t.context?.cssPrefix);if(c=b?b.split(" ").filter(Boolean):[],b&&o.classList){const A=c;let S=!1;for(const C of A)o.classList.add(C),S||(C.charCodeAt(0)===95&&C.charCodeAt(1)===99||C.charCodeAt(0)===95&&C.indexOf("_c",1)!==-1)&&(S=!0);S&&Zn(o)}}const w=t.__ref;if(w){const y=w.__staticCssClasses;if(y&&o.classList){const b=new Set(c);for(const A of y)b.has(A)||o.classList.remove(A)}w.__staticCssClasses=c}Nn(t)}finally{(0,k.popStaticCssPass)(),s&&(0,M.popConfig)(),Ao.delete(t)}}const Jn=t=>!!k.CSS_PROPS_REGISTRY[t]||!!(k.DEFAULT_CSS_PROPERTIES_LIST&&k.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function mn(t){t&&t.node&&Ss(t)}function te(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const c=t.aria[e];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());o.setAttribute(a,(0,v.serializeAttrValue)(a,c))}const s=(0,v.applyAttrTransforms)(t);for(const e in s){const c=s[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(e,c===!0?"":c)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||H.REGISTRY.has(e)||e==="on"||s[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!m(e)&&!(0,Q.isCssProp)(n,e)&&(0,v.checkAttributeByTagName)(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!v.ATTR_TRANSFORMS[e])continue;a=L.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,v.isEnumeratedTrueFalseAttr)((0,v.camelToAttr)(e)||e))continue;const r=(0,v.camelToAttr)(e)||e;o.setAttribute(r,(0,v.serializeAttrValue)(r,a))}}}function oe(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||m(o))return;const e=t.tag||"div";if((0,Q.isCssProp)(e,o)||!(0,v.checkAttributeByTagName)(e,o))return;const c=(0,v.camelToAttr)(o)||o,a=c.toLowerCase(),r=t.__ref&&t.__ref.__effects;let i=!1;if(r)for(let u=0;u<r.length;u++){const l=r[u];l&&l._attrName===a&&!l._disposed&&typeof l._execute=="function"&&(i=!0,l._execute())}if(i)return;let f=t[o];const d=v.ATTR_TRANSFORMS[o];if(d&&f!=null){const u=d(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=L.replaceLiteralsWithObjectFields.call(t,f,t.state)),Ft(s,c,f)}function se(t,o){const s=t.node,n=t.__ref;let e=n.__autoGrow;if(!o){if(e&&e.active){try{s.removeEventListener("input",e.resize)}catch{}ks(e),ct.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),Es(s,e,!1),e.active=!1,e.appliedMax=null,e.lastMeasure=0}return}e||(e=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Rt(t,!0);return}if(!(s.scrollHeight>0)){e.awaitingLayout=!0,Cs(t,e);return}e.awaitingLayout=!1;const a=re(s),r=ie(a),i=s.style.height;s.style.height="0px",r&&So(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=i,r&&So(s);return}const d=ce(s,a),u=d!=null&&f<d?d:f,l=ue(a),g=l!=null&&u>l;s.style.height=ae(g?l:u,a)+"px",r&&So(s),Es(s,e,g),e.lastMeasure=f,e.lastWidth=s.clientWidth,Cs(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}ks(e),ct.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,ee(t,e));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=c,e.appliedMax=c),e.resize()}function Rt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),ct.add(t),Vt())}function ne(){const t=Array.from(ct);ct.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,e=s.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=ht()),e.attachAttempts+=1,e.attachAttempts<=To&&ht()-e.firstAttemptAt<Do&&(ct.add(s),Vt());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function Cs(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const c=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Rt(t,!0);return}const r=s.clientWidth;o.lastWidth!=null&&Math.abs(r-o.lastWidth)<.5||(o.lastWidth=r,Rt(t,!0))};let a;try{a=new e(c),a.observe(s)}catch{return}o.watch=a}function ks(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function ee(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,n=s&&s.fonts&&s.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{o.active&&t.node&&Rt(t,!0)},()=>{})}function re(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const ft=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,wo=t=>(ft(t.paddingTop)||0)+(ft(t.paddingBottom)||0),vs=t=>(ft(t.borderTopWidth)||0)+(ft(t.borderBottomWidth)||0);function ie(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let n=0;n<o.length;n++){const e=o[n].trim();if(!(e!=="all"&&e!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function So(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const n=o[s];if(n&&n.transitionProperty==="height")try{n.cancel()}catch{}}}function ce(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const n=ft(o.lineHeight)||fe(t,o);return n>0?s*n+wo(o):null}const Mt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],js=new WeakMap;function fe(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let e=js.get(s);e||(e=new Map,js.set(s,e));const c=Mt.map(f=>o[f]||"").join("|");if(e.has(c))return e.get(c);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const r=a.style;r.position="absolute",r.visibility="hidden",r.top="0",r.left="-9999px",r.height="auto",r.minHeight="0",r.maxHeight="none",r.padding="0",r.border="0",r.boxSizing="content-box",r.overflow="hidden";for(let f=0;f<Mt.length;f++)o[Mt[f]]&&(r[Mt[f]]=o[Mt[f]]);let i=0;try{n.appendChild(a),i=a.clientHeight}catch{i=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return i>0?(e.set(c,i),i):null}function ae(t,o){return o?o.boxSizing==="border-box"?t+vs(o):o.boxSizing==="content-box"?Math.max(0,t-wo(o)):t:t}function ue(t){if(!t)return null;const o=ft(t.maxHeight);if(o==null||!(o>0))return null;const s=wo(t),n=vs(t),e=t.boxSizing==="border-box"?o-n:o+s,c=ft(t.lineHeight);if(!(c>0))return e;const a=Math.floor((e-s)/c+1e-6);return a>=1?a*c+s:e}function Es(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const Ps=["srcObject","muted"],de=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function le(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Ps.length;n++){const e=Ps[n],c=t[e];if(c===void 0||!(e in o))continue;const a=r=>{const i=de(e,r);if(o[e]!==i)try{o[e]=i}catch(f){F(s,e,f)}};if(typeof c=="function"){const r=R(t,t[e+"Deps"],c),i=(0,E.createEffect)(()=>{try{a(r(t,t.state,t.context))}catch(f){F(s,e,f)}},{depth:s.path.length,label:P(s,e)});s.__effects.push(i),s.__exec[e]=c}else a(c);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function pe(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,e=typeof n=="function"?R(t,t.autoGrowDeps,n):null,c=(0,E.createEffect)(()=>{const a=t.autoGrow;let r=a;if(typeof a=="function")try{r=(a===n&&e?e:a)(t,t.state,t.context)}catch{r=null}se(t,r)},{depth:s.path.length,label:P(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(c),e&&(s.__exec.autoGrow=n)}const Os=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ts(t,o){for(const s of Object.keys(t)){if(!m(s)||Os.has(s))continue;const n=(0,At.globalEventKeyInfo)(s);if(n){(0,At.registerGlobalEvent)(n,t,t[s]);continue}let e=t[s],c=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(c=e,e=c.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const r=e;e=function(f){return t.call(r,f)}}if(typeof e!="function")continue;const a=on(s);H.LIFECYCLE_EVENTS.has(a)||(0,At.registerEvent)(sn(a),t,e,c)}he(t)}function he(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const l of Os){const g=t[l];typeof g=="function"&&(s[l]=g,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,r=0,i=0,f=!1;const d=l=>{const g=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];g&&(a=g.clientX,r=g.clientY,i=Date.now(),f=!0)},u=l=>{if(!f)return;f=!1;const g=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!g)return;const x=g.clientX-a,p=g.clientY-r,h=Date.now()-i;if(h>c)return;const _=Math.abs(x),w=Math.abs(p);if(Math.max(_,w)<e)return;let y;if(_>w*1.2)y=x<0?"left":"right";else if(w>_*1.2)y=p<0?"up":"down";else return;const b="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),A=s[b],S=s.onSwipe;A&&A.call(t,l,t,t.state,t.context),S&&S.call(t,{direction:y,dx:x,dy:p,dt:h,event:l},t,t.state,t.context)};o.addEventListener("touchstart",d,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",d)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function at(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=at(e,c):s[n]=c}return s}function Co(t,o,s,n,e){if(!o||!t.node)return;const c=t.childExtends,a=_t(t,"childProps");if(Array.isArray(o)){const r=t.tag==="fragment",i=t.context?.document||globalThis.document,f=r?null:i?.createDocumentFragment();if(!r&&!f)return;const d=t.childProps,u=t.childrenAs,l=y=>{let b=o[y];const A=b;(typeof b=="string"||typeof b=="number")&&(b={text:b});let S=d;if(typeof d=="function")try{S=d(t,b)}catch{S=null}let C=typeof d=="function"?Et(S):a;if(e&&u!=="state"&&(C=Pt(C,Et(A))),u==="state"){let O=A;(typeof A=="string"||typeof A=="number")&&(O={value:A,text:A}),b=S?{...S,state:O}:{state:O}}else S&&(b=at(S,b));if(c&&!b.ignoreChildExtends)if(b.extends){const O=Array.isArray(b.extends)?b.extends:[b.extends],q=Array.isArray(c)?c:[c];b={...b,extends:[...q,...O]}}else b={...b,extends:c};const j=Ro(b?.key,A,y,t);try{return ot(Ot(b,C),t,j,s)}catch(O){if(typeof console<"u"&&console.error){const q=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${j}" failed to construct at ${q} (initial render, skipping this row):`,O?.message||O)}return null}},g=t.__ref;if(!(n===!0&&!r&&!!g&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let y=0;y<o.length;y++){const b=l(y);!r&&b?.node&&f.appendChild(b.node)}return r||t.node.appendChild(f),!0}const p=g.__childrenChunkGen=(g.__childrenChunkGen||0)+1;(0,U.openMountBudget)();const h=(0,U.childCostMeter)();let _=null;const w=y=>{if(g.__disposed||g.__childrenChunkGen!==p){_&&_.parentNode&&_.remove();return}for(let b=y;b<o.length;b++){h.begin();const A=l(b);A?.node&&(_?t.node.insertBefore(A.node,_):f.appendChild(A.node));const S=h.end();if(b+1<o.length&&(0,U.mountBudgetExhausted)(S)){_||(_=i.createComment("smbls-mount"),f.appendChild(_),t.node.appendChild(f));const C=b+1;(0,U.enqueueMountWork)(()=>w(C));return}}_?(_.remove(),t.node.tagName==="SELECT"&&qt(t,!0)):t.node.appendChild(f)};return w(0),(0,U.closeMountBudget)(),!0}if(typeof o=="string"){const r=Bo(o,t);if(Array.isArray(r))return Co(t,r,s,n,!0)}if(typeof o=="object")for(const r in o){if(H.REGISTRY.has(r))continue;let i=o[r];if(i==null||i===!1)continue;const f=e?Pt(a,Et(i)):a;if((typeof i=="string"||typeof i=="number")&&(i={text:i}),t.childProps&&(i=at(t.childProps,i)),c&&!i.ignoreChildExtends)if(i.extends){const d=Array.isArray(i.extends)?i.extends:[i.extends],u=Array.isArray(c)?c:[c];i={...i,extends:[...u,...d]}}else i={...i,extends:c};ot(Ot(i,f),t,Kt(t,r),s)}}function qt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const e=t.__ref,c=e&&e.__exec&&e.__exec.value,a=typeof c=="function",r=t.value!=null&&typeof t.value!="function";if(a||r){let d;if(a)try{d=c(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=L.replaceLiteralsWithObjectFields.call(t,d,t.state));const u=d==null?"":String(d);s.value!==u&&(s.value=u);return}const i=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!i)return;let f=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(f=d);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function Ds(t,o){let{children:s,content:n}=t;const e=t.childExtends,c=typeof s=="function"||Yo(t,"children");if(typeof s=="function"){const p=s;try{s=p(t,t.state,t.context)}catch(b){if(s=void 0,typeof console<"u"&&console.error){const A=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${A} (initial run, treating as empty):`,b?.message||b)}}qo(t,s),t.children=s;const h=t.__ref;let _=!1;const w=R(t,t.childrenDeps,p),y=(0,E.createEffect)(()=>{const b=_;_=!0;let A;try{A=w(t,t.state,t.context)}catch(B){if(typeof console<"u"&&console.error){const G=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${G}${b?"":" (initial tracking run)"}:`,B?.message||B)}return}if(!b||A===t.children)return;qo(t,A),t.children=A,h.__childrenChunkGen!=null&&h.__childrenChunkGen++;const S=typeof t.onContentUpdate=="function",C=S?[]:null,j=S?[]:null,O=S?[]:null;if(Array.isArray(A)&&t.childrenAs==="state"){const B=t.childProps,G=[],ko=new Map;for(let T=0;T<A.length;T++){const Z=A[T];let D=B;if(typeof B=="function")try{D=B(t,Z)}catch{D=null}const J=Ro(D&&D.key,Z,T,t);G.push(J),ko.set(J,{rawChild:Z,childProps:D})}const Is=new Set(G),Bs=h.__children.slice();for(const T of Bs)if(!Is.has(T)){const Z=t[T];Z?.remove&&Z.remove(),delete t[T],j&&j.push(T)}const wt=t.childExtends,Bt=t.tag==="fragment",Hs=t.context?.document||globalThis.document,St=Bt?null:Hs?.createDocumentFragment(),Xt=new Set;for(const T of G){const Z=ko.get(T),D=Z.rawChild,J=t[T];if(J&&J.state){if(D&&typeof D=="object"){const K=J.state,lt=K.$replace||K.replace,vo=K.$update||K.update;try{if(typeof lt=="function")lt.call(K,D);else if(typeof vo=="function"){for(const Y in K)if(!(Y==="__element"||Y==="root"||Y==="parent"||Y==="update")&&!Object.prototype.hasOwnProperty.call(D,Y))try{K[Y]=void 0}catch{}vo.call(K,D)}else for(const Y in D)K[Y]=D[Y]}catch(Y){if(typeof console<"u"&&console.error){const Vs=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Vs} (reconcile, keeping its previous data for this pass):`,Y?.message||Y)}}}O&&O.push(T);continue}let Jt=D;(typeof D=="string"||typeof D=="number")&&(Jt={value:D,text:D});const mt=Z.childProps;let X=mt?{...mt,state:Jt}:{state:Jt};const Us=typeof B=="function"?Et(mt):_t(t,"childProps");if(wt&&!X.ignoreChildExtends)if(X.extends){const K=Array.isArray(X.extends)?X.extends:[X.extends],lt=Array.isArray(wt)?wt:[wt];X={...X,extends:[...lt,...K]}}else X={...X,extends:wt};let to;try{to=ot(Ot(X,Us),t,T,o)}catch(K){if(typeof console<"u"&&console.error){const lt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${lt} (reconcile, skipping this row):`,K?.message||K)}Xt.add(T);continue}!Bt&&to?.node&&St&&St.appendChild(to.node),C&&C.push(T)}if(!Bt&&St&&St.childNodes.length&&t.node&&t.node.appendChild(St),!Bt&&t.node){let T=null;for(const Z of G){const D=t[Z]?.node;if(!D)continue;const J=T?T.nextSibling:t.node.firstChild;D!==J&&t.node.insertBefore(D,J),T=D}}h.__children=Xt.size?G.filter(T=>!Xt.has(T)):G,S&&(C.length||j.length)&&Lo(t,{added:C,removed:j,kept:O}),qt(t,!1);return}const V=S?[...h.__children]:null;for(const B of[...h.__children]){const G=t[B];G?.remove&&G.remove(),delete t[B]}h.__children=[],Co(t,A,o,!1,!0),qt(t,!1),S&&Lo(t,{added:[...h.__children],removed:V,kept:[]})},{depth:h.path.length,label:P(h,"children")});h.__effects.push(y)}const a=Co(t,s,o,!0,c);if(n!=null&&!(n&&n.__ref)){let p=n;if(typeof p=="string"||typeof p=="number"?p={text:p}:typeof p!="object"&&(p={}),t.childProps&&(p=at(t.childProps,p)),e&&!p.ignoreChildExtends)if(p.extends){const _=Array.isArray(p.extends)?p.extends:[p.extends],w=Array.isArray(e)?e:[e];p={...p,extends:[...w,..._]}}else p={...p,extends:e};const h=Pt(_t(t,"childProps"),_t(t,"content"));ot(Ot(p,h),t,"content",o)}if(s&&!a)return;const r=t.context?.components||{},i=t.__ref&&t.__ref.__runtimeSource,f=i?{}:null;{const p=Object.keys(t);for(let h=0;h<p.length;h++){const _=p[h];if(!_.endsWith("Extends")||typeof t[_]!="string")continue;const w=_.slice(0,-7);if(!w||w.charCodeAt(0)<65||w.charCodeAt(0)>90)continue;const y={extends:t[_]};delete t[_];for(let b=h+1;b<p.length;b++){const A=p[b],S=A.charCodeAt(0);if(S>=65&&S<=90||H.REGISTRY.has(A)||typeof t[A]=="function"&&(A.startsWith("on")||A.startsWith(".")))break;const C=t[A];C!==void 0&&(y[A]=C,delete t[A],f&&jt(i,A)&&(f[w]||(f[w]={}),f[w][A]=i[A]))}t[w]&&typeof t[w]=="object"?t[w]={...y,...t[w]}:t[w]=y}}const d=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),l=p=>{if(H.REGISTRY.has(p)||typeof t[p]!="object"||t[p]===null)return;const h=p.charCodeAt(0);if(h<65||h>90)return;let _=t[p];if(_.__ref)return;if(!_.extends&&!_.extend){const y=r[p]||r[`smbls.${p}`];y&&(_={..._,extends:y})}if(t.childProps&&(_=at(t.childProps,_)),e&&!_.ignoreChildExtends)if(_.extends){const y=Array.isArray(_.extends)?_.extends:[_.extends],b=Array.isArray(e)?e:[e];_={..._,extends:[...b,...y]}}else _={..._,extends:e};const w=i?Pt(_t(t,"childProps"),Pt(f[p]||null,_t(t,p))):null;ot(Ot(_,w),t,p,o)};if(!d){for(const p of u)l(p);return}(0,U.openMountBudget)();const g=(0,U.childCostMeter)(),x=p=>{for(let h=p;h<u.length;h++){g.begin(),l(u[h]);const _=g.end();if(h+1<u.length&&(0,U.mountBudgetExhausted)(_)){const w=h+1;(0,U.enqueueMountWork)(()=>x(w));return}}};x(0),(0,U.closeMountBudget)()}function Ls(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const e=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const r=s.node.nextSibling;a.insertBefore(n,r||e)}else a.insertBefore(n,e);return}}const c=o?.node||(o?.nodeType?o:null);if(c)if(s?.position==="before"&&s.node)c.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?c.insertBefore(n,a):c.appendChild(n)}else c.appendChild(n)}const Qt=3;function $s(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Qt?!1:(t.__inBeforeUpdate=!0,!0)}function It(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Qt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Qt}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,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);(0,z.dispatchPluginHook)(n,o,s);const e="on"+t,c=o[e];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(o.__ref[i])return!0;o.__ref[i]=!0}const f=o.context?.designSystem;f&&(0,M.pushConfig)(f);let d=!!i;try{const u=c(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const l=o.__ref;return u.catch(g=>{(0,z.reportLifecycleError)(o,e,g)}).finally(()=>{i&&l&&(l[i]=!1)}),d=!1,!0}if(u===!1)return!1}catch(u){if((0,z.reportLifecycleError)(o,e,u),o.context?.strictMode)throw u}finally{f&&(0,M.popConfig)(),d&&o.__ref&&(o.__ref[i]=!1)}}return!0}var ye=ot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var M=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _(t))!g.call(e,s)&&s!==n&&a(e,s,{get:()=>t[s],enumerable:!(r=h(t,s))||r.enumerable});return e};var y=e=>m(a({},"__esModule",{value:!0}),e);var S={};M(S,{MOUNT_YIELD_BUDGET_MS:()=>x,__flushMountQueueSync:()=>k,__pendingMountChunks:()=>B,__resetMountQueue:()=>U,childCostMeter:()=>w,closeMountBudget:()=>E,enqueueMountWork:()=>b,mountBudgetExhausted:()=>T,openMountBudget:()=>D});module.exports=y(S);const x=50,u=[];let i=!1,o=0,f=!1;function c(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function d(e){const t=typeof globalThis<"u"?globalThis.scheduler:null;if(t&&typeof t.yield=="function"){t.yield().then(e,e);return}if(typeof MessageChannel=="function"){const n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e()},n.port2.postMessage(0);return}setTimeout(e,0)}function T(e=0){return!o||c()-o+e<50?!1:(f=!0,!0)}function w(){let e=0,t=0,n=0;return{begin(){n=c()},end(){const r=c()-n;e+=r,t++;const s=e/t;return r>s?r:s}}}let l=0;function D(){l===0&&!o&&(o=c(),f=!1),l++}function E(){l>0&&l--,l===0&&!i&&(o=0,f=!1)}function b(e){u.push(e),i||(i=!0,d(p))}function p(){for(o=c(),f=!1;u.length;){const e=u.shift();try{e()}catch(t){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",t?.message||t)}if(f||c()-o>=50)break}if(u.length){d(p);return}i=!1,o=0,f=!1,l=0}function k(){let t=0;for(o=0;u.length&&t++<1e5;){const n=u.shift();try{n()}catch(r){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",r?.message||r)}}i=!1,o=0,f=!1,l=0}function B(){return u.length}function U(){u.length=0,i=!1,o=0,f=!1,l=0}
|
package/dist/cjs/src/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var A=(o,f)=>{for(var t in f)a(o,t,{get:f[t],enumerable:!0})},U=(o,f,t,r)=>{if(f&&typeof f=="object"||typeof f=="function")for(let s of g(f))!P.call(o,s)&&s!==t&&a(o,s,{get:()=>f[s],enumerable:!(r=b(f,s))||r.enumerable});return o};var j=o=>U(a({},"__esModule",{value:!0}),o);var S={};A(S,{default:()=>B,update:()=>x});module.exports=j(S);var u=require("@symbo.ls/signal"),_=require("./registry.js"),i=require("./create.js"),y=require("./pluginHooks.js"),v=require("./cssLonghands.js");function x(o={},f={}){const t=this,r=t.__ref;if(!r)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!f.preventListeners&&typeof t.onBeforeUpdate=="function"&&(0,i.acquireBeforeUpdateGuard)(r))try{const e=t.onBeforeUpdate(t,t.state,t.context,f);if(e&&typeof e.then=="function")e.then(()=>(0,i.releaseBeforeUpdateGuard)(r,!1),n=>{(0,i.releaseBeforeUpdateGuard)(r,!0),(0,y.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if((0,i.releaseBeforeUpdateGuard)(r,!1),e===!1)return t}catch(e){throw(0,i.releaseBeforeUpdateGuard)(r,!0),e}const s=!o||Object.keys(o).length===0,l=[];let h=!1;(0,u.batch)(()=>{if(o.state&&(0,u.isStore)(t.state)&&t.state.$update(o.state),o.text!==void 0&&(t.text=o.text,!r.__exec.text&&t.node&&(0,i.writeElementText)(t,o.text??"")),o.html!==void 0&&(t.html=o.html,!r.__exec.html&&t.node&&(t.node.innerHTML=o.html)),o.style&&t.node?.style){if(!r.__exec.style){const e=(0,i.resolveStyleBlock)(t,o.style);for(const n in e){const c=e[n];if(c==null)continue;const d=(0,v.cssPropName)(n),p=String(c).replace(/\s*!important\s*$/,"");t.node.style.setProperty(d,p,"important")}}t.style||(t.style={}),Object.assign(t.style,o.style)}if(o.attr&&t.node?.setAttribute){for(const e in o.attr){const n=o.attr[e];(0,i.writeAttr)(t.node,e,n)}t.attr||(t.attr={}),Object.assign(t.attr,o.attr)}if(o.data&&t.node?.dataset){for(const e in o.data)t.node.dataset[e]=o.data[e];t.data||(t.data={}),Object.assign(t.data,o.data)}if(o.vars&&typeof o.vars=="object"&&!Array.isArray(o.vars)){const e=t.vars&&typeof t.vars=="object"&&!Array.isArray(t.vars)?t.vars:null;t.vars={...e,...o.vars},h=!0}for(const e in o){if(_.REGISTRY.has(e)||e==="state")continue;const n=o[e],c=t[e];if(c&&c.__ref&&typeof c.update=="function")c.update(n,f);else if(typeof n=="object"&&n!==null){const d=e.charCodeAt(0);d>=65&&d<=90&&(0,i.create)(n,t,e,f)}else e!=="text"&&e!=="html"&&e!=="style"&&e!=="attr"&&e!=="data"&&(t[e]=n,typeof n!="function"&&l.push(e))}});for(let e=0;e<l.length;e++)(0,i.reconcileAttrProp)(t,l[e]);if(t.node){let e=h;for(let n=0;!e&&n<l.length;n++)(0,i.isStaticCssProp)(l[n])&&(e=!0);e&&(0,i.recompileStaticCss)(t)}if(t.node&&s&&r.__effects&&r.__effects.length)for(let e=0;e<r.__effects.length;e++){const n=r.__effects[e];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(t.node&&r.__conditionalRunners)for(const e of r.__conditionalRunners)e();return(0,y.dispatchPluginHook)("update",t),!f.preventListeners&&typeof t.onUpdate=="function"&&t.onUpdate(t,t.state,t.context,f),t}var B=x;
|
package/dist/cjs/src/version.js
CHANGED
|
@@ -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.
|
|
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.804";
|
package/dist/esm/src/create.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{createStore as oo,createScopeStore as
|
|
1
|
+
import{createStore as oo,createScopeStore as on,isStore as W}from"@symbo.ls/signal";import{createEffect as j,getObserver as sn}from"@symbo.ls/signal";import{withDesignSystem as X,untrack as Nt}from"./runContext.js";import{cacheNode as so,detectTag as Do,adoptHydrationNode as nn}from"./cache.js";import{REGISTRY as H,LIFECYCLE_EVENTS as en}from"./registry.js";import{registerEvent as rn,registerGlobalEvent as cn,globalEventKeyInfo as fn}from"./delegate.js";import{mountBridge as an}from"./bridge.js";import{applyExtends as un,openMergeLayer as dn,closeMergeLayer as ln}from"./extends.js";import{addMethods as pn}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as st}from"./devRuntime.js";import{mountBudgetExhausted as Lo,openMountBudget as Ro,closeMountBudget as Mo,enqueueMountWork as No,childCostMeter as Fo}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as $,isPolyglotWritableKey as hn,markPolyglotSeeded as yn,polyglotSeededKeys as _n}from"@symbo.ls/utils";import*as Ft from"@symbo.ls/utils";import{dispatchPluginHook as bt,hasPluginHook as gn,reportLifecycleError as $t}from"./pluginHooks.js";import{applyStateMethods as at}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as I,DEFAULT_CSS_PROPERTIES_LIST as U,pushStaticCssPass as $o,popStaticCssPass as Io,resolveStyleBlockTokens as bn}from"css-in-props";import{css as At,wrapHoverRule as Bo}from"@symbo.ls/css";import{pushConfig as Y,popConfig as q}from"@symbo.ls/scratch";import{checkAttributeByTagName as xt,applyAttrTransforms as An,ATTR_TRANSFORMS as no,camelToAttr as wt,serializeAttrValue as J,isEnumeratedTrueFalseAttr as It,extractConditionalAttrs as xn}from"attrs-in-props";import{resolveElementIdEngine as wn}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as Bt,CSS_SHORTHAND_LONGHANDS as Sn,cssShorthandStatesLonghand as Ho,cssPropName as Uo,cssCamelName as Vo}from"./cssLonghands.js";import{isAttributeFirst as Go,isCssProp as nt}from"./attributeFirst.js";import{VERSION as Cn}from"./version.js";const Ko=wn({uniqId:1,scopedStyleId:0},Cn),St=[],et=new Set;let eo=!1,Wo=0,ut=null,Ct=null;function dt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function zo(){return typeof document<"u"&&document.visibilityState==="hidden"}const kn=250,vn=1e3;function jn(){return Ct&&(Ct!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||zo())?!0:dt()-Wo>=vn}function En(){if(eo=!0,Wo=dt(),Ct=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(ro,0);ut=t?()=>t(o):null;return}if(zo()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(ro,kn);ut=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;Ct=requestAnimationFrame;const o=requestAnimationFrame(ro);ut=t?()=>t(o):null}}function Ht(){if(eo){if(!jn())return;const t=ut;if(ut=null,t)try{t()}catch{}}En()}const Yo=300,qo=15e4;function ro(){if(eo=!1,ut=null,Ct=null,et.size&&je(),!St.length)return;const t=St.splice(0,St.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=dt());const e=dt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Yo&&e<qo?(St.push(s),Ht()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",e,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&an(s),typeof s.onMounted=="function"&&D("Mounted",s,s.__ref?.__mountOptions||{})}}}function io(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Lt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,St.push(t),Ht())}function Zo(t,o){typeof t.onContentUpdate=="function"&&(bt("contentUpdate",t,o),X(t,()=>{try{t.onContentUpdate(t,t.state,t.context,o)}catch(s){if($t(t,"onContentUpdate",s),t.context?.strictMode)throw s}}))}function Z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Pn(t){return t.charAt(2).toLowerCase()+t.slice(3)}function On(t){return t.toLowerCase()}function co(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function kt(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=kt(e,c):s[n]=c}return s}function Ut(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Qo(t,o,s,n){return Vt(n,Ut(t)||(o&&typeof o=="object"?Ut(o.key):void 0)||String(s))}function Vt(t,o){if(!t||typeof o!="string")return o;let s=o;for(;Tn(t,s);)s="$"+s;return s!==o&&Dn(t,o,s),s}function Tn(t,o){if(H.has(o)&&o!=="content")return!0;if(!(o in t))return!1;const s=t[o];return!(s&&typeof s=="object"&&s.__ref&&s.parent===t)}const Xo=new Set;function Dn(t,o,s){if(!st())return;const n=t.__ref&&t.__ref.path&&t.__ref.path.join(".")||t.key||"<root>",e=n+"::"+o;Xo.has(e)||(Xo.add(e),console.warn(`[smbls] a child keyed "${o}" at ${n} names a property of its parent; it lives at el["${s}"] (data-key="${s}") so the parent keeps its own "${o}". Prefix the data keys to keep plain el.<key> access.`))}function m(t,o,s,n={},e){if(sn())return Nt(()=>m(t,o,s,n,e));if(t==null||t===!1)return null;const c=Qn(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Ut(s);const a=Ut(t.key),r=Object.create(null);r.key=s||(a&&o?Vt(o,a):a)||`_${Ko.uniqId++}`,r.parent=o||null,r.context=t.context||o?.context||n.context||{},r.context.__create||(r.context.__create=m);const i=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||r,path:o?.__ref?.path?[...o.__ref.path,r.key]:[r.key],origin:t};c&&(i.__runtimeSource=c);const f=t;if(t=mo(r,t,s,a,o,n),r.if!=null){let u;if(typeof r.if=="function")try{u=r.if(r,r.state,r.context)}catch(l){if(u=!1,i.__ifError=l,typeof console<"u"&&console.warn){const g=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${g} \u2014 treating as false:`,l?.message||l)}}else u=r.if;i.__if=!!u}if(i.__if)typeof r.if=="function"&&(i.__ifInitialized=!0);else{o&&(o[r.key]=r);const u=Mn(t,s,r.context?.components);return u.length&&(i.__ifLateMerge={definition:f,key:s,ownKey:a,names:u,options:n}),typeof r.if=="function"&&_s(r,i,r.if),r}r.tag||(r.tag=Do(r)),D("Init",r,n);const d=r.node=nn(r)||so(r);if(!d)return r;if(r.tag==="fragment"){const l=(r.context?.document||globalThis.document).createComment("");d.appendChild(l),i.__fragmentAnchor=l}D("AttachNode",r,n),d.setAttribute&&r.key&&d.setAttribute("data-key",r.key),o&&(o[r.key]=r,o.__ref?.__children&&(o.__ref.__children.includes(r.key)||o.__ref.__children.push(r.key))),d.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&d.setAttribute("data-smbls-app",r.context.key),r.id&&d.setAttribute&&(d.id=r.id),Ys(r,n),ps(r),ys(r);try{qs(r,n)}catch(u){if(typeof console<"u"&&console.error){const l=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${l}:`,u?.message||u,u?.stack?`
|
|
2
2
|
`+u.stack.split(`
|
|
3
3
|
`).slice(0,6).join(`
|
|
4
|
-
`):"")}}if(Zt(r,!0),Ys(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML&&Z(r,()=>{try{const u=r.html(r,r.state,r.context);u!=null&&typeof u!="function"&&(r.node.innerHTML=u)}catch{}}),D("Create",r,n),D("Complete",r,n),D("Render",r,n),D("RenderRouter",r,n),io(r,n),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,_=()=>{if(r.node){if(r.node.isConnected){l&&W(l);try{u(r,r.state,r.context)}catch(g){console.error("[DOMQL] onFrame error:",g)}finally{l&&z()}}requestAnimationFrame(_)}};requestAnimationFrame(_)}return r}const Qo=new Set(["childProps","attr","style","scope","data","vars"]);function Xo(t,o,s,n,e,c){if(s&&!o.extends&&!o.extend){const y=s.indexOf("_"),p=s.indexOf(".");let A=y>0?y:-1;if(p>0&&(A<0||p<A)&&(A=p),A>0){const w=s.substring(0,A),h=t.context?.components;h&&(h[w]||h["smbls."+w])?o={...o,extends:w}:h&&st()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${w}" but neither "${w}" nor "smbls.${w}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),fn(t,o,c);const a=an(t),r=t.props&&typeof t.props=="object"?t.props:null;for(const y in o){if(y==="parent"||y==="node"||y==="__ref"||y==="extends"||y==="context"||y==="props")continue;if(y==="key"){n&&(t.key=e?Vt(e,n):n);continue}const p=o[y];a&&a.mark(y);const A=t[y],w=A&&p&&typeof A=="object"&&typeof p=="object"&&!Array.isArray(A)&&!Array.isArray(p)&&typeof A!="function"&&typeof p!="function";w&&y.charCodeAt(0)>=65&&y.charCodeAt(0)<=90?t[y]=kt(A,p):w&&Qo.has(y)?t[y]={...A,...p}:w&&co(y)?t[y]=kt(A,p):t[y]=p}function i(y){for(const p in y){const A=y[p],w=t[p],h=w&&A&&typeof w=="object"&&typeof A=="object"&&!Array.isArray(w)&&!Array.isArray(A)&&typeof w!="function"&&typeof A!="function";h&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?t[p]=kt(w,A):h&&Qo.has(p)?t[p]={...w,...A}:h&&co(p)?t[p]=kt(w,A):t[p]=A}}if(r&&i(r),o.props&&typeof o.props=="object"&&(i(o.props),a))for(const y in o.props)a.mark(y);un(t),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const f=t.scope&&typeof t.scope=="object"?t.scope:null,d=e?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,l=d||u||null;if(o.scope!==void 0||f){const y={};f&&Object.assign(y,f),o.scope!==void 0&&Object.assign(y,o.scope),t.scope=ms(y,l)}else l&&(t.scope=l);o.if!==void 0&&(t.if=o.if);const _=t.__ref,g=Zn(t,_&&_.__runtimeSource);return _&&(_.__declaredArrays=g||void 0),dn(t),Rn(t,e,o,c),o}const Tn=new Set(["key","parent","context","__ref"]);function Dn(t,o){for(const n of Object.keys(t))Tn.has(n)||delete t[n];let s=o.definition;if(!s.extends&&!s.extend&&typeof o.key=="string"){const n=t.context?.components||{},e=n[o.key]||n["smbls."+o.key];e&&(s={...s,extends:e})}Nt(()=>Xo(t,s,o.key,o.ownKey,t.parent,o.options))}function Ln(t,o,s){const n=s||{},e=r=>!!(n[r]||n["smbls."+r]),c=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const r of a){if(typeof r!="string")continue;const i=r.includes(">")?r.split(">")[0].trim():r;e(i)||c.push(i)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let r=-1;const i=o.indexOf("_"),f=o.indexOf(".");i>0&&(r=i),f>0&&(r<0||f<r)&&(r=f);const d=r>0?o.substring(0,r):o;e(d)||c.push(d)}return c}function fo(t,o,s){if(typeof t.onStateInit!="function"&&!yn(t,"stateInit"))return;const n=t.state;t.state=o;try{D("StateInit",t,s)}finally{t.state=n}}const ao=t=>({isDataOnlyKey:o=>hn(t).has(o)});function Rn(t,o,s,n){const e=!o,c=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&c&&t.context?.state,r=s.state!==void 0&&!a?s.state:t.state&&!G(t.state)?t.state:void 0;if(r==null){if(o?.state)t.state=o.state,ft(t,t.state);else if(t.context?.state){const i=t.context.state,f={...i},d=t.context?.polyglot;if(d?.translations){const u=t.context,l=i.lang||d.defaultLang||"en",_=new Set,g=(A,w)=>{_.has(A)||ln(u,A,f)&&(f[A]=w,_.add(A),pn(u,A,w))},y=d.translations[l];if(y&&typeof y=="object")for(const A in y)g(A,y[A]);const p=new Set(d.languages||[]);for(const A in d.translations)p.has(A)||g(A,d.translations[A])}G(f)||fo(t,f,n),t.state=G(f)?f:oo(f,ao(t.context)),t.state.__element=t,t.state.root=t.state,ft(t,t.state),Ft.promoteActiveRootState?.(i,t.state),D("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),ft(t,t.state);return}if(typeof r=="string"){if(t.state=ts(r,o),t.state&&typeof t.state=="object"&&!G(t.state)){const i=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}ft(t,t.state),Nn(t,r,o),D("StateCreated",t,n);return}if(typeof r=="function"){const i=r(t,o?.state);if(G(i))t.state=i;else{const f=i||{};fo(t,f,n),t.state=oo(f,o?.state?void 0:ao(t.context))}}else if(G(r))t.state=r;else{const i={...r};fo(t,i,n),t.state=oo(i,o?.state?void 0:ao(t.context))}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,ft(t,t.state),Ft.promoteActiveRootState?.(r,t.state),D("StateCreated",t,n)}function Jo(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const e of s){if(n==null)return{};n=n[e]}return n??{}}function mo(t,o){const s=o.state;return t.startsWith("~/")?[s&&(s.root||s),t.slice(2)]:t.startsWith("../")?[s,t.slice(3)]:[s,t]}function ts(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[e,c]=mo(t,o);return c?Jo(e,c):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=Jo(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const e=o.state?.root?.lang||n.defaultLang||"en",c=n.translations[e];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function Mn(t,o){const[s,n]=mo(t,o);if(!n||!s||typeof s!="object")return;const e=s[n];if(e!==void 0||n.indexOf("/")===-1)return e;let c=s;for(const a of n.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function Nn(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!G(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const e=Nt(()=>j(()=>{const c=Mn(o,s);!c||typeof c!="object"||c===t.state||Nt(()=>os(t,t.state,c,!0))},{depth:n.path?n.path.length:0,label:v(n,"state")}));e._isStateBinding=!0,n.__stateBinding=e,n.__effects&&n.__effects.push(e)}function os(t,o,s,n){const e=t.__ref;if(!e)return;if(n||t.state===o){t.state=s,n&&ft(t,s),ss(e);const a=e.__children;if(a)for(let r=0;r<a.length;r++){const i=t[a[r]];i&&i.__ref&&i.parent===t&&os(i,o,s,!1)}return}if(e.__stateBinding){e.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=s,ss(e))}function ss(t){const o=t.__effects;if(o)for(let s=0;s<o.length;s++){const n=o[s];n&&!n._disposed&&!n._isStateBinding&&!n._isSubscribeToEffect&&typeof n._notify=="function"&&n._notify()}}const Fn=new Set(["s","state","ctx","context"]),uo=new WeakMap;function ns(t){if(uo.has(t))return uo.get(t);let o=null;try{const s=typeof Ft.getFunctionSource=="function"?Ft.getFunctionSource(t):Function.prototype.toString.call(t);if(typeof s=="string"){const n=s.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||s.match(/^[^(]*\(([^)]*)\)/);n&&(o={params:n[1].split(",").map(e=>e.trim()),body:s.slice(n.index+n[0].length)})}}catch{}return uo.set(t,o),o}function $n(t){const o=ns(t);return o?o.params.map(s=>s.split("=")[0].trim()).filter(Boolean):[]}const es=new WeakMap;function In(t){let o=es.get(t);return o===void 0&&(o=Bn(ns(t)),es.set(t,o)),o}function Bn(t){if(!t)return!0;const o=t.body;if(/\bstate\b|\barguments\b|\bcall\s*\(/.test(o))return!0;const s=t.params[1];if(!s)return!1;if(!/^[A-Za-z_$][\w$]*$/.test(s.split("=")[0].trim()))return!0;const n=s.split("=")[0].trim();return new RegExp("(^|[^\\w$.])"+n.replace(/\$/g,"\\$")+"(?![\\w$])").test(o)}const Hn=3,Un=/^(is|has)[A-Z0-9_$]/,Vn=new Set(["routerOptions"]),rs=new WeakSet;function Gn(t,o){if(typeof t!="function"||t.length!==2||o&&(Un.test(o)||Vn.has(o))||rs.has(t))return!1;const s=$n(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<Hn||Fn.has(n)?!1:(rs.add(t),!0)}function Kn(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const r=c[a];if(typeof t[r]!="function"||B.has(r))continue;const i=r.charCodeAt(0);i>=65&&i<=90||Y(r)||$[r]||H&&H.has(r)||i!==45&&(xt(s,r)||(st()&&Gn(t[r],r)&&console.warn(`[smbls] custom prop "${r}"${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('${r}', \u2026) instead of reading el.${r}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:r,fn:t[r]})))}for(let a=0;a<e.length;a++){const{prop:r,fn:i}=e[a];o.__exec[r]=i,Object.defineProperty(t,r,{get(){n&&W(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&z()}},set(f){delete o.__exec[r],Object.defineProperty(t,r,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Wn(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const n=o[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function T(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return Wn(t,o),s.apply(this,n)}}function dt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function v(t,o){return()=>t.path.join(".")+"::"+o}const is=new Set;function R(t,o,s){if(!st())return;const n=v(t,o)();is.has(n)||(is.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const cs=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,zn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;cs.lastIndex=0;let n;for(;(n=cs.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Yn=(t,o)=>!Y(t)&&!nt(o,t),lo=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Yn(t,n)&&zn(o,s)},po=new WeakMap,vt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),jt=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?it(t,o):t},Et=(t,o)=>t&&o?it(t,o):t||o||null,fs=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&vt(s,o)},lt=(t,o)=>fs(t,o)?jt(t.__ref.__runtimeSource[o]):null,Pt=(t,o)=>(o&&t&&typeof t=="object"&&po.set(t,o),t),qn=t=>{if(!t||typeof t!="object")return;const o=po.get(t);return o&&po.delete(t),o},ho=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let n=0;n<t.length;n++)ho(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const e=Object.getOwnPropertyDescriptor(t,n);e&&"value"in e&&ho(e.value,o,s)}}},Zn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(B.has(n)||o&&vt(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),c=e&&e.value;if(!Array.isArray(c))continue;const a=new Set;ho(c,a,new Set),a.size&&(s||(s=new Map),s.set(c,a))}return s},as=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,e=n&&n.get(o);if(!e)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of e)c.__authoredTemplates.add(a);return}},us=["attr","aria","data","metadata"],Qn=t=>{if(us.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},Xn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,e),a=c&&c.value,r=!!o&&vt(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!Qn(e))continue;const i=r?o[e]:null,f=i&&typeof i=="object"?i:null,d=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const l=r&&(!f||vt(f,u)),_=a[u];if(d&&_&&typeof _=="object"&&!Array.isArray(_)&&us.includes(u)){for(const g in _)lo(g,_[g],s,n,l);continue}lo(u,_,s,n,l)}continue}lo(e,a,s,n,r)}return s};function ds(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=Xn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const i of e)s.__authoredTemplates.add(i);else s.__authoredTemplates=e;if(Kn(t),typeof t.text=="function"){const i=t.text,f=T(t,t.textDeps,i),d=j(()=>{if(!s.contentManaged)try{let u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=F.call(t,u,t.state)),Gt(t,u))}catch(u){R(s,"text",u)}},{depth:s.path.length,label:v(s,"text")});s.__effects.push(d),s.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,f=j(()=>{if(s.contentManaged)return;const d=F.call(t,i,t.state);d!=null&&(t.text=d),t.node&&Gt(t,d??"")},{depth:s.path.length,label:v(s,"text")});s.__effects.push(f),s.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!B.has(i)&&!Y(i)&&!s.__exec[i]&&!Uo(c,i)){if($[i]){const f=t[i],d=T(t,t[i+"Deps"],f),u=i;let l,_=null,g=null,y;const p=j(()=>{const A=t.context?.designSystem;A&&W(A);try{const w=d(t,t.state,t.context);No();let h;try{h=$[u](w,t,t.state,t.context)}finally{Fo()}if(Array.isArray(h)){const x={};for(const S of h)if(S)for(const k in S)x[k]=S[k];h=x}const b=u==="show"||u==="hide";if(h&&t.node&&te(h)){const x=pt(h);if(x===null||x!==y){y=x;const S=At(h,null,t.context?.cssPrefix),k=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(g)for(const C of g)t.node.classList.remove(C);if(k&&k.length)for(const C of k)t.node.classList.add(C);g=k}}l=void 0,_=null}else if(h&&t.node){if(g){for(const S of g)t.node.classList.remove(S);g=null,y=void 0}const x=pt(h);if(x===null||x!==l||!Tt(t.node,_)){l=x;const S=Ss(t,h);_=Ot(t.node,S)}}else t.node&&b&&(l=void 0,_=null,t.node.style.display="")}finally{A&&z()}},{depth:s.path.length,label:v(s,u)});s.__effects.push(p),s.__exec[i]=f}else if(H&&H.has(i)){const f=t[i],d=T(t,t[i+"Deps"],f),u=i;let l,_=null;const g=j(()=>{const y=t.context?.designSystem;y&&W(y);try{const p=d(t,t.state,t.context);if(t.node)if(p!=null){const A=u+":"+String(p);if(A!==l||!Tt(t.node,_)){l=A;const w={[u]:p},h=Ss(t,w);_=Ot(t.node,h)}}else l=void 0,_=null,t.node.style[u]=""}finally{y&&z()}},{depth:s.path.length,label:v(s,u)});s.__effects.push(g),s.__exec[i]=f}else if(i.charCodeAt(0)===45){const f=t[i];As(t,i,f,t[i+"Deps"],i),s.__exec[i]=f}}if(oe(t),typeof t.html=="function"){const i=t.html,f=T(t,t.htmlDeps,i),d=j(()=>{Z(t,()=>{const u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)})},{depth:s.path.length,label:v(s,"html")});s.__effects.push(d),s.__exec.html=i}if(typeof t.value=="function"){const i=t.value,f=T(t,t.valueDeps,i),d=j(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=F.call(t,u,t.state)),ys(t,u)}catch(u){R(s,"value",u)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(d),s.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,f=j(()=>{try{ys(t,F.call(t,i,t.state))}catch(d){R(s,"value",d)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(f),s.__exec.value=i}if(typeof t.style=="function"){const i=t.style,f=T(t,t.styleDeps,i);let d,u=null,l,_,g,y;const p=j(()=>{const A=f(t,t.state,t.context),w=t.context&&t.context.designSystem;let h;if(A&&typeof A=="object"&&A===l&&w===g){const x=pt(A);h=x!==null&&x===_?y:qt(t,A),_=x}else h=qt(t,A),_=void 0;l=A,g=w,y=h;const b=pt(h);(b===null||b!==d||!Tt(t.node,u))&&(d=b,_o(t.node,u,h),J(t.node,h),u=Ot(t.node,h))},{depth:s.path.length,label:v(s,"style")});s.__effects.push(p),s.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const f=t.style[i];if(typeof f!="function")continue;const d=T(t,dt(t.styleDeps,i),f);let u,l=null;const _=j(()=>{try{const g=d(t,t.state,t.context);if(t.node){const y=i+":"+String(g);if(y!==u||!Tt(t.node,l)){u=y;const p=qt(t,{[i]:g});_o(t.node,l,Object.assign({},p,{[i]:""})),J(t.node,p),l=Ot(t.node,p)}}}catch(g){R(s,"style."+i,g)}},{depth:s.path.length,label:v(s,"style."+i)});s.__effects.push(_)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const f=T(t,dt(t.attrDeps,i),t.attr[i]),d=i,u=j(()=>{try{let l=f(t,t.state,t.context);typeof l=="string"&&l.includes("{{")&&(l=F.call(t,l,t.state)),t.node?.setAttribute&&Kt(t.node,d,l)}catch(l){R(s,"attr."+d,l)}},{depth:s.path.length,label:v(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const f=t.attr[i],d=i,u=j(()=>{try{const l=F.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(d,Q(d,l??""))}catch(l){R(s,"attr."+d,l)}},{depth:s.path.length,label:v(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const f=t.aria[i];if(typeof f=="string"&&f.includes("{{")){const _=f,g="aria-"+i.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),y=j(()=>{try{const p=F.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,Q(g,p??""))}catch(p){R(s,"aria."+i,p)}},{depth:s.path.length,label:v(s,"aria."+i)});y._attrName=g,s.__effects.push(y);continue}if(typeof f!="function")continue;const d=T(t,dt(t.ariaDeps,i),t.aria[i]),u="aria-"+i.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),l=j(()=>{try{const _=d(t,t.state,t.context);if(!t.node?.setAttribute)return;Kt(t.node,u,_)}catch(_){R(s,"aria."+i,_)}},{depth:s.path.length,label:v(s,"aria."+i)});l._attrName=u,s.__effects.push(l)}if(t.data&&typeof t.data=="object")for(const i in t.data){const f=t.data[i];if(typeof f=="string"&&f.includes("{{")){const g=f,y="data-"+i.replace(/[A-Z]/g,A=>"-"+A.toLowerCase()),p=j(()=>{try{const A=F.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,A??"")}catch(A){R(s,"data."+i,A)}},{depth:s.path.length,label:v(s,"data."+i)});p._attrName=y,s.__effects.push(p);continue}if(typeof f!="function")continue;const d=T(t,dt(t.dataDeps,i),t.data[i]),l="data-"+i.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),_=j(()=>{try{const g=d(t,t.state,t.context);if(!t.node?.setAttribute)return;g==null||g===!1?t.node.removeAttribute(l):typeof g!="function"&&typeof g!="object"&&t.node.setAttribute(l,g===!0?"":g)}catch(g){R(s,"data."+i,g)}},{depth:s.path.length,label:v(s,"data."+i)});_._attrName=l,s.__effects.push(_)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const i in a){if(typeof a[i]!="function")continue;const f=T(t,dt(t.classDeps,i),a[i]),d=j(()=>{try{const u=f(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(i):t.node.classList.remove(i)}catch(u){R(s,"class."+i,u)}},{depth:s.path.length,label:v(s,"class."+i)});s.__effects.push(d)}!n&&typeof t.if=="function"&&hs(t,s,t.if);for(const i of Object.keys(t)){if(B.has(i)||typeof t[i]!="function")continue;const f=i.charCodeAt(0);if(f>=65&&f<=90||Y(i))continue;const d=t[i];s.__exec[i]=d;const u=t.tag||"div";if(xt(u,i)&&!nt(u,i)){const l=wt(i)||i,_=T(t,t[i+"Deps"],d),g=j(()=>{try{let y=_(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=F.call(t,y,t.state)),t.node?.setAttribute&&Kt(t.node,l,y,!0)}catch(y){R(s,i,y)}},{depth:s.path.length,label:v(s,i)});g._attrName=l.toLowerCase(),s.__effects.push(g)}}const r=t.tag||"div";for(const i of Object.keys(t)){if(B.has(i))continue;const f=t[i];if(typeof f!="string"||!f.includes("{{"))continue;const d=i.charCodeAt(0);if(d>=65&&d<=90||Y(i)||nt(r,i)||no[i]||!xt(r,i))continue;const u=wt(i)||i,l=j(()=>{try{const _=F.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,Q(u,_??""))}catch(_){R(s,i,_)}},{depth:s.path.length,label:v(s,i)});l._attrName=u.toLowerCase(),s.__effects.push(l)}if(fe(t),ge(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,f=t.stateDeps;let d=!1,u=[];const l=j(()=>{const _=[];for(let p=0;p<f.length;p++){const A=f[p];try{_[p]=typeof A=="function"?A(t,t.state,t.context):t.state?.[A]}catch{_[p]=void 0}}if(!d){d=!0,u=_;return}let g=_.length!==u.length;for(let p=0;!g&&p<_.length;p++)_[p]!==u[p]&&(g=!0);const y=u;u=_,g&&Z(t,()=>{try{i(t,t.state,t.context,{prev:y,next:_})}catch(p){if($t(t,"onStateUpdate",p),t.context?.strictMode)throw p}})},{depth:s.path.length,label:v(s,"onStateUpdate")});s.__effects.push(l)}le(t)}function ls(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ys(t,t.parent);return}let n=null;const e=Object.keys(o),c=e.indexOf(t.key);for(let a=c+1;a<e.length;a++){const r=o[e[a]];if(r?.node?.parentNode===s){n=r.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function ps(t){_s(t),Se(t),Ls(t),Me(t),Re(t)}function hs(t,o,s){let n=T(t,t.ifDeps,s);const e=j(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const i=t.context?.components||{};c.names.some(f=>i[f]||i["smbls."+f])&&(o.__ifLateMerge=null,Dn(t,c),n=T(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(i){if(a=!1,o.__ifError=i,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,i?.message||i)}return}const r=o.__if;if(o.__if=!!a,r&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(i){console.error("[smbls] onRemove error:",i)}}else if(!r&&o.__if)if(o.__ifInitialized)t.node||(t.node=so(t)),t.node&&(t.node.ref=t),ls(t),_s(t),Ls(t),D("Render",t,{}),io(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=To(t)),D("Init",t,{}),t.node||(t.node=so(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"&&!o.__fragmentAnchor){const f=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(f),o.__fragmentAnchor=f}D("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ws(t,{}),ds(t,{skipIfEffect:!0}),ps(t),zs(t,{}),ls(t),D("Create",t,{}),D("Complete",t,{}),D("Render",t,{}),D("RenderRouter",t,{}),io(t,{})}},{depth:o.path.length,label:v(o,"if")});o.__effects.push(e)}function Gt(t,o){const s=t.node;if(!s)return;const n=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const e=t.__ref;let c=e?e.__textNode:null;if(c&&c.parentNode!==s&&(c=null),!c){const a=s.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):s.firstChild?(c=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(c,s.firstChild)):(s.textContent=n,c=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),e&&(e.__textNode=c||null)}function Jn(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function mn(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function Kt(t,o,s,n){s==null||s===!1&&!It(o)?Wt(t,o,null):typeof s=="function"||typeof s=="object"||(n&&o==="src"&&"src"in t?t.src=s:Wt(t,o,Q(o,s)))}function Wt(t,o,s){const n=Jn(t,o);s==null?t.removeAttribute(o):t.setAttribute(o,s),mn(t,n)}function ys(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const e=typeof document<"u"&&document.activeElement===s,c=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&c!=null&&a!=null)try{s.setSelectionRange(c,a)}catch{}const r=t.__ref&&t.__ref.__autoGrow;r&&r.active&&r.resize()}function _s(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Gt(t,t.text),$s(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.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 e in t.style)typeof t.style[e]!="function"&&(s[e]=t.style[e]);break}J(o,qt(t,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&&!It(s)||o.setAttribute&&o.setAttribute(s,Q(s,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),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("{{")||o.dataset&&(o.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&&o.classList.add(n));else if(typeof s=="object")for(const n in s){const e=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];e&&o.classList.add(typeof e=="string"?e:n)}}}}function pt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function te(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function Ot(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const e in o){if(o[e]==null||e.charAt(0)==="&")continue;const a=q(e);n.push(a,yo(s,a),gs(s,a))}return n}function yo(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function gs(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function q(t){return Bo(t)}function _o(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,e=new Set;if(s&&typeof s=="object")for(const c in s)s[c]==null||c.charAt(0)==="&"||e.add(q(c));for(let c=0;c<o.length;c+=3){const a=o[c];e.has(a)||yo(n,a)===o[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Tt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(yo(s,o[n])!==o[n+1]||gs(s,o[n])!==o[n+2])return!1;return!0}const Dt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,bs=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",zt=t=>Dt(t)?t:"--"+t;function Yt(t,o){if(!m(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let e=t[n];if(typeof e=="function"){if(!o)continue;e=e(o,o.state,o.context)}bs(e)&&(s||(s={}),s[zt(n)]=e)}return s}function As(t,o,s,n,e){xs(t,e,T(t,n,s),c=>bs(c)?{[o]:c}:null)}function xs(t,o,s,n,e){const c=t.__ref;let a,r=null;const i=j(()=>{Z(t,()=>{try{const f=n(s(t,t.state,t.context)),d=t.node;if(!d||!d.style)return;const u=pt(f);(u===null||u!==a||!Tt(d,r))&&(a=u,_o(d,r,f),f&&J(d,f),r=f?Ot(d,f):null,e&&e(f))}catch(f){R(c,o,f)}})},{depth:c.path.length,label:v(c,o)});c.__effects.push(i)}function oe(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){se(t,s),o.__exec.vars=s;return}if(m(s))for(const n of Object.keys(s)){const e=s[n];!n||typeof e!="function"||As(t,zt(n),e,dt(t.varsDeps,n),"vars."+n)}}function se(t,o){const s=t.__ref;xs(t,"vars",T(t,t.varsDeps,o),n=>Yt(n),n=>{s.__varsInline=n?new Set(Object.keys(n)):null})}function go(t,o){if(typeof t[o]=="function"&&(nt(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Dt(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!m(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&zt(n)===o)return!0;return!1}function ne(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(q(s)));return o}function ee(t,o,s,n){const e=t.__ref;if(!e)return;let c=null;if(s)for(const a of s){if(n&&n.has(a))continue;const r=o[a];if(r==null||typeof r=="object")continue;const i=q(a);Bt[i]&&(c||(c={}),c[i]=r)}e.__declaredLonghands=c}function ws(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const c in n){if(o.has(c))continue;const a=Bt[c];let r=!1;for(let i=0;i<a.length;i++)if(o.has(a[i])){r=!0;break}r&&(e||(e={}),e[c]=n[c])}return e}function Ss(t,o){const s=t.node;J(s,o);const n=ne(o);if(!n)return o;const e=t.__ref;if(e)if(e.__inlineCssKeys)for(const a of n)e.__inlineCssKeys.add(a);else e.__inlineCssKeys=new Set(n);const c=ws(t,n);return c?(J(s,c),Object.assign({},o,c)):o}function re(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=ws(t,o.__inlineCssKeys);s&&J(t.node,s)}function qt(t,o){return!o||typeof o!="object"?o:Z(t,()=>{try{return _n(o,t)}catch{return o}})}function J(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const e=o[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){s||(s={}),s[n]=e;continue}try{const c=String(e),a=Bo(n),r=c.trim(),i=/\s*!important\s*$/.test(r),f=r.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,i?"important":"")}catch{}}}s&&ie(t,s)}function ie(t,o){const s=`_ds${Vo.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let e=n.querySelector("style[data-smbls-scoped]");e||(e=n.createElement("style"),e.setAttribute("data-smbls-scoped",""),n.head.appendChild(e));let c="";for(const a in o){const r="."+s,i=a.replace(/&/g,r).split(",").map(d=>{const u=d.trim();return u.includes(r)?u:r+u}).join(", "),f=o[a];if(typeof f=="object"){let d="",u="";for(const l in f){const _=f[l];if(typeof _=="object"){const g=l.includes("&")?i.split(", ").map(p=>l.replace(/&/g,p)).join(", "):i.split(", ").map(p=>`${p} ${l}`).join(", ");let y="";for(const p in _)y+=`${q(p)}: ${_[p]};`;u+=$o(`${g} { ${y} }`,g)+`
|
|
5
|
-
`}else d+=`${
|
|
6
|
-
`),u&&(c+=u)}}c&&(e.textContent+=c)}const Cs=new Set;function ks(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function ce(t,o,s){const n=ks(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(ks(e)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";Cs.has(c)||(Cs.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(e)?e.join(", "):String(e)}]. 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 fe(t){const o=t.subscribeTo,s=typeof o=="function";let n=o;if(s)try{n=o(t,t.state,t.context)}catch{n=null}if(s&&st()&&ce(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let c=0;c<n.length;c++){const a=n[c];if(typeof a!="string"||a.length===0)continue;const r=a.split("."),i=r[0],f=r.slice(1),d={value:!1},u=j(()=>{const l=t.state&&(G(t.state)?t.state.root:null);if(!l||!G(l))return;let _=l;_=_[i];for(let y=0;y<f.length&&!(_==null||typeof _!="object");y++)if(G(_))_=_[f[y]];else break;if(!d.value)return;let g=!1;if(typeof t.onBeforeUpdate=="function"&&Z(t,()=>{try{if(Fe(e)){const y=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});y&&typeof y.then=="function"?y.then(()=>Qt(e,!1),p=>{Qt(e,!0),bt("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}):(Qt(e,!1),y===!1&&(g=!0))}}catch(y){Qt(e,!0),bt("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}}),!g&&t.node&&e.__effects)for(let y=0;y<e.__effects.length;y++){const p=e.__effects[y];p&&p!==u&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}!g&&typeof t.onUpdate=="function"&&Z(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(y){bt("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}})},{depth:e.path.length,label:v(e,"subscribeTo("+a+")")});d.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function bo(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function Ao(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const vs=new Set;function ae(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;vs.has(n)||(vs.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.`))}const js=new Map;function ue(t){let o=js.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push(Ho(e))};return s(Bt[t]),s(xn[t]),js.set(t,o),o}function Es(t,o,s){if(go(t,o)||s&&s.has(o))return!0;const n=ue(q(o));for(let e=0;e<n.length;e++){const c=n[e];if(go(t,c)||s&&s.has(c))return!0}return!1}function ht(t,o,s,n){const e={},c=new Set,a=(r,i,f)=>{const d=f?new Set(Object.keys(e)):null;if($[r]){const u=$[r](i,o,o.state,o.context);if(u){const l=Array.isArray(u)?u:[u];for(const _ of l)_&&Object.assign(e,_)}}else e[r]=i;if(f)for(const u in e)d.has(u)||c.add(u)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(o,o.state,o.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let l=i[u];typeof l=="function"&&(l=l(o,o.state,o.context)),!(l==null||typeof l=="function")&&a(u,l,Es(o,u,n))}continue}if(r==="vars"){const u=Yt(i,o);if(u)for(const l in u)a(l,u[l],go(o,l)||!!(n&&n.has(l)));continue}if(bo(r,o)){const u=ht(i,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){st()&&ae(r,o);continue}const f=Ao(r,o),d=ht(i,o,!1,n);Object.keys(d).length&&(e[f]=d);continue}a(r,i,Es(o,r,n))}}if(s)for(const r in e)c.add(r);for(const r of c){const i=e[r];typeof i=="string"&&!i.includes("!important")&&(e[r]=i+" !important")}return e}const m=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Ps(t,o){for(const s in o){const n=o[s];t[s]=m(n)?Ps(m(t[s])?t[s]:{},n):n}return t}function de(t,o){if(!m(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;m(e)&&(s=Ps(s||{},e))}return s}function xo(t,o){if(o===void 0&&(o=0),o>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)&&xo(t[s],o+1))return!0}return!1}function Os(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(bo(t,s)){const c=ht(o,s,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=Ao(t,s),e=ht(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function le(t){const o=t.__ref;for(const s of Object.keys(t)){if(!co(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!xo(n))continue;let e=null,c;const a=j(()=>{if(!t.node)return;const r=t.context?.designSystem;r&&W(r);let i,f=!1;try{const d=Os(s,n,t),u=d?pt(d.block)+"::"+d.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,d){const l=At({[d.cssProp]:d.block},null,t.context?.cssPrefix);i=l?l.split(" ").filter(Boolean):null}else i=null}finally{r&&z()}if(!(f||!t.node.classList)){if(e)for(const d of e)t.node.classList.remove(d);if(i&&i.length)for(const d of i)t.node.classList.add(d);e=i}},{depth:o.path.length,label:v(o,"cssBlock("+s+")")});o.__effects.push(a)}}const pe=()=>!0,he=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!$[t]||!!(H&&H.has(t))||Dt(t)||t==="vars"};function ye(t,o,s){const n={};let e=!1;for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(r!=="data"&&r!=="aria"&&(he(r,s[r])||B.has(r))?n[r]=!0:e=!0);if(!e)return null;const c=bn({[o]:s},t.tag||"div",n,pe);let a=null;for(const r in c)/^on/i.test(r)||(a||(a={}),a[r]=c[r]);return a}function Ts(t,o,s,n,e,c){const a=t.node;let r=null;const i=f=>{(r||(r=[])).push(f)};for(const f in n){const d=o.owners.get(f),u=d===s;if(!c&&d!==void 0&&!u)continue;let l;try{l=n[f](t)}catch(g){R(t.__ref,"conditional("+s+")."+f,g),u&&i(f);continue}if(typeof l=="string"&&l.includes("{{")&&(l=F.call(t,l,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){i(f);continue}if(l==null||typeof l=="object"||typeof l=="function"){u&&Ds(a,o,f);continue}const _=l===!1&&!It(f)?null:String(Q(f,l));i(f),!(u&&_===o.written.get(f))&&(d===void 0&&o.base.set(f,a.getAttribute(f)),Wt(a,f,_),o.owners.set(f,s),o.written.set(f,_))}e.appliedAttrs=r}function Ds(t,o,s){t.getAttribute(s)===o.written.get(s)&&Wt(t,s,o.base.get(s)),o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function _e(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const c of e)o.owners.get(c)===s&&Ds(t.node,o,c)}function Ls(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const n of o.owners.keys()){const e=o.written.get(n),c=s.getAttribute(n);c!==e&&(o.base.set(n,c),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function ge(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const c=e.charAt(0);if(c!=="."&&c!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const p=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${p}: { '${a.slice(p.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const i=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},d=ye(t,e,r);d&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const p in r){if(!Object.prototype.hasOwnProperty.call(r,p))continue;const A=p.charAt(0),w=r[p];if(!((A===":"||A==="@"||A==="&"||A==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(p==="vars"&&m(w)){for(const h of Object.keys(w))h&&u.add(zt(h));continue}u.add(p)}}const l=()=>{let p;const A=t[a];if(A===void 0){const b=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(b||x!==void 0)p=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{p=typeof S=="function"?S.call(t,t):S}catch(k){p=!1,o.__conditionalError=k,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,k?.message||k)}}}else if(typeof A=="function")try{p=A(t,t.state,t.context)}catch(b){p=!1,o.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else p=A;const w=i?!p:!!p;if(!t.node)return;const h=t.context?.designSystem;if(w===f.lastMatch){if(w&&d&&t.node.setAttribute){h&&W(h);try{Ts(t,s,e,d,f,!1)}finally{h&&z()}}return}f.lastMatch=w,h&&W(h);try{if(w){const b={},x={};let S=!1;for(const C in r){if(!Object.prototype.hasOwnProperty.call(r,C))continue;const L=r[C],tt=C.charAt(0);if((tt===":"||tt==="@"||tt==="&"||tt==="[")&&L&&typeof L=="object"&&!Array.isArray(L)){if(bo(C,t)){const P=ht(L,t,!1,u);Object.keys(P).length&&(x[`[data-theme="${C.slice(1)}"] &`]=P,S=!0)}else{const P=Ao(C,t),M=ht(L,t,!1,u);Object.keys(M).length&&(x[P]=M,S=!0)}continue}const ot=typeof L=="function"?L(t,t.state,t.context):L;if(ot!=null){if($[C]){const P=$[C](ot,t,t.state,t.context);if(P){const M=Array.isArray(P)?P:[P];for(const yt of M)yt&&Object.assign(b,yt)}}else if(H&&H.has(C))b[C]=ot;else if(Dt(C))b[C]=ot;else if(C==="vars"){const P=Yt(ot,t);P&&Object.assign(b,P)}}}const k=Object.keys(b);if(k.length){J(t.node,b);for(const C of k)n.set(C,e);f.appliedKeys=k}else f.appliedKeys=null;if(S){const C=At(x,null,t.context?.cssPrefix,{state:!0}),L=C?C.split(" ").filter(Boolean):[];if(L.length&&t.node.classList){for(const tt of L)t.node.classList.add(tt);f.appliedClasses=L}else f.appliedClasses=null}else if(f.appliedClasses){for(const C of f.appliedClasses)t.node.classList.remove(C);f.appliedClasses=null}d&&t.node.setAttribute&&Ts(t,s,e,d,f,!0)}else{if(f.appliedAttrs&&_e(t,s,e,f),f.appliedKeys){for(const b of f.appliedKeys)n.get(b)===e&&(Dt(b)?t.node.style.removeProperty(b):t.node.style[b]="",n.delete(b));f.appliedKeys=null}if(f.appliedClasses){for(const b of f.appliedClasses)t.node.classList.remove(b);f.appliedClasses=null}}}finally{h&&z()}};o.__conditionalRunners.push(l);const _=T(t,t[a+"Deps"],l),g=j(_,{depth:o.path.length,label:v(o,"conditional("+e+")")}),y=o.__exec&&o.__exec[a]||t[a];g._sources.size===0&&typeof y=="function"&&st()&&In(y)&&console.warn(`[smbls] conditional \`${e}\` 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 \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(g)}}const wo=new WeakSet,So=new WeakMap;function be(t){const o=So.get(t);if(o==="painted")return!1;if(o===void 0){So.set(t,"open");const s=t.defaultView,n=()=>{So.set(t,"painted")};s&&typeof s.requestAnimationFrame=="function"?s.requestAnimationFrame(n):setTimeout(n,0)}return!0}function Ae(t){const o=t.ownerDocument;!o||wo.has(o)||be(o)||(wo.add(o),queueMicrotask(()=>{wo.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const Co=new WeakSet;let Rs=!1;function Ms(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function ko(t,o){const s={...t};for(const n in o){const e=o[n],c=s[n];s[n]=e&&typeof e=="object"&&c&&typeof c=="object"?ko(c,e):e}return s}function Ns(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const c=Ns(e,o);Object.keys(c).length&&(s[n]=c)}else o.has(n)||(s[n]=e)}return s}function xe(t,o,s){let n=1/0,e=-1/0;for(const a of o.values())a<n&&(n=a),a>e&&(e=a);if(s)for(const a of s.values())a>e&&(e=a);if(e<=n)return null;let c=null;for(const[a,r]of o){if(r===e)continue;const i=we(a);if(i)for(let f=0;f<i.length;f+=3){const d=i[f],u=i[f+1],l=i[f+2],_=t[u]!=null?o.get(u):void 0,g=s&&s.get(d),y=_!==void 0&&_>r&&Io(d,t[u],l),p=!y&&g!==void 0&&g>r&&Io(d,void 0,l);if(y||p){y&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const Fs=new Map;function we(t){let o=Fs.get(t);if(o!==void 0)return o;const s=q(t),n=Bt[s];if(o=null,Array.isArray(n)){o=[];for(const e of n)o.push(e,Ho(e),s)}return Fs.set(t,o),o}function $s(t){const{node:o}=t;if(!o)return;if(Rs||(Rs=!0,At({display:"none"})),Co.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Co.add(t);const s=t.context?.designSystem;s&&W(s),No();try{const n={};let e=!1,c=[],a=null,r=null,i=null;const f=t.__ref&&t.__ref.__mergeLayer;let d,u=null,l=null;const _=(h,b)=>{if(b&&typeof b=="object"&&Ms(h)){r||(r={});const x=r[h];x&&(b=ko(x,b)),r[h]=b}else(b===null||typeof b!="object")&&(i||(i=new Set),i.add(h),d!==void 0&&(u||(u=new Map),u.set(h,d)));n[h]=b};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&$.theme){const h=$.theme(t.theme,t,t.state,t.context);if(h){const b=x=>{for(const S in x){const k=x[S];k&&typeof k=="object"&&Ms(S)&&(a||(a={}),a[S]=k),n[S]=k}};if(Array.isArray(h))for(const x of h)x&&b(x);else b(h);e=!0}}const g=(h,b)=>{if(h==="vars"){const x=Yt(b);if(x){for(const S in x)_(S,x[S]);e=!0}return}if($[h]){const x=$[h](b,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const k in S)_(k,S[k])}else for(const S in x)_(S,x[S]);e=!0}}else if(H&&H.has(h))b!=null&&typeof b!="object"&&(_(h,b),e=!0);else if(h.charCodeAt(0)===45)b!=null&&typeof b!="object"&&(_(h,b),e=!0);else if((h.charAt(0)==="&"||h.charAt(0)==="@"||h.charAt(0)===":"||h.charAt(0)==="[")&&b&&typeof b=="object"&&!Array.isArray(b)){if(xo(b))return;const x=Os(h,b,t);x&&(_(x.cssProp,x.block),e=!0)}};if(typeof t.class=="string"){const h=de(t.class,t.context?.designSystem?.class);if(h)for(const b in h)g(b,h[b])}const y=i?new Set(i):null,p=t.tag||"div";for(const h of Object.keys(t)){if(typeof t[h]=="function"){const x=f&&f.get(h);x!==void 0&&nt(p,h)&&(l||(l=new Map),l.set(q(h),x));continue}if(d=f?f.get(h):void 0,h==="vars"){g(h,t[h]);continue}if(B.has(h)||h==="theme")continue;const b=h.charCodeAt(0);b>=65&&b<=90||Y(h)||Uo(p,h)||g(h,t[h])}d=void 0;const A=u?xe(n,u,l):null;if(a)for(const h in a){let b=i?Ns(a[h],i):a[h];r&&r[h]&&(b=ko(b,r[h])),Object.keys(b).length?n[h]=b:delete n[h]}if(ee(t,n,i,A?new Set([...y||[],...A]):y),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const h=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof h=="string"&&h!==""&&n.display&&n.display!==h&&(n.display=h);const b=At(n,null,t.context?.cssPrefix);if(c=b?b.split(" ").filter(Boolean):[],b&&o.classList){const x=c;let S=!1;for(const k of x)o.classList.add(k),S||(k.charCodeAt(0)===95&&k.charCodeAt(1)===99||k.charCodeAt(0)===95&&k.indexOf("_c",1)!==-1)&&(S=!0);S&&Ae(o)}}const w=t.__ref;if(w){const h=w.__staticCssClasses;if(h&&o.classList){const b=new Set(c);for(const x of h)b.has(x)||o.classList.remove(x)}w.__staticCssClasses=c}re(t)}finally{Fo(),s&&z(),Co.delete(t)}}const ur=t=>!!$[t]||!!(H&&H.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function dr(t){t&&t.node&&$s(t)}function Se(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const c=t.aria[e];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());o.setAttribute(a,Q(a,c))}const s=gn(t);for(const e in s){const c=s[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(e,c===!0?"":c)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||B.has(e)||e==="on"||s[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(e)&&!nt(n,e)&&xt(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!no[e])continue;a=F.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!It(wt(e)||e))continue;const r=wt(e)||e;o.setAttribute(r,Q(r,a))}}}function lr(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||Y(o))return;const e=t.tag||"div";if(nt(e,o)||!xt(e,o))return;const c=wt(o)||o,a=c.toLowerCase(),r=t.__ref&&t.__ref.__effects;let i=!1;if(r)for(let u=0;u<r.length;u++){const l=r[u];l&&l._attrName===a&&!l._disposed&&typeof l._execute=="function"&&(i=!0,l._execute())}if(i)return;let f=t[o];const d=no[o];if(d&&f!=null){const u=d(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=F.call(t,f,t.state)),Kt(s,c,f)}function Ce(t,o){const s=t.node,n=t.__ref;let e=n.__autoGrow;if(!o){if(e&&e.active){try{s.removeEventListener("input",e.resize)}catch{}Bs(e),et.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),Vs(s,e,!1),e.active=!1,e.appliedMax=null,e.lastMeasure=0}return}e||(e=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Lt(t,!0);return}if(!(s.scrollHeight>0)){e.awaitingLayout=!0,Is(t,e);return}e.awaitingLayout=!1;const a=je(s),r=Ee(a),i=s.style.height;s.style.height="0px",r&&jo(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=i,r&&jo(s);return}const d=Pe(s,a),u=d!=null&&f<d?d:f,l=De(a),_=l!=null&&u>l;s.style.height=Te(_?l:u,a)+"px",r&&jo(s),Vs(s,e,_),e.lastMeasure=f,e.lastWidth=s.clientWidth,Is(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}Bs(e),et.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,ve(t,e));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=c,e.appliedMax=c),e.resize()}function Lt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),et.add(t),Ht())}function ke(){const t=Array.from(et);et.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,e=s.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=ut()),e.attachAttempts+=1,e.attachAttempts<=Wo&&ut()-e.firstAttemptAt<zo&&(et.add(s),Ht());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function Is(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const c=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Lt(t,!0);return}const r=s.clientWidth;o.lastWidth!=null&&Math.abs(r-o.lastWidth)<.5||(o.lastWidth=r,Lt(t,!0))};let a;try{a=new e(c),a.observe(s)}catch{return}o.watch=a}function Bs(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function ve(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,n=s&&s.fonts&&s.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{o.active&&t.node&&Lt(t,!0)},()=>{})}function je(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const rt=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,vo=t=>(rt(t.paddingTop)||0)+(rt(t.paddingBottom)||0),Hs=t=>(rt(t.borderTopWidth)||0)+(rt(t.borderBottomWidth)||0);function Ee(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let n=0;n<o.length;n++){const e=o[n].trim();if(!(e!=="all"&&e!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function jo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const n=o[s];if(n&&n.transitionProperty==="height")try{n.cancel()}catch{}}}function Pe(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const n=rt(o.lineHeight)||Oe(t,o);return n>0?s*n+vo(o):null}const Rt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],Us=new WeakMap;function Oe(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let e=Us.get(s);e||(e=new Map,Us.set(s,e));const c=Rt.map(f=>o[f]||"").join("|");if(e.has(c))return e.get(c);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const r=a.style;r.position="absolute",r.visibility="hidden",r.top="0",r.left="-9999px",r.height="auto",r.minHeight="0",r.maxHeight="none",r.padding="0",r.border="0",r.boxSizing="content-box",r.overflow="hidden";for(let f=0;f<Rt.length;f++)o[Rt[f]]&&(r[Rt[f]]=o[Rt[f]]);let i=0;try{n.appendChild(a),i=a.clientHeight}catch{i=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return i>0?(e.set(c,i),i):null}function Te(t,o){return o?o.boxSizing==="border-box"?t+Hs(o):o.boxSizing==="content-box"?Math.max(0,t-vo(o)):t:t}function De(t){if(!t)return null;const o=rt(t.maxHeight);if(o==null||!(o>0))return null;const s=vo(t),n=Hs(t),e=t.boxSizing==="border-box"?o-n:o+s,c=rt(t.lineHeight);if(!(c>0))return e;const a=Math.floor((e-s)/c+1e-6);return a>=1?a*c+s:e}function Vs(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const Gs=["srcObject","muted"],Le=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function Re(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Gs.length;n++){const e=Gs[n],c=t[e];if(c===void 0||!(e in o))continue;const a=r=>{const i=Le(e,r);if(o[e]!==i)try{o[e]=i}catch(f){R(s,e,f)}};if(typeof c=="function"){const r=T(t,t[e+"Deps"],c),i=j(()=>{try{a(r(t,t.state,t.context))}catch(f){R(s,e,f)}},{depth:s.path.length,label:v(s,e)});s.__effects.push(i),s.__exec[e]=c}else a(c);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Me(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,e=typeof n=="function"?T(t,t.autoGrowDeps,n):null,c=j(()=>{const a=t.autoGrow;let r=a;if(typeof a=="function")try{r=(a===n&&e?e:a)(t,t.state,t.context)}catch{r=null}Ce(t,r)},{depth:s.path.length,label:v(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(c),e&&(s.__exec.autoGrow=n)}const Ks=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ws(t,o){for(const s of Object.keys(t)){if(!Y(s)||Ks.has(s))continue;const n=rn(s);if(n){en(n,t,t[s]);continue}let e=t[s],c=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(c=e,e=c.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const r=e;e=function(f){return t.call(r,f)}}if(typeof e!="function")continue;const a=jn(s);sn.has(a)||nn(En(a),t,e,c)}Ne(t)}function Ne(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const l of Ks){const _=t[l];typeof _=="function"&&(s[l]=_,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,r=0,i=0,f=!1;const d=l=>{const _=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];_&&(a=_.clientX,r=_.clientY,i=Date.now(),f=!0)},u=l=>{if(!f)return;f=!1;const _=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!_)return;const g=_.clientX-a,y=_.clientY-r,p=Date.now()-i;if(p>c)return;const A=Math.abs(g),w=Math.abs(y);if(Math.max(A,w)<e)return;let h;if(A>w*1.2)h=g<0?"left":"right";else if(w>A*1.2)h=y<0?"up":"down";else return;const b="onSwipe"+h.charAt(0).toUpperCase()+h.slice(1),x=s[b],S=s.onSwipe;x&&x.call(t,l,t,t.state,t.context),S&&S.call(t,{direction:h,dx:g,dy:y,dt:p,event:l},t,t.state,t.context)};o.addEventListener("touchstart",d,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",d)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function it(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=it(e,c):s[n]=c}return s}function Eo(t,o,s,n,e){if(!o||!t.node)return;const c=t.childExtends,a=lt(t,"childProps");if(Array.isArray(o)){const r=t.tag==="fragment",i=t.context?.document||globalThis.document,f=r?null:i?.createDocumentFragment();if(!r&&!f)return;const d=t.childProps,u=t.childrenAs,l=w=>{let h=o[w];const b=h;(typeof h=="string"||typeof h=="number")&&(h={text:h});let x=d;if(typeof d=="function")try{x=d(t,h)}catch{x=null}let S=typeof d=="function"?jt(x):a;if(e&&u!=="state"&&(S=Et(S,jt(b))),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=it(x,h));if(c&&!h.ignoreChildExtends)if(h.extends){const C=Array.isArray(h.extends)?h.extends:[h.extends],L=Array.isArray(c)?c:[c];h={...h,extends:[...L,...C]}}else h={...h,extends:c};const k=qo(h?.key,b,w,t);try{return X(Pt(h,S),t,k,s)}catch(C){if(typeof console<"u"&&console.error){const L=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${L} (initial render, skipping this row):`,C?.message||C)}return null}},_=t.__ref;if(!(n===!0&&!r&&!!_&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const h=l(w);!r&&h?.node&&f.appendChild(h.node)}return r||t.node.appendChild(f),!0}const y=_.__childrenChunkGen=(_.__childrenChunkGen||0)+1;Lo();let p=null;const A=w=>{if(_.__disposed||_.__childrenChunkGen!==y){p&&p.parentNode&&p.remove();return}for(let h=w;h<o.length;h++){const b=l(h);if(b?.node&&(p?t.node.insertBefore(b.node,p):f.appendChild(b.node)),h+1<o.length&&Do()){p||(p=i.createComment("smbls-mount"),f.appendChild(p),t.node.appendChild(f));const x=h+1;Mo(()=>A(x));return}}p?(p.remove(),t.node.tagName==="SELECT"&&Zt(t,!0)):t.node.appendChild(f)};return A(0),Ro(),!0}if(typeof o=="string"){const r=ts(o,t);if(Array.isArray(r))return Eo(t,r,s,n,!0)}if(typeof o=="object")for(const r in o){if(B.has(r))continue;let i=o[r];if(i==null||i===!1)continue;const f=e?Et(a,jt(i)):a;if((typeof i=="string"||typeof i=="number")&&(i={text:i}),t.childProps&&(i=it(t.childProps,i)),c&&!i.ignoreChildExtends)if(i.extends){const d=Array.isArray(i.extends)?i.extends:[i.extends],u=Array.isArray(c)?c:[c];i={...i,extends:[...u,...d]}}else i={...i,extends:c};X(Pt(i,f),t,Vt(t,r),s)}}function Zt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const e=t.__ref,c=e&&e.__exec&&e.__exec.value,a=typeof c=="function",r=t.value!=null&&typeof t.value!="function";if(a||r){let d;if(a)try{d=c(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=F.call(t,d,t.state));const u=d==null?"":String(d);s.value!==u&&(s.value=u);return}const i=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!i)return;let f=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(f=d);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function zs(t,o){let{children:s,content:n}=t;const e=t.childExtends,c=typeof s=="function"||fs(t,"children");if(typeof s=="function"){const g=s;try{s=g(t,t.state,t.context)}catch(h){if(s=void 0,typeof console<"u"&&console.error){const b=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${b} (initial run, treating as empty):`,h?.message||h)}}as(t,s),t.children=s;const y=t.__ref;let p=!1;const A=T(t,t.childrenDeps,g),w=j(()=>{const h=p;p=!0;let b;try{b=A(t,t.state,t.context)}catch(P){if(typeof console<"u"&&console.error){const M=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${M}${h?"":" (initial tracking run)"}:`,P?.message||P)}return}if(!h||b===t.children)return;as(t,b),t.children=b,y.__childrenChunkGen!=null&&y.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,k=x?[]:null,C=x?[]:null;if(Array.isArray(b)&&t.childrenAs==="state"){const P=t.childProps,M=[],yt=new Map;for(let E=0;E<b.length;E++){const U=b[E];let O=P;if(typeof P=="function")try{O=P(t,U)}catch{O=null}const K=qo(O&&O.key,U,E,t);M.push(K),yt.set(K,{rawChild:U,childProps:O})}const qs=new Set(M),Zs=y.__children.slice();for(const E of Zs)if(!qs.has(E)){const U=t[E];U?.remove&&U.remove(),delete t[E],k&&k.push(E)}const _t=t.childExtends,Mt=t.tag==="fragment",Qs=t.context?.document||globalThis.document,gt=Mt?null:Qs?.createDocumentFragment(),Xt=new Set;for(const E of M){const U=yt.get(E),O=U.rawChild,K=t[E];if(K&&K.state){if(O&&typeof O=="object"){const N=K.state,ct=N.$replace||N.replace,Oo=N.$update||N.update;try{if(typeof ct=="function")ct.call(N,O);else if(typeof Oo=="function"){for(const I in N)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(O,I))try{N[I]=void 0}catch{}Oo.call(N,O)}else for(const I in O)N[I]=O[I]}catch(I){if(typeof console<"u"&&console.error){const Js=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to patch at ${Js} (reconcile, keeping its previous data for this pass):`,I?.message||I)}}}C&&C.push(E);continue}let Jt=O;(typeof O=="string"||typeof O=="number")&&(Jt={value:O,text:O});const mt=U.childProps;let V=mt?{...mt,state:Jt}:{state:Jt};const Xs=typeof P=="function"?jt(mt):lt(t,"childProps");if(_t&&!V.ignoreChildExtends)if(V.extends){const N=Array.isArray(V.extends)?V.extends:[V.extends],ct=Array.isArray(_t)?_t:[_t];V={...V,extends:[...ct,...N]}}else V={...V,extends:_t};let to;try{to=X(Pt(V,Xs),t,E,o)}catch(N){if(typeof console<"u"&&console.error){const ct=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to construct at ${ct} (reconcile, skipping this row):`,N?.message||N)}Xt.add(E);continue}!Mt&&to?.node&>&>.appendChild(to.node),S&&S.push(E)}if(!Mt&>&>.childNodes.length&&t.node&&t.node.appendChild(gt),!Mt&&t.node){let E=null;for(const U of M){const O=t[U]?.node;if(!O)continue;const K=E?E.nextSibling:t.node.firstChild;O!==K&&t.node.insertBefore(O,K),E=O}}y.__children=Xt.size?M.filter(E=>!Xt.has(E)):M,x&&(S.length||k.length)&&Yo(t,{added:S,removed:k,kept:C}),Zt(t,!1);return}const ot=x?[...y.__children]:null;for(const P of[...y.__children]){const M=t[P];M?.remove&&M.remove(),delete t[P]}y.__children=[],Eo(t,b,o,!1,!0),Zt(t,!1),x&&Yo(t,{added:[...y.__children],removed:ot,kept:[]})},{depth:y.path.length,label:v(y,"children")});y.__effects.push(w)}const a=Eo(t,s,o,!0,c);if(n!=null&&!(n&&n.__ref)){let g=n;if(typeof g=="string"||typeof g=="number"?g={text:g}:typeof g!="object"&&(g={}),t.childProps&&(g=it(t.childProps,g)),e&&!g.ignoreChildExtends)if(g.extends){const p=Array.isArray(g.extends)?g.extends:[g.extends],A=Array.isArray(e)?e:[e];g={...g,extends:[...A,...p]}}else g={...g,extends:e};const y=Et(lt(t,"childProps"),lt(t,"content"));X(Pt(g,y),t,"content",o)}if(s&&!a)return;const r=t.context?.components||{},i=t.__ref&&t.__ref.__runtimeSource,f=i?{}:null;{const g=Object.keys(t);for(let y=0;y<g.length;y++){const p=g[y];if(!p.endsWith("Extends")||typeof t[p]!="string")continue;const A=p.slice(0,-7);if(!A||A.charCodeAt(0)<65||A.charCodeAt(0)>90)continue;const w={extends:t[p]};delete t[p];for(let h=y+1;h<g.length;h++){const b=g[h],x=b.charCodeAt(0);if(x>=65&&x<=90||B.has(b)||typeof t[b]=="function"&&(b.startsWith("on")||b.startsWith(".")))break;const S=t[b];S!==void 0&&(w[b]=S,delete t[b],f&&vt(i,b)&&(f[A]||(f[A]={}),f[A][b]=i[b]))}t[A]&&typeof t[A]=="object"?t[A]={...w,...t[A]}:t[A]=w}}const d=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),l=g=>{if(B.has(g)||typeof t[g]!="object"||t[g]===null)return;const y=g.charCodeAt(0);if(y<65||y>90)return;let p=t[g];if(p.__ref)return;if(!p.extends&&!p.extend){const w=r[g]||r[`smbls.${g}`];w&&(p={...p,extends:w})}if(t.childProps&&(p=it(t.childProps,p)),e&&!p.ignoreChildExtends)if(p.extends){const w=Array.isArray(p.extends)?p.extends:[p.extends],h=Array.isArray(e)?e:[e];p={...p,extends:[...h,...w]}}else p={...p,extends:e};const A=i?Et(lt(t,"childProps"),Et(f[g]||null,lt(t,g))):null;X(Pt(p,A),t,g,o)};if(!d){for(const g of u)l(g);return}Lo();const _=g=>{for(let y=g;y<u.length;y++)if(l(u[y]),y+1<u.length&&Do()){const p=y+1;Mo(()=>_(p));return}};_(0),Ro()}function Ys(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const e=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const r=s.node.nextSibling;a.insertBefore(n,r||e)}else a.insertBefore(n,e);return}}const c=o?.node||(o?.nodeType?o:null);if(c)if(s?.position==="before"&&s.node)c.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?c.insertBefore(n,a):c.appendChild(n)}else c.appendChild(n)}const Po=3;function Fe(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Po?!1:(t.__inBeforeUpdate=!0,!0)}function Qt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Po&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Po}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function D(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);bt(n,o,s);const e="on"+t,c=o[e];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(o.__ref[i])return!0;o.__ref[i]=!0}const f=o.context?.designSystem;f&&W(f);let d=!!i;try{const u=c(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const l=o.__ref;return u.catch(_=>{$t(o,e,_)}).finally(()=>{i&&l&&(l[i]=!1)}),d=!1,!0}if(u===!1)return!1}catch(u){if($t(o,e,u),o.context?.strictMode)throw u}finally{f&&z(),d&&o.__ref&&(o.__ref[i]=!1)}}return!0}var pr=X;export{Po as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Fe as acquireBeforeUpdateGuard,X as create,pr as default,ro as flushMounts,ur as isStaticCssProp,dr as recompileStaticCss,lr as reconcileAttrProp,Qt as releaseBeforeUpdateGuard,qt as resolveStyleBlock,Kt as writeAttr,Gt as writeElementText};
|
|
4
|
+
`):"")}}if(Zt(r,!0),Zs(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML&&X(r,()=>{try{const u=r.html(r,r.state,r.context);u!=null&&typeof u!="function"&&(r.node.innerHTML=u)}catch{}}),D("Create",r,n),D("Complete",r,n),D("Render",r,n),D("RenderRouter",r,n),io(r,n),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,g=()=>{if(r.node){if(r.node.isConnected){l&&Y(l);try{u(r,r.state,r.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{l&&q()}}requestAnimationFrame(g)}};requestAnimationFrame(g)}return r}const Jo=new Set(["childProps","attr","style","scope","data","vars"]);function mo(t,o,s,n,e,c){if(s&&!o.extends&&!o.extend){const p=s.indexOf("_"),h=s.indexOf(".");let _=p>0?p:-1;if(h>0&&(_<0||h<_)&&(_=h),_>0){const w=s.substring(0,_),y=t.context?.components;y&&(y[w]||y["smbls."+w])?o={...o,extends:w}:y&&st()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${w}" but neither "${w}" nor "smbls.${w}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),un(t,o,c);const a=dn(t),r=t.props&&typeof t.props=="object"?t.props:null;for(const p in o){if(p==="parent"||p==="node"||p==="__ref"||p==="extends"||p==="context"||p==="props")continue;if(p==="key"){n&&(t.key=e?Vt(e,n):n);continue}const h=o[p];a&&a.mark(p);const _=t[p],w=_&&h&&typeof _=="object"&&typeof h=="object"&&!Array.isArray(_)&&!Array.isArray(h)&&typeof _!="function"&&typeof h!="function";w&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?t[p]=kt(_,h):w&&Jo.has(p)?t[p]={..._,...h}:w&&co(p)?t[p]=kt(_,h):t[p]=h}function i(p){for(const h in p){const _=p[h],w=t[h],y=w&&_&&typeof w=="object"&&typeof _=="object"&&!Array.isArray(w)&&!Array.isArray(_)&&typeof w!="function"&&typeof _!="function";y&&h.charCodeAt(0)>=65&&h.charCodeAt(0)<=90?t[h]=kt(w,_):y&&Jo.has(h)?t[h]={...w,..._}:y&&co(h)?t[h]=kt(w,_):t[h]=_}}if(r&&i(r),o.props&&typeof o.props=="object"&&(i(o.props),a))for(const p in o.props)a.mark(p);ln(t),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const f=t.scope&&typeof t.scope=="object"?t.scope:null,d=e?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,l=d||u||null;if(o.scope!==void 0||f){const p={};f&&Object.assign(p,f),o.scope!==void 0&&Object.assign(p,o.scope),t.scope=on(p,l)}else l&&(t.scope=l);o.if!==void 0&&(t.if=o.if);const g=t.__ref,x=Xn(t,g&&g.__runtimeSource);return g&&(g.__declaredArrays=x||void 0),pn(t),Nn(t,e,o,c),o}const Ln=new Set(["key","parent","context","__ref"]);function Rn(t,o){for(const n of Object.keys(t))Ln.has(n)||delete t[n];let s=o.definition;if(!s.extends&&!s.extend&&typeof o.key=="string"){const n=t.context?.components||{},e=n[o.key]||n["smbls."+o.key];e&&(s={...s,extends:e})}Nt(()=>mo(t,s,o.key,o.ownKey,t.parent,o.options))}function Mn(t,o,s){const n=s||{},e=r=>!!(n[r]||n["smbls."+r]),c=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const r of a){if(typeof r!="string")continue;const i=r.includes(">")?r.split(">")[0].trim():r;e(i)||c.push(i)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let r=-1;const i=o.indexOf("_"),f=o.indexOf(".");i>0&&(r=i),f>0&&(r<0||f<r)&&(r=f);const d=r>0?o.substring(0,r):o;e(d)||c.push(d)}return c}function fo(t,o,s){if(typeof t.onStateInit!="function"&&!gn(t,"stateInit"))return;const n=t.state;t.state=o;try{D("StateInit",t,s)}finally{t.state=n}}const ao=t=>({isDataOnlyKey:o=>_n(t).has(o)});function Nn(t,o,s,n){const e=!o,c=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&c&&t.context?.state,r=s.state!==void 0&&!a?s.state:t.state&&!W(t.state)?t.state:void 0;if(r==null){if(o?.state)t.state=o.state,at(t,t.state);else if(t.context?.state){const i=t.context.state,f={...i},d=t.context?.polyglot;if(d?.translations){const u=t.context,l=i.lang||d.defaultLang||"en",g=new Set,x=(_,w)=>{g.has(_)||hn(u,_,f)&&(f[_]=w,g.add(_),yn(u,_,w))},p=d.translations[l];if(p&&typeof p=="object")for(const _ in p)x(_,p[_]);const h=new Set(d.languages||[]);for(const _ in d.translations)h.has(_)||x(_,d.translations[_])}W(f)||fo(t,f,n),t.state=W(f)?f:oo(f,ao(t.context)),t.state.__element=t,t.state.root=t.state,at(t,t.state),Ft.promoteActiveRootState?.(i,t.state),D("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),at(t,t.state);return}if(typeof r=="string"){if(t.state=ss(r,o),t.state&&typeof t.state=="object"&&!W(t.state)){const i=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}at(t,t.state),$n(t,r,o),D("StateCreated",t,n);return}if(typeof r=="function"){const i=r(t,o?.state);if(W(i))t.state=i;else{const f=i||{};fo(t,f,n),t.state=oo(f,o?.state?void 0:ao(t.context))}}else if(W(r))t.state=r;else{const i={...r};fo(t,i,n),t.state=oo(i,o?.state?void 0:ao(t.context))}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,at(t,t.state),Ft.promoteActiveRootState?.(r,t.state),D("StateCreated",t,n)}function ts(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const e of s){if(n==null)return{};n=n[e]}return n??{}}function os(t,o){const s=o.state;return t.startsWith("~/")?[s&&(s.root||s),t.slice(2)]:t.startsWith("../")?[s,t.slice(3)]:[s,t]}function ss(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[e,c]=os(t,o);return c?ts(e,c):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=ts(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const e=o.state?.root?.lang||n.defaultLang||"en",c=n.translations[e];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function Fn(t,o){const[s,n]=os(t,o);if(!n||!s||typeof s!="object")return;const e=s[n];if(e!==void 0||n.indexOf("/")===-1)return e;let c=s;for(const a of n.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function $n(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!W(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const e=Nt(()=>j(()=>{const c=Fn(o,s);!c||typeof c!="object"||c===t.state||Nt(()=>ns(t,t.state,c,!0))},{depth:n.path?n.path.length:0,label:v(n,"state")}));e._isStateBinding=!0,n.__stateBinding=e,n.__effects&&n.__effects.push(e)}function ns(t,o,s,n){const e=t.__ref;if(!e)return;if(n||t.state===o){t.state=s,n&&at(t,s),es(e);const a=e.__children;if(a)for(let r=0;r<a.length;r++){const i=t[a[r]];i&&i.__ref&&i.parent===t&&ns(i,o,s,!1)}return}if(e.__stateBinding){e.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=s,es(e))}function es(t){const o=t.__effects;if(o)for(let s=0;s<o.length;s++){const n=o[s];n&&!n._disposed&&!n._isStateBinding&&!n._isSubscribeToEffect&&typeof n._notify=="function"&&n._notify()}}const In=new Set(["s","state","ctx","context"]),uo=new WeakMap;function rs(t){if(uo.has(t))return uo.get(t);let o=null;try{const s=typeof Ft.getFunctionSource=="function"?Ft.getFunctionSource(t):Function.prototype.toString.call(t);if(typeof s=="string"){const n=s.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||s.match(/^[^(]*\(([^)]*)\)/);n&&(o={params:n[1].split(",").map(e=>e.trim()),body:s.slice(n.index+n[0].length)})}}catch{}return uo.set(t,o),o}function Bn(t){const o=rs(t);return o?o.params.map(s=>s.split("=")[0].trim()).filter(Boolean):[]}const is=new WeakMap;function Hn(t){let o=is.get(t);return o===void 0&&(o=Un(rs(t)),is.set(t,o)),o}function Un(t){if(!t)return!0;const o=t.body;if(/\bstate\b|\barguments\b|\bcall\s*\(/.test(o))return!0;const s=t.params[1];if(!s)return!1;if(!/^[A-Za-z_$][\w$]*$/.test(s.split("=")[0].trim()))return!0;const n=s.split("=")[0].trim();return new RegExp("(^|[^\\w$.])"+n.replace(/\$/g,"\\$")+"(?![\\w$])").test(o)}const Vn=3,Gn=/^(is|has)[A-Z0-9_$]/,Kn=new Set(["routerOptions"]),cs=new WeakSet;function Wn(t,o){if(typeof t!="function"||t.length!==2||o&&(Gn.test(o)||Kn.has(o))||cs.has(t))return!1;const s=Bn(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<Vn||In.has(n)?!1:(cs.add(t),!0)}function zn(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const r=c[a];if(typeof t[r]!="function"||H.has(r))continue;const i=r.charCodeAt(0);i>=65&&i<=90||Z(r)||I[r]||U&&U.has(r)||i!==45&&(xt(s,r)||(st()&&Wn(t[r],r)&&console.warn(`[smbls] custom prop "${r}"${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('${r}', \u2026) instead of reading el.${r}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:r,fn:t[r]})))}for(let a=0;a<e.length;a++){const{prop:r,fn:i}=e[a];o.__exec[r]=i,Object.defineProperty(t,r,{get(){n&&Y(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&q()}},set(f){delete o.__exec[r],Object.defineProperty(t,r,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Yn(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const n=o[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function T(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return Yn(t,o),s.apply(this,n)}}function lt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function v(t,o){return()=>t.path.join(".")+"::"+o}const fs=new Set;function L(t,o,s){if(!st())return;const n=v(t,o)();fs.has(n)||(fs.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const as=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,qn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;as.lastIndex=0;let n;for(;(n=as.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Zn=(t,o)=>!Z(t)&&!nt(o,t),lo=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Zn(t,n)&&qn(o,s)},po=new WeakMap,vt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),jt=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?it(t,o):t},Et=(t,o)=>t&&o?it(t,o):t||o||null,us=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&vt(s,o)},pt=(t,o)=>us(t,o)?jt(t.__ref.__runtimeSource[o]):null,Pt=(t,o)=>(o&&t&&typeof t=="object"&&po.set(t,o),t),Qn=t=>{if(!t||typeof t!="object")return;const o=po.get(t);return o&&po.delete(t),o},ho=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let n=0;n<t.length;n++)ho(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const e=Object.getOwnPropertyDescriptor(t,n);e&&"value"in e&&ho(e.value,o,s)}}},Xn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(H.has(n)||o&&vt(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),c=e&&e.value;if(!Array.isArray(c))continue;const a=new Set;ho(c,a,new Set),a.size&&(s||(s=new Map),s.set(c,a))}return s},ds=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,e=n&&n.get(o);if(!e)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of e)c.__authoredTemplates.add(a);return}},ls=["attr","aria","data","metadata"],Jn=t=>{if(ls.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},mn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,e),a=c&&c.value,r=!!o&&vt(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!Jn(e))continue;const i=r?o[e]:null,f=i&&typeof i=="object"?i:null,d=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const l=r&&(!f||vt(f,u)),g=a[u];if(d&&g&&typeof g=="object"&&!Array.isArray(g)&&ls.includes(u)){for(const x in g)lo(x,g[x],s,n,l);continue}lo(u,g,s,n,l)}continue}lo(e,a,s,n,r)}return s};function ps(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=mn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const i of e)s.__authoredTemplates.add(i);else s.__authoredTemplates=e;if(zn(t),typeof t.text=="function"){const i=t.text,f=T(t,t.textDeps,i),d=j(()=>{if(!s.contentManaged)try{let u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=$.call(t,u,t.state)),Gt(t,u))}catch(u){L(s,"text",u)}},{depth:s.path.length,label:v(s,"text")});s.__effects.push(d),s.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,f=j(()=>{if(s.contentManaged)return;const d=$.call(t,i,t.state);d!=null&&(t.text=d),t.node&&Gt(t,d??"")},{depth:s.path.length,label:v(s,"text")});s.__effects.push(f),s.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!H.has(i)&&!Z(i)&&!s.__exec[i]&&!Go(c,i)){if(I[i]){const f=t[i],d=T(t,t[i+"Deps"],f),u=i;let l,g=null,x=null,p;const h=j(()=>{const _=t.context?.designSystem;_&&Y(_);try{const w=d(t,t.state,t.context);$o();let y;try{y=I[u](w,t,t.state,t.context)}finally{Io()}if(Array.isArray(y)){const A={};for(const S of y)if(S)for(const C in S)A[C]=S[C];y=A}const b=u==="show"||u==="hide";if(y&&t.node&&se(y)){const A=ht(y);if(A===null||A!==p){p=A;const S=At(y,null,t.context?.cssPrefix),C=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(x)for(const k of x)t.node.classList.remove(k);if(C&&C.length)for(const k of C)t.node.classList.add(k);x=C}}l=void 0,g=null}else if(y&&t.node){if(x){for(const S of x)t.node.classList.remove(S);x=null,p=void 0}const A=ht(y);if(A===null||A!==l||!Tt(t.node,g)){l=A;const S=ks(t,y);g=Ot(t.node,S)}}else t.node&&b&&(l=void 0,g=null,t.node.style.display="")}finally{_&&q()}},{depth:s.path.length,label:v(s,u)});s.__effects.push(h),s.__exec[i]=f}else if(U&&U.has(i)){const f=t[i],d=T(t,t[i+"Deps"],f),u=i;let l,g=null;const x=j(()=>{const p=t.context?.designSystem;p&&Y(p);try{const h=d(t,t.state,t.context);if(t.node)if(h!=null){const _=u+":"+String(h);if(_!==l||!Tt(t.node,g)){l=_;const w={[u]:h},y=ks(t,w);g=Ot(t.node,y)}}else l=void 0,g=null,t.node.style[u]=""}finally{p&&q()}},{depth:s.path.length,label:v(s,u)});s.__effects.push(x),s.__exec[i]=f}else if(i.charCodeAt(0)===45){const f=t[i];ws(t,i,f,t[i+"Deps"],i),s.__exec[i]=f}}if(ne(t),typeof t.html=="function"){const i=t.html,f=T(t,t.htmlDeps,i),d=j(()=>{X(t,()=>{const u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)})},{depth:s.path.length,label:v(s,"html")});s.__effects.push(d),s.__exec.html=i}if(typeof t.value=="function"){const i=t.value,f=T(t,t.valueDeps,i),d=j(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=$.call(t,u,t.state)),gs(t,u)}catch(u){L(s,"value",u)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(d),s.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,f=j(()=>{try{gs(t,$.call(t,i,t.state))}catch(d){L(s,"value",d)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(f),s.__exec.value=i}if(typeof t.style=="function"){const i=t.style,f=T(t,t.styleDeps,i);let d,u=null,l,g,x,p;const h=j(()=>{const _=f(t,t.state,t.context),w=t.context&&t.context.designSystem;let y;if(_&&typeof _=="object"&&_===l&&w===x){const A=ht(_);y=A!==null&&A===g?p:qt(t,_),g=A}else y=qt(t,_),g=void 0;l=_,x=w,p=y;const b=ht(y);(b===null||b!==d||!Tt(t.node,u))&&(d=b,_o(t.node,u,y),tt(t.node,y),u=Ot(t.node,y))},{depth:s.path.length,label:v(s,"style")});s.__effects.push(h),s.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const f=t.style[i];if(typeof f!="function")continue;const d=T(t,lt(t.styleDeps,i),f);let u,l=null;const g=j(()=>{try{const x=d(t,t.state,t.context);if(t.node){const p=i+":"+String(x);if(p!==u||!Tt(t.node,l)){u=p;const h=qt(t,{[i]:x});_o(t.node,l,Object.assign({},h,{[i]:""})),tt(t.node,h),l=Ot(t.node,h)}}}catch(x){L(s,"style."+i,x)}},{depth:s.path.length,label:v(s,"style."+i)});s.__effects.push(g)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const f=T(t,lt(t.attrDeps,i),t.attr[i]),d=i,u=j(()=>{try{let l=f(t,t.state,t.context);typeof l=="string"&&l.includes("{{")&&(l=$.call(t,l,t.state)),t.node?.setAttribute&&Kt(t.node,d,l)}catch(l){L(s,"attr."+d,l)}},{depth:s.path.length,label:v(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const f=t.attr[i],d=i,u=j(()=>{try{const l=$.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(d,J(d,l??""))}catch(l){L(s,"attr."+d,l)}},{depth:s.path.length,label:v(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const f=t.aria[i];if(typeof f=="string"&&f.includes("{{")){const g=f,x="aria-"+i.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),p=j(()=>{try{const h=$.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(x,J(x,h??""))}catch(h){L(s,"aria."+i,h)}},{depth:s.path.length,label:v(s,"aria."+i)});p._attrName=x,s.__effects.push(p);continue}if(typeof f!="function")continue;const d=T(t,lt(t.ariaDeps,i),t.aria[i]),u="aria-"+i.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),l=j(()=>{try{const g=d(t,t.state,t.context);if(!t.node?.setAttribute)return;Kt(t.node,u,g)}catch(g){L(s,"aria."+i,g)}},{depth:s.path.length,label:v(s,"aria."+i)});l._attrName=u,s.__effects.push(l)}if(t.data&&typeof t.data=="object")for(const i in t.data){const f=t.data[i];if(typeof f=="string"&&f.includes("{{")){const x=f,p="data-"+i.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),h=j(()=>{try{const _=$.call(t,x,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(p,_??"")}catch(_){L(s,"data."+i,_)}},{depth:s.path.length,label:v(s,"data."+i)});h._attrName=p,s.__effects.push(h);continue}if(typeof f!="function")continue;const d=T(t,lt(t.dataDeps,i),t.data[i]),l="data-"+i.replace(/[A-Z]/g,x=>"-"+x.toLowerCase()),g=j(()=>{try{const x=d(t,t.state,t.context);if(!t.node?.setAttribute)return;x==null||x===!1?t.node.removeAttribute(l):typeof x!="function"&&typeof x!="object"&&t.node.setAttribute(l,x===!0?"":x)}catch(x){L(s,"data."+i,x)}},{depth:s.path.length,label:v(s,"data."+i)});g._attrName=l,s.__effects.push(g)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const i in a){if(typeof a[i]!="function")continue;const f=T(t,lt(t.classDeps,i),a[i]),d=j(()=>{try{const u=f(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(i):t.node.classList.remove(i)}catch(u){L(s,"class."+i,u)}},{depth:s.path.length,label:v(s,"class."+i)});s.__effects.push(d)}!n&&typeof t.if=="function"&&_s(t,s,t.if);for(const i of Object.keys(t)){if(H.has(i)||typeof t[i]!="function")continue;const f=i.charCodeAt(0);if(f>=65&&f<=90||Z(i))continue;const d=t[i];s.__exec[i]=d;const u=t.tag||"div";if(xt(u,i)&&!nt(u,i)){const l=wt(i)||i,g=T(t,t[i+"Deps"],d),x=j(()=>{try{let p=g(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=$.call(t,p,t.state)),t.node?.setAttribute&&Kt(t.node,l,p,!0)}catch(p){L(s,i,p)}},{depth:s.path.length,label:v(s,i)});x._attrName=l.toLowerCase(),s.__effects.push(x)}}const r=t.tag||"div";for(const i of Object.keys(t)){if(H.has(i))continue;const f=t[i];if(typeof f!="string"||!f.includes("{{"))continue;const d=i.charCodeAt(0);if(d>=65&&d<=90||Z(i)||nt(r,i)||no[i]||!xt(r,i))continue;const u=wt(i)||i,l=j(()=>{try{const g=$.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,J(u,g??""))}catch(g){L(s,i,g)}},{depth:s.path.length,label:v(s,i)});l._attrName=u.toLowerCase(),s.__effects.push(l)}if(ue(t),Ae(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,f=t.stateDeps;let d=!1,u=[];const l=j(()=>{const g=[];for(let h=0;h<f.length;h++){const _=f[h];try{g[h]=typeof _=="function"?_(t,t.state,t.context):t.state?.[_]}catch{g[h]=void 0}}if(!d){d=!0,u=g;return}let x=g.length!==u.length;for(let h=0;!x&&h<g.length;h++)g[h]!==u[h]&&(x=!0);const p=u;u=g,x&&X(t,()=>{try{i(t,t.state,t.context,{prev:p,next:g})}catch(h){if($t(t,"onStateUpdate",h),t.context?.strictMode)throw h}})},{depth:s.path.length,label:v(s,"onStateUpdate")});s.__effects.push(l)}he(t)}function hs(t){const o=t.parent,s=o?.node;if(!s||!t.node){Zs(t,t.parent);return}let n=null;const e=Object.keys(o),c=e.indexOf(t.key);for(let a=c+1;a<e.length;a++){const r=o[e[a]];if(r?.node?.parentNode===s){n=r.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function ys(t){bs(t),ke(t),Ms(t),Fe(t),Ne(t)}function _s(t,o,s){let n=T(t,t.ifDeps,s);const e=j(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const i=t.context?.components||{};c.names.some(f=>i[f]||i["smbls."+f])&&(o.__ifLateMerge=null,Rn(t,c),n=T(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(i){if(a=!1,o.__ifError=i,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,i?.message||i)}return}const r=o.__if;if(o.__if=!!a,r&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(i){console.error("[smbls] onRemove error:",i)}}else if(!r&&o.__if)if(o.__ifInitialized)t.node||(t.node=so(t)),t.node&&(t.node.ref=t),hs(t),bs(t),Ms(t),D("Render",t,{}),io(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=Do(t)),D("Init",t,{}),t.node||(t.node=so(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"&&!o.__fragmentAnchor){const f=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(f),o.__fragmentAnchor=f}D("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ys(t,{}),ps(t,{skipIfEffect:!0}),ys(t),qs(t,{}),hs(t),D("Create",t,{}),D("Complete",t,{}),D("Render",t,{}),D("RenderRouter",t,{}),io(t,{})}},{depth:o.path.length,label:v(o,"if")});o.__effects.push(e)}function Gt(t,o){const s=t.node;if(!s)return;const n=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const e=t.__ref;let c=e?e.__textNode:null;if(c&&c.parentNode!==s&&(c=null),!c){const a=s.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):s.firstChild?(c=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(c,s.firstChild)):(s.textContent=n,c=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),e&&(e.__textNode=c||null)}function te(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function oe(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function Kt(t,o,s,n){s==null||s===!1&&!It(o)?Wt(t,o,null):typeof s=="function"||typeof s=="object"||(n&&o==="src"&&"src"in t?t.src=s:Wt(t,o,J(o,s)))}function Wt(t,o,s){const n=te(t,o);s==null?t.removeAttribute(o):t.setAttribute(o,s),oe(t,n)}function gs(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const e=typeof document<"u"&&document.activeElement===s,c=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&c!=null&&a!=null)try{s.setSelectionRange(c,a)}catch{}const r=t.__ref&&t.__ref.__autoGrow;r&&r.active&&r.resize()}function bs(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Gt(t,t.text),Bs(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.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 e in t.style)typeof t.style[e]!="function"&&(s[e]=t.style[e]);break}tt(o,qt(t,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&&!It(s)||o.setAttribute&&o.setAttribute(s,J(s,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),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("{{")||o.dataset&&(o.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&&o.classList.add(n));else if(typeof s=="object")for(const n in s){const e=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];e&&o.classList.add(typeof e=="string"?e:n)}}}}function ht(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function se(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function Ot(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const e in o){if(o[e]==null||e.charAt(0)==="&")continue;const a=Q(e);n.push(a,yo(s,a),As(s,a))}return n}function yo(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function As(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function Q(t){return Uo(t)}function _o(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,e=new Set;if(s&&typeof s=="object")for(const c in s)s[c]==null||c.charAt(0)==="&"||e.add(Q(c));for(let c=0;c<o.length;c+=3){const a=o[c];e.has(a)||yo(n,a)===o[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Tt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(yo(s,o[n])!==o[n+1]||As(s,o[n])!==o[n+2])return!1;return!0}const Dt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,xs=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",zt=t=>Dt(t)?t:"--"+t;function Yt(t,o){if(!ot(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let e=t[n];if(typeof e=="function"){if(!o)continue;e=e(o,o.state,o.context)}xs(e)&&(s||(s={}),s[zt(n)]=e)}return s}function ws(t,o,s,n,e){Ss(t,e,T(t,n,s),c=>xs(c)?{[o]:c}:null)}function Ss(t,o,s,n,e){const c=t.__ref;let a,r=null;const i=j(()=>{X(t,()=>{try{const f=n(s(t,t.state,t.context)),d=t.node;if(!d||!d.style)return;const u=ht(f);(u===null||u!==a||!Tt(d,r))&&(a=u,_o(d,r,f),f&&tt(d,f),r=f?Ot(d,f):null,e&&e(f))}catch(f){L(c,o,f)}})},{depth:c.path.length,label:v(c,o)});c.__effects.push(i)}function ne(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){ee(t,s),o.__exec.vars=s;return}if(ot(s))for(const n of Object.keys(s)){const e=s[n];!n||typeof e!="function"||ws(t,zt(n),e,lt(t.varsDeps,n),"vars."+n)}}function ee(t,o){const s=t.__ref;Ss(t,"vars",T(t,t.varsDeps,o),n=>Yt(n),n=>{s.__varsInline=n?new Set(Object.keys(n)):null})}function go(t,o){if(typeof t[o]=="function"&&(nt(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Dt(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!ot(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&zt(n)===o)return!0;return!1}function re(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(Q(s)));return o}function ie(t,o,s,n){const e=t.__ref;if(!e)return;let c=null;if(s)for(const a of s){if(n&&n.has(a))continue;const r=o[a];if(r==null||typeof r=="object")continue;const i=Q(a);Bt[i]&&(c||(c={}),c[i]=r)}e.__declaredLonghands=c}function Cs(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const c in n){if(o.has(c))continue;const a=Bt[c];let r=!1;for(let i=0;i<a.length;i++)if(o.has(a[i])){r=!0;break}r&&(e||(e={}),e[c]=n[c])}return e}function ks(t,o){const s=t.node;tt(s,o);const n=re(o);if(!n)return o;const e=t.__ref;if(e)if(e.__inlineCssKeys)for(const a of n)e.__inlineCssKeys.add(a);else e.__inlineCssKeys=new Set(n);const c=Cs(t,n);return c?(tt(s,c),Object.assign({},o,c)):o}function ce(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=Cs(t,o.__inlineCssKeys);s&&tt(t.node,s)}function qt(t,o){return!o||typeof o!="object"?o:X(t,()=>{try{return bn(o,t)}catch{return o}})}function tt(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const e=o[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){s||(s={}),s[n]=e;continue}try{const c=String(e),a=Uo(n),r=c.trim(),i=/\s*!important\s*$/.test(r),f=r.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,i?"important":"")}catch{}}}s&&fe(t,s)}function fe(t,o){const s=`_ds${Ko.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let e=n.querySelector("style[data-smbls-scoped]");e||(e=n.createElement("style"),e.setAttribute("data-smbls-scoped",""),n.head.appendChild(e));let c="";for(const a in o){const r="."+s,i=a.replace(/&/g,r).split(",").map(d=>{const u=d.trim();return u.includes(r)?u:r+u}).join(", "),f=o[a];if(typeof f=="object"){let d="",u="";for(const l in f){const g=f[l];if(typeof g=="object"){const x=l.includes("&")?i.split(", ").map(h=>l.replace(/&/g,h)).join(", "):i.split(", ").map(h=>`${h} ${l}`).join(", ");let p="";for(const h in g)p+=`${Q(h)}: ${g[h]};`;u+=Bo(`${x} { ${p} }`,x)+`
|
|
5
|
+
`}else d+=`${Q(l)}: ${g};`}d&&(c+=Bo(`${i} { ${d} }`,i)+`
|
|
6
|
+
`),u&&(c+=u)}}c&&(e.textContent+=c)}const vs=new Set;function js(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function ae(t,o,s){const n=js(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(js(e)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";vs.has(c)||(vs.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(e)?e.join(", "):String(e)}]. 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 ue(t){const o=t.subscribeTo,s=typeof o=="function";let n=o;if(s)try{n=o(t,t.state,t.context)}catch{n=null}if(s&&st()&&ae(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let c=0;c<n.length;c++){const a=n[c];if(typeof a!="string"||a.length===0)continue;const r=a.split("."),i=r[0],f=r.slice(1),d={value:!1},u=j(()=>{const l=t.state&&(W(t.state)?t.state.root:null);if(!l||!W(l))return;let g=l;g=g[i];for(let p=0;p<f.length&&!(g==null||typeof g!="object");p++)if(W(g))g=g[f[p]];else break;if(!d.value)return;let x=!1;if(typeof t.onBeforeUpdate=="function"&&X(t,()=>{try{if(Ie(e)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>Qt(e,!1),h=>{Qt(e,!0),bt("error",t,{hook:"onBeforeUpdate",error:h})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",h)}):(Qt(e,!1),p===!1&&(x=!0))}}catch(p){Qt(e,!0),bt("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}}),!x&&t.node&&e.__effects)for(let p=0;p<e.__effects.length;p++){const h=e.__effects[p];h&&h!==u&&!h._disposed&&!h._isSubscribeToEffect&&typeof h._execute=="function"&&h._execute()}!x&&typeof t.onUpdate=="function"&&X(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(p){bt("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}})},{depth:e.path.length,label:v(e,"subscribeTo("+a+")")});d.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function bo(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function Ao(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const Es=new Set;function de(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;Es.has(n)||(Es.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.`))}const Ps=new Map;function le(t){let o=Ps.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push(Vo(e))};return s(Bt[t]),s(Sn[t]),Ps.set(t,o),o}function Os(t,o,s){if(go(t,o)||s&&s.has(o))return!0;const n=le(Q(o));for(let e=0;e<n.length;e++){const c=n[e];if(go(t,c)||s&&s.has(c))return!0}return!1}function yt(t,o,s,n){const e={},c=new Set,a=(r,i,f)=>{const d=f?new Set(Object.keys(e)):null;if(I[r]){const u=I[r](i,o,o.state,o.context);if(u){const l=Array.isArray(u)?u:[u];for(const g of l)g&&Object.assign(e,g)}}else e[r]=i;if(f)for(const u in e)d.has(u)||c.add(u)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(o,o.state,o.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let l=i[u];typeof l=="function"&&(l=l(o,o.state,o.context)),!(l==null||typeof l=="function")&&a(u,l,Os(o,u,n))}continue}if(r==="vars"){const u=Yt(i,o);if(u)for(const l in u)a(l,u[l],go(o,l)||!!(n&&n.has(l)));continue}if(bo(r,o)){const u=yt(i,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){st()&&de(r,o);continue}const f=Ao(r,o),d=yt(i,o,!1,n);Object.keys(d).length&&(e[f]=d);continue}a(r,i,Os(o,r,n))}}if(s)for(const r in e)c.add(r);for(const r of c){const i=e[r];typeof i=="string"&&!i.includes("!important")&&(e[r]=i+" !important")}return e}const ot=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Ts(t,o){for(const s in o){const n=o[s];t[s]=ot(n)?Ts(ot(t[s])?t[s]:{},n):n}return t}function pe(t,o){if(!ot(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;ot(e)&&(s=Ts(s||{},e))}return s}function xo(t,o){if(o===void 0&&(o=0),o>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)&&xo(t[s],o+1))return!0}return!1}function Ds(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(bo(t,s)){const c=yt(o,s,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=Ao(t,s),e=yt(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function he(t){const o=t.__ref;for(const s of Object.keys(t)){if(!co(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!xo(n))continue;let e=null,c;const a=j(()=>{if(!t.node)return;const r=t.context?.designSystem;r&&Y(r);let i,f=!1;try{const d=Ds(s,n,t),u=d?ht(d.block)+"::"+d.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,d){const l=At({[d.cssProp]:d.block},null,t.context?.cssPrefix);i=l?l.split(" ").filter(Boolean):null}else i=null}finally{r&&q()}if(!(f||!t.node.classList)){if(e)for(const d of e)t.node.classList.remove(d);if(i&&i.length)for(const d of i)t.node.classList.add(d);e=i}},{depth:o.path.length,label:v(o,"cssBlock("+s+")")});o.__effects.push(a)}}const ye=()=>!0,_e=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!I[t]||!!(U&&U.has(t))||Dt(t)||t==="vars"};function ge(t,o,s){const n={};let e=!1;for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(r!=="data"&&r!=="aria"&&(_e(r,s[r])||H.has(r))?n[r]=!0:e=!0);if(!e)return null;const c=xn({[o]:s},t.tag||"div",n,ye);let a=null;for(const r in c)/^on/i.test(r)||(a||(a={}),a[r]=c[r]);return a}function Ls(t,o,s,n,e,c){const a=t.node;let r=null;const i=f=>{(r||(r=[])).push(f)};for(const f in n){const d=o.owners.get(f),u=d===s;if(!c&&d!==void 0&&!u)continue;let l;try{l=n[f](t)}catch(x){L(t.__ref,"conditional("+s+")."+f,x),u&&i(f);continue}if(typeof l=="string"&&l.includes("{{")&&(l=$.call(t,l,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){i(f);continue}if(l==null||typeof l=="object"||typeof l=="function"){u&&Rs(a,o,f);continue}const g=l===!1&&!It(f)?null:String(J(f,l));i(f),!(u&&g===o.written.get(f))&&(d===void 0&&o.base.set(f,a.getAttribute(f)),Wt(a,f,g),o.owners.set(f,s),o.written.set(f,g))}e.appliedAttrs=r}function Rs(t,o,s){t.getAttribute(s)===o.written.get(s)&&Wt(t,s,o.base.get(s)),o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function be(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const c of e)o.owners.get(c)===s&&Rs(t.node,o,c)}function Ms(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const n of o.owners.keys()){const e=o.written.get(n),c=s.getAttribute(n);c!==e&&(o.base.set(n,c),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function Ae(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const c=e.charAt(0);if(c!=="."&&c!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const h=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${h}: { '${a.slice(h.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const i=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},d=ge(t,e,r);d&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const h in r){if(!Object.prototype.hasOwnProperty.call(r,h))continue;const _=h.charAt(0),w=r[h];if(!((_===":"||_==="@"||_==="&"||_==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(h==="vars"&&ot(w)){for(const y of Object.keys(w))y&&u.add(zt(y));continue}u.add(h)}}const l=()=>{let h;const _=t[a];if(_===void 0){const b=!!t.state&&a in t.state,A=t.state?t.state[a]:void 0;if(b||A!==void 0)h=A;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{h=typeof S=="function"?S.call(t,t):S}catch(C){h=!1,o.__conditionalError=C,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,C?.message||C)}}}else if(typeof _=="function")try{h=_(t,t.state,t.context)}catch(b){h=!1,o.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else h=_;const w=i?!h:!!h;if(!t.node)return;const y=t.context?.designSystem;if(w===f.lastMatch){if(w&&d&&t.node.setAttribute){y&&Y(y);try{Ls(t,s,e,d,f,!1)}finally{y&&q()}}return}f.lastMatch=w,y&&Y(y);try{if(w){const b={},A={};let S=!1;for(const k in r){if(!Object.prototype.hasOwnProperty.call(r,k))continue;const E=r[k],V=k.charAt(0);if((V===":"||V==="@"||V==="&"||V==="[")&&E&&typeof E=="object"&&!Array.isArray(E)){if(bo(k,t)){const M=yt(E,t,!1,u);Object.keys(M).length&&(A[`[data-theme="${k.slice(1)}"] &`]=M,S=!0)}else{const M=Ao(k,t),R=yt(E,t,!1,u);Object.keys(R).length&&(A[M]=R,S=!0)}continue}const ct=typeof E=="function"?E(t,t.state,t.context):E;if(ct!=null){if(I[k]){const M=I[k](ct,t,t.state,t.context);if(M){const R=Array.isArray(M)?M:[M];for(const N of R)N&&Object.assign(b,N)}}else if(U&&U.has(k))b[k]=ct;else if(Dt(k))b[k]=ct;else if(k==="vars"){const M=Yt(ct,t);M&&Object.assign(b,M)}}}const C=Object.keys(b);if(C.length){tt(t.node,b);for(const k of C)n.set(k,e);f.appliedKeys=C}else f.appliedKeys=null;if(S){const k=At(A,null,t.context?.cssPrefix,{state:!0}),E=k?k.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const V of E)t.node.classList.add(V);f.appliedClasses=E}else f.appliedClasses=null}else if(f.appliedClasses){for(const k of f.appliedClasses)t.node.classList.remove(k);f.appliedClasses=null}d&&t.node.setAttribute&&Ls(t,s,e,d,f,!0)}else{if(f.appliedAttrs&&be(t,s,e,f),f.appliedKeys){for(const b of f.appliedKeys)n.get(b)===e&&(Dt(b)?t.node.style.removeProperty(b):t.node.style[b]="",n.delete(b));f.appliedKeys=null}if(f.appliedClasses){for(const b of f.appliedClasses)t.node.classList.remove(b);f.appliedClasses=null}}}finally{y&&q()}};o.__conditionalRunners.push(l);const g=T(t,t[a+"Deps"],l),x=j(g,{depth:o.path.length,label:v(o,"conditional("+e+")")}),p=o.__exec&&o.__exec[a]||t[a];x._sources.size===0&&typeof p=="function"&&st()&&Hn(p)&&console.warn(`[smbls] conditional \`${e}\` 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 \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(x)}}const wo=new WeakSet,So=new WeakMap;function xe(t){const o=So.get(t);if(o==="painted")return!1;if(o===void 0){So.set(t,"open");const s=t.defaultView,n=()=>{So.set(t,"painted")};s&&typeof s.requestAnimationFrame=="function"?s.requestAnimationFrame(n):setTimeout(n,0)}return!0}function we(t){const o=t.ownerDocument;!o||wo.has(o)||xe(o)||(wo.add(o),queueMicrotask(()=>{wo.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const Co=new WeakSet;let Ns=!1;function Fs(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function ko(t,o){const s={...t};for(const n in o){const e=o[n],c=s[n];s[n]=e&&typeof e=="object"&&c&&typeof c=="object"?ko(c,e):e}return s}function $s(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const c=$s(e,o);Object.keys(c).length&&(s[n]=c)}else o.has(n)||(s[n]=e)}return s}function Se(t,o,s){let n=1/0,e=-1/0;for(const a of o.values())a<n&&(n=a),a>e&&(e=a);if(s)for(const a of s.values())a>e&&(e=a);if(e<=n)return null;let c=null;for(const[a,r]of o){if(r===e)continue;const i=Ce(a);if(i)for(let f=0;f<i.length;f+=3){const d=i[f],u=i[f+1],l=i[f+2],g=t[u]!=null?o.get(u):void 0,x=s&&s.get(d),p=g!==void 0&&g>r&&Ho(d,t[u],l),h=!p&&x!==void 0&&x>r&&Ho(d,void 0,l);if(p||h){p&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const Is=new Map;function Ce(t){let o=Is.get(t);if(o!==void 0)return o;const s=Q(t),n=Bt[s];if(o=null,Array.isArray(n)){o=[];for(const e of n)o.push(e,Vo(e),s)}return Is.set(t,o),o}function Bs(t){const{node:o}=t;if(!o)return;if(Ns||(Ns=!0,At({display:"none"})),Co.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Co.add(t);const s=t.context?.designSystem;s&&Y(s),$o();try{const n={};let e=!1,c=[],a=null,r=null,i=null;const f=t.__ref&&t.__ref.__mergeLayer;let d,u=null,l=null;const g=(y,b)=>{if(b&&typeof b=="object"&&Fs(y)){r||(r={});const A=r[y];A&&(b=ko(A,b)),r[y]=b}else(b===null||typeof b!="object")&&(i||(i=new Set),i.add(y),d!==void 0&&(u||(u=new Map),u.set(y,d)));n[y]=b};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&I.theme){const y=I.theme(t.theme,t,t.state,t.context);if(y){const b=A=>{for(const S in A){const C=A[S];C&&typeof C=="object"&&Fs(S)&&(a||(a={}),a[S]=C),n[S]=C}};if(Array.isArray(y))for(const A of y)A&&b(A);else b(y);e=!0}}const x=(y,b)=>{if(y==="vars"){const A=Yt(b);if(A){for(const S in A)g(S,A[S]);e=!0}return}if(I[y]){const A=I[y](b,t,t.state,t.context);if(A){if(Array.isArray(A)){for(const S of A)if(S)for(const C in S)g(C,S[C])}else for(const S in A)g(S,A[S]);e=!0}}else if(U&&U.has(y))b!=null&&typeof b!="object"&&(g(y,b),e=!0);else if(y.charCodeAt(0)===45)b!=null&&typeof b!="object"&&(g(y,b),e=!0);else if((y.charAt(0)==="&"||y.charAt(0)==="@"||y.charAt(0)===":"||y.charAt(0)==="[")&&b&&typeof b=="object"&&!Array.isArray(b)){if(xo(b))return;const A=Ds(y,b,t);A&&(g(A.cssProp,A.block),e=!0)}};if(typeof t.class=="string"){const y=pe(t.class,t.context?.designSystem?.class);if(y)for(const b in y)x(b,y[b])}const p=i?new Set(i):null,h=t.tag||"div";for(const y of Object.keys(t)){if(typeof t[y]=="function"){const A=f&&f.get(y);A!==void 0&&nt(h,y)&&(l||(l=new Map),l.set(Q(y),A));continue}if(d=f?f.get(y):void 0,y==="vars"){x(y,t[y]);continue}if(H.has(y)||y==="theme")continue;const b=y.charCodeAt(0);b>=65&&b<=90||Z(y)||Go(h,y)||x(y,t[y])}d=void 0;const _=u?Se(n,u,l):null;if(a)for(const y in a){let b=i?$s(a[y],i):a[y];r&&r[y]&&(b=ko(b,r[y])),Object.keys(b).length?n[y]=b:delete n[y]}if(ie(t,n,i,_?new Set([...p||[],..._]):p),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const y=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof y=="string"&&y!==""&&n.display&&n.display!==y&&(n.display=y);const b=At(n,null,t.context?.cssPrefix);if(c=b?b.split(" ").filter(Boolean):[],b&&o.classList){const A=c;let S=!1;for(const C of A)o.classList.add(C),S||(C.charCodeAt(0)===95&&C.charCodeAt(1)===99||C.charCodeAt(0)===95&&C.indexOf("_c",1)!==-1)&&(S=!0);S&&we(o)}}const w=t.__ref;if(w){const y=w.__staticCssClasses;if(y&&o.classList){const b=new Set(c);for(const A of y)b.has(A)||o.classList.remove(A)}w.__staticCssClasses=c}ce(t)}finally{Io(),s&&q(),Co.delete(t)}}const lr=t=>!!I[t]||!!(U&&U.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function pr(t){t&&t.node&&Bs(t)}function ke(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const c=t.aria[e];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());o.setAttribute(a,J(a,c))}const s=An(t);for(const e in s){const c=s[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(e,c===!0?"":c)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||H.has(e)||e==="on"||s[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!Z(e)&&!nt(n,e)&&xt(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!no[e])continue;a=$.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!It(wt(e)||e))continue;const r=wt(e)||e;o.setAttribute(r,J(r,a))}}}function hr(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||Z(o))return;const e=t.tag||"div";if(nt(e,o)||!xt(e,o))return;const c=wt(o)||o,a=c.toLowerCase(),r=t.__ref&&t.__ref.__effects;let i=!1;if(r)for(let u=0;u<r.length;u++){const l=r[u];l&&l._attrName===a&&!l._disposed&&typeof l._execute=="function"&&(i=!0,l._execute())}if(i)return;let f=t[o];const d=no[o];if(d&&f!=null){const u=d(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=$.call(t,f,t.state)),Kt(s,c,f)}function ve(t,o){const s=t.node,n=t.__ref;let e=n.__autoGrow;if(!o){if(e&&e.active){try{s.removeEventListener("input",e.resize)}catch{}Us(e),et.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),Ks(s,e,!1),e.active=!1,e.appliedMax=null,e.lastMeasure=0}return}e||(e=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Lt(t,!0);return}if(!(s.scrollHeight>0)){e.awaitingLayout=!0,Hs(t,e);return}e.awaitingLayout=!1;const a=Pe(s),r=Oe(a),i=s.style.height;s.style.height="0px",r&&jo(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=i,r&&jo(s);return}const d=Te(s,a),u=d!=null&&f<d?d:f,l=Re(a),g=l!=null&&u>l;s.style.height=Le(g?l:u,a)+"px",r&&jo(s),Ks(s,e,g),e.lastMeasure=f,e.lastWidth=s.clientWidth,Hs(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}Us(e),et.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,Ee(t,e));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=c,e.appliedMax=c),e.resize()}function Lt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),et.add(t),Ht())}function je(){const t=Array.from(et);et.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,e=s.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=dt()),e.attachAttempts+=1,e.attachAttempts<=Yo&&dt()-e.firstAttemptAt<qo&&(et.add(s),Ht());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function Hs(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const c=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Lt(t,!0);return}const r=s.clientWidth;o.lastWidth!=null&&Math.abs(r-o.lastWidth)<.5||(o.lastWidth=r,Lt(t,!0))};let a;try{a=new e(c),a.observe(s)}catch{return}o.watch=a}function Us(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function Ee(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,n=s&&s.fonts&&s.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{o.active&&t.node&&Lt(t,!0)},()=>{})}function Pe(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const rt=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,vo=t=>(rt(t.paddingTop)||0)+(rt(t.paddingBottom)||0),Vs=t=>(rt(t.borderTopWidth)||0)+(rt(t.borderBottomWidth)||0);function Oe(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let n=0;n<o.length;n++){const e=o[n].trim();if(!(e!=="all"&&e!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function jo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const n=o[s];if(n&&n.transitionProperty==="height")try{n.cancel()}catch{}}}function Te(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const n=rt(o.lineHeight)||De(t,o);return n>0?s*n+vo(o):null}const Rt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],Gs=new WeakMap;function De(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let e=Gs.get(s);e||(e=new Map,Gs.set(s,e));const c=Rt.map(f=>o[f]||"").join("|");if(e.has(c))return e.get(c);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const r=a.style;r.position="absolute",r.visibility="hidden",r.top="0",r.left="-9999px",r.height="auto",r.minHeight="0",r.maxHeight="none",r.padding="0",r.border="0",r.boxSizing="content-box",r.overflow="hidden";for(let f=0;f<Rt.length;f++)o[Rt[f]]&&(r[Rt[f]]=o[Rt[f]]);let i=0;try{n.appendChild(a),i=a.clientHeight}catch{i=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return i>0?(e.set(c,i),i):null}function Le(t,o){return o?o.boxSizing==="border-box"?t+Vs(o):o.boxSizing==="content-box"?Math.max(0,t-vo(o)):t:t}function Re(t){if(!t)return null;const o=rt(t.maxHeight);if(o==null||!(o>0))return null;const s=vo(t),n=Vs(t),e=t.boxSizing==="border-box"?o-n:o+s,c=rt(t.lineHeight);if(!(c>0))return e;const a=Math.floor((e-s)/c+1e-6);return a>=1?a*c+s:e}function Ks(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const Ws=["srcObject","muted"],Me=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function Ne(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Ws.length;n++){const e=Ws[n],c=t[e];if(c===void 0||!(e in o))continue;const a=r=>{const i=Me(e,r);if(o[e]!==i)try{o[e]=i}catch(f){L(s,e,f)}};if(typeof c=="function"){const r=T(t,t[e+"Deps"],c),i=j(()=>{try{a(r(t,t.state,t.context))}catch(f){L(s,e,f)}},{depth:s.path.length,label:v(s,e)});s.__effects.push(i),s.__exec[e]=c}else a(c);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Fe(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,e=typeof n=="function"?T(t,t.autoGrowDeps,n):null,c=j(()=>{const a=t.autoGrow;let r=a;if(typeof a=="function")try{r=(a===n&&e?e:a)(t,t.state,t.context)}catch{r=null}ve(t,r)},{depth:s.path.length,label:v(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(c),e&&(s.__exec.autoGrow=n)}const zs=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ys(t,o){for(const s of Object.keys(t)){if(!Z(s)||zs.has(s))continue;const n=fn(s);if(n){cn(n,t,t[s]);continue}let e=t[s],c=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(c=e,e=c.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const r=e;e=function(f){return t.call(r,f)}}if(typeof e!="function")continue;const a=Pn(s);en.has(a)||rn(On(a),t,e,c)}$e(t)}function $e(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const l of zs){const g=t[l];typeof g=="function"&&(s[l]=g,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,r=0,i=0,f=!1;const d=l=>{const g=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];g&&(a=g.clientX,r=g.clientY,i=Date.now(),f=!0)},u=l=>{if(!f)return;f=!1;const g=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!g)return;const x=g.clientX-a,p=g.clientY-r,h=Date.now()-i;if(h>c)return;const _=Math.abs(x),w=Math.abs(p);if(Math.max(_,w)<e)return;let y;if(_>w*1.2)y=x<0?"left":"right";else if(w>_*1.2)y=p<0?"up":"down";else return;const b="onSwipe"+y.charAt(0).toUpperCase()+y.slice(1),A=s[b],S=s.onSwipe;A&&A.call(t,l,t,t.state,t.context),S&&S.call(t,{direction:y,dx:x,dy:p,dt:h,event:l},t,t.state,t.context)};o.addEventListener("touchstart",d,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",d)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function it(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=it(e,c):s[n]=c}return s}function Eo(t,o,s,n,e){if(!o||!t.node)return;const c=t.childExtends,a=pt(t,"childProps");if(Array.isArray(o)){const r=t.tag==="fragment",i=t.context?.document||globalThis.document,f=r?null:i?.createDocumentFragment();if(!r&&!f)return;const d=t.childProps,u=t.childrenAs,l=y=>{let b=o[y];const A=b;(typeof b=="string"||typeof b=="number")&&(b={text:b});let S=d;if(typeof d=="function")try{S=d(t,b)}catch{S=null}let C=typeof d=="function"?jt(S):a;if(e&&u!=="state"&&(C=Et(C,jt(A))),u==="state"){let E=A;(typeof A=="string"||typeof A=="number")&&(E={value:A,text:A}),b=S?{...S,state:E}:{state:E}}else S&&(b=it(S,b));if(c&&!b.ignoreChildExtends)if(b.extends){const E=Array.isArray(b.extends)?b.extends:[b.extends],V=Array.isArray(c)?c:[c];b={...b,extends:[...V,...E]}}else b={...b,extends:c};const k=Qo(b?.key,A,y,t);try{return m(Pt(b,C),t,k,s)}catch(E){if(typeof console<"u"&&console.error){const V=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${V} (initial render, skipping this row):`,E?.message||E)}return null}},g=t.__ref;if(!(n===!0&&!r&&!!g&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let y=0;y<o.length;y++){const b=l(y);!r&&b?.node&&f.appendChild(b.node)}return r||t.node.appendChild(f),!0}const p=g.__childrenChunkGen=(g.__childrenChunkGen||0)+1;Ro();const h=Fo();let _=null;const w=y=>{if(g.__disposed||g.__childrenChunkGen!==p){_&&_.parentNode&&_.remove();return}for(let b=y;b<o.length;b++){h.begin();const A=l(b);A?.node&&(_?t.node.insertBefore(A.node,_):f.appendChild(A.node));const S=h.end();if(b+1<o.length&&Lo(S)){_||(_=i.createComment("smbls-mount"),f.appendChild(_),t.node.appendChild(f));const C=b+1;No(()=>w(C));return}}_?(_.remove(),t.node.tagName==="SELECT"&&Zt(t,!0)):t.node.appendChild(f)};return w(0),Mo(),!0}if(typeof o=="string"){const r=ss(o,t);if(Array.isArray(r))return Eo(t,r,s,n,!0)}if(typeof o=="object")for(const r in o){if(H.has(r))continue;let i=o[r];if(i==null||i===!1)continue;const f=e?Et(a,jt(i)):a;if((typeof i=="string"||typeof i=="number")&&(i={text:i}),t.childProps&&(i=it(t.childProps,i)),c&&!i.ignoreChildExtends)if(i.extends){const d=Array.isArray(i.extends)?i.extends:[i.extends],u=Array.isArray(c)?c:[c];i={...i,extends:[...u,...d]}}else i={...i,extends:c};m(Pt(i,f),t,Vt(t,r),s)}}function Zt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const e=t.__ref,c=e&&e.__exec&&e.__exec.value,a=typeof c=="function",r=t.value!=null&&typeof t.value!="function";if(a||r){let d;if(a)try{d=c(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=$.call(t,d,t.state));const u=d==null?"":String(d);s.value!==u&&(s.value=u);return}const i=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!i)return;let f=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(f=d);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function qs(t,o){let{children:s,content:n}=t;const e=t.childExtends,c=typeof s=="function"||us(t,"children");if(typeof s=="function"){const p=s;try{s=p(t,t.state,t.context)}catch(b){if(s=void 0,typeof console<"u"&&console.error){const A=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${A} (initial run, treating as empty):`,b?.message||b)}}ds(t,s),t.children=s;const h=t.__ref;let _=!1;const w=T(t,t.childrenDeps,p),y=j(()=>{const b=_;_=!0;let A;try{A=w(t,t.state,t.context)}catch(R){if(typeof console<"u"&&console.error){const N=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${N}${b?"":" (initial tracking run)"}:`,R?.message||R)}return}if(!b||A===t.children)return;ds(t,A),t.children=A,h.__childrenChunkGen!=null&&h.__childrenChunkGen++;const S=typeof t.onContentUpdate=="function",C=S?[]:null,k=S?[]:null,E=S?[]:null;if(Array.isArray(A)&&t.childrenAs==="state"){const R=t.childProps,N=[],Oo=new Map;for(let P=0;P<A.length;P++){const G=A[P];let O=R;if(typeof R=="function")try{O=R(t,G)}catch{O=null}const z=Qo(O&&O.key,G,P,t);N.push(z),Oo.set(z,{rawChild:G,childProps:O})}const Qs=new Set(N),Xs=h.__children.slice();for(const P of Xs)if(!Qs.has(P)){const G=t[P];G?.remove&&G.remove(),delete t[P],k&&k.push(P)}const _t=t.childExtends,Mt=t.tag==="fragment",Js=t.context?.document||globalThis.document,gt=Mt?null:Js?.createDocumentFragment(),Xt=new Set;for(const P of N){const G=Oo.get(P),O=G.rawChild,z=t[P];if(z&&z.state){if(O&&typeof O=="object"){const F=z.state,ft=F.$replace||F.replace,To=F.$update||F.update;try{if(typeof ft=="function")ft.call(F,O);else if(typeof To=="function"){for(const B in F)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(O,B))try{F[B]=void 0}catch{}To.call(F,O)}else for(const B in O)F[B]=O[B]}catch(B){if(typeof console<"u"&&console.error){const tn=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${P}" failed to patch at ${tn} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}E&&E.push(P);continue}let Jt=O;(typeof O=="string"||typeof O=="number")&&(Jt={value:O,text:O});const mt=G.childProps;let K=mt?{...mt,state:Jt}:{state:Jt};const ms=typeof R=="function"?jt(mt):pt(t,"childProps");if(_t&&!K.ignoreChildExtends)if(K.extends){const F=Array.isArray(K.extends)?K.extends:[K.extends],ft=Array.isArray(_t)?_t:[_t];K={...K,extends:[...ft,...F]}}else K={...K,extends:_t};let to;try{to=m(Pt(K,ms),t,P,o)}catch(F){if(typeof console<"u"&&console.error){const ft=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${P}" failed to construct at ${ft} (reconcile, skipping this row):`,F?.message||F)}Xt.add(P);continue}!Mt&&to?.node&>&>.appendChild(to.node),C&&C.push(P)}if(!Mt&>&>.childNodes.length&&t.node&&t.node.appendChild(gt),!Mt&&t.node){let P=null;for(const G of N){const O=t[G]?.node;if(!O)continue;const z=P?P.nextSibling:t.node.firstChild;O!==z&&t.node.insertBefore(O,z),P=O}}h.__children=Xt.size?N.filter(P=>!Xt.has(P)):N,S&&(C.length||k.length)&&Zo(t,{added:C,removed:k,kept:E}),Zt(t,!1);return}const M=S?[...h.__children]:null;for(const R of[...h.__children]){const N=t[R];N?.remove&&N.remove(),delete t[R]}h.__children=[],Eo(t,A,o,!1,!0),Zt(t,!1),S&&Zo(t,{added:[...h.__children],removed:M,kept:[]})},{depth:h.path.length,label:v(h,"children")});h.__effects.push(y)}const a=Eo(t,s,o,!0,c);if(n!=null&&!(n&&n.__ref)){let p=n;if(typeof p=="string"||typeof p=="number"?p={text:p}:typeof p!="object"&&(p={}),t.childProps&&(p=it(t.childProps,p)),e&&!p.ignoreChildExtends)if(p.extends){const _=Array.isArray(p.extends)?p.extends:[p.extends],w=Array.isArray(e)?e:[e];p={...p,extends:[...w,..._]}}else p={...p,extends:e};const h=Et(pt(t,"childProps"),pt(t,"content"));m(Pt(p,h),t,"content",o)}if(s&&!a)return;const r=t.context?.components||{},i=t.__ref&&t.__ref.__runtimeSource,f=i?{}:null;{const p=Object.keys(t);for(let h=0;h<p.length;h++){const _=p[h];if(!_.endsWith("Extends")||typeof t[_]!="string")continue;const w=_.slice(0,-7);if(!w||w.charCodeAt(0)<65||w.charCodeAt(0)>90)continue;const y={extends:t[_]};delete t[_];for(let b=h+1;b<p.length;b++){const A=p[b],S=A.charCodeAt(0);if(S>=65&&S<=90||H.has(A)||typeof t[A]=="function"&&(A.startsWith("on")||A.startsWith(".")))break;const C=t[A];C!==void 0&&(y[A]=C,delete t[A],f&&vt(i,A)&&(f[w]||(f[w]={}),f[w][A]=i[A]))}t[w]&&typeof t[w]=="object"?t[w]={...y,...t[w]}:t[w]=y}}const d=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),l=p=>{if(H.has(p)||typeof t[p]!="object"||t[p]===null)return;const h=p.charCodeAt(0);if(h<65||h>90)return;let _=t[p];if(_.__ref)return;if(!_.extends&&!_.extend){const y=r[p]||r[`smbls.${p}`];y&&(_={..._,extends:y})}if(t.childProps&&(_=it(t.childProps,_)),e&&!_.ignoreChildExtends)if(_.extends){const y=Array.isArray(_.extends)?_.extends:[_.extends],b=Array.isArray(e)?e:[e];_={..._,extends:[...b,...y]}}else _={..._,extends:e};const w=i?Et(pt(t,"childProps"),Et(f[p]||null,pt(t,p))):null;m(Pt(_,w),t,p,o)};if(!d){for(const p of u)l(p);return}Ro();const g=Fo(),x=p=>{for(let h=p;h<u.length;h++){g.begin(),l(u[h]);const _=g.end();if(h+1<u.length&&Lo(_)){const w=h+1;No(()=>x(w));return}}};x(0),Mo()}function Zs(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const e=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const r=s.node.nextSibling;a.insertBefore(n,r||e)}else a.insertBefore(n,e);return}}const c=o?.node||(o?.nodeType?o:null);if(c)if(s?.position==="before"&&s.node)c.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?c.insertBefore(n,a):c.appendChild(n)}else c.appendChild(n)}const Po=3;function Ie(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Po?!1:(t.__inBeforeUpdate=!0,!0)}function Qt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Po&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Po}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function D(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);bt(n,o,s);const e="on"+t,c=o[e];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(o.__ref[i])return!0;o.__ref[i]=!0}const f=o.context?.designSystem;f&&Y(f);let d=!!i;try{const u=c(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const l=o.__ref;return u.catch(g=>{$t(o,e,g)}).finally(()=>{i&&l&&(l[i]=!1)}),d=!1,!0}if(u===!1)return!1}catch(u){if($t(o,e,u),o.context?.strictMode)throw u}finally{f&&q(),d&&o.__ref&&(o.__ref[i]=!1)}}return!0}var yr=m;export{Po as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Ie as acquireBeforeUpdateGuard,m as create,yr as default,ro as flushMounts,lr as isStaticCssProp,pr as recompileStaticCss,hr as reconcileAttrProp,Qt as releaseBeforeUpdateGuard,qt as resolveStyleBlock,Kt as writeAttr,Gt as writeElementText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const p=50,r=[];let l=!1,n=0,s=!1;function i(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function a(e){const t=typeof globalThis<"u"?globalThis.scheduler:null;if(t&&typeof t.yield=="function"){t.yield().then(e,e);return}if(typeof MessageChannel=="function"){const o=new MessageChannel;o.port1.onmessage=()=>{o.port1.close(),e()},o.port2.postMessage(0);return}setTimeout(e,0)}function h(e=0){return!n||i()-n+e<50?!1:(s=!0,!0)}function _(){let e=0,t=0,o=0;return{begin(){o=i()},end(){const f=i()-o;e+=f,t++;const c=e/t;return f>c?f:c}}}let u=0;function g(){u===0&&!n&&(n=i(),s=!1),u++}function M(){u>0&&u--,u===0&&!l&&(n=0,s=!1)}function m(e){r.push(e),l||(l=!0,a(d))}function d(){for(n=i(),s=!1;r.length;){const e=r.shift();try{e()}catch(t){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",t?.message||t)}if(s||i()-n>=50)break}if(r.length){a(d);return}l=!1,n=0,s=!1,u=0}function y(){let t=0;for(n=0;r.length&&t++<1e5;){const o=r.shift();try{o()}catch(f){typeof console<"u"&&console.error&&console.error("[smbls] deferred mount chunk failed:",f?.message||f)}}l=!1,n=0,s=!1,u=0}function x(){return r.length}function T(){r.length=0,l=!1,n=0,s=!1,u=0}export{p as MOUNT_YIELD_BUDGET_MS,y as __flushMountQueueSync,x as __pendingMountChunks,T as __resetMountQueue,_ as childCostMeter,M as closeMountBudget,m as enqueueMountWork,h as mountBudgetExhausted,g as openMountBudget};
|
package/dist/esm/src/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{batch as
|
|
1
|
+
import{batch as h,isStore as _}from"@symbo.ls/signal";import{REGISTRY as v}from"./registry.js";import{create as x,resolveStyleBlock as p,acquireBeforeUpdateGuard as b,releaseBeforeUpdateGuard as l,writeElementText as g,reconcileAttrProp as P,writeAttr as A,isStaticCssProp as U,recompileStaticCss as j}from"./create.js";import{dispatchPluginHook as u}from"./pluginHooks.js";import{cssPropName as B}from"./cssLonghands.js";function S(o={},f={}){const t=this,i=t.__ref;if(!i)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!f.preventListeners&&typeof t.onBeforeUpdate=="function"&&b(i))try{const e=t.onBeforeUpdate(t,t.state,t.context,f);if(e&&typeof e.then=="function")e.then(()=>l(i,!1),n=>{l(i,!0),u("error",t,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if(l(i,!1),e===!1)return t}catch(e){throw l(i,!0),e}const a=!o||Object.keys(o).length===0,c=[];let d=!1;h(()=>{if(o.state&&_(t.state)&&t.state.$update(o.state),o.text!==void 0&&(t.text=o.text,!i.__exec.text&&t.node&&g(t,o.text??"")),o.html!==void 0&&(t.html=o.html,!i.__exec.html&&t.node&&(t.node.innerHTML=o.html)),o.style&&t.node?.style){if(!i.__exec.style){const e=p(t,o.style);for(const n in e){const r=e[n];if(r==null)continue;const s=B(n),y=String(r).replace(/\s*!important\s*$/,"");t.node.style.setProperty(s,y,"important")}}t.style||(t.style={}),Object.assign(t.style,o.style)}if(o.attr&&t.node?.setAttribute){for(const e in o.attr){const n=o.attr[e];A(t.node,e,n)}t.attr||(t.attr={}),Object.assign(t.attr,o.attr)}if(o.data&&t.node?.dataset){for(const e in o.data)t.node.dataset[e]=o.data[e];t.data||(t.data={}),Object.assign(t.data,o.data)}if(o.vars&&typeof o.vars=="object"&&!Array.isArray(o.vars)){const e=t.vars&&typeof t.vars=="object"&&!Array.isArray(t.vars)?t.vars:null;t.vars={...e,...o.vars},d=!0}for(const e in o){if(v.has(e)||e==="state")continue;const n=o[e],r=t[e];if(r&&r.__ref&&typeof r.update=="function")r.update(n,f);else if(typeof n=="object"&&n!==null){const s=e.charCodeAt(0);s>=65&&s<=90&&x(n,t,e,f)}else e!=="text"&&e!=="html"&&e!=="style"&&e!=="attr"&&e!=="data"&&(t[e]=n,typeof n!="function"&&c.push(e))}});for(let e=0;e<c.length;e++)P(t,c[e]);if(t.node){let e=d;for(let n=0;!e&&n<c.length;n++)U(c[n])&&(e=!0);e&&j(t)}if(t.node&&a&&i.__effects&&i.__effects.length)for(let e=0;e<i.__effects.length;e++){const n=i.__effects[e];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(t.node&&i.__conditionalRunners)for(const e of i.__conditionalRunners)e();return u("update",t),!f.preventListeners&&typeof t.onUpdate=="function"&&t.onUpdate(t,t.state,t.context,f),t}var L=S;export{L as default,S as update};
|
package/dist/esm/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="3.14.
|
|
1
|
+
const o="3.14.804";export{o as VERSION};
|