@lunora/studio 1.0.0-alpha.385 → 1.0.0-alpha.387

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.
Files changed (72) hide show
  1. package/dist/index.d.mts +1 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/packem_chunks/ApiTab.mjs +1 -1
  5. package/dist/packem_chunks/ai-knowledge.mjs +1 -1
  6. package/dist/packem_shared/{ApiDocsPanel-BZNuHTR8.mjs → ApiDocsPanel-CgjWqkBr.mjs} +2 -2
  7. package/dist/standalone/{chunk-LVU6W6MM.js → chunk-2IZDKUFI.js} +1 -1
  8. package/dist/standalone/{chunk-PSBRO6JX.js → chunk-2L3WHXJV.js} +1 -1
  9. package/dist/standalone/{chunk-IR2MDKXQ.js → chunk-3R6W72RH.js} +1 -1
  10. package/dist/standalone/{chunk-H2ZCM66S.js → chunk-3Y4QC5Y3.js} +1 -1
  11. package/dist/standalone/{chunk-L34AGC7Z.js → chunk-457LPY43.js} +1 -1
  12. package/dist/standalone/{chunk-C56YDP56.js → chunk-56MOCXLS.js} +1 -1
  13. package/dist/standalone/{chunk-HJ7QDXCT.js → chunk-57F7KSWY.js} +1 -1
  14. package/dist/standalone/{chunk-EBKEYF3N.js → chunk-5AVK4OU3.js} +1 -1
  15. package/dist/standalone/{chunk-B2EUIUL5.js → chunk-6AOWASDA.js} +1 -1
  16. package/dist/standalone/{chunk-XD5CKMBE.js → chunk-6GIVSDLA.js} +1 -1
  17. package/dist/standalone/{chunk-V6JMOE7W.js → chunk-7KNQ44FF.js} +1 -1
  18. package/dist/standalone/{chunk-7THIXUEZ.js → chunk-BADXUCOT.js} +1 -1
  19. package/dist/standalone/{chunk-R6ZR7FZZ.js → chunk-C2AMUDOR.js} +1 -1
  20. package/dist/standalone/{chunk-6U3PB43O.js → chunk-CD2LQVUA.js} +1 -1
  21. package/dist/standalone/{chunk-FFJ75IBP.js → chunk-CDDK3RFD.js} +1 -1
  22. package/dist/standalone/{chunk-2HJOQZQ5.js → chunk-D34KO2UK.js} +1 -1
  23. package/dist/standalone/{chunk-DZZ3N75F.js → chunk-DG5IPCQV.js} +1 -1
  24. package/dist/standalone/{chunk-FZ6557GN.js → chunk-DPSTEE4D.js} +1 -1
  25. package/dist/standalone/{chunk-MCDKIVLH.js → chunk-DUNKBNMY.js} +1 -1
  26. package/dist/standalone/{chunk-ISTQIPTN.js → chunk-DUX2Q5UM.js} +1 -1
  27. package/dist/standalone/{chunk-EFTLHOFA.js → chunk-E5GKOI3R.js} +1 -1
  28. package/dist/standalone/{chunk-LQJQDJNH.js → chunk-EK74664L.js} +1 -1
  29. package/dist/standalone/{chunk-7QZQZYJT.js → chunk-FFNYPIIW.js} +1 -1
  30. package/dist/standalone/{chunk-42U2JUGB.js → chunk-GFOHMAH3.js} +1 -1
  31. package/dist/standalone/{chunk-FQRAKX6V.js → chunk-H5XMXLKP.js} +1 -1
  32. package/dist/standalone/{chunk-R3E7HYHA.js → chunk-HSL3R24X.js} +1 -1
  33. package/dist/standalone/{chunk-7MPWIS3R.js → chunk-I2C3K4SJ.js} +1 -1
  34. package/dist/standalone/{chunk-EZ2K57JT.js → chunk-J4JDBEID.js} +1 -1
  35. package/dist/standalone/{chunk-3MU55LYE.js → chunk-J6NDZCBQ.js} +1 -1
  36. package/dist/standalone/{chunk-ZYQQJ5FK.js → chunk-K55BSHNZ.js} +1 -1
  37. package/dist/standalone/{chunk-GRM43CFE.js → chunk-KAWNPEUA.js} +1 -1
  38. package/dist/standalone/{chunk-KE7ZGUGO.js → chunk-KDMDI7KA.js} +1 -1
  39. package/dist/standalone/{chunk-4JR7B43V.js → chunk-KFPV6FAK.js} +1 -1
  40. package/dist/standalone/{chunk-IUUXVNAP.js → chunk-KPX6GS6G.js} +1 -1
  41. package/dist/standalone/{chunk-MMLEHOX7.js → chunk-KSEWJNEY.js} +1 -1
  42. package/dist/standalone/{chunk-MBCU5GIY.js → chunk-KW5PNET5.js} +1 -1
  43. package/dist/standalone/{chunk-6WNYDTK5.js → chunk-M4TYLAUX.js} +1 -1
  44. package/dist/standalone/{chunk-GX2UAEGW.js → chunk-O5VYYMWA.js} +1 -1
  45. package/dist/standalone/{chunk-MIDNWFNN.js → chunk-ODV4EB3C.js} +1 -1
  46. package/dist/standalone/{chunk-NAQILWRM.js → chunk-OGIWPH2B.js} +1 -1
  47. package/dist/standalone/{chunk-LL7JKFBU.js → chunk-PROLM3J5.js} +1 -1
  48. package/dist/standalone/{chunk-YGSVIF7L.js → chunk-PUYNCASR.js} +1 -1
  49. package/dist/standalone/{chunk-I37NPLQI.js → chunk-PVNVHQS5.js} +1 -1
  50. package/dist/standalone/{chunk-CSDAZN5R.js → chunk-Q3U7OEDK.js} +1 -1
  51. package/dist/standalone/chunk-QB75Q7U4.js +7 -0
  52. package/dist/standalone/{chunk-O2HPBDEC.js → chunk-QS2BPA4D.js} +1 -1
  53. package/dist/standalone/{chunk-WXV3KCFJ.js → chunk-RBTRTSXY.js} +1 -1
  54. package/dist/standalone/{chunk-BZ6CJVEW.js → chunk-RUAE5VGJ.js} +1 -1
  55. package/dist/standalone/{chunk-WSYQMHC4.js → chunk-SALLT4EA.js} +1 -1
  56. package/dist/standalone/{chunk-E6KWXZCK.js → chunk-SB54Y4G6.js} +1 -1
  57. package/dist/standalone/{chunk-DVTU6UE5.js → chunk-THB7DCWF.js} +1 -1
  58. package/dist/standalone/{chunk-FUPX23QR.js → chunk-TQVX4KLJ.js} +1 -1
  59. package/dist/standalone/{chunk-4VF4BIOZ.js → chunk-TWNPQQS7.js} +1 -1
  60. package/dist/standalone/{chunk-O4BQMWIN.js → chunk-UVBNLJ2Q.js} +8 -8
  61. package/dist/standalone/{chunk-VLAEMGPY.js → chunk-V7EUTFAA.js} +1 -1
  62. package/dist/standalone/{chunk-3O5KRHWI.js → chunk-VEEFAOKX.js} +1 -1
  63. package/dist/standalone/{chunk-XWEMSCUN.js → chunk-VOQK6ERC.js} +1 -1
  64. package/dist/standalone/{chunk-2G5OZPH5.js → chunk-VXMAQB2K.js} +1 -1
  65. package/dist/standalone/chunk-WLQL3I62.js +1 -0
  66. package/dist/standalone/{chunk-LLSKRNQ5.js → chunk-XUS65GNY.js} +1 -1
  67. package/dist/standalone/{chunk-KSATOQ6G.js → chunk-XY5UOZMD.js} +1 -1
  68. package/dist/standalone/{chunk-V7W37FDL.js → chunk-ZLELD7AD.js} +1 -1
  69. package/dist/standalone/studio.js +1 -1
  70. package/package.json +3 -3
  71. package/dist/standalone/chunk-UAXX2RXT.js +0 -1
  72. package/dist/standalone/chunk-UK5OOCLQ.js +0 -7
@@ -1,4 +1,4 @@
1
- import{a as dt,b as Or,c as uo}from"./chunk-MVRBX7HB.js";import{d as zr}from"./chunk-R6NJ4ER6.js";import{a as io}from"./chunk-W7CLOQOU.js";import{a as Be}from"./chunk-ODEIAS3V.js";import{c as so}from"./chunk-MHZNDDGI.js";import{a as lo}from"./chunk-MMRSSV2C.js";import{a as ro}from"./chunk-76CCNRPQ.js";import{a as co,b as He,f as Vr,g as Er}from"./chunk-BWS7JUQV.js";import{a as Ot}from"./chunk-SNJ3ZOV2.js";import{a as ao}from"./chunk-JNWK5MJC.js";import{a as Tr}from"./chunk-ISTQIPTN.js";import{a as rn}from"./chunk-CJ2V577P.js";import"./chunk-QAETUNZX.js";import"./chunk-LMCBMC2V.js";import"./chunk-QF743FSL.js";import{b as yr,c as tn}from"./chunk-CL3JOU6F.js";import{a as ln}from"./chunk-DRHZZ7IN.js";import{a as to,b as xr}from"./chunk-KSATOQ6G.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import{a as Nr}from"./chunk-PAFHBQFL.js";import{a as Fr,b as kr}from"./chunk-EDL46BPM.js";import{a as en}from"./chunk-DWNWEMQK.js";import{b as Cr,c as Rr,f as on}from"./chunk-4KPATTV6.js";import{c as pr,d as br,e as hr,f as rt,g as Zt,h as wr,i as Sr}from"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import{i as vr}from"./chunk-OKZINWBB.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as oo}from"./chunk-NVMQPIRS.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as no}from"./chunk-S3TDGFRE.js";import"./chunk-L27FKJTG.js";import{a as Mr,b as Ir,c as Pr,d as nn,e as Ar,f as Dr}from"./chunk-J3ZEO3PJ.js";import{a as _e}from"./chunk-LYVYUTQY.js";import{b as Zo,c as lt}from"./chunk-KE7ZGUGO.js";import{b as Qo,c as Xo,d as Yt,e as fr,n as et}from"./chunk-UK5OOCLQ.js";import"./chunk-ZPQBVYNN.js";import{B as te,h as $e,i as je,j as Tt,p as Yo,q as eo,r as Ee,s as ee,w as _r,x as ut}from"./chunk-PN7JHEYW.js";import"./chunk-PDBW6GTJ.js";import{a as At}from"./chunk-A6TVTNKO.js";import{a as ct,b as Dt}from"./chunk-ADABTCDI.js";import{a as n,d as ke}from"./chunk-5PEAXTYQ.js";var Vs=ke(At(),1);var Mt=ke(ct(),1);var G=ke(At(),1),A=ke(ct(),1);var _t=ke(At(),1);var X=ke(Dt(),1),tt=ke(ct(),1);var fi=2166136261,pi=16777619,bi=n((t,e=fi)=>{let o=e;for(let l=0;l<t.length;l+=1)o^=t.charCodeAt(l),o=Math.imul(o,pi);return(o>>>0).toString(16).padStart(8,"0")},"L"),hi=/([a-z\d])([A-Z])/gu,wi=/[\s_-]+/u,Si=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),_i=n(t=>{let e=t.replaceAll(hi,"$1 $2").split(wi).map(l=>l.toLowerCase()).filter(l=>l.length>0),o=new Set(e);for(let l=0;l<e.length-1;l+=1){let r=e[l],a=e[l+1];r===void 0||a===void 0||(o.add(`${r}${a}`),o.add(`${r}_${a}`))}return[...o]},"ae"),$r="\u2022\u2022\u2022",qr=n((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:bi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):$r}catch{return $r}},"U"),jr=n((t,e)=>{let o=new Map;for(let l of t)l.table===e&&o.set(l.column,l.strategy);return o},"V"),xi=n(t=>{for(let e of _i(t))if(Si.has(e))return!0;return!1},"ce"),Hr=n((t,e)=>{let o=e.filter(r=>!t.has(r)&&xi(r));if(o.length===0)return t;let l=new Map(t);for(let r of o)l.set(r,"redact");return l},"j"),Vt=n((t,e,o)=>{if(!o.enabled)return t;let l=o.columns.get(e);return l===void 0?t:qr(t,l)},"_e"),mo=n((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let o={...t};for(let[l,r]of e.columns)l in o&&(o[l]=qr(o[l],r));return o},"ie"),go=n((t,e)=>!e.enabled||e.columns.size===0?t:t.map(o=>mo(o,e)),"Me"),Lr=n(t=>t==null?"\u2205":t===""?"(empty)":Ee(t),"z"),vi=n(t=>{let e=(0,_t.c)(32),{column:o,onFacetFilter:l,state:r}=t,a=te(),s;e[0]!==o||e[1]!==l||e[2]!==r.result?.values?(s=n(w=>{let x=Number(w.currentTarget.dataset.index),_=r.result?.values[x];_!==void 0&&l(o,_.value)},"x"),e[0]=o,e[1]=l,e[2]=r.result?.values,e[3]=s):s=e[3];let c=s,i=`db-facet-${o}`,u;e[4]!==o?(u=(0,X.jsx)("span",{className:"font-medium text-foreground",children:o}),e[4]=o,e[5]=u):u=e[5];let d;e[6]!==r.loading||e[7]!==r.result||e[8]!==a?(d=r.loading&&r.result===null&&(0,X.jsx)("span",{className:"text-muted-foreground",children:a("Loading\u2026")}),e[6]=r.loading,e[7]=r.result,e[8]=a,e[9]=d):d=e[9];let g;e[10]!==r.error?(g=r.error!==null&&(0,X.jsx)("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=g):g=e[11];let m;e[12]!==r.result?.values?(m=r.result?.values??[],e[12]=r.result?.values,e[13]=m):m=e[13];let h;if(e[14]!==o||e[15]!==c||e[16]!==m){let w;e[18]!==o||e[19]!==c?(w=n((x,_)=>(0,X.jsxs)("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":_,"data-testid":`db-facet-value-${o}`,onClick:c,type:"button",children:[(0,X.jsx)("span",{className:"truncate",children:Lr(x.value)}),(0,X.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:x.count})]},Lr(x.value)),"c"),e[18]=o,e[19]=c,e[20]=w):w=e[20],h=m.map(w),e[14]=o,e[15]=c,e[16]=m,e[17]=h}else h=e[17];let p;e[21]!==o||e[22]!==r.result||e[23]!==a?(p=r.result?.truncated===!0&&(0,X.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${o}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=o,e[22]=r.result,e[23]=a,e[24]=p):p=e[24];let b;return e[25]!==i||e[26]!==u||e[27]!==d||e[28]!==g||e[29]!==h||e[30]!==p?(b=(0,X.jsxs)("section",{className:"flex flex-col gap-1","data-testid":i,children:[u,d,g,h,p]}),e[25]=i,e[26]=u,e[27]=d,e[28]=g,e[29]=h,e[30]=p,e[31]=b):b=e[31],b},"ue"),fo=n(t=>{let e=(0,_t.c)(44),{columns:o,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,c=te(),i;e[0]!==s?(i=n(y=>{let{column:k}=y.currentTarget.dataset;k!==void 0&&s(k)},"o"),e[0]=s,e[1]=i):i=e[1];let u=i,d;e[2]!==r?(d=n(y=>r.enabled&&r.columns.has(y),"a"),e[2]=r,e[3]=d):d=e[3];let g=d,m,h,p,b,w,x,_,C;if(e[4]!==o||e[5]!==l||e[6]!==g||e[7]!==c||e[8]!==u){C=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==g?(y=n(N=>!g(N),"y"),e[17]=g,e[18]=y):y=e[18];let k=o.filter(y),P;if(e[19]!==l||e[20]!==g?(P=Object.entries(l).filter(N=>{let[T]=N;return!g(T)}),e[19]=l,e[20]=g,e[21]=P):P=e[21],m=P,k.length===0){C=null;break e}x="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",_="db-facets",b="flex flex-col gap-1.5";let M;e[22]!==c?(M=c("Facets"),e[22]=c,e[23]=M):M=e[23],e[24]!==M?(w=(0,X.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:M}),e[24]=M,e[25]=w):w=e[25],h="flex flex-wrap gap-1";let I;e[26]!==l||e[27]!==u?(I=n(N=>(0,X.jsx)("button",{"aria-pressed":N in l,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":N,"data-testid":`db-facet-toggle-${N}`,onClick:u,type:"button",children:N},N),"A"),e[26]=l,e[27]=u,e[28]=I):I=e[28],p=k.map(I)}e[4]=o,e[5]=l,e[6]=g,e[7]=c,e[8]=u,e[9]=m,e[10]=h,e[11]=p,e[12]=b,e[13]=w,e[14]=x,e[15]=_,e[16]=C}else m=e[9],h=e[10],p=e[11],b=e[12],w=e[13],x=e[14],_=e[15],C=e[16];if(C!==Symbol.for("react.early_return_sentinel"))return C;let F;e[29]!==h||e[30]!==p?(F=(0,X.jsx)("div",{className:h,children:p}),e[29]=h,e[30]=p,e[31]=F):F=e[31];let v;e[32]!==F||e[33]!==b||e[34]!==w?(v=(0,X.jsxs)("div",{className:b,children:[w,F]}),e[32]=F,e[33]=b,e[34]=w,e[35]=v):v=e[35];let R;e[36]!==a||e[37]!==m?(R=m.map(y=>{let[k,P]=y;return(0,X.jsx)(vi,{column:k,onFacetFilter:a,state:P},k)}),e[36]=a,e[37]=m,e[38]=R):R=e[38];let S;return e[39]!==v||e[40]!==R||e[41]!==x||e[42]!==_?(S=(0,X.jsxs)("aside",{className:x,"data-testid":_,children:[v,R]}),e[39]=v,e[40]=R,e[41]=x,e[42]=_,e[43]=S):S=e[43],S},"Te"),po=n(()=>{let[t,e]=(0,tt.useState)({}),o=Be(t),l=(0,tt.useRef)({}),r=n(async(a,s)=>{let c=(l.current[a]??0)+1;l.current[a]=c,e(i=>a in i?{...i,[a]:{error:null,loading:!0,result:i[a]?.result??null}}:i);try{let i=await s(a);if(l.current[a]!==c)return;e(u=>a in u?{...u,[a]:{error:null,loading:!1,result:i}}:u)}catch(i){if(l.current[a]!==c)return;throw e(u=>a in u?{...u,[a]:{error:Tt(i),loading:!1,result:null}}:u),i}},"n");return{clearFacets:n(()=>{e({})},"clearFacets"),facets:t,facetsRef:o,refetchFacets:n(a=>xr(Object.keys(o.current).map(s=>r(s,a))),"refetchFacets"),toggleFacet:n((a,s)=>{if(a in o.current){e(c=>Object.fromEntries(Object.entries(c).filter(([i])=>i!==a)));return}e(c=>({...c,[a]:{error:null,loading:!0,result:null}})),s!==null&&ee(r(a,s))},"toggleFacet")}},"$e"),yi=[],Ci=n(()=>{let t=(0,_t.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:o}=lt(_e.maskPolicies,e);return Array.isArray(o?.columns)?o.columns:yi},"fe"),bo=n(t=>{let e=(0,_t.c)(16),{columns:o,selectedTable:l}=t,r=Ci(),[a,s]=(0,tt.useState)(!0),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n(()=>{s(Ri)},"g"),e[0]=c):c=e[0];let i=c,u;if(e[1]!==o||e[2]!==r||e[3]!==l){let b=jr(r,l??"");u=Hr(b,o),e[1]=o,e[2]=r,e[3]=l,e[4]=u}else u=e[4];let d=u,g;e[5]!==a||e[6]!==r?(g=n((b,w)=>({columns:Hr(jr(r,b),w),enabled:a}),"l"),e[5]=a,e[6]=r,e[7]=g):g=e[7];let m=g,h;e[8]!==d||e[9]!==a?(h={columns:d,enabled:a},e[8]=d,e[9]=a,e[10]=h):h=e[10];let p;return e[11]!==d||e[12]!==a||e[13]!==m||e[14]!==h?(p={maskColumns:d,maskOn:a,maskView:h,maskViewFor:m,onToggleMask:i},e[11]=d,e[12]=a,e[13]=m,e[14]=h,e[15]=p):p=e[15],p},"Re");function Ri(t){return!t}n(Ri,"me");var Br=34,Gr=600,Fi=n(t=>{let e=(0,_t.c)(21),{item:o,onSelect:l,prefix:r,selected:a,start:s}=t,c;e[0]!==o.name||e[1]!==l?(c=n(()=>{l(o.name)},"g"),e[0]=o.name,e[1]=l,e[2]=c):c=e[2];let i=c,u=`translateY(${String(s)}px)`,d;e[3]!==u?(d={insetInline:0,position:"absolute",top:0,transform:u},e[3]=u,e[4]=d):d=e[4];let g=d,m=a?"bg-accent font-medium text-accent-foreground":"text-foreground",h;e[5]!==m?(h=ut("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",m),e[5]=m,e[6]=h):h=e[6];let p=`${r}-table-${o.name}`,b;e[7]!==o.name?(b=(0,X.jsx)("span",{className:"truncate",children:o.name}),e[7]=o.name,e[8]=b):b=e[8];let w;e[9]!==o.rowCount?(w=(0,X.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:o.rowCount}),e[9]=o.rowCount,e[10]=w):w=e[10];let x;e[11]!==i||e[12]!==a||e[13]!==h||e[14]!==p||e[15]!==b||e[16]!==w?(x=(0,X.jsxs)("button",{"aria-pressed":a,className:h,"data-testid":p,onClick:i,type:"button",children:[b,w]}),e[11]=i,e[12]=a,e[13]=h,e[14]=p,e[15]=b,e[16]=w,e[17]=x):x=e[17];let _;return e[18]!==g||e[19]!==x?(_=(0,X.jsx)("li",{style:g,children:x}),e[18]=g,e[19]=x,e[20]=_):_=e[20],_},"ge"),ho=n(({header:t,onReload:e,onSelect:o,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let c=te(),[i,u]=(0,tt.useState)(""),d=(0,tt.useRef)(null),g=n(b=>{u(b.target.value)},"l"),m=(0,tt.useMemo)(()=>{let b=i.trim().toLowerCase();return b===""?s:s.filter(w=>w.name.toLowerCase().includes(b))},[i,s]),h=so({count:m.length,estimateSize:n(()=>Br,"estimateSize"),getScrollElement:n(()=>d.current,"getScrollElement"),initialRect:{height:Gr,width:240},observeElementRect:n((b,w)=>io(b,w,Gr),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*Br};return(0,X.jsxs)("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${l}-table-list`,children:[t,(0,X.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,X.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:c("Tables")}),e!==void 0&&(0,X.jsx)("button",{"aria-label":r??c("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${l}-load-tables`,onClick:e,title:r??c("Refresh"),type:"button",children:(0,X.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,X.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})})})]}),(0,X.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,X.jsx)("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${l}-table-search`,onChange:g,placeholder:c("search table\u2026"),type:"search",value:i})}),(0,X.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:d,children:[(0,X.jsx)("li",{"aria-hidden":"true",style:p}),h.map(b=>{let w=m[b.index];return w===void 0?null:(0,X.jsx)(Fi,{item:w,onSelect:o,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"Ae");var f=ke(Dt(),1);var Kr=ke(ct(),1);function ki(t){return Ni(t)||typeof t=="function"||Mi(t)}n(ki,"isReactComponent");function Ni(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}n(Ni,"isClassComponent");function Mi(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}n(Mi,"isExoticComponent");function mt(t,e){return t==null?null:ki(t)?Kr.default.createElement(t,e):t}n(mt,"flexRender");function an(t){if("cell"in t&&t.cell){let e=t.cell,o=e.column.columnDef,l=e,r=o;return l.getIsAggregated?.()?mt(r.aggregatedCell??o.cell,e.getContext()):l.getIsPlaceholder?.()?null:mt(o.cell,e.getContext())}return"header"in t&&t.header?mt(t.header.column.columnDef.header,t.header.getContext()):"footer"in t&&t.footer?mt(t.footer.column.columnDef.footer,t.footer.getContext()):null}n(an,"FlexRender");function Ur(t){let e=Zt(t.source,t.selector,{compare:rt});return typeof t.children=="function"?t.children(e):t.children}n(Ur,"Subscribe");function Jr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}n(Jr,"atomToStore");function sn(t){let{createAtom:e,batch:o}=t,l=e(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:n(()=>{throw new Error("Feature not supported in current reactivity implementation")},"addSubscription"),unmount:n(()=>{throw new Error("Feature not supported in current reactivity implementation")},"unmount"),schedule:t.schedule??(r=>queueMicrotask(r)),batch:o,untrack:n(r=>r(),"untrack"),createReadonlyAtom:n((r,a)=>{let s=a?.compare??Object.is,c=!1,i,u=n(()=>{let g=r();return(!c||!s(i,g))&&(i=g,c=!0),i},"getSnapshot"),d=e(()=>(l.get(),u()),{compare:s});return{get:u,subscribe:d.subscribe.bind(d)}},"createReadonlyAtom"),createWritableAtom:n((r,a)=>e(r,{compare:a?.compare}),"createWritableAtom"),commit:n(()=>{l.set(r=>r+1)},"commit")}}n(sn,"renderPhaseReactivity");function cn(t,e=Object.is){let o=!1,l;return{get:t.get,markCommitted:n(r=>{l=r,o=!0},"markCommitted"),subscribe:n(r=>t.subscribe(a=>{(!o||!e(l,a))&&r(a)}),"subscribe")}}n(cn,"createRenderPhaseSource");function Wr(){return sn({createAtom:hr,batch:br})}n(Wr,"reactReactivity");function wo(t,e){return typeof t=="function"?t(e):t}n(wo,"functionalUpdate");function Re(t){if(Array.isArray(t))return t.map(Re);if(t&&typeof t=="object"){let e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;let o=e===null?j():{},l=Object.keys(t);for(let r=0;r<l.length;r++){let a=l[r];Object.defineProperty(o,a,{configurable:!0,enumerable:!0,value:Re(t[a]),writable:!0})}return o}return t}n(Re,"cloneState");function So(t,e){let o=Object.keys(e),l=t;for(let r=0;r<o.length;r++){let a=o[r];!a.startsWith("_memo_")&&a!=="_cellsCache"&&(l[a]=e[a])}return t}n(So,"copyInstancePropertiesWithoutMemos");function j(){return Object.create(null)}n(j,"makeObjectMap");function Ke(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n(Ke,"hasOwn");function Ge(t,e){return o=>{(e.options.atoms?.[t]??e.baseAtoms[t]).set(l=>wo(o,l))}}n(Ge,"makeStateUpdater");function Qr(t){if(typeof t!="object"||t===null)return!1;if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}n(Qr,"isPlainContainer");function Xr(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}n(Xr,"getEnumerableOwnKeys");var Ii=3;function Pi(t,e){return Yr(t,e,Ii)}n(Pi,"stateSlicesEqual");function Yr(t,e,o){if(Object.is(t,e))return!0;if(o<=0||!Qr(t)||!Qr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=Xr(t),r=Xr(e);if(l.length!==r.length)return!1;let a=t,s=e;for(let c=0;c<l.length;c++){let i=l[c];if(!Object.prototype.propertyIsEnumerable.call(e,i)||!Yr(a[i],s[i],o-1))return!1}return!0}n(Yr,"stateSlicesEqualAtDepth");function xt(t,e,o,l=Pi){let r=`on${e.charAt(0).toUpperCase()}${e.slice(1)}Change`,a=t.options[r];a&&a(s=>{let c=wo(o,s);return l(s,c)?s:c})}n(xt,"setStateSlice");function Zr(t){return t instanceof Function}n(Zr,"isFunction");function el(t,e){let o=[],l=n(r=>{r.forEach(a=>{o.push(a);let s=e(a);s.length&&l(s)})},"recurse");return l(t),o}n(el,"flattenBy");var Ai=n(({fn:t,memoDeps:e,onAfterCompare:o,onAfterUpdate:l,onBeforeCompare:r,onBeforeUpdate:a})=>{let s=[],c;return n(u=>{r?.();let d=e?.(u),g=!d||d.length!==s?.length;if(!g&&d){for(let m=0;m<d.length;m++)if(d[m]!==s[m]){g=!0;break}}return o?.(g),g&&(s=d,a?.(),c=t(...d??[]),l?.(c)),c},"memoizedFn")},"memo");function _o(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}n(_o,"skipFirstRun");var Di=n((t,e)=>{for(t=String(t);t.length<e;)t=" "+t;return t},"pad");function vt({feature:t,fnName:e,objectId:o,onAfterUpdate:l,table:r,...a}){let s,c,i=0,u;function d(h,p){let b=i===0?"(1st run)":p?"(rerun #"+i+")":"(cache)";i++,console.groupCollapsed(`%c\u23F1 ${Di(`${h.toFixed(1)} ms`,12)} %c${b}%c ${e}%c ${o?`(${e.split(".")[0]}Id: ${o})`:""}`,`font-size: .6rem; font-weight: bold; ${p?`color: hsl(
1
+ import{a as dt,b as Or,c as uo}from"./chunk-MVRBX7HB.js";import{d as zr}from"./chunk-R6NJ4ER6.js";import{a as io}from"./chunk-W7CLOQOU.js";import{a as Be}from"./chunk-ODEIAS3V.js";import{c as so}from"./chunk-MHZNDDGI.js";import{a as lo}from"./chunk-MMRSSV2C.js";import{a as ro}from"./chunk-76CCNRPQ.js";import{a as co,b as He,f as Vr,g as Er}from"./chunk-BWS7JUQV.js";import{a as Ot}from"./chunk-SNJ3ZOV2.js";import{a as ao}from"./chunk-JNWK5MJC.js";import{a as Tr}from"./chunk-DUX2Q5UM.js";import{a as rn}from"./chunk-CJ2V577P.js";import"./chunk-QAETUNZX.js";import"./chunk-LMCBMC2V.js";import"./chunk-QF743FSL.js";import{b as yr,c as tn}from"./chunk-CL3JOU6F.js";import{a as ln}from"./chunk-DRHZZ7IN.js";import{a as to,b as xr}from"./chunk-XY5UOZMD.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import{a as Nr}from"./chunk-PAFHBQFL.js";import{a as Fr,b as kr}from"./chunk-EDL46BPM.js";import{a as en}from"./chunk-DWNWEMQK.js";import{b as Cr,c as Rr,f as on}from"./chunk-4KPATTV6.js";import{c as pr,d as br,e as hr,f as rt,g as Zt,h as wr,i as Sr}from"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import{i as vr}from"./chunk-OKZINWBB.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as oo}from"./chunk-NVMQPIRS.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as no}from"./chunk-S3TDGFRE.js";import"./chunk-L27FKJTG.js";import{a as Mr,b as Ir,c as Pr,d as nn,e as Ar,f as Dr}from"./chunk-J3ZEO3PJ.js";import{a as _e}from"./chunk-LYVYUTQY.js";import{b as Zo,c as lt}from"./chunk-KDMDI7KA.js";import{b as Qo,c as Xo,d as Yt,e as fr,n as et}from"./chunk-QB75Q7U4.js";import"./chunk-ZPQBVYNN.js";import{B as te,h as $e,i as je,j as Tt,p as Yo,q as eo,r as Ee,s as ee,w as _r,x as ut}from"./chunk-PN7JHEYW.js";import"./chunk-PDBW6GTJ.js";import{a as At}from"./chunk-A6TVTNKO.js";import{a as ct,b as Dt}from"./chunk-ADABTCDI.js";import{a as n,d as ke}from"./chunk-5PEAXTYQ.js";var Vs=ke(At(),1);var Mt=ke(ct(),1);var G=ke(At(),1),A=ke(ct(),1);var _t=ke(At(),1);var X=ke(Dt(),1),tt=ke(ct(),1);var fi=2166136261,pi=16777619,bi=n((t,e=fi)=>{let o=e;for(let l=0;l<t.length;l+=1)o^=t.charCodeAt(l),o=Math.imul(o,pi);return(o>>>0).toString(16).padStart(8,"0")},"L"),hi=/([a-z\d])([A-Z])/gu,wi=/[\s_-]+/u,Si=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),_i=n(t=>{let e=t.replaceAll(hi,"$1 $2").split(wi).map(l=>l.toLowerCase()).filter(l=>l.length>0),o=new Set(e);for(let l=0;l<e.length-1;l+=1){let r=e[l],a=e[l+1];r===void 0||a===void 0||(o.add(`${r}${a}`),o.add(`${r}_${a}`))}return[...o]},"ae"),$r="\u2022\u2022\u2022",qr=n((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:bi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):$r}catch{return $r}},"U"),jr=n((t,e)=>{let o=new Map;for(let l of t)l.table===e&&o.set(l.column,l.strategy);return o},"V"),xi=n(t=>{for(let e of _i(t))if(Si.has(e))return!0;return!1},"ce"),Hr=n((t,e)=>{let o=e.filter(r=>!t.has(r)&&xi(r));if(o.length===0)return t;let l=new Map(t);for(let r of o)l.set(r,"redact");return l},"j"),Vt=n((t,e,o)=>{if(!o.enabled)return t;let l=o.columns.get(e);return l===void 0?t:qr(t,l)},"_e"),mo=n((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let o={...t};for(let[l,r]of e.columns)l in o&&(o[l]=qr(o[l],r));return o},"ie"),go=n((t,e)=>!e.enabled||e.columns.size===0?t:t.map(o=>mo(o,e)),"Me"),Lr=n(t=>t==null?"\u2205":t===""?"(empty)":Ee(t),"z"),vi=n(t=>{let e=(0,_t.c)(32),{column:o,onFacetFilter:l,state:r}=t,a=te(),s;e[0]!==o||e[1]!==l||e[2]!==r.result?.values?(s=n(w=>{let x=Number(w.currentTarget.dataset.index),_=r.result?.values[x];_!==void 0&&l(o,_.value)},"x"),e[0]=o,e[1]=l,e[2]=r.result?.values,e[3]=s):s=e[3];let c=s,i=`db-facet-${o}`,u;e[4]!==o?(u=(0,X.jsx)("span",{className:"font-medium text-foreground",children:o}),e[4]=o,e[5]=u):u=e[5];let d;e[6]!==r.loading||e[7]!==r.result||e[8]!==a?(d=r.loading&&r.result===null&&(0,X.jsx)("span",{className:"text-muted-foreground",children:a("Loading\u2026")}),e[6]=r.loading,e[7]=r.result,e[8]=a,e[9]=d):d=e[9];let g;e[10]!==r.error?(g=r.error!==null&&(0,X.jsx)("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=g):g=e[11];let m;e[12]!==r.result?.values?(m=r.result?.values??[],e[12]=r.result?.values,e[13]=m):m=e[13];let h;if(e[14]!==o||e[15]!==c||e[16]!==m){let w;e[18]!==o||e[19]!==c?(w=n((x,_)=>(0,X.jsxs)("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":_,"data-testid":`db-facet-value-${o}`,onClick:c,type:"button",children:[(0,X.jsx)("span",{className:"truncate",children:Lr(x.value)}),(0,X.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:x.count})]},Lr(x.value)),"c"),e[18]=o,e[19]=c,e[20]=w):w=e[20],h=m.map(w),e[14]=o,e[15]=c,e[16]=m,e[17]=h}else h=e[17];let p;e[21]!==o||e[22]!==r.result||e[23]!==a?(p=r.result?.truncated===!0&&(0,X.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${o}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=o,e[22]=r.result,e[23]=a,e[24]=p):p=e[24];let b;return e[25]!==i||e[26]!==u||e[27]!==d||e[28]!==g||e[29]!==h||e[30]!==p?(b=(0,X.jsxs)("section",{className:"flex flex-col gap-1","data-testid":i,children:[u,d,g,h,p]}),e[25]=i,e[26]=u,e[27]=d,e[28]=g,e[29]=h,e[30]=p,e[31]=b):b=e[31],b},"ue"),fo=n(t=>{let e=(0,_t.c)(44),{columns:o,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,c=te(),i;e[0]!==s?(i=n(y=>{let{column:k}=y.currentTarget.dataset;k!==void 0&&s(k)},"o"),e[0]=s,e[1]=i):i=e[1];let u=i,d;e[2]!==r?(d=n(y=>r.enabled&&r.columns.has(y),"a"),e[2]=r,e[3]=d):d=e[3];let g=d,m,h,p,b,w,x,_,C;if(e[4]!==o||e[5]!==l||e[6]!==g||e[7]!==c||e[8]!==u){C=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==g?(y=n(N=>!g(N),"y"),e[17]=g,e[18]=y):y=e[18];let k=o.filter(y),P;if(e[19]!==l||e[20]!==g?(P=Object.entries(l).filter(N=>{let[T]=N;return!g(T)}),e[19]=l,e[20]=g,e[21]=P):P=e[21],m=P,k.length===0){C=null;break e}x="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",_="db-facets",b="flex flex-col gap-1.5";let M;e[22]!==c?(M=c("Facets"),e[22]=c,e[23]=M):M=e[23],e[24]!==M?(w=(0,X.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:M}),e[24]=M,e[25]=w):w=e[25],h="flex flex-wrap gap-1";let I;e[26]!==l||e[27]!==u?(I=n(N=>(0,X.jsx)("button",{"aria-pressed":N in l,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":N,"data-testid":`db-facet-toggle-${N}`,onClick:u,type:"button",children:N},N),"A"),e[26]=l,e[27]=u,e[28]=I):I=e[28],p=k.map(I)}e[4]=o,e[5]=l,e[6]=g,e[7]=c,e[8]=u,e[9]=m,e[10]=h,e[11]=p,e[12]=b,e[13]=w,e[14]=x,e[15]=_,e[16]=C}else m=e[9],h=e[10],p=e[11],b=e[12],w=e[13],x=e[14],_=e[15],C=e[16];if(C!==Symbol.for("react.early_return_sentinel"))return C;let F;e[29]!==h||e[30]!==p?(F=(0,X.jsx)("div",{className:h,children:p}),e[29]=h,e[30]=p,e[31]=F):F=e[31];let v;e[32]!==F||e[33]!==b||e[34]!==w?(v=(0,X.jsxs)("div",{className:b,children:[w,F]}),e[32]=F,e[33]=b,e[34]=w,e[35]=v):v=e[35];let R;e[36]!==a||e[37]!==m?(R=m.map(y=>{let[k,P]=y;return(0,X.jsx)(vi,{column:k,onFacetFilter:a,state:P},k)}),e[36]=a,e[37]=m,e[38]=R):R=e[38];let S;return e[39]!==v||e[40]!==R||e[41]!==x||e[42]!==_?(S=(0,X.jsxs)("aside",{className:x,"data-testid":_,children:[v,R]}),e[39]=v,e[40]=R,e[41]=x,e[42]=_,e[43]=S):S=e[43],S},"Te"),po=n(()=>{let[t,e]=(0,tt.useState)({}),o=Be(t),l=(0,tt.useRef)({}),r=n(async(a,s)=>{let c=(l.current[a]??0)+1;l.current[a]=c,e(i=>a in i?{...i,[a]:{error:null,loading:!0,result:i[a]?.result??null}}:i);try{let i=await s(a);if(l.current[a]!==c)return;e(u=>a in u?{...u,[a]:{error:null,loading:!1,result:i}}:u)}catch(i){if(l.current[a]!==c)return;throw e(u=>a in u?{...u,[a]:{error:Tt(i),loading:!1,result:null}}:u),i}},"n");return{clearFacets:n(()=>{e({})},"clearFacets"),facets:t,facetsRef:o,refetchFacets:n(a=>xr(Object.keys(o.current).map(s=>r(s,a))),"refetchFacets"),toggleFacet:n((a,s)=>{if(a in o.current){e(c=>Object.fromEntries(Object.entries(c).filter(([i])=>i!==a)));return}e(c=>({...c,[a]:{error:null,loading:!0,result:null}})),s!==null&&ee(r(a,s))},"toggleFacet")}},"$e"),yi=[],Ci=n(()=>{let t=(0,_t.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:o}=lt(_e.maskPolicies,e);return Array.isArray(o?.columns)?o.columns:yi},"fe"),bo=n(t=>{let e=(0,_t.c)(16),{columns:o,selectedTable:l}=t,r=Ci(),[a,s]=(0,tt.useState)(!0),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n(()=>{s(Ri)},"g"),e[0]=c):c=e[0];let i=c,u;if(e[1]!==o||e[2]!==r||e[3]!==l){let b=jr(r,l??"");u=Hr(b,o),e[1]=o,e[2]=r,e[3]=l,e[4]=u}else u=e[4];let d=u,g;e[5]!==a||e[6]!==r?(g=n((b,w)=>({columns:Hr(jr(r,b),w),enabled:a}),"l"),e[5]=a,e[6]=r,e[7]=g):g=e[7];let m=g,h;e[8]!==d||e[9]!==a?(h={columns:d,enabled:a},e[8]=d,e[9]=a,e[10]=h):h=e[10];let p;return e[11]!==d||e[12]!==a||e[13]!==m||e[14]!==h?(p={maskColumns:d,maskOn:a,maskView:h,maskViewFor:m,onToggleMask:i},e[11]=d,e[12]=a,e[13]=m,e[14]=h,e[15]=p):p=e[15],p},"Re");function Ri(t){return!t}n(Ri,"me");var Br=34,Gr=600,Fi=n(t=>{let e=(0,_t.c)(21),{item:o,onSelect:l,prefix:r,selected:a,start:s}=t,c;e[0]!==o.name||e[1]!==l?(c=n(()=>{l(o.name)},"g"),e[0]=o.name,e[1]=l,e[2]=c):c=e[2];let i=c,u=`translateY(${String(s)}px)`,d;e[3]!==u?(d={insetInline:0,position:"absolute",top:0,transform:u},e[3]=u,e[4]=d):d=e[4];let g=d,m=a?"bg-accent font-medium text-accent-foreground":"text-foreground",h;e[5]!==m?(h=ut("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",m),e[5]=m,e[6]=h):h=e[6];let p=`${r}-table-${o.name}`,b;e[7]!==o.name?(b=(0,X.jsx)("span",{className:"truncate",children:o.name}),e[7]=o.name,e[8]=b):b=e[8];let w;e[9]!==o.rowCount?(w=(0,X.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:o.rowCount}),e[9]=o.rowCount,e[10]=w):w=e[10];let x;e[11]!==i||e[12]!==a||e[13]!==h||e[14]!==p||e[15]!==b||e[16]!==w?(x=(0,X.jsxs)("button",{"aria-pressed":a,className:h,"data-testid":p,onClick:i,type:"button",children:[b,w]}),e[11]=i,e[12]=a,e[13]=h,e[14]=p,e[15]=b,e[16]=w,e[17]=x):x=e[17];let _;return e[18]!==g||e[19]!==x?(_=(0,X.jsx)("li",{style:g,children:x}),e[18]=g,e[19]=x,e[20]=_):_=e[20],_},"ge"),ho=n(({header:t,onReload:e,onSelect:o,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let c=te(),[i,u]=(0,tt.useState)(""),d=(0,tt.useRef)(null),g=n(b=>{u(b.target.value)},"l"),m=(0,tt.useMemo)(()=>{let b=i.trim().toLowerCase();return b===""?s:s.filter(w=>w.name.toLowerCase().includes(b))},[i,s]),h=so({count:m.length,estimateSize:n(()=>Br,"estimateSize"),getScrollElement:n(()=>d.current,"getScrollElement"),initialRect:{height:Gr,width:240},observeElementRect:n((b,w)=>io(b,w,Gr),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*Br};return(0,X.jsxs)("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${l}-table-list`,children:[t,(0,X.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,X.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:c("Tables")}),e!==void 0&&(0,X.jsx)("button",{"aria-label":r??c("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${l}-load-tables`,onClick:e,title:r??c("Refresh"),type:"button",children:(0,X.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,X.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})})})]}),(0,X.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,X.jsx)("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${l}-table-search`,onChange:g,placeholder:c("search table\u2026"),type:"search",value:i})}),(0,X.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:d,children:[(0,X.jsx)("li",{"aria-hidden":"true",style:p}),h.map(b=>{let w=m[b.index];return w===void 0?null:(0,X.jsx)(Fi,{item:w,onSelect:o,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"Ae");var f=ke(Dt(),1);var Kr=ke(ct(),1);function ki(t){return Ni(t)||typeof t=="function"||Mi(t)}n(ki,"isReactComponent");function Ni(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}n(Ni,"isClassComponent");function Mi(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}n(Mi,"isExoticComponent");function mt(t,e){return t==null?null:ki(t)?Kr.default.createElement(t,e):t}n(mt,"flexRender");function an(t){if("cell"in t&&t.cell){let e=t.cell,o=e.column.columnDef,l=e,r=o;return l.getIsAggregated?.()?mt(r.aggregatedCell??o.cell,e.getContext()):l.getIsPlaceholder?.()?null:mt(o.cell,e.getContext())}return"header"in t&&t.header?mt(t.header.column.columnDef.header,t.header.getContext()):"footer"in t&&t.footer?mt(t.footer.column.columnDef.footer,t.footer.getContext()):null}n(an,"FlexRender");function Ur(t){let e=Zt(t.source,t.selector,{compare:rt});return typeof t.children=="function"?t.children(e):t.children}n(Ur,"Subscribe");function Jr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}n(Jr,"atomToStore");function sn(t){let{createAtom:e,batch:o}=t,l=e(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:n(()=>{throw new Error("Feature not supported in current reactivity implementation")},"addSubscription"),unmount:n(()=>{throw new Error("Feature not supported in current reactivity implementation")},"unmount"),schedule:t.schedule??(r=>queueMicrotask(r)),batch:o,untrack:n(r=>r(),"untrack"),createReadonlyAtom:n((r,a)=>{let s=a?.compare??Object.is,c=!1,i,u=n(()=>{let g=r();return(!c||!s(i,g))&&(i=g,c=!0),i},"getSnapshot"),d=e(()=>(l.get(),u()),{compare:s});return{get:u,subscribe:d.subscribe.bind(d)}},"createReadonlyAtom"),createWritableAtom:n((r,a)=>e(r,{compare:a?.compare}),"createWritableAtom"),commit:n(()=>{l.set(r=>r+1)},"commit")}}n(sn,"renderPhaseReactivity");function cn(t,e=Object.is){let o=!1,l;return{get:t.get,markCommitted:n(r=>{l=r,o=!0},"markCommitted"),subscribe:n(r=>t.subscribe(a=>{(!o||!e(l,a))&&r(a)}),"subscribe")}}n(cn,"createRenderPhaseSource");function Wr(){return sn({createAtom:hr,batch:br})}n(Wr,"reactReactivity");function wo(t,e){return typeof t=="function"?t(e):t}n(wo,"functionalUpdate");function Re(t){if(Array.isArray(t))return t.map(Re);if(t&&typeof t=="object"){let e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;let o=e===null?j():{},l=Object.keys(t);for(let r=0;r<l.length;r++){let a=l[r];Object.defineProperty(o,a,{configurable:!0,enumerable:!0,value:Re(t[a]),writable:!0})}return o}return t}n(Re,"cloneState");function So(t,e){let o=Object.keys(e),l=t;for(let r=0;r<o.length;r++){let a=o[r];!a.startsWith("_memo_")&&a!=="_cellsCache"&&(l[a]=e[a])}return t}n(So,"copyInstancePropertiesWithoutMemos");function j(){return Object.create(null)}n(j,"makeObjectMap");function Ke(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n(Ke,"hasOwn");function Ge(t,e){return o=>{(e.options.atoms?.[t]??e.baseAtoms[t]).set(l=>wo(o,l))}}n(Ge,"makeStateUpdater");function Qr(t){if(typeof t!="object"||t===null)return!1;if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}n(Qr,"isPlainContainer");function Xr(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}n(Xr,"getEnumerableOwnKeys");var Ii=3;function Pi(t,e){return Yr(t,e,Ii)}n(Pi,"stateSlicesEqual");function Yr(t,e,o){if(Object.is(t,e))return!0;if(o<=0||!Qr(t)||!Qr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=Xr(t),r=Xr(e);if(l.length!==r.length)return!1;let a=t,s=e;for(let c=0;c<l.length;c++){let i=l[c];if(!Object.prototype.propertyIsEnumerable.call(e,i)||!Yr(a[i],s[i],o-1))return!1}return!0}n(Yr,"stateSlicesEqualAtDepth");function xt(t,e,o,l=Pi){let r=`on${e.charAt(0).toUpperCase()}${e.slice(1)}Change`,a=t.options[r];a&&a(s=>{let c=wo(o,s);return l(s,c)?s:c})}n(xt,"setStateSlice");function Zr(t){return t instanceof Function}n(Zr,"isFunction");function el(t,e){let o=[],l=n(r=>{r.forEach(a=>{o.push(a);let s=e(a);s.length&&l(s)})},"recurse");return l(t),o}n(el,"flattenBy");var Ai=n(({fn:t,memoDeps:e,onAfterCompare:o,onAfterUpdate:l,onBeforeCompare:r,onBeforeUpdate:a})=>{let s=[],c;return n(u=>{r?.();let d=e?.(u),g=!d||d.length!==s?.length;if(!g&&d){for(let m=0;m<d.length;m++)if(d[m]!==s[m]){g=!0;break}}return o?.(g),g&&(s=d,a?.(),c=t(...d??[]),l?.(c)),c},"memoizedFn")},"memo");function _o(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}n(_o,"skipFirstRun");var Di=n((t,e)=>{for(t=String(t);t.length<e;)t=" "+t;return t},"pad");function vt({feature:t,fnName:e,objectId:o,onAfterUpdate:l,table:r,...a}){let s,c,i=0,u;function d(h,p){let b=i===0?"(1st run)":p?"(rerun #"+i+")":"(cache)";i++,console.groupCollapsed(`%c\u23F1 ${Di(`${h.toFixed(1)} ms`,12)} %c${b}%c ${e}%c ${o?`(${e.split(".")[0]}Id: ${o})`:""}`,`font-size: .6rem; font-weight: bold; ${p?`color: hsl(
2
2
  ${Math.max(0,Math.min(120-Math.log10(h)*60,120))}deg 100% 31%);`:""} `,`color: ${i<2?"#FF00FF":"#FF1493"}`,"color: #666","color: #87CEEB"),console.info({feature:t,state:r.store.state,deps:a.memoDeps?.toString()}),console.trace(),console.groupEnd()}return n(d,"logTime"),Ai({...a,...{onAfterUpdate:l?()=>{let{schedule:h,untrack:p}=r._reactivity;h(()=>p(()=>l()))}:void 0}})}n(vt,"tableMemo");function tl(t,e="_"){let[o,l]=t.replace(e," ").split(" ");return{fnKey:l,fnName:`${o}.${l}`,parentName:o}}n(tl,"getFunctionNameInfo");function fe(t,e,o){for(let[l,{fn:r,memoDeps:a}]of Object.entries(o)){let{fnKey:s,fnName:c}=tl(l);e[s]=a?vt({memoDeps:a,fn:r,fnName:c,table:e,feature:t}):r}}n(fe,"assignTableAPIs");function ue(t,e,o,l){for(let[r,{fn:a,memoDeps:s}]of Object.entries(l)){let{fnKey:c,fnName:i}=tl(r);if(s){let u=`_memo_${c}`;e[c]=function(...d){if(!this[u]){let g=this;this[u]=vt({memoDeps:n(m=>s(g,m),"memoDeps"),fn:n((...m)=>a(g,...m),"fn"),fnName:i,objectId:g.id,table:o,feature:t})}return this[u](...d)}}else e[c]=function(...u){return a(this,...u)}}}n(ue,"assignPrototypeAPIs");function re(t,e,o,...l){return t[e]?.(...l)??o(t,...l)}n(re,"callMemoOrStaticFn");function ol(t){return t.row.getValue(t.column.id)}n(ol,"cell_getValue");function nl(t){return t.getValue()??t.table.options.renderFallbackValue}n(nl,"cell_renderValue");function rl(t){return{table:t.table,column:t.column,row:t.row,cell:t,getValue:n(()=>t.getValue(),"getValue"),renderValue:n(()=>t.renderValue(),"renderValue")}}n(rl,"cell_getContext");var ll={assignCellPrototype:n((t,e)=>{ue("coreCellsFeature",t,e,{cell_getValue:{fn:n(o=>ol(o),"fn")},cell_renderValue:{fn:n(o=>nl(o),"fn")},cell_getContext:{fn:n(o=>rl(o),"fn"),memoDeps:n(o=>[o],"memoDeps")}})},"assignCellPrototype")};function Ti(t){if(!t._columnPrototype){t._columnPrototype={table:t};let e=Object.values(t._features);for(let o=0;o<e.length;o++)e[o].assignColumnPrototype?.(t._columnPrototype,t)}return t._columnPrototype}n(Ti,"getColumnPrototype");function al(t,e,o,l){let r={...t.getDefaultColumnDef(),...e},a=r.accessorKey,s=a===void 0?void 0:String(a),c=r.id??s?.replaceAll(".","_")??(typeof r.header=="string"?r.header:void 0),i;if(r.accessorFn)i=r.accessorFn;else if(a!==void 0)if(typeof a=="string"&&a.includes(".")){let m=a.split(".");i=n(h=>{let p=h;for(let b=0;b<m.length;b++){let w=m[b];p=p?.[w]}return p},"accessorFn")}else i=n(m=>m[r.accessorKey],"accessorFn");if(!c)throw new Error;let u=Ti(t),d=Object.create(u);d.accessorFn=i,d.columnDef=r,d.columns=[],d.depth=o,d.id=`${String(c)}`,d.parent=l;let g=t._columnInstanceInitFns;for(let m=0;m<g.length;m++)g[m](d);return d}n(al,"constructColumn");function xo(t){return t.getIsVisible?.()??!0}n(xo,"getIsColumnVisible");function un(t){return t.getVisibleLeafColumns?.()??t.getAllLeafColumns()}n(un,"getVisibleLeafColumns");function dn(t,e){let o=t,l=e;return o.getOrderColumnsFn?.()(l)??o._orderGroupedColumns?.(l)??e}n(dn,"orderLeafColumns");function vo(t,e,o,l){return t._orderByColumnPinning?.(e,o,l)??e}n(vo,"orderByColumnPinning");function Pe(t,e){return t.getPinnedVisibleLeafColumns?.(e)??(e&&e!=="center"?[]:un(t))}n(Pe,"getPinnedVisibleLeafColumns");function sl(t,e){return t._expandRows?.(e)??e}n(sl,"expandRowModel");function il(t){t.autoResetExpanded?.()}n(il,"autoResetExpanded");function yo(t){t.autoResetPageIndex?.()}n(yo,"autoResetPageIndex");function cl(t){t.autoResetSorting?.()}n(cl,"autoResetSorting");function ul(t){t.autoResetCellSelection?.()}n(ul,"autoResetCellSelection");function dl(t){return[t,...t.columns.flatMap(e=>e.getFlatColumns())]}n(dl,"column_getFlatColumns");function ml(t){if(t.columns.length){let e=t.columns.flatMap(o=>o.getLeafColumns());return dn(t.table,e)}return[t]}n(ml,"column_getLeafColumns");function gl(t){return{header:n(e=>{let o=e.header.column.columnDef;return o.accessorKey?o.accessorKey:o.accessorFn?o.id:null},"header"),cell:n(e=>e.renderValue()?.toString?.()??null,"cell"),...Object.values(t._features).reduce((e,o)=>Object.assign(e,o.getDefaultColumnDef?.()),{}),...t.options.defaultColumn}}n(gl,"table_getDefaultColumnDef");function fl(t,e,o,l=0){let r=new Array(e.length);for(let a=0;a<e.length;a++){if(!(a in e))continue;let s=e[a],c=al(t,s,l,o),i=s;c.columns=i.columns?fl(t,i.columns,c,l+1):[],r[a]=c}return r}n(fl,"constructColumns");function pl(t){return fl(t,t.options.columns)}n(pl,"table_getAllColumns");function bl(t){return t.getAllColumns().flatMap(e=>e.getFlatColumns())}n(bl,"table_getAllFlatColumns");function hl(t){let e=j(),o=t.getAllFlatColumns();for(let l=0;l<o.length;l++){let r=o[l];e[r.id]=r}return e}n(hl,"table_getAllFlatColumnsById");function wl(t){let e=t.getAllColumns().flatMap(o=>o.getLeafColumns());return dn(t,e)}n(wl,"table_getAllLeafColumns");function Sl(t){let e=j(),o=t.getAllLeafColumns();for(let l=0;l<o.length;l++){let r=o[l];e[r.id]=r}return e}n(Sl,"table_getAllLeafColumnsById");function _l(t,e){return t.getAllFlatColumnsById()[e]}n(_l,"table_getColumn");var xl={assignColumnPrototype:n((t,e)=>{ue("coreColumnsFeature",t,e,{column_getFlatColumns:{fn:n(o=>dl(o),"fn"),memoDeps:n(o=>[o.table.options.columns],"memoDeps")},column_getLeafColumns:{fn:n(o=>ml(o),"fn"),memoDeps:n(o=>[o.table.atoms.columnOrder?.get(),o.table.atoms.grouping?.get(),o.table.options.columns,o.table.options.groupedColumnMode],"memoDeps")}})},"assignColumnPrototype"),constructTableAPIs:n(t=>{fe("coreColumnsFeature",t,{table_getDefaultColumnDef:{fn:n(()=>gl(t),"fn"),memoDeps:n(()=>[t.options.defaultColumn],"memoDeps")},table_getAllColumns:{fn:n(()=>pl(t),"fn"),memoDeps:n(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumns:{fn:n(()=>bl(t),"fn"),memoDeps:n(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumnsById:{fn:n(()=>hl(t),"fn"),memoDeps:n(()=>[t.options.columns],"memoDeps")},table_getAllLeafColumns:{fn:n(()=>wl(t),"fn"),memoDeps:n(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getAllLeafColumnsById:{fn:n(()=>Sl(t),"fn"),memoDeps:n(()=>[t.getAllLeafColumns()],"memoDeps")},table_getColumn:{fn:n(e=>_l(t,e),"fn")}})},"constructTableAPIs")};function Oi(t){if(!t._headerPrototype){t._headerPrototype={table:t};let e=Object.values(t._features);for(let o=0;o<e.length;o++)e[o].assignHeaderPrototype?.(t._headerPrototype,t)}return t._headerPrototype}n(Oi,"getHeaderPrototype");function mn(t,e,o){let l=Oi(t),r=Object.create(l);r.colSpan=0,r.column=e,r.depth=o.depth,r.headerGroup=null,r.id=o.id??e.id,r.index=o.index,r.isPlaceholder=!!o.isPlaceholder,r.placeholderId=o.placeholderId,r.rowSpan=0,r.subHeaders=[];let a=t._headerInstanceInitFns;for(let s=0;s<a.length;s++)a[s](r);return r}n(mn,"constructHeader");function vl(t,e=1){let o=e;for(let l=0;l<t.length;l++){let r=t[l];xo(r)&&r.columns.length&&(o=Math.max(o,vl(r.columns,e+1)))}return o}n(vl,"getMaxHeaderDepth");function Vi(t,e){return t?`${t}_${e}`:String(e)}n(Vi,"formatHeaderGroupId");function Ei(t,e,o,l){let r=t??"";return e&&(r=r?`${r}_${e}`:String(e)),o&&(r=r?`${r}_${o}`:o),l&&(r=r?`${r}_${l}`:l),r}n(Ei,"formatHeaderId");function zi(t,e){let o=0;for(let l=0;l<t.length;l++)t[l].column===e&&o++;return o}n(zi,"countPendingHeadersForColumn");function yl(t,e,o,l,r,a){let s={depth:e,id:Vi(l,e),headers:[]},c=[];for(let i=0;i<t.length;i++){if(!(i in t))continue;let u=t[i],d=c[c.length-1],g=u.column.depth===s.depth,m,h=!1;if(g&&u.column.parent?m=u.column.parent:(m=u.column,h=!0),d&&d.column===m)d.subHeaders.push(u);else{let p=mn(o,m,{id:Ei(l,e,m.id,u.id),isPlaceholder:h,placeholderId:h?String(zi(c,m)):void 0,depth:e,index:c.length});p.subHeaders.push(u),c.push(p)}s.headers.push(u),u.headerGroup=s}for(let i=0;i<a.length;i++)a[i](s);r.push(s),e>0&&yl(c,e-1,o,l,r,a)}n(yl,"constructHeaderGroup");function Cl(t){for(let e=0;e<t.length;e++){let o=t[e];if(!xo(o.column))continue;let l=0;if(o.subHeaders.length){Cl(o.subHeaders);for(let r=0;r<o.subHeaders.length;r++){let a=o.subHeaders[r];xo(a.column)&&(l+=a.colSpan)}}else l=1;if(o.colSpan=l,o.isPlaceholder&&o.subHeaders.length===1&&o.subHeaders[0].column===o.column){let r=1,a=o.subHeaders[0];for(;a;)a.rowSpan=0,r++,a=a.subHeaders.length===1&&a.subHeaders[0].column===o.column?a.subHeaders[0]:void 0;o.rowSpan=r}else o.rowSpan=1}}n(Cl,"updateHeaderSpans");function Rl(t,e,o,l){let r=vl(t),a=[],s=o._headerGroupInstanceInitFns,c=new Array(e.length);for(let i=0;i<e.length;i++)i in e&&(c[i]=mn(o,e[i],{depth:r,index:i}));return yl(c,r-1,o,l,a,s),a.reverse(),Cl(a[0]?.headers??[]),a}n(Rl,"buildHeaderGroups");function Fl(t,e){for(let o=0;o<t.subHeaders.length;o++)Fl(t.subHeaders[o],e);e.push(t)}n(Fl,"collectLeafHeaders");function kl(t){let e=[];return Fl(t,e),e}n(kl,"header_getLeafHeaders");function Nl(t){return{column:t.column,header:t,table:t.column.table}}n(Nl,"header_getContext");function Ml(t){return Rl(t.getAllColumns(),vo(t,un(t),e=>e.id),t)}n(Ml,"table_getHeaderGroups");function Il(t){return[...t.getHeaderGroups()].reverse()}n(Il,"table_getFooterGroups");function Pl(t){let e=t.getHeaderGroups(),o=[];for(let l=0;l<e.length;l++){let r=e[l].headers;for(let a=0;a<r.length;a++)o.push(r[a])}return o}n(Pl,"table_getFlatHeaders");function Al(t){let e=t.getHeaderGroups()[0]?.headers??[],o=[];for(let l=0;l<e.length;l++){let r=e[l].getLeafHeaders();for(let a=0;a<r.length;a++)o.push(r[a])}return o}n(Al,"table_getLeafHeaders");var Dl={assignHeaderPrototype:n((t,e)=>{ue("coreHeadersFeature",t,e,{header_getLeafHeaders:{fn:n(o=>kl(o),"fn"),memoDeps:n(o=>[o.column.table.options.columns],"memoDeps")},header_getContext:{fn:n(o=>Nl(o),"fn"),memoDeps:n(o=>[o.column.table.options.columns],"memoDeps")}})},"assignHeaderPrototype"),constructTableAPIs:n(t=>{fe("coreHeadersFeature",t,{table_getHeaderGroups:{fn:n(()=>Ml(t),"fn"),memoDeps:n(()=>[t.options.columns,t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.options.groupedColumnMode],"memoDeps")},table_getFooterGroups:{fn:n(()=>Il(t),"fn"),memoDeps:n(()=>[t.getHeaderGroups()],"memoDeps")},table_getFlatHeaders:{fn:n(()=>Pl(t),"fn"),memoDeps:n(()=>[t.getHeaderGroups()],"memoDeps")},table_getLeafHeaders:{fn:n(()=>Al(t),"fn"),memoDeps:n(()=>[t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};function $i(t){if(!t._rowPrototype){t._rowPrototype={table:t};let e=Object.values(t._features);for(let o=0;o<e.length;o++)e[o].assignRowPrototype?.(t._rowPrototype,t)}return t._rowPrototype}n($i,"getRowPrototype");var Tl=n((t,e,o,l,r,a,s)=>{let c=$i(t),i=Object.create(c);i._displayIndexCache=-1,i._uniqueValuesCache=j(),i._valuesCache=j(),i.depth=r,i.id=e,i.index=l,i.original=o,i.parentId=s,i.subRows=a??[];let u=t._rowInstanceInitFns;for(let d=0;d<u.length;d++)u[d](i);return i},"constructRow");function Ol(){return t=>vt({feature:"coreRowModelsFeature",table:t,fnName:"table.getCoreRowModel",memoDeps:n(()=>[t.options.data],"memoDeps"),fn:n(()=>ji(t,t.options.data),"fn"),onAfterUpdate:_o(()=>{il(t),yo(t),cl(t),ul(t)})})}n(Ol,"createCoreRowModel");function Vl(t,e,o,l=0,r){let a=[];for(let s=0;s<o.length;s++){let c=o[s],i=Tl(t,t.getRowId(c,s,r),c,s,l,void 0,r?.id);e.flatRows.push(i),e.rowsById[i.id]=i,a.push(i),t.options.getSubRows&&(i.originalSubRows=t.options.getSubRows(c,s),i.originalSubRows?.length&&(i.subRows=Vl(t,e,i.originalSubRows,l+1,i)))}return a}n(Vl,"accessRows");function ji(t,e){let o={rows:[],flatRows:[],rowsById:j()};return o.rows=Vl(t,o,e),o}n(ji,"_createCoreRowModel");function El(t){return t._rowModels.coreRowModel||(t._rowModels.coreRowModel=t.options.features.coreRowModel?.(t)??Ol()(t)),t._rowModels.coreRowModel()}n(El,"table_getCoreRowModel");function zl(t){return t.getCoreRowModel()}n(zl,"table_getPreFilteredRowModel");function $l(t){return t._rowModels.filteredRowModel||(t._rowModels.filteredRowModel=t.options.features.filteredRowModel?.(t)),t.options.manualFiltering||!t._rowModels.filteredRowModel?t.getPreFilteredRowModel():t._rowModels.filteredRowModel()}n($l,"table_getFilteredRowModel");function jl(t){return t.getFilteredRowModel()}n(jl,"table_getPreGroupedRowModel");function Hl(t){return t._rowModels.groupedRowModel||(t._rowModels.groupedRowModel=t.options.features.groupedRowModel?.(t)),t.options.manualGrouping||!t._rowModels.groupedRowModel?t.getPreGroupedRowModel():t._rowModels.groupedRowModel()}n(Hl,"table_getGroupedRowModel");function Ll(t){return t.getGroupedRowModel()}n(Ll,"table_getPreSortedRowModel");function Bl(t){return t._rowModels.sortedRowModel||(t._rowModels.sortedRowModel=t.options.features.sortedRowModel?.(t)),t.options.manualSorting||!t._rowModels.sortedRowModel?t.getPreSortedRowModel():t._rowModels.sortedRowModel()}n(Bl,"table_getSortedRowModel");function Gl(t){return t.getSortedRowModel()}n(Gl,"table_getPreExpandedRowModel");function ql(t){return t._rowModels.expandedRowModel||(t._rowModels.expandedRowModel=t.options.features.expandedRowModel?.(t)),t.options.manualExpanding||!t._rowModels.expandedRowModel?t.getPreExpandedRowModel():t._rowModels.expandedRowModel()}n(ql,"table_getExpandedRowModel");function Kl(t){return t.getExpandedRowModel()}n(Kl,"table_getPrePaginatedRowModel");function Ul(t){return t._rowModels.paginatedRowModel||(t._rowModels.paginatedRowModel=t.options.features.paginatedRowModel?.(t)),t.options.manualPagination||!t._rowModels.paginatedRowModel?t.getPrePaginatedRowModel():t._rowModels.paginatedRowModel()}n(Ul,"table_getPaginatedRowModel");function Jl(t){return t.getPaginatedRowModel()}n(Jl,"table_getRowModel");var Wl={constructTableAPIs:n(t=>{fe("coreRowModelsFeature",t,{table_getCoreRowModel:{fn:n(()=>El(t),"fn")},table_getPreFilteredRowModel:{fn:n(()=>zl(t),"fn")},table_getFilteredRowModel:{fn:n(()=>$l(t),"fn")},table_getPreGroupedRowModel:{fn:n(()=>jl(t),"fn")},table_getGroupedRowModel:{fn:n(()=>Hl(t),"fn")},table_getPreSortedRowModel:{fn:n(()=>Ll(t),"fn")},table_getSortedRowModel:{fn:n(()=>Bl(t),"fn")},table_getPreExpandedRowModel:{fn:n(()=>Gl(t),"fn")},table_getExpandedRowModel:{fn:n(()=>ql(t),"fn")},table_getPrePaginatedRowModel:{fn:n(()=>Kl(t),"fn")},table_getPaginatedRowModel:{fn:n(()=>Ul(t),"fn")},table_getRowModel:{fn:n(()=>Jl(t),"fn")}})},"constructTableAPIs")};function Hi(t){if(!t._cellPrototype){t._cellPrototype={table:t};let e=Object.values(t._features);for(let o=0;o<e.length;o++)e[o].assignCellPrototype?.(t._cellPrototype,t)}return t._cellPrototype}n(Hi,"getCellPrototype");function Ql(t,e,o){let l=Hi(o),r=Object.create(l);r.column=t,r.id=`${e.id}_${t.id}`,r.row=e;let a=o._cellInstanceInitFns;for(let s=0;s<a.length;s++)a[s](r);return r}n(Ql,"constructCell");function Xl(t){let e=t.table.getRowsInDisplayOrder(),o=t._displayIndexCache;return e[o]===t?o:-1}n(Xl,"row_getDisplayIndex");function Yl(t){let e=t.getPrePaginatedRowModel(),o=t.options.paginateExpandedRows===!1?sl(t,e).rows:e.rows;for(let l=0;l<o.length;l++)o[l]._displayIndexCache=l;return o}n(Yl,"table_getRowsInDisplayOrder");function Zl(t,e){if(Ke(t._valuesCache,e))return t._valuesCache[e];let o=t.table.getColumn(e);if(o?.accessorFn)return t._valuesCache[e]=o.accessorFn(t.original,t.index),t._valuesCache[e]}n(Zl,"row_getValue");function ea(t,e){if(Ke(t._uniqueValuesCache,e))return t._uniqueValuesCache[e];let o=t.table.getColumn(e);if(o?.accessorFn)return o.columnDef.getUniqueValues?(t._uniqueValuesCache[e]=o.columnDef.getUniqueValues(t.original,t.index),t._uniqueValuesCache[e]):(t._uniqueValuesCache[e]=[t.getValue(e)],t._uniqueValuesCache[e])}n(ea,"row_getUniqueValues");function ta(t,e){return t.getValue(e)??t.table.options.renderFallbackValue}n(ta,"row_renderValue");function oa(t){return el(t.subRows,e=>e.subRows)}n(oa,"row_getLeafRows");function na(t){let e=t.getCoreRowModel().flatRows,o=0;for(let l=0;l<e.length;l++)o=Math.max(o,e[l].depth);return o}n(na,"table_getMaxSubRowDepth");function ra(t){if(t.parentId)return t.table.getCoreRowModel().rowsById[t.parentId]??t.table.getRow(t.parentId,!0)}n(ra,"row_getParentRow");function la(t){let e=[],o=t;for(;;){let l=o.getParentRow();if(!l)break;e.push(l),o=l}return e.reverse()}n(la,"row_getParentRows");function aa(t){let e=t.table.getAllLeafColumns(),o=t._cellsCache;o||(o=t._cellsCache=new WeakMap);let l=new Array(e.length);for(let r=0;r<e.length;r++){let a=e[r],s=o.get(a);s||(s=Ql(a,t,t.table),o.set(a,s)),l[r]=s}return l}n(aa,"row_getAllCells");function sa(t){let e=j(),o=t.getAllCells();for(let l=0;l<o.length;l++){let r=o[l];e[r.column.id]=r}return e}n(sa,"row_getAllCellsByColumnId");function ia(t,e,o,l){return e.options.getRowId?.(t,o,l)??(l?`${l.id}.${o}`:String(o))}n(ia,"table_getRowId");function ca(t,e,o){let l=(o?t.getPrePaginatedRowModel():t.getRowModel()).rowsById[e];if(!l&&(l=t.getCoreRowModel().rowsById[e],!l))throw new Error;return l}n(ca,"table_getRow");var ua={assignRowPrototype:n((t,e)=>{ue("coreRowsFeature",t,e,{row_getDisplayIndex:{fn:n(o=>Xl(o),"fn")},row_getAllCellsByColumnId:{fn:n(o=>sa(o),"fn"),memoDeps:n(o=>[o.getAllCells()],"memoDeps")},row_getAllCells:{fn:n(o=>aa(o),"fn"),memoDeps:n(o=>[o.table.getAllLeafColumns()],"memoDeps")},row_getLeafRows:{fn:n(o=>oa(o),"fn"),memoDeps:n(o=>[o.subRows],"memoDeps")},row_getParentRow:{fn:n(o=>ra(o),"fn")},row_getParentRows:{fn:n(o=>la(o),"fn")},row_getUniqueValues:{fn:n((o,l)=>ea(o,l),"fn")},row_getValue:{fn:n((o,l)=>Zl(o,l),"fn")},row_renderValue:{fn:n((o,l)=>ta(o,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:n(t=>{fe("coreRowsFeature",t,{table_getRowsInDisplayOrder:{fn:n(()=>Yl(t),"fn"),memoDeps:n(()=>[t.getPrePaginatedRowModel().rows,t.options.paginateExpandedRows,t.options.paginateExpandedRows===!1?t.atoms.expanded?.get():void 0],"memoDeps")},table_getRowId:{fn:n((e,o,l)=>ia(e,t,o,l),"fn")},table_getRow:{fn:n((e,o)=>ca(t,e,o),"fn")},table_getMaxSubRowDepth:{fn:n(()=>na(t),"fn"),memoDeps:n(()=>[t.getCoreRowModel()],"memoDeps")}})},"constructTableAPIs")};function Co(t,e,o=(l,r)=>l===r){let l=e===void 0?t.options.state:e;t._reactivity.batch(()=>{if(l)for(let r in l){let a=t.baseAtoms[r];if(!a)continue;let s=l[r],c=s===void 0?t.initialState[r]:s;o(t._reactivity.untrack(()=>a.get()),c)||a.set(()=>c)}})}n(Co,"table_syncExternalStateToBaseAtoms");function Ro(t,e,o=(l,r)=>l===r){t._reactivity.batch(()=>{Co(t,e,o),t._reactivity.commit?.()})}n(Ro,"table_publishExternalState");function gn(t){let e=Re(t.initialState);t._reactivity.batch(()=>{let l=Object.keys(e);for(let r=0;r<l.length;r++){let a=l[r];t.baseAtoms[a].set(e[a])}});let o=Object.values(t._features);for(let l=0;l<o.length;l++)o[l].resetTableInstanceData?.(t)}n(gn,"table_reset");function da(t,e){let{features:o,atoms:l,initialState:r}=t.options;if(!t.options.mergeOptions)return{...t.options,...e,features:o,atoms:l,initialState:r};let a=t.options.mergeOptions(t.options,e),s={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...s,features:{value:o,enumerable:!0,configurable:!0,writable:!0},atoms:{value:l,enumerable:!0,configurable:!0,writable:!0},initialState:{value:r,enumerable:!0,configurable:!0,writable:!0}})}n(da,"table_mergeOptions");function Et(t,e,o){let l=da(t,wo(e,t.options));t.optionsStore?t.optionsStore.set(()=>l):t.options=l,o?.syncExternalState!==!1&&Ro(t,l.state??null)}n(Et,"table_setOptions");var ma={constructTableAPIs:n(t=>{fe("coreTablesFeature",t,{table_reset:{fn:n(()=>gn(t),"fn")},table_setOptions:{fn:n(e=>Et(t,e),"fn")}})},"constructTableAPIs")};var ga={coreCellsFeature:ll,coreColumnsFeature:xl,coreHeadersFeature:Dl,coreRowModelsFeature:Wl,coreRowsFeature:ua,coreTablesFeature:ma};function fa(t,e={}){return Object.values(t).forEach(o=>{e=o.getInitialState?.(e)??e}),Re(e)}n(fa,"getInitialTableState");function fn(t){let e=t.features.coreReactivityFeature,{aggregationFns:o,columnMeta:l,coreRowModel:r,expandedRowModel:a,facetedMinMaxValues:s,facetedRowModel:c,facetedUniqueValues:i,filterFns:u,filterMeta:d,filteredRowModel:g,groupedRowModel:m,paginatedRowModel:h,sortFns:p,sortedRowModel:b,tableMeta:w,...x}=t.features,_={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...ga,...x},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:e,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:o,filterFns:u,sortFns:p},_rowModels:{},atoms:{},baseAtoms:{}},C=Object.values(_._features),F={...C.reduce((R,S)=>Object.assign(R,S.getDefaultTableOptions?.(_)),{}),...t};if(e.wrapExternalAtoms&&F.atoms)for(let[R,S]of Object.entries(F.atoms)){let y=S,k=e.createWritableAtom(y.get(),{debugName:`externalAtom/${R}`});F.atoms[R]=k;let P=!1,M=y.subscribe(N=>{P||k.set(N)}),I=k.subscribe(N=>{P=!0,y.set(N),P=!1});e.addSubscription(M),e.addSubscription(I)}e.createOptionsStore?(_.optionsStore=e.createWritableAtom(F,{debugName:"table/optionsStore"}),Object.defineProperty(_,"options",{configurable:!0,enumerable:!0,get(){return _.optionsStore.get()},set(R){_.optionsStore.set(()=>R)}})):_.options=F,_.initialState=fa(_._features,_.options.initialState);let v=Object.keys(_.initialState);for(let R=0;R<v.length;R++){let S=v[R];_.baseAtoms[S]=e.createWritableAtom(_.initialState[S],{debugName:`table/baseAtoms/${S}`}),_.atoms[S]=e.createReadonlyAtom(()=>{let y=_.options,k=y.atoms?.[S],P=k?k.get():_.baseAtoms[S].get();if(k)return P;let M=y.state;if(M&&Ke(M,S)){let I=M[S];return I===void 0?_.initialState[S]:I}return P},{debugName:`table/atoms/${S}`})}Co(_),_.store=Jr(e.createReadonlyAtom(()=>{let R={};for(let S=0;S<v.length;S++){let y=v[S];R[y]=_.atoms[y].get()}return R},{compare:rt,debugName:"table/store"}));for(let R=0;R<C.length;R++){let S=C[R];S.initTableInstanceData?.(_),S.initCellInstanceData&&_._cellInstanceInitFns.push(S.initCellInstanceData.bind(S)),S.initColumnInstanceData&&_._columnInstanceInitFns.push(S.initColumnInstanceData.bind(S)),S.initHeaderGroupInstanceData&&_._headerGroupInstanceInitFns.push(S.initHeaderGroupInstanceData.bind(S)),S.initHeaderInstanceData&&_._headerInstanceInitFns.push(S.initHeaderInstanceData.bind(S)),S.initRowInstanceData&&_._rowInstanceInitFns.push(S.initRowInstanceData.bind(S)),S.constructTableAPIs?.(_)}return _}n(fn,"constructTable");function pa(){return[]}n(pa,"getDefaultColumnOrderState");function pn(t){let e=n(o=>{let l=j();for(let r=0;r<o.length;r++)l[o[r].id]=r;return l},"buildIndexes");return{all:e(Pe(t)),center:e(Pe(t,"center")),start:e(Pe(t,"start")),end:e(Pe(t,"end"))}}n(pn,"table_getColumnIndexes");function ba(t,e){return re(t.table,"getColumnIndexes",pn)[e==="start"?"start":e==="end"?"end":e==="center"?"center":"all"][t.id]??-1}n(ba,"column_getIndex");function ha(t,e){return Pe(t.table,e)[0]?.id===t.id}n(ha,"column_getIsFirstColumn");function wa(t,e){let o=Pe(t.table,e);return o[o.length-1]?.id===t.id}n(wa,"column_getIsLastColumn");function bn(t,e){xt(t,"columnOrder",e)}n(bn,"table_setColumnOrder");function Sa(t,e){bn(t,e?[]:Re(t.initialState.columnOrder??[]))}n(Sa,"table_resetColumnOrder");function _a(t){let e=t.atoms.columnOrder?.get();return o=>{let l=[];if(!e?.length)l=o;else{let r=new Map;for(let a=0;a<o.length;a++){let s=o[a];r.set(s.id,s)}for(let a=0;a<e.length;a++){let s=e[a],c=r.get(s);c&&(l.push(c),r.delete(s))}for(let a=0;a<o.length;a++){let s=o[a];r.has(s.id)&&l.push(s)}}return Li(t,l)}}n(_a,"table_getOrderColumnsFn");function Li(t,e){let o=t.atoms.grouping?.get()??[],{groupedColumnMode:l}=t.options;if(!o.length||!l)return e;let r=e.filter(c=>!o.includes(c.id));if(l==="remove")return r;let a=new Map;for(let c=0;c<e.length;c++){let i=e[c];a.set(i.id,i)}let s=[];for(let c=0;c<o.length;c++){let i=a.get(o[c]);i&&s.push(i)}return[...s,...r]}n(Li,"orderColumns");var hn={getInitialState:n(t=>({columnOrder:pa(),...t}),"getInitialState"),getDefaultTableOptions:n(t=>({onColumnOrderChange:Ge("columnOrder",t)}),"getDefaultTableOptions"),assignColumnPrototype:n((t,e)=>{ue("columnOrderingFeature",t,e,{column_getIndex:{fn:n((o,l)=>ba(o,l),"fn")},column_getIsFirstColumn:{fn:n((o,l)=>ha(o,l),"fn")},column_getIsLastColumn:{fn:n((o,l)=>wa(o,l),"fn")}})},"assignColumnPrototype"),constructTableAPIs:n(t=>{fe("columnOrderingFeature",t,{table_getColumnIndexes:{fn:n(()=>pn(t),"fn"),memoDeps:n(()=>[t.options.columns,t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")},table_setColumnOrder:{fn:n(e=>bn(t,e),"fn")},table_resetColumnOrder:{fn:n(e=>Sa(t,e),"fn")},table_getOrderColumnsFn:{fn:n(()=>_a(t),"fn"),memoDeps:n(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")}})},"constructTableAPIs")};function xa(){return j()}n(xa,"getDefaultColumnSizingState");function wn(){return{size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER}}n(wn,"getDefaultColumnSizingColumnDef");function gt(t){let e=wn(),o=t.table.atoms.columnSizing?.get(),l=o&&Ke(o,t.id)?o[t.id]:void 0;return Math.min(Math.max(t.columnDef.minSize??e.minSize,l??t.columnDef.size??e.size),t.columnDef.maxSize??e.maxSize)}n(gt,"column_getSize");function Fo(t){let e=j(),o=j(),l=new Array(t.length),r=0;for(let s=0;s<t.length;s++){let c=t[s],i=re(c,"getSize",gt);l[s]=i,e[c.id]=r,r+=i}let a=0;for(let s=t.length-1;s>=0;s--)o[t[s].id]=a,a+=l[s];return{starts:e,afters:o}}n(Fo,"buildColumnOffsets");function ko(t){return{all:Fo(Pe(t)),center:Fo(Pe(t,"center")),start:Fo(Pe(t,"start")),end:Fo(Pe(t,"end"))}}n(ko,"table_getColumnOffsets");function va(t){return t==="start"?"start":t==="end"?"end":t==="center"?"center":"all"}n(va,"toOffsetsKey");function ya(t,e){return re(t.table,"getColumnOffsets",ko)[va(e)].starts[t.id]??0}n(ya,"column_getStart");function Ca(t,e){return re(t.table,"getColumnOffsets",ko)[va(e)].afters[t.id]??0}n(Ca,"column_getAfter");function Ra(t){Ct(t.table,e=>{let o=j(),l=Object.keys(e);for(let r=0;r<l.length;r++){let a=l[r];a!==t.id&&(o[a]=e[a])}return o})}n(Ra,"column_resetSize");function Fa(t){if(!t.subHeaders.length)return gt(t.column);let e=0;for(let o=0;o<t.subHeaders.length;o++)e+=Fa(t.subHeaders[o]);return e}n(Fa,"sumHeaderSize");function yt(t){return Fa(t)}n(yt,"header_getSize");function Sn(t){if(t.index>0){let e=t.headerGroup?.headers[t.index-1];if(e)return re(e,"getStart",Sn)+re(e,"getSize",yt)}return 0}n(Sn,"header_getStart");function Ct(t,e){t.options.onColumnSizingChange?.(e)}n(Ct,"table_setColumnSizing");function ka(t,e){Ct(t,e?j():Object.assign(j(),Re(t.initialState.columnSizing??{})))}n(ka,"table_resetColumnSizing");function _n(t){let e=0;for(let o=0;o<t.length;o++)e+=re(t[o],"getSize",gt);return e}n(_n,"sumColumnSizes");function Na(t){return t.getHeaderGroups()[0]?.headers.reduce((e,o)=>e+yt(o),0)??0}n(Na,"table_getTotalSize");function Ma(t){return _n(Pe(t,"start"))}n(Ma,"table_getStartTotalSize");function Ia(t){return _n(Pe(t,"center"))}n(Ia,"table_getCenterTotalSize");function Pa(t){return _n(Pe(t,"end"))}n(Pa,"table_getEndTotalSize");function Mo(){return{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}}n(Mo,"getDefaultColumnResizingState");function vn(t){return(t.columnDef.enableResizing??!0)&&(t.table.options.enableColumnResizing??!0)}n(vn,"column_getCanResize");function Aa(t){return t.table.atoms.columnResizing?.get()?.isResizingColumn===t.id}n(Aa,"column_getIsResizing");function Da(t,e){let o=t.table.getColumn(t.column.id),l=vn(o);return r=>{if(!l||xn(r)&&r.touches.length>1)return;let a=yt(t),s=t.getLeafHeaders().map(v=>[v.column.id,gt(v.column)]),c=xn(r)?Math.round(r.touches[0].clientX):r.clientX,i=j(),u=n((v,R)=>{if(typeof R!="number")return;let S=o.table,y=S.options.columnResizeMode==="onChange"||v==="end";S._reactivity.batch(()=>{Rt(S,k=>{let P=S.options.columnResizeDirection==="rtl"?-1:1,M=(R-(k.startOffset??0))*P,I=k.startSize??0,N=Math.max(I>0?M/I:0,-.999999);if(y){let T=k.columnSizingStart;for(let O=0;O<T.length;O++){let D=T[O],E=D[1];i[D[0]]=Math.round(Math.max(E>0?E+E*N:M/T.length,0)*100)/100}}return{...k,deltaOffset:M,deltaPercentage:N}}),y&&Ct(S,k=>Object.assign(j(),k,i))})},"updateOffset"),d=null,g=!1,m,h=n(()=>{g?(g=!1,u("move",m),d=requestAnimationFrame(h)):d=null},"flushMove"),p=n(v=>{if(m=v,typeof requestAnimationFrame!="function"){u("move",v);return}if(d!==null){g=!0;return}u("move",v),d=requestAnimationFrame(h)},"onMove"),b=n(v=>{d!==null&&(cancelAnimationFrame(d),d=null,g=!1),o.table._reactivity.batch(()=>{u("end",v??m),Rt(o.table,R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))})},"onEnd"),w=e||(typeof document<"u"?document:null),x={moveHandler:n(v=>p(v.clientX),"moveHandler"),upHandler:n(v=>{w?.removeEventListener("mousemove",x.moveHandler),w?.removeEventListener("mouseup",x.upHandler),b(v.clientX)},"upHandler")},_={moveHandler:n(v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),p(v.touches[0].clientX),!1),"moveHandler"),upHandler:n(v=>{C(),v.cancelable&&(v.preventDefault(),v.stopPropagation()),b(v.touches[0]?.clientX)},"upHandler"),cancelHandler:n(()=>{C(),b()},"cancelHandler")},C=n(()=>{w?.removeEventListener("touchmove",_.moveHandler),w?.removeEventListener("touchend",_.upHandler),w?.removeEventListener("touchcancel",_.cancelHandler)},"removeTouchEvents"),F=Bi()?{passive:!1}:!1;xn(r)?(w?.addEventListener("touchmove",_.moveHandler,F),w?.addEventListener("touchend",_.upHandler,F),w?.addEventListener("touchcancel",_.cancelHandler,F)):(w?.addEventListener("mousemove",x.moveHandler,F),w?.addEventListener("mouseup",x.upHandler,F)),Rt(o.table,v=>({...v,startOffset:c,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:o.id}))}}n(Da,"header_getResizeHandler");function Rt(t,e){t.options.onColumnResizingChange?.(e)}n(Rt,"table_setColumnResizing");function Ta(t,e){Rt(t,e?Mo():Re(t.initialState.columnResizing??Mo()))}n(Ta,"table_resetHeaderSizeInfo");var No=null;function Bi(){if(typeof No=="boolean")return No;let t=!1;try{let e={get passive(){return t=!0,!1}},o=n(()=>{},"noop");window.addEventListener("test",o,e),window.removeEventListener("test",o)}catch{t=!1}return No=t,No}n(Bi,"passiveEventSupported");function xn(t){return t.type==="touchstart"}n(xn,"isTouchStartEvent");var yn={getInitialState:n(t=>({columnResizing:Mo(),...t}),"getInitialState"),getDefaultTableOptions:n(t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnResizingChange:Ge("columnResizing",t)}),"getDefaultTableOptions"),assignColumnPrototype:n((t,e)=>{ue("columnResizingFeature",t,e,{column_getCanResize:{fn:n(o=>vn(o),"fn")},column_getIsResizing:{fn:n(o=>Aa(o),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:n((t,e)=>{ue("columnResizingFeature",t,e,{header_getResizeHandler:{fn:n((o,l)=>Da(o,l),"fn")}})},"assignHeaderPrototype"),constructTableAPIs:n(t=>{fe("columnResizingFeature",t,{table_setColumnResizing:{fn:n(e=>Rt(t,e),"fn")},table_resetHeaderSizeInfo:{fn:n(e=>Ta(t,e),"fn")}})},"constructTableAPIs")};var Cn={getInitialState:n(t=>({columnSizing:xa(),...t}),"getInitialState"),getDefaultColumnDef:n(()=>wn(),"getDefaultColumnDef"),getDefaultTableOptions:n(t=>({onColumnSizingChange:Ge("columnSizing",t)}),"getDefaultTableOptions"),assignColumnPrototype:n((t,e)=>{ue("columnSizingFeature",t,e,{column_getSize:{fn:n(o=>gt(o),"fn"),memoDeps:n(o=>[e.options.columns,e.atoms.columnSizing?.get()?.[o.id]],"memoDeps")},column_getStart:{fn:n((o,l)=>ya(o,l),"fn")},column_getAfter:{fn:n((o,l)=>Ca(o,l),"fn")},column_resetSize:{fn:n(o=>Ra(o),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:n((t,e)=>{ue("columnSizingFeature",t,e,{header_getSize:{fn:n(o=>yt(o),"fn"),memoDeps:n(o=>[e.options.columns,o.column.columns.length>0?e.atoms.columnSizing?.get():e.atoms.columnSizing?.get()?.[o.column.id]],"memoDeps")},header_getStart:{fn:n(o=>Sn(o),"fn"),memoDeps:n(()=>[e.options.columns,e.atoms.columnSizing?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode],"memoDeps")}})},"assignHeaderPrototype"),constructTableAPIs:n(t=>{fe("columnSizingFeature",t,{table_getColumnOffsets:{fn:n(()=>ko(t),"fn"),memoDeps:n(()=>[t.options.columns,t.atoms.columnSizing?.get(),t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")},table_setColumnSizing:{fn:n(e=>Ct(t,e),"fn")},table_resetColumnSizing:{fn:n(e=>ka(t,e),"fn")},table_getTotalSize:{fn:n(()=>Na(t),"fn"),memoDeps:n(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getStartTotalSize:{fn:n(()=>Ma(t),"fn"),memoDeps:n(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getCenterTotalSize:{fn:n(()=>Ia(t),"fn"),memoDeps:n(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getEndTotalSize:{fn:n(()=>Pa(t),"fn"),memoDeps:n(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};function Oa(){return j()}n(Oa,"getDefaultColumnVisibilityState");function Rn(t,e){zt(t)&&$t(t.table,o=>{let l=Object.assign(j(),o),r=e??!re(t,"getIsVisible",We),a=t.getLeafColumns();for(let s=0;s<a.length;s++){let c=a[s];zt(c)&&(l[c.id]=r)}return l})}n(Rn,"column_toggleVisibility");function We(t){let e=t.table.atoms.columnVisibility?.get();if(!e)return!0;let o=t.columns;return o.length?o.some(l=>re(l,"getIsVisible",We)):(Ke(e,t.id)?e[t.id]:void 0)??!0}n(We,"column_getIsVisible");function zt(t){return(t.columnDef.enableHiding??!0)&&(t.table.options.enableHiding??!0)}n(zt,"column_getCanHide");function Va(t){return e=>{Rn(t,e.target.checked)}}n(Va,"column_getToggleVisibilityHandler");function Ea(t){let e=t.getAllCells(),o=[];for(let l=0;l<e.length;l++){let r=e[l];re(r.column,"getIsVisible",We)&&o.push(r)}return vo(t.table,o,l=>l.column.id,()=>re(t,"getVisibleCellsByColumnId",Fn))}n(Ea,"row_getVisibleCells");function Fn(t){let e=j(),o=t.getAllCells();for(let l=0;l<o.length;l++){let r=o[l];re(r.column,"getIsVisible",We)&&(e[r.column.id]=r)}return e}n(Fn,"row_getVisibleCellsByColumnId");function za(t){return t.getAllFlatColumns().filter(e=>re(e,"getIsVisible",We))}n(za,"table_getVisibleFlatColumns");function $a(t){return t.getAllLeafColumns().filter(e=>re(e,"getIsVisible",We))}n($a,"table_getVisibleLeafColumns");function $t(t,e){xt(t,"columnVisibility",e)}n($t,"table_setColumnVisibility");function ja(t,e){$t(t,e?j():Object.assign(j(),Re(t.initialState.columnVisibility??{})))}n(ja,"table_resetColumnVisibility");function kn(t,e){e=e??!Nn(t);let o=j(),l=t.getAllLeafColumns();for(let r=0;r<l.length;r++){let a=l[r];o[a.id]=e||!zt(a)}$t(t,o)}n(kn,"table_toggleAllColumnsVisible");function Nn(t){return!t.getAllLeafColumns().some(e=>!re(e,"getIsVisible",We))}n(Nn,"table_getIsAllColumnsVisible");function Ha(t){return t.getAllLeafColumns().some(e=>re(e,"getIsVisible",We))}n(Ha,"table_getIsSomeColumnsVisible");function La(t){return e=>{kn(t,e.target.checked)}}n(La,"table_getToggleAllColumnsVisibilityHandler");var Mn={getInitialState:n(t=>({columnVisibility:Oa(),...t}),"getInitialState"),getDefaultTableOptions:n(t=>({onColumnVisibilityChange:Ge("columnVisibility",t)}),"getDefaultTableOptions"),assignColumnPrototype:n((t,e)=>{ue("columnVisibilityFeature",t,e,{column_getIsVisible:{fn:n(o=>We(o),"fn"),memoDeps:n(o=>[e.options.columns,e.atoms.columnVisibility?.get(),o.columns],"memoDeps")},column_getCanHide:{fn:n(o=>zt(o),"fn")},column_getToggleVisibilityHandler:{fn:n(o=>Va(o),"fn")},column_toggleVisibility:{fn:n((o,l)=>Rn(o,l),"fn")}})},"assignColumnPrototype"),assignRowPrototype:n((t,e)=>{ue("columnVisibilityFeature",t,e,{row_getVisibleCells:{fn:n(o=>Ea(o),"fn"),memoDeps:n(o=>[o.getAllCells(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get()],"memoDeps")},row_getVisibleCellsByColumnId:{fn:n(o=>Fn(o),"fn"),memoDeps:n(o=>[o.getAllCells(),e.atoms.columnVisibility?.get()],"memoDeps")}})},"assignRowPrototype"),constructTableAPIs:n(t=>{fe("columnVisibilityFeature",t,{table_getVisibleFlatColumns:{fn:n(()=>za(t),"fn"),memoDeps:n(()=>[t.atoms.columnVisibility?.get(),t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getVisibleLeafColumns:{fn:n(()=>$a(t),"fn"),memoDeps:n(()=>[t.atoms.columnVisibility?.get(),t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_setColumnVisibility:{fn:n(e=>$t(t,e),"fn")},table_resetColumnVisibility:{fn:n(e=>ja(t,e),"fn")},table_toggleAllColumnsVisible:{fn:n(e=>kn(t,e),"fn")},table_getIsAllColumnsVisible:{fn:n(()=>Nn(t),"fn")},table_getIsSomeColumnsVisible:{fn:n(()=>Ha(t),"fn")},table_getToggleAllColumnsVisibilityHandler:{fn:n(()=>La(t),"fn")}})},"constructTableAPIs")};function Ba(){return j()}n(Ba,"getDefaultRowSelectionState");function ft(t,e){t.options.onRowSelectionChange?.(e)}n(ft,"table_setRowSelection");function Ga(t,e){t._lastSelectedRowId=null,ft(t,e?j():Object.assign(j(),Re(t.initialState.rowSelection??{})))}n(Ga,"table_resetRowSelection");function In(t,e,o){t._lastSelectedRowId=null,ft(t,l=>{if(e=typeof e<"u"?e:!re(t,"getIsAllRowsSelected",Dn),o?.deselectAll&&!e)return j();let r=Object.assign(j(),l),a=t.getPreGroupedRowModel().flatRows;if(e){let s=new Map;a.forEach(c=>{Io(c,s)&&(r[c.id]=!0)})}else a.forEach(s=>{Qe(s)&&delete r[s.id]});return r})}n(In,"table_toggleAllRowsSelected");function Pn(t,e,o){t._lastSelectedRowId=null,ft(t,l=>{let r=typeof e<"u"?e:!re(t,"getIsAllPageRowsSelected",Tn);if(o?.deselectAll&&!r)return j();let a=Object.assign(j(),l);return t.getRowModel().rows.forEach(s=>{Do(a,s.id,r,!0,t,!0)}),a})}n(Pn,"table_toggleAllPageRowsSelected");function qa(t){return t.getCoreRowModel()}n(qa,"table_getPreSelectedRowModel");function Ka(t){let e=t.getCoreRowModel();return re(t,"getIsSomeRowsSelected",jt)?En(e,t):{rows:[],flatRows:[],rowsById:j()}}n(Ka,"table_getSelectedRowModel");function Ua(t){let e=t.getFilteredRowModel();return re(t,"getIsSomeRowsSelected",jt)?En(e,t):{rows:[],flatRows:[],rowsById:j()}}n(Ua,"table_getFilteredSelectedRowModel");function Ja(t){let e=t.getSortedRowModel();return re(t,"getIsSomeRowsSelected",jt)?En(e,t):{rows:[],flatRows:[],rowsById:j()}}n(Ja,"table_getGroupedSelectedRowModel");function An(t){return Object.keys(t.atoms.rowSelection?.get()??{})}n(An,"table_getSelectedRowIds");function Dn(t){let e=t.getFilteredRowModel().flatRows,o=t.atoms.rowSelection?.get()??{},l=!!(e.length&&Object.keys(o).length);if(l){let r=new Map;e.some(a=>!Ht(a,o)&&Io(a,r))&&(l=!1)}return l}n(Dn,"table_getIsAllRowsSelected");function Tn(t){let e=t.getPaginatedRowModel().flatRows,o=t.atoms.rowSelection?.get()??{},l=new Map,r=!1;for(let a=0;a<e.length;a++){let s=e[a];if(Ht(s,o))!r&&Io(s,l)&&(r=!0);else if(Io(s,l))return!1}return r}n(Tn,"table_getIsAllPageRowsSelected");function jt(t){return re(t,"getSelectedRowIds",An).length>0}n(jt,"table_getIsSomeRowsSelected");function Wa(t){return t.getPaginatedRowModel().flatRows.filter(e=>Qe(e)).some(e=>Po(e)||re(e,"getIsSomeSelected",Vn))}n(Wa,"table_getIsSomePageRowsSelected");function Qa(t){return e=>{In(t,e.target.checked)}}n(Qa,"table_getToggleAllRowsSelectedHandler");function Xa(t){return e=>{Pn(t,e.target.checked)}}n(Xa,"table_getToggleAllPageRowsSelectedHandler");function On(t,e,o){let l=Po(t);ft(t.table,r=>{e=typeof e<"u"?e:!l;let a=Object.assign(j(),r);return Do(a,t.id,e,(o?.selectChildren??!0)&&at(t),t.table),!e&&o?.deselectParents&&es(a,t),a})}n(On,"row_toggleSelected");function Po(t){return Ht(t,t.table.atoms.rowSelection?.get()??{})}n(Po,"row_getIsSelected");function Vn(t){return zn(t)==="some"}n(Vn,"row_getIsSomeSelected");function Ya(t){return zn(t)==="all"}n(Ya,"row_getIsAllSubRowsSelected");function Qe(t){let e=t.table.options;return typeof e.enableRowSelection=="function"?e.enableRowSelection(t):e.enableRowSelection??!0}n(Qe,"row_getCanSelect");function Ao(t){let e=t.table.options;return typeof e.enableSubRowSelection=="function"?e.enableSubRowSelection(t):e.enableSubRowSelection??!0}n(Ao,"row_getCanSelectSubRows");function at(t){let e=t.table.options;return typeof e.enableMultiRowSelection=="function"?e.enableMultiRowSelection(t):e.enableMultiRowSelection??!0}n(at,"row_getCanMultiSelect");function Za(t,e){let o=Qe(t);return l=>{if(!o)return;let r=l,a=t.table,s=r.target.checked,c=a._lastSelectedRowId;(!(a.options.enableRowRangeSelection!==!1&&c!==null&&at(t)&&(a.options.isRowRangeSelectionEvent?.(l)??!1))||!Gi(t,c,s,e))&&On(t,s,e),a._lastSelectedRowId=t.id}}n(Za,"row_getToggleSelectedHandler");function Gi(t,e,o,l){let r=l?.selectChildren??!0,a=t.table,s=a.getRowsInDisplayOrder(),c=a.getPrePaginatedRowModel().rowsById[e]??a.getCoreRowModel().rowsById[e];if(!c)return!1;let i=c.getDisplayIndex(),u=t.getDisplayIndex(),d=s[i],g=s[u];if(i<0||u<0||i>=s.length||u>=s.length||d?.id!==c.id||g?.id!==t.id||!at(c)||!at(t))return!1;let m=Math.min(i,u),h=Math.max(i,u);return ft(a,p=>{let b=Object.assign(j(),p);for(let w=m;w<=h;w++){let x=s[w];!Qe(x)||!at(x)||(Do(b,x.id,o,r,a),!o&&l?.deselectParents&&es(b,x))}return b}),!0}n(Gi,"selectRowRange");function Do(t,e,o,l,r,a){let s=r.getRow(e,!0);o?(at(s)||Object.keys(t).forEach(c=>delete t[c]),Qe(s)&&(t[e]=!0)):(!a||Qe(s))&&delete t[e],l&&s.subRows.length&&Ao(s)&&s.subRows.forEach(c=>Do(t,c.id,o,l,r,a))}n(Do,"mutateRowIsSelected");function Io(t,e){if(!Qe(t))return!1;let o=t.table;if(o.options.enableSubRowSelection===!0)return!0;let l=t.parentId;if(l===void 0)return!0;let r=e.get(l);if(r!==void 0)return r;let a=o.getCoreRowModel().rowsById,s=[],c=!0,i=l;for(;i!==void 0;){let u=e.get(i);if(u!==void 0){c=u;break}s.push(i);let d=a[i]??o.getRow(i,!0);if(!Ao(d)){c=!1;break}i=d.parentId}return s.forEach(u=>e.set(u,c)),c}n(Io,"isRowSelectableInSelectAll");function es(t,e){let o=e.table.getCoreRowModel().rowsById,l=e.parentId;for(;l!==void 0;)delete t[l],l=(o[l]??e.table.getRow(l,!0)).parentId}n(es,"pruneAncestorRowIds");function ts(t,e,o,l){let r=[];for(let a=0;a<t.length;a++){let s=t[a],c=Ht(s,e);if(c&&(o.push(s),l[s.id]=s),s.subRows.length){let i=ts(s.subRows,e,o,l);if(c){let u=Object.create(Object.getPrototypeOf(s));So(u,s),u.subRows=i,r.push(u)}}else c&&r.push(s)}return r}n(ts,"selectRowsRecursively");function En(t,e){let o=[],l=j(),r=e.atoms.rowSelection?.get()??{};return{rows:ts(t.rows,r,o,l),flatRows:o,rowsById:l}}n(En,"selectRowsFn");function Ht(t,e){return!!(Ke(e,t.id)&&e[t.id])}n(Ht,"isRowSelected");function zn(t){if(!t.subRows.length)return!1;let e=t.table.atoms.rowSelection?.get()??{},o=!1,l=!0,r=!1;for(let a=0;a<t.subRows.length;a++){let s=t.subRows[a];if(o&&!l)break;if(Qe(s)&&(r=!0,Ht(s,e)?o=!0:l=!1),s.subRows.length){let c=zn(s);c==="all"?(o=!0,r=!0):c==="some"?(o=!0,l=!1,r=!0):l=!1}}return r?l?"all":o?"some":!1:!1}n(zn,"isSubRowSelected");var $n={initTableInstanceData:n(t=>{t._lastSelectedRowId=null},"initTableInstanceData"),resetTableInstanceData:n(t=>{t._lastSelectedRowId=null},"resetTableInstanceData"),getInitialState:n(t=>({rowSelection:Ba(),...t}),"getInitialState"),getDefaultTableOptions:n(t=>({onRowSelectionChange:Ge("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableRowRangeSelection:!0,enableSubRowSelection:!0,isRowRangeSelectionEvent:n(e=>{let o=e;return!!(o.shiftKey||o.nativeEvent?.shiftKey)},"isRowRangeSelectionEvent")}),"getDefaultTableOptions"),assignRowPrototype:n((t,e)=>{ue("rowSelectionFeature",t,e,{row_toggleSelected:{fn:n((o,l,r)=>On(o,l,r),"fn")},row_getIsSelected:{fn:n(o=>Po(o),"fn")},row_getIsSomeSelected:{fn:n(o=>Vn(o),"fn"),memoDeps:n(o=>[o.subRows,o.table.atoms.rowSelection?.get(),o.table.options.enableRowSelection],"memoDeps")},row_getIsAllSubRowsSelected:{fn:n(o=>Ya(o),"fn"),memoDeps:n(o=>[o.subRows,o.table.atoms.rowSelection?.get(),o.table.options.enableRowSelection],"memoDeps")},row_getCanSelect:{fn:n(o=>Qe(o),"fn")},row_getCanSelectSubRows:{fn:n(o=>Ao(o),"fn")},row_getCanMultiSelect:{fn:n(o=>at(o),"fn")},row_getToggleSelectedHandler:{fn:n((o,l)=>Za(o,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:n(t=>{fe("rowSelectionFeature",t,{table_setRowSelection:{fn:n(e=>ft(t,e),"fn")},table_resetRowSelection:{fn:n(e=>Ga(t,e),"fn")},table_toggleAllRowsSelected:{fn:n((e,o)=>In(t,e,o),"fn")},table_toggleAllPageRowsSelected:{fn:n((e,o)=>Pn(t,e,o),"fn")},table_getPreSelectedRowModel:{fn:n(()=>qa(t),"fn")},table_getSelectedRowModel:{fn:n(()=>Ka(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getCoreRowModel()],"memoDeps")},table_getFilteredSelectedRowModel:{fn:n(()=>Ua(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel()],"memoDeps")},table_getGroupedSelectedRowModel:{fn:n(()=>Ja(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getSortedRowModel()],"memoDeps")},table_getSelectedRowIds:{fn:n(()=>An(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsAllRowsSelected:{fn:n(()=>Dn(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsAllPageRowsSelected:{fn:n(()=>Tn(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsSomeRowsSelected:{fn:n(()=>jt(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsSomePageRowsSelected:{fn:n(()=>Wa(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection],"memoDeps")},table_getToggleAllRowsSelectedHandler:{fn:n(()=>Qa(t),"fn")},table_getToggleAllPageRowsSelectedHandler:{fn:n(()=>Xa(t),"fn")}})},"constructTableAPIs")};var Hn=/([0-9]+)/gm;function Lt(t){let e=Object.assign((o,l,r)=>{let a=o.getValue(r),s=l.getValue(r),c=e.resolveDataValue;return c&&(a=c(a),s=c(s)),e.sort(a,s,o,l,r)},t);return e}n(Lt,"constructSortFn");var Ln=Lt({resolveDataValue:n(t=>ls(t).toLowerCase(),"resolveDataValue"),sort:n((t,e)=>Ki(t,e),"sort")});var Bn=Lt({resolveDataValue:n(t=>ls(t).toLowerCase(),"resolveDataValue"),sort:n((t,e)=>rs(t,e),"sort")});var Gn=Lt({resolveDataValue:n(t=>qi(t),"resolveDataValue"),sort:n((t,e)=>t>e?1:t<e?-1:0,"sort")}),Ft=Lt({sort:n((t,e)=>rs(t,e),"sort")});function rs(t,e){return t===e?0:t>e?1:-1}n(rs,"compareBasic");function qi(t){return t instanceof Date?t.getTime():t}n(qi,"toDateSortValue");function ls(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}n(ls,"toString");function Ki(t,e){let o=0,l=0,r=t.length,a=e.length;for(;o<r&&l<a;){let s=To(t.charCodeAt(o)),c=To(e.charCodeAt(l)),i=jn(t,o,s),u=jn(e,l,c);if(!s&&!c){let g=Ui(t,o,i,e,l,u);if(g)return g;o=i,l=u;continue}if(s!==c)return s?1:-1;let d=Ji(t,o,i,e,l,u);if(d)return d;o=i,l=u}return ns(t,o)-ns(e,l)}n(Ki,"compareAlphanumeric");function To(t){return t>=48&&t<=57}n(To,"isDigit");function jn(t,e,o){let l=e+1;for(;l<t.length&&To(t.charCodeAt(l))===o;)l++;return l}n(jn,"findChunkEnd");function Ui(t,e,o,l,r,a){let s=o-e,c=a-r,i=s<c?s:c;for(let u=0;u<i;u++){let d=t.charCodeAt(e+u),g=l.charCodeAt(r+u);if(d>g)return 1;if(g>d)return-1}return s>c?1:c>s?-1:0}n(Ui,"compareStringChunks");function Ji(t,e,o,l,r,a){let s=e;for(;s<o&&t.charCodeAt(s)===48;)s++;let c=r;for(;c<a&&l.charCodeAt(c)===48;)c++;let i=o-s,u=a-c;if(i===0&&u===0)return 0;if(i<=15&&u<=15){let m=os(t,s,o),h=os(l,c,a);return m>h?1:h>m?-1:0}let d=parseInt(t.slice(e,o),10),g=parseInt(l.slice(r,a),10);return d>g?1:g>d?-1:0}n(Ji,"compareNumericChunks");function os(t,e,o){let l=0;for(let r=e;r<o;r++)l=l*10+t.charCodeAt(r)-48;return l}n(os,"parseSmallInt");function ns(t,e){let o=0,l=e;for(;l<t.length;)o++,l=jn(t,l,To(t.charCodeAt(l)));return o}n(ns,"countRemainingChunks");function as(){return[]}n(as,"getDefaultSortingState");function Gt(t,e){xt(t,"sorting",e)}n(Gt,"table_setSorting");function qn(t,e){Gt(t,e?[]:Re(t.initialState.sorting??[]))}n(qn,"table_resetSorting");function ss(t){t.atoms.sorting&&(t.options.autoResetAll??t.options.autoResetSorting??!1)&&qn(t)}n(ss,"table_autoResetSorting");function Kn(t){let e=t.table._rowModelFns.sortFns,o=t.table.getFilteredRowModel().flatRows.slice(0,10),l,r=!1;for(let a=0;a<o.length;a++){let s=o[a].getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]"){l="datetime";break}if(typeof s=="string"&&(r=!0,s.split(Hn).length>1)){l="alphanumeric";break}}if(!l&&r&&(l="text"),l){let a=e?.[l];if(a||l==="alphanumeric"&&(a=e?.text),a)return a}return Ft}n(Kn,"column_getAutoSortFn");function Un(t){let e=t.table.getFilteredRowModel().flatRows.slice(0,10);for(let o=0;o<e.length;o++){let l=e[o].getValue(t.id);if(l!=null)return typeof l=="string"?"asc":"desc"}return"desc"}n(Un,"column_getAutoSortDir");function Oo(t){let e=t.table._rowModelFns.sortFns;return Zr(t.columnDef.sortFn)?t.columnDef.sortFn:t.columnDef.sortFn==="auto"?Kn(t):e?.[t.columnDef.sortFn]??Ft}n(Oo,"column_getSortFn");function Jn(t,e,o){let l=Qn(t,o&&Bt(t)),r=typeof e<"u";Gt(t.table,a=>{let s=a.findIndex(m=>m.id===t.id),c=s===-1?void 0:a[s],i=[],u,d=r?e:l==="desc",g=!!(a.length&&Bt(t)&&o);return g?c?u="toggle":u="add":c?u="toggle":u="replace",u==="toggle"&&(r||l||(u="remove")),u==="add"?(i=[...a,{id:t.id,desc:d}],i.splice(0,i.length-(t.table.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):u==="toggle"?i=g?a.map(m=>m.id===t.id?{...m,desc:d}:m):[{id:t.id,desc:d}]:u==="remove"?i=g?a.filter(m=>m.id!==t.id):[]:i=[{id:t.id,desc:d}],i})}n(Jn,"column_toggleSorting");function Wn(t){return t.columnDef.sortDescFirst??t.table.options.sortDescFirst??Un(t)==="desc"?"desc":"asc"}n(Wn,"column_getFirstSortDir");function Qn(t,e){let o=Wn(t),l=Xn(t);return l?l!==o&&(t.table.options.enableSortingRemoval??!0)&&(!e||(t.table.options.enableMultiRemove??!0))?!1:l==="desc"?"asc":"desc":o}n(Qn,"column_getNextSortingOrder");function qt(t){return(t.columnDef.enableSorting??!0)&&(t.table.options.enableSorting??!0)&&!!t.accessorFn}n(qt,"column_getCanSort");function Bt(t){return t.columnDef.enableMultiSort??t.table.options.enableMultiSort??!!t.accessorFn}n(Bt,"column_getCanMultiSort");function Xn(t){let e=t.table.atoms.sorting?.get()?.find(o=>o.id===t.id);return e?e.desc?"desc":"asc":!1}n(Xn,"column_getIsSorted");function is(t){return t.table.atoms.sorting?.get()?.findIndex(e=>e.id===t.id)??-1}n(is,"column_getSortIndex");function cs(t){Gt(t.table,e=>e.length?e.filter(o=>o.id!==t.id):[])}n(cs,"column_clearSorting");function us(t){let e=qt(t);return o=>{e&&Jn(t,void 0,Bt(t)?t.table.options.isMultiSortEvent?.(o):!1)}}n(us,"column_getToggleSortingHandler");var Yn={getInitialState(t){return{sorting:as(),...t}},getDefaultColumnDef(){return{sortFn:"auto",sortUndefined:1}},getDefaultTableOptions(t){return{autoResetSorting:!1,onSortingChange:Ge("sorting",t),isMultiSortEvent:n(e=>e.shiftKey,"isMultiSortEvent")}},assignColumnPrototype(t,e){ue("rowSortingFeature",t,e,{column_getAutoSortFn:{fn:n(o=>Kn(o),"fn")},column_getAutoSortDir:{fn:n(o=>Un(o),"fn")},column_getSortFn:{fn:n(o=>Oo(o),"fn")},column_toggleSorting:{fn:n((o,l,r)=>Jn(o,l,r),"fn")},column_getFirstSortDir:{fn:n(o=>Wn(o),"fn")},column_getNextSortingOrder:{fn:n((o,l)=>Qn(o,l),"fn")},column_getCanSort:{fn:n(o=>qt(o),"fn")},column_getCanMultiSort:{fn:n(o=>Bt(o),"fn")},column_getIsSorted:{fn:n(o=>Xn(o),"fn")},column_getSortIndex:{fn:n(o=>is(o),"fn")},column_clearSorting:{fn:n(o=>cs(o),"fn")},column_getToggleSortingHandler:{fn:n(o=>us(o),"fn")}})},constructTableAPIs(t){fe("rowSortingFeature",t,{table_autoResetSorting:{fn:n(()=>ss(t),"fn")},table_setSorting:{fn:n(e=>Gt(t,e),"fn")},table_resetSorting:{fn:n(e=>qn(t,e),"fn")}})}};function Zn(){return t=>{let e=t;return vt({feature:"rowSortingFeature",table:e,fnName:"table.getSortedRowModel",memoDeps:n(()=>[e.atoms.sorting?.get(),e.getPreSortedRowModel()],"memoDeps"),fn:n(()=>Wi(e),"fn"),onAfterUpdate:_o(()=>yo(e))})}}n(Zn,"createSortedRowModel");function Wi(t){let e=t.getPreSortedRowModel(),o=t.atoms.sorting?.get();if(!e.rows.length||!o?.length)return e;let l=[],r=o.filter(i=>{let u=t.getColumn(i.id);return u?qt(u):!1});if(!r.length)return e;let a=[];for(let i=0;i<r.length;i++){let u=r[i],d=t.getColumn(u.id);d&&a.push({id:u.id,desc:u.desc,sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortFn:Oo(d)})}let s=n((i,u)=>{for(let d=0;d<a.length;d++){let g=a[d],m=g.sortUndefined,h=g.desc,p=0;if(m){let b=i.getValue(g.id),w=u.getValue(g.id),x=b===void 0,_=w===void 0;if(x&&_)continue;if(x||_){if(m==="first")return x?-1:1;if(m==="last")return x?1:-1;p=x?m:-m}}if(p===0&&(p=g.sortFn(i,u,g.id)),p!==0)return h&&(p*=-1),g.invertSorting&&(p*=-1),p}return i.index-u.index},"compareRows"),c=n(i=>{let u=i.slice();u.sort(s);let d=!1;for(let g=0;g<u.length;g++){let m=u[g];m!==i[g]&&(d=!0);let h=l.length;if(l.push(m),m.subRows.length){let p=c(m.subRows);if(p.changed){let b=Object.create(Object.getPrototypeOf(m));So(b,m),b.subRows=p.rows,u[g]=b,l[h]=b,d=!0}}}return{rows:u,changed:d}},"sortData");return{rows:c(e.rows).rows,flatRows:l,rowsById:e.rowsById}}n(Wi,"_createSortedRowModel");var st=ke(ct(),1);var Qi=typeof window>"u"?st.useEffect:st.useLayoutEffect;function er(t,e){let[{table:o,rootSource:l}]=(0,st.useState)(()=>{let i=fn({...t,features:{coreReactivityFeature:Wr(),...t.features}});return i.Subscribe=(u=>Ur({...u,source:u.source??i.store})),i.FlexRender=an,{table:i,rootSource:cn(i.store,rt)}}),r=o;Et(r,i=>({...i,...t}),{syncExternalState:!1});let a=r.options.state,s=l.get(),c=Zt(l,e,{compare:rt});return Qi(()=>{l.markCommitted(s),Ro(r,a??null,rt)}),(0,st.useMemo)(()=>({...o,options:t,state:c}),[o,t,c])}n(er,"useTable");var ds=ke(At(),1),ms=ke(ct(),1);var Ce=ke(Dt(),1);var Xi=[{label:"=",value:"eq"},{label:"\u2260",value:"ne"},{label:"<",value:"lt"},{label:"\u2264",value:"lte"},{label:">",value:"gt"},{label:"\u2265",value:"gte"},{label:"contains",value:"contains"}],gs=n(t=>{let e=t.trim(),o=Number(e);return e!==""&&Number.isFinite(o)&&String(o)===e?o:t},"E"),Yi=n(t=>{let e=t.trim();return(e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):void 0)??(e==="true"||e==="false"?e==="true":gs(t))},"G"),Zi=n(t=>t.operator==="has"?Yi(t.value):gs(t.value),"I"),ec=n(t=>t.operator==="contains"?t.value==="":t.operator!=="eq"&&t.operator!=="ne"&&t.literal===void 0&&t.value.trim()==="","J"),tc=n(t=>{if(t.pathSegments!==void 0)return t.pathSegments;let e=t.path??"";return e.trim()===""?void 0:e.split(".").map(o=>o.trim())},"L"),Xe=n(t=>t.filter(e=>e.column!==""&&!ec(e)).map(e=>{let o=tc(e),l=o===void 0?{}:{path:o};return e.operator==="contains"?{column:e.column,operator:e.operator,...l,value:e.value}:{column:e.column,operator:e.operator,...l,value:e.literal===void 0?Zi(e):e.literal[0]}}),"_"),tr=n((t,e)=>({column:t.column,operator:t.operator,path:t.path,pathSegments:t.pathSegments,value:t.value,...e}),"j"),fs=n(t=>{let e=(0,ds.c)(51),{columns:o,filters:l,onAskAi:r,onFiltersChange:a,onSearchChange:s,search:c}=t,[i,u]=(0,ms.useState)(""),d=te(),g;e[0]!==o[0]||e[1]!==l||e[2]!==a?(g=n(()=>{a([...l,{column:o[0]??"",operator:"eq",value:""}])},"T"),e[0]=o[0],e[1]=l,e[2]=a,e[3]=g):g=e[3];let m=g,h;e[4]!==l||e[5]!==a?(h=n(N=>{let T=Number(N.currentTarget.dataset.index);a(l.filter((O,D)=>D!==T))},"w"),e[4]=l,e[5]=a,e[6]=h):h=e[6];let p=h,b;e[7]!==l||e[8]!==a?(b=n(N=>{let T=Number(N.currentTarget.dataset.index),O=N.currentTarget.value;a(l.map((D,E)=>E===T?tr(D,{column:O,path:void 0,pathSegments:void 0}):D))},"y"),e[7]=l,e[8]=a,e[9]=b):b=e[9];let w=b,x;e[10]!==l||e[11]!==a?(x=n(N=>{let T=Number(N.currentTarget.dataset.index),O=N.currentTarget.value;a(l.map((D,E)=>E!==T?D:O==="has"?tr(D,{operator:O}):{...D,operator:O}))},"q"),e[10]=l,e[11]=a,e[12]=x):x=e[12];let _=x,C;e[13]!==l||e[14]!==a?(C=n(N=>{let T=Number(N.currentTarget.dataset.index),O=N.currentTarget.value;a(l.map((D,E)=>E===T?{...D,path:O,pathSegments:void 0}:D))},"k"),e[13]=l,e[14]=a,e[15]=C):C=e[15];let F=C,v;e[16]!==l||e[17]!==a?(v=n(N=>{let T=Number(N.currentTarget.dataset.index),O=N.currentTarget.value;a(l.map((D,E)=>E===T?tr(D,{value:O}):D))},"A"),e[16]=l,e[17]=a,e[18]=v):v=e[18];let R=v,S;e[19]!==s||e[20]!==c?(S=(0,Ce.jsx)("input",{"aria-label":"Search rows","data-testid":"db-filter",onChange:s,placeholder:"search table\u2026",value:c}),e[19]=s,e[20]=c,e[21]=S):S=e[21];let y;e[22]!==m?(y=(0,Ce.jsx)("button",{"data-testid":"db-add-filter",onClick:m,type:"button",children:"Add filter"}),e[22]=m,e[23]=y):y=e[23];let k;e[24]!==i||e[25]!==r?(k=r!==void 0&&(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("input",{"aria-label":"Describe a filter","data-testid":"db-ai-prompt",onChange:n(N=>{u(N.target.value)},"onChange"),onKeyDown:n(N=>{N.key==="Enter"&&i.trim()!==""&&(N.preventDefault(),r(i.trim()))},"onKeyDown"),placeholder:"describe a filter\u2026",value:i}),(0,Ce.jsx)("button",{"data-testid":"db-ai-filter",disabled:i.trim()==="",onClick:n(()=>{r(i.trim())},"onClick"),type:"button",children:"Suggest"})]}),e[24]=i,e[25]=r,e[26]=k):k=e[26];let P;e[27]!==S||e[28]!==y||e[29]!==k?(P=(0,Ce.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[S,y,k]}),e[27]=S,e[28]=y,e[29]=k,e[30]=P):P=e[30];let M;if(e[31]!==w||e[32]!==_||e[33]!==F||e[34]!==R||e[35]!==o||e[36]!==l||e[37]!==p||e[38]!==d){let N;e[40]!==w||e[41]!==_||e[42]!==F||e[43]!==R||e[44]!==o||e[45]!==p||e[46]!==d?(N=n((T,O)=>(0,Ce.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"db-filter-row",children:[(0,Ce.jsx)("select",{"aria-label":"Filter column","data-index":O,"data-testid":"db-filter-column",onChange:w,value:T.column,children:o.map(oc)}),(0,Ce.jsx)("select",{"aria-label":"Filter operator","data-index":O,"data-testid":"db-filter-operator",onChange:_,value:T.operator,children:[...Xi,{label:d("has"),value:"has"}].map(nc)}),(0,Ce.jsx)("input",{"aria-label":d("Nested field path"),"data-index":O,"data-testid":"db-filter-path",onChange:F,placeholder:d("nested path, e.g. geo.city"),value:T.path??""}),(0,Ce.jsx)("input",{"aria-label":"Filter value","data-index":O,"data-testid":"db-filter-value",onChange:R,placeholder:T.operator==="has"?d('value ("10" in quotes matches text)'):"value",value:T.value}),(0,Ce.jsx)("button",{"aria-label":"Remove filter","data-index":O,"data-testid":"db-filter-remove",onClick:p,type:"button",children:"\u2715"})]},O),"r"),e[40]=w,e[41]=_,e[42]=F,e[43]=R,e[44]=o,e[45]=p,e[46]=d,e[47]=N):N=e[47],M=l.map(N),e[31]=w,e[32]=_,e[33]=F,e[34]=R,e[35]=o,e[36]=l,e[37]=p,e[38]=d,e[39]=M}else M=e[39];let I;return e[48]!==P||e[49]!==M?(I=(0,Ce.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"db-filters",children:[P,M]}),e[48]=P,e[49]=M,e[50]=I):I=e[50],I},"ee");function oc(t){return(0,Ce.jsx)("option",{value:t,children:t},t)}n(oc,"M");function nc(t){return(0,Ce.jsx)("option",{value:t.value,children:t.label},t.value)}n(nc,"Q");var rc=n(t=>({tables:Object.entries(t).map(([e,o])=>({fields:o.map(l=>l.name),indexes:[],name:e,relations:o.filter(l=>l.ref!==void 0).map(l=>({field:l.name,kind:"one",name:l.name,onDelete:l.onDelete,references:l.ref,table:e}))}))}),"_o"),lc=n(t=>{let e=new Map,o=new Set;for(let l of t.tables)for(let r of l.relations){if(r.kind!=="one"||r.onDelete==="set null")continue;let a=r.references,s=`${a}\0${l.name}\0${r.field}`;if(o.has(s))continue;o.add(s);let c=e.get(a)??[];c.push({...r,table:l.name}),e.set(a,c)}return e},"Ro"),ac=n((t,e)=>{let o=[],l=[t];for(;l.length>0;){let r=l.shift();if(r===void 0)break;e(r)&&o.push(r);for(let a of r.children)l.push(a)}return o},"$o"),ps=n((t,e)=>{let o=[];for(let[l,r]of Object.entries(e))for(let a of r)a.ref===t&&o.push({column:a.name,table:l});return o.sort((l,r)=>l.table.localeCompare(r.table)||l.column.localeCompare(r.column)),o},"Jt"),ar=n(t=>`${t.table}.${t.column}`,"Ot"),sc=n(t=>{let e=(0,G.c)(111),{columns:o,onApply:l,onClose:r,shardKey:a,table:s,total:c,uniqueColumns:i}=t,u=te(),[d,g]=(0,A.useState)(o[0]??""),[m,h]=(0,A.useState)(""),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=n(me=>{g(me.target.value)},"f"),e[0]=p):p=e[0];let b=p,w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=n(me=>{h(me.target.value)},"h"),e[1]=w):w=e[1];let x=w,_;e[2]!==m?(_=m.trim(),e[2]=m,e[3]=_):_=e[3];let C=_==="",F,v;if(e[4]!==C||e[5]!==u||e[6]!==m){if(!C)try{v=Yt(JSON.parse(m))}catch(me){F=u("Invalid JSON: {message}",{message:me.message})}e[4]=C,e[5]=u,e[6]=m,e[7]=F,e[8]=v}else F=e[7],v=e[8];let R;e[9]!==d||e[10]!==c||e[11]!==i?(R=i.has(d)&&c>1,e[9]=d,e[10]=c,e[11]=i,e[12]=R):R=e[12];let S=R,y=d!==""&&!C&&F===void 0&&!S,k;e[13]!==y||e[14]!==d||e[15]!==l||e[16]!==r||e[17]!==v?(k=n(()=>{y&&(l({[d]:v}),r())},"T"),e[13]=y,e[14]=d,e[15]=l,e[16]=r,e[17]=v,e[18]=k):k=e[18];let P=k,M;e[19]!==u?(M=u("Set a column on matching rows"),e[19]=u,e[20]=M):M=e[20];let I;e[21]!==u?(I=u("Set a column on matching rows"),e[21]=u,e[22]=I):I=e[22];let N;e[23]!==I?(N=(0,f.jsx)("h3",{className:"text-base text-foreground","data-testid":"bulk-patch-title",children:I}),e[23]=I,e[24]=N):N=e[24];let T;e[25]!==u||e[26]!==s||e[27]!==c?(T=u("Writes {total} rows of {table} through the schema-aware writer \u2014 validators and indexes apply, exactly like a mutation.",{table:s,total:c.toString()}),e[25]=u,e[26]=s,e[27]=c,e[28]=T):T=e[28];let O;e[29]!==T?(O=(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-desc",children:T}),e[29]=T,e[30]=O):O=e[30];let D;e[31]!==a||e[32]!==u?(D=a===""?u("Shard: root"):u("Shard: {shardKey} \u2014 rows in other shards are not touched.",{shardKey:a}),e[31]=a,e[32]=u,e[33]=D):D=e[33];let E;e[34]!==D?(E=(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-shard",children:D}),e[34]=D,e[35]=E):E=e[35];let q;e[36]!==O||e[37]!==E||e[38]!==N?(q=(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[N,O,E]}),e[36]=O,e[37]=E,e[38]=N,e[39]=q):q=e[39];let K;e[40]!==u?(K=u("Close"),e[40]=u,e[41]=K):K=e[41];let V;e[42]!==r||e[43]!==K?(V=(0,f.jsx)(oo,{"data-testid":"bulk-patch-close",onClick:r,size:"xs",variant:"ghost",children:K}),e[42]=r,e[43]=K,e[44]=V):V=e[44];let W;e[45]!==q||e[46]!==V?(W=(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[q,V]}),e[45]=q,e[46]=V,e[47]=W):W=e[47];let U;e[48]!==u?(U=u("Column"),e[48]=u,e[49]=U):U=e[49];let Y;e[50]!==U?(Y=(0,f.jsx)(rn,{htmlFor:"bulk-patch-column",children:U}),e[50]=U,e[51]=Y):Y=e[51];let ne;e[52]!==u?(ne=u("Column"),e[52]=u,e[53]=ne):ne=e[53];let oe;e[54]!==o?(oe=o.map(ic),e[54]=o,e[55]=oe):oe=e[55];let ae;e[56]!==d||e[57]!==ne||e[58]!==oe?(ae=(0,f.jsx)("select",{"aria-label":ne,className:"h-8 rounded-md border border-input bg-transparent px-2 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"bulk-patch-column",id:"bulk-patch-column",onChange:b,value:d,children:oe}),e[56]=d,e[57]=ne,e[58]=oe,e[59]=ae):ae=e[59];let de;e[60]!==u?(de=u("Value"),e[60]=u,e[61]=de):de=e[61];let pe;e[62]!==de?(pe=(0,f.jsx)(rn,{htmlFor:"bulk-patch-value",children:de}),e[62]=de,e[63]=pe):pe=e[63];let xe;e[64]!==m?(xe=(0,f.jsx)(vr,{className:"flex-1 font-mono","data-testid":"bulk-patch-value",id:"bulk-patch-value",onChange:x,placeholder:"true",value:m}),e[64]=m,e[65]=xe):xe=e[65];let we;e[66]!==Y||e[67]!==ae||e[68]!==pe||e[69]!==xe?(we=(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[Y,ae,pe,xe]}),e[66]=Y,e[67]=ae,e[68]=pe,e[69]=xe,e[70]=we):we=e[70];let Se;e[71]!==F?(Se=F!==void 0&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-error",role:"alert",children:F}),e[71]=F,e[72]=Se):Se=e[72];let ve;e[73]!==d||e[74]!==u||e[75]!==c||e[76]!==S?(ve=S&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-unique",role:"alert",children:u("{column} has a unique index \u2014 the same value cannot be set on {total} rows.",{column:d,total:c.toString()})}),e[73]=d,e[74]=u,e[75]=c,e[76]=S,e[77]=ve):ve=e[77];let $;e[78]!==C||e[79]!==u||e[80]!==S?($=C&&!S&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-hint",children:u('Enter a JSON value \u2014 for example true, 0, null, or "done".')}),e[78]=C,e[79]=u,e[80]=S,e[81]=$):$=e[81];let Q;e[82]!==y||e[83]!==d||e[84]!==m?(Q=y&&(0,f.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"bulk-patch-preview",children:`${d} = ${m.trim()}`}),e[82]=y,e[83]=d,e[84]=m,e[85]=Q):Q=e[85];let le;e[86]!==u?(le=u("Cancel"),e[86]=u,e[87]=le):le=e[87];let Fe;e[88]!==r||e[89]!==le?(Fe=(0,f.jsx)(oo,{"data-testid":"bulk-patch-cancel",onClick:r,size:"xs",variant:"outline",children:le}),e[88]=r,e[89]=le,e[90]=Fe):Fe=e[90];let Ae=!y,se;e[91]!==u||e[92]!==c?(se=u("Set on {total} rows",{total:c.toString()}),e[91]=u,e[92]=c,e[93]=se):se=e[93];let Z;e[94]!==P||e[95]!==Ae||e[96]!==se?(Z=(0,f.jsx)(oo,{"data-testid":"bulk-patch-apply",disabled:Ae,onClick:P,size:"xs",children:se}),e[94]=P,e[95]=Ae,e[96]=se,e[97]=Z):Z=e[97];let B;e[98]!==Fe||e[99]!==Z?(B=(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[Fe,Z]}),e[98]=Fe,e[99]=Z,e[100]=B):B=e[100];let De;return e[101]!==r||e[102]!==W||e[103]!==we||e[104]!==Se||e[105]!==ve||e[106]!==$||e[107]!==Q||e[108]!==B||e[109]!==M?(De=(0,f.jsxs)(Ot,{label:M,onClose:r,panelTestId:"bulk-patch-panel",testId:"bulk-patch-overlay",variant:"dialog",children:[W,we,Se,ve,$,Q,B]}),e[101]=r,e[102]=W,e[103]=we,e[104]=Se,e[105]=ve,e[106]=$,e[107]=Q,e[108]=B,e[109]=M,e[110]=De):De=e[110],De},"Do");function ic(t){return(0,f.jsx)("option",{value:t,children:t},t)}n(ic,"Ao");var bs=6,Eo=100,cc=n(t=>({paddingLeft:t*16}),"Po"),uc=n(t=>{let e=(0,G.c)(2),{table:o}=t,l=`cascade-restrict-${o}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-destructive/10 px-1 text-destructive","data-testid":l,children:"restrict \u2014 will block delete"}),e[0]=l,e[1]=r):r=e[1],r},"Io"),dc=n(t=>{let e=(0,G.c)(2),{table:o}=t,l=`cascade-cascade-${o}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-warning/10 px-1 text-warning","data-testid":l,children:"cascade"}),e[0]=l,e[1]=r):r=e[1],r},"Oo"),mc=n(t=>{let e=(0,G.c)(2),{table:o}=t,l=`cascade-undeclared-${o}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-muted px-1 text-muted-foreground","data-testid":l,children:"references \u2014 no delete action declared"}),e[0]=l,e[1]=r):r=e[1],r},"Fo"),gc=n(t=>t.relation===void 0||t.relation.onDelete==="cascade"?(0,f.jsx)(dc,{table:t.table}):t.isRestrict?(0,f.jsx)(uc,{table:t.table}):(0,f.jsx)(mc,{table:t.table}),"Mo"),Rs=n(t=>{let e=(0,G.c)(35),{depth:o,node:l}=t,r=`cascade-row-${l.table}`,a;e[0]!==o?(a=cc(o),e[0]=o,e[1]=a):a=e[1];let s;e[2]!==o?(s=o>0&&(0,f.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2514"}),e[2]=o,e[3]=s):s=e[3];let c;e[4]!==l.table?(c=(0,f.jsx)("span",{className:"font-medium text-foreground",children:l.table}),e[4]=l.table,e[5]=c):c=e[5];let i;e[6]!==l.relation||e[7]!==l.table?(i=l.relation!==void 0&&(0,f.jsxs)("span",{className:"text-muted-foreground","data-testid":`cascade-col-${l.table}-${l.relation.field}`,children:["via ",l.relation.field]}),e[6]=l.relation,e[7]=l.table,e[8]=i):i=e[8];let u;e[9]!==l.rowCount?(u=l.rowCount.toString(),e[9]=l.rowCount,e[10]=u):u=e[10];let d;e[11]!==u?(d=(0,f.jsxs)("span",{className:"text-muted-foreground",children:["(",u," rows)"]}),e[11]=u,e[12]=d):d=e[12];let g;e[13]!==l?(g=gc(l),e[13]=l,e[14]=g):g=e[14];let m;e[15]!==l.capNote||e[16]!==l.table?(m=l.capNote!==void 0&&(0,f.jsxs)("span",{className:"italic text-muted-foreground","data-testid":`cascade-cap-${l.table}`,children:["(",l.capNote,")"]}),e[15]=l.capNote,e[16]=l.table,e[17]=m):m=e[17];let h;e[18]!==r||e[19]!==a||e[20]!==s||e[21]!==c||e[22]!==i||e[23]!==d||e[24]!==g||e[25]!==m?(h=(0,f.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 py-1 font-mono text-xs","data-testid":r,style:a,children:[s,c,i,d,g,m]}),e[18]=r,e[19]=a,e[20]=s,e[21]=c,e[22]=i,e[23]=d,e[24]=g,e[25]=m,e[26]=h):h=e[26];let p;if(e[27]!==o||e[28]!==l.children){let w;e[30]!==o?(w=n((x,_)=>(0,f.jsx)(Rs,{depth:o+1,node:x},`${x.table}-${x.relation?.field??"root"}-${_.toString()}`),"h"),e[30]=o,e[31]=w):w=e[31],p=l.children.map(w),e[27]=o,e[28]=l.children,e[29]=p}else p=e[29];let b;return e[32]!==h||e[33]!==p?(b=(0,f.jsxs)(f.Fragment,{children:[h,p]}),e[32]=h,e[33]=p,e[34]=b):b=e[34],b},"an"),fc=n(t=>{let e=t._id??t.id??t.__id__??"";return typeof e=="string"?e:typeof e=="number"?e.toString():""},"Vo"),pc=n(async(t,e,o,l)=>{try{let r=await l(t,e,o),a=r.rows.flatMap(c=>fc(c)||[]).slice(0,Eo),s=r.total??0;return{capNote:s>Eo?`showing first ${Eo.toString()} of ${s.toString()}`:void 0,rowCount:s,rowIds:a}}catch{return{capNote:"count unavailable",rowCount:0,rowIds:[]}}},"Lo"),Fs=n(async(t,e,o,l,r,a,s)=>{let{capNote:c,rowCount:i,rowIds:u}=o===void 0?{capNote:void 0,rowCount:1,rowIds:[e]}:await pc(t,o.field,e,s),d=o?.onDelete==="restrict",g=[],m=`${t}:${e}`,h=a>=bs;if(!r.has(m)&&!h){r.add(m);let b=l.get(t)??[];for(let w of b)for(let x of u.slice(0,10)){let _=await Fs(w.table,x,w,l,r,a+1,s);(_.rowCount>0||a===0)&&g.push(_)}r.delete(m)}let p=c;if(h){let b=`depth capped at ${bs.toString()}`;p=c===void 0?b:`${c}; ${b}`}return{capNote:p,children:g,isRestrict:d,relation:o,rowCount:i,rowIds:u,table:t}},"cn"),bc=n(({onClose:t,onConfirm:e,readPage:o,rowId:l,schema:r,table:a})=>{let s=te(),[c,i]=(0,A.useState)(!0),[u,d]=(0,A.useState)(null),[g,m]=(0,A.useState)(null);(0,A.useEffect)(()=>{let b=!1;return ee((async()=>{try{i(!0),m(null);let w=lc(r);if(!((w.get(a)??[]).length>0)){b||(d({capNote:void 0,children:[],isRestrict:!1,relation:void 0,rowCount:1,rowIds:[l],table:a}),i(!1));return}let x=await Fs(a,l,void 0,w,new Set,0,o);b||(d(x),i(!1))}catch(w){b||(m(w.message),i(!1))}})()),()=>{b=!0}},[l,a]);let h=u!==null&&ac(u,b=>b.isRestrict).length>0,p=n(()=>{e(),t()},"f");return(0,f.jsxs)(Ot,{label:"Cascade impact preview",onClose:t,panelTestId:"cascade-panel",testId:"cascade-overlay",variant:"dialog",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,f.jsx)("h3",{className:"text-base text-foreground","data-testid":"cascade-title",children:s("Cascade impact")}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-desc",children:s("Delete preview \u2014 rows that would cascade or be blocked")})]}),(0,f.jsx)("button",{className:"text-xs text-muted-foreground hover:text-foreground","data-testid":"cascade-close",onClick:t,type:"button",children:s("Close")})]}),c&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-loading",children:s("Loading\u2026")}),g!==null&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"cascade-error",role:"alert",children:g}),!c&&u!==null&&(0,f.jsx)("ul",{className:"flex flex-col","data-testid":"cascade-tree",children:(0,f.jsx)(Rs,{depth:0,node:u})}),!c&&u!==null&&u.children.length===0&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-no-impact",children:s("No related rows found.")}),h&&(0,f.jsx)("p",{className:"text-sm font-medium text-destructive","data-testid":"cascade-blocker-warning",role:"alert",children:s("Restrict relations will block this delete.")}),(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,f.jsx)("button",{className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cascade-cancel",onClick:t,type:"button",children:s("Cancel")}),(0,f.jsx)("button",{className:"rounded-md bg-destructive px-3 py-1.5 text-xs font-medium text-destructive-foreground outline-none transition-colors hover:bg-destructive/90 focus-visible:bg-destructive/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"cascade-confirm",disabled:c,onClick:p,type:"button",children:s("Delete")})]})]})},"Bo"),hc=n((t,e,o,l,r=300)=>{if(l<=0)return{ids:new Set(t.map(g=>g.id)),leadPx:0,tailPx:0};let a=o-r,s=o+l+r,c=new Set,i=0,u=0,d=0;for(let g of t){let m=g.getSize(),h=e.has(g.id),p=i+m>a&&i<s;h||p?c.add(g.id):i<a?u+=m:d+=m,i+=m}return{ids:c,leadPx:u,tailPx:d}},"jo"),wc=n((t,e)=>{let o=new Map,l=0;for(let r of t)e.has(r.id)&&(o.set(r.id,l),l+=r.getSize());return o},"zo"),Sc={columnOrderingFeature:hn,columnResizingFeature:yn,columnSizingFeature:Cn,columnVisibilityFeature:Mn,rowSelectionFeature:$n,rowSortingFeature:Yn,sortedRowModel:Zn(),sortFns:{alphanumeric:Ln,basic:Ft,datetime:Gn,text:Bn}},_c=n(()=>{let t=(0,G.c)(12),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let[o,l]=(0,A.useState)(e),r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n((b,w,x)=>{l(_=>({..._,[b]:{..._[b],[w]:x}}))},"t"),t[1]=r):r=t[1];let a=r,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=n(()=>{l({})},"l"),t[2]=s):s=t[2];let c=s,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n((b,w)=>{l(x=>{let _=x[b];if(_===void 0)return x;let C=Object.fromEntries(Object.entries(_).filter(F=>{let[v,R]=F;return!(v in w)||!Object.is(R,w[v])}));return Object.keys(C).length===0?Object.fromEntries(Object.entries(x).filter(F=>{let[v]=F;return v!==b})):{...x,[b]:C}})},"a"),t[3]=i):i=t[3];let u=i,d;t[4]!==o?(d=n((b,w)=>{let x=o[b];return x!==void 0&&w in x?{value:x[w]}:void 0},"u"),t[4]=o,t[5]=d):d=t[5];let g=d,m;t[6]!==o?(m=Object.values(o).reduce(vc,0),t[6]=o,t[7]=m):m=t[7];let h=m,p;return t[8]!==h||t[9]!==o||t[10]!==g?(p={clear:c,count:h,drop:u,stage:a,staged:o,stagedValue:g},t[8]=h,t[9]=o,t[10]=g,t[11]=p):p=t[11],p},"Ko"),ks=n((t,e)=>{if(typeof e=="number"){let o=Number(t);return t.trim()===""||Number.isNaN(o)?t:o}if(typeof e=="boolean"){if(t==="true")return!0;if(t==="false")return!1}return t},"dn"),xc=n(t=>{let e=(0,G.c)(29),{changes:o,committing:l,onCommit:r,onDiscard:a}=t,s=te(),c;e[0]!==o.length||e[1]!==s?(c=s("{count} pending changes",{count:o.length}),e[0]=o.length,e[1]=s,e[2]=c):c=e[2];let i;e[3]!==c?(i=(0,f.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-warning","data-testid":"db-staged-count",children:c}),e[3]=c,e[4]=i):i=e[4];let u;e[5]!==l||e[6]!==s?(u=s(l?"Committing\u2026":"Commit"),e[5]=l,e[6]=s,e[7]=u):u=e[7];let d;e[8]!==l||e[9]!==r||e[10]!==u?(d=(0,f.jsx)("button",{className:"ms-auto rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"db-staged-commit",disabled:l,onClick:r,type:"button",children:u}),e[8]=l,e[9]=r,e[10]=u,e[11]=d):d=e[11];let g;e[12]!==s?(g=s("Discard"),e[12]=s,e[13]=g):g=e[13];let m;e[14]!==l||e[15]!==a||e[16]!==g?(m=(0,f.jsx)("button",{className:"rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"db-staged-discard",disabled:l,onClick:a,type:"button",children:g}),e[14]=l,e[15]=a,e[16]=g,e[17]=m):m=e[17];let h;e[18]!==i||e[19]!==d||e[20]!==m?(h=(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[i,d,m]}),e[18]=i,e[19]=d,e[20]=m,e[21]=h):h=e[21];let p;e[22]!==o?(p=o.map(yc),e[22]=o,e[23]=p):p=e[23];let b;e[24]!==p?(b=(0,f.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"db-staged-list",children:p}),e[24]=p,e[25]=b):b=e[25];let w;return e[26]!==h||e[27]!==b?(w=(0,f.jsxs)("div",{className:"flex flex-col gap-2 border border-warning/40 bg-warning/5 p-3","data-testid":"db-staged",children:[h,b]}),e[26]=h,e[27]=b,e[28]=w):w=e[28],w},"Go");function vc(t,e){return t+Object.keys(e).length}n(vc,"Jo");function yc(t){return(0,f.jsxs)("li",{className:"flex flex-wrap items-center gap-2 font-mono text-xs",children:[(0,f.jsxs)("span",{className:"text-muted-foreground",children:[t.rowId,".",t.column]}),(0,f.jsx)("span",{className:"text-destructive line-through",children:Ee(t.oldValue)}),(0,f.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2192"}),(0,f.jsx)("span",{className:"text-foreground",children:Ee(t.newValue)})]},`${t.rowId}:${t.column}`)}n(yc,"Wo");var hs=400,Cc=36,Rc={flex:"1 1 0%",minHeight:0,overflow:"auto",position:"relative"},Fc={width:"100%"},kc=/\n$/u,Nc={alignItems:"center",display:"flex",left:0,position:"absolute",top:0,width:"100%"},Mc={display:"flex",width:"100%"},ws={flex:"0 0 8.5rem",padding:"0.375rem 0.75rem"},Ic="2.5rem",Ns={alignItems:"center",display:"flex",flex:"0 0 2.5rem",justifyContent:"center",left:0,padding:"0.375rem 0",position:"sticky",zIndex:2},sr=n(t=>({flex:"0 0 auto",overflow:"hidden",padding:"0.375rem 0.75rem",position:"relative",textOverflow:"ellipsis",whiteSpace:"nowrap",width:`${t.toString()}px`}),"Ft"),Ms=n((t,e)=>({...sr(t),left:`calc(${Ic} + ${e.toString()}px)`,position:"sticky",zIndex:2}),"fn"),or="rounded-md px-2 py-0.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",Pc=n((t,e,o)=>e.enabled&&e.columns.has(o)?void 0:t,"ts"),lr="__back__:",Ac=n(t=>`${lr}${t.table}.${t.column}`,"ns"),Dc=n(t=>{let e=(0,G.c)(3),{counts:o,rowId:l}=t;if(o===void 0){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,f.jsx)("span",{className:"text-muted-foreground/50",children:"\u2014"}),e[0]=s):s=e[0],s}let r=o[l]??0,a;return e[1]!==r?(a=(0,f.jsx)("span",{className:"tabular-nums",children:r}),e[1]=r,e[2]=a):a=e[2],a},"os"),Ye=n(t=>{for(let e of["id","__id__","_id"]){let o=t[e];if(typeof o=="string"||typeof o=="number")return String(o)}return null},"Ie"),Tc=n((t,e)=>{if(e.enumValues!==void 0&&e.enumValues.length>0)return e.enumValues.includes(t)||t===""&&e.nullable===!0?{value:t===""?null:t}:void 0;if(e.type==="boolean")return t==="true"||t==="false"?{value:t==="true"}:void 0;if(e.type==="number"){let o=Number(t);return t.trim()===""||!Number.isFinite(o)?void 0:{value:o}}return{value:t}},"ss"),Oc=n((t,e,o)=>{if(o!==void 0&&o.type!=="any")return Tc(t,o);let l=ks(t,e);return typeof e=="number"&&typeof l!="number"?void 0:{value:l}},"ls"),Vc=n(({anchor:t,columnIds:e,columnMeta:o,editableColumn:l,rows:r,text:a})=>{let s=a.replaceAll(`\r
3
3
  `,`
4
4
  `).replace(kc,"").split(`
@@ -1 +1 @@
1
- import{a as st}from"./chunk-FFECJKHB.js";import"./chunk-T7UKRA6J.js";import{a as tt}from"./chunk-4AGOKKRZ.js";import{a as Ve}from"./chunk-KSATOQ6G.js";import"./chunk-OWRWDDJT.js";import{a as Xe}from"./chunk-DWNWEMQK.js";import{i as Ye}from"./chunk-OKZINWBB.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as ge}from"./chunk-NVMQPIRS.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as xe}from"./chunk-S3TDGFRE.js";import{b as fe}from"./chunk-UV6GPH2E.js";import"./chunk-L27FKJTG.js";import{a as et}from"./chunk-2G5OZPH5.js";import{a as Ze}from"./chunk-S7NFUY75.js";import{a as Re,b as _e,c as Je,d as H,e as L,f as S}from"./chunk-J3ZEO3PJ.js";import"./chunk-IR2MDKXQ.js";import"./chunk-PSBRO6JX.js";import"./chunk-EOFWXI3T.js";import{a as G}from"./chunk-LYVYUTQY.js";import{c as Be}from"./chunk-KE7ZGUGO.js";import{a as ke,e as Oe}from"./chunk-TN4Z3P6S.js";import{n as Ke}from"./chunk-UK5OOCLQ.js";import"./chunk-ZPQBVYNN.js";import{B as O,h as me,i as pe,j as K,p as Ge,s as he,w as He}from"./chunk-PN7JHEYW.js";import"./chunk-PDBW6GTJ.js";import{a as ut}from"./chunk-A6TVTNKO.js";import{a as it,b as ct}from"./chunk-ADABTCDI.js";import{a as c,d as $e}from"./chunk-5PEAXTYQ.js";var $=$e(ut(),1),M=$e(it(),1);var s=$e(ct(),1);var mt=c((n,e)=>{let t=new Set(n.map(a=>a.deadLetterQueue).filter(a=>typeof a=="string"&&a!=="")),o=n.filter(a=>(a.deadLetterQueue===void 0||a.deadLetterQueue==="")&&!t.has(a.name)),r=e.filter(a=>a.deadLettered).length;return{deadLetteredCount:r,queuesWithoutDlq:o,showReliabilityWarning:o.length>0||r>0}},"ct"),We="topic:",je=c(n=>{let e=[],t=new Map;for(let o of n)o.topic===void 0?e.push(o):t.set(o.topic,[...t.get(o.topic)??[],o]);return{plain:e,topics:t}},"Be"),rt=c(n=>`${We}${n}`,"He"),pt=c((n,e)=>n.startsWith(We)?(e.get(n.slice(We.length))??[]).map(t=>t.exportName):[n],"ut"),ht=200,gt=me(G.sendQueueMessage),ft=c(async(n,e,t)=>{let o=(await Promise.allSettled(e.map(async a=>n.query(gt,a,pe(""))))).flatMap((a,l)=>a.status==="rejected"?[{exportName:e[l]?.exportName??"",message:K(a.reason)}]:[]),[r]=o;return r===void 0?null:e.length===1?r.message:t("Not sent to {failed}",{failed:o.map(a=>`${a.exportName}: ${a.message}`).join("; ")})},"ft"),xt=me(G.replayQueueMessage),yt=me(G.clearQueueMessages),at=96,Nt=c(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n,Ge)}catch{return"[unserializable]"}},"xt"),bt=c(n=>n.length>at?`${n.slice(0,at)}\u2026`:n,"yt"),qt=c(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","bt"),vt=c((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"Nt"),nt=c(n=>{let e=(0,$.c)(17),{queue:t}=n,o=`queues-row-${t.exportName}`,r;e[0]!==t.exportName?(r=(0,s.jsx)(S,{className:"font-mono text-xs",children:t.exportName}),e[0]=t.exportName,e[1]=r):r=e[1];let a;e[2]!==t.name?(a=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.name}),e[2]=t.name,e[3]=a):a=e[3];let l;e[4]!==t.mode?(l=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.mode}),e[4]=t.mode,e[5]=l):l=e[5];let d;e[6]!==t.binding?(d=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.binding}),e[6]=t.binding,e[7]=d):d=e[7];let i=t.deadLetterQueue??"\u2014",u;e[8]!==i?(u=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:i}),e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==o||e[11]!==r||e[12]!==a||e[13]!==l||e[14]!==d||e[15]!==u?(p=(0,s.jsxs)(H,{"data-testid":o,children:[r,a,l,d,u]}),e[10]=o,e[11]=r,e[12]=a,e[13]=l,e[14]=d,e[15]=u,e[16]=p):p=e[16],p},"Ve"),St=c(n=>{let e=(0,$.c)(8),{loaded:t,queues:o}=n,r=O(),a;if(e[0]!==t||e[1]!==o||e[2]!==r){let{plain:l,topics:d}=je(o),i;e[4]!==r?(i=r("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[4]=r,e[5]=i):i=e[5];let u;e[6]!==i?(u=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=u):u=e[7],a=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[u,t&&o.length===0?(0,s.jsx)(xe,{description:r("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:r("No queues defined")}):(0,s.jsx)(ke,{className:"overflow-hidden py-0",children:(0,s.jsx)(Oe,{className:"px-0",children:(0,s.jsxs)(Re,{"data-testid":"queues-table",children:[(0,s.jsx)(_e,{children:(0,s.jsxs)(H,{children:[(0,s.jsx)(L,{children:r("Export")}),(0,s.jsx)(L,{children:r("Queue")}),(0,s.jsx)(L,{children:r("Mode")}),(0,s.jsx)(L,{children:r("Binding")}),(0,s.jsx)(L,{children:r("Dead-letter")})]})}),(0,s.jsxs)(Je,{children:[l.map(Et),[...d].map(p=>{let[f,x]=p;return(0,s.jsxs)(M.Fragment,{children:[(0,s.jsx)(H,{className:"bg-muted/40","data-testid":`queues-topic-${f}`,children:(0,s.jsx)(S,{className:"text-xs font-medium",colSpan:5,children:r("Topic {topic} \xB7 {count} subscriptions",{count:x.length,topic:f})})}),x.map(Mt)]},f)})]})]})})})]}),e[0]=t,e[1]=o,e[2]=r,e[3]=a}else a=e[3];return a},"qt"),Ct=c(n=>{let e=(0,$.c)(67),{message:t,onReplay:o,replayingId:r}=n,a=O(),l,d,i,u,p,f,x,m,h,N;if(e[0]!==t.attempts||e[1]!==t.body||e[2]!==t.deadLettered||e[3]!==t.exportName||e[4]!==t.id||e[5]!==t.messageId||e[6]!==t.outcome||e[7]!==t.queue||e[8]!==a){let R=Nt(t.body);d=H,f=`queues-message-${t.id}`;let _=t.exportName??t.queue;e[19]!==_?(x=(0,s.jsx)(S,{className:"font-mono text-xs",children:_}),e[19]=_,e[20]=x):x=e[20],e[21]!==t.messageId?(m=(0,s.jsx)(S,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:t.messageId,children:t.messageId}),e[21]=t.messageId,e[22]=m):m=e[22],e[23]!==t.attempts?(h=(0,s.jsx)(S,{className:"font-mono text-xs tabular-nums",children:t.attempts}),e[23]=t.attempts,e[24]=h):h=e[24];let B=`queues-outcome-${t.id}`,w;e[25]!==t.outcome?(w=qt(t.outcome),e[25]=t.outcome,e[26]=w):w=e[26];let T;e[27]!==t.outcome||e[28]!==B||e[29]!==w?(T=(0,s.jsx)(fe,{"data-testid":B,variant:w,children:t.outcome}),e[27]=t.outcome,e[28]=B,e[29]=w,e[30]=T):T=e[30];let I;e[31]!==t.deadLettered||e[32]!==t.id||e[33]!==a?(I=t.deadLettered&&(0,s.jsx)(fe,{"data-testid":`queues-dlq-${t.id}`,variant:"destructive",children:a("DLQ")}),e[31]=t.deadLettered,e[32]=t.id,e[33]=a,e[34]=I):I=e[34],e[35]!==T||e[36]!==I?(N=(0,s.jsx)(S,{children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[T,I]})}),e[35]=T,e[36]=I,e[37]=N):N=e[37],l=S,i="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=R,p=bt(R),e[0]=t.attempts,e[1]=t.body,e[2]=t.deadLettered,e[3]=t.exportName,e[4]=t.id,e[5]=t.messageId,e[6]=t.outcome,e[7]=t.queue,e[8]=a,e[9]=l,e[10]=d,e[11]=i,e[12]=u,e[13]=p,e[14]=f,e[15]=x,e[16]=m,e[17]=h,e[18]=N}else l=e[9],d=e[10],i=e[11],u=e[12],p=e[13],f=e[14],x=e[15],m=e[16],h=e[17],N=e[18];let y;e[38]!==l||e[39]!==i||e[40]!==u||e[41]!==p?(y=(0,s.jsx)(l,{className:i,title:u,children:p}),e[38]=l,e[39]=i,e[40]=u,e[41]=p,e[42]=y):y=e[42];let b;e[43]!==t.capturedAt?(b=He(t.capturedAt,"\u2014"),e[43]=t.capturedAt,e[44]=b):b=e[44];let C;e[45]!==b?(C=(0,s.jsx)(S,{className:"text-xs text-muted-foreground tabular-nums",children:b}),e[45]=b,e[46]=C):C=e[46];let q=`queues-replay-${t.id}`,v=r!==null,E;e[47]!==t.id||e[48]!==r||e[49]!==a?(E=r===t.id?a("Replaying\u2026"):a("Replay"),e[47]=t.id,e[48]=r,e[49]=a,e[50]=E):E=e[50];let A;e[51]!==t.id||e[52]!==o||e[53]!==q||e[54]!==v||e[55]!==E?(A=(0,s.jsx)(S,{children:(0,s.jsx)(ge,{"data-id":t.id,"data-testid":q,disabled:v,onClick:o,size:"xs",type:"button",variant:"outline",children:E})}),e[51]=t.id,e[52]=o,e[53]=q,e[54]=v,e[55]=E,e[56]=A):A=e[56];let D;return e[57]!==d||e[58]!==C||e[59]!==A||e[60]!==f||e[61]!==x||e[62]!==m||e[63]!==h||e[64]!==N||e[65]!==y?(D=(0,s.jsxs)(d,{"data-testid":f,children:[x,m,h,N,y,C,A]}),e[57]=d,e[58]=C,e[59]=A,e[60]=f,e[61]=x,e[62]=m,e[63]=h,e[64]=N,e[65]=y,e[66]=D):D=e[66],D},"St"),wt=c(n=>{let e=(0,$.c)(29),{hasError:t,messages:o,onClear:r,onReplay:a,replayingId:l}=n,d=O(),i;e[0]!==d?(i=d("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=d,e[1]=i):i=e[1];let u;e[2]!==i?(u=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=u):u=e[3];let p;e[4]!==d?(p=d("Clear the whole message log?"),e[4]=d,e[5]=p):p=e[5];let f=o.length===0,x;e[6]!==d?(x=d("Clear log"),e[6]=d,e[7]=x):x=e[7];let m;e[8]!==r||e[9]!==p||e[10]!==f||e[11]!==x?(m=(0,s.jsx)("div",{className:"ml-auto",children:(0,s.jsx)(Xe,{confirmLabel:p,disabled:f,onConfirm:r,testId:"queues-clear",children:x})}),e[8]=r,e[9]=p,e[10]=f,e[11]=x,e[12]=m):m=e[12];let h;e[13]!==o.length||e[14]!==d?(h=o.length>0&&(0,s.jsx)(fe,{"data-testid":"queues-count",variant:"secondary",children:d("{count} messages",{count:o.length})}),e[13]=o.length,e[14]=d,e[15]=h):h=e[15];let N;e[16]!==u||e[17]!==m||e[18]!==h?(N=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,m,h]}),e[16]=u,e[17]=m,e[18]=h,e[19]=N):N=e[19];let y;e[20]!==t||e[21]!==o||e[22]!==a||e[23]!==l||e[24]!==d?(y=!t&&o.length===0?(0,s.jsx)(xe,{description:d("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:d("No consumed messages yet.")}):(0,s.jsx)(ke,{className:"overflow-hidden py-0",children:(0,s.jsx)(Oe,{className:"px-0",children:(0,s.jsx)(st,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,s.jsxs)(Re,{"data-testid":"queues-messages-table",children:[(0,s.jsx)(_e,{children:(0,s.jsxs)(H,{children:[(0,s.jsx)(L,{children:d("Export")}),(0,s.jsx)(L,{children:d("Message")}),(0,s.jsx)(L,{children:d("Attempts")}),(0,s.jsx)(L,{children:d("Outcome")}),(0,s.jsx)(L,{children:d("Body")}),(0,s.jsx)(L,{children:d("Captured")}),(0,s.jsx)(L,{})]})}),(0,s.jsx)(Je,{children:o.map(C=>(0,s.jsx)(Ct,{message:C,onReplay:a,replayingId:l},C.id))})]})})})}),e[20]=t,e[21]=o,e[22]=a,e[23]=l,e[24]=d,e[25]=y):y=e[25];let b;return e[26]!==N||e[27]!==y?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[N,y]}),e[26]=N,e[27]=y,e[28]=b):b=e[28],b},"Et"),It=c(n=>{let e=(0,$.c)(20),{batchMode:t,bodyText:o,delayText:r,onBatchModeChange:a,onBodyChange:l,onDelayChange:d,onSelectExport:i,onSend:u,queues:p,selectedExportName:f,sending:x}=n,m=O(),h;e[0]!==m?(h=m("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=m,e[1]=h):h=e[1];let N;e[2]!==h?(N=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[2]=h,e[3]=N):N=e[3];let y;e[4]!==t||e[5]!==o||e[6]!==r||e[7]!==a||e[8]!==l||e[9]!==d||e[10]!==i||e[11]!==u||e[12]!==p||e[13]!==f||e[14]!==x||e[15]!==m?(y=p.length===0?(0,s.jsx)(xe,{description:m("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:m("No queues to send to")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("select",{"aria-label":m("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:i,value:f,children:[p.map(At),[...je(p).topics].map(C=>{let[q,v]=C;return(0,s.jsx)("option",{value:rt(q),children:m("{topic} (topic \u2192 {count} subscriptions)",{count:v.length,topic:q})},q)})]}),(0,s.jsx)(Ye,{"aria-label":m("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:d,placeholder:m("Delay (s)"),type:"number",value:r}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,s.jsx)("input",{checked:t,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:a,type:"checkbox"}),m("Send as batch (JSON array)")]}),(0,s.jsx)(ge,{className:"ml-auto","data-testid":"queues-send-button",disabled:x||f==="",onClick:u,type:"button",children:m(x?"Sending\u2026":"Send message")})]}),(0,s.jsx)(tt,{"aria-label":m("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:l,placeholder:t?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:o})]}),e[4]=t,e[5]=o,e[6]=r,e[7]=a,e[8]=l,e[9]=d,e[10]=i,e[11]=u,e[12]=p,e[13]=f,e[14]=x,e[15]=m,e[16]=y):y=e[16];let b;return e[17]!==N||e[18]!==y?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[N,y]}),e[17]=N,e[18]=y,e[19]=b):b=e[19],b},"Tt"),Qt=c((n,e,t,o)=>{let r=null,a=n.trim();if(a!=="")try{r=JSON.parse(a)}catch{return{error:o("Body must be valid JSON.")}}let l,d=e.trim();if(d!==""){let i=Number(d);if(!Number.isFinite(i)||i<0)return{error:o("Delay must be a non-negative number of seconds.")};l=i}return t&&!Array.isArray(r)?{error:o("Batch mode needs a JSON array body \u2014 each element is enqueued as one message.")}:{body:r,delaySeconds:l}},"Ct"),Lt=c(n=>{let e=(0,$.c)(11),{deadLetteredCount:t,queuesWithoutDlq:o}=n,r=O(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,s.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),e[0]=a):a=e[0];let l;e[1]!==o||e[2]!==r?(l=o.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"font-medium",children:r("No dead-letter queue on {queues}.",{queues:o.map(Tt).join(", ")})}),(0,s.jsx)("p",{className:"text-muted-foreground",children:r("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),e[1]=o,e[2]=r,e[3]=l):l=e[3];let d;e[4]!==t||e[5]!==o.length||e[6]!==r?(d=t>0&&(0,s.jsx)("p",{className:o.length>0?"text-muted-foreground":"font-medium",children:t===1?r("1 message was recently dead-lettered."):r("{count} messages were recently dead-lettered.",{count:t})}),e[4]=t,e[5]=o.length,e[6]=r,e[7]=d):d=e[7];let i;return e[8]!==l||e[9]!==d?(i=(0,s.jsx)(Ze,{icon:a,testId:"queues-dlq-warning",variant:"warning",children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[l,d]})}),e[8]=l,e[9]=d,e[10]=i):i=e[10],i},"_t"),Zt=c(n=>{let e=(0,$.c)(76),{limit:t}=n,o=t??ht,r=Ke(),a=O(),[l,d]=(0,M.useState)("declared"),[i,u]=(0,M.useState)(null),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let{data:f,error:x,errorSource:m}=Be(G.listQueues,p),h;e[1]!==o?(h={limit:o},e[1]=o,e[2]=h):h=e[2];let{data:N,error:y,errorSource:b,poll:C,refetch:q}=Be(G.getQueueMessages,h),v=Array.isArray(f?.queues)?[...f.queues].toSorted(Dt):[],E=N?.entries??[],{deadLetteredCount:A,queuesWithoutDlq:D,showReliabilityWarning:R}=mt(v,E),[_,B]=(0,M.useState)(""),[w,T]=(0,M.useState)(""),[I,ye]=(0,M.useState)(""),[k,Ne]=(0,M.useState)(!1),[be,V]=(0,M.useState)(!1),[qe,X]=(0,M.useState)(null),{topics:Y}=je(v),Fe=[...v.map($t),...[...Y.keys()].map(Bt)],J=Fe.includes(_)?_:Fe[0]??"",ze=l==="messages"?y:x,ot=l==="messages"?b:m,ve=ze??i,Se=ze===null?i:ot;Ve(C,l==="messages");let Z;e[3]!==k||e[4]!==w||e[5]!==r||e[6]!==I||e[7]!==q||e[8]!==J||e[9]!==V||e[10]!==a||e[11]!==Y?(Z=c(async()=>{u(null);let g=J;if(g==="")return;let Q=Qt(w,I,k,a);if("error"in Q){u(Q.error);return}let{body:Pe,delaySeconds:Ue}=Q;V(!0);let lt=pt(g,Y).map(ce=>k?{batch:Pe,delaySeconds:Ue,exportName:ce}:{body:Pe,delaySeconds:Ue,exportName:ce});try{u(await ft(r,lt,a)),q()}catch(ce){u(K(ce))}V(!1)},"K"),e[3]=k,e[4]=w,e[5]=r,e[6]=I,e[7]=q,e[8]=J,e[9]=V,e[10]=a,e[11]=Y,e[12]=Z):Z=e[12];let Ce=Z,ee;e[13]!==r||e[14]!==q||e[15]!==X?(ee=c(async g=>{u(null),X(g);try{await r.query(xt,{id:g},pe("")),q()}catch(Q){u(K(Q))}X(null)},"Z"),e[13]=r,e[14]=q,e[15]=X,e[16]=ee):ee=e[16];let we=ee,te;e[17]!==r||e[18]!==q?(te=c(async()=>{u(null);try{await r.query(yt,{},pe("")),q()}catch(g){u(K(g))}},"ee"),e[17]=r,e[18]=q,e[19]=te):te=e[19];let Ie=te,se;e[20]===Symbol.for("react.memo_cache_sentinel")?(se=c(g=>{let Q=g.currentTarget.dataset.tab;(Q==="declared"||Q==="messages"||Q==="send")&&d(Q)},"te"),e[20]=se):se=e[20];let dt=se,ae;e[21]!==B?(ae=c(g=>{B(g.currentTarget.value)},"se"),e[21]=B,e[22]=ae):ae=e[22];let Qe=ae,re;e[23]!==T?(re=c(g=>{T(g.currentTarget.value)},"re"),e[23]=T,e[24]=re):re=e[24];let Le=re,ne;e[25]!==ye?(ne=c(g=>{ye(g.currentTarget.value)},"ae"),e[25]=ye,e[26]=ne):ne=e[26];let Ee=ne,oe;e[27]!==Ne?(oe=c(g=>{Ne(g.currentTarget.checked)},"ne"),e[27]=Ne,e[28]=oe):oe=e[28];let Me=oe,de;e[29]!==Ce?(de=c(()=>{he(Ce())},"oe"),e[29]=Ce,e[30]=de):de=e[30];let Ae=de,le;e[31]!==we?(le=c(g=>{let{id:Q}=g.currentTarget.dataset;Q!==void 0&&he(we(Q))},"le"),e[31]=we,e[32]=le):le=e[32];let Te=le,ie;e[33]!==Ie?(ie=c(()=>{he(Ie())},"ie"),e[33]=Ie,e[34]=ie):ie=e[34];let De=ie,W;e[35]!==a||e[36]!==l?(W=(0,s.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(g=>(0,s.jsx)(ge,{"aria-selected":l===g,"data-tab":g,"data-testid":`queues-tab-${g}`,onClick:dt,role:"tab",size:"sm",type:"button",variant:l===g?"secondary":"ghost",children:vt(g,a)},g))}),e[35]=a,e[36]=l,e[37]=W):W=e[37];let j;e[38]!==ve||e[39]!==Se?(j=ve!==null&&(0,s.jsx)(et,{error:Se,testId:"queues-error"}),e[38]=ve,e[39]=Se,e[40]=j):j=e[40];let F;e[41]!==A||e[42]!==D||e[43]!==R?(F=R&&(0,s.jsx)(Lt,{deadLetteredCount:A,queuesWithoutDlq:D}),e[41]=A,e[42]=D,e[43]=R,e[44]=F):F=e[44];let z;e[45]!==v||e[46]!==f||e[47]!==l?(z=l==="declared"&&(0,s.jsx)(St,{loaded:f!==void 0,queues:v}),e[45]=v,e[46]=f,e[47]=l,e[48]=z):z=e[48];let P;e[49]!==E||e[50]!==y||e[51]!==De||e[52]!==Te||e[53]!==qe||e[54]!==l?(P=l==="messages"&&(0,s.jsx)(wt,{hasError:y!==null,messages:E,onClear:De,onReplay:Te,replayingId:qe}),e[49]=E,e[50]=y,e[51]=De,e[52]=Te,e[53]=qe,e[54]=l,e[55]=P):P=e[55];let U;e[56]!==k||e[57]!==w||e[58]!==I||e[59]!==Me||e[60]!==Le||e[61]!==Ee||e[62]!==Qe||e[63]!==Ae||e[64]!==v||e[65]!==J||e[66]!==be||e[67]!==l?(U=l==="send"&&(0,s.jsx)(It,{batchMode:k,bodyText:w,delayText:I,onBatchModeChange:Me,onBodyChange:Le,onDelayChange:Ee,onSelectExport:Qe,onSend:Ae,queues:v,selectedExportName:J,sending:be}),e[56]=k,e[57]=w,e[58]=I,e[59]=Me,e[60]=Le,e[61]=Ee,e[62]=Qe,e[63]=Ae,e[64]=v,e[65]=J,e[66]=be,e[67]=l,e[68]=U):U=e[68];let ue;return e[69]!==W||e[70]!==j||e[71]!==F||e[72]!==z||e[73]!==P||e[74]!==U?(ue=(0,s.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-queues-panel",children:[W,j,F,z,P,U]}),e[69]=W,e[70]=j,e[71]=F,e[72]=z,e[73]=P,e[74]=U,e[75]=ue):ue=e[75],ue},"ts");function Et(n){return(0,s.jsx)(nt,{queue:n},n.exportName)}c(Et,"vt");function Mt(n){return(0,s.jsx)(nt,{queue:n},n.exportName)}c(Mt,"wt");function At(n){return(0,s.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}c(At,"Qt");function Tt(n){return n.name}c(Tt,"At");function Dt(n,e){return n.exportName.localeCompare(e.exportName)}c(Dt,"It");function $t(n){return n.exportName}c($t,"Mt");function Bt(n){return rt(n)}c(Bt,"Lt");export{Zt as default};
1
+ import{a as st}from"./chunk-FFECJKHB.js";import"./chunk-T7UKRA6J.js";import{a as tt}from"./chunk-4AGOKKRZ.js";import{a as Ve}from"./chunk-XY5UOZMD.js";import"./chunk-OWRWDDJT.js";import{a as Xe}from"./chunk-DWNWEMQK.js";import{i as Ye}from"./chunk-OKZINWBB.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as ge}from"./chunk-NVMQPIRS.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as xe}from"./chunk-S3TDGFRE.js";import{b as fe}from"./chunk-UV6GPH2E.js";import"./chunk-L27FKJTG.js";import{a as et}from"./chunk-VXMAQB2K.js";import{a as Ze}from"./chunk-S7NFUY75.js";import{a as Re,b as _e,c as Je,d as H,e as L,f as S}from"./chunk-J3ZEO3PJ.js";import"./chunk-3R6W72RH.js";import"./chunk-2L3WHXJV.js";import"./chunk-EOFWXI3T.js";import{a as G}from"./chunk-LYVYUTQY.js";import{c as Be}from"./chunk-KDMDI7KA.js";import{a as ke,e as Oe}from"./chunk-TN4Z3P6S.js";import{n as Ke}from"./chunk-QB75Q7U4.js";import"./chunk-ZPQBVYNN.js";import{B as O,h as me,i as pe,j as K,p as Ge,s as he,w as He}from"./chunk-PN7JHEYW.js";import"./chunk-PDBW6GTJ.js";import{a as ut}from"./chunk-A6TVTNKO.js";import{a as it,b as ct}from"./chunk-ADABTCDI.js";import{a as c,d as $e}from"./chunk-5PEAXTYQ.js";var $=$e(ut(),1),M=$e(it(),1);var s=$e(ct(),1);var mt=c((n,e)=>{let t=new Set(n.map(a=>a.deadLetterQueue).filter(a=>typeof a=="string"&&a!=="")),o=n.filter(a=>(a.deadLetterQueue===void 0||a.deadLetterQueue==="")&&!t.has(a.name)),r=e.filter(a=>a.deadLettered).length;return{deadLetteredCount:r,queuesWithoutDlq:o,showReliabilityWarning:o.length>0||r>0}},"ct"),We="topic:",je=c(n=>{let e=[],t=new Map;for(let o of n)o.topic===void 0?e.push(o):t.set(o.topic,[...t.get(o.topic)??[],o]);return{plain:e,topics:t}},"Be"),rt=c(n=>`${We}${n}`,"He"),pt=c((n,e)=>n.startsWith(We)?(e.get(n.slice(We.length))??[]).map(t=>t.exportName):[n],"ut"),ht=200,gt=me(G.sendQueueMessage),ft=c(async(n,e,t)=>{let o=(await Promise.allSettled(e.map(async a=>n.query(gt,a,pe(""))))).flatMap((a,l)=>a.status==="rejected"?[{exportName:e[l]?.exportName??"",message:K(a.reason)}]:[]),[r]=o;return r===void 0?null:e.length===1?r.message:t("Not sent to {failed}",{failed:o.map(a=>`${a.exportName}: ${a.message}`).join("; ")})},"ft"),xt=me(G.replayQueueMessage),yt=me(G.clearQueueMessages),at=96,Nt=c(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n,Ge)}catch{return"[unserializable]"}},"xt"),bt=c(n=>n.length>at?`${n.slice(0,at)}\u2026`:n,"yt"),qt=c(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","bt"),vt=c((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"Nt"),nt=c(n=>{let e=(0,$.c)(17),{queue:t}=n,o=`queues-row-${t.exportName}`,r;e[0]!==t.exportName?(r=(0,s.jsx)(S,{className:"font-mono text-xs",children:t.exportName}),e[0]=t.exportName,e[1]=r):r=e[1];let a;e[2]!==t.name?(a=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.name}),e[2]=t.name,e[3]=a):a=e[3];let l;e[4]!==t.mode?(l=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.mode}),e[4]=t.mode,e[5]=l):l=e[5];let d;e[6]!==t.binding?(d=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.binding}),e[6]=t.binding,e[7]=d):d=e[7];let i=t.deadLetterQueue??"\u2014",u;e[8]!==i?(u=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:i}),e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==o||e[11]!==r||e[12]!==a||e[13]!==l||e[14]!==d||e[15]!==u?(p=(0,s.jsxs)(H,{"data-testid":o,children:[r,a,l,d,u]}),e[10]=o,e[11]=r,e[12]=a,e[13]=l,e[14]=d,e[15]=u,e[16]=p):p=e[16],p},"Ve"),St=c(n=>{let e=(0,$.c)(8),{loaded:t,queues:o}=n,r=O(),a;if(e[0]!==t||e[1]!==o||e[2]!==r){let{plain:l,topics:d}=je(o),i;e[4]!==r?(i=r("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[4]=r,e[5]=i):i=e[5];let u;e[6]!==i?(u=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=u):u=e[7],a=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[u,t&&o.length===0?(0,s.jsx)(xe,{description:r("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:r("No queues defined")}):(0,s.jsx)(ke,{className:"overflow-hidden py-0",children:(0,s.jsx)(Oe,{className:"px-0",children:(0,s.jsxs)(Re,{"data-testid":"queues-table",children:[(0,s.jsx)(_e,{children:(0,s.jsxs)(H,{children:[(0,s.jsx)(L,{children:r("Export")}),(0,s.jsx)(L,{children:r("Queue")}),(0,s.jsx)(L,{children:r("Mode")}),(0,s.jsx)(L,{children:r("Binding")}),(0,s.jsx)(L,{children:r("Dead-letter")})]})}),(0,s.jsxs)(Je,{children:[l.map(Et),[...d].map(p=>{let[f,x]=p;return(0,s.jsxs)(M.Fragment,{children:[(0,s.jsx)(H,{className:"bg-muted/40","data-testid":`queues-topic-${f}`,children:(0,s.jsx)(S,{className:"text-xs font-medium",colSpan:5,children:r("Topic {topic} \xB7 {count} subscriptions",{count:x.length,topic:f})})}),x.map(Mt)]},f)})]})]})})})]}),e[0]=t,e[1]=o,e[2]=r,e[3]=a}else a=e[3];return a},"qt"),Ct=c(n=>{let e=(0,$.c)(67),{message:t,onReplay:o,replayingId:r}=n,a=O(),l,d,i,u,p,f,x,m,h,N;if(e[0]!==t.attempts||e[1]!==t.body||e[2]!==t.deadLettered||e[3]!==t.exportName||e[4]!==t.id||e[5]!==t.messageId||e[6]!==t.outcome||e[7]!==t.queue||e[8]!==a){let R=Nt(t.body);d=H,f=`queues-message-${t.id}`;let _=t.exportName??t.queue;e[19]!==_?(x=(0,s.jsx)(S,{className:"font-mono text-xs",children:_}),e[19]=_,e[20]=x):x=e[20],e[21]!==t.messageId?(m=(0,s.jsx)(S,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:t.messageId,children:t.messageId}),e[21]=t.messageId,e[22]=m):m=e[22],e[23]!==t.attempts?(h=(0,s.jsx)(S,{className:"font-mono text-xs tabular-nums",children:t.attempts}),e[23]=t.attempts,e[24]=h):h=e[24];let B=`queues-outcome-${t.id}`,w;e[25]!==t.outcome?(w=qt(t.outcome),e[25]=t.outcome,e[26]=w):w=e[26];let T;e[27]!==t.outcome||e[28]!==B||e[29]!==w?(T=(0,s.jsx)(fe,{"data-testid":B,variant:w,children:t.outcome}),e[27]=t.outcome,e[28]=B,e[29]=w,e[30]=T):T=e[30];let I;e[31]!==t.deadLettered||e[32]!==t.id||e[33]!==a?(I=t.deadLettered&&(0,s.jsx)(fe,{"data-testid":`queues-dlq-${t.id}`,variant:"destructive",children:a("DLQ")}),e[31]=t.deadLettered,e[32]=t.id,e[33]=a,e[34]=I):I=e[34],e[35]!==T||e[36]!==I?(N=(0,s.jsx)(S,{children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[T,I]})}),e[35]=T,e[36]=I,e[37]=N):N=e[37],l=S,i="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=R,p=bt(R),e[0]=t.attempts,e[1]=t.body,e[2]=t.deadLettered,e[3]=t.exportName,e[4]=t.id,e[5]=t.messageId,e[6]=t.outcome,e[7]=t.queue,e[8]=a,e[9]=l,e[10]=d,e[11]=i,e[12]=u,e[13]=p,e[14]=f,e[15]=x,e[16]=m,e[17]=h,e[18]=N}else l=e[9],d=e[10],i=e[11],u=e[12],p=e[13],f=e[14],x=e[15],m=e[16],h=e[17],N=e[18];let y;e[38]!==l||e[39]!==i||e[40]!==u||e[41]!==p?(y=(0,s.jsx)(l,{className:i,title:u,children:p}),e[38]=l,e[39]=i,e[40]=u,e[41]=p,e[42]=y):y=e[42];let b;e[43]!==t.capturedAt?(b=He(t.capturedAt,"\u2014"),e[43]=t.capturedAt,e[44]=b):b=e[44];let C;e[45]!==b?(C=(0,s.jsx)(S,{className:"text-xs text-muted-foreground tabular-nums",children:b}),e[45]=b,e[46]=C):C=e[46];let q=`queues-replay-${t.id}`,v=r!==null,E;e[47]!==t.id||e[48]!==r||e[49]!==a?(E=r===t.id?a("Replaying\u2026"):a("Replay"),e[47]=t.id,e[48]=r,e[49]=a,e[50]=E):E=e[50];let A;e[51]!==t.id||e[52]!==o||e[53]!==q||e[54]!==v||e[55]!==E?(A=(0,s.jsx)(S,{children:(0,s.jsx)(ge,{"data-id":t.id,"data-testid":q,disabled:v,onClick:o,size:"xs",type:"button",variant:"outline",children:E})}),e[51]=t.id,e[52]=o,e[53]=q,e[54]=v,e[55]=E,e[56]=A):A=e[56];let D;return e[57]!==d||e[58]!==C||e[59]!==A||e[60]!==f||e[61]!==x||e[62]!==m||e[63]!==h||e[64]!==N||e[65]!==y?(D=(0,s.jsxs)(d,{"data-testid":f,children:[x,m,h,N,y,C,A]}),e[57]=d,e[58]=C,e[59]=A,e[60]=f,e[61]=x,e[62]=m,e[63]=h,e[64]=N,e[65]=y,e[66]=D):D=e[66],D},"St"),wt=c(n=>{let e=(0,$.c)(29),{hasError:t,messages:o,onClear:r,onReplay:a,replayingId:l}=n,d=O(),i;e[0]!==d?(i=d("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=d,e[1]=i):i=e[1];let u;e[2]!==i?(u=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=u):u=e[3];let p;e[4]!==d?(p=d("Clear the whole message log?"),e[4]=d,e[5]=p):p=e[5];let f=o.length===0,x;e[6]!==d?(x=d("Clear log"),e[6]=d,e[7]=x):x=e[7];let m;e[8]!==r||e[9]!==p||e[10]!==f||e[11]!==x?(m=(0,s.jsx)("div",{className:"ml-auto",children:(0,s.jsx)(Xe,{confirmLabel:p,disabled:f,onConfirm:r,testId:"queues-clear",children:x})}),e[8]=r,e[9]=p,e[10]=f,e[11]=x,e[12]=m):m=e[12];let h;e[13]!==o.length||e[14]!==d?(h=o.length>0&&(0,s.jsx)(fe,{"data-testid":"queues-count",variant:"secondary",children:d("{count} messages",{count:o.length})}),e[13]=o.length,e[14]=d,e[15]=h):h=e[15];let N;e[16]!==u||e[17]!==m||e[18]!==h?(N=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,m,h]}),e[16]=u,e[17]=m,e[18]=h,e[19]=N):N=e[19];let y;e[20]!==t||e[21]!==o||e[22]!==a||e[23]!==l||e[24]!==d?(y=!t&&o.length===0?(0,s.jsx)(xe,{description:d("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:d("No consumed messages yet.")}):(0,s.jsx)(ke,{className:"overflow-hidden py-0",children:(0,s.jsx)(Oe,{className:"px-0",children:(0,s.jsx)(st,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,s.jsxs)(Re,{"data-testid":"queues-messages-table",children:[(0,s.jsx)(_e,{children:(0,s.jsxs)(H,{children:[(0,s.jsx)(L,{children:d("Export")}),(0,s.jsx)(L,{children:d("Message")}),(0,s.jsx)(L,{children:d("Attempts")}),(0,s.jsx)(L,{children:d("Outcome")}),(0,s.jsx)(L,{children:d("Body")}),(0,s.jsx)(L,{children:d("Captured")}),(0,s.jsx)(L,{})]})}),(0,s.jsx)(Je,{children:o.map(C=>(0,s.jsx)(Ct,{message:C,onReplay:a,replayingId:l},C.id))})]})})})}),e[20]=t,e[21]=o,e[22]=a,e[23]=l,e[24]=d,e[25]=y):y=e[25];let b;return e[26]!==N||e[27]!==y?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[N,y]}),e[26]=N,e[27]=y,e[28]=b):b=e[28],b},"Et"),It=c(n=>{let e=(0,$.c)(20),{batchMode:t,bodyText:o,delayText:r,onBatchModeChange:a,onBodyChange:l,onDelayChange:d,onSelectExport:i,onSend:u,queues:p,selectedExportName:f,sending:x}=n,m=O(),h;e[0]!==m?(h=m("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=m,e[1]=h):h=e[1];let N;e[2]!==h?(N=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[2]=h,e[3]=N):N=e[3];let y;e[4]!==t||e[5]!==o||e[6]!==r||e[7]!==a||e[8]!==l||e[9]!==d||e[10]!==i||e[11]!==u||e[12]!==p||e[13]!==f||e[14]!==x||e[15]!==m?(y=p.length===0?(0,s.jsx)(xe,{description:m("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:m("No queues to send to")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("select",{"aria-label":m("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:i,value:f,children:[p.map(At),[...je(p).topics].map(C=>{let[q,v]=C;return(0,s.jsx)("option",{value:rt(q),children:m("{topic} (topic \u2192 {count} subscriptions)",{count:v.length,topic:q})},q)})]}),(0,s.jsx)(Ye,{"aria-label":m("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:d,placeholder:m("Delay (s)"),type:"number",value:r}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,s.jsx)("input",{checked:t,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:a,type:"checkbox"}),m("Send as batch (JSON array)")]}),(0,s.jsx)(ge,{className:"ml-auto","data-testid":"queues-send-button",disabled:x||f==="",onClick:u,type:"button",children:m(x?"Sending\u2026":"Send message")})]}),(0,s.jsx)(tt,{"aria-label":m("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:l,placeholder:t?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:o})]}),e[4]=t,e[5]=o,e[6]=r,e[7]=a,e[8]=l,e[9]=d,e[10]=i,e[11]=u,e[12]=p,e[13]=f,e[14]=x,e[15]=m,e[16]=y):y=e[16];let b;return e[17]!==N||e[18]!==y?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[N,y]}),e[17]=N,e[18]=y,e[19]=b):b=e[19],b},"Tt"),Qt=c((n,e,t,o)=>{let r=null,a=n.trim();if(a!=="")try{r=JSON.parse(a)}catch{return{error:o("Body must be valid JSON.")}}let l,d=e.trim();if(d!==""){let i=Number(d);if(!Number.isFinite(i)||i<0)return{error:o("Delay must be a non-negative number of seconds.")};l=i}return t&&!Array.isArray(r)?{error:o("Batch mode needs a JSON array body \u2014 each element is enqueued as one message.")}:{body:r,delaySeconds:l}},"Ct"),Lt=c(n=>{let e=(0,$.c)(11),{deadLetteredCount:t,queuesWithoutDlq:o}=n,r=O(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,s.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),e[0]=a):a=e[0];let l;e[1]!==o||e[2]!==r?(l=o.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"font-medium",children:r("No dead-letter queue on {queues}.",{queues:o.map(Tt).join(", ")})}),(0,s.jsx)("p",{className:"text-muted-foreground",children:r("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),e[1]=o,e[2]=r,e[3]=l):l=e[3];let d;e[4]!==t||e[5]!==o.length||e[6]!==r?(d=t>0&&(0,s.jsx)("p",{className:o.length>0?"text-muted-foreground":"font-medium",children:t===1?r("1 message was recently dead-lettered."):r("{count} messages were recently dead-lettered.",{count:t})}),e[4]=t,e[5]=o.length,e[6]=r,e[7]=d):d=e[7];let i;return e[8]!==l||e[9]!==d?(i=(0,s.jsx)(Ze,{icon:a,testId:"queues-dlq-warning",variant:"warning",children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[l,d]})}),e[8]=l,e[9]=d,e[10]=i):i=e[10],i},"_t"),Zt=c(n=>{let e=(0,$.c)(76),{limit:t}=n,o=t??ht,r=Ke(),a=O(),[l,d]=(0,M.useState)("declared"),[i,u]=(0,M.useState)(null),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let{data:f,error:x,errorSource:m}=Be(G.listQueues,p),h;e[1]!==o?(h={limit:o},e[1]=o,e[2]=h):h=e[2];let{data:N,error:y,errorSource:b,poll:C,refetch:q}=Be(G.getQueueMessages,h),v=Array.isArray(f?.queues)?[...f.queues].toSorted(Dt):[],E=N?.entries??[],{deadLetteredCount:A,queuesWithoutDlq:D,showReliabilityWarning:R}=mt(v,E),[_,B]=(0,M.useState)(""),[w,T]=(0,M.useState)(""),[I,ye]=(0,M.useState)(""),[k,Ne]=(0,M.useState)(!1),[be,V]=(0,M.useState)(!1),[qe,X]=(0,M.useState)(null),{topics:Y}=je(v),Fe=[...v.map($t),...[...Y.keys()].map(Bt)],J=Fe.includes(_)?_:Fe[0]??"",ze=l==="messages"?y:x,ot=l==="messages"?b:m,ve=ze??i,Se=ze===null?i:ot;Ve(C,l==="messages");let Z;e[3]!==k||e[4]!==w||e[5]!==r||e[6]!==I||e[7]!==q||e[8]!==J||e[9]!==V||e[10]!==a||e[11]!==Y?(Z=c(async()=>{u(null);let g=J;if(g==="")return;let Q=Qt(w,I,k,a);if("error"in Q){u(Q.error);return}let{body:Pe,delaySeconds:Ue}=Q;V(!0);let lt=pt(g,Y).map(ce=>k?{batch:Pe,delaySeconds:Ue,exportName:ce}:{body:Pe,delaySeconds:Ue,exportName:ce});try{u(await ft(r,lt,a)),q()}catch(ce){u(K(ce))}V(!1)},"K"),e[3]=k,e[4]=w,e[5]=r,e[6]=I,e[7]=q,e[8]=J,e[9]=V,e[10]=a,e[11]=Y,e[12]=Z):Z=e[12];let Ce=Z,ee;e[13]!==r||e[14]!==q||e[15]!==X?(ee=c(async g=>{u(null),X(g);try{await r.query(xt,{id:g},pe("")),q()}catch(Q){u(K(Q))}X(null)},"Z"),e[13]=r,e[14]=q,e[15]=X,e[16]=ee):ee=e[16];let we=ee,te;e[17]!==r||e[18]!==q?(te=c(async()=>{u(null);try{await r.query(yt,{},pe("")),q()}catch(g){u(K(g))}},"ee"),e[17]=r,e[18]=q,e[19]=te):te=e[19];let Ie=te,se;e[20]===Symbol.for("react.memo_cache_sentinel")?(se=c(g=>{let Q=g.currentTarget.dataset.tab;(Q==="declared"||Q==="messages"||Q==="send")&&d(Q)},"te"),e[20]=se):se=e[20];let dt=se,ae;e[21]!==B?(ae=c(g=>{B(g.currentTarget.value)},"se"),e[21]=B,e[22]=ae):ae=e[22];let Qe=ae,re;e[23]!==T?(re=c(g=>{T(g.currentTarget.value)},"re"),e[23]=T,e[24]=re):re=e[24];let Le=re,ne;e[25]!==ye?(ne=c(g=>{ye(g.currentTarget.value)},"ae"),e[25]=ye,e[26]=ne):ne=e[26];let Ee=ne,oe;e[27]!==Ne?(oe=c(g=>{Ne(g.currentTarget.checked)},"ne"),e[27]=Ne,e[28]=oe):oe=e[28];let Me=oe,de;e[29]!==Ce?(de=c(()=>{he(Ce())},"oe"),e[29]=Ce,e[30]=de):de=e[30];let Ae=de,le;e[31]!==we?(le=c(g=>{let{id:Q}=g.currentTarget.dataset;Q!==void 0&&he(we(Q))},"le"),e[31]=we,e[32]=le):le=e[32];let Te=le,ie;e[33]!==Ie?(ie=c(()=>{he(Ie())},"ie"),e[33]=Ie,e[34]=ie):ie=e[34];let De=ie,W;e[35]!==a||e[36]!==l?(W=(0,s.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(g=>(0,s.jsx)(ge,{"aria-selected":l===g,"data-tab":g,"data-testid":`queues-tab-${g}`,onClick:dt,role:"tab",size:"sm",type:"button",variant:l===g?"secondary":"ghost",children:vt(g,a)},g))}),e[35]=a,e[36]=l,e[37]=W):W=e[37];let j;e[38]!==ve||e[39]!==Se?(j=ve!==null&&(0,s.jsx)(et,{error:Se,testId:"queues-error"}),e[38]=ve,e[39]=Se,e[40]=j):j=e[40];let F;e[41]!==A||e[42]!==D||e[43]!==R?(F=R&&(0,s.jsx)(Lt,{deadLetteredCount:A,queuesWithoutDlq:D}),e[41]=A,e[42]=D,e[43]=R,e[44]=F):F=e[44];let z;e[45]!==v||e[46]!==f||e[47]!==l?(z=l==="declared"&&(0,s.jsx)(St,{loaded:f!==void 0,queues:v}),e[45]=v,e[46]=f,e[47]=l,e[48]=z):z=e[48];let P;e[49]!==E||e[50]!==y||e[51]!==De||e[52]!==Te||e[53]!==qe||e[54]!==l?(P=l==="messages"&&(0,s.jsx)(wt,{hasError:y!==null,messages:E,onClear:De,onReplay:Te,replayingId:qe}),e[49]=E,e[50]=y,e[51]=De,e[52]=Te,e[53]=qe,e[54]=l,e[55]=P):P=e[55];let U;e[56]!==k||e[57]!==w||e[58]!==I||e[59]!==Me||e[60]!==Le||e[61]!==Ee||e[62]!==Qe||e[63]!==Ae||e[64]!==v||e[65]!==J||e[66]!==be||e[67]!==l?(U=l==="send"&&(0,s.jsx)(It,{batchMode:k,bodyText:w,delayText:I,onBatchModeChange:Me,onBodyChange:Le,onDelayChange:Ee,onSelectExport:Qe,onSend:Ae,queues:v,selectedExportName:J,sending:be}),e[56]=k,e[57]=w,e[58]=I,e[59]=Me,e[60]=Le,e[61]=Ee,e[62]=Qe,e[63]=Ae,e[64]=v,e[65]=J,e[66]=be,e[67]=l,e[68]=U):U=e[68];let ue;return e[69]!==W||e[70]!==j||e[71]!==F||e[72]!==z||e[73]!==P||e[74]!==U?(ue=(0,s.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-queues-panel",children:[W,j,F,z,P,U]}),e[69]=W,e[70]=j,e[71]=F,e[72]=z,e[73]=P,e[74]=U,e[75]=ue):ue=e[75],ue},"ts");function Et(n){return(0,s.jsx)(nt,{queue:n},n.exportName)}c(Et,"vt");function Mt(n){return(0,s.jsx)(nt,{queue:n},n.exportName)}c(Mt,"wt");function At(n){return(0,s.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}c(At,"Qt");function Tt(n){return n.name}c(Tt,"At");function Dt(n,e){return n.exportName.localeCompare(e.exportName)}c(Dt,"It");function $t(n){return n.exportName}c($t,"Mt");function Bt(n){return rt(n)}c(Bt,"Lt");export{Zt as default};
@@ -1 +1 @@
1
- import{a as He}from"./chunk-ODEIAS3V.js";import{a as Se}from"./chunk-CJ2V577P.js";import{a as Ze}from"./chunk-KSATOQ6G.js";import{a as qe}from"./chunk-DWNWEMQK.js";import{i as ze}from"./chunk-OKZINWBB.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as $e}from"./chunk-NVMQPIRS.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{b as Ge}from"./chunk-UV6GPH2E.js";import"./chunk-L27FKJTG.js";import{a as Fe}from"./chunk-LYVYUTQY.js";import{n as Ke}from"./chunk-UK5OOCLQ.js";import"./chunk-ZPQBVYNN.js";import{B as Oe,h as Pe,i as me,j as Ce,k as Ue,s as Re}from"./chunk-PN7JHEYW.js";import"./chunk-PDBW6GTJ.js";import{a as at}from"./chunk-A6TVTNKO.js";import{a as ot,b as lt}from"./chunk-ADABTCDI.js";import{a as s,d as Me}from"./chunk-5PEAXTYQ.js";var Ee=Me(at(),1),m=Me(ot(),1);var r=Me(lt(),1);var De=Pe(Fe.getPitrBookmark),st=Pe(Fe.pitrRestore),nt=/^\d+$/u,Je=s(ie=>{let e=ie.trim(),h=nt.test(e)?Number(e):Date.parse(e),l=new Date(h);return Number.isNaN(l.getTime())?void 0:{epochMs:h,iso:l.toISOString()}},"$e"),it=s(ie=>{let e=(0,Ee.c)(9),{text:h}=ie,l=Oe();if(h.trim()==="")return null;let t,o,p;if(e[0]!==l||e[1]!==h){let y=Je(h);t="font-mono text-xs text-muted-foreground",o="pitr-time-resolved",p=y===void 0?l("Not a time \u2014 use epoch-ms or ISO 8601."):l("Resolves to {instant} (a date-time without an offset is read in this browser's time zone; a bare date is UTC)",{instant:y.iso}),e[0]=l,e[1]=h,e[2]=t,e[3]=o,e[4]=p}else t=e[2],o=e[3],p=e[4];let N;return e[5]!==t||e[6]!==o||e[7]!==p?(N=(0,r.jsx)("p",{className:t,"data-testid":o,children:p}),e[5]=t,e[6]=o,e[7]=p,e[8]=N):N=e[8],N},"lt"),gt=s(ie=>{let e=(0,Ee.c)(140),{initialShardKey:h}=ie,l=Ke(),t=Oe(),o=h??"",p=He(o),[N,y]=(0,m.useState)(null),[f,Qe]=(0,m.useState)(""),[ce,je]=(0,m.useState)(null),[c,We]=(0,m.useState)(""),[b,Xe]=(0,m.useState)(!1),[i,Ye]=(0,m.useState)(null),[ue,w]=(0,m.useState)(null),[de,I]=(0,m.useState)(!1),[C,Ve]=(0,m.useState)(!1),pe;e[0]!==l||e[1]!==o?(pe=s(async a=>{I(!0),w(null);let d;try{d={current:(await l.query(De,{},me(o))).current,error:null,unavailable:!1}}catch(n){let v=n;d={current:null,error:Ce(v),unavailable:Ue(v)==="PITR_UNAVAILABLE"}}a?.aborted!==!0&&(d.error===null?y(d.current):w(d.error),Ve(d.unavailable),I(!1))},"fe"),e[0]=l,e[1]=o,e[2]=pe):pe=e[2];let x=pe,he,fe;e[3]!==x?(he=s(()=>{let a=new AbortController;return Re(x(a.signal)),()=>{a.abort()}},"ue"),fe=[x],e[3]=x,e[4]=he,e[5]=fe):(he=e[4],fe=e[5]),(0,m.useEffect)(he,fe);let be;e[6]!==l||e[7]!==o?(be=s(async()=>{let a=await l.query(De,{},me(o));y(a.current)},"he"),e[6]=l,e[7]=o,e[8]=be):be=e[8],Ze(be,!C);let xe;e[9]===Symbol.for("react.memo_cache_sentinel")?(xe=s(a=>{Qe(a.target.value)},"be"),e[9]=xe):xe=e[9];let et=xe,ke;e[10]===Symbol.for("react.memo_cache_sentinel")?(ke=s(a=>{We(a.target.value)},"xe"),e[10]=ke):ke=e[10];let tt=ke,Ne;e[11]===Symbol.for("react.memo_cache_sentinel")?(Ne=s(a=>{Xe(a.target.checked)},"ke"),e[11]=Ne):Ne=e[11];let rt=Ne,ge,R,u,k,g,ve;if(e[12]!==c||e[13]!==l||e[14]!==ce||e[15]!==x||e[16]!==o||e[17]!==p||e[18]!==t||e[19]!==f){u=Je(f),R=s(()=>{if(u===void 0)return;let d=o;Re((async()=>{I(!0),w(null);let n;try{n={result:await l.query(De,{time:u.epochMs},me(d))}}catch(v){n={error:Ce(v)}}p.current===d&&("result"in n?(je(n.result.forTime===void 0?null:{bookmark:n.result.forTime,shard:d}),y(n.result.current)):(je(null),w(n.error)),I(!1))})())},"C"),g=ce?.shard===o?ce.bookmark:null;let a;e[26]!==l||e[27]!==x||e[28]!==o?(a=s(d=>{Re((async()=>{I(!0),w(null);try{let n=await l.mutation(st,d,me(o));Ye(n),await x()}catch(n){let v=n;w(Ce(v)),Ue(v)==="PITR_UNAVAILABLE"&&Ve(!0)}I(!1)})())},"o"),e[26]=l,e[27]=x,e[28]=o,e[29]=a):a=e[29],k=a,ge=c.trim()!==""||u!==void 0,ve=t("Restore {shard} to {target}?",{shard:o===""?t("root"):o,target:c.trim()===""?u?.iso??"":t("the given bookmark")}),e[12]=c,e[13]=l,e[14]=ce,e[15]=x,e[16]=o,e[17]=p,e[18]=t,e[19]=f,e[20]=ge,e[21]=R,e[22]=u,e[23]=k,e[24]=g,e[25]=ve}else ge=e[20],R=e[21],u=e[22],k=e[23],g=e[24],ve=e[25];let Te=ve,ye;e[30]!==c||e[31]!==u?.epochMs||e[32]!==b||e[33]!==k?(ye=s(()=>{let a=b?{restart:!0}:{};c.trim()===""?a.time=u?.epochMs:a.bookmark=c.trim(),k(a)},"Ne"),e[30]=c,e[31]=u?.epochMs,e[32]=b,e[33]=k,e[34]=ye):ye=e[34];let Be=ye,we;e[35]!==b||e[36]!==i||e[37]!==k?(we=s(()=>{i!==null&&k(b?{bookmark:i.undoBookmark,restart:!0}:{bookmark:i.undoBookmark})},"ye"),e[35]=b,e[36]=i,e[37]=k,e[38]=we):we=e[38];let Ae=we,S;e[39]!==t?(S=t("Shard"),e[39]=t,e[40]=S):S=e[40];let T;e[41]!==o||e[42]!==t?(T=o===""?t("root"):o,e[41]=o,e[42]=t,e[43]=T):T=e[43];let B;e[44]!==T?(B=(0,r.jsx)("span",{className:"font-mono",children:T}),e[44]=T,e[45]=B):B=e[45];let A;e[46]!==S||e[47]!==B?(A=(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[S,": ",B]})}),e[46]=S,e[47]=B,e[48]=A):A=e[48];let _;e[49]!==t?(_=t("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier."),e[49]=t,e[50]=_):_=e[50];let L;e[51]!==_?(L=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:_}),e[51]=_,e[52]=L):L=e[52];let M;e[53]!==ue?(M=ue!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:ue}),e[53]=ue,e[54]=M):M=e[54];let P;e[55]!==t?(P=t("Current bookmark"),e[55]=t,e[56]=P):P=e[56];let U;e[57]!==P?(U=(0,r.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:P}),e[57]=P,e[58]=U):U=e[58];let F;e[59]!==N?(F=N??(0,r.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[59]=N,e[60]=F):F=e[60];let O;e[61]!==F?(O=(0,r.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:F}),e[61]=F,e[62]=O):O=e[62];let q;e[63]!==U||e[64]!==O?(q=(0,r.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[U,O]}),e[63]=U,e[64]=O,e[65]=q):q=e[65];let z;e[66]!==t?(z=t("Restore"),e[66]=t,e[67]=z):z=e[67];let D;e[68]!==z?(D=(0,r.jsx)("h3",{className:"text-sm font-semibold",children:z}),e[68]=z,e[69]=D):D=e[69];let E;e[70]!==t?(E=t("Time (ISO or epoch-ms, last 30 days)"),e[70]=t,e[71]=E):E=e[71];let j;e[72]!==E?(j=(0,r.jsx)(Se,{htmlFor:"pitr-time",children:E}),e[72]=E,e[73]=j):j=e[73];let V;e[74]!==f?(V=(0,r.jsx)(ze,{"data-testid":"pitr-time",id:"pitr-time",onChange:et,placeholder:"2026-06-01T00:00:00.000Z",value:f}),e[74]=f,e[75]=V):V=e[75];let _e=de||C||u===void 0,K;e[76]!==t?(K=t("Preview"),e[76]=t,e[77]=K):K=e[77];let Z;e[78]!==R||e[79]!==_e||e[80]!==K?(Z=(0,r.jsx)($e,{"data-testid":"pitr-preview",disabled:_e,onClick:R,size:"sm",type:"button",variant:"outline",children:K}),e[78]=R,e[79]=_e,e[80]=K,e[81]=Z):Z=e[81];let $;e[82]!==V||e[83]!==Z?($=(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[V,Z]}),e[82]=V,e[83]=Z,e[84]=$):$=e[84];let G;e[85]!==f?(G=(0,r.jsx)(it,{text:f}),e[85]=f,e[86]=G):G=e[86];let H;e[87]!==g||e[88]!==t?(H=g!==null&&(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[t("Bookmark for that time"),": ",g]}),e[87]=g,e[88]=t,e[89]=H):H=e[89];let J;e[90]!==j||e[91]!==$||e[92]!==G||e[93]!==H?(J=(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[j,$,G,H]}),e[90]=j,e[91]=$,e[92]=G,e[93]=H,e[94]=J):J=e[94];let Q;e[95]!==t?(Q=t("Or an explicit bookmark (wins over time)"),e[95]=t,e[96]=Q):Q=e[96];let W;e[97]!==Q?(W=(0,r.jsx)(Se,{htmlFor:"pitr-bookmark",children:Q}),e[97]=Q,e[98]=W):W=e[98];let X;e[99]!==t?(X=t("bookmark string"),e[99]=t,e[100]=X):X=e[100];let Y;e[101]!==c||e[102]!==X?(Y=(0,r.jsx)(ze,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:tt,placeholder:X,value:c}),e[101]=c,e[102]=X,e[103]=Y):Y=e[103];let ee;e[104]!==W||e[105]!==Y?(ee=(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[W,Y]}),e[104]=W,e[105]=Y,e[106]=ee):ee=e[106];let te;e[107]!==b?(te=(0,r.jsx)("input",{checked:b,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:rt,type:"checkbox"}),e[107]=b,e[108]=te):te=e[108];let re;e[109]!==t?(re=t("Restart the shard now so recovery applies immediately"),e[109]=t,e[110]=re):re=e[110];let oe;e[111]!==te||e[112]!==re?(oe=(0,r.jsxs)(Se,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[te,re]}),e[111]=te,e[112]=re,e[113]=oe):oe=e[113];let Le=de||C||!ge,ae;e[114]!==t?(ae=t("Restore"),e[114]=t,e[115]=ae):ae=e[115];let le;e[116]!==Te||e[117]!==Be||e[118]!==Le||e[119]!==ae?(le=(0,r.jsx)("div",{children:(0,r.jsx)(qe,{confirmLabel:Te,disabled:Le,onConfirm:Be,testId:"pitr-restore",children:ae})}),e[116]=Te,e[117]=Be,e[118]=Le,e[119]=ae,e[120]=le):le=e[120];let se;e[121]!==D||e[122]!==J||e[123]!==ee||e[124]!==oe||e[125]!==le?(se=(0,r.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[D,J,ee,oe,le]}),e[121]=D,e[122]=J,e[123]=ee,e[124]=oe,e[125]=le,e[126]=se):se=e[126];let ne;e[127]!==de||e[128]!==Ae||e[129]!==i||e[130]!==t||e[131]!==C?(ne=i!==null&&(0,r.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore armed")}),(0,r.jsx)(Ge,{variant:i.restarted?"destructive":"secondary",children:i.restarted?t("restarted now"):t("on next restart")})]}),(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[t("Restored to"),": ",i.restoredTo]}),(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[t("Undo bookmark"),": ",i.undoBookmark]}),(0,r.jsx)("div",{children:(0,r.jsx)(qe,{confirmLabel:t("Confirm undo"),disabled:de||C,onConfirm:Ae,testId:"pitr-undo",children:t("Undo restore")})})]}),e[127]=de,e[128]=Ae,e[129]=i,e[130]=t,e[131]=C,e[132]=ne):ne=e[132];let Ie;return e[133]!==A||e[134]!==L||e[135]!==M||e[136]!==q||e[137]!==se||e[138]!==ne?(Ie=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[A,L,M,q,se,ne]}),e[133]=A,e[134]=L,e[135]=M,e[136]=q,e[137]=se,e[138]=ne,e[139]=Ie):Ie=e[139],Ie},"Nt");export{gt as PitrPanel};
1
+ import{a as He}from"./chunk-ODEIAS3V.js";import{a as Se}from"./chunk-CJ2V577P.js";import{a as Ze}from"./chunk-XY5UOZMD.js";import{a as qe}from"./chunk-DWNWEMQK.js";import{i as ze}from"./chunk-OKZINWBB.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as $e}from"./chunk-NVMQPIRS.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{b as Ge}from"./chunk-UV6GPH2E.js";import"./chunk-L27FKJTG.js";import{a as Fe}from"./chunk-LYVYUTQY.js";import{n as Ke}from"./chunk-QB75Q7U4.js";import"./chunk-ZPQBVYNN.js";import{B as Oe,h as Pe,i as me,j as Ce,k as Ue,s as Re}from"./chunk-PN7JHEYW.js";import"./chunk-PDBW6GTJ.js";import{a as at}from"./chunk-A6TVTNKO.js";import{a as ot,b as lt}from"./chunk-ADABTCDI.js";import{a as s,d as Me}from"./chunk-5PEAXTYQ.js";var Ee=Me(at(),1),m=Me(ot(),1);var r=Me(lt(),1);var De=Pe(Fe.getPitrBookmark),st=Pe(Fe.pitrRestore),nt=/^\d+$/u,Je=s(ie=>{let e=ie.trim(),h=nt.test(e)?Number(e):Date.parse(e),l=new Date(h);return Number.isNaN(l.getTime())?void 0:{epochMs:h,iso:l.toISOString()}},"$e"),it=s(ie=>{let e=(0,Ee.c)(9),{text:h}=ie,l=Oe();if(h.trim()==="")return null;let t,o,p;if(e[0]!==l||e[1]!==h){let y=Je(h);t="font-mono text-xs text-muted-foreground",o="pitr-time-resolved",p=y===void 0?l("Not a time \u2014 use epoch-ms or ISO 8601."):l("Resolves to {instant} (a date-time without an offset is read in this browser's time zone; a bare date is UTC)",{instant:y.iso}),e[0]=l,e[1]=h,e[2]=t,e[3]=o,e[4]=p}else t=e[2],o=e[3],p=e[4];let N;return e[5]!==t||e[6]!==o||e[7]!==p?(N=(0,r.jsx)("p",{className:t,"data-testid":o,children:p}),e[5]=t,e[6]=o,e[7]=p,e[8]=N):N=e[8],N},"lt"),gt=s(ie=>{let e=(0,Ee.c)(140),{initialShardKey:h}=ie,l=Ke(),t=Oe(),o=h??"",p=He(o),[N,y]=(0,m.useState)(null),[f,Qe]=(0,m.useState)(""),[ce,je]=(0,m.useState)(null),[c,We]=(0,m.useState)(""),[b,Xe]=(0,m.useState)(!1),[i,Ye]=(0,m.useState)(null),[ue,w]=(0,m.useState)(null),[de,I]=(0,m.useState)(!1),[C,Ve]=(0,m.useState)(!1),pe;e[0]!==l||e[1]!==o?(pe=s(async a=>{I(!0),w(null);let d;try{d={current:(await l.query(De,{},me(o))).current,error:null,unavailable:!1}}catch(n){let v=n;d={current:null,error:Ce(v),unavailable:Ue(v)==="PITR_UNAVAILABLE"}}a?.aborted!==!0&&(d.error===null?y(d.current):w(d.error),Ve(d.unavailable),I(!1))},"fe"),e[0]=l,e[1]=o,e[2]=pe):pe=e[2];let x=pe,he,fe;e[3]!==x?(he=s(()=>{let a=new AbortController;return Re(x(a.signal)),()=>{a.abort()}},"ue"),fe=[x],e[3]=x,e[4]=he,e[5]=fe):(he=e[4],fe=e[5]),(0,m.useEffect)(he,fe);let be;e[6]!==l||e[7]!==o?(be=s(async()=>{let a=await l.query(De,{},me(o));y(a.current)},"he"),e[6]=l,e[7]=o,e[8]=be):be=e[8],Ze(be,!C);let xe;e[9]===Symbol.for("react.memo_cache_sentinel")?(xe=s(a=>{Qe(a.target.value)},"be"),e[9]=xe):xe=e[9];let et=xe,ke;e[10]===Symbol.for("react.memo_cache_sentinel")?(ke=s(a=>{We(a.target.value)},"xe"),e[10]=ke):ke=e[10];let tt=ke,Ne;e[11]===Symbol.for("react.memo_cache_sentinel")?(Ne=s(a=>{Xe(a.target.checked)},"ke"),e[11]=Ne):Ne=e[11];let rt=Ne,ge,R,u,k,g,ve;if(e[12]!==c||e[13]!==l||e[14]!==ce||e[15]!==x||e[16]!==o||e[17]!==p||e[18]!==t||e[19]!==f){u=Je(f),R=s(()=>{if(u===void 0)return;let d=o;Re((async()=>{I(!0),w(null);let n;try{n={result:await l.query(De,{time:u.epochMs},me(d))}}catch(v){n={error:Ce(v)}}p.current===d&&("result"in n?(je(n.result.forTime===void 0?null:{bookmark:n.result.forTime,shard:d}),y(n.result.current)):(je(null),w(n.error)),I(!1))})())},"C"),g=ce?.shard===o?ce.bookmark:null;let a;e[26]!==l||e[27]!==x||e[28]!==o?(a=s(d=>{Re((async()=>{I(!0),w(null);try{let n=await l.mutation(st,d,me(o));Ye(n),await x()}catch(n){let v=n;w(Ce(v)),Ue(v)==="PITR_UNAVAILABLE"&&Ve(!0)}I(!1)})())},"o"),e[26]=l,e[27]=x,e[28]=o,e[29]=a):a=e[29],k=a,ge=c.trim()!==""||u!==void 0,ve=t("Restore {shard} to {target}?",{shard:o===""?t("root"):o,target:c.trim()===""?u?.iso??"":t("the given bookmark")}),e[12]=c,e[13]=l,e[14]=ce,e[15]=x,e[16]=o,e[17]=p,e[18]=t,e[19]=f,e[20]=ge,e[21]=R,e[22]=u,e[23]=k,e[24]=g,e[25]=ve}else ge=e[20],R=e[21],u=e[22],k=e[23],g=e[24],ve=e[25];let Te=ve,ye;e[30]!==c||e[31]!==u?.epochMs||e[32]!==b||e[33]!==k?(ye=s(()=>{let a=b?{restart:!0}:{};c.trim()===""?a.time=u?.epochMs:a.bookmark=c.trim(),k(a)},"Ne"),e[30]=c,e[31]=u?.epochMs,e[32]=b,e[33]=k,e[34]=ye):ye=e[34];let Be=ye,we;e[35]!==b||e[36]!==i||e[37]!==k?(we=s(()=>{i!==null&&k(b?{bookmark:i.undoBookmark,restart:!0}:{bookmark:i.undoBookmark})},"ye"),e[35]=b,e[36]=i,e[37]=k,e[38]=we):we=e[38];let Ae=we,S;e[39]!==t?(S=t("Shard"),e[39]=t,e[40]=S):S=e[40];let T;e[41]!==o||e[42]!==t?(T=o===""?t("root"):o,e[41]=o,e[42]=t,e[43]=T):T=e[43];let B;e[44]!==T?(B=(0,r.jsx)("span",{className:"font-mono",children:T}),e[44]=T,e[45]=B):B=e[45];let A;e[46]!==S||e[47]!==B?(A=(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[S,": ",B]})}),e[46]=S,e[47]=B,e[48]=A):A=e[48];let _;e[49]!==t?(_=t("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier."),e[49]=t,e[50]=_):_=e[50];let L;e[51]!==_?(L=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:_}),e[51]=_,e[52]=L):L=e[52];let M;e[53]!==ue?(M=ue!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:ue}),e[53]=ue,e[54]=M):M=e[54];let P;e[55]!==t?(P=t("Current bookmark"),e[55]=t,e[56]=P):P=e[56];let U;e[57]!==P?(U=(0,r.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:P}),e[57]=P,e[58]=U):U=e[58];let F;e[59]!==N?(F=N??(0,r.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[59]=N,e[60]=F):F=e[60];let O;e[61]!==F?(O=(0,r.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:F}),e[61]=F,e[62]=O):O=e[62];let q;e[63]!==U||e[64]!==O?(q=(0,r.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[U,O]}),e[63]=U,e[64]=O,e[65]=q):q=e[65];let z;e[66]!==t?(z=t("Restore"),e[66]=t,e[67]=z):z=e[67];let D;e[68]!==z?(D=(0,r.jsx)("h3",{className:"text-sm font-semibold",children:z}),e[68]=z,e[69]=D):D=e[69];let E;e[70]!==t?(E=t("Time (ISO or epoch-ms, last 30 days)"),e[70]=t,e[71]=E):E=e[71];let j;e[72]!==E?(j=(0,r.jsx)(Se,{htmlFor:"pitr-time",children:E}),e[72]=E,e[73]=j):j=e[73];let V;e[74]!==f?(V=(0,r.jsx)(ze,{"data-testid":"pitr-time",id:"pitr-time",onChange:et,placeholder:"2026-06-01T00:00:00.000Z",value:f}),e[74]=f,e[75]=V):V=e[75];let _e=de||C||u===void 0,K;e[76]!==t?(K=t("Preview"),e[76]=t,e[77]=K):K=e[77];let Z;e[78]!==R||e[79]!==_e||e[80]!==K?(Z=(0,r.jsx)($e,{"data-testid":"pitr-preview",disabled:_e,onClick:R,size:"sm",type:"button",variant:"outline",children:K}),e[78]=R,e[79]=_e,e[80]=K,e[81]=Z):Z=e[81];let $;e[82]!==V||e[83]!==Z?($=(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[V,Z]}),e[82]=V,e[83]=Z,e[84]=$):$=e[84];let G;e[85]!==f?(G=(0,r.jsx)(it,{text:f}),e[85]=f,e[86]=G):G=e[86];let H;e[87]!==g||e[88]!==t?(H=g!==null&&(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[t("Bookmark for that time"),": ",g]}),e[87]=g,e[88]=t,e[89]=H):H=e[89];let J;e[90]!==j||e[91]!==$||e[92]!==G||e[93]!==H?(J=(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[j,$,G,H]}),e[90]=j,e[91]=$,e[92]=G,e[93]=H,e[94]=J):J=e[94];let Q;e[95]!==t?(Q=t("Or an explicit bookmark (wins over time)"),e[95]=t,e[96]=Q):Q=e[96];let W;e[97]!==Q?(W=(0,r.jsx)(Se,{htmlFor:"pitr-bookmark",children:Q}),e[97]=Q,e[98]=W):W=e[98];let X;e[99]!==t?(X=t("bookmark string"),e[99]=t,e[100]=X):X=e[100];let Y;e[101]!==c||e[102]!==X?(Y=(0,r.jsx)(ze,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:tt,placeholder:X,value:c}),e[101]=c,e[102]=X,e[103]=Y):Y=e[103];let ee;e[104]!==W||e[105]!==Y?(ee=(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[W,Y]}),e[104]=W,e[105]=Y,e[106]=ee):ee=e[106];let te;e[107]!==b?(te=(0,r.jsx)("input",{checked:b,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:rt,type:"checkbox"}),e[107]=b,e[108]=te):te=e[108];let re;e[109]!==t?(re=t("Restart the shard now so recovery applies immediately"),e[109]=t,e[110]=re):re=e[110];let oe;e[111]!==te||e[112]!==re?(oe=(0,r.jsxs)(Se,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[te,re]}),e[111]=te,e[112]=re,e[113]=oe):oe=e[113];let Le=de||C||!ge,ae;e[114]!==t?(ae=t("Restore"),e[114]=t,e[115]=ae):ae=e[115];let le;e[116]!==Te||e[117]!==Be||e[118]!==Le||e[119]!==ae?(le=(0,r.jsx)("div",{children:(0,r.jsx)(qe,{confirmLabel:Te,disabled:Le,onConfirm:Be,testId:"pitr-restore",children:ae})}),e[116]=Te,e[117]=Be,e[118]=Le,e[119]=ae,e[120]=le):le=e[120];let se;e[121]!==D||e[122]!==J||e[123]!==ee||e[124]!==oe||e[125]!==le?(se=(0,r.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[D,J,ee,oe,le]}),e[121]=D,e[122]=J,e[123]=ee,e[124]=oe,e[125]=le,e[126]=se):se=e[126];let ne;e[127]!==de||e[128]!==Ae||e[129]!==i||e[130]!==t||e[131]!==C?(ne=i!==null&&(0,r.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore armed")}),(0,r.jsx)(Ge,{variant:i.restarted?"destructive":"secondary",children:i.restarted?t("restarted now"):t("on next restart")})]}),(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[t("Restored to"),": ",i.restoredTo]}),(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[t("Undo bookmark"),": ",i.undoBookmark]}),(0,r.jsx)("div",{children:(0,r.jsx)(qe,{confirmLabel:t("Confirm undo"),disabled:de||C,onConfirm:Ae,testId:"pitr-undo",children:t("Undo restore")})})]}),e[127]=de,e[128]=Ae,e[129]=i,e[130]=t,e[131]=C,e[132]=ne):ne=e[132];let Ie;return e[133]!==A||e[134]!==L||e[135]!==M||e[136]!==q||e[137]!==se||e[138]!==ne?(Ie=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[A,L,M,q,se,ne]}),e[133]=A,e[134]=L,e[135]=M,e[136]=q,e[137]=se,e[138]=ne,e[139]=Ie):Ie=e[139],Ie},"Nt");export{gt as PitrPanel};
@@ -1 +1 @@
1
- import{i as G}from"./chunk-OKZINWBB.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as E}from"./chunk-NVMQPIRS.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as Q}from"./chunk-S3TDGFRE.js";import{b as $}from"./chunk-UV6GPH2E.js";import"./chunk-L27FKJTG.js";import{a as X}from"./chunk-2G5OZPH5.js";import"./chunk-S7NFUY75.js";import{a as Y,b as Z,c as ee,d as V,e as c,f as d}from"./chunk-J3ZEO3PJ.js";import"./chunk-IR2MDKXQ.js";import"./chunk-PSBRO6JX.js";import"./chunk-EOFWXI3T.js";import{a as U}from"./chunk-LYVYUTQY.js";import{c as O}from"./chunk-KE7ZGUGO.js";import{a as J,e as K}from"./chunk-TN4Z3P6S.js";import"./chunk-UK5OOCLQ.js";import"./chunk-ZPQBVYNN.js";import{B as q,w as H}from"./chunk-PN7JHEYW.js";import"./chunk-PDBW6GTJ.js";import{a as le}from"./chunk-A6TVTNKO.js";import{a as oe,b as ce}from"./chunk-ADABTCDI.js";import{a as s,d as R}from"./chunk-5PEAXTYQ.js";var te=R(le(),1),j=R(oe(),1);var t=R(ce(),1);var re=s(e=>e.endpoint??e.id,"V"),de=s((e,r,i,z)=>{let n=i.trim().toLowerCase(),y=[],o=[];for(let l of e){let m=r==="all"||l.kind===r,h=n===""||`${re(l)} ${l.userId??""}`.toLowerCase().includes(n);m&&h&&(y.push(l),l.lastStatus==="failed"&&o.push(l))}return{failing:o,filtered:z?o:y}},"ie"),me=s(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","oe"),Ce=s(()=>{let e=(0,te.c)(40),r=q(),[i,z]=(0,j.useState)("all"),[n,y]=(0,j.useState)(""),[o,l]=(0,j.useState)(!1),m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={},e[0]=m):m=e[0];let{data:h,error:u,errorSource:k,isLoading:B,refetch:w}=O(U.listPushSubscriptions,m),C;if(e[1]!==h||e[2]!==u||e[3]!==k||e[4]!==o||e[5]!==B||e[6]!==i||e[7]!==w||e[8]!==n||e[9]!==r){let f=h?.subscriptions??[],ae=f.length>=1e3,{failing:se,filtered:F}=de(f,i,n,o),W=se.length,S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=s(a=>{y(a.target.value)},"S"),e[11]=S):S=e[11];let ie=S,I;e[12]!==w?(I=s(()=>{w()},"T"),e[12]=w,e[13]=I):I=e[13];let M=I,_;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=["all","web-push","fcm"],e[14]=_):_=e[14];let ne=_,p;e[15]!==i||e[16]!==r?(p=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:ne.map(a=>(0,t.jsx)(E,{"aria-selected":i===a,"data-testid":`nt-kind-${a}`,onClick:s(()=>{z(a)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===a?"secondary":"ghost",children:a==="all"?r("All"):a},a))}),e[15]=i,e[16]=r,e[17]=p):p=e[17];let T=h!==void 0&&(0,t.jsx)(E,{"aria-pressed":o,"data-testid":"nt-failing-filter",onClick:s(()=>{l(he)},"onClick"),size:"sm",type:"button",variant:o?"secondary":"ghost",children:ae?r("{count}+ failing",{count:W}):r("{count} failing",{count:W})}),g;e[18]!==r?(g=r("Filter devices"),e[18]=r,e[19]=g):g=e[19];let v;e[20]!==r?(v=r("filter endpoint, user"),e[20]=r,e[21]=v):v=e[21];let x;e[22]!==n||e[23]!==g||e[24]!==v?(x=(0,t.jsx)(G,{"aria-label":g,className:"h-8 w-56","data-testid":"nt-search",onChange:ie,placeholder:v,value:n}),e[22]=n,e[23]=g,e[24]=v,e[25]=x):x=e[25];let N;e[26]!==r?(N=r("Refresh"),e[26]=r,e[27]=N):N=e[27];let b;e[28]!==M||e[29]!==N?(b=(0,t.jsx)(E,{className:"ml-auto","data-testid":"nt-refresh",onClick:M,size:"sm",type:"button",variant:"outline",children:N}),e[28]=M,e[29]=N,e[30]=b):b=e[30];let P=f.length>0&&(0,t.jsx)($,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:f.length})}),L;e[31]!==b||e[32]!==P||e[33]!==p||e[34]!==T||e[35]!==x?(L=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,T,x,b,P]}),e[31]=b,e[32]=P,e[33]=p,e[34]=T,e[35]=x,e[36]=L):L=e[36];let A;e[37]!==u||e[38]!==k?(A=u!==null&&(0,t.jsx)(X,{error:k,testId:"nt-error"}),e[37]=u,e[38]=k,e[39]=A):A=e[39],C=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[L,A,u===null&&!B&&F.length===0&&(0,t.jsx)(Q,{description:f.length>0?r("No device matches the current kind, search or failing filter."):r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:f.length>0?r("No matching devices."):r("No registered devices.")}),F.length>0&&(0,t.jsx)(J,{className:"overflow-hidden py-0",children:(0,t.jsx)(K,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(Y,{"data-testid":"nt-table",children:[(0,t.jsx)(Z,{children:(0,t.jsxs)(V,{children:[(0,t.jsx)(c,{children:r("kind")}),(0,t.jsx)(c,{children:r("endpoint")}),(0,t.jsx)(c,{children:r("user")}),(0,t.jsx)(c,{children:r("last seen")}),(0,t.jsx)(c,{children:r("status")}),(0,t.jsx)(c,{children:r("error")})]})}),(0,t.jsx)(ee,{children:F.map(a=>{let D=re(a);return(0,t.jsxs)(V,{"data-testid":"nt-row",children:[(0,t.jsx)(d,{children:(0,t.jsx)($,{variant:"outline",children:a.kind})}),(0,t.jsx)(d,{className:"max-w-[28ch] truncate font-mono text-xs",title:D,children:D}),(0,t.jsx)(d,{className:"max-w-[16ch] truncate font-mono text-xs",children:a.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(d,{className:"text-muted-foreground tabular-nums",children:H(a.lastSeenAt,"\u2014")}),(0,t.jsx)(d,{children:(0,t.jsx)($,{"data-testid":`nt-status-${a.id}`,variant:me(a.lastStatus),children:a.lastStatus??r("n/a")})}),(0,t.jsx)(d,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:a.lastError??void 0,children:a.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},a.id)})})]})})})]}),e[1]=h,e[2]=u,e[3]=k,e[4]=o,e[5]=B,e[6]=i,e[7]=w,e[8]=n,e[9]=r,e[10]=C}else C=e[10];return C},"ke");function he(e){return!e}s(he,"le");export{Ce as default};
1
+ import{i as G}from"./chunk-OKZINWBB.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as E}from"./chunk-NVMQPIRS.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as Q}from"./chunk-S3TDGFRE.js";import{b as $}from"./chunk-UV6GPH2E.js";import"./chunk-L27FKJTG.js";import{a as X}from"./chunk-VXMAQB2K.js";import"./chunk-S7NFUY75.js";import{a as Y,b as Z,c as ee,d as V,e as c,f as d}from"./chunk-J3ZEO3PJ.js";import"./chunk-3R6W72RH.js";import"./chunk-2L3WHXJV.js";import"./chunk-EOFWXI3T.js";import{a as U}from"./chunk-LYVYUTQY.js";import{c as O}from"./chunk-KDMDI7KA.js";import{a as J,e as K}from"./chunk-TN4Z3P6S.js";import"./chunk-QB75Q7U4.js";import"./chunk-ZPQBVYNN.js";import{B as q,w as H}from"./chunk-PN7JHEYW.js";import"./chunk-PDBW6GTJ.js";import{a as le}from"./chunk-A6TVTNKO.js";import{a as oe,b as ce}from"./chunk-ADABTCDI.js";import{a as s,d as R}from"./chunk-5PEAXTYQ.js";var te=R(le(),1),j=R(oe(),1);var t=R(ce(),1);var re=s(e=>e.endpoint??e.id,"V"),de=s((e,r,i,z)=>{let n=i.trim().toLowerCase(),y=[],o=[];for(let l of e){let m=r==="all"||l.kind===r,h=n===""||`${re(l)} ${l.userId??""}`.toLowerCase().includes(n);m&&h&&(y.push(l),l.lastStatus==="failed"&&o.push(l))}return{failing:o,filtered:z?o:y}},"ie"),me=s(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","oe"),Ce=s(()=>{let e=(0,te.c)(40),r=q(),[i,z]=(0,j.useState)("all"),[n,y]=(0,j.useState)(""),[o,l]=(0,j.useState)(!1),m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={},e[0]=m):m=e[0];let{data:h,error:u,errorSource:k,isLoading:B,refetch:w}=O(U.listPushSubscriptions,m),C;if(e[1]!==h||e[2]!==u||e[3]!==k||e[4]!==o||e[5]!==B||e[6]!==i||e[7]!==w||e[8]!==n||e[9]!==r){let f=h?.subscriptions??[],ae=f.length>=1e3,{failing:se,filtered:F}=de(f,i,n,o),W=se.length,S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=s(a=>{y(a.target.value)},"S"),e[11]=S):S=e[11];let ie=S,I;e[12]!==w?(I=s(()=>{w()},"T"),e[12]=w,e[13]=I):I=e[13];let M=I,_;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=["all","web-push","fcm"],e[14]=_):_=e[14];let ne=_,p;e[15]!==i||e[16]!==r?(p=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:ne.map(a=>(0,t.jsx)(E,{"aria-selected":i===a,"data-testid":`nt-kind-${a}`,onClick:s(()=>{z(a)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===a?"secondary":"ghost",children:a==="all"?r("All"):a},a))}),e[15]=i,e[16]=r,e[17]=p):p=e[17];let T=h!==void 0&&(0,t.jsx)(E,{"aria-pressed":o,"data-testid":"nt-failing-filter",onClick:s(()=>{l(he)},"onClick"),size:"sm",type:"button",variant:o?"secondary":"ghost",children:ae?r("{count}+ failing",{count:W}):r("{count} failing",{count:W})}),g;e[18]!==r?(g=r("Filter devices"),e[18]=r,e[19]=g):g=e[19];let v;e[20]!==r?(v=r("filter endpoint, user"),e[20]=r,e[21]=v):v=e[21];let x;e[22]!==n||e[23]!==g||e[24]!==v?(x=(0,t.jsx)(G,{"aria-label":g,className:"h-8 w-56","data-testid":"nt-search",onChange:ie,placeholder:v,value:n}),e[22]=n,e[23]=g,e[24]=v,e[25]=x):x=e[25];let N;e[26]!==r?(N=r("Refresh"),e[26]=r,e[27]=N):N=e[27];let b;e[28]!==M||e[29]!==N?(b=(0,t.jsx)(E,{className:"ml-auto","data-testid":"nt-refresh",onClick:M,size:"sm",type:"button",variant:"outline",children:N}),e[28]=M,e[29]=N,e[30]=b):b=e[30];let P=f.length>0&&(0,t.jsx)($,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:f.length})}),L;e[31]!==b||e[32]!==P||e[33]!==p||e[34]!==T||e[35]!==x?(L=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,T,x,b,P]}),e[31]=b,e[32]=P,e[33]=p,e[34]=T,e[35]=x,e[36]=L):L=e[36];let A;e[37]!==u||e[38]!==k?(A=u!==null&&(0,t.jsx)(X,{error:k,testId:"nt-error"}),e[37]=u,e[38]=k,e[39]=A):A=e[39],C=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[L,A,u===null&&!B&&F.length===0&&(0,t.jsx)(Q,{description:f.length>0?r("No device matches the current kind, search or failing filter."):r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:f.length>0?r("No matching devices."):r("No registered devices.")}),F.length>0&&(0,t.jsx)(J,{className:"overflow-hidden py-0",children:(0,t.jsx)(K,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(Y,{"data-testid":"nt-table",children:[(0,t.jsx)(Z,{children:(0,t.jsxs)(V,{children:[(0,t.jsx)(c,{children:r("kind")}),(0,t.jsx)(c,{children:r("endpoint")}),(0,t.jsx)(c,{children:r("user")}),(0,t.jsx)(c,{children:r("last seen")}),(0,t.jsx)(c,{children:r("status")}),(0,t.jsx)(c,{children:r("error")})]})}),(0,t.jsx)(ee,{children:F.map(a=>{let D=re(a);return(0,t.jsxs)(V,{"data-testid":"nt-row",children:[(0,t.jsx)(d,{children:(0,t.jsx)($,{variant:"outline",children:a.kind})}),(0,t.jsx)(d,{className:"max-w-[28ch] truncate font-mono text-xs",title:D,children:D}),(0,t.jsx)(d,{className:"max-w-[16ch] truncate font-mono text-xs",children:a.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(d,{className:"text-muted-foreground tabular-nums",children:H(a.lastSeenAt,"\u2014")}),(0,t.jsx)(d,{children:(0,t.jsx)($,{"data-testid":`nt-status-${a.id}`,variant:me(a.lastStatus),children:a.lastStatus??r("n/a")})}),(0,t.jsx)(d,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:a.lastError??void 0,children:a.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},a.id)})})]})})})]}),e[1]=h,e[2]=u,e[3]=k,e[4]=o,e[5]=B,e[6]=i,e[7]=w,e[8]=n,e[9]=r,e[10]=C}else C=e[10];return C},"ke");function he(e){return!e}s(he,"le");export{Ce as default};