what-core 0.13.4 → 0.13.6

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.
@@ -0,0 +1,11 @@
1
+ import{E as Lt,Q as q,R as Nt,T as Bt,U as it,V as O,W as gt,Y as W,Z as Mt,_ as v,a as z,ba as Dt,ca as Ht,d as I,da as yt,f as j,j as Et,n as Q,r as Tt,z as St}from"./chunk-ZDIHSTQJ.min.js";import{a as Z}from"./chunk-6YOUZ6T4.min.js";var jt=I(null);typeof document<"u"&&document.addEventListener("focusin",t=>{jt.set(t.target)});function Me(){return{current:()=>jt(),focus:t=>t?.focus(),blur:()=>document.activeElement?.blur()}}function De(){let t={current:null};function e(r){typeof document>"u"||(t.current=r||document.activeElement||null)}function n(r){let o=t.current||r;o&&typeof o.focus=="function"&&o.focus()}return{capture:e,restore:n,previous:()=>t.current}}function te(t){let e=null;function n(){if(typeof document>"u")return;e=document.activeElement;let o=t.current||t;if(!o||typeof o.querySelectorAll!="function")return;let i=Pt(o);if(i.length===0)return;i[0].focus();function g(c){if(c.key!=="Tab")return;let p=Pt(o),l=p[0],d=p[p.length-1];c.shiftKey?document.activeElement===l&&(c.preventDefault(),d.focus()):document.activeElement===d&&(c.preventDefault(),l.focus())}return o.addEventListener("keydown",g),()=>{o.removeEventListener("keydown",g)}}function r(){e&&typeof e.focus=="function"&&e.focus()}return{activate:n,deactivate:r}}function Pt(t){let e=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(t.querySelectorAll(e)).filter(n=>n.offsetParent!==null)}function He({children:t,active:e=!0}){let n={current:null},r=I(0),o=te(n),i=null,g=l=>{n.current=l,r.set(d=>d+1)},c=j(()=>{if(r(),i&&(i(),i=null,o.deactivate()),e&&n.current)return i=o.activate(),()=>{i?.(),i=null,o.deactivate()}}),p=Mt?.();return p&&(p._cleanupCallbacks=p._cleanupCallbacks||[],p._cleanupCallbacks.push(()=>{c(),i?.(),i=null,o.deactivate()})),Z("div",{ref:g},t)}var k=null,mt=0;function ee(){return typeof document>"u"?null:(k||(k=document.createElement("div"),k.id="what-announcer",k.setAttribute("aria-live","polite"),k.setAttribute("aria-atomic","true"),k.style.cssText=`
2
+ position: absolute;
3
+ width: 1px;
4
+ height: 1px;
5
+ padding: 0;
6
+ margin: -1px;
7
+ overflow: hidden;
8
+ clip: rect(0, 0, 0, 0);
9
+ white-space: nowrap;
10
+ border: 0;
11
+ `,document.body.appendChild(k)),k)}function ne(t,e={}){let{priority:n="polite",timeout:r=1e3}=e,o=ee();if(!o)return;o.setAttribute("aria-live",n);let i=++mt;o.textContent="",requestAnimationFrame(()=>{mt===i&&(o.textContent=t)}),setTimeout(()=>{mt===i&&(o.textContent="")},r)}function Pe(t){return ne(t,{priority:"assertive"})}function je({href:t="#main",children:e="Skip to content"}){return Z("a",{href:t,class:"what-skip-link",onClick:n=>{n.preventDefault();let r=document.querySelector(t);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"}},e)}function bt(t){return t?"true":"false"}function Re(t=!1){let e=I(t);return{expanded:()=>e(),toggle:()=>e.set(!e.peek()),open:()=>e.set(!0),close:()=>e.set(!1),buttonProps:()=>({"aria-expanded":()=>bt(e()),onClick:()=>e.set(!e.peek())}),panelProps:()=>({hidden:()=>!e()})}}function $e(t=null){let e=I(t);return{selected:()=>e(),select:n=>e.set(n),isSelected:n=>e()===n,itemProps:n=>({"aria-selected":()=>bt(e()===n),onClick:()=>e.set(n)})}}function Ke(t=!1){let e=I(t);return{checked:()=>e(),toggle:()=>e.set(!e.peek()),set:n=>e.set(n),checkboxProps:()=>({role:"checkbox","aria-checked":()=>bt(e()),tabIndex:0,onClick:()=>e.set(!e.peek()),onKeyDown:n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),e.set(!e.peek()))}})}}function Oe(t,e={}){let n=typeof t=="function"?t:()=>t,r=I(0),o=e?.role||null,i=[],g=[],c=[];function p(h){let s=g[h];return s||(s={get current(){return i[h]||null},set current(a){i[h]=a||null;let x=c[h];typeof x=="function"?x(a):x&&typeof x=="object"&&(x.current=a)}},g[h]=s),s}function l(h){let s=i[h];return s?s.isConnected===!1?null:s:null}function d(h){let s=l(h);return!s||typeof s.focus!="function"?null:((typeof document>"u"||document.activeElement!==s)&&s.focus(),s)}function f(){if(typeof document>"u")return!1;let h=document.activeElement;if(!h)return!1;for(let s=0;s<i.length;s++){let a=i[s];if(a&&(a===h||typeof a.contains=="function"&&a.contains(h)))return!0}return!1}function m(h,s){return!(s>0)||h<0?0:h>s-1?s-1:h}function b(){return m(r(),n())}function y(h){return Number.isInteger(h)&&h>=0&&h<n()}function _(h){let s=n();if(s<=0)return;let a=m(r.peek(),s),x=a;switch(h.key){case"ArrowDown":case"ArrowRight":x=(a+1)%s;break;case"ArrowUp":case"ArrowLeft":x=(a-1+s)%s;break;case"Home":x=0;break;case"End":x=s-1;break;default:return}h.preventDefault(),r.set(x),d(x)}return{focusIndex:()=>b(),setFocusIndex:h=>{y(h)&&(r.set(h),f()&&d(h))},focusItem:h=>y(h)?(r.set(h),d(h)):null,getItemProps:(h,s)=>{let{ref:a,...x}=s||{};return c[h]=a||null,{ref:p(h),tabIndex:()=>b()===h?0:-1,onKeyDown:_,onFocus:S=>{let D=S&&(S.currentTarget||S.target);D&&(i[h]=D),r.set(h)},...x}},containerProps:h=>o?{role:o,...h}:{...h}}}function Ie({children:t,as:e="span"}){return Z(e,{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}},t)}function Ve({children:t,priority:e="polite",atomic:n=!0}){return Z("div",{"aria-live":e,"aria-atomic":n},t)}var Rt=0;function $t(){let t=Tt();return t?(t.idCounter=(t.idCounter||0)+1,t.idCounter):++Rt}function Kt(){Rt=0}function Ot(t="what"){let e=`${t}-${$t()}`;return()=>e}function ze(t,e="what"){let n=[];for(let r=0;r<t;r++)n.push(`${e}-${$t()}`);return n}function ke(t){let e=Ot("desc");return{descriptionId:e,descriptionProps:()=>({id:e(),style:{display:"none"}}),describedByProps:()=>({"aria-describedby":e()}),Description:()=>Z("div",{id:e(),style:{display:"none"}},t)}}function Ge(t){let e=Ot("label");return{labelId:e,labelProps:()=>({id:e()}),labelledByProps:()=>({"aria-labelledby":e()})}}var Ue={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Home:"Home",End:"End",Tab:"Tab"};function qe(t,e){return n=>{n.key===t&&e(n)}}function We(t,e){return n=>{t.includes(n.key)&&e(n)}}var et=null;function Fe(t){et=typeof t=="function"?t:null}function re(t,e,n){if(typeof n=="function"){let r=()=>{let o=n();return o.length===1?o[0]:o};return r._lazyChildren=!0,e=e?Object.assign({},e):{},Object.defineProperty(e,"_$lazyChildren",{value:r,configurable:!0}),{tag:t,props:e,children:[],key:null,_vnode:!0}}if(n&&n.length>0){let r=n.length===1?n[0]:n;e=e?Object.assign({},e,{children:r}):{children:r}}return{tag:t,props:e||{},children:n||[],key:null,_vnode:!0}}function tn(t,e,n){return W(re(t,e,n))}var oe={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>"}},ie=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 Gt(t){let e=t.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);return e?e[1]:""}function ce(t){let e=t.trim(),n=Gt(e);if(ie.has(n))return fe(e);let r=oe[n];if(r){let i=document.createElement("template");i.innerHTML=r.wrap+e+r.unwrap;let g=i.content.firstChild;for(let c=0;c<r.depth;c++)g=g.firstChild;return()=>g.cloneNode(!0)}let o=document.createElement("template");if(o.innerHTML=e,z&&o.content.childNodes.length!==1){let i=[...o.content.childNodes].find((g,c)=>c>0&&g.nodeType===1);throw Object.assign(new Error(`[what] <${n}> cannot contain <${i?i.nodeName.toLowerCase():"that element"}>: the HTML parser closed the outer tag early, so the rendered tree does not match your JSX.`),{code:"ERR_INVALID_HTML_NESTING"})}return()=>o.content.firstChild.cloneNode(!0)}var It=!1;function en(t){return z&&!It&&(It=!0,console.warn("[what] template() is a compiler internal. Use JSX instead. Direct calls with user input can lead to XSS vulnerabilities.")),ce(t)}function fe(t){let e=t.trim();if(Gt(e)==="svg"){let o=document.createElement("template");return o.innerHTML=e,()=>o.content.firstChild.cloneNode(!0)}let r=document.createElement("template");return r.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,()=>r.content.firstChild.firstChild.cloneNode(!0)}function Ut(t,e){if(!t)return;let n=!1,r=()=>{n||(n=!0,e())},o=t._dispose;t._dispose=o?()=>{o(),r()}:r}function qt(t,e,n){if(typeof e=="function"&&e._mapArray)return e(t,n||null);if(typeof e=="function"&&e._lazyChildren)return qt(t,e(),n);if(typeof e=="function"){let r=n||null,o=null,i=null,g=!1,c=Ct(),p=j(()=>Xt(c,()=>{let l=e(),d=typeof l;if(!g){g=!0,d==="string"||d==="number"?(i=document.createTextNode(String(l)),r?t.insertBefore(i,r):t.appendChild(i),et&&et(t,String(l)),o=i):o=ft(t,l,null,r);return}if(i!==null&&(d==="string"||d==="number")){let f=String(l);i.data!==f&&(i.data=f),et&&et(t,f);return}i=null,o=ft(t,l,o,r)}));return Ut(r||t,p),o}if(typeof e=="string"||typeof e=="number"){let r=document.createTextNode(String(e));return n?t.insertBefore(r,n):t.appendChild(r),r}return e!=null&&typeof e=="object"&&e.nodeType>0?(n?t.insertBefore(e,n):t.appendChild(e),e):ft(t,e,null,n||null)}function Wt(t){return!t||typeof t!="object"?!1:typeof Node<"u"&&t instanceof Node?!0:typeof t.nodeType=="number"&&typeof t.nodeName=="string"}function se(t){return!!t&&typeof t=="object"&&(t._vnode===!0||"tag"in t)}var at=typeof SVGElement<"u";function wt(t){return at&&t instanceof SVGElement&&t.tagName!=="foreignObject"}function Ct(){let t=v();return t[t.length-1]||null}function Xt(t,e){let n=v(),r=t!==null&&n[n.length-1]!==t;r&&n.push(t);try{return e()}finally{r&&n.pop()}}function Vt(t){return t==null?[]:Array.isArray(t)?t:[t]}function Jt(t,e,n){if(t==null||typeof t=="boolean")return n;if(Array.isArray(t)){for(let r=0;r<t.length;r++)Jt(t[r],e,n);return n}if(typeof t=="function"){let r=W(t,e,wt(e));if(r&&r.nodeType===11){let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}else r&&n.push(r);return n}if(typeof t=="string"||typeof t=="number")return n.push(document.createTextNode(String(t))),n;if(Wt(t)){if(t.nodeType===11&&t.childNodes.length>0){let r=Array.from(t.childNodes);for(let o=0;o<r.length;o++)n.push(r[o])}else n.push(t);return n}if(se(t)){let r=W(t,e,wt(e));if(r&&r.nodeType===11)if(r.childNodes.length===0)n.push(r);else{let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}else r&&n.push(r);return n}return n.push(document.createTextNode(String(t))),n}function le(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function ft(t,e,n,r){if(!t||typeof t.insertBefore!="function")return z&&console.warn("[what] reconcileInsert called with invalid parent:",t),n;let o=r||null;if(e==null||typeof e=="boolean"){let d=gt(Vt(n));for(let f=0;f<d.length;f++){let m=d[f];m.parentNode===t&&(O(m),t.removeChild(m))}return null}if((typeof e=="string"||typeof e=="number")&&n&&!Array.isArray(n)&&n.nodeType===3){let d=String(e);return n.data!==d&&(n.data=d),n}if(typeof e=="object"&&e!==null&&e.nodeType>0&&e.nodeType!==11&&!Array.isArray(e)){if(e===n)return n;if(n&&!Array.isArray(n)&&n.nodeType>0&&n.nodeType!==11)return n.parentNode===t?(O(n),t.replaceChild(e,n)):o?t.insertBefore(e,o):t.appendChild(e),e}let i=Jt(e,t,[]),g=Vt(n);if(le(g,i))return n;let c=gt(g),p=i.length;for(let d=0;d<c.length;d++){let f=c[d];if(f.parentNode!==t)continue;let m=!1;for(let b=0;b<p;b++)if(i[b]===f){m=!0;break}m||(O(f),t.removeChild(f))}let l=o;for(let d=i.length-1;d>=0;d--){let f=i[d];(f.parentNode!==t||f.nextSibling!==l)&&(l&&l.parentNode!==t&&(l=null),l?t.insertBefore(f,l):t.appendChild(f)),l=f}return i.length===0?null:i.length===1?i[0]:i}function nn(t,e,n){let r=n?.key,o=n?.raw||!1,i=(g,c)=>{let p=[],l=[],d=[],f=r&&!o?new Map:null,m=document.createComment("/list");g.insertBefore(m,c||null);let b=j(()=>{let y=t()||[],_=m.parentNode||g;r?pe(_,m,p,y,l,d,e,r,f):ue(_,m,p,y,l,d,e),p=y.length>0?y.slice():y});return Ut(m,()=>{b();for(let y=0;y<d.length;y++)d[y]?.();d.length=0}),m};return i._mapArray=!0,i._mapArraySource=t,i._mapArrayFn=e,i._mapArrayKeyed=!!r&&!o,i}function rn(t){let e=t._mapArraySource()||[],n=t._mapArrayFn,r=t._mapArrayKeyed;return e.map((o,i)=>n(r?()=>o:o,i))}function ue(t,e,n,r,o,i,g){let c=r.length,p=n.length;if(c===0){if(p>0){for(let s=0;s<p;s++)i[s]&&i[s]();for(let s=p-1;s>=0;s--){let a=o[s];a&&(O(a),a.parentNode===t&&t.removeChild(a))}o.length=0,i.length=0}return}if(p===0){let s=document.createDocumentFragment();for(let a=0;a<c;a++){let x=r[a],S=Q(D=>(i[a]=D,g(x,a)));o[a]=S,s.appendChild(S)}t.insertBefore(s,e);return}let l=0,d=Math.min(p,c);for(;l<d&&n[l]===r[l];)l++;if(l===p&&l===c)return;let f=p-1,m=c-1;for(;f>=l&&m>=l&&n[f]===r[m];)f--,m--;let b=new Array(c),y=new Array(c);for(let s=0;s<l;s++)b[s]=o[s],y[s]=i[s];for(let s=m+1;s<c;s++){let a=f+1+(s-m-1);b[s]=o[a],y[s]=i[a]}let _=m-l+1,h=f-l+1;if(_===0)for(let s=l;s<=f;s++)i[s]?.(),o[s]&&O(o[s]),o[s]?.parentNode&&o[s].parentNode.removeChild(o[s]);else if(h===0){let s=l<c&&b[m+1]?b[m+1]:e,a=document.createDocumentFragment();for(let x=l;x<=m;x++){let S=r[x],D=x;b[x]=Q(N=>(y[D]=N,g(S,D))),a.appendChild(b[x])}t.insertBefore(a,s)}else ae(t,e,n,r,o,i,g,l,f,m,b,y);o.length=c,i.length=c;for(let s=0;s<c;s++)o[s]=b[s],i[s]=y[s]}function ae(t,e,n,r,o,i,g,c,p,l,d,f){let m=new Map;for(let a=c;a<=p;a++)m.set(n[a],a);let b=l-c+1,y=new Int32Array(b);y.fill(-1);for(let a=c;a<=l;a++){let x=m.get(r[a]);x!==void 0&&(m.delete(r[a]),d[a]=o[x],f[a]=i[x],y[a-c]=x)}for(let[,a]of m)i[a]?.(),o[a]&&O(o[a]),o[a]?.parentNode&&o[a].parentNode.removeChild(o[a]);let _=b-de(y,b),h=new Uint8Array(b);if(_>1){let a=new Int32Array(_),x=new Int32Array(_),S=0;for(let N=0;N<b;N++)y[N]!==-1&&(a[S]=y[N],x[S]=N,S++);let D=Zt(a,_);for(let N=0;N<D.length;N++)h[x[D[N]]]=1}else if(_===1){for(let a=0;a<b;a++)if(y[a]!==-1){h[a]=1;break}}for(let a=c;a<=l;a++)if(!d[a]){let x=r[a],S=a;d[a]=Q(D=>(f[S]=D,g(x,S)))}let s=l+1<d.length&&d[l+1]?d[l+1]:e;for(let a=l;a>=c;a--){let x=a-c;(y[x]===-1||!h[x])&&(s&&s.parentNode!==t&&(s=e),t.insertBefore(d[a],s)),s=d[a]}}function de(t,e){let n=0;for(let r=0;r<e;r++)t[r]===-1&&n++;return n}function Zt(t,e){if(e===0)return[];if(e===1)return[0];let n=new Int32Array(e),r=new Int32Array(e),o=1;n[0]=0,r[0]=-1;for(let c=1;c<e;c++)if(t[c]>t[n[o-1]])r[c]=n[o-1],n[o++]=c;else{let p=0,l=o-1;for(;p<l;){let d=p+l>>1;t[n[d]]<t[c]?p=d+1:l=d}n[p]=c,r[c]=p>0?n[p-1]:-1}let i=new Array(o),g=n[o-1];for(let c=o-1;c>=0;c--)i[c]=g,g=r[g];return i}function he(){return document.createComment("i")}function F(t,e,n,r){let o=e;for(;o&&o!==n;){let i=o.nextSibling;t.insertBefore(o,r),o=i}}function xt(t,e,n){let r=e;for(;r&&r!==n;){let o=r.nextSibling;O(r),t.removeChild(r),r=o}}function _t(t,e,n,r,o,i,g,c,p){let l;if(o){let m=r(e),b=p(e);l=b,o.set(m,{itemSig:b})}else l=e;let d=he();t.appendChild(d);let f=Q(m=>(c[n]=m,i(l,n)));t.appendChild(f),g[n]=d}function pe(t,e,n,r,o,i,g,c,p){let l=r.length,d=n.length;if(l===0){if(d>0){for(let u=0;u<d;u++)i[u]&&i[u]();o[0]&&xt(t,o[0],e),o.length=0,i.length=0,p&&p.clear()}return}if(d===0){let u=document.createDocumentFragment();for(let E=0;E<l;E++)_t(u,r[E],E,c,p,g,o,i,I);t.insertBefore(u,e);return}let f=0,m=Math.min(d,l);for(;f<m;){if(n[f]===r[f]){f++;continue}let u=c(n[f]),E=c(r[f]);if(u!==E)break;p&&p.get(u).itemSig.set(r[f]),f++}let b=d-1,y=l-1;for(;b>=f&&y>=f;){if(n[b]===r[y]){b--,y--;continue}let u=c(n[b]),E=c(r[y]);if(u!==E)break;p&&p.get(u).itemSig.set(r[y]),b--,y--}if(f>b&&f>y)return;let _=new Array(l),h=new Array(l);for(let u=0;u<f;u++)_[u]=o[u],h[u]=i[u];for(let u=y+1;u<l;u++){let E=b+1+(u-y-1);_[u]=o[E],h[u]=i[E]}let s=y-f+1,a=b-f+1;if(a===0){let u=y+1<l&&_[y+1]?_[y+1]:e,E=document.createDocumentFragment();for(let B=f;B<=y;B++)_t(E,r[B],B,c,p,g,_,h,I);t.insertBefore(E,u),tt(o,i,_,h,l);return}if(s===0){for(let u=f;u<=b;u++){i[u]?.();let E=X(t,o[u],o,u,e);xt(t,o[u],E),p&&p.delete(c(n[u]))}tt(o,i,_,h,l);return}if(s===a&&s>=2&&s<=Math.max(a,200)){let u=0,E=-1,B=-1;for(let A=0;A<s&&u<=4;A++){let C=c(n[f+A]),K=c(r[f+A]);C!==K&&(u===0?E=A:u===1&&(B=A),u++)}if(u===2){let A=f+E,C=f+B,K=c(n[A]),J=c(n[C]),pt=c(r[A]),U=c(r[C]);if(K===U&&J===pt){for(let L=0;L<f;L++)_[L]=o[L],h[L]=i[L];for(let L=f;L<=y;L++)_[L]=o[L],h[L]=i[L];for(let L=y+1;L<l;L++){let $=b+1+(L-y-1);_[L]=o[$],h[L]=i[$]}let R=_[A];_[A]=_[C],_[C]=R;let M=h[A];if(h[A]=h[C],h[C]=M,p){if(r[A]!==n[A]){let L=c(r[A]),$=p.get(L);$&&$.itemSig.set(r[A])}if(r[C]!==n[C]){let L=c(r[C]),$=p.get(L);$&&$.itemSig.set(r[C])}}let H=C===A+1||A===C+1,P=Math.min(A,C),T=Math.max(A,C);if(H){let L=X(t,o[T],o,T,e);F(t,o[T],L,o[P])}else{let L=X(t,o[C],o,C,e),$=document.createComment("tmp");t.insertBefore($,o[C]),F(t,o[C],L,o[A]);let Ft=X(t,o[A],o,A,e);F(t,o[A],Ft,$),t.removeChild($)}tt(o,i,_,h,l);return}}if(u>=2&&u<=s){let A=E,C=-1,K=-1,J=!1,pt=c(n[f+A]),U=-1;for(let R=A;R<s;R++)if(c(r[f+R])===pt){U=R;break}if(U>A){let R=!0;for(let M=A;M<U;M++)if(c(n[f+M+1])!==c(r[f+M])){R=!1;break}if(R){let M=!0;for(let H=U+1;H<s;H++)if(c(n[f+H])!==c(r[f+H])){M=!1;break}M&&(J=!0,C=f+A,K=f+U)}}if(!J){let R=c(r[f+A]),M=-1;for(let H=A;H<a;H++)if(c(n[f+H])===R){M=H;break}if(M>A){let H=!0;for(let P=A;P<M;P++)if(c(n[f+P])!==c(r[f+P+1])){H=!1;break}if(H){let P=!0;for(let T=M+1;T<s;T++)if(c(n[f+T])!==c(r[f+T])){P=!1;break}P&&(J=!0,C=f+M,K=f+A)}}}if(J){for(let T=f;T<=b;T++)_[T]=o[T],h[T]=i[T];let R=_[C],M=h[C];if(C<K)for(let T=C;T<K;T++)_[T]=_[T+1],h[T]=h[T+1];else for(let T=C;T>K;T--)_[T]=_[T-1],h[T]=h[T-1];if(_[K]=R,h[K]=M,p)for(let T=f;T<=y;T++){let L=c(r[T]);if(r[T]!==n[T]){let $=p.get(L);$&&$.itemSig.set(r[T])}}let H=X(t,R,o,C,e),P;K+1<l?P=_[K+1]:P=e,(K>=y+1||P&&P.parentNode!==t)&&(P=e),F(t,R,H,P),tt(o,i,_,h,l);return}}}let x=new Map;for(let u=f;u<=b;u++)x.set(c(n[u]),u);let S=new Int32Array(s);S.fill(-1);for(let u=f;u<=y;u++){let E=c(r[u]),B=x.get(E);B!==void 0&&(x.delete(E),_[u]=o[B],h[u]=i[B],S[u-f]=B,p&&r[u]!==n[B]&&p.get(E).itemSig.set(r[u]))}let D=[...x.values()].sort((u,E)=>E-u);for(let u of D){i[u]?.();let E=X(t,o[u],o,u,e);xt(t,o[u],E),p&&p.delete(c(n[u]))}for(let u=f;u<=y;u++)if(!_[u]){let E=document.createDocumentFragment();_t(E,r[u],u,c,p,g,_,h,I),_[u]._frag=E}let N=0,rt=!0,ot=-1;for(let u=0;u<s;u++)S[u]!==-1&&(N++,S[u]<=ot&&(rt=!1),ot=S[u]);let V=new Uint8Array(s);if(rt)for(let u=0;u<s;u++)S[u]!==-1&&(V[u]=1);else if(N>1){let u=new Int32Array(N),E=new Int32Array(N),B=0;for(let C=0;C<s;C++)S[C]!==-1&&(u[B]=S[C],E[B]=C,B++);let A=Zt(u,N);for(let C=0;C<A.length;C++)V[E[A[C]]]=1}else if(N===1){for(let u=0;u<s;u++)if(S[u]!==-1){V[u]=1;break}}tt(o,i,_,h,l);let ht=y+1<l&&o[y+1]?o[y+1]:e;for(let u=y;u>=f;u--){let E=u-f,B=o[u];if(S[E]===-1)B._frag&&(t.insertBefore(B._frag,ht),delete B._frag);else if(!V[E]){let A=X(t,B,o,u,e);F(t,B,A,ht)}ht=B}}function X(t,e,n,r,o){let i=e.nextSibling;for(;i&&i!==o;){if(i.nodeType===8&&i.data==="i")return i;i=i.nextSibling}return o}function tt(t,e,n,r,o){t.length=o,e.length=o;for(let i=0;i<o;i++)t[i]=n[i],e[i]=r[i]}function on(t,e){for(let n in e){let r=e[n];if(n==="ref"){typeof r=="function"?r(t):r&&typeof r=="object"&&(r.current=t);continue}if(q(n)){if(typeof r!="function")continue;let o=n.slice(2).toLowerCase();t.addEventListener(o,r);continue}if(typeof r=="function"&&!q(n)){if(t._propEffects||(t._propEffects={}),t._propEffects[n])try{t._propEffects[n]()}catch{}n==="class"||n==="className"?t._propEffects[n]=j(()=>{let o=r()||"";at&&t instanceof SVGElement?t.setAttribute("class",o):t.className=o}):n==="style"&&typeof r()=="object"?t._propEffects[n]=j(()=>{dt(t,r())}):t._propEffects[n]=j(()=>{lt(t,n,r())})}else lt(t,n,r)}}function lt(t,e,n){if(e==="ref"){typeof n=="function"?n(t):n&&typeof n=="object"&&(n.current=t);return}if(e==="key")return;if(typeof n=="function"&&!q(e)){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=j(()=>lt(t,e,n()));return}if(q(e))return;if(Nt(e,n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${e}" attribute:`,n);return}let r=at&&t instanceof SVGElement;if(e==="class"||e==="className")r?t.setAttribute("class",n||""):t.className=n||"";else if(e==="dangerouslySetInnerHTML"){let o=n?.__html??"";typeof z<"u"&&z&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=o}else if(e==="innerHTML")if(n&&typeof n=="object"&&"__html"in n){let o=n.__html??"";typeof z<"u"&&z&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=o}else typeof console<"u"&&n!=null&&n!==""&&console.warn('[what] Plain string innerHTML is not allowed. Use { __html: "..." } or dangerouslySetInnerHTML={{ __html: "..." }} instead.');else if(e==="style")dt(t,n);else if(n==null){if(e in t)try{t[e]=""}catch{}t.removeAttribute(e)}else e.startsWith("data-")||e.startsWith("aria-")?t.setAttribute(e,n):typeof n=="boolean"?n?t.setAttribute(e,""):t.removeAttribute(e):r?t.setAttribute(e,n):e==="value"&&t.tagName==="SELECT"?yt(t,n):e in t?t[e]=n:t.setAttribute(e,n)}function nt(t,e,n,r){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=j(()=>r(t,n()))}function ge(t,e){if(typeof e=="function")return nt(t,"class",e,ge);at&&t instanceof SVGElement?t.setAttribute("class",e||""):t.className=e||""}function dt(t,e){if(typeof e=="function")return nt(t,"style",e,dt);if(typeof e=="string")t.style.cssText=e,t._lastStyleObj=null;else if(e&&typeof e=="object"){let n=t.style,r=t._lastStyleObj;if(r)for(let o in r)o in e||(n[o]="");for(let o in e)n[o]=e[o]??"";t._lastStyleObj=e}else e==null&&(t.style.cssText="",t._lastStyleObj=null)}function ye(t,e,n){if(typeof n=="function")return nt(t,e,n,(r,o)=>ye(r,e,o));n==null?t.removeAttribute(e):t.setAttribute(e,n)}function me(t,e){if(typeof e=="function")return nt(t,"value",e,me);if(t.tagName==="SELECT"){yt(t,e);return}let n=e==null?"":String(e);t.value!==n&&(t.value=n)}function be(t,e){if(typeof e=="function")return nt(t,"checked",e,be);t.checked=!!e}var zt=new Set;function cn(t){for(let e of t)zt.has(e)||(zt.add(e),document.addEventListener(e,n=>{let r=n.target,o="$$"+e;for(Object.defineProperty(n,"currentTarget",{configurable:!0,get(){return r||document}});r;){let i=r[o];if(i&&(i(n),n.cancelBubble))return;r=r.parentNode}}))}function fn(t,e,n){return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}function sn(t,e){j(()=>{for(let n in e){let r=typeof e[n]=="function"?e[n]():e[n];t.classList.toggle(n,!!r)}})}var ut=!1,w=null;function ln(){return ut}function xe(t,e){ut=!0,At=!1,Kt(),w={parent:e,index:0};try{let n=G(t,e);return e!==document.body&&e!==document.documentElement&&Yt(e),n}finally{ut=!1,w=null}}function Yt(t){if(!(!w||w.parent!==t))for(;t.childNodes.length>w.index;){let e=t.lastChild;O(e),t.removeChild(e)}}var _e=new Set(["$","/$","[]","/[]","fn","/fn","eb:start","eb:end","sb:start","sb:end","portal","portal:empty"]);function Qt(t){return t.nodeType===8&&_e.has(t.textContent)}function ct(t){let e=t.childNodes;for(;w.index<e.length;){let n=e[w.index];if(Qt(n)){w.index++;continue}return w.index++,n}return null}function vt(t){if(!w||w.parent!==t)return null;let e=t.childNodes;for(let n=w.index;n<e.length;n++){let r=e[n];if(!Qt(r))return r}return null}function Y(t,e){let n=e.nodeType===11?e.childNodes.length:1;return w&&w.parent===t?(t.insertBefore(e,t.childNodes[w.index]||null),w.index+=n):t.appendChild(e),e}function st(){return z}var At=!1;function we(){!st()||At||(At=!0,console.warn("[what] hydrate() was given DOM that is already built, so the server's markup is being REPLACED by a client render rather than adopted. Hydration needs an unbuilt vnode tree, which is what h() returns. what-compiler emits the unbuilt form for JSX written directly inside a hydrate() call, so the remaining causes are: a tree built before the call (`const tree = <App />; hydrate(tree, el)`), a component whose own body what-compiler lowered (it returns a template clone, which is finished DOM, and cannot be rendered by renderToString either), or a DOM node passed in by hand. The page below is correct and interactive; only the reuse is lost."))}function G(t,e){if(t==null||typeof t=="boolean")return null;if(typeof t=="string"||typeof t=="number"){let n=String(t);if(n===""){let i=vt(e);return i&&i.nodeType===3?(ct(e),i.textContent="",i):Y(e,document.createTextNode(""))}let r=ct(e);if(r&&r.nodeType===3)return r.textContent!==n&&(st()&&console.warn(`[what] Hydration mismatch: expected text "${n}", got "${r.textContent}"`),r.textContent=n),r;st()&&console.warn(`[what] Hydration mismatch: expected text node "${n}", got ${r?r.nodeName:"nothing"}. Falling back to client render.`);let o=document.createTextNode(n);return r?e.replaceChild(o,r):Y(e,o),o}if(typeof t=="function"&&t._lazyChildren)return G(t(),e);if(typeof t=="function"&&t._mapArray){let n=!!(w&&w.parent===e),r=n&&e.childNodes[w.index]||null,o=document.createComment("list");e.insertBefore(o,r),n&&w.index++;let i=t(e,r);if(o._rangeEnd=i,n){let g=Array.prototype.indexOf.call(e.childNodes,i);g>=0&&(w.index=g+1)}return i}if(typeof t=="function"){let n=!!(w&&w.parent===e),r=document.createComment("fn"),o=document.createComment("/fn");n?(e.insertBefore(r,e.childNodes[w.index]||null),w.index++):e.appendChild(r),G(t(),e),n?(e.insertBefore(o,e.childNodes[w.index]||null),w.index++):e.appendChild(o);let i=[];for(let f=r.nextSibling;f&&f!==o;f=f.nextSibling)i.push(f);let g=i.length===0?null:i.length===1?i[0]:i,c=Ct(),p=j(()=>Xt(c,()=>{let f=t();ut||(g=ft(o.parentNode||e,f,g,o))})),l=!1,d=()=>{l||(l=!0,p())};return r._dispose=d,o._dispose=d,Bt(r,d),r._rangeEnd=o,g}if(Array.isArray(t)){let n=[];for(let r of t){let o=G(r,e);o&&n.push(o)}return n.length===1?n[0]:n}if(typeof t=="object"&&t._vnode){if(typeof t.tag=="function"){let i=v(),g=t.tag,c=t.props||{},p=t.children||[],l={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:g,_parentCtx:i[i.length-1]||null,_errorBoundary:null};i.push(l);let d,f=null;try{let m={...c};c._$lazyChildren?f=Dt(g,m,c._$lazyChildren):m.children=p.length===0?c.children:p.length===1?p[0]:p,d=g(m),f&&f()}catch(m){return i.pop(),!Ht(m)&&!(m&&typeof m.then=="function"&&Ae(m,l))&&!St(m,l)&&console.error("[what] Error in component during hydration:",g.name||"Anonymous",m),null}l.mounted=!0,l._mountCallbacks&&queueMicrotask(()=>{if(!l.disposed)for(let m of l._mountCallbacks)try{m()}catch(b){console.error("[what] onMount error:",b)}});try{let m=G(d,e),b=typeof d=="function"||Array.isArray(d)&&d.some(h=>typeof h=="function"),y=Array.isArray(m)?m[0]:m,_=!b&&y&&y.nodeType?y:e;return it(_,l),m}finally{i.pop()}}if(t.tag==="__errorBoundary"){let{errorState:i,fallback:g,reset:c,handleError:p}=t.props;return kt(t,e,{startText:"eb:start",endText:"eb:end",ctxExtras:{_errorBoundary:p},state:i,contentFor:l=>l?typeof g=="function"?g({error:l,reset:c}):g:t.children||[]})}if(t.tag==="__suspense"){let{boundary:i,fallback:g,loading:c}=t.props;return kt(t,e,{startText:"sb:start",endText:"sb:end",ctxExtras:{_suspenseBoundary:i},state:c,contentFor:p=>p?g:t.children||[]})}if(t.tag==="__portal"){let i=W(t,e);return i?Y(e,i):null}let n=ct(e),r=t.tag.toLowerCase();if(n&&n.nodeType===1&&n.nodeName.toLowerCase()===r){Te(n,t.props||{}),n.removeAttribute("data-hk");let i=w;if(w={parent:n,index:0},t.props?.dangerouslySetInnerHTML?.__html==null){for(let c of t.children)G(c,n);t.children.length>0&&Yt(n)}return w=i,n}st()&&console.warn(`[what] Hydration mismatch: expected <${t.tag}>, got ${n?n.nodeName:"nothing"}. Falling back to client render.`);let o=W(t,e,wt(e));return n?e.replaceChild(o,n):Y(e,o),o}if(Wt(t)){we();let n=t.nodeType===11?t.childNodes.length:1,o=!!(w&&w.parent===e)?ct(e):null;return o?(e.replaceChild(t,o),w.index+=n-1,t):Y(e,t)}return Y(e,document.createTextNode(String(t)))}function Ae(t,e){for(let n=e;n;n=n._parentCtx)if(n._suspenseBoundary)return n._suspenseBoundary.onSuspend(t),!0;return!1}function Ce(t,e){return typeof t=="string"||typeof t=="number"?e.nodeType!==3:t&&t._vnode&&typeof t.tag=="string"?e.nodeType!==1||e.nodeName.toLowerCase()!==t.tag.toLowerCase():!1}function Ee(t,e,n){if(e<0||!w||w.parent!==t||w.index!==e)return!1;let r=vt(t);if(!r)return!1;let o=n(),i=Array.isArray(o)?o:[o],g=i.find(c=>c!=null&&typeof c!="boolean");if(g===void 0)return!0;if(Ce(g,r))return!1;for(let c of i)G(c,t);return!0}function kt(t,e,{startText:n,endText:r,ctxExtras:o,state:i,contentFor:g}){let c=t.children||[],p=!!(w&&w.parent===e),l=document.createComment(n),d=document.createComment(r),f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:Ct(),_startComment:l,_endComment:d,...o};p?(e.insertBefore(l,e.childNodes[w.index]||null),w.index++):e.appendChild(l);let m=p?w.index:-1,b=v();b.push(f);try{for(let x of c)G(x,e)}finally{b.pop()}let y=Et(i),_=!y;if(y){b.push(f);try{_=Ee(e,m,()=>g(y))}finally{b.pop()}}p?(e.insertBefore(d,e.childNodes[w.index]||null),w.index++):e.appendChild(d);let h=!0,s=0,a=j(()=>{let x=i();if(h&&(h=!1,_&&x===y))return;let S=l.parentNode;if(!S)return;let D=++s;for(;l.nextSibling&&l.nextSibling!==d;){let N=l.nextSibling;O(N),S.removeChild(N)}b.push(f);try{let N=g(x),rt=Array.isArray(N)?N:[N];for(let ot of rt){let V=W(ot,S);if(D!==s){V&&O(V);break}V&&(d.parentNode?d.parentNode.insertBefore(V,d):O(V))}}finally{b.pop()}});if(p&&w&&w.parent===e){let x=Array.prototype.indexOf.call(e.childNodes,d);x>=0&&(w.index=x+1)}return f.effects.push(a),it(l,f),it(d,f),l}function Te(t,e){for(let n in e){if(n==="children"||n==="key"||n==="dangerouslySetInnerHTML"||n==="innerHTML")continue;if(n==="ref"){let o=e.ref;typeof o=="function"?o(t):o&&typeof o=="object"&&(o.current=t);continue}let r=e[n];if(q(n)){if(typeof r!="function")continue;let o=n.slice(2).toLowerCase();t.addEventListener(o,r);continue}if(n.startsWith("$$")){t[n]=r;continue}if(typeof r=="function"&&!q(n)){n==="class"||n==="className"?j(()=>{t.className=r()||""}):n==="style"&&typeof r()=="object"?j(()=>{dt(t,r())}):j(()=>{lt(t,n,r())});continue}}}Lt({hydrate:xe,insert:qt});export{Me as a,De as b,te as c,He as d,ne as e,Pe as f,je as g,Re as h,$e as i,Ke as j,Oe as k,Ie as l,Ve as m,Ot as n,ze as o,ke as p,Ge as q,Ue as r,qe as s,We as t,Fe as u,re as v,tn as w,ce as x,en as y,fe as z,qt as A,nn as B,rn as C,on as D,lt as E,ge as F,dt as G,ye as H,me as I,be as J,cn as K,fn as L,sn as M,ln as N,xe as O};
@@ -0,0 +1 @@
1
+ import{a as T}from"./chunk-6YOUZ6T4.min.js";var l=typeof globalThis<"u"&&typeof globalThis.__WHAT_DEV__=="boolean"?globalThis.__WHAT_DEV__:import.meta&&import.meta.env?!!import.meta.env.DEV:(typeof process<"u"&&process.env,!1),d=null;function Qe(e){l&&(d=e)}var C=null,b=null,E=null,W=!1,B=0,x=[],V=!1,F=Symbol("needs_upstream"),H=null;function A(e,t){let n=e,r=new Set,o=null,s=0;function c(f){l&&W&&console.warn("[what] Signal.set() called inside a computed function. This may cause infinite loops. Use effect() instead."+(t?` (signal: ${t})`:""));let a=typeof f=="function"?f(n):f;(n===a?n!==0||1/n===1/a:n!==n&&a!==a)||(n=a,o=null,l&&d&&d.onSignalUpdate?.(i),r.size>0&&ie(r))}function i(f){if(arguments.length===0){let a=C;return a!==null&&(a!==o||a._epoch!==s)&&(o=a,s=a._epoch,r.add(a),a.deps.push(r)),n}c(f)}return i.set=c,i.peek=()=>n,i.subscribe=f=>L(()=>f(i())),i._signal=!0,l&&(i._subs=r,r._signalOwner=i,t&&(i._debugName=t)),l&&d&&d.onSignalCreate?.(i),i}function Ze(e){let t,n=!0,r=new Set,o=null,s=0,c=Q(()=>{let f=W;l&&(W=!0);try{t=e(),n=!1}finally{l&&(W=f)}},!0);c._level=1,c._computed=!0,c._computedSubs=r,r._owner=c,c._markDirty=()=>{n=!0},c._isDirty=()=>n,b&&b.disposals.push(()=>I(c));function i(){if(c.disposed)return t;let f=C;return f!==null&&(f!==o||f._epoch!==s)&&(o=f,s=f._epoch,r.add(f),f.deps.push(r)),n&&re(c),t}return c._onNotify=()=>{n=!0,o=null,r.size>0&&ie(r)},i._signal=!0,i.peek=()=>(n&&!c.disposed&&re(c),t),i}function re(e){if(H!==null)throw H.push(e),F;let t=[e];H=t;try{for(;t.length>0;){let n=t[t.length-1];if(n.disposed||!n._isDirty||!n._isDirty()){t.pop();continue}let r=!1,o=n.deps;for(let s=0;s<o.length;s++){let c=o[s]._owner;c&&!c.disposed&&c._computed&&c._isDirty&&c._isDirty()&&(t.push(c),r=!0)}if(!r)try{let s=n.deps.length;Z(n),n.deps.length!==s&&$(n),t.pop()}catch(s){if(s===F)n._markDirty();else throw s}}}finally{H=null}}function $(e){let t=0,n=e.deps;for(let r=0;r<n.length;r++){let o=n[r]._owner;if(o){let s=o._level;s>t&&(t=s)}}e._level=t+1}var ve=()=>{};function L(e,t){let n=Q(e);n._level=1;let r=C;C=n;try{let s=n.fn();typeof s=="function"&&(n._cleanup=s)}catch(s){throw I(n),s}finally{C=r}if($(n),t?.stable&&(n._stable=!0),n.deps.length===0&&n._cleanup===null)return n.disposed=!0,l&&d&&d.onEffectDispose?.(n),ve;let o=()=>I(n);return b&&b.disposals.push(o),o}function Ye(e){B++;try{e()}finally{B--,B===0&&Y()}}function Q(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 l&&d&&d.onEffectCreate?.(n),n}function Z(e){if(e.disposed)return;if(e._stable){if(e._cleanup){try{e._cleanup()}catch(r){l&&console.warn("[what] Error in effect cleanup:",r)}e._cleanup=null}let n=C;C=null;try{let r=e.fn();typeof r=="function"&&(e._cleanup=r)}catch(r){d?.onError&&d.onError?.(r,{type:"effect",effect:e}),l&&console.warn("[what] Error in stable effect:",r)}finally{C=n}l&&d?.onEffectRun&&d.onEffectRun?.(e);return}if(se(e),e._cleanup){try{e._cleanup()}catch(n){l&&d?.onError&&d.onError?.(n,{type:"effect-cleanup",effect:e}),l&&console.warn("[what] Error in effect cleanup:",n)}e._cleanup=null}let t=C;C=e;try{let n=e.fn();typeof n=="function"&&(e._cleanup=n)}catch(n){throw n===F||l&&d?.onError&&d.onError?.(n,{type:"effect",effect:e}),n}finally{C=t}l&&d?.onEffectRun&&d.onEffectRun?.(e)}function I(e){if(e.disposed=!0,l&&d&&d.onEffectDispose?.(e),se(e),e._cleanup){try{e._cleanup()}catch(t){l&&console.warn("[what] Error in effect cleanup on dispose:",t)}e._cleanup=null}}function se(e){let t=e.deps;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0,e._epoch++}var K=0,M=null,R=0;function oe(e){if(!e.disposed){if(e._onNotify)e._onNotify();else if(!e._pending)if(B===0&&e._stable){let t=C;C=null;try{let n=e.fn();if(typeof n=="function"){if(e._cleanup)try{e._cleanup()}catch{}e._cleanup=n}}catch(n){l&&d?.onError&&d.onError?.(n,{type:"effect",effect:e}),l&&console.warn("[what] Error in stable effect:",n)}finally{C=t}}else{e._pending=!0;let t=e._level,n=x.length;n>0&&x[n-1]._level>t&&(V=!0),x.push(e)}}}function ie(e){if(K===0){K=1;try{for(let t of e)oe(t);if(R>0&&M){let t=0,n=M;for(;t<R;){let r=n[t];n[t]=null,t++;for(let o of r)oe(o)}R=0}}finally{K=0}B===0&&x.length>0&&ke()}else M===null&&(M=[]),R>=M.length?M.push(e):M[R]=e,R++}var z=!1;function ke(){z||(z=!0,queueMicrotask(()=>{z=!1,Y()}))}var U=!1;function Y(){if(!U){U=!0;try{let e=0;for(;x.length>0&&e<25;){let t=x;x=[],t.length>1&&V&&t.sort((n,r)=>n._level-r._level),V=!1;for(let n=0;n<t.length;n++){let r=t[n];if(r._pending=!1,!r.disposed&&!r._onNotify){let o=r.deps.length;try{Z(r)}catch(s){if(s===F)throw s;l&&d?.onError&&d.onError?.(s,{type:"effect",effect:r});try{console.error("[what] Uncaught error in effect during update:",s)}catch{}continue}!r._computed&&r.deps.length!==o&&$(r)}}e++}if(e>=25){if(l){let n=x.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<x.length;t++)x[t]._pending=!1;x.length=0}}finally{U=!1}}}function et(e){let t,n=new Set,r=Q(()=>{let s=e();if(!Object.is(t,s)){t=s;for(let c of n)if(!c.disposed){if(c._onNotify)c._onNotify();else if(!c._pending){c._pending=!0;let i=c._level,f=x.length;f>0&&x[f-1]._level>i&&(V=!0),x.push(c)}}}});r._level=1;try{Z(r)}catch(s){throw I(r),s}$(r),n._owner=r,b&&b.disposals.push(()=>I(r));function o(){return C&&(n.add(C),C.deps.push(n)),t}return o._signal=!0,o.peek=()=>t,o}function tt(){if(U){l&&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(C){l&&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}z=!1,Y()}function ee(e){let t=C;C=null;try{return e()}finally{C=t}}function nt(){return E}function rt(e,t){let n=E,r=b;E=e,b=e;try{return t()}finally{E=n,b=r}}function ot(e){let t=b,n=E,r={disposals:[],owner:E,children:[],_disposed:!1};E&&E.children.push(r),b=r,E=r;try{return e(()=>te(r))}finally{b=t,E=n}}function te(e){if(e._disposed)return;e._disposed=!0;let t=!1,n;for(;e.children.length>0;){let r=e.children.pop();try{te(r)}catch(o){t||(t=!0,n=o)}}e.children.length=0;for(let r=e.disposals.length-1;r>=0;r--)try{e.disposals[r]()}catch(o){t||(t=!0,n=o)}if(e.disposals.length=0,e.owner){let r=e.owner.children.indexOf(e);r>=0&&e.owner.children.splice(r,1)}if(t)throw n}function st(e){let t=b,n=E,r={disposals:[],owner:null,children:[],_disposed:!1};b=r,E=r;try{return e(()=>te(r))}finally{b=t,E=n}}function it(e){b&&b.disposals.push(e)}if(l&&typeof WeakRef<"u"){let t={signals:new Set,effects:new Set,components:[]};d={__isPreinstallBuffer:!0,onSignalCreate(n){t.signals.size<2e3&&t.signals.add(new WeakRef(n))},onSignalUpdate(){},onEffectCreate(n){t.effects.size<2e3&&t.effects.add(new WeakRef(n))},onEffectDispose(){},onEffectRun(){},onError(){},onComponentMount(n){t.components.length<2e3&&t.components.push(n)},onComponentUnmount(){},__buffer:t}}function ct(){if(!l)return{signals:[],effects:[],components:[]};let e={signals:[],effects:[],components:[]},t=typeof X<"u"?X:null;if(!t)return e;for(let n of t.signals){let r=n.deref?.();r&&e.signals.push(r)}for(let n of t.effects){let r=n.deref?.();r&&e.effects.push(r)}for(let n of t.components)e.components.push(n);return e}var X=null;l&&d?.__isPreinstallBuffer&&(X=d.__buffer);var O=null,j=null;function at(e){j||(j=e)}function Ae(){return j?.getStore()??O}function ce(){return typeof document>"u"||Ae()!=null}function lt(e){let t=O;return O=e,t}function ut(e,t){if(j)return j.run(e,t);let n=O;O=e;try{return t()}finally{O=n}}function yt(e,t){let n=function(o){return e(o)};return n.displayName=`Memo(${e.name||"Anonymous"})`,n}var fe=null;function ae(e){fe=e}function gt(e){let t=null,n=null,r=null,o=new Set;function s(c){if(r)throw r;if(t)return T(t,c);throw n||(n=e().then(i=>{t=i.default||i,o.forEach(f=>f()),o.clear()}).catch(i=>{r=i})),n}return s.displayName="Lazy",s._lazy=!0,s._onLoad=c=>{t?c():o.add(c)},s}function Ne({fallback:e,children:t}){let n=A(!1),r=new Set,o=!1;return{tag:"__suspense",props:{boundary:{_suspense:!0,onSuspend(c){o||(n.set(!0),r.add(c),c.then(()=>{r.delete(c),r.size===0&&n.set(!1)},i=>{o=!0,r.delete(c),console.error("[what] Suspense: a suspended child rejected:",i)}))}},fallback:e,loading:n},children:Array.isArray(t)?t:[t],_vnode:!0}}Ne._deferChildren=!0;function Le({fallback:e,children:t,onError:n}){let r=A(null);return{tag:"__errorBoundary",props:{errorState:r,handleError:c=>{if(r.set(c),n)try{n(c)}catch(i){console.error("Error in onError handler:",i)}},fallback:e,reset:()=>r.set(null)},children:Array.isArray(t)?t:[t],_vnode:!0}}Le._deferChildren=!0;function le(e,t){let n=t||fe?.();for(;n;){if(n._errorBoundary)return n._errorBoundary(e),!0;n=n._parentCtx}return!1}function Ct({when:e,fallback:t=null,children:n}){return()=>(typeof e=="function"?e():e)?n:t}function wt({each:e,fallback:t=null,children:n}){let r=Array.isArray(n)?n[0]:n;return typeof r!="function"?(console.warn("[what] For: children must be a render function, e.g. <For each={items}>{(item) => ...}</For>"),t):()=>{let o=typeof e=="function"?e():e;return!o||o.length===0?t:o.map((s,c)=>{let i=r(s,c);return i&&typeof i=="object"&&i.key==null&&(s!=null&&typeof s=="object"?s.id!=null?i.key=s.id:s.key!=null&&(i.key=s.key):(typeof s=="string"||typeof s=="number")&&(i.key=s)),i})}}function bt({fallback:e=null,children:t}){let n=Array.isArray(t)?t:[t];return()=>{for(let r of n)if(r&&r.tag===De){let o=r.props.when;if(typeof o=="function"?o():o)return r.children}return e}}function De(e){return()=>(typeof e.when=="function"?e.when():e.when)?e.children:null}var q=null;function St(e){q=e}function Me(e){let t={};for(let n in e){let r=e[n];typeof r=="function"||typeof r=="symbol"||r===void 0||(t[n]=r)}try{return JSON.stringify(t)}catch{return"{}"}}function xt({component:e,mode:t,mediaQuery:n,name:r,children:o,...s}){let c=r||e?.name||"Island",i=t||"idle",f={"data-island":c,"data-island-mode":i,"data-hydrate":i,"data-island-self":"1"},a=o==null?[]:Array.isArray(o)?o:[o];if(ce())return T("div",{...f,"data-island-props":Me(s)},T(e,s,...a));let _=!1;function y(u){if(_)return;_=!0;let p=T(e,s,...a);u.childNodes.length>0&&q?.hydrate?q.hydrate(p,u):q?.insert&&q.insert(u,p,null),u.removeAttribute("data-hydrate"),u.removeAttribute("data-island-self"),u.setAttribute("data-island-hydrated","");let m=u.ownerDocument?.defaultView??globalThis;typeof m.CustomEvent=="function"&&u.dispatchEvent(new m.CustomEvent("island:hydrated",{bubbles:!0,detail:{name:c,mode:i}}))}function S(u){let p=()=>y(u);switch(i){case"load":queueMicrotask(p);break;case"idle":typeof requestIdleCallback<"u"?requestIdleCallback(p):setTimeout(p,200);break;case"visible":{if(typeof IntersectionObserver>"u"){queueMicrotask(p);break}let m=new IntersectionObserver(w=>{w.some(v=>v.isIntersecting)&&(m.disconnect(),p())},{rootMargin:"200px"});m.observe(u);break}case"interaction":case"action":{let m=["click","focus","mouseenter","touchstart"],w=()=>{for(let v of m)u.removeEventListener(v,w);p()};for(let v of m)u.addEventListener(v,w,{once:!0});break}case"media":{if(!n||typeof window>"u"||!window.matchMedia){p();break}let m=window.matchMedia(n);if(m.matches){queueMicrotask(p);break}let w=()=>{m.matches&&(m.removeEventListener("change",w),p())};m.addEventListener("change",w);break}case"static":break;default:queueMicrotask(p)}}return T("div",{...f,ref:u=>{u&&S(u)}})}var ue=!1;function kt(e,t,n){return ue||(ue=!0,console.warn("[what] each() is deprecated. Use the <For> component or Array.map() instead.")),!e||e.length===0?[]:e.map((r,o)=>{let s=t(r,o);return n&&s&&typeof s=="object"&&(s.key=n(r,o)),s})}function At(...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,o]of Object.entries(n))o&&t.push(r)}return t.join(" ")}function Nt(e){return typeof e=="string"?e:Object.entries(e).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>`${Te(t)}:${n}`).join(";")}function Te(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Lt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function Dt(e,t){let n=0;return(...r)=>{let o=Date.now();o-n>=t&&(n=o,e(...r))}}var G=null;function pe(e){G=e}function Mt(e){if(typeof window>"u")return A(!1);let t=window.matchMedia(e),n=A(t.matches),r=s=>n.set(s.matches);t.addEventListener("change",r);let o=G?.();return o&&(o._cleanupCallbacks=o._cleanupCallbacks||[],o._cleanupCallbacks.push(()=>t.removeEventListener("change",r))),n}function Tt(e,t){let n;try{let i=localStorage.getItem(e);n=i!==null?JSON.parse(i):t}catch{n=t}let r=A(n),o=L(()=>{try{localStorage.setItem(e,JSON.stringify(r()))}catch(i){l&&console.warn("[what] localStorage write failed (quota exceeded?):",i)}}),s=null;typeof window<"u"&&(s=i=>{if(i.key===e&&i.newValue!==null)try{r.set(JSON.parse(i.newValue))}catch(f){l&&console.warn("[what] localStorage parse failed:",f)}},window.addEventListener("storage",s));let c=G?.();return c&&(c._cleanupCallbacks=c._cleanupCallbacks||[],c._cleanupCallbacks.push(()=>{o(),s&&window.removeEventListener("storage",s)})),r}function Rt({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 Ot(e,t){if(typeof document>"u")return;let n=o=>{let s=e.current||e;!s||s.contains(o.target)||t(o)};document.addEventListener("mousedown",n),document.addEventListener("touchstart",n);let r=G?.();r&&(r._cleanupCallbacks=r._cleanupCallbacks||[],r._cleanupCallbacks.push(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}))}function Pt(e,t){return{class:t?`${e}-enter ${e}-enter-active`:`${e}-leave ${e}-leave-active`}}var Re=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"]),Oe="http://www.w3.org/2000/svg",de=new Set(["href","src","action","formaction","formAction","data","ping","xlink:href","xlinkHref"]),he=new Set(["srcdoc","srcDoc"]);function Pe(e){if(e==null)return!0;let t;try{t=String(e).trim().replace(/[\s\x00-\x1f]/g,"").toLowerCase()}catch{return!1}return!(t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))}function _e(e){if(e.length<=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return(t===111||t===79)&&(n===110||n===78)}function Be(e,t){let n=e.toLowerCase();return he.has(e)||he.has(n)?!0:!de.has(e)&&!de.has(n)?!1:!Pe(t)}function Ie(e){return e==="role"||e.startsWith("aria-")}var ye=new Set,J=new WeakMap;function je(e){return!e||typeof e!="object"?!1:typeof Node<"u"&&e instanceof Node?!0:typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function me(e){return!!e&&typeof e=="object"&&(e._vnode===!0||"tag"in e)}function ne(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)}l&&d?.onComponentUnmount&&d.onComponentUnmount?.(e),ye.delete(e)}}function qe(e,t){!e||typeof t!="function"||(e._hydrationDisposers?e._hydrationDisposers.push(t):e._hydrationDisposers=[t])}function Ht(e,t){qe(e,()=>ne(t))}function D(e){if(!e)return;if(e._componentCtx&&ne(e._componentCtx),e._hydrationDisposers){let n=e._hydrationDisposers;e._hydrationDisposers=null;for(let r=0;r<n.length;r++)try{n[r]()}catch{}}if(e.nodeType===8){let n=J.get(e);n&&ne(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++)D(t[n])}function He(e){let t=null;for(let n of e){let r=n._rangeEnd;if(!r||r.parentNode!==n.parentNode)continue;t||(t=e.slice());let o=t;for(let s=n.nextSibling;s&&(o.push(s),s!==r);s=s.nextSibling);}return t||e}function Wt(e,t){typeof t=="string"&&(t=document.querySelector(t)),D(t),t.textContent="";let n=N(e,t);return n&&t.appendChild(n),()=>{D(t),t.textContent=""}}function N(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(je(e))return e;if(typeof e=="function"&&e._mapArray){let r=document.createDocumentFragment(),o=document.createComment("list");return r.appendChild(o),o._rangeEnd=e(r,null),r}if(typeof e=="function"&&e._lazyChildren)return N(e(),t,n);if(typeof e=="function"){let r=document.createComment("fn"),o=document.createComment("/fn"),s=[],c=document.createDocumentFragment();c.appendChild(r),c.appendChild(o);let i=h[h.length-1]||null,f=L(()=>{let a=i!==null&&h[h.length-1]!==i;a&&h.push(i);try{let _=e(),y=_==null||_===!1||_===!0?[]:Array.isArray(_)?_:[_],S=o.parentNode;if(!S)return;for(let u of He(s))D(u),u.parentNode===S&&S.removeChild(u);s=[];for(let u of y){let p=N(u,S,t?._isSvg);if(p)if(p.nodeType===11){let m=Array.from(p.childNodes);S.insertBefore(p,o);for(let w of m)s.push(w)}else S.insertBefore(p,o),s.push(p)}}finally{a&&h.pop()}});return r._dispose=f,o._dispose=f,r._rangeEnd=o,c}if(Array.isArray(e)){let r=document.createDocumentFragment();for(let o of e){let s=N(o,t,n);s&&r.appendChild(s)}return r}return me(e)&&typeof e.tag=="function"?Fe(e,t,n):me(e)&&typeof e.tag=="string"?e.tag==="__errorBoundary"?Ce(e,t):e.tag==="__suspense"?we(e,t):e.tag==="__portal"?be(e,t):Ge(e,t,n):document.createTextNode(String(e))}var We={get(e,t){if(t!=="_sig"&&!(t==="__proto__"||t==="constructor"||t==="prototype"))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}},set(e,t){return!1}},h=[];function ge(){return h[h.length-1]}ae(ge);pe(ge);function zt(){return h}function Ut(e){let t={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:e,_parentCtx:h[h.length-1]||null,_errorBoundary:null};return h.push(t),t}function Vt(e){h[h.length-1]===e&&h.pop(),e.disposed=!0}function ze(e,t,n){if(e._deferChildren)return t.children=n,null;let r,o=!1,s=!0;return Object.defineProperty(t,"children",{get(){return s?(o||(o=!0,r=n()),r):n()},enumerable:!0,configurable:!0}),()=>{s=!1,o=!1,r=void 0}}var Ue=Symbol.for("what.navigation.signal");function Ve(e){if(e==null)return!1;let t=e[Ue];return typeof t!="function"?!1:(t(e),!0)}function Fe(e,t,n){let{tag:r,props:o,children:s}=e;if(typeof r=="function"&&(r.prototype?.isReactComponent||r.prototype?.render)){let g=r;r=function(Ee){return new g(Ee).render()},r.displayName=g.displayName||g.name||"ClassComponent"}if(r==="__errorBoundary"||e.tag==="__errorBoundary")return Ce(e,t);if(r==="__suspense"||e.tag==="__suspense")return we(e,t);if(r==="__portal"||e.tag==="__portal")return be(e,t);let c=h[h.length-1]||null,i=null;if(c&&(i=c._errorBoundary||null,!i)){let g=c._parentCtx;for(;g;){if(g._errorBoundary){i=g._errorBoundary;break}g=g._parentCtx}}let f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:r,_parentCtx:c,_errorBoundary:i},a=document.createComment("c:start"),_=document.createComment("c:end");J.set(a,f),f._startComment=a,f._endComment=_;let y=document.createDocumentFragment();y._componentCtx=f,f._wrapper=a,ye.add(f),l&&d?.onComponentMount&&d.onComponentMount?.(f);let S=s.length===0?void 0:s.length===1?s[0]:s,u;S!==void 0?u=o?Object.assign({},o,{children:S}):{children:S}:u=o?Object.assign({},o):{};let p=o&&o._$lazyChildren,m=p?ze(r,u,p):null,w=A(u);f._propsSignal=w;let v=new Proxy({_sig:w},We);h.push(f);let k;try{k=ee(()=>r(v))}catch(g){if(h.pop(),!Ve(g)&&!(g&&typeof g.then=="function"&&$e(g,f))&&!le(g,f))throw console.error("[what] Uncaught error in component:",r.name||"Anonymous",g),g;return y.appendChild(a),y.appendChild(_),y}m&&m(),f.mounted=!0,f._mountCallbacks&&queueMicrotask(()=>{if(!f.disposed)for(let g of f._mountCallbacks)try{g()}catch(P){console.error("[what] onMount error:",P)}}),y.appendChild(a);let xe=Array.isArray(k)?k:[k];try{for(let g of xe){let P=N(g,y,n);P&&y.appendChild(P)}}finally{h.pop()}return y.appendChild(_),y}function $e(e,t){let n=t;for(;n;){if(n._suspenseBoundary)return n._suspenseBoundary.onSuspend(e),!0;n=n._parentCtx}return!1}function Ce(e,t){let{errorState:n,handleError:r,fallback:o,reset:s}=e.props,c=e.children,i=document.createComment("eb:start"),f=document.createComment("eb:end"),a={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null,_errorBoundary:r,_startComment:i,_endComment:f};J.set(i,a);let _=document.createDocumentFragment();_._componentCtx=a,_.appendChild(i),_.appendChild(f);let y=L(()=>{let S=n();h.push(a);let u=i.parentNode;if(u)for(;i.nextSibling&&i.nextSibling!==f;){let m=i.nextSibling;D(m),u.removeChild(m)}let p;S?p=typeof o=="function"?[o({error:S,reset:s})]:[o]:p=c,p=Array.isArray(p)?p:[p];for(let m of p){let w=N(m,t);w&&(f.parentNode?f.parentNode.insertBefore(w,f):_.insertBefore(w,f))}h.pop()});return a.effects.push(y),_}function we(e,t){let{boundary:n,fallback:r,loading:o}=e.props,s=e.children,c=document.createComment("sb:start"),i=document.createComment("sb:end"),f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null,_suspenseBoundary:n,_startComment:c,_endComment:i};J.set(c,f);let a=document.createDocumentFragment();a._componentCtx=f,a.appendChild(c),a.appendChild(i);let _=0,y=L(()=>{let u=o()?[r]:s,p=Array.isArray(u)?u:[u],m=++_;h.push(f);let w=c.parentNode;if(w)for(;c.nextSibling&&c.nextSibling!==i;){let v=c.nextSibling;D(v),w.removeChild(v)}try{for(let v of p){let k=N(v,t);if(m!==_){k&&D(k);break}k&&(i.parentNode?i.parentNode.insertBefore(k,i):a.insertBefore(k,i))}}finally{h.pop()}});return f.effects.push(y),a}function be(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 o={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:h[h.length-1]||null},s=document.createComment("portal");s._componentCtx=o;let c=[];for(let i of r){let f=N(i,n);f&&(n.appendChild(f),c.push(f))}return o._cleanupCallbacks=[()=>{for(let i of c)D(i),i.parentNode&&i.parentNode.removeChild(i)}],s}function Ge(e,t,n){let{tag:r,props:o,children:s}=e,c=n||Re.has(r),i=c?document.createElementNS(Oe,r):document.createElement(r);o&&Je(i,o,{},c);let f=c&&r!=="foreignObject";for(let a=0;a<s.length;a++){let _=N(s[a],i,f);_&&i.appendChild(_)}return i._vnode=e,i}function Je(e,t,n,r){if(t){for(let o in t)if(!(o==="key"||o==="children")){if(o==="ref"){let s=t.ref;typeof s=="function"?s(e):s&&(s.current=e);continue}Se(e,o,t[o],r)}}}function Ke(e,t){e.value=t,e.value!==String(t)&&queueMicrotask(()=>{e.value=t})}function Se(e,t,n,r){if(typeof n=="function"&&!_e(t)&&t!=="ref"){if(e._propEffects||(e._propEffects={}),e._propEffects[t])try{e._propEffects[t]()}catch{}e._propEffects[t]=L(()=>{let o=n();Se(e,t,o,r)});return}if(_e(t)){if(typeof n!="function"&&n!=null)return;let o=t.slice(2),s=!1;o.endsWith("Capture")&&(o=o.slice(0,-7),s=!0);let c=o.toLowerCase(),i=s?c+"_capture":c,f=e._events?.[i];if(f&&f._original===n||(f&&e.removeEventListener(c,f,s),n==null))return;e._events||(e._events={});let a=y=>(y.nativeEvent||(y.nativeEvent=y),ee(()=>a._handler(y)));a._handler=n,a._original=n,e._events[i]=a;let _=n._eventOpts;e.addEventListener(c,a,_||s||void 0);return}if(Be(t,n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${t}" attribute:`,n);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 o=e._prevStyle||{};for(let s in o)s in n||(e.style[s]="");for(let s in n)e.style[s]=n[s]??"";e._prevStyle={...n}}return}if(t==="dangerouslySetInnerHTML"){let o=n?.__html??"";l&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),e.innerHTML=o;return}if(t==="innerHTML"){if(n==null)return;if(n&&typeof n=="object"&&"__html"in n){let o=n.__html??"";l&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),e.innerHTML=o}else{l&&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(n==null){if(t in e)try{e[t]=""}catch{}e.removeAttribute(t);return}if(Ie(t)||t.startsWith("data-")){e.setAttribute(t,typeof n=="boolean"?String(n):n);return}if(typeof n=="boolean"){n?e.setAttribute(t,""):e.removeAttribute(t);return}if(r){n===!1||n==null?e.removeAttribute(t):e.setAttribute(t,n===!0?"":String(n));return}if(t==="value"&&e.tagName==="SELECT"){Ke(e,n);return}t in e?e[t]=n:e.setAttribute(t,n)}export{l as a,d as b,Qe as c,A as d,Ze as e,L as f,Ye as g,et as h,tt as i,ee as j,nt as k,rt as l,ot as m,st as n,it as o,ct as p,at as q,Ae as r,ce as s,lt as t,ut as u,yt as v,gt as w,Ne as x,Le as y,le as z,Ct as A,wt as B,bt as C,De as D,St as E,xt as F,kt as G,At as H,Nt as I,Lt as J,Dt as K,Mt as L,Tt as M,Rt as N,Ot as O,Pt as P,_e as Q,Be as R,Ie as S,qe as T,Ht as U,D as V,He as W,Wt as X,N as Y,ge as Z,zt as _,Ut as $,Vt as aa,ze as ba,Ve as ca,Ke as da};
package/dist/index.min.js CHANGED
@@ -1,4 +1,4 @@
1
- import{A as Fn,B as Pn,C as Hn,D as Gn,J as Vn,K as $n,L as Un,M as jn,N as qn,a as dn,b as fn,c as pn,d as hn,e as gn,f as mn,g as yn,h as vn,i as wn,j as xn,k as En,l as bn,m as _n,n as Sn,o as kn,p as Rn,q as Cn,r as An,s as In,t as Tn,u as Nn,v as Dn,w as On,x as Je,y as Ln,z as Mn}from"./chunk-DZTPU2YD.min.js";import{$ as un,A as Bt,B as Wt,C as Yt,D as Xt,F as zt,G as Qt,H as Kt,I as Jt,J as Zt,K as en,L as tn,M as nn,N as rn,O as on,P as sn,Q as De,S as an,W as cn,Y as W,_ as ln,a as L,c as At,d,e as P,f as V,g as O,h as It,i as Tt,j as ce,k as Nt,l as Dt,m as Ot,o as Lt,p as Mt,q as Ht,r as ge,s as Ne,t as Gt,u as Vt,v as $t,w as Ut,x as jt,y as qt}from"./chunk-OKM3GKVP.min.js";import{a as N,b as Ft,c as Pt}from"./chunk-O3SKPRTY.min.js";var re;function Oe(){if(re!==void 0)return re;if(typeof document>"u")return re=null;let e=document.getElementById("__what_data");if(!e)return re=null;try{re=JSON.parse(e.textContent)}catch{re=null}return re}function Bn(){re=void 0}function Le(){let e=Oe();return e?e.loaderData:void 0}function Me(e){let t=Oe();return t&&t.resources?t.resources[e]:void 0}function Wn(){if(Ne()){let e=ge();return e?e.loaderData:void 0}return Le()}function Y(e){let t=W();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 oe(e){let t=e.hookIndex++;return{index:t,exists:t<e.hooks.length}}function Yn(e){let t=Y("useState"),{index:n,exists:r}=oe(t);if(!r){let s=d(typeof e=="function"?e():e);t.hooks[n]=s}let o=t.hooks[n];return[o,o.set]}function Xn(e){let t=Y("useSignal"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]=d(typeof e=="function"?e():e)),t.hooks[n]}function zn(e){let t=Y("useComputed"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]=P(e)),t.hooks[n]}function Qn(e,t){let n=Y("useEffect"),{index:r,exists:o}=oe(n);if(o||(n.hooks[r]={cleanup:null,dispose:null}),L&&Array.isArray(t)&&t.length>0)for(let a=0;a<t.length;a++){let c=t[a];c!=null&&typeof c!="function"&&console.warn(`[what] useEffect dep at index ${a} is not a function. Did you mean to pass a signal? Use count instead of count()`)}let s=n.hooks[r];s.dispose||(t===void 0?queueMicrotask(()=>{n.disposed||(s.dispose=V(()=>{if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let a=e();typeof a=="function"&&(s.cleanup=a)}),n.effects=n.effects||[],n.effects.push(s.dispose))}):t.length===0?(queueMicrotask(()=>{if(n.disposed)return;let a=e();typeof a=="function"&&(s.cleanup=a)}),s.dispose=!0):queueMicrotask(()=>{n.disposed||(s.dispose=V(()=>{for(let c=0;c<t.length;c++){let u=t[c];typeof u=="function"&&u._signal&&u()}if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let a=ce(()=>e());typeof a=="function"&&(s.cleanup=a)}),n.effects=n.effects||[],n.effects.push(s.dispose))}))}function Kn(e,t){let n=Y("useMemo"),{index:r,exists:o}=oe(n);return o||(n.hooks[r]={computed:P(e)}),n.hooks[r].computed}function Jn(e,t){let n=Y("useCallback"),{index:r,exists:o}=oe(n);return o||(n.hooks[r]={callback:e}),n.hooks[r].callback}function Zn(e){let t=Y("useRef"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]={current:e}),t.hooks[n]}function Ze(e){let t=W();for(L&&!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 er(e){let t={_defaultValue:e,Provider:({value:n,children:r})=>{let o=Y("Context.Provider");if(o._contextValues||(o._contextValues=new Map),o._contextSignals||(o._contextSignals=new Map),o._contextSignals.has(t))o._contextSignals.get(t).set(n);else{let s=d(n);o._contextSignals.set(t,s),o._contextValues.set(t,s)}return r},Consumer:({children:n})=>{let r=Ze(t);return typeof n=="function"?n(r):n}};return t.Provider._deferChildren=!0,t}function tr(e,t,n){let r=Y("useReducer"),{index:o,exists:s}=oe(r);if(!s){let c=n?n(t):t,u=d(c),p=i=>{u.set(h=>e(h,i))};r.hooks[o]={signal:u,dispatch:p}}let a=r.hooks[o];return[a.signal,a.dispatch]}function nr(e){let t=Y("onMount");t.mounted||(t._mountCallbacks=t._mountCallbacks||[],t._mountCallbacks.push(e))}function rr(e){let t=Y("onCleanup");t._cleanupCallbacks=t._cleanupCallbacks||[],t._cleanupCallbacks.push(e)}function or(e,t={}){if(Ne()){let i=ge();if(i){let h=t.key!=null?t.key:`__r${i.resourceCounter++}`,g=i.resources.get(h);if(g&&g.status==="ready")return[()=>g.value,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];if(g&&g.status==="error")return[()=>{},{loading:()=>!1,error:()=>g.error,refetch:()=>{},mutate:()=>{}}];if(!g){let _=Promise.resolve().then(()=>e(t.source??!0,{})).then(b=>{i.resources.set(h,{status:"ready",value:b})}).catch(b=>{i.resources.set(h,{status:"error",error:b})});throw i.resources.set(h,{status:"pending",promise:_}),_}throw g.promise}if(t.initialValue!=null)return[()=>t.initialValue,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];throw Promise.resolve().then(()=>e(t.source??!0,{}))}let n=t.initialValue;if(n==null&&t.key!=null){let i=Me(t.key);i!==void 0&&(n=i)}let r=d(n??null),o=d(n==null),s=d(null),a=null,c=async i=>{a&&a.abort(),a=new AbortController;let{signal:h}=a;o.set(!0),s.set(null);try{let g=await e(i,{signal:h});h.aborted||O(()=>{r.set(g),o.set(!1)})}catch(g){h.aborted||O(()=>{s.set(g),o.set(!1)})}},u=i=>{r.set(typeof i=="function"?i(r()):i)},p=W?.();return p&&(p._cleanupCallbacks=p._cleanupCallbacks||[],p._cleanupCallbacks.push(()=>{a&&a.abort()})),n==null&&c(t.source),[r,{loading:o,error:s,refetch:c,mutate:u}]}function nt(e){return e._storeComputed=!0,e}var et=!1;function sr(e){return et||(et=!0,console.warn("[what] storeComputed() is deprecated. Use derived() instead.")),nt(e)}function ar(e){let t={},n={},r={};for(let[o,s]of Object.entries(e))typeof s=="function"&&s._storeComputed?(L&&s.length===0&&console.warn(`[what] derived() for "${o}" should accept the state parameter, e.g. derived(state => ...).`),n[o]=s):typeof s=="function"?r[o]=s:t[o]=d(s);for(let[o,s]of Object.entries(n)){let a=new Proxy({},{get(c,u){if(t[u])return t[u]();if(n[u])return n[u]()}});n[o]=P(()=>s(a))}for(let[o,s]of Object.entries(r))r[o]=(...a)=>{let c;return O(()=>{let u=new Proxy({},{get(p,i){if(t[i])return t[i].peek();if(n[i])return n[i].peek();if(r[i])return r[i]},set(p,i,h){return t[i]&&t[i].set(h),!0}});c=s.apply(u,a)}),c};return function(){let s={};for(let[a,c]of Object.entries(t))Object.defineProperty(s,a,{get:()=>c(),enumerable:!0});for(let[a,c]of Object.entries(n))Object.defineProperty(s,a,{get:()=>c(),enumerable:!0});for(let[a,c]of Object.entries(r))s[a]=c;return s}}var tt=!1;function ir(e){return tt||(tt=!0,console.warn("[what] atom() is deprecated. Use signal() directly instead.")),d(e)}var Fe={title:null,metas:new Map,links:new Map};function cr({title:e,meta:t,link:n,children:r}){if(typeof document>"u"){let o=ge();return o&&o.head&&ur(o.head,{title:e,meta:t,link:n}),r??null}if(e&&(document.title=e,Fe.title=e),t)for(let o of Array.isArray(t)?t:[t]){let s=o.name||o.property||o.httpEquiv||JSON.stringify(o);ot("meta",s,o)}if(n)for(let o of Array.isArray(n)?n:[n]){let s=o.rel+(o.href||"");ot("link",s,o)}return r||null}function lr(e){return e.name||e.property||e.httpEquiv||JSON.stringify(e)}function ur(e,{title:t,meta:n,link:r}){if(t!=null&&(e.title=t),n)for(let o of Array.isArray(n)?n:[n])e.metas.set(lr(o),o);if(r)for(let o of Array.isArray(r)?r:[r])e.links.set(o.rel+(o.href||""),o)}function dr(){return{title:null,metas:new Map,links:new Map}}function fr(e){if(!e)return"";let t="";e.title!=null&&(t+=`<title>${st(String(e.title))}</title>`);for(let n of e.metas.values())t+=rt("meta",n);for(let n of e.links.values())t+=rt("link",n);return t}var pr=/^[a-zA-Z_:][a-zA-Z0-9:._-]*$/;function Pe(e){if(!pr.test(e))return!1;let t=e.toLowerCase();return!(t.startsWith("on")&&t.length>2)}function ke(e){return e==="httpEquiv"?"http-equiv":e}function rt(e,t){let n=`<${e}`;for(let[r,o]of Object.entries(t)){if(o==null||o===!1)continue;let s=ke(r);Pe(s)&&(n+=` ${s}="${st(String(o))}"`)}return n+">"}function st(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function hr(e){let t=String(e);return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n.codePointAt(0).toString(16)} `)}function ot(e,t,n){let r=document.head.querySelector(`[data-what-head="${hr(t)}"]`);if(r){gr(r,n);return}let o=document.createElement(e);o.setAttribute("data-what-head",t);for(let[s,a]of Object.entries(n))Pe(ke(s))&&o.setAttribute(ke(s),a);document.head.appendChild(o)}function gr(e,t){for(let[n,r]of Object.entries(t)){let o=ke(n);Pe(o)&&e.getAttribute(o)!==r&&e.setAttribute(o,r)}}function mr(){let e=document.head.querySelectorAll("[data-what-head]");for(let t of e)t.remove();Fe.metas.clear(),Fe.links.clear()}var me=[],ye=[],Ge=!1;function Z(e){return me.push(e),Ve(),()=>{let t=me.indexOf(e);t!==-1&&me.splice(t,1)}}function se(e){return ye.push(e),Ve(),()=>{let t=ye.indexOf(e);t!==-1&&ye.splice(t,1)}}function at(){for(;me.length>0;){let e=me.shift();try{e()}catch(t){console.error("[what] Scheduler read error:",t)}}for(;ye.length>0;){let e=ye.shift();try{e()}catch(t){console.error("[what] Scheduler write error:",t)}}Ge=!1,(me.length>0||ye.length>0)&&Ve()}function Ve(){Ge||(Ge=!0,requestAnimationFrame(at))}function yr(e){return new Promise(t=>{Z(()=>{t(e())})})}function vr(e){return new Promise(t=>{se(()=>{e(),t()})})}function wr(e,t){let n=Symbol("scheduledEffect");return V(()=>{it(n,()=>{Z(()=>{let r=e();t&&se(()=>t(r))})})})}function xr(){let e,t=new Promise((n,r)=>{let o=requestAnimationFrame(n);e=()=>{cancelAnimationFrame(o),r(new Error("Cancelled"))}});return t.cancel=e,t}var we=new Map;function it(e,t){we.has(e)?we.set(e,t):(we.set(e,t),requestAnimationFrame(()=>{let n=we.get(e);we.delete(e),n&&n()}))}var He=new WeakMap,Re=null;function Er(e,t){return typeof ResizeObserver>"u"?(t(e.getBoundingClientRect()),()=>{}):(Re||(Re=new ResizeObserver(n=>{Z(()=>{for(let r of n){let o=He.get(r.target);o&&o(r.contentRect)}})})),He.set(e,t),Re.observe(e),()=>{He.delete(e),Re.unobserve(e)})}function br(e,t,n={}){if(typeof IntersectionObserver>"u")return t({isIntersecting:!0,intersectionRatio:1}),()=>{};let r=new IntersectionObserver(o=>{Z(()=>{for(let s of o)t(s)})},n);return r.observe(e),()=>r.disconnect()}function _r(e,t={}){let{duration:n=300,easing:r=o=>o*(2-o)}=t;return new Promise(o=>{let s,a,c;Z(()=>{s=window.scrollY;let p=e.getBoundingClientRect();a=s+p.top,c=performance.now(),u()});function u(){Z(()=>{let p=performance.now()-c,i=Math.min(p/n,1),h=r(i),g=s+(a-s)*h;se(()=>{window.scrollTo(0,g),i<1?requestAnimationFrame(u):o()})})}})}function ct(e){let t=W?.(),n=V(e);return t&&t.effects.push(n),n}function lt(e,t={}){let{stiffness:n=100,damping:r=10,mass:o=1,precision:s=.01}=t,a=d(e),c=d(e),u=d(0),p=d(!1),i=null,h=null;function g(S){if(h===null){h=S,i=requestAnimationFrame(g);return}let E=Math.min((S-h)/1e3,.064);h=S;let T=a.peek(),D=c.peek(),A=u.peek(),k=T-D,m=-n*k,f=-r*A,I=(m+f)/o,F=A+I*E,G=T+F*E;if(O(()=>{u.set(F),a.set(G)}),Math.abs(F)<s&&Math.abs(k)<s){O(()=>{a.set(D),u.set(0),p.set(!1)}),i=null,h=null;return}i=requestAnimationFrame(g)}function _(S){c.set(S),i===null&&(p.set(!0),h=null,i=requestAnimationFrame(g))}function b(){i&&(cancelAnimationFrame(i),i=null),p.set(!1),h=null}function R(S){b(),O(()=>{a.set(S),c.set(S),u.set(0)})}let C=W?.();return C&&(C._cleanupCallbacks=C._cleanupCallbacks||[],C._cleanupCallbacks.push(b)),{current:()=>a(),target:()=>c(),velocity:()=>u(),isAnimating:()=>p(),set:_,stop:b,snap:R,subscribe:a.subscribe}}function ut(e,t,n={}){let{duration:r=300,easing:o=_=>_*(2-_),onUpdate:s,onComplete:a}=n,c=d(0),u=d(e),p=d(!0),i=null,h=null;function g(_){i===null&&(i=_);let b=_-i,R=Math.min(b/r,1),C=o(R),S=e+(t-e)*C;O(()=>{c.set(R),u.set(S)}),s&&s(S,R),R<1?h=requestAnimationFrame(g):(p.set(!1),a&&a())}return h=requestAnimationFrame(g),{progress:()=>c(),value:()=>u(),isAnimating:()=>p(),cancel:()=>{h&&cancelAnimationFrame(h),p.set(!1)},subscribe:u.subscribe}}var dt={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 Sr(e={}){let{duration:t=300,easing:n=dt.easeOutQuad}=e,r=d(!1),o=d(0);async function s(a){return r.set(!0),o.set(0),new Promise(c=>{let u=performance.now();function p(i){let h=i-u,g=Math.min(h/t,1);o.set(n(g)),g<1?requestAnimationFrame(p):(r.set(!1),a&&a(),c())}requestAnimationFrame(p)})}return{isTransitioning:()=>r(),progress:()=>o(),start:s}}function kr(e,t={}){let{onDrag:n,onDragStart:r,onDragEnd:o,onPinch:s,onSwipe:a,onTap:c,onLongPress:u,preventDefault:p=!1}=t,i={isDragging:d(!1),startX:0,startY:0,currentX:d(0),currentY:d(0),deltaX:d(0),deltaY:d(0),velocity:d({x:0,y:0})},h=0,g=0,_=0,b=null;function R(k){let m=k.touches?k.touches[0]:k;i.startX=m.clientX,i.startY=m.clientY,g=m.clientX,_=m.clientY,h=performance.now(),i.isDragging.set(!0),r&&r({x:i.startX,y:i.startY}),u&&(b=setTimeout(()=>{i.isDragging.peek()&&u({x:g,y:_})},500))}function C(k){if(!i.isDragging.peek())return;let m=k.touches?k.touches[0]:k,f=m.clientX,I=m.clientY,F=performance.now(),G=F-h;O(()=>{i.currentX.set(f),i.currentY.set(I),i.deltaX.set(f-i.startX),i.deltaY.set(I-i.startY),G>0&&i.velocity.set({x:(f-g)/G*1e3,y:(I-_)/G*1e3})}),g=f,_=I,h=F,b&&Math.sqrt(i.deltaX.peek()**2+i.deltaY.peek()**2)>10&&(clearTimeout(b),b=null),n&&n({x:f,y:I,deltaX:i.deltaX.peek(),deltaY:i.deltaY.peek(),velocity:i.velocity.peek()})}function S(k){if(!i.isDragging.peek())return;b&&(clearTimeout(b),b=null);let m=i.deltaX.peek(),f=i.deltaY.peek(),I=i.velocity.peek();if(Math.sqrt(m**2+f**2)<10&&c&&c({x:i.startX,y:i.startY}),a&&(Math.abs(I.x)>500||Math.abs(I.y)>500)){let G=Math.abs(I.x)>Math.abs(I.y)?I.x>0?"right":"left":I.y>0?"down":"up";a({direction:G,velocity:I})}o&&o({deltaX:m,deltaY:f,velocity:I}),i.isDragging.set(!1)}let E=null;function T(k){if(!s||k.touches.length!==2)return;let m=k.touches[0],f=k.touches[1],I=Math.sqrt((f.clientX-m.clientX)**2+(f.clientY-m.clientY)**2);E===null&&(E=I);let F=I/E,G=(m.clientX+f.clientX)/2,v=(m.clientY+f.clientY)/2;s({scale:F,centerX:G,centerY:v})}function D(){E=null}typeof e=="function"?ct(()=>{let k=ce(e);if(k)return A(k)}):e?.current!==void 0?ct(()=>{let k=e.current;if(k)return A(k)}):e&&A(e);function A(k){return k.addEventListener("mousedown",R),k.addEventListener("touchstart",R,{passive:!p}),window.addEventListener("mousemove",C),window.addEventListener("touchmove",T),window.addEventListener("touchmove",C),window.addEventListener("mouseup",S),window.addEventListener("touchend",S),window.addEventListener("touchend",D),()=>{k.removeEventListener("mousedown",R),k.removeEventListener("touchstart",R),window.removeEventListener("mousemove",C),window.removeEventListener("touchmove",T),window.removeEventListener("touchmove",C),window.removeEventListener("mouseup",S),window.removeEventListener("touchend",S),window.removeEventListener("touchend",D)}}return i}function Rr(e){let t=d(e);return{value:()=>t(),setValue:n=>t.set(n),spring(n,r={}){let o=lt(t.peek(),r);o.set(n);let s=V(()=>{t.set(o.current())});return{stop:()=>{o.stop(),s()}}},timing(n,r={}){let o=ut(t.peek(),n,{...r,onUpdate:s=>t.set(s)});return{stop:()=>o.cancel()}},interpolate(n,r){return()=>{let o=t();for(let s=0;s<n.length-1;s++)if(o>=n[s]&&o<=n[s+1]){let a=(o-n[s])/(n[s+1]-n[s]);return r[s]+(r[s+1]-r[s])*a}return o<=n[0]?r[0]:r[r.length-1]}},subscribe:t.subscribe}}function ft(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 Cr(e,t,n="enter",r=300){let o=ft(t);return new Promise(s=>{se(()=>{e.classList.add(o[n]),Z(()=>{e.offsetHeight,se(()=>{e.classList.add(o[`${n}Active`]),setTimeout(()=>{se(()=>{e.classList.remove(o[n],o[`${n}Active`]),e.classList.add(o[`${n}Done`]),s()})},r)})})})})}var Ar=`
1
+ import{A as Mn,B as Fn,C as Pn,D as Hn,E as Gn,K as $n,L as Vn,M as jn,N as Un,O as qn,a as dn,b as fn,c as pn,d as hn,e as gn,f as mn,g as yn,h as vn,i as wn,j as xn,k as En,l as bn,m as Sn,n as _n,o as kn,p as Rn,q as Cn,r as An,s as In,t as Tn,u as Nn,w as Dn,x as On,y as Je,z as Ln}from"./chunk-XRUIKSAO.min.js";import{$ as ln,A as Bt,B as Wt,C as Xt,D as Yt,F as zt,G as Qt,H as Kt,I as Jt,J as Zt,K as en,L as tn,M as nn,N as rn,O as on,P as sn,Q as Ne,S as an,X as cn,Z as W,a as L,aa as un,c as At,d,e as P,f as $,g as O,h as It,i as Tt,j as ce,k as Nt,l as Dt,m as Ot,o as Lt,p as Mt,q as Ht,r as ge,s as Te,t as Gt,u as $t,v as Vt,w as jt,x as Ut,y as qt}from"./chunk-ZDIHSTQJ.min.js";import{a as N,b as Ft,c as Pt}from"./chunk-6YOUZ6T4.min.js";var re;function De(){if(re!==void 0)return re;if(typeof document>"u")return re=null;let e=document.getElementById("__what_data");if(!e)return re=null;try{re=JSON.parse(e.textContent)}catch{re=null}return re}function Bn(){re=void 0}function Oe(){let e=De();return e?e.loaderData:void 0}function Le(e){let t=De();return t&&t.resources?t.resources[e]:void 0}function Wn(){if(Te()){let e=ge();return e?e.loaderData:void 0}return Oe()}function X(e){let t=W();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 oe(e){let t=e.hookIndex++;return{index:t,exists:t<e.hooks.length}}function Xn(e){let t=X("useState"),{index:n,exists:r}=oe(t);if(!r){let s=d(typeof e=="function"?e():e);t.hooks[n]=s}let o=t.hooks[n];return[o,o.set]}function Yn(e){let t=X("useSignal"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]=d(typeof e=="function"?e():e)),t.hooks[n]}function zn(e){let t=X("useComputed"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]=P(e)),t.hooks[n]}function Qn(e,t){let n=X("useEffect"),{index:r,exists:o}=oe(n);if(o||(n.hooks[r]={cleanup:null,dispose:null}),L&&Array.isArray(t)&&t.length>0)for(let a=0;a<t.length;a++){let c=t[a];c!=null&&typeof c!="function"&&console.warn(`[what] useEffect dep at index ${a} is not a function. Did you mean to pass a signal? Use count instead of count()`)}let s=n.hooks[r];s.dispose||(t===void 0?queueMicrotask(()=>{n.disposed||(s.dispose=$(()=>{if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let a=e();typeof a=="function"&&(s.cleanup=a)}),n.effects=n.effects||[],n.effects.push(s.dispose))}):t.length===0?(queueMicrotask(()=>{if(n.disposed)return;let a=e();typeof a=="function"&&(s.cleanup=a)}),s.dispose=!0):queueMicrotask(()=>{n.disposed||(s.dispose=$(()=>{for(let c=0;c<t.length;c++){let u=t[c];typeof u=="function"&&u._signal&&u()}if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let a=ce(()=>e());typeof a=="function"&&(s.cleanup=a)}),n.effects=n.effects||[],n.effects.push(s.dispose))}))}function Kn(e,t){let n=X("useMemo"),{index:r,exists:o}=oe(n);return o||(n.hooks[r]={computed:P(e)}),n.hooks[r].computed}function Jn(e,t){let n=X("useCallback"),{index:r,exists:o}=oe(n);return o||(n.hooks[r]={callback:e}),n.hooks[r].callback}function Zn(e){let t=X("useRef"),{index:n,exists:r}=oe(t);return r||(t.hooks[n]={current:e}),t.hooks[n]}function Ze(e){let t=W();for(L&&!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 er(e){let t={_defaultValue:e,Provider:({value:n,children:r})=>{let o=X("Context.Provider");if(o._contextValues||(o._contextValues=new Map),o._contextSignals||(o._contextSignals=new Map),o._contextSignals.has(t))o._contextSignals.get(t).set(n);else{let s=d(n);o._contextSignals.set(t,s),o._contextValues.set(t,s)}return r},Consumer:({children:n})=>{let r=Ze(t);return typeof n=="function"?n(r):n}};return t.Provider._deferChildren=!0,t}function tr(e,t,n){let r=X("useReducer"),{index:o,exists:s}=oe(r);if(!s){let c=n?n(t):t,u=d(c),p=i=>{u.set(h=>e(h,i))};r.hooks[o]={signal:u,dispatch:p}}let a=r.hooks[o];return[a.signal,a.dispatch]}function nr(e){let t=X("onMount");t.mounted||(t._mountCallbacks=t._mountCallbacks||[],t._mountCallbacks.push(e))}function rr(e){let t=X("onCleanup");t._cleanupCallbacks=t._cleanupCallbacks||[],t._cleanupCallbacks.push(e)}function or(e,t={}){if(Te()){let i=ge();if(i){let h=t.key!=null?t.key:`__r${i.resourceCounter++}`,g=i.resources.get(h);if(g&&g.status==="ready")return[()=>g.value,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];if(g&&g.status==="error")return[()=>{},{loading:()=>!1,error:()=>g.error,refetch:()=>{},mutate:()=>{}}];if(!g){let b=Promise.resolve().then(()=>e(t.source??!0,{})).then(S=>{i.resources.set(h,{status:"ready",value:S})}).catch(S=>{i.resources.set(h,{status:"error",error:S})});throw i.resources.set(h,{status:"pending",promise:b}),b}throw g.promise}if(t.initialValue!=null)return[()=>t.initialValue,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];throw Promise.resolve().then(()=>e(t.source??!0,{}))}let n=t.initialValue;if(n==null&&t.key!=null){let i=Le(t.key);i!==void 0&&(n=i)}let r=d(n??null),o=d(n==null),s=d(null),a=null,c=async i=>{a&&a.abort(),a=new AbortController;let{signal:h}=a;o.set(!0),s.set(null);try{let g=await e(i,{signal:h});h.aborted||O(()=>{r.set(g),o.set(!1)})}catch(g){h.aborted||O(()=>{s.set(g),o.set(!1)})}},u=i=>{r.set(typeof i=="function"?i(r()):i)},p=W?.();return p&&(p._cleanupCallbacks=p._cleanupCallbacks||[],p._cleanupCallbacks.push(()=>{a&&a.abort()})),n==null&&c(t.source),[r,{loading:o,error:s,refetch:c,mutate:u}]}function nt(e){return e._storeComputed=!0,e}var et=!1;function sr(e){return et||(et=!0,console.warn("[what] storeComputed() is deprecated. Use derived() instead.")),nt(e)}function ar(e){let t={},n={},r={};for(let[o,s]of Object.entries(e))typeof s=="function"&&s._storeComputed?(L&&s.length===0&&console.warn(`[what] derived() for "${o}" should accept the state parameter, e.g. derived(state => ...).`),n[o]=s):typeof s=="function"?r[o]=s:t[o]=d(s);for(let[o,s]of Object.entries(n)){let a=new Proxy({},{get(c,u){if(t[u])return t[u]();if(n[u])return n[u]()}});n[o]=P(()=>s(a))}for(let[o,s]of Object.entries(r))r[o]=(...a)=>{let c;return O(()=>{let u=new Proxy({},{get(p,i){if(t[i])return t[i].peek();if(n[i])return n[i].peek();if(r[i])return r[i]},set(p,i,h){return t[i]&&t[i].set(h),!0}});c=s.apply(u,a)}),c};return function(){let s={};for(let[a,c]of Object.entries(t))Object.defineProperty(s,a,{get:()=>c(),enumerable:!0});for(let[a,c]of Object.entries(n))Object.defineProperty(s,a,{get:()=>c(),enumerable:!0});for(let[a,c]of Object.entries(r))s[a]=c;return s}}var tt=!1;function ir(e){return tt||(tt=!0,console.warn("[what] atom() is deprecated. Use signal() directly instead.")),d(e)}var Me={title:null,metas:new Map,links:new Map};function cr({title:e,meta:t,link:n,children:r}){if(typeof document>"u"){let o=ge();return o&&o.head&&ur(o.head,{title:e,meta:t,link:n}),r??null}if(e&&(document.title=e,Me.title=e),t)for(let o of Array.isArray(t)?t:[t]){let s=o.name||o.property||o.httpEquiv||JSON.stringify(o);ot("meta",s,o)}if(n)for(let o of Array.isArray(n)?n:[n]){let s=o.rel+(o.href||"");ot("link",s,o)}return r||null}function lr(e){return e.name||e.property||e.httpEquiv||JSON.stringify(e)}function ur(e,{title:t,meta:n,link:r}){if(t!=null&&(e.title=t),n)for(let o of Array.isArray(n)?n:[n])e.metas.set(lr(o),o);if(r)for(let o of Array.isArray(r)?r:[r])e.links.set(o.rel+(o.href||""),o)}function dr(){return{title:null,metas:new Map,links:new Map}}function fr(e){if(!e)return"";let t="";e.title!=null&&(t+=`<title>${st(String(e.title))}</title>`);for(let n of e.metas.values())t+=rt("meta",n);for(let n of e.links.values())t+=rt("link",n);return t}var pr=/^[a-zA-Z_:][a-zA-Z0-9:._-]*$/;function Fe(e){if(!pr.test(e))return!1;let t=e.toLowerCase();return!(t.startsWith("on")&&t.length>2)}function ke(e){return e==="httpEquiv"?"http-equiv":e}function rt(e,t){let n=`<${e}`;for(let[r,o]of Object.entries(t)){if(o==null||o===!1)continue;let s=ke(r);Fe(s)&&(n+=` ${s}="${st(String(o))}"`)}return n+">"}function st(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function hr(e){let t=String(e);return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n.codePointAt(0).toString(16)} `)}function ot(e,t,n){let r=document.head.querySelector(`[data-what-head="${hr(t)}"]`);if(r){gr(r,n);return}let o=document.createElement(e);o.setAttribute("data-what-head",t);for(let[s,a]of Object.entries(n))Fe(ke(s))&&o.setAttribute(ke(s),a);document.head.appendChild(o)}function gr(e,t){for(let[n,r]of Object.entries(t)){let o=ke(n);Fe(o)&&e.getAttribute(o)!==r&&e.setAttribute(o,r)}}function mr(){let e=document.head.querySelectorAll("[data-what-head]");for(let t of e)t.remove();Me.metas.clear(),Me.links.clear()}var me=[],ye=[],Ge=!1;function Z(e){return me.push(e),$e(),()=>{let t=me.indexOf(e);t!==-1&&me.splice(t,1)}}function se(e){return ye.push(e),$e(),()=>{let t=ye.indexOf(e);t!==-1&&ye.splice(t,1)}}function at(){for(;me.length>0;){let e=me.shift();try{e()}catch(t){console.error("[what] Scheduler read error:",t)}}for(;ye.length>0;){let e=ye.shift();try{e()}catch(t){console.error("[what] Scheduler write error:",t)}}Ge=!1,(me.length>0||ye.length>0)&&$e()}function $e(){Ge||(Ge=!0,requestAnimationFrame(at))}function yr(e){return new Promise(t=>{Z(()=>{t(e())})})}function vr(e){return new Promise(t=>{se(()=>{e(),t()})})}function wr(e,t){let n=Symbol("scheduledEffect");return $(()=>{it(n,()=>{Z(()=>{let r=e();t&&se(()=>t(r))})})})}function xr(){let e,t=new Promise((n,r)=>{let o=requestAnimationFrame(n);e=()=>{cancelAnimationFrame(o),r(new Error("Cancelled"))}});return t.cancel=e,t}var we=new Map;function it(e,t){we.has(e)?we.set(e,t):(we.set(e,t),requestAnimationFrame(()=>{let n=we.get(e);we.delete(e),n&&n()}))}var Pe=new WeakMap,He=null;function Er(e,t){if(typeof ResizeObserver>"u")return t(e.getBoundingClientRect()),()=>{};He||(He=new ResizeObserver(r=>{Z(()=>{for(let o of r){let s=Pe.get(o.target);s&&s(o.contentRect)}})}));let n=He;return Pe.set(e,t),n.observe(e),()=>{Pe.delete(e),n.unobserve(e)}}function br(e,t,n={}){if(typeof IntersectionObserver>"u")return t({isIntersecting:!0,intersectionRatio:1}),()=>{};let r=new IntersectionObserver(o=>{Z(()=>{for(let s of o)t(s)})},n);return r.observe(e),()=>r.disconnect()}function Sr(e,t={}){let{duration:n=300,easing:r=o=>o*(2-o)}=t;return new Promise(o=>{let s,a,c;Z(()=>{s=window.scrollY;let p=e.getBoundingClientRect();a=s+p.top,c=performance.now(),u()});function u(){Z(()=>{let p=performance.now()-c,i=Math.min(p/n,1),h=r(i),g=s+(a-s)*h;se(()=>{window.scrollTo(0,g),i<1?requestAnimationFrame(u):o()})})}})}function ct(e){let t=W?.(),n=$(e);return t&&t.effects.push(n),n}function lt(e,t={}){let{stiffness:n=100,damping:r=10,mass:o=1,precision:s=.01}=t,a=d(e),c=d(e),u=d(0),p=d(!1),i=null,h=null;function g(k){if(h===null){h=k,i=requestAnimationFrame(g);return}let v=Math.min((k-h)/1e3,.064);h=k;let T=a.peek(),D=c.peek(),C=u.peek(),_=T-D,m=-n*_,f=-r*C,A=(m+f)/o,F=C+A*v,G=T+F*v;if(O(()=>{u.set(F),a.set(G)}),Math.abs(F)<s&&Math.abs(_)<s){O(()=>{a.set(D),u.set(0),p.set(!1)}),i=null,h=null;return}i=requestAnimationFrame(g)}function b(k){c.set(k),i===null&&(p.set(!0),h=null,i=requestAnimationFrame(g))}function S(){i&&(cancelAnimationFrame(i),i=null),p.set(!1),h=null}function I(k){S(),O(()=>{a.set(k),c.set(k),u.set(0)})}let R=W?.();return R&&(R._cleanupCallbacks=R._cleanupCallbacks||[],R._cleanupCallbacks.push(S)),{current:()=>a(),target:()=>c(),velocity:()=>u(),isAnimating:()=>p(),set:b,stop:S,snap:I,subscribe:a.subscribe}}function ut(e,t,n={}){let{duration:r=300,easing:o=b=>b*(2-b),onUpdate:s,onComplete:a}=n,c=d(0),u=d(e),p=d(!0),i=null,h=null;function g(b){i===null&&(i=b);let I=b-i,R=Math.min(I/r,1),k=o(R),v=e+(t-e)*k;O(()=>{c.set(R),u.set(v)}),s&&s(v,R),R<1?h=requestAnimationFrame(g):(p.set(!1),a&&a())}return h=requestAnimationFrame(g),{progress:()=>c(),value:()=>u(),isAnimating:()=>p(),cancel:()=>{h&&cancelAnimationFrame(h),p.set(!1)},subscribe:u.subscribe}}var dt={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 _r(e={}){let{duration:t=300,easing:n=dt.easeOutQuad}=e,r=d(!1),o=d(0);async function s(a){return r.set(!0),o.set(0),new Promise(c=>{let u=performance.now();function p(i){let h=i-u,g=Math.min(h/t,1);o.set(n(g)),g<1?requestAnimationFrame(p):(r.set(!1),a&&a(),c())}requestAnimationFrame(p)})}return{isTransitioning:()=>r(),progress:()=>o(),start:s}}function kr(e,t={}){let{onDrag:n,onDragStart:r,onDragEnd:o,onPinch:s,onSwipe:a,onTap:c,onLongPress:u,preventDefault:p=!1}=t,i={isDragging:d(!1),startX:0,startY:0,currentX:d(0),currentY:d(0),deltaX:d(0),deltaY:d(0),velocity:d({x:0,y:0})},h=0,g=0,b=0,S=null;function I(_){let m=_.touches?_.touches[0]:_;i.startX=m.clientX,i.startY=m.clientY,g=m.clientX,b=m.clientY,h=performance.now(),i.isDragging.set(!0),r&&r({x:i.startX,y:i.startY}),u&&(S=setTimeout(()=>{i.isDragging.peek()&&u({x:g,y:b})},500))}function R(_){if(!i.isDragging.peek())return;let m=_.touches?_.touches[0]:_,f=m.clientX,A=m.clientY,F=performance.now(),G=F-h;O(()=>{i.currentX.set(f),i.currentY.set(A),i.deltaX.set(f-i.startX),i.deltaY.set(A-i.startY),G>0&&i.velocity.set({x:(f-g)/G*1e3,y:(A-b)/G*1e3})}),g=f,b=A,h=F,S&&Math.sqrt(i.deltaX.peek()**2+i.deltaY.peek()**2)>10&&(clearTimeout(S),S=null),n&&n({x:f,y:A,deltaX:i.deltaX.peek(),deltaY:i.deltaY.peek(),velocity:i.velocity.peek()})}function k(_){if(!i.isDragging.peek())return;S&&(clearTimeout(S),S=null);let m=i.deltaX.peek(),f=i.deltaY.peek(),A=i.velocity.peek();if(Math.sqrt(m**2+f**2)<10&&c&&c({x:i.startX,y:i.startY}),a&&(Math.abs(A.x)>500||Math.abs(A.y)>500)){let G=Math.abs(A.x)>Math.abs(A.y)?A.x>0?"right":"left":A.y>0?"down":"up";a({direction:G,velocity:A})}o&&o({deltaX:m,deltaY:f,velocity:A}),i.isDragging.set(!1)}let v=null;function T(_){if(!s||_.touches.length!==2)return;let m=_.touches[0],f=_.touches[1],A=Math.sqrt((f.clientX-m.clientX)**2+(f.clientY-m.clientY)**2);v===null&&(v=A);let F=A/v,G=(m.clientX+f.clientX)/2,w=(m.clientY+f.clientY)/2;s({scale:F,centerX:G,centerY:w})}function D(){v=null}typeof e=="function"?ct(()=>{let _=ce(e);if(_)return C(_)}):e?.current!==void 0?ct(()=>{let _=e.current;if(_)return C(_)}):e&&C(e);function C(_){return _.addEventListener("mousedown",I),_.addEventListener("touchstart",I,{passive:!p}),window.addEventListener("mousemove",R),window.addEventListener("touchmove",T),window.addEventListener("touchmove",R),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("touchend",D),()=>{_.removeEventListener("mousedown",I),_.removeEventListener("touchstart",I),window.removeEventListener("mousemove",R),window.removeEventListener("touchmove",T),window.removeEventListener("touchmove",R),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("touchend",D)}}return i}function Rr(e){let t=d(e);return{value:()=>t(),setValue:n=>t.set(n),spring(n,r={}){let o=lt(t.peek(),r);o.set(n);let s=$(()=>{t.set(o.current())});return{stop:()=>{o.stop(),s()}}},timing(n,r={}){let o=ut(t.peek(),n,{...r,onUpdate:s=>t.set(s)});return{stop:()=>o.cancel()}},interpolate(n,r){return()=>{let o=t();for(let s=0;s<n.length-1;s++)if(o>=n[s]&&o<=n[s+1]){let a=(o-n[s])/(n[s+1]-n[s]);return r[s]+(r[s+1]-r[s])*a}return o<=n[0]?r[0]:r[r.length-1]}},subscribe:t.subscribe}}function ft(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 Cr(e,t,n="enter",r=300){let o=ft(t);return new Promise(s=>{se(()=>{e.classList.add(o[n]),Z(()=>{e.offsetHeight,se(()=>{e.classList.add(o[`${n}Active`]),setTimeout(()=>{se(()=>{e.classList.remove(o[n],o[`${n}Active`]),e.classList.add(o[`${n}Done`]),s()})},r)})})})})}var Ar=`
2
2
  .what-skeleton {
3
3
  background: linear-gradient(
4
4
  90deg,
@@ -50,7 +50,7 @@ import{A as Fn,B as Pn,C as Hn,D as Gn,J as Vn,K as $n,L as Un,M as jn,N as qn,a
50
50
  0% { transform: translateX(-100%); }
51
51
  100% { transform: translateX(100%); }
52
52
  }
53
- `,pt=!1;function le(){if(pt||typeof document>"u")return;pt=!0;let e=document.createElement("style");e.textContent=Ar,document.head.appendChild(e)}function $e({width:e,height:t,variant:n="shimmer",circle:r=!1,class:o,style:s,count:a=1}){le();let c=`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""} ${n==="wave"?"what-skeleton-wave":""}`,u=o?`${c} ${o}`:c,p={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,borderRadius:r?"50%":void 0,...s};return a===1?N("div",{class:u,style:p,"aria-hidden":"true"}):Array.from({length:a},(i,h)=>N("div",{key:h,class:u,style:{...p,marginBottom:h<a-1?"8px":void 0},"aria-hidden":"true"}))}function Ue({lines:e=3,lastLineWidth:t="60%",lineHeight:n=16,gap:r=8,variant:o="shimmer"}){return le(),N("div",{class:"what-skeleton-text","aria-hidden":"true"},Array.from({length:e},(s,a)=>N("div",{key:a,class:`what-skeleton ${o==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${n}px`,width:a===e-1?t:"100%",marginBottom:a<e-1?`${r}px`:void 0}})))}function Ir({size:e=40,variant:t="shimmer"}){return $e({width:e,height:e,circle:!0,variant:t})}function ht({imageHeight:e=200,lines:t=3,variant:n="shimmer"}){return le(),N("div",{class:"what-skeleton-card","aria-hidden":"true"},N("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${e}px`,width:"100%",marginBottom:"16px"}}),N("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"24px",width:"70%",marginBottom:"12px"}}),Ue({lines:t,variant:n}))}function Tr({rows:e=5,columns:t=4,variant:n="shimmer"}){return le(),N("div",{class:"what-skeleton-table","aria-hidden":"true"},N("div",{style:{display:"flex",gap:"16px",marginBottom:"16px"}},Array.from({length:t},(r,o)=>N("div",{key:o,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"20px",flex:1}}))),Array.from({length:e},(r,o)=>N("div",{key:o,style:{display:"flex",gap:"16px",marginBottom:o<e-1?"12px":void 0}},Array.from({length:t},(s,a)=>N("div",{key:a,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"16px",flex:1}})))))}function Nr({type:e="default",height:t,children:n}){return le(),e==="card"?ht({}):e==="text"?Ue({}):n||N("div",{class:"what-skeleton what-island-skeleton",style:{height:typeof t=="number"?`${t}px`:t||"100px",width:"100%"},"aria-hidden":"true"})}function Dr(e,t=[]){let n=d(!0),r=d(null),o=d(null);return V(()=>{n.set(!0),o.set(null),Promise.resolve(e()).then(s=>{r.set(s),n.set(!1)}).catch(s=>{o.set(s),n.set(!1)})}),{isLoading:()=>n(),data:()=>r(),error:()=>o(),Skeleton:s=>n()?$e(s):null}}function Or({width:e="100%",height:t=100,label:n="Loading...",showLabel:r=!1,variant:o="shimmer"}){return le(),N("div",{class:`what-skeleton ${o==="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&&N("span",{style:{color:"var(--skeleton-text, #999)",fontSize:"14px"}},n))}function Lr({size:e=8,color:t="#666"}){le();let n={width:`${e}px`,height:`${e}px`,borderRadius:"50%",backgroundColor:t,animation:"what-skeleton-pulse 1s infinite ease-in-out"};return N("div",{class:"what-loading-dots",style:{display:"flex",gap:`${e/2}px`},"aria-label":"Loading",role:"status"},N("div",{style:{...n,animationDelay:"0s"}}),N("div",{style:{...n,animationDelay:"0.2s"}}),N("div",{style:{...n,animationDelay:"0.4s"}}))}function Mr({size:e=24,color:t="#666",strokeWidth:n=2}){return N("svg",{width:e,height:e,viewBox:"0 0 24 24",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading",role:"status"},N("style",null,"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"),N("circle",{cx:12,cy:12,r:10,stroke:t,strokeWidth:n,fill:"none",strokeDasharray:"31.4 31.4",strokeLinecap:"round"}))}var U=new Map,ee=new Map,te=new Map,z=new Map,gt=200;function ae(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:JSON.stringify(t)??String(t)).map(t=>t.replace(/([\\:])/g,"\\$1")).join(":"):e}function Ce(e){return z.set(e,Date.now()),U.has(e)||(U.set(e,d(null)),U.size>gt&&Pr()),U.get(e)}function mt(e){return ee.has(e)||ee.set(e,d(null)),ee.get(e)}function Fr(e){return te.has(e)||te.set(e,d(!1)),te.get(e)}function Pr(){let e=[...z.entries()].sort((n,r)=>n[1]-r[1]),t=Math.floor(gt*.2);for(let n=0;n<t&&n<e.length;n++){let r=e[n][0];X.has(r)&&X.get(r).size>0||(U.delete(r),ee.delete(r),te.delete(r),z.delete(r),Ee.delete(r))}}var X=new Map;function Be(e,t){return X.has(e)||X.set(e,new Set),X.get(e).add(t),()=>{let n=X.get(e);n&&(n.delete(t),n.size===0&&X.delete(e))}}var je=new Set;function We(e){return je.add(e),()=>je.delete(e)}var ue=new Map,Ee=new Map,Ye=new Map;function yt(e){return Ye.get(e)||0}function Hr(e){Ye.set(e,yt(e)+1)}function xe(e){return e&&typeof e.unref=="function"&&e.unref(),e}function K(e){let t=W?.(),n=V(e);return t&&t.effects.push(n),n}function vt(e){let t=W?.();t&&t.effects.push(e)}function wt(e){let t=typeof e=="function"?e:()=>e,n=d(ce(()=>!!t()));return K(()=>{n.set(!!t())}),n}function Gr(e,t={}){let{method:n="GET",body:r,headers:o={},transform:s=g=>g,initialData:a=null}=t,c=d(a),u=d(null),p=d(!0),i=null;async function h(){i&&i.abort(),i=new AbortController;let{signal:g}=i;p.set(!0),u.set(null);try{let _=await fetch(e,{method:n,headers:{"Content-Type":"application/json",...o},body:r?JSON.stringify(r):void 0,signal:g});if(!_.ok)throw new Error(`HTTP ${_.status}: ${_.statusText}`);let b=await _.json();g.aborted||c.set(s(b))}catch(_){g.aborted||u.set(_)}finally{g.aborted||p.set(!1)}}return K(()=>(h(),()=>{i&&i.abort()})),{data:()=>c(),error:()=>u(),isLoading:()=>p(),refetch:h,mutate:g=>c.set(g)}}function Vr(e,t,n={}){let{revalidateOnFocus:r=!0,revalidateOnReconnect:o=!0,refreshInterval:s=0,dedupingInterval:a=2e3,fallbackData:c,onSuccess:u,onError:p}=n;if(e==null||e===!1){let E=d(c||null),T=d(null);return{data:()=>E(),error:()=>T(),isLoading:()=>!1,isValidating:()=>!1,mutate:D=>E.set(typeof D=="function"?D(E()):D),revalidate:()=>Promise.resolve()}}let i=ae(e),h=Ce(i),g=mt(i),_=Fr(i),b=P(()=>h()??c??null),R=P(()=>{let E=h()==null,T=_();return E&&T}),C=null;async function S({force:E=!1}={}){let T=Date.now(),D=yt(i);if(ue.has(i)){let f=ue.get(i);if(E?f.epoch===D:T-f.timestamp<a)return f.refCount++,f.promise}let A=Ee.get(i);if(!E&&A&&T-A<a&&h.peek()!=null)return h.peek();if(C){let f=ue.get(i);(!f||f.refCount<=1)&&C.abort()}C=new AbortController;let{signal:k}=C;_.set(!0);let m=t(e,{signal:k});ue.set(i,{promise:m,timestamp:T,refCount:1,epoch:D});try{let f=await m;return k.aborted?void 0:(O(()=>{h.set(f),g.set(null)}),z.set(i,Date.now()),Ee.set(i,Date.now()),u&&u(f,e),f)}catch(f){if(k.aborted)return;throw g.set(f),p&&p(f,e),f}finally{k.aborted||_.set(!1);let f=ue.get(i);f&&(f.refCount--,f.refCount<=0&&ue.delete(i))}}return K(()=>{let E=Be(i,()=>S({force:!0}).catch(()=>{})),T=We(()=>{C&&(C.abort(),C=null)});return S().catch(()=>{}),()=>{C&&C.abort(),E(),T()}}),r&&typeof window<"u"&&K(()=>{let E=()=>{document.visibilityState==="visible"&&S().catch(()=>{})};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)}),o&&typeof window<"u"&&K(()=>{let E=()=>S().catch(()=>{});return window.addEventListener("online",E),()=>window.removeEventListener("online",E)}),s>0&&K(()=>{let E=xe(setInterval(()=>{S().catch(()=>{})},s));return()=>clearInterval(E)}),{data:()=>b(),error:()=>g(),isLoading:()=>R(),isValidating:()=>_(),mutate:(E,T=!0)=>{let D=typeof E=="function"?E(h.peek()):E;h.set(D),z.set(i,Date.now()),T&&S().catch(()=>{})},revalidate:S}}function $r(e){let{queryKey:t,queryFn:n,enabled:r=!0,staleTime:o=0,cacheTime:s=300*1e3,refetchOnWindowFocus:a=!0,refetchInterval:c=!1,retry:u=3,retryDelay:p=v=>Math.min(1e3*2**v,3e4),onSuccess:i,onError:h,onSettled:g,select:_,placeholderData:b}=e,R=ae(t),C=wt(r),S=Ce(R),E=P(()=>{let v=S();return _&&v!=null?_(v):v}),T=mt(R),D=d(S.peek()!=null?"success":C.peek()?"loading":"idle"),A=d("idle"),k=P(()=>{let v=D(),M=S()!=null,ie=T()!=null,J=A()==="fetching";return v==="success"&&!M||v==="error"&&!ie?J?"loading":"idle":v}),m=0,f=null,I=null;async function F({force:v=!1,manual:M=!1}={}){if(!M&&!C.peek())return;let ie=Date.now();if(!v&&S.peek()!=null&&ie-m<o)return S.peek();f&&f.controller.abort();let J=new AbortController;f={controller:J,manual:M};let{signal:j}=J;A.set("fetching"),S.peek()==null&&D.set("loading");let l=0;async function w(){try{let x=await n({queryKey:Array.isArray(t)?t:[t],signal:j});return j.aborted?void 0:(O(()=>{S.set(x),T.set(null),D.set("success"),A.set("idle")}),m=Date.now(),z.set(R,Date.now()),i&&i(x),g&&g(x,null),I&&clearTimeout(I),I=xe(setTimeout(()=>{if(Date.now()-m>=s){let y=X.get(R);(!y||y.size===0)&&(U.delete(R),ee.delete(R),te.delete(R),z.delete(R),Ee.delete(R))}},s)),x)}catch(x){if(j.aborted)return;if(l++,l<u)return await new Promise((y,q)=>{let B=xe(setTimeout(y,p(l)));j.addEventListener("abort",()=>{clearTimeout(B),q(new DOMException("Aborted","AbortError"))},{once:!0})}).catch(y=>{if(y.name!=="AbortError")throw y}),j.aborted?void 0:w();throw O(()=>{T.set(x),D.set("error"),A.set("idle")}),h&&h(x),g&&g(null,x),x}}try{return await w()}finally{f&&f.controller===J&&(f=null)}}function G(){f&&(f.controller.abort(),f=null),O(()=>{D.peek()!=="idle"&&D.set("idle"),A.peek()!=="idle"&&A.set("idle")})}return K(()=>{let v=Be(R,()=>F({force:!0}).catch(()=>{})),M=We(G);return C()?F().catch(()=>{}):f?.manual||O(()=>{D.peek()==="loading"&&D.set("idle"),A.peek()!=="idle"&&A.set("idle")}),()=>{f&&!f.manual&&(f.controller.abort(),f=null),v(),M()}}),vt(()=>{f&&(f.controller.abort(),f=null)}),a&&typeof window<"u"&&K(()=>{let v=()=>{document.visibilityState==="visible"&&F().catch(()=>{})};return document.addEventListener("visibilitychange",v),()=>document.removeEventListener("visibilitychange",v)}),c&&K(()=>{let v=xe(setInterval(()=>{F().catch(()=>{})},c));return()=>clearInterval(v)}),{data:()=>E()??b,error:()=>T(),status:()=>k(),fetchStatus:()=>A(),isLoading:()=>k()==="loading",isError:()=>k()==="error",isSuccess:()=>k()==="success",isIdle:()=>k()==="idle",isFetching:()=>A()==="fetching",isEnabled:()=>C(),refetch:()=>F({force:!0,manual:!0})}}function Ur(e){let{queryKey:t,queryFn:n,getNextPageParam:r,getPreviousPageParam:o,initialPageParam:s,enabled:a=!0,select:c,retry:u=3,retryDelay:p=v=>Math.min(1e3*2**v,3e4),onSuccess:i,onError:h,onSettled:g}=e,_=wt(a),b=d([]),R=d([]),C=d(!0),S=d(!1),E=d(!1),T=d(!1),D=d(null),A=d(_.peek()?"loading":"idle"),k=ae(t),m=null;function f(){m&&(m.controller.abort(),m=null),O(()=>{b.set([]),R.set([]),C.set(!0),S.set(!1),E.set(!1),T.set(!1),D.set(null),A.set("idle")})}async function I(v,M="next",{replace:ie=!1,manual:J=!1}={}){m&&m.controller.abort();let j=new AbortController;m={controller:j,manual:J,direction:M};let{signal:l}=j,w=M==="next"?E:T;w.set(!0),b.peek().length===0&&A.set("loading");let x=0;try{for(;;)try{let y=await n({queryKey:Array.isArray(t)?t:[t],pageParam:v,signal:l});return l.aborted?void 0:(O(()=>{ie?(b.set([y]),R.set([v])):M==="next"?(b.set([...b.peek(),y]),R.set([...R.peek(),v])):(b.set([y,...b.peek()]),R.set([v,...R.peek()]));let q=r?.(y,b.peek());if(C.set(q!==void 0),o){let B=o(y,b.peek());S.set(B!==void 0)}D.set(null),A.set("success")}),i&&i(y),g&&g(y,null),y)}catch(y){if(l.aborted)return;if(x++,x<u){if(await new Promise((q,B)=>{let Se=xe(setTimeout(q,p(x)));l.addEventListener("abort",()=>{clearTimeout(Se),B(new DOMException("Aborted","AbortError"))},{once:!0})}).catch(q=>{if(q.name!=="AbortError")throw q}),l.aborted)return;continue}throw O(()=>{D.set(y),A.set("error")}),h&&h(y),g&&g(null,y),y}}finally{let y=m&&m.controller!==j?m:null;(!l.aborted||!y||y.direction!==M)&&w.set(!1),m&&m.controller===j&&(m=null)}}function F({manual:v=!1}={}){return I(s,"next",{replace:!0,manual:v})}let G=P(()=>{let v={pages:b(),pageParams:R()};return c?c(v):v});return K(()=>{let v=Be(k,()=>{_.peek()&&F().catch(()=>{})}),M=We(f);return _()?I(s,"next",{replace:!0}).catch(()=>{}):m?.manual||O(()=>{A.peek()==="loading"&&A.set("idle"),E.peek()&&E.set(!1),T.peek()&&T.set(!1)}),()=>{m&&!m.manual&&(m.controller.abort(),m=null),v(),M()}}),vt(()=>{m&&(m.controller.abort(),m=null)}),{data:()=>G(),error:()=>D(),status:()=>A(),isLoading:()=>A()==="loading",isError:()=>A()==="error",isSuccess:()=>A()==="success",isIdle:()=>A()==="idle",isFetching:()=>E()||T(),isEnabled:()=>_(),hasNextPage:()=>C(),hasPreviousPage:()=>S(),isFetchingNextPage:()=>E(),isFetchingPreviousPage:()=>T(),fetchNextPage:async()=>{let v=b.peek();if(v.length===0)return I(s,"next",{replace:!0,manual:!0});let M=r?.(v[v.length-1],v);if(M!==void 0)return I(M,"next",{manual:!0})},fetchPreviousPage:async()=>{let v=b.peek();if(v.length===0)return I(s,"previous",{replace:!0,manual:!0});let M=o?.(v[0],v);if(M!==void 0)return I(M,"previous",{manual:!0})},refetch:()=>F({manual:!0})}}function qe(){let e=new Set(U.keys());for(let t of X.keys())e.add(t);return e}function jr(e,t={}){let{hard:n=!1,exact:r=!1}=t,o=[];if(typeof e=="function")for(let s of qe())e(s)&&o.push(s);else if(Array.isArray(e)&&!r){let s=ae(e),a=s+":";for(let c of qe())(c===s||typeof c=="string"&&c.startsWith(a))&&o.push(c)}else o.push(ae(e));for(let s of o){Hr(s),n&&U.has(s)&&U.get(s).set(null);let a=X.get(s);if(a)for(let c of a)c()}}function qr(e,t){e=ae(e);let n=Ce(e);return t(e).then(r=>(n.set(r),z.set(e,Date.now()),r))}function Br(e,t){e=ae(e);let n=Ce(e),r=n.peek();n.set(typeof t=="function"?t(r):t),z.set(e,Date.now())}function Wr(e){return e=ae(e),U.has(e)?U.get(e).peek():void 0}function Yr(){O(()=>{for(let e of qe()){U.get(e)?.set(void 0),ee.get(e)?.set(null),te.get(e)?.set(!1);let t=X.get(e);t!==void 0&&t.size>0?z.set(e,Date.now()):(U.delete(e),ee.delete(e),te.delete(e),z.delete(e))}for(let e of je)e()}),Ee.clear(),ue.clear(),Ye.clear()}function Xr(){let e=[];for(let[t,n]of U)e.push({key:t,data:n.peek(),error:ee.has(t)?ee.get(t).peek():null,isValidating:te.has(t)?te.get(t).peek():!1});return e}function xt(e,t){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function zr(e,t){return typeof e!="function"?t:typeof t!="function"?e:function(...r){return e.apply(this,r),t.apply(this,r)}}function Qr(e,t){let n={...e},r=new Map;for(let o in n)De(o)&&r.set(o.slice(2).toLowerCase(),o);for(let o in t){let s=t[o];if(!De(o)){n[o]=s;continue}let a=r.get(o.slice(2).toLowerCase());if(a===void 0){n[o]=s,r.set(o.slice(2).toLowerCase(),o);continue}n[a]=zr(s,n[a])}return n}function Kr(e={}){let t=W?.();if(t){let n=t.hookIndex++;return t.hooks[n]||(t.hooks[n]=Et(e)),t.hooks[n]}return Et(e)}function Et(e={}){let{defaultValues:t={},mode:n="onSubmit",reValidateMode:r="onChange",resolver:o}=e,s={},a={},c={},u=d({});function p(l){return s[l]||(s[l]=d(t[l]??"")),s[l]}function i(l){return a[l]||(a[l]=d(null)),a[l]}function h(l){return c[l]||(c[l]=d(!1)),c[l]}let g=d(!1),_=d(!1),b=d(!1),R=d(!1),C=d(0);function S(l=!1){let w={...t};for(let[x,y]of Object.entries(s))w[x]=l?y():y.peek();return w}function E(l=!1){return l?u():u.peek()}function T(l,w){let x=w??null;i(l).set(x),u.set(y=>{if(y[l]===x)return y;if(x==null){if(!Object.prototype.hasOwnProperty.call(y,l))return y;let B={...y};return delete B[l],B}return{...y,[l]:x}})}function D(l={}){let w=l||{};O(()=>{for(let[x,y]of Object.entries(a))Object.prototype.hasOwnProperty.call(w,x)||y.set(null);for(let[x,y]of Object.entries(w))i(x).set(y??null);u.set({...w})})}let A=P(()=>Object.keys(E(!0)).length===0),k=P(()=>{let l={};for(let[w,x]of Object.entries(s))x()!==(t[w]??"")&&(l[w]=!0);return l});async function m(l){if(!o)return!0;R.set(!0);try{let x=(await o(S(!1)))?.errors||{};if(l){let y=x[l]??null;return T(l,y),!y}else return D(x),Object.keys(x).length===0}finally{R.set(!1)}}function f(l,w={}){let x=p(l),y=w.type==="radio",q=w.type==="checkbox",B=y&&w.value!==void 0;function Se($){if(B)return w.value;if($)return typeof $.hasAttribute=="function"?$.hasAttribute("value")?$.value:void 0:$.value}let Qe=!1,Ke=!1,Te=$=>{let H=$&&$.target;if(!H){L&&console.warn(`[what] register("${l}") change handler was called without an event. Pass the DOM event through (or call form.setValue() directly). Ignoring.`);return}let he=w.type||H.type,ne;if(he==="radio"){if(ne=Se(H),ne===void 0){L&&!Qe&&(Qe=!0,console.warn(`[what] register("${l}", { type: 'radio' }) cannot tell which value this radio contributes: pass { value } or give the <input> a value attribute. Field left unchanged.`));return}}else he==="checkbox"?ne=H.checked:ne=H.value;I(l,ne),(n==="onChange"||b.peek()&&r==="onChange")&&m(l)},Q={name:l,onBlur:()=>{h(l).set(!0),(n==="onBlur"||b.peek()&&r==="onBlur")&&m(l)},onFocus:()=>{},ref:w.ref};if(y){let $=B?()=>x()===w.value:()=>!1;B&&(Q.value=w.value),Q.checked=$,Q.onchange=Te,Q.ref=H=>{if(xt(w.ref,H),!H||typeof H!="object")return;H._propEffects||(H._propEffects={});let he="checked:property";if(H._propEffects[he])try{H._propEffects[he]()}catch{}H._propEffects[he]=V(()=>{let ne=Se(H);H.checked=ne!==void 0&&x()===ne})}}else q?(Object.defineProperty(Q,"checked",{get(){return!!x()},enumerable:!0}),Q.onchange=Te):(Object.defineProperty(Q,"value",{get(){return x()},enumerable:!0}),Q.oninput=Te,Q.ref=$=>{xt(w.ref,$),L&&!Ke&&$&&$.type==="radio"&&(Ke=!0,console.warn(`[what] register("${l}") was spread onto <input type="radio"> without a type. Radios in a group share one field holding the SELECTED option, so the registration must be told this radio's value: register("${l}", { type: 'radio', value: ... }), or use <Radio name value register />. As written, the registration overwrote the input's own value and the group cannot record a choice.`))});return Q}function I(l,w,x={}){let{shouldValidate:y=!1,shouldDirty:q=!0}=x;p(l).set(w),q&&g.set(!0),y&&m(l)}function F(l){return p(l)()}function G(l,w){T(l,w)}function v(l){T(l,null)}function M(){D({})}function ie(l=t){O(()=>{for(let[w,x]of Object.entries(s))x.set(l[w]??"");for(let w of Object.values(a))w.set(null);u.set({});for(let w of Object.values(c))w.set(!1);g.set(!1),b.set(!1)})}function J(l,w){return async x=>{x&&x.preventDefault(),_.set(!0),b.set(!0),C.set(C.peek()+1);try{await m()?await l(S()):w&&w(E(!1))}finally{_.set(!1)}}}function j(l){return l?P(()=>p(l)()):P(()=>S(!0))}return{register:f,handleSubmit:J,setValue:I,getValue:F,setError:G,clearError:v,clearErrors:M,reset:ie,watch:j,validate:m,formState:{get values(){return S(!0)},get errors(){return E(!0)},error:l=>i(l)(),get touched(){let l={};for(let[w,x]of Object.entries(c))x()&&(l[w]=!0);return l},isDirty:()=>g(),isValid:A,isValidating:()=>R(),isSubmitting:()=>_(),isSubmitted:()=>b(),submitCount:()=>C(),dirtyFields:k}}}function Jr(e){return!e||typeof e!="object"?null:Array.isArray(e.issues)?e.issues:Array.isArray(e.errors)?e.errors:null}function Zr(e){let t=e?.path;if(t==null)return"";if(!Array.isArray(t))return String(t);let n="";for(let r=0;r<t.length;r++){let o=t[r];n+=(r?".":"")+(typeof o=="symbol"?o.toString():String(o))}return n}function eo(e){return async t=>{try{return{values:await e.parseAsync(t),errors:{}}}catch(n){let r=Jr(n);if(!r)throw n;let o={};for(let s of r){let a=Zr(s);o[a]||(o[a]={type:s.code??"validation",message:s.message})}return Object.keys(o).length===0&&(o[""]={type:"validation",message:n?.message||"Validation failed"}),{values:{},errors:o}}}}function to(e){return!e||typeof e!="object"?!1:e.name==="ValidationError"||Array.isArray(e.inner)}function no(e){return async t=>{try{return{values:await e.validate(t,{abortEarly:!1}),errors:{}}}catch(n){if(!to(n))throw n;let r={},o=Array.isArray(n.inner)&&n.inner.length>0?n.inner:[n];for(let s of o){let a=s.path??"";r[a]||(r[a]={type:s.type??"validation",message:s.message})}return{values:{},errors:r}}}}function ro(e){return async t=>{let n={};for(let[r,o]of Object.entries(e)){let s=t[r];for(let a of o){let c=a(s,t);if(c){n[r]={type:"validation",message:c};break}}}return{values:t,errors:n}}}var oo={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 so(e,t={}){let{validate:n,defaultValue:r=""}=t,o=d(r),s=d(null),a=d(!1),c=d(!1);async function u(){if(!n)return!0;let p=await n(o.peek());return s.set(p||null),!p}return{name:e,value:()=>o(),error:()=>s(),isTouched:()=>a(),isDirty:()=>c(),setValue:p=>{o.set(p),c.set(!0)},setError:p=>s.set(p),validate:u,reset:()=>{o.set(r),s.set(null),a.set(!1),c.set(!1)},inputProps:()=>({name:e,value:o(),onInput:p=>{o.set(p.target.value),c.set(!0)},onBlur:()=>{a.set(!0),u()}})}}function ao(e){let{register:t,error:n,...r}=e,o=t?t(e.name):{};return N("input",{...r,...o,"aria-invalid":n?"true":void 0})}function io(e){let{register:t,error:n,...r}=e,o=t?t(e.name):{};return N("textarea",{...r,...o,"aria-invalid":n?"true":void 0})}function co(e){let{register:t,error:n,children:r,...o}=e,s=t?t(e.name):{};return N("select",{...o,...s,"aria-invalid":n?"true":void 0},r)}function lo(e){let{register:t,...n}=e,r=t?t(e.name):{};return N("input",{type:"checkbox",...n,...r,checked:r.value})}function uo(e){let{register:t,value:n,...r}=e;if(n===void 0)return L&&console.warn(`[what] <Radio name="${e.name}"> is missing a \`value\` prop. Radios in a group share one field holding the selected option's value, so a valueless radio has nothing to contribute and cannot be checked. Rendering it unregistered.`),N("input",{type:"radio",...r});let o=t?t(e.name,{type:"radio",value:n,ref:r.ref}):{};return N("input",Qr({type:"radio",value:n,...r},o))}function fo({name:e,formState:t,errors:n,render:r}){let o=t&&typeof t.error=="function"?t.error(e):(t?.errors!=null?t.errors:typeof n=="function"?n():n)?.[e]||null;return o?r?r({message:o.message,type:o.type}):N("span",{class:"what-error",role:"alert"},o.message):null}var ze={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:
53
+ `,pt=!1;function le(){if(pt||typeof document>"u")return;pt=!0;let e=document.createElement("style");e.textContent=Ar,document.head.appendChild(e)}function Ve({width:e,height:t,variant:n="shimmer",circle:r=!1,class:o,style:s,count:a=1}){le();let c=`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""} ${n==="wave"?"what-skeleton-wave":""}`,u=o?`${c} ${o}`:c,p={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,borderRadius:r?"50%":void 0,...s};return a===1?N("div",{class:u,style:p,"aria-hidden":"true"}):Array.from({length:a},(i,h)=>N("div",{key:h,class:u,style:{...p,marginBottom:h<a-1?"8px":void 0},"aria-hidden":"true"}))}function je({lines:e=3,lastLineWidth:t="60%",lineHeight:n=16,gap:r=8,variant:o="shimmer"}){return le(),N("div",{class:"what-skeleton-text","aria-hidden":"true"},Array.from({length:e},(s,a)=>N("div",{key:a,class:`what-skeleton ${o==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${n}px`,width:a===e-1?t:"100%",marginBottom:a<e-1?`${r}px`:void 0}})))}function Ir({size:e=40,variant:t="shimmer"}){return Ve({width:e,height:e,circle:!0,variant:t})}function ht({imageHeight:e=200,lines:t=3,variant:n="shimmer"}){return le(),N("div",{class:"what-skeleton-card","aria-hidden":"true"},N("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${e}px`,width:"100%",marginBottom:"16px"}}),N("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"24px",width:"70%",marginBottom:"12px"}}),je({lines:t,variant:n}))}function Tr({rows:e=5,columns:t=4,variant:n="shimmer"}){return le(),N("div",{class:"what-skeleton-table","aria-hidden":"true"},N("div",{style:{display:"flex",gap:"16px",marginBottom:"16px"}},Array.from({length:t},(r,o)=>N("div",{key:o,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"20px",flex:1}}))),Array.from({length:e},(r,o)=>N("div",{key:o,style:{display:"flex",gap:"16px",marginBottom:o<e-1?"12px":void 0}},Array.from({length:t},(s,a)=>N("div",{key:a,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"16px",flex:1}})))))}function Nr({type:e="default",height:t,children:n}){return le(),e==="card"?ht({}):e==="text"?je({}):n||N("div",{class:"what-skeleton what-island-skeleton",style:{height:typeof t=="number"?`${t}px`:t||"100px",width:"100%"},"aria-hidden":"true"})}function Dr(e,t=[]){let n=d(!0),r=d(null),o=d(null);return $(()=>{n.set(!0),o.set(null),Promise.resolve(e()).then(s=>{r.set(s),n.set(!1)}).catch(s=>{o.set(s),n.set(!1)})}),{isLoading:()=>n(),data:()=>r(),error:()=>o(),Skeleton:s=>n()?Ve(s):null}}function Or({width:e="100%",height:t=100,label:n="Loading...",showLabel:r=!1,variant:o="shimmer"}){return le(),N("div",{class:`what-skeleton ${o==="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&&N("span",{style:{color:"var(--skeleton-text, #999)",fontSize:"14px"}},n))}function Lr({size:e=8,color:t="#666"}){le();let n={width:`${e}px`,height:`${e}px`,borderRadius:"50%",backgroundColor:t,animation:"what-skeleton-pulse 1s infinite ease-in-out"};return N("div",{class:"what-loading-dots",style:{display:"flex",gap:`${e/2}px`},"aria-label":"Loading",role:"status"},N("div",{style:{...n,animationDelay:"0s"}}),N("div",{style:{...n,animationDelay:"0.2s"}}),N("div",{style:{...n,animationDelay:"0.4s"}}))}function Mr({size:e=24,color:t="#666",strokeWidth:n=2}){return N("svg",{width:e,height:e,viewBox:"0 0 24 24",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading",role:"status"},N("style",null,"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"),N("circle",{cx:12,cy:12,r:10,stroke:t,strokeWidth:n,fill:"none",strokeDasharray:"31.4 31.4",strokeLinecap:"round"}))}var j=new Map,ee=new Map,te=new Map,z=new Map,gt=200;function ae(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:JSON.stringify(t)??String(t)).map(t=>t.replace(/([\\:])/g,"\\$1")).join(":"):e}function Re(e){return z.set(e,Date.now()),j.has(e)||(j.set(e,d(null)),j.size>gt&&Pr()),j.get(e)}function mt(e){return ee.has(e)||ee.set(e,d(null)),ee.get(e)}function Fr(e){return te.has(e)||te.set(e,d(!1)),te.get(e)}function Pr(){let e=[...z.entries()].sort((n,r)=>n[1]-r[1]),t=Math.floor(gt*.2);for(let n=0;n<t&&n<e.length;n++){let r=e[n][0];Y.has(r)&&Y.get(r).size>0||(j.delete(r),ee.delete(r),te.delete(r),z.delete(r),Ee.delete(r))}}var Y=new Map;function Be(e,t){return Y.has(e)||Y.set(e,new Set),Y.get(e).add(t),()=>{let n=Y.get(e);n&&(n.delete(t),n.size===0&&Y.delete(e))}}var Ue=new Set;function We(e){return Ue.add(e),()=>Ue.delete(e)}var ue=new Map,Ee=new Map,Xe=new Map;function yt(e){return Xe.get(e)||0}function Hr(e){Xe.set(e,yt(e)+1)}function xe(e){return e&&typeof e.unref=="function"&&e.unref(),e}function K(e){let t=W?.(),n=$(e);return t&&t.effects.push(n),n}function vt(e){let t=W?.();t&&t.effects.push(e)}function wt(e){let t=typeof e=="function"?e:()=>e,n=d(ce(()=>!!t()));return K(()=>{n.set(!!t())}),n}function Gr(e,t={}){let{method:n="GET",body:r,headers:o={},transform:s=g=>g,initialData:a=null}=t,c=d(a),u=d(null),p=d(!0),i=null;async function h(){i&&i.abort(),i=new AbortController;let{signal:g}=i;p.set(!0),u.set(null);try{let b=await fetch(e,{method:n,headers:{"Content-Type":"application/json",...o},body:r?JSON.stringify(r):void 0,signal:g});if(!b.ok)throw new Error(`HTTP ${b.status}: ${b.statusText}`);let S=await b.json();g.aborted||c.set(s(S))}catch(b){g.aborted||u.set(b)}finally{g.aborted||p.set(!1)}}return K(()=>(h(),()=>{i&&i.abort()})),{data:()=>c(),error:()=>u(),isLoading:()=>p(),refetch:h,mutate:g=>c.set(g)}}function $r(e,t,n={}){let{revalidateOnFocus:r=!0,revalidateOnReconnect:o=!0,refreshInterval:s=0,dedupingInterval:a=2e3,fallbackData:c,onSuccess:u,onError:p}=n;if(e==null||e===!1){let v=d(c||null),T=d(null);return{data:()=>v(),error:()=>T(),isLoading:()=>!1,isValidating:()=>!1,mutate:D=>v.set(typeof D=="function"?D(v()):D),revalidate:()=>Promise.resolve()}}let i=ae(e),h=Re(i),g=mt(i),b=Fr(i),S=P(()=>h()??c??null),I=P(()=>{let v=h()==null,T=b();return v&&T}),R=null;async function k({force:v=!1}={}){let T=Date.now(),D=yt(i);if(ue.has(i)){let f=ue.get(i);if(v?f.epoch===D:T-f.timestamp<a)return f.refCount++,f.promise}let C=Ee.get(i);if(!v&&C&&T-C<a&&h.peek()!=null)return h.peek();if(R){let f=ue.get(i);(!f||f.refCount<=1)&&R.abort()}R=new AbortController;let{signal:_}=R;b.set(!0);let m=t(e,{signal:_});ue.set(i,{promise:m,timestamp:T,refCount:1,epoch:D});try{let f=await m;return _.aborted?void 0:(O(()=>{h.set(f),g.set(null)}),z.set(i,Date.now()),Ee.set(i,Date.now()),u&&u(f,e),f)}catch(f){if(_.aborted)return;throw g.set(f),p&&p(f,e),f}finally{_.aborted||b.set(!1);let f=ue.get(i);f&&(f.refCount--,f.refCount<=0&&ue.delete(i))}}return K(()=>{let v=Be(i,()=>k({force:!0}).catch(()=>{})),T=We(()=>{R&&(R.abort(),R=null)});return k().catch(()=>{}),()=>{R&&R.abort(),v(),T()}}),r&&typeof window<"u"&&K(()=>{let v=()=>{document.visibilityState==="visible"&&k().catch(()=>{})};return document.addEventListener("visibilitychange",v),()=>document.removeEventListener("visibilitychange",v)}),o&&typeof window<"u"&&K(()=>{let v=()=>k().catch(()=>{});return window.addEventListener("online",v),()=>window.removeEventListener("online",v)}),s>0&&K(()=>{let v=xe(setInterval(()=>{k().catch(()=>{})},s));return()=>clearInterval(v)}),{data:()=>S(),error:()=>g(),isLoading:()=>I(),isValidating:()=>b(),mutate:(v,T=!0)=>{let D=typeof v=="function"?v(h.peek()):v;h.set(D),z.set(i,Date.now()),T&&k().catch(()=>{})},revalidate:k}}function Vr(e){let{queryKey:t,queryFn:n,enabled:r=!0,staleTime:o=0,cacheTime:s=300*1e3,refetchOnWindowFocus:a=!0,refetchInterval:c=!1,retry:u=3,retryDelay:p=w=>Math.min(1e3*2**w,3e4),onSuccess:i,onError:h,onSettled:g,select:b,placeholderData:S}=e,I=ae(t),R=wt(r),k=Re(I),v=P(()=>{let w=k();return b&&w!=null?b(w):w}),T=mt(I),D=d(k.peek()!=null?"success":R.peek()?"loading":"idle"),C=d("idle"),_=P(()=>{let w=D(),M=k()!=null,ie=T()!=null,J=C()==="fetching";return w==="success"&&!M||w==="error"&&!ie?J?"loading":"idle":w}),m=0,f=null,A=null;async function F({force:w=!1,manual:M=!1}={}){if(!M&&!R.peek())return;let ie=Date.now();if(!w&&k.peek()!=null&&ie-m<o)return k.peek();f&&f.controller.abort();let J=new AbortController;f={controller:J,manual:M};let{signal:U}=J;C.set("fetching"),k.peek()==null&&D.set("loading");let l=0;async function x(){try{let E=await n({queryKey:Array.isArray(t)?t:[t],signal:U});return U.aborted?void 0:(O(()=>{k.set(E),T.set(null),D.set("success"),C.set("idle")}),m=Date.now(),z.set(I,Date.now()),i&&i(E),g&&g(E,null),A&&clearTimeout(A),A=xe(setTimeout(()=>{if(Date.now()-m>=s){let y=Y.get(I);(!y||y.size===0)&&(j.delete(I),ee.delete(I),te.delete(I),z.delete(I),Ee.delete(I))}},s)),E)}catch(E){if(U.aborted)return;if(l++,l<u)return await new Promise((y,q)=>{let B=xe(setTimeout(y,p(l)));U.addEventListener("abort",()=>{clearTimeout(B),q(new DOMException("Aborted","AbortError"))},{once:!0})}).catch(y=>{if(y.name!=="AbortError")throw y}),U.aborted?void 0:x();throw O(()=>{T.set(E),D.set("error"),C.set("idle")}),h&&h(E),g&&g(null,E),E}}try{return await x()}finally{f&&f.controller===J&&(f=null)}}function G(){f&&(f.controller.abort(),f=null),O(()=>{D.peek()!=="idle"&&D.set("idle"),C.peek()!=="idle"&&C.set("idle")})}return K(()=>{let w=Be(I,()=>F({force:!0}).catch(()=>{})),M=We(G);return R()?F().catch(()=>{}):f?.manual||O(()=>{D.peek()==="loading"&&D.set("idle"),C.peek()!=="idle"&&C.set("idle")}),()=>{f&&!f.manual&&(f.controller.abort(),f=null),w(),M()}}),vt(()=>{f&&(f.controller.abort(),f=null)}),a&&typeof window<"u"&&K(()=>{let w=()=>{document.visibilityState==="visible"&&F().catch(()=>{})};return document.addEventListener("visibilitychange",w),()=>document.removeEventListener("visibilitychange",w)}),c&&K(()=>{let w=xe(setInterval(()=>{F().catch(()=>{})},c));return()=>clearInterval(w)}),{data:()=>v()??S,error:()=>T(),status:()=>_(),fetchStatus:()=>C(),isLoading:()=>_()==="loading",isError:()=>_()==="error",isSuccess:()=>_()==="success",isIdle:()=>_()==="idle",isFetching:()=>C()==="fetching",isEnabled:()=>R(),refetch:()=>F({force:!0,manual:!0})}}function jr(e){let{queryKey:t,queryFn:n,getNextPageParam:r,getPreviousPageParam:o,initialPageParam:s,enabled:a=!0,select:c,retry:u=3,retryDelay:p=w=>Math.min(1e3*2**w,3e4),onSuccess:i,onError:h,onSettled:g}=e,b=wt(a),S=d([]),I=d([]),R=d(!0),k=d(!1),v=d(!1),T=d(!1),D=d(null),C=d(b.peek()?"loading":"idle"),_=ae(t),m=null;function f(){m&&(m.controller.abort(),m=null),O(()=>{S.set([]),I.set([]),R.set(!0),k.set(!1),v.set(!1),T.set(!1),D.set(null),C.set("idle")})}async function A(w,M="next",{replace:ie=!1,manual:J=!1}={}){m&&m.controller.abort();let U=new AbortController;m={controller:U,manual:J,direction:M};let{signal:l}=U,x=M==="next"?v:T;x.set(!0),S.peek().length===0&&C.set("loading");let E=0;try{for(;;)try{let y=await n({queryKey:Array.isArray(t)?t:[t],pageParam:w,signal:l});return l.aborted?void 0:(O(()=>{ie?(S.set([y]),I.set([w])):M==="next"?(S.set([...S.peek(),y]),I.set([...I.peek(),w])):(S.set([y,...S.peek()]),I.set([w,...I.peek()]));let q=r?.(y,S.peek());if(R.set(q!==void 0),o){let B=o(y,S.peek());k.set(B!==void 0)}D.set(null),C.set("success")}),i&&i(y),g&&g(y,null),y)}catch(y){if(l.aborted)return;if(E++,E<u){if(await new Promise((q,B)=>{let _e=xe(setTimeout(q,p(E)));l.addEventListener("abort",()=>{clearTimeout(_e),B(new DOMException("Aborted","AbortError"))},{once:!0})}).catch(q=>{if(q.name!=="AbortError")throw q}),l.aborted)return;continue}throw O(()=>{D.set(y),C.set("error")}),h&&h(y),g&&g(null,y),y}}finally{let y=m&&m.controller!==U?m:null;(!l.aborted||!y||y.direction!==M)&&x.set(!1),m&&m.controller===U&&(m=null)}}function F({manual:w=!1}={}){return A(s,"next",{replace:!0,manual:w})}let G=P(()=>{let w={pages:S(),pageParams:I()};return c?c(w):w});return K(()=>{let w=Be(_,()=>{b.peek()&&F().catch(()=>{})}),M=We(f);return b()?A(s,"next",{replace:!0}).catch(()=>{}):m?.manual||O(()=>{C.peek()==="loading"&&C.set("idle"),v.peek()&&v.set(!1),T.peek()&&T.set(!1)}),()=>{m&&!m.manual&&(m.controller.abort(),m=null),w(),M()}}),vt(()=>{m&&(m.controller.abort(),m=null)}),{data:()=>G(),error:()=>D(),status:()=>C(),isLoading:()=>C()==="loading",isError:()=>C()==="error",isSuccess:()=>C()==="success",isIdle:()=>C()==="idle",isFetching:()=>v()||T(),isEnabled:()=>b(),hasNextPage:()=>R(),hasPreviousPage:()=>k(),isFetchingNextPage:()=>v(),isFetchingPreviousPage:()=>T(),fetchNextPage:async()=>{let w=S.peek();if(w.length===0)return A(s,"next",{replace:!0,manual:!0});let M=r?.(w[w.length-1],w);if(M!==void 0)return A(M,"next",{manual:!0})},fetchPreviousPage:async()=>{let w=S.peek();if(w.length===0)return A(s,"previous",{replace:!0,manual:!0});let M=o?.(w[0],w);if(M!==void 0)return A(M,"previous",{manual:!0})},refetch:()=>F({manual:!0})}}function qe(){let e=new Set(j.keys());for(let t of Y.keys())e.add(t);return e}function Ur(e,t={}){let{hard:n=!1,exact:r=!1}=t,o=[];if(typeof e=="function")for(let s of qe())e(s)&&o.push(s);else if(Array.isArray(e)&&!r){let s=ae(e),a=s+":";for(let c of qe())(c===s||typeof c=="string"&&c.startsWith(a))&&o.push(c)}else o.push(ae(e));for(let s of o){Hr(s),n&&j.has(s)&&j.get(s).set(null);let a=Y.get(s);if(a)for(let c of a)c()}}function qr(e,t){e=ae(e);let n=Re(e);return t(e).then(r=>(n.set(r),z.set(e,Date.now()),r))}function Br(e,t){e=ae(e);let n=Re(e),r=n.peek();n.set(typeof t=="function"?t(r):t),z.set(e,Date.now())}function Wr(e){return e=ae(e),j.has(e)?j.get(e).peek():void 0}function Xr(){O(()=>{for(let e of qe()){j.get(e)?.set(void 0),ee.get(e)?.set(null),te.get(e)?.set(!1);let t=Y.get(e);t!==void 0&&t.size>0?z.set(e,Date.now()):(j.delete(e),ee.delete(e),te.delete(e),z.delete(e))}for(let e of Ue)e()}),Ee.clear(),ue.clear(),Xe.clear()}function Yr(){let e=[];for(let[t,n]of j)e.push({key:t,data:n.peek(),error:ee.has(t)?ee.get(t).peek():null,isValidating:te.has(t)?te.get(t).peek():!1});return e}function xt(e,t){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function zr(e,t){return typeof e!="function"?t:typeof t!="function"?e:function(...r){return e.apply(this,r),t.apply(this,r)}}function Qr(e,t){let n={...e},r=new Map;for(let o in n)Ne(o)&&r.set(o.slice(2).toLowerCase(),o);for(let o in t){let s=t[o];if(!Ne(o)){n[o]=s;continue}let a=r.get(o.slice(2).toLowerCase());if(a===void 0){n[o]=s,r.set(o.slice(2).toLowerCase(),o);continue}n[a]=zr(s,n[a])}return n}function Kr(e={}){let t=W?.();if(t){let n=t.hookIndex++;return t.hooks[n]||(t.hooks[n]=Et(e)),t.hooks[n]}return Et(e)}function Et(e={}){let{defaultValues:t={},mode:n="onSubmit",reValidateMode:r="onChange",resolver:o}=e,s={},a={},c={},u=d({});function p(l){return s[l]||(s[l]=d(t[l]??"")),s[l]}function i(l){return a[l]||(a[l]=d(null)),a[l]}function h(l){return c[l]||(c[l]=d(!1)),c[l]}let g=d(!1),b=d(!1),S=d(!1),I=d(!1),R=d(0);function k(l=!1){let x={...t};for(let[E,y]of Object.entries(s))x[E]=l?y():y.peek();return x}function v(l=!1){return l?u():u.peek()}function T(l,x){let E=x??null;i(l).set(E),u.set(y=>{if(y[l]===E)return y;if(E==null){if(!Object.prototype.hasOwnProperty.call(y,l))return y;let B={...y};return delete B[l],B}return{...y,[l]:E}})}function D(l={}){let x=l||{};O(()=>{for(let[E,y]of Object.entries(a))Object.prototype.hasOwnProperty.call(x,E)||y.set(null);for(let[E,y]of Object.entries(x))i(E).set(y??null);u.set({...x})})}let C=P(()=>Object.keys(v(!0)).length===0),_=P(()=>{let l={};for(let[x,E]of Object.entries(s))E()!==(t[x]??"")&&(l[x]=!0);return l});async function m(l){if(!o)return!0;I.set(!0);try{let E=(await o(k(!1)))?.errors||{};if(l){let y=E[l]??null;return T(l,y),!y}else return D(E),Object.keys(E).length===0}finally{I.set(!1)}}function f(l,x={}){let E=p(l),y=x.type==="radio",q=x.type==="checkbox",B=y&&x.value!==void 0;function _e(V){if(B)return x.value;if(V)return typeof V.hasAttribute=="function"?V.hasAttribute("value")?V.value:void 0:V.value}let Qe=!1,Ke=!1,Ie=V=>{let H=V&&V.target;if(!H){L&&console.warn(`[what] register("${l}") change handler was called without an event. Pass the DOM event through (or call form.setValue() directly). Ignoring.`);return}let he=x.type||H.type,ne;if(he==="radio"){if(ne=_e(H),ne===void 0){L&&!Qe&&(Qe=!0,console.warn(`[what] register("${l}", { type: 'radio' }) cannot tell which value this radio contributes: pass { value } or give the <input> a value attribute. Field left unchanged.`));return}}else he==="checkbox"?ne=H.checked:ne=H.value;A(l,ne),(n==="onChange"||S.peek()&&r==="onChange")&&m(l)},Q={name:l,onBlur:()=>{h(l).set(!0),(n==="onBlur"||S.peek()&&r==="onBlur")&&m(l)},onFocus:()=>{},ref:x.ref};if(y){let V=B?()=>E()===x.value:()=>!1;B&&(Q.value=x.value),Q.checked=V,Q.onchange=Ie,Q.ref=H=>{if(xt(x.ref,H),!H||typeof H!="object")return;H._propEffects||(H._propEffects={});let he="checked:property";if(H._propEffects[he])try{H._propEffects[he]()}catch{}H._propEffects[he]=$(()=>{let ne=_e(H);H.checked=ne!==void 0&&E()===ne})}}else q?(Object.defineProperty(Q,"checked",{get(){return!!E()},enumerable:!0}),Q.onchange=Ie):(Object.defineProperty(Q,"value",{get(){return E()},enumerable:!0}),Q.oninput=Ie,Q.ref=V=>{xt(x.ref,V),L&&!Ke&&V&&V.type==="radio"&&(Ke=!0,console.warn(`[what] register("${l}") was spread onto <input type="radio"> without a type. Radios in a group share one field holding the SELECTED option, so the registration must be told this radio's value: register("${l}", { type: 'radio', value: ... }), or use <Radio name value register />. As written, the registration overwrote the input's own value and the group cannot record a choice.`))});return Q}function A(l,x,E={}){let{shouldValidate:y=!1,shouldDirty:q=!0}=E;p(l).set(x),q&&g.set(!0),y&&m(l)}function F(l){return p(l)()}function G(l,x){T(l,x)}function w(l){T(l,null)}function M(){D({})}function ie(l=t){O(()=>{for(let[x,E]of Object.entries(s))E.set(l[x]??"");for(let x of Object.values(a))x.set(null);u.set({});for(let x of Object.values(c))x.set(!1);g.set(!1),S.set(!1)})}function J(l,x){return async E=>{E&&E.preventDefault(),b.set(!0),S.set(!0),R.set(R.peek()+1);try{await m()?await l(k()):x&&x(v(!1))}finally{b.set(!1)}}}function U(l){return l?P(()=>p(l)()):P(()=>k(!0))}return{register:f,handleSubmit:J,setValue:A,getValue:F,setError:G,clearError:w,clearErrors:M,reset:ie,watch:U,validate:m,formState:{get values(){return k(!0)},get errors(){return v(!0)},error:l=>i(l)(),get touched(){let l={};for(let[x,E]of Object.entries(c))E()&&(l[x]=!0);return l},isDirty:()=>g(),isValid:C,isValidating:()=>I(),isSubmitting:()=>b(),isSubmitted:()=>S(),submitCount:()=>R(),dirtyFields:_}}}function Jr(e){return!e||typeof e!="object"?null:Array.isArray(e.issues)?e.issues:Array.isArray(e.errors)?e.errors:null}function Zr(e){let t=e?.path;if(t==null)return"";if(!Array.isArray(t))return String(t);let n="";for(let r=0;r<t.length;r++){let o=t[r];n+=(r?".":"")+(typeof o=="symbol"?o.toString():String(o))}return n}function eo(e){return async t=>{try{return{values:await e.parseAsync(t),errors:{}}}catch(n){let r=Jr(n);if(!r)throw n;let o={};for(let s of r){let a=Zr(s);o[a]||(o[a]={type:s.code??"validation",message:s.message})}return Object.keys(o).length===0&&(o[""]={type:"validation",message:n?.message||"Validation failed"}),{values:{},errors:o}}}}function to(e){return!e||typeof e!="object"?!1:e.name==="ValidationError"||Array.isArray(e.inner)}function no(e){return async t=>{try{return{values:await e.validate(t,{abortEarly:!1}),errors:{}}}catch(n){if(!to(n))throw n;let r={},o=Array.isArray(n.inner)&&n.inner.length>0?n.inner:[n];for(let s of o){let a=s.path??"";r[a]||(r[a]={type:s.type??"validation",message:s.message})}return{values:{},errors:r}}}}function ro(e){return async t=>{let n={};for(let[r,o]of Object.entries(e)){let s=t[r];for(let a of o){let c=a(s,t);if(c){n[r]={type:"validation",message:c};break}}}return{values:t,errors:n}}}var oo={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 so(e,t={}){let{validate:n,defaultValue:r=""}=t,o=d(r),s=d(null),a=d(!1),c=d(!1);async function u(){if(!n)return!0;let p=await n(o.peek());return s.set(p||null),!p}return{name:e,value:()=>o(),error:()=>s(),isTouched:()=>a(),isDirty:()=>c(),setValue:p=>{o.set(p),c.set(!0)},setError:p=>s.set(p),validate:u,reset:()=>{o.set(r),s.set(null),a.set(!1),c.set(!1)},inputProps:()=>({name:e,value:o(),onInput:p=>{o.set(p.target.value),c.set(!0)},onBlur:()=>{a.set(!0),u()}})}}function ao(e){let{register:t,error:n,...r}=e,o=t?t(e.name):{};return N("input",{...r,...o,"aria-invalid":n?"true":void 0})}function io(e){let{register:t,error:n,...r}=e,o=t?t(e.name):{};return N("textarea",{...r,...o,"aria-invalid":n?"true":void 0})}function co(e){let{register:t,error:n,children:r,...o}=e,s=t?t(e.name):{};return N("select",{...o,...s,"aria-invalid":n?"true":void 0},r)}function lo(e){let{register:t,...n}=e,r=t?t(e.name):{};return N("input",{type:"checkbox",...n,...r,checked:r.value})}function uo(e){let{register:t,value:n,...r}=e;if(n===void 0)return L&&console.warn(`[what] <Radio name="${e.name}"> is missing a \`value\` prop. Radios in a group share one field holding the selected option's value, so a valueless radio has nothing to contribute and cannot be checked. Rendering it unregistered.`),N("input",{type:"radio",...r});let o=t?t(e.name,{type:"radio",value:n,ref:r.ref}):{};return N("input",Qr({type:"radio",value:n,...r},o))}function fo({name:e,formState:t,errors:n,render:r}){let o=t&&typeof t.error=="function"?t.error(e):(t?.errors!=null?t.errors:typeof n=="function"?n():n)?.[e]||null;return o?r?r({message:o.message,type:o.type}):N("span",{class:"what-error",role:"alert"},o.message):null}var ze={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:
54
54
  effect(() => { count(count() + 1); });
55
55
 
56
56
  // Good \u2014 use untrack() so the read doesn't subscribe:
@@ -141,7 +141,18 @@ export const save = action(async (data) => {
141
141
  function Row() { return { name: 'a' }; }
142
142
 
143
143
  // Good \u2014 return elements, and interpolate values as children:
144
- function Row({ name }) { return <li>{name}</li>; }`},FORM_ACTION_NOT_REGISTERED:{code:"ERR_FORM_ACTION_NOT_REGISTERED",severity:"error",template:"[what] <Form action={fn}>: that function is not a server action.",suggestion:"Wrap it with action() from what-server, or pass the action id as a string. A plain function has no id, so there is nothing for the form post to address.",codeExample:`// Bad \u2014 a plain function:
144
+ function Row({ name }) { return <li>{name}</li>; }`},COMPILED_JSX_IN_SSR:{code:"ERR_COMPILED_JSX_IN_SSR",severity:"error",template:"what-compiler output cannot be server-rendered: {{file}}.",suggestion:'what-compiler lowers JSX to module-scope _$template() calls that run document.createElement() at import time, and to _$createComponent() which builds DOM. Neither has a server-rendered form, so a module it compiled throws "document is not defined" when a server imports it. Server-rendered views have two supported spellings: author them with h(), or compile them with the automatic JSX runtime (jsxImportSource: "what-framework"), which emits h() calls that renderToString understands. what-compiler stays on the client entry, where the fine-grained output is the point.',codeExample:`// Bad \u2014 a server module compiled by what-compiler:
145
+ // vite.config.js: plugins: [what()] + vite build --ssr
146
+ export function Page() { return <h1>Hi</h1>; } // throws on import
147
+
148
+ // Good \u2014 h(), which renderToString understands:
149
+ import { h } from 'what-framework';
150
+ export function Page() { return h('h1', null, 'Hi'); }
151
+
152
+ // Good \u2014 the automatic JSX runtime for the server build:
153
+ // vite.config.js (server): esbuild: { jsx: 'automatic',
154
+ // jsxImportSource: 'what-framework' }
155
+ export function Page() { return <h1>Hi</h1>; } // lowers to h()`},FORM_ACTION_NOT_REGISTERED:{code:"ERR_FORM_ACTION_NOT_REGISTERED",severity:"error",template:"[what] <Form action={fn}>: that function is not a server action.",suggestion:"Wrap it with action() from what-server, or pass the action id as a string. A plain function has no id, so there is nothing for the form post to address.",codeExample:`// Bad \u2014 a plain function:
145
156
  async function save(data) {}
146
157
  <Form action={save} />
147
158
 
@@ -204,6 +215,6 @@ createWhatError('MISSING_KEYS');
204
215
 
205
216
  // Good:
206
217
  createWhatError('MISSING_KEY', { component: 'TodoList' });`},UNKNOWN_TOOL:{code:"ERR_UNKNOWN_TOOL",severity:"error",template:"Unknown tool: {{name}}.",suggestion:"The MCP client called a tool this server does not expose. Call tools/list to enumerate what is available; a stale client cache is the usual cause.",codeExample:`// List what the server actually exposes:
207
- { "method": "tools/list" }`}},Xe=null;function _t(e){return Xe===null&&(Xe=new Map(Object.values(ze).map(t=>[t.code,t]))),Xe.get(e)}var pe=class extends Error{constructor({code:t,message:n,suggestion:r,codeExample:o,file:s,line:a,component:c,signal:u,effect:p}){super(n),this.name="WhatError",this.code=t,this.suggestion=r,this.codeExample=o,this.file=s,this.line=a,this.component=c,this.signal=u,this.effect=p}toJSON(){return{code:this.code,message:this.message,suggestion:this.suggestion,codeExample:this.codeExample,file:this.file,line:this.line,component:this.component,signal:this.signal,effect:this.effect}}};function fe(e,t={}){let n=typeof e=="string"?ze[e]:e;if(!n)return new pe({code:"ERR_UNKNOWN",message:`Unknown error: ${e}`,suggestion:"Check the error code and try again."});let r=n.template;for(let[o,s]of Object.entries(t))r=r.replace(new RegExp(`\\{\\{${o}\\}\\}`,"g"),String(s));return r=r.replace(/\{\{[^}]+\}\}/g,"(unknown)"),new pe({code:n.code,message:r,suggestion:n.suggestion,codeExample:n.codeExample,file:t.file,line:t.line,component:t.component,signal:t.signal||t.signalName,effect:t.effect||t.effectName})}var de=[],bt=200;function Ae(e){L&&(de.push({...e.toJSON(),timestamp:Date.now()}),de.length>bt&&(de=de.slice(-bt)))}function Ie(e){return e?de.filter(t=>t.timestamp>e):de.slice()}function po(){de=[]}function ho(e,t={}){let n=e?.message||String(e);if(e&&typeof e.code=="string"){let r=_t(e.code);if(r)return new pe({code:r.code,message:n,suggestion:r.suggestion,codeExample:r.codeExample,file:t.file,line:t.line,component:t.component,signal:t.signal||t.signalName,effect:t.effect||t.effectName})}return n.includes("infinite effect loop")||n.includes("25 iterations")?fe("INFINITE_EFFECT",t):n.includes("hydration")||n.includes("Hydration")?fe("HYDRATION_MISMATCH",t):n.includes("Signal.set() called inside a computed")?fe("SIGNAL_WRITE_IN_RENDER",{...t,signalName:n.match(/signal: (\w+)/)?.[1]||t.signalName}):new pe({code:"ERR_RUNTIME",message:n,suggestion:"Check the stack trace and component context for more details.",...t})}var be={signalReadDetection:!0,componentNaming:!0,importValidation:!0};function go(e){Object.assign(be,e)}function mo(){return{...be}}function yo(e,t){return!L||!be.signalReadDetection||(e.toString=function(){let n=fe("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${n.message}
208
- Suggestion: ${n.suggestion}`),Ae(n),String(e())},e.valueOf=function(){let n=fe("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${n.message}
209
- Suggestion: ${n.suggestion}`),Ae(n),e()}),e}function vo(e){if(!L||!be.componentNaming||!e||/^[A-Z]/.test(e))return null;let t=`Component "${e}" should use PascalCase (e.g., "${wo(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 wo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var St=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 xo(e){if(!L||!be.importValidation)return[];let t=[];for(let n of e)St.has(n)||t.push({name:n,message:`"${n}" is not a valid export from what-framework.`,suggestion:`Check the API reference. Did you mean: ${Eo(n)}?`});return t}function Eo(e){let t=e.toLowerCase(),n=null,r=1/0;for(let o of St){let s=bo(t,o.toLowerCase());s<r&&(r=s,n=o)}return r<=3?n:"(no close match found)"}function bo(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 o=1;o<=e.length;o++){let s=t[r-1]===e[o-1]?0:1;n[r][o]=Math.min(n[r-1][o]+1,n[r][o-1]+1,n[r-1][o-1]+s)}return n[t.length][e.length]}var _o="0.13.4",_e=[];function So(e){L&&_e.push(e)}function ko(e){if(!L)return;let t=_e.indexOf(e);t>=0&&_e.splice(t,1)}function kt(){return _e.slice()}var ve=[];function Ro(e){L&&ve.push(e)}function Co(e){if(!L)return;let t=ve.indexOf(e);t>=0&&ve.splice(t,1)}function Rt(){return ve.slice()}function Ct(){let e=Ie(),t=e.filter(u=>Date.now()-u.timestamp<6e4),r=e.filter(u=>u.code==="ERR_INFINITE_EFFECT").length>0,o=e.filter(u=>u.code==="ERR_ORPHAN_EFFECT"),s=ve.filter(u=>!!(u._subs&&u._subs.size===0)).length,a=ve.length,c=a>1e4?"high":a>1e3?"medium":"low";return{effectCycleRisk:r,orphanEffects:o.length,signalLeaks:s,memoryPressure:c,recentErrorCount:t.length,totalSignals:a,totalComponents:_e.length}}function Ao(){L&&(typeof globalThis>"u"||(globalThis.__WHAT_AGENT__={framework:"what-framework",version:_o,mode:"development",features:["signals","effects","computed","ssr","islands","router","stores","forms","animations","a11y"],components:()=>kt().map(e=>({id:e.id,name:e.name||e.displayName||e.constructor?.name})),signals:()=>Rt().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:()=>Ie(),health:()=>Ct(),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{lo as Checkbox,ze as ERROR_CODES,qt as ErrorBoundary,fo as ErrorMessage,hn as FocusTrap,Wt as For,Ft as Fragment,cr as Head,ao as Input,zt as Island,Nr as IslandSkeleton,An as Keys,_n as LiveRegion,Lr as LoadingDots,Xt as Match,Or as Placeholder,rn as Portal,uo as Radio,co as Select,Bt as Show,$e as Skeleton,Ir as SkeletonAvatar,ht as SkeletonCard,Tr as SkeletonTable,Ue as SkeletonText,yn as SkipLink,Mr as Spinner,jt as Suspense,Yt as Switch,io as Textarea,bn as VisuallyHidden,pe as WhatError,Dn as _$createComponent,On as _$template,Mt as __drainPreinstallBuffer,Xr as __getCacheSnapshot,Ht as __installServerContextStorage,Oe as __readHydrationData,Bn as __resetHydrationData,At as __setDevToolsHooks,ln as _beginComponentSSR,un as _endComponentSSR,an as _isAriaAttr,Pn as _mapArrayToArray,Nn as _setTextInsertHook,Je as _template,gn as announce,mn as announceAssertive,ir as atom,O as batch,dr as beginHeadCollection,vo as checkComponentName,Un as classList,ho as classifyError,Yr as clearCache,po as clearCollectedErrors,mr as clearHead,Kt as cls,Ae as collectError,P as computed,go as configureGuardrails,er as createContext,or as createResource,Ot as createRoot,ar as createStore,ft as createTransitionClasses,fe as createWhatError,Cr as cssTransition,Zt as debounce,Vn as delegateEvents,nt as derived,Qt as each,dt as easings,V as effect,fr as endHeadCollection,at as flushScheduler,Tt as flushSync,Rt as getActiveSignals,Ie as getCollectedErrors,_t as getErrorDefinition,mo as getGuardrailConfig,Ct as getHealth,Le as getLoaderData,kt as getMountedComponents,Nt as getOwner,Wr as getQueryData,Me as getResource,ge as getServerContext,N as h,Pt as html,qn as hydrate,Mn as insert,Ao as installAgentContext,yo as installSignalReadGuardrail,jr as invalidateQueries,jn as isHydrating,Ut as lazy,Fn as mapArray,yr as measure,$t as memo,cn as mount,vr as mutate,xr as nextFrame,$n as on,rr as onCleanup,br as onIntersect,In as onKey,Tn as onKeys,nr as onMount,Er as onResize,Lt as onRootCleanup,qr as prefetchQuery,it as raf,So as registerComponent,Ro as registerSignal,oo as rules,Dt as runWithOwner,Vt as runWithServerContext,Z as scheduleRead,se as scheduleWrite,Gn as setProp,Br as setQueryData,Gt as setServerContext,d as signal,It as signalMemo,ro as simpleResolver,_r as smoothScrollTo,Hn as spread,lt as spring,sr as storeComputed,Jt as style,Ln as svgTemplate,Je as template,en as throttle,sn as transition,ut as tween,ko as unregisterComponent,Co as unregisterSignal,ce as untrack,Rr as useAnimatedValue,xn as useAriaChecked,vn as useAriaExpanded,wn as useAriaSelected,Jn as useCallback,on as useClickOutside,zn as useComputed,Ze as useContext,Rn as useDescribedBy,Qn as useEffect,Gr as useFetch,so as useField,dn as useFocus,fn as useFocusRestore,pn as useFocusTrap,Kr as useForm,kr as useGesture,Sn as useId,kn as useIds,Ur as useInfiniteQuery,Cn as useLabelledBy,Wn as useLoaderData,nn as useLocalStorage,tn as useMediaQuery,Kn as useMemo,$r as useQuery,tr as useReducer,Zn as useRef,En as useRovingTabIndex,Vr as useSWR,wr as useScheduledEffect,Xn as useSignal,Dr as useSkeleton,Yn as useState,Sr as useTransition,xo as validateImports,no as yupResolver,eo as zodResolver};
218
+ { "method": "tools/list" }`}},Ye=null;function St(e){return Ye===null&&(Ye=new Map(Object.values(ze).map(t=>[t.code,t]))),Ye.get(e)}var pe=class extends Error{constructor({code:t,message:n,suggestion:r,codeExample:o,file:s,line:a,component:c,signal:u,effect:p}){super(n),this.name="WhatError",this.code=t,this.suggestion=r,this.codeExample=o,this.file=s,this.line=a,this.component=c,this.signal=u,this.effect=p}toJSON(){return{code:this.code,message:this.message,suggestion:this.suggestion,codeExample:this.codeExample,file:this.file,line:this.line,component:this.component,signal:this.signal,effect:this.effect}}};function fe(e,t={}){let n=typeof e=="string"?ze[e]:e;if(!n)return new pe({code:"ERR_UNKNOWN",message:`Unknown error: ${e}`,suggestion:"Check the error code and try again."});let r=n.template;for(let[o,s]of Object.entries(t))r=r.replace(new RegExp(`\\{\\{${o}\\}\\}`,"g"),String(s));return r=r.replace(/\{\{[^}]+\}\}/g,"(unknown)"),new pe({code:n.code,message:r,suggestion:n.suggestion,codeExample:n.codeExample,file:t.file,line:t.line,component:t.component,signal:t.signal||t.signalName,effect:t.effect||t.effectName})}var de=[],bt=200;function Ce(e){L&&(de.push({...e.toJSON(),timestamp:Date.now()}),de.length>bt&&(de=de.slice(-bt)))}function Ae(e){return e?de.filter(t=>t.timestamp>e):de.slice()}function po(){de=[]}function ho(e,t={}){let n=e?.message||String(e);if(e&&typeof e.code=="string"){let r=St(e.code);if(r)return new pe({code:r.code,message:n,suggestion:r.suggestion,codeExample:r.codeExample,file:t.file,line:t.line,component:t.component,signal:t.signal||t.signalName,effect:t.effect||t.effectName})}return n.includes("infinite effect loop")||n.includes("25 iterations")?fe("INFINITE_EFFECT",t):n.includes("hydration")||n.includes("Hydration")?fe("HYDRATION_MISMATCH",t):n.includes("Signal.set() called inside a computed")?fe("SIGNAL_WRITE_IN_RENDER",{...t,signalName:n.match(/signal: (\w+)/)?.[1]||t.signalName}):new pe({code:"ERR_RUNTIME",message:n,suggestion:"Check the stack trace and component context for more details.",...t})}var be={signalReadDetection:!0,componentNaming:!0,importValidation:!0};function go(e){Object.assign(be,e)}function mo(){return{...be}}function yo(e,t){return!L||!be.signalReadDetection||(e.toString=function(){let n=fe("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${n.message}
219
+ Suggestion: ${n.suggestion}`),Ce(n),String(e())},e.valueOf=function(){let n=fe("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${n.message}
220
+ Suggestion: ${n.suggestion}`),Ce(n),e()}),e}function vo(e){if(!L||!be.componentNaming||!e||/^[A-Z]/.test(e))return null;let t=`Component "${e}" should use PascalCase (e.g., "${wo(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 wo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var _t=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 xo(e){if(!L||!be.importValidation)return[];let t=[];for(let n of e)_t.has(n)||t.push({name:n,message:`"${n}" is not a valid export from what-framework.`,suggestion:`Check the API reference. Did you mean: ${Eo(n)}?`});return t}function Eo(e){let t=e.toLowerCase(),n=null,r=1/0;for(let o of _t){let s=bo(t,o.toLowerCase());s<r&&(r=s,n=o)}return r<=3?n:"(no close match found)"}function bo(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 o=1;o<=e.length;o++){let s=t[r-1]===e[o-1]?0:1;n[r][o]=Math.min(n[r-1][o]+1,n[r][o-1]+1,n[r-1][o-1]+s)}return n[t.length][e.length]}var So="0.13.6",Se=[];function _o(e){L&&Se.push(e)}function ko(e){if(!L)return;let t=Se.indexOf(e);t>=0&&Se.splice(t,1)}function kt(){return Se.slice()}var ve=[];function Ro(e){L&&ve.push(e)}function Co(e){if(!L)return;let t=ve.indexOf(e);t>=0&&ve.splice(t,1)}function Rt(){return ve.slice()}function Ct(){let e=Ae(),t=e.filter(u=>Date.now()-u.timestamp<6e4),r=e.filter(u=>u.code==="ERR_INFINITE_EFFECT").length>0,o=e.filter(u=>u.code==="ERR_ORPHAN_EFFECT"),s=ve.filter(u=>!!(u._subs&&u._subs.size===0)).length,a=ve.length,c=a>1e4?"high":a>1e3?"medium":"low";return{effectCycleRisk:r,orphanEffects:o.length,signalLeaks:s,memoryPressure:c,recentErrorCount:t.length,totalSignals:a,totalComponents:Se.length}}function Ao(){L&&(typeof globalThis>"u"||(globalThis.__WHAT_AGENT__={framework:"what-framework",version:So,mode:"development",features:["signals","effects","computed","ssr","islands","router","stores","forms","animations","a11y"],components:()=>kt().map(e=>({id:e.id,name:e.name||e.displayName||e.constructor?.name})),signals:()=>Rt().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:()=>Ae(),health:()=>Ct(),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{lo as Checkbox,ze as ERROR_CODES,qt as ErrorBoundary,fo as ErrorMessage,hn as FocusTrap,Wt as For,Ft as Fragment,cr as Head,ao as Input,zt as Island,Nr as IslandSkeleton,An as Keys,Sn as LiveRegion,Lr as LoadingDots,Yt as Match,Or as Placeholder,rn as Portal,uo as Radio,co as Select,Bt as Show,Ve as Skeleton,Ir as SkeletonAvatar,ht as SkeletonCard,Tr as SkeletonTable,je as SkeletonText,yn as SkipLink,Mr as Spinner,Ut as Suspense,Xt as Switch,io as Textarea,bn as VisuallyHidden,pe as WhatError,Dn as _$createComponent,On as _$template,Mt as __drainPreinstallBuffer,Yr as __getCacheSnapshot,Ht as __installServerContextStorage,De as __readHydrationData,Bn as __resetHydrationData,At as __setDevToolsHooks,ln as _beginComponentSSR,un as _endComponentSSR,an as _isAriaAttr,Pn as _mapArrayToArray,Nn as _setTextInsertHook,Je as _template,gn as announce,mn as announceAssertive,ir as atom,O as batch,dr as beginHeadCollection,vo as checkComponentName,jn as classList,ho as classifyError,Xr as clearCache,po as clearCollectedErrors,mr as clearHead,Kt as cls,Ce as collectError,P as computed,go as configureGuardrails,er as createContext,or as createResource,Ot as createRoot,ar as createStore,ft as createTransitionClasses,fe as createWhatError,Cr as cssTransition,Zt as debounce,$n as delegateEvents,nt as derived,Qt as each,dt as easings,$ as effect,fr as endHeadCollection,at as flushScheduler,Tt as flushSync,Rt as getActiveSignals,Ae as getCollectedErrors,St as getErrorDefinition,mo as getGuardrailConfig,Ct as getHealth,Oe as getLoaderData,kt as getMountedComponents,Nt as getOwner,Wr as getQueryData,Le as getResource,ge as getServerContext,N as h,Pt as html,qn as hydrate,Mn as insert,Ao as installAgentContext,yo as installSignalReadGuardrail,Ur as invalidateQueries,Un as isHydrating,jt as lazy,Fn as mapArray,yr as measure,Vt as memo,cn as mount,vr as mutate,xr as nextFrame,Vn as on,rr as onCleanup,br as onIntersect,In as onKey,Tn as onKeys,nr as onMount,Er as onResize,Lt as onRootCleanup,qr as prefetchQuery,it as raf,_o as registerComponent,Ro as registerSignal,oo as rules,Dt as runWithOwner,$t as runWithServerContext,Z as scheduleRead,se as scheduleWrite,Gn as setProp,Br as setQueryData,Gt as setServerContext,d as signal,It as signalMemo,ro as simpleResolver,Sr as smoothScrollTo,Hn as spread,lt as spring,sr as storeComputed,Jt as style,Ln as svgTemplate,Je as template,en as throttle,sn as transition,ut as tween,ko as unregisterComponent,Co as unregisterSignal,ce as untrack,Rr as useAnimatedValue,xn as useAriaChecked,vn as useAriaExpanded,wn as useAriaSelected,Jn as useCallback,on as useClickOutside,zn as useComputed,Ze as useContext,Rn as useDescribedBy,Qn as useEffect,Gr as useFetch,so as useField,dn as useFocus,fn as useFocusRestore,pn as useFocusTrap,Kr as useForm,kr as useGesture,_n as useId,kn as useIds,jr as useInfiniteQuery,Cn as useLabelledBy,Wn as useLoaderData,nn as useLocalStorage,tn as useMediaQuery,Kn as useMemo,Vr as useQuery,tr as useReducer,Zn as useRef,En as useRovingTabIndex,$r as useSWR,wr as useScheduledEffect,Yn as useSignal,Dr as useSkeleton,Xn as useState,_r as useTransition,xo as validateImports,no as yupResolver,eo as zodResolver};
@@ -1 +1 @@
1
- import{a as r,b as f}from"./chunk-O3SKPRTY.min.js";function u(n,i,o){if(i==null)return r(n,null);let{children:e,...t}=i;return o!==void 0&&(t.key=o),e===void 0?r(n,t):Array.isArray(e)?r(n,t,...e):r(n,t,e)}var x=u,c=u;export{f as Fragment,x as jsx,u as jsxDEV,c as jsxs};
1
+ import{a as r,b as f}from"./chunk-6YOUZ6T4.min.js";function u(n,i,o){if(i==null)return r(n,null);let{children:e,...t}=i;return o!==void 0&&(t.key=o),e===void 0?r(n,t):Array.isArray(e)?r(n,t,...e):r(n,t,e)}var x=u,c=u;export{f as Fragment,x as jsx,u as jsxDEV,c as jsxs};
@@ -1 +1 @@
1
- import{a as r,b as f}from"./chunk-O3SKPRTY.min.js";function o(n,t,u){if(t==null)return r(n,null);let{children:e,...i}=t;return u!==void 0&&(i.key=u),e===void 0?r(n,i):Array.isArray(e)?r(n,i,...e):r(n,i,e)}var d=o;export{f as Fragment,o as jsx,d as jsxs};
1
+ import{a as r,b as f}from"./chunk-6YOUZ6T4.min.js";function o(n,t,u){if(t==null)return r(n,null);let{children:e,...i}=t;return u!==void 0&&(i.key=u),e===void 0?r(n,i):Array.isArray(e)?r(n,i,...e):r(n,i,e)}var d=o;export{f as Fragment,o as jsx,d as jsxs};
@@ -1 +1 @@
1
- import{A as j,B as k,C as l,D as m,E as n,F as o,G as p,H as q,I as r,J as s,K as t,L as u,M as v,N as w,u as d,v as e,w as f,x as g,y as h,z as i}from"./chunk-DZTPU2YD.min.js";import{f as a,h as b,j as c}from"./chunk-OKM3GKVP.min.js";import"./chunk-O3SKPRTY.min.js";export{e as _$createComponent,f as _$template,k as _mapArrayToArray,d as _setTextInsertHook,g as _template,u as classList,s as delegateEvents,a as effect,w as hydrate,i as insert,v as isHydrating,j as mapArray,b as memo,t as on,p as setAttr,r as setChecked,n as setClass,m as setProp,o as setStyle,q as setValue,l as spread,h as svgTemplate,g as template,c as untrack};
1
+ import{A as j,B as k,C as l,D as m,E as n,F as o,G as p,H as q,I as r,J as s,K as t,L as u,M as v,N as w,O as x,u as d,v as e,w as f,x as g,y as h,z as i}from"./chunk-XRUIKSAO.min.js";import{f as a,h as b,j as c}from"./chunk-ZDIHSTQJ.min.js";import"./chunk-6YOUZ6T4.min.js";export{e as _$componentVNode,f as _$createComponent,g as _$template,l as _mapArrayToArray,d as _setTextInsertHook,h as _template,v as classList,t as delegateEvents,a as effect,x as hydrate,j as insert,w as isHydrating,k as mapArray,b as memo,u as on,q as setAttr,s as setChecked,o as setClass,n as setProp,p as setStyle,r as setValue,m as spread,i as svgTemplate,h as template,c as untrack};
@@ -1 +1 @@
1
- import{W as x,a as k,b as _,c as E,d as b,f as y,i as h,m as g}from"./chunk-OKM3GKVP.min.js";import{a as v}from"./chunk-O3SKPRTY.min.js";var f=null;function N(){return typeof document<"u"&&(f=document.createElement("div"),f.id="test-root",document.body.appendChild(f)),f}function q(){f&&(f.innerHTML="",f.parentNode&&f.parentNode.removeChild(f),f=null)}function H(e,t={}){let{container:n}=t,o=n||N();if(!o)throw new Error("No DOM container available. Are you running in Node.js without jsdom?");let s=x(e,o);return{container:o,unmount:s,getByText:r=>p(o,r),getByTestId:r=>o.querySelector(`[data-testid="${r}"]`),getByRole:r=>o.querySelector(`[role="${r}"]`),getAllByText:r=>$(o,r),queryByText:r=>p(o,r),queryByTestId:r=>o.querySelector(`[data-testid="${r}"]`),debug:()=>console.log(o.innerHTML),findByText:(r,u)=>S(()=>p(o,r),{timeout:u}),findByTestId:(r,u)=>S(()=>o.querySelector(`[data-testid="${r}"]`),{timeout:u})}}function O(e,t){let n=N();if(!n)throw new Error("No DOM container available. Are you running in Node.js without jsdom?");let o={},s=null,r;return g(u=>{s=u;let c=v(e,t||{});r=x(c,n)}),{container:n,signals:new Proxy(o,{get(u,c){if(c in u)return u[c]},set(u,c,i){return u[c]=i,!0}}),update(){h()},unmount(){r&&r(),s&&s(),q()},getByText:u=>p(n,u),getByTestId:u=>n.querySelector(`[data-testid="${u}"]`),queryByText:u=>p(n,u),debug:()=>console.log(n.innerHTML)}}function R(){h()}var B="(unnamed)";function F(e){if(!k)throw new Error('[what] trackSignals() requires a development build. Signal debug names and subscriber back-references are stripped in production, so there is nothing to report. Run your tests with NODE_ENV !== "production".');let t=[],n=[],o=(l,d)=>{l.includes(d)||l.push(d)},s=_,r={...s||{},onSignalUpdate(l){o(n,l?._debugName||B),s?.onSignalUpdate?.(l)}};delete r.__isPreinstallBuffer;let u=b(0,"__trackSignals_probe__"),c={current:null},i=null,a=(l,d)=>{for(let w of l||[]){if(d.has(w))continue;d.add(w);let m=w._signalOwner;if(m){m!==u&&o(t,m._debugName||B);continue}let T=w._owner;T?.deps&&a(T.deps,d)}};E(r);try{g(d=>{c.current=d,y(()=>{u(),e()})});let l=new Set;for(let d of u._subs)a(d.deps,l)}catch(l){i=l}finally{c.current?.(),E(s)}if(i)throw i;return{accessed:t,written:n}}function A(e,t){let n=[t],o=0,s=b(t,e),r=s.set;s.set=function(i){let a=typeof i=="function"?i(s.peek()):i;return Object.is(s.peek(),a)||(o++,n.push(a)),r(a)};let u=s,c=function(...i){if(i.length===0)return u();let a=typeof i[0]=="function"?i[0](u.peek()):i[0];return Object.is(u.peek(),a)||(o++,n.push(a)),u(a)};return c._signal=!0,c.peek=s.peek,c.set=s.set,c.subscribe=s.subscribe,s._debugName&&(c._debugName=s._debugName),s._subs&&(c._subs=s._subs),Object.defineProperty(c,"history",{get(){return n}}),Object.defineProperty(c,"setCount",{get(){return o}}),c.reset=function(i){let a=i!==void 0?i:t;n.length=0,n.push(a),o=0,u(a)},c}function p(e,t){let n=t instanceof RegExp?t:null,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let s=o.currentNode,r=s.textContent||"";if(n?n.test(r):r.includes(t))return s.parentElement}return null}function $(e,t){let n=[],o=t instanceof RegExp?t:null,s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let r=s.currentNode,u=r.textContent||"";(o?o.test(u):u.includes(t))&&n.push(r.parentElement)}return n}var P={click(e){let t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:typeof window<"u"?window:void 0});return e.dispatchEvent(t),t},change(e,t){e.value=t;let n=new Event("input",{bubbles:!0});e.dispatchEvent(n);let o=new Event("change",{bubbles:!0});return e.dispatchEvent(o),o},input(e,t){e.value=t;let n=new Event("input",{bubbles:!0});return e.dispatchEvent(n),n},submit(e){let t=new Event("submit",{bubbles:!0,cancelable:!0});return e.dispatchEvent(t),t},focus(e){e.focus();let t=new FocusEvent("focus",{bubbles:!0});return e.dispatchEvent(t),t},blur(e){e.blur();let t=new FocusEvent("blur",{bubbles:!0});return e.dispatchEvent(t),t},keyDown(e,t,n={}){let o=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:t,...n});return e.dispatchEvent(o),o},keyUp(e,t,n={}){let o=new KeyboardEvent("keyup",{bubbles:!0,cancelable:!0,key:t,...n});return e.dispatchEvent(o),o},mouseEnter(e){let t=new MouseEvent("mouseenter",{bubbles:!0});return e.dispatchEvent(t),t},mouseLeave(e){let t=new MouseEvent("mouseleave",{bubbles:!0});return e.dispatchEvent(t),t}};async function S(e,t={}){let{timeout:n=1e3,interval:o=50}=t,s=Date.now();for(;Date.now()-s<n;){try{let r=e();if(r)return r}catch{}await new Promise(r=>setTimeout(r,o))}throw new Error(`waitFor timed out after ${n}ms`)}async function j(e,t={}){let{timeout:n=1e3,interval:o=50}=t,s=Date.now(),r=e();if(!r)throw new Error("Element not found");for(;Date.now()-s<n;){if(r=e(),!r)return;await new Promise(u=>setTimeout(u,o))}throw new Error(`Element still present after ${n}ms`)}async function I(e){let t=await e();return h(),await new Promise(n=>queueMicrotask(()=>n())),await new Promise(n=>setTimeout(()=>n(),0)),t}function L(e){let t=b(e),n=[e];return y(()=>{n.push(t())}),{signal:t,get value(){return t()},set value(o){t.set(o)},history:n,reset(){n.length=0,n.push(t())}}}function V(e="MockComponent"){let t=[];function n(o){return t.push({props:o,timestamp:Date.now()}),v("div",{"data-testid":`mock-${e}`},JSON.stringify(o,null,2))}return n.displayName=e,n.calls=t,n.lastCall=()=>t[t.length-1],n.reset=()=>{t.length=0},n}var U={toBeInTheDocument(e){if(!e||!e.parentNode)throw new Error("Expected element to be in the document")},toHaveTextContent(e,t){if(!e)throw new Error("Element not found");let n=e.textContent;if(!(t instanceof RegExp?t.test(n):n.includes(t)))throw new Error(`Expected "${n}" to contain "${t}"`)},toHaveAttribute(e,t,n){if(!e)throw new Error("Element not found");let o=e.getAttribute(t);if(n!==void 0&&o!==n)throw new Error(`Expected attribute "${t}" to be "${n}", got "${o}"`);if(n===void 0&&o===null)throw new Error(`Expected element to have attribute "${t}"`)},toHaveClass(e,t){if(!e)throw new Error("Element not found");if(!e.classList.contains(t))throw new Error(`Expected element to have class "${t}"`)},toBeVisible(e){if(!e)throw new Error("Element not found");let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0")throw new Error("Expected element to be visible")},toBeDisabled(e){if(!e)throw new Error("Element not found");if(!e.disabled)throw new Error("Expected element to be disabled")},toHaveValue(e,t){if(!e)throw new Error("Element not found");if(e.value!==t)throw new Error(`Expected value to be "${t}", got "${e.value}"`)}},W={getByText:e=>p(document.body,e),getByTestId:e=>document.querySelector(`[data-testid="${e}"]`),getByRole:e=>document.querySelector(`[role="${e}"]`),getAllByText:e=>$(document.body,e),queryByText:e=>p(document.body,e),queryByTestId:e=>document.querySelector(`[data-testid="${e}"]`),debug:()=>console.log(document.body.innerHTML)};export{I as act,q as cleanup,L as createTestSignal,U as expect,P as fireEvent,R as flushEffects,V as mockComponent,A as mockSignal,H as render,O as renderTest,W as screen,N as setupDOM,F as trackSignals,S as waitFor,j as waitForElementToBeRemoved};
1
+ import{X as T,a as _,b as S,c as y,d as b,f as g,i as h,m as v}from"./chunk-ZDIHSTQJ.min.js";import{a as x}from"./chunk-6YOUZ6T4.min.js";var f=null,m=new Set;function $(e){let t=()=>{m.has(t)&&(m.delete(t),e())};return m.add(t),t}function q(){return typeof document<"u"&&(f=document.createElement("div"),f.id="test-root",document.body.appendChild(f)),f}function M(){for(let e of[...m])try{e()}catch{}f&&(f.innerHTML="",f.parentNode&&f.parentNode.removeChild(f),f=null)}function R(e,t={}){let{container:n}=t,o=n||q();if(!o)throw new Error("No DOM container available. Are you running in Node.js without jsdom?");let s=$(T(e,o));return{container:o,unmount:s,getByText:r=>p(o,r),getByTestId:r=>o.querySelector(`[data-testid="${r}"]`),getByRole:r=>o.querySelector(`[role="${r}"]`),getAllByText:r=>D(o,r),queryByText:r=>p(o,r),queryByTestId:r=>o.querySelector(`[data-testid="${r}"]`),debug:()=>console.log(o.innerHTML),findByText:(r,u)=>N(()=>p(o,r),{timeout:u}),findByTestId:(r,u)=>N(()=>o.querySelector(`[data-testid="${r}"]`),{timeout:u})}}function F(e,t){let n=q();if(!n)throw new Error("No DOM container available. Are you running in Node.js without jsdom?");let o={},s=null,r;return v(u=>{s=u;let c=x(e,t||{});r=$(T(c,n))}),{container:n,signals:new Proxy(o,{get(u,c){if(c in u)return u[c]},set(u,c,i){return u[c]=i,!0}}),update(){h()},unmount(){r&&r(),s&&s(),M()},getByText:u=>p(n,u),getByTestId:u=>n.querySelector(`[data-testid="${u}"]`),queryByText:u=>p(n,u),debug:()=>console.log(n.innerHTML)}}function A(){h()}var B="(unnamed)";function P(e){if(!_)throw new Error('[what] trackSignals() requires a development build. Signal debug names and subscriber back-references are stripped in production, so there is nothing to report. Run your tests with NODE_ENV !== "production".');let t=[],n=[],o=(d,l)=>{d.includes(l)||d.push(l)},s=S,r={...s||{},onSignalUpdate(d){o(n,d?._debugName||B),s?.onSignalUpdate?.(d)}};delete r.__isPreinstallBuffer;let u=b(0,"__trackSignals_probe__"),c={current:null},i=null,a=(d,l)=>{for(let w of d||[]){if(l.has(w))continue;l.add(w);let E=w._signalOwner;if(E){E!==u&&o(t,E._debugName||B);continue}let k=w._owner;k?.deps&&a(k.deps,l)}};y(r);try{v(l=>{c.current=l,g(()=>{u(),e()})});let d=new Set;for(let l of u._subs)a(l.deps,d)}catch(d){i=d}finally{c.current?.(),y(s)}if(i)throw i;return{accessed:t,written:n}}function j(e,t){let n=[t],o=0,s=b(t,e),r=s.set;s.set=function(i){let a=typeof i=="function"?i(s.peek()):i;return Object.is(s.peek(),a)||(o++,n.push(a)),r(a)};let u=s,c=function(...i){if(i.length===0)return u();let a=typeof i[0]=="function"?i[0](u.peek()):i[0];return Object.is(u.peek(),a)||(o++,n.push(a)),u(a)};return c._signal=!0,c.peek=s.peek,c.set=s.set,c.subscribe=s.subscribe,s._debugName&&(c._debugName=s._debugName),s._subs&&(c._subs=s._subs),Object.defineProperty(c,"history",{get(){return n}}),Object.defineProperty(c,"setCount",{get(){return o}}),c.reset=function(i){let a=i!==void 0?i:t;n.length=0,n.push(a),o=0,u(a)},c}function p(e,t){let n=t instanceof RegExp?t:null,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;o.nextNode();){let s=o.currentNode,r=s.textContent||"";if(n?n.test(r):r.includes(t))return s.parentElement}return null}function D(e,t){let n=[],o=t instanceof RegExp?t:null,s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let r=s.currentNode,u=r.textContent||"";(o?o.test(u):u.includes(t))&&n.push(r.parentElement)}return n}var I={click(e){let t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:typeof window<"u"?window:void 0});return e.dispatchEvent(t),t},change(e,t){e.value=t;let n=new Event("input",{bubbles:!0});e.dispatchEvent(n);let o=new Event("change",{bubbles:!0});return e.dispatchEvent(o),o},input(e,t){e.value=t;let n=new Event("input",{bubbles:!0});return e.dispatchEvent(n),n},submit(e){let t=new Event("submit",{bubbles:!0,cancelable:!0});return e.dispatchEvent(t),t},focus(e){e.focus();let t=new FocusEvent("focus",{bubbles:!0});return e.dispatchEvent(t),t},blur(e){e.blur();let t=new FocusEvent("blur",{bubbles:!0});return e.dispatchEvent(t),t},keyDown(e,t,n={}){let o=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:t,...n});return e.dispatchEvent(o),o},keyUp(e,t,n={}){let o=new KeyboardEvent("keyup",{bubbles:!0,cancelable:!0,key:t,...n});return e.dispatchEvent(o),o},mouseEnter(e){let t=new MouseEvent("mouseenter",{bubbles:!0});return e.dispatchEvent(t),t},mouseLeave(e){let t=new MouseEvent("mouseleave",{bubbles:!0});return e.dispatchEvent(t),t}};async function N(e,t={}){let{timeout:n=1e3,interval:o=50}=t,s=Date.now();for(;Date.now()-s<n;){try{let r=e();if(r)return r}catch{}await new Promise(r=>setTimeout(r,o))}throw new Error(`waitFor timed out after ${n}ms`)}async function L(e,t={}){let{timeout:n=1e3,interval:o=50}=t,s=Date.now(),r=e();if(!r)throw new Error("Element not found");for(;Date.now()-s<n;){if(r=e(),!r)return;await new Promise(u=>setTimeout(u,o))}throw new Error(`Element still present after ${n}ms`)}async function V(e){let t=await e();return h(),await new Promise(n=>queueMicrotask(()=>n())),await new Promise(n=>setTimeout(()=>n(),0)),t}function U(e){let t=b(e),n=[e];return g(()=>{n.push(t())}),{signal:t,get value(){return t()},set value(o){t.set(o)},history:n,reset(){n.length=0,n.push(t())}}}function W(e="MockComponent"){let t=[];function n(o){return t.push({props:o,timestamp:Date.now()}),x("div",{"data-testid":`mock-${e}`},JSON.stringify(o,null,2))}return n.displayName=e,n.calls=t,n.lastCall=()=>t[t.length-1],n.reset=()=>{t.length=0},n}var K={toBeInTheDocument(e){if(!e||!e.parentNode)throw new Error("Expected element to be in the document")},toHaveTextContent(e,t){if(!e)throw new Error("Element not found");let n=e.textContent;if(!(t instanceof RegExp?t.test(n):n.includes(t)))throw new Error(`Expected "${n}" to contain "${t}"`)},toHaveAttribute(e,t,n){if(!e)throw new Error("Element not found");let o=e.getAttribute(t);if(n!==void 0&&o!==n)throw new Error(`Expected attribute "${t}" to be "${n}", got "${o}"`);if(n===void 0&&o===null)throw new Error(`Expected element to have attribute "${t}"`)},toHaveClass(e,t){if(!e)throw new Error("Element not found");if(!e.classList.contains(t))throw new Error(`Expected element to have class "${t}"`)},toBeVisible(e){if(!e)throw new Error("Element not found");let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0")throw new Error("Expected element to be visible")},toBeDisabled(e){if(!e)throw new Error("Element not found");if(!e.disabled)throw new Error("Expected element to be disabled")},toHaveValue(e,t){if(!e)throw new Error("Element not found");if(e.value!==t)throw new Error(`Expected value to be "${t}", got "${e.value}"`)}},X={getByText:e=>p(document.body,e),getByTestId:e=>document.querySelector(`[data-testid="${e}"]`),getByRole:e=>document.querySelector(`[role="${e}"]`),getAllByText:e=>D(document.body,e),queryByText:e=>p(document.body,e),queryByTestId:e=>document.querySelector(`[data-testid="${e}"]`),debug:()=>console.log(document.body.innerHTML)};export{V as act,M as cleanup,U as createTestSignal,K as expect,I as fireEvent,A as flushEffects,W as mockComponent,j as mockSignal,R as render,F as renderTest,X as screen,q as setupDOM,P as trackSignals,N as waitFor,L as waitForElementToBeRemoved};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "what-core",
3
- "version": "0.13.4",
3
+ "version": "0.13.6",
4
4
  "description": "What Framework - Signal-based UI framework built for AI agents",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/render.d.ts CHANGED
@@ -49,3 +49,10 @@ export function svgTemplate(html: string): () => Element;
49
49
  * the package a scaffolded app actually depends on.
50
50
  */
51
51
  export function _$createComponent(component: unknown, props?: unknown, ...args: unknown[]): unknown;
52
+
53
+ /**
54
+ * @internal The unbuilt sibling of `_$createComponent`, emitted for the JSX
55
+ * passed directly to `hydrate()`. Returns the VNode instead of its DOM, because
56
+ * hydration can only adopt server markup with a tree that has not been built.
57
+ */
58
+ export function _$componentVNode(component: unknown, props?: unknown, ...args: unknown[]): VNodeChild;