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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as R,J as gt,K as dt,L as yt,M as V,O as Z,Q as bt,R as mt,S as _t,T as ct,a as G,c as nt,e as N,m as X}from"./chunk-PABR63P3.min.js";var Y=null;function kt(t){Y=typeof t=="function"?t:null}function vt(t,e,n){if(typeof n=="function"){let i=()=>{let o=n();return o.length===1?o[0]:o};return i._lazyChildren=!0,e||(e={}),Object.defineProperty(e,"_$lazyChildren",{value:i,configurable:!0}),Z({tag:t,props:e,children:[],key:null,_vnode:!0})}if(n&&n.length>0){let i=n.length===1?n[0]:n;e?e.children=i:e={children:i}}return Z({tag:t,props:e||{},children:n||[],key:null,_vnode:!0})}var Mt={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>"}},Ht=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 Et(t){let e=t.match(/^<([a-zA-Z][a-zA-Z0-9]*)/);return e?e[1]:""}function jt(t){let e=t.trim(),n=Et(e);if(Ht.has(n))return Bt(e);let i=Mt[n];if(i){let r=document.createElement("template");r.innerHTML=i.wrap+e+i.unwrap;let m=r.content.firstChild;for(let c=0;c<i.depth;c++)m=m.firstChild;return()=>m.cloneNode(!0)}let o=document.createElement("template");return o.innerHTML=e,()=>o.content.firstChild.cloneNode(!0)}var pt=!1;function Ft(t){return G&&!pt&&(pt=!0,console.warn("[what] template() is a compiler internal. Use JSX instead. Direct calls with user input can lead to XSS vulnerabilities.")),jt(t)}function Bt(t){let e=t.trim();if(Et(e)==="svg"){let o=document.createElement("template");return o.innerHTML=e,()=>o.content.firstChild.cloneNode(!0)}let i=document.createElement("template");return i.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,()=>i.content.firstChild.firstChild.cloneNode(!0)}function $t(t,e,n){if(typeof e=="function"&&e._mapArray)return e(t,n||null);if(typeof e=="function"&&e._lazyChildren)return $t(t,e(),n);if(typeof e=="function"){let i=n||null,o=null,r=null,m=!1;return N(()=>{let c=e(),a=typeof c;if(!m){m=!0,a==="string"||a==="number"?(r=document.createTextNode(String(c)),i?t.insertBefore(r,i):t.appendChild(r),Y&&Y(t,String(c)),o=r):o=I(t,c,null,i);return}if(r!==null&&(a==="string"||a==="number")){let l=String(c);r.data!==l&&(r.data=l),Y&&Y(t,l);return}r=null,o=I(t,c,o,i)}),o}if(typeof e=="string"||typeof e=="number"){let i=document.createTextNode(String(e));return n?t.insertBefore(i,n):t.appendChild(i),i}return e!=null&&typeof e=="object"&&e.nodeType>0?(n?t.insertBefore(e,n):t.appendChild(e),e):I(t,e,null,n||null)}function wt(t){return!t||typeof t!="object"?!1:typeof Node<"u"&&t instanceof Node?!0:typeof t.nodeType=="number"&&typeof t.nodeName=="string"}function Nt(t){return!!t&&typeof t=="object"&&(t._vnode===!0||"tag"in t)}var ot=typeof SVGElement<"u";function xt(t){return ot&&t instanceof SVGElement&&t.tagName!=="foreignObject"}function Ct(t){return t==null?[]:Array.isArray(t)?t:[t]}function Lt(t,e,n){if(t==null||typeof t=="boolean")return n;if(Array.isArray(t)){for(let i=0;i<t.length;i++)Lt(t[i],e,n);return n}if(typeof t=="function"){let i=Z(t,e,xt(e));if(i&&i.nodeType===11){let o=Array.from(i.childNodes);for(let r=0;r<o.length;r++)n.push(o[r])}else i&&n.push(i);return n}if(typeof t=="string"||typeof t=="number")return n.push(document.createTextNode(String(t))),n;if(wt(t)){if(t.nodeType===11&&t.childNodes.length>0){let i=Array.from(t.childNodes);for(let o=0;o<i.length;o++)n.push(i[o])}else n.push(t);return n}if(Nt(t)){let i=Z(t,e,xt(e));if(i&&i.nodeType===11)if(i.childNodes.length===0)n.push(i);else{let o=Array.from(i.childNodes);for(let r=0;r<o.length;r++)n.push(o[r])}else i&&n.push(i);return n}return n.push(document.createTextNode(String(t))),n}function Dt(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 I(t,e,n,i){if(!t||typeof t.insertBefore!="function")return G&&console.warn("[what] reconcileInsert called with invalid parent:",t),n;let o=i||null;if(e==null||typeof e=="boolean"){let l=Ct(n);for(let y=0;y<l.length;y++){let s=l[y];s.parentNode===t&&(V(s),t.removeChild(s))}return null}if((typeof e=="string"||typeof e=="number")&&n&&!Array.isArray(n)&&n.nodeType===3){let l=String(e);return n.data!==l&&(n.data=l),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?(V(n),t.replaceChild(e,n)):o?t.insertBefore(e,o):t.appendChild(e),e}let r=Lt(e,t,[]),m=Ct(n);if(Dt(m,r))return n;let c=r.length;for(let l=0;l<m.length;l++){let y=m[l];if(y.parentNode!==t)continue;let s=!1;for(let C=0;C<c;C++)if(r[C]===y){s=!0;break}s||(V(y),t.removeChild(y))}let a=o;for(let l=r.length-1;l>=0;l--){let y=r[l];(y.parentNode!==t||y.nextSibling!==a)&&(a&&a.parentNode!==t&&(a=null),a?t.insertBefore(y,a):t.appendChild(y)),a=y}return r.length===0?null:r.length===1?r[0]:r}function te(t,e,n){let i=n?.key,o=n?.raw||!1,r=(m,c)=>{let a=[],l=[],y=[],s=i&&!o?new Map:null,C=document.createComment("/list");return m.insertBefore(C,c||null),N(()=>{let d=t()||[],b=C.parentNode||m;i?zt(b,C,a,d,l,y,e,i,s):Kt(b,C,a,d,l,y,e),a=d.length>0?d.slice():d}),C};return r._mapArray=!0,r}function Kt(t,e,n,i,o,r,m){let c=i.length,a=n.length;if(c===0){if(a>0){for(let u=0;u<a;u++)r[u]&&r[u]();for(let u=a-1;u>=0;u--){let h=o[u];h&&(V(h),h.parentNode===t&&t.removeChild(h))}o.length=0,r.length=0}return}if(a===0){let u=document.createDocumentFragment();for(let h=0;h<c;h++){let E=i[h],L=X(O=>(r[h]=O,m(E,h)));o[h]=L,u.appendChild(L)}t.insertBefore(u,e);return}let l=0,y=Math.min(a,c);for(;l<y&&n[l]===i[l];)l++;if(l===a&&l===c)return;let s=a-1,C=c-1;for(;s>=l&&C>=l&&n[s]===i[C];)s--,C--;let d=new Array(c),b=new Array(c);for(let u=0;u<l;u++)d[u]=o[u],b[u]=r[u];for(let u=C+1;u<c;u++){let h=s+1+(u-C-1);d[u]=o[h],b[u]=r[h]}let p=C-l+1,T=s-l+1;if(p===0)for(let u=l;u<=s;u++)r[u]?.(),o[u]&&V(o[u]),o[u]?.parentNode&&o[u].parentNode.removeChild(o[u]);else if(T===0){let u=l<c&&d[C+1]?d[C+1]:e,h=document.createDocumentFragment();for(let E=l;E<=C;E++){let L=i[E],O=E;d[E]=X(S=>(b[O]=S,m(L,O))),h.appendChild(d[E])}t.insertBefore(h,u)}else Ot(t,e,n,i,o,r,m,l,s,C,d,b);o.length=c,r.length=c;for(let u=0;u<c;u++)o[u]=d[u],r[u]=b[u]}function Ot(t,e,n,i,o,r,m,c,a,l,y,s){let C=new Map;for(let h=c;h<=a;h++)C.set(n[h],h);let d=l-c+1,b=new Int32Array(d);b.fill(-1);for(let h=c;h<=l;h++){let E=C.get(i[h]);E!==void 0&&(C.delete(i[h]),y[h]=o[E],s[h]=r[E],b[h-c]=E)}for(let[,h]of C)r[h]?.(),o[h]&&V(o[h]),o[h]?.parentNode&&o[h].parentNode.removeChild(o[h]);let p=d-Pt(b,d),T=new Uint8Array(d);if(p>1){let h=new Int32Array(p),E=new Int32Array(p),L=0;for(let S=0;S<d;S++)b[S]!==-1&&(h[L]=b[S],E[L]=S,L++);let O=St(h,p);for(let S=0;S<O.length;S++)T[E[O[S]]]=1}else if(p===1){for(let h=0;h<d;h++)if(b[h]!==-1){T[h]=1;break}}for(let h=c;h<=l;h++)if(!y[h]){let E=i[h],L=h;y[h]=X(O=>(s[L]=O,m(E,L)))}let u=l+1<y.length&&y[l+1]?y[l+1]:e;for(let h=l;h>=c;h--){let E=h-c;(b[E]===-1||!T[E])&&(u&&u.parentNode!==t&&(u=e),t.insertBefore(y[h],u)),u=y[h]}}function Pt(t,e){let n=0;for(let i=0;i<e;i++)t[i]===-1&&n++;return n}function St(t,e){if(e===0)return[];if(e===1)return[0];let n=new Int32Array(e),i=new Int32Array(e),o=1;n[0]=0,i[0]=-1;for(let c=1;c<e;c++)if(t[c]>t[n[o-1]])i[c]=n[o-1],n[o++]=c;else{let a=0,l=o-1;for(;a<l;){let y=a+l>>1;t[n[y]]<t[c]?a=y+1:l=y}n[a]=c,i[c]=a>0?n[a-1]:-1}let r=new Array(o),m=n[o-1];for(let c=o-1;c>=0;c--)r[c]=m,m=i[m];return r}function Vt(){return document.createComment("i")}function J(t,e,n,i){let o=e;for(;o&&o!==n;){let r=o.nextSibling;t.insertBefore(o,i),o=r}}function lt(t,e,n){let i=e;for(;i&&i!==n;){let o=i.nextSibling;V(i),t.removeChild(i),i=o}}function st(t,e,n,i,o,r,m,c,a){let l;if(o){let C=i(e),d=a(e);l=d,o.set(C,{itemSig:d})}else l=e;let y=Vt();t.appendChild(y);let s=X(C=>(c[n]=C,r(l,n)));t.appendChild(s),m[n]=y}function zt(t,e,n,i,o,r,m,c,a){let l=i.length,y=n.length;if(l===0){if(y>0){for(let f=0;f<y;f++)r[f]&&r[f]();o[0]&<(t,o[0],e),o.length=0,r.length=0,a&&a.clear()}return}if(y===0){let f=document.createDocumentFragment();for(let x=0;x<l;x++)st(f,i[x],x,c,a,m,o,r,nt);t.insertBefore(f,e);return}let s=0,C=Math.min(y,l);for(;s<C;){if(n[s]===i[s]){s++;continue}let f=c(n[s]),x=c(i[s]);if(f!==x)break;a&&a.get(f).itemSig.set(i[s]),s++}let d=y-1,b=l-1;for(;d>=s&&b>=s;){if(n[d]===i[b]){d--,b--;continue}let f=c(n[d]),x=c(i[b]);if(f!==x)break;a&&a.get(f).itemSig.set(i[b]),d--,b--}if(s>d&&s>b)return;let p=new Array(l),T=new Array(l);for(let f=0;f<s;f++)p[f]=o[f],T[f]=r[f];for(let f=b+1;f<l;f++){let x=d+1+(f-b-1);p[f]=o[x],T[f]=r[x]}let u=b-s+1,h=d-s+1;if(h===0){let f=b+1<l&&p[b+1]?p[b+1]:e,x=document.createDocumentFragment();for(let w=s;w<=b;w++)st(x,i[w],w,c,a,m,p,T,nt);t.insertBefore(x,f),Q(o,r,p,T,l);return}if(u===0){for(let f=s;f<=d;f++){r[f]?.();let x=U(t,o[f],o,f,e);lt(t,o[f],x),a&&a.delete(c(n[f]))}Q(o,r,p,T,l);return}if(u===h&&u>=2&&u<=Math.max(h,200)){let f=0,x=-1,w=-1;for(let _=0;_<u&&f<=4;_++){let A=c(n[s+_]),D=c(i[s+_]);A!==D&&(f===0?x=_:f===1&&(w=_),f++)}if(f===2){let _=s+x,A=s+w,D=c(n[_]),K=c(n[A]),q=c(i[_]),tt=c(i[A]);if(D===tt&&K===q){for(let g=0;g<s;g++)p[g]=o[g],T[g]=r[g];for(let g=s;g<=b;g++)p[g]=o[g],T[g]=r[g];for(let g=b+1;g<l;g++){let $=d+1+(g-b-1);p[g]=o[$],T[g]=r[$]}let z=p[_];p[_]=p[A],p[A]=z;let j=T[_];if(T[_]=T[A],T[A]=j,a){if(i[_]!==n[_]){let g=c(i[_]),$=a.get(g);$&&$.itemSig.set(i[_])}if(i[A]!==n[A]){let g=c(i[A]),$=a.get(g);$&&$.itemSig.set(i[A])}}let H=A===_+1||_===A+1,B=Math.min(_,A),M=Math.max(_,A);if(H){let g=U(t,o[M],o,M,e);J(t,o[M],g,o[B])}else{let g=U(t,o[A],o,A,e),$=document.createComment("tmp");t.insertBefore($,o[A]),J(t,o[A],g,o[_]);let et=U(t,o[_],o,_,e);J(t,o[_],et,$),t.removeChild($)}Q(o,r,p,T,l);return}}if(f>=2&&f<=u){let _=x,A=null,D=-1,K=-1,q=!1,tt=c(n[s+_]),z=-1;for(let j=_;j<u;j++)if(c(i[s+j])===tt){z=j;break}if(z>_){let j=!0;for(let H=_;H<z;H++)if(c(n[s+H+1])!==c(i[s+H])){j=!1;break}if(j){let H=!0;for(let B=z+1;B<u;B++)if(c(n[s+B])!==c(i[s+B])){H=!1;break}H&&(q=!0,D=s+_,K=s+z,A=tt)}}if(!q){let j=c(i[s+_]),H=-1;for(let B=_;B<h;B++)if(c(n[s+B])===j){H=B;break}if(H>_){let B=!0;for(let M=_;M<H;M++)if(c(n[s+M])!==c(i[s+M+1])){B=!1;break}if(B){let M=!0;for(let g=H+1;g<u;g++)if(c(n[s+g])!==c(i[s+g])){M=!1;break}M&&(q=!0,D=s+H,K=s+_,A=j)}}}if(q){for(let g=s;g<=d;g++)p[g]=o[g],T[g]=r[g];let j=p[D],H=T[D];if(D<K)for(let g=D;g<K;g++)p[g]=p[g+1],T[g]=T[g+1];else for(let g=D;g>K;g--)p[g]=p[g-1],T[g]=T[g-1];if(p[K]=j,T[K]=H,a)for(let g=s;g<=b;g++){let $=c(i[g]);if(i[g]!==n[g]){let et=a.get($);et&&et.itemSig.set(i[g])}}let B=U(t,j,o,D,e),M;K+1<l?M=p[K+1]:M=e,(K>=b+1||M&&M.parentNode!==t)&&(M=e),J(t,j,B,M),Q(o,r,p,T,l);return}}}let E=new Map;for(let f=s;f<=d;f++)E.set(c(n[f]),f);let L=new Int32Array(u);L.fill(-1);for(let f=s;f<=b;f++){let x=c(i[f]),w=E.get(x);w!==void 0&&(E.delete(x),p[f]=o[w],T[f]=r[w],L[f-s]=w,a&&i[f]!==n[w]&&a.get(x).itemSig.set(i[f]))}let O=[...E.values()].sort((f,x)=>x-f);for(let f of O){r[f]?.();let x=U(t,o[f],o,f,e);lt(t,o[f],x),a&&a.delete(c(n[f]))}for(let f=s;f<=b;f++)if(!p[f]){let x=document.createDocumentFragment();st(x,i[f],f,c,a,m,p,T,nt),p[f]._frag=x}let S=0,at=!0,ht=-1;for(let f=0;f<u;f++)L[f]!==-1&&(S++,L[f]<=ht&&(at=!1),ht=L[f]);let F=new Uint8Array(u);if(at)for(let f=0;f<u;f++)L[f]!==-1&&(F[f]=1);else if(S>1){let f=new Int32Array(S),x=new Int32Array(S),w=0;for(let A=0;A<u;A++)L[A]!==-1&&(f[w]=L[A],x[w]=A,w++);let _=St(f,S);for(let A=0;A<_.length;A++)F[x[_[A]]]=1}else if(S===1){for(let f=0;f<u;f++)if(L[f]!==-1){F[f]=1;break}}Q(o,r,p,T,l);let ft=b+1<l&&o[b+1]?o[b+1]:e;for(let f=b;f>=s;f--){let x=f-s,w=o[f];if(L[x]===-1)w._frag&&(t.insertBefore(w._frag,ft),delete w._frag);else if(!F[x]){let _=U(t,w,o,f,e);J(t,w,_,ft)}ft=w}}function U(t,e,n,i,o){let r=e.nextSibling;for(;r&&r!==o;){if(r.nodeType===8&&r.data==="i")return r;r=r.nextSibling}return o}function Q(t,e,n,i,o){t.length=o,e.length=o;for(let r=0;r<o;r++)t[r]=n[r],e[r]=i[r]}function ee(t,e){for(let n in e){let i=e[n];if(R(n)){if(typeof i!="function")continue;let o=n.slice(2).toLowerCase();t.addEventListener(o,i);continue}if(typeof i=="function"&&!R(n)){if(t._propEffects||(t._propEffects={}),t._propEffects[n])try{t._propEffects[n]()}catch{}n==="class"||n==="className"?t._propEffects[n]=N(()=>{let o=i()||"";ot&&t instanceof SVGElement?t.setAttribute("class",o):t.className=o}):n==="style"&&typeof i()=="object"?t._propEffects[n]=N(()=>{rt(t,i())}):t._propEffects[n]=N(()=>{k(t,n,i())})}else k(t,n,i)}}function k(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"&&!R(e)){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=N(()=>k(t,e,n()));return}if(R(e))return;if(gt(e,n)){typeof console<"u"&&console.warn(`[what] Blocked unsafe URL in "${e}" attribute:`,n);return}let i=ot&&t instanceof SVGElement;if(e==="class"||e==="className")i?t.setAttribute("class",n||""):t.className=n||"";else if(e==="dangerouslySetInnerHTML"){let o=n?.__html??"";typeof G<"u"&&G&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=o}else if(e==="innerHTML")if(n&&typeof n=="object"&&"__html"in n){let o=n.__html??"";typeof G<"u"&&G&&typeof o=="string"&&/(<script|onerror\s*=|onload\s*=|javascript:)/i.test(o)&&console.warn("[what] dangerouslySetInnerHTML contains potential XSS vectors. Ensure content is sanitized."),t.innerHTML=o}else typeof console<"u"&&n!=null&&n!==""&&console.warn('[what] Plain string innerHTML is not allowed. Use { __html: "..." } or dangerouslySetInnerHTML={{ __html: "..." }} instead.');else if(e==="style")rt(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):i?t.setAttribute(e,n):e==="value"&&t.tagName==="SELECT"?ct(t,n):e in t?t[e]=n:t.setAttribute(e,n)}function v(t,e,n,i){if(t._propEffects||(t._propEffects={}),t._propEffects[e])try{t._propEffects[e]()}catch{}t._propEffects[e]=N(()=>i(t,n()))}function Gt(t,e){if(typeof e=="function")return v(t,"class",e,Gt);ot&&t instanceof SVGElement?t.setAttribute("class",e||""):t.className=e||""}function rt(t,e){if(typeof e=="function")return v(t,"style",e,rt);if(typeof e=="string")t.style.cssText=e,t._lastStyleObj=null;else if(e&&typeof e=="object"){let n=t.style,i=t._lastStyleObj;if(i)for(let o in i)o in e||(n[o]="");for(let o in e)n[o]=e[o]??"";t._lastStyleObj=e}else e==null&&(t.style.cssText="",t._lastStyleObj=null)}function Rt(t,e,n){if(typeof n=="function")return v(t,e,n,(i,o)=>Rt(i,e,o));n==null?t.removeAttribute(e):t.setAttribute(e,n)}function Ut(t,e){if(typeof e=="function")return v(t,"value",e,Ut);if(t.tagName==="SELECT"){ct(t,e);return}let n=e==null?"":String(e);t.value!==n&&(t.value=n)}function qt(t,e){if(typeof e=="function")return v(t,"checked",e,qt);t.checked=!!e}var At=new Set;function ne(t){for(let e of t)At.has(e)||(At.add(e),document.addEventListener(e,n=>{let i=n.target,o="$$"+e;for(Object.defineProperty(n,"currentTarget",{configurable:!0,get(){return i||document}});i;){let r=i[o];if(r&&(r(n),n.cancelBubble))return;i=i.parentNode}}))}function ie(t,e,n){return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}function oe(t,e){N(()=>{for(let n in e){let i=typeof e[n]=="function"?e[n]():e[n];t.classList.toggle(n,!!i)}})}var it=!1,P=null;function re(){return it}function fe(t,e){it=!0,P={parent:e,index:0};try{return W(t,e)}finally{it=!1,P=null}}function Tt(t){let e=t.childNodes;for(;P.index<e.length;){let n=e[P.index];if(n.nodeType===8){let i=n.textContent;if(i==="$"||i==="/$"||i==="[]"||i==="/[]"){P.index++;continue}}return P.index++,n}return null}function ut(){return typeof process<"u"&&!1}function W(t,e){if(t==null||typeof t=="boolean")return null;if(typeof t=="string"||typeof t=="number"){let i=Tt(e),o=String(t);if(i&&i.nodeType===3)return ut()&&i.textContent!==o&&(console.warn(`[what] Hydration mismatch: expected text "${o}", got "${i.textContent}"`),i.textContent=o),i;ut()&&console.warn(`[what] Hydration mismatch: expected text node "${o}", got ${i?i.nodeName:"nothing"}. Falling back to client render.`);let r=document.createTextNode(o);return i?e.replaceChild(r,i):e.appendChild(r),r}if(typeof t=="function"&&t._lazyChildren)return W(t(),e);if(typeof t=="function"){let i=t(),o=W(i,e),r=N(()=>{let m=t();it||(o=I(e,m,o,null))});return dt(o&&o.nodeType?o:e,r),o}if(Array.isArray(t)){let i=[];for(let o of t){let r=W(o,e);r&&i.push(r)}return i.length===1?i[0]:i}if(typeof t=="object"&&t._vnode){if(typeof t.tag=="function"){let m=bt(),c=t.tag,a=t.props||{},l=t.children||[],y={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:c,_parentCtx:m[m.length-1]||null,_errorBoundary:null};m.push(y);let s,C=null;try{let d={...a};a._$lazyChildren?C=mt(c,d,a._$lazyChildren):d.children=l.length===0?a.children:l.length===1?l[0]:l,s=c(d),C&&C()}catch(d){return m.pop(),_t(d)||console.error("[what] Error in component during hydration:",c.name||"Anonymous",d),null}y.mounted=!0,y._mountCallbacks&&queueMicrotask(()=>{if(!y.disposed)for(let d of y._mountCallbacks)try{d()}catch(b){console.error("[what] onMount error:",b)}});try{let d=W(s,e),b=Array.isArray(d)?d[0]:d;return yt(b&&b.nodeType?b:e,y),d}finally{m.pop()}}let i=Tt(e),o=t.tag.toUpperCase();if(i&&i.nodeType===1&&i.nodeName===o){Wt(i,t.props||{});let m=P;if(P={parent:i,index:0},t.props?.dangerouslySetInnerHTML?.__html==null)for(let a of t.children)W(a,i);return P=m,i}ut()&&console.warn(`[what] Hydration mismatch: expected <${t.tag}>, got ${i?i.nodeName:"nothing"}. Falling back to client render.`);let r=document.createElement(t.tag);for(let m in t.props||{})m==="children"||m==="key"||k(r,m,t.props[m]);for(let m of t.children)I(r,m,null,null);return i?e.replaceChild(r,i):e.appendChild(r),r}if(wt(t))return t;let n=document.createTextNode(String(t));return e.appendChild(n),n}function Wt(t,e){for(let n in e){if(n==="children"||n==="key"||n==="ref"||n==="dangerouslySetInnerHTML"||n==="innerHTML")continue;let i=e[n];if(R(n)){if(typeof i!="function")continue;let o=n.slice(2).toLowerCase();t.addEventListener(o,i);continue}if(n.startsWith("$$")){t[n]=i;continue}if(typeof i=="function"&&!R(n)){n==="class"||n==="className"?N(()=>{t.className=i()||""}):n==="style"&&typeof i()=="object"?N(()=>{rt(t,i())}):N(()=>{k(t,n,i())});continue}}}export{kt as a,vt as b,jt as c,Ft as d,Bt as e,$t as f,te as g,ee as h,k as i,Gt as j,rt as k,Rt as l,Ut as m,qt as n,ne as o,ie as p,oe as q,re as r,fe as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as B}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),d=null;function ze(e){u&&(d=e)}var _=null,C=null,b=null,j=!1,P=0,w=[],q=!1,U=Symbol("needs_upstream"),R=null;function S(e,t){let n=e,r=new Set,o=null,s=0;function c(f){u&&j&&console.warn("[what] Signal.set() called inside a computed function. This may cause infinite loops. Use effect() instead."+(t?` (signal: ${t})`:""));let l=typeof f=="function"?f(n):f;(n===l?n!==0||1/n===1/l:n!==n&&l!==l)||(n=l,o=null,u&&d&&d.onSignalUpdate(i),r.size>0&&re(r))}function i(f){if(arguments.length===0){let l=_;return l!==null&&(l!==o||l._epoch!==s)&&(o=l,s=l._epoch,r.add(l),l.deps.push(r)),n}c(f)}return i.set=c,i.peek=()=>n,i.subscribe=f=>L(()=>f(i())),i._signal=!0,u&&(i._subs=r,t&&(i._debugName=t)),u&&d&&d.onSignalCreate(i),i}function Ve(e){let t,n=!0,r=new Set,o=null,s=0,c=G(()=>{let f=j;u&&(j=!0);try{t=e(),n=!1}finally{u&&(j=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=_;return f!==null&&(f!==o||f._epoch!==s)&&(o=f,s=f._epoch,r.add(f),f.deps.push(r)),n&&Y(c),t}return c._onNotify=()=>{n=!0,o=null,r.size>0&&re(r)},i._signal=!0,i.peek=()=>(n&&Y(c),t),i}function Y(e){if(R!==null)throw R.push(e),U;let t=[e];R=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;K(n),n.deps.length!==s&&W(n),t.pop()}catch(s){if(s===U)n._markDirty();else throw s}}}finally{R=null}}function W(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 be=()=>{};function L(e,t){let n=G(e);n._level=1;let r=_;_=n;try{let s=n.fn();typeof s=="function"&&(n._cleanup=s)}finally{_=r}if(W(n),t?.stable&&(n._stable=!0),n.deps.length===0&&n._cleanup===null)return n.disposed=!0,u&&d&&d.onEffectDispose(n),be;let o=()=>te(n);return C&&C.disposals.push(o),o}function Fe(e){P++;try{e()}finally{P--,P===0&&J()}}function G(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&&d&&d.onEffectCreate(n),n}function K(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=_;_=null;try{let o=e.fn();typeof o=="function"&&(e._cleanup=o)}catch(o){d?.onError&&d.onError(o,{type:"effect",effect:e}),u&&console.warn("[what] Error in stable effect:",o)}finally{_=r}u&&d?.onEffectRun&&d.onEffectRun(e);return}let t=e.deps.length===1?e.deps[0]:null;if(ne(e),e._cleanup){try{e._cleanup()}catch(r){u&&d?.onError&&d.onError(r,{type:"effect-cleanup",effect:e}),u&&console.warn("[what] Error in effect cleanup:",r)}e._cleanup=null}let n=_;_=e;try{let r=e.fn();typeof r=="function"&&(e._cleanup=r)}catch(r){throw r===U||u&&d?.onError&&d.onError(r,{type:"effect",effect:e}),r}finally{_=n}t!==null&&e.deps.length===1&&e.deps[0]===t&&!e._cleanup&&!e._pending&&(e._stable=!0),u&&d?.onEffectRun&&d.onEffectRun(e)}function te(e){if(e.disposed=!0,u&&d&&d.onEffectDispose(e),ne(e),e._cleanup){try{e._cleanup()}catch(t){u&&console.warn("[what] Error in effect cleanup on dispose:",t)}e._cleanup=null}}function ne(e){let t=e.deps;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0,e._epoch++}var F=0,D=null,T=0;function ee(e){if(!e.disposed){if(e._onNotify)e._onNotify();else if(!e._pending)if(P===0&&e._stable){let t=_;_=null;try{let n=e.fn();if(typeof n=="function"){if(e._cleanup)try{e._cleanup()}catch{}e._cleanup=n}}catch(n){u&&d?.onError&&d.onError(n,{type:"effect",effect:e}),u&&console.warn("[what] Error in stable effect:",n)}finally{_=t}}else{e._pending=!0;let t=e._level,n=w.length;n>0&&w[n-1]._level>t&&(q=!0),w.push(e)}}}function re(e){if(F===0){F=1;try{for(let t of e)ee(t);if(T>0){let t=0;for(;t<T;){let n=D[t];D[t]=null,t++;for(let r of n)ee(r)}T=0}}finally{F=0}P===0&&w.length>0&&Ee()}else D===null&&(D=[]),T>=D.length?D.push(e):D[T]=e,T++}var I=!1;function Ee(){I||(I=!0,queueMicrotask(()=>{I=!1,J()}))}var H=!1;function J(){if(!H){H=!0;try{let e=0;for(;w.length>0&&e<25;){let t=w;w=[],t.length>1&&q&&t.sort((n,r)=>n._level-r._level),q=!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{K(r)}catch(s){if(s===U)throw s;u&&d?.onError&&d.onError(s,{type:"effect",effect:r});try{console.error("[what] Uncaught error in effect during update:",s)}catch{}continue}!r._computed&&r.deps.length!==o&&W(r)}}e++}if(e>=25){if(u){let n=w.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<w.length;t++)w[t]._pending=!1;w.length=0}}finally{H=!1}}}function $e(e){let t,n=new Set,r=G(()=>{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=w.length;f>0&&w[f-1]._level>i&&(q=!0),w.push(c)}}}});r._level=1,K(r),W(r),n._owner=r,C&&C.disposals.push(()=>te(r));function o(){return _&&(n.add(_),_.deps.push(n)),t}return o._signal=!0,o.peek=()=>t,o}function Ge(){if(H){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(_){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}I=!1,J()}function X(e){let t=_;_=null;try{return e()}finally{_=t}}function Ke(){return b}function Je(e,t){let n=b,r=C;b=e,C=e;try{return t()}finally{b=n,C=r}}function Xe(e){let t=C,n=b,r={disposals:[],owner:b,children:[],_disposed:!1};b&&b.children.push(r),C=r,b=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let s=r.children.length-1;s>=0;s--)Q(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{C=t,b=n}}function Q(e){if(!e._disposed){e._disposed=!0;for(let t=e.children.length-1;t>=0;t--)Q(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 Qe(e){let t=C,n=b,r={disposals:[],owner:null,children:[],_disposed:!1};C=r,b=r;try{return e(()=>{if(!r._disposed){r._disposed=!0;for(let s=r.children.length-1;s>=0;s--)Q(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{C=t,b=n}}function Ze(e){C&&C.disposals.push(e)}if(u&&typeof WeakRef<"u"){let t={signals:new Set,effects:new Set,components:[]};d={__isPreinstallBuffer:!0,onSignalCreate(n){t.signals.size<2e3&&t.signals.add(new WeakRef(n))},onSignalUpdate(){},onEffectCreate(n){t.effects.size<2e3&&t.effects.add(new WeakRef(n))},onEffectDispose(){},onEffectRun(){},onError(){},onComponentMount(n){t.components.length<2e3&&t.components.push(n)},onComponentUnmount(){},__buffer:t}}function Ye(){if(!u)return{signals:[],effects:[],components:[]};let e={signals:[],effects:[],components:[]},t=typeof $<"u"?$: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 $=null;u&&d?.__isPreinstallBuffer&&($=d.__buffer);function it(e,t){let n=function(o){return e(o)};return n.displayName=`Memo(${e.name||"Anonymous"})`,n}var oe=null;function se(e){oe=e}function ct(e){let t=null,n=null,r=null,o=new Set;function s(c){if(r)throw r;if(t)return B(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 Se({fallback:e,children:t}){let n=S(!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}}Se._deferChildren=!0;function xe({fallback:e,children:t,onError:n}){let r=S(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}}xe._deferChildren=!0;function ie(e,t){let n=t||oe?.();for(;n;){if(n._errorBoundary)return n._errorBoundary(e),!0;n=n._parentCtx}return!1}function ft({when:e,fallback:t=null,children:n}){return()=>(typeof e=="function"?e():e)?n:t}function lt({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 at({fallback:e=null,children:t}){let n=Array.isArray(t)?t:[t];return()=>{for(let r of n)if(r&&r.tag===ke){let o=r.props.when;if(typeof o=="function"?o():o)return r.children}return e}}function ke(e){return()=>(typeof e.when=="function"?e.when():e.when)?e.children:null}function ut({component:e,mode:t,mediaQuery:n,...r}){let o=B("div",{"data-island":e.name||"Island","data-hydrate":t}),s=S(null),c=S(!1);function i(){c()||(c.set(!0),s.set(B(e,r)))}function f(p){switch(t){case"load":queueMicrotask(i);break;case"idle":typeof requestIdleCallback<"u"?requestIdleCallback(i):setTimeout(i,200);break;case"visible":{let a=new IntersectionObserver(m=>{m[0].isIntersecting&&(a.disconnect(),i())});a.observe(p);break}case"interaction":{let a=()=>{p.removeEventListener("click",a),p.removeEventListener("focus",a),p.removeEventListener("mouseenter",a),i()};p.addEventListener("click",a,{once:!0}),p.addEventListener("focus",a,{once:!0}),p.addEventListener("mouseenter",a,{once:!0});break}case"media":{if(!n){i();break}let a=window.matchMedia(n);if(a.matches)queueMicrotask(i);else{let m=()=>{a.matches&&(a.removeEventListener("change",m),i())};a.addEventListener("change",m)}break}default:queueMicrotask(i)}}let l=p=>{p&&f(p)};return B("div",{"data-island":e.name||"Island","data-hydrate":t,ref:l},c()?s():null)}var ce=!1;function ht(e,t,n){return ce||(ce=!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 _t(...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 mt(e){return typeof e=="string"?e:Object.entries(e).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>`${ve(t)}:${n}`).join(";")}function ve(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function yt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function gt(e,t){let n=0;return(...r)=>{let o=Date.now();o-n>=t&&(n=o,e(...r))}}var z=null;function fe(e){z=e}function Ct(e){if(typeof window>"u")return S(!1);let t=window.matchMedia(e),n=S(t.matches),r=s=>n.set(s.matches);t.addEventListener("change",r);let o=z?.();return o&&(o._cleanupCallbacks=o._cleanupCallbacks||[],o._cleanupCallbacks.push(()=>t.removeEventListener("change",r))),n}function wt(e,t){let n;try{let i=localStorage.getItem(e);n=i!==null?JSON.parse(i):t}catch{n=t}let r=S(n),o=L(()=>{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=z?.();return c&&(c._cleanupCallbacks=c._cleanupCallbacks||[],c._cleanupCallbacks.push(()=>{o(),s&&window.removeEventListener("storage",s)})),r}function bt({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 Et(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=z?.();r&&(r._cleanupCallbacks=r._cleanupCallbacks||[],r._cleanupCallbacks.push(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}))}function St(e,t){return{class:t?`${e}-enter ${e}-enter-active`:`${e}-leave ${e}-leave-active`}}var Le=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"]),Ne="http://www.w3.org/2000/svg",le=new Set(["href","src","action","formaction","formAction","data","ping","xlink:href","xlinkHref"]),ae=new Set(["srcdoc","srcDoc"]);function Ae(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 ue(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 De(e,t){let n=e.toLowerCase();return ae.has(e)||ae.has(n)?!0:!le.has(e)&&!le.has(n)?!1:!Ae(t)}var de=new Set,V=new WeakMap;function Te(e){return!e||typeof e!="object"?!1:typeof Node<"u"&&e instanceof Node?!0:typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function pe(e){return!!e&&typeof e=="object"&&(e._vnode===!0||"tag"in e)}function Z(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&&d?.onComponentUnmount&&d.onComponentUnmount(e),de.delete(e)}}function Me(e,t){!e||typeof t!="function"||(e._hydrationDisposers?e._hydrationDisposers.push(t):e._hydrationDisposers=[t])}function Dt(e,t){Me(e,()=>Z(t))}function N(e){if(!e)return;if(e._componentCtx&&Z(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=V.get(e);n&&Z(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++)N(t[n])}function Tt(e,t){typeof t=="string"&&(t=document.querySelector(t)),N(t),t.textContent="";let n=x(e,t);return n&&t.appendChild(n),()=>{N(t),t.textContent=""}}function x(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(Te(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 x(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=L(()=>{let f=e(),l=f==null||f===!1||f===!0?[]:Array.isArray(f)?f:[f],p=o.parentNode;if(p){for(let a of s)N(a),a.parentNode===p&&p.removeChild(a);s=[];for(let a of l){let m=x(a,p,t?._isSvg);if(m)if(m.nodeType===11){let y=Array.from(m.childNodes);p.insertBefore(m,o);for(let E of y)s.push(E)}else p.insertBefore(m,o),s.push(m)}}});return r._dispose=i,o._dispose=i,c}if(Array.isArray(e)){let r=document.createDocumentFragment();for(let o of e){let s=x(o,t,n);s&&r.appendChild(s)}return r}return pe(e)&&typeof e.tag=="function"?je(e,t,n):pe(e)&&typeof e.tag=="string"?e.tag==="__errorBoundary"?_e(e,t):e.tag==="__suspense"?me(e,t):e.tag==="__portal"?ye(e,t):He(e,t,n):document.createTextNode(String(e))}var Be={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}},g=[];function he(){return g[g.length-1]}se(he);fe(he);function Mt(){return g}function Pe(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 Oe=Symbol.for("what.navigation.signal");function Re(e){if(e==null)return!1;let t=e[Oe];return typeof t!="function"?!1:(t(e),!0)}function je(e,t,n){let{tag:r,props:o,children:s}=e;if(typeof r=="function"&&(r.prototype?.isReactComponent||r.prototype?.render)){let h=r;r=function(we){return new h(we).render()},r.displayName=h.displayName||h.name||"ClassComponent"}if(r==="__errorBoundary"||e.tag==="__errorBoundary")return _e(e,t);if(r==="__suspense"||e.tag==="__suspense")return me(e,t);if(r==="__portal"||e.tag==="__portal")return ye(e,t);let c=g[g.length-1]||null,i=null;if(c&&(i=c._errorBoundary||null,!i)){let h=c._parentCtx;for(;h;){if(h._errorBoundary){i=h._errorBoundary;break}h=h._parentCtx}}let f={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,Component:r,_parentCtx:c,_errorBoundary:i},l=document.createComment("c:start"),p=document.createComment("c:end");V.set(l,f),f._startComment=l,f._endComment=p;let a=document.createDocumentFragment();a._componentCtx=f,f._wrapper=l,de.add(f),u&&d?.onComponentMount&&d.onComponentMount(f);let m=s.length===0?void 0:s.length===1?s[0]:s,y;m!==void 0?y=o?Object.assign({},o,{children:m}):{children:m}:y=o?Object.assign({},o):{};let E=o&&o._$lazyChildren,k=E?Pe(r,y,E):null,v=S(y);f._propsSignal=v;let A=new Proxy({_sig:v},Be);g.push(f);let O;try{O=X(()=>r(A))}catch(h){if(g.pop(),!Re(h)&&!(h&&typeof h.then=="function"&&Ie(h,f))&&!ie(h,f))throw console.error("[what] Uncaught error in component:",r.name||"Anonymous",h),h;return a.appendChild(l),a.appendChild(p),a}k&&k(),f.mounted=!0,f._mountCallbacks&&queueMicrotask(()=>{if(!f.disposed)for(let h of f._mountCallbacks)try{h()}catch(M){console.error("[what] onMount error:",M)}}),a.appendChild(l);let Ce=Array.isArray(O)?O:[O];try{for(let h of Ce){let M=x(h,a,n);M&&a.appendChild(M)}}finally{g.pop()}return a.appendChild(p),a}function Ie(e,t){let n=t;for(;n;){if(n._suspenseBoundary)return n._suspenseBoundary.onSuspend(e),!0;n=n._parentCtx}return!1}function _e(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"),l={hooks:[],hookIndex:0,effects:[],cleanups:[],mounted:!1,disposed:!1,_parentCtx:g[g.length-1]||null,_errorBoundary:r,_startComment:i,_endComment:f};V.set(i,l);let p=document.createDocumentFragment();p._componentCtx=l,p.appendChild(i),p.appendChild(f);let a=L(()=>{let m=n();if(g.push(l),i.parentNode)for(;i.nextSibling&&i.nextSibling!==f;){let E=i.nextSibling;N(E),E.parentNode.removeChild(E)}let y;m?y=typeof o=="function"?[o({error:m,reset:s})]:[o]:y=c,y=Array.isArray(y)?y:[y];for(let E of y){let k=x(E,t);k&&(f.parentNode?f.parentNode.insertBefore(k,f):p.insertBefore(k,f))}g.pop()});return l.effects.push(a),p}function me(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:g[g.length-1]||null,_suspenseBoundary:n,_startComment:c,_endComment:i};V.set(c,f);let l=document.createDocumentFragment();l._componentCtx=f,l.appendChild(c),l.appendChild(i);let p=0,a=L(()=>{let y=o()?[r]:s,E=Array.isArray(y)?y:[y],k=++p;if(g.push(f),c.parentNode)for(;c.nextSibling&&c.nextSibling!==i;){let v=c.nextSibling;N(v),v.parentNode.removeChild(v)}try{for(let v of E){let A=x(v,t);if(k!==p){A&&N(A);break}A&&(i.parentNode?i.parentNode.insertBefore(A,i):l.insertBefore(A,i))}}finally{g.pop()}});return f.effects.push(a),l}function ye(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:g[g.length-1]||null},s=document.createComment("portal");s._componentCtx=o;let c=[];for(let i of r){let f=x(i,n);f&&(n.appendChild(f),c.push(f))}return o._cleanupCallbacks=[()=>{for(let i of c)N(i),i.parentNode&&i.parentNode.removeChild(i)}],s}function He(e,t,n){let{tag:r,props:o,children:s}=e,c=n||Le.has(r),i=c?document.createElementNS(Ne,r):document.createElement(r);o&&qe(i,o,{},c);let f=c&&r!=="foreignObject";for(let l=0;l<s.length;l++){let p=x(s[l],i,f);p&&i.appendChild(p)}return i._vnode=e,i}function qe(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}ge(e,o,t[o],r)}}}function Ue(e,t){e.value=t,e.value!==String(t)&&queueMicrotask(()=>{e.value=t})}function ge(e,t,n,r){if(typeof n=="function"&&!ue(t)&&t!=="ref"){if(e._propEffects||(e._propEffects={}),e._propEffects[t])try{e._propEffects[t]()}catch{}e._propEffects[t]=L(()=>{let o=n();ge(e,t,o,r)});return}if(ue(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 l=a=>(a.nativeEvent||(a.nativeEvent=a),X(()=>l._handler(a)));l._handler=n,l._original=n,e._events[i]=l;let p=n._eventOpts;e.addEventListener(c,l,p||s||void 0);return}if(De(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(typeof n=="boolean"){n?e.setAttribute(t,""):e.removeAttribute(t);return}if(t.startsWith("data-")||t.startsWith("aria-")){e.setAttribute(t,n);return}if(r){n===!1||n==null?e.removeAttribute(t):e.setAttribute(t,n===!0?"":String(n));return}if(t==="value"&&e.tagName==="SELECT"){Ue(e,n);return}t in e?e[t]=n:e.setAttribute(t,n)}export{u as a,ze as b,S as c,Ve as d,L as e,Fe as f,$e as g,Ge as h,X as i,Ke as j,Je as k,Xe as l,Qe as m,Ze as n,Ye as o,it as p,ct as q,Se as r,xe as s,ft as t,lt as u,at as v,ke as w,ut as x,ht as y,_t as z,mt as A,yt as B,gt as C,Ct as D,wt as E,bt as F,Et as G,St as H,ue as I,De as J,Me as K,Dt as L,N as M,Tt as N,x as O,he as P,Mt as Q,Pe as R,Re as S,Ue as T};
|