@lunora/studio 1.0.0-alpha.390 → 1.0.0-alpha.392

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 (107) hide show
  1. package/dist/index.d.mts +1 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/packem_chunks/ai-knowledge.mjs +1 -1
  4. package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
  5. package/dist/standalone/{chunk-OWCTA7GY.js → chunk-22C2K5PS.js} +1 -1
  6. package/dist/standalone/{chunk-EMZ7RPR3.js → chunk-2CMHGYZ4.js} +1 -1
  7. package/dist/standalone/{chunk-Y5QMX4YG.js → chunk-2XAJCKRP.js} +1 -1
  8. package/dist/standalone/{chunk-CXXCVBMK.js → chunk-34USSEJN.js} +1 -1
  9. package/dist/standalone/{chunk-ADS4BJ7K.js → chunk-3HVF5LKQ.js} +1 -1
  10. package/dist/standalone/{chunk-CY45AO5T.js → chunk-3RCYH6UA.js} +1 -1
  11. package/dist/standalone/{chunk-HUL247LG.js → chunk-3YBXNEUY.js} +1 -1
  12. package/dist/standalone/{chunk-ELPLRD4S.js → chunk-4YZAJTU5.js} +1 -1
  13. package/dist/standalone/{chunk-KGQPMSNY.js → chunk-5D73GSOC.js} +1 -1
  14. package/dist/standalone/{chunk-K2LXQ3LS.js → chunk-5FFKYQHT.js} +1 -1
  15. package/dist/standalone/{chunk-375GZTYC.js → chunk-6HZDJA4T.js} +1 -1
  16. package/dist/standalone/{chunk-L6VJTINV.js → chunk-6IDVWVML.js} +1 -1
  17. package/dist/standalone/{chunk-PBXRUYD3.js → chunk-6WTQL4W2.js} +1 -1
  18. package/dist/standalone/{chunk-HLBZ7OAO.js → chunk-6YDEXJRE.js} +1 -1
  19. package/dist/standalone/{chunk-U5UEDY4E.js → chunk-725JLR43.js} +1 -1
  20. package/dist/standalone/{chunk-OQTMT64P.js → chunk-7ELEYWJC.js} +1 -1
  21. package/dist/standalone/{chunk-ATBPQT7F.js → chunk-7ML357XR.js} +1 -1
  22. package/dist/standalone/{chunk-4YVCKOYF.js → chunk-7UPL6MQR.js} +1 -1
  23. package/dist/standalone/{chunk-V3DOKU22.js → chunk-7Z243YUE.js} +1 -1
  24. package/dist/standalone/{chunk-VQQEDEHH.js → chunk-ACCTEC6Y.js} +1 -1
  25. package/dist/standalone/{chunk-V5TGDG6U.js → chunk-AJFMXVR4.js} +1 -1
  26. package/dist/standalone/{chunk-2YDK4MZM.js → chunk-ANHHDGNL.js} +1 -1
  27. package/dist/standalone/{chunk-I6YVDNKQ.js → chunk-ATYVKUH7.js} +1 -1
  28. package/dist/standalone/{chunk-3WYPRZY3.js → chunk-AZ6QNL6G.js} +1 -1
  29. package/dist/standalone/{chunk-4MFQ4XEJ.js → chunk-B34JDEEO.js} +1 -1
  30. package/dist/standalone/{chunk-ZP453BM4.js → chunk-BFEX6HDU.js} +1 -1
  31. package/dist/standalone/{chunk-AXB32N5O.js → chunk-BKKE4QKE.js} +1 -1
  32. package/dist/standalone/{chunk-2ZJJH4YN.js → chunk-CDIV23I2.js} +2 -2
  33. package/dist/standalone/{chunk-IXCSVK2Z.js → chunk-COMBKDVY.js} +1 -1
  34. package/dist/standalone/{chunk-CP3LCFFM.js → chunk-D63EYK5I.js} +1 -1
  35. package/dist/standalone/{chunk-5EIGSLIK.js → chunk-D7UOJY4N.js} +1 -1
  36. package/dist/standalone/{chunk-AQG5OGO4.js → chunk-DW5KLXPI.js} +1 -1
  37. package/dist/standalone/{chunk-AXDXIMCN.js → chunk-DYPC464U.js} +1 -1
  38. package/dist/standalone/{chunk-SGIEXE5J.js → chunk-E3IVOZVW.js} +1 -1
  39. package/dist/standalone/{chunk-CFQQHZYU.js → chunk-EFEAOMEB.js} +1 -1
  40. package/dist/standalone/{chunk-3YCWRKSW.js → chunk-EMNOVYZC.js} +1 -1
  41. package/dist/standalone/{chunk-WEPANQGT.js → chunk-EXHVWM27.js} +1 -1
  42. package/dist/standalone/{chunk-MNN3YCKF.js → chunk-EYBS3Q7O.js} +1 -1
  43. package/dist/standalone/{chunk-WXZ334CL.js → chunk-EZ5PVGPY.js} +1 -1
  44. package/dist/standalone/{chunk-KZXSJF7K.js → chunk-FNBNPTCM.js} +1 -1
  45. package/dist/standalone/{chunk-EZMAQE3T.js → chunk-FT5WEK3S.js} +1 -1
  46. package/dist/standalone/{chunk-CQDENTSP.js → chunk-GVPVWT3Q.js} +1 -1
  47. package/dist/standalone/{chunk-ZADOHFZB.js → chunk-H2HGJURT.js} +1 -1
  48. package/dist/standalone/{chunk-HCK62XWB.js → chunk-HWG2R642.js} +1 -1
  49. package/dist/standalone/{chunk-FYAUOSTX.js → chunk-HYAGF6A5.js} +1 -1
  50. package/dist/standalone/{chunk-UFS6UP4Z.js → chunk-I37WFNA6.js} +1 -1
  51. package/dist/standalone/{chunk-LOEVTOKP.js → chunk-IFU5WQHZ.js} +1 -1
  52. package/dist/standalone/{chunk-APCHI5CD.js → chunk-INDH6PRB.js} +1 -1
  53. package/dist/standalone/{chunk-U7NVTULW.js → chunk-JKTAHFTK.js} +1 -1
  54. package/dist/standalone/{chunk-23MMGFHI.js → chunk-JPL3WAVW.js} +1 -1
  55. package/dist/standalone/chunk-K2I3AGZR.js +1 -0
  56. package/dist/standalone/{chunk-RJJRUUTE.js → chunk-KBPMT33Z.js} +1 -1
  57. package/dist/standalone/{chunk-ZJIYJZ6F.js → chunk-KMBE7RTC.js} +1 -1
  58. package/dist/standalone/{chunk-6K4F727K.js → chunk-KULAZ4W3.js} +1 -1
  59. package/dist/standalone/{chunk-V4B7ZPEG.js → chunk-LEF32Q5K.js} +1 -1
  60. package/dist/standalone/{chunk-YLC2ZYCL.js → chunk-LFWS6VBU.js} +1 -1
  61. package/dist/standalone/{chunk-QTWNCDLK.js → chunk-MA2KXG2L.js} +1 -1
  62. package/dist/standalone/{chunk-DZV6YFWZ.js → chunk-MPGM6L64.js} +1 -1
  63. package/dist/standalone/{chunk-L7TFQUD7.js → chunk-MVWMRJD5.js} +1 -1
  64. package/dist/standalone/{chunk-OJR7BDKC.js → chunk-N4P6WYRV.js} +1 -1
  65. package/dist/standalone/{chunk-LRUYEVHH.js → chunk-NP6H72XD.js} +1 -1
  66. package/dist/standalone/{chunk-XV2XEUUB.js → chunk-NPHGFVNE.js} +1 -1
  67. package/dist/standalone/{chunk-CO6R6GCX.js → chunk-NRWR25MB.js} +1 -1
  68. package/dist/standalone/{chunk-HMMALUXM.js → chunk-O46IV64X.js} +1 -1
  69. package/dist/standalone/{chunk-BRPLE2Z6.js → chunk-O56AZXG6.js} +1 -1
  70. package/dist/standalone/{chunk-BHUWAGFN.js → chunk-OOPMRFI2.js} +1 -1
  71. package/dist/standalone/chunk-OZUPOUHR.js +1 -0
  72. package/dist/standalone/{chunk-O66HDCZT.js → chunk-PLDE5R5Y.js} +1 -1
  73. package/dist/standalone/{chunk-NAGIOR23.js → chunk-PRVBT5AJ.js} +1 -1
  74. package/dist/standalone/{chunk-JZN3MNJX.js → chunk-PUTERXSU.js} +1 -1
  75. package/dist/standalone/{chunk-2M37OAK3.js → chunk-PYG3TDLZ.js} +1 -1
  76. package/dist/standalone/{chunk-CBTPJPCZ.js → chunk-QHI77TGI.js} +1 -1
  77. package/dist/standalone/{chunk-NP6CBOPK.js → chunk-QIROOZNJ.js} +1 -1
  78. package/dist/standalone/{chunk-Y2AKO63C.js → chunk-QMZKJK53.js} +1 -1
  79. package/dist/standalone/{chunk-HJOXP6C3.js → chunk-RIHWRGFS.js} +1 -1
  80. package/dist/standalone/{chunk-FKAOFBS3.js → chunk-RN32N6ZO.js} +1 -1
  81. package/dist/standalone/{chunk-ERUKFS3I.js → chunk-RTD3B67U.js} +1 -1
  82. package/dist/standalone/{chunk-3OVQC66W.js → chunk-RUCMNPTD.js} +1 -1
  83. package/dist/standalone/{chunk-BU5VWXRR.js → chunk-RZJAZ5ED.js} +1 -1
  84. package/dist/standalone/{chunk-7ASIMMZY.js → chunk-S64V5MAT.js} +1 -1
  85. package/dist/standalone/{chunk-EKXAE4PS.js → chunk-TFH347JK.js} +1 -1
  86. package/dist/standalone/{chunk-KIQ34774.js → chunk-TJ76NZTD.js} +1 -1
  87. package/dist/standalone/{chunk-CVJDEN5L.js → chunk-TJV64AXT.js} +1 -1
  88. package/dist/standalone/{chunk-P3ML7HGE.js → chunk-TVDBLCXQ.js} +1 -1
  89. package/dist/standalone/{chunk-LYWT6GTX.js → chunk-TVJFKXX4.js} +1 -1
  90. package/dist/standalone/{chunk-NFI2TNKU.js → chunk-UDKKUJHY.js} +1 -1
  91. package/dist/standalone/{chunk-W5BTAOHO.js → chunk-UEONVTOV.js} +1 -1
  92. package/dist/standalone/{chunk-JQBVRWFN.js → chunk-UNUSBFIC.js} +1 -1
  93. package/dist/standalone/{chunk-LLD7TMBV.js → chunk-UQ3WOVL2.js} +1 -1
  94. package/dist/standalone/{chunk-2OSZRVNW.js → chunk-UW34S35F.js} +1 -1
  95. package/dist/standalone/{chunk-UL5XVKGR.js → chunk-XHDCFSC6.js} +1 -1
  96. package/dist/standalone/{chunk-2CDROYSG.js → chunk-XKK5ABPC.js} +1 -1
  97. package/dist/standalone/{chunk-BWBECJFT.js → chunk-XYWMQVZ2.js} +1 -1
  98. package/dist/standalone/chunk-YESGXFAR.js +7 -0
  99. package/dist/standalone/{chunk-2D4WBSDO.js → chunk-Z6PYAG36.js} +1 -1
  100. package/dist/standalone/{chunk-BWHVY6L6.js → chunk-Z7ZRXPPE.js} +1 -1
  101. package/dist/standalone/{chunk-LLSK6QBX.js → chunk-ZHDO7DYM.js} +1 -1
  102. package/dist/standalone/{chunk-EYSF4DHD.js → chunk-ZIY53FID.js} +1 -1
  103. package/dist/standalone/studio.js +1 -1
  104. package/package.json +3 -3
  105. package/dist/standalone/chunk-IL64HWFW.js +0 -1
  106. package/dist/standalone/chunk-K5W5C237.js +0 -1
  107. package/dist/standalone/chunk-QFN62JQJ.js +0 -7
@@ -1,4 +1,4 @@
1
- import{a as dt,b as Or,c as uo}from"./chunk-LLSK6QBX.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-ATBPQT7F.js";import{a as ro}from"./chunk-WXZ334CL.js";import{a as co,b as He,f as Vr,g as Er}from"./chunk-LOEVTOKP.js";import{a as Ot}from"./chunk-UL5XVKGR.js";import{a as ao}from"./chunk-JNWK5MJC.js";import{a as Tr}from"./chunk-DZV6YFWZ.js";import{a as rn}from"./chunk-MNN3YCKF.js";import"./chunk-CQDENTSP.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-ERUKFS3I.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-YLC2ZYCL.js";import{a as Fr,b as kr}from"./chunk-EDL46BPM.js";import{a as en}from"./chunk-W5BTAOHO.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-2D4WBSDO.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as oo}from"./chunk-CBTPJPCZ.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as no}from"./chunk-HMMALUXM.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-ZJIYJZ6F.js";import{a as _e}from"./chunk-LYVYUTQY.js";import{b as Zo,c as lt}from"./chunk-LRUYEVHH.js";import{b as Qo,c as Xo,d as Yt,e as fr,n as et}from"./chunk-QFN62JQJ.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-2ZJJH4YN.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-ZHDO7DYM.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-7ML357XR.js";import{a as ro}from"./chunk-EZ5PVGPY.js";import{a as co,b as He,f as Vr,g as Er}from"./chunk-IFU5WQHZ.js";import{a as Ot}from"./chunk-XHDCFSC6.js";import{a as ao}from"./chunk-JNWK5MJC.js";import{a as Tr}from"./chunk-MPGM6L64.js";import{a as rn}from"./chunk-EYBS3Q7O.js";import"./chunk-GVPVWT3Q.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-RTD3B67U.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-LFWS6VBU.js";import{a as Fr,b as kr}from"./chunk-EDL46BPM.js";import{a as en}from"./chunk-UEONVTOV.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-Z6PYAG36.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as oo}from"./chunk-QHI77TGI.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as no}from"./chunk-O46IV64X.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-KMBE7RTC.js";import{a as _e}from"./chunk-LYVYUTQY.js";import{b as Zo,c as lt}from"./chunk-NP6H72XD.js";import{b as Qo,c as Xo,d as Yt,e as fr,n as et}from"./chunk-YESGXFAR.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-CDIV23I2.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 we,b as Ge}from"./chunk-QHVUXMRV.js";import{i as je,k as He}from"./chunk-2NUCBQFU.js";import{a as Ee,b as Pe,c as Ne,d as De,e as Be,g as Me,h as Fe}from"./chunk-2D4WBSDO.js";import{I as Se,J as Ve,K as Le,L as Te,M as Oe,N as _e,b as U,l as Ae}from"./chunk-4SY2N2RS.js";import{b as ve,c as Re}from"./chunk-SCTYLLJT.js";import{b as Ce,v as M}from"./chunk-OZID3UYF.js";import{b as ke,d as ge,e as ye,i as Ie,j as H}from"./chunk-L27FKJTG.js";import{x as he}from"./chunk-2ZJJH4YN.js";import{a as Et}from"./chunk-A6TVTNKO.js";import{a as A,b as xe}from"./chunk-ADABTCDI.js";import{a as i,c as It,d as C}from"./chunk-5PEAXTYQ.js";var Qe=C(Et(),1);var V={};It(V,{Indicator:()=>$e,Root:()=>Ye});var l=C(A(),1);function Ue(o){if(!o)return null;for(let e of o.elements){let r=e.tagName;if(r==="BUTTON"||r==="INPUT"){let a=e;if(a.type==="submit")return a}}return null}i(Ue,"getDefaultFormSubmitter");var qe="data-checked",We="data-unchecked";function q(o){return{checked(e){return o.indeterminate?{}:e?{[qe]:""}:{[We]:""}},...Ee}}i(q,"getCheckboxStateAttributesMapping");var ze=C(A(),1);function Ke(o,e,r,a=!0,s){let[f,p]=ze.useState(),P=U(s?`${s}-label`:void 0),b=o??e??f;return M(()=>{let x=o||e||!a?void 0:Nt(r.current,P);f!==x&&p(x)}),b}i(Ke,"useAriaLabelledBy");function Nt(o,e){let r=Dt(o);if(r)return!r.id&&e&&(r.id=e),r.id||void 0}i(Nt,"getAriaLabelledBy");function Dt(o){if(!o)return;let e=o.parentElement;if(e&&e.tagName==="LABEL")return e;let r=o.id;if(r){let s=o.nextElementSibling;if(s&&s.htmlFor===r)return s}let a=o.labels;return a&&a[0]}i(Dt,"findAssociatedLabel");var W=C(A(),1);var Bt=W.createContext(void 0);function Je(){return W.useContext(Bt)}i(Je,"useCheckboxGroupContext");var z=C(A(),1);var ie=z.createContext(void 0);function Xe(){let o=z.useContext(ie);if(o===void 0)throw new Error(ge(14));return o}i(Xe,"useCheckboxRootContext");var S=C(xe(),1);var At="data-parent",Ye=l.forwardRef(i(function(e,r){let{checked:a,className:s,defaultChecked:f=!1,"aria-labelledby":p,disabled:P=!1,form:b,id:x,indeterminate:N=!1,inputRef:X,name:L,onCheckedChange:F,parent:u=!1,readOnly:y=!1,render:ae,required:I=!1,uncheckedValue:T,value:O,nativeButton:_=!1,style:Mt,...Ze}=e,{clearErrors:et}=Ne(),{disabled:tt,name:ot,setDirty:rt,setFilled:se,setFocused:de,setTouched:nt,state:ce,validationMode:it,validityData:at,validation:st}=Pe(),dt=Me(),{labelId:ct,registerControlId:ut,getDescriptionProps:ue}=De(),n=Je(),k=n?.allValues===void 0?void 0:n.parent,w=k!==void 0,c=tt||dt.disabled||n?.disabled||P,E=ot??L,d=O??E,le=U(),lt=n?.registerControlId!==ut,Y=Be({id:x||void 0,enabled:lt}),ft=_?Y:le,$={};w&&(u?$=k.getParentProps():d!==void 0&&($=k.getChildProps(d)));let{checked:fe=a,indeterminate:pt=N,onCheckedChange:mt,...bt}=$,Q=n?.value,G=l.useRef(null),{getButtonProps:xt,buttonRef:ht}=Re({disabled:c,native:_}),D=n?.validation??st,[m,Ct]=Le({controlled:d!==void 0&&Q!==void 0&&!u?Q.includes(d):fe,default:f,name:"Checkbox",state:"checked"}),Z=w?!!fe:m,B=w&&pt||N;Fe(G,le,m,void 0,!n&&!c,L);let ee=k?.registerChildId,g=l.useRef(null),pe=D.registerInput,me=n?d:void 0,kt=l.useCallback(t=>pe(t,{controlRef:G,value:me}),[pe,me]),gt=ye(X,g,u?void 0:kt),vt=Ke(p,ct,g,!_,Y);M(()=>{g.current&&(g.current.indeterminate=B),n||se(m)},[m,B,n,se]),Te(m,()=>{n||(et(E),rt(m!==at.initialValue),D.change(m))});let Rt=ke({checked:m,disabled:c,form:b,name:u?void 0:E,id:_?void 0:Y,required:I,ref:gt,style:E?Ge:we,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(t){if(t.nativeEvent.defaultPrevented)return;if(y){t.preventDefault();return}let h=t.currentTarget.checked,v=_e(Oe.none,t.nativeEvent);if(F?.(h,v),!v.isCanceled&&(mt?.(h,v),!v.isCanceled&&(Ct(h),d!==void 0&&n!==void 0&&!u&&!w))){let R=h?[...n.value,d]:n.value.filter(j=>j!==d);n.setValue(R,v)}},onClick(t){t.stopPropagation()},onFocus(){G.current?.focus()}},O!==void 0?{value:(n?m&&O:O)||""}:Ie,ue,t=>D.getValidationProps(c,t));l.useEffect(()=>{if(!k||d===void 0)return;let t=k.disabledStatesRef.current;return t.set(d,c),()=>{t.delete(d)}},[k,c,d]);let te=l.useMemo(()=>({...ce,checked:Z,disabled:c,readOnly:y,required:I,indeterminate:B}),[ce,Z,c,y,I,B]),yt=q(te),be=H("span",e,{state:te,ref:[ht,G,r],props:[{id:ft,role:"checkbox","aria-checked":B?"mixed":Z,"aria-readonly":y||void 0,"aria-required":I||void 0,"aria-labelledby":vt,[At]:u?"":void 0,onFocus(){c||de(!0)},onBlur(){let t=g.current;t&&(nt(!0),de(!1),it==="onBlur"&&D.commit(n?Q:t.checked))},onKeyDown(t){if(t.key!=="Enter"||(t.preventBaseUIHandler(),t.defaultPrevented))return;let h=g.current?.form??null,v=t.currentTarget,R=t.nativeEvent,j=t.preventDefault,re=R.preventDefault,ne=!1;t.preventDefault=()=>{ne=!0,j.call(t)},R.preventDefault=()=>{ne=!0,re.call(R)},re.call(R),Ce(v).queueMicrotask(()=>{t.preventDefault=j,R.preventDefault=re,ne||Ue(h)?.click()})},onClick(t){if(y||c)return;t.preventDefault();let h=g.current;h&&ve(h,t)}},Ze,bt,xt,ue,t=>D.getValidationProps(c,t)],stateAttributesMapping:yt}),oe=be.props.id;return M(()=>{if(!(!ee||u||d===void 0||oe===void 0))return ee(d,oe)},[ee,u,d,oe]),(0,S.jsxs)(ie.Provider,{value:te,children:[be,!m&&!n&&E&&!u&&T!==void 0&&(0,S.jsx)("input",{type:"hidden",form:b,name:E,value:T,disabled:c}),(0,S.jsx)("input",{...Rt,suppressHydrationWarning:!0})]})},"CheckboxRoot"));var K=C(A(),1);var $e=K.forwardRef(i(function(e,r){let{render:a,className:s,style:f,keepMounted:p=!1,...P}=e,b=Xe(),x=b.checked||b.indeterminate,{mounted:N,transitionStatus:X,setMounted:L}=Ve(x),F=K.useRef(null),u={...b,transitionStatus:X};Se({batch:!0,enabled:!x,open:x,ref:F,onComplete(){x||L(!1)}});let ae={...q(b),...Ae},I=p||N,T=H("span",e,{ref:[r,F],state:u,stateAttributesMapping:ae,props:P});return I?T:null},"CheckboxIndicator"));var J=C(xe(),1);function Fo(o){let e=(0,Qe.c)(9),r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let s;e[3]!==r?(s=he("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",r),e[3]=r,e[4]=s):s=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,J.jsx)(V.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,J.jsx)(He,{icon:je,strokeWidth:2})}),e[5]=f):f=e[5];let p;return e[6]!==a||e[7]!==s?(p=(0,J.jsx)(V.Root,{"data-slot":"checkbox",className:s,...a,children:f}),e[6]=a,e[7]=s,e[8]=p):p=e[8],p}i(Fo,"v");export{Fo as a};
1
+ import{a as we,b as Ge}from"./chunk-QHVUXMRV.js";import{i as je,k as He}from"./chunk-2NUCBQFU.js";import{a as Ee,b as Pe,c as Ne,d as De,e as Be,g as Me,h as Fe}from"./chunk-Z6PYAG36.js";import{I as Se,J as Ve,K as Le,L as Te,M as Oe,N as _e,b as U,l as Ae}from"./chunk-4SY2N2RS.js";import{b as ve,c as Re}from"./chunk-SCTYLLJT.js";import{b as Ce,v as M}from"./chunk-OZID3UYF.js";import{b as ke,d as ge,e as ye,i as Ie,j as H}from"./chunk-L27FKJTG.js";import{x as he}from"./chunk-CDIV23I2.js";import{a as Et}from"./chunk-A6TVTNKO.js";import{a as A,b as xe}from"./chunk-ADABTCDI.js";import{a as i,c as It,d as C}from"./chunk-5PEAXTYQ.js";var Qe=C(Et(),1);var V={};It(V,{Indicator:()=>$e,Root:()=>Ye});var l=C(A(),1);function Ue(o){if(!o)return null;for(let e of o.elements){let r=e.tagName;if(r==="BUTTON"||r==="INPUT"){let a=e;if(a.type==="submit")return a}}return null}i(Ue,"getDefaultFormSubmitter");var qe="data-checked",We="data-unchecked";function q(o){return{checked(e){return o.indeterminate?{}:e?{[qe]:""}:{[We]:""}},...Ee}}i(q,"getCheckboxStateAttributesMapping");var ze=C(A(),1);function Ke(o,e,r,a=!0,s){let[f,p]=ze.useState(),P=U(s?`${s}-label`:void 0),b=o??e??f;return M(()=>{let x=o||e||!a?void 0:Nt(r.current,P);f!==x&&p(x)}),b}i(Ke,"useAriaLabelledBy");function Nt(o,e){let r=Dt(o);if(r)return!r.id&&e&&(r.id=e),r.id||void 0}i(Nt,"getAriaLabelledBy");function Dt(o){if(!o)return;let e=o.parentElement;if(e&&e.tagName==="LABEL")return e;let r=o.id;if(r){let s=o.nextElementSibling;if(s&&s.htmlFor===r)return s}let a=o.labels;return a&&a[0]}i(Dt,"findAssociatedLabel");var W=C(A(),1);var Bt=W.createContext(void 0);function Je(){return W.useContext(Bt)}i(Je,"useCheckboxGroupContext");var z=C(A(),1);var ie=z.createContext(void 0);function Xe(){let o=z.useContext(ie);if(o===void 0)throw new Error(ge(14));return o}i(Xe,"useCheckboxRootContext");var S=C(xe(),1);var At="data-parent",Ye=l.forwardRef(i(function(e,r){let{checked:a,className:s,defaultChecked:f=!1,"aria-labelledby":p,disabled:P=!1,form:b,id:x,indeterminate:N=!1,inputRef:X,name:L,onCheckedChange:F,parent:u=!1,readOnly:y=!1,render:ae,required:I=!1,uncheckedValue:T,value:O,nativeButton:_=!1,style:Mt,...Ze}=e,{clearErrors:et}=Ne(),{disabled:tt,name:ot,setDirty:rt,setFilled:se,setFocused:de,setTouched:nt,state:ce,validationMode:it,validityData:at,validation:st}=Pe(),dt=Me(),{labelId:ct,registerControlId:ut,getDescriptionProps:ue}=De(),n=Je(),k=n?.allValues===void 0?void 0:n.parent,w=k!==void 0,c=tt||dt.disabled||n?.disabled||P,E=ot??L,d=O??E,le=U(),lt=n?.registerControlId!==ut,Y=Be({id:x||void 0,enabled:lt}),ft=_?Y:le,$={};w&&(u?$=k.getParentProps():d!==void 0&&($=k.getChildProps(d)));let{checked:fe=a,indeterminate:pt=N,onCheckedChange:mt,...bt}=$,Q=n?.value,G=l.useRef(null),{getButtonProps:xt,buttonRef:ht}=Re({disabled:c,native:_}),D=n?.validation??st,[m,Ct]=Le({controlled:d!==void 0&&Q!==void 0&&!u?Q.includes(d):fe,default:f,name:"Checkbox",state:"checked"}),Z=w?!!fe:m,B=w&&pt||N;Fe(G,le,m,void 0,!n&&!c,L);let ee=k?.registerChildId,g=l.useRef(null),pe=D.registerInput,me=n?d:void 0,kt=l.useCallback(t=>pe(t,{controlRef:G,value:me}),[pe,me]),gt=ye(X,g,u?void 0:kt),vt=Ke(p,ct,g,!_,Y);M(()=>{g.current&&(g.current.indeterminate=B),n||se(m)},[m,B,n,se]),Te(m,()=>{n||(et(E),rt(m!==at.initialValue),D.change(m))});let Rt=ke({checked:m,disabled:c,form:b,name:u?void 0:E,id:_?void 0:Y,required:I,ref:gt,style:E?Ge:we,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(t){if(t.nativeEvent.defaultPrevented)return;if(y){t.preventDefault();return}let h=t.currentTarget.checked,v=_e(Oe.none,t.nativeEvent);if(F?.(h,v),!v.isCanceled&&(mt?.(h,v),!v.isCanceled&&(Ct(h),d!==void 0&&n!==void 0&&!u&&!w))){let R=h?[...n.value,d]:n.value.filter(j=>j!==d);n.setValue(R,v)}},onClick(t){t.stopPropagation()},onFocus(){G.current?.focus()}},O!==void 0?{value:(n?m&&O:O)||""}:Ie,ue,t=>D.getValidationProps(c,t));l.useEffect(()=>{if(!k||d===void 0)return;let t=k.disabledStatesRef.current;return t.set(d,c),()=>{t.delete(d)}},[k,c,d]);let te=l.useMemo(()=>({...ce,checked:Z,disabled:c,readOnly:y,required:I,indeterminate:B}),[ce,Z,c,y,I,B]),yt=q(te),be=H("span",e,{state:te,ref:[ht,G,r],props:[{id:ft,role:"checkbox","aria-checked":B?"mixed":Z,"aria-readonly":y||void 0,"aria-required":I||void 0,"aria-labelledby":vt,[At]:u?"":void 0,onFocus(){c||de(!0)},onBlur(){let t=g.current;t&&(nt(!0),de(!1),it==="onBlur"&&D.commit(n?Q:t.checked))},onKeyDown(t){if(t.key!=="Enter"||(t.preventBaseUIHandler(),t.defaultPrevented))return;let h=g.current?.form??null,v=t.currentTarget,R=t.nativeEvent,j=t.preventDefault,re=R.preventDefault,ne=!1;t.preventDefault=()=>{ne=!0,j.call(t)},R.preventDefault=()=>{ne=!0,re.call(R)},re.call(R),Ce(v).queueMicrotask(()=>{t.preventDefault=j,R.preventDefault=re,ne||Ue(h)?.click()})},onClick(t){if(y||c)return;t.preventDefault();let h=g.current;h&&ve(h,t)}},Ze,bt,xt,ue,t=>D.getValidationProps(c,t)],stateAttributesMapping:yt}),oe=be.props.id;return M(()=>{if(!(!ee||u||d===void 0||oe===void 0))return ee(d,oe)},[ee,u,d,oe]),(0,S.jsxs)(ie.Provider,{value:te,children:[be,!m&&!n&&E&&!u&&T!==void 0&&(0,S.jsx)("input",{type:"hidden",form:b,name:E,value:T,disabled:c}),(0,S.jsx)("input",{...Rt,suppressHydrationWarning:!0})]})},"CheckboxRoot"));var K=C(A(),1);var $e=K.forwardRef(i(function(e,r){let{render:a,className:s,style:f,keepMounted:p=!1,...P}=e,b=Xe(),x=b.checked||b.indeterminate,{mounted:N,transitionStatus:X,setMounted:L}=Ve(x),F=K.useRef(null),u={...b,transitionStatus:X};Se({batch:!0,enabled:!x,open:x,ref:F,onComplete(){x||L(!1)}});let ae={...q(b),...Ae},I=p||N,T=H("span",e,{ref:[r,F],state:u,stateAttributesMapping:ae,props:P});return I?T:null},"CheckboxIndicator"));var J=C(xe(),1);function Fo(o){let e=(0,Qe.c)(9),r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let s;e[3]!==r?(s=he("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",r),e[3]=r,e[4]=s):s=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,J.jsx)(V.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,J.jsx)(He,{icon:je,strokeWidth:2})}),e[5]=f):f=e[5];let p;return e[6]!==a||e[7]!==s?(p=(0,J.jsx)(V.Root,{"data-slot":"checkbox",className:s,...a,children:f}),e[6]=a,e[7]=s,e[8]=p):p=e[8],p}i(Fo,"v");export{Fo as a};
@@ -1 +1 @@
1
- import{a as we}from"./chunk-VQQEDEHH.js";import{a as ve}from"./chunk-W5BTAOHO.js";import{i as me}from"./chunk-2D4WBSDO.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as q}from"./chunk-CBTPJPCZ.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as ue}from"./chunk-HMMALUXM.js";import"./chunk-L27FKJTG.js";import{a as ae,b as re,c as ne,d as L,e as h,f as p}from"./chunk-ZJIYJZ6F.js";import{a as X}from"./chunk-LYVYUTQY.js";import{c as Ne}from"./chunk-LRUYEVHH.js";import{a as ee,e as te}from"./chunk-XV2XEUUB.js";import{n as ce}from"./chunk-QFN62JQJ.js";import"./chunk-ZPQBVYNN.js";import{B as Y,h as ie,i as de,j as U,p as pe,s as z}from"./chunk-2ZJJH4YN.js";import"./chunk-PDBW6GTJ.js";import{a as be}from"./chunk-A6TVTNKO.js";import{a as ke,b as Se}from"./chunk-ADABTCDI.js";import{a as s,d as he}from"./chunk-5PEAXTYQ.js";var xe=he(be(),1),i=he(ke(),1);var t=he(Se(),1);var Ce=["queued","running","rollingBack","paused","waiting","complete","errored","terminated"],Oe=["pause","resume","restart","terminate"],Ie=s(l=>{let e=(0,xe.c)(7),{busy:w,id:x,onAct:N}=l,b=Y(),a;e[0]!==w||e[1]!==x||e[2]!==N||e[3]!==b?(a=Oe.map(m=>m==="restart"?(0,t.jsx)(ve,{confirmLabel:b("Restart?"),disabled:w,onConfirm:s(()=>{N(m)},"onConfirm"),testId:`workflow-instance-${m}-${x}`,children:b(m)},m):(0,t.jsx)(q,{"data-testid":`workflow-instance-${m}-${x}`,disabled:w,onClick:s(()=>{N(m)},"onClick"),size:"sm",type:"button",variant:"ghost",children:b(m)},m)),e[0]=w,e[1]=x,e[2]=N,e[3]=b,e[4]=a):a=e[4];let d;return e[5]!==a?(d=(0,t.jsx)(t.Fragment,{children:a}),e[5]=a,e[6]=d):d=e[6],d},"Ce"),$e="WORKFLOWS_NOT_CONFIGURED",We=s(l=>typeof l=="object"&&l!==null&&l.code===$e,"Oe"),Ae=s(l=>{let e=l.error??l.output;if(e===void 0)return"\u2014";try{return JSON.stringify(e,pe)}catch{return"(unserializable)"}},"Ee"),Te=s(({loadDetail:l,loadInstances:e,readOnly:w,runAction:x,workflowName:N})=>{let b=ce(),a=Y(),[d,m]=(0,i.useState)(null),[v,R]=(0,i.useState)(null),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(null),[F,W]=(0,i.useState)(!1),[_,j]=(0,i.useState)(null),g=(0,i.useRef)(0),y=(0,i.useRef)(0),k=(0,i.useRef)(0),A=l??(n=>b.getWorkflowInstance(n)),I=w?void 0:x??(e===void 0?n=>b.setWorkflowInstanceStatus(n):void 0),T=s(async()=>{y.current+=1;let n=y.current;O(null),W(!1);let u=S===""?void 0:S;try{if(e===void 0){let r=await b.listWorkflowInstances({name:N,status:u});if(n!==y.current)return;if(r.configured===!1){m(null),W(!0);return}m(r.instances);return}let f=await e({name:N,status:u});n===y.current&&m(f)}catch(f){if(n!==y.current)return;m(null),We(f)?W(!0):O(U(f))}},"E");(0,i.useEffect)(()=>{g.current+=1,k.current+=1,R(null),z(T())},[N,S]);let P=s(async n=>{k.current+=1;let u=k.current;O(null);try{let f=await A({id:n,name:N});u===k.current&&R(f)}catch(f){u===k.current&&O(U(f))}},"W"),E=s(()=>{k.current+=1,R(null)},"A"),J=s(async(n,u)=>{if(I===void 0)return;let f=g.current;j(n),O(null);try{await I({action:u,id:n,name:N}),f===g.current&&await T()}catch(r){O(U(r))}j(null)},"L");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:a("Instance history")}),(0,t.jsxs)("select",{"aria-label":a("Filter by status"),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":"workflow-instances-filter",onChange:s(n=>{B(n.target.value)},"onChange"),value:S,children:[(0,t.jsx)("option",{value:"",children:a("All statuses")}),Ce.map(n=>(0,t.jsx)("option",{value:n,children:n},n))]})]}),C!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:C}),F&&(0,t.jsx)(ue,{description:a("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:a("Workflow inspection not configured")}),!F&&d!==null&&d.length===0&&(0,t.jsx)(ue,{description:a("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:a("No instances")}),d!==null&&d.length>0&&(0,t.jsx)(ee,{className:"overflow-hidden py-0",children:(0,t.jsx)(te,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflow-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(h,{children:a("Instance id")}),(0,t.jsx)(h,{children:a("Status")}),(0,t.jsx)(h,{children:a("Created")}),(0,t.jsx)(h,{children:a("Ended")}),(0,t.jsx)(h,{"aria-label":a("Actions")})]})}),(0,t.jsx)(ne,{children:d.map(n=>(0,t.jsxs)(L,{"data-testid":`workflow-instance-${n.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:n.status}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.createdOn??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.endedOn??"\u2014"}),(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsx)(q,{"data-testid":`workflow-instance-steps-${n.id}`,onClick:s(()=>{z(P(n.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:a("Steps")}),I!==void 0&&(0,t.jsx)(Ie,{busy:_===n.id,id:n.id,onAct:s(u=>{z(J(n.id,u))},"onAct")},N)]})})]},n.id))})]})})}),v!==null&&(0,t.jsx)(ee,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,t.jsxs)(te,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"font-mono text-xs",children:[a("Steps")," \xB7 ",v.id]}),(0,t.jsx)(q,{"data-testid":"workflow-instance-detail-close",onClick:E,size:"xs",type:"button",variant:"ghost",children:a("Close")})]}),v.steps.length===0?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a("This instance has no recorded steps yet.")}):(0,t.jsxs)(ae,{"data-testid":"workflow-instance-steps",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(h,{children:a("Step")}),(0,t.jsx)(h,{children:a("Type")}),(0,t.jsx)(h,{children:a("Attempts")}),(0,t.jsx)(h,{children:a("Started")}),(0,t.jsx)(h,{children:a("Output")})]})}),(0,t.jsx)(ne,{children:v.steps.map((n,u)=>(0,t.jsxs)(L,{"data-testid":`workflow-step-${String(u)}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.name}),(0,t.jsx)(p,{className:"text-xs text-muted-foreground",children:n.type??"\u2014"}),(0,t.jsx)(p,{className:"tabular-nums",children:n.attempts??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.start??"\u2014"}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:Ae(n)})]},`${n.name}:${String(u)}`))})]})]})})]})},"_e"),_e=ie(X.createWorkflowInstance),Ee=ie(X.getWorkflowInstanceStatus),Je=ie(X.sendWorkflowEvent),De=s(l=>{if(l.error)return`${l.error.name}: ${l.error.message}`;if(l.output===void 0)return"\u2014";try{return JSON.stringify(l.output,pe)}catch{return"(unserializable)"}},"$e"),ge=s(l=>{let e=l.trim();if(e==="")return{value:void 0};try{return{value:JSON.parse(e)}}catch{return null}},"ve"),Fe=s((l,e)=>l.some(w=>w.exportName===e)?e:l[0]?.exportName??"","Fe"),Pe=s(l=>{let e=(0,xe.c)(72),{eventTypes:w,exportName:x,onSent:N}=l,b=ce(),a=Y(),[d,m]=(0,i.useState)(""),[v,R]=(0,i.useState)(""),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(!1),[F,W]=(0,i.useState)(null),_;e[0]!==b||e[1]!==x||e[2]!==N||e[3]!==a||e[4]!==v?(_=s(async(D,oe)=>{try{await b.query(Je,{exportName:x,id:D,payload:oe,type:v},de(""))}catch(fe){W(U(fe));return}try{await N(x,D)}catch(fe){let ye=fe;W(`${a("Event sent, but refreshing the instance failed")}: ${U(ye)}`)}},"_"),e[0]=b,e[1]=x,e[2]=N,e[3]=a,e[4]=v,e[5]=_):_=e[5];let j=_,g;e[6]!==j||e[7]!==d||e[8]!==S||e[9]!==a?(g=s(async()=>{let D=d.trim(),oe=ge(S);if(oe===null){W(a("Payload must be valid JSON"));return}O(!0),W(null),await j(D,oe.value).finally(()=>{O(!1)})},"N"),e[6]=j,e[7]=d,e[8]=S,e[9]=a,e[10]=g):g=e[10];let y=g,k;e[11]!==a?(k=a("Send event"),e[11]=a,e[12]=k):k=e[12];let A;e[13]!==k?(A=(0,t.jsx)("h3",{className:"text-sm font-medium",children:k}),e[13]=k,e[14]=A):A=e[14];let I;e[15]!==F?(I=F!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-event-error",role:"alert",children:F}),e[15]=F,e[16]=I):I=e[16];let T;e[17]!==a?(T=a("Instance id"),e[17]=a,e[18]=T):T=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=s(D=>{m(D.target.value)},"O"),e[19]=P):P=e[19];let E;e[20]!==a?(E=a("Instance id"),e[20]=a,e[21]=E):E=e[21];let J;e[22]!==d||e[23]!==T||e[24]!==E?(J=(0,t.jsx)(me,{"aria-label":T,className:"max-w-48","data-testid":"workflows-event-id",onChange:P,placeholder:E,value:d}),e[22]=d,e[23]=T,e[24]=E,e[25]=J):J=e[25];let n;e[26]!==a?(n=a("Event type"),e[26]=a,e[27]=n):n=e[27];let u;e[28]===Symbol.for("react.memo_cache_sentinel")?(u=s(D=>{R(D.target.value)},"L"),e[28]=u):u=e[28];let f;e[29]!==a?(f=a("Event type"),e[29]=a,e[30]=f):f=e[30];let r;e[31]!==n||e[32]!==f||e[33]!==v?(r=(0,t.jsx)(me,{"aria-label":n,className:"max-w-48","data-testid":"workflows-event-type",list:"workflows-event-types",onChange:u,placeholder:f,value:v}),e[31]=n,e[32]=f,e[33]=v,e[34]=r):r=e[34];let c;e[35]!==w?(c=w.map(Le),e[35]=w,e[36]=c):c=e[36];let o;e[37]!==c?(o=(0,t.jsx)("datalist",{"data-testid":"workflows-event-types",id:"workflows-event-types",children:c}),e[37]=c,e[38]=o):o=e[38];let $;e[39]!==x||e[40]!==d||e[41]!==C||e[42]!==v?($=C||x===""||d.trim()===""||v.trim()==="",e[39]=x,e[40]=d,e[41]=C,e[42]=v,e[43]=$):$=e[43];let K;e[44]!==y?(K=s(()=>{z(y())},"z"),e[44]=y,e[45]=K):K=e[45];let G;e[46]!==C||e[47]!==a?(G=a(C?"Sending\u2026":"Send event"),e[46]=C,e[47]=a,e[48]=G):G=e[48];let M;e[49]!==$||e[50]!==K||e[51]!==G?(M=(0,t.jsx)(q,{"data-testid":"workflows-event-button",disabled:$,onClick:K,children:G}),e[49]=$,e[50]=K,e[51]=G,e[52]=M):M=e[52];let Z;e[53]!==r||e[54]!==o||e[55]!==M||e[56]!==J?(Z=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[J,r,o,M]}),e[53]=r,e[54]=o,e[55]=M,e[56]=J,e[57]=Z):Z=e[57];let H;e[58]!==a?(H=a("Payload (JSON)"),e[58]=a,e[59]=H):H=e[59];let se;e[60]===Symbol.for("react.memo_cache_sentinel")?(se=s(D=>{B(D.target.value)},"Y"),e[60]=se):se=e[60];let Q;e[61]!==a?(Q=a("Payload (JSON, optional)"),e[61]=a,e[62]=Q):Q=e[62];let V;e[63]!==S||e[64]!==H||e[65]!==Q?(V=(0,t.jsx)(we,{"aria-label":H,className:"font-mono","data-testid":"workflows-event-payload",onChange:se,placeholder:Q,value:S}),e[63]=S,e[64]=H,e[65]=Q,e[66]=V):V=e[66];let le;return e[67]!==Z||e[68]!==V||e[69]!==A||e[70]!==I?(le=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-event",children:[A,I,Z,V]}),e[67]=Z,e[68]=V,e[69]=A,e[70]=I,e[71]=le):le=e[71],le},"Pe"),Ve=s(()=>{let l=ce(),e=Y(),{data:w,error:x}=Ne(X.listWorkflows,{}),[N,b]=(0,i.useState)(""),[a,d]=(0,i.useState)(""),[m,v]=(0,i.useState)(""),[R,S]=(0,i.useState)(!1),[B,C]=(0,i.useState)(null),[O,F]=(0,i.useState)([]),[W,_]=(0,i.useState)(null),j=w!==void 0,g=Array.isArray(w?.workflows)?[...w.workflows].toSorted((r,c)=>r.exportName.localeCompare(c.exportName)):[],y=Fe(g,N),k=g.find(r=>r.exportName===y),A=s(r=>{F(c=>{let o=c.filter($=>!($.exportName===r.exportName&&$.id===r.id));return[r,...o]})},"T"),I=s(async()=>{let r=y;if(r==="")return;let c=ge(m);if(c===null){C(e("Params must be valid JSON"));return}S(!0),C(null);try{let o=a.trim(),$=await l.query(_e,{exportName:r,id:o===""?void 0:o,params:c.value},de(""));A({exportName:r,id:$.id,status:$.status}),d("")}catch(o){C(U(o))}S(!1)},"F"),T=s(()=>{z(I())},"P"),P=s(async(r,c)=>{_(c);try{let o=await l.query(Ee,{exportName:r,id:c},de(""));A({error:o.error,exportName:r,id:o.id,output:o.output,status:o.status})}catch(o){throw _(null),o}_(null)},"O"),E=s(async(r,c)=>{try{await P(r,c)}catch(o){C(U(o))}},"E"),J=s(r=>{b(r.target.value)},"W"),n=s(r=>{d(r.target.value)},"A"),u=s(r=>{v(r.target.value)},"L"),f=s(r=>{let{export:c,id:o}=r.currentTarget.dataset;c!==void 0&&o!==void 0&&z(E(c,o))},"n");return(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:x}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),j&&g.length===0?(0,t.jsx)(ue,{description:e("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:e("No workflows defined")}):(0,t.jsx)(ee,{className:"overflow-hidden py-0",children:(0,t.jsx)(te,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(h,{children:e("Export")}),(0,t.jsx)(h,{children:e("Name")}),(0,t.jsx)(h,{children:e("Class")})]})}),(0,t.jsx)(ne,{children:g.map(r=>(0,t.jsxs)(L,{"data-testid":`workflows-row-${r.exportName}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.name}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.className})]},r.exportName))})]})})}),g.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Start instance")}),B!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:B}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":e("Workflow"),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":"workflows-start-select",onChange:J,value:y,children:g.map(r=>(0,t.jsx)("option",{value:r.exportName,children:r.exportName},r.exportName))}),(0,t.jsx)(me,{"aria-label":e("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:n,placeholder:e("Instance id (optional)"),value:a}),(0,t.jsx)(q,{"data-testid":"workflows-start-button",disabled:R||y==="",onClick:T,children:e(R?"Starting\u2026":"Start instance")})]}),(0,t.jsx)(we,{"aria-label":e("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:u,placeholder:e("Params (JSON, optional)"),value:m})]}),g.length>0&&(0,t.jsx)(Pe,{eventTypes:w?.eventTypes??[],exportName:y,onSent:P},y),O.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Instances")}),(0,t.jsx)(ee,{className:"overflow-hidden py-0",children:(0,t.jsx)(te,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(h,{children:e("Workflow")}),(0,t.jsx)(h,{children:e("Instance id")}),(0,t.jsx)(h,{children:e("Status")}),(0,t.jsx)(h,{children:e("Output")}),(0,t.jsx)(h,{})]})}),(0,t.jsx)(ne,{children:O.map(r=>(0,t.jsxs)(L,{"data-testid":`workflows-instance-${r.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:r.status}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:De(r)}),(0,t.jsx)(p,{children:(0,t.jsx)(q,{"data-export":r.exportName,"data-id":r.id,"data-testid":`workflows-instance-refresh-${r.id}`,disabled:W===r.id,onClick:f,size:"xs",variant:"outline",children:W===r.id?e("Refreshing\u2026"):e("Refresh")})})]},`${r.exportName}:${r.id}`))})]})})})]}),k!==void 0&&(0,t.jsx)(Te,{workflowName:k.name})]})},"Ze");function Le(l){return(0,t.jsx)("option",{value:l,children:l},l)}s(Le,"De");export{Ve as default};
1
+ import{a as we}from"./chunk-ACCTEC6Y.js";import{a as ve}from"./chunk-UEONVTOV.js";import{i as me}from"./chunk-Z6PYAG36.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as q}from"./chunk-QHI77TGI.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as ue}from"./chunk-O46IV64X.js";import"./chunk-L27FKJTG.js";import{a as ae,b as re,c as ne,d as L,e as h,f as p}from"./chunk-KMBE7RTC.js";import{a as X}from"./chunk-LYVYUTQY.js";import{c as Ne}from"./chunk-NP6H72XD.js";import{a as ee,e as te}from"./chunk-NPHGFVNE.js";import{n as ce}from"./chunk-YESGXFAR.js";import"./chunk-ZPQBVYNN.js";import{B as Y,h as ie,i as de,j as U,p as pe,s as z}from"./chunk-CDIV23I2.js";import"./chunk-PDBW6GTJ.js";import{a as be}from"./chunk-A6TVTNKO.js";import{a as ke,b as Se}from"./chunk-ADABTCDI.js";import{a as s,d as he}from"./chunk-5PEAXTYQ.js";var xe=he(be(),1),i=he(ke(),1);var t=he(Se(),1);var Ce=["queued","running","rollingBack","paused","waiting","complete","errored","terminated"],Oe=["pause","resume","restart","terminate"],Ie=s(l=>{let e=(0,xe.c)(7),{busy:w,id:x,onAct:N}=l,b=Y(),a;e[0]!==w||e[1]!==x||e[2]!==N||e[3]!==b?(a=Oe.map(m=>m==="restart"?(0,t.jsx)(ve,{confirmLabel:b("Restart?"),disabled:w,onConfirm:s(()=>{N(m)},"onConfirm"),testId:`workflow-instance-${m}-${x}`,children:b(m)},m):(0,t.jsx)(q,{"data-testid":`workflow-instance-${m}-${x}`,disabled:w,onClick:s(()=>{N(m)},"onClick"),size:"sm",type:"button",variant:"ghost",children:b(m)},m)),e[0]=w,e[1]=x,e[2]=N,e[3]=b,e[4]=a):a=e[4];let d;return e[5]!==a?(d=(0,t.jsx)(t.Fragment,{children:a}),e[5]=a,e[6]=d):d=e[6],d},"Ce"),$e="WORKFLOWS_NOT_CONFIGURED",We=s(l=>typeof l=="object"&&l!==null&&l.code===$e,"Oe"),Ae=s(l=>{let e=l.error??l.output;if(e===void 0)return"\u2014";try{return JSON.stringify(e,pe)}catch{return"(unserializable)"}},"Ee"),Te=s(({loadDetail:l,loadInstances:e,readOnly:w,runAction:x,workflowName:N})=>{let b=ce(),a=Y(),[d,m]=(0,i.useState)(null),[v,R]=(0,i.useState)(null),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(null),[F,W]=(0,i.useState)(!1),[_,j]=(0,i.useState)(null),g=(0,i.useRef)(0),y=(0,i.useRef)(0),k=(0,i.useRef)(0),A=l??(n=>b.getWorkflowInstance(n)),I=w?void 0:x??(e===void 0?n=>b.setWorkflowInstanceStatus(n):void 0),T=s(async()=>{y.current+=1;let n=y.current;O(null),W(!1);let u=S===""?void 0:S;try{if(e===void 0){let r=await b.listWorkflowInstances({name:N,status:u});if(n!==y.current)return;if(r.configured===!1){m(null),W(!0);return}m(r.instances);return}let f=await e({name:N,status:u});n===y.current&&m(f)}catch(f){if(n!==y.current)return;m(null),We(f)?W(!0):O(U(f))}},"E");(0,i.useEffect)(()=>{g.current+=1,k.current+=1,R(null),z(T())},[N,S]);let P=s(async n=>{k.current+=1;let u=k.current;O(null);try{let f=await A({id:n,name:N});u===k.current&&R(f)}catch(f){u===k.current&&O(U(f))}},"W"),E=s(()=>{k.current+=1,R(null)},"A"),J=s(async(n,u)=>{if(I===void 0)return;let f=g.current;j(n),O(null);try{await I({action:u,id:n,name:N}),f===g.current&&await T()}catch(r){O(U(r))}j(null)},"L");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:a("Instance history")}),(0,t.jsxs)("select",{"aria-label":a("Filter by status"),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":"workflow-instances-filter",onChange:s(n=>{B(n.target.value)},"onChange"),value:S,children:[(0,t.jsx)("option",{value:"",children:a("All statuses")}),Ce.map(n=>(0,t.jsx)("option",{value:n,children:n},n))]})]}),C!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:C}),F&&(0,t.jsx)(ue,{description:a("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:a("Workflow inspection not configured")}),!F&&d!==null&&d.length===0&&(0,t.jsx)(ue,{description:a("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:a("No instances")}),d!==null&&d.length>0&&(0,t.jsx)(ee,{className:"overflow-hidden py-0",children:(0,t.jsx)(te,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflow-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(h,{children:a("Instance id")}),(0,t.jsx)(h,{children:a("Status")}),(0,t.jsx)(h,{children:a("Created")}),(0,t.jsx)(h,{children:a("Ended")}),(0,t.jsx)(h,{"aria-label":a("Actions")})]})}),(0,t.jsx)(ne,{children:d.map(n=>(0,t.jsxs)(L,{"data-testid":`workflow-instance-${n.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:n.status}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.createdOn??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.endedOn??"\u2014"}),(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsx)(q,{"data-testid":`workflow-instance-steps-${n.id}`,onClick:s(()=>{z(P(n.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:a("Steps")}),I!==void 0&&(0,t.jsx)(Ie,{busy:_===n.id,id:n.id,onAct:s(u=>{z(J(n.id,u))},"onAct")},N)]})})]},n.id))})]})})}),v!==null&&(0,t.jsx)(ee,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,t.jsxs)(te,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"font-mono text-xs",children:[a("Steps")," \xB7 ",v.id]}),(0,t.jsx)(q,{"data-testid":"workflow-instance-detail-close",onClick:E,size:"xs",type:"button",variant:"ghost",children:a("Close")})]}),v.steps.length===0?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a("This instance has no recorded steps yet.")}):(0,t.jsxs)(ae,{"data-testid":"workflow-instance-steps",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(h,{children:a("Step")}),(0,t.jsx)(h,{children:a("Type")}),(0,t.jsx)(h,{children:a("Attempts")}),(0,t.jsx)(h,{children:a("Started")}),(0,t.jsx)(h,{children:a("Output")})]})}),(0,t.jsx)(ne,{children:v.steps.map((n,u)=>(0,t.jsxs)(L,{"data-testid":`workflow-step-${String(u)}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.name}),(0,t.jsx)(p,{className:"text-xs text-muted-foreground",children:n.type??"\u2014"}),(0,t.jsx)(p,{className:"tabular-nums",children:n.attempts??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.start??"\u2014"}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:Ae(n)})]},`${n.name}:${String(u)}`))})]})]})})]})},"_e"),_e=ie(X.createWorkflowInstance),Ee=ie(X.getWorkflowInstanceStatus),Je=ie(X.sendWorkflowEvent),De=s(l=>{if(l.error)return`${l.error.name}: ${l.error.message}`;if(l.output===void 0)return"\u2014";try{return JSON.stringify(l.output,pe)}catch{return"(unserializable)"}},"$e"),ge=s(l=>{let e=l.trim();if(e==="")return{value:void 0};try{return{value:JSON.parse(e)}}catch{return null}},"ve"),Fe=s((l,e)=>l.some(w=>w.exportName===e)?e:l[0]?.exportName??"","Fe"),Pe=s(l=>{let e=(0,xe.c)(72),{eventTypes:w,exportName:x,onSent:N}=l,b=ce(),a=Y(),[d,m]=(0,i.useState)(""),[v,R]=(0,i.useState)(""),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(!1),[F,W]=(0,i.useState)(null),_;e[0]!==b||e[1]!==x||e[2]!==N||e[3]!==a||e[4]!==v?(_=s(async(D,oe)=>{try{await b.query(Je,{exportName:x,id:D,payload:oe,type:v},de(""))}catch(fe){W(U(fe));return}try{await N(x,D)}catch(fe){let ye=fe;W(`${a("Event sent, but refreshing the instance failed")}: ${U(ye)}`)}},"_"),e[0]=b,e[1]=x,e[2]=N,e[3]=a,e[4]=v,e[5]=_):_=e[5];let j=_,g;e[6]!==j||e[7]!==d||e[8]!==S||e[9]!==a?(g=s(async()=>{let D=d.trim(),oe=ge(S);if(oe===null){W(a("Payload must be valid JSON"));return}O(!0),W(null),await j(D,oe.value).finally(()=>{O(!1)})},"N"),e[6]=j,e[7]=d,e[8]=S,e[9]=a,e[10]=g):g=e[10];let y=g,k;e[11]!==a?(k=a("Send event"),e[11]=a,e[12]=k):k=e[12];let A;e[13]!==k?(A=(0,t.jsx)("h3",{className:"text-sm font-medium",children:k}),e[13]=k,e[14]=A):A=e[14];let I;e[15]!==F?(I=F!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-event-error",role:"alert",children:F}),e[15]=F,e[16]=I):I=e[16];let T;e[17]!==a?(T=a("Instance id"),e[17]=a,e[18]=T):T=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=s(D=>{m(D.target.value)},"O"),e[19]=P):P=e[19];let E;e[20]!==a?(E=a("Instance id"),e[20]=a,e[21]=E):E=e[21];let J;e[22]!==d||e[23]!==T||e[24]!==E?(J=(0,t.jsx)(me,{"aria-label":T,className:"max-w-48","data-testid":"workflows-event-id",onChange:P,placeholder:E,value:d}),e[22]=d,e[23]=T,e[24]=E,e[25]=J):J=e[25];let n;e[26]!==a?(n=a("Event type"),e[26]=a,e[27]=n):n=e[27];let u;e[28]===Symbol.for("react.memo_cache_sentinel")?(u=s(D=>{R(D.target.value)},"L"),e[28]=u):u=e[28];let f;e[29]!==a?(f=a("Event type"),e[29]=a,e[30]=f):f=e[30];let r;e[31]!==n||e[32]!==f||e[33]!==v?(r=(0,t.jsx)(me,{"aria-label":n,className:"max-w-48","data-testid":"workflows-event-type",list:"workflows-event-types",onChange:u,placeholder:f,value:v}),e[31]=n,e[32]=f,e[33]=v,e[34]=r):r=e[34];let c;e[35]!==w?(c=w.map(Le),e[35]=w,e[36]=c):c=e[36];let o;e[37]!==c?(o=(0,t.jsx)("datalist",{"data-testid":"workflows-event-types",id:"workflows-event-types",children:c}),e[37]=c,e[38]=o):o=e[38];let $;e[39]!==x||e[40]!==d||e[41]!==C||e[42]!==v?($=C||x===""||d.trim()===""||v.trim()==="",e[39]=x,e[40]=d,e[41]=C,e[42]=v,e[43]=$):$=e[43];let K;e[44]!==y?(K=s(()=>{z(y())},"z"),e[44]=y,e[45]=K):K=e[45];let G;e[46]!==C||e[47]!==a?(G=a(C?"Sending\u2026":"Send event"),e[46]=C,e[47]=a,e[48]=G):G=e[48];let M;e[49]!==$||e[50]!==K||e[51]!==G?(M=(0,t.jsx)(q,{"data-testid":"workflows-event-button",disabled:$,onClick:K,children:G}),e[49]=$,e[50]=K,e[51]=G,e[52]=M):M=e[52];let Z;e[53]!==r||e[54]!==o||e[55]!==M||e[56]!==J?(Z=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[J,r,o,M]}),e[53]=r,e[54]=o,e[55]=M,e[56]=J,e[57]=Z):Z=e[57];let H;e[58]!==a?(H=a("Payload (JSON)"),e[58]=a,e[59]=H):H=e[59];let se;e[60]===Symbol.for("react.memo_cache_sentinel")?(se=s(D=>{B(D.target.value)},"Y"),e[60]=se):se=e[60];let Q;e[61]!==a?(Q=a("Payload (JSON, optional)"),e[61]=a,e[62]=Q):Q=e[62];let V;e[63]!==S||e[64]!==H||e[65]!==Q?(V=(0,t.jsx)(we,{"aria-label":H,className:"font-mono","data-testid":"workflows-event-payload",onChange:se,placeholder:Q,value:S}),e[63]=S,e[64]=H,e[65]=Q,e[66]=V):V=e[66];let le;return e[67]!==Z||e[68]!==V||e[69]!==A||e[70]!==I?(le=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-event",children:[A,I,Z,V]}),e[67]=Z,e[68]=V,e[69]=A,e[70]=I,e[71]=le):le=e[71],le},"Pe"),Ve=s(()=>{let l=ce(),e=Y(),{data:w,error:x}=Ne(X.listWorkflows,{}),[N,b]=(0,i.useState)(""),[a,d]=(0,i.useState)(""),[m,v]=(0,i.useState)(""),[R,S]=(0,i.useState)(!1),[B,C]=(0,i.useState)(null),[O,F]=(0,i.useState)([]),[W,_]=(0,i.useState)(null),j=w!==void 0,g=Array.isArray(w?.workflows)?[...w.workflows].toSorted((r,c)=>r.exportName.localeCompare(c.exportName)):[],y=Fe(g,N),k=g.find(r=>r.exportName===y),A=s(r=>{F(c=>{let o=c.filter($=>!($.exportName===r.exportName&&$.id===r.id));return[r,...o]})},"T"),I=s(async()=>{let r=y;if(r==="")return;let c=ge(m);if(c===null){C(e("Params must be valid JSON"));return}S(!0),C(null);try{let o=a.trim(),$=await l.query(_e,{exportName:r,id:o===""?void 0:o,params:c.value},de(""));A({exportName:r,id:$.id,status:$.status}),d("")}catch(o){C(U(o))}S(!1)},"F"),T=s(()=>{z(I())},"P"),P=s(async(r,c)=>{_(c);try{let o=await l.query(Ee,{exportName:r,id:c},de(""));A({error:o.error,exportName:r,id:o.id,output:o.output,status:o.status})}catch(o){throw _(null),o}_(null)},"O"),E=s(async(r,c)=>{try{await P(r,c)}catch(o){C(U(o))}},"E"),J=s(r=>{b(r.target.value)},"W"),n=s(r=>{d(r.target.value)},"A"),u=s(r=>{v(r.target.value)},"L"),f=s(r=>{let{export:c,id:o}=r.currentTarget.dataset;c!==void 0&&o!==void 0&&z(E(c,o))},"n");return(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:x}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),j&&g.length===0?(0,t.jsx)(ue,{description:e("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:e("No workflows defined")}):(0,t.jsx)(ee,{className:"overflow-hidden py-0",children:(0,t.jsx)(te,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(h,{children:e("Export")}),(0,t.jsx)(h,{children:e("Name")}),(0,t.jsx)(h,{children:e("Class")})]})}),(0,t.jsx)(ne,{children:g.map(r=>(0,t.jsxs)(L,{"data-testid":`workflows-row-${r.exportName}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.name}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.className})]},r.exportName))})]})})}),g.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Start instance")}),B!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:B}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":e("Workflow"),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":"workflows-start-select",onChange:J,value:y,children:g.map(r=>(0,t.jsx)("option",{value:r.exportName,children:r.exportName},r.exportName))}),(0,t.jsx)(me,{"aria-label":e("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:n,placeholder:e("Instance id (optional)"),value:a}),(0,t.jsx)(q,{"data-testid":"workflows-start-button",disabled:R||y==="",onClick:T,children:e(R?"Starting\u2026":"Start instance")})]}),(0,t.jsx)(we,{"aria-label":e("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:u,placeholder:e("Params (JSON, optional)"),value:m})]}),g.length>0&&(0,t.jsx)(Pe,{eventTypes:w?.eventTypes??[],exportName:y,onSent:P},y),O.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Instances")}),(0,t.jsx)(ee,{className:"overflow-hidden py-0",children:(0,t.jsx)(te,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(L,{children:[(0,t.jsx)(h,{children:e("Workflow")}),(0,t.jsx)(h,{children:e("Instance id")}),(0,t.jsx)(h,{children:e("Status")}),(0,t.jsx)(h,{children:e("Output")}),(0,t.jsx)(h,{})]})}),(0,t.jsx)(ne,{children:O.map(r=>(0,t.jsxs)(L,{"data-testid":`workflows-instance-${r.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:r.status}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:De(r)}),(0,t.jsx)(p,{children:(0,t.jsx)(q,{"data-export":r.exportName,"data-id":r.id,"data-testid":`workflows-instance-refresh-${r.id}`,disabled:W===r.id,onClick:f,size:"xs",variant:"outline",children:W===r.id?e("Refreshing\u2026"):e("Refresh")})})]},`${r.exportName}:${r.id}`))})]})})})]}),k!==void 0&&(0,t.jsx)(Te,{workflowName:k.name})]})},"Ze");function Le(l){return(0,t.jsx)("option",{value:l,children:l},l)}s(Le,"De");export{Ve as default};
@@ -1 +1 @@
1
- import{a as c}from"./chunk-QLZGKBOW.js";import{i as e}from"./chunk-7WGZSDRS.js";import{s as m}from"./chunk-2ZJJH4YN.js";import{a as n}from"./chunk-A6TVTNKO.js";import{a as s,d as p}from"./chunk-5PEAXTYQ.js";var f=p(n(),1);var h=s(r=>{let t=(0,f.c)(3),a=e(),o;return t[0]!==a||t[1]!==r?(o=s(i=>{c({shardKey:r,traceId:i}),m(a({to:"/traces"}))},"e"),t[0]=a,t[1]=r,t[2]=o):o=t[2],o},"u");export{h as a};
1
+ import{a as c}from"./chunk-QLZGKBOW.js";import{i as e}from"./chunk-7WGZSDRS.js";import{s as m}from"./chunk-CDIV23I2.js";import{a as n}from"./chunk-A6TVTNKO.js";import{a as s,d as p}from"./chunk-5PEAXTYQ.js";var f=p(n(),1);var h=s(r=>{let t=(0,f.c)(3),a=e(),o;return t[0]!==a||t[1]!==r?(o=s(i=>{c({shardKey:r,traceId:i}),m(a({to:"/traces"}))},"e"),t[0]=a,t[1]=r,t[2]=o):o=t[2],o},"u");export{h as a};
@@ -1 +1 @@
1
- import{x as s}from"./chunk-2ZJJH4YN.js";import{a as c}from"./chunk-A6TVTNKO.js";import{b}from"./chunk-ADABTCDI.js";import{a as d,d as o}from"./chunk-5PEAXTYQ.js";var l=o(c(),1);var u=o(b(),1);function p(n){let i=(0,l.c)(8),r,e;i[0]!==n?({className:r,...e}=n,i[0]=n,i[1]=r,i[2]=e):(r=i[1],e=i[2]);let t;i[3]!==r?(t=s("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),i[3]=r,i[4]=t):t=i[4];let a;return i[5]!==e||i[6]!==t?(a=(0,u.jsx)("textarea",{"data-slot":"textarea",className:t,...e}),i[5]=e,i[6]=t,i[7]=a):a=i[7],a}d(p,"b");export{p as a};
1
+ import{x as s}from"./chunk-CDIV23I2.js";import{a as c}from"./chunk-A6TVTNKO.js";import{b}from"./chunk-ADABTCDI.js";import{a as d,d as o}from"./chunk-5PEAXTYQ.js";var l=o(c(),1);var u=o(b(),1);function p(n){let i=(0,l.c)(8),r,e;i[0]!==n?({className:r,...e}=n,i[0]=n,i[1]=r,i[2]=e):(r=i[1],e=i[2]);let t;i[3]!==r?(t=s("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),i[3]=r,i[4]=t):t=i[4];let a;return i[5]!==e||i[6]!==t?(a=(0,u.jsx)("textarea",{"data-slot":"textarea",className:t,...e}),i[5]=e,i[6]=t,i[7]=a):a=i[7],a}d(p,"b");export{p as a};
@@ -1 +1 @@
1
- import{a as k,b as y}from"./chunk-LJLNIVUA.js";import{b as N}from"./chunk-BHUWAGFN.js";import{B as b,w}from"./chunk-2ZJJH4YN.js";import{a as _}from"./chunk-A6TVTNKO.js";import{a as S,b as E}from"./chunk-ADABTCDI.js";import{a as h,d as x}from"./chunk-5PEAXTYQ.js";var v=x(_(),1);var j=x(S(),1);var l=x(E(),1);var F={debug:"secondary",error:"destructive",fatal:"destructive",info:"outline",log:"outline",trace:"outline",warn:"secondary"},L=h(f=>{let e=(0,v.c)(19),{errors:t}=f,i=b(),[r,u]=(0,j.useState)(!1),s,m;if(e[0]!==t||e[1]!==r||e[2]!==i){let g=t.map(B).join(", ");s=r,m=i(r?"Hide the stack and cause of {field}":"Show the stack and cause of {field}",{field:g}),e[0]=t,e[1]=r,e[2]=i,e[3]=s,e[4]=m}else s=e[3],m=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=h(()=>{u(C)},"i"),e[5]=c):c=e[5];let p=r?"\u25BE":"\u25B8",a;e[6]!==i?(a=i("Error details"),e[6]=i,e[7]=a):a=e[7];let n;e[8]!==s||e[9]!==m||e[10]!==p||e[11]!==a?(n=(0,l.jsxs)("button",{"aria-expanded":s,"aria-label":m,className:"shrink-0 pl-2 text-[11px] text-destructive underline-offset-2 hover:underline","data-testid":"lg-error-toggle",onClick:c,type:"button",children:[p," ",a]}),e[8]=s,e[9]=m,e[10]=p,e[11]=a,e[12]=n):n=e[12];let o;e[13]!==t||e[14]!==r?(o=r?(0,l.jsx)("pre",{className:"order-last mt-1 basis-full overflow-x-auto whitespace-pre rounded-md bg-muted/50 p-2 font-mono text-[11px] leading-snug text-muted-foreground","data-testid":"lg-error-detail",children:k(t)}):null,e[13]=t,e[14]=r,e[15]=o):o=e[15];let d;return e[16]!==n||e[17]!==o?(d=(0,l.jsxs)(l.Fragment,{children:[n,o]}),e[16]=n,e[17]=o,e[18]=d):d=e[18],d},"_");function B(f){let[e]=f;return e}h(B,"j");function C(f){return!f}h(C,"F");var q=h(f=>{let e=(0,v.c)(24),{entry:t}=f,i;e[0]!==t.fields?(i=y(t.fields),e[0]=t.fields,e[1]=i):i=e[1];let r=i,u;e[2]!==t.timestamp?(u=w(t.timestamp),e[2]=t.timestamp,e[3]=u):u=e[3];let s;e[4]!==u?(s=(0,l.jsx)("span",{className:"w-44 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:u}),e[4]=u,e[5]=s):s=e[5];let m=F[t.level],c;e[6]!==t.level||e[7]!==m?(c=(0,l.jsx)("span",{className:"w-20 shrink-0",role:"gridcell",children:(0,l.jsx)(N,{variant:m,children:t.level})}),e[6]=t.level,e[7]=m,e[8]=c):c=e[8];let p=t.functionPath??"\u2014",a;e[9]!==p?(a=(0,l.jsx)("span",{className:"w-48 shrink-0 truncate text-muted-foreground",role:"gridcell",children:p}),e[9]=p,e[10]=a):a=e[10];let n;e[11]!==r.text?(n=r.text===""?null:(0,l.jsx)("span",{className:"ml-2 text-muted-foreground","data-testid":"lg-fields",children:r.text}),e[11]=r.text,e[12]=n):n=e[12];let o;e[13]!==t.message||e[14]!==n?(o=(0,l.jsxs)("span",{className:"min-w-0 flex-1 truncate",role:"gridcell",children:[t.message,n]}),e[13]=t.message,e[14]=n,e[15]=o):o=e[15];let d;e[16]!==r.errors?(d=r.errors.length===0?null:(0,l.jsx)("span",{className:"contents",role:"gridcell",children:(0,l.jsx)(L,{errors:r.errors})}),e[16]=r.errors,e[17]=d):d=e[17];let g;return e[18]!==d||e[19]!==s||e[20]!==c||e[21]!==a||e[22]!==o?(g=(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center",role:"none",children:[s,c,a,o,d]}),e[18]=d,e[19]=s,e[20]=c,e[21]=a,e[22]=o,e[23]=g):g=e[23],g},"D");export{F as a,L as b,q as c};
1
+ import{a as k,b as y}from"./chunk-LJLNIVUA.js";import{b as N}from"./chunk-OOPMRFI2.js";import{B as b,w}from"./chunk-CDIV23I2.js";import{a as _}from"./chunk-A6TVTNKO.js";import{a as S,b as E}from"./chunk-ADABTCDI.js";import{a as h,d as x}from"./chunk-5PEAXTYQ.js";var v=x(_(),1);var j=x(S(),1);var l=x(E(),1);var F={debug:"secondary",error:"destructive",fatal:"destructive",info:"outline",log:"outline",trace:"outline",warn:"secondary"},L=h(f=>{let e=(0,v.c)(19),{errors:t}=f,i=b(),[r,u]=(0,j.useState)(!1),s,m;if(e[0]!==t||e[1]!==r||e[2]!==i){let g=t.map(B).join(", ");s=r,m=i(r?"Hide the stack and cause of {field}":"Show the stack and cause of {field}",{field:g}),e[0]=t,e[1]=r,e[2]=i,e[3]=s,e[4]=m}else s=e[3],m=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=h(()=>{u(C)},"i"),e[5]=c):c=e[5];let p=r?"\u25BE":"\u25B8",a;e[6]!==i?(a=i("Error details"),e[6]=i,e[7]=a):a=e[7];let n;e[8]!==s||e[9]!==m||e[10]!==p||e[11]!==a?(n=(0,l.jsxs)("button",{"aria-expanded":s,"aria-label":m,className:"shrink-0 pl-2 text-[11px] text-destructive underline-offset-2 hover:underline","data-testid":"lg-error-toggle",onClick:c,type:"button",children:[p," ",a]}),e[8]=s,e[9]=m,e[10]=p,e[11]=a,e[12]=n):n=e[12];let o;e[13]!==t||e[14]!==r?(o=r?(0,l.jsx)("pre",{className:"order-last mt-1 basis-full overflow-x-auto whitespace-pre rounded-md bg-muted/50 p-2 font-mono text-[11px] leading-snug text-muted-foreground","data-testid":"lg-error-detail",children:k(t)}):null,e[13]=t,e[14]=r,e[15]=o):o=e[15];let d;return e[16]!==n||e[17]!==o?(d=(0,l.jsxs)(l.Fragment,{children:[n,o]}),e[16]=n,e[17]=o,e[18]=d):d=e[18],d},"_");function B(f){let[e]=f;return e}h(B,"j");function C(f){return!f}h(C,"F");var q=h(f=>{let e=(0,v.c)(24),{entry:t}=f,i;e[0]!==t.fields?(i=y(t.fields),e[0]=t.fields,e[1]=i):i=e[1];let r=i,u;e[2]!==t.timestamp?(u=w(t.timestamp),e[2]=t.timestamp,e[3]=u):u=e[3];let s;e[4]!==u?(s=(0,l.jsx)("span",{className:"w-44 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:u}),e[4]=u,e[5]=s):s=e[5];let m=F[t.level],c;e[6]!==t.level||e[7]!==m?(c=(0,l.jsx)("span",{className:"w-20 shrink-0",role:"gridcell",children:(0,l.jsx)(N,{variant:m,children:t.level})}),e[6]=t.level,e[7]=m,e[8]=c):c=e[8];let p=t.functionPath??"\u2014",a;e[9]!==p?(a=(0,l.jsx)("span",{className:"w-48 shrink-0 truncate text-muted-foreground",role:"gridcell",children:p}),e[9]=p,e[10]=a):a=e[10];let n;e[11]!==r.text?(n=r.text===""?null:(0,l.jsx)("span",{className:"ml-2 text-muted-foreground","data-testid":"lg-fields",children:r.text}),e[11]=r.text,e[12]=n):n=e[12];let o;e[13]!==t.message||e[14]!==n?(o=(0,l.jsxs)("span",{className:"min-w-0 flex-1 truncate",role:"gridcell",children:[t.message,n]}),e[13]=t.message,e[14]=n,e[15]=o):o=e[15];let d;e[16]!==r.errors?(d=r.errors.length===0?null:(0,l.jsx)("span",{className:"contents",role:"gridcell",children:(0,l.jsx)(L,{errors:r.errors})}),e[16]=r.errors,e[17]=d):d=e[17];let g;return e[18]!==d||e[19]!==s||e[20]!==c||e[21]!==a||e[22]!==o?(g=(0,l.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center",role:"none",children:[s,c,a,o,d]}),e[18]=d,e[19]=s,e[20]=c,e[21]=a,e[22]=o,e[23]=g):g=e[23],g},"D");export{F as a,L as b,q as c};
@@ -1 +1 @@
1
- import{a as O}from"./chunk-VQQEDEHH.js";import{a as C}from"./chunk-MNN3YCKF.js";import{a as c}from"./chunk-HMMALUXM.js";import{b as N}from"./chunk-BHUWAGFN.js";import"./chunk-L27FKJTG.js";import{a as k}from"./chunk-JZN3MNJX.js";import"./chunk-EYSF4DHD.js";import{a as w,b as T,c as A,d as f,e as s,f as l}from"./chunk-ZJIYJZ6F.js";import"./chunk-ELPLRD4S.js";import"./chunk-NFI2TNKU.js";import"./chunk-EOFWXI3T.js";import{a as v}from"./chunk-LYVYUTQY.js";import{c as p}from"./chunk-LRUYEVHH.js";import{a as b,e as S}from"./chunk-XV2XEUUB.js";import"./chunk-QFN62JQJ.js";import"./chunk-ZPQBVYNN.js";import{B as y}from"./chunk-2ZJJH4YN.js";import"./chunk-PDBW6GTJ.js";import"./chunk-A6TVTNKO.js";import{a as R,b as V}from"./chunk-ADABTCDI.js";import{a as n,d as x}from"./chunk-5PEAXTYQ.js";var F=x(R(),1);var e=x(V(),1);var $=n(a=>{let t=a.trim();if(t.length===0)return{context:void 0,error:null};try{let o=JSON.parse(t);return o===null||typeof o!="object"||Array.isArray(o)?{context:void 0,error:"Targeting context must be a JSON object."}:{context:o,error:null}}catch{return{context:void 0,error:"Targeting context is not valid JSON."}}},"H"),q='{ "targetingKey": "user-123", "plan": "premium" }',D=n(a=>a.type==="object"?JSON.stringify(a.value):String(a.value),"R"),Y=n(({initialShardKey:a=""})=>{let t=y(),[o,j]=(0,F.useState)(""),{context:g,error:m}=$(o),I=g===void 0?{}:{context:g},{data:i,error:J,errorSource:K,liveError:E}=p(v.listFlags,I,{live:!0,shardKey:a}),u=i!==void 0,L=i?.configured??!1,h=Array.isArray(i?.flags)?[...i.flags].toSorted((r,B)=>r.key.localeCompare(B.key)):[],d;return u&&!L?d=(0,e.jsx)(c,{description:t("No @lunora/flags provider is wired in this deployment. Add lunora/flags.ts with defineFlags({ provider }) to gate code paths on feature flags."),testId:"flags-unconfigured",title:t("No flags provider configured")}):u&&h.length===0?d=(0,e.jsx)(c,{description:t('A flags provider is configured, but no handler reads a flag yet. Call ctx.flags.boolean("key", false) in a query, mutation, or action.'),testId:"flags-empty",title:t("No flags read")}):d=(0,e.jsx)(b,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(w,{"data-testid":"flags-table",children:[(0,e.jsx)(T,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(s,{children:t("Key")}),(0,e.jsx)(s,{children:t("Type")}),(0,e.jsx)(s,{children:t("Value")}),(0,e.jsx)(s,{children:t("Reason")}),(0,e.jsx)(s,{children:t("Variant")})]})}),(0,e.jsx)(A,{children:h.map(r=>(0,e.jsxs)(f,{"data-testid":`flags-row-${r.key}`,children:[(0,e.jsx)(l,{className:"font-mono text-xs",children:r.key}),(0,e.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:r.type}),(0,e.jsx)(l,{className:"font-mono text-xs",children:D(r)}),(0,e.jsx)(l,{children:r.errorCode===void 0?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:r.reason??"\u2014"}):(0,e.jsx)(N,{"data-testid":`flags-error-${r.key}`,variant:"destructive",children:r.errorCode})}),(0,e.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:r.variant??"\u2014"})]},r.key))})]})})}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-flags-panel",children:[J!==null&&(0,e.jsx)(k,{error:K,shardKey:a,testId:"flags-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t('Feature flags are read in code with ctx.flags.<type>("key", default). They evaluate through the OpenFeature provider configured in lunora/flags.ts; edit the targeting context below to see how each flag resolves for a given audience.')}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(C,{htmlFor:"flags-targeting-context",children:t("Targeting context (JSON)")}),(0,e.jsx)(O,{className:"font-mono text-xs","data-testid":"flags-context-input",id:"flags-targeting-context",onChange:n(r=>{j(r.target.value)},"onChange"),placeholder:q,rows:3,value:o}),m!==null&&(0,e.jsx)("p",{className:"text-xs text-destructive","data-testid":"flags-context-error",role:"alert",children:t(m)}),E!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"flags-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")})]}),d]})},"W");export{Y as default};
1
+ import{a as O}from"./chunk-ACCTEC6Y.js";import{a as C}from"./chunk-EYBS3Q7O.js";import{a as c}from"./chunk-O46IV64X.js";import{b as N}from"./chunk-OOPMRFI2.js";import"./chunk-L27FKJTG.js";import{a as k}from"./chunk-PUTERXSU.js";import"./chunk-ZIY53FID.js";import{a as w,b as T,c as A,d as f,e as s,f as l}from"./chunk-KMBE7RTC.js";import"./chunk-4YZAJTU5.js";import"./chunk-UDKKUJHY.js";import"./chunk-EOFWXI3T.js";import{a as v}from"./chunk-LYVYUTQY.js";import{c as p}from"./chunk-NP6H72XD.js";import{a as b,e as S}from"./chunk-NPHGFVNE.js";import"./chunk-YESGXFAR.js";import"./chunk-ZPQBVYNN.js";import{B as y}from"./chunk-CDIV23I2.js";import"./chunk-PDBW6GTJ.js";import"./chunk-A6TVTNKO.js";import{a as R,b as V}from"./chunk-ADABTCDI.js";import{a as n,d as x}from"./chunk-5PEAXTYQ.js";var F=x(R(),1);var e=x(V(),1);var $=n(a=>{let t=a.trim();if(t.length===0)return{context:void 0,error:null};try{let o=JSON.parse(t);return o===null||typeof o!="object"||Array.isArray(o)?{context:void 0,error:"Targeting context must be a JSON object."}:{context:o,error:null}}catch{return{context:void 0,error:"Targeting context is not valid JSON."}}},"H"),q='{ "targetingKey": "user-123", "plan": "premium" }',D=n(a=>a.type==="object"?JSON.stringify(a.value):String(a.value),"R"),Y=n(({initialShardKey:a=""})=>{let t=y(),[o,j]=(0,F.useState)(""),{context:g,error:m}=$(o),I=g===void 0?{}:{context:g},{data:i,error:J,errorSource:K,liveError:E}=p(v.listFlags,I,{live:!0,shardKey:a}),u=i!==void 0,L=i?.configured??!1,h=Array.isArray(i?.flags)?[...i.flags].toSorted((r,B)=>r.key.localeCompare(B.key)):[],d;return u&&!L?d=(0,e.jsx)(c,{description:t("No @lunora/flags provider is wired in this deployment. Add lunora/flags.ts with defineFlags({ provider }) to gate code paths on feature flags."),testId:"flags-unconfigured",title:t("No flags provider configured")}):u&&h.length===0?d=(0,e.jsx)(c,{description:t('A flags provider is configured, but no handler reads a flag yet. Call ctx.flags.boolean("key", false) in a query, mutation, or action.'),testId:"flags-empty",title:t("No flags read")}):d=(0,e.jsx)(b,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(w,{"data-testid":"flags-table",children:[(0,e.jsx)(T,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(s,{children:t("Key")}),(0,e.jsx)(s,{children:t("Type")}),(0,e.jsx)(s,{children:t("Value")}),(0,e.jsx)(s,{children:t("Reason")}),(0,e.jsx)(s,{children:t("Variant")})]})}),(0,e.jsx)(A,{children:h.map(r=>(0,e.jsxs)(f,{"data-testid":`flags-row-${r.key}`,children:[(0,e.jsx)(l,{className:"font-mono text-xs",children:r.key}),(0,e.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:r.type}),(0,e.jsx)(l,{className:"font-mono text-xs",children:D(r)}),(0,e.jsx)(l,{children:r.errorCode===void 0?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:r.reason??"\u2014"}):(0,e.jsx)(N,{"data-testid":`flags-error-${r.key}`,variant:"destructive",children:r.errorCode})}),(0,e.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:r.variant??"\u2014"})]},r.key))})]})})}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-flags-panel",children:[J!==null&&(0,e.jsx)(k,{error:K,shardKey:a,testId:"flags-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t('Feature flags are read in code with ctx.flags.<type>("key", default). They evaluate through the OpenFeature provider configured in lunora/flags.ts; edit the targeting context below to see how each flag resolves for a given audience.')}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(C,{htmlFor:"flags-targeting-context",children:t("Targeting context (JSON)")}),(0,e.jsx)(O,{className:"font-mono text-xs","data-testid":"flags-context-input",id:"flags-targeting-context",onChange:n(r=>{j(r.target.value)},"onChange"),placeholder:q,rows:3,value:o}),m!==null&&(0,e.jsx)("p",{className:"text-xs text-destructive","data-testid":"flags-context-error",role:"alert",children:t(m)}),E!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"flags-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")})]}),d]})},"W");export{Y as default};