@symbo.ls/element 3.14.799 → 3.14.800

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @symbo.ls/element
2
2
 
3
+ ## 3.14.800
4
+
5
+ ### Patch Changes
6
+
7
+ - Server rendering is correct and fast, opt-in hydration, and Cloudflare deploys run the full build (FW-BRENDER-HYDRATION-AND-CF-DEPLOY-PROVIDER-1, FW-PUBLISH-TIME-PRERENDER-SSRCACHE-1).
8
+
9
+ Behaviour changes (check these first):
10
+
11
+ - `smbls build` copies `public/` into the output root (never replacing a file the bundler wrote), so `_redirects`, `_headers` and `404.html` ship with every bundler.
12
+ - Booting over a pre-rendered page removes only `style[data-emotion="smbls"]` and `style[data-brender]`; the host page's own `<style>` tags stay.
13
+ - The Cloudflare worker (`renderProjectHtml` without eval) keeps the client render instead of painting a wrong pre-render; a stored pre-render (`ssrCache` / `__ssr`) is still served. `ssrWithoutEval: true` opts back in.
14
+
15
+ Fixes:
16
+
17
+ - Every server render after the first one paints its theme colours again (linkedom made `deepClone` copy nothing nested).
18
+ - Server pages ship their own reset, keyframes and `:root` once, also in the Cloudflare worker (`generateGlobalCSS` read the wrong keys, wrote files and cached across projects).
19
+ - A pre-render waits for its own requests instead of a flat 2 s; server renders stop rescanning the head for every inserted rule.
20
+ - The server render gets the project's `globalScope` and context keys, as the client does; a `<select>` with a value no longer drops its parent.
21
+
22
+ New, opt-in:
23
+
24
+ - Hydration: `hydrate: true` (or `window.__BRENDER_HYDRATE__` from the server, with `__BR_REGISTRY__`) adopts the server DOM instead of replacing it; a mismatch falls back to a fresh node, a throw to the fresh render. brender `renderPage({ adoptDom })` ships the registry and the recorded GET answers; `@symbo.ls/fetch` exports `createEarlySeedScript`, `earlyKey`, `EARLY_KEY`.
25
+ - `smbls deploy --provider cloudflare [--target pages|workers] [--dry-run] [--no-brender]` runs the full `smbls build` pipeline; `--target workers` writes Workers Static Assets config.
26
+ - `smbls publish --ssr` (or `"prerender": true` in `symbols.json`) pre-renders every static route and stores it as `__ssr`, which the platform renderer serves; off by default.
27
+
28
+ - Updated dependencies
29
+ - @symbo.ls/css@3.14.775
30
+
3
31
  ## 3.14.799
4
32
 
5
33
  ### Patch Changes
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},v=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!b.call(e,o)&&o!==r&&c(e,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return e};var x=e=>v(c({},"__esModule",{value:!0}),e);var k={};y(k,{SVG_NS:()=>i,SVG_TAGS:()=>s,cacheNode:()=>S,createHTMLNode:()=>f,detectTag:()=>g,isSvgTag:()=>l,isValidTag:()=>d});module.exports=x(k);const i="http://www.w3.org/2000/svg",s=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),T=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function d(e){return T.has(e)||s.has(e)}function l(e){return s.has(e)}function g(e){let{tag:t,key:r}=e;if(typeof t=="function")try{t=t(e,e.state,e.context)}catch(a){t=void 0,typeof console<"u"&&console.error&&console.error(`[smbls] \`tag:\` factory threw on "${r||"<anon>"}" \u2014 falling back to key-based tag detection:`,a?.message||a)}if(t===!0&&(t=r),typeof t=="string"&&d(t))return t;if(!r||typeof r!="string")return"div";const n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]);let o=r.toLowerCase();return o.includes(".")&&(o=o.split(".")[0]),o.includes("_")&&(o=o.split("_")[0]),d(o)&&!n.has(o)?o:"div"}const p={};function f(e,t){const r=t?.context?.document||globalThis.document;if(!r)return null;if(e==="string")return r.createTextNode(t?.text||"");if(e==="fragment")return r.createDocumentFragment();if(l(e)){const n=t?.parent;if(e==="svg"||n?.node?.namespaceURI===i)return r.createElementNS(i,e);if(e!=="svg")return r.createElement("div")}return r.createElement(e)}function S(e){const t=e.tag=g(e),n=l(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,o=e?.context?.document||globalThis.document;let a=p[n];if(a||(a=p[n]=f(t,e)),!a)return null;const u=o&&a.ownerDocument!==o?f(t,e):a.cloneNode(!0);return t==="string"&&(u.nodeValue=e.text||""),u}
1
+ "use strict";var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},T=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of x(t))!_.call(e,o)&&o!==n&&f(e,o,{get:()=>t[o],enumerable:!(a=v(t,o))||a.enumerable});return e};var k=e=>T(f({},"__esModule",{value:!0}),e);var M={};S(M,{SVG_NS:()=>i,SVG_TAGS:()=>d,adoptHydrationNode:()=>A,cacheNode:()=>w,createHTMLNode:()=>p,detectTag:()=>u,elementPath:()=>g,isSvgTag:()=>c,isValidTag:()=>l});module.exports=k(M);const i="http://www.w3.org/2000/svg",d=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),C=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function l(e){return C.has(e)||d.has(e)}function c(e){return d.has(e)}function u(e){let{tag:t,key:n}=e;if(typeof t=="function")try{t=t(e,e.state,e.context)}catch(r){t=void 0,typeof console<"u"&&console.error&&console.error(`[smbls] \`tag:\` factory threw on "${n||"<anon>"}" \u2014 falling back to key-based tag detection:`,r?.message||r)}if(t===!0&&(t=n),typeof t=="string"&&l(t))return t;if(!n||typeof n!="string")return"div";const a=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]);let o=n.toLowerCase();return o.includes(".")&&(o=o.split(".")[0]),o.includes("_")&&(o=o.split("_")[0]),l(o)&&!a.has(o)?o:"div"}const m={};function p(e,t){const n=t?.context?.document||globalThis.document;if(!n)return null;if(e==="string")return n.createTextNode(t?.text||"");if(e==="fragment")return n.createDocumentFragment();if(c(e)){const a=t?.parent;if(e==="svg"||a?.node?.namespaceURI===i)return n.createElementNS(i,e);if(e!=="svg")return n.createElement("div")}return n.createElement(e)}function w(e){const t=e.tag=u(e),a=c(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,o=e?.context?.document||globalThis.document;let r=m[a];if(r||(r=m[a]=p(t,e)),!r)return null;const s=o&&r.ownerDocument!==o?p(t,e):r.cloneNode(!0);return t==="string"&&(s.nodeValue=e.text||""),s}const g=e=>{const t=e.__ref;if(t&&t.__hydrationPath!==void 0)return t.__hydrationPath;const n=e.parent,a=n&&n.__ref?g(n):null,o=a===null?"":a?a+"."+e.key:String(e.key);return t&&(t.__hydrationPath=o),o},N=new Set(["src","srcset"]);function A(e){const t=e?.context?.__hydration;if(!t)return null;const n=e.tag=u(e);if(n==="string"||n==="fragment")return null;const a=g(e),o=t.registry[a===""?"__root":a],r=o!==void 0?t.nodes[o]:null;if(!r||r.nodeType!==1||t.claimed.has(r))return o!==void 0&&t.misses++,null;const s=c(n)&&(n==="svg"||e.parent?.node?.namespaceURI===i),b=c(n)&&!s&&n!=="svg"?"div":n,y=s?r.namespaceURI===i:r.namespaceURI!==i;if(r.localName!==b||!y)return t.misses++,null;t.claimed.add(r),t.adopted++;for(const h of Array.from(r.getAttributeNames?r.getAttributeNames():[]))N.has(h)||r.removeAttribute(h);for(;r.firstChild;)r.removeChild(r.firstChild);return r}
@@ -1,6 +1,6 @@
1
- "use strict";var Ps=Object.create;var Ft=Object.defineProperty;var Os=Object.getOwnPropertyDescriptor;var Ts=Object.getOwnPropertyNames;var Ls=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Ms=(t,o)=>{for(var s in o)Ft(t,s,{get:o[s],enumerable:!0})},wo=(t,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of Ts(o))!Ds.call(t,e)&&e!==s&&Ft(t,e,{get:()=>o[e],enumerable:!(n=Os(o,e))||n.enumerable});return t};var Rs=(t,o,s)=>(s=t!=null?Ps(Ls(t)):{},wo(o||!t||!t.__esModule?Ft(s,"default",{value:t,enumerable:!0}):s,t)),Ns=t=>wo(Ft({},"__esModule",{value:!0}),t);var Vn={};Ms(Vn,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>zt,acquireBeforeUpdateGuard:()=>Ss,create:()=>m,default:()=>Hn,flushMounts:()=>Kt,isStaticCssProp:()=>kn,recompileStaticCss:()=>jn,reconcileAttrProp:()=>En,releaseBeforeUpdateGuard:()=>Rt,resolveStyleBlock:()=>Wt,writeElementText:()=>Mt});module.exports=Ns(Vn);var U=require("@symbo.ls/signal"),E=require("@symbo.ls/signal"),at=require("./cache.js"),V=require("./registry.js"),At=require("./delegate.js"),bs=require("./bridge.js"),Yt=require("./extends.js"),As=require("./methods.js"),Wn=require("./dispose.js"),ft=require("./devRuntime.js"),G=require("./mountScheduler.js"),R=require("@symbo.ls/utils"),$t=Rs(require("@symbo.ls/utils"),1),Y=require("@symbo.ls/utils/function.js"),bt=require("@symbo.ls/state"),P=require("css-in-props"),tt=require("@symbo.ls/css"),k=require("@symbo.ls/scratch"),C=require("attrs-in-props"),xs=require("./engineRegistry.js"),q=require("./cssLonghands.js"),W=require("./attributeFirst.js"),ws=require("./version.js");const So=(0,xs.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},ws.VERSION),Ct=[],et=new Set;let Jt=!1,Co=0,dt=null,vt=null;function lt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function vo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Fs=250,$s=1e3;function Is(){return vt&&(vt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||vo())?!0:lt()-Co>=$s}function Us(){if(Jt=!0,Co=lt(),vt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Kt,0);dt=t?()=>t(o):null;return}if(vo()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Kt,Fs);dt=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;vt=requestAnimationFrame;const o=requestAnimationFrame(Kt);dt=t?()=>t(o):null}}function It(){if(Jt){if(!Is())return;const t=dt;if(dt=null,t)try{t()}catch{}}Us()}const ko=300,jo=15e4;function Kt(){if(Jt=!1,dt=null,vt=null,et.size&&On(),!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=lt());const e=lt()-n.__mountFirstAttemptAt;n.__mountAttempts<=ko&&e<jo?(Ct.push(s),It()):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,bs.mountBridge)(s),typeof s.onMounted=="function"&&F("Mounted",s,s.__ref?.__mountOptions||{})}}}function mt(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,Ct.push(t),It())}function Eo(t,o){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,Y.runPluginHook)("contentUpdate",t,o);const s=t.context?.designSystem;s&&(0,k.pushConfig)(s);try{t.onContentUpdate(t,t.state,t.context,o)}catch(n){if(t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&(0,k.popConfig)()}}function Q(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Hs(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Vs(t){return t.toLowerCase()}function to(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],i=o[n];e&&i&&typeof e=="object"&&typeof i=="object"&&!Array.isArray(e)&&!Array.isArray(i)&&typeof e!="function"&&typeof i!="function"?s[n]=kt(e,i):s[n]=i}return s}function Ut(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Po(t,o,s){return Ut(t)||(o&&typeof o=="object"?Ut(o.key):void 0)||String(s)}function m(t,o,s,n={},e){const i=(0,E.getObserver)();if(i){(0,E.setObserver)(null);try{return m(t,o,s,n,e)}finally{(0,E.setObserver)(i)}}if(t==null||t===!1)return null;const a=ms(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Ut(s);const f=Ut(t.key),r=Object.create(null);r.key=s||f||`_${So.uniqId++}`,r.parent=o||null,r.context=t.context||o?.context||n.context||{},r.context.__create||(r.context.__create=m);const c=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};a&&(c.__runtimeSource=a);const l=t;if(t=Oo(r,t,s,f,o,n),r.if!=null){let d;if(typeof r.if=="function")try{d=r.if(r,r.state,r.context)}catch(h){if(d=!1,c.__ifError=h,typeof console<"u"&&console.warn){const y=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,h?.message||h)}}else d=r.if;c.__if=!!d}if(c.__if)typeof r.if=="function"&&(c.__ifInitialized=!0);else{o&&(o[r.key]=r);const d=Ks(t,s,r.context?.components);return d.length&&(c.__ifLateMerge={definition:l,key:s,ownKey:f,names:d,options:n}),typeof r.if=="function"&&Io(r,c,r.if),r}r.tag||(r.tag=(0,at.detectTag)(r)),F("Init",r,n);const u=r.node=(0,at.cacheNode)(r);if(!u)return r;if(r.tag==="fragment"){const h=(r.context?.document||globalThis.document).createComment("");u.appendChild(h),c.__fragmentAnchor=h}F("AttachNode",r,n),u.setAttribute&&r.key&&u.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))),u.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&u.setAttribute("data-smbls-app",r.context.key),r.id&&u.setAttribute&&(u.id=r.id),ys(r,n),Fo(r),io(r),is(r),po(r),ps(r),In(r);try{_s(r,n)}catch(d){if(typeof console<"u"&&console.error){const h=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,d?.message||d,d?.stack?`
1
+ "use strict";var Ps=Object.create;var Ft=Object.defineProperty;var Os=Object.getOwnPropertyDescriptor;var Ts=Object.getOwnPropertyNames;var Ls=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Ms=(t,o)=>{for(var s in o)Ft(t,s,{get:o[s],enumerable:!0})},wo=(t,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of Ts(o))!Ds.call(t,e)&&e!==s&&Ft(t,e,{get:()=>o[e],enumerable:!(n=Os(o,e))||n.enumerable});return t};var Rs=(t,o,s)=>(s=t!=null?Ps(Ls(t)):{},wo(o||!t||!t.__esModule?Ft(s,"default",{value:t,enumerable:!0}):s,t)),Ns=t=>wo(Ft({},"__esModule",{value:!0}),t);var Vn={};Ms(Vn,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>zt,acquireBeforeUpdateGuard:()=>Ss,create:()=>m,default:()=>Hn,flushMounts:()=>Kt,isStaticCssProp:()=>kn,recompileStaticCss:()=>jn,reconcileAttrProp:()=>En,releaseBeforeUpdateGuard:()=>Rt,resolveStyleBlock:()=>Wt,writeElementText:()=>Mt});module.exports=Ns(Vn);var U=require("@symbo.ls/signal"),E=require("@symbo.ls/signal"),ot=require("./cache.js"),V=require("./registry.js"),At=require("./delegate.js"),bs=require("./bridge.js"),Yt=require("./extends.js"),As=require("./methods.js"),Wn=require("./dispose.js"),at=require("./devRuntime.js"),G=require("./mountScheduler.js"),R=require("@symbo.ls/utils"),$t=Rs(require("@symbo.ls/utils"),1),Y=require("@symbo.ls/utils/function.js"),bt=require("@symbo.ls/state"),P=require("css-in-props"),tt=require("@symbo.ls/css"),k=require("@symbo.ls/scratch"),C=require("attrs-in-props"),xs=require("./engineRegistry.js"),q=require("./cssLonghands.js"),W=require("./attributeFirst.js"),ws=require("./version.js");const So=(0,xs.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},ws.VERSION),Ct=[],rt=new Set;let Jt=!1,Co=0,dt=null,vt=null;function lt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function vo(){return typeof document<"u"&&document.visibilityState==="hidden"}const Fs=250,$s=1e3;function Is(){return vt&&(vt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||vo())?!0:lt()-Co>=$s}function Us(){if(Jt=!0,Co=lt(),vt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Kt,0);dt=t?()=>t(o):null;return}if(vo()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(Kt,Fs);dt=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;vt=requestAnimationFrame;const o=requestAnimationFrame(Kt);dt=t?()=>t(o):null}}function It(){if(Jt){if(!Is())return;const t=dt;if(dt=null,t)try{t()}catch{}}Us()}const ko=300,jo=15e4;function Kt(){if(Jt=!1,dt=null,vt=null,rt.size&&On(),!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=lt());const e=lt()-n.__mountFirstAttemptAt;n.__mountAttempts<=ko&&e<jo?(Ct.push(s),It()):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,bs.mountBridge)(s),typeof s.onMounted=="function"&&F("Mounted",s,s.__ref?.__mountOptions||{})}}}function mt(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,Ct.push(t),It())}function Eo(t,o){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,Y.runPluginHook)("contentUpdate",t,o);const s=t.context?.designSystem;s&&(0,k.pushConfig)(s);try{t.onContentUpdate(t,t.state,t.context,o)}catch(n){if(t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&(0,k.popConfig)()}}function Q(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Hs(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Vs(t){return t.toLowerCase()}function to(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],i=o[n];e&&i&&typeof e=="object"&&typeof i=="object"&&!Array.isArray(e)&&!Array.isArray(i)&&typeof e!="function"&&typeof i!="function"?s[n]=kt(e,i):s[n]=i}return s}function Ut(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Po(t,o,s){return Ut(t)||(o&&typeof o=="object"?Ut(o.key):void 0)||String(s)}function m(t,o,s,n={},e){const i=(0,E.getObserver)();if(i){(0,E.setObserver)(null);try{return m(t,o,s,n,e)}finally{(0,E.setObserver)(i)}}if(t==null||t===!1)return null;const a=ms(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Ut(s);const f=Ut(t.key),r=Object.create(null);r.key=s||f||`_${So.uniqId++}`,r.parent=o||null,r.context=t.context||o?.context||n.context||{},r.context.__create||(r.context.__create=m);const c=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};a&&(c.__runtimeSource=a);const l=t;if(t=Oo(r,t,s,f,o,n),r.if!=null){let d;if(typeof r.if=="function")try{d=r.if(r,r.state,r.context)}catch(h){if(d=!1,c.__ifError=h,typeof console<"u"&&console.warn){const y=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,h?.message||h)}}else d=r.if;c.__if=!!d}if(c.__if)typeof r.if=="function"&&(c.__ifInitialized=!0);else{o&&(o[r.key]=r);const d=Ks(t,s,r.context?.components);return d.length&&(c.__ifLateMerge={definition:l,key:s,ownKey:f,names:d,options:n}),typeof r.if=="function"&&Io(r,c,r.if),r}r.tag||(r.tag=(0,ot.detectTag)(r)),F("Init",r,n);const u=r.node=(0,ot.adoptHydrationNode)(r)||(0,ot.cacheNode)(r);if(!u)return r;if(r.tag==="fragment"){const h=(r.context?.document||globalThis.document).createComment("");u.appendChild(h),c.__fragmentAnchor=h}F("AttachNode",r,n),u.setAttribute&&r.key&&u.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))),u.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&u.setAttribute("data-smbls-app",r.context.key),r.id&&u.setAttribute&&(u.id=r.id),ys(r,n),Fo(r),io(r),is(r),po(r),ps(r),In(r);try{_s(r,n)}catch(d){if(typeof console<"u"&&console.error){const h=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,d?.message||d,d?.stack?`
2
2
  `+d.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(Gt(r,!0),gs(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML){const d=r.context?.designSystem;d&&(0,k.pushConfig)(d);try{const h=r.html(r,r.state,r.context);h!=null&&typeof h!="function"&&(r.node.innerHTML=h)}catch{}finally{d&&(0,k.popConfig)()}}if(F("Create",r,n),F("Complete",r,n),F("Render",r,n),F("RenderRouter",r,n),mt(r,n),typeof r.onFrame=="function"){const d=r.onFrame,h=r.context?.designSystem,y=()=>{if(r.node){if(r.node.isConnected){h&&(0,k.pushConfig)(h);try{d(r,r.state,r.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{h&&(0,k.popConfig)()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return r}function Oo(t,o,s,n,e,i){if(s&&!o.extends&&!o.extend){const b=s.indexOf("_"),w=s.indexOf(".");let p=b>0?b:-1;if(w>0&&(p<0||w<p)&&(p=w),p>0){const _=s.substring(0,p),x=t.context?.components;x&&(x[_]||x["smbls."+_])?o={...o,extends:_}:x&&(0,ft.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 "${_}" but neither "${_}" nor "smbls.${_}" 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,Yt.applyExtends)(t,o,i);const a=(0,Yt.openMergeLayer)(t),f=a?a.rank:0,r=new Set(["childProps","attr","style","scope","data","vars"]),c=t.props&&typeof t.props=="object"?t.props:null;for(const b in o){if(b==="parent"||b==="node"||b==="__ref"||b==="extends"||b==="context"||b==="props")continue;if(b==="key"){n&&(t.key=n);continue}const w=o[b];a&&a.set(b,f);const p=t[b],_=p&&w&&typeof p=="object"&&typeof w=="object"&&!Array.isArray(p)&&!Array.isArray(w)&&typeof p!="function"&&typeof w!="function";_&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?t[b]=kt(p,w):_&&r.has(b)?t[b]={...p,...w}:_&&to(b)?t[b]=kt(p,w):t[b]=w}function l(b){for(const w in b){const p=b[w],_=t[w],x=_&&p&&typeof _=="object"&&typeof p=="object"&&!Array.isArray(_)&&!Array.isArray(p)&&typeof _!="function"&&typeof p!="function";x&&w.charCodeAt(0)>=65&&w.charCodeAt(0)<=90?t[w]=kt(_,p):x&&r.has(w)?t[w]={..._,...p}:x&&to(w)?t[w]=kt(_,p):t[w]=p}}if(c&&l(c),o.props&&typeof o.props=="object"&&(l(o.props),a))for(const b in o.props)a.set(b,f);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 u=t.scope&&typeof t.scope=="object"?t.scope:null,d=e?.scope,h=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,y=d||h||null;if(o.scope!==void 0||u){const b={};u&&Object.assign(b,u),o.scope!==void 0&&Object.assign(b,o.scope),t.scope=(0,U.createScopeStore)(b,y)}else y&&(t.scope=y);o.if!==void 0&&(t.if=o.if);const A=t.__ref,g=tn(t,A&&A.__runtimeSource);return A&&(A.__declaredArrays=g||void 0),(0,As.addMethods)(t),Ws(t,e,o,i),o}const Bs=new Set(["key","parent","context","__ref"]);function Gs(t,o){for(const e of Object.keys(t))Bs.has(e)||delete t[e];const s=(0,E.getObserver)();s&&(0,E.setObserver)(null);let n=o.definition;if(!n.extends&&!n.extend&&typeof o.key=="string"){const e=t.context?.components||{},i=e[o.key]||e["smbls."+o.key];i&&(n={...n,extends:i})}try{Oo(t,n,o.key,o.ownKey,t.parent,o.options)}finally{s&&(0,E.setObserver)(s)}}function Ks(t,o,s){const n=s||{},e=f=>!!(n[f]||n["smbls."+f]),i=[],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 f of a){if(typeof f!="string")continue;const r=f.includes(">")?f.split(">")[0].trim():f;e(r)||i.push(r)}return i}if(typeof o=="string"&&/^[A-Z]/.test(o)){let f=-1;const r=o.indexOf("_"),c=o.indexOf(".");r>0&&(f=r),c>0&&(f<0||c<f)&&(f=c);const l=f>0?o.substring(0,f):o;e(l)||i.push(l)}return i}function oo(t,o,s){if(typeof t.onStateInit!="function"&&!t.context?.plugins?.length)return;const n=t.state;t.state=o;try{F("StateInit",t,s)}finally{t.state=n}}function Ws(t,o,s,n){const e=!o,i=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&i&&t.context?.state,f=s.state!==void 0&&!a?s.state:t.state&&!(0,U.isStore)(t.state)?t.state:void 0;if(f==null){if(o?.state)t.state=o.state,(0,bt.applyStateMethods)(t,t.state);else if(t.context?.state){const r=t.context.state,c={...r},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=r.lang||l.defaultLang||"en",h=new Set,y=(b,w)=>{h.has(b)||(0,R.isPolyglotWritableKey)(u,b,c)&&(c[b]=w,h.add(b),(0,R.markPolyglotSeeded)(u,b,w))},A=l.translations[d];if(A&&typeof A=="object")for(const b in A)y(b,A[b]);const g=new Set(l.languages||[]);for(const b in l.translations)g.has(b)||y(b,l.translations[b])}(0,U.isStore)(c)||oo(t,c,n),t.state=(0,U.isStore)(c)?c:(0,U.createStore)(c),t.state.__element=t,t.state.root=t.state,(0,bt.applyStateMethods)(t,t.state),$t.promoteActiveRootState?.(r,t.state),F("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,bt.applyStateMethods)(t,t.state);return}if(typeof f=="string"){if(t.state=To(f,o),t.state&&typeof t.state=="object"&&!(0,U.isStore)(t.state)){const r=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:r,enumerable:!1,configurable:!0,writable:!0})}(0,bt.applyStateMethods)(t,t.state),F("StateCreated",t,n);return}if(typeof f=="function"){const r=f(t,o?.state);if((0,U.isStore)(r))t.state=r;else{const c=r||{};oo(t,c,n),t.state=(0,U.createStore)(c)}}else if((0,U.isStore)(f))t.state=f;else{const r={...f};oo(t,r,n),t.state=(0,U.createStore)(r)}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,bt.applyStateMethods)(t,t.state),$t.promoteActiveRootState?.(f,t.state),F("StateCreated",t,n)}function so(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 To(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")){const e=t.slice(3);return e?so(o.state,e):o.state??{}}if(t.startsWith("~/")){const e=o.state?.root||o.state,i=t.slice(2);return i?so(e,i):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=so(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",i=n.translations[e];if(i?.[t]!==void 0)return i[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const zs=new Set(["s","state","ctx","context"]);function Ys(t){try{const s=(typeof $t.getFunctionSource=="function"?$t.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function qs(t){if(typeof t!="function"||t.length!==2)return!1;const o=Ys(t);if(o.length<2)return!1;const s=o[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!zs.has(s)}function Zs(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(typeof t[f]!="function"||V.REGISTRY.has(f))continue;const r=f.charCodeAt(0);r>=65&&r<=90||Q(f)||P.CSS_PROPS_REGISTRY[f]||P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(f)||r!==45&&((0,C.checkAttributeByTagName)(s,f)||((0,ft.isLoudDevRuntime)()&&qs(t[f])&&console.warn(`[smbls] custom prop "${f}"${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('${f}', \u2026) instead of reading el.${f}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:f,fn:t[f]})))}for(let a=0;a<e.length;a++){const{prop:f,fn:r}=e[a];o.__exec[f]=r,Object.defineProperty(t,f,{get(){n&&(0,k.pushConfig)(n);try{return r(t,t.state,t.context)}catch{return}finally{n&&(0,k.popConfig)()}},set(c){delete o.__exec[f],Object.defineProperty(t,f,{value:c,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Qs(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 M(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return Qs(t,o),s.apply(this,n)}}function pt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function O(t,o){return()=>t.path.join(".")+"::"+o}const Lo=new Set;function N(t,o,s){if(!(0,ft.isLoudDevRuntime)())return;const n=O(t,o)();Lo.has(n)||(Lo.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Do=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,Xs=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;Do.lastIndex=0;let n;for(;(n=Do.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Js=(t,o)=>!Q(t)&&!(0,W.isCssProp)(o,t),no=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Js(t,n)&&Xs(o,s)},eo=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)?ct(t,o):t},Pt=(t,o)=>t&&o?ct(t,o):t||o||null,Mo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&jt(s,o)},ht=(t,o)=>Mo(t,o)?Et(t.__ref.__runtimeSource[o]):null,Ot=(t,o)=>(o&&t&&typeof t=="object"&&eo.set(t,o),t),ms=t=>{if(!t||typeof t!="object")return;const o=eo.get(t);return o&&eo.delete(t),o},ro=(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++)ro(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&&ro(e.value,o,s)}}},tn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(V.REGISTRY.has(n)||o&&jt(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),i=e&&e.value;if(!Array.isArray(i))continue;const a=new Set;ro(i,a,new Set),a.size&&(s||(s=new Map),s.set(i,a))}return s},Ro=(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 i=t.__ref;i.__authoredTemplates||(i.__authoredTemplates=new Set);for(const a of e)i.__authoredTemplates.add(a);return}},No=["attr","aria","data","metadata"],on=t=>{if(No.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},sn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const i=Object.getOwnPropertyDescriptor(t,e),a=i&&i.value,f=!!o&&jt(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!on(e))continue;const r=f?o[e]:null,c=r&&typeof r=="object"?r:null,l=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const d=f&&(!c||jt(c,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&No.includes(u)){for(const y in h)no(y,h[y],s,n,d);continue}no(u,h,s,n,d)}continue}no(e,a,s,n,f)}return s};function Fo(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=sn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const r of e)s.__authoredTemplates.add(r);else s.__authoredTemplates=e;if(Zs(t),typeof t.text=="function"){const r=t.text,c=M(t,t.textDeps,r),l=(0,E.createEffect)(()=>{if(!s.contentManaged)try{let u=c(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),Mt(t,u))}catch(u){N(s,"text",u)}},{depth:s.path.length,label:O(s,"text")});s.__effects.push(l),s.__exec.text=r}else if(typeof t.text=="string"&&t.text.includes("{{")){const r=t.text,c=(0,E.createEffect)(()=>{if(s.contentManaged)return;const l=R.replaceLiteralsWithObjectFields.call(t,r,t.state);l!=null&&(t.text=l),t.node&&Mt(t,l??"")},{depth:s.path.length,label:O(s,"text")});s.__effects.push(c),s.__exec.text=r}const i=t.tag||"div";for(const r of Object.keys(t))if(typeof t[r]=="function"&&!V.REGISTRY.has(r)&&!Q(r)&&!s.__exec[r]&&!(0,W.isAttributeFirst)(i,r)){if(P.CSS_PROPS_REGISTRY[r]){const c=t[r],l=M(t,t[r+"Deps"],c),u=r;let d,h=null,y=null,A;const g=(0,E.createEffect)(()=>{const b=t.context?.designSystem;b&&(0,k.pushConfig)(b);try{const w=l(t,t.state,t.context);(0,P.pushStaticCssPass)();let p;try{p=P.CSS_PROPS_REGISTRY[u](w,t,t.state,t.context)}finally{(0,P.popStaticCssPass)()}if(Array.isArray(p)){const x={};for(const S of p)if(S)for(const j in S)x[j]=S[j];p=x}const _=u==="show"||u==="hide";if(p&&t.node&&nn(p)){const x=Tt(p);if(x===null||x!==A){A=x;const S=(0,tt.css)(p,null,t.context?.cssPrefix),j=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(y)for(const v of y)t.node.classList.remove(v);if(j&&j.length)for(const v of j)t.node.classList.add(v);y=j}}d=void 0,h=null}else if(p&&t.node){if(y){for(const S of y)t.node.classList.remove(S);y=null,A=void 0}const x=Tt(p);if(x===null||x!==d||!_t(t.node,h)){d=x;const S=Ko(t,p);h=yt(t.node,S)}}else t.node&&_&&(d=void 0,h=null,t.node.style.display="")}finally{b&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,u)});s.__effects.push(g),s.__exec[r]=c}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(r)){const c=t[r],l=M(t,t[r+"Deps"],c),u=r;let d,h=null;const y=(0,E.createEffect)(()=>{const A=t.context?.designSystem;A&&(0,k.pushConfig)(A);try{const g=l(t,t.state,t.context);if(t.node)if(g!=null){const b=u+":"+String(g);if(b!==d||!_t(t.node,h)){d=b;const w={[u]:g},p=Ko(t,w);h=yt(t.node,p)}}else d=void 0,h=null,t.node.style[u]=""}finally{A&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,u)});s.__effects.push(y),s.__exec[r]=c}else if(r.charCodeAt(0)===45){const c=t[r];Bo(t,r,c,t[r+"Deps"],r),s.__exec[r]=c}}if(en(t),typeof t.html=="function"){const r=t.html,c=M(t,t.htmlDeps,r),l=(0,E.createEffect)(()=>{const u=t.context?.designSystem;u&&(0,k.pushConfig)(u);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{u&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,"html")});s.__effects.push(l),s.__exec.html=r}if(typeof t.value=="function"){const r=t.value,c=M(t,t.valueDeps,r),l=(0,E.createEffect)(()=>{try{let u=c(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),Uo(t,u)}catch(u){N(s,"value",u)}},{depth:s.path.length,label:O(s,"value")});s.__effects.push(l),s.__exec.value=r}else if(typeof t.value=="string"&&t.value.includes("{{")){const r=t.value,c=(0,E.createEffect)(()=>{try{Uo(t,R.replaceLiteralsWithObjectFields.call(t,r,t.state))}catch(l){N(s,"value",l)}},{depth:s.path.length,label:O(s,"value")});s.__effects.push(c),s.__exec.value=r}if(typeof t.style=="function"){const r=t.style,c=M(t,t.styleDeps,r);let l,u=null;const d=(0,E.createEffect)(()=>{const h=Wt(t,c(t,t.state,t.context)),y=Tt(h);(y===null||y!==l||!_t(t.node,u))&&(l=y,Ht(t.node,u,h),J(t.node,h),u=yt(t.node,h))},{depth:s.path.length,label:O(s,"style")});s.__effects.push(d),s.__exec.style=r}else if(t.style&&typeof t.style=="object")for(const r in t.style){const c=t.style[r];if(typeof c!="function")continue;const l=M(t,pt(t.styleDeps,r),c);let u,d=null;const h=(0,E.createEffect)(()=>{try{const y=l(t,t.state,t.context);if(t.node){const A=r+":"+String(y);if(A!==u||!_t(t.node,d)){u=A;const g=Wt(t,{[r]:y});Ht(t.node,d,Object.assign({},g,{[r]:""})),J(t.node,g),d=yt(t.node,g)}}}catch(y){N(s,"style."+r,y)}},{depth:s.path.length,label:O(s,"style."+r)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const r in t.attr)if(typeof t.attr[r]=="function"){const c=M(t,pt(t.attrDeps,r),t.attr[r]),l=r,u=(0,E.createEffect)(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!(0,C.isEnumeratedTrueFalseAttr)(l)?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(l,(0,C.serializeAttrValue)(l,d)))}catch(d){N(s,"attr."+l,d)}},{depth:s.path.length,label:O(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[r]=="string"&&t.attr[r].includes("{{")){const c=t.attr[r],l=r,u=(0,E.createEffect)(()=>{try{const d=R.replaceLiteralsWithObjectFields.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,(0,C.serializeAttrValue)(l,d??""))}catch(d){N(s,"attr."+l,d)}},{depth:s.path.length,label:O(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="string"&&c.includes("{{")){const h=c,y="aria-"+r.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),A=(0,E.createEffect)(()=>{try{const g=R.replaceLiteralsWithObjectFields.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,(0,C.serializeAttrValue)(y,g??""))}catch(g){N(s,"aria."+r,g)}},{depth:s.path.length,label:O(s,"aria."+r)});A._attrName=y,s.__effects.push(A);continue}if(typeof c!="function")continue;const l=M(t,pt(t.ariaDeps,r),t.aria[r]),u="aria-"+r.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=(0,E.createEffect)(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;h==null?t.node.removeAttribute(u):typeof h!="function"&&typeof h!="object"&&t.node.setAttribute(u,(0,C.serializeAttrValue)(u,h))}catch(h){N(s,"aria."+r,h)}},{depth:s.path.length,label:O(s,"aria."+r)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const r in t.data){const c=t.data[r];if(typeof c=="string"&&c.includes("{{")){const y=c,A="data-"+r.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),g=(0,E.createEffect)(()=>{try{const b=R.replaceLiteralsWithObjectFields.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(A,b??"")}catch(b){N(s,"data."+r,b)}},{depth:s.path.length,label:O(s,"data."+r)});g._attrName=A,s.__effects.push(g);continue}if(typeof c!="function")continue;const l=M(t,pt(t.dataDeps,r),t.data[r]),d="data-"+r.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),h=(0,E.createEffect)(()=>{try{const y=l(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null||y===!1?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(d,y===!0?"":y)}catch(y){N(s,"data."+r,y)}},{depth:s.path.length,label:O(s,"data."+r)});h._attrName=d,s.__effects.push(h)}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 r in a){if(typeof a[r]!="function")continue;const c=M(t,pt(t.classDeps,r),a[r]),l=(0,E.createEffect)(()=>{try{const u=c(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(r):t.node.classList.remove(r)}catch(u){N(s,"class."+r,u)}},{depth:s.path.length,label:O(s,"class."+r)});s.__effects.push(l)}!n&&typeof t.if=="function"&&Io(t,s,t.if);for(const r of Object.keys(t)){if(V.REGISTRY.has(r)||typeof t[r]!="function")continue;const c=r.charCodeAt(0);if(c>=65&&c<=90||Q(r))continue;const l=t[r];s.__exec[r]=l;const u=t.tag||"div";if((0,C.checkAttributeByTagName)(u,r)&&!(0,W.isCssProp)(u,r)){const d=(0,C.camelToAttr)(r)||r,h=M(t,t[r+"Deps"],l),y=(0,E.createEffect)(()=>{try{let A=h(t,t.state,t.context);typeof A=="string"&&A.includes("{{")&&(A=R.replaceLiteralsWithObjectFields.call(t,A,t.state)),t.node?.setAttribute&&(A==null||A===!1&&!(0,C.isEnumeratedTrueFalseAttr)(d)?t.node.removeAttribute(d):typeof A!="function"&&typeof A!="object"&&(d==="src"&&"src"in t.node?t.node.src=A:t.node.setAttribute(d,(0,C.serializeAttrValue)(d,A))))}catch(A){N(s,r,A)}},{depth:s.path.length,label:O(s,r)});y._attrName=d.toLowerCase(),s.__effects.push(y)}}const f=t.tag||"div";for(const r of Object.keys(t)){if(V.REGISTRY.has(r))continue;const c=t[r];if(typeof c!="string"||!c.includes("{{"))continue;const l=r.charCodeAt(0);if(l>=65&&l<=90||Q(r)||(0,W.isCssProp)(f,r)||C.ATTR_TRANSFORMS[r]||!(0,C.checkAttributeByTagName)(f,r))continue;const u=(0,C.camelToAttr)(r)||r,d=(0,E.createEffect)(()=>{try{const h=R.replaceLiteralsWithObjectFields.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,C.serializeAttrValue)(u,h??""))}catch(h){N(s,r,h)}},{depth:s.path.length,label:O(s,r)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(ln(t),wn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const r=t.onStateUpdate,c=t.stateDeps;let l=!1,u=[];const d=(0,E.createEffect)(()=>{const h=[];for(let b=0;b<c.length;b++){const w=c[b];try{h[b]=typeof w=="function"?w(t,t.state,t.context):t.state?.[w]}catch{h[b]=void 0}}if(!l){l=!0,u=h;return}let y=h.length!==u.length;for(let b=0;!y&&b<h.length;b++)h[b]!==u[b]&&(y=!0);const A=u;if(u=h,!y)return;const g=t.context?.designSystem;g&&(0,k.pushConfig)(g);try{r(t,t.state,t.context,{prev:A,next:h})}catch(b){if(t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onStateUpdate",error:b})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',b),t.context?.strictMode)throw b}finally{g&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,"onStateUpdate")});s.__effects.push(d)}_n(t)}function $o(t){const o=t.parent,s=o?.node;if(!s||!t.node){gs(t,t.parent);return}let n=null;const e=Object.keys(o),i=e.indexOf(t.key);for(let a=i+1;a<e.length;a++){const f=o[e[a]];if(f?.node?.parentNode===s){n=f.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Io(t,o,s){let n=M(t,t.ifDeps,s);const e=(0,E.createEffect)(()=>{const i=!o.__ifInitialized&&o.__ifLateMerge;if(i){const r=t.context?.components||{};i.names.some(c=>r[c]||r["smbls."+c])&&(o.__ifLateMerge=null,Gs(t,i),n=M(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(r){if(a=!1,o.__ifError=r,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,r?.message||r)}return}const f=o.__if;if(o.__if=!!a,f&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(r){console.error("[smbls] onRemove error:",r)}}else if(!f&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,at.cacheNode)(t)),t.node&&(t.node.ref=t),$o(t),io(t),po(t),F("Render",t,{}),mt(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,at.detectTag)(t)),F("Init",t,{}),t.node||(t.node=(0,at.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 c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),o.__fragmentAnchor=c}F("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,{}),Fo(t,{skipIfEffect:!0}),io(t),is(t),po(t),ps(t),_s(t,{}),$o(t),F("Create",t,{}),F("Complete",t,{}),F("Render",t,{}),F("RenderRouter",t,{}),mt(t,{})}},{depth:o.path.length,label:O(o,"if")});o.__effects.push(e)}function Mt(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 i=e?e.__textNode:null;if(i&&i.parentNode!==s&&(i=null),!i){const a=s.firstChild;a&&a.nodeType===3&&(i=a)}i?i.nodeValue!==n&&(i.nodeValue=n):s.firstChild?(i=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(i,s.firstChild)):(s.textContent=n,i=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),e&&(e.__textNode=i||null)}function Uo(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,i=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&i!=null&&a!=null)try{s.setSelectionRange(i,a)}catch{}const f=t.__ref&&t.__ref.__autoGrow;f&&f.active&&f.resize()}function io(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Mt(t,t.text),rs(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,Wt(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,C.isEnumeratedTrueFalseAttr)(s)||o.setAttribute&&o.setAttribute(s,(0,C.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 Tt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function nn(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 yt(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=X(e);n.push(a,co(s,a),Ho(s,a))}return n}function co(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function Ho(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function X(t){return rt(t)?t:t.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}function Ht(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 i in s)s[i]==null||i.charAt(0)==="&"||e.add(X(i));for(let i=0;i<o.length;i+=3){const a=o[i];e.has(a)||co(n,a)===o[i+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function _t(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(co(s,o[n])!==o[n+1]||Ho(s,o[n])!==o[n+2])return!1;return!0}const rt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,Vo=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",Vt=t=>rt(t)?t:"--"+t;function Bt(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)}Vo(e)&&(s||(s={}),s[Vt(n)]=e)}return s}function Bo(t,o,s,n,e){const i=t.__ref,a=M(t,n,s);let f,r=null;const c=(0,E.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,k.pushConfig)(l);try{const u=a(t,t.state,t.context),d=t.node;if(!d||!d.style)return;if(!Vo(u)){Ht(d,r,null),f=void 0,r=null;return}const h=String(u);if(h!==f||!_t(d,r)){f=h;const y={[o]:u};J(d,y),r=yt(d,y)}}catch(u){N(i,e,u)}finally{l&&(0,k.popConfig)()}},{depth:i.path.length,label:O(i,e)});i.__effects.push(c)}function en(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){rn(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"||Bo(t,Vt(n),e,pt(t.varsDeps,n),"vars."+n)}}function rn(t,o){const s=t.__ref,n=M(t,t.varsDeps,o);let e,i=null;const a=(0,E.createEffect)(()=>{const f=t.context?.designSystem;f&&(0,k.pushConfig)(f);try{const r=Bt(n(t,t.state,t.context)),c=t.node;if(!c||!c.style)return;const l=Tt(r);(l===null||l!==e||!_t(c,i))&&(e=l,Ht(c,i,r),r&&J(c,r),i=r?yt(c,r):null,s.__varsInline=r?new Set(Object.keys(r)):null)}catch(r){N(s,"vars",r)}finally{f&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,"vars")});s.__effects.push(a)}function fo(t,o){if(typeof t[o]=="function"&&((0,W.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!rt(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"&&Vt(n)===o)return!0;return!1}function cn(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(X(s)));return o}function fn(t,o,s,n){const e=t.__ref;if(!e)return;let i=null;if(s)for(const a of s){if(n&&n.has(a))continue;const f=o[a];if(f==null||typeof f=="object")continue;const r=X(a);q.CSS_LONGHAND_SHORTHANDS[r]&&(i||(i={}),i[r]=f)}e.__declaredLonghands=i}function Go(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const i in n){if(o.has(i))continue;const a=q.CSS_LONGHAND_SHORTHANDS[i];let f=!1;for(let r=0;r<a.length;r++)if(o.has(a[r])){f=!0;break}f&&(e||(e={}),e[i]=n[i])}return e}function Ko(t,o){const s=t.node;J(s,o);const n=cn(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 i=Go(t,n);return i?(J(s,i),Object.assign({},o,i)):o}function an(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=Go(t,o.__inlineCssKeys);s&&J(t.node,s)}function Wt(t,o){if(!o||typeof o!="object")return o;const s=t&&t.context&&t.context.designSystem;s&&(0,k.pushConfig)(s);try{return(0,P.resolveStyleBlockTokens)(o,t)}catch{return o}finally{s&&(0,k.popConfig)()}}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 i=String(e),a=rt(n)?n:n.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),f=i.trim(),r=/\s*!important\s*$/.test(f),c=f.replace(/\s*!important\s*$/,"");t.style.setProperty(a,c,r?"important":"")}catch{}}}s&&un(t,s)}function un(t,o){const s=`_ds${So.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 i="";for(const a in o){const f="."+s,r=a.replace(/&/g,f).split(",").map(l=>{const u=l.trim();return u.includes(f)?u:f+u}).join(", "),c=o[a];if(typeof c=="object"){let l="",u="";for(const d in c){const h=c[d];if(typeof h=="object"){const y=d.includes("&")?r.split(", ").map(g=>d.replace(/&/g,g)).join(", "):r.split(", ").map(g=>`${g} ${d}`).join(", ");let A="";for(const g in h)A+=`${X(g)}: ${h[g]};`;u+=(0,tt.wrapHoverRule)(`${y} { ${A} }`,y)+`
4
+ `):"")}}if(Gt(r,!0),gs(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML){const d=r.context?.designSystem;d&&(0,k.pushConfig)(d);try{const h=r.html(r,r.state,r.context);h!=null&&typeof h!="function"&&(r.node.innerHTML=h)}catch{}finally{d&&(0,k.popConfig)()}}if(F("Create",r,n),F("Complete",r,n),F("Render",r,n),F("RenderRouter",r,n),mt(r,n),typeof r.onFrame=="function"){const d=r.onFrame,h=r.context?.designSystem,y=()=>{if(r.node){if(r.node.isConnected){h&&(0,k.pushConfig)(h);try{d(r,r.state,r.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{h&&(0,k.popConfig)()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return r}function Oo(t,o,s,n,e,i){if(s&&!o.extends&&!o.extend){const b=s.indexOf("_"),w=s.indexOf(".");let p=b>0?b:-1;if(w>0&&(p<0||w<p)&&(p=w),p>0){const _=s.substring(0,p),x=t.context?.components;x&&(x[_]||x["smbls."+_])?o={...o,extends:_}:x&&(0,at.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 "${_}" but neither "${_}" nor "smbls.${_}" 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,Yt.applyExtends)(t,o,i);const a=(0,Yt.openMergeLayer)(t),f=a?a.rank:0,r=new Set(["childProps","attr","style","scope","data","vars"]),c=t.props&&typeof t.props=="object"?t.props:null;for(const b in o){if(b==="parent"||b==="node"||b==="__ref"||b==="extends"||b==="context"||b==="props")continue;if(b==="key"){n&&(t.key=n);continue}const w=o[b];a&&a.set(b,f);const p=t[b],_=p&&w&&typeof p=="object"&&typeof w=="object"&&!Array.isArray(p)&&!Array.isArray(w)&&typeof p!="function"&&typeof w!="function";_&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?t[b]=kt(p,w):_&&r.has(b)?t[b]={...p,...w}:_&&to(b)?t[b]=kt(p,w):t[b]=w}function l(b){for(const w in b){const p=b[w],_=t[w],x=_&&p&&typeof _=="object"&&typeof p=="object"&&!Array.isArray(_)&&!Array.isArray(p)&&typeof _!="function"&&typeof p!="function";x&&w.charCodeAt(0)>=65&&w.charCodeAt(0)<=90?t[w]=kt(_,p):x&&r.has(w)?t[w]={..._,...p}:x&&to(w)?t[w]=kt(_,p):t[w]=p}}if(c&&l(c),o.props&&typeof o.props=="object"&&(l(o.props),a))for(const b in o.props)a.set(b,f);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 u=t.scope&&typeof t.scope=="object"?t.scope:null,d=e?.scope,h=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,y=d||h||null;if(o.scope!==void 0||u){const b={};u&&Object.assign(b,u),o.scope!==void 0&&Object.assign(b,o.scope),t.scope=(0,U.createScopeStore)(b,y)}else y&&(t.scope=y);o.if!==void 0&&(t.if=o.if);const A=t.__ref,g=tn(t,A&&A.__runtimeSource);return A&&(A.__declaredArrays=g||void 0),(0,As.addMethods)(t),Ws(t,e,o,i),o}const Bs=new Set(["key","parent","context","__ref"]);function Gs(t,o){for(const e of Object.keys(t))Bs.has(e)||delete t[e];const s=(0,E.getObserver)();s&&(0,E.setObserver)(null);let n=o.definition;if(!n.extends&&!n.extend&&typeof o.key=="string"){const e=t.context?.components||{},i=e[o.key]||e["smbls."+o.key];i&&(n={...n,extends:i})}try{Oo(t,n,o.key,o.ownKey,t.parent,o.options)}finally{s&&(0,E.setObserver)(s)}}function Ks(t,o,s){const n=s||{},e=f=>!!(n[f]||n["smbls."+f]),i=[],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 f of a){if(typeof f!="string")continue;const r=f.includes(">")?f.split(">")[0].trim():f;e(r)||i.push(r)}return i}if(typeof o=="string"&&/^[A-Z]/.test(o)){let f=-1;const r=o.indexOf("_"),c=o.indexOf(".");r>0&&(f=r),c>0&&(f<0||c<f)&&(f=c);const l=f>0?o.substring(0,f):o;e(l)||i.push(l)}return i}function oo(t,o,s){if(typeof t.onStateInit!="function"&&!t.context?.plugins?.length)return;const n=t.state;t.state=o;try{F("StateInit",t,s)}finally{t.state=n}}function Ws(t,o,s,n){const e=!o,i=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&i&&t.context?.state,f=s.state!==void 0&&!a?s.state:t.state&&!(0,U.isStore)(t.state)?t.state:void 0;if(f==null){if(o?.state)t.state=o.state,(0,bt.applyStateMethods)(t,t.state);else if(t.context?.state){const r=t.context.state,c={...r},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=r.lang||l.defaultLang||"en",h=new Set,y=(b,w)=>{h.has(b)||(0,R.isPolyglotWritableKey)(u,b,c)&&(c[b]=w,h.add(b),(0,R.markPolyglotSeeded)(u,b,w))},A=l.translations[d];if(A&&typeof A=="object")for(const b in A)y(b,A[b]);const g=new Set(l.languages||[]);for(const b in l.translations)g.has(b)||y(b,l.translations[b])}(0,U.isStore)(c)||oo(t,c,n),t.state=(0,U.isStore)(c)?c:(0,U.createStore)(c),t.state.__element=t,t.state.root=t.state,(0,bt.applyStateMethods)(t,t.state),$t.promoteActiveRootState?.(r,t.state),F("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,bt.applyStateMethods)(t,t.state);return}if(typeof f=="string"){if(t.state=To(f,o),t.state&&typeof t.state=="object"&&!(0,U.isStore)(t.state)){const r=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:r,enumerable:!1,configurable:!0,writable:!0})}(0,bt.applyStateMethods)(t,t.state),F("StateCreated",t,n);return}if(typeof f=="function"){const r=f(t,o?.state);if((0,U.isStore)(r))t.state=r;else{const c=r||{};oo(t,c,n),t.state=(0,U.createStore)(c)}}else if((0,U.isStore)(f))t.state=f;else{const r={...f};oo(t,r,n),t.state=(0,U.createStore)(r)}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,bt.applyStateMethods)(t,t.state),$t.promoteActiveRootState?.(f,t.state),F("StateCreated",t,n)}function so(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 To(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")){const e=t.slice(3);return e?so(o.state,e):o.state??{}}if(t.startsWith("~/")){const e=o.state?.root||o.state,i=t.slice(2);return i?so(e,i):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=so(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",i=n.translations[e];if(i?.[t]!==void 0)return i[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const zs=new Set(["s","state","ctx","context"]);function Ys(t){try{const s=(typeof $t.getFunctionSource=="function"?$t.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function qs(t){if(typeof t!="function"||t.length!==2)return!1;const o=Ys(t);if(o.length<2)return!1;const s=o[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!zs.has(s)}function Zs(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(typeof t[f]!="function"||V.REGISTRY.has(f))continue;const r=f.charCodeAt(0);r>=65&&r<=90||Q(f)||P.CSS_PROPS_REGISTRY[f]||P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(f)||r!==45&&((0,C.checkAttributeByTagName)(s,f)||((0,at.isLoudDevRuntime)()&&qs(t[f])&&console.warn(`[smbls] custom prop "${f}"${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('${f}', \u2026) instead of reading el.${f}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:f,fn:t[f]})))}for(let a=0;a<e.length;a++){const{prop:f,fn:r}=e[a];o.__exec[f]=r,Object.defineProperty(t,f,{get(){n&&(0,k.pushConfig)(n);try{return r(t,t.state,t.context)}catch{return}finally{n&&(0,k.popConfig)()}},set(c){delete o.__exec[f],Object.defineProperty(t,f,{value:c,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Qs(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 M(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return Qs(t,o),s.apply(this,n)}}function pt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function O(t,o){return()=>t.path.join(".")+"::"+o}const Lo=new Set;function N(t,o,s){if(!(0,at.isLoudDevRuntime)())return;const n=O(t,o)();Lo.has(n)||(Lo.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Do=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,Xs=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;Do.lastIndex=0;let n;for(;(n=Do.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Js=(t,o)=>!Q(t)&&!(0,W.isCssProp)(o,t),no=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Js(t,n)&&Xs(o,s)},eo=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)?ft(t,o):t},Pt=(t,o)=>t&&o?ft(t,o):t||o||null,Mo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&jt(s,o)},ht=(t,o)=>Mo(t,o)?Et(t.__ref.__runtimeSource[o]):null,Ot=(t,o)=>(o&&t&&typeof t=="object"&&eo.set(t,o),t),ms=t=>{if(!t||typeof t!="object")return;const o=eo.get(t);return o&&eo.delete(t),o},ro=(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++)ro(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&&ro(e.value,o,s)}}},tn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(V.REGISTRY.has(n)||o&&jt(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),i=e&&e.value;if(!Array.isArray(i))continue;const a=new Set;ro(i,a,new Set),a.size&&(s||(s=new Map),s.set(i,a))}return s},Ro=(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 i=t.__ref;i.__authoredTemplates||(i.__authoredTemplates=new Set);for(const a of e)i.__authoredTemplates.add(a);return}},No=["attr","aria","data","metadata"],on=t=>{if(No.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},sn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const i=Object.getOwnPropertyDescriptor(t,e),a=i&&i.value,f=!!o&&jt(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!on(e))continue;const r=f?o[e]:null,c=r&&typeof r=="object"?r:null,l=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const d=f&&(!c||jt(c,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&No.includes(u)){for(const y in h)no(y,h[y],s,n,d);continue}no(u,h,s,n,d)}continue}no(e,a,s,n,f)}return s};function Fo(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=sn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const r of e)s.__authoredTemplates.add(r);else s.__authoredTemplates=e;if(Zs(t),typeof t.text=="function"){const r=t.text,c=M(t,t.textDeps,r),l=(0,E.createEffect)(()=>{if(!s.contentManaged)try{let u=c(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),Mt(t,u))}catch(u){N(s,"text",u)}},{depth:s.path.length,label:O(s,"text")});s.__effects.push(l),s.__exec.text=r}else if(typeof t.text=="string"&&t.text.includes("{{")){const r=t.text,c=(0,E.createEffect)(()=>{if(s.contentManaged)return;const l=R.replaceLiteralsWithObjectFields.call(t,r,t.state);l!=null&&(t.text=l),t.node&&Mt(t,l??"")},{depth:s.path.length,label:O(s,"text")});s.__effects.push(c),s.__exec.text=r}const i=t.tag||"div";for(const r of Object.keys(t))if(typeof t[r]=="function"&&!V.REGISTRY.has(r)&&!Q(r)&&!s.__exec[r]&&!(0,W.isAttributeFirst)(i,r)){if(P.CSS_PROPS_REGISTRY[r]){const c=t[r],l=M(t,t[r+"Deps"],c),u=r;let d,h=null,y=null,A;const g=(0,E.createEffect)(()=>{const b=t.context?.designSystem;b&&(0,k.pushConfig)(b);try{const w=l(t,t.state,t.context);(0,P.pushStaticCssPass)();let p;try{p=P.CSS_PROPS_REGISTRY[u](w,t,t.state,t.context)}finally{(0,P.popStaticCssPass)()}if(Array.isArray(p)){const x={};for(const S of p)if(S)for(const j in S)x[j]=S[j];p=x}const _=u==="show"||u==="hide";if(p&&t.node&&nn(p)){const x=Tt(p);if(x===null||x!==A){A=x;const S=(0,tt.css)(p,null,t.context?.cssPrefix),j=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(y)for(const v of y)t.node.classList.remove(v);if(j&&j.length)for(const v of j)t.node.classList.add(v);y=j}}d=void 0,h=null}else if(p&&t.node){if(y){for(const S of y)t.node.classList.remove(S);y=null,A=void 0}const x=Tt(p);if(x===null||x!==d||!_t(t.node,h)){d=x;const S=Ko(t,p);h=yt(t.node,S)}}else t.node&&_&&(d=void 0,h=null,t.node.style.display="")}finally{b&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,u)});s.__effects.push(g),s.__exec[r]=c}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(r)){const c=t[r],l=M(t,t[r+"Deps"],c),u=r;let d,h=null;const y=(0,E.createEffect)(()=>{const A=t.context?.designSystem;A&&(0,k.pushConfig)(A);try{const g=l(t,t.state,t.context);if(t.node)if(g!=null){const b=u+":"+String(g);if(b!==d||!_t(t.node,h)){d=b;const w={[u]:g},p=Ko(t,w);h=yt(t.node,p)}}else d=void 0,h=null,t.node.style[u]=""}finally{A&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,u)});s.__effects.push(y),s.__exec[r]=c}else if(r.charCodeAt(0)===45){const c=t[r];Bo(t,r,c,t[r+"Deps"],r),s.__exec[r]=c}}if(en(t),typeof t.html=="function"){const r=t.html,c=M(t,t.htmlDeps,r),l=(0,E.createEffect)(()=>{const u=t.context?.designSystem;u&&(0,k.pushConfig)(u);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{u&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,"html")});s.__effects.push(l),s.__exec.html=r}if(typeof t.value=="function"){const r=t.value,c=M(t,t.valueDeps,r),l=(0,E.createEffect)(()=>{try{let u=c(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=R.replaceLiteralsWithObjectFields.call(t,u,t.state)),Uo(t,u)}catch(u){N(s,"value",u)}},{depth:s.path.length,label:O(s,"value")});s.__effects.push(l),s.__exec.value=r}else if(typeof t.value=="string"&&t.value.includes("{{")){const r=t.value,c=(0,E.createEffect)(()=>{try{Uo(t,R.replaceLiteralsWithObjectFields.call(t,r,t.state))}catch(l){N(s,"value",l)}},{depth:s.path.length,label:O(s,"value")});s.__effects.push(c),s.__exec.value=r}if(typeof t.style=="function"){const r=t.style,c=M(t,t.styleDeps,r);let l,u=null;const d=(0,E.createEffect)(()=>{const h=Wt(t,c(t,t.state,t.context)),y=Tt(h);(y===null||y!==l||!_t(t.node,u))&&(l=y,Ht(t.node,u,h),J(t.node,h),u=yt(t.node,h))},{depth:s.path.length,label:O(s,"style")});s.__effects.push(d),s.__exec.style=r}else if(t.style&&typeof t.style=="object")for(const r in t.style){const c=t.style[r];if(typeof c!="function")continue;const l=M(t,pt(t.styleDeps,r),c);let u,d=null;const h=(0,E.createEffect)(()=>{try{const y=l(t,t.state,t.context);if(t.node){const A=r+":"+String(y);if(A!==u||!_t(t.node,d)){u=A;const g=Wt(t,{[r]:y});Ht(t.node,d,Object.assign({},g,{[r]:""})),J(t.node,g),d=yt(t.node,g)}}}catch(y){N(s,"style."+r,y)}},{depth:s.path.length,label:O(s,"style."+r)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const r in t.attr)if(typeof t.attr[r]=="function"){const c=M(t,pt(t.attrDeps,r),t.attr[r]),l=r,u=(0,E.createEffect)(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!(0,C.isEnumeratedTrueFalseAttr)(l)?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(l,(0,C.serializeAttrValue)(l,d)))}catch(d){N(s,"attr."+l,d)}},{depth:s.path.length,label:O(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[r]=="string"&&t.attr[r].includes("{{")){const c=t.attr[r],l=r,u=(0,E.createEffect)(()=>{try{const d=R.replaceLiteralsWithObjectFields.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,(0,C.serializeAttrValue)(l,d??""))}catch(d){N(s,"attr."+l,d)}},{depth:s.path.length,label:O(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="string"&&c.includes("{{")){const h=c,y="aria-"+r.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),A=(0,E.createEffect)(()=>{try{const g=R.replaceLiteralsWithObjectFields.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,(0,C.serializeAttrValue)(y,g??""))}catch(g){N(s,"aria."+r,g)}},{depth:s.path.length,label:O(s,"aria."+r)});A._attrName=y,s.__effects.push(A);continue}if(typeof c!="function")continue;const l=M(t,pt(t.ariaDeps,r),t.aria[r]),u="aria-"+r.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=(0,E.createEffect)(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;h==null?t.node.removeAttribute(u):typeof h!="function"&&typeof h!="object"&&t.node.setAttribute(u,(0,C.serializeAttrValue)(u,h))}catch(h){N(s,"aria."+r,h)}},{depth:s.path.length,label:O(s,"aria."+r)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const r in t.data){const c=t.data[r];if(typeof c=="string"&&c.includes("{{")){const y=c,A="data-"+r.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),g=(0,E.createEffect)(()=>{try{const b=R.replaceLiteralsWithObjectFields.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(A,b??"")}catch(b){N(s,"data."+r,b)}},{depth:s.path.length,label:O(s,"data."+r)});g._attrName=A,s.__effects.push(g);continue}if(typeof c!="function")continue;const l=M(t,pt(t.dataDeps,r),t.data[r]),d="data-"+r.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),h=(0,E.createEffect)(()=>{try{const y=l(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null||y===!1?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(d,y===!0?"":y)}catch(y){N(s,"data."+r,y)}},{depth:s.path.length,label:O(s,"data."+r)});h._attrName=d,s.__effects.push(h)}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 r in a){if(typeof a[r]!="function")continue;const c=M(t,pt(t.classDeps,r),a[r]),l=(0,E.createEffect)(()=>{try{const u=c(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(r):t.node.classList.remove(r)}catch(u){N(s,"class."+r,u)}},{depth:s.path.length,label:O(s,"class."+r)});s.__effects.push(l)}!n&&typeof t.if=="function"&&Io(t,s,t.if);for(const r of Object.keys(t)){if(V.REGISTRY.has(r)||typeof t[r]!="function")continue;const c=r.charCodeAt(0);if(c>=65&&c<=90||Q(r))continue;const l=t[r];s.__exec[r]=l;const u=t.tag||"div";if((0,C.checkAttributeByTagName)(u,r)&&!(0,W.isCssProp)(u,r)){const d=(0,C.camelToAttr)(r)||r,h=M(t,t[r+"Deps"],l),y=(0,E.createEffect)(()=>{try{let A=h(t,t.state,t.context);typeof A=="string"&&A.includes("{{")&&(A=R.replaceLiteralsWithObjectFields.call(t,A,t.state)),t.node?.setAttribute&&(A==null||A===!1&&!(0,C.isEnumeratedTrueFalseAttr)(d)?t.node.removeAttribute(d):typeof A!="function"&&typeof A!="object"&&(d==="src"&&"src"in t.node?t.node.src=A:t.node.setAttribute(d,(0,C.serializeAttrValue)(d,A))))}catch(A){N(s,r,A)}},{depth:s.path.length,label:O(s,r)});y._attrName=d.toLowerCase(),s.__effects.push(y)}}const f=t.tag||"div";for(const r of Object.keys(t)){if(V.REGISTRY.has(r))continue;const c=t[r];if(typeof c!="string"||!c.includes("{{"))continue;const l=r.charCodeAt(0);if(l>=65&&l<=90||Q(r)||(0,W.isCssProp)(f,r)||C.ATTR_TRANSFORMS[r]||!(0,C.checkAttributeByTagName)(f,r))continue;const u=(0,C.camelToAttr)(r)||r,d=(0,E.createEffect)(()=>{try{const h=R.replaceLiteralsWithObjectFields.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,C.serializeAttrValue)(u,h??""))}catch(h){N(s,r,h)}},{depth:s.path.length,label:O(s,r)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(ln(t),wn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const r=t.onStateUpdate,c=t.stateDeps;let l=!1,u=[];const d=(0,E.createEffect)(()=>{const h=[];for(let b=0;b<c.length;b++){const w=c[b];try{h[b]=typeof w=="function"?w(t,t.state,t.context):t.state?.[w]}catch{h[b]=void 0}}if(!l){l=!0,u=h;return}let y=h.length!==u.length;for(let b=0;!y&&b<h.length;b++)h[b]!==u[b]&&(y=!0);const A=u;if(u=h,!y)return;const g=t.context?.designSystem;g&&(0,k.pushConfig)(g);try{r(t,t.state,t.context,{prev:A,next:h})}catch(b){if(t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onStateUpdate",error:b})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',b),t.context?.strictMode)throw b}finally{g&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,"onStateUpdate")});s.__effects.push(d)}_n(t)}function $o(t){const o=t.parent,s=o?.node;if(!s||!t.node){gs(t,t.parent);return}let n=null;const e=Object.keys(o),i=e.indexOf(t.key);for(let a=i+1;a<e.length;a++){const f=o[e[a]];if(f?.node?.parentNode===s){n=f.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function Io(t,o,s){let n=M(t,t.ifDeps,s);const e=(0,E.createEffect)(()=>{const i=!o.__ifInitialized&&o.__ifLateMerge;if(i){const r=t.context?.components||{};i.names.some(c=>r[c]||r["smbls."+c])&&(o.__ifLateMerge=null,Gs(t,i),n=M(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(r){if(a=!1,o.__ifError=r,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,r?.message||r)}return}const f=o.__if;if(o.__if=!!a,f&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(r){console.error("[smbls] onRemove error:",r)}}else if(!f&&o.__if)if(o.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),$o(t),io(t),po(t),F("Render",t,{}),mt(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=(0,ot.detectTag)(t)),F("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 c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),o.__fragmentAnchor=c}F("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,{}),Fo(t,{skipIfEffect:!0}),io(t),is(t),po(t),ps(t),_s(t,{}),$o(t),F("Create",t,{}),F("Complete",t,{}),F("Render",t,{}),F("RenderRouter",t,{}),mt(t,{})}},{depth:o.path.length,label:O(o,"if")});o.__effects.push(e)}function Mt(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 i=e?e.__textNode:null;if(i&&i.parentNode!==s&&(i=null),!i){const a=s.firstChild;a&&a.nodeType===3&&(i=a)}i?i.nodeValue!==n&&(i.nodeValue=n):s.firstChild?(i=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(i,s.firstChild)):(s.textContent=n,i=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),e&&(e.__textNode=i||null)}function Uo(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,i=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&i!=null&&a!=null)try{s.setSelectionRange(i,a)}catch{}const f=t.__ref&&t.__ref.__autoGrow;f&&f.active&&f.resize()}function io(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Mt(t,t.text),rs(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,Wt(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,C.isEnumeratedTrueFalseAttr)(s)||o.setAttribute&&o.setAttribute(s,(0,C.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 Tt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function nn(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 yt(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=X(e);n.push(a,co(s,a),Ho(s,a))}return n}function co(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function Ho(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function X(t){return it(t)?t:t.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}function Ht(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 i in s)s[i]==null||i.charAt(0)==="&"||e.add(X(i));for(let i=0;i<o.length;i+=3){const a=o[i];e.has(a)||co(n,a)===o[i+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function _t(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(co(s,o[n])!==o[n+1]||Ho(s,o[n])!==o[n+2])return!1;return!0}const it=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,Vo=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",Vt=t=>it(t)?t:"--"+t;function Bt(t,o){if(!st(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)}Vo(e)&&(s||(s={}),s[Vt(n)]=e)}return s}function Bo(t,o,s,n,e){const i=t.__ref,a=M(t,n,s);let f,r=null;const c=(0,E.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,k.pushConfig)(l);try{const u=a(t,t.state,t.context),d=t.node;if(!d||!d.style)return;if(!Vo(u)){Ht(d,r,null),f=void 0,r=null;return}const h=String(u);if(h!==f||!_t(d,r)){f=h;const y={[o]:u};J(d,y),r=yt(d,y)}}catch(u){N(i,e,u)}finally{l&&(0,k.popConfig)()}},{depth:i.path.length,label:O(i,e)});i.__effects.push(c)}function en(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){rn(t,s),o.__exec.vars=s;return}if(st(s))for(const n of Object.keys(s)){const e=s[n];!n||typeof e!="function"||Bo(t,Vt(n),e,pt(t.varsDeps,n),"vars."+n)}}function rn(t,o){const s=t.__ref,n=M(t,t.varsDeps,o);let e,i=null;const a=(0,E.createEffect)(()=>{const f=t.context?.designSystem;f&&(0,k.pushConfig)(f);try{const r=Bt(n(t,t.state,t.context)),c=t.node;if(!c||!c.style)return;const l=Tt(r);(l===null||l!==e||!_t(c,i))&&(e=l,Ht(c,i,r),r&&J(c,r),i=r?yt(c,r):null,s.__varsInline=r?new Set(Object.keys(r)):null)}catch(r){N(s,"vars",r)}finally{f&&(0,k.popConfig)()}},{depth:s.path.length,label:O(s,"vars")});s.__effects.push(a)}function fo(t,o){if(typeof t[o]=="function"&&((0,W.isCssProp)(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!it(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!st(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&Vt(n)===o)return!0;return!1}function cn(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(X(s)));return o}function fn(t,o,s,n){const e=t.__ref;if(!e)return;let i=null;if(s)for(const a of s){if(n&&n.has(a))continue;const f=o[a];if(f==null||typeof f=="object")continue;const r=X(a);q.CSS_LONGHAND_SHORTHANDS[r]&&(i||(i={}),i[r]=f)}e.__declaredLonghands=i}function Go(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const i in n){if(o.has(i))continue;const a=q.CSS_LONGHAND_SHORTHANDS[i];let f=!1;for(let r=0;r<a.length;r++)if(o.has(a[r])){f=!0;break}f&&(e||(e={}),e[i]=n[i])}return e}function Ko(t,o){const s=t.node;J(s,o);const n=cn(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 i=Go(t,n);return i?(J(s,i),Object.assign({},o,i)):o}function an(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=Go(t,o.__inlineCssKeys);s&&J(t.node,s)}function Wt(t,o){if(!o||typeof o!="object")return o;const s=t&&t.context&&t.context.designSystem;s&&(0,k.pushConfig)(s);try{return(0,P.resolveStyleBlockTokens)(o,t)}catch{return o}finally{s&&(0,k.popConfig)()}}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 i=String(e),a=it(n)?n:n.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),f=i.trim(),r=/\s*!important\s*$/.test(f),c=f.replace(/\s*!important\s*$/,"");t.style.setProperty(a,c,r?"important":"")}catch{}}}s&&un(t,s)}function un(t,o){const s=`_ds${So.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 i="";for(const a in o){const f="."+s,r=a.replace(/&/g,f).split(",").map(l=>{const u=l.trim();return u.includes(f)?u:f+u}).join(", "),c=o[a];if(typeof c=="object"){let l="",u="";for(const d in c){const h=c[d];if(typeof h=="object"){const y=d.includes("&")?r.split(", ").map(g=>d.replace(/&/g,g)).join(", "):r.split(", ").map(g=>`${g} ${d}`).join(", ");let A="";for(const g in h)A+=`${X(g)}: ${h[g]};`;u+=(0,tt.wrapHoverRule)(`${y} { ${A} }`,y)+`
5
5
  `}else l+=`${X(d)}: ${h};`}l&&(i+=(0,tt.wrapHoverRule)(`${r} { ${l} }`,r)+`
6
- `),u&&(i+=u)}}i&&(e.textContent+=i)}const Wo=new Set;function zo(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 dn(t,o,s){const n=zo(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(zo(e)===n)return;const i=t.__ref.path?t.__ref.path.join("."):t.key||"?";Wo.has(i)||(Wo.add(i),console.warn(`[smbls] subscribeTo function at "${i}" 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 ln(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,ft.isLoudDevRuntime)()&&dn(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let i=0;i<n.length;i++){const a=n[i];if(typeof a!="string"||a.length===0)continue;const f=a.split("."),r=f[0],c=f.slice(1),l={value:!1},u=(0,E.createEffect)(()=>{const d=t.state&&((0,U.isStore)(t.state)?t.state.root:null);if(!d||!(0,U.isStore)(d))return;let h=d;h=h[r];for(let A=0;A<c.length&&!(h==null||typeof h!="object");A++)if((0,U.isStore)(h))h=h[c[A]];else break;if(!l.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const A=t.context?.designSystem;A&&(0,k.pushConfig)(A);try{if(Ss(e)){const g=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});g&&typeof g.then=="function"?g.then(()=>Rt(e,!1),b=>{Rt(e,!0),t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:b})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",b)}):(Rt(e,!1),g===!1&&(y=!0))}}catch(g){Rt(e,!0),t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{A&&(0,k.popConfig)()}}if(!y&&t.node&&e.__effects)for(let A=0;A<e.__effects.length;A++){const g=e.__effects[A];g&&g!==u&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!y&&typeof t.onUpdate=="function"){const A=t.context?.designSystem;A&&(0,k.pushConfig)(A);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{A&&(0,k.popConfig)()}}},{depth:e.path.length,label:O(e,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function ao(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 uo(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 Yo=new Set;function pn(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;Yo.has(n)||(Yo.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 qo=new Map;function hn(t){let o=qo.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push(e.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()))};return s(q.CSS_LONGHAND_SHORTHANDS[t]),s(q.CSS_SHORTHAND_LONGHANDS[t]),qo.set(t,o),o}function Zo(t,o,s){if(fo(t,o)||s&&s.has(o))return!0;const n=hn(X(o));for(let e=0;e<n.length;e++){const i=n[e];if(fo(t,i)||s&&s.has(i))return!0}return!1}function gt(t,o,s,n){const e={},i=new Set,a=(f,r,c)=>{const l=c?new Set(Object.keys(e)):null;if(P.CSS_PROPS_REGISTRY[f]){const u=P.CSS_PROPS_REGISTRY[f](r,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(e,h)}}else e[f]=r;if(c)for(const u in e)l.has(u)||i.add(u)};for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f))continue;let r=t[f];if(typeof r=="function"&&(r=r(o,o.state,o.context)),!(r==null||typeof r=="function")){if(typeof r=="object"&&!Array.isArray(r)){if(f==="style"){for(const u in r){let d=r[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,Zo(o,u,n))}continue}if(f==="vars"){const u=Bt(r,o);if(u)for(const d in u)a(d,u[d],fo(o,d)||!!(n&&n.has(d)));continue}if(ao(f,o)){const u=gt(r,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${f.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(f)){(0,ft.isLoudDevRuntime)()&&pn(f,o);continue}const c=uo(f,o),l=gt(r,o,!1,n);Object.keys(l).length&&(e[c]=l);continue}a(f,r,Zo(o,f,n))}}if(s)for(const f in e)i.add(f);for(const f of i){const r=e[f];typeof r=="string"&&!r.includes("!important")&&(e[f]=r+" !important")}return e}const ot=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Qo(t,o){for(const s in o){const n=o[s];t[s]=ot(n)?Qo(ot(t[s])?t[s]:{},n):n}return t}function yn(t,o){if(!ot(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;ot(e)&&(s=Qo(s||{},e))}return s}function lo(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)&&lo(t[s],o+1))return!0}return!1}function Xo(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(ao(t,s)){const i=gt(o,s,!1);return Object.keys(i).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:i}:null}const n=uo(t,s),e=gt(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function _n(t){const o=t.__ref;for(const s of Object.keys(t)){if(!to(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!lo(n))continue;let e=null,i;const a=(0,E.createEffect)(()=>{if(!t.node)return;const f=t.context?.designSystem;f&&(0,k.pushConfig)(f);let r,c=!1;try{const l=Xo(s,n,t),u=l?Tt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===i)c=!0;else if(i=u,l){const d=(0,tt.css)({[l.cssProp]:l.block},null,t.context?.cssPrefix);r=d?d.split(" ").filter(Boolean):null}else r=null}finally{f&&(0,k.popConfig)()}if(!(c||!t.node.classList)){if(e)for(const l of e)t.node.classList.remove(l);if(r&&r.length)for(const l of r)t.node.classList.add(l);e=r}},{depth:o.path.length,label:O(o,"cssBlock("+s+")")});o.__effects.push(a)}}const gn=()=>!0,bn=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!P.CSS_PROPS_REGISTRY[t]||!!(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(t))||rt(t)||t==="vars"};function An(t,o,s){const n={};let e=!1;for(const f in s)Object.prototype.hasOwnProperty.call(s,f)&&(f!=="data"&&f!=="aria"&&(bn(f,s[f])||V.REGISTRY.has(f))?n[f]=!0:e=!0);if(!e)return null;const i=(0,C.extractConditionalAttrs)({[o]:s},t.tag||"div",n,gn);let a=null;for(const f in i)/^on/i.test(f)||(a||(a={}),a[f]=i[f]);return a}function Jo(t,o,s,n,e,i){const a=t.node;let f=null;const r=c=>{(f||(f=[])).push(c)};for(const c in n){const l=o.owners.get(c),u=l===s;if(!i&&l!==void 0&&!u)continue;let d;try{d=n[c](t)}catch(y){N(t.__ref,"conditional("+s+")."+c,y),u&&r(c);continue}if(typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),u&&a.getAttribute(c)!==o.written.get(c)){r(c);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&mo(a,o,c);continue}const h=d===!1&&!(0,C.isEnumeratedTrueFalseAttr)(c)?null:String((0,C.serializeAttrValue)(c,d));r(c),!(u&&h===o.written.get(c))&&(l===void 0&&o.base.set(c,a.getAttribute(c)),h==null?a.removeAttribute(c):a.setAttribute(c,h),o.owners.set(c,s),o.written.set(c,h))}e.appliedAttrs=f}function mo(t,o,s){if(t.getAttribute(s)===o.written.get(s)){const n=o.base.get(s);n==null?t.removeAttribute(s):t.setAttribute(s,n)}o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function xn(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const i of e)o.owners.get(i)===s&&mo(t.node,o,i)}function po(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),i=s.getAttribute(n);i!==e&&(o.base.set(n,i),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function wn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const i=e.charAt(0);if(i!=="."&&i!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const g=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${i}\` is read as one prop name. Nest the selector inside instead: \`${i}${g}: { '${a.slice(g.length)}': {...} }\`.`)}continue}const f=t[e];if(!f||typeof f!="object")continue;const r=i==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},l=An(t,e,f);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const g in f){if(!Object.prototype.hasOwnProperty.call(f,g))continue;const b=g.charAt(0),w=f[g];if(!((b===":"||b==="@"||b==="&"||b==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(g==="vars"&&ot(w)){for(const p of Object.keys(w))p&&u.add(Vt(p));continue}u.add(g)}}const d=()=>{let g;const b=t[a];if(b===void 0){const _=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(_||x!==void 0)g=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{g=typeof S=="function"?S.call(t,t):S}catch(j){g=!1,o.__conditionalError=j,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,j?.message||j)}}}else if(typeof b=="function")try{g=b(t,t.state,t.context)}catch(_){g=!1,o.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else g=b;const w=r?!g:!!g;if(!t.node)return;const p=t.context?.designSystem;if(w===c.lastMatch){if(w&&l&&t.node.setAttribute){p&&(0,k.pushConfig)(p);try{Jo(t,s,e,l,c,!1)}finally{p&&(0,k.popConfig)()}}return}c.lastMatch=w,p&&(0,k.pushConfig)(p);try{if(w){const _={},x={};let S=!1;for(const v in f){if(!Object.prototype.hasOwnProperty.call(f,v))continue;const $=f[v],st=v.charAt(0);if((st===":"||st==="@"||st==="&"||st==="[")&&$&&typeof $=="object"&&!Array.isArray($)){if(ao(v,t)){const L=gt($,t,!1,u);Object.keys(L).length&&(x[`[data-theme="${v.slice(1)}"] &`]=L,S=!0)}else{const L=uo(v,t),I=gt($,t,!1,u);Object.keys(I).length&&(x[L]=I,S=!0)}continue}const nt=typeof $=="function"?$(t,t.state,t.context):$;if(nt!=null){if(P.CSS_PROPS_REGISTRY[v]){const L=P.CSS_PROPS_REGISTRY[v](nt,t,t.state,t.context);if(L){const I=Array.isArray(L)?L:[L];for(const xt of I)xt&&Object.assign(_,xt)}}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(v))_[v]=nt;else if(rt(v))_[v]=nt;else if(v==="vars"){const L=Bt(nt,t);L&&Object.assign(_,L)}}}const j=Object.keys(_);if(j.length){J(t.node,_);for(const v of j)n.set(v,e);c.appliedKeys=j}else c.appliedKeys=null;if(S){const v=(0,tt.css)(x,null,t.context?.cssPrefix,{state:!0}),$=v?v.split(" ").filter(Boolean):[];if($.length&&t.node.classList){for(const st of $)t.node.classList.add(st);c.appliedClasses=$}else c.appliedClasses=null}else if(c.appliedClasses){for(const v of c.appliedClasses)t.node.classList.remove(v);c.appliedClasses=null}l&&t.node.setAttribute&&Jo(t,s,e,l,c,!0)}else{if(c.appliedAttrs&&xn(t,s,e,c),c.appliedKeys){for(const _ of c.appliedKeys)n.get(_)===e&&(rt(_)?t.node.style.removeProperty(_):t.node.style[_]="",n.delete(_));c.appliedKeys=null}if(c.appliedClasses){for(const _ of c.appliedClasses)t.node.classList.remove(_);c.appliedClasses=null}}}finally{p&&(0,k.popConfig)()}};o.__conditionalRunners.push(d);const h=M(t,t[a+"Deps"],d),y=(0,E.createEffect)(h,{depth:o.path.length,label:O(o,"conditional("+e+")")}),A=o.__exec&&o.__exec[a]||t[a];y._sources.size===0&&typeof A=="function"&&(0,ft.isLoudDevRuntime)()&&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(y)}}const ho=new WeakSet,ts=new WeakSet,os=new WeakSet;function Sn(t){if(os.has(t))return!1;if(!ts.has(t)){ts.add(t);const o=t.defaultView,s=()=>{os.add(t)};o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(s):setTimeout(s,0)}return!0}function Cn(t){const o=t.ownerDocument;!o||ho.has(o)||Sn(o)||(ho.add(o),queueMicrotask(()=>{ho.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const yo=new WeakSet;let ss=!1;function ns(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function _o(t,o){const s={...t};for(const n in o){const e=o[n],i=s[n];s[n]=e&&typeof e=="object"&&i&&typeof i=="object"?_o(i,e):e}return s}function es(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const i=es(e,o);Object.keys(i).length&&(s[n]=i)}else o.has(n)||(s[n]=e)}return s}function vn(t,o,s){let n=null;for(const[e,i]of o){const a=X(e),f=q.CSS_LONGHAND_SHORTHANDS[a];if(f)for(let r=0;r<f.length;r++){const c=f[r].replace(/-([a-z])/g,(y,A)=>A.toUpperCase()),l=t[c]!=null?o.get(c):void 0,u=s&&s.get(f[r]),d=l!==void 0&&l>i&&(0,q.cssShorthandStatesLonghand)(f[r],t[c],a),h=!d&&u!==void 0&&u>i&&(0,q.cssShorthandStatesLonghand)(f[r],void 0,a);if(d||h){d&&delete t[e],n||(n=new Set),n.add(e);break}}}return n}function rs(t){const{node:o}=t;if(!o)return;if(ss||(ss=!0,(0,tt.css)({display:"none"})),yo.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}yo.add(t);const s=t.context?.designSystem;s&&(0,k.pushConfig)(s),(0,P.pushStaticCssPass)();try{const n={};let e=!1,i=[],a=null,f=null,r=null;const c=t.__ref&&t.__ref.__mergeLayer;let l,u=null,d=null;const h=(p,_)=>{if(_&&typeof _=="object"&&ns(p)){f||(f={});const x=f[p];x&&(_=_o(x,_)),f[p]=_}else(_===null||typeof _!="object")&&(r||(r=new Set),r.add(p),l!==void 0&&(u||(u=new Map),u.set(p,l)));n[p]=_};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&P.CSS_PROPS_REGISTRY.theme){const p=P.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(p){const _=x=>{for(const S in x){const j=x[S];j&&typeof j=="object"&&ns(S)&&(a||(a={}),a[S]=j),n[S]=j}};if(Array.isArray(p))for(const x of p)x&&_(x);else _(p);e=!0}}const y=(p,_)=>{if(p==="vars"){const x=Bt(_);if(x){for(const S in x)h(S,x[S]);e=!0}return}if(P.CSS_PROPS_REGISTRY[p]){const x=P.CSS_PROPS_REGISTRY[p](_,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const j in S)h(j,S[j])}else for(const S in x)h(S,x[S]);e=!0}}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(p))_!=null&&typeof _!="object"&&(h(p,_),e=!0);else if(p.charCodeAt(0)===45)_!=null&&typeof _!="object"&&(h(p,_),e=!0);else if((p.charAt(0)==="&"||p.charAt(0)==="@"||p.charAt(0)===":"||p.charAt(0)==="[")&&_&&typeof _=="object"&&!Array.isArray(_)){if(lo(_))return;const x=Xo(p,_,t);x&&(h(x.cssProp,x.block),e=!0)}};if(typeof t.class=="string"){const p=yn(t.class,t.context?.designSystem?.class);if(p)for(const _ in p)y(_,p[_])}const A=r?new Set(r):null,g=t.tag||"div";for(const p of Object.keys(t)){if(typeof t[p]=="function"){const x=c&&c.get(p);x!==void 0&&(0,W.isCssProp)(g,p)&&(d||(d=new Map),d.set(X(p),x));continue}if(l=c?c.get(p):void 0,p==="vars"){y(p,t[p]);continue}if(V.REGISTRY.has(p)||p==="theme")continue;const _=p.charCodeAt(0);_>=65&&_<=90||Q(p)||(0,W.isAttributeFirst)(g,p)||y(p,t[p])}l=void 0;const b=u?vn(n,u,d):null;if(a)for(const p in a){let _=r?es(a[p],r):a[p];f&&f[p]&&(_=_o(_,f[p])),Object.keys(_).length?n[p]=_:delete n[p]}if(fn(t,n,r,b?new Set([...A||[],...b]):A),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const p=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof p=="string"&&p!==""&&n.display&&n.display!==p&&(n.display=p);const _=(0,tt.css)(n,null,t.context?.cssPrefix);if(i=_?_.split(" ").filter(Boolean):[],_&&o.classList){const x=i;let S=!1;for(const j of x)o.classList.add(j),S||(j.charCodeAt(0)===95&&j.charCodeAt(1)===99||j.charCodeAt(0)===95&&j.indexOf("_c",1)!==-1)&&(S=!0);S&&Cn(o)}}const w=t.__ref;if(w){const p=w.__staticCssClasses;if(p&&o.classList){const _=new Set(i);for(const x of p)_.has(x)||o.classList.remove(x)}w.__staticCssClasses=i}an(t)}finally{(0,P.popStaticCssPass)(),s&&(0,k.popConfig)(),yo.delete(t)}}const kn=t=>!!P.CSS_PROPS_REGISTRY[t]||!!(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function jn(t){t&&t.node&&rs(t)}function is(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const i=t.aria[e];if(typeof i=="function"||typeof i=="object"||i==null||typeof i=="string"&&i.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,f=>"-"+f.toLowerCase());o.setAttribute(a,(0,C.serializeAttrValue)(a,i))}const s=(0,C.applyAttrTransforms)(t);for(const e in s){const i=s[e];i!=null&&i!==!1&&typeof i!="function"&&typeof i!="object"&&o.setAttribute(e,i===!0?"":i)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||V.REGISTRY.has(e)||e==="on"||s[e]!==void 0)continue;const i=e.charCodeAt(0);if(!(i>=65&&i<=90)&&!Q(e)&&!(0,W.isCssProp)(n,e)&&(0,C.checkAttributeByTagName)(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!C.ATTR_TRANSFORMS[e])continue;a=R.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,C.isEnumeratedTrueFalseAttr)((0,C.camelToAttr)(e)||e))continue;const f=(0,C.camelToAttr)(e)||e;o.setAttribute(f,(0,C.serializeAttrValue)(f,a))}}}function En(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||Q(o))return;const e=t.tag||"div";if((0,W.isCssProp)(e,o)||!(0,C.checkAttributeByTagName)(e,o))return;const i=(0,C.camelToAttr)(o)||o,a=i.toLowerCase(),f=t.__ref&&t.__ref.__effects;let r=!1;if(f)for(let u=0;u<f.length;u++){const d=f[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(r=!0,d._execute())}if(r)return;let c=t[o];const l=C.ATTR_TRANSFORMS[o];if(l&&c!=null){const u=l(t);u!==void 0&&(c=u)}typeof c=="string"&&c.includes("{{")&&(c=R.replaceLiteralsWithObjectFields.call(t,c,t.state)),c==null||c===!1&&!(0,C.isEnumeratedTrueFalseAttr)(i)?s.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&s.setAttribute(i,(0,C.serializeAttrValue)(i,c))}function Pn(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{}fs(e),et.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),ds(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,cs(t,e);return}e.awaitingLayout=!1;const a=Ln(s),f=Dn(a),r=s.style.height;s.style.height="0px",f&&bo(s);const c=s.scrollHeight;if(!(c>0)){s.style.height=r,f&&bo(s);return}const l=Mn(s,a),u=l!=null&&c<l?l:c,d=Fn(a),h=d!=null&&u>d;s.style.height=Nn(h?d:u,a)+"px",f&&bo(s),ds(s,e,h),e.lastMeasure=c,e.lastWidth=s.clientWidth,cs(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}fs(e),et.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,Tn(t,e));const i=typeof o=="object"&&o.max!=null?String(o.max):null;i!==e.appliedMax&&(i==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=i,e.appliedMax=i),e.resize()}function Lt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),et.add(t),It())}function On(){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=lt()),e.attachAttempts+=1,e.attachAttempts<=ko&&lt()-e.firstAttemptAt<jo&&(et.add(s),It());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 i=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Lt(t,!0);return}const f=s.clientWidth;o.lastWidth!=null&&Math.abs(f-o.lastWidth)<.5||(o.lastWidth=f,Lt(t,!0))};let a;try{a=new e(i),a.observe(s)}catch{return}o.watch=a}function fs(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function Tn(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 Ln(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const it=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,go=t=>(it(t.paddingTop)||0)+(it(t.paddingBottom)||0),as=t=>(it(t.borderTopWidth)||0)+(it(t.borderBottomWidth)||0);function Dn(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 bo(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 Mn(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=it(o.lineHeight)||Rn(t,o);return n>0?s*n+go(o):null}const Dt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],us=new WeakMap;function Rn(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 i=Dt.map(c=>o[c]||"").join("|");if(e.has(i))return e.get(i);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const f=a.style;f.position="absolute",f.visibility="hidden",f.top="0",f.left="-9999px",f.height="auto",f.minHeight="0",f.maxHeight="none",f.padding="0",f.border="0",f.boxSizing="content-box",f.overflow="hidden";for(let c=0;c<Dt.length;c++)o[Dt[c]]&&(f[Dt[c]]=o[Dt[c]]);let r=0;try{n.appendChild(a),r=a.clientHeight}catch{r=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return r>0?(e.set(i,r),r):null}function Nn(t,o){return o?o.boxSizing==="border-box"?t+as(o):o.boxSizing==="content-box"?Math.max(0,t-go(o)):t:t}function Fn(t){if(!t)return null;const o=it(t.maxHeight);if(o==null||!(o>0))return null;const s=go(t),n=as(t),e=t.boxSizing==="border-box"?o-n:o+s,i=it(t.lineHeight);if(!(i>0))return e;const a=Math.floor((e-s)/i+1e-6);return a>=1?a*i+s:e}function ds(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 ls=["srcObject","muted"],$n=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function In(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<ls.length;n++){const e=ls[n],i=t[e];if(i===void 0||!(e in o))continue;const a=f=>{const r=$n(e,f);if(o[e]!==r)try{o[e]=r}catch(c){N(s,e,c)}};if(typeof i=="function"){const f=M(t,t[e+"Deps"],i),r=(0,E.createEffect)(()=>{try{a(f(t,t.state,t.context))}catch(c){N(s,e,c)}},{depth:s.path.length,label:O(s,e)});s.__effects.push(r),s.__exec[e]=i}else a(i);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function ps(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"?M(t,t.autoGrowDeps,n):null,i=(0,E.createEffect)(()=>{const a=t.autoGrow;let f=a;if(typeof a=="function")try{f=(a===n&&e?e:a)(t,t.state,t.context)}catch{f=null}Pn(t,f)},{depth:s.path.length,label:O(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(i),e&&(s.__exec.autoGrow=n)}const hs=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function ys(t,o){for(const s of Object.keys(t)){if(!Q(s)||hs.has(s))continue;const n=(0,At.globalEventKeyInfo)(s);if(n){(0,At.registerGlobalEvent)(n,t,t[s]);continue}let e=t[s],i=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(i=e,e=i.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const f=e;e=function(c){return t.call(f,c)}}if(typeof e!="function")continue;const a=Hs(s);V.LIFECYCLE_EVENTS.has(a)||(0,At.registerEvent)(Vs(a),t,e,i)}Un(t)}function Un(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const d of hs){const h=t[d];typeof h=="function"&&(s[d]=h,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,i=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,f=0,r=0,c=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,f=h.clientY,r=Date.now(),c=!0)},u=d=>{if(!c)return;c=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const y=h.clientX-a,A=h.clientY-f,g=Date.now()-r;if(g>i)return;const b=Math.abs(y),w=Math.abs(A);if(Math.max(b,w)<e)return;let p;if(b>w*1.2)p=y<0?"left":"right";else if(w>b*1.2)p=A<0?"up":"down";else return;const _="onSwipe"+p.charAt(0).toUpperCase()+p.slice(1),x=s[_],S=s.onSwipe;x&&x.call(t,d,t,t.state,t.context),S&&S.call(t,{direction:p,dx:y,dy:A,dt:g,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function ct(t,o){const s={...t};for(const n in o){const e=s[n],i=o[n];e&&i&&typeof e=="object"&&typeof i=="object"&&!Array.isArray(e)&&!Array.isArray(i)&&typeof e!="function"&&typeof i!="function"?s[n]=ct(e,i):s[n]=i}return s}function Ao(t,o,s,n,e){if(!o||!t.node)return;const i=t.childExtends,a=ht(t,"childProps");if(Array.isArray(o)){const f=t.tag==="fragment",r=t.context?.document||globalThis.document,c=f?null:r?.createDocumentFragment();if(!f&&!c)return;const l=t.childProps,u=t.childrenAs,d=w=>{let p=o[w];const _=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let x=l;if(typeof l=="function")try{x=l(t,p)}catch{x=null}let S=typeof l=="function"?Et(x):a;if(e&&u!=="state"&&(S=Pt(S,Et(_))),u==="state"){let v=_;(typeof _=="string"||typeof _=="number")&&(v={value:_,text:_}),p=x?{...x,state:v}:{state:v}}else x&&(p=ct(x,p));if(i&&!p.ignoreChildExtends)if(p.extends){const v=Array.isArray(p.extends)?p.extends:[p.extends],$=Array.isArray(i)?i:[i];p={...p,extends:[...$,...v]}}else p={...p,extends:i};const j=Po(p?.key,_,w);try{return m(Ot(p,S),t,j,s)}catch(v){if(typeof console<"u"&&console.error){const $=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${j}" failed to construct at ${$} (initial render, skipping this row):`,v?.message||v)}return null}},h=t.__ref;if(!(n===!0&&!f&&!!h&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const p=d(w);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const A=h.__childrenChunkGen=(h.__childrenChunkGen||0)+1;(0,G.openMountBudget)();let g=null;const b=w=>{if(h.__disposed||h.__childrenChunkGen!==A){g&&g.parentNode&&g.remove();return}for(let p=w;p<o.length;p++){const _=d(p);if(_?.node&&(g?t.node.insertBefore(_.node,g):c.appendChild(_.node)),p+1<o.length&&(0,G.mountBudgetExhausted)()){g||(g=r.createComment("smbls-mount"),c.appendChild(g),t.node.appendChild(c));const x=p+1;(0,G.enqueueMountWork)(()=>b(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&Gt(t,!0)):t.node.appendChild(c)};return b(0),(0,G.closeMountBudget)(),!0}if(typeof o=="string"){const f=To(o,t);if(Array.isArray(f))return Ao(t,f,s,n,!0)}if(typeof o=="object")for(const f in o){if(V.REGISTRY.has(f))continue;let r=o[f];if(r==null||r===!1)continue;const c=e?Pt(a,Et(r)):a;if((typeof r=="string"||typeof r=="number")&&(r={text:r}),t.childProps&&(r=ct(t.childProps,r)),i&&!r.ignoreChildExtends)if(r.extends){const l=Array.isArray(r.extends)?r.extends:[r.extends],u=Array.isArray(i)?i:[i];r={...r,extends:[...u,...l]}}else r={...r,extends:i};m(Ot(r,c),t,f,s)}}function Gt(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,i=e&&e.__exec&&e.__exec.value,a=typeof i=="function",f=t.value!=null&&typeof t.value!="function";if(a||f){let l;if(a)try{l=i(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=R.replaceLiteralsWithObjectFields.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const r=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!r)return;let c=-1;for(let l=0;l<n.length;l++)n[l].defaultSelected&&(c=l);c>=0&&s.selectedIndex!==c&&(s.selectedIndex=c)}function _s(t,o){let{children:s,content:n}=t;const e=t.childExtends,i=typeof s=="function"||Mo(t,"children");if(typeof s=="function"){const y=s;try{s=y(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const _=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${_} (initial run, treating as empty):`,p?.message||p)}}Ro(t,s),t.children=s;const A=t.__ref;let g=!1;const b=M(t,t.childrenDeps,y),w=(0,E.createEffect)(()=>{const p=g;g=!0;let _;try{_=b(t,t.state,t.context)}catch(L){if(typeof console<"u"&&console.error){const I=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${I}${p?"":" (initial tracking run)"}:`,L?.message||L)}return}if(!p||_===t.children)return;Ro(t,_),t.children=_,A.__childrenChunkGen!=null&&A.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,j=x?[]:null,v=x?[]:null;if(Array.isArray(_)&&t.childrenAs==="state"){const L=t.childProps,I=[],xt=new Map;for(let T=0;T<_.length;T++){const K=_[T];let D=L;if(typeof L=="function")try{D=L(t,K)}catch{D=null}const Z=Po(D&&D.key,K,T);I.push(Z),xt.set(Z,{rawChild:K,childProps:D})}const Cs=new Set(I),vs=A.__children.slice();for(const T of vs)if(!Cs.has(T)){const K=t[T];K?.remove&&K.remove(),delete t[T],j&&j.push(T)}const wt=t.childExtends,Nt=t.tag==="fragment",ks=t.context?.document||globalThis.document,St=Nt?null:ks?.createDocumentFragment(),qt=new Set;for(const T of I){const K=xt.get(T),D=K.rawChild,Z=t[T];if(Z&&Z.state){if(D&&typeof D=="object"){const H=Z.state,ut=H.$replace||H.replace,xo=H.$update||H.update;try{if(typeof ut=="function")ut.call(H,D);else if(typeof xo=="function"){for(const B in H)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(D,B))try{H[B]=void 0}catch{}xo.call(H,D)}else for(const B in D)H[B]=D[B]}catch(B){if(typeof console<"u"&&console.error){const Es=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Es} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}v&&v.push(T);continue}let Zt=D;(typeof D=="string"||typeof D=="number")&&(Zt={value:D,text:D});const Qt=K.childProps;let z=Qt?{...Qt,state:Zt}:{state:Zt};const js=typeof L=="function"?Et(Qt):ht(t,"childProps");if(wt&&!z.ignoreChildExtends)if(z.extends){const H=Array.isArray(z.extends)?z.extends:[z.extends],ut=Array.isArray(wt)?wt:[wt];z={...z,extends:[...ut,...H]}}else z={...z,extends:wt};let Xt;try{Xt=m(Ot(z,js),t,T,o)}catch(H){if(typeof console<"u"&&console.error){const ut=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${ut} (reconcile, skipping this row):`,H?.message||H)}qt.add(T);continue}!Nt&&Xt?.node&&St&&St.appendChild(Xt.node),S&&S.push(T)}if(!Nt&&St&&St.childNodes.length&&t.node&&t.node.appendChild(St),!Nt&&t.node){let T=null;for(const K of I){const D=t[K]?.node;if(!D)continue;const Z=T?T.nextSibling:t.node.firstChild;D!==Z&&t.node.insertBefore(D,Z),T=D}}A.__children=qt.size?I.filter(T=>!qt.has(T)):I,x&&(S.length||j.length)&&Eo(t,{added:S,removed:j,kept:v}),Gt(t,!1);return}const nt=x?[...A.__children]:null;for(const L of[...A.__children]){const I=t[L];I?.remove&&I.remove(),delete t[L]}A.__children=[],Ao(t,_,o,!1,!0),Gt(t,!1),x&&Eo(t,{added:[...A.__children],removed:nt,kept:[]})},{depth:A.path.length,label:O(A,"children")});A.__effects.push(w)}const a=Ao(t,s,o,!0,i);if(n!=null&&!(n&&n.__ref)){let y=n;if(typeof y=="string"||typeof y=="number"?y={text:y}:typeof y!="object"&&(y={}),t.childProps&&(y=ct(t.childProps,y)),e&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],b=Array.isArray(e)?e:[e];y={...y,extends:[...b,...g]}}else y={...y,extends:e};const A=Pt(ht(t,"childProps"),ht(t,"content"));m(Ot(y,A),t,"content",o)}if(s&&!a)return;const f=t.context?.components||{},r=t.__ref&&t.__ref.__runtimeSource,c=r?{}:null;{const y=Object.keys(t);for(let A=0;A<y.length;A++){const g=y[A];if(!g.endsWith("Extends")||typeof t[g]!="string")continue;const b=g.slice(0,-7);if(!b||b.charCodeAt(0)<65||b.charCodeAt(0)>90)continue;const w={extends:t[g]};delete t[g];for(let p=A+1;p<y.length;p++){const _=y[p],x=_.charCodeAt(0);if(x>=65&&x<=90||V.REGISTRY.has(_)||typeof t[_]=="function"&&(_.startsWith("on")||_.startsWith(".")))break;const S=t[_];S!==void 0&&(w[_]=S,delete t[_],c&&jt(r,_)&&(c[b]||(c[b]={}),c[b][_]=r[_]))}t[b]&&typeof t[b]=="object"?t[b]={...w,...t[b]}:t[b]=w}}const l=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),d=y=>{if(V.REGISTRY.has(y)||typeof t[y]!="object"||t[y]===null)return;const A=y.charCodeAt(0);if(A<65||A>90)return;let g=t[y];if(g.__ref)return;if(!g.extends&&!g.extend){const w=f[y]||f[`smbls.${y}`];w&&(g={...g,extends:w})}if(t.childProps&&(g=ct(t.childProps,g)),e&&!g.ignoreChildExtends)if(g.extends){const w=Array.isArray(g.extends)?g.extends:[g.extends],p=Array.isArray(e)?e:[e];g={...g,extends:[...p,...w]}}else g={...g,extends:e};const b=r?Pt(ht(t,"childProps"),Pt(c[y]||null,ht(t,y))):null;m(Ot(g,b),t,y,o)};if(!l){for(const y of u)d(y);return}(0,G.openMountBudget)();const h=y=>{for(let A=y;A<u.length;A++)if(d(u[A]),A+1<u.length&&(0,G.mountBudgetExhausted)()){const g=A+1;(0,G.enqueueMountWork)(()=>h(g));return}};h(0),(0,G.closeMountBudget)()}function gs(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 f=s.node.nextSibling;a.insertBefore(n,f||e)}else a.insertBefore(n,e);return}}const i=o?.node||(o?.nodeType?o:null);if(i)if(s?.position==="before"&&s.node)i.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?i.insertBefore(n,a):i.appendChild(n)}else i.appendChild(n)}const zt=3;function Ss(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=zt?!1:(t.__inBeforeUpdate=!0,!0)}function Rt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===zt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${zt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function F(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);o.context?.plugins?.length&&(0,Y.runPluginHook)(n,o,s);const e="on"+t,i=o[e];if(typeof i=="function"){const r=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(r){if(o.__ref[r])return!0;o.__ref[r]=!0}const c=o.context?.designSystem;c&&(0,k.pushConfig)(c);let l=!!r;try{const u=i(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{o.context?.plugins?.length&&(0,Y.runPluginHook)("error",o,{hook:e,error:h})||console.error(`[DOMQL] Lifecycle "${e}" error:`,h)}).finally(()=>{r&&d&&(d[r]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if(o.context?.plugins?.length&&(0,Y.runPluginHook)("error",o,{hook:e,error:u})||console.error(`[DOMQL] Lifecycle "${e}" error:`,u),o.context?.strictMode)throw u}finally{c&&(0,k.popConfig)(),l&&o.__ref&&(o.__ref[r]=!1)}}return!0}var Hn=m;
6
+ `),u&&(i+=u)}}i&&(e.textContent+=i)}const Wo=new Set;function zo(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 dn(t,o,s){const n=zo(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(zo(e)===n)return;const i=t.__ref.path?t.__ref.path.join("."):t.key||"?";Wo.has(i)||(Wo.add(i),console.warn(`[smbls] subscribeTo function at "${i}" 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 ln(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,at.isLoudDevRuntime)()&&dn(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let i=0;i<n.length;i++){const a=n[i];if(typeof a!="string"||a.length===0)continue;const f=a.split("."),r=f[0],c=f.slice(1),l={value:!1},u=(0,E.createEffect)(()=>{const d=t.state&&((0,U.isStore)(t.state)?t.state.root:null);if(!d||!(0,U.isStore)(d))return;let h=d;h=h[r];for(let A=0;A<c.length&&!(h==null||typeof h!="object");A++)if((0,U.isStore)(h))h=h[c[A]];else break;if(!l.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const A=t.context?.designSystem;A&&(0,k.pushConfig)(A);try{if(Ss(e)){const g=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});g&&typeof g.then=="function"?g.then(()=>Rt(e,!1),b=>{Rt(e,!0),t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:b})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",b)}):(Rt(e,!1),g===!1&&(y=!0))}}catch(g){Rt(e,!0),t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{A&&(0,k.popConfig)()}}if(!y&&t.node&&e.__effects)for(let A=0;A<e.__effects.length;A++){const g=e.__effects[A];g&&g!==u&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!y&&typeof t.onUpdate=="function"){const A=t.context?.designSystem;A&&(0,k.pushConfig)(A);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&(0,Y.runPluginHook)("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{A&&(0,k.popConfig)()}}},{depth:e.path.length,label:O(e,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function ao(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 uo(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 Yo=new Set;function pn(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;Yo.has(n)||(Yo.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 qo=new Map;function hn(t){let o=qo.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push(e.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()))};return s(q.CSS_LONGHAND_SHORTHANDS[t]),s(q.CSS_SHORTHAND_LONGHANDS[t]),qo.set(t,o),o}function Zo(t,o,s){if(fo(t,o)||s&&s.has(o))return!0;const n=hn(X(o));for(let e=0;e<n.length;e++){const i=n[e];if(fo(t,i)||s&&s.has(i))return!0}return!1}function gt(t,o,s,n){const e={},i=new Set,a=(f,r,c)=>{const l=c?new Set(Object.keys(e)):null;if(P.CSS_PROPS_REGISTRY[f]){const u=P.CSS_PROPS_REGISTRY[f](r,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(e,h)}}else e[f]=r;if(c)for(const u in e)l.has(u)||i.add(u)};for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f))continue;let r=t[f];if(typeof r=="function"&&(r=r(o,o.state,o.context)),!(r==null||typeof r=="function")){if(typeof r=="object"&&!Array.isArray(r)){if(f==="style"){for(const u in r){let d=r[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,Zo(o,u,n))}continue}if(f==="vars"){const u=Bt(r,o);if(u)for(const d in u)a(d,u[d],fo(o,d)||!!(n&&n.has(d)));continue}if(ao(f,o)){const u=gt(r,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${f.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(f)){(0,at.isLoudDevRuntime)()&&pn(f,o);continue}const c=uo(f,o),l=gt(r,o,!1,n);Object.keys(l).length&&(e[c]=l);continue}a(f,r,Zo(o,f,n))}}if(s)for(const f in e)i.add(f);for(const f of i){const r=e[f];typeof r=="string"&&!r.includes("!important")&&(e[f]=r+" !important")}return e}const st=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Qo(t,o){for(const s in o){const n=o[s];t[s]=st(n)?Qo(st(t[s])?t[s]:{},n):n}return t}function yn(t,o){if(!st(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;st(e)&&(s=Qo(s||{},e))}return s}function lo(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)&&lo(t[s],o+1))return!0}return!1}function Xo(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(ao(t,s)){const i=gt(o,s,!1);return Object.keys(i).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:i}:null}const n=uo(t,s),e=gt(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function _n(t){const o=t.__ref;for(const s of Object.keys(t)){if(!to(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!lo(n))continue;let e=null,i;const a=(0,E.createEffect)(()=>{if(!t.node)return;const f=t.context?.designSystem;f&&(0,k.pushConfig)(f);let r,c=!1;try{const l=Xo(s,n,t),u=l?Tt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===i)c=!0;else if(i=u,l){const d=(0,tt.css)({[l.cssProp]:l.block},null,t.context?.cssPrefix);r=d?d.split(" ").filter(Boolean):null}else r=null}finally{f&&(0,k.popConfig)()}if(!(c||!t.node.classList)){if(e)for(const l of e)t.node.classList.remove(l);if(r&&r.length)for(const l of r)t.node.classList.add(l);e=r}},{depth:o.path.length,label:O(o,"cssBlock("+s+")")});o.__effects.push(a)}}const gn=()=>!0,bn=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!P.CSS_PROPS_REGISTRY[t]||!!(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(t))||it(t)||t==="vars"};function An(t,o,s){const n={};let e=!1;for(const f in s)Object.prototype.hasOwnProperty.call(s,f)&&(f!=="data"&&f!=="aria"&&(bn(f,s[f])||V.REGISTRY.has(f))?n[f]=!0:e=!0);if(!e)return null;const i=(0,C.extractConditionalAttrs)({[o]:s},t.tag||"div",n,gn);let a=null;for(const f in i)/^on/i.test(f)||(a||(a={}),a[f]=i[f]);return a}function Jo(t,o,s,n,e,i){const a=t.node;let f=null;const r=c=>{(f||(f=[])).push(c)};for(const c in n){const l=o.owners.get(c),u=l===s;if(!i&&l!==void 0&&!u)continue;let d;try{d=n[c](t)}catch(y){N(t.__ref,"conditional("+s+")."+c,y),u&&r(c);continue}if(typeof d=="string"&&d.includes("{{")&&(d=R.replaceLiteralsWithObjectFields.call(t,d,t.state)),u&&a.getAttribute(c)!==o.written.get(c)){r(c);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&mo(a,o,c);continue}const h=d===!1&&!(0,C.isEnumeratedTrueFalseAttr)(c)?null:String((0,C.serializeAttrValue)(c,d));r(c),!(u&&h===o.written.get(c))&&(l===void 0&&o.base.set(c,a.getAttribute(c)),h==null?a.removeAttribute(c):a.setAttribute(c,h),o.owners.set(c,s),o.written.set(c,h))}e.appliedAttrs=f}function mo(t,o,s){if(t.getAttribute(s)===o.written.get(s)){const n=o.base.get(s);n==null?t.removeAttribute(s):t.setAttribute(s,n)}o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function xn(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const i of e)o.owners.get(i)===s&&mo(t.node,o,i)}function po(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),i=s.getAttribute(n);i!==e&&(o.base.set(n,i),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function wn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const i=e.charAt(0);if(i!=="."&&i!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const g=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${i}\` is read as one prop name. Nest the selector inside instead: \`${i}${g}: { '${a.slice(g.length)}': {...} }\`.`)}continue}const f=t[e];if(!f||typeof f!="object")continue;const r=i==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},l=An(t,e,f);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const g in f){if(!Object.prototype.hasOwnProperty.call(f,g))continue;const b=g.charAt(0),w=f[g];if(!((b===":"||b==="@"||b==="&"||b==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(g==="vars"&&st(w)){for(const p of Object.keys(w))p&&u.add(Vt(p));continue}u.add(g)}}const d=()=>{let g;const b=t[a];if(b===void 0){const _=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(_||x!==void 0)g=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{g=typeof S=="function"?S.call(t,t):S}catch(j){g=!1,o.__conditionalError=j,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,j?.message||j)}}}else if(typeof b=="function")try{g=b(t,t.state,t.context)}catch(_){g=!1,o.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else g=b;const w=r?!g:!!g;if(!t.node)return;const p=t.context?.designSystem;if(w===c.lastMatch){if(w&&l&&t.node.setAttribute){p&&(0,k.pushConfig)(p);try{Jo(t,s,e,l,c,!1)}finally{p&&(0,k.popConfig)()}}return}c.lastMatch=w,p&&(0,k.pushConfig)(p);try{if(w){const _={},x={};let S=!1;for(const v in f){if(!Object.prototype.hasOwnProperty.call(f,v))continue;const $=f[v],nt=v.charAt(0);if((nt===":"||nt==="@"||nt==="&"||nt==="[")&&$&&typeof $=="object"&&!Array.isArray($)){if(ao(v,t)){const L=gt($,t,!1,u);Object.keys(L).length&&(x[`[data-theme="${v.slice(1)}"] &`]=L,S=!0)}else{const L=uo(v,t),I=gt($,t,!1,u);Object.keys(I).length&&(x[L]=I,S=!0)}continue}const et=typeof $=="function"?$(t,t.state,t.context):$;if(et!=null){if(P.CSS_PROPS_REGISTRY[v]){const L=P.CSS_PROPS_REGISTRY[v](et,t,t.state,t.context);if(L){const I=Array.isArray(L)?L:[L];for(const xt of I)xt&&Object.assign(_,xt)}}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(v))_[v]=et;else if(it(v))_[v]=et;else if(v==="vars"){const L=Bt(et,t);L&&Object.assign(_,L)}}}const j=Object.keys(_);if(j.length){J(t.node,_);for(const v of j)n.set(v,e);c.appliedKeys=j}else c.appliedKeys=null;if(S){const v=(0,tt.css)(x,null,t.context?.cssPrefix,{state:!0}),$=v?v.split(" ").filter(Boolean):[];if($.length&&t.node.classList){for(const nt of $)t.node.classList.add(nt);c.appliedClasses=$}else c.appliedClasses=null}else if(c.appliedClasses){for(const v of c.appliedClasses)t.node.classList.remove(v);c.appliedClasses=null}l&&t.node.setAttribute&&Jo(t,s,e,l,c,!0)}else{if(c.appliedAttrs&&xn(t,s,e,c),c.appliedKeys){for(const _ of c.appliedKeys)n.get(_)===e&&(it(_)?t.node.style.removeProperty(_):t.node.style[_]="",n.delete(_));c.appliedKeys=null}if(c.appliedClasses){for(const _ of c.appliedClasses)t.node.classList.remove(_);c.appliedClasses=null}}}finally{p&&(0,k.popConfig)()}};o.__conditionalRunners.push(d);const h=M(t,t[a+"Deps"],d),y=(0,E.createEffect)(h,{depth:o.path.length,label:O(o,"conditional("+e+")")}),A=o.__exec&&o.__exec[a]||t[a];y._sources.size===0&&typeof A=="function"&&(0,at.isLoudDevRuntime)()&&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(y)}}const ho=new WeakSet,ts=new WeakSet,os=new WeakSet;function Sn(t){if(os.has(t))return!1;if(!ts.has(t)){ts.add(t);const o=t.defaultView,s=()=>{os.add(t)};o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(s):setTimeout(s,0)}return!0}function Cn(t){const o=t.ownerDocument;!o||ho.has(o)||Sn(o)||(ho.add(o),queueMicrotask(()=>{ho.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const yo=new WeakSet;let ss=!1;function ns(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function _o(t,o){const s={...t};for(const n in o){const e=o[n],i=s[n];s[n]=e&&typeof e=="object"&&i&&typeof i=="object"?_o(i,e):e}return s}function es(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const i=es(e,o);Object.keys(i).length&&(s[n]=i)}else o.has(n)||(s[n]=e)}return s}function vn(t,o,s){let n=null;for(const[e,i]of o){const a=X(e),f=q.CSS_LONGHAND_SHORTHANDS[a];if(f)for(let r=0;r<f.length;r++){const c=f[r].replace(/-([a-z])/g,(y,A)=>A.toUpperCase()),l=t[c]!=null?o.get(c):void 0,u=s&&s.get(f[r]),d=l!==void 0&&l>i&&(0,q.cssShorthandStatesLonghand)(f[r],t[c],a),h=!d&&u!==void 0&&u>i&&(0,q.cssShorthandStatesLonghand)(f[r],void 0,a);if(d||h){d&&delete t[e],n||(n=new Set),n.add(e);break}}}return n}function rs(t){const{node:o}=t;if(!o)return;if(ss||(ss=!0,(0,tt.css)({display:"none"})),yo.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}yo.add(t);const s=t.context?.designSystem;s&&(0,k.pushConfig)(s),(0,P.pushStaticCssPass)();try{const n={};let e=!1,i=[],a=null,f=null,r=null;const c=t.__ref&&t.__ref.__mergeLayer;let l,u=null,d=null;const h=(p,_)=>{if(_&&typeof _=="object"&&ns(p)){f||(f={});const x=f[p];x&&(_=_o(x,_)),f[p]=_}else(_===null||typeof _!="object")&&(r||(r=new Set),r.add(p),l!==void 0&&(u||(u=new Map),u.set(p,l)));n[p]=_};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&P.CSS_PROPS_REGISTRY.theme){const p=P.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(p){const _=x=>{for(const S in x){const j=x[S];j&&typeof j=="object"&&ns(S)&&(a||(a={}),a[S]=j),n[S]=j}};if(Array.isArray(p))for(const x of p)x&&_(x);else _(p);e=!0}}const y=(p,_)=>{if(p==="vars"){const x=Bt(_);if(x){for(const S in x)h(S,x[S]);e=!0}return}if(P.CSS_PROPS_REGISTRY[p]){const x=P.CSS_PROPS_REGISTRY[p](_,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const j in S)h(j,S[j])}else for(const S in x)h(S,x[S]);e=!0}}else if(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(p))_!=null&&typeof _!="object"&&(h(p,_),e=!0);else if(p.charCodeAt(0)===45)_!=null&&typeof _!="object"&&(h(p,_),e=!0);else if((p.charAt(0)==="&"||p.charAt(0)==="@"||p.charAt(0)===":"||p.charAt(0)==="[")&&_&&typeof _=="object"&&!Array.isArray(_)){if(lo(_))return;const x=Xo(p,_,t);x&&(h(x.cssProp,x.block),e=!0)}};if(typeof t.class=="string"){const p=yn(t.class,t.context?.designSystem?.class);if(p)for(const _ in p)y(_,p[_])}const A=r?new Set(r):null,g=t.tag||"div";for(const p of Object.keys(t)){if(typeof t[p]=="function"){const x=c&&c.get(p);x!==void 0&&(0,W.isCssProp)(g,p)&&(d||(d=new Map),d.set(X(p),x));continue}if(l=c?c.get(p):void 0,p==="vars"){y(p,t[p]);continue}if(V.REGISTRY.has(p)||p==="theme")continue;const _=p.charCodeAt(0);_>=65&&_<=90||Q(p)||(0,W.isAttributeFirst)(g,p)||y(p,t[p])}l=void 0;const b=u?vn(n,u,d):null;if(a)for(const p in a){let _=r?es(a[p],r):a[p];f&&f[p]&&(_=_o(_,f[p])),Object.keys(_).length?n[p]=_:delete n[p]}if(fn(t,n,r,b?new Set([...A||[],...b]):A),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const p=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof p=="string"&&p!==""&&n.display&&n.display!==p&&(n.display=p);const _=(0,tt.css)(n,null,t.context?.cssPrefix);if(i=_?_.split(" ").filter(Boolean):[],_&&o.classList){const x=i;let S=!1;for(const j of x)o.classList.add(j),S||(j.charCodeAt(0)===95&&j.charCodeAt(1)===99||j.charCodeAt(0)===95&&j.indexOf("_c",1)!==-1)&&(S=!0);S&&Cn(o)}}const w=t.__ref;if(w){const p=w.__staticCssClasses;if(p&&o.classList){const _=new Set(i);for(const x of p)_.has(x)||o.classList.remove(x)}w.__staticCssClasses=i}an(t)}finally{(0,P.popStaticCssPass)(),s&&(0,k.popConfig)(),yo.delete(t)}}const kn=t=>!!P.CSS_PROPS_REGISTRY[t]||!!(P.DEFAULT_CSS_PROPERTIES_LIST&&P.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function jn(t){t&&t.node&&rs(t)}function is(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const i=t.aria[e];if(typeof i=="function"||typeof i=="object"||i==null||typeof i=="string"&&i.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,f=>"-"+f.toLowerCase());o.setAttribute(a,(0,C.serializeAttrValue)(a,i))}const s=(0,C.applyAttrTransforms)(t);for(const e in s){const i=s[e];i!=null&&i!==!1&&typeof i!="function"&&typeof i!="object"&&o.setAttribute(e,i===!0?"":i)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||V.REGISTRY.has(e)||e==="on"||s[e]!==void 0)continue;const i=e.charCodeAt(0);if(!(i>=65&&i<=90)&&!Q(e)&&!(0,W.isCssProp)(n,e)&&(0,C.checkAttributeByTagName)(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!C.ATTR_TRANSFORMS[e])continue;a=R.replaceLiteralsWithObjectFields.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!(0,C.isEnumeratedTrueFalseAttr)((0,C.camelToAttr)(e)||e))continue;const f=(0,C.camelToAttr)(e)||e;o.setAttribute(f,(0,C.serializeAttrValue)(f,a))}}}function En(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||Q(o))return;const e=t.tag||"div";if((0,W.isCssProp)(e,o)||!(0,C.checkAttributeByTagName)(e,o))return;const i=(0,C.camelToAttr)(o)||o,a=i.toLowerCase(),f=t.__ref&&t.__ref.__effects;let r=!1;if(f)for(let u=0;u<f.length;u++){const d=f[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(r=!0,d._execute())}if(r)return;let c=t[o];const l=C.ATTR_TRANSFORMS[o];if(l&&c!=null){const u=l(t);u!==void 0&&(c=u)}typeof c=="string"&&c.includes("{{")&&(c=R.replaceLiteralsWithObjectFields.call(t,c,t.state)),c==null||c===!1&&!(0,C.isEnumeratedTrueFalseAttr)(i)?s.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&s.setAttribute(i,(0,C.serializeAttrValue)(i,c))}function Pn(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{}fs(e),rt.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),ds(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,cs(t,e);return}e.awaitingLayout=!1;const a=Ln(s),f=Dn(a),r=s.style.height;s.style.height="0px",f&&bo(s);const c=s.scrollHeight;if(!(c>0)){s.style.height=r,f&&bo(s);return}const l=Mn(s,a),u=l!=null&&c<l?l:c,d=Fn(a),h=d!=null&&u>d;s.style.height=Nn(h?d:u,a)+"px",f&&bo(s),ds(s,e,h),e.lastMeasure=c,e.lastWidth=s.clientWidth,cs(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}fs(e),rt.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,Tn(t,e));const i=typeof o=="object"&&o.max!=null?String(o.max):null;i!==e.appliedMax&&(i==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=i,e.appliedMax=i),e.resize()}function Lt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),rt.add(t),It())}function On(){const t=Array.from(rt);rt.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=lt()),e.attachAttempts+=1,e.attachAttempts<=ko&&lt()-e.firstAttemptAt<jo&&(rt.add(s),It());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 i=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Lt(t,!0);return}const f=s.clientWidth;o.lastWidth!=null&&Math.abs(f-o.lastWidth)<.5||(o.lastWidth=f,Lt(t,!0))};let a;try{a=new e(i),a.observe(s)}catch{return}o.watch=a}function fs(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function Tn(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 Ln(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const ct=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,go=t=>(ct(t.paddingTop)||0)+(ct(t.paddingBottom)||0),as=t=>(ct(t.borderTopWidth)||0)+(ct(t.borderBottomWidth)||0);function Dn(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 bo(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 Mn(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=ct(o.lineHeight)||Rn(t,o);return n>0?s*n+go(o):null}const Dt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],us=new WeakMap;function Rn(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 i=Dt.map(c=>o[c]||"").join("|");if(e.has(i))return e.get(i);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const f=a.style;f.position="absolute",f.visibility="hidden",f.top="0",f.left="-9999px",f.height="auto",f.minHeight="0",f.maxHeight="none",f.padding="0",f.border="0",f.boxSizing="content-box",f.overflow="hidden";for(let c=0;c<Dt.length;c++)o[Dt[c]]&&(f[Dt[c]]=o[Dt[c]]);let r=0;try{n.appendChild(a),r=a.clientHeight}catch{r=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return r>0?(e.set(i,r),r):null}function Nn(t,o){return o?o.boxSizing==="border-box"?t+as(o):o.boxSizing==="content-box"?Math.max(0,t-go(o)):t:t}function Fn(t){if(!t)return null;const o=ct(t.maxHeight);if(o==null||!(o>0))return null;const s=go(t),n=as(t),e=t.boxSizing==="border-box"?o-n:o+s,i=ct(t.lineHeight);if(!(i>0))return e;const a=Math.floor((e-s)/i+1e-6);return a>=1?a*i+s:e}function ds(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 ls=["srcObject","muted"],$n=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function In(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<ls.length;n++){const e=ls[n],i=t[e];if(i===void 0||!(e in o))continue;const a=f=>{const r=$n(e,f);if(o[e]!==r)try{o[e]=r}catch(c){N(s,e,c)}};if(typeof i=="function"){const f=M(t,t[e+"Deps"],i),r=(0,E.createEffect)(()=>{try{a(f(t,t.state,t.context))}catch(c){N(s,e,c)}},{depth:s.path.length,label:O(s,e)});s.__effects.push(r),s.__exec[e]=i}else a(i);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function ps(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"?M(t,t.autoGrowDeps,n):null,i=(0,E.createEffect)(()=>{const a=t.autoGrow;let f=a;if(typeof a=="function")try{f=(a===n&&e?e:a)(t,t.state,t.context)}catch{f=null}Pn(t,f)},{depth:s.path.length,label:O(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(i),e&&(s.__exec.autoGrow=n)}const hs=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function ys(t,o){for(const s of Object.keys(t)){if(!Q(s)||hs.has(s))continue;const n=(0,At.globalEventKeyInfo)(s);if(n){(0,At.registerGlobalEvent)(n,t,t[s]);continue}let e=t[s],i=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(i=e,e=i.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const f=e;e=function(c){return t.call(f,c)}}if(typeof e!="function")continue;const a=Hs(s);V.LIFECYCLE_EVENTS.has(a)||(0,At.registerEvent)(Vs(a),t,e,i)}Un(t)}function Un(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const d of hs){const h=t[d];typeof h=="function"&&(s[d]=h,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,i=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,f=0,r=0,c=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,f=h.clientY,r=Date.now(),c=!0)},u=d=>{if(!c)return;c=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const y=h.clientX-a,A=h.clientY-f,g=Date.now()-r;if(g>i)return;const b=Math.abs(y),w=Math.abs(A);if(Math.max(b,w)<e)return;let p;if(b>w*1.2)p=y<0?"left":"right";else if(w>b*1.2)p=A<0?"up":"down";else return;const _="onSwipe"+p.charAt(0).toUpperCase()+p.slice(1),x=s[_],S=s.onSwipe;x&&x.call(t,d,t,t.state,t.context),S&&S.call(t,{direction:p,dx:y,dy:A,dt:g,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function ft(t,o){const s={...t};for(const n in o){const e=s[n],i=o[n];e&&i&&typeof e=="object"&&typeof i=="object"&&!Array.isArray(e)&&!Array.isArray(i)&&typeof e!="function"&&typeof i!="function"?s[n]=ft(e,i):s[n]=i}return s}function Ao(t,o,s,n,e){if(!o||!t.node)return;const i=t.childExtends,a=ht(t,"childProps");if(Array.isArray(o)){const f=t.tag==="fragment",r=t.context?.document||globalThis.document,c=f?null:r?.createDocumentFragment();if(!f&&!c)return;const l=t.childProps,u=t.childrenAs,d=w=>{let p=o[w];const _=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let x=l;if(typeof l=="function")try{x=l(t,p)}catch{x=null}let S=typeof l=="function"?Et(x):a;if(e&&u!=="state"&&(S=Pt(S,Et(_))),u==="state"){let v=_;(typeof _=="string"||typeof _=="number")&&(v={value:_,text:_}),p=x?{...x,state:v}:{state:v}}else x&&(p=ft(x,p));if(i&&!p.ignoreChildExtends)if(p.extends){const v=Array.isArray(p.extends)?p.extends:[p.extends],$=Array.isArray(i)?i:[i];p={...p,extends:[...$,...v]}}else p={...p,extends:i};const j=Po(p?.key,_,w);try{return m(Ot(p,S),t,j,s)}catch(v){if(typeof console<"u"&&console.error){const $=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${j}" failed to construct at ${$} (initial render, skipping this row):`,v?.message||v)}return null}},h=t.__ref;if(!(n===!0&&!f&&!!h&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const p=d(w);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const A=h.__childrenChunkGen=(h.__childrenChunkGen||0)+1;(0,G.openMountBudget)();let g=null;const b=w=>{if(h.__disposed||h.__childrenChunkGen!==A){g&&g.parentNode&&g.remove();return}for(let p=w;p<o.length;p++){const _=d(p);if(_?.node&&(g?t.node.insertBefore(_.node,g):c.appendChild(_.node)),p+1<o.length&&(0,G.mountBudgetExhausted)()){g||(g=r.createComment("smbls-mount"),c.appendChild(g),t.node.appendChild(c));const x=p+1;(0,G.enqueueMountWork)(()=>b(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&Gt(t,!0)):t.node.appendChild(c)};return b(0),(0,G.closeMountBudget)(),!0}if(typeof o=="string"){const f=To(o,t);if(Array.isArray(f))return Ao(t,f,s,n,!0)}if(typeof o=="object")for(const f in o){if(V.REGISTRY.has(f))continue;let r=o[f];if(r==null||r===!1)continue;const c=e?Pt(a,Et(r)):a;if((typeof r=="string"||typeof r=="number")&&(r={text:r}),t.childProps&&(r=ft(t.childProps,r)),i&&!r.ignoreChildExtends)if(r.extends){const l=Array.isArray(r.extends)?r.extends:[r.extends],u=Array.isArray(i)?i:[i];r={...r,extends:[...u,...l]}}else r={...r,extends:i};m(Ot(r,c),t,f,s)}}function Gt(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,i=e&&e.__exec&&e.__exec.value,a=typeof i=="function",f=t.value!=null&&typeof t.value!="function";if(a||f){let l;if(a)try{l=i(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=R.replaceLiteralsWithObjectFields.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const r=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!r)return;let c=-1;for(let l=0;l<n.length;l++)n[l].defaultSelected&&(c=l);c>=0&&s.selectedIndex!==c&&(s.selectedIndex=c)}function _s(t,o){let{children:s,content:n}=t;const e=t.childExtends,i=typeof s=="function"||Mo(t,"children");if(typeof s=="function"){const y=s;try{s=y(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const _=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${_} (initial run, treating as empty):`,p?.message||p)}}Ro(t,s),t.children=s;const A=t.__ref;let g=!1;const b=M(t,t.childrenDeps,y),w=(0,E.createEffect)(()=>{const p=g;g=!0;let _;try{_=b(t,t.state,t.context)}catch(L){if(typeof console<"u"&&console.error){const I=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${I}${p?"":" (initial tracking run)"}:`,L?.message||L)}return}if(!p||_===t.children)return;Ro(t,_),t.children=_,A.__childrenChunkGen!=null&&A.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,j=x?[]:null,v=x?[]:null;if(Array.isArray(_)&&t.childrenAs==="state"){const L=t.childProps,I=[],xt=new Map;for(let T=0;T<_.length;T++){const K=_[T];let D=L;if(typeof L=="function")try{D=L(t,K)}catch{D=null}const Z=Po(D&&D.key,K,T);I.push(Z),xt.set(Z,{rawChild:K,childProps:D})}const Cs=new Set(I),vs=A.__children.slice();for(const T of vs)if(!Cs.has(T)){const K=t[T];K?.remove&&K.remove(),delete t[T],j&&j.push(T)}const wt=t.childExtends,Nt=t.tag==="fragment",ks=t.context?.document||globalThis.document,St=Nt?null:ks?.createDocumentFragment(),qt=new Set;for(const T of I){const K=xt.get(T),D=K.rawChild,Z=t[T];if(Z&&Z.state){if(D&&typeof D=="object"){const H=Z.state,ut=H.$replace||H.replace,xo=H.$update||H.update;try{if(typeof ut=="function")ut.call(H,D);else if(typeof xo=="function"){for(const B in H)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(D,B))try{H[B]=void 0}catch{}xo.call(H,D)}else for(const B in D)H[B]=D[B]}catch(B){if(typeof console<"u"&&console.error){const Es=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Es} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}v&&v.push(T);continue}let Zt=D;(typeof D=="string"||typeof D=="number")&&(Zt={value:D,text:D});const Qt=K.childProps;let z=Qt?{...Qt,state:Zt}:{state:Zt};const js=typeof L=="function"?Et(Qt):ht(t,"childProps");if(wt&&!z.ignoreChildExtends)if(z.extends){const H=Array.isArray(z.extends)?z.extends:[z.extends],ut=Array.isArray(wt)?wt:[wt];z={...z,extends:[...ut,...H]}}else z={...z,extends:wt};let Xt;try{Xt=m(Ot(z,js),t,T,o)}catch(H){if(typeof console<"u"&&console.error){const ut=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${ut} (reconcile, skipping this row):`,H?.message||H)}qt.add(T);continue}!Nt&&Xt?.node&&St&&St.appendChild(Xt.node),S&&S.push(T)}if(!Nt&&St&&St.childNodes.length&&t.node&&t.node.appendChild(St),!Nt&&t.node){let T=null;for(const K of I){const D=t[K]?.node;if(!D)continue;const Z=T?T.nextSibling:t.node.firstChild;D!==Z&&t.node.insertBefore(D,Z),T=D}}A.__children=qt.size?I.filter(T=>!qt.has(T)):I,x&&(S.length||j.length)&&Eo(t,{added:S,removed:j,kept:v}),Gt(t,!1);return}const et=x?[...A.__children]:null;for(const L of[...A.__children]){const I=t[L];I?.remove&&I.remove(),delete t[L]}A.__children=[],Ao(t,_,o,!1,!0),Gt(t,!1),x&&Eo(t,{added:[...A.__children],removed:et,kept:[]})},{depth:A.path.length,label:O(A,"children")});A.__effects.push(w)}const a=Ao(t,s,o,!0,i);if(n!=null&&!(n&&n.__ref)){let y=n;if(typeof y=="string"||typeof y=="number"?y={text:y}:typeof y!="object"&&(y={}),t.childProps&&(y=ft(t.childProps,y)),e&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],b=Array.isArray(e)?e:[e];y={...y,extends:[...b,...g]}}else y={...y,extends:e};const A=Pt(ht(t,"childProps"),ht(t,"content"));m(Ot(y,A),t,"content",o)}if(s&&!a)return;const f=t.context?.components||{},r=t.__ref&&t.__ref.__runtimeSource,c=r?{}:null;{const y=Object.keys(t);for(let A=0;A<y.length;A++){const g=y[A];if(!g.endsWith("Extends")||typeof t[g]!="string")continue;const b=g.slice(0,-7);if(!b||b.charCodeAt(0)<65||b.charCodeAt(0)>90)continue;const w={extends:t[g]};delete t[g];for(let p=A+1;p<y.length;p++){const _=y[p],x=_.charCodeAt(0);if(x>=65&&x<=90||V.REGISTRY.has(_)||typeof t[_]=="function"&&(_.startsWith("on")||_.startsWith(".")))break;const S=t[_];S!==void 0&&(w[_]=S,delete t[_],c&&jt(r,_)&&(c[b]||(c[b]={}),c[b][_]=r[_]))}t[b]&&typeof t[b]=="object"?t[b]={...w,...t[b]}:t[b]=w}}const l=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),d=y=>{if(V.REGISTRY.has(y)||typeof t[y]!="object"||t[y]===null)return;const A=y.charCodeAt(0);if(A<65||A>90)return;let g=t[y];if(g.__ref)return;if(!g.extends&&!g.extend){const w=f[y]||f[`smbls.${y}`];w&&(g={...g,extends:w})}if(t.childProps&&(g=ft(t.childProps,g)),e&&!g.ignoreChildExtends)if(g.extends){const w=Array.isArray(g.extends)?g.extends:[g.extends],p=Array.isArray(e)?e:[e];g={...g,extends:[...p,...w]}}else g={...g,extends:e};const b=r?Pt(ht(t,"childProps"),Pt(c[y]||null,ht(t,y))):null;m(Ot(g,b),t,y,o)};if(!l){for(const y of u)d(y);return}(0,G.openMountBudget)();const h=y=>{for(let A=y;A<u.length;A++)if(d(u[A]),A+1<u.length&&(0,G.mountBudgetExhausted)()){const g=A+1;(0,G.enqueueMountWork)(()=>h(g));return}};h(0),(0,G.closeMountBudget)()}function gs(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 f=s.node.nextSibling;a.insertBefore(n,f||e)}else a.insertBefore(n,e);return}}const i=o?.node||(o?.nodeType?o:null);if(i)if(s?.position==="before"&&s.node)i.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?i.insertBefore(n,a):i.appendChild(n)}else i.appendChild(n)}const zt=3;function Ss(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=zt?!1:(t.__inBeforeUpdate=!0,!0)}function Rt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===zt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${zt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function F(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);o.context?.plugins?.length&&(0,Y.runPluginHook)(n,o,s);const e="on"+t,i=o[e];if(typeof i=="function"){const r=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(r){if(o.__ref[r])return!0;o.__ref[r]=!0}const c=o.context?.designSystem;c&&(0,k.pushConfig)(c);let l=!!r;try{const u=i(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{o.context?.plugins?.length&&(0,Y.runPluginHook)("error",o,{hook:e,error:h})||console.error(`[DOMQL] Lifecycle "${e}" error:`,h)}).finally(()=>{r&&d&&(d[r]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if(o.context?.plugins?.length&&(0,Y.runPluginHook)("error",o,{hook:e,error:u})||console.error(`[DOMQL] Lifecycle "${e}" error:`,u),o.context?.strictMode)throw u}finally{c&&(0,k.popConfig)(),l&&o.__ref&&(o.__ref[r]=!1)}}return!0}var Hn=m;
@@ -1 +1 @@
1
- var i=Object.create;var p=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var G=(e,o)=>{for(var a in o)p(e,a,{get:o[a],enumerable:!0})},n=(e,o,a,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let f of v(o))!u.call(e,f)&&f!==a&&p(e,f,{get:()=>o[f],enumerable:!(m=N(o,f))||m.enumerable});return e};var I=(e,o,a)=>(a=e!=null?i(S(e)):{},n(o||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),c=e=>n(p({},"__esModule",{value:!0}),e);var L={};G(L,{DELEGATED_EVENTS:()=>r.DELEGATED_EVENTS,LIFECYCLE_EVENTS:()=>r.LIFECYCLE_EVENTS,MIXINS:()=>r.MIXINS,NON_BUBBLING_EVENTS:()=>r.NON_BUBBLING_EVENTS,REGISTRY:()=>r.REGISTRY,SVG_TAGS:()=>t.SVG_TAGS,addDelegatedEvent:()=>E.addDelegatedEvent,addMethods:()=>l.addMethods,applyExtends:()=>g.applyExtends,cacheNode:()=>t.cacheNode,create:()=>d.create,createHTMLNode:()=>t.createHTMLNode,default:()=>d.default,detectTag:()=>t.detectTag,dispose:()=>s.dispose,flushMounts:()=>d.flushMounts,globalEventKeyInfo:()=>E.globalEventKeyInfo,inertOutsidePlugin:()=>T.inertOutsidePlugin,isSvgTag:()=>t.isSvgTag,isValidTag:()=>t.isValidTag,refreshContextProto:()=>l.refreshContextProto,registerEvent:()=>E.registerEvent,registerGlobalEvent:()=>E.registerGlobalEvent,remove:()=>s.remove,removeDelegatedEvent:()=>E.removeDelegatedEvent,update:()=>x.update});module.exports=c(L);var d=I(require("./create.js"),1),x=require("./update.js"),s=require("./dispose.js"),r=require("./registry.js"),E=require("./delegate.js"),t=require("./cache.js"),g=require("./extends.js"),l=require("./methods.js"),T=require("./inertOutside.js");
1
+ var N=Object.create;var f=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var G=(t,o)=>{for(var d in o)f(t,d,{get:o[d],enumerable:!0})},s=(t,o,d,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of v(o))!u.call(t,p)&&p!==d&&f(t,p,{get:()=>o[p],enumerable:!(m=T(o,p))||m.enumerable});return t};var I=(t,o,d)=>(d=t!=null?N(S(t)):{},s(o||!t||!t.__esModule?f(d,"default",{value:t,enumerable:!0}):d,t)),c=t=>s(f({},"__esModule",{value:!0}),t);var h={};G(h,{DELEGATED_EVENTS:()=>r.DELEGATED_EVENTS,LIFECYCLE_EVENTS:()=>r.LIFECYCLE_EVENTS,MIXINS:()=>r.MIXINS,NON_BUBBLING_EVENTS:()=>r.NON_BUBBLING_EVENTS,REGISTRY:()=>r.REGISTRY,SVG_TAGS:()=>e.SVG_TAGS,addDelegatedEvent:()=>a.addDelegatedEvent,addMethods:()=>l.addMethods,adoptHydrationNode:()=>e.adoptHydrationNode,applyExtends:()=>g.applyExtends,cacheNode:()=>e.cacheNode,create:()=>E.create,createHTMLNode:()=>e.createHTMLNode,default:()=>E.default,detectTag:()=>e.detectTag,dispose:()=>n.dispose,elementPath:()=>e.elementPath,flushMounts:()=>E.flushMounts,globalEventKeyInfo:()=>a.globalEventKeyInfo,inertOutsidePlugin:()=>i.inertOutsidePlugin,isSvgTag:()=>e.isSvgTag,isValidTag:()=>e.isValidTag,refreshContextProto:()=>l.refreshContextProto,registerEvent:()=>a.registerEvent,registerGlobalEvent:()=>a.registerGlobalEvent,remove:()=>n.remove,removeDelegatedEvent:()=>a.removeDelegatedEvent,update:()=>x.update});module.exports=c(h);var E=I(require("./create.js"),1),x=require("./update.js"),n=require("./dispose.js"),r=require("./registry.js"),a=require("./delegate.js"),e=require("./cache.js"),g=require("./extends.js"),l=require("./methods.js"),i=require("./inertOutside.js");
@@ -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.799";
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.800";
@@ -1 +1 @@
1
- const i="http://www.w3.org/2000/svg",s=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),p=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function d(e){return p.has(e)||s.has(e)}function l(e){return s.has(e)}function g(e){let{tag:t,key:o}=e;if(typeof t=="function")try{t=t(e,e.state,e.context)}catch(n){t=void 0,typeof console<"u"&&console.error&&console.error(`[smbls] \`tag:\` factory threw on "${o||"<anon>"}" \u2014 falling back to key-based tag detection:`,n?.message||n)}if(t===!0&&(t=o),typeof t=="string"&&d(t))return t;if(!o||typeof o!="string")return"div";const a=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]);let r=o.toLowerCase();return r.includes(".")&&(r=r.split(".")[0]),r.includes("_")&&(r=r.split("_")[0]),d(r)&&!a.has(r)?r:"div"}const f={};function u(e,t){const o=t?.context?.document||globalThis.document;if(!o)return null;if(e==="string")return o.createTextNode(t?.text||"");if(e==="fragment")return o.createDocumentFragment();if(l(e)){const a=t?.parent;if(e==="svg"||a?.node?.namespaceURI===i)return o.createElementNS(i,e);if(e!=="svg")return o.createElement("div")}return o.createElement(e)}function m(e){const t=e.tag=g(e),a=l(t)&&(t==="svg"||e.parent?.node?.namespaceURI===i)?"svg:"+t:t,r=e?.context?.document||globalThis.document;let n=f[a];if(n||(n=f[a]=u(t,e)),!n)return null;const c=r&&n.ownerDocument!==r?u(t,e):n.cloneNode(!0);return t==="string"&&(c.nodeValue=e.text||""),c}export{i as SVG_NS,s as SVG_TAGS,m as cacheNode,u as createHTMLNode,g as detectTag,l as isSvgTag,d as isValidTag};
1
+ const i="http://www.w3.org/2000/svg",d=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),y=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function l(t){return y.has(t)||d.has(t)}function c(t){return d.has(t)}function u(t){let{tag:e,key:n}=t;if(typeof e=="function")try{e=e(t,t.state,t.context)}catch(o){e=void 0,typeof console<"u"&&console.error&&console.error(`[smbls] \`tag:\` factory threw on "${n||"<anon>"}" \u2014 falling back to key-based tag detection:`,o?.message||o)}if(e===!0&&(e=n),typeof e=="string"&&l(e))return e;if(!n||typeof n!="string")return"div";const a=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]);let r=n.toLowerCase();return r.includes(".")&&(r=r.split(".")[0]),r.includes("_")&&(r=r.split("_")[0]),l(r)&&!a.has(r)?r:"div"}const p={};function g(t,e){const n=e?.context?.document||globalThis.document;if(!n)return null;if(t==="string")return n.createTextNode(e?.text||"");if(t==="fragment")return n.createDocumentFragment();if(c(t)){const a=e?.parent;if(t==="svg"||a?.node?.namespaceURI===i)return n.createElementNS(i,t);if(t!=="svg")return n.createElement("div")}return n.createElement(t)}function x(t){const e=t.tag=u(t),a=c(e)&&(e==="svg"||t.parent?.node?.namespaceURI===i)?"svg:"+e:e,r=t?.context?.document||globalThis.document;let o=p[a];if(o||(o=p[a]=g(e,t)),!o)return null;const s=r&&o.ownerDocument!==r?g(e,t):o.cloneNode(!0);return e==="string"&&(s.nodeValue=t.text||""),s}const h=t=>{const e=t.__ref;if(e&&e.__hydrationPath!==void 0)return e.__hydrationPath;const n=t.parent,a=n&&n.__ref?h(n):null,r=a===null?"":a?a+"."+t.key:String(t.key);return e&&(e.__hydrationPath=r),r},v=new Set(["src","srcset"]);function _(t){const e=t?.context?.__hydration;if(!e)return null;const n=t.tag=u(t);if(n==="string"||n==="fragment")return null;const a=h(t),r=e.registry[a===""?"__root":a],o=r!==void 0?e.nodes[r]:null;if(!o||o.nodeType!==1||e.claimed.has(o))return r!==void 0&&e.misses++,null;const s=c(n)&&(n==="svg"||t.parent?.node?.namespaceURI===i),m=c(n)&&!s&&n!=="svg"?"div":n,b=s?o.namespaceURI===i:o.namespaceURI!==i;if(o.localName!==m||!b)return e.misses++,null;e.claimed.add(o),e.adopted++;for(const f of Array.from(o.getAttributeNames?o.getAttributeNames():[]))v.has(f)||o.removeAttribute(f);for(;o.firstChild;)o.removeChild(o.firstChild);return o}export{i as SVG_NS,d as SVG_TAGS,_ as adoptHydrationNode,x as cacheNode,g as createHTMLNode,u as detectTag,h as elementPath,c as isSvgTag,l as isValidTag};
@@ -1,6 +1,6 @@
1
- import{createStore as Qt,createScopeStore as $s,isStore as Y}from"@symbo.ls/signal";import{createEffect as j,getObserver as ko,setObserver as Nt}from"@symbo.ls/signal";import{cacheNode as Xt,detectTag as jo}from"./cache.js";import{REGISTRY as G,LIFECYCLE_EVENTS as Is}from"./registry.js";import{registerEvent as Us,registerGlobalEvent as Hs,globalEventKeyInfo as Vs}from"./delegate.js";import{mountBridge as Bs}from"./bridge.js";import{applyExtends as Gs,openMergeLayer as Ks}from"./extends.js";import{addMethods as Ws}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as ft}from"./devRuntime.js";import{mountBudgetExhausted as Eo,openMountBudget as Po,closeMountBudget as Oo,enqueueMountWork as To}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as I,isPolyglotWritableKey as zs,markPolyglotSeeded as Ys}from"@symbo.ls/utils";import*as Ft from"@symbo.ls/utils";import{runPluginHook as q}from"@symbo.ls/utils/function.js";import{applyStateMethods as xt}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as U,DEFAULT_CSS_PROPERTIES_LIST as V,pushStaticCssPass as Lo,popStaticCssPass as Do,resolveStyleBlockTokens as qs}from"css-in-props";import{css as wt,wrapHoverRule as Mo}from"@symbo.ls/css";import{pushConfig as L,popConfig as D}from"@symbo.ls/scratch";import{checkAttributeByTagName as St,applyAttrTransforms as Zs,ATTR_TRANSFORMS as Jt,camelToAttr as Ct,serializeAttrValue as K,isEnumeratedTrueFalseAttr as at,extractConditionalAttrs as Qs}from"attrs-in-props";import{resolveElementIdEngine as Xs}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as $t,CSS_SHORTHAND_LONGHANDS as Js,cssShorthandStatesLonghand as Ro}from"./cssLonghands.js";import{isAttributeFirst as No,isCssProp as st}from"./attributeFirst.js";import{VERSION as ms}from"./version.js";const Fo=Xs({uniqId:1,scopedStyleId:0},ms),vt=[],nt=new Set;let mt=!1,$o=0,ut=null,kt=null;function dt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Io(){return typeof document<"u"&&document.visibilityState==="hidden"}const tn=250,on=1e3;function sn(){return kt&&(kt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Io())?!0:dt()-$o>=on}function nn(){if(mt=!0,$o=dt(),kt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(to,0);ut=t?()=>t(o):null;return}if(Io()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(to,tn);ut=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;kt=requestAnimationFrame;const o=requestAnimationFrame(to);ut=t?()=>t(o):null}}function It(){if(mt){if(!sn())return;const t=ut;if(ut=null,t)try{t()}catch{}}nn()}const Uo=300,Ho=15e4;function to(){if(mt=!1,ut=null,kt=null,nt.size&&Kn(),!vt.length)return;const t=vt.splice(0,vt.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const e=s.__ref||(s.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=dt());const r=dt()-e.__mountFirstAttemptAt;e.__mountAttempts<=Uo&&r<Ho?(vt.push(s),It()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&Bs(s),typeof s.onMounted=="function"&&R("Mounted",s,s.__ref?.__mountOptions||{})}}}function oo(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Dt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,vt.push(t),It())}function Vo(t,o){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&q("contentUpdate",t,o);const s=t.context?.designSystem;s&&L(s);try{t.onContentUpdate(t,t.state,t.context,o)}catch(e){if(t.context?.plugins?.length&&q("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{s&&D()}}function Z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function en(t){return t.charAt(2).toLowerCase()+t.slice(3)}function rn(t){return t.toLowerCase()}function so(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function jt(t,o){const s={...t};for(const e in o){const r=s[e],i=o[e];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[e]=jt(r,i):s[e]=i}return s}function Ut(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Bo(t,o,s){return Ut(t)||(o&&typeof o=="object"?Ut(o.key):void 0)||String(s)}function J(t,o,s,e={},r){const i=ko();if(i){Nt(null);try{return J(t,o,s,e,r)}finally{Nt(i)}}if(t==null||t===!1)return null;const a=bn(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Ut(s);const f=Ut(t.key),n=Object.create(null);n.key=s||f||`_${Fo.uniqId++}`,n.parent=o||null,n.context=t.context||o?.context||e.context||{},n.context.__create||(n.context.__create=J);const c=n.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||n,path:o?.__ref?.path?[...o.__ref.path,n.key]:[n.key],origin:t};a&&(c.__runtimeSource=a);const l=t;if(t=Go(n,t,s,f,o,e),n.if!=null){let d;if(typeof n.if=="function")try{d=n.if(n,n.state,n.context)}catch(h){if(d=!1,c.__ifError=h,typeof console<"u"&&console.warn){const y=n.key||n.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,h?.message||h)}}else d=n.if;c.__if=!!d}if(c.__if)typeof n.if=="function"&&(c.__ifInitialized=!0);else{o&&(o[n.key]=n);const d=an(t,s,n.context?.components);return d.length&&(c.__ifLateMerge={definition:l,key:s,ownKey:f,names:d,options:e}),typeof n.if=="function"&&Jo(n,c,n.if),n}n.tag||(n.tag=jo(n)),R("Init",n,e);const u=n.node=Xt(n);if(!u)return n;if(n.tag==="fragment"){const h=(n.context?.document||globalThis.document).createComment("");u.appendChild(h),c.__fragmentAnchor=h}R("AttachNode",n,e),u.setAttribute&&n.key&&u.setAttribute("data-key",n.key),o&&(o[n.key]=n,o.__ref?.__children&&(o.__ref.__children.includes(n.key)||o.__ref.__children.push(n.key))),u.setAttribute&&n.context?.scopeSelector&&n.context.scopeSelector!==":root"&&n.context.key&&n.key===n.context.key&&u.setAttribute("data-smbls-app",n.context.key),n.id&&u.setAttribute&&(u.id=n.id),Os(n,e),Qo(n),fo(n),xs(n),_o(n),Es(n),mn(n);try{Ts(n,e)}catch(d){if(typeof console<"u"&&console.error){const h=n.__ref?.path?.join(".")||n.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,d?.message||d,d?.stack?`
1
+ import{createStore as Qt,createScopeStore as $s,isStore as Y}from"@symbo.ls/signal";import{createEffect as j,getObserver as ko,setObserver as Nt}from"@symbo.ls/signal";import{cacheNode as Xt,detectTag as jo,adoptHydrationNode as Is}from"./cache.js";import{REGISTRY as G,LIFECYCLE_EVENTS as Us}from"./registry.js";import{registerEvent as Hs,registerGlobalEvent as Vs,globalEventKeyInfo as Bs}from"./delegate.js";import{mountBridge as Gs}from"./bridge.js";import{applyExtends as Ks,openMergeLayer as Ws}from"./extends.js";import{addMethods as zs}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as ft}from"./devRuntime.js";import{mountBudgetExhausted as Eo,openMountBudget as Po,closeMountBudget as Oo,enqueueMountWork as To}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as I,isPolyglotWritableKey as Ys,markPolyglotSeeded as qs}from"@symbo.ls/utils";import*as Ft from"@symbo.ls/utils";import{runPluginHook as q}from"@symbo.ls/utils/function.js";import{applyStateMethods as xt}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as U,DEFAULT_CSS_PROPERTIES_LIST as V,pushStaticCssPass as Lo,popStaticCssPass as Do,resolveStyleBlockTokens as Zs}from"css-in-props";import{css as wt,wrapHoverRule as Mo}from"@symbo.ls/css";import{pushConfig as L,popConfig as D}from"@symbo.ls/scratch";import{checkAttributeByTagName as St,applyAttrTransforms as Qs,ATTR_TRANSFORMS as Jt,camelToAttr as Ct,serializeAttrValue as K,isEnumeratedTrueFalseAttr as at,extractConditionalAttrs as Xs}from"attrs-in-props";import{resolveElementIdEngine as Js}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as $t,CSS_SHORTHAND_LONGHANDS as ms,cssShorthandStatesLonghand as Ro}from"./cssLonghands.js";import{isAttributeFirst as No,isCssProp as st}from"./attributeFirst.js";import{VERSION as tn}from"./version.js";const Fo=Js({uniqId:1,scopedStyleId:0},tn),vt=[],nt=new Set;let mt=!1,$o=0,ut=null,kt=null;function dt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Io(){return typeof document<"u"&&document.visibilityState==="hidden"}const on=250,sn=1e3;function nn(){return kt&&(kt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Io())?!0:dt()-$o>=sn}function en(){if(mt=!0,$o=dt(),kt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(to,0);ut=t?()=>t(o):null;return}if(Io()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(to,on);ut=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;kt=requestAnimationFrame;const o=requestAnimationFrame(to);ut=t?()=>t(o):null}}function It(){if(mt){if(!nn())return;const t=ut;if(ut=null,t)try{t()}catch{}}en()}const Uo=300,Ho=15e4;function to(){if(mt=!1,ut=null,kt=null,nt.size&&Wn(),!vt.length)return;const t=vt.splice(0,vt.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const e=s.__ref||(s.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=dt());const r=dt()-e.__mountFirstAttemptAt;e.__mountAttempts<=Uo&&r<Ho?(vt.push(s),It()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&Gs(s),typeof s.onMounted=="function"&&R("Mounted",s,s.__ref?.__mountOptions||{})}}}function oo(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Dt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,vt.push(t),It())}function Vo(t,o){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&q("contentUpdate",t,o);const s=t.context?.designSystem;s&&L(s);try{t.onContentUpdate(t,t.state,t.context,o)}catch(e){if(t.context?.plugins?.length&&q("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{s&&D()}}function Z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function rn(t){return t.charAt(2).toLowerCase()+t.slice(3)}function cn(t){return t.toLowerCase()}function so(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function jt(t,o){const s={...t};for(const e in o){const r=s[e],i=o[e];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[e]=jt(r,i):s[e]=i}return s}function Ut(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Bo(t,o,s){return Ut(t)||(o&&typeof o=="object"?Ut(o.key):void 0)||String(s)}function J(t,o,s,e={},r){const i=ko();if(i){Nt(null);try{return J(t,o,s,e,r)}finally{Nt(i)}}if(t==null||t===!1)return null;const a=An(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Ut(s);const f=Ut(t.key),n=Object.create(null);n.key=s||f||`_${Fo.uniqId++}`,n.parent=o||null,n.context=t.context||o?.context||e.context||{},n.context.__create||(n.context.__create=J);const c=n.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||n,path:o?.__ref?.path?[...o.__ref.path,n.key]:[n.key],origin:t};a&&(c.__runtimeSource=a);const l=t;if(t=Go(n,t,s,f,o,e),n.if!=null){let d;if(typeof n.if=="function")try{d=n.if(n,n.state,n.context)}catch(h){if(d=!1,c.__ifError=h,typeof console<"u"&&console.warn){const y=n.key||n.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,h?.message||h)}}else d=n.if;c.__if=!!d}if(c.__if)typeof n.if=="function"&&(c.__ifInitialized=!0);else{o&&(o[n.key]=n);const d=un(t,s,n.context?.components);return d.length&&(c.__ifLateMerge={definition:l,key:s,ownKey:f,names:d,options:e}),typeof n.if=="function"&&Jo(n,c,n.if),n}n.tag||(n.tag=jo(n)),R("Init",n,e);const u=n.node=Is(n)||Xt(n);if(!u)return n;if(n.tag==="fragment"){const h=(n.context?.document||globalThis.document).createComment("");u.appendChild(h),c.__fragmentAnchor=h}R("AttachNode",n,e),u.setAttribute&&n.key&&u.setAttribute("data-key",n.key),o&&(o[n.key]=n,o.__ref?.__children&&(o.__ref.__children.includes(n.key)||o.__ref.__children.push(n.key))),u.setAttribute&&n.context?.scopeSelector&&n.context.scopeSelector!==":root"&&n.context.key&&n.key===n.context.key&&u.setAttribute("data-smbls-app",n.context.key),n.id&&u.setAttribute&&(u.id=n.id),Os(n,e),Qo(n),fo(n),xs(n),_o(n),Es(n),te(n);try{Ts(n,e)}catch(d){if(typeof console<"u"&&console.error){const h=n.__ref?.path?.join(".")||n.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,d?.message||d,d?.stack?`
2
2
  `+d.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(Kt(n,!0),Ls(n,o,r),typeof n.html=="function"&&n.node&&!n.node.innerHTML){const d=n.context?.designSystem;d&&L(d);try{const h=n.html(n,n.state,n.context);h!=null&&typeof h!="function"&&(n.node.innerHTML=h)}catch{}finally{d&&D()}}if(R("Create",n,e),R("Complete",n,e),R("Render",n,e),R("RenderRouter",n,e),oo(n,e),typeof n.onFrame=="function"){const d=n.onFrame,h=n.context?.designSystem,y=()=>{if(n.node){if(n.node.isConnected){h&&L(h);try{d(n,n.state,n.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{h&&D()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return n}function Go(t,o,s,e,r,i){if(s&&!o.extends&&!o.extend){const b=s.indexOf("_"),w=s.indexOf(".");let p=b>0?b:-1;if(w>0&&(p<0||w<p)&&(p=w),p>0){const _=s.substring(0,p),x=t.context?.components;x&&(x[_]||x["smbls."+_])?o={...o,extends:_}:x&&ft()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${_}" but neither "${_}" nor "smbls.${_}" 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),Gs(t,o,i);const a=Ks(t),f=a?a.rank:0,n=new Set(["childProps","attr","style","scope","data","vars"]),c=t.props&&typeof t.props=="object"?t.props:null;for(const b in o){if(b==="parent"||b==="node"||b==="__ref"||b==="extends"||b==="context"||b==="props")continue;if(b==="key"){e&&(t.key=e);continue}const w=o[b];a&&a.set(b,f);const p=t[b],_=p&&w&&typeof p=="object"&&typeof w=="object"&&!Array.isArray(p)&&!Array.isArray(w)&&typeof p!="function"&&typeof w!="function";_&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?t[b]=jt(p,w):_&&n.has(b)?t[b]={...p,...w}:_&&so(b)?t[b]=jt(p,w):t[b]=w}function l(b){for(const w in b){const p=b[w],_=t[w],x=_&&p&&typeof _=="object"&&typeof p=="object"&&!Array.isArray(_)&&!Array.isArray(p)&&typeof _!="function"&&typeof p!="function";x&&w.charCodeAt(0)>=65&&w.charCodeAt(0)<=90?t[w]=jt(_,p):x&&n.has(w)?t[w]={..._,...p}:x&&so(w)?t[w]=jt(_,p):t[w]=p}}if(c&&l(c),o.props&&typeof o.props=="object"&&(l(o.props),a))for(const b in o.props)a.set(b,f);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 u=t.scope&&typeof t.scope=="object"?t.scope:null,d=r?.scope,h=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,y=d||h||null;if(o.scope!==void 0||u){const b={};u&&Object.assign(b,u),o.scope!==void 0&&Object.assign(b,o.scope),t.scope=$s(b,y)}else y&&(t.scope=y);o.if!==void 0&&(t.if=o.if);const A=t.__ref,g=An(t,A&&A.__runtimeSource);return A&&(A.__declaredArrays=g||void 0),Ws(t),un(t,r,o,i),o}const cn=new Set(["key","parent","context","__ref"]);function fn(t,o){for(const r of Object.keys(t))cn.has(r)||delete t[r];const s=ko();s&&Nt(null);let e=o.definition;if(!e.extends&&!e.extend&&typeof o.key=="string"){const r=t.context?.components||{},i=r[o.key]||r["smbls."+o.key];i&&(e={...e,extends:i})}try{Go(t,e,o.key,o.ownKey,t.parent,o.options)}finally{s&&Nt(s)}}function an(t,o,s){const e=s||{},r=f=>!!(e[f]||e["smbls."+f]),i=[],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 f of a){if(typeof f!="string")continue;const n=f.includes(">")?f.split(">")[0].trim():f;r(n)||i.push(n)}return i}if(typeof o=="string"&&/^[A-Z]/.test(o)){let f=-1;const n=o.indexOf("_"),c=o.indexOf(".");n>0&&(f=n),c>0&&(f<0||c<f)&&(f=c);const l=f>0?o.substring(0,f):o;r(l)||i.push(l)}return i}function no(t,o,s){if(typeof t.onStateInit!="function"&&!t.context?.plugins?.length)return;const e=t.state;t.state=o;try{R("StateInit",t,s)}finally{t.state=e}}function un(t,o,s,e){const r=!o,i=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=r&&i&&t.context?.state,f=s.state!==void 0&&!a?s.state:t.state&&!Y(t.state)?t.state:void 0;if(f==null){if(o?.state)t.state=o.state,xt(t,t.state);else if(t.context?.state){const n=t.context.state,c={...n},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=n.lang||l.defaultLang||"en",h=new Set,y=(b,w)=>{h.has(b)||zs(u,b,c)&&(c[b]=w,h.add(b),Ys(u,b,w))},A=l.translations[d];if(A&&typeof A=="object")for(const b in A)y(b,A[b]);const g=new Set(l.languages||[]);for(const b in l.translations)g.has(b)||y(b,l.translations[b])}Y(c)||no(t,c,e),t.state=Y(c)?c:Qt(c),t.state.__element=t,t.state.root=t.state,xt(t,t.state),Ft.promoteActiveRootState?.(n,t.state),R("StateCreated",t,e)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),xt(t,t.state);return}if(typeof f=="string"){if(t.state=Ko(f,o),t.state&&typeof t.state=="object"&&!Y(t.state)){const n=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:n,enumerable:!1,configurable:!0,writable:!0})}xt(t,t.state),R("StateCreated",t,e);return}if(typeof f=="function"){const n=f(t,o?.state);if(Y(n))t.state=n;else{const c=n||{};no(t,c,e),t.state=Qt(c)}}else if(Y(f))t.state=f;else{const n={...f};no(t,n,e),t.state=Qt(n)}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,xt(t,t.state),Ft.promoteActiveRootState?.(f,t.state),R("StateCreated",t,e)}function eo(t,o){if(!o)return t;const s=o.split("/");let e=t;for(const r of s){if(e==null)return{};e=e[r]}return e??{}}function Ko(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?eo(o.state,r):o.state??{}}if(t.startsWith("~/")){const r=o.state?.root||o.state,i=t.slice(2);return i?eo(r,i):r??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=eo(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const e=o.context?.polyglot;if(e?.translations){const r=o.state?.root?.lang||e.defaultLang||"en",i=e.translations[r];if(i?.[t]!==void 0)return i[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const dn=new Set(["s","state","ctx","context"]);function ln(t){try{const s=(typeof Ft.getFunctionSource=="function"?Ft.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function pn(t){if(typeof t!="function"||t.length!==2)return!1;const o=ln(t);if(o.length<2)return!1;const s=o[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!dn.has(s)}function hn(t){const o=t.__ref,s=t.tag||"div",e=t.context?.designSystem,r=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(typeof t[f]!="function"||G.has(f))continue;const n=f.charCodeAt(0);n>=65&&n<=90||Z(f)||U[f]||V&&V.has(f)||n!==45&&(St(s,f)||(ft()&&pn(t[f])&&console.warn(`[smbls] custom prop "${f}"${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('${f}', \u2026) instead of reading el.${f}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:f,fn:t[f]})))}for(let a=0;a<r.length;a++){const{prop:f,fn:n}=r[a];o.__exec[f]=n,Object.defineProperty(t,f,{get(){e&&L(e);try{return n(t,t.state,t.context)}catch{return}finally{e&&D()}},set(c){delete o.__exec[f],Object.defineProperty(t,f,{value:c,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 e=o[s];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function T(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...e){return yn(t,o),s.apply(this,e)}}function lt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function k(t,o){return()=>t.path.join(".")+"::"+o}const Wo=new Set;function M(t,o,s){if(!ft())return;const e=k(t,o)();Wo.has(e)||(Wo.add(e),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const zo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,_n=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;zo.lastIndex=0;let e;for(;(e=zo.exec(s))!==null;)e[2].includes("{{")&&o.add(e[2])},gn=(t,o)=>!Z(t)&&!st(o,t),ro=(t,o,s,e,r)=>{if(typeof o=="string"){!r&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&gn(t,e)&&_n(o,s)},io=new WeakMap,Et=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Pt=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},Ot=(t,o)=>t&&o?it(t,o):t||o||null,Yo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&Et(s,o)},pt=(t,o)=>Yo(t,o)?Pt(t.__ref.__runtimeSource[o]):null,Tt=(t,o)=>(o&&t&&typeof t=="object"&&io.set(t,o),t),bn=t=>{if(!t||typeof t!="object")return;const o=io.get(t);return o&&io.delete(t),o},co=(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 e=0;e<t.length;e++)co(t[e],o,s);return}if(!t.__ref)for(const e of Object.keys(t)){if(e==="state")continue;const r=Object.getOwnPropertyDescriptor(t,e);r&&"value"in r&&co(r.value,o,s)}}},An=(t,o)=>{let s=null;for(const e of Object.keys(t)){if(G.has(e)||o&&Et(o,e))continue;const r=Object.getOwnPropertyDescriptor(t,e),i=r&&r.value;if(!Array.isArray(i))continue;const a=new Set;co(i,a,new Set),a.size&&(s||(s=new Map),s.set(i,a))}return s},qo=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const e=s.__ref&&s.__ref.__declaredArrays,r=e&&e.get(o);if(!r)continue;const i=t.__ref;i.__authoredTemplates||(i.__authoredTemplates=new Set);for(const a of r)i.__authoredTemplates.add(a);return}},Zo=["attr","aria","data","metadata"],xn=t=>{if(Zo.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},wn=(t,o)=>{const s=new Set,e=t.tag||"div";for(const r of Object.keys(t)){const i=Object.getOwnPropertyDescriptor(t,r),a=i&&i.value,f=!!o&&Et(o,r);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!xn(r))continue;const n=f?o[r]:null,c=n&&typeof n=="object"?n:null,l=r.charCodeAt(0)===46||r.charCodeAt(0)===33;for(const u in a){const d=f&&(!c||Et(c,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&Zo.includes(u)){for(const y in h)ro(y,h[y],s,e,d);continue}ro(u,h,s,e,d)}continue}ro(r,a,s,e,f)}return s};function Qo(t,o){const s=t.__ref,e=!!(o&&o.skipIfEffect),r=wn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const n of r)s.__authoredTemplates.add(n);else s.__authoredTemplates=r;if(hn(t),typeof t.text=="function"){const n=t.text,c=T(t,t.textDeps,n),l=j(()=>{if(!s.contentManaged)try{let u=c(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=I.call(t,u,t.state)),Ht(t,u))}catch(u){M(s,"text",u)}},{depth:s.path.length,label:k(s,"text")});s.__effects.push(l),s.__exec.text=n}else if(typeof t.text=="string"&&t.text.includes("{{")){const n=t.text,c=j(()=>{if(s.contentManaged)return;const l=I.call(t,n,t.state);l!=null&&(t.text=l),t.node&&Ht(t,l??"")},{depth:s.path.length,label:k(s,"text")});s.__effects.push(c),s.__exec.text=n}const i=t.tag||"div";for(const n of Object.keys(t))if(typeof t[n]=="function"&&!G.has(n)&&!Z(n)&&!s.__exec[n]&&!No(i,n)){if(U[n]){const c=t[n],l=T(t,t[n+"Deps"],c),u=n;let d,h=null,y=null,A;const g=j(()=>{const b=t.context?.designSystem;b&&L(b);try{const w=l(t,t.state,t.context);Lo();let p;try{p=U[u](w,t,t.state,t.context)}finally{Do()}if(Array.isArray(p)){const x={};for(const S of p)if(S)for(const v in S)x[v]=S[v];p=x}const _=u==="show"||u==="hide";if(p&&t.node&&Sn(p)){const x=Lt(p);if(x===null||x!==A){A=x;const S=wt(p,null,t.context?.cssPrefix),v=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(y)for(const C of y)t.node.classList.remove(C);if(v&&v.length)for(const C of v)t.node.classList.add(C);y=v}}d=void 0,h=null}else if(p&&t.node){if(y){for(const S of y)t.node.classList.remove(S);y=null,A=void 0}const x=Lt(p);if(x===null||x!==d||!yt(t.node,h)){d=x;const S=es(t,p);h=ht(t.node,S)}}else t.node&&_&&(d=void 0,h=null,t.node.style.display="")}finally{b&&D()}},{depth:s.path.length,label:k(s,u)});s.__effects.push(g),s.__exec[n]=c}else if(V&&V.has(n)){const c=t[n],l=T(t,t[n+"Deps"],c),u=n;let d,h=null;const y=j(()=>{const A=t.context?.designSystem;A&&L(A);try{const g=l(t,t.state,t.context);if(t.node)if(g!=null){const b=u+":"+String(g);if(b!==d||!yt(t.node,h)){d=b;const w={[u]:g},p=es(t,w);h=ht(t.node,p)}}else d=void 0,h=null,t.node.style[u]=""}finally{A&&D()}},{depth:s.path.length,label:k(s,u)});s.__effects.push(y),s.__exec[n]=c}else if(n.charCodeAt(0)===45){const c=t[n];ss(t,n,c,t[n+"Deps"],n),s.__exec[n]=c}}if(Cn(t),typeof t.html=="function"){const n=t.html,c=T(t,t.htmlDeps,n),l=j(()=>{const u=t.context?.designSystem;u&&L(u);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{u&&D()}},{depth:s.path.length,label:k(s,"html")});s.__effects.push(l),s.__exec.html=n}if(typeof t.value=="function"){const n=t.value,c=T(t,t.valueDeps,n),l=j(()=>{try{let u=c(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=I.call(t,u,t.state)),mo(t,u)}catch(u){M(s,"value",u)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(l),s.__exec.value=n}else if(typeof t.value=="string"&&t.value.includes("{{")){const n=t.value,c=j(()=>{try{mo(t,I.call(t,n,t.state))}catch(l){M(s,"value",l)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(c),s.__exec.value=n}if(typeof t.style=="function"){const n=t.style,c=T(t,t.styleDeps,n);let l,u=null;const d=j(()=>{const h=lo(t,c(t,t.state,t.context)),y=Lt(h);(y===null||y!==l||!yt(t.node,u))&&(l=y,Vt(t.node,u,h),X(t.node,h),u=ht(t.node,h))},{depth:s.path.length,label:k(s,"style")});s.__effects.push(d),s.__exec.style=n}else if(t.style&&typeof t.style=="object")for(const n in t.style){const c=t.style[n];if(typeof c!="function")continue;const l=T(t,lt(t.styleDeps,n),c);let u,d=null;const h=j(()=>{try{const y=l(t,t.state,t.context);if(t.node){const A=n+":"+String(y);if(A!==u||!yt(t.node,d)){u=A;const g=lo(t,{[n]:y});Vt(t.node,d,Object.assign({},g,{[n]:""})),X(t.node,g),d=ht(t.node,g)}}}catch(y){M(s,"style."+n,y)}},{depth:s.path.length,label:k(s,"style."+n)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const n in t.attr)if(typeof t.attr[n]=="function"){const c=T(t,lt(t.attrDeps,n),t.attr[n]),l=n,u=j(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=I.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!at(l)?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(l,K(l,d)))}catch(d){M(s,"attr."+l,d)}},{depth:s.path.length,label:k(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[n]=="string"&&t.attr[n].includes("{{")){const c=t.attr[n],l=n,u=j(()=>{try{const d=I.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,K(l,d??""))}catch(d){M(s,"attr."+l,d)}},{depth:s.path.length,label:k(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const c=t.aria[n];if(typeof c=="string"&&c.includes("{{")){const h=c,y="aria-"+n.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),A=j(()=>{try{const g=I.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,K(y,g??""))}catch(g){M(s,"aria."+n,g)}},{depth:s.path.length,label:k(s,"aria."+n)});A._attrName=y,s.__effects.push(A);continue}if(typeof c!="function")continue;const l=T(t,lt(t.ariaDeps,n),t.aria[n]),u="aria-"+n.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=j(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;h==null?t.node.removeAttribute(u):typeof h!="function"&&typeof h!="object"&&t.node.setAttribute(u,K(u,h))}catch(h){M(s,"aria."+n,h)}},{depth:s.path.length,label:k(s,"aria."+n)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];if(typeof c=="string"&&c.includes("{{")){const y=c,A="data-"+n.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),g=j(()=>{try{const b=I.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(A,b??"")}catch(b){M(s,"data."+n,b)}},{depth:s.path.length,label:k(s,"data."+n)});g._attrName=A,s.__effects.push(g);continue}if(typeof c!="function")continue;const l=T(t,lt(t.dataDeps,n),t.data[n]),d="data-"+n.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),h=j(()=>{try{const y=l(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null||y===!1?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(d,y===!0?"":y)}catch(y){M(s,"data."+n,y)}},{depth:s.path.length,label:k(s,"data."+n)});h._attrName=d,s.__effects.push(h)}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 n in a){if(typeof a[n]!="function")continue;const c=T(t,lt(t.classDeps,n),a[n]),l=j(()=>{try{const u=c(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(n):t.node.classList.remove(n)}catch(u){M(s,"class."+n,u)}},{depth:s.path.length,label:k(s,"class."+n)});s.__effects.push(l)}!e&&typeof t.if=="function"&&Jo(t,s,t.if);for(const n of Object.keys(t)){if(G.has(n)||typeof t[n]!="function")continue;const c=n.charCodeAt(0);if(c>=65&&c<=90||Z(n))continue;const l=t[n];s.__exec[n]=l;const u=t.tag||"div";if(St(u,n)&&!st(u,n)){const d=Ct(n)||n,h=T(t,t[n+"Deps"],l),y=j(()=>{try{let A=h(t,t.state,t.context);typeof A=="string"&&A.includes("{{")&&(A=I.call(t,A,t.state)),t.node?.setAttribute&&(A==null||A===!1&&!at(d)?t.node.removeAttribute(d):typeof A!="function"&&typeof A!="object"&&(d==="src"&&"src"in t.node?t.node.src=A:t.node.setAttribute(d,K(d,A))))}catch(A){M(s,n,A)}},{depth:s.path.length,label:k(s,n)});y._attrName=d.toLowerCase(),s.__effects.push(y)}}const f=t.tag||"div";for(const n of Object.keys(t)){if(G.has(n))continue;const c=t[n];if(typeof c!="string"||!c.includes("{{"))continue;const l=n.charCodeAt(0);if(l>=65&&l<=90||Z(n)||st(f,n)||Jt[n]||!St(f,n))continue;const u=Ct(n)||n,d=j(()=>{try{const h=I.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,K(u,h??""))}catch(h){M(s,n,h)}},{depth:s.path.length,label:k(s,n)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(Tn(t),Un(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const n=t.onStateUpdate,c=t.stateDeps;let l=!1,u=[];const d=j(()=>{const h=[];for(let b=0;b<c.length;b++){const w=c[b];try{h[b]=typeof w=="function"?w(t,t.state,t.context):t.state?.[w]}catch{h[b]=void 0}}if(!l){l=!0,u=h;return}let y=h.length!==u.length;for(let b=0;!y&&b<h.length;b++)h[b]!==u[b]&&(y=!0);const A=u;if(u=h,!y)return;const g=t.context?.designSystem;g&&L(g);try{n(t,t.state,t.context,{prev:A,next:h})}catch(b){if(t.context?.plugins?.length&&q("error",t,{hook:"onStateUpdate",error:b})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',b),t.context?.strictMode)throw b}finally{g&&D()}},{depth:s.path.length,label:k(s,"onStateUpdate")});s.__effects.push(d)}Rn(t)}function Xo(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ls(t,t.parent);return}let e=null;const r=Object.keys(o),i=r.indexOf(t.key);for(let a=i+1;a<r.length;a++){const f=o[r[a]];if(f?.node?.parentNode===s){e=f.node;break}}e?s.insertBefore(t.node,e):s.appendChild(t.node)}function Jo(t,o,s){let e=T(t,t.ifDeps,s);const r=j(()=>{const i=!o.__ifInitialized&&o.__ifLateMerge;if(i){const n=t.context?.components||{};i.names.some(c=>n[c]||n["smbls."+c])&&(o.__ifLateMerge=null,fn(t,i),e=T(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=e(t,t.state,t.context)}catch(n){if(a=!1,o.__ifError=n,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,n?.message||n)}return}const f=o.__if;if(o.__if=!!a,f&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(n){console.error("[smbls] onRemove error:",n)}}else if(!f&&o.__if)if(o.__ifInitialized)t.node||(t.node=Xt(t)),t.node&&(t.node.ref=t),Xo(t),fo(t),_o(t),R("Render",t,{}),oo(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=jo(t)),R("Init",t,{}),t.node||(t.node=Xt(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 c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),o.__fragmentAnchor=c}R("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,{}),Qo(t,{skipIfEffect:!0}),fo(t),xs(t),_o(t),Es(t),Ts(t,{}),Xo(t),R("Create",t,{}),R("Complete",t,{}),R("Render",t,{}),R("RenderRouter",t,{}),oo(t,{})}},{depth:o.path.length,label:k(o,"if")});o.__effects.push(r)}function Ht(t,o){const s=t.node;if(!s)return;const e=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==e&&(s.nodeValue=e);return}const r=t.__ref;let i=r?r.__textNode:null;if(i&&i.parentNode!==s&&(i=null),!i){const a=s.firstChild;a&&a.nodeType===3&&(i=a)}i?i.nodeValue!==e&&(i.nodeValue=e):s.firstChild?(i=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),s.insertBefore(i,s.firstChild)):(s.textContent=e,i=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=i||null)}function mo(t,o){const s=t.node;if(!s||!("value"in s))return;const e=o==null?"":String(o);if(s.value===e)return;const r=typeof document<"u"&&document.activeElement===s,i=r&&typeof s.selectionStart=="number"?s.selectionStart:null,a=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=e,r&&i!=null&&a!=null)try{s.setSelectionRange(i,a)}catch{}const f=t.__ref&&t.__ref.__autoGrow;f&&f.active&&f.resize()}function fo(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Ht(t,t.text),As(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 e in t.style)if(typeof t.style[e]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}X(o,lo(t,s))}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const e=t.attr[s];typeof e=="function"||typeof e=="object"||e!=null&&(typeof e=="string"&&e.includes("{{")||e===!1&&!at(s)||o.setAttribute&&o.setAttribute(s,K(s,e)))}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 e=t.data[s];typeof e=="function"||typeof e=="object"||e==null||e===!1||typeof e=="string"&&e.includes("{{")||o.dataset&&(o.dataset[s]=e===!0?"":e)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(e=>e&&o.classList.add(e));else if(typeof s=="object")for(const e in s){const r=typeof s[e]=="function"?s[e](t,t.state,t.context):s[e];r&&o.classList.add(typeof r=="string"?r:e)}}}}function Lt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Sn(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 ht(t,o){if(!t||!t.style||!o)return null;const s=t.style,e=[];for(const r in o){if(o[r]==null||r.charAt(0)==="&")continue;const a=Q(r);e.push(a,ao(s,a),ts(s,a))}return e}function ao(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function ts(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function Q(t){return et(t)?t:t.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}function Vt(t,o,s){if(!t||!t.style||!o||!o.length)return;const e=t.style,r=new Set;if(s&&typeof s=="object")for(const i in s)s[i]==null||i.charAt(0)==="&"||r.add(Q(i));for(let i=0;i<o.length;i+=3){const a=o[i];r.has(a)||ao(e,a)===o[i+1]&&typeof e.removeProperty=="function"&&e.removeProperty(a)}}function yt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let e=0;e<o.length;e+=3)if(ao(s,o[e])!==o[e+1]||ts(s,o[e])!==o[e+2])return!1;return!0}const et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,os=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",Bt=t=>et(t)?t:"--"+t;function Gt(t,o){if(!m(t))return null;let s=null;for(const e of Object.keys(t)){if(!e)continue;let r=t[e];if(typeof r=="function"){if(!o)continue;r=r(o,o.state,o.context)}os(r)&&(s||(s={}),s[Bt(e)]=r)}return s}function ss(t,o,s,e,r){const i=t.__ref,a=T(t,e,s);let f,n=null;const c=j(()=>{const l=t.context?.designSystem;l&&L(l);try{const u=a(t,t.state,t.context),d=t.node;if(!d||!d.style)return;if(!os(u)){Vt(d,n,null),f=void 0,n=null;return}const h=String(u);if(h!==f||!yt(d,n)){f=h;const y={[o]:u};X(d,y),n=ht(d,y)}}catch(u){M(i,r,u)}finally{l&&D()}},{depth:i.path.length,label:k(i,r)});i.__effects.push(c)}function Cn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){vn(t,s),o.__exec.vars=s;return}if(m(s))for(const e of Object.keys(s)){const r=s[e];!e||typeof r!="function"||ss(t,Bt(e),r,lt(t.varsDeps,e),"vars."+e)}}function vn(t,o){const s=t.__ref,e=T(t,t.varsDeps,o);let r,i=null;const a=j(()=>{const f=t.context?.designSystem;f&&L(f);try{const n=Gt(e(t,t.state,t.context)),c=t.node;if(!c||!c.style)return;const l=Lt(n);(l===null||l!==r||!yt(c,i))&&(r=l,Vt(c,i,n),n&&X(c,n),i=n?ht(c,n):null,s.__varsInline=n?new Set(Object.keys(n)):null)}catch(n){M(s,"vars",n)}finally{f&&D()}},{depth:s.path.length,label:k(s,"vars")});s.__effects.push(a)}function uo(t,o){if(typeof t[o]=="function"&&(st(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!et(o))return!1;const s=t.vars;if(typeof s=="function"){const e=t.__ref&&t.__ref.__varsInline;return!!(e&&e.has(o))}if(!m(s))return!1;for(const e of Object.keys(s))if(typeof s[e]=="function"&&Bt(e)===o)return!0;return!1}function kn(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 jn(t,o,s,e){const r=t.__ref;if(!r)return;let i=null;if(s)for(const a of s){if(e&&e.has(a))continue;const f=o[a];if(f==null||typeof f=="object")continue;const n=Q(a);$t[n]&&(i||(i={}),i[n]=f)}r.__declaredLonghands=i}function ns(t,o){const s=t.__ref,e=s&&s.__declaredLonghands;if(!e||!o)return null;let r=null;for(const i in e){if(o.has(i))continue;const a=$t[i];let f=!1;for(let n=0;n<a.length;n++)if(o.has(a[n])){f=!0;break}f&&(r||(r={}),r[i]=e[i])}return r}function es(t,o){const s=t.node;X(s,o);const e=kn(o);if(!e)return o;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const a of e)r.__inlineCssKeys.add(a);else r.__inlineCssKeys=new Set(e);const i=ns(t,e);return i?(X(s,i),Object.assign({},o,i)):o}function En(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=ns(t,o.__inlineCssKeys);s&&X(t.node,s)}function lo(t,o){if(!o||typeof o!="object")return o;const s=t&&t.context&&t.context.designSystem;s&&L(s);try{return qs(o,t)}catch{return o}finally{s&&D()}}function X(t,o){if(!t||!o||!t.style)return;let s=null;for(const e in o){const r=o[e];if(r!=null){if(e.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[e]=r;continue}try{const i=String(r),a=et(e)?e:e.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),f=i.trim(),n=/\s*!important\s*$/.test(f),c=f.replace(/\s*!important\s*$/,"");t.style.setProperty(a,c,n?"important":"")}catch{}}}s&&Pn(t,s)}function Pn(t,o){const s=`_ds${Fo.scopedStyleId++}`;t.classList.add(s);const e=t.ownerDocument;let r=e.querySelector("style[data-smbls-scoped]");r||(r=e.createElement("style"),r.setAttribute("data-smbls-scoped",""),e.head.appendChild(r));let i="";for(const a in o){const f="."+s,n=a.replace(/&/g,f).split(",").map(l=>{const u=l.trim();return u.includes(f)?u:f+u}).join(", "),c=o[a];if(typeof c=="object"){let l="",u="";for(const d in c){const h=c[d];if(typeof h=="object"){const y=d.includes("&")?n.split(", ").map(g=>d.replace(/&/g,g)).join(", "):n.split(", ").map(g=>`${g} ${d}`).join(", ");let A="";for(const g in h)A+=`${Q(g)}: ${h[g]};`;u+=Mo(`${y} { ${A} }`,y)+`
4
+ `):"")}}if(Kt(n,!0),Ls(n,o,r),typeof n.html=="function"&&n.node&&!n.node.innerHTML){const d=n.context?.designSystem;d&&L(d);try{const h=n.html(n,n.state,n.context);h!=null&&typeof h!="function"&&(n.node.innerHTML=h)}catch{}finally{d&&D()}}if(R("Create",n,e),R("Complete",n,e),R("Render",n,e),R("RenderRouter",n,e),oo(n,e),typeof n.onFrame=="function"){const d=n.onFrame,h=n.context?.designSystem,y=()=>{if(n.node){if(n.node.isConnected){h&&L(h);try{d(n,n.state,n.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{h&&D()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return n}function Go(t,o,s,e,r,i){if(s&&!o.extends&&!o.extend){const b=s.indexOf("_"),w=s.indexOf(".");let p=b>0?b:-1;if(w>0&&(p<0||w<p)&&(p=w),p>0){const _=s.substring(0,p),x=t.context?.components;x&&(x[_]||x["smbls."+_])?o={...o,extends:_}:x&&ft()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${_}" but neither "${_}" nor "smbls.${_}" 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),Ks(t,o,i);const a=Ws(t),f=a?a.rank:0,n=new Set(["childProps","attr","style","scope","data","vars"]),c=t.props&&typeof t.props=="object"?t.props:null;for(const b in o){if(b==="parent"||b==="node"||b==="__ref"||b==="extends"||b==="context"||b==="props")continue;if(b==="key"){e&&(t.key=e);continue}const w=o[b];a&&a.set(b,f);const p=t[b],_=p&&w&&typeof p=="object"&&typeof w=="object"&&!Array.isArray(p)&&!Array.isArray(w)&&typeof p!="function"&&typeof w!="function";_&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?t[b]=jt(p,w):_&&n.has(b)?t[b]={...p,...w}:_&&so(b)?t[b]=jt(p,w):t[b]=w}function l(b){for(const w in b){const p=b[w],_=t[w],x=_&&p&&typeof _=="object"&&typeof p=="object"&&!Array.isArray(_)&&!Array.isArray(p)&&typeof _!="function"&&typeof p!="function";x&&w.charCodeAt(0)>=65&&w.charCodeAt(0)<=90?t[w]=jt(_,p):x&&n.has(w)?t[w]={..._,...p}:x&&so(w)?t[w]=jt(_,p):t[w]=p}}if(c&&l(c),o.props&&typeof o.props=="object"&&(l(o.props),a))for(const b in o.props)a.set(b,f);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 u=t.scope&&typeof t.scope=="object"?t.scope:null,d=r?.scope,h=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,y=d||h||null;if(o.scope!==void 0||u){const b={};u&&Object.assign(b,u),o.scope!==void 0&&Object.assign(b,o.scope),t.scope=$s(b,y)}else y&&(t.scope=y);o.if!==void 0&&(t.if=o.if);const A=t.__ref,g=xn(t,A&&A.__runtimeSource);return A&&(A.__declaredArrays=g||void 0),zs(t),dn(t,r,o,i),o}const fn=new Set(["key","parent","context","__ref"]);function an(t,o){for(const r of Object.keys(t))fn.has(r)||delete t[r];const s=ko();s&&Nt(null);let e=o.definition;if(!e.extends&&!e.extend&&typeof o.key=="string"){const r=t.context?.components||{},i=r[o.key]||r["smbls."+o.key];i&&(e={...e,extends:i})}try{Go(t,e,o.key,o.ownKey,t.parent,o.options)}finally{s&&Nt(s)}}function un(t,o,s){const e=s||{},r=f=>!!(e[f]||e["smbls."+f]),i=[],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 f of a){if(typeof f!="string")continue;const n=f.includes(">")?f.split(">")[0].trim():f;r(n)||i.push(n)}return i}if(typeof o=="string"&&/^[A-Z]/.test(o)){let f=-1;const n=o.indexOf("_"),c=o.indexOf(".");n>0&&(f=n),c>0&&(f<0||c<f)&&(f=c);const l=f>0?o.substring(0,f):o;r(l)||i.push(l)}return i}function no(t,o,s){if(typeof t.onStateInit!="function"&&!t.context?.plugins?.length)return;const e=t.state;t.state=o;try{R("StateInit",t,s)}finally{t.state=e}}function dn(t,o,s,e){const r=!o,i=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=r&&i&&t.context?.state,f=s.state!==void 0&&!a?s.state:t.state&&!Y(t.state)?t.state:void 0;if(f==null){if(o?.state)t.state=o.state,xt(t,t.state);else if(t.context?.state){const n=t.context.state,c={...n},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=n.lang||l.defaultLang||"en",h=new Set,y=(b,w)=>{h.has(b)||Ys(u,b,c)&&(c[b]=w,h.add(b),qs(u,b,w))},A=l.translations[d];if(A&&typeof A=="object")for(const b in A)y(b,A[b]);const g=new Set(l.languages||[]);for(const b in l.translations)g.has(b)||y(b,l.translations[b])}Y(c)||no(t,c,e),t.state=Y(c)?c:Qt(c),t.state.__element=t,t.state.root=t.state,xt(t,t.state),Ft.promoteActiveRootState?.(n,t.state),R("StateCreated",t,e)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),xt(t,t.state);return}if(typeof f=="string"){if(t.state=Ko(f,o),t.state&&typeof t.state=="object"&&!Y(t.state)){const n=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:n,enumerable:!1,configurable:!0,writable:!0})}xt(t,t.state),R("StateCreated",t,e);return}if(typeof f=="function"){const n=f(t,o?.state);if(Y(n))t.state=n;else{const c=n||{};no(t,c,e),t.state=Qt(c)}}else if(Y(f))t.state=f;else{const n={...f};no(t,n,e),t.state=Qt(n)}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,xt(t,t.state),Ft.promoteActiveRootState?.(f,t.state),R("StateCreated",t,e)}function eo(t,o){if(!o)return t;const s=o.split("/");let e=t;for(const r of s){if(e==null)return{};e=e[r]}return e??{}}function Ko(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?eo(o.state,r):o.state??{}}if(t.startsWith("~/")){const r=o.state?.root||o.state,i=t.slice(2);return i?eo(r,i):r??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=eo(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const e=o.context?.polyglot;if(e?.translations){const r=o.state?.root?.lang||e.defaultLang||"en",i=e.translations[r];if(i?.[t]!==void 0)return i[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const ln=new Set(["s","state","ctx","context"]);function pn(t){try{const s=(typeof Ft.getFunctionSource=="function"?Ft.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function hn(t){if(typeof t!="function"||t.length!==2)return!1;const o=pn(t);if(o.length<2)return!1;const s=o[1].replace(/[{}[\]]/g,"").trim();return s.length>0&&!ln.has(s)}function yn(t){const o=t.__ref,s=t.tag||"div",e=t.context?.designSystem,r=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(typeof t[f]!="function"||G.has(f))continue;const n=f.charCodeAt(0);n>=65&&n<=90||Z(f)||U[f]||V&&V.has(f)||n!==45&&(St(s,f)||(ft()&&hn(t[f])&&console.warn(`[smbls] custom prop "${f}"${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('${f}', \u2026) instead of reading el.${f}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:f,fn:t[f]})))}for(let a=0;a<r.length;a++){const{prop:f,fn:n}=r[a];o.__exec[f]=n,Object.defineProperty(t,f,{get(){e&&L(e);try{return n(t,t.state,t.context)}catch{return}finally{e&&D()}},set(c){delete o.__exec[f],Object.defineProperty(t,f,{value:c,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function _n(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const e=o[s];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function T(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...e){return _n(t,o),s.apply(this,e)}}function lt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function k(t,o){return()=>t.path.join(".")+"::"+o}const Wo=new Set;function M(t,o,s){if(!ft())return;const e=k(t,o)();Wo.has(e)||(Wo.add(e),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const zo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,gn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;zo.lastIndex=0;let e;for(;(e=zo.exec(s))!==null;)e[2].includes("{{")&&o.add(e[2])},bn=(t,o)=>!Z(t)&&!st(o,t),ro=(t,o,s,e,r)=>{if(typeof o=="string"){!r&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&bn(t,e)&&gn(o,s)},io=new WeakMap,Et=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Pt=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},Ot=(t,o)=>t&&o?it(t,o):t||o||null,Yo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&Et(s,o)},pt=(t,o)=>Yo(t,o)?Pt(t.__ref.__runtimeSource[o]):null,Tt=(t,o)=>(o&&t&&typeof t=="object"&&io.set(t,o),t),An=t=>{if(!t||typeof t!="object")return;const o=io.get(t);return o&&io.delete(t),o},co=(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 e=0;e<t.length;e++)co(t[e],o,s);return}if(!t.__ref)for(const e of Object.keys(t)){if(e==="state")continue;const r=Object.getOwnPropertyDescriptor(t,e);r&&"value"in r&&co(r.value,o,s)}}},xn=(t,o)=>{let s=null;for(const e of Object.keys(t)){if(G.has(e)||o&&Et(o,e))continue;const r=Object.getOwnPropertyDescriptor(t,e),i=r&&r.value;if(!Array.isArray(i))continue;const a=new Set;co(i,a,new Set),a.size&&(s||(s=new Map),s.set(i,a))}return s},qo=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const e=s.__ref&&s.__ref.__declaredArrays,r=e&&e.get(o);if(!r)continue;const i=t.__ref;i.__authoredTemplates||(i.__authoredTemplates=new Set);for(const a of r)i.__authoredTemplates.add(a);return}},Zo=["attr","aria","data","metadata"],wn=t=>{if(Zo.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},Sn=(t,o)=>{const s=new Set,e=t.tag||"div";for(const r of Object.keys(t)){const i=Object.getOwnPropertyDescriptor(t,r),a=i&&i.value,f=!!o&&Et(o,r);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!wn(r))continue;const n=f?o[r]:null,c=n&&typeof n=="object"?n:null,l=r.charCodeAt(0)===46||r.charCodeAt(0)===33;for(const u in a){const d=f&&(!c||Et(c,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&Zo.includes(u)){for(const y in h)ro(y,h[y],s,e,d);continue}ro(u,h,s,e,d)}continue}ro(r,a,s,e,f)}return s};function Qo(t,o){const s=t.__ref,e=!!(o&&o.skipIfEffect),r=Sn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const n of r)s.__authoredTemplates.add(n);else s.__authoredTemplates=r;if(yn(t),typeof t.text=="function"){const n=t.text,c=T(t,t.textDeps,n),l=j(()=>{if(!s.contentManaged)try{let u=c(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=I.call(t,u,t.state)),Ht(t,u))}catch(u){M(s,"text",u)}},{depth:s.path.length,label:k(s,"text")});s.__effects.push(l),s.__exec.text=n}else if(typeof t.text=="string"&&t.text.includes("{{")){const n=t.text,c=j(()=>{if(s.contentManaged)return;const l=I.call(t,n,t.state);l!=null&&(t.text=l),t.node&&Ht(t,l??"")},{depth:s.path.length,label:k(s,"text")});s.__effects.push(c),s.__exec.text=n}const i=t.tag||"div";for(const n of Object.keys(t))if(typeof t[n]=="function"&&!G.has(n)&&!Z(n)&&!s.__exec[n]&&!No(i,n)){if(U[n]){const c=t[n],l=T(t,t[n+"Deps"],c),u=n;let d,h=null,y=null,A;const g=j(()=>{const b=t.context?.designSystem;b&&L(b);try{const w=l(t,t.state,t.context);Lo();let p;try{p=U[u](w,t,t.state,t.context)}finally{Do()}if(Array.isArray(p)){const x={};for(const S of p)if(S)for(const v in S)x[v]=S[v];p=x}const _=u==="show"||u==="hide";if(p&&t.node&&Cn(p)){const x=Lt(p);if(x===null||x!==A){A=x;const S=wt(p,null,t.context?.cssPrefix),v=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(y)for(const C of y)t.node.classList.remove(C);if(v&&v.length)for(const C of v)t.node.classList.add(C);y=v}}d=void 0,h=null}else if(p&&t.node){if(y){for(const S of y)t.node.classList.remove(S);y=null,A=void 0}const x=Lt(p);if(x===null||x!==d||!yt(t.node,h)){d=x;const S=es(t,p);h=ht(t.node,S)}}else t.node&&_&&(d=void 0,h=null,t.node.style.display="")}finally{b&&D()}},{depth:s.path.length,label:k(s,u)});s.__effects.push(g),s.__exec[n]=c}else if(V&&V.has(n)){const c=t[n],l=T(t,t[n+"Deps"],c),u=n;let d,h=null;const y=j(()=>{const A=t.context?.designSystem;A&&L(A);try{const g=l(t,t.state,t.context);if(t.node)if(g!=null){const b=u+":"+String(g);if(b!==d||!yt(t.node,h)){d=b;const w={[u]:g},p=es(t,w);h=ht(t.node,p)}}else d=void 0,h=null,t.node.style[u]=""}finally{A&&D()}},{depth:s.path.length,label:k(s,u)});s.__effects.push(y),s.__exec[n]=c}else if(n.charCodeAt(0)===45){const c=t[n];ss(t,n,c,t[n+"Deps"],n),s.__exec[n]=c}}if(vn(t),typeof t.html=="function"){const n=t.html,c=T(t,t.htmlDeps,n),l=j(()=>{const u=t.context?.designSystem;u&&L(u);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{u&&D()}},{depth:s.path.length,label:k(s,"html")});s.__effects.push(l),s.__exec.html=n}if(typeof t.value=="function"){const n=t.value,c=T(t,t.valueDeps,n),l=j(()=>{try{let u=c(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=I.call(t,u,t.state)),mo(t,u)}catch(u){M(s,"value",u)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(l),s.__exec.value=n}else if(typeof t.value=="string"&&t.value.includes("{{")){const n=t.value,c=j(()=>{try{mo(t,I.call(t,n,t.state))}catch(l){M(s,"value",l)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(c),s.__exec.value=n}if(typeof t.style=="function"){const n=t.style,c=T(t,t.styleDeps,n);let l,u=null;const d=j(()=>{const h=lo(t,c(t,t.state,t.context)),y=Lt(h);(y===null||y!==l||!yt(t.node,u))&&(l=y,Vt(t.node,u,h),X(t.node,h),u=ht(t.node,h))},{depth:s.path.length,label:k(s,"style")});s.__effects.push(d),s.__exec.style=n}else if(t.style&&typeof t.style=="object")for(const n in t.style){const c=t.style[n];if(typeof c!="function")continue;const l=T(t,lt(t.styleDeps,n),c);let u,d=null;const h=j(()=>{try{const y=l(t,t.state,t.context);if(t.node){const A=n+":"+String(y);if(A!==u||!yt(t.node,d)){u=A;const g=lo(t,{[n]:y});Vt(t.node,d,Object.assign({},g,{[n]:""})),X(t.node,g),d=ht(t.node,g)}}}catch(y){M(s,"style."+n,y)}},{depth:s.path.length,label:k(s,"style."+n)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const n in t.attr)if(typeof t.attr[n]=="function"){const c=T(t,lt(t.attrDeps,n),t.attr[n]),l=n,u=j(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=I.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!at(l)?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(l,K(l,d)))}catch(d){M(s,"attr."+l,d)}},{depth:s.path.length,label:k(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[n]=="string"&&t.attr[n].includes("{{")){const c=t.attr[n],l=n,u=j(()=>{try{const d=I.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,K(l,d??""))}catch(d){M(s,"attr."+l,d)}},{depth:s.path.length,label:k(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const c=t.aria[n];if(typeof c=="string"&&c.includes("{{")){const h=c,y="aria-"+n.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),A=j(()=>{try{const g=I.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,K(y,g??""))}catch(g){M(s,"aria."+n,g)}},{depth:s.path.length,label:k(s,"aria."+n)});A._attrName=y,s.__effects.push(A);continue}if(typeof c!="function")continue;const l=T(t,lt(t.ariaDeps,n),t.aria[n]),u="aria-"+n.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=j(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;h==null?t.node.removeAttribute(u):typeof h!="function"&&typeof h!="object"&&t.node.setAttribute(u,K(u,h))}catch(h){M(s,"aria."+n,h)}},{depth:s.path.length,label:k(s,"aria."+n)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const n in t.data){const c=t.data[n];if(typeof c=="string"&&c.includes("{{")){const y=c,A="data-"+n.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),g=j(()=>{try{const b=I.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(A,b??"")}catch(b){M(s,"data."+n,b)}},{depth:s.path.length,label:k(s,"data."+n)});g._attrName=A,s.__effects.push(g);continue}if(typeof c!="function")continue;const l=T(t,lt(t.dataDeps,n),t.data[n]),d="data-"+n.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),h=j(()=>{try{const y=l(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null||y===!1?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(d,y===!0?"":y)}catch(y){M(s,"data."+n,y)}},{depth:s.path.length,label:k(s,"data."+n)});h._attrName=d,s.__effects.push(h)}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 n in a){if(typeof a[n]!="function")continue;const c=T(t,lt(t.classDeps,n),a[n]),l=j(()=>{try{const u=c(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(n):t.node.classList.remove(n)}catch(u){M(s,"class."+n,u)}},{depth:s.path.length,label:k(s,"class."+n)});s.__effects.push(l)}!e&&typeof t.if=="function"&&Jo(t,s,t.if);for(const n of Object.keys(t)){if(G.has(n)||typeof t[n]!="function")continue;const c=n.charCodeAt(0);if(c>=65&&c<=90||Z(n))continue;const l=t[n];s.__exec[n]=l;const u=t.tag||"div";if(St(u,n)&&!st(u,n)){const d=Ct(n)||n,h=T(t,t[n+"Deps"],l),y=j(()=>{try{let A=h(t,t.state,t.context);typeof A=="string"&&A.includes("{{")&&(A=I.call(t,A,t.state)),t.node?.setAttribute&&(A==null||A===!1&&!at(d)?t.node.removeAttribute(d):typeof A!="function"&&typeof A!="object"&&(d==="src"&&"src"in t.node?t.node.src=A:t.node.setAttribute(d,K(d,A))))}catch(A){M(s,n,A)}},{depth:s.path.length,label:k(s,n)});y._attrName=d.toLowerCase(),s.__effects.push(y)}}const f=t.tag||"div";for(const n of Object.keys(t)){if(G.has(n))continue;const c=t[n];if(typeof c!="string"||!c.includes("{{"))continue;const l=n.charCodeAt(0);if(l>=65&&l<=90||Z(n)||st(f,n)||Jt[n]||!St(f,n))continue;const u=Ct(n)||n,d=j(()=>{try{const h=I.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,K(u,h??""))}catch(h){M(s,n,h)}},{depth:s.path.length,label:k(s,n)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(Ln(t),Hn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const n=t.onStateUpdate,c=t.stateDeps;let l=!1,u=[];const d=j(()=>{const h=[];for(let b=0;b<c.length;b++){const w=c[b];try{h[b]=typeof w=="function"?w(t,t.state,t.context):t.state?.[w]}catch{h[b]=void 0}}if(!l){l=!0,u=h;return}let y=h.length!==u.length;for(let b=0;!y&&b<h.length;b++)h[b]!==u[b]&&(y=!0);const A=u;if(u=h,!y)return;const g=t.context?.designSystem;g&&L(g);try{n(t,t.state,t.context,{prev:A,next:h})}catch(b){if(t.context?.plugins?.length&&q("error",t,{hook:"onStateUpdate",error:b})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',b),t.context?.strictMode)throw b}finally{g&&D()}},{depth:s.path.length,label:k(s,"onStateUpdate")});s.__effects.push(d)}Nn(t)}function Xo(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ls(t,t.parent);return}let e=null;const r=Object.keys(o),i=r.indexOf(t.key);for(let a=i+1;a<r.length;a++){const f=o[r[a]];if(f?.node?.parentNode===s){e=f.node;break}}e?s.insertBefore(t.node,e):s.appendChild(t.node)}function Jo(t,o,s){let e=T(t,t.ifDeps,s);const r=j(()=>{const i=!o.__ifInitialized&&o.__ifLateMerge;if(i){const n=t.context?.components||{};i.names.some(c=>n[c]||n["smbls."+c])&&(o.__ifLateMerge=null,an(t,i),e=T(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=e(t,t.state,t.context)}catch(n){if(a=!1,o.__ifError=n,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,n?.message||n)}return}const f=o.__if;if(o.__if=!!a,f&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(n){console.error("[smbls] onRemove error:",n)}}else if(!f&&o.__if)if(o.__ifInitialized)t.node||(t.node=Xt(t)),t.node&&(t.node.ref=t),Xo(t),fo(t),_o(t),R("Render",t,{}),oo(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=jo(t)),R("Init",t,{}),t.node||(t.node=Xt(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 c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),o.__fragmentAnchor=c}R("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,{}),Qo(t,{skipIfEffect:!0}),fo(t),xs(t),_o(t),Es(t),Ts(t,{}),Xo(t),R("Create",t,{}),R("Complete",t,{}),R("Render",t,{}),R("RenderRouter",t,{}),oo(t,{})}},{depth:o.path.length,label:k(o,"if")});o.__effects.push(r)}function Ht(t,o){const s=t.node;if(!s)return;const e=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==e&&(s.nodeValue=e);return}const r=t.__ref;let i=r?r.__textNode:null;if(i&&i.parentNode!==s&&(i=null),!i){const a=s.firstChild;a&&a.nodeType===3&&(i=a)}i?i.nodeValue!==e&&(i.nodeValue=e):s.firstChild?(i=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),s.insertBefore(i,s.firstChild)):(s.textContent=e,i=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=i||null)}function mo(t,o){const s=t.node;if(!s||!("value"in s))return;const e=o==null?"":String(o);if(s.value===e)return;const r=typeof document<"u"&&document.activeElement===s,i=r&&typeof s.selectionStart=="number"?s.selectionStart:null,a=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=e,r&&i!=null&&a!=null)try{s.setSelectionRange(i,a)}catch{}const f=t.__ref&&t.__ref.__autoGrow;f&&f.active&&f.resize()}function fo(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Ht(t,t.text),As(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 e in t.style)if(typeof t.style[e]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}X(o,lo(t,s))}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const e=t.attr[s];typeof e=="function"||typeof e=="object"||e!=null&&(typeof e=="string"&&e.includes("{{")||e===!1&&!at(s)||o.setAttribute&&o.setAttribute(s,K(s,e)))}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 e=t.data[s];typeof e=="function"||typeof e=="object"||e==null||e===!1||typeof e=="string"&&e.includes("{{")||o.dataset&&(o.dataset[s]=e===!0?"":e)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(e=>e&&o.classList.add(e));else if(typeof s=="object")for(const e in s){const r=typeof s[e]=="function"?s[e](t,t.state,t.context):s[e];r&&o.classList.add(typeof r=="string"?r:e)}}}}function Lt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function Cn(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 ht(t,o){if(!t||!t.style||!o)return null;const s=t.style,e=[];for(const r in o){if(o[r]==null||r.charAt(0)==="&")continue;const a=Q(r);e.push(a,ao(s,a),ts(s,a))}return e}function ao(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function ts(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function Q(t){return et(t)?t:t.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}function Vt(t,o,s){if(!t||!t.style||!o||!o.length)return;const e=t.style,r=new Set;if(s&&typeof s=="object")for(const i in s)s[i]==null||i.charAt(0)==="&"||r.add(Q(i));for(let i=0;i<o.length;i+=3){const a=o[i];r.has(a)||ao(e,a)===o[i+1]&&typeof e.removeProperty=="function"&&e.removeProperty(a)}}function yt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let e=0;e<o.length;e+=3)if(ao(s,o[e])!==o[e+1]||ts(s,o[e])!==o[e+2])return!1;return!0}const et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,os=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",Bt=t=>et(t)?t:"--"+t;function Gt(t,o){if(!m(t))return null;let s=null;for(const e of Object.keys(t)){if(!e)continue;let r=t[e];if(typeof r=="function"){if(!o)continue;r=r(o,o.state,o.context)}os(r)&&(s||(s={}),s[Bt(e)]=r)}return s}function ss(t,o,s,e,r){const i=t.__ref,a=T(t,e,s);let f,n=null;const c=j(()=>{const l=t.context?.designSystem;l&&L(l);try{const u=a(t,t.state,t.context),d=t.node;if(!d||!d.style)return;if(!os(u)){Vt(d,n,null),f=void 0,n=null;return}const h=String(u);if(h!==f||!yt(d,n)){f=h;const y={[o]:u};X(d,y),n=ht(d,y)}}catch(u){M(i,r,u)}finally{l&&D()}},{depth:i.path.length,label:k(i,r)});i.__effects.push(c)}function vn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){kn(t,s),o.__exec.vars=s;return}if(m(s))for(const e of Object.keys(s)){const r=s[e];!e||typeof r!="function"||ss(t,Bt(e),r,lt(t.varsDeps,e),"vars."+e)}}function kn(t,o){const s=t.__ref,e=T(t,t.varsDeps,o);let r,i=null;const a=j(()=>{const f=t.context?.designSystem;f&&L(f);try{const n=Gt(e(t,t.state,t.context)),c=t.node;if(!c||!c.style)return;const l=Lt(n);(l===null||l!==r||!yt(c,i))&&(r=l,Vt(c,i,n),n&&X(c,n),i=n?ht(c,n):null,s.__varsInline=n?new Set(Object.keys(n)):null)}catch(n){M(s,"vars",n)}finally{f&&D()}},{depth:s.path.length,label:k(s,"vars")});s.__effects.push(a)}function uo(t,o){if(typeof t[o]=="function"&&(st(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!et(o))return!1;const s=t.vars;if(typeof s=="function"){const e=t.__ref&&t.__ref.__varsInline;return!!(e&&e.has(o))}if(!m(s))return!1;for(const e of Object.keys(s))if(typeof s[e]=="function"&&Bt(e)===o)return!0;return!1}function jn(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 En(t,o,s,e){const r=t.__ref;if(!r)return;let i=null;if(s)for(const a of s){if(e&&e.has(a))continue;const f=o[a];if(f==null||typeof f=="object")continue;const n=Q(a);$t[n]&&(i||(i={}),i[n]=f)}r.__declaredLonghands=i}function ns(t,o){const s=t.__ref,e=s&&s.__declaredLonghands;if(!e||!o)return null;let r=null;for(const i in e){if(o.has(i))continue;const a=$t[i];let f=!1;for(let n=0;n<a.length;n++)if(o.has(a[n])){f=!0;break}f&&(r||(r={}),r[i]=e[i])}return r}function es(t,o){const s=t.node;X(s,o);const e=jn(o);if(!e)return o;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const a of e)r.__inlineCssKeys.add(a);else r.__inlineCssKeys=new Set(e);const i=ns(t,e);return i?(X(s,i),Object.assign({},o,i)):o}function Pn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=ns(t,o.__inlineCssKeys);s&&X(t.node,s)}function lo(t,o){if(!o||typeof o!="object")return o;const s=t&&t.context&&t.context.designSystem;s&&L(s);try{return Zs(o,t)}catch{return o}finally{s&&D()}}function X(t,o){if(!t||!o||!t.style)return;let s=null;for(const e in o){const r=o[e];if(r!=null){if(e.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[e]=r;continue}try{const i=String(r),a=et(e)?e:e.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),f=i.trim(),n=/\s*!important\s*$/.test(f),c=f.replace(/\s*!important\s*$/,"");t.style.setProperty(a,c,n?"important":"")}catch{}}}s&&On(t,s)}function On(t,o){const s=`_ds${Fo.scopedStyleId++}`;t.classList.add(s);const e=t.ownerDocument;let r=e.querySelector("style[data-smbls-scoped]");r||(r=e.createElement("style"),r.setAttribute("data-smbls-scoped",""),e.head.appendChild(r));let i="";for(const a in o){const f="."+s,n=a.replace(/&/g,f).split(",").map(l=>{const u=l.trim();return u.includes(f)?u:f+u}).join(", "),c=o[a];if(typeof c=="object"){let l="",u="";for(const d in c){const h=c[d];if(typeof h=="object"){const y=d.includes("&")?n.split(", ").map(g=>d.replace(/&/g,g)).join(", "):n.split(", ").map(g=>`${g} ${d}`).join(", ");let A="";for(const g in h)A+=`${Q(g)}: ${h[g]};`;u+=Mo(`${y} { ${A} }`,y)+`
5
5
  `}else l+=`${Q(d)}: ${h};`}l&&(i+=Mo(`${n} { ${l} }`,n)+`
6
- `),u&&(i+=u)}}i&&(r.textContent+=i)}const rs=new Set;function is(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 On(t,o,s){const e=is(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=o(t,t.state,t.context)}catch{return}if(is(r)===e)return;const i=t.__ref.path?t.__ref.path.join("."):t.key||"?";rs.has(i)||(rs.add(i),console.warn(`[smbls] subscribeTo function at "${i}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Tn(t){const o=t.subscribeTo,s=typeof o=="function";let e=o;if(s)try{e=o(t,t.state,t.context)}catch{e=null}if(s&&ft()&&On(t,o,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const r=t.__ref;for(let i=0;i<e.length;i++){const a=e[i];if(typeof a!="string"||a.length===0)continue;const f=a.split("."),n=f[0],c=f.slice(1),l={value:!1},u=j(()=>{const d=t.state&&(Y(t.state)?t.state.root:null);if(!d||!Y(d))return;let h=d;h=h[n];for(let A=0;A<c.length&&!(h==null||typeof h!="object");A++)if(Y(h))h=h[c[A]];else break;if(!l.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const A=t.context?.designSystem;A&&L(A);try{if(oe(r)){const g=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});g&&typeof g.then=="function"?g.then(()=>Wt(r,!1),b=>{Wt(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:b})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",b)}):(Wt(r,!1),g===!1&&(y=!0))}}catch(g){Wt(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{A&&D()}}if(!y&&t.node&&r.__effects)for(let A=0;A<r.__effects.length;A++){const g=r.__effects[A];g&&g!==u&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!y&&typeof t.onUpdate=="function"){const A=t.context?.designSystem;A&&L(A);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&q("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{A&&D()}}},{depth:r.path.length,label:k(r,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,r.__effects.push(u)}}function po(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 ho(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 cs=new Set;function Ln(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",e=s+"::"+t;cs.has(e)||(cs.add(e),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 fs=new Map;function Dn(t){let o=fs.get(t);if(o)return o;o=[];const s=e=>{if(e)for(const r of e)o.push(r.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()))};return s($t[t]),s(Js[t]),fs.set(t,o),o}function as(t,o,s){if(uo(t,o)||s&&s.has(o))return!0;const e=Dn(Q(o));for(let r=0;r<e.length;r++){const i=e[r];if(uo(t,i)||s&&s.has(i))return!0}return!1}function _t(t,o,s,e){const r={},i=new Set,a=(f,n,c)=>{const l=c?new Set(Object.keys(r)):null;if(U[f]){const u=U[f](n,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(r,h)}}else r[f]=n;if(c)for(const u in r)l.has(u)||i.add(u)};for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f))continue;let n=t[f];if(typeof n=="function"&&(n=n(o,o.state,o.context)),!(n==null||typeof n=="function")){if(typeof n=="object"&&!Array.isArray(n)){if(f==="style"){for(const u in n){let d=n[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,as(o,u,e))}continue}if(f==="vars"){const u=Gt(n,o);if(u)for(const d in u)a(d,u[d],uo(o,d)||!!(e&&e.has(d)));continue}if(po(f,o)){const u=_t(n,o,!1,e);Object.keys(u).length&&(r[`[data-theme="${f.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(f)){ft()&&Ln(f,o);continue}const c=ho(f,o),l=_t(n,o,!1,e);Object.keys(l).length&&(r[c]=l);continue}a(f,n,as(o,f,e))}}if(s)for(const f in r)i.add(f);for(const f of i){const n=r[f];typeof n=="string"&&!n.includes("!important")&&(r[f]=n+" !important")}return r}const m=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function us(t,o){for(const s in o){const e=o[s];t[s]=m(e)?us(m(t[s])?t[s]:{},e):e}return t}function Mn(t,o){if(!m(o))return;let s;for(const e of t.split(" ")){const r=e?o[e]:null;m(r)&&(s=us(s||{},r))}return s}function yo(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)&&yo(t[s],o+1))return!0}return!1}function ds(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(po(t,s)){const i=_t(o,s,!1);return Object.keys(i).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:i}:null}const e=ho(t,s),r=_t(o,s,!1);return Object.keys(r).length?{cssProp:e,block:r}:null}function Rn(t){const o=t.__ref;for(const s of Object.keys(t)){if(!so(s))continue;const e=t[s];if(!e||typeof e!="object"||Array.isArray(e)||!yo(e))continue;let r=null,i;const a=j(()=>{if(!t.node)return;const f=t.context?.designSystem;f&&L(f);let n,c=!1;try{const l=ds(s,e,t),u=l?Lt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===i)c=!0;else if(i=u,l){const d=wt({[l.cssProp]:l.block},null,t.context?.cssPrefix);n=d?d.split(" ").filter(Boolean):null}else n=null}finally{f&&D()}if(!(c||!t.node.classList)){if(r)for(const l of r)t.node.classList.remove(l);if(n&&n.length)for(const l of n)t.node.classList.add(l);r=n}},{depth:o.path.length,label:k(o,"cssBlock("+s+")")});o.__effects.push(a)}}const Nn=()=>!0,Fn=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!U[t]||!!(V&&V.has(t))||et(t)||t==="vars"};function $n(t,o,s){const e={};let r=!1;for(const f in s)Object.prototype.hasOwnProperty.call(s,f)&&(f!=="data"&&f!=="aria"&&(Fn(f,s[f])||G.has(f))?e[f]=!0:r=!0);if(!r)return null;const i=Qs({[o]:s},t.tag||"div",e,Nn);let a=null;for(const f in i)/^on/i.test(f)||(a||(a={}),a[f]=i[f]);return a}function ls(t,o,s,e,r,i){const a=t.node;let f=null;const n=c=>{(f||(f=[])).push(c)};for(const c in e){const l=o.owners.get(c),u=l===s;if(!i&&l!==void 0&&!u)continue;let d;try{d=e[c](t)}catch(y){M(t.__ref,"conditional("+s+")."+c,y),u&&n(c);continue}if(typeof d=="string"&&d.includes("{{")&&(d=I.call(t,d,t.state)),u&&a.getAttribute(c)!==o.written.get(c)){n(c);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&ps(a,o,c);continue}const h=d===!1&&!at(c)?null:String(K(c,d));n(c),!(u&&h===o.written.get(c))&&(l===void 0&&o.base.set(c,a.getAttribute(c)),h==null?a.removeAttribute(c):a.setAttribute(c,h),o.owners.set(c,s),o.written.set(c,h))}r.appliedAttrs=f}function ps(t,o,s){if(t.getAttribute(s)===o.written.get(s)){const e=o.base.get(s);e==null?t.removeAttribute(s):t.setAttribute(s,e)}o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function In(t,o,s,e){const r=e.appliedAttrs;if(e.appliedAttrs=null,!!r)for(const i of r)o.owners.get(i)===s&&ps(t.node,o,i)}function _o(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const e of o.owners.keys()){const r=o.written.get(e),i=s.getAttribute(e);i!==r&&(o.base.set(e,i),r==null?s.removeAttribute(e):s.setAttribute(e,r))}}function Un(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const e=new Map;for(const r of Object.keys(t)){const i=r.charAt(0);if(i!=="."&&i!=="!")continue;const a=r.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const g=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${i}\` is read as one prop name. Nest the selector inside instead: \`${i}${g}: { '${a.slice(g.length)}': {...} }\`.`)}continue}const f=t[r];if(!f||typeof f!="object")continue;const n=i==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},l=$n(t,r,f);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const g in f){if(!Object.prototype.hasOwnProperty.call(f,g))continue;const b=g.charAt(0),w=f[g];if(!((b===":"||b==="@"||b==="&"||b==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(g==="vars"&&m(w)){for(const p of Object.keys(w))p&&u.add(Bt(p));continue}u.add(g)}}const d=()=>{let g;const b=t[a];if(b===void 0){const _=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(_||x!==void 0)g=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{g=typeof S=="function"?S.call(t,t):S}catch(v){g=!1,o.__conditionalError=v,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,v?.message||v)}}}else if(typeof b=="function")try{g=b(t,t.state,t.context)}catch(_){g=!1,o.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else g=b;const w=n?!g:!!g;if(!t.node)return;const p=t.context?.designSystem;if(w===c.lastMatch){if(w&&l&&t.node.setAttribute){p&&L(p);try{ls(t,s,r,l,c,!1)}finally{p&&D()}}return}c.lastMatch=w,p&&L(p);try{if(w){const _={},x={};let S=!1;for(const C in f){if(!Object.prototype.hasOwnProperty.call(f,C))continue;const N=f[C],tt=C.charAt(0);if((tt===":"||tt==="@"||tt==="&"||tt==="[")&&N&&typeof N=="object"&&!Array.isArray(N)){if(po(C,t)){const P=_t(N,t,!1,u);Object.keys(P).length&&(x[`[data-theme="${C.slice(1)}"] &`]=P,S=!0)}else{const P=ho(C,t),F=_t(N,t,!1,u);Object.keys(F).length&&(x[P]=F,S=!0)}continue}const ot=typeof N=="function"?N(t,t.state,t.context):N;if(ot!=null){if(U[C]){const P=U[C](ot,t,t.state,t.context);if(P){const F=Array.isArray(P)?P:[P];for(const gt of F)gt&&Object.assign(_,gt)}}else if(V&&V.has(C))_[C]=ot;else if(et(C))_[C]=ot;else if(C==="vars"){const P=Gt(ot,t);P&&Object.assign(_,P)}}}const v=Object.keys(_);if(v.length){X(t.node,_);for(const C of v)e.set(C,r);c.appliedKeys=v}else c.appliedKeys=null;if(S){const C=wt(x,null,t.context?.cssPrefix,{state:!0}),N=C?C.split(" ").filter(Boolean):[];if(N.length&&t.node.classList){for(const tt of N)t.node.classList.add(tt);c.appliedClasses=N}else c.appliedClasses=null}else if(c.appliedClasses){for(const C of c.appliedClasses)t.node.classList.remove(C);c.appliedClasses=null}l&&t.node.setAttribute&&ls(t,s,r,l,c,!0)}else{if(c.appliedAttrs&&In(t,s,r,c),c.appliedKeys){for(const _ of c.appliedKeys)e.get(_)===r&&(et(_)?t.node.style.removeProperty(_):t.node.style[_]="",e.delete(_));c.appliedKeys=null}if(c.appliedClasses){for(const _ of c.appliedClasses)t.node.classList.remove(_);c.appliedClasses=null}}}finally{p&&D()}};o.__conditionalRunners.push(d);const h=T(t,t[a+"Deps"],d),y=j(h,{depth:o.path.length,label:k(o,"conditional("+r+")")}),A=o.__exec&&o.__exec[a]||t[a];y._sources.size===0&&typeof A=="function"&&ft()&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(y)}}const go=new WeakSet,hs=new WeakSet,ys=new WeakSet;function Hn(t){if(ys.has(t))return!1;if(!hs.has(t)){hs.add(t);const o=t.defaultView,s=()=>{ys.add(t)};o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(s):setTimeout(s,0)}return!0}function Vn(t){const o=t.ownerDocument;!o||go.has(o)||Hn(o)||(go.add(o),queueMicrotask(()=>{go.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const bo=new WeakSet;let _s=!1;function gs(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Ao(t,o){const s={...t};for(const e in o){const r=o[e],i=s[e];s[e]=r&&typeof r=="object"&&i&&typeof i=="object"?Ao(i,r):r}return s}function bs(t,o){const s={};for(const e in t){const r=t[e];if(r&&typeof r=="object"){const i=bs(r,o);Object.keys(i).length&&(s[e]=i)}else o.has(e)||(s[e]=r)}return s}function Bn(t,o,s){let e=null;for(const[r,i]of o){const a=Q(r),f=$t[a];if(f)for(let n=0;n<f.length;n++){const c=f[n].replace(/-([a-z])/g,(y,A)=>A.toUpperCase()),l=t[c]!=null?o.get(c):void 0,u=s&&s.get(f[n]),d=l!==void 0&&l>i&&Ro(f[n],t[c],a),h=!d&&u!==void 0&&u>i&&Ro(f[n],void 0,a);if(d||h){d&&delete t[r],e||(e=new Set),e.add(r);break}}}return e}function As(t){const{node:o}=t;if(!o)return;if(_s||(_s=!0,wt({display:"none"})),bo.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}bo.add(t);const s=t.context?.designSystem;s&&L(s),Lo();try{const e={};let r=!1,i=[],a=null,f=null,n=null;const c=t.__ref&&t.__ref.__mergeLayer;let l,u=null,d=null;const h=(p,_)=>{if(_&&typeof _=="object"&&gs(p)){f||(f={});const x=f[p];x&&(_=Ao(x,_)),f[p]=_}else(_===null||typeof _!="object")&&(n||(n=new Set),n.add(p),l!==void 0&&(u||(u=new Map),u.set(p,l)));e[p]=_};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&U.theme){const p=U.theme(t.theme,t,t.state,t.context);if(p){const _=x=>{for(const S in x){const v=x[S];v&&typeof v=="object"&&gs(S)&&(a||(a={}),a[S]=v),e[S]=v}};if(Array.isArray(p))for(const x of p)x&&_(x);else _(p);r=!0}}const y=(p,_)=>{if(p==="vars"){const x=Gt(_);if(x){for(const S in x)h(S,x[S]);r=!0}return}if(U[p]){const x=U[p](_,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const v in S)h(v,S[v])}else for(const S in x)h(S,x[S]);r=!0}}else if(V&&V.has(p))_!=null&&typeof _!="object"&&(h(p,_),r=!0);else if(p.charCodeAt(0)===45)_!=null&&typeof _!="object"&&(h(p,_),r=!0);else if((p.charAt(0)==="&"||p.charAt(0)==="@"||p.charAt(0)===":"||p.charAt(0)==="[")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yo(_))return;const x=ds(p,_,t);x&&(h(x.cssProp,x.block),r=!0)}};if(typeof t.class=="string"){const p=Mn(t.class,t.context?.designSystem?.class);if(p)for(const _ in p)y(_,p[_])}const A=n?new Set(n):null,g=t.tag||"div";for(const p of Object.keys(t)){if(typeof t[p]=="function"){const x=c&&c.get(p);x!==void 0&&st(g,p)&&(d||(d=new Map),d.set(Q(p),x));continue}if(l=c?c.get(p):void 0,p==="vars"){y(p,t[p]);continue}if(G.has(p)||p==="theme")continue;const _=p.charCodeAt(0);_>=65&&_<=90||Z(p)||No(g,p)||y(p,t[p])}l=void 0;const b=u?Bn(e,u,d):null;if(a)for(const p in a){let _=n?bs(a[p],n):a[p];f&&f[p]&&(_=Ao(_,f[p])),Object.keys(_).length?e[p]=_:delete e[p]}if(jn(t,e,n,b?new Set([...A||[],...b]):A),r){e.display&&String(e.display).includes("!important")&&(o.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const p=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof p=="string"&&p!==""&&e.display&&e.display!==p&&(e.display=p);const _=wt(e,null,t.context?.cssPrefix);if(i=_?_.split(" ").filter(Boolean):[],_&&o.classList){const x=i;let S=!1;for(const v of x)o.classList.add(v),S||(v.charCodeAt(0)===95&&v.charCodeAt(1)===99||v.charCodeAt(0)===95&&v.indexOf("_c",1)!==-1)&&(S=!0);S&&Vn(o)}}const w=t.__ref;if(w){const p=w.__staticCssClasses;if(p&&o.classList){const _=new Set(i);for(const x of p)_.has(x)||o.classList.remove(x)}w.__staticCssClasses=i}En(t)}finally{Do(),s&&D(),bo.delete(t)}}const Pe=t=>!!U[t]||!!(V&&V.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Oe(t){t&&t.node&&As(t)}function xs(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const i=t.aria[r];if(typeof i=="function"||typeof i=="object"||i==null||typeof i=="string"&&i.includes("{{"))continue;const a="aria-"+r.replace(/[A-Z]/g,f=>"-"+f.toLowerCase());o.setAttribute(a,K(a,i))}const s=Zs(t);for(const r in s){const i=s[r];i!=null&&i!==!1&&typeof i!="function"&&typeof i!="object"&&o.setAttribute(r,i===!0?"":i)}const e=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.has(r)||r==="on"||s[r]!==void 0)continue;const i=r.charCodeAt(0);if(!(i>=65&&i<=90)&&!Z(r)&&!st(e,r)&&St(e,r)){let a=t[r];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!Jt[r])continue;a=I.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!at(Ct(r)||r))continue;const f=Ct(r)||r;o.setAttribute(f,K(f,a))}}}function Te(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const e=o.charCodeAt(0);if(e>=65&&e<=90||Z(o))return;const r=t.tag||"div";if(st(r,o)||!St(r,o))return;const i=Ct(o)||o,a=i.toLowerCase(),f=t.__ref&&t.__ref.__effects;let n=!1;if(f)for(let u=0;u<f.length;u++){const d=f[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(n=!0,d._execute())}if(n)return;let c=t[o];const l=Jt[o];if(l&&c!=null){const u=l(t);u!==void 0&&(c=u)}typeof c=="string"&&c.includes("{{")&&(c=I.call(t,c,t.state)),c==null||c===!1&&!at(i)?s.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&s.setAttribute(i,K(i,c))}function Gn(t,o){const s=t.node,e=t.__ref;let r=e.__autoGrow;if(!o){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}Ss(r),nt.delete(t),s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),ks(s,r,!1),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=e.__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){Dt(t,!0);return}if(!(s.scrollHeight>0)){r.awaitingLayout=!0,ws(t,r);return}r.awaitingLayout=!1;const a=zn(s),f=Yn(a),n=s.style.height;s.style.height="0px",f&&wo(s);const c=s.scrollHeight;if(!(c>0)){s.style.height=n,f&&wo(s);return}const l=qn(s,a),u=l!=null&&c<l?l:c,d=Xn(a),h=d!=null&&u>d;s.style.height=Qn(h?d:u,a)+"px",f&&wo(s),ks(s,r,h),r.lastMeasure=c,r.lastWidth=s.clientWidth,ws(t,r)}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}Ss(r),nt.delete(t)})),r.active||(s.addEventListener("input",r.resize),r.active=!0,Wn(t,r));const i=typeof o=="object"&&o.max!=null?String(o.max):null;i!==r.appliedMax&&(i==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=i,r.appliedMax=i),r.resize()}function Dt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),nt.add(t),It())}function Kn(){const t=Array.from(nt);nt.clear();for(let o=0;o<t.length;o++){const s=t[o],e=s.node,r=s.__ref?.__autoGrow;if(!(!e||!r||!r.active)){if(!e.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=dt()),r.attachAttempts+=1,r.attachAttempts<=Uo&&dt()-r.firstAttemptAt<Ho&&(nt.add(s),It());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function ws(t,o){if(o.watch)return;const s=t.node;if(!s)return;const e=s.ownerDocument&&s.ownerDocument.defaultView,r=e&&e.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const i=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Dt(t,!0);return}const f=s.clientWidth;o.lastWidth!=null&&Math.abs(f-o.lastWidth)<.5||(o.lastWidth=f,Dt(t,!0))};let a;try{a=new r(i),a.observe(s)}catch{return}o.watch=a}function Ss(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function Wn(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,e=s&&s.fonts&&s.fonts.ready;!e||typeof e.then!="function"||e.then(()=>{o.active&&t.node&&Dt(t,!0)},()=>{})}function zn(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,xo=t=>(rt(t.paddingTop)||0)+(rt(t.paddingBottom)||0),Cs=t=>(rt(t.borderTopWidth)||0)+(rt(t.borderBottomWidth)||0);function Yn(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let e=0;e<o.length;e++){const r=o[e].trim();if(!(r!=="all"&&r!=="height")&&parseFloat(s[e%s.length])>0)return!0}return!1}function wo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const e=o[s];if(e&&e.transitionProperty==="height")try{e.cancel()}catch{}}}function qn(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const e=rt(o.lineHeight)||Zn(t,o);return e>0?s*e+xo(o):null}const Mt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],vs=new WeakMap;function Zn(t,o){const s=t.ownerDocument,e=s&&(s.body||s.documentElement);if(!e||!s.createElement)return null;let r=vs.get(s);r||(r=new Map,vs.set(s,r));const i=Mt.map(c=>o[c]||"").join("|");if(r.has(i))return r.get(i);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const f=a.style;f.position="absolute",f.visibility="hidden",f.top="0",f.left="-9999px",f.height="auto",f.minHeight="0",f.maxHeight="none",f.padding="0",f.border="0",f.boxSizing="content-box",f.overflow="hidden";for(let c=0;c<Mt.length;c++)o[Mt[c]]&&(f[Mt[c]]=o[Mt[c]]);let n=0;try{e.appendChild(a),n=a.clientHeight}catch{n=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return n>0?(r.set(i,n),n):null}function Qn(t,o){return o?o.boxSizing==="border-box"?t+Cs(o):o.boxSizing==="content-box"?Math.max(0,t-xo(o)):t:t}function Xn(t){if(!t)return null;const o=rt(t.maxHeight);if(o==null||!(o>0))return null;const s=xo(t),e=Cs(t),r=t.boxSizing==="border-box"?o-e:o+s,i=rt(t.lineHeight);if(!(i>0))return r;const a=Math.floor((r-s)/i+1e-6);return a>=1?a*i+s:r}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 js=["srcObject","muted"],Jn=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function mn(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let e=0;e<js.length;e++){const r=js[e],i=t[r];if(i===void 0||!(r in o))continue;const a=f=>{const n=Jn(r,f);if(o[r]!==n)try{o[r]=n}catch(c){M(s,r,c)}};if(typeof i=="function"){const f=T(t,t[r+"Deps"],i),n=j(()=>{try{a(f(t,t.state,t.context))}catch(c){M(s,r,c)}},{depth:s.path.length,label:k(s,r)});s.__effects.push(n),s.__exec[r]=i}else a(i);r==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Es(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,e=t.autoGrow,r=typeof e=="function"?T(t,t.autoGrowDeps,e):null,i=j(()=>{const a=t.autoGrow;let f=a;if(typeof a=="function")try{f=(a===e&&r?r:a)(t,t.state,t.context)}catch{f=null}Gn(t,f)},{depth:s.path.length,label:k(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(i),r&&(s.__exec.autoGrow=e)}const Ps=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Os(t,o){for(const s of Object.keys(t)){if(!Z(s)||Ps.has(s))continue;const e=Vs(s);if(e){Hs(e,t,t[s]);continue}let r=t[s],i=null;if(r&&typeof r=="object"&&!Array.isArray(r)&&(i=r,r=i.handler),typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const f=r;r=function(c){return t.call(f,c)}}if(typeof r!="function")continue;const a=en(s);Is.has(a)||Us(rn(a),t,r,i)}te(t)}function te(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let e=!1;for(const d of Ps){const h=t[d];typeof h=="function"&&(s[d]=h,e=!0)}if(!e)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,i=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,f=0,n=0,c=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,f=h.clientY,n=Date.now(),c=!0)},u=d=>{if(!c)return;c=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const y=h.clientX-a,A=h.clientY-f,g=Date.now()-n;if(g>i)return;const b=Math.abs(y),w=Math.abs(A);if(Math.max(b,w)<r)return;let p;if(b>w*1.2)p=y<0?"left":"right";else if(w>b*1.2)p=A<0?"up":"down";else return;const _="onSwipe"+p.charAt(0).toUpperCase()+p.slice(1),x=s[_],S=s.onSwipe;x&&x.call(t,d,t,t.state,t.context),S&&S.call(t,{direction:p,dx:y,dy:A,dt:g,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function it(t,o){const s={...t};for(const e in o){const r=s[e],i=o[e];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[e]=it(r,i):s[e]=i}return s}function So(t,o,s,e,r){if(!o||!t.node)return;const i=t.childExtends,a=pt(t,"childProps");if(Array.isArray(o)){const f=t.tag==="fragment",n=t.context?.document||globalThis.document,c=f?null:n?.createDocumentFragment();if(!f&&!c)return;const l=t.childProps,u=t.childrenAs,d=w=>{let p=o[w];const _=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let x=l;if(typeof l=="function")try{x=l(t,p)}catch{x=null}let S=typeof l=="function"?Pt(x):a;if(r&&u!=="state"&&(S=Ot(S,Pt(_))),u==="state"){let C=_;(typeof _=="string"||typeof _=="number")&&(C={value:_,text:_}),p=x?{...x,state:C}:{state:C}}else x&&(p=it(x,p));if(i&&!p.ignoreChildExtends)if(p.extends){const C=Array.isArray(p.extends)?p.extends:[p.extends],N=Array.isArray(i)?i:[i];p={...p,extends:[...N,...C]}}else p={...p,extends:i};const v=Bo(p?.key,_,w);try{return J(Tt(p,S),t,v,s)}catch(C){if(typeof console<"u"&&console.error){const N=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to construct at ${N} (initial render, skipping this row):`,C?.message||C)}return null}},h=t.__ref;if(!(e===!0&&!f&&!!h&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const p=d(w);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const A=h.__childrenChunkGen=(h.__childrenChunkGen||0)+1;Po();let g=null;const b=w=>{if(h.__disposed||h.__childrenChunkGen!==A){g&&g.parentNode&&g.remove();return}for(let p=w;p<o.length;p++){const _=d(p);if(_?.node&&(g?t.node.insertBefore(_.node,g):c.appendChild(_.node)),p+1<o.length&&Eo()){g||(g=n.createComment("smbls-mount"),c.appendChild(g),t.node.appendChild(c));const x=p+1;To(()=>b(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&Kt(t,!0)):t.node.appendChild(c)};return b(0),Oo(),!0}if(typeof o=="string"){const f=Ko(o,t);if(Array.isArray(f))return So(t,f,s,e,!0)}if(typeof o=="object")for(const f in o){if(G.has(f))continue;let n=o[f];if(n==null||n===!1)continue;const c=r?Ot(a,Pt(n)):a;if((typeof n=="string"||typeof n=="number")&&(n={text:n}),t.childProps&&(n=it(t.childProps,n)),i&&!n.ignoreChildExtends)if(n.extends){const l=Array.isArray(n.extends)?n.extends:[n.extends],u=Array.isArray(i)?i:[i];n={...n,extends:[...u,...l]}}else n={...n,extends:i};J(Tt(n,c),t,f,s)}}function Kt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const e=s.options;if(!e||!e.length)return;const r=t.__ref,i=r&&r.__exec&&r.__exec.value,a=typeof i=="function",f=t.value!=null&&typeof t.value!="function";if(a||f){let l;if(a)try{l=i(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=I.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const n=o||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!n)return;let c=-1;for(let l=0;l<e.length;l++)e[l].defaultSelected&&(c=l);c>=0&&s.selectedIndex!==c&&(s.selectedIndex=c)}function Ts(t,o){let{children:s,content:e}=t;const r=t.childExtends,i=typeof s=="function"||Yo(t,"children");if(typeof s=="function"){const y=s;try{s=y(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const _=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${_} (initial run, treating as empty):`,p?.message||p)}}qo(t,s),t.children=s;const A=t.__ref;let g=!1;const b=T(t,t.childrenDeps,y),w=j(()=>{const p=g;g=!0;let _;try{_=b(t,t.state,t.context)}catch(P){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${F}${p?"":" (initial tracking run)"}:`,P?.message||P)}return}if(!p||_===t.children)return;qo(t,_),t.children=_,A.__childrenChunkGen!=null&&A.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,v=x?[]:null,C=x?[]:null;if(Array.isArray(_)&&t.childrenAs==="state"){const P=t.childProps,F=[],gt=new Map;for(let E=0;E<_.length;E++){const B=_[E];let O=P;if(typeof P=="function")try{O=P(t,B)}catch{O=null}const z=Bo(O&&O.key,B,E);F.push(z),gt.set(z,{rawChild:B,childProps:O})}const Ds=new Set(F),Ms=A.__children.slice();for(const E of Ms)if(!Ds.has(E)){const B=t[E];B?.remove&&B.remove(),delete t[E],v&&v.push(E)}const bt=t.childExtends,Rt=t.tag==="fragment",Rs=t.context?.document||globalThis.document,At=Rt?null:Rs?.createDocumentFragment(),zt=new Set;for(const E of F){const B=gt.get(E),O=B.rawChild,z=t[E];if(z&&z.state){if(O&&typeof O=="object"){const $=z.state,ct=$.$replace||$.replace,vo=$.$update||$.update;try{if(typeof ct=="function")ct.call($,O);else if(typeof vo=="function"){for(const H in $)if(!(H==="__element"||H==="root"||H==="parent"||H==="update")&&!Object.prototype.hasOwnProperty.call(O,H))try{$[H]=void 0}catch{}vo.call($,O)}else for(const H in O)$[H]=O[H]}catch(H){if(typeof console<"u"&&console.error){const Fs=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to patch at ${Fs} (reconcile, keeping its previous data for this pass):`,H?.message||H)}}}C&&C.push(E);continue}let Yt=O;(typeof O=="string"||typeof O=="number")&&(Yt={value:O,text:O});const qt=B.childProps;let W=qt?{...qt,state:Yt}:{state:Yt};const Ns=typeof P=="function"?Pt(qt):pt(t,"childProps");if(bt&&!W.ignoreChildExtends)if(W.extends){const $=Array.isArray(W.extends)?W.extends:[W.extends],ct=Array.isArray(bt)?bt:[bt];W={...W,extends:[...ct,...$]}}else W={...W,extends:bt};let Zt;try{Zt=J(Tt(W,Ns),t,E,o)}catch($){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):`,$?.message||$)}zt.add(E);continue}!Rt&&Zt?.node&&At&&At.appendChild(Zt.node),S&&S.push(E)}if(!Rt&&At&&At.childNodes.length&&t.node&&t.node.appendChild(At),!Rt&&t.node){let E=null;for(const B of F){const O=t[B]?.node;if(!O)continue;const z=E?E.nextSibling:t.node.firstChild;O!==z&&t.node.insertBefore(O,z),E=O}}A.__children=zt.size?F.filter(E=>!zt.has(E)):F,x&&(S.length||v.length)&&Vo(t,{added:S,removed:v,kept:C}),Kt(t,!1);return}const ot=x?[...A.__children]:null;for(const P of[...A.__children]){const F=t[P];F?.remove&&F.remove(),delete t[P]}A.__children=[],So(t,_,o,!1,!0),Kt(t,!1),x&&Vo(t,{added:[...A.__children],removed:ot,kept:[]})},{depth:A.path.length,label:k(A,"children")});A.__effects.push(w)}const a=So(t,s,o,!0,i);if(e!=null&&!(e&&e.__ref)){let y=e;if(typeof y=="string"||typeof y=="number"?y={text:y}:typeof y!="object"&&(y={}),t.childProps&&(y=it(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],b=Array.isArray(r)?r:[r];y={...y,extends:[...b,...g]}}else y={...y,extends:r};const A=Ot(pt(t,"childProps"),pt(t,"content"));J(Tt(y,A),t,"content",o)}if(s&&!a)return;const f=t.context?.components||{},n=t.__ref&&t.__ref.__runtimeSource,c=n?{}:null;{const y=Object.keys(t);for(let A=0;A<y.length;A++){const g=y[A];if(!g.endsWith("Extends")||typeof t[g]!="string")continue;const b=g.slice(0,-7);if(!b||b.charCodeAt(0)<65||b.charCodeAt(0)>90)continue;const w={extends:t[g]};delete t[g];for(let p=A+1;p<y.length;p++){const _=y[p],x=_.charCodeAt(0);if(x>=65&&x<=90||G.has(_)||typeof t[_]=="function"&&(_.startsWith("on")||_.startsWith(".")))break;const S=t[_];S!==void 0&&(w[_]=S,delete t[_],c&&Et(n,_)&&(c[b]||(c[b]={}),c[b][_]=n[_]))}t[b]&&typeof t[b]=="object"?t[b]={...w,...t[b]}:t[b]=w}}const l=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),d=y=>{if(G.has(y)||typeof t[y]!="object"||t[y]===null)return;const A=y.charCodeAt(0);if(A<65||A>90)return;let g=t[y];if(g.__ref)return;if(!g.extends&&!g.extend){const w=f[y]||f[`smbls.${y}`];w&&(g={...g,extends:w})}if(t.childProps&&(g=it(t.childProps,g)),r&&!g.ignoreChildExtends)if(g.extends){const w=Array.isArray(g.extends)?g.extends:[g.extends],p=Array.isArray(r)?r:[r];g={...g,extends:[...p,...w]}}else g={...g,extends:r};const b=n?Ot(pt(t,"childProps"),Ot(c[y]||null,pt(t,y))):null;J(Tt(g,b),t,y,o)};if(!l){for(const y of u)d(y);return}Po();const h=y=>{for(let A=y;A<u.length;A++)if(d(u[A]),A+1<u.length&&Eo()){const g=A+1;To(()=>h(g));return}};h(0),Oo()}function Ls(t,o,s){const{node:e}=t;if(!e)return;e.ref=t;const r=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(r){const a=r.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const f=s.node.nextSibling;a.insertBefore(e,f||r)}else a.insertBefore(e,r);return}}const i=o?.node||(o?.nodeType?o:null);if(i)if(s?.position==="before"&&s.node)i.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?i.insertBefore(e,a):i.appendChild(e)}else i.appendChild(e)}const Co=3;function oe(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Co?!1:(t.__inBeforeUpdate=!0,!0)}function Wt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Co&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Co}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function R(t,o,s){const e=t.charAt(0).toLowerCase()+t.slice(1);o.context?.plugins?.length&&q(e,o,s);const r="on"+t,i=o[r];if(typeof i=="function"){const n=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(n){if(o.__ref[n])return!0;o.__ref[n]=!0}const c=o.context?.designSystem;c&&L(c);let l=!!n;try{const u=i(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{o.context?.plugins?.length&&q("error",o,{hook:r,error:h})||console.error(`[DOMQL] Lifecycle "${r}" error:`,h)}).finally(()=>{n&&d&&(d[n]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if(o.context?.plugins?.length&&q("error",o,{hook:r,error:u})||console.error(`[DOMQL] Lifecycle "${r}" error:`,u),o.context?.strictMode)throw u}finally{c&&D(),l&&o.__ref&&(o.__ref[n]=!1)}}return!0}var Le=J;export{Co as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,oe as acquireBeforeUpdateGuard,J as create,Le as default,to as flushMounts,Pe as isStaticCssProp,Oe as recompileStaticCss,Te as reconcileAttrProp,Wt as releaseBeforeUpdateGuard,lo as resolveStyleBlock,Ht as writeElementText};
6
+ `),u&&(i+=u)}}i&&(r.textContent+=i)}const rs=new Set;function is(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 Tn(t,o,s){const e=is(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=o(t,t.state,t.context)}catch{return}if(is(r)===e)return;const i=t.__ref.path?t.__ref.path.join("."):t.key||"?";rs.has(i)||(rs.add(i),console.warn(`[smbls] subscribeTo function at "${i}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Ln(t){const o=t.subscribeTo,s=typeof o=="function";let e=o;if(s)try{e=o(t,t.state,t.context)}catch{e=null}if(s&&ft()&&Tn(t,o,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const r=t.__ref;for(let i=0;i<e.length;i++){const a=e[i];if(typeof a!="string"||a.length===0)continue;const f=a.split("."),n=f[0],c=f.slice(1),l={value:!1},u=j(()=>{const d=t.state&&(Y(t.state)?t.state.root:null);if(!d||!Y(d))return;let h=d;h=h[n];for(let A=0;A<c.length&&!(h==null||typeof h!="object");A++)if(Y(h))h=h[c[A]];else break;if(!l.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const A=t.context?.designSystem;A&&L(A);try{if(se(r)){const g=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});g&&typeof g.then=="function"?g.then(()=>Wt(r,!1),b=>{Wt(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:b})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",b)}):(Wt(r,!1),g===!1&&(y=!0))}}catch(g){Wt(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{A&&D()}}if(!y&&t.node&&r.__effects)for(let A=0;A<r.__effects.length;A++){const g=r.__effects[A];g&&g!==u&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!y&&typeof t.onUpdate=="function"){const A=t.context?.designSystem;A&&L(A);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&q("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{A&&D()}}},{depth:r.path.length,label:k(r,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,r.__effects.push(u)}}function po(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 ho(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 cs=new Set;function Dn(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",e=s+"::"+t;cs.has(e)||(cs.add(e),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 fs=new Map;function Mn(t){let o=fs.get(t);if(o)return o;o=[];const s=e=>{if(e)for(const r of e)o.push(r.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()))};return s($t[t]),s(ms[t]),fs.set(t,o),o}function as(t,o,s){if(uo(t,o)||s&&s.has(o))return!0;const e=Mn(Q(o));for(let r=0;r<e.length;r++){const i=e[r];if(uo(t,i)||s&&s.has(i))return!0}return!1}function _t(t,o,s,e){const r={},i=new Set,a=(f,n,c)=>{const l=c?new Set(Object.keys(r)):null;if(U[f]){const u=U[f](n,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(r,h)}}else r[f]=n;if(c)for(const u in r)l.has(u)||i.add(u)};for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f))continue;let n=t[f];if(typeof n=="function"&&(n=n(o,o.state,o.context)),!(n==null||typeof n=="function")){if(typeof n=="object"&&!Array.isArray(n)){if(f==="style"){for(const u in n){let d=n[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,as(o,u,e))}continue}if(f==="vars"){const u=Gt(n,o);if(u)for(const d in u)a(d,u[d],uo(o,d)||!!(e&&e.has(d)));continue}if(po(f,o)){const u=_t(n,o,!1,e);Object.keys(u).length&&(r[`[data-theme="${f.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(f)){ft()&&Dn(f,o);continue}const c=ho(f,o),l=_t(n,o,!1,e);Object.keys(l).length&&(r[c]=l);continue}a(f,n,as(o,f,e))}}if(s)for(const f in r)i.add(f);for(const f of i){const n=r[f];typeof n=="string"&&!n.includes("!important")&&(r[f]=n+" !important")}return r}const m=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function us(t,o){for(const s in o){const e=o[s];t[s]=m(e)?us(m(t[s])?t[s]:{},e):e}return t}function Rn(t,o){if(!m(o))return;let s;for(const e of t.split(" ")){const r=e?o[e]:null;m(r)&&(s=us(s||{},r))}return s}function yo(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)&&yo(t[s],o+1))return!0}return!1}function ds(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(po(t,s)){const i=_t(o,s,!1);return Object.keys(i).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:i}:null}const e=ho(t,s),r=_t(o,s,!1);return Object.keys(r).length?{cssProp:e,block:r}:null}function Nn(t){const o=t.__ref;for(const s of Object.keys(t)){if(!so(s))continue;const e=t[s];if(!e||typeof e!="object"||Array.isArray(e)||!yo(e))continue;let r=null,i;const a=j(()=>{if(!t.node)return;const f=t.context?.designSystem;f&&L(f);let n,c=!1;try{const l=ds(s,e,t),u=l?Lt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===i)c=!0;else if(i=u,l){const d=wt({[l.cssProp]:l.block},null,t.context?.cssPrefix);n=d?d.split(" ").filter(Boolean):null}else n=null}finally{f&&D()}if(!(c||!t.node.classList)){if(r)for(const l of r)t.node.classList.remove(l);if(n&&n.length)for(const l of n)t.node.classList.add(l);r=n}},{depth:o.path.length,label:k(o,"cssBlock("+s+")")});o.__effects.push(a)}}const Fn=()=>!0,$n=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!U[t]||!!(V&&V.has(t))||et(t)||t==="vars"};function In(t,o,s){const e={};let r=!1;for(const f in s)Object.prototype.hasOwnProperty.call(s,f)&&(f!=="data"&&f!=="aria"&&($n(f,s[f])||G.has(f))?e[f]=!0:r=!0);if(!r)return null;const i=Xs({[o]:s},t.tag||"div",e,Fn);let a=null;for(const f in i)/^on/i.test(f)||(a||(a={}),a[f]=i[f]);return a}function ls(t,o,s,e,r,i){const a=t.node;let f=null;const n=c=>{(f||(f=[])).push(c)};for(const c in e){const l=o.owners.get(c),u=l===s;if(!i&&l!==void 0&&!u)continue;let d;try{d=e[c](t)}catch(y){M(t.__ref,"conditional("+s+")."+c,y),u&&n(c);continue}if(typeof d=="string"&&d.includes("{{")&&(d=I.call(t,d,t.state)),u&&a.getAttribute(c)!==o.written.get(c)){n(c);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&ps(a,o,c);continue}const h=d===!1&&!at(c)?null:String(K(c,d));n(c),!(u&&h===o.written.get(c))&&(l===void 0&&o.base.set(c,a.getAttribute(c)),h==null?a.removeAttribute(c):a.setAttribute(c,h),o.owners.set(c,s),o.written.set(c,h))}r.appliedAttrs=f}function ps(t,o,s){if(t.getAttribute(s)===o.written.get(s)){const e=o.base.get(s);e==null?t.removeAttribute(s):t.setAttribute(s,e)}o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function Un(t,o,s,e){const r=e.appliedAttrs;if(e.appliedAttrs=null,!!r)for(const i of r)o.owners.get(i)===s&&ps(t.node,o,i)}function _o(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const e of o.owners.keys()){const r=o.written.get(e),i=s.getAttribute(e);i!==r&&(o.base.set(e,i),r==null?s.removeAttribute(e):s.setAttribute(e,r))}}function Hn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const e=new Map;for(const r of Object.keys(t)){const i=r.charAt(0);if(i!=="."&&i!=="!")continue;const a=r.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const g=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${i}\` is read as one prop name. Nest the selector inside instead: \`${i}${g}: { '${a.slice(g.length)}': {...} }\`.`)}continue}const f=t[r];if(!f||typeof f!="object")continue;const n=i==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},l=In(t,r,f);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const g in f){if(!Object.prototype.hasOwnProperty.call(f,g))continue;const b=g.charAt(0),w=f[g];if(!((b===":"||b==="@"||b==="&"||b==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(g==="vars"&&m(w)){for(const p of Object.keys(w))p&&u.add(Bt(p));continue}u.add(g)}}const d=()=>{let g;const b=t[a];if(b===void 0){const _=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(_||x!==void 0)g=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{g=typeof S=="function"?S.call(t,t):S}catch(v){g=!1,o.__conditionalError=v,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,v?.message||v)}}}else if(typeof b=="function")try{g=b(t,t.state,t.context)}catch(_){g=!1,o.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else g=b;const w=n?!g:!!g;if(!t.node)return;const p=t.context?.designSystem;if(w===c.lastMatch){if(w&&l&&t.node.setAttribute){p&&L(p);try{ls(t,s,r,l,c,!1)}finally{p&&D()}}return}c.lastMatch=w,p&&L(p);try{if(w){const _={},x={};let S=!1;for(const C in f){if(!Object.prototype.hasOwnProperty.call(f,C))continue;const N=f[C],tt=C.charAt(0);if((tt===":"||tt==="@"||tt==="&"||tt==="[")&&N&&typeof N=="object"&&!Array.isArray(N)){if(po(C,t)){const P=_t(N,t,!1,u);Object.keys(P).length&&(x[`[data-theme="${C.slice(1)}"] &`]=P,S=!0)}else{const P=ho(C,t),F=_t(N,t,!1,u);Object.keys(F).length&&(x[P]=F,S=!0)}continue}const ot=typeof N=="function"?N(t,t.state,t.context):N;if(ot!=null){if(U[C]){const P=U[C](ot,t,t.state,t.context);if(P){const F=Array.isArray(P)?P:[P];for(const gt of F)gt&&Object.assign(_,gt)}}else if(V&&V.has(C))_[C]=ot;else if(et(C))_[C]=ot;else if(C==="vars"){const P=Gt(ot,t);P&&Object.assign(_,P)}}}const v=Object.keys(_);if(v.length){X(t.node,_);for(const C of v)e.set(C,r);c.appliedKeys=v}else c.appliedKeys=null;if(S){const C=wt(x,null,t.context?.cssPrefix,{state:!0}),N=C?C.split(" ").filter(Boolean):[];if(N.length&&t.node.classList){for(const tt of N)t.node.classList.add(tt);c.appliedClasses=N}else c.appliedClasses=null}else if(c.appliedClasses){for(const C of c.appliedClasses)t.node.classList.remove(C);c.appliedClasses=null}l&&t.node.setAttribute&&ls(t,s,r,l,c,!0)}else{if(c.appliedAttrs&&Un(t,s,r,c),c.appliedKeys){for(const _ of c.appliedKeys)e.get(_)===r&&(et(_)?t.node.style.removeProperty(_):t.node.style[_]="",e.delete(_));c.appliedKeys=null}if(c.appliedClasses){for(const _ of c.appliedClasses)t.node.classList.remove(_);c.appliedClasses=null}}}finally{p&&D()}};o.__conditionalRunners.push(d);const h=T(t,t[a+"Deps"],d),y=j(h,{depth:o.path.length,label:k(o,"conditional("+r+")")}),A=o.__exec&&o.__exec[a]||t[a];y._sources.size===0&&typeof A=="function"&&ft()&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(y)}}const go=new WeakSet,hs=new WeakSet,ys=new WeakSet;function Vn(t){if(ys.has(t))return!1;if(!hs.has(t)){hs.add(t);const o=t.defaultView,s=()=>{ys.add(t)};o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(s):setTimeout(s,0)}return!0}function Bn(t){const o=t.ownerDocument;!o||go.has(o)||Vn(o)||(go.add(o),queueMicrotask(()=>{go.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const bo=new WeakSet;let _s=!1;function gs(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Ao(t,o){const s={...t};for(const e in o){const r=o[e],i=s[e];s[e]=r&&typeof r=="object"&&i&&typeof i=="object"?Ao(i,r):r}return s}function bs(t,o){const s={};for(const e in t){const r=t[e];if(r&&typeof r=="object"){const i=bs(r,o);Object.keys(i).length&&(s[e]=i)}else o.has(e)||(s[e]=r)}return s}function Gn(t,o,s){let e=null;for(const[r,i]of o){const a=Q(r),f=$t[a];if(f)for(let n=0;n<f.length;n++){const c=f[n].replace(/-([a-z])/g,(y,A)=>A.toUpperCase()),l=t[c]!=null?o.get(c):void 0,u=s&&s.get(f[n]),d=l!==void 0&&l>i&&Ro(f[n],t[c],a),h=!d&&u!==void 0&&u>i&&Ro(f[n],void 0,a);if(d||h){d&&delete t[r],e||(e=new Set),e.add(r);break}}}return e}function As(t){const{node:o}=t;if(!o)return;if(_s||(_s=!0,wt({display:"none"})),bo.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}bo.add(t);const s=t.context?.designSystem;s&&L(s),Lo();try{const e={};let r=!1,i=[],a=null,f=null,n=null;const c=t.__ref&&t.__ref.__mergeLayer;let l,u=null,d=null;const h=(p,_)=>{if(_&&typeof _=="object"&&gs(p)){f||(f={});const x=f[p];x&&(_=Ao(x,_)),f[p]=_}else(_===null||typeof _!="object")&&(n||(n=new Set),n.add(p),l!==void 0&&(u||(u=new Map),u.set(p,l)));e[p]=_};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&U.theme){const p=U.theme(t.theme,t,t.state,t.context);if(p){const _=x=>{for(const S in x){const v=x[S];v&&typeof v=="object"&&gs(S)&&(a||(a={}),a[S]=v),e[S]=v}};if(Array.isArray(p))for(const x of p)x&&_(x);else _(p);r=!0}}const y=(p,_)=>{if(p==="vars"){const x=Gt(_);if(x){for(const S in x)h(S,x[S]);r=!0}return}if(U[p]){const x=U[p](_,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const v in S)h(v,S[v])}else for(const S in x)h(S,x[S]);r=!0}}else if(V&&V.has(p))_!=null&&typeof _!="object"&&(h(p,_),r=!0);else if(p.charCodeAt(0)===45)_!=null&&typeof _!="object"&&(h(p,_),r=!0);else if((p.charAt(0)==="&"||p.charAt(0)==="@"||p.charAt(0)===":"||p.charAt(0)==="[")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yo(_))return;const x=ds(p,_,t);x&&(h(x.cssProp,x.block),r=!0)}};if(typeof t.class=="string"){const p=Rn(t.class,t.context?.designSystem?.class);if(p)for(const _ in p)y(_,p[_])}const A=n?new Set(n):null,g=t.tag||"div";for(const p of Object.keys(t)){if(typeof t[p]=="function"){const x=c&&c.get(p);x!==void 0&&st(g,p)&&(d||(d=new Map),d.set(Q(p),x));continue}if(l=c?c.get(p):void 0,p==="vars"){y(p,t[p]);continue}if(G.has(p)||p==="theme")continue;const _=p.charCodeAt(0);_>=65&&_<=90||Z(p)||No(g,p)||y(p,t[p])}l=void 0;const b=u?Gn(e,u,d):null;if(a)for(const p in a){let _=n?bs(a[p],n):a[p];f&&f[p]&&(_=Ao(_,f[p])),Object.keys(_).length?e[p]=_:delete e[p]}if(En(t,e,n,b?new Set([...A||[],...b]):A),r){e.display&&String(e.display).includes("!important")&&(o.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const p=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof p=="string"&&p!==""&&e.display&&e.display!==p&&(e.display=p);const _=wt(e,null,t.context?.cssPrefix);if(i=_?_.split(" ").filter(Boolean):[],_&&o.classList){const x=i;let S=!1;for(const v of x)o.classList.add(v),S||(v.charCodeAt(0)===95&&v.charCodeAt(1)===99||v.charCodeAt(0)===95&&v.indexOf("_c",1)!==-1)&&(S=!0);S&&Bn(o)}}const w=t.__ref;if(w){const p=w.__staticCssClasses;if(p&&o.classList){const _=new Set(i);for(const x of p)_.has(x)||o.classList.remove(x)}w.__staticCssClasses=i}Pn(t)}finally{Do(),s&&D(),bo.delete(t)}}const Oe=t=>!!U[t]||!!(V&&V.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Te(t){t&&t.node&&As(t)}function xs(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const i=t.aria[r];if(typeof i=="function"||typeof i=="object"||i==null||typeof i=="string"&&i.includes("{{"))continue;const a="aria-"+r.replace(/[A-Z]/g,f=>"-"+f.toLowerCase());o.setAttribute(a,K(a,i))}const s=Qs(t);for(const r in s){const i=s[r];i!=null&&i!==!1&&typeof i!="function"&&typeof i!="object"&&o.setAttribute(r,i===!0?"":i)}const e=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.has(r)||r==="on"||s[r]!==void 0)continue;const i=r.charCodeAt(0);if(!(i>=65&&i<=90)&&!Z(r)&&!st(e,r)&&St(e,r)){let a=t[r];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!Jt[r])continue;a=I.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!at(Ct(r)||r))continue;const f=Ct(r)||r;o.setAttribute(f,K(f,a))}}}function Le(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const e=o.charCodeAt(0);if(e>=65&&e<=90||Z(o))return;const r=t.tag||"div";if(st(r,o)||!St(r,o))return;const i=Ct(o)||o,a=i.toLowerCase(),f=t.__ref&&t.__ref.__effects;let n=!1;if(f)for(let u=0;u<f.length;u++){const d=f[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(n=!0,d._execute())}if(n)return;let c=t[o];const l=Jt[o];if(l&&c!=null){const u=l(t);u!==void 0&&(c=u)}typeof c=="string"&&c.includes("{{")&&(c=I.call(t,c,t.state)),c==null||c===!1&&!at(i)?s.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&s.setAttribute(i,K(i,c))}function Kn(t,o){const s=t.node,e=t.__ref;let r=e.__autoGrow;if(!o){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}Ss(r),nt.delete(t),s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),ks(s,r,!1),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=e.__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){Dt(t,!0);return}if(!(s.scrollHeight>0)){r.awaitingLayout=!0,ws(t,r);return}r.awaitingLayout=!1;const a=Yn(s),f=qn(a),n=s.style.height;s.style.height="0px",f&&wo(s);const c=s.scrollHeight;if(!(c>0)){s.style.height=n,f&&wo(s);return}const l=Zn(s,a),u=l!=null&&c<l?l:c,d=Jn(a),h=d!=null&&u>d;s.style.height=Xn(h?d:u,a)+"px",f&&wo(s),ks(s,r,h),r.lastMeasure=c,r.lastWidth=s.clientWidth,ws(t,r)}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}Ss(r),nt.delete(t)})),r.active||(s.addEventListener("input",r.resize),r.active=!0,zn(t,r));const i=typeof o=="object"&&o.max!=null?String(o.max):null;i!==r.appliedMax&&(i==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=i,r.appliedMax=i),r.resize()}function Dt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),nt.add(t),It())}function Wn(){const t=Array.from(nt);nt.clear();for(let o=0;o<t.length;o++){const s=t[o],e=s.node,r=s.__ref?.__autoGrow;if(!(!e||!r||!r.active)){if(!e.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=dt()),r.attachAttempts+=1,r.attachAttempts<=Uo&&dt()-r.firstAttemptAt<Ho&&(nt.add(s),It());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function ws(t,o){if(o.watch)return;const s=t.node;if(!s)return;const e=s.ownerDocument&&s.ownerDocument.defaultView,r=e&&e.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const i=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Dt(t,!0);return}const f=s.clientWidth;o.lastWidth!=null&&Math.abs(f-o.lastWidth)<.5||(o.lastWidth=f,Dt(t,!0))};let a;try{a=new r(i),a.observe(s)}catch{return}o.watch=a}function Ss(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function zn(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,e=s&&s.fonts&&s.fonts.ready;!e||typeof e.then!="function"||e.then(()=>{o.active&&t.node&&Dt(t,!0)},()=>{})}function Yn(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,xo=t=>(rt(t.paddingTop)||0)+(rt(t.paddingBottom)||0),Cs=t=>(rt(t.borderTopWidth)||0)+(rt(t.borderBottomWidth)||0);function qn(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let e=0;e<o.length;e++){const r=o[e].trim();if(!(r!=="all"&&r!=="height")&&parseFloat(s[e%s.length])>0)return!0}return!1}function wo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const e=o[s];if(e&&e.transitionProperty==="height")try{e.cancel()}catch{}}}function Zn(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const e=rt(o.lineHeight)||Qn(t,o);return e>0?s*e+xo(o):null}const Mt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],vs=new WeakMap;function Qn(t,o){const s=t.ownerDocument,e=s&&(s.body||s.documentElement);if(!e||!s.createElement)return null;let r=vs.get(s);r||(r=new Map,vs.set(s,r));const i=Mt.map(c=>o[c]||"").join("|");if(r.has(i))return r.get(i);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const f=a.style;f.position="absolute",f.visibility="hidden",f.top="0",f.left="-9999px",f.height="auto",f.minHeight="0",f.maxHeight="none",f.padding="0",f.border="0",f.boxSizing="content-box",f.overflow="hidden";for(let c=0;c<Mt.length;c++)o[Mt[c]]&&(f[Mt[c]]=o[Mt[c]]);let n=0;try{e.appendChild(a),n=a.clientHeight}catch{n=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return n>0?(r.set(i,n),n):null}function Xn(t,o){return o?o.boxSizing==="border-box"?t+Cs(o):o.boxSizing==="content-box"?Math.max(0,t-xo(o)):t:t}function Jn(t){if(!t)return null;const o=rt(t.maxHeight);if(o==null||!(o>0))return null;const s=xo(t),e=Cs(t),r=t.boxSizing==="border-box"?o-e:o+s,i=rt(t.lineHeight);if(!(i>0))return r;const a=Math.floor((r-s)/i+1e-6);return a>=1?a*i+s:r}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 js=["srcObject","muted"],mn=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function te(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let e=0;e<js.length;e++){const r=js[e],i=t[r];if(i===void 0||!(r in o))continue;const a=f=>{const n=mn(r,f);if(o[r]!==n)try{o[r]=n}catch(c){M(s,r,c)}};if(typeof i=="function"){const f=T(t,t[r+"Deps"],i),n=j(()=>{try{a(f(t,t.state,t.context))}catch(c){M(s,r,c)}},{depth:s.path.length,label:k(s,r)});s.__effects.push(n),s.__exec[r]=i}else a(i);r==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Es(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,e=t.autoGrow,r=typeof e=="function"?T(t,t.autoGrowDeps,e):null,i=j(()=>{const a=t.autoGrow;let f=a;if(typeof a=="function")try{f=(a===e&&r?r:a)(t,t.state,t.context)}catch{f=null}Kn(t,f)},{depth:s.path.length,label:k(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(i),r&&(s.__exec.autoGrow=e)}const Ps=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Os(t,o){for(const s of Object.keys(t)){if(!Z(s)||Ps.has(s))continue;const e=Bs(s);if(e){Vs(e,t,t[s]);continue}let r=t[s],i=null;if(r&&typeof r=="object"&&!Array.isArray(r)&&(i=r,r=i.handler),typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const f=r;r=function(c){return t.call(f,c)}}if(typeof r!="function")continue;const a=rn(s);Us.has(a)||Hs(cn(a),t,r,i)}oe(t)}function oe(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let e=!1;for(const d of Ps){const h=t[d];typeof h=="function"&&(s[d]=h,e=!0)}if(!e)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,i=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,f=0,n=0,c=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,f=h.clientY,n=Date.now(),c=!0)},u=d=>{if(!c)return;c=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const y=h.clientX-a,A=h.clientY-f,g=Date.now()-n;if(g>i)return;const b=Math.abs(y),w=Math.abs(A);if(Math.max(b,w)<r)return;let p;if(b>w*1.2)p=y<0?"left":"right";else if(w>b*1.2)p=A<0?"up":"down";else return;const _="onSwipe"+p.charAt(0).toUpperCase()+p.slice(1),x=s[_],S=s.onSwipe;x&&x.call(t,d,t,t.state,t.context),S&&S.call(t,{direction:p,dx:y,dy:A,dt:g,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function it(t,o){const s={...t};for(const e in o){const r=s[e],i=o[e];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[e]=it(r,i):s[e]=i}return s}function So(t,o,s,e,r){if(!o||!t.node)return;const i=t.childExtends,a=pt(t,"childProps");if(Array.isArray(o)){const f=t.tag==="fragment",n=t.context?.document||globalThis.document,c=f?null:n?.createDocumentFragment();if(!f&&!c)return;const l=t.childProps,u=t.childrenAs,d=w=>{let p=o[w];const _=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let x=l;if(typeof l=="function")try{x=l(t,p)}catch{x=null}let S=typeof l=="function"?Pt(x):a;if(r&&u!=="state"&&(S=Ot(S,Pt(_))),u==="state"){let C=_;(typeof _=="string"||typeof _=="number")&&(C={value:_,text:_}),p=x?{...x,state:C}:{state:C}}else x&&(p=it(x,p));if(i&&!p.ignoreChildExtends)if(p.extends){const C=Array.isArray(p.extends)?p.extends:[p.extends],N=Array.isArray(i)?i:[i];p={...p,extends:[...N,...C]}}else p={...p,extends:i};const v=Bo(p?.key,_,w);try{return J(Tt(p,S),t,v,s)}catch(C){if(typeof console<"u"&&console.error){const N=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to construct at ${N} (initial render, skipping this row):`,C?.message||C)}return null}},h=t.__ref;if(!(e===!0&&!f&&!!h&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const p=d(w);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const A=h.__childrenChunkGen=(h.__childrenChunkGen||0)+1;Po();let g=null;const b=w=>{if(h.__disposed||h.__childrenChunkGen!==A){g&&g.parentNode&&g.remove();return}for(let p=w;p<o.length;p++){const _=d(p);if(_?.node&&(g?t.node.insertBefore(_.node,g):c.appendChild(_.node)),p+1<o.length&&Eo()){g||(g=n.createComment("smbls-mount"),c.appendChild(g),t.node.appendChild(c));const x=p+1;To(()=>b(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&Kt(t,!0)):t.node.appendChild(c)};return b(0),Oo(),!0}if(typeof o=="string"){const f=Ko(o,t);if(Array.isArray(f))return So(t,f,s,e,!0)}if(typeof o=="object")for(const f in o){if(G.has(f))continue;let n=o[f];if(n==null||n===!1)continue;const c=r?Ot(a,Pt(n)):a;if((typeof n=="string"||typeof n=="number")&&(n={text:n}),t.childProps&&(n=it(t.childProps,n)),i&&!n.ignoreChildExtends)if(n.extends){const l=Array.isArray(n.extends)?n.extends:[n.extends],u=Array.isArray(i)?i:[i];n={...n,extends:[...u,...l]}}else n={...n,extends:i};J(Tt(n,c),t,f,s)}}function Kt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const e=s.options;if(!e||!e.length)return;const r=t.__ref,i=r&&r.__exec&&r.__exec.value,a=typeof i=="function",f=t.value!=null&&typeof t.value!="function";if(a||f){let l;if(a)try{l=i(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=I.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const n=o||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!n)return;let c=-1;for(let l=0;l<e.length;l++)e[l].defaultSelected&&(c=l);c>=0&&s.selectedIndex!==c&&(s.selectedIndex=c)}function Ts(t,o){let{children:s,content:e}=t;const r=t.childExtends,i=typeof s=="function"||Yo(t,"children");if(typeof s=="function"){const y=s;try{s=y(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const _=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${_} (initial run, treating as empty):`,p?.message||p)}}qo(t,s),t.children=s;const A=t.__ref;let g=!1;const b=T(t,t.childrenDeps,y),w=j(()=>{const p=g;g=!0;let _;try{_=b(t,t.state,t.context)}catch(P){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${F}${p?"":" (initial tracking run)"}:`,P?.message||P)}return}if(!p||_===t.children)return;qo(t,_),t.children=_,A.__childrenChunkGen!=null&&A.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,v=x?[]:null,C=x?[]:null;if(Array.isArray(_)&&t.childrenAs==="state"){const P=t.childProps,F=[],gt=new Map;for(let E=0;E<_.length;E++){const B=_[E];let O=P;if(typeof P=="function")try{O=P(t,B)}catch{O=null}const z=Bo(O&&O.key,B,E);F.push(z),gt.set(z,{rawChild:B,childProps:O})}const Ds=new Set(F),Ms=A.__children.slice();for(const E of Ms)if(!Ds.has(E)){const B=t[E];B?.remove&&B.remove(),delete t[E],v&&v.push(E)}const bt=t.childExtends,Rt=t.tag==="fragment",Rs=t.context?.document||globalThis.document,At=Rt?null:Rs?.createDocumentFragment(),zt=new Set;for(const E of F){const B=gt.get(E),O=B.rawChild,z=t[E];if(z&&z.state){if(O&&typeof O=="object"){const $=z.state,ct=$.$replace||$.replace,vo=$.$update||$.update;try{if(typeof ct=="function")ct.call($,O);else if(typeof vo=="function"){for(const H in $)if(!(H==="__element"||H==="root"||H==="parent"||H==="update")&&!Object.prototype.hasOwnProperty.call(O,H))try{$[H]=void 0}catch{}vo.call($,O)}else for(const H in O)$[H]=O[H]}catch(H){if(typeof console<"u"&&console.error){const Fs=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to patch at ${Fs} (reconcile, keeping its previous data for this pass):`,H?.message||H)}}}C&&C.push(E);continue}let Yt=O;(typeof O=="string"||typeof O=="number")&&(Yt={value:O,text:O});const qt=B.childProps;let W=qt?{...qt,state:Yt}:{state:Yt};const Ns=typeof P=="function"?Pt(qt):pt(t,"childProps");if(bt&&!W.ignoreChildExtends)if(W.extends){const $=Array.isArray(W.extends)?W.extends:[W.extends],ct=Array.isArray(bt)?bt:[bt];W={...W,extends:[...ct,...$]}}else W={...W,extends:bt};let Zt;try{Zt=J(Tt(W,Ns),t,E,o)}catch($){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):`,$?.message||$)}zt.add(E);continue}!Rt&&Zt?.node&&At&&At.appendChild(Zt.node),S&&S.push(E)}if(!Rt&&At&&At.childNodes.length&&t.node&&t.node.appendChild(At),!Rt&&t.node){let E=null;for(const B of F){const O=t[B]?.node;if(!O)continue;const z=E?E.nextSibling:t.node.firstChild;O!==z&&t.node.insertBefore(O,z),E=O}}A.__children=zt.size?F.filter(E=>!zt.has(E)):F,x&&(S.length||v.length)&&Vo(t,{added:S,removed:v,kept:C}),Kt(t,!1);return}const ot=x?[...A.__children]:null;for(const P of[...A.__children]){const F=t[P];F?.remove&&F.remove(),delete t[P]}A.__children=[],So(t,_,o,!1,!0),Kt(t,!1),x&&Vo(t,{added:[...A.__children],removed:ot,kept:[]})},{depth:A.path.length,label:k(A,"children")});A.__effects.push(w)}const a=So(t,s,o,!0,i);if(e!=null&&!(e&&e.__ref)){let y=e;if(typeof y=="string"||typeof y=="number"?y={text:y}:typeof y!="object"&&(y={}),t.childProps&&(y=it(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],b=Array.isArray(r)?r:[r];y={...y,extends:[...b,...g]}}else y={...y,extends:r};const A=Ot(pt(t,"childProps"),pt(t,"content"));J(Tt(y,A),t,"content",o)}if(s&&!a)return;const f=t.context?.components||{},n=t.__ref&&t.__ref.__runtimeSource,c=n?{}:null;{const y=Object.keys(t);for(let A=0;A<y.length;A++){const g=y[A];if(!g.endsWith("Extends")||typeof t[g]!="string")continue;const b=g.slice(0,-7);if(!b||b.charCodeAt(0)<65||b.charCodeAt(0)>90)continue;const w={extends:t[g]};delete t[g];for(let p=A+1;p<y.length;p++){const _=y[p],x=_.charCodeAt(0);if(x>=65&&x<=90||G.has(_)||typeof t[_]=="function"&&(_.startsWith("on")||_.startsWith(".")))break;const S=t[_];S!==void 0&&(w[_]=S,delete t[_],c&&Et(n,_)&&(c[b]||(c[b]={}),c[b][_]=n[_]))}t[b]&&typeof t[b]=="object"?t[b]={...w,...t[b]}:t[b]=w}}const l=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),d=y=>{if(G.has(y)||typeof t[y]!="object"||t[y]===null)return;const A=y.charCodeAt(0);if(A<65||A>90)return;let g=t[y];if(g.__ref)return;if(!g.extends&&!g.extend){const w=f[y]||f[`smbls.${y}`];w&&(g={...g,extends:w})}if(t.childProps&&(g=it(t.childProps,g)),r&&!g.ignoreChildExtends)if(g.extends){const w=Array.isArray(g.extends)?g.extends:[g.extends],p=Array.isArray(r)?r:[r];g={...g,extends:[...p,...w]}}else g={...g,extends:r};const b=n?Ot(pt(t,"childProps"),Ot(c[y]||null,pt(t,y))):null;J(Tt(g,b),t,y,o)};if(!l){for(const y of u)d(y);return}Po();const h=y=>{for(let A=y;A<u.length;A++)if(d(u[A]),A+1<u.length&&Eo()){const g=A+1;To(()=>h(g));return}};h(0),Oo()}function Ls(t,o,s){const{node:e}=t;if(!e)return;e.ref=t;const r=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(r){const a=r.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const f=s.node.nextSibling;a.insertBefore(e,f||r)}else a.insertBefore(e,r);return}}const i=o?.node||(o?.nodeType?o:null);if(i)if(s?.position==="before"&&s.node)i.insertBefore(e,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?i.insertBefore(e,a):i.appendChild(e)}else i.appendChild(e)}const Co=3;function se(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Co?!1:(t.__inBeforeUpdate=!0,!0)}function Wt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Co&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Co}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function R(t,o,s){const e=t.charAt(0).toLowerCase()+t.slice(1);o.context?.plugins?.length&&q(e,o,s);const r="on"+t,i=o[r];if(typeof i=="function"){const n=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(n){if(o.__ref[n])return!0;o.__ref[n]=!0}const c=o.context?.designSystem;c&&L(c);let l=!!n;try{const u=i(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{o.context?.plugins?.length&&q("error",o,{hook:r,error:h})||console.error(`[DOMQL] Lifecycle "${r}" error:`,h)}).finally(()=>{n&&d&&(d[n]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if(o.context?.plugins?.length&&q("error",o,{hook:r,error:u})||console.error(`[DOMQL] Lifecycle "${r}" error:`,u),o.context?.strictMode)throw u}finally{c&&D(),l&&o.__ref&&(o.__ref[n]=!1)}}return!0}var De=J;export{Co as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,se as acquireBeforeUpdateGuard,J as create,De as default,to as flushMounts,Oe as isStaticCssProp,Te as recompileStaticCss,Le as reconcileAttrProp,Wt as releaseBeforeUpdateGuard,lo as resolveStyleBlock,Ht as writeElementText};
@@ -1 +1 @@
1
- import{create as o,default as r,flushMounts as E}from"./create.js";import{update as d}from"./update.js";import{dispose as p,remove as s}from"./dispose.js";import{REGISTRY as m,LIFECYCLE_EVENTS as n,DELEGATED_EVENTS as x,NON_BUBBLING_EVENTS as g,MIXINS as T}from"./registry.js";import{addDelegatedEvent as N,removeDelegatedEvent as v,registerEvent as S,registerGlobalEvent as u,globalEventKeyInfo as G}from"./delegate.js";import{cacheNode as c,detectTag as L,createHTMLNode as V,isValidTag as _,isSvgTag as h,SVG_TAGS as D}from"./cache.js";import{applyExtends as B}from"./extends.js";import{addMethods as b,refreshContextProto as y}from"./methods.js";import{inertOutsidePlugin as O}from"./inertOutside.js";export{x as DELEGATED_EVENTS,n as LIFECYCLE_EVENTS,T as MIXINS,g as NON_BUBBLING_EVENTS,m as REGISTRY,D as SVG_TAGS,N as addDelegatedEvent,b as addMethods,B as applyExtends,c as cacheNode,o as create,V as createHTMLNode,r as default,L as detectTag,p as dispose,E as flushMounts,G as globalEventKeyInfo,O as inertOutsidePlugin,h as isSvgTag,_ as isValidTag,y as refreshContextProto,S as registerEvent,u as registerGlobalEvent,s as remove,v as removeDelegatedEvent,d as update};
1
+ import{create as o,default as r,flushMounts as a}from"./create.js";import{update as E}from"./update.js";import{dispose as f,remove as n}from"./dispose.js";import{REGISTRY as m,LIFECYCLE_EVENTS as s,DELEGATED_EVENTS as x,NON_BUBBLING_EVENTS as g,MIXINS as i}from"./registry.js";import{addDelegatedEvent as T,removeDelegatedEvent as v,registerEvent as S,registerGlobalEvent as u,globalEventKeyInfo as G}from"./delegate.js";import{cacheNode as c,detectTag as h,createHTMLNode as L,isValidTag as V,isSvgTag as _,SVG_TAGS as D,adoptHydrationNode as M,elementPath as y}from"./cache.js";import{applyExtends as C}from"./extends.js";import{addMethods as b,refreshContextProto as A}from"./methods.js";import{inertOutsidePlugin as O}from"./inertOutside.js";export{x as DELEGATED_EVENTS,s as LIFECYCLE_EVENTS,i as MIXINS,g as NON_BUBBLING_EVENTS,m as REGISTRY,D as SVG_TAGS,T as addDelegatedEvent,b as addMethods,M as adoptHydrationNode,C as applyExtends,c as cacheNode,o as create,L as createHTMLNode,r as default,h as detectTag,f as dispose,y as elementPath,a as flushMounts,G as globalEventKeyInfo,O as inertOutsidePlugin,_ as isSvgTag,V as isValidTag,A as refreshContextProto,S as registerEvent,u as registerGlobalEvent,n as remove,v as removeDelegatedEvent,E as update};
@@ -1 +1 @@
1
- const o="3.14.799";export{o as VERSION};
1
+ const o="3.14.800";export{o as VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/element",
3
- "version": "3.14.799",
3
+ "version": "3.14.800",
4
4
  "description": "Core element creation, update, and disposal engine for smbls v3.14",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -20,7 +20,7 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@symbo.ls/css": "^3.14.774",
23
+ "@symbo.ls/css": "^3.14.775",
24
24
  "@symbo.ls/scratch": "^3.14.786",
25
25
  "@symbo.ls/signal": "^3.14.786",
26
26
  "@symbo.ls/state": "^3.14.681",