@symbo.ls/element 3.14.790 → 3.14.792
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/dist/cjs/src/attributeFirst.js +1 -0
- package/dist/cjs/src/create.js +5 -5
- package/dist/cjs/src/cssLonghands.js +1 -0
- package/dist/cjs/src/delegate.js +1 -1
- package/dist/cjs/src/update.js +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/esm/src/attributeFirst.js +1 -0
- package/dist/esm/src/create.js +5 -5
- package/dist/esm/src/cssLonghands.js +1 -0
- package/dist/esm/src/delegate.js +1 -1
- package/dist/esm/src/update.js +1 -1
- package/dist/esm/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var T=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var E=(o,t)=>{for(var S in t)T(o,S,{get:t[S],enumerable:!0})},m=(o,t,S,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _(t))!a.call(o,r)&&r!==S&&T(o,r,{get:()=>t[r],enumerable:!(e=R(t,r))||e.enumerable});return o};var n=o=>m(T({},"__esModule",{value:!0}),o);var P={};E(P,{ATTRIBUTE_FIRST_KEYS:()=>c,isAttributeFirst:()=>p,isCssProp:()=>I});module.exports=n(P);var i=require("attrs-in-props"),s=require("css-in-props");const c=new Set(["rows","cols","wrap"]),p=(o,t)=>c.has(t)&&(0,i.checkAttributeByTagName)(o,t),I=(o,t)=>!!(s.CSS_PROPS_REGISTRY[t]||s.DEFAULT_CSS_PROPERTIES_LIST&&s.DEFAULT_CSS_PROPERTIES_LIST.has(t))&&!p(o,t);
|
package/dist/cjs/src/create.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`+
|
|
1
|
+
"use strict";var Go=Object.create;var At=Object.defineProperty;var Ho=Object.getOwnPropertyDescriptor;var Vo=Object.getOwnPropertyNames;var Wo=Object.getPrototypeOf,zo=Object.prototype.hasOwnProperty;var Yo=(t,s)=>{for(var o in s)At(t,o,{get:s[o],enumerable:!0})},mt=(t,s,o,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of Vo(s))!zo.call(t,n)&&n!==o&&At(t,n,{get:()=>s[n],enumerable:!(e=Ho(s,n))||e.enumerable});return t};var qo=(t,s,o)=>(o=t!=null?Go(Wo(t)):{},mt(s||!t||!t.__esModule?At(o,"default",{value:t,enumerable:!0}):o,t)),Zo=t=>mt(At({},"__esModule",{value:!0}),t);var Ns={};Yo(Ns,{BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES:()=>Rt,acquireBeforeUpdateGuard:()=>Io,create:()=>Q,default:()=>Ds,flushMounts:()=>Ot,isStaticCssProp:()=>js,recompileStaticCss:()=>Es,reconcileAttrProp:()=>Ts,releaseBeforeUpdateGuard:()=>_t,writeElementText:()=>yt});module.exports=Zo(Ns);var N=require("@symbo.ls/signal"),E=require("@symbo.ls/signal"),ot=require("./cache.js"),K=require("./registry.js"),ct=require("./delegate.js"),No=require("./extends.js"),Mo=require("./methods.js"),Is=require("./dispose.js"),tt=require("./devRuntime.js"),G=require("./mountScheduler.js"),R=require("@symbo.ls/utils"),xt=qo(require("@symbo.ls/utils"),1),W=require("@symbo.ls/utils/function.js"),it=require("@symbo.ls/state"),C=require("css-in-props"),q=require("@symbo.ls/css"),v=require("@symbo.ls/scratch"),w=require("attrs-in-props"),Fo=require("./engineRegistry.js"),Qt=require("./cssLonghands.js"),Z=require("./attributeFirst.js"),$o=require("./version.js");const to=(0,Fo.resolveElementIdEngine)({uniqId:1,scopedStyleId:0},$o.VERSION),ut=[],J=new Set;let Ft=!1,oo=0,et=null,lt=null;function nt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function so(){return typeof document<"u"&&document.visibilityState==="hidden"}const Qo=250,Xo=1e3;function Jo(){return lt&&(lt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||so())?!0:nt()-oo>=Xo}function mo(){if(Ft=!0,oo=nt(),lt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ot,0);et=t?()=>t(s):null;return}if(so()){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ot,Qo);et=t?()=>t(s):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;lt=requestAnimationFrame;const s=requestAnimationFrame(Ot);et=t?()=>t(s):null}}function Ct(){if(Ft){if(!Jo())return;const t=et;if(et=null,t)try{t()}catch{}}mo()}const eo=300,no=15e4;function Ot(){if(Ft=!1,et=null,lt=null,J.size&&Ls(),!ut.length)return;const t=ut.splice(0,ut.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.node){if(!o.node.isConnected){const e=o.__ref||(o.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=nt());const n=nt()-e.__mountFirstAttemptAt;e.__mountAttempts<=eo&&n<no?(ut.push(o),Ct()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",n,"ms \u2014 node never connected:",o.key||o.tag||o);continue}$("Mounted",o,o.__ref?.__mountOptions||{})}}}function $t(t,s){const o=t.__ref?.__autoGrow;o&&o.active&&qt(t,!0),typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,ut.push(t),Ct())}function ro(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&(0,W.runPluginHook)("contentUpdate",t,s);const o=t.context?.designSystem;o&&(0,v.pushConfig)(o);try{t.onContentUpdate(t,t.state,t.context,s)}catch(e){if(t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{o&&(0,v.popConfig)()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function ts(t){return t.charAt(2).toLowerCase()+t.slice(3)}function os(t){return t.toLowerCase()}function It(t){const s=t.charCodeAt(0);return s===58||s===64||s===38||s===91}function dt(t,s){const o={...t};for(const e in s){const n=o[e],c=s[e];n&&c&&typeof n=="object"&&typeof c=="object"&&!Array.isArray(n)&&!Array.isArray(c)&&typeof n!="function"&&typeof c!="function"?o[e]=dt(n,c):o[e]=c}return o}function St(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function io(t,s,o){return St(t)||(s&&typeof s=="object"?St(s.key):void 0)||String(o)}function Q(t,s,o,e={},n){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),o=St(o);const c=St(t.key),r=Object.create(null);r.key=o||c||`_${to.uniqId++}`,r.parent=s||null,r.context=t.context||s?.context||e.context||{},r.context.__create||(r.context.__create=Q);const d=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||r,path:s?.__ref?.path?[...s.__ref.path,r.key]:[r.key],origin:t};if(o&&!t.extends&&!t.extend){const u=o.indexOf("_"),l=o.indexOf(".");let b=u>0?u:-1;if(l>0&&(b<0||l<b)&&(b=l),b>0){const A=o.substring(0,b),k=r.context?.components;k&&(k[A]||k["smbls."+A])?t={...t,extends:A}:k&&(0,tt.isLoudDevRuntime)()&&(/^[A-Z]\w*_\d+$/.test(o)||/^[A-Z]\w*\.\w+$/.test(o))&&console.warn(`[smbls] auto-extend: key "${o}" looks like an instance of "${A}" but neither "${A}" nor "smbls.${A}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}(0,No.applyExtends)(r,t,e);const i=new Set(["childProps","attr","style","scope","data"]),g=r.props&&typeof r.props=="object"?r.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;if(u==="key"){c&&(r.key=c);continue}const l=t[u],b=r[u],A=b&&l&&typeof b=="object"&&typeof l=="object"&&!Array.isArray(b)&&!Array.isArray(l)&&typeof b!="function"&&typeof l!="function";A&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?r[u]=dt(b,l):A&&i.has(u)?r[u]={...b,...l}:A&&It(u)?r[u]=dt(b,l):r[u]=l}function _(u){for(const l in u){const b=u[l],A=r[l],k=A&&b&&typeof A=="object"&&typeof b=="object"&&!Array.isArray(A)&&!Array.isArray(b)&&typeof A!="function"&&typeof b!="function";k&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?r[l]=dt(A,b):k&&i.has(l)?r[l]={...A,...b}:k&&It(l)?r[l]=dt(A,b):r[l]=b}}g&&_(g),t.props&&typeof t.props=="object"&&_(t.props),t.classlist!==void 0&&(r.classlist=t.classlist),t.text!==void 0&&(r.text=t.text),t.html!==void 0&&(r.html=t.html);const f=r.scope&&typeof r.scope=="object"?r.scope:null,p=s?.scope,y=r.context&&typeof r.context.globalScope=="object"&&r.context.globalScope||null,a=p||y||null;if(t.scope!==void 0||f){const u={};f&&Object.assign(u,f),t.scope!==void 0&&Object.assign(u,t.scope),r.scope=(0,N.createScopeStore)(u,a)}else a&&(r.scope=a);if(t.if!==void 0&&(r.if=t.if),(0,Mo.addMethods)(r),ss(r,s,t),r.if!=null){let u;if(typeof r.if=="function")try{u=r.if(r,r.state,r.context)}catch(l){if(u=!1,d.__ifError=l,typeof console<"u"&&console.warn){const b=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${b} \u2014 treating as false:`,l?.message||l)}}else u=r.if;d.__if=!!u}if(d.__if)typeof r.if=="function"&&(d.__ifInitialized=!0);else return s&&(s[r.key]=r),typeof r.if=="function"&&ho(r,d,r.if),r;r.tag||(r.tag=(0,ot.detectTag)(r)),$("Init",r,e);const h=r.node=(0,ot.cacheNode)(r);if(!h)return r;if(r.tag==="fragment"){const l=(r.context?.document||globalThis.document).createComment("");h.appendChild(l),d.__fragmentAnchor=l}$("AttachNode",r,e),h.setAttribute&&r.key&&h.setAttribute("data-key",r.key),s&&(s[r.key]=r,s.__ref?.__children&&(s.__ref.__children.includes(r.key)||s.__ref.__children.push(r.key))),h.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&h.setAttribute("data-smbls-app",r.context.key),r.id&&h.setAttribute&&(h.id=r.id),Oo(r,e),lo(r),Bt(r),To(r),Po(r);try{Ro(r,e)}catch(u){if(typeof console<"u"&&console.error){const l=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${l}:`,u?.message||u,u?.stack?`
|
|
2
|
+
`+u.stack.split(`
|
|
3
3
|
`).slice(0,6).join(`
|
|
4
|
-
`):"")}}if(Ct(n,!0),Co(n,s,e),typeof n.html=="function"&&n.node&&!n.node.innerHTML){const p=n.context?.designSystem;p&&(0,v.pushConfig)(p);try{const y=n.html(n,n.state,n.context);y!=null&&typeof y!="function"&&(n.node.innerHTML=y)}catch{}finally{p&&(0,v.popConfig)()}}if(F("Create",n,r),F("Complete",n,r),F("Render",n,r),F("RenderRouter",n,r),Ot(n,r),typeof n.onFrame=="function"){const p=n.onFrame,y=n.context?.designSystem,_=()=>{if(n.node){if(n.node.isConnected){y&&(0,v.pushConfig)(y);try{p(n,n.state,n.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{y&&(0,v.popConfig)()}}requestAnimationFrame(_)}};requestAnimationFrame(_)}return n}function zo(t,s,o){const r=!s,e=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=r&&e&&t.context?.state,n=o.state!==void 0&&!c?o.state:t.state&&!(0,R.isStore)(t.state)?t.state:void 0;if(n==null){if(s?.state)t.state=s.state,(0,st.applyStateMethods)(t,t.state);else if(t.context?.state){const i=t.context.state,d={...i},g=t.context?.polyglot;if(g?.translations){const a=t.context,f=i.lang||g.defaultLang||"en",l=new Set,u=(p,y)=>{l.has(p)||(0,O.isPolyglotWritableKey)(a,p,d)&&(d[p]=y,l.add(p),(0,O.markPolyglotSeeded)(a,p))},h=g.translations[f];if(h&&typeof h=="object")for(const p in h)u(p,h[p]);const b=new Set(g.languages||[]);for(const p in g.translations)b.has(p)||u(p,g.translations[p])}t.state=(0,R.isStore)(d)?d:(0,R.createStore)(d),t.state.__element=t,t.state.root=t.state,(0,st.applyStateMethods)(t,t.state),yt.promoteActiveRootState?.(i,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,st.applyStateMethods)(t,t.state);return}if(typeof n=="string"){if(t.state=mt(n,s),t.state&&typeof t.state=="object"&&!(0,R.isStore)(t.state)){const i=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}(0,st.applyStateMethods)(t,t.state);return}if(typeof n=="function"){const i=n(t,s?.state);t.state=(0,R.isStore)(i)?i:(0,R.createStore)(i||{})}else(0,R.isStore)(n)?t.state=n:t.state=(0,R.createStore)({...n});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,st.applyStateMethods)(t,t.state),yt.promoteActiveRootState?.(n,t.state)}function Nt(t,s){if(!s)return t;const o=s.split("/");let r=t;for(const e of o){if(r==null)return{};r=r[e]}return r??{}}function mt(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const e=t.slice(3);return e?Nt(s.state,e):s.state??{}}if(t.startsWith("~/")){const e=s.state?.root||s.state,c=t.slice(2);return c?Nt(e,c):e??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Nt(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const r=s.context?.polyglot;if(r?.translations){const e=s.state?.root?.lang||r.defaultLang||"en",c=r.translations[e];if(c?.[t]!==void 0)return c[t];if(r.translations[t]!==void 0)return r.translations[t]}return{}}const Yo=new Set(["s","state","ctx","context"]);function Zo(t){try{const o=(typeof yt.getFunctionSource=="function"?yt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(r=>r.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function qo(t){if(typeof t!="function"||t.length!==2)return!1;const s=Zo(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!Yo.has(o)}function Qo(t){const s=t.__ref,o=t.tag||"div",r=t.context?.designSystem,e=[],c=Object.keys(t);for(let n=0;n<c.length;n++){const i=c[n];if(typeof t[i]!="function"||B.REGISTRY.has(i))continue;const d=i.charCodeAt(0);d>=65&&d<=90||z(i)||A.CSS_PROPS_REGISTRY[i]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i)||(0,C.checkAttributeByTagName)(o,i)||((0,J.isLoudDevRuntime)()&&qo(t[i])&&console.warn(`[smbls] custom prop "${i}"${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('${i}', \u2026) instead of reading el.${i}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:i,fn:t[i]}))}for(let n=0;n<e.length;n++){const{prop:i,fn:d}=e[n];s.__exec[i]=d,Object.defineProperty(t,i,{get(){r&&(0,v.pushConfig)(r);try{return d(t,t.state,t.context)}catch{return}finally{r&&(0,v.popConfig)()}},set(g){delete s.__exec[i],Object.defineProperty(t,i,{value:g,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Xo(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const r=s[o];try{typeof r=="function"?r(t,t.state,t.context):typeof r=="string"&&t.state?.[r]}catch{}}}function N(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...r){return Xo(t,s),o.apply(this,r)}}function at(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function j(t,s){return()=>t.path.join(".")+"::"+s}const to=new Set;function I(t,s,o){if(!(0,J.isLoudDevRuntime)())return;const r=j(t,s)();to.has(r)||(to.add(r),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const oo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,Jo=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;oo.lastIndex=0;let r;for(;(r=oo.exec(o))!==null;)r[2].includes("{{")&&s.add(r[2])},mo=t=>!z(t)&&!A.CSS_PROPS_REGISTRY[t]&&!(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(t)),so=(t,s,o)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&mo(t)&&Jo(s,o)},ts=["attr","aria","data"],os=t=>{if(ts.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},ss=t=>{const s=new Set;for(const o of Object.keys(t)){const r=Object.getOwnPropertyDescriptor(t,o),e=r&&r.value;if(e&&typeof e=="object"&&!Array.isArray(e)){if(!os(o))continue;for(const c in e)so(c,e[c],s);continue}so(o,e,s)}return s};function eo(t,s){const o=t.__ref,r=!!(s&&s.skipIfEffect),e=ss(t);if(o.__authoredTemplates)for(const i of e)o.__authoredTemplates.add(i);else o.__authoredTemplates=e;if(Qo(t),typeof t.text=="function"){const i=t.text,d=N(t,t.textDeps,i),g=(0,E.createEffect)(()=>{if(!o.contentManaged)try{let a=d(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=O.replaceLiteralsWithObjectFields.call(t,a,t.state)),dt(t,a))}catch(a){I(o,"text",a)}},{depth:o.path.length,label:j(o,"text")});o.__effects.push(g),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,d=(0,E.createEffect)(()=>{if(o.contentManaged)return;const g=O.replaceLiteralsWithObjectFields.call(t,i,t.state);g!=null&&(t.text=g),t.node&&dt(t,g??"")},{depth:o.path.length,label:j(o,"text")});o.__effects.push(d),o.__exec.text=i}for(const i of Object.keys(t))if(typeof t[i]=="function"&&!B.REGISTRY.has(i)&&!z(i)&&!o.__exec[i]){if(A.CSS_PROPS_REGISTRY[i]){const d=t[i],g=N(t,t[i+"Deps"],d),a=i;let f,l=null,u=null,h;const b=(0,E.createEffect)(()=>{const p=t.context?.designSystem;p&&(0,v.pushConfig)(p);try{const y=g(t,t.state,t.context);(0,A.pushStaticCssPass)();let _;try{_=A.CSS_PROPS_REGISTRY[a](y,t,t.state,t.context)}finally{(0,A.popStaticCssPass)()}if(Array.isArray(_)){const k={};for(const w of _)if(w)for(const S in w)k[S]=w[S];_=k}const x=a==="show"||a==="hide";if(_&&t.node&&es(_)){const k=_t(_);if(k===null||k!==h){h=k;const w=(0,Y.css)(_,null,t.context?.cssPrefix),S=w?w.split(" ").filter(Boolean):null;if(t.node.classList){if(u)for(const D of u)t.node.classList.remove(D);if(S&&S.length)for(const D of S)t.node.classList.add(D);u=S}}f=void 0,l=null}else if(_&&t.node){if(u){for(const w of u)t.node.classList.remove(w);u=null,h=void 0}const k=_t(_);if(k===null||k!==f||!At(t.node,l)){f=k;const w=uo(t,_);l=bt(t.node,w)}}else if(t.node&&x){f=void 0,l=null;const k=o.__explicitDisplay;t.node.style.display=typeof k=="string"?k:""}}finally{p&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,a)});o.__effects.push(b),o.__exec[i]=d}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i)){const d=t[i],g=N(t,t[i+"Deps"],d),a=i;let f,l=null;const u=(0,E.createEffect)(()=>{const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{const b=g(t,t.state,t.context);if(t.node)if(b!=null){const p=a+":"+String(b);if(p!==f||!At(t.node,l)){f=p;const y={[a]:b},_=uo(t,y);l=bt(t.node,_)}}else f=void 0,l=null,t.node.style[a]=""}finally{h&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,a)});o.__effects.push(u),o.__exec[i]=d}}if(typeof t.html=="function"){const i=t.html,d=N(t,t.htmlDeps,i),g=(0,E.createEffect)(()=>{const a=t.context?.designSystem;a&&(0,v.pushConfig)(a);try{const f=d(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&(t.node.innerHTML=f)}finally{a&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,"html")});o.__effects.push(g),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,d=N(t,t.valueDeps,i),g=(0,E.createEffect)(()=>{try{let a=d(t,t.state,t.context);typeof a=="string"&&a.includes("{{")&&(a=O.replaceLiteralsWithObjectFields.call(t,a,t.state)),io(t,a)}catch(a){I(o,"value",a)}},{depth:o.path.length,label:j(o,"value")});o.__effects.push(g),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,d=(0,E.createEffect)(()=>{try{io(t,O.replaceLiteralsWithObjectFields.call(t,i,t.state))}catch(g){I(o,"value",g)}},{depth:o.path.length,label:j(o,"value")});o.__effects.push(d),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,d=N(t,t.styleDeps,i);let g,a=null;const f=(0,E.createEffect)(()=>{const l=d(t,t.state,t.context),u=_t(l);(u===null||u!==g||!At(t.node,a))&&(g=u,ns(t.node,a,l),X(t.node,l),a=bt(t.node,l))},{depth:o.path.length,label:j(o,"style")});o.__effects.push(f),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const d=t.style[i];if(typeof d!="function")continue;const g=N(t,at(t.styleDeps,i),d);let a,f=null;const l=(0,E.createEffect)(()=>{try{const u=g(t,t.state,t.context);if(t.node){const h=i+":"+String(u);if(h!==a||!At(t.node,f)){a=h;const b={[i]:u};X(t.node,b),f=bt(t.node,b)}}}catch(u){I(o,"style."+i,u)}},{depth:o.path.length,label:j(o,"style."+i)});o.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const d=N(t,at(t.attrDeps,i),t.attr[i]),g=i,a=(0,E.createEffect)(()=>{try{let f=d(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=O.replaceLiteralsWithObjectFields.call(t,f,t.state)),t.node?.setAttribute&&(f==null||f===!1&&!(0,C.isEnumeratedTrueFalseAttr)(g)?t.node.removeAttribute(g):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(g,(0,C.serializeAttrValue)(g,f)))}catch(f){I(o,"attr."+g,f)}},{depth:o.path.length,label:j(o,"attr."+g)});a._attrName=g.toLowerCase(),o.__effects.push(a)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const d=t.attr[i],g=i,a=(0,E.createEffect)(()=>{try{const f=O.replaceLiteralsWithObjectFields.call(t,d,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,(0,C.serializeAttrValue)(g,f??""))}catch(f){I(o,"attr."+g,f)}},{depth:o.path.length,label:j(o,"attr."+g)});a._attrName=g.toLowerCase(),o.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const d=t.aria[i];if(typeof d=="string"&&d.includes("{{")){const l=d,u="aria-"+i.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),h=(0,E.createEffect)(()=>{try{const b=O.replaceLiteralsWithObjectFields.call(t,l,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,(0,C.serializeAttrValue)(u,b??""))}catch(b){I(o,"aria."+i,b)}},{depth:o.path.length,label:j(o,"aria."+i)});h._attrName=u,o.__effects.push(h);continue}if(typeof d!="function")continue;const g=N(t,at(t.ariaDeps,i),t.aria[i]),a="aria-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),f=(0,E.createEffect)(()=>{try{const l=g(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null?t.node.removeAttribute(a):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(a,(0,C.serializeAttrValue)(a,l))}catch(l){I(o,"aria."+i,l)}},{depth:o.path.length,label:j(o,"aria."+i)});f._attrName=a,o.__effects.push(f)}if(t.data&&typeof t.data=="object")for(const i in t.data){const d=t.data[i];if(typeof d=="string"&&d.includes("{{")){const u=d,h="data-"+i.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),b=(0,E.createEffect)(()=>{try{const p=O.replaceLiteralsWithObjectFields.call(t,u,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(h,p??"")}catch(p){I(o,"data."+i,p)}},{depth:o.path.length,label:j(o,"data."+i)});b._attrName=h,o.__effects.push(b);continue}if(typeof d!="function")continue;const g=N(t,at(t.dataDeps,i),t.data[i]),f="data-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),l=(0,E.createEffect)(()=>{try{const u=g(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(f):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(f,u===!0?"":u)}catch(u){I(o,"data."+i,u)}},{depth:o.path.length,label:j(o,"data."+i)});l._attrName=f,o.__effects.push(l)}const c=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(c)for(const i in c){if(typeof c[i]!="function")continue;const d=N(t,at(t.classDeps,i),c[i]),g=(0,E.createEffect)(()=>{try{const a=d(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(i):t.node.classList.remove(i)}catch(a){I(o,"class."+i,a)}},{depth:o.path.length,label:j(o,"class."+i)});o.__effects.push(g)}!r&&typeof t.if=="function"&&ro(t,o,t.if);for(const i of Object.keys(t)){if(B.REGISTRY.has(i)||typeof t[i]!="function")continue;const d=i.charCodeAt(0);if(d>=65&&d<=90||z(i))continue;const g=t[i];o.__exec[i]=g;const a=t.tag||"div";if((0,C.checkAttributeByTagName)(a,i)&&!A.CSS_PROPS_REGISTRY[i]&&!(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i))){const f=(0,C.camelToAttr)(i)||i,l=N(t,t[i+"Deps"],g),u=(0,E.createEffect)(()=>{try{let h=l(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=O.replaceLiteralsWithObjectFields.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!(0,C.isEnumeratedTrueFalseAttr)(f)?t.node.removeAttribute(f):typeof h!="function"&&typeof h!="object"&&(f==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(f,(0,C.serializeAttrValue)(f,h))))}catch(h){I(o,i,h)}},{depth:o.path.length,label:j(o,i)});u._attrName=f.toLowerCase(),o.__effects.push(u)}}const n=t.tag||"div";for(const i of Object.keys(t)){if(B.REGISTRY.has(i))continue;const d=t[i];if(typeof d!="string"||!d.includes("{{"))continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||z(i)||A.CSS_PROPS_REGISTRY[i]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i)||C.ATTR_TRANSFORMS[i]||!(0,C.checkAttributeByTagName)(n,i))continue;const a=(0,C.camelToAttr)(i)||i,f=(0,E.createEffect)(()=>{try{const l=O.replaceLiteralsWithObjectFields.call(t,d,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,(0,C.serializeAttrValue)(a,l??""))}catch(l){I(o,i,l)}},{depth:o.path.length,label:j(o,i)});f._attrName=a.toLowerCase(),o.__effects.push(f)}if(ls(t),hs(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,d=t.stateDeps;let g=!1,a=[];const f=(0,E.createEffect)(()=>{const l=[];for(let p=0;p<d.length;p++){const y=d[p];try{l[p]=typeof y=="function"?y(t,t.state,t.context):t.state?.[y]}catch{l[p]=void 0}}if(!g){g=!0,a=l;return}let u=l.length!==a.length;for(let p=0;!u&&p<l.length;p++)l[p]!==a[p]&&(u=!0);const h=a;if(a=l,!u)return;const b=t.context?.designSystem;b&&(0,v.pushConfig)(b);try{i(t,t.state,t.context,{prev:h,next:l})}catch(p){if(t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onStateUpdate",error:p})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',p),t.context?.strictMode)throw p}finally{b&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,"onStateUpdate")});o.__effects.push(f)}ps(t)}function no(t){const s=t.parent,o=s?.node;if(!o||!t.node){Co(t,t.parent);return}let r=null;const e=Object.keys(s),c=e.indexOf(t.key);for(let n=c+1;n<e.length;n++){const i=s[e[n]];if(i?.node?.parentNode===o){r=i.node;break}}r?o.insertBefore(t.node,r):o.appendChild(t.node)}function ro(t,s,o){const r=N(t,t.ifDeps,o),e=(0,E.createEffect)(()=>{let c;try{c=r(t,t.state,t.context)}catch(i){if(c=!1,s.__ifError=i,typeof console<"u"&&console.warn){const d=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${d} \u2014 treating as false:`,i?.message||i)}return}const n=s.__if;if(s.__if=!!c,n&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(i){console.error("[smbls] onRemove error:",i)}}else if(!n&&s.__if)if(s.__ifInitialized)t.node||(t.node=(0,m.cacheNode)(t)),t.node&&(t.node.ref=t),no(t),Rt(t),F("Render",t,{}),Ot(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,m.detectTag)(t)),F("Init",t,{}),t.node||(t.node=(0,m.cacheNode)(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const d=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(d),s.__fragmentAnchor=d}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),wo(t,{}),eo(t,{skipIfEffect:!0}),Rt(t),Ao(t),So(t,{}),no(t),F("Create",t,{}),F("Complete",t,{}),F("Render",t,{}),F("RenderRouter",t,{}),Ot(t,{})}},{depth:s.path.length,label:j(s,"if")});s.__effects.push(e)}function dt(t,s){const o=t.node;if(!o)return;const r=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==r&&(o.nodeValue=r);return}const e=t.__ref;let c=e?e.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const n=o.firstChild;n&&n.nodeType===3&&(c=n)}c?c.nodeValue!==r&&(c.nodeValue=r):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(r),o.insertBefore(c,o.firstChild)):(o.textContent=r,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),e&&(e.__textNode=c||null)}function io(t,s){const o=t.node;if(!o||!("value"in o))return;const r=s==null?"":String(s);if(o.value===r)return;const e=typeof document<"u"&&document.activeElement===o,c=e&&typeof o.selectionStart=="number"?o.selectionStart:null,n=e&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=r,e&&c!=null&&n!=null)try{o.setSelectionRange(c,n)}catch{}}function Rt(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&dt(t,t.text),gs(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const r in t.style)if(typeof t.style[r]=="function"){o={};for(const e in t.style)typeof t.style[e]!="function"&&(o[e]=t.style[e]);break}X(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const r=t.attr[o];typeof r=="function"||typeof r=="object"||r!=null&&(typeof r=="string"&&r.includes("{{")||r===!1&&!(0,C.isEnumeratedTrueFalseAttr)(o)||s.setAttribute&&s.setAttribute(o,(0,C.serializeAttrValue)(o,r)))}if(t.data&&typeof t.data=="object")for(const o in t.data){const r=t.data[o];typeof r=="function"||typeof r=="object"||r==null||r===!1||typeof r=="string"&&r.includes("{{")||s.dataset&&(s.dataset[o]=r===!0?"":r)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(r=>r&&s.classList.add(r));else if(typeof o=="object")for(const r in o){const e=typeof o[r]=="function"?o[r](t,t.state,t.context):o[r];e&&s.classList.add(typeof e=="string"?e:r)}}}}function _t(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function es(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function bt(t,s){if(!t||!t.style||!s)return null;const o=t.style,r=[];for(const e in s){if(s[e]==null||e.charAt(0)==="&")continue;const n=xt(e);r.push(n,Mt(o,n),co(o,n))}return r}function Mt(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function co(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function xt(t){return kt(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function ns(t,s,o){if(!t||!t.style||!s||!s.length)return;const r=t.style,e=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||e.add(xt(c));for(let c=0;c<s.length;c+=3){const n=s[c];e.has(n)||Mt(r,n)===s[c+1]&&typeof r.removeProperty=="function"&&r.removeProperty(n)}}function At(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let r=0;r<s.length;r+=3)if(Mt(o,s[r])!==s[r+1]||co(o,s[r])!==s[r+2])return!1;return!0}const kt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,wt=t=>[t+"-top",t+"-right",t+"-bottom",t+"-left",t+"-block",t+"-block-start",t+"-block-end",t+"-inline",t+"-inline-start",t+"-inline-end"],St=["top","right","bottom","left","block","block-start","block-end","inline","inline-start","inline-end"],rs=(()=>{const t=["border-width","border-style","border-color","border-image"];for(const s of St)t.push("border-"+s),t.push("border-"+s+"-width","border-"+s+"-style","border-"+s+"-color");return t})(),ao={animation:["animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-timeline","animation-range","animation-range-start","animation-range-end"],background:["background-image","background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-color"],border:rs,"border-width":St.map(t=>"border-"+t+"-width"),"border-style":St.map(t=>"border-"+t+"-style"),"border-color":St.map(t=>"border-"+t+"-color"),"border-top":["border-top-width","border-top-style","border-top-color"],"border-right":["border-right-width","border-right-style","border-right-color"],"border-bottom":["border-bottom-width","border-bottom-style","border-bottom-color"],"border-left":["border-left-width","border-left-style","border-left-color"],"border-block":["border-block-width","border-block-style","border-block-color","border-block-start","border-block-end","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end-width","border-block-end-style","border-block-end-color"],"border-inline":["border-inline-width","border-inline-style","border-inline-color","border-inline-start","border-inline-end","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end-width","border-inline-end-style","border-inline-end-color"],"border-image":["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],"border-radius":["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-start-start-radius","border-start-end-radius","border-end-start-radius","border-end-end-radius"],columns:["column-width","column-count"],"column-rule":["column-rule-width","column-rule-style","column-rule-color"],container:["container-name","container-type"],"contain-intrinsic-size":["contain-intrinsic-width","contain-intrinsic-height"],flex:["flex-grow","flex-shrink","flex-basis"],"flex-flow":["flex-direction","flex-wrap"],font:["font-style","font-variant","font-weight","font-stretch","font-size","line-height","font-family","font-size-adjust","font-kerning","font-feature-settings","font-variation-settings","font-optical-sizing"],gap:["row-gap","column-gap"],grid:["grid-template","grid-template-rows","grid-template-columns","grid-template-areas","grid-auto-rows","grid-auto-columns","grid-auto-flow"],"grid-template":["grid-template-rows","grid-template-columns","grid-template-areas"],"grid-area":["grid-row","grid-column","grid-row-start","grid-row-end","grid-column-start","grid-column-end"],"grid-row":["grid-row-start","grid-row-end"],"grid-column":["grid-column-start","grid-column-end"],inset:["top","right","bottom","left","inset-block","inset-block-start","inset-block-end","inset-inline","inset-inline-start","inset-inline-end"],"inset-block":["inset-block-start","inset-block-end"],"inset-inline":["inset-inline-start","inset-inline-end"],"list-style":["list-style-type","list-style-position","list-style-image"],margin:wt("margin"),"margin-block":["margin-block-start","margin-block-end"],"margin-inline":["margin-inline-start","margin-inline-end"],mask:["mask-image","mask-mode","mask-repeat","mask-position","mask-clip","mask-origin","mask-size","mask-composite"],offset:["offset-position","offset-path","offset-distance","offset-rotate","offset-anchor"],outline:["outline-width","outline-style","outline-color"],overflow:["overflow-x","overflow-y"],"overscroll-behavior":["overscroll-behavior-x","overscroll-behavior-y"],padding:wt("padding"),"padding-block":["padding-block-start","padding-block-end"],"padding-inline":["padding-inline-start","padding-inline-end"],"place-content":["align-content","justify-content"],"place-items":["align-items","justify-items"],"place-self":["align-self","justify-self"],"scroll-margin":wt("scroll-margin"),"scroll-padding":wt("scroll-padding"),"text-decoration":["text-decoration-line","text-decoration-style","text-decoration-color","text-decoration-thickness"],"text-emphasis":["text-emphasis-style","text-emphasis-color"],transition:["transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior"]},fo=(()=>{const t={};for(const s in ao)for(const o of ao[s]){const r=t[o];r?r.push(s):t[o]=[s]}return t})();function is(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(xt(o)));return s}function cs(t,s,o,r){const e=t.__ref;if(!e)return;let c=null;if(o)for(const n of o){if(r&&r.has(n))continue;const i=s[n];if(i==null||typeof i=="object")continue;const d=xt(n);fo[d]&&(c||(c={}),c[d]=i)}e.__declaredLonghands=c}function lo(t,s){const o=t.__ref,r=o&&o.__declaredLonghands;if(!r||!s)return null;let e=null;for(const c in r){if(s.has(c))continue;const n=fo[c];let i=!1;for(let d=0;d<n.length;d++)if(s.has(n[d])){i=!0;break}i&&(e||(e={}),e[c]=r[c])}return e}function uo(t,s){const o=t.node;X(o,s);const r=is(s);if(!r)return s;const e=t.__ref;if(e)if(e.__inlineCssKeys)for(const n of r)e.__inlineCssKeys.add(n);else e.__inlineCssKeys=new Set(r);const c=lo(t,r);return c?(X(o,c),Object.assign({},s,c)):s}function as(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=lo(t,s.__inlineCssKeys);o&&X(t.node,o)}function X(t,s){if(!t||!s||!t.style)return;let o=null;for(const r in s){const e=s[r];if(e!=null){if(r.charAt(0)==="&"&&typeof e=="object"){o||(o={}),o[r]=e;continue}try{const c=String(e),n=kt(r)?r:r.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),i=c.trim(),d=/\s*!important\s*$/.test(i),g=i.replace(/\s*!important\s*$/,"");t.style.setProperty(n,g,d?"important":"")}catch{}}}o&&fs(t,o)}function fs(t,s){const o=`_ds${Zt.scopedStyleId++}`;t.classList.add(o);const r=t.ownerDocument;let e=r.querySelector("style[data-smbls-scoped]");e||(e=r.createElement("style"),e.setAttribute("data-smbls-scoped",""),r.head.appendChild(e));let c="";for(const n in s){const i="."+o,d=n.replace(/&/g,i).split(",").map(a=>{const f=a.trim();return f.includes(i)?f:i+f}).join(", "),g=s[n];if(typeof g=="object"){let a="",f="";for(const l in g){const u=g[l];if(typeof u=="object"){const h=l.includes("&")?d.split(", ").map(p=>l.replace(/&/g,p)).join(", "):d.split(", ").map(p=>`${p} ${l}`).join(", ");let b="";for(const p in u)b+=`${p.replace(/[A-Z]/g,y=>"-"+y.toLowerCase())}: ${u[p]};`;f+=(0,Y.wrapHoverRule)(`${h} { ${b} }`,h)+`
|
|
5
|
-
`}else
|
|
6
|
-
`),f&&(c+=f)}}c&&(e.textContent+=c)}const po=new Set;function ho(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function ds(t,s,o){const r=ho(o);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=s(t,t.state,t.context)}catch{return}if(ho(e)===r)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";po.has(c)||(po.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.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 ls(t){const s=t.subscribeTo,o=typeof s=="function";let r=s;if(o)try{r=s(t,t.state,t.context)}catch{r=null}if(o&&(0,J.isLoudDevRuntime)()&&ds(t,s,Array.isArray(r)?r:[]),!Array.isArray(r)||r.length===0)return;const e=t.__ref;for(let c=0;c<r.length;c++){const n=r[c];if(typeof n!="string"||n.length===0)continue;const i=n.split("."),d=i[0],g=i.slice(1),a={value:!1},f=(0,E.createEffect)(()=>{const l=t.state&&((0,R.isStore)(t.state)?t.state.root:null);if(!l||!(0,R.isStore)(l))return;let u=l;u=u[d];for(let b=0;b<g.length&&!(u==null||typeof u!="object");b++)if((0,R.isStore)(u))u=u[g[b]];else break;if(!a.value)return;let h=!1;if(typeof t.onBeforeUpdate=="function"){const b=t.context?.designSystem;b&&(0,v.pushConfig)(b);try{if(Po(e)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>lt(e,!1),y=>{lt(e,!0),t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}):(lt(e,!1),p===!1&&(h=!0))}}catch(p){lt(e,!0),t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}finally{b&&(0,v.popConfig)()}}if(!h&&t.node&&e.__effects)for(let b=0;b<e.__effects.length;b++){const p=e.__effects[b];p&&p!==f&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}if(!h&&typeof t.onUpdate=="function"){const b=t.context?.designSystem;b&&(0,v.pushConfig)(b);try{t.onUpdate(t,t.state,t.context)}catch(p){t.context?.plugins?.length&&(0,G.runPluginHook)("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}finally{b&&(0,v.popConfig)()}}},{depth:e.path.length,label:j(e,"subscribeTo("+n+")")});a.value=!0,f._isSubscribeToEffect=!0,e.__effects.push(f)}}function $t(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function Ft(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const yo=new Set;function us(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",r=o+"::"+t;yo.has(r)||(yo.add(r),console.warn(`[smbls/css] "${t}" at ${o} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function ot(t,s,o,r){const e={},c=new Set,n=(i,d,g)=>{const a=g?new Set(Object.keys(e)):null;if(A.CSS_PROPS_REGISTRY[i]){const f=A.CSS_PROPS_REGISTRY[i](d,s,s.state,s.context);if(f){const l=Array.isArray(f)?f:[f];for(const u of l)u&&Object.assign(e,u)}}else e[i]=d;if(g)for(const f in e)a.has(f)||c.add(f)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let d=t[i];if(typeof d=="function"&&(d=d(s,s.state,s.context)),d==null||typeof d=="function")continue;if(typeof d=="object"&&!Array.isArray(d)){if(i==="style"){for(const u in d){let h=d[u];if(typeof h=="function"&&(h=h(s,s.state,s.context)),h==null||typeof h=="function")continue;const b=typeof s[u]=="function"&&(A.CSS_PROPS_REGISTRY[u]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(u))||!!(r&&r.has(u));n(u,h,b)}continue}if($t(i,s)){const u=ot(d,s,!1,r);Object.keys(u).length&&(e[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){(0,J.isLoudDevRuntime)()&&us(i,s);continue}const f=Ft(i,s),l=ot(d,s,!1,r);Object.keys(l).length&&(e[f]=l);continue}const g=typeof s[i]=="function"&&(A.CSS_PROPS_REGISTRY[i]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(i)),a=!!(r&&r.has(i));n(i,d,g||a)}if(o)for(const i in e)c.add(i);for(const i of c){const d=e[i];typeof d=="string"&&!d.includes("!important")&&(e[i]=d+" !important")}return e}function It(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&It(t[o],s+1))return!0}return!1}function go(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if($t(t,o)){const c=ot(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const r=Ft(t,o),e=ot(s,o,!1);return Object.keys(e).length?{cssProp:r,block:e}:null}function ps(t){const s=t.__ref;for(const o of Object.keys(t)){if(!Dt(o))continue;const r=t[o];if(!r||typeof r!="object"||Array.isArray(r)||!It(r))continue;let e=null,c;const n=(0,E.createEffect)(()=>{if(!t.node)return;const i=t.context?.designSystem;i&&(0,v.pushConfig)(i);let d,g=!1;try{const a=go(o,r,t),f=a?_t(a.block)+"::"+a.cssProp:null;if(f!==null&&f===c)g=!0;else if(c=f,a){const l=(0,Y.css)({[a.cssProp]:a.block},null,t.context?.cssPrefix);d=l?l.split(" ").filter(Boolean):null}else d=null}finally{i&&(0,v.popConfig)()}if(!(g||!t.node.classList)){if(e)for(const a of e)t.node.classList.remove(a);if(d&&d.length)for(const a of d)t.node.classList.add(a);e=d}},{depth:s.path.length,label:j(s,"cssBlock("+o+")")});s.__effects.push(n)}}function hs(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const r of Object.keys(t)){const e=r.charAt(0);if(e!=="."&&e!=="!")continue;const c=r.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const h=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${e}\` is read as one prop name. Nest the selector inside instead: \`${e}${h}: { '${c.slice(h.length)}': {...} }\`.`)}continue}const n=t[r];if(!n||typeof n!="object")continue;const i=e==="!",d={lastMatch:!1,appliedKeys:null,appliedClasses:null},g=new Set;for(const h in n){if(!Object.prototype.hasOwnProperty.call(n,h))continue;const b=h.charAt(0),p=n[h];(b===":"||b==="@"||b==="&"||b==="[")&&p&&typeof p=="object"&&!Array.isArray(p)||g.add(h)}const a=()=>{let h;const b=t[c];if(b===void 0){const _=!!t.state&&c in t.state,x=t.state?t.state[c]:void 0;if(_||x!==void 0)h=x;else{const k=t.context?.cases?.[c];if(k===void 0)return;try{h=typeof k=="function"?k.call(t,t):k}catch(w){h=!1,s.__conditionalError=w,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,w?.message||w)}}}else if(typeof b=="function")try{h=b(t,t.state,t.context)}catch(_){h=!1,s.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else h=b;const p=i?!h:!!h;if(!t.node||p===d.lastMatch)return;d.lastMatch=p;const y=t.context?.designSystem;y&&(0,v.pushConfig)(y);try{if(p){const _={},x={};let k=!1;for(const S in n){if(!Object.prototype.hasOwnProperty.call(n,S))continue;const D=n[S],Z=S.charAt(0);if((Z===":"||Z==="@"||Z==="&"||Z==="[")&&D&&typeof D=="object"&&!Array.isArray(D)){if($t(S,t)){const L=ot(D,t,!1,g);Object.keys(L).length&&(x[`[data-theme="${S.slice(1)}"] &`]=L,k=!0)}else{const L=Ft(S,t),Q=ot(D,t,!1,g);Object.keys(Q).length&&(x[L]=Q,k=!0)}continue}const M=typeof D=="function"?D(t,t.state,t.context):D;if(M!=null)if(A.CSS_PROPS_REGISTRY[S]){const L=A.CSS_PROPS_REGISTRY[S](M,t,t.state,t.context);if(L){const Q=Array.isArray(L)?L:[L];for(const ut of Q)ut&&Object.assign(_,ut)}}else(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(S)||kt(S))&&(_[S]=M)}const w=Object.keys(_);if(w.length){X(t.node,_);for(const S of w)o.set(S,r);d.appliedKeys=w}else d.appliedKeys=null;if(k){const S=(0,Y.css)(x,null,t.context?.cssPrefix,{state:!0}),D=S?S.split(" ").filter(Boolean):[];if(D.length&&t.node.classList){for(const Z of D)t.node.classList.add(Z);d.appliedClasses=D}else d.appliedClasses=null}else if(d.appliedClasses){for(const S of d.appliedClasses)t.node.classList.remove(S);d.appliedClasses=null}}else{if(d.appliedKeys){for(const _ of d.appliedKeys)o.get(_)===r&&(kt(_)?t.node.style.removeProperty(_):t.node.style[_]="",o.delete(_));d.appliedKeys=null}if(d.appliedClasses){for(const _ of d.appliedClasses)t.node.classList.remove(_);d.appliedClasses=null}}}finally{y&&(0,v.popConfig)()}};s.__conditionalRunners.push(a);const f=N(t,t[c+"Deps"],a),l=(0,E.createEffect)(f,{depth:s.path.length,label:j(s,"conditional("+r+")")}),u=s.__exec&&s.__exec[c]||t[c];l._sources.size===0&&typeof u=="function"&&(0,J.isLoudDevRuntime)()&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(l)}}const Ut=new WeakSet;function ys(t){const s=t.ownerDocument;!s||Ut.has(s)||(Ut.add(s),queueMicrotask(()=>{Ut.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const Bt=new WeakSet;let _o=!1;function bo(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Ht(t,s){const o={...t};for(const r in s){const e=s[r],c=o[r];o[r]=e&&typeof e=="object"&&c&&typeof c=="object"?Ht(c,e):e}return o}function xo(t,s){const o={};for(const r in t){const e=t[r];if(e&&typeof e=="object"){const c=xo(e,s);Object.keys(c).length&&(o[r]=c)}else s.has(r)||(o[r]=e)}return o}function gs(t){const{node:s}=t;if(!s)return;if(_o||(_o=!0,(0,Y.css)({display:"none"})),Bt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Bt.add(t);const o=t.context?.designSystem;o&&(0,v.pushConfig)(o),(0,A.pushStaticCssPass)();try{const r={};let e=!1,c=null,n=null,i=null;const d=(a,f)=>{if(f&&typeof f=="object"&&bo(a)){n||(n={});const l=n[a];l&&(f=Ht(l,f)),n[a]=f}else(f===null||typeof f!="object")&&(i||(i=new Set),i.add(a));r[a]=f};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&A.CSS_PROPS_REGISTRY.theme){const a=A.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(a){const f=l=>{for(const u in l){const h=l[u];h&&typeof h=="object"&&bo(u)&&(c||(c={}),c[u]=h),r[u]=h}};if(Array.isArray(a))for(const l of a)l&&f(l);else f(a);e=!0}}if(typeof t.class=="string"&&Yt.resolveDesignSystemClass){const a=Yt.resolveDesignSystemClass(t.class,t);if(a){for(const f in a)d(f,a[f]);e=!0}}const g=i?new Set(i):null;for(const a of Object.keys(t)){if(typeof t[a]=="function"||B.REGISTRY.has(a)||a==="theme")continue;const f=a.charCodeAt(0);if(!(f>=65&&f<=90)&&!z(a)){if(A.CSS_PROPS_REGISTRY[a]){const l=t[a],u=A.CSS_PROPS_REGISTRY[a](l,t,t.state,t.context);if(u){if(Array.isArray(u)){for(const h of u)if(h)for(const b in h)d(b,h[b])}else for(const h in u)d(h,u[h]);e=!0}}else if(A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(a)){const l=t[a];l!=null&&typeof l!="object"&&(d(a,l),e=!0)}else if(a.charCodeAt(0)===45){const l=t[a];l!=null&&typeof l!="object"&&(d(a,l),e=!0)}else if(a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="["){const l=t[a];if(l&&typeof l=="object"&&!Array.isArray(l)){if(It(l))continue;const u=go(a,l,t);u&&(d(u.cssProp,u.block),e=!0)}}}}if(c)for(const a in c){let f=i?xo(c[a],i):c[a];n&&n[a]&&(f=Ht(f,n[a])),Object.keys(f).length?r[a]=f:delete r[a]}if(cs(t,r,i,g),e){r.display&&String(r.display).includes("!important")&&(s.style.setProperty("display",String(r.display).replace(/\s*!important\s*$/,""),"important"),delete r.display);const a=(0,Y.css)(r,null,t.context?.cssPrefix);if(a&&s.classList){const l=a.split(" ").filter(Boolean);let u=!1;for(const h of l)s.classList.add(h),u||(h.charCodeAt(0)===95&&h.charCodeAt(1)===99||h.charCodeAt(0)===95&&h.indexOf("_c",1)!==-1)&&(u=!0);u&&ys(s)}const f=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(f!=null){const l=r.display;if(l&&l!==f)if(f==="none"){const u=[];for(const h of s.classList)h.startsWith("_d-")&&h!=="_d-none"&&u.push(h);for(const h of u)s.classList.remove(h);s.classList.add("_d-none")}else s.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(s.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}as(t)}finally{(0,A.popStaticCssPass)(),o&&(0,v.popConfig)(),Bt.delete(t)}}function Ao(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const c=t.aria[e];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const n="aria-"+e.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.setAttribute(n,(0,C.serializeAttrValue)(n,c))}const o=(0,C.applyAttrTransforms)(t);for(const e in o){const c=o[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(e,c===!0?"":c)}const r=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||B.REGISTRY.has(e)||e==="on"||o[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!z(e)&&!(A.CSS_PROPS_REGISTRY[e]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(e))&&(0,C.checkAttributeByTagName)(r,e)){let n=t[e];if(n==null)continue;if(typeof n=="string"&&n.includes("{{")){if(!C.ATTR_TRANSFORMS[e])continue;n=O.replaceLiteralsWithObjectFields.call(t,n,t.state)}if(n==null||typeof n=="function"||typeof n=="object"||n===!1&&!(0,C.isEnumeratedTrueFalseAttr)((0,C.camelToAttr)(e)||e))continue;const i=(0,C.camelToAttr)(e)||e;s.setAttribute(i,(0,C.serializeAttrValue)(i,n))}}}function _s(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const r=s.charCodeAt(0);if(r>=65&&r<=90||z(s)||A.CSS_PROPS_REGISTRY[s]||A.DEFAULT_CSS_PROPERTIES_LIST&&A.DEFAULT_CSS_PROPERTIES_LIST.has(s)||!(0,C.checkAttributeByTagName)(t.tag||"div",s))return;const e=(0,C.camelToAttr)(s)||s,c=e.toLowerCase(),n=t.__ref&&t.__ref.__effects;let i=!1;if(n)for(let a=0;a<n.length;a++){const f=n[a];f&&f._attrName===c&&!f._disposed&&typeof f._execute=="function"&&(i=!0,f._execute())}if(i)return;let d=t[s];const g=C.ATTR_TRANSFORMS[s];if(g&&d!=null){const a=g(t);a!==void 0&&(d=a)}typeof d=="string"&&d.includes("{{")&&(d=O.replaceLiteralsWithObjectFields.call(t,d,t.state)),d==null||d===!1&&!(0,C.isEnumeratedTrueFalseAttr)(e)?o.removeAttribute(e):typeof d!="function"&&typeof d!="object"&&o.setAttribute(e,(0,C.serializeAttrValue)(e,d))}function bs(t,s){const o=t.node,r=t.__ref;let e=r.__autoGrow;if(!s){if(e&&e.active){try{o.removeEventListener("input",e.resize)}catch{}o.style.height="",e.appliedMax!=null&&o.style.maxHeight===e.appliedMax&&(o.style.maxHeight=""),e.active=!1,e.appliedMax=null,e.lastMeasure=0}return}e||(e=r.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(o.scrollHeight===0&&e.lastMeasure>0)return;o.style.height="auto";const n=o.scrollHeight;o.style.height=n+"px",n>0&&(e.lastMeasure=n)}},r.__eventCleanup||(r.__eventCleanup=[]),r.__eventCleanup.push(()=>{try{o.removeEventListener("input",e.resize)}catch{}})),e.active||(o.addEventListener("input",e.resize),e.active=!0);const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&o.style.maxHeight===e.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,e.appliedMax=c),e.resize()}function xs(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,r=t.autoGrow,e=typeof r=="function"?N(t,t.autoGrowDeps,r):null,c=(0,E.createEffect)(()=>{const n=t.autoGrow;let i=n;if(typeof n=="function")try{i=(n===r&&e?e:n)(t,t.state,t.context)}catch{i=null}bs(t,i)},{depth:o.path.length,label:j(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),e&&(o.__exec.autoGrow=r)}const ko=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function wo(t,s){for(const o of Object.keys(t)){if(!z(o)||ko.has(o))continue;const r=(0,et.globalEventKeyInfo)(o);if(r){(0,et.registerGlobalEvent)(r,t,t[o]);continue}let e=t[o];if(typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const n=e;e=function(d){return t.call(n,d)}}if(typeof e!="function")continue;const c=Go(o);B.LIFECYCLE_EVENTS.has(c)||(0,et.registerEvent)(Wo(c),t,e)}As(t)}function As(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let r=!1;for(const l of ko){const u=t[l];typeof u=="function"&&(o[l]=u,r=!0)}if(!r)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let n=0,i=0,d=0,g=!1;const a=l=>{const u=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];u&&(n=u.clientX,i=u.clientY,d=Date.now(),g=!0)},f=l=>{if(!g)return;g=!1;const u=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!u)return;const h=u.clientX-n,b=u.clientY-i,p=Date.now()-d;if(p>c)return;const y=Math.abs(h),_=Math.abs(b);if(Math.max(y,_)<e)return;let x;if(y>_*1.2)x=h<0?"left":"right";else if(_>y*1.2)x=b<0?"up":"down";else return;const k="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),w=o[k],S=o.onSwipe;w&&w.call(t,l,t,t.state,t.context),S&&S.call(t,{direction:x,dx:h,dy:b,dt:p,event:l},t,t.state,t.context)};s.addEventListener("touchstart",a,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",a)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function ft(t,s){const o={...t};for(const r in s){const e=o[r],c=s[r];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?o[r]=ft(e,c):o[r]=c}return o}function Kt(t,s,o,r){if(!s||!t.node)return;const e=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",n=t.context?.document||globalThis.document,i=c?null:n?.createDocumentFragment();if(!c&&!i)return;const d=t.childProps,g=t.childrenAs,a=p=>{let y=s[p];const _=y;(typeof y=="string"||typeof y=="number")&&(y={text:y});let x=d;if(typeof d=="function")try{x=d(t,y)}catch{x=null}if(g==="state"){let w=_;(typeof _=="string"||typeof _=="number")&&(w={value:_,text:_}),y=x?{...x,state:w}:{state:w}}else x&&(y=ft(x,y));if(e&&!y.ignoreChildExtends)if(y.extends){const w=Array.isArray(y.extends)?y.extends:[y.extends],S=Array.isArray(e)?e:[e];y={...y,extends:[...S,...w]}}else y={...y,extends:e};const k=Jt(y?.key,_,p);try{return q(y,t,k,o)}catch(w){if(typeof console<"u"&&console.error){const S=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${S} (initial render, skipping this row):`,w?.message||w)}return null}},f=t.__ref;if(!(r===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let p=0;p<s.length;p++){const y=a(p);!c&&y?.node&&i.appendChild(y.node)}return c||t.node.appendChild(i),!0}const u=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;(0,H.openMountBudget)();let h=null;const b=p=>{if(f.__disposed||f.__childrenChunkGen!==u){h&&h.parentNode&&h.remove();return}for(let y=p;y<s.length;y++){const _=a(y);if(_?.node&&(h?t.node.insertBefore(_.node,h):i.appendChild(_.node)),y+1<s.length&&(0,H.mountBudgetExhausted)()){h||(h=n.createComment("smbls-mount"),i.appendChild(h),t.node.appendChild(i));const x=y+1;(0,H.enqueueMountWork)(()=>b(x));return}}h?(h.remove(),t.node.tagName==="SELECT"&&Ct(t,!0)):t.node.appendChild(i)};return b(0),(0,H.closeMountBudget)(),!0}if(typeof s=="string"){const c=mt(s,t);if(Array.isArray(c))return Kt(t,c,o,r)}if(typeof s=="object")for(const c in s){if(B.REGISTRY.has(c))continue;let n=s[c];if(!(n==null||n===!1)){if((typeof n=="string"||typeof n=="number")&&(n={text:n}),t.childProps&&(n=ft(t.childProps,n)),e&&!n.ignoreChildExtends)if(n.extends){const i=Array.isArray(n.extends)?n.extends:[n.extends],d=Array.isArray(e)?e:[e];n={...n,extends:[...d,...i]}}else n={...n,extends:e};q(n,t,c,o)}}}function Ct(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const r=o.options;if(!r||!r.length)return;const e=t.__ref,c=e&&e.__exec&&e.__exec.value,n=typeof c=="function",i=t.value!=null&&typeof t.value!="function";if(n||i){let a;if(n)try{a=c(t,t.state,t.context)}catch{return}else a=t.value,typeof a=="string"&&a.includes("{{")&&(a=O.replaceLiteralsWithObjectFields.call(t,a,t.state));const f=a==null?"":String(a);o.value!==f&&(o.value=f);return}const d=s||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!d)return;let g=-1;for(let a=0;a<r.length;a++)r[a].defaultSelected&&(g=a);g>=0&&o.selectedIndex!==g&&(o.selectedIndex=g)}function So(t,s){let{children:o,content:r}=t;const e=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(p){if(o=void 0,typeof console<"u"&&console.error){const y=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${y} (initial run, treating as empty):`,p?.message||p)}}t.children=o;const l=t.__ref;let u=!1;const h=N(t,t.childrenDeps,f),b=(0,E.createEffect)(()=>{const p=u;u=!0;let y;try{y=h(t,t.state,t.context)}catch(M){if(typeof console<"u"&&console.error){const L=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${L}${p?"":" (initial tracking run)"}:`,M?.message||M)}return}if(!p||y===t.children)return;t.children=y,l.__childrenChunkGen!=null&&l.__childrenChunkGen++;const _=typeof t.onContentUpdate=="function",x=_?[]:null,k=_?[]:null,w=_?[]:null;if(Array.isArray(y)&&t.childrenAs==="state"){const M=t.childProps,L=[],Q=new Map;for(let T=0;T<y.length;T++){const K=y[T];let P=M;if(typeof M=="function")try{P=M(t,K)}catch{P=null}const W=Jt(P&&P.key,K,T);L.push(W),Q.set(W,{rawChild:K,childProps:P})}const ut=new Set(L),Lo=l.__children.slice();for(const T of Lo)if(!ut.has(T)){const K=t[T];K?.remove&&K.remove(),delete t[T],k&&k.push(T)}const nt=t.childExtends,pt=t.tag==="fragment",Oo=t.context?.document||globalThis.document,rt=pt?null:Oo?.createDocumentFragment(),Et=new Set;for(const T of L){const K=Q.get(T),P=K.rawChild,W=t[T];if(W&&W.state){if(P&&typeof P=="object"){const $=W.state,tt=$.$replace||$.replace,Gt=$.$update||$.update;try{if(typeof tt=="function")tt.call($,P);else if(typeof Gt=="function"){for(const U in $)if(!(U==="__element"||U==="root"||U==="parent"||U==="update")&&!Object.prototype.hasOwnProperty.call(P,U))try{$[U]=void 0}catch{}Gt.call($,P)}else for(const U in P)$[U]=P[U]}catch(U){if(typeof console<"u"&&console.error){const Do=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Do} (reconcile, keeping its previous data for this pass):`,U?.message||U)}}}w&&w.push(T);continue}let Tt=P;(typeof P=="string"||typeof P=="number")&&(Tt={value:P,text:P});const Vt=K.childProps;let V=Vt?{...Vt,state:Tt}:{state:Tt};if(nt&&!V.ignoreChildExtends)if(V.extends){const $=Array.isArray(V.extends)?V.extends:[V.extends],tt=Array.isArray(nt)?nt:[nt];V={...V,extends:[...tt,...$]}}else V={...V,extends:nt};let Pt;try{Pt=q(V,t,T,s)}catch($){if(typeof console<"u"&&console.error){const tt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${tt} (reconcile, skipping this row):`,$?.message||$)}Et.add(T);continue}!pt&&Pt?.node&&rt&&rt.appendChild(Pt.node),x&&x.push(T)}if(!pt&&rt&&rt.childNodes.length&&t.node&&t.node.appendChild(rt),!pt&&t.node){let T=null;for(const K of L){const P=t[K]?.node;if(!P)continue;const W=T?T.nextSibling:t.node.firstChild;P!==W&&t.node.insertBefore(P,W),T=P}}l.__children=Et.size?L.filter(T=>!Et.has(T)):L,_&&(x.length||k.length)&&Xt(t,{added:x,removed:k,kept:w}),Ct(t,!1);return}const Z=_?[...l.__children]:null;for(const M of[...l.__children]){const L=t[M];L?.remove&&L.remove(),delete t[M]}l.__children=[],Kt(t,y,s),Ct(t,!1),_&&Xt(t,{added:[...l.__children],removed:Z,kept:[]})},{depth:l.path.length,label:j(l,"children")});l.__effects.push(b)}const c=Kt(t,o,s,!0);if(r!=null&&!(r&&r.__ref)){let f=r;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=ft(t.childProps,f)),e&&!f.ignoreChildExtends)if(f.extends){const l=Array.isArray(f.extends)?f.extends:[f.extends],u=Array.isArray(e)?e:[e];f={...f,extends:[...u,...l]}}else f={...f,extends:e};q(f,t,"content",s)}if(o&&!c)return;const n=t.context?.components||{};{const f=Object.keys(t);for(let l=0;l<f.length;l++){const u=f[l];if(!u.endsWith("Extends")||typeof t[u]!="string")continue;const h=u.slice(0,-7);if(!h||h.charCodeAt(0)<65||h.charCodeAt(0)>90)continue;const b={extends:t[u]};delete t[u];for(let p=l+1;p<f.length;p++){const y=f[p],_=y.charCodeAt(0);if(_>=65&&_<=90||B.REGISTRY.has(y)||typeof t[y]=="function"&&(y.startsWith("on")||y.startsWith(".")))break;const x=t[y];x!==void 0&&(b[y]=x,delete t[y])}t[h]&&typeof t[h]=="object"?t[h]={...b,...t[h]}:t[h]=b}}const i=s?.mountYield===!0||t.yieldChildren===!0,d=Object.keys(t),g=f=>{if(B.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return;const l=f.charCodeAt(0);if(l<65||l>90)return;let u=t[f];if(!u.__ref){if(!u.extends&&!u.extend){const h=n[f]||n[`smbls.${f}`];h&&(u={...u,extends:h})}if(t.childProps&&(u=ft(t.childProps,u)),e&&!u.ignoreChildExtends)if(u.extends){const h=Array.isArray(u.extends)?u.extends:[u.extends],b=Array.isArray(e)?e:[e];u={...u,extends:[...b,...h]}}else u={...u,extends:e};q(u,t,f,s)}};if(!i){for(const f of d)g(f);return}(0,H.openMountBudget)();const a=f=>{for(let l=f;l<d.length;l++)if(g(d[l]),l+1<d.length&&(0,H.mountBudgetExhausted)()){const u=l+1;(0,H.enqueueMountWork)(()=>a(u));return}};a(0),(0,H.closeMountBudget)()}function Co(t,s,o){const{node:r}=t;if(!r)return;r.ref=t;const e=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(e){const n=e.parentNode;if(n){if(o?.position==="before"&&o.node)n.insertBefore(r,o.node);else if(o?.position==="after"&&o.node){const i=o.node.nextSibling;n.insertBefore(r,i||e)}else n.insertBefore(r,e);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(r,o.node);else if(o?.position==="after"&&o.node){const n=o.node.nextSibling;n?c.insertBefore(r,n):c.appendChild(r)}else c.appendChild(r)}const jt=3;function Po(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=jt?!1:(t.__inBeforeUpdate=!0,!0)}function lt(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===jt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${jt}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,s,o){const r=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,G.runPluginHook)(r,s,o);const e="on"+t,c=s[e];if(typeof c=="function"){const d=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(d){if(s.__ref[d])return!0;s.__ref[d]=!0}const g=s.context?.designSystem;g&&(0,v.pushConfig)(g);let a=!!d;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const l=s.__ref;return f.catch(u=>{s.context?.plugins?.length&&(0,G.runPluginHook)("error",s,{hook:e,error:u})||console.error(`[DOMQL] Lifecycle "${e}" error:`,u)}).finally(()=>{d&&l&&(l[d]=!1)}),a=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&(0,G.runPluginHook)("error",s,{hook:e,error:f})||console.error(`[DOMQL] Lifecycle "${e}" error:`,f),s.context?.strictMode)throw f}finally{g&&(0,v.popConfig)(),a&&s.__ref&&(s.__ref[d]=!1)}}return!0}var ks=q;
|
|
4
|
+
`):"")}}if(Lt(r,!0),Do(r,s,n),typeof r.html=="function"&&r.node&&!r.node.innerHTML){const u=r.context?.designSystem;u&&(0,v.pushConfig)(u);try{const l=r.html(r,r.state,r.context);l!=null&&typeof l!="function"&&(r.node.innerHTML=l)}catch{}finally{u&&(0,v.popConfig)()}}if($("Create",r,e),$("Complete",r,e),$("Render",r,e),$("RenderRouter",r,e),$t(r,e),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,b=()=>{if(r.node){if(r.node.isConnected){l&&(0,v.pushConfig)(l);try{u(r,r.state,r.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{l&&(0,v.popConfig)()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return r}function ss(t,s,o){const e=!s,n=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=e&&n&&t.context?.state,r=o.state!==void 0&&!c?o.state:t.state&&!(0,N.isStore)(t.state)?t.state:void 0;if(r==null){if(s?.state)t.state=s.state,(0,it.applyStateMethods)(t,t.state);else if(t.context?.state){const d=t.context.state,i={...d},g=t.context?.polyglot;if(g?.translations){const _=t.context,f=d.lang||g.defaultLang||"en",p=new Set,y=(u,l)=>{p.has(u)||(0,R.isPolyglotWritableKey)(_,u,i)&&(i[u]=l,p.add(u),(0,R.markPolyglotSeeded)(_,u))},a=g.translations[f];if(a&&typeof a=="object")for(const u in a)y(u,a[u]);const h=new Set(g.languages||[]);for(const u in g.translations)h.has(u)||y(u,g.translations[u])}t.state=(0,N.isStore)(i)?i:(0,N.createStore)(i),t.state.__element=t,t.state.root=t.state,(0,it.applyStateMethods)(t,t.state),xt.promoteActiveRootState?.(d,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),(0,it.applyStateMethods)(t,t.state);return}if(typeof r=="string"){if(t.state=co(r,s),t.state&&typeof t.state=="object"&&!(0,N.isStore)(t.state)){const d=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:d,enumerable:!1,configurable:!0,writable:!0})}(0,it.applyStateMethods)(t,t.state);return}if(typeof r=="function"){const d=r(t,s?.state);t.state=(0,N.isStore)(d)?d:(0,N.createStore)(d||{})}else(0,N.isStore)(r)?t.state=r:t.state=(0,N.createStore)({...r});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,(0,it.applyStateMethods)(t,t.state),xt.promoteActiveRootState?.(r,t.state)}function Ut(t,s){if(!s)return t;const o=s.split("/");let e=t;for(const n of o){if(e==null)return{};e=e[n]}return e??{}}function co(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const n=t.slice(3);return n?Ut(s.state,n):s.state??{}}if(t.startsWith("~/")){const n=s.state?.root||s.state,c=t.slice(2);return c?Ut(n,c):n??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Ut(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const e=s.context?.polyglot;if(e?.translations){const n=s.state?.root?.lang||e.defaultLang||"en",c=e.translations[n];if(c?.[t]!==void 0)return c[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const es=new Set(["s","state","ctx","context"]);function ns(t){try{const o=(typeof xt.getFunctionSource=="function"?xt.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function rs(t){if(typeof t!="function"||t.length!==2)return!1;const s=ns(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!es.has(o)}function is(t){const s=t.__ref,o=t.tag||"div",e=t.context?.designSystem,n=[],c=Object.keys(t);for(let r=0;r<c.length;r++){const d=c[r];if(typeof t[d]!="function"||K.REGISTRY.has(d))continue;const i=d.charCodeAt(0);i>=65&&i<=90||Y(d)||C.CSS_PROPS_REGISTRY[d]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(d)||(0,w.checkAttributeByTagName)(o,d)||((0,tt.isLoudDevRuntime)()&&rs(t[d])&&console.warn(`[smbls] custom prop "${d}"${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('${d}', \u2026) instead of reading el.${d}(\u2026) directly (see RULES.md Rule 8).`),n.push({prop:d,fn:t[d]}))}for(let r=0;r<n.length;r++){const{prop:d,fn:i}=n[r];s.__exec[d]=i,Object.defineProperty(t,d,{get(){e&&(0,v.pushConfig)(e);try{return i(t,t.state,t.context)}catch{return}finally{e&&(0,v.popConfig)()}},set(g){delete s.__exec[d],Object.defineProperty(t,d,{value:g,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function cs(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const e=s[o];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function D(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...e){return cs(t,s),o.apply(this,e)}}function pt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function j(t,s){return()=>t.path.join(".")+"::"+s}const fo=new Set;function I(t,s,o){if(!(0,tt.isLoudDevRuntime)())return;const e=j(t,s)();fo.has(e)||(fo.add(e),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const ao=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,fs=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;ao.lastIndex=0;let e;for(;(e=ao.exec(o))!==null;)e[2].includes("{{")&&s.add(e[2])},as=(t,s)=>!Y(t)&&!(0,Z.isCssProp)(s,t),uo=(t,s,o,e)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&as(t,e)&&fs(s,o)},us=["attr","aria","data"],ls=t=>{if(us.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},ds=t=>{const s=new Set,o=t.tag||"div";for(const e of Object.keys(t)){const n=Object.getOwnPropertyDescriptor(t,e),c=n&&n.value;if(c&&typeof c=="object"&&!Array.isArray(c)){if(!ls(e))continue;for(const r in c)uo(r,c[r],s,o);continue}uo(e,c,s,o)}return s};function lo(t,s){const o=t.__ref,e=!!(s&&s.skipIfEffect),n=ds(t);if(o.__authoredTemplates)for(const i of n)o.__authoredTemplates.add(i);else o.__authoredTemplates=n;if(is(t),typeof t.text=="function"){const i=t.text,g=D(t,t.textDeps,i),_=(0,E.createEffect)(()=>{if(!o.contentManaged)try{let f=g(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&typeof f!="object"&&(typeof f=="string"&&f.includes("{{")&&(f=R.replaceLiteralsWithObjectFields.call(t,f,t.state)),yt(t,f))}catch(f){I(o,"text",f)}},{depth:o.path.length,label:j(o,"text")});o.__effects.push(_),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,g=(0,E.createEffect)(()=>{if(o.contentManaged)return;const _=R.replaceLiteralsWithObjectFields.call(t,i,t.state);_!=null&&(t.text=_),t.node&&yt(t,_??"")},{depth:o.path.length,label:j(o,"text")});o.__effects.push(g),o.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!K.REGISTRY.has(i)&&!Y(i)&&!o.__exec[i]&&!(0,Z.isAttributeFirst)(c,i)){if(C.CSS_PROPS_REGISTRY[i]){const g=t[i],_=D(t,t[i+"Deps"],g),f=i;let p,y=null,a=null,h;const u=(0,E.createEffect)(()=>{const l=t.context?.designSystem;l&&(0,v.pushConfig)(l);try{const b=_(t,t.state,t.context);(0,C.pushStaticCssPass)();let A;try{A=C.CSS_PROPS_REGISTRY[f](b,t,t.state,t.context)}finally{(0,C.popStaticCssPass)()}if(Array.isArray(A)){const S={};for(const x of A)if(x)for(const L in x)S[L]=x[L];A=S}const k=f==="show"||f==="hide";if(A&&t.node&&ps(A)){const S=wt(A);if(S===null||S!==h){h=S;const x=(0,q.css)(A,null,t.context?.cssPrefix),L=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(a)for(const U of a)t.node.classList.remove(U);if(L&&L.length)for(const U of L)t.node.classList.add(U);a=L}}p=void 0,y=null}else if(A&&t.node){if(a){for(const x of a)t.node.classList.remove(x);a=null,h=void 0}const S=wt(A);if(S===null||S!==p||!jt(t.node,y)){p=S;const x=bo(t,A);y=vt(t.node,x)}}else t.node&&k&&(p=void 0,y=null,t.node.style.display="")}finally{l&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,f)});o.__effects.push(u),o.__exec[i]=g}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(i)){const g=t[i],_=D(t,t[i+"Deps"],g),f=i;let p,y=null;const a=(0,E.createEffect)(()=>{const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{const u=_(t,t.state,t.context);if(t.node)if(u!=null){const l=f+":"+String(u);if(l!==p||!jt(t.node,y)){p=l;const b={[f]:u},A=bo(t,b);y=vt(t.node,A)}}else p=void 0,y=null,t.node.style[f]=""}finally{h&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,f)});o.__effects.push(a),o.__exec[i]=g}}if(typeof t.html=="function"){const i=t.html,g=D(t,t.htmlDeps,i),_=(0,E.createEffect)(()=>{const f=t.context?.designSystem;f&&(0,v.pushConfig)(f);try{const p=g(t,t.state,t.context);t.node&&p!=null&&typeof p!="function"&&(t.node.innerHTML=p)}finally{f&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,"html")});o.__effects.push(_),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,g=D(t,t.valueDeps,i),_=(0,E.createEffect)(()=>{try{let f=g(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=R.replaceLiteralsWithObjectFields.call(t,f,t.state)),yo(t,f)}catch(f){I(o,"value",f)}},{depth:o.path.length,label:j(o,"value")});o.__effects.push(_),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,g=(0,E.createEffect)(()=>{try{yo(t,R.replaceLiteralsWithObjectFields.call(t,i,t.state))}catch(_){I(o,"value",_)}},{depth:o.path.length,label:j(o,"value")});o.__effects.push(g),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,g=D(t,t.styleDeps,i);let _,f=null;const p=(0,E.createEffect)(()=>{const y=g(t,t.state,t.context),a=wt(y);(a===null||a!==_||!jt(t.node,f))&&(_=a,hs(t.node,f,y),m(t.node,y),f=vt(t.node,y))},{depth:o.path.length,label:j(o,"style")});o.__effects.push(p),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const g=t.style[i];if(typeof g!="function")continue;const _=D(t,pt(t.styleDeps,i),g);let f,p=null;const y=(0,E.createEffect)(()=>{try{const a=_(t,t.state,t.context);if(t.node){const h=i+":"+String(a);if(h!==f||!jt(t.node,p)){f=h;const u={[i]:a};m(t.node,u),p=vt(t.node,u)}}}catch(a){I(o,"style."+i,a)}},{depth:o.path.length,label:j(o,"style."+i)});o.__effects.push(y)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const g=D(t,pt(t.attrDeps,i),t.attr[i]),_=i,f=(0,E.createEffect)(()=>{try{let p=g(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=R.replaceLiteralsWithObjectFields.call(t,p,t.state)),t.node?.setAttribute&&(p==null||p===!1&&!(0,w.isEnumeratedTrueFalseAttr)(_)?t.node.removeAttribute(_):typeof p!="function"&&typeof p!="object"&&t.node.setAttribute(_,(0,w.serializeAttrValue)(_,p)))}catch(p){I(o,"attr."+_,p)}},{depth:o.path.length,label:j(o,"attr."+_)});f._attrName=_.toLowerCase(),o.__effects.push(f)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const g=t.attr[i],_=i,f=(0,E.createEffect)(()=>{try{const p=R.replaceLiteralsWithObjectFields.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(_,(0,w.serializeAttrValue)(_,p??""))}catch(p){I(o,"attr."+_,p)}},{depth:o.path.length,label:j(o,"attr."+_)});f._attrName=_.toLowerCase(),o.__effects.push(f)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const g=t.aria[i];if(typeof g=="string"&&g.includes("{{")){const y=g,a="aria-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),h=(0,E.createEffect)(()=>{try{const u=R.replaceLiteralsWithObjectFields.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,(0,w.serializeAttrValue)(a,u??""))}catch(u){I(o,"aria."+i,u)}},{depth:o.path.length,label:j(o,"aria."+i)});h._attrName=a,o.__effects.push(h);continue}if(typeof g!="function")continue;const _=D(t,pt(t.ariaDeps,i),t.aria[i]),f="aria-"+i.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),p=(0,E.createEffect)(()=>{try{const y=_(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(f,(0,w.serializeAttrValue)(f,y))}catch(y){I(o,"aria."+i,y)}},{depth:o.path.length,label:j(o,"aria."+i)});p._attrName=f,o.__effects.push(p)}if(t.data&&typeof t.data=="object")for(const i in t.data){const g=t.data[i];if(typeof g=="string"&&g.includes("{{")){const a=g,h="data-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),u=(0,E.createEffect)(()=>{try{const l=R.replaceLiteralsWithObjectFields.call(t,a,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(h,l??"")}catch(l){I(o,"data."+i,l)}},{depth:o.path.length,label:j(o,"data."+i)});u._attrName=h,o.__effects.push(u);continue}if(typeof g!="function")continue;const _=D(t,pt(t.dataDeps,i),t.data[i]),p="data-"+i.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),y=(0,E.createEffect)(()=>{try{const a=_(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(p):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(p,a===!0?"":a)}catch(a){I(o,"data."+i,a)}},{depth:o.path.length,label:j(o,"data."+i)});y._attrName=p,o.__effects.push(y)}const r=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(r)for(const i in r){if(typeof r[i]!="function")continue;const g=D(t,pt(t.classDeps,i),r[i]),_=(0,E.createEffect)(()=>{try{const f=g(t,t.state,t.context);if(!t.node?.classList)return;typeof f=="string"?t.node.classList.add(f):f?t.node.classList.add(i):t.node.classList.remove(i)}catch(f){I(o,"class."+i,f)}},{depth:o.path.length,label:j(o,"class."+i)});o.__effects.push(_)}!e&&typeof t.if=="function"&&ho(t,o,t.if);for(const i of Object.keys(t)){if(K.REGISTRY.has(i)||typeof t[i]!="function")continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||Y(i))continue;const _=t[i];o.__exec[i]=_;const f=t.tag||"div";if((0,w.checkAttributeByTagName)(f,i)&&!(0,Z.isCssProp)(f,i)){const p=(0,w.camelToAttr)(i)||i,y=D(t,t[i+"Deps"],_),a=(0,E.createEffect)(()=>{try{let h=y(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=R.replaceLiteralsWithObjectFields.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!(0,w.isEnumeratedTrueFalseAttr)(p)?t.node.removeAttribute(p):typeof h!="function"&&typeof h!="object"&&(p==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(p,(0,w.serializeAttrValue)(p,h))))}catch(h){I(o,i,h)}},{depth:o.path.length,label:j(o,i)});a._attrName=p.toLowerCase(),o.__effects.push(a)}}const d=t.tag||"div";for(const i of Object.keys(t)){if(K.REGISTRY.has(i))continue;const g=t[i];if(typeof g!="string"||!g.includes("{{"))continue;const _=i.charCodeAt(0);if(_>=65&&_<=90||Y(i)||(0,Z.isCssProp)(d,i)||w.ATTR_TRANSFORMS[i]||!(0,w.checkAttributeByTagName)(d,i))continue;const f=(0,w.camelToAttr)(i)||i,p=(0,E.createEffect)(()=>{try{const y=R.replaceLiteralsWithObjectFields.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(f,(0,w.serializeAttrValue)(f,y??""))}catch(y){I(o,i,y)}},{depth:o.path.length,label:j(o,i)});p._attrName=f.toLowerCase(),o.__effects.push(p)}if(xs(t),vs(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,g=t.stateDeps;let _=!1,f=[];const p=(0,E.createEffect)(()=>{const y=[];for(let l=0;l<g.length;l++){const b=g[l];try{y[l]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{y[l]=void 0}}if(!_){_=!0,f=y;return}let a=y.length!==f.length;for(let l=0;!a&&l<y.length;l++)y[l]!==f[l]&&(a=!0);const h=f;if(f=y,!a)return;const u=t.context?.designSystem;u&&(0,v.pushConfig)(u);try{i(t,t.state,t.context,{prev:h,next:y})}catch(l){if(t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onStateUpdate",error:l})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',l),t.context?.strictMode)throw l}finally{u&&(0,v.popConfig)()}},{depth:o.path.length,label:j(o,"onStateUpdate")});o.__effects.push(p)}ws(t)}function po(t){const s=t.parent,o=s?.node;if(!o||!t.node){Do(t,t.parent);return}let e=null;const n=Object.keys(s),c=n.indexOf(t.key);for(let r=c+1;r<n.length;r++){const d=s[n[r]];if(d?.node?.parentNode===o){e=d.node;break}}e?o.insertBefore(t.node,e):o.appendChild(t.node)}function ho(t,s,o){const e=D(t,t.ifDeps,o),n=(0,E.createEffect)(()=>{let c;try{c=e(t,t.state,t.context)}catch(d){if(c=!1,s.__ifError=d,typeof console<"u"&&console.warn){const i=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${i} \u2014 treating as false:`,d?.message||d)}return}const r=s.__if;if(s.__if=!!c,r&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(d){console.error("[smbls] onRemove error:",d)}}else if(!r&&s.__if)if(s.__ifInitialized)t.node||(t.node=(0,ot.cacheNode)(t)),t.node&&(t.node.ref=t),po(t),Bt(t),$("Render",t,{}),$t(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=(0,ot.detectTag)(t)),$("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"&&!s.__fragmentAnchor){const i=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(i),s.__fragmentAnchor=i}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Oo(t,{}),lo(t,{skipIfEffect:!0}),Bt(t),To(t),Po(t),Ro(t,{}),po(t),$("Create",t,{}),$("Complete",t,{}),$("Render",t,{}),$("RenderRouter",t,{}),$t(t,{})}},{depth:s.path.length,label:j(s,"if")});s.__effects.push(n)}function yt(t,s){const o=t.node;if(!o)return;const e=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==e&&(o.nodeValue=e);return}const n=t.__ref;let c=n?n.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const r=o.firstChild;r&&r.nodeType===3&&(c=r)}c?c.nodeValue!==e&&(c.nodeValue=e):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),o.insertBefore(c,o.firstChild)):(o.textContent=e,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),n&&(n.__textNode=c||null)}function yo(t,s){const o=t.node;if(!o||!("value"in o))return;const e=s==null?"":String(s);if(o.value===e)return;const n=typeof document<"u"&&document.activeElement===o,c=n&&typeof o.selectionStart=="number"?o.selectionStart:null,r=n&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=e,n&&c!=null&&r!=null)try{o.setSelectionRange(c,r)}catch{}}function Bt(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&yt(t,t.text),Eo(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const e in t.style)if(typeof t.style[e]=="function"){o={};for(const n in t.style)typeof t.style[n]!="function"&&(o[n]=t.style[n]);break}m(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const e=t.attr[o];typeof e=="function"||typeof e=="object"||e!=null&&(typeof e=="string"&&e.includes("{{")||e===!1&&!(0,w.isEnumeratedTrueFalseAttr)(o)||s.setAttribute&&s.setAttribute(o,(0,w.serializeAttrValue)(o,e)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&s.setAttribute&&s.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const o in t.data){const e=t.data[o];typeof e=="function"||typeof e=="object"||e==null||e===!1||typeof e=="string"&&e.includes("{{")||s.dataset&&(s.dataset[o]=e===!0?"":e)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(e=>e&&s.classList.add(e));else if(typeof o=="object")for(const e in o){const n=typeof o[e]=="function"?o[e](t,t.state,t.context):o[e];n&&s.classList.add(typeof n=="string"?n:e)}}}}function wt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function ps(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function vt(t,s){if(!t||!t.style||!s)return null;const o=t.style,e=[];for(const n in s){if(s[n]==null||n.charAt(0)==="&")continue;const r=kt(n);e.push(r,Kt(o,r),_o(o,r))}return e}function Kt(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function _o(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function kt(t){return Et(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function hs(t,s,o){if(!t||!t.style||!s||!s.length)return;const e=t.style,n=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||n.add(kt(c));for(let c=0;c<s.length;c+=3){const r=s[c];n.has(r)||Kt(e,r)===s[c+1]&&typeof e.removeProperty=="function"&&e.removeProperty(r)}}function jt(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let e=0;e<s.length;e+=3)if(Kt(o,s[e])!==s[e+1]||_o(o,s[e])!==s[e+2])return!1;return!0}const Et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function ys(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(kt(o)));return s}function _s(t,s,o,e){const n=t.__ref;if(!n)return;let c=null;if(o)for(const r of o){if(e&&e.has(r))continue;const d=s[r];if(d==null||typeof d=="object")continue;const i=kt(r);Qt.CSS_LONGHAND_SHORTHANDS[i]&&(c||(c={}),c[i]=d)}n.__declaredLonghands=c}function go(t,s){const o=t.__ref,e=o&&o.__declaredLonghands;if(!e||!s)return null;let n=null;for(const c in e){if(s.has(c))continue;const r=Qt.CSS_LONGHAND_SHORTHANDS[c];let d=!1;for(let i=0;i<r.length;i++)if(s.has(r[i])){d=!0;break}d&&(n||(n={}),n[c]=e[c])}return n}function bo(t,s){const o=t.node;m(o,s);const e=ys(s);if(!e)return s;const n=t.__ref;if(n)if(n.__inlineCssKeys)for(const r of e)n.__inlineCssKeys.add(r);else n.__inlineCssKeys=new Set(e);const c=go(t,e);return c?(m(o,c),Object.assign({},s,c)):s}function gs(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=go(t,s.__inlineCssKeys);o&&m(t.node,o)}function m(t,s){if(!t||!s||!t.style)return;let o=null;for(const e in s){const n=s[e];if(n!=null){if(e.charAt(0)==="&"&&typeof n=="object"){o||(o={}),o[e]=n;continue}try{const c=String(n),r=Et(e)?e:e.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),d=c.trim(),i=/\s*!important\s*$/.test(d),g=d.replace(/\s*!important\s*$/,"");t.style.setProperty(r,g,i?"important":"")}catch{}}}o&&bs(t,o)}function bs(t,s){const o=`_ds${to.scopedStyleId++}`;t.classList.add(o);const e=t.ownerDocument;let n=e.querySelector("style[data-smbls-scoped]");n||(n=e.createElement("style"),n.setAttribute("data-smbls-scoped",""),e.head.appendChild(n));let c="";for(const r in s){const d="."+o,i=r.replace(/&/g,d).split(",").map(_=>{const f=_.trim();return f.includes(d)?f:d+f}).join(", "),g=s[r];if(typeof g=="object"){let _="",f="";for(const p in g){const y=g[p];if(typeof y=="object"){const a=p.includes("&")?i.split(", ").map(u=>p.replace(/&/g,u)).join(", "):i.split(", ").map(u=>`${u} ${p}`).join(", ");let h="";for(const u in y)h+=`${u.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${y[u]};`;f+=(0,q.wrapHoverRule)(`${a} { ${h} }`,a)+`
|
|
5
|
+
`}else _+=`${p.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())}: ${y};`}_&&(c+=(0,q.wrapHoverRule)(`${i} { ${_} }`,i)+`
|
|
6
|
+
`),f&&(c+=f)}}c&&(n.textContent+=c)}const Ao=new Set;function xo(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function As(t,s,o){const e=xo(o);queueMicrotask(()=>{if(!t.__ref)return;let n;try{n=s(t,t.state,t.context)}catch{return}if(xo(n)===e)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";Ao.has(c)||(Ao.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.join(", ")||"(none)"}], probed [${Array.isArray(n)?n.join(", "):String(n)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function xs(t){const s=t.subscribeTo,o=typeof s=="function";let e=s;if(o)try{e=s(t,t.state,t.context)}catch{e=null}if(o&&(0,tt.isLoudDevRuntime)()&&As(t,s,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const n=t.__ref;for(let c=0;c<e.length;c++){const r=e[c];if(typeof r!="string"||r.length===0)continue;const d=r.split("."),i=d[0],g=d.slice(1),_={value:!1},f=(0,E.createEffect)(()=>{const p=t.state&&((0,N.isStore)(t.state)?t.state.root:null);if(!p||!(0,N.isStore)(p))return;let y=p;y=y[i];for(let h=0;h<g.length&&!(y==null||typeof y!="object");h++)if((0,N.isStore)(y))y=y[g[h]];else break;if(!_.value)return;let a=!1;if(typeof t.onBeforeUpdate=="function"){const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{if(Io(n)){const u=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});u&&typeof u.then=="function"?u.then(()=>_t(n,!1),l=>{_t(n,!0),t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}):(_t(n,!1),u===!1&&(a=!0))}}catch(u){_t(n,!0),t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onBeforeUpdate",error:u})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",u)}finally{h&&(0,v.popConfig)()}}if(!a&&t.node&&n.__effects)for(let h=0;h<n.__effects.length;h++){const u=n.__effects[h];u&&u!==f&&!u._disposed&&!u._isSubscribeToEffect&&typeof u._execute=="function"&&u._execute()}if(!a&&typeof t.onUpdate=="function"){const h=t.context?.designSystem;h&&(0,v.pushConfig)(h);try{t.onUpdate(t,t.state,t.context)}catch(u){t.context?.plugins?.length&&(0,W.runPluginHook)("error",t,{hook:"onUpdate",error:u})||console.error("[DOMQL] subscribeTo onUpdate error:",u)}finally{h&&(0,v.popConfig)()}}},{depth:n.path.length,label:j(n,"subscribeTo("+r+")")});_.value=!0,f._isSubscribeToEffect=!0,n.__effects.push(f)}}function Gt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function Ht(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const Co=new Set;function Cs(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",e=o+"::"+t;Co.has(e)||(Co.add(e),console.warn(`[smbls/css] "${t}" at ${o} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function rt(t,s,o,e){const n={},c=new Set,r=(d,i,g)=>{const _=g?new Set(Object.keys(n)):null;if(C.CSS_PROPS_REGISTRY[d]){const f=C.CSS_PROPS_REGISTRY[d](i,s,s.state,s.context);if(f){const p=Array.isArray(f)?f:[f];for(const y of p)y&&Object.assign(n,y)}}else n[d]=i;if(g)for(const f in n)_.has(f)||c.add(f)};for(const d in t){if(!Object.prototype.hasOwnProperty.call(t,d))continue;let i=t[d];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(d==="style"){for(const y in i){let a=i[y];if(typeof a=="function"&&(a=a(s,s.state,s.context)),a==null||typeof a=="function")continue;const h=typeof s[y]=="function"&&(C.CSS_PROPS_REGISTRY[y]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(y))||!!(e&&e.has(y));r(y,a,h)}continue}if(Gt(d,s)){const y=rt(i,s,!1,e);Object.keys(y).length&&(n[`[data-theme="${d.slice(1)}"] &`]=y);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(d)){(0,tt.isLoudDevRuntime)()&&Cs(d,s);continue}const f=Ht(d,s),p=rt(i,s,!1,e);Object.keys(p).length&&(n[f]=p);continue}const g=typeof s[d]=="function"&&(C.CSS_PROPS_REGISTRY[d]||C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(d)),_=!!(e&&e.has(d));r(d,i,g||_)}if(o)for(const d in n)c.add(d);for(const d of c){const i=n[d];typeof i=="string"&&!i.includes("!important")&&(n[d]=i+" !important")}return n}const Tt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function So(t,s){for(const o in s){const e=s[o];t[o]=Tt(e)?So(Tt(t[o])?t[o]:{},e):e}return t}function Ss(t,s){if(!Tt(s))return;let o;for(const e of t.split(" ")){const n=e?s[e]:null;Tt(n)&&(o=So(o||{},n))}return o}function Vt(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Vt(t[o],s+1))return!0}return!1}function wo(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Gt(t,o)){const c=rt(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const e=Ht(t,o),n=rt(s,o,!1);return Object.keys(n).length?{cssProp:e,block:n}:null}function ws(t){const s=t.__ref;for(const o of Object.keys(t)){if(!It(o))continue;const e=t[o];if(!e||typeof e!="object"||Array.isArray(e)||!Vt(e))continue;let n=null,c;const r=(0,E.createEffect)(()=>{if(!t.node)return;const d=t.context?.designSystem;d&&(0,v.pushConfig)(d);let i,g=!1;try{const _=wo(o,e,t),f=_?wt(_.block)+"::"+_.cssProp:null;if(f!==null&&f===c)g=!0;else if(c=f,_){const p=(0,q.css)({[_.cssProp]:_.block},null,t.context?.cssPrefix);i=p?p.split(" ").filter(Boolean):null}else i=null}finally{d&&(0,v.popConfig)()}if(!(g||!t.node.classList)){if(n)for(const _ of n)t.node.classList.remove(_);if(i&&i.length)for(const _ of i)t.node.classList.add(_);n=i}},{depth:s.path.length,label:j(s,"cssBlock("+o+")")});s.__effects.push(r)}}function vs(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const e of Object.keys(t)){const n=e.charAt(0);if(n!=="."&&n!=="!")continue;const c=e.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const a=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${n}\` is read as one prop name. Nest the selector inside instead: \`${n}${a}: { '${c.slice(a.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const d=n==="!",i={lastMatch:!1,appliedKeys:null,appliedClasses:null},g=new Set;for(const a in r){if(!Object.prototype.hasOwnProperty.call(r,a))continue;const h=a.charAt(0),u=r[a];(h===":"||h==="@"||h==="&"||h==="[")&&u&&typeof u=="object"&&!Array.isArray(u)||g.add(a)}const _=()=>{let a;const h=t[c];if(h===void 0){const b=!!t.state&&c in t.state,A=t.state?t.state[c]:void 0;if(b||A!==void 0)a=A;else{const k=t.context?.cases?.[c];if(k===void 0)return;try{a=typeof k=="function"?k.call(t,t):k}catch(S){a=!1,s.__conditionalError=S,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,S?.message||S)}}}else if(typeof h=="function")try{a=h(t,t.state,t.context)}catch(b){a=!1,s.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else a=h;const u=d?!a:!!a;if(!t.node||u===i.lastMatch)return;i.lastMatch=u;const l=t.context?.designSystem;l&&(0,v.pushConfig)(l);try{if(u){const b={},A={};let k=!1;for(const x in r){if(!Object.prototype.hasOwnProperty.call(r,x))continue;const L=r[x],U=x.charAt(0);if((U===":"||U==="@"||U==="&"||U==="[")&&L&&typeof L=="object"&&!Array.isArray(L)){if(Gt(x,t)){const O=rt(L,t,!1,g);Object.keys(O).length&&(A[`[data-theme="${x.slice(1)}"] &`]=O,k=!0)}else{const O=Ht(x,t),X=rt(L,t,!1,g);Object.keys(X).length&&(A[O]=X,k=!0)}continue}const M=typeof L=="function"?L(t,t.state,t.context):L;if(M!=null)if(C.CSS_PROPS_REGISTRY[x]){const O=C.CSS_PROPS_REGISTRY[x](M,t,t.state,t.context);if(O){const X=Array.isArray(O)?O:[O];for(const gt of X)gt&&Object.assign(b,gt)}}else(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(x)||Et(x))&&(b[x]=M)}const S=Object.keys(b);if(S.length){m(t.node,b);for(const x of S)o.set(x,e);i.appliedKeys=S}else i.appliedKeys=null;if(k){const x=(0,q.css)(A,null,t.context?.cssPrefix,{state:!0}),L=x?x.split(" ").filter(Boolean):[];if(L.length&&t.node.classList){for(const U of L)t.node.classList.add(U);i.appliedClasses=L}else i.appliedClasses=null}else if(i.appliedClasses){for(const x of i.appliedClasses)t.node.classList.remove(x);i.appliedClasses=null}}else{if(i.appliedKeys){for(const b of i.appliedKeys)o.get(b)===e&&(Et(b)?t.node.style.removeProperty(b):t.node.style[b]="",o.delete(b));i.appliedKeys=null}if(i.appliedClasses){for(const b of i.appliedClasses)t.node.classList.remove(b);i.appliedClasses=null}}}finally{l&&(0,v.popConfig)()}};s.__conditionalRunners.push(_);const f=D(t,t[c+"Deps"],_),p=(0,E.createEffect)(f,{depth:s.path.length,label:j(s,"conditional("+e+")")}),y=s.__exec&&s.__exec[c]||t[c];p._sources.size===0&&typeof y=="function"&&(0,tt.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 \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(p)}}const Wt=new WeakSet;function ks(t){const s=t.ownerDocument;!s||Wt.has(s)||(Wt.add(s),queueMicrotask(()=>{Wt.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const zt=new WeakSet;let vo=!1;function ko(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Yt(t,s){const o={...t};for(const e in s){const n=s[e],c=o[e];o[e]=n&&typeof n=="object"&&c&&typeof c=="object"?Yt(c,n):n}return o}function jo(t,s){const o={};for(const e in t){const n=t[e];if(n&&typeof n=="object"){const c=jo(n,s);Object.keys(c).length&&(o[e]=c)}else s.has(e)||(o[e]=n)}return o}function Eo(t){const{node:s}=t;if(!s)return;if(vo||(vo=!0,(0,q.css)({display:"none"})),zt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}zt.add(t);const o=t.context?.designSystem;o&&(0,v.pushConfig)(o),(0,C.pushStaticCssPass)();try{const e={};let n=!1,c=[],r=null,d=null,i=null;const g=(a,h)=>{if(h&&typeof h=="object"&&ko(a)){d||(d={});const u=d[a];u&&(h=Yt(u,h)),d[a]=h}else(h===null||typeof h!="object")&&(i||(i=new Set),i.add(a));e[a]=h};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&C.CSS_PROPS_REGISTRY.theme){const a=C.CSS_PROPS_REGISTRY.theme(t.theme,t,t.state,t.context);if(a){const h=u=>{for(const l in u){const b=u[l];b&&typeof b=="object"&&ko(l)&&(r||(r={}),r[l]=b),e[l]=b}};if(Array.isArray(a))for(const u of a)u&&h(u);else h(a);n=!0}}const _=(a,h)=>{if(C.CSS_PROPS_REGISTRY[a]){const u=C.CSS_PROPS_REGISTRY[a](h,t,t.state,t.context);if(u){if(Array.isArray(u)){for(const l of u)if(l)for(const b in l)g(b,l[b])}else for(const l in u)g(l,u[l]);n=!0}}else if(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(a))h!=null&&typeof h!="object"&&(g(a,h),n=!0);else if(a.charCodeAt(0)===45)h!=null&&typeof h!="object"&&(g(a,h),n=!0);else if((a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="[")&&h&&typeof h=="object"&&!Array.isArray(h)){if(Vt(h))return;const u=wo(a,h,t);u&&(g(u.cssProp,u.block),n=!0)}};if(typeof t.class=="string"){const a=Ss(t.class,t.context?.designSystem?.class);if(a)for(const h in a)_(h,a[h])}const f=i?new Set(i):null,p=t.tag||"div";for(const a of Object.keys(t)){if(typeof t[a]=="function"||K.REGISTRY.has(a)||a==="theme")continue;const h=a.charCodeAt(0);h>=65&&h<=90||Y(a)||(0,Z.isAttributeFirst)(p,a)||_(a,t[a])}if(r)for(const a in r){let h=i?jo(r[a],i):r[a];d&&d[a]&&(h=Yt(h,d[a])),Object.keys(h).length?e[a]=h:delete e[a]}if(_s(t,e,i,f),n){e.display&&String(e.display).includes("!important")&&(s.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const a=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof a=="string"&&a!==""&&e.display&&e.display!==a&&(e.display=a);const h=(0,q.css)(e,null,t.context?.cssPrefix);if(c=h?h.split(" ").filter(Boolean):[],h&&s.classList){const u=c;let l=!1;for(const b of u)s.classList.add(b),l||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(l=!0);l&&ks(s)}}const y=t.__ref;if(y){const a=y.__staticCssClasses;if(a&&s.classList){const h=new Set(c);for(const u of a)h.has(u)||s.classList.remove(u)}y.__staticCssClasses=c}gs(t)}finally{(0,C.popStaticCssPass)(),o&&(0,v.popConfig)(),zt.delete(t)}}const js=t=>!!C.CSS_PROPS_REGISTRY[t]||!!(C.DEFAULT_CSS_PROPERTIES_LIST&&C.DEFAULT_CSS_PROPERTIES_LIST.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Es(t){t&&t.node&&Eo(t)}function To(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const n in t.aria){const c=t.aria[n];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const r="aria-"+n.replace(/[A-Z]/g,d=>"-"+d.toLowerCase());s.setAttribute(r,(0,w.serializeAttrValue)(r,c))}const o=(0,w.applyAttrTransforms)(t);for(const n in o){const c=o[n];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(n,c===!0?"":c)}const e=t.tag||"div";for(const n of Object.keys(t)){if(typeof t[n]=="function"||K.REGISTRY.has(n)||n==="on"||o[n]!==void 0)continue;const c=n.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(n)&&!(0,Z.isCssProp)(e,n)&&(0,w.checkAttributeByTagName)(e,n)){let r=t[n];if(r==null)continue;if(typeof r=="string"&&r.includes("{{")){if(!w.ATTR_TRANSFORMS[n])continue;r=R.replaceLiteralsWithObjectFields.call(t,r,t.state)}if(r==null||typeof r=="function"||typeof r=="object"||r===!1&&!(0,w.isEnumeratedTrueFalseAttr)((0,w.camelToAttr)(n)||n))continue;const d=(0,w.camelToAttr)(n)||n;s.setAttribute(d,(0,w.serializeAttrValue)(d,r))}}}function Ts(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const e=s.charCodeAt(0);if(e>=65&&e<=90||Y(s))return;const n=t.tag||"div";if((0,Z.isCssProp)(n,s)||!(0,w.checkAttributeByTagName)(n,s))return;const c=(0,w.camelToAttr)(s)||s,r=c.toLowerCase(),d=t.__ref&&t.__ref.__effects;let i=!1;if(d)for(let f=0;f<d.length;f++){const p=d[f];p&&p._attrName===r&&!p._disposed&&typeof p._execute=="function"&&(i=!0,p._execute())}if(i)return;let g=t[s];const _=w.ATTR_TRANSFORMS[s];if(_&&g!=null){const f=_(t);f!==void 0&&(g=f)}typeof g=="string"&&g.includes("{{")&&(g=R.replaceLiteralsWithObjectFields.call(t,g,t.state)),g==null||g===!1&&!(0,w.isEnumeratedTrueFalseAttr)(c)?o.removeAttribute(c):typeof g!="function"&&typeof g!="object"&&o.setAttribute(c,(0,w.serializeAttrValue)(c,g))}function Ps(t,s){const o=t.node,e=t.__ref;let n=e.__autoGrow;if(!s){if(n&&n.active){try{o.removeEventListener("input",n.resize)}catch{}Pt(n),J.delete(t),o.style.height="",n.appliedMax!=null&&o.style.maxHeight===n.appliedMax&&(o.style.maxHeight=""),n.active=!1,n.appliedMax=null,n.lastMeasure=0}return}n||(n=e.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,layoutWatch:null,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!o.isConnected){qt(t,!0);return}if(!(o.scrollHeight>0)){Os(t,n);return}Pt(n);const r=o.style.height;o.style.height="auto";const d=o.scrollHeight;if(!(d>0)){o.style.height=r;return}o.style.height=d+"px",n.lastMeasure=d}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{o.removeEventListener("input",n.resize)}catch{}Pt(n),J.delete(t)})),n.active||(o.addEventListener("input",n.resize),n.active=!0);const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==n.appliedMax&&(c==null?n.appliedMax!=null&&o.style.maxHeight===n.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,n.appliedMax=c),n.resize()}function qt(t,s){const o=t.__ref?.__autoGrow;o&&(s&&(o.attachAttempts=0,o.firstAttemptAt=null),J.add(t),Ct())}function Ls(){const t=Array.from(J);J.clear();for(let s=0;s<t.length;s++){const o=t[s],e=o.node,n=o.__ref?.__autoGrow;if(!(!e||!n||!n.active)){if(!e.isConnected){n.firstAttemptAt==null&&(n.firstAttemptAt=nt()),n.attachAttempts+=1,n.attachAttempts<=eo&&nt()-n.firstAttemptAt<no&&(J.add(o),Ct());continue}n.attachAttempts=0,n.firstAttemptAt=null,n.resize()}}}function Os(t,s){if(s.layoutWatch)return;const o=t.node;if(!o)return;const e=o.ownerDocument&&o.ownerDocument.defaultView,n=e&&e.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof n!="function")return;const c=()=>{!o.isConnected||!(o.scrollHeight>0)||(Pt(s),qt(t,!0))};let r;try{r=new n(c),r.observe(o)}catch{return}s.layoutWatch=r}function Pt(t){const s=t.layoutWatch;if(s){t.layoutWatch=null;try{s.disconnect()}catch{}}}function Po(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,e=t.autoGrow,n=typeof e=="function"?D(t,t.autoGrowDeps,e):null,c=(0,E.createEffect)(()=>{const r=t.autoGrow;let d=r;if(typeof r=="function")try{d=(r===e&&n?n:r)(t,t.state,t.context)}catch{d=null}Ps(t,d)},{depth:o.path.length,label:j(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),n&&(o.__exec.autoGrow=e)}const Lo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Oo(t,s){for(const o of Object.keys(t)){if(!Y(o)||Lo.has(o))continue;const e=(0,ct.globalEventKeyInfo)(o);if(e){(0,ct.registerGlobalEvent)(e,t,t[o]);continue}let n=t[o];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){const r=n;n=function(i){return t.call(r,i)}}if(typeof n!="function")continue;const c=ts(o);K.LIFECYCLE_EVENTS.has(c)||(0,ct.registerEvent)(os(c),t,n)}Rs(t)}function Rs(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let e=!1;for(const p of Lo){const y=t[p];typeof y=="function"&&(o[p]=y,e=!0)}if(!e)return;const n=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let r=0,d=0,i=0,g=!1;const _=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(r=y.clientX,d=y.clientY,i=Date.now(),g=!0)},f=p=>{if(!g)return;g=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const a=y.clientX-r,h=y.clientY-d,u=Date.now()-i;if(u>c)return;const l=Math.abs(a),b=Math.abs(h);if(Math.max(l,b)<n)return;let A;if(l>b*1.2)A=a<0?"left":"right";else if(b>l*1.2)A=h<0?"up":"down";else return;const k="onSwipe"+A.charAt(0).toUpperCase()+A.slice(1),S=o[k],x=o.onSwipe;S&&S.call(t,p,t,t.state,t.context),x&&x.call(t,{direction:A,dx:a,dy:h,dt:u,event:p},t,t.state,t.context)};s.addEventListener("touchstart",_,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",_)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function ht(t,s){const o={...t};for(const e in s){const n=o[e],c=s[e];n&&c&&typeof n=="object"&&typeof c=="object"&&!Array.isArray(n)&&!Array.isArray(c)&&typeof n!="function"&&typeof c!="function"?o[e]=ht(n,c):o[e]=c}return o}function Zt(t,s,o,e){if(!s||!t.node)return;const n=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",r=t.context?.document||globalThis.document,d=c?null:r?.createDocumentFragment();if(!c&&!d)return;const i=t.childProps,g=t.childrenAs,_=u=>{let l=s[u];const b=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let A=i;if(typeof i=="function")try{A=i(t,l)}catch{A=null}if(g==="state"){let S=b;(typeof b=="string"||typeof b=="number")&&(S={value:b,text:b}),l=A?{...A,state:S}:{state:S}}else A&&(l=ht(A,l));if(n&&!l.ignoreChildExtends)if(l.extends){const S=Array.isArray(l.extends)?l.extends:[l.extends],x=Array.isArray(n)?n:[n];l={...l,extends:[...x,...S]}}else l={...l,extends:n};const k=io(l?.key,b,u);try{return Q(l,t,k,o)}catch(S){if(typeof console<"u"&&console.error){const x=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${x} (initial render, skipping this row):`,S?.message||S)}return null}},f=t.__ref;if(!(e===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let u=0;u<s.length;u++){const l=_(u);!c&&l?.node&&d.appendChild(l.node)}return c||t.node.appendChild(d),!0}const y=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;(0,G.openMountBudget)();let a=null;const h=u=>{if(f.__disposed||f.__childrenChunkGen!==y){a&&a.parentNode&&a.remove();return}for(let l=u;l<s.length;l++){const b=_(l);if(b?.node&&(a?t.node.insertBefore(b.node,a):d.appendChild(b.node)),l+1<s.length&&(0,G.mountBudgetExhausted)()){a||(a=r.createComment("smbls-mount"),d.appendChild(a),t.node.appendChild(d));const A=l+1;(0,G.enqueueMountWork)(()=>h(A));return}}a?(a.remove(),t.node.tagName==="SELECT"&&Lt(t,!0)):t.node.appendChild(d)};return h(0),(0,G.closeMountBudget)(),!0}if(typeof s=="string"){const c=co(s,t);if(Array.isArray(c))return Zt(t,c,o,e)}if(typeof s=="object")for(const c in s){if(K.REGISTRY.has(c))continue;let r=s[c];if(!(r==null||r===!1)){if((typeof r=="string"||typeof r=="number")&&(r={text:r}),t.childProps&&(r=ht(t.childProps,r)),n&&!r.ignoreChildExtends)if(r.extends){const d=Array.isArray(r.extends)?r.extends:[r.extends],i=Array.isArray(n)?n:[n];r={...r,extends:[...i,...d]}}else r={...r,extends:n};Q(r,t,c,o)}}}function Lt(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const e=o.options;if(!e||!e.length)return;const n=t.__ref,c=n&&n.__exec&&n.__exec.value,r=typeof c=="function",d=t.value!=null&&typeof t.value!="function";if(r||d){let _;if(r)try{_=c(t,t.state,t.context)}catch{return}else _=t.value,typeof _=="string"&&_.includes("{{")&&(_=R.replaceLiteralsWithObjectFields.call(t,_,t.state));const f=_==null?"":String(_);o.value!==f&&(o.value=f);return}const i=s||!(n&&n.__selectSynced);if(n&&(n.__selectSynced=!0),!i)return;let g=-1;for(let _=0;_<e.length;_++)e[_].defaultSelected&&(g=_);g>=0&&o.selectedIndex!==g&&(o.selectedIndex=g)}function Ro(t,s){let{children:o,content:e}=t;const n=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(u){if(o=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,u?.message||u)}}t.children=o;const p=t.__ref;let y=!1;const a=D(t,t.childrenDeps,f),h=(0,E.createEffect)(()=>{const u=y;y=!0;let l;try{l=a(t,t.state,t.context)}catch(M){if(typeof console<"u"&&console.error){const O=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${O}${u?"":" (initial tracking run)"}:`,M?.message||M)}return}if(!u||l===t.children)return;t.children=l,p.__childrenChunkGen!=null&&p.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",A=b?[]:null,k=b?[]:null,S=b?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const M=t.childProps,O=[],X=new Map;for(let T=0;T<l.length;T++){const H=l[T];let P=M;if(typeof M=="function")try{P=M(t,H)}catch{P=null}const z=io(P&&P.key,H,T);O.push(z),X.set(z,{rawChild:H,childProps:P})}const gt=new Set(O),Uo=p.__children.slice();for(const T of Uo)if(!gt.has(T)){const H=t[T];H?.remove&&H.remove(),delete t[T],k&&k.push(T)}const ft=t.childExtends,bt=t.tag==="fragment",Bo=t.context?.document||globalThis.document,at=bt?null:Bo?.createDocumentFragment(),Dt=new Set;for(const T of O){const H=X.get(T),P=H.rawChild,z=t[T];if(z&&z.state){if(P&&typeof P=="object"){const F=z.state,st=F.$replace||F.replace,Jt=F.$update||F.update;try{if(typeof st=="function")st.call(F,P);else if(typeof Jt=="function"){for(const B in F)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(P,B))try{F[B]=void 0}catch{}Jt.call(F,P)}else for(const B in P)F[B]=P[B]}catch(B){if(typeof console<"u"&&console.error){const Ko=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to patch at ${Ko} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}S&&S.push(T);continue}let Nt=P;(typeof P=="string"||typeof P=="number")&&(Nt={value:P,text:P});const Xt=H.childProps;let V=Xt?{...Xt,state:Nt}:{state:Nt};if(ft&&!V.ignoreChildExtends)if(V.extends){const F=Array.isArray(V.extends)?V.extends:[V.extends],st=Array.isArray(ft)?ft:[ft];V={...V,extends:[...st,...F]}}else V={...V,extends:ft};let Mt;try{Mt=Q(V,t,T,s)}catch(F){if(typeof console<"u"&&console.error){const st=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${T}" failed to construct at ${st} (reconcile, skipping this row):`,F?.message||F)}Dt.add(T);continue}!bt&&Mt?.node&&at&&at.appendChild(Mt.node),A&&A.push(T)}if(!bt&&at&&at.childNodes.length&&t.node&&t.node.appendChild(at),!bt&&t.node){let T=null;for(const H of O){const P=t[H]?.node;if(!P)continue;const z=T?T.nextSibling:t.node.firstChild;P!==z&&t.node.insertBefore(P,z),T=P}}p.__children=Dt.size?O.filter(T=>!Dt.has(T)):O,b&&(A.length||k.length)&&ro(t,{added:A,removed:k,kept:S}),Lt(t,!1);return}const U=b?[...p.__children]:null;for(const M of[...p.__children]){const O=t[M];O?.remove&&O.remove(),delete t[M]}p.__children=[],Zt(t,l,s),Lt(t,!1),b&&ro(t,{added:[...p.__children],removed:U,kept:[]})},{depth:p.path.length,label:j(p,"children")});p.__effects.push(h)}const c=Zt(t,o,s,!0);if(e!=null&&!(e&&e.__ref)){let f=e;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=ht(t.childProps,f)),n&&!f.ignoreChildExtends)if(f.extends){const p=Array.isArray(f.extends)?f.extends:[f.extends],y=Array.isArray(n)?n:[n];f={...f,extends:[...y,...p]}}else f={...f,extends:n};Q(f,t,"content",s)}if(o&&!c)return;const r=t.context?.components||{};{const f=Object.keys(t);for(let p=0;p<f.length;p++){const y=f[p];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const a=y.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const h={extends:t[y]};delete t[y];for(let u=p+1;u<f.length;u++){const l=f[u],b=l.charCodeAt(0);if(b>=65&&b<=90||K.REGISTRY.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const A=t[l];A!==void 0&&(h[l]=A,delete t[l])}t[a]&&typeof t[a]=="object"?t[a]={...h,...t[a]}:t[a]=h}}const d=s?.mountYield===!0||t.yieldChildren===!0,i=Object.keys(t),g=f=>{if(K.REGISTRY.has(f)||typeof t[f]!="object"||t[f]===null)return;const p=f.charCodeAt(0);if(p<65||p>90)return;let y=t[f];if(!y.__ref){if(!y.extends&&!y.extend){const a=r[f]||r[`smbls.${f}`];a&&(y={...y,extends:a})}if(t.childProps&&(y=ht(t.childProps,y)),n&&!y.ignoreChildExtends)if(y.extends){const a=Array.isArray(y.extends)?y.extends:[y.extends],h=Array.isArray(n)?n:[n];y={...y,extends:[...h,...a]}}else y={...y,extends:n};Q(y,t,f,s)}};if(!d){for(const f of i)g(f);return}(0,G.openMountBudget)();const _=f=>{for(let p=f;p<i.length;p++)if(g(i[p]),p+1<i.length&&(0,G.mountBudgetExhausted)()){const y=p+1;(0,G.enqueueMountWork)(()=>_(y));return}};_(0),(0,G.closeMountBudget)()}function Do(t,s,o){const{node:e}=t;if(!e)return;e.ref=t;const n=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(n){const r=n.parentNode;if(r){if(o?.position==="before"&&o.node)r.insertBefore(e,o.node);else if(o?.position==="after"&&o.node){const d=o.node.nextSibling;r.insertBefore(e,d||n)}else r.insertBefore(e,n);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(e,o.node);else if(o?.position==="after"&&o.node){const r=o.node.nextSibling;r?c.insertBefore(e,r):c.appendChild(e)}else c.appendChild(e)}const Rt=3;function Io(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Rt?!1:(t.__inBeforeUpdate=!0,!0)}function _t(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Rt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Rt}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function $(t,s,o){const e=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&(0,W.runPluginHook)(e,s,o);const n="on"+t,c=s[n];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(s.__ref[i])return!0;s.__ref[i]=!0}const g=s.context?.designSystem;g&&(0,v.pushConfig)(g);let _=!!i;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const p=s.__ref;return f.catch(y=>{s.context?.plugins?.length&&(0,W.runPluginHook)("error",s,{hook:n,error:y})||console.error(`[DOMQL] Lifecycle "${n}" error:`,y)}).finally(()=>{i&&p&&(p[i]=!1)}),_=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&(0,W.runPluginHook)("error",s,{hook:n,error:f})||console.error(`[DOMQL] Lifecycle "${n}" error:`,f),s.context?.strictMode)throw f}finally{g&&(0,v.popConfig)(),_&&s.__ref&&(s.__ref[i]=!1)}}return!0}var Ds=Q;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var w=(o,i)=>{for(var s in i)c(o,s,{get:i[s],enumerable:!0})},k=(o,i,s,m)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of f(i))!h.call(o,a)&&a!==s&&c(o,a,{get:()=>i[a],enumerable:!(m=u(i,a))||m.enumerable});return o};var y=o=>k(c({},"__esModule",{value:!0}),o);var x={};w(x,{CSS_LONGHAND_SHORTHANDS:()=>p,CSS_SHORTHAND_LONGHANDS:()=>n});module.exports=y(x);const t=(o,i)=>i.split(" ").map(s=>o+"-"+s),d="top right bottom left",g=d+" block block-start block-end inline inline-start inline-end",e="start end",r="width style color",l=o=>t(o,g),S=(()=>{const o=t("border","width style color image");for(const i of g.split(" "))o.push("border-"+i,...t("border-"+i,r));return o})(),b=o=>[...t("border-"+o,r+" start end"),...t("border-"+o+"-start",r),...t("border-"+o+"-end",r)],n={animation:t("animation","name duration timing-function delay iteration-count direction fill-mode play-state timeline range range-start range-end"),background:t("background","image position position-x position-y size repeat origin clip attachment color"),border:S};for(const o of["width","style","color"])n["border-"+o]=g.split(" ").map(i=>"border-"+i+"-"+o);for(const o of d.split(" "))n["border-"+o]=t("border-"+o,r);n["border-block"]=b("block"),n["border-inline"]=b("inline"),Object.assign(n,{"border-image":t("border-image","source slice width outset repeat"),"border-radius":"top-left top-right bottom-right bottom-left start-start start-end end-start end-end".split(" ").map(o=>"border-"+o+"-radius"),columns:t("column","width count"),"column-rule":t("column-rule",r),container:t("container","name type"),"contain-intrinsic-size":t("contain-intrinsic","width height"),flex:t("flex","grow shrink basis"),"flex-flow":t("flex","direction wrap"),font:[...t("font","style variant weight stretch size"),"line-height",...t("font","family size-adjust kerning feature-settings variation-settings optical-sizing")],gap:["row-gap","column-gap"],grid:t("grid","template template-rows template-columns template-areas auto-rows auto-columns auto-flow"),"grid-template":t("grid-template","rows columns areas"),"grid-area":t("grid","row column row-start row-end column-start column-end"),"grid-row":t("grid-row",e),"grid-column":t("grid-column",e),inset:[...d.split(" "),...t("inset","block block-start block-end inline inline-start inline-end")],"inset-block":t("inset-block",e),"inset-inline":t("inset-inline",e),"list-style":t("list-style","type position image"),margin:l("margin"),"margin-block":t("margin-block",e),"margin-inline":t("margin-inline",e),mask:t("mask","image mode repeat position clip origin size composite"),offset:t("offset","position path distance rotate anchor"),outline:t("outline",r),overflow:t("overflow","x y"),"overscroll-behavior":t("overscroll-behavior","x y"),padding:l("padding"),"padding-block":t("padding-block",e),"padding-inline":t("padding-inline",e)});for(const o of["content","items","self"])n["place-"+o]=["align-"+o,"justify-"+o];Object.assign(n,{"scroll-margin":l("scroll-margin"),"scroll-padding":l("scroll-padding"),"text-decoration":t("text-decoration","line style color thickness"),"text-emphasis":t("text-emphasis","style color"),transition:t("transition","property duration timing-function delay behavior")});const p={};for(const o in n)for(const i of n[o])(p[i]||(p[i]=[])).push(o);
|
package/dist/cjs/src/delegate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var T=(e
|
|
1
|
+
"use strict";var p=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},V=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of C(e))!S.call(t,o)&&o!==r&&p(t,o,{get:()=>e[o],enumerable:!(n=D(e,o))||n.enumerable});return t};var M=t=>V(p({},"__esModule",{value:!0}),t);var F={};T(F,{addDelegatedEvent:()=>b,globalEventKeyInfo:()=>R,isDelegatable:()=>h,registerEvent:()=>B,registerGlobalEvent:()=>W,removeDelegatedEvent:()=>v});module.exports=M(F);var l=require("./registry.js"),a=require("@symbo.ls/scratch");const E=new WeakMap,A={passive:!0},I={passive:!0,capture:!0},g=(t,e)=>l.PASSIVE_EVENTS.has(t)?e?I:A:e||!1;function y(t){let e=E.get(t);return e||(e={handlers:new Map,installed:new Set},E.set(t,e)),e}function x(t,e){const r=y(e);if(r.installed.has(t))return;r.installed.add(t);const n=t==="focus"||t==="blur"||t==="focusin"||t==="focusout"||t==="mouseenter"||t==="mouseleave"||t==="pointerenter"||t==="pointerleave",o=t==="mouseenter"||t==="mouseleave"||t==="pointerenter"||t==="pointerleave";e.addEventListener(t,i=>{if(o){const u=i.target,c=r.handlers.get(t),f=c&&u?c.get(u):null;if(!f||i.relatedTarget&&typeof u.contains=="function"&&u.contains(i.relatedTarget))return;f(i);return}let s=i.target;for(;s&&s!==e;){const u=r.handlers.get(t);if(u){const c=u.get(s);if(c&&(c(i),i.cancelBubble))return}s=s.parentNode}},g(t,n))}function b(t,e,r,n){n||(n=e.ownerDocument?.documentElement||e.getRootNode());const o=y(n);x(t,n),o.handlers.has(t)||o.handlers.set(t,new WeakMap),o.handlers.get(t).set(e,r)}function v(t,e,r){r||(r=e.ownerDocument?.documentElement||e.getRootNode());const n=E.get(r);if(!n)return;const o=n.handlers.get(t);o&&o.delete(e)}function h(t){return l.DELEGATED_EVENTS.has(t)&&!l.LIFECYCLE_EVENTS.has(t)}function w(t,e){const{context:r}=t,n=r?.designSystem;return o=>{n&&(0,a.pushConfig)(n);try{const i=e.call(t,o,t,t.state,r);if(i&&typeof i.then=="function"){i.catch(s=>{t.error=s,console.error("[DOMQL] Async event error:",s)}).finally(()=>{n&&(0,a.popConfig)()});return}}catch(i){if(t.error=i,console.error("[DOMQL] Event error:",i),r?.strictMode)throw i}n&&(0,a.popConfig)()}}function B(t,e,r){const{node:n,context:o}=e;if(!n)return;const i=w(e,r),s=l.NON_BUBBLING_EVENTS.has(t);if(!s&&h(t)){const u=o?.rootNode||n.ownerDocument?.documentElement;b(t,n,i,u)}else n.addEventListener(t,i,g(t,!1));e.__ref.__eventCleanup||(e.__ref.__eventCleanup=[]),e.__ref.__eventCleanup.push(()=>{if(!s&&h(t)){const u=o?.rootNode||n.ownerDocument?.documentElement;v(t,n,u)}else n.removeEventListener(t,i,g(t,!1))})}const _=[["onDocument","document"],["onWindow","window"],["onVisualViewport","visualViewport"],["onMediaQuery","mediaQuery"]];function R(t){if(typeof t!="string")return null;for(let e=0;e<_.length;e++){const r=_[e][0];if(t.length<=r.length||!t.startsWith(r))continue;const n=t.charCodeAt(r.length);if(!(n<65||n>90))return{target:_[e][1],eventName:t.slice(r.length).toLowerCase()}}return null}const q=/^[A-Za-z_$][\w$]*$/;function G(t,e,r){let n=e,o=!1,i,s=!1,u=null;if(e&&typeof e=="object"&&typeof e!="function"&&(n=e.handler,o=!!e.capture,s=!!e.once,typeof e.passive=="boolean"&&(i=e.passive),typeof e.query=="string"&&(u=e.query)),typeof n=="string"&&q.test(n)){const c=n;n=function(d){return t.call(c,d)}}return typeof n!="function"?null:(i===void 0&&(i=l.PASSIVE_EVENTS.has(r)),{handler:n,capture:o,passive:i,once:s,query:u})}function Q(t,e,r){const n=t.node?.ownerDocument||t.context?.document||(typeof document<"u"?document:null);if(!n||typeof n.addEventListener!="function")return null;if(e==="document")return n;const o=n.defaultView||(typeof window<"u"?window:null);if(!o)return null;if(e==="window")return typeof o.addEventListener=="function"?o:null;if(e==="visualViewport"){const i=o.visualViewport;return i&&typeof i.addEventListener=="function"?i:null}if(e==="mediaQuery"){const i=r&&r.query;if(typeof i!="string"||!i.trim()||typeof o.matchMedia!="function")return null;try{return o.matchMedia(i)||null}catch{return null}}return null}function m(t,e,r,n){try{return t.addEventListener(e,r,n),!0}catch{return typeof t.addListener=="function"?(t.addListener(r),!0):!1}}function O(t,e,r,n){try{t.removeEventListener(e,r,n)}catch{typeof t.removeListener=="function"&&t.removeListener(r)}}function P(t){const e=t.node;if(!e)return!1;const r=e.nodeType===11?t.__ref?.__fragmentAnchor:e;return r?r.isConnected!==!1:!1}function W(t,e,r){if(e.__ref){if(Array.isArray(r)){if(t.target!=="mediaQuery")return;for(let o=0;o<r.length;o++)L(t,e,r[o]);return}L(t,e,r)}}function L(t,e,r){const n=e.__ref,o=G(e,r,t.eventName);if(!o||t.target==="mediaQuery"&&t.eventName!=="change")return;const i=Q(e,t.target,o);if(!i)return;const s=t.target+":"+(o.query?o.query+":":"")+t.eventName+":"+(o.capture?1:0);if(n.__globalEvents&&n.__globalEvents.has(s))return;const u=w(e,o.handler),c=d=>{P(e)&&u(d)},f={capture:o.capture,passive:o.passive,once:o.once};m(i,t.eventName,c,f)&&(n.__globalEvents||(n.__globalEvents=new Map),n.__globalEvents.set(s,{target:i,eventName:t.eventName,listener:c,options:f}),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{O(i,t.eventName,c,f),n.__globalEvents&&n.__globalEvents.delete(s)}))}
|
package/dist/cjs/src/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var
|
|
1
|
+
"use strict";var h=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var P=(o,r)=>{for(var e in r)h(o,e,{get:r[e],enumerable:!0})},U=(o,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of g(r))!A.call(o,c)&&c!==e&&h(o,c,{get:()=>r[c],enumerable:!(i=b(r,c))||i.enumerable});return o};var v=o=>U(h({},"__esModule",{value:!0}),o);var k={};P(k,{default:()=>j,update:()=>p});module.exports=v(k);var u=require("@symbo.ls/signal"),_=require("./registry.js"),f=require("./create.js"),y=require("@symbo.ls/utils/function.js"),a=require("attrs-in-props");function p(o={},r={}){const e=this,i=e.__ref;if(!i)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!r.preventListeners&&typeof e.onBeforeUpdate=="function"&&(0,f.acquireBeforeUpdateGuard)(i))try{const t=e.onBeforeUpdate(e,e.state,e.context,r);if(t&&typeof t.then=="function")t.then(()=>(0,f.releaseBeforeUpdateGuard)(i,!1),n=>{(0,f.releaseBeforeUpdateGuard)(i,!0),e.context?.plugins?.length&&(0,y.runPluginHook)("error",e,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if((0,f.releaseBeforeUpdateGuard)(i,!1),t===!1)return e}catch(t){throw(0,f.releaseBeforeUpdateGuard)(i,!0),t}const c=!o||Object.keys(o).length===0,l=[];(0,u.batch)(()=>{if(o.state&&(0,u.isStore)(e.state)&&e.state.$update(o.state),o.text!==void 0&&(e.text=o.text,!i.__exec.text&&e.node&&(0,f.writeElementText)(e,o.text??"")),o.html!==void 0&&(e.html=o.html,!i.__exec.html&&e.node&&(e.node.innerHTML=o.html)),o.style&&e.node?.style){if(!i.__exec.style)for(const t in o.style){const n=o.style[t];if(n==null)continue;const s=t.replace(/[A-Z]/g,x=>"-"+x.toLowerCase()),d=String(n).replace(/\s*!important\s*$/,"");e.node.style.setProperty(s,d,"important")}e.style||(e.style={}),Object.assign(e.style,o.style)}if(o.attr&&e.node?.setAttribute){for(const t in o.attr){const n=o.attr[t];n==null||n===!1&&!(0,a.isEnumeratedTrueFalseAttr)(t)?e.node.removeAttribute(t):typeof n!="function"&&typeof n!="object"&&e.node.setAttribute(t,(0,a.serializeAttrValue)(t,n))}e.attr||(e.attr={}),Object.assign(e.attr,o.attr)}if(o.data&&e.node?.dataset){for(const t in o.data)e.node.dataset[t]=o.data[t];e.data||(e.data={}),Object.assign(e.data,o.data)}for(const t in o){if(_.REGISTRY.has(t)||t==="state")continue;const n=o[t],s=e[t];if(s&&s.__ref&&typeof s.update=="function")s.update(n,r);else if(typeof n=="object"&&n!==null){const d=t.charCodeAt(0);d>=65&&d<=90&&(0,f.create)(n,e,t,r)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=n,typeof n!="function"&&l.push(t))}});for(let t=0;t<l.length;t++)(0,f.reconcileAttrProp)(e,l[t]);if(e.node){for(let t=0;t<l.length;t++)if((0,f.isStaticCssProp)(l[t])){(0,f.recompileStaticCss)(e);break}}if(e.node&&c&&i.__effects&&i.__effects.length)for(let t=0;t<i.__effects.length;t++){const n=i.__effects[t];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(e.node&&i.__conditionalRunners)for(const t of i.__conditionalRunners)t();return(0,y.runPluginHook)("update",e),!r.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,r),e}var j=p;
|
package/dist/cjs/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},I=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of s(o))!x.call(t,c)&&c!==e&&n(t,c,{get:()=>o[c],enumerable:!(p=r(o,c))||p.enumerable});return t};var N=t=>I(n({},"__esModule",{value:!0}),t);var R={};E(R,{VERSION:()=>O});module.exports=N(R);const O="3.14.
|
|
1
|
+
var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},I=(t,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of s(o))!x.call(t,c)&&c!==e&&n(t,c,{get:()=>o[c],enumerable:!(p=r(o,c))||p.enumerable});return t};var N=t=>I(n({},"__esModule",{value:!0}),t);var R={};E(R,{VERSION:()=>O});module.exports=N(R);const O="3.14.792";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{checkAttributeByTagName as s}from"attrs-in-props";import{CSS_PROPS_REGISTRY as S,DEFAULT_CSS_PROPERTIES_LIST as r}from"css-in-props";const T=new Set(["rows","cols","wrap"]),e=(o,t)=>T.has(t)&&s(o,t),p=(o,t)=>!!(S[t]||r&&r.has(t))&&!e(o,t);export{T as ATTRIBUTE_FIRST_KEYS,e as isAttributeFirst,p as isCssProp};
|
package/dist/esm/src/create.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{createStore as
|
|
2
|
-
`+
|
|
1
|
+
import{createStore as Mt,createScopeStore as Zo,isStore as q}from"@symbo.ls/signal";import{createEffect as v}from"@symbo.ls/signal";import{cacheNode as Ft,detectTag as so}from"./cache.js";import{REGISTRY as W,LIFECYCLE_EVENTS as Qo}from"./registry.js";import{registerEvent as Xo,registerGlobalEvent as Jo,globalEventKeyInfo as mo}from"./delegate.js";import{applyExtends as ts}from"./extends.js";import{addMethods as os}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as tt}from"./devRuntime.js";import{mountBudgetExhausted as eo,openMountBudget as no,closeMountBudget as ro,enqueueMountWork as io}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as $,isPolyglotWritableKey as ss,markPolyglotSeeded as es}from"@symbo.ls/utils";import*as At from"@symbo.ls/utils";import{runPluginHook as z}from"@symbo.ls/utils/function.js";import{applyStateMethods as it}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as R,DEFAULT_CSS_PROPERTIES_LIST as D,pushStaticCssPass as co,popStaticCssPass as fo}from"css-in-props";import{css as ct,wrapHoverRule as ao}from"@symbo.ls/css";import{pushConfig as N,popConfig as M}from"@symbo.ls/scratch";import{checkAttributeByTagName as ft,applyAttrTransforms as ns,ATTR_TRANSFORMS as $t,camelToAttr as at,serializeAttrValue as H,isEnumeratedTrueFalseAttr as ut}from"attrs-in-props";import{resolveElementIdEngine as rs}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as uo}from"./cssLonghands.js";import{isAttributeFirst as lo,isCssProp as lt}from"./attributeFirst.js";import{VERSION as is}from"./version.js";const po=rs({uniqId:1,scopedStyleId:0},is),dt=[],Q=new Set;let It=!1,ho=0,ot=null,pt=null;function st(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function yo(){return typeof document<"u"&&document.visibilityState==="hidden"}const cs=250,fs=1e3;function as(){return pt&&(pt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||yo())?!0:st()-ho>=fs}function us(){if(It=!0,ho=st(),pt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ut,0);ot=t?()=>t(s):null;return}if(yo()){const t=typeof clearTimeout=="function"?clearTimeout:null,s=setTimeout(Ut,cs);ot=t?()=>t(s):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;pt=requestAnimationFrame;const s=requestAnimationFrame(Ut);ot=t?()=>t(s):null}}function xt(){if(It){if(!as())return;const t=ot;if(ot=null,t)try{t()}catch{}}us()}const _o=300,go=15e4;function Ut(){if(It=!1,ot=null,pt=null,Q.size&&Is(),!dt.length)return;const t=dt.splice(0,dt.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.node){if(!o.node.isConnected){const e=o.__ref||(o.__ref={});e.__mountAttempts=(e.__mountAttempts||0)+1,e.__mountFirstAttemptAt==null&&(e.__mountFirstAttemptAt=st());const r=st()-e.__mountFirstAttemptAt;e.__mountAttempts<=_o&&r<go?(dt.push(o),xt()):console.warn("[DOMQL] onMounted dropped after",e.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",o.key||o.tag||o);continue}F("Mounted",o,o.__ref?.__mountOptions||{})}}}function Bt(t,s){const o=t.__ref?.__autoGrow;o&&o.active&&Xt(t,!0),typeof t.onMounted=="function"&&(t.__ref.__mountOptions=s,dt.push(t),xt())}function bo(t,s){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&z("contentUpdate",t,s);const o=t.context?.designSystem;o&&N(o);try{t.onContentUpdate(t,t.state,t.context,s)}catch(e){if(t.context?.plugins?.length&&z("error",t,{hook:"onContentUpdate",error:e})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',e),t.context?.strictMode)throw e}finally{o&&M()}}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function ls(t){return t.charAt(2).toLowerCase()+t.slice(3)}function ds(t){return t.toLowerCase()}function Kt(t){const s=t.charCodeAt(0);return s===58||s===64||s===38||s===91}function ht(t,s){const o={...t};for(const e in s){const r=o[e],c=s[e];r&&c&&typeof r=="object"&&typeof c=="object"&&!Array.isArray(r)&&!Array.isArray(c)&&typeof r!="function"&&typeof c!="function"?o[e]=ht(r,c):o[e]=c}return o}function Ct(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Ao(t,s,o){return Ct(t)||(s&&typeof s=="object"?Ct(s.key):void 0)||String(o)}function X(t,s,o,e={},r){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t}),o=Ct(o);const c=Ct(t.key),n=Object.create(null);n.key=o||c||`_${po.uniqId++}`,n.parent=s||null,n.context=t.context||s?.context||e.context||{},n.context.__create||(n.context.__create=X);const d=n.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:s?.__ref?.root||n,path:s?.__ref?.path?[...s.__ref.path,n.key]:[n.key],origin:t};if(o&&!t.extends&&!t.extend){const u=o.indexOf("_"),l=o.indexOf(".");let b=u>0?u:-1;if(l>0&&(b<0||l<b)&&(b=l),b>0){const A=o.substring(0,b),S=n.context?.components;S&&(S[A]||S["smbls."+A])?t={...t,extends:A}:S&&tt()&&(/^[A-Z]\w*_\d+$/.test(o)||/^[A-Z]\w*\.\w+$/.test(o))&&console.warn(`[smbls] auto-extend: key "${o}" looks like an instance of "${A}" but neither "${A}" nor "smbls.${A}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}ts(n,t,e);const i=new Set(["childProps","attr","style","scope","data"]),g=n.props&&typeof n.props=="object"?n.props:null;for(const u in t){if(u==="parent"||u==="node"||u==="__ref"||u==="extends"||u==="context"||u==="props")continue;if(u==="key"){c&&(n.key=c);continue}const l=t[u],b=n[u],A=b&&l&&typeof b=="object"&&typeof l=="object"&&!Array.isArray(b)&&!Array.isArray(l)&&typeof b!="function"&&typeof l!="function";A&&u.charCodeAt(0)>=65&&u.charCodeAt(0)<=90?n[u]=ht(b,l):A&&i.has(u)?n[u]={...b,...l}:A&&Kt(u)?n[u]=ht(b,l):n[u]=l}function _(u){for(const l in u){const b=u[l],A=n[l],S=A&&b&&typeof A=="object"&&typeof b=="object"&&!Array.isArray(A)&&!Array.isArray(b)&&typeof A!="function"&&typeof b!="function";S&&l.charCodeAt(0)>=65&&l.charCodeAt(0)<=90?n[l]=ht(A,b):S&&i.has(l)?n[l]={...A,...b}:S&&Kt(l)?n[l]=ht(A,b):n[l]=b}}g&&_(g),t.props&&typeof t.props=="object"&&_(t.props),t.classlist!==void 0&&(n.classlist=t.classlist),t.text!==void 0&&(n.text=t.text),t.html!==void 0&&(n.html=t.html);const f=n.scope&&typeof n.scope=="object"?n.scope:null,p=s?.scope,y=n.context&&typeof n.context.globalScope=="object"&&n.context.globalScope||null,a=p||y||null;if(t.scope!==void 0||f){const u={};f&&Object.assign(u,f),t.scope!==void 0&&Object.assign(u,t.scope),n.scope=Zo(u,a)}else a&&(n.scope=a);if(t.if!==void 0&&(n.if=t.if),os(n),ps(n,s,t),n.if!=null){let u;if(typeof n.if=="function")try{u=n.if(n,n.state,n.context)}catch(l){if(u=!1,d.__ifError=l,typeof console<"u"&&console.warn){const b=n.key||n.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${b} \u2014 treating as false:`,l?.message||l)}}else u=n.if;d.__if=!!u}if(d.__if)typeof n.if=="function"&&(d.__ifInitialized=!0);else return s&&(s[n.key]=n),typeof n.if=="function"&&jo(n,d,n.if),n;n.tag||(n.tag=so(n)),F("Init",n,e);const h=n.node=Ft(n);if(!h)return n;if(n.tag==="fragment"){const l=(n.context?.document||globalThis.document).createComment("");h.appendChild(l),d.__fragmentAnchor=l}F("AttachNode",n,e),h.setAttribute&&n.key&&h.setAttribute("data-key",n.key),s&&(s[n.key]=n,s.__ref?.__children&&(s.__ref.__children.includes(n.key)||s.__ref.__children.push(n.key))),h.setAttribute&&n.context?.scopeSelector&&n.context.scopeSelector!==":root"&&n.context.key&&n.key===n.context.key&&h.setAttribute("data-smbls-app",n.context.key),n.id&&h.setAttribute&&(h.id=n.id),Ho(n,e),vo(n),Ht(n),Bo(n),Ko(n);try{Vo(n,e)}catch(u){if(typeof console<"u"&&console.error){const l=n.__ref?.path?.join(".")||n.key||"<root>";console.error(`[smbls] createChildren failed at ${l}:`,u?.message||u,u?.stack?`
|
|
2
|
+
`+u.stack.split(`
|
|
3
3
|
`).slice(0,6).join(`
|
|
4
|
-
`):"")}}if(Ct(e,!0),Ro(e,s,r),typeof e.html=="function"&&e.node&&!e.node.innerHTML){const p=e.context?.designSystem;p&&R(p);try{const y=e.html(e,e.state,e.context);y!=null&&typeof y!="function"&&(e.node.innerHTML=y)}catch{}finally{p&&M()}}if($("Create",e,n),$("Complete",e,n),$("Render",e,n),$("RenderRouter",e,n),Rt(e,n),typeof e.onFrame=="function"){const p=e.onFrame,y=e.context?.designSystem,_=()=>{if(e.node){if(e.node.isConnected){y&&R(y);try{p(e,e.state,e.context)}catch(x){console.error("[DOMQL] onFrame error:",x)}finally{y&&M()}}requestAnimationFrame(_)}};requestAnimationFrame(_)}return e}function ss(t,s,o){const n=!s,r=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=n&&r&&t.context?.state,e=o.state!==void 0&&!c?o.state:t.state&&!Z(t.state)?t.state:void 0;if(e==null){if(s?.state)t.state=s.state,et(t,t.state);else if(t.context?.state){const i=t.context.state,d={...i},g=t.context?.polyglot;if(g?.translations){const a=t.context,f=i.lang||g.defaultLang||"en",l=new Set,u=(p,y)=>{l.has(p)||Wo(a,p,d)&&(d[p]=y,l.add(p),zo(a,p))},h=g.translations[f];if(h&&typeof h=="object")for(const p in h)u(p,h[p]);const b=new Set(g.languages||[]);for(const p in g.translations)b.has(p)||u(p,g.translations[p])}t.state=Z(d)?d:Pt(d),t.state.__element=t,t.state.root=t.state,et(t,t.state),ht.promoteActiveRootState?.(i,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),et(t,t.state);return}if(typeof e=="string"){if(t.state=fo(e,s),t.state&&typeof t.state=="object"&&!Z(t.state)){const i=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}et(t,t.state);return}if(typeof e=="function"){const i=e(t,s?.state);t.state=Z(i)?i:Pt(i||{})}else Z(e)?t.state=e:t.state=Pt({...e});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,et(t,t.state),ht.promoteActiveRootState?.(e,t.state)}function $t(t,s){if(!s)return t;const o=s.split("/");let n=t;for(const r of o){if(n==null)return{};n=n[r]}return n??{}}function fo(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?$t(s.state,r):s.state??{}}if(t.startsWith("~/")){const r=s.state?.root||s.state,c=t.slice(2);return c?$t(r,c):r??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=$t(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const n=s.context?.polyglot;if(n?.translations){const r=s.state?.root?.lang||n.defaultLang||"en",c=n.translations[r];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const es=new Set(["s","state","ctx","context"]);function ns(t){try{const o=(typeof ht.getFunctionSource=="function"?ht.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function rs(t){if(typeof t!="function"||t.length!==2)return!1;const s=ns(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!es.has(o)}function is(t){const s=t.__ref,o=t.tag||"div",n=t.context?.designSystem,r=[],c=Object.keys(t);for(let e=0;e<c.length;e++){const i=c[e];if(typeof t[i]!="function"||G.has(i))continue;const d=i.charCodeAt(0);d>=65&&d<=90||z(i)||P[i]||E&&E.has(i)||rt(o,i)||(m()&&rs(t[i])&&console.warn(`[smbls] custom prop "${i}"${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('${i}', \u2026) instead of reading el.${i}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:i,fn:t[i]}))}for(let e=0;e<r.length;e++){const{prop:i,fn:d}=r[e];s.__exec[i]=d,Object.defineProperty(t,i,{get(){n&&R(n);try{return d(t,t.state,t.context)}catch{return}finally{n&&M()}},set(g){delete s.__exec[i],Object.defineProperty(t,i,{value:g,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function cs(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const n=s[o];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function O(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...n){return cs(t,s),o.apply(this,n)}}function dt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function S(t,s){return()=>t.path.join(".")+"::"+s}const lo=new Set;function I(t,s,o){if(!m())return;const n=S(t,s)();lo.has(n)||(lo.add(n),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const uo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,as=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;uo.lastIndex=0;let n;for(;(n=uo.exec(o))!==null;)n[2].includes("{{")&&s.add(n[2])},fs=t=>!z(t)&&!P[t]&&!(E&&E.has(t)),po=(t,s,o)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&fs(t)&&as(s,o)},ds=["attr","aria","data"],ls=t=>{if(ds.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},us=t=>{const s=new Set;for(const o of Object.keys(t)){const n=Object.getOwnPropertyDescriptor(t,o),r=n&&n.value;if(r&&typeof r=="object"&&!Array.isArray(r)){if(!ls(o))continue;for(const c in r)po(c,r[c],s);continue}po(o,r,s)}return s};function ho(t,s){const o=t.__ref,n=!!(s&&s.skipIfEffect),r=us(t);if(o.__authoredTemplates)for(const i of r)o.__authoredTemplates.add(i);else o.__authoredTemplates=r;if(is(t),typeof t.text=="function"){const i=t.text,d=O(t,t.textDeps,i),g=C(()=>{if(!o.contentManaged)try{let a=d(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=F.call(t,a,t.state)),gt(t,a))}catch(a){I(o,"text",a)}},{depth:o.path.length,label:S(o,"text")});o.__effects.push(g),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,d=C(()=>{if(o.contentManaged)return;const g=F.call(t,i,t.state);g!=null&&(t.text=g),t.node&>(t,g??"")},{depth:o.path.length,label:S(o,"text")});o.__effects.push(d),o.__exec.text=i}for(const i of Object.keys(t))if(typeof t[i]=="function"&&!G.has(i)&&!z(i)&&!o.__exec[i]){if(P[i]){const d=t[i],g=O(t,t[i+"Deps"],d),a=i;let f,l=null,u=null,h;const b=C(()=>{const p=t.context?.designSystem;p&&R(p);try{const y=g(t,t.state,t.context);to();let _;try{_=P[a](y,t,t.state,t.context)}finally{oo()}if(Array.isArray(_)){const A={};for(const k of _)if(k)for(const w in k)A[w]=k[w];_=A}const x=a==="show"||a==="hide";if(_&&t.node&&ps(_)){const A=_t(_);if(A===null||A!==h){h=A;const k=nt(_,null,t.context?.cssPrefix),w=k?k.split(" ").filter(Boolean):null;if(t.node.classList){if(u)for(const L of u)t.node.classList.remove(L);if(w&&w.length)for(const L of w)t.node.classList.add(L);u=w}}f=void 0,l=null}else if(_&&t.node){if(u){for(const k of u)t.node.classList.remove(k);u=null,h=void 0}const A=_t(_);if(A===null||A!==f||!At(t.node,l)){f=A;const k=wo(t,_);l=bt(t.node,k)}}else if(t.node&&x){f=void 0,l=null;const A=o.__explicitDisplay;t.node.style.display=typeof A=="string"?A:""}}finally{p&&M()}},{depth:o.path.length,label:S(o,a)});o.__effects.push(b),o.__exec[i]=d}else if(E&&E.has(i)){const d=t[i],g=O(t,t[i+"Deps"],d),a=i;let f,l=null;const u=C(()=>{const h=t.context?.designSystem;h&&R(h);try{const b=g(t,t.state,t.context);if(t.node)if(b!=null){const p=a+":"+String(b);if(p!==f||!At(t.node,l)){f=p;const y={[a]:b},_=wo(t,y);l=bt(t.node,_)}}else f=void 0,l=null,t.node.style[a]=""}finally{h&&M()}},{depth:o.path.length,label:S(o,a)});o.__effects.push(u),o.__exec[i]=d}}if(typeof t.html=="function"){const i=t.html,d=O(t,t.htmlDeps,i),g=C(()=>{const a=t.context?.designSystem;a&&R(a);try{const f=d(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&(t.node.innerHTML=f)}finally{a&&M()}},{depth:o.path.length,label:S(o,"html")});o.__effects.push(g),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,d=O(t,t.valueDeps,i),g=C(()=>{try{let a=d(t,t.state,t.context);typeof a=="string"&&a.includes("{{")&&(a=F.call(t,a,t.state)),_o(t,a)}catch(a){I(o,"value",a)}},{depth:o.path.length,label:S(o,"value")});o.__effects.push(g),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,d=C(()=>{try{_o(t,F.call(t,i,t.state))}catch(g){I(o,"value",g)}},{depth:o.path.length,label:S(o,"value")});o.__effects.push(d),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,d=O(t,t.styleDeps,i);let g,a=null;const f=C(()=>{const l=d(t,t.state,t.context),u=_t(l);(u===null||u!==g||!At(t.node,a))&&(g=u,hs(t.node,a,l),X(t.node,l),a=bt(t.node,l))},{depth:o.path.length,label:S(o,"style")});o.__effects.push(f),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const d=t.style[i];if(typeof d!="function")continue;const g=O(t,dt(t.styleDeps,i),d);let a,f=null;const l=C(()=>{try{const u=g(t,t.state,t.context);if(t.node){const h=i+":"+String(u);if(h!==a||!At(t.node,f)){a=h;const b={[i]:u};X(t.node,b),f=bt(t.node,b)}}}catch(u){I(o,"style."+i,u)}},{depth:o.path.length,label:S(o,"style."+i)});o.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const d=O(t,dt(t.attrDeps,i),t.attr[i]),g=i,a=C(()=>{try{let f=d(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=F.call(t,f,t.state)),t.node?.setAttribute&&(f==null||f===!1&&!ct(g)?t.node.removeAttribute(g):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(g,K(g,f)))}catch(f){I(o,"attr."+g,f)}},{depth:o.path.length,label:S(o,"attr."+g)});a._attrName=g.toLowerCase(),o.__effects.push(a)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const d=t.attr[i],g=i,a=C(()=>{try{const f=F.call(t,d,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,K(g,f??""))}catch(f){I(o,"attr."+g,f)}},{depth:o.path.length,label:S(o,"attr."+g)});a._attrName=g.toLowerCase(),o.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const d=t.aria[i];if(typeof d=="string"&&d.includes("{{")){const l=d,u="aria-"+i.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),h=C(()=>{try{const b=F.call(t,l,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,K(u,b??""))}catch(b){I(o,"aria."+i,b)}},{depth:o.path.length,label:S(o,"aria."+i)});h._attrName=u,o.__effects.push(h);continue}if(typeof d!="function")continue;const g=O(t,dt(t.ariaDeps,i),t.aria[i]),a="aria-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),f=C(()=>{try{const l=g(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null?t.node.removeAttribute(a):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(a,K(a,l))}catch(l){I(o,"aria."+i,l)}},{depth:o.path.length,label:S(o,"aria."+i)});f._attrName=a,o.__effects.push(f)}if(t.data&&typeof t.data=="object")for(const i in t.data){const d=t.data[i];if(typeof d=="string"&&d.includes("{{")){const u=d,h="data-"+i.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),b=C(()=>{try{const p=F.call(t,u,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(h,p??"")}catch(p){I(o,"data."+i,p)}},{depth:o.path.length,label:S(o,"data."+i)});b._attrName=h,o.__effects.push(b);continue}if(typeof d!="function")continue;const g=O(t,dt(t.dataDeps,i),t.data[i]),f="data-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),l=C(()=>{try{const u=g(t,t.state,t.context);if(!t.node?.setAttribute)return;u==null||u===!1?t.node.removeAttribute(f):typeof u!="function"&&typeof u!="object"&&t.node.setAttribute(f,u===!0?"":u)}catch(u){I(o,"data."+i,u)}},{depth:o.path.length,label:S(o,"data."+i)});l._attrName=f,o.__effects.push(l)}const c=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(c)for(const i in c){if(typeof c[i]!="function")continue;const d=O(t,dt(t.classDeps,i),c[i]),g=C(()=>{try{const a=d(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(i):t.node.classList.remove(i)}catch(a){I(o,"class."+i,a)}},{depth:o.path.length,label:S(o,"class."+i)});o.__effects.push(g)}!n&&typeof t.if=="function"&&go(t,o,t.if);for(const i of Object.keys(t)){if(G.has(i)||typeof t[i]!="function")continue;const d=i.charCodeAt(0);if(d>=65&&d<=90||z(i))continue;const g=t[i];o.__exec[i]=g;const a=t.tag||"div";if(rt(a,i)&&!P[i]&&!(E&&E.has(i))){const f=it(i)||i,l=O(t,t[i+"Deps"],g),u=C(()=>{try{let h=l(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=F.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!ct(f)?t.node.removeAttribute(f):typeof h!="function"&&typeof h!="object"&&(f==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(f,K(f,h))))}catch(h){I(o,i,h)}},{depth:o.path.length,label:S(o,i)});u._attrName=f.toLowerCase(),o.__effects.push(u)}}const e=t.tag||"div";for(const i of Object.keys(t)){if(G.has(i))continue;const d=t[i];if(typeof d!="string"||!d.includes("{{"))continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||z(i)||P[i]||E&&E.has(i)||Ot[i]||!rt(e,i))continue;const a=it(i)||i,f=C(()=>{try{const l=F.call(t,d,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,K(a,l??""))}catch(l){I(o,i,l)}},{depth:o.path.length,label:S(o,i)});f._attrName=a.toLowerCase(),o.__effects.push(f)}if(ks(t),Cs(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,d=t.stateDeps;let g=!1,a=[];const f=C(()=>{const l=[];for(let p=0;p<d.length;p++){const y=d[p];try{l[p]=typeof y=="function"?y(t,t.state,t.context):t.state?.[y]}catch{l[p]=void 0}}if(!g){g=!0,a=l;return}let u=l.length!==a.length;for(let p=0;!u&&p<l.length;p++)l[p]!==a[p]&&(u=!0);const h=a;if(a=l,!u)return;const b=t.context?.designSystem;b&&R(b);try{i(t,t.state,t.context,{prev:h,next:l})}catch(p){if(t.context?.plugins?.length&&W("error",t,{hook:"onStateUpdate",error:p})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',p),t.context?.strictMode)throw p}finally{b&&M()}},{depth:o.path.length,label:S(o,"onStateUpdate")});o.__effects.push(f)}Ss(t)}function yo(t){const s=t.parent,o=s?.node;if(!o||!t.node){Ro(t,t.parent);return}let n=null;const r=Object.keys(s),c=r.indexOf(t.key);for(let e=c+1;e<r.length;e++){const i=s[r[e]];if(i?.node?.parentNode===o){n=i.node;break}}n?o.insertBefore(t.node,n):o.appendChild(t.node)}function go(t,s,o){const n=O(t,t.ifDeps,o),r=C(()=>{let c;try{c=n(t,t.state,t.context)}catch(i){if(c=!1,s.__ifError=i,typeof console<"u"&&console.warn){const d=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${d} \u2014 treating as false:`,i?.message||i)}return}const e=s.__if;if(s.__if=!!c,e&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(i){console.error("[smbls] onRemove error:",i)}}else if(!e&&s.__if)if(s.__ifInitialized)t.node||(t.node=Lt(t)),t.node&&(t.node.ref=t),yo(t),Ft(t),$("Render",t,{}),Rt(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=qt(t)),$("Init",t,{}),t.node||(t.node=Lt(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const d=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(d),s.__fragmentAnchor=d}$("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Do(t,{}),ho(t,{skipIfEffect:!0}),Ft(t),Lo(t),No(t,{}),yo(t),$("Create",t,{}),$("Complete",t,{}),$("Render",t,{}),$("RenderRouter",t,{}),Rt(t,{})}},{depth:s.path.length,label:S(s,"if")});s.__effects.push(r)}function gt(t,s){const o=t.node;if(!o)return;const n=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==n&&(o.nodeValue=n);return}const r=t.__ref;let c=r?r.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const e=o.firstChild;e&&e.nodeType===3&&(c=e)}c?c.nodeValue!==n&&(c.nodeValue=n):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),o.insertBefore(c,o.firstChild)):(o.textContent=n,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),r&&(r.__textNode=c||null)}function _o(t,s){const o=t.node;if(!o||!("value"in o))return;const n=s==null?"":String(s);if(o.value===n)return;const r=typeof document<"u"&&document.activeElement===o,c=r&&typeof o.selectionStart=="number"?o.selectionStart:null,e=r&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=n,r&&c!=null&&e!=null)try{o.setSelectionRange(c,e)}catch{}}function Ft(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&>(t,t.text),js(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){o={};for(const r in t.style)typeof t.style[r]!="function"&&(o[r]=t.style[r]);break}X(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const n=t.attr[o];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!ct(o)||s.setAttribute&&s.setAttribute(o,K(o,n)))}if(t.data&&typeof t.data=="object")for(const o in t.data){const n=t.data[o];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||s.dataset&&(s.dataset[o]=n===!0?"":n)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(n=>n&&s.classList.add(n));else if(typeof o=="object")for(const n in o){const r=typeof o[n]=="function"?o[n](t,t.state,t.context):o[n];r&&s.classList.add(typeof r=="string"?r:n)}}}}function _t(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function ps(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function bt(t,s){if(!t||!t.style||!s)return null;const o=t.style,n=[];for(const r in s){if(s[r]==null||r.charAt(0)==="&")continue;const e=xt(r);n.push(e,It(o,e),bo(o,e))}return n}function It(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function bo(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function xt(t){return kt(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function hs(t,s,o){if(!t||!t.style||!s||!s.length)return;const n=t.style,r=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||r.add(xt(c));for(let c=0;c<s.length;c+=3){const e=s[c];r.has(e)||It(n,e)===s[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(e)}}function At(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let n=0;n<s.length;n+=3)if(It(o,s[n])!==s[n+1]||bo(o,s[n])!==s[n+2])return!1;return!0}const kt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,wt=t=>[t+"-top",t+"-right",t+"-bottom",t+"-left",t+"-block",t+"-block-start",t+"-block-end",t+"-inline",t+"-inline-start",t+"-inline-end"],St=["top","right","bottom","left","block","block-start","block-end","inline","inline-start","inline-end"],ys=(()=>{const t=["border-width","border-style","border-color","border-image"];for(const s of St)t.push("border-"+s),t.push("border-"+s+"-width","border-"+s+"-style","border-"+s+"-color");return t})(),xo={animation:["animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-timeline","animation-range","animation-range-start","animation-range-end"],background:["background-image","background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-color"],border:ys,"border-width":St.map(t=>"border-"+t+"-width"),"border-style":St.map(t=>"border-"+t+"-style"),"border-color":St.map(t=>"border-"+t+"-color"),"border-top":["border-top-width","border-top-style","border-top-color"],"border-right":["border-right-width","border-right-style","border-right-color"],"border-bottom":["border-bottom-width","border-bottom-style","border-bottom-color"],"border-left":["border-left-width","border-left-style","border-left-color"],"border-block":["border-block-width","border-block-style","border-block-color","border-block-start","border-block-end","border-block-start-width","border-block-start-style","border-block-start-color","border-block-end-width","border-block-end-style","border-block-end-color"],"border-inline":["border-inline-width","border-inline-style","border-inline-color","border-inline-start","border-inline-end","border-inline-start-width","border-inline-start-style","border-inline-start-color","border-inline-end-width","border-inline-end-style","border-inline-end-color"],"border-image":["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],"border-radius":["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-start-start-radius","border-start-end-radius","border-end-start-radius","border-end-end-radius"],columns:["column-width","column-count"],"column-rule":["column-rule-width","column-rule-style","column-rule-color"],container:["container-name","container-type"],"contain-intrinsic-size":["contain-intrinsic-width","contain-intrinsic-height"],flex:["flex-grow","flex-shrink","flex-basis"],"flex-flow":["flex-direction","flex-wrap"],font:["font-style","font-variant","font-weight","font-stretch","font-size","line-height","font-family","font-size-adjust","font-kerning","font-feature-settings","font-variation-settings","font-optical-sizing"],gap:["row-gap","column-gap"],grid:["grid-template","grid-template-rows","grid-template-columns","grid-template-areas","grid-auto-rows","grid-auto-columns","grid-auto-flow"],"grid-template":["grid-template-rows","grid-template-columns","grid-template-areas"],"grid-area":["grid-row","grid-column","grid-row-start","grid-row-end","grid-column-start","grid-column-end"],"grid-row":["grid-row-start","grid-row-end"],"grid-column":["grid-column-start","grid-column-end"],inset:["top","right","bottom","left","inset-block","inset-block-start","inset-block-end","inset-inline","inset-inline-start","inset-inline-end"],"inset-block":["inset-block-start","inset-block-end"],"inset-inline":["inset-inline-start","inset-inline-end"],"list-style":["list-style-type","list-style-position","list-style-image"],margin:wt("margin"),"margin-block":["margin-block-start","margin-block-end"],"margin-inline":["margin-inline-start","margin-inline-end"],mask:["mask-image","mask-mode","mask-repeat","mask-position","mask-clip","mask-origin","mask-size","mask-composite"],offset:["offset-position","offset-path","offset-distance","offset-rotate","offset-anchor"],outline:["outline-width","outline-style","outline-color"],overflow:["overflow-x","overflow-y"],"overscroll-behavior":["overscroll-behavior-x","overscroll-behavior-y"],padding:wt("padding"),"padding-block":["padding-block-start","padding-block-end"],"padding-inline":["padding-inline-start","padding-inline-end"],"place-content":["align-content","justify-content"],"place-items":["align-items","justify-items"],"place-self":["align-self","justify-self"],"scroll-margin":wt("scroll-margin"),"scroll-padding":wt("scroll-padding"),"text-decoration":["text-decoration-line","text-decoration-style","text-decoration-color","text-decoration-thickness"],"text-emphasis":["text-emphasis-style","text-emphasis-color"],transition:["transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior"]},Ao=(()=>{const t={};for(const s in xo)for(const o of xo[s]){const n=t[o];n?n.push(s):t[o]=[s]}return t})();function gs(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(xt(o)));return s}function _s(t,s,o,n){const r=t.__ref;if(!r)return;let c=null;if(o)for(const e of o){if(n&&n.has(e))continue;const i=s[e];if(i==null||typeof i=="object")continue;const d=xt(e);Ao[d]&&(c||(c={}),c[d]=i)}r.__declaredLonghands=c}function ko(t,s){const o=t.__ref,n=o&&o.__declaredLonghands;if(!n||!s)return null;let r=null;for(const c in n){if(s.has(c))continue;const e=Ao[c];let i=!1;for(let d=0;d<e.length;d++)if(s.has(e[d])){i=!0;break}i&&(r||(r={}),r[c]=n[c])}return r}function wo(t,s){const o=t.node;X(o,s);const n=gs(s);if(!n)return s;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const e of n)r.__inlineCssKeys.add(e);else r.__inlineCssKeys=new Set(n);const c=ko(t,n);return c?(X(o,c),Object.assign({},s,c)):s}function bs(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=ko(t,s.__inlineCssKeys);o&&X(t.node,o)}function X(t,s){if(!t||!s||!t.style)return;let o=null;for(const n in s){const r=s[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){o||(o={}),o[n]=r;continue}try{const c=String(r),e=kt(n)?n:n.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),i=c.trim(),d=/\s*!important\s*$/.test(i),g=i.replace(/\s*!important\s*$/,"");t.style.setProperty(e,g,d?"important":"")}catch{}}}o&&xs(t,o)}function xs(t,s){const o=`_ds${no.scopedStyleId++}`;t.classList.add(o);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let c="";for(const e in s){const i="."+o,d=e.replace(/&/g,i).split(",").map(a=>{const f=a.trim();return f.includes(i)?f:i+f}).join(", "),g=s[e];if(typeof g=="object"){let a="",f="";for(const l in g){const u=g[l];if(typeof u=="object"){const h=l.includes("&")?d.split(", ").map(p=>l.replace(/&/g,p)).join(", "):d.split(", ").map(p=>`${p} ${l}`).join(", ");let b="";for(const p in u)b+=`${p.replace(/[A-Z]/g,y=>"-"+y.toLowerCase())}: ${u[p]};`;f+=eo(`${h} { ${b} }`,h)+`
|
|
5
|
-
`}else
|
|
6
|
-
`),f&&(c+=f)}}c&&(r.textContent+=c)}const So=new Set;function Co(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function As(t,s,o){const n=Co(o);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=s(t,t.state,t.context)}catch{return}if(Co(r)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";So.has(c)||(So.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.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 ks(t){const s=t.subscribeTo,o=typeof s=="function";let n=s;if(o)try{n=s(t,t.state,t.context)}catch{n=null}if(o&&m()&&As(t,s,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let c=0;c<n.length;c++){const e=n[c];if(typeof e!="string"||e.length===0)continue;const i=e.split("."),d=i[0],g=i.slice(1),a={value:!1},f=C(()=>{const l=t.state&&(Z(t.state)?t.state.root:null);if(!l||!Z(l))return;let u=l;u=u[d];for(let b=0;b<g.length&&!(u==null||typeof u!="object");b++)if(Z(u))u=u[g[b]];else break;if(!a.value)return;let h=!1;if(typeof t.onBeforeUpdate=="function"){const b=t.context?.designSystem;b&&R(b);try{if(Ls(r)){const p=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});p&&typeof p.then=="function"?p.then(()=>vt(r,!1),y=>{vt(r,!0),t.context?.plugins?.length&&W("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}):(vt(r,!1),p===!1&&(h=!0))}}catch(p){vt(r,!0),t.context?.plugins?.length&&W("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}finally{b&&M()}}if(!h&&t.node&&r.__effects)for(let b=0;b<r.__effects.length;b++){const p=r.__effects[b];p&&p!==f&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}if(!h&&typeof t.onUpdate=="function"){const b=t.context?.designSystem;b&&R(b);try{t.onUpdate(t,t.state,t.context)}catch(p){t.context?.plugins?.length&&W("error",t,{hook:"onUpdate",error:p})||console.error("[DOMQL] subscribeTo onUpdate error:",p)}finally{b&&M()}}},{depth:r.path.length,label:S(r,"subscribeTo("+e+")")});a.value=!0,f._isSubscribeToEffect=!0,r.__effects.push(f)}}function Ut(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function Bt(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const vo=new Set;function ws(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",n=o+"::"+t;vo.has(n)||(vo.add(n),console.warn(`[smbls/css] "${t}" at ${o} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function tt(t,s,o,n){const r={},c=new Set,e=(i,d,g)=>{const a=g?new Set(Object.keys(r)):null;if(P[i]){const f=P[i](d,s,s.state,s.context);if(f){const l=Array.isArray(f)?f:[f];for(const u of l)u&&Object.assign(r,u)}}else r[i]=d;if(g)for(const f in r)a.has(f)||c.add(f)};for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let d=t[i];if(typeof d=="function"&&(d=d(s,s.state,s.context)),d==null||typeof d=="function")continue;if(typeof d=="object"&&!Array.isArray(d)){if(i==="style"){for(const u in d){let h=d[u];if(typeof h=="function"&&(h=h(s,s.state,s.context)),h==null||typeof h=="function")continue;const b=typeof s[u]=="function"&&(P[u]||E&&E.has(u))||!!(n&&n.has(u));e(u,h,b)}continue}if(Ut(i,s)){const u=tt(d,s,!1,n);Object.keys(u).length&&(r[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){m()&&ws(i,s);continue}const f=Bt(i,s),l=tt(d,s,!1,n);Object.keys(l).length&&(r[f]=l);continue}const g=typeof s[i]=="function"&&(P[i]||E&&E.has(i)),a=!!(n&&n.has(i));e(i,d,g||a)}if(o)for(const i in r)c.add(i);for(const i of c){const d=r[i];typeof d=="string"&&!d.includes("!important")&&(r[i]=d+" !important")}return r}function Ht(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Ht(t[o],s+1))return!0}return!1}function jo(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Ut(t,o)){const c=tt(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=Bt(t,o),r=tt(s,o,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function Ss(t){const s=t.__ref;for(const o of Object.keys(t)){if(!Mt(o))continue;const n=t[o];if(!n||typeof n!="object"||Array.isArray(n)||!Ht(n))continue;let r=null,c;const e=C(()=>{if(!t.node)return;const i=t.context?.designSystem;i&&R(i);let d,g=!1;try{const a=jo(o,n,t),f=a?_t(a.block)+"::"+a.cssProp:null;if(f!==null&&f===c)g=!0;else if(c=f,a){const l=nt({[a.cssProp]:a.block},null,t.context?.cssPrefix);d=l?l.split(" ").filter(Boolean):null}else d=null}finally{i&&M()}if(!(g||!t.node.classList)){if(r)for(const a of r)t.node.classList.remove(a);if(d&&d.length)for(const a of d)t.node.classList.add(a);r=d}},{depth:s.path.length,label:S(s,"cssBlock("+o+")")});s.__effects.push(e)}}function Cs(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const n of Object.keys(t)){const r=n.charAt(0);if(r!=="."&&r!=="!")continue;const c=n.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const h=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${h}: { '${c.slice(h.length)}': {...} }\`.`)}continue}const e=t[n];if(!e||typeof e!="object")continue;const i=r==="!",d={lastMatch:!1,appliedKeys:null,appliedClasses:null},g=new Set;for(const h in e){if(!Object.prototype.hasOwnProperty.call(e,h))continue;const b=h.charAt(0),p=e[h];(b===":"||b==="@"||b==="&"||b==="[")&&p&&typeof p=="object"&&!Array.isArray(p)||g.add(h)}const a=()=>{let h;const b=t[c];if(b===void 0){const _=!!t.state&&c in t.state,x=t.state?t.state[c]:void 0;if(_||x!==void 0)h=x;else{const A=t.context?.cases?.[c];if(A===void 0)return;try{h=typeof A=="function"?A.call(t,t):A}catch(k){h=!1,s.__conditionalError=k,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,k?.message||k)}}}else if(typeof b=="function")try{h=b(t,t.state,t.context)}catch(_){h=!1,s.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else h=b;const p=i?!h:!!h;if(!t.node||p===d.lastMatch)return;d.lastMatch=p;const y=t.context?.designSystem;y&&R(y);try{if(p){const _={},x={};let A=!1;for(const w in e){if(!Object.prototype.hasOwnProperty.call(e,w))continue;const L=e[w],Y=w.charAt(0);if((Y===":"||Y==="@"||Y==="&"||Y==="[")&&L&&typeof L=="object"&&!Array.isArray(L)){if(Ut(w,t)){const T=tt(L,t,!1,g);Object.keys(T).length&&(x[`[data-theme="${w.slice(1)}"] &`]=T,A=!0)}else{const T=Bt(w,t),q=tt(L,t,!1,g);Object.keys(q).length&&(x[T]=q,A=!0)}continue}const D=typeof L=="function"?L(t,t.state,t.context):L;if(D!=null)if(P[w]){const T=P[w](D,t,t.state,t.context);if(T){const q=Array.isArray(T)?T:[T];for(const ut of q)ut&&Object.assign(_,ut)}}else(E&&E.has(w)||kt(w))&&(_[w]=D)}const k=Object.keys(_);if(k.length){X(t.node,_);for(const w of k)o.set(w,n);d.appliedKeys=k}else d.appliedKeys=null;if(A){const w=nt(x,null,t.context?.cssPrefix,{state:!0}),L=w?w.split(" ").filter(Boolean):[];if(L.length&&t.node.classList){for(const Y of L)t.node.classList.add(Y);d.appliedClasses=L}else d.appliedClasses=null}else if(d.appliedClasses){for(const w of d.appliedClasses)t.node.classList.remove(w);d.appliedClasses=null}}else{if(d.appliedKeys){for(const _ of d.appliedKeys)o.get(_)===n&&(kt(_)?t.node.style.removeProperty(_):t.node.style[_]="",o.delete(_));d.appliedKeys=null}if(d.appliedClasses){for(const _ of d.appliedClasses)t.node.classList.remove(_);d.appliedClasses=null}}}finally{y&&M()}};s.__conditionalRunners.push(a);const f=O(t,t[c+"Deps"],a),l=C(f,{depth:s.path.length,label:S(s,"conditional("+n+")")}),u=s.__exec&&s.__exec[c]||t[c];l._sources.size===0&&typeof u=="function"&&m()&&console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(l)}}const Kt=new WeakSet;function vs(t){const s=t.ownerDocument;!s||Kt.has(s)||(Kt.add(s),queueMicrotask(()=>{Kt.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const Vt=new WeakSet;let Eo=!1;function To(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Gt(t,s){const o={...t};for(const n in s){const r=s[n],c=o[n];o[n]=r&&typeof r=="object"&&c&&typeof c=="object"?Gt(c,r):r}return o}function Po(t,s){const o={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const c=Po(r,s);Object.keys(c).length&&(o[n]=c)}else s.has(n)||(o[n]=r)}return o}function js(t){const{node:s}=t;if(!s)return;if(Eo||(Eo=!0,nt({display:"none"})),Vt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Vt.add(t);const o=t.context?.designSystem;o&&R(o),to();try{const n={};let r=!1,c=null,e=null,i=null;const d=(a,f)=>{if(f&&typeof f=="object"&&To(a)){e||(e={});const l=e[a];l&&(f=Gt(l,f)),e[a]=f}else(f===null||typeof f!="object")&&(i||(i=new Set),i.add(a));n[a]=f};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&P.theme){const a=P.theme(t.theme,t,t.state,t.context);if(a){const f=l=>{for(const u in l){const h=l[u];h&&typeof h=="object"&&To(u)&&(c||(c={}),c[u]=h),n[u]=h}};if(Array.isArray(a))for(const l of a)l&&f(l);else f(a);r=!0}}if(typeof t.class=="string"&&so.resolveDesignSystemClass){const a=so.resolveDesignSystemClass(t.class,t);if(a){for(const f in a)d(f,a[f]);r=!0}}const g=i?new Set(i):null;for(const a of Object.keys(t)){if(typeof t[a]=="function"||G.has(a)||a==="theme")continue;const f=a.charCodeAt(0);if(!(f>=65&&f<=90)&&!z(a)){if(P[a]){const l=t[a],u=P[a](l,t,t.state,t.context);if(u){if(Array.isArray(u)){for(const h of u)if(h)for(const b in h)d(b,h[b])}else for(const h in u)d(h,u[h]);r=!0}}else if(E&&E.has(a)){const l=t[a];l!=null&&typeof l!="object"&&(d(a,l),r=!0)}else if(a.charCodeAt(0)===45){const l=t[a];l!=null&&typeof l!="object"&&(d(a,l),r=!0)}else if(a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="["){const l=t[a];if(l&&typeof l=="object"&&!Array.isArray(l)){if(Ht(l))continue;const u=jo(a,l,t);u&&(d(u.cssProp,u.block),r=!0)}}}}if(c)for(const a in c){let f=i?Po(c[a],i):c[a];e&&e[a]&&(f=Gt(f,e[a])),Object.keys(f).length?n[a]=f:delete n[a]}if(_s(t,n,i,g),r){n.display&&String(n.display).includes("!important")&&(s.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const a=nt(n,null,t.context?.cssPrefix);if(a&&s.classList){const l=a.split(" ").filter(Boolean);let u=!1;for(const h of l)s.classList.add(h),u||(h.charCodeAt(0)===95&&h.charCodeAt(1)===99||h.charCodeAt(0)===95&&h.indexOf("_c",1)!==-1)&&(u=!0);u&&vs(s)}const f=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(f!=null){const l=n.display;if(l&&l!==f)if(f==="none"){const u=[];for(const h of s.classList)h.startsWith("_d-")&&h!=="_d-none"&&u.push(h);for(const h of u)s.classList.remove(h);s.classList.add("_d-none")}else s.style.display==="none"&&(typeof t.hide=="function"||typeof t.show=="function")||(s.style.display=t.display),t.__ref&&(t.__ref.__explicitDisplay=t.display)}}bs(t)}finally{oo(),o&&M(),Vt.delete(t)}}function Lo(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const e="aria-"+r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase());s.setAttribute(e,K(e,c))}const o=Yo(t);for(const r in o){const c=o[r];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(r,c===!0?"":c)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.has(r)||r==="on"||o[r]!==void 0)continue;const c=r.charCodeAt(0);if(!(c>=65&&c<=90)&&!z(r)&&!(P[r]||E&&E.has(r))&&rt(n,r)){let e=t[r];if(e==null)continue;if(typeof e=="string"&&e.includes("{{")){if(!Ot[r])continue;e=F.call(t,e,t.state)}if(e==null||typeof e=="function"||typeof e=="object"||e===!1&&!ct(it(r)||r))continue;const i=it(r)||r;s.setAttribute(i,K(i,e))}}}function te(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const n=s.charCodeAt(0);if(n>=65&&n<=90||z(s)||P[s]||E&&E.has(s)||!rt(t.tag||"div",s))return;const r=it(s)||s,c=r.toLowerCase(),e=t.__ref&&t.__ref.__effects;let i=!1;if(e)for(let a=0;a<e.length;a++){const f=e[a];f&&f._attrName===c&&!f._disposed&&typeof f._execute=="function"&&(i=!0,f._execute())}if(i)return;let d=t[s];const g=Ot[s];if(g&&d!=null){const a=g(t);a!==void 0&&(d=a)}typeof d=="string"&&d.includes("{{")&&(d=F.call(t,d,t.state)),d==null||d===!1&&!ct(r)?o.removeAttribute(r):typeof d!="function"&&typeof d!="object"&&o.setAttribute(r,K(r,d))}function Es(t,s){const o=t.node,n=t.__ref;let r=n.__autoGrow;if(!s){if(r&&r.active){try{o.removeEventListener("input",r.resize)}catch{}o.style.height="",r.appliedMax!=null&&o.style.maxHeight===r.appliedMax&&(o.style.maxHeight=""),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,resize:()=>{if(o.scrollHeight===0&&r.lastMeasure>0)return;o.style.height="auto";const e=o.scrollHeight;o.style.height=e+"px",e>0&&(r.lastMeasure=e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{o.removeEventListener("input",r.resize)}catch{}})),r.active||(o.addEventListener("input",r.resize),r.active=!0);const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==r.appliedMax&&(c==null?r.appliedMax!=null&&o.style.maxHeight===r.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,r.appliedMax=c),r.resize()}function Ts(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,n=t.autoGrow,r=typeof n=="function"?O(t,t.autoGrowDeps,n):null,c=C(()=>{const e=t.autoGrow;let i=e;if(typeof e=="function")try{i=(e===n&&r?r:e)(t,t.state,t.context)}catch{i=null}Es(t,i)},{depth:o.path.length,label:S(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),r&&(o.__exec.autoGrow=n)}const Oo=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Do(t,s){for(const o of Object.keys(t)){if(!z(o)||Oo.has(o))continue;const n=Ko(o);if(n){Ho(n,t,t[o]);continue}let r=t[o];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const e=r;r=function(d){return t.call(e,d)}}if(typeof r!="function")continue;const c=ts(o);Uo.has(c)||Bo(os(c),t,r)}Ps(t)}function Ps(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let n=!1;for(const l of Oo){const u=t[l];typeof u=="function"&&(o[l]=u,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let e=0,i=0,d=0,g=!1;const a=l=>{const u=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];u&&(e=u.clientX,i=u.clientY,d=Date.now(),g=!0)},f=l=>{if(!g)return;g=!1;const u=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!u)return;const h=u.clientX-e,b=u.clientY-i,p=Date.now()-d;if(p>c)return;const y=Math.abs(h),_=Math.abs(b);if(Math.max(y,_)<r)return;let x;if(y>_*1.2)x=h<0?"left":"right";else if(_>y*1.2)x=b<0?"up":"down";else return;const A="onSwipe"+x.charAt(0).toUpperCase()+x.slice(1),k=o[A],w=o.onSwipe;k&&k.call(t,l,t,t.state,t.context),w&&w.call(t,{direction:x,dx:h,dy:b,dt:p,event:l},t,t.state,t.context)};s.addEventListener("touchstart",a,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",a)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function lt(t,s){const o={...t};for(const n in s){const r=o[n],c=s[n];r&&c&&typeof r=="object"&&typeof c=="object"&&!Array.isArray(r)&&!Array.isArray(c)&&typeof r!="function"&&typeof c!="function"?o[n]=lt(r,c):o[n]=c}return o}function Wt(t,s,o,n){if(!s||!t.node)return;const r=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",e=t.context?.document||globalThis.document,i=c?null:e?.createDocumentFragment();if(!c&&!i)return;const d=t.childProps,g=t.childrenAs,a=p=>{let y=s[p];const _=y;(typeof y=="string"||typeof y=="number")&&(y={text:y});let x=d;if(typeof d=="function")try{x=d(t,y)}catch{x=null}if(g==="state"){let k=_;(typeof _=="string"||typeof _=="number")&&(k={value:_,text:_}),y=x?{...x,state:k}:{state:k}}else x&&(y=lt(x,y));if(r&&!y.ignoreChildExtends)if(y.extends){const k=Array.isArray(y.extends)?y.extends:[y.extends],w=Array.isArray(r)?r:[r];y={...y,extends:[...w,...k]}}else y={...y,extends:r};const A=ao(y?.key,_,p);try{return Q(y,t,A,o)}catch(k){if(typeof console<"u"&&console.error){const w=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${A}" failed to construct at ${w} (initial render, skipping this row):`,k?.message||k)}return null}},f=t.__ref;if(!(n===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let p=0;p<s.length;p++){const y=a(p);!c&&y?.node&&i.appendChild(y.node)}return c||t.node.appendChild(i),!0}const u=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;Xt();let h=null;const b=p=>{if(f.__disposed||f.__childrenChunkGen!==u){h&&h.parentNode&&h.remove();return}for(let y=p;y<s.length;y++){const _=a(y);if(_?.node&&(h?t.node.insertBefore(_.node,h):i.appendChild(_.node)),y+1<s.length&&Qt()){h||(h=e.createComment("smbls-mount"),i.appendChild(h),t.node.appendChild(i));const x=y+1;mt(()=>b(x));return}}h?(h.remove(),t.node.tagName==="SELECT"&&Ct(t,!0)):t.node.appendChild(i)};return b(0),Jt(),!0}if(typeof s=="string"){const c=fo(s,t);if(Array.isArray(c))return Wt(t,c,o,n)}if(typeof s=="object")for(const c in s){if(G.has(c))continue;let e=s[c];if(!(e==null||e===!1)){if((typeof e=="string"||typeof e=="number")&&(e={text:e}),t.childProps&&(e=lt(t.childProps,e)),r&&!e.ignoreChildExtends)if(e.extends){const i=Array.isArray(e.extends)?e.extends:[e.extends],d=Array.isArray(r)?r:[r];e={...e,extends:[...d,...i]}}else e={...e,extends:r};Q(e,t,c,o)}}}function Ct(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const n=o.options;if(!n||!n.length)return;const r=t.__ref,c=r&&r.__exec&&r.__exec.value,e=typeof c=="function",i=t.value!=null&&typeof t.value!="function";if(e||i){let a;if(e)try{a=c(t,t.state,t.context)}catch{return}else a=t.value,typeof a=="string"&&a.includes("{{")&&(a=F.call(t,a,t.state));const f=a==null?"":String(a);o.value!==f&&(o.value=f);return}const d=s||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!d)return;let g=-1;for(let a=0;a<n.length;a++)n[a].defaultSelected&&(g=a);g>=0&&o.selectedIndex!==g&&(o.selectedIndex=g)}function No(t,s){let{children:o,content:n}=t;const r=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(p){if(o=void 0,typeof console<"u"&&console.error){const y=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${y} (initial run, treating as empty):`,p?.message||p)}}t.children=o;const l=t.__ref;let u=!1;const h=O(t,t.childrenDeps,f),b=C(()=>{const p=u;u=!0;let y;try{y=h(t,t.state,t.context)}catch(D){if(typeof console<"u"&&console.error){const T=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${T}${p?"":" (initial tracking run)"}:`,D?.message||D)}return}if(!p||y===t.children)return;t.children=y,l.__childrenChunkGen!=null&&l.__childrenChunkGen++;const _=typeof t.onContentUpdate=="function",x=_?[]:null,A=_?[]:null,k=_?[]:null;if(Array.isArray(y)&&t.childrenAs==="state"){const D=t.childProps,T=[],q=new Map;for(let v=0;v<y.length;v++){const B=y[v];let j=D;if(typeof D=="function")try{j=D(t,B)}catch{j=null}const V=ao(j&&j.key,B,v);T.push(V),q.set(V,{rawChild:B,childProps:j})}const ut=new Set(T),Mo=l.__children.slice();for(const v of Mo)if(!ut.has(v)){const B=t[v];B?.remove&&B.remove(),delete t[v],A&&A.push(v)}const ot=t.childExtends,pt=t.tag==="fragment",$o=t.context?.document||globalThis.document,st=pt?null:$o?.createDocumentFragment(),jt=new Set;for(const v of T){const B=q.get(v),j=B.rawChild,V=t[v];if(V&&V.state){if(j&&typeof j=="object"){const N=V.state,J=N.$replace||N.replace,Zt=N.$update||N.update;try{if(typeof J=="function")J.call(N,j);else if(typeof Zt=="function"){for(const U in N)if(!(U==="__element"||U==="root"||U==="parent"||U==="update")&&!Object.prototype.hasOwnProperty.call(j,U))try{N[U]=void 0}catch{}Zt.call(N,j)}else for(const U in j)N[U]=j[U]}catch(U){if(typeof console<"u"&&console.error){const Fo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to patch at ${Fo} (reconcile, keeping its previous data for this pass):`,U?.message||U)}}}k&&k.push(v);continue}let Et=j;(typeof j=="string"||typeof j=="number")&&(Et={value:j,text:j});const Yt=B.childProps;let H=Yt?{...Yt,state:Et}:{state:Et};if(ot&&!H.ignoreChildExtends)if(H.extends){const N=Array.isArray(H.extends)?H.extends:[H.extends],J=Array.isArray(ot)?ot:[ot];H={...H,extends:[...J,...N]}}else H={...H,extends:ot};let Tt;try{Tt=Q(H,t,v,s)}catch(N){if(typeof console<"u"&&console.error){const J=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to construct at ${J} (reconcile, skipping this row):`,N?.message||N)}jt.add(v);continue}!pt&&Tt?.node&&st&&st.appendChild(Tt.node),x&&x.push(v)}if(!pt&&st&&st.childNodes.length&&t.node&&t.node.appendChild(st),!pt&&t.node){let v=null;for(const B of T){const j=t[B]?.node;if(!j)continue;const V=v?v.nextSibling:t.node.firstChild;j!==V&&t.node.insertBefore(j,V),v=j}}l.__children=jt.size?T.filter(v=>!jt.has(v)):T,_&&(x.length||A.length)&&co(t,{added:x,removed:A,kept:k}),Ct(t,!1);return}const Y=_?[...l.__children]:null;for(const D of[...l.__children]){const T=t[D];T?.remove&&T.remove(),delete t[D]}l.__children=[],Wt(t,y,s),Ct(t,!1),_&&co(t,{added:[...l.__children],removed:Y,kept:[]})},{depth:l.path.length,label:S(l,"children")});l.__effects.push(b)}const c=Wt(t,o,s,!0);if(n!=null&&!(n&&n.__ref)){let f=n;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=lt(t.childProps,f)),r&&!f.ignoreChildExtends)if(f.extends){const l=Array.isArray(f.extends)?f.extends:[f.extends],u=Array.isArray(r)?r:[r];f={...f,extends:[...u,...l]}}else f={...f,extends:r};Q(f,t,"content",s)}if(o&&!c)return;const e=t.context?.components||{};{const f=Object.keys(t);for(let l=0;l<f.length;l++){const u=f[l];if(!u.endsWith("Extends")||typeof t[u]!="string")continue;const h=u.slice(0,-7);if(!h||h.charCodeAt(0)<65||h.charCodeAt(0)>90)continue;const b={extends:t[u]};delete t[u];for(let p=l+1;p<f.length;p++){const y=f[p],_=y.charCodeAt(0);if(_>=65&&_<=90||G.has(y)||typeof t[y]=="function"&&(y.startsWith("on")||y.startsWith(".")))break;const x=t[y];x!==void 0&&(b[y]=x,delete t[y])}t[h]&&typeof t[h]=="object"?t[h]={...b,...t[h]}:t[h]=b}}const i=s?.mountYield===!0||t.yieldChildren===!0,d=Object.keys(t),g=f=>{if(G.has(f)||typeof t[f]!="object"||t[f]===null)return;const l=f.charCodeAt(0);if(l<65||l>90)return;let u=t[f];if(!u.__ref){if(!u.extends&&!u.extend){const h=e[f]||e[`smbls.${f}`];h&&(u={...u,extends:h})}if(t.childProps&&(u=lt(t.childProps,u)),r&&!u.ignoreChildExtends)if(u.extends){const h=Array.isArray(u.extends)?u.extends:[u.extends],b=Array.isArray(r)?r:[r];u={...u,extends:[...b,...h]}}else u={...u,extends:r};Q(u,t,f,s)}};if(!i){for(const f of d)g(f);return}Xt();const a=f=>{for(let l=f;l<d.length;l++)if(g(d[l]),l+1<d.length&&Qt()){const u=l+1;mt(()=>a(u));return}};a(0),Jt()}function Ro(t,s,o){const{node:n}=t;if(!n)return;n.ref=t;const r=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(r){const e=r.parentNode;if(e){if(o?.position==="before"&&o.node)e.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const i=o.node.nextSibling;e.insertBefore(n,i||r)}else e.insertBefore(n,r);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(n,o.node);else if(o?.position==="after"&&o.node){const e=o.node.nextSibling;e?c.insertBefore(n,e):c.appendChild(n)}else c.appendChild(n)}const zt=3;function Ls(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=zt?!1:(t.__inBeforeUpdate=!0,!0)}function vt(t,s){t&&(t.__inBeforeUpdate=!1,s?(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 $(t,s,o){const n=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&W(n,s,o);const r="on"+t,c=s[r];if(typeof c=="function"){const d=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(d){if(s.__ref[d])return!0;s.__ref[d]=!0}const g=s.context?.designSystem;g&&R(g);let a=!!d;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const l=s.__ref;return f.catch(u=>{s.context?.plugins?.length&&W("error",s,{hook:r,error:u})||console.error(`[DOMQL] Lifecycle "${r}" error:`,u)}).finally(()=>{d&&l&&(l[d]=!1)}),a=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&W("error",s,{hook:r,error:f})||console.error(`[DOMQL] Lifecycle "${r}" error:`,f),s.context?.strictMode)throw f}finally{g&&M(),a&&s.__ref&&(s.__ref[d]=!1)}}return!0}var oe=Q;export{zt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Ls as acquireBeforeUpdateGuard,Q as create,oe as default,Nt as flushMounts,te as reconcileAttrProp,vt as releaseBeforeUpdateGuard,gt as writeElementText};
|
|
4
|
+
`):"")}}if(Lt(n,!0),Wo(n,s,r),typeof n.html=="function"&&n.node&&!n.node.innerHTML){const u=n.context?.designSystem;u&&N(u);try{const l=n.html(n,n.state,n.context);l!=null&&typeof l!="function"&&(n.node.innerHTML=l)}catch{}finally{u&&M()}}if(F("Create",n,e),F("Complete",n,e),F("Render",n,e),F("RenderRouter",n,e),Bt(n,e),typeof n.onFrame=="function"){const u=n.onFrame,l=n.context?.designSystem,b=()=>{if(n.node){if(n.node.isConnected){l&&N(l);try{u(n,n.state,n.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{l&&M()}}requestAnimationFrame(b)}};requestAnimationFrame(b)}return n}function ps(t,s,o){const e=!s,r=o.state&&typeof o.state=="object"&&!Array.isArray(o.state)&&Object.keys(o.state).length===0,c=e&&r&&t.context?.state,n=o.state!==void 0&&!c?o.state:t.state&&!q(t.state)?t.state:void 0;if(n==null){if(s?.state)t.state=s.state,it(t,t.state);else if(t.context?.state){const d=t.context.state,i={...d},g=t.context?.polyglot;if(g?.translations){const _=t.context,f=d.lang||g.defaultLang||"en",p=new Set,y=(u,l)=>{p.has(u)||ss(_,u,i)&&(i[u]=l,p.add(u),es(_,u))},a=g.translations[f];if(a&&typeof a=="object")for(const u in a)y(u,a[u]);const h=new Set(g.languages||[]);for(const u in g.translations)h.has(u)||y(u,g.translations[u])}t.state=q(i)?i:Mt(i),t.state.__element=t,t.state.root=t.state,it(t,t.state),At.promoteActiveRootState?.(d,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),it(t,t.state);return}if(typeof n=="string"){if(t.state=xo(n,s),t.state&&typeof t.state=="object"&&!q(t.state)){const d=s?.state?.root||s?.state||t.state;Object.defineProperty(t.state,"root",{value:d,enumerable:!1,configurable:!0,writable:!0})}it(t,t.state);return}if(typeof n=="function"){const d=n(t,s?.state);t.state=q(d)?d:Mt(d||{})}else q(n)?t.state=n:t.state=Mt({...n});t.state.__element=t,s?.state?(t.state.parent=s.state,t.state.root=s.state.root||s.state):t.state.root=t.state,it(t,t.state),At.promoteActiveRootState?.(n,t.state)}function Gt(t,s){if(!s)return t;const o=s.split("/");let e=t;for(const r of o){if(e==null)return{};e=e[r]}return e??{}}function xo(t,s){if(!s)return{};if(t===".")return s.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?Gt(s.state,r):s.state??{}}if(t.startsWith("~/")){const r=s.state?.root||s.state,c=t.slice(2);return c?Gt(r,c):r??{}}if(s.state?.[t]!==void 0)return s.state[t];const o=Gt(s.state,t);if(o!=null&&Object.keys(o).length>0)return o;const e=s.context?.polyglot;if(e?.translations){const r=s.state?.root?.lang||e.defaultLang||"en",c=e.translations[r];if(c?.[t]!==void 0)return c[t];if(e.translations[t]!==void 0)return e.translations[t]}return{}}const hs=new Set(["s","state","ctx","context"]);function ys(t){try{const o=(typeof At.getFunctionSource=="function"?At.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return o?o[1].split(",").map(e=>e.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function _s(t){if(typeof t!="function"||t.length!==2)return!1;const s=ys(t);if(s.length<2)return!1;const o=s[1].replace(/[{}[\]]/g,"").trim();return o.length>0&&!hs.has(o)}function gs(t){const s=t.__ref,o=t.tag||"div",e=t.context?.designSystem,r=[],c=Object.keys(t);for(let n=0;n<c.length;n++){const d=c[n];if(typeof t[d]!="function"||W.has(d))continue;const i=d.charCodeAt(0);i>=65&&i<=90||Y(d)||R[d]||D&&D.has(d)||ft(o,d)||(tt()&&_s(t[d])&&console.warn(`[smbls] custom prop "${d}"${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('${d}', \u2026) instead of reading el.${d}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:d,fn:t[d]}))}for(let n=0;n<r.length;n++){const{prop:d,fn:i}=r[n];s.__exec[d]=i,Object.defineProperty(t,d,{get(){e&&N(e);try{return i(t,t.state,t.context)}catch{return}finally{e&&M()}},set(g){delete s.__exec[d],Object.defineProperty(t,d,{value:g,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function bs(t,s){if(!(!Array.isArray(s)||s.length===0))for(let o=0;o<s.length;o++){const e=s[o];try{typeof e=="function"?e(t,t.state,t.context):typeof e=="string"&&t.state?.[e]}catch{}}}function P(t,s,o){return!Array.isArray(s)||s.length===0?o:function(...e){return bs(t,s),o.apply(this,e)}}function yt(t,s){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[s]}function w(t,s){return()=>t.path.join(".")+"::"+s}const Co=new Set;function I(t,s,o){if(!tt())return;const e=w(t,s)();Co.has(e)||(Co.add(e),console.warn(`[smbls] "${s}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,o?.message||o))}const So=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,As=(t,s)=>{let o;try{o=String(t)}catch{return}if(!o.includes("{{"))return;So.lastIndex=0;let e;for(;(e=So.exec(o))!==null;)e[2].includes("{{")&&s.add(e[2])},xs=(t,s)=>!Y(t)&&!lt(s,t),wo=(t,s,o,e)=>{if(typeof s=="string"){s.includes("{{")&&o.add(s);return}typeof s=="function"&&xs(t,e)&&As(s,o)},Cs=["attr","aria","data"],Ss=t=>{if(Cs.includes(t))return!0;const s=t.charCodeAt(0);return s===46||s===33||s===64},ws=t=>{const s=new Set,o=t.tag||"div";for(const e of Object.keys(t)){const r=Object.getOwnPropertyDescriptor(t,e),c=r&&r.value;if(c&&typeof c=="object"&&!Array.isArray(c)){if(!Ss(e))continue;for(const n in c)wo(n,c[n],s,o);continue}wo(e,c,s,o)}return s};function vo(t,s){const o=t.__ref,e=!!(s&&s.skipIfEffect),r=ws(t);if(o.__authoredTemplates)for(const i of r)o.__authoredTemplates.add(i);else o.__authoredTemplates=r;if(gs(t),typeof t.text=="function"){const i=t.text,g=P(t,t.textDeps,i),_=v(()=>{if(!o.contentManaged)try{let f=g(t,t.state,t.context);t.node&&f!=null&&typeof f!="function"&&typeof f!="object"&&(typeof f=="string"&&f.includes("{{")&&(f=$.call(t,f,t.state)),St(t,f))}catch(f){I(o,"text",f)}},{depth:o.path.length,label:w(o,"text")});o.__effects.push(_),o.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,g=v(()=>{if(o.contentManaged)return;const _=$.call(t,i,t.state);_!=null&&(t.text=_),t.node&&St(t,_??"")},{depth:o.path.length,label:w(o,"text")});o.__effects.push(g),o.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!W.has(i)&&!Y(i)&&!o.__exec[i]&&!lo(c,i)){if(R[i]){const g=t[i],_=P(t,t[i+"Deps"],g),f=i;let p,y=null,a=null,h;const u=v(()=>{const l=t.context?.designSystem;l&&N(l);try{const b=_(t,t.state,t.context);co();let A;try{A=R[f](b,t,t.state,t.context)}finally{fo()}if(Array.isArray(A)){const C={};for(const x of A)if(x)for(const E in x)C[E]=x[E];A=C}const S=f==="show"||f==="hide";if(A&&t.node&&vs(A)){const C=wt(A);if(C===null||C!==h){h=C;const x=ct(A,null,t.context?.cssPrefix),E=x?x.split(" ").filter(Boolean):null;if(t.node.classList){if(a)for(const U of a)t.node.classList.remove(U);if(E&&E.length)for(const U of E)t.node.classList.add(U);a=E}}p=void 0,y=null}else if(A&&t.node){if(a){for(const x of a)t.node.classList.remove(x);a=null,h=void 0}const C=wt(A);if(C===null||C!==p||!jt(t.node,y)){p=C;const x=Lo(t,A);y=vt(t.node,x)}}else t.node&&S&&(p=void 0,y=null,t.node.style.display="")}finally{l&&M()}},{depth:o.path.length,label:w(o,f)});o.__effects.push(u),o.__exec[i]=g}else if(D&&D.has(i)){const g=t[i],_=P(t,t[i+"Deps"],g),f=i;let p,y=null;const a=v(()=>{const h=t.context?.designSystem;h&&N(h);try{const u=_(t,t.state,t.context);if(t.node)if(u!=null){const l=f+":"+String(u);if(l!==p||!jt(t.node,y)){p=l;const b={[f]:u},A=Lo(t,b);y=vt(t.node,A)}}else p=void 0,y=null,t.node.style[f]=""}finally{h&&M()}},{depth:o.path.length,label:w(o,f)});o.__effects.push(a),o.__exec[i]=g}}if(typeof t.html=="function"){const i=t.html,g=P(t,t.htmlDeps,i),_=v(()=>{const f=t.context?.designSystem;f&&N(f);try{const p=g(t,t.state,t.context);t.node&&p!=null&&typeof p!="function"&&(t.node.innerHTML=p)}finally{f&&M()}},{depth:o.path.length,label:w(o,"html")});o.__effects.push(_),o.__exec.html=i}if(typeof t.value=="function"){const i=t.value,g=P(t,t.valueDeps,i),_=v(()=>{try{let f=g(t,t.state,t.context);typeof f=="string"&&f.includes("{{")&&(f=$.call(t,f,t.state)),Eo(t,f)}catch(f){I(o,"value",f)}},{depth:o.path.length,label:w(o,"value")});o.__effects.push(_),o.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,g=v(()=>{try{Eo(t,$.call(t,i,t.state))}catch(_){I(o,"value",_)}},{depth:o.path.length,label:w(o,"value")});o.__effects.push(g),o.__exec.value=i}if(typeof t.style=="function"){const i=t.style,g=P(t,t.styleDeps,i);let _,f=null;const p=v(()=>{const y=g(t,t.state,t.context),a=wt(y);(a===null||a!==_||!jt(t.node,f))&&(_=a,ks(t.node,f,y),J(t.node,y),f=vt(t.node,y))},{depth:o.path.length,label:w(o,"style")});o.__effects.push(p),o.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const g=t.style[i];if(typeof g!="function")continue;const _=P(t,yt(t.styleDeps,i),g);let f,p=null;const y=v(()=>{try{const a=_(t,t.state,t.context);if(t.node){const h=i+":"+String(a);if(h!==f||!jt(t.node,p)){f=h;const u={[i]:a};J(t.node,u),p=vt(t.node,u)}}}catch(a){I(o,"style."+i,a)}},{depth:o.path.length,label:w(o,"style."+i)});o.__effects.push(y)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const g=P(t,yt(t.attrDeps,i),t.attr[i]),_=i,f=v(()=>{try{let p=g(t,t.state,t.context);typeof p=="string"&&p.includes("{{")&&(p=$.call(t,p,t.state)),t.node?.setAttribute&&(p==null||p===!1&&!ut(_)?t.node.removeAttribute(_):typeof p!="function"&&typeof p!="object"&&t.node.setAttribute(_,H(_,p)))}catch(p){I(o,"attr."+_,p)}},{depth:o.path.length,label:w(o,"attr."+_)});f._attrName=_.toLowerCase(),o.__effects.push(f)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const g=t.attr[i],_=i,f=v(()=>{try{const p=$.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(_,H(_,p??""))}catch(p){I(o,"attr."+_,p)}},{depth:o.path.length,label:w(o,"attr."+_)});f._attrName=_.toLowerCase(),o.__effects.push(f)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const g=t.aria[i];if(typeof g=="string"&&g.includes("{{")){const y=g,a="aria-"+i.replace(/[A-Z]/g,u=>"-"+u.toLowerCase()),h=v(()=>{try{const u=$.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(a,H(a,u??""))}catch(u){I(o,"aria."+i,u)}},{depth:o.path.length,label:w(o,"aria."+i)});h._attrName=a,o.__effects.push(h);continue}if(typeof g!="function")continue;const _=P(t,yt(t.ariaDeps,i),t.aria[i]),f="aria-"+i.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),p=v(()=>{try{const y=_(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null?t.node.removeAttribute(f):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(f,H(f,y))}catch(y){I(o,"aria."+i,y)}},{depth:o.path.length,label:w(o,"aria."+i)});p._attrName=f,o.__effects.push(p)}if(t.data&&typeof t.data=="object")for(const i in t.data){const g=t.data[i];if(typeof g=="string"&&g.includes("{{")){const a=g,h="data-"+i.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),u=v(()=>{try{const l=$.call(t,a,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(h,l??"")}catch(l){I(o,"data."+i,l)}},{depth:o.path.length,label:w(o,"data."+i)});u._attrName=h,o.__effects.push(u);continue}if(typeof g!="function")continue;const _=P(t,yt(t.dataDeps,i),t.data[i]),p="data-"+i.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),y=v(()=>{try{const a=_(t,t.state,t.context);if(!t.node?.setAttribute)return;a==null||a===!1?t.node.removeAttribute(p):typeof a!="function"&&typeof a!="object"&&t.node.setAttribute(p,a===!0?"":a)}catch(a){I(o,"data."+i,a)}},{depth:o.path.length,label:w(o,"data."+i)});y._attrName=p,o.__effects.push(y)}const n=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(n)for(const i in n){if(typeof n[i]!="function")continue;const g=P(t,yt(t.classDeps,i),n[i]),_=v(()=>{try{const f=g(t,t.state,t.context);if(!t.node?.classList)return;typeof f=="string"?t.node.classList.add(f):f?t.node.classList.add(i):t.node.classList.remove(i)}catch(f){I(o,"class."+i,f)}},{depth:o.path.length,label:w(o,"class."+i)});o.__effects.push(_)}!e&&typeof t.if=="function"&&jo(t,o,t.if);for(const i of Object.keys(t)){if(W.has(i)||typeof t[i]!="function")continue;const g=i.charCodeAt(0);if(g>=65&&g<=90||Y(i))continue;const _=t[i];o.__exec[i]=_;const f=t.tag||"div";if(ft(f,i)&&!lt(f,i)){const p=at(i)||i,y=P(t,t[i+"Deps"],_),a=v(()=>{try{let h=y(t,t.state,t.context);typeof h=="string"&&h.includes("{{")&&(h=$.call(t,h,t.state)),t.node?.setAttribute&&(h==null||h===!1&&!ut(p)?t.node.removeAttribute(p):typeof h!="function"&&typeof h!="object"&&(p==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(p,H(p,h))))}catch(h){I(o,i,h)}},{depth:o.path.length,label:w(o,i)});a._attrName=p.toLowerCase(),o.__effects.push(a)}}const d=t.tag||"div";for(const i of Object.keys(t)){if(W.has(i))continue;const g=t[i];if(typeof g!="string"||!g.includes("{{"))continue;const _=i.charCodeAt(0);if(_>=65&&_<=90||Y(i)||lt(d,i)||$t[i]||!ft(d,i))continue;const f=at(i)||i,p=v(()=>{try{const y=$.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(f,H(f,y??""))}catch(y){I(o,i,y)}},{depth:o.path.length,label:w(o,i)});p._attrName=f.toLowerCase(),o.__effects.push(p)}if(Os(t),Ms(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,g=t.stateDeps;let _=!1,f=[];const p=v(()=>{const y=[];for(let l=0;l<g.length;l++){const b=g[l];try{y[l]=typeof b=="function"?b(t,t.state,t.context):t.state?.[b]}catch{y[l]=void 0}}if(!_){_=!0,f=y;return}let a=y.length!==f.length;for(let l=0;!a&&l<y.length;l++)y[l]!==f[l]&&(a=!0);const h=f;if(f=y,!a)return;const u=t.context?.designSystem;u&&N(u);try{i(t,t.state,t.context,{prev:h,next:y})}catch(l){if(t.context?.plugins?.length&&z("error",t,{hook:"onStateUpdate",error:l})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',l),t.context?.strictMode)throw l}finally{u&&M()}},{depth:o.path.length,label:w(o,"onStateUpdate")});o.__effects.push(p)}Ns(t)}function ko(t){const s=t.parent,o=s?.node;if(!o||!t.node){Wo(t,t.parent);return}let e=null;const r=Object.keys(s),c=r.indexOf(t.key);for(let n=c+1;n<r.length;n++){const d=s[r[n]];if(d?.node?.parentNode===o){e=d.node;break}}e?o.insertBefore(t.node,e):o.appendChild(t.node)}function jo(t,s,o){const e=P(t,t.ifDeps,o),r=v(()=>{let c;try{c=e(t,t.state,t.context)}catch(d){if(c=!1,s.__ifError=d,typeof console<"u"&&console.warn){const i=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${i} \u2014 treating as false:`,d?.message||d)}return}const n=s.__if;if(s.__if=!!c,n&&!s.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(d){console.error("[smbls] onRemove error:",d)}}else if(!n&&s.__if)if(s.__ifInitialized)t.node||(t.node=Ft(t)),t.node&&(t.node.ref=t),ko(t),Ht(t),F("Render",t,{}),Bt(t,{});else{if(s.__ifInitialized=!0,t.tag||(t.tag=so(t)),F("Init",t,{}),t.node||(t.node=Ft(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!s.__fragmentAnchor){const i=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(i),s.__fragmentAnchor=i}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),Ho(t,{}),vo(t,{skipIfEffect:!0}),Ht(t),Bo(t),Ko(t),Vo(t,{}),ko(t),F("Create",t,{}),F("Complete",t,{}),F("Render",t,{}),F("RenderRouter",t,{}),Bt(t,{})}},{depth:s.path.length,label:w(s,"if")});s.__effects.push(r)}function St(t,s){const o=t.node;if(!o)return;const e=s==null||typeof s=="object"?"":String(s);if(t.tag==="string"){o.nodeValue!==e&&(o.nodeValue=e);return}const r=t.__ref;let c=r?r.__textNode:null;if(c&&c.parentNode!==o&&(c=null),!c){const n=o.firstChild;n&&n.nodeType===3&&(c=n)}c?c.nodeValue!==e&&(c.nodeValue=e):o.firstChild?(c=(o.ownerDocument||t.context?.document||globalThis.document).createTextNode(e),o.insertBefore(c,o.firstChild)):(o.textContent=e,c=o.firstChild&&o.firstChild.nodeType===3?o.firstChild:null),r&&(r.__textNode=c||null)}function Eo(t,s){const o=t.node;if(!o||!("value"in o))return;const e=s==null?"":String(s);if(o.value===e)return;const r=typeof document<"u"&&document.activeElement===o,c=r&&typeof o.selectionStart=="number"?o.selectionStart:null,n=r&&typeof o.selectionEnd=="number"?o.selectionEnd:null;if(o.value=e,r&&c!=null&&n!=null)try{o.setSelectionRange(c,n)}catch{}}function Ht(t){const{node:s}=t;if(s){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&St(t,t.text),Uo(t),typeof t.html=="string"&&(s.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in s){const o=String(t.value);s.value!==o&&(s.value=o)}if(t.style&&typeof t.style=="object"){let o=t.style;for(const e in t.style)if(typeof t.style[e]=="function"){o={};for(const r in t.style)typeof t.style[r]!="function"&&(o[r]=t.style[r]);break}J(s,o)}if(t.attr&&typeof t.attr=="object")for(const o in t.attr){const e=t.attr[o];typeof e=="function"||typeof e=="object"||e!=null&&(typeof e=="string"&&e.includes("{{")||e===!1&&!ut(o)||s.setAttribute&&s.setAttribute(o,H(o,e)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&s.setAttribute&&s.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const o in t.data){const e=t.data[o];typeof e=="function"||typeof e=="object"||e==null||e===!1||typeof e=="string"&&e.includes("{{")||s.dataset&&(s.dataset[o]=e===!0?"":e)}if(t.classlist||t.class){const o=t.classlist||t.class;if(typeof o=="string")o.split(" ").forEach(e=>e&&s.classList.add(e));else if(typeof o=="object")for(const e in o){const r=typeof o[e]=="function"?o[e](t,t.state,t.context):o[e];r&&s.classList.add(typeof r=="string"?r:e)}}}}function wt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function vs(t){if(!t||typeof t!="object")return!1;for(const s in t){const o=t[s];if(o&&typeof o=="object"&&!Array.isArray(o))return!0}return!1}function vt(t,s){if(!t||!t.style||!s)return null;const o=t.style,e=[];for(const r in s){if(s[r]==null||r.charAt(0)==="&")continue;const n=kt(r);e.push(n,Vt(o,n),To(o,n))}return e}function Vt(t,s){return typeof t.getPropertyValue=="function"?t.getPropertyValue(s):""}function To(t,s){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(s):""}function kt(t){return Et(t)?t:t.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())}function ks(t,s,o){if(!t||!t.style||!s||!s.length)return;const e=t.style,r=new Set;if(o&&typeof o=="object")for(const c in o)o[c]==null||c.charAt(0)==="&"||r.add(kt(c));for(let c=0;c<s.length;c+=3){const n=s[c];r.has(n)||Vt(e,n)===s[c+1]&&typeof e.removeProperty=="function"&&e.removeProperty(n)}}function jt(t,s){if(!s||!t||!t.style)return!1;const o=t.style;for(let e=0;e<s.length;e+=3)if(Vt(o,s[e])!==s[e+1]||To(o,s[e])!==s[e+2])return!1;return!0}const Et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45;function js(t){let s=null;for(const o in t)t[o]!=null&&o.charAt(0)!=="&"&&(s||(s=new Set),s.add(kt(o)));return s}function Es(t,s,o,e){const r=t.__ref;if(!r)return;let c=null;if(o)for(const n of o){if(e&&e.has(n))continue;const d=s[n];if(d==null||typeof d=="object")continue;const i=kt(n);uo[i]&&(c||(c={}),c[i]=d)}r.__declaredLonghands=c}function Po(t,s){const o=t.__ref,e=o&&o.__declaredLonghands;if(!e||!s)return null;let r=null;for(const c in e){if(s.has(c))continue;const n=uo[c];let d=!1;for(let i=0;i<n.length;i++)if(s.has(n[i])){d=!0;break}d&&(r||(r={}),r[c]=e[c])}return r}function Lo(t,s){const o=t.node;J(o,s);const e=js(s);if(!e)return s;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const n of e)r.__inlineCssKeys.add(n);else r.__inlineCssKeys=new Set(e);const c=Po(t,e);return c?(J(o,c),Object.assign({},s,c)):s}function Ts(t){const s=t.__ref;if(!s||!s.__inlineCssKeys||!s.__declaredLonghands)return;const o=Po(t,s.__inlineCssKeys);o&&J(t.node,o)}function J(t,s){if(!t||!s||!t.style)return;let o=null;for(const e in s){const r=s[e];if(r!=null){if(e.charAt(0)==="&"&&typeof r=="object"){o||(o={}),o[e]=r;continue}try{const c=String(r),n=Et(e)?e:e.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),d=c.trim(),i=/\s*!important\s*$/.test(d),g=d.replace(/\s*!important\s*$/,"");t.style.setProperty(n,g,i?"important":"")}catch{}}}o&&Ps(t,o)}function Ps(t,s){const o=`_ds${po.scopedStyleId++}`;t.classList.add(o);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 c="";for(const n in s){const d="."+o,i=n.replace(/&/g,d).split(",").map(_=>{const f=_.trim();return f.includes(d)?f:d+f}).join(", "),g=s[n];if(typeof g=="object"){let _="",f="";for(const p in g){const y=g[p];if(typeof y=="object"){const a=p.includes("&")?i.split(", ").map(u=>p.replace(/&/g,u)).join(", "):i.split(", ").map(u=>`${u} ${p}`).join(", ");let h="";for(const u in y)h+=`${u.replace(/[A-Z]/g,l=>"-"+l.toLowerCase())}: ${y[u]};`;f+=ao(`${a} { ${h} }`,a)+`
|
|
5
|
+
`}else _+=`${p.replace(/[A-Z]/g,a=>"-"+a.toLowerCase())}: ${y};`}_&&(c+=ao(`${i} { ${_} }`,i)+`
|
|
6
|
+
`),f&&(c+=f)}}c&&(r.textContent+=c)}const Oo=new Set;function Ro(t){if(!Array.isArray(t))return"";const s=[];for(let o=0;o<t.length;o++)typeof t[o]=="string"&&t[o].length&&s.push(t[o]);return s.sort(),s.join("|")}function Ls(t,s,o){const e=Ro(o);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=s(t,t.state,t.context)}catch{return}if(Ro(r)===e)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";Oo.has(c)||(Oo.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${o.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 Os(t){const s=t.subscribeTo,o=typeof s=="function";let e=s;if(o)try{e=s(t,t.state,t.context)}catch{e=null}if(o&&tt()&&Ls(t,s,Array.isArray(e)?e:[]),!Array.isArray(e)||e.length===0)return;const r=t.__ref;for(let c=0;c<e.length;c++){const n=e[c];if(typeof n!="string"||n.length===0)continue;const d=n.split("."),i=d[0],g=d.slice(1),_={value:!1},f=v(()=>{const p=t.state&&(q(t.state)?t.state.root:null);if(!p||!q(p))return;let y=p;y=y[i];for(let h=0;h<g.length&&!(y==null||typeof y!="object");h++)if(q(y))y=y[g[h]];else break;if(!_.value)return;let a=!1;if(typeof t.onBeforeUpdate=="function"){const h=t.context?.designSystem;h&&N(h);try{if(Ks(r)){const u=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});u&&typeof u.then=="function"?u.then(()=>Ot(r,!1),l=>{Ot(r,!0),t.context?.plugins?.length&&z("error",t,{hook:"onBeforeUpdate",error:l})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",l)}):(Ot(r,!1),u===!1&&(a=!0))}}catch(u){Ot(r,!0),t.context?.plugins?.length&&z("error",t,{hook:"onBeforeUpdate",error:u})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",u)}finally{h&&M()}}if(!a&&t.node&&r.__effects)for(let h=0;h<r.__effects.length;h++){const u=r.__effects[h];u&&u!==f&&!u._disposed&&!u._isSubscribeToEffect&&typeof u._execute=="function"&&u._execute()}if(!a&&typeof t.onUpdate=="function"){const h=t.context?.designSystem;h&&N(h);try{t.onUpdate(t,t.state,t.context)}catch(u){t.context?.plugins?.length&&z("error",t,{hook:"onUpdate",error:u})||console.error("[DOMQL] subscribeTo onUpdate error:",u)}finally{h&&M()}}},{depth:r.path.length,label:w(r,"subscribeTo("+n+")")});_.value=!0,f._isSubscribeToEffect=!0,r.__effects.push(f)}}function Wt(t,s){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!s.context?.designSystem?.media?.[t.slice(1)])}function zt(t,s){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const o=s.context?.designSystem?.media?.[t.slice(1)];return o?/^@(media|supports|container)\b/.test(o)?o:`@media ${o}`:t}const Do=new Set;function Rs(t,s){const o=s?.__ref?.path?s.__ref.path.join("."):s?.key||"?",e=o+"::"+t;Do.has(e)||(Do.add(e),console.warn(`[smbls/css] "${t}" at ${o} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function et(t,s,o,e){const r={},c=new Set,n=(d,i,g)=>{const _=g?new Set(Object.keys(r)):null;if(R[d]){const f=R[d](i,s,s.state,s.context);if(f){const p=Array.isArray(f)?f:[f];for(const y of p)y&&Object.assign(r,y)}}else r[d]=i;if(g)for(const f in r)_.has(f)||c.add(f)};for(const d in t){if(!Object.prototype.hasOwnProperty.call(t,d))continue;let i=t[d];if(typeof i=="function"&&(i=i(s,s.state,s.context)),i==null||typeof i=="function")continue;if(typeof i=="object"&&!Array.isArray(i)){if(d==="style"){for(const y in i){let a=i[y];if(typeof a=="function"&&(a=a(s,s.state,s.context)),a==null||typeof a=="function")continue;const h=typeof s[y]=="function"&&(R[y]||D&&D.has(y))||!!(e&&e.has(y));n(y,a,h)}continue}if(Wt(d,s)){const y=et(i,s,!1,e);Object.keys(y).length&&(r[`[data-theme="${d.slice(1)}"] &`]=y);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(d)){tt()&&Rs(d,s);continue}const f=zt(d,s),p=et(i,s,!1,e);Object.keys(p).length&&(r[f]=p);continue}const g=typeof s[d]=="function"&&(R[d]||D&&D.has(d)),_=!!(e&&e.has(d));n(d,i,g||_)}if(o)for(const d in r)c.add(d);for(const d of c){const i=r[d];typeof i=="string"&&!i.includes("!important")&&(r[d]=i+" !important")}return r}const Tt=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function No(t,s){for(const o in s){const e=s[o];t[o]=Tt(e)?No(Tt(t[o])?t[o]:{},e):e}return t}function Ds(t,s){if(!Tt(s))return;let o;for(const e of t.split(" ")){const r=e?s[e]:null;Tt(r)&&(o=No(o||{},r))}return o}function Yt(t,s){if(s===void 0&&(s=0),s>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&Yt(t[o],s+1))return!0}return!1}function Mo(t,s,o){if(!s||typeof s!="object"||Array.isArray(s))return null;if(Wt(t,o)){const c=et(s,o,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const e=zt(t,o),r=et(s,o,!1);return Object.keys(r).length?{cssProp:e,block:r}:null}function Ns(t){const s=t.__ref;for(const o of Object.keys(t)){if(!Kt(o))continue;const e=t[o];if(!e||typeof e!="object"||Array.isArray(e)||!Yt(e))continue;let r=null,c;const n=v(()=>{if(!t.node)return;const d=t.context?.designSystem;d&&N(d);let i,g=!1;try{const _=Mo(o,e,t),f=_?wt(_.block)+"::"+_.cssProp:null;if(f!==null&&f===c)g=!0;else if(c=f,_){const p=ct({[_.cssProp]:_.block},null,t.context?.cssPrefix);i=p?p.split(" ").filter(Boolean):null}else i=null}finally{d&&M()}if(!(g||!t.node.classList)){if(r)for(const _ of r)t.node.classList.remove(_);if(i&&i.length)for(const _ of i)t.node.classList.add(_);r=i}},{depth:s.path.length,label:w(s,"cssBlock("+o+")")});s.__effects.push(n)}}function Ms(t){const s=t.__ref;s.__conditionalRunners=[];const o=new Map;for(const e of Object.keys(t)){const r=e.charAt(0);if(r!=="."&&r!=="!")continue;const c=e.slice(1);if(!c)continue;if(/[:@\s>~+[\]]/.test(c)){if(typeof console<"u"&&console.warn){const a=c.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${r}\` is read as one prop name. Nest the selector inside instead: \`${r}${a}: { '${c.slice(a.length)}': {...} }\`.`)}continue}const n=t[e];if(!n||typeof n!="object")continue;const d=r==="!",i={lastMatch:!1,appliedKeys:null,appliedClasses:null},g=new Set;for(const a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;const h=a.charAt(0),u=n[a];(h===":"||h==="@"||h==="&"||h==="[")&&u&&typeof u=="object"&&!Array.isArray(u)||g.add(a)}const _=()=>{let a;const h=t[c];if(h===void 0){const b=!!t.state&&c in t.state,A=t.state?t.state[c]:void 0;if(b||A!==void 0)a=A;else{const S=t.context?.cases?.[c];if(S===void 0)return;try{a=typeof S=="function"?S.call(t,t):S}catch(C){a=!1,s.__conditionalError=C,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,C?.message||C)}}}else if(typeof h=="function")try{a=h(t,t.state,t.context)}catch(b){a=!1,s.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else a=h;const u=d?!a:!!a;if(!t.node||u===i.lastMatch)return;i.lastMatch=u;const l=t.context?.designSystem;l&&N(l);try{if(u){const b={},A={};let S=!1;for(const x in n){if(!Object.prototype.hasOwnProperty.call(n,x))continue;const E=n[x],U=x.charAt(0);if((U===":"||U==="@"||U==="&"||U==="[")&&E&&typeof E=="object"&&!Array.isArray(E)){if(Wt(x,t)){const T=et(E,t,!1,g);Object.keys(T).length&&(A[`[data-theme="${x.slice(1)}"] &`]=T,S=!0)}else{const T=zt(x,t),Z=et(E,t,!1,g);Object.keys(Z).length&&(A[T]=Z,S=!0)}continue}const L=typeof E=="function"?E(t,t.state,t.context):E;if(L!=null)if(R[x]){const T=R[x](L,t,t.state,t.context);if(T){const Z=Array.isArray(T)?T:[T];for(const gt of Z)gt&&Object.assign(b,gt)}}else(D&&D.has(x)||Et(x))&&(b[x]=L)}const C=Object.keys(b);if(C.length){J(t.node,b);for(const x of C)o.set(x,e);i.appliedKeys=C}else i.appliedKeys=null;if(S){const x=ct(A,null,t.context?.cssPrefix,{state:!0}),E=x?x.split(" ").filter(Boolean):[];if(E.length&&t.node.classList){for(const U of E)t.node.classList.add(U);i.appliedClasses=E}else i.appliedClasses=null}else if(i.appliedClasses){for(const x of i.appliedClasses)t.node.classList.remove(x);i.appliedClasses=null}}else{if(i.appliedKeys){for(const b of i.appliedKeys)o.get(b)===e&&(Et(b)?t.node.style.removeProperty(b):t.node.style[b]="",o.delete(b));i.appliedKeys=null}if(i.appliedClasses){for(const b of i.appliedClasses)t.node.classList.remove(b);i.appliedClasses=null}}}finally{l&&M()}};s.__conditionalRunners.push(_);const f=P(t,t[c+"Deps"],_),p=v(f,{depth:s.path.length,label:w(s,"conditional("+e+")")}),y=s.__exec&&s.__exec[c]||t[c];p._sources.size===0&&typeof y=="function"&&tt()&&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 \`${c}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),s.__effects.push(p)}}const qt=new WeakSet;function Fs(t){const s=t.ownerDocument;!s||qt.has(s)||(qt.add(s),queueMicrotask(()=>{qt.delete(s);const o=s.body||s.documentElement;o&&o.offsetWidth}))}const Zt=new WeakSet;let Fo=!1;function $o(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Qt(t,s){const o={...t};for(const e in s){const r=s[e],c=o[e];o[e]=r&&typeof r=="object"&&c&&typeof c=="object"?Qt(c,r):r}return o}function Io(t,s){const o={};for(const e in t){const r=t[e];if(r&&typeof r=="object"){const c=Io(r,s);Object.keys(c).length&&(o[e]=c)}else s.has(e)||(o[e]=r)}return o}function Uo(t){const{node:s}=t;if(!s)return;if(Fo||(Fo=!0,ct({display:"none"})),Zt.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Zt.add(t);const o=t.context?.designSystem;o&&N(o),co();try{const e={};let r=!1,c=[],n=null,d=null,i=null;const g=(a,h)=>{if(h&&typeof h=="object"&&$o(a)){d||(d={});const u=d[a];u&&(h=Qt(u,h)),d[a]=h}else(h===null||typeof h!="object")&&(i||(i=new Set),i.add(a));e[a]=h};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&R.theme){const a=R.theme(t.theme,t,t.state,t.context);if(a){const h=u=>{for(const l in u){const b=u[l];b&&typeof b=="object"&&$o(l)&&(n||(n={}),n[l]=b),e[l]=b}};if(Array.isArray(a))for(const u of a)u&&h(u);else h(a);r=!0}}const _=(a,h)=>{if(R[a]){const u=R[a](h,t,t.state,t.context);if(u){if(Array.isArray(u)){for(const l of u)if(l)for(const b in l)g(b,l[b])}else for(const l in u)g(l,u[l]);r=!0}}else if(D&&D.has(a))h!=null&&typeof h!="object"&&(g(a,h),r=!0);else if(a.charCodeAt(0)===45)h!=null&&typeof h!="object"&&(g(a,h),r=!0);else if((a.charAt(0)==="&"||a.charAt(0)==="@"||a.charAt(0)===":"||a.charAt(0)==="[")&&h&&typeof h=="object"&&!Array.isArray(h)){if(Yt(h))return;const u=Mo(a,h,t);u&&(g(u.cssProp,u.block),r=!0)}};if(typeof t.class=="string"){const a=Ds(t.class,t.context?.designSystem?.class);if(a)for(const h in a)_(h,a[h])}const f=i?new Set(i):null,p=t.tag||"div";for(const a of Object.keys(t)){if(typeof t[a]=="function"||W.has(a)||a==="theme")continue;const h=a.charCodeAt(0);h>=65&&h<=90||Y(a)||lo(p,a)||_(a,t[a])}if(n)for(const a in n){let h=i?Io(n[a],i):n[a];d&&d[a]&&(h=Qt(h,d[a])),Object.keys(h).length?e[a]=h:delete e[a]}if(Es(t,e,i,f),r){e.display&&String(e.display).includes("!important")&&(s.style.setProperty("display",String(e.display).replace(/\s*!important\s*$/,""),"important"),delete e.display);const a=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof a=="string"&&a!==""&&e.display&&e.display!==a&&(e.display=a);const h=ct(e,null,t.context?.cssPrefix);if(c=h?h.split(" ").filter(Boolean):[],h&&s.classList){const u=c;let l=!1;for(const b of u)s.classList.add(b),l||(b.charCodeAt(0)===95&&b.charCodeAt(1)===99||b.charCodeAt(0)===95&&b.indexOf("_c",1)!==-1)&&(l=!0);l&&Fs(s)}}const y=t.__ref;if(y){const a=y.__staticCssClasses;if(a&&s.classList){const h=new Set(c);for(const u of a)h.has(u)||s.classList.remove(u)}y.__staticCssClasses=c}Ts(t)}finally{fo(),o&&M(),Zt.delete(t)}}const pe=t=>!!R[t]||!!(D&&D.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function he(t){t&&t.node&&Uo(t)}function Bo(t){const{node:s}=t;if(!s||!s.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const c=t.aria[r];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const n="aria-"+r.replace(/[A-Z]/g,d=>"-"+d.toLowerCase());s.setAttribute(n,H(n,c))}const o=ns(t);for(const r in o){const c=o[r];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&s.setAttribute(r,c===!0?"":c)}const e=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||W.has(r)||r==="on"||o[r]!==void 0)continue;const c=r.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(r)&&!lt(e,r)&&ft(e,r)){let n=t[r];if(n==null)continue;if(typeof n=="string"&&n.includes("{{")){if(!$t[r])continue;n=$.call(t,n,t.state)}if(n==null||typeof n=="function"||typeof n=="object"||n===!1&&!ut(at(r)||r))continue;const d=at(r)||r;s.setAttribute(d,H(d,n))}}}function ye(t,s){const{node:o}=t;if(!o||!o.setAttribute)return;const e=s.charCodeAt(0);if(e>=65&&e<=90||Y(s))return;const r=t.tag||"div";if(lt(r,s)||!ft(r,s))return;const c=at(s)||s,n=c.toLowerCase(),d=t.__ref&&t.__ref.__effects;let i=!1;if(d)for(let f=0;f<d.length;f++){const p=d[f];p&&p._attrName===n&&!p._disposed&&typeof p._execute=="function"&&(i=!0,p._execute())}if(i)return;let g=t[s];const _=$t[s];if(_&&g!=null){const f=_(t);f!==void 0&&(g=f)}typeof g=="string"&&g.includes("{{")&&(g=$.call(t,g,t.state)),g==null||g===!1&&!ut(c)?o.removeAttribute(c):typeof g!="function"&&typeof g!="object"&&o.setAttribute(c,H(c,g))}function $s(t,s){const o=t.node,e=t.__ref;let r=e.__autoGrow;if(!s){if(r&&r.active){try{o.removeEventListener("input",r.resize)}catch{}Pt(r),Q.delete(t),o.style.height="",r.appliedMax!=null&&o.style.maxHeight===r.appliedMax&&(o.style.maxHeight=""),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=e.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,layoutWatch:null,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!o.isConnected){Xt(t,!0);return}if(!(o.scrollHeight>0)){Us(t,r);return}Pt(r);const n=o.style.height;o.style.height="auto";const d=o.scrollHeight;if(!(d>0)){o.style.height=n;return}o.style.height=d+"px",r.lastMeasure=d}},e.__eventCleanup||(e.__eventCleanup=[]),e.__eventCleanup.push(()=>{try{o.removeEventListener("input",r.resize)}catch{}Pt(r),Q.delete(t)})),r.active||(o.addEventListener("input",r.resize),r.active=!0);const c=typeof s=="object"&&s.max!=null?String(s.max):null;c!==r.appliedMax&&(c==null?r.appliedMax!=null&&o.style.maxHeight===r.appliedMax&&(o.style.maxHeight=""):o.style.maxHeight=c,r.appliedMax=c),r.resize()}function Xt(t,s){const o=t.__ref?.__autoGrow;o&&(s&&(o.attachAttempts=0,o.firstAttemptAt=null),Q.add(t),xt())}function Is(){const t=Array.from(Q);Q.clear();for(let s=0;s<t.length;s++){const o=t[s],e=o.node,r=o.__ref?.__autoGrow;if(!(!e||!r||!r.active)){if(!e.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=st()),r.attachAttempts+=1,r.attachAttempts<=_o&&st()-r.firstAttemptAt<go&&(Q.add(o),xt());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function Us(t,s){if(s.layoutWatch)return;const o=t.node;if(!o)return;const e=o.ownerDocument&&o.ownerDocument.defaultView,r=e&&e.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const c=()=>{!o.isConnected||!(o.scrollHeight>0)||(Pt(s),Xt(t,!0))};let n;try{n=new r(c),n.observe(o)}catch{return}s.layoutWatch=n}function Pt(t){const s=t.layoutWatch;if(s){t.layoutWatch=null;try{s.disconnect()}catch{}}}function Ko(t){if(!t.autoGrow)return;const s=t.node;if(!s||s.tagName!=="TEXTAREA")return;const o=t.__ref,e=t.autoGrow,r=typeof e=="function"?P(t,t.autoGrowDeps,e):null,c=v(()=>{const n=t.autoGrow;let d=n;if(typeof n=="function")try{d=(n===e&&r?r:n)(t,t.state,t.context)}catch{d=null}$s(t,d)},{depth:o.path.length,label:w(o,"autoGrow")});o.__effects||(o.__effects=[]),o.__effects.push(c),r&&(o.__exec.autoGrow=e)}const Go=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ho(t,s){for(const o of Object.keys(t)){if(!Y(o)||Go.has(o))continue;const e=mo(o);if(e){Jo(e,t,t[o]);continue}let r=t[o];if(typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const n=r;r=function(i){return t.call(n,i)}}if(typeof r!="function")continue;const c=ls(o);Qo.has(c)||Xo(ds(c),t,r)}Bs(t)}function Bs(t){const s=t.node;if(!s||!s.addEventListener)return;const o={};let e=!1;for(const p of Go){const y=t[p];typeof y=="function"&&(o[p]=y,e=!0)}if(!e)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let n=0,d=0,i=0,g=!1;const _=p=>{const y=p.touches&&p.touches[0]||p.changedTouches&&p.changedTouches[0];y&&(n=y.clientX,d=y.clientY,i=Date.now(),g=!0)},f=p=>{if(!g)return;g=!1;const y=p.changedTouches&&p.changedTouches[0]||p.touches&&p.touches[0];if(!y)return;const a=y.clientX-n,h=y.clientY-d,u=Date.now()-i;if(u>c)return;const l=Math.abs(a),b=Math.abs(h);if(Math.max(l,b)<r)return;let A;if(l>b*1.2)A=a<0?"left":"right";else if(b>l*1.2)A=h<0?"up":"down";else return;const S="onSwipe"+A.charAt(0).toUpperCase()+A.slice(1),C=o[S],x=o.onSwipe;C&&C.call(t,p,t,t.state,t.context),x&&x.call(t,{direction:A,dx:a,dy:h,dt:u,event:p},t,t.state,t.context)};s.addEventListener("touchstart",_,{passive:!0}),s.addEventListener("touchend",f,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{s.removeEventListener("touchstart",_)}catch{}try{s.removeEventListener("touchend",f)}catch{}})}function _t(t,s){const o={...t};for(const e in s){const r=o[e],c=s[e];r&&c&&typeof r=="object"&&typeof c=="object"&&!Array.isArray(r)&&!Array.isArray(c)&&typeof r!="function"&&typeof c!="function"?o[e]=_t(r,c):o[e]=c}return o}function Jt(t,s,o,e){if(!s||!t.node)return;const r=t.childExtends;if(Array.isArray(s)){const c=t.tag==="fragment",n=t.context?.document||globalThis.document,d=c?null:n?.createDocumentFragment();if(!c&&!d)return;const i=t.childProps,g=t.childrenAs,_=u=>{let l=s[u];const b=l;(typeof l=="string"||typeof l=="number")&&(l={text:l});let A=i;if(typeof i=="function")try{A=i(t,l)}catch{A=null}if(g==="state"){let C=b;(typeof b=="string"||typeof b=="number")&&(C={value:b,text:b}),l=A?{...A,state:C}:{state:C}}else A&&(l=_t(A,l));if(r&&!l.ignoreChildExtends)if(l.extends){const C=Array.isArray(l.extends)?l.extends:[l.extends],x=Array.isArray(r)?r:[r];l={...l,extends:[...x,...C]}}else l={...l,extends:r};const S=Ao(l?.key,b,u);try{return X(l,t,S,o)}catch(C){if(typeof console<"u"&&console.error){const x=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${S}" failed to construct at ${x} (initial render, skipping this row):`,C?.message||C)}return null}},f=t.__ref;if(!(e===!0&&!c&&!!f&&(o?.mountYield===!0||t.yieldChildren===!0))){for(let u=0;u<s.length;u++){const l=_(u);!c&&l?.node&&d.appendChild(l.node)}return c||t.node.appendChild(d),!0}const y=f.__childrenChunkGen=(f.__childrenChunkGen||0)+1;no();let a=null;const h=u=>{if(f.__disposed||f.__childrenChunkGen!==y){a&&a.parentNode&&a.remove();return}for(let l=u;l<s.length;l++){const b=_(l);if(b?.node&&(a?t.node.insertBefore(b.node,a):d.appendChild(b.node)),l+1<s.length&&eo()){a||(a=n.createComment("smbls-mount"),d.appendChild(a),t.node.appendChild(d));const A=l+1;io(()=>h(A));return}}a?(a.remove(),t.node.tagName==="SELECT"&&Lt(t,!0)):t.node.appendChild(d)};return h(0),ro(),!0}if(typeof s=="string"){const c=xo(s,t);if(Array.isArray(c))return Jt(t,c,o,e)}if(typeof s=="object")for(const c in s){if(W.has(c))continue;let n=s[c];if(!(n==null||n===!1)){if((typeof n=="string"||typeof n=="number")&&(n={text:n}),t.childProps&&(n=_t(t.childProps,n)),r&&!n.ignoreChildExtends)if(n.extends){const d=Array.isArray(n.extends)?n.extends:[n.extends],i=Array.isArray(r)?r:[r];n={...n,extends:[...i,...d]}}else n={...n,extends:r};X(n,t,c,o)}}}function Lt(t,s){const o=t.node;if(!o||o.tagName!=="SELECT")return;const e=o.options;if(!e||!e.length)return;const r=t.__ref,c=r&&r.__exec&&r.__exec.value,n=typeof c=="function",d=t.value!=null&&typeof t.value!="function";if(n||d){let _;if(n)try{_=c(t,t.state,t.context)}catch{return}else _=t.value,typeof _=="string"&&_.includes("{{")&&(_=$.call(t,_,t.state));const f=_==null?"":String(_);o.value!==f&&(o.value=f);return}const i=s||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!i)return;let g=-1;for(let _=0;_<e.length;_++)e[_].defaultSelected&&(g=_);g>=0&&o.selectedIndex!==g&&(o.selectedIndex=g)}function Vo(t,s){let{children:o,content:e}=t;const r=t.childExtends;if(typeof o=="function"){const f=o;try{o=f(t,t.state,t.context)}catch(u){if(o=void 0,typeof console<"u"&&console.error){const l=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${l} (initial run, treating as empty):`,u?.message||u)}}t.children=o;const p=t.__ref;let y=!1;const a=P(t,t.childrenDeps,f),h=v(()=>{const u=y;y=!0;let l;try{l=a(t,t.state,t.context)}catch(L){if(typeof console<"u"&&console.error){const T=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${T}${u?"":" (initial tracking run)"}:`,L?.message||L)}return}if(!u||l===t.children)return;t.children=l,p.__childrenChunkGen!=null&&p.__childrenChunkGen++;const b=typeof t.onContentUpdate=="function",A=b?[]:null,S=b?[]:null,C=b?[]:null;if(Array.isArray(l)&&t.childrenAs==="state"){const L=t.childProps,T=[],Z=new Map;for(let k=0;k<l.length;k++){const K=l[k];let j=L;if(typeof L=="function")try{j=L(t,K)}catch{j=null}const V=Ao(j&&j.key,K,k);T.push(V),Z.set(V,{rawChild:K,childProps:j})}const gt=new Set(T),zo=p.__children.slice();for(const k of zo)if(!gt.has(k)){const K=t[k];K?.remove&&K.remove(),delete t[k],S&&S.push(k)}const nt=t.childExtends,bt=t.tag==="fragment",Yo=t.context?.document||globalThis.document,rt=bt?null:Yo?.createDocumentFragment(),Rt=new Set;for(const k of T){const K=Z.get(k),j=K.rawChild,V=t[k];if(V&&V.state){if(j&&typeof j=="object"){const O=V.state,m=O.$replace||O.replace,oo=O.$update||O.update;try{if(typeof m=="function")m.call(O,j);else if(typeof oo=="function"){for(const B in O)if(!(B==="__element"||B==="root"||B==="parent"||B==="update")&&!Object.prototype.hasOwnProperty.call(j,B))try{O[B]=void 0}catch{}oo.call(O,j)}else for(const B in j)O[B]=j[B]}catch(B){if(typeof console<"u"&&console.error){const qo=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to patch at ${qo} (reconcile, keeping its previous data for this pass):`,B?.message||B)}}}C&&C.push(k);continue}let Dt=j;(typeof j=="string"||typeof j=="number")&&(Dt={value:j,text:j});const to=K.childProps;let G=to?{...to,state:Dt}:{state:Dt};if(nt&&!G.ignoreChildExtends)if(G.extends){const O=Array.isArray(G.extends)?G.extends:[G.extends],m=Array.isArray(nt)?nt:[nt];G={...G,extends:[...m,...O]}}else G={...G,extends:nt};let Nt;try{Nt=X(G,t,k,s)}catch(O){if(typeof console<"u"&&console.error){const m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${m} (reconcile, skipping this row):`,O?.message||O)}Rt.add(k);continue}!bt&&Nt?.node&&rt&&rt.appendChild(Nt.node),A&&A.push(k)}if(!bt&&rt&&rt.childNodes.length&&t.node&&t.node.appendChild(rt),!bt&&t.node){let k=null;for(const K of T){const j=t[K]?.node;if(!j)continue;const V=k?k.nextSibling:t.node.firstChild;j!==V&&t.node.insertBefore(j,V),k=j}}p.__children=Rt.size?T.filter(k=>!Rt.has(k)):T,b&&(A.length||S.length)&&bo(t,{added:A,removed:S,kept:C}),Lt(t,!1);return}const U=b?[...p.__children]:null;for(const L of[...p.__children]){const T=t[L];T?.remove&&T.remove(),delete t[L]}p.__children=[],Jt(t,l,s),Lt(t,!1),b&&bo(t,{added:[...p.__children],removed:U,kept:[]})},{depth:p.path.length,label:w(p,"children")});p.__effects.push(h)}const c=Jt(t,o,s,!0);if(e!=null&&!(e&&e.__ref)){let f=e;if(typeof f=="string"||typeof f=="number"?f={text:f}:typeof f!="object"&&(f={}),t.childProps&&(f=_t(t.childProps,f)),r&&!f.ignoreChildExtends)if(f.extends){const p=Array.isArray(f.extends)?f.extends:[f.extends],y=Array.isArray(r)?r:[r];f={...f,extends:[...y,...p]}}else f={...f,extends:r};X(f,t,"content",s)}if(o&&!c)return;const n=t.context?.components||{};{const f=Object.keys(t);for(let p=0;p<f.length;p++){const y=f[p];if(!y.endsWith("Extends")||typeof t[y]!="string")continue;const a=y.slice(0,-7);if(!a||a.charCodeAt(0)<65||a.charCodeAt(0)>90)continue;const h={extends:t[y]};delete t[y];for(let u=p+1;u<f.length;u++){const l=f[u],b=l.charCodeAt(0);if(b>=65&&b<=90||W.has(l)||typeof t[l]=="function"&&(l.startsWith("on")||l.startsWith(".")))break;const A=t[l];A!==void 0&&(h[l]=A,delete t[l])}t[a]&&typeof t[a]=="object"?t[a]={...h,...t[a]}:t[a]=h}}const d=s?.mountYield===!0||t.yieldChildren===!0,i=Object.keys(t),g=f=>{if(W.has(f)||typeof t[f]!="object"||t[f]===null)return;const p=f.charCodeAt(0);if(p<65||p>90)return;let y=t[f];if(!y.__ref){if(!y.extends&&!y.extend){const a=n[f]||n[`smbls.${f}`];a&&(y={...y,extends:a})}if(t.childProps&&(y=_t(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const a=Array.isArray(y.extends)?y.extends:[y.extends],h=Array.isArray(r)?r:[r];y={...y,extends:[...h,...a]}}else y={...y,extends:r};X(y,t,f,s)}};if(!d){for(const f of i)g(f);return}no();const _=f=>{for(let p=f;p<i.length;p++)if(g(i[p]),p+1<i.length&&eo()){const y=p+1;io(()=>_(y));return}};_(0),ro()}function Wo(t,s,o){const{node:e}=t;if(!e)return;e.ref=t;const r=s?.tag==="fragment"?s.__ref?.__fragmentAnchor:null;if(r){const n=r.parentNode;if(n){if(o?.position==="before"&&o.node)n.insertBefore(e,o.node);else if(o?.position==="after"&&o.node){const d=o.node.nextSibling;n.insertBefore(e,d||r)}else n.insertBefore(e,r);return}}const c=s?.node||(s?.nodeType?s:null);if(c)if(o?.position==="before"&&o.node)c.insertBefore(e,o.node);else if(o?.position==="after"&&o.node){const n=o.node.nextSibling;n?c.insertBefore(e,n):c.appendChild(e)}else c.appendChild(e)}const mt=3;function Ks(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=mt?!1:(t.__inBeforeUpdate=!0,!0)}function Ot(t,s){t&&(t.__inBeforeUpdate=!1,s?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===mt&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${mt}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,s,o){const e=t.charAt(0).toLowerCase()+t.slice(1);s.context?.plugins?.length&&z(e,s,o);const r="on"+t,c=s[r];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(s.__ref[i])return!0;s.__ref[i]=!0}const g=s.context?.designSystem;g&&N(g);let _=!!i;try{const f=c(s,s.state,s.context,o);if(f&&typeof f.then=="function"){const p=s.__ref;return f.catch(y=>{s.context?.plugins?.length&&z("error",s,{hook:r,error:y})||console.error(`[DOMQL] Lifecycle "${r}" error:`,y)}).finally(()=>{i&&p&&(p[i]=!1)}),_=!1,!0}if(f===!1)return!1}catch(f){if(s.context?.plugins?.length&&z("error",s,{hook:r,error:f})||console.error(`[DOMQL] Lifecycle "${r}" error:`,f),s.context?.strictMode)throw f}finally{g&&M(),_&&s.__ref&&(s.__ref[i]=!1)}}return!0}var _e=X;export{mt as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Ks as acquireBeforeUpdateGuard,X as create,_e as default,Ut as flushMounts,pe as isStaticCssProp,he as recompileStaticCss,ye as reconcileAttrProp,Ot as releaseBeforeUpdateGuard,St as writeElementText};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=(o,i)=>i.split(" ").map(g=>o+"-"+g),a="top right bottom left",l=a+" block block-start block-end inline inline-start inline-end",e="start end",r="width style color",s=o=>t(o,l),p=(()=>{const o=t("border","width style color image");for(const i of l.split(" "))o.push("border-"+i,...t("border-"+i,r));return o})(),c=o=>[...t("border-"+o,r+" start end"),...t("border-"+o+"-start",r),...t("border-"+o+"-end",r)],n={animation:t("animation","name duration timing-function delay iteration-count direction fill-mode play-state timeline range range-start range-end"),background:t("background","image position position-x position-y size repeat origin clip attachment color"),border:p};for(const o of["width","style","color"])n["border-"+o]=l.split(" ").map(i=>"border-"+i+"-"+o);for(const o of a.split(" "))n["border-"+o]=t("border-"+o,r);n["border-block"]=c("block"),n["border-inline"]=c("inline"),Object.assign(n,{"border-image":t("border-image","source slice width outset repeat"),"border-radius":"top-left top-right bottom-right bottom-left start-start start-end end-start end-end".split(" ").map(o=>"border-"+o+"-radius"),columns:t("column","width count"),"column-rule":t("column-rule",r),container:t("container","name type"),"contain-intrinsic-size":t("contain-intrinsic","width height"),flex:t("flex","grow shrink basis"),"flex-flow":t("flex","direction wrap"),font:[...t("font","style variant weight stretch size"),"line-height",...t("font","family size-adjust kerning feature-settings variation-settings optical-sizing")],gap:["row-gap","column-gap"],grid:t("grid","template template-rows template-columns template-areas auto-rows auto-columns auto-flow"),"grid-template":t("grid-template","rows columns areas"),"grid-area":t("grid","row column row-start row-end column-start column-end"),"grid-row":t("grid-row",e),"grid-column":t("grid-column",e),inset:[...a.split(" "),...t("inset","block block-start block-end inline inline-start inline-end")],"inset-block":t("inset-block",e),"inset-inline":t("inset-inline",e),"list-style":t("list-style","type position image"),margin:s("margin"),"margin-block":t("margin-block",e),"margin-inline":t("margin-inline",e),mask:t("mask","image mode repeat position clip origin size composite"),offset:t("offset","position path distance rotate anchor"),outline:t("outline",r),overflow:t("overflow","x y"),"overscroll-behavior":t("overscroll-behavior","x y"),padding:s("padding"),"padding-block":t("padding-block",e),"padding-inline":t("padding-inline",e)});for(const o of["content","items","self"])n["place-"+o]=["align-"+o,"justify-"+o];Object.assign(n,{"scroll-margin":s("scroll-margin"),"scroll-padding":s("scroll-padding"),"text-decoration":t("text-decoration","line style color thickness"),"text-emphasis":t("text-emphasis","style color"),transition:t("transition","property duration timing-function delay behavior")});const d={};for(const o in n)for(const i of n[o])(d[i]||(d[i]=[])).push(o);export{d as CSS_LONGHAND_SHORTHANDS,n as CSS_SHORTHAND_LONGHANDS};
|
package/dist/esm/src/delegate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DELEGATED_EVENTS as L,LIFECYCLE_EVENTS as b,PASSIVE_EVENTS as E,NON_BUBBLING_EVENTS as v}from"./registry.js";import{pushConfig as D,popConfig as
|
|
1
|
+
import{DELEGATED_EVENTS as L,LIFECYCLE_EVENTS as b,PASSIVE_EVENTS as E,NON_BUBBLING_EVENTS as v}from"./registry.js";import{pushConfig as D,popConfig as g}from"@symbo.ls/scratch";const a=new WeakMap,C={passive:!0},S={passive:!0,capture:!0},d=(t,e)=>E.has(t)?e?S:C:e||!1;function _(t){let e=a.get(t);return e||(e={handlers:new Map,installed:new Set},a.set(t,e)),e}function T(t,e){const r=_(e);if(r.installed.has(t))return;r.installed.add(t);const n=t==="focus"||t==="blur"||t==="focusin"||t==="focusout"||t==="mouseenter"||t==="mouseleave"||t==="pointerenter"||t==="pointerleave",o=t==="mouseenter"||t==="mouseleave"||t==="pointerenter"||t==="pointerleave";e.addEventListener(t,i=>{if(o){const u=i.target,c=r.handlers.get(t),l=c&&u?c.get(u):null;if(!l||i.relatedTarget&&typeof u.contains=="function"&&u.contains(i.relatedTarget))return;l(i);return}let s=i.target;for(;s&&s!==e;){const u=r.handlers.get(t);if(u){const c=u.get(s);if(c&&(c(i),i.cancelBubble))return}s=s.parentNode}},d(t,n))}function V(t,e,r,n){n||(n=e.ownerDocument?.documentElement||e.getRootNode());const o=_(n);T(t,n),o.handlers.has(t)||o.handlers.set(t,new WeakMap),o.handlers.get(t).set(e,r)}function M(t,e,r){r||(r=e.ownerDocument?.documentElement||e.getRootNode());const n=a.get(r);if(!n)return;const o=n.handlers.get(t);o&&o.delete(e)}function h(t){return L.has(t)&&!b.has(t)}function y(t,e){const{context:r}=t,n=r?.designSystem;return o=>{n&&D(n);try{const i=e.call(t,o,t,t.state,r);if(i&&typeof i.then=="function"){i.catch(s=>{t.error=s,console.error("[DOMQL] Async event error:",s)}).finally(()=>{n&&g()});return}}catch(i){if(t.error=i,console.error("[DOMQL] Event error:",i),r?.strictMode)throw i}n&&g()}}function m(t,e,r){const{node:n,context:o}=e;if(!n)return;const i=y(e,r),s=v.has(t);if(!s&&h(t)){const u=o?.rootNode||n.ownerDocument?.documentElement;V(t,n,i,u)}else n.addEventListener(t,i,d(t,!1));e.__ref.__eventCleanup||(e.__ref.__eventCleanup=[]),e.__ref.__eventCleanup.push(()=>{if(!s&&h(t)){const u=o?.rootNode||n.ownerDocument?.documentElement;M(t,n,u)}else n.removeEventListener(t,i,d(t,!1))})}const p=[["onDocument","document"],["onWindow","window"],["onVisualViewport","visualViewport"],["onMediaQuery","mediaQuery"]];function O(t){if(typeof t!="string")return null;for(let e=0;e<p.length;e++){const r=p[e][0];if(t.length<=r.length||!t.startsWith(r))continue;const n=t.charCodeAt(r.length);if(!(n<65||n>90))return{target:p[e][1],eventName:t.slice(r.length).toLowerCase()}}return null}const A=/^[A-Za-z_$][\w$]*$/;function I(t,e,r){let n=e,o=!1,i,s=!1,u=null;if(e&&typeof e=="object"&&typeof e!="function"&&(n=e.handler,o=!!e.capture,s=!!e.once,typeof e.passive=="boolean"&&(i=e.passive),typeof e.query=="string"&&(u=e.query)),typeof n=="string"&&A.test(n)){const c=n;n=function(f){return t.call(c,f)}}return typeof n!="function"?null:(i===void 0&&(i=E.has(r)),{handler:n,capture:o,passive:i,once:s,query:u})}function x(t,e,r){const n=t.node?.ownerDocument||t.context?.document||(typeof document<"u"?document:null);if(!n||typeof n.addEventListener!="function")return null;if(e==="document")return n;const o=n.defaultView||(typeof window<"u"?window:null);if(!o)return null;if(e==="window")return typeof o.addEventListener=="function"?o:null;if(e==="visualViewport"){const i=o.visualViewport;return i&&typeof i.addEventListener=="function"?i:null}if(e==="mediaQuery"){const i=r&&r.query;if(typeof i!="string"||!i.trim()||typeof o.matchMedia!="function")return null;try{return o.matchMedia(i)||null}catch{return null}}return null}function B(t,e,r,n){try{return t.addEventListener(e,r,n),!0}catch{return typeof t.addListener=="function"?(t.addListener(r),!0):!1}}function R(t,e,r,n){try{t.removeEventListener(e,r,n)}catch{typeof t.removeListener=="function"&&t.removeListener(r)}}function q(t){const e=t.node;if(!e)return!1;const r=e.nodeType===11?t.__ref?.__fragmentAnchor:e;return r?r.isConnected!==!1:!1}function P(t,e,r){if(e.__ref){if(Array.isArray(r)){if(t.target!=="mediaQuery")return;for(let o=0;o<r.length;o++)w(t,e,r[o]);return}w(t,e,r)}}function w(t,e,r){const n=e.__ref,o=I(e,r,t.eventName);if(!o||t.target==="mediaQuery"&&t.eventName!=="change")return;const i=x(e,t.target,o);if(!i)return;const s=t.target+":"+(o.query?o.query+":":"")+t.eventName+":"+(o.capture?1:0);if(n.__globalEvents&&n.__globalEvents.has(s))return;const u=y(e,o.handler),c=f=>{q(e)&&u(f)},l={capture:o.capture,passive:o.passive,once:o.once};B(i,t.eventName,c,l)&&(n.__globalEvents||(n.__globalEvents=new Map),n.__globalEvents.set(s,{target:i,eventName:t.eventName,listener:c,options:l}),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{R(i,t.eventName,c,l),n.__globalEvents&&n.__globalEvents.delete(s)}))}export{V as addDelegatedEvent,O as globalEventKeyInfo,h as isDelegatable,m as registerEvent,P as registerGlobalEvent,M as removeDelegatedEvent};
|
package/dist/esm/src/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{batch as h,isStore as y}from"@symbo.ls/signal";import{REGISTRY as _}from"./registry.js";import{create as
|
|
1
|
+
import{batch as h,isStore as y}from"@symbo.ls/signal";import{REGISTRY as _}from"./registry.js";import{create as p,acquireBeforeUpdateGuard as x,releaseBeforeUpdateGuard as l,writeElementText as b,reconcileAttrProp as g,isStaticCssProp as A,recompileStaticCss as P}from"./create.js";import{runPluginHook as d}from"@symbo.ls/utils/function.js";import{serializeAttrValue as U,isEnumeratedTrueFalseAttr as v}from"attrs-in-props";function j(o={},r={}){const e=this,i=e.__ref;if(!i)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!r.preventListeners&&typeof e.onBeforeUpdate=="function"&&x(i))try{const t=e.onBeforeUpdate(e,e.state,e.context,r);if(t&&typeof t.then=="function")t.then(()=>l(i,!1),n=>{l(i,!0),e.context?.plugins?.length&&d("error",e,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if(l(i,!1),t===!1)return e}catch(t){throw l(i,!0),t}const u=!o||Object.keys(o).length===0,c=[];h(()=>{if(o.state&&y(e.state)&&e.state.$update(o.state),o.text!==void 0&&(e.text=o.text,!i.__exec.text&&e.node&&b(e,o.text??"")),o.html!==void 0&&(e.html=o.html,!i.__exec.html&&e.node&&(e.node.innerHTML=o.html)),o.style&&e.node?.style){if(!i.__exec.style)for(const t in o.style){const n=o.style[t];if(n==null)continue;const f=t.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()),s=String(n).replace(/\s*!important\s*$/,"");e.node.style.setProperty(f,s,"important")}e.style||(e.style={}),Object.assign(e.style,o.style)}if(o.attr&&e.node?.setAttribute){for(const t in o.attr){const n=o.attr[t];n==null||n===!1&&!v(t)?e.node.removeAttribute(t):typeof n!="function"&&typeof n!="object"&&e.node.setAttribute(t,U(t,n))}e.attr||(e.attr={}),Object.assign(e.attr,o.attr)}if(o.data&&e.node?.dataset){for(const t in o.data)e.node.dataset[t]=o.data[t];e.data||(e.data={}),Object.assign(e.data,o.data)}for(const t in o){if(_.has(t)||t==="state")continue;const n=o[t],f=e[t];if(f&&f.__ref&&typeof f.update=="function")f.update(n,r);else if(typeof n=="object"&&n!==null){const s=t.charCodeAt(0);s>=65&&s<=90&&p(n,e,t,r)}else t!=="text"&&t!=="html"&&t!=="style"&&t!=="attr"&&t!=="data"&&(e[t]=n,typeof n!="function"&&c.push(t))}});for(let t=0;t<c.length;t++)g(e,c[t]);if(e.node){for(let t=0;t<c.length;t++)if(A(c[t])){P(e);break}}if(e.node&&u&&i.__effects&&i.__effects.length)for(let t=0;t<i.__effects.length;t++){const n=i.__effects[t];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(e.node&&i.__conditionalRunners)for(const t of i.__conditionalRunners)t();return d("update",e),!r.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,r),e}var L=j;export{L as default,j as update};
|
package/dist/esm/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="3.14.
|
|
1
|
+
const o="3.14.792";export{o as VERSION};
|