what-core 0.11.8 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-NCPX66TV.min.js +1 -0
- package/dist/chunk-RXISSKLI.min.js +11 -0
- package/dist/index.min.js +5 -15
- package/dist/render.min.js +1 -1
- package/dist/testing.min.js +1 -1
- package/index.d.ts +30 -0
- package/jsx-dev-runtime.d.ts +2 -2
- package/jsx-runtime.d.ts +2 -2
- package/package.json +1 -1
- package/render.d.ts +15 -1
- package/src/a11y.js +34 -2
- package/src/agent-context.js +1 -1
- package/src/components.js +128 -60
- package/src/data.js +47 -4
- package/src/dom.js +50 -2
- package/src/index.js +3 -0
- package/src/render.js +26 -1
- package/src/server-context.js +12 -0
- package/testing.d.ts +36 -1
- package/dist/chunk-JIZR6JX5.min.js +0 -1
- package/dist/chunk-PABR63P3.min.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as M}from"./chunk-O3SKPRTY.min.js";var u=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),p=null;function Xe(e){u&&(p=e)}var C=null,S=null,v=null,H=!1,B=0,x=[],U=!1,V=Symbol("needs_upstream"),q=null;function k(e,t){let n=e,r=new Set,o=null,s=0;function c(f){u&&H&&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,u&&p&&p.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=>N(()=>f(i())),i._signal=!0,u&&(i._subs=r,t&&(i._debugName=t)),u&&p&&p.onSignalCreate(i),i}function Qe(e){let t,n=!0,r=new Set,o=null,s=0,c=X(()=>{let f=H;u&&(H=!0);try{t=e(),n=!1}finally{u&&(H=f)}},!0);c._level=1,c._computed=!0,c._computedSubs=r,r._owner=c,c._markDirty=()=>{n=!0},c._isDirty=()=>n;function i(){let f=C;return f!==null&&(f!==o||f._epoch!==s)&&(o=f,s=f._epoch,r.add(f),f.deps.push(r)),n&&ne(c),t}return c._onNotify=()=>{n=!0,o=null,r.size>0&&ie(r)},i._signal=!0,i.peek=()=>(n&&ne(c),t),i}function ne(e){if(q!==null)throw q.push(e),V;let t=[e];q=t;try{for(;t.length>0;){let n=t[t.length-1];if(!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._computed&&c._isDirty&&c._isDirty()&&(t.push(c),r=!0)}if(!r)try{let s=n.deps.length;Q(n),n.deps.length!==s&&F(n),t.pop()}catch(s){if(s===V)n._markDirty();else throw s}}}finally{q=null}}function F(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 N(e,t){let n=X(e);n._level=1;let r=C;C=n;try{let s=n.fn();typeof s=="function"&&(n._cleanup=s)}finally{C=r}if(F(n),t?.stable&&(n._stable=!0),n.deps.length===0&&n._cleanup===null)return n.disposed=!0,u&&p&&p.onEffectDispose(n),ve;let o=()=>oe(n);return S&&S.disposals.push(o),o}function Ze(e){B++;try{e()}finally{B--,B===0&&Z()}}function X(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 u&&p&&p.onEffectCreate(n),n}function Q(e){if(e.disposed)return;if(e._stable){if(e._cleanup){try{e._cleanup()}catch(o){u&&console.warn("[what] Error in effect cleanup:",o)}e._cleanup=null}let r=C;C=null;try{let o=e.fn();typeof o=="function"&&(e._cleanup=o)}catch(o){p?.onError&&p.onError(o,{type:"effect",effect:e}),u&&console.warn("[what] Error in stable effect:",o)}finally{C=r}u&&p?.onEffectRun&&p.onEffectRun(e);return}let t=e.deps.length===1?e.deps[0]:null;if(se(e),e._cleanup){try{e._cleanup()}catch(r){u&&p?.onError&&p.onError(r,{type:"effect-cleanup",effect:e}),u&&console.warn("[what] Error in effect cleanup:",r)}e._cleanup=null}let n=C;C=e;try{let r=e.fn();typeof r=="function"&&(e._cleanup=r)}catch(r){throw r===V||u&&p?.onError&&p.onError(r,{type:"effect",effect:e}),r}finally{C=n}t!==null&&e.deps.length===1&&e.deps[0]===t&&!e._cleanup&&!e._pending&&(e._stable=!0),u&&p?.onEffectRun&&p.onEffectRun(e)}function oe(e){if(e.disposed=!0,u&&p&&p.onEffectDispose(e),se(e),e._cleanup){try{e._cleanup()}catch(t){u&&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 J=0,D=null,T=0;function re(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){u&&p?.onError&&p.onError(n,{type:"effect",effect:e}),u&&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&&(U=!0),x.push(e)}}}function ie(e){if(J===0){J=1;try{for(let t of e)re(t);if(T>0){let t=0;for(;t<T;){let n=D[t];D[t]=null,t++;for(let r of n)re(r)}T=0}}finally{J=0}B===0&&x.length>0&&ke()}else D===null&&(D=[]),T>=D.length?D.push(e):D[T]=e,T++}var W=!1;function ke(){W||(W=!0,queueMicrotask(()=>{W=!1,Z()}))}var z=!1;function Z(){if(!z){z=!0;try{let e=0;for(;x.length>0&&e<25;){let t=x;x=[],t.length>1&&U&&t.sort((n,r)=>n._level-r._level),U=!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{Q(r)}catch(s){if(s===V)throw s;u&&p?.onError&&p.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&&F(r)}}e++}if(e>=25){if(u){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{z=!1}}}function Ye(e){let t,n=new Set,r=X(()=>{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&&(U=!0),x.push(c)}}}});r._level=1,Q(r),F(r),n._owner=r,S&&S.disposals.push(()=>oe(r));function o(){return C&&(n.add(C),C.deps.push(n)),t}return o._signal=!0,o.peek=()=>t,o}function et(){if(z){u&&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){u&&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}W=!1,Z()}function Y(e){let t=C;C=null;try{return e()}finally{C=t}}function tt(){return v}function nt(e,t){let n=v,r=S;v=e,S=e;try{return t()}finally{v=n,S=r}}function rt(e){let t=S,n=v,r={disposals:[],owner:v,children:[],_disposed:!1};v&&v.children.push(r),S=r,v=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let s=r.children.length-1;s>=0;s--)ee(r.children[s]);r.children.length=0;for(let s=r.disposals.length-1;s>=0;s--)r.disposals[s]();if(r.disposals.length=0,r.owner){let s=r.owner.children.indexOf(r);s>=0&&r.owner.children.splice(s,1)}}})}finally{S=t,v=n}}function ee(e){if(!e._disposed){e._disposed=!0;for(let t=e.children.length-1;t>=0;t--)ee(e.children[t]);e.children.length=0;for(let t=e.disposals.length-1;t>=0;t--)e.disposals[t]();e.disposals.length=0}}function ot(e){let t=S,n=v,r={disposals:[],owner:null,children:[],_disposed:!1};S=r,v=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let s=r.children.length-1;s>=0;s--)ee(r.children[s]);r.children.length=0;for(let s=r.disposals.length-1;s>=0;s--)r.disposals[s]();r.disposals.length=0}})}finally{S=t,v=n}}function st(e){S&&S.disposals.push(e)}if(u&&typeof WeakRef<"u"){let t={signals:new Set,effects:new Set,components:[]};p={__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 it(){if(!u)return{signals:[],effects:[],components:[]};let e={signals:[],effects:[],components:[]},t=typeof K<"u"?K: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 K=null;u&&p?.__isPreinstallBuffer&&(K=p.__buffer);var O=null,P=null;function ft(e){P||(P=e)}function Ae(){return P?.getStore()??O}function ce(){return typeof document>"u"||Ae()!=null}function at(e){let t=O;return O=e,t}function lt(e,t){if(P)return P.run(e,t);let n=O;O=e;try{return t()}finally{O=n}}function gt(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 Ct(e){let t=null,n=null,r=null,o=new Set;function s(c){if(r)throw r;if(t)return M(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=k(!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=k(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 wt({when:e,fallback:t=null,children:n}){return()=>(typeof e=="function"?e():e)?n:t}function bt({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 St({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 I=null;function xt(e){I=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 Et({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 M("div",{...f,"data-island-props":Me(s)},M(e,s,...a));let h=!1;function y(l){if(h)return;h=!0;let d=M(e,s,...a);l.childNodes.length>0&&I?.hydrate?I.hydrate(d,l):I?.insert&&I.insert(l,d,null),l.removeAttribute("data-hydrate"),l.removeAttribute("data-island-self"),l.setAttribute("data-island-hydrated","");let _=l.ownerDocument?.defaultView??globalThis;typeof _.CustomEvent=="function"&&l.dispatchEvent(new _.CustomEvent("island:hydrated",{bubbles:!0,detail:{name:c,mode:i}}))}function b(l){let d=()=>y(l);switch(i){case"load":queueMicrotask(d);break;case"idle":typeof requestIdleCallback<"u"?requestIdleCallback(d):setTimeout(d,200);break;case"visible":{if(typeof IntersectionObserver>"u"){queueMicrotask(d);break}let _=new IntersectionObserver(w=>{w.some(E=>E.isIntersecting)&&(_.disconnect(),d())},{rootMargin:"200px"});_.observe(l);break}case"interaction":case"action":{let _=["click","focus","mouseenter","touchstart"],w=()=>{for(let E of _)l.removeEventListener(E,w);d()};for(let E of _)l.addEventListener(E,w,{once:!0});break}case"media":{if(!n||typeof window>"u"||!window.matchMedia){d();break}let _=window.matchMedia(n);if(_.matches){queueMicrotask(d);break}let w=()=>{_.matches&&(_.removeEventListener("change",w),d())};_.addEventListener("change",w);break}case"static":break;default:queueMicrotask(d)}}return M("div",{...f,ref:l=>{l&&b(l)}})}var ue=!1;function At(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 Nt(...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 Lt(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 Dt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function Mt(e,t){let n=0;return(...r)=>{let o=Date.now();o-n>=t&&(n=o,e(...r))}}var $=null;function pe(e){$=e}function Tt(e){if(typeof window>"u")return k(!1);let t=window.matchMedia(e),n=k(t.matches),r=s=>n.set(s.matches);t.addEventListener("change",r);let o=$?.();return o&&(o._cleanupCallbacks=o._cleanupCallbacks||[],o._cleanupCallbacks.push(()=>t.removeEventListener("change",r))),n}function Ot(e,t){let n;try{let i=localStorage.getItem(e);n=i!==null?JSON.parse(i):t}catch{n=t}let r=k(n),o=N(()=>{try{localStorage.setItem(e,JSON.stringify(r()))}catch(i){u&&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){u&&console.warn("[what] localStorage parse failed:",f)}},window.addEventListener("storage",s));let c=$?.();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 Bt(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=$?.();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 Oe=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"]),Re="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 Be(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 Pe(e,t){let n=e.toLowerCase();return he.has(e)||he.has(n)?!0:!de.has(e)&&!de.has(n)?!1:!Be(t)}function Ie(e){return e==="role"||e.startsWith("aria-")}var ye=new Set,G=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 te(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)}u&&p?.onComponentUnmount&&p.onComponentUnmount(e),ye.delete(e)}}function qe(e,t){!e||typeof t!="function"||(e._hydrationDisposers?e._hydrationDisposers.push(t):e._hydrationDisposers=[t])}function Ut(e,t){qe(e,()=>te(t))}function L(e){if(!e)return;if(e._componentCtx&&te(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=G.get(e);n&&te(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++)L(t[n])}function Vt(e,t){typeof t=="string"&&(t=document.querySelector(t)),L(t),t.textContent="";let n=A(e,t);return n&&t.appendChild(n),()=>{L(t),t.textContent=""}}function A(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-frag");return r.appendChild(o),e(r,o),r}if(typeof e=="function"&&e._lazyChildren)return A(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=m[m.length-1]||null,f=N(()=>{let a=i!==null&&m[m.length-1]!==i;a&&m.push(i);try{let h=e(),y=h==null||h===!1||h===!0?[]:Array.isArray(h)?h:[h],b=o.parentNode;if(!b)return;for(let l of s)L(l),l.parentNode===b&&b.removeChild(l);s=[];for(let l of y){let d=A(l,b,t?._isSvg);if(d)if(d.nodeType===11){let _=Array.from(d.childNodes);b.insertBefore(d,o);for(let w of _)s.push(w)}else b.insertBefore(d,o),s.push(d)}}finally{a&&m.pop()}});return r._dispose=f,o._dispose=f,c}if(Array.isArray(e)){let r=document.createDocumentFragment();for(let o of e){let s=A(o,t,n);s&&r.appendChild(s)}return r}return me(e)&&typeof e.tag=="function"?Ve(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):$e(e,t,n):document.createTextNode(String(e))}var He={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}},m=[];function ge(){return m[m.length-1]}ae(ge);pe(ge);function Ft(){return m}function We(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 ze=Symbol.for("what.navigation.signal");function Ue(e){if(e==null)return!1;let t=e[ze];return typeof t!="function"?!1:(t(e),!0)}function Ve(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=m[m.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"),h=document.createComment("c:end");G.set(a,f),f._startComment=a,f._endComment=h;let y=document.createDocumentFragment();y._componentCtx=f,f._wrapper=a,ye.add(f),u&&p?.onComponentMount&&p.onComponentMount(f);let b=s.length===0?void 0:s.length===1?s[0]:s,l;b!==void 0?l=o?Object.assign({},o,{children:b}):{children:b}:l=o?Object.assign({},o):{};let d=o&&o._$lazyChildren,_=d?We(r,l,d):null,w=k(l);f._propsSignal=w;let E=new Proxy({_sig:w},He);m.push(f);let j;try{j=Y(()=>r(E))}catch(g){if(m.pop(),!Ue(g)&&!(g&&typeof g.then=="function"&&Fe(g,f))&&!le(g,f))throw console.error("[what] Uncaught error in component:",r.name||"Anonymous",g),g;return y.appendChild(a),y.appendChild(h),y}_&&_(),f.mounted=!0,f._mountCallbacks&&queueMicrotask(()=>{if(!f.disposed)for(let g of f._mountCallbacks)try{g()}catch(R){console.error("[what] onMount error:",R)}}),y.appendChild(a);let xe=Array.isArray(j)?j:[j];try{for(let g of xe){let R=A(g,y,n);R&&y.appendChild(R)}}finally{m.pop()}return y.appendChild(h),y}function Fe(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:m[m.length-1]||null,_errorBoundary:r,_startComment:i,_endComment:f};G.set(i,a);let h=document.createDocumentFragment();h._componentCtx=a,h.appendChild(i),h.appendChild(f);let y=N(()=>{let b=n();if(m.push(a),i.parentNode)for(;i.nextSibling&&i.nextSibling!==f;){let d=i.nextSibling;L(d),d.parentNode.removeChild(d)}let l;b?l=typeof o=="function"?[o({error:b,reset:s})]:[o]:l=c,l=Array.isArray(l)?l:[l];for(let d of l){let _=A(d,t);_&&(f.parentNode?f.parentNode.insertBefore(_,f):h.insertBefore(_,f))}m.pop()});return a.effects.push(y),h}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:m[m.length-1]||null,_suspenseBoundary:n,_startComment:c,_endComment:i};G.set(c,f);let a=document.createDocumentFragment();a._componentCtx=f,a.appendChild(c),a.appendChild(i);let h=0,y=N(()=>{let l=o()?[r]:s,d=Array.isArray(l)?l:[l],_=++h;if(m.push(f),c.parentNode)for(;c.nextSibling&&c.nextSibling!==i;){let w=c.nextSibling;L(w),w.parentNode.removeChild(w)}try{for(let w of d){let E=A(w,t);if(_!==h){E&&L(E);break}E&&(i.parentNode?i.parentNode.insertBefore(E,i):a.insertBefore(E,i))}}finally{m.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:m[m.length-1]||null},s=document.createComment("portal");s._componentCtx=o;let c=[];for(let i of r){let f=A(i,n);f&&(n.appendChild(f),c.push(f))}return o._cleanupCallbacks=[()=>{for(let i of c)L(i),i.parentNode&&i.parentNode.removeChild(i)}],s}function $e(e,t,n){let{tag:r,props:o,children:s}=e,c=n||Oe.has(r),i=c?document.createElementNS(Re,r):document.createElement(r);o&&Ge(i,o,{},c);let f=c&&r!=="foreignObject";for(let a=0;a<s.length;a++){let h=A(s[a],i,f);h&&i.appendChild(h)}return i._vnode=e,i}function Ge(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 Je(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]=N(()=>{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),Y(()=>a._handler(y)));a._handler=n,a._original=n,e._events[i]=a;let h=n._eventOpts;e.addEventListener(c,a,h||s||void 0);return}if(Pe(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??"";u&&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??"";u&&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{u&&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)){e.setAttribute(t,typeof n=="boolean"?String(n):n);return}if(typeof n=="boolean"){n?e.setAttribute(t,""):e.removeAttribute(t);return}if(t.startsWith("data-")){e.setAttribute(t,n);return}if(r){n===!1||n==null?e.removeAttribute(t):e.setAttribute(t,n===!0?"":String(n));return}if(t==="value"&&e.tagName==="SELECT"){Je(e,n);return}t in e?e[t]=n:e.setAttribute(t,n)}export{u as a,Xe as b,k as c,Qe as d,N as e,Ze as f,Ye as g,et as h,Y as i,tt as j,nt as k,rt as l,ot as m,st as n,it as o,ft as p,Ae as q,at as r,lt as s,gt as t,Ct as u,Ne as v,Le as w,wt as x,bt as y,St as z,De as A,xt as B,Et as C,At as D,Nt as E,Lt as F,Dt as G,Mt as H,Tt as I,Ot as J,Rt as K,Bt as L,Pt as M,_e as N,Pe as O,Ie as P,qe as Q,Ut as R,L as S,Vt as T,A as U,ge as V,Ft as W,We as X,Ue as Y,Je as Z};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{B as bt,N as q,O as xt,Q as mt,R as _t,S as z,U as Q,V as Ct,W as wt,X as At,Y as Et,Z as lt,a as U,c as R,e as j,m as J,q as yt}from"./chunk-NCPX66TV.min.js";import{a as X}from"./chunk-O3SKPRTY.min.js";var Lt=R(null);typeof document<"u"&&document.addEventListener("focusin",t=>{Lt.set(t.target)});function ae(){return{current:()=>Lt(),focus:t=>t?.focus(),blur:()=>document.activeElement?.blur()}}function de(){let t={current:null};function e(o){typeof document>"u"||(t.current=o||document.activeElement||null)}function n(o){let r=t.current||o;r&&typeof r.focus=="function"&&r.focus()}return{capture:e,restore:n,previous:()=>t.current}}function Gt(t){let e=null;function n(){if(typeof document>"u")return;e=document.activeElement;let r=t.current||t;if(!r||typeof r.querySelectorAll!="function")return;let i=Tt(r);if(i.length===0)return;i[0].focus();function g(c){if(c.key!=="Tab")return;let l=Tt(r),s=l[0],p=l[l.length-1];c.shiftKey?document.activeElement===s&&(c.preventDefault(),p.focus()):document.activeElement===p&&(c.preventDefault(),s.focus())}return r.addEventListener("keydown",g),()=>{r.removeEventListener("keydown",g)}}function o(){e&&typeof e.focus=="function"&&e.focus()}return{activate:n,deactivate:o}}function Tt(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},o=R(0),r=Gt(n),i=null,g=s=>{n.current=s,o.set(p=>p+1)},c=j(()=>{if(o(),i&&(i(),i=null,r.deactivate()),e&&n.current)return i=r.activate(),()=>{i?.(),i=null,r.deactivate()}}),l=Ct?.();return l&&(l._cleanupCallbacks=l._cleanupCallbacks||[],l._cleanupCallbacks.push(()=>{c(),i?.(),i=null,r.deactivate()})),X("div",{ref:g},t)}var O=null,ut=0;function Ut(){return typeof document>"u"?null:(O||(O=document.createElement("div"),O.id="what-announcer",O.setAttribute("aria-live","polite"),O.setAttribute("aria-atomic","true"),O.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(O)),O)}function qt(t,e={}){let{priority:n="polite",timeout:o=1e3}=e,r=Ut();if(!r)return;r.setAttribute("aria-live",n);let i=++ut;r.textContent="",requestAnimationFrame(()=>{ut===i&&(r.textContent=t)}),setTimeout(()=>{ut===i&&(r.textContent="")},o)}function pe(t){return qt(t,{priority:"assertive"})}function ge({href:t="#main",children:e="Skip to content"}){return X("a",{href:t,class:"what-skip-link",onClick:n=>{n.preventDefault();let o=document.querySelector(t);o&&(o.focus(),o.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 ye(t=!1){let e=R(t);return{expanded:()=>e(),toggle:()=>e.set(!e.peek()),open:()=>e.set(!0),close:()=>e.set(!1),buttonProps:()=>({"aria-expanded":e(),onClick:()=>e.set(!e.peek())}),panelProps:()=>({hidden:!e()})}}function be(t=null){let e=R(t);return{selected:()=>e(),select:n=>e.set(n),isSelected:n=>e()===n,itemProps:n=>({"aria-selected":e()===n,onClick:()=>e.set(n)})}}function xe(t=!1){let e=R(t);return{checked:()=>e(),toggle:()=>e.set(!e.peek()),set:n=>e.set(n),checkboxProps:()=>({role:"checkbox","aria-checked":e(),tabIndex:0,onClick:()=>e.set(!e.peek()),onKeyDown:n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),e.set(!e.peek()))}})}}function me(t){let e=typeof t=="function"?t:()=>t,n=R(0);function o(r){let i=e();if(!(i<=0))switch(r.key){case"ArrowDown":case"ArrowRight":r.preventDefault(),n.set((n.peek()+1)%i);break;case"ArrowUp":case"ArrowLeft":r.preventDefault(),n.set((n.peek()-1+i)%i);break;case"Home":r.preventDefault(),n.set(0);break;case"End":r.preventDefault(),n.set(i-1);break}}return{focusIndex:()=>n(),setFocusIndex:r=>n.set(r),getItemProps:r=>({tabIndex:n()===r?0:-1,onKeyDown:o,onFocus:()=>n.set(r)}),containerProps:()=>({role:"listbox"})}}function _e({children:t,as:e="span"}){return X(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 Ce({children:t,priority:e="polite",atomic:n=!0}){return X("div",{"aria-live":e,"aria-atomic":n},t)}var St=0;function Dt(){let t=yt();return t?(t.idCounter=(t.idCounter||0)+1,t.idCounter):++St}function Mt(){St=0}function Ht(t="what"){let e=`${t}-${Dt()}`;return()=>e}function we(t,e="what"){let n=[];for(let o=0;o<t;o++)n.push(`${e}-${Dt()}`);return n}function Ae(t){let e=Ht("desc");return{descriptionId:e,descriptionProps:()=>({id:e(),style:{display:"none"}}),describedByProps:()=>({"aria-describedby":e()}),Description:()=>X("div",{id:e(),style:{display:"none"}},t)}}function Ee(t){let e=Ht("label");return{labelId:e,labelProps:()=>({id:e()}),labelledByProps:()=>({"aria-labelledby":e()})}}var Te={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Home:"Home",End:"End",Tab:"Tab"};function Le(t,e){return n=>{n.key===t&&e(n)}}function Se(t,e){return n=>{t.includes(n.key)&&e(n)}}var v=null;function Re(t){v=typeof t=="function"?t:null}function Ve(t,e,n){if(typeof n=="function"){let o=()=>{let r=n();return r.length===1?r[0]:r};return o._lazyChildren=!0,e||(e={}),Object.defineProperty(e,"_$lazyChildren",{value:o,configurable:!0}),Q({tag:t,props:e,children:[],key:null,_vnode:!0})}if(n&&n.length>0){let o=n.length===1?n[0]:n;e?e.children=o:e={children:o}}return Q({tag:t,props:e||{},children:n||[],key:null,_vnode:!0})}var Wt={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>"}},It=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 Nt(t){let e=t.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);return e?e[1]:""}function Xt(t){let e=t.trim(),n=Nt(e);if(It.has(n))return Zt(e);let o=Wt[n];if(o){let i=document.createElement("template");i.innerHTML=o.wrap+e+o.unwrap;let g=i.content.firstChild;for(let c=0;c<o.depth;c++)g=g.firstChild;return()=>g.cloneNode(!0)}let r=document.createElement("template");return r.innerHTML=e,()=>r.content.firstChild.cloneNode(!0)}var Bt=!1;function ze(t){return U&&!Bt&&(Bt=!0,console.warn("[what] template() is a compiler internal. Use JSX instead. Direct calls with user input can lead to XSS vulnerabilities.")),Xt(t)}function Zt(t){let e=t.trim();if(Nt(e)==="svg"){let r=document.createElement("template");return r.innerHTML=e,()=>r.content.firstChild.cloneNode(!0)}let o=document.createElement("template");return o.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,()=>o.content.firstChild.firstChild.cloneNode(!0)}function Rt(t,e,n){if(typeof e=="function"&&e._mapArray)return e(t,n||null);if(typeof e=="function"&&e._lazyChildren)return Rt(t,e(),n);if(typeof e=="function"){let o=n||null,r=null,i=null,g=!1;return j(()=>{let c=e(),l=typeof c;if(!g){g=!0,l==="string"||l==="number"?(i=document.createTextNode(String(c)),o?t.insertBefore(i,o):t.appendChild(i),v&&v(t,String(c)),r=i):r=F(t,c,null,o);return}if(i!==null&&(l==="string"||l==="number")){let s=String(c);i.data!==s&&(i.data=s),v&&v(t,s);return}i=null,r=F(t,c,r,o)}),r}if(typeof e=="string"||typeof e=="number"){let o=document.createTextNode(String(e));return n?t.insertBefore(o,n):t.appendChild(o),o}return e!=null&&typeof e=="object"&&e.nodeType>0?(n?t.insertBefore(e,n):t.appendChild(e),e):F(t,e,null,n||null)}function Vt(t){return!t||typeof t!="object"?!1:typeof Node<"u"&&t instanceof Node?!0:typeof t.nodeType=="number"&&typeof t.nodeName=="string"}function Jt(t){return!!t&&typeof t=="object"&&(t._vnode===!0||"tag"in t)}var ft=typeof SVGElement<"u";function jt(t){return ft&&t instanceof SVGElement&&t.tagName!=="foreignObject"}function Pt(t){return t==null?[]:Array.isArray(t)?t:[t]}function zt(t,e,n){if(t==null||typeof t=="boolean")return n;if(Array.isArray(t)){for(let o=0;o<t.length;o++)zt(t[o],e,n);return n}if(typeof t=="function"){let o=Q(t,e,jt(e));if(o&&o.nodeType===11){let r=Array.from(o.childNodes);for(let i=0;i<r.length;i++)n.push(r[i])}else o&&n.push(o);return n}if(typeof t=="string"||typeof t=="number")return n.push(document.createTextNode(String(t))),n;if(Vt(t)){if(t.nodeType===11&&t.childNodes.length>0){let o=Array.from(t.childNodes);for(let r=0;r<o.length;r++)n.push(o[r])}else n.push(t);return n}if(Jt(t)){let o=Q(t,e,jt(e));if(o&&o.nodeType===11)if(o.childNodes.length===0)n.push(o);else{let r=Array.from(o.childNodes);for(let i=0;i<r.length;i++)n.push(r[i])}else o&&n.push(o);return n}return n.push(document.createTextNode(String(t))),n}function Qt(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 F(t,e,n,o){if(!t||typeof t.insertBefore!="function")return U&&console.warn("[what] reconcileInsert called with invalid parent:",t),n;let r=o||null;if(e==null||typeof e=="boolean"){let s=Pt(n);for(let p=0;p<s.length;p++){let u=s[p];u.parentNode===t&&(z(u),t.removeChild(u))}return null}if((typeof e=="string"||typeof e=="number")&&n&&!Array.isArray(n)&&n.nodeType===3){let s=String(e);return n.data!==s&&(n.data=s),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?(z(n),t.replaceChild(e,n)):r?t.insertBefore(e,r):t.appendChild(e),e}let i=zt(e,t,[]),g=Pt(n);if(Qt(g,i))return n;let c=i.length;for(let s=0;s<g.length;s++){let p=g[s];if(p.parentNode!==t)continue;let u=!1;for(let C=0;C<c;C++)if(i[C]===p){u=!0;break}u||(z(p),t.removeChild(p))}let l=r;for(let s=i.length-1;s>=0;s--){let p=i[s];(p.parentNode!==t||p.nextSibling!==l)&&(l&&l.parentNode!==t&&(l=null),l?t.insertBefore(p,l):t.appendChild(p)),l=p}return i.length===0?null:i.length===1?i[0]:i}function Oe(t,e,n){let o=n?.key,r=n?.raw||!1,i=(g,c)=>{let l=[],s=[],p=[],u=o&&!r?new Map:null,C=document.createComment("/list");return g.insertBefore(C,c||null),j(()=>{let y=t()||[],b=C.parentNode||g;o?te(b,C,l,y,s,p,e,o,u):Yt(b,C,l,y,s,p,e),l=y.length>0?y.slice():y}),C};return i._mapArray=!0,i}function Yt(t,e,n,o,r,i,g){let c=o.length,l=n.length;if(c===0){if(l>0){for(let a=0;a<l;a++)i[a]&&i[a]();for(let a=l-1;a>=0;a--){let d=r[a];d&&(z(d),d.parentNode===t&&t.removeChild(d))}r.length=0,i.length=0}return}if(l===0){let a=document.createDocumentFragment();for(let d=0;d<c;d++){let E=o[d],L=J(N=>(i[d]=N,g(E,d)));r[d]=L,a.appendChild(L)}t.insertBefore(a,e);return}let s=0,p=Math.min(l,c);for(;s<p&&n[s]===o[s];)s++;if(s===l&&s===c)return;let u=l-1,C=c-1;for(;u>=s&&C>=s&&n[u]===o[C];)u--,C--;let y=new Array(c),b=new Array(c);for(let a=0;a<s;a++)y[a]=r[a],b[a]=i[a];for(let a=C+1;a<c;a++){let d=u+1+(a-C-1);y[a]=r[d],b[a]=i[d]}let m=C-s+1,A=u-s+1;if(m===0)for(let a=s;a<=u;a++)i[a]?.(),r[a]&&z(r[a]),r[a]?.parentNode&&r[a].parentNode.removeChild(r[a]);else if(A===0){let a=s<c&&y[C+1]?y[C+1]:e,d=document.createDocumentFragment();for(let E=s;E<=C;E++){let L=o[E],N=E;y[E]=J(S=>(b[N]=S,g(L,N))),d.appendChild(y[E])}t.insertBefore(d,a)}else kt(t,e,n,o,r,i,g,s,u,C,y,b);r.length=c,i.length=c;for(let a=0;a<c;a++)r[a]=y[a],i[a]=b[a]}function kt(t,e,n,o,r,i,g,c,l,s,p,u){let C=new Map;for(let d=c;d<=l;d++)C.set(n[d],d);let y=s-c+1,b=new Int32Array(y);b.fill(-1);for(let d=c;d<=s;d++){let E=C.get(o[d]);E!==void 0&&(C.delete(o[d]),p[d]=r[E],u[d]=i[E],b[d-c]=E)}for(let[,d]of C)i[d]?.(),r[d]&&z(r[d]),r[d]?.parentNode&&r[d].parentNode.removeChild(r[d]);let m=y-vt(b,y),A=new Uint8Array(y);if(m>1){let d=new Int32Array(m),E=new Int32Array(m),L=0;for(let S=0;S<y;S++)b[S]!==-1&&(d[L]=b[S],E[L]=S,L++);let N=Ot(d,m);for(let S=0;S<N.length;S++)A[E[N[S]]]=1}else if(m===1){for(let d=0;d<y;d++)if(b[d]!==-1){A[d]=1;break}}for(let d=c;d<=s;d++)if(!p[d]){let E=o[d],L=d;p[d]=J(N=>(u[L]=N,g(E,L)))}let a=s+1<p.length&&p[s+1]?p[s+1]:e;for(let d=s;d>=c;d--){let E=d-c;(b[E]===-1||!A[E])&&(a&&a.parentNode!==t&&(a=e),t.insertBefore(p[d],a)),a=p[d]}}function vt(t,e){let n=0;for(let o=0;o<e;o++)t[o]===-1&&n++;return n}function Ot(t,e){if(e===0)return[];if(e===1)return[0];let n=new Int32Array(e),o=new Int32Array(e),r=1;n[0]=0,o[0]=-1;for(let c=1;c<e;c++)if(t[c]>t[n[r-1]])o[c]=n[r-1],n[r++]=c;else{let l=0,s=r-1;for(;l<s;){let p=l+s>>1;t[n[p]]<t[c]?l=p+1:s=p}n[l]=c,o[c]=l>0?n[l-1]:-1}let i=new Array(r),g=n[r-1];for(let c=r-1;c>=0;c--)i[c]=g,g=o[g];return i}function Ft(){return document.createComment("i")}function Y(t,e,n,o){let r=e;for(;r&&r!==n;){let i=r.nextSibling;t.insertBefore(r,o),r=i}}function at(t,e,n){let o=e;for(;o&&o!==n;){let r=o.nextSibling;z(o),t.removeChild(o),o=r}}function dt(t,e,n,o,r,i,g,c,l){let s;if(r){let C=o(e),y=l(e);s=y,r.set(C,{itemSig:y})}else s=e;let p=Ft();t.appendChild(p);let u=J(C=>(c[n]=C,i(s,n)));t.appendChild(u),g[n]=p}function te(t,e,n,o,r,i,g,c,l){let s=o.length,p=n.length;if(s===0){if(p>0){for(let f=0;f<p;f++)i[f]&&i[f]();r[0]&&at(t,r[0],e),r.length=0,i.length=0,l&&l.clear()}return}if(p===0){let f=document.createDocumentFragment();for(let _=0;_<s;_++)dt(f,o[_],_,c,l,g,r,i,R);t.insertBefore(f,e);return}let u=0,C=Math.min(p,s);for(;u<C;){if(n[u]===o[u]){u++;continue}let f=c(n[u]),_=c(o[u]);if(f!==_)break;l&&l.get(f).itemSig.set(o[u]),u++}let y=p-1,b=s-1;for(;y>=u&&b>=u;){if(n[y]===o[b]){y--,b--;continue}let f=c(n[y]),_=c(o[b]);if(f!==_)break;l&&l.get(f).itemSig.set(o[b]),y--,b--}if(u>y&&u>b)return;let m=new Array(s),A=new Array(s);for(let f=0;f<u;f++)m[f]=r[f],A[f]=i[f];for(let f=b+1;f<s;f++){let _=y+1+(f-b-1);m[f]=r[_],A[f]=i[_]}let a=b-u+1,d=y-u+1;if(d===0){let f=b+1<s&&m[b+1]?m[b+1]:e,_=document.createDocumentFragment();for(let T=u;T<=b;T++)dt(_,o[T],T,c,l,g,m,A,R);t.insertBefore(_,f),k(r,i,m,A,s);return}if(a===0){for(let f=u;f<=y;f++){i[f]?.();let _=W(t,r[f],r,f,e);at(t,r[f],_),l&&l.delete(c(n[f]))}k(r,i,m,A,s);return}if(a===d&&a>=2&&a<=Math.max(d,200)){let f=0,_=-1,T=-1;for(let x=0;x<a&&f<=4;x++){let w=c(n[u+x]),K=c(o[u+x]);w!==K&&(f===0?_=x:f===1&&(T=x),f++)}if(f===2){let x=u+_,w=u+T,K=c(n[x]),$=c(n[w]),I=c(o[x]),ot=c(o[w]);if(K===ot&&$===I){for(let h=0;h<u;h++)m[h]=r[h],A[h]=i[h];for(let h=u;h<=b;h++)m[h]=r[h],A[h]=i[h];for(let h=b+1;h<s;h++){let P=y+1+(h-b-1);m[h]=r[P],A[h]=i[P]}let G=m[x];m[x]=m[w],m[w]=G;let H=A[x];if(A[x]=A[w],A[w]=H,l){if(o[x]!==n[x]){let h=c(o[x]),P=l.get(h);P&&P.itemSig.set(o[x])}if(o[w]!==n[w]){let h=c(o[w]),P=l.get(h);P&&P.itemSig.set(o[w])}}let M=w===x+1||x===w+1,B=Math.min(x,w),D=Math.max(x,w);if(M){let h=W(t,r[D],r,D,e);Y(t,r[D],h,r[B])}else{let h=W(t,r[w],r,w,e),P=document.createComment("tmp");t.insertBefore(P,r[w]),Y(t,r[w],h,r[x]);let rt=W(t,r[x],r,x,e);Y(t,r[x],rt,P),t.removeChild(P)}k(r,i,m,A,s);return}}if(f>=2&&f<=a){let x=_,w=null,K=-1,$=-1,I=!1,ot=c(n[u+x]),G=-1;for(let H=x;H<a;H++)if(c(o[u+H])===ot){G=H;break}if(G>x){let H=!0;for(let M=x;M<G;M++)if(c(n[u+M+1])!==c(o[u+M])){H=!1;break}if(H){let M=!0;for(let B=G+1;B<a;B++)if(c(n[u+B])!==c(o[u+B])){M=!1;break}M&&(I=!0,K=u+x,$=u+G,w=ot)}}if(!I){let H=c(o[u+x]),M=-1;for(let B=x;B<d;B++)if(c(n[u+B])===H){M=B;break}if(M>x){let B=!0;for(let D=x;D<M;D++)if(c(n[u+D])!==c(o[u+D+1])){B=!1;break}if(B){let D=!0;for(let h=M+1;h<a;h++)if(c(n[u+h])!==c(o[u+h])){D=!1;break}D&&(I=!0,K=u+M,$=u+x,w=H)}}}if(I){for(let h=u;h<=y;h++)m[h]=r[h],A[h]=i[h];let H=m[K],M=A[K];if(K<$)for(let h=K;h<$;h++)m[h]=m[h+1],A[h]=A[h+1];else for(let h=K;h>$;h--)m[h]=m[h-1],A[h]=A[h-1];if(m[$]=H,A[$]=M,l)for(let h=u;h<=b;h++){let P=c(o[h]);if(o[h]!==n[h]){let rt=l.get(P);rt&&rt.itemSig.set(o[h])}}let B=W(t,H,r,K,e),D;$+1<s?D=m[$+1]:D=e,($>=b+1||D&&D.parentNode!==t)&&(D=e),Y(t,H,B,D),k(r,i,m,A,s);return}}}let E=new Map;for(let f=u;f<=y;f++)E.set(c(n[f]),f);let L=new Int32Array(a);L.fill(-1);for(let f=u;f<=b;f++){let _=c(o[f]),T=E.get(_);T!==void 0&&(E.delete(_),m[f]=r[T],A[f]=i[T],L[f-u]=T,l&&o[f]!==n[T]&&l.get(_).itemSig.set(o[f]))}let N=[...E.values()].sort((f,_)=>_-f);for(let f of N){i[f]?.();let _=W(t,r[f],r,f,e);at(t,r[f],_),l&&l.delete(c(n[f]))}for(let f=u;f<=b;f++)if(!m[f]){let _=document.createDocumentFragment();dt(_,o[f],f,c,l,g,m,A,R),m[f]._frag=_}let S=0,pt=!0,gt=-1;for(let f=0;f<a;f++)L[f]!==-1&&(S++,L[f]<=gt&&(pt=!1),gt=L[f]);let nt=new Uint8Array(a);if(pt)for(let f=0;f<a;f++)L[f]!==-1&&(nt[f]=1);else if(S>1){let f=new Int32Array(S),_=new Int32Array(S),T=0;for(let w=0;w<a;w++)L[w]!==-1&&(f[T]=L[w],_[T]=w,T++);let x=Ot(f,S);for(let w=0;w<x.length;w++)nt[_[x[w]]]=1}else if(S===1){for(let f=0;f<a;f++)if(L[f]!==-1){nt[f]=1;break}}k(r,i,m,A,s);let st=b+1<s&&r[b+1]?r[b+1]:e;for(let f=b;f>=u;f--){let _=f-u,T=r[f];if(L[_]===-1)T._frag&&(t.insertBefore(T._frag,st),delete T._frag);else if(!nt[_]){let x=W(t,T,r,f,e);Y(t,T,x,st)}st=T}}function W(t,e,n,o,r){let i=e.nextSibling;for(;i&&i!==r;){if(i.nodeType===8&&i.data==="i")return i;i=i.nextSibling}return r}function k(t,e,n,o,r){t.length=r,e.length=r;for(let i=0;i<r;i++)t[i]=n[i],e[i]=o[i]}function Ge(t,e){for(let n in e){let o=e[n];if(q(n)){if(typeof o!="function")continue;let r=n.slice(2).toLowerCase();t.addEventListener(r,o);continue}if(typeof o=="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 r=o()||"";ft&&t instanceof SVGElement?t.setAttribute("class",r):t.className=r}):n==="style"&&typeof o()=="object"?t._propEffects[n]=j(()=>{ct(t,o())}):t._propEffects[n]=j(()=>{tt(t,n,o())})}else tt(t,n,o)}}function tt(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(()=>tt(t,e,n()));return}if(q(e))return;if(xt(e,n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${e}" attribute:`,n);return}let o=ft&&t instanceof SVGElement;if(e==="class"||e==="className")o?t.setAttribute("class",n||""):t.className=n||"";else if(e==="dangerouslySetInnerHTML"){let r=n?.__html??"";typeof U<"u"&&U&&typeof r=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(r)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=r}else if(e==="innerHTML")if(n&&typeof n=="object"&&"__html"in n){let r=n.__html??"";typeof U<"u"&&U&&typeof r=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(r)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=r}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")ct(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):o?t.setAttribute(e,n):e==="value"&&t.tagName==="SELECT"?lt(t,n):e in t?t[e]=n:t.setAttribute(e,n)}function et(t,e,n,o){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=j(()=>o(t,n()))}function ee(t,e){if(typeof e=="function")return et(t,"class",e,ee);ft&&t instanceof SVGElement?t.setAttribute("class",e||""):t.className=e||""}function ct(t,e){if(typeof e=="function")return et(t,"style",e,ct);if(typeof e=="string")t.style.cssText=e,t._lastStyleObj=null;else if(e&&typeof e=="object"){let n=t.style,o=t._lastStyleObj;if(o)for(let r in o)r in e||(n[r]="");for(let r in e)n[r]=e[r]??"";t._lastStyleObj=e}else e==null&&(t.style.cssText="",t._lastStyleObj=null)}function ne(t,e,n){if(typeof n=="function")return et(t,e,n,(o,r)=>ne(o,e,r));n==null?t.removeAttribute(e):t.setAttribute(e,n)}function oe(t,e){if(typeof e=="function")return et(t,"value",e,oe);if(t.tagName==="SELECT"){lt(t,e);return}let n=e==null?"":String(e);t.value!==n&&(t.value=n)}function re(t,e){if(typeof e=="function")return et(t,"checked",e,re);t.checked=!!e}var Kt=new Set;function Ue(t){for(let e of t)Kt.has(e)||(Kt.add(e),document.addEventListener(e,n=>{let o=n.target,r="$$"+e;for(Object.defineProperty(n,"currentTarget",{configurable:!0,get(){return o||document}});o;){let i=o[r];if(i&&(i(n),n.cancelBubble))return;o=o.parentNode}}))}function qe(t,e,n){return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}function We(t,e){j(()=>{for(let n in e){let o=typeof e[n]=="function"?e[n]():e[n];t.classList.toggle(n,!!o)}})}var it=!1,V=null;function Ie(){return it}function ie(t,e){it=!0,Mt(),V={parent:e,index:0};try{return Z(t,e)}finally{it=!1,V=null}}function $t(t){let e=t.childNodes;for(;V.index<e.length;){let n=e[V.index];if(n.nodeType===8){let o=n.textContent;if(o==="$"||o==="/$"||o==="[]"||o==="/[]"){V.index++;continue}}return V.index++,n}return null}function ht(){return typeof process<"u"&&!1}function Z(t,e){if(t==null||typeof t=="boolean")return null;if(typeof t=="string"||typeof t=="number"){let o=$t(e),r=String(t);if(o&&o.nodeType===3)return ht()&&o.textContent!==r&&(console.warn(`[what] Hydration mismatch: expected text "${r}", got "${o.textContent}"`),o.textContent=r),o;ht()&&console.warn(`[what] Hydration mismatch: expected text node "${r}", got ${o?o.nodeName:"nothing"}. Falling back to client render.`);let i=document.createTextNode(r);return o?e.replaceChild(i,o):e.appendChild(i),i}if(typeof t=="function"&&t._lazyChildren)return Z(t(),e);if(typeof t=="function"){let o=t(),r=Z(o,e),i=j(()=>{let g=t();it||(r=F(e,g,r,null))});return mt(r&&r.nodeType?r:e,i),r}if(Array.isArray(t)){let o=[];for(let r of t){let i=Z(r,e);i&&o.push(i)}return o.length===1?o[0]:o}if(typeof t=="object"&&t._vnode){if(typeof t.tag=="function"){let g=wt(),c=t.tag,l=t.props||{},s=t.children||[],p={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:c,_parentCtx:g[g.length-1]||null,_errorBoundary:null};g.push(p);let u,C=null;try{let y={...l};l._$lazyChildren?C=At(c,y,l._$lazyChildren):y.children=s.length===0?l.children:s.length===1?s[0]:s,u=c(y),C&&C()}catch(y){return g.pop(),Et(y)||console.error("[what] Error in component during hydration:",c.name||"Anonymous",y),null}p.mounted=!0,p._mountCallbacks&&queueMicrotask(()=>{if(!p.disposed)for(let y of p._mountCallbacks)try{y()}catch(b){console.error("[what] onMount error:",b)}});try{let y=Z(u,e),b=Array.isArray(y)?y[0]:y;return _t(b&&b.nodeType?b:e,p),y}finally{g.pop()}}let o=$t(e),r=t.tag.toUpperCase();if(o&&o.nodeType===1&&o.nodeName===r){fe(o,t.props||{});let g=V;if(V={parent:o,index:0},t.props?.dangerouslySetInnerHTML?.__html==null)for(let l of t.children)Z(l,o);return V=g,o}ht()&&console.warn(`[what] Hydration mismatch: expected <${t.tag}>, got ${o?o.nodeName:"nothing"}. Falling back to client render.`);let i=document.createElement(t.tag);for(let g in t.props||{})g==="children"||g==="key"||tt(i,g,t.props[g]);for(let g of t.children)F(i,g,null,null);return o?e.replaceChild(i,o):e.appendChild(i),i}if(Vt(t))return t;let n=document.createTextNode(String(t));return e.appendChild(n),n}function fe(t,e){for(let n in e){if(n==="children"||n==="key"||n==="dangerouslySetInnerHTML"||n==="innerHTML")continue;if(n==="ref"){let r=e.ref;typeof r=="function"?r(t):r&&typeof r=="object"&&(r.current=t);continue}let o=e[n];if(q(n)){if(typeof o!="function")continue;let r=n.slice(2).toLowerCase();t.addEventListener(r,o);continue}if(n.startsWith("$$")){t[n]=o;continue}if(typeof o=="function"&&!q(n)){n==="class"||n==="className"?j(()=>{t.className=o()||""}):n==="style"&&typeof o()=="object"?j(()=>{ct(t,o())}):j(()=>{tt(t,n,o())});continue}}}bt({hydrate:ie,insert:Rt});export{ae as a,de as b,Gt as c,he as d,qt as e,pe as f,ge as g,ye as h,be as i,xe as j,me as k,_e as l,Ce as m,Ht as n,we as o,Ae as p,Ee as q,Te as r,Le as s,Se as t,Re as u,Ve as v,Xt as w,ze as x,Zt as y,Rt as z,Oe as A,Ge as B,tt as C,ee as D,ct as E,ne as F,oe as G,re as H,Ue as I,qe as J,We as K,Ie as L,ie as M};
|
package/dist/index.min.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import{a as Xt,b as Qt,c as zt,d as Oe,e as Ut,f as Kt,g as Jt,h as Zt,i as en,o as tn,p as nn,q as rn,r as on,s as sn}from"./chunk-JIZR6JX5.min.js";import{A as $t,B as Ht,C as Vt,D as jt,E as qt,F as Bt,G as Gt,H as Wt,N as Yt,P as $,a as F,b as yt,c as l,d as N,e as O,f as D,g as xt,h as vt,i as le,j as wt,k as bt,l as kt,n as St,o as Et,p as At,q as Rt,r as It,s as Tt,t as Dt,u as Lt,v as Mt,w as Ft,x as Pt,y as Nt,z as Ot}from"./chunk-PABR63P3.min.js";import{a as w,b as Ct,c as _t}from"./chunk-O3SKPRTY.min.js";var se=null,fe=null;function an(e){fe||(fe=e)}function ie(){return fe?.getStore()??se}function cn(e){let t=se;return se=e,t}function un(e,t){if(fe)return fe.run(e,t);let n=se;se=e;try{return t()}finally{se=n}}var Q;function _e(){if(Q!==void 0)return Q;if(typeof document>"u")return Q=null;let e=document.getElementById("__what_data");if(!e)return Q=null;try{Q=JSON.parse(e.textContent)}catch{Q=null}return Q}function ln(){Q=void 0}function Ae(){let e=_e();return e?e.loaderData:void 0}function Re(e){let t=_e();return t&&t.resources?t.resources[e]:void 0}function fn(){if(typeof document>"u"){let e=ie();return e?e.loaderData:void 0}return Ae()}function j(e){let t=$();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 z(e){let t=e.hookIndex++;return{index:t,exists:t<e.hooks.length}}function dn(e){let t=j("useState"),{index:n,exists:o}=z(t);if(!o){let s=l(typeof e=="function"?e():e);t.hooks[n]=s}let r=t.hooks[n];return[r,r.set]}function pn(e){let t=j("useSignal"),{index:n,exists:o}=z(t);return o||(t.hooks[n]=l(typeof e=="function"?e():e)),t.hooks[n]}function hn(e){let t=j("useComputed"),{index:n,exists:o}=z(t);return o||(t.hooks[n]=N(e)),t.hooks[n]}function gn(e,t){let n=j("useEffect"),{index:o,exists:r}=z(n);if(r||(n.hooks[o]={cleanup:null,dispose:null}),F&&Array.isArray(t)&&t.length>0)for(let i=0;i<t.length;i++){let a=t[i];a!=null&&typeof a!="function"&&console.warn(`[what] useEffect dep at index ${i} is not a function. Did you mean to pass a signal? Use count instead of count()`)}let s=n.hooks[o];s.dispose||(t===void 0?queueMicrotask(()=>{n.disposed||(s.dispose=O(()=>{if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let i=e();typeof i=="function"&&(s.cleanup=i)}),n.effects=n.effects||[],n.effects.push(s.dispose))}):t.length===0?(queueMicrotask(()=>{if(n.disposed)return;let i=e();typeof i=="function"&&(s.cleanup=i)}),s.dispose=!0):queueMicrotask(()=>{n.disposed||(s.dispose=O(()=>{for(let a=0;a<t.length;a++){let u=t[a];typeof u=="function"&&u._signal&&u()}if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let i=le(()=>e());typeof i=="function"&&(s.cleanup=i)}),n.effects=n.effects||[],n.effects.push(s.dispose))}))}function mn(e,t){let n=j("useMemo"),{index:o,exists:r}=z(n);return r||(n.hooks[o]={computed:N(e)}),n.hooks[o].computed}function yn(e,t){let n=j("useCallback"),{index:o,exists:r}=z(n);return r||(n.hooks[o]={callback:e}),n.hooks[o].callback}function xn(e){let t=j("useRef"),{index:n,exists:o}=z(t);return o||(t.hooks[n]={current:e}),t.hooks[n]}function $e(e){let t=$();for(F&&!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 vn(e){let t={_defaultValue:e,Provider:({value:n,children:o})=>{let r=j("Context.Provider");if(r._contextValues||(r._contextValues=new Map),r._contextSignals||(r._contextSignals=new Map),r._contextSignals.has(t))r._contextSignals.get(t).set(n);else{let s=l(n);r._contextSignals.set(t,s),r._contextValues.set(t,s)}return o},Consumer:({children:n})=>{let o=$e(t);return typeof n=="function"?n(o):n}};return t.Provider._deferChildren=!0,t}function wn(e,t,n){let o=j("useReducer"),{index:r,exists:s}=z(o);if(!s){let a=n?n(t):t,u=l(a),f=c=>{u.set(d=>e(d,c))};o.hooks[r]={signal:u,dispatch:f}}let i=o.hooks[r];return[i.signal,i.dispatch]}function bn(e){let t=j("onMount");t.mounted||(t._mountCallbacks=t._mountCallbacks||[],t._mountCallbacks.push(e))}function kn(e){let t=j("onCleanup");t._cleanupCallbacks=t._cleanupCallbacks||[],t._cleanupCallbacks.push(e)}function Sn(e,t={}){if(typeof document>"u"){let c=ie();if(c){let d=t.key!=null?t.key:`__r${c.resourceCounter++}`,h=c.resources.get(d);if(h&&h.status==="ready")return[()=>h.value,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];if(h&&h.status==="error")return[()=>{},{loading:()=>!1,error:()=>h.error,refetch:()=>{},mutate:()=>{}}];if(!h){let v=Promise.resolve().then(()=>e(t.source??!0,{})).then(b=>{c.resources.set(d,{status:"ready",value:b})}).catch(b=>{c.resources.set(d,{status:"error",error:b})});throw c.resources.set(d,{status:"pending",promise:v}),v}throw h.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 c=Re(t.key);c!==void 0&&(n=c)}let o=l(n??null),r=l(n==null),s=l(null),i=null,a=async c=>{i&&i.abort(),i=new AbortController;let{signal:d}=i;r.set(!0),s.set(null);try{let h=await e(c,{signal:d});d.aborted||D(()=>{o.set(h),r.set(!1)})}catch(h){d.aborted||D(()=>{s.set(h),r.set(!1)})}},u=c=>{o.set(typeof c=="function"?c(o()):c)},f=$?.();return f&&(f._cleanupCallbacks=f._cleanupCallbacks||[],f._cleanupCallbacks.push(()=>{i&&i.abort()})),n==null&&a(t.source),[o,{loading:r,error:s,refetch:a,mutate:u}]}function je(e){return e._storeComputed=!0,e}var He=!1;function En(e){return He||(He=!0,console.warn("[what] storeComputed() is deprecated. Use derived() instead.")),je(e)}function Cn(e){let t={},n={},o={},r={};for(let[s,i]of Object.entries(e))typeof i=="function"&&i._storeComputed?(F&&i.length===0&&console.warn(`[what] derived() for "${s}" should accept the state parameter, e.g. derived(state => ...).`),n[s]=i):typeof i=="function"?o[s]=i:t[s]=l(i);for(let[s,i]of Object.entries(n)){let a=new Proxy({},{get(u,f){if(t[f])return t[f]();if(n[f])return n[f]()}});n[s]=N(()=>i(a))}for(let[s,i]of Object.entries(o))o[s]=(...a)=>{let u;return D(()=>{let f=new Proxy({},{get(c,d){if(t[d])return t[d].peek();if(n[d])return n[d].peek();if(o[d])return o[d]},set(c,d,h){return t[d]&&t[d].set(h),!0}});u=i.apply(f,a)}),u};return function(){let i={};for(let[a,u]of Object.entries(t))Object.defineProperty(i,a,{get:()=>u(),enumerable:!0});for(let[a,u]of Object.entries(n))Object.defineProperty(i,a,{get:()=>u(),enumerable:!0});for(let[a,u]of Object.entries(o))i[a]=u;return i}}var Ve=!1;function _n(e){return Ve||(Ve=!0,console.warn("[what] atom() is deprecated. Use signal() directly instead.")),l(e)}var Ie={title:null,metas:new Map,links:new Map};function An({title:e,meta:t,link:n,children:o}){if(typeof document>"u"){let r=ie();return r&&r.head&&In(r.head,{title:e,meta:t,link:n}),o??null}if(e&&(document.title=e,Ie.title=e),t)for(let r of Array.isArray(t)?t:[t]){let s=r.name||r.property||r.httpEquiv||JSON.stringify(r);Be("meta",s,r)}if(n)for(let r of Array.isArray(n)?n:[n]){let s=r.rel+(r.href||"");Be("link",s,r)}return o||null}function Rn(e){return e.name||e.property||e.httpEquiv||JSON.stringify(e)}function In(e,{title:t,meta:n,link:o}){if(t!=null&&(e.title=t),n)for(let r of Array.isArray(n)?n:[n])e.metas.set(Rn(r),r);if(o)for(let r of Array.isArray(o)?o:[o])e.links.set(r.rel+(r.href||""),r)}function Tn(){return{title:null,metas:new Map,links:new Map}}function Dn(e){if(!e)return"";let t="";e.title!=null&&(t+=`<title>${Ge(String(e.title))}</title>`);for(let n of e.metas.values())t+=qe("meta",n);for(let n of e.links.values())t+=qe("link",n);return t}var Ln=/^[a-zA-Z_:][a-zA-Z0-9:._-]*$/;function Te(e){if(!Ln.test(e))return!1;let t=e.toLowerCase();return!(t.startsWith("on")&&t.length>2)}function ve(e){return e==="httpEquiv"?"http-equiv":e}function qe(e,t){let n=`<${e}`;for(let[o,r]of Object.entries(t)){if(r==null||r===!1)continue;let s=ve(o);Te(s)&&(n+=` ${s}="${Ge(String(r))}"`)}return n+">"}function Ge(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Mn(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 Be(e,t,n){let o=document.head.querySelector(`[data-what-head="${Mn(t)}"]`);if(o){Fn(o,n);return}let r=document.createElement(e);r.setAttribute("data-what-head",t);for(let[s,i]of Object.entries(n))Te(ve(s))&&r.setAttribute(ve(s),i);document.head.appendChild(r)}function Fn(e,t){for(let[n,o]of Object.entries(t)){let r=ve(n);Te(r)&&e.getAttribute(r)!==o&&e.setAttribute(r,o)}}function Pn(){let e=document.head.querySelectorAll("[data-what-head]");for(let t of e)t.remove();Ie.metas.clear(),Ie.links.clear()}var pe=[],he=[],Le=!1;function G(e){return pe.push(e),Ye(),()=>{let t=pe.indexOf(e);t!==-1&&pe.splice(t,1)}}function U(e){return he.push(e),Ye(),()=>{let t=he.indexOf(e);t!==-1&&he.splice(t,1)}}function We(){for(;pe.length>0;){let e=pe.shift();try{e()}catch(t){console.error("[what] Scheduler read error:",t)}}for(;he.length>0;){let e=he.shift();try{e()}catch(t){console.error("[what] Scheduler write error:",t)}}Le=!1}function Ye(){Le||(Le=!0,requestAnimationFrame(We))}function Nn(e){return new Promise(t=>{G(()=>{t(e())})})}function On(e){return new Promise(t=>{U(()=>{e(),t()})})}function $n(e,t){let n=Symbol("scheduledEffect");return O(()=>{Xe(n,()=>{G(()=>{let o=e();t&&U(()=>t(o))})})})}function Hn(){let e,t=new Promise((n,o)=>{let r=requestAnimationFrame(n);e=()=>{cancelAnimationFrame(r),o(new Error("Cancelled"))}});return t.cancel=e,t}var de=new Map;function Xe(e,t){de.has(e)?de.set(e,t):(de.set(e,t),requestAnimationFrame(()=>{let n=de.get(e);de.delete(e),n&&n()}))}var De=new WeakMap,we=null;function Vn(e,t){return typeof ResizeObserver>"u"?(t(e.getBoundingClientRect()),()=>{}):(we||(we=new ResizeObserver(n=>{G(()=>{for(let o of n){let r=De.get(o.target);r&&r(o.contentRect)}})})),De.set(e,t),we.observe(e),()=>{De.delete(e),we.unobserve(e)})}function jn(e,t,n={}){if(typeof IntersectionObserver>"u")return t({isIntersecting:!0,intersectionRatio:1}),()=>{};let o=new IntersectionObserver(r=>{G(()=>{for(let s of r)t(s)})},n);return o.observe(e),()=>o.disconnect()}function qn(e,t={}){let{duration:n=300,easing:o=r=>r*(2-r)}=t;return new Promise(r=>{let s,i,a;G(()=>{s=window.scrollY;let f=e.getBoundingClientRect();i=s+f.top,a=performance.now(),u()});function u(){G(()=>{let f=performance.now()-a,c=Math.min(f/n,1),d=o(c),h=s+(i-s)*d;U(()=>{window.scrollTo(0,h),c<1?requestAnimationFrame(u):r()})})}})}function Qe(e){let t=$?.(),n=O(e);return t&&t.effects.push(n),n}function ze(e,t={}){let{stiffness:n=100,damping:o=10,mass:r=1,precision:s=.01}=t,i=l(e),a=l(e),u=l(0),f=l(!1),c=null,d=null;function h(y){if(d===null){d=y,c=requestAnimationFrame(h);return}let R=Math.min((y-d)/1e3,.064);d=y;let m=i.peek(),I=a.peek(),_=u.peek(),x=m-I,g=-n*x,L=-o*_,k=(g+L)/r,M=_+k*R,P=m+M*R;if(D(()=>{u.set(M),i.set(P)}),Math.abs(M)<s&&Math.abs(x)<s){D(()=>{i.set(I),u.set(0),f.set(!1)}),c=null,d=null;return}c=requestAnimationFrame(h)}function v(y){a.set(y),c===null&&(f.set(!0),d=null,c=requestAnimationFrame(h))}function b(){c&&(cancelAnimationFrame(c),c=null),f.set(!1),d=null}function E(y){b(),D(()=>{i.set(y),a.set(y),u.set(0)})}let S=$?.();return S&&(S._cleanupCallbacks=S._cleanupCallbacks||[],S._cleanupCallbacks.push(b)),{current:()=>i(),target:()=>a(),velocity:()=>u(),isAnimating:()=>f(),set:v,stop:b,snap:E,subscribe:i.subscribe}}function Ue(e,t,n={}){let{duration:o=300,easing:r=v=>v*(2-v),onUpdate:s,onComplete:i}=n,a=l(0),u=l(e),f=l(!0),c=null,d=null;function h(v){c===null&&(c=v);let b=v-c,E=Math.min(b/o,1),S=r(E),y=e+(t-e)*S;D(()=>{a.set(E),u.set(y)}),s&&s(y,E),E<1?d=requestAnimationFrame(h):(f.set(!1),i&&i())}return d=requestAnimationFrame(h),{progress:()=>a(),value:()=>u(),isAnimating:()=>f(),cancel:()=>{d&&cancelAnimationFrame(d),f.set(!1)},subscribe:u.subscribe}}var Ke={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 Bn(e={}){let{duration:t=300,easing:n=Ke.easeOutQuad}=e,o=l(!1),r=l(0);async function s(i){return o.set(!0),r.set(0),new Promise(a=>{let u=performance.now();function f(c){let d=c-u,h=Math.min(d/t,1);r.set(n(h)),h<1?requestAnimationFrame(f):(o.set(!1),i&&i(),a())}requestAnimationFrame(f)})}return{isTransitioning:()=>o(),progress:()=>r(),start:s}}function Gn(e,t={}){let{onDrag:n,onDragStart:o,onDragEnd:r,onPinch:s,onSwipe:i,onTap:a,onLongPress:u,preventDefault:f=!1}=t,c={isDragging:l(!1),startX:0,startY:0,currentX:l(0),currentY:l(0),deltaX:l(0),deltaY:l(0),velocity:l({x:0,y:0})},d=0,h=0,v=0,b=null;function E(x){let g=x.touches?x.touches[0]:x;c.startX=g.clientX,c.startY=g.clientY,h=g.clientX,v=g.clientY,d=performance.now(),c.isDragging.set(!0),o&&o({x:c.startX,y:c.startY}),u&&(b=setTimeout(()=>{c.isDragging.peek()&&u({x:h,y:v})},500))}function S(x){if(!c.isDragging.peek())return;let g=x.touches?x.touches[0]:x,L=g.clientX,k=g.clientY,M=performance.now(),P=M-d;D(()=>{c.currentX.set(L),c.currentY.set(k),c.deltaX.set(L-c.startX),c.deltaY.set(k-c.startY),P>0&&c.velocity.set({x:(L-h)/P*1e3,y:(k-v)/P*1e3})}),h=L,v=k,d=M,b&&Math.sqrt(c.deltaX.peek()**2+c.deltaY.peek()**2)>10&&(clearTimeout(b),b=null),n&&n({x:L,y:k,deltaX:c.deltaX.peek(),deltaY:c.deltaY.peek(),velocity:c.velocity.peek()})}function y(x){if(!c.isDragging.peek())return;b&&(clearTimeout(b),b=null);let g=c.deltaX.peek(),L=c.deltaY.peek(),k=c.velocity.peek();if(Math.sqrt(g**2+L**2)<10&&a&&a({x:c.startX,y:c.startY}),i&&(Math.abs(k.x)>500||Math.abs(k.y)>500)){let P=Math.abs(k.x)>Math.abs(k.y)?k.x>0?"right":"left":k.y>0?"down":"up";i({direction:P,velocity:k})}r&&r({deltaX:g,deltaY:L,velocity:k}),c.isDragging.set(!1)}let R=null;function m(x){if(!s||x.touches.length!==2)return;let g=x.touches[0],L=x.touches[1],k=Math.sqrt((L.clientX-g.clientX)**2+(L.clientY-g.clientY)**2);R===null&&(R=k);let M=k/R,P=(g.clientX+L.clientX)/2,ee=(g.clientY+L.clientY)/2;s({scale:M,centerX:P,centerY:ee})}function I(){R=null}typeof e=="function"?Qe(()=>{let x=le(e);if(x)return _(x)}):e?.current!==void 0?Qe(()=>{let x=e.current;if(x)return _(x)}):e&&_(e);function _(x){return x.addEventListener("mousedown",E),x.addEventListener("touchstart",E,{passive:!f}),window.addEventListener("mousemove",S),window.addEventListener("touchmove",m),window.addEventListener("touchmove",S),window.addEventListener("mouseup",y),window.addEventListener("touchend",y),window.addEventListener("touchend",I),()=>{x.removeEventListener("mousedown",E),x.removeEventListener("touchstart",E),window.removeEventListener("mousemove",S),window.removeEventListener("touchmove",m),window.removeEventListener("touchmove",S),window.removeEventListener("mouseup",y),window.removeEventListener("touchend",y),window.removeEventListener("touchend",I)}}return c}function Wn(e){let t=l(e),n=[];return{value:()=>t(),setValue:o=>t.set(o),spring(o,r={}){let s=ze(t.peek(),r);s.set(o);let i=O(()=>{t.set(s.current())});return{stop:()=>{s.stop(),i()}}},timing(o,r={}){let s=Ue(t.peek(),o,{...r,onUpdate:i=>t.set(i)});return{stop:()=>s.cancel()}},interpolate(o,r){return()=>{let s=t();for(let i=0;i<o.length-1;i++)if(s>=o[i]&&s<=o[i+1]){let a=(s-o[i])/(o[i+1]-o[i]);return r[i]+(r[i+1]-r[i])*a}return s<=o[0]?r[0]:r[r.length-1]}},subscribe:t.subscribe}}function Je(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 Yn(e,t,n="enter",o=300){let r=Je(t);return new Promise(s=>{U(()=>{e.classList.add(r[n]),G(()=>{e.offsetHeight,U(()=>{e.classList.add(r[`${n}Active`]),setTimeout(()=>{U(()=>{e.classList.remove(r[n],r[`${n}Active`]),e.classList.add(r[`${n}Done`]),s()})},o)})})})})}var et=l(null);typeof document<"u"&&document.addEventListener("focusin",e=>{et.set(e.target)});function Xn(){return{current:()=>et(),focus:e=>e?.focus(),blur:()=>document.activeElement?.blur()}}function Qn(){let e={current:null};function t(o){typeof document>"u"||(e.current=o||document.activeElement||null)}function n(o){let r=e.current||o;r&&typeof r.focus=="function"&&r.focus()}return{capture:t,restore:n,previous:()=>e.current}}function tt(e){let t=null;function n(){if(typeof document>"u")return;t=document.activeElement;let r=e.current||e;if(!r||typeof r.querySelectorAll!="function")return;let s=Ze(r);if(s.length===0)return;s[0].focus();function i(a){if(a.key!=="Tab")return;let u=Ze(r),f=u[0],c=u[u.length-1];a.shiftKey?document.activeElement===f&&(a.preventDefault(),c.focus()):document.activeElement===c&&(a.preventDefault(),f.focus())}return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}}function o(){t&&typeof t.focus=="function"&&t.focus()}return{activate:n,deactivate:o}}function Ze(e){let t=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(t)).filter(n=>n.offsetParent!==null)}function zn({children:e,active:t=!0}){let n={current:null},o=l(0),r=tt(n),s=null,i=f=>{n.current=f,o.set(c=>c+1)},a=O(()=>{if(o(),s&&(s(),s=null,r.deactivate()),t&&n.current)return s=r.activate(),()=>{s?.(),s=null,r.deactivate()}}),u=$?.();return u&&(u._cleanupCallbacks=u._cleanupCallbacks||[],u._cleanupCallbacks.push(()=>{a(),s?.(),s=null,r.deactivate()})),w("div",{ref:i},e)}var K=null,Me=0;function Un(){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 nt(e,t={}){let{priority:n="polite",timeout:o=1e3}=t,r=Un();if(!r)return;r.setAttribute("aria-live",n);let s=++Me;r.textContent="",requestAnimationFrame(()=>{Me===s&&(r.textContent=e)}),setTimeout(()=>{Me===s&&(r.textContent="")},o)}function Kn(e){return nt(e,{priority:"assertive"})}function Jn({href:e="#main",children:t="Skip to content"}){return w("a",{href:e,class:"what-skip-link",onClick:n=>{n.preventDefault();let o=document.querySelector(e);o&&(o.focus(),o.scrollIntoView())},style:{position:"absolute",top:"-40px",left:"0",padding:"8px",background:"#000",color:"#fff",textDecoration:"none",zIndex:"10000"},onFocus:n=>{n.target.style.top="0"},onBlur:n=>{n.target.style.top="-40px"}},t)}function Zn(e=!1){let t=l(e);return{expanded:()=>t(),toggle:()=>t.set(!t.peek()),open:()=>t.set(!0),close:()=>t.set(!1),buttonProps:()=>({"aria-expanded":t(),onClick:()=>t.set(!t.peek())}),panelProps:()=>({hidden:!t()})}}function er(e=null){let t=l(e);return{selected:()=>t(),select:n=>t.set(n),isSelected:n=>t()===n,itemProps:n=>({"aria-selected":t()===n,onClick:()=>t.set(n)})}}function tr(e=!1){let t=l(e);return{checked:()=>t(),toggle:()=>t.set(!t.peek()),set:n=>t.set(n),checkboxProps:()=>({role:"checkbox","aria-checked":t(),tabIndex:0,onClick:()=>t.set(!t.peek()),onKeyDown:n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),t.set(!t.peek()))}})}}function nr(e){let t=typeof e=="function"?e:()=>e,n=l(0);function o(r){let s=t();if(!(s<=0))switch(r.key){case"ArrowDown":case"ArrowRight":r.preventDefault(),n.set((n.peek()+1)%s);break;case"ArrowUp":case"ArrowLeft":r.preventDefault(),n.set((n.peek()-1+s)%s);break;case"Home":r.preventDefault(),n.set(0);break;case"End":r.preventDefault(),n.set(s-1);break}}return{focusIndex:()=>n(),setFocusIndex:r=>n.set(r),getItemProps:r=>({tabIndex:n()===r?0:-1,onKeyDown:o,onFocus:()=>n.set(r)}),containerProps:()=>({role:"listbox"})}}function rr({children:e,as:t="span"}){return w(t,{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}},e)}function or({children:e,priority:t="polite",atomic:n=!0}){return w("div",{"aria-live":t,"aria-atomic":n},e)}var rt=0;function Fe(e="what"){let t=`${e}-${++rt}`;return()=>t}function sr(e,t="what"){let n=[];for(let o=0;o<e;o++)n.push(`${t}-${++rt}`);return n}function ir(e){let t=Fe("desc");return{descriptionId:t,descriptionProps:()=>({id:t(),style:{display:"none"}}),describedByProps:()=>({"aria-describedby":t()}),Description:()=>w("div",{id:t(),style:{display:"none"}},e)}}function ar(e){let t=Fe("label");return{labelId:t,labelProps:()=>({id:t()}),labelledByProps:()=>({"aria-labelledby":t()})}}var cr={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Home:"Home",End:"End",Tab:"Tab"};function ur(e,t){return n=>{n.key===e&&t(n)}}function lr(e,t){return n=>{e.includes(n.key)&&t(n)}}var fr=`
|
|
1
|
+
import{A as hn,B as gn,C as mn,I as yn,J as xn,K as vn,L as wn,M as bn,a as Gt,b as qt,c as Bt,d as Wt,e as Yt,f as Xt,g as Qt,h as zt,i as Ut,j as Kt,k as Jt,l as Zt,m as en,n as tn,o as nn,p as rn,q as on,r as sn,s as an,t as cn,u as un,v as ln,w as fn,x as De,y as dn,z as pn}from"./chunk-RXISSKLI.min.js";import{A as At,C as Tt,D as It,E as Mt,F as Lt,G as Dt,H as Ft,I as Nt,J as Ot,K as Pt,L as $t,M as Ht,P as Vt,T as jt,V,a as F,b as ct,c as f,d as O,e as $,f as M,g as ut,h as lt,i as ue,j as ft,k as dt,l as pt,n as ht,o as gt,p as xt,q as se,r as vt,s as wt,t as bt,u as kt,v as St,w as Et,x as Ct,y as _t,z as Rt}from"./chunk-NCPX66TV.min.js";import{a as C,b as mt,c as yt}from"./chunk-O3SKPRTY.min.js";var Q;function Ee(){if(Q!==void 0)return Q;if(typeof document>"u")return Q=null;let e=document.getElementById("__what_data");if(!e)return Q=null;try{Q=JSON.parse(e.textContent)}catch{Q=null}return Q}function kn(){Q=void 0}function Ce(){let e=Ee();return e?e.loaderData:void 0}function _e(e){let t=Ee();return t&&t.resources?t.resources[e]:void 0}function Sn(){if(typeof document>"u"){let e=se();return e?e.loaderData:void 0}return Ce()}function j(e){let t=V();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 z(e){let t=e.hookIndex++;return{index:t,exists:t<e.hooks.length}}function En(e){let t=j("useState"),{index:n,exists:r}=z(t);if(!r){let s=f(typeof e=="function"?e():e);t.hooks[n]=s}let o=t.hooks[n];return[o,o.set]}function Cn(e){let t=j("useSignal"),{index:n,exists:r}=z(t);return r||(t.hooks[n]=f(typeof e=="function"?e():e)),t.hooks[n]}function _n(e){let t=j("useComputed"),{index:n,exists:r}=z(t);return r||(t.hooks[n]=O(e)),t.hooks[n]}function Rn(e,t){let n=j("useEffect"),{index:r,exists:o}=z(n);if(o||(n.hooks[r]={cleanup:null,dispose:null}),F&&Array.isArray(t)&&t.length>0)for(let i=0;i<t.length;i++){let a=t[i];a!=null&&typeof a!="function"&&console.warn(`[what] useEffect dep at index ${i} is not a function. Did you mean to pass a signal? Use count instead of count()`)}let 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 i=e();typeof i=="function"&&(s.cleanup=i)}),n.effects=n.effects||[],n.effects.push(s.dispose))}):t.length===0?(queueMicrotask(()=>{if(n.disposed)return;let i=e();typeof i=="function"&&(s.cleanup=i)}),s.dispose=!0):queueMicrotask(()=>{n.disposed||(s.dispose=$(()=>{for(let a=0;a<t.length;a++){let u=t[a];typeof u=="function"&&u._signal&&u()}if(s.cleanup){try{s.cleanup()}catch{}s.cleanup=null}let i=ue(()=>e());typeof i=="function"&&(s.cleanup=i)}),n.effects=n.effects||[],n.effects.push(s.dispose))}))}function An(e,t){let n=j("useMemo"),{index:r,exists:o}=z(n);return o||(n.hooks[r]={computed:O(e)}),n.hooks[r].computed}function Tn(e,t){let n=j("useCallback"),{index:r,exists:o}=z(n);return o||(n.hooks[r]={callback:e}),n.hooks[r].callback}function In(e){let t=j("useRef"),{index:n,exists:r}=z(t);return r||(t.hooks[n]={current:e}),t.hooks[n]}function Fe(e){let t=V();for(F&&!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 Mn(e){let t={_defaultValue:e,Provider:({value:n,children:r})=>{let o=j("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=f(n);o._contextSignals.set(t,s),o._contextValues.set(t,s)}return r},Consumer:({children:n})=>{let r=Fe(t);return typeof n=="function"?n(r):n}};return t.Provider._deferChildren=!0,t}function Ln(e,t,n){let r=j("useReducer"),{index:o,exists:s}=z(r);if(!s){let a=n?n(t):t,u=f(a),d=c=>{u.set(l=>e(l,c))};r.hooks[o]={signal:u,dispatch:d}}let i=r.hooks[o];return[i.signal,i.dispatch]}function Dn(e){let t=j("onMount");t.mounted||(t._mountCallbacks=t._mountCallbacks||[],t._mountCallbacks.push(e))}function Fn(e){let t=j("onCleanup");t._cleanupCallbacks=t._cleanupCallbacks||[],t._cleanupCallbacks.push(e)}function Nn(e,t={}){if(typeof document>"u"){let c=se();if(c){let l=t.key!=null?t.key:`__r${c.resourceCounter++}`,h=c.resources.get(l);if(h&&h.status==="ready")return[()=>h.value,{loading:()=>!1,error:()=>null,refetch:()=>{},mutate:()=>{}}];if(h&&h.status==="error")return[()=>{},{loading:()=>!1,error:()=>h.error,refetch:()=>{},mutate:()=>{}}];if(!h){let v=Promise.resolve().then(()=>e(t.source??!0,{})).then(w=>{c.resources.set(l,{status:"ready",value:w})}).catch(w=>{c.resources.set(l,{status:"error",error:w})});throw c.resources.set(l,{status:"pending",promise:v}),v}throw h.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 c=_e(t.key);c!==void 0&&(n=c)}let r=f(n??null),o=f(n==null),s=f(null),i=null,a=async c=>{i&&i.abort(),i=new AbortController;let{signal:l}=i;o.set(!0),s.set(null);try{let h=await e(c,{signal:l});l.aborted||M(()=>{r.set(h),o.set(!1)})}catch(h){l.aborted||M(()=>{s.set(h),o.set(!1)})}},u=c=>{r.set(typeof c=="function"?c(r()):c)},d=V?.();return d&&(d._cleanupCallbacks=d._cleanupCallbacks||[],d._cleanupCallbacks.push(()=>{i&&i.abort()})),n==null&&a(t.source),[r,{loading:o,error:s,refetch:a,mutate:u}]}function Pe(e){return e._storeComputed=!0,e}var Ne=!1;function On(e){return Ne||(Ne=!0,console.warn("[what] storeComputed() is deprecated. Use derived() instead.")),Pe(e)}function Pn(e){let t={},n={},r={},o={};for(let[s,i]of Object.entries(e))typeof i=="function"&&i._storeComputed?(F&&i.length===0&&console.warn(`[what] derived() for "${s}" should accept the state parameter, e.g. derived(state => ...).`),n[s]=i):typeof i=="function"?r[s]=i:t[s]=f(i);for(let[s,i]of Object.entries(n)){let a=new Proxy({},{get(u,d){if(t[d])return t[d]();if(n[d])return n[d]()}});n[s]=O(()=>i(a))}for(let[s,i]of Object.entries(r))r[s]=(...a)=>{let u;return M(()=>{let d=new Proxy({},{get(c,l){if(t[l])return t[l].peek();if(n[l])return n[l].peek();if(r[l])return r[l]},set(c,l,h){return t[l]&&t[l].set(h),!0}});u=i.apply(d,a)}),u};return function(){let i={};for(let[a,u]of Object.entries(t))Object.defineProperty(i,a,{get:()=>u(),enumerable:!0});for(let[a,u]of Object.entries(n))Object.defineProperty(i,a,{get:()=>u(),enumerable:!0});for(let[a,u]of Object.entries(r))i[a]=u;return i}}var Oe=!1;function $n(e){return Oe||(Oe=!0,console.warn("[what] atom() is deprecated. Use signal() directly instead.")),f(e)}var Re={title:null,metas:new Map,links:new Map};function Hn({title:e,meta:t,link:n,children:r}){if(typeof document>"u"){let o=se();return o&&o.head&&jn(o.head,{title:e,meta:t,link:n}),r??null}if(e&&(document.title=e,Re.title=e),t)for(let o of Array.isArray(t)?t:[t]){let s=o.name||o.property||o.httpEquiv||JSON.stringify(o);He("meta",s,o)}if(n)for(let o of Array.isArray(n)?n:[n]){let s=o.rel+(o.href||"");He("link",s,o)}return r||null}function Vn(e){return e.name||e.property||e.httpEquiv||JSON.stringify(e)}function jn(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(Vn(o),o);if(r)for(let o of Array.isArray(r)?r:[r])e.links.set(o.rel+(o.href||""),o)}function Gn(){return{title:null,metas:new Map,links:new Map}}function qn(e){if(!e)return"";let t="";e.title!=null&&(t+=`<title>${Ve(String(e.title))}</title>`);for(let n of e.metas.values())t+=$e("meta",n);for(let n of e.links.values())t+=$e("link",n);return t}var Bn=/^[a-zA-Z_:][a-zA-Z0-9:._-]*$/;function Ae(e){if(!Bn.test(e))return!1;let t=e.toLowerCase();return!(t.startsWith("on")&&t.length>2)}function ye(e){return e==="httpEquiv"?"http-equiv":e}function $e(e,t){let n=`<${e}`;for(let[r,o]of Object.entries(t)){if(o==null||o===!1)continue;let s=ye(r);Ae(s)&&(n+=` ${s}="${Ve(String(o))}"`)}return n+">"}function Ve(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Wn(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 He(e,t,n){let r=document.head.querySelector(`[data-what-head="${Wn(t)}"]`);if(r){Yn(r,n);return}let o=document.createElement(e);o.setAttribute("data-what-head",t);for(let[s,i]of Object.entries(n))Ae(ye(s))&&o.setAttribute(ye(s),i);document.head.appendChild(o)}function Yn(e,t){for(let[n,r]of Object.entries(t)){let o=ye(n);Ae(o)&&e.getAttribute(o)!==r&&e.setAttribute(o,r)}}function Xn(){let e=document.head.querySelectorAll("[data-what-head]");for(let t of e)t.remove();Re.metas.clear(),Re.links.clear()}var fe=[],de=[],Ie=!1;function W(e){return fe.push(e),Ge(),()=>{let t=fe.indexOf(e);t!==-1&&fe.splice(t,1)}}function U(e){return de.push(e),Ge(),()=>{let t=de.indexOf(e);t!==-1&&de.splice(t,1)}}function je(){for(;fe.length>0;){let e=fe.shift();try{e()}catch(t){console.error("[what] Scheduler read error:",t)}}for(;de.length>0;){let e=de.shift();try{e()}catch(t){console.error("[what] Scheduler write error:",t)}}Ie=!1}function Ge(){Ie||(Ie=!0,requestAnimationFrame(je))}function Qn(e){return new Promise(t=>{W(()=>{t(e())})})}function zn(e){return new Promise(t=>{U(()=>{e(),t()})})}function Un(e,t){let n=Symbol("scheduledEffect");return $(()=>{qe(n,()=>{W(()=>{let r=e();t&&U(()=>t(r))})})})}function Kn(){let e,t=new Promise((n,r)=>{let o=requestAnimationFrame(n);e=()=>{cancelAnimationFrame(o),r(new Error("Cancelled"))}});return t.cancel=e,t}var le=new Map;function qe(e,t){le.has(e)?le.set(e,t):(le.set(e,t),requestAnimationFrame(()=>{let n=le.get(e);le.delete(e),n&&n()}))}var Te=new WeakMap,xe=null;function Jn(e,t){return typeof ResizeObserver>"u"?(t(e.getBoundingClientRect()),()=>{}):(xe||(xe=new ResizeObserver(n=>{W(()=>{for(let r of n){let o=Te.get(r.target);o&&o(r.contentRect)}})})),Te.set(e,t),xe.observe(e),()=>{Te.delete(e),xe.unobserve(e)})}function Zn(e,t,n={}){if(typeof IntersectionObserver>"u")return t({isIntersecting:!0,intersectionRatio:1}),()=>{};let r=new IntersectionObserver(o=>{W(()=>{for(let s of o)t(s)})},n);return r.observe(e),()=>r.disconnect()}function er(e,t={}){let{duration:n=300,easing:r=o=>o*(2-o)}=t;return new Promise(o=>{let s,i,a;W(()=>{s=window.scrollY;let d=e.getBoundingClientRect();i=s+d.top,a=performance.now(),u()});function u(){W(()=>{let d=performance.now()-a,c=Math.min(d/n,1),l=r(c),h=s+(i-s)*l;U(()=>{window.scrollTo(0,h),c<1?requestAnimationFrame(u):o()})})}})}function Be(e){let t=V?.(),n=$(e);return t&&t.effects.push(n),n}function We(e,t={}){let{stiffness:n=100,damping:r=10,mass:o=1,precision:s=.01}=t,i=f(e),a=f(e),u=f(0),d=f(!1),c=null,l=null;function h(y){if(l===null){l=y,c=requestAnimationFrame(h);return}let A=Math.min((y-l)/1e3,.064);l=y;let m=i.peek(),T=a.peek(),_=u.peek(),x=m-T,g=-n*x,L=-r*_,b=(g+L)/o,D=_+b*A,N=m+D*A;if(M(()=>{u.set(D),i.set(N)}),Math.abs(D)<s&&Math.abs(x)<s){M(()=>{i.set(T),u.set(0),d.set(!1)}),c=null,l=null;return}c=requestAnimationFrame(h)}function v(y){a.set(y),c===null&&(d.set(!0),l=null,c=requestAnimationFrame(h))}function w(){c&&(cancelAnimationFrame(c),c=null),d.set(!1),l=null}function S(y){w(),M(()=>{i.set(y),a.set(y),u.set(0)})}let k=V?.();return k&&(k._cleanupCallbacks=k._cleanupCallbacks||[],k._cleanupCallbacks.push(w)),{current:()=>i(),target:()=>a(),velocity:()=>u(),isAnimating:()=>d(),set:v,stop:w,snap:S,subscribe:i.subscribe}}function Ye(e,t,n={}){let{duration:r=300,easing:o=v=>v*(2-v),onUpdate:s,onComplete:i}=n,a=f(0),u=f(e),d=f(!0),c=null,l=null;function h(v){c===null&&(c=v);let w=v-c,S=Math.min(w/r,1),k=o(S),y=e+(t-e)*k;M(()=>{a.set(S),u.set(y)}),s&&s(y,S),S<1?l=requestAnimationFrame(h):(d.set(!1),i&&i())}return l=requestAnimationFrame(h),{progress:()=>a(),value:()=>u(),isAnimating:()=>d(),cancel:()=>{l&&cancelAnimationFrame(l),d.set(!1)},subscribe:u.subscribe}}var Xe={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 tr(e={}){let{duration:t=300,easing:n=Xe.easeOutQuad}=e,r=f(!1),o=f(0);async function s(i){return r.set(!0),o.set(0),new Promise(a=>{let u=performance.now();function d(c){let l=c-u,h=Math.min(l/t,1);o.set(n(h)),h<1?requestAnimationFrame(d):(r.set(!1),i&&i(),a())}requestAnimationFrame(d)})}return{isTransitioning:()=>r(),progress:()=>o(),start:s}}function nr(e,t={}){let{onDrag:n,onDragStart:r,onDragEnd:o,onPinch:s,onSwipe:i,onTap:a,onLongPress:u,preventDefault:d=!1}=t,c={isDragging:f(!1),startX:0,startY:0,currentX:f(0),currentY:f(0),deltaX:f(0),deltaY:f(0),velocity:f({x:0,y:0})},l=0,h=0,v=0,w=null;function S(x){let g=x.touches?x.touches[0]:x;c.startX=g.clientX,c.startY=g.clientY,h=g.clientX,v=g.clientY,l=performance.now(),c.isDragging.set(!0),r&&r({x:c.startX,y:c.startY}),u&&(w=setTimeout(()=>{c.isDragging.peek()&&u({x:h,y:v})},500))}function k(x){if(!c.isDragging.peek())return;let g=x.touches?x.touches[0]:x,L=g.clientX,b=g.clientY,D=performance.now(),N=D-l;M(()=>{c.currentX.set(L),c.currentY.set(b),c.deltaX.set(L-c.startX),c.deltaY.set(b-c.startY),N>0&&c.velocity.set({x:(L-h)/N*1e3,y:(b-v)/N*1e3})}),h=L,v=b,l=D,w&&Math.sqrt(c.deltaX.peek()**2+c.deltaY.peek()**2)>10&&(clearTimeout(w),w=null),n&&n({x:L,y:b,deltaX:c.deltaX.peek(),deltaY:c.deltaY.peek(),velocity:c.velocity.peek()})}function y(x){if(!c.isDragging.peek())return;w&&(clearTimeout(w),w=null);let g=c.deltaX.peek(),L=c.deltaY.peek(),b=c.velocity.peek();if(Math.sqrt(g**2+L**2)<10&&a&&a({x:c.startX,y:c.startY}),i&&(Math.abs(b.x)>500||Math.abs(b.y)>500)){let N=Math.abs(b.x)>Math.abs(b.y)?b.x>0?"right":"left":b.y>0?"down":"up";i({direction:N,velocity:b})}o&&o({deltaX:g,deltaY:L,velocity:b}),c.isDragging.set(!1)}let A=null;function m(x){if(!s||x.touches.length!==2)return;let g=x.touches[0],L=x.touches[1],b=Math.sqrt((L.clientX-g.clientX)**2+(L.clientY-g.clientY)**2);A===null&&(A=b);let D=b/A,N=(g.clientX+L.clientX)/2,Z=(g.clientY+L.clientY)/2;s({scale:D,centerX:N,centerY:Z})}function T(){A=null}typeof e=="function"?Be(()=>{let x=ue(e);if(x)return _(x)}):e?.current!==void 0?Be(()=>{let x=e.current;if(x)return _(x)}):e&&_(e);function _(x){return x.addEventListener("mousedown",S),x.addEventListener("touchstart",S,{passive:!d}),window.addEventListener("mousemove",k),window.addEventListener("touchmove",m),window.addEventListener("touchmove",k),window.addEventListener("mouseup",y),window.addEventListener("touchend",y),window.addEventListener("touchend",T),()=>{x.removeEventListener("mousedown",S),x.removeEventListener("touchstart",S),window.removeEventListener("mousemove",k),window.removeEventListener("touchmove",m),window.removeEventListener("touchmove",k),window.removeEventListener("mouseup",y),window.removeEventListener("touchend",y),window.removeEventListener("touchend",T)}}return c}function rr(e){let t=f(e),n=[];return{value:()=>t(),setValue:r=>t.set(r),spring(r,o={}){let s=We(t.peek(),o);s.set(r);let i=$(()=>{t.set(s.current())});return{stop:()=>{s.stop(),i()}}},timing(r,o={}){let s=Ye(t.peek(),r,{...o,onUpdate:i=>t.set(i)});return{stop:()=>s.cancel()}},interpolate(r,o){return()=>{let s=t();for(let i=0;i<r.length-1;i++)if(s>=r[i]&&s<=r[i+1]){let a=(s-r[i])/(r[i+1]-r[i]);return o[i]+(o[i+1]-o[i])*a}return s<=r[0]?o[0]:o[o.length-1]}},subscribe:t.subscribe}}function Qe(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 or(e,t,n="enter",r=300){let o=Qe(t);return new Promise(s=>{U(()=>{e.classList.add(o[n]),W(()=>{e.offsetHeight,U(()=>{e.classList.add(o[`${n}Active`]),setTimeout(()=>{U(()=>{e.classList.remove(o[n],o[`${n}Active`]),e.classList.add(o[`${n}Done`]),s()})},r)})})})})}var sr=`
|
|
12
2
|
.what-skeleton {
|
|
13
3
|
background: linear-gradient(
|
|
14
4
|
90deg,
|
|
@@ -60,7 +50,7 @@ import{a as Xt,b as Qt,c as zt,d as Oe,e as Ut,f as Kt,g as Jt,h as Zt,i as en,o
|
|
|
60
50
|
0% { transform: translateX(-100%); }
|
|
61
51
|
100% { transform: translateX(100%); }
|
|
62
52
|
}
|
|
63
|
-
`,ot=!1;function te(){if(ot||typeof document>"u")return;ot=!0;let e=document.createElement("style");e.textContent=fr,document.head.appendChild(e)}function Pe({width:e,height:t,variant:n="shimmer",circle:o=!1,class:r,style:s,count:i=1}){te();let a=`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""} ${n==="wave"?"what-skeleton-wave":""}`,u=r?`${a} ${r}`:a,f={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,borderRadius:o?"50%":void 0,...s};return i===1?w("div",{class:u,style:f,"aria-hidden":"true"}):Array.from({length:i},(c,d)=>w("div",{key:d,class:u,style:{...f,marginBottom:d<i-1?"8px":void 0},"aria-hidden":"true"}))}function Ne({lines:e=3,lastLineWidth:t="60%",lineHeight:n=16,gap:o=8,variant:r="shimmer"}){return te(),w("div",{class:"what-skeleton-text","aria-hidden":"true"},Array.from({length:e},(s,i)=>w("div",{key:i,class:`what-skeleton ${r==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${n}px`,width:i===e-1?t:"100%",marginBottom:i<e-1?`${o}px`:void 0}})))}function dr({size:e=40,variant:t="shimmer"}){return Pe({width:e,height:e,circle:!0,variant:t})}function st({imageHeight:e=200,lines:t=3,variant:n="shimmer"}){return te(),w("div",{class:"what-skeleton-card","aria-hidden":"true"},w("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${e}px`,width:"100%",marginBottom:"16px"}}),w("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"24px",width:"70%",marginBottom:"12px"}}),Ne({lines:t,variant:n}))}function pr({rows:e=5,columns:t=4,variant:n="shimmer"}){return te(),w("div",{class:"what-skeleton-table","aria-hidden":"true"},w("div",{style:{display:"flex",gap:"16px",marginBottom:"16px"}},Array.from({length:t},(o,r)=>w("div",{key:r,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"20px",flex:1}}))),Array.from({length:e},(o,r)=>w("div",{key:r,style:{display:"flex",gap:"16px",marginBottom:r<e-1?"12px":void 0}},Array.from({length:t},(s,i)=>w("div",{key:i,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"16px",flex:1}})))))}function hr({type:e="default",height:t,children:n}){return te(),e==="card"?st({}):e==="text"?Ne({}):n||w("div",{class:"what-skeleton what-island-skeleton",style:{height:typeof t=="number"?`${t}px`:t||"100px",width:"100%"},"aria-hidden":"true"})}function gr(e,t=[]){let n=l(!0),o=l(null),r=l(null);return O(()=>{n.set(!0),r.set(null),Promise.resolve(e()).then(s=>{o.set(s),n.set(!1)}).catch(s=>{r.set(s),n.set(!1)})}),{isLoading:()=>n(),data:()=>o(),error:()=>r(),Skeleton:s=>n()?Pe(s):null}}function mr({width:e="100%",height:t=100,label:n="Loading...",showLabel:o=!1,variant:r="shimmer"}){return te(),w("div",{class:`what-skeleton ${r==="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"},o&&w("span",{style:{color:"var(--skeleton-text, #999)",fontSize:"14px"}},n))}function yr({size:e=8,color:t="#666"}){te();let n={width:`${e}px`,height:`${e}px`,borderRadius:"50%",backgroundColor:t,animation:"what-skeleton-pulse 1s infinite ease-in-out"};return w("div",{class:"what-loading-dots",style:{display:"flex",gap:`${e/2}px`},"aria-label":"Loading",role:"status"},w("div",{style:{...n,animationDelay:"0s"}}),w("div",{style:{...n,animationDelay:"0.2s"}}),w("div",{style:{...n,animationDelay:"0.4s"}}))}function xr({size:e=24,color:t="#666",strokeWidth:n=2}){return w("svg",{width:e,height:e,viewBox:"0 0 24 24",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading",role:"status"},w("style",null,"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"),w("circle",{cx:12,cy:12,r:10,stroke:t,strokeWidth:n,fill:"none",strokeDasharray:"31.4 31.4",strokeLinecap:"round"}))}var H=new Map,J=new Map,Z=new Map,q=new Map,it=200;function be(e){return q.set(e,Date.now()),H.has(e)||(H.set(e,l(null)),H.size>it&&wr()),H.get(e)}function at(e){return J.has(e)||J.set(e,l(null)),J.get(e)}function vr(e){return Z.has(e)||Z.set(e,l(!1)),Z.get(e)}function wr(){let e=[...q.entries()].sort((n,o)=>n[1]-o[1]),t=Math.floor(it*.2);for(let n=0;n<t&&n<e.length;n++){let o=e[n][0];W.has(o)&&W.get(o).size>0||(H.delete(o),J.delete(o),Z.delete(o),q.delete(o),ge.delete(o))}}var W=new Map;function ct(e,t){return W.has(e)||W.set(e,new Set),W.get(e).add(t),()=>{let n=W.get(e);n&&(n.delete(t),n.size===0&&W.delete(e))}}var ne=new Map,ge=new Map;function Y(e){let t=$?.(),n=O(e);return t&&t.effects.push(n),n}function br(e,t={}){let{method:n="GET",body:o,headers:r={},transform:s=h=>h,initialData:i=null}=t,a=l(i),u=l(null),f=l(!0),c=null;async function d(){c&&c.abort(),c=new AbortController;let{signal:h}=c;f.set(!0),u.set(null);try{let v=await fetch(e,{method:n,headers:{"Content-Type":"application/json",...r},body:o?JSON.stringify(o):void 0,signal:h});if(!v.ok)throw new Error(`HTTP ${v.status}: ${v.statusText}`);let b=await v.json();h.aborted||a.set(s(b))}catch(v){h.aborted||u.set(v)}finally{h.aborted||f.set(!1)}}return Y(()=>(d(),()=>{c&&c.abort()})),{data:()=>a(),error:()=>u(),isLoading:()=>f(),refetch:d,mutate:h=>a.set(h)}}function kr(e,t,n={}){let{revalidateOnFocus:o=!0,revalidateOnReconnect:r=!0,refreshInterval:s=0,dedupingInterval:i=2e3,fallbackData:a,onSuccess:u,onError:f,suspense:c=!1}=n;if(e==null||e===!1){let m=l(a||null),I=l(null);return{data:()=>m(),error:()=>I(),isLoading:()=>!1,isValidating:()=>!1,mutate:_=>m.set(typeof _=="function"?_(m()):_),revalidate:()=>Promise.resolve()}}let d=be(e),h=at(e),v=vr(e),b=N(()=>d()??a??null),E=N(()=>d()==null&&v()),S=null;async function y(){let m=Date.now();if(ne.has(e)){let g=ne.get(e);if(m-g.timestamp<i)return g.refCount++,g.promise}let I=ge.get(e);if(I&&m-I<i&&d.peek()!=null)return d.peek();if(S){let g=ne.get(e);(!g||g.refCount<=1)&&S.abort()}S=new AbortController;let{signal:_}=S;v.set(!0);let x=t(e,{signal:_});ne.set(e,{promise:x,timestamp:m,refCount:1});try{let g=await x;return _.aborted?void 0:(D(()=>{d.set(g),h.set(null)}),q.set(e,Date.now()),ge.set(e,Date.now()),u&&u(g,e),g)}catch(g){if(_.aborted)return;throw h.set(g),f&&f(g,e),g}finally{_.aborted||v.set(!1);let g=ne.get(e);g&&(g.refCount--,g.refCount<=0&&ne.delete(e))}}let R=ct(e,()=>y().catch(()=>{}));return Y(()=>(y().catch(()=>{}),()=>{S&&S.abort(),R()})),o&&typeof window<"u"&&Y(()=>{let m=()=>{document.visibilityState==="visible"&&y().catch(()=>{})};return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)}),r&&typeof window<"u"&&Y(()=>{let m=()=>y().catch(()=>{});return window.addEventListener("online",m),()=>window.removeEventListener("online",m)}),s>0&&Y(()=>{let m=setInterval(()=>{y().catch(()=>{})},s);return()=>clearInterval(m)}),{data:()=>b(),error:()=>h(),isLoading:()=>E(),isValidating:()=>v(),mutate:(m,I=!0)=>{let _=typeof m=="function"?m(d.peek()):m;d.set(_),q.set(e,Date.now()),I&&y().catch(()=>{})},revalidate:y}}function Sr(e){let{queryKey:t,queryFn:n,enabled:o=!0,staleTime:r=0,cacheTime:s=300*1e3,refetchOnWindowFocus:i=!0,refetchInterval:a=!1,retry:u=3,retryDelay:f=k=>Math.min(1e3*2**k,3e4),onSuccess:c,onError:d,onSettled:h,select:v,placeholderData:b}=e,E=Array.isArray(t)?t.join(":"):t,S=be(E),y=N(()=>{let k=S();return v&&k!==null?v(k):k}),R=at(E),m=l(S.peek()!=null?"success":"loading"),I=l("idle"),_=0,x=null;async function g(){if(!o)return;let k=Date.now();if(S.peek()!=null&&k-_<r)return S.peek();x&&x.abort(),x=new AbortController;let{signal:M}=x;I.set("fetching"),S.peek()==null&&m.set("loading");let P=0;async function ee(){try{let V=await n({queryKey:Array.isArray(t)?t:[t],signal:M});return M.aborted?void 0:(D(()=>{S.set(V),R.set(null),m.set("success"),I.set("idle")}),_=Date.now(),q.set(E,Date.now()),c&&c(V),h&&h(V,null),setTimeout(()=>{if(Date.now()-_>=s){let B=W.get(E);(!B||B.size===0)&&(H.delete(E),J.delete(E),Z.delete(E),q.delete(E),ge.delete(E))}},s),V)}catch(V){if(M.aborted)return;if(P++,P<u)return await new Promise((B,Ee)=>{let Ce=setTimeout(B,f(P));M.addEventListener("abort",()=>{clearTimeout(Ce),Ee(new DOMException("Aborted","AbortError"))},{once:!0})}).catch(B=>{if(B.name!=="AbortError")throw B}),M.aborted?void 0:ee();throw D(()=>{R.set(V),m.set("error"),I.set("idle")}),d&&d(V),h&&h(null,V),V}}return ee()}let L=ct(E,()=>g().catch(()=>{}));return Y(()=>(o&&g().catch(()=>{}),()=>{x&&x.abort(),L()})),i&&typeof window<"u"&&Y(()=>{let k=()=>{document.visibilityState==="visible"&&g().catch(()=>{})};return document.addEventListener("visibilitychange",k),()=>document.removeEventListener("visibilitychange",k)}),a&&Y(()=>{let k=setInterval(()=>{g().catch(()=>{})},a);return()=>clearInterval(k)}),{data:()=>y()??b,error:()=>R(),status:()=>m(),fetchStatus:()=>I(),isLoading:()=>m()==="loading",isError:()=>m()==="error",isSuccess:()=>m()==="success",isFetching:()=>I()==="fetching",refetch:g}}function Er(e){let{queryKey:t,queryFn:n,getNextPageParam:o,getPreviousPageParam:r,initialPageParam:s,...i}=e,a=l([]),u=l([s]),f=l(!0),c=l(!1),d=l(!1),h=l(!1),v=Array.isArray(t)?t.join(":"):t,b=null,E=!1;async function S(y,R="next"){b&&b.abort(),b=new AbortController;let{signal:m}=b,I=R==="next"?d:h;I.set(!0);try{let _=await n({queryKey:Array.isArray(t)?t:[t],pageParam:y,signal:m});return m.aborted?void 0:(D(()=>{E?(a.set([_]),u.set([y]),E=!1):R==="next"?(a.set([...a.peek(),_]),u.set([...u.peek(),y])):(a.set([_,...a.peek()]),u.set([y,...u.peek()]));let x=o?.(_,a.peek());if(f.set(x!==void 0),r){let g=r(_,a.peek());c.set(g!==void 0)}}),_)}finally{m.aborted||I.set(!1)}}return Y(()=>(S(s).catch(()=>{}),()=>{b&&b.abort()})),{data:()=>({pages:a(),pageParams:u()}),hasNextPage:()=>f(),hasPreviousPage:()=>c(),isFetchingNextPage:()=>d(),isFetchingPreviousPage:()=>h(),fetchNextPage:async()=>{let y=a.peek()[a.peek().length-1],R=o?.(y,a.peek());if(R!==void 0)return S(R,"next")},fetchPreviousPage:async()=>{let y=a.peek()[0],R=r?.(y,a.peek());if(R!==void 0)return S(R,"previous")},refetch:async()=>(E=!0,S(s))}}function Cr(e,t={}){let{hard:n=!1}=t,o=[];if(typeof e=="function")for(let[r]of H)e(r)&&o.push(r);else o.push(e);for(let r of o){n&&H.has(r)&&H.get(r).set(null);let s=W.get(r);if(s)for(let i of s)i()}}function _r(e,t){let n=be(e);return t(e).then(o=>(n.set(o),q.set(e,Date.now()),o))}function Ar(e,t){let n=be(e),o=n.peek();n.set(typeof t=="function"?t(o):t),q.set(e,Date.now())}function Rr(e){return H.has(e)?H.get(e).peek():void 0}function Ir(){H.clear(),J.clear(),Z.clear(),q.clear(),ge.clear(),ne.clear()}function Tr(){let e=[];for(let[t,n]of H)e.push({key:t,data:n.peek(),error:J.has(t)?J.get(t).peek():null,isValidating:Z.has(t)?Z.get(t).peek():!1});return e}function Dr(e={}){let t=$?.();if(t){let n=t.hookIndex++;return t.hooks[n]||(t.hooks[n]=ut(e)),t.hooks[n]}return ut(e)}function ut(e={}){let{defaultValues:t={},mode:n="onSubmit",reValidateMode:o="onChange",resolver:r}=e,s={},i={},a={},u=l({});function f(p){return s[p]||(s[p]=l(t[p]??"")),s[p]}function c(p){return i[p]||(i[p]=l(null)),i[p]}function d(p){return a[p]||(a[p]=l(!1)),a[p]}let h=l(!1),v=l(!1),b=l(!1),E=l(!1),S=l(0);function y(p=!1){let C={...t};for(let[A,T]of Object.entries(s))C[A]=p?T():T.peek();return C}function R(p=!1){return p?u():u.peek()}function m(p,C){let A=C??null;c(p).set(A),u.set(T=>{if(T[p]===A)return T;if(A==null){if(!Object.prototype.hasOwnProperty.call(T,p))return T;let X={...T};return delete X[p],X}return{...T,[p]:A}})}function I(p={}){let C=p||{};D(()=>{for(let[A,T]of Object.entries(i))Object.prototype.hasOwnProperty.call(C,A)||T.set(null);for(let[A,T]of Object.entries(C))c(A).set(T??null);u.set({...C})})}let _=N(()=>Object.keys(R(!0)).length===0),x=N(()=>{let p={};for(let[C,A]of Object.entries(s))A()!==(t[C]??"")&&(p[C]=!0);return p});async function g(p){if(!r)return!0;E.set(!0);try{let A=(await r(y(!1)))?.errors||{};if(p){let T=A[p]??null;return m(p,T),!T}else return I(A),Object.keys(A).length===0}finally{E.set(!1)}}function L(p,C={}){let A=f(p),T=C.type==="checkbox"||C.type==="radio",ue=xe=>{let mt=xe.target.type==="checkbox"||xe.target.type==="radio"?xe.target.checked:xe.target.value;k(p,mt),(n==="onChange"||b.peek()&&o==="onChange")&&g(p)},X={name:p,onBlur:()=>{d(p).set(!0),(n==="onBlur"||b.peek()&&o==="onBlur")&&g(p)},onFocus:()=>{},ref:C.ref};return T?(Object.defineProperty(X,"checked",{get(){return!!A()},enumerable:!0}),X.onchange=ue):(Object.defineProperty(X,"value",{get(){return A()},enumerable:!0}),X.oninput=ue),X}function k(p,C,A={}){let{shouldValidate:T=!1,shouldDirty:ue=!0}=A;f(p).set(C),ue&&h.set(!0),T&&g(p)}function M(p){return f(p)()}function P(p,C){m(p,C)}function ee(p){m(p,null)}function V(){I({})}function B(p=t){D(()=>{for(let[C,A]of Object.entries(s))A.set(p[C]??"");for(let C of Object.values(i))C.set(null);u.set({});for(let C of Object.values(a))C.set(!1);h.set(!1),b.set(!1)})}function Ee(p,C){return async A=>{A&&A.preventDefault(),v.set(!0),b.set(!0),S.set(S.peek()+1),await g()?await p(y()):C&&C(R(!1)),v.set(!1)}}function Ce(p){return p?N(()=>f(p)()):N(()=>y(!0))}return{register:L,handleSubmit:Ee,setValue:k,getValue:M,setError:P,clearError:ee,clearErrors:V,reset:B,watch:Ce,validate:g,formState:{get values(){return y(!0)},get errors(){return R(!0)},error:p=>c(p)(),get touched(){let p={};for(let[C,A]of Object.entries(a))A()&&(p[C]=!0);return p},isDirty:()=>h(),isValid:_,isValidating:()=>E(),isSubmitting:()=>v(),isSubmitted:()=>b(),submitCount:()=>S(),dirtyFields:x}}}function Lr(e){return async t=>{try{return{values:await e.parseAsync(t),errors:{}}}catch(n){let o={};for(let r of n.errors||[]){let s=r.path.join(".");o[s]||(o[s]={type:r.code,message:r.message})}return{values:{},errors:o}}}}function Mr(e){return async t=>{try{return{values:await e.validate(t,{abortEarly:!1}),errors:{}}}catch(n){let o={};for(let r of n.inner||[])o[r.path]||(o[r.path]={type:r.type,message:r.message});return{values:{},errors:o}}}}function Fr(e){return async t=>{let n={};for(let[o,r]of Object.entries(e)){let s=t[o];for(let i of r){let a=i(s,t);if(a){n[o]={type:"validation",message:a};break}}}return{values:t,errors:n}}}var Pr={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,o)=>{if(n!==o[e])return t||`Must match ${e}`},custom:e=>e};function Nr(e,t={}){let{validate:n,defaultValue:o=""}=t,r=l(o),s=l(null),i=l(!1),a=l(!1);async function u(){if(!n)return!0;let f=await n(r.peek());return s.set(f||null),!f}return{name:e,value:()=>r(),error:()=>s(),isTouched:()=>i(),isDirty:()=>a(),setValue:f=>{r.set(f),a.set(!0)},setError:f=>s.set(f),validate:u,reset:()=>{r.set(o),s.set(null),i.set(!1),a.set(!1)},inputProps:()=>({name:e,value:r(),onInput:f=>{r.set(f.target.value),a.set(!0)},onBlur:()=>{i.set(!0),u()}})}}function Or(e){let{register:t,error:n,...o}=e,r=t?t(e.name):{};return w("input",{...o,...r,"aria-invalid":n?"true":void 0})}function $r(e){let{register:t,error:n,...o}=e,r=t?t(e.name):{};return w("textarea",{...o,...r,"aria-invalid":n?"true":void 0})}function Hr(e){let{register:t,error:n,children:o,...r}=e,s=t?t(e.name):{};return w("select",{...r,...s,"aria-invalid":n?"true":void 0},o)}function Vr(e){let{register:t,...n}=e,o=t?t(e.name):{};return w("input",{type:"checkbox",...n,...o,checked:o.value})}function jr(e){let{register:t,value:n,...o}=e,r=t?t(e.name):{};return w("input",{type:"radio",value:n,...o,checked:r.value===n,onChange:s=>{s.target.checked&&r.onInput&&r.onInput({target:{value:n}})}})}function qr({name:e,formState:t,errors:n,render:o}){let r=t&&typeof t.error=="function"?t.error(e):(t?.errors!=null?t.errors:typeof n=="function"?n():n)?.[e]||null;return r?o?o({message:r.message,type:r.type}):w("span",{class:"what-error",role:"alert"},r.message):null}var ft={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
|
+
`,ze=!1;function ee(){if(ze||typeof document>"u")return;ze=!0;let e=document.createElement("style");e.textContent=sr,document.head.appendChild(e)}function Me({width:e,height:t,variant:n="shimmer",circle:r=!1,class:o,style:s,count:i=1}){ee();let a=`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""} ${n==="wave"?"what-skeleton-wave":""}`,u=o?`${a} ${o}`:a,d={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t,borderRadius:r?"50%":void 0,...s};return i===1?C("div",{class:u,style:d,"aria-hidden":"true"}):Array.from({length:i},(c,l)=>C("div",{key:l,class:u,style:{...d,marginBottom:l<i-1?"8px":void 0},"aria-hidden":"true"}))}function Le({lines:e=3,lastLineWidth:t="60%",lineHeight:n=16,gap:r=8,variant:o="shimmer"}){return ee(),C("div",{class:"what-skeleton-text","aria-hidden":"true"},Array.from({length:e},(s,i)=>C("div",{key:i,class:`what-skeleton ${o==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${n}px`,width:i===e-1?t:"100%",marginBottom:i<e-1?`${r}px`:void 0}})))}function ir({size:e=40,variant:t="shimmer"}){return Me({width:e,height:e,circle:!0,variant:t})}function Ue({imageHeight:e=200,lines:t=3,variant:n="shimmer"}){return ee(),C("div",{class:"what-skeleton-card","aria-hidden":"true"},C("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:`${e}px`,width:"100%",marginBottom:"16px"}}),C("div",{class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"24px",width:"70%",marginBottom:"12px"}}),Le({lines:t,variant:n}))}function ar({rows:e=5,columns:t=4,variant:n="shimmer"}){return ee(),C("div",{class:"what-skeleton-table","aria-hidden":"true"},C("div",{style:{display:"flex",gap:"16px",marginBottom:"16px"}},Array.from({length:t},(r,o)=>C("div",{key:o,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"20px",flex:1}}))),Array.from({length:e},(r,o)=>C("div",{key:o,style:{display:"flex",gap:"16px",marginBottom:o<e-1?"12px":void 0}},Array.from({length:t},(s,i)=>C("div",{key:i,class:`what-skeleton ${n==="pulse"?"what-skeleton-pulse":""}`,style:{height:"16px",flex:1}})))))}function cr({type:e="default",height:t,children:n}){return ee(),e==="card"?Ue({}):e==="text"?Le({}):n||C("div",{class:"what-skeleton what-island-skeleton",style:{height:typeof t=="number"?`${t}px`:t||"100px",width:"100%"},"aria-hidden":"true"})}function ur(e,t=[]){let n=f(!0),r=f(null),o=f(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()?Me(s):null}}function lr({width:e="100%",height:t=100,label:n="Loading...",showLabel:r=!1,variant:o="shimmer"}){return ee(),C("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&&C("span",{style:{color:"var(--skeleton-text, #999)",fontSize:"14px"}},n))}function fr({size:e=8,color:t="#666"}){ee();let n={width:`${e}px`,height:`${e}px`,borderRadius:"50%",backgroundColor:t,animation:"what-skeleton-pulse 1s infinite ease-in-out"};return C("div",{class:"what-loading-dots",style:{display:"flex",gap:`${e/2}px`},"aria-label":"Loading",role:"status"},C("div",{style:{...n,animationDelay:"0s"}}),C("div",{style:{...n,animationDelay:"0.2s"}}),C("div",{style:{...n,animationDelay:"0.4s"}}))}function dr({size:e=24,color:t="#666",strokeWidth:n=2}){return C("svg",{width:e,height:e,viewBox:"0 0 24 24",style:{animation:"spin 1s linear infinite"},"aria-label":"Loading",role:"status"},C("style",null,"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"),C("circle",{cx:12,cy:12,r:10,stroke:t,strokeWidth:n,fill:"none",strokeDasharray:"31.4 31.4",strokeLinecap:"round"}))}var P=new Map,K=new Map,J=new Map,q=new Map,Ke=200;function ne(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 ve(e){return q.set(e,Date.now()),P.has(e)||(P.set(e,f(null)),P.size>Ke&&hr()),P.get(e)}function Je(e){return K.has(e)||K.set(e,f(null)),K.get(e)}function pr(e){return J.has(e)||J.set(e,f(!1)),J.get(e)}function hr(){let e=[...q.entries()].sort((n,r)=>n[1]-r[1]),t=Math.floor(Ke*.2);for(let n=0;n<t&&n<e.length;n++){let r=e[n][0];G.has(r)&&G.get(r).size>0||(P.delete(r),K.delete(r),J.delete(r),q.delete(r),pe.delete(r))}}var G=new Map;function Ze(e,t){return G.has(e)||G.set(e,new Set),G.get(e).add(t),()=>{let n=G.get(e);n&&(n.delete(t),n.size===0&&G.delete(e))}}var te=new Map,pe=new Map;function Y(e){let t=V?.(),n=$(e);return t&&t.effects.push(n),n}function gr(e,t={}){let{method:n="GET",body:r,headers:o={},transform:s=h=>h,initialData:i=null}=t,a=f(i),u=f(null),d=f(!0),c=null;async function l(){c&&c.abort(),c=new AbortController;let{signal:h}=c;d.set(!0),u.set(null);try{let v=await fetch(e,{method:n,headers:{"Content-Type":"application/json",...o},body:r?JSON.stringify(r):void 0,signal:h});if(!v.ok)throw new Error(`HTTP ${v.status}: ${v.statusText}`);let w=await v.json();h.aborted||a.set(s(w))}catch(v){h.aborted||u.set(v)}finally{h.aborted||d.set(!1)}}return Y(()=>(l(),()=>{c&&c.abort()})),{data:()=>a(),error:()=>u(),isLoading:()=>d(),refetch:l,mutate:h=>a.set(h)}}function mr(e,t,n={}){let{revalidateOnFocus:r=!0,revalidateOnReconnect:o=!0,refreshInterval:s=0,dedupingInterval:i=2e3,fallbackData:a,onSuccess:u,onError:d,suspense:c=!1}=n;if(e==null||e===!1){let m=f(a||null),T=f(null);return{data:()=>m(),error:()=>T(),isLoading:()=>!1,isValidating:()=>!1,mutate:_=>m.set(typeof _=="function"?_(m()):_),revalidate:()=>Promise.resolve()}}let l=ve(e),h=Je(e),v=pr(e),w=O(()=>l()??a??null),S=O(()=>l()==null&&v()),k=null;async function y(){let m=Date.now();if(te.has(e)){let g=te.get(e);if(m-g.timestamp<i)return g.refCount++,g.promise}let T=pe.get(e);if(T&&m-T<i&&l.peek()!=null)return l.peek();if(k){let g=te.get(e);(!g||g.refCount<=1)&&k.abort()}k=new AbortController;let{signal:_}=k;v.set(!0);let x=t(e,{signal:_});te.set(e,{promise:x,timestamp:m,refCount:1});try{let g=await x;return _.aborted?void 0:(M(()=>{l.set(g),h.set(null)}),q.set(e,Date.now()),pe.set(e,Date.now()),u&&u(g,e),g)}catch(g){if(_.aborted)return;throw h.set(g),d&&d(g,e),g}finally{_.aborted||v.set(!1);let g=te.get(e);g&&(g.refCount--,g.refCount<=0&&te.delete(e))}}let A=Ze(e,()=>y().catch(()=>{}));return Y(()=>(y().catch(()=>{}),()=>{k&&k.abort(),A()})),r&&typeof window<"u"&&Y(()=>{let m=()=>{document.visibilityState==="visible"&&y().catch(()=>{})};return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)}),o&&typeof window<"u"&&Y(()=>{let m=()=>y().catch(()=>{});return window.addEventListener("online",m),()=>window.removeEventListener("online",m)}),s>0&&Y(()=>{let m=setInterval(()=>{y().catch(()=>{})},s);return()=>clearInterval(m)}),{data:()=>w(),error:()=>h(),isLoading:()=>S(),isValidating:()=>v(),mutate:(m,T=!0)=>{let _=typeof m=="function"?m(l.peek()):m;l.set(_),q.set(e,Date.now()),T&&y().catch(()=>{})},revalidate:y}}function yr(e){let{queryKey:t,queryFn:n,enabled:r=!0,staleTime:o=0,cacheTime:s=300*1e3,refetchOnWindowFocus:i=!0,refetchInterval:a=!1,retry:u=3,retryDelay:d=b=>Math.min(1e3*2**b,3e4),onSuccess:c,onError:l,onSettled:h,select:v,placeholderData:w}=e,S=ne(t),k=ve(S),y=O(()=>{let b=k();return v&&b!==null?v(b):b}),A=Je(S),m=f(k.peek()!=null?"success":"loading"),T=f("idle"),_=0,x=null;async function g(){if(!r)return;let b=Date.now();if(k.peek()!=null&&b-_<o)return k.peek();x&&x.abort(),x=new AbortController;let{signal:D}=x;T.set("fetching"),k.peek()==null&&m.set("loading");let N=0;async function Z(){try{let H=await n({queryKey:Array.isArray(t)?t:[t],signal:D});return D.aborted?void 0:(M(()=>{k.set(H),A.set(null),m.set("success"),T.set("idle")}),_=Date.now(),q.set(S,Date.now()),c&&c(H),h&&h(H,null),setTimeout(()=>{if(Date.now()-_>=s){let B=G.get(S);(!B||B.size===0)&&(P.delete(S),K.delete(S),J.delete(S),q.delete(S),pe.delete(S))}},s),H)}catch(H){if(D.aborted)return;if(N++,N<u)return await new Promise((B,ke)=>{let Se=setTimeout(B,d(N));D.addEventListener("abort",()=>{clearTimeout(Se),ke(new DOMException("Aborted","AbortError"))},{once:!0})}).catch(B=>{if(B.name!=="AbortError")throw B}),D.aborted?void 0:Z();throw M(()=>{A.set(H),m.set("error"),T.set("idle")}),l&&l(H),h&&h(null,H),H}}return Z()}let L=Ze(S,()=>g().catch(()=>{}));return Y(()=>(r&&g().catch(()=>{}),()=>{x&&x.abort(),L()})),i&&typeof window<"u"&&Y(()=>{let b=()=>{document.visibilityState==="visible"&&g().catch(()=>{})};return document.addEventListener("visibilitychange",b),()=>document.removeEventListener("visibilitychange",b)}),a&&Y(()=>{let b=setInterval(()=>{g().catch(()=>{})},a);return()=>clearInterval(b)}),{data:()=>y()??w,error:()=>A(),status:()=>m(),fetchStatus:()=>T(),isLoading:()=>m()==="loading",isError:()=>m()==="error",isSuccess:()=>m()==="success",isFetching:()=>T()==="fetching",refetch:g}}function xr(e){let{queryKey:t,queryFn:n,getNextPageParam:r,getPreviousPageParam:o,initialPageParam:s,...i}=e,a=f([]),u=f([s]),d=f(!0),c=f(!1),l=f(!1),h=f(!1),v=ne(t),w=null,S=!1;async function k(y,A="next"){w&&w.abort(),w=new AbortController;let{signal:m}=w,T=A==="next"?l:h;T.set(!0);try{let _=await n({queryKey:Array.isArray(t)?t:[t],pageParam:y,signal:m});return m.aborted?void 0:(M(()=>{S?(a.set([_]),u.set([y]),S=!1):A==="next"?(a.set([...a.peek(),_]),u.set([...u.peek(),y])):(a.set([_,...a.peek()]),u.set([y,...u.peek()]));let x=r?.(_,a.peek());if(d.set(x!==void 0),o){let g=o(_,a.peek());c.set(g!==void 0)}}),_)}finally{m.aborted||T.set(!1)}}return Y(()=>(k(s).catch(()=>{}),()=>{w&&w.abort()})),{data:()=>({pages:a(),pageParams:u()}),hasNextPage:()=>d(),hasPreviousPage:()=>c(),isFetchingNextPage:()=>l(),isFetchingPreviousPage:()=>h(),fetchNextPage:async()=>{let y=a.peek()[a.peek().length-1],A=r?.(y,a.peek());if(A!==void 0)return k(A,"next")},fetchPreviousPage:async()=>{let y=a.peek()[0],A=o?.(y,a.peek());if(A!==void 0)return k(A,"previous")},refetch:async()=>(S=!0,k(s))}}function vr(){let e=new Set(P.keys());for(let t of G.keys())e.add(t);return e}function wr(e,t={}){let{hard:n=!1,exact:r=!1}=t,o=[];if(typeof e=="function")for(let[s]of P)e(s)&&o.push(s);else if(Array.isArray(e)&&!r){let s=ne(e),i=s+":";for(let a of vr())(a===s||typeof a=="string"&&a.startsWith(i))&&o.push(a)}else o.push(ne(e));for(let s of o){n&&P.has(s)&&P.get(s).set(null);let i=G.get(s);if(i)for(let a of i)a()}}function br(e,t){e=ne(e);let n=ve(e);return t(e).then(r=>(n.set(r),q.set(e,Date.now()),r))}function kr(e,t){e=ne(e);let n=ve(e),r=n.peek();n.set(typeof t=="function"?t(r):t),q.set(e,Date.now())}function Sr(e){return e=ne(e),P.has(e)?P.get(e).peek():void 0}function Er(){P.clear(),K.clear(),J.clear(),q.clear(),pe.clear(),te.clear()}function Cr(){let e=[];for(let[t,n]of P)e.push({key:t,data:n.peek(),error:K.has(t)?K.get(t).peek():null,isValidating:J.has(t)?J.get(t).peek():!1});return e}function _r(e={}){let t=V?.();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={},i={},a={},u=f({});function d(p){return s[p]||(s[p]=f(t[p]??"")),s[p]}function c(p){return i[p]||(i[p]=f(null)),i[p]}function l(p){return a[p]||(a[p]=f(!1)),a[p]}let h=f(!1),v=f(!1),w=f(!1),S=f(!1),k=f(0);function y(p=!1){let E={...t};for(let[R,I]of Object.entries(s))E[R]=p?I():I.peek();return E}function A(p=!1){return p?u():u.peek()}function m(p,E){let R=E??null;c(p).set(R),u.set(I=>{if(I[p]===R)return I;if(R==null){if(!Object.prototype.hasOwnProperty.call(I,p))return I;let X={...I};return delete X[p],X}return{...I,[p]:R}})}function T(p={}){let E=p||{};M(()=>{for(let[R,I]of Object.entries(i))Object.prototype.hasOwnProperty.call(E,R)||I.set(null);for(let[R,I]of Object.entries(E))c(R).set(I??null);u.set({...E})})}let _=O(()=>Object.keys(A(!0)).length===0),x=O(()=>{let p={};for(let[E,R]of Object.entries(s))R()!==(t[E]??"")&&(p[E]=!0);return p});async function g(p){if(!o)return!0;S.set(!0);try{let R=(await o(y(!1)))?.errors||{};if(p){let I=R[p]??null;return m(p,I),!I}else return T(R),Object.keys(R).length===0}finally{S.set(!1)}}function L(p,E={}){let R=d(p),I=E.type==="checkbox"||E.type==="radio",ce=me=>{let at=me.target.type==="checkbox"||me.target.type==="radio"?me.target.checked:me.target.value;b(p,at),(n==="onChange"||w.peek()&&r==="onChange")&&g(p)},X={name:p,onBlur:()=>{l(p).set(!0),(n==="onBlur"||w.peek()&&r==="onBlur")&&g(p)},onFocus:()=>{},ref:E.ref};return I?(Object.defineProperty(X,"checked",{get(){return!!R()},enumerable:!0}),X.onchange=ce):(Object.defineProperty(X,"value",{get(){return R()},enumerable:!0}),X.oninput=ce),X}function b(p,E,R={}){let{shouldValidate:I=!1,shouldDirty:ce=!0}=R;d(p).set(E),ce&&h.set(!0),I&&g(p)}function D(p){return d(p)()}function N(p,E){m(p,E)}function Z(p){m(p,null)}function H(){T({})}function B(p=t){M(()=>{for(let[E,R]of Object.entries(s))R.set(p[E]??"");for(let E of Object.values(i))E.set(null);u.set({});for(let E of Object.values(a))E.set(!1);h.set(!1),w.set(!1)})}function ke(p,E){return async R=>{R&&R.preventDefault(),v.set(!0),w.set(!0),k.set(k.peek()+1),await g()?await p(y()):E&&E(A(!1)),v.set(!1)}}function Se(p){return p?O(()=>d(p)()):O(()=>y(!0))}return{register:L,handleSubmit:ke,setValue:b,getValue:D,setError:N,clearError:Z,clearErrors:H,reset:B,watch:Se,validate:g,formState:{get values(){return y(!0)},get errors(){return A(!0)},error:p=>c(p)(),get touched(){let p={};for(let[E,R]of Object.entries(a))R()&&(p[E]=!0);return p},isDirty:()=>h(),isValid:_,isValidating:()=>S(),isSubmitting:()=>v(),isSubmitted:()=>w(),submitCount:()=>k(),dirtyFields:x}}}function Rr(e){return async t=>{try{return{values:await e.parseAsync(t),errors:{}}}catch(n){let r={};for(let o of n.errors||[]){let s=o.path.join(".");r[s]||(r[s]={type:o.code,message:o.message})}return{values:{},errors:r}}}}function Ar(e){return async t=>{try{return{values:await e.validate(t,{abortEarly:!1}),errors:{}}}catch(n){let r={};for(let o of n.inner||[])r[o.path]||(r[o.path]={type:o.type,message:o.message});return{values:{},errors:r}}}}function Tr(e){return async t=>{let n={};for(let[r,o]of Object.entries(e)){let s=t[r];for(let i of o){let a=i(s,t);if(a){n[r]={type:"validation",message:a};break}}}return{values:t,errors:n}}}var Ir={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 Mr(e,t={}){let{validate:n,defaultValue:r=""}=t,o=f(r),s=f(null),i=f(!1),a=f(!1);async function u(){if(!n)return!0;let d=await n(o.peek());return s.set(d||null),!d}return{name:e,value:()=>o(),error:()=>s(),isTouched:()=>i(),isDirty:()=>a(),setValue:d=>{o.set(d),a.set(!0)},setError:d=>s.set(d),validate:u,reset:()=>{o.set(r),s.set(null),i.set(!1),a.set(!1)},inputProps:()=>({name:e,value:o(),onInput:d=>{o.set(d.target.value),a.set(!0)},onBlur:()=>{i.set(!0),u()}})}}function Lr(e){let{register:t,error:n,...r}=e,o=t?t(e.name):{};return C("input",{...r,...o,"aria-invalid":n?"true":void 0})}function Dr(e){let{register:t,error:n,...r}=e,o=t?t(e.name):{};return C("textarea",{...r,...o,"aria-invalid":n?"true":void 0})}function Fr(e){let{register:t,error:n,children:r,...o}=e,s=t?t(e.name):{};return C("select",{...o,...s,"aria-invalid":n?"true":void 0},r)}function Nr(e){let{register:t,...n}=e,r=t?t(e.name):{};return C("input",{type:"checkbox",...n,...r,checked:r.value})}function Or(e){let{register:t,value:n,...r}=e,o=t?t(e.name):{};return C("input",{type:"radio",value:n,...r,checked:o.value===n,onChange:s=>{s.target.checked&&o.onInput&&o.onInput({target:{value:n}})}})}function Pr({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}):C("span",{class:"what-error",role:"alert"},o.message):null}var nt={INFINITE_EFFECT:{code:"ERR_INFINITE_EFFECT",severity:"error",template:'Effect "{{effectName}}" exceeded 25 flush iterations \u2014 likely an infinite loop.',suggestion:"An effect is writing to a signal it also reads, creating a cycle. Use untrack() to read the signal without subscribing, or restructure so the write and read are in separate effects.",codeExample:`// Bad \u2014 reads and writes count, creating a cycle:
|
|
64
54
|
effect(() => { count(count() + 1); });
|
|
65
55
|
|
|
66
56
|
// Good \u2014 use untrack() so the read doesn't subscribe:
|
|
@@ -130,6 +120,6 @@ redirect(ALLOWED.has(query.next) ? query.next : '/');`},REDIRECT_NOT_CAUGHT:{cod
|
|
|
130
120
|
|
|
131
121
|
// On the server, catch it instead of navigating:
|
|
132
122
|
try { html = renderToString(<App />); }
|
|
133
|
-
catch (e) { if (e.name === 'RouterRedirect') return Response.redirect(e.to, 302); throw e; }`}},
|
|
134
|
-
Suggestion: ${n.suggestion}`),
|
|
135
|
-
Suggestion: ${n.suggestion}`),
|
|
123
|
+
catch (e) { if (e.name === 'RouterRedirect') return Response.redirect(e.to, 302); throw e; }`}},ie=class extends Error{constructor({code:t,message:n,suggestion:r,file:o,line:s,component:i,signal:a,effect:u}){super(n),this.name="WhatError",this.code=t,this.suggestion=r,this.file=o,this.line=s,this.component=i,this.signal=a,this.effect=u}toJSON(){return{code:this.code,message:this.message,suggestion:this.suggestion,file:this.file,line:this.line,component:this.component,signal:this.signal,effect:this.effect}}};function oe(e,t={}){let n=typeof e=="string"?nt[e]:e;if(!n)return new ie({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 ie({code:n.code,message:r,suggestion:n.suggestion,file:t.file,line:t.line,component:t.component,signal:t.signal||t.signalName,effect:t.effect||t.effectName})}var re=[],tt=200;function we(e){F&&(re.push({...e.toJSON(),timestamp:Date.now()}),re.length>tt&&(re=re.slice(-tt)))}function be(e){return e?re.filter(t=>t.timestamp>e):re.slice()}function $r(){re=[]}function Hr(e,t={}){let n=e?.message||String(e);return n.includes("infinite effect loop")||n.includes("25 iterations")?oe("INFINITE_EFFECT",t):n.includes("hydration")||n.includes("Hydration")?oe("HYDRATION_MISMATCH",t):n.includes("Signal.set() called inside a computed")?oe("SIGNAL_WRITE_IN_RENDER",{...t,signalName:n.match(/signal: (\w+)/)?.[1]||t.signalName}):new ie({code:"ERR_RUNTIME",message:n,suggestion:"Check the stack trace and component context for more details.",...t})}var he={signalReadDetection:!0,componentNaming:!0,importValidation:!0};function Vr(e){Object.assign(he,e)}function jr(){return{...he}}function Gr(e,t){return!F||!he.signalReadDetection||(e.toString=function(){let n=oe("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${n.message}
|
|
124
|
+
Suggestion: ${n.suggestion}`),we(n),String(e())},e.valueOf=function(){let n=oe("MISSING_SIGNAL_READ",{signalName:t||"(unnamed)"});return console.warn(`[what] ${n.message}
|
|
125
|
+
Suggestion: ${n.suggestion}`),we(n),e()}),e}function qr(e){if(!F||!he.componentNaming||!e||/^[A-Z]/.test(e))return null;let t=`Component "${e}" should use PascalCase (e.g., "${Br(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 Br(e){return e.charAt(0).toUpperCase()+e.slice(1)}var rt=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 Wr(e){if(!F||!he.importValidation)return[];let t=[];for(let n of e)rt.has(n)||t.push({name:n,message:`"${n}" is not a valid export from what-framework.`,suggestion:`Check the API reference. Did you mean: ${Yr(n)}?`});return t}function Yr(e){let t=e.toLowerCase(),n=null,r=1/0;for(let o of rt){let s=Xr(t,o.toLowerCase());s<r&&(r=s,n=o)}return r<=3?n:"(no close match found)"}function Xr(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 Qr="0.12.0",ge=[];function zr(e){F&&ge.push(e)}function Ur(e){if(!F)return;let t=ge.indexOf(e);t>=0&&ge.splice(t,1)}function ot(){return ge.slice()}var ae=[];function Kr(e){F&&ae.push(e)}function Jr(e){if(!F)return;let t=ae.indexOf(e);t>=0&&ae.splice(t,1)}function st(){return ae.slice()}function it(){let e=be(),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=ae.filter(u=>!!(u._subs&&u._subs.size===0)).length,i=ae.length,a=i>1e4?"high":i>1e3?"medium":"low";return{effectCycleRisk:r,orphanEffects:o.length,signalLeaks:s,memoryPressure:a,recentErrorCount:t.length,totalSignals:i,totalComponents:ge.length}}function Zr(){F&&(typeof globalThis>"u"||(globalThis.__WHAT_AGENT__={framework:"what-framework",version:Qr,mode:"development",features:["signals","effects","computed","ssr","islands","router","stores","forms","animations","a11y"],components:()=>ot().map(e=>({id:e.id,name:e.name||e.displayName||e.constructor?.name})),signals:()=>st().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:()=>be(),health:()=>it(),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{Nr as Checkbox,nt as ERROR_CODES,Et as ErrorBoundary,Pr as ErrorMessage,Wt as FocusTrap,_t as For,mt as Fragment,Hn as Head,Lr as Input,Tt as Island,cr as IslandSkeleton,sn as Keys,en as LiveRegion,fr as LoadingDots,At as Match,lr as Placeholder,Pt as Portal,Or as Radio,Fr as Select,Ct as Show,Me as Skeleton,ir as SkeletonAvatar,Ue as SkeletonCard,ar as SkeletonTable,Le as SkeletonText,Qt as SkipLink,dr as Spinner,St as Suspense,Rt as Switch,Dr as Textarea,Zt as VisuallyHidden,ie as WhatError,ln as _$createComponent,fn as _$template,gt as __drainPreinstallBuffer,Cr as __getCacheSnapshot,xt as __installServerContextStorage,Ee as __readHydrationData,kn as __resetHydrationData,ct as __setDevToolsHooks,Vt as _isAriaAttr,un as _setTextInsertHook,De as _template,Yt as announce,Xt as announceAssertive,$n as atom,M as batch,Gn as beginHeadCollection,qr as checkComponentName,vn as classList,Hr as classifyError,Er as clearCache,$r as clearCollectedErrors,Xn as clearHead,Mt as cls,we as collectError,O as computed,Vr as configureGuardrails,Mn as createContext,Nn as createResource,pt as createRoot,Pn as createStore,Qe as createTransitionClasses,oe as createWhatError,or as cssTransition,Dt as debounce,yn as delegateEvents,Pe as derived,It as each,Xe as easings,$ as effect,qn as endHeadCollection,je as flushScheduler,lt as flushSync,st as getActiveSignals,be as getCollectedErrors,jr as getGuardrailConfig,it as getHealth,Ce as getLoaderData,ot as getMountedComponents,ft as getOwner,Sr as getQueryData,_e as getResource,se as getServerContext,C as h,yt as html,bn as hydrate,pn as insert,Zr as installAgentContext,Gr as installSignalReadGuardrail,wr as invalidateQueries,wn as isHydrating,kt as lazy,hn as mapArray,Qn as measure,bt as memo,jt as mount,zn as mutate,Kn as nextFrame,xn as on,Fn as onCleanup,Zn as onIntersect,an as onKey,cn as onKeys,Dn as onMount,Jn as onResize,ht as onRootCleanup,br as prefetchQuery,qe as raf,zr as registerComponent,Kr as registerSignal,Ir as rules,dt as runWithOwner,wt as runWithServerContext,W as scheduleRead,U as scheduleWrite,mn as setProp,kr as setQueryData,vt as setServerContext,f as signal,ut as signalMemo,Tr as simpleResolver,er as smoothScrollTo,gn as spread,We as spring,On as storeComputed,Lt as style,dn as svgTemplate,De as template,Ft as throttle,Ht as transition,Ye as tween,Ur as unregisterComponent,Jr as unregisterSignal,ue as untrack,rr as useAnimatedValue,Kt as useAriaChecked,zt as useAriaExpanded,Ut as useAriaSelected,Tn as useCallback,$t as useClickOutside,_n as useComputed,Fe as useContext,rn as useDescribedBy,Rn as useEffect,gr as useFetch,Mr as useField,Gt as useFocus,qt as useFocusRestore,Bt as useFocusTrap,_r as useForm,nr as useGesture,tn as useId,nn as useIds,xr as useInfiniteQuery,on as useLabelledBy,Sn as useLoaderData,Ot as useLocalStorage,Nt as useMediaQuery,An as useMemo,yr as useQuery,Ln as useReducer,In as useRef,Jt as useRovingTabIndex,mr as useSWR,Un as useScheduledEffect,Cn as useSignal,ur as useSkeleton,En as useState,tr as useTransition,Wr as validateImports,Ar as yupResolver,Rr as zodResolver};
|
package/dist/render.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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,u as d,v as e,w as f,x as g,y as h,z as i}from"./chunk-RXISSKLI.min.js";import{e as a,g as b,i as c}from"./chunk-NCPX66TV.min.js";import"./chunk-O3SKPRTY.min.js";export{e as _$createComponent,f as _$template,d as _setTextInsertHook,g as _template,t as classList,r as delegateEvents,a as effect,v as hydrate,i as insert,u as isHydrating,j as mapArray,b as memo,s as on,o as setAttr,q as setChecked,m as setClass,l as setProp,n as setStyle,p as setValue,k as spread,h as svgTemplate,g as template,c as untrack};
|
package/dist/testing.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{T as m,c as f,e as p,h as w,l as b}from"./chunk-NCPX66TV.min.js";import{a as h}from"./chunk-O3SKPRTY.min.js";var l=null;function E(){return typeof document<"u"&&(l=document.createElement("div"),l.id="test-root",document.body.appendChild(l)),l}function v(){l&&(l.innerHTML="",l.parentNode&&l.parentNode.removeChild(l),l=null)}function N(e,t={}){let{container:n}=t,o=n||E();if(!o)throw new Error("No DOM container available. Are you running in Node.js without jsdom?");let s=m(e,o);return{container:o,unmount:s,getByText:r=>d(o,r),getByTestId:r=>o.querySelector(`[data-testid="${r}"]`),getByRole:r=>o.querySelector(`[role="${r}"]`),getAllByText:r=>g(o,r),queryByText:r=>d(o,r),queryByTestId:r=>o.querySelector(`[data-testid="${r}"]`),debug:()=>console.log(o.innerHTML),findByText:(r,u)=>y(()=>d(o,r),{timeout:u}),findByTestId:(r,u)=>y(()=>o.querySelector(`[data-testid="${r}"]`),{timeout:u})}}function q(e,t){let n=E();if(!n)throw new Error("No DOM container available. Are you running in Node.js without jsdom?");let o={},s=null,r;return b(u=>{s=u;let c=h(e,t||{});r=m(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(){w()},unmount(){r&&r(),s&&s(),v()},getByText:u=>d(n,u),getByTestId:u=>n.querySelector(`[data-testid="${u}"]`),queryByText:u=>d(n,u),debug:()=>console.log(n.innerHTML)}}function C(){w()}function M(e){let t=[],n=[],o=f,s=new Map,r=i=>{t.includes(i)||t.push(i)},u=i=>{n.includes(i)||n.push(i)},c;return b(i=>{c=i;let a=p(()=>{e()})}),c&&c(),{accessed:t,written:n}}function D(e,t){let n=[t],o=0,s=f(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 d(e,t){let n=t instanceof RegExp?t:null,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1);for(;o.nextNode();){let s=o.currentNode;if(n?n.test(s.textContent):s.textContent.includes(t))return s.parentElement}return null}function g(e,t){let n=[],o=t instanceof RegExp?t:null,s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1);for(;s.nextNode();){let r=s.currentNode;(o?o.test(r.textContent):r.textContent.includes(t))&&n.push(r.parentElement)}return n}var H={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 y(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 O(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 _(e){let t=await e();return w(),await new Promise(n=>queueMicrotask(n)),await new Promise(n=>setTimeout(n,0)),t}function F(e){let t=f(e),n=[e];return p(()=>{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 R(e="MockComponent"){let t=[];function n(o){return t.push({props:o,timestamp:Date.now()}),h("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 j={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}"`)}},A={getByText:e=>d(document.body,e),getByTestId:e=>document.querySelector(`[data-testid="${e}"]`),getByRole:e=>document.querySelector(`[role="${e}"]`),getAllByText:e=>g(document.body,e),queryByText:e=>d(document.body,e),queryByTestId:e=>document.querySelector(`[data-testid="${e}"]`),debug:()=>console.log(document.body.innerHTML)};export{_ as act,v as cleanup,F as createTestSignal,j as expect,H as fireEvent,C as flushEffects,R as mockComponent,D as mockSignal,N as render,q as renderTest,A as screen,E as setupDOM,M as trackSignals,y as waitFor,O as waitForElementToBeRemoved};
|
package/index.d.ts
CHANGED
|
@@ -646,3 +646,33 @@ export interface HealthReport {
|
|
|
646
646
|
export function getHealth(): HealthReport;
|
|
647
647
|
/** Expose globalThis.__WHAT_AGENT__ for agent tooling (dev mode only). */
|
|
648
648
|
export function installAgentContext(): void;
|
|
649
|
+
|
|
650
|
+
/** Warn when a component function is not PascalCase. Dev-mode only; returns null in production. */
|
|
651
|
+
export function checkComponentName(name: string): GuardrailWarning | null;
|
|
652
|
+
|
|
653
|
+
export interface GuardrailWarning {
|
|
654
|
+
code: string;
|
|
655
|
+
name: string;
|
|
656
|
+
suggestion: string;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
export interface InvalidImport {
|
|
660
|
+
name: string;
|
|
661
|
+
message: string;
|
|
662
|
+
suggestion: string;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/** Report import names that are not valid exports of what-framework. Dev-mode only. */
|
|
666
|
+
export function validateImports(importNames: readonly string[]): InvalidImport[];
|
|
667
|
+
|
|
668
|
+
// --- Agent registries ---
|
|
669
|
+
// The devtools bridge and MCP server read these to enumerate the live graph.
|
|
670
|
+
// Registration is a no-op in production builds; the getters always return a copy.
|
|
671
|
+
|
|
672
|
+
export function registerComponent(component: unknown): void;
|
|
673
|
+
export function unregisterComponent(component: unknown): void;
|
|
674
|
+
export function getMountedComponents(): unknown[];
|
|
675
|
+
|
|
676
|
+
export function registerSignal(sig: unknown): void;
|
|
677
|
+
export function unregisterSignal(sig: unknown): void;
|
|
678
|
+
export function getActiveSignals(): unknown[];
|
package/jsx-dev-runtime.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// What Framework — JSX dev-runtime type definitions.
|
|
2
2
|
// Re-exports the runtime types (including the JSX namespace) and adds jsxDEV,
|
|
3
3
|
// which the "react-jsxdev" transform emits in development builds.
|
|
4
|
-
import type { VNode } from './index';
|
|
4
|
+
import type { VNode } from './index.js';
|
|
5
5
|
|
|
6
|
-
export * from './jsx-runtime';
|
|
6
|
+
export * from './jsx-runtime.js';
|
|
7
7
|
|
|
8
8
|
export function jsxDEV(
|
|
9
9
|
type: any,
|
package/jsx-runtime.d.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
// documentation, while an index signature keeps arbitrary/custom attributes and
|
|
12
12
|
// web-component tags valid (never false-flagging code the runtime accepts).
|
|
13
13
|
|
|
14
|
-
import type { VNode, VNodeChild } from './index';
|
|
14
|
+
import type { VNode, VNodeChild } from './index.js';
|
|
15
15
|
|
|
16
|
-
export { Fragment } from './index';
|
|
16
|
+
export { Fragment } from './index.js';
|
|
17
17
|
|
|
18
18
|
/** A JSX attribute value in What may be static or a reactive `() => value` thunk. */
|
|
19
19
|
export type Reactive<T> = T | (() => T);
|
package/package.json
CHANGED
package/render.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export {
|
|
|
9
9
|
classList,
|
|
10
10
|
effect,
|
|
11
11
|
untrack,
|
|
12
|
-
} from './index';
|
|
12
|
+
} from './index.js';
|
|
13
|
+
import type { VNodeChild } from './index.js';
|
|
13
14
|
|
|
14
15
|
// Compiler-internal template alias — identical to template() but never
|
|
15
16
|
// dev-warns. Compiled output imports this (SPRINT v0.11 C5).
|
|
@@ -28,3 +29,16 @@ export function setChecked(el: Element, value: any): void;
|
|
|
28
29
|
// exported from the package index). Emitted by the compiler for branch
|
|
29
30
|
// memoization of conditional JSX (SPRINT v0.11 C1).
|
|
30
31
|
export function memo<T>(fn: () => T): (() => T) & { peek(): T };
|
|
32
|
+
|
|
33
|
+
// --- Hydration ---
|
|
34
|
+
// hydrate() adopts server-rendered DOM instead of recreating it: it walks the
|
|
35
|
+
// existing nodes, attaches event handlers and reactive bindings in place, and
|
|
36
|
+
// restarts the useId sequence so client ids reproduce the server's.
|
|
37
|
+
export function hydrate(vnode: VNodeChild, container: Element): Node | Node[] | null;
|
|
38
|
+
|
|
39
|
+
/** True while a hydration pass is walking existing DOM. */
|
|
40
|
+
export function isHydrating(): boolean;
|
|
41
|
+
|
|
42
|
+
// SVG counterpart to template(): elements are created in the SVG namespace, which
|
|
43
|
+
// a plain innerHTML template cannot do.
|
|
44
|
+
export function svgTemplate(html: string): () => Element;
|