@jasonshimmy/custom-elements-runtime 0.3.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -58
- package/dist/custom-elements-runtime.cjs.js +36 -30
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +2337 -1484
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +36 -30
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/runtime/component.d.ts +39 -2
- package/dist/runtime/event-manager.d.ts +58 -0
- package/dist/runtime/helpers.d.ts +19 -0
- package/dist/runtime/hooks.d.ts +113 -0
- package/dist/runtime/props.d.ts +13 -1
- package/dist/runtime/reactive-proxy-cache.d.ts +51 -0
- package/dist/runtime/reactive.d.ts +118 -0
- package/dist/runtime/render.d.ts +2 -2
- package/dist/runtime/secure-expression-evaluator.d.ts +30 -0
- package/dist/runtime/template-compiler.d.ts +4 -0
- package/dist/runtime/types.d.ts +2 -10
- package/dist/runtime/vdom.d.ts +10 -2
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
(function(j,Y){typeof exports=="object"&&typeof module<"u"?Y(exports):typeof define=="function"&&define.amd?define(["exports"],Y):(j=typeof globalThis<"u"?globalThis:j||self,Y(j.CustomElementsRuntime={}))})(this,(function(j){"use strict";function Y(e,t){return O(e?t:[],"when-block")}function Ye(e,t){return e.map((r,i)=>{const n=typeof r=="object"?r?.key??r?.id??`idx-${i}`:String(r);return O(t(r,i),`each-${n}`)})}function We(){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,i]=e[t];if(r)return[O(i,`whenChain-branch-${t}`)]}return[O([],"whenChain-empty")]}function O(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}function Xe(e,t){return Y(!e,t)}function et(e,t){const r=!e||e.length===0;return Y(r,t)}function tt(e,t){const r=!!(e&&e.length>0);return Y(r,t)}function rt(e,t,r){const i=[];return e.forEach((n,s)=>{t(n,s)&&i.push({item:n,originalIndex:s})}),i.map(({item:n,originalIndex:s},o)=>{const a=typeof n=="object"&&n!=null?n?.key??n?.id??`filtered-${s}`:`filtered-${s}`;return O(r(n,s,o),`each-where-${a}`)})}function nt(e,t){const r=e?.length??0;return r===0&&t.empty?O(t.empty,"switch-length-empty"):r===1&&t.one?O(t.one(e[0]),"switch-length-one"):t.exactly?.[r]?O(t.exactly[r](e),`switch-length-${r}`):r>1&&t.many?O(t.many(e),"switch-length-many"):O([],"switch-length-fallback")}function it(e,t,r){const i=new Map;return e.forEach(n=>{const s=t(n);i.has(s)||i.set(s,[]),i.get(s).push(n)}),Array.from(i.entries()).map(([n,s],o)=>O(r(n,s,o),`each-group-${n}`))}function st(e,t,r,i){const n=r*t,s=Math.min(n+t,e.length);return e.slice(n,s).map((a,c)=>{const u=n+c,m=typeof a=="object"&&a!=null?a?.key??a?.id??`page-${u}`:`page-${u}`;return O(i(a,u,c),`each-page-${m}`)})}function ot(e,t){return e.loading&&t.loading?O(t.loading,"promise-loading"):e.error&&t.error?O(t.error(e.error),"promise-error"):e.data!==void 0&&t.success?O(t.success(e.data),"promise-success"):t.idle?O(t.idle,"promise-idle"):O([],"promise-fallback")}function q(e,t){const r=typeof window<"u"&&window.matchMedia?.(e)?.matches;return Y(!!r,t)}const G={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)"},_e=["sm","md","lg","xl","2xl"],Ie={sm:e=>q(G.sm,e),md:e=>q(G.md,e),lg:e=>q(G.lg,e),xl:e=>q(G.xl,e),"2xl":e=>q(G["2xl"],e),dark:e=>q(G.dark,e),light:e=>q("(prefers-color-scheme: light)",e),touch:e=>q("(hover: none) and (pointer: coarse)",e),mouse:e=>q("(hover: hover) and (pointer: fine)",e),reducedMotion:e=>q("(prefers-reduced-motion: reduce)",e),highContrast:e=>q("(prefers-contrast: high)",e),portrait:e=>q("(orientation: portrait)",e),landscape:e=>q("(orientation: landscape)",e)};function at(e,t){const r=[];e.includes("dark")?r.push(G.dark):e.includes("light")&&r.push("(prefers-color-scheme: light)");const i=e.filter(o=>_e.includes(o)),n=i[i.length-1];n&&n in G&&r.push(G[n]);const s=r.length>0?r.join(" and "):"all";return q(s,t)}function ct(e){const t=[];return e.base&&t.push(O(e.base,"responsive-base")),_e.forEach(r=>{const i=e[r];i&&t.push(Ie[r](i))}),t}function lt(e){const t=[];let r=null;return{case(i,n){const s=typeof i=="function"?i:o=>o===i;return t.push({condition:s,content:n}),this},when(i,n){return t.push({condition:i,content:n}),this},otherwise(i){return r=i,this},done(){for(let i=0;i<t.length;i++){const{condition:n,content:s}=t[i];if(n(e))return O(s,`switch-case-${i}`)}return O(r||[],"switch-otherwise")}}}const qe=typeof process<"u"&&process.env?.NODE_ENV!=="production";function Q(e,...t){qe&&console.error(e,...t)}function de(e,...t){qe&&console.warn(e,...t)}class re extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return re.instance||(re.instance=new re),re.instance}emit(t,r){const i=Date.now(),n=this.eventCounters.get(t);if(!n||i-n.window>1e3)this.eventCounters.set(t,{count:1,window:i});else if(n.count++,n.count>50&&n.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(r)}catch(a){Q(`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 i=this.handlers[t];i&&i.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,i){return this.addEventListener(t,r,i),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(i=>{const n=this.on(t,s=>{n(),r(s),i(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,i]of this.eventCounters.entries())t[r]={count:i.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const se=re.getInstance(),ft=(e,t)=>se.emit(e,t),ut=(e,t)=>se.on(e,t),dt=(e,t)=>se.off(e,t),pt=(e,t)=>se.once(e,t),ht=(e,t,r)=>se.listen(e,t,r);function Ee(e){let t={...e};const r=[];function i(a){r.push(a),a(t)}function n(){return t}function s(a){const c=typeof a=="function"?a(t):a;t={...t,...c},o()}function o(){r.forEach(a=>a(t))}return{subscribe:i,getState:n,setState:s}}function X(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ee(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function K(e,t){return typeof t=="string"?t.split(".").reduce((r,i)=>r?.[i],e):t}function pe(e,t,r){const i=String(t).split("."),n=i.pop();if(!n)return;const s=i.reduce((o,a)=>(o[a]==null&&(o[a]={}),o[a]),e);s[n]=r}function gt(e,t,r){if(r)for(const[i,n]of Object.entries(r)){let s,o={};if(Array.isArray(n)?(s=n[0],o=n[1]||{}):s=n,t.set(i,{callback:s,options:o,oldValue:K(e,i)}),o.immediate)try{const a=K(e,i);s(a,void 0,e)}catch(a){Q(`Error in immediate watcher for "${i}":`,a)}}}function mt(e,t,r,i){const n=(o,a)=>{if(o===a)return!0;if(typeof o!=typeof a||typeof o!="object"||o===null||a===null)return!1;if(Array.isArray(o)&&Array.isArray(a))return o.length!==a.length?!1:o.every((m,T)=>n(m,a[T]));const c=Object.keys(o),u=Object.keys(a);return c.length!==u.length?!1:c.every(m=>n(o[m],a[m]))},s=t.get(r);if(s&&!n(i,s.oldValue))try{s.callback(i,s.oldValue,e),s.oldValue=i}catch(o){Q(`Error in watcher for "${r}":`,o)}for(const[o,a]of t.entries())if(a.options.deep&&r.startsWith(o+"."))try{const c=K(e,o);n(c,a.oldValue)||(a.callback(c,a.oldValue,e),a.oldValue=c)}catch(c){Q(`Error in deep watcher for "${o}":`,c)}}function yt(e,t,r){if(!t.props)return;function i(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 o=X(n),a=e.getAttribute(o);if(typeof e[n]<"u")try{const c=e[n];s.type===Boolean&&typeof c=="boolean"||s.type===Number&&typeof c=="number"||s.type===Function&&typeof c=="function"?r[n]=c:r[n]=ee(i(String(c),s.type))}catch{r[n]=e[n]}else a!==null?r[n]=ee(i(a,s.type)):"default"in s&&s.default!==void 0&&(r[n]=ee(s.default))}})}function bt(e,t,r,i){e.onConnected&&!r&&(e.onConnected(t),i(!0))}function wt(e,t,r,i,n,s,o,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(c=>c()),i(),n(),s(!1),o(null),a(!1)}function xt(e,t,r,i,n){e.onAttributeChanged&&e.onAttributeChanged(t,r,i,n)}function ne(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))ne(r,t)}}function vt(e,t,r,i,n,s,o,a){if(!s)return;const c=t.includes("lazy"),u=t.includes("trim"),m=t.includes("number"),T=()=>K(s._state||s,e),p=T();let l="text";o instanceof HTMLInputElement?l=i?.type||o.type||"text":o instanceof HTMLSelectElement?l="select":o instanceof HTMLTextAreaElement&&(l="textarea");const w=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,d=w?l==="checkbox"||l==="radio"?"checked":"value":a??"modelValue";if(l==="checkbox")if(Array.isArray(p))r[d]=p.includes(String(o?.getAttribute("value")??i?.value??""));else{const x=o?.getAttribute("true-value")??!0;r[d]=p===x}else if(l==="radio")r[d]=p===(i?.value??"");else if(l==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const x=Array.isArray(p)?p.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(f=>{f.selected=x.includes(f.value)})},0),r[d]=Array.isArray(p)?p:[]}else r[d]=p;else{r[d]=p;try{const x=X(d);i&&(i[x]=p)}catch{}}const g=c||l==="checkbox"||l==="radio"||l==="select"?"change":"input",y=x=>{if(x.isComposing||n._isComposing)return;const f=typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&window.__vitest__;if(x.isTrusted===!1&&!f)return;const b=x.target;if(!b||b._modelUpdating)return;let h=b.value;if(l==="checkbox"){const E=T();if(Array.isArray(E)){const C=b.getAttribute("value")??"",A=Array.from(E);if(b.checked)A.includes(C)||A.push(C);else{const M=A.indexOf(C);M>-1&&A.splice(M,1)}h=A}else{const C=b.getAttribute("true-value")??!0,A=b.getAttribute("false-value")??!1;h=b.checked?C:A}}else if(l==="radio")h=b.getAttribute("value")??b.value;else if(l==="select"&&b.multiple)h=Array.from(b.selectedOptions).map(E=>E.value);else if(u&&typeof h=="string"&&(h=h.trim()),m){const E=Number(h);isNaN(E)||(h=E)}const _=s._state||s,S=K(_,e);if(Array.isArray(h)&&Array.isArray(S)?JSON.stringify([...h].sort())!==JSON.stringify([...S].sort()):h!==S){b._modelUpdating=!0;try{if(pe(_,e,h),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,h),b){const E=`update:${X(d)}`,C=new CustomEvent(E,{detail:h,bubbles:!0,composed:!0});b.dispatchEvent(C)}}finally{setTimeout(()=>b._modelUpdating=!1,0)}}};if(w){if(n[g]){const x=n[g];o&&o.removeEventListener(g,x)}n[g]=y}else{const x=`update:${X(d)}`;if(n[x]){const f=n[x];o&&o.removeEventListener(x,f)}n[x]=f=>{const b=s._state||s,h=f.detail!==void 0?f.detail:f.target?.value,_=K(b,e);if(Array.isArray(h)&&Array.isArray(_)?JSON.stringify([...h].sort())!==JSON.stringify([..._].sort()):h!==_){pe(b,e,h),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,h);const $=f.target;if($){$[d]=h;try{const E=X(d);typeof h=="boolean"?h?$.setAttribute(E,"true"):$.setAttribute(E,"false"):$.setAttribute(E,String(h))}catch{}queueMicrotask(()=>{typeof $._applyProps=="function"&&$._applyProps($._cfg),typeof $._requestRender=="function"&&$._requestRender()})}}}}(l==="text"||l==="textarea")&&(n.compositionstart=(()=>n._isComposing=!0),n.compositionend=x=>{n._isComposing=!1;const f=x.target;f&&setTimeout(()=>{const b=f.value,h=s._state||s,_=K(h,e);let S=b;if(u&&(S=S.trim()),m){const E=Number(S);isNaN(E)||(S=E)}if(Array.isArray(S)&&Array.isArray(_)?JSON.stringify([...S].sort())!==JSON.stringify([..._].sort()):S!==_){f._modelUpdating=!0;try{pe(h,e,S),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,S)}finally{setTimeout(()=>f._modelUpdating=!1,0)}}},0)})}function ze(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function kt(e,t,r,i){if(typeof e=="object"&&e!==null)for(const[n,s]of Object.entries(e))n.startsWith("data-")||n.startsWith("aria-")||n==="class"?r[n]=s:t[n]=s;else if(typeof e=="string"){if(!i)return;try{const n=he(e,i);if(typeof n=="object"&&n!==null){for(const[s,o]of Object.entries(n))s.startsWith("data-")||s.startsWith("aria-")||s==="class"?r[s]=o:t[s]=o;return}else{r[e]=n;return}}catch{const n=K(i,e);r[e]=n}}}function _t(e,t,r){let i;if(typeof e=="string"){if(!r)return;i=he(e,r)}else i=e;const n=t.style||"";let s=n;if(i){if(n){const o=n.split(";").map(c=>c.trim()).filter(Boolean),a=o.findIndex(c=>c.startsWith("display:"));a>=0&&o[a]==="display: none"&&(o.splice(a,1),s=o.length>0?o.join("; ")+";":"")}}else if(n){const o=n.split(";").filter(Boolean),a=o.findIndex(c=>c.trim().startsWith("display:"));a>=0?o[a]="display: none":o.push("display: none"),s=o.join("; ")}else s="display: none";s!==n&&(s?t.style=s:delete t.style)}function he(e,t){if([/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i].some(i=>i.test(e))){de("Potentially dangerous expression blocked:",e);return}if(e.trim().startsWith("{")&&e.trim().endsWith("}"))try{const i=Object.keys(t),n=i.map(a=>t[a]),s=e.replace(/ctx\./g,"");if(s.length>1e3){de("Expression too long, blocked for security:",e);return}return new Function(...i,`return ${s}`)(...n)}catch(i){de("Failed to evaluate expression:",e,i);return}if(e.startsWith("ctx.")){const i=e.slice(4);return K(t,i)}return K(t,e)}function Et(e,t,r){let i;if(typeof e=="string"){if(!r)return;i=he(e,r)}else i=e;let n=[];typeof i=="string"?n=[i]:Array.isArray(i)?n=i.filter(Boolean):typeof i=="object"&&i!==null&&(n=Object.entries(i).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",o=s?`${s} ${n.join(" ")}`.trim():n.join(" ");o&&(t.class=o)}function St(e,t,r){let i;if(typeof e=="string"){if(!r)return;i=he(e,r)}else i=e;let n="";if(typeof i=="string")n=i;else if(i&&typeof i=="object"){const o=[];for(const[a,c]of Object.entries(i))if(c!=null&&c!==""){const u=a.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`),m=["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 T=String(c);typeof c=="number"&&m.includes(u)&&(T=`${c}px`),o.push(`${u}: ${T}`)}n=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+n}function He(e,t,r,i){const n={},s={...i||{}},o={};for(const[a,c]of Object.entries(e)){const{value:u,modifiers:m,arg:T}=c;if(a==="model"||a.startsWith("model:")){const p=a.split(":"),l=p.length>1?p[1]:T;vt(typeof u=="string"?u:String(u),m,n,s,o,t,r,l);continue}switch(a){case"bind":kt(u,n,s,t);break;case"show":_t(u,s,t);break;case"class":Et(u,s,t);break;case"style":St(u,s,t);break}}return{props:n,attrs:s,listeners:o}}function Se(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let a=o.props?.key??o.key;if(!a){const T=o.tag||"node",l=[o.props?.attrs?.id,o.props?.attrs?.name,o.props?.attrs?.["data-key"],o.props?.props?.id,o.props?.props?.name,o.props?.props?.dataKey,o.props?.props?.["data-key"]].find(w=>w!=null)??"";a=l?`${t}:${T}:${l}`:`${t}:${T}`}let c=a,u=1;for(;s.has(c);)c=`${a}#${u++}`;s.add(c);let m=o.children;return Array.isArray(m)&&(m=Se(m,c)),{...o,key:c,children:m}})}const r=e;let i=r.props?.key??r.key??t,n=r.children;return Array.isArray(n)&&(n=Se(n,i)),{...r,key:i,children:n}}function Ne(e,t,r,i){const n=r.directives??{},s=He(n,i,e,r.attrs),o={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},c=t.props??{},u=o,m=r?.isCustomElement??t?.isCustomElement??!1;let T=!1;for(const w in{...c,...u}){const v=c[w],d=u[w];if(v!==d)if(T=!0,w==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==d&&(e.value=d??"");else if(w==="checked"&&e instanceof HTMLInputElement)e.checked=!!d;else if(w.startsWith("on")&&typeof d=="function"){const g=ze(w);typeof v=="function"&&e.removeEventListener(g,v),e.addEventListener(g,d)}else if(d==null)e.removeAttribute(w);else if((r?.isCustomElement??t?.isCustomElement??!1)||w in e)try{e[w]=d}catch{}else d===!1&&e.removeAttribute(w)}for(const[w,v]of Object.entries(s.listeners||{}))e.addEventListener(w,v);const p=t.attrs??{},l=a;for(const w in{...p,...l}){const v=p[w],d=l[w];if(v!==d)if(T=!0,d==null||d===!1){if(e.removeAttribute(w),w==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)try{e.value=""}catch{}else if(e instanceof HTMLSelectElement)try{e.value=""}catch{}else if(e instanceof HTMLProgressElement)try{e.value=0}catch{}}if(w==="checked"&&e instanceof HTMLInputElement)try{e.checked=!1}catch{}if(w==="disabled")try{e.disabled=!1}catch{}}else{if(w==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){try{e.value=d??""}catch{e.setAttribute(w,String(d))}continue}else if(e instanceof HTMLSelectElement){try{e.value=d??""}catch{}continue}else if(e instanceof HTMLProgressElement){try{e.value=Number(d)}catch{}continue}}if(w==="checked"&&e instanceof HTMLInputElement){try{e.checked=!!d}catch{}continue}if(w==="style"){e.setAttribute(w,String(d));continue}if(!(e.namespaceURI==="http://www.w3.org/2000/svg")&&w in e)try{e[w]=d}catch{e.setAttribute(w,String(d))}else e.setAttribute(w,String(d))}}if(m&&T)try{if(typeof e._applyProps=="function")try{e._applyProps(e._cfg)}catch{}typeof e.requestRender=="function"?e.requestRender():typeof e._render=="function"&&e._render(e._cfg)}catch{}}function N(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const p=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(p.key=e.key),p}if(e.tag==="#anchor"){const p=e,l=Array.isArray(p.children)?p.children:[],w=document.createTextNode(""),v=document.createTextNode("");p.key!=null&&(w.key=`${p.key}:start`,v.key=`${p.key}:end`),p._startNode=w,p._endNode=v;const d=document.createDocumentFragment();d.appendChild(w);for(const g of l){const y=N(g,t);d.appendChild(y)}return d.appendChild(v),d}const i=document.createElement(e.tag);e.key!=null&&(i.key=e.key);const{props:n={},attrs:s={},directives:o={}}=e.props??{},a=He(o,t,i,s),c={...n,...a.props},u={...s,...a.attrs},m=i.namespaceURI==="http://www.w3.org/2000/svg";for(const p in u){const l=u[p];if(!(typeof p!="string"||/\[object Object\]/.test(p))){if(typeof l=="boolean")l&&i.setAttribute(p,"");else if(l!=null)if(!m&&p==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement||i instanceof HTMLProgressElement))try{i instanceof HTMLProgressElement?i.value=Number(l):i.value=l??""}catch{i.setAttribute(p,String(l))}else if(!m&&p==="checked"&&i instanceof HTMLInputElement)try{i.checked=!!l}catch{i.setAttribute(p,String(l))}else if(!m&&p in i)try{i[p]=l}catch{i.setAttribute(p,String(l))}else i.setAttribute(p,String(l))}}for(const p in c){const l=c[p];if(!(typeof p!="string"||/\[object Object\]/.test(p)))if(p==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement))i.value=l??"";else if(p==="checked"&&i instanceof HTMLInputElement)i.checked=!!l;else if(p.startsWith("on")&&typeof l=="function")i.addEventListener(ze(p),l);else{if(p.startsWith("on")&&l===void 0)continue;if(l==null||l===!1)i.removeAttribute(p);else if((e.props?.isCustomElement??!1)||p in i)try{i[p]=l}catch{}}}for(const[p,l]of Object.entries(a.listeners||{}))i.addEventListener(p,l);const T=e.props?.ref??(e.props?.props&&e.props.props.ref);typeof e!="string"&&T&&r&&(r[T]=i);try{if(typeof i._applyProps=="function")try{i._applyProps(i._cfg)}catch{}typeof i.requestRender=="function"?i.requestRender():typeof i._render=="function"&&i._render(i._cfg)}catch{}if(Array.isArray(e.children))for(const p of e.children)i.appendChild(N(p,t,r));else typeof e.children=="string"&&(i.textContent=e.children);try{if(i instanceof HTMLSelectElement&&u&&u.hasOwnProperty("value"))try{i.value=u.value??""}catch{}}catch{}return i}function $t(e,t,r,i,n){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],a=new Map;for(const l of o)l&&l.key!=null&&a.set(l.key,l);const c=new Map;for(const l of s){const w=l.key;w!=null&&c.set(w,l)}const u=new Set;let m=e.firstChild;function T(l,w){let v=l;for(;v&&(u.add(v),v!==w);)v=v.nextSibling}function p(l,w,v,d){const g=[];let y=l.nextSibling;for(;y&&y!==w;)g.push(y),y=y.nextSibling;const x=Array.isArray(v)?v:[];if(d.some(b=>b&&b.key!=null)||x.some(b=>b&&b.key!=null)){const b=new Map,h=new Map;for(const $ of x)$&&$.key!=null&&b.set($.key,$);for(const $ of g){const E=$.key;E!=null&&h.set(E,$)}const _=new Set;let S=l.nextSibling;for(const $ of d){let E;if($.key!=null&&h.has($.key)){const C=b.get($.key);E=ge(h.get($.key),C,$,i),_.add(E),E!==S&&e.contains(E)&&e.insertBefore(E,S)}else E=N($,i),e.insertBefore(E,S),_.add(E);S=E.nextSibling}for(const $ of g)!_.has($)&&e.contains($)&&e.removeChild($)}else{const b=Math.min(x.length,d.length);for(let h=0;h<b;h++){const _=x[h],S=d[h],$=ge(g[h],_,S,i);$!==g[h]&&(e.insertBefore($,g[h]),e.removeChild(g[h]))}for(let h=b;h<d.length;h++)e.insertBefore(N(d[h],i),w);for(let h=b;h<g.length;h++)e.removeChild(g[h])}}for(const l of r){let w;if(l.tag==="#anchor"){const v=l.key,d=`${v}:start`,g=`${v}:end`;let y=c.get(d),x=c.get(g);const f=Array.isArray(l.children)?l.children:[];if(y||(y=document.createTextNode(""),y.key=d),x||(x=document.createTextNode(""),x.key=g),l._startNode=y,l._endNode=x,!e.contains(y)||!e.contains(x)){e.insertBefore(y,m);for(const b of f)e.insertBefore(N(b,i),m);e.insertBefore(x,m)}else p(y,x,a.get(v)?.children,f);T(y,x),m=x.nextSibling;continue}if(l.key!=null&&c.has(l.key)){const v=a.get(l.key);w=ge(c.get(l.key),v,l,i,n),u.add(w),w!==m&&e.contains(w)&&(m&&!e.contains(m)&&(m=null),e.insertBefore(w,m))}else w=N(l,i,n),m&&!e.contains(m)&&(m=null),e.insertBefore(w,m),u.add(w);m=w.nextSibling}for(const l of s)!u.has(l)&&e.contains(l)&&(ne(l,n),e.removeChild(l))}function ge(e,t,r,i,n){if(t&&typeof t!="string"&&t.props?.ref&&n&&ne(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 o=document.createTextNode(r);return e.parentNode?.replaceChild(o,e),o}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const o=r,a=Array.isArray(o.children)?o.children:[],c=o._startNode??document.createTextNode(""),u=o._endNode??document.createTextNode("");o.key!=null&&(c.key=`${o.key}:start`,u.key=`${o.key}:end`),o._startNode=c,o._endNode=u;const m=document.createDocumentFragment();m.appendChild(c);for(const T of a){const p=N(T,i);m.appendChild(p)}return m.appendChild(u),e.parentNode?.replaceChild(m,e),c}if(!r){ne(e,n);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){ne(e,n);const o=N(r,i,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=o),e.parentNode?.replaceChild(o,e),o}if(r.tag==="#anchor"){const o=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),c=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,c.key=`${r.key}:end`),r._startNode=a,r._endNode=c;const u=document.createDocumentFragment();u.appendChild(a);for(const m of o)u.appendChild(N(m,i));return u.appendChild(c),e.parentNode?.replaceChild(u,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const o=e;return Ne(o,t.props||{},r.props||{},i),$t(o,t.children,r.children,i,n),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=o),o}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&(t.tag&&String(t.tag).includes("-")||r.props&&r.props.isCustomElement||t.props&&t.props.isCustomElement))try{const a=e;return Ne(a,t.props||{},r.props||{},i),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=a),a}catch{}ne(e,n);const s=N(r,i,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function Ct(e,t,r,i){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=Se(n,String(n.key??"root"));const s=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let a;s&&o?typeof s!="string"&&typeof n!="string"&&s.tag===n.tag&&s.key===n.key?a=ge(o,s,n,r,i):(a=N(n,r,i),e.replaceChild(a,o)):(a=N(n,r,i),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const c=[];for(let u=0;u<e.childNodes.length;u++){const m=e.childNodes[u];m!==a&&m.nodeName!=="STYLE"&&(ne(m,i),c.push(m))}c.forEach(u=>e.removeChild(u)),e._prevVNode=n,e._prevDom=a}function me(e){if(typeof e=="string")return ee(e);if(e.tag==="#text")return typeof e.children=="string"?ee(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(me).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([n,s])=>` ${n}="${ee(String(s))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([n])=>n!=="attrs"&&n!=="directives"&&n!=="ref"&&n!=="key").map(([n,s])=>` ${n}="${ee(String(s))}"`).join(""));const i=Array.isArray(e.children)?e.children.filter(Boolean).map(me).join(""):typeof e.children=="string"?ee(e.children):e.children?me(e.children):"";return`<${e.tag}${t}${r}>${i}</${e.tag}>`}function $e(e,...t){let r="";for(let i=0;i<e.length;i++)r+=e[i],i<t.length&&(r+=t[i]);return r}function De(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let ye=null;function Ue(){return ye||(ye=new CSSStyleSheet,ye.replaceSync(De(Tt))),ye}function At(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Tt=$e`
|
|
1
|
+
(function($,pe){typeof exports=="object"&&typeof module<"u"?pe(exports):typeof define=="function"&&define.amd?define(["exports"],pe):($=typeof globalThis<"u"?globalThis:$||self,pe($.CustomElementsRuntime={}))})(this,(function($){"use strict";class pe{pendingUpdates=new Map;isFlushScheduled=!1;schedule(t,n){const r=n||t.toString();this.pendingUpdates.set(r,t),this.isFlushScheduled||(this.isFlushScheduled=!0,typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&(window.__vitest__||window.Cypress)?this.flush():queueMicrotask(()=>this.flush()))}flush(){const t=Array.from(this.pendingUpdates.values());this.pendingUpdates.clear(),this.isFlushScheduled=!1;for(const n of t)try{n()}catch(r){typeof console<"u"&&console.error&&console.error("Error in batched update:",r)}}get pendingCount(){return this.pendingUpdates.size}}const gt=new pe;function fe(e,t){gt.schedule(e,t)}const Je=new WeakSet;class mt{static cache=new WeakMap;static arrayHandlerCache=new WeakMap;static objectHandlerCache=new WeakMap;static getOrCreateProxy(t,n,r=!1){const i=this.cache.get(t);if(i)return i;const s=r?this.getOrCreateArrayHandler(n):this.getOrCreateObjectHandler(n),o=new Proxy(t,s);try{Ze.markAsProxy(o)}catch{}return this.cache.set(t,o),o}static getOrCreateArrayHandler(t){if(!this.arrayHandlerCache.has(t)){const n={get:(r,i,s)=>{const o=Reflect.get(r,i,s);return typeof o=="function"&&typeof i=="string"&&["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].includes(i)?function(...u){const m=o.apply(r,u);return t.triggerUpdate(),m}:o},set:(r,i,s)=>(r[i]=t.makeReactiveValue(s),t.triggerUpdate(),!0),deleteProperty:(r,i)=>(delete r[i],t.triggerUpdate(),!0)};this.arrayHandlerCache.set(t,n)}return this.arrayHandlerCache.get(t)}static getOrCreateObjectHandler(t){if(!this.objectHandlerCache.has(t)){const n={get:(r,i,s)=>Reflect.get(r,i,s),set:(r,i,s)=>(r[i]=t.makeReactiveValue(s),t.triggerUpdate(),!0),deleteProperty:(r,i)=>(delete r[i],t.triggerUpdate(),!0)};this.objectHandlerCache.set(t,n)}return this.objectHandlerCache.get(t)}static hasProxy(t){return this.cache.has(t)}static clear(){this.cache=new WeakMap,this.arrayHandlerCache=new WeakMap,this.objectHandlerCache=new WeakMap}static getStats(){return{hasCachedProxies:this.cache instanceof WeakMap}}}class Ze{static contextCache=new WeakMap;static createReactiveProxy(t,n,r){try{if(Je.has(t))return t}catch{}const i=Array.isArray(t);let s=this.contextCache.get(n);s||(s=new WeakMap,this.contextCache.set(n,s));let o=s.get(r);return o||(o={triggerUpdate:n,makeReactiveValue:r},s.set(r,o)),mt.getOrCreateProxy(t,o,i)}static markAsProxy(t){if(t)try{Je.add(t)}catch{}}}class yt{currentComponent=null;componentDependencies=new Map;componentRenderFunctions=new Map;stateStorage=new Map;stateIndexCounter=new Map;trackingDisabled=!1;lastWarningTime=new Map;setCurrentComponent(t,n){this.currentComponent=t,this.componentRenderFunctions.set(t,n),this.componentDependencies.has(t)||this.componentDependencies.set(t,new Set),this.stateIndexCounter.set(t,0)}clearCurrentComponent(){this.currentComponent=null}disableTracking(){this.trackingDisabled=!0}enableTracking(){this.trackingDisabled=!1}isRenderingComponent(){return this.currentComponent!==null}shouldEmitRenderWarning(){if(!this.currentComponent)return!0;const t=this.currentComponent,n=this.lastWarningTime.get(t)||0,r=Date.now();return r-n<1e3?!1:(this.lastWarningTime.set(t,r),!0)}withoutTracking(t){const n=this.trackingDisabled;this.trackingDisabled=!0;try{return t()}finally{this.trackingDisabled=n}}getOrCreateState(t){if(!this.currentComponent)return new Pe(t);const n=this.currentComponent,r=this.stateIndexCounter.get(n)||0,i=`${n}:${r}`;if(this.stateIndexCounter.set(n,r+1),this.stateStorage.has(i))return this.stateStorage.get(i);const s=new Pe(t);return this.stateStorage.set(i,s),s}trackDependency(t){this.trackingDisabled||this.currentComponent&&(this.componentDependencies.get(this.currentComponent)?.add(t),t.addDependent(this.currentComponent))}triggerUpdate(t){t.getDependents().forEach(n=>{const r=this.componentRenderFunctions.get(n);r&&fe(r,n)})}cleanup(t){const n=this.componentDependencies.get(t);n&&(n.forEach(r=>r.removeDependent(t)),this.componentDependencies.delete(t)),this.componentRenderFunctions.delete(t);for(const r of Array.from(this.stateStorage.keys()))r.startsWith(t+":")&&this.stateStorage.delete(r);this.stateIndexCounter.delete(t)}}const q=new yt;class Pe{_value;dependents=new Set;constructor(t){this._value=this.makeReactive(t)}get value(){return q.trackDependency(this),this._value}set value(t){q.isRenderingComponent()&&q.shouldEmitRenderWarning()&&console.warn(`🚨 State modification detected during render! This can cause infinite loops.
|
|
2
|
+
• Move state updates to event handlers
|
|
3
|
+
• Use useEffect/watch for side effects
|
|
4
|
+
• Ensure computed properties don't modify state`),this._value=this.makeReactive(t),q.triggerUpdate(this)}addDependent(t){this.dependents.add(t)}removeDependent(t){this.dependents.delete(t)}getDependents(){return this.dependents}makeReactive(t){return t===null||typeof t!="object"||t instanceof Node||t instanceof Element||t instanceof HTMLElement?t:Ze.createReactiveProxy(t,()=>q.triggerUpdate(this),n=>this.makeReactive(n))}}function bt(e){return q.getOrCreateState(e===void 0?null:e)}function wt(e){const t=new Pe(e());return{get value(){return q.trackDependency(t),e()}}}function vt(e,t,n={}){let r=e();n.immediate&&t(r,r);const i=`watch-${Math.random().toString(36).substr(2,9)}`,s=()=>{q.setCurrentComponent(i,s);const o=e();q.clearCurrentComponent(),o!==r&&(t(o,r),r=o)};return q.setCurrentComponent(i,s),e(),q.clearCurrentComponent(),()=>{q.cleanup(i)}}const ve=new Map,xe=new Map,ke=new Map,Le=500;function ne(e){if(ve.has(e))return ve.get(e);const t=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return ve.size<Le&&ve.set(e,t),t}function Ge(e){if(xe.has(e))return xe.get(e);const t=e.replace(/-([a-z])/g,(n,r)=>r.toUpperCase());return xe.size<Le&&xe.set(e,t),t}function re(e){if(typeof e=="string"){if(ke.has(e))return ke.get(e);const t=e.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]);return t!==e&&ke.size<Le&&ke.set(e,t),t}return e}function B(e,t){if(typeof t=="string"){const n=t.split(".").reduce((r,i)=>r?.[i],e);return n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ReactiveState"?n.value:n}return t}function Ce(e,t,n){const r=String(t).split("."),i=r.pop();if(!i)return;const s=r.reduce((o,a)=>(o[a]==null&&(o[a]={}),o[a]),e);s[i]&&typeof s[i]=="object"&&s[i].constructor&&s[i].constructor.name==="ReactiveState"?s[i].value=n:s[i]=n}const Qe=typeof process<"u"&&process.env?.NODE_ENV!=="production";function ie(e,...t){Qe&&console.error(e,...t)}function je(e,...t){Qe&&console.warn(e,...t)}function xt(e,t,n){if(n)for(const[r,i]of Object.entries(n)){let s,o={};if(Array.isArray(i)?(s=i[0],o=i[1]||{}):s=i,t.set(r,{callback:s,options:o,oldValue:B(e,r)}),o.immediate)try{const a=B(e,r);s(a,void 0,e)}catch(a){ie(`Error in immediate watcher for "${r}":`,a)}}}function kt(e,t,n,r){const i=(o,a)=>{if(o===a)return!0;if(typeof o!=typeof a||typeof o!="object"||o===null||a===null)return!1;if(Array.isArray(o)&&Array.isArray(a))return o.length!==a.length?!1:o.every((g,w)=>i(g,a[w]));const u=Object.keys(o),m=Object.keys(a);return u.length!==m.length?!1:u.every(g=>i(o[g],a[g]))},s=t.get(n);if(s&&!i(r,s.oldValue))try{s.callback(r,s.oldValue,e),s.oldValue=r}catch(o){ie(`Error in watcher for "${n}":`,o)}for(const[o,a]of t.entries())if(a.options.deep&&n.startsWith(o+"."))try{const u=B(e,o);i(u,a.oldValue)||(a.callback(u,a.oldValue,e),a.oldValue=u)}catch(u){ie(`Error in deep watcher for "${o}":`,u)}}function Xe(e,t){return t===Boolean?e==="true":t===Number?Number(e):e}function Ct(e,t,n){t&&Object.entries(t).forEach(([r,i])=>{const s=ne(r),o=e.getAttribute(s);if(i.type===Function&&typeof e[r]=="function")n[r]=e[r];else if(typeof e[r]<"u")try{const a=e[r];i.type===Boolean&&typeof a=="boolean"||i.type===Number&&typeof a=="number"||i.type===Function&&typeof a=="function"?n[r]=a:n[r]=re(Xe(String(a),i.type))}catch{n[r]=e[r]}else o!==null?n[r]=re(Xe(o,i.type)):"default"in i&&i.default!==void 0&&(n[r]=re(i.default))})}function _t(e,t,n){t.props&&Ct(e,t.props,n)}function Et(e,t,n,r){e.onConnected&&!n&&(e.onConnected(t),r(!0))}function St(e,t,n,r,i,s,o,a){e.onDisconnected&&e.onDisconnected(t),n.forEach(u=>u()),r(),i(),s(!1),o(null),a(!1)}function $t(e,t,n,r,i){e.onAttributeChanged&&e.onAttributeChanged(t,n,r,i)}class At{static cache=new Map;static maxCacheSize=1e3;static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i,/setTimeout/i,/setInterval/i,/fetch/i,/XMLHttpRequest/i];static evaluate(t,n){const r=this.cache.get(t);if(r){if(!r.isSecure){je("Blocked cached dangerous expression:",t);return}return r.evaluator(n)}const i=this.createEvaluator(t);if(this.cache.size>=this.maxCacheSize){const s=this.cache.keys().next().value;s&&this.cache.delete(s)}if(this.cache.set(t,i),!i.isSecure){je("Blocked dangerous expression:",t);return}return i.evaluator(n)}static createEvaluator(t){if(this.hasDangerousPatterns(t))return{evaluator:()=>{},isSecure:!1};if(t.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(t),isSecure:!0}}catch(n){return je("Failed to create evaluator for expression:",t,n),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(t){return this.dangerousPatterns.some(n=>n.test(t))}static createSafeEvaluator(t){if(t.trim().startsWith("{")&&t.trim().endsWith("}"))return this.createObjectEvaluator(t);if(/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())){const n=t.trim().slice(4);return r=>B(r,n)}return t.includes("ctx")||/[+\-*/%<>=&|?:\[\]]/.test(t)?this.createSimpleEvaluator(t):n=>B(n,t)}static createObjectEvaluator(t){const n=t.trim().slice(1,-1),r=this.parseObjectProperties(n);return i=>{const s={};for(const{key:o,value:a}of r)try{if(a.startsWith("ctx.")){const u=a.slice(4);s[o]=B(i,u)}else s[o]=this.evaluateSimpleValue(a,i)}catch{s[o]=void 0}return s}}static parseObjectProperties(t){const n=[],r=t.split(",");for(const i of r){const s=i.indexOf(":");if(s===-1)continue;const o=i.slice(0,s).trim(),a=i.slice(s+1).trim(),u=o.replace(/^['"]|['"]$/g,"");n.push({key:u,value:a})}return n}static createSimpleEvaluator(t){return n=>{try{let r=t;const i=[];r=r.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,w=>`<<#${i.push(w)-1}#>>`);const s=r.match(/ctx\.[\w.]+/g)||[];for(const w of s){const h=w.slice(4),l=B(n,h);if(l===void 0)return;const d=i.push(JSON.stringify(l))-1;r=r.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`)}const o=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=r.match(o)||[];for(const w of a){if(w.startsWith("ctx."))continue;const h=B(n,w);if(h===void 0)return;const l=i.push(JSON.stringify(h))-1;r=r.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${l}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let m;const g=new Set;for(;(m=u.exec(r))!==null;){const w=m[1];if(["true","false","null","undefined"].includes(w)||/^[0-9]+$/.test(w)||w==="ctx"||g.has(w))continue;g.add(w);const h=B(n,w);if(h===void 0)return;const l=JSON.stringify(h),d=i.push(l)-1;w.includes(".")?r=r.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`):r=r.replace(new RegExp("\\b"+w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${d}#>>`)}r=r.replace(/<<#(\d+)#>>/g,(w,h)=>i[Number(h)]);try{return this.evaluateBasicExpression(r)}catch{return}}catch{return}}}static evaluateBasicExpression(t){const n=this.tokenize(t);let r=0;function i(){return n[r]}function s(c){const p=n[r++];if(c&&!p)throw new Error(`Unexpected token EOF, expected ${c}`);if(c&&p&&p.type!==c&&p.value!==c)throw new Error(`Unexpected token ${p.type}/${p.value}, expected ${c}`);return p}function o(){return a()}function a(){let c=u();if(i()&&i().value==="?"){s("?");const p=o();s(":");const y=o();return c?p:y}return c}function u(){let c=m();for(;i()&&i().value==="||";){s("OP");const p=m();c=c||p}return c}function m(){let c=g();for(;i()&&i().value==="&&";){s("OP");const p=g();c=c&&p}return c}function g(){let c=w();for(;i()&&["==","!=","===","!=="].includes(i().value);){const p=s("OP").value,y=w();switch(p){case"==":c=c==y;break;case"!=":c=c!=y;break;case"===":c=c===y;break;case"!==":c=c!==y;break}}return c}function w(){let c=h();for(;i()&&[">","<",">=","<="].includes(i().value);){const p=s("OP").value,y=h();switch(p){case">":c=c>y;break;case"<":c=c<y;break;case">=":c=c>=y;break;case"<=":c=c<=y;break}}return c}function h(){let c=l();for(;i()&&(i().value==="+"||i().value==="-");){const p=s("OP").value,y=l();c=p==="+"?c+y:c-y}return c}function l(){let c=d();for(;i()&&(i().value==="*"||i().value==="/"||i().value==="%");){const p=s("OP").value,y=d();switch(p){case"*":c=c*y;break;case"/":c=c/y;break;case"%":c=c%y;break}}return c}function d(){return i()&&i().value==="!"?(s("OP"),!d()):i()&&i().value==="-"?(s("OP"),-d()):v()}function v(){const c=i();if(c){if(c.type==="NUMBER")return s("NUMBER"),Number(c.value);if(c.type==="STRING")return s("STRING"),c.value.slice(1,-1);if(c.type==="IDENT")return s("IDENT"),c.value==="true"?!0:c.value==="false"?!1:c.value==="null"?null:void 0;if(c.value==="["){s("PUNC");const p=[];for(;i()&&i().value!=="]";)p.push(o()),i()&&i().value===","&&s("PUNC");return s("PUNC"),p}if(c.value==="("){s("PUNC");const p=o();return s("PUNC"),p}throw new Error("Unexpected token in expression")}}return o()}static tokenize(t){const n=[],r=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let i;for(;(i=r.exec(t))!==null;){const s=i[1];s&&(/^\d/.test(s)?n.push({type:"NUMBER",value:s}):/^"/.test(s)||/^'/.test(s)?n.push({type:"STRING",value:s}):/^[a-zA-Z_]/.test(s)?n.push({type:"IDENT",value:s}):/^[()?:,\[\]]$/.test(s)?n.push({type:"PUNC",value:s}):n.push({type:"OP",value:s}))}return n}static evaluateSimpleValue(t,n){if(t==="true")return!0;if(t==="false")return!1;if(!isNaN(Number(t)))return Number(t);if(t.startsWith("ctx.")){const r=t.slice(4);return B(n,r)}return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class se{static cleanupFunctions=new WeakMap;static addListener(t,n,r,i){t.addEventListener(n,r,i);const o={event:n,handler:r,options:i,cleanup:()=>t.removeEventListener(n,r,i),addedAt:Date.now()};this.cleanupFunctions.has(t)||this.cleanupFunctions.set(t,[]);const a=this.cleanupFunctions.get(t);a.push(o),this.cleanupFunctions.get(t).__metaList=a}static removeListener(t,n,r,i){t.removeEventListener(n,r,i);const s=this.cleanupFunctions.get(t);if(s){const o=s.__metaList||null;if(o){const a=o.findIndex(u=>u.event===n&&u.handler===r&&JSON.stringify(u.options)===JSON.stringify(i));if(a>=0){try{o[a].cleanup()}catch{}o.splice(a,1)}o.length===0&&this.cleanupFunctions.delete(t)}else{const a=s.findIndex(()=>!0);a>=0&&(s.splice(a,1),s.length===0&&this.cleanupFunctions.delete(t))}}}static cleanup(t){const n=this.cleanupFunctions.get(t);n&&((n.__metaList||n).forEach(i=>{try{typeof i=="function"?i():i&&typeof i.cleanup=="function"&&i.cleanup()}catch(s){console.error("Error during event cleanup:",s)}}),this.cleanupFunctions.delete(t))}static cleanupAll(){try{this.cleanupFunctions=new WeakMap}catch(t){console.error("Error during global cleanup:",t)}}static hasListeners(t){const n=this.cleanupFunctions.get(t),r=n?n.__metaList||n:void 0;return!!(r&&r.length>0)}static getListenerCount(t){const n=this.cleanupFunctions.get(t),r=n?n.__metaList||n:void 0;return r?r.length:0}}function ce(e,t){if(t&&e instanceof HTMLElement){se.cleanup(e);for(const n in t)t[n]===e&&delete t[n];for(const n of Array.from(e.childNodes))ce(n,t)}}function he(e,t,n){if(typeof e=="string")return;const r=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),i=e.props?.ref??(e.props?.props&&e.props.props.ref);r?r.value=t:i&&n&&(n[i]=t)}function Rt(e,t,n,r,i,s,o,a){if(!s)return;const u=t.includes("lazy"),m=t.includes("trim"),g=t.includes("number"),w=e&&typeof e=="object"&&"value"in e&&typeof e.value<"u",h=()=>{if(w){const C=e.value;return a&&typeof C=="object"&&C!==null?C[a]:C}return B(s._state||s,e)},l=h();let d="text";o instanceof HTMLInputElement?d=r?.type||o.type||"text":o instanceof HTMLSelectElement?d="select":o instanceof HTMLTextAreaElement&&(d="textarea");const v=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,c=v?d==="checkbox"||d==="radio"?"checked":"value":a??"modelValue";if(d==="checkbox")if(Array.isArray(l))n[c]=l.includes(String(o?.getAttribute("value")??r?.value??""));else{const C=o?.getAttribute("true-value")??!0;n[c]=l===C}else if(d==="radio")n[c]=l===(r?.value??"");else if(d==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const C=Array.isArray(l)?l.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(k=>{k.selected=C.includes(k.value)})},0),n[c]=Array.isArray(l)?l:[]}else n[c]=l;else{n[c]=l;try{const C=ne(c);r&&(r[C]=l)}catch{}}const p=u||d==="checkbox"||d==="radio"||d==="select"?"change":"input",y=C=>{if(C.isComposing||i._isComposing)return;const k=typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&window.__vitest__;if(C.isTrusted===!1&&!k)return;const f=C.target;if(!f||f._modelUpdating)return;let x=f.value;if(d==="checkbox"){const T=h();if(Array.isArray(T)){const O=f.getAttribute("value")??"",A=Array.from(T);if(f.checked)A.includes(O)||A.push(O);else{const L=A.indexOf(O);L>-1&&A.splice(L,1)}x=A}else{const O=f.getAttribute("true-value")??!0,A=f.getAttribute("false-value")??!1;x=f.checked?O:A}}else if(d==="radio")x=f.getAttribute("value")??f.value;else if(d==="select"&&f.multiple)x=Array.from(f.selectedOptions).map(T=>T.value);else if(m&&typeof x=="string"&&(x=x.trim()),g){const T=Number(x);isNaN(T)||(x=T)}const R=s._state||s,_=h();if(Array.isArray(x)&&Array.isArray(_)?JSON.stringify([...x].sort())!==JSON.stringify([..._].sort()):x!==_){f._modelUpdating=!0;try{if(w)if(a&&typeof e.value=="object"&&e.value!==null){const T={...e.value};T[a]=x,e.value=T}else e.value=x;else Ce(R,e,x);if(s._requestRender&&s._requestRender(),s._triggerWatchers){const T=w?"reactiveState":e;s._triggerWatchers(T,x)}if(f){const T=`update:${ne(c)}`,O=new CustomEvent(T,{detail:x,bubbles:!0,composed:!0});f.dispatchEvent(O)}}finally{setTimeout(()=>f._modelUpdating=!1,0)}}};if(v){if(i[p]){const C=i[p];o&&se.removeListener(o,p,C)}i[p]=y}else{const C=`update:${ne(c)}`;if(i[C]){const k=i[C];o&&se.removeListener(o,C,k)}i[C]=k=>{const f=s._state||s,x=k.detail!==void 0?k.detail:k.target?.value,R=B(f,e);if(Array.isArray(x)&&Array.isArray(R)?JSON.stringify([...x].sort())!==JSON.stringify([...R].sort()):x!==R){Ce(f,e,x),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,x);const S=k.target;if(S){S[c]=x;try{const T=ne(c);typeof x=="boolean"?x?S.setAttribute(T,"true"):S.setAttribute(T,"false"):S.setAttribute(T,String(x))}catch{}queueMicrotask(()=>{typeof S._applyProps=="function"&&S._applyProps(S._cfg),typeof S._requestRender=="function"&&S._requestRender()})}}}}(d==="text"||d==="textarea")&&(i.compositionstart=(()=>i._isComposing=!0),i.compositionend=C=>{i._isComposing=!1;const k=C.target;k&&setTimeout(()=>{const f=k.value,x=s._state||s,R=B(x,e);let _=f;if(m&&(_=_.trim()),g){const T=Number(_);isNaN(T)||(_=T)}if(Array.isArray(_)&&Array.isArray(R)?JSON.stringify([..._].sort())!==JSON.stringify([...R].sort()):_!==R){k._modelUpdating=!0;try{Ce(x,e,_),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,_)}finally{setTimeout(()=>k._modelUpdating=!1,0)}}},0)})}function Ye(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function Tt(e,t,n,r){if(typeof e=="object"&&e!==null)for(const[i,s]of Object.entries(e))i.startsWith("data-")||i.startsWith("aria-")||i==="class"?n[i]=s:t[i]=s;else if(typeof e=="string"){if(!r)return;try{const i=ge(e,r);if(typeof i=="object"&&i!==null){for(const[s,o]of Object.entries(i))s.startsWith("data-")||s.startsWith("aria-")||s==="class"?n[s]=o:t[s]=o;return}else{n[e]=i;return}}catch{const i=B(r,e);n[e]=i}}}function Ot(e,t,n){let r;if(typeof e=="string"){if(!n)return;r=ge(e,n)}else r=e;const i=t.style||"";let s=i;if(r){if(i){const o=i.split(";").map(u=>u.trim()).filter(Boolean),a=o.findIndex(u=>u.startsWith("display:"));a>=0&&o[a]==="display: none"&&(o.splice(a,1),s=o.length>0?o.join("; ")+";":"")}}else if(i){const o=i.split(";").filter(Boolean),a=o.findIndex(u=>u.trim().startsWith("display:"));a>=0?o[a]="display: none":o.push("display: none"),s=o.join("; ")}else s="display: none";s!==i&&(s?t.style=s:delete t.style)}function ge(e,t){return At.evaluate(e,t)}function Pt(e,t,n){let r;if(typeof e=="string"){if(!n)return;r=ge(e,n)}else r=e;let i=[];typeof r=="string"?i=[r]:Array.isArray(r)?i=r.filter(Boolean):typeof r=="object"&&r!==null&&(i=Object.entries(r).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",o=s?`${s} ${i.join(" ")}`.trim():i.join(" ");o&&(t.class=o)}function Lt(e,t,n){let r;if(typeof e=="string"){if(!n)return;r=ge(e,n)}else r=e;let i="";if(typeof r=="string")i=r;else if(r&&typeof r=="object"){const o=[];for(const[a,u]of Object.entries(r))if(u!=null&&u!==""){const m=a.replace(/[A-Z]/g,h=>`-${h.toLowerCase()}`),g=["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 w=String(u);typeof u=="number"&&g.includes(m)&&(w=`${u}px`),o.push(`${m}: ${w}`)}i=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+i}function jt(e,t,n){let r=e;typeof e=="string"&&n&&(r=ge(e,n)),r&&typeof r=="object"&&r.constructor?.name==="ReactiveState"?t.reactiveRef=r:t.ref=r}function et(e,t,n,r){const i={},s={...r||{}},o={};for(const[a,u]of Object.entries(e)){const{value:m,modifiers:g,arg:w}=u;if(a==="model"||a.startsWith("model:")){const h=a.split(":"),l=h.length>1?h[1]:w;Rt(m,g,i,s,o,t,n,l);continue}switch(a){case"bind":Tt(m,i,s,t);break;case"show":Ot(m,s,t);break;case"class":Pt(m,s,t);break;case"style":Lt(m,s,t);break;case"ref":jt(m,i,t);break}}return{props:i,attrs:s,listeners:o}}function Me(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let a=o.props?.key??o.key;if(!a){const w=o.tag||"node",l=[o.props?.attrs?.id,o.props?.attrs?.name,o.props?.attrs?.["data-key"],o.props?.props?.id,o.props?.props?.name,o.props?.props?.dataKey,o.props?.props?.["data-key"]].find(d=>d!=null)??"";a=l?`${t}:${w}:${l}`:`${t}:${w}`}let u=a,m=1;for(;s.has(u);)u=`${a}#${m++}`;s.add(u);let g=o.children;return Array.isArray(g)&&(g=Me(g,u)),{...o,key:u,children:g}})}const n=e;let r=n.props?.key??n.key??t,i=n.children;return Array.isArray(i)&&(i=Me(i,r)),{...n,key:r,children:i}}function tt(e,t,n,r){const i=n.directives??{},s=et(i,r,e,n.attrs),o={...t.props,...n.props,...s.props},a={...t.attrs,...n.attrs,...s.attrs},u=t.props??{},m=o,g=n?.isCustomElement??t?.isCustomElement??!1;let w=!1;for(const d in{...u,...m}){const v=u[d],b=m[d];if(v!==b)if(w=!0,d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==b&&(e.value=b??"");else if(d==="checked"&&e instanceof HTMLInputElement)e.checked=!!b;else if(d.startsWith("on")&&typeof b=="function"){const c=Ye(d);typeof v=="function"&&se.removeListener(e,c,v),se.addListener(e,c,b)}else if(b==null)e.removeAttribute(d);else if((n?.isCustomElement??t?.isCustomElement??!1)||d in e)try{e[d]=b}catch{}else b===!1&&e.removeAttribute(d)}for(const[d,v]of Object.entries(s.listeners||{}))se.addListener(e,d,v);const h=t.attrs??{},l=a;for(const d in{...h,...l}){const v=h[d],b=l[d];let c=v,p=b;if(v&&typeof v=="object"&&v.constructor?.name==="ReactiveState"&&(c=v.value),b&&typeof b=="object"&&b.constructor?.name==="ReactiveState"&&(p=b.value),c!==p)if(w=!0,p==null||p===!1){if(e.removeAttribute(d),d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)try{e.value=""}catch{}else if(e instanceof HTMLSelectElement)try{e.value=""}catch{}else if(e instanceof HTMLProgressElement)try{e.value=0}catch{}}if(d==="checked"&&e instanceof HTMLInputElement)try{e.checked=!1}catch{}if(d==="disabled")try{e.disabled=!1}catch{}}else{if(d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){try{e.value=p??""}catch{e.setAttribute(d,String(p))}continue}else if(e instanceof HTMLSelectElement){try{e.value=p??""}catch{}continue}else if(e instanceof HTMLProgressElement){try{e.value=Number(p)}catch{}continue}}if(d==="checked"&&e instanceof HTMLInputElement){try{e.checked=!!p}catch{}continue}if(d==="style"){e.setAttribute(d,String(p));continue}const y=e.namespaceURI==="http://www.w3.org/2000/svg";if(g&&!y&&d.includes("-")){const C=Ge(d);try{e[C]=p}catch{e.setAttribute(d,String(p))}}else if(!y&&d in e)try{e[d]=p}catch{e.setAttribute(d,String(p))}else e.setAttribute(d,String(p))}}if(g&&w)try{if(typeof e._applyProps=="function")try{e._applyProps(e._cfg)}catch{}typeof e.requestRender=="function"?e.requestRender():typeof e._render=="function"&&e._render(e._cfg)}catch{}}function Z(e,t,n){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const h=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(h.key=e.key),h}if(e.tag==="#anchor"){const h=e,l=Array.isArray(h.children)?h.children:[],d=document.createTextNode(""),v=document.createTextNode("");h.key!=null&&(d.key=`${h.key}:start`,v.key=`${h.key}:end`),h._startNode=d,h._endNode=v;const b=document.createDocumentFragment();b.appendChild(d);for(const c of l){const p=Z(c,t);b.appendChild(p)}return b.appendChild(v),b}const r=document.createElement(e.tag);e.key!=null&&(r.key=e.key);const{props:i={},attrs:s={},directives:o={}}=e.props??{},a=et(o,t,r,s),u={...i,...a.props},m={...s,...a.attrs},g=r.namespaceURI==="http://www.w3.org/2000/svg";for(const h in m){const l=m[h];if(!(typeof h!="string"||/\[object Object\]/.test(h))){if(typeof l=="boolean")l&&r.setAttribute(h,"");else if(l!=null)if(!g&&h==="value"&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement||r instanceof HTMLProgressElement))try{r instanceof HTMLProgressElement?r.value=Number(l):r.value=l??""}catch{r.setAttribute(h,String(l))}else if(!g&&h==="checked"&&r instanceof HTMLInputElement)try{r.checked=!!l}catch{r.setAttribute(h,String(l))}else if(!g&&h in r)try{r[h]=l}catch{r.setAttribute(h,String(l))}else if((e.props?.isCustomElement??!1)&&!g&&h.includes("-")){const v=Ge(h);try{r[v]=l}catch{r.setAttribute(h,String(l))}}else r.setAttribute(h,String(l))}}for(const h in u){const l=u[h];if(!(typeof h!="string"||/\[object Object\]/.test(h)))if(h==="value"&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)){const d=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;r.value=d??""}else if(h==="checked"&&r instanceof HTMLInputElement){const d=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;r.checked=!!d}else if(h.startsWith("on")&&typeof l=="function")se.addListener(r,Ye(h),l);else{if(h.startsWith("on")&&l===void 0)continue;if(l==null||l===!1)r.removeAttribute(h);else if((e.props?.isCustomElement??!1)||h in r)try{const v=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;r[h]=v}catch{}}}for(const[h,l]of Object.entries(a.listeners||{}))se.addListener(r,h,l);const w={...e,props:{...e.props,...a.props}};he(w,r,n);try{if(typeof r._applyProps=="function")try{r._applyProps(r._cfg)}catch{}typeof r.requestRender=="function"?r.requestRender():typeof r._render=="function"&&r._render(r._cfg)}catch{}if(Array.isArray(e.children))for(const h of e.children)r.appendChild(Z(h,t,n));else typeof e.children=="string"&&(r.textContent=e.children);try{if(r instanceof HTMLSelectElement&&m&&m.hasOwnProperty("value"))try{r.value=m.value??""}catch{}}catch{}return r}function Mt(e,t,n,r,i){if(typeof n=="string"){e.textContent!==n&&(e.textContent=n);return}if(!Array.isArray(n))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],a=new Map;for(const l of o)l&&l.key!=null&&a.set(l.key,l);const u=new Map;for(const l of s){const d=l.key;d!=null&&u.set(d,l)}const m=new Set;let g=e.firstChild;function w(l,d){let v=l;for(;v&&(m.add(v),v!==d);)v=v.nextSibling}function h(l,d,v,b){const c=[];let p=l.nextSibling;for(;p&&p!==d;)c.push(p),p=p.nextSibling;const y=Array.isArray(v)?v:[];if(b.some(k=>k&&k.key!=null)||y.some(k=>k&&k.key!=null)){const k=new Map,f=new Map;for(const _ of y)_&&_.key!=null&&k.set(_.key,_);for(const _ of c){const S=_.key;S!=null&&f.set(S,_)}const x=new Set;let R=l.nextSibling;for(const _ of b){let S;if(_.key!=null&&f.has(_.key)){const T=k.get(_.key);S=_e(f.get(_.key),T,_,r),x.add(S),S!==R&&e.contains(S)&&e.insertBefore(S,R)}else S=Z(_,r),e.insertBefore(S,R),x.add(S);R=S.nextSibling}for(const _ of c)!x.has(_)&&e.contains(_)&&e.removeChild(_)}else{const k=Math.min(y.length,b.length);for(let f=0;f<k;f++){const x=y[f],R=b[f],_=_e(c[f],x,R,r);_!==c[f]&&(e.insertBefore(_,c[f]),e.removeChild(c[f]))}for(let f=k;f<b.length;f++)e.insertBefore(Z(b[f],r),d);for(let f=k;f<c.length;f++)e.removeChild(c[f])}}for(const l of n){let d;if(l.tag==="#anchor"){const v=l.key,b=`${v}:start`,c=`${v}:end`;let p=u.get(b),y=u.get(c);const C=Array.isArray(l.children)?l.children:[];if(p||(p=document.createTextNode(""),p.key=b),y||(y=document.createTextNode(""),y.key=c),l._startNode=p,l._endNode=y,!e.contains(p)||!e.contains(y)){e.insertBefore(p,g);for(const k of C)e.insertBefore(Z(k,r),g);e.insertBefore(y,g)}else h(p,y,a.get(v)?.children,C);w(p,y),g=y.nextSibling;continue}if(l.key!=null&&u.has(l.key)){const v=a.get(l.key);d=_e(u.get(l.key),v,l,r,i),m.add(d),d!==g&&e.contains(d)&&(g&&!e.contains(g)&&(g=null),e.insertBefore(d,g))}else d=Z(l,r,i),g&&!e.contains(g)&&(g=null),e.insertBefore(d,g),m.add(d);g=d.nextSibling}for(const l of s)!m.has(l)&&e.contains(l)&&(ce(l,i),e.removeChild(l))}function _e(e,t,n,r,i){if(t&&typeof t!="string"&&t.props?.ref&&i&&ce(e,i),t===n)return e;if(typeof n=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==n&&(e.textContent=n),e;{const o=document.createTextNode(n);return e.parentNode?.replaceChild(o,e),o}}if(n&&typeof n!="string"&&n.tag==="#anchor"){const o=n,a=Array.isArray(o.children)?o.children:[],u=o._startNode??document.createTextNode(""),m=o._endNode??document.createTextNode("");o.key!=null&&(u.key=`${o.key}:start`,m.key=`${o.key}:end`),o._startNode=u,o._endNode=m;const g=document.createDocumentFragment();g.appendChild(u);for(const w of a){const h=Z(w,r);g.appendChild(h)}return g.appendChild(m),e.parentNode?.replaceChild(g,e),u}if(!n){ce(e,i);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){ce(e,i);const o=Z(n,r,i);return he(n,o,i),e.parentNode?.replaceChild(o,e),o}if(n.tag==="#anchor"){const o=Array.isArray(n.children)?n.children:[],a=n._startNode??document.createTextNode(""),u=n._endNode??document.createTextNode("");n.key!=null&&(a.key=`${n.key}:start`,u.key=`${n.key}:end`),n._startNode=a,n._endNode=u;const m=document.createDocumentFragment();m.appendChild(a);for(const g of o)m.appendChild(Z(g,r));return m.appendChild(u),e.parentNode?.replaceChild(m,e),a}if(typeof t!="string"&&typeof n!="string"&&t.tag===n.tag&&t.key===n.key){const o=e;return tt(o,t.props||{},n.props||{},r),Mt(o,t.children,n.children,r,i),he(n,o,i),o}if(typeof t!="string"&&typeof n!="string"&&t.tag===n.tag&&(t.tag&&String(t.tag).includes("-")||n.props&&n.props.isCustomElement||t.props&&t.props.isCustomElement))try{const a=e;return tt(a,t.props||{},n.props||{},r),he(n,a,i),a}catch{}ce(e,i);const s=Z(n,r,i);return he(n,s,i),e.parentNode?.replaceChild(s,e),s}function Nt(e,t,n,r){let i;Array.isArray(t)?t.length===1?(i=t[0],i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})):i={tag:"div",key:"__root__",children:t}:(i=t,i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})),i&&typeof i=="object"&&i.tag==="#anchor"&&(i={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[i]}),i=Me(i,String(i.key??"root"));const s=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let a;s&&o?typeof s!="string"&&typeof i!="string"&&s.tag===i.tag&&s.key===i.key?a=_e(o,s,i,n,r):(a=Z(i,n,r),e.replaceChild(a,o)):(a=Z(i,n,r),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const u=[];for(let m=0;m<e.childNodes.length;m++){const g=e.childNodes[m];g!==a&&g.nodeName!=="STYLE"&&(ce(g,r),u.push(g))}u.forEach(m=>e.removeChild(m)),e._prevVNode=i,e._prevDom=a}function Ee(e){if(typeof e=="string")return re(e);if(e.tag==="#text")return typeof e.children=="string"?re(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(Ee).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([i,s])=>` ${i}="${re(String(s))}"`).join(""));let n="";e.props&&(n=Object.entries(e.props).filter(([i])=>i!=="attrs"&&i!=="directives"&&i!=="ref"&&i!=="key").map(([i,s])=>` ${i}="${re(String(s))}"`).join(""));const r=Array.isArray(e.children)?e.children.filter(Boolean).map(Ee).join(""):typeof e.children=="string"?re(e.children):e.children?Ee(e.children):"";return`<${e.tag}${t}${n}>${r}</${e.tag}>`}function nt(e,...t){let n="";for(let r=0;r<e.length;r++)n+=e[r],r<t.length&&(n+=t[r]);return n}function rt(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let Se=null;function it(){return Se||(Se=new CSSStyleSheet,Se.replaceSync(rt(Dt))),Se}function Wt(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Dt=nt`
|
|
2
5
|
:host, *, ::before, ::after {
|
|
3
6
|
all: isolate;
|
|
4
7
|
box-sizing: border-box;
|
|
@@ -56,33 +59,36 @@
|
|
|
56
59
|
sup { top: -.5em }
|
|
57
60
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
58
61
|
[hidden] { display: none }
|
|
59
|
-
`,jt=Object.fromEntries(Object.entries({neutral:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},info:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},warning:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}}).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([r,i])=>[r,`var(--color-${e}${r==="DEFAULT"?"":`-${r}`}, ${i})`]))])),Ce={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-7":"grid-template-columns:repeat(7,minmax(0,1fr));","grid-cols-8":"grid-template-columns:repeat(8,minmax(0,1fr));","grid-cols-9":"grid-template-columns:repeat(9,minmax(0,1fr));","grid-cols-10":"grid-template-columns:repeat(10,minmax(0,1fr));","grid-cols-11":"grid-template-columns:repeat(11,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-5":"grid-template-rows:repeat(5,minmax(0,1fr));","grid-rows-6":"grid-template-rows:repeat(6,minmax(0,1fr));","grid-rows-7":"grid-template-rows:repeat(7,minmax(0,1fr));","grid-rows-8":"grid-template-rows:repeat(8,minmax(0,1fr));","grid-rows-9":"grid-template-rows:repeat(9,minmax(0,1fr));","grid-rows-10":"grid-template-rows:repeat(10,minmax(0,1fr));","grid-rows-11":"grid-template-rows:repeat(11,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-7":"grid-column:span 7 / span 7;","col-span-8":"grid-column:span 8 / span 8;","col-span-9":"grid-column:span 9 / span 9;","col-span-10":"grid-column:span 10 / span 10;","col-span-11":"grid-column:span 11 / span 11;","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-7":"grid-row:span 7 / span 7;","row-span-8":"grid-row:span 8 / span 8;","row-span-9":"grid-row:span 9 / span 9;","row-span-10":"grid-row:span 10 / span 10;","row-span-11":"grid-row:span 11 / span 11;","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;","border-2":"border-width:2px;","border-4":"border-width:4px;","border-6":"border-width:6px;","border-8":"border-width:8px;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-xl":"border-radius:0.75rem;","rounded-2xl":"border-radius:1rem;","rounded-3xl":"border-radius:1.5rem;","rounded-4xl":"border-radius:2rem;","rounded-full":"border-radius:9999px;","shadow-none":"--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);","shadow-xs":"--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));","shadow-sm":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-md":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-lg":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-xl":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-2xl":"--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, 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;","cursor-auto":"cursor:auto;","cursor-default":"cursor:default;","cursor-pointer":"cursor:pointer;","cursor-wait":"cursor:wait;","cursor-text":"cursor:text;","cursor-move":"cursor:move;","cursor-help":"cursor:help;","cursor-not-allowed":"cursor:not-allowed;","z-0":"z-index:0;","z-10":"z-index:10;","z-20":"z-index:20;","z-30":"z-index:30;","z-40":"z-index:40;","z-50":"z-index:50;"},Lt="0.25rem",Fe={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 D(e,t){let r=0,i=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==="(")i++;else if(s===")"&&i>0)i--;else if(r===0&&i===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,n)+t+e.slice(n)}return e+t}const Rt={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${D(e,":hover")}{${t}}`,focus:(e,t)=>`${D(e,":focus")}{${t}}`,active:(e,t)=>`${D(e,":active")}{${t}}`,disabled:(e,t)=>`${D(e,":disabled")}{${t}}`,visited:(e,t)=>`${D(e,":visited")}{${t}}`,checked:(e,t)=>`${D(e,":checked")}{${t}}`,first:(e,t)=>`${D(e,":first-child")}{${t}}`,last:(e,t)=>`${D(e,":last-child")}{${t}}`,odd:(e,t)=>`${D(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${D(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${D(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${D(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)"},Te=["sm","md","lg","xl","2xl"];function je(e){const t=e.startsWith("-"),i=(t?e.slice(1):e).split("-");if(i.length<2)return null;const n=i.slice(0,-1).join("-"),s=i[i.length-1],o=parseFloat(s);if(Number.isNaN(o)||!Fe[n])return null;const a=t?"-":"";return Fe[n].map(c=>`${c}:calc(${a}${Lt} * ${o});`).join("")}function Ke(e){const t=e.replace("#",""),r=parseInt(t,16),i=r>>16&255,n=r>>8&255,s=r&255;return`${i} ${n} ${s}`}function Ot(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,i,n="DEFAULT"]=t,s=jt[i]?.[n];if(!s)return null;if(r==="shadow")return`--ce-shadow-color:${s};`;const a={bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",outline:"outline-color",caret:"caret-color",accent:"accent-color",fill:"fill",stroke:"stroke"}[r];return a?`${a}:${s};`:null}function Pt(e){const[t,r]=e.split("/");if(!r)return{base:t};const i=parseInt(r,10);return isNaN(i)||i<0||i>100?{base:t}:{base:t,opacity:i/100}}function Le(e){const{base:t,opacity:r}=Pt(e),i=Ot(t);if(i){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=Ke(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return i}const n=be(t);if(n&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const o=Ke(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return n}function Re(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 be(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 o=n[2].trim();return o=o.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),o=o.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${o};`}return null}const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const i=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(i==="rotate")return`transform:rotate(${n});`;const o=s[i]??i.replace(/_/g,"-");if(o&&n)return`${o}:${n};`}return null}function Mt(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 Bt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Wt(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let i;for(;i=t.exec(e);){const n=i[2].split(/\s+/).filter(Boolean);n.length&&r.push(...n)}return r.filter(Boolean)}const Je=new Map,It=16;function qt(e){const t=Date.now(),r=Je.get(e);if(r&&t-r.timestamp<It)return r.css;const i=Wt(e),n=new Set(i),s=[],o=[],a=[],c=[],u={};function m(d,g=!1){const y=(g?"dark|":"")+d;if(y in u)return u[y];const x=w(d,g);return u[y]=x,x}function T(d){const g=d.some(x=>Te.includes(x)),y=d.includes("dark");return d.length===0?1:!g&&!y?2:g&&!y?3:4}function p(d){const g=[];let y="",x=0,f=0;for(let b=0;b<d.length;b++){const h=d[b];h==="["?x++:h==="]"&&x>0?x--:h==="("?f++:h===")"&&f>0&&f--,h===":"&&x===0&&f===0?(g.push(y),y=""):y+=h}return y&&g.push(y),g}function l(d){switch(d){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(d,g=!1){const y=p(d);let x=!1;const f=y.find(k=>(k.startsWith("!")&&(x=!0,k=k.slice(1)),Ce[k]||je(k)||Re(k)||Le(k)||be(k)));if(!f)return null;const b=f.replace(/^!/,""),h=Ce[b]??je(b)??Re(b)??Le(b)??be(b);if(!h)return null;const _=y.indexOf(f);let S=_>=0?y.slice(0,_):[];g&&(S=S.filter(k=>k!=="dark"));const $=`.${Bt(d)}`,E="__SUBJECT__",C=x?h.replace(/;$/," !important;"):h;let A=E;const M=[];for(const k of S)k.startsWith("group-")?(A=`.group:${k.slice(6)} ${A}`,M.push(k)):k.startsWith("peer-")&&(A=A.replace(E,`.peer:${k.slice(5)}~${E}`),M.push(k));S=S.filter(k=>!M.includes(k));const ie=[],fe=[];let B=null;for(const k of S){if(k==="dark"||Te.includes(k))continue;const I=Mt(k);if(I){B=I;continue}const P=l(k);if(P){B?fe.push(P):ie.push(P);continue}const W=Rt[k];typeof W=="function"&&(A=W(A,C).split("{")[0])}function V(k,I){if(!I)return k;let P=0,W=0;if(k.length&&(k[0]===">"||k[0]==="+"||k[0]==="~"||k[0]===" ")){let L=1;for(;L<k.length&&k[L]===" ";)L++;for(;L<k.length;L++){const R=k[L];if(R==="["?P++:R==="]"&&P>0?P--:R==="("?W++:R===")"&&W>0&&W--,P===0&&W===0&&(k[L]===">"||k[L]==="+"||k[L]==="~"||k[L]===" "))return k.slice(0,L)+I+k.slice(L)}return k+I}for(let L=0;L<k.length;L++){const R=k[L];if(R==="["?P++:R==="]"&&P>0?P--:R==="("?W++:R===")"&&W>0&&W--,P===0&&W===0&&(R===">"||R==="+"||R==="~"||R===" "))return k.slice(0,L)+I+k.slice(L)}return k+I}const U=ie.join(""),F=fe.join("");if(B)if(B.includes("&")){const k=B.indexOf("&"),I=B.slice(0,k),P=B.slice(k+1),W=E+U,L=A;if(ie.length===0)A=L.replace(E,I+W+F+P);else{const R=V(P,F);A=L.replace(E,I+W+R)}}else A=A.replace(E,`${B}${E+U}`),F&&(A=A.replace(E,`${E}${F}`));else A=E+U+F;A=A.replace(new RegExp(E,"g"),$);let z=`${A}{${C}}`;const H=S.filter(k=>Te.includes(k)),Z=H.length?H[H.length-1]:null,ue=S.includes("dark");return g&&Z?z=`@media (prefers-color-scheme: dark) and ${Ae[Z]}{${z}}`:g?z=`@media (prefers-color-scheme: dark){${z}}`:ue&&Z?z=`@media (prefers-color-scheme: dark) and ${Ae[Z]}{${z}}`:ue?z=`@media (prefers-color-scheme: dark){${z}}`:Z&&(z=`@media ${Ae[Z]}{${z}}`),z}for(const d of n){const g=p(d),y=g.find(h=>Ce[h]||je(h)||Re(h)||Le(h)||be(h));if(!y)continue;const x=g.indexOf(y),f=x>=0?g.slice(0,x):[],b=T(f);if(b===4){const h=m(d,!0);h&&c.push(h)}else{const h=m(d);h&&(b===1?s.push(h):b===2?o.push(h):b===3&&a.push(h))}}const v=[...s,...o,...a,...c].join("");return Je.set(e,{css:v,timestamp:t}),v}const ae=[];function zt(e,t,r,i,n,s,o,a){if(e){ae.push(r);try{if(t.loadingTemplate&&r.isLoading){oe(e,t.loadingTemplate(r),r,i,n);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&oe(e,t.errorTemplate(r.error,r),r,i,n);return}const c=t.render(r);if(c instanceof Promise){s(!0),c.then(u=>{s(!1),o(null),oe(e,u,r,i,n),a(e.innerHTML)}).catch(u=>{s(!1),o(u),t.errorTemplate&&oe(e,t.errorTemplate(u,r),r,i,n)}),t.loadingTemplate&&oe(e,t.loadingTemplate(r),r,i,n);return}oe(e,c,r,i,n),a(e.innerHTML)}finally{ae.pop()}}}function oe(e,t,r,i,n){e&&(Ct(e,Array.isArray(t)?t:[t],r,i),n(e.innerHTML))}function Ht(e,t,r,i,n,s,o){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(n(r+1),r>10){o(null);return}}else n(0);const c=setTimeout(()=>{i(Date.now()),e(),o(null)},0);o(c)}function Nt(e,t,r,i,n,s){if(!e)return;const o=qt(i);if(!t.style&&(!o||o.trim()==="")){s(null),e.adoptedStyleSheets=[Ue()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let c=At(`${a}
|
|
60
|
-
|
|
61
|
-
`);c=De(c);let u=n;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==c)&&u.replaceSync(c),e.adoptedStyleSheets=[Ue(),u],s(u)}class Dt{pendingUpdates=new Map;isFlushScheduled=!1;schedule(t,r){const i=r||t.toString();this.pendingUpdates.set(i,t),this.isFlushScheduled||(this.isFlushScheduled=!0,typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&(window.__vitest__||window.Cypress)?this.flush():queueMicrotask(()=>this.flush()))}flush(){const t=Array.from(this.pendingUpdates.values());this.pendingUpdates.clear(),this.isFlushScheduled=!1;for(const r of t)try{r()}catch(i){typeof console<"u"&&console.error&&console.error("Error in batched update:",i)}}get pendingCount(){return this.pendingUpdates.size}}const Ut=new Dt;function ce(e,t){Ut.schedule(e,t)}const we=new Map,Ve=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[Ve]||(e[Ve]=we)}function Oe(e,t,r){let i=X(e);i.includes("-")||(i=`cer-${i}`);let n;typeof t=="function"?n={...r,render:t}:n=t,typeof n.onError!="function"&&(n.onError=(s,o)=>{Q(`[${i}] Error:`,s,o)});try{const s=new Set(["refs","requestRender","error","hasError","isLoading","emit"]),o=[];if(n.state&&typeof n.state=="object"&&Object.keys(n.state).forEach(a=>{s.has(a)&&o.push(a)}),n.props&&typeof n.props=="object"&&Object.keys(n.props).forEach(a=>{s.has(a)&&o.push(a)}),n.computed&&typeof n.computed=="object"&&Object.keys(n.computed).forEach(a=>{s.has(a)&&o.push(a)}),o.length>0){const a=Array.from(new Set(o));de(`[${i}] 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(we.set(i,n),typeof window<"u")if(!customElements.get(i))customElements.define(i,Ft(i,n));else try{document.querySelectorAll(i).forEach(s=>{try{typeof s._cfg<"u"&&(s._cfg=n),typeof s._render=="function"&&s._render(n)}catch{}})}catch{}}function Ft(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;_componentId;_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=we.get(e)||t,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;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}),Object.defineProperty(r,"_requestRender",{value:()=>this._requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_triggerWatchers",{value:(n,s)=>this._triggerWatchers(n,s),writable:!1,enumerable:!1,configurable:!1}),this.context=r,Object.defineProperty(this.context,"emit",{value:(n,s,o)=>{const a=new CustomEvent(n,{detail:s,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const i=we.get(e)||t;Object.keys(i).forEach(n=>{const s=i[n];typeof s=="function"&&(this.context[n]=(...o)=>s(...o,this.context))}),this._applyComputed(i),i.props&&Object.keys(i.props).forEach(n=>{let s=this[n];Object.defineProperty(this,n,{get(){return s},set(o){const a=s;s=o,this.context[n]=o,this._initializing||(this._applyProps(i),a!==o&&this._requestRender())},enumerable:!0,configurable:!0})}),this._initializing=!1,this._initWatchers(i),this._render(i)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),bt(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{wt(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,i,n){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),xt(t,r,i,n,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(X):[]}_applyComputed(r){this._runLogicWithinErrorBoundary(t,()=>{r.computed&&Object.entries(r.computed).forEach(([i,n])=>{Object.defineProperty(this.context,i,{get:()=>{const s=n(this.context);return ee(s)},enumerable:!0})})})}_render(r){this._runLogicWithinErrorBoundary(r,()=>{zt(this.shadowRoot,r,this.context,this._refs,i=>{this._lastHtmlStringForJitCSS=i,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(i)},i=>{this._templateLoading=i,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(i)},i=>{this._templateError=i,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(i)},i=>this._applyStyle(r,i))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{ce(()=>{Ht(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})},this._componentId)})}_applyStyle(r,i){this._runLogicWithinErrorBoundary(r,()=>{Nt(this.shadowRoot,r,this.context,i,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(r,i){this._hasError&&(this._hasError=!1);try{i()}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 i=function(s,o=""){return Array.isArray(s)?new Proxy(s,{get(a,c,u){const m=Reflect.get(a,c,u);return typeof m=="function"&&typeof c=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(c)?function(...p){const l=m.apply(a,p);if(!n._initializing){const w=o||"root";n._triggerWatchers(w,a),ce(()=>n._render(r),n._componentId)}return l}:m},set(a,c,u){if(a[c]=u,!n._initializing){const m=o?`${o}.${String(c)}`:String(c);n._triggerWatchers(m,u),ce(()=>n._render(r),n._componentId)}return!0},deleteProperty(a,c){if(delete a[c],!n._initializing){const u=o?`${o}.${String(c)}`:String(c);n._triggerWatchers(u,void 0),ce(()=>n._render(r),n._componentId)}return!0}}):s&&typeof s=="object"?(Object.keys(s).forEach(a=>{const c=o?`${o}.${a}`:a;s[a]=i(s[a],c)}),new Proxy(s,{set(a,c,u){const m=o?`${o}.${String(c)}`:String(c);return a[c]=i(u,m),n._initializing||(n._triggerWatchers(m,a[c]),ce(()=>n._render(r),n._componentId)),!0},get(a,c,u){return Reflect.get(a,c,u)}})):s};const n=this;return i({...r.state})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{gt(this.context,this._watchers,r.watch||{})})}_triggerWatchers(r,i){mt(this.context,this._watchers,r,i)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{yt(this,r,this.context)}catch(i){this._hasError=!0,r.onError&&r.onError(i,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(i,this.context))}})}}}function le(e,t={},r,i){const n=i??t.key;return{tag:e,key:n,props:t,children:r}}function xe(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function ve(e){return typeof e=="object"&&e!==null&&"tag"in e&&!xe(e)}function Kt(e,t){return e.key!=null?e:{...e,key:t}}function Jt(e,t=[],r={}){const i={},n={},s={},o=[],a=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let c;for(;c=a.exec(e);){const u=c[1],m=c[2],T=(c[4]||c[6])??"",p=T.match(/^{{(\d+)}}$/);let l=p?t[Number(p[1])]??null:T;p||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const w=["model","bind","show","class","style"];if(u===":"){const[v,d]=m.split(":"),[g,...y]=v.split(".");if(w.includes(g)){const x=[...y],f=g==="model"&&d?`model:${d}`:g;s[f]={value:l,modifiers:x,arg:d}}else n[m]=l,o.push(m)}else if(u==="@"){const[v,...d]=m.split("."),g=d,y=typeof l=="function"?l:typeof r[l]=="function"?r[l]:void 0;if(y){const x=b=>{if(g.includes("prevent")&&b.preventDefault(),g.includes("stop")&&b.stopPropagation(),!(g.includes("self")&&b.target!==b.currentTarget))return g.includes("once")&&b.currentTarget?.removeEventListener(v,x),y(b)},f="on"+v.charAt(0).toUpperCase()+v.slice(1);i[f]=x}}else m==="ref"?i.ref=l:n[m]=l}return{props:i,attrs:n,directives:s,bound:o}}function Vt(e,t,r){const i=ae.length>0?ae[ae.length-1]:void 0,n=r??i;function s(f,b){return le("#text",{},f,b)}let o="";for(let f=0;f<e.length;f++)o+=e[f],f<t.length&&(o+=`{{${f}}}`);const a=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,c=[];let u,m=[],T=null,p={},l,w=0,v=[];function d(f){!f||typeof f!="object"||xe(f)||(f.props||f.attrs?(f.props&&(p.props||(p.props={}),Object.assign(p.props,f.props)),f.attrs&&(p.attrs||(p.attrs={}),Object.keys(f.attrs).forEach(b=>{if(b==="style"&&p.attrs.style){const h=p.attrs.style.replace(/;?\s*$/,""),_=f.attrs.style.replace(/^;?\s*/,"");p.attrs.style=h+"; "+_}else if(b==="class"&&p.attrs.class){const h=p.attrs.class.trim().split(/\s+/).filter(Boolean),_=f.attrs.class.trim().split(/\s+/).filter(Boolean),S=[...new Set([...h,..._])];p.attrs.class=S.join(" ")}else p.attrs[b]=f.attrs[b]}))):(p.props||(p.props={}),Object.assign(p.props,f)))}function g(f,b){const h=T?m:v;if(xe(f)){const _=f.key??b;let S=f.children;h.push({...f,key:_,children:S});return}if(ve(f)){h.push(Kt(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let _=0;_<f.length;_++){const S=f[_];xe(S)||ve(S)||Array.isArray(S)?g(S,`${b}-${_}`):S!==null&&typeof S=="object"?d(S):h.push(s(String(S),`${b}-${_}`))}return}if(f!==null&&typeof f=="object"){d(f);return}h.push(s(String(f),b))}const y=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;u=a.exec(o);)if(!(u[0].startsWith("<!--")&&u[0].endsWith("-->"))){if(u[1]){const f=u[1],b=u[0][1]==="/",h=u[0][u[0].length-2]==="/"||y.has(f),{props:_,attrs:S,directives:$,bound:E}=Jt(u[2]||"",t,n),C={props:{},attrs:{}};for(const A in _)C.props[A]=_[A];for(const A in S)C.attrs[A]=S[A];if(C.attrs&&Object.prototype.hasOwnProperty.call(C.attrs,"key")&&!(C.props&&Object.prototype.hasOwnProperty.call(C.props,"key")))try{C.props.key=C.attrs.key}catch{}try{const A={input:["value","checked","disabled","readonly","required","placeholder","maxlength","minlength"],textarea:["value","disabled","readonly","required","placeholder","maxlength","minlength"],select:["value","disabled","required","multiple"],option:["selected","disabled","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","disabled","autofocus","form"]},M=f.toLowerCase(),ie=A[M]??[];if(C.attrs)for(const B of ie)E&&E.includes(B)&&B in C.attrs&&!(C.props&&B in C.props)&&(C.props[B]=C.attrs[B],delete C.attrs[B]);if((f.includes("-")||!!n?.__customElements?.has?.(f))&&E&&C.attrs){const B=new Set(["id","name","data-key","key"]);for(const V of E)if(V in C.attrs&&!(C.props&&V in C.props)){const U=V.includes("-")?V.split("-").map((F,z)=>z===0?F:F.charAt(0).toUpperCase()+F.slice(1)).join(""):V;C.props[U]=C.attrs[V],B.has(V)||delete C.attrs[V]}C.isCustomElement=!0}}catch{}if($&&Object.keys($).some(A=>A==="model"||A.startsWith("model:")))try{const A=Symbol.for("cer.registry"),M=globalThis[A],ie=!!(M&&typeof M.has=="function"&&M.has(f)),fe=!!(n&&(n.__customElements instanceof Set&&n.__customElements.has(f)||Array.isArray(n.__isCustomElements)&&n.__isCustomElements.includes(f)));if(!!(f.includes("-")||fe||ie))for(const U of Object.keys($)){if(U!=="model"&&!U.startsWith("model:"))continue;const F=$[U],z=F.arg??(U.includes(":")?U.split(":",2)[1]:void 0),H=F.value,Z=z??"modelValue",ue=K,k=pe,I=n?n._state||n:void 0;let P;typeof H=="string"&&n?P=ue(I,H):P=H,C.props[Z]=P;try{const R=X(Z);C.attrs||(C.attrs={}),P!==void 0&&(C.attrs[R]=P)}catch{}C.isCustomElement=!0;const W=`update:${X(Z)}`,L="on"+W.charAt(0).toUpperCase()+W.slice(1);C.props[L]=function(R){const ke=R.detail!==void 0?R.detail:R.target?R.target.value:void 0;if(!I)return;const Be=ue(I,typeof H=="string"?H:String(H));(Array.isArray(ke)&&Array.isArray(Be)?JSON.stringify([...ke].sort())!==JSON.stringify([...Be].sort()):ke!==Be)&&(k(I,typeof H=="string"?H:String(H),ke),n?.requestRender?n.requestRender():n?._requestRender&&n._requestRender())},delete $[U]}}catch{}if(Object.keys($).length>0&&(C.directives={...$}),b){const A=le(T,p,m.length===1&&ve(m[0])&&m[0].tag==="#text"?typeof m[0].children=="string"?m[0].children:"":m.length?m:void 0,l),M=c.pop();M?(T=M.tag,p=M.props,l=M.key,m=M.children,m.push(A)):(v.push(A),T=null,p={},l=void 0,m=[])}else h?T?m.push(le(f,C,void 0,void 0)):v.push(le(f,C,void 0,void 0)):(T&&c.push({tag:T,props:p,children:m,key:l}),T=f,p=C,m=[])}else if(typeof u[3]<"u"){const f=Number(u[3]),b=t[f],h=`interp-${f}`;g(b,h)}else if(u[4]){const f=u[4],b=T?m:v,h=f.split(/({{\d+}})/);for(const _ of h){if(!_)continue;const S=_.match(/^{{(\d+)}}$/);if(S){const $=Number(S[1]),E=t[$],C=`interp-${$}`;g(E,C)}else{const $=`text-${w++}`;b.push(s(_,$))}}}}const x=v.filter(f=>ve(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0);return x.length===1?x[0]:x.length>1?x:le("div",{},"","fallback-root")}function te(e,...t){const r=t[t.length-1],i=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return Vt(e,t,i)}const Pe=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},J=(e,t)=>{for(const r of e){const i=[],n=r.path.replace(/:[^/]+/g,a=>(i.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${n}$`),o=t.match(s);if(o){const a={};return i.forEach((c,u)=>{a[c]=o[u+1]}),{route:r,params:a}}}return{route:null,params:{}}},Me={};async function Ge(e){if(e.component)return e.component;if(e.load){if(Me[e.path])return Me[e.path];try{const t=await e.load();return Me[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 Ze(e){const{routes:t,base:r="",initialUrl:i}=e;let n,s,o,a,c,u,m;const T=async(v,d)=>{const g=t.find(y=>J([y],v.path).route!==null);if(g?.beforeEnter)try{const y=await g.beforeEnter(v,d);return typeof y=="string"?(await w(y,!0),!1):y!==!1}catch(y){return Q("beforeEnter error",y),!1}return!0},p=async(v,d)=>{const g=t.find(y=>J([y],v.path).route!==null);if(g?.onEnter)try{const y=await g.onEnter(v,d);return typeof y=="string"?(await w(y,!0),!1):y!==!1}catch(y){return Q("onEnter error",y),!1}return!0},l=(v,d)=>{const g=t.find(y=>J([y],v.path).route!==null);if(g?.afterEnter)try{g.afterEnter(v,d)}catch(y){Q("afterEnter error",y)}},w=async(v,d=!1)=>{try{const g={path:v.replace(r,"")||"/",query:{}},y=J(t,g.path);if(!y)throw new Error(`No route found for ${g.path}`);const x=o.getState(),f={path:g.path,params:y.params,query:g.query};if(!await T(f,x)||!await p(f,x))return;typeof window<"u"&&typeof document<"u"&&(d?window.history.replaceState({},"",r+v):window.history.pushState({},"",r+v)),o.setState(f),l(f,x)}catch(g){Q("Navigation error:",g)}};if(typeof window<"u"&&typeof document<"u"){n=()=>{const d=new URL(window.location.href),g=d.pathname.replace(r,"")||"/",y=Pe(d.search);return{path:g,query:y}},s=n();const v=J(t,s.path);o=Ee({path:s.path,params:v.params,query:s.query}),a=async(d=!1)=>{const g=n();await w(g.path,d)},window.addEventListener("popstate",()=>a(!0)),c=d=>w(d,!1),u=d=>w(d,!0),m=()=>window.history.back()}else{n=()=>{const g=new URL(i||"/","http://localhost"),y=g.pathname.replace(r,"")||"/",x=Pe(g.search);return{path:y,query:x}},s=n();const v=J(t,s.path);o=Ee({path:s.path,params:v.params,query:s.query}),a=async()=>{const g=n();await d(g.path)};const d=async g=>{try{const y={path:g.replace(r,"")||"/",query:{}},x=J(t,y.path);if(!x)throw new Error(`No route found for ${y.path}`);const f=o.getState(),b={path:y.path,params:x.params,query:y.query},h=t.find(_=>J([_],b.path).route!==null);if(h?.beforeEnter)try{const _=await h.beforeEnter(b,f);if(typeof _=="string"){await d(_);return}if(_===!1)return}catch{return}if(h?.onEnter)try{const _=await h.onEnter(b,f);if(typeof _=="string"){await d(_);return}if(_===!1)return}catch{return}if(o.setState(b),h?.afterEnter)try{h.afterEnter(b,f)}catch{}}catch{}};c=async g=>d(g),u=async g=>d(g),m=()=>{}}return{store:o,push:c,replace:u,back:m,subscribe:o.subscribe,matchRoute:v=>J(t,v),getCurrent:()=>o.getState(),resolveRouteComponent:Ge}}function Gt(e,t){return J(e,t)}function Zt(e){const t=Ze(e);return Oe("router-view",{async render(){if(!t)return te`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:i}=r,n=t.matchRoute(i);if(!n.route)return te`<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 o=s(),a=o instanceof Promise?await o:o;return typeof a=="string"?{tag:a,props:{},children:[]}:a}return te`<div>Invalid route component</div>`}catch{return te`<div>Invalid route component</div>`}},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),Oe("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:$e`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
part="button"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
62
|
+
`,zt=Object.fromEntries(Object.entries({neutral:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},info:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},warning:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}}).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([n,r])=>[n,`var(--color-${e}${n==="DEFAULT"?"":`-${n}`}, ${r})`]))])),Ne={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-7":"grid-template-columns:repeat(7,minmax(0,1fr));","grid-cols-8":"grid-template-columns:repeat(8,minmax(0,1fr));","grid-cols-9":"grid-template-columns:repeat(9,minmax(0,1fr));","grid-cols-10":"grid-template-columns:repeat(10,minmax(0,1fr));","grid-cols-11":"grid-template-columns:repeat(11,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-5":"grid-template-rows:repeat(5,minmax(0,1fr));","grid-rows-6":"grid-template-rows:repeat(6,minmax(0,1fr));","grid-rows-7":"grid-template-rows:repeat(7,minmax(0,1fr));","grid-rows-8":"grid-template-rows:repeat(8,minmax(0,1fr));","grid-rows-9":"grid-template-rows:repeat(9,minmax(0,1fr));","grid-rows-10":"grid-template-rows:repeat(10,minmax(0,1fr));","grid-rows-11":"grid-template-rows:repeat(11,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-7":"grid-column:span 7 / span 7;","col-span-8":"grid-column:span 8 / span 8;","col-span-9":"grid-column:span 9 / span 9;","col-span-10":"grid-column:span 10 / span 10;","col-span-11":"grid-column:span 11 / span 11;","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-7":"grid-row:span 7 / span 7;","row-span-8":"grid-row:span 8 / span 8;","row-span-9":"grid-row:span 9 / span 9;","row-span-10":"grid-row:span 10 / span 10;","row-span-11":"grid-row:span 11 / span 11;","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;","border-2":"border-width:2px;","border-4":"border-width:4px;","border-6":"border-width:6px;","border-8":"border-width:8px;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-xl":"border-radius:0.75rem;","rounded-2xl":"border-radius:1rem;","rounded-3xl":"border-radius:1.5rem;","rounded-4xl":"border-radius:2rem;","rounded-full":"border-radius:9999px;","shadow-none":"--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);","shadow-xs":"--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));","shadow-sm":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-md":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-lg":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-xl":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-2xl":"--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, 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;","cursor-auto":"cursor:auto;","cursor-default":"cursor:default;","cursor-pointer":"cursor:pointer;","cursor-wait":"cursor:wait;","cursor-text":"cursor:text;","cursor-move":"cursor:move;","cursor-help":"cursor:help;","cursor-not-allowed":"cursor:not-allowed;","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;"},Ht="0.25rem",st={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 G(e,t){let n=0,r=0;for(let i=0;i<e.length;i++){const s=e[i];if(s==="[")n++;else if(s==="]"&&n>0)n--;else if(s==="(")r++;else if(s===")"&&r>0)r--;else if(n===0&&r===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,i)+t+e.slice(i)}return e+t}const It={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${G(e,":hover")}{${t}}`,focus:(e,t)=>`${G(e,":focus")}{${t}}`,active:(e,t)=>`${G(e,":active")}{${t}}`,disabled:(e,t)=>`${G(e,":disabled")}{${t}}`,visited:(e,t)=>`${G(e,":visited")}{${t}}`,checked:(e,t)=>`${G(e,":checked")}{${t}}`,first:(e,t)=>`${G(e,":first-child")}{${t}}`,last:(e,t)=>`${G(e,":last-child")}{${t}}`,odd:(e,t)=>`${G(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${G(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${G(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${G(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}}`},We={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},De=["sm","md","lg","xl","2xl"];function ze(e){const t=e.startsWith("-"),r=(t?e.slice(1):e).split("-");if(r.length<2)return null;const i=r.slice(0,-1).join("-"),s=r[r.length-1],o=parseFloat(s);if(Number.isNaN(o)||!st[i])return null;const a=t?"-":"";return st[i].map(u=>`${u}:calc(${a}${Ht} * ${o});`).join("")}function ot(e){const t=e.replace("#",""),n=parseInt(t,16),r=n>>16&255,i=n>>8&255,s=n&255;return`${r} ${i} ${s}`}function Bt(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[,n,r,i="DEFAULT"]=t,s=zt[r]?.[i];if(!s)return null;if(n==="shadow")return`--ce-shadow-color:${s};`;const a={bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",outline:"outline-color",caret:"caret-color",accent:"accent-color",fill:"fill",stroke:"stroke"}[n];return a?`${a}:${s};`:null}function Ut(e){const[t,n]=e.split("/");if(!n)return{base:t};const r=parseInt(n,10);return isNaN(r)||r<0||r>100?{base:t}:{base:t,opacity:r/100}}function He(e){const{base:t,opacity:n}=Ut(e),r=Bt(t);if(r){if(n!==void 0){const s=/#([0-9a-f]{6})/i.exec(r);if(s){const o=ot(s[0]);return r.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${n})`)}}return r}const i=$e(t);if(i&&n!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=ot(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${n})`)}}return i}function Ie(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const n=parseInt(t[1],10);return n<0||n>100?null:`opacity:${n/100};`}function $e(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const i=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(i){const s=i[1].trim();let o=i[2].trim();return o=o.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),o=o.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${o};`}return null}const t=e.indexOf("-["),n=e.endsWith("]");if(t>0&&n){const r=e.slice(0,t);let i=e.slice(t+2,-1);i=i.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(r==="rotate")return`transform:rotate(${i});`;const o=s[r]??r.replace(/_/g,"-");if(o&&i)return`${o}:${i};`}return null}function qt(e){if(e.startsWith("[")&&e.endsWith("]")){const n=e.slice(1,-1);return n.includes("&")?n:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const n=e.slice(t+2,-1).replace(/_/g,"-");return n.includes("&")?n:e.replace(/_/g,"-")}return null}function Ft(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Kt(e){const t=/class\s*=\s*(['"])(.*?)\1/g,n=[];let r;for(;r=t.exec(e);){const i=r[2].split(/\s+/).filter(Boolean);i.length&&n.push(...i)}return n.filter(Boolean)}const at=new Map,Vt=16;function Jt(e){const t=Date.now(),n=at.get(e);if(n&&t-n.timestamp<Vt)return n.css;const r=Kt(e),i=new Set(r),s=[],o=[],a=[],u=[],m={};function g(b,c=!1){const p=(c?"dark|":"")+b;if(p in m)return m[p];const y=d(b,c);return m[p]=y,y}function w(b){const c=b.some(y=>De.includes(y)),p=b.includes("dark");return b.length===0?1:!c&&!p?2:c&&!p?3:4}function h(b){const c=[];let p="",y=0,C=0;for(let k=0;k<b.length;k++){const f=b[k];f==="["?y++:f==="]"&&y>0?y--:f==="("?C++:f===")"&&C>0&&C--,f===":"&&y===0&&C===0?(c.push(p),p=""):p+=f}return p&&c.push(p),c}function l(b){switch(b){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 d(b,c=!1){const p=h(b);let y=!1;const C=p.find(E=>(E.startsWith("!")&&(y=!0,E=E.slice(1)),Ne[E]||ze(E)||Ie(E)||He(E)||$e(E)));if(!C)return null;const k=C.replace(/^!/,""),f=Ne[k]??ze(k)??Ie(k)??He(k)??$e(k);if(!f)return null;const x=p.indexOf(C);let R=x>=0?p.slice(0,x):[];c&&(R=R.filter(E=>E!=="dark"));const _=`.${Ft(b)}`,S="__SUBJECT__",T=y?f.replace(/;$/," !important;"):f;let O=S;const A=[];for(const E of R)E.startsWith("group-")?(O=`.group:${E.slice(6)} ${O}`,A.push(E)):E.startsWith("peer-")&&(O=O.replace(S,`.peer:${E.slice(5)}~${S}`),A.push(E));R=R.filter(E=>!A.includes(E));const L=[],F=[];let Q=null;for(const E of R){if(E==="dark"||De.includes(E))continue;const K=qt(E);if(K){Q=K;continue}const H=l(E);if(H){Q?F.push(H):L.push(H);continue}const z=It[E];typeof z=="function"&&(O=z(O,T).split("{")[0])}function Oe(E,K){if(!K)return E;let H=0,z=0;if(E.length&&(E[0]===">"||E[0]==="+"||E[0]==="~"||E[0]===" ")){let P=1;for(;P<E.length&&E[P]===" ";)P++;for(;P<E.length;P++){const I=E[P];if(I==="["?H++:I==="]"&&H>0?H--:I==="("?z++:I===")"&&z>0&&z--,H===0&&z===0&&(E[P]===">"||E[P]==="+"||E[P]==="~"||E[P]===" "))return E.slice(0,P)+K+E.slice(P)}return E+K}for(let P=0;P<E.length;P++){const I=E[P];if(I==="["?H++:I==="]"&&H>0?H--:I==="("?z++:I===")"&&z>0&&z--,H===0&&z===0&&(I===">"||I==="+"||I==="~"||I===" "))return E.slice(0,P)+K+E.slice(P)}return E+K}const V=L.join(""),j=F.join("");if(Q)if(Q.includes("&")){const E=Q.indexOf("&"),K=Q.slice(0,E),H=Q.slice(E+1),z=S+V,P=O;if(L.length===0)O=P.replace(S,K+z+j+H);else{const I=Oe(H,j);O=P.replace(S,K+z+I)}}else O=O.replace(S,`${Q}${S+V}`),j&&(O=O.replace(S,`${S}${j}`));else O=S+V+j;O=O.replace(new RegExp(S,"g"),_);let W=`${O}{${T}}`;const J=R.filter(E=>De.includes(E)),X=J.length?J[J.length-1]:null,D=R.includes("dark");return c&&X?W=`@media (prefers-color-scheme: dark) and ${We[X]}{${W}}`:c?W=`@media (prefers-color-scheme: dark){${W}}`:D&&X?W=`@media (prefers-color-scheme: dark) and ${We[X]}{${W}}`:D?W=`@media (prefers-color-scheme: dark){${W}}`:X&&(W=`@media ${We[X]}{${W}}`),W}for(const b of i){const c=h(b),p=c.find(f=>Ne[f]||ze(f)||Ie(f)||He(f)||$e(f));if(!p)continue;const y=c.indexOf(p),C=y>=0?c.slice(0,y):[],k=w(C);if(k===4){const f=g(b,!0);f&&u.push(f)}else{const f=g(b);f&&(k===1?s.push(f):k===2?o.push(f):k===3&&a.push(f))}}const v=[...s,...o,...a,...u].join("");return at.set(e,{css:v,timestamp:t}),v}const me=[];function Zt(e,t,n,r,i,s,o,a){if(e){me.push(n);try{const u=t.render(n);if(u instanceof Promise){s(!0),u.then(m=>{s(!1),o(null),ct(e,m,n,r,i),a(e.innerHTML)}).catch(m=>{s(!1),o(m)});return}ct(e,u,n,r,i),a(e.innerHTML)}finally{me.pop()}}}function ct(e,t,n,r,i){e&&(Nt(e,Array.isArray(t)?t:[t],n,r),i(e.innerHTML))}function Gt(e,t,n,r,i,s,o){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(i(n+1),n===15)console.warn(`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
63
|
+
Common causes:
|
|
64
|
+
• Event handler calling a function immediately: @click="\${fn()}" should be @click="\${fn}"
|
|
65
|
+
• State modification during render
|
|
66
|
+
• Missing dependencies in computed/watch
|
|
67
|
+
Component rendering will be throttled to prevent browser freeze.`);else if(n>20){console.error(`🛑 Infinite loop detected in component render:
|
|
68
|
+
• This might be caused by state updates during render
|
|
69
|
+
• Ensure all state modifications are done in event handlers or effects
|
|
70
|
+
Stopping runaway component render to prevent browser freeze`),o(null);return}}else i(0);const m=setTimeout(()=>{r(Date.now()),e(),o(null)},n>10?100:0);o(m)}function Qt(e,t,n,r,i){if(!e)return;const s=Jt(n);if((!s||s.trim()==="")&&!t._computedStyle){i(null),e.adoptedStyleSheets=[it()];return}let o="";t._computedStyle&&(o=t._computedStyle);let a=Wt(`${o}
|
|
71
|
+
${s}
|
|
72
|
+
`);a=rt(a);let u=r;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==a)&&u.replaceSync(a),e.adoptedStyleSheets=[it(),u],i(u)}let N=null;function Xt(e){N=e}function Yt(){N=null}function en(){if(!N)throw new Error("useEmit must be called during component render");const e=N.emit;return(t,n)=>e(t,n)}function ye(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function tn(e){if(!N)throw new Error("useOnConnected must be called during component render");ye(N),N._hookCallbacks.onConnected=e}function nn(e){if(!N)throw new Error("useOnDisconnected must be called during component render");ye(N),N._hookCallbacks.onDisconnected=e}function rn(e){if(!N)throw new Error("useOnAttributeChanged must be called during component render");ye(N),N._hookCallbacks.onAttributeChanged=e}function sn(e){if(!N)throw new Error("useOnError must be called during component render");ye(N),N._hookCallbacks.onError=e}function on(e){if(!N)throw new Error("useStyle must be called during component render");ye(N);try{const t=e();Object.defineProperty(N,"_computedStyle",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(t){console.warn("Error in useStyle callback:",t),Object.defineProperty(N,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const Ae=new Map,lt=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[lt]||(e[lt]=Ae)}function an(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;_componentId;_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=Ae.get(e)||t,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const n=this._initContext(t);Object.defineProperty(n,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"_requestRender",{value:()=>this._requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"_componentId",{value:this._componentId,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"_triggerWatchers",{value:(i,s)=>this._triggerWatchers(i,s),writable:!1,enumerable:!1,configurable:!1}),this.context=n,Object.defineProperty(this.context,"emit",{value:(i,s,o)=>{const a=new CustomEvent(i,{detail:s,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const r=Ae.get(e)||t;Object.keys(r).forEach(i=>{const s=r[i];typeof s=="function"&&(this.context[i]=(...o)=>s(...o,this.context))}),this._applyComputed(r),r.props&&Object.keys(r.props).forEach(i=>{let s=this[i];Object.defineProperty(this,i,{get(){return s},set(o){const a=s;s=o,this.context[i]=o,this._initializing||(this._applyProps(r),a!==o&&this._requestRender())},enumerable:!0,configurable:!0})}),this._initializing=!1,this._initWatchers(r),this._applyProps(r),this._render(r)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),this._requestRender(),Et(t,this.context,this._mounted,n=>{this._mounted=n})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{St(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},n=>{this._templateLoading=n},n=>{this._templateError=n},n=>{this._mounted=n})})}attributeChangedCallback(n,r,i){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),r!==i&&this._requestRender(),$t(t,n,r,i,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(ne):[]}_applyComputed(n){}_render(n){this._runLogicWithinErrorBoundary(n,()=>{Zt(this.shadowRoot,n,this.context,this._refs,r=>{this._lastHtmlStringForJitCSS=r,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(r)},r=>{this._templateLoading=r,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(r)},r=>{this._templateError=r,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(r)},r=>this._applyStyle(n,r))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{fe(()=>{Gt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,n=>{this._lastRenderTime=n},n=>{this._renderCount=n},this._renderTimeoutId,n=>{this._renderTimeoutId=n})},this._componentId)})}_applyStyle(n,r){this._runLogicWithinErrorBoundary(n,()=>{Qt(this.shadowRoot,this.context,r,this._styleSheet,i=>{this._styleSheet=i})})}_runLogicWithinErrorBoundary(n,r){this._hasError&&(this._hasError=!1);try{r()}catch(i){this._hasError=!0,n.onError&&n.onError(i,this.context)}}_initContext(n){try{let r=function(s,o=""){return Array.isArray(s)?new Proxy(s,{get(a,u,m){const g=Reflect.get(a,u,m);return typeof g=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...h){const l=g.apply(a,h);if(!i._initializing){const d=o||"root";i._triggerWatchers(d,a),fe(()=>i._render(n),i._componentId)}return l}:g},set(a,u,m){if(a[u]=m,!i._initializing){const g=o?`${o}.${String(u)}`:String(u);i._triggerWatchers(g,m),fe(()=>i._render(n),i._componentId)}return!0},deleteProperty(a,u){if(delete a[u],!i._initializing){const m=o?`${o}.${String(u)}`:String(u);i._triggerWatchers(m,void 0),fe(()=>i._render(n),i._componentId)}return!0}}):s&&typeof s=="object"?s.constructor&&s.constructor.name==="ReactiveState"?s:(Object.keys(s).forEach(a=>{const u=o?`${o}.${a}`:a;s[a]=r(s[a],u)}),new Proxy(s,{set(a,u,m){const g=o?`${o}.${String(u)}`:String(u);return a[u]=r(m,g),i._initializing||(i._triggerWatchers(g,a[u]),fe(()=>i._render(n),i._componentId)),!0},get(a,u,m){return Reflect.get(a,u,m)}})):s};const i=this;return r({...n.props?Object.fromEntries(Object.entries(n.props).map(([s,o])=>[s,o.default])):{}})}catch{return{}}}_initWatchers(n){this._runLogicWithinErrorBoundary(n,()=>{xt(this.context,this._watchers,{})})}_triggerWatchers(n,r){kt(this.context,this._watchers,n,r)}_applyProps(n){this._runLogicWithinErrorBoundary(n,()=>{try{_t(this,n,this.context)}catch(r){this._hasError=!0,n.onError&&n.onError(r,this.context)}})}}}function Be(e,t){let n=ne(e);n.includes("-")||(n=`cer-${n}`);let r={};if(typeof window<"u")try{const a=t.toString().match(/\(\s*{\s*([^}]+)\s*}/);if(a){const m=a[1].split(",").map(g=>g.trim());for(const g of m){const w=g.indexOf("=");if(w!==-1){const h=g.substring(0,w).trim(),l=g.substring(w+1).trim();try{l==="true"?r[h]=!0:l==="false"?r[h]=!1:l==="[]"?r[h]=[]:l==="{}"?r[h]={}:/^\d+$/.test(l)?r[h]=parseInt(l):/^'.*'$/.test(l)||/^".*"$/.test(l)?r[h]=l.slice(1,-1):r[h]=l}catch{r[h]=""}}else{const h=g.split(":")[0].trim();h&&!h.includes("}")&&(r[h]="")}}}}catch{}let i={};const s={props:Object.fromEntries(Object.entries(r).map(([o,a])=>[o,{type:typeof a=="boolean"?Boolean:typeof a=="number"?Number:typeof a=="string"?String:Function,default:a}])),onConnected:o=>{i.onConnected&&i.onConnected()},onDisconnected:o=>{i.onDisconnected&&i.onDisconnected()},onAttributeChanged:(o,a,u,m)=>{i.onAttributeChanged&&i.onAttributeChanged(o,a,u)},onError:(o,a)=>{i.onError&&o&&i.onError(o)},render:o=>{const a=o._componentId||`${n}-${Math.random().toString(36).substr(2,9)}`;q.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{Xt(o);const u=Object.keys(r).length>0;let m;if(u){const g={};Object.keys(r).forEach(w=>{g[w]=o[w]??r[w]}),m=t(g)}else m=t();if(o._hookCallbacks){const g=o._hookCallbacks;g.onConnected&&(i.onConnected=g.onConnected),g.onDisconnected&&(i.onDisconnected=g.onDisconnected),g.onAttributeChanged&&(i.onAttributeChanged=g.onAttributeChanged),g.onError&&(i.onError=g.onError),g.style&&(o._styleCallback=g.style)}return m}finally{Yt(),q.clearCurrentComponent()}}};Ae.set(n,s),typeof window<"u"&&(customElements.get(n)||customElements.define(n,an(n,s)))}class cn{map=new Map;maxSize;constructor(t){this.maxSize=t}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}set(t,n){if(this.map.has(t)&&this.map.delete(t),this.map.set(t,n),this.map.size>this.maxSize){const r=this.map.keys().next().value;r!==void 0&&this.map.delete(r)}}has(t){return this.map.has(t)}clear(){this.map.clear()}}const Ue=new cn(500);function ln(e,t){if(e==null){console.warn(`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`);return}typeof e!="function"&&console.warn(`🚨 Potential infinite loop detected! Event handler for '@${t}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${t}="\${functionName()}" to @${t}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&console.warn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`)}function be(e,t={},n,r){const i=r??t.key;return{tag:e,key:i,props:t,children:n}}function Re(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function Te(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Re(e)}function un(e,t){return e.key!=null?e:{...e,key:t}}function fn(e,t=[],n={}){const r={},i={},s={},o=[],a=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let u;for(;u=a.exec(e);){const m=u[1],g=u[2],w=(u[4]||u[6])??"",h=w.match(/^{{(\d+)}}$/);let l=h?t[Number(h[1])]??null:w;h||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const d=["model","bind","show","class","style","ref"];if(m===":"){const[v,b]=g.split(":"),[c,...p]=v.split(".");if(d.includes(c)){const y=[...p],C=c==="model"&&b?`model:${b}`:c;s[C]={value:l,modifiers:y,arg:b}}else{let y=l;y&&typeof y=="object"&&y.constructor?.name==="ReactiveState"&&(y=y.value),i[g]=y,o.push(g)}}else if(m==="@"){const[v,...b]=g.split("."),c=b;ln(l,v);const p=typeof l=="function"?l:typeof n[l]=="function"?n[l]:void 0;if(p){const y=k=>{if(c.includes("prevent")&&k.preventDefault(),c.includes("stop")&&k.stopPropagation(),!(c.includes("self")&&k.target!==k.currentTarget))return c.includes("once")&&k.currentTarget?.removeEventListener(v,y),p(k)},C="on"+v.charAt(0).toUpperCase()+v.slice(1);r[C]=y}}else g==="ref"?r.ref=l:i[g]=l}return{props:r,attrs:i,directives:s,bound:o}}function dn(e,t,n){const r=me.length>0?me[me.length-1]:void 0,i=n??r,s=!n&&t.length===0,o=s?e.join("<!--TEMPLATE_DELIM-->"):null;if(s&&o){const f=Ue.get(o);if(f)return f}function a(f,x){return be("#text",{},f,x)}let u="";for(let f=0;f<e.length;f++)u+=e[f],f<t.length&&(u+=`{{${f}}}`);const m=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,g=[];let w,h=[],l=null,d={},v,b=0,c=[];function p(f){!f||typeof f!="object"||Re(f)||(f.props||f.attrs?(f.props&&(d.props||(d.props={}),Object.assign(d.props,f.props)),f.attrs&&(d.attrs||(d.attrs={}),Object.keys(f.attrs).forEach(x=>{if(x==="style"&&d.attrs.style){const R=d.attrs.style.replace(/;?\s*$/,""),_=f.attrs.style.replace(/^;?\s*/,"");d.attrs.style=R+"; "+_}else if(x==="class"&&d.attrs.class){const R=d.attrs.class.trim().split(/\s+/).filter(Boolean),_=f.attrs.class.trim().split(/\s+/).filter(Boolean),S=[...new Set([...R,..._])];d.attrs.class=S.join(" ")}else d.attrs[x]=f.attrs[x]}))):(d.props||(d.props={}),Object.assign(d.props,f)))}function y(f,x){const R=l?h:c;if(Re(f)){const _=f.key??x;let S=f.children;R.push({...f,key:_,children:S});return}if(Te(f)){R.push(un(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let _=0;_<f.length;_++){const S=f[_];Re(S)||Te(S)||Array.isArray(S)?y(S,`${x}-${_}`):S!==null&&typeof S=="object"?p(S):R.push(a(String(S),`${x}-${_}`))}return}if(f!==null&&typeof f=="object"){p(f);return}R.push(a(String(f),x))}const C=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;w=m.exec(u);)if(!(w[0].startsWith("<!--")&&w[0].endsWith("-->"))){if(w[1]){const f=w[1],x=w[0][1]==="/",R=w[0][w[0].length-2]==="/"||C.has(f),{props:_,attrs:S,directives:T,bound:O}=fn(w[2]||"",t,i),A={props:{},attrs:{}};for(const L in _)A.props[L]=_[L];for(const L in S)A.attrs[L]=S[L];if(A.attrs&&Object.prototype.hasOwnProperty.call(A.attrs,"key")&&!(A.props&&Object.prototype.hasOwnProperty.call(A.props,"key")))try{A.props.key=A.attrs.key}catch{}try{const L={input:["value","checked","disabled","readonly","required","placeholder","maxlength","minlength"],textarea:["value","disabled","readonly","required","placeholder","maxlength","minlength"],select:["value","disabled","required","multiple"],option:["selected","disabled","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","disabled","autofocus","form"]},F=f.toLowerCase(),Q=L[F]??[];if(A.attrs){for(const V of Q)if(O&&O.includes(V)&&V in A.attrs&&!(A.props&&V in A.props)){let j=A.attrs[V];j&&typeof j=="object"&&j.constructor?.name==="ReactiveState"&&(j=j.value),A.props[V]=j,delete A.attrs[V]}}if((f.includes("-")||!!i?.__customElements?.has?.(f))&&(A.isCustomElement=!0,O&&A.attrs)){const V=new Set(["id","name","data-key","key"]);for(const j of O)if(j in A.attrs&&!(A.props&&j in A.props)){const W=j.includes("-")?j.split("-").map((X,D)=>D===0?X:X.charAt(0).toUpperCase()+X.slice(1)).join(""):j;let J=A.attrs[j];J&&typeof J=="object"&&J.constructor?.name==="ReactiveState"&&(J=J.value),A.props[W]=J,V.has(j)||delete A.attrs[j]}}}catch{}if(T&&Object.keys(T).some(L=>L==="model"||L.startsWith("model:")))try{const L=Symbol.for("cer.registry"),F=globalThis[L],Q=!!(F&&typeof F.has=="function"&&F.has(f)),Oe=!!(i&&(i.__customElements instanceof Set&&i.__customElements.has(f)||Array.isArray(i.__isCustomElements)&&i.__isCustomElements.includes(f)));if(!!(f.includes("-")||Oe||Q))for(const W of Object.keys(T)){if(W!=="model"&&!W.startsWith("model:"))continue;const J=T[W],X=J.arg??(W.includes(":")?W.split(":",2)[1]:void 0),D=J.value,E=X??"modelValue",K=B,H=Ce,z=i?i._state||i:void 0;let P;typeof D=="string"&&i?P=K(z,D):(P=D,P&&typeof P=="object"&&P.constructor?.name==="ReactiveState"&&(P=P.value)),A.props[E]=P;try{const ae=ne(E);A.attrs||(A.attrs={}),P!==void 0&&(A.attrs[ae]=P)}catch{}A.isCustomElement=!0;const ht=`update:${ne(E)}`.replace(/-([a-z])/g,(ae,te)=>te.toUpperCase()),Ln="on"+ht.charAt(0).toUpperCase()+ht.slice(1);A.props[Ln]=function(ae){const te=ae.detail!==void 0?ae.detail:ae.target?ae.target.value:void 0;if(z)if(D&&typeof D=="object"&&D.constructor?.name==="ReactiveState"){const ue=D.value;(Array.isArray(te)&&Array.isArray(ue)?JSON.stringify([...te].sort())!==JSON.stringify([...ue].sort()):te!==ue)&&(D.value=te,i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}else{const ue=K(z,typeof D=="string"?D:String(D));(Array.isArray(te)&&Array.isArray(ue)?JSON.stringify([...te].sort())!==JSON.stringify([...ue].sort()):te!==ue)&&(H(z,typeof D=="string"?D:String(D),te),i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}},delete T[W]}}catch{}if(Object.keys(T).length>0&&(A.directives={...T}),x){const L=be(l,d,h.length===1&&Te(h[0])&&h[0].tag==="#text"?typeof h[0].children=="string"?h[0].children:"":h.length?h:void 0,v),F=g.pop();F?(l=F.tag,d=F.props,v=F.key,h=F.children,h.push(L)):(c.push(L),l=null,d={},v=void 0,h=[])}else R?l?h.push(be(f,A,void 0,void 0)):c.push(be(f,A,void 0,void 0)):(l&&g.push({tag:l,props:d,children:h,key:v}),l=f,d=A,h=[])}else if(typeof w[3]<"u"){const f=Number(w[3]),x=t[f],R=`interp-${f}`;y(x,R)}else if(w[4]){const f=w[4],x=l?h:c,R=f.split(/({{\d+}})/);for(const _ of R){if(!_)continue;const S=_.match(/^{{(\d+)}}$/);if(S){const T=Number(S[1]),O=t[T],A=`interp-${T}`;y(O,A)}else{const T=`text-${b++}`;x.push(a(_,T))}}}}const k=c.filter(f=>Te(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0);if(k.length===1){const f=k[0];return s&&o&&Ue.set(o,f),f}else if(k.length>1){const f=k;return s&&o&&Ue.set(o,f),f}return be("div",{},"","fallback-root")}function oe(e,...t){const n=t[t.length-1],r=typeof n=="object"&&n&&!Array.isArray(n)?n:void 0;return dn(e,t,r)}function we(e,t){return M(e?t:[],"when-block")}function pn(e,t){return e.map((n,r)=>{const i=typeof n=="object"?n?.key??n?.id??`idx-${r}`:String(n);return M(t(n,r),`each-${i}`)})}function ut(){const e=[];return{when(t,n){return e.push([t,n]),this},otherwise(t){return e.push([!0,t]),this},done(){return hn(...e)}}}function hn(...e){for(let t=0;t<e.length;t++){const[n,r]=e[t];if(n)return[M(r,`whenChain-branch-${t}`)]}return[M([],"whenChain-empty")]}function M(e,t){const n=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:n}}function gn(e,t){return we(!e,t)}function mn(e,t){const n=!e||e.length===0;return we(n,t)}function yn(e,t){const n=!!(e&&e.length>0);return we(n,t)}function bn(e,t,n){const r=[];return e.forEach((i,s)=>{t(i,s)&&r.push({item:i,originalIndex:s})}),r.map(({item:i,originalIndex:s},o)=>{const a=typeof i=="object"&&i!=null?i?.key??i?.id??`filtered-${s}`:`filtered-${s}`;return M(n(i,s,o),`each-where-${a}`)})}function wn(e,t){const n=e?.length??0;return n===0&&t.empty?M(t.empty,"switch-length-empty"):n===1&&t.one?M(t.one(e[0]),"switch-length-one"):t.exactly?.[n]?M(t.exactly[n](e),`switch-length-${n}`):n>1&&t.many?M(t.many(e),"switch-length-many"):M([],"switch-length-fallback")}function vn(e,t,n){const r=new Map;return e.forEach(i=>{const s=t(i);r.has(s)||r.set(s,[]),r.get(s).push(i)}),Array.from(r.entries()).map(([i,s],o)=>M(n(i,s,o),`each-group-${i}`))}function xn(e,t,n,r){const i=n*t,s=Math.min(i+t,e.length);return e.slice(i,s).map((a,u)=>{const m=i+u,g=typeof a=="object"&&a!=null?a?.key??a?.id??`page-${m}`:`page-${m}`;return M(r(a,m,u),`each-page-${g}`)})}function kn(e,t){return e.loading&&t.loading?M(t.loading,"promise-loading"):e.error&&t.error?M(t.error(e.error),"promise-error"):e.data!==void 0&&t.success?M(t.success(e.data),"promise-success"):t.idle?M(t.idle,"promise-idle"):M([],"promise-fallback")}function U(e,t){const n=typeof window<"u"&&window.matchMedia?.(e)?.matches;return we(!!n,t)}const ee={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)"},qe=["sm","md","lg","xl","2xl"],ft={sm:e=>U(ee.sm,e),md:e=>U(ee.md,e),lg:e=>U(ee.lg,e),xl:e=>U(ee.xl,e),"2xl":e=>U(ee["2xl"],e),dark:e=>U(ee.dark,e),light:e=>U("(prefers-color-scheme: light)",e),touch:e=>U("(hover: none) and (pointer: coarse)",e),mouse:e=>U("(hover: hover) and (pointer: fine)",e),reducedMotion:e=>U("(prefers-reduced-motion: reduce)",e),highContrast:e=>U("(prefers-contrast: high)",e),portrait:e=>U("(orientation: portrait)",e),landscape:e=>U("(orientation: landscape)",e)};function Cn(e,t){const n=[];e.includes("dark")?n.push(ee.dark):e.includes("light")&&n.push("(prefers-color-scheme: light)");const r=e.filter(o=>qe.includes(o)),i=r[r.length-1];i&&i in ee&&n.push(ee[i]);const s=n.length>0?n.join(" and "):"all";return U(s,t)}function _n(e){const t=[];return e.base&&t.push(M(e.base,"responsive-base")),qe.forEach(n=>{const r=e[n];r&&t.push(ft[n](r))}),t}function En(e){const t=[];let n=null;return{case(r,i){const s=typeof r=="function"?r:o=>o===r;return t.push({condition:s,content:i}),this},when(r,i){return t.push({condition:r,content:i}),this},otherwise(r){return n=r,this},done(){for(let r=0;r<t.length;r++){const{condition:i,content:s}=t[r];if(i(e))return M(s,`switch-case-${r}`)}return M(n||[],"switch-otherwise")}}}class le extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return le.instance||(le.instance=new le),le.instance}emit(t,n){const r=Date.now(),i=this.eventCounters.get(t);if(!i||r-i.window>1e3)this.eventCounters.set(t,{count:1,window:r});else if(i.count++,i.count>50&&i.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(n)}catch(a){ie(`Error in global event handler for "${t}":`,a)}})}on(t,n){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(n),()=>this.off(t,n)}off(t,n){const r=this.handlers[t];r&&r.delete(n)}offAll(t){delete this.handlers[t]}listen(t,n,r){return this.addEventListener(t,n,r),()=>this.removeEventListener(t,n)}once(t,n){return new Promise(r=>{const i=this.on(t,s=>{i(),n(s),r(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[n,r]of this.eventCounters.entries())t[n]={count:r.count,handlersCount:this.getHandlerCount(n)};return t}resetEventCounters(){this.eventCounters.clear()}}const de=le.getInstance(),Sn=(e,t)=>de.emit(e,t),$n=(e,t)=>de.on(e,t),An=(e,t)=>de.off(e,t),Rn=(e,t)=>de.once(e,t),Tn=(e,t,n)=>de.listen(e,t,n);function Fe(e){let t={...e};const n=[];function r(a){n.push(a),a(t)}function i(){return t}function s(a){const u=typeof a=="function"?a(t):a;t={...t,...u},o()}function o(){n.forEach(a=>a(t))}return{subscribe:r,getState:i,setState:s}}const Ke=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},Y=(e,t)=>{for(const n of e){const r=[],i=n.path.replace(/:[^/]+/g,a=>(r.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${i}$`),o=t.match(s);if(o){const a={};return r.forEach((u,m)=>{a[u]=o[m+1]}),{route:n,params:a}}}return{route:null,params:{}}},Ve={};async function dt(e){if(e.component)return e.component;if(e.load){if(Ve[e.path])return Ve[e.path];try{const t=await e.load();return Ve[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function pt(e){const{routes:t,base:n="",initialUrl:r}=e;let i,s,o,a,u,m,g;const w=async(v,b)=>{const c=t.find(p=>Y([p],v.path).route!==null);if(c?.beforeEnter)try{const p=await c.beforeEnter(v,b);return typeof p=="string"?(await d(p,!0),!1):p!==!1}catch(p){return ie("beforeEnter error",p),!1}return!0},h=async(v,b)=>{const c=t.find(p=>Y([p],v.path).route!==null);if(c?.onEnter)try{const p=await c.onEnter(v,b);return typeof p=="string"?(await d(p,!0),!1):p!==!1}catch(p){return ie("onEnter error",p),!1}return!0},l=(v,b)=>{const c=t.find(p=>Y([p],v.path).route!==null);if(c?.afterEnter)try{c.afterEnter(v,b)}catch(p){ie("afterEnter error",p)}},d=async(v,b=!1)=>{try{const c={path:v.replace(n,"")||"/",query:{}},p=Y(t,c.path);if(!p)throw new Error(`No route found for ${c.path}`);const y=o.getState(),C={path:c.path,params:p.params,query:c.query};if(!await w(C,y)||!await h(C,y))return;typeof window<"u"&&typeof document<"u"&&(b?window.history.replaceState({},"",n+v):window.history.pushState({},"",n+v)),o.setState(C),l(C,y)}catch(c){ie("Navigation error:",c)}};if(typeof window<"u"&&typeof document<"u"&&typeof r>"u"){i=()=>{const b=new URL(window.location.href),c=b.pathname.replace(n,"")||"/",p=Ke(b.search);return{path:c,query:p}},s=i();const v=Y(t,s.path);o=Fe({path:s.path,params:v.params,query:s.query}),a=async(b=!1)=>{const c=i();await d(c.path,b)},window.addEventListener("popstate",()=>a(!0)),u=b=>d(b,!1),m=b=>d(b,!0),g=()=>window.history.back()}else{i=()=>{const c=new URL(r||"/","http://localhost"),p=c.pathname.replace(n,"")||"/",y=Ke(c.search);return{path:p,query:y}},s=i();const v=Y(t,s.path);o=Fe({path:s.path,params:v.params,query:s.query}),a=async()=>{const c=i();await b(c.path)};const b=async c=>{try{const p={path:c.replace(n,"")||"/",query:{}},y=Y(t,p.path);if(!y)throw new Error(`No route found for ${p.path}`);const C=o.getState(),k={path:p.path,params:y.params,query:p.query},f=t.find(x=>Y([x],k.path).route!==null);if(f?.beforeEnter)try{const x=await f.beforeEnter(k,C);if(typeof x=="string"){await b(x);return}if(x===!1)return}catch{return}if(f?.onEnter)try{const x=await f.onEnter(k,C);if(typeof x=="string"){await b(x);return}if(x===!1)return}catch{return}if(o.setState(k),f?.afterEnter)try{f.afterEnter(k,C)}catch{}}catch{}};u=async c=>b(c),m=async c=>b(c),g=()=>{}}return{store:o,push:u,replace:m,back:g,subscribe:o.subscribe,matchRoute:v=>Y(t,v),getCurrent:()=>o.getState(),resolveRouteComponent:dt}}function On(e,t){return Y(e,t)}function Pn(e){const t=pt(e);return Be("router-view",(n={},r={})=>{const{onConnected:i}=r;if(i&&i(()=>{t&&typeof t.subscribe=="function"&&t.subscribe(()=>{})}),!t)return oe`<div>Router not initialized.</div>`;const s=t.getCurrent(),{path:o}=s,a=t.matchRoute(o);return a.route?t.resolveRouteComponent(a.route).then(u=>{if(typeof u=="string")return{tag:u,props:{},children:[]};if(typeof u=="function"){const m=u();return(m instanceof Promise?m:Promise.resolve(m)).then(w=>typeof w=="string"?{tag:w,props:{},children:[]}:w)}return oe`<div>Invalid route component</div>`}).catch(()=>oe`<div>Invalid route component</div>`):oe`<div>Not found</div>`}),Be("router-link",(n={},r={})=>{const{to:i="",tag:s="a",replace:o=!1,exact:a=!1,activeClass:u="active",exactActiveClass:m="exact-active",ariaCurrentValue:g="page",disabled:w=!1,external:h=!1,class:l=""}=n,d=t.getCurrent(),v=d.path===i,b=a?v:d&&typeof d.path=="string"?d.path.startsWith(i):!1,c=v?`aria-current="${g}"`:"",p=(l||"").split(/\s+/).filter(Boolean),y={};for(const _ of p)y[_]=!0;const C={...y,[u]:b,[m]:v},k=s==="button",f=w?k?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",x=h&&(s==="a"||!s)?'target="_blank" rel="noopener noreferrer"':"",R=_=>{if(w){_.preventDefault();return}h&&(s==="a"||!s)||(_.preventDefault(),o?t.replace(i):t.push(i))};return oe`
|
|
73
|
+
${ut().when(k,oe`
|
|
74
|
+
<button
|
|
75
|
+
part="button"
|
|
76
|
+
:class="${C}"
|
|
77
|
+
${c}
|
|
78
|
+
${f}
|
|
79
|
+
${x}
|
|
80
|
+
@click="${R}"
|
|
81
|
+
><slot></slot></button>
|
|
82
|
+
`).otherwise(oe`
|
|
83
|
+
<a
|
|
84
|
+
part="link"
|
|
85
|
+
href="${i}"
|
|
86
|
+
:class="${C}"
|
|
87
|
+
${c}
|
|
88
|
+
${f}
|
|
89
|
+
${x}
|
|
90
|
+
@click="${R}"
|
|
91
|
+
><slot></slot></a>
|
|
92
|
+
`).done()}
|
|
93
|
+
`}),t}$.GlobalEventBus=le,$.anchorBlock=M,$.component=Be,$.computed=wt,$.createStore=Fe,$.css=nt,$.each=pn,$.eachGroup=vn,$.eachPage=xn,$.eachWhere=bn,$.emit=Sn,$.eventBus=de,$.html=oe,$.initRouter=Pn,$.listen=Tn,$.match=ut,$.matchRoute=Y,$.matchRouteSSR=On,$.mediaVariants=ee,$.off=An,$.on=$n,$.once=Rn,$.parseQuery=Ke,$.ref=bt,$.renderToString=Ee,$.resolveRouteComponent=dt,$.responsive=ft,$.responsiveOrder=qe,$.responsiveSwitch=_n,$.switchOn=En,$.switchOnLength=wn,$.switchOnPromise=kn,$.unless=gn,$.useEmit=en,$.useOnAttributeChanged=rn,$.useOnConnected=tn,$.useOnDisconnected=nn,$.useOnError=sn,$.useRouter=pt,$.useStyle=on,$.watch=vt,$.when=we,$.whenEmpty=mn,$.whenMedia=U,$.whenNotEmpty=yn,$.whenVariants=Cn,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})}));
|
|
88
94
|
//# sourceMappingURL=custom-elements-runtime.umd.js.map
|