@symbo.ls/element 3.14.801 → 3.14.803

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},P=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of N(t))!R.call(e,o)&&o!==n&&h(e,o,{get:()=>t[o],enumerable:!(r=M(t,o))||r.enumerable});return e};var L=e=>P(h({},"__esModule",{value:!0}),e);var U={};x(U,{inertOutsidePlugin:()=>K});module.exports=L(U);var a=require("@symbo.ls/signal");const d="inertOutside",k=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT","BASE","TITLE"]),D='a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable="false"])',q={attributes:!0,attributeFilter:["inert"]},g=new WeakMap,O=new WeakMap,p=new Set,_=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function f(e){const t=(0,a.getObserver)();t&&(0,a.setObserver)(null);try{return e()}catch(n){console.error("[smbls] inertOutside:",n)}finally{t&&(0,a.setObserver)(t)}}function S(e){const t=()=>f(e);typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function W(e){if(!e||!e.defaultView||!("activeElement"in e))return null;let t=g.get(e);if(t)return t;const n=e.defaultView.MutationObserver||globalThis.MutationObserver;return typeof n!="function"?null:(t={doc:e,layers:[],held:new Map,top:null,observer:null},t.observer=new n(r=>f(()=>E(t,r))),g.set(e,t),t)}function T(e,t){const n=e.element.node;return!!n&&n.nodeType===1&&n.isConnected&&n.ownerDocument===t}function B(e){const t=e.activeElement;return t&&t!==e.body&&t!==e.documentElement?t:null}const A=e=>!!(e.closest&&e.closest("[inert]"));function V(e){const t=e.ownerDocument,n=new Set,r=[];for(let o=e;o!==t.body;o=o.parentNode){const c=o.parentNode;if(!c||c.nodeType!==1||c===t.documentElement)break;r.push(c);for(let l=c.firstElementChild;l;l=l.nextElementSibling)l!==o&&!k.has(l.tagName)&&n.add(l)}return{outside:n,parents:r}}function m(e,t){for(let n=0;n<t.length;n++){const{type:r,target:o}=t[n];r==="attributes"&&e.held.has(o)&&e.held.set(o,!o.hasAttribute("inert"))}}function E(e,t){const{doc:n,held:r,observer:o}=e;t&&m(e,t),m(e,o.takeRecords());const c=e.top,l=[];for(const s of e.layers){const b=T(s,n);b&&!s.live&&(l.push(s),s.returnFocus=B(n)),s.live=b}l.length&&(e.layers=e.layers.filter(s=>!l.includes(s)).concat(l));let i=null;for(let s=e.layers.length-1;s>=0&&!i;s--)e.layers[s].live&&(i=e.layers[s]);e.top=i;const{outside:v,parents:y}=i?V(i.element.node):{outside:new Set,parents:[]};for(const[s,b]of r)v.has(s)||(b&&s.removeAttribute("inert"),r.delete(s));for(const s of v)r.has(s)||r.set(s,!1),s.hasAttribute("inert")||(s.setAttribute("inert",""),r.set(s,!0));o.takeRecords(),o.disconnect();for(const s of y)o.observe(s,{childList:!0});for(const s of r.keys())o.observe(s,q);if(e.layers.some(s=>!s.live)?p.add(e):p.delete(e),i===c)return;const u=c&&!(c.declared&&c.live)?c:null;if(i&&l.includes(i))u&&u.returnFocus&&(i.returnFocus=u.returnFocus),S(()=>C(e,i));else if(u){const s=u.returnFocus;S(()=>j(e,u,s))}u&&(u.returnFocus=null)}function C(e,t){const n=t.element.node;if(e.top!==t||!n||!n.isConnected)return;const r=e.doc,o=r.activeElement;if(o&&n.contains(o))return;const c=new Set,l=(i,v)=>{if(c.has(i)||(c.add(i),i.matches(":disabled")))return!1;const y=v&&i.getAttribute("tabindex");return y&&parseInt(y,10)<0?!1:(i.focus(),r.activeElement===i)};for(const i of n.querySelectorAll("[autofocus]"))if(l(i,!1))return;for(const i of n.querySelectorAll(D))if(l(i,!0))return;o&&o!==r.body&&typeof o.blur=="function"&&o.blur()}function j(e,t,n){if(t.declared&&t.live)return;const r=e.doc,o=r.activeElement,c=t.element.node;(!o||o===r.body||c&&c.contains(o)||A(o))&&(n&&n.isConnected&&n.ownerDocument===r&&!A(n)&&(n.focus({preventScroll:!0}),r.activeElement===n)||e.top&&C(e,e.top))}function w(e,t){if(e.declared===t)return;const n=e.manager;if(e.declared=t,e.live=!1,t)n.layers.push(e);else{const r=n.layers.indexOf(e);r!==-1&&n.layers.splice(r,1)}E(n)}function I(e){let t=e[d];if(typeof t=="function")try{t=t(e,e.state,e.context)}catch{t=!1}return!!t}function F(e){let t=O.get(e);if(t)return t;const n=e.__ref,r=e.node;if(!n||!r||r.nodeType!==1)return null;const o=W(r.ownerDocument);if(!o)return null;t={element:e,manager:o,declared:!1,live:!1,returnFocus:null},O.set(e,t);const c=(0,a.createEffect)(()=>{const l=I(e);f(()=>w(t,l))},{depth:n.path.length,label:()=>n.path.join(".")+"::"+d});return n.__effects||(n.__effects=[]),n.__effects.push(c),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>f(()=>w(t,!1))),t}function z(){for(const e of p){if(!e.doc.defaultView){p.delete(e);continue}e.layers.some(t=>!t.live&&T(t,e.doc))&&E(e)}}const K={name:d,create(e){_(e,d)&&f(()=>F(e))},render(){p.size&&f(z)},update(e){_(e,d)&&f(()=>{const t=F(e);t&&w(t,I(e))})}};
1
+ "use strict";var h=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of R(t))!x.call(e,o)&&o!==n&&h(e,o,{get:()=>t[o],enumerable:!(r=N(t,o))||r.enumerable});return e};var L=e=>k(h({},"__esModule",{value:!0}),e);var Y={};P(Y,{inertOutsidePlugin:()=>U});module.exports=L(Y);var F=require("@symbo.ls/signal"),M=require("./runContext.js");const a="inertOutside",D=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT","BASE","TITLE"]),q='a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex], [contenteditable]:not([contenteditable="false"])',W={attributes:!0,attributeFilter:["inert"]},w=new WeakMap,g=new WeakMap,d=new Set,O=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function f(e){try{return(0,M.untrack)(e)}catch(t){console.error("[smbls] inertOutside:",t)}}function _(e){const t=()=>f(e);typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t)}function B(e){if(!e||!e.defaultView||!("activeElement"in e))return null;let t=w.get(e);if(t)return t;const n=e.defaultView.MutationObserver||globalThis.MutationObserver;return typeof n!="function"?null:(t={doc:e,layers:[],held:new Map,top:null,observer:null},t.observer=new n(r=>f(()=>b(t,r))),w.set(e,t),t)}function S(e,t){const n=e.element.node;return!!n&&n.nodeType===1&&n.isConnected&&n.ownerDocument===t}function V(e){const t=e.activeElement;return t&&t!==e.body&&t!==e.documentElement?t:null}const T=e=>!!(e.closest&&e.closest("[inert]"));function j(e){const t=e.ownerDocument,n=new Set,r=[];for(let o=e;o!==t.body;o=o.parentNode){const c=o.parentNode;if(!c||c.nodeType!==1||c===t.documentElement)break;r.push(c);for(let u=c.firstElementChild;u;u=u.nextElementSibling)u!==o&&!D.has(u.tagName)&&n.add(u)}return{outside:n,parents:r}}function m(e,t){for(let n=0;n<t.length;n++){const{type:r,target:o}=t[n];r==="attributes"&&e.held.has(o)&&e.held.set(o,!o.hasAttribute("inert"))}}function b(e,t){const{doc:n,held:r,observer:o}=e;t&&m(e,t),m(e,o.takeRecords());const c=e.top,u=[];for(const s of e.layers){const y=S(s,n);y&&!s.live&&(u.push(s),s.returnFocus=V(n)),s.live=y}u.length&&(e.layers=e.layers.filter(s=>!u.includes(s)).concat(u));let i=null;for(let s=e.layers.length-1;s>=0&&!i;s--)e.layers[s].live&&(i=e.layers[s]);e.top=i;const{outside:p,parents:v}=i?j(i.element.node):{outside:new Set,parents:[]};for(const[s,y]of r)p.has(s)||(y&&s.removeAttribute("inert"),r.delete(s));for(const s of p)r.has(s)||r.set(s,!1),s.hasAttribute("inert")||(s.setAttribute("inert",""),r.set(s,!0));o.takeRecords(),o.disconnect();for(const s of v)o.observe(s,{childList:!0});for(const s of r.keys())o.observe(s,W);if(e.layers.some(s=>!s.live)?d.add(e):d.delete(e),i===c)return;const l=c&&!(c.declared&&c.live)?c:null;if(i&&u.includes(i))l&&l.returnFocus&&(i.returnFocus=l.returnFocus),_(()=>A(e,i));else if(l){const s=l.returnFocus;_(()=>z(e,l,s))}l&&(l.returnFocus=null)}function A(e,t){const n=t.element.node;if(e.top!==t||!n||!n.isConnected)return;const r=e.doc,o=r.activeElement;if(o&&n.contains(o))return;const c=new Set,u=(i,p)=>{if(c.has(i)||(c.add(i),i.matches(":disabled")))return!1;const v=p&&i.getAttribute("tabindex");return v&&parseInt(v,10)<0?!1:(i.focus(),r.activeElement===i)};for(const i of n.querySelectorAll("[autofocus]"))if(u(i,!1))return;for(const i of n.querySelectorAll(q))if(u(i,!0))return;o&&o!==r.body&&typeof o.blur=="function"&&o.blur()}function z(e,t,n){if(t.declared&&t.live)return;const r=e.doc,o=r.activeElement,c=t.element.node;(!o||o===r.body||c&&c.contains(o)||T(o))&&(n&&n.isConnected&&n.ownerDocument===r&&!T(n)&&(n.focus({preventScroll:!0}),r.activeElement===n)||e.top&&A(e,e.top))}function E(e,t){if(e.declared===t)return;const n=e.manager;if(e.declared=t,e.live=!1,t)n.layers.push(e);else{const r=n.layers.indexOf(e);r!==-1&&n.layers.splice(r,1)}b(n)}function C(e){let t=e[a];if(typeof t=="function")try{t=t(e,e.state,e.context)}catch{t=!1}return!!t}function I(e){let t=g.get(e);if(t)return t;const n=e.__ref,r=e.node;if(!n||!r||r.nodeType!==1)return null;const o=B(r.ownerDocument);if(!o)return null;t={element:e,manager:o,declared:!1,live:!1,returnFocus:null},g.set(e,t);const c=(0,F.createEffect)(()=>{const u=C(e);f(()=>E(t,u))},{depth:n.path.length,label:()=>n.path.join(".")+"::"+a});return n.__effects||(n.__effects=[]),n.__effects.push(c),n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>f(()=>E(t,!1))),t}function K(){for(const e of d){if(!e.doc.defaultView){d.delete(e);continue}e.layers.some(t=>!t.live&&S(t,e.doc))&&b(e)}}const U={name:a,create(e){O(e,a)&&f(()=>I(e))},render(){d.size&&f(K)},update(e){O(e,a)&&f(()=>{const t=I(e);t&&E(t,C(e))})}};
@@ -0,0 +1 @@
1
+ "use strict";var l=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of h(e))!p.call(t,o)&&o!==n&&l(t,o,{get:()=>e[o],enumerable:!(r=g(e,o))||r.enumerable});return t};var y=t=>x(l({},"__esModule",{value:!0}),t);var H={};d(H,{dispatchPluginHook:()=>a,hasPluginHook:()=>u,reportLifecycleError:()=>P});module.exports=y(H);var s=require("@symbo.ls/utils/function.js");const f=new WeakMap;let i=null,c=null;function k(t,e){let n=t===i?c:f.get(t);(!n||n.length!==t.length)&&(n={length:t.length,hooks:new Map},f.set(t,n)),i=t,c=n;let r=n.hooks.get(e);if(r===void 0){r=!1;for(const o of t)if(typeof o[e]=="function"){r=!0;break}n.hooks.set(e,r)}return r}function u(t,e){const n=t&&t.context&&t.context.plugins;return!!(n&&n.length&&k(n,e))}function a(t,e,...n){return u(e,t)?(0,s.runPluginHook)(t,e,...n):!1}function P(t,e,n){a("error",t,{hook:e,error:n})||console.error(`[DOMQL] Lifecycle "${e}" error:`,n)}
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.create;var n=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var y=(r,t)=>{for(var s in t)n(r,s,{get:t[s],enumerable:!0})},u=(r,t,s,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of l(t))!g.call(r,e)&&e!==s&&n(r,e,{get:()=>t[e],enumerable:!(c=f(t,e))||c.enumerable});return r};var m=(r,t,s)=>(s=r!=null?a(p(r)):{},u(t||!r||!r.__esModule?n(s,"default",{value:r,enumerable:!0}):s,r)),x=r=>u(n({},"__esModule",{value:!0}),r);var O={};y(O,{untrack:()=>v,withDesignSystem:()=>b});module.exports=x(O);var o=m(require("@symbo.ls/signal"),1),i=require("@symbo.ls/scratch");function b(r,t){const s=r&&r.context&&r.context.designSystem;if(!s)return t();(0,i.pushConfig)(s);try{return t()}finally{(0,i.popConfig)()}}const v=o.untrack||(r=>{const t=o.getObserver();if(!t)return r();o.setObserver(null);try{return r()}finally{o.setObserver(t)}});
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var j=(o,f)=>{for(var e in f)y(o,e,{get:f[e],enumerable:!0})},U=(o,f,e,r)=>{if(f&&typeof f=="object"||typeof f=="function")for(let c of A(f))!P.call(o,c)&&c!==e&&y(o,c,{get:()=>f[c],enumerable:!(r=g(f,c))||r.enumerable});return o};var B=o=>U(y({},"__esModule",{value:!0}),o);var k={};j(k,{default:()=>S,update:()=>p});module.exports=B(k);var u=require("@symbo.ls/signal"),v=require("./registry.js"),i=require("./create.js"),h=require("@symbo.ls/utils/function.js"),a=require("attrs-in-props");function p(o={},f={}){const e=this,r=e.__ref;if(!r)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!f.preventListeners&&typeof e.onBeforeUpdate=="function"&&(0,i.acquireBeforeUpdateGuard)(r))try{const t=e.onBeforeUpdate(e,e.state,e.context,f);if(t&&typeof t.then=="function")t.then(()=>(0,i.releaseBeforeUpdateGuard)(r,!1),n=>{(0,i.releaseBeforeUpdateGuard)(r,!0),e.context?.plugins?.length&&(0,h.runPluginHook)("error",e,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if((0,i.releaseBeforeUpdateGuard)(r,!1),t===!1)return e}catch(t){throw(0,i.releaseBeforeUpdateGuard)(r,!0),t}const c=!o||Object.keys(o).length===0,l=[];let _=!1;(0,u.batch)(()=>{if(o.state&&(0,u.isStore)(e.state)&&e.state.$update(o.state),o.text!==void 0&&(e.text=o.text,!r.__exec.text&&e.node&&(0,i.writeElementText)(e,o.text??"")),o.html!==void 0&&(e.html=o.html,!r.__exec.html&&e.node&&(e.node.innerHTML=o.html)),o.style&&e.node?.style){if(!r.__exec.style){const t=(0,i.resolveStyleBlock)(e,o.style);for(const n in t){const s=t[n];if(s==null)continue;const d=n.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),x=String(s).replace(/\s*!important\s*$/,"");e.node.style.setProperty(d,x,"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)}if(o.vars&&typeof o.vars=="object"&&!Array.isArray(o.vars)){const t=e.vars&&typeof e.vars=="object"&&!Array.isArray(e.vars)?e.vars:null;e.vars={...t,...o.vars},_=!0}for(const t in o){if(v.REGISTRY.has(t)||t==="state")continue;const n=o[t],s=e[t];if(s&&s.__ref&&typeof s.update=="function")s.update(n,f);else if(typeof n=="object"&&n!==null){const d=t.charCodeAt(0);d>=65&&d<=90&&(0,i.create)(n,e,t,f)}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,i.reconcileAttrProp)(e,l[t]);if(e.node){let t=_;for(let n=0;!t&&n<l.length;n++)(0,i.isStaticCssProp)(l[n])&&(t=!0);t&&(0,i.recompileStaticCss)(e)}if(e.node&&c&&r.__effects&&r.__effects.length)for(let t=0;t<r.__effects.length;t++){const n=r.__effects[t];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(e.node&&r.__conditionalRunners)for(const t of r.__conditionalRunners)t();return(0,h.runPluginHook)("update",e),!f.preventListeners&&typeof e.onUpdate=="function"&&e.onUpdate(e,e.state,e.context,f),e}var S=p;
1
+ "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var P=(o,f)=>{for(var t in f)a(o,t,{get:f[t],enumerable:!0})},U=(o,f,t,r)=>{if(f&&typeof f=="object"||typeof f=="function")for(let s of g(f))!A.call(o,s)&&s!==t&&a(o,s,{get:()=>f[s],enumerable:!(r=b(f,s))||r.enumerable});return o};var j=o=>U(a({},"__esModule",{value:!0}),o);var S={};P(S,{default:()=>B,update:()=>v});module.exports=j(S);var u=require("@symbo.ls/signal"),_=require("./registry.js"),i=require("./create.js"),y=require("./pluginHooks.js");function v(o={},f={}){const t=this,r=t.__ref;if(!r)return;if((typeof o=="string"||typeof o=="number")&&(o={text:o}),!f.preventListeners&&typeof t.onBeforeUpdate=="function"&&(0,i.acquireBeforeUpdateGuard)(r))try{const e=t.onBeforeUpdate(t,t.state,t.context,f);if(e&&typeof e.then=="function")e.then(()=>(0,i.releaseBeforeUpdateGuard)(r,!1),n=>{(0,i.releaseBeforeUpdateGuard)(r,!0),(0,y.dispatchPluginHook)("error",t,{hook:"onBeforeUpdate",error:n})||console.error("[DOMQL] onBeforeUpdate error:",n)});else if((0,i.releaseBeforeUpdateGuard)(r,!1),e===!1)return t}catch(e){throw(0,i.releaseBeforeUpdateGuard)(r,!0),e}const s=!o||Object.keys(o).length===0,l=[];let h=!1;(0,u.batch)(()=>{if(o.state&&(0,u.isStore)(t.state)&&t.state.$update(o.state),o.text!==void 0&&(t.text=o.text,!r.__exec.text&&t.node&&(0,i.writeElementText)(t,o.text??"")),o.html!==void 0&&(t.html=o.html,!r.__exec.html&&t.node&&(t.node.innerHTML=o.html)),o.style&&t.node?.style){if(!r.__exec.style){const e=(0,i.resolveStyleBlock)(t,o.style);for(const n in e){const c=e[n];if(c==null)continue;const d=n.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),x=String(c).replace(/\s*!important\s*$/,"");t.node.style.setProperty(d,x,"important")}}t.style||(t.style={}),Object.assign(t.style,o.style)}if(o.attr&&t.node?.setAttribute){for(const e in o.attr){const n=o.attr[e];(0,i.writeAttr)(t.node,e,n)}t.attr||(t.attr={}),Object.assign(t.attr,o.attr)}if(o.data&&t.node?.dataset){for(const e in o.data)t.node.dataset[e]=o.data[e];t.data||(t.data={}),Object.assign(t.data,o.data)}if(o.vars&&typeof o.vars=="object"&&!Array.isArray(o.vars)){const e=t.vars&&typeof t.vars=="object"&&!Array.isArray(t.vars)?t.vars:null;t.vars={...e,...o.vars},h=!0}for(const e in o){if(_.REGISTRY.has(e)||e==="state")continue;const n=o[e],c=t[e];if(c&&c.__ref&&typeof c.update=="function")c.update(n,f);else if(typeof n=="object"&&n!==null){const d=e.charCodeAt(0);d>=65&&d<=90&&(0,i.create)(n,t,e,f)}else e!=="text"&&e!=="html"&&e!=="style"&&e!=="attr"&&e!=="data"&&(t[e]=n,typeof n!="function"&&l.push(e))}});for(let e=0;e<l.length;e++)(0,i.reconcileAttrProp)(t,l[e]);if(t.node){let e=h;for(let n=0;!e&&n<l.length;n++)(0,i.isStaticCssProp)(l[n])&&(e=!0);e&&(0,i.recompileStaticCss)(t)}if(t.node&&s&&r.__effects&&r.__effects.length)for(let e=0;e<r.__effects.length;e++){const n=r.__effects[e];n&&!n._disposed&&!n._isSubscribeToEffect&&typeof n._execute=="function"&&n._execute()}else if(t.node&&r.__conditionalRunners)for(const e of r.__conditionalRunners)e();return(0,y.dispatchPluginHook)("update",t),!f.preventListeners&&typeof t.onUpdate=="function"&&t.onUpdate(t,t.state,t.context,f),t}var B=v;
@@ -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.801";
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.803";
@@ -1 +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 e=new Set(["rows","cols","wrap","fill","stroke"]),i=(o,t)=>e.has(t)&&s(o,t),p=(o,t)=>!!(S[t]||r&&r.has(t))&&!i(o,t);export{e as ATTRIBUTE_FIRST_KEYS,i as isAttributeFirst,p as isCssProp};
1
+ import{checkAttributeByTagName as r}from"attrs-in-props";import{CSS_PROPS_REGISTRY as S,DEFAULT_CSS_PROPERTIES_LIST as s}from"css-in-props";const e=new Set(["rows","cols","wrap","fill","stroke","offset"]),i=(o,t)=>e.has(t)&&r(o,t),p=(o,t)=>!!(S[t]||s&&s.has(t))&&!i(o,t);export{e as ATTRIBUTE_FIRST_KEYS,i as isAttributeFirst,p as isCssProp};
@@ -1 +1 @@
1
- import{createEffect as l,getObserver as y,setObserver as f}from"@symbo.ls/signal";import{pushConfig as c,popConfig as d}from"@symbo.ls/scratch";import{runPluginHook as g}from"@symbo.ls/utils/function.js";import{isLoudDevRuntime as _}from"./devRuntime.js";const B=(t,r)=>Object.prototype.hasOwnProperty.call(t,r);function s(t,r,n){t.context?.plugins?.length&&g("error",t,{hook:r,error:n})||console.error(`[DOMQL] Lifecycle "${r}" error:`,n)}function u(t,r,n){const o=y();o&&f(null);const i=t.context?.designSystem;i&&c(i);try{return r.call(t,n,t,t.state,t.context)}finally{i&&d(),o&&f(o)}}function b(t,r){if(!_())return;const n=r.__children&&r.__children.length>0;!n&&t.html==null||console.warn(`[smbls] bridge host "${r.path.join(".")}" renders DOMQL ${n?"children":"html"} inside the node it hands to its library \u2014 the library owns that subtree and may replace them. Keep DOMQL children beside the host, not in it.`)}function w(t){const r=t.__ref,n=t.node;if(!r||!n||r.__bridge||typeof t.onBridgeMount!="function"||!("scrollHeight"in n))return;const o=r.__bridge={settled:!1,failed:!1,disposed:!1,destroyed:!1,instance:void 0,effect:null};r.contentManaged=!0,b(t,r);let i;try{i=u(t,t.onBridgeMount,n)}catch(e){if(o.failed=!0,s(t,"onBridgeMount",e),t.context?.strictMode)throw e;return}if(i&&typeof i.then=="function"){i.then(e=>a(t,o,e),e=>{o.failed=!0,s(t,"onBridgeMount",e)});return}a(t,o,i)}function a(t,r,n){if(r.settled=!0,r.instance=n,r.disposed){p(t,r);return}if(Object.defineProperty(t,"bridge",{value:n,writable:!0,configurable:!0,enumerable:!1}),typeof t.onBridgeUpdate!="function")return;const o=t.__ref;r.effect=l(()=>{if(r.disposed)return;const i=t.context?.designSystem;i&&c(i);try{const e=t.onBridgeUpdate.call(t,r.instance,t,t.state,t.context);e&&typeof e.then=="function"&&e.catch(h=>s(t,"onBridgeUpdate",h))}catch(e){s(t,"onBridgeUpdate",e)}finally{i&&d()}},{depth:o.path.length,label:()=>o.path.join(".")+"::onBridgeUpdate"}),o.__effects.push(r.effect)}function L(t){const r=t.__ref?.__bridge;!r||r.disposed||(r.disposed=!0,r.effect&&r.effect.dispose(),r.settled&&p(t,r))}function p(t,r){if(r.destroyed)return;r.destroyed=!0;const n=r.instance;if(r.instance=void 0,B(t,"bridge")&&(t.bridge=void 0),typeof t.onBridgeDestroy=="function")try{const o=u(t,t.onBridgeDestroy,n);o&&typeof o.then=="function"&&o.catch(i=>s(t,"onBridgeDestroy",i))}catch(o){s(t,"onBridgeDestroy",o)}}export{L as destroyBridge,w as mountBridge};
1
+ import{createEffect as a}from"@symbo.ls/signal";import{withDesignSystem as f,untrack as h}from"./runContext.js";import{reportLifecycleError as s}from"./pluginHooks.js";import{isLoudDevRuntime as p}from"./devRuntime.js";const y=(t,r)=>Object.prototype.hasOwnProperty.call(t,r);function c(t,r,n){return h(()=>f(t,()=>r.call(t,n,t,t.state,t.context)))}function g(t,r){if(!p())return;const n=r.__children&&r.__children.length>0;!n&&t.html==null||console.warn(`[smbls] bridge host "${r.path.join(".")}" renders DOMQL ${n?"children":"html"} inside the node it hands to its library \u2014 the library owns that subtree and may replace them. Keep DOMQL children beside the host, not in it.`)}function w(t){const r=t.__ref,n=t.node;if(!r||!n||r.__bridge||typeof t.onBridgeMount!="function"||!("scrollHeight"in n))return;const o=r.__bridge={settled:!1,failed:!1,disposed:!1,destroyed:!1,instance:void 0,effect:null};r.contentManaged=!0,g(t,r);let i;try{i=c(t,t.onBridgeMount,n)}catch(e){if(o.failed=!0,s(t,"onBridgeMount",e),t.context?.strictMode)throw e;return}if(i&&typeof i.then=="function"){i.then(e=>d(t,o,e),e=>{o.failed=!0,s(t,"onBridgeMount",e)});return}d(t,o,i)}function d(t,r,n){if(r.settled=!0,r.instance=n,r.disposed){u(t,r);return}if(Object.defineProperty(t,"bridge",{value:n,writable:!0,configurable:!0,enumerable:!1}),typeof t.onBridgeUpdate!="function")return;const o=t.__ref;r.effect=a(()=>{r.disposed||f(t,()=>{try{const i=t.onBridgeUpdate.call(t,r.instance,t,t.state,t.context);i&&typeof i.then=="function"&&i.catch(e=>s(t,"onBridgeUpdate",e))}catch(i){s(t,"onBridgeUpdate",i)}})},{depth:o.path.length,label:()=>o.path.join(".")+"::onBridgeUpdate"}),o.__effects.push(r.effect)}function D(t){const r=t.__ref?.__bridge;!r||r.disposed||(r.disposed=!0,r.effect&&r.effect.dispose(),r.settled&&u(t,r))}function u(t,r){if(r.destroyed)return;r.destroyed=!0;const n=r.instance;if(r.instance=void 0,y(t,"bridge")&&(t.bridge=void 0),typeof t.onBridgeDestroy=="function")try{const o=c(t,t.onBridgeDestroy,n);o&&typeof o.then=="function"&&o.catch(i=>s(t,"onBridgeDestroy",i))}catch(o){s(t,"onBridgeDestroy",o)}}export{D as destroyBridge,w as mountBridge};
@@ -1,6 +1,6 @@
1
- import{createStore as Qt,createScopeStore as $s,isStore as Y}from"@symbo.ls/signal";import{createEffect as j,getObserver as ko,setObserver as Nt}from"@symbo.ls/signal";import{cacheNode as Xt,detectTag as jo,adoptHydrationNode as Us}from"./cache.js";import{REGISTRY as G,LIFECYCLE_EVENTS as Hs}from"./registry.js";import{registerEvent as Vs,registerGlobalEvent as Bs,globalEventKeyInfo as Gs}from"./delegate.js";import{mountBridge as Ks}from"./bridge.js";import{applyExtends as Ws,openMergeLayer as zs}from"./extends.js";import{addMethods as Ys}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as ft}from"./devRuntime.js";import{mountBudgetExhausted as Eo,openMountBudget as Po,closeMountBudget as Oo,enqueueMountWork as To}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as $,isPolyglotWritableKey as qs,markPolyglotSeeded as Zs}from"@symbo.ls/utils";import*as Ft from"@symbo.ls/utils";import{runPluginHook as q}from"@symbo.ls/utils/function.js";import{applyStateMethods as xt}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as U,DEFAULT_CSS_PROPERTIES_LIST as V,pushStaticCssPass as Lo,popStaticCssPass as Do,resolveStyleBlockTokens as Qs}from"css-in-props";import{css as wt,wrapHoverRule as Ro}from"@symbo.ls/css";import{pushConfig as L,popConfig as D}from"@symbo.ls/scratch";import{checkAttributeByTagName as St,applyAttrTransforms as Xs,ATTR_TRANSFORMS as Jt,camelToAttr as Ct,serializeAttrValue as K,isEnumeratedTrueFalseAttr as at,extractConditionalAttrs as Js}from"attrs-in-props";import{resolveElementIdEngine as ms}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as It,CSS_SHORTHAND_LONGHANDS as tn,cssShorthandStatesLonghand as Mo}from"./cssLonghands.js";import{isAttributeFirst as No,isCssProp as st}from"./attributeFirst.js";import{VERSION as on}from"./version.js";const Fo=ms({uniqId:1,scopedStyleId:0},on),vt=[],nt=new Set;let mt=!1,Io=0,ut=null,kt=null;function dt(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function $o(){return typeof document<"u"&&document.visibilityState==="hidden"}const sn=250,nn=1e3;function en(){return kt&&(kt!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||$o())?!0:dt()-Io>=nn}function rn(){if(mt=!0,Io=dt(),kt=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(to,0);ut=t?()=>t(o):null;return}if($o()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(to,sn);ut=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;kt=requestAnimationFrame;const o=requestAnimationFrame(to);ut=t?()=>t(o):null}}function $t(){if(mt){if(!en())return;const t=ut;if(ut=null,t)try{t()}catch{}}rn()}const Uo=300,Ho=15e4;function to(){if(mt=!1,ut=null,kt=null,nt.size&&Zn(),!vt.length)return;const t=vt.splice(0,vt.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=dt());const r=dt()-n.__mountFirstAttemptAt;n.__mountAttempts<=Uo&&r<Ho?(vt.push(s),$t()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",r,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&Ks(s),typeof s.onMounted=="function"&&M("Mounted",s,s.__ref?.__mountOptions||{})}}}function oo(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Dt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,vt.push(t),$t())}function Vo(t,o){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&q("contentUpdate",t,o);const s=t.context?.designSystem;s&&L(s);try{t.onContentUpdate(t,t.state,t.context,o)}catch(n){if(t.context?.plugins?.length&&q("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{s&&D()}}function Z(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function cn(t){return t.charAt(2).toLowerCase()+t.slice(3)}function fn(t){return t.toLowerCase()}function so(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function jt(t,o){const s={...t};for(const n in o){const r=s[n],i=o[n];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[n]=jt(r,i):s[n]=i}return s}function Ut(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function Bo(t,o,s){return Ut(t)||(o&&typeof o=="object"?Ut(o.key):void 0)||String(s)}function J(t,o,s,n={},r){const i=ko();if(i){Nt(null);try{return J(t,o,s,n,r)}finally{Nt(i)}}if(t==null||t===!1)return null;const a=Cn(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Ut(s);const f=Ut(t.key),e=Object.create(null);e.key=s||f||`_${Fo.uniqId++}`,e.parent=o||null,e.context=t.context||o?.context||n.context||{},e.context.__create||(e.context.__create=J);const c=e.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||e,path:o?.__ref?.path?[...o.__ref.path,e.key]:[e.key],origin:t};a&&(c.__runtimeSource=a);const l=t;if(t=Go(e,t,s,f,o,n),e.if!=null){let d;if(typeof e.if=="function")try{d=e.if(e,e.state,e.context)}catch(h){if(d=!1,c.__ifError=h,typeof console<"u"&&console.warn){const y=e.key||e.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${y} \u2014 treating as false:`,h?.message||h)}}else d=e.if;c.__if=!!d}if(c.__if)typeof e.if=="function"&&(c.__ifInitialized=!0);else{o&&(o[e.key]=e);const d=dn(t,s,e.context?.components);return d.length&&(c.__ifLateMerge={definition:l,key:s,ownKey:f,names:d,options:n}),typeof e.if=="function"&&mo(e,c,e.if),e}e.tag||(e.tag=jo(e)),M("Init",e,n);const u=e.node=Us(e)||Xt(e);if(!u)return e;if(e.tag==="fragment"){const h=(e.context?.document||globalThis.document).createComment("");u.appendChild(h),c.__fragmentAnchor=h}M("AttachNode",e,n),u.setAttribute&&e.key&&u.setAttribute("data-key",e.key),o&&(o[e.key]=e,o.__ref?.__children&&(o.__ref.__children.includes(e.key)||o.__ref.__children.push(e.key))),u.setAttribute&&e.context?.scopeSelector&&e.context.scopeSelector!==":root"&&e.context.key&&e.key===e.context.key&&u.setAttribute("data-smbls-app",e.context.key),e.id&&u.setAttribute&&(u.id=e.id),Ts(e,n),Xo(e),fo(e),ws(e),_o(e),Ps(e),ee(e);try{Ls(e,n)}catch(d){if(typeof console<"u"&&console.error){const h=e.__ref?.path?.join(".")||e.key||"<root>";console.error(`[smbls] createChildren failed at ${h}:`,d?.message||d,d?.stack?`
2
- `+d.stack.split(`
1
+ import{createStore as oo,createScopeStore as ms,isStore as G}from"@symbo.ls/signal";import{createEffect as j,getObserver as tn}from"@symbo.ls/signal";import{withDesignSystem as Z,untrack as Nt}from"./runContext.js";import{cacheNode as so,detectTag as To,adoptHydrationNode as on}from"./cache.js";import{REGISTRY as B,LIFECYCLE_EVENTS as sn}from"./registry.js";import{registerEvent as nn,registerGlobalEvent as en,globalEventKeyInfo as rn}from"./delegate.js";import{mountBridge as cn}from"./bridge.js";import{applyExtends as fn,openMergeLayer as an,closeMergeLayer as un}from"./extends.js";import{addMethods as dn}from"./methods.js";import"./dispose.js";import{isLoudDevRuntime as st}from"./devRuntime.js";import{mountBudgetExhausted as Do,openMountBudget as Lo,closeMountBudget as Ro,enqueueMountWork as Mo}from"./mountScheduler.js";import{replaceLiteralsWithObjectFields as F,isPolyglotWritableKey as ln,markPolyglotSeeded as pn,polyglotSeededKeys as hn}from"@symbo.ls/utils";import*as Ft from"@symbo.ls/utils";import{dispatchPluginHook as bt,hasPluginHook as yn,reportLifecycleError as $t}from"./pluginHooks.js";import{applyStateMethods as ft}from"@symbo.ls/state";import{CSS_PROPS_REGISTRY as $,DEFAULT_CSS_PROPERTIES_LIST as H,pushStaticCssPass as No,popStaticCssPass as Fo,resolveStyleBlockTokens as _n}from"css-in-props";import{css as At,wrapHoverRule as $o}from"@symbo.ls/css";import{pushConfig as W,popConfig as z}from"@symbo.ls/scratch";import{checkAttributeByTagName as xt,applyAttrTransforms as gn,ATTR_TRANSFORMS as no,camelToAttr as wt,serializeAttrValue as Q,isEnumeratedTrueFalseAttr as It,extractConditionalAttrs as bn}from"attrs-in-props";import{resolveElementIdEngine as An}from"./engineRegistry.js";import{CSS_LONGHAND_SHORTHANDS as Bt,CSS_SHORTHAND_LONGHANDS as xn,cssShorthandStatesLonghand as Io,cssPropName as Bo,cssCamelName as Ho}from"./cssLonghands.js";import{isAttributeFirst as Uo,isCssProp as nt}from"./attributeFirst.js";import{VERSION as wn}from"./version.js";const Vo=An({uniqId:1,scopedStyleId:0},wn),St=[],et=new Set;let eo=!1,Go=0,at=null,Ct=null;function ut(){return typeof Date<"u"&&typeof Date.now=="function"?Date.now():0}function Ko(){return typeof document<"u"&&document.visibilityState==="hidden"}const Sn=250,Cn=1e3;function kn(){return Ct&&(Ct!==(typeof requestAnimationFrame=="function"?requestAnimationFrame:null)||Ko())?!0:ut()-Go>=Cn}function vn(){if(eo=!0,Go=ut(),Ct=null,typeof requestAnimationFrame!="function"){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(ro,0);at=t?()=>t(o):null;return}if(Ko()){const t=typeof clearTimeout=="function"?clearTimeout:null,o=setTimeout(ro,Sn);at=t?()=>t(o):null}else{const t=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:null;Ct=requestAnimationFrame;const o=requestAnimationFrame(ro);at=t?()=>t(o):null}}function Ht(){if(eo){if(!kn())return;const t=at;if(at=null,t)try{t()}catch{}}vn()}const Wo=300,zo=15e4;function ro(){if(eo=!1,at=null,Ct=null,et.size&&ke(),!St.length)return;const t=St.splice(0,St.length);for(let o=0;o<t.length;o++){const s=t[o];if(s.node){if(!s.node.isConnected){const n=s.__ref||(s.__ref={});n.__mountAttempts=(n.__mountAttempts||0)+1,n.__mountFirstAttemptAt==null&&(n.__mountFirstAttemptAt=ut());const e=ut()-n.__mountFirstAttemptAt;n.__mountAttempts<=Wo&&e<zo?(St.push(s),Ht()):console.warn("[DOMQL] onMounted dropped after",n.__mountAttempts,"attempts /",e,"ms \u2014 node never connected:",s.key||s.tag||s);continue}typeof s.onBridgeMount=="function"&&cn(s),typeof s.onMounted=="function"&&D("Mounted",s,s.__ref?.__mountOptions||{})}}}function io(t,o){const s=t.__ref?.__autoGrow;s&&s.active&&Lt(t,!0),!(typeof t.onMounted!="function"&&typeof t.onBridgeMount!="function")&&(t.__ref.__mountOptions=o,St.push(t),Ht())}function Yo(t,o){typeof t.onContentUpdate=="function"&&(bt("contentUpdate",t,o),Z(t,()=>{try{t.onContentUpdate(t,t.state,t.context,o)}catch(s){if($t(t,"onContentUpdate",s),t.context?.strictMode)throw s}}))}function Y(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function jn(t){return t.charAt(2).toLowerCase()+t.slice(3)}function En(t){return t.toLowerCase()}function co(t){const o=t.charCodeAt(0);return o===58||o===64||o===38||o===91}function kt(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=kt(e,c):s[n]=c}return s}function Ut(t){if(typeof t=="string")return t||void 0;if(typeof t=="number"||typeof t=="bigint")return String(t)}function qo(t,o,s,n){return Vt(n,Ut(t)||(o&&typeof o=="object"?Ut(o.key):void 0)||String(s))}function Vt(t,o){if(!t||typeof o!="string")return o;let s=o;for(;Pn(t,s);)s="$"+s;return s!==o&&On(t,o,s),s}function Pn(t,o){if(B.has(o)&&o!=="content")return!0;if(!(o in t))return!1;const s=t[o];return!(s&&typeof s=="object"&&s.__ref&&s.parent===t)}const Zo=new Set;function On(t,o,s){if(!st())return;const n=t.__ref&&t.__ref.path&&t.__ref.path.join(".")||t.key||"<root>",e=n+"::"+o;Zo.has(e)||(Zo.add(e),console.warn(`[smbls] a child keyed "${o}" at ${n} names a property of its parent; it lives at el["${s}"] (data-key="${s}") so the parent keeps its own "${o}". Prefix the data keys to keep plain el.<key> access.`))}function X(t,o,s,n={},e){if(tn())return Nt(()=>X(t,o,s,n,e));if(t==null||t===!1)return null;const c=qn(t);(typeof t=="string"||typeof t=="number")&&(t={text:t}),s=Ut(s);const a=Ut(t.key),r=Object.create(null);r.key=s||(a&&o?Vt(o,a):a)||`_${Vo.uniqId++}`,r.parent=o||null,r.context=t.context||o?.context||n.context||{},r.context.__create||(r.context.__create=X);const i=r.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:o?.__ref?.root||r,path:o?.__ref?.path?[...o.__ref.path,r.key]:[r.key],origin:t};c&&(i.__runtimeSource=c);const f=t;if(t=Xo(r,t,s,a,o,n),r.if!=null){let u;if(typeof r.if=="function")try{u=r.if(r,r.state,r.context)}catch(l){if(u=!1,i.__ifError=l,typeof console<"u"&&console.warn){const _=r.key||r.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${_} \u2014 treating as false:`,l?.message||l)}}else u=r.if;i.__if=!!u}if(i.__if)typeof r.if=="function"&&(i.__ifInitialized=!0);else{o&&(o[r.key]=r);const u=Ln(t,s,r.context?.components);return u.length&&(i.__ifLateMerge={definition:f,key:s,ownKey:a,names:u,options:n}),typeof r.if=="function"&&hs(r,i,r.if),r}r.tag||(r.tag=To(r)),D("Init",r,n);const d=r.node=on(r)||so(r);if(!d)return r;if(r.tag==="fragment"){const l=(r.context?.document||globalThis.document).createComment("");d.appendChild(l),i.__fragmentAnchor=l}D("AttachNode",r,n),d.setAttribute&&r.key&&d.setAttribute("data-key",r.key),o&&(o[r.key]=r,o.__ref?.__children&&(o.__ref.__children.includes(r.key)||o.__ref.__children.push(r.key))),d.setAttribute&&r.context?.scopeSelector&&r.context.scopeSelector!==":root"&&r.context.key&&r.key===r.context.key&&d.setAttribute("data-smbls-app",r.context.key),r.id&&d.setAttribute&&(d.id=r.id),Ws(r,n),ds(r),ps(r);try{zs(r,n)}catch(u){if(typeof console<"u"&&console.error){const l=r.__ref?.path?.join(".")||r.key||"<root>";console.error(`[smbls] createChildren failed at ${l}:`,u?.message||u,u?.stack?`
2
+ `+u.stack.split(`
3
3
  `).slice(0,6).join(`
4
- `):"")}}if(Kt(e,!0),Ds(e,o,r),typeof e.html=="function"&&e.node&&!e.node.innerHTML){const d=e.context?.designSystem;d&&L(d);try{const h=e.html(e,e.state,e.context);h!=null&&typeof h!="function"&&(e.node.innerHTML=h)}catch{}finally{d&&D()}}if(M("Create",e,n),M("Complete",e,n),M("Render",e,n),M("RenderRouter",e,n),oo(e,n),typeof e.onFrame=="function"){const d=e.onFrame,h=e.context?.designSystem,y=()=>{if(e.node){if(e.node.isConnected){h&&L(h);try{d(e,e.state,e.context)}catch(A){console.error("[DOMQL] onFrame error:",A)}finally{h&&D()}}requestAnimationFrame(y)}};requestAnimationFrame(y)}return e}function Go(t,o,s,n,r,i){if(s&&!o.extends&&!o.extend){const b=s.indexOf("_"),w=s.indexOf(".");let p=b>0?b:-1;if(w>0&&(p<0||w<p)&&(p=w),p>0){const _=s.substring(0,p),x=t.context?.components;x&&(x[_]||x["smbls."+_])?o={...o,extends:_}:x&&ft()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${_}" but neither "${_}" nor "smbls.${_}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),Ws(t,o,i);const a=zs(t),f=a?a.rank:0,e=new Set(["childProps","attr","style","scope","data","vars"]),c=t.props&&typeof t.props=="object"?t.props:null;for(const b in o){if(b==="parent"||b==="node"||b==="__ref"||b==="extends"||b==="context"||b==="props")continue;if(b==="key"){n&&(t.key=n);continue}const w=o[b];a&&a.set(b,f);const p=t[b],_=p&&w&&typeof p=="object"&&typeof w=="object"&&!Array.isArray(p)&&!Array.isArray(w)&&typeof p!="function"&&typeof w!="function";_&&b.charCodeAt(0)>=65&&b.charCodeAt(0)<=90?t[b]=jt(p,w):_&&e.has(b)?t[b]={...p,...w}:_&&so(b)?t[b]=jt(p,w):t[b]=w}function l(b){for(const w in b){const p=b[w],_=t[w],x=_&&p&&typeof _=="object"&&typeof p=="object"&&!Array.isArray(_)&&!Array.isArray(p)&&typeof _!="function"&&typeof p!="function";x&&w.charCodeAt(0)>=65&&w.charCodeAt(0)<=90?t[w]=jt(_,p):x&&e.has(w)?t[w]={..._,...p}:x&&so(w)?t[w]=jt(_,p):t[w]=p}}if(c&&l(c),o.props&&typeof o.props=="object"&&(l(o.props),a))for(const b in o.props)a.set(b,f);o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const u=t.scope&&typeof t.scope=="object"?t.scope:null,d=r?.scope,h=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,y=d||h||null;if(o.scope!==void 0||u){const b={};u&&Object.assign(b,u),o.scope!==void 0&&Object.assign(b,o.scope),t.scope=$s(b,y)}else y&&(t.scope=y);o.if!==void 0&&(t.if=o.if);const A=t.__ref,g=vn(t,A&&A.__runtimeSource);return A&&(A.__declaredArrays=g||void 0),Ys(t),ln(t,r,o,i),o}const an=new Set(["key","parent","context","__ref"]);function un(t,o){for(const r of Object.keys(t))an.has(r)||delete t[r];const s=ko();s&&Nt(null);let n=o.definition;if(!n.extends&&!n.extend&&typeof o.key=="string"){const r=t.context?.components||{},i=r[o.key]||r["smbls."+o.key];i&&(n={...n,extends:i})}try{Go(t,n,o.key,o.ownKey,t.parent,o.options)}finally{s&&Nt(s)}}function dn(t,o,s){const n=s||{},r=f=>!!(n[f]||n["smbls."+f]),i=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const f of a){if(typeof f!="string")continue;const e=f.includes(">")?f.split(">")[0].trim():f;r(e)||i.push(e)}return i}if(typeof o=="string"&&/^[A-Z]/.test(o)){let f=-1;const e=o.indexOf("_"),c=o.indexOf(".");e>0&&(f=e),c>0&&(f<0||c<f)&&(f=c);const l=f>0?o.substring(0,f):o;r(l)||i.push(l)}return i}function no(t,o,s){if(typeof t.onStateInit!="function"&&!t.context?.plugins?.length)return;const n=t.state;t.state=o;try{M("StateInit",t,s)}finally{t.state=n}}function ln(t,o,s,n){const r=!o,i=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=r&&i&&t.context?.state,f=s.state!==void 0&&!a?s.state:t.state&&!Y(t.state)?t.state:void 0;if(f==null){if(o?.state)t.state=o.state,xt(t,t.state);else if(t.context?.state){const e=t.context.state,c={...e},l=t.context?.polyglot;if(l?.translations){const u=t.context,d=e.lang||l.defaultLang||"en",h=new Set,y=(b,w)=>{h.has(b)||qs(u,b,c)&&(c[b]=w,h.add(b),Zs(u,b,w))},A=l.translations[d];if(A&&typeof A=="object")for(const b in A)y(b,A[b]);const g=new Set(l.languages||[]);for(const b in l.translations)g.has(b)||y(b,l.translations[b])}Y(c)||no(t,c,n),t.state=Y(c)?c:Qt(c),t.state.__element=t,t.state.root=t.state,xt(t,t.state),Ft.promoteActiveRootState?.(e,t.state),M("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),xt(t,t.state);return}if(typeof f=="string"){if(t.state=Ko(f,o),t.state&&typeof t.state=="object"&&!Y(t.state)){const e=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:e,enumerable:!1,configurable:!0,writable:!0})}xt(t,t.state),M("StateCreated",t,n);return}if(typeof f=="function"){const e=f(t,o?.state);if(Y(e))t.state=e;else{const c=e||{};no(t,c,n),t.state=Qt(c)}}else if(Y(f))t.state=f;else{const e={...f};no(t,e,n),t.state=Qt(e)}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,xt(t,t.state),Ft.promoteActiveRootState?.(f,t.state),M("StateCreated",t,n)}function eo(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const r of s){if(n==null)return{};n=n[r]}return n??{}}function Ko(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")){const r=t.slice(3);return r?eo(o.state,r):o.state??{}}if(t.startsWith("~/")){const r=o.state?.root||o.state,i=t.slice(2);return i?eo(r,i):r??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=eo(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const r=o.state?.root?.lang||n.defaultLang||"en",i=n.translations[r];if(i?.[t]!==void 0)return i[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}const pn=new Set(["s","state","ctx","context"]);function hn(t){try{const s=(typeof Ft.getFunctionSource=="function"?Ft.getFunctionSource(t):Function.prototype.toString.call(t)).match(/^[^(]*\(([^)]*)\)/);return s?s[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}const yn=3,_n=/^(is|has)[A-Z0-9_$]/,gn=new Set(["routerOptions"]),Wo=new WeakSet;function bn(t,o){if(typeof t!="function"||t.length!==2||o&&(_n.test(o)||gn.has(o))||Wo.has(t))return!1;const s=hn(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<yn||pn.has(n)?!1:(Wo.add(t),!0)}function An(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,r=[],i=Object.keys(t);for(let a=0;a<i.length;a++){const f=i[a];if(typeof t[f]!="function"||G.has(f))continue;const e=f.charCodeAt(0);e>=65&&e<=90||Z(f)||U[f]||V&&V.has(f)||e!==45&&(St(s,f)||(ft()&&bn(t[f],f)&&console.warn(`[smbls] custom prop "${f}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${f}', \u2026) instead of reading el.${f}(\u2026) directly (see RULES.md Rule 8).`),r.push({prop:f,fn:t[f]})))}for(let a=0;a<r.length;a++){const{prop:f,fn:e}=r[a];o.__exec[f]=e,Object.defineProperty(t,f,{get(){n&&L(n);try{return e(t,t.state,t.context)}catch{return}finally{n&&D()}},set(c){delete o.__exec[f],Object.defineProperty(t,f,{value:c,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function xn(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const n=o[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function T(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return xn(t,o),s.apply(this,n)}}function lt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function k(t,o){return()=>t.path.join(".")+"::"+o}const zo=new Set;function R(t,o,s){if(!ft())return;const n=k(t,o)();zo.has(n)||(zo.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const Yo=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,wn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;Yo.lastIndex=0;let n;for(;(n=Yo.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Sn=(t,o)=>!Z(t)&&!st(o,t),ro=(t,o,s,n,r)=>{if(typeof o=="string"){!r&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Sn(t,n)&&wn(o,s)},io=new WeakMap,Et=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),Pt=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?it(t,o):t},Ot=(t,o)=>t&&o?it(t,o):t||o||null,qo=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&Et(s,o)},pt=(t,o)=>qo(t,o)?Pt(t.__ref.__runtimeSource[o]):null,Tt=(t,o)=>(o&&t&&typeof t=="object"&&io.set(t,o),t),Cn=t=>{if(!t||typeof t!="object")return;const o=io.get(t);return o&&io.delete(t),o},co=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let n=0;n<t.length;n++)co(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const r=Object.getOwnPropertyDescriptor(t,n);r&&"value"in r&&co(r.value,o,s)}}},vn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(G.has(n)||o&&Et(o,n))continue;const r=Object.getOwnPropertyDescriptor(t,n),i=r&&r.value;if(!Array.isArray(i))continue;const a=new Set;co(i,a,new Set),a.size&&(s||(s=new Map),s.set(i,a))}return s},Zo=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,r=n&&n.get(o);if(!r)continue;const i=t.__ref;i.__authoredTemplates||(i.__authoredTemplates=new Set);for(const a of r)i.__authoredTemplates.add(a);return}},Qo=["attr","aria","data","metadata"],kn=t=>{if(Qo.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},jn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const r of Object.keys(t)){const i=Object.getOwnPropertyDescriptor(t,r),a=i&&i.value,f=!!o&&Et(o,r);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!kn(r))continue;const e=f?o[r]:null,c=e&&typeof e=="object"?e:null,l=r.charCodeAt(0)===46||r.charCodeAt(0)===33;for(const u in a){const d=f&&(!c||Et(c,u)),h=a[u];if(l&&h&&typeof h=="object"&&!Array.isArray(h)&&Qo.includes(u)){for(const y in h)ro(y,h[y],s,n,d);continue}ro(u,h,s,n,d)}continue}ro(r,a,s,n,f)}return s};function Xo(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),r=jn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const e of r)s.__authoredTemplates.add(e);else s.__authoredTemplates=r;if(An(t),typeof t.text=="function"){const e=t.text,c=T(t,t.textDeps,e),l=j(()=>{if(!s.contentManaged)try{let u=c(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=$.call(t,u,t.state)),Ht(t,u))}catch(u){R(s,"text",u)}},{depth:s.path.length,label:k(s,"text")});s.__effects.push(l),s.__exec.text=e}else if(typeof t.text=="string"&&t.text.includes("{{")){const e=t.text,c=j(()=>{if(s.contentManaged)return;const l=$.call(t,e,t.state);l!=null&&(t.text=l),t.node&&Ht(t,l??"")},{depth:s.path.length,label:k(s,"text")});s.__effects.push(c),s.__exec.text=e}const i=t.tag||"div";for(const e of Object.keys(t))if(typeof t[e]=="function"&&!G.has(e)&&!Z(e)&&!s.__exec[e]&&!No(i,e)){if(U[e]){const c=t[e],l=T(t,t[e+"Deps"],c),u=e;let d,h=null,y=null,A;const g=j(()=>{const b=t.context?.designSystem;b&&L(b);try{const w=l(t,t.state,t.context);Lo();let p;try{p=U[u](w,t,t.state,t.context)}finally{Do()}if(Array.isArray(p)){const x={};for(const S of p)if(S)for(const v in S)x[v]=S[v];p=x}const _=u==="show"||u==="hide";if(p&&t.node&&En(p)){const x=Lt(p);if(x===null||x!==A){A=x;const S=wt(p,null,t.context?.cssPrefix),v=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(y)for(const C of y)t.node.classList.remove(C);if(v&&v.length)for(const C of v)t.node.classList.add(C);y=v}}d=void 0,h=null}else if(p&&t.node){if(y){for(const S of y)t.node.classList.remove(S);y=null,A=void 0}const x=Lt(p);if(x===null||x!==d||!yt(t.node,h)){d=x;const S=rs(t,p);h=ht(t.node,S)}}else t.node&&_&&(d=void 0,h=null,t.node.style.display="")}finally{b&&D()}},{depth:s.path.length,label:k(s,u)});s.__effects.push(g),s.__exec[e]=c}else if(V&&V.has(e)){const c=t[e],l=T(t,t[e+"Deps"],c),u=e;let d,h=null;const y=j(()=>{const A=t.context?.designSystem;A&&L(A);try{const g=l(t,t.state,t.context);if(t.node)if(g!=null){const b=u+":"+String(g);if(b!==d||!yt(t.node,h)){d=b;const w={[u]:g},p=rs(t,w);h=ht(t.node,p)}}else d=void 0,h=null,t.node.style[u]=""}finally{A&&D()}},{depth:s.path.length,label:k(s,u)});s.__effects.push(y),s.__exec[e]=c}else if(e.charCodeAt(0)===45){const c=t[e];ns(t,e,c,t[e+"Deps"],e),s.__exec[e]=c}}if(Pn(t),typeof t.html=="function"){const e=t.html,c=T(t,t.htmlDeps,e),l=j(()=>{const u=t.context?.designSystem;u&&L(u);try{const d=c(t,t.state,t.context);t.node&&d!=null&&typeof d!="function"&&(t.node.innerHTML=d)}finally{u&&D()}},{depth:s.path.length,label:k(s,"html")});s.__effects.push(l),s.__exec.html=e}if(typeof t.value=="function"){const e=t.value,c=T(t,t.valueDeps,e),l=j(()=>{try{let u=c(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=$.call(t,u,t.state)),ts(t,u)}catch(u){R(s,"value",u)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(l),s.__exec.value=e}else if(typeof t.value=="string"&&t.value.includes("{{")){const e=t.value,c=j(()=>{try{ts(t,$.call(t,e,t.state))}catch(l){R(s,"value",l)}},{depth:s.path.length,label:k(s,"value")});s.__effects.push(c),s.__exec.value=e}if(typeof t.style=="function"){const e=t.style,c=T(t,t.styleDeps,e);let l,u=null;const d=j(()=>{const h=lo(t,c(t,t.state,t.context)),y=Lt(h);(y===null||y!==l||!yt(t.node,u))&&(l=y,Vt(t.node,u,h),X(t.node,h),u=ht(t.node,h))},{depth:s.path.length,label:k(s,"style")});s.__effects.push(d),s.__exec.style=e}else if(t.style&&typeof t.style=="object")for(const e in t.style){const c=t.style[e];if(typeof c!="function")continue;const l=T(t,lt(t.styleDeps,e),c);let u,d=null;const h=j(()=>{try{const y=l(t,t.state,t.context);if(t.node){const A=e+":"+String(y);if(A!==u||!yt(t.node,d)){u=A;const g=lo(t,{[e]:y});Vt(t.node,d,Object.assign({},g,{[e]:""})),X(t.node,g),d=ht(t.node,g)}}}catch(y){R(s,"style."+e,y)}},{depth:s.path.length,label:k(s,"style."+e)});s.__effects.push(h)}if(t.attr&&typeof t.attr=="object"){for(const e in t.attr)if(typeof t.attr[e]=="function"){const c=T(t,lt(t.attrDeps,e),t.attr[e]),l=e,u=j(()=>{try{let d=c(t,t.state,t.context);typeof d=="string"&&d.includes("{{")&&(d=$.call(t,d,t.state)),t.node?.setAttribute&&(d==null||d===!1&&!at(l)?t.node.removeAttribute(l):typeof d!="function"&&typeof d!="object"&&t.node.setAttribute(l,K(l,d)))}catch(d){R(s,"attr."+l,d)}},{depth:s.path.length,label:k(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[e]=="string"&&t.attr[e].includes("{{")){const c=t.attr[e],l=e,u=j(()=>{try{const d=$.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(l,K(l,d??""))}catch(d){R(s,"attr."+l,d)}},{depth:s.path.length,label:k(s,"attr."+l)});u._attrName=l.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const c=t.aria[e];if(typeof c=="string"&&c.includes("{{")){const h=c,y="aria-"+e.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),A=j(()=>{try{const g=$.call(t,h,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,K(y,g??""))}catch(g){R(s,"aria."+e,g)}},{depth:s.path.length,label:k(s,"aria."+e)});A._attrName=y,s.__effects.push(A);continue}if(typeof c!="function")continue;const l=T(t,lt(t.ariaDeps,e),t.aria[e]),u="aria-"+e.replace(/[A-Z]/g,h=>"-"+h.toLowerCase()),d=j(()=>{try{const h=l(t,t.state,t.context);if(!t.node?.setAttribute)return;h==null?t.node.removeAttribute(u):typeof h!="function"&&typeof h!="object"&&t.node.setAttribute(u,K(u,h))}catch(h){R(s,"aria."+e,h)}},{depth:s.path.length,label:k(s,"aria."+e)});d._attrName=u,s.__effects.push(d)}if(t.data&&typeof t.data=="object")for(const e in t.data){const c=t.data[e];if(typeof c=="string"&&c.includes("{{")){const y=c,A="data-"+e.replace(/[A-Z]/g,b=>"-"+b.toLowerCase()),g=j(()=>{try{const b=$.call(t,y,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(A,b??"")}catch(b){R(s,"data."+e,b)}},{depth:s.path.length,label:k(s,"data."+e)});g._attrName=A,s.__effects.push(g);continue}if(typeof c!="function")continue;const l=T(t,lt(t.dataDeps,e),t.data[e]),d="data-"+e.replace(/[A-Z]/g,y=>"-"+y.toLowerCase()),h=j(()=>{try{const y=l(t,t.state,t.context);if(!t.node?.setAttribute)return;y==null||y===!1?t.node.removeAttribute(d):typeof y!="function"&&typeof y!="object"&&t.node.setAttribute(d,y===!0?"":y)}catch(y){R(s,"data."+e,y)}},{depth:s.path.length,label:k(s,"data."+e)});h._attrName=d,s.__effects.push(h)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const e in a){if(typeof a[e]!="function")continue;const c=T(t,lt(t.classDeps,e),a[e]),l=j(()=>{try{const u=c(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(e):t.node.classList.remove(e)}catch(u){R(s,"class."+e,u)}},{depth:s.path.length,label:k(s,"class."+e)});s.__effects.push(l)}!n&&typeof t.if=="function"&&mo(t,s,t.if);for(const e of Object.keys(t)){if(G.has(e)||typeof t[e]!="function")continue;const c=e.charCodeAt(0);if(c>=65&&c<=90||Z(e))continue;const l=t[e];s.__exec[e]=l;const u=t.tag||"div";if(St(u,e)&&!st(u,e)){const d=Ct(e)||e,h=T(t,t[e+"Deps"],l),y=j(()=>{try{let A=h(t,t.state,t.context);typeof A=="string"&&A.includes("{{")&&(A=$.call(t,A,t.state)),t.node?.setAttribute&&(A==null||A===!1&&!at(d)?t.node.removeAttribute(d):typeof A!="function"&&typeof A!="object"&&(d==="src"&&"src"in t.node?t.node.src=A:t.node.setAttribute(d,K(d,A))))}catch(A){R(s,e,A)}},{depth:s.path.length,label:k(s,e)});y._attrName=d.toLowerCase(),s.__effects.push(y)}}const f=t.tag||"div";for(const e of Object.keys(t)){if(G.has(e))continue;const c=t[e];if(typeof c!="string"||!c.includes("{{"))continue;const l=e.charCodeAt(0);if(l>=65&&l<=90||Z(e)||st(f,e)||Jt[e]||!St(f,e))continue;const u=Ct(e)||e,d=j(()=>{try{const h=$.call(t,c,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,K(u,h??""))}catch(h){R(s,e,h)}},{depth:s.path.length,label:k(s,e)});d._attrName=u.toLowerCase(),s.__effects.push(d)}if(Nn(t),Kn(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const e=t.onStateUpdate,c=t.stateDeps;let l=!1,u=[];const d=j(()=>{const h=[];for(let b=0;b<c.length;b++){const w=c[b];try{h[b]=typeof w=="function"?w(t,t.state,t.context):t.state?.[w]}catch{h[b]=void 0}}if(!l){l=!0,u=h;return}let y=h.length!==u.length;for(let b=0;!y&&b<h.length;b++)h[b]!==u[b]&&(y=!0);const A=u;if(u=h,!y)return;const g=t.context?.designSystem;g&&L(g);try{e(t,t.state,t.context,{prev:A,next:h})}catch(b){if(t.context?.plugins?.length&&q("error",t,{hook:"onStateUpdate",error:b})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',b),t.context?.strictMode)throw b}finally{g&&D()}},{depth:s.path.length,label:k(s,"onStateUpdate")});s.__effects.push(d)}Un(t)}function Jo(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ds(t,t.parent);return}let n=null;const r=Object.keys(o),i=r.indexOf(t.key);for(let a=i+1;a<r.length;a++){const f=o[r[a]];if(f?.node?.parentNode===s){n=f.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function mo(t,o,s){let n=T(t,t.ifDeps,s);const r=j(()=>{const i=!o.__ifInitialized&&o.__ifLateMerge;if(i){const e=t.context?.components||{};i.names.some(c=>e[c]||e["smbls."+c])&&(o.__ifLateMerge=null,un(t,i),n=T(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(e){if(a=!1,o.__ifError=e,typeof console<"u"&&console.warn){const c=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${c} \u2014 treating as false:`,e?.message||e)}return}const f=o.__if;if(o.__if=!!a,f&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(e){console.error("[smbls] onRemove error:",e)}}else if(!f&&o.__if)if(o.__ifInitialized)t.node||(t.node=Xt(t)),t.node&&(t.node.ref=t),Jo(t),fo(t),_o(t),M("Render",t,{}),oo(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=jo(t)),M("Init",t,{}),t.node||(t.node=Xt(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!o.__fragmentAnchor){const c=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(c),o.__fragmentAnchor=c}M("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ts(t,{}),Xo(t,{skipIfEffect:!0}),fo(t),ws(t),_o(t),Ps(t),Ls(t,{}),Jo(t),M("Create",t,{}),M("Complete",t,{}),M("Render",t,{}),M("RenderRouter",t,{}),oo(t,{})}},{depth:o.path.length,label:k(o,"if")});o.__effects.push(r)}function Ht(t,o){const s=t.node;if(!s)return;const n=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const r=t.__ref;let i=r?r.__textNode:null;if(i&&i.parentNode!==s&&(i=null),!i){const a=s.firstChild;a&&a.nodeType===3&&(i=a)}i?i.nodeValue!==n&&(i.nodeValue=n):s.firstChild?(i=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(i,s.firstChild)):(s.textContent=n,i=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),r&&(r.__textNode=i||null)}function ts(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const r=typeof document<"u"&&document.activeElement===s,i=r&&typeof s.selectionStart=="number"?s.selectionStart:null,a=r&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,r&&i!=null&&a!=null)try{s.setSelectionRange(i,a)}catch{}const f=t.__ref&&t.__ref.__autoGrow;f&&f.active&&f.resize()}function fo(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Ht(t,t.text),xs(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){s={};for(const r in t.style)typeof t.style[r]!="function"&&(s[r]=t.style[r]);break}X(o,lo(t,s))}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const n=t.attr[s];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!at(s)||o.setAttribute&&o.setAttribute(s,K(s,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const s in t.data){const n=t.data[s];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||o.dataset&&(o.dataset[s]=n===!0?"":n)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(n=>n&&o.classList.add(n));else if(typeof s=="object")for(const n in s){const r=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];r&&o.classList.add(typeof r=="string"?r:n)}}}}function Lt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function En(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function ht(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const r in o){if(o[r]==null||r.charAt(0)==="&")continue;const a=Q(r);n.push(a,ao(s,a),os(s,a))}return n}function ao(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function os(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function Q(t){return et(t)?t:t.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}function Vt(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,r=new Set;if(s&&typeof s=="object")for(const i in s)s[i]==null||i.charAt(0)==="&"||r.add(Q(i));for(let i=0;i<o.length;i+=3){const a=o[i];r.has(a)||ao(n,a)===o[i+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function yt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(ao(s,o[n])!==o[n+1]||os(s,o[n])!==o[n+2])return!1;return!0}const et=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,ss=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",Bt=t=>et(t)?t:"--"+t;function Gt(t,o){if(!m(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let r=t[n];if(typeof r=="function"){if(!o)continue;r=r(o,o.state,o.context)}ss(r)&&(s||(s={}),s[Bt(n)]=r)}return s}function ns(t,o,s,n,r){const i=t.__ref,a=T(t,n,s);let f,e=null;const c=j(()=>{const l=t.context?.designSystem;l&&L(l);try{const u=a(t,t.state,t.context),d=t.node;if(!d||!d.style)return;if(!ss(u)){Vt(d,e,null),f=void 0,e=null;return}const h=String(u);if(h!==f||!yt(d,e)){f=h;const y={[o]:u};X(d,y),e=ht(d,y)}}catch(u){R(i,r,u)}finally{l&&D()}},{depth:i.path.length,label:k(i,r)});i.__effects.push(c)}function Pn(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){On(t,s),o.__exec.vars=s;return}if(m(s))for(const n of Object.keys(s)){const r=s[n];!n||typeof r!="function"||ns(t,Bt(n),r,lt(t.varsDeps,n),"vars."+n)}}function On(t,o){const s=t.__ref,n=T(t,t.varsDeps,o);let r,i=null;const a=j(()=>{const f=t.context?.designSystem;f&&L(f);try{const e=Gt(n(t,t.state,t.context)),c=t.node;if(!c||!c.style)return;const l=Lt(e);(l===null||l!==r||!yt(c,i))&&(r=l,Vt(c,i,e),e&&X(c,e),i=e?ht(c,e):null,s.__varsInline=e?new Set(Object.keys(e)):null)}catch(e){R(s,"vars",e)}finally{f&&D()}},{depth:s.path.length,label:k(s,"vars")});s.__effects.push(a)}function uo(t,o){if(typeof t[o]=="function"&&(st(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!et(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!m(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&Bt(n)===o)return!0;return!1}function Tn(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(Q(s)));return o}function Ln(t,o,s,n){const r=t.__ref;if(!r)return;let i=null;if(s)for(const a of s){if(n&&n.has(a))continue;const f=o[a];if(f==null||typeof f=="object")continue;const e=Q(a);It[e]&&(i||(i={}),i[e]=f)}r.__declaredLonghands=i}function es(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let r=null;for(const i in n){if(o.has(i))continue;const a=It[i];let f=!1;for(let e=0;e<a.length;e++)if(o.has(a[e])){f=!0;break}f&&(r||(r={}),r[i]=n[i])}return r}function rs(t,o){const s=t.node;X(s,o);const n=Tn(o);if(!n)return o;const r=t.__ref;if(r)if(r.__inlineCssKeys)for(const a of n)r.__inlineCssKeys.add(a);else r.__inlineCssKeys=new Set(n);const i=es(t,n);return i?(X(s,i),Object.assign({},o,i)):o}function Dn(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=es(t,o.__inlineCssKeys);s&&X(t.node,s)}function lo(t,o){if(!o||typeof o!="object")return o;const s=t&&t.context&&t.context.designSystem;s&&L(s);try{return Qs(o,t)}catch{return o}finally{s&&D()}}function X(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const r=o[n];if(r!=null){if(n.charAt(0)==="&"&&typeof r=="object"){s||(s={}),s[n]=r;continue}try{const i=String(r),a=et(n)?n:n.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),f=i.trim(),e=/\s*!important\s*$/.test(f),c=f.replace(/\s*!important\s*$/,"");t.style.setProperty(a,c,e?"important":"")}catch{}}}s&&Rn(t,s)}function Rn(t,o){const s=`_ds${Fo.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let r=n.querySelector("style[data-smbls-scoped]");r||(r=n.createElement("style"),r.setAttribute("data-smbls-scoped",""),n.head.appendChild(r));let i="";for(const a in o){const f="."+s,e=a.replace(/&/g,f).split(",").map(l=>{const u=l.trim();return u.includes(f)?u:f+u}).join(", "),c=o[a];if(typeof c=="object"){let l="",u="";for(const d in c){const h=c[d];if(typeof h=="object"){const y=d.includes("&")?e.split(", ").map(g=>d.replace(/&/g,g)).join(", "):e.split(", ").map(g=>`${g} ${d}`).join(", ");let A="";for(const g in h)A+=`${Q(g)}: ${h[g]};`;u+=Ro(`${y} { ${A} }`,y)+`
5
- `}else l+=`${Q(d)}: ${h};`}l&&(i+=Ro(`${e} { ${l} }`,e)+`
6
- `),u&&(i+=u)}}i&&(r.textContent+=i)}const is=new Set;function cs(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function Mn(t,o,s){const n=cs(s);queueMicrotask(()=>{if(!t.__ref)return;let r;try{r=o(t,t.state,t.context)}catch{return}if(cs(r)===n)return;const i=t.__ref.path?t.__ref.path.join("."):t.key||"?";is.has(i)||(is.add(i),console.warn(`[smbls] subscribeTo function at "${i}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(r)?r.join(", "):String(r)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function Nn(t){const o=t.subscribeTo,s=typeof o=="function";let n=o;if(s)try{n=o(t,t.state,t.context)}catch{n=null}if(s&&ft()&&Mn(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const r=t.__ref;for(let i=0;i<n.length;i++){const a=n[i];if(typeof a!="string"||a.length===0)continue;const f=a.split("."),e=f[0],c=f.slice(1),l={value:!1},u=j(()=>{const d=t.state&&(Y(t.state)?t.state.root:null);if(!d||!Y(d))return;let h=d;h=h[e];for(let A=0;A<c.length&&!(h==null||typeof h!="object");A++)if(Y(h))h=h[c[A]];else break;if(!l.value)return;let y=!1;if(typeof t.onBeforeUpdate=="function"){const A=t.context?.designSystem;A&&L(A);try{if(ie(r)){const g=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});g&&typeof g.then=="function"?g.then(()=>Wt(r,!1),b=>{Wt(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:b})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",b)}):(Wt(r,!1),g===!1&&(y=!0))}}catch(g){Wt(r,!0),t.context?.plugins?.length&&q("error",t,{hook:"onBeforeUpdate",error:g})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",g)}finally{A&&D()}}if(!y&&t.node&&r.__effects)for(let A=0;A<r.__effects.length;A++){const g=r.__effects[A];g&&g!==u&&!g._disposed&&!g._isSubscribeToEffect&&typeof g._execute=="function"&&g._execute()}if(!y&&typeof t.onUpdate=="function"){const A=t.context?.designSystem;A&&L(A);try{t.onUpdate(t,t.state,t.context)}catch(g){t.context?.plugins?.length&&q("error",t,{hook:"onUpdate",error:g})||console.error("[DOMQL] subscribeTo onUpdate error:",g)}finally{A&&D()}}},{depth:r.path.length,label:k(r,"subscribeTo("+a+")")});l.value=!0,u._isSubscribeToEffect=!0,r.__effects.push(u)}}function po(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function ho(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const fs=new Set;function Fn(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;fs.has(n)||(fs.add(n),console.warn(`[smbls/css] "${t}" at ${s} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}const as=new Map;function In(t){let o=as.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const r of n)o.push(r.replace(/-([a-z])/g,(i,a)=>a.toUpperCase()))};return s(It[t]),s(tn[t]),as.set(t,o),o}function us(t,o,s){if(uo(t,o)||s&&s.has(o))return!0;const n=In(Q(o));for(let r=0;r<n.length;r++){const i=n[r];if(uo(t,i)||s&&s.has(i))return!0}return!1}function _t(t,o,s,n){const r={},i=new Set,a=(f,e,c)=>{const l=c?new Set(Object.keys(r)):null;if(U[f]){const u=U[f](e,o,o.state,o.context);if(u){const d=Array.isArray(u)?u:[u];for(const h of d)h&&Object.assign(r,h)}}else r[f]=e;if(c)for(const u in r)l.has(u)||i.add(u)};for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f))continue;let e=t[f];if(typeof e=="function"&&(e=e(o,o.state,o.context)),!(e==null||typeof e=="function")){if(typeof e=="object"&&!Array.isArray(e)){if(f==="style"){for(const u in e){let d=e[u];typeof d=="function"&&(d=d(o,o.state,o.context)),!(d==null||typeof d=="function")&&a(u,d,us(o,u,n))}continue}if(f==="vars"){const u=Gt(e,o);if(u)for(const d in u)a(d,u[d],uo(o,d)||!!(n&&n.has(d)));continue}if(po(f,o)){const u=_t(e,o,!1,n);Object.keys(u).length&&(r[`[data-theme="${f.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(f)){ft()&&Fn(f,o);continue}const c=ho(f,o),l=_t(e,o,!1,n);Object.keys(l).length&&(r[c]=l);continue}a(f,e,us(o,f,n))}}if(s)for(const f in r)i.add(f);for(const f of i){const e=r[f];typeof e=="string"&&!e.includes("!important")&&(r[f]=e+" !important")}return r}const m=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function ds(t,o){for(const s in o){const n=o[s];t[s]=m(n)?ds(m(t[s])?t[s]:{},n):n}return t}function $n(t,o){if(!m(o))return;let s;for(const n of t.split(" ")){const r=n?o[n]:null;m(r)&&(s=ds(s||{},r))}return s}function yo(t,o){if(o===void 0&&(o=0),o>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&yo(t[s],o+1))return!0}return!1}function ls(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(po(t,s)){const i=_t(o,s,!1);return Object.keys(i).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:i}:null}const n=ho(t,s),r=_t(o,s,!1);return Object.keys(r).length?{cssProp:n,block:r}:null}function Un(t){const o=t.__ref;for(const s of Object.keys(t)){if(!so(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!yo(n))continue;let r=null,i;const a=j(()=>{if(!t.node)return;const f=t.context?.designSystem;f&&L(f);let e,c=!1;try{const l=ls(s,n,t),u=l?Lt(l.block)+"::"+l.cssProp:null;if(u!==null&&u===i)c=!0;else if(i=u,l){const d=wt({[l.cssProp]:l.block},null,t.context?.cssPrefix);e=d?d.split(" ").filter(Boolean):null}else e=null}finally{f&&D()}if(!(c||!t.node.classList)){if(r)for(const l of r)t.node.classList.remove(l);if(e&&e.length)for(const l of e)t.node.classList.add(l);r=e}},{depth:o.path.length,label:k(o,"cssBlock("+s+")")});o.__effects.push(a)}}const Hn=()=>!0,Vn=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!U[t]||!!(V&&V.has(t))||et(t)||t==="vars"};function Bn(t,o,s){const n={};let r=!1;for(const f in s)Object.prototype.hasOwnProperty.call(s,f)&&(f!=="data"&&f!=="aria"&&(Vn(f,s[f])||G.has(f))?n[f]=!0:r=!0);if(!r)return null;const i=Js({[o]:s},t.tag||"div",n,Hn);let a=null;for(const f in i)/^on/i.test(f)||(a||(a={}),a[f]=i[f]);return a}function ps(t,o,s,n,r,i){const a=t.node;let f=null;const e=c=>{(f||(f=[])).push(c)};for(const c in n){const l=o.owners.get(c),u=l===s;if(!i&&l!==void 0&&!u)continue;let d;try{d=n[c](t)}catch(y){R(t.__ref,"conditional("+s+")."+c,y),u&&e(c);continue}if(typeof d=="string"&&d.includes("{{")&&(d=$.call(t,d,t.state)),u&&a.getAttribute(c)!==o.written.get(c)){e(c);continue}if(d==null||typeof d=="object"||typeof d=="function"){u&&hs(a,o,c);continue}const h=d===!1&&!at(c)?null:String(K(c,d));e(c),!(u&&h===o.written.get(c))&&(l===void 0&&o.base.set(c,a.getAttribute(c)),h==null?a.removeAttribute(c):a.setAttribute(c,h),o.owners.set(c,s),o.written.set(c,h))}r.appliedAttrs=f}function hs(t,o,s){if(t.getAttribute(s)===o.written.get(s)){const n=o.base.get(s);n==null?t.removeAttribute(s):t.setAttribute(s,n)}o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function Gn(t,o,s,n){const r=n.appliedAttrs;if(n.appliedAttrs=null,!!r)for(const i of r)o.owners.get(i)===s&&hs(t.node,o,i)}function _o(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const n of o.owners.keys()){const r=o.written.get(n),i=s.getAttribute(n);i!==r&&(o.base.set(n,i),r==null?s.removeAttribute(n):s.setAttribute(n,r))}}function Kn(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const r of Object.keys(t)){const i=r.charAt(0);if(i!=="."&&i!=="!")continue;const a=r.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const g=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${i}\` is read as one prop name. Nest the selector inside instead: \`${i}${g}: { '${a.slice(g.length)}': {...} }\`.`)}continue}const f=t[r];if(!f||typeof f!="object")continue;const e=i==="!",c={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},l=Bn(t,r,f);l&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const g in f){if(!Object.prototype.hasOwnProperty.call(f,g))continue;const b=g.charAt(0),w=f[g];if(!((b===":"||b==="@"||b==="&"||b==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(g==="vars"&&m(w)){for(const p of Object.keys(w))p&&u.add(Bt(p));continue}u.add(g)}}const d=()=>{let g;const b=t[a];if(b===void 0){const _=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(_||x!==void 0)g=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{g=typeof S=="function"?S.call(t,t):S}catch(v){g=!1,o.__conditionalError=v,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,v?.message||v)}}}else if(typeof b=="function")try{g=b(t,t.state,t.context)}catch(_){g=!1,o.__conditionalError=_,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${r}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,_?.message||_)}else g=b;const w=e?!g:!!g;if(!t.node)return;const p=t.context?.designSystem;if(w===c.lastMatch){if(w&&l&&t.node.setAttribute){p&&L(p);try{ps(t,s,r,l,c,!1)}finally{p&&D()}}return}c.lastMatch=w,p&&L(p);try{if(w){const _={},x={};let S=!1;for(const C in f){if(!Object.prototype.hasOwnProperty.call(f,C))continue;const N=f[C],tt=C.charAt(0);if((tt===":"||tt==="@"||tt==="&"||tt==="[")&&N&&typeof N=="object"&&!Array.isArray(N)){if(po(C,t)){const P=_t(N,t,!1,u);Object.keys(P).length&&(x[`[data-theme="${C.slice(1)}"] &`]=P,S=!0)}else{const P=ho(C,t),F=_t(N,t,!1,u);Object.keys(F).length&&(x[P]=F,S=!0)}continue}const ot=typeof N=="function"?N(t,t.state,t.context):N;if(ot!=null){if(U[C]){const P=U[C](ot,t,t.state,t.context);if(P){const F=Array.isArray(P)?P:[P];for(const gt of F)gt&&Object.assign(_,gt)}}else if(V&&V.has(C))_[C]=ot;else if(et(C))_[C]=ot;else if(C==="vars"){const P=Gt(ot,t);P&&Object.assign(_,P)}}}const v=Object.keys(_);if(v.length){X(t.node,_);for(const C of v)n.set(C,r);c.appliedKeys=v}else c.appliedKeys=null;if(S){const C=wt(x,null,t.context?.cssPrefix,{state:!0}),N=C?C.split(" ").filter(Boolean):[];if(N.length&&t.node.classList){for(const tt of N)t.node.classList.add(tt);c.appliedClasses=N}else c.appliedClasses=null}else if(c.appliedClasses){for(const C of c.appliedClasses)t.node.classList.remove(C);c.appliedClasses=null}l&&t.node.setAttribute&&ps(t,s,r,l,c,!0)}else{if(c.appliedAttrs&&Gn(t,s,r,c),c.appliedKeys){for(const _ of c.appliedKeys)n.get(_)===r&&(et(_)?t.node.style.removeProperty(_):t.node.style[_]="",n.delete(_));c.appliedKeys=null}if(c.appliedClasses){for(const _ of c.appliedClasses)t.node.classList.remove(_);c.appliedClasses=null}}}finally{p&&D()}};o.__conditionalRunners.push(d);const h=T(t,t[a+"Deps"],d),y=j(h,{depth:o.path.length,label:k(o,"conditional("+r+")")}),A=o.__exec&&o.__exec[a]||t[a];y._sources.size===0&&typeof A=="function"&&ft()&&console.warn(`[smbls] conditional \`${r}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(y)}}const go=new WeakSet,ys=new WeakSet,_s=new WeakSet;function Wn(t){if(_s.has(t))return!1;if(!ys.has(t)){ys.add(t);const o=t.defaultView,s=()=>{_s.add(t)};o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(s):setTimeout(s,0)}return!0}function zn(t){const o=t.ownerDocument;!o||go.has(o)||Wn(o)||(go.add(o),queueMicrotask(()=>{go.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const bo=new WeakSet;let gs=!1;function bs(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function Ao(t,o){const s={...t};for(const n in o){const r=o[n],i=s[n];s[n]=r&&typeof r=="object"&&i&&typeof i=="object"?Ao(i,r):r}return s}function As(t,o){const s={};for(const n in t){const r=t[n];if(r&&typeof r=="object"){const i=As(r,o);Object.keys(i).length&&(s[n]=i)}else o.has(n)||(s[n]=r)}return s}function Yn(t,o,s){let n=null;for(const[r,i]of o){const a=Q(r),f=It[a];if(f)for(let e=0;e<f.length;e++){const c=f[e].replace(/-([a-z])/g,(y,A)=>A.toUpperCase()),l=t[c]!=null?o.get(c):void 0,u=s&&s.get(f[e]),d=l!==void 0&&l>i&&Mo(f[e],t[c],a),h=!d&&u!==void 0&&u>i&&Mo(f[e],void 0,a);if(d||h){d&&delete t[r],n||(n=new Set),n.add(r);break}}}return n}function xs(t){const{node:o}=t;if(!o)return;if(gs||(gs=!0,wt({display:"none"})),bo.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}bo.add(t);const s=t.context?.designSystem;s&&L(s),Lo();try{const n={};let r=!1,i=[],a=null,f=null,e=null;const c=t.__ref&&t.__ref.__mergeLayer;let l,u=null,d=null;const h=(p,_)=>{if(_&&typeof _=="object"&&bs(p)){f||(f={});const x=f[p];x&&(_=Ao(x,_)),f[p]=_}else(_===null||typeof _!="object")&&(e||(e=new Set),e.add(p),l!==void 0&&(u||(u=new Map),u.set(p,l)));n[p]=_};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&U.theme){const p=U.theme(t.theme,t,t.state,t.context);if(p){const _=x=>{for(const S in x){const v=x[S];v&&typeof v=="object"&&bs(S)&&(a||(a={}),a[S]=v),n[S]=v}};if(Array.isArray(p))for(const x of p)x&&_(x);else _(p);r=!0}}const y=(p,_)=>{if(p==="vars"){const x=Gt(_);if(x){for(const S in x)h(S,x[S]);r=!0}return}if(U[p]){const x=U[p](_,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const v in S)h(v,S[v])}else for(const S in x)h(S,x[S]);r=!0}}else if(V&&V.has(p))_!=null&&typeof _!="object"&&(h(p,_),r=!0);else if(p.charCodeAt(0)===45)_!=null&&typeof _!="object"&&(h(p,_),r=!0);else if((p.charAt(0)==="&"||p.charAt(0)==="@"||p.charAt(0)===":"||p.charAt(0)==="[")&&_&&typeof _=="object"&&!Array.isArray(_)){if(yo(_))return;const x=ls(p,_,t);x&&(h(x.cssProp,x.block),r=!0)}};if(typeof t.class=="string"){const p=$n(t.class,t.context?.designSystem?.class);if(p)for(const _ in p)y(_,p[_])}const A=e?new Set(e):null,g=t.tag||"div";for(const p of Object.keys(t)){if(typeof t[p]=="function"){const x=c&&c.get(p);x!==void 0&&st(g,p)&&(d||(d=new Map),d.set(Q(p),x));continue}if(l=c?c.get(p):void 0,p==="vars"){y(p,t[p]);continue}if(G.has(p)||p==="theme")continue;const _=p.charCodeAt(0);_>=65&&_<=90||Z(p)||No(g,p)||y(p,t[p])}l=void 0;const b=u?Yn(n,u,d):null;if(a)for(const p in a){let _=e?As(a[p],e):a[p];f&&f[p]&&(_=Ao(_,f[p])),Object.keys(_).length?n[p]=_:delete n[p]}if(Ln(t,n,e,b?new Set([...A||[],...b]):A),r){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const p=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof p=="string"&&p!==""&&n.display&&n.display!==p&&(n.display=p);const _=wt(n,null,t.context?.cssPrefix);if(i=_?_.split(" ").filter(Boolean):[],_&&o.classList){const x=i;let S=!1;for(const v of x)o.classList.add(v),S||(v.charCodeAt(0)===95&&v.charCodeAt(1)===99||v.charCodeAt(0)===95&&v.indexOf("_c",1)!==-1)&&(S=!0);S&&zn(o)}}const w=t.__ref;if(w){const p=w.__staticCssClasses;if(p&&o.classList){const _=new Set(i);for(const x of p)_.has(x)||o.classList.remove(x)}w.__staticCssClasses=i}Dn(t)}finally{Do(),s&&D(),bo.delete(t)}}const Re=t=>!!U[t]||!!(V&&V.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function Me(t){t&&t.node&&xs(t)}function ws(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const r in t.aria){const i=t.aria[r];if(typeof i=="function"||typeof i=="object"||i==null||typeof i=="string"&&i.includes("{{"))continue;const a="aria-"+r.replace(/[A-Z]/g,f=>"-"+f.toLowerCase());o.setAttribute(a,K(a,i))}const s=Xs(t);for(const r in s){const i=s[r];i!=null&&i!==!1&&typeof i!="function"&&typeof i!="object"&&o.setAttribute(r,i===!0?"":i)}const n=t.tag||"div";for(const r of Object.keys(t)){if(typeof t[r]=="function"||G.has(r)||r==="on"||s[r]!==void 0)continue;const i=r.charCodeAt(0);if(!(i>=65&&i<=90)&&!Z(r)&&!st(n,r)&&St(n,r)){let a=t[r];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!Jt[r])continue;a=$.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!at(Ct(r)||r))continue;const f=Ct(r)||r;o.setAttribute(f,K(f,a))}}}function Ne(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||Z(o))return;const r=t.tag||"div";if(st(r,o)||!St(r,o))return;const i=Ct(o)||o,a=i.toLowerCase(),f=t.__ref&&t.__ref.__effects;let e=!1;if(f)for(let u=0;u<f.length;u++){const d=f[u];d&&d._attrName===a&&!d._disposed&&typeof d._execute=="function"&&(e=!0,d._execute())}if(e)return;let c=t[o];const l=Jt[o];if(l&&c!=null){const u=l(t);u!==void 0&&(c=u)}typeof c=="string"&&c.includes("{{")&&(c=$.call(t,c,t.state)),c==null||c===!1&&!at(i)?s.removeAttribute(i):typeof c!="function"&&typeof c!="object"&&s.setAttribute(i,K(i,c))}function qn(t,o){const s=t.node,n=t.__ref;let r=n.__autoGrow;if(!o){if(r&&r.active){try{s.removeEventListener("input",r.resize)}catch{}Cs(r),nt.delete(t),s.style.height="",r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""),js(s,r,!1),r.active=!1,r.appliedMax=null,r.lastMeasure=0}return}r||(r=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Dt(t,!0);return}if(!(s.scrollHeight>0)){r.awaitingLayout=!0,Ss(t,r);return}r.awaitingLayout=!1;const a=Xn(s),f=Jn(a),e=s.style.height;s.style.height="0px",f&&wo(s);const c=s.scrollHeight;if(!(c>0)){s.style.height=e,f&&wo(s);return}const l=mn(s,a),u=l!=null&&c<l?l:c,d=se(a),h=d!=null&&u>d;s.style.height=oe(h?d:u,a)+"px",f&&wo(s),js(s,r,h),r.lastMeasure=c,r.lastWidth=s.clientWidth,Ss(t,r)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",r.resize)}catch{}Cs(r),nt.delete(t)})),r.active||(s.addEventListener("input",r.resize),r.active=!0,Qn(t,r));const i=typeof o=="object"&&o.max!=null?String(o.max):null;i!==r.appliedMax&&(i==null?r.appliedMax!=null&&s.style.maxHeight===r.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=i,r.appliedMax=i),r.resize()}function Dt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),nt.add(t),$t())}function Zn(){const t=Array.from(nt);nt.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,r=s.__ref?.__autoGrow;if(!(!n||!r||!r.active)){if(!n.isConnected){r.firstAttemptAt==null&&(r.firstAttemptAt=dt()),r.attachAttempts+=1,r.attachAttempts<=Uo&&dt()-r.firstAttemptAt<Ho&&(nt.add(s),$t());continue}r.attachAttempts=0,r.firstAttemptAt=null,r.resize()}}}function Ss(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,r=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof r!="function")return;const i=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Dt(t,!0);return}const f=s.clientWidth;o.lastWidth!=null&&Math.abs(f-o.lastWidth)<.5||(o.lastWidth=f,Dt(t,!0))};let a;try{a=new r(i),a.observe(s)}catch{return}o.watch=a}function Cs(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function Qn(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,n=s&&s.fonts&&s.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{o.active&&t.node&&Dt(t,!0)},()=>{})}function Xn(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const rt=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,xo=t=>(rt(t.paddingTop)||0)+(rt(t.paddingBottom)||0),vs=t=>(rt(t.borderTopWidth)||0)+(rt(t.borderBottomWidth)||0);function Jn(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let n=0;n<o.length;n++){const r=o[n].trim();if(!(r!=="all"&&r!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function wo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const n=o[s];if(n&&n.transitionProperty==="height")try{n.cancel()}catch{}}}function mn(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const n=rt(o.lineHeight)||te(t,o);return n>0?s*n+xo(o):null}const Rt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],ks=new WeakMap;function te(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let r=ks.get(s);r||(r=new Map,ks.set(s,r));const i=Rt.map(c=>o[c]||"").join("|");if(r.has(i))return r.get(i);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const f=a.style;f.position="absolute",f.visibility="hidden",f.top="0",f.left="-9999px",f.height="auto",f.minHeight="0",f.maxHeight="none",f.padding="0",f.border="0",f.boxSizing="content-box",f.overflow="hidden";for(let c=0;c<Rt.length;c++)o[Rt[c]]&&(f[Rt[c]]=o[Rt[c]]);let e=0;try{n.appendChild(a),e=a.clientHeight}catch{e=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return e>0?(r.set(i,e),e):null}function oe(t,o){return o?o.boxSizing==="border-box"?t+vs(o):o.boxSizing==="content-box"?Math.max(0,t-xo(o)):t:t}function se(t){if(!t)return null;const o=rt(t.maxHeight);if(o==null||!(o>0))return null;const s=xo(t),n=vs(t),r=t.boxSizing==="border-box"?o-n:o+s,i=rt(t.lineHeight);if(!(i>0))return r;const a=Math.floor((r-s)/i+1e-6);return a>=1?a*i+s:r}function js(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const Es=["srcObject","muted"],ne=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function ee(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Es.length;n++){const r=Es[n],i=t[r];if(i===void 0||!(r in o))continue;const a=f=>{const e=ne(r,f);if(o[r]!==e)try{o[r]=e}catch(c){R(s,r,c)}};if(typeof i=="function"){const f=T(t,t[r+"Deps"],i),e=j(()=>{try{a(f(t,t.state,t.context))}catch(c){R(s,r,c)}},{depth:s.path.length,label:k(s,r)});s.__effects.push(e),s.__exec[r]=i}else a(i);r==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Ps(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,r=typeof n=="function"?T(t,t.autoGrowDeps,n):null,i=j(()=>{const a=t.autoGrow;let f=a;if(typeof a=="function")try{f=(a===n&&r?r:a)(t,t.state,t.context)}catch{f=null}qn(t,f)},{depth:s.path.length,label:k(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(i),r&&(s.__exec.autoGrow=n)}const Os=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ts(t,o){for(const s of Object.keys(t)){if(!Z(s)||Os.has(s))continue;const n=Gs(s);if(n){Bs(n,t,t[s]);continue}let r=t[s],i=null;if(r&&typeof r=="object"&&!Array.isArray(r)&&(i=r,r=i.handler),typeof r=="string"&&/^[A-Za-z_$][\w$]*$/.test(r)){const f=r;r=function(c){return t.call(f,c)}}if(typeof r!="function")continue;const a=cn(s);Hs.has(a)||Vs(fn(a),t,r,i)}re(t)}function re(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const d of Os){const h=t[d];typeof h=="function"&&(s[d]=h,n=!0)}if(!n)return;const r=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,i=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,f=0,e=0,c=!1;const l=d=>{const h=d.touches&&d.touches[0]||d.changedTouches&&d.changedTouches[0];h&&(a=h.clientX,f=h.clientY,e=Date.now(),c=!0)},u=d=>{if(!c)return;c=!1;const h=d.changedTouches&&d.changedTouches[0]||d.touches&&d.touches[0];if(!h)return;const y=h.clientX-a,A=h.clientY-f,g=Date.now()-e;if(g>i)return;const b=Math.abs(y),w=Math.abs(A);if(Math.max(b,w)<r)return;let p;if(b>w*1.2)p=y<0?"left":"right";else if(w>b*1.2)p=A<0?"up":"down";else return;const _="onSwipe"+p.charAt(0).toUpperCase()+p.slice(1),x=s[_],S=s.onSwipe;x&&x.call(t,d,t,t.state,t.context),S&&S.call(t,{direction:p,dx:y,dy:A,dt:g,event:d},t,t.state,t.context)};o.addEventListener("touchstart",l,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",l)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function it(t,o){const s={...t};for(const n in o){const r=s[n],i=o[n];r&&i&&typeof r=="object"&&typeof i=="object"&&!Array.isArray(r)&&!Array.isArray(i)&&typeof r!="function"&&typeof i!="function"?s[n]=it(r,i):s[n]=i}return s}function So(t,o,s,n,r){if(!o||!t.node)return;const i=t.childExtends,a=pt(t,"childProps");if(Array.isArray(o)){const f=t.tag==="fragment",e=t.context?.document||globalThis.document,c=f?null:e?.createDocumentFragment();if(!f&&!c)return;const l=t.childProps,u=t.childrenAs,d=w=>{let p=o[w];const _=p;(typeof p=="string"||typeof p=="number")&&(p={text:p});let x=l;if(typeof l=="function")try{x=l(t,p)}catch{x=null}let S=typeof l=="function"?Pt(x):a;if(r&&u!=="state"&&(S=Ot(S,Pt(_))),u==="state"){let C=_;(typeof _=="string"||typeof _=="number")&&(C={value:_,text:_}),p=x?{...x,state:C}:{state:C}}else x&&(p=it(x,p));if(i&&!p.ignoreChildExtends)if(p.extends){const C=Array.isArray(p.extends)?p.extends:[p.extends],N=Array.isArray(i)?i:[i];p={...p,extends:[...N,...C]}}else p={...p,extends:i};const v=Bo(p?.key,_,w);try{return J(Tt(p,S),t,v,s)}catch(C){if(typeof console<"u"&&console.error){const N=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${v}" failed to construct at ${N} (initial render, skipping this row):`,C?.message||C)}return null}},h=t.__ref;if(!(n===!0&&!f&&!!h&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const p=d(w);!f&&p?.node&&c.appendChild(p.node)}return f||t.node.appendChild(c),!0}const A=h.__childrenChunkGen=(h.__childrenChunkGen||0)+1;Po();let g=null;const b=w=>{if(h.__disposed||h.__childrenChunkGen!==A){g&&g.parentNode&&g.remove();return}for(let p=w;p<o.length;p++){const _=d(p);if(_?.node&&(g?t.node.insertBefore(_.node,g):c.appendChild(_.node)),p+1<o.length&&Eo()){g||(g=e.createComment("smbls-mount"),c.appendChild(g),t.node.appendChild(c));const x=p+1;To(()=>b(x));return}}g?(g.remove(),t.node.tagName==="SELECT"&&Kt(t,!0)):t.node.appendChild(c)};return b(0),Oo(),!0}if(typeof o=="string"){const f=Ko(o,t);if(Array.isArray(f))return So(t,f,s,n,!0)}if(typeof o=="object")for(const f in o){if(G.has(f))continue;let e=o[f];if(e==null||e===!1)continue;const c=r?Ot(a,Pt(e)):a;if((typeof e=="string"||typeof e=="number")&&(e={text:e}),t.childProps&&(e=it(t.childProps,e)),i&&!e.ignoreChildExtends)if(e.extends){const l=Array.isArray(e.extends)?e.extends:[e.extends],u=Array.isArray(i)?i:[i];e={...e,extends:[...u,...l]}}else e={...e,extends:i};J(Tt(e,c),t,f,s)}}function Kt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const r=t.__ref,i=r&&r.__exec&&r.__exec.value,a=typeof i=="function",f=t.value!=null&&typeof t.value!="function";if(a||f){let l;if(a)try{l=i(t,t.state,t.context)}catch{return}else l=t.value,typeof l=="string"&&l.includes("{{")&&(l=$.call(t,l,t.state));const u=l==null?"":String(l);s.value!==u&&(s.value=u);return}const e=o||!(r&&r.__selectSynced);if(r&&(r.__selectSynced=!0),!e)return;let c=-1;for(let l=0;l<n.length;l++)n[l].defaultSelected&&(c=l);c>=0&&s.selectedIndex!==c&&(s.selectedIndex=c)}function Ls(t,o){let{children:s,content:n}=t;const r=t.childExtends,i=typeof s=="function"||qo(t,"children");if(typeof s=="function"){const y=s;try{s=y(t,t.state,t.context)}catch(p){if(s=void 0,typeof console<"u"&&console.error){const _=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${_} (initial run, treating as empty):`,p?.message||p)}}Zo(t,s),t.children=s;const A=t.__ref;let g=!1;const b=T(t,t.childrenDeps,y),w=j(()=>{const p=g;g=!0;let _;try{_=b(t,t.state,t.context)}catch(P){if(typeof console<"u"&&console.error){const F=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${F}${p?"":" (initial tracking run)"}:`,P?.message||P)}return}if(!p||_===t.children)return;Zo(t,_),t.children=_,A.__childrenChunkGen!=null&&A.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,v=x?[]:null,C=x?[]:null;if(Array.isArray(_)&&t.childrenAs==="state"){const P=t.childProps,F=[],gt=new Map;for(let E=0;E<_.length;E++){const B=_[E];let O=P;if(typeof P=="function")try{O=P(t,B)}catch{O=null}const z=Bo(O&&O.key,B,E);F.push(z),gt.set(z,{rawChild:B,childProps:O})}const Rs=new Set(F),Ms=A.__children.slice();for(const E of Ms)if(!Rs.has(E)){const B=t[E];B?.remove&&B.remove(),delete t[E],v&&v.push(E)}const bt=t.childExtends,Mt=t.tag==="fragment",Ns=t.context?.document||globalThis.document,At=Mt?null:Ns?.createDocumentFragment(),zt=new Set;for(const E of F){const B=gt.get(E),O=B.rawChild,z=t[E];if(z&&z.state){if(O&&typeof O=="object"){const I=z.state,ct=I.$replace||I.replace,vo=I.$update||I.update;try{if(typeof ct=="function")ct.call(I,O);else if(typeof vo=="function"){for(const H in I)if(!(H==="__element"||H==="root"||H==="parent"||H==="update")&&!Object.prototype.hasOwnProperty.call(O,H))try{I[H]=void 0}catch{}vo.call(I,O)}else for(const H in O)I[H]=O[H]}catch(H){if(typeof console<"u"&&console.error){const Is=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to patch at ${Is} (reconcile, keeping its previous data for this pass):`,H?.message||H)}}}C&&C.push(E);continue}let Yt=O;(typeof O=="string"||typeof O=="number")&&(Yt={value:O,text:O});const qt=B.childProps;let W=qt?{...qt,state:Yt}:{state:Yt};const Fs=typeof P=="function"?Pt(qt):pt(t,"childProps");if(bt&&!W.ignoreChildExtends)if(W.extends){const I=Array.isArray(W.extends)?W.extends:[W.extends],ct=Array.isArray(bt)?bt:[bt];W={...W,extends:[...ct,...I]}}else W={...W,extends:bt};let Zt;try{Zt=J(Tt(W,Fs),t,E,o)}catch(I){if(typeof console<"u"&&console.error){const ct=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to construct at ${ct} (reconcile, skipping this row):`,I?.message||I)}zt.add(E);continue}!Mt&&Zt?.node&&At&&At.appendChild(Zt.node),S&&S.push(E)}if(!Mt&&At&&At.childNodes.length&&t.node&&t.node.appendChild(At),!Mt&&t.node){let E=null;for(const B of F){const O=t[B]?.node;if(!O)continue;const z=E?E.nextSibling:t.node.firstChild;O!==z&&t.node.insertBefore(O,z),E=O}}A.__children=zt.size?F.filter(E=>!zt.has(E)):F,x&&(S.length||v.length)&&Vo(t,{added:S,removed:v,kept:C}),Kt(t,!1);return}const ot=x?[...A.__children]:null;for(const P of[...A.__children]){const F=t[P];F?.remove&&F.remove(),delete t[P]}A.__children=[],So(t,_,o,!1,!0),Kt(t,!1),x&&Vo(t,{added:[...A.__children],removed:ot,kept:[]})},{depth:A.path.length,label:k(A,"children")});A.__effects.push(w)}const a=So(t,s,o,!0,i);if(n!=null&&!(n&&n.__ref)){let y=n;if(typeof y=="string"||typeof y=="number"?y={text:y}:typeof y!="object"&&(y={}),t.childProps&&(y=it(t.childProps,y)),r&&!y.ignoreChildExtends)if(y.extends){const g=Array.isArray(y.extends)?y.extends:[y.extends],b=Array.isArray(r)?r:[r];y={...y,extends:[...b,...g]}}else y={...y,extends:r};const A=Ot(pt(t,"childProps"),pt(t,"content"));J(Tt(y,A),t,"content",o)}if(s&&!a)return;const f=t.context?.components||{},e=t.__ref&&t.__ref.__runtimeSource,c=e?{}:null;{const y=Object.keys(t);for(let A=0;A<y.length;A++){const g=y[A];if(!g.endsWith("Extends")||typeof t[g]!="string")continue;const b=g.slice(0,-7);if(!b||b.charCodeAt(0)<65||b.charCodeAt(0)>90)continue;const w={extends:t[g]};delete t[g];for(let p=A+1;p<y.length;p++){const _=y[p],x=_.charCodeAt(0);if(x>=65&&x<=90||G.has(_)||typeof t[_]=="function"&&(_.startsWith("on")||_.startsWith(".")))break;const S=t[_];S!==void 0&&(w[_]=S,delete t[_],c&&Et(e,_)&&(c[b]||(c[b]={}),c[b][_]=e[_]))}t[b]&&typeof t[b]=="object"?t[b]={...w,...t[b]}:t[b]=w}}const l=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),d=y=>{if(G.has(y)||typeof t[y]!="object"||t[y]===null)return;const A=y.charCodeAt(0);if(A<65||A>90)return;let g=t[y];if(g.__ref)return;if(!g.extends&&!g.extend){const w=f[y]||f[`smbls.${y}`];w&&(g={...g,extends:w})}if(t.childProps&&(g=it(t.childProps,g)),r&&!g.ignoreChildExtends)if(g.extends){const w=Array.isArray(g.extends)?g.extends:[g.extends],p=Array.isArray(r)?r:[r];g={...g,extends:[...p,...w]}}else g={...g,extends:r};const b=e?Ot(pt(t,"childProps"),Ot(c[y]||null,pt(t,y))):null;J(Tt(g,b),t,y,o)};if(!l){for(const y of u)d(y);return}Po();const h=y=>{for(let A=y;A<u.length;A++)if(d(u[A]),A+1<u.length&&Eo()){const g=A+1;To(()=>h(g));return}};h(0),Oo()}function Ds(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const r=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(r){const a=r.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const f=s.node.nextSibling;a.insertBefore(n,f||r)}else a.insertBefore(n,r);return}}const i=o?.node||(o?.nodeType?o:null);if(i)if(s?.position==="before"&&s.node)i.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?i.insertBefore(n,a):i.appendChild(n)}else i.appendChild(n)}const Co=3;function ie(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Co?!1:(t.__inBeforeUpdate=!0,!0)}function Wt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Co&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Co}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function M(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);o.context?.plugins?.length&&q(n,o,s);const r="on"+t,i=o[r];if(typeof i=="function"){const e=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(e){if(o.__ref[e])return!0;o.__ref[e]=!0}const c=o.context?.designSystem;c&&L(c);let l=!!e;try{const u=i(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const d=o.__ref;return u.catch(h=>{o.context?.plugins?.length&&q("error",o,{hook:r,error:h})||console.error(`[DOMQL] Lifecycle "${r}" error:`,h)}).finally(()=>{e&&d&&(d[e]=!1)}),l=!1,!0}if(u===!1)return!1}catch(u){if(o.context?.plugins?.length&&q("error",o,{hook:r,error:u})||console.error(`[DOMQL] Lifecycle "${r}" error:`,u),o.context?.strictMode)throw u}finally{c&&D(),l&&o.__ref&&(o.__ref[e]=!1)}}return!0}var Fe=J;export{Co as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,ie as acquireBeforeUpdateGuard,J as create,Fe as default,to as flushMounts,Re as isStaticCssProp,Me as recompileStaticCss,Ne as reconcileAttrProp,Wt as releaseBeforeUpdateGuard,lo as resolveStyleBlock,Ht as writeElementText};
4
+ `):"")}}if(Zt(r,!0),Ys(r,o,e),typeof r.html=="function"&&r.node&&!r.node.innerHTML&&Z(r,()=>{try{const u=r.html(r,r.state,r.context);u!=null&&typeof u!="function"&&(r.node.innerHTML=u)}catch{}}),D("Create",r,n),D("Complete",r,n),D("Render",r,n),D("RenderRouter",r,n),io(r,n),typeof r.onFrame=="function"){const u=r.onFrame,l=r.context?.designSystem,_=()=>{if(r.node){if(r.node.isConnected){l&&W(l);try{u(r,r.state,r.context)}catch(g){console.error("[DOMQL] onFrame error:",g)}finally{l&&z()}}requestAnimationFrame(_)}};requestAnimationFrame(_)}return r}const Qo=new Set(["childProps","attr","style","scope","data","vars"]);function Xo(t,o,s,n,e,c){if(s&&!o.extends&&!o.extend){const y=s.indexOf("_"),p=s.indexOf(".");let A=y>0?y:-1;if(p>0&&(A<0||p<A)&&(A=p),A>0){const w=s.substring(0,A),h=t.context?.components;h&&(h[w]||h["smbls."+w])?o={...o,extends:w}:h&&st()&&(/^[A-Z]\w*_\d+$/.test(s)||/^[A-Z]\w*\.\w+$/.test(s))&&console.warn(`[smbls] auto-extend: key "${s}" looks like an instance of "${w}" but neither "${w}" nor "smbls.${w}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}t.__ref&&(t.__ref.__mergeLayer=null),fn(t,o,c);const a=an(t),r=t.props&&typeof t.props=="object"?t.props:null;for(const y in o){if(y==="parent"||y==="node"||y==="__ref"||y==="extends"||y==="context"||y==="props")continue;if(y==="key"){n&&(t.key=e?Vt(e,n):n);continue}const p=o[y];a&&a.mark(y);const A=t[y],w=A&&p&&typeof A=="object"&&typeof p=="object"&&!Array.isArray(A)&&!Array.isArray(p)&&typeof A!="function"&&typeof p!="function";w&&y.charCodeAt(0)>=65&&y.charCodeAt(0)<=90?t[y]=kt(A,p):w&&Qo.has(y)?t[y]={...A,...p}:w&&co(y)?t[y]=kt(A,p):t[y]=p}function i(y){for(const p in y){const A=y[p],w=t[p],h=w&&A&&typeof w=="object"&&typeof A=="object"&&!Array.isArray(w)&&!Array.isArray(A)&&typeof w!="function"&&typeof A!="function";h&&p.charCodeAt(0)>=65&&p.charCodeAt(0)<=90?t[p]=kt(w,A):h&&Qo.has(p)?t[p]={...w,...A}:h&&co(p)?t[p]=kt(w,A):t[p]=A}}if(r&&i(r),o.props&&typeof o.props=="object"&&(i(o.props),a))for(const y in o.props)a.mark(y);un(t),o.classlist!==void 0&&(t.classlist=o.classlist),o.text!==void 0&&(t.text=o.text),o.html!==void 0&&(t.html=o.html);const f=t.scope&&typeof t.scope=="object"?t.scope:null,d=e?.scope,u=t.context&&typeof t.context.globalScope=="object"&&t.context.globalScope||null,l=d||u||null;if(o.scope!==void 0||f){const y={};f&&Object.assign(y,f),o.scope!==void 0&&Object.assign(y,o.scope),t.scope=ms(y,l)}else l&&(t.scope=l);o.if!==void 0&&(t.if=o.if);const _=t.__ref,g=Zn(t,_&&_.__runtimeSource);return _&&(_.__declaredArrays=g||void 0),dn(t),Rn(t,e,o,c),o}const Tn=new Set(["key","parent","context","__ref"]);function Dn(t,o){for(const n of Object.keys(t))Tn.has(n)||delete t[n];let s=o.definition;if(!s.extends&&!s.extend&&typeof o.key=="string"){const n=t.context?.components||{},e=n[o.key]||n["smbls."+o.key];e&&(s={...s,extends:e})}Nt(()=>Xo(t,s,o.key,o.ownKey,t.parent,o.options))}function Ln(t,o,s){const n=s||{},e=r=>!!(n[r]||n["smbls."+r]),c=[],a=[];if(t.extends&&a.push(...Array.isArray(t.extends)?t.extends:[t.extends]),t.extend&&a.push(...Array.isArray(t.extend)?t.extend:[t.extend]),a.length){for(const r of a){if(typeof r!="string")continue;const i=r.includes(">")?r.split(">")[0].trim():r;e(i)||c.push(i)}return c}if(typeof o=="string"&&/^[A-Z]/.test(o)){let r=-1;const i=o.indexOf("_"),f=o.indexOf(".");i>0&&(r=i),f>0&&(r<0||f<r)&&(r=f);const d=r>0?o.substring(0,r):o;e(d)||c.push(d)}return c}function fo(t,o,s){if(typeof t.onStateInit!="function"&&!yn(t,"stateInit"))return;const n=t.state;t.state=o;try{D("StateInit",t,s)}finally{t.state=n}}const ao=t=>({isDataOnlyKey:o=>hn(t).has(o)});function Rn(t,o,s,n){const e=!o,c=s.state&&typeof s.state=="object"&&!Array.isArray(s.state)&&Object.keys(s.state).length===0,a=e&&c&&t.context?.state,r=s.state!==void 0&&!a?s.state:t.state&&!G(t.state)?t.state:void 0;if(r==null){if(o?.state)t.state=o.state,ft(t,t.state);else if(t.context?.state){const i=t.context.state,f={...i},d=t.context?.polyglot;if(d?.translations){const u=t.context,l=i.lang||d.defaultLang||"en",_=new Set,g=(A,w)=>{_.has(A)||ln(u,A,f)&&(f[A]=w,_.add(A),pn(u,A,w))},y=d.translations[l];if(y&&typeof y=="object")for(const A in y)g(A,y[A]);const p=new Set(d.languages||[]);for(const A in d.translations)p.has(A)||g(A,d.translations[A])}G(f)||fo(t,f,n),t.state=G(f)?f:oo(f,ao(t.context)),t.state.__element=t,t.state.root=t.state,ft(t,t.state),Ft.promoteActiveRootState?.(i,t.state),D("StateCreated",t,n)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),ft(t,t.state);return}if(typeof r=="string"){if(t.state=ts(r,o),t.state&&typeof t.state=="object"&&!G(t.state)){const i=o?.state?.root||o?.state||t.state;Object.defineProperty(t.state,"root",{value:i,enumerable:!1,configurable:!0,writable:!0})}ft(t,t.state),Nn(t,r,o),D("StateCreated",t,n);return}if(typeof r=="function"){const i=r(t,o?.state);if(G(i))t.state=i;else{const f=i||{};fo(t,f,n),t.state=oo(f,o?.state?void 0:ao(t.context))}}else if(G(r))t.state=r;else{const i={...r};fo(t,i,n),t.state=oo(i,o?.state?void 0:ao(t.context))}t.state.__element=t,o?.state?(t.state.parent=o.state,t.state.root=o.state.root||o.state):t.state.root=t.state,ft(t,t.state),Ft.promoteActiveRootState?.(r,t.state),D("StateCreated",t,n)}function Jo(t,o){if(!o)return t;const s=o.split("/");let n=t;for(const e of s){if(n==null)return{};n=n[e]}return n??{}}function mo(t,o){const s=o.state;return t.startsWith("~/")?[s&&(s.root||s),t.slice(2)]:t.startsWith("../")?[s,t.slice(3)]:[s,t]}function ts(t,o){if(!o)return{};if(t===".")return o.state||{};if(t.startsWith("../")||t.startsWith("~/")){const[e,c]=mo(t,o);return c?Jo(e,c):e??{}}if(o.state?.[t]!==void 0)return o.state[t];const s=Jo(o.state,t);if(s!=null&&Object.keys(s).length>0)return s;const n=o.context?.polyglot;if(n?.translations){const e=o.state?.root?.lang||n.defaultLang||"en",c=n.translations[e];if(c?.[t]!==void 0)return c[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}function Mn(t,o){const[s,n]=mo(t,o);if(!n||!s||typeof s!="object")return;const e=s[n];if(e!==void 0||n.indexOf("/")===-1)return e;let c=s;for(const a of n.split("/")){if(c==null||typeof c!="object")return;c=c[a]}return c}function Nn(t,o,s){const n=t.__ref;if(!n||!s||o==="."||!G(s.state))return;n.__stateBinding&&n.__stateBinding.dispose();const e=Nt(()=>j(()=>{const c=Mn(o,s);!c||typeof c!="object"||c===t.state||Nt(()=>os(t,t.state,c,!0))},{depth:n.path?n.path.length:0,label:v(n,"state")}));e._isStateBinding=!0,n.__stateBinding=e,n.__effects&&n.__effects.push(e)}function os(t,o,s,n){const e=t.__ref;if(!e)return;if(n||t.state===o){t.state=s,n&&ft(t,s),ss(e);const a=e.__children;if(a)for(let r=0;r<a.length;r++){const i=t[a[r]];i&&i.__ref&&i.parent===t&&os(i,o,s,!1)}return}if(e.__stateBinding){e.__stateBinding._notify();return}const c=t.state;c&&typeof c=="object"&&c.parent===o&&(c.parent=s,ss(e))}function ss(t){const o=t.__effects;if(o)for(let s=0;s<o.length;s++){const n=o[s];n&&!n._disposed&&!n._isStateBinding&&!n._isSubscribeToEffect&&typeof n._notify=="function"&&n._notify()}}const Fn=new Set(["s","state","ctx","context"]),uo=new WeakMap;function ns(t){if(uo.has(t))return uo.get(t);let o=null;try{const s=typeof Ft.getFunctionSource=="function"?Ft.getFunctionSource(t):Function.prototype.toString.call(t);if(typeof s=="string"){const n=s.match(/^\s*(?:async\s+)?([A-Za-z_$][\w$]*)\s*=>/)||s.match(/^[^(]*\(([^)]*)\)/);n&&(o={params:n[1].split(",").map(e=>e.trim()),body:s.slice(n.index+n[0].length)})}}catch{}return uo.set(t,o),o}function $n(t){const o=ns(t);return o?o.params.map(s=>s.split("=")[0].trim()).filter(Boolean):[]}const es=new WeakMap;function In(t){let o=es.get(t);return o===void 0&&(o=Bn(ns(t)),es.set(t,o)),o}function Bn(t){if(!t)return!0;const o=t.body;if(/\bstate\b|\barguments\b|\bcall\s*\(/.test(o))return!0;const s=t.params[1];if(!s)return!1;if(!/^[A-Za-z_$][\w$]*$/.test(s.split("=")[0].trim()))return!0;const n=s.split("=")[0].trim();return new RegExp("(^|[^\\w$.])"+n.replace(/\$/g,"\\$")+"(?![\\w$])").test(o)}const Hn=3,Un=/^(is|has)[A-Z0-9_$]/,Vn=new Set(["routerOptions"]),rs=new WeakSet;function Gn(t,o){if(typeof t!="function"||t.length!==2||o&&(Un.test(o)||Vn.has(o))||rs.has(t))return!1;const s=$n(t);if(s.length<2)return!1;const n=s[1].replace(/[{}[\]]/g,"").trim();return n.length<Hn||Fn.has(n)?!1:(rs.add(t),!0)}function Kn(t){const o=t.__ref,s=t.tag||"div",n=t.context?.designSystem,e=[],c=Object.keys(t);for(let a=0;a<c.length;a++){const r=c[a];if(typeof t[r]!="function"||B.has(r))continue;const i=r.charCodeAt(0);i>=65&&i<=90||Y(r)||$[r]||H&&H.has(r)||i!==45&&(xt(s,r)||(st()&&Gn(t[r],r)&&console.warn(`[smbls] custom prop "${r}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${r}', \u2026) instead of reading el.${r}(\u2026) directly (see RULES.md Rule 8).`),e.push({prop:r,fn:t[r]})))}for(let a=0;a<e.length;a++){const{prop:r,fn:i}=e[a];o.__exec[r]=i,Object.defineProperty(t,r,{get(){n&&W(n);try{return i(t,t.state,t.context)}catch{return}finally{n&&z()}},set(f){delete o.__exec[r],Object.defineProperty(t,r,{value:f,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Wn(t,o){if(!(!Array.isArray(o)||o.length===0))for(let s=0;s<o.length;s++){const n=o[s];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function T(t,o,s){return!Array.isArray(o)||o.length===0?s:function(...n){return Wn(t,o),s.apply(this,n)}}function dt(t,o){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[o]}function v(t,o){return()=>t.path.join(".")+"::"+o}const is=new Set;function R(t,o,s){if(!st())return;const n=v(t,o)();is.has(n)||(is.add(n),console.warn(`[smbls] "${o}" effect threw on ${t.path.join(".")} \u2014 keeping previous value:`,s?.message||s))}const cs=/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,zn=(t,o)=>{let s;try{s=String(t)}catch{return}if(!s.includes("{{"))return;cs.lastIndex=0;let n;for(;(n=cs.exec(s))!==null;)n[2].includes("{{")&&o.add(n[2])},Yn=(t,o)=>!Y(t)&&!nt(o,t),lo=(t,o,s,n,e)=>{if(typeof o=="string"){!e&&o.includes("{{")&&s.add(o);return}typeof o=="function"&&Yn(t,n)&&zn(o,s)},po=new WeakMap,vt=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),jt=t=>{if(typeof t=="string"||typeof t=="number")return{text:t};if(!t||typeof t!="object"||Array.isArray(t))return null;const o=t.props;return o&&typeof o=="object"&&!Array.isArray(o)?it(t,o):t},Et=(t,o)=>t&&o?it(t,o):t||o||null,fs=(t,o)=>{const s=t.__ref&&t.__ref.__runtimeSource;return!!s&&vt(s,o)},lt=(t,o)=>fs(t,o)?jt(t.__ref.__runtimeSource[o]):null,Pt=(t,o)=>(o&&t&&typeof t=="object"&&po.set(t,o),t),qn=t=>{if(!t||typeof t!="object")return;const o=po.get(t);return o&&po.delete(t),o},ho=(t,o,s)=>{if(typeof t=="string"){t.includes("{{")&&o.add(t);return}if(!(!t||typeof t!="object"||s.has(t))){if(s.add(t),Array.isArray(t)){for(let n=0;n<t.length;n++)ho(t[n],o,s);return}if(!t.__ref)for(const n of Object.keys(t)){if(n==="state")continue;const e=Object.getOwnPropertyDescriptor(t,n);e&&"value"in e&&ho(e.value,o,s)}}},Zn=(t,o)=>{let s=null;for(const n of Object.keys(t)){if(B.has(n)||o&&vt(o,n))continue;const e=Object.getOwnPropertyDescriptor(t,n),c=e&&e.value;if(!Array.isArray(c))continue;const a=new Set;ho(c,a,new Set),a.size&&(s||(s=new Map),s.set(c,a))}return s},as=(t,o)=>{if(Array.isArray(o))for(let s=t;s;s=s.parent){const n=s.__ref&&s.__ref.__declaredArrays,e=n&&n.get(o);if(!e)continue;const c=t.__ref;c.__authoredTemplates||(c.__authoredTemplates=new Set);for(const a of e)c.__authoredTemplates.add(a);return}},us=["attr","aria","data","metadata"],Qn=t=>{if(us.includes(t))return!0;const o=t.charCodeAt(0);return o===46||o===33||o===64},Xn=(t,o)=>{const s=new Set,n=t.tag||"div";for(const e of Object.keys(t)){const c=Object.getOwnPropertyDescriptor(t,e),a=c&&c.value,r=!!o&&vt(o,e);if(a&&typeof a=="object"&&!Array.isArray(a)){if(!Qn(e))continue;const i=r?o[e]:null,f=i&&typeof i=="object"?i:null,d=e.charCodeAt(0)===46||e.charCodeAt(0)===33;for(const u in a){const l=r&&(!f||vt(f,u)),_=a[u];if(d&&_&&typeof _=="object"&&!Array.isArray(_)&&us.includes(u)){for(const g in _)lo(g,_[g],s,n,l);continue}lo(u,_,s,n,l)}continue}lo(e,a,s,n,r)}return s};function ds(t,o){const s=t.__ref,n=!!(o&&o.skipIfEffect),e=Xn(t,s.__runtimeSource);if(s.__authoredTemplates)for(const i of e)s.__authoredTemplates.add(i);else s.__authoredTemplates=e;if(Kn(t),typeof t.text=="function"){const i=t.text,f=T(t,t.textDeps,i),d=j(()=>{if(!s.contentManaged)try{let u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&typeof u!="object"&&(typeof u=="string"&&u.includes("{{")&&(u=F.call(t,u,t.state)),Gt(t,u))}catch(u){R(s,"text",u)}},{depth:s.path.length,label:v(s,"text")});s.__effects.push(d),s.__exec.text=i}else if(typeof t.text=="string"&&t.text.includes("{{")){const i=t.text,f=j(()=>{if(s.contentManaged)return;const d=F.call(t,i,t.state);d!=null&&(t.text=d),t.node&&Gt(t,d??"")},{depth:s.path.length,label:v(s,"text")});s.__effects.push(f),s.__exec.text=i}const c=t.tag||"div";for(const i of Object.keys(t))if(typeof t[i]=="function"&&!B.has(i)&&!Y(i)&&!s.__exec[i]&&!Uo(c,i)){if($[i]){const f=t[i],d=T(t,t[i+"Deps"],f),u=i;let l,_=null,g=null,y;const p=j(()=>{const A=t.context?.designSystem;A&&W(A);try{const w=d(t,t.state,t.context);No();let h;try{h=$[u](w,t,t.state,t.context)}finally{Fo()}if(Array.isArray(h)){const x={};for(const S of h)if(S)for(const k in S)x[k]=S[k];h=x}const b=u==="show"||u==="hide";if(h&&t.node&&te(h)){const x=pt(h);if(x===null||x!==y){y=x;const S=At(h,null,t.context?.cssPrefix),k=S?S.split(" ").filter(Boolean):null;if(t.node.classList){if(g)for(const C of g)t.node.classList.remove(C);if(k&&k.length)for(const C of k)t.node.classList.add(C);g=k}}l=void 0,_=null}else if(h&&t.node){if(g){for(const S of g)t.node.classList.remove(S);g=null,y=void 0}const x=pt(h);if(x===null||x!==l||!Tt(t.node,_)){l=x;const S=Ss(t,h);_=Ot(t.node,S)}}else t.node&&b&&(l=void 0,_=null,t.node.style.display="")}finally{A&&z()}},{depth:s.path.length,label:v(s,u)});s.__effects.push(p),s.__exec[i]=f}else if(H&&H.has(i)){const f=t[i],d=T(t,t[i+"Deps"],f),u=i;let l,_=null;const g=j(()=>{const y=t.context?.designSystem;y&&W(y);try{const p=d(t,t.state,t.context);if(t.node)if(p!=null){const A=u+":"+String(p);if(A!==l||!Tt(t.node,_)){l=A;const w={[u]:p},h=Ss(t,w);_=Ot(t.node,h)}}else l=void 0,_=null,t.node.style[u]=""}finally{y&&z()}},{depth:s.path.length,label:v(s,u)});s.__effects.push(g),s.__exec[i]=f}else if(i.charCodeAt(0)===45){const f=t[i];As(t,i,f,t[i+"Deps"],i),s.__exec[i]=f}}if(oe(t),typeof t.html=="function"){const i=t.html,f=T(t,t.htmlDeps,i),d=j(()=>{Z(t,()=>{const u=f(t,t.state,t.context);t.node&&u!=null&&typeof u!="function"&&(t.node.innerHTML=u)})},{depth:s.path.length,label:v(s,"html")});s.__effects.push(d),s.__exec.html=i}if(typeof t.value=="function"){const i=t.value,f=T(t,t.valueDeps,i),d=j(()=>{try{let u=f(t,t.state,t.context);typeof u=="string"&&u.includes("{{")&&(u=F.call(t,u,t.state)),ys(t,u)}catch(u){R(s,"value",u)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(d),s.__exec.value=i}else if(typeof t.value=="string"&&t.value.includes("{{")){const i=t.value,f=j(()=>{try{ys(t,F.call(t,i,t.state))}catch(d){R(s,"value",d)}},{depth:s.path.length,label:v(s,"value")});s.__effects.push(f),s.__exec.value=i}if(typeof t.style=="function"){const i=t.style,f=T(t,t.styleDeps,i);let d,u=null,l,_,g,y;const p=j(()=>{const A=f(t,t.state,t.context),w=t.context&&t.context.designSystem;let h;if(A&&typeof A=="object"&&A===l&&w===g){const x=pt(A);h=x!==null&&x===_?y:qt(t,A),_=x}else h=qt(t,A),_=void 0;l=A,g=w,y=h;const b=pt(h);(b===null||b!==d||!Tt(t.node,u))&&(d=b,_o(t.node,u,h),J(t.node,h),u=Ot(t.node,h))},{depth:s.path.length,label:v(s,"style")});s.__effects.push(p),s.__exec.style=i}else if(t.style&&typeof t.style=="object")for(const i in t.style){const f=t.style[i];if(typeof f!="function")continue;const d=T(t,dt(t.styleDeps,i),f);let u,l=null;const _=j(()=>{try{const g=d(t,t.state,t.context);if(t.node){const y=i+":"+String(g);if(y!==u||!Tt(t.node,l)){u=y;const p=qt(t,{[i]:g});_o(t.node,l,Object.assign({},p,{[i]:""})),J(t.node,p),l=Ot(t.node,p)}}}catch(g){R(s,"style."+i,g)}},{depth:s.path.length,label:v(s,"style."+i)});s.__effects.push(_)}if(t.attr&&typeof t.attr=="object"){for(const i in t.attr)if(typeof t.attr[i]=="function"){const f=T(t,dt(t.attrDeps,i),t.attr[i]),d=i,u=j(()=>{try{let l=f(t,t.state,t.context);typeof l=="string"&&l.includes("{{")&&(l=F.call(t,l,t.state)),t.node?.setAttribute&&Kt(t.node,d,l)}catch(l){R(s,"attr."+d,l)}},{depth:s.path.length,label:v(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}else if(typeof t.attr[i]=="string"&&t.attr[i].includes("{{")){const f=t.attr[i],d=i,u=j(()=>{try{const l=F.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(d,Q(d,l??""))}catch(l){R(s,"attr."+d,l)}},{depth:s.path.length,label:v(s,"attr."+d)});u._attrName=d.toLowerCase(),s.__effects.push(u)}}if(t.aria&&typeof t.aria=="object")for(const i in t.aria){const f=t.aria[i];if(typeof f=="string"&&f.includes("{{")){const _=f,g="aria-"+i.replace(/[A-Z]/g,p=>"-"+p.toLowerCase()),y=j(()=>{try{const p=F.call(t,_,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(g,Q(g,p??""))}catch(p){R(s,"aria."+i,p)}},{depth:s.path.length,label:v(s,"aria."+i)});y._attrName=g,s.__effects.push(y);continue}if(typeof f!="function")continue;const d=T(t,dt(t.ariaDeps,i),t.aria[i]),u="aria-"+i.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),l=j(()=>{try{const _=d(t,t.state,t.context);if(!t.node?.setAttribute)return;Kt(t.node,u,_)}catch(_){R(s,"aria."+i,_)}},{depth:s.path.length,label:v(s,"aria."+i)});l._attrName=u,s.__effects.push(l)}if(t.data&&typeof t.data=="object")for(const i in t.data){const f=t.data[i];if(typeof f=="string"&&f.includes("{{")){const g=f,y="data-"+i.replace(/[A-Z]/g,A=>"-"+A.toLowerCase()),p=j(()=>{try{const A=F.call(t,g,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(y,A??"")}catch(A){R(s,"data."+i,A)}},{depth:s.path.length,label:v(s,"data."+i)});p._attrName=y,s.__effects.push(p);continue}if(typeof f!="function")continue;const d=T(t,dt(t.dataDeps,i),t.data[i]),l="data-"+i.replace(/[A-Z]/g,g=>"-"+g.toLowerCase()),_=j(()=>{try{const g=d(t,t.state,t.context);if(!t.node?.setAttribute)return;g==null||g===!1?t.node.removeAttribute(l):typeof g!="function"&&typeof g!="object"&&t.node.setAttribute(l,g===!0?"":g)}catch(g){R(s,"data."+i,g)}},{depth:s.path.length,label:v(s,"data."+i)});_._attrName=l,s.__effects.push(_)}const a=t.classlist&&typeof t.classlist=="object"&&!Array.isArray(t.classlist)?t.classlist:t.class&&typeof t.class=="object"&&!Array.isArray(t.class)?t.class:null;if(a)for(const i in a){if(typeof a[i]!="function")continue;const f=T(t,dt(t.classDeps,i),a[i]),d=j(()=>{try{const u=f(t,t.state,t.context);if(!t.node?.classList)return;typeof u=="string"?t.node.classList.add(u):u?t.node.classList.add(i):t.node.classList.remove(i)}catch(u){R(s,"class."+i,u)}},{depth:s.path.length,label:v(s,"class."+i)});s.__effects.push(d)}!n&&typeof t.if=="function"&&hs(t,s,t.if);for(const i of Object.keys(t)){if(B.has(i)||typeof t[i]!="function")continue;const f=i.charCodeAt(0);if(f>=65&&f<=90||Y(i))continue;const d=t[i];s.__exec[i]=d;const u=t.tag||"div";if(xt(u,i)&&!nt(u,i)){const l=wt(i)||i,_=T(t,t[i+"Deps"],d),g=j(()=>{try{let y=_(t,t.state,t.context);typeof y=="string"&&y.includes("{{")&&(y=F.call(t,y,t.state)),t.node?.setAttribute&&Kt(t.node,l,y,!0)}catch(y){R(s,i,y)}},{depth:s.path.length,label:v(s,i)});g._attrName=l.toLowerCase(),s.__effects.push(g)}}const r=t.tag||"div";for(const i of Object.keys(t)){if(B.has(i))continue;const f=t[i];if(typeof f!="string"||!f.includes("{{"))continue;const d=i.charCodeAt(0);if(d>=65&&d<=90||Y(i)||nt(r,i)||no[i]||!xt(r,i))continue;const u=wt(i)||i,l=j(()=>{try{const _=F.call(t,f,t.state);if(!t.node||!t.node.setAttribute)return;t.node.setAttribute(u,Q(u,_??""))}catch(_){R(s,i,_)}},{depth:s.path.length,label:v(s,i)});l._attrName=u.toLowerCase(),s.__effects.push(l)}if(fe(t),ge(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){const i=t.onStateUpdate,f=t.stateDeps;let d=!1,u=[];const l=j(()=>{const _=[];for(let p=0;p<f.length;p++){const A=f[p];try{_[p]=typeof A=="function"?A(t,t.state,t.context):t.state?.[A]}catch{_[p]=void 0}}if(!d){d=!0,u=_;return}let g=_.length!==u.length;for(let p=0;!g&&p<_.length;p++)_[p]!==u[p]&&(g=!0);const y=u;u=_,g&&Z(t,()=>{try{i(t,t.state,t.context,{prev:y,next:_})}catch(p){if($t(t,"onStateUpdate",p),t.context?.strictMode)throw p}})},{depth:s.path.length,label:v(s,"onStateUpdate")});s.__effects.push(l)}le(t)}function ls(t){const o=t.parent,s=o?.node;if(!s||!t.node){Ys(t,t.parent);return}let n=null;const e=Object.keys(o),c=e.indexOf(t.key);for(let a=c+1;a<e.length;a++){const r=o[e[a]];if(r?.node?.parentNode===s){n=r.node;break}}n?s.insertBefore(t.node,n):s.appendChild(t.node)}function ps(t){_s(t),Se(t),Ls(t),Me(t),Re(t)}function hs(t,o,s){let n=T(t,t.ifDeps,s);const e=j(()=>{const c=!o.__ifInitialized&&o.__ifLateMerge;if(c){const i=t.context?.components||{};c.names.some(f=>i[f]||i["smbls."+f])&&(o.__ifLateMerge=null,Dn(t,c),n=T(t,t.ifDeps,typeof t.if=="function"?t.if:s))}let a;try{a=n(t,t.state,t.context)}catch(i){if(a=!1,o.__ifError=i,typeof console<"u"&&console.warn){const f=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${f} \u2014 treating as false:`,i?.message||i)}return}const r=o.__if;if(o.__if=!!a,r&&!o.__if&&t.node){t.node.remove();try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(i){console.error("[smbls] onRemove error:",i)}}else if(!r&&o.__if)if(o.__ifInitialized)t.node||(t.node=so(t)),t.node&&(t.node.ref=t),ls(t),_s(t),Ls(t),D("Render",t,{}),io(t,{});else{if(o.__ifInitialized=!0,o.__ifLateMerge=null,t.tag||(t.tag=To(t)),D("Init",t,{}),t.node||(t.node=so(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!o.__fragmentAnchor){const f=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(f),o.__fragmentAnchor=f}D("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),Ws(t,{}),ds(t,{skipIfEffect:!0}),ps(t),zs(t,{}),ls(t),D("Create",t,{}),D("Complete",t,{}),D("Render",t,{}),D("RenderRouter",t,{}),io(t,{})}},{depth:o.path.length,label:v(o,"if")});o.__effects.push(e)}function Gt(t,o){const s=t.node;if(!s)return;const n=o==null||typeof o=="object"?"":String(o);if(t.tag==="string"){s.nodeValue!==n&&(s.nodeValue=n);return}const e=t.__ref;let c=e?e.__textNode:null;if(c&&c.parentNode!==s&&(c=null),!c){const a=s.firstChild;a&&a.nodeType===3&&(c=a)}c?c.nodeValue!==n&&(c.nodeValue=n):s.firstChild?(c=(s.ownerDocument||t.context?.document||globalThis.document).createTextNode(n),s.insertBefore(c,s.firstChild)):(s.textContent=n,c=s.firstChild&&s.firstChild.nodeType===3?s.firstChild:null),e&&(e.__textNode=c||null)}function Jn(t,o){return o!=="checked"||!t||t.tagName!=="INPUT"?null:t.hasAttribute("checked")}function mn(t,o){if(o===null)return;const s=t.hasAttribute("checked");s!==o&&t.checked!==s&&(t.checked=s)}function Kt(t,o,s,n){s==null||s===!1&&!It(o)?Wt(t,o,null):typeof s=="function"||typeof s=="object"||(n&&o==="src"&&"src"in t?t.src=s:Wt(t,o,Q(o,s)))}function Wt(t,o,s){const n=Jn(t,o);s==null?t.removeAttribute(o):t.setAttribute(o,s),mn(t,n)}function ys(t,o){const s=t.node;if(!s||!("value"in s))return;const n=o==null?"":String(o);if(s.value===n)return;const e=typeof document<"u"&&document.activeElement===s,c=e&&typeof s.selectionStart=="number"?s.selectionStart:null,a=e&&typeof s.selectionEnd=="number"?s.selectionEnd:null;if(s.value=n,e&&c!=null&&a!=null)try{s.setSelectionRange(c,a)}catch{}const r=t.__ref&&t.__ref.__autoGrow;r&&r.active&&r.resize()}function _s(t){const{node:o}=t;if(o){if((typeof t.text=="string"&&!t.text.includes("{{")||typeof t.text=="number")&&Gt(t,t.text),$s(t),typeof t.html=="string"&&(o.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&!(typeof t.value=="string"&&t.value.includes("{{"))&&"value"in o){const s=String(t.value);o.value!==s&&(o.value=s)}if(t.style&&typeof t.style=="object"){let s=t.style;for(const n in t.style)if(typeof t.style[n]=="function"){s={};for(const e in t.style)typeof t.style[e]!="function"&&(s[e]=t.style[e]);break}J(o,qt(t,s))}if(t.attr&&typeof t.attr=="object")for(const s in t.attr){const n=t.attr[s];typeof n=="function"||typeof n=="object"||n!=null&&(typeof n=="string"&&n.includes("{{")||n===!1&&!It(s)||o.setAttribute&&o.setAttribute(s,Q(s,n)))}if(typeof t.themeModifier=="string"&&t.themeModifier&&o.setAttribute&&o.setAttribute("data-theme",t.themeModifier),t.data&&typeof t.data=="object")for(const s in t.data){const n=t.data[s];typeof n=="function"||typeof n=="object"||n==null||n===!1||typeof n=="string"&&n.includes("{{")||o.dataset&&(o.dataset[s]=n===!0?"":n)}if(t.classlist||t.class){const s=t.classlist||t.class;if(typeof s=="string")s.split(" ").forEach(n=>n&&o.classList.add(n));else if(typeof s=="object")for(const n in s){const e=typeof s[n]=="function"?s[n](t,t.state,t.context):s[n];e&&o.classList.add(typeof e=="string"?e:n)}}}}function pt(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function te(t){if(!t||typeof t!="object")return!1;for(const o in t){const s=t[o];if(s&&typeof s=="object"&&!Array.isArray(s))return!0}return!1}function Ot(t,o){if(!t||!t.style||!o)return null;const s=t.style,n=[];for(const e in o){if(o[e]==null||e.charAt(0)==="&")continue;const a=q(e);n.push(a,yo(s,a),gs(s,a))}return n}function yo(t,o){return typeof t.getPropertyValue=="function"?t.getPropertyValue(o):""}function gs(t,o){return typeof t.getPropertyPriority=="function"?t.getPropertyPriority(o):""}function q(t){return Bo(t)}function _o(t,o,s){if(!t||!t.style||!o||!o.length)return;const n=t.style,e=new Set;if(s&&typeof s=="object")for(const c in s)s[c]==null||c.charAt(0)==="&"||e.add(q(c));for(let c=0;c<o.length;c+=3){const a=o[c];e.has(a)||yo(n,a)===o[c+1]&&typeof n.removeProperty=="function"&&n.removeProperty(a)}}function Tt(t,o){if(!o||!t||!t.style)return!1;const s=t.style;for(let n=0;n<o.length;n+=3)if(yo(s,o[n])!==o[n+1]||gs(s,o[n])!==o[n+2])return!1;return!0}const Dt=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,bs=t=>typeof t=="number"||t===!0||typeof t=="string"&&t!=="",zt=t=>Dt(t)?t:"--"+t;function Yt(t,o){if(!m(t))return null;let s=null;for(const n of Object.keys(t)){if(!n)continue;let e=t[n];if(typeof e=="function"){if(!o)continue;e=e(o,o.state,o.context)}bs(e)&&(s||(s={}),s[zt(n)]=e)}return s}function As(t,o,s,n,e){xs(t,e,T(t,n,s),c=>bs(c)?{[o]:c}:null)}function xs(t,o,s,n,e){const c=t.__ref;let a,r=null;const i=j(()=>{Z(t,()=>{try{const f=n(s(t,t.state,t.context)),d=t.node;if(!d||!d.style)return;const u=pt(f);(u===null||u!==a||!Tt(d,r))&&(a=u,_o(d,r,f),f&&J(d,f),r=f?Ot(d,f):null,e&&e(f))}catch(f){R(c,o,f)}})},{depth:c.path.length,label:v(c,o)});c.__effects.push(i)}function oe(t){const o=t.__ref,s=t.vars;if(typeof s=="function"){se(t,s),o.__exec.vars=s;return}if(m(s))for(const n of Object.keys(s)){const e=s[n];!n||typeof e!="function"||As(t,zt(n),e,dt(t.varsDeps,n),"vars."+n)}}function se(t,o){const s=t.__ref;xs(t,"vars",T(t,t.varsDeps,o),n=>Yt(n),n=>{s.__varsInline=n?new Set(Object.keys(n)):null})}function go(t,o){if(typeof t[o]=="function"&&(nt(t.tag||"div",o)||o.charCodeAt(0)===45))return!0;if(!Dt(o))return!1;const s=t.vars;if(typeof s=="function"){const n=t.__ref&&t.__ref.__varsInline;return!!(n&&n.has(o))}if(!m(s))return!1;for(const n of Object.keys(s))if(typeof s[n]=="function"&&zt(n)===o)return!0;return!1}function ne(t){let o=null;for(const s in t)t[s]!=null&&s.charAt(0)!=="&"&&(o||(o=new Set),o.add(q(s)));return o}function ee(t,o,s,n){const e=t.__ref;if(!e)return;let c=null;if(s)for(const a of s){if(n&&n.has(a))continue;const r=o[a];if(r==null||typeof r=="object")continue;const i=q(a);Bt[i]&&(c||(c={}),c[i]=r)}e.__declaredLonghands=c}function ws(t,o){const s=t.__ref,n=s&&s.__declaredLonghands;if(!n||!o)return null;let e=null;for(const c in n){if(o.has(c))continue;const a=Bt[c];let r=!1;for(let i=0;i<a.length;i++)if(o.has(a[i])){r=!0;break}r&&(e||(e={}),e[c]=n[c])}return e}function Ss(t,o){const s=t.node;J(s,o);const n=ne(o);if(!n)return o;const e=t.__ref;if(e)if(e.__inlineCssKeys)for(const a of n)e.__inlineCssKeys.add(a);else e.__inlineCssKeys=new Set(n);const c=ws(t,n);return c?(J(s,c),Object.assign({},o,c)):o}function re(t){const o=t.__ref;if(!o||!o.__inlineCssKeys||!o.__declaredLonghands)return;const s=ws(t,o.__inlineCssKeys);s&&J(t.node,s)}function qt(t,o){return!o||typeof o!="object"?o:Z(t,()=>{try{return _n(o,t)}catch{return o}})}function J(t,o){if(!t||!o||!t.style)return;let s=null;for(const n in o){const e=o[n];if(e!=null){if(n.charAt(0)==="&"&&typeof e=="object"){s||(s={}),s[n]=e;continue}try{const c=String(e),a=Bo(n),r=c.trim(),i=/\s*!important\s*$/.test(r),f=r.replace(/\s*!important\s*$/,"");t.style.setProperty(a,f,i?"important":"")}catch{}}}s&&ie(t,s)}function ie(t,o){const s=`_ds${Vo.scopedStyleId++}`;t.classList.add(s);const n=t.ownerDocument;let e=n.querySelector("style[data-smbls-scoped]");e||(e=n.createElement("style"),e.setAttribute("data-smbls-scoped",""),n.head.appendChild(e));let c="";for(const a in o){const r="."+s,i=a.replace(/&/g,r).split(",").map(d=>{const u=d.trim();return u.includes(r)?u:r+u}).join(", "),f=o[a];if(typeof f=="object"){let d="",u="";for(const l in f){const _=f[l];if(typeof _=="object"){const g=l.includes("&")?i.split(", ").map(p=>l.replace(/&/g,p)).join(", "):i.split(", ").map(p=>`${p} ${l}`).join(", ");let y="";for(const p in _)y+=`${q(p)}: ${_[p]};`;u+=$o(`${g} { ${y} }`,g)+`
5
+ `}else d+=`${q(l)}: ${_};`}d&&(c+=$o(`${i} { ${d} }`,i)+`
6
+ `),u&&(c+=u)}}c&&(e.textContent+=c)}const Cs=new Set;function ks(t){if(!Array.isArray(t))return"";const o=[];for(let s=0;s<t.length;s++)typeof t[s]=="string"&&t[s].length&&o.push(t[s]);return o.sort(),o.join("|")}function ce(t,o,s){const n=ks(s);queueMicrotask(()=>{if(!t.__ref)return;let e;try{e=o(t,t.state,t.context)}catch{return}if(ks(e)===n)return;const c=t.__ref.path?t.__ref.path.join("."):t.key||"?";Cs.has(c)||(Cs.add(c),console.warn(`[smbls] subscribeTo function at "${c}" resolved to a DIFFERENT key list one microtask after create \u2014 wired [${s.join(", ")||"(none)"}], probed [${Array.isArray(e)?e.join(", "):String(e)}]. subscribeTo's function form is resolved ONCE at element-create time (registerSubscribeToEffects, @symbo.ls/element create.js) \u2014 this element stays wired to the ORIGINAL list for its whole lifetime, so this drift is invisible to the reactive effect and any key only present in the new list will never trigger onUpdate. If the watched key genuinely is not known until later (e.g. a module config that loads after shell boot), route the write through an imperative call instead of subscribeTo \u2014 see functions/moduleOpenBridge.js's moduleOpenPage (workspace repo) for the house pattern.`))})}function fe(t){const o=t.subscribeTo,s=typeof o=="function";let n=o;if(s)try{n=o(t,t.state,t.context)}catch{n=null}if(s&&st()&&ce(t,o,Array.isArray(n)?n:[]),!Array.isArray(n)||n.length===0)return;const e=t.__ref;for(let c=0;c<n.length;c++){const a=n[c];if(typeof a!="string"||a.length===0)continue;const r=a.split("."),i=r[0],f=r.slice(1),d={value:!1},u=j(()=>{const l=t.state&&(G(t.state)?t.state.root:null);if(!l||!G(l))return;let _=l;_=_[i];for(let y=0;y<f.length&&!(_==null||typeof _!="object");y++)if(G(_))_=_[f[y]];else break;if(!d.value)return;let g=!1;if(typeof t.onBeforeUpdate=="function"&&Z(t,()=>{try{if(Fe(e)){const y=t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0});y&&typeof y.then=="function"?y.then(()=>Qt(e,!1),p=>{Qt(e,!0),bt("error",t,{hook:"onBeforeUpdate",error:p})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",p)}):(Qt(e,!1),y===!1&&(g=!0))}}catch(y){Qt(e,!0),bt("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}}),!g&&t.node&&e.__effects)for(let y=0;y<e.__effects.length;y++){const p=e.__effects[y];p&&p!==u&&!p._disposed&&!p._isSubscribeToEffect&&typeof p._execute=="function"&&p._execute()}!g&&typeof t.onUpdate=="function"&&Z(t,()=>{try{t.onUpdate(t,t.state,t.context)}catch(y){bt("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}})},{depth:e.path.length,label:v(e,"subscribeTo("+a+")")});d.value=!0,u._isSubscribeToEffect=!0,e.__effects.push(u)}}function bo(t,o){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&!t.startsWith("@container")&&(t==="@dark"||t==="@light"||!o.context?.designSystem?.media?.[t.slice(1)])}function Ao(t,o){if(t.charCodeAt(0)!==64||/^@(media|supports|container|keyframes)\b/.test(t))return t;const s=o.context?.designSystem?.media?.[t.slice(1)];return s?/^@(media|supports|container)\b/.test(s)?s:`@media ${s}`:t}const vs=new Set;function ae(t,o){const s=o?.__ref?.path?o.__ref.path.join("."):o?.key||"?",n=s+"::"+t;vs.has(n)||(vs.add(n),console.warn(`[smbls/css] "${t}" at ${s} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}const js=new Map;function ue(t){let o=js.get(t);if(o)return o;o=[];const s=n=>{if(n)for(const e of n)o.push(Ho(e))};return s(Bt[t]),s(xn[t]),js.set(t,o),o}function Es(t,o,s){if(go(t,o)||s&&s.has(o))return!0;const n=ue(q(o));for(let e=0;e<n.length;e++){const c=n[e];if(go(t,c)||s&&s.has(c))return!0}return!1}function ht(t,o,s,n){const e={},c=new Set,a=(r,i,f)=>{const d=f?new Set(Object.keys(e)):null;if($[r]){const u=$[r](i,o,o.state,o.context);if(u){const l=Array.isArray(u)?u:[u];for(const _ of l)_&&Object.assign(e,_)}}else e[r]=i;if(f)for(const u in e)d.has(u)||c.add(u)};for(const r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];if(typeof i=="function"&&(i=i(o,o.state,o.context)),!(i==null||typeof i=="function")){if(typeof i=="object"&&!Array.isArray(i)){if(r==="style"){for(const u in i){let l=i[u];typeof l=="function"&&(l=l(o,o.state,o.context)),!(l==null||typeof l=="function")&&a(u,l,Es(o,u,n))}continue}if(r==="vars"){const u=Yt(i,o);if(u)for(const l in u)a(l,u[l],go(o,l)||!!(n&&n.has(l)));continue}if(bo(r,o)){const u=ht(i,o,!1,n);Object.keys(u).length&&(e[`[data-theme="${r.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(r)){st()&&ae(r,o);continue}const f=Ao(r,o),d=ht(i,o,!1,n);Object.keys(d).length&&(e[f]=d);continue}a(r,i,Es(o,r,n))}}if(s)for(const r in e)c.add(r);for(const r of c){const i=e[r];typeof i=="string"&&!i.includes("!important")&&(e[r]=i+" !important")}return e}const m=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function Ps(t,o){for(const s in o){const n=o[s];t[s]=m(n)?Ps(m(t[s])?t[s]:{},n):n}return t}function de(t,o){if(!m(o))return;let s;for(const n of t.split(" ")){const e=n?o[n]:null;m(e)&&(s=Ps(s||{},e))}return s}function xo(t,o){if(o===void 0&&(o=0),o>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&xo(t[s],o+1))return!0}return!1}function Os(t,o,s){if(!o||typeof o!="object"||Array.isArray(o))return null;if(bo(t,s)){const c=ht(o,s,!1);return Object.keys(c).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:c}:null}const n=Ao(t,s),e=ht(o,s,!1);return Object.keys(e).length?{cssProp:n,block:e}:null}function le(t){const o=t.__ref;for(const s of Object.keys(t)){if(!co(s))continue;const n=t[s];if(!n||typeof n!="object"||Array.isArray(n)||!xo(n))continue;let e=null,c;const a=j(()=>{if(!t.node)return;const r=t.context?.designSystem;r&&W(r);let i,f=!1;try{const d=Os(s,n,t),u=d?pt(d.block)+"::"+d.cssProp:null;if(u!==null&&u===c)f=!0;else if(c=u,d){const l=At({[d.cssProp]:d.block},null,t.context?.cssPrefix);i=l?l.split(" ").filter(Boolean):null}else i=null}finally{r&&z()}if(!(f||!t.node.classList)){if(e)for(const d of e)t.node.classList.remove(d);if(i&&i.length)for(const d of i)t.node.classList.add(d);e=i}},{depth:o.path.length,label:v(o,"cssBlock("+s+")")});o.__effects.push(a)}}const pe=()=>!0,he=(t,o)=>{const s=t.charAt(0);return(s===":"||s==="@"||s==="&"||s==="[")&&o&&typeof o=="object"&&!Array.isArray(o)?!0:!!$[t]||!!(H&&H.has(t))||Dt(t)||t==="vars"};function ye(t,o,s){const n={};let e=!1;for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(r!=="data"&&r!=="aria"&&(he(r,s[r])||B.has(r))?n[r]=!0:e=!0);if(!e)return null;const c=bn({[o]:s},t.tag||"div",n,pe);let a=null;for(const r in c)/^on/i.test(r)||(a||(a={}),a[r]=c[r]);return a}function Ts(t,o,s,n,e,c){const a=t.node;let r=null;const i=f=>{(r||(r=[])).push(f)};for(const f in n){const d=o.owners.get(f),u=d===s;if(!c&&d!==void 0&&!u)continue;let l;try{l=n[f](t)}catch(g){R(t.__ref,"conditional("+s+")."+f,g),u&&i(f);continue}if(typeof l=="string"&&l.includes("{{")&&(l=F.call(t,l,t.state)),u&&a.getAttribute(f)!==o.written.get(f)){i(f);continue}if(l==null||typeof l=="object"||typeof l=="function"){u&&Ds(a,o,f);continue}const _=l===!1&&!It(f)?null:String(Q(f,l));i(f),!(u&&_===o.written.get(f))&&(d===void 0&&o.base.set(f,a.getAttribute(f)),Wt(a,f,_),o.owners.set(f,s),o.written.set(f,_))}e.appliedAttrs=r}function Ds(t,o,s){t.getAttribute(s)===o.written.get(s)&&Wt(t,s,o.base.get(s)),o.owners.delete(s),o.base.delete(s),o.written.delete(s)}function _e(t,o,s,n){const e=n.appliedAttrs;if(n.appliedAttrs=null,!!e)for(const c of e)o.owners.get(c)===s&&Ds(t.node,o,c)}function Ls(t){const o=t.__ref&&t.__ref.__conditionalAttrs,s=t.node;if(!(!o||!o.owners.size||!s||!s.getAttribute))for(const n of o.owners.keys()){const e=o.written.get(n),c=s.getAttribute(n);c!==e&&(o.base.set(n,c),e==null?s.removeAttribute(n):s.setAttribute(n,e))}}function ge(t){const o=t.__ref;o.__conditionalRunners=[];let s=null;const n=new Map;for(const e of Object.keys(t)){const c=e.charAt(0);if(c!=="."&&c!=="!")continue;const a=e.slice(1);if(!a)continue;if(/[:@\s>~+[\]]/.test(a)){if(typeof console<"u"&&console.warn){const p=a.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${c}\` is read as one prop name. Nest the selector inside instead: \`${c}${p}: { '${a.slice(p.length)}': {...} }\`.`)}continue}const r=t[e];if(!r||typeof r!="object")continue;const i=c==="!",f={lastMatch:!1,appliedKeys:null,appliedClasses:null,appliedAttrs:null},d=ye(t,e,r);d&&!s&&(s=o.__conditionalAttrs={owners:new Map,base:new Map,written:new Map});const u=new Set;for(const p in r){if(!Object.prototype.hasOwnProperty.call(r,p))continue;const A=p.charAt(0),w=r[p];if(!((A===":"||A==="@"||A==="&"||A==="[")&&w&&typeof w=="object"&&!Array.isArray(w))){if(p==="vars"&&m(w)){for(const h of Object.keys(w))h&&u.add(zt(h));continue}u.add(p)}}const l=()=>{let p;const A=t[a];if(A===void 0){const b=!!t.state&&a in t.state,x=t.state?t.state[a]:void 0;if(b||x!==void 0)p=x;else{const S=t.context?.cases?.[a];if(S===void 0)return;try{p=typeof S=="function"?S.call(t,t):S}catch(k){p=!1,o.__conditionalError=k,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,k?.message||k)}}}else if(typeof A=="function")try{p=A(t,t.state,t.context)}catch(b){p=!1,o.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${e}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}else p=A;const w=i?!p:!!p;if(!t.node)return;const h=t.context?.designSystem;if(w===f.lastMatch){if(w&&d&&t.node.setAttribute){h&&W(h);try{Ts(t,s,e,d,f,!1)}finally{h&&z()}}return}f.lastMatch=w,h&&W(h);try{if(w){const b={},x={};let S=!1;for(const C in r){if(!Object.prototype.hasOwnProperty.call(r,C))continue;const L=r[C],tt=C.charAt(0);if((tt===":"||tt==="@"||tt==="&"||tt==="[")&&L&&typeof L=="object"&&!Array.isArray(L)){if(bo(C,t)){const P=ht(L,t,!1,u);Object.keys(P).length&&(x[`[data-theme="${C.slice(1)}"] &`]=P,S=!0)}else{const P=Ao(C,t),M=ht(L,t,!1,u);Object.keys(M).length&&(x[P]=M,S=!0)}continue}const ot=typeof L=="function"?L(t,t.state,t.context):L;if(ot!=null){if($[C]){const P=$[C](ot,t,t.state,t.context);if(P){const M=Array.isArray(P)?P:[P];for(const yt of M)yt&&Object.assign(b,yt)}}else if(H&&H.has(C))b[C]=ot;else if(Dt(C))b[C]=ot;else if(C==="vars"){const P=Yt(ot,t);P&&Object.assign(b,P)}}}const k=Object.keys(b);if(k.length){J(t.node,b);for(const C of k)n.set(C,e);f.appliedKeys=k}else f.appliedKeys=null;if(S){const C=At(x,null,t.context?.cssPrefix,{state:!0}),L=C?C.split(" ").filter(Boolean):[];if(L.length&&t.node.classList){for(const tt of L)t.node.classList.add(tt);f.appliedClasses=L}else f.appliedClasses=null}else if(f.appliedClasses){for(const C of f.appliedClasses)t.node.classList.remove(C);f.appliedClasses=null}d&&t.node.setAttribute&&Ts(t,s,e,d,f,!0)}else{if(f.appliedAttrs&&_e(t,s,e,f),f.appliedKeys){for(const b of f.appliedKeys)n.get(b)===e&&(Dt(b)?t.node.style.removeProperty(b):t.node.style[b]="",n.delete(b));f.appliedKeys=null}if(f.appliedClasses){for(const b of f.appliedClasses)t.node.classList.remove(b);f.appliedClasses=null}}}finally{h&&z()}};o.__conditionalRunners.push(l);const _=T(t,t[a+"Deps"],l),g=j(_,{depth:o.path.length,label:v(o,"conditional("+e+")")}),y=o.__exec&&o.__exec[a]||t[a];g._sources.size===0&&typeof y=="function"&&st()&&In(y)&&console.warn(`[smbls] conditional \`${e}\` on ${t.key||"?"} subscribed to nothing \u2014 its predicate tracked no reactive read on its first run, so no state write will ever re-evaluate it (only a direct element.update() on this element re-runs it). If the predicate guards its state reads (\`in\`, short-circuits, \`?.\`), declare \`${a}Deps: [...]\` (state-key strings or \`(el, s) => \u2026\` selectors) so the subscription is armed unconditionally.`),o.__effects.push(g)}}const wo=new WeakSet,So=new WeakMap;function be(t){const o=So.get(t);if(o==="painted")return!1;if(o===void 0){So.set(t,"open");const s=t.defaultView,n=()=>{So.set(t,"painted")};s&&typeof s.requestAnimationFrame=="function"?s.requestAnimationFrame(n):setTimeout(n,0)}return!0}function Ae(t){const o=t.ownerDocument;!o||wo.has(o)||be(o)||(wo.add(o),queueMicrotask(()=>{wo.delete(o);const s=o.body||o.documentElement;s&&s.offsetWidth}))}const Co=new WeakSet;let Rs=!1;function Ms(t){return t.startsWith("[data-theme=")||t.startsWith("@media")&&t.includes("prefers-color-scheme")}function ko(t,o){const s={...t};for(const n in o){const e=o[n],c=s[n];s[n]=e&&typeof e=="object"&&c&&typeof c=="object"?ko(c,e):e}return s}function Ns(t,o){const s={};for(const n in t){const e=t[n];if(e&&typeof e=="object"){const c=Ns(e,o);Object.keys(c).length&&(s[n]=c)}else o.has(n)||(s[n]=e)}return s}function xe(t,o,s){let n=1/0,e=-1/0;for(const a of o.values())a<n&&(n=a),a>e&&(e=a);if(s)for(const a of s.values())a>e&&(e=a);if(e<=n)return null;let c=null;for(const[a,r]of o){if(r===e)continue;const i=we(a);if(i)for(let f=0;f<i.length;f+=3){const d=i[f],u=i[f+1],l=i[f+2],_=t[u]!=null?o.get(u):void 0,g=s&&s.get(d),y=_!==void 0&&_>r&&Io(d,t[u],l),p=!y&&g!==void 0&&g>r&&Io(d,void 0,l);if(y||p){y&&delete t[a],c||(c=new Set),c.add(a);break}}}return c}const Fs=new Map;function we(t){let o=Fs.get(t);if(o!==void 0)return o;const s=q(t),n=Bt[s];if(o=null,Array.isArray(n)){o=[];for(const e of n)o.push(e,Ho(e),s)}return Fs.set(t,o),o}function $s(t){const{node:o}=t;if(!o)return;if(Rs||(Rs=!0,At({display:"none"})),Co.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}Co.add(t);const s=t.context?.designSystem;s&&W(s),No();try{const n={};let e=!1,c=[],a=null,r=null,i=null;const f=t.__ref&&t.__ref.__mergeLayer;let d,u=null,l=null;const _=(h,b)=>{if(b&&typeof b=="object"&&Ms(h)){r||(r={});const x=r[h];x&&(b=ko(x,b)),r[h]=b}else(b===null||typeof b!="object")&&(i||(i=new Set),i.add(h),d!==void 0&&(u||(u=new Map),u.set(h,d)));n[h]=b};if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&$.theme){const h=$.theme(t.theme,t,t.state,t.context);if(h){const b=x=>{for(const S in x){const k=x[S];k&&typeof k=="object"&&Ms(S)&&(a||(a={}),a[S]=k),n[S]=k}};if(Array.isArray(h))for(const x of h)x&&b(x);else b(h);e=!0}}const g=(h,b)=>{if(h==="vars"){const x=Yt(b);if(x){for(const S in x)_(S,x[S]);e=!0}return}if($[h]){const x=$[h](b,t,t.state,t.context);if(x){if(Array.isArray(x)){for(const S of x)if(S)for(const k in S)_(k,S[k])}else for(const S in x)_(S,x[S]);e=!0}}else if(H&&H.has(h))b!=null&&typeof b!="object"&&(_(h,b),e=!0);else if(h.charCodeAt(0)===45)b!=null&&typeof b!="object"&&(_(h,b),e=!0);else if((h.charAt(0)==="&"||h.charAt(0)==="@"||h.charAt(0)===":"||h.charAt(0)==="[")&&b&&typeof b=="object"&&!Array.isArray(b)){if(xo(b))return;const x=Os(h,b,t);x&&(_(x.cssProp,x.block),e=!0)}};if(typeof t.class=="string"){const h=de(t.class,t.context?.designSystem?.class);if(h)for(const b in h)g(b,h[b])}const y=i?new Set(i):null,p=t.tag||"div";for(const h of Object.keys(t)){if(typeof t[h]=="function"){const x=f&&f.get(h);x!==void 0&&nt(p,h)&&(l||(l=new Map),l.set(q(h),x));continue}if(d=f?f.get(h):void 0,h==="vars"){g(h,t[h]);continue}if(B.has(h)||h==="theme")continue;const b=h.charCodeAt(0);b>=65&&b<=90||Y(h)||Uo(p,h)||g(h,t[h])}d=void 0;const A=u?xe(n,u,l):null;if(a)for(const h in a){let b=i?Ns(a[h],i):a[h];r&&r[h]&&(b=ko(b,r[h])),Object.keys(b).length?n[h]=b:delete n[h]}if(ee(t,n,i,A?new Set([...y||[],...A]):y),e){n.display&&String(n.display).includes("!important")&&(o.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);const h=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;typeof h=="string"&&h!==""&&n.display&&n.display!==h&&(n.display=h);const b=At(n,null,t.context?.cssPrefix);if(c=b?b.split(" ").filter(Boolean):[],b&&o.classList){const x=c;let S=!1;for(const k of x)o.classList.add(k),S||(k.charCodeAt(0)===95&&k.charCodeAt(1)===99||k.charCodeAt(0)===95&&k.indexOf("_c",1)!==-1)&&(S=!0);S&&Ae(o)}}const w=t.__ref;if(w){const h=w.__staticCssClasses;if(h&&o.classList){const b=new Set(c);for(const x of h)b.has(x)||o.classList.remove(x)}w.__staticCssClasses=c}re(t)}finally{Fo(),s&&z(),Co.delete(t)}}const ur=t=>!!$[t]||!!(H&&H.has(t))||typeof t=="string"&&t.charCodeAt(0)===45;function dr(t){t&&t.node&&$s(t)}function Se(t){const{node:o}=t;if(!o||!o.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(const e in t.aria){const c=t.aria[e];if(typeof c=="function"||typeof c=="object"||c==null||typeof c=="string"&&c.includes("{{"))continue;const a="aria-"+e.replace(/[A-Z]/g,r=>"-"+r.toLowerCase());o.setAttribute(a,Q(a,c))}const s=gn(t);for(const e in s){const c=s[e];c!=null&&c!==!1&&typeof c!="function"&&typeof c!="object"&&o.setAttribute(e,c===!0?"":c)}const n=t.tag||"div";for(const e of Object.keys(t)){if(typeof t[e]=="function"||B.has(e)||e==="on"||s[e]!==void 0)continue;const c=e.charCodeAt(0);if(!(c>=65&&c<=90)&&!Y(e)&&!nt(n,e)&&xt(n,e)){let a=t[e];if(a==null)continue;if(typeof a=="string"&&a.includes("{{")){if(!no[e])continue;a=F.call(t,a,t.state)}if(a==null||typeof a=="function"||typeof a=="object"||a===!1&&!It(wt(e)||e))continue;const r=wt(e)||e;o.setAttribute(r,Q(r,a))}}}function lr(t,o){const{node:s}=t;if(!s||!s.setAttribute)return;const n=o.charCodeAt(0);if(n>=65&&n<=90||Y(o))return;const e=t.tag||"div";if(nt(e,o)||!xt(e,o))return;const c=wt(o)||o,a=c.toLowerCase(),r=t.__ref&&t.__ref.__effects;let i=!1;if(r)for(let u=0;u<r.length;u++){const l=r[u];l&&l._attrName===a&&!l._disposed&&typeof l._execute=="function"&&(i=!0,l._execute())}if(i)return;let f=t[o];const d=no[o];if(d&&f!=null){const u=d(t);u!==void 0&&(f=u)}typeof f=="string"&&f.includes("{{")&&(f=F.call(t,f,t.state)),Kt(s,c,f)}function Ce(t,o){const s=t.node,n=t.__ref;let e=n.__autoGrow;if(!o){if(e&&e.active){try{s.removeEventListener("input",e.resize)}catch{}Bs(e),et.delete(t),s.style.height="",e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""),Vs(s,e,!1),e.active=!1,e.appliedMax=null,e.lastMeasure=0}return}e||(e=n.__autoGrow={active:!1,appliedMax:null,lastMeasure:0,lastWidth:null,watch:null,awaitingLayout:!1,appliedScroll:!1,fontsHooked:!1,attachAttempts:0,firstAttemptAt:null,resize:()=>{if(!s.isConnected){Lt(t,!0);return}if(!(s.scrollHeight>0)){e.awaitingLayout=!0,Is(t,e);return}e.awaitingLayout=!1;const a=je(s),r=Ee(a),i=s.style.height;s.style.height="0px",r&&jo(s);const f=s.scrollHeight;if(!(f>0)){s.style.height=i,r&&jo(s);return}const d=Pe(s,a),u=d!=null&&f<d?d:f,l=De(a),_=l!=null&&u>l;s.style.height=Te(_?l:u,a)+"px",r&&jo(s),Vs(s,e,_),e.lastMeasure=f,e.lastWidth=s.clientWidth,Is(t,e)}},n.__eventCleanup||(n.__eventCleanup=[]),n.__eventCleanup.push(()=>{try{s.removeEventListener("input",e.resize)}catch{}Bs(e),et.delete(t)})),e.active||(s.addEventListener("input",e.resize),e.active=!0,ve(t,e));const c=typeof o=="object"&&o.max!=null?String(o.max):null;c!==e.appliedMax&&(c==null?e.appliedMax!=null&&s.style.maxHeight===e.appliedMax&&(s.style.maxHeight=""):s.style.maxHeight=c,e.appliedMax=c),e.resize()}function Lt(t,o){const s=t.__ref?.__autoGrow;s&&(o&&(s.attachAttempts=0,s.firstAttemptAt=null),et.add(t),Ht())}function ke(){const t=Array.from(et);et.clear();for(let o=0;o<t.length;o++){const s=t[o],n=s.node,e=s.__ref?.__autoGrow;if(!(!n||!e||!e.active)){if(!n.isConnected){e.firstAttemptAt==null&&(e.firstAttemptAt=ut()),e.attachAttempts+=1,e.attachAttempts<=Wo&&ut()-e.firstAttemptAt<zo&&(et.add(s),Ht());continue}e.attachAttempts=0,e.firstAttemptAt=null,e.resize()}}}function Is(t,o){if(o.watch)return;const s=t.node;if(!s)return;const n=s.ownerDocument&&s.ownerDocument.defaultView,e=n&&n.ResizeObserver||(typeof ResizeObserver=="function"?ResizeObserver:null);if(typeof e!="function")return;const c=()=>{if(!o.active||!s.isConnected||!(s.scrollHeight>0))return;if(o.awaitingLayout){o.awaitingLayout=!1,Lt(t,!0);return}const r=s.clientWidth;o.lastWidth!=null&&Math.abs(r-o.lastWidth)<.5||(o.lastWidth=r,Lt(t,!0))};let a;try{a=new e(c),a.observe(s)}catch{return}o.watch=a}function Bs(t){const o=t.watch;if(o){t.watch=null;try{o.disconnect()}catch{}}}function ve(t,o){if(o.fontsHooked)return;o.fontsHooked=!0;const s=t.node&&t.node.ownerDocument,n=s&&s.fonts&&s.fonts.ready;!n||typeof n.then!="function"||n.then(()=>{o.active&&t.node&&Lt(t,!0)},()=>{})}function je(t){const o=t.ownerDocument&&t.ownerDocument.defaultView;try{return o&&o.getComputedStyle?o.getComputedStyle(t):null}catch{return null}}const rt=t=>typeof t=="string"&&/^\s*-?\d*\.?\d+px\s*$/.test(t)?parseFloat(t):null,vo=t=>(rt(t.paddingTop)||0)+(rt(t.paddingBottom)||0),Hs=t=>(rt(t.borderTopWidth)||0)+(rt(t.borderBottomWidth)||0);function Ee(t){if(!t)return!1;const o=String(t.transitionProperty||"").split(","),s=String(t.transitionDuration||"0s").split(",");for(let n=0;n<o.length;n++){const e=o[n].trim();if(!(e!=="all"&&e!=="height")&&parseFloat(s[n%s.length])>0)return!0}return!1}function jo(t){if(typeof t.getAnimations!="function")return;let o;try{o=t.getAnimations()}catch{return}for(let s=0;s<o.length;s++){const n=o[s];if(n&&n.transitionProperty==="height")try{n.cancel()}catch{}}}function Pe(t,o){if(!o||!t.hasAttribute||!t.hasAttribute("rows"))return null;const s=parseInt(t.getAttribute("rows"),10);if(!(s>0))return null;const n=rt(o.lineHeight)||Oe(t,o);return n>0?s*n+vo(o):null}const Rt=["fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontFamily","lineHeight","letterSpacing"],Us=new WeakMap;function Oe(t,o){const s=t.ownerDocument,n=s&&(s.body||s.documentElement);if(!n||!s.createElement)return null;let e=Us.get(s);e||(e=new Map,Us.set(s,e));const c=Rt.map(f=>o[f]||"").join("|");if(e.has(c))return e.get(c);const a=s.createElement("textarea");a.rows=1,a.setAttribute("aria-hidden","true"),a.tabIndex=-1;const r=a.style;r.position="absolute",r.visibility="hidden",r.top="0",r.left="-9999px",r.height="auto",r.minHeight="0",r.maxHeight="none",r.padding="0",r.border="0",r.boxSizing="content-box",r.overflow="hidden";for(let f=0;f<Rt.length;f++)o[Rt[f]]&&(r[Rt[f]]=o[Rt[f]]);let i=0;try{n.appendChild(a),i=a.clientHeight}catch{i=0}finally{a.parentNode&&a.parentNode.removeChild(a)}return i>0?(e.set(c,i),i):null}function Te(t,o){return o?o.boxSizing==="border-box"?t+Hs(o):o.boxSizing==="content-box"?Math.max(0,t-vo(o)):t:t}function De(t){if(!t)return null;const o=rt(t.maxHeight);if(o==null||!(o>0))return null;const s=vo(t),n=Hs(t),e=t.boxSizing==="border-box"?o-n:o+s,c=rt(t.lineHeight);if(!(c>0))return e;const a=Math.floor((e-s)/c+1e-6);return a>=1?a*c+s:e}function Vs(t,o,s){s?o.appliedScroll||(t.style.overflowY="auto",o.appliedScroll=!0):o.appliedScroll&&(t.style.overflowY==="auto"&&(t.style.overflowY=""),o.appliedScroll=!1)}const Gs=["srcObject","muted"],Le=(t,o)=>t==="muted"?o===!0||o===""||o==="true"||o==="muted":o??null;function Re(t){const o=t.node,s=t.__ref;if(!(!o||!s))for(let n=0;n<Gs.length;n++){const e=Gs[n],c=t[e];if(c===void 0||!(e in o))continue;const a=r=>{const i=Le(e,r);if(o[e]!==i)try{o[e]=i}catch(f){R(s,e,f)}};if(typeof c=="function"){const r=T(t,t[e+"Deps"],c),i=j(()=>{try{a(r(t,t.state,t.context))}catch(f){R(s,e,f)}},{depth:s.path.length,label:v(s,e)});s.__effects.push(i),s.__exec[e]=c}else a(c);e==="srcObject"&&(s.__releaseMedia=()=>{try{o.srcObject!=null&&(o.srcObject=null)}catch{}})}}function Me(t){if(!t.autoGrow)return;const o=t.node;if(!o||o.tagName!=="TEXTAREA")return;const s=t.__ref,n=t.autoGrow,e=typeof n=="function"?T(t,t.autoGrowDeps,n):null,c=j(()=>{const a=t.autoGrow;let r=a;if(typeof a=="function")try{r=(a===n&&e?e:a)(t,t.state,t.context)}catch{r=null}Ce(t,r)},{depth:s.path.length,label:v(s,"autoGrow")});s.__effects||(s.__effects=[]),s.__effects.push(c),e&&(s.__exec.autoGrow=n)}const Ks=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function Ws(t,o){for(const s of Object.keys(t)){if(!Y(s)||Ks.has(s))continue;const n=rn(s);if(n){en(n,t,t[s]);continue}let e=t[s],c=null;if(e&&typeof e=="object"&&!Array.isArray(e)&&(c=e,e=c.handler),typeof e=="string"&&/^[A-Za-z_$][\w$]*$/.test(e)){const r=e;e=function(f){return t.call(r,f)}}if(typeof e!="function")continue;const a=jn(s);sn.has(a)||nn(En(a),t,e,c)}Ne(t)}function Ne(t){const o=t.node;if(!o||!o.addEventListener)return;const s={};let n=!1;for(const l of Ks){const _=t[l];typeof _=="function"&&(s[l]=_,n=!0)}if(!n)return;const e=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,c=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600;let a=0,r=0,i=0,f=!1;const d=l=>{const _=l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0];_&&(a=_.clientX,r=_.clientY,i=Date.now(),f=!0)},u=l=>{if(!f)return;f=!1;const _=l.changedTouches&&l.changedTouches[0]||l.touches&&l.touches[0];if(!_)return;const g=_.clientX-a,y=_.clientY-r,p=Date.now()-i;if(p>c)return;const A=Math.abs(g),w=Math.abs(y);if(Math.max(A,w)<e)return;let h;if(A>w*1.2)h=g<0?"left":"right";else if(w>A*1.2)h=y<0?"up":"down";else return;const b="onSwipe"+h.charAt(0).toUpperCase()+h.slice(1),x=s[b],S=s.onSwipe;x&&x.call(t,l,t,t.state,t.context),S&&S.call(t,{direction:h,dx:g,dy:y,dt:p,event:l},t,t.state,t.context)};o.addEventListener("touchstart",d,{passive:!0}),o.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{o.removeEventListener("touchstart",d)}catch{}try{o.removeEventListener("touchend",u)}catch{}})}function it(t,o){const s={...t};for(const n in o){const e=s[n],c=o[n];e&&c&&typeof e=="object"&&typeof c=="object"&&!Array.isArray(e)&&!Array.isArray(c)&&typeof e!="function"&&typeof c!="function"?s[n]=it(e,c):s[n]=c}return s}function Eo(t,o,s,n,e){if(!o||!t.node)return;const c=t.childExtends,a=lt(t,"childProps");if(Array.isArray(o)){const r=t.tag==="fragment",i=t.context?.document||globalThis.document,f=r?null:i?.createDocumentFragment();if(!r&&!f)return;const d=t.childProps,u=t.childrenAs,l=w=>{let h=o[w];const b=h;(typeof h=="string"||typeof h=="number")&&(h={text:h});let x=d;if(typeof d=="function")try{x=d(t,h)}catch{x=null}let S=typeof d=="function"?jt(x):a;if(e&&u!=="state"&&(S=Et(S,jt(b))),u==="state"){let C=b;(typeof b=="string"||typeof b=="number")&&(C={value:b,text:b}),h=x?{...x,state:C}:{state:C}}else x&&(h=it(x,h));if(c&&!h.ignoreChildExtends)if(h.extends){const C=Array.isArray(h.extends)?h.extends:[h.extends],L=Array.isArray(c)?c:[c];h={...h,extends:[...L,...C]}}else h={...h,extends:c};const k=qo(h?.key,b,w,t);try{return X(Pt(h,S),t,k,s)}catch(C){if(typeof console<"u"&&console.error){const L=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${k}" failed to construct at ${L} (initial render, skipping this row):`,C?.message||C)}return null}},_=t.__ref;if(!(n===!0&&!r&&!!_&&(s?.mountYield===!0||t.yieldChildren===!0))){for(let w=0;w<o.length;w++){const h=l(w);!r&&h?.node&&f.appendChild(h.node)}return r||t.node.appendChild(f),!0}const y=_.__childrenChunkGen=(_.__childrenChunkGen||0)+1;Lo();let p=null;const A=w=>{if(_.__disposed||_.__childrenChunkGen!==y){p&&p.parentNode&&p.remove();return}for(let h=w;h<o.length;h++){const b=l(h);if(b?.node&&(p?t.node.insertBefore(b.node,p):f.appendChild(b.node)),h+1<o.length&&Do()){p||(p=i.createComment("smbls-mount"),f.appendChild(p),t.node.appendChild(f));const x=h+1;Mo(()=>A(x));return}}p?(p.remove(),t.node.tagName==="SELECT"&&Zt(t,!0)):t.node.appendChild(f)};return A(0),Ro(),!0}if(typeof o=="string"){const r=ts(o,t);if(Array.isArray(r))return Eo(t,r,s,n,!0)}if(typeof o=="object")for(const r in o){if(B.has(r))continue;let i=o[r];if(i==null||i===!1)continue;const f=e?Et(a,jt(i)):a;if((typeof i=="string"||typeof i=="number")&&(i={text:i}),t.childProps&&(i=it(t.childProps,i)),c&&!i.ignoreChildExtends)if(i.extends){const d=Array.isArray(i.extends)?i.extends:[i.extends],u=Array.isArray(c)?c:[c];i={...i,extends:[...u,...d]}}else i={...i,extends:c};X(Pt(i,f),t,Vt(t,r),s)}}function Zt(t,o){const s=t.node;if(!s||s.tagName!=="SELECT")return;const n=s.options;if(!n||!n.length)return;const e=t.__ref,c=e&&e.__exec&&e.__exec.value,a=typeof c=="function",r=t.value!=null&&typeof t.value!="function";if(a||r){let d;if(a)try{d=c(t,t.state,t.context)}catch{return}else d=t.value,typeof d=="string"&&d.includes("{{")&&(d=F.call(t,d,t.state));const u=d==null?"":String(d);s.value!==u&&(s.value=u);return}const i=o||!(e&&e.__selectSynced);if(e&&(e.__selectSynced=!0),!i)return;let f=-1;for(let d=0;d<n.length;d++)n[d].defaultSelected&&(f=d);f>=0&&s.selectedIndex!==f&&(s.selectedIndex=f)}function zs(t,o){let{children:s,content:n}=t;const e=t.childExtends,c=typeof s=="function"||fs(t,"children");if(typeof s=="function"){const g=s;try{s=g(t,t.state,t.context)}catch(h){if(s=void 0,typeof console<"u"&&console.error){const b=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${b} (initial run, treating as empty):`,h?.message||h)}}as(t,s),t.children=s;const y=t.__ref;let p=!1;const A=T(t,t.childrenDeps,g),w=j(()=>{const h=p;p=!0;let b;try{b=A(t,t.state,t.context)}catch(P){if(typeof console<"u"&&console.error){const M=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${M}${h?"":" (initial tracking run)"}:`,P?.message||P)}return}if(!h||b===t.children)return;as(t,b),t.children=b,y.__childrenChunkGen!=null&&y.__childrenChunkGen++;const x=typeof t.onContentUpdate=="function",S=x?[]:null,k=x?[]:null,C=x?[]:null;if(Array.isArray(b)&&t.childrenAs==="state"){const P=t.childProps,M=[],yt=new Map;for(let E=0;E<b.length;E++){const U=b[E];let O=P;if(typeof P=="function")try{O=P(t,U)}catch{O=null}const K=qo(O&&O.key,U,E,t);M.push(K),yt.set(K,{rawChild:U,childProps:O})}const qs=new Set(M),Zs=y.__children.slice();for(const E of Zs)if(!qs.has(E)){const U=t[E];U?.remove&&U.remove(),delete t[E],k&&k.push(E)}const _t=t.childExtends,Mt=t.tag==="fragment",Qs=t.context?.document||globalThis.document,gt=Mt?null:Qs?.createDocumentFragment(),Xt=new Set;for(const E of M){const U=yt.get(E),O=U.rawChild,K=t[E];if(K&&K.state){if(O&&typeof O=="object"){const N=K.state,ct=N.$replace||N.replace,Oo=N.$update||N.update;try{if(typeof ct=="function")ct.call(N,O);else if(typeof Oo=="function"){for(const I in N)if(!(I==="__element"||I==="root"||I==="parent"||I==="update")&&!Object.prototype.hasOwnProperty.call(O,I))try{N[I]=void 0}catch{}Oo.call(N,O)}else for(const I in O)N[I]=O[I]}catch(I){if(typeof console<"u"&&console.error){const Js=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to patch at ${Js} (reconcile, keeping its previous data for this pass):`,I?.message||I)}}}C&&C.push(E);continue}let Jt=O;(typeof O=="string"||typeof O=="number")&&(Jt={value:O,text:O});const mt=U.childProps;let V=mt?{...mt,state:Jt}:{state:Jt};const Xs=typeof P=="function"?jt(mt):lt(t,"childProps");if(_t&&!V.ignoreChildExtends)if(V.extends){const N=Array.isArray(V.extends)?V.extends:[V.extends],ct=Array.isArray(_t)?_t:[_t];V={...V,extends:[...ct,...N]}}else V={...V,extends:_t};let to;try{to=X(Pt(V,Xs),t,E,o)}catch(N){if(typeof console<"u"&&console.error){const ct=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${E}" failed to construct at ${ct} (reconcile, skipping this row):`,N?.message||N)}Xt.add(E);continue}!Mt&&to?.node&&gt&&gt.appendChild(to.node),S&&S.push(E)}if(!Mt&&gt&&gt.childNodes.length&&t.node&&t.node.appendChild(gt),!Mt&&t.node){let E=null;for(const U of M){const O=t[U]?.node;if(!O)continue;const K=E?E.nextSibling:t.node.firstChild;O!==K&&t.node.insertBefore(O,K),E=O}}y.__children=Xt.size?M.filter(E=>!Xt.has(E)):M,x&&(S.length||k.length)&&Yo(t,{added:S,removed:k,kept:C}),Zt(t,!1);return}const ot=x?[...y.__children]:null;for(const P of[...y.__children]){const M=t[P];M?.remove&&M.remove(),delete t[P]}y.__children=[],Eo(t,b,o,!1,!0),Zt(t,!1),x&&Yo(t,{added:[...y.__children],removed:ot,kept:[]})},{depth:y.path.length,label:v(y,"children")});y.__effects.push(w)}const a=Eo(t,s,o,!0,c);if(n!=null&&!(n&&n.__ref)){let g=n;if(typeof g=="string"||typeof g=="number"?g={text:g}:typeof g!="object"&&(g={}),t.childProps&&(g=it(t.childProps,g)),e&&!g.ignoreChildExtends)if(g.extends){const p=Array.isArray(g.extends)?g.extends:[g.extends],A=Array.isArray(e)?e:[e];g={...g,extends:[...A,...p]}}else g={...g,extends:e};const y=Et(lt(t,"childProps"),lt(t,"content"));X(Pt(g,y),t,"content",o)}if(s&&!a)return;const r=t.context?.components||{},i=t.__ref&&t.__ref.__runtimeSource,f=i?{}:null;{const g=Object.keys(t);for(let y=0;y<g.length;y++){const p=g[y];if(!p.endsWith("Extends")||typeof t[p]!="string")continue;const A=p.slice(0,-7);if(!A||A.charCodeAt(0)<65||A.charCodeAt(0)>90)continue;const w={extends:t[p]};delete t[p];for(let h=y+1;h<g.length;h++){const b=g[h],x=b.charCodeAt(0);if(x>=65&&x<=90||B.has(b)||typeof t[b]=="function"&&(b.startsWith("on")||b.startsWith(".")))break;const S=t[b];S!==void 0&&(w[b]=S,delete t[b],f&&vt(i,b)&&(f[A]||(f[A]={}),f[A][b]=i[b]))}t[A]&&typeof t[A]=="object"?t[A]={...w,...t[A]}:t[A]=w}}const d=o?.mountYield===!0||t.yieldChildren===!0,u=Object.keys(t),l=g=>{if(B.has(g)||typeof t[g]!="object"||t[g]===null)return;const y=g.charCodeAt(0);if(y<65||y>90)return;let p=t[g];if(p.__ref)return;if(!p.extends&&!p.extend){const w=r[g]||r[`smbls.${g}`];w&&(p={...p,extends:w})}if(t.childProps&&(p=it(t.childProps,p)),e&&!p.ignoreChildExtends)if(p.extends){const w=Array.isArray(p.extends)?p.extends:[p.extends],h=Array.isArray(e)?e:[e];p={...p,extends:[...h,...w]}}else p={...p,extends:e};const A=i?Et(lt(t,"childProps"),Et(f[g]||null,lt(t,g))):null;X(Pt(p,A),t,g,o)};if(!d){for(const g of u)l(g);return}Lo();const _=g=>{for(let y=g;y<u.length;y++)if(l(u[y]),y+1<u.length&&Do()){const p=y+1;Mo(()=>_(p));return}};_(0),Ro()}function Ys(t,o,s){const{node:n}=t;if(!n)return;n.ref=t;const e=o?.tag==="fragment"?o.__ref?.__fragmentAnchor:null;if(e){const a=e.parentNode;if(a){if(s?.position==="before"&&s.node)a.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const r=s.node.nextSibling;a.insertBefore(n,r||e)}else a.insertBefore(n,e);return}}const c=o?.node||(o?.nodeType?o:null);if(c)if(s?.position==="before"&&s.node)c.insertBefore(n,s.node);else if(s?.position==="after"&&s.node){const a=s.node.nextSibling;a?c.insertBefore(n,a):c.appendChild(n)}else c.appendChild(n)}const Po=3;function Fe(t){return!t||t.__inBeforeUpdate||(t.__beforeUpdateFailCount||0)>=Po?!1:(t.__inBeforeUpdate=!0,!0)}function Qt(t,o){t&&(t.__inBeforeUpdate=!1,o?(t.__beforeUpdateFailCount=(t.__beforeUpdateFailCount||0)+1,t.__beforeUpdateFailCount===Po&&typeof console<"u"&&console.error&&console.error(`[DOMQL] onBeforeUpdate failed ${Po}x in a row on this element \u2014 pausing automatic retries until a future prop/state change re-arms it.`)):t.__beforeUpdateFailCount=0)}function D(t,o,s){const n=t.charAt(0).toLowerCase()+t.slice(1);bt(n,o,s);const e="on"+t,c=o[e];if(typeof c=="function"){const i=t==="Render"?"__inRender":t==="RenderRouter"?"__inRenderRouter":null;if(i){if(o.__ref[i])return!0;o.__ref[i]=!0}const f=o.context?.designSystem;f&&W(f);let d=!!i;try{const u=c(o,o.state,o.context,s);if(u&&typeof u.then=="function"){const l=o.__ref;return u.catch(_=>{$t(o,e,_)}).finally(()=>{i&&l&&(l[i]=!1)}),d=!1,!0}if(u===!1)return!1}catch(u){if($t(o,e,u),o.context?.strictMode)throw u}finally{f&&z(),d&&o.__ref&&(o.__ref[i]=!1)}}return!0}var pr=X;export{Po as BEFORE_UPDATE_MAX_CONSECUTIVE_FAILURES,Fe as acquireBeforeUpdateGuard,X as create,pr as default,ro as flushMounts,ur as isStaticCssProp,dr as recompileStaticCss,lr as reconcileAttrProp,Qt as releaseBeforeUpdateGuard,qt as resolveStyleBlock,Kt as writeAttr,Gt as writeElementText};
@@ -1 +1 @@
1
- import*as s from"@symbo.ls/css";if(!s.CSS_SHORTHAND_LONGHANDS||!s.CSS_LONGHAND_SHORTHANDS)throw new Error("@symbo.ls/element: the installed @symbo.ls/css does not export CSS_SHORTHAND_LONGHANDS / CSS_LONGHAND_SHORTHANDS (the CSS shorthand family table, packages/css/src/cssLonghands.js). This element needs the @symbo.ls/css published in the same release \u2014 update @symbo.ls/css.");const S=s.CSS_SHORTHAND_LONGHANDS,e=s.CSS_LONGHAND_SHORTHANDS,t=s.cssShorthandStatesLonghand||(()=>!1);export{e as CSS_LONGHAND_SHORTHANDS,S as CSS_SHORTHAND_LONGHANDS,t as cssShorthandStatesLonghand};
1
+ import*as e from"@symbo.ls/css";if(!e.CSS_SHORTHAND_LONGHANDS||!e.CSS_LONGHAND_SHORTHANDS)throw new Error("@symbo.ls/element: the installed @symbo.ls/css does not export CSS_SHORTHAND_LONGHANDS / CSS_LONGHAND_SHORTHANDS (the CSS shorthand family table, packages/css/src/cssLonghands.js). This element needs the @symbo.ls/css published in the same release \u2014 update @symbo.ls/css.");const a=e.CSS_SHORTHAND_LONGHANDS,N=e.CSS_LONGHAND_SHORTHANDS,r=e.cssShorthandStatesLonghand||(()=>!1),S=s=>s.charCodeAt(0)===45&&s.charCodeAt(1)===45,c=e.cssPropName||(s=>S(s)?s:s.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())),H=e.cssCamelName||(s=>S(s)?s:s.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()));export{N as CSS_LONGHAND_SHORTHANDS,a as CSS_SHORTHAND_LONGHANDS,H as cssCamelName,c as cssPropName,r as cssShorthandStatesLonghand};
@@ -1 +1 @@
1
- import{getObserver as c,setObserver as s}from"@symbo.ls/signal";import{destroyBridge as a}from"./bridge.js";function t(r){if(!r)return;const o=r.__ref;if(!o)return;const i=c();if(i){s(null);try{return t(r)}finally{s(i)}}o.__disposed=!0;try{typeof r.onBeforeRemove=="function"&&r.onBeforeRemove(r,r.state,r.context)}catch(e){console.error("[smbls] onBeforeRemove error:",e)}if(o.__bridge&&a(r),o.__effects){for(let e=0;e<o.__effects.length;e++)o.__effects[e].dispose();o.__effects.length=0}if(typeof o.__releaseMedia=="function"&&(o.__releaseMedia(),o.__releaseMedia=null),o.__eventCleanup){for(let e=0;e<o.__eventCleanup.length;e++)o.__eventCleanup[e]();o.__eventCleanup.length=0}if(o.__children){const e=o.__children.slice();o.__children.length=0;for(let _=0;_<e.length;_++){const f=r[e[_]];f&&f.__ref&&t(f)}}r.node?.parentNode?r.node.remove():r.tag==="fragment"&&o.__fragmentAnchor?.parentNode&&o.__fragmentAnchor.remove();const n=r.state?.$destroy||r.state?.destroy;if(typeof n=="function"&&r.state.__element===r&&n.call(r.state),r.parent?.__ref?.__children){const e=r.parent.__ref.__children.indexOf(r.key);e!==-1&&r.parent.__ref.__children.splice(e,1),delete r.parent[r.key]}try{typeof r.onRemove=="function"&&r.onRemove(r)}catch(e){console.error("[smbls] onRemove error:",e)}r.node=null,r.parent=null,r.__ref=null}function l(){t(this)}export{t as dispose,l as remove};
1
+ import{getObserver as n}from"@symbo.ls/signal";import{untrack as s}from"./runContext.js";import{destroyBridge as c}from"./bridge.js";function t(r){if(!r)return;const o=r.__ref;if(!o)return;if(n())return s(()=>t(r));o.__disposed=!0;try{typeof r.onBeforeRemove=="function"&&r.onBeforeRemove(r,r.state,r.context)}catch(e){console.error("[smbls] onBeforeRemove error:",e)}if(o.__bridge&&c(r),o.__effects){for(let e=0;e<o.__effects.length;e++)o.__effects[e].dispose();o.__effects.length=0}if(typeof o.__releaseMedia=="function"&&(o.__releaseMedia(),o.__releaseMedia=null),o.__eventCleanup){for(let e=0;e<o.__eventCleanup.length;e++)o.__eventCleanup[e]();o.__eventCleanup.length=0}if(o.__children){const e=o.__children.slice();o.__children.length=0;for(let _=0;_<e.length;_++){const f=r[e[_]];f&&f.__ref&&t(f)}}r.node?.parentNode?r.node.remove():r.tag==="fragment"&&o.__fragmentAnchor?.parentNode&&o.__fragmentAnchor.remove();const i=r.state?.$destroy||r.state?.destroy;if(typeof i=="function"&&r.state.__element===r&&i.call(r.state),r.parent?.__ref?.__children){const e=r.parent.__ref.__children.indexOf(r.key);e!==-1&&r.parent.__ref.__children.splice(e,1),delete r.parent[r.key]}try{typeof r.onRemove=="function"&&r.onRemove(r)}catch(e){console.error("[smbls] onRemove error:",e)}r.node=null,r.parent=null,r.__ref=null}function u(){t(this)}export{t as dispose,u as remove};
@@ -1 +1 @@
1
- const A=new WeakMap;function l(t){const r=[];return t.extends&&(Array.isArray(t.extends)?r.push(...t.extends):r.push(t.extends)),t.extend&&(Array.isArray(t.extend)?r.push(...t.extend):r.push(t.extend)),r}function h(t,r,e){const s=l(r);if(!s.length)return;const f=(t.context||e?.context||{}).components||{};for(let n=0;n<s.length;n++){const o=y(s[n],f);o&&o!==r&&p(t,o,e,new Set([r]))}}function y(t,r){if(typeof t=="string"){if(t.includes(">")){const e=t.split(">").map(c=>c.trim());let s=r[e[0]]||r[`smbls.${e[0]}`];for(let c=1;c<e.length&&s;c++)s=s[e[c]];return s||null}return r[t]||r[`smbls.${t}`]||null}return typeof t=="object"&&t!==null?t:null}function p(t,r,e,s=new Set){if(s.has(r))return;s.add(r);const c=l(r);if(c.length){const o=(t.context||e?.context||{}).components||{};for(let a=0;a<c.length;a++){const u=y(c[a],o);u&&p(t,u,e,s)}}const f=i(t);for(const n in r){if(n==="extends"||n==="extend")continue;const o=r[n];f&&f.set(n,f.rank),t[n]===void 0?o&&typeof o=="object"&&!Array.isArray(o)&&typeof o!="function"?t[n]={...o}:t[n]=o:typeof t[n]=="object"&&typeof o=="object"&&!Array.isArray(t[n])&&!Array.isArray(o)&&t[n]!==null&&o!==null?t[n]=x(t[n],o):t[n]=o}}function i(t){const r=t&&t.__ref;if(!r)return null;let e=r.__mergeLayer;return e||(e=r.__mergeLayer=new Map),e.rank=(e.rank||0)+1,e}function x(t,r){const e={...t};for(const s in r){const c=e[s],f=r[s];c&&f&&typeof c=="object"&&typeof f=="object"&&!Array.isArray(c)&&!Array.isArray(f)&&typeof c!="function"&&typeof f!="function"?e[s]=x(c,f):e[s]=f}return e}export{h as applyExtends,i as openMergeLayer};
1
+ import{CSS_PROPS_REGISTRY as A}from"css-in-props";import{CSS_LONGHAND_SHORTHANDS as x,CSS_SHORTHAND_LONGHANDS as _,cssPropName as g,cssCamelName as S}from"./cssLonghands.js";const N=new WeakMap;function l(r){const t=[];return r.extends&&(Array.isArray(r.extends)?t.push(...r.extends):t.push(r.extends)),r.extend&&(Array.isArray(r.extend)?t.push(...r.extend):t.push(r.extend)),t}function w(r,t,e){const n=l(t);if(!n.length)return;const c=(r.context||e?.context||{}).components||{};for(let s=0;s<n.length;s++){const o=p(n[s],c);o&&o!==t&&y(r,o,e,new Set([t]))}}function p(r,t){if(typeof r=="string"){if(r.includes(">")){const e=r.split(">").map(a=>a.trim());let n=t[e[0]]||t[`smbls.${e[0]}`];for(let a=1;a<e.length&&n;a++)n=n[e[a]];return n||null}return t[r]||t[`smbls.${r}`]||null}return typeof r=="object"&&r!==null?r:null}function y(r,t,e,n=new Set){if(n.has(t))return;n.add(t);const a=l(t);if(a.length){const o=(r.context||e?.context||{}).components||{};for(let u=0;u<a.length;u++){const i=p(a[u],o);i&&y(r,i,e,n)}}const c=L(r);for(const s in t){if(s==="extends"||s==="extend")continue;const o=t[s];c&&c.mark(s),r[s]===void 0?o&&typeof o=="object"&&!Array.isArray(o)&&typeof o!="function"?r[s]={...o}:r[s]=o:typeof r[s]=="object"&&typeof o=="object"&&!Array.isArray(r[s])&&!Array.isArray(o)&&r[s]!==null&&o!==null?r[s]=h(r[s],o):r[s]=o}}class k{constructor(){this.rank=0,this.ranks=null}mark(t){b(t)&&(this.ranks||(this.ranks=new Map),this.ranks.set(t,this.rank))}get(t){return this.ranks?this.ranks.get(t):void 0}get size(){return this.ranks?this.ranks.size:0}}const f=new Set;for(const r of[x,_])for(const t in r)f.add(t),f.add(S(t));const d=new Map;function b(r){const t=r.charCodeAt(0);if(t>=65&&t<=90||t>=48&&t<=57)return!1;let e=d.get(r);return e===void 0&&(e=!!A[r]||f.has(r)||r.indexOf("-")>=0&&!(r.charCodeAt(0)===45&&r.charCodeAt(1)===45)&&f.has(g(r)),d.set(r,e)),e}function L(r){const t=r&&r.__ref;if(!t)return null;let e=t.__mergeLayer;return e||(e=t.__mergeLayer=new k),e.rank++,e}function j(r){const t=r&&r.__ref&&r.__ref.__mergeLayer;if(!t||!t.ranks)return;let e;for(const n of t.ranks.values())if(e===void 0)e=n;else if(n!==e)return;t.ranks=null}function h(r,t){const e={...r};for(const n in t){const a=e[n],c=t[n];a&&c&&typeof a=="object"&&typeof c=="object"&&!Array.isArray(a)&&!Array.isArray(c)&&typeof a!="function"&&typeof c!="function"?e[n]=h(a,c):e[n]=c}return e}export{w as applyExtends,j as closeMergeLayer,L as openMergeLayer};