@jasonshimmy/custom-elements-runtime 0.2.0 → 0.2.2
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/README.md +1 -0
- package/dist/custom-elements-runtime.cjs.js +16 -16
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +906 -939
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +16 -16
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/router.d.ts +1 -0
- package/dist/runtime/types.d.ts +14 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(T,Q){typeof exports=="object"&&typeof module<"u"?Q(exports):typeof define=="function"&&define.amd?define(["exports"],Q):(T=typeof globalThis<"u"?globalThis:T||self,Q(T.CustomElementsRuntime={}))})(this,(function(T){"use strict";function Q(e,t){return ee(e?t:[],"when-block")}function Ne(e,t){return e.map((r,n)=>{const o=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return ee(t(r,n),`each-${o}`)})}function Ce(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return We(...e)}}}function We(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[ee(n,`whenChain-branch-${t}`)]}return[ee([],"whenChain-empty")]}function ee(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class K extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return K.instance||(K.instance=new K),K.instance}emit(t,r){const n=Date.now(),o=this.eventCounters.get(t);if(!o||n-o.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(o.count++,o.count>50&&(console.error(`Event storm detected for "${t}": ${o.count} events in 1 second. Throttling...`),o.count>100)){console.warn(`Blocking further "${t}" events to prevent infinite loop`);return}this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(i=>{try{i(r)}catch(a){console.error(`Error in global event handler for "${t}":`,a)}})}on(t,r){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(r),()=>this.off(t,r)}off(t,r){const n=this.handlers[t];n&&n.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,n){return this.addEventListener(t,r,n),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(n=>{const o=this.on(t,s=>{o(),r(s),n(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,n]of this.eventCounters.entries())t[r]={count:n.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const V=K.getInstance(),De=(e,t)=>V.emit(e,t),qe=(e,t)=>V.on(e,t),Ie=(e,t)=>V.off(e,t),He=(e,t)=>V.once(e,t),Ke=(e,t,r)=>V.listen(e,t,r);function ae(e){let t={...e};const r=[];function n(a){r.push(a),a(t)}function o(){return t}function s(a){const c=typeof a=="function"?a(t):a;t={...t,...c},i()}function i(){r.forEach(a=>a(t))}return{subscribe:n,getState:o,setState:s}}function le(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ce(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function Ue(e,t,r){if(r)for(const[n,o]of Object.entries(r)){let s,i={};if(Array.isArray(o)?(s=o[0],i=o[1]||{}):s=o,t.set(n,{callback:s,options:i,oldValue:fe(e,n)}),i.immediate)try{const a=fe(e,n);s(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${n}":`,a)}}}function fe(e,t){return t.split(".").reduce((r,n)=>r?.[n],e)}function Fe(e,t,r,n){const o=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((l,y)=>o(l,a[y]));const c=Object.keys(i),u=Object.keys(a);return c.length!==u.length?!1:c.every(l=>o(i[l],a[l]))},s=t.get(r);if(s&&!o(n,s.oldValue))try{s.callback(n,s.oldValue,e),s.oldValue=n}catch(i){console.error(`Error in watcher for "${r}":`,i)}for(const[i,a]of t.entries())if(a.options.deep&&r.startsWith(i+"."))try{const c=fe(e,i);o(c,a.oldValue)||(a.callback(c,a.oldValue,e),a.oldValue=c)}catch(c){console.error(`Error in deep watcher for "${i}":`,c)}}function Ve(e,t,r){if(!t.props)return;function n(o,s){return s===Boolean?o==="true":s===Number?Number(o):o}Object.entries(t.props).forEach(([o,s])=>{if(s.type===Function&&typeof e[o]=="function")r[o]=e[o];else{const i=e.getAttribute(le(o));i!==null?r[o]=ce(n(i,s.type)):"default"in s&&s.default!==void 0&&(r[o]=ce(s.default))}})}function Je(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function Ze(e,t,r,n,o,s,i,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(c=>c()),n(),o(),s(!1),i(null),a(!1)}function Qe(e,t,r,n,o){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,o)}function U(e,t){if(t&&e instanceof HTMLElement){for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))U(r,t)}}function F(e,t){return typeof t=="string"?t.split(".").reduce((r,n)=>r?.[n],e):t}function Ee(e,t,r){const n=t.split("."),o=n.pop();if(!o)return;const s=n.reduce((i,a)=>(a in i||(i[a]={}),i[a]),e);s[o]=r}function Xe(e,t,r,n,o,s,i){if(!s)return;const a=t.includes("lazy"),c=t.includes("trim"),u=t.includes("number"),l=()=>{const p=s._state||s;return F(p,e)},y=l();let d="text";const b=n?.type;if(i instanceof HTMLInputElement?d=b||i.type||"text":i instanceof HTMLSelectElement?d="select":i instanceof HTMLTextAreaElement&&(d="textarea"),d==="checkbox")if(Array.isArray(y)){const p=i?.getAttribute("value")||n?.value||"",f=y.includes(p);i&&i.checked!==f&&(r.checked=f)}else{const p=i?.getAttribute("true-value")||!0,f=y===p;i&&i.checked!==f&&(r.checked=f)}else if(d==="radio"){const p=n?.value||"",f=y===p;i&&i.checked!==f&&(r.checked=f)}else if(d==="select")if(i&&i.hasAttribute("multiple")){const p=i,f=Array.isArray(y)?y:[];setTimeout(()=>{Array.from(p.options).forEach(g=>{const m=f.includes(g.value);g.selected!==m&&(g.selected=m)})},0)}else setTimeout(()=>{i instanceof HTMLSelectElement&&i.value!==String(y)&&(i.value=String(y))},0);else{const p=String(y??"");(!i||i.value!==p)&&(r.value=y)}const k=a||d==="checkbox"||d==="radio"||d==="select"?"change":"input",x=p=>{if(p.isComposing||o._isComposing||p.isTrusted===!1)return;const f=p.target;if(f._modelUpdating)return;const g=l();let m=f.value;if(d==="checkbox")if(Array.isArray(g)){const $=f.getAttribute("value")||"",_=[...g];if(f.checked)_.includes($)||_.push($);else{const C=_.indexOf($);C>-1&&_.splice(C,1)}m=_}else{const $=f.getAttribute("true-value")||!0,_=f.getAttribute("false-value")||!1;m=f.checked?$:_}else if(d==="radio")m=f.getAttribute("value")||f.value;else if(d==="select"&&f.multiple){const $=f;m=Array.from($.selectedOptions).map(_=>_.value)}else if(c&&(m=m.trim()),u){const $=Number(m);isNaN($)||(m=$)}const h=s._state||s,w=F(h,e);if(Array.isArray(m)&&Array.isArray(w)?JSON.stringify([...m].sort())!==JSON.stringify([...w].sort()):m!==w){const $=p.target;$._modelUpdating=!0,Ee(h,e,m),setTimeout(()=>{$._modelUpdating=!1},0),s._requestRender&&s._requestRender()}};if(o[k]=x,d==="text"||d==="textarea"){const p=()=>{o._isComposing=!0},f=g=>{o._isComposing=!1;const m=g.target;setTimeout(()=>{if(m){let h=m.value;if(c&&(h=h.trim()),u){const _=Number(h);isNaN(_)||(h=_)}const w=s._state||s,v=F(w,e);(Array.isArray(h)&&Array.isArray(v)?JSON.stringify([...h].sort())!==JSON.stringify([...v].sort()):h!==v)&&(m&&(m._modelUpdating=!0,setTimeout(()=>{m._modelUpdating=!1},0)),Ee(w,e,h),s._requestRender&&s._requestRender())}},0)};o.compositionstart=p,o.compositionend=f}}function Ae(e){return e.slice(2).charAt(0).toLowerCase()+e.slice(3)}function te(e){if(!e)return[void 0,void 0];if(typeof e=="function")return[e,void 0];if(typeof e=="object"){if(typeof e.handler=="function")return[e.handler,e.options];if(typeof e.fn=="function")return[e.fn,e.options]}return[void 0,void 0]}function Ye(e,t,r,n){if(n){if(typeof e=="object"&&e!==null)for(const[o,s]of Object.entries(e))t[o]=s;else if(typeof e=="string")try{const o=JSON.parse(e);if(typeof o=="object"&&o!==null){for(const[s,i]of Object.entries(o))t[s]=i;return}}catch{const o=F(n,e);r[e]=o}}}function Ge(e,t,r){if(!r)return;const n=F(r,e),o=t.style||"",s=n?"":"none";if(o){const i=o.split(";").filter(Boolean),a=i.findIndex(c=>c.trim().startsWith("display:"));a>=0?i[a]=`display: ${s}`:i.push(`display: ${s}`),t.style=i.join("; ")}else t.style=`display: ${s}`}function et(e,t,r){if(!r)return;const n=F(r,e);let o=[];typeof n=="string"?o=[n]:Array.isArray(n)?o=n.filter(Boolean):typeof n=="object"&&(o=Object.entries(n).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",i=s?`${s} ${o.join(" ")}`.trim():o.join(" ");i&&(t.class=i)}function tt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=F(r,e)}else n=e;let o="";if(typeof n=="string")o=n;else if(n&&typeof n=="object"){const i=[];for(const[a,c]of Object.entries(n))if(c!=null&&c!==""){const u=a.replace(/[A-Z]/g,d=>`-${d.toLowerCase()}`),l=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let y=String(c);typeof c=="number"&&l.includes(u)&&(y=`${c}px`),i.push(`${u}: ${y}`)}o=i.join("; ")+(i.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+o}function Te(e,t,r,n){const o={},s={...n||{}},i={};for(const[a,c]of Object.entries(e)){const{value:u,modifiers:l}=c;switch(a){case"model":Xe(typeof u=="string"?u:String(u),l,o,s,i,t,r);break;case"bind":Ye(u,o,s,t);break;case"show":Ge(u,s,t);break;case"class":et(u,s,t);break;case"style":tt(u,s,t);break}}return{props:o,attrs:s,listeners:i}}function ue(e,t){if(Array.isArray(e)){const s=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const y=i.tag||"node",d=i.props?.attrs?.id??i.props?.attrs?.name??i.props?.attrs?.["data-key"]??"";a=d?`${t}:${y}:${d}`:`${t}:${y}`}let c=a,u=1;for(;s.has(c);)c=`${a}#${u++}`;s.add(c);let l=i.children;return Array.isArray(l)&&(l=ue(l,c)),{...i,key:c,children:l}})}const r=e;let n=r.props?.key??r.key??t,o=r.children;return Array.isArray(o)&&(o=ue(o,n)),{...r,key:n,children:o}}function rt(e,t,r,n){const o=r.directives??{},s=Te(o,n,e,r.attrs),i={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},c=t.props??{},u=i;for(const d in{...c,...u}){const b=c[d],k=u[d];if(b!==k)if(d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==k&&(e.value=k??"");else if(d==="checked"&&e instanceof HTMLInputElement)e.checked=!!k;else if(d.startsWith("on")){const x=Ae(d),[p,f]=te(k),[g,m]=te(b);g&&e.removeEventListener(x,g,m),p&&e.addEventListener(x,p,f)}else k==null||k===!1?e.removeAttribute(d):e.setAttribute(d,String(k))}for(const[d,b]of Object.entries(s.listeners||{})){const[k,x]=te(b);k&&e.addEventListener(d,k,x)}const l=t.attrs??{},y=a;for(const d in{...l,...y}){const b=l[d],k=y[d];b!==k&&(k==null||k===!1?e.removeAttribute(d):e.setAttribute(d,String(k)))}}function O(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const y=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(y.key=e.key),y}if(e.tag==="#anchor"){const y=e,d=Array.isArray(y.children)?y.children:[],b=document.createTextNode(""),k=document.createTextNode("");y.key!=null&&(b.key=`${y.key}:start`,k.key=`${y.key}:end`),y._startNode=b,y._endNode=k;const x=document.createDocumentFragment();x.appendChild(b);for(const p of d){const f=O(p,t);x.appendChild(f)}return x.appendChild(k),x}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:o={},attrs:s={},directives:i={}}=e.props??{},a=Te(i,t,n,s),c={...o,...a.props},u={...s,...a.attrs};for(const y in u){const d=u[y];if(typeof y!="string"||/\[object Object\]/.test(y)){typeof window<"u"&&window.console&&console.warn("Skipping invalid attribute key:",y,d);continue}typeof d=="boolean"?d&&n.setAttribute(y,""):d!=null&&n.setAttribute(y,d)}for(const y in c){const d=c[y];if(typeof y!="string"||/\[object Object\]/.test(y)){typeof window<"u"&&window.console&&console.warn("Skipping invalid prop key:",y,d);continue}if(y==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement))n.value=d??"";else if(y==="checked"&&n instanceof HTMLInputElement)n.checked=!!d;else if(y.startsWith("on")){const[b,k]=te(d);b&&n.addEventListener(Ae(y),b,k)}else{if(y.startsWith("on")&&d===void 0)continue;d==null||d===!1?n.removeAttribute(y):n.setAttribute(y,String(d))}}for(const[y,d]of Object.entries(a.listeners||{}))n.addEventListener(y,d);const l=e.props?.ref??(e.props?.props&&e.props.props.ref);if(typeof e!="string"&&l&&r&&(r[l]=n),Array.isArray(e.children))for(const y of e.children)n.appendChild(O(y,t,r));else typeof e.children=="string"&&(n.textContent=e.children);return n}function nt(e,t,r,n,o){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),i=Array.isArray(t)?t:[],a=new Map;for(const b of i)b&&b.key!=null&&a.set(b.key,b);const c=new Map;for(const b of s){const k=b.key;k!=null&&c.set(k,b)}const u=new Set;let l=e.firstChild;function y(b,k){let x=b;for(;x&&(u.add(x),x!==k);)x=x.nextSibling}function d(b,k,x,p){const f=[];let g=b.nextSibling;for(;g&&g!==k;)f.push(g),g=g.nextSibling;const m=Array.isArray(x)?x:[];if(p.some(w=>w&&w.key!=null)||m.some(w=>w&&w.key!=null)){const w=new Map,v=new Map;for(const C of m)C&&C.key!=null&&w.set(C.key,C);for(const C of f){const E=C.key;E!=null&&v.set(E,C)}const $=new Set;let _=b.nextSibling;for(const C of p){let E;if(C.key!=null&&v.has(C.key)){const L=w.get(C.key);E=re(v.get(C.key),L,C,n),$.add(E),E!==_&&e.contains(E)&&e.insertBefore(E,_)}else E=O(C,n),e.insertBefore(E,_),$.add(E);_=E.nextSibling}for(const C of f)!$.has(C)&&e.contains(C)&&e.removeChild(C)}else{const w=Math.min(m.length,p.length);for(let v=0;v<w;v++){const $=m[v],_=p[v],C=re(f[v],$,_,n);C!==f[v]&&(e.insertBefore(C,f[v]),e.removeChild(f[v]))}for(let v=w;v<p.length;v++)e.insertBefore(O(p[v],n),k);for(let v=w;v<f.length;v++)e.removeChild(f[v])}}for(const b of r){let k;if(b.tag==="#anchor"){const x=b.key,p=`${x}:start`,f=`${x}:end`;let g=c.get(p),m=c.get(f);const h=Array.isArray(b.children)?b.children:[];if(g||(g=document.createTextNode(""),g.key=p),m||(m=document.createTextNode(""),m.key=f),b._startNode=g,b._endNode=m,!e.contains(g)||!e.contains(m)){e.insertBefore(g,l);for(const w of h)e.insertBefore(O(w,n),l);e.insertBefore(m,l)}else d(g,m,a.get(x)?.children,h);y(g,m),l=m.nextSibling;continue}if(b.key!=null&&c.has(b.key)){const x=a.get(b.key);k=re(c.get(b.key),x,b,n,o),u.add(k),k!==l&&e.contains(k)&&(l&&!e.contains(l)&&(l=null),e.insertBefore(k,l))}else k=O(b,n,o),l&&!e.contains(l)&&(l=null),e.insertBefore(k,l),u.add(k);l=k.nextSibling}for(const b of s)!u.has(b)&&e.contains(b)&&(U(b,o),e.removeChild(b))}function re(e,t,r,n,o){if(t&&typeof t!="string"&&t.props?.ref&&o&&U(e,o),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const i=document.createTextNode(r);return e.parentNode?.replaceChild(i,e),i}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const i=r,a=Array.isArray(i.children)?i.children:[],c=i._startNode??document.createTextNode(""),u=i._endNode??document.createTextNode("");i.key!=null&&(c.key=`${i.key}:start`,u.key=`${i.key}:end`),i._startNode=c,i._endNode=u;const l=document.createDocumentFragment();l.appendChild(c);for(const y of a){const d=O(y,n);l.appendChild(d)}return l.appendChild(u),e.parentNode?.replaceChild(l,e),c}if(!r){U(e,o);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!t||typeof t=="string"){U(e,o);const i=O(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),e.parentNode?.replaceChild(i,e),i}if(r.tag==="#anchor"){const i=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),c=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,c.key=`${r.key}:end`),r._startNode=a,r._endNode=c;const u=document.createDocumentFragment();u.appendChild(a);for(const l of i)u.appendChild(O(l,n));return u.appendChild(c),e.parentNode?.replaceChild(u,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const i=e;return rt(i,t.props||{},r.props||{},n),nt(i,t.children,r.children,n,o),typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),i}U(e,o);const s=O(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function ot(e,t,r,n){let o;Array.isArray(t)?t.length===1?(o=t[0],o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})):o={tag:"div",key:"__root__",children:t}:(o=t,o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})),o&&typeof o=="object"&&o.tag==="#anchor"&&(o={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[o]}),o=ue(o,String(o.key??"root"));const s=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;s&&i?typeof s!="string"&&typeof o!="string"&&s.tag===o.tag&&s.key===o.key?a=re(i,s,o,r,n):(a=O(o,r,n),e.replaceChild(a,i)):(a=O(o,r,n),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const c=[];for(let u=0;u<e.childNodes.length;u++){const l=e.childNodes[u];l!==a&&l.nodeName!=="STYLE"&&(U(l,n),c.push(l))}c.forEach(u=>e.removeChild(u)),e._prevVNode=o,e._prevDom=a}function de(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function je(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let ne=null;function Le(){return ne||(ne=new CSSStyleSheet,ne.replaceSync(je(st))),ne}function it(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const st=de`
|
|
1
|
+
(function(A,J){typeof exports=="object"&&typeof module<"u"?J(exports):typeof define=="function"&&define.amd?define(["exports"],J):(A=typeof globalThis<"u"?globalThis:A||self,J(A.CustomElementsRuntime={}))})(this,(function(A){"use strict";function J(e,t){return X(e?t:[],"when-block")}function Me(e,t){return e.map((r,o)=>{const n=typeof r=="object"?r?.key??r?.id??`idx-${o}`:String(r);return X(t(r,o),`each-${n}`)})}function Se(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return Ne(...e)}}}function Ne(...e){for(let t=0;t<e.length;t++){const[r,o]=e[t];if(r)return[X(o,`whenChain-branch-${t}`)]}return[X([],"whenChain-empty")]}function X(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class I extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return I.instance||(I.instance=new I),I.instance}emit(t,r){const o=Date.now(),n=this.eventCounters.get(t);if(!n||o-n.window>1e3)this.eventCounters.set(t,{count:1,window:o});else if(n.count++,n.count>50&&(console.error(`Event storm detected for "${t}": ${n.count} events in 1 second. Throttling...`),n.count>100)){console.warn(`Blocking further "${t}" events to prevent infinite loop`);return}this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(i=>{try{i(r)}catch(a){console.error(`Error in global event handler for "${t}":`,a)}})}on(t,r){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(r),()=>this.off(t,r)}off(t,r){const o=this.handlers[t];o&&o.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,o){return this.addEventListener(t,r,o),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(o=>{const n=this.on(t,s=>{n(),r(s),o(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,o]of this.eventCounters.entries())t[r]={count:o.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const K=I.getInstance(),We=(e,t)=>K.emit(e,t),De=(e,t)=>K.on(e,t),qe=(e,t)=>K.off(e,t),Ie=(e,t)=>K.once(e,t),He=(e,t,r)=>K.listen(e,t,r);function oe(e){let t={...e};const r=[];function o(a){r.push(a),a(t)}function n(){return t}function s(a){const l=typeof a=="function"?a(t):a;t={...t,...l},i()}function i(){r.forEach(a=>a(t))}return{subscribe:o,getState:n,setState:s}}function ie(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function Fe(e,t,r){if(r)for(const[o,n]of Object.entries(r)){let s,i={};if(Array.isArray(n)?(s=n[0],i=n[1]||{}):s=n,t.set(o,{callback:s,options:i,oldValue:ae(e,o)}),i.immediate)try{const a=ae(e,o);s(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${o}":`,a)}}}function ae(e,t){return t.split(".").reduce((r,o)=>r?.[o],e)}function Ke(e,t,r,o){const n=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((p,y)=>n(p,a[y]));const l=Object.keys(i),f=Object.keys(a);return l.length!==f.length?!1:l.every(p=>n(i[p],a[p]))},s=t.get(r);if(s&&!n(o,s.oldValue))try{s.callback(o,s.oldValue,e),s.oldValue=o}catch(i){console.error(`Error in watcher for "${r}":`,i)}for(const[i,a]of t.entries())if(a.options.deep&&r.startsWith(i+"."))try{const l=ae(e,i);n(l,a.oldValue)||(a.callback(l,a.oldValue,e),a.oldValue=l)}catch(l){console.error(`Error in deep watcher for "${i}":`,l)}}function Ue(e,t,r){if(!t.props)return;function o(n,s){return s===Boolean?n==="true":s===Number?Number(n):n}Object.entries(t.props).forEach(([n,s])=>{if(s.type===Function&&typeof e[n]=="function")r[n]=e[n];else{const i=e.getAttribute(ie(n));i!==null?r[n]=se(o(i,s.type)):"default"in s&&s.default!==void 0&&(r[n]=se(s.default))}})}function Ve(e,t,r,o){e.onConnected&&!r&&(e.onConnected(t),o(!0))}function Je(e,t,r,o,n,s,i,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(l=>l()),o(),n(),s(!1),i(null),a(!1)}function Ze(e,t,r,o,n){e.onAttributeChanged&&e.onAttributeChanged(t,r,o,n)}function H(e,t){if(t&&e instanceof HTMLElement){for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))H(r,t)}}function F(e,t){return typeof t=="string"?t.split(".").reduce((r,o)=>r?.[o],e):t}function _e(e,t,r){const o=t.split("."),n=o.pop();if(!n)return;const s=o.reduce((i,a)=>(a in i||(i[a]={}),i[a]),e);s[n]=r}function Qe(e,t,r,o,n,s,i){if(!s)return;const a=t.includes("lazy"),l=t.includes("trim"),f=t.includes("number"),p=()=>{const h=s._state||s;return F(h,e)},y=p();let c="text";const x=o?.type;if(i instanceof HTMLInputElement?c=x||i.type||"text":i instanceof HTMLSelectElement?c="select":i instanceof HTMLTextAreaElement&&(c="textarea"),c==="checkbox")if(Array.isArray(y)){const h=i?.getAttribute("value")||o?.value||"",u=y.includes(h);i&&i.checked!==u&&(r.checked=u)}else{const h=i?.getAttribute("true-value")||!0,u=y===h;i&&i.checked!==u&&(r.checked=u)}else if(c==="radio"){const h=o?.value||"",u=y===h;i&&i.checked!==u&&(r.checked=u)}else if(c==="select")if(i&&i.hasAttribute("multiple")){const h=i,u=Array.isArray(y)?y:[];setTimeout(()=>{Array.from(h.options).forEach(g=>{const b=u.includes(g.value);g.selected!==b&&(g.selected=b)})},0)}else setTimeout(()=>{i instanceof HTMLSelectElement&&i.value!==String(y)&&(i.value=String(y))},0);else{const h=String(y??"");(!i||i.value!==h)&&(r.value=y)}const w=a||c==="checkbox"||c==="radio"||c==="select"?"change":"input",k=h=>{if(h.isComposing||n._isComposing||h.isTrusted===!1)return;const u=h.target;if(u._modelUpdating)return;const g=p();let b=u.value;if(c==="checkbox")if(Array.isArray(g)){const $=u.getAttribute("value")||"",_=[...g];if(u.checked)_.includes($)||_.push($);else{const C=_.indexOf($);C>-1&&_.splice(C,1)}b=_}else{const $=u.getAttribute("true-value")||!0,_=u.getAttribute("false-value")||!1;b=u.checked?$:_}else if(c==="radio")b=u.getAttribute("value")||u.value;else if(c==="select"&&u.multiple){const $=u;b=Array.from($.selectedOptions).map(_=>_.value)}else if(l&&(b=b.trim()),f){const $=Number(b);isNaN($)||(b=$)}const d=s._state||s,v=F(d,e);if(Array.isArray(b)&&Array.isArray(v)?JSON.stringify([...b].sort())!==JSON.stringify([...v].sort()):b!==v){const $=h.target;$._modelUpdating=!0,_e(d,e,b),setTimeout(()=>{$._modelUpdating=!1},0),s._requestRender&&s._requestRender()}};if(n[w]=k,c==="text"||c==="textarea"){const h=()=>{n._isComposing=!0},u=g=>{n._isComposing=!1;const b=g.target;setTimeout(()=>{if(b){let d=b.value;if(l&&(d=d.trim()),f){const _=Number(d);isNaN(_)||(d=_)}const v=s._state||s,m=F(v,e);(Array.isArray(d)&&Array.isArray(m)?JSON.stringify([...d].sort())!==JSON.stringify([...m].sort()):d!==m)&&(b&&(b._modelUpdating=!0,setTimeout(()=>{b._modelUpdating=!1},0)),_e(v,e,d),s._requestRender&&s._requestRender())}},0)};n.compositionstart=h,n.compositionend=u}}function Ce(e){return e.slice(2).charAt(0).toLowerCase()+e.slice(3)}function Ye(e,t,r,o){if(o){if(typeof e=="object"&&e!==null)for(const[n,s]of Object.entries(e))t[n]=s;else if(typeof e=="string")try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){for(const[s,i]of Object.entries(n))t[s]=i;return}}catch{const n=F(o,e);r[e]=n}}}function Xe(e,t,r){if(!r)return;const o=F(r,e),n=t.style||"",s=o?"":"none";if(n){const i=n.split(";").filter(Boolean),a=i.findIndex(l=>l.trim().startsWith("display:"));a>=0?i[a]=`display: ${s}`:i.push(`display: ${s}`),t.style=i.join("; ")}else t.style=`display: ${s}`}function Ge(e,t,r){if(!r)return;const o=F(r,e);let n=[];typeof o=="string"?n=[o]:Array.isArray(o)?n=o.filter(Boolean):typeof o=="object"&&(n=Object.entries(o).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",i=s?`${s} ${n.join(" ")}`.trim():n.join(" ");i&&(t.class=i)}function et(e,t,r){let o;if(typeof e=="string"){if(!r)return;o=F(r,e)}else o=e;let n="";if(typeof o=="string")n=o;else if(o&&typeof o=="object"){const i=[];for(const[a,l]of Object.entries(o))if(l!=null&&l!==""){const f=a.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`),p=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let y=String(l);typeof l=="number"&&p.includes(f)&&(y=`${l}px`),i.push(`${f}: ${y}`)}n=i.join("; ")+(i.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+n}function Ee(e,t,r,o){const n={},s={...o||{}},i={};for(const[a,l]of Object.entries(e)){const{value:f,modifiers:p}=l;switch(a){case"model":Qe(typeof f=="string"?f:String(f),p,n,s,i,t,r);break;case"bind":Ye(f,n,s,t);break;case"show":Xe(f,s,t);break;case"class":Ge(f,s,t);break;case"style":et(f,s,t);break}}return{props:n,attrs:s,listeners:i}}function ce(e,t){if(Array.isArray(e)){const s=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const y=i.tag||"node",c=i.props?.attrs?.id??i.props?.attrs?.name??i.props?.attrs?.["data-key"]??"";a=c?`${t}:${y}:${c}`:`${t}:${y}`}let l=a,f=1;for(;s.has(l);)l=`${a}#${f++}`;s.add(l);let p=i.children;return Array.isArray(p)&&(p=ce(p,l)),{...i,key:l,children:p}})}const r=e;let o=r.props?.key??r.key??t,n=r.children;return Array.isArray(n)&&(n=ce(n,o)),{...r,key:o,children:n}}function tt(e,t,r,o){const n=r.directives??{},s=Ee(n,o,e,r.attrs),i={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},l=t.props??{},f=i;for(const c in{...l,...f}){const x=l[c],w=f[c];if(x!==w)if(c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==w&&(e.value=w??"");else if(c==="checked"&&e instanceof HTMLInputElement)e.checked=!!w;else if(c.startsWith("on")&&typeof w=="function"){const k=Ce(c);typeof x=="function"&&e.removeEventListener(k,x),e.addEventListener(k,w)}else w==null||w===!1?e.removeAttribute(c):e.setAttribute(c,String(w))}for(const[c,x]of Object.entries(s.listeners||{}))e.addEventListener(c,x);const p=t.attrs??{},y=a;for(const c in{...p,...y}){const x=p[c],w=y[c];x!==w&&(w==null||w===!1?e.removeAttribute(c):e.setAttribute(c,String(w)))}}function P(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const y=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(y.key=e.key),y}if(e.tag==="#anchor"){const y=e,c=Array.isArray(y.children)?y.children:[],x=document.createTextNode(""),w=document.createTextNode("");y.key!=null&&(x.key=`${y.key}:start`,w.key=`${y.key}:end`),y._startNode=x,y._endNode=w;const k=document.createDocumentFragment();k.appendChild(x);for(const h of c){const u=P(h,t);k.appendChild(u)}return k.appendChild(w),k}const o=document.createElement(e.tag);e.key!=null&&(o.key=e.key);const{props:n={},attrs:s={},directives:i={}}=e.props??{},a=Ee(i,t,o,s),l={...n,...a.props},f={...s,...a.attrs};for(const y in f){const c=f[y];if(typeof y!="string"||/\[object Object\]/.test(y)){typeof window<"u"&&window.console&&console.warn("Skipping invalid attribute key:",y,c);continue}typeof c=="boolean"?c&&o.setAttribute(y,""):c!=null&&o.setAttribute(y,c)}for(const y in l){const c=l[y];if(typeof y!="string"||/\[object Object\]/.test(y)){typeof window<"u"&&window.console&&console.warn("Skipping invalid prop key:",y,c);continue}if(y==="value"&&(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement))o.value=c??"";else if(y==="checked"&&o instanceof HTMLInputElement)o.checked=!!c;else if(y.startsWith("on")&&typeof c=="function")o.addEventListener(Ce(y),c);else{if(y.startsWith("on")&&c===void 0)continue;c==null||c===!1?o.removeAttribute(y):o.setAttribute(y,String(c))}}for(const[y,c]of Object.entries(a.listeners||{}))o.addEventListener(y,c);const p=e.props?.ref??(e.props?.props&&e.props.props.ref);if(typeof e!="string"&&p&&r&&(r[p]=o),Array.isArray(e.children))for(const y of e.children)o.appendChild(P(y,t,r));else typeof e.children=="string"&&(o.textContent=e.children);return o}function rt(e,t,r,o,n){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),i=Array.isArray(t)?t:[],a=new Map;for(const x of i)x&&x.key!=null&&a.set(x.key,x);const l=new Map;for(const x of s){const w=x.key;w!=null&&l.set(w,x)}const f=new Set;let p=e.firstChild;function y(x,w){let k=x;for(;k&&(f.add(k),k!==w);)k=k.nextSibling}function c(x,w,k,h){const u=[];let g=x.nextSibling;for(;g&&g!==w;)u.push(g),g=g.nextSibling;const b=Array.isArray(k)?k:[];if(h.some(v=>v&&v.key!=null)||b.some(v=>v&&v.key!=null)){const v=new Map,m=new Map;for(const C of b)C&&C.key!=null&&v.set(C.key,C);for(const C of u){const E=C.key;E!=null&&m.set(E,C)}const $=new Set;let _=x.nextSibling;for(const C of h){let E;if(C.key!=null&&m.has(C.key)){const L=v.get(C.key);E=G(m.get(C.key),L,C,o),$.add(E),E!==_&&e.contains(E)&&e.insertBefore(E,_)}else E=P(C,o),e.insertBefore(E,_),$.add(E);_=E.nextSibling}for(const C of u)!$.has(C)&&e.contains(C)&&e.removeChild(C)}else{const v=Math.min(b.length,h.length);for(let m=0;m<v;m++){const $=b[m],_=h[m],C=G(u[m],$,_,o);C!==u[m]&&(e.insertBefore(C,u[m]),e.removeChild(u[m]))}for(let m=v;m<h.length;m++)e.insertBefore(P(h[m],o),w);for(let m=v;m<u.length;m++)e.removeChild(u[m])}}for(const x of r){let w;if(x.tag==="#anchor"){const k=x.key,h=`${k}:start`,u=`${k}:end`;let g=l.get(h),b=l.get(u);const d=Array.isArray(x.children)?x.children:[];if(g||(g=document.createTextNode(""),g.key=h),b||(b=document.createTextNode(""),b.key=u),x._startNode=g,x._endNode=b,!e.contains(g)||!e.contains(b)){e.insertBefore(g,p);for(const v of d)e.insertBefore(P(v,o),p);e.insertBefore(b,p)}else c(g,b,a.get(k)?.children,d);y(g,b),p=b.nextSibling;continue}if(x.key!=null&&l.has(x.key)){const k=a.get(x.key);w=G(l.get(x.key),k,x,o,n),f.add(w),w!==p&&e.contains(w)&&(p&&!e.contains(p)&&(p=null),e.insertBefore(w,p))}else w=P(x,o,n),p&&!e.contains(p)&&(p=null),e.insertBefore(w,p),f.add(w);p=w.nextSibling}for(const x of s)!f.has(x)&&e.contains(x)&&(H(x,n),e.removeChild(x))}function G(e,t,r,o,n){if(t&&typeof t!="string"&&t.props?.ref&&n&&H(e,n),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const i=document.createTextNode(r);return e.parentNode?.replaceChild(i,e),i}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const i=r,a=Array.isArray(i.children)?i.children:[],l=i._startNode??document.createTextNode(""),f=i._endNode??document.createTextNode("");i.key!=null&&(l.key=`${i.key}:start`,f.key=`${i.key}:end`),i._startNode=l,i._endNode=f;const p=document.createDocumentFragment();p.appendChild(l);for(const y of a){const c=P(y,o);p.appendChild(c)}return p.appendChild(f),e.parentNode?.replaceChild(p,e),l}if(!r){H(e,n);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!t||typeof t=="string"){H(e,n);const i=P(r,o,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=i),e.parentNode?.replaceChild(i,e),i}if(r.tag==="#anchor"){const i=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),l=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,l.key=`${r.key}:end`),r._startNode=a,r._endNode=l;const f=document.createDocumentFragment();f.appendChild(a);for(const p of i)f.appendChild(P(p,o));return f.appendChild(l),e.parentNode?.replaceChild(f,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const i=e;return tt(i,t.props||{},r.props||{},o),rt(i,t.children,r.children,o,n),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=i),i}H(e,n);const s=P(r,o,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function nt(e,t,r,o){let n;Array.isArray(t)?t.length===1?(n=t[0],n&&typeof n=="object"&&n.key==null&&(n={...n,key:"__root__"})):n={tag:"div",key:"__root__",children:t}:(n=t,n&&typeof n=="object"&&n.key==null&&(n={...n,key:"__root__"})),n&&typeof n=="object"&&n.tag==="#anchor"&&(n={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[n]}),n=ce(n,String(n.key??"root"));const s=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;s&&i?typeof s!="string"&&typeof n!="string"&&s.tag===n.tag&&s.key===n.key?a=G(i,s,n,r,o):(a=P(n,r,o),e.replaceChild(a,i)):(a=P(n,r,o),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const l=[];for(let f=0;f<e.childNodes.length;f++){const p=e.childNodes[f];p!==a&&p.nodeName!=="STYLE"&&(H(p,o),l.push(p))}l.forEach(f=>e.removeChild(f)),e._prevVNode=n,e._prevDom=a}function le(e,...t){let r="";for(let o=0;o<e.length;o++)r+=e[o],o<t.length&&(r+=t[o]);return r}function Ae(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let ee=null;function Te(){return ee||(ee=new CSSStyleSheet,ee.replaceSync(Ae(it))),ee}function ot(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const it=le`
|
|
2
2
|
:host, *, ::before, ::after {
|
|
3
3
|
all: isolate;
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -56,33 +56,33 @@
|
|
|
56
56
|
sup { top: -.5em }
|
|
57
57
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
58
58
|
[hidden] { display: none }
|
|
59
|
-
`,at={gray:{50:"var(--color-gray-50, #f9fafb)",100:"var(--color-gray-100, #f3f4f6)",200:"var(--color-gray-200, #e5e7eb)",300:"var(--color-gray-300, #d1d5db)",400:"var(--color-gray-400, #9ca3af)",500:"var(--color-gray-500, #6b7280)",600:"var(--color-gray-600, #4b5563)",700:"var(--color-gray-700, #374151)",800:"var(--color-gray-800, #1f2937)",900:"var(--color-gray-900, #111827)"},neutral:{50:"var(--color-neutral-50, #fafafa)",100:"var(--color-neutral-100, #f5f5f5)",200:"var(--color-neutral-200, #e5e5e5)",300:"var(--color-neutral-300, #d4d4d4)",400:"var(--color-neutral-400, #a3a3a3)",500:"var(--color-neutral-500, #737373)",600:"var(--color-neutral-600, #525252)",700:"var(--color-neutral-700, #404040)",800:"var(--color-neutral-800, #262626)",900:"var(--color-neutral-900, #171717)"},slate:{50:"var(--color-slate-50, #f8fafc)",100:"var(--color-slate-100, #f1f5f9)",200:"var(--color-slate-200, #e2e8f0)",300:"var(--color-slate-300, #cbd5e1)",400:"var(--color-slate-400, #94a3b8)",500:"var(--color-slate-500, #64748b)",600:"var(--color-slate-600, #475569)",700:"var(--color-slate-700, #334155)",800:"var(--color-slate-800, #1e293b)",900:"var(--color-slate-900, #0f172a)"},zinc:{50:"var(--color-zinc-50, #fafafa)",100:"var(--color-zinc-100, #f4f4f5)",200:"var(--color-zinc-200, #e4e4e7)",300:"var(--color-zinc-300, #d4d4d8)",400:"var(--color-zinc-400, #a1a1aa)",500:"var(--color-zinc-500, #71717a)",600:"var(--color-zinc-600, #52525b)",700:"var(--color-zinc-700, #3f3f46)",800:"var(--color-zinc-800, #27272a)",900:"var(--color-zinc-900, #18181b)"},red:{50:"var(--color-red-50, #fef2f2)",100:"var(--color-red-100, #fee2e2)",200:"var(--color-red-200, #fecaca)",300:"var(--color-red-300, #fca5a5)",400:"var(--color-red-400, #f87171)",500:"var(--color-red-500, #ef4444)",600:"var(--color-red-600, #dc2626)",700:"var(--color-red-700, #b91c1c)",800:"var(--color-red-800, #991b1b)",900:"var(--color-red-900, #7f1d1d)"},blue:{50:"var(--color-blue-50, #eff6ff)",100:"var(--color-blue-100, #dbeafe)",200:"var(--color-blue-200, #bfdbfe)",300:"var(--color-blue-300, #93c5fd)",400:"var(--color-blue-400, #60a5fa)",500:"var(--color-blue-500, #3b82f6)",600:"var(--color-blue-600, #2563eb)",700:"var(--color-blue-700, #1d4ed8)",800:"var(--color-blue-800, #1e40af)",900:"var(--color-blue-900, #1e3a8a)"},green:{50:"var(--color-green-50, #f0fdf4)",100:"var(--color-green-100, #dcfce7)",200:"var(--color-green-200, #bbf7d0)",300:"var(--color-green-300, #86efac)",400:"var(--color-green-400, #4ade80)",500:"var(--color-green-500, #22c55e)",600:"var(--color-green-600, #16a34a)",700:"var(--color-green-700, #15803d)",800:"var(--color-green-800, #166534)",900:"var(--color-green-900, #14532d)"},amber:{50:"var(--color-amber-50, #fffbeb)",100:"var(--color-amber-100, #fef3c7)",200:"var(--color-amber-200, #fde68a)",300:"var(--color-amber-300, #fcd34d)",400:"var(--color-amber-400, #fbbf24)",500:"var(--color-amber-500, #f59e0b)",600:"var(--color-amber-600, #d97706)",700:"var(--color-amber-700, #b45309)",800:"var(--color-amber-800, #92400e)",900:"var(--color-amber-900, #78350f)"},indigo:{50:"var(--color-indigo-50, #eef2ff)",100:"var(--color-indigo-100, #e0e7ff)",200:"var(--color-indigo-200, #c7d2fe)",300:"var(--color-indigo-300, #a5b4fc)",400:"var(--color-indigo-400, #818cf8)",500:"var(--color-indigo-500, #6366f1)",600:"var(--color-indigo-600, #4f46e5)",700:"var(--color-indigo-700, #4338ca)",800:"var(--color-indigo-800, #3730a3)",900:"var(--color-indigo-900, #312e81)"},emerald:{50:"var(--color-emerald-50, #ecfdf5)",100:"var(--color-emerald-100, #d1fae5)",200:"var(--color-emerald-200, #a7f3d0)",300:"var(--color-emerald-300, #6ee7b7)",400:"var(--color-emerald-400, #34d399)",500:"var(--color-emerald-500, #10b981)",600:"var(--color-emerald-600, #059669)",700:"var(--color-emerald-700, #047857)",800:"var(--color-emerald-800, #065f46)",900:"var(--color-emerald-900, #064e3b)"},rose:{50:"var(--color-rose-50, #fff1f2)",100:"var(--color-rose-100, #ffe4e6)",200:"var(--color-rose-200, #fecdd3)",300:"var(--color-rose-300, #fda4af)",400:"var(--color-rose-400, #fb7185)",500:"var(--color-rose-500, #f43f5e)",600:"var(--color-rose-600, #e11d48)",700:"var(--color-rose-700, #be123c)",800:"var(--color-rose-800, #9f1239)",900:"var(--color-rose-900, #881337)"},white:{DEFAULT:"var(--color-white, #ffffff)"},black:{DEFAULT:"var(--color-black, #000000)"}},pe={block:"display:block;",inline:"display:inline;","inline-block":"display:inline-block;",flex:"display:flex;","inline-flex":"display:inline-flex;",grid:"display:grid;",hidden:"display:none;","w-full":"width:100%;","w-screen":"width:100dvw;","h-full":"height:100%;","h-screen":"height:100dvw;","max-w-full":"max-width:100%;","max-h-full":"max-height:100%;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","m-auto":"margin:auto;","mx-auto":"margin-inline:auto;","my-auto":"margin-block:auto;","overflow-auto":"overflow:auto;","overflow-hidden":"overflow:hidden;","overflow-visible":"overflow:visible;","overflow-scroll":"overflow:scroll;","pointer-events-none":"pointer-events:none;","pointer-events-auto":"pointer-events:auto;","sr-only":"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;","not-sr-only":"position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;","grid-cols-1":"grid-template-columns:repeat(1,minmax(0,1fr));","grid-cols-2":"grid-template-columns:repeat(2,minmax(0,1fr));","grid-cols-3":"grid-template-columns:repeat(3,minmax(0,1fr));","grid-cols-4":"grid-template-columns:repeat(4,minmax(0,1fr));","grid-cols-5":"grid-template-columns:repeat(5,minmax(0,1fr));","grid-cols-6":"grid-template-columns:repeat(6,minmax(0,1fr));","grid-cols-12":"grid-template-columns:repeat(12,minmax(0,1fr));","grid-rows-1":"grid-template-rows:repeat(1,minmax(0,1fr));","grid-rows-2":"grid-template-rows:repeat(2,minmax(0,1fr));","grid-rows-3":"grid-template-rows:repeat(3,minmax(0,1fr));","grid-rows-4":"grid-template-rows:repeat(4,minmax(0,1fr));","grid-rows-6":"grid-template-rows:repeat(6,minmax(0,1fr));","grid-rows-12":"grid-template-rows:repeat(12,minmax(0,1fr));","col-span-1":"grid-column:span 1 / span 1;","col-span-2":"grid-column:span 2 / span 2;","col-span-3":"grid-column:span 3 / span 3;","col-span-4":"grid-column:span 4 / span 4;","col-span-5":"grid-column:span 5 / span 5;","col-span-6":"grid-column:span 6 / span 6;","col-span-12":"grid-column:span 12 / span 12;","row-span-1":"grid-row:span 1 / span 1;","row-span-2":"grid-row:span 2 / span 2;","row-span-3":"grid-row:span 3 / span 3;","row-span-4":"grid-row:span 4 / span 4;","row-span-6":"grid-row:span 6 / span 6;","row-span-12":"grid-row:span 12 / span 12;",absolute:"position:absolute;",relative:"position:relative;",fixed:"position:fixed;",sticky:"position:sticky;","font-bold":"font-weight:700;","font-semibold":"font-weight:600;","font-medium":"font-weight:500;","font-light":"font-weight:300;",underline:"text-decoration-line:underline;",overline:"text-decoration-line:overline;","line-through":"text-decoration-line:line-through;","no-underline":"text-decoration-line:none;",italic:"font-style:italic;","not-italic":"font-style:normal;",uppercase:"text-transform:uppercase;",lowercase:"text-transform:lowercase;",capitalize:"text-transform:capitalize;","normal-case":"text-transform:none;","text-left":"text-align:left;","text-center":"text-align:center;","text-right":"text-align:right;","text-xs":"font-size:0.75rem;line-height:calc(1 / 0.75)","text-sm":"font-size:0.875rem;line-height:calc(1.25 / 0.875)","text-base":"font-size:1rem;line-height:calc(1.5 / 1)","text-lg":"font-size:1.125rem;line-height:calc(1.75 / 1.125)","text-xl":"font-size:1.25rem;line-height:calc(1.75 / 1.25)","text-2xl":"font-size:1.5rem;line-height:calc(2 / 1.5)","text-3xl":"font-size:1.875rem;line-height:calc(2.25 / 1.875)","text-4xl":"font-size:2.25rem;line-height:calc(2.5 / 2.25)","text-5xl":"font-size:3rem;line-height:1","text-6xl":"font-size:3.75rem;line-height:1","text-7xl":"font-size:4.5rem;line-height:1","text-8xl":"font-size:6rem;line-height:1",border:"border-width:1px;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;",rounded:"border-radius:0.25rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-full":"border-radius:9999px;","ring-0":"box-shadow:none;","ring-1":"box-shadow:0 0 0 1px rgba(59,130,246,0.5);","ring-2":"box-shadow:0 0 0 2px rgba(59,130,246,0.5);","ring-4":"box-shadow:0 0 0 4px rgba(59,130,246,0.5);","ring-8":"box-shadow:0 0 0 8px rgba(59,130,246,0.5);","shadow-none":"box-shadow:0 0 #0000;","shadow-xs":"box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);","shadow-sm":"box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);","shadow-md":"box-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);","shadow-lg":"box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);","shadow-xl":"box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);","shadow-2xl":"box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",truncate:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",visible:"visibility:visible;",invisible:"visibility:hidden;","items-center":"align-items:center;","items-start":"align-items:flex-start;","items-end":"align-items:flex-end;","items-baseline":"align-items:baseline;","items-stretch":"align-items:stretch;","justify-center":"justify-content:center;","justify-start":"justify-content:flex-start;","justify-between":"justify-content:space-between;","justify-around":"justify-content:space-around;","justify-evenly":"justify-content:space-evenly;","justify-end":"justify-content:flex-end;","flex-wrap":"flex-wrap:wrap;","flex-nowrap":"flex-wrap:nowrap;","flex-wrap-reverse":"flex-wrap:wrap-reverse;","content-center":"align-content:center;","content-start":"align-content:flex-start;","content-end":"align-content:flex-end;","content-between":"align-content:space-between;","content-around":"align-content:space-around;","content-stretch":"align-content:stretch;","self-auto":"align-self:auto;","self-start":"align-self:flex-start;","self-end":"align-self:flex-end;","self-center":"align-self:center;","self-stretch":"align-self:stretch;","flex-1":"flex:1 1 0%;","flex-auto":"flex:1 1 auto;","flex-initial":"flex:0 1 auto;","flex-none":"flex:0 0 auto;","flex-col":"flex-direction:column;","flex-row":"flex-direction:row;",grow:"flex-grow:1;",shrink:"flex-shrink:1;","grow-0":"flex-grow:0;","shrink-0":"flex-shrink:0;","font-sans":"font-family:ui-sans-serif,system-ui,sans-serif;","font-serif":"font-family:ui-serif,Georgia,serif;","font-mono":"font-family:ui-monospace,SFMono-Regular,monospace;","line-clamp-1":"display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-2":"display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-3":"display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-4":"display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","z-0":"z-index:0;","z-10":"z-index:10;","z-20":"z-index:20;","z-30":"z-index:30;","z-40":"z-index:40;","z-50":"z-index:50;"},lt="0.25rem",ze={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]};function M(e,t){let r=0,n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s==="[")r++;else if(s==="]"&&r>0)r--;else if(s==="(")n++;else if(s===")"&&n>0)n--;else if(r===0&&n===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,o)+t+e.slice(o)}return e+t}const ct={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${M(e,":hover")}{${t}}`,focus:(e,t)=>`${M(e,":focus")}{${t}}`,active:(e,t)=>`${M(e,":active")}{${t}}`,disabled:(e,t)=>`${M(e,":disabled")}{${t}}`,visited:(e,t)=>`${M(e,":visited")}{${t}}`,checked:(e,t)=>`${M(e,":checked")}{${t}}`,first:(e,t)=>`${M(e,":first-child")}{${t}}`,last:(e,t)=>`${M(e,":last-child")}{${t}}`,odd:(e,t)=>`${M(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${M(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${M(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${M(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},he={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},ge=["sm","md","lg","xl","2xl"];function ye(e){const t=e.startsWith("-"),n=(t?e.slice(1):e).split("-");if(n.length<2)return null;const o=n.slice(0,-1).join("-"),s=n[n.length-1],i=parseFloat(s);if(Number.isNaN(i)||!ze[o])return null;const a=t?"-":"";return ze[o].map(c=>`${c}:calc(${a}${lt} * ${i});`).join("")}function Re(e){const t=e.replace("#",""),r=parseInt(t,16),n=r>>16&255,o=r>>8&255,s=r&255;return`${n} ${o} ${s}`}function ft(e){const t=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,n,o="DEFAULT"]=t,s=at[n]?.[o];return s?`${{bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",shadow:"box-shadow",outline:"outline-color",caret:"caret-color",accent:"accent-color",placeholder:"placeholder-color",fill:"fill-color",stroke:"stroke-color"}[r]}:${s};`:null}function ut(e){const[t,r]=e.split("/");if(!r)return{base:t};const n=parseInt(r,10);return isNaN(n)||n<0||n>100?{base:t}:{base:t,opacity:n/100}}function me(e){const{base:t,opacity:r}=ut(e),n=ft(t);if(n){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const i=Re(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return n}const o=oe(t);if(o&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(o);if(s){const i=Re(s[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return o}function be(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const r=parseInt(t[1],10);return r<0||r>100?null:`opacity:${r/100};`}function oe(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const o=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(o){const s=o[1].trim();let i=o[2].trim();return i=i.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),i=i.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${i};`}return null}const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const n=e.slice(0,t);let o=e.slice(t+2,-1);o=o.replace(/_/g," ");const s={bg:"background-color",text:"color",p:"padding",px:"padding-inline",py:"padding-block",m:"margin",mx:"margin-inline",my:"margin-block",w:"width",h:"height","min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height","border-t":"border-top","border-b":"border-bottom","border-l":"border-left","border-r":"border-right","border-x":"border-inline","border-y":"border-block",shadow:"box-shadow",duration:"transition-duration",list:"list-style",break:"word-break",flex:"flex-direction",items:"align-items",justify:"justify-content",whitespace:"white-space",select:"user-select",content:"align-content",self:"align-self",basis:"flex-basis",tracking:"letter-spacing",scroll:"scroll-behavior",delay:"transition-delay",weight:"font-weight",leading:"line-height",z:"z-index"};if(n==="rotate")return`transform:rotate(${o});`;const i=s[n]??n.replace(/_/g,"-");if(i&&o)return`${i}:${o};`}return null}function dt(e){if(e.startsWith("[")&&e.endsWith("]")){const r=e.slice(1,-1);return r.includes("&")?r:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const r=e.slice(t+2,-1).replace(/_/g,"-");return r.includes("&")?r:e.replace(/_/g,"-")}return null}function pt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function ht(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let n;for(;n=t.exec(e);){const o=n[2].split(/\s+/).filter(Boolean);o.length&&r.push(...o)}return r.filter(Boolean)}const Pe=new Map,gt=16;function yt(e){const t=Date.now(),r=Pe.get(e);if(r&&t-r.timestamp<gt)return r.css;const n=ht(e),o=new Set(n),s=[],i=[],a=[],c=[],u={};function l(p,f=!1){const g=(f?"dark|":"")+p;if(g in u)return u[g];const m=k(p,f);return u[g]=m,m}function y(p){const f=p.some(m=>ge.includes(m)),g=p.includes("dark");return p.length===0?1:!f&&!g?2:f&&!g?3:4}function d(p){const f=[];let g="",m=0,h=0;for(let w=0;w<p.length;w++){const v=p[w];v==="["?m++:v==="]"&&m>0?m--:v==="("?h++:v===")"&&h>0&&h--,v===":"&&m===0&&h===0?(f.push(g),g=""):g+=v}return g&&f.push(g),f}function b(p){switch(p){case"hover":return":hover";case"focus":return":focus";case"active":return":active";case"visited":return":visited";case"disabled":return":disabled";case"checked":return":checked";case"first":return":first-child";case"last":return":last-child";case"odd":return":nth-child(odd)";case"even":return":nth-child(even)";case"focus-within":return":focus-within";case"focus-visible":return":focus-visible";default:return null}}function k(p,f=!1){const g=d(p);(p.includes("mask-image")||p.includes("sm: hover")||p.includes("sm:hover")||p.includes("mask.svg"))&&console.error("DEBUG generateRule:",p,g);let m=!1,h=g.find(S=>(S.startsWith("!")&&(m=!0,S=S.slice(1)),pe[S]||ye(S)||be(S)||me(S)||oe(S)));if(!h)return null;const w=h.replace(/^!/,""),v=pe[w]??ye(w)??be(w)??me(w)??oe(w);if(!v)return null;const $=g.indexOf(h);let _=$>=0?g.slice(0,$):[];f&&(_=_.filter(S=>S!=="dark"));const C=`.${pt(p)}`,E="__SUBJECT__",L=m?v.replace(/;$/," !important;"):v;let j=E;const A=[];for(const S of _)S.startsWith("group-")?(j=`.group:${S.slice(6)} ${j}`,A.push(S)):S.startsWith("peer-")&&(j=j.replace(E,`.peer:${S.slice(5)}~${E}`),A.push(S));_=_.filter(S=>!A.includes(S));const H=[],$e=[];let q=null;for(const S of _){if(S==="dark"||ge.includes(S))continue;const D=dt(S);if(D){q=D;continue}const R=b(S);if(R){q?$e.push(R):H.push(R);continue}const B=ct[S];typeof B=="function"&&(j=B(j,L).split("{")[0])}function Ct(S,D){if(!D)return S;let R=0,B=0;if(S.length&&(S[0]===">"||S[0]==="+"||S[0]==="~"||S[0]===" ")){let z=1;for(;z<S.length&&S[z]===" ";)z++;for(;z<S.length;z++){const P=S[z];if(P==="["?R++:P==="]"&&R>0?R--:P==="("?B++:P===")"&&B>0&&B--,R===0&&B===0&&(S[z]===">"||S[z]==="+"||S[z]==="~"||S[z]===" "))return S.slice(0,z)+D+S.slice(z)}return S+D}for(let z=0;z<S.length;z++){const P=S[z];if(P==="["?R++:P==="]"&&R>0?R--:P==="("?B++:P===")"&&B>0&&B--,R===0&&B===0&&(P===">"||P==="+"||P==="~"||P===" "))return S.slice(0,z)+D+S.slice(z)}return S+D}const Se=H.join(""),G=$e.join("");if(q)if(q.includes("&")){const S=q.indexOf("&"),D=q.slice(0,S),R=q.slice(S+1),B=E+Se,z=j;if(H.length===0)j=z.replace(E,D+B+G+R);else{const P=Ct(R,G);j=z.replace(E,D+B+P)}}else j=j.replace(E,`${q}${E+Se}`),G&&(j=j.replace(E,`${E}${G}`));else j=E+Se+G;j=j.replace(new RegExp(E,"g"),C);let W=`${j}{${L}}`;const _e=_.filter(S=>ge.includes(S)),Z=_e.length?_e[_e.length-1]:null,Me=_.includes("dark");return f&&Z?W=`@media (prefers-color-scheme: dark) and ${he[Z]}{${W}}`:f?W=`@media (prefers-color-scheme: dark){${W}}`:Me&&Z?W=`@media (prefers-color-scheme: dark) and ${he[Z]}{${W}}`:Me?W=`@media (prefers-color-scheme: dark){${W}}`:Z&&(W=`@media ${he[Z]}{${W}}`),W}for(const p of o){const f=d(p),g=f.find(v=>pe[v]||ye(v)||be(v)||me(v)||oe(v));if(!g)continue;const m=f.indexOf(g),h=m>=0?f.slice(0,m):[],w=y(h);if(w===4){const v=l(p,!0);v&&c.push(v)}else{const v=l(p);v&&(w===1?s.push(v):w===2?i.push(v):w===3&&a.push(v))}}const x=[...s,...i,...a,...c].join("");return Pe.set(e,{css:x,timestamp:t}),x}const X=[];function mt(e,t,r,n,o,s,i,a){if(e){X.push(r);try{if(t.loadingTemplate&&r.isLoading){J(e,t.loadingTemplate(r),r,n,o);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&J(e,t.errorTemplate(r.error,r),r,n,o);return}const c=t.render(r);if(c instanceof Promise){s(!0),c.then(u=>{s(!1),i(null),J(e,u,r,n,o),a(e.innerHTML)}).catch(u=>{s(!1),i(u),t.errorTemplate&&J(e,t.errorTemplate(u,r),r,n,o)}),t.loadingTemplate&&J(e,t.loadingTemplate(r),r,n,o);return}J(e,c,r,n,o),a(e.innerHTML)}finally{X.pop()}}}function J(e,t,r,n,o){e&&(ot(e,Array.isArray(t)?t:[t],r,n),o(e.innerHTML))}function bt(e,t,r,n,o,s,i){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(o(r+1),r>10){console.warn("Potential infinite render loop detected. Skipping render."),i(null);return}}else o(0);const c=setTimeout(()=>{n(Date.now()),e(),i(null)},0);i(c)}function vt(e,t,r,n,o,s){if(!e)return;const i=yt(n);if(!t.style&&(!i||i.trim()==="")){s(null),e.adoptedStyleSheets=[Le()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let c=it(`${a}
|
|
59
|
+
`,st={gray:{50:"var(--color-gray-50, #f9fafb)",100:"var(--color-gray-100, #f3f4f6)",200:"var(--color-gray-200, #e5e7eb)",300:"var(--color-gray-300, #d1d5db)",400:"var(--color-gray-400, #9ca3af)",500:"var(--color-gray-500, #6b7280)",600:"var(--color-gray-600, #4b5563)",700:"var(--color-gray-700, #374151)",800:"var(--color-gray-800, #1f2937)",900:"var(--color-gray-900, #111827)"},neutral:{50:"var(--color-neutral-50, #fafafa)",100:"var(--color-neutral-100, #f5f5f5)",200:"var(--color-neutral-200, #e5e5e5)",300:"var(--color-neutral-300, #d4d4d4)",400:"var(--color-neutral-400, #a3a3a3)",500:"var(--color-neutral-500, #737373)",600:"var(--color-neutral-600, #525252)",700:"var(--color-neutral-700, #404040)",800:"var(--color-neutral-800, #262626)",900:"var(--color-neutral-900, #171717)"},slate:{50:"var(--color-slate-50, #f8fafc)",100:"var(--color-slate-100, #f1f5f9)",200:"var(--color-slate-200, #e2e8f0)",300:"var(--color-slate-300, #cbd5e1)",400:"var(--color-slate-400, #94a3b8)",500:"var(--color-slate-500, #64748b)",600:"var(--color-slate-600, #475569)",700:"var(--color-slate-700, #334155)",800:"var(--color-slate-800, #1e293b)",900:"var(--color-slate-900, #0f172a)"},zinc:{50:"var(--color-zinc-50, #fafafa)",100:"var(--color-zinc-100, #f4f4f5)",200:"var(--color-zinc-200, #e4e4e7)",300:"var(--color-zinc-300, #d4d4d8)",400:"var(--color-zinc-400, #a1a1aa)",500:"var(--color-zinc-500, #71717a)",600:"var(--color-zinc-600, #52525b)",700:"var(--color-zinc-700, #3f3f46)",800:"var(--color-zinc-800, #27272a)",900:"var(--color-zinc-900, #18181b)"},red:{50:"var(--color-red-50, #fef2f2)",100:"var(--color-red-100, #fee2e2)",200:"var(--color-red-200, #fecaca)",300:"var(--color-red-300, #fca5a5)",400:"var(--color-red-400, #f87171)",500:"var(--color-red-500, #ef4444)",600:"var(--color-red-600, #dc2626)",700:"var(--color-red-700, #b91c1c)",800:"var(--color-red-800, #991b1b)",900:"var(--color-red-900, #7f1d1d)"},blue:{50:"var(--color-blue-50, #eff6ff)",100:"var(--color-blue-100, #dbeafe)",200:"var(--color-blue-200, #bfdbfe)",300:"var(--color-blue-300, #93c5fd)",400:"var(--color-blue-400, #60a5fa)",500:"var(--color-blue-500, #3b82f6)",600:"var(--color-blue-600, #2563eb)",700:"var(--color-blue-700, #1d4ed8)",800:"var(--color-blue-800, #1e40af)",900:"var(--color-blue-900, #1e3a8a)"},green:{50:"var(--color-green-50, #f0fdf4)",100:"var(--color-green-100, #dcfce7)",200:"var(--color-green-200, #bbf7d0)",300:"var(--color-green-300, #86efac)",400:"var(--color-green-400, #4ade80)",500:"var(--color-green-500, #22c55e)",600:"var(--color-green-600, #16a34a)",700:"var(--color-green-700, #15803d)",800:"var(--color-green-800, #166534)",900:"var(--color-green-900, #14532d)"},amber:{50:"var(--color-amber-50, #fffbeb)",100:"var(--color-amber-100, #fef3c7)",200:"var(--color-amber-200, #fde68a)",300:"var(--color-amber-300, #fcd34d)",400:"var(--color-amber-400, #fbbf24)",500:"var(--color-amber-500, #f59e0b)",600:"var(--color-amber-600, #d97706)",700:"var(--color-amber-700, #b45309)",800:"var(--color-amber-800, #92400e)",900:"var(--color-amber-900, #78350f)"},indigo:{50:"var(--color-indigo-50, #eef2ff)",100:"var(--color-indigo-100, #e0e7ff)",200:"var(--color-indigo-200, #c7d2fe)",300:"var(--color-indigo-300, #a5b4fc)",400:"var(--color-indigo-400, #818cf8)",500:"var(--color-indigo-500, #6366f1)",600:"var(--color-indigo-600, #4f46e5)",700:"var(--color-indigo-700, #4338ca)",800:"var(--color-indigo-800, #3730a3)",900:"var(--color-indigo-900, #312e81)"},emerald:{50:"var(--color-emerald-50, #ecfdf5)",100:"var(--color-emerald-100, #d1fae5)",200:"var(--color-emerald-200, #a7f3d0)",300:"var(--color-emerald-300, #6ee7b7)",400:"var(--color-emerald-400, #34d399)",500:"var(--color-emerald-500, #10b981)",600:"var(--color-emerald-600, #059669)",700:"var(--color-emerald-700, #047857)",800:"var(--color-emerald-800, #065f46)",900:"var(--color-emerald-900, #064e3b)"},rose:{50:"var(--color-rose-50, #fff1f2)",100:"var(--color-rose-100, #ffe4e6)",200:"var(--color-rose-200, #fecdd3)",300:"var(--color-rose-300, #fda4af)",400:"var(--color-rose-400, #fb7185)",500:"var(--color-rose-500, #f43f5e)",600:"var(--color-rose-600, #e11d48)",700:"var(--color-rose-700, #be123c)",800:"var(--color-rose-800, #9f1239)",900:"var(--color-rose-900, #881337)"},white:{DEFAULT:"var(--color-white, #ffffff)"},black:{DEFAULT:"var(--color-black, #000000)"}},fe={block:"display:block;",inline:"display:inline;","inline-block":"display:inline-block;",flex:"display:flex;","inline-flex":"display:inline-flex;",grid:"display:grid;",hidden:"display:none;","w-full":"width:100%;","w-screen":"width:100dvw;","h-full":"height:100%;","h-screen":"height:100dvw;","max-w-full":"max-width:100%;","max-h-full":"max-height:100%;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","m-auto":"margin:auto;","mx-auto":"margin-inline:auto;","my-auto":"margin-block:auto;","overflow-auto":"overflow:auto;","overflow-hidden":"overflow:hidden;","overflow-visible":"overflow:visible;","overflow-scroll":"overflow:scroll;","pointer-events-none":"pointer-events:none;","pointer-events-auto":"pointer-events:auto;","sr-only":"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;","not-sr-only":"position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;","grid-cols-1":"grid-template-columns:repeat(1,minmax(0,1fr));","grid-cols-2":"grid-template-columns:repeat(2,minmax(0,1fr));","grid-cols-3":"grid-template-columns:repeat(3,minmax(0,1fr));","grid-cols-4":"grid-template-columns:repeat(4,minmax(0,1fr));","grid-cols-5":"grid-template-columns:repeat(5,minmax(0,1fr));","grid-cols-6":"grid-template-columns:repeat(6,minmax(0,1fr));","grid-cols-12":"grid-template-columns:repeat(12,minmax(0,1fr));","grid-rows-1":"grid-template-rows:repeat(1,minmax(0,1fr));","grid-rows-2":"grid-template-rows:repeat(2,minmax(0,1fr));","grid-rows-3":"grid-template-rows:repeat(3,minmax(0,1fr));","grid-rows-4":"grid-template-rows:repeat(4,minmax(0,1fr));","grid-rows-6":"grid-template-rows:repeat(6,minmax(0,1fr));","grid-rows-12":"grid-template-rows:repeat(12,minmax(0,1fr));","col-span-1":"grid-column:span 1 / span 1;","col-span-2":"grid-column:span 2 / span 2;","col-span-3":"grid-column:span 3 / span 3;","col-span-4":"grid-column:span 4 / span 4;","col-span-5":"grid-column:span 5 / span 5;","col-span-6":"grid-column:span 6 / span 6;","col-span-12":"grid-column:span 12 / span 12;","row-span-1":"grid-row:span 1 / span 1;","row-span-2":"grid-row:span 2 / span 2;","row-span-3":"grid-row:span 3 / span 3;","row-span-4":"grid-row:span 4 / span 4;","row-span-6":"grid-row:span 6 / span 6;","row-span-12":"grid-row:span 12 / span 12;",absolute:"position:absolute;",relative:"position:relative;",fixed:"position:fixed;",sticky:"position:sticky;","font-bold":"font-weight:700;","font-semibold":"font-weight:600;","font-medium":"font-weight:500;","font-light":"font-weight:300;",underline:"text-decoration-line:underline;",overline:"text-decoration-line:overline;","line-through":"text-decoration-line:line-through;","no-underline":"text-decoration-line:none;",italic:"font-style:italic;","not-italic":"font-style:normal;",uppercase:"text-transform:uppercase;",lowercase:"text-transform:lowercase;",capitalize:"text-transform:capitalize;","normal-case":"text-transform:none;","text-left":"text-align:left;","text-center":"text-align:center;","text-right":"text-align:right;","text-xs":"font-size:0.75rem;line-height:calc(1 / 0.75)","text-sm":"font-size:0.875rem;line-height:calc(1.25 / 0.875)","text-base":"font-size:1rem;line-height:calc(1.5 / 1)","text-lg":"font-size:1.125rem;line-height:calc(1.75 / 1.125)","text-xl":"font-size:1.25rem;line-height:calc(1.75 / 1.25)","text-2xl":"font-size:1.5rem;line-height:calc(2 / 1.5)","text-3xl":"font-size:1.875rem;line-height:calc(2.25 / 1.875)","text-4xl":"font-size:2.25rem;line-height:calc(2.5 / 2.25)","text-5xl":"font-size:3rem;line-height:1","text-6xl":"font-size:3.75rem;line-height:1","text-7xl":"font-size:4.5rem;line-height:1","text-8xl":"font-size:6rem;line-height:1",border:"border-width:1px;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;",rounded:"border-radius:0.25rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-full":"border-radius:9999px;","ring-0":"box-shadow:none;","ring-1":"box-shadow:0 0 0 1px rgba(59,130,246,0.5);","ring-2":"box-shadow:0 0 0 2px rgba(59,130,246,0.5);","ring-4":"box-shadow:0 0 0 4px rgba(59,130,246,0.5);","ring-8":"box-shadow:0 0 0 8px rgba(59,130,246,0.5);","shadow-none":"box-shadow:0 0 #0000;","shadow-xs":"box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);","shadow-sm":"box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);","shadow-md":"box-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);","shadow-lg":"box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);","shadow-xl":"box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);","shadow-2xl":"box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",truncate:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",visible:"visibility:visible;",invisible:"visibility:hidden;","items-center":"align-items:center;","items-start":"align-items:flex-start;","items-end":"align-items:flex-end;","items-baseline":"align-items:baseline;","items-stretch":"align-items:stretch;","justify-center":"justify-content:center;","justify-start":"justify-content:flex-start;","justify-between":"justify-content:space-between;","justify-around":"justify-content:space-around;","justify-evenly":"justify-content:space-evenly;","justify-end":"justify-content:flex-end;","flex-wrap":"flex-wrap:wrap;","flex-nowrap":"flex-wrap:nowrap;","flex-wrap-reverse":"flex-wrap:wrap-reverse;","content-center":"align-content:center;","content-start":"align-content:flex-start;","content-end":"align-content:flex-end;","content-between":"align-content:space-between;","content-around":"align-content:space-around;","content-stretch":"align-content:stretch;","self-auto":"align-self:auto;","self-start":"align-self:flex-start;","self-end":"align-self:flex-end;","self-center":"align-self:center;","self-stretch":"align-self:stretch;","flex-1":"flex:1 1 0%;","flex-auto":"flex:1 1 auto;","flex-initial":"flex:0 1 auto;","flex-none":"flex:0 0 auto;","flex-col":"flex-direction:column;","flex-row":"flex-direction:row;",grow:"flex-grow:1;",shrink:"flex-shrink:1;","grow-0":"flex-grow:0;","shrink-0":"flex-shrink:0;","font-sans":"font-family:ui-sans-serif,system-ui,sans-serif;","font-serif":"font-family:ui-serif,Georgia,serif;","font-mono":"font-family:ui-monospace,SFMono-Regular,monospace;","line-clamp-1":"display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-2":"display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-3":"display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-4":"display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","z-0":"z-index:0;","z-10":"z-index:10;","z-20":"z-index:20;","z-30":"z-index:30;","z-40":"z-index:40;","z-50":"z-index:50;"},at="0.25rem",je={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]};function O(e,t){let r=0,o=0;for(let n=0;n<e.length;n++){const s=e[n];if(s==="[")r++;else if(s==="]"&&r>0)r--;else if(s==="(")o++;else if(s===")"&&o>0)o--;else if(r===0&&o===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,n)+t+e.slice(n)}return e+t}const ct={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${O(e,":hover")}{${t}}`,focus:(e,t)=>`${O(e,":focus")}{${t}}`,active:(e,t)=>`${O(e,":active")}{${t}}`,disabled:(e,t)=>`${O(e,":disabled")}{${t}}`,visited:(e,t)=>`${O(e,":visited")}{${t}}`,checked:(e,t)=>`${O(e,":checked")}{${t}}`,first:(e,t)=>`${O(e,":first-child")}{${t}}`,last:(e,t)=>`${O(e,":last-child")}{${t}}`,odd:(e,t)=>`${O(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${O(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${O(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${O(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},ue={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},de=["sm","md","lg","xl","2xl"];function pe(e){const t=e.startsWith("-"),o=(t?e.slice(1):e).split("-");if(o.length<2)return null;const n=o.slice(0,-1).join("-"),s=o[o.length-1],i=parseFloat(s);if(Number.isNaN(i)||!je[n])return null;const a=t?"-":"";return je[n].map(l=>`${l}:calc(${a}${at} * ${i});`).join("")}function Le(e){const t=e.replace("#",""),r=parseInt(t,16),o=r>>16&255,n=r>>8&255,s=r&255;return`${o} ${n} ${s}`}function lt(e){const t=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,o,n="DEFAULT"]=t,s=st[o]?.[n];return s?`${{bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",shadow:"box-shadow",outline:"outline-color",caret:"caret-color",accent:"accent-color",placeholder:"placeholder-color",fill:"fill-color",stroke:"stroke-color"}[r]}:${s};`:null}function ft(e){const[t,r]=e.split("/");if(!r)return{base:t};const o=parseInt(r,10);return isNaN(o)||o<0||o>100?{base:t}:{base:t,opacity:o/100}}function he(e){const{base:t,opacity:r}=ft(e),o=lt(t);if(o){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(o);if(s){const i=Le(s[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return o}const n=te(t);if(n&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const i=Le(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return n}function ge(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const r=parseInt(t[1],10);return r<0||r>100?null:`opacity:${r/100};`}function te(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const n=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(n){const s=n[1].trim();let i=n[2].trim();return i=i.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),i=i.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${i};`}return null}const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const o=e.slice(0,t);let n=e.slice(t+2,-1);n=n.replace(/_/g," ");const s={bg:"background-color",text:"color",p:"padding",px:"padding-inline",py:"padding-block",m:"margin",mx:"margin-inline",my:"margin-block",w:"width",h:"height","min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height","border-t":"border-top","border-b":"border-bottom","border-l":"border-left","border-r":"border-right","border-x":"border-inline","border-y":"border-block",shadow:"box-shadow",duration:"transition-duration",list:"list-style",break:"word-break",flex:"flex-direction",items:"align-items",justify:"justify-content",whitespace:"white-space",select:"user-select",content:"align-content",self:"align-self",basis:"flex-basis",tracking:"letter-spacing",scroll:"scroll-behavior",delay:"transition-delay",weight:"font-weight",leading:"line-height",z:"z-index"};if(o==="rotate")return`transform:rotate(${n});`;const i=s[o]??o.replace(/_/g,"-");if(i&&n)return`${i}:${n};`}return null}function ut(e){if(e.startsWith("[")&&e.endsWith("]")){const r=e.slice(1,-1);return r.includes("&")?r:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const r=e.slice(t+2,-1).replace(/_/g,"-");return r.includes("&")?r:e.replace(/_/g,"-")}return null}function dt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function pt(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let o;for(;o=t.exec(e);){const n=o[2].split(/\s+/).filter(Boolean);n.length&&r.push(...n)}return r.filter(Boolean)}const Re=new Map,ht=16;function gt(e){const t=Date.now(),r=Re.get(e);if(r&&t-r.timestamp<ht)return r.css;const o=pt(e),n=new Set(o),s=[],i=[],a=[],l=[],f={};function p(h,u=!1){const g=(u?"dark|":"")+h;if(g in f)return f[g];const b=w(h,u);return f[g]=b,b}function y(h){const u=h.some(b=>de.includes(b)),g=h.includes("dark");return h.length===0?1:!u&&!g?2:u&&!g?3:4}function c(h){const u=[];let g="",b=0,d=0;for(let v=0;v<h.length;v++){const m=h[v];m==="["?b++:m==="]"&&b>0?b--:m==="("?d++:m===")"&&d>0&&d--,m===":"&&b===0&&d===0?(u.push(g),g=""):g+=m}return g&&u.push(g),u}function x(h){switch(h){case"hover":return":hover";case"focus":return":focus";case"active":return":active";case"visited":return":visited";case"disabled":return":disabled";case"checked":return":checked";case"first":return":first-child";case"last":return":last-child";case"odd":return":nth-child(odd)";case"even":return":nth-child(even)";case"focus-within":return":focus-within";case"focus-visible":return":focus-visible";default:return null}}function w(h,u=!1){const g=c(h);(h.includes("mask-image")||h.includes("sm: hover")||h.includes("sm:hover")||h.includes("mask.svg"))&&console.error("DEBUG generateRule:",h,g);let b=!1,d=g.find(S=>(S.startsWith("!")&&(b=!0,S=S.slice(1)),fe[S]||pe(S)||ge(S)||he(S)||te(S)));if(!d)return null;const v=d.replace(/^!/,""),m=fe[v]??pe(v)??ge(v)??he(v)??te(v);if(!m)return null;const $=g.indexOf(d);let _=$>=0?g.slice(0,$):[];u&&(_=_.filter(S=>S!=="dark"));const C=`.${dt(h)}`,E="__SUBJECT__",L=b?m.replace(/;$/," !important;"):m;let T=E;const we=[];for(const S of _)S.startsWith("group-")?(T=`.group:${S.slice(6)} ${T}`,we.push(S)):S.startsWith("peer-")&&(T=T.replace(E,`.peer:${S.slice(5)}~${E}`),we.push(S));_=_.filter(S=>!we.includes(S));const xe=[],Pe=[];let q=null;for(const S of _){if(S==="dark"||de.includes(S))continue;const W=ut(S);if(W){q=W;continue}const R=x(S);if(R){q?Pe.push(R):xe.push(R);continue}const B=ct[S];typeof B=="function"&&(T=B(T,L).split("{")[0])}function _t(S,W){if(!W)return S;let R=0,B=0;if(S.length&&(S[0]===">"||S[0]==="+"||S[0]==="~"||S[0]===" ")){let j=1;for(;j<S.length&&S[j]===" ";)j++;for(;j<S.length;j++){const z=S[j];if(z==="["?R++:z==="]"&&R>0?R--:z==="("?B++:z===")"&&B>0&&B--,R===0&&B===0&&(S[j]===">"||S[j]==="+"||S[j]==="~"||S[j]===" "))return S.slice(0,j)+W+S.slice(j)}return S+W}for(let j=0;j<S.length;j++){const z=S[j];if(z==="["?R++:z==="]"&&R>0?R--:z==="("?B++:z===")"&&B>0&&B--,R===0&&B===0&&(z===">"||z==="+"||z==="~"||z===" "))return S.slice(0,j)+W+S.slice(j)}return S+W}const ke=xe.join(""),Y=Pe.join("");if(q)if(q.includes("&")){const S=q.indexOf("&"),W=q.slice(0,S),R=q.slice(S+1),B=E+ke,j=T;if(xe.length===0)T=j.replace(E,W+B+Y+R);else{const z=_t(R,Y);T=j.replace(E,W+B+z)}}else T=T.replace(E,`${q}${E+ke}`),Y&&(T=T.replace(E,`${E}${Y}`));else T=E+ke+Y;T=T.replace(new RegExp(E,"g"),C);let N=`${T}{${L}}`;const $e=_.filter(S=>de.includes(S)),V=$e.length?$e[$e.length-1]:null,Oe=_.includes("dark");return u&&V?N=`@media (prefers-color-scheme: dark) and ${ue[V]}{${N}}`:u?N=`@media (prefers-color-scheme: dark){${N}}`:Oe&&V?N=`@media (prefers-color-scheme: dark) and ${ue[V]}{${N}}`:Oe?N=`@media (prefers-color-scheme: dark){${N}}`:V&&(N=`@media ${ue[V]}{${N}}`),N}for(const h of n){const u=c(h),g=u.find(m=>fe[m]||pe(m)||ge(m)||he(m)||te(m));if(!g)continue;const b=u.indexOf(g),d=b>=0?u.slice(0,b):[],v=y(d);if(v===4){const m=p(h,!0);m&&l.push(m)}else{const m=p(h);m&&(v===1?s.push(m):v===2?i.push(m):v===3&&a.push(m))}}const k=[...s,...i,...a,...l].join("");return Re.set(e,{css:k,timestamp:t}),k}const Z=[];function yt(e,t,r,o,n,s,i,a){if(e){Z.push(r);try{if(t.loadingTemplate&&r.isLoading){U(e,t.loadingTemplate(r),r,o,n);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&U(e,t.errorTemplate(r.error,r),r,o,n);return}const l=t.render(r);if(l instanceof Promise){s(!0),l.then(f=>{s(!1),i(null),U(e,f,r,o,n),a(e.innerHTML)}).catch(f=>{s(!1),i(f),t.errorTemplate&&U(e,t.errorTemplate(f,r),r,o,n)}),t.loadingTemplate&&U(e,t.loadingTemplate(r),r,o,n);return}U(e,l,r,o,n),a(e.innerHTML)}finally{Z.pop()}}}function U(e,t,r,o,n){e&&(nt(e,Array.isArray(t)?t:[t],r,o),n(e.innerHTML))}function mt(e,t,r,o,n,s,i){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(n(r+1),r>10){console.warn("Potential infinite render loop detected. Skipping render."),i(null);return}}else n(0);const l=setTimeout(()=>{o(Date.now()),e(),i(null)},0);i(l)}function bt(e,t,r,o,n,s){if(!e)return;const i=gt(o);if(!t.style&&(!i||i.trim()==="")){s(null),e.adoptedStyleSheets=[Te()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let l=ot(`${a}
|
|
60
60
|
${i}
|
|
61
|
-
`);c=je(c);let u=o;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==c)&&u.replaceSync(c),e.adoptedStyleSheets=[Le(),u],s(u)}const ve=new Map;function we(e,t,r){let n=le(e);n.includes("-")||(n=`cer-${n}`);let o;if(typeof t=="function"?o={...r,render:t}:o=t,typeof o.onError!="function"&&(o.onError=(s,i)=>{console.error(`[${n}] Error:`,s,i)}),ve.set(n,o),typeof window<"u")if(!customElements.get(n))customElements.define(n,wt(n,o));else try{document.querySelectorAll(n).forEach(s=>{try{typeof s._cfg<"u"&&(s._cfg=o),typeof s._render=="function"&&s._render(o)}catch{}})}catch{}}function wt(e,t){if(!t.render)throw new Error("Component must have a render function");return typeof window>"u"?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_styleSheet=null;_lastHtmlStringForJitCSS="";get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.attachShadow({mode:"open"}),this._cfg=ve.get(e)||t;const r=this._initContext(t);Object.defineProperty(r,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),this.context=r,this._applyProps(t),Object.defineProperty(this.context,"emit",{value:(o,s,i)=>{const a=new CustomEvent(o,{detail:s,bubbles:!0,composed:!0,...i||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const n=ve.get(e)||t;Object.keys(n).forEach(o=>{const s=n[o];typeof s=="function"&&(this.context[o]=(...i)=>s(...i,this.context))}),this._applyComputed(n),this._initializing=!1,this._initWatchers(n),this._render(n)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Je(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Ze(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,n,o){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),Qe(t,r,n,o,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(le):[]}_applyComputed(r){this._runLogicWithinErrorBoundary(t,()=>{r.computed&&Object.entries(r.computed).forEach(([n,o])=>{Object.defineProperty(this.context,n,{get:()=>{const s=o(this.context);return ce(s)},enumerable:!0})})})}_render(r){this._runLogicWithinErrorBoundary(r,()=>{mt(this.shadowRoot,r,this.context,this._refs,n=>{this._lastHtmlStringForJitCSS=n,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(n)},n=>{this._templateLoading=n,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(n)},n=>{this._templateError=n,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(n)},n=>this._applyStyle(r,n))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{bt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})})}_applyStyle(r,n){this._runLogicWithinErrorBoundary(r,()=>{vt(this.shadowRoot,r,this.context,n,this._styleSheet,o=>{this._styleSheet=o})})}_runLogicWithinErrorBoundary(r,n){this._hasError&&(this._hasError=!1);try{n()}catch(o){this._hasError=!0,r.onError&&r.onError(o,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(o,this.context))}}_initContext(r){try{let n=function(s,i=""){return Array.isArray(s)?new Proxy(s,{get(a,c,u){const l=Reflect.get(a,c,u);return typeof l=="function"&&typeof c=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(c)?function(...d){const b=l.apply(a,d);if(!o._initializing){const k=i||"root";o._triggerWatchers(k,a),o._render(r)}return b}:l},set(a,c,u){if(a[c]=u,!o._initializing){const l=i?`${i}.${String(c)}`:String(c);o._triggerWatchers(l,u),o._render(r)}return!0},deleteProperty(a,c){if(delete a[c],!o._initializing){const u=i?`${i}.${String(c)}`:String(c);o._triggerWatchers(u,void 0),o._render(r)}return!0}}):s&&typeof s=="object"?(Object.keys(s).forEach(a=>{const c=i?`${i}.${a}`:a;s[a]=n(s[a],c)}),new Proxy(s,{set(a,c,u){const l=i?`${i}.${String(c)}`:String(c);return a[c]=n(u,l),o._initializing||(o._triggerWatchers(l,a[c]),o._render(r)),!0},get(a,c,u){return Reflect.get(a,c,u)}})):s};const o=this;return n({...r.state})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{Ue(this.context,this._watchers,r.watch||{})})}_triggerWatchers(r,n){Fe(this.context,this._watchers,r,n)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{Ve(this,r,this.context)}catch(n){this._hasError=!0,r.onError&&r.onError(n,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(n,this.context))}})}}}function Y(e,t={},r,n){const o=n??t.key;return{tag:e,key:o,props:t,children:r}}function ie(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function se(e){return typeof e=="object"&&e!==null&&"tag"in e&&!ie(e)}function xt(e,t){return e.key!=null?e:{...e,key:t}}function kt(e,t=[],r={}){const n={},o={},s={};function i(u,l,y){const d=typeof u=="function"?u:typeof y[u]=="function"?y[u]:void 0;if(typeof d!="function")return;const b=l.includes("prevent"),k=l.includes("stop"),x=l.includes("stopImmediate")||l.includes("stopImmediatePropagation"),p=l.includes("self"),f=l.includes("left"),g=l.includes("middle"),m=l.includes("right"),h=l.includes("ctrl")||l.includes("control"),w=l.includes("alt")||l.includes("option"),v=l.includes("shift"),$=l.includes("meta")||l.includes("cmd")||l.includes("command"),_={enter:"Enter",tab:"Tab",space:" ",spacebar:" ",esc:"Escape",escape:"Escape",del:"Delete",delete:"Delete",backspace:"Backspace",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",insert:"Insert",pause:"Pause"};let C=l.filter(A=>_[A]);(f||g||m)&&(C=C.filter(A=>A!=="left"&&A!=="middle"&&A!=="right"));const E=function(A){if(!((f||g||m)&&A instanceof MouseEvent&&(f&&A.button!==0||g&&A.button!==1||m&&A.button!==2))&&!(h&&!A.ctrlKey)&&!(w&&!A.altKey)&&!(v&&!A.shiftKey)&&!($&&!A.metaKey)){if(C.length>0){const H=A.key;if(!H||!C.some(q=>_[q]===H))return}if(!(p&&A.target!==A.currentTarget)){b&&A.preventDefault(),k&&A.stopPropagation(),x&&A.stopImmediatePropagation();try{return typeof u=="function"?u.call(void 0,A):d.call(y,A)}catch(H){throw H}}}},L={};return l.includes("once")&&(L.once=!0),l.includes("capture")&&(L.capture=!0),l.includes("passive")&&(L.passive=!0),Object.keys(L).length>0?{handler:E,options:L}:E}const a=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let c;for(;c=a.exec(e);){const u=c[1],l=c[2],y=(c[4]||c[6])??"",d=y.match(/^{{(\d+)}}$/);let b=d?t[Number(d[1])]??null:y;d||(b==="true"?b=!0:b==="false"?b=!1:b==="null"?b=null:isNaN(Number(b))||(b=Number(b)));const k=["model","bind","show","class","style"];if(u===":"){const[x,...p]=l.split(".");if(k.includes(x)){const f=[...p];s[x]={value:b,modifiers:f}}else o[l]=b}else if(u==="@"){const x=l.split("."),p=x[0],f=x.slice(1),g="on"+p.charAt(0).toUpperCase()+p.slice(1),m=i(b,f,r);m!==void 0&&(n[g]=m)}else l==="ref"?n.ref=b:o[l]=b}return{props:n,attrs:o,directives:s}}function $t(e,t,r){const n=X.length>0?X[X.length-1]:void 0,o=r??n;function s(h,w){return Y("#text",{},h,w)}let i="";for(let h=0;h<e.length;h++)i+=e[h],h<t.length&&(i+=`{{${h}}}`);const a=/<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,c=[];let u,l=[],y=null,d={},b,k=0,x=[];function p(h){!h||typeof h!="object"||ie(h)||(h.props||h.attrs?(h.props&&(d.props||(d.props={}),Object.assign(d.props,h.props)),h.attrs&&(d.attrs||(d.attrs={}),Object.keys(h.attrs).forEach(w=>{if(w==="style"&&d.attrs.style){const v=d.attrs.style.replace(/;?\s*$/,""),$=h.attrs.style.replace(/^;?\s*/,"");d.attrs.style=v+"; "+$}else if(w==="class"&&d.attrs.class){const v=d.attrs.class.trim().split(/\s+/).filter(Boolean),$=h.attrs.class.trim().split(/\s+/).filter(Boolean),_=[...new Set([...v,...$])];d.attrs.class=_.join(" ")}else d.attrs[w]=h.attrs[w]}))):(d.props||(d.props={}),Object.assign(d.props,h)))}function f(h,w){const v=y?l:x;if(ie(h)){const $=h.key??w;let _=h.children;v.push({...h,key:$,children:_});return}if(se(h)){v.push(xt(h,void 0));return}if(Array.isArray(h)){if(h.length===0)return;for(let $=0;$<h.length;$++){const _=h[$];ie(_)||se(_)||Array.isArray(_)?f(_,`${w}-${$}`):_!==null&&typeof _=="object"?p(_):v.push(s(String(_),`${w}-${$}`))}return}if(h!==null&&typeof h=="object"){p(h);return}v.push(s(String(h),w))}const g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;u=a.exec(i);)if(u[1]){const h=u[1],w=u[0][1]==="/",v=u[0][u[0].length-2]==="/"||g.has(h),{props:$,attrs:_,directives:C}=kt(u[2]||"",t,o),E={props:{},attrs:{}};for(const L in $)E.props[L]=$[L];for(const L in _)E.attrs[L]=_[L];if(Object.keys(C).length>0&&(E.directives={...C}),w){const L=Y(y,d,l.length===1&&se(l[0])&&l[0].tag==="#text"?typeof l[0].children=="string"?l[0].children:"":l.length?l:void 0,b),j=c.pop();j?(y=j.tag,d=j.props,b=j.key,l=j.children,l.push(L)):(x.push(L),y=null,d={},b=void 0,l=[])}else v?y?l.push(Y(h,E,void 0,void 0)):x.push(Y(h,E,void 0,void 0)):(y&&c.push({tag:y,props:d,children:l,key:b}),y=h,d=E,l=[])}else if(typeof u[3]<"u"){const h=Number(u[3]),w=t[h],v=`interp-${h}`;f(w,v)}else if(u[4]){const h=u[4],w=y?l:x,v=h.split(/({{\d+}})/);for(const $ of v){if(!$)continue;const _=$.match(/^{{(\d+)}}$/);if(_){const C=Number(_[1]),E=t[C],L=`interp-${C}`;f(E,L)}else{const C=`text-${k++}`;w.push(s($,C))}}}const m=x.filter(h=>se(h)&&h.tag==="#text"?typeof h.children=="string"&&h.children.trim()!=="":!0);return m.length===1?m[0]:m.length>1?m:Y("div",{},"","fallback-root")}function I(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return $t(e,t,n)}const xe=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},N=(e,t)=>{for(const r of e){const n=[],o=r.path.replace(/:[^/]+/g,a=>(n.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${o}$`),i=t.match(s);if(i){const a={};return n.forEach((c,u)=>{a[c]=i[u+1]}),{route:r,params:a}}}return{route:null,params:{}}},ke={};async function Be(e){if(e.component)return e.component;if(e.load){if(ke[e.path])return ke[e.path];try{const t=await e.load();return ke[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function Oe(e){const{routes:t,base:r="",initialUrl:n}=e;let o,s,i,a,c,u,l;const y=async(x,p)=>{const f=t.find(g=>N([g],x.path).route!==null);if(f?.beforeEnter)try{const g=await f.beforeEnter(x,p);return typeof g=="string"?(await k(g,!0),!1):g!==!1}catch(g){return console.error("beforeEnter error",g),!1}return!0},d=async(x,p)=>{const f=t.find(g=>N([g],x.path).route!==null);if(f?.onEnter)try{const g=await f.onEnter(x,p);return typeof g=="string"?(await k(g,!0),!1):g!==!1}catch(g){return console.error("onEnter error",g),!1}return!0},b=(x,p)=>{const f=t.find(g=>N([g],x.path).route!==null);if(f?.afterEnter)try{f.afterEnter(x,p)}catch(g){console.error("afterEnter error",g)}},k=async(x,p=!1)=>{try{const f={path:x.replace(r,"")||"/",query:{}},g=N(t,f.path);if(!g)throw new Error(`No route found for ${f.path}`);const m=i.getState(),h={path:f.path,params:g.params,query:f.query};if(!await y(h,m)||!await d(h,m))return;typeof window<"u"&&typeof document<"u"&&(p?window.history.replaceState({},"",r+x):window.history.pushState({},"",r+x)),i.setState(h),b(h,m)}catch(f){console.error("Navigation error:",f)}};if(typeof window<"u"&&typeof document<"u"){o=()=>{const p=new URL(window.location.href),f=p.pathname.replace(r,"")||"/",g=xe(p.search);return{path:f,query:g}},s=o();const x=N(t,s.path);i=ae({path:s.path,params:x.params,query:s.query}),a=async(p=!1)=>{const f=o();await k(f.path,p)},window.addEventListener("popstate",()=>a(!0)),c=p=>k(p,!1),u=p=>k(p,!0),l=()=>window.history.back()}else{o=()=>{const f=new URL(n||"/","http://localhost"),g=f.pathname.replace(r,"")||"/",m=xe(f.search);return{path:g,query:m}},s=o();const x=N(t,s.path);i=ae({path:s.path,params:x.params,query:s.query}),a=async()=>{const f=o();await p(f.path)};const p=async f=>{try{const g={path:f.replace(r,"")||"/",query:{}},m=N(t,g.path);if(!m)throw new Error(`No route found for ${g.path}`);const h=i.getState(),w={path:g.path,params:m.params,query:g.query},v=t.find($=>N([$],w.path).route!==null);if(v?.beforeEnter)try{const $=await v.beforeEnter(w,h);if(typeof $=="string"){await p($);return}if($===!1)return}catch{return}if(v?.onEnter)try{const $=await v.onEnter(w,h);if(typeof $=="string"){await p($);return}if($===!1)return}catch{return}if(i.setState(w),v?.afterEnter)try{v.afterEnter(w,h)}catch{}}catch{}};c=async f=>p(f),u=async f=>p(f),l=()=>{}}return{store:i,push:c,replace:u,back:l,subscribe:i.subscribe,matchRoute:x=>N(t,x),getCurrent:()=>i.getState(),resolveRouteComponent:Be}}function St(e,t){return N(e,t)}function _t(e){const t=Oe(e);return we("router-view",{async render(){if(!t)return I`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:n}=r,o=t.matchRoute(n);if(!o.route)return I`<div>Not found</div>`;try{const s=await t.resolveRouteComponent(o.route);if(typeof s=="string")return{tag:s,props:{},children:[]};if(typeof s=="function"){const i=s(),a=i instanceof Promise?await i:i;return typeof a=="string"?{tag:a,props:{},children:[]}:a}return I`<div>Invalid route component</div>`}catch{return I`<div>Invalid route component</div>`}},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),we("router-link",{state:{},props:{to:{type:String,default:""},tag:{type:String,default:"a"},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},activeClass:{type:String,default:"active"},exactActiveClass:{type:String,default:"exact-active"},ariaCurrentValue:{type:String,default:"page"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},class:{type:String,default:""},style:{type:String,default:de`
|
|
61
|
+
`);l=Ae(l);let f=n;f||(f=new CSSStyleSheet),(f.cssRules.length===0||f.toString()!==l)&&f.replaceSync(l),e.adoptedStyleSheets=[Te(),f],s(f)}const ye=new Map;function me(e,t,r){let o=ie(e);o.includes("-")||(o=`cer-${o}`);let n;typeof t=="function"?n={...r,render:t}:n=t,typeof n.onError!="function"&&(n.onError=(s,i)=>{console.error(`[${o}] Error:`,s,i)});try{const s=new Set(["refs","requestRender","error","hasError","isLoading","emit"]),i=[];if(n.state&&typeof n.state=="object"&&Object.keys(n.state).forEach(a=>{s.has(a)&&i.push(a)}),n.props&&typeof n.props=="object"&&Object.keys(n.props).forEach(a=>{s.has(a)&&i.push(a)}),n.computed&&typeof n.computed=="object"&&Object.keys(n.computed).forEach(a=>{s.has(a)&&i.push(a)}),i.length>0){const a=Array.from(new Set(i));console.warn(`[${o}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`)}}catch{}if(ye.set(o,n),typeof window<"u")if(!customElements.get(o))customElements.define(o,vt(o,n));else try{document.querySelectorAll(o).forEach(s=>{try{typeof s._cfg<"u"&&(s._cfg=n),typeof s._render=="function"&&s._render(n)}catch{}})}catch{}}function vt(e,t){if(!t.render)throw new Error("Component must have a render function");return typeof window>"u"?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_styleSheet=null;_lastHtmlStringForJitCSS="";get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.attachShadow({mode:"open"}),this._cfg=ye.get(e)||t;const r=this._initContext(t);Object.defineProperty(r,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),this.context=r,this._applyProps(t),Object.defineProperty(this.context,"emit",{value:(n,s,i)=>{const a=new CustomEvent(n,{detail:s,bubbles:!0,composed:!0,...i||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const o=ye.get(e)||t;Object.keys(o).forEach(n=>{const s=o[n];typeof s=="function"&&(this.context[n]=(...i)=>s(...i,this.context))}),this._applyComputed(o),this._initializing=!1,this._initWatchers(o),this._render(o)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Ve(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Je(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,o,n){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),Ze(t,r,o,n,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(ie):[]}_applyComputed(r){this._runLogicWithinErrorBoundary(t,()=>{r.computed&&Object.entries(r.computed).forEach(([o,n])=>{Object.defineProperty(this.context,o,{get:()=>{const s=n(this.context);return se(s)},enumerable:!0})})})}_render(r){this._runLogicWithinErrorBoundary(r,()=>{yt(this.shadowRoot,r,this.context,this._refs,o=>{this._lastHtmlStringForJitCSS=o,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(o)},o=>{this._templateLoading=o,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(o)},o=>{this._templateError=o,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(o)},o=>this._applyStyle(r,o))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{mt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})})}_applyStyle(r,o){this._runLogicWithinErrorBoundary(r,()=>{bt(this.shadowRoot,r,this.context,o,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(r,o){this._hasError&&(this._hasError=!1);try{o()}catch(n){this._hasError=!0,r.onError&&r.onError(n,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(n,this.context))}}_initContext(r){try{let o=function(s,i=""){return Array.isArray(s)?new Proxy(s,{get(a,l,f){const p=Reflect.get(a,l,f);return typeof p=="function"&&typeof l=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(l)?function(...c){const x=p.apply(a,c);if(!n._initializing){const w=i||"root";n._triggerWatchers(w,a),n._render(r)}return x}:p},set(a,l,f){if(a[l]=f,!n._initializing){const p=i?`${i}.${String(l)}`:String(l);n._triggerWatchers(p,f),n._render(r)}return!0},deleteProperty(a,l){if(delete a[l],!n._initializing){const f=i?`${i}.${String(l)}`:String(l);n._triggerWatchers(f,void 0),n._render(r)}return!0}}):s&&typeof s=="object"?(Object.keys(s).forEach(a=>{const l=i?`${i}.${a}`:a;s[a]=o(s[a],l)}),new Proxy(s,{set(a,l,f){const p=i?`${i}.${String(l)}`:String(l);return a[l]=o(f,p),n._initializing||(n._triggerWatchers(p,a[l]),n._render(r)),!0},get(a,l,f){return Reflect.get(a,l,f)}})):s};const n=this;return o({...r.state})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{Fe(this.context,this._watchers,r.watch||{})})}_triggerWatchers(r,o){Ke(this.context,this._watchers,r,o)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{Ue(this,r,this.context)}catch(o){this._hasError=!0,r.onError&&r.onError(o,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(o,this.context))}})}}}function Q(e,t={},r,o){const n=o??t.key;return{tag:e,key:n,props:t,children:r}}function re(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function ne(e){return typeof e=="object"&&e!==null&&"tag"in e&&!re(e)}function wt(e,t){return e.key!=null?e:{...e,key:t}}function xt(e,t=[],r={}){const o={},n={},s={},i=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let a;for(;a=i.exec(e);){const l=a[1],f=a[2],p=(a[4]||a[6])??"",y=p.match(/^{{(\d+)}}$/);let c=y?t[Number(y[1])]??null:p;y||(c==="true"?c=!0:c==="false"?c=!1:c==="null"?c=null:isNaN(Number(c))||(c=Number(c)));const x=["model","bind","show","class","style"];if(l===":"){const[w,...k]=f.split(".");if(x.includes(w)){const h=[...k];s[w]={value:c,modifiers:h}}else n[f]=c}else if(l==="@"){const w="on"+f.charAt(0).toUpperCase()+f.slice(1);o[w]=typeof c=="function"?c:typeof r[c]=="function"?r[c]:void 0}else f==="ref"?o.ref=c:n[f]=c}return{props:o,attrs:n,directives:s}}function kt(e,t,r){const o=Z.length>0?Z[Z.length-1]:void 0,n=r??o;function s(d,v){return Q("#text",{},d,v)}let i="";for(let d=0;d<e.length;d++)i+=e[d],d<t.length&&(i+=`{{${d}}}`);const a=/<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,l=[];let f,p=[],y=null,c={},x,w=0,k=[];function h(d){!d||typeof d!="object"||re(d)||(d.props||d.attrs?(d.props&&(c.props||(c.props={}),Object.assign(c.props,d.props)),d.attrs&&(c.attrs||(c.attrs={}),Object.keys(d.attrs).forEach(v=>{if(v==="style"&&c.attrs.style){const m=c.attrs.style.replace(/;?\s*$/,""),$=d.attrs.style.replace(/^;?\s*/,"");c.attrs.style=m+"; "+$}else if(v==="class"&&c.attrs.class){const m=c.attrs.class.trim().split(/\s+/).filter(Boolean),$=d.attrs.class.trim().split(/\s+/).filter(Boolean),_=[...new Set([...m,...$])];c.attrs.class=_.join(" ")}else c.attrs[v]=d.attrs[v]}))):(c.props||(c.props={}),Object.assign(c.props,d)))}function u(d,v){const m=y?p:k;if(re(d)){const $=d.key??v;let _=d.children;m.push({...d,key:$,children:_});return}if(ne(d)){m.push(wt(d,void 0));return}if(Array.isArray(d)){if(d.length===0)return;for(let $=0;$<d.length;$++){const _=d[$];re(_)||ne(_)||Array.isArray(_)?u(_,`${v}-${$}`):_!==null&&typeof _=="object"?h(_):m.push(s(String(_),`${v}-${$}`))}return}if(d!==null&&typeof d=="object"){h(d);return}m.push(s(String(d),v))}const g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;f=a.exec(i);)if(f[1]){const d=f[1],v=f[0][1]==="/",m=f[0][f[0].length-2]==="/"||g.has(d),{props:$,attrs:_,directives:C}=xt(f[2]||"",t,n),E={props:{},attrs:{}};for(const L in $)E.props[L]=$[L];for(const L in _)E.attrs[L]=_[L];if(Object.keys(C).length>0&&(E.directives={...C}),v){const L=Q(y,c,p.length===1&&ne(p[0])&&p[0].tag==="#text"?typeof p[0].children=="string"?p[0].children:"":p.length?p:void 0,x),T=l.pop();T?(y=T.tag,c=T.props,x=T.key,p=T.children,p.push(L)):(k.push(L),y=null,c={},x=void 0,p=[])}else m?y?p.push(Q(d,E,void 0,void 0)):k.push(Q(d,E,void 0,void 0)):(y&&l.push({tag:y,props:c,children:p,key:x}),y=d,c=E,p=[])}else if(typeof f[3]<"u"){const d=Number(f[3]),v=t[d],m=`interp-${d}`;u(v,m)}else if(f[4]){const d=f[4],v=y?p:k,m=d.split(/({{\d+}})/);for(const $ of m){if(!$)continue;const _=$.match(/^{{(\d+)}}$/);if(_){const C=Number(_[1]),E=t[C],L=`interp-${C}`;u(E,L)}else{const C=`text-${w++}`;v.push(s($,C))}}}const b=k.filter(d=>ne(d)&&d.tag==="#text"?typeof d.children=="string"&&d.children.trim()!=="":!0);return b.length===1?b[0]:b.length>1?b:Q("div",{},"","fallback-root")}function D(e,...t){const r=t[t.length-1],o=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return kt(e,t,o)}const be=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},M=(e,t)=>{for(const r of e){const o=[],n=r.path.replace(/:[^/]+/g,a=>(o.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${n}$`),i=t.match(s);if(i){const a={};return o.forEach((l,f)=>{a[l]=i[f+1]}),{route:r,params:a}}}return{route:null,params:{}}},ve={};async function ze(e){if(e.component)return e.component;if(e.load){if(ve[e.path])return ve[e.path];try{const t=await e.load();return ve[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function Be(e){const{routes:t,base:r="",initialUrl:o}=e;let n,s,i,a,l,f,p;const y=async(k,h)=>{const u=t.find(g=>M([g],k.path).route!==null);if(u?.beforeEnter)try{const g=await u.beforeEnter(k,h);return typeof g=="string"?(await w(g,!0),!1):g!==!1}catch(g){return console.error("beforeEnter error",g),!1}return!0},c=async(k,h)=>{const u=t.find(g=>M([g],k.path).route!==null);if(u?.onEnter)try{const g=await u.onEnter(k,h);return typeof g=="string"?(await w(g,!0),!1):g!==!1}catch(g){return console.error("onEnter error",g),!1}return!0},x=(k,h)=>{const u=t.find(g=>M([g],k.path).route!==null);if(u?.afterEnter)try{u.afterEnter(k,h)}catch(g){console.error("afterEnter error",g)}},w=async(k,h=!1)=>{try{const u={path:k.replace(r,"")||"/",query:{}},g=M(t,u.path);if(!g)throw new Error(`No route found for ${u.path}`);const b=i.getState(),d={path:u.path,params:g.params,query:u.query};if(!await y(d,b)||!await c(d,b))return;typeof window<"u"&&typeof document<"u"&&(h?window.history.replaceState({},"",r+k):window.history.pushState({},"",r+k)),i.setState(d),x(d,b)}catch(u){console.error("Navigation error:",u)}};if(typeof window<"u"&&typeof document<"u"){n=()=>{const h=new URL(window.location.href),u=h.pathname.replace(r,"")||"/",g=be(h.search);return{path:u,query:g}},s=n();const k=M(t,s.path);i=oe({path:s.path,params:k.params,query:s.query}),a=async(h=!1)=>{const u=n();await w(u.path,h)},window.addEventListener("popstate",()=>a(!0)),l=h=>w(h,!1),f=h=>w(h,!0),p=()=>window.history.back()}else{n=()=>{const u=new URL(o||"/","http://localhost"),g=u.pathname.replace(r,"")||"/",b=be(u.search);return{path:g,query:b}},s=n();const k=M(t,s.path);i=oe({path:s.path,params:k.params,query:s.query}),a=async()=>{const u=n();await h(u.path)};const h=async u=>{try{const g={path:u.replace(r,"")||"/",query:{}},b=M(t,g.path);if(!b)throw new Error(`No route found for ${g.path}`);const d=i.getState(),v={path:g.path,params:b.params,query:g.query},m=t.find($=>M([$],v.path).route!==null);if(m?.beforeEnter)try{const $=await m.beforeEnter(v,d);if(typeof $=="string"){await h($);return}if($===!1)return}catch{return}if(m?.onEnter)try{const $=await m.onEnter(v,d);if(typeof $=="string"){await h($);return}if($===!1)return}catch{return}if(i.setState(v),m?.afterEnter)try{m.afterEnter(v,d)}catch{}}catch{}};l=async u=>h(u),f=async u=>h(u),p=()=>{}}return{store:i,push:l,replace:f,back:p,subscribe:i.subscribe,matchRoute:k=>M(t,k),getCurrent:()=>i.getState(),resolveRouteComponent:ze}}function $t(e,t){return M(e,t)}function St(e){const t=Be(e);return me("router-view",{async render(){if(!t)return D`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:o}=r,n=t.matchRoute(o);if(!n.route)return D`<div>Not found</div>`;try{const s=await t.resolveRouteComponent(n.route);if(typeof s=="string")return{tag:s,props:{},children:[]};if(typeof s=="function"){const i=s(),a=i instanceof Promise?await i:i;return typeof a=="string"?{tag:a,props:{},children:[]}:a}return D`<div>Invalid route component</div>`}catch{return D`<div>Invalid route component</div>`}},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),me("router-link",{state:{},props:{to:{type:String,default:""},tag:{type:String,default:"a"},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},activeClass:{type:String,default:"active"},exactActiveClass:{type:String,default:"exact-active"},ariaCurrentValue:{type:String,default:"page"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},class:{type:String,default:""},style:{type:String,default:le`
|
|
62
62
|
[aria-disabled="true"] {
|
|
63
63
|
pointer-events: none;
|
|
64
64
|
opacity: 0.5;
|
|
65
65
|
}
|
|
66
|
-
`}},style:r=>r.style,render:r=>{const
|
|
67
|
-
${
|
|
66
|
+
`}},style:r=>r.style,render:r=>{const o=t.getCurrent(),n=r.to,s=r.exact,i=r.exactActiveClass,a=r.activeClass,l=r.ariaCurrentValue,f=r.tag,p=r.disabled,y=r.external,c=o.path===n,x=s?c:o&&typeof o.path=="string"?o.path.startsWith(n):!1,w=c?`aria-current="${l}"`:"",k=(r.class||"").split(/\s+/).filter(Boolean),h={};for(const v of k)h[v]=!0;const u={...h,[a]:x,[i]:c},g=f==="button",b=p?g?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",d=y&&(f==="a"||!f)?'target="_blank" rel="noopener noreferrer"':"";return D`
|
|
67
|
+
${Se().when(g,D`
|
|
68
68
|
<button
|
|
69
69
|
part="button"
|
|
70
|
-
:class="${
|
|
71
|
-
${
|
|
72
|
-
${
|
|
73
|
-
${
|
|
70
|
+
:class="${u}"
|
|
71
|
+
${w}
|
|
72
|
+
${b}
|
|
73
|
+
${d}
|
|
74
74
|
@click="navigate"
|
|
75
75
|
><slot></slot></button>
|
|
76
|
-
`).otherwise(
|
|
76
|
+
`).otherwise(D`
|
|
77
77
|
<a
|
|
78
78
|
part="link"
|
|
79
|
-
href="${
|
|
80
|
-
:class="${
|
|
81
|
-
${
|
|
82
|
-
${
|
|
83
|
-
${
|
|
79
|
+
href="${n}"
|
|
80
|
+
:class="${u}"
|
|
81
|
+
${w}
|
|
82
|
+
${b}
|
|
83
|
+
${d}
|
|
84
84
|
@click="navigate"
|
|
85
85
|
><slot></slot></a>
|
|
86
86
|
`).done()}
|
|
87
|
-
`},navigate:(r,
|
|
87
|
+
`},navigate:(r,o)=>{if(o.disabled){r.preventDefault();return}o.external&&(o.tag==="a"||!o.tag)||(r.preventDefault(),o.replace?t.replace(o.to):t.push(o.to))}}),t}A.GlobalEventBus=I,A.component=me,A.createStore=oe,A.css=le,A.each=Me,A.emit=We,A.eventBus=K,A.html=D,A.initRouter=St,A.listen=He,A.match=Se,A.matchRoute=M,A.matchRouteSSR=$t,A.off=qe,A.on=De,A.once=Ie,A.parseQuery=be,A.resolveRouteComponent=ze,A.useRouter=Be,A.when=J,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
|
|
88
88
|
//# sourceMappingURL=custom-elements-runtime.umd.js.map
|