@lunora/studio 1.0.0-alpha.147 → 1.0.0-alpha.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
- package/dist/packem_chunks/SqlEditorPanel.mjs +7 -7
- package/dist/packem_chunks/TableEditor.mjs +1 -1
- package/dist/packem_chunks/payments-panel.mjs +1 -1
- package/dist/packem_shared/{DataBrowser-Bpj-0P1G.mjs → DataBrowser-B0XdZT2Z.mjs} +1 -1
- package/dist/packem_shared/wire-codec-oeb8YWV3.mjs +1 -0
- package/dist/standalone/{chunk-T3VYCKM7.js → chunk-3WOJTY4R.js} +1 -1
- package/dist/standalone/{chunk-HRYPE4NU.js → chunk-4FRHYJK4.js} +1 -1
- package/dist/standalone/{chunk-LFDP6ANM.js → chunk-4MDOVJ4W.js} +1 -1
- package/dist/standalone/{chunk-4XIC6MLF.js → chunk-66I57F5M.js} +1 -1
- package/dist/standalone/{chunk-OSLV4PT6.js → chunk-6DX7WXXT.js} +1 -1
- package/dist/standalone/chunk-6UKUXEBW.js +8 -0
- package/dist/standalone/{chunk-3KDC7UYQ.js → chunk-7J33QSVR.js} +1 -1
- package/dist/standalone/{chunk-GWW7SJR6.js → chunk-7ROGUMLR.js} +1 -1
- package/dist/standalone/{chunk-KCEVLJ65.js → chunk-7WRJROPR.js} +1 -1
- package/dist/standalone/{chunk-2GPQJLCR.js → chunk-7ZETHOUS.js} +1 -1
- package/dist/standalone/{chunk-DLT5B4TL.js → chunk-AHK42KDL.js} +1 -1
- package/dist/standalone/{chunk-2GZVY7CX.js → chunk-AMZKMGKY.js} +1 -1
- package/dist/standalone/{chunk-4R6AMNIM.js → chunk-APXBR22Z.js} +1 -1
- package/dist/standalone/{chunk-ZYCM7BV2.js → chunk-AUWQMDAX.js} +1 -1
- package/dist/standalone/{chunk-HR42URDR.js → chunk-AX2APCG6.js} +1 -1
- package/dist/standalone/{chunk-QNSRFASE.js → chunk-C4YXQWPA.js} +1 -1
- package/dist/standalone/{chunk-GIOZAYBS.js → chunk-D3PZ6MIM.js} +1 -1
- package/dist/standalone/{chunk-WWXSQVPE.js → chunk-DCUJOJLT.js} +1 -1
- package/dist/standalone/{chunk-2Z5PSAHC.js → chunk-DEXFM45H.js} +1 -1
- package/dist/standalone/{chunk-CZY6LNTK.js → chunk-DRYRBVT5.js} +1 -1
- package/dist/standalone/{chunk-VWFNJLMK.js → chunk-DSFSMWDN.js} +1 -1
- package/dist/standalone/{chunk-WXRI2LBR.js → chunk-FLNL5VTQ.js} +1 -1
- package/dist/standalone/{chunk-OEVYSTUL.js → chunk-GB2JAHPX.js} +1 -1
- package/dist/standalone/{chunk-EERTS7JH.js → chunk-GJZHLAVK.js} +1 -1
- package/dist/standalone/{chunk-JWPJS6AI.js → chunk-GV7UT4HH.js} +1 -1
- package/dist/standalone/{chunk-SLFPZM2C.js → chunk-H5ZCOPNG.js} +1 -1
- package/dist/standalone/{chunk-JY4ANRPG.js → chunk-IODDEC5H.js} +1 -1
- package/dist/standalone/{chunk-RDYIEOYN.js → chunk-J5NCVH3C.js} +1 -1
- package/dist/standalone/{chunk-GDB2JX2H.js → chunk-J77YHYKR.js} +1 -1
- package/dist/standalone/{chunk-NZ57KZSG.js → chunk-JDDCFPPX.js} +1 -1
- package/dist/standalone/{chunk-YCEVUCMI.js → chunk-JKUQYLWD.js} +1 -1
- package/dist/standalone/{chunk-6UG4S7I7.js → chunk-KASSSQS4.js} +1 -1
- package/dist/standalone/{chunk-5EWLJXES.js → chunk-KB45MOFE.js} +1 -1
- package/dist/standalone/{chunk-FIACUWE5.js → chunk-KCQPXMOO.js} +1 -1
- package/dist/standalone/{chunk-JOYK6ITY.js → chunk-KLME5CLU.js} +1 -1
- package/dist/standalone/{chunk-3CGQYQDZ.js → chunk-KRXMPCR7.js} +1 -1
- package/dist/standalone/{chunk-R5QR5EZZ.js → chunk-L47XJL6L.js} +1 -1
- package/dist/standalone/{chunk-KJ4YYMID.js → chunk-N6EJBSDR.js} +1 -1
- package/dist/standalone/{chunk-7BRTPMJO.js → chunk-NAG6ZTZT.js} +1 -1
- package/dist/standalone/{chunk-5OFSVXDU.js → chunk-NOVVYTNU.js} +1 -1
- package/dist/standalone/chunk-OVTMYZN2.js +1 -0
- package/dist/standalone/{chunk-XVX3KH35.js → chunk-P4CS3RZR.js} +1 -1
- package/dist/standalone/{chunk-2LOBQ4CX.js → chunk-PUP4LTHC.js} +1 -1
- package/dist/standalone/chunk-Q443C75G.js +1 -0
- package/dist/standalone/{chunk-7IY5BR52.js → chunk-QBDSW2YH.js} +1 -1
- package/dist/standalone/{chunk-XHM5CP2I.js → chunk-QFS5WAWF.js} +1 -1
- package/dist/standalone/{chunk-VLCHF5SE.js → chunk-SI7NMHGS.js} +1 -1
- package/dist/standalone/{chunk-VGJ6HFCF.js → chunk-V23FBXTK.js} +1 -1
- package/dist/standalone/{chunk-VWXU7LIX.js → chunk-VEWOXE6L.js} +1 -1
- package/dist/standalone/{chunk-6DQKYWZI.js → chunk-VO3YI35Z.js} +1 -1
- package/dist/standalone/{chunk-PIGJKRDD.js → chunk-VZRWYNKZ.js} +1 -1
- package/dist/standalone/{chunk-BVRZVNKL.js → chunk-XFZGJQY4.js} +1 -1
- package/dist/standalone/{chunk-5K2UDZLN.js → chunk-XJDQG6VV.js} +1 -1
- package/dist/standalone/{chunk-XZCNX7YU.js → chunk-XTLR2A7C.js} +1 -1
- package/dist/standalone/{chunk-MNGNHBOS.js → chunk-XVONF2UL.js} +1 -1
- package/dist/standalone/{chunk-LK4TLRSU.js → chunk-YSX56MFQ.js} +1 -1
- package/dist/standalone/{chunk-N74RUMRA.js → chunk-ZD7TZD5E.js} +1 -1
- package/dist/standalone/{chunk-KQFH6FFC.js → chunk-ZXRRPWQV.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +4 -4
- package/dist/packem_shared/wire-codec-C0jSa3ZC.mjs +0 -1
- package/dist/standalone/chunk-LSWAITBZ.js +0 -1
- package/dist/standalone/chunk-QYEQOTRN.js +0 -8
- package/dist/standalone/chunk-ZTDD3M5D.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as me}from"./chunk-F7UC63UN.js";import{a as Ot,b as zt,c as At,d as Kt}from"./chunk-SUDJTC4S.js";import{a as it}from"./chunk-LJYUUOBB.js";import{a as Dt,b as Ct,c as It,d as Ft,e as Pe}from"./chunk-U5JDESCI.js";import{a as Tt}from"./chunk-RPQL45FL.js";import{a as Rt}from"./chunk-2ES4GR4C.js";import"./chunk-4GTO7FL5.js";import"./chunk-I52I2DJG.js";import{e as $t}from"./chunk-UYEZR3BI.js";import"./chunk-TWTNWOJU.js";import{a as _t}from"./chunk-BOTGXX4H.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import{a as Ee,b as et,c as tt,d as vt,e as yt,f as rt,g as at,h as Nt,i as St}from"./chunk-JAKYTDUH.js";import"./chunk-5JDWLCSH.js";import"./chunk-PYT4RZJH.js";import{a as kt}from"./chunk-S3CRZLGS.js";import{a as Mt}from"./chunk-IABM4BFJ.js";import{a as wt,b as qt}from"./chunk-OGUKYRFM.js";import"./chunk-JVUZEYKQ.js";import"./chunk-OKG3HWSJ.js";import"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as Ze}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import{b as We}from"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import"./chunk-35DM4JJG.js";import{a as ze}from"./chunk-4ZEL6BYL.js";import{c as Le}from"./chunk-KQFH6FFC.js";import{f as ct}from"./chunk-XZCNX7YU.js";import"./chunk-FSRSK4LY.js";import"./chunk-2LN3T5HY.js";import{a as ht}from"./chunk-FKVZRPV5.js";import{a as st,b as lt,c as nt,d as je,e as ce,f as U}from"./chunk-HEAQVSNS.js";import{a as fe,b as Ae,c as Ke,d as ut,e as pe}from"./chunk-WUWBZPUK.js";import{d as ge,f as gt,g as ft,h as pt,i as xt,l as Ge,o as bt}from"./chunk-FODLDLE2.js";import{a as o,d as Ye,e as Jt,f as Bt,g as Ht,i as mt}from"./chunk-YKXDMIHQ.js";var P=Ye(Jt(),1);var xe=Ye(Bt(),1);var t=Ye(Ht(),1);var Ut=/["\\\u0000-\u001F\uD800-\uDFFF]/,Lt=o(s=>Ut.test(s)?JSON.stringify(s):`"${s}"`,"ot"),dt=o(s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(typeof s=="number"){if(Number.isNaN(s))return"nan";if(s===1/0)return"inf";if(s===-1/0)return"-inf";if(Object.is(s,-0))return"-0"}if(typeof s=="string")return Lt(s);if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s)){let i="[";for(let n=0;n<s.length;n++)n>0&&(i+=","),i+=dt(s[n]);return i+"]"}let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let i=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${i} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let l=s,a=Object.keys(l).sort(),r="{",u=!0;for(let i of a){let n=l[i];n!==void 0&&(u?u=!1:r+=",",r+=Lt(i),r+=":",r+=dt(n))}return r+"}"},"Ze"),Pt=o((s,e,l)=>`${s}:${e}:${dt(l??{})}`,"ht"),Qt=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"gt"),Wt=o((s,e)=>Qt(s,e),"Jt"),Gt=o(s=>Qt(s.kind,s),"Vt"),ot=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"We"),Vt=o(s=>Array.isArray(s?.series)?s.series:[],"Gt"),Xt="FUNCTION_NOT_FOUND",Yt=o(s=>{let e=new Map;if(!Array.isArray(s?.series))return e;for(let l of s.series)e.set(Pt(l.kind,l.name,l.attributes),l.points);return e},"Xt"),Zt={counter:"secondary",gauge:"default",histogram:"outline"},Et=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,u=ge();if(r===void 0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=c):c=e[0],c}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let c=`mt-instrument-trace-${l}`,f;return e[3]!==n||e[4]!==c||e[5]!==r?(f=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":c,title:r,children:n}),e[3]=n,e[4]=c,e[5]=r,e[6]=f):f=e[6],f}let h=`mt-instrument-trace-${l}`,y;e[7]!==a||e[8]!==r?(y=o(()=>{a(r)},"v"),e[7]=a,e[8]=r,e[9]=y):y=e[9];let w;e[10]!==u||e[11]!==r?(w=u("Open the exemplar trace {trace}",{trace:r}),e[10]=u,e[11]=r,e[12]=w):w=e[12];let g;return e[13]!==n||e[14]!==h||e[15]!==y||e[16]!==w?(g=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":h,onClick:y,title:w,type:"button",children:n}),e[13]=n,e[14]=h,e[15]=y,e[16]=w,e[17]=g):g=e[17],g},"Zt"),er=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={},e[0]=u):u=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:h,errorSource:y}=Le(ze.getMetricSeries,u,i),w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w={},e[3]=w):w=e[3];let g;e[4]!==a?(g={live:!0,shardKey:a},e[4]=a,e[5]=g):g=e[5];let{data:c}=Le(ze.getMetricHistory,w,g),f,N,q,_,d,x,p,b,M,$,S,I,C;if(e[6]!==n||e[7]!==h||e[8]!==y||e[9]!==c||e[10]!==l||e[11]!==r){b=Symbol.for("react.early_return_sentinel");e:{let z=Vt(n),A=xt(y)===Xt;if(h!==null&&!A){let m;e[25]!==r?(m=r("Instruments"),e[25]=r,e[26]=m):m=e[26];let j;e[27]!==m?(j=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[27]=m,e[28]=j):j=e[28];let J;e[29]!==h||e[30]!==r?(J=r("Instruments unavailable: {error}",{error:h}),e[29]=h,e[30]=r,e[31]=J):J=e[31];let B;e[32]!==J?(B=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:J}),e[32]=J,e[33]=B):B=e[33];let de;e[34]!==j||e[35]!==B?(de=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[j,B]}),e[34]=j,e[35]=B,e[36]=de):de=e[36],b=de;break e}if(z.length===0){b=null;break e}let D=Yt(c),L;e[37]!==r?(L=o(m=>r(m==="counter"?"Counter":m==="gauge"?"Gauge":"Histogram"),"z"),e[37]=r,e[38]=L):L=e[38];let Q=L;d="flex flex-col gap-2",x="mt-instruments";let K;e[39]!==r?(K=r("Instruments"),e[39]=r,e[40]=K):K=e[40],e[41]!==K?(p=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:K}),e[41]=K,e[42]=p):p=e[42],_=fe,C="overflow-hidden py-0",q=pe,I="px-0",N=st,$="mt-instruments-table";let W;e[43]!==r?(W=r("name"),e[43]=r,e[44]=W):W=e[44];let G;e[45]!==W?(G=(0,t.jsx)(ce,{children:W}),e[45]=W,e[46]=G):G=e[46];let V;e[47]!==r?(V=r("kind"),e[47]=r,e[48]=V):V=e[48];let X;e[49]!==V?(X=(0,t.jsx)(ce,{children:V}),e[49]=V,e[50]=X):X=e[50];let Y;e[51]!==r?(Y=r("value"),e[51]=r,e[52]=Y):Y=e[52];let Z;e[53]!==Y?(Z=(0,t.jsx)(ce,{className:"text-right",children:Y}),e[53]=Y,e[54]=Z):Z=e[54];let E;e[55]!==r?(E=r("count"),e[55]=r,e[56]=E):E=e[56];let ee;e[57]!==E?(ee=(0,t.jsx)(ce,{className:"text-right",children:E}),e[57]=E,e[58]=ee):ee=e[58];let te;e[59]!==r?(te=r("range"),e[59]=r,e[60]=te):te=e[60];let re;e[61]!==te?(re=(0,t.jsx)(ce,{className:"text-right",children:te}),e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==r?(ae=r("trend"),e[63]=r,e[64]=ae):ae=e[64];let se;e[65]!==ae?(se=(0,t.jsx)(ce,{children:ae}),e[65]=ae,e[66]=se):se=e[66];let le;e[67]!==r?(le=r("trace"),e[67]=r,e[68]=le):le=e[68];let ne;e[69]!==le?(ne=(0,t.jsx)(ce,{children:le}),e[69]=le,e[70]=ne):ne=e[70];let ie;e[71]!==r?(ie=r("dimensions"),e[71]=r,e[72]=ie):ie=e[72];let oe;e[73]!==ie?(oe=(0,t.jsx)(ce,{children:ie}),e[73]=ie,e[74]=oe):oe=e[74],e[75]!==G||e[76]!==X||e[77]!==Z||e[78]!==ee||e[79]!==re||e[80]!==se||e[81]!==ne||e[82]!==oe?(S=(0,t.jsx)(lt,{children:(0,t.jsxs)(je,{children:[G,X,Z,ee,re,se,ne,oe]})}),e[75]=G,e[76]=X,e[77]=Z,e[78]=ee,e[79]=re,e[80]=se,e[81]=ne,e[82]=oe,e[83]=S):S=e[83],f=nt,M=z.map(m=>{let j=Tt(m.attributes),J=Pt(m.kind,m.name,m.attributes),B=(D.get(J)??[]).map(de=>Wt(m.kind,de));return(0,t.jsxs)(je,{"data-testid":`mt-instrument-${m.name}`,children:[(0,t.jsx)(U,{className:"font-mono text-xs",title:m.functionPath,children:m.name}),(0,t.jsx)(U,{children:(0,t.jsx)(We,{variant:Zt[m.kind],children:Q(m.kind)})}),(0,t.jsx)(U,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${m.name}`,children:ot(Gt(m))}),(0,t.jsx)(U,{className:"text-right tabular-nums text-muted-foreground",children:m.count.toLocaleString()}),(0,t.jsx)(U,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:m.min===m.max?"\u2014":`${ot(m.min)}\u2013${ot(m.max)}`}),(0,t.jsx)(U,{children:B.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:m.name}),className:"h-6 w-24 text-foreground",series:B,testId:`mt-instrument-trend-${m.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(U,{className:"font-mono text-xs",children:(0,t.jsx)(Et,{name:m.name,onOpenTrace:l,traceId:m.exemplarTraceId})}),(0,t.jsx)(U,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:j,children:j===""?"\u2014":j})]},J)})}e[6]=n,e[7]=h,e[8]=y,e[9]=c,e[10]=l,e[11]=r,e[12]=f,e[13]=N,e[14]=q,e[15]=_,e[16]=d,e[17]=x,e[18]=p,e[19]=b,e[20]=M,e[21]=$,e[22]=S,e[23]=I,e[24]=C}else f=e[12],N=e[13],q=e[14],_=e[15],d=e[16],x=e[17],p=e[18],b=e[19],M=e[20],$=e[21],S=e[22],I=e[23],C=e[24];if(b!==Symbol.for("react.early_return_sentinel"))return b;let F;e[84]!==f||e[85]!==M?(F=(0,t.jsx)(f,{children:M}),e[84]=f,e[85]=M,e[86]=F):F=e[86];let k;e[87]!==N||e[88]!==F||e[89]!==$||e[90]!==S?(k=(0,t.jsxs)(N,{"data-testid":$,children:[S,F]}),e[87]=N,e[88]=F,e[89]=$,e[90]=S,e[91]=k):k=e[91];let v;e[92]!==q||e[93]!==k||e[94]!==I?(v=(0,t.jsx)(q,{className:I,children:k}),e[92]=q,e[93]=k,e[94]=I,e[95]=v):v=e[95];let T;e[96]!==_||e[97]!==v||e[98]!==C?(T=(0,t.jsx)(_,{className:C,children:v}),e[96]=_,e[97]=v,e[98]=C,e[99]=T):T=e[99];let O;return e[100]!==d||e[101]!==x||e[102]!==p||e[103]!==T?(O=(0,t.jsxs)("section",{className:d,"data-testid":x,children:[p,T]}),e[100]=d,e[101]=x,e[102]=p,e[103]=T,e[104]=O):O=e[104],O},"er"),tr=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),u;e[0]!==r?(u=r("Shards"),e[0]=r,e[1]=u):u=e[1];let i;e[2]!==l.failed||e[3]!==l.reachable||e[4]!==r?(i=l.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:l.failed,reachable:l.reachable}):r("{reachable} reachable",{reachable:l.reachable}),e[2]=l.failed,e[3]=l.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==u||e[7]!==i?(n=(0,t.jsx)(me,{label:u,testId:"mt-agg-shards",value:i}),e[6]=u,e[7]=i,e[8]=n):n=e[8];let h;e[9]!==r?(h=r("Total requests"),e[9]=r,e[10]=h):h=e[10];let y;e[11]!==l.totalRequests||e[12]!==h?(y=(0,t.jsx)(me,{label:h,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=h,e[13]=y):y=e[13];let w;e[14]!==r?(w=r("Total errors"),e[14]=r,e[15]=w):w=e[15];let g;e[16]!==l.totalErrors||e[17]!==w?(g=(0,t.jsx)(me,{label:w,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=w,e[18]=g):g=e[18];let c;e[19]!==r?(c=r("Total database size"),e[19]=r,e[20]=c):c=e[20];let f;e[21]!==l.totalDatabaseSize?(f=Ge(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=f):f=e[22];let N;e[23]!==c||e[24]!==f?(N=(0,t.jsx)(me,{label:c,testId:"mt-agg-db-size",value:f}),e[23]=c,e[24]=f,e[25]=N):N=e[25];let q;e[26]!==r?(q=r("Combined cache hit rate"),e[26]=r,e[27]=q):q=e[27];let _;e[28]!==l.hitRate||e[29]!==r?(_=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=_):_=e[30];let d;e[31]!==q||e[32]!==_?(d=(0,t.jsx)(me,{label:q,testId:"mt-agg-cache",value:_}),e[31]=q,e[32]=_,e[33]=d):d=e[33];let x;e[34]!==N||e[35]!==d||e[36]!==n||e[37]!==y||e[38]!==g?(x=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,y,g,N,d]}),e[34]=N,e[35]=d,e[36]=n,e[37]=y,e[38]=g,e[39]=x):x=e[39];let p;e[40]!==r?(p=r("shard"),e[40]=r,e[41]=p):p=e[41];let b;e[42]!==p?(b=(0,t.jsx)(ce,{children:p}),e[42]=p,e[43]=b):b=e[43];let M;e[44]!==r?(M=r("requests"),e[44]=r,e[45]=M):M=e[45];let $;e[46]!==M?($=(0,t.jsx)(ce,{children:M}),e[46]=M,e[47]=$):$=e[47];let S;e[48]!==r?(S=r("errors"),e[48]=r,e[49]=S):S=e[49];let I;e[50]!==S?(I=(0,t.jsx)(ce,{children:S}),e[50]=S,e[51]=I):I=e[51];let C;e[52]!==r?(C=r("db size"),e[52]=r,e[53]=C):C=e[53];let F;e[54]!==C?(F=(0,t.jsx)(ce,{children:C}),e[54]=C,e[55]=F):F=e[55];let k;e[56]!==b||e[57]!==$||e[58]!==I||e[59]!==F?(k=(0,t.jsx)(lt,{children:(0,t.jsxs)(je,{children:[b,$,I,F]})}),e[56]=b,e[57]=$,e[58]=I,e[59]=F,e[60]=k):k=e[60];let v;if(e[61]!==a||e[62]!==r){let A;e[64]!==r?(A=o(D=>(0,t.jsxs)(je,{"data-testid":`mt-agg-row-${D.shard}`,children:[(0,t.jsx)(U,{children:D.shard}),D.metrics===null?(0,t.jsx)(U,{className:"text-destructive",colSpan:3,children:D.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(U,{className:"tabular-nums",children:D.metrics.requests}),(0,t.jsx)(U,{className:"tabular-nums",children:D.metrics.errors}),(0,t.jsx)(U,{className:"tabular-nums",children:Ge(D.metrics.databaseSize)})]})]},D.shard),"O"),e[64]=r,e[65]=A):A=e[65],v=a.map(A),e[61]=a,e[62]=r,e[63]=v}else v=e[63];let T;e[66]!==v?(T=(0,t.jsx)(nt,{children:v}),e[66]=v,e[67]=T):T=e[67];let O;e[68]!==k||e[69]!==T?(O=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(st,{"data-testid":"mt-agg-table",children:[k,T]})})}),e[68]=k,e[69]=T,e[70]=O):O=e[70];let z;return e[71]!==x||e[72]!==O?(z=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[x,O]}),e[71]=x,e[72]=O,e[73]=z):z=e[73],z},"tr"),rr=o(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return l>0?`${l.toString()}h ${a.toString()}m`:a>0?`${a.toString()}m ${r.toString()}s`:`${r.toString()}s`},"rr"),ar=o((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"sr"),jt=o(s=>s<=0?"\u2014":s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"ct"),sr=o(s=>{let e=(0,xe.c)(75),{currentDelta:l,errorRate:a,history:r,latencyPercentiles:u,metrics:i}=s,n=ge(),{cache:h}=i,y;e[0]!==r||e[1]!==n?(y=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=y):y=e[2];let w;e[3]!==l||e[4]!==r.length||e[5]!==n?(w=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${l.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=l,e[4]=r.length,e[5]=n,e[6]=w):w=e[6];let g;e[7]!==n?(g=n("Requests"),e[7]=n,e[8]=g):g=e[8];let c;e[9]!==i.requests||e[10]!==y||e[11]!==w||e[12]!==g?(c=(0,t.jsx)(me,{chart:y,footer:w,label:g,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=y,e[11]=w,e[12]=g,e[13]=c):c=e[13];let f;e[14]!==a||e[15]!==n?(f=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=f):f=e[16];let N;e[17]!==n?(N=n("Errors"),e[17]=n,e[18]=N):N=e[18];let q;e[19]!==a||e[20]!==i.errors?(q=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=q):q=e[21];let _;e[22]!==f||e[23]!==N||e[24]!==q?(_=(0,t.jsx)(me,{footer:f,label:N,testId:"mt-errors",value:q}),e[22]=f,e[23]=N,e[24]=q,e[25]=_):_=e[25];let d;e[26]!==u.p90?(d=u.p90>0?`P90 ${jt(u.p90)}`:void 0,e[26]=u.p90,e[27]=d):d=e[27];let x;e[28]!==n?(x=n("P95 latency"),e[28]=n,e[29]=x):x=e[29];let p;e[30]!==u.p95?(p=u.p95>0?jt(u.p95):"\u2014",e[30]=u.p95,e[31]=p):p=e[31];let b;e[32]!==x||e[33]!==p||e[34]!==d?(b=(0,t.jsx)(me,{footer:d,label:x,testId:"mt-p95",value:p}),e[32]=x,e[33]=p,e[34]=d,e[35]=b):b=e[35];let M;e[36]!==h||e[37]!==n?(M=h?`${h.entries.toLocaleString()} ${n("cache entries")}`:void 0,e[36]=h,e[37]=n,e[38]=M):M=e[38];let $;e[39]!==n?($=n("Database size"),e[39]=n,e[40]=$):$=e[40];let S;e[41]!==i.databaseSize?(S=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=S):S=e[42];let I;e[43]!==M||e[44]!==$||e[45]!==S?(I=(0,t.jsx)(me,{footer:M,label:$,testId:"mt-db-size",value:S}),e[43]=M,e[44]=$,e[45]=S,e[46]=I):I=e[46];let C;e[47]!==n?(C=n("Shard"),e[47]=n,e[48]=C):C=e[48];let F;e[49]!==i.shard||e[50]!==C?(F=(0,t.jsx)(me,{label:C,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=C,e[51]=F):F=e[51];let k;e[52]!==n?(k=n("Uptime"),e[52]=n,e[53]=k):k=e[53];let v;e[54]!==i.uptimeMs?(v=rr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=v):v=e[55];let T;e[56]!==k||e[57]!==v?(T=(0,t.jsx)(me,{label:k,testId:"mt-uptime",value:v}),e[56]=k,e[57]=v,e[58]=T):T=e[58];let O;e[59]!==n?(O=n("Cache hit rate"),e[59]=n,e[60]=O):O=e[60];let z;e[61]!==h||e[62]!==n?(z=h?n("{rate} ({count} entries)",{count:h.entries,rate:ar(h.hits,h.misses)}):n("no cache configured"),e[61]=h,e[62]=n,e[63]=z):z=e[63];let A;e[64]!==O||e[65]!==z?(A=(0,t.jsx)(me,{label:O,testId:"mt-cache",value:z}),e[64]=O,e[65]=z,e[66]=A):A=e[66];let D;return e[67]!==b||e[68]!==I||e[69]!==F||e[70]!==T||e[71]!==A||e[72]!==c||e[73]!==_?(D=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[c,_,b,I,F,T,A]}),e[67]=b,e[68]=I,e[69]=F,e[70]=T,e[71]=A,e[72]=c,e[73]=_,e[74]=D):D=e[74],D},"lr"),Xe=o(s=>s>=100?"critical":s>=50?"warning":"good","Ve"),Qe=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Ae"),Ve=o(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"He"),lr=o(s=>{let e=(0,xe.c)(3),{level:l}=s;if(l==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(We,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(l==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"ir"),nr=o((s,e)=>{let l=[...s];return l.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),l},"ar"),ir=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,u]=(0,P.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,h]=(0,P.useState)(i),y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=o(C=>{C!==null&&u(C)},"v"),e[1]=y):y=e[1];let w=y,g,c,f,N,q,_,d,x,p,b;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){f=Symbol.for("react.early_return_sentinel");e:{let C=nr(l,r),F;e[16]!==l?(F=l.filter(or),e[16]=l,e[17]=F):F=e[17];let k=F.length,v;e[18]!==l?(v=l.filter(dr),e[18]=l,e[19]=v):v=e[19];let T=v.length,O;e[20]!==l?(O=l.filter(cr),e[20]=l,e[21]=O):O=e[21];let z=O.length,A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=o(R=>{h(ue=>{let H=new Set(ue);return H.has(R)?H.delete(R):H.add(R),H})},"O"),e[22]=A):A=e[22];let D=A;if(l.length===0){let R;e[23]!==a?(R=a("No query insights yet"),e[23]=a,e[24]=R):R=e[24];let ue;e[25]!==R?(ue=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:R}),e[25]=R,e[26]=ue):ue=e[26];let H;e[27]!==a?(H=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=H):H=e[28];let he;e[29]!==H?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:H}),e[29]=H,e[30]=he):he=e[30];let Ue;e[31]!==ue||e[32]!==he?(Ue=(0,t.jsx)(fe,{children:(0,t.jsx)(pe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ue,he]})})}),e[31]=ue,e[32]=he,e[33]=Ue):Ue=e[33],f=Ue;break e}d="space-y-4",x="qi-root";let L;e[34]!==a?(L=a("Critical queries"),e[34]=a,e[35]=L):L=e[35];let Q;e[36]!==L?(Q=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:L})}),e[36]=L,e[37]=Q):Q=e[37];let K;e[38]!==k?(K=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:k}),e[38]=k,e[39]=K):K=e[39];let W;e[40]!==a?(W=a(">100ms avg execution"),e[40]=a,e[41]=W):W=e[41];let G;e[42]!==W?(G=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:W}),e[42]=W,e[43]=G):G=e[43];let V;e[44]!==K||e[45]!==G?(V=(0,t.jsxs)(pe,{children:[K,G]}),e[44]=K,e[45]=G,e[46]=V):V=e[46];let X;e[47]!==Q||e[48]!==V?(X=(0,t.jsxs)(fe,{children:[Q,V]}),e[47]=Q,e[48]=V,e[49]=X):X=e[49];let Y;e[50]!==a?(Y=a("Moderate queries"),e[50]=a,e[51]=Y):Y=e[51];let Z;e[52]!==Y?(Z=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:Y})}),e[52]=Y,e[53]=Z):Z=e[53];let E;e[54]!==T?(E=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:T}),e[54]=T,e[55]=E):E=e[55];let ee;e[56]!==a?(ee=a("50\u2013100ms avg execution"),e[56]=a,e[57]=ee):ee=e[57];let te;e[58]!==ee?(te=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ee}),e[58]=ee,e[59]=te):te=e[59];let re;e[60]!==E||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[E,te]}),e[60]=E,e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==Z||e[64]!==re?(ae=(0,t.jsxs)(fe,{children:[Z,re]}),e[63]=Z,e[64]=re,e[65]=ae):ae=e[65];let se;e[66]!==a?(se=a("Fast queries"),e[66]=a,e[67]=se):se=e[67];let le;e[68]!==se?(le=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==z?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:z}),e[70]=z,e[71]=ne):ne=e[71];let ie;e[72]!==a?(ie=a("<50ms avg execution"),e[72]=a,e[73]=ie):ie=e[73];let oe;e[74]!==ie?(oe=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ie}),e[74]=ie,e[75]=oe):oe=e[75];let m;e[76]!==ne||e[77]!==oe?(m=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=m):m=e[78];let j;e[79]!==le||e[80]!==m?(j=(0,t.jsxs)(fe,{children:[le,m]}),e[79]=le,e[80]=m,e[81]=j):j=e[81],e[82]!==X||e[83]!==ae||e[84]!==j?(p=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[X,ae,j]}),e[82]=X,e[83]=ae,e[84]=j,e[85]=p):p=e[85];let J;e[86]!==a?(J=a("Query leaderboard"),e[86]=a,e[87]=J):J=e[87];let B;e[88]!==J?(B=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:J}),e[88]=J,e[89]=B):B=e[89];let de;e[90]!==r||e[91]!==a?(de=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=de):de=e[92];let be;e[93]!==de?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:de}),e[93]=de,e[94]=be):be=e[94];let ve;e[95]!==B||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[B,be]}),e[95]=B,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Je;e[104]===Symbol.for("react.memo_cache_sentinel")?(Je=(0,t.jsx)(Ct,{}),e[104]=Je):Je=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(It,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Je}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let Me;e[109]!==qe?(Me=(0,t.jsx)(Pe,{value:"totalTime",children:qe}),e[109]=qe,e[110]=Me):Me=e[110];let ke;e[111]!==a?(ke=a("Avg time"),e[111]=a,e[112]=ke):ke=e[112];let _e;e[113]!==ke?(_e=(0,t.jsx)(Pe,{value:"avgTime",children:ke}),e[113]=ke,e[114]=_e):_e=e[114];let $e;e[115]!==a?($e=a("Execution count"),e[115]=a,e[116]=$e):$e=e[116];let De;e[117]!==$e?(De=(0,t.jsx)(Pe,{value:"execCount",children:$e}),e[117]=$e,e[118]=De):De=e[118];let Ce;e[119]!==a?(Ce=a("Rows read"),e[119]=a,e[120]=Ce):Ce=e[120];let Ie;e[121]!==Ce?(Ie=(0,t.jsx)(Pe,{value:"rowsRead",children:Ce}),e[121]=Ce,e[122]=Ie):Ie=e[122];let Fe;e[123]!==Me||e[124]!==_e||e[125]!==De||e[126]!==Ie?(Fe=(0,t.jsxs)(Ft,{children:[Me,_e,De,Ie]}),e[123]=Me,e[124]=_e,e[125]=De,e[126]=Ie,e[127]=Fe):Fe=e[127];let Te;e[128]!==r||e[129]!==we||e[130]!==Fe?(Te=(0,t.jsxs)(Dt,{onValueChange:w,value:r,children:[we,Fe]}),e[128]=r,e[129]=we,e[130]=Fe,e[131]=Te):Te=e[131];let Re;e[132]!==Ne||e[133]!==Te?(Re=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,Te]}),e[132]=Ne,e[133]=Te,e[134]=Re):Re=e[134],e[135]!==ve||e[136]!==Re?(b=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,Re]}),e[135]=ve,e[136]=Re,e[137]=b):b=e[137],c=fe;let Oe;e[138]!==a?(Oe=a("Statements"),e[138]=a,e[139]=Oe):Oe=e[139];let Be;e[140]!==Oe?(Be=(0,t.jsx)(Ke,{children:Oe}),e[140]=Oe,e[141]=Be):Be=e[141],_=(0,t.jsxs)(Ae,{children:[Be,(0,t.jsx)(ut,{children:a("{count} tracked statements",{count:C.length})})]}),g=pe,N="space-y-2";let He;e[142]!==n||e[143]!==a?(He=o(R=>{let ue=R.normalizedSql,H=n.has(ue),he=Xe(R.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":H,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{D(ue)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(lr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),R.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Ve(R.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),H&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[R.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsWritten)})]})]})]})]},ue)},"Ke"),e[142]=n,e[143]=a,e[144]=He):He=e[144],q=C.map(He)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=g,e[7]=c,e[8]=f,e[9]=N,e[10]=q,e[11]=_,e[12]=d,e[13]=x,e[14]=p,e[15]=b}else g=e[6],c=e[7],f=e[8],N=e[9],q=e[10],_=e[11],d=e[12],x=e[13],p=e[14],b=e[15];if(f!==Symbol.for("react.early_return_sentinel"))return f;let M;e[145]!==N||e[146]!==q?(M=(0,t.jsx)("div",{className:N,children:q}),e[145]=N,e[146]=q,e[147]=M):M=e[147];let $;e[148]!==g||e[149]!==M?($=(0,t.jsx)(g,{children:M}),e[148]=g,e[149]=M,e[150]=$):$=e[150];let S;e[151]!==c||e[152]!==$||e[153]!==_?(S=(0,t.jsxs)(c,{children:[_,$]}),e[151]=c,e[152]=$,e[153]=_,e[154]=S):S=e[154];let I;return e[155]!==S||e[156]!==d||e[157]!==x||e[158]!==p||e[159]!==b?(I=(0,t.jsxs)("div",{className:d,"data-testid":x,children:[p,b,S]}),e[155]=S,e[156]=d,e[157]=x,e[158]=p,e[159]=b,e[160]=I):I=e[160],I},"nr");function or(s){return Xe(s.avgDurationMs)==="critical"}o(or,"or");function dr(s){return Xe(s.avgDurationMs)==="warning"}o(dr,"cr");function cr(s){return Xe(s.avgDurationMs)==="good"}o(cr,"dr");var mr=["1m","5m","15m","1h"],ur=o(s=>new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"ur"),hr=o(s=>s.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:ur(e.bucketMs)})),"fr"),gr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,P.useState)("15m"),r=Le(ze.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,u=hr(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:mr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===l,className:mt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===l&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:o(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(We,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),u.length===0?(0,t.jsx)(ht,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(Ee,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(yt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(Ee,{height:140,width:"100%",children:(0,t.jsxs)(Nt,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(vt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(ir,{queryStats:r?.entries??[]})]})},"hr"),fr=gt(ze.getMetrics),pr=o((s,e)=>s?e:"overview","pr"),jr=o(({initialShardKey:s})=>{let e=ct(),l=ge(),{queryShardKey:a,setShardKey:r,shardKey:u}=kt(s),[i,n]=(0,P.useState)("overview"),[h,y]=(0,P.useState)([]),w=(0,P.useRef)(null),g=(0,P.useRef)(null),c=(0,P.useRef)(!0);(0,P.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]);let f=Rt(a),{data:N,error:q,liveError:_}=Le(ze.getMetrics,{},{live:!0,shardKey:a}),d=N??null;(0,P.useEffect)(()=>{if(N===void 0)return;qt(a);let D=N,L=w.current,Q=g.current!==null&&g.current!==D.shard;if(g.current=D.shard,w.current=D.requests,Q){y([]);return}L!==null&&D.requests>=L&&y(K=>[...K,D.requests-L].slice(-30))},[N,a]);let[x,p]=(0,P.useState)(null),[b,M]=(0,P.useState)(!1),$=o(async()=>{M(!0);let D=zt(u,wt());try{let L=await Promise.all(D.map(async Q=>{try{let K=await e.query(fr,{},ft(Q));return{error:null,metrics:K,shard:Q===""?K.shard:Q}}catch(K){return{error:pt(K),metrics:null,shard:Q===""?"__root__":Q}}}));c.current&&p(L)}finally{c.current&&M(!1)}},"R"),S=x===null?null:Ot(x),I=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,C=h.length>0?h.at(-1):0,F=d?At(d):{p90:0,p95:0},k=(0,P.useMemo)(()=>{if(!d||!("queryStats"in d))return;let D=d.queryStats;if(!(!D||!Array.isArray(D)))return Kt(D)},[d]),v=pr(k!==void 0,i),T=o(()=>{bt($())},"D"),O=o(()=>{p(null)},"F"),z=o(()=>{n("overview")},"A"),A=o(()=>{n("query-insights")},"O");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(Mt,{onChange:r,testId:"mt-shard-input",value:u}),(0,t.jsx)(_t,{message:_,prefix:"mt"}),(0,t.jsx)(Ze,{"data-testid":"mt-aggregate",disabled:b,onClick:T,size:"sm",type:"button",variant:"secondary",children:l(b?"Aggregating\u2026":"All shards")}),x!==null&&(0,t.jsx)(Ze,{"data-testid":"mt-aggregate-clear",onClick:O,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:$t,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),q!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:q}),k!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:z,type:"button",children:l("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:A,type:"button",children:[l("Query insights"),k.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:k.length})]})]}),v==="query-insights"&&k!==void 0&&(0,t.jsx)(gr,{shardKey:a}),v==="overview"&&d!==null&&(0,t.jsx)(sr,{currentDelta:C,errorRate:I,history:h,latencyPercentiles:F,metrics:d}),v==="overview"&&d===null&&null,v==="overview"&&(0,t.jsx)(er,{onOpenTrace:f,shardKey:a}),v==="overview"&&S!==null&&x!==null&&(0,t.jsx)(tr,{aggregate:S,shardResults:x})]})},"jr");export{jr as MetricsPanel};
|
|
1
|
+
import{a as me}from"./chunk-F7UC63UN.js";import{a as Ot,b as zt,c as At,d as Kt}from"./chunk-SUDJTC4S.js";import{a as it}from"./chunk-LJYUUOBB.js";import{a as Dt,b as Ct,c as It,d as Ft,e as Pe}from"./chunk-U5JDESCI.js";import{a as Tt}from"./chunk-RPQL45FL.js";import{a as Rt}from"./chunk-2ES4GR4C.js";import"./chunk-4GTO7FL5.js";import"./chunk-I52I2DJG.js";import{e as $t}from"./chunk-UYEZR3BI.js";import"./chunk-TWTNWOJU.js";import{a as _t}from"./chunk-BOTGXX4H.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import{a as Ee,b as et,c as tt,d as vt,e as yt,f as rt,g as at,h as Nt,i as St}from"./chunk-JAKYTDUH.js";import"./chunk-5JDWLCSH.js";import"./chunk-PYT4RZJH.js";import{a as kt}from"./chunk-S3CRZLGS.js";import{a as Mt}from"./chunk-IABM4BFJ.js";import{a as wt,b as qt}from"./chunk-OGUKYRFM.js";import"./chunk-JVUZEYKQ.js";import"./chunk-OKG3HWSJ.js";import"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as Ze}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import{b as We}from"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import"./chunk-35DM4JJG.js";import{a as ze}from"./chunk-4ZEL6BYL.js";import{c as Le}from"./chunk-ZXRRPWQV.js";import{f as ct}from"./chunk-XTLR2A7C.js";import"./chunk-FSRSK4LY.js";import"./chunk-2LN3T5HY.js";import{a as ht}from"./chunk-FKVZRPV5.js";import{a as st,b as lt,c as nt,d as je,e as ce,f as U}from"./chunk-HEAQVSNS.js";import{a as fe,b as Ae,c as Ke,d as ut,e as pe}from"./chunk-WUWBZPUK.js";import{d as ge,f as gt,g as ft,h as pt,i as xt,l as Ge,o as bt}from"./chunk-FODLDLE2.js";import{a as o,d as Ye,e as Jt,f as Bt,g as Ht,i as mt}from"./chunk-YKXDMIHQ.js";var P=Ye(Jt(),1);var xe=Ye(Bt(),1);var t=Ye(Ht(),1);var Ut=/["\\\u0000-\u001F\uD800-\uDFFF]/,Lt=o(s=>Ut.test(s)?JSON.stringify(s):`"${s}"`,"ot"),dt=o(s=>{if(s===void 0)return"null";if(typeof s=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key \u2014 pass it as a string, or use stableWireKey");if(typeof s=="number"){if(Number.isNaN(s))return"nan";if(s===1/0)return"inf";if(s===-1/0)return"-inf";if(Object.is(s,-0))return"-0"}if(typeof s=="string")return Lt(s);if(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s)){let i="[";for(let n=0;n<s.length;n++)n>0&&(i+=","),i+=dt(s[n]);return i+"]"}let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let i=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${i} in a stable JSON cache key \u2014 only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}let l=s,a=Object.keys(l).sort(),r="{",u=!0;for(let i of a){let n=l[i];n!==void 0&&(u?u=!1:r+=",",r+=Lt(i),r+=":",r+=dt(n))}return r+"}"},"Ze"),Pt=o((s,e,l)=>`${s}:${e}:${dt(l??{})}`,"ht"),Qt=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"gt"),Wt=o((s,e)=>Qt(s,e),"Jt"),Gt=o(s=>Qt(s.kind,s),"Vt"),ot=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"We"),Vt=o(s=>Array.isArray(s?.series)?s.series:[],"Gt"),Xt="FUNCTION_NOT_FOUND",Yt=o(s=>{let e=new Map;if(!Array.isArray(s?.series))return e;for(let l of s.series)e.set(Pt(l.kind,l.name,l.attributes),l.points);return e},"Xt"),Zt={counter:"secondary",gauge:"default",histogram:"outline"},Et=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,u=ge();if(r===void 0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=c):c=e[0],c}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let c=`mt-instrument-trace-${l}`,f;return e[3]!==n||e[4]!==c||e[5]!==r?(f=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":c,title:r,children:n}),e[3]=n,e[4]=c,e[5]=r,e[6]=f):f=e[6],f}let h=`mt-instrument-trace-${l}`,y;e[7]!==a||e[8]!==r?(y=o(()=>{a(r)},"v"),e[7]=a,e[8]=r,e[9]=y):y=e[9];let w;e[10]!==u||e[11]!==r?(w=u("Open the exemplar trace {trace}",{trace:r}),e[10]=u,e[11]=r,e[12]=w):w=e[12];let g;return e[13]!==n||e[14]!==h||e[15]!==y||e[16]!==w?(g=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":h,onClick:y,title:w,type:"button",children:n}),e[13]=n,e[14]=h,e[15]=y,e[16]=w,e[17]=g):g=e[17],g},"Zt"),er=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={},e[0]=u):u=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:h,errorSource:y}=Le(ze.getMetricSeries,u,i),w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w={},e[3]=w):w=e[3];let g;e[4]!==a?(g={live:!0,shardKey:a},e[4]=a,e[5]=g):g=e[5];let{data:c}=Le(ze.getMetricHistory,w,g),f,N,q,_,d,x,p,b,M,$,S,I,C;if(e[6]!==n||e[7]!==h||e[8]!==y||e[9]!==c||e[10]!==l||e[11]!==r){b=Symbol.for("react.early_return_sentinel");e:{let z=Vt(n),A=xt(y)===Xt;if(h!==null&&!A){let m;e[25]!==r?(m=r("Instruments"),e[25]=r,e[26]=m):m=e[26];let j;e[27]!==m?(j=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[27]=m,e[28]=j):j=e[28];let J;e[29]!==h||e[30]!==r?(J=r("Instruments unavailable: {error}",{error:h}),e[29]=h,e[30]=r,e[31]=J):J=e[31];let B;e[32]!==J?(B=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:J}),e[32]=J,e[33]=B):B=e[33];let de;e[34]!==j||e[35]!==B?(de=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[j,B]}),e[34]=j,e[35]=B,e[36]=de):de=e[36],b=de;break e}if(z.length===0){b=null;break e}let D=Yt(c),L;e[37]!==r?(L=o(m=>r(m==="counter"?"Counter":m==="gauge"?"Gauge":"Histogram"),"z"),e[37]=r,e[38]=L):L=e[38];let Q=L;d="flex flex-col gap-2",x="mt-instruments";let K;e[39]!==r?(K=r("Instruments"),e[39]=r,e[40]=K):K=e[40],e[41]!==K?(p=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:K}),e[41]=K,e[42]=p):p=e[42],_=fe,C="overflow-hidden py-0",q=pe,I="px-0",N=st,$="mt-instruments-table";let W;e[43]!==r?(W=r("name"),e[43]=r,e[44]=W):W=e[44];let G;e[45]!==W?(G=(0,t.jsx)(ce,{children:W}),e[45]=W,e[46]=G):G=e[46];let V;e[47]!==r?(V=r("kind"),e[47]=r,e[48]=V):V=e[48];let X;e[49]!==V?(X=(0,t.jsx)(ce,{children:V}),e[49]=V,e[50]=X):X=e[50];let Y;e[51]!==r?(Y=r("value"),e[51]=r,e[52]=Y):Y=e[52];let Z;e[53]!==Y?(Z=(0,t.jsx)(ce,{className:"text-right",children:Y}),e[53]=Y,e[54]=Z):Z=e[54];let E;e[55]!==r?(E=r("count"),e[55]=r,e[56]=E):E=e[56];let ee;e[57]!==E?(ee=(0,t.jsx)(ce,{className:"text-right",children:E}),e[57]=E,e[58]=ee):ee=e[58];let te;e[59]!==r?(te=r("range"),e[59]=r,e[60]=te):te=e[60];let re;e[61]!==te?(re=(0,t.jsx)(ce,{className:"text-right",children:te}),e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==r?(ae=r("trend"),e[63]=r,e[64]=ae):ae=e[64];let se;e[65]!==ae?(se=(0,t.jsx)(ce,{children:ae}),e[65]=ae,e[66]=se):se=e[66];let le;e[67]!==r?(le=r("trace"),e[67]=r,e[68]=le):le=e[68];let ne;e[69]!==le?(ne=(0,t.jsx)(ce,{children:le}),e[69]=le,e[70]=ne):ne=e[70];let ie;e[71]!==r?(ie=r("dimensions"),e[71]=r,e[72]=ie):ie=e[72];let oe;e[73]!==ie?(oe=(0,t.jsx)(ce,{children:ie}),e[73]=ie,e[74]=oe):oe=e[74],e[75]!==G||e[76]!==X||e[77]!==Z||e[78]!==ee||e[79]!==re||e[80]!==se||e[81]!==ne||e[82]!==oe?(S=(0,t.jsx)(lt,{children:(0,t.jsxs)(je,{children:[G,X,Z,ee,re,se,ne,oe]})}),e[75]=G,e[76]=X,e[77]=Z,e[78]=ee,e[79]=re,e[80]=se,e[81]=ne,e[82]=oe,e[83]=S):S=e[83],f=nt,M=z.map(m=>{let j=Tt(m.attributes),J=Pt(m.kind,m.name,m.attributes),B=(D.get(J)??[]).map(de=>Wt(m.kind,de));return(0,t.jsxs)(je,{"data-testid":`mt-instrument-${m.name}`,children:[(0,t.jsx)(U,{className:"font-mono text-xs",title:m.functionPath,children:m.name}),(0,t.jsx)(U,{children:(0,t.jsx)(We,{variant:Zt[m.kind],children:Q(m.kind)})}),(0,t.jsx)(U,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${m.name}`,children:ot(Gt(m))}),(0,t.jsx)(U,{className:"text-right tabular-nums text-muted-foreground",children:m.count.toLocaleString()}),(0,t.jsx)(U,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:m.min===m.max?"\u2014":`${ot(m.min)}\u2013${ot(m.max)}`}),(0,t.jsx)(U,{children:B.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:m.name}),className:"h-6 w-24 text-foreground",series:B,testId:`mt-instrument-trend-${m.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(U,{className:"font-mono text-xs",children:(0,t.jsx)(Et,{name:m.name,onOpenTrace:l,traceId:m.exemplarTraceId})}),(0,t.jsx)(U,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:j,children:j===""?"\u2014":j})]},J)})}e[6]=n,e[7]=h,e[8]=y,e[9]=c,e[10]=l,e[11]=r,e[12]=f,e[13]=N,e[14]=q,e[15]=_,e[16]=d,e[17]=x,e[18]=p,e[19]=b,e[20]=M,e[21]=$,e[22]=S,e[23]=I,e[24]=C}else f=e[12],N=e[13],q=e[14],_=e[15],d=e[16],x=e[17],p=e[18],b=e[19],M=e[20],$=e[21],S=e[22],I=e[23],C=e[24];if(b!==Symbol.for("react.early_return_sentinel"))return b;let F;e[84]!==f||e[85]!==M?(F=(0,t.jsx)(f,{children:M}),e[84]=f,e[85]=M,e[86]=F):F=e[86];let k;e[87]!==N||e[88]!==F||e[89]!==$||e[90]!==S?(k=(0,t.jsxs)(N,{"data-testid":$,children:[S,F]}),e[87]=N,e[88]=F,e[89]=$,e[90]=S,e[91]=k):k=e[91];let v;e[92]!==q||e[93]!==k||e[94]!==I?(v=(0,t.jsx)(q,{className:I,children:k}),e[92]=q,e[93]=k,e[94]=I,e[95]=v):v=e[95];let T;e[96]!==_||e[97]!==v||e[98]!==C?(T=(0,t.jsx)(_,{className:C,children:v}),e[96]=_,e[97]=v,e[98]=C,e[99]=T):T=e[99];let O;return e[100]!==d||e[101]!==x||e[102]!==p||e[103]!==T?(O=(0,t.jsxs)("section",{className:d,"data-testid":x,children:[p,T]}),e[100]=d,e[101]=x,e[102]=p,e[103]=T,e[104]=O):O=e[104],O},"er"),tr=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),u;e[0]!==r?(u=r("Shards"),e[0]=r,e[1]=u):u=e[1];let i;e[2]!==l.failed||e[3]!==l.reachable||e[4]!==r?(i=l.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:l.failed,reachable:l.reachable}):r("{reachable} reachable",{reachable:l.reachable}),e[2]=l.failed,e[3]=l.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==u||e[7]!==i?(n=(0,t.jsx)(me,{label:u,testId:"mt-agg-shards",value:i}),e[6]=u,e[7]=i,e[8]=n):n=e[8];let h;e[9]!==r?(h=r("Total requests"),e[9]=r,e[10]=h):h=e[10];let y;e[11]!==l.totalRequests||e[12]!==h?(y=(0,t.jsx)(me,{label:h,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=h,e[13]=y):y=e[13];let w;e[14]!==r?(w=r("Total errors"),e[14]=r,e[15]=w):w=e[15];let g;e[16]!==l.totalErrors||e[17]!==w?(g=(0,t.jsx)(me,{label:w,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=w,e[18]=g):g=e[18];let c;e[19]!==r?(c=r("Total database size"),e[19]=r,e[20]=c):c=e[20];let f;e[21]!==l.totalDatabaseSize?(f=Ge(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=f):f=e[22];let N;e[23]!==c||e[24]!==f?(N=(0,t.jsx)(me,{label:c,testId:"mt-agg-db-size",value:f}),e[23]=c,e[24]=f,e[25]=N):N=e[25];let q;e[26]!==r?(q=r("Combined cache hit rate"),e[26]=r,e[27]=q):q=e[27];let _;e[28]!==l.hitRate||e[29]!==r?(_=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=_):_=e[30];let d;e[31]!==q||e[32]!==_?(d=(0,t.jsx)(me,{label:q,testId:"mt-agg-cache",value:_}),e[31]=q,e[32]=_,e[33]=d):d=e[33];let x;e[34]!==N||e[35]!==d||e[36]!==n||e[37]!==y||e[38]!==g?(x=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,y,g,N,d]}),e[34]=N,e[35]=d,e[36]=n,e[37]=y,e[38]=g,e[39]=x):x=e[39];let p;e[40]!==r?(p=r("shard"),e[40]=r,e[41]=p):p=e[41];let b;e[42]!==p?(b=(0,t.jsx)(ce,{children:p}),e[42]=p,e[43]=b):b=e[43];let M;e[44]!==r?(M=r("requests"),e[44]=r,e[45]=M):M=e[45];let $;e[46]!==M?($=(0,t.jsx)(ce,{children:M}),e[46]=M,e[47]=$):$=e[47];let S;e[48]!==r?(S=r("errors"),e[48]=r,e[49]=S):S=e[49];let I;e[50]!==S?(I=(0,t.jsx)(ce,{children:S}),e[50]=S,e[51]=I):I=e[51];let C;e[52]!==r?(C=r("db size"),e[52]=r,e[53]=C):C=e[53];let F;e[54]!==C?(F=(0,t.jsx)(ce,{children:C}),e[54]=C,e[55]=F):F=e[55];let k;e[56]!==b||e[57]!==$||e[58]!==I||e[59]!==F?(k=(0,t.jsx)(lt,{children:(0,t.jsxs)(je,{children:[b,$,I,F]})}),e[56]=b,e[57]=$,e[58]=I,e[59]=F,e[60]=k):k=e[60];let v;if(e[61]!==a||e[62]!==r){let A;e[64]!==r?(A=o(D=>(0,t.jsxs)(je,{"data-testid":`mt-agg-row-${D.shard}`,children:[(0,t.jsx)(U,{children:D.shard}),D.metrics===null?(0,t.jsx)(U,{className:"text-destructive",colSpan:3,children:D.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(U,{className:"tabular-nums",children:D.metrics.requests}),(0,t.jsx)(U,{className:"tabular-nums",children:D.metrics.errors}),(0,t.jsx)(U,{className:"tabular-nums",children:Ge(D.metrics.databaseSize)})]})]},D.shard),"O"),e[64]=r,e[65]=A):A=e[65],v=a.map(A),e[61]=a,e[62]=r,e[63]=v}else v=e[63];let T;e[66]!==v?(T=(0,t.jsx)(nt,{children:v}),e[66]=v,e[67]=T):T=e[67];let O;e[68]!==k||e[69]!==T?(O=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(st,{"data-testid":"mt-agg-table",children:[k,T]})})}),e[68]=k,e[69]=T,e[70]=O):O=e[70];let z;return e[71]!==x||e[72]!==O?(z=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[x,O]}),e[71]=x,e[72]=O,e[73]=z):z=e[73],z},"tr"),rr=o(s=>{let e=Math.floor(s/1e3),l=Math.floor(e/3600),a=Math.floor(e%3600/60),r=e%60;return l>0?`${l.toString()}h ${a.toString()}m`:a>0?`${a.toString()}m ${r.toString()}s`:`${r.toString()}s`},"rr"),ar=o((s,e)=>{let l=s+e;return l===0?"\u2014":`${(s/l*100).toFixed(1)}%`},"sr"),jt=o(s=>s<=0?"\u2014":s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"ct"),sr=o(s=>{let e=(0,xe.c)(75),{currentDelta:l,errorRate:a,history:r,latencyPercentiles:u,metrics:i}=s,n=ge(),{cache:h}=i,y;e[0]!==r||e[1]!==n?(y=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=y):y=e[2];let w;e[3]!==l||e[4]!==r.length||e[5]!==n?(w=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${l.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=l,e[4]=r.length,e[5]=n,e[6]=w):w=e[6];let g;e[7]!==n?(g=n("Requests"),e[7]=n,e[8]=g):g=e[8];let c;e[9]!==i.requests||e[10]!==y||e[11]!==w||e[12]!==g?(c=(0,t.jsx)(me,{chart:y,footer:w,label:g,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=y,e[11]=w,e[12]=g,e[13]=c):c=e[13];let f;e[14]!==a||e[15]!==n?(f=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=f):f=e[16];let N;e[17]!==n?(N=n("Errors"),e[17]=n,e[18]=N):N=e[18];let q;e[19]!==a||e[20]!==i.errors?(q=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=q):q=e[21];let _;e[22]!==f||e[23]!==N||e[24]!==q?(_=(0,t.jsx)(me,{footer:f,label:N,testId:"mt-errors",value:q}),e[22]=f,e[23]=N,e[24]=q,e[25]=_):_=e[25];let d;e[26]!==u.p90?(d=u.p90>0?`P90 ${jt(u.p90)}`:void 0,e[26]=u.p90,e[27]=d):d=e[27];let x;e[28]!==n?(x=n("P95 latency"),e[28]=n,e[29]=x):x=e[29];let p;e[30]!==u.p95?(p=u.p95>0?jt(u.p95):"\u2014",e[30]=u.p95,e[31]=p):p=e[31];let b;e[32]!==x||e[33]!==p||e[34]!==d?(b=(0,t.jsx)(me,{footer:d,label:x,testId:"mt-p95",value:p}),e[32]=x,e[33]=p,e[34]=d,e[35]=b):b=e[35];let M;e[36]!==h||e[37]!==n?(M=h?`${h.entries.toLocaleString()} ${n("cache entries")}`:void 0,e[36]=h,e[37]=n,e[38]=M):M=e[38];let $;e[39]!==n?($=n("Database size"),e[39]=n,e[40]=$):$=e[40];let S;e[41]!==i.databaseSize?(S=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=S):S=e[42];let I;e[43]!==M||e[44]!==$||e[45]!==S?(I=(0,t.jsx)(me,{footer:M,label:$,testId:"mt-db-size",value:S}),e[43]=M,e[44]=$,e[45]=S,e[46]=I):I=e[46];let C;e[47]!==n?(C=n("Shard"),e[47]=n,e[48]=C):C=e[48];let F;e[49]!==i.shard||e[50]!==C?(F=(0,t.jsx)(me,{label:C,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=C,e[51]=F):F=e[51];let k;e[52]!==n?(k=n("Uptime"),e[52]=n,e[53]=k):k=e[53];let v;e[54]!==i.uptimeMs?(v=rr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=v):v=e[55];let T;e[56]!==k||e[57]!==v?(T=(0,t.jsx)(me,{label:k,testId:"mt-uptime",value:v}),e[56]=k,e[57]=v,e[58]=T):T=e[58];let O;e[59]!==n?(O=n("Cache hit rate"),e[59]=n,e[60]=O):O=e[60];let z;e[61]!==h||e[62]!==n?(z=h?n("{rate} ({count} entries)",{count:h.entries,rate:ar(h.hits,h.misses)}):n("no cache configured"),e[61]=h,e[62]=n,e[63]=z):z=e[63];let A;e[64]!==O||e[65]!==z?(A=(0,t.jsx)(me,{label:O,testId:"mt-cache",value:z}),e[64]=O,e[65]=z,e[66]=A):A=e[66];let D;return e[67]!==b||e[68]!==I||e[69]!==F||e[70]!==T||e[71]!==A||e[72]!==c||e[73]!==_?(D=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[c,_,b,I,F,T,A]}),e[67]=b,e[68]=I,e[69]=F,e[70]=T,e[71]=A,e[72]=c,e[73]=_,e[74]=D):D=e[74],D},"lr"),Xe=o(s=>s>=100?"critical":s>=50?"warning":"good","Ve"),Qe=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Ae"),Ve=o(s=>s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString(),"He"),lr=o(s=>{let e=(0,xe.c)(3),{level:l}=s;if(l==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(We,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(l==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"ir"),nr=o((s,e)=>{let l=[...s];return l.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),l},"ar"),ir=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,u]=(0,P.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,h]=(0,P.useState)(i),y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=o(C=>{C!==null&&u(C)},"v"),e[1]=y):y=e[1];let w=y,g,c,f,N,q,_,d,x,p,b;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){f=Symbol.for("react.early_return_sentinel");e:{let C=nr(l,r),F;e[16]!==l?(F=l.filter(or),e[16]=l,e[17]=F):F=e[17];let k=F.length,v;e[18]!==l?(v=l.filter(dr),e[18]=l,e[19]=v):v=e[19];let T=v.length,O;e[20]!==l?(O=l.filter(cr),e[20]=l,e[21]=O):O=e[21];let z=O.length,A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=o(R=>{h(ue=>{let H=new Set(ue);return H.has(R)?H.delete(R):H.add(R),H})},"O"),e[22]=A):A=e[22];let D=A;if(l.length===0){let R;e[23]!==a?(R=a("No query insights yet"),e[23]=a,e[24]=R):R=e[24];let ue;e[25]!==R?(ue=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:R}),e[25]=R,e[26]=ue):ue=e[26];let H;e[27]!==a?(H=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=H):H=e[28];let he;e[29]!==H?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:H}),e[29]=H,e[30]=he):he=e[30];let Ue;e[31]!==ue||e[32]!==he?(Ue=(0,t.jsx)(fe,{children:(0,t.jsx)(pe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ue,he]})})}),e[31]=ue,e[32]=he,e[33]=Ue):Ue=e[33],f=Ue;break e}d="space-y-4",x="qi-root";let L;e[34]!==a?(L=a("Critical queries"),e[34]=a,e[35]=L):L=e[35];let Q;e[36]!==L?(Q=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:L})}),e[36]=L,e[37]=Q):Q=e[37];let K;e[38]!==k?(K=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:k}),e[38]=k,e[39]=K):K=e[39];let W;e[40]!==a?(W=a(">100ms avg execution"),e[40]=a,e[41]=W):W=e[41];let G;e[42]!==W?(G=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:W}),e[42]=W,e[43]=G):G=e[43];let V;e[44]!==K||e[45]!==G?(V=(0,t.jsxs)(pe,{children:[K,G]}),e[44]=K,e[45]=G,e[46]=V):V=e[46];let X;e[47]!==Q||e[48]!==V?(X=(0,t.jsxs)(fe,{children:[Q,V]}),e[47]=Q,e[48]=V,e[49]=X):X=e[49];let Y;e[50]!==a?(Y=a("Moderate queries"),e[50]=a,e[51]=Y):Y=e[51];let Z;e[52]!==Y?(Z=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:Y})}),e[52]=Y,e[53]=Z):Z=e[53];let E;e[54]!==T?(E=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:T}),e[54]=T,e[55]=E):E=e[55];let ee;e[56]!==a?(ee=a("50\u2013100ms avg execution"),e[56]=a,e[57]=ee):ee=e[57];let te;e[58]!==ee?(te=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ee}),e[58]=ee,e[59]=te):te=e[59];let re;e[60]!==E||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[E,te]}),e[60]=E,e[61]=te,e[62]=re):re=e[62];let ae;e[63]!==Z||e[64]!==re?(ae=(0,t.jsxs)(fe,{children:[Z,re]}),e[63]=Z,e[64]=re,e[65]=ae):ae=e[65];let se;e[66]!==a?(se=a("Fast queries"),e[66]=a,e[67]=se):se=e[67];let le;e[68]!==se?(le=(0,t.jsx)(Ae,{className:"pb-2",children:(0,t.jsx)(Ke,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==z?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:z}),e[70]=z,e[71]=ne):ne=e[71];let ie;e[72]!==a?(ie=a("<50ms avg execution"),e[72]=a,e[73]=ie):ie=e[73];let oe;e[74]!==ie?(oe=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ie}),e[74]=ie,e[75]=oe):oe=e[75];let m;e[76]!==ne||e[77]!==oe?(m=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=m):m=e[78];let j;e[79]!==le||e[80]!==m?(j=(0,t.jsxs)(fe,{children:[le,m]}),e[79]=le,e[80]=m,e[81]=j):j=e[81],e[82]!==X||e[83]!==ae||e[84]!==j?(p=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[X,ae,j]}),e[82]=X,e[83]=ae,e[84]=j,e[85]=p):p=e[85];let J;e[86]!==a?(J=a("Query leaderboard"),e[86]=a,e[87]=J):J=e[87];let B;e[88]!==J?(B=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:J}),e[88]=J,e[89]=B):B=e[89];let de;e[90]!==r||e[91]!==a?(de=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=de):de=e[92];let be;e[93]!==de?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:de}),e[93]=de,e[94]=be):be=e[94];let ve;e[95]!==B||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[B,be]}),e[95]=B,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Je;e[104]===Symbol.for("react.memo_cache_sentinel")?(Je=(0,t.jsx)(Ct,{}),e[104]=Je):Je=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(It,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Je}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let Me;e[109]!==qe?(Me=(0,t.jsx)(Pe,{value:"totalTime",children:qe}),e[109]=qe,e[110]=Me):Me=e[110];let ke;e[111]!==a?(ke=a("Avg time"),e[111]=a,e[112]=ke):ke=e[112];let _e;e[113]!==ke?(_e=(0,t.jsx)(Pe,{value:"avgTime",children:ke}),e[113]=ke,e[114]=_e):_e=e[114];let $e;e[115]!==a?($e=a("Execution count"),e[115]=a,e[116]=$e):$e=e[116];let De;e[117]!==$e?(De=(0,t.jsx)(Pe,{value:"execCount",children:$e}),e[117]=$e,e[118]=De):De=e[118];let Ce;e[119]!==a?(Ce=a("Rows read"),e[119]=a,e[120]=Ce):Ce=e[120];let Ie;e[121]!==Ce?(Ie=(0,t.jsx)(Pe,{value:"rowsRead",children:Ce}),e[121]=Ce,e[122]=Ie):Ie=e[122];let Fe;e[123]!==Me||e[124]!==_e||e[125]!==De||e[126]!==Ie?(Fe=(0,t.jsxs)(Ft,{children:[Me,_e,De,Ie]}),e[123]=Me,e[124]=_e,e[125]=De,e[126]=Ie,e[127]=Fe):Fe=e[127];let Te;e[128]!==r||e[129]!==we||e[130]!==Fe?(Te=(0,t.jsxs)(Dt,{onValueChange:w,value:r,children:[we,Fe]}),e[128]=r,e[129]=we,e[130]=Fe,e[131]=Te):Te=e[131];let Re;e[132]!==Ne||e[133]!==Te?(Re=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,Te]}),e[132]=Ne,e[133]=Te,e[134]=Re):Re=e[134],e[135]!==ve||e[136]!==Re?(b=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,Re]}),e[135]=ve,e[136]=Re,e[137]=b):b=e[137],c=fe;let Oe;e[138]!==a?(Oe=a("Statements"),e[138]=a,e[139]=Oe):Oe=e[139];let Be;e[140]!==Oe?(Be=(0,t.jsx)(Ke,{children:Oe}),e[140]=Oe,e[141]=Be):Be=e[141],_=(0,t.jsxs)(Ae,{children:[Be,(0,t.jsx)(ut,{children:a("{count} tracked statements",{count:C.length})})]}),g=pe,N="space-y-2";let He;e[142]!==n||e[143]!==a?(He=o(R=>{let ue=R.normalizedSql,H=n.has(ue),he=Xe(R.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":H,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{D(ue)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(lr,{level:he}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),R.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(R.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Ve(R.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),H&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:R.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[R.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(R.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(R.rowsWritten)})]})]})]})]},ue)},"Ke"),e[142]=n,e[143]=a,e[144]=He):He=e[144],q=C.map(He)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=g,e[7]=c,e[8]=f,e[9]=N,e[10]=q,e[11]=_,e[12]=d,e[13]=x,e[14]=p,e[15]=b}else g=e[6],c=e[7],f=e[8],N=e[9],q=e[10],_=e[11],d=e[12],x=e[13],p=e[14],b=e[15];if(f!==Symbol.for("react.early_return_sentinel"))return f;let M;e[145]!==N||e[146]!==q?(M=(0,t.jsx)("div",{className:N,children:q}),e[145]=N,e[146]=q,e[147]=M):M=e[147];let $;e[148]!==g||e[149]!==M?($=(0,t.jsx)(g,{children:M}),e[148]=g,e[149]=M,e[150]=$):$=e[150];let S;e[151]!==c||e[152]!==$||e[153]!==_?(S=(0,t.jsxs)(c,{children:[_,$]}),e[151]=c,e[152]=$,e[153]=_,e[154]=S):S=e[154];let I;return e[155]!==S||e[156]!==d||e[157]!==x||e[158]!==p||e[159]!==b?(I=(0,t.jsxs)("div",{className:d,"data-testid":x,children:[p,b,S]}),e[155]=S,e[156]=d,e[157]=x,e[158]=p,e[159]=b,e[160]=I):I=e[160],I},"nr");function or(s){return Xe(s.avgDurationMs)==="critical"}o(or,"or");function dr(s){return Xe(s.avgDurationMs)==="warning"}o(dr,"cr");function cr(s){return Xe(s.avgDurationMs)==="good"}o(cr,"dr");var mr=["1m","5m","15m","1h"],ur=o(s=>new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"ur"),hr=o(s=>s.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:ur(e.bucketMs)})),"fr"),gr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,P.useState)("15m"),r=Le(ze.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,u=hr(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:mr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===l,className:mt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===l&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:o(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(We,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),u.length===0?(0,t.jsx)(ht,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(Ee,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(yt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(Ee,{height:140,width:"100%",children:(0,t.jsxs)(Nt,{data:u,children:[(0,t.jsx)(tt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(rt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(at,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(et,{}),(0,t.jsx)(vt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(ir,{queryStats:r?.entries??[]})]})},"hr"),fr=gt(ze.getMetrics),pr=o((s,e)=>s?e:"overview","pr"),jr=o(({initialShardKey:s})=>{let e=ct(),l=ge(),{queryShardKey:a,setShardKey:r,shardKey:u}=kt(s),[i,n]=(0,P.useState)("overview"),[h,y]=(0,P.useState)([]),w=(0,P.useRef)(null),g=(0,P.useRef)(null),c=(0,P.useRef)(!0);(0,P.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]);let f=Rt(a),{data:N,error:q,liveError:_}=Le(ze.getMetrics,{},{live:!0,shardKey:a}),d=N??null;(0,P.useEffect)(()=>{if(N===void 0)return;qt(a);let D=N,L=w.current,Q=g.current!==null&&g.current!==D.shard;if(g.current=D.shard,w.current=D.requests,Q){y([]);return}L!==null&&D.requests>=L&&y(K=>[...K,D.requests-L].slice(-30))},[N,a]);let[x,p]=(0,P.useState)(null),[b,M]=(0,P.useState)(!1),$=o(async()=>{M(!0);let D=zt(u,wt());try{let L=await Promise.all(D.map(async Q=>{try{let K=await e.query(fr,{},ft(Q));return{error:null,metrics:K,shard:Q===""?K.shard:Q}}catch(K){return{error:pt(K),metrics:null,shard:Q===""?"__root__":Q}}}));c.current&&p(L)}finally{c.current&&M(!1)}},"R"),S=x===null?null:Ot(x),I=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,C=h.length>0?h.at(-1):0,F=d?At(d):{p90:0,p95:0},k=(0,P.useMemo)(()=>{if(!d||!("queryStats"in d))return;let D=d.queryStats;if(!(!D||!Array.isArray(D)))return Kt(D)},[d]),v=pr(k!==void 0,i),T=o(()=>{bt($())},"D"),O=o(()=>{p(null)},"F"),z=o(()=>{n("overview")},"A"),A=o(()=>{n("query-insights")},"O");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(Mt,{onChange:r,testId:"mt-shard-input",value:u}),(0,t.jsx)(_t,{message:_,prefix:"mt"}),(0,t.jsx)(Ze,{"data-testid":"mt-aggregate",disabled:b,onClick:T,size:"sm",type:"button",variant:"secondary",children:l(b?"Aggregating\u2026":"All shards")}),x!==null&&(0,t.jsx)(Ze,{"data-testid":"mt-aggregate-clear",onClick:O,size:"sm",type:"button",variant:"ghost",children:l("Hide")}),(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:$t,rel:"noreferrer",target:"_blank",children:l("Open in Cloudflare")})]}),q!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:q}),k!==void 0&&(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsx)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:z,type:"button",children:l("Overview")}),(0,t.jsxs)("button",{className:`pb-2 text-sm font-medium transition-colors ${v==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:A,type:"button",children:[l("Query insights"),k.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:k.length})]})]}),v==="query-insights"&&k!==void 0&&(0,t.jsx)(gr,{shardKey:a}),v==="overview"&&d!==null&&(0,t.jsx)(sr,{currentDelta:C,errorRate:I,history:h,latencyPercentiles:F,metrics:d}),v==="overview"&&d===null&&null,v==="overview"&&(0,t.jsx)(er,{onOpenTrace:f,shardKey:a}),v==="overview"&&S!==null&&x!==null&&(0,t.jsx)(tr,{aggregate:S,shardResults:x})]})},"jr");export{jr as MetricsPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ot,b as Ie,e as uo,f as co}from"./chunk-INWAISDG.js";import{a as ao,b as it,c as so,d as At}from"./chunk-DLT5B4TL.js";import{a as Tt}from"./chunk-NPERN4YF.js";import{b as Et}from"./chunk-MNAASONZ.js";import{d as go}from"./chunk-UYEZR3BI.js";import{a as vn,b as bn,c as Dt,d as io}from"./chunk-LSWAITBZ.js";import{a as It}from"./chunk-CSUROWL2.js";import"./chunk-TJRQUJFS.js";import"./chunk-TWTNWOJU.js";import"./chunk-WQYWA7U6.js";import{a as Vt}from"./chunk-VVOVVU53.js";import{a as yt}from"./chunk-XZMOZFE6.js";import{a as pn}from"./chunk-IMOHEGMV.js";import{a as lo}from"./chunk-66UGPQVC.js";import{b as Un,c as cn}from"./chunk-RLLKECZT.js";import"./chunk-7RIRJD2P.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import{a as hn}from"./chunk-QKEJLVC5.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import{a as mn}from"./chunk-SU737V7V.js";import{a as Zn}from"./chunk-IABM4BFJ.js";import{a as Xn,b as Yn}from"./chunk-OGUKYRFM.js";import{c as jn,d as Bn,e as qn}from"./chunk-JVUZEYKQ.js";import{b as Qn,c as Wn,f as gn}from"./chunk-OKG3HWSJ.js";import{P as Jn}from"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as Mt}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import"./chunk-25NFR6EB.js";import{a as be}from"./chunk-4ZEL6BYL.js";import{b as dn,c as tt}from"./chunk-KQFH6FFC.js";import{f as Ke}from"./chunk-XZCNX7YU.js";import"./chunk-FSRSK4LY.js";import"./chunk-2LN3T5HY.js";import{a as Pt}from"./chunk-FKVZRPV5.js";import{a as eo,b as to,c as no,d as fn,e as oo,f as ro}from"./chunk-HEAQVSNS.js";import{d as ee,f as Pe,g as Ve,h as Ct,m as un,n as Ue,o as le,r as Kn}from"./chunk-FODLDLE2.js";import{a,d as ye,e as dt,f as xt,g as St,i as at}from"./chunk-YKXDMIHQ.js";var ar=ye(xt(),1);var ft=ye(dt(),1);var Qe=ye(xt(),1);var G=ye(St(),1),De=ye(dt(),1);var Er=2166136261,Tr=16777619,Dr=a((t,e=Er)=>{let n=e;for(let o=0;o<t.length;o+=1)n^=t.charCodeAt(o),n=Math.imul(n,Tr);return(n>>>0).toString(16).padStart(8,"0")},"j"),Or=/([a-z\d])([A-Z])/gu,Ar=/[\s_-]+/u,Lr=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),zr=a(t=>{let e=t.replaceAll(Or,"$1 $2").split(Ar).map(o=>o.toLowerCase()).filter(o=>o.length>0),n=new Set(e);for(let o=0;o<e.length-1;o+=1){let r=e[o],l=e[o+1];r===void 0||l===void 0||(n.add(`${r}${l}`),n.add(`${r}_${l}`))}return[...n]},"oe"),fo="\u2022\u2022\u2022",wo=a((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:Dr(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):fo}catch{return fo}},"G"),mo=a((t,e)=>{let n=new Map;for(let o of t)o.table===e&&n.set(o.column,o.strategy);return n},"P"),Gr=a(t=>{for(let e of zr(t))if(Lr.has(e))return!0;return!1},"ae"),po=a((t,e)=>{let n=e.filter(r=>!t.has(r)&&Gr(r));if(n.length===0)return t;let o=new Map(t);for(let r of n)o.set(r,"redact");return o},"B"),Rt=a((t,e,n)=>{if(!n.enabled)return t;let o=n.columns.get(e);return o===void 0?t:wo(t,o)},"_e"),Lt=a((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let n={...t};for(let[o,r]of e.columns)o in n&&(n[o]=wo(n[o],r));return n},"le"),zt=a((t,e)=>!e.enabled||e.columns.size===0?t:t.map(n=>Lt(n,e)),"Fe"),Hr=[25,50,100,250],jr=a(t=>{let e=(0,Qe.c)(18),{onChange:n,options:o,prefix:r,value:l}=t,i=ee(),s;e[0]!==n?(s=a(w=>{n(Number.parseInt(w.target.value,10))},"g"),e[0]=n,e[1]=s):s=e[1];let u=s,d=`${r}-page-size`,c;e[2]!==i?(c=i("Rows per page"),e[2]=i,e[3]=c):c=e[3];let p;e[4]!==c?(p=(0,G.jsx)("span",{children:c}),e[4]=c,e[5]=p):p=e[5];let g=`${r}-page-size`,f=`${r}-page-size`,m;e[6]!==o?(m=o.map(qr),e[6]=o,e[7]=m):m=e[7];let h;e[8]!==u||e[9]!==g||e[10]!==f||e[11]!==m||e[12]!==l?(h=(0,G.jsx)("select",{className:"h-6 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":g,id:f,onChange:u,value:l,children:m}),e[8]=u,e[9]=g,e[10]=f,e[11]=m,e[12]=l,e[13]=h):h=e[13];let b;return e[14]!==d||e[15]!==p||e[16]!==h?(b=(0,G.jsxs)("label",{className:"flex items-center gap-1.5",htmlFor:d,children:[p,h]}),e[14]=d,e[15]=p,e[16]=h,e[17]=b):b=e[17],b},"ie"),Br=a(t=>{let e=(0,Qe.c)(25),{onJump:n,page:o,pages:r,prefix:l}=t,i=ee(),s;e[0]!==n||e[1]!==r?(s=a(R=>{let y=Number.parseInt(R,10);Number.isNaN(y)||n(Math.min(Math.max(1,y),Math.max(1,r)))},"g"),e[0]=n,e[1]=r,e[2]=s):s=e[2];let u=s,d;e[3]!==u?(d=a(R=>{R.key==="Enter"&&u(R.currentTarget.value)},"f"),e[3]=u,e[4]=d):d=e[4];let c=d,p;e[5]!==u?(p=a(R=>{u(R.currentTarget.value)},"a"),e[5]=u,e[6]=p):p=e[6];let g=p,f;e[7]!==i?(f=i("Page"),e[7]=i,e[8]=f):f=e[8];let m;e[9]!==i?(m=i("Page"),e[9]=i,e[10]=m):m=e[10];let h=`${l}-page-jump`,b=Math.max(1,r),w;e[11]!==g||e[12]!==c||e[13]!==o||e[14]!==m||e[15]!==h||e[16]!==b?(w=(0,G.jsx)("input",{"aria-label":m,className:"h-6 w-12 rounded-md border border-border bg-background px-1 text-center tabular-nums outline-none focus-visible:border-ring","data-testid":h,defaultValue:o,max:b,min:1,onBlur:g,onKeyDown:c,type:"number"},o),e[11]=g,e[12]=c,e[13]=o,e[14]=m,e[15]=h,e[16]=b,e[17]=w):w=e[17];let x;e[18]!==r||e[19]!==i?(x=i("of {pages}",{pages:r}),e[18]=r,e[19]=i,e[20]=x):x=e[20];let C;return e[21]!==f||e[22]!==w||e[23]!==x?(C=(0,G.jsxs)("span",{className:"flex items-center gap-1.5 tabular-nums",children:[f,w,x]}),e[21]=f,e[22]=w,e[23]=x,e[24]=C):C=e[24],C},"de"),Gt=a(({hasNext:t,hasPrevious:e,onJumpToPage:n,onNext:o,onPageSizeChange:r,onPrevious:l,pageSize:i,pageSizeOptions:s=Hr,prefix:u,rangeEnd:d,rangeStart:c,total:p})=>{let g=ee(),f="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",m=i!==void 0&&i>0?Math.max(1,Math.ceil(p/i)):1,h=i!==void 0&&i>0?Math.floor(Math.max(0,c-1)/i)+1:1;return(0,G.jsxs)("div",{className:"flex w-full items-center justify-between gap-3 text-xs text-muted-foreground",children:[(0,G.jsxs)("div",{className:"flex items-center gap-3",children:[i!==void 0&&r!==void 0&&(0,G.jsx)(jr,{onChange:r,options:s,prefix:u,value:i}),(0,G.jsx)("span",{className:"tabular-nums","data-testid":`${u}-page-info`,children:g("{rangeStart}-{rangeEnd} of {total}",{rangeEnd:d,rangeStart:c,total:p})})]}),(0,G.jsxs)("div",{className:"flex items-center gap-3",children:[(0,G.jsx)("button",{className:f,"data-testid":`${u}-prev`,disabled:!e,onClick:l,type:"button",children:g("Previous")}),i!==void 0&&n!==void 0&&(0,G.jsx)(Br,{onJump:n,page:h,pages:m,prefix:u}),(0,G.jsx)("button",{className:f,"data-testid":`${u}-next`,disabled:!t,onClick:o,type:"button",children:g("Next")})]})]})},"Te");function qr(t){return(0,G.jsx)("option",{value:t,children:t},t)}a(qr,"ue");var ho=a(t=>t==null?"\u2205":t===""?"(empty)":typeof t=="object"?JSON.stringify(t):String(t),"D"),Jr=a(t=>{let e=(0,Qe.c)(32),{column:n,onFacetFilter:o,state:r}=t,l=ee(),i;e[0]!==n||e[1]!==o||e[2]!==r.result?.values?(i=a(b=>{let w=Number(b.currentTarget.dataset.index),x=r.result?.values[w];x!==void 0&&o(n,x.value)},"u"),e[0]=n,e[1]=o,e[2]=r.result?.values,e[3]=i):i=e[3];let s=i,u=`db-facet-${n}`,d;e[4]!==n?(d=(0,G.jsx)("span",{className:"font-medium text-foreground",children:n}),e[4]=n,e[5]=d):d=e[5];let c;e[6]!==r.loading||e[7]!==r.result||e[8]!==l?(c=r.loading&&r.result===null&&(0,G.jsx)("span",{className:"text-muted-foreground",children:l("Loading\u2026")}),e[6]=r.loading,e[7]=r.result,e[8]=l,e[9]=c):c=e[9];let p;e[10]!==r.error?(p=r.error!==null&&(0,G.jsx)("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=p):p=e[11];let g;e[12]!==r.result?.values?(g=r.result?.values??[],e[12]=r.result?.values,e[13]=g):g=e[13];let f;if(e[14]!==n||e[15]!==s||e[16]!==g){let b;e[18]!==n||e[19]!==s?(b=a((w,x)=>(0,G.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":x,"data-testid":`db-facet-value-${n}`,onClick:s,type:"button",children:[(0,G.jsx)("span",{className:"truncate",children:ho(w.value)}),(0,G.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:w.count})]},ho(w.value)),"i"),e[18]=n,e[19]=s,e[20]=b):b=e[20],f=g.map(b),e[14]=n,e[15]=s,e[16]=g,e[17]=f}else f=e[17];let m;e[21]!==n||e[22]!==r.result||e[23]!==l?(m=r.result?.truncated===!0&&(0,G.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${n}`,children:l("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=n,e[22]=r.result,e[23]=l,e[24]=m):m=e[24];let h;return e[25]!==u||e[26]!==d||e[27]!==c||e[28]!==p||e[29]!==f||e[30]!==m?(h=(0,G.jsxs)("section",{className:"flex flex-col gap-1","data-testid":u,children:[d,c,p,f,m]}),e[25]=u,e[26]=d,e[27]=c,e[28]=p,e[29]=f,e[30]=m,e[31]=h):h=e[31],h},"fe"),Ht=a(t=>{let e=(0,Qe.c)(44),{columns:n,facets:o,mask:r,onFacetFilter:l,onToggleFacet:i}=t,s=ee(),u;e[0]!==i?(u=a(N=>{let{column:M}=N.currentTarget.dataset;M!==void 0&&i(M)},"o"),e[0]=i,e[1]=u):u=e[1];let d=u,c;e[2]!==r?(c=a(N=>r.enabled&&r.columns.has(N),"l"),e[2]=r,e[3]=c):c=e[3];let p=c,g,f,m,h,b,w,x,C;if(e[4]!==n||e[5]!==o||e[6]!==p||e[7]!==s||e[8]!==d){C=Symbol.for("react.early_return_sentinel");e:{let N;e[17]!==p?(N=a(V=>!p(V),"w"),e[17]=p,e[18]=N):N=e[18];let M=n.filter(N),F;if(e[19]!==o||e[20]!==p?(F=Object.entries(o).filter(V=>{let[I]=V;return!p(I)}),e[19]=o,e[20]=p,e[21]=F):F=e[21],g=F,M.length===0){C=null;break e}w="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",x="db-facets",h="flex flex-col gap-1.5";let k;e[22]!==s?(k=s("Facets"),e[22]=s,e[23]=k):k=e[23],e[24]!==k?(b=(0,G.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:k}),e[24]=k,e[25]=b):b=e[25],f="flex flex-wrap gap-1";let $;e[26]!==o||e[27]!==d?($=a(V=>(0,G.jsx)("button",{"aria-pressed":V in o,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":V,"data-testid":`db-facet-toggle-${V}`,onClick:d,type:"button",children:V},V),"R"),e[26]=o,e[27]=d,e[28]=$):$=e[28],m=M.map($)}e[4]=n,e[5]=o,e[6]=p,e[7]=s,e[8]=d,e[9]=g,e[10]=f,e[11]=m,e[12]=h,e[13]=b,e[14]=w,e[15]=x,e[16]=C}else g=e[9],f=e[10],m=e[11],h=e[12],b=e[13],w=e[14],x=e[15],C=e[16];if(C!==Symbol.for("react.early_return_sentinel"))return C;let R;e[29]!==f||e[30]!==m?(R=(0,G.jsx)("div",{className:f,children:m}),e[29]=f,e[30]=m,e[31]=R):R=e[31];let y;e[32]!==R||e[33]!==h||e[34]!==b?(y=(0,G.jsxs)("div",{className:h,children:[b,R]}),e[32]=R,e[33]=h,e[34]=b,e[35]=y):y=e[35];let _;e[36]!==l||e[37]!==g?(_=g.map(N=>{let[M,F]=N;return(0,G.jsx)(Jr,{column:M,onFacetFilter:l,state:F},M)}),e[36]=l,e[37]=g,e[38]=_):_=e[38];let S;return e[39]!==y||e[40]!==_||e[41]!==w||e[42]!==x?(S=(0,G.jsxs)("aside",{className:w,"data-testid":x,children:[y,_]}),e[39]=y,e[40]=_,e[41]=w,e[42]=x,e[43]=S):S=e[43],S},"Ee");function We(t){let e=(0,Qe.c)(2),n=(0,De.useRef)(t),o;return e[0]!==t?(o=a(()=>{n.current=t},"s"),e[0]=t,e[1]=o):o=e[1],(0,De.useEffect)(o),n}a(We,"me");var jt=a(()=>{let[t,e]=(0,De.useState)({}),n=We(t),o=(0,De.useRef)({}),r=a(async(l,i)=>{let s=(o.current[l]??0)+1;o.current[l]=s,e(u=>l in u?{...u,[l]:{error:null,loading:!0,result:u[l]?.result??null}}:u);try{let u=await i(l);if(o.current[l]!==s)return;e(d=>l in d?{...d,[l]:{error:null,loading:!1,result:u}}:d)}catch(u){if(o.current[l]!==s)return;e(d=>l in d?{...d,[l]:{error:Ct(u),loading:!1,result:null}}:d)}},"r");return{clearFacets:a(()=>{e({})},"clearFacets"),facets:t,facetsRef:n,refetchFacets:a(l=>{for(let i of Object.keys(n.current))le(r(i,l))},"refetchFacets"),toggleFacet:a((l,i)=>{if(l in n.current){e(s=>Object.fromEntries(Object.entries(s).filter(([u])=>u!==l)));return}e(s=>({...s,[l]:{error:null,loading:!0,result:null}})),i!==null&&le(r(l,i))},"toggleFacet")}},"Oe"),Kr=[],Ur=a(()=>{let t=(0,Qe.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:n}=tt(be.maskPolicies,e);return Array.isArray(n?.columns)?n.columns:Kr},"ge"),Bt=a(t=>{let e=(0,Qe.c)(16),{columns:n,selectedTable:o}=t,r=Ur(),[l,i]=(0,De.useState)(!0),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=a(()=>{i(Qr)},"g"),e[0]=s):s=e[0];let u=s,d;if(e[1]!==n||e[2]!==r||e[3]!==o){let h=mo(r,o??"");d=po(h,n),e[1]=n,e[2]=r,e[3]=o,e[4]=d}else d=e[4];let c=d,p;e[5]!==l||e[6]!==r?(p=a((h,b)=>({columns:po(mo(r,h),b),enabled:l}),"a"),e[5]=l,e[6]=r,e[7]=p):p=e[7];let g=p,f;e[8]!==c||e[9]!==l?(f={columns:c,enabled:l},e[8]=c,e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==c||e[12]!==l||e[13]!==g||e[14]!==f?(m={maskColumns:c,maskOn:l,maskView:f,maskViewFor:g,onToggleMask:u},e[11]=c,e[12]=l,e[13]=g,e[14]=f,e[15]=m):m=e[15],m},"Re");function Qr(t){return!t}a(Qr,"he");var vo=34,bo=600,Wr=a(t=>{let e=(0,Qe.c)(21),{item:n,onSelect:o,prefix:r,selected:l,start:i}=t,s;e[0]!==n.name||e[1]!==o?(s=a(()=>{o(n.name)},"g"),e[0]=n.name,e[1]=o,e[2]=s):s=e[2];let u=s,d=`translateY(${String(i)}px)`,c;e[3]!==d?(c={insetInline:0,position:"absolute",top:0,transform:d},e[3]=d,e[4]=c):c=e[4];let p=c,g=l?"bg-accent font-medium text-accent-foreground":"text-foreground",f;e[5]!==g?(f=at("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",g),e[5]=g,e[6]=f):f=e[6];let m=`${r}-table-${n.name}`,h;e[7]!==n.name?(h=(0,G.jsx)("span",{className:"truncate",children:n.name}),e[7]=n.name,e[8]=h):h=e[8];let b;e[9]!==n.rowCount?(b=(0,G.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:n.rowCount}),e[9]=n.rowCount,e[10]=b):b=e[10];let w;e[11]!==u||e[12]!==l||e[13]!==f||e[14]!==m||e[15]!==h||e[16]!==b?(w=(0,G.jsxs)("button",{"aria-pressed":l,className:f,"data-testid":m,onClick:u,type:"button",children:[h,b]}),e[11]=u,e[12]=l,e[13]=f,e[14]=m,e[15]=h,e[16]=b,e[17]=w):w=e[17];let x;return e[18]!==p||e[19]!==w?(x=(0,G.jsx)("li",{style:p,children:w}),e[18]=p,e[19]=w,e[20]=x):x=e[20],x},"pe"),qt=a(({header:t,onReload:e,onSelect:n,prefix:o,reloadLabel:r,selected:l,tables:i})=>{let s=ee(),[u,d]=(0,De.useState)(""),c=(0,De.useRef)(null),p=a(h=>{d(h.target.value)},"a"),g=(0,De.useMemo)(()=>{let h=u.trim().toLowerCase();return h===""?i:i.filter(b=>b.name.toLowerCase().includes(h))},[u,i]),f=Et({count:g.length,estimateSize:a(()=>vo,"estimateSize"),getScrollElement:a(()=>c.current,"getScrollElement"),initialRect:{height:bo,width:240},observeElementRect:a((h,b)=>Tt(h,b,bo),"observeElementRect"),overscan:12}).getVirtualItems(),m={height:g.length*vo};return(0,G.jsxs)("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${o}-table-list`,children:[t,(0,G.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,G.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:s("Tables")}),e!==void 0&&(0,G.jsx)("button",{"aria-label":r??s("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":`${o}-load-tables`,onClick:e,title:r??s("Refresh"),type:"button",children:(0,G.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,G.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,G.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,G.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":`${o}-table-search`,onChange:p,placeholder:s("search table\u2026"),type:"search",value:u})}),(0,G.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${o}-table-list-rows`,ref:c,children:[(0,G.jsx)("li",{"aria-hidden":"true",style:m}),f.map(h=>{let b=g[h.index];return b===void 0?null:(0,G.jsx)(Wr,{item:b,onSelect:n,prefix:o,selected:l===b.name,start:h.start},b.name)})]})]})},"Ae");var K=ye(xt(),1);var P=ye(dt(),1);var v=ye(St(),1);var Ft=ye(dt(),1);function nt(t,e){return typeof t=="function"?t(e):t}a(nt,"functionalUpdate");function Ee(t,e){return n=>{e.setState(o=>({...o,[t]:nt(n,o[t])}))}}a(Ee,"makeStateUpdater");function Qt(t){return t instanceof Function}a(Qt,"isFunction");function Xr(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}a(Xr,"isNumberArray");function Yr(t,e){let n=[],o=a(r=>{r.forEach(l=>{n.push(l);let i=e(l);i!=null&&i.length&&o(i)})},"recurse");return o(t),n}a(Yr,"flattenBy");function A(t,e,n){let o=[],r;return l=>{let i;n.key&&n.debug&&(i=Date.now());let s=t(l);if(!(s.length!==o.length||s.some((c,p)=>o[p]!==c)))return r;o=s;let d;if(n.key&&n.debug&&(d=Date.now()),r=e(...s),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){let c=Math.round((Date.now()-i)*100)/100,p=Math.round((Date.now()-d)*100)/100,g=p/16,f=a((m,h)=>{for(m=String(m);m.length<h;)m=" "+m;return m},"pad");console.info(`%c\u23F1 ${f(p,5)} /${f(c,5)} ms`,`
|
|
1
|
+
import{a as Ot,b as Ie,e as uo,f as co}from"./chunk-INWAISDG.js";import{a as ao,b as it,c as so,d as At}from"./chunk-AHK42KDL.js";import{a as Tt}from"./chunk-NPERN4YF.js";import{b as Et}from"./chunk-MNAASONZ.js";import{d as go}from"./chunk-UYEZR3BI.js";import{a as vn,b as bn,c as Dt,d as io}from"./chunk-OVTMYZN2.js";import{a as It}from"./chunk-CSUROWL2.js";import"./chunk-TJRQUJFS.js";import"./chunk-TWTNWOJU.js";import"./chunk-WQYWA7U6.js";import{a as Vt}from"./chunk-VVOVVU53.js";import{a as yt}from"./chunk-XZMOZFE6.js";import{a as pn}from"./chunk-IMOHEGMV.js";import{a as lo}from"./chunk-66UGPQVC.js";import{b as Un,c as cn}from"./chunk-RLLKECZT.js";import"./chunk-7RIRJD2P.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import{a as hn}from"./chunk-QKEJLVC5.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import{a as mn}from"./chunk-SU737V7V.js";import{a as Zn}from"./chunk-IABM4BFJ.js";import{a as Xn,b as Yn}from"./chunk-OGUKYRFM.js";import{c as jn,d as Bn,e as qn}from"./chunk-JVUZEYKQ.js";import{b as Qn,c as Wn,f as gn}from"./chunk-OKG3HWSJ.js";import{P as Jn}from"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as Mt}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import"./chunk-25NFR6EB.js";import{a as be}from"./chunk-4ZEL6BYL.js";import{b as dn,c as tt}from"./chunk-ZXRRPWQV.js";import{f as Ke}from"./chunk-XTLR2A7C.js";import"./chunk-FSRSK4LY.js";import"./chunk-2LN3T5HY.js";import{a as Pt}from"./chunk-FKVZRPV5.js";import{a as eo,b as to,c as no,d as fn,e as oo,f as ro}from"./chunk-HEAQVSNS.js";import{d as ee,f as Pe,g as Ve,h as Ct,m as un,n as Ue,o as le,r as Kn}from"./chunk-FODLDLE2.js";import{a,d as ye,e as dt,f as xt,g as St,i as at}from"./chunk-YKXDMIHQ.js";var ar=ye(xt(),1);var ft=ye(dt(),1);var Qe=ye(xt(),1);var G=ye(St(),1),De=ye(dt(),1);var Er=2166136261,Tr=16777619,Dr=a((t,e=Er)=>{let n=e;for(let o=0;o<t.length;o+=1)n^=t.charCodeAt(o),n=Math.imul(n,Tr);return(n>>>0).toString(16).padStart(8,"0")},"j"),Or=/([a-z\d])([A-Z])/gu,Ar=/[\s_-]+/u,Lr=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),zr=a(t=>{let e=t.replaceAll(Or,"$1 $2").split(Ar).map(o=>o.toLowerCase()).filter(o=>o.length>0),n=new Set(e);for(let o=0;o<e.length-1;o+=1){let r=e[o],l=e[o+1];r===void 0||l===void 0||(n.add(`${r}${l}`),n.add(`${r}_${l}`))}return[...n]},"oe"),fo="\u2022\u2022\u2022",wo=a((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:Dr(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):fo}catch{return fo}},"G"),mo=a((t,e)=>{let n=new Map;for(let o of t)o.table===e&&n.set(o.column,o.strategy);return n},"P"),Gr=a(t=>{for(let e of zr(t))if(Lr.has(e))return!0;return!1},"ae"),po=a((t,e)=>{let n=e.filter(r=>!t.has(r)&&Gr(r));if(n.length===0)return t;let o=new Map(t);for(let r of n)o.set(r,"redact");return o},"B"),Rt=a((t,e,n)=>{if(!n.enabled)return t;let o=n.columns.get(e);return o===void 0?t:wo(t,o)},"_e"),Lt=a((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let n={...t};for(let[o,r]of e.columns)o in n&&(n[o]=wo(n[o],r));return n},"le"),zt=a((t,e)=>!e.enabled||e.columns.size===0?t:t.map(n=>Lt(n,e)),"Fe"),Hr=[25,50,100,250],jr=a(t=>{let e=(0,Qe.c)(18),{onChange:n,options:o,prefix:r,value:l}=t,i=ee(),s;e[0]!==n?(s=a(w=>{n(Number.parseInt(w.target.value,10))},"g"),e[0]=n,e[1]=s):s=e[1];let u=s,d=`${r}-page-size`,c;e[2]!==i?(c=i("Rows per page"),e[2]=i,e[3]=c):c=e[3];let p;e[4]!==c?(p=(0,G.jsx)("span",{children:c}),e[4]=c,e[5]=p):p=e[5];let g=`${r}-page-size`,f=`${r}-page-size`,m;e[6]!==o?(m=o.map(qr),e[6]=o,e[7]=m):m=e[7];let h;e[8]!==u||e[9]!==g||e[10]!==f||e[11]!==m||e[12]!==l?(h=(0,G.jsx)("select",{className:"h-6 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":g,id:f,onChange:u,value:l,children:m}),e[8]=u,e[9]=g,e[10]=f,e[11]=m,e[12]=l,e[13]=h):h=e[13];let b;return e[14]!==d||e[15]!==p||e[16]!==h?(b=(0,G.jsxs)("label",{className:"flex items-center gap-1.5",htmlFor:d,children:[p,h]}),e[14]=d,e[15]=p,e[16]=h,e[17]=b):b=e[17],b},"ie"),Br=a(t=>{let e=(0,Qe.c)(25),{onJump:n,page:o,pages:r,prefix:l}=t,i=ee(),s;e[0]!==n||e[1]!==r?(s=a(R=>{let y=Number.parseInt(R,10);Number.isNaN(y)||n(Math.min(Math.max(1,y),Math.max(1,r)))},"g"),e[0]=n,e[1]=r,e[2]=s):s=e[2];let u=s,d;e[3]!==u?(d=a(R=>{R.key==="Enter"&&u(R.currentTarget.value)},"f"),e[3]=u,e[4]=d):d=e[4];let c=d,p;e[5]!==u?(p=a(R=>{u(R.currentTarget.value)},"a"),e[5]=u,e[6]=p):p=e[6];let g=p,f;e[7]!==i?(f=i("Page"),e[7]=i,e[8]=f):f=e[8];let m;e[9]!==i?(m=i("Page"),e[9]=i,e[10]=m):m=e[10];let h=`${l}-page-jump`,b=Math.max(1,r),w;e[11]!==g||e[12]!==c||e[13]!==o||e[14]!==m||e[15]!==h||e[16]!==b?(w=(0,G.jsx)("input",{"aria-label":m,className:"h-6 w-12 rounded-md border border-border bg-background px-1 text-center tabular-nums outline-none focus-visible:border-ring","data-testid":h,defaultValue:o,max:b,min:1,onBlur:g,onKeyDown:c,type:"number"},o),e[11]=g,e[12]=c,e[13]=o,e[14]=m,e[15]=h,e[16]=b,e[17]=w):w=e[17];let x;e[18]!==r||e[19]!==i?(x=i("of {pages}",{pages:r}),e[18]=r,e[19]=i,e[20]=x):x=e[20];let C;return e[21]!==f||e[22]!==w||e[23]!==x?(C=(0,G.jsxs)("span",{className:"flex items-center gap-1.5 tabular-nums",children:[f,w,x]}),e[21]=f,e[22]=w,e[23]=x,e[24]=C):C=e[24],C},"de"),Gt=a(({hasNext:t,hasPrevious:e,onJumpToPage:n,onNext:o,onPageSizeChange:r,onPrevious:l,pageSize:i,pageSizeOptions:s=Hr,prefix:u,rangeEnd:d,rangeStart:c,total:p})=>{let g=ee(),f="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",m=i!==void 0&&i>0?Math.max(1,Math.ceil(p/i)):1,h=i!==void 0&&i>0?Math.floor(Math.max(0,c-1)/i)+1:1;return(0,G.jsxs)("div",{className:"flex w-full items-center justify-between gap-3 text-xs text-muted-foreground",children:[(0,G.jsxs)("div",{className:"flex items-center gap-3",children:[i!==void 0&&r!==void 0&&(0,G.jsx)(jr,{onChange:r,options:s,prefix:u,value:i}),(0,G.jsx)("span",{className:"tabular-nums","data-testid":`${u}-page-info`,children:g("{rangeStart}-{rangeEnd} of {total}",{rangeEnd:d,rangeStart:c,total:p})})]}),(0,G.jsxs)("div",{className:"flex items-center gap-3",children:[(0,G.jsx)("button",{className:f,"data-testid":`${u}-prev`,disabled:!e,onClick:l,type:"button",children:g("Previous")}),i!==void 0&&n!==void 0&&(0,G.jsx)(Br,{onJump:n,page:h,pages:m,prefix:u}),(0,G.jsx)("button",{className:f,"data-testid":`${u}-next`,disabled:!t,onClick:o,type:"button",children:g("Next")})]})]})},"Te");function qr(t){return(0,G.jsx)("option",{value:t,children:t},t)}a(qr,"ue");var ho=a(t=>t==null?"\u2205":t===""?"(empty)":typeof t=="object"?JSON.stringify(t):String(t),"D"),Jr=a(t=>{let e=(0,Qe.c)(32),{column:n,onFacetFilter:o,state:r}=t,l=ee(),i;e[0]!==n||e[1]!==o||e[2]!==r.result?.values?(i=a(b=>{let w=Number(b.currentTarget.dataset.index),x=r.result?.values[w];x!==void 0&&o(n,x.value)},"u"),e[0]=n,e[1]=o,e[2]=r.result?.values,e[3]=i):i=e[3];let s=i,u=`db-facet-${n}`,d;e[4]!==n?(d=(0,G.jsx)("span",{className:"font-medium text-foreground",children:n}),e[4]=n,e[5]=d):d=e[5];let c;e[6]!==r.loading||e[7]!==r.result||e[8]!==l?(c=r.loading&&r.result===null&&(0,G.jsx)("span",{className:"text-muted-foreground",children:l("Loading\u2026")}),e[6]=r.loading,e[7]=r.result,e[8]=l,e[9]=c):c=e[9];let p;e[10]!==r.error?(p=r.error!==null&&(0,G.jsx)("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=p):p=e[11];let g;e[12]!==r.result?.values?(g=r.result?.values??[],e[12]=r.result?.values,e[13]=g):g=e[13];let f;if(e[14]!==n||e[15]!==s||e[16]!==g){let b;e[18]!==n||e[19]!==s?(b=a((w,x)=>(0,G.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":x,"data-testid":`db-facet-value-${n}`,onClick:s,type:"button",children:[(0,G.jsx)("span",{className:"truncate",children:ho(w.value)}),(0,G.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:w.count})]},ho(w.value)),"i"),e[18]=n,e[19]=s,e[20]=b):b=e[20],f=g.map(b),e[14]=n,e[15]=s,e[16]=g,e[17]=f}else f=e[17];let m;e[21]!==n||e[22]!==r.result||e[23]!==l?(m=r.result?.truncated===!0&&(0,G.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${n}`,children:l("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=n,e[22]=r.result,e[23]=l,e[24]=m):m=e[24];let h;return e[25]!==u||e[26]!==d||e[27]!==c||e[28]!==p||e[29]!==f||e[30]!==m?(h=(0,G.jsxs)("section",{className:"flex flex-col gap-1","data-testid":u,children:[d,c,p,f,m]}),e[25]=u,e[26]=d,e[27]=c,e[28]=p,e[29]=f,e[30]=m,e[31]=h):h=e[31],h},"fe"),Ht=a(t=>{let e=(0,Qe.c)(44),{columns:n,facets:o,mask:r,onFacetFilter:l,onToggleFacet:i}=t,s=ee(),u;e[0]!==i?(u=a(N=>{let{column:M}=N.currentTarget.dataset;M!==void 0&&i(M)},"o"),e[0]=i,e[1]=u):u=e[1];let d=u,c;e[2]!==r?(c=a(N=>r.enabled&&r.columns.has(N),"l"),e[2]=r,e[3]=c):c=e[3];let p=c,g,f,m,h,b,w,x,C;if(e[4]!==n||e[5]!==o||e[6]!==p||e[7]!==s||e[8]!==d){C=Symbol.for("react.early_return_sentinel");e:{let N;e[17]!==p?(N=a(V=>!p(V),"w"),e[17]=p,e[18]=N):N=e[18];let M=n.filter(N),F;if(e[19]!==o||e[20]!==p?(F=Object.entries(o).filter(V=>{let[I]=V;return!p(I)}),e[19]=o,e[20]=p,e[21]=F):F=e[21],g=F,M.length===0){C=null;break e}w="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",x="db-facets",h="flex flex-col gap-1.5";let k;e[22]!==s?(k=s("Facets"),e[22]=s,e[23]=k):k=e[23],e[24]!==k?(b=(0,G.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:k}),e[24]=k,e[25]=b):b=e[25],f="flex flex-wrap gap-1";let $;e[26]!==o||e[27]!==d?($=a(V=>(0,G.jsx)("button",{"aria-pressed":V in o,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":V,"data-testid":`db-facet-toggle-${V}`,onClick:d,type:"button",children:V},V),"R"),e[26]=o,e[27]=d,e[28]=$):$=e[28],m=M.map($)}e[4]=n,e[5]=o,e[6]=p,e[7]=s,e[8]=d,e[9]=g,e[10]=f,e[11]=m,e[12]=h,e[13]=b,e[14]=w,e[15]=x,e[16]=C}else g=e[9],f=e[10],m=e[11],h=e[12],b=e[13],w=e[14],x=e[15],C=e[16];if(C!==Symbol.for("react.early_return_sentinel"))return C;let R;e[29]!==f||e[30]!==m?(R=(0,G.jsx)("div",{className:f,children:m}),e[29]=f,e[30]=m,e[31]=R):R=e[31];let y;e[32]!==R||e[33]!==h||e[34]!==b?(y=(0,G.jsxs)("div",{className:h,children:[b,R]}),e[32]=R,e[33]=h,e[34]=b,e[35]=y):y=e[35];let _;e[36]!==l||e[37]!==g?(_=g.map(N=>{let[M,F]=N;return(0,G.jsx)(Jr,{column:M,onFacetFilter:l,state:F},M)}),e[36]=l,e[37]=g,e[38]=_):_=e[38];let S;return e[39]!==y||e[40]!==_||e[41]!==w||e[42]!==x?(S=(0,G.jsxs)("aside",{className:w,"data-testid":x,children:[y,_]}),e[39]=y,e[40]=_,e[41]=w,e[42]=x,e[43]=S):S=e[43],S},"Ee");function We(t){let e=(0,Qe.c)(2),n=(0,De.useRef)(t),o;return e[0]!==t?(o=a(()=>{n.current=t},"s"),e[0]=t,e[1]=o):o=e[1],(0,De.useEffect)(o),n}a(We,"me");var jt=a(()=>{let[t,e]=(0,De.useState)({}),n=We(t),o=(0,De.useRef)({}),r=a(async(l,i)=>{let s=(o.current[l]??0)+1;o.current[l]=s,e(u=>l in u?{...u,[l]:{error:null,loading:!0,result:u[l]?.result??null}}:u);try{let u=await i(l);if(o.current[l]!==s)return;e(d=>l in d?{...d,[l]:{error:null,loading:!1,result:u}}:d)}catch(u){if(o.current[l]!==s)return;e(d=>l in d?{...d,[l]:{error:Ct(u),loading:!1,result:null}}:d)}},"r");return{clearFacets:a(()=>{e({})},"clearFacets"),facets:t,facetsRef:n,refetchFacets:a(l=>{for(let i of Object.keys(n.current))le(r(i,l))},"refetchFacets"),toggleFacet:a((l,i)=>{if(l in n.current){e(s=>Object.fromEntries(Object.entries(s).filter(([u])=>u!==l)));return}e(s=>({...s,[l]:{error:null,loading:!0,result:null}})),i!==null&&le(r(l,i))},"toggleFacet")}},"Oe"),Kr=[],Ur=a(()=>{let t=(0,Qe.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:n}=tt(be.maskPolicies,e);return Array.isArray(n?.columns)?n.columns:Kr},"ge"),Bt=a(t=>{let e=(0,Qe.c)(16),{columns:n,selectedTable:o}=t,r=Ur(),[l,i]=(0,De.useState)(!0),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=a(()=>{i(Qr)},"g"),e[0]=s):s=e[0];let u=s,d;if(e[1]!==n||e[2]!==r||e[3]!==o){let h=mo(r,o??"");d=po(h,n),e[1]=n,e[2]=r,e[3]=o,e[4]=d}else d=e[4];let c=d,p;e[5]!==l||e[6]!==r?(p=a((h,b)=>({columns:po(mo(r,h),b),enabled:l}),"a"),e[5]=l,e[6]=r,e[7]=p):p=e[7];let g=p,f;e[8]!==c||e[9]!==l?(f={columns:c,enabled:l},e[8]=c,e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==c||e[12]!==l||e[13]!==g||e[14]!==f?(m={maskColumns:c,maskOn:l,maskView:f,maskViewFor:g,onToggleMask:u},e[11]=c,e[12]=l,e[13]=g,e[14]=f,e[15]=m):m=e[15],m},"Re");function Qr(t){return!t}a(Qr,"he");var vo=34,bo=600,Wr=a(t=>{let e=(0,Qe.c)(21),{item:n,onSelect:o,prefix:r,selected:l,start:i}=t,s;e[0]!==n.name||e[1]!==o?(s=a(()=>{o(n.name)},"g"),e[0]=n.name,e[1]=o,e[2]=s):s=e[2];let u=s,d=`translateY(${String(i)}px)`,c;e[3]!==d?(c={insetInline:0,position:"absolute",top:0,transform:d},e[3]=d,e[4]=c):c=e[4];let p=c,g=l?"bg-accent font-medium text-accent-foreground":"text-foreground",f;e[5]!==g?(f=at("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",g),e[5]=g,e[6]=f):f=e[6];let m=`${r}-table-${n.name}`,h;e[7]!==n.name?(h=(0,G.jsx)("span",{className:"truncate",children:n.name}),e[7]=n.name,e[8]=h):h=e[8];let b;e[9]!==n.rowCount?(b=(0,G.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:n.rowCount}),e[9]=n.rowCount,e[10]=b):b=e[10];let w;e[11]!==u||e[12]!==l||e[13]!==f||e[14]!==m||e[15]!==h||e[16]!==b?(w=(0,G.jsxs)("button",{"aria-pressed":l,className:f,"data-testid":m,onClick:u,type:"button",children:[h,b]}),e[11]=u,e[12]=l,e[13]=f,e[14]=m,e[15]=h,e[16]=b,e[17]=w):w=e[17];let x;return e[18]!==p||e[19]!==w?(x=(0,G.jsx)("li",{style:p,children:w}),e[18]=p,e[19]=w,e[20]=x):x=e[20],x},"pe"),qt=a(({header:t,onReload:e,onSelect:n,prefix:o,reloadLabel:r,selected:l,tables:i})=>{let s=ee(),[u,d]=(0,De.useState)(""),c=(0,De.useRef)(null),p=a(h=>{d(h.target.value)},"a"),g=(0,De.useMemo)(()=>{let h=u.trim().toLowerCase();return h===""?i:i.filter(b=>b.name.toLowerCase().includes(h))},[u,i]),f=Et({count:g.length,estimateSize:a(()=>vo,"estimateSize"),getScrollElement:a(()=>c.current,"getScrollElement"),initialRect:{height:bo,width:240},observeElementRect:a((h,b)=>Tt(h,b,bo),"observeElementRect"),overscan:12}).getVirtualItems(),m={height:g.length*vo};return(0,G.jsxs)("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${o}-table-list`,children:[t,(0,G.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,G.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:s("Tables")}),e!==void 0&&(0,G.jsx)("button",{"aria-label":r??s("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":`${o}-load-tables`,onClick:e,title:r??s("Refresh"),type:"button",children:(0,G.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,G.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,G.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,G.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":`${o}-table-search`,onChange:p,placeholder:s("search table\u2026"),type:"search",value:u})}),(0,G.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${o}-table-list-rows`,ref:c,children:[(0,G.jsx)("li",{"aria-hidden":"true",style:m}),f.map(h=>{let b=g[h.index];return b===void 0?null:(0,G.jsx)(Wr,{item:b,onSelect:n,prefix:o,selected:l===b.name,start:h.start},b.name)})]})]})},"Ae");var K=ye(xt(),1);var P=ye(dt(),1);var v=ye(St(),1);var Ft=ye(dt(),1);function nt(t,e){return typeof t=="function"?t(e):t}a(nt,"functionalUpdate");function Ee(t,e){return n=>{e.setState(o=>({...o,[t]:nt(n,o[t])}))}}a(Ee,"makeStateUpdater");function Qt(t){return t instanceof Function}a(Qt,"isFunction");function Xr(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}a(Xr,"isNumberArray");function Yr(t,e){let n=[],o=a(r=>{r.forEach(l=>{n.push(l);let i=e(l);i!=null&&i.length&&o(i)})},"recurse");return o(t),n}a(Yr,"flattenBy");function A(t,e,n){let o=[],r;return l=>{let i;n.key&&n.debug&&(i=Date.now());let s=t(l);if(!(s.length!==o.length||s.some((c,p)=>o[p]!==c)))return r;o=s;let d;if(n.key&&n.debug&&(d=Date.now()),r=e(...s),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){let c=Math.round((Date.now()-i)*100)/100,p=Math.round((Date.now()-d)*100)/100,g=p/16,f=a((m,h)=>{for(m=String(m);m.length<h;)m=" "+m;return m},"pad");console.info(`%c\u23F1 ${f(p,5)} /${f(c,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return r}}a(A,"memo");function L(t,e,n,o){return{debug:a(()=>{var r;return(r=t?.debugAll)!=null?r:t[e]},"debug"),key:!1,onChange:o}}a(L,"getMemoOptions");function Zr(t,e,n,o){let r=a(()=>{var i;return(i=l.getValue())!=null?i:t.options.renderFallbackValue},"getRenderValue"),l={id:`${e.id}_${n.id}`,row:e,column:n,getValue:a(()=>e.getValue(o),"getValue"),renderValue:r,getContext:A(()=>[t,n,e,l],(i,s,u,d)=>({table:i,column:s,row:u,cell:d,getValue:d.getValue,renderValue:d.renderValue}),L(t.options,"debugCells","cell.getContext"))};return t._features.forEach(i=>{i.createCell==null||i.createCell(l,n,e,t)},{}),l}a(Zr,"createCell");function el(t,e,n,o){var r,l;let s={...t._getDefaultColumnDef(),...e},u=s.accessorKey,d=(r=(l=s.id)!=null?l:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?r:typeof s.header=="string"?s.header:void 0,c;if(s.accessorFn?c=s.accessorFn:u&&(u.includes(".")?c=a(g=>{let f=g;for(let h of u.split(".")){var m;f=(m=f)==null?void 0:m[h]}return f},"accessorFn"):c=a(g=>g[s.accessorKey],"accessorFn")),!d)throw new Error;let p={id:`${String(d)}`,accessorFn:c,parent:o,depth:n,columnDef:s,columns:[],getFlatColumns:A(()=>[!0],()=>{var g;return[p,...(g=p.columns)==null?void 0:g.flatMap(f=>f.getFlatColumns())]},L(t.options,"debugColumns","column.getFlatColumns")),getLeafColumns:A(()=>[t._getOrderColumnsFn()],g=>{var f;if((f=p.columns)!=null&&f.length){let m=p.columns.flatMap(h=>h.getLeafColumns());return g(m)}return[p]},L(t.options,"debugColumns","column.getLeafColumns"))};for(let g of t._features)g.createColumn==null||g.createColumn(p,t);return p}a(el,"createColumn");var Re="debugHeaders";function xo(t,e,n){var o;let l={id:(o=n.id)!=null?o:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:a(()=>{let i=[],s=a(u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(s),i.push(u)},"recurseHeader");return s(l),i},"getLeafHeaders"),getContext:a(()=>({table:t,header:l,column:e}),"getContext")};return t._features.forEach(i=>{i.createHeader==null||i.createHeader(l,t)}),l}a(xo,"createHeader");var tl={createTable:a(t=>{t.getHeaderGroups=A(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,r)=>{var l,i;let s=(l=o?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?l:[],u=(i=r?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?i:[],d=n.filter(p=>!(o!=null&&o.includes(p.id))&&!(r!=null&&r.includes(p.id)));return Jt(e,[...s,...d,...u],t)},L(t.options,Re,"getHeaderGroups")),t.getCenterHeaderGroups=A(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,r)=>(n=n.filter(l=>!(o!=null&&o.includes(l.id))&&!(r!=null&&r.includes(l.id))),Jt(e,n,t,"center")),L(t.options,Re,"getCenterHeaderGroups")),t.getLeftHeaderGroups=A(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var r;let l=(r=o?.map(i=>n.find(s=>s.id===i)).filter(Boolean))!=null?r:[];return Jt(e,l,t,"left")},L(t.options,Re,"getLeftHeaderGroups")),t.getRightHeaderGroups=A(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var r;let l=(r=o?.map(i=>n.find(s=>s.id===i)).filter(Boolean))!=null?r:[];return Jt(e,l,t,"right")},L(t.options,Re,"getRightHeaderGroups")),t.getFooterGroups=A(()=>[t.getHeaderGroups()],e=>[...e].reverse(),L(t.options,Re,"getFooterGroups")),t.getLeftFooterGroups=A(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),L(t.options,Re,"getLeftFooterGroups")),t.getCenterFooterGroups=A(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),L(t.options,Re,"getCenterFooterGroups")),t.getRightFooterGroups=A(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),L(t.options,Re,"getRightFooterGroups")),t.getFlatHeaders=A(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),L(t.options,Re,"getFlatHeaders")),t.getLeftFlatHeaders=A(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),L(t.options,Re,"getLeftFlatHeaders")),t.getCenterFlatHeaders=A(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),L(t.options,Re,"getCenterFlatHeaders")),t.getRightFlatHeaders=A(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),L(t.options,Re,"getRightFlatHeaders")),t.getCenterLeafHeaders=A(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),L(t.options,Re,"getCenterLeafHeaders")),t.getLeftLeafHeaders=A(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),L(t.options,Re,"getLeftLeafHeaders")),t.getRightLeafHeaders=A(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),L(t.options,Re,"getRightLeafHeaders")),t.getLeafHeaders=A(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var r,l,i,s,u,d;return[...(r=(l=e[0])==null?void 0:l.headers)!=null?r:[],...(i=(s=n[0])==null?void 0:s.headers)!=null?i:[],...(u=(d=o[0])==null?void 0:d.headers)!=null?u:[]].map(c=>c.getLeafHeaders()).flat()},L(t.options,Re,"getLeafHeaders"))},"createTable")};function Jt(t,e,n,o){var r,l;let i=0,s=a(function(g,f){f===void 0&&(f=1),i=Math.max(i,f),g.filter(m=>m.getIsVisible()).forEach(m=>{var h;(h=m.columns)!=null&&h.length&&s(m.columns,f+1)},0)},"findMaxDepth");s(t);let u=[],d=a((g,f)=>{let m={depth:f,id:[o,`${f}`].filter(Boolean).join("_"),headers:[]},h=[];g.forEach(b=>{let w=[...h].reverse()[0],x=b.column.depth===m.depth,C,R=!1;if(x&&b.column.parent?C=b.column.parent:(C=b.column,R=!0),w&&w?.column===C)w.subHeaders.push(b);else{let y=xo(n,C,{id:[o,f,C.id,b?.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${h.filter(_=>_.column===C).length}`:void 0,depth:f,index:h.length});y.subHeaders.push(b),h.push(y)}m.headers.push(b),b.headerGroup=m}),u.push(m),f>0&&d(h,f-1)},"createHeaderGroup"),c=e.map((g,f)=>xo(n,g,{depth:i,index:f}));d(c,i-1),u.reverse();let p=a(g=>g.filter(m=>m.column.getIsVisible()).map(m=>{let h=0,b=0,w=[0];m.subHeaders&&m.subHeaders.length?(w=[],p(m.subHeaders).forEach(C=>{let{colSpan:R,rowSpan:y}=C;h+=R,w.push(y)})):h=1;let x=Math.min(...w);return b=b+x,m.colSpan=h,m.rowSpan=b,{colSpan:h,rowSpan:b}}),"recurseHeadersForSpans");return p((r=(l=u[0])==null?void 0:l.headers)!=null?r:[]),u}a(Jt,"buildHeaderGroups");var nl=a((t,e,n,o,r,l,i)=>{let s={id:e,index:o,original:n,depth:r,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:a(u=>{if(s._valuesCache.hasOwnProperty(u))return s._valuesCache[u];let d=t.getColumn(u);if(d!=null&&d.accessorFn)return s._valuesCache[u]=d.accessorFn(s.original,o),s._valuesCache[u]},"getValue"),getUniqueValues:a(u=>{if(s._uniqueValuesCache.hasOwnProperty(u))return s._uniqueValuesCache[u];let d=t.getColumn(u);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(s._uniqueValuesCache[u]=d.columnDef.getUniqueValues(s.original,o),s._uniqueValuesCache[u]):(s._uniqueValuesCache[u]=[s.getValue(u)],s._uniqueValuesCache[u])},"getUniqueValues"),renderValue:a(u=>{var d;return(d=s.getValue(u))!=null?d:t.options.renderFallbackValue},"renderValue"),subRows:l??[],getLeafRows:a(()=>Yr(s.subRows,u=>u.subRows),"getLeafRows"),getParentRow:a(()=>s.parentId?t.getRow(s.parentId,!0):void 0,"getParentRow"),getParentRows:a(()=>{let u=[],d=s;for(;;){let c=d.getParentRow();if(!c)break;u.push(c),d=c}return u.reverse()},"getParentRows"),getAllCells:A(()=>[t.getAllLeafColumns()],u=>u.map(d=>Zr(t,s,d,d.id)),L(t.options,"debugRows","getAllCells")),_getAllCellsByColumnId:A(()=>[s.getAllCells()],u=>u.reduce((d,c)=>(d[c.column.id]=c,d),{}),L(t.options,"debugRows","getAllCellsByColumnId"))};for(let u=0;u<t._features.length;u++){let d=t._features[u];d==null||d.createRow==null||d.createRow(s,t)}return s},"createRow"),ol={createColumn:a((t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}},"createColumn")},Co=a((t,e,n)=>{var o,r;let l=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(l))},"includesString");Co.autoRemove=t=>Oe(t);var yo=a((t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))},"includesStringSensitive");yo.autoRemove=t=>Oe(t);var Ro=a((t,e,n)=>{var o;return((o=t.getValue(e))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()},"equalsString");Ro.autoRemove=t=>Oe(t);var _o=a((t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)},"arrIncludes");_o.autoRemove=t=>Oe(t);var No=a((t,e,n)=>!n.some(o=>{var r;return!((r=t.getValue(e))!=null&&r.includes(o))}),"arrIncludesAll");No.autoRemove=t=>Oe(t)||!(t!=null&&t.length);var Fo=a((t,e,n)=>n.some(o=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(o)}),"arrIncludesSome");Fo.autoRemove=t=>Oe(t)||!(t!=null&&t.length);var ko=a((t,e,n)=>t.getValue(e)===n,"equals");ko.autoRemove=t=>Oe(t);var $o=a((t,e,n)=>t.getValue(e)==n,"weakEquals");$o.autoRemove=t=>Oe(t);var Pn=a((t,e,n)=>{let[o,r]=n,l=t.getValue(e);return l>=o&&l<=r},"inNumberRange");Pn.resolveFilterValue=t=>{let[e,n]=t,o=typeof e!="number"?parseFloat(e):e,r=typeof n!="number"?parseFloat(n):n,l=e===null||Number.isNaN(o)?-1/0:o,i=n===null||Number.isNaN(r)?1/0:r;if(l>i){let s=l;l=i,i=s}return[l,i]};Pn.autoRemove=t=>Oe(t)||Oe(t[0])&&Oe(t[1]);var Xe={includesString:Co,includesStringSensitive:yo,equalsString:Ro,arrIncludes:_o,arrIncludesAll:No,arrIncludesSome:Fo,equals:ko,weakEquals:$o,inNumberRange:Pn};function Oe(t){return t==null||t===""}a(Oe,"testFalsey");var rl={getDefaultColumnDef:a(()=>({filterFn:"auto"}),"getDefaultColumnDef"),getInitialState:a(t=>({columnFilters:[],...t}),"getInitialState"),getDefaultOptions:a(t=>({onColumnFiltersChange:Ee("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),"getDefaultOptions"),createColumn:a((t,e)=>{t.getAutoFilterFn=()=>{let n=e.getCoreRowModel().flatRows[0],o=n?.getValue(t.id);return typeof o=="string"?Xe.includesString:typeof o=="number"?Xe.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Xe.equals:Array.isArray(o)?Xe.arrIncludes:Xe.weakEquals},t.getFilterFn=()=>{var n,o;return Qt(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(o=e.options.filterFns)==null?void 0:o[t.columnDef.filterFn])!=null?n:Xe[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,o,r;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((o=e.options.enableColumnFilters)!=null?o:!0)&&((r=e.options.enableFilters)!=null?r:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(o=>o.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,o;return(n=(o=e.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(o=>{let r=t.getFilterFn(),l=o?.find(c=>c.id===t.id),i=nt(n,l?l.value:void 0);if(So(r,i,t)){var s;return(s=o?.filter(c=>c.id!==t.id))!=null?s:[]}let u={id:t.id,value:i};if(l){var d;return(d=o?.map(c=>c.id===t.id?u:c))!=null?d:[]}return o!=null&&o.length?[...o,u]:[u]})}},"createColumn"),createRow:a((t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},"createRow"),createTable:a(t=>{t.setColumnFilters=e=>{let n=t.getAllLeafColumns(),o=a(r=>{var l;return(l=nt(e,r))==null?void 0:l.filter(i=>{let s=n.find(u=>u.id===i.id);if(s){let u=s.getFilterFn();if(So(u,i.value,s))return!1}return!0})},"updateFn");t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},t.resetColumnFilters=e=>{var n,o;t.setColumnFilters(e?[]:(n=(o=t.initialState)==null?void 0:o.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())},"createTable")};function So(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}a(So,"shouldAutoRemoveFilter");var ll=a((t,e,n)=>n.reduce((o,r)=>{let l=r.getValue(t);return o+(typeof l=="number"?l:0)},0),"sum"),al=a((t,e,n)=>{let o;return n.forEach(r=>{let l=r.getValue(t);l!=null&&(o>l||o===void 0&&l>=l)&&(o=l)}),o},"min"),il=a((t,e,n)=>{let o;return n.forEach(r=>{let l=r.getValue(t);l!=null&&(o<l||o===void 0&&l>=l)&&(o=l)}),o},"max"),sl=a((t,e,n)=>{let o,r;return n.forEach(l=>{let i=l.getValue(t);i!=null&&(o===void 0?i>=i&&(o=r=i):(o>i&&(o=i),r<i&&(r=i)))}),[o,r]},"extent"),ul=a((t,e)=>{let n=0,o=0;if(e.forEach(r=>{let l=r.getValue(t);l!=null&&(l=+l)>=l&&(++n,o+=l)}),n)return o/n},"mean"),dl=a((t,e)=>{if(!e.length)return;let n=e.map(l=>l.getValue(t));if(!Xr(n))return;if(n.length===1)return n[0];let o=Math.floor(n.length/2),r=n.sort((l,i)=>l-i);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},"median"),cl=a((t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),"unique"),gl=a((t,e)=>new Set(e.map(n=>n.getValue(t))).size,"uniqueCount"),fl=a((t,e)=>e.length,"count"),wn={sum:ll,min:al,max:il,extent:sl,mean:ul,median:dl,unique:cl,uniqueCount:gl,count:fl},ml={getDefaultColumnDef:a(()=>({aggregatedCell:a(t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},"aggregatedCell"),aggregationFn:"auto"}),"getDefaultColumnDef"),getInitialState:a(t=>({grouping:[],...t}),"getInitialState"),getDefaultOptions:a(t=>({onGroupingChange:Ee("grouping",t),groupedColumnMode:"reorder"}),"getDefaultOptions"),createColumn:a((t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(o=>o!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,o;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((o=e.options.enableGrouping)!=null?o:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{let n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{let n=e.getCoreRowModel().flatRows[0],o=n?.getValue(t.id);if(typeof o=="number")return wn.sum;if(Object.prototype.toString.call(o)==="[object Date]")return wn.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return Qt(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(o=e.options.aggregationFns)==null?void 0:o[t.columnDef.aggregationFn])!=null?n:wn[t.columnDef.aggregationFn]}},"createColumn"),createTable:a(t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,o;t.setGrouping(e?[]:(n=(o=t.initialState)==null?void 0:o.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},"createTable"),createRow:a((t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];let o=e.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(t._groupingValuesCache[n]=o.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},"createRow"),createCell:a((t,e,n,o)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var r;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}},"createCell")};function pl(t,e,n){if(!(e!=null&&e.length)||!n)return t;let o=t.filter(l=>!e.includes(l.id));return n==="remove"?o:[...e.map(l=>t.find(i=>i.id===l)).filter(Boolean),...o]}a(pl,"orderColumns");var hl={getInitialState:a(t=>({columnOrder:[],...t}),"getInitialState"),getDefaultOptions:a(t=>({onColumnOrderChange:Ee("columnOrder",t)}),"getDefaultOptions"),createColumn:a((t,e)=>{t.getIndex=A(n=>[Nt(e,n)],n=>n.findIndex(o=>o.id===t.id),L(e.options,"debugColumns","getIndex")),t.getIsFirstColumn=n=>{var o;return((o=Nt(e,n)[0])==null?void 0:o.id)===t.id},t.getIsLastColumn=n=>{var o;let r=Nt(e,n);return((o=r[r.length-1])==null?void 0:o.id)===t.id}},"createColumn"),createTable:a(t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=A(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>r=>{let l=[];if(!(e!=null&&e.length))l=r;else{let i=[...e],s=[...r];for(;s.length&&i.length;){let u=i.shift(),d=s.findIndex(c=>c.id===u);d>-1&&l.push(s.splice(d,1)[0])}l=[...l,...s]}return pl(l,n,o)},L(t.options,"debugTable","_getOrderColumnsFn"))},"createTable")},xn=a(()=>({left:[],right:[]}),"getDefaultColumnPinningState"),vl={getInitialState:a(t=>({columnPinning:xn(),...t}),"getInitialState"),getDefaultOptions:a(t=>({onColumnPinningChange:Ee("columnPinning",t)}),"getDefaultOptions"),createColumn:a((t,e)=>{t.pin=n=>{let o=t.getLeafColumns().map(r=>r.id).filter(Boolean);e.setColumnPinning(r=>{var l,i;if(n==="right"){var s,u;return{left:((s=r?.left)!=null?s:[]).filter(p=>!(o!=null&&o.includes(p))),right:[...((u=r?.right)!=null?u:[]).filter(p=>!(o!=null&&o.includes(p))),...o]}}if(n==="left"){var d,c;return{left:[...((d=r?.left)!=null?d:[]).filter(p=>!(o!=null&&o.includes(p))),...o],right:((c=r?.right)!=null?c:[]).filter(p=>!(o!=null&&o.includes(p)))}}return{left:((l=r?.left)!=null?l:[]).filter(p=>!(o!=null&&o.includes(p))),right:((i=r?.right)!=null?i:[]).filter(p=>!(o!=null&&o.includes(p)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var r,l,i;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((l=(i=e.options.enableColumnPinning)!=null?i:e.options.enablePinning)!=null?l:!0)}),t.getIsPinned=()=>{let n=t.getLeafColumns().map(s=>s.id),{left:o,right:r}=e.getState().columnPinning,l=n.some(s=>o?.includes(s)),i=n.some(s=>r?.includes(s));return l?"left":i?"right":!1},t.getPinnedIndex=()=>{var n,o;let r=t.getIsPinned();return r?(n=(o=e.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(t.id))!=null?n:-1:0}},"createColumn"),createRow:a((t,e)=>{t.getCenterVisibleCells=A(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,r)=>{let l=[...o??[],...r??[]];return n.filter(i=>!l.includes(i.column.id))},L(e.options,"debugRows","getCenterVisibleCells")),t.getLeftVisibleCells=A(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,o)=>(o??[]).map(l=>n.find(i=>i.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),L(e.options,"debugRows","getLeftVisibleCells")),t.getRightVisibleCells=A(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(l=>n.find(i=>i.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),L(e.options,"debugRows","getRightVisibleCells"))},"createRow"),createTable:a(t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,o;return t.setColumnPinning(e?xn():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:xn())},t.getIsSomeColumnsPinned=e=>{var n;let o=t.getState().columnPinning;if(!e){var r,l;return!!((r=o.left)!=null&&r.length||(l=o.right)!=null&&l.length)}return!!((n=o[e])!=null&&n.length)},t.getLeftLeafColumns=A(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(r=>r.id===o)).filter(Boolean),L(t.options,"debugColumns","getLeftLeafColumns")),t.getRightLeafColumns=A(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(r=>r.id===o)).filter(Boolean),L(t.options,"debugColumns","getRightLeafColumns")),t.getCenterLeafColumns=A(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o)=>{let r=[...n??[],...o??[]];return e.filter(l=>!r.includes(l.id))},L(t.options,"debugColumns","getCenterLeafColumns"))},"createTable")};function bl(t){return t||(typeof document<"u"?document:null)}a(bl,"safelyAccessDocument");var Kt={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Sn=a(()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),"getDefaultColumnSizingInfoState"),wl={getDefaultColumnDef:a(()=>Kt,"getDefaultColumnDef"),getInitialState:a(t=>({columnSizing:{},columnSizingInfo:Sn(),...t}),"getInitialState"),getDefaultOptions:a(t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ee("columnSizing",t),onColumnSizingInfoChange:Ee("columnSizingInfo",t)}),"getDefaultOptions"),createColumn:a((t,e)=>{t.getSize=()=>{var n,o,r;let l=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Kt.minSize,(o=l??t.columnDef.size)!=null?o:Kt.size),(r=t.columnDef.maxSize)!=null?r:Kt.maxSize)},t.getStart=A(n=>[n,Nt(e,n),e.getState().columnSizing],(n,o)=>o.slice(0,t.getIndex(n)).reduce((r,l)=>r+l.getSize(),0),L(e.options,"debugColumns","getStart")),t.getAfter=A(n=>[n,Nt(e,n),e.getState().columnSizing],(n,o)=>o.slice(t.getIndex(n)+1).reduce((r,l)=>r+l.getSize(),0),L(e.options,"debugColumns","getAfter")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:o,...r}=n;return r})},t.getCanResize=()=>{var n,o;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((o=e.options.enableColumnResizing)!=null?o:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},"createColumn"),createHeader:a((t,e)=>{t.getSize=()=>{let n=0,o=a(r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var l;n+=(l=r.column.getSize())!=null?l:0}},"recurse");return o(t),n},t.getStart=()=>{if(t.index>0){let n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{let o=e.getColumn(t.column.id),r=o?.getCanResize();return l=>{if(!o||!r||(l.persist==null||l.persist(),Cn(l)&&l.touches&&l.touches.length>1))return;let i=t.getSize(),s=t?t.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[o.id,o.getSize()]],u=Cn(l)?Math.round(l.touches[0].clientX):l.clientX,d={},c=a((w,x)=>{typeof x=="number"&&(e.setColumnSizingInfo(C=>{var R,y;let _=e.options.columnResizeDirection==="rtl"?-1:1,S=(x-((R=C?.startOffset)!=null?R:0))*_,N=Math.max(S/((y=C?.startSize)!=null?y:0),-.999999);return C.columnSizingStart.forEach(M=>{let[F,k]=M;d[F]=Math.round(Math.max(k+k*N,0)*100)/100}),{...C,deltaOffset:S,deltaPercentage:N}}),(e.options.columnResizeMode==="onChange"||w==="end")&&e.setColumnSizing(C=>({...C,...d})))},"updateOffset"),p=a(w=>c("move",w),"onMove"),g=a(w=>{c("end",w),e.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},"onEnd"),f=bl(n),m={moveHandler:a(w=>p(w.clientX),"moveHandler"),upHandler:a(w=>{f?.removeEventListener("mousemove",m.moveHandler),f?.removeEventListener("mouseup",m.upHandler),g(w.clientX)},"upHandler")},h={moveHandler:a(w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),p(w.touches[0].clientX),!1),"moveHandler"),upHandler:a(w=>{var x;f?.removeEventListener("touchmove",h.moveHandler),f?.removeEventListener("touchend",h.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),g((x=w.touches[0])==null?void 0:x.clientX)},"upHandler")},b=xl()?{passive:!1}:!1;Cn(l)?(f?.addEventListener("touchmove",h.moveHandler,b),f?.addEventListener("touchend",h.upHandler,b)):(f?.addEventListener("mousemove",m.moveHandler,b),f?.addEventListener("mouseup",m.upHandler,b)),e.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:o.id}))}}},"createHeader"),createTable:a(t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Sn():(n=t.initialState.columnSizingInfo)!=null?n:Sn())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?e:0}},"createTable")},Ut=null;function xl(){if(typeof Ut=="boolean")return Ut;let t=!1;try{let e={get passive(){return t=!0,!1}},n=a(()=>{},"noop");window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Ut=t,Ut}a(xl,"passiveEventSupported");function Cn(t){return t.type==="touchstart"}a(Cn,"isTouchStartEvent");var Sl={getInitialState:a(t=>({columnVisibility:{},...t}),"getInitialState"),getDefaultOptions:a(t=>({onColumnVisibilityChange:Ee("columnVisibility",t)}),"getDefaultOptions"),createColumn:a((t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;let r=t.columns;return(n=r.length?r.some(l=>l.getIsVisible()):(o=e.getState().columnVisibility)==null?void 0:o[t.id])!=null?n:!0},t.getCanHide=()=>{var n,o;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((o=e.options.enableHiding)!=null?o:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},"createColumn"),createRow:a((t,e)=>{t._getAllVisibleCells=A(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),L(e.options,"debugRows","_getAllVisibleCells")),t.getVisibleCells=A(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],L(e.options,"debugRows","getVisibleCells"))},"createRow"),createTable:a(t=>{let e=a((n,o)=>A(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),L(t.options,"debugColumns",n)),"makeVisibleColumnsMethod");t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var o;t.setColumnVisibility(n?{}:(o=t.initialState.columnVisibility)!=null?o:{})},t.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((r,l)=>({...r,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;t.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}},"createTable")};function Nt(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}a(Nt,"_getVisibleLeafColumns");var Cl={createTable:a(t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}},"createTable")},yl={getInitialState:a(t=>({globalFilter:void 0,...t}),"getInitialState"),getDefaultOptions:a(t=>({onGlobalFilterChange:Ee("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:a(e=>{var n;let o=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"},"getColumnCanGlobalFilter")}),"getDefaultOptions"),createColumn:a((t,e)=>{t.getCanGlobalFilter=()=>{var n,o,r,l;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=e.options.enableGlobalFilter)!=null?o:!0)&&((r=e.options.enableFilters)!=null?r:!0)&&((l=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?l:!0)&&!!t.accessorFn}},"createColumn"),createTable:a(t=>{t.getGlobalAutoFilterFn=()=>Xe.includesString,t.getGlobalFilterFn=()=>{var e,n;let{globalFilterFn:o}=t.options;return Qt(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:Xe[o]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}},"createTable")},Rl={getInitialState:a(t=>({expanded:{},...t}),"getInitialState"),getDefaultOptions:a(t=>({onExpandedChange:Ee("expanded",t),paginateExpandedRows:!0}),"getDefaultOptions"),createTable:a(t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var o,r;if(!e){t._queue(()=>{e=!0});return}if((o=(r=t.options.autoResetAll)!=null?r:t.options.autoResetExpanded)!=null?o:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=o=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(o),t.toggleAllRowsExpanded=o=>{o??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=o=>{var r,l;t.setExpanded(o?{}:(r=(l=t.initialState)==null?void 0:l.expanded)!=null?r:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{let o=t.getState().expanded;return o===!0||Object.values(o).some(Boolean)},t.getIsAllRowsExpanded=()=>{let o=t.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||t.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},t.getExpandedDepth=()=>{let o=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(l=>{let i=l.split(".");o=Math.max(o,i.length)}),o},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},"createTable"),createRow:a((t,e)=>{t.toggleExpanded=n=>{e.setExpanded(o=>{var r;let l=o===!0?!0:!!(o!=null&&o[t.id]),i={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(s=>{i[s]=!0}):i=o,n=(r=n)!=null?r:!l,!l&&n)return{...i,[t.id]:!0};if(l&&!n){let{[t.id]:s,...u}=i;return u}return o})},t.getIsExpanded=()=>{var n;let o=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:o===!0||o?.[t.id])},t.getCanExpand=()=>{var n,o,r;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((o=e.options.enableExpanding)!=null?o:!0)&&!!((r=t.subRows)!=null&&r.length)},t.getIsAllParentsExpanded=()=>{let n=!0,o=t;for(;n&&o.parentId;)o=e.getRow(o.parentId,!0),n=o.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{let n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}},"createRow")},Nn=0,Fn=10,yn=a(()=>({pageIndex:Nn,pageSize:Fn}),"getDefaultPaginationState"),_l={getInitialState:a(t=>({...t,pagination:{...yn(),...t?.pagination}}),"getInitialState"),getDefaultOptions:a(t=>({onPaginationChange:Ee("pagination",t)}),"getDefaultOptions"),createTable:a(t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var o,r;if(!e){t._queue(()=>{e=!0});return}if((o=(r=t.options.autoResetAll)!=null?r:t.options.autoResetPageIndex)!=null?o:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=o=>{let r=a(l=>nt(o,l),"safeUpdater");return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(r)},t.resetPagination=o=>{var r;t.setPagination(o?yn():(r=t.initialState.pagination)!=null?r:yn())},t.setPageIndex=o=>{t.setPagination(r=>{let l=nt(o,r.pageIndex),i=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return l=Math.max(0,Math.min(l,i)),{...r,pageIndex:l}})},t.resetPageIndex=o=>{var r,l;t.setPageIndex(o?Nn:(r=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?r:Nn)},t.resetPageSize=o=>{var r,l;t.setPageSize(o?Fn:(r=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?r:Fn)},t.setPageSize=o=>{t.setPagination(r=>{let l=Math.max(1,nt(o,r.pageSize)),i=r.pageSize*r.pageIndex,s=Math.floor(i/l);return{...r,pageIndex:s,pageSize:l}})},t.setPageCount=o=>t.setPagination(r=>{var l;let i=nt(o,(l=t.options.pageCount)!=null?l:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...r,pageCount:i}}),t.getPageOptions=A(()=>[t.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((l,i)=>i)),r},L(t.options,"debugTable","getPageOptions")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{let{pageIndex:o}=t.getState().pagination,r=t.getPageCount();return r===-1?!0:r===0?!1:o<r-1},t.previousPage=()=>t.setPageIndex(o=>o-1),t.nextPage=()=>t.setPageIndex(o=>o+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var o;return(o=t.options.pageCount)!=null?o:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var o;return(o=t.options.rowCount)!=null?o:t.getPrePaginationRowModel().rows.length}},"createTable")},Rn=a(()=>({top:[],bottom:[]}),"getDefaultRowPinningState"),Nl={getInitialState:a(t=>({rowPinning:Rn(),...t}),"getInitialState"),getDefaultOptions:a(t=>({onRowPinningChange:Ee("rowPinning",t)}),"getDefaultOptions"),createRow:a((t,e)=>{t.pin=(n,o,r)=>{let l=o?t.getLeafRows().map(u=>{let{id:d}=u;return d}):[],i=r?t.getParentRows().map(u=>{let{id:d}=u;return d}):[],s=new Set([...i,t.id,...l]);e.setRowPinning(u=>{var d,c;if(n==="bottom"){var p,g;return{top:((p=u?.top)!=null?p:[]).filter(h=>!(s!=null&&s.has(h))),bottom:[...((g=u?.bottom)!=null?g:[]).filter(h=>!(s!=null&&s.has(h))),...Array.from(s)]}}if(n==="top"){var f,m;return{top:[...((f=u?.top)!=null?f:[]).filter(h=>!(s!=null&&s.has(h))),...Array.from(s)],bottom:((m=u?.bottom)!=null?m:[]).filter(h=>!(s!=null&&s.has(h)))}}return{top:((d=u?.top)!=null?d:[]).filter(h=>!(s!=null&&s.has(h))),bottom:((c=u?.bottom)!=null?c:[]).filter(h=>!(s!=null&&s.has(h)))}})},t.getCanPin=()=>{var n;let{enableRowPinning:o,enablePinning:r}=e.options;return typeof o=="function"?o(t):(n=o??r)!=null?n:!0},t.getIsPinned=()=>{let n=[t.id],{top:o,bottom:r}=e.getState().rowPinning,l=n.some(s=>o?.includes(s)),i=n.some(s=>r?.includes(s));return l?"top":i?"bottom":!1},t.getPinnedIndex=()=>{var n,o;let r=t.getIsPinned();if(!r)return-1;let l=(n=r==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(i=>{let{id:s}=i;return s});return(o=l?.indexOf(t.id))!=null?o:-1}},"createRow"),createTable:a(t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?Rn():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:Rn())},t.getIsSomeRowsPinned=e=>{var n;let o=t.getState().rowPinning;if(!e){var r,l;return!!((r=o.top)!=null&&r.length||(l=o.bottom)!=null&&l.length)}return!!((n=o[e])!=null&&n.length)},t._getPinnedRows=(e,n,o)=>{var r;return((r=t.options.keepPinnedRows)==null||r?(n??[]).map(i=>{let s=t.getRow(i,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(i=>e.find(s=>s.id===i))).filter(Boolean).map(i=>({...i,position:o}))},t.getTopRows=A(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),L(t.options,"debugRows","getTopRows")),t.getBottomRows=A(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),L(t.options,"debugRows","getBottomRows")),t.getCenterRows=A(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,o)=>{let r=new Set([...n??[],...o??[]]);return e.filter(l=>!r.has(l.id))},L(t.options,"debugRows","getCenterRows"))},"createTable")},Fl={getInitialState:a(t=>({rowSelection:{},...t}),"getInitialState"),getDefaultOptions:a(t=>({onRowSelectionChange:Ee("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),"getDefaultOptions"),createTable:a(t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();let o={...n},r=t.getPreGroupedRowModel().flatRows;return e?r.forEach(l=>{l.getCanSelect()&&(o[l.id]=!0)}):r.forEach(l=>{delete o[l.id]}),o})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{let o=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),r={...n};return t.getRowModel().rows.forEach(l=>{kn(r,l.id,o,!0,t)}),r}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=A(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?_n(t,n):{rows:[],flatRows:[],rowsById:{}},L(t.options,"debugTable","getSelectedRowModel")),t.getFilteredSelectedRowModel=A(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?_n(t,n):{rows:[],flatRows:[],rowsById:{}},L(t.options,"debugTable","getFilteredSelectedRowModel")),t.getGroupedSelectedRowModel=A(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?_n(t,n):{rows:[],flatRows:[],rowsById:{}},L(t.options,"debugTable","getGroupedSelectedRowModel")),t.getIsAllRowsSelected=()=>{let e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState(),o=!!(e.length&&Object.keys(n).length);return o&&e.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},t.getIsAllPageRowsSelected=()=>{let e=t.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=t.getState(),o=!!e.length;return o&&e.some(r=>!n[r.id])&&(o=!1),o},t.getIsSomeRowsSelected=()=>{var e;let n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{let e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},"createTable"),createRow:a((t,e)=>{t.toggleSelected=(n,o)=>{let r=t.getIsSelected();e.setRowSelection(l=>{var i;if(n=typeof n<"u"?n:!r,t.getCanSelect()&&r===n)return l;let s={...l};return kn(s,t.id,n,(i=o?.selectChildren)!=null?i:!0,e),s})},t.getIsSelected=()=>{let{rowSelection:n}=e.getState();return Vn(t,n)},t.getIsSomeSelected=()=>{let{rowSelection:n}=e.getState();return $n(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=e.getState();return $n(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{let n=t.getCanSelect();return o=>{var r;n&&t.toggleSelected((r=o.target)==null?void 0:r.checked)}}},"createRow")},kn=a((t,e,n,o,r)=>{var l;let i=r.getRow(e,!0);n?(i.getCanMultiSelect()||Object.keys(t).forEach(s=>delete t[s]),i.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(l=i.subRows)!=null&&l.length&&i.getCanSelectSubRows()&&i.subRows.forEach(s=>kn(t,s.id,n,o,r))},"mutateRowIsSelected");function _n(t,e){let n=t.getState().rowSelection,o=[],r={},l=a(function(i,s){return i.map(u=>{var d;let c=Vn(u,n);if(c&&(o.push(u),r[u.id]=u),(d=u.subRows)!=null&&d.length&&(u={...u,subRows:l(u.subRows)}),c)return u}).filter(Boolean)},"recurseRows");return{rows:l(e.rows),flatRows:o,rowsById:r}}a(_n,"selectRowsFn");function Vn(t,e){var n;return(n=e[t.id])!=null?n:!1}a(Vn,"isRowSelected");function $n(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let r=!0,l=!1;return t.subRows.forEach(i=>{if(!(l&&!r)&&(i.getCanSelect()&&(Vn(i,e)?l=!0:r=!1),i.subRows&&i.subRows.length)){let s=$n(i,e);s==="all"?l=!0:(s==="some"&&(l=!0),r=!1)}}),r?"all":l?"some":!1}a($n,"isSubRowSelected");var Mn=/([0-9]+)/gm,kl=a((t,e,n)=>Mo(ot(t.getValue(n)).toLowerCase(),ot(e.getValue(n)).toLowerCase()),"alphanumeric"),$l=a((t,e,n)=>Mo(ot(t.getValue(n)),ot(e.getValue(n))),"alphanumericCaseSensitive"),Ml=a((t,e,n)=>In(ot(t.getValue(n)).toLowerCase(),ot(e.getValue(n)).toLowerCase()),"text"),Pl=a((t,e,n)=>In(ot(t.getValue(n)),ot(e.getValue(n))),"textCaseSensitive"),Vl=a((t,e,n)=>{let o=t.getValue(n),r=e.getValue(n);return o>r?1:o<r?-1:0},"datetime"),Il=a((t,e,n)=>In(t.getValue(n),e.getValue(n)),"basic");function In(t,e){return t===e?0:t>e?1:-1}a(In,"compareBasic");function ot(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}a(ot,"toString");function Mo(t,e){let n=t.split(Mn).filter(Boolean),o=e.split(Mn).filter(Boolean);for(;n.length&&o.length;){let r=n.shift(),l=o.shift(),i=parseInt(r,10),s=parseInt(l,10),u=[i,s].sort();if(isNaN(u[0])){if(r>l)return 1;if(l>r)return-1;continue}if(isNaN(u[1]))return isNaN(i)?-1:1;if(i>s)return 1;if(s>i)return-1}return n.length-o.length}a(Mo,"compareAlphanumeric");var _t={alphanumeric:kl,alphanumericCaseSensitive:$l,text:Ml,textCaseSensitive:Pl,datetime:Vl,basic:Il},El={getInitialState:a(t=>({sorting:[],...t}),"getInitialState"),getDefaultColumnDef:a(()=>({sortingFn:"auto",sortUndefined:1}),"getDefaultColumnDef"),getDefaultOptions:a(t=>({onSortingChange:Ee("sorting",t),isMultiSortEvent:a(e=>e.shiftKey,"isMultiSortEvent")}),"getDefaultOptions"),createColumn:a((t,e)=>{t.getAutoSortingFn=()=>{let n=e.getFilteredRowModel().flatRows.slice(10),o=!1;for(let r of n){let l=r?.getValue(t.id);if(Object.prototype.toString.call(l)==="[object Date]")return _t.datetime;if(typeof l=="string"&&(o=!0,l.split(Mn).length>1))return _t.alphanumeric}return o?_t.text:_t.basic},t.getAutoSortDir=()=>{let n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,o;if(!t)throw new Error;return Qt(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(o=e.options.sortingFns)==null?void 0:o[t.columnDef.sortingFn])!=null?n:_t[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{let r=t.getNextSortingOrder(),l=typeof n<"u"&&n!==null;e.setSorting(i=>{let s=i?.find(f=>f.id===t.id),u=i?.findIndex(f=>f.id===t.id),d=[],c,p=l?n:r==="desc";if(i!=null&&i.length&&t.getCanMultiSort()&&o?s?c="toggle":c="add":i!=null&&i.length&&u!==i.length-1?c="replace":s?c="toggle":c="replace",c==="toggle"&&(l||r||(c="remove")),c==="add"){var g;d=[...i,{id:t.id,desc:p}],d.splice(0,d.length-((g=e.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else c==="toggle"?d=i.map(f=>f.id===t.id?{...f,desc:p}:f):c==="remove"?d=i.filter(f=>f.id!==t.id):d=[{id:t.id,desc:p}];return d})},t.getFirstSortDir=()=>{var n,o;return((n=(o=t.columnDef.sortDescFirst)!=null?o:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var o,r;let l=t.getFirstSortDir(),i=t.getIsSorted();return i?i!==l&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(r=e.options.enableMultiRemove)!=null)||r)?!1:i==="desc"?"asc":"desc":l},t.getCanSort=()=>{var n,o;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((o=e.options.enableSorting)!=null?o:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,o;return(n=(o=t.columnDef.enableMultiSort)!=null?o:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;let o=(n=e.getState().sorting)==null?void 0:n.find(r=>r.id===t.id);return o?o.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,o;return(n=(o=e.getState().sorting)==null?void 0:o.findIndex(r=>r.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==t.id):[])},t.getToggleSortingHandler=()=>{let n=t.getCanSort();return o=>{n&&(o.persist==null||o.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(o):!1))}}},"createColumn"),createTable:a(t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,o;t.setSorting(e?[]:(n=(o=t.initialState)==null?void 0:o.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())},"createTable")},Tl=[tl,Sl,hl,vl,ol,rl,Cl,yl,El,ml,Rl,_l,Nl,Fl,wl];function Po(t){var e,n;let o=[...Tl,...(e=t._features)!=null?e:[]],r={_features:o},l=r._features.reduce((g,f)=>Object.assign(g,f.getDefaultOptions==null?void 0:f.getDefaultOptions(r)),{}),i=a(g=>r.options.mergeOptions?r.options.mergeOptions(l,g):{...l,...g},"mergeOptions"),u={...{},...(n=t.initialState)!=null?n:{}};r._features.forEach(g=>{var f;u=(f=g.getInitialState==null?void 0:g.getInitialState(u))!=null?f:u});let d=[],c=!1,p={_features:o,options:{...l,...t},initialState:u,_queue:a(g=>{d.push(g),c||(c=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();c=!1}).catch(f=>setTimeout(()=>{throw f})))},"_queue"),reset:a(()=>{r.setState(r.initialState)},"reset"),setOptions:a(g=>{let f=nt(g,r.options);r.options=i(f)},"setOptions"),getState:a(()=>r.options.state,"getState"),setState:a(g=>{r.options.onStateChange==null||r.options.onStateChange(g)},"setState"),_getRowId:a((g,f,m)=>{var h;return(h=r.options.getRowId==null?void 0:r.options.getRowId(g,f,m))!=null?h:`${m?[m.id,f].join("."):f}`},"_getRowId"),getCoreRowModel:a(()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),"getCoreRowModel"),getRowModel:a(()=>r.getPaginationRowModel(),"getRowModel"),getRow:a((g,f)=>{let m=(f?r.getPrePaginationRowModel():r.getRowModel()).rowsById[g];if(!m&&(m=r.getCoreRowModel().rowsById[g],!m))throw new Error;return m},"getRow"),_getDefaultColumnDef:A(()=>[r.options.defaultColumn],g=>{var f;return g=(f=g)!=null?f:{},{header:a(m=>{let h=m.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},"header"),cell:a(m=>{var h,b;return(h=(b=m.renderValue())==null||b.toString==null?void 0:b.toString())!=null?h:null},"cell"),...r._features.reduce((m,h)=>Object.assign(m,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...g}},L(t,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:a(()=>r.options.columns,"_getColumnDefs"),getAllColumns:A(()=>[r._getColumnDefs()],g=>{let f=a(function(m,h,b){return b===void 0&&(b=0),m.map(w=>{let x=el(r,w,b,h),C=w;return x.columns=C.columns?f(C.columns,x,b+1):[],x})},"recurseColumns");return f(g)},L(t,"debugColumns","getAllColumns")),getAllFlatColumns:A(()=>[r.getAllColumns()],g=>g.flatMap(f=>f.getFlatColumns()),L(t,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:A(()=>[r.getAllFlatColumns()],g=>g.reduce((f,m)=>(f[m.id]=m,f),{}),L(t,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:A(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(g,f)=>{let m=g.flatMap(h=>h.getLeafColumns());return f(m)},L(t,"debugColumns","getAllLeafColumns")),getColumn:a(g=>r._getAllFlatColumnsById()[g],"getColumn")};Object.assign(r,p);for(let g=0;g<r._features.length;g++){let f=r._features[g];f==null||f.createTable==null||f.createTable(r)}return r}a(Po,"createTable");function Vo(){return t=>A(()=>[t.options.data],e=>{let n={rows:[],flatRows:[],rowsById:{}},o=a(function(r,l,i){l===void 0&&(l=0);let s=[];for(let d=0;d<r.length;d++){let c=nl(t,t._getRowId(r[d],d,i),r[d],d,l,void 0,i?.id);if(n.flatRows.push(c),n.rowsById[c.id]=c,s.push(c),t.options.getSubRows){var u;c.originalSubRows=t.options.getSubRows(r[d],d),(u=c.originalSubRows)!=null&&u.length&&(c.subRows=o(c.originalSubRows,l+1,c))}}return s},"accessRows");return n.rows=o(e),n},L(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}a(Vo,"getCoreRowModel");function Io(){return t=>A(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;let o=t.getState().sorting,r=[],l=o.filter(u=>{var d;return(d=t.getColumn(u.id))==null?void 0:d.getCanSort()}),i={};l.forEach(u=>{let d=t.getColumn(u.id);d&&(i[u.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});let s=a(u=>{let d=u.map(c=>({...c}));return d.sort((c,p)=>{for(let f=0;f<l.length;f+=1){var g;let m=l[f],h=i[m.id],b=h.sortUndefined,w=(g=m?.desc)!=null?g:!1,x=0;if(b){let C=c.getValue(m.id),R=p.getValue(m.id),y=C===void 0,_=R===void 0;if(y||_){if(b==="first")return y?-1:1;if(b==="last")return y?1:-1;x=y&&_?0:y?b:-b}}if(x===0&&(x=h.sortingFn(c,p,m.id)),x!==0)return w&&(x*=-1),h.invertSorting&&(x*=-1),x}return c.index-p.index}),d.forEach(c=>{var p;r.push(c),(p=c.subRows)!=null&&p.length&&(c.subRows=s(c.subRows))}),d},"sortData");return{rows:s(n.rows),flatRows:r,rowsById:n.rowsById}},L(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}a(Io,"getSortedRowModel");function Eo(t,e){return t?Dl(t)?Ft.createElement(t,e):t:null}a(Eo,"flexRender");function Dl(t){return Ol(t)||typeof t=="function"||Al(t)}a(Dl,"isReactComponent");function Ol(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}a(Ol,"isClassComponent");function Al(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}a(Al,"isExoticComponent");function To(t){let e={state:{},onStateChange:a(()=>{},"onStateChange"),renderFallbackValue:null,...t},[n]=Ft.useState(()=>({current:Po(e)})),[o,r]=Ft.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...t,state:{...o,...t.state},onStateChange:a(i=>{r(i),t.onStateChange==null||t.onStateChange(i)},"onStateChange")})),n.current}a(To,"useReactTable");var Do=ye(xt(),1),Oo=ye(dt(),1),Se=ye(St(),1);var Ll=[{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"}],zl=a(t=>{let e=t.trim(),n=Number(e);return e!==""&&Number.isFinite(n)&&String(n)===e?n:t},"K"),Ge=a(t=>t.filter(e=>e.column!=="").map(e=>({column:e.column,operator:e.operator,value:e.operator==="contains"?e.value:zl(e.value)})),"I"),Ao=a(t=>{let e=(0,Do.c)(44),{columns:n,filters:o,onAskAi:r,onFiltersChange:l,onSearchChange:i,search:s}=t,[u,d]=(0,Oo.useState)(""),c;e[0]!==n[0]||e[1]!==o||e[2]!==l?(c=a(()=>{l([...o,{column:n[0]??"",operator:"eq",value:""}])},"N"),e[0]=n[0],e[1]=o,e[2]=l,e[3]=c):c=e[3];let p=c,g;e[4]!==o||e[5]!==l?(g=a(F=>{let k=Number(F.currentTarget.dataset.index);l(o.filter(($,V)=>V!==k))},"T"),e[4]=o,e[5]=l,e[6]=g):g=e[6];let f=g,m;e[7]!==o||e[8]!==l?(m=a(F=>{let k=Number(F.currentTarget.dataset.index),$=F.currentTarget.value;l(o.map((V,I)=>I===k?{...V,column:$}:V))},"S"),e[7]=o,e[8]=l,e[9]=m):m=e[9];let h=m,b;e[10]!==o||e[11]!==l?(b=a(F=>{let k=Number(F.currentTarget.dataset.index),$=F.currentTarget.value;l(o.map((V,I)=>I===k?{...V,operator:$}:V))},"k"),e[10]=o,e[11]=l,e[12]=b):b=e[12];let w=b,x;e[13]!==o||e[14]!==l?(x=a(F=>{let k=Number(F.currentTarget.dataset.index),$=F.currentTarget.value;l(o.map((V,I)=>I===k?{...V,value:$}:V))},"w"),e[13]=o,e[14]=l,e[15]=x):x=e[15];let C=x,R;e[16]!==i||e[17]!==s?(R=(0,Se.jsx)("input",{"aria-label":"Search rows","data-testid":"db-filter",onChange:i,placeholder:"search table\u2026",value:s}),e[16]=i,e[17]=s,e[18]=R):R=e[18];let y;e[19]!==p?(y=(0,Se.jsx)("button",{"data-testid":"db-add-filter",onClick:p,type:"button",children:"Add filter"}),e[19]=p,e[20]=y):y=e[20];let _;e[21]!==u||e[22]!==r?(_=r!==void 0&&(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)("input",{"aria-label":"Describe a filter","data-testid":"db-ai-prompt",onChange:a(F=>{d(F.target.value)},"onChange"),onKeyDown:a(F=>{F.key==="Enter"&&u.trim()!==""&&(F.preventDefault(),r(u.trim()))},"onKeyDown"),placeholder:"describe a filter\u2026",value:u}),(0,Se.jsx)("button",{"data-testid":"db-ai-filter",disabled:u.trim()==="",onClick:a(()=>{r(u.trim())},"onClick"),type:"button",children:"Suggest"})]}),e[21]=u,e[22]=r,e[23]=_):_=e[23];let S;e[24]!==R||e[25]!==y||e[26]!==_?(S=(0,Se.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[R,y,_]}),e[24]=R,e[25]=y,e[26]=_,e[27]=S):S=e[27];let N;if(e[28]!==h||e[29]!==w||e[30]!==C||e[31]!==n||e[32]!==o||e[33]!==f){let F;e[35]!==h||e[36]!==w||e[37]!==C||e[38]!==n||e[39]!==f?(F=a((k,$)=>(0,Se.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"db-filter-row",children:[(0,Se.jsx)("select",{"aria-label":"Filter column","data-index":$,"data-testid":"db-filter-column",onChange:h,value:k.column,children:n.map(Gl)}),(0,Se.jsx)("select",{"aria-label":"Filter operator","data-index":$,"data-testid":"db-filter-operator",onChange:w,value:k.operator,children:Ll.map(Hl)}),(0,Se.jsx)("input",{"aria-label":"Filter value","data-index":$,"data-testid":"db-filter-value",onChange:C,placeholder:"value",value:k.value}),(0,Se.jsx)("button",{"aria-label":"Remove filter","data-index":$,"data-testid":"db-filter-remove",onClick:f,type:"button",children:"\u2715"})]},$),"t"),e[35]=h,e[36]=w,e[37]=C,e[38]=n,e[39]=f,e[40]=F):F=e[40],N=o.map(F),e[28]=h,e[29]=w,e[30]=C,e[31]=n,e[32]=o,e[33]=f,e[34]=N}else N=e[34];let M;return e[41]!==N||e[42]!==S?(M=(0,Se.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"db-filters",children:[S,N]}),e[41]=N,e[42]=S,e[43]=M):M=e[43],M},"J");function Gl(t){return(0,Se.jsx)("option",{value:t,children:t},t)}a(Gl,"$");function Hl(t){return(0,Se.jsx)("option",{value:t.value,children:t.label},t.value)}a(Hl,"z");var jl=a(t=>({tables:Object.entries(t).map(([e,n])=>({fields:n.map(o=>o.name),indexes:[],name:e,relations:n.filter(o=>o.ref!==void 0).map(o=>({field:o.name,kind:"one",name:o.name,references:o.ref,table:e}))}))}),"lo"),Bl=a(t=>{let e=new Map,n=new Set;for(let o of t.tables)for(let r of o.relations){if(r.kind!=="one"||r.onDelete==="set null")continue;let l=r.references,i=`${l}\0${o.name}\0${r.field}`;if(n.has(i))continue;n.add(i);let s=e.get(l)??[];s.push({...r,table:o.name}),e.set(l,s)}return e},"ro"),ql=a((t,e)=>{let n=[],o=[t];for(;o.length>0;){let r=o.shift();if(r===void 0)break;e(r)&&n.push(r);for(let l of r.children)o.push(l)}return n},"ao"),Lo=a((t,e)=>{let n=[];for(let[o,r]of Object.entries(e))for(let l of r)l.ref===t&&n.push({column:l.name,table:o});return n.sort((o,r)=>o.table.localeCompare(r.table)||o.column.localeCompare(r.column)),n},"Bt"),An=a(t=>`${t.table}.${t.column}`,"Dt"),Jl=a(t=>{let e=(0,K.c)(111),{columns:n,onApply:o,onClose:r,shardKey:l,table:i,total:s,uniqueColumns:u}=t,d=ee(),[c,p]=(0,P.useState)(n[0]??""),[g,f]=(0,P.useState)(""),m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=a(re=>{p(re.target.value)},"f"),e[0]=m):m=e[0];let h=m,b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=a(re=>{f(re.target.value)},"h"),e[1]=b):b=e[1];let w=b,x;e[2]!==g?(x=g.trim(),e[2]=g,e[3]=x):x=e[3];let C=x==="",R,y;if(e[4]!==C||e[5]!==d||e[6]!==g){if(!C)try{y=Dt(JSON.parse(g))}catch(re){R=d("Invalid JSON: {message}",{message:re.message})}e[4]=C,e[5]=d,e[6]=g,e[7]=R,e[8]=y}else R=e[7],y=e[8];let _;e[9]!==c||e[10]!==s||e[11]!==u?(_=u.has(c)&&s>1,e[9]=c,e[10]=s,e[11]=u,e[12]=_):_=e[12];let S=_,N=c!==""&&!C&&R===void 0&&!S,M;e[13]!==N||e[14]!==c||e[15]!==o||e[16]!==r||e[17]!==y?(M=a(()=>{N&&(o({[c]:y}),r())},"k"),e[13]=N,e[14]=c,e[15]=o,e[16]=r,e[17]=y,e[18]=M):M=e[18];let F=M,k;e[19]!==d?(k=d("Set a column on matching rows"),e[19]=d,e[20]=k):k=e[20];let $;e[21]!==d?($=d("Set a column on matching rows"),e[21]=d,e[22]=$):$=e[22];let V;e[23]!==$?(V=(0,v.jsx)("h3",{className:"text-base text-foreground","data-testid":"bulk-patch-title",children:$}),e[23]=$,e[24]=V):V=e[24];let I;e[25]!==d||e[26]!==i||e[27]!==s?(I=d("Writes {total} rows of {table} through the schema-aware writer \u2014 validators and indexes apply, exactly like a mutation.",{table:i,total:s.toString()}),e[25]=d,e[26]=i,e[27]=s,e[28]=I):I=e[28];let T;e[29]!==I?(T=(0,v.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-desc",children:I}),e[29]=I,e[30]=T):T=e[30];let E;e[31]!==l||e[32]!==d?(E=l===""?d("Shard: root"):d("Shard: {shardKey} \u2014 rows in other shards are not touched.",{shardKey:l}),e[31]=l,e[32]=d,e[33]=E):E=e[33];let H;e[34]!==E?(H=(0,v.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-shard",children:E}),e[34]=E,e[35]=H):H=e[35];let J;e[36]!==T||e[37]!==H||e[38]!==V?(J=(0,v.jsxs)("div",{className:"flex flex-col gap-0.5",children:[V,T,H]}),e[36]=T,e[37]=H,e[38]=V,e[39]=J):J=e[39];let O;e[40]!==d?(O=d("Close"),e[40]=d,e[41]=O):O=e[41];let q;e[42]!==r||e[43]!==O?(q=(0,v.jsx)(Mt,{"data-testid":"bulk-patch-close",onClick:r,size:"xs",variant:"ghost",children:O}),e[42]=r,e[43]=O,e[44]=q):q=e[44];let Y;e[45]!==J||e[46]!==q?(Y=(0,v.jsxs)("div",{className:"flex items-start justify-between",children:[J,q]}),e[45]=J,e[46]=q,e[47]=Y):Y=e[47];let U;e[48]!==d?(U=d("Column"),e[48]=d,e[49]=U):U=e[49];let ne;e[50]!==U?(ne=(0,v.jsx)(pn,{htmlFor:"bulk-patch-column",children:U}),e[50]=U,e[51]=ne):ne=e[51];let oe;e[52]!==d?(oe=d("Column"),e[52]=d,e[53]=oe):oe=e[53];let ae;e[54]!==n?(ae=n.map(Kl),e[54]=n,e[55]=ae):ae=e[55];let we;e[56]!==c||e[57]!==oe||e[58]!==ae?(we=(0,v.jsx)("select",{"aria-label":oe,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:h,value:c,children:ae}),e[56]=c,e[57]=oe,e[58]=ae,e[59]=we):we=e[59];let se;e[60]!==d?(se=d("Value"),e[60]=d,e[61]=se):se=e[61];let fe;e[62]!==se?(fe=(0,v.jsx)(pn,{htmlFor:"bulk-patch-value",children:se}),e[62]=se,e[63]=fe):fe=e[63];let me;e[64]!==g?(me=(0,v.jsx)(Jn,{className:"flex-1 font-mono","data-testid":"bulk-patch-value",id:"bulk-patch-value",onChange:w,placeholder:"true",value:g}),e[64]=g,e[65]=me):me=e[65];let xe;e[66]!==ne||e[67]!==we||e[68]!==fe||e[69]!==me?(xe=(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[ne,we,fe,me]}),e[66]=ne,e[67]=we,e[68]=fe,e[69]=me,e[70]=xe):xe=e[70];let de;e[71]!==R?(de=R!==void 0&&(0,v.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-error",role:"alert",children:R}),e[71]=R,e[72]=de):de=e[72];let pe;e[73]!==c||e[74]!==d||e[75]!==s||e[76]!==S?(pe=S&&(0,v.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-unique",role:"alert",children:d("{column} has a unique index \u2014 the same value cannot be set on {total} rows.",{column:c,total:s.toString()})}),e[73]=c,e[74]=d,e[75]=s,e[76]=S,e[77]=pe):pe=e[77];let z;e[78]!==C||e[79]!==d||e[80]!==S?(z=C&&!S&&(0,v.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-hint",children:d('Enter a JSON value \u2014 for example true, 0, null, or "done".')}),e[78]=C,e[79]=d,e[80]=S,e[81]=z):z=e[81];let Z;e[82]!==N||e[83]!==c||e[84]!==g?(Z=N&&(0,v.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"bulk-patch-preview",children:`${c} = ${g.trim()}`}),e[82]=N,e[83]=c,e[84]=g,e[85]=Z):Z=e[85];let ie;e[86]!==d?(ie=d("Cancel"),e[86]=d,e[87]=ie):ie=e[87];let ce;e[88]!==r||e[89]!==ie?(ce=(0,v.jsx)(Mt,{"data-testid":"bulk-patch-cancel",onClick:r,size:"xs",variant:"outline",children:ie}),e[88]=r,e[89]=ie,e[90]=ce):ce=e[90];let _e=!N,he;e[91]!==d||e[92]!==s?(he=d("Set on {total} rows",{total:s.toString()}),e[91]=d,e[92]=s,e[93]=he):he=e[93];let te;e[94]!==F||e[95]!==_e||e[96]!==he?(te=(0,v.jsx)(Mt,{"data-testid":"bulk-patch-apply",disabled:_e,onClick:F,size:"xs",children:he}),e[94]=F,e[95]=_e,e[96]=he,e[97]=te):te=e[97];let Q;e[98]!==ce||e[99]!==te?(Q=(0,v.jsxs)("div",{className:"flex justify-end gap-2",children:[ce,te]}),e[98]=ce,e[99]=te,e[100]=Q):Q=e[100];let ke;return e[101]!==r||e[102]!==Y||e[103]!==xe||e[104]!==de||e[105]!==pe||e[106]!==z||e[107]!==Z||e[108]!==Q||e[109]!==k?(ke=(0,v.jsxs)(yt,{label:k,onClose:r,panelTestId:"bulk-patch-panel",testId:"bulk-patch-overlay",variant:"dialog",children:[Y,xe,de,pe,z,Z,Q]}),e[101]=r,e[102]=Y,e[103]=xe,e[104]=de,e[105]=pe,e[106]=z,e[107]=Z,e[108]=Q,e[109]=k,e[110]=ke):ke=e[110],ke},"io");function Kl(t){return(0,v.jsx)("option",{value:t,children:t},t)}a(Kl,"co");var zo=6,Xt=100,Ul=a(t=>({paddingLeft:t*16}),"uo"),Ql=a(t=>{let e=(0,K.c)(2),{table:n}=t,o=`cascade-restrict-${n}`,r;return e[0]!==o?(r=(0,v.jsx)("span",{className:"rounded bg-destructive/10 px-1 text-destructive","data-testid":o,children:"restrict \u2014 will block delete"}),e[0]=o,e[1]=r):r=e[1],r},"fo"),Wl=a(t=>{let e=(0,K.c)(2),{table:n}=t,o=`cascade-cascade-${n}`,r;return e[0]!==o?(r=(0,v.jsx)("span",{className:"rounded bg-warning/10 px-1 text-warning","data-testid":o,children:"cascade"}),e[0]=o,e[1]=r):r=e[1],r},"mo"),Xl=a(t=>{let e=(0,K.c)(2),{table:n}=t,o=`cascade-undeclared-${n}`,r;return e[0]!==o?(r=(0,v.jsx)("span",{className:"rounded bg-muted px-1 text-muted-foreground","data-testid":o,children:"references \u2014 no delete action declared"}),e[0]=o,e[1]=r):r=e[1],r},"go"),Yl=a(t=>t.relation===void 0||t.relation.onDelete==="cascade"?(0,v.jsx)(Wl,{table:t.table}):t.isRestrict?(0,v.jsx)(Ql,{table:t.table}):(0,v.jsx)(Xl,{table:t.table}),"po"),Qo=a(t=>{let e=(0,K.c)(35),{depth:n,node:o}=t,r=`cascade-row-${o.table}`,l;e[0]!==n?(l=Ul(n),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==n?(i=n>0&&(0,v.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2514"}),e[2]=n,e[3]=i):i=e[3];let s;e[4]!==o.table?(s=(0,v.jsx)("span",{className:"font-medium text-foreground",children:o.table}),e[4]=o.table,e[5]=s):s=e[5];let u;e[6]!==o.relation||e[7]!==o.table?(u=o.relation!==void 0&&(0,v.jsxs)("span",{className:"text-muted-foreground","data-testid":`cascade-col-${o.table}-${o.relation.field}`,children:["via ",o.relation.field]}),e[6]=o.relation,e[7]=o.table,e[8]=u):u=e[8];let d;e[9]!==o.rowCount?(d=o.rowCount.toString(),e[9]=o.rowCount,e[10]=d):d=e[10];let c;e[11]!==d?(c=(0,v.jsxs)("span",{className:"text-muted-foreground",children:["(",d," rows)"]}),e[11]=d,e[12]=c):c=e[12];let p;e[13]!==o?(p=Yl(o),e[13]=o,e[14]=p):p=e[14];let g;e[15]!==o.capNote||e[16]!==o.table?(g=o.capNote!==void 0&&(0,v.jsxs)("span",{className:"italic text-muted-foreground","data-testid":`cascade-cap-${o.table}`,children:["(",o.capNote,")"]}),e[15]=o.capNote,e[16]=o.table,e[17]=g):g=e[17];let f;e[18]!==r||e[19]!==l||e[20]!==i||e[21]!==s||e[22]!==u||e[23]!==c||e[24]!==p||e[25]!==g?(f=(0,v.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 py-1 font-mono text-xs","data-testid":r,style:l,children:[i,s,u,c,p,g]}),e[18]=r,e[19]=l,e[20]=i,e[21]=s,e[22]=u,e[23]=c,e[24]=p,e[25]=g,e[26]=f):f=e[26];let m;if(e[27]!==n||e[28]!==o.children){let b;e[30]!==n?(b=a((w,x)=>(0,v.jsx)(Qo,{depth:n+1,node:w},`${w.table}-${w.relation?.field??"root"}-${x.toString()}`),"h"),e[30]=n,e[31]=b):b=e[31],m=o.children.map(b),e[27]=n,e[28]=o.children,e[29]=m}else m=e[29];let h;return e[32]!==f||e[33]!==m?(h=(0,v.jsxs)(v.Fragment,{children:[f,m]}),e[32]=f,e[33]=m,e[34]=h):h=e[34],h},"en"),Zl=a(t=>{let e=t._id??t.id??t.__id__??"";return typeof e=="string"?e:typeof e=="number"?e.toString():""},"bo"),ea=a(async(t,e,n,o)=>{try{let r=await o(t,e,n),l=r.rows.flatMap(s=>Zl(s)||[]).slice(0,Xt),i=r.total??0;return{capNote:i>Xt?`showing first ${Xt.toString()} of ${i.toString()}`:void 0,rowCount:i,rowIds:l}}catch{return{capNote:"count unavailable",rowCount:0,rowIds:[]}}},"ho"),Wo=a(async(t,e,n,o,r,l,i)=>{let{capNote:s,rowCount:u,rowIds:d}=n===void 0?{capNote:void 0,rowCount:1,rowIds:[e]}:await ea(t,n.field,e,i),c=n?.onDelete==="restrict",p=[],g=`${t}:${e}`,f=l>=zo;if(!r.has(g)&&!f){r.add(g);let h=o.get(t)??[];for(let b of h)for(let w of d.slice(0,10)){let x=await Wo(b.table,w,b,o,r,l+1,i);(x.rowCount>0||l===0)&&p.push(x)}r.delete(g)}let m=s;if(f){let h=`depth capped at ${zo.toString()}`;m=s===void 0?h:`${s}; ${h}`}return{capNote:m,children:p,isRestrict:c,relation:n,rowCount:u,rowIds:d,table:t}},"tn"),ta=a(({onClose:t,onConfirm:e,readPage:n,rowId:o,schema:r,table:l})=>{let i=ee(),[s,u]=(0,P.useState)(!0),[d,c]=(0,P.useState)(null),[p,g]=(0,P.useState)(null);(0,P.useEffect)(()=>{let h=!1;return le((async()=>{try{u(!0),g(null);let b=Bl(r);if(!((b.get(l)??[]).length>0)){h||(c({capNote:void 0,children:[],isRestrict:!1,relation:void 0,rowCount:1,rowIds:[o],table:l}),u(!1));return}let w=await Wo(l,o,void 0,b,new Set,0,n);h||(c(w),u(!1))}catch(b){h||(g(b.message),u(!1))}})()),()=>{h=!0}},[o,l]);let f=d!==null&&ql(d,h=>h.isRestrict).length>0,m=a(()=>{e(),t()},"f");return(0,v.jsxs)(yt,{label:"Cascade impact preview",onClose:t,panelTestId:"cascade-panel",testId:"cascade-overlay",variant:"dialog",children:[(0,v.jsxs)("div",{className:"flex items-start justify-between",children:[(0,v.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,v.jsx)("h3",{className:"text-base text-foreground","data-testid":"cascade-title",children:i("Cascade impact")}),(0,v.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-desc",children:i("Delete preview \u2014 rows that would cascade or be blocked")})]}),(0,v.jsx)("button",{className:"text-xs text-muted-foreground hover:text-foreground","data-testid":"cascade-close",onClick:t,type:"button",children:i("Close")})]}),s&&(0,v.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-loading",children:i("Loading\u2026")}),p!==null&&(0,v.jsx)("p",{className:"text-xs text-destructive","data-testid":"cascade-error",role:"alert",children:p}),!s&&d!==null&&(0,v.jsx)("ul",{className:"flex flex-col","data-testid":"cascade-tree",children:(0,v.jsx)(Qo,{depth:0,node:d})}),!s&&d!==null&&d.children.length===0&&(0,v.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-no-impact",children:i("No related rows found.")}),f&&(0,v.jsx)("p",{className:"text-sm font-medium text-destructive","data-testid":"cascade-blocker-warning",role:"alert",children:i("Restrict relations will block this delete.")}),(0,v.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,v.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:i("Cancel")}),(0,v.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:s,onClick:m,type:"button",children:i("Delete")})]})]})},"xo"),na=a((t,e,n,o,r=300)=>{if(o<=0)return{ids:new Set(t.map(p=>p.id)),leadPx:0,tailPx:0};let l=n-r,i=n+o+r,s=new Set,u=0,d=0,c=0;for(let p of t){let g=p.getSize(),f=e.has(p.id),m=u+g>l&&u<i;f||m?s.add(p.id):u<l?d+=g:c+=g,u+=g}return{ids:s,leadPx:d,tailPx:c}},"vo"),oa=a((t,e)=>{let n=new Map,o=0;for(let r of t)e.has(r.id)&&(n.set(r.id,o),o+=r.getSize());return n},"wo"),ra=a(()=>{let t=(0,K.c)(12),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let[n,o]=(0,P.useState)(e),r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=a((h,b,w)=>{o(x=>({...x,[h]:{...x[h],[b]:w}}))},"t"),t[1]=r):r=t[1];let l=r,i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=a(()=>{o({})},"l"),t[2]=i):i=t[2];let s=i,u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=a((h,b)=>{o(w=>{let x=w[h];if(x===void 0)return w;let C=Object.fromEntries(Object.entries(x).filter(R=>{let[y,_]=R;return!(y in b)||!Object.is(_,b[y])}));return Object.keys(C).length===0?Object.fromEntries(Object.entries(w).filter(R=>{let[y]=R;return y!==h})):{...w,[h]:C}})},"a"),t[3]=u):u=t[3];let d=u,c;t[4]!==n?(c=a((h,b)=>{let w=n[h];return w!==void 0&&b in w?{value:w[b]}:void 0},"m"),t[4]=n,t[5]=c):c=t[5];let p=c,g;t[6]!==n?(g=Object.values(n).reduce(aa,0),t[6]=n,t[7]=g):g=t[7];let f=g,m;return t[8]!==f||t[9]!==n||t[10]!==p?(m={clear:s,count:f,drop:d,stage:l,staged:n,stagedValue:p},t[8]=f,t[9]=n,t[10]=p,t[11]=m):m=t[11],m},"yo"),Xo=a((t,e)=>{if(typeof e=="number"){let n=Number(t);return t.trim()===""||Number.isNaN(n)?t:n}if(typeof e=="boolean"){if(t==="true")return!0;if(t==="false")return!1}return t},"nn"),la=a(t=>{let e=(0,K.c)(29),{changes:n,committing:o,onCommit:r,onDiscard:l}=t,i=ee(),s;e[0]!==n.length||e[1]!==i?(s=i("{count} pending changes",{count:n.length}),e[0]=n.length,e[1]=i,e[2]=s):s=e[2];let u;e[3]!==s?(u=(0,v.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-warning","data-testid":"db-staged-count",children:s}),e[3]=s,e[4]=u):u=e[4];let d;e[5]!==o||e[6]!==i?(d=i(o?"Committing\u2026":"Commit"),e[5]=o,e[6]=i,e[7]=d):d=e[7];let c;e[8]!==o||e[9]!==r||e[10]!==d?(c=(0,v.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:o,onClick:r,type:"button",children:d}),e[8]=o,e[9]=r,e[10]=d,e[11]=c):c=e[11];let p;e[12]!==i?(p=i("Discard"),e[12]=i,e[13]=p):p=e[13];let g;e[14]!==o||e[15]!==l||e[16]!==p?(g=(0,v.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:o,onClick:l,type:"button",children:p}),e[14]=o,e[15]=l,e[16]=p,e[17]=g):g=e[17];let f;e[18]!==u||e[19]!==c||e[20]!==g?(f=(0,v.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,c,g]}),e[18]=u,e[19]=c,e[20]=g,e[21]=f):f=e[21];let m;e[22]!==n?(m=n.map(ia),e[22]=n,e[23]=m):m=e[23];let h;e[24]!==m?(h=(0,v.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"db-staged-list",children:m}),e[24]=m,e[25]=h):h=e[25];let b;return e[26]!==f||e[27]!==h?(b=(0,v.jsxs)("div",{className:"flex flex-col gap-2 border border-warning/40 bg-warning/5 p-3","data-testid":"db-staged",children:[f,h]}),e[26]=f,e[27]=h,e[28]=b):b=e[28],b},"Co");function aa(t,e){return t+Object.keys(e).length}a(aa,"No");function ia(t){return(0,v.jsxs)("li",{className:"flex flex-wrap items-center gap-2 font-mono text-xs",children:[(0,v.jsxs)("span",{className:"text-muted-foreground",children:[t.rowId,".",t.column]}),(0,v.jsx)("span",{className:"text-destructive line-through",children:Ue(t.oldValue)}),(0,v.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2192"}),(0,v.jsx)("span",{className:"text-foreground",children:Ue(t.newValue)})]},`${t.rowId}:${t.column}`)}a(ia,"So");var Go=400,sa=36,ua={flex:"1 1 0%",minHeight:0,overflow:"auto",position:"relative"},da={width:"100%"},ca=/\n$/u,ga={alignItems:"center",display:"flex",left:0,position:"absolute",top:0,width:"100%"},fa={display:"flex",width:"100%"},Ho={flex:"0 0 8.5rem",padding:"0.375rem 0.75rem"},ma="2.5rem",Yo={alignItems:"center",display:"flex",flex:"0 0 2.5rem",justifyContent:"center",left:0,padding:"0.375rem 0",position:"sticky",zIndex:2},Ln=a(t=>({flex:"0 0 auto",overflow:"hidden",padding:"0.375rem 0.75rem",position:"relative",textOverflow:"ellipsis",whiteSpace:"nowrap",width:`${t.toString()}px`}),"At"),Zo=a((t,e)=>({...Ln(t),left:`calc(${ma} + ${e.toString()}px)`,position:"sticky",zIndex:2}),"sn"),En="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",pa=a((t,e,n)=>e.enabled&&e.columns.has(n)?void 0:t,"Ao"),On="__back__:",ha=a(t=>`${On}${t.table}.${t.column}`,"Io"),va=a(t=>{let e=(0,K.c)(3),{counts:n,rowId:o}=t;if(n===void 0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,v.jsx)("span",{className:"text-muted-foreground/50",children:"\u2014"}),e[0]=i):i=e[0],i}let r=n[o]??0,l;return e[1]!==r?(l=(0,v.jsx)("span",{className:"tabular-nums",children:r}),e[1]=r,e[2]=l):l=e[2],l},"Po"),He=a(t=>{for(let e of["id","__id__","_id"]){let n=t[e];if(typeof n=="string"||typeof n=="number")return String(n)}return null},"Ae"),ba=a((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 n=Number(t);return t.trim()===""||!Number.isFinite(n)?void 0:{value:n}}return{value:t}},"Oo"),wa=a((t,e,n)=>{if(n!==void 0&&n.type!=="any")return ba(t,n);let o=Xo(t,e);return typeof e=="number"&&typeof o!="number"?void 0:{value:o}},"Mo"),xa=a(({anchor:t,columnIds:e,columnMeta:n,editableColumn:o,rows:r,text:l})=>{let i=l.replaceAll(`\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as j,c as v,d as D,f as g}from"./chunk-
|
|
1
|
+
import{b as j,c as v,d as D,f as g}from"./chunk-XTLR2A7C.js";import{f as S,g as w,h as P,o as q}from"./chunk-FODLDLE2.js";import{a as i,d as A,e as x,f as M}from"./chunk-YKXDMIHQ.js";var E=A(M(),1);var p=A(x(),1);var I=300,l=i(t=>typeof t=="string"?t===""?void 0:t:typeof t=="number"||typeof t=="boolean"?String(t):void 0,"a"),u=i(t=>t.filter(r=>r!==void 0).join(" "),"c"),T=i(t=>{let r=Array.isArray(t.filters)?t.filters.length:0,e=typeof t.search=="string"&&t.search!=="";return r===0&&!e?"no predicate":u([r===0?void 0:`${String(r)} filters`,e?"search":void 0])},"q"),N={clearTable:i(t=>u([l(t.table),"whole table"]),"clearTable"),deleteRows:i(t=>u([l(t.table),T(t)]),"deleteRows"),facetColumn:i(t=>u([l(t.table),l(t.column)]),"facetColumn"),importShard:i(t=>{if(!Array.isArray(t.rows))return"";let r=[...new Set(t.rows.filter(e=>typeof e=="object"&&e!==null).map(e=>e.table).filter(e=>typeof e=="string"))].toSorted((e,s)=>e.localeCompare(s));return u([`${String(t.rows.length)} rows`,r.length===0?void 0:`into ${r.join(", ")}`])},"importShard"),lintSql:i(()=>"sql","lintSql"),patchRows:i(t=>u([l(t.table),typeof t.doc=="object"&&t.doc!==null?`set ${Object.keys(t.doc).join(", ")}`:void 0,T(t)]),"patchRows"),pitrRestore:i(t=>u([l(t.time)===void 0?void 0:`to ${String(t.time)}`,typeof t.bookmark=="string"&&t.bookmark!==""?"from bookmark":void 0,t.restart===!0?"restart now":void 0]),"pitrRestore"),readTablePage:i(t=>u([l(t.table),Array.isArray(t.filters)&&t.filters.length>0?`${String(t.filters.length)} filters`:void 0,typeof t.search=="string"&&t.search!==""?"search":void 0,typeof t.limit=="number"?`limit ${String(t.limit)}`:void 0]),"readTablePage"),runMigration:i(t=>u([l(t.id),l(t.direction),t.dryRun===!0?"dry-run":void 0]),"runMigration"),runSql:i(t=>typeof t.sql=="string"?`${String(t.sql.length)} chars`:"","runSql"),schemaVersion:i(t=>typeof t.hash=="string"?t.hash.slice(0,8):"","schemaVersion"),writeRow:i(t=>u([l(t.table),"1 row"]),"writeRow")},$="__lunora_admin__:",F=i((t,r)=>{let e=t.startsWith($)?t.slice($.length):t,s=N[e];if(s!==void 0)return s(r);let n=Object.keys(r);return n.length===0?"":n.join(", ")},"M"),V=i(t=>{if(Array.isArray(t))return t.length;if(!(typeof t!="object"||t===null)){for(let r of Object.values(t))if(Array.isArray(r))return r.length}},"K"),k=class{static{i(this,"x")}entries=[];listeners=new Set;nextSeq=1;getSnapshot=i(()=>this.entries,"getSnapshot");subscribe=i(r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}),"subscribe");start(r,e,s){return this.append(r,e,s,"call","pending")}startSubscription(r,e,s){return this.append(r,e,s,"subscription","live")}recordPush(r){if(this.listeners.size===0){let e=this.entries.find(s=>s.seq===r);e!==void 0&&(e.pushes=(e.pushes??0)+1);return}this.patch(r,e=>({...e,pushes:(e.pushes??0)+1}))}failSubscription(r,e){this.patch(r,s=>({...s,error:e,status:"error"}))}endSubscription(r){this.patch(r,e=>e.status==="error"?e:{...e,durationMs:Date.now()-e.startedAt,status:"closed"})}lastErrorSeq(){return this.entries.findLast(r=>r.status==="error")?.seq}settle(r,e){this.patch(r,s=>({...s,durationMs:Date.now()-s.startedAt,...e.error===void 0?{resultCount:V(e.result),status:"ok"}:{error:e.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(r,e,s,n,a){let d=this.nextSeq;this.nextSeq+=1;let c={functionPath:r,kind:n,seq:d,shardKey:s,startedAt:Date.now(),status:a,summary:F(r,e),...n==="subscription"?{pushes:0}:{}},o=[...this.entries,c];return this.entries=o.length>I?o.slice(o.length-I):o,this.emit(),d}patch(r,e){let s=this.entries.findIndex(n=>n.seq===r);s!==-1&&(this.entries=this.entries.with(s,e(this.entries[s])),this.emit())}emit(){for(let r of this.listeners)r()}},f=new k,_=i((t,r,e)=>["lunora-admin",t,r,e.trim()],"j"),O=i((t,r)=>[...t,r],"E");function W(t,r,e={}){let s=g(),{enabled:n=!0,keepPreviousData:a=!1,staleTime:d=0}=e,c=O(t,s.clientIdentifier()),o=D({enabled:n,queryFn:r,placeholderData:a?j:void 0,queryKey:c,staleTime:d});return{data:o.data,error:o.error?P(o.error):o.error,errorSource:o.error??void 0,isLoading:o.isLoading,liveError:void 0,refetch:i(()=>{q(o.refetch())},"refetch")}}i(W,"F");function Y(t,r,e={}){let s=g(),n=v(),{enabled:a=!0,keepPreviousData:d=!1,live:c=!1,shardKey:o="",staleTime:R}=e,m=_(t,r,o),C=W(m,()=>s.query(S(t),r,w(o)),{enabled:a,keepPreviousData:d,staleTime:R??(c?Number.POSITIVE_INFINITY:0)}),[K,b]=(0,p.useState)(void 0),L=JSON.stringify(m);return(0,p.useEffect)(()=>{if(!a||!c)return;b(void 0);let y=f.startSubscription(t,r,o),Q=s.subscribe(S(t),r,h=>{f.recordPush(y),b(void 0),n.setQueryData(O(m,s.clientIdentifier()),h)},{...w(o),onError:i(h=>{f.failSubscription(y,h.message),b(h.message)},"onError")});return()=>{f.endSubscription(y),Q()}},[s,L,a,c]),{...C,liveError:a&&c?K:void 0}}i(Y,"U");var B=i(()=>{let t=(0,E.c)(2),r=v(),e;return t[0]!==r?(e=i((s,n,a)=>{let d=n===void 0?["lunora-admin",s]:_(s,n,a??"");q(r.invalidateQueries({queryKey:d}))},"r"),t[0]=r,t[1]=e):e=t[1],e},"W");export{f as a,W as b,Y as c,B as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Yi,b as Ve,c as Ri,d as Je,e as Zi,f as xi,k as ji}from"./chunk-3KDC7UYQ.js";import"./chunk-Q4CAKBWN.js";import"./chunk-CZY6LNTK.js";import"./chunk-RLLKECZT.js";import"./chunk-7RIRJD2P.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import{a as pi}from"./chunk-QKEJLVC5.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import"./chunk-5WJXVZMZ.js";import"./chunk-PYT4RZJH.js";import"./chunk-K7AJEMKE.js";import"./chunk-JVUZEYKQ.js";import{a as Le}from"./chunk-OKG3HWSJ.js";import{P as Xi}from"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import{a as zy}from"./chunk-4L4WTGN5.js";import{a as Gi}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import{b as Ke}from"./chunk-GWW7SJR6.js";import"./chunk-35DM4JJG.js";import"./chunk-4ZEL6BYL.js";import"./chunk-KQFH6FFC.js";import{a as Hi,e as qi}from"./chunk-XZCNX7YU.js";import"./chunk-FSRSK4LY.js";import{d as _i}from"./chunk-2LN3T5HY.js";import"./chunk-FKVZRPV5.js";import"./chunk-WUWBZPUK.js";import{a as Qi,d as je,p as Ci}from"./chunk-FODLDLE2.js";import{a as c,b as vn,d as fu,e as Ni,f as Ay,g as Bi,i as xe}from"./chunk-YKXDMIHQ.js";var ri=vn(w=>{"use strict";function $e(l,t){var a=l.length;l.push(t);l:for(;0<a;){var u=a-1>>>1,n=l[u];if(0<yn(n,t))l[u]=t,l[a]=n,a=u;else break l}}c($e,"push");function wl(l){return l.length===0?null:l[0]}c(wl,"peek");function hn(l){if(l.length===0)return null;var t=l[0],a=l.pop();if(a!==t){l[0]=a;l:for(var u=0,n=l.length,e=n>>>1;u<e;){var f=2*(u+1)-1,i=l[f],m=f+1,d=l[m];if(0>yn(i,a))m<n&&0>yn(d,i)?(l[u]=d,l[m]=a,u=m):(l[u]=i,l[f]=a,u=f);else if(m<n&&0>yn(d,a))l[u]=d,l[m]=a,u=m;else break l}}return t}c(hn,"pop");function yn(l,t){var a=l.sortIndex-t.sortIndex;return a!==0?a:l.id-t.id}c(yn,"compare");w.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Vi=performance,w.unstable_now=function(){return Vi.now()}):(We=Date,Li=We.now(),w.unstable_now=function(){return We.now()-Li});var Vi,We,Li,tt=[],Et=[],Ty=1,Ql=null,Sl=3,ke=!1,iu=!1,mu=!1,re=!1,Wi=typeof setTimeout=="function"?setTimeout:null,wi=typeof clearTimeout=="function"?clearTimeout:null,Ki=typeof setImmediate<"u"?setImmediate:null;function dn(l){for(var t=wl(Et);t!==null;){if(t.callback===null)hn(Et);else if(t.startTime<=l)hn(Et),t.sortIndex=t.expirationTime,$e(tt,t);else break;t=wl(Et)}}c(dn,"advanceTimers");function Ie(l){if(mu=!1,dn(l),!iu)if(wl(tt)!==null)iu=!0,oa||(oa=!0,ga());else{var t=wl(Et);t!==null&&Pe(Ie,t.startTime-l)}}c(Ie,"handleTimeout");var oa=!1,vu=-1,Fi=5,$i=-1;function ki(){return re?!0:!(w.unstable_now()-$i<Fi)}c(ki,"shouldYieldToHost");function we(){if(re=!1,oa){var l=w.unstable_now();$i=l;var t=!0;try{l:{iu=!1,mu&&(mu=!1,wi(vu),vu=-1),ke=!0;var a=Sl;try{t:{for(dn(l),Ql=wl(tt);Ql!==null&&!(Ql.expirationTime>l&&ki());){var u=Ql.callback;if(typeof u=="function"){Ql.callback=null,Sl=Ql.priorityLevel;var n=u(Ql.expirationTime<=l);if(l=w.unstable_now(),typeof n=="function"){Ql.callback=n,dn(l),t=!0;break t}Ql===wl(tt)&&hn(tt),dn(l)}else hn(tt);Ql=wl(tt)}if(Ql!==null)t=!0;else{var e=wl(Et);e!==null&&Pe(Ie,e.startTime-l),t=!1}}break l}finally{Ql=null,Sl=a,ke=!1}t=void 0}}finally{t?ga():oa=!1}}}c(we,"performWorkUntilDeadline");var ga;typeof Ki=="function"?ga=c(function(){Ki(we)},"schedulePerformWorkUntilDeadline"):typeof MessageChannel<"u"?(Fe=new MessageChannel,Ji=Fe.port2,Fe.port1.onmessage=we,ga=c(function(){Ji.postMessage(null)},"schedulePerformWorkUntilDeadline")):ga=c(function(){Wi(we,0)},"schedulePerformWorkUntilDeadline");var Fe,Ji;function Pe(l,t){vu=Wi(function(){l(w.unstable_now())},t)}c(Pe,"requestHostTimeout");w.unstable_IdlePriority=5;w.unstable_ImmediatePriority=1;w.unstable_LowPriority=4;w.unstable_NormalPriority=3;w.unstable_Profiling=null;w.unstable_UserBlockingPriority=2;w.unstable_cancelCallback=function(l){l.callback=null};w.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fi=0<l?Math.floor(1e3/l):5};w.unstable_getCurrentPriorityLevel=function(){return Sl};w.unstable_next=function(l){switch(Sl){case 1:case 2:case 3:var t=3;break;default:t=Sl}var a=Sl;Sl=t;try{return l()}finally{Sl=a}};w.unstable_requestPaint=function(){re=!0};w.unstable_runWithPriority=function(l,t){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var a=Sl;Sl=l;try{return t()}finally{Sl=a}};w.unstable_scheduleCallback=function(l,t,a){var u=w.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?u+a:u):a=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,l={id:Ty++,callback:t,priorityLevel:l,startTime:a,expirationTime:n,sortIndex:-1},a>u?(l.sortIndex=a,$e(Et,l),wl(tt)===null&&l===wl(Et)&&(mu?(wi(vu),vu=-1):mu=!0,Pe(Ie,a-u))):(l.sortIndex=n,$e(tt,l),iu||ke||(iu=!0,oa||(oa=!0,ga()))),l};w.unstable_shouldYield=ki;w.unstable_wrapCallback=function(l){var t=Sl;return function(){var a=Sl;Sl=t;try{return l.apply(this,arguments)}finally{Sl=a}}}});var Pi=vn((e2,Ii)=>{"use strict";Ii.exports=ri()});var yy=vn(Re=>{"use strict";var el=Pi(),U1=Ni(),Ey=zy();function z(l){var t="https://react.dev/errors/"+l;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+l+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}c(z,"formatProdErrorMessage");function D1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}c(D1,"isValidContainer");function ku(l){var t=l,a=l;if(l.alternate)for(;t.return;)t=t.return;else{l=t;do t=l,(t.flags&4098)!==0&&(a=t.return),l=t.return;while(l)}return t.tag===3?a:null}c(ku,"getNearestMountedFiber");function _1(l){if(l.tag===13){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(_1,"getSuspenseInstanceFromFiber");function N1(l){if(l.tag===31){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(N1,"getActivityInstanceFromFiber");function l0(l){if(ku(l)!==l)throw Error(z(188))}c(l0,"assertIsMounted");function My(l){var t=l.alternate;if(!t){if(t=ku(l),t===null)throw Error(z(188));return t!==l?null:l}for(var a=l,u=t;;){var n=a.return;if(n===null)break;var e=n.alternate;if(e===null){if(u=n.return,u!==null){a=u;continue}break}if(n.child===e.child){for(e=n.child;e;){if(e===a)return l0(n),l;if(e===u)return l0(n),t;e=e.sibling}throw Error(z(188))}if(a.return!==u.return)a=n,u=e;else{for(var f=!1,i=n.child;i;){if(i===a){f=!0,a=n,u=e;break}if(i===u){f=!0,u=n,a=e;break}i=i.sibling}if(!f){for(i=e.child;i;){if(i===a){f=!0,a=e,u=n;break}if(i===u){f=!0,u=e,a=n;break}i=i.sibling}if(!f)throw Error(z(189))}}if(a.alternate!==u)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?l:t}c(My,"findCurrentFiberUsingSlowPath");function H1(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l;for(l=l.child;l!==null;){if(t=H1(l),t!==null)return t;l=l.sibling}return null}c(H1,"findCurrentHostFiberImpl");var W=Object.assign,Oy=Symbol.for("react.element"),Sn=Symbol.for("react.transitional.element"),su=Symbol.for("react.portal"),Ea=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),Qc=Symbol.for("react.profiler"),q1=Symbol.for("react.consumer"),mt=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Xc=Symbol.for("react.suspense"),Gc=Symbol.for("react.suspense_list"),Bf=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),Cc=Symbol.for("react.activity"),Uy=Symbol.for("react.memo_cache_sentinel"),t0=Symbol.iterator;function yu(l){return l===null||typeof l!="object"?null:(l=t0&&l[t0]||l["@@iterator"],typeof l=="function"?l:null)}c(yu,"getIteratorFn");var Dy=Symbol.for("react.client.reference");function pc(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Dy?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Ea:return"Fragment";case Qc:return"Profiler";case B1:return"StrictMode";case Xc:return"Suspense";case Gc:return"SuspenseList";case Cc:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case su:return"Portal";case mt:return l.displayName||"Context";case q1:return(l._context.displayName||"Context")+".Consumer";case Hf:var t=l.render;return l=l.displayName,l||(l=t.displayName||t.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Bf:return t=l.displayName||null,t!==null?t:pc(l.type)||"Memo";case Mt:t=l._payload,l=l._init;try{return pc(l(t))}catch{}}return null}c(pc,"getComponentNameFromType");var zu=Array.isArray,D=U1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Ey.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,la={pending:!1,data:null,method:null,action:null},Rc=[],Ma=-1;function Il(l){return{current:l}}c(Il,"createCursor");function il(l){0>Ma||(l.current=Rc[Ma],Rc[Ma]=null,Ma--)}c(il,"pop");function L(l,t){Ma++,Rc[Ma]=l.current,l.current=t}c(L,"push");var rl=Il(null),Cu=Il(null),Xt=Il(null),wn=Il(null);function Fn(l,t){switch(L(Xt,t),L(Cu,l),L(rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?i1(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=i1(t),l=rv(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}il(rl),L(rl,l)}c(Fn,"pushHostContainer");function ja(){il(rl),il(Cu),il(Xt)}c(ja,"popHostContainer");function Zc(l){l.memoizedState!==null&&L(wn,l);var t=rl.current,a=rv(t,l.type);t!==a&&(L(Cu,l),L(rl,a))}c(Zc,"pushHostContext");function $n(l){Cu.current===l&&(il(rl),il(Cu)),wn.current===l&&(il(wn),wu._currentValue=la)}c($n,"popHostContext");var lc,a0;function kt(l){if(lc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);lc=t&&t[1]||"",a0=-1<a.stack.indexOf(`
|
|
1
|
+
import{a as Yi,b as Ve,c as Ri,d as Je,e as Zi,f as xi,k as ji}from"./chunk-7J33QSVR.js";import"./chunk-Q4CAKBWN.js";import"./chunk-DRYRBVT5.js";import"./chunk-RLLKECZT.js";import"./chunk-7RIRJD2P.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import{a as pi}from"./chunk-QKEJLVC5.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import"./chunk-5WJXVZMZ.js";import"./chunk-PYT4RZJH.js";import"./chunk-K7AJEMKE.js";import"./chunk-JVUZEYKQ.js";import{a as Le}from"./chunk-OKG3HWSJ.js";import{P as Xi}from"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import{a as zy}from"./chunk-4L4WTGN5.js";import{a as Gi}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import{b as Ke}from"./chunk-7ROGUMLR.js";import"./chunk-35DM4JJG.js";import"./chunk-4ZEL6BYL.js";import"./chunk-ZXRRPWQV.js";import{a as Hi,e as qi}from"./chunk-XTLR2A7C.js";import"./chunk-FSRSK4LY.js";import{d as _i}from"./chunk-2LN3T5HY.js";import"./chunk-FKVZRPV5.js";import"./chunk-WUWBZPUK.js";import{a as Qi,d as je,p as Ci}from"./chunk-FODLDLE2.js";import{a as c,b as vn,d as fu,e as Ni,f as Ay,g as Bi,i as xe}from"./chunk-YKXDMIHQ.js";var ri=vn(w=>{"use strict";function $e(l,t){var a=l.length;l.push(t);l:for(;0<a;){var u=a-1>>>1,n=l[u];if(0<yn(n,t))l[u]=t,l[a]=n,a=u;else break l}}c($e,"push");function wl(l){return l.length===0?null:l[0]}c(wl,"peek");function hn(l){if(l.length===0)return null;var t=l[0],a=l.pop();if(a!==t){l[0]=a;l:for(var u=0,n=l.length,e=n>>>1;u<e;){var f=2*(u+1)-1,i=l[f],m=f+1,d=l[m];if(0>yn(i,a))m<n&&0>yn(d,i)?(l[u]=d,l[m]=a,u=m):(l[u]=i,l[f]=a,u=f);else if(m<n&&0>yn(d,a))l[u]=d,l[m]=a,u=m;else break l}}return t}c(hn,"pop");function yn(l,t){var a=l.sortIndex-t.sortIndex;return a!==0?a:l.id-t.id}c(yn,"compare");w.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Vi=performance,w.unstable_now=function(){return Vi.now()}):(We=Date,Li=We.now(),w.unstable_now=function(){return We.now()-Li});var Vi,We,Li,tt=[],Et=[],Ty=1,Ql=null,Sl=3,ke=!1,iu=!1,mu=!1,re=!1,Wi=typeof setTimeout=="function"?setTimeout:null,wi=typeof clearTimeout=="function"?clearTimeout:null,Ki=typeof setImmediate<"u"?setImmediate:null;function dn(l){for(var t=wl(Et);t!==null;){if(t.callback===null)hn(Et);else if(t.startTime<=l)hn(Et),t.sortIndex=t.expirationTime,$e(tt,t);else break;t=wl(Et)}}c(dn,"advanceTimers");function Ie(l){if(mu=!1,dn(l),!iu)if(wl(tt)!==null)iu=!0,oa||(oa=!0,ga());else{var t=wl(Et);t!==null&&Pe(Ie,t.startTime-l)}}c(Ie,"handleTimeout");var oa=!1,vu=-1,Fi=5,$i=-1;function ki(){return re?!0:!(w.unstable_now()-$i<Fi)}c(ki,"shouldYieldToHost");function we(){if(re=!1,oa){var l=w.unstable_now();$i=l;var t=!0;try{l:{iu=!1,mu&&(mu=!1,wi(vu),vu=-1),ke=!0;var a=Sl;try{t:{for(dn(l),Ql=wl(tt);Ql!==null&&!(Ql.expirationTime>l&&ki());){var u=Ql.callback;if(typeof u=="function"){Ql.callback=null,Sl=Ql.priorityLevel;var n=u(Ql.expirationTime<=l);if(l=w.unstable_now(),typeof n=="function"){Ql.callback=n,dn(l),t=!0;break t}Ql===wl(tt)&&hn(tt),dn(l)}else hn(tt);Ql=wl(tt)}if(Ql!==null)t=!0;else{var e=wl(Et);e!==null&&Pe(Ie,e.startTime-l),t=!1}}break l}finally{Ql=null,Sl=a,ke=!1}t=void 0}}finally{t?ga():oa=!1}}}c(we,"performWorkUntilDeadline");var ga;typeof Ki=="function"?ga=c(function(){Ki(we)},"schedulePerformWorkUntilDeadline"):typeof MessageChannel<"u"?(Fe=new MessageChannel,Ji=Fe.port2,Fe.port1.onmessage=we,ga=c(function(){Ji.postMessage(null)},"schedulePerformWorkUntilDeadline")):ga=c(function(){Wi(we,0)},"schedulePerformWorkUntilDeadline");var Fe,Ji;function Pe(l,t){vu=Wi(function(){l(w.unstable_now())},t)}c(Pe,"requestHostTimeout");w.unstable_IdlePriority=5;w.unstable_ImmediatePriority=1;w.unstable_LowPriority=4;w.unstable_NormalPriority=3;w.unstable_Profiling=null;w.unstable_UserBlockingPriority=2;w.unstable_cancelCallback=function(l){l.callback=null};w.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fi=0<l?Math.floor(1e3/l):5};w.unstable_getCurrentPriorityLevel=function(){return Sl};w.unstable_next=function(l){switch(Sl){case 1:case 2:case 3:var t=3;break;default:t=Sl}var a=Sl;Sl=t;try{return l()}finally{Sl=a}};w.unstable_requestPaint=function(){re=!0};w.unstable_runWithPriority=function(l,t){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var a=Sl;Sl=l;try{return t()}finally{Sl=a}};w.unstable_scheduleCallback=function(l,t,a){var u=w.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?u+a:u):a=u,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,l={id:Ty++,callback:t,priorityLevel:l,startTime:a,expirationTime:n,sortIndex:-1},a>u?(l.sortIndex=a,$e(Et,l),wl(tt)===null&&l===wl(Et)&&(mu?(wi(vu),vu=-1):mu=!0,Pe(Ie,a-u))):(l.sortIndex=n,$e(tt,l),iu||ke||(iu=!0,oa||(oa=!0,ga()))),l};w.unstable_shouldYield=ki;w.unstable_wrapCallback=function(l){var t=Sl;return function(){var a=Sl;Sl=t;try{return l.apply(this,arguments)}finally{Sl=a}}}});var Pi=vn((e2,Ii)=>{"use strict";Ii.exports=ri()});var yy=vn(Re=>{"use strict";var el=Pi(),U1=Ni(),Ey=zy();function z(l){var t="https://react.dev/errors/"+l;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+l+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}c(z,"formatProdErrorMessage");function D1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}c(D1,"isValidContainer");function ku(l){var t=l,a=l;if(l.alternate)for(;t.return;)t=t.return;else{l=t;do t=l,(t.flags&4098)!==0&&(a=t.return),l=t.return;while(l)}return t.tag===3?a:null}c(ku,"getNearestMountedFiber");function _1(l){if(l.tag===13){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(_1,"getSuspenseInstanceFromFiber");function N1(l){if(l.tag===31){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}c(N1,"getActivityInstanceFromFiber");function l0(l){if(ku(l)!==l)throw Error(z(188))}c(l0,"assertIsMounted");function My(l){var t=l.alternate;if(!t){if(t=ku(l),t===null)throw Error(z(188));return t!==l?null:l}for(var a=l,u=t;;){var n=a.return;if(n===null)break;var e=n.alternate;if(e===null){if(u=n.return,u!==null){a=u;continue}break}if(n.child===e.child){for(e=n.child;e;){if(e===a)return l0(n),l;if(e===u)return l0(n),t;e=e.sibling}throw Error(z(188))}if(a.return!==u.return)a=n,u=e;else{for(var f=!1,i=n.child;i;){if(i===a){f=!0,a=n,u=e;break}if(i===u){f=!0,u=n,a=e;break}i=i.sibling}if(!f){for(i=e.child;i;){if(i===a){f=!0,a=e,u=n;break}if(i===u){f=!0,u=e,a=n;break}i=i.sibling}if(!f)throw Error(z(189))}}if(a.alternate!==u)throw Error(z(190))}if(a.tag!==3)throw Error(z(188));return a.stateNode.current===a?l:t}c(My,"findCurrentFiberUsingSlowPath");function H1(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l;for(l=l.child;l!==null;){if(t=H1(l),t!==null)return t;l=l.sibling}return null}c(H1,"findCurrentHostFiberImpl");var W=Object.assign,Oy=Symbol.for("react.element"),Sn=Symbol.for("react.transitional.element"),su=Symbol.for("react.portal"),Ea=Symbol.for("react.fragment"),B1=Symbol.for("react.strict_mode"),Qc=Symbol.for("react.profiler"),q1=Symbol.for("react.consumer"),mt=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Xc=Symbol.for("react.suspense"),Gc=Symbol.for("react.suspense_list"),Bf=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),Cc=Symbol.for("react.activity"),Uy=Symbol.for("react.memo_cache_sentinel"),t0=Symbol.iterator;function yu(l){return l===null||typeof l!="object"?null:(l=t0&&l[t0]||l["@@iterator"],typeof l=="function"?l:null)}c(yu,"getIteratorFn");var Dy=Symbol.for("react.client.reference");function pc(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Dy?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Ea:return"Fragment";case Qc:return"Profiler";case B1:return"StrictMode";case Xc:return"Suspense";case Gc:return"SuspenseList";case Cc:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case su:return"Portal";case mt:return l.displayName||"Context";case q1:return(l._context.displayName||"Context")+".Consumer";case Hf:var t=l.render;return l=l.displayName,l||(l=t.displayName||t.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Bf:return t=l.displayName||null,t!==null?t:pc(l.type)||"Memo";case Mt:t=l._payload,l=l._init;try{return pc(l(t))}catch{}}return null}c(pc,"getComponentNameFromType");var zu=Array.isArray,D=U1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Ey.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,la={pending:!1,data:null,method:null,action:null},Rc=[],Ma=-1;function Il(l){return{current:l}}c(Il,"createCursor");function il(l){0>Ma||(l.current=Rc[Ma],Rc[Ma]=null,Ma--)}c(il,"pop");function L(l,t){Ma++,Rc[Ma]=l.current,l.current=t}c(L,"push");var rl=Il(null),Cu=Il(null),Xt=Il(null),wn=Il(null);function Fn(l,t){switch(L(Xt,t),L(Cu,l),L(rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?i1(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=i1(t),l=rv(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}il(rl),L(rl,l)}c(Fn,"pushHostContainer");function ja(){il(rl),il(Cu),il(Xt)}c(ja,"popHostContainer");function Zc(l){l.memoizedState!==null&&L(wn,l);var t=rl.current,a=rv(t,l.type);t!==a&&(L(Cu,l),L(rl,a))}c(Zc,"pushHostContext");function $n(l){Cu.current===l&&(il(rl),il(Cu)),wn.current===l&&(il(wn),wu._currentValue=la)}c($n,"popHostContext");var lc,a0;function kt(l){if(lc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);lc=t&&t[1]||"",a0=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+lc+l+a0}c(kt,"describeBuiltInComponentFrame");var tc=!1;function ac(l,t){if(!l||tc)return"";tc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:c(function(){try{if(t){var b=c(function(){throw Error()},"Fake");if(Object.defineProperty(b.prototype,"props",{set:c(function(){throw Error()},"set")}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(g){var S=g}Reflect.construct(l,[],b)}else{try{b.call()}catch(g){S=g}l.call(b.prototype)}}else{try{throw Error()}catch(g){S=g}(b=l())&&typeof b.catch=="function"&&b.catch(function(){})}}catch(g){if(g&&S&&typeof g.stack=="string")return[g.stack,S.stack]}return[null,null]},"DetermineComponentFrameRoot")};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var e=u.DetermineComponentFrameRoot(),f=e[0],i=e[1];if(f&&i){var m=f.split(`
|
|
4
4
|
`),d=i.split(`
|