@jasonshimmy/custom-elements-runtime 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements-runtime.cjs.js +14 -14
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +994 -940
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +14 -14
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/runtime/component.d.ts +8 -0
- package/dist/runtime/helpers.d.ts +8 -0
- package/dist/runtime/template-compiler.d.ts +1 -0
- package/dist/runtime/types.d.ts +7 -4
- package/dist/runtime/vdom.d.ts +2 -16
- package/dist/runtime/watchers.d.ts +0 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Oe(e,t){return te(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 te(t(r,o),`each-${n}`)})}function Te(){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[te(o,`whenChain-branch-${t}`)]}return[te([],"whenChain-empty")]}function te(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class q extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return q.instance||(q.instance=new q),q.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=q.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 pe(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 we(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function he(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:ge(e,o)}),i.immediate)try{const a=ge(e,o);s(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${o}":`,a)}}}function ge(e,t){return t.split(".").reduce((r,o)=>r?.[o],e)}function Ue(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=ge(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 Ke(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(we(n));i!==null?r[n]=he(o(i,s.type)):"default"in s&&s.default!==void 0&&(r[n]=he(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 I(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))I(r,t)}}function H(e,t){return typeof t=="string"?t.split(".").reduce((r,o)=>r?.[o],e):t}function Se(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 H(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=H(d,e);if(Array.isArray(b)&&Array.isArray(v)?JSON.stringify([...b].sort())!==JSON.stringify([...v].sort()):b!==v){const $=h.target;$._modelUpdating=!0,Se(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=H(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)),Se(v,e,d),s._requestRender&&s._requestRender())}},0)};n.compositionstart=h,n.compositionend=u}}function je(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=H(o,e);r[e]=n}}}function Xe(e,t,r){if(!r)return;const o=H(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=H(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=H(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 Le(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 ye(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=ye(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=ye(n,o)),{...r,key:o,children:n}}function tt(e,t,r,o){const n=r.directives??{},s=Le(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=je(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=Le(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(je(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 j=v.get(C.key);E=X(m.get(C.key),j,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=X(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=X(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)&&(I(x,n),e.removeChild(x))}function X(e,t,r,o,n){if(t&&typeof t!="string"&&t.props?.ref&&n&&I(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){I(e,n);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!t||typeof t=="string"){I(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}I(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=ye(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=X(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"&&(I(p,o),l.push(p))}l.forEach(f=>e.removeChild(f)),e._prevVNode=n,e._prevDom=a}function xe(e,...t){let r="";for(let o=0;o<e.length;o++)r+=e[o],o<t.length&&(r+=t[o]);return r}function Re(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let Q=null;function _e(){return Q||(Q=new CSSStyleSheet,Q.replaceSync(Re(it))),Q}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=xe`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Me(e,t){return ue(e?t:[],"when-block")}function We(e,t){return e.map((r,o)=>{const n=typeof r=="object"?r?.key??r?.id??`idx-${o}`:String(r);return ue(t(r,o),`each-${n}`)})}function Le(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return qe(...e)}}}function qe(...e){for(let t=0;t<e.length;t++){const[r,o]=e[t];if(r)return[ue(o,`whenChain-branch-${t}`)]}return[ue([],"whenChain-empty")]}function ue(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class V extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return V.instance||(V.instance=new V),V.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&&n.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const i=this.handlers[t];i&&i.forEach(s=>{try{s(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,i=>{n(),r(i),o(i)})})}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 Q=V.getInstance(),De=(e,t)=>Q.emit(e,t),Ie=(e,t)=>Q.on(e,t),He=(e,t)=>Q.off(e,t),Fe=(e,t)=>Q.once(e,t),Ke=(e,t,r)=>Q.listen(e,t,r);function ke(e){let t={...e};const r=[];function o(a){r.push(a),a(t)}function n(){return t}function i(a){const f=typeof a=="function"?a(t):a;t={...t,...f},s()}function s(){r.forEach(a=>a(t))}return{subscribe:o,getState:n,setState:i}}function Z(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function F(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function N(e,t){return typeof t=="string"?t.split(".").reduce((r,o)=>r?.[o],e):t}function se(e,t,r){const o=String(t).split("."),n=o.pop();if(!n)return;const i=o.reduce((s,a)=>(s[a]==null&&(s[a]={}),s[a]),e);i[n]=r}function Ue(e,t,r){if(r)for(const[o,n]of Object.entries(r)){let i,s={};if(Array.isArray(n)?(i=n[0],s=n[1]||{}):i=n,t.set(o,{callback:i,options:s,oldValue:N(e,o)}),s.immediate)try{const a=N(e,o);i(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${o}":`,a)}}}function Ve(e,t,r,o){const n=(s,a)=>{if(s===a)return!0;if(typeof s!=typeof a||typeof s!="object"||s===null||a===null)return!1;if(Array.isArray(s)&&Array.isArray(a))return s.length!==a.length?!1:s.every((d,m)=>n(d,a[m]));const f=Object.keys(s),u=Object.keys(a);return f.length!==u.length?!1:f.every(d=>n(s[d],a[d]))},i=t.get(r);if(i&&!n(o,i.oldValue))try{i.callback(o,i.oldValue,e),i.oldValue=o}catch(s){console.error(`Error in watcher for "${r}":`,s)}for(const[s,a]of t.entries())if(a.options.deep&&r.startsWith(s+"."))try{const f=N(e,s);n(f,a.oldValue)||(a.callback(f,a.oldValue,e),a.oldValue=f)}catch(f){console.error(`Error in deep watcher for "${s}":`,f)}}function Je(e,t,r){if(!t.props)return;function o(n,i){return i===Boolean?n==="true":i===Number?Number(n):n}Object.entries(t.props).forEach(([n,i])=>{if(i.type===Function&&typeof e[n]=="function")r[n]=e[n];else{const s=e.getAttribute(Z(n));s!==null?r[n]=F(o(s,i.type)):"default"in i&&i.default!==void 0&&(r[n]=F(i.default))}})}function Ze(e,t,r,o){e.onConnected&&!r&&(e.onConnected(t),o(!0))}function Ge(e,t,r,o,n,i,s,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(f=>f()),o(),n(),i(!1),s(null),a(!1)}function Ye(e,t,r,o,n){e.onAttributeChanged&&e.onAttributeChanged(t,r,o,n)}function J(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))J(r,t)}}function Qe(e,t,r,o,n,i,s,a){if(!i)return;const f=t.includes("lazy"),u=t.includes("trim"),d=t.includes("number"),m=()=>N(i._state||i,e),l=m();let h="text";s instanceof HTMLInputElement?h=o?.type||s.type||"text":s instanceof HTMLSelectElement?h="select":s instanceof HTMLTextAreaElement&&(h="textarea");const w=s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement,v=w?h==="checkbox"||h==="radio"?"checked":"value":a??"modelValue";if(h==="checkbox")if(Array.isArray(l))r[v]=l.includes(String(s?.getAttribute("value")??o?.value??""));else{const x=s?.getAttribute("true-value")??!0;r[v]=l===x}else if(h==="radio")r[v]=l===(o?.value??"");else if(h==="select")if(s&&s.hasAttribute("multiple")&&s instanceof HTMLSelectElement){const x=Array.isArray(l)?l.map(String):[];setTimeout(()=>{Array.from(s.options).forEach(c=>{c.selected=x.includes(c.value)})},0),r[v]=Array.isArray(l)?l:[]}else r[v]=l;else{r[v]=l;try{const x=Z(v);o&&(o[x]=l)}catch{}}const b=f||h==="checkbox"||h==="radio"||h==="select"?"change":"input",y=x=>{if(x.isComposing||n._isComposing||x.isTrusted===!1)return;const c=x.target;if(!c||c._modelUpdating)return;let g=c.value;if(h==="checkbox"){const C=m();if(Array.isArray(C)){const S=c.getAttribute("value")??"",A=Array.from(C);if(c.checked)A.includes(S)||A.push(S);else{const T=A.indexOf(S);T>-1&&A.splice(T,1)}g=A}else{const S=c.getAttribute("true-value")??!0,A=c.getAttribute("false-value")??!1;g=c.checked?S:A}}else if(h==="radio")g=c.getAttribute("value")??c.value;else if(h==="select"&&c.multiple)g=Array.from(c.selectedOptions).map(C=>C.value);else if(u&&typeof g=="string"&&(g=g.trim()),d){const C=Number(g);isNaN(C)||(g=C)}const p=i._state||i,_=N(p,e);if(Array.isArray(g)&&Array.isArray(_)?JSON.stringify([...g].sort())!==JSON.stringify([..._].sort()):g!==_){c._modelUpdating=!0;try{se(p,e,g),i._requestRender&&i._requestRender()}finally{setTimeout(()=>c._modelUpdating=!1,0)}}};w?n[b]=y:n[`update:${Z(v)}`]=x=>{const c=i._state||i,g=x.detail!==void 0?x.detail:x.target?.value,p=N(c,e);(Array.isArray(g)&&Array.isArray(p)?JSON.stringify([...g].sort())!==JSON.stringify([...p].sort()):g!==p)&&(se(c,e,g),i._requestRender&&i._requestRender())},(h==="text"||h==="textarea")&&(n.compositionstart=(()=>n._isComposing=!0),n.compositionend=x=>{n._isComposing=!1;const c=x.target;c&&setTimeout(()=>{const g=c.value,p=i._state||i,_=N(p,e);let E=g;if(u&&(E=E.trim()),d){const S=Number(E);isNaN(S)||(E=S)}if(Array.isArray(E)&&Array.isArray(_)?JSON.stringify([...E].sort())!==JSON.stringify([..._].sort()):E!==_){c._modelUpdating=!0;try{se(p,e,E),i._requestRender&&i._requestRender()}finally{setTimeout(()=>c._modelUpdating=!1,0)}}},0)})}function ze(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function Xe(e,t,r,o){if(o){if(typeof e=="object"&&e!==null)for(const[n,i]of Object.entries(e))t[n]=i;else if(typeof e=="string")try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){for(const[i,s]of Object.entries(n))t[i]=s;return}}catch{const n=N(o,e);r[e]=n}}}function et(e,t,r){if(!r)return;const o=N(r,e),n=t.style||"",i=o?"":"none";if(n){const s=n.split(";").filter(Boolean),a=s.findIndex(f=>f.trim().startsWith("display:"));a>=0?s[a]=`display: ${i}`:s.push(`display: ${i}`),t.style=s.join("; ")}else t.style=`display: ${i}`}function tt(e,t,r){if(!r)return;const o=N(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 i=t.class||"",s=i?`${i} ${n.join(" ")}`.trim():n.join(" ");s&&(t.class=s)}function rt(e,t,r){let o;if(typeof e=="string"){if(!r)return;o=N(r,e)}else o=e;let n="";if(typeof o=="string")n=o;else if(o&&typeof o=="object"){const s=[];for(const[a,f]of Object.entries(o))if(f!=null&&f!==""){const u=a.replace(/[A-Z]/g,l=>`-${l.toLowerCase()}`),d=["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 m=String(f);typeof f=="number"&&d.includes(u)&&(m=`${f}px`),s.push(`${u}: ${m}`)}n=s.join("; ")+(s.length>0?";":"")}const i=t.style||"";t.style=i+(i&&!i.endsWith(";")?"; ":"")+n}function Be(e,t,r,o){const n={},i={...o||{}},s={};for(const[a,f]of Object.entries(e)){const{value:u,modifiers:d,arg:m}=f;if(a==="model"||a.startsWith("model:")){const l=a.split(":"),h=l.length>1?l[1]:m;Qe(typeof u=="string"?u:String(u),d,n,i,s,t,r,h);continue}switch(a){case"bind":Xe(u,n,i,t);break;case"show":et(u,i,t);break;case"class":tt(u,i,t);break;case"style":rt(u,i,t);break}}return{props:n,attrs:i,listeners:s}}function $e(e,t){if(Array.isArray(e)){const i=new Set;return e.map(s=>{if(!s||typeof s!="object")return s;let a=s.props?.key??s.key;if(!a){const m=s.tag||"node",l=s.props?.attrs?.id??s.props?.attrs?.name??s.props?.attrs?.["data-key"]??"";a=l?`${t}:${m}:${l}`:`${t}:${m}`}let f=a,u=1;for(;i.has(f);)f=`${a}#${u++}`;i.add(f);let d=s.children;return Array.isArray(d)&&(d=$e(d,f)),{...s,key:f,children:d}})}const r=e;let o=r.props?.key??r.key??t,n=r.children;return Array.isArray(n)&&(n=$e(n,o)),{...r,key:o,children:n}}function nt(e,t,r,o){const n=r.directives??{},i=Be(n,o,e,r.attrs),s={...t.props,...r.props,...i.props},a={...t.attrs,...r.attrs,...i.attrs},f=t.props??{},u=s;for(const l in{...f,...u}){const h=f[l],w=u[l];if(h!==w){if(l==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==w&&(e.value=w??"");else if(l==="checked"&&e instanceof HTMLInputElement)e.checked=!!w;else if(l.startsWith("on")&&typeof w=="function"){const $=ze(l);typeof h=="function"&&e.removeEventListener($,h),e.addEventListener($,w)}else if(w==null||w===!1)e.removeAttribute(l);else if((r?.isCustomElement??t?.isCustomElement??!1)||l in e)try{e[l]=w}catch{}}}for(const[l,h]of Object.entries(i.listeners||{}))e.addEventListener(l,h);const d=t.attrs??{},m=a;for(const l in{...d,...m}){const h=d[l],w=m[l];h!==w&&(w==null||w===!1?e.removeAttribute(l):e.setAttribute(l,String(w)))}}function M(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const m=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(m.key=e.key),m}if(e.tag==="#anchor"){const m=e,l=Array.isArray(m.children)?m.children:[],h=document.createTextNode(""),w=document.createTextNode("");m.key!=null&&(h.key=`${m.key}:start`,w.key=`${m.key}:end`),m._startNode=h,m._endNode=w;const $=document.createDocumentFragment();$.appendChild(h);for(const v of l){const b=M(v,t);$.appendChild(b)}return $.appendChild(w),$}const o=document.createElement(e.tag);e.key!=null&&(o.key=e.key);const{props:n={},attrs:i={},directives:s={}}=e.props??{},a=Be(s,t,o,i),f={...n,...a.props},u={...i,...a.attrs};for(const m in u){const l=u[m];typeof m!="string"||/\[object Object\]/.test(m)||(typeof l=="boolean"?l&&o.setAttribute(m,""):l!=null&&o.setAttribute(m,l))}for(const m in f){const l=f[m];if(!(typeof m!="string"||/\[object Object\]/.test(m)))if(m==="value"&&(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement))o.value=l??"";else if(m==="checked"&&o instanceof HTMLInputElement)o.checked=!!l;else if(m.startsWith("on")&&typeof l=="function")o.addEventListener(ze(m),l);else{if(m.startsWith("on")&&l===void 0)continue;if(l==null||l===!1)o.removeAttribute(m);else if((e.props?.isCustomElement??!1)||m in o)try{o[m]=l}catch{}}}for(const[m,l]of Object.entries(a.listeners||{}))o.addEventListener(m,l);const d=e.props?.ref??(e.props?.props&&e.props.props.ref);typeof e!="string"&&d&&r&&(r[d]=o);try{if(typeof o._applyProps=="function")try{o._applyProps(o._cfg)}catch{}typeof o.requestRender=="function"?o.requestRender():typeof o._render=="function"&&o._render(o._cfg)}catch{}if(Array.isArray(e.children))for(const m of e.children)o.appendChild(M(m,t,r));else typeof e.children=="string"&&(o.textContent=e.children);return o}function ot(e,t,r,o,n){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const i=Array.from(e.childNodes),s=Array.isArray(t)?t:[],a=new Map;for(const h of s)h&&h.key!=null&&a.set(h.key,h);const f=new Map;for(const h of i){const w=h.key;w!=null&&f.set(w,h)}const u=new Set;let d=e.firstChild;function m(h,w){let $=h;for(;$&&(u.add($),$!==w);)$=$.nextSibling}function l(h,w,$,v){const b=[];let y=h.nextSibling;for(;y&&y!==w;)b.push(y),y=y.nextSibling;const x=Array.isArray($)?$:[];if(v.some(g=>g&&g.key!=null)||x.some(g=>g&&g.key!=null)){const g=new Map,p=new Map;for(const C of x)C&&C.key!=null&&g.set(C.key,C);for(const C of b){const S=C.key;S!=null&&p.set(S,C)}const _=new Set;let E=h.nextSibling;for(const C of v){let S;if(C.key!=null&&p.has(C.key)){const A=g.get(C.key);S=ae(p.get(C.key),A,C,o),_.add(S),S!==E&&e.contains(S)&&e.insertBefore(S,E)}else S=M(C,o),e.insertBefore(S,E),_.add(S);E=S.nextSibling}for(const C of b)!_.has(C)&&e.contains(C)&&e.removeChild(C)}else{const g=Math.min(x.length,v.length);for(let p=0;p<g;p++){const _=x[p],E=v[p],C=ae(b[p],_,E,o);C!==b[p]&&(e.insertBefore(C,b[p]),e.removeChild(b[p]))}for(let p=g;p<v.length;p++)e.insertBefore(M(v[p],o),w);for(let p=g;p<b.length;p++)e.removeChild(b[p])}}for(const h of r){let w;if(h.tag==="#anchor"){const $=h.key,v=`${$}:start`,b=`${$}:end`;let y=f.get(v),x=f.get(b);const c=Array.isArray(h.children)?h.children:[];if(y||(y=document.createTextNode(""),y.key=v),x||(x=document.createTextNode(""),x.key=b),h._startNode=y,h._endNode=x,!e.contains(y)||!e.contains(x)){e.insertBefore(y,d);for(const g of c)e.insertBefore(M(g,o),d);e.insertBefore(x,d)}else l(y,x,a.get($)?.children,c);m(y,x),d=x.nextSibling;continue}if(h.key!=null&&f.has(h.key)){const $=a.get(h.key);w=ae(f.get(h.key),$,h,o,n),u.add(w),w!==d&&e.contains(w)&&(d&&!e.contains(d)&&(d=null),e.insertBefore(w,d))}else w=M(h,o,n),d&&!e.contains(d)&&(d=null),e.insertBefore(w,d),u.add(w);d=w.nextSibling}for(const h of i)!u.has(h)&&e.contains(h)&&(J(h,n),e.removeChild(h))}function ae(e,t,r,o,n){if(t&&typeof t!="string"&&t.props?.ref&&n&&J(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 s=document.createTextNode(r);return e.parentNode?.replaceChild(s,e),s}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const s=r,a=Array.isArray(s.children)?s.children:[],f=s._startNode??document.createTextNode(""),u=s._endNode??document.createTextNode("");s.key!=null&&(f.key=`${s.key}:start`,u.key=`${s.key}:end`),s._startNode=f,s._endNode=u;const d=document.createDocumentFragment();d.appendChild(f);for(const m of a){const l=M(m,o);d.appendChild(l)}return d.appendChild(u),e.parentNode?.replaceChild(d,e),f}if(!r){J(e,n);const s=document.createComment("removed");return e.parentNode?.replaceChild(s,e),s}if(!t||typeof t=="string"){J(e,n);const s=M(r,o,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}if(r.tag==="#anchor"){const s=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),f=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,f.key=`${r.key}:end`),r._startNode=a,r._endNode=f;const u=document.createDocumentFragment();u.appendChild(a);for(const d of s)u.appendChild(M(d,o));return u.appendChild(f),e.parentNode?.replaceChild(u,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const s=e;return nt(s,t.props||{},r.props||{},o),ot(s,t.children,r.children,o,n),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=s),s}J(e,n);const i=M(r,o,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=i),e.parentNode?.replaceChild(i,e),i}function it(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=$e(n,String(n.key??"root"));const i=e._prevVNode??null,s=e._prevDom??e.firstChild??null;let a;i&&s?typeof i!="string"&&typeof n!="string"&&i.tag===n.tag&&i.key===n.key?a=ae(s,i,n,r,o):(a=M(n,r,o),e.replaceChild(a,s)):(a=M(n,r,o),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const f=[];for(let u=0;u<e.childNodes.length;u++){const d=e.childNodes[u];d!==a&&d.nodeName!=="STYLE"&&(J(d,o),f.push(d))}f.forEach(u=>e.removeChild(u)),e._prevVNode=n,e._prevDom=a}function le(e){if(typeof e=="string")return F(e);if(e.tag==="#text")return typeof e.children=="string"?F(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(le).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([n,i])=>` ${n}="${F(String(i))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([n])=>n!=="attrs"&&n!=="directives"&&n!=="ref"&&n!=="key").map(([n,i])=>` ${n}="${F(String(i))}"`).join(""));const o=Array.isArray(e.children)?e.children.filter(Boolean).map(le).join(""):typeof e.children=="string"?F(e.children):e.children?le(e.children):"";return`<${e.tag}${t}${r}>${o}</${e.tag}>`}function Ce(e,...t){let r="";for(let o=0;o<e.length;o++)r+=e[o],o<t.length&&(r+=t[o]);return r}function Oe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let oe=null;function Ee(){return oe||(oe=new CSSStyleSheet,oe.replaceSync(Oe(at))),oe}function st(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const at=Ce`
|
|
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
|
-
`,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)"},transparent:{DEFAULT:"var(--color-transparent, transparent)"},current:{DEFAULT:"var(--color-current, currentColor)"}},se={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;","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);",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:"transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;","transition-all":"transition-property:all;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-shadow":"transition-property:box-shadow;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","transition-none":"transition-property:none;","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",Ce={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 B(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)=>`${B(e,":hover")}{${t}}`,focus:(e,t)=>`${B(e,":focus")}{${t}}`,active:(e,t)=>`${B(e,":active")}{${t}}`,disabled:(e,t)=>`${B(e,":disabled")}{${t}}`,visited:(e,t)=>`${B(e,":visited")}{${t}}`,checked:(e,t)=>`${B(e,":checked")}{${t}}`,first:(e,t)=>`${B(e,":first-child")}{${t}}`,last:(e,t)=>`${B(e,":last-child")}{${t}}`,odd:(e,t)=>`${B(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${B(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${B(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${B(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}}`},ae={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)"},ce=["sm","md","lg","xl","2xl"];function le(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)||!Ce[n])return null;const a=t?"-":"";return Ce[n].map(l=>`${l}:calc(${a}${at} * ${i});`).join("")}function Ee(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 fe(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=Ee(s[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return o}const n=G(t);if(n&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const i=Ee(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return n}function ue(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 G(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",shadow:"box-shadow",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",transition:"transition-property",ease:"transition-timing-function",delay:"transition-delay",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",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 Ae=new Map,ht=16;function gt(e){const t=Date.now(),r=Ae.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=>ce.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;const d=g.find(S=>(S.startsWith("!")&&(b=!0,S=S.slice(1)),se[S]||le(S)||ue(S)||fe(S)||G(S)));if(!d)return null;const v=d.replace(/^!/,""),m=se[v]??le(v)??ue(v)??fe(v)??G(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__",j=b?m.replace(/;$/," !important;"):m;let A=E;const re=[];for(const S of _)S.startsWith("group-")?(A=`.group:${S.slice(6)} ${A}`,re.push(S)):S.startsWith("peer-")&&(A=A.replace(E,`.peer:${S.slice(5)}~${E}`),re.push(S));_=_.filter(S=>!re.includes(S));const ne=[],ke=[];let W=null;for(const S of _){if(S==="dark"||ce.includes(S))continue;const M=ut(S);if(M){W=M;continue}const L=x(S);if(L){W?ke.push(L):ne.push(L);continue}const z=ct[S];typeof z=="function"&&(A=z(A,j).split("{")[0])}function Pe(S,M){if(!M)return S;let L=0,z=0;if(S.length&&(S[0]===">"||S[0]==="+"||S[0]==="~"||S[0]===" ")){let T=1;for(;T<S.length&&S[T]===" ";)T++;for(;T<S.length;T++){const R=S[T];if(R==="["?L++:R==="]"&&L>0?L--:R==="("?z++:R===")"&&z>0&&z--,L===0&&z===0&&(S[T]===">"||S[T]==="+"||S[T]==="~"||S[T]===" "))return S.slice(0,T)+M+S.slice(T)}return S+M}for(let T=0;T<S.length;T++){const R=S[T];if(R==="["?L++:R==="]"&&L>0?L--:R==="("?z++:R===")"&&z>0&&z--,L===0&&z===0&&(R===">"||R==="+"||R==="~"||R===" "))return S.slice(0,T)+M+S.slice(T)}return S+M}const oe=ne.join(""),V=ke.join("");if(W)if(W.includes("&")){const S=W.indexOf("&"),M=W.slice(0,S),L=W.slice(S+1),z=E+oe,T=A;if(ne.length===0)A=T.replace(E,M+z+V+L);else{const R=Pe(L,V);A=T.replace(E,M+z+R)}}else A=A.replace(E,`${W}${E+oe}`),V&&(A=A.replace(E,`${E}${V}`));else A=E+oe+V;A=A.replace(new RegExp(E,"g"),C);let O=`${A}{${j}}`;const ie=_.filter(S=>ce.includes(S)),F=ie.length?ie[ie.length-1]:null,$e=_.includes("dark");return u&&F?O=`@media (prefers-color-scheme: dark) and ${ae[F]}{${O}}`:u?O=`@media (prefers-color-scheme: dark){${O}}`:$e&&F?O=`@media (prefers-color-scheme: dark) and ${ae[F]}{${O}}`:$e?O=`@media (prefers-color-scheme: dark){${O}}`:F&&(O=`@media ${ae[F]}{${O}}`),O}for(const h of n){const u=c(h),g=u.find(m=>se[m]||le(m)||ue(m)||fe(m)||G(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 Ae.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=[_e()];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
|
-
${
|
|
61
|
-
`);l=Re(l);let f=n;f||(f=new CSSStyleSheet),(f.cssRules.length===0||f.toString()!==l)&&f.replaceSync(l),e.adoptedStyleSheets=[_e(),f],s(f)}const me=new Map;function be(e,t,r){let o=we(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(me.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=me.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=me.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(we):[]}_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 he(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){Ue(this.context,this._watchers,r,o)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{Ke(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 J(e,t={},r,o){const n=o??t.key;return{tag:e,key:n,props:t,children:r}}function ee(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function Y(e){return typeof e=="object"&&e!==null&&"tag"in e&&!ee(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 J("#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"||ee(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(ee(d)){const $=d.key??v;let _=d.children;m.push({...d,key:$,children:_});return}if(Y(d)){m.push(wt(d,void 0));return}if(Array.isArray(d)){if(d.length===0)return;for(let $=0;$<d.length;$++){const _=d[$];ee(_)||Y(_)||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 j in $)E.props[j]=$[j];for(const j in _)E.attrs[j]=_[j];if(Object.keys(C).length>0&&(E.directives={...C}),v){const j=J(y,c,p.length===1&&Y(p[0])&&p[0].tag==="#text"?typeof p[0].children=="string"?p[0].children:"":p.length?p:void 0,x),A=l.pop();A?(y=A.tag,c=A.props,x=A.key,p=A.children,p.push(j)):(k.push(j),y=null,c={},x=void 0,p=[])}else m?y?p.push(J(d,E,void 0,void 0)):k.push(J(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],j=`interp-${C}`;u(E,j)}else{const C=`text-${w++}`;v.push(s($,C))}}}const b=k.filter(d=>Y(d)&&d.tag==="#text"?typeof d.children=="string"&&d.children.trim()!=="":!0);return b.length===1?b[0]:b.length>1?b:J("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 ve=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},N=(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:{}}},de={};async function ze(e){if(e.component)return e.component;if(e.load){if(de[e.path])return de[e.path];try{const t=await e.load();return de[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=>N([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=>N([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=>N([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=N(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=ve(h.search);return{path:u,query:g}},s=n();const k=N(t,s.path);i=pe({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=ve(u.search);return{path:g,query:b}},s=n();const k=N(t,s.path);i=pe({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=N(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($=>N([$],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=>N(t,k),getCurrent:()=>i.getState(),resolveRouteComponent:ze}}function $t(e,t){return N(e,t)}function St(e){const t=Be(e);return be("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()})}}),be("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:xe`
|
|
59
|
+
`,lt={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)"},transparent:{DEFAULT:"var(--color-transparent, transparent)"},current:{DEFAULT:"var(--color-current, currentColor)"}},ge={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;","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);",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:"transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;","transition-all":"transition-property:all;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-shadow":"transition-property:box-shadow;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","transition-none":"transition-property:none;","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;"},ct="0.25rem",Ae={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 P(e,t){let r=0,o=0;for(let n=0;n<e.length;n++){const i=e[n];if(i==="[")r++;else if(i==="]"&&r>0)r--;else if(i==="(")o++;else if(i===")"&&o>0)o--;else if(r===0&&o===0&&(i===">"||i==="+"||i==="~"||i===" "))return e.slice(0,n)+t+e.slice(n)}return e+t}const ft={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${P(e,":hover")}{${t}}`,focus:(e,t)=>`${P(e,":focus")}{${t}}`,active:(e,t)=>`${P(e,":active")}{${t}}`,disabled:(e,t)=>`${P(e,":disabled")}{${t}}`,visited:(e,t)=>`${P(e,":visited")}{${t}}`,checked:(e,t)=>`${P(e,":checked")}{${t}}`,first:(e,t)=>`${P(e,":first-child")}{${t}}`,last:(e,t)=>`${P(e,":last-child")}{${t}}`,odd:(e,t)=>`${P(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${P(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${P(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${P(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}}`},ye={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)"},me=["sm","md","lg","xl","2xl"];function be(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("-"),i=o[o.length-1],s=parseFloat(i);if(Number.isNaN(s)||!Ae[n])return null;const a=t?"-":"";return Ae[n].map(f=>`${f}:calc(${a}${ct} * ${s});`).join("")}function Te(e){const t=e.replace("#",""),r=parseInt(t,16),o=r>>16&255,n=r>>8&255,i=r&255;return`${o} ${n} ${i}`}function ut(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,i=lt[o]?.[n];return i?`${{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]}:${i};`:null}function dt(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 ve(e){const{base:t,opacity:r}=dt(e),o=ut(t);if(o){if(r!==void 0){const i=/#([0-9a-f]{6})/i.exec(o);if(i){const s=Te(i[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${s} / ${r})`)}}return o}const n=ce(t);if(n&&r!==void 0){const i=/#([0-9a-f]{6})/i.exec(n);if(i){const s=Te(i[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${s} / ${r})`)}}return n}function xe(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 ce(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 i=n[1].trim();let s=n[2].trim();return s=s.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),s=s.replace(/^'([^']*)'$/g,'"$1"'),`${i}:${s};`}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 i={bg:"background-color",text:"color",shadow:"box-shadow",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",transition:"transition-property",ease:"transition-timing-function",delay:"transition-delay",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",weight:"font-weight",leading:"line-height",z:"z-index"};if(o==="rotate")return`transform:rotate(${n});`;const s=i[o]??o.replace(/_/g,"-");if(s&&n)return`${s}:${n};`}return null}function pt(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 ht(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function gt(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 je=new Map,yt=16;function mt(e){const t=Date.now(),r=je.get(e);if(r&&t-r.timestamp<yt)return r.css;const o=gt(e),n=new Set(o),i=[],s=[],a=[],f=[],u={};function d(v,b=!1){const y=(b?"dark|":"")+v;if(y in u)return u[y];const x=w(v,b);return u[y]=x,x}function m(v){const b=v.some(x=>me.includes(x)),y=v.includes("dark");return v.length===0?1:!b&&!y?2:b&&!y?3:4}function l(v){const b=[];let y="",x=0,c=0;for(let g=0;g<v.length;g++){const p=v[g];p==="["?x++:p==="]"&&x>0?x--:p==="("?c++:p===")"&&c>0&&c--,p===":"&&x===0&&c===0?(b.push(y),y=""):y+=p}return y&&b.push(y),b}function h(v){switch(v){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(v,b=!1){const y=l(v);let x=!1;const c=y.find(k=>(k.startsWith("!")&&(x=!0,k=k.slice(1)),ge[k]||be(k)||xe(k)||ve(k)||ce(k)));if(!c)return null;const g=c.replace(/^!/,""),p=ge[g]??be(g)??xe(g)??ve(g)??ce(g);if(!p)return null;const _=y.indexOf(c);let E=_>=0?y.slice(0,_):[];b&&(E=E.filter(k=>k!=="dark"));const C=`.${ht(v)}`,S="__SUBJECT__",A=x?p.replace(/;$/," !important;"):p;let T=S;const X=[];for(const k of E)k.startsWith("group-")?(T=`.group:${k.slice(6)} ${T}`,X.push(k)):k.startsWith("peer-")&&(T=T.replace(S,`.peer:${k.slice(5)}~${S}`),X.push(k));E=E.filter(k=>!X.includes(k));const ee=[],pe=[];let q=null;for(const k of E){if(k==="dark"||me.includes(k))continue;const B=pt(k);if(B){q=B;continue}const z=h(k);if(z){q?pe.push(z):ee.push(z);continue}const O=ft[k];typeof O=="function"&&(T=O(T,A).split("{")[0])}function I(k,B){if(!B)return k;let z=0,O=0;if(k.length&&(k[0]===">"||k[0]==="+"||k[0]==="~"||k[0]===" ")){let j=1;for(;j<k.length&&k[j]===" ";)j++;for(;j<k.length;j++){const L=k[j];if(L==="["?z++:L==="]"&&z>0?z--:L==="("?O++:L===")"&&O>0&&O--,z===0&&O===0&&(k[j]===">"||k[j]==="+"||k[j]==="~"||k[j]===" "))return k.slice(0,j)+B+k.slice(j)}return k+B}for(let j=0;j<k.length;j++){const L=k[j];if(L==="["?z++:L==="]"&&z>0?z--:L==="("?O++:L===")"&&O>0&&O--,z===0&&O===0&&(L===">"||L==="+"||L==="~"||L===" "))return k.slice(0,j)+B+k.slice(j)}return k+B}const G=ee.join(""),K=pe.join("");if(q)if(q.includes("&")){const k=q.indexOf("&"),B=q.slice(0,k),z=q.slice(k+1),O=S+G,j=T;if(ee.length===0)T=j.replace(S,B+O+K+z);else{const L=I(z,K);T=j.replace(S,B+O+L)}}else T=T.replace(S,`${q}${S+G}`),K&&(T=T.replace(S,`${S}${K}`));else T=S+G+K;T=T.replace(new RegExp(S,"g"),C);let R=`${T}{${A}}`;const U=E.filter(k=>me.includes(k)),D=U.length?U[U.length-1]:null,ne=E.includes("dark");return b&&D?R=`@media (prefers-color-scheme: dark) and ${ye[D]}{${R}}`:b?R=`@media (prefers-color-scheme: dark){${R}}`:ne&&D?R=`@media (prefers-color-scheme: dark) and ${ye[D]}{${R}}`:ne?R=`@media (prefers-color-scheme: dark){${R}}`:D&&(R=`@media ${ye[D]}{${R}}`),R}for(const v of n){const b=l(v),y=b.find(p=>ge[p]||be(p)||xe(p)||ve(p)||ce(p));if(!y)continue;const x=b.indexOf(y),c=x>=0?b.slice(0,x):[],g=m(c);if(g===4){const p=d(v,!0);p&&f.push(p)}else{const p=d(v);p&&(g===1?i.push(p):g===2?s.push(p):g===3&&a.push(p))}}const $=[...i,...s,...a,...f].join("");return je.set(e,{css:$,timestamp:t}),$}const re=[];function bt(e,t,r,o,n,i,s,a){if(e){re.push(r);try{if(t.loadingTemplate&&r.isLoading){Y(e,t.loadingTemplate(r),r,o,n);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&Y(e,t.errorTemplate(r.error,r),r,o,n);return}const f=t.render(r);if(f instanceof Promise){i(!0),f.then(u=>{i(!1),s(null),Y(e,u,r,o,n),a(e.innerHTML)}).catch(u=>{i(!1),s(u),t.errorTemplate&&Y(e,t.errorTemplate(u,r),r,o,n)}),t.loadingTemplate&&Y(e,t.loadingTemplate(r),r,o,n);return}Y(e,f,r,o,n),a(e.innerHTML)}finally{re.pop()}}}function Y(e,t,r,o,n){e&&(it(e,Array.isArray(t)?t:[t],r,o),n(e.innerHTML))}function vt(e,t,r,o,n,i,s){if(i!==null&&clearTimeout(i),Date.now()-t<16){if(n(r+1),r>10){s(null);return}}else n(0);const f=setTimeout(()=>{o(Date.now()),e(),s(null)},0);s(f)}function xt(e,t,r,o,n,i){if(!e)return;const s=mt(o);if(!t.style&&(!s||s.trim()==="")){i(null),e.adoptedStyleSheets=[Ee()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let f=st(`${a}
|
|
60
|
+
${s}
|
|
61
|
+
`);f=Oe(f);let u=n;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==f)&&u.replaceSync(f),e.adoptedStyleSheets=[Ee(),u],i(u)}const de=new Map,Re=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[Re]||(e[Re]=de)}function _e(e,t,r){let o=Z(e);o.includes("-")||(o=`cer-${o}`);let n;typeof t=="function"?n={...r,render:t}:n=t,typeof n.onError!="function"&&(n.onError=(i,s)=>{console.error(`[${o}] Error:`,i,s)});try{const i=new Set(["refs","requestRender","error","hasError","isLoading","emit"]),s=[];if(n.state&&typeof n.state=="object"&&Object.keys(n.state).forEach(a=>{i.has(a)&&s.push(a)}),n.props&&typeof n.props=="object"&&Object.keys(n.props).forEach(a=>{i.has(a)&&s.push(a)}),n.computed&&typeof n.computed=="object"&&Object.keys(n.computed).forEach(a=>{i.has(a)&&s.push(a)}),s.length>0){const a=Array.from(new Set(s));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(de.set(o,n),typeof window<"u")if(!customElements.get(o))customElements.define(o,wt(o,n));else try{document.querySelectorAll(o).forEach(i=>{try{typeof i._cfg<"u"&&(i._cfg=n),typeof i._render=="function"&&i._render(n)}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=de.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,Object.defineProperty(this.context,"emit",{value:(n,i,s)=>{const a=new CustomEvent(n,{detail:i,bubbles:!0,composed:!0,...s||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const o=de.get(e)||t;Object.keys(o).forEach(n=>{const i=o[n];typeof i=="function"&&(this.context[n]=(...s)=>i(...s,this.context))}),this._applyComputed(o),this._initializing=!1,this._initWatchers(o),this._render(o)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),Ze(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Ge(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),Ye(t,r,o,n,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(Z):[]}_applyComputed(r){this._runLogicWithinErrorBoundary(t,()=>{r.computed&&Object.entries(r.computed).forEach(([o,n])=>{Object.defineProperty(this.context,o,{get:()=>{const i=n(this.context);return F(i)},enumerable:!0})})})}_render(r){this._runLogicWithinErrorBoundary(r,()=>{bt(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,()=>{vt(()=>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,()=>{xt(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(i,s=""){return Array.isArray(i)?new Proxy(i,{get(a,f,u){const d=Reflect.get(a,f,u);return typeof d=="function"&&typeof f=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(f)?function(...l){const h=d.apply(a,l);if(!n._initializing){const w=s||"root";n._triggerWatchers(w,a),n._render(r)}return h}:d},set(a,f,u){if(a[f]=u,!n._initializing){const d=s?`${s}.${String(f)}`:String(f);n._triggerWatchers(d,u),n._render(r)}return!0},deleteProperty(a,f){if(delete a[f],!n._initializing){const u=s?`${s}.${String(f)}`:String(f);n._triggerWatchers(u,void 0),n._render(r)}return!0}}):i&&typeof i=="object"?(Object.keys(i).forEach(a=>{const f=s?`${s}.${a}`:a;i[a]=o(i[a],f)}),new Proxy(i,{set(a,f,u){const d=s?`${s}.${String(f)}`:String(f);return a[f]=o(u,d),n._initializing||(n._triggerWatchers(d,a[f]),n._render(r)),!0},get(a,f,u){return Reflect.get(a,f,u)}})):i};const n=this;return o({...r.state})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{Ue(this.context,this._watchers,r.watch||{})})}_triggerWatchers(r,o){Ve(this.context,this._watchers,r,o)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{Je(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 te(e,t={},r,o){const n=o??t.key;return{tag:e,key:n,props:t,children:r}}function fe(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function ie(e){return typeof e=="object"&&e!==null&&"tag"in e&&!fe(e)}function kt(e,t){return e.key!=null?e:{...e,key:t}}function $t(e,t=[],r={}){const o={},n={},i={},s=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let a;for(;a=s.exec(e);){const f=a[1],u=a[2],d=(a[4]||a[6])??"",m=d.match(/^{{(\d+)}}$/);let l=m?t[Number(m[1])]??null:d;m||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const h=["model","bind","show","class","style"];if(f===":"){const[w,$]=u.split(":"),[v,...b]=w.split(".");if(h.includes(v)){const y=[...b],x=v==="model"&&$?`model:${$}`:v;i[x]={value:l,modifiers:y,arg:$}}else n[u]=l}else if(f==="@"){const w="on"+u.charAt(0).toUpperCase()+u.slice(1);o[w]=typeof l=="function"?l:typeof r[l]=="function"?r[l]:void 0}else u==="ref"?o.ref=l:n[u]=l}return{props:o,attrs:n,directives:i}}function _t(e,t,r){const o=re.length>0?re[re.length-1]:void 0,n=r??o;function i(c,g){return te("#text",{},c,g)}let s="";for(let c=0;c<e.length;c++)s+=e[c],c<t.length&&(s+=`{{${c}}}`);const a=/<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,f=[];let u,d=[],m=null,l={},h,w=0,$=[];function v(c){!c||typeof c!="object"||fe(c)||(c.props||c.attrs?(c.props&&(l.props||(l.props={}),Object.assign(l.props,c.props)),c.attrs&&(l.attrs||(l.attrs={}),Object.keys(c.attrs).forEach(g=>{if(g==="style"&&l.attrs.style){const p=l.attrs.style.replace(/;?\s*$/,""),_=c.attrs.style.replace(/^;?\s*/,"");l.attrs.style=p+"; "+_}else if(g==="class"&&l.attrs.class){const p=l.attrs.class.trim().split(/\s+/).filter(Boolean),_=c.attrs.class.trim().split(/\s+/).filter(Boolean),E=[...new Set([...p,..._])];l.attrs.class=E.join(" ")}else l.attrs[g]=c.attrs[g]}))):(l.props||(l.props={}),Object.assign(l.props,c)))}function b(c,g){const p=m?d:$;if(fe(c)){const _=c.key??g;let E=c.children;p.push({...c,key:_,children:E});return}if(ie(c)){p.push(kt(c,void 0));return}if(Array.isArray(c)){if(c.length===0)return;for(let _=0;_<c.length;_++){const E=c[_];fe(E)||ie(E)||Array.isArray(E)?b(E,`${g}-${_}`):E!==null&&typeof E=="object"?v(E):p.push(i(String(E),`${g}-${_}`))}return}if(c!==null&&typeof c=="object"){v(c);return}p.push(i(String(c),g))}const y=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;u=a.exec(s);)if(u[1]){const c=u[1],g=u[0][1]==="/",p=u[0][u[0].length-2]==="/"||y.has(c),{props:_,attrs:E,directives:C}=$t(u[2]||"",t,n),S={props:{},attrs:{}};for(const A in _)S.props[A]=_[A];for(const A in E)S.attrs[A]=E[A];if(C&&Object.keys(C).some(A=>A==="model"||A.startsWith("model:")))try{const A=Symbol.for("cer.registry"),T=globalThis[A],X=!!(T&&typeof T.has=="function"&&T.has(c)),ee=!!(n&&(n.__customElements instanceof Set&&n.__customElements.has(c)||Array.isArray(n.__isCustomElements)&&n.__isCustomElements.includes(c)));if(!!(c.includes("-")||ee||X))for(const I of Object.keys(C)){if(I!=="model"&&!I.startsWith("model:"))continue;const G=C[I],K=G.arg??(I.includes(":")?I.split(":",2)[1]:void 0),R=G.value,U=K??"modelValue",D=N,ne=se,k=n?n._state||n:void 0;let B;typeof R=="string"&&n?B=D(k,R):B=R,S.props[U]=B;try{const j=Z(U);S.attrs||(S.attrs={}),B!==void 0&&(S.attrs[j]=B)}catch{}S.isCustomElement=!0;const z=`update:${Z(U)}`,O="on"+z.charAt(0).toUpperCase()+z.slice(1);S.props[O]=function(j){const L=j.detail!==void 0?j.detail:j.target?j.target.value:void 0;if(!k)return;const he=D(k,typeof R=="string"?R:String(R));(Array.isArray(L)&&Array.isArray(he)?JSON.stringify([...L].sort())!==JSON.stringify([...he].sort()):L!==he)&&(ne(k,typeof R=="string"?R:String(R),L),n?.requestRender?n.requestRender():n?._requestRender&&n._requestRender())},delete C[I]}}catch{}if(Object.keys(C).length>0&&(S.directives={...C}),g){const A=te(m,l,d.length===1&&ie(d[0])&&d[0].tag==="#text"?typeof d[0].children=="string"?d[0].children:"":d.length?d:void 0,h),T=f.pop();T?(m=T.tag,l=T.props,h=T.key,d=T.children,d.push(A)):($.push(A),m=null,l={},h=void 0,d=[])}else p?m?d.push(te(c,S,void 0,void 0)):$.push(te(c,S,void 0,void 0)):(m&&f.push({tag:m,props:l,children:d,key:h}),m=c,l=S,d=[])}else if(typeof u[3]<"u"){const c=Number(u[3]),g=t[c],p=`interp-${c}`;b(g,p)}else if(u[4]){const c=u[4],g=m?d:$,p=c.split(/({{\d+}})/);for(const _ of p){if(!_)continue;const E=_.match(/^{{(\d+)}}$/);if(E){const C=Number(E[1]),S=t[C],A=`interp-${C}`;b(S,A)}else{const C=`text-${w++}`;g.push(i(_,C))}}}const x=$.filter(c=>ie(c)&&c.tag==="#text"?typeof c.children=="string"&&c.children.trim()!=="":!0);return x.length===1?x[0]:x.length>1?x:te("div",{},"","fallback-root")}function H(e,...t){const r=t[t.length-1],o=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return _t(e,t,o)}const Se=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},W=(e,t)=>{for(const r of e){const o=[],n=r.path.replace(/:[^/]+/g,a=>(o.push(a.slice(1)),"([^/]+)")),i=new RegExp(`^${n}$`),s=t.match(i);if(s){const a={};return o.forEach((f,u)=>{a[f]=s[u+1]}),{route:r,params:a}}}return{route:null,params:{}}},we={};async function Pe(e){if(e.component)return e.component;if(e.load){if(we[e.path])return we[e.path];try{const t=await e.load();return we[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 Ne(e){const{routes:t,base:r="",initialUrl:o}=e;let n,i,s,a,f,u,d;const m=async($,v)=>{const b=t.find(y=>W([y],$.path).route!==null);if(b?.beforeEnter)try{const y=await b.beforeEnter($,v);return typeof y=="string"?(await w(y,!0),!1):y!==!1}catch(y){return console.error("beforeEnter error",y),!1}return!0},l=async($,v)=>{const b=t.find(y=>W([y],$.path).route!==null);if(b?.onEnter)try{const y=await b.onEnter($,v);return typeof y=="string"?(await w(y,!0),!1):y!==!1}catch(y){return console.error("onEnter error",y),!1}return!0},h=($,v)=>{const b=t.find(y=>W([y],$.path).route!==null);if(b?.afterEnter)try{b.afterEnter($,v)}catch(y){console.error("afterEnter error",y)}},w=async($,v=!1)=>{try{const b={path:$.replace(r,"")||"/",query:{}},y=W(t,b.path);if(!y)throw new Error(`No route found for ${b.path}`);const x=s.getState(),c={path:b.path,params:y.params,query:b.query};if(!await m(c,x)||!await l(c,x))return;typeof window<"u"&&typeof document<"u"&&(v?window.history.replaceState({},"",r+$):window.history.pushState({},"",r+$)),s.setState(c),h(c,x)}catch(b){console.error("Navigation error:",b)}};if(typeof window<"u"&&typeof document<"u"){n=()=>{const v=new URL(window.location.href),b=v.pathname.replace(r,"")||"/",y=Se(v.search);return{path:b,query:y}},i=n();const $=W(t,i.path);s=ke({path:i.path,params:$.params,query:i.query}),a=async(v=!1)=>{const b=n();await w(b.path,v)},window.addEventListener("popstate",()=>a(!0)),f=v=>w(v,!1),u=v=>w(v,!0),d=()=>window.history.back()}else{n=()=>{const b=new URL(o||"/","http://localhost"),y=b.pathname.replace(r,"")||"/",x=Se(b.search);return{path:y,query:x}},i=n();const $=W(t,i.path);s=ke({path:i.path,params:$.params,query:i.query}),a=async()=>{const b=n();await v(b.path)};const v=async b=>{try{const y={path:b.replace(r,"")||"/",query:{}},x=W(t,y.path);if(!x)throw new Error(`No route found for ${y.path}`);const c=s.getState(),g={path:y.path,params:x.params,query:y.query},p=t.find(_=>W([_],g.path).route!==null);if(p?.beforeEnter)try{const _=await p.beforeEnter(g,c);if(typeof _=="string"){await v(_);return}if(_===!1)return}catch{return}if(p?.onEnter)try{const _=await p.onEnter(g,c);if(typeof _=="string"){await v(_);return}if(_===!1)return}catch{return}if(s.setState(g),p?.afterEnter)try{p.afterEnter(g,c)}catch{}}catch{}};f=async b=>v(b),u=async b=>v(b),d=()=>{}}return{store:s,push:f,replace:u,back:d,subscribe:s.subscribe,matchRoute:$=>W(t,$),getCurrent:()=>s.getState(),resolveRouteComponent:Pe}}function St(e,t){return W(e,t)}function Ct(e){const t=Ne(e);return _e("router-view",{async render(){if(!t)return H`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:o}=r,n=t.matchRoute(o);if(!n.route)return H`<div>Not found</div>`;try{const i=await t.resolveRouteComponent(n.route);if(typeof i=="string")return{tag:i,props:{},children:[]};if(typeof i=="function"){const s=i(),a=s instanceof Promise?await s:s;return typeof a=="string"?{tag:a,props:{},children:[]}:a}return H`<div>Invalid route component</div>`}catch{return H`<div>Invalid route component</div>`}},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),_e("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:Ce`
|
|
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 o=t.getCurrent(),n=r.to,
|
|
67
|
-
${
|
|
66
|
+
`}},style:r=>r.style,render:r=>{const o=t.getCurrent(),n=r.to,i=r.exact,s=r.exactActiveClass,a=r.activeClass,f=r.ariaCurrentValue,u=r.tag,d=r.disabled,m=r.external,l=o.path===n,h=i?l:o&&typeof o.path=="string"?o.path.startsWith(n):!1,w=l?`aria-current="${f}"`:"",$=(r.class||"").split(/\s+/).filter(Boolean),v={};for(const g of $)v[g]=!0;const b={...v,[a]:h,[s]:l},y=u==="button",x=d?y?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",c=m&&(u==="a"||!u)?'target="_blank" rel="noopener noreferrer"':"";return H`
|
|
67
|
+
${Le().when(y,H`
|
|
68
68
|
<button
|
|
69
69
|
part="button"
|
|
70
|
-
:class="${
|
|
70
|
+
:class="${b}"
|
|
71
71
|
${w}
|
|
72
|
-
${
|
|
73
|
-
${
|
|
72
|
+
${x}
|
|
73
|
+
${c}
|
|
74
74
|
@click="navigate"
|
|
75
75
|
><slot></slot></button>
|
|
76
|
-
`).otherwise(
|
|
76
|
+
`).otherwise(H`
|
|
77
77
|
<a
|
|
78
78
|
part="link"
|
|
79
79
|
href="${n}"
|
|
80
|
-
:class="${
|
|
80
|
+
:class="${b}"
|
|
81
81
|
${w}
|
|
82
|
-
${
|
|
83
|
-
${
|
|
82
|
+
${x}
|
|
83
|
+
${c}
|
|
84
84
|
@click="navigate"
|
|
85
85
|
><slot></slot></a>
|
|
86
86
|
`).done()}
|
|
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}exports.GlobalEventBus=
|
|
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}exports.GlobalEventBus=V;exports.component=_e;exports.createStore=ke;exports.css=Ce;exports.each=We;exports.emit=De;exports.eventBus=Q;exports.html=H;exports.initRouter=Ct;exports.listen=Ke;exports.match=Le;exports.matchRoute=W;exports.matchRouteSSR=St;exports.off=He;exports.on=Ie;exports.once=Fe;exports.parseQuery=Se;exports.renderToString=le;exports.resolveRouteComponent=Pe;exports.useRouter=Ne;exports.when=Me;
|
|
88
88
|
//# sourceMappingURL=custom-elements-runtime.cjs.js.map
|