what-core 0.7.0 → 0.8.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/dist/index.js +9 -0
- package/dist/index.js.map +2 -2
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +3 -3
- package/dist/render.js +7 -0
- package/dist/render.js.map +2 -2
- package/dist/render.min.js +1 -1
- package/dist/render.min.js.map +3 -3
- package/dist/testing.js.map +2 -2
- package/dist/testing.min.js.map +2 -2
- package/package.json +1 -1
- package/src/dom.js +0 -1
- package/src/guardrails.js +2 -0
- package/src/index.js +3 -0
- package/src/render.js +13 -1
package/dist/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var A=!(typeof process<"u"),P=null;function yn(e){A&&(P=e)}var B=null,q=null,X=null,De=!1,Ee=0,z=[],$e=!1,Ue=Symbol("needs_upstream"),Re=null;function y(e,t){let n=e,r=new Set,s=null,o=0;function i(a){A&&De&&console.warn("[what] Signal.set() called inside a computed function. This may cause infinite loops. Use effect() instead."+(t?` (signal: ${t})`:""));let l=typeof a=="function"?a(n):a;n===l||n!==n&&l!==l||(n=l,s=null,A&&P&&P.onSignalUpdate(c),r.size>0&&pt(r))}function c(a){if(arguments.length===0){let l=B;return l!==null&&(l!==s||l._epoch!==o)&&(s=l,o=l._epoch,r.add(l),l.deps.push(r)),n}i(a)}return c.set=i,c.peek=()=>n,c.subscribe=a=>N(()=>a(c())),c._signal=!0,A&&(c._subs=r,t&&(c._debugName=t)),A&&P&&P.onSignalCreate(c),c}function W(e){let t,n=!0,r=new Set,s=null,o=0,i=Xe(()=>{let a=De;A&&(De=!0);try{t=e(),n=!1}finally{A&&(De=a)}},!0);i._level=1,i._computed=!0,i._computedSubs=r,r._owner=i,i._markDirty=()=>{n=!0},i._isDirty=()=>n;function c(){let a=B;return a!==null&&(a!==s||a._epoch!==o)&&(s=a,o=a._epoch,r.add(a),a.deps.push(r)),n&<(i),t}return i._onNotify=()=>{n=!0,s=null,r.size>0&&pt(r)},c._signal=!0,c.peek=()=>(n&<(i),t),c}function lt(e){if(Re!==null)throw Re.push(e),Ue;let t=[e];Re=t;try{for(;t.length>0;){let n=t[t.length-1];if(!n._isDirty||!n._isDirty()){t.pop();continue}let r=!1,s=n.deps;for(let o=0;o<s.length;o++){let i=s[o]._owner;i&&i._computed&&i._isDirty&&i._isDirty()&&(t.push(i),r=!0)}if(!r)try{let o=n.deps.length;Ye(n),n.deps.length!==o&&Fe(n),t.pop()}catch(o){if(o===Ue)n._markDirty();else throw o}}}finally{Re=null}}function Fe(e){let t=0,n=e.deps;for(let r=0;r<n.length;r++){let s=n[r]._owner;if(s){let o=s._level;o>t&&(t=o)}}e._level=t+1}function N(e,t){let n=Xe(e);n._level=1;let r=B;B=n;try{let o=n.fn();typeof o=="function"&&(n._cleanup=o)}finally{B=r}Fe(n),t?.stable&&(n._stable=!0);let s=()=>ft(n);return q&&q.disposals.push(s),s}function H(e){Ee++;try{e()}finally{Ee--,Ee===0&&Ke()}}function Xe(e,t){let n={fn:e,deps:[],lazy:t||!1,_onNotify:null,disposed:!1,_pending:!1,_stable:!1,_level:0,_computed:!1,_computedSubs:null,_isDirty:null,_markDirty:null,_cleanup:null,_epoch:0};return A&&P&&P.onEffectCreate(n),n}function Ye(e){if(e.disposed)return;if(e._stable){if(e._cleanup){try{e._cleanup()}catch(s){A&&console.warn("[what] Error in effect cleanup:",s)}e._cleanup=null}let r=B;B=null;try{let s=e.fn();typeof s=="function"&&(e._cleanup=s)}catch(s){P?.onError&&P.onError(s,{type:"effect",effect:e}),A&&console.warn("[what] Error in stable effect:",s)}finally{B=r}A&&P?.onEffectRun&&P.onEffectRun(e);return}let t=e.deps.length===1?e.deps[0]:null;if(dt(e),e._cleanup){try{e._cleanup()}catch(r){A&&P?.onError&&P.onError(r,{type:"effect-cleanup",effect:e}),A&&console.warn("[what] Error in effect cleanup:",r)}e._cleanup=null}let n=B;B=e;try{let r=e.fn();typeof r=="function"&&(e._cleanup=r)}catch(r){throw r===Ue||A&&P?.onError&&P.onError(r,{type:"effect",effect:e}),r}finally{B=n}t!==null&&e.deps.length===1&&e.deps[0]===t&&!e._cleanup&&!e._pending&&(e._stable=!0),A&&P?.onEffectRun&&P.onEffectRun(e)}function ft(e){if(e.disposed=!0,A&&P&&P.onEffectDispose(e),dt(e),e._cleanup){try{e._cleanup()}catch(t){A&&console.warn("[what] Error in effect cleanup on dispose:",t)}e._cleanup=null}}function dt(e){let t=e.deps;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0,e._epoch++}var ze=0,de=null,xe=0;function ut(e){if(!e.disposed){if(e._onNotify)e._onNotify();else if(!e._pending)if(Ee===0&&e._stable){let t=B;B=null;try{let n=e.fn();if(typeof n=="function"){if(e._cleanup)try{e._cleanup()}catch{}e._cleanup=n}}catch(n){A&&P?.onError&&P.onError(n,{type:"effect",effect:e}),A&&console.warn("[what] Error in stable effect:",n)}finally{B=t}}else{e._pending=!0;let t=e._level,n=z.length;n>0&&z[n-1]._level>t&&($e=!0),z.push(e)}}}function pt(e){if(ze===0){ze=1;try{for(let t of e)ut(t);if(xe>0){let t=0;for(;t<xe;){let n=de[t];de[t]=null,t++;for(let r of n)ut(r)}xe=0}}finally{ze=0}Ee===0&&z.length>0&&xn()}else de===null&&(de=[]),xe>=de.length?de.push(e):de[xe]=e,xe++}var Oe=!1;function xn(){Oe||(Oe=!0,queueMicrotask(()=>{Oe=!1,Ke()}))}var Pe=!1;function Ke(){if(!Pe){Pe=!0;try{let e=0;for(;z.length>0&&e<25;){let t=z;z=[],t.length>1&&$e&&t.sort((n,r)=>n._level-r._level),$e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r._pending=!1,!r.disposed&&!r._onNotify){let s=r.deps.length;Ye(r),!r._computed&&r.deps.length!==s&&Fe(r)}}e++}if(e>=25){if(A){let n=z.slice(0,3).map(r=>r.fn?.name||r.fn?.toString().slice(0,60)||"(anonymous)");console.warn(`[what] Possible infinite effect loop detected (25 iterations). Likely cause: an effect writes to a signal it also reads, creating a cycle. Use untrack() to read signals without subscribing. Looping effects: ${n.join(", ")}`)}else console.warn("[what] Possible infinite effect loop detected");for(let t=0;t<z.length;t++)z[t]._pending=!1;z.length=0}}finally{Pe=!1}}}function bn(e){let t,n=new Set,r=Xe(()=>{let o=e();if(!Object.is(t,o)){t=o;for(let i of n)if(!i.disposed){if(i._onNotify)i._onNotify();else if(!i._pending){i._pending=!0;let c=i._level,a=z.length;a>0&&z[a-1]._level>c&&($e=!0),z.push(i)}}}});r._level=1,Ye(r),Fe(r),n._owner=r,q&&q.disposals.push(()=>ft(r));function s(){return B&&(n.add(B),B.deps.push(n)),t}return s._signal=!0,s.peek=()=>t,s}function wn(){if(Pe){A&&console.warn("[what] flushSync() called during an active flush (e.g., inside a component render or effect). This is a no-op to prevent infinite loops. Move flushSync() to an event handler or onMount callback.");return}if(B){A&&console.warn("[what] flushSync() called during effect execution. This is a no-op to prevent infinite loops. Move flushSync() to an event handler or onMount callback.");return}Oe=!1,Ke()}function ie(e){let t=B;B=null;try{return e()}finally{B=t}}function _n(){return X}function Cn(e,t){let n=X,r=q;X=e,q=e;try{return t()}finally{X=n,q=r}}function En(e){let t=q,n=X,r={disposals:[],owner:X,children:[],_disposed:!1};X&&X.children.push(r),q=r,X=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let o=r.children.length-1;o>=0;o--)Qe(r.children[o]);r.children.length=0;for(let o=r.disposals.length-1;o>=0;o--)r.disposals[o]();if(r.disposals.length=0,r.owner){let o=r.owner.children.indexOf(r);o>=0&&r.owner.children.splice(o,1)}}})}finally{q=t,X=n}}function Qe(e){if(!e._disposed){e._disposed=!0;for(let t=e.children.length-1;t>=0;t--)Qe(e.children[t]);e.children.length=0;for(let t=e.disposals.length-1;t>=0;t--)e.disposals[t]();e.disposals.length=0}}function pe(e){let t=q,n=X,r={disposals:[],owner:null,children:[],_disposed:!1};q=r,X=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let o=r.children.length-1;o>=0;o--)Qe(r.children[o]);r.children.length=0;for(let o=r.disposals.length-1;o>=0;o--)r.disposals[o]();r.disposals.length=0}})}finally{q=t,X=n}}function kn(e){q&&q.disposals.push(e)}var vn=Object.create(null),ht=[];function L(e,t){t=t||vn;let n=arguments.length,r;if(n<=2)r=ht;else if(n===3)r=An(arguments[2]);else{let o=[];for(let i=2;i<n;i++)Je(arguments[i],o);r=o}let s=t.key??null;return t.key!==void 0&&(t={...t},delete t.key),{tag:e,props:t,children:r,key:s,_vnode:!0}}function Sn({children:e}){return e}function An(e){if(e==null||e===!1||e===!0)return ht;if(Array.isArray(e)){let t=[];return Je(e,t),t}return typeof e=="object"&&e._vnode?[e]:typeof e=="function"?[e]:[String(e)]}function Je(e,t){if(!(e==null||e===!1||e===!0))if(Array.isArray(e))for(let n=0;n<e.length;n++)Je(e[n],t);else typeof e=="object"&&e._vnode||typeof e=="function"?t.push(e):t.push(String(e))}function Tn(e,...t){let n=e.reduce((r,s,o)=>r+s+(o<t.length?`\0${o}\0`:""),"");return Ln(n,t)}function Ln(e,t){e=e.trim();let n=[],r=0;for(;r<e.length;){if(e[r]==="<"){let o=gt(e,r,t);if(o){n.push(o.node),r=o.end;continue}}let s=mt(e,r,t);s.text&&n.push(s.text),r=s.end}return n.length===1?n[0]:n}function gt(e,t,n){let r=e.slice(t).match(/^<([a-zA-Z][a-zA-Z0-9-]*|[A-Z]\w*)/);if(!r)return null;let s=r[1],o=t+r[0].length,i={};for(;o<e.length;){for(;o<e.length&&/\s/.test(e[o]);)o++;if(e.slice(o,o+2)==="/>")return{node:L(s,Object.keys(i).length?i:null),end:o+2};if(e[o]===">"){o++;break}if(e.slice(o,o+3)==="..."){let f=e.slice(o+3).match(/^\x00(\d+)\x00/);if(f){Object.assign(i,n[Number(f[1])]),o+=3+f[0].length;continue}}let l=e.slice(o).match(/^([a-zA-Z_@:][a-zA-Z0-9_:.-]*)/);if(!l)break;let u=l[1];for(o+=l[0].length;o<e.length&&/\s/.test(e[o]);)o++;if(e[o]==="="){for(o++;o<e.length&&/\s/.test(e[o]);)o++;let f=e.slice(o).match(/^\x00(\d+)\x00/);if(f)i[u]=n[Number(f[1])],o+=f[0].length;else if(e[o]==='"'||e[o]==="'"){let h=e[o];o++;let x="";for(;o<e.length&&e[o]!==h;){let m=e.slice(o).match(/^\x00(\d+)\x00/);m?(x+=String(n[Number(m[1])]),o+=m[0].length):(x+=e[o],o++)}o++,i[u]=x}}else i[u]=!0}let c=[],a=`</${s}>`;for(;o<e.length;){if(e.slice(o,o+a.length)===a){o+=a.length;break}if(e[o]==="<"){let u=gt(e,o,n);if(u){c.push(u.node),o=u.end;continue}}let l=mt(e,o,n);l.text!=null&&c.push(l.text),o=l.end}return{node:L(s,Object.keys(i).length?i:null,...c),end:o}}function mt(e,t,n){let r=t,s="";for(;r<e.length&&e[r]!=="<";){let o=e.slice(r).match(/^\x00(\d+)\x00/);if(o)return s.trim()?{text:s.trim(),end:r}:{text:n[Number(o[1])],end:r+o[0].length};s+=e[r],r++}return{text:s.trim()||null,end:r}}function Mn(e,t){let n=function(s){return e(s)};return n.displayName=`Memo(${e.name||"Anonymous"})`,n}var yt=null;function xt(e){yt=e}function Nn(e){let t=null,n=null,r=null,s=new Set;function o(i){if(r)throw r;if(t)return L(t,i);throw n||(n=e().then(c=>{t=c.default||c,s.forEach(a=>a()),s.clear()}).catch(c=>{r=c})),n}return o.displayName="Lazy",o._lazy=!0,o._onLoad=i=>{t?i():s.add(i)},o}function In({fallback:e,children:t}){let n=y(!1),r=new Set;return{tag:"__suspense",props:{boundary:{_suspense:!0,onSuspend(o){n.set(!0),r.add(o),o.finally(()=>{r.delete(o),r.size===0&&n.set(!1)})}},fallback:e,loading:n},children:Array.isArray(t)?t:[t],_vnode:!0}}function Rn({fallback:e,children:t,onError:n}){let r=y(null);return{tag:"__errorBoundary",props:{errorState:r,handleError:i=>{if(r.set(i),n)try{n(i)}catch(c){console.error("Error in onError handler:",c)}},fallback:e,reset:()=>r.set(null)},children:Array.isArray(t)?t:[t],_vnode:!0}}function bt(e,t){let n=t||yt?.();for(;n;){if(n._errorBoundary)return n._errorBoundary(e),!0;n=n._parentCtx}return!1}function Dn({when:e,fallback:t=null,children:n}){return(typeof e=="function"?e():e)?n:t}function On({each:e,fallback:t=null,children:n}){let r=typeof e=="function"?e():e;if(!r||r.length===0)return t;let s=Array.isArray(n)?n[0]:n;return typeof s!="function"?(console.warn("[what] For: children must be a render function, e.g. <For each={items}>{(item) => ...}</For>"),t):r.map((o,i)=>{let c=s(o,i);return c&&typeof c=="object"&&c.key==null&&(o!=null&&typeof o=="object"?o.id!=null?c.key=o.id:o.key!=null&&(c.key=o.key):(typeof o=="string"||typeof o=="number")&&(c.key=o)),c})}function Pn({fallback:e=null,children:t}){let n=Array.isArray(t)?t:[t];for(let r of n)if(r&&r.tag===Ze&&(typeof r.props.when=="function"?r.props.when():r.props.when))return r.children;return e}function Ze({when:e,children:t}){return{tag:Ze,props:{when:e},children:t,_vnode:!0}}function $n({component:e,mode:t,mediaQuery:n,...r}){let s=L("div",{"data-island":e.name||"Island","data-hydrate":t}),o=y(null),i=y(!1);function c(){i()||(i.set(!0),o.set(L(e,r)))}function a(u){switch(t){case"load":queueMicrotask(c);break;case"idle":typeof requestIdleCallback<"u"?requestIdleCallback(c):setTimeout(c,200);break;case"visible":{let f=new IntersectionObserver(h=>{h[0].isIntersecting&&(f.disconnect(),c())});f.observe(u);break}case"interaction":{let f=()=>{u.removeEventListener("click",f),u.removeEventListener("focus",f),u.removeEventListener("mouseenter",f),c()};u.addEventListener("click",f,{once:!0}),u.addEventListener("focus",f,{once:!0}),u.addEventListener("mouseenter",f,{once:!0});break}case"media":{if(!n){c();break}let f=window.matchMedia(n);if(f.matches)queueMicrotask(c);else{let h=()=>{f.matches&&(f.removeEventListener("change",h),c())};f.addEventListener("change",h)}break}default:queueMicrotask(c)}}let l=u=>{u&&a(u)};return L("div",{"data-island":e.name||"Island","data-hydrate":t,ref:l},i()?o():null)}var wt=!1;function Fn(e,t,n){return wt||(wt=!0,console.warn("[what] each() is deprecated. Use the <For> component or Array.map() instead.")),!e||e.length===0?[]:e.map((r,s)=>{let o=t(r,s);return n&&o&&typeof o=="object"&&(o.key=n(r,s)),o})}function jn(...e){let t=[];for(let n of e)if(n){if(typeof n=="string")t.push(n);else if(typeof n=="object")for(let[r,s]of Object.entries(n))s&&t.push(r)}return t.join(" ")}function Bn(e){return typeof e=="string"?e:Object.entries(e).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>`${Hn(t)}:${n}`).join(";")}function Hn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Vn(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function qn(e,t){let n=0;return(...r)=>{let s=Date.now();s-n>=t&&(n=s,e(...r))}}var je=null;function _t(e){je=e}function Wn(e){if(typeof window>"u")return y(!1);let t=window.matchMedia(e),n=y(t.matches),r=o=>n.set(o.matches);t.addEventListener("change",r);let s=je?.();return s&&(s._cleanupCallbacks=s._cleanupCallbacks||[],s._cleanupCallbacks.push(()=>t.removeEventListener("change",r))),n}function Gn(e,t){let n;try{let c=localStorage.getItem(e);n=c!==null?JSON.parse(c):t}catch{n=t}let r=y(n),s=N(()=>{try{localStorage.setItem(e,JSON.stringify(r()))}catch(c){A&&console.warn("[what] localStorage write failed (quota exceeded?):",c)}}),o=null;typeof window<"u"&&(o=c=>{if(c.key===e&&c.newValue!==null)try{r.set(JSON.parse(c.newValue))}catch(a){A&&console.warn("[what] localStorage parse failed:",a)}},window.addEventListener("storage",o));let i=je?.();return i&&(i._cleanupCallbacks=i._cleanupCallbacks||[],i._cleanupCallbacks.push(()=>{s(),o&&window.removeEventListener("storage",o)})),r}function zn({target:e,children:t}){if(typeof document>"u")return null;let n=typeof e=="string"?document.querySelector(e):e;return n?{tag:"__portal",props:{container:n},children:Array.isArray(t)?t:[t],_vnode:!0}:null}function Un(e,t){if(typeof document>"u")return;let n=s=>{let o=e.current||e;!o||o.contains(s.target)||t(s)};document.addEventListener("mousedown",n),document.addEventListener("touchstart",n);let r=je?.();r&&(r._cleanupCallbacks=r._cleanupCallbacks||[],r._cleanupCallbacks.push(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}))}function Xn(e,t){return{class:t?`${e}-enter ${e}-enter-active`:`${e}-leave ${e}-leave-active`}}var Yn=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","foreignObject","linearGradient","radialGradient","stop","marker","animate","animateTransform","animateMotion","set","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence"]),Kn="http://www.w3.org/2000/svg",kt=new Set,Be=new WeakMap;function Qn(e){return!e||typeof e!="object"?!1:typeof Node<"u"&&e instanceof Node?!0:typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function Ct(e){return!!e&&typeof e=="object"&&(e._vnode===!0||"tag"in e)}function Et(e){if(!e.disposed){if(e.disposed=!0,e.cleanups)for(let t of e.cleanups)try{t()}catch(n){console.error("[what] cleanup error:",n)}if(e.effects)for(let t of e.effects)try{t()}catch{}if(e.hooks){for(let t of e.hooks)if(t&&typeof t.cleanup=="function")try{t.cleanup()}catch(n){console.error("[what] hook cleanup error:",n)}}if(e._cleanupCallbacks)for(let t of e._cleanupCallbacks)try{t()}catch(n){console.error("[what] onCleanup error:",n)}A&&P?.onComponentUnmount&&P.onComponentUnmount(e),kt.delete(e)}}function Y(e){if(!e)return;if(e._componentCtx&&Et(e._componentCtx),e.nodeType===8){let n=Be.get(e);n&&Et(n)}if(e._dispose)try{e._dispose()}catch{}if(e._propEffects)for(let n in e._propEffects)try{e._propEffects[n]()}catch{}let t=e.childNodes;if(t&&t.length>0)for(let n=0;n<t.length;n++)Y(t[n])}function Jn(e,t){typeof t=="string"&&(t=document.querySelector(t)),Y(t),t.textContent="";let n=J(e,t);return n&&t.appendChild(n),()=>{Y(t),t.textContent=""}}function J(e,t,n){if(e==null||e===!1||e===!0)return document.createComment("");if(typeof e=="string"||typeof e=="number")return document.createTextNode(String(e));if(Qn(e))return e;if(typeof e=="function"){let r=document.createComment("fn"),s=document.createComment("/fn"),o=[],i=document.createDocumentFragment();i.appendChild(r),i.appendChild(s);let c=N(()=>{let a=e(),l=a==null||a===!1||a===!0?[]:Array.isArray(a)?a:[a],u=s.parentNode;if(u){for(let f of o)Y(f),f.parentNode===u&&u.removeChild(f);o=[];for(let f of l){let h=J(f,u,t?._isSvg);if(h)if(h.nodeType===11){let x=Array.from(h.childNodes);u.insertBefore(h,s);for(let m of x)o.push(m)}else u.insertBefore(h,s),o.push(h)}}});return r._dispose=c,s._dispose=c,i}if(Array.isArray(e)){let r=document.createDocumentFragment();for(let s of e){let o=J(s,t,n);o&&r.appendChild(o)}return r}return Ct(e)&&typeof e.tag=="function"?er(e,t,n):Ct(e)?or(e,t,n):document.createTextNode(String(e))}var Zn={get(e,t){if(t!=="_sig")return e._sig()[t]},has(e,t){return t==="_sig"?!1:t in e._sig()},ownKeys(e){return Reflect.ownKeys(e._sig())},getOwnPropertyDescriptor(e,t){if(t==="_sig")return;let n=e._sig();if(t in n)return{value:n[t],writable:!1,enumerable:!0,configurable:!0}}},V=[];function G(){return V[V.length-1]}xt(G);_t(G);function vt(){return V}function er(e,t,n){let{tag:r,props:s,children:o}=e;if(typeof r=="function"&&(r.prototype?.isReactComponent||r.prototype?.render)){let d=r;r=function(S){return new d(S).render()},r.displayName=d.displayName||d.name||"ClassComponent"}if(r==="__errorBoundary"||e.tag==="__errorBoundary")return tr(e,t);if(r==="__suspense"||e.tag==="__suspense")return nr(e,t);if(r==="__portal"||e.tag==="__portal")return rr(e,t);let i=V[V.length-1]||null,c=null;if(i&&(c=i._errorBoundary||null,!c)){let d=i._parentCtx;for(;d;){if(d._errorBoundary){c=d._errorBoundary;break}d=d._parentCtx}}let a={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:r,_parentCtx:i,_errorBoundary:c},l=document.createComment("c:start"),u=document.createComment("c:end");Be.set(l,a),a._startComment=l,a._endComment=u;let f=document.createDocumentFragment();f._componentCtx=a,a._wrapper=l,kt.add(a),A&&P?.onComponentMount&&P.onComponentMount(a);let h=o.length===0?void 0:o.length===1?o[0]:o,x;h!==void 0?x=s?Object.assign({},s,{children:h}):{children:h}:x=s?Object.assign({},s):{};let m=y(x);a._propsSignal=m;let w=new Proxy({_sig:m},Zn);V.push(a);let k;try{k=r(w)}catch(d){if(V.pop(),!bt(d,a))throw console.error("[what] Uncaught error in component:",r.name||"Anonymous",d),d;return f.appendChild(l),f.appendChild(u),f}V.pop(),a.mounted=!0,a._mountCallbacks&&queueMicrotask(()=>{if(!a.disposed)for(let d of a._mountCallbacks)try{d()}catch(b){console.error("[what] onMount error:",b)}}),f.appendChild(l);let g=Array.isArray(k)?k:[k];for(let d of g){let b=J(d,f,n);b&&f.appendChild(b)}return f.appendChild(u),f}function tr(e,t){let{errorState:n,handleError:r,fallback:s,reset:o}=e.props,i=e.children,c=document.createComment("eb:start"),a=document.createComment("eb:end"),l={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:V[V.length-1]||null,_errorBoundary:r,_startComment:c,_endComment:a};Be.set(c,l);let u=document.createDocumentFragment();u._componentCtx=l,u.appendChild(c),u.appendChild(a);let f=N(()=>{let h=n();if(V.push(l),c.parentNode)for(;c.nextSibling&&c.nextSibling!==a;){let m=c.nextSibling;Y(m),m.parentNode.removeChild(m)}let x;h?x=typeof s=="function"?[s({error:h,reset:o})]:[s]:x=i,x=Array.isArray(x)?x:[x];for(let m of x){let w=J(m,t);w&&(a.parentNode?a.parentNode.insertBefore(w,a):u.insertBefore(w,a))}V.pop()});return l.effects.push(f),u}function nr(e,t){let{boundary:n,fallback:r,loading:s}=e.props,o=e.children,i=document.createComment("sb:start"),c=document.createComment("sb:end"),a={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:V[V.length-1]||null,_startComment:i,_endComment:c};Be.set(i,a);let l=document.createDocumentFragment();l._componentCtx=a,l.appendChild(i),l.appendChild(c);let u=N(()=>{let h=s()?[r]:o,x=Array.isArray(h)?h:[h];if(V.push(a),i.parentNode)for(;i.nextSibling&&i.nextSibling!==c;){let m=i.nextSibling;Y(m),m.parentNode.removeChild(m)}for(let m of x){let w=J(m,t);w&&(c.parentNode?c.parentNode.insertBefore(w,c):l.insertBefore(w,c))}V.pop()});return a.effects.push(u),l}function rr(e,t){let{container:n}=e.props,r=e.children;if(!n)return console.warn("[what] Portal: target container not found"),document.createComment("portal:empty");let s={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:V[V.length-1]||null},o=document.createComment("portal");o._componentCtx=s;let i=[];for(let c of r){let a=J(c,n);a&&(n.appendChild(a),i.push(a))}return s._cleanupCallbacks=[()=>{for(let c of i)Y(c),c.parentNode&&c.parentNode.removeChild(c)}],o}function or(e,t,n){let{tag:r,props:s,children:o}=e,i=n||Yn.has(r),c=i?document.createElementNS(Kn,r):document.createElement(r);s&&sr(c,s,{},i);let a=i&&r!=="foreignObject";for(let l=0;l<o.length;l++){let u=J(o[l],c,a);u&&c.appendChild(u)}return c._vnode=e,c}function sr(e,t,n,r){if(t){for(let s in t)if(!(s==="key"||s==="children")){if(s==="ref"){let o=t.ref;typeof o=="function"?o(e):o&&(o.current=e);continue}St(e,s,t[s],r)}}}function St(e,t,n,r){if(typeof n=="function"&&!(t.startsWith("on")&&t.length>2)&&t!=="ref"){if(e._propEffects||(e._propEffects={}),e._propEffects[t])try{e._propEffects[t]()}catch{}e._propEffects[t]=N(()=>{let s=n();St(e,t,s,r)});return}if(t.startsWith("on")&&t.length>2){let s=t.slice(2),o=!1;s.endsWith("Capture")&&(s=s.slice(0,-7),o=!0);let i=s.toLowerCase(),c=o?i+"_capture":i,a=e._events?.[c];if(a&&a._original===n||(a&&e.removeEventListener(i,a,o),n==null))return;e._events||(e._events={});let l=f=>(f.nativeEvent||(f.nativeEvent=f),ie(()=>l._handler(f)));l._handler=n,l._original=n,e._events[c]=l;let u=n._eventOpts;e.addEventListener(i,l,u||o||void 0);return}if(t==="className"||t==="class"){r?e.setAttribute("class",n||""):e.className=n||"";return}if(t==="style"){if(typeof n=="string")e.style.cssText=n,e._prevStyle=null;else if(typeof n=="object"){let s=e._prevStyle||{};for(let o in s)o in n||(e.style[o]="");for(let o in n)e.style[o]=n[o]??"";e._prevStyle={...n}}return}if(t==="dangerouslySetInnerHTML"){e.innerHTML=n?.__html??"";return}if(t==="innerHTML"){if(n==null)return;if(n&&typeof n=="object"&&"__html"in n)e.innerHTML=n.__html??"";else{A&&console.warn("[what] innerHTML received a raw string. This is a security risk (XSS). Use innerHTML={{ __html: trustedString }} or dangerouslySetInnerHTML={{ __html: trustedString }} instead.");return}return}if(typeof n=="boolean"){n?e.setAttribute(t,""):e.removeAttribute(t);return}if(t.startsWith("data-")||t.startsWith("aria-")){e.setAttribute(t,n);return}if(r){n===!1||n==null?e.removeAttribute(t):e.setAttribute(t,n===!0?"":String(n));return}t in e?e[t]=n:e.setAttribute(t,n)}function ir(e,t,n){if(n&&n.length>0){let r=n.length===1?n[0]:n;t?t.children=r:t={children:r}}return J({tag:e,props:t||{},children:n||[],key:null,_vnode:!0})}var At=new Set(["href","src","action","formaction","formAction"]);function cr(e){if(typeof e!="string")return!0;let t=e.trim().replace(/[\s\x00-\x1f]/g,"").toLowerCase();return!(t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))}var ar={tr:{depth:2,wrap:"<table><tbody>",unwrap:"</tbody></table>"},td:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},th:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},thead:{depth:1,wrap:"<table>",unwrap:"</table>"},tbody:{depth:1,wrap:"<table>",unwrap:"</table>"},tfoot:{depth:1,wrap:"<table>",unwrap:"</table>"},colgroup:{depth:1,wrap:"<table>",unwrap:"</table>"},col:{depth:1,wrap:"<table>",unwrap:"</table>"},caption:{depth:1,wrap:"<table>",unwrap:"</table>"}},lr=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","text","tspan","foreignObject","clipPath","mask","pattern","linearGradient","radialGradient","stop","marker","symbol","image","animate","animateTransform","animateMotion","set","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feImage","feMorphology","feSpecularLighting","feTile","feTurbulence","feDistantLight","fePointLight","feSpotLight"]);function It(e){let t=e.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);return t?t[1]:""}function Rt(e){let t=e.trim(),n=It(t);if(lr.has(n))return Ot(t);let r=ar[n];if(r){let o=document.createElement("template");o.innerHTML=r.wrap+t+r.unwrap;let i=o.content.firstChild;for(let c=0;c<r.depth;c++)i=i.firstChild;return()=>i.cloneNode(!0)}let s=document.createElement("template");return s.innerHTML=t,()=>s.content.firstChild.cloneNode(!0)}var Tt=!1;function Dt(e){return A&&!Tt&&(Tt=!0,console.warn("[what] template() is a compiler internal. Use JSX instead. Direct calls with user input can lead to XSS vulnerabilities.")),Rt(e)}function Ot(e){let t=e.trim();if(It(t)==="svg"){let s=document.createElement("template");return s.innerHTML=t,()=>s.content.firstChild.cloneNode(!0)}let r=document.createElement("template");return r.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,()=>r.content.firstChild.firstChild.cloneNode(!0)}function ur(e,t,n){if(typeof t=="function"){let r=t(),s=typeof r;if(s==="string"||s==="number"){let i=document.createTextNode(String(r)),c=n||null;c?e.insertBefore(i,c):e.appendChild(i);let a=i,l=!0;return N(()=>{let u=t(),f=typeof u;if(l&&(f==="string"||f==="number")){let h=String(u);i.data!==h&&(i.data=h)}else l=!1,a=be(e,u,a,c)}),i}let o=r!=null?be(e,r,null,n||null):null;return N(()=>{o=be(e,t(),o,n||null)}),o}if(typeof t=="string"||typeof t=="number"){let r=document.createTextNode(String(t));return n?e.insertBefore(r,n):e.appendChild(r),r}return t!=null&&typeof t=="object"&&t.nodeType>0?(n?e.insertBefore(t,n):e.appendChild(t),t):be(e,t,null,n||null)}function Pt(e){return!e||typeof e!="object"?!1:typeof Node<"u"&&e instanceof Node?!0:typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function fr(e){return!!e&&typeof e=="object"&&(e._vnode===!0||"tag"in e)}var dr=typeof SVGElement<"u";function pr(e){return dr&&e instanceof SVGElement&&e.tagName!=="foreignObject"}function Lt(e){return e==null?[]:Array.isArray(e)?e:[e]}function $t(e,t,n){if(e==null||typeof e=="boolean")return n;if(Array.isArray(e)){for(let r=0;r<e.length;r++)$t(e[r],t,n);return n}return typeof e=="string"||typeof e=="number"?(n.push(document.createTextNode(String(e))),n):Pt(e)?(n.push(e),n):fr(e)?(n.push(J(e,t,pr(t))),n):(n.push(document.createTextNode(String(e))),n)}function hr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function be(e,t,n,r){if(!e||typeof e.insertBefore!="function")return A&&console.warn("[what] reconcileInsert called with invalid parent:",e),n;let s=r||null;if(t==null||typeof t=="boolean"){let l=Lt(n);for(let u=0;u<l.length;u++){let f=l[u];f.parentNode===e&&(Y(f),e.removeChild(f))}return null}if((typeof t=="string"||typeof t=="number")&&n&&!Array.isArray(n)&&n.nodeType===3){let l=String(t);return n.data!==l&&(n.data=l),n}if(typeof t=="object"&&t!==null&&t.nodeType>0&&!Array.isArray(t)){if(t===n)return n;if(n&&!Array.isArray(n)&&n.nodeType>0)return n.parentNode===e?(Y(n),e.replaceChild(t,n)):s?e.insertBefore(t,s):e.appendChild(t),t}let o=$t(t,e,[]),i=Lt(n);if(hr(i,o))return n;let c=o.length;for(let l=0;l<i.length;l++){let u=i[l];if(u.parentNode!==e)continue;let f=!1;for(let h=0;h<c;h++)if(o[h]===u){f=!0;break}f||(Y(u),e.removeChild(u))}let a=s;for(let l=o.length-1;l>=0;l--){let u=o[l];(u.parentNode!==e||u.nextSibling!==a)&&(a&&a.parentNode!==e&&(a=null),a?e.insertBefore(u,a):e.appendChild(u)),a=u}return o.length===0?null:o.length===1?o[0]:o}function gr(e,t,n){let r=n?.key,s=n?.raw||!1;return(o,i)=>{let c=[],a=[],l=[],u=r&&!s?new Map:null,f=document.createComment("/list");return o.insertBefore(f,i||null),N(()=>{let h=e()||[];r?br(o,f,c,h,a,l,t,r,u):mr(o,f,c,h,a,l,t),c=h.length>0?h.slice():h}),f}}function mr(e,t,n,r,s,o,i){let c=r.length,a=n.length;if(c===0){if(a>0){for(let g=0;g<a;g++)o[g]&&o[g]();for(let g=a-1;g>=0;g--){let d=s[g];d&&((d._componentCtx||d._dispose||d._propEffects)&&Y(d),d.parentNode===e&&e.removeChild(d))}s.length=0,o.length=0}return}if(a===0){let g=document.createDocumentFragment();for(let d=0;d<c;d++){let b=r[d],S=pe(T=>(o[d]=T,i(b,d)));s[d]=S,g.appendChild(S)}e.insertBefore(g,t);return}let l=0,u=Math.min(a,c);for(;l<u&&n[l]===r[l];)l++;if(l===a&&l===c)return;let f=a-1,h=c-1;for(;f>=l&&h>=l&&n[f]===r[h];)f--,h--;let x=new Array(c),m=new Array(c);for(let g=0;g<l;g++)x[g]=s[g],m[g]=o[g];for(let g=h+1;g<c;g++){let d=f+1+(g-h-1);x[g]=s[d],m[g]=o[d]}let w=h-l+1,k=f-l+1;if(w===0)for(let g=l;g<=f;g++)o[g]?.(),s[g]?.parentNode&&s[g].parentNode.removeChild(s[g]);else if(k===0){let g=l<c&&x[h+1]?x[h+1]:t,d=document.createDocumentFragment();for(let b=l;b<=h;b++){let S=r[b],T=b;x[b]=pe(E=>(m[T]=E,i(S,T))),d.appendChild(x[b])}e.insertBefore(d,g)}else yr(e,t,n,r,s,o,i,l,f,h,x,m);s.length=c,o.length=c;for(let g=0;g<c;g++)s[g]=x[g],o[g]=m[g]}function yr(e,t,n,r,s,o,i,c,a,l,u,f){let h=new Map;for(let d=c;d<=a;d++)h.set(n[d],d);let x=l-c+1,m=new Int32Array(x);m.fill(-1);for(let d=c;d<=l;d++){let b=h.get(r[d]);b!==void 0&&(h.delete(r[d]),u[d]=s[b],f[d]=o[b],m[d-c]=b)}for(let[,d]of h)o[d]?.(),s[d]?.parentNode&&s[d].parentNode.removeChild(s[d]);let w=x-xr(m,x),k=new Uint8Array(x);if(w>1){let d=new Int32Array(w),b=new Int32Array(w),S=0;for(let E=0;E<x;E++)m[E]!==-1&&(d[S]=m[E],b[S]=E,S++);let T=Ft(d,w);for(let E=0;E<T.length;E++)k[b[T[E]]]=1}else if(w===1){for(let d=0;d<x;d++)if(m[d]!==-1){k[d]=1;break}}for(let d=c;d<=l;d++)if(!u[d]){let b=r[d],S=d;u[d]=pe(T=>(f[S]=T,i(b,S)))}let g=l+1<u.length&&u[l+1]?u[l+1]:t;for(let d=l;d>=c;d--){let b=d-c;(m[b]===-1||!k[b])&&(g&&g.parentNode!==e&&(g=t),e.insertBefore(u[d],g)),g=u[d]}}function xr(e,t){let n=0;for(let r=0;r<t;r++)e[r]===-1&&n++;return n}function Ft(e,t){if(t===0)return[];if(t===1)return[0];let n=new Int32Array(t),r=new Int32Array(t),s=1;n[0]=0,r[0]=-1;for(let c=1;c<t;c++)if(e[c]>e[n[s-1]])r[c]=n[s-1],n[s++]=c;else{let a=0,l=s-1;for(;a<l;){let u=a+l>>1;e[n[u]]<e[c]?a=u+1:l=u}n[a]=c,r[c]=a>0?n[a-1]:-1}let o=new Array(s),i=n[s-1];for(let c=s-1;c>=0;c--)o[c]=i,i=r[i];return o}function br(e,t,n,r,s,o,i,c,a){let l=r.length,u=n.length;if(l===0){if(u>0){for(let p=0;p<u;p++)o[p]&&o[p]();for(let p=u-1;p>=0;p--){let C=s[p];C&&((C._componentCtx||C._dispose||C._propEffects)&&Y(C),C.parentNode===e&&e.removeChild(C))}s.length=0,o.length=0,a&&a.clear()}return}if(u===0){let p=document.createDocumentFragment();for(let C=0;C<l;C++){let I=r[C],$=C,D;if(a){let Q=c(I),_=y(I);D=_,a.set(Q,{itemSig:_})}else D=I;let U=pe(Q=>(o[$]=Q,i(D,$)));s[C]=U,p.appendChild(U)}e.insertBefore(p,t);return}let f=0,h=Math.min(u,l);for(;f<h;){if(n[f]===r[f]){f++;continue}let p=c(n[f]),C=c(r[f]);if(p!==C)break;a&&a.get(p).itemSig.set(r[f]),f++}let x=u-1,m=l-1;for(;x>=f&&m>=f;){if(n[x]===r[m]){x--,m--;continue}let p=c(n[x]),C=c(r[m]);if(p!==C)break;a&&a.get(p).itemSig.set(r[m]),x--,m--}if(f>x&&f>m)return;let w=new Array(l),k=new Array(l);for(let p=0;p<f;p++)w[p]=s[p],k[p]=o[p];for(let p=m+1;p<l;p++){let C=x+1+(p-m-1);w[p]=s[C],k[p]=o[C]}let g=m-f+1;if(x-f+1===0){let p=m+1<l&&w[m+1]?w[m+1]:t,C=document.createDocumentFragment();for(let I=f;I<=m;I++){let $=r[I],D=I,U;if(a){let Q=c($),_=y($);U=_,a.set(Q,{itemSig:_})}else U=$;w[I]=pe(Q=>(k[D]=Q,i(U,D))),C.appendChild(w[I])}e.insertBefore(C,p),et(s,o,w,k,l);return}if(g===0){for(let p=f;p<=x;p++)o[p]?.(),s[p]?.parentNode&&e.removeChild(s[p]),a&&a.delete(c(n[p]));et(s,o,w,k,l);return}let b=new Map;for(let p=f;p<=x;p++)b.set(c(n[p]),p);let S=new Int32Array(g);S.fill(-1);for(let p=f;p<=m;p++){let C=c(r[p]),I=b.get(C);I!==void 0&&(b.delete(C),w[p]=s[I],k[p]=o[I],S[p-f]=I,a&&r[p]!==n[I]&&a.get(C).itemSig.set(r[p]))}for(let[p,C]of b)o[C]?.(),s[C]?.parentNode&&e.removeChild(s[C]),a&&a.delete(p);for(let p=f;p<=m;p++)if(!w[p]){let C=r[p],I=p,$;if(a){let D=c(C),U=y(C);$=U,a.set(D,{itemSig:U})}else $=C;w[p]=pe(D=>(k[I]=D,i($,I)))}let T=0,E=!0,v=-1;for(let p=0;p<g;p++)S[p]!==-1&&(T++,S[p]<=v&&(E=!1),v=S[p]);let F=new Uint8Array(g);if(E)for(let p=0;p<g;p++)S[p]!==-1&&(F[p]=1);else if(T>1){let p=new Int32Array(T),C=new Int32Array(T),I=0;for(let D=0;D<g;D++)S[D]!==-1&&(p[I]=S[D],C[I]=D,I++);let $=Ft(p,T);for(let D=0;D<$.length;D++)F[C[$[D]]]=1}else if(T===1){for(let p=0;p<g;p++)if(S[p]!==-1){F[p]=1;break}}let M=m+1<w.length&&w[m+1]?w[m+1]:t;for(let p=m;p>=f;p--){let C=p-f;(S[C]===-1||!F[C])&&(M&&M.parentNode!==e&&(M=t),e.insertBefore(w[p],M)),M=w[p]}et(s,o,w,k,l)}function et(e,t,n,r,s){e.length=s,t.length=s;for(let o=0;o<s;o++)e[o]=n[o],t[o]=r[o]}function wr(e,t){for(let n in t){let r=t[n];if(n.startsWith("on")&&n.length>2){let s=n.slice(2).toLowerCase();e.addEventListener(s,r);continue}typeof r=="function"&&!n.startsWith("on")?n==="class"||n==="className"?N(()=>{e.className=r()||""}):n==="style"&&typeof r()=="object"?N(()=>{let s=r();for(let o in s)e.style[o]=s[o]??""}):N(()=>{ve(e,n,r())}):ve(e,n,r)}}function ve(e,t,n){if(t==="ref"){typeof n=="function"?n(e):n&&typeof n=="object"&&(n.current=e);return}if(t!=="key"){if((At.has(t)||At.has(t.toLowerCase()))&&!cr(n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${t}" attribute: ${n}`);return}if(t==="class"||t==="className")e.className=n||"";else if(t==="dangerouslySetInnerHTML")e.innerHTML=n?.__html??"";else if(t==="innerHTML")n&&typeof n=="object"&&"__html"in n?e.innerHTML=n.__html??"":typeof console<"u"&&n!=null&&n!==""&&console.warn('[what] Plain string innerHTML is not allowed. Use { __html: "..." } or dangerouslySetInnerHTML={{ __html: "..." }} instead.');else if(t==="style"){if(typeof n=="string")e.style.cssText=n;else if(typeof n=="object")for(let r in n)e.style[r]=n[r]??""}else t.startsWith("data-")||t.startsWith("aria-")?e.setAttribute(t,n):typeof n=="boolean"?n?e.setAttribute(t,""):e.removeAttribute(t):t in e?e[t]=n:e.setAttribute(t,n)}}var Mt=new Set;function _r(e){for(let t of e)Mt.has(t)||(Mt.add(t),document.addEventListener(t,n=>{let r=n.target,s="$$"+t;for(;r;){let o=r[s];if(o&&(o(n),n.cancelBubble))return;r=r.parentNode}}))}function Cr(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Er(e,t){N(()=>{for(let n in t){let r=typeof t[n]=="function"?t[n]():t[n];e.classList.toggle(n,!!r)}})}var He=!1,te=null;function kr(){return He}function vr(e,t){He=!0,te={parent:t,index:0};try{return ke(e,t)}finally{He=!1,te=null}}function Nt(e){let t=e.childNodes;for(;te.index<t.length;){let n=t[te.index];if(n.nodeType===8){let r=n.textContent;if(r==="$"||r==="/$"||r==="[]"||r==="/[]"){te.index++;continue}}return te.index++,n}return null}function tt(){return typeof process<"u"&&!1}function ke(e,t){if(e==null||typeof e=="boolean")return null;if(typeof e=="string"||typeof e=="number"){let r=Nt(t),s=String(e);if(r&&r.nodeType===3)return tt()&&r.textContent!==s&&(console.warn(`[what] Hydration mismatch: expected text "${s}", got "${r.textContent}"`),r.textContent=s),r;tt()&&console.warn(`[what] Hydration mismatch: expected text node "${s}", got ${r?r.nodeName:"nothing"}. Falling back to client render.`);let o=document.createTextNode(s);return r?t.replaceChild(o,r):t.appendChild(o),o}if(typeof e=="function"){let r=e(),s=ke(r,t);return N(()=>{let o=e();He||(s=be(t,o,s,null))}),s}if(Array.isArray(e)){let r=[];for(let s of e){let o=ke(s,t);o&&r.push(o)}return r.length===1?r[0]:r}if(typeof e=="object"&&e._vnode){if(typeof e.tag=="function"){let i=vt(),c=e.tag,a=e.props||{},l=e.children||[],u={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:c,_parentCtx:i[i.length-1]||null,_errorBoundary:null};i.push(u);let f;try{let h=l.length===0?void 0:l.length===1?l[0]:l;f=c({...a,children:h})}catch(h){return i.pop(),console.error("[what] Error in component during hydration:",c.name||"Anonymous",h),null}return i.pop(),u.mounted=!0,u._mountCallbacks&&queueMicrotask(()=>{if(!u.disposed)for(let h of u._mountCallbacks)try{h()}catch(x){console.error("[what] onMount error:",x)}}),ke(f,t)}let r=Nt(t),s=e.tag.toUpperCase();if(r&&r.nodeType===1&&r.nodeName===s){Sr(r,e.props||{});let i=te;if(te={parent:r,index:0},e.props?.dangerouslySetInnerHTML?.__html==null)for(let a of e.children)ke(a,r);return te=i,r}tt()&&console.warn(`[what] Hydration mismatch: expected <${e.tag}>, got ${r?r.nodeName:"nothing"}. Falling back to client render.`);let o=document.createElement(e.tag);for(let i in e.props||{})i==="children"||i==="key"||ve(o,i,e.props[i]);for(let i of e.children)be(o,i,null,null);return r?t.replaceChild(o,r):t.appendChild(o),o}if(Pt(e))return e;let n=document.createTextNode(String(e));return t.appendChild(n),n}function Sr(e,t){for(let n in t){if(n==="children"||n==="key"||n==="ref"||n==="dangerouslySetInnerHTML"||n==="innerHTML")continue;let r=t[n];if(n.startsWith("on")&&n.length>2){let s=n.slice(2).toLowerCase();e.addEventListener(s,r);continue}if(n.startsWith("$$")){e[n]=r;continue}if(typeof r=="function"&&!n.startsWith("on")){n==="class"||n==="className"?N(()=>{e.className=r()||""}):n==="style"&&typeof r()=="object"?N(()=>{let s=r();for(let o in s)e.style[o]=s[o]??""}):N(()=>{ve(e,n,r())});continue}}}function Z(e){let t=G();if(!t)throw new Error(`[what] ${e||"Hook"}() can only be called inside a component function. Did you call it outside of a component or in an async callback? If you need reactive state outside a component, use signal() directly.`);return t}function ce(e){let t=e.hookIndex++;return{index:t,exists:t<e.hooks.length}}function Ar(e){let t=Z("useState"),{index:n,exists:r}=ce(t);if(!r){let o=y(typeof e=="function"?e():e);t.hooks[n]=o}let s=t.hooks[n];return[s,s.set]}function Tr(e){let t=Z("useSignal"),{index:n,exists:r}=ce(t);return r||(t.hooks[n]=y(typeof e=="function"?e():e)),t.hooks[n]}function Lr(e){let t=Z("useComputed"),{index:n,exists:r}=ce(t);return r||(t.hooks[n]=W(e)),t.hooks[n]}function Mr(e,t){let n=Z("useEffect"),{index:r,exists:s}=ce(n);if(s||(n.hooks[r]={cleanup:null,dispose:null}),A&&Array.isArray(t)&&t.length>0)for(let i=0;i<t.length;i++){let c=t[i];c!=null&&typeof c!="function"&&console.warn(`[what] useEffect dep at index ${i} is not a function. Did you mean to pass a signal? Use count instead of count()`)}let o=n.hooks[r];o.dispose||(t===void 0?queueMicrotask(()=>{n.disposed||(o.dispose=N(()=>{if(o.cleanup){try{o.cleanup()}catch{}o.cleanup=null}let i=e();typeof i=="function"&&(o.cleanup=i)}),n.effects=n.effects||[],n.effects.push(o.dispose))}):t.length===0?(queueMicrotask(()=>{if(n.disposed)return;let i=e();typeof i=="function"&&(o.cleanup=i)}),o.dispose=!0):queueMicrotask(()=>{n.disposed||(o.dispose=N(()=>{for(let c=0;c<t.length;c++){let a=t[c];typeof a=="function"&&a._signal&&a()}if(o.cleanup){try{o.cleanup()}catch{}o.cleanup=null}let i=ie(()=>e());typeof i=="function"&&(o.cleanup=i)}),n.effects=n.effects||[],n.effects.push(o.dispose))}))}function Nr(e,t){let n=Z("useMemo"),{index:r,exists:s}=ce(n);return s||(n.hooks[r]={computed:W(e)}),n.hooks[r].computed}function Ir(e,t){let n=Z("useCallback"),{index:r,exists:s}=ce(n);return s||(n.hooks[r]={callback:e}),n.hooks[r].callback}function Rr(e){let t=Z("useRef"),{index:n,exists:r}=ce(t);return r||(t.hooks[n]={current:e}),t.hooks[n]}function jt(e){let t=G();for(A&&!t&&console.warn(`[what] useContext(${e?.displayName||"Context"}) called outside of component render. useContext must be called during component rendering, not inside effects or event handlers. Store the context value in a variable during render and use that variable in your callback.`);t;){if(t._contextValues&&t._contextValues.has(e)){let n=t._contextValues.get(e);return n&&n._signal?n():n}t=t._parentCtx}return e._defaultValue}function Dr(e){let t={_defaultValue:e,Provider:({value:n,children:r})=>{let s=Z("Context.Provider");if(s._contextValues||(s._contextValues=new Map),s._contextSignals||(s._contextSignals=new Map),s._contextSignals.has(t))s._contextSignals.get(t).set(n);else{let o=y(n);s._contextSignals.set(t,o),s._contextValues.set(t,o)}return r},Consumer:({children:n})=>{let r=jt(t);return typeof n=="function"?n(r):n}};return t}function Or(e,t,n){let r=Z("useReducer"),{index:s,exists:o}=ce(r);if(!o){let c=n?n(t):t,a=y(c),l=u=>{a.set(f=>e(f,u))};r.hooks[s]={signal:a,dispatch:l}}let i=r.hooks[s];return[i.signal,i.dispatch]}function Pr(e){let t=Z("onMount");t.mounted||(t._mountCallbacks=t._mountCallbacks||[],t._mountCallbacks.push(e))}function $r(e){let t=Z("onCleanup");t._cleanupCallbacks=t._cleanupCallbacks||[],t._cleanupCallbacks.push(e)}function Fr(e,t={}){let n=y(t.initialValue??null),r=y(!t.initialValue),s=y(null),o=null,i=async l=>{o&&o.abort(),o=new AbortController;let{signal:u}=o;r.set(!0),s.set(null);try{let f=await e(l,{signal:u});u.aborted||H(()=>{n.set(f),r.set(!1)})}catch(f){u.aborted||H(()=>{s.set(f),r.set(!1)})}},c=l=>{n.set(typeof l=="function"?l(n()):l)},a=G?.();return a&&(a._cleanupCallbacks=a._cleanupCallbacks||[],a._cleanupCallbacks.push(()=>{o&&o.abort()})),t.initialValue||i(t.source),[n,{loading:r,error:s,refetch:i,mutate:c}]}function Vt(e){return e._storeComputed=!0,e}var Bt=!1;function jr(e){return Bt||(Bt=!0,console.warn("[what] storeComputed() is deprecated. Use derived() instead.")),Vt(e)}function Br(e){let t={},n={},r={},s={};for(let[o,i]of Object.entries(e))typeof i=="function"&&i._storeComputed?(A&&i.length===0&&console.warn(`[what] derived() for "${o}" should accept the state parameter, e.g. derived(state => ...).`),n[o]=i):typeof i=="function"?r[o]=i:t[o]=y(i);for(let[o,i]of Object.entries(n)){let c=new Proxy({},{get(a,l){if(t[l])return t[l]();if(n[l])return n[l]()}});n[o]=W(()=>i(c))}for(let[o,i]of Object.entries(r))r[o]=(...c)=>{H(()=>{let a=new Proxy({},{get(l,u){if(t[u])return t[u].peek();if(n[u])return n[u].peek();if(r[u])return r[u]},set(l,u,f){return t[u]&&t[u].set(f),!0}});i.apply(a,c)})};return function(){let i={};for(let[c,a]of Object.entries(t))Object.defineProperty(i,c,{get:()=>a(),enumerable:!0});for(let[c,a]of Object.entries(n))Object.defineProperty(i,c,{get:()=>a(),enumerable:!0});for(let[c,a]of Object.entries(r))i[c]=a;return i}}var Ht=!1;function Hr(e){return Ht||(Ht=!0,console.warn("[what] atom() is deprecated. Use signal() directly instead.")),y(e)}var nt={title:null,metas:new Map,links:new Map};function Vr({title:e,meta:t,link:n,children:r}){if(typeof document>"u")return null;if(e&&(document.title=e,nt.title=e),t)for(let s of Array.isArray(t)?t:[t]){let o=s.name||s.property||s.httpEquiv||JSON.stringify(s);qt("meta",o,s)}if(n)for(let s of Array.isArray(n)?n:[n]){let o=s.rel+(s.href||"");qt("link",o,s)}return r||null}function qt(e,t,n){let r=document.head.querySelector(`[data-what-head="${t}"]`);if(r){qr(r,n);return}let s=document.createElement(e);s.setAttribute("data-what-head",t);for(let[o,i]of Object.entries(n))s.setAttribute(o,i);document.head.appendChild(s)}function qr(e,t){for(let[n,r]of Object.entries(t))e.getAttribute(n)!==r&&e.setAttribute(n,r)}function Wr(){let e=document.head.querySelectorAll("[data-what-head]");for(let t of e)t.remove();nt.metas.clear(),nt.links.clear()}var Ae=[],Te=[],ot=!1;function ne(e){return Ae.push(e),Gt(),()=>{let t=Ae.indexOf(e);t!==-1&&Ae.splice(t,1)}}function ae(e){return Te.push(e),Gt(),()=>{let t=Te.indexOf(e);t!==-1&&Te.splice(t,1)}}function Wt(){for(;Ae.length>0;){let e=Ae.shift();try{e()}catch(t){console.error("[what] Scheduler read error:",t)}}for(;Te.length>0;){let e=Te.shift();try{e()}catch(t){console.error("[what] Scheduler write error:",t)}}ot=!1}function Gt(){ot||(ot=!0,requestAnimationFrame(Wt))}function Gr(e){return new Promise(t=>{ne(()=>{t(e())})})}function zr(e){return new Promise(t=>{ae(()=>{e(),t()})})}function Ur(e,t){let n=Symbol("scheduledEffect");return N(()=>{zt(n,()=>{ne(()=>{let r=e();t&&ae(()=>t(r))})})})}function Xr(){let e,t=new Promise((n,r)=>{let s=requestAnimationFrame(n);e=()=>{cancelAnimationFrame(s),r(new Error("Cancelled"))}});return t.cancel=e,t}var Se=new Map;function zt(e,t){Se.has(e)?Se.set(e,t):(Se.set(e,t),requestAnimationFrame(()=>{let n=Se.get(e);Se.delete(e),n&&n()}))}var rt=new WeakMap,Ve=null;function Yr(e,t){return typeof ResizeObserver>"u"?(t(e.getBoundingClientRect()),()=>{}):(Ve||(Ve=new ResizeObserver(n=>{ne(()=>{for(let r of n){let s=rt.get(r.target);s&&s(r.contentRect)}})})),rt.set(e,t),Ve.observe(e),()=>{rt.delete(e),Ve.unobserve(e)})}function Kr(e,t,n={}){if(typeof IntersectionObserver>"u")return t({isIntersecting:!0,intersectionRatio:1}),()=>{};let r=new IntersectionObserver(s=>{ne(()=>{for(let o of s)t(o)})},n);return r.observe(e),()=>r.disconnect()}function Qr(e,t={}){let{duration:n=300,easing:r=s=>s*(2-s)}=t;return new Promise(s=>{let o,i,c;ne(()=>{o=window.scrollY;let l=e.getBoundingClientRect();i=o+l.top,c=performance.now(),a()});function a(){ne(()=>{let l=performance.now()-c,u=Math.min(l/n,1),f=r(u),h=o+(i-o)*f;ae(()=>{window.scrollTo(0,h),u<1?requestAnimationFrame(a):s()})})}})}function Ut(e){let t=G?.(),n=N(e);return t&&t.effects.push(n),n}function Xt(e,t={}){let{stiffness:n=100,damping:r=10,mass:s=1,precision:o=.01}=t,i=y(e),c=y(e),a=y(0),l=y(!1),u=null,f=null;function h(g){if(f===null){f=g,u=requestAnimationFrame(h);return}let d=Math.min((g-f)/1e3,.064);f=g;let b=i.peek(),S=c.peek(),T=a.peek(),E=b-S,v=-n*E,F=-r*T,M=(v+F)/s,p=T+M*d,C=b+p*d;if(H(()=>{a.set(p),i.set(C)}),Math.abs(p)<o&&Math.abs(E)<o){H(()=>{i.set(S),a.set(0),l.set(!1)}),u=null,f=null;return}u=requestAnimationFrame(h)}function x(g){c.set(g),u===null&&(l.set(!0),f=null,u=requestAnimationFrame(h))}function m(){u&&(cancelAnimationFrame(u),u=null),l.set(!1),f=null}function w(g){m(),H(()=>{i.set(g),c.set(g),a.set(0)})}let k=G?.();return k&&(k._cleanupCallbacks=k._cleanupCallbacks||[],k._cleanupCallbacks.push(m)),{current:()=>i(),target:()=>c(),velocity:()=>a(),isAnimating:()=>l(),set:x,stop:m,snap:w,subscribe:i.subscribe}}function Yt(e,t,n={}){let{duration:r=300,easing:s=x=>x*(2-x),onUpdate:o,onComplete:i}=n,c=y(0),a=y(e),l=y(!0),u=null,f=null;function h(x){u===null&&(u=x);let m=x-u,w=Math.min(m/r,1),k=s(w),g=e+(t-e)*k;H(()=>{c.set(w),a.set(g)}),o&&o(g,w),w<1?f=requestAnimationFrame(h):(l.set(!1),i&&i())}return f=requestAnimationFrame(h),{progress:()=>c(),value:()=>a(),isAnimating:()=>l(),cancel:()=>{f&&cancelAnimationFrame(f),l.set(!1)},subscribe:a.subscribe}}var Kt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*(2*Math.PI/3)),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1,easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375};function Jr(e={}){let{duration:t=300,easing:n=Kt.easeOutQuad}=e,r=y(!1),s=y(0);async function o(i){return r.set(!0),s.set(0),new Promise(c=>{let a=performance.now();function l(u){let f=u-a,h=Math.min(f/t,1);s.set(n(h)),h<1?requestAnimationFrame(l):(r.set(!1),i&&i(),c())}requestAnimationFrame(l)})}return{isTransitioning:()=>r(),progress:()=>s(),start:o}}function Zr(e,t={}){let{onDrag:n,onDragStart:r,onDragEnd:s,onPinch:o,onSwipe:i,onTap:c,onLongPress:a,preventDefault:l=!1}=t,u={isDragging:y(!1),startX:0,startY:0,currentX:y(0),currentY:y(0),deltaX:y(0),deltaY:y(0),velocity:y({x:0,y:0})},f=0,h=0,x=0,m=null;function w(E){let v=E.touches?E.touches[0]:E;u.startX=v.clientX,u.startY=v.clientY,h=v.clientX,x=v.clientY,f=performance.now(),u.isDragging.set(!0),r&&r({x:u.startX,y:u.startY}),a&&(m=setTimeout(()=>{u.isDragging.peek()&&a({x:h,y:x})},500))}function k(E){if(!u.isDragging.peek())return;let v=E.touches?E.touches[0]:E,F=v.clientX,M=v.clientY,p=performance.now(),C=p-f;H(()=>{u.currentX.set(F),u.currentY.set(M),u.deltaX.set(F-u.startX),u.deltaY.set(M-u.startY),C>0&&u.velocity.set({x:(F-h)/C*1e3,y:(M-x)/C*1e3})}),h=F,x=M,f=p,m&&Math.sqrt(u.deltaX.peek()**2+u.deltaY.peek()**2)>10&&(clearTimeout(m),m=null),n&&n({x:F,y:M,deltaX:u.deltaX.peek(),deltaY:u.deltaY.peek(),velocity:u.velocity.peek()})}function g(E){if(!u.isDragging.peek())return;m&&(clearTimeout(m),m=null);let v=u.deltaX.peek(),F=u.deltaY.peek(),M=u.velocity.peek();if(Math.sqrt(v**2+F**2)<10&&c&&c({x:u.startX,y:u.startY}),i&&(Math.abs(M.x)>500||Math.abs(M.y)>500)){let C=Math.abs(M.x)>Math.abs(M.y)?M.x>0?"right":"left":M.y>0?"down":"up";i({direction:C,velocity:M})}s&&s({deltaX:v,deltaY:F,velocity:M}),u.isDragging.set(!1)}let d=null;function b(E){if(!o||E.touches.length!==2)return;let v=E.touches[0],F=E.touches[1],M=Math.sqrt((F.clientX-v.clientX)**2+(F.clientY-v.clientY)**2);d===null&&(d=M);let p=M/d,C=(v.clientX+F.clientX)/2,I=(v.clientY+F.clientY)/2;o({scale:p,centerX:C,centerY:I})}function S(){d=null}typeof e=="function"?Ut(()=>{let E=ie(e);if(E)return T(E)}):e?.current!==void 0?Ut(()=>{let E=e.current;if(E)return T(E)}):e&&T(e);function T(E){return E.addEventListener("mousedown",w),E.addEventListener("touchstart",w,{passive:!l}),window.addEventListener("mousemove",k),window.addEventListener("touchmove",b),window.addEventListener("touchmove",k),window.addEventListener("mouseup",g),window.addEventListener("touchend",g),window.addEventListener("touchend",S),()=>{E.removeEventListener("mousedown",w),E.removeEventListener("touchstart",w),window.removeEventListener("mousemove",k),window.removeEventListener("touchmove",b),window.removeEventListener("touchmove",k),window.removeEventListener("mouseup",g),window.removeEventListener("touchend",g),window.removeEventListener("touchend",S)}}return u}function eo(e){let t=y(e),n=[];return{value:()=>t(),setValue:r=>t.set(r),spring(r,s={}){let o=Xt(t.peek(),s);o.set(r);let i=N(()=>{t.set(o.current())});return{stop:()=>{o.stop(),i()}}},timing(r,s={}){let o=Yt(t.peek(),r,{...s,onUpdate:i=>t.set(i)});return{stop:()=>o.cancel()}},interpolate(r,s){return()=>{let o=t();for(let i=0;i<r.length-1;i++)if(o>=r[i]&&o<=r[i+1]){let c=(o-r[i])/(r[i+1]-r[i]);return s[i]+(s[i+1]-s[i])*c}return o<=r[0]?s[0]:s[s.length-1]}},subscribe:t.subscribe}}function Qt(e){return{enter:`${e}-enter`,enterActive:`${e}-enter-active`,enterDone:`${e}-enter-done`,exit:`${e}-exit`,exitActive:`${e}-exit-active`,exitDone:`${e}-exit-done`}}async function to(e,t,n="enter",r=300){let s=Qt(t);return new Promise(o=>{ae(()=>{e.classList.add(s[n]),ne(()=>{e.offsetHeight,ae(()=>{e.classList.add(s[`${n}Active`]),setTimeout(()=>{ae(()=>{e.classList.remove(s[n],s[`${n}Active`]),e.classList.add(s[`${n}Done`]),o()})},r)})})})})}var Zt=y(null);typeof document<"u"&&document.addEventListener("focusin",e=>{Zt.set(e.target)});function no(){return{current:()=>Zt(),focus:e=>e?.focus(),blur:()=>document.activeElement?.blur()}}function ro(){let e={current:null};function t(r){typeof document>"u"||(e.current=r||document.activeElement||null)}function n(r){let s=e.current||r;s&&typeof s.focus=="function"&&s.focus()}return{capture:t,restore:n,previous:()=>e.current}}function en(e){let t=null;function n(){if(typeof document>"u")return;t=document.activeElement;let s=e.current||e;if(!s||typeof s.querySelectorAll!="function")return;let o=Jt(s);if(o.length===0)return;o[0].focus();function i(c){if(c.key!=="Tab")return;let a=Jt(s),l=a[0],u=a[a.length-1];c.shiftKey?document.activeElement===l&&(c.preventDefault(),u.focus()):document.activeElement===u&&(c.preventDefault(),l.focus())}return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}}function r(){t&&typeof t.focus=="function"&&t.focus()}return{activate:n,deactivate:r}}function Jt(e){let t=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(t)).filter(n=>n.offsetParent!==null)}function oo({children:e,active:t=!0}){let n={current:null},r=y(0),s=en(n),o=null,i=l=>{n.current=l,r.set(u=>u+1)},c=N(()=>{if(r(),o&&(o(),o=null,s.deactivate()),t&&n.current)return o=s.activate(),()=>{o?.(),o=null,s.deactivate()}}),a=G?.();return a&&(a._cleanupCallbacks=a._cleanupCallbacks||[],a._cleanupCallbacks.push(()=>{c(),o?.(),o=null,s.deactivate()})),L("div",{ref:i},e)}var le=null,st=0;function so(){return typeof document>"u"?null:(le||(le=document.createElement("div"),le.id="what-announcer",le.setAttribute("aria-live","polite"),le.setAttribute("aria-atomic","true"),le.style.cssText=`
|
|
1
|
+
var A=!(typeof process<"u"),P=null;function xn(e){A&&(P=e)}var B=null,q=null,X=null,Oe=!1,ke=0,z=[],Fe=!1,Xe=Symbol("needs_upstream"),De=null;function y(e,t){let n=e,r=new Set,s=null,o=0;function i(a){A&&Oe&&console.warn("[what] Signal.set() called inside a computed function. This may cause infinite loops. Use effect() instead."+(t?` (signal: ${t})`:""));let l=typeof a=="function"?a(n):a;n===l||n!==n&&l!==l||(n=l,s=null,A&&P&&P.onSignalUpdate(c),r.size>0&&ht(r))}function c(a){if(arguments.length===0){let l=B;return l!==null&&(l!==s||l._epoch!==o)&&(s=l,o=l._epoch,r.add(l),l.deps.push(r)),n}i(a)}return c.set=i,c.peek=()=>n,c.subscribe=a=>N(()=>a(c())),c._signal=!0,A&&(c._subs=r,t&&(c._debugName=t)),A&&P&&P.onSignalCreate(c),c}function W(e){let t,n=!0,r=new Set,s=null,o=0,i=Ye(()=>{let a=Oe;A&&(Oe=!0);try{t=e(),n=!1}finally{A&&(Oe=a)}},!0);i._level=1,i._computed=!0,i._computedSubs=r,r._owner=i,i._markDirty=()=>{n=!0},i._isDirty=()=>n;function c(){let a=B;return a!==null&&(a!==s||a._epoch!==o)&&(s=a,o=a._epoch,r.add(a),a.deps.push(r)),n&&ut(i),t}return i._onNotify=()=>{n=!0,s=null,r.size>0&&ht(r)},c._signal=!0,c.peek=()=>(n&&ut(i),t),c}function ut(e){if(De!==null)throw De.push(e),Xe;let t=[e];De=t;try{for(;t.length>0;){let n=t[t.length-1];if(!n._isDirty||!n._isDirty()){t.pop();continue}let r=!1,s=n.deps;for(let o=0;o<s.length;o++){let i=s[o]._owner;i&&i._computed&&i._isDirty&&i._isDirty()&&(t.push(i),r=!0)}if(!r)try{let o=n.deps.length;Ke(n),n.deps.length!==o&&je(n),t.pop()}catch(o){if(o===Xe)n._markDirty();else throw o}}}finally{De=null}}function je(e){let t=0,n=e.deps;for(let r=0;r<n.length;r++){let s=n[r]._owner;if(s){let o=s._level;o>t&&(t=o)}}e._level=t+1}function N(e,t){let n=Ye(e);n._level=1;let r=B;B=n;try{let o=n.fn();typeof o=="function"&&(n._cleanup=o)}finally{B=r}je(n),t?.stable&&(n._stable=!0);let s=()=>dt(n);return q&&q.disposals.push(s),s}function H(e){ke++;try{e()}finally{ke--,ke===0&&Qe()}}function Ye(e,t){let n={fn:e,deps:[],lazy:t||!1,_onNotify:null,disposed:!1,_pending:!1,_stable:!1,_level:0,_computed:!1,_computedSubs:null,_isDirty:null,_markDirty:null,_cleanup:null,_epoch:0};return A&&P&&P.onEffectCreate(n),n}function Ke(e){if(e.disposed)return;if(e._stable){if(e._cleanup){try{e._cleanup()}catch(s){A&&console.warn("[what] Error in effect cleanup:",s)}e._cleanup=null}let r=B;B=null;try{let s=e.fn();typeof s=="function"&&(e._cleanup=s)}catch(s){P?.onError&&P.onError(s,{type:"effect",effect:e}),A&&console.warn("[what] Error in stable effect:",s)}finally{B=r}A&&P?.onEffectRun&&P.onEffectRun(e);return}let t=e.deps.length===1?e.deps[0]:null;if(pt(e),e._cleanup){try{e._cleanup()}catch(r){A&&P?.onError&&P.onError(r,{type:"effect-cleanup",effect:e}),A&&console.warn("[what] Error in effect cleanup:",r)}e._cleanup=null}let n=B;B=e;try{let r=e.fn();typeof r=="function"&&(e._cleanup=r)}catch(r){throw r===Xe||A&&P?.onError&&P.onError(r,{type:"effect",effect:e}),r}finally{B=n}t!==null&&e.deps.length===1&&e.deps[0]===t&&!e._cleanup&&!e._pending&&(e._stable=!0),A&&P?.onEffectRun&&P.onEffectRun(e)}function dt(e){if(e.disposed=!0,A&&P&&P.onEffectDispose(e),pt(e),e._cleanup){try{e._cleanup()}catch(t){A&&console.warn("[what] Error in effect cleanup on dispose:",t)}e._cleanup=null}}function pt(e){let t=e.deps;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0,e._epoch++}var Ue=0,de=null,xe=0;function ft(e){if(!e.disposed){if(e._onNotify)e._onNotify();else if(!e._pending)if(ke===0&&e._stable){let t=B;B=null;try{let n=e.fn();if(typeof n=="function"){if(e._cleanup)try{e._cleanup()}catch{}e._cleanup=n}}catch(n){A&&P?.onError&&P.onError(n,{type:"effect",effect:e}),A&&console.warn("[what] Error in stable effect:",n)}finally{B=t}}else{e._pending=!0;let t=e._level,n=z.length;n>0&&z[n-1]._level>t&&(Fe=!0),z.push(e)}}}function ht(e){if(Ue===0){Ue=1;try{for(let t of e)ft(t);if(xe>0){let t=0;for(;t<xe;){let n=de[t];de[t]=null,t++;for(let r of n)ft(r)}xe=0}}finally{Ue=0}ke===0&&z.length>0&&bn()}else de===null&&(de=[]),xe>=de.length?de.push(e):de[xe]=e,xe++}var Pe=!1;function bn(){Pe||(Pe=!0,queueMicrotask(()=>{Pe=!1,Qe()}))}var $e=!1;function Qe(){if(!$e){$e=!0;try{let e=0;for(;z.length>0&&e<25;){let t=z;z=[],t.length>1&&Fe&&t.sort((n,r)=>n._level-r._level),Fe=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r._pending=!1,!r.disposed&&!r._onNotify){let s=r.deps.length;Ke(r),!r._computed&&r.deps.length!==s&&je(r)}}e++}if(e>=25){if(A){let n=z.slice(0,3).map(r=>r.fn?.name||r.fn?.toString().slice(0,60)||"(anonymous)");console.warn(`[what] Possible infinite effect loop detected (25 iterations). Likely cause: an effect writes to a signal it also reads, creating a cycle. Use untrack() to read signals without subscribing. Looping effects: ${n.join(", ")}`)}else console.warn("[what] Possible infinite effect loop detected");for(let t=0;t<z.length;t++)z[t]._pending=!1;z.length=0}}finally{$e=!1}}}function wn(e){let t,n=new Set,r=Ye(()=>{let o=e();if(!Object.is(t,o)){t=o;for(let i of n)if(!i.disposed){if(i._onNotify)i._onNotify();else if(!i._pending){i._pending=!0;let c=i._level,a=z.length;a>0&&z[a-1]._level>c&&(Fe=!0),z.push(i)}}}});r._level=1,Ke(r),je(r),n._owner=r,q&&q.disposals.push(()=>dt(r));function s(){return B&&(n.add(B),B.deps.push(n)),t}return s._signal=!0,s.peek=()=>t,s}function _n(){if($e){A&&console.warn("[what] flushSync() called during an active flush (e.g., inside a component render or effect). This is a no-op to prevent infinite loops. Move flushSync() to an event handler or onMount callback.");return}if(B){A&&console.warn("[what] flushSync() called during effect execution. This is a no-op to prevent infinite loops. Move flushSync() to an event handler or onMount callback.");return}Pe=!1,Qe()}function ie(e){let t=B;B=null;try{return e()}finally{B=t}}function Cn(){return X}function kn(e,t){let n=X,r=q;X=e,q=e;try{return t()}finally{X=n,q=r}}function En(e){let t=q,n=X,r={disposals:[],owner:X,children:[],_disposed:!1};X&&X.children.push(r),q=r,X=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let o=r.children.length-1;o>=0;o--)Je(r.children[o]);r.children.length=0;for(let o=r.disposals.length-1;o>=0;o--)r.disposals[o]();if(r.disposals.length=0,r.owner){let o=r.owner.children.indexOf(r);o>=0&&r.owner.children.splice(o,1)}}})}finally{q=t,X=n}}function Je(e){if(!e._disposed){e._disposed=!0;for(let t=e.children.length-1;t>=0;t--)Je(e.children[t]);e.children.length=0;for(let t=e.disposals.length-1;t>=0;t--)e.disposals[t]();e.disposals.length=0}}function pe(e){let t=q,n=X,r={disposals:[],owner:null,children:[],_disposed:!1};q=r,X=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let o=r.children.length-1;o>=0;o--)Je(r.children[o]);r.children.length=0;for(let o=r.disposals.length-1;o>=0;o--)r.disposals[o]();r.disposals.length=0}})}finally{q=t,X=n}}function vn(e){q&&q.disposals.push(e)}var Sn=Object.create(null),gt=[];function L(e,t){t=t||Sn;let n=arguments.length,r;if(n<=2)r=gt;else if(n===3)r=Tn(arguments[2]);else{let o=[];for(let i=2;i<n;i++)Ze(arguments[i],o);r=o}let s=t.key??null;return t.key!==void 0&&(t={...t},delete t.key),{tag:e,props:t,children:r,key:s,_vnode:!0}}function An({children:e}){return e}function Tn(e){if(e==null||e===!1||e===!0)return gt;if(Array.isArray(e)){let t=[];return Ze(e,t),t}return typeof e=="object"&&e._vnode?[e]:typeof e=="function"?[e]:[String(e)]}function Ze(e,t){if(!(e==null||e===!1||e===!0))if(Array.isArray(e))for(let n=0;n<e.length;n++)Ze(e[n],t);else typeof e=="object"&&e._vnode||typeof e=="function"?t.push(e):t.push(String(e))}function Ln(e,...t){let n=e.reduce((r,s,o)=>r+s+(o<t.length?`\0${o}\0`:""),"");return Mn(n,t)}function Mn(e,t){e=e.trim();let n=[],r=0;for(;r<e.length;){if(e[r]==="<"){let o=mt(e,r,t);if(o){n.push(o.node),r=o.end;continue}}let s=yt(e,r,t);s.text&&n.push(s.text),r=s.end}return n.length===1?n[0]:n}function mt(e,t,n){let r=e.slice(t).match(/^<([a-zA-Z][a-zA-Z0-9-]*|[A-Z]\w*)/);if(!r)return null;let s=r[1],o=t+r[0].length,i={};for(;o<e.length;){for(;o<e.length&&/\s/.test(e[o]);)o++;if(e.slice(o,o+2)==="/>")return{node:L(s,Object.keys(i).length?i:null),end:o+2};if(e[o]===">"){o++;break}if(e.slice(o,o+3)==="..."){let f=e.slice(o+3).match(/^\x00(\d+)\x00/);if(f){Object.assign(i,n[Number(f[1])]),o+=3+f[0].length;continue}}let l=e.slice(o).match(/^([a-zA-Z_@:][a-zA-Z0-9_:.-]*)/);if(!l)break;let u=l[1];for(o+=l[0].length;o<e.length&&/\s/.test(e[o]);)o++;if(e[o]==="="){for(o++;o<e.length&&/\s/.test(e[o]);)o++;let f=e.slice(o).match(/^\x00(\d+)\x00/);if(f)i[u]=n[Number(f[1])],o+=f[0].length;else if(e[o]==='"'||e[o]==="'"){let h=e[o];o++;let x="";for(;o<e.length&&e[o]!==h;){let m=e.slice(o).match(/^\x00(\d+)\x00/);m?(x+=String(n[Number(m[1])]),o+=m[0].length):(x+=e[o],o++)}o++,i[u]=x}}else i[u]=!0}let c=[],a=`</${s}>`;for(;o<e.length;){if(e.slice(o,o+a.length)===a){o+=a.length;break}if(e[o]==="<"){let u=mt(e,o,n);if(u){c.push(u.node),o=u.end;continue}}let l=yt(e,o,n);l.text!=null&&c.push(l.text),o=l.end}return{node:L(s,Object.keys(i).length?i:null,...c),end:o}}function yt(e,t,n){let r=t,s="";for(;r<e.length&&e[r]!=="<";){let o=e.slice(r).match(/^\x00(\d+)\x00/);if(o)return s.trim()?{text:s.trim(),end:r}:{text:n[Number(o[1])],end:r+o[0].length};s+=e[r],r++}return{text:s.trim()||null,end:r}}function Nn(e,t){let n=function(s){return e(s)};return n.displayName=`Memo(${e.name||"Anonymous"})`,n}var xt=null;function bt(e){xt=e}function In(e){let t=null,n=null,r=null,s=new Set;function o(i){if(r)throw r;if(t)return L(t,i);throw n||(n=e().then(c=>{t=c.default||c,s.forEach(a=>a()),s.clear()}).catch(c=>{r=c})),n}return o.displayName="Lazy",o._lazy=!0,o._onLoad=i=>{t?i():s.add(i)},o}function Rn({fallback:e,children:t}){let n=y(!1),r=new Set;return{tag:"__suspense",props:{boundary:{_suspense:!0,onSuspend(o){n.set(!0),r.add(o),o.finally(()=>{r.delete(o),r.size===0&&n.set(!1)})}},fallback:e,loading:n},children:Array.isArray(t)?t:[t],_vnode:!0}}function Dn({fallback:e,children:t,onError:n}){let r=y(null);return{tag:"__errorBoundary",props:{errorState:r,handleError:i=>{if(r.set(i),n)try{n(i)}catch(c){console.error("Error in onError handler:",c)}},fallback:e,reset:()=>r.set(null)},children:Array.isArray(t)?t:[t],_vnode:!0}}function wt(e,t){let n=t||xt?.();for(;n;){if(n._errorBoundary)return n._errorBoundary(e),!0;n=n._parentCtx}return!1}function On({when:e,fallback:t=null,children:n}){return(typeof e=="function"?e():e)?n:t}function Pn({each:e,fallback:t=null,children:n}){let r=typeof e=="function"?e():e;if(!r||r.length===0)return t;let s=Array.isArray(n)?n[0]:n;return typeof s!="function"?(console.warn("[what] For: children must be a render function, e.g. <For each={items}>{(item) => ...}</For>"),t):r.map((o,i)=>{let c=s(o,i);return c&&typeof c=="object"&&c.key==null&&(o!=null&&typeof o=="object"?o.id!=null?c.key=o.id:o.key!=null&&(c.key=o.key):(typeof o=="string"||typeof o=="number")&&(c.key=o)),c})}function $n({fallback:e=null,children:t}){let n=Array.isArray(t)?t:[t];for(let r of n)if(r&&r.tag===et&&(typeof r.props.when=="function"?r.props.when():r.props.when))return r.children;return e}function et({when:e,children:t}){return{tag:et,props:{when:e},children:t,_vnode:!0}}function Fn({component:e,mode:t,mediaQuery:n,...r}){let s=L("div",{"data-island":e.name||"Island","data-hydrate":t}),o=y(null),i=y(!1);function c(){i()||(i.set(!0),o.set(L(e,r)))}function a(u){switch(t){case"load":queueMicrotask(c);break;case"idle":typeof requestIdleCallback<"u"?requestIdleCallback(c):setTimeout(c,200);break;case"visible":{let f=new IntersectionObserver(h=>{h[0].isIntersecting&&(f.disconnect(),c())});f.observe(u);break}case"interaction":{let f=()=>{u.removeEventListener("click",f),u.removeEventListener("focus",f),u.removeEventListener("mouseenter",f),c()};u.addEventListener("click",f,{once:!0}),u.addEventListener("focus",f,{once:!0}),u.addEventListener("mouseenter",f,{once:!0});break}case"media":{if(!n){c();break}let f=window.matchMedia(n);if(f.matches)queueMicrotask(c);else{let h=()=>{f.matches&&(f.removeEventListener("change",h),c())};f.addEventListener("change",h)}break}default:queueMicrotask(c)}}let l=u=>{u&&a(u)};return L("div",{"data-island":e.name||"Island","data-hydrate":t,ref:l},i()?o():null)}var _t=!1;function jn(e,t,n){return _t||(_t=!0,console.warn("[what] each() is deprecated. Use the <For> component or Array.map() instead.")),!e||e.length===0?[]:e.map((r,s)=>{let o=t(r,s);return n&&o&&typeof o=="object"&&(o.key=n(r,s)),o})}function Bn(...e){let t=[];for(let n of e)if(n){if(typeof n=="string")t.push(n);else if(typeof n=="object")for(let[r,s]of Object.entries(n))s&&t.push(r)}return t.join(" ")}function Hn(e){return typeof e=="string"?e:Object.entries(e).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>`${Vn(t)}:${n}`).join(";")}function Vn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function qn(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function Wn(e,t){let n=0;return(...r)=>{let s=Date.now();s-n>=t&&(n=s,e(...r))}}var Be=null;function Ct(e){Be=e}function Gn(e){if(typeof window>"u")return y(!1);let t=window.matchMedia(e),n=y(t.matches),r=o=>n.set(o.matches);t.addEventListener("change",r);let s=Be?.();return s&&(s._cleanupCallbacks=s._cleanupCallbacks||[],s._cleanupCallbacks.push(()=>t.removeEventListener("change",r))),n}function zn(e,t){let n;try{let c=localStorage.getItem(e);n=c!==null?JSON.parse(c):t}catch{n=t}let r=y(n),s=N(()=>{try{localStorage.setItem(e,JSON.stringify(r()))}catch(c){A&&console.warn("[what] localStorage write failed (quota exceeded?):",c)}}),o=null;typeof window<"u"&&(o=c=>{if(c.key===e&&c.newValue!==null)try{r.set(JSON.parse(c.newValue))}catch(a){A&&console.warn("[what] localStorage parse failed:",a)}},window.addEventListener("storage",o));let i=Be?.();return i&&(i._cleanupCallbacks=i._cleanupCallbacks||[],i._cleanupCallbacks.push(()=>{s(),o&&window.removeEventListener("storage",o)})),r}function Un({target:e,children:t}){if(typeof document>"u")return null;let n=typeof e=="string"?document.querySelector(e):e;return n?{tag:"__portal",props:{container:n},children:Array.isArray(t)?t:[t],_vnode:!0}:null}function Xn(e,t){if(typeof document>"u")return;let n=s=>{let o=e.current||e;!o||o.contains(s.target)||t(s)};document.addEventListener("mousedown",n),document.addEventListener("touchstart",n);let r=Be?.();r&&(r._cleanupCallbacks=r._cleanupCallbacks||[],r._cleanupCallbacks.push(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}))}function Yn(e,t){return{class:t?`${e}-enter ${e}-enter-active`:`${e}-leave ${e}-leave-active`}}var Kn=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","symbol","clipPath","mask","pattern","image","text","tspan","textPath","foreignObject","linearGradient","radialGradient","stop","marker","animate","animateTransform","animateMotion","set","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence"]),Qn="http://www.w3.org/2000/svg",vt=new Set,He=new WeakMap;function Jn(e){return!e||typeof e!="object"?!1:typeof Node<"u"&&e instanceof Node?!0:typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function kt(e){return!!e&&typeof e=="object"&&(e._vnode===!0||"tag"in e)}function Et(e){if(!e.disposed){if(e.disposed=!0,e.cleanups)for(let t of e.cleanups)try{t()}catch(n){console.error("[what] cleanup error:",n)}if(e.effects)for(let t of e.effects)try{t()}catch{}if(e.hooks){for(let t of e.hooks)if(t&&typeof t.cleanup=="function")try{t.cleanup()}catch(n){console.error("[what] hook cleanup error:",n)}}if(e._cleanupCallbacks)for(let t of e._cleanupCallbacks)try{t()}catch(n){console.error("[what] onCleanup error:",n)}A&&P?.onComponentUnmount&&P.onComponentUnmount(e),vt.delete(e)}}function Y(e){if(!e)return;if(e._componentCtx&&Et(e._componentCtx),e.nodeType===8){let n=He.get(e);n&&Et(n)}if(e._dispose)try{e._dispose()}catch{}if(e._propEffects)for(let n in e._propEffects)try{e._propEffects[n]()}catch{}let t=e.childNodes;if(t&&t.length>0)for(let n=0;n<t.length;n++)Y(t[n])}function Zn(e,t){typeof t=="string"&&(t=document.querySelector(t)),Y(t),t.textContent="";let n=J(e,t);return n&&t.appendChild(n),()=>{Y(t),t.textContent=""}}function J(e,t,n){if(e==null||e===!1||e===!0)return document.createComment("");if(typeof e=="string"||typeof e=="number")return document.createTextNode(String(e));if(Jn(e))return e;if(typeof e=="function"){let r=document.createComment("fn"),s=document.createComment("/fn"),o=[],i=document.createDocumentFragment();i.appendChild(r),i.appendChild(s);let c=N(()=>{let a=e(),l=a==null||a===!1||a===!0?[]:Array.isArray(a)?a:[a],u=s.parentNode;if(u){for(let f of o)Y(f),f.parentNode===u&&u.removeChild(f);o=[];for(let f of l){let h=J(f,u,t?._isSvg);if(h)if(h.nodeType===11){let x=Array.from(h.childNodes);u.insertBefore(h,s);for(let m of x)o.push(m)}else u.insertBefore(h,s),o.push(h)}}});return r._dispose=c,s._dispose=c,i}if(Array.isArray(e)){let r=document.createDocumentFragment();for(let s of e){let o=J(s,t,n);o&&r.appendChild(o)}return r}return kt(e)&&typeof e.tag=="function"?tr(e,t,n):kt(e)?sr(e,t,n):document.createTextNode(String(e))}var er={get(e,t){if(t!=="_sig")return e._sig()[t]},has(e,t){return t==="_sig"?!1:t in e._sig()},ownKeys(e){return Reflect.ownKeys(e._sig())},getOwnPropertyDescriptor(e,t){if(t==="_sig")return;let n=e._sig();if(t in n)return{value:n[t],writable:!1,enumerable:!0,configurable:!0}}},V=[];function G(){return V[V.length-1]}bt(G);Ct(G);function St(){return V}function tr(e,t,n){let{tag:r,props:s,children:o}=e;if(typeof r=="function"&&(r.prototype?.isReactComponent||r.prototype?.render)){let d=r;r=function(S){return new d(S).render()},r.displayName=d.displayName||d.name||"ClassComponent"}if(r==="__errorBoundary"||e.tag==="__errorBoundary")return nr(e,t);if(r==="__suspense"||e.tag==="__suspense")return rr(e,t);if(r==="__portal"||e.tag==="__portal")return or(e,t);let i=V[V.length-1]||null,c=null;if(i&&(c=i._errorBoundary||null,!c)){let d=i._parentCtx;for(;d;){if(d._errorBoundary){c=d._errorBoundary;break}d=d._parentCtx}}let a={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:r,_parentCtx:i,_errorBoundary:c},l=document.createComment("c:start"),u=document.createComment("c:end");He.set(l,a),a._startComment=l,a._endComment=u;let f=document.createDocumentFragment();f._componentCtx=a,a._wrapper=l,vt.add(a),A&&P?.onComponentMount&&P.onComponentMount(a);let h=o.length===0?void 0:o.length===1?o[0]:o,x;h!==void 0?x=s?Object.assign({},s,{children:h}):{children:h}:x=s?Object.assign({},s):{};let m=y(x);a._propsSignal=m;let w=new Proxy({_sig:m},er);V.push(a);let E;try{E=r(w)}catch(d){if(V.pop(),!wt(d,a))throw console.error("[what] Uncaught error in component:",r.name||"Anonymous",d),d;return f.appendChild(l),f.appendChild(u),f}V.pop(),a.mounted=!0,a._mountCallbacks&&queueMicrotask(()=>{if(!a.disposed)for(let d of a._mountCallbacks)try{d()}catch(b){console.error("[what] onMount error:",b)}}),f.appendChild(l);let g=Array.isArray(E)?E:[E];for(let d of g){let b=J(d,f,n);b&&f.appendChild(b)}return f.appendChild(u),f}function nr(e,t){let{errorState:n,handleError:r,fallback:s,reset:o}=e.props,i=e.children,c=document.createComment("eb:start"),a=document.createComment("eb:end"),l={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:V[V.length-1]||null,_errorBoundary:r,_startComment:c,_endComment:a};He.set(c,l);let u=document.createDocumentFragment();u._componentCtx=l,u.appendChild(c),u.appendChild(a);let f=N(()=>{let h=n();if(V.push(l),c.parentNode)for(;c.nextSibling&&c.nextSibling!==a;){let m=c.nextSibling;Y(m),m.parentNode.removeChild(m)}let x;h?x=typeof s=="function"?[s({error:h,reset:o})]:[s]:x=i,x=Array.isArray(x)?x:[x];for(let m of x){let w=J(m,t);w&&(a.parentNode?a.parentNode.insertBefore(w,a):u.insertBefore(w,a))}V.pop()});return l.effects.push(f),u}function rr(e,t){let{boundary:n,fallback:r,loading:s}=e.props,o=e.children,i=document.createComment("sb:start"),c=document.createComment("sb:end"),a={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:V[V.length-1]||null,_startComment:i,_endComment:c};He.set(i,a);let l=document.createDocumentFragment();l._componentCtx=a,l.appendChild(i),l.appendChild(c);let u=N(()=>{let h=s()?[r]:o,x=Array.isArray(h)?h:[h];if(V.push(a),i.parentNode)for(;i.nextSibling&&i.nextSibling!==c;){let m=i.nextSibling;Y(m),m.parentNode.removeChild(m)}for(let m of x){let w=J(m,t);w&&(c.parentNode?c.parentNode.insertBefore(w,c):l.insertBefore(w,c))}V.pop()});return a.effects.push(u),l}function or(e,t){let{container:n}=e.props,r=e.children;if(!n)return console.warn("[what] Portal: target container not found"),document.createComment("portal:empty");let s={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:V[V.length-1]||null},o=document.createComment("portal");o._componentCtx=s;let i=[];for(let c of r){let a=J(c,n);a&&(n.appendChild(a),i.push(a))}return s._cleanupCallbacks=[()=>{for(let c of i)Y(c),c.parentNode&&c.parentNode.removeChild(c)}],o}function sr(e,t,n){let{tag:r,props:s,children:o}=e,i=n||Kn.has(r),c=i?document.createElementNS(Qn,r):document.createElement(r);s&&ir(c,s,{},i);let a=i&&r!=="foreignObject";for(let l=0;l<o.length;l++){let u=J(o[l],c,a);u&&c.appendChild(u)}return c._vnode=e,c}function ir(e,t,n,r){if(t){for(let s in t)if(!(s==="key"||s==="children")){if(s==="ref"){let o=t.ref;typeof o=="function"?o(e):o&&(o.current=e);continue}At(e,s,t[s],r)}}}function At(e,t,n,r){if(typeof n=="function"&&!(t.startsWith("on")&&t.length>2)&&t!=="ref"){if(e._propEffects||(e._propEffects={}),e._propEffects[t])try{e._propEffects[t]()}catch{}e._propEffects[t]=N(()=>{let s=n();At(e,t,s,r)});return}if(t.startsWith("on")&&t.length>2){let s=t.slice(2),o=!1;s.endsWith("Capture")&&(s=s.slice(0,-7),o=!0);let i=s.toLowerCase(),c=o?i+"_capture":i,a=e._events?.[c];if(a&&a._original===n||(a&&e.removeEventListener(i,a,o),n==null))return;e._events||(e._events={});let l=f=>(f.nativeEvent||(f.nativeEvent=f),ie(()=>l._handler(f)));l._handler=n,l._original=n,e._events[c]=l;let u=n._eventOpts;e.addEventListener(i,l,u||o||void 0);return}if(t==="className"||t==="class"){r?e.setAttribute("class",n||""):e.className=n||"";return}if(t==="style"){if(typeof n=="string")e.style.cssText=n,e._prevStyle=null;else if(typeof n=="object"){let s=e._prevStyle||{};for(let o in s)o in n||(e.style[o]="");for(let o in n)e.style[o]=n[o]??"";e._prevStyle={...n}}return}if(t==="dangerouslySetInnerHTML"){e.innerHTML=n?.__html??"";return}if(t==="innerHTML"){if(n==null)return;if(n&&typeof n=="object"&&"__html"in n)e.innerHTML=n.__html??"";else{A&&console.warn("[what] innerHTML received a raw string. This is a security risk (XSS). Use innerHTML={{ __html: trustedString }} or dangerouslySetInnerHTML={{ __html: trustedString }} instead.");return}return}if(typeof n=="boolean"){n?e.setAttribute(t,""):e.removeAttribute(t);return}if(t.startsWith("data-")||t.startsWith("aria-")){e.setAttribute(t,n);return}if(r){n===!1||n==null?e.removeAttribute(t):e.setAttribute(t,n===!0?"":String(n));return}t in e?e[t]=n:e.setAttribute(t,n)}var Ee=null;function cr(e){Ee=typeof e=="function"?e:null}function ar(e,t,n){if(n&&n.length>0){let r=n.length===1?n[0]:n;t?t.children=r:t={children:r}}return J({tag:e,props:t||{},children:n||[],key:null,_vnode:!0})}var Tt=new Set(["href","src","action","formaction","formAction"]);function lr(e){if(typeof e!="string")return!0;let t=e.trim().replace(/[\s\x00-\x1f]/g,"").toLowerCase();return!(t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))}var ur={tr:{depth:2,wrap:"<table><tbody>",unwrap:"</tbody></table>"},td:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},th:{depth:3,wrap:"<table><tbody><tr>",unwrap:"</tr></tbody></table>"},thead:{depth:1,wrap:"<table>",unwrap:"</table>"},tbody:{depth:1,wrap:"<table>",unwrap:"</table>"},tfoot:{depth:1,wrap:"<table>",unwrap:"</table>"},colgroup:{depth:1,wrap:"<table>",unwrap:"</table>"},col:{depth:1,wrap:"<table>",unwrap:"</table>"},caption:{depth:1,wrap:"<table>",unwrap:"</table>"}},fr=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","defs","use","text","tspan","foreignObject","clipPath","mask","pattern","linearGradient","radialGradient","stop","marker","symbol","image","animate","animateTransform","animateMotion","set","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feImage","feMorphology","feSpecularLighting","feTile","feTurbulence","feDistantLight","fePointLight","feSpotLight"]);function Rt(e){let t=e.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);return t?t[1]:""}function Dt(e){let t=e.trim(),n=Rt(t);if(fr.has(n))return Pt(t);let r=ur[n];if(r){let o=document.createElement("template");o.innerHTML=r.wrap+t+r.unwrap;let i=o.content.firstChild;for(let c=0;c<r.depth;c++)i=i.firstChild;return()=>i.cloneNode(!0)}let s=document.createElement("template");return s.innerHTML=t,()=>s.content.firstChild.cloneNode(!0)}var Lt=!1;function Ot(e){return A&&!Lt&&(Lt=!0,console.warn("[what] template() is a compiler internal. Use JSX instead. Direct calls with user input can lead to XSS vulnerabilities.")),Dt(e)}function Pt(e){let t=e.trim();if(Rt(t)==="svg"){let s=document.createElement("template");return s.innerHTML=t,()=>s.content.firstChild.cloneNode(!0)}let r=document.createElement("template");return r.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,()=>r.content.firstChild.firstChild.cloneNode(!0)}function dr(e,t,n){if(typeof t=="function"){let r=t(),s=typeof r;if(s==="string"||s==="number"){let i=document.createTextNode(String(r)),c=n||null;c?e.insertBefore(i,c):e.appendChild(i),Ee&&Ee(e,String(r));let a=i,l=!0;return N(()=>{let u=t(),f=typeof u;if(l&&(f==="string"||f==="number")){let h=String(u);i.data!==h&&(i.data=h),Ee&&Ee(e,h)}else l=!1,a=be(e,u,a,c)}),i}let o=r!=null?be(e,r,null,n||null):null;return N(()=>{o=be(e,t(),o,n||null)}),o}if(typeof t=="string"||typeof t=="number"){let r=document.createTextNode(String(t));return n?e.insertBefore(r,n):e.appendChild(r),r}return t!=null&&typeof t=="object"&&t.nodeType>0?(n?e.insertBefore(t,n):e.appendChild(t),t):be(e,t,null,n||null)}function $t(e){return!e||typeof e!="object"?!1:typeof Node<"u"&&e instanceof Node?!0:typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function pr(e){return!!e&&typeof e=="object"&&(e._vnode===!0||"tag"in e)}var hr=typeof SVGElement<"u";function gr(e){return hr&&e instanceof SVGElement&&e.tagName!=="foreignObject"}function Mt(e){return e==null?[]:Array.isArray(e)?e:[e]}function Ft(e,t,n){if(e==null||typeof e=="boolean")return n;if(Array.isArray(e)){for(let r=0;r<e.length;r++)Ft(e[r],t,n);return n}return typeof e=="string"||typeof e=="number"?(n.push(document.createTextNode(String(e))),n):$t(e)?(n.push(e),n):pr(e)?(n.push(J(e,t,gr(t))),n):(n.push(document.createTextNode(String(e))),n)}function mr(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function be(e,t,n,r){if(!e||typeof e.insertBefore!="function")return A&&console.warn("[what] reconcileInsert called with invalid parent:",e),n;let s=r||null;if(t==null||typeof t=="boolean"){let l=Mt(n);for(let u=0;u<l.length;u++){let f=l[u];f.parentNode===e&&(Y(f),e.removeChild(f))}return null}if((typeof t=="string"||typeof t=="number")&&n&&!Array.isArray(n)&&n.nodeType===3){let l=String(t);return n.data!==l&&(n.data=l),n}if(typeof t=="object"&&t!==null&&t.nodeType>0&&!Array.isArray(t)){if(t===n)return n;if(n&&!Array.isArray(n)&&n.nodeType>0)return n.parentNode===e?(Y(n),e.replaceChild(t,n)):s?e.insertBefore(t,s):e.appendChild(t),t}let o=Ft(t,e,[]),i=Mt(n);if(mr(i,o))return n;let c=o.length;for(let l=0;l<i.length;l++){let u=i[l];if(u.parentNode!==e)continue;let f=!1;for(let h=0;h<c;h++)if(o[h]===u){f=!0;break}f||(Y(u),e.removeChild(u))}let a=s;for(let l=o.length-1;l>=0;l--){let u=o[l];(u.parentNode!==e||u.nextSibling!==a)&&(a&&a.parentNode!==e&&(a=null),a?e.insertBefore(u,a):e.appendChild(u)),a=u}return o.length===0?null:o.length===1?o[0]:o}function yr(e,t,n){let r=n?.key,s=n?.raw||!1;return(o,i)=>{let c=[],a=[],l=[],u=r&&!s?new Map:null,f=document.createComment("/list");return o.insertBefore(f,i||null),N(()=>{let h=e()||[];r?_r(o,f,c,h,a,l,t,r,u):xr(o,f,c,h,a,l,t),c=h.length>0?h.slice():h}),f}}function xr(e,t,n,r,s,o,i){let c=r.length,a=n.length;if(c===0){if(a>0){for(let g=0;g<a;g++)o[g]&&o[g]();for(let g=a-1;g>=0;g--){let d=s[g];d&&((d._componentCtx||d._dispose||d._propEffects)&&Y(d),d.parentNode===e&&e.removeChild(d))}s.length=0,o.length=0}return}if(a===0){let g=document.createDocumentFragment();for(let d=0;d<c;d++){let b=r[d],S=pe(T=>(o[d]=T,i(b,d)));s[d]=S,g.appendChild(S)}e.insertBefore(g,t);return}let l=0,u=Math.min(a,c);for(;l<u&&n[l]===r[l];)l++;if(l===a&&l===c)return;let f=a-1,h=c-1;for(;f>=l&&h>=l&&n[f]===r[h];)f--,h--;let x=new Array(c),m=new Array(c);for(let g=0;g<l;g++)x[g]=s[g],m[g]=o[g];for(let g=h+1;g<c;g++){let d=f+1+(g-h-1);x[g]=s[d],m[g]=o[d]}let w=h-l+1,E=f-l+1;if(w===0)for(let g=l;g<=f;g++)o[g]?.(),s[g]?.parentNode&&s[g].parentNode.removeChild(s[g]);else if(E===0){let g=l<c&&x[h+1]?x[h+1]:t,d=document.createDocumentFragment();for(let b=l;b<=h;b++){let S=r[b],T=b;x[b]=pe(k=>(m[T]=k,i(S,T))),d.appendChild(x[b])}e.insertBefore(d,g)}else br(e,t,n,r,s,o,i,l,f,h,x,m);s.length=c,o.length=c;for(let g=0;g<c;g++)s[g]=x[g],o[g]=m[g]}function br(e,t,n,r,s,o,i,c,a,l,u,f){let h=new Map;for(let d=c;d<=a;d++)h.set(n[d],d);let x=l-c+1,m=new Int32Array(x);m.fill(-1);for(let d=c;d<=l;d++){let b=h.get(r[d]);b!==void 0&&(h.delete(r[d]),u[d]=s[b],f[d]=o[b],m[d-c]=b)}for(let[,d]of h)o[d]?.(),s[d]?.parentNode&&s[d].parentNode.removeChild(s[d]);let w=x-wr(m,x),E=new Uint8Array(x);if(w>1){let d=new Int32Array(w),b=new Int32Array(w),S=0;for(let k=0;k<x;k++)m[k]!==-1&&(d[S]=m[k],b[S]=k,S++);let T=jt(d,w);for(let k=0;k<T.length;k++)E[b[T[k]]]=1}else if(w===1){for(let d=0;d<x;d++)if(m[d]!==-1){E[d]=1;break}}for(let d=c;d<=l;d++)if(!u[d]){let b=r[d],S=d;u[d]=pe(T=>(f[S]=T,i(b,S)))}let g=l+1<u.length&&u[l+1]?u[l+1]:t;for(let d=l;d>=c;d--){let b=d-c;(m[b]===-1||!E[b])&&(g&&g.parentNode!==e&&(g=t),e.insertBefore(u[d],g)),g=u[d]}}function wr(e,t){let n=0;for(let r=0;r<t;r++)e[r]===-1&&n++;return n}function jt(e,t){if(t===0)return[];if(t===1)return[0];let n=new Int32Array(t),r=new Int32Array(t),s=1;n[0]=0,r[0]=-1;for(let c=1;c<t;c++)if(e[c]>e[n[s-1]])r[c]=n[s-1],n[s++]=c;else{let a=0,l=s-1;for(;a<l;){let u=a+l>>1;e[n[u]]<e[c]?a=u+1:l=u}n[a]=c,r[c]=a>0?n[a-1]:-1}let o=new Array(s),i=n[s-1];for(let c=s-1;c>=0;c--)o[c]=i,i=r[i];return o}function _r(e,t,n,r,s,o,i,c,a){let l=r.length,u=n.length;if(l===0){if(u>0){for(let p=0;p<u;p++)o[p]&&o[p]();for(let p=u-1;p>=0;p--){let C=s[p];C&&((C._componentCtx||C._dispose||C._propEffects)&&Y(C),C.parentNode===e&&e.removeChild(C))}s.length=0,o.length=0,a&&a.clear()}return}if(u===0){let p=document.createDocumentFragment();for(let C=0;C<l;C++){let I=r[C],$=C,D;if(a){let Q=c(I),_=y(I);D=_,a.set(Q,{itemSig:_})}else D=I;let U=pe(Q=>(o[$]=Q,i(D,$)));s[C]=U,p.appendChild(U)}e.insertBefore(p,t);return}let f=0,h=Math.min(u,l);for(;f<h;){if(n[f]===r[f]){f++;continue}let p=c(n[f]),C=c(r[f]);if(p!==C)break;a&&a.get(p).itemSig.set(r[f]),f++}let x=u-1,m=l-1;for(;x>=f&&m>=f;){if(n[x]===r[m]){x--,m--;continue}let p=c(n[x]),C=c(r[m]);if(p!==C)break;a&&a.get(p).itemSig.set(r[m]),x--,m--}if(f>x&&f>m)return;let w=new Array(l),E=new Array(l);for(let p=0;p<f;p++)w[p]=s[p],E[p]=o[p];for(let p=m+1;p<l;p++){let C=x+1+(p-m-1);w[p]=s[C],E[p]=o[C]}let g=m-f+1;if(x-f+1===0){let p=m+1<l&&w[m+1]?w[m+1]:t,C=document.createDocumentFragment();for(let I=f;I<=m;I++){let $=r[I],D=I,U;if(a){let Q=c($),_=y($);U=_,a.set(Q,{itemSig:_})}else U=$;w[I]=pe(Q=>(E[D]=Q,i(U,D))),C.appendChild(w[I])}e.insertBefore(C,p),tt(s,o,w,E,l);return}if(g===0){for(let p=f;p<=x;p++)o[p]?.(),s[p]?.parentNode&&e.removeChild(s[p]),a&&a.delete(c(n[p]));tt(s,o,w,E,l);return}let b=new Map;for(let p=f;p<=x;p++)b.set(c(n[p]),p);let S=new Int32Array(g);S.fill(-1);for(let p=f;p<=m;p++){let C=c(r[p]),I=b.get(C);I!==void 0&&(b.delete(C),w[p]=s[I],E[p]=o[I],S[p-f]=I,a&&r[p]!==n[I]&&a.get(C).itemSig.set(r[p]))}for(let[p,C]of b)o[C]?.(),s[C]?.parentNode&&e.removeChild(s[C]),a&&a.delete(p);for(let p=f;p<=m;p++)if(!w[p]){let C=r[p],I=p,$;if(a){let D=c(C),U=y(C);$=U,a.set(D,{itemSig:U})}else $=C;w[p]=pe(D=>(E[I]=D,i($,I)))}let T=0,k=!0,v=-1;for(let p=0;p<g;p++)S[p]!==-1&&(T++,S[p]<=v&&(k=!1),v=S[p]);let F=new Uint8Array(g);if(k)for(let p=0;p<g;p++)S[p]!==-1&&(F[p]=1);else if(T>1){let p=new Int32Array(T),C=new Int32Array(T),I=0;for(let D=0;D<g;D++)S[D]!==-1&&(p[I]=S[D],C[I]=D,I++);let $=jt(p,T);for(let D=0;D<$.length;D++)F[C[$[D]]]=1}else if(T===1){for(let p=0;p<g;p++)if(S[p]!==-1){F[p]=1;break}}let M=m+1<w.length&&w[m+1]?w[m+1]:t;for(let p=m;p>=f;p--){let C=p-f;(S[C]===-1||!F[C])&&(M&&M.parentNode!==e&&(M=t),e.insertBefore(w[p],M)),M=w[p]}tt(s,o,w,E,l)}function tt(e,t,n,r,s){e.length=s,t.length=s;for(let o=0;o<s;o++)e[o]=n[o],t[o]=r[o]}function Cr(e,t){for(let n in t){let r=t[n];if(n.startsWith("on")&&n.length>2){let s=n.slice(2).toLowerCase();e.addEventListener(s,r);continue}typeof r=="function"&&!n.startsWith("on")?n==="class"||n==="className"?N(()=>{e.className=r()||""}):n==="style"&&typeof r()=="object"?N(()=>{let s=r();for(let o in s)e.style[o]=s[o]??""}):N(()=>{Se(e,n,r())}):Se(e,n,r)}}function Se(e,t,n){if(t==="ref"){typeof n=="function"?n(e):n&&typeof n=="object"&&(n.current=e);return}if(t!=="key"){if((Tt.has(t)||Tt.has(t.toLowerCase()))&&!lr(n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${t}" attribute: ${n}`);return}if(t==="class"||t==="className")e.className=n||"";else if(t==="dangerouslySetInnerHTML")e.innerHTML=n?.__html??"";else if(t==="innerHTML")n&&typeof n=="object"&&"__html"in n?e.innerHTML=n.__html??"":typeof console<"u"&&n!=null&&n!==""&&console.warn('[what] Plain string innerHTML is not allowed. Use { __html: "..." } or dangerouslySetInnerHTML={{ __html: "..." }} instead.');else if(t==="style"){if(typeof n=="string")e.style.cssText=n;else if(typeof n=="object")for(let r in n)e.style[r]=n[r]??""}else t.startsWith("data-")||t.startsWith("aria-")?e.setAttribute(t,n):typeof n=="boolean"?n?e.setAttribute(t,""):e.removeAttribute(t):t in e?e[t]=n:e.setAttribute(t,n)}}var Nt=new Set;function kr(e){for(let t of e)Nt.has(t)||(Nt.add(t),document.addEventListener(t,n=>{let r=n.target,s="$$"+t;for(;r;){let o=r[s];if(o&&(o(n),n.cancelBubble))return;r=r.parentNode}}))}function Er(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function vr(e,t){N(()=>{for(let n in t){let r=typeof t[n]=="function"?t[n]():t[n];e.classList.toggle(n,!!r)}})}var Ve=!1,te=null;function Sr(){return Ve}function Ar(e,t){Ve=!0,te={parent:t,index:0};try{return ve(e,t)}finally{Ve=!1,te=null}}function It(e){let t=e.childNodes;for(;te.index<t.length;){let n=t[te.index];if(n.nodeType===8){let r=n.textContent;if(r==="$"||r==="/$"||r==="[]"||r==="/[]"){te.index++;continue}}return te.index++,n}return null}function nt(){return typeof process<"u"&&!1}function ve(e,t){if(e==null||typeof e=="boolean")return null;if(typeof e=="string"||typeof e=="number"){let r=It(t),s=String(e);if(r&&r.nodeType===3)return nt()&&r.textContent!==s&&(console.warn(`[what] Hydration mismatch: expected text "${s}", got "${r.textContent}"`),r.textContent=s),r;nt()&&console.warn(`[what] Hydration mismatch: expected text node "${s}", got ${r?r.nodeName:"nothing"}. Falling back to client render.`);let o=document.createTextNode(s);return r?t.replaceChild(o,r):t.appendChild(o),o}if(typeof e=="function"){let r=e(),s=ve(r,t);return N(()=>{let o=e();Ve||(s=be(t,o,s,null))}),s}if(Array.isArray(e)){let r=[];for(let s of e){let o=ve(s,t);o&&r.push(o)}return r.length===1?r[0]:r}if(typeof e=="object"&&e._vnode){if(typeof e.tag=="function"){let i=St(),c=e.tag,a=e.props||{},l=e.children||[],u={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:c,_parentCtx:i[i.length-1]||null,_errorBoundary:null};i.push(u);let f;try{let h=l.length===0?void 0:l.length===1?l[0]:l;f=c({...a,children:h})}catch(h){return i.pop(),console.error("[what] Error in component during hydration:",c.name||"Anonymous",h),null}return i.pop(),u.mounted=!0,u._mountCallbacks&&queueMicrotask(()=>{if(!u.disposed)for(let h of u._mountCallbacks)try{h()}catch(x){console.error("[what] onMount error:",x)}}),ve(f,t)}let r=It(t),s=e.tag.toUpperCase();if(r&&r.nodeType===1&&r.nodeName===s){Tr(r,e.props||{});let i=te;if(te={parent:r,index:0},e.props?.dangerouslySetInnerHTML?.__html==null)for(let a of e.children)ve(a,r);return te=i,r}nt()&&console.warn(`[what] Hydration mismatch: expected <${e.tag}>, got ${r?r.nodeName:"nothing"}. Falling back to client render.`);let o=document.createElement(e.tag);for(let i in e.props||{})i==="children"||i==="key"||Se(o,i,e.props[i]);for(let i of e.children)be(o,i,null,null);return r?t.replaceChild(o,r):t.appendChild(o),o}if($t(e))return e;let n=document.createTextNode(String(e));return t.appendChild(n),n}function Tr(e,t){for(let n in t){if(n==="children"||n==="key"||n==="ref"||n==="dangerouslySetInnerHTML"||n==="innerHTML")continue;let r=t[n];if(n.startsWith("on")&&n.length>2){let s=n.slice(2).toLowerCase();e.addEventListener(s,r);continue}if(n.startsWith("$$")){e[n]=r;continue}if(typeof r=="function"&&!n.startsWith("on")){n==="class"||n==="className"?N(()=>{e.className=r()||""}):n==="style"&&typeof r()=="object"?N(()=>{let s=r();for(let o in s)e.style[o]=s[o]??""}):N(()=>{Se(e,n,r())});continue}}}function Z(e){let t=G();if(!t)throw new Error(`[what] ${e||"Hook"}() can only be called inside a component function. Did you call it outside of a component or in an async callback? If you need reactive state outside a component, use signal() directly.`);return t}function ce(e){let t=e.hookIndex++;return{index:t,exists:t<e.hooks.length}}function Lr(e){let t=Z("useState"),{index:n,exists:r}=ce(t);if(!r){let o=y(typeof e=="function"?e():e);t.hooks[n]=o}let s=t.hooks[n];return[s,s.set]}function Mr(e){let t=Z("useSignal"),{index:n,exists:r}=ce(t);return r||(t.hooks[n]=y(typeof e=="function"?e():e)),t.hooks[n]}function Nr(e){let t=Z("useComputed"),{index:n,exists:r}=ce(t);return r||(t.hooks[n]=W(e)),t.hooks[n]}function Ir(e,t){let n=Z("useEffect"),{index:r,exists:s}=ce(n);if(s||(n.hooks[r]={cleanup:null,dispose:null}),A&&Array.isArray(t)&&t.length>0)for(let i=0;i<t.length;i++){let c=t[i];c!=null&&typeof c!="function"&&console.warn(`[what] useEffect dep at index ${i} is not a function. Did you mean to pass a signal? Use count instead of count()`)}let o=n.hooks[r];o.dispose||(t===void 0?queueMicrotask(()=>{n.disposed||(o.dispose=N(()=>{if(o.cleanup){try{o.cleanup()}catch{}o.cleanup=null}let i=e();typeof i=="function"&&(o.cleanup=i)}),n.effects=n.effects||[],n.effects.push(o.dispose))}):t.length===0?(queueMicrotask(()=>{if(n.disposed)return;let i=e();typeof i=="function"&&(o.cleanup=i)}),o.dispose=!0):queueMicrotask(()=>{n.disposed||(o.dispose=N(()=>{for(let c=0;c<t.length;c++){let a=t[c];typeof a=="function"&&a._signal&&a()}if(o.cleanup){try{o.cleanup()}catch{}o.cleanup=null}let i=ie(()=>e());typeof i=="function"&&(o.cleanup=i)}),n.effects=n.effects||[],n.effects.push(o.dispose))}))}function Rr(e,t){let n=Z("useMemo"),{index:r,exists:s}=ce(n);return s||(n.hooks[r]={computed:W(e)}),n.hooks[r].computed}function Dr(e,t){let n=Z("useCallback"),{index:r,exists:s}=ce(n);return s||(n.hooks[r]={callback:e}),n.hooks[r].callback}function Or(e){let t=Z("useRef"),{index:n,exists:r}=ce(t);return r||(t.hooks[n]={current:e}),t.hooks[n]}function Bt(e){let t=G();for(A&&!t&&console.warn(`[what] useContext(${e?.displayName||"Context"}) called outside of component render. useContext must be called during component rendering, not inside effects or event handlers. Store the context value in a variable during render and use that variable in your callback.`);t;){if(t._contextValues&&t._contextValues.has(e)){let n=t._contextValues.get(e);return n&&n._signal?n():n}t=t._parentCtx}return e._defaultValue}function Pr(e){let t={_defaultValue:e,Provider:({value:n,children:r})=>{let s=Z("Context.Provider");if(s._contextValues||(s._contextValues=new Map),s._contextSignals||(s._contextSignals=new Map),s._contextSignals.has(t))s._contextSignals.get(t).set(n);else{let o=y(n);s._contextSignals.set(t,o),s._contextValues.set(t,o)}return r},Consumer:({children:n})=>{let r=Bt(t);return typeof n=="function"?n(r):n}};return t}function $r(e,t,n){let r=Z("useReducer"),{index:s,exists:o}=ce(r);if(!o){let c=n?n(t):t,a=y(c),l=u=>{a.set(f=>e(f,u))};r.hooks[s]={signal:a,dispatch:l}}let i=r.hooks[s];return[i.signal,i.dispatch]}function Fr(e){let t=Z("onMount");t.mounted||(t._mountCallbacks=t._mountCallbacks||[],t._mountCallbacks.push(e))}function jr(e){let t=Z("onCleanup");t._cleanupCallbacks=t._cleanupCallbacks||[],t._cleanupCallbacks.push(e)}function Br(e,t={}){let n=y(t.initialValue??null),r=y(!t.initialValue),s=y(null),o=null,i=async l=>{o&&o.abort(),o=new AbortController;let{signal:u}=o;r.set(!0),s.set(null);try{let f=await e(l,{signal:u});u.aborted||H(()=>{n.set(f),r.set(!1)})}catch(f){u.aborted||H(()=>{s.set(f),r.set(!1)})}},c=l=>{n.set(typeof l=="function"?l(n()):l)},a=G?.();return a&&(a._cleanupCallbacks=a._cleanupCallbacks||[],a._cleanupCallbacks.push(()=>{o&&o.abort()})),t.initialValue||i(t.source),[n,{loading:r,error:s,refetch:i,mutate:c}]}function qt(e){return e._storeComputed=!0,e}var Ht=!1;function Hr(e){return Ht||(Ht=!0,console.warn("[what] storeComputed() is deprecated. Use derived() instead.")),qt(e)}function Vr(e){let t={},n={},r={},s={};for(let[o,i]of Object.entries(e))typeof i=="function"&&i._storeComputed?(A&&i.length===0&&console.warn(`[what] derived() for "${o}" should accept the state parameter, e.g. derived(state => ...).`),n[o]=i):typeof i=="function"?r[o]=i:t[o]=y(i);for(let[o,i]of Object.entries(n)){let c=new Proxy({},{get(a,l){if(t[l])return t[l]();if(n[l])return n[l]()}});n[o]=W(()=>i(c))}for(let[o,i]of Object.entries(r))r[o]=(...c)=>{H(()=>{let a=new Proxy({},{get(l,u){if(t[u])return t[u].peek();if(n[u])return n[u].peek();if(r[u])return r[u]},set(l,u,f){return t[u]&&t[u].set(f),!0}});i.apply(a,c)})};return function(){let i={};for(let[c,a]of Object.entries(t))Object.defineProperty(i,c,{get:()=>a(),enumerable:!0});for(let[c,a]of Object.entries(n))Object.defineProperty(i,c,{get:()=>a(),enumerable:!0});for(let[c,a]of Object.entries(r))i[c]=a;return i}}var Vt=!1;function qr(e){return Vt||(Vt=!0,console.warn("[what] atom() is deprecated. Use signal() directly instead.")),y(e)}var rt={title:null,metas:new Map,links:new Map};function Wr({title:e,meta:t,link:n,children:r}){if(typeof document>"u")return null;if(e&&(document.title=e,rt.title=e),t)for(let s of Array.isArray(t)?t:[t]){let o=s.name||s.property||s.httpEquiv||JSON.stringify(s);Wt("meta",o,s)}if(n)for(let s of Array.isArray(n)?n:[n]){let o=s.rel+(s.href||"");Wt("link",o,s)}return r||null}function Wt(e,t,n){let r=document.head.querySelector(`[data-what-head="${t}"]`);if(r){Gr(r,n);return}let s=document.createElement(e);s.setAttribute("data-what-head",t);for(let[o,i]of Object.entries(n))s.setAttribute(o,i);document.head.appendChild(s)}function Gr(e,t){for(let[n,r]of Object.entries(t))e.getAttribute(n)!==r&&e.setAttribute(n,r)}function zr(){let e=document.head.querySelectorAll("[data-what-head]");for(let t of e)t.remove();rt.metas.clear(),rt.links.clear()}var Te=[],Le=[],st=!1;function ne(e){return Te.push(e),zt(),()=>{let t=Te.indexOf(e);t!==-1&&Te.splice(t,1)}}function ae(e){return Le.push(e),zt(),()=>{let t=Le.indexOf(e);t!==-1&&Le.splice(t,1)}}function Gt(){for(;Te.length>0;){let e=Te.shift();try{e()}catch(t){console.error("[what] Scheduler read error:",t)}}for(;Le.length>0;){let e=Le.shift();try{e()}catch(t){console.error("[what] Scheduler write error:",t)}}st=!1}function zt(){st||(st=!0,requestAnimationFrame(Gt))}function Ur(e){return new Promise(t=>{ne(()=>{t(e())})})}function Xr(e){return new Promise(t=>{ae(()=>{e(),t()})})}function Yr(e,t){let n=Symbol("scheduledEffect");return N(()=>{Ut(n,()=>{ne(()=>{let r=e();t&&ae(()=>t(r))})})})}function Kr(){let e,t=new Promise((n,r)=>{let s=requestAnimationFrame(n);e=()=>{cancelAnimationFrame(s),r(new Error("Cancelled"))}});return t.cancel=e,t}var Ae=new Map;function Ut(e,t){Ae.has(e)?Ae.set(e,t):(Ae.set(e,t),requestAnimationFrame(()=>{let n=Ae.get(e);Ae.delete(e),n&&n()}))}var ot=new WeakMap,qe=null;function Qr(e,t){return typeof ResizeObserver>"u"?(t(e.getBoundingClientRect()),()=>{}):(qe||(qe=new ResizeObserver(n=>{ne(()=>{for(let r of n){let s=ot.get(r.target);s&&s(r.contentRect)}})})),ot.set(e,t),qe.observe(e),()=>{ot.delete(e),qe.unobserve(e)})}function Jr(e,t,n={}){if(typeof IntersectionObserver>"u")return t({isIntersecting:!0,intersectionRatio:1}),()=>{};let r=new IntersectionObserver(s=>{ne(()=>{for(let o of s)t(o)})},n);return r.observe(e),()=>r.disconnect()}function Zr(e,t={}){let{duration:n=300,easing:r=s=>s*(2-s)}=t;return new Promise(s=>{let o,i,c;ne(()=>{o=window.scrollY;let l=e.getBoundingClientRect();i=o+l.top,c=performance.now(),a()});function a(){ne(()=>{let l=performance.now()-c,u=Math.min(l/n,1),f=r(u),h=o+(i-o)*f;ae(()=>{window.scrollTo(0,h),u<1?requestAnimationFrame(a):s()})})}})}function Xt(e){let t=G?.(),n=N(e);return t&&t.effects.push(n),n}function Yt(e,t={}){let{stiffness:n=100,damping:r=10,mass:s=1,precision:o=.01}=t,i=y(e),c=y(e),a=y(0),l=y(!1),u=null,f=null;function h(g){if(f===null){f=g,u=requestAnimationFrame(h);return}let d=Math.min((g-f)/1e3,.064);f=g;let b=i.peek(),S=c.peek(),T=a.peek(),k=b-S,v=-n*k,F=-r*T,M=(v+F)/s,p=T+M*d,C=b+p*d;if(H(()=>{a.set(p),i.set(C)}),Math.abs(p)<o&&Math.abs(k)<o){H(()=>{i.set(S),a.set(0),l.set(!1)}),u=null,f=null;return}u=requestAnimationFrame(h)}function x(g){c.set(g),u===null&&(l.set(!0),f=null,u=requestAnimationFrame(h))}function m(){u&&(cancelAnimationFrame(u),u=null),l.set(!1),f=null}function w(g){m(),H(()=>{i.set(g),c.set(g),a.set(0)})}let E=G?.();return E&&(E._cleanupCallbacks=E._cleanupCallbacks||[],E._cleanupCallbacks.push(m)),{current:()=>i(),target:()=>c(),velocity:()=>a(),isAnimating:()=>l(),set:x,stop:m,snap:w,subscribe:i.subscribe}}function Kt(e,t,n={}){let{duration:r=300,easing:s=x=>x*(2-x),onUpdate:o,onComplete:i}=n,c=y(0),a=y(e),l=y(!0),u=null,f=null;function h(x){u===null&&(u=x);let m=x-u,w=Math.min(m/r,1),E=s(w),g=e+(t-e)*E;H(()=>{c.set(w),a.set(g)}),o&&o(g,w),w<1?f=requestAnimationFrame(h):(l.set(!1),i&&i())}return f=requestAnimationFrame(h),{progress:()=>c(),value:()=>a(),isAnimating:()=>l(),cancel:()=>{f&&cancelAnimationFrame(f),l.set(!1)},subscribe:a.subscribe}}var Qt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*(2*Math.PI/3)),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1,easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375};function eo(e={}){let{duration:t=300,easing:n=Qt.easeOutQuad}=e,r=y(!1),s=y(0);async function o(i){return r.set(!0),s.set(0),new Promise(c=>{let a=performance.now();function l(u){let f=u-a,h=Math.min(f/t,1);s.set(n(h)),h<1?requestAnimationFrame(l):(r.set(!1),i&&i(),c())}requestAnimationFrame(l)})}return{isTransitioning:()=>r(),progress:()=>s(),start:o}}function to(e,t={}){let{onDrag:n,onDragStart:r,onDragEnd:s,onPinch:o,onSwipe:i,onTap:c,onLongPress:a,preventDefault:l=!1}=t,u={isDragging:y(!1),startX:0,startY:0,currentX:y(0),currentY:y(0),deltaX:y(0),deltaY:y(0),velocity:y({x:0,y:0})},f=0,h=0,x=0,m=null;function w(k){let v=k.touches?k.touches[0]:k;u.startX=v.clientX,u.startY=v.clientY,h=v.clientX,x=v.clientY,f=performance.now(),u.isDragging.set(!0),r&&r({x:u.startX,y:u.startY}),a&&(m=setTimeout(()=>{u.isDragging.peek()&&a({x:h,y:x})},500))}function E(k){if(!u.isDragging.peek())return;let v=k.touches?k.touches[0]:k,F=v.clientX,M=v.clientY,p=performance.now(),C=p-f;H(()=>{u.currentX.set(F),u.currentY.set(M),u.deltaX.set(F-u.startX),u.deltaY.set(M-u.startY),C>0&&u.velocity.set({x:(F-h)/C*1e3,y:(M-x)/C*1e3})}),h=F,x=M,f=p,m&&Math.sqrt(u.deltaX.peek()**2+u.deltaY.peek()**2)>10&&(clearTimeout(m),m=null),n&&n({x:F,y:M,deltaX:u.deltaX.peek(),deltaY:u.deltaY.peek(),velocity:u.velocity.peek()})}function g(k){if(!u.isDragging.peek())return;m&&(clearTimeout(m),m=null);let v=u.deltaX.peek(),F=u.deltaY.peek(),M=u.velocity.peek();if(Math.sqrt(v**2+F**2)<10&&c&&c({x:u.startX,y:u.startY}),i&&(Math.abs(M.x)>500||Math.abs(M.y)>500)){let C=Math.abs(M.x)>Math.abs(M.y)?M.x>0?"right":"left":M.y>0?"down":"up";i({direction:C,velocity:M})}s&&s({deltaX:v,deltaY:F,velocity:M}),u.isDragging.set(!1)}let d=null;function b(k){if(!o||k.touches.length!==2)return;let v=k.touches[0],F=k.touches[1],M=Math.sqrt((F.clientX-v.clientX)**2+(F.clientY-v.clientY)**2);d===null&&(d=M);let p=M/d,C=(v.clientX+F.clientX)/2,I=(v.clientY+F.clientY)/2;o({scale:p,centerX:C,centerY:I})}function S(){d=null}typeof e=="function"?Xt(()=>{let k=ie(e);if(k)return T(k)}):e?.current!==void 0?Xt(()=>{let k=e.current;if(k)return T(k)}):e&&T(e);function T(k){return k.addEventListener("mousedown",w),k.addEventListener("touchstart",w,{passive:!l}),window.addEventListener("mousemove",E),window.addEventListener("touchmove",b),window.addEventListener("touchmove",E),window.addEventListener("mouseup",g),window.addEventListener("touchend",g),window.addEventListener("touchend",S),()=>{k.removeEventListener("mousedown",w),k.removeEventListener("touchstart",w),window.removeEventListener("mousemove",E),window.removeEventListener("touchmove",b),window.removeEventListener("touchmove",E),window.removeEventListener("mouseup",g),window.removeEventListener("touchend",g),window.removeEventListener("touchend",S)}}return u}function no(e){let t=y(e),n=[];return{value:()=>t(),setValue:r=>t.set(r),spring(r,s={}){let o=Yt(t.peek(),s);o.set(r);let i=N(()=>{t.set(o.current())});return{stop:()=>{o.stop(),i()}}},timing(r,s={}){let o=Kt(t.peek(),r,{...s,onUpdate:i=>t.set(i)});return{stop:()=>o.cancel()}},interpolate(r,s){return()=>{let o=t();for(let i=0;i<r.length-1;i++)if(o>=r[i]&&o<=r[i+1]){let c=(o-r[i])/(r[i+1]-r[i]);return s[i]+(s[i+1]-s[i])*c}return o<=r[0]?s[0]:s[s.length-1]}},subscribe:t.subscribe}}function Jt(e){return{enter:`${e}-enter`,enterActive:`${e}-enter-active`,enterDone:`${e}-enter-done`,exit:`${e}-exit`,exitActive:`${e}-exit-active`,exitDone:`${e}-exit-done`}}async function ro(e,t,n="enter",r=300){let s=Jt(t);return new Promise(o=>{ae(()=>{e.classList.add(s[n]),ne(()=>{e.offsetHeight,ae(()=>{e.classList.add(s[`${n}Active`]),setTimeout(()=>{ae(()=>{e.classList.remove(s[n],s[`${n}Active`]),e.classList.add(s[`${n}Done`]),o()})},r)})})})})}var en=y(null);typeof document<"u"&&document.addEventListener("focusin",e=>{en.set(e.target)});function oo(){return{current:()=>en(),focus:e=>e?.focus(),blur:()=>document.activeElement?.blur()}}function so(){let e={current:null};function t(r){typeof document>"u"||(e.current=r||document.activeElement||null)}function n(r){let s=e.current||r;s&&typeof s.focus=="function"&&s.focus()}return{capture:t,restore:n,previous:()=>e.current}}function tn(e){let t=null;function n(){if(typeof document>"u")return;t=document.activeElement;let s=e.current||e;if(!s||typeof s.querySelectorAll!="function")return;let o=Zt(s);if(o.length===0)return;o[0].focus();function i(c){if(c.key!=="Tab")return;let a=Zt(s),l=a[0],u=a[a.length-1];c.shiftKey?document.activeElement===l&&(c.preventDefault(),u.focus()):document.activeElement===u&&(c.preventDefault(),l.focus())}return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}}function r(){t&&typeof t.focus=="function"&&t.focus()}return{activate:n,deactivate:r}}function Zt(e){let t=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(t)).filter(n=>n.offsetParent!==null)}function io({children:e,active:t=!0}){let n={current:null},r=y(0),s=tn(n),o=null,i=l=>{n.current=l,r.set(u=>u+1)},c=N(()=>{if(r(),o&&(o(),o=null,s.deactivate()),t&&n.current)return o=s.activate(),()=>{o?.(),o=null,s.deactivate()}}),a=G?.();return a&&(a._cleanupCallbacks=a._cleanupCallbacks||[],a._cleanupCallbacks.push(()=>{c(),o?.(),o=null,s.deactivate()})),L("div",{ref:i},e)}var le=null,it=0;function co(){return typeof document>"u"?null:(le||(le=document.createElement("div"),le.id="what-announcer",le.setAttribute("aria-live","polite"),le.setAttribute("aria-atomic","true"),le.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
width: 1px;
|
|
4
4
|
height: 1px;
|
|
@@ -8,7 +8,7 @@ var A=!(typeof process<"u"),P=null;function yn(e){A&&(P=e)}var B=null,q=null,X=n
|
|
|
8
8
|
clip: rect(0, 0, 0, 0);
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
border: 0;
|
|
11
|
-
`,document.body.appendChild(le)),le)}function
|
|
11
|
+
`,document.body.appendChild(le)),le)}function nn(e,t={}){let{priority:n="polite",timeout:r=1e3}=t,s=co();if(!s)return;s.setAttribute("aria-live",n);let o=++it;s.textContent="",requestAnimationFrame(()=>{it===o&&(s.textContent=e)}),setTimeout(()=>{it===o&&(s.textContent="")},r)}function ao(e){return nn(e,{priority:"assertive"})}function lo({href:e="#main",children:t="Skip to content"}){return L("a",{href:e,class:"what-skip-link",onClick:n=>{n.preventDefault();let r=document.querySelector(e);r&&(r.focus(),r.scrollIntoView())},style:{position:"absolute",top:"-40px",left:"0",padding:"8px",background:"#000",color:"#fff",textDecoration:"none",zIndex:"10000"},onFocus:n=>{n.target.style.top="0"},onBlur:n=>{n.target.style.top="-40px"}},t)}function uo(e=!1){let t=y(e);return{expanded:()=>t(),toggle:()=>t.set(!t.peek()),open:()=>t.set(!0),close:()=>t.set(!1),buttonProps:()=>({"aria-expanded":t(),onClick:()=>t.set(!t.peek())}),panelProps:()=>({hidden:!t()})}}function fo(e=null){let t=y(e);return{selected:()=>t(),select:n=>t.set(n),isSelected:n=>t()===n,itemProps:n=>({"aria-selected":t()===n,onClick:()=>t.set(n)})}}function po(e=!1){let t=y(e);return{checked:()=>t(),toggle:()=>t.set(!t.peek()),set:n=>t.set(n),checkboxProps:()=>({role:"checkbox","aria-checked":t(),tabIndex:0,onClick:()=>t.set(!t.peek()),onKeyDown:n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),t.set(!t.peek()))}})}}function ho(e){let t=typeof e=="function"?e:()=>e,n=y(0);function r(s){let o=t();if(!(o<=0))switch(s.key){case"ArrowDown":case"ArrowRight":s.preventDefault(),n.set((n.peek()+1)%o);break;case"ArrowUp":case"ArrowLeft":s.preventDefault(),n.set((n.peek()-1+o)%o);break;case"Home":s.preventDefault(),n.set(0);break;case"End":s.preventDefault(),n.set(o-1);break}}return{focusIndex:()=>n(),setFocusIndex:s=>n.set(s),getItemProps:s=>({tabIndex:n()===s?0:-1,onKeyDown:r,onFocus:()=>n.set(s)}),containerProps:()=>({role:"listbox"})}}function go({children:e,as:t="span"}){return L(t,{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}},e)}function mo({children:e,priority:t="polite",atomic:n=!0}){return L("div",{"aria-live":t,"aria-atomic":n},e)}var rn=0;function ct(e="what"){let t=`${e}-${++rn}`;return()=>t}function yo(e,t="what"){let n=[];for(let r=0;r<e;r++)n.push(`${t}-${++rn}`);return n}function xo(e){let t=ct("desc");return{descriptionId:t,descriptionProps:()=>({id:t(),style:{display:"none"}}),describedByProps:()=>({"aria-describedby":t()}),Description:()=>L("div",{id:t(),style:{display:"none"}},e)}}function bo(e){let t=ct("label");return{labelId:t,labelProps:()=>({id:t()}),labelledByProps:()=>({"aria-labelledby":t()})}}var wo={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Home:"Home",End:"End",Tab:"Tab"};function _o(e,t){return n=>{n.key===e&&t(n)}}function Co(e,t){return n=>{e.includes(n.key)&&t(n)}}var ko=`
|
|
12
12
|
.what-skeleton {
|
|
13
13
|
background: linear-gradient(
|
|
14
14
|
90deg,
|
|
@@ -60,7 +60,7 @@ var A=!(typeof process<"u"),P=null;function yn(e){A&&(P=e)}var B=null,q=null,X=n
|
|
|
60
60
|
0% { transform: translateX(-100%); }
|
|
61
61
|
100% { transform: translateX(100%); }
|
|
62
62
|
}
|
|
63
|
-
`,rn=!1;function he(){if(rn||typeof document>"u")return;rn=!0;let e=document.createElement("style");e.textContent=_o,document.head.appendChild(e)}function ct({width:e,height:t,variant:n="shimmer",circle:r=!1,class:s,style:o,count:i=1}){he();let c=`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""} ${n==="wave"?"what-skeleton-wave":""}`,a=s?`${c} ${s}`:c,l={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,borderRadius:r?"50%":void 0,...o};return i===1?L("div",{class:a,style:l,"aria-hidden":"true"}):Array.from({length:i},(u,f)=>L("div",{key:f,class:a,style:{...l,marginBottom:f<i-1?"8px":void 0},"aria-hidden":"true"}))}function at({lines:e=3,lastLineWidth:t="60%",lineHeight:n=16,gap:r=8,variant:s="shimmer"}){return he(),L("div",{class:"what-skeleton-text","aria-hidden":"true"},Array.from({length:e},(o,i)=>L("div",{key:i,class:`what-skeleton ${s==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${n}px`,width:i===e-1?t:"100%",marginBottom:i<e-1?`${r}px`:void 0}})))}function Co({size:e=40,variant:t="shimmer"}){return ct({width:e,height:e,circle:!0,variant:t})}function on({imageHeight:e=200,lines:t=3,variant:n="shimmer"}){return he(),L("div",{class:"what-skeleton-card","aria-hidden":"true"},L("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${e}px`,width:"100%",marginBottom:"16px"}}),L("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"24px",width:"70%",marginBottom:"12px"}}),at({lines:t,variant:n}))}function Eo({rows:e=5,columns:t=4,variant:n="shimmer"}){return he(),L("div",{class:"what-skeleton-table","aria-hidden":"true"},L("div",{style:{display:"flex",gap:"16px",marginBottom:"16px"}},Array.from({length:t},(r,s)=>L("div",{key:s,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"20px",flex:1}}))),Array.from({length:e},(r,s)=>L("div",{key:s,style:{display:"flex",gap:"16px",marginBottom:s<e-1?"12px":void 0}},Array.from({length:t},(o,i)=>L("div",{key:i,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"16px",flex:1}})))))}function ko({type:e="default",height:t,children:n}){return he(),e==="card"?on({}):e==="text"?at({}):n||L("div",{class:"what-skeleton what-island-skeleton",style:{height:typeof t=="number"?`${t}px`:t||"100px",width:"100%"},"aria-hidden":"true"})}function vo(e,t=[]){let n=y(!0),r=y(null),s=y(null);return N(()=>{n.set(!0),s.set(null),Promise.resolve(e()).then(o=>{r.set(o),n.set(!1)}).catch(o=>{s.set(o),n.set(!1)})}),{isLoading:()=>n(),data:()=>r(),error:()=>s(),Skeleton:o=>n()?ct(o):null}}function So({width:e="100%",height:t=100,label:n="Loading...",showLabel:r=!1,variant:s="shimmer"}){return he(),L("div",{class:`what-skeleton ${s==="pulse"?"what-skeleton-pulse":""}`,style:{width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,display:"flex",alignItems:"center",justifyContent:"center"},"aria-label":n,role:"status"},r&&L("span",{style:{color:"var(--skeleton-text, #999)",fontSize:"14px"}},n))}function Ao({size:e=8,color:t="#666"}){he();let n={width:`${e}px`,height:`${e}px`,borderRadius:"50%",backgroundColor:t,animation:"what-skeleton-pulse 1s infinite ease-in-out"};return L("div",{class:"what-loading-dots",style:{display:"flex",gap:`${e/2}px`},"aria-label":"Loading",role:"status"},L("div",{style:{...n,animationDelay:"0s"}}),L("div",{style:{...n,animationDelay:"0.2s"}}),L("div",{style:{...n,animationDelay:"0.4s"}}))}function To({size:e=24,color:t="#666",strokeWidth:n=2}){return L("svg",{width:e,height:e,viewBox:"0 0 24 24",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading",role:"status"},L("style",null,"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"),L("circle",{cx:12,cy:12,r:10,stroke:t,strokeWidth:n,fill:"none",strokeDasharray:"31.4 31.4",strokeLinecap:"round"}))}var K=new Map,ue=new Map,fe=new Map,ee=new Map,sn=200;function qe(e){return ee.set(e,Date.now()),K.has(e)||(K.set(e,y(null)),K.size>sn&&Mo()),K.get(e)}function cn(e){return ue.has(e)||ue.set(e,y(null)),ue.get(e)}function Lo(e){return fe.has(e)||fe.set(e,y(!1)),fe.get(e)}function Mo(){let e=[...ee.entries()].sort((n,r)=>n[1]-r[1]),t=Math.floor(sn*.2);for(let n=0;n<t&&n<e.length;n++){let r=e[n][0];re.has(r)&&re.get(r).size>0||(K.delete(r),ue.delete(r),fe.delete(r),ee.delete(r),Le.delete(r))}}var re=new Map;function an(e,t){return re.has(e)||re.set(e,new Set),re.get(e).add(t),()=>{let n=re.get(e);n&&(n.delete(t),n.size===0&&re.delete(e))}}var ge=new Map,Le=new Map;function oe(e){let t=G?.(),n=N(e);return t&&t.effects.push(n),n}function No(e,t={}){let{method:n="GET",body:r,headers:s={},transform:o=h=>h,initialData:i=null}=t,c=y(i),a=y(null),l=y(!0),u=null;async function f(){u&&u.abort(),u=new AbortController;let{signal:h}=u;l.set(!0),a.set(null);try{let x=await fetch(e,{method:n,headers:{"Content-Type":"application/json",...s},body:r?JSON.stringify(r):void 0,signal:h});if(!x.ok)throw new Error(`HTTP ${x.status}: ${x.statusText}`);let m=await x.json();h.aborted||c.set(o(m))}catch(x){h.aborted||a.set(x)}finally{h.aborted||l.set(!1)}}return oe(()=>(f(),()=>{u&&u.abort()})),{data:()=>c(),error:()=>a(),isLoading:()=>l(),refetch:f,mutate:h=>c.set(h)}}function Io(e,t,n={}){let{revalidateOnFocus:r=!0,revalidateOnReconnect:s=!0,refreshInterval:o=0,dedupingInterval:i=2e3,fallbackData:c,onSuccess:a,onError:l,suspense:u=!1}=n;if(e==null||e===!1){let b=y(c||null),S=y(null);return{data:()=>b(),error:()=>S(),isLoading:()=>!1,isValidating:()=>!1,mutate:T=>b.set(typeof T=="function"?T(b()):T),revalidate:()=>Promise.resolve()}}let f=qe(e),h=cn(e),x=Lo(e),m=W(()=>f()??c??null),w=W(()=>f()==null&&x()),k=null;async function g(){let b=Date.now();if(ge.has(e)){let v=ge.get(e);if(b-v.timestamp<i)return v.refCount++,v.promise}let S=Le.get(e);if(S&&b-S<i&&f.peek()!=null)return f.peek();if(k){let v=ge.get(e);(!v||v.refCount<=1)&&k.abort()}k=new AbortController;let{signal:T}=k;x.set(!0);let E=t(e,{signal:T});ge.set(e,{promise:E,timestamp:b,refCount:1});try{let v=await E;return T.aborted?void 0:(H(()=>{f.set(v),h.set(null)}),ee.set(e,Date.now()),Le.set(e,Date.now()),a&&a(v,e),v)}catch(v){if(T.aborted)return;throw h.set(v),l&&l(v,e),v}finally{T.aborted||x.set(!1);let v=ge.get(e);v&&(v.refCount--,v.refCount<=0&&ge.delete(e))}}let d=an(e,()=>g().catch(()=>{}));return oe(()=>(g().catch(()=>{}),()=>{k&&k.abort(),d()})),r&&typeof window<"u"&&oe(()=>{let b=()=>{document.visibilityState==="visible"&&g().catch(()=>{})};return document.addEventListener("visibilitychange",b),()=>document.removeEventListener("visibilitychange",b)}),s&&typeof window<"u"&&oe(()=>{let b=()=>g().catch(()=>{});return window.addEventListener("online",b),()=>window.removeEventListener("online",b)}),o>0&&oe(()=>{let b=setInterval(()=>{g().catch(()=>{})},o);return()=>clearInterval(b)}),{data:()=>m(),error:()=>h(),isLoading:()=>w(),isValidating:()=>x(),mutate:(b,S=!0)=>{let T=typeof b=="function"?b(f.peek()):b;f.set(T),ee.set(e,Date.now()),S&&g().catch(()=>{})},revalidate:g}}function Ro(e){let{queryKey:t,queryFn:n,enabled:r=!0,staleTime:s=0,cacheTime:o=300*1e3,refetchOnWindowFocus:i=!0,refetchInterval:c=!1,retry:a=3,retryDelay:l=M=>Math.min(1e3*2**M,3e4),onSuccess:u,onError:f,onSettled:h,select:x,placeholderData:m}=e,w=Array.isArray(t)?t.join(":"):t,k=qe(w),g=W(()=>{let M=k();return x&&M!==null?x(M):M}),d=cn(w),b=y(k.peek()!=null?"success":"loading"),S=y("idle"),T=0,E=null;async function v(){if(!r)return;let M=Date.now();if(k.peek()!=null&&M-T<s)return k.peek();E&&E.abort(),E=new AbortController;let{signal:p}=E;S.set("fetching"),k.peek()==null&&b.set("loading");let C=0;async function I(){try{let $=await n({queryKey:Array.isArray(t)?t:[t],signal:p});return p.aborted?void 0:(H(()=>{k.set($),d.set(null),b.set("success"),S.set("idle")}),T=Date.now(),ee.set(w,Date.now()),u&&u($),h&&h($,null),setTimeout(()=>{if(Date.now()-T>=o){let D=re.get(w);(!D||D.size===0)&&(K.delete(w),ue.delete(w),fe.delete(w),ee.delete(w),Le.delete(w))}},o),$)}catch($){if(p.aborted)return;if(C++,C<a)return await new Promise((D,U)=>{let Q=setTimeout(D,l(C));p.addEventListener("abort",()=>{clearTimeout(Q),U(new DOMException("Aborted","AbortError"))},{once:!0})}).catch(D=>{if(D.name!=="AbortError")throw D}),p.aborted?void 0:I();throw H(()=>{d.set($),b.set("error"),S.set("idle")}),f&&f($),h&&h(null,$),$}}return I()}let F=an(w,()=>v().catch(()=>{}));return oe(()=>(r&&v().catch(()=>{}),()=>{E&&E.abort(),F()})),i&&typeof window<"u"&&oe(()=>{let M=()=>{document.visibilityState==="visible"&&v().catch(()=>{})};return document.addEventListener("visibilitychange",M),()=>document.removeEventListener("visibilitychange",M)}),c&&oe(()=>{let M=setInterval(()=>{v().catch(()=>{})},c);return()=>clearInterval(M)}),{data:()=>g()??m,error:()=>d(),status:()=>b(),fetchStatus:()=>S(),isLoading:()=>b()==="loading",isError:()=>b()==="error",isSuccess:()=>b()==="success",isFetching:()=>S()==="fetching",refetch:v}}function Do(e){let{queryKey:t,queryFn:n,getNextPageParam:r,getPreviousPageParam:s,initialPageParam:o,...i}=e,c=y([]),a=y([o]),l=y(!0),u=y(!1),f=y(!1),h=y(!1),x=Array.isArray(t)?t.join(":"):t,m=null,w=!1;async function k(g,d="next"){m&&m.abort(),m=new AbortController;let{signal:b}=m,S=d==="next"?f:h;S.set(!0);try{let T=await n({queryKey:Array.isArray(t)?t:[t],pageParam:g,signal:b});return b.aborted?void 0:(H(()=>{w?(c.set([T]),a.set([g]),w=!1):d==="next"?(c.set([...c.peek(),T]),a.set([...a.peek(),g])):(c.set([T,...c.peek()]),a.set([g,...a.peek()]));let E=r?.(T,c.peek());if(l.set(E!==void 0),s){let v=s(T,c.peek());u.set(v!==void 0)}}),T)}finally{b.aborted||S.set(!1)}}return oe(()=>(k(o).catch(()=>{}),()=>{m&&m.abort()})),{data:()=>({pages:c(),pageParams:a()}),hasNextPage:()=>l(),hasPreviousPage:()=>u(),isFetchingNextPage:()=>f(),isFetchingPreviousPage:()=>h(),fetchNextPage:async()=>{let g=c.peek()[c.peek().length-1],d=r?.(g,c.peek());if(d!==void 0)return k(d,"next")},fetchPreviousPage:async()=>{let g=c.peek()[0],d=s?.(g,c.peek());if(d!==void 0)return k(d,"previous")},refetch:async()=>(w=!0,k(o))}}function Oo(e,t={}){let{hard:n=!1}=t,r=[];if(typeof e=="function")for(let[s]of K)e(s)&&r.push(s);else r.push(e);for(let s of r){n&&K.has(s)&&K.get(s).set(null);let o=re.get(s);if(o)for(let i of o)i()}}function Po(e,t){let n=qe(e);return t(e).then(r=>(n.set(r),ee.set(e,Date.now()),r))}function $o(e,t){let n=qe(e),r=n.peek();n.set(typeof t=="function"?t(r):t),ee.set(e,Date.now())}function Fo(e){return K.has(e)?K.get(e).peek():void 0}function jo(){K.clear(),ue.clear(),fe.clear(),ee.clear(),Le.clear(),ge.clear()}function Bo(){let e=[];for(let[t,n]of K)e.push({key:t,data:n.peek(),error:ue.has(t)?ue.get(t).peek():null,isValidating:fe.has(t)?fe.get(t).peek():!1});return e}function Ho(e={}){let t=G?.();if(t){let n=t.hookIndex++;return t.hooks[n]||(t.hooks[n]=ln(e)),t.hooks[n]}return ln(e)}function ln(e={}){let{defaultValues:t={},mode:n="onSubmit",reValidateMode:r="onChange",resolver:s}=e,o={},i={},c={},a=y({});function l(_){return o[_]||(o[_]=y(t[_]??"")),o[_]}function u(_){return i[_]||(i[_]=y(null)),i[_]}function f(_){return c[_]||(c[_]=y(!1)),c[_]}let h=y(!1),x=y(!1),m=y(!1),w=y(!1),k=y(0);function g(_=!1){let R={...t};for(let[O,j]of Object.entries(o))R[O]=_?j():j.peek();return R}function d(_=!1){return _?a():a.peek()}function b(_,R){let O=R??null;u(_).set(O),a.set(j=>{if(j[_]===O)return j;if(O==null){if(!Object.prototype.hasOwnProperty.call(j,_))return j;let se={...j};return delete se[_],se}return{...j,[_]:O}})}function S(_={}){let R=_||{};H(()=>{for(let[O,j]of Object.entries(i))Object.prototype.hasOwnProperty.call(R,O)||j.set(null);for(let[O,j]of Object.entries(R))u(O).set(j??null);a.set({...R})})}let T=W(()=>Object.keys(d(!0)).length===0),E=W(()=>{let _={};for(let[R,O]of Object.entries(o))O()!==(t[R]??"")&&(_[R]=!0);return _});async function v(_){if(!s)return!0;w.set(!0);try{let O=(await s(g(!1)))?.errors||{};if(_){let j=O[_]??null;return b(_,j),!j}else return S(O),Object.keys(O).length===0}finally{w.set(!1)}}function F(_,R={}){let O=l(_),j=R.type==="checkbox"||R.type==="radio",Ce=Ie=>{let mn=Ie.target.type==="checkbox"||Ie.target.type==="radio"?Ie.target.checked:Ie.target.value;M(_,mn),(n==="onChange"||m.peek()&&r==="onChange")&&v(_)},se={name:_,onBlur:()=>{f(_).set(!0),(n==="onBlur"||m.peek()&&r==="onBlur")&&v(_)},onFocus:()=>{},ref:R.ref};return j?(Object.defineProperty(se,"checked",{get(){return!!O()},enumerable:!0}),se.onchange=Ce):(Object.defineProperty(se,"value",{get(){return O()},enumerable:!0}),se.oninput=Ce),se}function M(_,R,O={}){let{shouldValidate:j=!1,shouldDirty:Ce=!0}=O;l(_).set(R),Ce&&h.set(!0),j&&v(_)}function p(_){return l(_)()}function C(_,R){b(_,R)}function I(_){b(_,null)}function $(){S({})}function D(_=t){H(()=>{for(let[R,O]of Object.entries(o))O.set(_[R]??"");for(let R of Object.values(i))R.set(null);a.set({});for(let R of Object.values(c))R.set(!1);h.set(!1),m.set(!1)})}function U(_,R){return async O=>{O&&O.preventDefault(),x.set(!0),m.set(!0),k.set(k.peek()+1),await v()?await _(g()):R&&R(d(!1)),x.set(!1)}}function Q(_){return _?W(()=>l(_)()):W(()=>g(!0))}return{register:F,handleSubmit:U,setValue:M,getValue:p,setError:C,clearError:I,clearErrors:$,reset:D,watch:Q,validate:v,formState:{get values(){return g(!0)},get errors(){return d(!0)},error:_=>u(_)(),get touched(){let _={};for(let[R,O]of Object.entries(c))O()&&(_[R]=!0);return _},isDirty:()=>h(),isValid:T,isValidating:()=>w(),isSubmitting:()=>x(),isSubmitted:()=>m(),submitCount:()=>k(),dirtyFields:E}}}function Vo(e){return async t=>{try{return{values:await e.parseAsync(t),errors:{}}}catch(n){let r={};for(let s of n.errors||[]){let o=s.path.join(".");r[o]||(r[o]={type:s.code,message:s.message})}return{values:{},errors:r}}}}function qo(e){return async t=>{try{return{values:await e.validate(t,{abortEarly:!1}),errors:{}}}catch(n){let r={};for(let s of n.inner||[])r[s.path]||(r[s.path]={type:s.type,message:s.message});return{values:{},errors:r}}}}function Wo(e){return async t=>{let n={};for(let[r,s]of Object.entries(e)){let o=t[r];for(let i of s){let c=i(o,t);if(c){n[r]={type:"validation",message:c};break}}}return{values:t,errors:n}}}var Go={required:(e="This field is required")=>t=>{if(t==null||t==="")return e},minLength:(e,t)=>n=>{if(typeof n=="string"&&n.length<e)return t||`Must be at least ${e} characters`},maxLength:(e,t)=>n=>{if(typeof n=="string"&&n.length>e)return t||`Must be at most ${e} characters`},min:(e,t)=>n=>{if(typeof n=="number"&&n<e)return t||`Must be at least ${e}`},max:(e,t)=>n=>{if(typeof n=="number"&&n>e)return t||`Must be at most ${e}`},pattern:(e,t="Invalid format")=>n=>{if(typeof n=="string"&&!e.test(n))return t},email:(e="Invalid email address")=>t=>{if(typeof t=="string"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return e},url:(e="Invalid URL")=>t=>{try{typeof t=="string"&&t&&new URL(t)}catch{return e}},match:(e,t)=>(n,r)=>{if(n!==r[e])return t||`Must match ${e}`},custom:e=>e};function zo(e,t={}){let{validate:n,defaultValue:r=""}=t,s=y(r),o=y(null),i=y(!1),c=y(!1);async function a(){if(!n)return!0;let l=await n(s.peek());return o.set(l||null),!l}return{name:e,value:()=>s(),error:()=>o(),isTouched:()=>i(),isDirty:()=>c(),setValue:l=>{s.set(l),c.set(!0)},setError:l=>o.set(l),validate:a,reset:()=>{s.set(r),o.set(null),i.set(!1),c.set(!1)},inputProps:()=>({name:e,value:s(),onInput:l=>{s.set(l.target.value),c.set(!0)},onBlur:()=>{i.set(!0),a()}})}}function Uo(e){let{register:t,error:n,...r}=e,s=t?t(e.name):{};return L("input",{...r,...s,"aria-invalid":n?"true":void 0})}function Xo(e){let{register:t,error:n,...r}=e,s=t?t(e.name):{};return L("textarea",{...r,...s,"aria-invalid":n?"true":void 0})}function Yo(e){let{register:t,error:n,children:r,...s}=e,o=t?t(e.name):{};return L("select",{...s,...o,"aria-invalid":n?"true":void 0},r)}function Ko(e){let{register:t,...n}=e,r=t?t(e.name):{};return L("input",{type:"checkbox",...n,...r,checked:r.value})}function Qo(e){let{register:t,value:n,...r}=e,s=t?t(e.name):{};return L("input",{type:"radio",value:n,...r,checked:s.value===n,onChange:o=>{o.target.checked&&s.onInput&&s.onInput({target:{value:n}})}})}function Jo({name:e,formState:t,errors:n,render:r}){let s=t&&typeof t.error=="function"?t.error(e):(t?.errors!=null?t.errors:typeof n=="function"?n():n)?.[e]||null;return s?r?r({message:s.message,type:s.type}):L("span",{class:"what-error",role:"alert"},s.message):null}var fn={INFINITE_EFFECT:{code:"ERR_INFINITE_EFFECT",severity:"error",template:'Effect "{{effectName}}" exceeded 25 flush iterations \u2014 likely an infinite loop.',suggestion:"An effect is writing to a signal it also reads, creating a cycle. Use untrack() to read the signal without subscribing, or restructure so the write and read are in separate effects.",codeExample:`// Bad \u2014 reads and writes count, creating a cycle:
|
|
63
|
+
`,on=!1;function he(){if(on||typeof document>"u")return;on=!0;let e=document.createElement("style");e.textContent=ko,document.head.appendChild(e)}function at({width:e,height:t,variant:n="shimmer",circle:r=!1,class:s,style:o,count:i=1}){he();let c=`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""} ${n==="wave"?"what-skeleton-wave":""}`,a=s?`${c} ${s}`:c,l={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,borderRadius:r?"50%":void 0,...o};return i===1?L("div",{class:a,style:l,"aria-hidden":"true"}):Array.from({length:i},(u,f)=>L("div",{key:f,class:a,style:{...l,marginBottom:f<i-1?"8px":void 0},"aria-hidden":"true"}))}function lt({lines:e=3,lastLineWidth:t="60%",lineHeight:n=16,gap:r=8,variant:s="shimmer"}){return he(),L("div",{class:"what-skeleton-text","aria-hidden":"true"},Array.from({length:e},(o,i)=>L("div",{key:i,class:`what-skeleton ${s==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${n}px`,width:i===e-1?t:"100%",marginBottom:i<e-1?`${r}px`:void 0}})))}function Eo({size:e=40,variant:t="shimmer"}){return at({width:e,height:e,circle:!0,variant:t})}function sn({imageHeight:e=200,lines:t=3,variant:n="shimmer"}){return he(),L("div",{class:"what-skeleton-card","aria-hidden":"true"},L("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${e}px`,width:"100%",marginBottom:"16px"}}),L("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"24px",width:"70%",marginBottom:"12px"}}),lt({lines:t,variant:n}))}function vo({rows:e=5,columns:t=4,variant:n="shimmer"}){return he(),L("div",{class:"what-skeleton-table","aria-hidden":"true"},L("div",{style:{display:"flex",gap:"16px",marginBottom:"16px"}},Array.from({length:t},(r,s)=>L("div",{key:s,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"20px",flex:1}}))),Array.from({length:e},(r,s)=>L("div",{key:s,style:{display:"flex",gap:"16px",marginBottom:s<e-1?"12px":void 0}},Array.from({length:t},(o,i)=>L("div",{key:i,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"16px",flex:1}})))))}function So({type:e="default",height:t,children:n}){return he(),e==="card"?sn({}):e==="text"?lt({}):n||L("div",{class:"what-skeleton what-island-skeleton",style:{height:typeof t=="number"?`${t}px`:t||"100px",width:"100%"},"aria-hidden":"true"})}function Ao(e,t=[]){let n=y(!0),r=y(null),s=y(null);return N(()=>{n.set(!0),s.set(null),Promise.resolve(e()).then(o=>{r.set(o),n.set(!1)}).catch(o=>{s.set(o),n.set(!1)})}),{isLoading:()=>n(),data:()=>r(),error:()=>s(),Skeleton:o=>n()?at(o):null}}function To({width:e="100%",height:t=100,label:n="Loading...",showLabel:r=!1,variant:s="shimmer"}){return he(),L("div",{class:`what-skeleton ${s==="pulse"?"what-skeleton-pulse":""}`,style:{width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,display:"flex",alignItems:"center",justifyContent:"center"},"aria-label":n,role:"status"},r&&L("span",{style:{color:"var(--skeleton-text, #999)",fontSize:"14px"}},n))}function Lo({size:e=8,color:t="#666"}){he();let n={width:`${e}px`,height:`${e}px`,borderRadius:"50%",backgroundColor:t,animation:"what-skeleton-pulse 1s infinite ease-in-out"};return L("div",{class:"what-loading-dots",style:{display:"flex",gap:`${e/2}px`},"aria-label":"Loading",role:"status"},L("div",{style:{...n,animationDelay:"0s"}}),L("div",{style:{...n,animationDelay:"0.2s"}}),L("div",{style:{...n,animationDelay:"0.4s"}}))}function Mo({size:e=24,color:t="#666",strokeWidth:n=2}){return L("svg",{width:e,height:e,viewBox:"0 0 24 24",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading",role:"status"},L("style",null,"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"),L("circle",{cx:12,cy:12,r:10,stroke:t,strokeWidth:n,fill:"none",strokeDasharray:"31.4 31.4",strokeLinecap:"round"}))}var K=new Map,ue=new Map,fe=new Map,ee=new Map,cn=200;function We(e){return ee.set(e,Date.now()),K.has(e)||(K.set(e,y(null)),K.size>cn&&Io()),K.get(e)}function an(e){return ue.has(e)||ue.set(e,y(null)),ue.get(e)}function No(e){return fe.has(e)||fe.set(e,y(!1)),fe.get(e)}function Io(){let e=[...ee.entries()].sort((n,r)=>n[1]-r[1]),t=Math.floor(cn*.2);for(let n=0;n<t&&n<e.length;n++){let r=e[n][0];re.has(r)&&re.get(r).size>0||(K.delete(r),ue.delete(r),fe.delete(r),ee.delete(r),Me.delete(r))}}var re=new Map;function ln(e,t){return re.has(e)||re.set(e,new Set),re.get(e).add(t),()=>{let n=re.get(e);n&&(n.delete(t),n.size===0&&re.delete(e))}}var ge=new Map,Me=new Map;function oe(e){let t=G?.(),n=N(e);return t&&t.effects.push(n),n}function Ro(e,t={}){let{method:n="GET",body:r,headers:s={},transform:o=h=>h,initialData:i=null}=t,c=y(i),a=y(null),l=y(!0),u=null;async function f(){u&&u.abort(),u=new AbortController;let{signal:h}=u;l.set(!0),a.set(null);try{let x=await fetch(e,{method:n,headers:{"Content-Type":"application/json",...s},body:r?JSON.stringify(r):void 0,signal:h});if(!x.ok)throw new Error(`HTTP ${x.status}: ${x.statusText}`);let m=await x.json();h.aborted||c.set(o(m))}catch(x){h.aborted||a.set(x)}finally{h.aborted||l.set(!1)}}return oe(()=>(f(),()=>{u&&u.abort()})),{data:()=>c(),error:()=>a(),isLoading:()=>l(),refetch:f,mutate:h=>c.set(h)}}function Do(e,t,n={}){let{revalidateOnFocus:r=!0,revalidateOnReconnect:s=!0,refreshInterval:o=0,dedupingInterval:i=2e3,fallbackData:c,onSuccess:a,onError:l,suspense:u=!1}=n;if(e==null||e===!1){let b=y(c||null),S=y(null);return{data:()=>b(),error:()=>S(),isLoading:()=>!1,isValidating:()=>!1,mutate:T=>b.set(typeof T=="function"?T(b()):T),revalidate:()=>Promise.resolve()}}let f=We(e),h=an(e),x=No(e),m=W(()=>f()??c??null),w=W(()=>f()==null&&x()),E=null;async function g(){let b=Date.now();if(ge.has(e)){let v=ge.get(e);if(b-v.timestamp<i)return v.refCount++,v.promise}let S=Me.get(e);if(S&&b-S<i&&f.peek()!=null)return f.peek();if(E){let v=ge.get(e);(!v||v.refCount<=1)&&E.abort()}E=new AbortController;let{signal:T}=E;x.set(!0);let k=t(e,{signal:T});ge.set(e,{promise:k,timestamp:b,refCount:1});try{let v=await k;return T.aborted?void 0:(H(()=>{f.set(v),h.set(null)}),ee.set(e,Date.now()),Me.set(e,Date.now()),a&&a(v,e),v)}catch(v){if(T.aborted)return;throw h.set(v),l&&l(v,e),v}finally{T.aborted||x.set(!1);let v=ge.get(e);v&&(v.refCount--,v.refCount<=0&&ge.delete(e))}}let d=ln(e,()=>g().catch(()=>{}));return oe(()=>(g().catch(()=>{}),()=>{E&&E.abort(),d()})),r&&typeof window<"u"&&oe(()=>{let b=()=>{document.visibilityState==="visible"&&g().catch(()=>{})};return document.addEventListener("visibilitychange",b),()=>document.removeEventListener("visibilitychange",b)}),s&&typeof window<"u"&&oe(()=>{let b=()=>g().catch(()=>{});return window.addEventListener("online",b),()=>window.removeEventListener("online",b)}),o>0&&oe(()=>{let b=setInterval(()=>{g().catch(()=>{})},o);return()=>clearInterval(b)}),{data:()=>m(),error:()=>h(),isLoading:()=>w(),isValidating:()=>x(),mutate:(b,S=!0)=>{let T=typeof b=="function"?b(f.peek()):b;f.set(T),ee.set(e,Date.now()),S&&g().catch(()=>{})},revalidate:g}}function Oo(e){let{queryKey:t,queryFn:n,enabled:r=!0,staleTime:s=0,cacheTime:o=300*1e3,refetchOnWindowFocus:i=!0,refetchInterval:c=!1,retry:a=3,retryDelay:l=M=>Math.min(1e3*2**M,3e4),onSuccess:u,onError:f,onSettled:h,select:x,placeholderData:m}=e,w=Array.isArray(t)?t.join(":"):t,E=We(w),g=W(()=>{let M=E();return x&&M!==null?x(M):M}),d=an(w),b=y(E.peek()!=null?"success":"loading"),S=y("idle"),T=0,k=null;async function v(){if(!r)return;let M=Date.now();if(E.peek()!=null&&M-T<s)return E.peek();k&&k.abort(),k=new AbortController;let{signal:p}=k;S.set("fetching"),E.peek()==null&&b.set("loading");let C=0;async function I(){try{let $=await n({queryKey:Array.isArray(t)?t:[t],signal:p});return p.aborted?void 0:(H(()=>{E.set($),d.set(null),b.set("success"),S.set("idle")}),T=Date.now(),ee.set(w,Date.now()),u&&u($),h&&h($,null),setTimeout(()=>{if(Date.now()-T>=o){let D=re.get(w);(!D||D.size===0)&&(K.delete(w),ue.delete(w),fe.delete(w),ee.delete(w),Me.delete(w))}},o),$)}catch($){if(p.aborted)return;if(C++,C<a)return await new Promise((D,U)=>{let Q=setTimeout(D,l(C));p.addEventListener("abort",()=>{clearTimeout(Q),U(new DOMException("Aborted","AbortError"))},{once:!0})}).catch(D=>{if(D.name!=="AbortError")throw D}),p.aborted?void 0:I();throw H(()=>{d.set($),b.set("error"),S.set("idle")}),f&&f($),h&&h(null,$),$}}return I()}let F=ln(w,()=>v().catch(()=>{}));return oe(()=>(r&&v().catch(()=>{}),()=>{k&&k.abort(),F()})),i&&typeof window<"u"&&oe(()=>{let M=()=>{document.visibilityState==="visible"&&v().catch(()=>{})};return document.addEventListener("visibilitychange",M),()=>document.removeEventListener("visibilitychange",M)}),c&&oe(()=>{let M=setInterval(()=>{v().catch(()=>{})},c);return()=>clearInterval(M)}),{data:()=>g()??m,error:()=>d(),status:()=>b(),fetchStatus:()=>S(),isLoading:()=>b()==="loading",isError:()=>b()==="error",isSuccess:()=>b()==="success",isFetching:()=>S()==="fetching",refetch:v}}function Po(e){let{queryKey:t,queryFn:n,getNextPageParam:r,getPreviousPageParam:s,initialPageParam:o,...i}=e,c=y([]),a=y([o]),l=y(!0),u=y(!1),f=y(!1),h=y(!1),x=Array.isArray(t)?t.join(":"):t,m=null,w=!1;async function E(g,d="next"){m&&m.abort(),m=new AbortController;let{signal:b}=m,S=d==="next"?f:h;S.set(!0);try{let T=await n({queryKey:Array.isArray(t)?t:[t],pageParam:g,signal:b});return b.aborted?void 0:(H(()=>{w?(c.set([T]),a.set([g]),w=!1):d==="next"?(c.set([...c.peek(),T]),a.set([...a.peek(),g])):(c.set([T,...c.peek()]),a.set([g,...a.peek()]));let k=r?.(T,c.peek());if(l.set(k!==void 0),s){let v=s(T,c.peek());u.set(v!==void 0)}}),T)}finally{b.aborted||S.set(!1)}}return oe(()=>(E(o).catch(()=>{}),()=>{m&&m.abort()})),{data:()=>({pages:c(),pageParams:a()}),hasNextPage:()=>l(),hasPreviousPage:()=>u(),isFetchingNextPage:()=>f(),isFetchingPreviousPage:()=>h(),fetchNextPage:async()=>{let g=c.peek()[c.peek().length-1],d=r?.(g,c.peek());if(d!==void 0)return E(d,"next")},fetchPreviousPage:async()=>{let g=c.peek()[0],d=s?.(g,c.peek());if(d!==void 0)return E(d,"previous")},refetch:async()=>(w=!0,E(o))}}function $o(e,t={}){let{hard:n=!1}=t,r=[];if(typeof e=="function")for(let[s]of K)e(s)&&r.push(s);else r.push(e);for(let s of r){n&&K.has(s)&&K.get(s).set(null);let o=re.get(s);if(o)for(let i of o)i()}}function Fo(e,t){let n=We(e);return t(e).then(r=>(n.set(r),ee.set(e,Date.now()),r))}function jo(e,t){let n=We(e),r=n.peek();n.set(typeof t=="function"?t(r):t),ee.set(e,Date.now())}function Bo(e){return K.has(e)?K.get(e).peek():void 0}function Ho(){K.clear(),ue.clear(),fe.clear(),ee.clear(),Me.clear(),ge.clear()}function Vo(){let e=[];for(let[t,n]of K)e.push({key:t,data:n.peek(),error:ue.has(t)?ue.get(t).peek():null,isValidating:fe.has(t)?fe.get(t).peek():!1});return e}function qo(e={}){let t=G?.();if(t){let n=t.hookIndex++;return t.hooks[n]||(t.hooks[n]=un(e)),t.hooks[n]}return un(e)}function un(e={}){let{defaultValues:t={},mode:n="onSubmit",reValidateMode:r="onChange",resolver:s}=e,o={},i={},c={},a=y({});function l(_){return o[_]||(o[_]=y(t[_]??"")),o[_]}function u(_){return i[_]||(i[_]=y(null)),i[_]}function f(_){return c[_]||(c[_]=y(!1)),c[_]}let h=y(!1),x=y(!1),m=y(!1),w=y(!1),E=y(0);function g(_=!1){let R={...t};for(let[O,j]of Object.entries(o))R[O]=_?j():j.peek();return R}function d(_=!1){return _?a():a.peek()}function b(_,R){let O=R??null;u(_).set(O),a.set(j=>{if(j[_]===O)return j;if(O==null){if(!Object.prototype.hasOwnProperty.call(j,_))return j;let se={...j};return delete se[_],se}return{...j,[_]:O}})}function S(_={}){let R=_||{};H(()=>{for(let[O,j]of Object.entries(i))Object.prototype.hasOwnProperty.call(R,O)||j.set(null);for(let[O,j]of Object.entries(R))u(O).set(j??null);a.set({...R})})}let T=W(()=>Object.keys(d(!0)).length===0),k=W(()=>{let _={};for(let[R,O]of Object.entries(o))O()!==(t[R]??"")&&(_[R]=!0);return _});async function v(_){if(!s)return!0;w.set(!0);try{let O=(await s(g(!1)))?.errors||{};if(_){let j=O[_]??null;return b(_,j),!j}else return S(O),Object.keys(O).length===0}finally{w.set(!1)}}function F(_,R={}){let O=l(_),j=R.type==="checkbox"||R.type==="radio",Ce=Re=>{let yn=Re.target.type==="checkbox"||Re.target.type==="radio"?Re.target.checked:Re.target.value;M(_,yn),(n==="onChange"||m.peek()&&r==="onChange")&&v(_)},se={name:_,onBlur:()=>{f(_).set(!0),(n==="onBlur"||m.peek()&&r==="onBlur")&&v(_)},onFocus:()=>{},ref:R.ref};return j?(Object.defineProperty(se,"checked",{get(){return!!O()},enumerable:!0}),se.onchange=Ce):(Object.defineProperty(se,"value",{get(){return O()},enumerable:!0}),se.oninput=Ce),se}function M(_,R,O={}){let{shouldValidate:j=!1,shouldDirty:Ce=!0}=O;l(_).set(R),Ce&&h.set(!0),j&&v(_)}function p(_){return l(_)()}function C(_,R){b(_,R)}function I(_){b(_,null)}function $(){S({})}function D(_=t){H(()=>{for(let[R,O]of Object.entries(o))O.set(_[R]??"");for(let R of Object.values(i))R.set(null);a.set({});for(let R of Object.values(c))R.set(!1);h.set(!1),m.set(!1)})}function U(_,R){return async O=>{O&&O.preventDefault(),x.set(!0),m.set(!0),E.set(E.peek()+1),await v()?await _(g()):R&&R(d(!1)),x.set(!1)}}function Q(_){return _?W(()=>l(_)()):W(()=>g(!0))}return{register:F,handleSubmit:U,setValue:M,getValue:p,setError:C,clearError:I,clearErrors:$,reset:D,watch:Q,validate:v,formState:{get values(){return g(!0)},get errors(){return d(!0)},error:_=>u(_)(),get touched(){let _={};for(let[R,O]of Object.entries(c))O()&&(_[R]=!0);return _},isDirty:()=>h(),isValid:T,isValidating:()=>w(),isSubmitting:()=>x(),isSubmitted:()=>m(),submitCount:()=>E(),dirtyFields:k}}}function Wo(e){return async t=>{try{return{values:await e.parseAsync(t),errors:{}}}catch(n){let r={};for(let s of n.errors||[]){let o=s.path.join(".");r[o]||(r[o]={type:s.code,message:s.message})}return{values:{},errors:r}}}}function Go(e){return async t=>{try{return{values:await e.validate(t,{abortEarly:!1}),errors:{}}}catch(n){let r={};for(let s of n.inner||[])r[s.path]||(r[s.path]={type:s.type,message:s.message});return{values:{},errors:r}}}}function zo(e){return async t=>{let n={};for(let[r,s]of Object.entries(e)){let o=t[r];for(let i of s){let c=i(o,t);if(c){n[r]={type:"validation",message:c};break}}}return{values:t,errors:n}}}var Uo={required:(e="This field is required")=>t=>{if(t==null||t==="")return e},minLength:(e,t)=>n=>{if(typeof n=="string"&&n.length<e)return t||`Must be at least ${e} characters`},maxLength:(e,t)=>n=>{if(typeof n=="string"&&n.length>e)return t||`Must be at most ${e} characters`},min:(e,t)=>n=>{if(typeof n=="number"&&n<e)return t||`Must be at least ${e}`},max:(e,t)=>n=>{if(typeof n=="number"&&n>e)return t||`Must be at most ${e}`},pattern:(e,t="Invalid format")=>n=>{if(typeof n=="string"&&!e.test(n))return t},email:(e="Invalid email address")=>t=>{if(typeof t=="string"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return e},url:(e="Invalid URL")=>t=>{try{typeof t=="string"&&t&&new URL(t)}catch{return e}},match:(e,t)=>(n,r)=>{if(n!==r[e])return t||`Must match ${e}`},custom:e=>e};function Xo(e,t={}){let{validate:n,defaultValue:r=""}=t,s=y(r),o=y(null),i=y(!1),c=y(!1);async function a(){if(!n)return!0;let l=await n(s.peek());return o.set(l||null),!l}return{name:e,value:()=>s(),error:()=>o(),isTouched:()=>i(),isDirty:()=>c(),setValue:l=>{s.set(l),c.set(!0)},setError:l=>o.set(l),validate:a,reset:()=>{s.set(r),o.set(null),i.set(!1),c.set(!1)},inputProps:()=>({name:e,value:s(),onInput:l=>{s.set(l.target.value),c.set(!0)},onBlur:()=>{i.set(!0),a()}})}}function Yo(e){let{register:t,error:n,...r}=e,s=t?t(e.name):{};return L("input",{...r,...s,"aria-invalid":n?"true":void 0})}function Ko(e){let{register:t,error:n,...r}=e,s=t?t(e.name):{};return L("textarea",{...r,...s,"aria-invalid":n?"true":void 0})}function Qo(e){let{register:t,error:n,children:r,...s}=e,o=t?t(e.name):{};return L("select",{...s,...o,"aria-invalid":n?"true":void 0},r)}function Jo(e){let{register:t,...n}=e,r=t?t(e.name):{};return L("input",{type:"checkbox",...n,...r,checked:r.value})}function Zo(e){let{register:t,value:n,...r}=e,s=t?t(e.name):{};return L("input",{type:"radio",value:n,...r,checked:s.value===n,onChange:o=>{o.target.checked&&s.onInput&&s.onInput({target:{value:n}})}})}function es({name:e,formState:t,errors:n,render:r}){let s=t&&typeof t.error=="function"?t.error(e):(t?.errors!=null?t.errors:typeof n=="function"?n():n)?.[e]||null;return s?r?r({message:s.message,type:s.type}):L("span",{class:"what-error",role:"alert"},s.message):null}var dn={INFINITE_EFFECT:{code:"ERR_INFINITE_EFFECT",severity:"error",template:'Effect "{{effectName}}" exceeded 25 flush iterations \u2014 likely an infinite loop.',suggestion:"An effect is writing to a signal it also reads, creating a cycle. Use untrack() to read the signal without subscribing, or restructure so the write and read are in separate effects.",codeExample:`// Bad \u2014 reads and writes count, creating a cycle:
|
|
64
64
|
effect(() => { count(count() + 1); });
|
|
65
65
|
|
|
66
66
|
// Good \u2014 use untrack() so the read doesn't subscribe:
|
|
@@ -117,7 +117,7 @@ html\`<div>\${sanitizedContent}</div>\``},MISSING_KEY:{code:"ERR_MISSING_KEY",se
|
|
|
117
117
|
<For each={items()}>{item => <li>{item.name}</li>}</For>
|
|
118
118
|
|
|
119
119
|
// Good \u2014 stable key:
|
|
120
|
-
<For each={items()}>{item => <li key={item.id}>{item.name}</li>}</For>`}},we=class extends Error{constructor({code:t,message:n,suggestion:r,file:s,line:o,component:i,signal:c,effect:a}){super(n),this.name="WhatError",this.code=t,this.suggestion=r,this.file=s,this.line=o,this.component=i,this.signal=c,this.effect=a}toJSON(){return{code:this.code,message:this.message,suggestion:this.suggestion,file:this.file,line:this.line,component:this.component,signal:this.signal,effect:this.effect}}};function ye(e,t={}){let n=typeof e=="string"?
|
|
121
|
-
Suggestion: ${r.suggestion}`),
|
|
122
|
-
Suggestion: ${r.suggestion}`),
|
|
120
|
+
<For each={items()}>{item => <li key={item.id}>{item.name}</li>}</For>`}},we=class extends Error{constructor({code:t,message:n,suggestion:r,file:s,line:o,component:i,signal:c,effect:a}){super(n),this.name="WhatError",this.code=t,this.suggestion=r,this.file=s,this.line=o,this.component=i,this.signal=c,this.effect=a}toJSON(){return{code:this.code,message:this.message,suggestion:this.suggestion,file:this.file,line:this.line,component:this.component,signal:this.signal,effect:this.effect}}};function ye(e,t={}){let n=typeof e=="string"?dn[e]:e;if(!n)return new we({code:"ERR_UNKNOWN",message:`Unknown error: ${e}`,suggestion:"Check the error code and try again."});let r=n.template;for(let[s,o]of Object.entries(t))r=r.replace(new RegExp(`\\{\\{${s}\\}\\}`,"g"),String(o));return r=r.replace(/\{\{[^}]+\}\}/g,"(unknown)"),new we({code:n.code,message:r,suggestion:n.suggestion,file:t.file,line:t.line,component:t.component,signal:t.signal||t.signalName,effect:t.effect||t.effectName})}var me=[],fn=200;function Ge(e){A&&(me.push({...e.toJSON(),timestamp:Date.now()}),me.length>fn&&(me=me.slice(-fn)))}function ze(e){return e?me.filter(t=>t.timestamp>e):me.slice()}function ts(){me=[]}function ns(e,t={}){let n=e?.message||String(e);return n.includes("infinite effect loop")||n.includes("25 iterations")?ye("INFINITE_EFFECT",t):n.includes("hydration")||n.includes("Hydration")?ye("HYDRATION_MISMATCH",t):n.includes("Signal.set() called inside a computed")?ye("SIGNAL_WRITE_IN_RENDER",{...t,signalName:n.match(/signal: (\w+)/)?.[1]||t.signalName}):new we({code:"ERR_RUNTIME",message:n,suggestion:"Check the stack trace and component context for more details.",...t})}var Ne={signalReadDetection:!0,effectCycleDetection:!0,componentNaming:!0,importValidation:!0};function rs(e){Object.assign(Ne,e)}function os(){return{...Ne}}function ss(e,t){if(!A||!Ne.signalReadDetection)return e;let n=e.toString;return e.toString=function(){let r=ye("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${r.message}
|
|
121
|
+
Suggestion: ${r.suggestion}`),Ge(r),String(e())},e.valueOf=function(){let r=ye("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${r.message}
|
|
122
|
+
Suggestion: ${r.suggestion}`),Ge(r),e()},e}function is(e){if(!A||!Ne.componentNaming||!e||/^[A-Z]/.test(e))return null;let t=`Component "${e}" should use PascalCase (e.g., "${cs(e)}"). PascalCase distinguishes components from HTML elements in JSX and is required by the What Framework compiler.`;return console.warn(`[what] ${t}`),{code:"WARN_COMPONENT_NAMING",name:e,suggestion:t}}function cs(e){return e.charAt(0).toUpperCase()+e.slice(1)}var pn=new Set(["signal","computed","effect","signalMemo","batch","untrack","flushSync","createRoot","getOwner","runWithOwner","onRootCleanup","__setDevToolsHooks","template","_template","svgTemplate","insert","mapArray","spread","setProp","delegateEvents","on","classList","hydrate","isHydrating","_$createComponent","h","Fragment","html","mount","useState","useSignal","useComputed","useEffect","useMemo","useCallback","useRef","useContext","useReducer","createContext","onMount","onCleanup","createResource","memo","lazy","Suspense","ErrorBoundary","Show","For","Switch","Match","Island","createStore","derived","storeComputed","atom","Head","clearHead","each","cls","style","debounce","throttle","useMediaQuery","useLocalStorage","useClickOutside","Portal","transition","scheduleRead","scheduleWrite","flushScheduler","measure","mutate","useScheduledEffect","nextFrame","raf","onResize","onIntersect","smoothScrollTo","_setTextInsertHook","spring","tween","easings","useTransition","useGesture","useAnimatedValue","createTransitionClasses","cssTransition","useFocus","useFocusRestore","useFocusTrap","FocusTrap","announce","announceAssertive","SkipLink","useAriaExpanded","useAriaSelected","useAriaChecked","useRovingTabIndex","VisuallyHidden","LiveRegion","useId","useIds","useDescribedBy","useLabelledBy","Keys","onKey","onKeys","Skeleton","SkeletonText","SkeletonAvatar","SkeletonCard","SkeletonTable","IslandSkeleton","useSkeleton","Placeholder","LoadingDots","Spinner","useFetch","useSWR","useQuery","useInfiniteQuery","invalidateQueries","prefetchQuery","setQueryData","getQueryData","clearCache","__getCacheSnapshot","useForm","useField","rules","simpleResolver","zodResolver","yupResolver","Input","Textarea","Select","Checkbox","Radio","ErrorMessage"]);function as(e){if(!A||!Ne.importValidation)return[];let t=[];for(let n of e)pn.has(n)||t.push({name:n,message:`"${n}" is not a valid export from what-framework.`,suggestion:`Check the API reference. Did you mean: ${ls(n)}?`});return t}function ls(e){let t=e.toLowerCase(),n=null,r=1/0;for(let s of pn){let o=us(t,s.toLowerCase());o<r&&(r=o,n=s)}return r<=3?n:"(no close match found)"}function us(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[];for(let r=0;r<=t.length;r++)n[r]=[r];for(let r=0;r<=e.length;r++)n[0][r]=r;for(let r=1;r<=t.length;r++)for(let s=1;s<=e.length;s++){let o=t[r-1]===e[s-1]?0:1;n[r][s]=Math.min(n[r-1][s]+1,n[r][s-1]+1,n[r-1][s-1]+o)}return n[t.length][e.length]}var fs="0.6.0",Ie=[];function ds(e){A&&Ie.push(e)}function ps(e){if(!A)return;let t=Ie.indexOf(e);t>=0&&Ie.splice(t,1)}function hn(){return Ie.slice()}var _e=[];function hs(e){A&&_e.push(e)}function gs(e){if(!A)return;let t=_e.indexOf(e);t>=0&&_e.splice(t,1)}function gn(){return _e.slice()}function mn(){let e=ze(),t=e.filter(a=>Date.now()-a.timestamp<6e4),r=e.filter(a=>a.code==="ERR_INFINITE_EFFECT").length>0,s=e.filter(a=>a.code==="ERR_ORPHAN_EFFECT"),o=_e.filter(a=>!!(a._subs&&a._subs.size===0)).length,i=_e.length,c=i>1e4?"high":i>1e3?"medium":"low";return{effectCycleRisk:r,orphanEffects:s.length,signalLeaks:o,memoryPressure:c,recentErrorCount:t.length,totalSignals:i,totalComponents:Ie.length}}function ms(){A&&(typeof globalThis>"u"||(globalThis.__WHAT_AGENT__={framework:"what-framework",version:fs,mode:"development",features:["signals","effects","computed","ssr","islands","router","stores","forms","animations","a11y"],components:()=>hn().map(e=>({id:e.id,name:e.name||e.displayName||e.constructor?.name})),signals:()=>gn().map((e,t)=>({id:t,name:e._debugName||`signal_${t}`,value:typeof e=="function"?e.peek?.():void 0,subscriberCount:e._subs?e._subs.size:0})),errors:()=>ze(),health:()=>mn(),api:{reactive:["signal","computed","effect","batch","untrack","flushSync","createRoot","memo"],hooks:["useState","useSignal","useComputed","useEffect","useMemo","useCallback","useRef","useContext","onMount","onCleanup"],components:["Show","For","Switch","Match","Suspense","ErrorBoundary","lazy","Island"],data:["useSWR","useQuery","useFetch","useInfiniteQuery"],store:["createStore","derived","atom"]}}))}export{Jo as Checkbox,dn as ERROR_CODES,Dn as ErrorBoundary,es as ErrorMessage,io as FocusTrap,Pn as For,An as Fragment,Wr as Head,Yo as Input,Fn as Island,So as IslandSkeleton,wo as Keys,mo as LiveRegion,Lo as LoadingDots,et as Match,To as Placeholder,Un as Portal,Zo as Radio,Qo as Select,On as Show,at as Skeleton,Eo as SkeletonAvatar,sn as SkeletonCard,vo as SkeletonTable,lt as SkeletonText,lo as SkipLink,Mo as Spinner,Rn as Suspense,$n as Switch,Ko as Textarea,go as VisuallyHidden,we as WhatError,ar as _$createComponent,Dt as _$template,Vo as __getCacheSnapshot,xn as __setDevToolsHooks,cr as _setTextInsertHook,Ot as _template,nn as announce,ao as announceAssertive,qr as atom,H as batch,is as checkComponentName,vr as classList,ns as classifyError,Ho as clearCache,ts as clearCollectedErrors,zr as clearHead,Bn as cls,Ge as collectError,W as computed,rs as configureGuardrails,Pr as createContext,Br as createResource,En as createRoot,Vr as createStore,Jt as createTransitionClasses,ye as createWhatError,ro as cssTransition,qn as debounce,kr as delegateEvents,qt as derived,jn as each,Qt as easings,N as effect,Gt as flushScheduler,_n as flushSync,gn as getActiveSignals,ze as getCollectedErrors,os as getGuardrailConfig,mn as getHealth,hn as getMountedComponents,Cn as getOwner,Bo as getQueryData,L as h,Ln as html,Ar as hydrate,dr as insert,ms as installAgentContext,ss as installSignalReadGuardrail,$o as invalidateQueries,Sr as isHydrating,In as lazy,yr as mapArray,Ur as measure,Nn as memo,Zn as mount,Xr as mutate,Kr as nextFrame,Er as on,jr as onCleanup,Jr as onIntersect,_o as onKey,Co as onKeys,Fr as onMount,Qr as onResize,vn as onRootCleanup,Fo as prefetchQuery,Ut as raf,ds as registerComponent,hs as registerSignal,Uo as rules,kn as runWithOwner,ne as scheduleRead,ae as scheduleWrite,Se as setProp,jo as setQueryData,y as signal,wn as signalMemo,zo as simpleResolver,Zr as smoothScrollTo,Cr as spread,Yt as spring,Hr as storeComputed,Hn as style,Pt as svgTemplate,Ot as template,Wn as throttle,Yn as transition,Kt as tween,ps as unregisterComponent,gs as unregisterSignal,ie as untrack,no as useAnimatedValue,po as useAriaChecked,uo as useAriaExpanded,fo as useAriaSelected,Dr as useCallback,Xn as useClickOutside,Nr as useComputed,Bt as useContext,xo as useDescribedBy,Ir as useEffect,Ro as useFetch,Xo as useField,oo as useFocus,so as useFocusRestore,tn as useFocusTrap,qo as useForm,to as useGesture,ct as useId,yo as useIds,Po as useInfiniteQuery,bo as useLabelledBy,zn as useLocalStorage,Gn as useMediaQuery,Rr as useMemo,Oo as useQuery,$r as useReducer,Or as useRef,ho as useRovingTabIndex,Do as useSWR,Yr as useScheduledEffect,Mr as useSignal,Ao as useSkeleton,Lr as useState,eo as useTransition,as as validateImports,Go as yupResolver,Wo as zodResolver};
|
|
123
123
|
//# sourceMappingURL=index.min.js.map
|