smbls 3.14.749 → 3.14.752
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/smbls.cjs +31 -31
- package/dist/smbls.embed.iife.js +6 -6
- package/dist/smbls.esm.js +31 -31
- package/dist/smbls.iife-string.js +2 -2
- package/dist/smbls.iife.js +31 -31
- package/package.json +3 -3
package/dist/smbls.embed.iife.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var SymbolsEmbed=(()=>{var ur=Object.defineProperty;var gi=Object.getOwnPropertyDescriptor;var yi=Object.getOwnPropertyNames;var mi=Object.prototype.hasOwnProperty;var k=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var se=(t,e)=>{for(var r in e)ur(t,r,{get:e[r],enumerable:!0})},bi=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of yi(e))!mi.call(t,s)&&s!==r&&ur(t,s,{get:()=>e[s],enumerable:!(n=gi(e,s))||n.enumerable});return t};var xi=t=>bi(ur({},"__esModule",{value:!0}),t);var yt,St,Pr=k(()=>{"use strict";yt=globalThis,St=yt.document});var Ne,Rr=k(()=>{"use strict";Pr();Ne=t=>typeof yt<"u"&&(yt.Node&&t instanceof yt.Node||yt.Window&&t instanceof yt.Window||t===yt||St!==void 0&&t===St)});var j,w,Ve,A,M,Dt,Mn,ue=k(()=>{"use strict";j=t=>t===null?!1:typeof t=="object"&&t.constructor===Object,w=t=>typeof t=="string",Ve=t=>typeof t=="number",A=t=>typeof t=="function",M=t=>Array.isArray(t),Dt=t=>t===null?!1:typeof t=="object",Mn=t=>t===void 0});var Ln,Dr=k(()=>{"use strict";Be();Ln=(t,e=[])=>t.reduce((r,n)=>Ir(r,Ht(n,{exclude:e}),e),{})});function Ue(t,e,r={}){let{bracketsLength:n=2}=r,s=n===3?"{{{":"{{";if(!t.includes(s))return t;let o=$i[n],i=e||this.state||{},c=this;return t.replace(o,(a,l,f,u)=>{let h=f.trim();if(u){let p=c?.context,y=p?.functions?.[u]||p?.utils?.[u]||p?.methods?.[u]||p?.snippets?.[u]||c?.[u];if(y&&typeof y=="function")try{return String(y.call(c,h)??"")}catch{return""}return""}if(l){let p=(l.match(/\.\.\//g)||[]).length,y=i;for(let m=0;m<p;m++){if(!y||!y.parent)return"";y=y.parent}if(h==="parent")return String(y.value??"");let d=de(y,h);return String(d??"")}else{let p=de(i,h);if(p!=null)return String(p);let y=c?.context?.polyglot;if(y?.translations){let d=i?.root?.lang||i?.lang||c?.context?.state?.lang||y.defaultLang||"en",m=y.translations[d];if(m){let b=de(m,h);if(b!=null&&typeof b!="object")return String(b);for(let g in m){let _=m[g];if(_&&typeof _=="object"&&!Array.isArray(_)){let S=de(_,h);if(S!=null&&typeof S!="object")return String(S)}}}let x=de(y.translations,h);if(x!=null&&typeof x!="object")return String(x)}return""}})}var $i,de,Fn=k(()=>{"use strict";$i={2:/{{\s*((?:\.\.\/)*)([\w\d.]+)\s*(?:\|\s*([\w\d.]+))?\s*}}/g,3:/{{{(\s*(?:\.\.\/)*)([\w\d.]+)\s*(?:\|\s*([\w\d.]+))?\s*}}}/g},de=(t,e)=>e.split(".").reduce((r,n)=>r?.[n],t)});var Ti,Pi,Ri,Nn,jr=k(()=>{"use strict";Ti=new Set(["update","parse","clean","create","destroy","add","toggle","remove","apply","set","reset","replace","quietReplace","quietUpdate","applyReplace","applyFunction","keys","values","ref","rootUpdate","parentUpdate","parent","__element","__depends","__ref","__children","root","setByPath","setPathCollection","removeByPath","removePathCollection","getByPath"]),Pi=new Set(["update","__element"]),Ri=new Set(["set","reset","update","remove","updateContent","removeContent","lookup","lookdown","lookdownAll","getRef","getPath","setNodeStyles","spotByPath","keys","parse","setProps","parseDeep","variables","if","log","verbose","warn","error","call","nextElement","previousElement","getRootState","getRoot","getRootData","getRootContext","getContext","getQuery","getDB","getChildren","preventContentUpdate","preventContentRecreate"]),Nn=new Set(["node","context","extends","__element","__ref",...Ri,...Ti,...Pi])});var Vn,qt,Ir,Bn,Ht,Be=k(()=>{"use strict";ue();Dr();Rr();jr();Vn=t=>t.charCodeAt(0)===95&&t.charCodeAt(1)===95,qt=(t,e,r,n)=>{if(A(t))return e?typeof t.call!="function"?t:t.call(e,e,r||e.state,n||e.context):void 0;if(t!=null&&e?.context?.plugins&&(M(t)||j(t)&&!Ne(t))){let s=e.context.plugins;for(let o of s)if(o.resolveHandler){let i=o.resolveHandler(t,e);if(typeof i=="function")return qt(i,e,r,n)}}return t},Ir=(t,e,r=Nn)=>Bn(t,e,r,null),Bn=(t,e,r,n)=>{if(t===e)return t;if(n){for(let o=0;o<n.length;o+=2)if(n[o]===t&&n[o+1]===e)return t}let s=r instanceof Set;for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o)||Vn(o)||o==="constructor"||o==="prototype"||(s?r.has(o):r.includes(o)))continue;let i=t[o],c=e[o];if(Dt(i)&&Dt(c)){let a=n||[];a.push(t,e),Bn(i,c,r,a),a.length-=2}else i===void 0&&(t[o]=c)}return t},Ht=(t,e={})=>{let{exclude:r=[],cleanUndefined:n=!1,cleanNull:s=!1,visited:o=new WeakMap,handleExtends:i=!1}=e;if(!Dt(t)||Ne(t))return t;if(o.has(t))return o.get(t);let c=r instanceof Set?r:r.length>3?new Set(r):null,a=u=>c?c.has(u):r.includes(u),l=M(t)?[]:{};o.set(t,l);let f=[[t,l]];for(;f.length;){let[u,h]=f.pop();for(let p in u){if(!Object.prototype.hasOwnProperty.call(u,p)||Vn(p)||p==="__proto__"||a(p))continue;let y=u[p];if(!(n&&y===void 0)&&!(s&&y===null)){if(Ne(y)){h[p]=y;continue}if(i&&p==="extends"&&M(y)){h[p]=Ln(y,r);continue}if(A(y)){h[p]=y;continue}if(Dt(y))if(o.has(y))h[p]=o.get(y);else{let d=M(y)?[]:{};o.set(y,d),h[p]=d,f.push([y,d])}else h[p]=y}}}return l}});var Un=k(()=>{"use strict"});var Wn,Di,Mr,At,zn=k(()=>{"use strict";Wn="production",Di=(t=Wn)=>t==="production",Mr=(t=Wn)=>!Di(t),At=t=>{let e=t&&"env"in t?t.env:typeof process<"u"&&process.env?"production":void 0;if(e&&e!=="production")return!0;let r=t&&"hostname"in t?t.hostname:typeof location<"u"?location.hostname:void 0;return typeof r=="string"&&r?r==="localhost"||r==="127.0.0.1"||r.endsWith(".localhost"):!1}});var wt,We=k(()=>{"use strict";wt=(t,e,...r)=>{let n=e?.context?.plugins;if(!n)return!1;let s=!1;for(let o of n)typeof o[t]=="function"&&(o[t](e,...r),s=!0);return s}});var Gn=k(()=>{"use strict"});var Hn=k(()=>{"use strict"});var zf,qn=k(()=>{"use strict";zf=typeof navigator>"u"?!1:/Mobi/.test(navigator.userAgent)});var Kn=k(()=>{"use strict"});var Qn=k(()=>{"use strict"});var Jn=k(()=>{"use strict"});var Xn=k(()=>{"use strict"});var Yn=k(()=>{"use strict"});var Zn=k(()=>{"use strict"});var to=k(()=>{"use strict"});var eo=k(()=>{"use strict"});var ro,Lr=k(()=>{"use strict";ro={}});var oo={};se(oo,{restAdapter:()=>no,setup:()=>ji});var Ii,Et,ji,no,so=k(()=>{"use strict";Ii=(t,e,r)=>{let n=e&&!e.startsWith("/")?"/":"",s=new URL(`${t}${n}${e}`);if(r)for(let o in r){let i=r[o];i!=null&&s.searchParams.set(o,typeof i=="object"?JSON.stringify(i):i)}return s.toString()},Et=async(t,e)=>{let r=await globalThis.fetch(t,e),n=r.headers.get("content-type"),s=n&&n.includes("json")?await r.json():await r.text();return{data:s,error:r.ok?null:s?.message||s?.error||r.statusText,status:r.status}},ji=async({url:t,headers:e,auth:r,fetchOptions:n})=>{if(!t)throw new Error("@symbo.ls/fetch rest: url is required");return no(t,e,r,n)},no=(t,e={},r,n={})=>{let s=r?.token||null,o=f=>{let u={...e,...f};return s&&(u.Authorization=`Bearer ${s}`),u},i=f=>({...o(f),"Content-Type":"application/json"}),c=f=>({...n,...f}),a=(f,u)=>{let h=u||t;if(f&&(f.startsWith("http://")||f.startsWith("https://")))return f;let p=f&&!f.startsWith("/")?"/":"";return`${h}${p}${f||""}`};return{name:"rest",setToken:f=>{s=f},getSession:async()=>{if(!r?.sessionUrl)return s?{token:s}:null;let f=await Et(a(r.sessionUrl,r.baseUrl),c({headers:o()}));return f.error?null:f.data},signIn:async f=>{if(!r?.signInUrl)throw new Error("rest: auth.signInUrl not configured");let u=await Et(a(r.signInUrl,r.baseUrl),c({method:"POST",headers:i(),body:JSON.stringify(f)}));return u.data?.token&&(s=u.data.token),u},signOut:async()=>(r?.signOutUrl&&await Et(a(r.signOutUrl,r.baseUrl),c({method:"POST",headers:o()})),s=null,{error:null}),select:({from:f,params:u,select:h,limit:p,offset:y,order:d,single:m,headers:x,baseUrl:b})=>{let g={...u};return h&&(g.select=h),p&&(g.limit=p),y&&(g.offset=y),m&&(g.single=!0),d&&(typeof d=="string"?g.order=d:Array.isArray(d)?g.order=d.map(_=>`${_.by}:${_.asc===!1?"desc":"asc"}`).join(","):d.by&&(g.order=`${d.by}:${d.asc===!1?"desc":"asc"}`)),Et(Ii(b||t,f||"",g),c({headers:o(x)}))},rpc:({from:f,params:u,headers:h,baseUrl:p})=>Et(a(`rpc/${f}`,p),c({method:"POST",headers:i(h),body:JSON.stringify(u)})),insert:({from:f,data:u,headers:h,baseUrl:p})=>Et(a(f,p),c({method:"POST",headers:i(h),body:JSON.stringify(u)})),update:({from:f,data:u,params:h,method:p,headers:y,baseUrl:d})=>{let m=h?.id||u?.id,x=m?`${f}/${m}`:f;return Et(a(x,d),c({method:p||"PATCH",headers:i(y),body:JSON.stringify(u)}))},upsert:({from:f,data:u,params:h,method:p,headers:y,baseUrl:d})=>{let m=h?.id||u?.id,x=m?`${f}/${m}`:f;return Et(a(x,d),c({method:p||"PUT",headers:i(y),body:JSON.stringify(u)}))},delete:({from:f,params:u,headers:h,baseUrl:p})=>{let y=u?.id,d=y?`${f}/${y}`:f;return Et(a(d,p),c({method:"DELETE",headers:o(h)}))}}}});var co={};se(co,{localAdapter:()=>io,setup:()=>Li});var ze,Mi,Li,io,ao=k(()=>{"use strict";ze=(t,e)=>{if(!e)return!0;for(let r in e){let n=e[r];if(n===null){if(t[r]!==null&&t[r]!==void 0)return!1}else if(Array.isArray(n)){if(!n.includes(t[r]))return!1}else if(typeof n=="object"){for(let s in n)if(s==="gt"&&!(t[r]>n[s])||s==="gte"&&!(t[r]>=n[s])||s==="lt"&&!(t[r]<n[s])||s==="lte"&&!(t[r]<=n[s])||s==="neq"&&t[r]===n[s]||s==="like"&&!String(t[r]).includes(n[s]))return!1}else if(t[r]!==n)return!1}return!0},Mi=(t,{order:e,limit:r,offset:n,single:s})=>{let o=[...t];if(e){let i=typeof e=="string"?e:e.by,c=e.asc!==!1;o.sort((a,l)=>a[i]<l[i]?c?-1:1:a[i]>l[i]?c?1:-1:0)}return n&&(o=o.slice(n)),r&&(o=o.slice(0,r)),s?{data:o[0]||null,error:null}:{data:o,error:null}},Li=async({data:t,...e})=>io(t,e),io=(t={},e={})=>{let r={},n={},s=e.persist!==!1&&typeof localStorage<"u",o=e.prefix||"smbls_db_",i=f=>{if(!r[f])if(s)try{let u=localStorage.getItem(o+f);r[f]=u?JSON.parse(u):t[f]||[]}catch{r[f]=t[f]||[]}else r[f]=t[f]||[];return r[f]},c=f=>{if(s)try{localStorage.setItem(o+f,JSON.stringify(r[f]))}catch{}},a=(f,u,h,p)=>{let y=n[f];if(y)for(let d of y)d(h,p,{event:u,table:f})},l=Date.now();return{name:"local",store:r,select:async({from:f,params:u,...h})=>{let y=i(f).filter(d=>ze(d,u));return Mi(y,h)},insert:async({from:f,data:u})=>{let h=i(f),y=(Array.isArray(u)?u:[u]).map(d=>{let m={id:d.id||++l,...d};return h.push(m),m});c(f);for(let d of y)a(f,"INSERT",d,null);return{data:Array.isArray(u)?y:y[0],error:null}},update:async({from:f,data:u,params:h})=>{let p=i(f),y=[];for(let d=0;d<p.length;d++)if(ze(p[d],h)){let m={...p[d]};Object.assign(p[d],u),y.push(p[d]),a(f,"UPDATE",p[d],m)}return c(f),{data:y,error:null}},upsert:async({from:f,data:u,params:h})=>{let p=i(f),y=Array.isArray(u)?u:[u],d=[];for(let m of y){let x=h||(m.id!==void 0?{id:m.id}:null),b=x?p.findIndex(g=>ze(g,x)):-1;if(b>-1){let g={...p[b]};Object.assign(p[b],m),d.push(p[b]),a(f,"UPDATE",p[b],g)}else{let g={id:m.id||++l,...m};p.push(g),d.push(g),a(f,"INSERT",g,null)}}return c(f),{data:Array.isArray(u)?d:d[0],error:null}},delete:async({from:f,params:u})=>{let h=i(f),p=[];for(let y=h.length-1;y>=0;y--)ze(h[y],u)&&(p.push(h[y]),h.splice(y,1),a(f,"DELETE",null,p[p.length-1]));return c(f),{data:p,error:null}},subscribe:({from:f,on:u},h)=>{n[f]||(n[f]=[]);let p=(y,d,m)=>{u&&u!=="*"&&u!==m.event||h(y,d,m)};return n[f].push(p),()=>{let y=n[f].indexOf(p);y>-1&&n[f].splice(y,1)}}}}});var Se={};se(Se,{createAdapter:()=>Wi,default:()=>tc,executeFetch:()=>Ur,fetchPlugin:()=>Zi,initAdapterAuth:()=>Qe,parseDuration:()=>ye,queryClient:()=>Yi,registerAdapter:()=>Ui,resolveDb:()=>po});var Fi,Ni,Ge,he,He,ge,Vi,Bi,Ui,Wi,po,ye,Z,ho,pe,zi,_e,me,be,qe,Vr,Ke,Gi,fo,Fr,go,yo,Kt,lo,Hi,uo,qi,Je,mo,bo,Qe,Br,ut,mt,xe,Vt,kt,It,Ki,Qi,Ji,Nr,Xi,Ur,Yi,Zi,tc,we=k(()=>{"use strict";V();Fi=["select","rpc","insert","update","upsert","delete","subscribe"],Ni={rest:()=>Promise.resolve().then(()=>(so(),oo)),local:()=>Promise.resolve().then(()=>(ao(),co))},Ge=Symbol.for("@symbo.ls/fetch:CUSTOM_ADAPTERS"),he=(()=>{if(typeof globalThis<"u"&&globalThis[Ge])return globalThis[Ge];let t={};if(typeof globalThis<"u")try{return Object.defineProperty(globalThis,Ge,{value:t,writable:!1,configurable:!1,enumerable:!1}),globalThis[Ge]}catch{}return t})(),He=Symbol.for("@symbo.ls/fetch:PENDING_ADAPTERS"),ge=(()=>{if(typeof globalThis<"u"&&globalThis[He])return globalThis[He];let t={};if(typeof globalThis<"u")try{return Object.defineProperty(globalThis,He,{value:t,writable:!1,configurable:!1,enumerable:!1}),globalThis[He]}catch{}return t})(),Vi=5e3,Bi=t=>new Promise(e=>{if(he[t])return e(he[t]);let r=ge[t]||(ge[t]=[]),n=!1,s=()=>{n||(n=!0,e(he[t]||null))};r.push(s),setTimeout(s,Vi)}),Ui=(t,e)=>{he[t]=e;let r=ge[t];if(r&&r.length){ge[t]=[];for(let n of r)n()}},Wi=t=>{let e={};for(let r of Fi)t[r]&&(e[r]=t[r]);return e.name=t.name||"custom",e},po=async t=>{if(!t)return null;if(typeof t.select=="function")return t;let{adapter:e,...r}=t,n=typeof e=="string"?e:typeof t=="string"?t:null;if(!n)return null;let s=he[n]||Ni[n];if(!s&&(s=await Bi(n),!s))throw new Error(`Unknown db adapter: "${n}". Use registerAdapter() for adapters with optional deps.`);let o=await s();if(!o||typeof o.setup!="function")throw new Error(`Adapter "${n}" loader returned a module without a setup() function. Got keys: [${Object.keys(o||{}).join(", ")}]. Likely a bundler chunk-resolution issue.`);return o.setup(r)},ye=t=>{if(!t)return 0;if(typeof t=="number")return t;let e=t.match(/^(\d+)(ms|s|m|h)$/);if(!e)return 0;let r=parseInt(e[1]),n=e[2];return n==="ms"?r:n==="s"?r*1e3:n==="m"?r*6e4:n==="h"?r*36e5:0},Z=new Map,ho=new Map,pe=new Map,zi=(t,e,r)=>{if(t.cache?.key)return t.cache.key;let n=qi(t.params),s=r?`${r}:`:"",o=`${t.from}:${t.method}:${s}${JSON.stringify(n||"")}`;return e?`${o}:${e}`:o},_e=t=>Z.get(t)||null,me=(t,e,r)=>{let n=Z.get(t),s={data:e,error:r,time:Date.now(),stale:!1};Z.set(t,s);let o=ho.get(t);if(o)for(let i of o)A(i)&&i(s);return s},be=t=>{if(t){let e=Z.get(t);e&&(e.stale=!0);return}for(let[,e]of Z)e.stale=!0},qe=t=>{if(t){Z.delete(t);return}Z.clear()},Vr=t=>!t&&t!==!1?{staleTime:6e4,gcTime:3e5}:t===!1?null:t===!0?{staleTime:6e4,gcTime:3e5}:typeof t=="number"?{staleTime:t,gcTime:Math.max(t*5,3e5)}:w(t)?{staleTime:ye(t),gcTime:3e5}:{staleTime:ye(t.stale||t.staleTime)||6e4,gcTime:ye(t.gc||t.gcTime||t.expire)||3e5,key:t.key},Ke=null,Gi=()=>{Ke||(Ke=setInterval(()=>{let t=Date.now();for(let[e,r]of Z){let n=ho.get(e);!(n&&n.size>0)&&t-r.time>(r.gcTime||3e5)&&Z.delete(e)}},3e4),Ke.unref&&Ke.unref())};Gi();fo=3,Fr=t=>Math.min(1e3*2**t,3e4),go=t=>{let e=t.retry;return e===!1?{count:0}:e===!0||e===void 0?{count:fo,delay:Fr}:typeof e=="number"?{count:e,delay:Fr}:{count:e.count??fo,delay:A(e.delay)?e.delay:typeof e.delay=="number"?()=>e.delay:Fr}},yo=async(t,e)=>{let{count:r,delay:n}=e,s;for(let o=0;o<=r;o++)try{let i=await t();if(i?.error){if(s=i.error,o<r){let c=A(n)?n(o,s):n;await new Promise(a=>setTimeout(a,c));continue}return i}return i}catch(i){if(s=i,o<r){let c=A(n)?n(o,i):n;await new Promise(a=>setTimeout(a,c));continue}throw i}return{data:null,error:s}},Kt={focus:new Set,online:new Set},lo=!1,Hi=()=>{if(lo||typeof window>"u")return;lo=!0;let t=()=>{for(let r of Kt.focus)r()},e=()=>{for(let r of Kt.online)r()};window.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&t()}),window.addEventListener("focus",t),window.addEventListener("online",e)},uo=(t,e)=>{let r=e.__ref;if(t===!0)return{from:r.__state||e.key,method:"select",query:!0,on:"create"};if(w(t))return{from:t,method:"select",query:!0,on:"create"};if(j(t)){let n={...t};return n.from=n.from||r.__state||e.key,n.method=n.method||"select",n.on=n.on||"create",n.query===void 0&&(n.query=!0),n}return null},qi=t=>(!t||A(t),t),Je=(t,e)=>{let r=t?.state?.root||e?.state?.root;if(r?.lang)return r.lang},mo=(t,e)=>{let n=(t?.state?.root||e?.state?.root)?.__fetchScope;return n?String(n):void 0},bo=(t,e,r)=>{let n;if(!t)n=void 0;else if(A(t))n=t(e,e.state);else{n={};for(let s in t){let o=t[s];n[s]=A(o)?o(e,e.state):o}}return n},Qe=async(t,e)=>{if(!t||t.__authInitialized||(t.__authInitialized=!0,!t.getSession))return;let r=(n,s)=>{let o=e.state?.root;o?.update&&o.update({auth:{user:n,session:s,loading:!1}})};try{let n=await t.getSession();r(n?.user||null,n)}catch(n){console.warn("[fetch] Failed to restore auth session:",n.message)}t.onAuthStateChange&&t.onAuthStateChange((n,s)=>{r(s?.user||null,s)})},Br=async(t,e)=>{if(A(t.select))return t.auth!==!1&&await Qe(t,e),t;if(t.__resolved)return t.auth!==!1&&await Qe(t.__resolved,e),t.__resolved;if(t.__resolving)return t.__resolving;t.__resolving=po(t);let r=await t.__resolving;return delete t.__resolving,r?(r.auth=t.auth,r.url=t.url,r.key=t.key,t.__resolved=r,e.fetch=r,t.auth!==!1&&await Qe(r,e),r):null},ut=(t,e,...r)=>{let n=A(t[e])?t[e]:null;n&&n.call(t,...r,t,t.state,t.context)},mt=(t,e,r,...n)=>{let s=t&&A(t[r])?t[r]:null;s&&s.call(e,...n,e,e.state,e.context)},xe=t=>{let e={},r=t.node;if(!r)return e;if(r.tagName==="FORM"){let s=new FormData(r);for(let[o,i]of s.entries())e[o]=i;return e}let n=r.querySelectorAll("input, textarea, select");for(let s=0;s<n.length;s++){let o=n[s],i=o.name||o.getAttribute("name");i&&(o.type==="checkbox"?e[i]=o.checked:o.type==="file"?e[i]=o.files:e[i]=o.value)}return e},Vt=(t,e,r,n={})=>{let s=r&&r.startsWith("~/"),o=s&&t.state?.root||t.state;if(o?.update)if(s){let i=r.slice(2);e&&typeof e=="object"&&!Array.isArray(e)&&i in e?o.update(e,{preventFetch:!0,...n}):o.update({[i]:e},{preventFetch:!0,...n})}else{let i=r?{[r]:e}:e;o.update(i,{preventFetch:!0,...n})}},kt=(t,e)=>{let r=t?.__ref;r&&(r.__fetchStatus=e,r.__fetching=e.isFetching,r.__fetchError=e.error)},It=async(t,e,r,n={})=>{let s=r?.fetch;if(!s||!e||!e.__ref||t.enabled===!1||A(t.enabled)&&!t.enabled(e,e.state)||t.skip===!0||A(t.skip)&&t.skip(e,e.state))return;let o=await Br(s,r);if(!o||!e.__ref)return;let i=e.__ref,{from:c,method:a,query:l,params:f,cache:u,transform:h,single:p,auth:y,fields:d,as:m,limit:x,offset:b,order:g,headers:_,baseUrl:S,page:v,cursor:D,getNextPageParam:nt,getPreviousPageParam:L,infinite:q,placeholderData:it,initialData:Tt,select:K,keepPreviousData:ot}=t,O=w(K)?K:void 0;if(l&&A(e.getQuery)){let I=e.getQuery(o.name||"paths");I&&(O=I.select||I.length&&I.join(",")||O)}let F=bo(f,e,r),$=Vr(u),tt=go(t),Ft=Je(e,r),ne=mo(e,r),ct=Ft?`:${Ft}`:"",oe=ne?`${ne}:`:"",T=$?u?.key||`${c}:${a}:${oe}${JSON.stringify(F||"")}${q?":infinite":""}${v?":p"+JSON.stringify(v):""}${ct}`:null;if(!i.__fetchInitialized&&T&&(i.__fetchInitialized=!0,Tt!==void 0)){let I=A(Tt)?Tt():Tt;me(T,I,null)}if((a==="select"||a==="rpc")&&T&&$){let I=_e(T);if(I&&!I.error){let R=Date.now()-I.time,B=I.stale||R>($.staleTime||0),E=I.data;if(A(K)&&(E=K(E,e,e.state)),h&&(E=h(E,e,e.state)),Vt(e,E,m),!B){kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!0,error:null,status:"success",fetchStatus:"idle"});return}}else if(it!==void 0){let R=A(it)?it(e,e.state):it;R!==void 0&&Vt(e,R,m)}}if(T&&pe.has(T)&&!n.force){let I=pe.get(T);try{let R=await Promise.race([I,new Promise((B,E)=>setTimeout(()=>E("DEDUP_TIMEOUT"),15e3))]);if(R?.data!==void 0){let B=R.data;A(K)&&(B=K(B,e,e.state)),h&&(B=h(B,e,e.state)),Vt(e,B,m),ut(e,"onFetchComplete",B),mt(t,e,"onFetchComplete",B)}}catch{}return}let Pt=!_e(T)?.data;kt(e,{isFetching:!0,isLoading:Pt,isStale:!1,isSuccess:!1,error:null,status:"pending",fetchStatus:"fetching"}),ut(e,"onFetchStart"),mt(t,e,"onFetchStart");let at=r?.analyze?.emitNetwork,st=at?typeof performance<"u"?performance.now():Date.now():0;at&&at({phase:"start",mode:"query",from:c,method:a,cacheKey:T,lang:Ft});let vn=yo(async()=>{if(y!==!1&&o.auth!==!1&&o.getSession){let E=await o.getSession();if(y===!0&&!E){let Y={message:"Not authenticated"};return kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:Y,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",Y),mt(t,e,"onFetchError",Y),{data:null,error:Y}}}let I=o[a];if(!A(I))return{data:null,error:{message:`Method "${a}" not found on adapter`}};let R={from:c,select:O,params:F,single:p,limit:x,offset:b,order:g,headers:_,baseUrl:S},B=Je(e,r);if(B&&(R.headers={...R.headers,"Accept-Language":B}),v!==void 0){if(j(v))v.offset!==void 0&&(R.offset=v.offset),v.limit!==void 0&&(R.limit=v.limit),v.cursor!==void 0&&(R.params={...R.params,cursor:v.cursor});else if(typeof v=="number"){let E=t.pageSize||x||20;R.offset=(v-1)*E,R.limit=E}}if(D!==void 0&&(R.params={...R.params,cursor:D}),a==="insert"||a==="update"||a==="upsert"){let E;if(d===!0||t.on==="submit")E=xe(e);else if(M(d)){let Y=xe(e);E={};for(let lr of d)E[lr]=Y[lr]}else e.state?.parse?E=e.state.parse():j(e.state)&&(E={...e.state});h&&(E=h(E,e,e.state)),R.data=E}if(a==="rpc"){let E=F;if(t.on==="submit"){let Y=xe(e);E=t.transformParams?t.transformParams(Y,e,e.state):Y}R.params=E}if(a==="subscribe"){let E=o.subscribe({from:c,params:F,on:t.subscribeOn},(Y,lr,cf)=>{Vt(e,Y,m),ut(e,"onFetchComplete",Y),mt(t,e,"onFetchComplete",Y)});return i.__unsubscribe=E,{data:null,error:null,subscribed:!0}}return I(R)},tt);T&&pe.set(T,vn);try{let I=await vn;if(I?.subscribed)return;let{data:R,error:B}=I||{};if(B){T&&me(T,null,B),kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:B,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",B),mt(t,e,"onFetchError",B),at&&at({phase:"error",mode:"query",from:c,method:a,cacheKey:T,error:B.message||B,durationMs:(typeof performance<"u"?performance.now():Date.now())-st});return}if(R!==void 0){if((a==="select"||a==="rpc")&&T){let Y=me(T,R,null);Y.gcTime=$?.gcTime||3e5}let E=R;q&&M(R)&&(i.__pages||(i.__pages=[]),n.direction==="previous"?i.__pages.unshift(R):i.__pages.push(R),E=i.__pages.flat(),nt&&(i.__nextPageParam=nt(R,i.__pages),i.__hasNextPage=i.__nextPageParam!=null),L&&(i.__prevPageParam=L(R,i.__pages),i.__hasPreviousPage=i.__prevPageParam!=null)),A(K)&&(E=K(E,e,e.state)),h&&(E=h(E,e,e.state)),(!ot||E!==void 0)&&Vt(e,E,m),kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!0,error:null,status:"success",fetchStatus:"idle"}),ut(e,"onFetchComplete",E),mt(t,e,"onFetchComplete",E),at&&at({phase:"success",mode:"query",ok:!0,from:c,method:a,cacheKey:T,durationMs:(typeof performance<"u"?performance.now():Date.now())-st})}}catch(I){kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:I,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",I),mt(t,e,"onFetchError",I),at&&at({phase:"error",mode:"query",from:c,method:a,cacheKey:T,error:I.message||String(I),durationMs:(typeof performance<"u"?performance.now():Date.now())-st})}finally{T&&pe.delete(T)}},Ki=(t,e,r)=>{let n=t.on,s=e.__ref;s.__fetchListeners||(s.__fetchListeners=[]);let o=t.__runner||It;if(n==="submit"){let i=a=>{a.preventDefault(),o(t,e,r)},c=e.node;c&&(c.addEventListener("submit",i),s.__fetchListeners.push(()=>c.removeEventListener("submit",i)))}else if(n==="click"){let i=()=>o(t,e,r),c=e.node;c&&(c.addEventListener("click",i),s.__fetchListeners.push(()=>c.removeEventListener("click",i)))}else n==="stateChange"&&(s.__fetchOnStateChange=()=>o(t,e,r))},Qi=(t,e,r)=>{let n=e.__ref;n.__fetchCleanups||(n.__fetchCleanups=[]),Hi();let s=t.refetchInterval;if(s){let o=typeof s=="number"?s:ye(s);if(o>0){let i=setInterval(()=>{(t.refetchIntervalInBackground||typeof document>"u"||document.visibilityState==="visible")&&It(t,e,r,{force:!0})},o);n.__fetchCleanups.push(()=>clearInterval(i))}}if(t.refetchOnWindowFocus!==!1){let o=()=>{let i=Je(e,r),c=mo(e,r),a=zi(t,i,c),l=_e(a),f=Vr(t.cache);(!l||l.stale||Date.now()-l.time>(f?.staleTime||0))&&It(t,e,r,{force:!0})};Kt.focus.add(o),n.__fetchCleanups.push(()=>Kt.focus.delete(o))}if(t.refetchOnReconnect!==!1){let o=()=>It(t,e,r,{force:!0});Kt.online.add(o),n.__fetchCleanups.push(()=>Kt.online.delete(o))}},Ji=(t,e,r)=>{if(!e.optimistic)return null;let n=t.__ref,s=e.as,o=t.state?.parse?t.state.parse():j(t.state)?{...t.state}:t.state;n.__optimisticSnapshot=o;let i=A(e.optimistic)?e.optimistic(r,o,t):e.optimistic;return i!==void 0&&Vt(t,i,s),o},Nr=(t,e)=>{let r=t.__ref,n=r.__optimisticSnapshot;n!==void 0&&(Vt(t,n,e.as),delete r.__optimisticSnapshot)},Xi=async(t,e,r)=>{let n=r?.fetch;if(!n)return;let s=await Br(n,r);if(!s)return;let o=e.__ref,{method:i,from:c,fields:a,transform:l,as:f,on:u,auth:h,headers:p,baseUrl:y,invalidates:d,optimistic:m,onMutate:x,onSuccess:b,onError:g,onSettled:_}=t,S;if(a===!0||u==="submit")S=xe(e);else if(M(a)){let L=xe(e);S={};for(let q of a)S[q]=L[q]}else e.state?.parse?S=e.state.parse():j(e.state)&&(S={...e.state});l&&(S=l(S,e,e.state)),A(x)&&x(S,e,e.state);let v=m?Ji(e,t,S):null;o.__fetching=!0,kt(e,{isFetching:!0,isLoading:!1,isStale:!1,isSuccess:!1,error:null,status:"pending",fetchStatus:"fetching"}),ut(e,"onFetchStart"),mt(t,e,"onFetchStart");let D=r?.analyze?.emitNetwork,nt=D?typeof performance<"u"?performance.now():Date.now():0;D&&D({phase:"start",mode:"mutation",from:c,method:i});try{if(h!==!1&&s.auth!==!1&&s.getSession){let F=await s.getSession();if(h===!0&&!F){v!==void 0&&Nr(e,t);let $={message:"Not authenticated"};ut(e,"onFetchError",$),mt(t,e,"onFetchError",$);return}}let L=s[i];if(!A(L))return;let q={from:c,data:S,headers:p,baseUrl:y};t.params&&(q.params=bo(t.params,e,r));let it=Je(e,r);it&&(q.headers={...q.headers,"Accept-Language":it});let Tt=go(t),K=await yo(()=>L(q),Tt),{data:ot,error:O}=K||{};if(O){v!==void 0&&Nr(e,t),kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:O,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",O),A(g)&&g(O,S,e),A(_)&&_(null,O,S,e),D&&D({phase:"error",mode:"mutation",from:c,method:i,error:O.message||String(O),durationMs:(typeof performance<"u"?performance.now():Date.now())-nt});return}if(delete o.__optimisticSnapshot,ot!==void 0){let F=f?{[f]:ot}:ot;e.state?.update&&e.state.update(F,{preventFetch:!0})}if(kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!0,error:null,status:"success",fetchStatus:"idle"}),ut(e,"onFetchComplete",ot),mt(t,e,"onFetchComplete",ot),A(b)&&b(ot,S,e),A(_)&&_(ot,null,S,e),D&&D({phase:"success",mode:"mutation",ok:!0,from:c,method:i,durationMs:(typeof performance<"u"?performance.now():Date.now())-nt}),d){let F=M(d)?d:[d];for(let $ of F)if($===!0||$==="*")for(let[tt]of Z)tt.startsWith(c+":")&&be(tt);else be($)}}catch(L){v!==void 0&&Nr(e,t),kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:L,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",L),mt(t,e,"onFetchError",L),A(g)&&g(L,S,e),A(_)&&_(null,L,S,e),D&&D({phase:"error",mode:"mutation",from:c,method:i,error:L.message||String(L),durationMs:(typeof performance<"u"?performance.now():Date.now())-nt})}finally{o.__fetching=!1}},Ur=(t,e,r,n)=>{if(!t||!n?.fetch)return;let o=qt(t,e);if(!o)return;let i=M(o)?o.map(a=>uo(qt(a,e),e)).filter(Boolean):[uo(o,e)].filter(Boolean);for(let a of i){let l=a.method==="insert"||a.method==="update"||a.method==="upsert"||a.method==="delete",f=l?Xi:It;a.on==="create"?f(a,e,n):Promise.resolve().then(()=>{Ki({...a,__runner:f},e,n)}),!l&&a.on==="create"&&(a.refetchInterval||a.refetchOnWindowFocus!==!1||a.refetchOnReconnect!==!1)&&Qi(a,e,n)}let c=e.__ref;c.refetch=a=>{for(let l of i)It(l,e,n,{force:!0,...a})},c.fetchNextPage=()=>{let a=i[0];if(!a||!a.infinite)return;let l=c.__nextPageParam;if(l==null)return;let f={...a,cursor:l};It(f,e,n,{direction:"next",force:!0})},c.fetchPreviousPage=()=>{let a=i[0];if(!a||!a.infinite)return;let l=c.__prevPageParam;if(l==null)return;let f={...a,cursor:l};It(f,e,n,{direction:"previous",force:!0})}},Yi={invalidateQueries:t=>{if(!t){be();return}if(w(t))for(let[e]of Z)(e.startsWith(t)||e.includes(t))&&be(e);else if(M(t)){let e=t.join(":");for(let[r]of Z)r.includes(e)&&be(r)}},removeQueries:t=>{if(!t){qe();return}if(w(t))for(let[e]of Z)(e.startsWith(t)||e.includes(t))&&qe(e)},getQueryData:t=>_e(t)?.data??void 0,setQueryData:(t,e)=>{let r=_e(t),n=A(e)?e(r?.data):e;me(t,n,null)},prefetchQuery:async(t,e)=>{let r=e?.fetch;if(!r)return;let n=await Br(r,e);if(!n)return;let s=t.cache?.key||`${t.from}:${t.method||"select"}:${JSON.stringify(t.params||"")}`,o=n[t.method||"select"];if(!A(o))return;let i=await o({from:t.from,params:t.params,limit:t.limit,offset:t.offset,order:t.order,single:t.single});if(i?.data!==void 0&&!i?.error){let c=me(s,i.data,null);c.gcTime=Vr(t.cache)?.gcTime||3e5}return i},getCache:()=>Z,clear:()=>qe(),dropNonLang:t=>{if(!t)return;let e=`:${t}`;for(let[r]of Z)r.match(/:([a-z]{2,3})$/i)&&(r.endsWith(e)||qe(r))}},Zi={name:"fetch",create(t){let e=t.fetch;e&&(t.parent||pe.clear(),Ur(e,t,t.state,t.context))}},tc=Ur});function So(t){let e=this,{__ref:r}=e,n=[].concat(t),s=r.root[n[0]];if(!n||!n.length)return console.log(n,"on",e.key,"is undefined");for(;s.key===n[0]&&(n.shift(),!!n.length);)if(s=s[n[0]],!s)return;return s}function wo(){return this.getRef("__children").map(e=>this[e])}function ko(){return this.getRef().path}function Co(t){let e=null,r=n=>n.__element&&n.root?.isRootState;if(!this)e=xo();else if(r(this))e=this.root;else if(this.__ref&&this.__ref.path){let n=this.state&&r(this.state),s=A(this.state)&&this.parent.state&&r(this.parent.state);(n||s)&&(e=this.state.root||this.parent.state.root)}return e||(e=xo()),t?e?.[t]:e}function vo(t){let e=this.getRootState()?.__element;return e&&Object.keys(e).length>0&&t?e[t]:e}function Ao(t){return this.getRoot("data")&&Object.keys(this.getRoot("data")).length>0&&t?this.getRoot("data")[t]:this.getRoot("data")}function Eo(t){let e=this.getRoot()?.context;return t?e[t]:e}function Oo(t){let e=this.context;return t?e[t]:e}function zr(...t){if(Qt!=="test"&&Qt!=="development")return;let e=this,{__ref:r}=e;return console.groupCollapsed(e.key),t.length?t.forEach(n=>console.log(`%c${n}:
|
|
2
|
-
`,"font-weight: bold",e[n])):(console.log(r.path),e.keys().forEach(s=>console.log(`%c${s}:`,"font-weight: bold",e[s]))),console.log(e),console.groupEnd(e.key),e}function $o(...t){(
|
|
1
|
+
"use strict";var SymbolsEmbed=(()=>{var pr=Object.defineProperty;var gi=Object.getOwnPropertyDescriptor;var yi=Object.getOwnPropertyNames;var mi=Object.prototype.hasOwnProperty;var k=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var ie=(t,e)=>{for(var r in e)pr(t,r,{get:e[r],enumerable:!0})},bi=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of yi(e))!mi.call(t,s)&&s!==r&&pr(t,s,{get:()=>e[s],enumerable:!(n=gi(e,s))||n.enumerable});return t};var xi=t=>bi(pr({},"__esModule",{value:!0}),t);var yt,St,Dr=k(()=>{"use strict";yt=globalThis,St=yt.document});var Ve,Ir=k(()=>{"use strict";Dr();Ve=t=>typeof yt<"u"&&(yt.Node&&t instanceof yt.Node||yt.Window&&t instanceof yt.Window||t===yt||St!==void 0&&t===St)});var j,w,Be,A,M,Dt,Ht,Ln,de=k(()=>{"use strict";j=t=>t===null?!1:typeof t=="object"&&t.constructor===Object,w=t=>typeof t=="string",Be=t=>typeof t=="number",A=t=>typeof t=="function",M=t=>Array.isArray(t),Dt=t=>t===null?!1:typeof t=="object",Ht=t=>t!==void 0,Ln=t=>t===void 0});var Fn,jr=k(()=>{"use strict";Ue();Fn=(t,e=[])=>t.reduce((r,n)=>Mr(r,qt(n,{exclude:e}),e),{})});function We(t,e,r={}){let{bracketsLength:n=2}=r,s=n===3?"{{{":"{{";if(!t.includes(s))return t;let o=$i[n],i=e||this.state||{},c=this;return t.replace(o,(a,l,f,u)=>{let h=f.trim();if(u){let p=c?.context,y=p?.functions?.[u]||p?.utils?.[u]||p?.methods?.[u]||p?.snippets?.[u]||c?.[u];if(y&&typeof y=="function")try{return String(y.call(c,h)??"")}catch{return""}return""}if(l){let p=(l.match(/\.\.\//g)||[]).length,y=i;for(let m=0;m<p;m++){if(!y||!y.parent)return"";y=y.parent}if(h==="parent")return String(y.value??"");let d=pe(y,h);return String(d??"")}else{let p=pe(i,h);if(p!=null)return String(p);let y=c?.context?.polyglot;if(y?.translations){let d=i?.root?.lang||i?.lang||c?.context?.state?.lang||y.defaultLang||"en",m=y.translations[d];if(m){let b=pe(m,h);if(b!=null&&typeof b!="object")return String(b);for(let g in m){let _=m[g];if(_&&typeof _=="object"&&!Array.isArray(_)){let S=pe(_,h);if(S!=null&&typeof S!="object")return String(S)}}}let x=pe(y.translations,h);if(x!=null&&typeof x!="object")return String(x)}return""}})}var $i,pe,Nn=k(()=>{"use strict";$i={2:/{{\s*((?:\.\.\/)*)([\w\d.]+)\s*(?:\|\s*([\w\d.]+))?\s*}}/g,3:/{{{(\s*(?:\.\.\/)*)([\w\d.]+)\s*(?:\|\s*([\w\d.]+))?\s*}}}/g},pe=(t,e)=>e.split(".").reduce((r,n)=>r?.[n],t)});var Ti,Pi,Ri,Vn,Lr=k(()=>{"use strict";Ti=new Set(["update","parse","clean","create","destroy","add","toggle","remove","apply","set","reset","replace","quietReplace","quietUpdate","applyReplace","applyFunction","keys","values","ref","rootUpdate","parentUpdate","parent","__element","__depends","__ref","__children","root","setByPath","setPathCollection","removeByPath","removePathCollection","getByPath"]),Pi=new Set(["update","__element"]),Ri=new Set(["set","reset","update","remove","updateContent","removeContent","lookup","lookdown","lookdownAll","getRef","getPath","setNodeStyles","spotByPath","keys","parse","setProps","parseDeep","variables","if","log","verbose","warn","error","call","nextElement","previousElement","getRootState","getRoot","getRootData","getRootContext","getContext","getQuery","getDB","getChildren","preventContentUpdate","preventContentRecreate"]),Vn=new Set(["node","context","extends","__element","__ref",...Ri,...Ti,...Pi])});var Bn,Kt,Mr,Un,qt,Ue=k(()=>{"use strict";de();jr();Ir();Lr();Bn=t=>t.charCodeAt(0)===95&&t.charCodeAt(1)===95,Kt=(t,e,r,n)=>{if(A(t))return e?typeof t.call!="function"?t:t.call(e,e,r||e.state,n||e.context):void 0;if(t!=null&&e?.context?.plugins&&(M(t)||j(t)&&!Ve(t))){let s=e.context.plugins;for(let o of s)if(o.resolveHandler){let i=o.resolveHandler(t,e);if(typeof i=="function")return Kt(i,e,r,n)}}return t},Mr=(t,e,r=Vn)=>Un(t,e,r,null),Un=(t,e,r,n)=>{if(t===e)return t;if(n){for(let o=0;o<n.length;o+=2)if(n[o]===t&&n[o+1]===e)return t}let s=r instanceof Set;for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o)||Bn(o)||o==="constructor"||o==="prototype"||(s?r.has(o):r.includes(o)))continue;let i=t[o],c=e[o];if(Dt(i)&&Dt(c)){let a=n||[];a.push(t,e),Un(i,c,r,a),a.length-=2}else i===void 0&&(t[o]=c)}return t},qt=(t,e={})=>{let{exclude:r=[],cleanUndefined:n=!1,cleanNull:s=!1,visited:o=new WeakMap,handleExtends:i=!1}=e;if(!Dt(t)||Ve(t))return t;if(o.has(t))return o.get(t);let c=r instanceof Set?r:r.length>3?new Set(r):null,a=u=>c?c.has(u):r.includes(u),l=M(t)?[]:{};o.set(t,l);let f=[[t,l]];for(;f.length;){let[u,h]=f.pop();for(let p in u){if(!Object.prototype.hasOwnProperty.call(u,p)||Bn(p)||p==="__proto__"||a(p))continue;let y=u[p];if(!(n&&y===void 0)&&!(s&&y===null)){if(Ve(y)){h[p]=y;continue}if(i&&p==="extends"&&M(y)){h[p]=Fn(y,r);continue}if(A(y)){h[p]=y;continue}if(Dt(y))if(o.has(y))h[p]=o.get(y);else{let d=M(y)?[]:{};o.set(y,d),h[p]=d,f.push([y,d])}else h[p]=y}}}return l}});var Wn=k(()=>{"use strict"});var zn,Di,Fr,At,Gn=k(()=>{"use strict";zn="production",Di=(t=zn)=>t==="production",Fr=(t=zn)=>!Di(t),At=t=>{let e=t&&"env"in t?t.env:typeof process<"u"&&process.env?"production":void 0;if(e&&e!=="production")return!0;let r=t&&"hostname"in t?t.hostname:typeof location<"u"?location.hostname:void 0;return typeof r=="string"&&r?r==="localhost"||r==="127.0.0.1"||r.endsWith(".localhost"):!1}});var wt,ze=k(()=>{"use strict";wt=(t,e,...r)=>{let n=e?.context?.plugins;if(!n)return!1;let s=!1;for(let o of n)typeof o[t]=="function"&&(o[t](e,...r),s=!0);return s}});var Hn=k(()=>{"use strict"});var qn=k(()=>{"use strict"});var Gf,Kn=k(()=>{"use strict";Gf=typeof navigator>"u"?!1:/Mobi/.test(navigator.userAgent)});var Qn=k(()=>{"use strict"});var Jn=k(()=>{"use strict"});var Xn=k(()=>{"use strict"});var Yn=k(()=>{"use strict"});var Zn=k(()=>{"use strict"});var to=k(()=>{"use strict"});var eo=k(()=>{"use strict"});var ro=k(()=>{"use strict"});var no,Nr=k(()=>{"use strict";no={}});var so={};ie(so,{restAdapter:()=>oo,setup:()=>ji});var Ii,Et,ji,oo,io=k(()=>{"use strict";Ii=(t,e,r)=>{let n=e&&!e.startsWith("/")?"/":"",s=new URL(`${t}${n}${e}`);if(r)for(let o in r){let i=r[o];i!=null&&s.searchParams.set(o,typeof i=="object"?JSON.stringify(i):i)}return s.toString()},Et=async(t,e)=>{let r=await globalThis.fetch(t,e),n=r.headers.get("content-type"),s=n&&n.includes("json")?await r.json():await r.text();return{data:s,error:r.ok?null:s?.message||s?.error||r.statusText,status:r.status}},ji=async({url:t,headers:e,auth:r,fetchOptions:n})=>{if(!t)throw new Error("@symbo.ls/fetch rest: url is required");return oo(t,e,r,n)},oo=(t,e={},r,n={})=>{let s=r?.token||null,o=f=>{let u={...e,...f};return s&&(u.Authorization=`Bearer ${s}`),u},i=f=>({...o(f),"Content-Type":"application/json"}),c=f=>({...n,...f}),a=(f,u)=>{let h=u||t;if(f&&(f.startsWith("http://")||f.startsWith("https://")))return f;let p=f&&!f.startsWith("/")?"/":"";return`${h}${p}${f||""}`};return{name:"rest",setToken:f=>{s=f},getSession:async()=>{if(!r?.sessionUrl)return s?{token:s}:null;let f=await Et(a(r.sessionUrl,r.baseUrl),c({headers:o()}));return f.error?null:f.data},signIn:async f=>{if(!r?.signInUrl)throw new Error("rest: auth.signInUrl not configured");let u=await Et(a(r.signInUrl,r.baseUrl),c({method:"POST",headers:i(),body:JSON.stringify(f)}));return u.data?.token&&(s=u.data.token),u},signOut:async()=>(r?.signOutUrl&&await Et(a(r.signOutUrl,r.baseUrl),c({method:"POST",headers:o()})),s=null,{error:null}),select:({from:f,params:u,select:h,limit:p,offset:y,order:d,single:m,headers:x,baseUrl:b})=>{let g={...u};return h&&(g.select=h),p&&(g.limit=p),y&&(g.offset=y),m&&(g.single=!0),d&&(typeof d=="string"?g.order=d:Array.isArray(d)?g.order=d.map(_=>`${_.by}:${_.asc===!1?"desc":"asc"}`).join(","):d.by&&(g.order=`${d.by}:${d.asc===!1?"desc":"asc"}`)),Et(Ii(b||t,f||"",g),c({headers:o(x)}))},rpc:({from:f,params:u,headers:h,baseUrl:p})=>Et(a(`rpc/${f}`,p),c({method:"POST",headers:i(h),body:JSON.stringify(u)})),insert:({from:f,data:u,headers:h,baseUrl:p})=>Et(a(f,p),c({method:"POST",headers:i(h),body:JSON.stringify(u)})),update:({from:f,data:u,params:h,method:p,headers:y,baseUrl:d})=>{let m=h?.id||u?.id,x=m?`${f}/${m}`:f;return Et(a(x,d),c({method:p||"PATCH",headers:i(y),body:JSON.stringify(u)}))},upsert:({from:f,data:u,params:h,method:p,headers:y,baseUrl:d})=>{let m=h?.id||u?.id,x=m?`${f}/${m}`:f;return Et(a(x,d),c({method:p||"PUT",headers:i(y),body:JSON.stringify(u)}))},delete:({from:f,params:u,headers:h,baseUrl:p})=>{let y=u?.id,d=y?`${f}/${y}`:f;return Et(a(d,p),c({method:"DELETE",headers:o(h)}))}}}});var ao={};ie(ao,{localAdapter:()=>co,setup:()=>Li});var Ge,Mi,Li,co,fo=k(()=>{"use strict";Ge=(t,e)=>{if(!e)return!0;for(let r in e){let n=e[r];if(n===null){if(t[r]!==null&&t[r]!==void 0)return!1}else if(Array.isArray(n)){if(!n.includes(t[r]))return!1}else if(typeof n=="object"){for(let s in n)if(s==="gt"&&!(t[r]>n[s])||s==="gte"&&!(t[r]>=n[s])||s==="lt"&&!(t[r]<n[s])||s==="lte"&&!(t[r]<=n[s])||s==="neq"&&t[r]===n[s]||s==="like"&&!String(t[r]).includes(n[s]))return!1}else if(t[r]!==n)return!1}return!0},Mi=(t,{order:e,limit:r,offset:n,single:s})=>{let o=[...t];if(e){let i=typeof e=="string"?e:e.by,c=e.asc!==!1;o.sort((a,l)=>a[i]<l[i]?c?-1:1:a[i]>l[i]?c?1:-1:0)}return n&&(o=o.slice(n)),r&&(o=o.slice(0,r)),s?{data:o[0]||null,error:null}:{data:o,error:null}},Li=async({data:t,...e})=>co(t,e),co=(t={},e={})=>{let r={},n={},s=e.persist!==!1&&typeof localStorage<"u",o=e.prefix||"smbls_db_",i=f=>{if(!r[f])if(s)try{let u=localStorage.getItem(o+f);r[f]=u?JSON.parse(u):t[f]||[]}catch{r[f]=t[f]||[]}else r[f]=t[f]||[];return r[f]},c=f=>{if(s)try{localStorage.setItem(o+f,JSON.stringify(r[f]))}catch{}},a=(f,u,h,p)=>{let y=n[f];if(y)for(let d of y)d(h,p,{event:u,table:f})},l=Date.now();return{name:"local",store:r,select:async({from:f,params:u,...h})=>{let y=i(f).filter(d=>Ge(d,u));return Mi(y,h)},insert:async({from:f,data:u})=>{let h=i(f),y=(Array.isArray(u)?u:[u]).map(d=>{let m={id:d.id||++l,...d};return h.push(m),m});c(f);for(let d of y)a(f,"INSERT",d,null);return{data:Array.isArray(u)?y:y[0],error:null}},update:async({from:f,data:u,params:h})=>{let p=i(f),y=[];for(let d=0;d<p.length;d++)if(Ge(p[d],h)){let m={...p[d]};Object.assign(p[d],u),y.push(p[d]),a(f,"UPDATE",p[d],m)}return c(f),{data:y,error:null}},upsert:async({from:f,data:u,params:h})=>{let p=i(f),y=Array.isArray(u)?u:[u],d=[];for(let m of y){let x=h||(m.id!==void 0?{id:m.id}:null),b=x?p.findIndex(g=>Ge(g,x)):-1;if(b>-1){let g={...p[b]};Object.assign(p[b],m),d.push(p[b]),a(f,"UPDATE",p[b],g)}else{let g={id:m.id||++l,...m};p.push(g),d.push(g),a(f,"INSERT",g,null)}}return c(f),{data:Array.isArray(u)?d:d[0],error:null}},delete:async({from:f,params:u})=>{let h=i(f),p=[];for(let y=h.length-1;y>=0;y--)Ge(h[y],u)&&(p.push(h[y]),h.splice(y,1),a(f,"DELETE",null,p[p.length-1]));return c(f),{data:p,error:null}},subscribe:({from:f,on:u},h)=>{n[f]||(n[f]=[]);let p=(y,d,m)=>{u&&u!=="*"&&u!==m.event||h(y,d,m)};return n[f].push(p),()=>{let y=n[f].indexOf(p);y>-1&&n[f].splice(y,1)}}}}});var we={};ie(we,{createAdapter:()=>Wi,default:()=>tc,executeFetch:()=>zr,fetchPlugin:()=>Zi,initAdapterAuth:()=>Je,parseDuration:()=>me,queryClient:()=>Yi,registerAdapter:()=>Ui,resolveDb:()=>ho});var Fi,Ni,He,ge,qe,ye,Vi,Bi,Ui,Wi,ho,me,Z,go,he,zi,Se,be,xe,Ke,Ur,Qe,Gi,lo,Vr,yo,mo,Qt,uo,Hi,po,qi,Xe,bo,xo,Je,Wr,ut,mt,_e,Vt,kt,It,Ki,Qi,Ji,Br,Xi,zr,Yi,Zi,tc,ke=k(()=>{"use strict";V();Fi=["select","rpc","insert","update","upsert","delete","subscribe"],Ni={rest:()=>Promise.resolve().then(()=>(io(),so)),local:()=>Promise.resolve().then(()=>(fo(),ao))},He=Symbol.for("@symbo.ls/fetch:CUSTOM_ADAPTERS"),ge=(()=>{if(typeof globalThis<"u"&&globalThis[He])return globalThis[He];let t={};if(typeof globalThis<"u")try{return Object.defineProperty(globalThis,He,{value:t,writable:!1,configurable:!1,enumerable:!1}),globalThis[He]}catch{}return t})(),qe=Symbol.for("@symbo.ls/fetch:PENDING_ADAPTERS"),ye=(()=>{if(typeof globalThis<"u"&&globalThis[qe])return globalThis[qe];let t={};if(typeof globalThis<"u")try{return Object.defineProperty(globalThis,qe,{value:t,writable:!1,configurable:!1,enumerable:!1}),globalThis[qe]}catch{}return t})(),Vi=5e3,Bi=t=>new Promise(e=>{if(ge[t])return e(ge[t]);let r=ye[t]||(ye[t]=[]),n=!1,s=()=>{n||(n=!0,e(ge[t]||null))};r.push(s),setTimeout(s,Vi)}),Ui=(t,e)=>{ge[t]=e;let r=ye[t];if(r&&r.length){ye[t]=[];for(let n of r)n()}},Wi=t=>{let e={};for(let r of Fi)t[r]&&(e[r]=t[r]);return e.name=t.name||"custom",e},ho=async t=>{if(!t)return null;if(typeof t.select=="function")return t;let{adapter:e,...r}=t,n=typeof e=="string"?e:typeof t=="string"?t:null;if(!n)return null;let s=ge[n]||Ni[n];if(!s&&(s=await Bi(n),!s))throw new Error(`Unknown db adapter: "${n}". Use registerAdapter() for adapters with optional deps.`);let o=await s();if(!o||typeof o.setup!="function")throw new Error(`Adapter "${n}" loader returned a module without a setup() function. Got keys: [${Object.keys(o||{}).join(", ")}]. Likely a bundler chunk-resolution issue.`);return o.setup(r)},me=t=>{if(!t)return 0;if(typeof t=="number")return t;let e=t.match(/^(\d+)(ms|s|m|h)$/);if(!e)return 0;let r=parseInt(e[1]),n=e[2];return n==="ms"?r:n==="s"?r*1e3:n==="m"?r*6e4:n==="h"?r*36e5:0},Z=new Map,go=new Map,he=new Map,zi=(t,e,r)=>{if(t.cache?.key)return t.cache.key;let n=qi(t.params),s=r?`${r}:`:"",o=`${t.from}:${t.method}:${s}${JSON.stringify(n||"")}`;return e?`${o}:${e}`:o},Se=t=>Z.get(t)||null,be=(t,e,r)=>{let n=Z.get(t),s={data:e,error:r,time:Date.now(),stale:!1};Z.set(t,s);let o=go.get(t);if(o)for(let i of o)A(i)&&i(s);return s},xe=t=>{if(t){let e=Z.get(t);e&&(e.stale=!0);return}for(let[,e]of Z)e.stale=!0},Ke=t=>{if(t){Z.delete(t);return}Z.clear()},Ur=t=>!t&&t!==!1?{staleTime:6e4,gcTime:3e5}:t===!1?null:t===!0?{staleTime:6e4,gcTime:3e5}:typeof t=="number"?{staleTime:t,gcTime:Math.max(t*5,3e5)}:w(t)?{staleTime:me(t),gcTime:3e5}:{staleTime:me(t.stale||t.staleTime)||6e4,gcTime:me(t.gc||t.gcTime||t.expire)||3e5,key:t.key},Qe=null,Gi=()=>{Qe||(Qe=setInterval(()=>{let t=Date.now();for(let[e,r]of Z){let n=go.get(e);!(n&&n.size>0)&&t-r.time>(r.gcTime||3e5)&&Z.delete(e)}},3e4),Qe.unref&&Qe.unref())};Gi();lo=3,Vr=t=>Math.min(1e3*2**t,3e4),yo=t=>{let e=t.retry;return e===!1?{count:0}:e===!0||e===void 0?{count:lo,delay:Vr}:typeof e=="number"?{count:e,delay:Vr}:{count:e.count??lo,delay:A(e.delay)?e.delay:typeof e.delay=="number"?()=>e.delay:Vr}},mo=async(t,e)=>{let{count:r,delay:n}=e,s;for(let o=0;o<=r;o++)try{let i=await t();if(i?.error){if(s=i.error,o<r){let c=A(n)?n(o,s):n;await new Promise(a=>setTimeout(a,c));continue}return i}return i}catch(i){if(s=i,o<r){let c=A(n)?n(o,i):n;await new Promise(a=>setTimeout(a,c));continue}throw i}return{data:null,error:s}},Qt={focus:new Set,online:new Set},uo=!1,Hi=()=>{if(uo||typeof window>"u")return;uo=!0;let t=()=>{for(let r of Qt.focus)r()},e=()=>{for(let r of Qt.online)r()};window.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&t()}),window.addEventListener("focus",t),window.addEventListener("online",e)},po=(t,e)=>{let r=e.__ref;if(t===!0)return{from:r.__state||e.key,method:"select",query:!0,on:"create"};if(w(t))return{from:t,method:"select",query:!0,on:"create"};if(j(t)){let n={...t};return n.from=n.from||r.__state||e.key,n.method=n.method||"select",n.on=n.on||"create",n.query===void 0&&(n.query=!0),n}return null},qi=t=>(!t||A(t),t),Xe=(t,e)=>{let r=t?.state?.root||e?.state?.root;if(r?.lang)return r.lang},bo=(t,e)=>{let n=(t?.state?.root||e?.state?.root)?.__fetchScope;return n?String(n):void 0},xo=(t,e,r)=>{let n;if(!t)n=void 0;else if(A(t))n=t(e,e.state);else{n={};for(let s in t){let o=t[s];n[s]=A(o)?o(e,e.state):o}}return n},Je=async(t,e)=>{if(!t||t.__authInitialized||(t.__authInitialized=!0,!t.getSession))return;let r=(n,s)=>{let o=e.state?.root;o?.update&&o.update({auth:{user:n,session:s,loading:!1}})};try{let n=await t.getSession();r(n?.user||null,n)}catch(n){console.warn("[fetch] Failed to restore auth session:",n.message)}t.onAuthStateChange&&t.onAuthStateChange((n,s)=>{r(s?.user||null,s)})},Wr=async(t,e)=>{if(A(t.select))return t.auth!==!1&&await Je(t,e),t;if(t.__resolved)return t.auth!==!1&&await Je(t.__resolved,e),t.__resolved;if(t.__resolving)return t.__resolving;t.__resolving=ho(t);let r=await t.__resolving;return delete t.__resolving,r?(r.auth=t.auth,r.url=t.url,r.key=t.key,t.__resolved=r,e.fetch=r,t.auth!==!1&&await Je(r,e),r):null},ut=(t,e,...r)=>{let n=A(t[e])?t[e]:null;n&&n.call(t,...r,t,t.state,t.context)},mt=(t,e,r,...n)=>{let s=t&&A(t[r])?t[r]:null;s&&s.call(e,...n,e,e.state,e.context)},_e=t=>{let e={},r=t.node;if(!r)return e;if(r.tagName==="FORM"){let s=new FormData(r);for(let[o,i]of s.entries())e[o]=i;return e}let n=r.querySelectorAll("input, textarea, select");for(let s=0;s<n.length;s++){let o=n[s],i=o.name||o.getAttribute("name");i&&(o.type==="checkbox"?e[i]=o.checked:o.type==="file"?e[i]=o.files:e[i]=o.value)}return e},Vt=(t,e,r,n={})=>{let s=r&&r.startsWith("~/"),o=s&&t.state?.root||t.state;if(o?.update)if(s){let i=r.slice(2);e&&typeof e=="object"&&!Array.isArray(e)&&i in e?o.update(e,{preventFetch:!0,...n}):o.update({[i]:e},{preventFetch:!0,...n})}else{let i=r?{[r]:e}:e;o.update(i,{preventFetch:!0,...n})}},kt=(t,e)=>{let r=t?.__ref;r&&(r.__fetchStatus=e,r.__fetching=e.isFetching,r.__fetchError=e.error)},It=async(t,e,r,n={})=>{let s=r?.fetch;if(!s||!e||!e.__ref||t.enabled===!1||A(t.enabled)&&!t.enabled(e,e.state)||t.skip===!0||A(t.skip)&&t.skip(e,e.state))return;let o=await Wr(s,r);if(!o||!e.__ref)return;let i=e.__ref,{from:c,method:a,query:l,params:f,cache:u,transform:h,single:p,auth:y,fields:d,as:m,limit:x,offset:b,order:g,headers:_,baseUrl:S,page:v,cursor:D,getNextPageParam:ot,getPreviousPageParam:L,infinite:q,placeholderData:ct,initialData:Tt,select:K,keepPreviousData:st}=t,O=w(K)?K:void 0;if(l&&A(e.getQuery)){let I=e.getQuery(o.name||"paths");I&&(O=I.select||I.length&&I.join(",")||O)}let F=xo(f,e,r),$=Ur(u),tt=yo(t),Ft=Xe(e,r),oe=bo(e,r),at=Ft?`:${Ft}`:"",se=oe?`${oe}:`:"",T=$?u?.key||`${c}:${a}:${se}${JSON.stringify(F||"")}${q?":infinite":""}${v?":p"+JSON.stringify(v):""}${at}`:null;if(!i.__fetchInitialized&&T&&(i.__fetchInitialized=!0,Tt!==void 0)){let I=A(Tt)?Tt():Tt;be(T,I,null)}if((a==="select"||a==="rpc")&&T&&$){let I=Se(T);if(I&&!I.error){let R=Date.now()-I.time,B=I.stale||R>($.staleTime||0),E=I.data;if(A(K)&&(E=K(E,e,e.state)),h&&(E=h(E,e,e.state)),Vt(e,E,m),!B){kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!0,error:null,status:"success",fetchStatus:"idle"});return}}else if(ct!==void 0){let R=A(ct)?ct(e,e.state):ct;R!==void 0&&Vt(e,R,m)}}if(T&&he.has(T)&&!n.force){let I=he.get(T);try{let R=await Promise.race([I,new Promise((B,E)=>setTimeout(()=>E("DEDUP_TIMEOUT"),15e3))]);if(R?.data!==void 0){let B=R.data;A(K)&&(B=K(B,e,e.state)),h&&(B=h(B,e,e.state)),Vt(e,B,m),ut(e,"onFetchComplete",B),mt(t,e,"onFetchComplete",B)}}catch{}return}let Pt=!Se(T)?.data;kt(e,{isFetching:!0,isLoading:Pt,isStale:!1,isSuccess:!1,error:null,status:"pending",fetchStatus:"fetching"}),ut(e,"onFetchStart"),mt(t,e,"onFetchStart");let ft=r?.analyze?.emitNetwork,it=ft?typeof performance<"u"?performance.now():Date.now():0;ft&&ft({phase:"start",mode:"query",from:c,method:a,cacheKey:T,lang:Ft});let An=mo(async()=>{if(y!==!1&&o.auth!==!1&&o.getSession){let E=await o.getSession();if(y===!0&&!E){let Y={message:"Not authenticated"};return kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:Y,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",Y),mt(t,e,"onFetchError",Y),{data:null,error:Y}}}let I=o[a];if(!A(I))return{data:null,error:{message:`Method "${a}" not found on adapter`}};let R={from:c,select:O,params:F,single:p,limit:x,offset:b,order:g,headers:_,baseUrl:S},B=Xe(e,r);if(B&&(R.headers={...R.headers,"Accept-Language":B}),v!==void 0){if(j(v))v.offset!==void 0&&(R.offset=v.offset),v.limit!==void 0&&(R.limit=v.limit),v.cursor!==void 0&&(R.params={...R.params,cursor:v.cursor});else if(typeof v=="number"){let E=t.pageSize||x||20;R.offset=(v-1)*E,R.limit=E}}if(D!==void 0&&(R.params={...R.params,cursor:D}),a==="insert"||a==="update"||a==="upsert"){let E;if(d===!0||t.on==="submit")E=_e(e);else if(M(d)){let Y=_e(e);E={};for(let dr of d)E[dr]=Y[dr]}else e.state?.parse?E=e.state.parse():j(e.state)&&(E={...e.state});h&&(E=h(E,e,e.state)),R.data=E}if(a==="rpc"){let E=F;if(t.on==="submit"){let Y=_e(e);E=t.transformParams?t.transformParams(Y,e,e.state):Y}R.params=E}if(a==="subscribe"){let E=o.subscribe({from:c,params:F,on:t.subscribeOn},(Y,dr,af)=>{Vt(e,Y,m),ut(e,"onFetchComplete",Y),mt(t,e,"onFetchComplete",Y)});return i.__unsubscribe=E,{data:null,error:null,subscribed:!0}}return I(R)},tt);T&&he.set(T,An);try{let I=await An;if(I?.subscribed)return;let{data:R,error:B}=I||{};if(B){T&&be(T,null,B),kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:B,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",B),mt(t,e,"onFetchError",B),ft&&ft({phase:"error",mode:"query",from:c,method:a,cacheKey:T,error:B.message||B,durationMs:(typeof performance<"u"?performance.now():Date.now())-it});return}if(R!==void 0){if((a==="select"||a==="rpc")&&T){let Y=be(T,R,null);Y.gcTime=$?.gcTime||3e5}let E=R;q&&M(R)&&(i.__pages||(i.__pages=[]),n.direction==="previous"?i.__pages.unshift(R):i.__pages.push(R),E=i.__pages.flat(),ot&&(i.__nextPageParam=ot(R,i.__pages),i.__hasNextPage=i.__nextPageParam!=null),L&&(i.__prevPageParam=L(R,i.__pages),i.__hasPreviousPage=i.__prevPageParam!=null)),A(K)&&(E=K(E,e,e.state)),h&&(E=h(E,e,e.state)),(!st||E!==void 0)&&Vt(e,E,m),kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!0,error:null,status:"success",fetchStatus:"idle"}),ut(e,"onFetchComplete",E),mt(t,e,"onFetchComplete",E),ft&&ft({phase:"success",mode:"query",ok:!0,from:c,method:a,cacheKey:T,durationMs:(typeof performance<"u"?performance.now():Date.now())-it})}}catch(I){kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:I,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",I),mt(t,e,"onFetchError",I),ft&&ft({phase:"error",mode:"query",from:c,method:a,cacheKey:T,error:I.message||String(I),durationMs:(typeof performance<"u"?performance.now():Date.now())-it})}finally{T&&he.delete(T)}},Ki=(t,e,r)=>{let n=t.on,s=e.__ref;s.__fetchListeners||(s.__fetchListeners=[]);let o=t.__runner||It;if(n==="submit"){let i=a=>{a.preventDefault(),o(t,e,r)},c=e.node;c&&(c.addEventListener("submit",i),s.__fetchListeners.push(()=>c.removeEventListener("submit",i)))}else if(n==="click"){let i=()=>o(t,e,r),c=e.node;c&&(c.addEventListener("click",i),s.__fetchListeners.push(()=>c.removeEventListener("click",i)))}else n==="stateChange"&&(s.__fetchOnStateChange=()=>o(t,e,r))},Qi=(t,e,r)=>{let n=e.__ref;n.__fetchCleanups||(n.__fetchCleanups=[]),Hi();let s=t.refetchInterval;if(s){let o=typeof s=="number"?s:me(s);if(o>0){let i=setInterval(()=>{(t.refetchIntervalInBackground||typeof document>"u"||document.visibilityState==="visible")&&It(t,e,r,{force:!0})},o);n.__fetchCleanups.push(()=>clearInterval(i))}}if(t.refetchOnWindowFocus!==!1){let o=()=>{let i=Xe(e,r),c=bo(e,r),a=zi(t,i,c),l=Se(a),f=Ur(t.cache);(!l||l.stale||Date.now()-l.time>(f?.staleTime||0))&&It(t,e,r,{force:!0})};Qt.focus.add(o),n.__fetchCleanups.push(()=>Qt.focus.delete(o))}if(t.refetchOnReconnect!==!1){let o=()=>It(t,e,r,{force:!0});Qt.online.add(o),n.__fetchCleanups.push(()=>Qt.online.delete(o))}},Ji=(t,e,r)=>{if(!e.optimistic)return null;let n=t.__ref,s=e.as,o=t.state?.parse?t.state.parse():j(t.state)?{...t.state}:t.state;n.__optimisticSnapshot=o;let i=A(e.optimistic)?e.optimistic(r,o,t):e.optimistic;return i!==void 0&&Vt(t,i,s),o},Br=(t,e)=>{let r=t.__ref,n=r.__optimisticSnapshot;n!==void 0&&(Vt(t,n,e.as),delete r.__optimisticSnapshot)},Xi=async(t,e,r)=>{let n=r?.fetch;if(!n)return;let s=await Wr(n,r);if(!s)return;let o=e.__ref,{method:i,from:c,fields:a,transform:l,as:f,on:u,auth:h,headers:p,baseUrl:y,invalidates:d,optimistic:m,onMutate:x,onSuccess:b,onError:g,onSettled:_}=t,S;if(a===!0||u==="submit")S=_e(e);else if(M(a)){let L=_e(e);S={};for(let q of a)S[q]=L[q]}else e.state?.parse?S=e.state.parse():j(e.state)&&(S={...e.state});l&&(S=l(S,e,e.state)),A(x)&&x(S,e,e.state);let v=m?Ji(e,t,S):null;o.__fetching=!0,kt(e,{isFetching:!0,isLoading:!1,isStale:!1,isSuccess:!1,error:null,status:"pending",fetchStatus:"fetching"}),ut(e,"onFetchStart"),mt(t,e,"onFetchStart");let D=r?.analyze?.emitNetwork,ot=D?typeof performance<"u"?performance.now():Date.now():0;D&&D({phase:"start",mode:"mutation",from:c,method:i});try{if(h!==!1&&s.auth!==!1&&s.getSession){let F=await s.getSession();if(h===!0&&!F){v!==void 0&&Br(e,t);let $={message:"Not authenticated"};ut(e,"onFetchError",$),mt(t,e,"onFetchError",$);return}}let L=s[i];if(!A(L))return;let q={from:c,data:S,headers:p,baseUrl:y};t.params&&(q.params=xo(t.params,e,r));let ct=Xe(e,r);ct&&(q.headers={...q.headers,"Accept-Language":ct});let Tt=yo(t),K=await mo(()=>L(q),Tt),{data:st,error:O}=K||{};if(O){v!==void 0&&Br(e,t),kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:O,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",O),A(g)&&g(O,S,e),A(_)&&_(null,O,S,e),D&&D({phase:"error",mode:"mutation",from:c,method:i,error:O.message||String(O),durationMs:(typeof performance<"u"?performance.now():Date.now())-ot});return}if(delete o.__optimisticSnapshot,st!==void 0){let F=f?{[f]:st}:st;e.state?.update&&e.state.update(F,{preventFetch:!0})}if(kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!0,error:null,status:"success",fetchStatus:"idle"}),ut(e,"onFetchComplete",st),mt(t,e,"onFetchComplete",st),A(b)&&b(st,S,e),A(_)&&_(st,null,S,e),D&&D({phase:"success",mode:"mutation",ok:!0,from:c,method:i,durationMs:(typeof performance<"u"?performance.now():Date.now())-ot}),d){let F=M(d)?d:[d];for(let $ of F)if($===!0||$==="*")for(let[tt]of Z)tt.startsWith(c+":")&&xe(tt);else xe($)}}catch(L){v!==void 0&&Br(e,t),kt(e,{isFetching:!1,isLoading:!1,isStale:!1,isSuccess:!1,error:L,status:"error",fetchStatus:"idle"}),ut(e,"onFetchError",L),mt(t,e,"onFetchError",L),A(g)&&g(L,S,e),A(_)&&_(null,L,S,e),D&&D({phase:"error",mode:"mutation",from:c,method:i,error:L.message||String(L),durationMs:(typeof performance<"u"?performance.now():Date.now())-ot})}finally{o.__fetching=!1}},zr=(t,e,r,n)=>{if(!t||!n?.fetch)return;let o=Kt(t,e);if(!o)return;let i=M(o)?o.map(a=>po(Kt(a,e),e)).filter(Boolean):[po(o,e)].filter(Boolean);for(let a of i){let l=a.method==="insert"||a.method==="update"||a.method==="upsert"||a.method==="delete",f=l?Xi:It;a.on==="create"?f(a,e,n):Promise.resolve().then(()=>{Ki({...a,__runner:f},e,n)}),!l&&a.on==="create"&&(a.refetchInterval||a.refetchOnWindowFocus!==!1||a.refetchOnReconnect!==!1)&&Qi(a,e,n)}let c=e.__ref;c.refetch=a=>{for(let l of i)It(l,e,n,{force:!0,...a})},c.fetchNextPage=()=>{let a=i[0];if(!a||!a.infinite)return;let l=c.__nextPageParam;if(l==null)return;let f={...a,cursor:l};It(f,e,n,{direction:"next",force:!0})},c.fetchPreviousPage=()=>{let a=i[0];if(!a||!a.infinite)return;let l=c.__prevPageParam;if(l==null)return;let f={...a,cursor:l};It(f,e,n,{direction:"previous",force:!0})}},Yi={invalidateQueries:t=>{if(!t){xe();return}if(w(t))for(let[e]of Z)(e.startsWith(t)||e.includes(t))&&xe(e);else if(M(t)){let e=t.join(":");for(let[r]of Z)r.includes(e)&&xe(r)}},removeQueries:t=>{if(!t){Ke();return}if(w(t))for(let[e]of Z)(e.startsWith(t)||e.includes(t))&&Ke(e)},getQueryData:t=>Se(t)?.data??void 0,setQueryData:(t,e)=>{let r=Se(t),n=A(e)?e(r?.data):e;be(t,n,null)},prefetchQuery:async(t,e)=>{let r=e?.fetch;if(!r)return;let n=await Wr(r,e);if(!n)return;let s=t.cache?.key||`${t.from}:${t.method||"select"}:${JSON.stringify(t.params||"")}`,o=n[t.method||"select"];if(!A(o))return;let i=await o({from:t.from,params:t.params,limit:t.limit,offset:t.offset,order:t.order,single:t.single});if(i?.data!==void 0&&!i?.error){let c=be(s,i.data,null);c.gcTime=Ur(t.cache)?.gcTime||3e5}return i},getCache:()=>Z,clear:()=>Ke(),dropNonLang:t=>{if(!t)return;let e=`:${t}`;for(let[r]of Z)r.match(/:([a-z]{2,3})$/i)&&(r.endsWith(e)||Ke(r))}},Zi={name:"fetch",create(t){let e=t.fetch;e&&(t.parent||he.clear(),zr(e,t,t.state,t.context))}},tc=zr});function So(t){let e=this,{__ref:r}=e,n=[].concat(t),s=r.root[n[0]];if(!n||!n.length)return console.log(n,"on",e.key,"is undefined");for(;s.key===n[0]&&(n.shift(),!!n.length);)if(s=s[n[0]],!s)return;return s}function wo(){return this.getRef("__children").map(e=>this[e])}function ko(){return this.getRef().path}function Co(t){let e=null,r=n=>n.__element&&n.root?.isRootState;if(!this)e=_o();else if(r(this))e=this.root;else if(this.__ref&&this.__ref.path){let n=this.state&&r(this.state),s=A(this.state)&&this.parent.state&&r(this.parent.state);(n||s)&&(e=this.state.root||this.parent.state.root)}return e||(e=_o()),t?e?.[t]:e}function vo(t){let e=this.getRootState()?.__element;return e&&Object.keys(e).length>0&&t?e[t]:e}function Ao(t){return this.getRoot("data")&&Object.keys(this.getRoot("data")).length>0&&t?this.getRoot("data")[t]:this.getRoot("data")}function Eo(t){let e=this.getRoot()?.context;return t?e[t]:e}function Oo(t){let e=this.context;return t?e[t]:e}function Hr(...t){if(Jt!=="test"&&Jt!=="development")return;let e=this,{__ref:r}=e;return console.groupCollapsed(e.key),t.length?t.forEach(n=>console.log(`%c${n}:
|
|
2
|
+
`,"font-weight: bold",e[n])):(console.log(r.path),e.keys().forEach(s=>console.log(`%c${s}:`,"font-weight: bold",e[s]))),console.log(e),console.groupEnd(e.key),e}function $o(...t){(Jt==="test"||Jt==="development")&&console.warn(...t)}function To(...t){if(Jt==="test"||Jt==="development"){if(t[t.length-1]?.debugger)debugger;throw t[t.length-1]?.verbose&&Hr.call(this),new Error(...t)}}function Po(){let t=this,{key:e,parent:r}=t,{__children:n}=r.__ref,s=n.indexOf(e),o=n[s+1];return r[o]}function Ro(t){let e=t||this,{key:r,parent:n}=e,{__children:s}=n.__ref;if(!s)return;let o=s.indexOf(r);return n[s[o-1]]}function Do(t={}){let e=this;e.data||(e.data={}),e.data.varCaches||(e.data.varCaches={});let r=e.data.varCaches,n={},s;for(let o in t)t[o]!==r[o]&&(s=!0,n[o]=t[o]);return{changed:o=>{if(!s)return;let i=o(n,qt(r));for(let c in n)r[c]=n[c];return i},timeout:(o,i)=>{if(!s)return;let c=setTimeout(()=>{o(n),clearTimeout(c)},i)}}}async function Io(){let t=this,e=t.context?.fetch;if(!e)return null;if(typeof e.select=="function"){if(!e.__authInitialized&&e.getSession){let{initAdapterAuth:s}=await Promise.resolve().then(()=>(ke(),we));await s(e,t.context)}return e}if(e.__resolved){if(!e.__resolved.__authInitialized&&e.__resolved.getSession){let{initAdapterAuth:s}=await Promise.resolve().then(()=>(ke(),we));await s(e.__resolved,t.context)}return e.__resolved}if(e.__resolving)return e.__resolving;let r=Promise.resolve().then(()=>(ke(),we)).then(({resolveDb:s})=>s(e));e.__resolving=r;let n=await r;if(e.__resolved=n,t.context.fetch=n,delete e.__resolving,n?.getSession){let{initAdapterAuth:s}=await Promise.resolve().then(()=>(ke(),we));await s(n,t.context)}return n}function jo(t){let e=this,r=t||no.useStateQuery||e.context?.useStateQuery;if(!r)return null;let n={};if(Gr(e,n),r===!0)return n;let s=ac[r];return s?s(n):n}var Jt,ec,_o,Gr,rc,Mo,nc,oc,sc,ic,cc,ac,Lo=k(()=>{"use strict";de();Ue();Nr();Jt="production";ec=null,_o=()=>ec||null;Gr=(t,e)=>{let r=t.__ref;if(!r)return;let n=r.__state;n&&typeof n=="string"&&rc(e,n);let s=r.__children;if(s)for(let c=0;c<s.length;c++){let a=t[s[c]];a&&a.__ref&&Gr(a,e)}let o=r.contentElementKey||"content",i=t[o];i&&i.__ref&&Gr(i,e)},rc=(t,e)=>{let n=e.replaceAll("../","").replaceAll("~/","").split("/"),s=t;for(let o=0;o<n.length;o++){let i=n[o];o===n.length-1?s[i]||(s[i]=!0):(s[i]===!0&&(s[i]={}),s[i]||(s[i]={}),s=s[i])}},Mo=(t,e=0)=>{let r=" ".repeat(e),n=Object.entries(t);return n.length?n.map(([o,i])=>i===!0?`${r}${o}`:`${r}${o} {
|
|
3
3
|
${Mo(i,e+1)}
|
|
4
4
|
${r}}`).join(`
|
|
5
5
|
`):""},nc=t=>`{
|
|
@@ -7,10 +7,10 @@ ${Mo(t,1)}
|
|
|
7
7
|
}`,oc=t=>{let e={fields:{},include:[]},r=(n,s)=>{let o=[];for(let i in n)if(n[i]===!0)o.push(i);else{let c=s?`${s}.${i}`:i;e.include.push(c),r(n[i],c)}o.length&&(e.fields[s||"_root"]=o)};return r(t,""),e},sc=t=>{let e=o=>{let i=[],c=[];for(let a in o)if(o[a]===!0)i.push(a);else{let l=e(o[a]),f=[];l.select&&f.push(`$select=${l.select}`),l.expand&&f.push(`$expand=${l.expand}`),c.push(f.length?`${a}(${f.join(";")})`:a)}return{select:i.length?i.join(","):"",expand:c.length?c.join(","):""}},{select:r,expand:n}=e(t),s=[];return r&&s.push(`$select=${r}`),n&&s.push(`$expand=${n}`),s.join("&")},ic=(t,e)=>{let r=[],n=[],s=new Set,o=(f,u,h)=>{s.add(u),h&&n.push(`LEFT JOIN ${u} ON ${u}.${h}_id = ${h}.id`);for(let p in f)f[p]===!0?r.push(`${u}.${p}`):o(f[p],p,u)},i=Object.keys(t);i.length===1&&t[i[0]]!==!0?o(t[i[0]],i[0],null):o(t,"_root",null);let c=[...s][0]||"_root",a=r.length?r.join(", "):"*",l=n.length?`
|
|
8
8
|
`+n.join(`
|
|
9
9
|
`):"";return`SELECT ${a}
|
|
10
|
-
FROM ${c}${l}`},cc=t=>{let e=[],r=(n,s)=>{for(let o in n){let i=s?`${s}/${o}`:o;n[o]===!0?e.push(i):r(n[o],i)}};return r(t,""),e},ac={graphql:nc,"json-api":oc,odata:sc,sql:ic,paths:cc}});var Fo=k(()=>{"use strict"});var No=k(()=>{});var Vo=k(()=>{"use strict"});var Bo=k(()=>{"use strict"});var Uo=k(()=>{"use strict"});var Wo=k(()=>{"use strict"});var zo=k(()=>{"use strict"});var Go=k(()=>{"use strict"});var Ho=k(()=>{"use strict"});var qo=k(()=>{"use strict"});var Ko=k(()=>{"use strict"});var Qo=k(()=>{"use strict"});var Jo,Xo,Yo,Zo=k(()=>{"use strict";ue();Jo=t=>(typeof t!="string"&&(t=String(t||"")),t.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,r){return r===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")),Xo=t=>t.replace(/[^a-zA-Z0-9]/g," ").trim().toLowerCase().replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Yo=t=>{if(M(t))return t;if(w(t))return t.split(" ");if(j(t))return Object.values(t);if(Ve(t))return[t]}});var ts=k(()=>{"use strict"});var es=k(()=>{"use strict"});var V=k(()=>{"use strict";Un();zn();ue();Be();We();Dr();Rr();Gn();Hn();Fn();Pr();qn();Kn();Jn();Xn();Qn();Yn();Zn();jr();to();Lo();Lr();Fo();eo();No();Vo();Bo();Uo();Wo();zo();Go();Ho();qo();Ko();Qo();Zo();ts();es()});var of={};se(of,{FACTORY:()=>tr,REGISTRY:()=>et,applyExtends:()=>$e,batch:()=>vt,create:()=>ht,createEffect:()=>N,createElement:()=>rf,createSignal:()=>ft,createStore:()=>lt,getActiveConfig:()=>P,mount:()=>nf,popConfig:()=>U,pushConfig:()=>z,registerEvent:()=>Oe});var Nt=null,je=0,Me=[],Fe=()=>Nt;var Le=0,dr=[];function ft(t){let e=new Set;function r(){return Nt&&(e.add(Nt),Nt._sources.add(o)),t}function n(i){i!==t&&(t=i,Ci(e))}function s(){return t}let o={get:r,set:n,peek:s,_subscribers:e,_type:"signal"};return o}var _t=new Set,pr=!1;function N(t,e){let r=e?.depth??0,n={_sources:new Set,_type:"effect",_depth:r,_disposed:!1,_subscribers:new Set,_execute(){if(n._disposed)return;On(n);let s=Nt;Nt=n;try{t()}catch(o){console.error("[smbls] effect error:",o)}finally{Nt=s}},_notify(){n._disposed||(je>0?Me.push(n):Le>0?dr.push(n):gr(n))},dispose(){n._disposed=!0,On(n)}};return n._execute(),n}function vt(t){je++;try{t()}finally{je--,je===0&&wi()}}var hr=!1,An=1e3,_i=8;function En(){return typeof performance<"u"?performance.now():Date.now()}function gr(t){_t.add(t),!hr&&(pr||(pr=!0,queueMicrotask($n)))}var Gt=[];function Si(){if(_t.size===1){let[t]=_t;_t.clear(),t._disposed||t._execute();return}Gt.length=0;for(let t of _t)Gt.push(t);_t.clear(),Gt.sort((t,e)=>t._depth-e._depth);for(let t=0;t<Gt.length;t++){let e=Gt[t];e._disposed||e._execute()}Gt.length=0}function $n(t=0){if(pr=!1,_t.size===0)return;hr=!0;let e=En(),r=!1;try{for(;_t.size>0;){if(++t>An){console.error("[smbls] reactive effect cascade exceeded",An,"passes in a single flush \u2014 breaking to avoid hanging the thread.","This usually means an effect (or an onUpdate/subscribeTo handler","it calls into) unconditionally writes back a signal it depends on."),_t.clear();break}if(Si(),_t.size>0&&En()-e>_i){r=!0,setTimeout(()=>$n(t),0);break}}}finally{r||(hr=!1)}}function wi(){for(let t=0;t<Me.length;t++)gr(Me[t]);Me.length=0}function ki(t){Le++;try{for(let e of t)e._notify()}finally{if(Le--,Le===0&&dr.length>0){let e=dr.splice(0);for(let r=0;r<e.length;r++)gr(e[r])}}}function Ci(t){ki(t)}function On(t){for(let e of t._sources)e._subscribers.delete(t);t._sources.clear()}var Rt=Symbol("store"),br=Symbol("signals"),_r=["update","parse","clean","keys","values","replace","add","remove","destroy","quietUpdate"],ie=new Set(_r),Tn=new Set,Pn=(t,e)=>t?t+"."+e:String(e);function ce(t,e){let r=(e||"")+"::"+t;if(Tn.has(r))return;Tn.add(r);let n=e?`state.${e}`:"state",s=`[smbls/state] "${t}" is a reserved store-method name and was written as DATA at ${n}.${t}. The value is preserved and readable \u2014 data wins over the method \u2014 but "${n}.${t}(\u2026)" no longer reaches the store method on this node. Use "${n}.$${t}(\u2026)" for the method, or rename the data key. Reserved: ${_r.join(", ")}.`;typeof console<"u"&&console.warn&&console.warn(s)}var yr=t=>!t||typeof t!="object"||Array.isArray(t)||t[Rt]||Object.isFrozen(t)||typeof Node<"u"&&t instanceof Node||t.__ref||t.nodeType||t.nodeName,vi=12,Rn=t=>{if(!t||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};function xr(t,e,r){if(t===e)return!0;if(r>vi)return!1;if(Array.isArray(t)||Array.isArray(e)){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!xr(t[n],e[n],r+1))return!1;return!0}if(Rn(t)&&Rn(e)){let n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(let o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!xr(t[o],e[o],r+1))return!1;return!0}return!1}function lt(t,e,r,n){r===void 0&&(r=0),n===void 0&&(n="");let s={},o={},i=e&&e.maxDepth||8;if(t&&typeof t=="object")for(let b in t){if(b==="__proto__"||!Object.prototype.hasOwnProperty.call(t,b))continue;ie.has(b)&&ce(b,n);let g=t[b];r<i&&g&&typeof g=="object"&&!yr(g)?(o[b]=g,s[b]=ft(lt(g,e,r+1,Pn(n,b)))):(o[b]=g,s[b]=ft(g))}let c=new Proxy(o,{get(b,g){if(g===Rt)return!0;if(g===br)return s;if(g==="__raw")return b;if(g==="$update")return a;if(g==="$parse")return f;if(g==="$clean")return u;if(g==="$keys")return h;if(g==="$values")return p;if(g==="$replace")return y;if(g==="$add")return d;if(g==="$remove")return m;if(g==="$destroy")return x;if(g==="$quietUpdate")return l;if(ie.has(g)&&!Object.prototype.hasOwnProperty.call(s,g))switch(g){case"update":return a;case"parse":return f;case"clean":return u;case"keys":return h;case"values":return p;case"replace":return y;case"add":return d;case"remove":return m;case"destroy":return x;case"quietUpdate":return l}if(g==="__element")return b.__element;if(g==="parent")return b.parent;if(g==="root")return b.root;if(Object.prototype.hasOwnProperty.call(s,g)){let S=s[g].get();if(S!==void 0||!(g!=="root"&&b.root&&b.root!==c))return S}if(b[g]!==void 0)return b[g];let _=typeof g=="string"&&!g.startsWith("__")&&g!=="then"&&g!=="constructor"&&Fe()!=null;if(g!=="root"&&b.root&&b.root!==c){let S=b.root[g];return S===void 0&&_&&!Object.prototype.hasOwnProperty.call(s,g)?(s[g]=ft(void 0),s[g].get()):S}if(_)return s[g]=ft(void 0),s[g].get()},set(b,g,_){if(g==="__proto__")return!1;if(g==="__element"||g==="parent"||g==="root")return b[g]=_,!0;ie.has(g)&&ce(g,n);let S=Pn(n,g);if(Object.prototype.hasOwnProperty.call(s,g))if(_&&typeof _=="object"&&!yr(_)){if(_===b[g])return!0;let v=s[g].peek(),D=v&&v[Rt]?v.$parse():v;if(xr(_,D,0))return!0;b[g]=_,s[g].set(lt(_,e,r+1,S))}else b[g]=_,s[g].set(_);else b[g]=_,_&&typeof _=="object"&&!yr(_)?s[g]=ft(lt(_,e,r+1,S)):s[g]=ft(_);return!0},has(b,g){return typeof g=="string"&&g.charCodeAt(0)===36&&ie.has(g.slice(1))?!0:g in s||g in b},ownKeys(b){return Object.keys(s)},getOwnPropertyDescriptor(b,g){return g in s?{enumerable:!0,configurable:!0,value:s[g].peek()}:Object.getOwnPropertyDescriptor(b,g)},deleteProperty(b,g){return s[g]&&(s[g].set(void 0),delete s[g]),delete b[g],!0}});function a(b,g){vt(()=>{for(let S in b)S!=="__proto__"&&(c[S]=b[S])});let _=o.__element;return _&&_.onUpdate&&!g?.quiet&&_.onUpdate(_,c,_.context),c}function l(b){return a(b,{quiet:!0})}function f(b){if(b||(b=new Set),b.has(c))return"[Circular]";b.add(c);let g={};for(let _ in s){if(_==="parent"||_==="root"||_.startsWith("__"))continue;let S=s[_].peek();S&&S[Rt]?g[_]=S.$parse(b):g[_]=S}return g}function u(){return vt(()=>{for(let b in s)delete c[b]}),c}function h(){return Object.keys(s)}function p(){return Object.keys(s).map(b=>s[b].peek())}function y(b){return vt(()=>{for(let g in s)g in b||delete c[g];for(let g in b)g!=="__proto__"&&(c[g]=b[g])}),c}function d(b,g){return c[b]=g,c}function m(b){return delete c[b],c}function x(){u(),o.__element=null,o.parent=null}return c}function G(t){return t&&t[Rt]===!0}function Sr(t,e){let r={},n={};if(t&&typeof t=="object")for(let i in t)n[i]=t[i],r[i]=ft(t[i]);let s=i=>{if(Object.prototype.hasOwnProperty.call(r,i))return r;let c=e;for(;c;){let a=c[br];if(a&&Object.prototype.hasOwnProperty.call(a,i))return a;c=c[Rt]?c[mr]:null}return null};return new Proxy(n,{get(i,c){return c===Rt?!0:c===br?r:c===mr?e:c==="__raw"?i:Object.prototype.hasOwnProperty.call(r,c)?r[c].get():e&&c!=="then"&&c!=="constructor"?e[c]:i[c]},set(i,c,a){let l=s(c);return l?(l===r&&(i[c]=a),l[c].set(a),!0):(i[c]=a,r[c]=ft(a),!0)},has(i,c){if(c in r||c in i)return!0;let a=e;for(;a;){if(c in a)return!0;a=a[Rt]?a[mr]:null}return!1},ownKeys(){return Object.keys(r)},getOwnPropertyDescriptor(i,c){return c in r?{enumerable:!0,configurable:!0,value:r[c].peek()}:Object.getOwnPropertyDescriptor(i,c)}})}var mr=Symbol("scope.parent");var wr="http://www.w3.org/2000/svg",vr=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),Ai=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function kr(t){return Ai.has(t)||vr.has(t)}function Ar(t){return vr.has(t)}function ae(t){let{tag:e,key:r}=t;if(typeof e=="function")try{e=e(t,t.state,t.context)}catch(o){e=void 0,typeof console<"u"&&console.error&&console.error(`[smbls] \`tag:\` factory threw on "${r||"<anon>"}" \u2014 falling back to key-based tag detection:`,o?.message||o)}if(e===!0&&(e=r),typeof e=="string"&&kr(e))return e;if(!r||typeof r!="string")return"div";let n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]),s=r.toLowerCase();return s.includes(".")&&(s=s.split(".")[0]),s.includes("_")&&(s=s.split("_")[0]),kr(s)&&!n.has(s)?s:"div"}var Dn={};function Cr(t,e){let r=e?.context?.document||globalThis.document;if(!r)return null;if(t==="string")return r.createTextNode(e?.text||"");if(t==="fragment")return r.createDocumentFragment();if(Ar(t)){let n=e?.parent;if(t==="svg"||n?.node?.namespaceURI===wr)return r.createElementNS(wr,t);if(t!=="svg")return r.createElement("div")}return r.createElement(t)}function fe(t){let e=t.tag=ae(t),n=Ar(e)&&(e==="svg"||t.parent?.node?.namespaceURI===wr)?"svg:"+e:e,s=t?.context?.document||globalThis.document,o=Dn[n];if(o||(o=Dn[n]=Cr(e,t)),!o)return null;let i=s&&o.ownerDocument!==s?Cr(e,t):o.cloneNode(!0);return e==="string"&&(i.nodeValue=t.text||""),i}var et=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","__name","__ref","__hash","__text","parent","node"]);var le=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),Er=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),In=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),Or=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);var $r=t=>t==="em"||t==="rem"||t==="vw"||t==="vh"||t==="vmax"||t==="vmin",Tr=["px","cm","mm","in","pt","pc","em","rem","ex","cap","ch","ic","lh","rlh","%","vw","vh","vmin","vmax","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax","deg","rad","grad","turn","s","ms","dpi","dpcm","dppx","fr","auto"],Ei=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Oi=new RegExp(`^-?(?:\\d+\\.?\\d*|\\.\\d+)(?:${Tr.filter(t=>t!=="auto").map(Ei).join("|")})$`),jn=t=>Oi.test(String(t).trim());V();var rs=t=>{if(t==="")return[0,0,0,0];if(t.toLowerCase()==="transparent")return[0,0,0,0];if(t[0]==="#")return t.length<7&&(t="#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+(t.length>4?t[4]+t[4]:"")),[parseInt(t.substr(1,2),16),parseInt(t.substr(3,2),16),parseInt(t.substr(5,2),16),t.length>7?parseInt(t.substr(7,2),16)/255:1];if(t.indexOf("rgb")===-1&&St&&yt){let e=St.body.appendChild(St.createElement("fictum")),r="rgb(1, 2, 3)";if(e.style.color=r,e.style.color!==r){St.body.removeChild(e);return}if(e.style.color=t,e.style.color===r||e.style.color==="")return St.body.removeChild(e),[0,0,0,0];t=yt.getComputedStyle(e).color,St.body.removeChild(e)}return t.indexOf("rgb")===0?(t.indexOf("rgba")===-1&&(t=`${t}, 1`),t.match(/[\.\d]+/g).map(e=>+e)):[0,0,0,0]};var fc=(t,e=1)=>{let[r,n,s]=t.match(/\w\w/g).map(o=>parseInt(o,16));return[r,n,s]};var lc=([t,e,r])=>((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1);var uc=(t,e,r)=>{let n=Math.max(t,e,r),s=n-Math.min(t,e,r),o=1-Math.abs(n+n-s-1),i=s&&(n==t?(e-r)/s:n==e?2+(r-t)/s:4+(t-e)/s);return[60*(i<0?i+6:i),o?s/o:0,(n+n-s)/2]},dc=(t,e,r,n=e*Math.min(r,1-r),s=(o,i=(o+t/30)%12)=>r-n*Math.max(Math.min(i-3,9-i,1),-1))=>[s(0),s(8),s(4)],pc=(t,e)=>{let r=parseInt(t,16),n=(r>>16)+e;n>255?n=255:n<0&&(n=0);let s=(r>>8&255)+e;s>255?s=255:s<0&&(s=0);let o=(r&255)+e;return o>255?o=255:o<0&&(o=0),((o|s<<8|n<<16)+16777216).toString(16).slice(1)};var Q=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,Bt=/(?:rgba?\(|hsla?\(|#[0-9a-fA-F]{3,8}\b)/,hc=/^([a-zA-Z]\w*(?:-[a-zA-Z]\w*)*)(?:\.(\d+))?(?:([+-]\d+|=\d+))?$/,ke=t=>{if(!w(t))return null;if(Bt.test(t))return{passthrough:t};if(Q(t))return{cssVar:t};let e=t.match(hc);if(!e)return null;let[,r,n,s]=e,o=n!==void 0?`0.${n}`:void 0,i=s&&s[0]==="="?s.slice(1):s;return{name:r,alpha:o,tone:i}},Jt=t=>w(t)&&(t.includes("rgb")||t.includes("var(")||t.includes("#")),Ce=t=>{let e=[],r="",n=0;for(let s of t){if(s==="("?n+=1:s===")"&&n>0&&(n-=1),s===","&&n===0){e.push(r),r="";continue}r+=s}return(r.length||!e.length)&&e.push(r),e},ns=(t,e)=>{w(t)&&t.includes("rgb")&&(t=rs(t).join(", ")),w(t)&&(t=t.split(",").map(s=>parseFloat(s.trim()))),Ve(e)&&(e+="");let r=lc(t),n=e.slice(0,1);if(n==="-"||n==="+"){let s=pc(r,parseFloat(e));return fc(s).join(", ")}else{let[s,o,i]=t,[c,a]=uc(s/255,o/255,i/255),l=Math.max(0,Math.min(100,parseFloat(e)))/100;return dc(c,a,l).map(u=>Math.round(Math.max(0,Math.min(1,u))*255)).join(", ")}};var Gr=(t,e)=>{if(t[e])return t[e].value;if(t.default)return t[t.default].value;let r=Object.keys(t)[0];return r&&t[r]&&t[r].value};V();V();V();V();var Xe={};se(Xe,{animation:()=>jc,breakpoints:()=>Dc,class:()=>Bc,color:()=>Cc,devices:()=>Ic,document:()=>Rc,font:()=>mc,fontFace:()=>_c,fontFamily:()=>bc,fontFamilyTypes:()=>xc,gradient:()=>vc,grid:()=>Vc,icons:()=>Oc,media:()=>Sc,reset:()=>Uc,semanticIcons:()=>$c,sequence:()=>Ut,shadow:()=>Ec,sizes:()=>zc,spacing:()=>kc,svg:()=>Mc,svgData:()=>Lc,templates:()=>Fc,theme:()=>Ac,timing:()=>Pc,typography:()=>Hr,unit:()=>gc,vars:()=>Wc});var Ut={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,"minor-sixth":1.6,phi:1.618,"major-sixth":1.667,"square-root-3":1.732,"minor-seventh":1.778,"major-seventh":1.875,octave:2,"square-root-5":2.23,"major-tenth":2.5,"major-eleventh":2.667,"major-twelfth":3,pi:3.14,"double-octave":4};var gc={default:"em"};var yc={browserDefault:16,base:16,type:"font-size",ratio:Ut["minor-third"],range:[-3,12],h1Matches:6,lineHeight:1.5,subSequence:!0,mediaRegenerate:!1,unit:"em",templates:{},sequence:{},scales:{},vars:{}},Hr=yc;var mc={};var bc={},xc={"sans-serif":"Helvetica, Arial, sans-serif, --system-default",serif:"Times New Roman, Georgia, serif, --system-default",monospace:"Courier New, monospace, --system-default"},_c={};var Sc={tv:"(min-width: 2780px)",light:"(prefers-color-scheme: light)",dark:"(prefers-color-scheme: dark)",print:"print"};var wc={base:Hr.base,type:"spacing",ratio:Ut.phi,range:[-5,15],subSequence:!0,mediaRegenerate:!1,unit:"em",sequence:{},scales:{},vars:{}},kc=wc;var Cc={},vc={};var Ac={};var Ec={};var Oc={},$c={};var Tc={default:150,base:150,type:"timing",ratio:Ut["perfect-fourth"],range:[-3,12],mediaRegenerate:!1,unit:"ms",sequence:{},scales:{},vars:{}},Pc=Tc;var Rc={};var Dc={screenL:1920,screenM:1680,screenS:1440,tabletL:1366,tabletM:1280,tabletS:1024,mobileL:768,mobileM:560,mobileS:480,mobileXS:375},Ic={screenXXL:[2560,1440],screenXL:[2240,1260],screenL:[1920,1024],screenM:[1680,1024],screenS:[1440,720],tabletL:[1366,926],tabletM:[1280,768],tabletS:[1024,768],mobileL:[768,375],mobileM:[560,768],mobileS:[480,768],mobileXS:[375,768]};var jc={};var Mc={},Lc={};var Fc={};var Nc={},Vc=Nc;var Bc={};var Uc={},Wc={},zc={};var os={},ss={},Ye=Xe,Ze={},is=t=>t.replace(/_([a-z])/g,(e,r)=>r.toUpperCase());for(let t in Ye){let e=t.toLowerCase();Ze[e]=Ye[t];let r=is(e);r!==e&&(Ze[r]=Ye[t]),e!==t&&(Ze[t]=Ye[t])}var qr={verbose:!1,useVariable:!0,useReset:!0,globalTheme:"auto",cssVars:os,cssMediaVars:ss,CSS_VARS:os,CSS_MEDIA_VARS:ss,_scratchConfig:!0,...Ze},td=Ht(qr),tr={active:"0",0:qr};var ve=[],z=t=>{t&&t._scratchConfig&&ve.push(t)},U=()=>{ve.pop()},P=t=>ve.length?ve[ve.length-1]:tr[t||tr.active]||qr;var er={"-6":"U","-5":"V","-4":"W","-3":"X","-2":"Y","-1":"Z",0:"A",1:"B",2:"C",3:"D",4:"E",5:"F",6:"G",7:"H",8:"I",9:"J",10:"K",11:"L",12:"M",13:"N",14:"O",15:"P",16:"Q",17:"R",18:"S",19:"T"},cs=(t,e)=>{let{key:r,variable:n,value:s,scaling:o,index:i,scalingVariable:c}=t;e.sequence[r]={key:r,decimal:~~(s*100)/100,val:~~s,scaling:o,index:i,scalingVariable:c,variable:n},e.scales[r]=o;let a=as.has(e.unit)?"rem":e.unit;e.vars[n]=o+a},Xt=t=>{if(!t.includes("("))return t;let e=t.split("(")[0],r=t.slice(t.indexOf("(")+1,t.lastIndexOf(")"));return[e,r]},as=new Set(["vw","vh","vmin","vmax","svw","svh","lvw","lvh","dvw","dvh"]),Gc=(t,e)=>{let{base:r,type:n,unit:s}=e,o=as.has(s)?"rem":s,i=($r(o)?1:r)+o;if(t===0)return i;let a="--"+(e.varPrefix?e.varPrefix+"-":"")+(n&&n.replace(".","-")),l=`${a}-ratio`;if(t>0){let f=er[t-1];return`calc(var(${a}-${f}) * var(${l}))`}if(t<0){let f=er[t+1],u=Math.abs(t),h=Math.pow(fs,2*u),p=er[u];return p?`max(calc(var(${a}-${f}) / var(${l})), calc(var(${a}-${p}) / ${h.toFixed(4)}))`:`calc(var(${a}-${f}) / var(${l}))`}},Hc=(t,e,r,n)=>{let{type:s}=n,i=t===2&&e.length===2?t+1:t,l=`${"--"+(n.varPrefix?n.varPrefix+"-":"")+(s&&s.replace(".","-"))}-sub-ratio-`;return`calc(var(${r}) * var(${l+i}))`},qc=(t,e)=>{let n=(t*e-t)/1.618,s=t*e-n,o=t+n,i=(s+o)/2;return[s,i,o]};var Kc=(t,e)=>{let{key:r,base:n,value:s,ratio:o,variable:i,index:c}=t,l=~~(s*o)-~~s,f,[u,h,p]=qc(s,o);l>16?f=[u,h,p]:f=[u,p],f.forEach((y,d)=>{let m=~~(y/n*1e3)/1e3,x=i+(d+1),b=c+(d+1)/10,g=Hc(d+1,f,i,e),_={key:r+(d+1),variable:x,value:y,scaling:m,scalingVariable:g,index:b};cs(_,e)})},fs=1.618,Qc=(t,e,r)=>{if(t>=0)return e*Math.pow(r,t);let n=Math.abs(t),s=e*Math.pow(r,t),o=e*Math.pow(r,n)/Math.pow(fs,2*n);return Math.max(s,o)},Ae=t=>{let{type:e,base:r,ratio:n,range:s,subSequence:o}=t,i=Math.abs(s[0])+Math.abs(s[1]),a="--"+(t.varPrefix?t.varPrefix+"-":"")+(e&&e.replace(".","-"))+"-";for(let l=0;l<=i;l++){let f=s[1]-l,u=er[f],h=Qc(f,r,n),p=~~(h/r*100)/100,y=a+u,d=Gc(f,t),m={key:u,variable:y,value:h,base:r,scaling:p,scalingVariable:d,ratio:n,index:f};cs(m,t),o&&Kc(m,t)}return t};var ls=(t="A",e)=>{let r=P(),{unit:n}=r;if(w(t)&&Q(t))return`var(${t})`;if(w(t)&&/^(?:env|var|calc|min|max|clamp)\(/.test(t.trim()))return t;if(w(t)){let g=r.sizes;if(g){let _=g[t]||g[t.toLowerCase()];if(_!==void 0)return t.slice(0,1)==="-"?`calc(${_} * -1)`:_}}let{sequence:s,unit:o=n.default,useVariable:i}=e,c=/^-?[a-zA-Z]/i,a=c.test(t);if(jn(t)||!a||["none","auto","max-content","min-content","fit-content","inherit","initial","unset","revert","revert-layer"].includes(t))return t;let h=`--${e.varPrefix?e.varPrefix+"-":""}${Xo(e.type.replace(".","-"))}-`,p=t.toUpperCase(),y=p.slice(0,1)==="-"?"-":"",d=y?p.slice(1):p,m="";d.includes("_")&&(m="_"+d.split("_")[1].toLowerCase(),d=d.split("_")[0]);let x=g=>c.test(g)?`var(${h}${g}${m})`:g;if(d.includes("+")){let[g,_]=d.split("+"),S=`${x(g)} + ${x(_)}`;return y?`calc((${S}) * -1)`:`calc(${S})`}else if(d.includes("*")){let[g,_]=d.split("*"),S=`${x(g)} * ${x(_)}`;return y?`calc((${S}) * -1)`:`calc(${S})`}else if(d.includes("-")){let[g,_]=d.split("-"),S=`${x(g)} - ${x(_)}`;return y?`calc((${S}) * -1)`:`calc(${S})`}if(!s[d]&&d.length===2&&(r.verbose&&console.warn(d,"- value is not found because `subSequence` is set to false"),d=d.slice(0,1)),i||r.useVariable){let g=`var(${h}${d}${m})`;return y?`calc(${g} * -1)`:g}let b=s?s[d]:null;if(!b){if(console.warn("can't find",s,d),At())throw new Error(`[smbls] Unresolvable design-system token "${t}"`+(e.type?` for sequence "${e.type}"`:"")+" \u2014 not a registered `sizes` name and not a valid spacing/typography/timing sequence letter. The CSS property using it would silently be dropped in production. Register the token in `designSystem/sizes.js` (or the relevant sequence family) or fix the typo.");return}return o==="ms"||o==="s"?y+b.val+o:y+b.scaling+o},Jc=(t,e)=>{if(!["+","-","*","/",","].filter(o=>t.includes(o+" ")).length)return t;let n=/(\s+-\s+|\s*[+*/,]\s*)/;return t.split(n).map(o=>{let i=o.trim();return!i||["+","-","*","/",","].includes(i)?o:ls(i,e)}).join("")},Wt=(t,e,r,n)=>{if(typeof t!="string")return P().verbose&&console.warn(e,t,"is not a string"),{[e]:t};if(t==="-"||t==="")return{};if(!n&&t.includes("(")){if(/^(?:env|var)\(/.test(t.trim()))return{[e]:t};let o=Xt(t);n=o[0],t=o[1]}return["+","-","*","/",","].filter(o=>t.includes(o+" ")).length?t=Jc(t,r):t=ls(t,r),{[e]:n?`${n}(${t})`:t}};V();var md=Mr();var Xc="line|circle|ellipse|rect|polyline|polygon|path|stop|use|image",bd=new RegExp(`<(${Xc})\\b([^>]*?)\\s*/>`,"g");V();var Zc={light:"(prefers-color-scheme: light)",dark:"(prefers-color-scheme: dark)"},dt=(t,e,r)=>{let n=r||P();if(!w(t)){n.verbose&&console.warn(t,"- type for color is not valid");return}if(Q(t))return`var(${t})`;e&&t[e]&&(t=t[e]);let s,o,i;if(M(t))[s,o,i]=t;else{let u=ke(t);if(!u){let{color:h,gradient:p}=n,y=p[t]||h[t];return y?(e&&y[e]&&(y=y[e]),n.useVariable?`var(${y.var})`:y.value):t}if(u.passthrough)return u.passthrough;if(u.cssVar)return`var(${u.cssVar})`;s=u.name,o=u.alpha,i=u.tone}let{color:c,gradient:a}=n,l=c[s]||a[s];if(!l)return n.verbose&&console.warn("Can't find color ",s),t;if(e)if(l[e]!==void 0)l=l[e];else if(M(l)){let u=e.charCodeAt(0)===64?e.slice(1):e;u==="dark"?l=l[1]!==void 0?l[1]:l[0]:(u!=="light"&&n.verbose&&console.warn(t," - array-form color tokens only support light/dark; falling back to the light slot for scheme",e),l=l[0])}else n.verbose&&console.warn(t," - does not have ",e);if(w(l))return dt(l,null,r);let f=l.rgb;if(!f){let u=n.useVariable?`var(${l.var})`:l.value;if(o&&u){let h=Math.round(parseFloat(o)*100);return`color-mix(in srgb, ${u} ${h}%, transparent)`}return u}return i&&!l[i]&&(f=ns(f,i),l[i]={rgb:f,var:`${l.var}-${i}`}),l[i]&&(f=l[i].rgb),o?`rgba(${f}, ${o})`:i?`rgba(${f}, 1)`:n.useVariable?`var(${l.var})`:`rgb(${f})`},pt=(t,e,r)=>{let n=r||P();if(e||(e=n.globalTheme==="auto"?null:n.globalTheme),!w(t)){n.verbose&&console.warn(t,"- type for color is not valid");return}if(Q(t))return`var(${t})`;let s,o,i;if(M(t))s=t[0];else{let u=ke(t);if(u){if(u.passthrough)return u.passthrough;if(u.cssVar)return`var(${u.cssVar})`;s=u.name,o=u.alpha,i=u.tone}else s=t}let{color:c,gradient:a}=n,l=c[s]||a[s],f=j(l);if(f&&l.value)return dt(t,`@${e}`,r);if(f){if(n.useVariable&&l.var)return o||i?dt(t,null,r):`var(${l.var})`;if(e)return dt(t,`@${e}`,r);{let u={};for(let h in l){if(h.charCodeAt(0)!==64)continue;let p=h.slice(1),y=n.media&&n.media[p]||Zc[p];if(!y)continue;let d="@media "+(y==="print"?`${y}`:`screen and ${y}`);u[d]=dt(t,h,r)}return u}}else return n.verbose&&console.warn("Can't find color",t),t};V();var Kr=t=>{let e=P(),r={};for(let n in t){let s=n.slice(0,1);if(Dt(t[n])){if(s==="@")continue;s===":"?r[`&${n}`]=Kr(t[n]):s==="."&&(r[`&${n}`]=Kr(t[n]))}else r[n]=t[n]}return r},ds=(t,e)=>{let r=e.shift();return t[r]?ds(t[r],e):t},us=(t,e)=>M(e)?ds(t,e):w(e)&&t[e]?t[e]:t;var Ee=(t,e)=>{let r=P();if(w(t)&&Q(t)&&(t=Ee(t.slice(2))),!t||!w(t)){r.verbose&&console.warn(`${t} - Theme is not a string`);return}let[n,...s]=M(t)?t:t.split(" "),o=r.theme[n];return o&&s.length?o=us(o,s):o&&e&&(o=us(o,e)),Kr(o)};var ps=(t,e)=>{let r=P(),{fontFamily:n}=r;return Gr(e||n,t)};var gs=t=>{let e=P(),{typography:r}=e;return Wt(t,"fontSize",r)};V();V();var ea=t=>{let r=P().spacing||{},n=parseFloat(t.spacingRatio),s={...r,ratio:Number.isFinite(n)?n:r.ratio,sequence:{},scales:{}};return Ae(s),s};var ys=t=>{let e=t.toLowerCase(),r=e.includes("width")||e.includes("height"),n=e.includes("border")||e.includes("outline");return r&&!n};var ra=t=>{let e=P(),{spacing:r}=e;return!t||!t.sequence?r:Object.keys(t.sequence).length>0?t:Ae(t)},J=(t,e="padding",r,n)=>{let s=ra(r);if(w(t)){if(!n&&/^(?:env|var)\(/.test(t.trim()))return{[e]:t};if(!n&&t.includes("(")){let i=Xt(t);n=i[0],t=i[1]}}let o=n?[t]:Yo(t);if(M(o)){if(o.length>1){let i="";e==="borderWidth"&&(e="border",i="Width");let c={2:["Block","Inline"],3:["BlockStart","Inline","BlockEnd"],4:["BlockStart","InlineEnd","BlockEnd","InlineStart"]},a=(l,f)=>Wt(o[f],e+l+i,s,n);return c[o.length].map((l,f)=>a(l,f))}return Wt(t,e,s,n)}},Yt=(t,e,r,n)=>{let s=P(),{spacing:o}=s,i=r||t[e];if(!n&&w(i)&&/^(?:env|var)\(/.test(i.trim()))return{[e]:i};if(!n&&w(i)&&i.includes("(")){let c=Xt(i);n=c[0],i=c[1]}if(t.spacingRatio){let c=ea(t);return J(i,e,c,n)}return J(i,e,o,n)},ms=t=>{let e=r=>{let n=["+","-","*","/"].includes(r),s=Tr.some(i=>t.includes(i));return n||s?r:r.length<3&&/[A-Z]/.test(r)?r+"_default":r};return t.split(",").map(r=>r.trim()).map(e).join(",").split(" ").map(e).join(" ")};V();var bs=(t,e)=>{let r=P();if(e||(e=r.globalTheme==="auto"?null:r.globalTheme),!w(t)){r.verbose&&console.warn(t,"- type for color is not valid");return}if(Q(t))return`var(${t})`;let[n]=M(t)?t:t.split(" "),o=r.shadow[n],i=j(o);if(!o)return r.verbose&&console.warn("Can't find color ",n),t;if(e){let c=o["@"+e]||o[e];if(c)return c.value!==void 0?c.value:c;r.verbose&&console.warn(t," - does not have ",e)}if(i&&o.value)return o.value;if(i){let c={};for(let a in o){if(a.charCodeAt(0)!==64)continue;let l=r.media[a.slice(1)];if(!l)continue;let f="@media "+(l==="print"?`${l}`:`screen and ${l}`),u=o[a],h=u&&(u.value!==void 0?u.value:u);h!==void 0&&(c[f]=h)}return c}return r.verbose&&console.warn("Can't find color",t),t};V();var Ot=t=>{let e=P(),{timing:r}=e;return r[t]||r[Jo(t)]||t},Ct=(t,e="timing")=>{let r=P(),{timing:n}=r;return Wt(t,e,n)};V();var ia=new Set(["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial"]),ca=new Set(["to","top","bottom","left","right","center","at","circle","ellipse","closest-side","farthest-side","closest-corner","farthest-corner"]),aa=t=>ia.has(t),jt=t=>{let e=t+"";if(Bt.test(e))return e;let r=e.trim();return r==="none"||r==="0"||r==="initial"||r==="inherit"||r==="unset"?e:e.split(/\s+/).map(s=>{if(s=s.trim(),!s)return"";if(Q(s))return`var(${s})`;if(aa(s)||/^\d/.test(s)||s==="0")return s;let o=dt(s);if(Jt(o))return o;let i=J(s,"border");return i&&i.border?i.border:s}).join(" ")},xs=t=>Bt.test(t)?t:t.split(/\s+/).map(e=>{if(e=e.trim(),!e)return"";if(Q(e))return`var(${e})`;if(/^\d/.test(e)||e.includes("px")||e==="0")return e;let r=dt(e);return Jt(r)?r:e}).join(" "),_s=(t,e)=>bs(t,e),Qr=(t,e)=>Bt.test(t)?t:Ce(t).map(r=>(r=r.trim(),r?r.split(/\s+/).map(n=>{if(n=n.trim(),!n)return"";if(Q(n))return`var(${n})`;if(n==="inset"||n==="none")return n;let s=dt(n);if(Jt(s)){let i=pt(n,e);return j(i)?Object.values(i).filter(c=>c.includes(": "+e))[0]:i}if(/^\d/.test(n)||n==="0"||n.includes("px")||n.slice(-2)==="em")return n;let o=J(n,"shadow");return o&&o.shadow?o.shadow:n}).join(" "):"")).join(", "),Jr=(t,e)=>{let r=t.indexOf("(");if(r===-1)return t;let n=t.slice(0,r+1),s=t.slice(r+1,t.lastIndexOf(")")),o=")",c=Ce(s).map(a=>(a=a.trim(),a.split(/\s+/).map(f=>{if(!f||/^\d/.test(f)||f==="0"||ca.has(f)||f==="transparent"||Bt.test(f))return f;let u=dt(f);return Jt(u)?u:f}).join(" ")));return n+c.join(", ")+o},Ss=(t,e)=>{let r=P();return Ce(t).map(n=>{let s=n.trim();if(Q(s))return`var(${s})`;if(/^var\(/.test(s)||s.includes("url"))return s;if(r.gradient?.[s]){let o=pt(s,e);if(w(o))return o;if(j(o)){for(let i in o)if(w(o[i]))return o[i]}return s}return s.includes("gradient")?Jr(s,e):s.includes("/")||s.startsWith("http")||s.includes(".")&&!ke(s)?`url(${s})`:s}).join(", ")},ws=t=>w(t)&&t.split(" ").map(e=>J(e,"gap").gap).join(" "),fa=t=>{let e=t.split(" ");return e.length?e.map(r=>Q(r)?`var(${r})`:r.length<3||r.includes("ms")?Ct(r).timing||r:Ot(r)?Ot(r):r).join(" "):t},Xr=(t,e,r)=>{if(w(t))return t.split(",").map(n=>Ct(n).timing||n).join(",")},ks=t=>{let e=t.split(",");if(e.length)return e.map(fa).join(",")};function W(t,e,r={},n={}){let s=qt.call(this,e||r[t]);if(s==null)return;let o;if(w(s)){if(/^(?:env|var)\(/.test(s.trim()))return{[t]:s};if(s.includes("(")){let a=Xt(s);o=a[0],s=a[1]}let i=r.scaleBoxSize,c=ys(t);!i&&c&&!n.ratio&&(s=ms(s))}return n.ratio?Yt(r,t,s,o):J(s,t,void 0,o)}var C=(t,e=null,r)=>W(t,e,r,{ratio:!0}),Yr=(t,e,r)=>{if(w(t))return{borderRadius:t.split(" ").map((n,s)=>Yt(e,r,n)[r]).join(" ")}};var Zr=new WeakMap,la={passive:!0},ua={passive:!0,capture:!0},tn=(t,e)=>In.has(t)?e?ua:la:e||!1;function vs(t){let e=Zr.get(t);return e||(e={handlers:new Map,installed:new Set},Zr.set(t,e)),e}function da(t,e){let r=vs(e);if(r.installed.has(t))return;r.installed.add(t);let n=t==="focus"||t==="blur"||t==="focusin"||t==="focusout"||t==="mouseenter"||t==="mouseleave",s=t==="mouseenter"||t==="mouseleave";e.addEventListener(t,o=>{let i=o.target;for(;i&&i!==e;){let c=r.handlers.get(t);if(c){let a=c.get(i);if(a){if(s&&o.relatedTarget&&i.contains(o.relatedTarget)){i=i.parentNode;continue}if(a(o),o.cancelBubble)return}}i=i.parentNode}},tn(t,n))}function As(t,e,r,n){n||(n=e.ownerDocument?.documentElement||e.getRootNode());let s=vs(n);da(t,n),s.handlers.has(t)||s.handlers.set(t,new WeakMap),s.handlers.get(t).set(e,r)}function Es(t,e,r){r||(r=e.ownerDocument?.documentElement||e.getRootNode());let n=Zr.get(r);if(!n)return;let s=n.handlers.get(t);s&&s.delete(e)}function Cs(t){return Or.has(t)&&!le.has(t)}function Oe(t,e,r){let{node:n,context:s}=e;if(!n)return;let o=s?.designSystem,i=a=>{o&&z(o);try{let l=r.call(e,a,e,e.state,s);if(l&&typeof l.then=="function"){l.catch(f=>{e.error=f,console.error("[DOMQL] Async event error:",f)}).finally(()=>{o&&U()});return}}catch(l){if(e.error=l,console.error("[DOMQL] Event error:",l),s?.strictMode)throw l}o&&U()},c=Er.has(t);if(!c&&Cs(t)){let a=s?.rootNode||n.ownerDocument?.documentElement;As(t,n,i,a)}else n.addEventListener(t,i,tn(t,!1));e.__ref.__eventCleanup||(e.__ref.__eventCleanup=[]),e.__ref.__eventCleanup.push(()=>{if(!c&&Cs(t)){let a=s?.rootNode||n.ownerDocument?.documentElement;Es(t,n,a)}else n.removeEventListener(t,i,tn(t,!1))})}function Os(t){let e=[];return t.extends&&(Array.isArray(t.extends)?e.push(...t.extends):e.push(t.extends)),t.extend&&(Array.isArray(t.extend)?e.push(...t.extend):e.push(t.extend)),e}function $e(t,e,r){let n=Os(e);if(!n.length)return;let o=(t.context||r?.context||{}).components||{};for(let i=0;i<n.length;i++){let c=$s(n[i],o);c&&c!==e&&Ts(t,c,r,new Set([e]))}}function $s(t,e){if(typeof t=="string"){if(t.includes(">")){let r=t.split(">").map(s=>s.trim()),n=e[r[0]]||e[`smbls.${r[0]}`];for(let s=1;s<r.length&&n;s++)n=n[r[s]];return n||null}return e[t]||e[`smbls.${t}`]||null}return typeof t=="object"&&t!==null?t:null}function Ts(t,e,r,n=new Set){if(n.has(e))return;n.add(e);let s=Os(e);if(s.length){let i=(t.context||r?.context||{}).components||{};for(let c=0;c<s.length;c++){let a=$s(s[c],i);a&&Ts(t,a,r,n)}}for(let o in e){if(o==="extends"||o==="extend")continue;let i=e[o];t[o]===void 0?i&&typeof i=="object"&&!Array.isArray(i)&&typeof i!="function"?t[o]={...i}:t[o]=i:typeof t[o]=="object"&&typeof i=="object"&&!Array.isArray(t[o])&&!Array.isArray(i)&&t[o]!==null&&i!==null?t[o]=Ps(t[o],i):t[o]=i}}function Ps(t,e){let r={...t};for(let n in e){let s=r[n],o=e[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)&&typeof s!="function"&&typeof o!="function"?r[n]=Ps(s,o):r[n]=o}return r}We();V();var en={default:["accesskey","autofocus","class","contenteditable","contextmenu","dir","draggable","hidden","id","lang","part","placeholder","slot","spellcheck","style","tabindex","title","translate","inert","radiogroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autocapitalize","autocorrect","autosave","color","itemprop","itemscope","itemtype","itemid","itemref","results","security","unselectable","is"],a:["accesskey","charset","coords","download","href","hreflang","name","rel","rev","shape","target","type"],aria:["aria-activedescendant","aria-atomic","aria-autocomplete","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],anchor:["download","href","hreflang","media","ping","rel","target","type","referrerpolicy"],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],area:["alt","coords","download","href","hreflang","media","referrerpolicy","rel","shape","target","ping"],base:["href","target"],blockquote:["cite"],button:["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","type","value"],canvas:["height","width"],col:["span","width"],colgroup:["span"],data:["value"],details:["open"],del:["cite","datetime"],dialog:["open"],embed:["height","src","type","width"],fieldset:["disabled","form","name"],form:["acceptcharset","action","autocomplete","enctype","method","name","novalidate","target","rel"],html:["manifest"],iframe:["allow","allowfullscreen","allowtransparency","frameborder","height","loading","marginheight","marginwidth","mozallowfullscreen","name","referrerpolicy","sandbox","scrolling","seamless","src","srcdoc","webkitallowfullscreen","width"],img:["alt","crossorigin","decoding","height","ismap","loading","referrerpolicy","sizes","src","srcset","usemap","width"],ins:["cite","datetime"],input:["accept","alt","autocomplete","capture","checked","crossorigin","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","indeterminate","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","src","step","type","value","width"],keygen:["challenge","disabled","form","keytype","keyparams","name"],label:["form","for"],li:["value"],link:["as","crossorigin","href","hreflang","integrity","media","imagesrcset","imagesizes","referrerpolicy","rel","sizes","type","charset"],map:["name"],menu:["type"],media:["autoplay","controls","currenttime","defaultmuted","defaultplaybackrate","loop","mediagroup","muted","playsinline","preload","src","volume"],meta:["charset","content","http-equiv","name","media"],meter:["form","high","low","max","min","optimum","value"],quote:["cite"],object:["classid","data","form","height","name","type","usemap","width","wmode"],ol:["reversed","start","type"],optgroup:["disabled","label"],option:["disabled","label","selected","value"],output:["form","for","name"],param:["name","value"],progress:["max","value"],slot:["name"],script:["async","charset","crossorigin","defer","integrity","nomodule","nonce","referrerpolicy","src","type"],select:["autocomplete","disabled","form","multiple","name","required","size","value","onchange"],source:["height","media","sizes","src","srcset","type","width"],style:["media","nonce","scoped","type"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],textarea:["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","value","wrap"],td:["align","colspan","headers","rowspan","scope","abbr","height","width","valign"],th:["align","colspan","headers","rowspan","scope","abbr"],time:["datetime"],track:["default","kind","label","src","srclang"],video:["autoplay","controls","crossorigin","disablepictureinpicture","disableremoteplayback","height","loop","muted","playsinline","poster","preload","src","width"],svg:["className","class","color","height","id","lang","max","media","method","min","name","style","target","type","width","role","tabindex","crossorigin","accent-height","accumulate","additive","alignment-baseline","allowReorder","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","clip","clip-path","clipPathUnits","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","end","exponent","externalResourcesRequired","fill","fill-opacity","fill-rule","filter","filterRes","filterUnits","flood-color","flood-opacity","focusable","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","format","from","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","href","horiz-adv-x","horiz-origin-x","ideographic","image-rendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","markerHeight","marker-mid","marker-start","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","paint-order","panose-1","path","pathLength","patternContentUnits","patternTransform","patternUnits","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","surfaceScale","systemLanguage","tableValues","targetX","targetY","text-anchor","text-decoration","textLength","text-rendering","to","transform","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","values","vector-effect","version","vert-adv-y","vert-origin-x","vert-origin-y","v-hanging","v-ideographic","viewBox","viewTarget","visibility","v-mathematical","widths","word-spacing","writing-mode","x1","x2","x","xChannelSelector","x-height","xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xmlns","xmlns:xlink","xml:space","y1","y2","y","yChannelSelector","z","zoomAndPan"]};var Te=t=>t.startsWith("aria")&&t.length>4&&t.charCodeAt(4)>=65&&t.charCodeAt(4)<=90?"aria-"+t.charAt(4).toLowerCase()+t.slice(5).replace(/([A-Z])/g,e=>"-"+e.toLowerCase()):t.startsWith("data")&&t.length>4&&t.charCodeAt(4)>=65&&t.charCodeAt(4)<=90?"data-"+t.charAt(4).toLowerCase()+t.slice(5).replace(/([A-Z])/g,e=>"-"+e.toLowerCase()):ha(t),pa=new Set(["tabIndex","readOnly","maxLength","minLength","autoComplete","autoFocus","autoPlay","contentEditable","spellCheck","colSpan","rowSpan","srcSet","crossOrigin","accessKey","inputMode","enterKeyHint","formAction","noValidate"]),ha=t=>pa.has(t)?t.toLowerCase():null,ga=new Set(["draggable","contenteditable","spellcheck","autocorrect"]),rn=t=>typeof t=="string"&&(ga.has(t)||t.startsWith("aria-")),nr=(t,e)=>e!==!0&&e!==!1?e:rn(t)?e?"true":"false":e===!0?"":e,Pe=(t,e)=>e.startsWith("aria-")||e.startsWith("data-")||Te(e)||en.default.includes(e)?!0:Object.prototype.hasOwnProperty.call(en,t)?en[t].includes(e):!1;var rr=(t,e)=>{let r=t.call("exec",e,t);if(r)return w(r)&&r.includes("{{")&&(r=t.call("replaceLiteralsWithObjectFields",r)),r},Rs=(t,e)=>{let r=(t.preSrc||"")+(rr(t,e)||"");if(!r)return;try{return new URL(r),r}catch{}let{context:n}=t;if(!n.files&&!n.assets)return r;if(r.startsWith("/assets/")){let s=r.slice(8),o=n.assets&&(n.assets[r]||n.assets[s]);return o&&o.content?o.content.src:r}if(r.startsWith("/files/")){let s=r.slice(7),o=n.files&&(n.files[r]||n.files[s]);return o&&o.content?o.content.src:r}if(n.assets){let s=n.assets[r];if(s&&s.content)return s.content.src}if(n.files){let s=n.files[r];if(s&&s.content)return s.content.src}return r},Ds={src:t=>Rs(t,t.src),href:t=>rr(t,t.href),action:t=>rr(t,t.action),poster:t=>Rs(t,t.poster),data:t=>rr(t,t.data)},Is=t=>{let e=t.tag||"div",r={};for(let n in Ds)if(t[n]!==void 0&&Pe(e,n)){let s=Ds[n](t);s!==void 0&&(r[n]=s)}return r};function nn(t={},e={}){let r=this,n=r.__ref;if(!n)return;if((typeof t=="string"||typeof t=="number")&&(t={text:t}),!e.preventListeners&&typeof r.onBeforeUpdate=="function"&&r.onBeforeUpdate(r,r.state,r.context,e)===!1)return r;let s=!t||Object.keys(t).length===0;if(vt(()=>{if(t.state&&G(r.state)&&r.state.$update(t.state),t.text!==void 0&&(r.text=t.text,!n.__exec.text&&r.node&&(r.tag==="string"?r.node.nodeValue=t.text??"":r.node.textContent=t.text??"")),t.html!==void 0&&(r.html=t.html,!n.__exec.html&&r.node&&(r.node.innerHTML=t.html)),t.style&&r.node?.style){if(!n.__exec.style)for(let o in t.style){let i=t.style[o];if(i==null)continue;let c=o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=String(i).replace(/\s*!important\s*$/,"");r.node.style.setProperty(c,a,"important")}r.style||(r.style={}),Object.assign(r.style,t.style)}if(t.attr&&r.node?.setAttribute){for(let o in t.attr){let i=t.attr[o];i==null||i===!1?r.node.removeAttribute(o):typeof i!="function"&&typeof i!="object"&&r.node.setAttribute(o,nr(o,i))}r.attr||(r.attr={}),Object.assign(r.attr,t.attr)}if(t.data&&r.node?.dataset){for(let o in t.data)r.node.dataset[o]=t.data[o];r.data||(r.data={}),Object.assign(r.data,t.data)}for(let o in t){if(et.has(o)||o==="state")continue;let i=t[o],c=r[o];if(c&&c.__ref&&typeof c.update=="function")c.update(i,e);else if(typeof i=="object"&&i!==null){let a=o.charCodeAt(0);a>=65&&a<=90&&ht(i,r,o,e)}else o!=="text"&&o!=="html"&&o!=="style"&&o!=="attr"&&o!=="data"&&(r[o]=i)}}),r.node&&s&&n.__effects&&n.__effects.length)for(let o=0;o<n.__effects.length;o++){let i=n.__effects[o];i&&!i._disposed&&!i._isSubscribeToEffect&&typeof i._execute=="function"&&i._execute()}else if(r.node&&n.__conditionalRunners)for(let o of n.__conditionalRunners)o();return wt("update",r),!e.preventListeners&&typeof r.onUpdate=="function"&&r.onUpdate(r,r.state,r.context,e),r}function on(t){if(!t)return;let e=t.__ref;if(!e)return;try{typeof t.onBeforeRemove=="function"&&t.onBeforeRemove(t,t.state,t.context)}catch(n){console.error("[smbls] onBeforeRemove error:",n)}if(e.__effects){for(let n=0;n<e.__effects.length;n++)e.__effects[n].dispose();e.__effects.length=0}if(e.__eventCleanup){for(let n=0;n<e.__eventCleanup.length;n++)e.__eventCleanup[n]();e.__eventCleanup.length=0}if(e.__children){for(let n=0;n<e.__children.length;n++){let s=e.__children[n],o=t[s];o&&o.__ref&&on(o)}e.__children.length=0}t.node?.parentNode?t.node.remove():t.tag==="fragment"&&e.__fragmentAnchor?.parentNode&&e.__fragmentAnchor.remove();let r=t.state?.$destroy||t.state?.destroy;if(typeof r=="function"&&t.state.__element===t&&r.call(t.state),t.parent?.__ref?.__children){let n=t.parent.__ref.__children.indexOf(t.key);n!==-1&&t.parent.__ref.__children.splice(n,1),delete t.parent[t.key]}try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(n){console.error("[smbls] onRemove error:",n)}t.node=null,t.parent=null,t.__ref=null}function sn(){on(this)}V();V();var Re=new Map,ya=null,js=null;var Ms=t=>!!(t&&t.documentElement&&typeof t.createElement=="function"&&t.head!==void 0);function Vs(){try{let t=P();if(t){if(Ms(t.__domDocument))return t.__domDocument;if(Ms(t.document))return t.document}}catch{}return typeof document<"u"?document:null}var ma={display:"d",position:"pos",padding:"p",paddingTop:"pt",paddingRight:"pr",paddingBottom:"pb",paddingLeft:"pl",margin:"m",marginTop:"mt",marginRight:"mr",marginBottom:"mb",marginLeft:"ml",width:"w",height:"h",minWidth:"mnw",minHeight:"mnh",maxWidth:"mxw",maxHeight:"mxh",top:"t",right:"r",bottom:"b",left:"l",flex:"fx",flexDirection:"fxd",flexWrap:"fxw",flexGrow:"fxg",flexShrink:"fxs",flexBasis:"fxb",justifyContent:"jc",alignItems:"ai",alignSelf:"as",alignContent:"ac",gap:"g",rowGap:"rg",columnGap:"cg",gridTemplateColumns:"gtc",gridTemplateRows:"gtr",gridColumn:"gc",gridRow:"gr",overflow:"of",overflowX:"ofx",overflowY:"ofy",fontSize:"fs",fontWeight:"fw",fontFamily:"ff",fontStyle:"fst",lineHeight:"lh",letterSpacing:"ls",textAlign:"ta",textDecoration:"td",textTransform:"tt",color:"c",background:"bg",backgroundColor:"bgc",backgroundImage:"bgi",border:"bd",borderRadius:"br",borderColor:"bdc",borderWidth:"bdw",borderStyle:"bds",boxShadow:"bxsh",opacity:"op",zIndex:"z",cursor:"cur",transition:"tr",transform:"tf",animation:"an",visibility:"vis",whiteSpace:"ws",wordBreak:"wb",objectFit:"obj",pointerEvents:"pe",userSelect:"us",boxSizing:"bxz",outline:"ol",listStyle:"lis",textOverflow:"txo",verticalAlign:"va",float:"fl",clear:"cl",content:"cnt",backdropFilter:"bdf",filter:"flt",resize:"rsz",appearance:"apr",fill:"fil",stroke:"stk"};function or(t){return t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function sr(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=e*16777619>>>0;return e.toString(36)}function ba(t){let e=String(t);return e.length<=20?e.replace(/\s+/g,"_").replace(/[^a-zA-Z0-9_-]/g,"").toLowerCase():sr(e)}var xa={"backdrop-filter":"-webkit-backdrop-filter","user-select":"-webkit-user-select"};function an(t,e){let r=xa[t];return r?`${t}:${e};${r}:${e};`:`${t}:${e};`}var _a="@media (hover: hover)",Sa=/(?:^|[^\\]):hover(?![\w-])/;function Bs(){try{let t=P();if(t&&t.hoverMedia===!1)return!1}catch{}return!0}function zt(t,e,r){return r===!1||!Sa.test(e)||r===void 0&&!Bs()?t:`${_a}{${t}}`}function Ls(t,e,r){let n=(r?r+"":"")+t+":"+e,s=Re.get(n),o=s?null:or(t);if(!s){let a=ma[t]||sr(t),l=ba(e);s=r?`_${r}_${a}-${l}`:`_${a}-${l}`,Re.set(n,s)}if(typeof e=="string"&&(e.indexOf("}")!==-1||e.indexOf("{")!==-1))return s;let i=o||or(t),c=`.${s}{${an(i,e)}}`;return Mt(c),s}var Fs=new WeakMap;function Mt(t,e){let r=wa(e);if(!r)return;let n=Fs.get(r);if(n||(n=new Set,Fs.set(r,n)),!n.has(t)){n.add(t);try{r.insertRule(t,r.cssRules.length)}catch{}}}var Ns=new WeakMap;function wa(t){let e=t||Vs();if(!e||!e.head)return null;let r=Ns.get(e);if(r&&r.ownerNode&&r.ownerNode.parentNode===e.head)return r;let n=e.head.querySelector("style[data-smbls]");n||(n=e.createElement("style"),n.setAttribute("data-smbls",""),e.head.appendChild(n));let s=n.sheet;return Ns.set(e,s),ya=s,s}var ka=8;function Zt(t,e,r){if(!t||typeof t!="object")return"";let n=null,s=0,o=[],i=[];for(let a in t){let l=t[a];l==null||l===!1||l===""||(typeof l=="object"?i.push([a,l]):js?(n||(n=[]),n.push(a,String(l)),s++):o.push(Ls(a,String(l),r)))}if(n&&s>=ka){let a=n.join("\0"),l=js(a),f=l.indexOf("\0"),u=l.substring(0,f),h=l.substring(f+1);if(h){let p=h.split(`
|
|
11
|
-
`);for(let y=0;y<p.length;y++)p[y]&&Mt(p[y])}o.push(u)}else if(n)for(let a=0;a<n.length;a+=2)o.push(Ls(n[a],n[a+1],r));let c=[];for(let a=0;a<i.length;a++)c.push(Ca(i[a][0],i[a][1],r));return o.concat(c).join(" ").trim()}var cn=new Map;function Ca(t,e,r){let n=JSON.stringify(e),s=t.indexOf(":hover")!==-1||n.indexOf(":hover")!==-1,o=s&&Bs(),i=(r?r+"":"")+t+n+(s&&!o?"rawhover":""),c=Re.get(i);if(c){let d=cn.get(c);if(d)for(let m=0;m<d.length;m++)Mt(d[m]);return c}c=r?`_${r}_c${sr(i)}`:`_c${sr(i)}`;let a="",l=[],f=d=>typeof d=="string"&&(d.indexOf("{")!==-1||d.indexOf("}")!==-1),u=(d,m)=>{let x="";for(let b in m){let g=m[b];if(g!=null)if(typeof g=="object")u([...d,b],g);else{if(f(g))continue;x+=an(or(b),g)}}x&&(d.length===0?a+=x:l.push({chain:d,body:x}))};u([],e);let h=d=>{if(!d.length)return`.${c}`;let m=d[0].split(",").map(x=>x.trim()).map(x=>x.includes("&")?x.replace(/&/g,`.${c}`):x.startsWith(":")?`.${c}${x}`:`.${c} ${x}`);for(let x=1;x<d.length;x++){let b=d[x].split(",").map(_=>_.trim()),g=[];for(let _ of m)for(let S of b)S.includes("&")?g.push(S.replace(/&/g,_)):S.startsWith(":")?g.push(_+S):g.push(_+" "+S);m=g}return m.join(", ")},p=[];if(t.startsWith("@media")||t.startsWith("@supports")){if(a){let d=`${t}{.${c}{${a}}}`;p.push(d),Mt(d)}for(let d of l){let m=h(d.chain),x=zt(`${t}{${m}{${d.body}}}`,m,o);p.push(x),Mt(x)}return cn.set(c,p),Re.set(i,c),c}let y=h([t]);if(a){let d=zt(`${y}{${a}}`,y,o);p.push(d),Mt(d)}for(let d of l){let m=h([t,...d.chain]),x=zt(`${m}{${d.body}}`,m,o);p.push(x),Mt(x)}return cn.set(c,p),Re.set(i,c),c}function ir(t,e){let r="";for(let n in e){let s="";for(let o in e[n])s+=an(or(o),e[n][o]);r+=`${n}{${s}}`}return Mt(`@keyframes ${t}{${r}}`),t}var va=["ease","linear","ease-in","ease-out","ease-in-out","step-start","step-end"],Aa=["none","forwards","backwards","both"],Ea=["normal","reverse","alternate","alternate-reverse"],Oa=["running","paused"],$a=t=>/^[\d.]+m?s$/.test(t),Ta=0,Us=new Map,fn=(t,e)=>{let{animation:r}=e.context&&e.context.designSystem||{};if(j(t)){let s=JSON.stringify(t),o=Us.get(s);if(o)return o;let i=`smbls-anim-${Ta++}`,c=ir(i,t);return Us.set(s,c),c}let n=r&&r[t];return j(n)?ir(t,n):t},Pa=(t,e)=>{let{animation:r}=e.context&&e.context.designSystem||{},n=t.split(/\s+/),s=null,o=[],i=null,c=null,a=null,l=null,f=null;for(let u of n)r&&r[u]?s=u:$a(u)?o.push(u):va.includes(u)||u.startsWith("cubic-bezier")||u.startsWith("steps(")?i=u:u==="infinite"||/^\d+$/.test(u)?c=u==="infinite"?u:Number(u):Ea.includes(u)?a=u:Aa.includes(u)?l=u:Oa.includes(u)?f=u:s||(s=u);return{name:s,durations:o,timingFunction:i,iterationCount:c,direction:a,fillMode:l,playState:f}},Ws={animation:(t,e)=>{if(w(t)&&t.includes(" ")){let r=Pa(t,e);return{animationName:fn(r.name||t,e),animationDuration:r.durations[0]||Ct(e.animationDuration||"A").timing,animationDelay:r.durations[1]||Ct(e.animationDelay||"0s").timing,animationTimingFunction:r.timingFunction||Ot(e.animationTimingFunction||"ease"),animationFillMode:r.fillMode||e.animationFillMode||"both",animationIterationCount:r.iterationCount!=null?r.iterationCount:e.animationIterationCount||1,animationPlayState:r.playState||e.animationPlayState,animationDirection:r.direction||e.animationDirection}}return{animationName:fn(t,e),animationDuration:Ct(e.animationDuration||"A").timing,animationDelay:Ct(e.animationDelay||"0s").timing,animationTimingFunction:Ot(e.animationTimingFunction||"ease"),animationFillMode:e.animationFillMode||"both",animationIterationCount:e.animationIterationCount||1,animationPlayState:e.animationPlayState,animationDirection:e.animationDirection}},animationName:(t,e)=>({animationName:fn(t,e)}),animationDuration:t=>({animationDuration:Ct(t).timing}),animationDelay:t=>({animationDelay:Ct(t).timing}),animationTimingFunction:t=>({animationTimingFunction:Ot(t)}),animationIterationCount:t=>({animationIterationCount:t}),animationFillMode:t=>({animationFillMode:t}),animationPlayState:t=>({animationPlayState:t}),animationDirection:t=>({animationDirection:t})};V();var zs={show:t=>t?void 0:{display:"none !important"},hide:t=>t?{display:"none !important"}:void 0,height:(t,e)=>C("height",t,e),width:(t,e)=>C("width",t,e),boxSizing:t=>Mn(t)?{boxSizing:"border-box"}:{boxSizing:t},boxSize:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("height",e),...W("width",r||e)}},inlineSize:(t,e)=>C("inlineSize",t,e),blockSize:(t,e)=>C("blockSize",t,e),minWidth:(t,e)=>C("minWidth",t,e),maxWidth:(t,e)=>C("maxWidth",t,e),widthRange:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("minWidth",e),...W("maxWidth",r||e)}},minHeight:(t,e)=>C("minHeight",t,e),maxHeight:(t,e)=>C("maxHeight",t,e),heightRange:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("minHeight",e),...W("maxHeight",r||e)}},size:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...C("inlineSize",e),...C("blockSize",r||e)}},minBlockSize:(t,e)=>C("minBlockSize",t,e),minInlineSize:(t,e)=>C("minInlineSize",t,e),maxBlockSize:(t,e)=>C("maxBlockSize",t,e),maxInlineSize:(t,e)=>C("maxInlineSize",t,e),minSize:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("minInlineSize",e),...W("minBlockSize",r||e)}},maxSize:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("maxInlineSize",e),...W("maxBlockSize",r||e)}},borderWidth:(t,e)=>C("borderWidth",t,e),borderTopWidth:(t,e)=>C("borderTopWidth",t,e),borderRightWidth:(t,e)=>C("borderRightWidth",t,e),borderBottomWidth:(t,e)=>C("borderBottomWidth",t,e),borderLeftWidth:(t,e)=>C("borderLeftWidth",t,e),padding:(t,e)=>C("padding",t,e),scrollPadding:(t,e)=>C("scrollPadding",t,e),paddingInline:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("paddingInlineStart",e),...W("paddingInlineEnd",r||e)}},paddingBlock:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("paddingBlockStart",e),...W("paddingBlockEnd",r||e)}},paddingTop:(t,e)=>C("paddingBlockStart",t,e),paddingBottom:(t,e)=>C("paddingBlockEnd",t,e),paddingLeft:(t,e)=>C("paddingInlineStart",t,e),paddingRight:(t,e)=>C("paddingInlineEnd",t,e),paddingBlockStart:(t,e)=>C("paddingBlockStart",t,e),paddingBlockEnd:(t,e)=>C("paddingBlockEnd",t,e),paddingInlineStart:(t,e)=>C("paddingInlineStart",t,e),paddingInlineEnd:(t,e)=>C("paddingInlineEnd",t,e),margin:(t,e)=>C("margin",t,e),marginInline:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("marginInlineStart",e),...W("marginInlineEnd",r||e)}},marginBlock:(t,e)=>{if(!w(e.marginBlock))return;let[r,n]=e.marginBlock.split(" ");return{...W("marginBlockStart",r),...W("marginBlockEnd",n||r)}},marginTop:(t,e)=>C("marginBlockStart",t,e),marginBottom:(t,e)=>C("marginBlockEnd",t,e),marginLeft:(t,e)=>C("marginInlineStart",t,e),marginRight:(t,e)=>C("marginInlineEnd",t,e),marginInlineStart:(t,e)=>C("marginInlineStart",t,e),marginInlineEnd:(t,e)=>C("marginInlineEnd",t,e),marginBlockStart:(t,e)=>C("marginBlockStart",t,e),marginBlockEnd:(t,e)=>C("marginBlockEnd",t,e),gap:t=>({gap:ws(t)}),columnGap:(t,e)=>Yt(e,"columnGap",t),rowGap:(t,e)=>Yt(e,"rowGap",t),flexWrap:t=>({display:"flex",flexWrap:t}),flexFlow:(t,e)=>{let r=e.reverse;if(!w(t))return;let[n,s]=(t||"row").split(" ");return(t.startsWith("x")||t==="row")&&(n="row"),(t.startsWith("y")||t==="column")&&(n="column"),{display:"flex",flexFlow:(n||"")+(!n.includes("-reverse")&&r?"-reverse":"")+" "+(s||"")}},flexAlign:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{display:"flex",alignItems:e,justifyContent:r}},round:(t,e)=>Yr(t??e.borderRadius,e,"round"),borderRadius:(t,e)=>Yr(t??e.round,e,"borderRadius")};var Gs={fontSize:t=>gs(t)||t,fontFamily:t=>({fontFamily:ps(t)||t}),fontWeight:t=>({fontWeight:t,fontVariationSettings:'"wght" '+t}),lineClamp:t=>{if(t!=null)return t==="none"?{WebkitLineClamp:"none",lineClamp:"none"}:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:String(t),lineClamp:String(t),overflow:"hidden"}}};var Hs={overflow:t=>({overflow:t}),cursor:(t,e,r,n)=>{if(!t)return;let s=n.assets&&n.assets[t];if(s&&s.content)t=`url(${s.content.src})`;else{let o=n.files&&n.files[t];o&&o.content&&(t=`url(${o.content.src})`)}return{cursor:t}},opacity:t=>t!=null?{opacity:String(t)}:void 0,visibility:t=>t!=null?{visibility:t}:void 0,pointerEvents:t=>t!=null?{pointerEvents:t}:void 0};var qs={inset:(t,e)=>{if(e.call("isNumber",t))return{inset:t};if(e.call("isString",t))return{inset:t.split(" ").map(r=>J(r,"k").k).join(" ")}},left:t=>J(t,"left"),top:t=>J(t,"top"),right:t=>J(t,"right"),bottom:t=>J(t,"bottom"),verticalInset:t=>{if(typeof t!="string")return;let e=t.split(" ").map(r=>J(r,"k").k);return{top:e[0],bottom:e[1]||e[0]}},horizontalInset:t=>{if(typeof t!="string")return;let e=t.split(" ").map(r=>J(r,"k").k);return{left:e[0],right:e[1]||e[0]}}};V();var bt=({context:t,state:e})=>{let r=e?.root?.globalTheme||t.designSystem?.globalTheme;return r==="auto"?null:r},gt=(t,e)=>{if(e==null||e==="")return;if(!j(e))return{[t]:e};let r={},n=!1;for(let s in e){let o=e[s];o==null||o===""||j(o)||(r[s]={[t]:o},n=!0)}return n?r:void 0},Ks={theme:(t,e)=>{if(t)return e.themeModifier?Ee(t,`@${e.themeModifier}`):Ee(t)},color:(t,e)=>{let r=bt(e);if(t)return gt("color",pt(t,r))},background:(t,e)=>{let r=bt(e);if(t)return w(t)&&t.includes("gradient")&&t.includes("(")?{background:Jr(t,r)}:gt("background",pt(t,r))},backgroundColor:(t,e)=>{let r=bt(e);if(t)return gt("backgroundColor",pt(t,r))},backgroundImage:(t,e,r,n)=>{let s=bt(e);if(!t)return;let o=n.assets&&n.assets[t];if(o&&o.content)t=o.content.src;else{let i=n.files&&n.files[t];i&&i.content&&(t=i.content.src)}return gt("backgroundImage",Ss(t,s))},textStroke:t=>({WebkitTextStroke:xs(t)}),outline:t=>({outline:jt(t)}),outlineOffset:(t,e)=>C("outlineOffset",t,e),border:t=>({border:jt(t)}),borderColor:(t,e)=>{let r=bt(e);if(t)return gt("borderColor",pt(t,r))},borderTopColor:(t,e)=>{let r=bt(e);if(t)return gt("borderTopColor",pt(t,r))},borderBottomColor:(t,e)=>{let r=bt(e);if(t)return gt("borderBottomColor",pt(t,r))},borderLeftColor:(t,e)=>{let r=bt(e);if(t)return gt("borderLeftColor",pt(t,r))},borderRightColor:(t,e)=>{let r=bt(e);if(t)return gt("borderRightColor",pt(t,r))},borderLeft:t=>({borderLeft:jt(t)}),borderTop:t=>({borderTop:jt(t)}),borderRight:t=>({borderRight:jt(t)}),borderBottom:t=>({borderBottom:jt(t)}),shadow:(t,e)=>{let r=bt(e);if(t)return gt("boxShadow",_s(t,r))},boxShadow:(t,e)=>{if(!w(t))return;let[r,n]=t.split("!importan"),s=bt(e),o=n?" !important":"",i=Qr(r.trim(),s);return w(i)?{boxShadow:i+o}:gt("boxShadow",i)},textShadow:(t,{context:e})=>gt("textShadow",Qr(t,e.designSystem.globalTheme)),columnRule:t=>({columnRule:jt(t)})};var Qs={transition:t=>({transition:ks(t)}),transitionDuration:t=>({transitionDuration:Xr(t)}),transitionDelay:t=>({transitionDelay:Xr(t)}),transitionTimingFunction:t=>({transitionTimingFunction:Ot(t)}),transitionProperty:t=>({transitionProperty:t,willChange:t})};V();var Js={flow:(t,e)=>{let r=e.reverse;if(!w(t))return;let[n,s]=(t||"row").split(" ");return(t.startsWith("x")||t==="row")&&(n="row"),(t.startsWith("y")||t==="column")&&(n="column"),{display:"flex",flexFlow:(n||"")+(!n.includes("-reverse")&&r?"-reverse":"")+" "+(s||"")}},wrap:(t,e)=>({display:"flex",flexWrap:t}),align:(t,e)=>{let[r,n]=t.split(" ");return{display:"flex",alignItems:r,justifyContent:n}}};var Xs={area:t=>({gridArea:t}),template:t=>({gridTemplate:t}),templateAreas:t=>({gridTemplateAreas:t}),column:t=>({gridColumn:t}),columns:t=>({gridTemplateColumns:t}),templateColumns:t=>({gridTemplateColumns:t}),autoColumns:t=>({gridAutoColumns:t}),columnStart:t=>({gridColumnStart:t}),row:t=>({gridRow:t}),rows:t=>({gridTemplateRows:t}),templateRows:t=>({gridTemplateRows:t}),autoRows:t=>({gridAutoRows:t}),rowStart:t=>({gridRowStart:t}),autoFlow:t=>({gridAutoFlow:t})};var X={...Ws,...zs,...Gs,...Hs,...qs,...Ks,...Qs,...Js,...Xs};var H=new Set(["accentColor","alignContent","alignItems","alignSelf","alignmentBaseline","all","animation","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationTimingFunction","appearance","aspectRatio","backdropFilter","backfaceVisibility","background","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundRepeatX","backgroundRepeatY","backgroundSize","baselineShift","blockSize","border","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","boxDecorationBreak","boxShadow","boxSizing","breakAfter","breakBefore","breakInside","captionSide","caretColor","clear","clip","clipPath","color","colorAdjust","colorInterpolation","colorInterpolationFilters","colorRendering","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","contain","content","counterIncrement","counterReset","cursor","direction","display","emptyCells","filter","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","float","font","fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantNumeric","fontVariantPosition","fontWeight","fontVariationSettings","fontSynthesis","forcedColorAdjust","gap","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","hyphens","imageOrientation","imageRendering","imeMode","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","initialLetter","isolation","justifyContent","justifyItems","justifySelf","left","letterSpacing","lineBreak","lineClamp","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBottom","marginLeft","marginRight","marginTop","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","mask","maskBorder","maskBorderImage","maskBorderOutset","maskBorderRepeat","maskBorderSlice","maskBorderSource","maskBorderWidth","maskClip","maskComposite","maskImage","maskOrigin","maskPosition","maskRepeat","maskSize","maskType","maxBlockSize","maxHeight","maxInlineSize","maxWidth","minBlockSize","minHeight","minInlineSize","minWidth","mixBlendMode","objectFit","objectPosition","objectViewBox","offset","offsetDistance","offsetPath","offsetRotate","opacity","order","orientation","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflow","overflowAnchor","overflowClip","overflowScrolling","overflowWrap","overflowX","overflowY","overscrollBehavior","overscrollBehaviorX","overscrollBehaviorY","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","pageBreakAfter","pageBreakBefore","pageBreakInside","paintOrder","perspective","perspectiveOrigin","placeContent","placeItems","placeSelf","pointerEvents","position","resize","right","rotate","rowGap","scrollBehavior","scrollPadding","scrollSnapAlign","scrollSnapType","scrollbarColor","scrollbarGutter","scrollbarWidth","shapeImageThreshold","shapeMargin","shapeOutside","tabSize","tableLayout","textAlign","textAlignLast","textDecoration","textDecorationColor","textDecorationLine","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textIndent","textOverflow","textShadow","textTransform","textUnderlineOffset","top","touchAction","transform","transformOrigin","transformStyle","transition","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","translateX","translateY","translateZ","unicodeBidi","userSelect","verticalAlign","visibility","whiteSpace","widows","width","willChange","wordBreak","wordSpacing","wordWrap","writingMode","zIndex"]);V();function ln(t,e,r){let n=t?.context?.analyze;if(!n||!n.emit||e==="warn"&&!n.shouldCapture("warnings")||e==="error"&&!n.shouldCapture("errors"))return;let s=r.map(o=>o?.message||(typeof o=="string"?o:null)).filter(Boolean).join(" ");n.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:s||null,args:r})}var Ys=new Set;function Ra(t,e,r){let n=String(e);if(Ys.has(n))return;Ys.add(n);let s=t?.__ref?.path,o=Array.isArray(s)&&s.length?s.join("."):t?.key!=null?String(t.key):"(unknown element)",i=r!=null?`resolves to a non-function (${typeof r}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",c=`[smbls] el.call('${n}') at <${o}>: "${n}" ${i}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;ln(t,"error",[c]),console.error(c)}function Da(...t){return ln(this,"warn",t),$o.apply(this,t)}function Ia(...t){return ln(this,"error",t),To.apply(this,t)}var Zs={update:nn,remove:sn,getDB:Io,getQuery:jo,getRootData:Ao,getChildren:wo,getPath:ko,nextElement:Po,previousElement:Ro,verbose:zr,warn:Da,error:Ia,variables:Do,spotByPath:So,set(t,e){let r=this.__ref;if(r){if(r.__setLocked){r.__setQueued={content:t,options:e};return}r.__setLocked=!0}try{if(this.removeContent(),t!=null){let n=this.context?.__create;n&&n(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(r){r.__setLocked=!1;let n=r.__setQueued;n&&(r.__setQueued=null,this.set(n.content,n.options))}}},reset(t){let e=this.context?.__create;if(!e)return this;let r=this.parent,n=this.key,s=this.parse();return this.remove(),e(s,r,n,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){let e=this.__ref;if(!e?.__children)return null;for(let r of e.__children){let n=this[r];if(!n)continue;if(typeof t=="function"){if(t(n))return n}else if(typeof t=="string"&&n.key===t)return n;let s=n.lookdown?.(t);if(s)return s}return null},lookdownAll(t,e=[]){let r=this.__ref;if(!r?.__children)return e;for(let n of r.__children){let s=this[n];s&&(typeof t=="function"?t(s)&&e.push(s):typeof t=="string"&&s.key===t&&e.push(s),s.lookdownAll?.(t,e))}return e},getRef(){return this.__ref},getRoot:vo,getRootState:Co,getRootContext:Eo,getContext:Oo,parse(t){let e={},r=t?new Set(t):null,n=this.__ref?.__exec;for(let s in this)if(!(s==="parent"||s==="node"||s==="__ref")&&!r?.has(s)){if(n&&n[s]!==void 0){e[s]=n[s];continue}typeof this[s]!="function"&&(e[s]=this[s])}return e},parseDeep(t){let e=this.parse(t),r=this.__ref;if(r?.__children)for(let n of r.__children)this[n]?.parseDeep&&(e[n]=this[n].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){let e={};for(let r of t)e[r]=this[r];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(let e in t){let r=t[e];if(r==null)continue;let n=e.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),s=String(r).replace(/\s*!important\s*$/,"");this.node.style.setProperty(n,s,"important")}},call(t,...e){let r=this.context,n=r?.methods?.[t]||r?.functions?.[t]||r?.utils?.[t]||this[t];if(typeof n=="function")return n.call(this,...e);At()&&Ra(this,t,n)},removeContent(){let t=this.__ref;if(!t?.__children)return;let e=this.content;if(e?.remove){e.remove(),delete this.content;let r=t.__children.indexOf("content");r!==-1&&t.__children.splice(r,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},ti=new WeakMap;function ja(t){if(!t)return Zs;let e=ti.get(t);if(e)return e;e=Object.create(Zs);let r=t.methods;if(r)for(let n in r)e[n]=r[n];return ti.set(t,e),e}function un(t){let e=ja(t.context);Object.setPrototypeOf(t,e)}V();We();var cr=(t,e,r)=>{Object.defineProperty(t,e,{value:r,enumerable:!1,configurable:!0,writable:!0})},xt=(t,e,r,{onlyIfAbsent:n}={})=>{cr(t,"$"+e,r),!(n&&Object.prototype.hasOwnProperty.call(t,e))&&cr(t,e,r)},dn=(t,e,...r)=>{if(!t)return;let n=t["$"+e];if(typeof n=="function")return n.apply(t,r);let s=t[e];if(typeof s=="function")return s.apply(t,r)},Lt=(t,e)=>{if(G(e)){let s=e.__raw||e;xt(s,"toggle",function(o,i={}){e[o]=!e[o]},{onlyIfAbsent:!0}),xt(s,"set",function(o,i={}){return e.$clean({preventStateUpdate:!0}),typeof o=="object"&&o!==null&&e.$update(o,i),e},{onlyIfAbsent:!0}),xt(s,"setByPath",function(o,i,c={}){let a=o.split("."),l=e;for(let f=0;f<a.length-1;f++)l[a[f]]===void 0&&(l[a[f]]={}),l=l[a[f]];return l[a[a.length-1]]=i,e}),xt(s,"getByPath",function(o){let i=o.split("."),c=e;for(let a=0;a<i.length;a++){if(c==null)return;c=c[i[a]]}return c}),xt(s,"removeByPath",function(o,i={}){let c=o.split("."),a=e;for(let l=0;l<c.length-1;l++){if(a==null)return e;a=a[c[l]]}return a&&delete a[c[c.length-1]],e}),xt(s,"reset",function(o={}){let i=e.$parse();return e.$set(i,o)}),xt(s,"apply",function(o,i={}){if(typeof o=="function"){let c=o(e);return e.$update(c,i)}}),xt(s,"applyFunction",function(o,i={}){if(typeof o=="function")return o(e),e.$update(e.$parse(),i)}),xt(s,"rootUpdate",function(o,i={}){let c=e;for(;c?.parent&&G(c.parent);)c=c.parent;return dn(c,"update",o,i)}),xt(s,"parentUpdate",function(o,i={}){if(e.parent)return dn(e.parent,"update",o,i)}),xt(s,"quietReplace",function(o,i={}){return e.$replace(o,{quiet:!0,...i})}),Object.getOwnPropertyDescriptor(s,"root")||Object.defineProperty(s,"root",{get:function(){let o=e,i=G(o)?o:null;for(let c=0;c<64&&o?.parent&&o.parent!==o;c++)o=o.parent,G(o)&&(i=o);return i||o},enumerable:!1,configurable:!0});return}if(!e||typeof e!="object")return;let r=()=>{for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&delete e[s]},n={update(s){if(!s||typeof s!="object")return e;for(let o in s)e[o]=s[o];return e},apply(s){if(typeof s!="function")return e;let o=s(e);return o?e.$update(o):e},parse(){return{...e}},toggle(s){return e[s]=!e[s],e},set(s){if(!s||typeof s!="object")return e;r();for(let o in s)e[o]=s[o];return e},replace(s){return e.$set(s)},clean(){return r(),e}};for(let s in n)if(cr(e,"$"+s,n[s]),typeof e[s]!="function"){if(Object.prototype.hasOwnProperty.call(e,s)){ce(s,"");continue}cr(e,s,n[s])}};var Vg=new Proxy(Object.create(null),{get(){},has(){return!1}});var Ma=1,ar=[],yn=!1;function La(){yn||(yn=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(mn):setTimeout(mn,0))}function mn(){if(yn=!1,!ar.length)return;let t=ar.splice(0,ar.length);for(let e=0;e<t.length;e++){let r=t[e];!r.node||!r.node.isConnected||$t("Mounted",r,r.__ref?.__mountOptions||{})}}function si(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,ar.push(t),La())}function ei(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&wt("contentUpdate",t,e);let r=t.context?.designSystem;r&&z(r);try{t.onContentUpdate(t,t.state,t.context,e)}catch(n){if(t.context?.plugins?.length&&wt("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{r&&U()}}function ee(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Fa(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Na(t){return t.toLowerCase()}function bn(t){let e=t.charCodeAt(0);return e===58||e===64||e===38}function Ie(t,e){let r={...t};for(let n in e){let s=r[n],o=e[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)&&typeof s!="function"&&typeof o!="function"?r[n]=Ie(s,o):r[n]=o}return r}function ht(t,e,r,n={},s){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});let o=Object.create(null);o.key=r||t.key||`_${Ma++}`,o.parent=e||null,o.context=t.context||e?.context||n.context||{},o.context.__create||(o.context.__create=ht);let i=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:e?.__ref?.root||o,path:e?.__ref?.path?[...e.__ref.path,o.key]:[o.key]};if(r&&!t.extends&&!t.extend){let d=r.indexOf("_");if(d>0){let m=r.substring(0,d),x=o.context?.components;x&&(x[m]||x["smbls."+m])?t={...t,extends:m}:x&&At()&&/^[A-Z]\w*_\d+$/.test(r)&&console.warn(`[smbls] auto-extend: key "${r}" looks like a multi-instance (${m}_N) but neither "${m}" nor "smbls.${m}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}$e(o,t,n);let c=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(let d in t){if(d==="parent"||d==="node"||d==="__ref"||d==="extends"||d==="context"||d==="props")continue;let m=t[d],x=o[d],b=x&&m&&typeof x=="object"&&typeof m=="object"&&!Array.isArray(x)&&!Array.isArray(m)&&typeof x!="function"&&typeof m!="function";b&&d.charCodeAt(0)>=65&&d.charCodeAt(0)<=90?o[d]=Ie(x,m):b&&c.has(d)?o[d]={...x,...m}:b&&bn(d)?o[d]=Ie(x,m):o[d]=m}function l(d){for(let m in d){let x=d[m],b=o[m],g=b&&x&&typeof b=="object"&&typeof x=="object"&&!Array.isArray(b)&&!Array.isArray(x)&&typeof b!="function"&&typeof x!="function";g&&m.charCodeAt(0)>=65&&m.charCodeAt(0)<=90?o[m]=Ie(b,x):g&&c.has(m)?o[m]={...b,...x}:g&&bn(m)?o[m]=Ie(b,x):o[m]=x}}a&&l(a),t.props&&typeof t.props=="object"&&l(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);let f=o.scope&&typeof o.scope=="object"?o.scope:null,u=e?.scope,h=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,p=u||h||null;if(t.scope!==void 0||f){let d={};f&&Object.assign(d,f),t.scope!==void 0&&Object.assign(d,t.scope),o.scope=Sr(d,p)}else p&&(o.scope=p);if(t.if!==void 0&&(o.if=t.if),un(o),Va(o,e,t),o.if!=null){let d;if(typeof o.if=="function")try{d=o.if(o,o.state,o.context)}catch(m){if(d=!1,i.__ifError=m,typeof console<"u"&&console.warn){let x=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${x} \u2014 treating as false:`,m?.message||m)}}else d=o.if;i.__if=!!d}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&ai(o,i,o.if),o;o.tag||(o.tag=ae(o)),$t("Init",o,n);let y=o.node=fe(o);if(!y)return o;if(o.tag==="fragment"){let m=(o.context?.document||globalThis.document).createComment("");y.appendChild(m),i.__fragmentAnchor=m}$t("AttachNode",o,n),y.setAttribute&&o.key&&y.setAttribute("data-key",o.key),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),y.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&y.setAttribute("data-smbls-app",o.context.key),o.id&&y.setAttribute&&(y.id=o.id),di(o,n),ci(o),xn(o),li(o),tf(o);try{pi(o,n)}catch(d){if(typeof console<"u"&&console.error){let m=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${m}:`,d?.message||d,d?.stack?`
|
|
10
|
+
FROM ${c}${l}`},cc=t=>{let e=[],r=(n,s)=>{for(let o in n){let i=s?`${s}/${o}`:o;n[o]===!0?e.push(i):r(n[o],i)}};return r(t,""),e},ac={graphql:nc,"json-api":oc,odata:sc,sql:ic,paths:cc}});var Fo=k(()=>{"use strict"});var No=k(()=>{});var Vo=k(()=>{"use strict"});var Bo=k(()=>{"use strict"});var Uo=k(()=>{"use strict"});var Wo=k(()=>{"use strict"});var zo=k(()=>{"use strict"});var Go=k(()=>{"use strict"});var Ho=k(()=>{"use strict"});var qo=k(()=>{"use strict"});var Ko=k(()=>{"use strict"});var Qo=k(()=>{"use strict"});var Jo,Xo,Yo,Zo=k(()=>{"use strict";de();Jo=t=>(typeof t!="string"&&(t=String(t||"")),t.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,r){return r===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")),Xo=t=>t.replace(/[^a-zA-Z0-9]/g," ").trim().toLowerCase().replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Yo=t=>{if(M(t))return t;if(w(t))return t.split(" ");if(j(t))return Object.values(t);if(Be(t))return[t]}});var ts=k(()=>{"use strict"});var es=k(()=>{"use strict"});var V=k(()=>{"use strict";Wn();Gn();de();Ue();ze();jr();Ir();Hn();qn();Nn();Dr();Kn();Qn();Xn();Yn();Jn();Zn();to();Lr();eo();Lo();Nr();Fo();ro();No();Vo();Bo();Uo();Wo();zo();Go();Ho();qo();Ko();Qo();Zo();ts();es()});var sf={};ie(sf,{FACTORY:()=>er,REGISTRY:()=>rt,applyExtends:()=>Te,batch:()=>vt,create:()=>ht,createEffect:()=>N,createElement:()=>nf,createSignal:()=>et,createStore:()=>lt,getActiveConfig:()=>P,mount:()=>of,popConfig:()=>U,pushConfig:()=>z,registerEvent:()=>$e});var Nt=null,Me=0,Le=[],Ne=()=>Nt;var Fe=0,hr=[];function et(t){let e=new Set;function r(){return Nt&&(e.add(Nt),Nt._sources.add(o)),t}function n(i){i!==t&&(t=i,Ci(e))}function s(){return t}let o={get:r,set:n,peek:s,_subscribers:e,_type:"signal"};return o}var _t=new Set,gr=!1;function N(t,e){let r=e?.depth??0,n={_sources:new Set,_type:"effect",_depth:r,_disposed:!1,_subscribers:new Set,_execute(){if(n._disposed)return;$n(n);let s=Nt;Nt=n;try{t()}catch(o){console.error("[smbls] effect error:",o)}finally{Nt=s}},_notify(){n._disposed||(Me>0?Le.push(n):Fe>0?hr.push(n):mr(n))},dispose(){n._disposed=!0,$n(n)}};return n._execute(),n}function vt(t){Me++;try{t()}finally{Me--,Me===0&&wi()}}var yr=!1,En=1e3,_i=8;function On(){return typeof performance<"u"?performance.now():Date.now()}function mr(t){_t.add(t),!yr&&(gr||(gr=!0,queueMicrotask(Tn)))}var Gt=[];function Si(){if(_t.size===1){let[t]=_t;_t.clear(),t._disposed||t._execute();return}Gt.length=0;for(let t of _t)Gt.push(t);_t.clear(),Gt.sort((t,e)=>t._depth-e._depth);for(let t=0;t<Gt.length;t++){let e=Gt[t];e._disposed||e._execute()}Gt.length=0}function Tn(t=0){if(gr=!1,_t.size===0)return;yr=!0;let e=On(),r=!1;try{for(;_t.size>0;){if(++t>En){console.error("[smbls] reactive effect cascade exceeded",En,"passes in a single flush \u2014 breaking to avoid hanging the thread.","This usually means an effect (or an onUpdate/subscribeTo handler","it calls into) unconditionally writes back a signal it depends on."),_t.clear();break}if(Si(),_t.size>0&&On()-e>_i){r=!0,setTimeout(()=>Tn(t),0);break}}}finally{r||(yr=!1)}}function wi(){for(let t=0;t<Le.length;t++)mr(Le[t]);Le.length=0}function ki(t){Fe++;try{for(let e of t)e._notify()}finally{if(Fe--,Fe===0&&hr.length>0){let e=hr.splice(0);for(let r=0;r<e.length;r++)mr(e[r])}}}function Ci(t){ki(t)}function $n(t){for(let e of t._sources)e._subscribers.delete(t);t._sources.clear()}var Rt=Symbol("store"),_r=Symbol("signals"),wr=["update","parse","clean","keys","values","replace","add","remove","destroy","quietUpdate"],ce=new Set(wr),Pn=new Set,Rn=(t,e)=>t?t+"."+e:String(e);function ae(t,e){let r=(e||"")+"::"+t;if(Pn.has(r))return;Pn.add(r);let n=e?`state.${e}`:"state",s=`[smbls/state] "${t}" is a reserved store-method name and was written as DATA at ${n}.${t}. The value is preserved and readable \u2014 data wins over the method \u2014 but "${n}.${t}(\u2026)" no longer reaches the store method on this node. Use "${n}.$${t}(\u2026)" for the method, or rename the data key. Reserved: ${wr.join(", ")}.`;typeof console<"u"&&console.warn&&console.warn(s)}var br=t=>!t||typeof t!="object"||Array.isArray(t)||t[Rt]||Object.isFrozen(t)||typeof Node<"u"&&t instanceof Node||t.__ref||t.nodeType||t.nodeName,vi=12,Dn=t=>{if(!t||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};function Sr(t,e,r){if(t===e)return!0;if(r>vi)return!1;if(Array.isArray(t)||Array.isArray(e)){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Sr(t[n],e[n],r+1))return!1;return!0}if(Dn(t)&&Dn(e)){let n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(let o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Sr(t[o],e[o],r+1))return!1;return!0}return!1}function lt(t,e,r,n){r===void 0&&(r=0),n===void 0&&(n="");let s={},o={},i=e&&e.maxDepth||8;if(t&&typeof t=="object")for(let b in t){if(b==="__proto__"||!Object.prototype.hasOwnProperty.call(t,b))continue;ce.has(b)&&ae(b,n);let g=t[b];r<i&&g&&typeof g=="object"&&!br(g)?(o[b]=g,s[b]=et(lt(g,e,r+1,Rn(n,b)))):(o[b]=g,s[b]=et(g))}let c=new Proxy(o,{get(b,g){if(g===Rt)return!0;if(g===_r)return s;if(g==="__raw")return b;if(g==="$update")return a;if(g==="$parse")return f;if(g==="$clean")return u;if(g==="$keys")return h;if(g==="$values")return p;if(g==="$replace")return y;if(g==="$add")return d;if(g==="$remove")return m;if(g==="$destroy")return x;if(g==="$quietUpdate")return l;if(ce.has(g)&&!Object.prototype.hasOwnProperty.call(s,g))switch(g){case"update":return a;case"parse":return f;case"clean":return u;case"keys":return h;case"values":return p;case"replace":return y;case"add":return d;case"remove":return m;case"destroy":return x;case"quietUpdate":return l}if(g==="__element")return b.__element;if(g==="parent")return b.parent;if(g==="root")return b.root;if(Object.prototype.hasOwnProperty.call(s,g)){let S=s[g].get();if(S!==void 0||!(g!=="root"&&b.root&&b.root!==c))return S}if(b[g]!==void 0)return b[g];let _=typeof g=="string"&&!g.startsWith("__")&&g!=="then"&&g!=="constructor"&&Ne()!=null;if(g!=="root"&&b.root&&b.root!==c){let S=b.root[g];return S===void 0&&_&&!Object.prototype.hasOwnProperty.call(s,g)?(s[g]=et(void 0),s[g].get()):S}if(_)return s[g]=et(void 0),s[g].get()},set(b,g,_){if(g==="__proto__")return!1;if(g==="__element"||g==="parent"||g==="root")return b[g]=_,!0;ce.has(g)&&ae(g,n);let S=Rn(n,g);if(Object.prototype.hasOwnProperty.call(s,g))if(_&&typeof _=="object"&&!br(_)){if(_===b[g])return!0;let v=s[g].peek(),D=v&&v[Rt]?v.$parse():v;if(Sr(_,D,0))return!0;b[g]=_,s[g].set(lt(_,e,r+1,S))}else b[g]=_,s[g].set(_);else b[g]=_,_&&typeof _=="object"&&!br(_)?s[g]=et(lt(_,e,r+1,S)):s[g]=et(_);return!0},has(b,g){return typeof g=="string"&&g.charCodeAt(0)===36&&ce.has(g.slice(1))?!0:g in s||g in b},ownKeys(b){return Object.keys(s)},getOwnPropertyDescriptor(b,g){return g in s?{enumerable:!0,configurable:!0,value:s[g].peek()}:Object.getOwnPropertyDescriptor(b,g)},deleteProperty(b,g){return s[g]&&(s[g].set(void 0),delete s[g]),delete b[g],!0}});function a(b,g){vt(()=>{for(let S in b)S!=="__proto__"&&(c[S]=b[S])});let _=o.__element;return _&&_.onUpdate&&!g?.quiet&&_.onUpdate(_,c,_.context),c}function l(b){return a(b,{quiet:!0})}function f(b){if(b||(b=new Set),b.has(c))return"[Circular]";b.add(c);let g={};for(let _ in s){if(_==="parent"||_==="root"||_.startsWith("__"))continue;let S=s[_].peek();S&&S[Rt]?g[_]=S.$parse(b):g[_]=S}return g}function u(){return vt(()=>{for(let b in s)delete c[b]}),c}function h(){return Object.keys(s)}function p(){return Object.keys(s).map(b=>s[b].peek())}function y(b){return vt(()=>{for(let g in s)g in b||delete c[g];for(let g in b)g!=="__proto__"&&(c[g]=b[g])}),c}function d(b,g){return c[b]=g,c}function m(b){return delete c[b],c}function x(){u(),o.__element=null,o.parent=null}return c}function G(t){return t&&t[Rt]===!0}function kr(t,e){let r={},n={};if(t&&typeof t=="object")for(let i in t)n[i]=t[i],r[i]=et(t[i]);let s=i=>{if(Object.prototype.hasOwnProperty.call(r,i))return r;let c=e;for(;c;){let a=c[_r];if(a&&Object.prototype.hasOwnProperty.call(a,i))return a;c=c[Rt]?c[xr]:null}return null};return new Proxy(n,{get(i,c){return c===Rt?!0:c===_r?r:c===xr?e:c==="__raw"?i:Object.prototype.hasOwnProperty.call(r,c)?r[c].get():e&&c!=="then"&&c!=="constructor"?e[c]:i[c]},set(i,c,a){let l=s(c);return l?(l===r&&(i[c]=a),l[c].set(a),!0):(i[c]=a,r[c]=et(a),!0)},has(i,c){if(c in r||c in i)return!0;let a=e;for(;a;){if(c in a)return!0;a=a[Rt]?a[xr]:null}return!1},ownKeys(){return Object.keys(r)},getOwnPropertyDescriptor(i,c){return c in r?{enumerable:!0,configurable:!0,value:r[c].peek()}:Object.getOwnPropertyDescriptor(i,c)}})}var xr=Symbol("scope.parent");var Cr="http://www.w3.org/2000/svg",Er=new Set(["svg","path","circle","ellipse","line","polyline","polygon","rect","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","foreignObject","desc","title","metadata"]),Ai=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","string","fragment","shadow"]);function vr(t){return Ai.has(t)||Er.has(t)}function Or(t){return Er.has(t)}function fe(t){let{tag:e,key:r}=t;if(typeof e=="function")try{e=e(t,t.state,t.context)}catch(o){e=void 0,typeof console<"u"&&console.error&&console.error(`[smbls] \`tag:\` factory threw on "${r||"<anon>"}" \u2014 falling back to key-based tag detection:`,o?.message||o)}if(e===!0&&(e=r),typeof e=="string"&&vr(e))return e;if(!r||typeof r!="string")return"div";let n=new Set(["html","head","body","meta","link","script","style","title","base","noscript","template","th","tr","td","thead","tbody","tfoot","caption","col","colgroup"]),s=r.toLowerCase();return s.includes(".")&&(s=s.split(".")[0]),s.includes("_")&&(s=s.split("_")[0]),vr(s)&&!n.has(s)?s:"div"}var In={};function Ar(t,e){let r=e?.context?.document||globalThis.document;if(!r)return null;if(t==="string")return r.createTextNode(e?.text||"");if(t==="fragment")return r.createDocumentFragment();if(Or(t)){let n=e?.parent;if(t==="svg"||n?.node?.namespaceURI===Cr)return r.createElementNS(Cr,t);if(t!=="svg")return r.createElement("div")}return r.createElement(t)}function le(t){let e=t.tag=fe(t),n=Or(e)&&(e==="svg"||t.parent?.node?.namespaceURI===Cr)?"svg:"+e:e,s=t?.context?.document||globalThis.document,o=In[n];if(o||(o=In[n]=Ar(e,t)),!o)return null;let i=s&&o.ownerDocument!==s?Ar(e,t):o.cloneNode(!0);return e==="string"&&(i.nodeValue=t.text||""),i}var rt=new Set(["extends","children","content","childrenAs","childExtends","childExtendsRecursive","childProps","inheritParentProps","state","if","define","deps","tag","attr","style","text","html","value","data","classlist","class","scope","root","context","$router","routes","fetch","variables","query","key","component","preventContentUpdate","preventContentRecreate","subscribeTo","autoGrow","__name","__ref","__hash","__text","parent","node"]);var ue=new Set(["start","init","complete","attachNode","stateInit","stateCreated","beforeUpdate","update","afterUpdate","beforeClassAssign","lazyLoad","render","renderRouter","done","create","frame","mounted","contentUpdate","startUpdate","stateUpdate","beforeStateUpdate","initInspect","initSync","beforeRemove","remove"]),$r=new Set(["load","error","abort","scroll","canplay","canplaythrough","ended","pause","play","playing","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","durationchange","loadeddata","loadedmetadata","progress","emptied","resize"]),jn=new Set(["wheel","mousewheel","touchstart","touchmove","touchend","touchcancel"]),Tr=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","pointerdown","pointerup","pointermove","pointerenter","pointerleave","pointerover","pointerout","touchstart","touchend","touchmove","keydown","keyup","keypress","input","change","submit","reset","focus","blur","focusin","focusout","wheel","contextmenu","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]);var Pr=t=>t==="em"||t==="rem"||t==="vw"||t==="vh"||t==="vmax"||t==="vmin",Rr=["px","cm","mm","in","pt","pc","em","rem","ex","cap","ch","ic","lh","rlh","%","vw","vh","vmin","vmax","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax","deg","rad","grad","turn","s","ms","dpi","dpcm","dppx","fr","auto"],Ei=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Oi=new RegExp(`^-?(?:\\d+\\.?\\d*|\\.\\d+)(?:${Rr.filter(t=>t!=="auto").map(Ei).join("|")})$`),Mn=t=>Oi.test(String(t).trim());V();var rs=t=>{if(t==="")return[0,0,0,0];if(t.toLowerCase()==="transparent")return[0,0,0,0];if(t[0]==="#")return t.length<7&&(t="#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+(t.length>4?t[4]+t[4]:"")),[parseInt(t.substr(1,2),16),parseInt(t.substr(3,2),16),parseInt(t.substr(5,2),16),t.length>7?parseInt(t.substr(7,2),16)/255:1];if(t.indexOf("rgb")===-1&&St&&yt){let e=St.body.appendChild(St.createElement("fictum")),r="rgb(1, 2, 3)";if(e.style.color=r,e.style.color!==r){St.body.removeChild(e);return}if(e.style.color=t,e.style.color===r||e.style.color==="")return St.body.removeChild(e),[0,0,0,0];t=yt.getComputedStyle(e).color,St.body.removeChild(e)}return t.indexOf("rgb")===0?(t.indexOf("rgba")===-1&&(t=`${t}, 1`),t.match(/[\.\d]+/g).map(e=>+e)):[0,0,0,0]};var fc=(t,e=1)=>{let[r,n,s]=t.match(/\w\w/g).map(o=>parseInt(o,16));return[r,n,s]};var lc=([t,e,r])=>((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1);var uc=(t,e,r)=>{let n=Math.max(t,e,r),s=n-Math.min(t,e,r),o=1-Math.abs(n+n-s-1),i=s&&(n==t?(e-r)/s:n==e?2+(r-t)/s:4+(t-e)/s);return[60*(i<0?i+6:i),o?s/o:0,(n+n-s)/2]},dc=(t,e,r,n=e*Math.min(r,1-r),s=(o,i=(o+t/30)%12)=>r-n*Math.max(Math.min(i-3,9-i,1),-1))=>[s(0),s(8),s(4)],pc=(t,e)=>{let r=parseInt(t,16),n=(r>>16)+e;n>255?n=255:n<0&&(n=0);let s=(r>>8&255)+e;s>255?s=255:s<0&&(s=0);let o=(r&255)+e;return o>255?o=255:o<0&&(o=0),((o|s<<8|n<<16)+16777216).toString(16).slice(1)};var Q=t=>t.charCodeAt(0)===45&&t.charCodeAt(1)===45,Bt=/(?:rgba?\(|hsla?\(|#[0-9a-fA-F]{3,8}\b)/,hc=/^([a-zA-Z]\w*(?:-[a-zA-Z]\w*)*)(?:\.(\d+))?(?:([+-]\d+|=\d+))?$/,Ce=t=>{if(!w(t))return null;if(Bt.test(t))return{passthrough:t};if(Q(t))return{cssVar:t};let e=t.match(hc);if(!e)return null;let[,r,n,s]=e,o=n!==void 0?`0.${n}`:void 0,i=s&&s[0]==="="?s.slice(1):s;return{name:r,alpha:o,tone:i}},Xt=t=>w(t)&&(t.includes("rgb")||t.includes("var(")||t.includes("#")),ve=t=>{let e=[],r="",n=0;for(let s of t){if(s==="("?n+=1:s===")"&&n>0&&(n-=1),s===","&&n===0){e.push(r),r="";continue}r+=s}return(r.length||!e.length)&&e.push(r),e},ns=(t,e)=>{w(t)&&t.includes("rgb")&&(t=rs(t).join(", ")),w(t)&&(t=t.split(",").map(s=>parseFloat(s.trim()))),Be(e)&&(e+="");let r=lc(t),n=e.slice(0,1);if(n==="-"||n==="+"){let s=pc(r,parseFloat(e));return fc(s).join(", ")}else{let[s,o,i]=t,[c,a]=uc(s/255,o/255,i/255),l=Math.max(0,Math.min(100,parseFloat(e)))/100;return dc(c,a,l).map(u=>Math.round(Math.max(0,Math.min(1,u))*255)).join(", ")}};var qr=(t,e)=>{if(t[e])return t[e].value;if(t.default)return t[t.default].value;let r=Object.keys(t)[0];return r&&t[r]&&t[r].value};V();V();V();V();var Ye={};ie(Ye,{animation:()=>jc,breakpoints:()=>Dc,class:()=>Bc,color:()=>Cc,devices:()=>Ic,document:()=>Rc,font:()=>mc,fontFace:()=>_c,fontFamily:()=>bc,fontFamilyTypes:()=>xc,gradient:()=>vc,grid:()=>Vc,icons:()=>Oc,media:()=>Sc,reset:()=>Uc,semanticIcons:()=>$c,sequence:()=>Ut,shadow:()=>Ec,sizes:()=>zc,spacing:()=>kc,svg:()=>Mc,svgData:()=>Lc,templates:()=>Fc,theme:()=>Ac,timing:()=>Pc,typography:()=>Kr,unit:()=>gc,vars:()=>Wc});var Ut={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,"minor-sixth":1.6,phi:1.618,"major-sixth":1.667,"square-root-3":1.732,"minor-seventh":1.778,"major-seventh":1.875,octave:2,"square-root-5":2.23,"major-tenth":2.5,"major-eleventh":2.667,"major-twelfth":3,pi:3.14,"double-octave":4};var gc={default:"em"};var yc={browserDefault:16,base:16,type:"font-size",ratio:Ut["minor-third"],range:[-3,12],h1Matches:6,lineHeight:1.5,subSequence:!0,mediaRegenerate:!1,unit:"em",templates:{},sequence:{},scales:{},vars:{}},Kr=yc;var mc={};var bc={},xc={"sans-serif":"Helvetica, Arial, sans-serif, --system-default",serif:"Times New Roman, Georgia, serif, --system-default",monospace:"Courier New, monospace, --system-default"},_c={};var Sc={tv:"(min-width: 2780px)",light:"(prefers-color-scheme: light)",dark:"(prefers-color-scheme: dark)",print:"print"};var wc={base:Kr.base,type:"spacing",ratio:Ut.phi,range:[-5,15],subSequence:!0,mediaRegenerate:!1,unit:"em",sequence:{},scales:{},vars:{}},kc=wc;var Cc={},vc={};var Ac={};var Ec={};var Oc={},$c={};var Tc={default:150,base:150,type:"timing",ratio:Ut["perfect-fourth"],range:[-3,12],mediaRegenerate:!1,unit:"ms",sequence:{},scales:{},vars:{}},Pc=Tc;var Rc={};var Dc={screenL:1920,screenM:1680,screenS:1440,tabletL:1366,tabletM:1280,tabletS:1024,mobileL:768,mobileM:560,mobileS:480,mobileXS:375},Ic={screenXXL:[2560,1440],screenXL:[2240,1260],screenL:[1920,1024],screenM:[1680,1024],screenS:[1440,720],tabletL:[1366,926],tabletM:[1280,768],tabletS:[1024,768],mobileL:[768,375],mobileM:[560,768],mobileS:[480,768],mobileXS:[375,768]};var jc={};var Mc={},Lc={};var Fc={};var Nc={},Vc=Nc;var Bc={};var Uc={},Wc={},zc={};var os={},ss={},Ze=Ye,tr={},is=t=>t.replace(/_([a-z])/g,(e,r)=>r.toUpperCase());for(let t in Ze){let e=t.toLowerCase();tr[e]=Ze[t];let r=is(e);r!==e&&(tr[r]=Ze[t]),e!==t&&(tr[t]=Ze[t])}var rr={verbose:!1,useVariable:!0,useReset:!0,globalTheme:"auto",cssVars:os,cssMediaVars:ss,CSS_VARS:os,CSS_MEDIA_VARS:ss,_scratchConfig:!0,...tr},Gc=(t,e)=>{if(!t)return null;if(t.__globalThemeSignal)return Ht(e)&&t.__globalThemeSignal.set(e),t.__globalThemeSignal;let r=Ht(e)?e:t.globalTheme,n=et(Ht(r)?r:"auto");return Object.defineProperty(t,"globalTheme",{get(){return n.get()},set(s){n.set(s)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"__globalThemeSignal",{value:n,enumerable:!1,configurable:!0,writable:!0}),n};Gc(rr);var rd=qt(rr),er={active:"0",0:rr};var Ae=[],z=t=>{t&&t._scratchConfig&&Ae.push(t)},U=()=>{Ae.pop()},P=t=>Ae.length?Ae[Ae.length-1]:er[t||er.active]||rr;var nr={"-6":"U","-5":"V","-4":"W","-3":"X","-2":"Y","-1":"Z",0:"A",1:"B",2:"C",3:"D",4:"E",5:"F",6:"G",7:"H",8:"I",9:"J",10:"K",11:"L",12:"M",13:"N",14:"O",15:"P",16:"Q",17:"R",18:"S",19:"T"},cs=(t,e)=>{let{key:r,variable:n,value:s,scaling:o,index:i,scalingVariable:c}=t;e.sequence[r]={key:r,decimal:~~(s*100)/100,val:~~s,scaling:o,index:i,scalingVariable:c,variable:n},e.scales[r]=o;let a=as.has(e.unit)?"rem":e.unit;e.vars[n]=o+a},Yt=t=>{if(!t.includes("("))return t;let e=t.split("(")[0],r=t.slice(t.indexOf("(")+1,t.lastIndexOf(")"));return[e,r]},as=new Set(["vw","vh","vmin","vmax","svw","svh","lvw","lvh","dvw","dvh"]),Hc=(t,e)=>{let{base:r,type:n,unit:s}=e,o=as.has(s)?"rem":s,i=(Pr(o)?1:r)+o;if(t===0)return i;let a="--"+(e.varPrefix?e.varPrefix+"-":"")+(n&&n.replace(".","-")),l=`${a}-ratio`;if(t>0){let f=nr[t-1];return`calc(var(${a}-${f}) * var(${l}))`}if(t<0){let f=nr[t+1],u=Math.abs(t),h=Math.pow(fs,2*u),p=nr[u];return p?`max(calc(var(${a}-${f}) / var(${l})), calc(var(${a}-${p}) / ${h.toFixed(4)}))`:`calc(var(${a}-${f}) / var(${l}))`}},qc=(t,e,r,n)=>{let{type:s}=n,i=t===2&&e.length===2?t+1:t,l=`${"--"+(n.varPrefix?n.varPrefix+"-":"")+(s&&s.replace(".","-"))}-sub-ratio-`;return`calc(var(${r}) * var(${l+i}))`},Kc=(t,e)=>{let n=(t*e-t)/1.618,s=t*e-n,o=t+n,i=(s+o)/2;return[s,i,o]};var Qc=(t,e)=>{let{key:r,base:n,value:s,ratio:o,variable:i,index:c}=t,l=~~(s*o)-~~s,f,[u,h,p]=Kc(s,o);l>16?f=[u,h,p]:f=[u,p],f.forEach((y,d)=>{let m=~~(y/n*1e3)/1e3,x=i+(d+1),b=c+(d+1)/10,g=qc(d+1,f,i,e),_={key:r+(d+1),variable:x,value:y,scaling:m,scalingVariable:g,index:b};cs(_,e)})},fs=1.618,Jc=(t,e,r)=>{if(t>=0)return e*Math.pow(r,t);let n=Math.abs(t),s=e*Math.pow(r,t),o=e*Math.pow(r,n)/Math.pow(fs,2*n);return Math.max(s,o)},Ee=t=>{let{type:e,base:r,ratio:n,range:s,subSequence:o}=t,i=Math.abs(s[0])+Math.abs(s[1]),a="--"+(t.varPrefix?t.varPrefix+"-":"")+(e&&e.replace(".","-"))+"-";for(let l=0;l<=i;l++){let f=s[1]-l,u=nr[f],h=Jc(f,r,n),p=~~(h/r*100)/100,y=a+u,d=Hc(f,t),m={key:u,variable:y,value:h,base:r,scaling:p,scalingVariable:d,ratio:n,index:f};cs(m,t),o&&Qc(m,t)}return t};var ls=(t="A",e)=>{let r=P(),{unit:n}=r;if(w(t)&&Q(t))return`var(${t})`;if(w(t)&&/^(?:env|var|calc|min|max|clamp)\(/.test(t.trim()))return t;if(w(t)){let g=r.sizes;if(g){let _=g[t]||g[t.toLowerCase()];if(_!==void 0)return t.slice(0,1)==="-"?`calc(${_} * -1)`:_}}let{sequence:s,unit:o=n.default,useVariable:i}=e,c=/^-?[a-zA-Z]/i,a=c.test(t);if(Mn(t)||!a||["none","auto","max-content","min-content","fit-content","inherit","initial","unset","revert","revert-layer"].includes(t))return t;let h=`--${e.varPrefix?e.varPrefix+"-":""}${Xo(e.type.replace(".","-"))}-`,p=t.toUpperCase(),y=p.slice(0,1)==="-"?"-":"",d=y?p.slice(1):p,m="";d.includes("_")&&(m="_"+d.split("_")[1].toLowerCase(),d=d.split("_")[0]);let x=g=>c.test(g)?`var(${h}${g}${m})`:g;if(d.includes("+")){let[g,_]=d.split("+"),S=`${x(g)} + ${x(_)}`;return y?`calc((${S}) * -1)`:`calc(${S})`}else if(d.includes("*")){let[g,_]=d.split("*"),S=`${x(g)} * ${x(_)}`;return y?`calc((${S}) * -1)`:`calc(${S})`}else if(d.includes("-")){let[g,_]=d.split("-"),S=`${x(g)} - ${x(_)}`;return y?`calc((${S}) * -1)`:`calc(${S})`}if(!s[d]&&d.length===2&&(r.verbose&&console.warn(d,"- value is not found because `subSequence` is set to false"),d=d.slice(0,1)),i||r.useVariable){let g=`var(${h}${d}${m})`;return y?`calc(${g} * -1)`:g}let b=s?s[d]:null;if(!b){if(console.warn("can't find",s,d),At())throw new Error(`[smbls] Unresolvable design-system token "${t}"`+(e.type?` for sequence "${e.type}"`:"")+" \u2014 not a registered `sizes` name and not a valid spacing/typography/timing sequence letter. The CSS property using it would silently be dropped in production. Register the token in `designSystem/sizes.js` (or the relevant sequence family) or fix the typo.");return}return o==="ms"||o==="s"?y+b.val+o:y+b.scaling+o},Xc=(t,e)=>{if(!["+","-","*","/",","].filter(o=>t.includes(o+" ")).length)return t;let n=/(\s+-\s+|\s*[+*/,]\s*)/;return t.split(n).map(o=>{let i=o.trim();return!i||["+","-","*","/",","].includes(i)?o:ls(i,e)}).join("")},Wt=(t,e,r,n)=>{if(typeof t!="string")return P().verbose&&console.warn(e,t,"is not a string"),{[e]:t};if(t==="-"||t==="")return{};if(!n&&t.includes("(")){if(/^(?:env|var)\(/.test(t.trim()))return{[e]:t};let o=Yt(t);n=o[0],t=o[1]}return["+","-","*","/",","].filter(o=>t.includes(o+" ")).length?t=Xc(t,r):t=ls(t,r),{[e]:n?`${n}(${t})`:t}};V();var xd=Fr();var Yc="line|circle|ellipse|rect|polyline|polygon|path|stop|use|image",_d=new RegExp(`<(${Yc})\\b([^>]*?)\\s*/>`,"g");V();var ta={light:"(prefers-color-scheme: light)",dark:"(prefers-color-scheme: dark)"},dt=(t,e,r)=>{let n=r||P();if(!w(t)){n.verbose&&console.warn(t,"- type for color is not valid");return}if(Q(t))return`var(${t})`;e&&t[e]&&(t=t[e]);let s,o,i;if(M(t))[s,o,i]=t;else{let u=Ce(t);if(!u){let{color:h,gradient:p}=n,y=p[t]||h[t];return y?(e&&y[e]&&(y=y[e]),n.useVariable?`var(${y.var})`:y.value):t}if(u.passthrough)return u.passthrough;if(u.cssVar)return`var(${u.cssVar})`;s=u.name,o=u.alpha,i=u.tone}let{color:c,gradient:a}=n,l=c[s]||a[s];if(!l)return n.verbose&&console.warn("Can't find color ",s),t;if(e)if(l[e]!==void 0)l=l[e];else if(M(l)){let u=e.charCodeAt(0)===64?e.slice(1):e;u==="dark"?l=l[1]!==void 0?l[1]:l[0]:(u!=="light"&&n.verbose&&console.warn(t," - array-form color tokens only support light/dark; falling back to the light slot for scheme",e),l=l[0])}else n.verbose&&console.warn(t," - does not have ",e);if(w(l))return dt(l,null,r);let f=l.rgb;if(!f){let u=n.useVariable?`var(${l.var})`:l.value;if(o&&u){let h=Math.round(parseFloat(o)*100);return`color-mix(in srgb, ${u} ${h}%, transparent)`}return u}return i&&!l[i]&&(f=ns(f,i),l[i]={rgb:f,var:`${l.var}-${i}`}),l[i]&&(f=l[i].rgb),o?`rgba(${f}, ${o})`:i?`rgba(${f}, 1)`:n.useVariable?`var(${l.var})`:`rgb(${f})`},pt=(t,e,r)=>{let n=r||P();if(e||(e=n.globalTheme==="auto"?null:n.globalTheme),!w(t)){n.verbose&&console.warn(t,"- type for color is not valid");return}if(Q(t))return`var(${t})`;let s,o,i;if(M(t))s=t[0];else{let u=Ce(t);if(u){if(u.passthrough)return u.passthrough;if(u.cssVar)return`var(${u.cssVar})`;s=u.name,o=u.alpha,i=u.tone}else s=t}let{color:c,gradient:a}=n,l=c[s]||a[s],f=j(l);if(f&&l.value)return dt(t,`@${e}`,r);if(f){if(n.useVariable&&l.var)return o||i?dt(t,null,r):`var(${l.var})`;if(e)return dt(t,`@${e}`,r);{let u={};for(let h in l){if(h.charCodeAt(0)!==64)continue;let p=h.slice(1),y=n.media&&n.media[p]||ta[p];if(!y)continue;let d="@media "+(y==="print"?`${y}`:`screen and ${y}`);u[d]=dt(t,h,r)}return u}}else return n.verbose&&console.warn("Can't find color",t),t};V();var Qr=t=>{let e=P(),r={};for(let n in t){let s=n.slice(0,1);if(Dt(t[n])){if(s==="@")continue;s===":"?r[`&${n}`]=Qr(t[n]):s==="."&&(r[`&${n}`]=Qr(t[n]))}else r[n]=t[n]}return r},ds=(t,e)=>{let r=e.shift();return t[r]?ds(t[r],e):t},us=(t,e)=>M(e)?ds(t,e):w(e)&&t[e]?t[e]:t;var Oe=(t,e)=>{let r=P();if(w(t)&&Q(t)&&(t=Oe(t.slice(2))),!t||!w(t)){r.verbose&&console.warn(`${t} - Theme is not a string`);return}let[n,...s]=M(t)?t:t.split(" "),o=r.theme[n];return o&&s.length?o=us(o,s):o&&e&&(o=us(o,e)),Qr(o)};var ps=(t,e)=>{let r=P(),{fontFamily:n}=r;return qr(e||n,t)};var gs=t=>{let e=P(),{typography:r}=e;return Wt(t,"fontSize",r)};V();V();var ra=t=>{let r=P().spacing||{},n=parseFloat(t.spacingRatio),s={...r,ratio:Number.isFinite(n)?n:r.ratio,sequence:{},scales:{}};return Ee(s),s};var ys=t=>{let e=t.toLowerCase(),r=e.includes("width")||e.includes("height"),n=e.includes("border")||e.includes("outline");return r&&!n};var na=t=>{let e=P(),{spacing:r}=e;return!t||!t.sequence?r:Object.keys(t.sequence).length>0?t:Ee(t)},J=(t,e="padding",r,n)=>{let s=na(r);if(w(t)){if(!n&&/^(?:env|var)\(/.test(t.trim()))return{[e]:t};if(!n&&t.includes("(")){let i=Yt(t);n=i[0],t=i[1]}}let o=n?[t]:Yo(t);if(M(o)){if(o.length>1){let i="";e==="borderWidth"&&(e="border",i="Width");let c={2:["Block","Inline"],3:["BlockStart","Inline","BlockEnd"],4:["BlockStart","InlineEnd","BlockEnd","InlineStart"]},a=(l,f)=>Wt(o[f],e+l+i,s,n);return c[o.length].map((l,f)=>a(l,f))}return Wt(t,e,s,n)}},Zt=(t,e,r,n)=>{let s=P(),{spacing:o}=s,i=r||t[e];if(!n&&w(i)&&/^(?:env|var)\(/.test(i.trim()))return{[e]:i};if(!n&&w(i)&&i.includes("(")){let c=Yt(i);n=c[0],i=c[1]}if(t.spacingRatio){let c=ra(t);return J(i,e,c,n)}return J(i,e,o,n)},ms=t=>{let e=r=>{let n=["+","-","*","/"].includes(r),s=Rr.some(i=>t.includes(i));return n||s?r:r.length<3&&/[A-Z]/.test(r)?r+"_default":r};return t.split(",").map(r=>r.trim()).map(e).join(",").split(" ").map(e).join(" ")};V();var bs=(t,e)=>{let r=P();if(e||(e=r.globalTheme==="auto"?null:r.globalTheme),!w(t)){r.verbose&&console.warn(t,"- type for color is not valid");return}if(Q(t))return`var(${t})`;let[n]=M(t)?t:t.split(" "),o=r.shadow[n],i=j(o);if(!o)return r.verbose&&console.warn("Can't find color ",n),t;if(e){let c=o["@"+e]||o[e];if(c)return c.value!==void 0?c.value:c;r.verbose&&console.warn(t," - does not have ",e)}if(i&&o.value)return o.value;if(i){let c={};for(let a in o){if(a.charCodeAt(0)!==64)continue;let l=r.media[a.slice(1)];if(!l)continue;let f="@media "+(l==="print"?`${l}`:`screen and ${l}`),u=o[a],h=u&&(u.value!==void 0?u.value:u);h!==void 0&&(c[f]=h)}return c}return r.verbose&&console.warn("Can't find color",t),t};V();var Ot=t=>{let e=P(),{timing:r}=e;return r[t]||r[Jo(t)]||t},Ct=(t,e="timing")=>{let r=P(),{timing:n}=r;return Wt(t,e,n)};V();var ca=new Set(["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial"]),aa=new Set(["to","top","bottom","left","right","center","at","circle","ellipse","closest-side","farthest-side","closest-corner","farthest-corner"]),fa=t=>ca.has(t),jt=t=>{let e=t+"";if(Bt.test(e))return e;let r=e.trim();return r==="none"||r==="0"||r==="initial"||r==="inherit"||r==="unset"?e:e.split(/\s+/).map(s=>{if(s=s.trim(),!s)return"";if(Q(s))return`var(${s})`;if(fa(s)||/^\d/.test(s)||s==="0")return s;let o=dt(s);if(Xt(o))return o;let i=J(s,"border");return i&&i.border?i.border:s}).join(" ")},xs=t=>Bt.test(t)?t:t.split(/\s+/).map(e=>{if(e=e.trim(),!e)return"";if(Q(e))return`var(${e})`;if(/^\d/.test(e)||e.includes("px")||e==="0")return e;let r=dt(e);return Xt(r)?r:e}).join(" "),_s=(t,e)=>bs(t,e),Jr=(t,e)=>Bt.test(t)?t:ve(t).map(r=>(r=r.trim(),r?r.split(/\s+/).map(n=>{if(n=n.trim(),!n)return"";if(Q(n))return`var(${n})`;if(n==="inset"||n==="none")return n;let s=dt(n);if(Xt(s)){let i=pt(n,e);return j(i)?Object.values(i).filter(c=>c.includes(": "+e))[0]:i}if(/^\d/.test(n)||n==="0"||n.includes("px")||n.slice(-2)==="em")return n;let o=J(n,"shadow");return o&&o.shadow?o.shadow:n}).join(" "):"")).join(", "),Xr=(t,e)=>{let r=t.indexOf("(");if(r===-1)return t;let n=t.slice(0,r+1),s=t.slice(r+1,t.lastIndexOf(")")),o=")",c=ve(s).map(a=>(a=a.trim(),a.split(/\s+/).map(f=>{if(!f||/^\d/.test(f)||f==="0"||aa.has(f)||f==="transparent"||Bt.test(f))return f;let u=dt(f);return Xt(u)?u:f}).join(" ")));return n+c.join(", ")+o},Ss=(t,e)=>{let r=P();return ve(t).map(n=>{let s=n.trim();if(Q(s))return`var(${s})`;if(/^var\(/.test(s)||s.includes("url"))return s;if(r.gradient?.[s]){let o=pt(s,e);if(w(o))return o;if(j(o)){for(let i in o)if(w(o[i]))return o[i]}return s}return s.includes("gradient")?Xr(s,e):s.includes("/")||s.startsWith("http")||s.includes(".")&&!Ce(s)?`url(${s})`:s}).join(", ")},ws=t=>w(t)&&t.split(" ").map(e=>J(e,"gap").gap).join(" "),la=t=>{let e=t.split(" ");return e.length?e.map(r=>Q(r)?`var(${r})`:r.length<3||r.includes("ms")?Ct(r).timing||r:Ot(r)?Ot(r):r).join(" "):t},Yr=(t,e,r)=>{if(w(t))return t.split(",").map(n=>Ct(n).timing||n).join(",")},ks=t=>{let e=t.split(",");if(e.length)return e.map(la).join(",")};function W(t,e,r={},n={}){let s=Kt.call(this,e||r[t]);if(s==null)return;let o;if(w(s)){if(/^(?:env|var)\(/.test(s.trim()))return{[t]:s};if(s.includes("(")){let a=Yt(s);o=a[0],s=a[1]}let i=r.scaleBoxSize,c=ys(t);!i&&c&&!n.ratio&&(s=ms(s))}return n.ratio?Zt(r,t,s,o):J(s,t,void 0,o)}var C=(t,e=null,r)=>W(t,e,r,{ratio:!0}),Zr=(t,e,r)=>{if(w(t))return{borderRadius:t.split(" ").map((n,s)=>Zt(e,r,n)[r]).join(" ")}};var tn=new WeakMap,ua={passive:!0},da={passive:!0,capture:!0},en=(t,e)=>jn.has(t)?e?da:ua:e||!1;function vs(t){let e=tn.get(t);return e||(e={handlers:new Map,installed:new Set},tn.set(t,e)),e}function pa(t,e){let r=vs(e);if(r.installed.has(t))return;r.installed.add(t);let n=t==="focus"||t==="blur"||t==="focusin"||t==="focusout"||t==="mouseenter"||t==="mouseleave",s=t==="mouseenter"||t==="mouseleave";e.addEventListener(t,o=>{let i=o.target;for(;i&&i!==e;){let c=r.handlers.get(t);if(c){let a=c.get(i);if(a){if(s&&o.relatedTarget&&i.contains(o.relatedTarget)){i=i.parentNode;continue}if(a(o),o.cancelBubble)return}}i=i.parentNode}},en(t,n))}function As(t,e,r,n){n||(n=e.ownerDocument?.documentElement||e.getRootNode());let s=vs(n);pa(t,n),s.handlers.has(t)||s.handlers.set(t,new WeakMap),s.handlers.get(t).set(e,r)}function Es(t,e,r){r||(r=e.ownerDocument?.documentElement||e.getRootNode());let n=tn.get(r);if(!n)return;let s=n.handlers.get(t);s&&s.delete(e)}function Cs(t){return Tr.has(t)&&!ue.has(t)}function $e(t,e,r){let{node:n,context:s}=e;if(!n)return;let o=s?.designSystem,i=a=>{o&&z(o);try{let l=r.call(e,a,e,e.state,s);if(l&&typeof l.then=="function"){l.catch(f=>{e.error=f,console.error("[DOMQL] Async event error:",f)}).finally(()=>{o&&U()});return}}catch(l){if(e.error=l,console.error("[DOMQL] Event error:",l),s?.strictMode)throw l}o&&U()},c=$r.has(t);if(!c&&Cs(t)){let a=s?.rootNode||n.ownerDocument?.documentElement;As(t,n,i,a)}else n.addEventListener(t,i,en(t,!1));e.__ref.__eventCleanup||(e.__ref.__eventCleanup=[]),e.__ref.__eventCleanup.push(()=>{if(!c&&Cs(t)){let a=s?.rootNode||n.ownerDocument?.documentElement;Es(t,n,a)}else n.removeEventListener(t,i,en(t,!1))})}function Os(t){let e=[];return t.extends&&(Array.isArray(t.extends)?e.push(...t.extends):e.push(t.extends)),t.extend&&(Array.isArray(t.extend)?e.push(...t.extend):e.push(t.extend)),e}function Te(t,e,r){let n=Os(e);if(!n.length)return;let o=(t.context||r?.context||{}).components||{};for(let i=0;i<n.length;i++){let c=$s(n[i],o);c&&c!==e&&Ts(t,c,r,new Set([e]))}}function $s(t,e){if(typeof t=="string"){if(t.includes(">")){let r=t.split(">").map(s=>s.trim()),n=e[r[0]]||e[`smbls.${r[0]}`];for(let s=1;s<r.length&&n;s++)n=n[r[s]];return n||null}return e[t]||e[`smbls.${t}`]||null}return typeof t=="object"&&t!==null?t:null}function Ts(t,e,r,n=new Set){if(n.has(e))return;n.add(e);let s=Os(e);if(s.length){let i=(t.context||r?.context||{}).components||{};for(let c=0;c<s.length;c++){let a=$s(s[c],i);a&&Ts(t,a,r,n)}}for(let o in e){if(o==="extends"||o==="extend")continue;let i=e[o];t[o]===void 0?i&&typeof i=="object"&&!Array.isArray(i)&&typeof i!="function"?t[o]={...i}:t[o]=i:typeof t[o]=="object"&&typeof i=="object"&&!Array.isArray(t[o])&&!Array.isArray(i)&&t[o]!==null&&i!==null?t[o]=Ps(t[o],i):t[o]=i}}function Ps(t,e){let r={...t};for(let n in e){let s=r[n],o=e[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)&&typeof s!="function"&&typeof o!="function"?r[n]=Ps(s,o):r[n]=o}return r}ze();V();var rn={default:["accesskey","autofocus","class","contenteditable","contextmenu","dir","draggable","hidden","id","lang","part","placeholder","slot","spellcheck","style","tabindex","title","translate","inert","radiogroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autocapitalize","autocorrect","autosave","color","itemprop","itemscope","itemtype","itemid","itemref","results","security","unselectable","is"],a:["accesskey","charset","coords","download","href","hreflang","name","rel","rev","shape","target","type"],aria:["aria-activedescendant","aria-atomic","aria-autocomplete","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],anchor:["download","href","hreflang","media","ping","rel","target","type","referrerpolicy"],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],area:["alt","coords","download","href","hreflang","media","referrerpolicy","rel","shape","target","ping"],base:["href","target"],blockquote:["cite"],button:["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","type","value"],canvas:["height","width"],col:["span","width"],colgroup:["span"],data:["value"],details:["open"],del:["cite","datetime"],dialog:["open"],embed:["height","src","type","width"],fieldset:["disabled","form","name"],form:["acceptcharset","action","autocomplete","enctype","method","name","novalidate","target","rel"],html:["manifest"],iframe:["allow","allowfullscreen","allowtransparency","frameborder","height","loading","marginheight","marginwidth","mozallowfullscreen","name","referrerpolicy","sandbox","scrolling","seamless","src","srcdoc","webkitallowfullscreen","width"],img:["alt","crossorigin","decoding","height","ismap","loading","referrerpolicy","sizes","src","srcset","usemap","width"],ins:["cite","datetime"],input:["accept","alt","autocomplete","capture","checked","crossorigin","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","indeterminate","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","src","step","type","value","width"],keygen:["challenge","disabled","form","keytype","keyparams","name"],label:["form","for"],li:["value"],link:["as","crossorigin","href","hreflang","integrity","media","imagesrcset","imagesizes","referrerpolicy","rel","sizes","type","charset"],map:["name"],menu:["type"],media:["autoplay","controls","currenttime","defaultmuted","defaultplaybackrate","loop","mediagroup","muted","playsinline","preload","src","volume"],meta:["charset","content","http-equiv","name","media"],meter:["form","high","low","max","min","optimum","value"],quote:["cite"],object:["classid","data","form","height","name","type","usemap","width","wmode"],ol:["reversed","start","type"],optgroup:["disabled","label"],option:["disabled","label","selected","value"],output:["form","for","name"],param:["name","value"],progress:["max","value"],slot:["name"],script:["async","charset","crossorigin","defer","integrity","nomodule","nonce","referrerpolicy","src","type"],select:["autocomplete","disabled","form","multiple","name","required","size","value","onchange"],source:["height","media","sizes","src","srcset","type","width"],style:["media","nonce","scoped","type"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],textarea:["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","value","wrap"],td:["align","colspan","headers","rowspan","scope","abbr","height","width","valign"],th:["align","colspan","headers","rowspan","scope","abbr"],time:["datetime"],track:["default","kind","label","src","srclang"],video:["autoplay","controls","crossorigin","disablepictureinpicture","disableremoteplayback","height","loop","muted","playsinline","poster","preload","src","width"],svg:["className","class","color","height","id","lang","max","media","method","min","name","style","target","type","width","role","tabindex","crossorigin","accent-height","accumulate","additive","alignment-baseline","allowReorder","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","clip","clip-path","clipPathUnits","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","end","exponent","externalResourcesRequired","fill","fill-opacity","fill-rule","filter","filterRes","filterUnits","flood-color","flood-opacity","focusable","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","format","from","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","href","horiz-adv-x","horiz-origin-x","ideographic","image-rendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","markerHeight","marker-mid","marker-start","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","paint-order","panose-1","path","pathLength","patternContentUnits","patternTransform","patternUnits","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","surfaceScale","systemLanguage","tableValues","targetX","targetY","text-anchor","text-decoration","textLength","text-rendering","to","transform","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","values","vector-effect","version","vert-adv-y","vert-origin-x","vert-origin-y","v-hanging","v-ideographic","viewBox","viewTarget","visibility","v-mathematical","widths","word-spacing","writing-mode","x1","x2","x","xChannelSelector","x-height","xlink:actuate","xlink:arcrole","xlink:href","xlink:role","xlink:show","xlink:title","xlink:type","xml:base","xml:lang","xmlns","xmlns:xlink","xml:space","y1","y2","y","yChannelSelector","z","zoomAndPan"]};var Pe=t=>t.startsWith("aria")&&t.length>4&&t.charCodeAt(4)>=65&&t.charCodeAt(4)<=90?"aria-"+t.charAt(4).toLowerCase()+t.slice(5).replace(/([A-Z])/g,e=>"-"+e.toLowerCase()):t.startsWith("data")&&t.length>4&&t.charCodeAt(4)>=65&&t.charCodeAt(4)<=90?"data-"+t.charAt(4).toLowerCase()+t.slice(5).replace(/([A-Z])/g,e=>"-"+e.toLowerCase()):ga(t),ha=new Set(["tabIndex","readOnly","maxLength","minLength","autoComplete","autoFocus","autoPlay","contentEditable","spellCheck","colSpan","rowSpan","srcSet","crossOrigin","accessKey","inputMode","enterKeyHint","formAction","noValidate"]),ga=t=>ha.has(t)?t.toLowerCase():null,ya=new Set(["draggable","contenteditable","spellcheck","autocorrect"]),nn=t=>typeof t=="string"&&(ya.has(t)||t.startsWith("aria-")),sr=(t,e)=>e!==!0&&e!==!1?e:nn(t)?e?"true":"false":e===!0?"":e,Re=(t,e)=>e.startsWith("aria-")||e.startsWith("data-")||Pe(e)||rn.default.includes(e)?!0:Object.prototype.hasOwnProperty.call(rn,t)?rn[t].includes(e):!1;var or=(t,e)=>{let r=t.call("exec",e,t);if(r)return w(r)&&r.includes("{{")&&(r=t.call("replaceLiteralsWithObjectFields",r)),r},Rs=(t,e)=>{let r=(t.preSrc||"")+(or(t,e)||"");if(!r)return;try{return new URL(r),r}catch{}let{context:n}=t;if(!n.files&&!n.assets)return r;if(r.startsWith("/assets/")){let s=r.slice(8),o=n.assets&&(n.assets[r]||n.assets[s]);return o&&o.content?o.content.src:r}if(r.startsWith("/files/")){let s=r.slice(7),o=n.files&&(n.files[r]||n.files[s]);return o&&o.content?o.content.src:r}if(n.assets){let s=n.assets[r];if(s&&s.content)return s.content.src}if(n.files){let s=n.files[r];if(s&&s.content)return s.content.src}return r},Ds={src:t=>Rs(t,t.src),href:t=>or(t,t.href),action:t=>or(t,t.action),poster:t=>Rs(t,t.poster),data:t=>or(t,t.data)},Is=t=>{let e=t.tag||"div",r={};for(let n in Ds)if(t[n]!==void 0&&Re(e,n)){let s=Ds[n](t);s!==void 0&&(r[n]=s)}return r};function on(t={},e={}){let r=this,n=r.__ref;if(!n)return;if((typeof t=="string"||typeof t=="number")&&(t={text:t}),!e.preventListeners&&typeof r.onBeforeUpdate=="function"&&r.onBeforeUpdate(r,r.state,r.context,e)===!1)return r;let s=!t||Object.keys(t).length===0;if(vt(()=>{if(t.state&&G(r.state)&&r.state.$update(t.state),t.text!==void 0&&(r.text=t.text,!n.__exec.text&&r.node&&(r.tag==="string"?r.node.nodeValue=t.text??"":r.node.textContent=t.text??"")),t.html!==void 0&&(r.html=t.html,!n.__exec.html&&r.node&&(r.node.innerHTML=t.html)),t.style&&r.node?.style){if(!n.__exec.style)for(let o in t.style){let i=t.style[o];if(i==null)continue;let c=o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=String(i).replace(/\s*!important\s*$/,"");r.node.style.setProperty(c,a,"important")}r.style||(r.style={}),Object.assign(r.style,t.style)}if(t.attr&&r.node?.setAttribute){for(let o in t.attr){let i=t.attr[o];i==null||i===!1?r.node.removeAttribute(o):typeof i!="function"&&typeof i!="object"&&r.node.setAttribute(o,sr(o,i))}r.attr||(r.attr={}),Object.assign(r.attr,t.attr)}if(t.data&&r.node?.dataset){for(let o in t.data)r.node.dataset[o]=t.data[o];r.data||(r.data={}),Object.assign(r.data,t.data)}for(let o in t){if(rt.has(o)||o==="state")continue;let i=t[o],c=r[o];if(c&&c.__ref&&typeof c.update=="function")c.update(i,e);else if(typeof i=="object"&&i!==null){let a=o.charCodeAt(0);a>=65&&a<=90&&ht(i,r,o,e)}else o!=="text"&&o!=="html"&&o!=="style"&&o!=="attr"&&o!=="data"&&(r[o]=i)}}),r.node&&s&&n.__effects&&n.__effects.length)for(let o=0;o<n.__effects.length;o++){let i=n.__effects[o];i&&!i._disposed&&!i._isSubscribeToEffect&&typeof i._execute=="function"&&i._execute()}else if(r.node&&n.__conditionalRunners)for(let o of n.__conditionalRunners)o();return wt("update",r),!e.preventListeners&&typeof r.onUpdate=="function"&&r.onUpdate(r,r.state,r.context,e),r}function sn(t){if(!t)return;let e=t.__ref;if(!e)return;try{typeof t.onBeforeRemove=="function"&&t.onBeforeRemove(t,t.state,t.context)}catch(n){console.error("[smbls] onBeforeRemove error:",n)}if(e.__effects){for(let n=0;n<e.__effects.length;n++)e.__effects[n].dispose();e.__effects.length=0}if(e.__eventCleanup){for(let n=0;n<e.__eventCleanup.length;n++)e.__eventCleanup[n]();e.__eventCleanup.length=0}if(e.__children){for(let n=0;n<e.__children.length;n++){let s=e.__children[n],o=t[s];o&&o.__ref&&sn(o)}e.__children.length=0}t.node?.parentNode?t.node.remove():t.tag==="fragment"&&e.__fragmentAnchor?.parentNode&&e.__fragmentAnchor.remove();let r=t.state?.$destroy||t.state?.destroy;if(typeof r=="function"&&t.state.__element===t&&r.call(t.state),t.parent?.__ref?.__children){let n=t.parent.__ref.__children.indexOf(t.key);n!==-1&&t.parent.__ref.__children.splice(n,1),delete t.parent[t.key]}try{typeof t.onRemove=="function"&&t.onRemove(t)}catch(n){console.error("[smbls] onRemove error:",n)}t.node=null,t.parent=null,t.__ref=null}function cn(){sn(this)}V();V();var De=new Map,ma=null,js=null;var Ms=t=>!!(t&&t.documentElement&&typeof t.createElement=="function"&&t.head!==void 0);function Vs(){try{let t=P();if(t){if(Ms(t.__domDocument))return t.__domDocument;if(Ms(t.document))return t.document}}catch{}return typeof document<"u"?document:null}var ba={display:"d",position:"pos",padding:"p",paddingTop:"pt",paddingRight:"pr",paddingBottom:"pb",paddingLeft:"pl",margin:"m",marginTop:"mt",marginRight:"mr",marginBottom:"mb",marginLeft:"ml",width:"w",height:"h",minWidth:"mnw",minHeight:"mnh",maxWidth:"mxw",maxHeight:"mxh",top:"t",right:"r",bottom:"b",left:"l",flex:"fx",flexDirection:"fxd",flexWrap:"fxw",flexGrow:"fxg",flexShrink:"fxs",flexBasis:"fxb",justifyContent:"jc",alignItems:"ai",alignSelf:"as",alignContent:"ac",gap:"g",rowGap:"rg",columnGap:"cg",gridTemplateColumns:"gtc",gridTemplateRows:"gtr",gridColumn:"gc",gridRow:"gr",overflow:"of",overflowX:"ofx",overflowY:"ofy",fontSize:"fs",fontWeight:"fw",fontFamily:"ff",fontStyle:"fst",lineHeight:"lh",letterSpacing:"ls",textAlign:"ta",textDecoration:"td",textTransform:"tt",color:"c",background:"bg",backgroundColor:"bgc",backgroundImage:"bgi",border:"bd",borderRadius:"br",borderColor:"bdc",borderWidth:"bdw",borderStyle:"bds",boxShadow:"bxsh",opacity:"op",zIndex:"z",cursor:"cur",transition:"tr",transform:"tf",animation:"an",visibility:"vis",whiteSpace:"ws",wordBreak:"wb",objectFit:"obj",pointerEvents:"pe",userSelect:"us",boxSizing:"bxz",outline:"ol",listStyle:"lis",textOverflow:"txo",verticalAlign:"va",float:"fl",clear:"cl",content:"cnt",backdropFilter:"bdf",filter:"flt",resize:"rsz",appearance:"apr",fill:"fil",stroke:"stk"};function ir(t){return t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function cr(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=e*16777619>>>0;return e.toString(36)}function xa(t){let e=String(t);return e.length<=20?e.replace(/\s+/g,"_").replace(/[^a-zA-Z0-9_-]/g,"").toLowerCase():cr(e)}var _a={"backdrop-filter":"-webkit-backdrop-filter","user-select":"-webkit-user-select"};function fn(t,e){let r=_a[t];return r?`${t}:${e};${r}:${e};`:`${t}:${e};`}var Sa="@media (hover: hover)",wa=/(?:^|[^\\]):hover(?![\w-])/;function Bs(){try{let t=P();if(t&&t.hoverMedia===!1)return!1}catch{}return!0}function zt(t,e,r){return r===!1||!wa.test(e)||r===void 0&&!Bs()?t:`${Sa}{${t}}`}function Ls(t,e,r){let n=(r?r+"":"")+t+":"+e,s=De.get(n),o=s?null:ir(t);if(!s){let a=ba[t]||cr(t),l=xa(e);s=r?`_${r}_${a}-${l}`:`_${a}-${l}`,De.set(n,s)}if(typeof e=="string"&&(e.indexOf("}")!==-1||e.indexOf("{")!==-1))return s;let i=o||ir(t),c=`.${s}{${fn(i,e)}}`;return Mt(c),s}var Fs=new WeakMap;function Mt(t,e){let r=ka(e);if(!r)return;let n=Fs.get(r);if(n||(n=new Set,Fs.set(r,n)),!n.has(t)){n.add(t);try{r.insertRule(t,r.cssRules.length)}catch{}}}var Ns=new WeakMap;function ka(t){let e=t||Vs();if(!e||!e.head)return null;let r=Ns.get(e);if(r&&r.ownerNode&&r.ownerNode.parentNode===e.head)return r;let n=e.head.querySelector("style[data-smbls]");n||(n=e.createElement("style"),n.setAttribute("data-smbls",""),e.head.appendChild(n));let s=n.sheet;return Ns.set(e,s),ma=s,s}var Ca=8;function te(t,e,r){if(!t||typeof t!="object")return"";let n=null,s=0,o=[],i=[];for(let a in t){let l=t[a];l==null||l===!1||l===""||(typeof l=="object"?i.push([a,l]):js?(n||(n=[]),n.push(a,String(l)),s++):o.push(Ls(a,String(l),r)))}if(n&&s>=Ca){let a=n.join("\0"),l=js(a),f=l.indexOf("\0"),u=l.substring(0,f),h=l.substring(f+1);if(h){let p=h.split(`
|
|
11
|
+
`);for(let y=0;y<p.length;y++)p[y]&&Mt(p[y])}o.push(u)}else if(n)for(let a=0;a<n.length;a+=2)o.push(Ls(n[a],n[a+1],r));let c=[];for(let a=0;a<i.length;a++)c.push(va(i[a][0],i[a][1],r));return o.concat(c).join(" ").trim()}var an=new Map;function va(t,e,r){let n=JSON.stringify(e),s=t.indexOf(":hover")!==-1||n.indexOf(":hover")!==-1,o=s&&Bs(),i=(r?r+"":"")+t+n+(s&&!o?"rawhover":""),c=De.get(i);if(c){let d=an.get(c);if(d)for(let m=0;m<d.length;m++)Mt(d[m]);return c}c=r?`_${r}_c${cr(i)}`:`_c${cr(i)}`;let a="",l=[],f=d=>typeof d=="string"&&(d.indexOf("{")!==-1||d.indexOf("}")!==-1),u=(d,m)=>{let x="";for(let b in m){let g=m[b];if(g!=null)if(typeof g=="object")u([...d,b],g);else{if(f(g))continue;x+=fn(ir(b),g)}}x&&(d.length===0?a+=x:l.push({chain:d,body:x}))};u([],e);let h=d=>{if(!d.length)return`.${c}`;let m=d[0].split(",").map(x=>x.trim()).map(x=>x.includes("&")?x.replace(/&/g,`.${c}`):x.startsWith(":")?`.${c}${x}`:`.${c} ${x}`);for(let x=1;x<d.length;x++){let b=d[x].split(",").map(_=>_.trim()),g=[];for(let _ of m)for(let S of b)S.includes("&")?g.push(S.replace(/&/g,_)):S.startsWith(":")?g.push(_+S):g.push(_+" "+S);m=g}return m.join(", ")},p=[];if(t.startsWith("@media")||t.startsWith("@supports")){if(a){let d=`${t}{.${c}{${a}}}`;p.push(d),Mt(d)}for(let d of l){let m=h(d.chain),x=zt(`${t}{${m}{${d.body}}}`,m,o);p.push(x),Mt(x)}return an.set(c,p),De.set(i,c),c}let y=h([t]);if(a){let d=zt(`${y}{${a}}`,y,o);p.push(d),Mt(d)}for(let d of l){let m=h([t,...d.chain]),x=zt(`${m}{${d.body}}`,m,o);p.push(x),Mt(x)}return an.set(c,p),De.set(i,c),c}function ar(t,e){let r="";for(let n in e){let s="";for(let o in e[n])s+=fn(ir(o),e[n][o]);r+=`${n}{${s}}`}return Mt(`@keyframes ${t}{${r}}`),t}var Aa=["ease","linear","ease-in","ease-out","ease-in-out","step-start","step-end"],Ea=["none","forwards","backwards","both"],Oa=["normal","reverse","alternate","alternate-reverse"],$a=["running","paused"],Ta=t=>/^[\d.]+m?s$/.test(t),Pa=0,Us=new Map,ln=(t,e)=>{let{animation:r}=e.context&&e.context.designSystem||{};if(j(t)){let s=JSON.stringify(t),o=Us.get(s);if(o)return o;let i=`smbls-anim-${Pa++}`,c=ar(i,t);return Us.set(s,c),c}let n=r&&r[t];return j(n)?ar(t,n):t},Ra=(t,e)=>{let{animation:r}=e.context&&e.context.designSystem||{},n=t.split(/\s+/),s=null,o=[],i=null,c=null,a=null,l=null,f=null;for(let u of n)r&&r[u]?s=u:Ta(u)?o.push(u):Aa.includes(u)||u.startsWith("cubic-bezier")||u.startsWith("steps(")?i=u:u==="infinite"||/^\d+$/.test(u)?c=u==="infinite"?u:Number(u):Oa.includes(u)?a=u:Ea.includes(u)?l=u:$a.includes(u)?f=u:s||(s=u);return{name:s,durations:o,timingFunction:i,iterationCount:c,direction:a,fillMode:l,playState:f}},Ws={animation:(t,e)=>{if(w(t)&&t.includes(" ")){let r=Ra(t,e);return{animationName:ln(r.name||t,e),animationDuration:r.durations[0]||Ct(e.animationDuration||"A").timing,animationDelay:r.durations[1]||Ct(e.animationDelay||"0s").timing,animationTimingFunction:r.timingFunction||Ot(e.animationTimingFunction||"ease"),animationFillMode:r.fillMode||e.animationFillMode||"both",animationIterationCount:r.iterationCount!=null?r.iterationCount:e.animationIterationCount||1,animationPlayState:r.playState||e.animationPlayState,animationDirection:r.direction||e.animationDirection}}return{animationName:ln(t,e),animationDuration:Ct(e.animationDuration||"A").timing,animationDelay:Ct(e.animationDelay||"0s").timing,animationTimingFunction:Ot(e.animationTimingFunction||"ease"),animationFillMode:e.animationFillMode||"both",animationIterationCount:e.animationIterationCount||1,animationPlayState:e.animationPlayState,animationDirection:e.animationDirection}},animationName:(t,e)=>({animationName:ln(t,e)}),animationDuration:t=>({animationDuration:Ct(t).timing}),animationDelay:t=>({animationDelay:Ct(t).timing}),animationTimingFunction:t=>({animationTimingFunction:Ot(t)}),animationIterationCount:t=>({animationIterationCount:t}),animationFillMode:t=>({animationFillMode:t}),animationPlayState:t=>({animationPlayState:t}),animationDirection:t=>({animationDirection:t})};V();var zs={show:t=>t?void 0:{display:"none !important"},hide:t=>t?{display:"none !important"}:void 0,height:(t,e)=>C("height",t,e),width:(t,e)=>C("width",t,e),boxSizing:t=>Ln(t)?{boxSizing:"border-box"}:{boxSizing:t},boxSize:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("height",e),...W("width",r||e)}},inlineSize:(t,e)=>C("inlineSize",t,e),blockSize:(t,e)=>C("blockSize",t,e),minWidth:(t,e)=>C("minWidth",t,e),maxWidth:(t,e)=>C("maxWidth",t,e),widthRange:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("minWidth",e),...W("maxWidth",r||e)}},minHeight:(t,e)=>C("minHeight",t,e),maxHeight:(t,e)=>C("maxHeight",t,e),heightRange:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("minHeight",e),...W("maxHeight",r||e)}},size:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...C("inlineSize",e),...C("blockSize",r||e)}},minBlockSize:(t,e)=>C("minBlockSize",t,e),minInlineSize:(t,e)=>C("minInlineSize",t,e),maxBlockSize:(t,e)=>C("maxBlockSize",t,e),maxInlineSize:(t,e)=>C("maxInlineSize",t,e),minSize:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("minInlineSize",e),...W("minBlockSize",r||e)}},maxSize:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("maxInlineSize",e),...W("maxBlockSize",r||e)}},borderWidth:(t,e)=>C("borderWidth",t,e),borderTopWidth:(t,e)=>C("borderTopWidth",t,e),borderRightWidth:(t,e)=>C("borderRightWidth",t,e),borderBottomWidth:(t,e)=>C("borderBottomWidth",t,e),borderLeftWidth:(t,e)=>C("borderLeftWidth",t,e),padding:(t,e)=>C("padding",t,e),scrollPadding:(t,e)=>C("scrollPadding",t,e),paddingInline:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("paddingInlineStart",e),...W("paddingInlineEnd",r||e)}},paddingBlock:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("paddingBlockStart",e),...W("paddingBlockEnd",r||e)}},paddingTop:(t,e)=>C("paddingBlockStart",t,e),paddingBottom:(t,e)=>C("paddingBlockEnd",t,e),paddingLeft:(t,e)=>C("paddingInlineStart",t,e),paddingRight:(t,e)=>C("paddingInlineEnd",t,e),paddingBlockStart:(t,e)=>C("paddingBlockStart",t,e),paddingBlockEnd:(t,e)=>C("paddingBlockEnd",t,e),paddingInlineStart:(t,e)=>C("paddingInlineStart",t,e),paddingInlineEnd:(t,e)=>C("paddingInlineEnd",t,e),margin:(t,e)=>C("margin",t,e),marginInline:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{...W("marginInlineStart",e),...W("marginInlineEnd",r||e)}},marginBlock:(t,e)=>{if(!w(e.marginBlock))return;let[r,n]=e.marginBlock.split(" ");return{...W("marginBlockStart",r),...W("marginBlockEnd",n||r)}},marginTop:(t,e)=>C("marginBlockStart",t,e),marginBottom:(t,e)=>C("marginBlockEnd",t,e),marginLeft:(t,e)=>C("marginInlineStart",t,e),marginRight:(t,e)=>C("marginInlineEnd",t,e),marginInlineStart:(t,e)=>C("marginInlineStart",t,e),marginInlineEnd:(t,e)=>C("marginInlineEnd",t,e),marginBlockStart:(t,e)=>C("marginBlockStart",t,e),marginBlockEnd:(t,e)=>C("marginBlockEnd",t,e),gap:t=>({gap:ws(t)}),columnGap:(t,e)=>Zt(e,"columnGap",t),rowGap:(t,e)=>Zt(e,"rowGap",t),flexWrap:t=>({display:"flex",flexWrap:t}),flexFlow:(t,e)=>{let r=e.reverse;if(!w(t))return;let[n,s]=(t||"row").split(" ");return(t.startsWith("x")||t==="row")&&(n="row"),(t.startsWith("y")||t==="column")&&(n="column"),{display:"flex",flexFlow:(n||"")+(!n.includes("-reverse")&&r?"-reverse":"")+" "+(s||"")}},flexAlign:t=>{if(!w(t))return;let[e,r]=t.split(" ");return{display:"flex",alignItems:e,justifyContent:r}},round:(t,e)=>Zr(t??e.borderRadius,e,"round"),borderRadius:(t,e)=>Zr(t??e.round,e,"borderRadius")};var Gs={fontSize:t=>gs(t)||t,fontFamily:t=>({fontFamily:ps(t)||t}),fontWeight:t=>({fontWeight:t,fontVariationSettings:'"wght" '+t}),lineClamp:t=>{if(t!=null)return t==="none"?{WebkitLineClamp:"none",lineClamp:"none"}:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:String(t),lineClamp:String(t),overflow:"hidden"}}};var Hs={overflow:t=>({overflow:t}),cursor:(t,e,r,n)=>{if(!t)return;let s=n.assets&&n.assets[t];if(s&&s.content)t=`url(${s.content.src})`;else{let o=n.files&&n.files[t];o&&o.content&&(t=`url(${o.content.src})`)}return{cursor:t}},opacity:t=>t!=null?{opacity:String(t)}:void 0,visibility:t=>t!=null?{visibility:t}:void 0,pointerEvents:t=>t!=null?{pointerEvents:t}:void 0};var qs={inset:(t,e)=>{if(e.call("isNumber",t))return{inset:t};if(e.call("isString",t))return{inset:t.split(" ").map(r=>J(r,"k").k).join(" ")}},left:t=>J(t,"left"),top:t=>J(t,"top"),right:t=>J(t,"right"),bottom:t=>J(t,"bottom"),verticalInset:t=>{if(typeof t!="string")return;let e=t.split(" ").map(r=>J(r,"k").k);return{top:e[0],bottom:e[1]||e[0]}},horizontalInset:t=>{if(typeof t!="string")return;let e=t.split(" ").map(r=>J(r,"k").k);return{left:e[0],right:e[1]||e[0]}}};V();var bt=({context:t,state:e})=>{let r=e?.root?.globalTheme||t.designSystem?.globalTheme;return r==="auto"?null:r},gt=(t,e)=>{if(e==null||e==="")return;if(!j(e))return{[t]:e};let r={},n=!1;for(let s in e){let o=e[s];o==null||o===""||j(o)||(r[s]={[t]:o},n=!0)}return n?r:void 0},Ks={theme:(t,e)=>{if(t)return e.themeModifier?Oe(t,`@${e.themeModifier}`):Oe(t)},color:(t,e)=>{let r=bt(e);if(t)return gt("color",pt(t,r))},background:(t,e)=>{let r=bt(e);if(t)return w(t)&&t.includes("gradient")&&t.includes("(")?{background:Xr(t,r)}:gt("background",pt(t,r))},backgroundColor:(t,e)=>{let r=bt(e);if(t)return gt("backgroundColor",pt(t,r))},backgroundImage:(t,e,r,n)=>{let s=bt(e);if(!t)return;let o=n.assets&&n.assets[t];if(o&&o.content)t=o.content.src;else{let i=n.files&&n.files[t];i&&i.content&&(t=i.content.src)}return gt("backgroundImage",Ss(t,s))},textStroke:t=>({WebkitTextStroke:xs(t)}),outline:t=>({outline:jt(t)}),outlineOffset:(t,e)=>C("outlineOffset",t,e),border:t=>({border:jt(t)}),borderColor:(t,e)=>{let r=bt(e);if(t)return gt("borderColor",pt(t,r))},borderTopColor:(t,e)=>{let r=bt(e);if(t)return gt("borderTopColor",pt(t,r))},borderBottomColor:(t,e)=>{let r=bt(e);if(t)return gt("borderBottomColor",pt(t,r))},borderLeftColor:(t,e)=>{let r=bt(e);if(t)return gt("borderLeftColor",pt(t,r))},borderRightColor:(t,e)=>{let r=bt(e);if(t)return gt("borderRightColor",pt(t,r))},borderLeft:t=>({borderLeft:jt(t)}),borderTop:t=>({borderTop:jt(t)}),borderRight:t=>({borderRight:jt(t)}),borderBottom:t=>({borderBottom:jt(t)}),shadow:(t,e)=>{let r=bt(e);if(t)return gt("boxShadow",_s(t,r))},boxShadow:(t,e)=>{if(!w(t))return;let[r,n]=t.split("!importan"),s=bt(e),o=n?" !important":"",i=Jr(r.trim(),s);return w(i)?{boxShadow:i+o}:gt("boxShadow",i)},textShadow:(t,{context:e})=>gt("textShadow",Jr(t,e.designSystem.globalTheme)),columnRule:t=>({columnRule:jt(t)})};var Qs={transition:t=>({transition:ks(t)}),transitionDuration:t=>({transitionDuration:Yr(t)}),transitionDelay:t=>({transitionDelay:Yr(t)}),transitionTimingFunction:t=>({transitionTimingFunction:Ot(t)}),transitionProperty:t=>({transitionProperty:t,willChange:t})};V();var Js={flow:(t,e)=>{let r=e.reverse;if(!w(t))return;let[n,s]=(t||"row").split(" ");return(t.startsWith("x")||t==="row")&&(n="row"),(t.startsWith("y")||t==="column")&&(n="column"),{display:"flex",flexFlow:(n||"")+(!n.includes("-reverse")&&r?"-reverse":"")+" "+(s||"")}},wrap:(t,e)=>({display:"flex",flexWrap:t}),align:(t,e)=>{let[r,n]=t.split(" ");return{display:"flex",alignItems:r,justifyContent:n}}};var Xs={area:t=>({gridArea:t}),template:t=>({gridTemplate:t}),templateAreas:t=>({gridTemplateAreas:t}),column:t=>({gridColumn:t}),columns:t=>({gridTemplateColumns:t}),templateColumns:t=>({gridTemplateColumns:t}),autoColumns:t=>({gridAutoColumns:t}),columnStart:t=>({gridColumnStart:t}),row:t=>({gridRow:t}),rows:t=>({gridTemplateRows:t}),templateRows:t=>({gridTemplateRows:t}),autoRows:t=>({gridAutoRows:t}),rowStart:t=>({gridRowStart:t}),autoFlow:t=>({gridAutoFlow:t})};var X={...Ws,...zs,...Gs,...Hs,...qs,...Ks,...Qs,...Js,...Xs};var H=new Set(["accentColor","alignContent","alignItems","alignSelf","alignmentBaseline","all","animation","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationTimingFunction","appearance","aspectRatio","backdropFilter","backfaceVisibility","background","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundRepeatX","backgroundRepeatY","backgroundSize","baselineShift","blockSize","border","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","boxDecorationBreak","boxShadow","boxSizing","breakAfter","breakBefore","breakInside","captionSide","caretColor","clear","clip","clipPath","color","colorAdjust","colorInterpolation","colorInterpolationFilters","colorRendering","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","contain","content","counterIncrement","counterReset","cursor","direction","display","emptyCells","filter","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","float","font","fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantNumeric","fontVariantPosition","fontWeight","fontVariationSettings","fontSynthesis","forcedColorAdjust","gap","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","hyphens","imageOrientation","imageRendering","imeMode","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","initialLetter","isolation","justifyContent","justifyItems","justifySelf","left","letterSpacing","lineBreak","lineClamp","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBottom","marginLeft","marginRight","marginTop","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","mask","maskBorder","maskBorderImage","maskBorderOutset","maskBorderRepeat","maskBorderSlice","maskBorderSource","maskBorderWidth","maskClip","maskComposite","maskImage","maskOrigin","maskPosition","maskRepeat","maskSize","maskType","maxBlockSize","maxHeight","maxInlineSize","maxWidth","minBlockSize","minHeight","minInlineSize","minWidth","mixBlendMode","objectFit","objectPosition","objectViewBox","offset","offsetDistance","offsetPath","offsetRotate","opacity","order","orientation","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflow","overflowAnchor","overflowClip","overflowScrolling","overflowWrap","overflowX","overflowY","overscrollBehavior","overscrollBehaviorX","overscrollBehaviorY","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","pageBreakAfter","pageBreakBefore","pageBreakInside","paintOrder","perspective","perspectiveOrigin","placeContent","placeItems","placeSelf","pointerEvents","position","resize","right","rotate","rowGap","scrollBehavior","scrollPadding","scrollSnapAlign","scrollSnapType","scrollbarColor","scrollbarGutter","scrollbarWidth","shapeImageThreshold","shapeMargin","shapeOutside","tabSize","tableLayout","textAlign","textAlignLast","textDecoration","textDecorationColor","textDecorationLine","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textIndent","textOverflow","textShadow","textTransform","textUnderlineOffset","top","touchAction","transform","transformOrigin","transformStyle","transition","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","translateX","translateY","translateZ","unicodeBidi","userSelect","verticalAlign","visibility","whiteSpace","widows","width","willChange","wordBreak","wordSpacing","wordWrap","writingMode","zIndex"]);V();function un(t,e,r){let n=t?.context?.analyze;if(!n||!n.emit||e==="warn"&&!n.shouldCapture("warnings")||e==="error"&&!n.shouldCapture("errors"))return;let s=r.map(o=>o?.message||(typeof o=="string"?o:null)).filter(Boolean).join(" ");n.emit({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,ts:Date.now(),type:e==="error"?"error":"warning",level:e,hook:e==="error"?"el.error":"el.warn",element:{key:t.key!=null?String(t.key):null,name:t.__name||null,tag:t.tag||null},message:s||null,args:r})}var Ys=new Set;function Da(t,e,r){let n=String(e);if(Ys.has(n))return;Ys.add(n);let s=t?.__ref?.path,o=Array.isArray(s)&&s.length?s.join("."):t?.key!=null?String(t.key):"(unknown element)",i=r!=null?`resolves to a non-function (${typeof r}) \u2014 it cannot be called`:"is not registered in context.methods, context.functions, or context.utils, and is not an element method",c=`[smbls] el.call('${n}') at <${o}>: "${n}" ${i}. Returning undefined (unchanged behavior) \u2014 check the name for typos or register the function on the project. Warned once per name; repeat misses are silent.`;un(t,"error",[c]),console.error(c)}function Ia(...t){return un(this,"warn",t),$o.apply(this,t)}function ja(...t){return un(this,"error",t),To.apply(this,t)}var Zs={update:on,remove:cn,getDB:Io,getQuery:jo,getRootData:Ao,getChildren:wo,getPath:ko,nextElement:Po,previousElement:Ro,verbose:Hr,warn:Ia,error:ja,variables:Do,spotByPath:So,set(t,e){let r=this.__ref;if(r){if(r.__setLocked){r.__setQueued={content:t,options:e};return}r.__setLocked=!0}try{if(this.removeContent(),t!=null){let n=this.context?.__create;n&&n(t,this,"content",e)}this.__ref&&(this.__ref.contentManaged=!0)}finally{if(r){r.__setLocked=!1;let n=r.__setQueued;n&&(r.__setQueued=null,this.set(n.content,n.options))}}},reset(t){let e=this.context?.__create;if(!e)return this;let r=this.parent,n=this.key,s=this.parse();return this.remove(),e(s,r,n,t)},lookup(t){let e=this.parent;for(;e;){if(typeof t=="function"){if(t(e))return e}else if(typeof t=="string"){if(e.key===t)return e;if(e[t]&&e[t].__ref)return e[t]}e=e.parent}return null},lookdown(t){let e=this.__ref;if(!e?.__children)return null;for(let r of e.__children){let n=this[r];if(!n)continue;if(typeof t=="function"){if(t(n))return n}else if(typeof t=="string"&&n.key===t)return n;let s=n.lookdown?.(t);if(s)return s}return null},lookdownAll(t,e=[]){let r=this.__ref;if(!r?.__children)return e;for(let n of r.__children){let s=this[n];s&&(typeof t=="function"?t(s)&&e.push(s):typeof t=="string"&&s.key===t&&e.push(s),s.lookdownAll?.(t,e))}return e},getRef(){return this.__ref},getRoot:vo,getRootState:Co,getRootContext:Eo,getContext:Oo,parse(t){let e={},r=t?new Set(t):null,n=this.__ref?.__exec;for(let s in this)if(!(s==="parent"||s==="node"||s==="__ref")&&!r?.has(s)){if(n&&n[s]!==void 0){e[s]=n[s];continue}typeof this[s]!="function"&&(e[s]=this[s])}return e},parseDeep(t){let e=this.parse(t),r=this.__ref;if(r?.__children)for(let n of r.__children)this[n]?.parseDeep&&(e[n]=this[n].parseDeep(t));return e},keys(){return Object.keys(this)},log(...t){if(t.length){let e={};for(let r of t)e[r]=this[r];console.log(e)}else console.log(this)},setProps(t,e){return this.update(t,e)},setNodeStyles(t){if(this.node?.style)for(let e in t){let r=t[e];if(r==null)continue;let n=e.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),s=String(r).replace(/\s*!important\s*$/,"");this.node.style.setProperty(n,s,"important")}},call(t,...e){let r=this.context,n=r?.methods?.[t]||r?.functions?.[t]||r?.utils?.[t]||this[t];if(typeof n=="function")return n.call(this,...e);At()&&Da(this,t,n)},removeContent(){let t=this.__ref;if(!t?.__children)return;let e=this.content;if(e?.remove){e.remove(),delete this.content;let r=t.__children.indexOf("content");r!==-1&&t.__children.splice(r,1)}e?.node?.parentNode&&e.node.parentNode.removeChild(e.node)}},ti=new WeakMap;function Ma(t){if(!t)return Zs;let e=ti.get(t);if(e)return e;e=Object.create(Zs);let r=t.methods;if(r)for(let n in r)e[n]=r[n];return ti.set(t,e),e}function dn(t){let e=Ma(t.context);Object.setPrototypeOf(t,e)}V();ze();var fr=(t,e,r)=>{Object.defineProperty(t,e,{value:r,enumerable:!1,configurable:!0,writable:!0})},xt=(t,e,r,{onlyIfAbsent:n}={})=>{fr(t,"$"+e,r),!(n&&Object.prototype.hasOwnProperty.call(t,e))&&fr(t,e,r)},pn=(t,e,...r)=>{if(!t)return;let n=t["$"+e];if(typeof n=="function")return n.apply(t,r);let s=t[e];if(typeof s=="function")return s.apply(t,r)},Lt=(t,e)=>{if(G(e)){let s=e.__raw||e;xt(s,"toggle",function(o,i={}){e[o]=!e[o]},{onlyIfAbsent:!0}),xt(s,"set",function(o,i={}){return e.$clean({preventStateUpdate:!0}),typeof o=="object"&&o!==null&&e.$update(o,i),e},{onlyIfAbsent:!0}),xt(s,"setByPath",function(o,i,c={}){let a=o.split("."),l=e;for(let f=0;f<a.length-1;f++)l[a[f]]===void 0&&(l[a[f]]={}),l=l[a[f]];return l[a[a.length-1]]=i,e}),xt(s,"getByPath",function(o){let i=o.split("."),c=e;for(let a=0;a<i.length;a++){if(c==null)return;c=c[i[a]]}return c}),xt(s,"removeByPath",function(o,i={}){let c=o.split("."),a=e;for(let l=0;l<c.length-1;l++){if(a==null)return e;a=a[c[l]]}return a&&delete a[c[c.length-1]],e}),xt(s,"reset",function(o={}){let i=e.$parse();return e.$set(i,o)}),xt(s,"apply",function(o,i={}){if(typeof o=="function"){let c=o(e);return e.$update(c,i)}}),xt(s,"applyFunction",function(o,i={}){if(typeof o=="function")return o(e),e.$update(e.$parse(),i)}),xt(s,"rootUpdate",function(o,i={}){let c=e;for(;c?.parent&&G(c.parent);)c=c.parent;return pn(c,"update",o,i)}),xt(s,"parentUpdate",function(o,i={}){if(e.parent)return pn(e.parent,"update",o,i)}),xt(s,"quietReplace",function(o,i={}){return e.$replace(o,{quiet:!0,...i})}),Object.getOwnPropertyDescriptor(s,"root")||Object.defineProperty(s,"root",{get:function(){let o=e,i=G(o)?o:null;for(let c=0;c<64&&o?.parent&&o.parent!==o;c++)o=o.parent,G(o)&&(i=o);return i||o},enumerable:!1,configurable:!0});return}if(!e||typeof e!="object")return;let r=()=>{for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&delete e[s]},n={update(s){if(!s||typeof s!="object")return e;for(let o in s)e[o]=s[o];return e},apply(s){if(typeof s!="function")return e;let o=s(e);return o?e.$update(o):e},parse(){return{...e}},toggle(s){return e[s]=!e[s],e},set(s){if(!s||typeof s!="object")return e;r();for(let o in s)e[o]=s[o];return e},replace(s){return e.$set(s)},clean(){return r(),e}};for(let s in n)if(fr(e,"$"+s,n[s]),typeof e[s]!="function"){if(Object.prototype.hasOwnProperty.call(e,s)){ae(s,"");continue}fr(e,s,n[s])}};var Ug=new Proxy(Object.create(null),{get(){},has(){return!1}});var La=1,lr=[],mn=!1;function Fa(){mn||(mn=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(bn):setTimeout(bn,0))}function bn(){if(mn=!1,!lr.length)return;let t=lr.splice(0,lr.length);for(let e=0;e<t.length;e++){let r=t[e];!r.node||!r.node.isConnected||$t("Mounted",r,r.__ref?.__mountOptions||{})}}function si(t,e){typeof t.onMounted=="function"&&(t.__ref.__mountOptions=e,lr.push(t),Fa())}function ei(t,e){if(typeof t.onContentUpdate!="function")return;t.context?.plugins?.length&&wt("contentUpdate",t,e);let r=t.context?.designSystem;r&&z(r);try{t.onContentUpdate(t,t.state,t.context,e)}catch(n){if(t.context?.plugins?.length&&wt("error",t,{hook:"onContentUpdate",error:n})||console.error('[DOMQL] Lifecycle "onContentUpdate" error:',n),t.context?.strictMode)throw n}finally{r&&U()}}function re(t){return t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90}function Na(t){return t.charAt(2).toLowerCase()+t.slice(3)}function Va(t){return t.toLowerCase()}function xn(t){let e=t.charCodeAt(0);return e===58||e===64||e===38}function je(t,e){let r={...t};for(let n in e){let s=r[n],o=e[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)&&typeof s!="function"&&typeof o!="function"?r[n]=je(s,o):r[n]=o}return r}function ht(t,e,r,n={},s){if(t==null||t===!1)return null;(typeof t=="string"||typeof t=="number")&&(t={text:t});let o=Object.create(null);o.key=r||t.key||`_${La++}`,o.parent=e||null,o.context=t.context||e?.context||n.context||{},o.context.__create||(o.context.__create=ht);let i=o.__ref={__if:!0,__children:[],__exec:{},__effects:[],__eventCleanup:[],root:e?.__ref?.root||o,path:e?.__ref?.path?[...e.__ref.path,o.key]:[o.key]};if(r&&!t.extends&&!t.extend){let d=r.indexOf("_");if(d>0){let m=r.substring(0,d),x=o.context?.components;x&&(x[m]||x["smbls."+m])?t={...t,extends:m}:x&&At()&&/^[A-Z]\w*_\d+$/.test(r)&&console.warn(`[smbls] auto-extend: key "${r}" looks like a multi-instance (${m}_N) but neither "${m}" nor "smbls.${m}" is registered in context.components \u2014 element will render as a plain <div>. Register the base component or rename the key.`)}}Te(o,t,n);let c=new Set(["childProps","attr","style","scope","data"]),a=o.props&&typeof o.props=="object"?o.props:null;for(let d in t){if(d==="parent"||d==="node"||d==="__ref"||d==="extends"||d==="context"||d==="props")continue;let m=t[d],x=o[d],b=x&&m&&typeof x=="object"&&typeof m=="object"&&!Array.isArray(x)&&!Array.isArray(m)&&typeof x!="function"&&typeof m!="function";b&&d.charCodeAt(0)>=65&&d.charCodeAt(0)<=90?o[d]=je(x,m):b&&c.has(d)?o[d]={...x,...m}:b&&xn(d)?o[d]=je(x,m):o[d]=m}function l(d){for(let m in d){let x=d[m],b=o[m],g=b&&x&&typeof b=="object"&&typeof x=="object"&&!Array.isArray(b)&&!Array.isArray(x)&&typeof b!="function"&&typeof x!="function";g&&m.charCodeAt(0)>=65&&m.charCodeAt(0)<=90?o[m]=je(b,x):g&&c.has(m)?o[m]={...b,...x}:g&&xn(m)?o[m]=je(b,x):o[m]=x}}a&&l(a),t.props&&typeof t.props=="object"&&l(t.props),t.data!==void 0&&(o.data=t.data),t.classlist!==void 0&&(o.classlist=t.classlist),t.text!==void 0&&(o.text=t.text),t.html!==void 0&&(o.html=t.html);let f=o.scope&&typeof o.scope=="object"?o.scope:null,u=e?.scope,h=o.context&&typeof o.context.globalScope=="object"&&o.context.globalScope||null,p=u||h||null;if(t.scope!==void 0||f){let d={};f&&Object.assign(d,f),t.scope!==void 0&&Object.assign(d,t.scope),o.scope=kr(d,p)}else p&&(o.scope=p);if(t.if!==void 0&&(o.if=t.if),dn(o),Ba(o,e,t),o.if!=null){let d;if(typeof o.if=="function")try{d=o.if(o,o.state,o.context)}catch(m){if(d=!1,i.__ifError=m,typeof console<"u"&&console.warn){let x=o.key||o.tag||"?";console.warn(`[smbls] \`if:\` evaluator threw on ${x} \u2014 treating as false:`,m?.message||m)}}else d=o.if;i.__if=!!d}if(i.__if)typeof o.if=="function"&&(i.__ifInitialized=!0);else return e&&(e[o.key]=o),typeof o.if=="function"&&ai(o,i,o.if),o;o.tag||(o.tag=fe(o)),$t("Init",o,n);let y=o.node=le(o);if(!y)return o;if(o.tag==="fragment"){let m=(o.context?.document||globalThis.document).createComment("");y.appendChild(m),i.__fragmentAnchor=m}$t("AttachNode",o,n),y.setAttribute&&o.key&&y.setAttribute("data-key",o.key),e&&(e[o.key]=o,e.__ref?.__children&&(e.__ref.__children.includes(o.key)||e.__ref.__children.push(o.key))),y.setAttribute&&o.context?.scopeSelector&&o.context.scopeSelector!==":root"&&o.context.key&&o.key===o.context.key&&y.setAttribute("data-smbls-app",o.context.key),o.id&&y.setAttribute&&(y.id=o.id),di(o,n),ci(o),_n(o),li(o),ef(o);try{pi(o,n)}catch(d){if(typeof console<"u"&&console.error){let m=o.__ref?.path?.join(".")||o.key||"<root>";console.error(`[smbls] createChildren failed at ${m}:`,d?.message||d,d?.stack?`
|
|
12
12
|
`+d.stack.split(`
|
|
13
13
|
`).slice(0,6).join(`
|
|
14
|
-
`):"")}}if(wn(o,!0),hi(o,e,s),typeof o.html=="function"&&o.node&&!o.node.innerHTML){let d=o.context?.designSystem;d&&z(d);try{let m=o.html(o,o.state,o.context);m!=null&&typeof m!="function"&&(o.node.innerHTML=m)}catch{}finally{d&&U()}}if($t("Create",o,n),$t("Complete",o,n),$t("Render",o,n),$t("RenderRouter",o,n),si(o,n),typeof o.onFrame=="function"){let d=o.onFrame,m=o.context?.designSystem,x=()=>{if(o.node){if(o.node.isConnected){m&&z(m);try{d(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{m&&U()}}requestAnimationFrame(x)}};requestAnimationFrame(x)}return o}function Va(t,e,r){let n=!e,s=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)&&Object.keys(r.state).length===0,o=n&&s&&t.context?.state,i=r.state!==void 0&&!o?r.state:t.state&&!G(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Lt(t,t.state);else if(t.context?.state){let c=t.context.state,a={...c},l=t.context?.polyglot;if(l?.translations){let f=c.lang||l.defaultLang||"en",u=l.translations[f];if(u&&typeof u=="object")for(let p in u)a[p]===void 0&&(a[p]=u[p]);let h=new Set(l.languages||[]);for(let p in l.translations)!h.has(p)&&a[p]===void 0&&(a[p]=l.translations[p])}t.state=G(a)?a:lt(a),t.state.__element=t,t.state.root=t.state,Lt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Lt(t,t.state);return}if(typeof i=="string"){if(t.state=ii(i,e),t.state&&typeof t.state=="object"&&!G(t.state)){let c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}Lt(t,t.state);return}if(typeof i=="function"){let c=i(t,e?.state);t.state=G(c)?c:lt(c||{})}else G(i)?t.state=i:t.state=lt({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,Lt(t,t.state)}function pn(t,e){if(!e)return t;let r=e.split("/"),n=t;for(let s of r){if(n==null)return{};n=n[s]}return n??{}}function ii(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let s=t.slice(3);return s?pn(e.state,s):e.state??{}}if(t.startsWith("~/")){let s=e.state?.root||e.state,o=t.slice(2);return o?pn(s,o):s??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=pn(e.state,t);if(r!=null&&Object.keys(r).length>0)return r;let n=e.context?.polyglot;if(n?.translations){let s=e.state?.root?.lang||n.defaultLang||"en",o=n.translations[s];if(o?.[t]!==void 0)return o[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}var Ba=new Set(["s","state","ctx","context"]);function Ua(t){try{let r=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return r?r[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function Wa(t){if(typeof t!="function"||t.length!==2)return!1;let e=Ua(t);if(e.length<2)return!1;let r=e[1].replace(/[{}[\]]/g,"").trim();return r.length>0&&!Ba.has(r)}function za(t){let e=t.__ref,r=t.tag||"div",n=t.context?.designSystem,s=[],o=Object.keys(t);for(let i=0;i<o.length;i++){let c=o[i];if(typeof t[c]!="function"||et.has(c))continue;let a=c.charCodeAt(0);a>=65&&a<=90||ee(c)||X[c]||H&&H.has(c)||Pe(r,c)||(At()&&Wa(t[c])&&console.warn(`[smbls] custom prop "${c}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${c}', \u2026) instead of reading el.${c}(\u2026) directly (see RULES.md Rule 8).`),s.push({prop:c,fn:t[c]}))}for(let i=0;i<s.length;i++){let{prop:c,fn:a}=s[i];e.__exec[c]=a,Object.defineProperty(t,c,{get(){n&&z(n);try{return a(t,t.state,t.context)}catch{return}finally{n&&U()}},set(l){delete e.__exec[c],Object.defineProperty(t,c,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Ga(t,e){if(!(!Array.isArray(e)||e.length===0))for(let r=0;r<e.length;r++){let n=e[r];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function rt(t,e,r){return!Array.isArray(e)||e.length===0?r:function(...n){return Ga(t,e),r.apply(this,n)}}function De(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function ci(t,e){let r=t.__ref,n=!!(e&&e.skipIfEffect);if(za(t),typeof t.text=="function"){let o=t.text,i=rt(t,t.textDeps,o),c=N(()=>{if(!r.contentManaged)try{let a=i(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=Ue.call(t,a,t.state)),t.tag==="string"?t.node.nodeValue=a:t.node.textContent=a)}catch{}},{depth:r.path.length});r.__effects.push(c),r.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){let o=t.text,i=N(()=>{if(r.contentManaged)return;let c=Ue.call(t,o,t.state);c!=null&&(t.text=c),t.node&&(t.tag==="string"?t.node.nodeValue=c??"":t.node.textContent=c??"")},{depth:r.path.length});r.__effects.push(i),r.__exec.text=o}for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!et.has(o)&&!ee(o)&&!r.__exec[o]){if(X[o]){let i=t[o],c=rt(t,t[o+"Deps"],i),a=o,l,f=N(()=>{let u=t.context?.designSystem;u&&z(u);try{let h=c(t,t.state,t.context),p=X[a](h,t,t.state,t.context);if(p&&t.node){let y=_n(p);(y===null||y!==l)&&(l=y,te(t.node,p))}else t.node&&(a==="show"||a==="hide")&&(l=void 0,t.node.style.display="")}finally{u&&U()}},{depth:r.path.length});r.__effects.push(f),r.__exec[o]=i}else if(H&&H.has(o)){let i=t[o],c=rt(t,t[o+"Deps"],i),a=o,l,f=N(()=>{let u=t.context?.designSystem;u&&z(u);try{let h=c(t,t.state,t.context);if(t.node)if(h!=null){let p=a+":"+String(h);p!==l&&(l=p,te(t.node,{[a]:h}))}else l=void 0,t.node.style[a]=""}finally{u&&U()}},{depth:r.path.length});r.__effects.push(f),r.__exec[o]=i}}if(typeof t.html=="function"){let o=t.html,i=rt(t,t.htmlDeps,o),c=N(()=>{let a=t.context?.designSystem;a&&z(a);try{let l=i(t,t.state,t.context);t.node&&l!=null&&typeof l!="function"&&(t.node.innerHTML=l)}finally{a&&U()}},{depth:r.path.length});r.__effects.push(c),r.__exec.html=o}if(typeof t.value=="function"){let o=t.value,i=rt(t,t.valueDeps,o),c=N(()=>{try{let a=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let l=a==null?"":String(a);if(t.node.value===l)return;let f=typeof document<"u"&&document.activeElement===t.node,u=f&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,h=f&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=l,f&&u!=null&&h!=null)try{t.node.setSelectionRange(u,h)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(c),r.__exec.value=o}if(typeof t.style=="function"){let o=t.style,i=rt(t,t.styleDeps,o),c,a=N(()=>{let l=i(t,t.state,t.context),f=_n(l);(f===null||f!==c)&&(c=f,te(t.node,l))},{depth:r.path.length});r.__effects.push(a),r.__exec.style=o}else if(t.style&&typeof t.style=="object")for(let o in t.style){let i=t.style[o];if(typeof i!="function")continue;let c=rt(t,De(t.styleDeps,o),i),a,l=N(()=>{try{let f=c(t,t.state,t.context);if(t.node){let u=o+":"+String(f);u!==a&&(a=u,te(t.node,{[o]:f}))}}catch{}},{depth:r.path.length});r.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(let o in t.attr)if(typeof t.attr[o]=="function"){let i=rt(t,De(t.attrDeps,o),t.attr[o]),c=o,a=N(()=>{try{let l=i(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,l===!0?"":l))}catch{}},{depth:r.path.length});r.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(let o in t.aria){if(typeof t.aria[o]!="function")continue;let i=rt(t,De(t.ariaDeps,o),t.aria[o]),c="aria-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=N(()=>{try{let l=i(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,l===!0?"":l)}catch{}},{depth:r.path.length});r.__effects.push(a)}if(t.data&&typeof t.data=="object")for(let o in t.data){if(typeof t.data[o]!="function")continue;let i=rt(t,De(t.dataDeps,o),t.data[o]),a="data-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),l=N(()=>{try{let f=i(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(a):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(a,f===!0?"":f)}catch{}},{depth:r.path.length});r.__effects.push(l)}let s=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(s)for(let o in s){if(typeof s[o]!="function")continue;let i=rt(t,De(t.classDeps,o),s[o]),c=N(()=>{try{let a=i(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:r.path.length});r.__effects.push(c)}!n&&typeof t.if=="function"&&ai(t,r,t.if);for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||et.has(o)||typeof t[o]!="function")continue;let i=o.charCodeAt(0);if(i>=65&&i<=90||ee(o))continue;let c=t[o];r.__exec[o]=c;let a=t.tag||"div";if(Pe(a,o)&&!X[o]&&!(H&&H.has(o))){let l=Te(o)||o,f=rt(t,t[o+"Deps"],c),u=N(()=>{try{let h=f(t,t.state,t.context);t.node?.setAttribute&&(h==null||h===!1?t.node.removeAttribute(l):typeof h!="function"&&typeof h!="object"&&(l==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(l,h===!0?"":h)))}catch{}},{depth:r.path.length});r.__effects.push(u)}}if(Ka(t),Xa(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){let o=t.onStateUpdate,i=t.stateDeps,c=!1,a=[],l=N(()=>{let f=[];for(let y=0;y<i.length;y++){let d=i[y];try{f[y]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{f[y]=void 0}}if(!c){c=!0,a=f;return}let u=f.length!==a.length;for(let y=0;!u&&y<f.length;y++)f[y]!==a[y]&&(u=!0);let h=a;if(a=f,!u)return;let p=t.context?.designSystem;p&&z(p);try{o(t,t.state,t.context,{prev:h,next:f})}catch(y){if(t.context?.plugins?.length&&wt("error",t,{hook:"onStateUpdate",error:y})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',y),t.context?.strictMode)throw y}finally{p&&U()}},{depth:r.path.length});r.__effects.push(l)}Ja(t)}function ri(t){let e=t.parent,r=e?.node;if(!r||!t.node){hi(t,t.parent);return}let n=null,s=Object.keys(e),o=s.indexOf(t.key);for(let i=o+1;i<s.length;i++){let c=e[s[i]];if(c?.node?.parentNode===r){n=c.node;break}}n?r.insertBefore(t.node,n):r.appendChild(t.node)}function ai(t,e,r){let n=rt(t,t.ifDeps,r),s=N(()=>{let o;try{o=n(t,t.state,t.context)}catch(c){if(o=!1,e.__ifError=c,typeof console<"u"&&console.warn){let a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,c?.message||c)}return}let i=e.__if;if(e.__if=!!o,i&&!e.__if&&t.node)t.node.remove();else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=fe(t)),t.node&&(t.node.ref=t),ri(t),xn(t);else{if(e.__ifInitialized=!0,t.tag||(t.tag=ae(t)),$t("Init",t,{}),t.node||(t.node=fe(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!e.__fragmentAnchor){let a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),e.__fragmentAnchor=a}$t("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),di(t,{}),ci(t,{skipIfEffect:!0}),xn(t),li(t),pi(t,{}),ri(t),si(t,{})}},{depth:e.path.length});e.__effects.push(s)}function xn(t){let{node:e}=t;if(e){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?e.nodeValue=t.text:e.textContent=t.text:typeof t.text=="number"&&(e.textContent=t.text),Za(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){let r=String(t.value);e.value!==r&&(e.value=r)}if(t.style&&typeof t.style=="object"&&te(e,t.style),t.attr&&typeof t.attr=="object")for(let r in t.attr){let n=t.attr[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.setAttribute&&e.setAttribute(r,n===!0?"":n)}if(t.data&&typeof t.data=="object")for(let r in t.data){let n=t.data[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.dataset&&(e.dataset[r]=n===!0?"":n)}if(t.classlist||t.class){let r=t.classlist||t.class;if(typeof r=="string")r.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof r=="object")for(let n in r){let s=typeof r[n]=="function"?r[n](t,t.state,t.context):r[n];s&&e.classList.add(typeof s=="string"?s:n)}}}}function _n(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function te(t,e){if(!t||!e||!t.style)return;let r=null;for(let n in e){let s=e[n];if(s!=null){if(n.charAt(0)==="&"&&typeof s=="object"){r||(r={}),r[n]=s;continue}try{let o=String(s),i=n.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),c=o.trim(),a=/\s*!important\s*$/.test(c),l=c.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,a?"important":"")}catch{}}}r&&qa(t,r)}var Ha=0;function qa(t,e){let r=`_ds${Ha++}`;t.classList.add(r);let n=t.ownerDocument,s=n.querySelector("style[data-smbls-scoped]");s||(s=n.createElement("style"),s.setAttribute("data-smbls-scoped",""),n.head.appendChild(s));let o="";for(let i in e){let c="."+r,a=i.replace(/&/g,c).split(",").map(f=>{let u=f.trim();return u.includes(c)?u:c+u}).join(", "),l=e[i];if(typeof l=="object"){let f="",u="";for(let h in l){let p=l[h];if(typeof p=="object"){let y=h.includes("&")?a.split(", ").map(m=>h.replace(/&/g,m)).join(", "):a.split(", ").map(m=>`${m} ${h}`).join(", "),d="";for(let m in p)d+=`${m.replace(/[A-Z]/g,x=>"-"+x.toLowerCase())}: ${p[m]};`;u+=zt(`${y} { ${d} }`,y)+`
|
|
14
|
+
`):"")}}if(kn(o,!0),hi(o,e,s),typeof o.html=="function"&&o.node&&!o.node.innerHTML){let d=o.context?.designSystem;d&&z(d);try{let m=o.html(o,o.state,o.context);m!=null&&typeof m!="function"&&(o.node.innerHTML=m)}catch{}finally{d&&U()}}if($t("Create",o,n),$t("Complete",o,n),$t("Render",o,n),$t("RenderRouter",o,n),si(o,n),typeof o.onFrame=="function"){let d=o.onFrame,m=o.context?.designSystem,x=()=>{if(o.node){if(o.node.isConnected){m&&z(m);try{d(o,o.state,o.context)}catch(b){console.error("[DOMQL] onFrame error:",b)}finally{m&&U()}}requestAnimationFrame(x)}};requestAnimationFrame(x)}return o}function Ba(t,e,r){let n=!e,s=r.state&&typeof r.state=="object"&&!Array.isArray(r.state)&&Object.keys(r.state).length===0,o=n&&s&&t.context?.state,i=r.state!==void 0&&!o?r.state:t.state&&!G(t.state)?t.state:void 0;if(i==null){if(e?.state)t.state=e.state,Lt(t,t.state);else if(t.context?.state){let c=t.context.state,a={...c},l=t.context?.polyglot;if(l?.translations){let f=c.lang||l.defaultLang||"en",u=l.translations[f];if(u&&typeof u=="object")for(let p in u)a[p]===void 0&&(a[p]=u[p]);let h=new Set(l.languages||[]);for(let p in l.translations)!h.has(p)&&a[p]===void 0&&(a[p]=l.translations[p])}t.state=G(a)?a:lt(a),t.state.__element=t,t.state.root=t.state,Lt(t,t.state)}else t.state={},Object.defineProperty(t.state,"root",{value:t.state,enumerable:!1,configurable:!0,writable:!0}),Lt(t,t.state);return}if(typeof i=="string"){if(t.state=ii(i,e),t.state&&typeof t.state=="object"&&!G(t.state)){let c=e?.state?.root||e?.state||t.state;Object.defineProperty(t.state,"root",{value:c,enumerable:!1,configurable:!0,writable:!0})}Lt(t,t.state);return}if(typeof i=="function"){let c=i(t,e?.state);t.state=G(c)?c:lt(c||{})}else G(i)?t.state=i:t.state=lt({...i});t.state.__element=t,e?.state?(t.state.parent=e.state,t.state.root=e.state.root||e.state):t.state.root=t.state,Lt(t,t.state)}function hn(t,e){if(!e)return t;let r=e.split("/"),n=t;for(let s of r){if(n==null)return{};n=n[s]}return n??{}}function ii(t,e){if(!e)return{};if(t===".")return e.state||{};if(t.startsWith("../")){let s=t.slice(3);return s?hn(e.state,s):e.state??{}}if(t.startsWith("~/")){let s=e.state?.root||e.state,o=t.slice(2);return o?hn(s,o):s??{}}if(e.state?.[t]!==void 0)return e.state[t];let r=hn(e.state,t);if(r!=null&&Object.keys(r).length>0)return r;let n=e.context?.polyglot;if(n?.translations){let s=e.state?.root?.lang||n.defaultLang||"en",o=n.translations[s];if(o?.[t]!==void 0)return o[t];if(n.translations[t]!==void 0)return n.translations[t]}return{}}var Ua=new Set(["s","state","ctx","context"]);function Wa(t){try{let r=Function.prototype.toString.call(t).match(/^[^(]*\(([^)]*)\)/);return r?r[1].split(",").map(n=>n.trim().split("=")[0].trim()).filter(Boolean):[]}catch{return[]}}function za(t){if(typeof t!="function"||t.length!==2)return!1;let e=Wa(t);if(e.length<2)return!1;let r=e[1].replace(/[{}[\]]/g,"").trim();return r.length>0&&!Ua.has(r)}function Ga(t){let e=t.__ref,r=t.tag||"div",n=t.context?.designSystem,s=[],o=Object.keys(t);for(let i=0;i<o.length;i++){let c=o[i];if(typeof t[c]!="function"||rt.has(c))continue;let a=c.charCodeAt(0);a>=65&&a<=90||re(c)||X[c]||H&&H.has(c)||Re(r,c)||(At()&&za(t[c])&&console.warn(`[smbls] custom prop "${c}"${t.key?` on key "${t.key}"`:""} is a function \u2014 it will be auto-invoked on read and its RETURN VALUE stored, not preserved as a callable reference. If you meant to stash a callback, use el.call('${c}', \u2026) instead of reading el.${c}(\u2026) directly (see RULES.md Rule 8).`),s.push({prop:c,fn:t[c]}))}for(let i=0;i<s.length;i++){let{prop:c,fn:a}=s[i];e.__exec[c]=a,Object.defineProperty(t,c,{get(){n&&z(n);try{return a(t,t.state,t.context)}catch{return}finally{n&&U()}},set(l){delete e.__exec[c],Object.defineProperty(t,c,{value:l,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}}function Ha(t,e){if(!(!Array.isArray(e)||e.length===0))for(let r=0;r<e.length;r++){let n=e[r];try{typeof n=="function"?n(t,t.state,t.context):typeof n=="string"&&t.state?.[n]}catch{}}}function nt(t,e,r){return!Array.isArray(e)||e.length===0?r:function(...n){return Ha(t,e),r.apply(this,n)}}function Ie(t,e){if(!(!t||Array.isArray(t)||typeof t!="object"))return t[e]}function ci(t,e){let r=t.__ref,n=!!(e&&e.skipIfEffect);if(Ga(t),typeof t.text=="function"){let o=t.text,i=nt(t,t.textDeps,o),c=N(()=>{if(!r.contentManaged)try{let a=i(t,t.state,t.context);t.node&&a!=null&&typeof a!="function"&&typeof a!="object"&&(typeof a=="string"&&a.includes("{{")&&(a=We.call(t,a,t.state)),t.tag==="string"?t.node.nodeValue=a:t.node.textContent=a)}catch{}},{depth:r.path.length});r.__effects.push(c),r.__exec.text=o}else if(typeof t.text=="string"&&t.text.includes("{{")){let o=t.text,i=N(()=>{if(r.contentManaged)return;let c=We.call(t,o,t.state);c!=null&&(t.text=c),t.node&&(t.tag==="string"?t.node.nodeValue=c??"":t.node.textContent=c??"")},{depth:r.path.length});r.__effects.push(i),r.__exec.text=o}for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof t[o]=="function"&&!rt.has(o)&&!re(o)&&!r.__exec[o]){if(X[o]){let i=t[o],c=nt(t,t[o+"Deps"],i),a=o,l,f=N(()=>{let u=t.context?.designSystem;u&&z(u);try{let h=c(t,t.state,t.context),p=X[a](h,t,t.state,t.context);if(p&&t.node){let y=Sn(p);(y===null||y!==l)&&(l=y,ee(t.node,p))}else t.node&&(a==="show"||a==="hide")&&(l=void 0,t.node.style.display="")}finally{u&&U()}},{depth:r.path.length});r.__effects.push(f),r.__exec[o]=i}else if(H&&H.has(o)){let i=t[o],c=nt(t,t[o+"Deps"],i),a=o,l,f=N(()=>{let u=t.context?.designSystem;u&&z(u);try{let h=c(t,t.state,t.context);if(t.node)if(h!=null){let p=a+":"+String(h);p!==l&&(l=p,ee(t.node,{[a]:h}))}else l=void 0,t.node.style[a]=""}finally{u&&U()}},{depth:r.path.length});r.__effects.push(f),r.__exec[o]=i}}if(typeof t.html=="function"){let o=t.html,i=nt(t,t.htmlDeps,o),c=N(()=>{let a=t.context?.designSystem;a&&z(a);try{let l=i(t,t.state,t.context);t.node&&l!=null&&typeof l!="function"&&(t.node.innerHTML=l)}finally{a&&U()}},{depth:r.path.length});r.__effects.push(c),r.__exec.html=o}if(typeof t.value=="function"){let o=t.value,i=nt(t,t.valueDeps,o),c=N(()=>{try{let a=i(t,t.state,t.context);if(!t.node||!("value"in t.node))return;let l=a==null?"":String(a);if(t.node.value===l)return;let f=typeof document<"u"&&document.activeElement===t.node,u=f&&typeof t.node.selectionStart=="number"?t.node.selectionStart:null,h=f&&typeof t.node.selectionEnd=="number"?t.node.selectionEnd:null;if(t.node.value=l,f&&u!=null&&h!=null)try{t.node.setSelectionRange(u,h)}catch{}}catch{}},{depth:r.path.length});r.__effects.push(c),r.__exec.value=o}if(typeof t.style=="function"){let o=t.style,i=nt(t,t.styleDeps,o),c,a=N(()=>{let l=i(t,t.state,t.context),f=Sn(l);(f===null||f!==c)&&(c=f,ee(t.node,l))},{depth:r.path.length});r.__effects.push(a),r.__exec.style=o}else if(t.style&&typeof t.style=="object")for(let o in t.style){let i=t.style[o];if(typeof i!="function")continue;let c=nt(t,Ie(t.styleDeps,o),i),a,l=N(()=>{try{let f=c(t,t.state,t.context);if(t.node){let u=o+":"+String(f);u!==a&&(a=u,ee(t.node,{[o]:f}))}}catch{}},{depth:r.path.length});r.__effects.push(l)}if(t.attr&&typeof t.attr=="object"){for(let o in t.attr)if(typeof t.attr[o]=="function"){let i=nt(t,Ie(t.attrDeps,o),t.attr[o]),c=o,a=N(()=>{try{let l=i(t,t.state,t.context);t.node?.setAttribute&&(l==null||l===!1?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,l===!0?"":l))}catch{}},{depth:r.path.length});r.__effects.push(a)}}if(t.aria&&typeof t.aria=="object")for(let o in t.aria){if(typeof t.aria[o]!="function")continue;let i=nt(t,Ie(t.ariaDeps,o),t.aria[o]),c="aria-"+o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase()),a=N(()=>{try{let l=i(t,t.state,t.context);if(!t.node?.setAttribute)return;l==null||l===!1?t.node.removeAttribute(c):typeof l!="function"&&typeof l!="object"&&t.node.setAttribute(c,l===!0?"":l)}catch{}},{depth:r.path.length});r.__effects.push(a)}if(t.data&&typeof t.data=="object")for(let o in t.data){if(typeof t.data[o]!="function")continue;let i=nt(t,Ie(t.dataDeps,o),t.data[o]),a="data-"+o.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),l=N(()=>{try{let f=i(t,t.state,t.context);if(!t.node?.setAttribute)return;f==null||f===!1?t.node.removeAttribute(a):typeof f!="function"&&typeof f!="object"&&t.node.setAttribute(a,f===!0?"":f)}catch{}},{depth:r.path.length});r.__effects.push(l)}let s=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(s)for(let o in s){if(typeof s[o]!="function")continue;let i=nt(t,Ie(t.classDeps,o),s[o]),c=N(()=>{try{let a=i(t,t.state,t.context);if(!t.node?.classList)return;typeof a=="string"?t.node.classList.add(a):a?t.node.classList.add(o):t.node.classList.remove(o)}catch{}},{depth:r.path.length});r.__effects.push(c)}!n&&typeof t.if=="function"&&ai(t,r,t.if);for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||rt.has(o)||typeof t[o]!="function")continue;let i=o.charCodeAt(0);if(i>=65&&i<=90||re(o))continue;let c=t[o];r.__exec[o]=c;let a=t.tag||"div";if(Re(a,o)&&!X[o]&&!(H&&H.has(o))){let l=Pe(o)||o,f=nt(t,t[o+"Deps"],c),u=N(()=>{try{let h=f(t,t.state,t.context);t.node?.setAttribute&&(h==null||h===!1?t.node.removeAttribute(l):typeof h!="function"&&typeof h!="object"&&(l==="src"&&"src"in t.node?t.node.src=h:t.node.setAttribute(l,h===!0?"":h)))}catch{}},{depth:r.path.length});r.__effects.push(u)}}if(Qa(t),Ya(t),typeof t.onStateUpdate=="function"&&Array.isArray(t.stateDeps)){let o=t.onStateUpdate,i=t.stateDeps,c=!1,a=[],l=N(()=>{let f=[];for(let y=0;y<i.length;y++){let d=i[y];try{f[y]=typeof d=="function"?d(t,t.state,t.context):t.state?.[d]}catch{f[y]=void 0}}if(!c){c=!0,a=f;return}let u=f.length!==a.length;for(let y=0;!u&&y<f.length;y++)f[y]!==a[y]&&(u=!0);let h=a;if(a=f,!u)return;let p=t.context?.designSystem;p&&z(p);try{o(t,t.state,t.context,{prev:h,next:f})}catch(y){if(t.context?.plugins?.length&&wt("error",t,{hook:"onStateUpdate",error:y})||console.error('[DOMQL] Lifecycle "onStateUpdate" error:',y),t.context?.strictMode)throw y}finally{p&&U()}},{depth:r.path.length});r.__effects.push(l)}Xa(t)}function ri(t){let e=t.parent,r=e?.node;if(!r||!t.node){hi(t,t.parent);return}let n=null,s=Object.keys(e),o=s.indexOf(t.key);for(let i=o+1;i<s.length;i++){let c=e[s[i]];if(c?.node?.parentNode===r){n=c.node;break}}n?r.insertBefore(t.node,n):r.appendChild(t.node)}function ai(t,e,r){let n=nt(t,t.ifDeps,r),s=N(()=>{let o;try{o=n(t,t.state,t.context)}catch(c){if(o=!1,e.__ifError=c,typeof console<"u"&&console.warn){let a=t.key||t.tag||"?";console.warn(`[smbls] \`if:\` reactive effect threw on ${a} \u2014 treating as false:`,c?.message||c)}return}let i=e.__if;if(e.__if=!!o,i&&!e.__if&&t.node)t.node.remove();else if(!i&&e.__if)if(e.__ifInitialized)t.node||(t.node=le(t)),t.node&&(t.node.ref=t),ri(t),_n(t);else{if(e.__ifInitialized=!0,t.tag||(t.tag=fe(t)),$t("Init",t,{}),t.node||(t.node=le(t)),!t.node)return;if(t.parent?.__ref?.__children&&!t.parent.__ref.__children.includes(t.key)&&t.parent.__ref.__children.push(t.key),t.tag==="fragment"&&!e.__fragmentAnchor){let a=(t.context?.document||globalThis.document).createComment("");t.node.appendChild(a),e.__fragmentAnchor=a}$t("AttachNode",t,{}),t.node.setAttribute&&t.key&&t.node.setAttribute("data-key",t.key),t.id&&t.node.setAttribute&&(t.node.id=t.id),di(t,{}),ci(t,{skipIfEffect:!0}),_n(t),li(t),pi(t,{}),ri(t),si(t,{})}},{depth:e.path.length});e.__effects.push(s)}function _n(t){let{node:e}=t;if(e){if(typeof t.text=="string"&&!t.text.includes("{{")?t.tag==="string"?e.nodeValue=t.text:e.textContent=t.text:typeof t.text=="number"&&(e.textContent=t.text),tf(t),typeof t.html=="string"&&(e.innerHTML=t.html),t.value!=null&&typeof t.value!="function"&&"value"in e){let r=String(t.value);e.value!==r&&(e.value=r)}if(t.style&&typeof t.style=="object"&&ee(e,t.style),t.attr&&typeof t.attr=="object")for(let r in t.attr){let n=t.attr[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.setAttribute&&e.setAttribute(r,n===!0?"":n)}if(t.data&&typeof t.data=="object")for(let r in t.data){let n=t.data[r];typeof n=="function"||typeof n=="object"||n==null||n===!1||e.dataset&&(e.dataset[r]=n===!0?"":n)}if(t.classlist||t.class){let r=t.classlist||t.class;if(typeof r=="string")r.split(" ").forEach(n=>n&&e.classList.add(n));else if(typeof r=="object")for(let n in r){let s=typeof r[n]=="function"?r[n](t,t.state,t.context):r[n];s&&e.classList.add(typeof s=="string"?s:n)}}}}function Sn(t){if(t==null||typeof t!="object")return"s:"+String(t);try{return"o:"+JSON.stringify(t)}catch{return null}}function ee(t,e){if(!t||!e||!t.style)return;let r=null;for(let n in e){let s=e[n];if(s!=null){if(n.charAt(0)==="&"&&typeof s=="object"){r||(r={}),r[n]=s;continue}try{let o=String(s),i=n.replace(/[A-Z]/g,f=>"-"+f.toLowerCase()),c=o.trim(),a=/\s*!important\s*$/.test(c),l=c.replace(/\s*!important\s*$/,"");t.style.setProperty(i,l,a?"important":"")}catch{}}}r&&Ka(t,r)}var qa=0;function Ka(t,e){let r=`_ds${qa++}`;t.classList.add(r);let n=t.ownerDocument,s=n.querySelector("style[data-smbls-scoped]");s||(s=n.createElement("style"),s.setAttribute("data-smbls-scoped",""),n.head.appendChild(s));let o="";for(let i in e){let c="."+r,a=i.replace(/&/g,c).split(",").map(f=>{let u=f.trim();return u.includes(c)?u:c+u}).join(", "),l=e[i];if(typeof l=="object"){let f="",u="";for(let h in l){let p=l[h];if(typeof p=="object"){let y=h.includes("&")?a.split(", ").map(m=>h.replace(/&/g,m)).join(", "):a.split(", ").map(m=>`${m} ${h}`).join(", "),d="";for(let m in p)d+=`${m.replace(/[A-Z]/g,x=>"-"+x.toLowerCase())}: ${p[m]};`;u+=zt(`${y} { ${d} }`,y)+`
|
|
15
15
|
`}else f+=`${h.replace(/[A-Z]/g,y=>"-"+y.toLowerCase())}: ${p};`}f&&(o+=zt(`${a} { ${f} }`,a)+`
|
|
16
|
-
`),u&&(o+=u)}}o&&(s.textContent+=o)}function Ka(t){let e=t.subscribeTo;if(typeof e=="function")try{e=e(t,t.state,t.context)}catch{e=null}if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let s=e[n];if(typeof s!="string"||s.length===0)continue;let o=s.split("."),i=o[0],c=o.slice(1),a={value:!1},l=N(()=>{let f=t.state&&(G(t.state)?t.state.root:null);if(!f||!G(f))return;let u=f;u=u[i];for(let p=0;p<c.length&&!(u==null||typeof u!="object");p++)if(G(u))u=u[c[p]];else break;if(!a.value)return;let h=!1;if(typeof t.onBeforeUpdate=="function"){let p=t.context?.designSystem;p&&z(p);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(h=!0)}catch(y){t.context?.plugins?.length&&wt("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}finally{p&&U()}}if(!h&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){let y=r.__effects[p];y&&y!==l&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}if(!h&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&z(p);try{t.onUpdate(t,t.state,t.context)}catch(y){t.context?.plugins?.length&&wt("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}finally{p&&U()}}},{depth:r.path.length});a.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function kn(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}var ni=new Set;function Qa(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;ni.has(n)||(ni.add(n),console.warn(`[smbls/css] "${t}" at ${r} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function re(t,e,r){let n={},s=new Set,o=(i,c,a)=>{let l=a?new Set(Object.keys(n)):null;if(X[i]){let f=X[i](c,e,e.state,e.context);if(f){let u=Array.isArray(f)?f:[f];for(let h of u)h&&Object.assign(n,h)}}else n[i]=c;if(a)for(let f in n)l.has(f)||s.add(f)};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let c=t[i];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(i==="style"){for(let u in c){let h=c[u];if(typeof h=="function"&&(h=h(e,e.state,e.context)),h==null||typeof h=="function")continue;let p=typeof e[u]=="function"&&(X[u]||H&&H.has(u));o(u,h,p)}continue}if(kn(i,e)){let u=re(c,e,!0);Object.keys(u).length&&(n[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){At()&&Qa(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){let u=e.context?.designSystem?.media?.[i.slice(1)];u&&(l=`@media ${u}`)}let f=re(c,e,!1);Object.keys(f).length&&(n[l]=f);continue}let a=typeof e[i]=="function"&&(X[i]||H&&H.has(i));o(i,c,a)}if(r)for(let i in n)s.add(i);for(let i of s){let c=n[i];typeof c=="string"&&!c.includes("!important")&&(n[i]=c+" !important")}return n}function Cn(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&Cn(t[r],e+1))return!0}return!1}function fi(t,e,r){if(!e||typeof e!="object"||Array.isArray(e))return null;if(kn(t,r)){let o=re(e,r,!0);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){let o=r.context?.designSystem?.media?.[t.slice(1)];o&&(n=`@media ${o}`)}let s=re(e,r,!1);return Object.keys(s).length?{cssProp:n,block:s}:null}function Ja(t){let e=t.__ref;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!bn(r))continue;let n=t[r];if(!n||typeof n!="object"||Array.isArray(n)||!Cn(n))continue;let s=null,o,i=N(()=>{if(!t.node)return;let c=t.context?.designSystem;c&&z(c);let a,l=!1;try{let f=fi(r,n,t),u=f?_n(f.block)+"::"+f.cssProp:null;if(u!==null&&u===o)l=!0;else if(o=u,f){let h=Zt({[f.cssProp]:f.block},null,t.context?.cssPrefix);a=h?h.split(" ").filter(Boolean):null}else a=null}finally{c&&U()}if(!(l||!t.node.classList)){if(s)for(let f of s)t.node.classList.remove(f);if(a&&a.length)for(let f of a)t.node.classList.add(f);s=a}},{depth:e.path.length});e.__effects.push(i)}}function Xa(t){let e=t.__ref;e.__conditionalRunners=[];let r=new Map;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=n.charAt(0);if(s!=="."&&s!=="!")continue;let o=n.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){let u=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${s}\` is read as one prop name. Nest the selector inside instead: \`${s}${u}: { '${o.slice(u.length)}': {...} }\`.`)}continue}let i=t[n];if(!i||typeof i!="object")continue;let c=s==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let u,h=t[o];if(h===void 0){let d=!!t.state&&o in t.state,m=t.state?t.state[o]:void 0;if(d||m!==void 0)u=m;else{let x=t.context?.cases?.[o];if(x===void 0)return;try{u=typeof x=="function"?x.call(t,t):x}catch(b){u=!1,e.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}}}else if(typeof h=="function")try{u=h(t,t.state,t.context)}catch(d){u=!1,e.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else u=h;let p=c?!u:!!u;if(!t.node||p===a.lastMatch)return;a.lastMatch=p;let y=t.context?.designSystem;y&&z(y);try{if(p){let d={},m={},x=!1;for(let g in i){if(!Object.prototype.hasOwnProperty.call(i,g))continue;let _=i[g],S=g.charAt(0);if((S===":"||S==="@"||S==="&")&&_&&typeof _=="object"&&!Array.isArray(_)){if(kn(g,t)){let D=re(_,t,!0);Object.keys(D).length&&(m[`[data-theme="${g.slice(1)}"] &`]=D,x=!0)}else{let D=g;if(S==="@"&&!g.startsWith("@media")&&!g.startsWith("@keyframes")){let L=t.context?.designSystem?.media?.[g.slice(1)];L&&(D=`@media ${L}`)}let nt=re(_,t,!1);Object.keys(nt).length&&(m[D]=nt,x=!0)}continue}let v=typeof _=="function"?_(t,t.state,t.context):_;if(v!=null)if(X[g]){let D=X[g](v,t,t.state,t.context);if(D){let nt=Array.isArray(D)?D:[D];for(let L of nt)L&&Object.assign(d,L)}}else H&&H.has(g)&&(d[g]=v)}let b=Object.keys(d);if(b.length){te(t.node,d);for(let g of b)r.set(g,n);a.appliedKeys=b}else a.appliedKeys=null;if(x){let g=Zt(m,null,t.context?.cssPrefix),_=g?g.split(" ").filter(Boolean):[];if(_.length&&t.node.classList){for(let S of _)t.node.classList.add(S);a.appliedClasses=_}else a.appliedClasses=null}else if(a.appliedClasses){for(let g of a.appliedClasses)t.node.classList.remove(g);a.appliedClasses=null}}else{if(a.appliedKeys){for(let d of a.appliedKeys)r.get(d)===n&&(t.node.style[d]="",r.delete(d));a.appliedKeys=null}if(a.appliedClasses){for(let d of a.appliedClasses)t.node.classList.remove(d);a.appliedClasses=null}}}finally{y&&U()}};e.__conditionalRunners.push(l);let f=N(l,{depth:e.path.length});e.__effects.push(f)}}var hn=new WeakSet;function Ya(t){let e=t.ownerDocument;!e||hn.has(e)||(hn.add(e),queueMicrotask(()=>{hn.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var gn=new WeakSet,oi=!1;function Za(t){let{node:e}=t;if(!e)return;if(oi||(oi=!0,Zt({display:"none"})),gn.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}gn.add(t);let r=t.context?.designSystem;r&&z(r);try{let n={},s=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&X.theme){let o=X.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(let i of o)i&&Object.assign(n,i);else Object.assign(n,o);s=!0}}for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||et.has(o)||o==="theme")continue;let i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!ee(o)){if(X[o]){let c=t[o],a=X[o](c,t,t.state,t.context);if(a){if(Array.isArray(a))for(let l of a)l&&Object.assign(n,l);else Object.assign(n,a);s=!0}}else if(H&&H.has(o)){let c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,s=!0)}else if(o.charCodeAt(0)===45){let c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,s=!0)}else if(o.charAt(0)==="&"||o.charAt(0)==="@"||o.charAt(0)===":"){let c=t[o];if(c&&typeof c=="object"&&!Array.isArray(c)){if(Cn(c))continue;let a=fi(o,c,t);a&&(n[a.cssProp]=a.block,s=!0)}}}}if(s){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let o=Zt(n,null,t.context?.cssPrefix);if(o&&e.classList){let c=o.split(" ").filter(Boolean),a=!1;for(let l of c)e.classList.add(l),a||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(a=!0);a&&Ya(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let c=n.display;if(c&&c!==i)if(i==="none"){let a=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&a.push(l);for(let l of a)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&U(),gn.delete(t)}}function li(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let s in t.aria){let o=t.aria[s];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;let i="aria-"+s.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(i,o===!0?"":o)}let r=Is(t);for(let s in r){let o=r[s];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&e.setAttribute(s,o===!0?"":o)}let n=t.tag||"div";for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||et.has(s)||s==="on"||r[s]!==void 0)continue;let o=s.charCodeAt(0);if(!(o>=65&&o<=90)&&!ee(s)&&!(X[s]||H&&H.has(s))&&Pe(n,s)){let i=t[s];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=Ue(i,t,t.state,t.context),t[s]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!rn(Te(s)||s))continue;let c=Te(s)||s;e.setAttribute(c,nr(c,i))}}}function tf(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let s=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};s(),e.addEventListener("input",s),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",s)}catch{}})}var ui=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function di(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!ee(r)||ui.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let o=n;n=function(c){return t.call(o,c)}}if(typeof n!="function")continue;let s=Fa(r);le.has(s)||Oe(Na(s),t,n)}ef(t)}function ef(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let h of ui){let p=t[h];typeof p=="function"&&(r[h]=p,n=!0)}if(!n)return;let s=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,c=0,a=0,l=!1,f=h=>{let p=h.touches&&h.touches[0]||h.changedTouches&&h.changedTouches[0];p&&(i=p.clientX,c=p.clientY,a=Date.now(),l=!0)},u=h=>{if(!l)return;l=!1;let p=h.changedTouches&&h.changedTouches[0]||h.touches&&h.touches[0];if(!p)return;let y=p.clientX-i,d=p.clientY-c,m=Date.now()-a;if(m>o)return;let x=Math.abs(y),b=Math.abs(d);if(Math.max(x,b)<s)return;let g;if(x>b*1.2)g=y<0?"left":"right";else if(b>x*1.2)g=d<0?"up":"down";else return;let _="onSwipe"+g.charAt(0).toUpperCase()+g.slice(1),S=r[_],v=r.onSwipe;S&&S.call(t,h,t,t.state,t.context),v&&v.call(t,{direction:g,dx:y,dy:d,dt:m,event:h},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function fr(t,e){let r={...t};for(let n in e){let s=r[n],o=e[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)&&typeof s!="function"&&typeof o!="function"?r[n]=fr(s,o):r[n]=o}return r}function Sn(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=t.tag==="fragment",o=t.context?.document||globalThis.document,i=s?null:o?.createDocumentFragment();if(!s&&!i)return;let c=t.childProps,a=t.childrenAs;for(let l=0;l<e.length;l++){let f=e[l],u=f;(typeof f=="string"||typeof f=="number")&&(f={text:f});let h=c;if(typeof c=="function")try{h=c(t,f)}catch{h=null}if(a==="state"){let d=u;(typeof u=="string"||typeof u=="number")&&(d={value:u,text:u}),f=h?{...h,state:d}:{state:d}}else h&&(f=fr(h,f));if(n&&!f.ignoreChildExtends)if(f.extends){let d=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...d]}}else f={...f,extends:n};let p=f?.key||u&&typeof u=="object"&&u.key||`${l}`,y;try{y=ht(f,t,p,r)}catch(d){if(typeof console<"u"&&console.error){let m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${p}" failed to construct at ${m} (initial render, skipping this row):`,d?.message||d)}continue}!s&&y?.node&&i.appendChild(y.node)}return s||t.node.appendChild(i),!0}if(typeof e=="string"){let s=ii(e,t);if(Array.isArray(s))return Sn(t,s,r)}if(typeof e=="object")for(let s in e){if(et.has(s))continue;let o=e[s];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=fr(t.childProps,o)),n&&!o.ignoreChildExtends)if(o.extends){let i=Array.isArray(o.extends)?o.extends:[o.extends],c=Array.isArray(n)?n:[n];o={...o,extends:[...c,...i]}}else o={...o,extends:n};ht(o,t,s,r)}}}function wn(t,e){let r=t.node;if(!r||r.tagName!=="SELECT")return;let n=r.options;if(!n||!n.length)return;let s=t.__ref,o=s&&s.__exec&&s.__exec.value,i=typeof o=="function",c=t.value!=null&&typeof t.value!="function";if(i||c){let f;if(i)try{f=o(t,t.state,t.context)}catch{return}else f=t.value;let u=f==null?"":String(f);r.value!==u&&(r.value=u);return}let a=e||!(s&&s.__selectSynced);if(s&&(s.__selectSynced=!0),!a)return;let l=-1;for(let f=0;f<n.length;f++)n[f].defaultSelected&&(l=f);l>=0&&r.selectedIndex!==l&&(r.selectedIndex=l)}function pi(t,e){let{children:r,content:n}=t,s=t.childExtends;if(typeof r=="function"){let c=r;try{r=c(t,t.state,t.context)}catch(h){if(r=void 0,typeof console<"u"&&console.error){let p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,h?.message||h)}}t.children=r;let a=t.__ref,l=!1,f=rt(t,t.childrenDeps,c),u=N(()=>{let h=l;l=!0;let p;try{p=f(t,t.state,t.context)}catch(S){if(typeof console<"u"&&console.error){let v=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${v}${h?"":" (initial tracking run)"}:`,S?.message||S)}return}if(!h||p===t.children)return;t.children=p;let y=typeof t.onContentUpdate=="function",d=y?[]:null,m=y?[]:null,x=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){let S=t.childProps,v=[],D=new Map;for(let O=0;O<p.length;O++){let F=p[O],$=S;if(typeof S=="function")try{$=S(t,F)}catch{$=null}let tt=$&&$.key||F&&F.key||`${O}`;v.push(tt),D.set(tt,{rawChild:F,childProps:$})}let nt=new Set(v),L=a.__children.slice();for(let O of L)if(!nt.has(O)){let F=t[O];F?.remove&&F.remove(),delete t[O],m&&m.push(O)}let q=t.childExtends,it=t.tag==="fragment",Tt=t.context?.document||globalThis.document,K=it?null:Tt?.createDocumentFragment(),ot=new Set;for(let O of v){let F=D.get(O),$=F.rawChild,tt=t[O];if(tt&&tt.state){if($&&typeof $=="object"){let T=tt.state,Pt=T.$replace||T.replace,at=T.$update||T.update;if(typeof Pt=="function")Pt.call(T,$);else if(typeof at=="function"){for(let st in T)if(!(st==="__element"||st==="root"||st==="parent"||st==="update")&&!Object.prototype.hasOwnProperty.call($,st))try{T[st]=void 0}catch{}at.call(T,$)}else for(let st in $)T[st]=$[st]}x&&x.push(O);continue}let Ft=$;(typeof $=="string"||typeof $=="number")&&(Ft={value:$,text:$});let ne=F.childProps,ct=ne?{...ne,state:Ft}:{state:Ft};if(q&&!ct.ignoreChildExtends)if(ct.extends){let T=Array.isArray(ct.extends)?ct.extends:[ct.extends],Pt=Array.isArray(q)?q:[q];ct={...ct,extends:[...Pt,...T]}}else ct={...ct,extends:q};let oe;try{oe=ht(ct,t,O,e)}catch(T){if(typeof console<"u"&&console.error){let Pt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${O}" failed to construct at ${Pt} (reconcile, skipping this row):`,T?.message||T)}ot.add(O);continue}!it&&oe?.node&&K&&K.appendChild(oe.node),d&&d.push(O)}if(!it&&K&&K.childNodes.length&&t.node&&t.node.appendChild(K),!it&&t.node){let O=null;for(let F of v){let $=t[F]?.node;if(!$)continue;let tt=O?O.nextSibling:t.node.firstChild;$!==tt&&t.node.insertBefore($,tt),O=$}}a.__children=ot.size?v.filter(O=>!ot.has(O)):v,y&&(d.length||m.length)&&ei(t,{added:d,removed:m,kept:x}),wn(t,!1);return}let _=y?[...a.__children]:null;for(let S of[...a.__children]){let v=t[S];v?.remove&&v.remove(),delete t[S]}a.__children=[],Sn(t,p,e),wn(t,!1),y&&ei(t,{added:[...a.__children],removed:_,kept:[]})},{depth:a.path.length});a.__effects.push(u)}let o=Sn(t,r||n,e);if((r||n)&&!o)return;let i=t.context?.components||{};{let c=Object.keys(t);for(let a=0;a<c.length;a++){let l=c[a];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;let f=l.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;let u={extends:t[l]};delete t[l];for(let h=a+1;h<c.length;h++){let p=c[h],y=p.charCodeAt(0);if(y>=65&&y<=90||et.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;let d=t[p];d!==void 0&&(u[p]=d,delete t[p])}t[f]&&typeof t[f]=="object"?t[f]={...u,...t[f]}:t[f]=u}}for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||et.has(c)||typeof t[c]!="object"||t[c]===null)continue;let a=c.charCodeAt(0);if(a<65||a>90)continue;let l=t[c];if(!l.__ref){if(!l.extends&&!l.extend){let f=i[c]||i[`smbls.${c}`];f&&(l={...l,extends:f})}if(t.childProps&&(l=fr(t.childProps,l)),s&&!l.ignoreChildExtends)if(l.extends){let f=Array.isArray(l.extends)?l.extends:[l.extends],u=Array.isArray(s)?s:[s];l={...l,extends:[...u,...f]}}else l={...l,extends:s};ht(l,t,c,e)}}}function hi(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let s=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(s){let i=s.parentNode;if(i){if(r?.position==="before"&&r.node)i.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let c=r.node.nextSibling;i.insertBefore(n,c||s)}else i.insertBefore(n,s);return}}let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let i=r.node.nextSibling;i?o.insertBefore(n,i):o.appendChild(n)}else o.appendChild(n)}function $t(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&wt(n,e,r);let s="on"+t,o=e[s];if(typeof o=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let c=e.context?.designSystem;c&&z(c);try{if(o(e,e.state,e.context,r)===!1)return!1}catch(a){if(e.context?.plugins?.length&&wt("error",e,{hook:s,error:a})||console.error(`[DOMQL] Lifecycle "${s}" error:`,a),e.context?.strictMode)throw a}finally{c&&U(),i&&(e.__ref.__inRender=!1)}}return!0}var rf=ht;var nf=(t,e,r={})=>{if(!t||typeof t!="object")throw new Error("[SymbolsEmbed.mount] rootDef must be an object");if(typeof Node>"u"||!(e instanceof Node))throw new Error("[SymbolsEmbed.mount] host must be a DOM element");let n=r.state?lt(r.state):void 0;return ht(t,e,"Root",{state:n,context:r.context||{}})};return xi(of);})();
|
|
16
|
+
`),u&&(o+=u)}}o&&(s.textContent+=o)}function Qa(t){let e=t.subscribeTo;if(typeof e=="function")try{e=e(t,t.state,t.context)}catch{e=null}if(!Array.isArray(e)||e.length===0)return;let r=t.__ref;for(let n=0;n<e.length;n++){let s=e[n];if(typeof s!="string"||s.length===0)continue;let o=s.split("."),i=o[0],c=o.slice(1),a={value:!1},l=N(()=>{let f=t.state&&(G(t.state)?t.state.root:null);if(!f||!G(f))return;let u=f;u=u[i];for(let p=0;p<c.length&&!(u==null||typeof u!="object");p++)if(G(u))u=u[c[p]];else break;if(!a.value)return;let h=!1;if(typeof t.onBeforeUpdate=="function"){let p=t.context?.designSystem;p&&z(p);try{t.onBeforeUpdate(t,t.state,t.context,{updateBySubscription:!0})===!1&&(h=!0)}catch(y){t.context?.plugins?.length&&wt("error",t,{hook:"onBeforeUpdate",error:y})||console.error("[DOMQL] subscribeTo onBeforeUpdate error:",y)}finally{p&&U()}}if(!h&&t.node&&r.__effects)for(let p=0;p<r.__effects.length;p++){let y=r.__effects[p];y&&y!==l&&!y._disposed&&!y._isSubscribeToEffect&&typeof y._execute=="function"&&y._execute()}if(!h&&typeof t.onUpdate=="function"){let p=t.context?.designSystem;p&&z(p);try{t.onUpdate(t,t.state,t.context)}catch(y){t.context?.plugins?.length&&wt("error",t,{hook:"onUpdate",error:y})||console.error("[DOMQL] subscribeTo onUpdate error:",y)}finally{p&&U()}}},{depth:r.path.length});a.value=!0,l._isSubscribeToEffect=!0,r.__effects.push(l)}}function Cn(t,e){return t.charCodeAt(0)===64&&t.length>1&&!t.startsWith("@media")&&!t.startsWith("@keyframes")&&!t.startsWith("@supports")&&(t==="@dark"||t==="@light"||!e.context?.designSystem?.media?.[t.slice(1)])}var ni=new Set;function Ja(t,e){let r=e?.__ref?.path?e.__ref.path.join("."):e?.key||"?",n=r+"::"+t;ni.has(n)||(ni.add(n),console.warn(`[smbls/css] "${t}" at ${r} is a CHILD-COMPONENT key nested inside a pseudo/selector block (":hover", "@dark", etc.) \u2014 that is never a valid CSS selector fragment. The rule is DROPPED (not shipped as a dead/never-matching selector). To reveal a child on a parent state, target the child's OWN class from the parent selector instead, e.g. move the declaration onto the child element itself, or use a sibling-selector combinator in a top-level style block.`))}function ne(t,e,r){let n={},s=new Set,o=(i,c,a)=>{let l=a?new Set(Object.keys(n)):null;if(X[i]){let f=X[i](c,e,e.state,e.context);if(f){let u=Array.isArray(f)?f:[f];for(let h of u)h&&Object.assign(n,h)}}else n[i]=c;if(a)for(let f in n)l.has(f)||s.add(f)};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let c=t[i];if(typeof c=="function"&&(c=c(e,e.state,e.context)),c==null||typeof c=="function")continue;if(typeof c=="object"&&!Array.isArray(c)){if(i==="style"){for(let u in c){let h=c[u];if(typeof h=="function"&&(h=h(e,e.state,e.context)),h==null||typeof h=="function")continue;let p=typeof e[u]=="function"&&(X[u]||H&&H.has(u));o(u,h,p)}continue}if(Cn(i,e)){let u=ne(c,e,!0);Object.keys(u).length&&(n[`[data-theme="${i.slice(1)}"] &`]=u);continue}if(/^[A-Z][A-Za-z0-9]*$/.test(i)){At()&&Ja(i,e);continue}let l=i;if(i.charCodeAt(0)===64&&!i.startsWith("@media")&&!i.startsWith("@keyframes")){let u=e.context?.designSystem?.media?.[i.slice(1)];u&&(l=`@media ${u}`)}let f=ne(c,e,!1);Object.keys(f).length&&(n[l]=f);continue}let a=typeof e[i]=="function"&&(X[i]||H&&H.has(i));o(i,c,a)}if(r)for(let i in n)s.add(i);for(let i of s){let c=n[i];typeof c=="string"&&!c.includes("!important")&&(n[i]=c+" !important")}return n}function vn(t,e){if(e===void 0&&(e=0),e>8)return!1;if(typeof t=="function")return!0;if(t&&typeof t=="object"&&!Array.isArray(t)){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&vn(t[r],e+1))return!0}return!1}function fi(t,e,r){if(!e||typeof e!="object"||Array.isArray(e))return null;if(Cn(t,r)){let o=ne(e,r,!0);return Object.keys(o).length?{cssProp:`[data-theme="${t.slice(1)}"] &`,block:o}:null}let n=t;if(t.charAt(0)==="@"&&!t.startsWith("@media")&&!t.startsWith("@keyframes")){let o=r.context?.designSystem?.media?.[t.slice(1)];o&&(n=`@media ${o}`)}let s=ne(e,r,!1);return Object.keys(s).length?{cssProp:n,block:s}:null}function Xa(t){let e=t.__ref;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!xn(r))continue;let n=t[r];if(!n||typeof n!="object"||Array.isArray(n)||!vn(n))continue;let s=null,o,i=N(()=>{if(!t.node)return;let c=t.context?.designSystem;c&&z(c);let a,l=!1;try{let f=fi(r,n,t),u=f?Sn(f.block)+"::"+f.cssProp:null;if(u!==null&&u===o)l=!0;else if(o=u,f){let h=te({[f.cssProp]:f.block},null,t.context?.cssPrefix);a=h?h.split(" ").filter(Boolean):null}else a=null}finally{c&&U()}if(!(l||!t.node.classList)){if(s)for(let f of s)t.node.classList.remove(f);if(a&&a.length)for(let f of a)t.node.classList.add(f);s=a}},{depth:e.path.length});e.__effects.push(i)}}function Ya(t){let e=t.__ref;e.__conditionalRunners=[];let r=new Map;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=n.charAt(0);if(s!=="."&&s!=="!")continue;let o=n.slice(1);if(!o)continue;if(/[:@\s>~+[\]]/.test(o)){if(typeof console<"u"&&console.warn){let u=o.split(/[:@\s>~+[\]]/)[0];console.warn(`[smbls] conditional \`${n}\` on ${t.key||"?"} will never match \u2014 the whole string after \`${s}\` is read as one prop name. Nest the selector inside instead: \`${s}${u}: { '${o.slice(u.length)}': {...} }\`.`)}continue}let i=t[n];if(!i||typeof i!="object")continue;let c=s==="!",a={lastMatch:!1,appliedKeys:null,appliedClasses:null},l=()=>{let u,h=t[o];if(h===void 0){let d=!!t.state&&o in t.state,m=t.state?t.state[o]:void 0;if(d||m!==void 0)u=m;else{let x=t.context?.cases?.[o];if(x===void 0)return;try{u=typeof x=="function"?x.call(t,t):x}catch(b){u=!1,e.__conditionalError=b,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` case fn threw on ${t.key||"?"} \u2014 treating as false:`,b?.message||b)}}}else if(typeof h=="function")try{u=h(t,t.state,t.context)}catch(d){u=!1,e.__conditionalError=d,typeof console<"u"&&console.warn&&console.warn(`[smbls] conditional \`${n}\` predicate threw on ${t.key||"?"} \u2014 treating as false:`,d?.message||d)}else u=h;let p=c?!u:!!u;if(!t.node||p===a.lastMatch)return;a.lastMatch=p;let y=t.context?.designSystem;y&&z(y);try{if(p){let d={},m={},x=!1;for(let g in i){if(!Object.prototype.hasOwnProperty.call(i,g))continue;let _=i[g],S=g.charAt(0);if((S===":"||S==="@"||S==="&")&&_&&typeof _=="object"&&!Array.isArray(_)){if(Cn(g,t)){let D=ne(_,t,!0);Object.keys(D).length&&(m[`[data-theme="${g.slice(1)}"] &`]=D,x=!0)}else{let D=g;if(S==="@"&&!g.startsWith("@media")&&!g.startsWith("@keyframes")){let L=t.context?.designSystem?.media?.[g.slice(1)];L&&(D=`@media ${L}`)}let ot=ne(_,t,!1);Object.keys(ot).length&&(m[D]=ot,x=!0)}continue}let v=typeof _=="function"?_(t,t.state,t.context):_;if(v!=null)if(X[g]){let D=X[g](v,t,t.state,t.context);if(D){let ot=Array.isArray(D)?D:[D];for(let L of ot)L&&Object.assign(d,L)}}else H&&H.has(g)&&(d[g]=v)}let b=Object.keys(d);if(b.length){ee(t.node,d);for(let g of b)r.set(g,n);a.appliedKeys=b}else a.appliedKeys=null;if(x){let g=te(m,null,t.context?.cssPrefix),_=g?g.split(" ").filter(Boolean):[];if(_.length&&t.node.classList){for(let S of _)t.node.classList.add(S);a.appliedClasses=_}else a.appliedClasses=null}else if(a.appliedClasses){for(let g of a.appliedClasses)t.node.classList.remove(g);a.appliedClasses=null}}else{if(a.appliedKeys){for(let d of a.appliedKeys)r.get(d)===n&&(t.node.style[d]="",r.delete(d));a.appliedKeys=null}if(a.appliedClasses){for(let d of a.appliedClasses)t.node.classList.remove(d);a.appliedClasses=null}}}finally{y&&U()}};e.__conditionalRunners.push(l);let f=N(l,{depth:e.path.length});e.__effects.push(f)}}var gn=new WeakSet;function Za(t){let e=t.ownerDocument;!e||gn.has(e)||(gn.add(e),queueMicrotask(()=>{gn.delete(e);let r=e.body||e.documentElement;r&&r.offsetWidth}))}var yn=new WeakSet,oi=!1;function tf(t){let{node:e}=t;if(!e)return;if(oi||(oi=!0,te({display:"none"})),yn.has(t)){console.error("[applyCssInProps] re-entry detected for element",t.key,"prop path:",t.__ref?.path);return}yn.add(t);let r=t.context?.designSystem;r&&z(r);try{let n={},s=!1;if(Object.prototype.hasOwnProperty.call(t,"theme")&&typeof t.theme!="function"&&X.theme){let o=X.theme(t.theme,t,t.state,t.context);if(o){if(Array.isArray(o))for(let i of o)i&&Object.assign(n,i);else Object.assign(n,o);s=!0}}for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o)||typeof t[o]=="function"||rt.has(o)||o==="theme")continue;let i=o.charCodeAt(0);if(!(i>=65&&i<=90)&&!re(o)){if(X[o]){let c=t[o],a=X[o](c,t,t.state,t.context);if(a){if(Array.isArray(a))for(let l of a)l&&Object.assign(n,l);else Object.assign(n,a);s=!0}}else if(H&&H.has(o)){let c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,s=!0)}else if(o.charCodeAt(0)===45){let c=t[o];c!=null&&typeof c!="object"&&(n[o]=c,s=!0)}else if(o.charAt(0)==="&"||o.charAt(0)==="@"||o.charAt(0)===":"){let c=t[o];if(c&&typeof c=="object"&&!Array.isArray(c)){if(vn(c))continue;let a=fi(o,c,t);a&&(n[a.cssProp]=a.block,s=!0)}}}}if(s){n.display&&String(n.display).includes("!important")&&(e.style.setProperty("display",String(n.display).replace(/\s*!important\s*$/,""),"important"),delete n.display);let o=te(n,null,t.context?.cssPrefix);if(o&&e.classList){let c=o.split(" ").filter(Boolean),a=!1;for(let l of c)e.classList.add(l),a||(l.charCodeAt(0)===95&&l.charCodeAt(1)===99||l.charCodeAt(0)===95&&l.indexOf("_c",1)!==-1)&&(a=!0);a&&Za(e)}let i=t.display!=null&&typeof t.display!="function"?t.display:t.hide===!0||t.show===!1?"none":null;if(i!=null){let c=n.display;if(c&&c!==i)if(i==="none"){let a=[];for(let l of e.classList)l.startsWith("_d-")&&l!=="_d-none"&&a.push(l);for(let l of a)e.classList.remove(l);e.classList.add("_d-none")}else e.style.display=t.display}}}finally{r&&U(),yn.delete(t)}}function li(t){let{node:e}=t;if(!e||!e.setAttribute)return;if(t.aria&&typeof t.aria=="object")for(let s in t.aria){let o=t.aria[s];if(typeof o=="function"||typeof o=="object"||o==null||o===!1)continue;let i="aria-"+s.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.setAttribute(i,o===!0?"":o)}let r=Is(t);for(let s in r){let o=r[s];o!=null&&o!==!1&&typeof o!="function"&&typeof o!="object"&&e.setAttribute(s,o===!0?"":o)}let n=t.tag||"div";for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||typeof t[s]=="function"||rt.has(s)||s==="on"||r[s]!==void 0)continue;let o=s.charCodeAt(0);if(!(o>=65&&o<=90)&&!re(s)&&!(X[s]||H&&H.has(s))&&Re(n,s)){let i=t[s];if(i==null||(typeof i=="string"&&i.includes("{{")&&(i=We(i,t,t.state,t.context),t[s]=i),i==null||typeof i=="function"||typeof i=="object")||i===!1&&!nn(Pe(s)||s))continue;let c=Pe(s)||s;e.setAttribute(c,sr(c,i))}}}function ef(t){if(!t.autoGrow)return;let e=t.node;if(!e||e.tagName!=="TEXTAREA")return;let r=t.autoGrow,n=r&&typeof r=="object"&&r.max?String(r.max):null;n&&(e.style.maxHeight=n);let s=()=>{e.style.height="auto",e.style.height=e.scrollHeight+"px"};s(),e.addEventListener("input",s),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("input",s)}catch{}})}var ui=new Set(["onSwipe","onSwipeLeft","onSwipeRight","onSwipeUp","onSwipeDown"]);function di(t,e){for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||!re(r)||ui.has(r))continue;let n=t[r];if(typeof n=="string"&&/^[A-Za-z_$][\w$]*$/.test(n)){let o=n;n=function(c){return t.call(o,c)}}if(typeof n!="function")continue;let s=Na(r);ue.has(s)||$e(Va(s),t,n)}rf(t)}function rf(t){let e=t.node;if(!e||!e.addEventListener)return;let r={},n=!1;for(let h of ui){let p=t[h];typeof p=="function"&&(r[h]=p,n=!0)}if(!n)return;let s=typeof t.swipeThreshold=="number"?t.swipeThreshold:40,o=typeof t.swipeMaxDuration=="number"?t.swipeMaxDuration:600,i=0,c=0,a=0,l=!1,f=h=>{let p=h.touches&&h.touches[0]||h.changedTouches&&h.changedTouches[0];p&&(i=p.clientX,c=p.clientY,a=Date.now(),l=!0)},u=h=>{if(!l)return;l=!1;let p=h.changedTouches&&h.changedTouches[0]||h.touches&&h.touches[0];if(!p)return;let y=p.clientX-i,d=p.clientY-c,m=Date.now()-a;if(m>o)return;let x=Math.abs(y),b=Math.abs(d);if(Math.max(x,b)<s)return;let g;if(x>b*1.2)g=y<0?"left":"right";else if(b>x*1.2)g=d<0?"up":"down";else return;let _="onSwipe"+g.charAt(0).toUpperCase()+g.slice(1),S=r[_],v=r.onSwipe;S&&S.call(t,h,t,t.state,t.context),v&&v.call(t,{direction:g,dx:y,dy:d,dt:m,event:h},t,t.state,t.context)};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchend",u,{passive:!0}),t.__ref.__eventCleanup||(t.__ref.__eventCleanup=[]),t.__ref.__eventCleanup.push(()=>{try{e.removeEventListener("touchstart",f)}catch{}try{e.removeEventListener("touchend",u)}catch{}})}function ur(t,e){let r={...t};for(let n in e){let s=r[n],o=e[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)&&typeof s!="function"&&typeof o!="function"?r[n]=ur(s,o):r[n]=o}return r}function wn(t,e,r){if(!e||!t.node)return;let n=t.childExtends;if(Array.isArray(e)){let s=t.tag==="fragment",o=t.context?.document||globalThis.document,i=s?null:o?.createDocumentFragment();if(!s&&!i)return;let c=t.childProps,a=t.childrenAs;for(let l=0;l<e.length;l++){let f=e[l],u=f;(typeof f=="string"||typeof f=="number")&&(f={text:f});let h=c;if(typeof c=="function")try{h=c(t,f)}catch{h=null}if(a==="state"){let d=u;(typeof u=="string"||typeof u=="number")&&(d={value:u,text:u}),f=h?{...h,state:d}:{state:d}}else h&&(f=ur(h,f));if(n&&!f.ignoreChildExtends)if(f.extends){let d=Array.isArray(f.extends)?f.extends:[f.extends],m=Array.isArray(n)?n:[n];f={...f,extends:[...m,...d]}}else f={...f,extends:n};let p=f?.key||u&&typeof u=="object"&&u.key||`${l}`,y;try{y=ht(f,t,p,r)}catch(d){if(typeof console<"u"&&console.error){let m=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${p}" failed to construct at ${m} (initial render, skipping this row):`,d?.message||d)}continue}!s&&y?.node&&i.appendChild(y.node)}return s||t.node.appendChild(i),!0}if(typeof e=="string"){let s=ii(e,t);if(Array.isArray(s))return wn(t,s,r)}if(typeof e=="object")for(let s in e){if(rt.has(s))continue;let o=e[s];if(!(o==null||o===!1)){if((typeof o=="string"||typeof o=="number")&&(o={text:o}),t.childProps&&(o=ur(t.childProps,o)),n&&!o.ignoreChildExtends)if(o.extends){let i=Array.isArray(o.extends)?o.extends:[o.extends],c=Array.isArray(n)?n:[n];o={...o,extends:[...c,...i]}}else o={...o,extends:n};ht(o,t,s,r)}}}function kn(t,e){let r=t.node;if(!r||r.tagName!=="SELECT")return;let n=r.options;if(!n||!n.length)return;let s=t.__ref,o=s&&s.__exec&&s.__exec.value,i=typeof o=="function",c=t.value!=null&&typeof t.value!="function";if(i||c){let f;if(i)try{f=o(t,t.state,t.context)}catch{return}else f=t.value;let u=f==null?"":String(f);r.value!==u&&(r.value=u);return}let a=e||!(s&&s.__selectSynced);if(s&&(s.__selectSynced=!0),!a)return;let l=-1;for(let f=0;f<n.length;f++)n[f].defaultSelected&&(l=f);l>=0&&r.selectedIndex!==l&&(r.selectedIndex=l)}function pi(t,e){let{children:r,content:n}=t,s=t.childExtends;if(typeof r=="function"){let c=r;try{r=c(t,t.state,t.context)}catch(h){if(r=void 0,typeof console<"u"&&console.error){let p=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${p} (initial run, treating as empty):`,h?.message||h)}}t.children=r;let a=t.__ref,l=!1,f=nt(t,t.childrenDeps,c),u=N(()=>{let h=l;l=!0;let p;try{p=f(t,t.state,t.context)}catch(S){if(typeof console<"u"&&console.error){let v=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] \`children:\` factory threw at ${v}${h?"":" (initial tracking run)"}:`,S?.message||S)}return}if(!h||p===t.children)return;t.children=p;let y=typeof t.onContentUpdate=="function",d=y?[]:null,m=y?[]:null,x=y?[]:null;if(Array.isArray(p)&&t.childrenAs==="state"){let S=t.childProps,v=[],D=new Map;for(let O=0;O<p.length;O++){let F=p[O],$=S;if(typeof S=="function")try{$=S(t,F)}catch{$=null}let tt=$&&$.key||F&&F.key||`${O}`;v.push(tt),D.set(tt,{rawChild:F,childProps:$})}let ot=new Set(v),L=a.__children.slice();for(let O of L)if(!ot.has(O)){let F=t[O];F?.remove&&F.remove(),delete t[O],m&&m.push(O)}let q=t.childExtends,ct=t.tag==="fragment",Tt=t.context?.document||globalThis.document,K=ct?null:Tt?.createDocumentFragment(),st=new Set;for(let O of v){let F=D.get(O),$=F.rawChild,tt=t[O];if(tt&&tt.state){if($&&typeof $=="object"){let T=tt.state,Pt=T.$replace||T.replace,ft=T.$update||T.update;if(typeof Pt=="function")Pt.call(T,$);else if(typeof ft=="function"){for(let it in T)if(!(it==="__element"||it==="root"||it==="parent"||it==="update")&&!Object.prototype.hasOwnProperty.call($,it))try{T[it]=void 0}catch{}ft.call(T,$)}else for(let it in $)T[it]=$[it]}x&&x.push(O);continue}let Ft=$;(typeof $=="string"||typeof $=="number")&&(Ft={value:$,text:$});let oe=F.childProps,at=oe?{...oe,state:Ft}:{state:Ft};if(q&&!at.ignoreChildExtends)if(at.extends){let T=Array.isArray(at.extends)?at.extends:[at.extends],Pt=Array.isArray(q)?q:[q];at={...at,extends:[...Pt,...T]}}else at={...at,extends:q};let se;try{se=ht(at,t,O,e)}catch(T){if(typeof console<"u"&&console.error){let Pt=t.__ref?.path?.join(".")||t.key||"<root>";console.error(`[smbls] child "${O}" failed to construct at ${Pt} (reconcile, skipping this row):`,T?.message||T)}st.add(O);continue}!ct&&se?.node&&K&&K.appendChild(se.node),d&&d.push(O)}if(!ct&&K&&K.childNodes.length&&t.node&&t.node.appendChild(K),!ct&&t.node){let O=null;for(let F of v){let $=t[F]?.node;if(!$)continue;let tt=O?O.nextSibling:t.node.firstChild;$!==tt&&t.node.insertBefore($,tt),O=$}}a.__children=st.size?v.filter(O=>!st.has(O)):v,y&&(d.length||m.length)&&ei(t,{added:d,removed:m,kept:x}),kn(t,!1);return}let _=y?[...a.__children]:null;for(let S of[...a.__children]){let v=t[S];v?.remove&&v.remove(),delete t[S]}a.__children=[],wn(t,p,e),kn(t,!1),y&&ei(t,{added:[...a.__children],removed:_,kept:[]})},{depth:a.path.length});a.__effects.push(u)}let o=wn(t,r||n,e);if((r||n)&&!o)return;let i=t.context?.components||{};{let c=Object.keys(t);for(let a=0;a<c.length;a++){let l=c[a];if(!l.endsWith("Extends")||typeof t[l]!="string")continue;let f=l.slice(0,-7);if(!f||f.charCodeAt(0)<65||f.charCodeAt(0)>90)continue;let u={extends:t[l]};delete t[l];for(let h=a+1;h<c.length;h++){let p=c[h],y=p.charCodeAt(0);if(y>=65&&y<=90||rt.has(p)||typeof t[p]=="function"&&(p.startsWith("on")||p.startsWith(".")))break;let d=t[p];d!==void 0&&(u[p]=d,delete t[p])}t[f]&&typeof t[f]=="object"?t[f]={...u,...t[f]}:t[f]=u}}for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||rt.has(c)||typeof t[c]!="object"||t[c]===null)continue;let a=c.charCodeAt(0);if(a<65||a>90)continue;let l=t[c];if(!l.__ref){if(!l.extends&&!l.extend){let f=i[c]||i[`smbls.${c}`];f&&(l={...l,extends:f})}if(t.childProps&&(l=ur(t.childProps,l)),s&&!l.ignoreChildExtends)if(l.extends){let f=Array.isArray(l.extends)?l.extends:[l.extends],u=Array.isArray(s)?s:[s];l={...l,extends:[...u,...f]}}else l={...l,extends:s};ht(l,t,c,e)}}}function hi(t,e,r){let{node:n}=t;if(!n)return;n.ref=t;let s=e?.tag==="fragment"?e.__ref?.__fragmentAnchor:null;if(s){let i=s.parentNode;if(i){if(r?.position==="before"&&r.node)i.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let c=r.node.nextSibling;i.insertBefore(n,c||s)}else i.insertBefore(n,s);return}}let o=e?.node||(e?.nodeType?e:null);if(o)if(r?.position==="before"&&r.node)o.insertBefore(n,r.node);else if(r?.position==="after"&&r.node){let i=r.node.nextSibling;i?o.insertBefore(n,i):o.appendChild(n)}else o.appendChild(n)}function $t(t,e,r){let n=t.charAt(0).toLowerCase()+t.slice(1);e.context?.plugins?.length&&wt(n,e,r);let s="on"+t,o=e[s];if(typeof o=="function"){let i=t==="Render"||t==="RenderRouter";if(i){if(e.__ref.__inRender)return!0;e.__ref.__inRender=!0}let c=e.context?.designSystem;c&&z(c);try{if(o(e,e.state,e.context,r)===!1)return!1}catch(a){if(e.context?.plugins?.length&&wt("error",e,{hook:s,error:a})||console.error(`[DOMQL] Lifecycle "${s}" error:`,a),e.context?.strictMode)throw a}finally{c&&U(),i&&(e.__ref.__inRender=!1)}}return!0}var nf=ht;var of=(t,e,r={})=>{if(!t||typeof t!="object")throw new Error("[SymbolsEmbed.mount] rootDef must be an object");if(typeof Node>"u"||!(e instanceof Node))throw new Error("[SymbolsEmbed.mount] host must be a DOM element");let n=r.state?lt(r.state):void 0;return ht(t,e,"Root",{state:n,context:r.context||{}})};return xi(sf);})();
|