MCPcopy Index your code
hub / github.com/tinyplex/tinybase / cs

Function cs

docs/js/app.js:1–1  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1"use strict";(()=>{var Be="v9.0.0";var hc="TinyBase",Ks=document,Je=()=>{addEventListener("load",()=>{let t=js("#version");t.innerText=Be,t.style.width=t.scrollWidth+"px"})},uc=null,ke=()=>uc??=js("body > main > nav"),Tc=null,Ue=()=>Tc??=js("body > main > article"),ct=t=>t.preventDefault(),js=t=>Ks.querySelector(t),qs=(t,n)=>t.querySelector(n),Lc=t=>Ks.getElementById(t),os=(t,n,c={},r)=>{let f=Ks.createElement(t);return Object.entries(c).forEach(u=>f.setAttribute(...u)),r!=null&&(f.innerText=r),n!=null?n.appendChild(f):f},ot=(t,n)=>t.classList.add(n);var Ht=(t,n)=>t.classList.remove(n),We=(t,n,c)=>t.classList.toggle(n)?c():0,xt=(t,n=!0)=>{let c=ke();["?","#"].forEach(r=>{t.includes(r)&&(t=t.substring(0,t.indexOf(r)))}),fetch(`${t}nav.json`).then(r=>r.json()).then(r=>{Ht(qs(c,"li.current"),"current"),qe(r,qs(c,"ul"))}),fetch(`${t}article.html`).then(r=>r.text()).then(r=>{let f=Ue();f.innerHTML=r,f.scrollTo(0,0),Hn()}),n&&history.pushState(null,"",t)},Et=(t,n,c)=>os("input",t,{type:"hidden",name:"project"+n,value:c}),Hn=()=>{let t=qs(Ue(),":scope iframe"),n=t?.parentElement;if(t==null||n==null)return;let c=n.insertBefore(os("form",null,{action:"https://stackblitz.com/run",method:"post",target:"_blank"}),t);n.insertBefore(os("a",null,{id:"sbEdit"},"Open this demo in StackBlitz"),t).onclick=()=>{c.childNodes.length==0?fetch("stackblitz.json").then(r=>r.json()).then(r=>{Et(c,"[title]",r.title),Et(c,"[description]",r.description),Et(c,"[template]",r.template),Object.entries(r.files).forEach(([u,E])=>Et(c,`[files][${u}]`,E)),r.settings!=null&&Et(c,"[settings]",JSON.stringify(r.settings)),r.dependencies!=null&&Et(c,"[dependencies]",JSON.stringify(r.dependencies));let f=new URL(c.action);Object.entries(r.options??{}).forEach(([u,E])=>f.searchParams.set(u,E)),c.action=f.toString(),c.submit()}):c.submit()}},qe=({i:t,n,u:c,r,c:f,p:u,o:E,_:A},Z)=>{let M=ke(),p=Lc(t);if(p==null){p=os("li",Z,{id:t}),os("span",p);let h=os("a",p,{href:c});r?os("code",h,{},n):h.innerText=n,u&&ot(p,"parent")}if(E&&ot(p,"open"),A!=null){let h=qs(p,"ul")??os("ul",p);A.forEach(L=>{qe(L,h)})}if(f){ot(p,"current"),Ks.title=`${n} | ${hc}`;let h=p.getBoundingClientRect(),L=M.getBoundingClientRect();h.top<L.top?M.scrollBy(0,h.top-L.top):h.bottom>L.bottom&&M.scrollBy(0,Math.min(h.bottom-L.bottom,h.top-L.top))}};var Os="dark",xn="light",_n="auto",Ke=()=>{let t=matchMedia("(prefers-color-scheme: dark)"),n=()=>{let c=localStorage.getItem(Os)??_n;js("#dark")?.setAttribute("class",c),js("html").className=c==Os||c==_n&&t.matches?Os:xn};t.addEventListener("change",n),window.addEventListener("storage",c=>{c.storageArea==localStorage&&c.key==Os&&n()}),addEventListener("load",()=>{js("#dark").addEventListener("click",()=>{let c=localStorage.getItem(Os);localStorage.setItem(Os,c==Os?xn:c==xn?_n:Os),n()}),n()}),n()};var Ie=t=>typeof t;var dc=Ie(""),Oe=t=>""+t,Ec=t=>(n,c,r)=>t(n)?r?.():c(n),bs=t=>t===void 0,so=t=>t===null,it=Ec(bs),Sc=t=>Ie(t)==dc,Dt=t=>Array.isArray(t),Zs=t=>t.length,pc=(t,n)=>t.test(n),to=(t,n)=>t.every(n),Cc=(t,n)=>Zs(t)===Zs(n)&&to(t,(c,r)=>n[r]===c),$e=(t,n)=>to(t,(c,r)=>r==0||n(t[r-1],c)<=0),Ze=(t,n)=>t.sort(n),rt=(t,n)=>t.forEach(n),mc=(t,n)=>t.map(n),Rc=(t,n,c)=>t.reduce(n,c),no=(t,...n)=>t.push(...n),yc=t=>t.shift(),eo=t=>n=>Rc(Fn(n),(c,r)=>c+t(r),0),oo=t=>t?.size??0,co=eo(oo),Nc=eo(co),St=(t,n)=>t?.has(n)??!1,sn=t=>bs(t)||oo(t)==0,Fn=t=>[...t?.values()??[]],Xe=t=>t.clear(),Ls=(t,n)=>t?.forEach(n),pt=(t,n)=>t?.delete(n),Vc=Object,Mc=Vc.freeze,Hc=Map,cs=t=>new Hc(t),io=t=>[...t?.keys()??[]],k=(t,n)=>t?.get(n),_t=(t,n)=>Ls(t,(c,r)=>n(r,c)),J=(t,n,c)=>bs(c)?(pt(t,n),t):t?.set(n,c),ro=(t,n,c,r)=>(St(t,n)?r?.(k(t,n)):J(t,n,c()),k(t,n)),Dn=(t,n,c,r,f=0)=>it((c?ro:k)(t,n[f],f>Zs(n)-2?c:cs),u=>{if(f>Zs(n)-2)return r?.(u)&&J(t,n[f]),u;let E=Dn(u,n,c,r,f+1);return sn(u)&&J(t,n[f]),E}),$s=t=>new Set(Dt(t)||bs(t)?t:[t]),Ys=(t,n)=>t?.add(n),xc=(t,n,c,r,f)=>{let u=t.hasRow,E=cs(),A=cs(),Z=cs(),M=cs(),p=cs(),h=cs(),L=()=>t,N=()=>io(E),D=C=>_t(A,C),H=C=>St(A,C),x=C=>k(E,C),K=C=>k(A,C),ds=(C,S)=>J(A,C,S),fs=(C,...S)=>{let G=ro(h,C,$s);rt(S,rs=>Ys(G,rs))},Es=C=>it(k(h,C),S=>{rt(Fn(S),G=>{t.delListener(G),pt(S,G)}),J(h,C)}),Ns=(C,S)=>{J(E,C,S),St(A,C)||(J(A,C,n()),J(M,C,cs()),J(p,C,cs()),f(Z))},Fs=(C,S,G,rs,V)=>{Ns(C,S);let z=cs(),Q=cs(),I=k(M,C),gs=k(p,C),Ss=w=>{let O=ps=>t.getCell(S,w,ps),ss=k(I,w),Rs=u(S,w)?c(rs(O,w)):void 0;if(ss===Rs||Dt(ss)&&Dt(Rs)&&Cc(ss,Rs)||J(z,w,[ss,Rs]),!bs(V)){let ps=k(gs,w),Vs=u(S,w)?V(O,w):void 0;ps!=Vs&&J(Q,w,Vs)}},hs=w=>{G(()=>{Ls(z,([,O],ss)=>J(I,ss,O)),Ls(Q,(O,ss)=>J(gs,ss,O))},z,Q,I,gs,w),Xe(z),Xe(Q)};_t(I,Ss),t.hasTable(S)&&rt(t.getRowIds(S),w=>{St(I,w)||Ss(w)}),hs(!0),Es(C),fs(C,t.addRowListener(S,null,(w,O,ss)=>Ss(ss)),t.addTableListener(S,()=>hs()))},Js=C=>{J(E,C),J(A,C),J(M,C),J(p,C),Es(C),f(Z)};return[L,N,D,H,x,K,ds,Ns,Fs,Js,C=>r(C,Z),()=>_t(h,Js)]},Qe=(t,n)=>Sc(t)?c=>c(t):t??(()=>n??""),_c=(t,n)=>{let c=new WeakMap;return r=>(c.has(r)||c.set(r,t(r)),c.get(r))},Dc=(t,n)=>(t??0)<(n??0)?-1:1,Fc=/^\d+$/,Pc=()=>{let t=[],n=0;return[c=>(c?yc(t):null)??""+n++,c=>{pc(Fc,c)&&Zs(t)<1e3&&no(t,c)}]},vc=(t,n=[""])=>{let c=[],r=(f,u)=>u==Zs(n)?no(c,f):so(n[u])?Ls(f,E=>r(E,u+1)):rt([n[u],null],E=>r(k(f,E),u+1));return r(t,0),c},wc=t=>{let n,[c,r]=Pc(),f=cs();return[(M,p,h,L=[],N=()=>[])=>{n??=t();let D=c(1);return J(f,D,[M,p,h,L,N]),Ys(Dn(p,h??[""],$s),D),D},(M,p,...h)=>rt(vc(M,p),L=>Ls(L,N=>k(f,N)[0](n,...p??[],...h))),M=>it(k(f,M),([,p,h])=>(Dn(p,h??[""],void 0,L=>(pt(L,M),sn(L)?1:0)),J(f,M),r(M),h)),M=>it(k(f,M),([p,,h=[],L,N])=>{let D=(...H)=>{let x=Zs(H);x==Zs(h)?p(n,...H,...N(H)):so(h[x])?rt(L[x]?.(...H)??[],K=>D(...H,K)):D(...H,h[x])};D()})]},ao=_c(t=>{let n=cs(),c=cs(),[r,f,u]=wc(()=>rs),[E,A,Z,M,p,h,L,,N,D,H,x]=xc(t,cs,V=>bs(V)?"":Dt(V)?mc(V,Oe):Oe(V),r,f),K=(V,z)=>St(h(V),z),ds=(V,z,Q,I,gs,Ss=Dc)=>{let hs=bs(gs)?void 0:([w],[O])=>gs(w,O);return N(V,z,(w,O,ss,Rs,ps,Vs)=>{let Ms=0,Ps=$s(),vs=$s(),as=h(V);if(Ls(O,([W,us],Cs)=>{let Hs=$s(W),ks=$s(us);Ls(Hs,X=>pt(ks,X)?pt(Hs,X):0),Ls(Hs,X=>{Ys(Ps,X),it(k(as,X),ws=>{pt(ws,Cs),sn(ws)&&(J(as,X),Ms=1)})}),Ls(ks,X=>{Ys(Ps,X),St(as,X)||(J(as,X,$s()),Ms=1),Ys(k(as,X),Cs),bs(I)||Ys(vs,X)})}),w(),sn(ps)||(Vs?_t(as,W=>Ys(vs,W)):_t(ss,W=>it(k(Rs,W),us=>rt(Dt(us)?us:[us],Cs=>Ys(vs,Cs)))),Ls(vs,W=>{let us=(Hs,ks)=>Ss(k(ps,Hs),k(ps,ks),W),Cs=[...k(as,W)];$e(Cs,us)||(J(as,W,$s(Ze(Cs,us))),Ys(Ps,W))})),(Ms||Vs)&&!bs(hs)){let W=[...as];$e(W,hs)||(L(V,cs(Ze(W,hs))),Ms=1)}Ms&&f(n,[V]),Ls(Ps,W=>f(c,[V,W]))},Qe(Q),it(I,Qe)),rs},fs=V=>Z((z,Q)=>V(z,I=>Ns(z,I,Q))),Es=(V,z)=>Ns(V,z,h(V)),Ns=(V,z,Q)=>{let I=p(V);Ls(Q,(gs,Ss)=>z(Ss,hs=>Ls(gs,w=>hs(w,O=>t.forEachCell(I,w,O)))))},rs={setIndexDefinition:ds,delIndexDefinition:V=>(D(V),rs),getStore:E,getIndexIds:A,forEachIndex:fs,forEachSlice:Es,hasIndex:M,hasSlice:K,getTableId:p,getSliceIds:V=>io(h(V)),getSliceRowIds:(V,z)=>Fn(k(h(V),z)),addIndexIdsListener:H,addSliceIdsListener:(V,z)=>r(z,n,[V]),addSliceRowIdsListener:(V,z,Q)=>r(Q,c,[V,z]),delListener:V=>(u(V),rs),destroy:x,getListenerStats:()=>({sliceIds:co(n),sliceRowIds:Nc(c)})};return Mc(rs)});var st=t=>typeof t;var Lo=st(""),Ac=st(!0),Eo=st(0),zc=st(st),So="object",po="array",Ct="type",xs="default",tn="allowNull",Gc="null",jc="Listener",Yc="add",at="Has",un="Ids",Rt="Table",lo=Rt+"s",bc=Rt+un,an="Row",Bc=an+"Count",Jc=an+un,cn="Cell",fo=cn+un,ln="Value",go=ln+"s",kc=ln+un,Co="\uFFFD",v=t=>""+t,mo=t=>(n,c,r)=>t(n)?r?.():c(n),Uc=globalThis,Wc=isFinite,qc=(t,n)=>t instanceof n,fn=t=>t==null,es=t=>t===void 0,ht=t=>t===null,Kc=mo(fn),F=mo(es),Ro=t=>t==Lo||t==Ac,Oc=t=>st(t)==Lo,Pn=t=>st(t)==zc,Tn=t=>Array.isArray(t),Gn=(t,n,c)=>t.slice(n,c),Ds=t=>t.length,$c=(t,n)=>t.test(n),lt=Uc.structuredClone,vn=async(t,n,c)=>{try{return await t()}catch(r){n?.(r)}},Zc=(t,n)=>t.includes(n),yo=(t,n)=>t.every(n),Xc=(t,n)=>Ds(t)===Ds(n)&&yo(t,(c,r)=>n[r]===c),Qc=(t,n)=>t.sort(n),jt=(t,n)=>t.forEach(n),gn=(t,n)=>t.map(n),Ic=(t,n,c)=>t.reduce(n,c),hn=(t,...n)=>t.push(...n),si=t=>t.shift(),nt=Object,ho=t=>nt.getPrototypeOf(t),ti=nt.isFrozen,kn=nt.entries,tt=t=>!fn(t)&&Kc(ho(t),n=>n==nt.prototype||fn(ho(n)),()=>!0),ni=nt.keys,ei=nt.freeze,oi=(t=[])=>nt.fromEntries(t),zt=(t,n)=>n in t,No=(t,n)=>(delete t[n],t),ci=(t,n)=>jt(kn(t),([c,r])=>n(r,c)),ii=(t,n)=>gn(kn(t),([c,r])=>n(r,c)),Bs=(t,n)=>oi(ii(t,(c,r)=>[r,n(c,r)])),Vo=t=>Ds(ni(t)),_s=t=>tt(t)&&Vo(t)==0,ut=(t,n,c=(r,f)=>r===f)=>{let r=kn(t);return Ds(r)===Vo(n)&&yo(r,([f,u])=>tt(u)?tt(n[f])?ut(n[f],u,c):!1:c(u,n[f]))},Xs=(t,n,c,r=0)=>fn(t)||!tt(t)||!r&&_s(t)||ti(t)?(c?.(),!1):(ci(t,(f,u)=>{n(f,u)||No(t,u)}),r?!0:!_s(t)),Mo=JSON.stringify,rn=JSON.parse,mt=t=>Mo(t,(n,c)=>qc(c,Map)?nt.fromEntries([...c]):c),Ft=t=>{if(ht(t))return Gc;if(Tn(t))return po;if(tt(t))return So;let n=st(t);return Ro(n)||n==Eo&&Wc(t)?n:void 0},wn=t=>t==So||t==po,Pt=t=>tt(t)||Tn(t)?Co+Mo(t):t,jn=t=>Oc(t)&&t[0]==Co,q=(t,n,c)=>!c&&jn(t)?rn(Gn(t,1)):t,Un=t=>n=>Ic(ri(n),(c,r)=>c+t(r),0),Wn=t=>t?.size??0,qn=Un(Wn),Gt=Un(qn),An=Un(Gt),ns=(t,n)=>t?.has(n)??!1,y=t=>es(t)||Wn(t)==0,ri=t=>[...t?.values()??[]],zn=t=>t.clear(),_=(t,n)=>t?.forEach(n),yt=(t,n)=>t?.delete(n),ai=Map,R=t=>new ai(t),vt=t=>[...t?.keys()??[]],T=(t,n)=>t?.get(n),Is=(t,n)=>_(t,(c,r)=>n(r,c)),li=(t,n)=>gn([...t?.entries()??[]],([c,r])=>n(r,c)),P=(t,n,c)=>es(c)?(yt(t,n),t):t?.set(n,c),U=(t,n,c,r)=>(ns(t,n)?r?.(T(t,n)):P(t,n,c()),T(t,n)),Qs=(t,n,c,r=P)=>(Bs(n,(f,u)=>c(t,u,f)),Is(t,f=>zt(n,f)?0:r(t,f)),t),is=(t,n,c,r)=>{let f={};return _(t,(u,E)=>{if(!c?.(u,E)){let A=n?n(u,E):u;r?.(A)||(f[E]=A)}}),f},Yn=(t,n,c)=>is(t,r=>is(r,n,c),y,_s),wt=(t,n,c)=>is(t,r=>Yn(r,n,c),y,_s),ys=(t,n)=>{let c=R();return _(t,(r,f)=>c.set(f,n?.(r)??r)),c},bn=t=>ys(t,ys),uo=t=>ys(t,bn),Bn=(t,n,c,r,f=0)=>F((c?U:T)(t,n[f],f>Ds(n)-2?c:R),u=>{if(f>Ds(n)-2)return r?.(u)&&P(t,n[f]),u;let E=Bn(u,n,c,r,f+1);return y(u)&&P(t,n[f]),E}),fi=(t,n)=>(t??0)<(n??0)?-1:1,gi=/^\d+$/,Jn=()=>{let t=[],n=0;return[c=>(c?si(t):null)??""+n++,c=>{$c(gi,c)&&Ds(t)<1e3&&hn(t,c)}]},ft=t=>new Set(Tn(t)||es(t)?t:[t]),gt=(t,n)=>t?.add(n),hi=(t,n=[""])=>{let c=[],r=(f,u)=>u==Ds(n)?hn(c,f):ht(n[u])?_(f,E=>r(E,u+1)):jt([n[u],null],E=>r(T(f,E),u+1));return r(t,0),c},ui=t=>{let n,[c,r]=Jn(),f=R();return[(M,p,h,L=[],N=()=>[])=>{n??=t();let D=c(1);return P(f,D,[M,p,h,L,N]),gt(Bn(p,h??[""],ft),D),D},(M,p,...h)=>jt(hi(M,p),L=>_(L,N=>T(f,N)[0](n,...p??[],...h))),M=>F(T(f,M),([,p,h])=>(Bn(p,h??[""],void 0,L=>(yt(L,M),y(L)?1:0)),P(f,M),r(M),h)),M=>F(T(f,M),([p,,h=[],L,N])=>{let D=(...H)=>{let x=Ds(H);x==Ds(h)?p(n,...H,...N(H)):ht(h[x])?jt(L[x]?.(...H)??[],K=>D(...H,K)):D(...H,h[x])};D()})]},nn=t=>[t,t],Y=(t,n=qn)=>n(t[0])+n(t[1]),b=()=>[R(),R()],en=t=>[...t],on=([t,n])=>t===n,At=(t,n,c)=>P(t,n,T(t,n)==-c?void 0:c),To=([t,n],[c,r])=>ut(t,c)&&ut(n,r),Kn=()=>{let t,n,c=!1,r=!1,f=0,u=[],E=[],A=0,Z=R(),M=R(),p=R(),h=R(),L=R(),N=R(),D=R(),H=R(),x=R(),K=ft(),ds=R(),fs=R(),Es=R(),Ns=R(),Fs=R(),Js=R(),Nt=ft(),et=R(),C=R(),S=R(),G=R(),rs=b(),V=b(),z=b(),Q=b(),I=b(),gs=b(),Ss=b(),hs=b(),w=b(),O=b(),ss=b(),Rs=b(),ps=b(),Vs=b(),Ms=b(),Ps=b(),vs=b(),as=b(),W=b(),us=b(),Cs=b(),Hs=b(),ks=R(),X=b(),[ws,$,Do,Fo]=ui(()=>ms),ts=s=>{let e=A;A=1;let o=s();return A=e,o},Us=(s,e,o,i=Object.is)=>F(e(),a=>s===a||i(s,a)?o(a):ts(()=>o(a))),Po=s=>Xs(s,e=>Xs(e,Zn)),vo=s=>Xs(s,Zn),Zn=s=>{if(!Xs(s,(i,a)=>Zc([Ct,xs,tn],a)))return!1;let e=s[Ct];if(!Ro(e)&&e!=Eo&&!wn(e))return!1;let o=s[xs];return ht(o)&&!s[tn]?!1:(ht(o)||(Ft(o)!=e?No(s,xs):s[xs]=Pt(o)),!0)},wo=Tn,Ao=s=>Xs(s,Xn,As),Xn=(s,e)=>(!t||ns(Es,e)||As(e))&&Xs(s,(o,i)=>Yt(e,i,o),()=>As(e)),Yt=(s,e,o,i)=>Xs(i?o:se(o,s,e),(a,l)=>F(Ln(s,e,l,a),g=>(o[l]=g,!0),()=>!1),()=>As(s,e)),Ln=(s,e,o,i)=>t?F(T(T(Es,s),o),a=>ht(i)?a[tn]?i:As(s,e,o,i,a[xs]):Ft(i)===a[Ct]?Pt(i):wn(a[Ct])&&jn(i)?i:As(s,e,o,i,a[xs]),()=>As(s,e,o,i)):es(Ft(i))?As(s,e,o,i):Pt(i),Qn=(s,e)=>Xs(e?s:zo(s),(o,i)=>F(In(i,o),a=>(s[i]=a,!0),()=>!1),()=>Tt()),In=(s,e)=>n?F(T(Fs,s),o=>ht(e)?o[tn]?e:Tt(s,e,o[xs]):Ft(e)===o[Ct]?Pt(e):wn(o[Ct])&&jn(e)?e:Tt(s,e,o[xs]),()=>Tt(s,e)):es(Ft(e))?Tt(s,e):Pt(e),se=(s,e,o)=>(F(T(Ns,e),([i,a])=>{_(i,(l,g)=>{zt(s,g)||(s[g]=l,F(o,d=>gt(U(U(D,e,R),d,ft),g)))}),_(a,l=>{zt(s,l)||As(e,o,l)})}),s),zo=s=>(n&&(_(Js,(e,o)=>{zt(s,o)||(s[o]=e,gt(K,o))}),_(Nt,e=>{zt(s,e)||Tt(e)})),s),te=s=>Qs(Es,s,(e,o,i)=>{let a=R(),l=ft();Qs(U(Es,o,R),i,(g,d,m)=>{P(g,d,m),F(m[xs],B=>P(a,d,B),()=>gt(l,d))}),P(Ns,o,[a,l])},(e,o)=>{P(Es,o),P(Ns,o)}),ne=s=>Qs(Fs,s,(e,o,i)=>{P(Fs,o,i),F(i[xs],a=>P(Js,o,a),()=>gt(Nt,o))},(e,o)=>{P(Fs,o),P(Js,o),yt(Nt,o)}),ee=s=>_s(s)?Qt():Zt(s),dn=(s,e,o,i,a,l)=>es(i)?ze(s,e,o,!0,a):_e(s,e,o,i,a,l),oe=s=>_s(s)?It():Xt(s),En=(s,e,o)=>es(e)?Ge(s,o):De(s,e,o),Go=s=>Us(s,()=>F(u[0],e=>ts(()=>e(lt(s))),()=>s),([e,o])=>{(_s(e)?Qt:Zt)(e),(_s(o)?It:Xt)(o)},To),ce=(s,e)=>Us(s,()=>e?s:F(u[1],o=>ts(()=>o(lt(s))),()=>s),o=>Qs(S,o,(i,a,l)=>Sn(a,l),(i,a)=>ae(a)),ut),Sn=(s,e,o)=>Us(e,()=>o?e:F(u[2],i=>ts(()=>i(s,lt(e))),()=>e),i=>Qs(U(S,s,()=>(Cn(s,1),P(et,s,Jn()),P(C,s,R()),R())),i,(a,l,g)=>bt(s,a,l,g),(a,l)=>le(s,a,l)),ut),bt=(s,e,o,i,a)=>Us(i,()=>a?i:F(u[3],l=>ts(()=>l(s,o,lt(i))),()=>i),l=>Qs(U(e,o,()=>(kt(s,o,1),R())),l,(g,d,m)=>Vt(s,o,g,d,m),(g,d)=>pn(s,e,o,g,d,a)),ut),jo=(s,e,o,i,a)=>{Qs(U(e,o,()=>(kt(s,o,1),R())),i,(l,g,d)=>F(Ln(s,o,g,d),m=>Vt(s,o,l,g,m,a)),(l,g)=>pn(s,e,o,l,g,!0))},Vt=(s,e,o,i,a,l)=>Us(a,()=>F(l?void 0:u[4],g=>ts(()=>g(s,e,i,a)),()=>a),g=>{ns(o,i)||ge(s,e,i,1);let d=T(o,i);g!==d&&(he(s,e,i,d,g),P(o,i,g))}),ie=(s,e,o,i,a,l)=>F(T(e,o),g=>Vt(s,o,g,i,a,l),()=>{let g=R();P(e,o,g),kt(s,o,1),Bs(se({[i]:a},s,o),(d,m)=>Vt(s,o,g,m,d,l))}),re=(s,e)=>Us(s,()=>e?s:F(u[5],o=>ts(()=>o(lt(s))),()=>s),o=>Qs(G,o,(i,a,l)=>Bt(a,l),(i,a)=>fe(a)),ut),Bt=(s,e,o)=>Us(e,()=>F(o?void 0:u[6],i=>ts(()=>i(s,e)),()=>e),i=>{ns(G,s)||ue(s,1);let a=T(G,s);i!==a&&(Te(s,a,i),P(G,s,i))}),Yo=(s,e)=>{let[o]=T(et,s),i;do i=o(e);while(ns(T(S,s),i));return i},Jt=s=>U(S,s,()=>(Cn(s,1),P(et,s,Jn()),P(C,s,R()),R())),ae=s=>ts(()=>u[8]?.(s))??!0?Sn(s,{},!0):T(S,s),le=(s,e,o)=>{if(ts(()=>u[9]?.(s,o))??!0){let[,i]=T(et,s);i(o),bt(s,e,o,{},!0)}},pn=(s,e,o,i,a,l,g)=>{let d=T(T(Ns,s)?.[0],a);if(!es(d)&&!l)return Vt(s,o,i,a,d);if(g||(ts(()=>u[10]?.(s,o,a))??!0)){let m=B=>{he(s,o,B,T(i,B)),ge(s,o,B,-1),P(i,B)};es(d)?m(a):Is(i,m),y(i)&&(kt(s,o,-1),y(P(e,o))&&(Cn(s,-1),P(S,s),P(et,s),P(C,s)))}},fe=(s,e)=>{let o=T(Js,s);if(!es(o))return Bt(s,o);(e||(ts(()=>u[12]?.(s))??!0))&&(Te(s,T(G,s)),ue(s,-1),P(G,s))},Cn=(s,e)=>At(Z,s,e),kt=(s,e,o)=>At(U(h,s,R),e,o)&&P(p,s,U(p,s,()=>0)+o),ge=(s,e,o,i)=>{let a=T(C,s),l=T(a,o)??0;(l==0&&i==1||l==1&&i==-1)&&At(U(M,s,R),o,i),P(a,o,l!=-i?l+i:void 0),At(U(U(L,s,R),e,R),o,i)},he=(s,e,o,i,a)=>{let l=ns(T(T(D,s),e),o)&&es(i)?1:0;U(U(U(N,s,R),e,R),o,()=>[i,0])[1]=a,E[3]?.(s,e,o,a,A,l),yt(T(T(D,s),e),o)},ue=(s,e)=>At(H,s,e),Te=(s,e,o)=>{let i=ns(K,s)&&es(e)?1:0;U(x,s,()=>[e,0])[1]=o,E[4]?.(s,o,A,i),yt(K,s)},As=(s,e,o,i,a)=>(hn(U(U(U(ds,s,R),e,R),o,()=>[]),i),a),Tt=(s,e,o)=>(hn(U(fs,s,()=>[]),e),o),Ut=(s,e,o)=>F(T(T(T(N,s),e),o),([i,a])=>[!0,q(i),q(a)],()=>[!1,...nn(qt(s,e,o))]),Le=s=>F(T(x,s),([e,o])=>[!0,q(e),q(o)],()=>[!1,...nn(Kt(s))]),de=s=>!y(ds)&&!y(Ps[s])?_(s?uo(ds):ds,(e,o)=>_(e,(i,a)=>_(i,(l,g)=>$(Ps[s],[o,a,g],l)))):0,Ee=s=>!y(fs)&&!y(vs[s])?_(s?ys(fs):fs,(e,o)=>$(vs[s],[o],e)):0,Mt=(s,e,o,i)=>{if(!y(s))return $(e,i,()=>is(s)),Is(s,(a,l)=>$(o,[...i??[],a],l==1)),1},bo=s=>ys(s,e=>ys(e,o=>ys(o,en))),Se=s=>{let e=!y(rs[s]),o=!y(O[s]),i=!(y(ps[s])&&y(Vs[s])&&y(w[s])&&y(ss[s])&&y(gs[s])&&y(Ss[s])&&y(hs[s])&&!o&&y(z[s])&&y(Q[s])),a=!(y(Ms[s])&&y(Rs[s])&&y(I[s])&&y(V[s]));if(e||i||a){let l=s?[ys(Z),bn(M),ys(p),bn(h),uo(L),bo(N)]:[Z,M,p,h,L,N];if(e){let g=Ot();g!=c&&$(rs[s],void 0,g)}if(i){Mt(l[0],z[s],Q[s]),_(l[1],(d,m)=>Mt(d,gs[s],Ss[s],[m])),_(l[2],(d,m)=>{d!=0&&$(hs[s],[m],ye(m))});let g=ft();_(l[3],(d,m)=>{Mt(d,w[s],ss[s],[m])&&o&&($(O[s],[m,null]),gt(g,m))}),o&&_(l[5],(d,m)=>{if(!ns(g,m)){let B=ft();_(d,ls=>_(ls,([Ws,zs],Gs)=>zs!==Ws?gt(B,Gs):yt(ls,Gs))),_(B,ls=>$(O[s],[m,ls]))}}),_(l[4],(d,m)=>_(d,(B,ls)=>Mt(B,ps[s],Vs[s],[m,ls])))}if(a){let g;_(l[5],(d,m)=>{let B;_(d,(ls,Ws)=>{let zs;_(ls,([Gs,dt],gc)=>{dt!==Gs&&($(Ms[s],[m,Ws,gc],q(dt),q(Gs),Ut),g=B=zs=1)}),zs&&$(Rs[s],[m,Ws],Ut)}),B&&$(I[s],[m],Ut)}),g&&$(V[s],void 0,Ut)}}},pe=s=>{let e=!y(as[s]),o=!y(us[s])||!y(Cs[s]),i=!y(Hs[s])||!y(W[s]);if(e||o||i){let a=s?[ys(H),ys(x,en)]:[H,x];if(e){let l=$t();l!=r&&$(as[s],void 0,l)}if(o&&Mt(a[0],us[s],Cs[s]),i){let l;_(a[1],([g,d],m)=>{d!==g&&($(Hs[s],[m],q(d),q(g),Le),l=1)}),l&&$(W[s],void 0,Le)}}},j=(s,...e)=>(Mn(()=>s(...gn(e,v))),ms),Ce=(s,e,o,i,a)=>{let l=Wt(s,e,...o);return ws(()=>{let g=Wt(s,e,...o);Xc(g,l)||(l=g,i(ms,s,e,...o,l))},O[a?1:0],[s,e],[Ts])},me=(s=!1)=>[is(N,(e,o)=>T(Z,o)===-1?void 0:is(e,(i,a)=>T(T(h,o),a)===-1?void 0:is(i,([,l])=>q(l,"",s),l=>on(l)),y,_s),y,_s),is(x,([,e])=>q(e,"",s),e=>on(e)),1],Bo=()=>[mn(),yn()],Jo=()=>[wt(S),is(G)],mn=()=>wt(S,q),Ts=()=>vt(S),ko=s=>Yn(T(S,v(s)),q),Re=s=>vt(T(C,v(s))),ye=s=>Wn(T(S,v(s))),Lt=s=>vt(T(S,v(s))),Wt=(s,e,o,i=0,a)=>tt(s)?Wt(s.tableId,s.cellId,s.descending,s.offset,s.limit):gn(Gn(Qc(li(T(S,v(s)),(l,g)=>[es(e)?g:T(l,v(e)),g]),([l],[g])=>fi(l,g)*(o?-1:1)),i,es(a)?a:i+a),([,l])=>l),Uo=(s,e)=>is(T(T(S,v(s)),v(e)),q),Rn=(s,e)=>vt(T(T(S,v(s)),v(e))),qt=(s,e,o)=>q(T(T(T(S,v(s)),v(e)),v(o))),yn=()=>is(G,q),Nn=()=>vt(G),Kt=s=>q(T(G,v(s))),Ot=()=>!y(S),Ne=s=>ns(S,v(s)),Ve=(s,e)=>ns(T(C,v(s)),v(e)),Me=(s,e)=>ns(T(S,v(s)),v(e)),He=(s,e,o)=>ns(T(T(S,v(s)),v(e)),v(o)),$t=()=>!y(G),xe=s=>ns(G,v(s)),Wo=()=>mt(S),qo=()=>mt(G),Ko=()=>mt([S,G]),Oo=()=>mt(Es),$o=()=>mt(Fs),Zo=()=>mt([Es,Fs]),Xo=s=>j(()=>{let e=Pn(s)?s():s;wo(e)&&Go(e)}),Zt=s=>j(()=>Ao(s)?ce(s):0),Qo=(s,e)=>j(o=>Xn(e,o)?Sn(o,e):0,s),Io=(s,e,o)=>j((i,a)=>Yt(i,a,o)?bt(i,Jt(i),a,o):0,s,e),sc=(s,e,o=!0)=>Mn(()=>{let i;return Yt(s,i,e)&&(s=v(s),bt(s,Jt(s),i=Yo(s,o?1:0),e)),i}),tc=(s,e,o)=>j((i,a)=>{if(Yt(i,a,o,1)){let l=Jt(i);Bs(o,(g,d)=>ie(i,l,a,d,g))}},s,e),_e=(s,e,o,i,a,l)=>j((g,d,m)=>F(Ln(g,d,m,Pn(i)?i(qt(g,d,m)):i),B=>{let ls=Jt(g);F(a||l||!u[14]?.()?void 0:u[3],Ws=>{let zs=T(ls,d),Gs={...zs?is(zs):{},[m]:B};F(ts(()=>Ws(g,d,lt(Gs))),dt=>jo(g,ls,d,dt,a))},()=>ie(g,ls,d,m,B,a))}),s,e,o),Xt=s=>j(()=>Qn(s)?re(s):0),nc=s=>j(()=>Qn(s,1)?Bs(s,(e,o)=>Bt(o,e)):0),De=(s,e,o)=>j(i=>F(In(i,Pn(e)?e(Kt(i)):e),a=>Bt(i,a,o)),s),ec=s=>j(()=>Us(s,()=>F(u[13],e=>ts(()=>e(lt(s))),()=>s),e=>{Bs(e[0],(o,i)=>es(o)?we(i):Bs(o,(a,l)=>es(a)?Ae(i,l):Bs(a,(g,d)=>dn(i,l,d,g,void 0,!0)))),Bs(e[1],(o,i)=>En(i,o))},To)),Fe=s=>(vn(()=>ee(rn(s))),ms),oc=s=>(vn(()=>oe(rn(s))),ms),cc=s=>j(()=>vn(()=>{let[e,o]=rn(s);ee(e),oe(o)},()=>Fe(s))),Pe=s=>j(()=>{if((t=Po(s))&&(te(s),!y(S))){let e=mn();Qt(),Zt(e)}}),ve=s=>j(()=>{if(n=vo(s)){let e=yn();Vn(),It(),n=!0,ne(s),Xt(e)}}),ic=(s,e)=>j(()=>{Pe(s),ve(e)}),Qt=()=>j(()=>ts(()=>u[7]?.())??!0?ce({},!0):0),we=s=>j(e=>ns(S,e)?ae(e):0,s),Ae=(s,e)=>j((o,i)=>F(T(S,o),a=>ns(a,i)?le(o,a,i):0),s,e),ze=(s,e,o,i,a)=>j((l,g,d)=>F(T(S,l),m=>F(T(m,g),B=>ns(B,d)?pn(l,m,g,B,d,i,a):0)),s,e,o),It=()=>j(()=>ts(()=>u[11]?.())??!0?re({},!0):0),Ge=(s,e)=>j(o=>ns(G,o)?fe(o,e):0,s),je=()=>j(()=>{te({}),t=!1}),Vn=()=>j(()=>{ne({}),n=!1}),rc=()=>j(()=>{je(),Vn()}),Mn=(s,e)=>{if(f!=-1){Ye();let o=s();return be(e),o}},Ye=()=>(f!=-1&&f++,f==1&&(E[0]?.(),$(ks)),ms),ac=()=>me(),lc=()=>me(!0),fc=()=>[!y(N),!y(x),wt(N,en,on),wt(ds),is(x,en,on),is(fs),is(Z),Yn(h),wt(L),is(H)],be=s=>(f>0&&(f--,f==0&&(f=1,ts(()=>{de(1),y(N)||Se(1),Ee(1),y(x)||pe(1)}),s?.(ms)&&(_(N,(e,o)=>_(e,(i,a)=>_(i,([l],g)=>dn(o,a,g,l,!0)))),zn(N),_(x,([e],o)=>En(o,e,!0)),zn(x)),$(X[0],void 0),f=-1,de(0),y(N)||Se(0),Ee(0),y(x)||pe(0),E[1]?.(),$(X[1],void 0),E[2]?.(),f=0,c=Ot(),r=$t(),jt([Z,M,p,h,L,N,D,ds,H,x,K,fs],zn))),ms),ms={getContent:Bo,getTables:mn,getTableIds:Ts,getTable:ko,getTableCellIds:Re,getRowCount:ye,getRowIds:Lt,getSortedRowIds:Wt,getRow:Uo,getCellIds:Rn,getCell:qt,getValues:yn,getValueIds:Nn,getValue:Kt,hasTables:Ot,hasTable:Ne,hasTableCell:Ve,hasRow:Me,hasCell:He,hasValues:$t,hasValue:xe,getTablesJson:Wo,getValuesJson:qo,getJson:Ko,getTablesSchemaJson:Oo,getValuesSchemaJson:$o,getSchemaJson:Zo,hasTablesSchema:()=>t,hasValuesSchema:()=>n,setContent:Xo,setTables:Zt,setTable:Qo,setRow:Io,addRow:sc,setPartialRow:tc,setCell:_e,setValues:Xt,setPartialValues:nc,setValue:De,applyChanges:ec,setTablesJson:Fe,setValuesJson:oc,setJson:cc,setTablesSchema:Pe,setValuesSchema:ve,setSchema:ic,delTables:Qt,delTable:we,delRow:Ae,delCell:ze,delValues:It,delValue:Ge,delTablesSchema:je,delValuesSchema:Vn,delSchema:rc,transaction:Mn,startTransaction:Ye,getTransactionChanges:ac,getTransactionLog:fc,finishTransaction:be,forEachTable:s=>_(S,(e,o)=>s(o,i=>_(e,(a,l)=>i(l,g=>Is(a,(d,m)=>g(d,q(m))))))),forEachTableCell:(s,e)=>Is(T(C,v(s)),e),forEachRow:(s,e)=>_(T(S,v(s)),(o,i)=>e(i,a=>Is(o,(l,g)=>a(l,q(g))))),forEachCell:(s,e,o)=>Is(T(T(S,v(s)),v(e)),(i,a)=>o(i,q(a))),forEachValue:s=>Is(G,(e,o)=>s(e,q(o))),addSortedRowIdsListener:(s,e,o,i,a,l,g)=>tt(s)?Ce(s.tableId,s.cellId,[s.descending??!1,s.offset??0,s.limit],e,o):Ce(s,e,[o,i,a],l,g),addStartTransactionListener:s=>ws(s,ks),addWillFinishTransactionListener:s=>ws(s,X[0]),addDidFinishTransactionListener:s=>ws(s,X[1]),callListener:s=>(Fo(s),ms),delListener:s=>(Do(s),ms),getListenerStats:()=>({hasTables:Y(rs),tables:Y(V),tableIds:Y(z),hasTable:Y(Q),table:Y(I),tableCellIds:Y(gs),hasTableCell:Y(Ss,Gt),rowCount:Y(hs),rowIds:Y(w),sortedRowIds:Y(O),hasRow:Y(ss,Gt),row:Y(Rs,Gt),cellIds:Y(ps,Gt),hasCell:Y(Vs,An),cell:Y(Ms,An),invalidCell:Y(Ps,An),hasValues:Y(as),values:Y(W),valueIds:Y(us),hasValue:Y(Cs),value:Y(Hs),invalidValue:Y(vs),transaction:qn(ks)+Y(X)}),isMergeable:()=>!1,_:[Kn,ws,$,(s,e,o,i,a)=>E=[s,e,o,i,a],(s,e,o,i,a,l,g,d,m,B,ls,Ws,zs,Gs,dt)=>u=[s,e,o,i,a,l,g,d,m,B,ls,Ws,zs,Gs,dt],dn,En,Jo,lc]};return Bs({[at+lo]:[0,rs,[],()=>[Ot()]],[lo]:[0,V],[bc]:[0,z],[at+Rt]:[1,Q,[Ts],s=>[Ne(...s)]],[Rt]:[1,I,[Ts]],[Rt+fo]:[1,gs,[Ts]],[at+Rt+cn]:[2,Ss,[Ts,Re],s=>[Ve(...s)]],[Bc]:[1,hs,[Ts]],[Jc]:[1,w,[Ts]],[at+an]:[2,ss,[Ts,Lt],s=>[Me(...s)]],[an]:[2,Rs,[Ts,Lt]],[fo]:[2,ps,[Ts,Lt]],[at+cn]:[3,Vs,[Ts,Lt,Rn],s=>[He(...s)]],[cn]:[3,Ms,[Ts,Lt,Rn],s=>nn(qt(...s))],InvalidCell:[3,Ps],[at+go]:[0,as,[],()=>[$t()]],[go]:[0,W],[kc]:[0,us],[at+ln]:[1,Cs,[Nn],s=>[xe(...s)]],[ln]:[1,Hs,[Nn],s=>nn(Kt(s[0]))],InvalidValue:[1,vs]},([s,e,o,i],a)=>{ms[Yc+a+jc]=(...l)=>ws(l[s],e[l[s+1]?1:0],s>0?Gn(l,0,s):void 0,o,i)}),ei(ms)};var Ti=["db","id","ids","no","ui","ws","add","api","bun","del","dom","for","get","has","hlc","log","map","row","set","sql","use","web","yjs"],_o=(t=!1)=>{addEventListener("load",()=>{let n=js("body > header > nav");if(n==null)return;let c=os("div",null,{id:"search"}),r=os("input",c,{type:"text",placeholder:(navigator.platform.startsWith("Mac")?"\u2318":"cmd-")+"K Search"}),f=os("ol",c),u=os("li",f,{},"No results found"),E=Kn(),A=ao(E);A.setIndexDefinition("p","p",h=>{let L=[];return h("t").split(" ").forEach(N=>{for(let D=0;D<N.length;D++)L.push(N.slice(0,D+1))}),L},"t",void 0,(h,L,N)=>$n(L,N)-$n(h,N)),fetch("/pages.json").then(h=>h.json()).then(h=>{E.transaction(()=>{E.setContent(h),E.forEachRow("p",L=>{let{n:N,s:D}=E.getRow("p",L),H=new Set;On(L,H,!0),On(N,H),On(D,H),E.setCell("p",L,"t",Array.from(H.values()).join(" "))})}),Z()});let Z=()=>{n.prepend(c);let h=()=>(r.value?ot:Ht)(f,"show");r.addEventListener("focus",h),r.addEventListener("input",()=>{h(),M()}),r.addEventListener("blur",()=>Ht(f,"show")),p()},M=()=>{let h=r.value.toLowerCase().split(/[^a-z0-9]+/),L=new Map;h.forEach(H=>A.getSliceRowIds("p",H).slice(0,50).forEach(x=>L.set(x,(L.get(x)??0)+$n(E.getCell("p",x,"t"),H))));let N=Array.from(L.keys()).sort((H,x)=>L.get(x)-L.get(H)).slice(0,10),D=N.length==0?[u]:N.map((H,x)=>{let K=os("li"),{n:ds,s:fs}=E.getRow("p",H);return Ho(os("b",K),ds,h[0]),Ho(os("span",K),fs,h[0]),K.title=fs,K.addEventListener("mousedown",()=>t?location.href=H:xt(H)),x==0&&ot(K,"hover"),K});f.replaceChildren(...D)},p=()=>addEventListener("keydown",h=>{if(Ks.activeElement==r){let L=qs(f,".hover");switch(h.code){case"Escape":return r.blur();case"ArrowDown":return ct(h),xo(L,L?.nextSibling??f.firstChild);case"ArrowUp":return ct(h),xo(L,L?.previousSibling??f.lastChild);case"Enter":return L?.dispatchEvent(new MouseEvent("mousedown"))}}else h.code=="KeyK"&&h.metaKey&&(r.focus(),ct(h))})})},Ho=(t,n,c)=>{let r=n.toLowerCase().indexOf(c);t.innerHTML=r==-1?n:n.substring(0,r)+"<em>"+n.substring(r,r+c.length)+"</em>"+n.substring(r+c.length)},xo=(t,n)=>{t!=n&&(t&&Ht(t,"hover"),n&&(ot(n,"hover"),n.scrollIntoView({block:"nearest",inline:"nearest"})))},On=(t,n,c)=>{let r=t.replaceAll(/[^a-zA-Z0-9]/g," ").split(/\s+/);c&&r.reverse(),r.forEach(f=>{[f,...f.replaceAll(/([a-z])([A-Z])/g,"$1 $2").split(" ")].forEach(u=>{let E=u.toLowerCase();(E.length>3||Ti.includes(E))&&n.add(E)})})},$n=(t,n)=>{let c=t.length,r=t.indexOf(n);return r===-1?0:(c-r)/c};Je();Ke();_o();addEventListener("load",()=>{Hn(),Ks.body.addEventListener("click",n=>{if(n.button!=0)return;let c=n.target;if(c.tagName=="SPAN"&&c.innerHTML==""&&c.parentElement?.tagName=="LI")return t(c.parentElement);for(;c.tagName!="A"&&c.parentElement!=null;)c=c.parentElement;let r=c.href;!n.metaKey&&!n.shiftKey&&r!=null&&r!=location.origin+"/"&&r.startsWith(location.origin+"/")&&!r.includes("#")&&(xt(r),ct(n))}),window.onpopstate=function(n){location.href.includes("#")||(xt(location.href,!1),ct(n))};let t=n=>We(n,"open",()=>{let c=qs(n,"a");c.href!=location.origin&&c.click()})});})();

Callers 6

xcFunction · 0.70
NsFunction · 0.70
FsFunction · 0.70
wcFunction · 0.70
app.jsFile · 0.70
dsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected