@lunora/studio 1.0.0-alpha.81 → 1.0.0-alpha.83
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.d.ts +35 -6
- package/dist/index.js +1 -1
- package/dist/mount.js +1 -1
- package/dist/packem_chunks/AdvisorHealthPanel.js +1 -0
- package/dist/packem_chunks/ApiTab.js +1 -1
- package/dist/packem_chunks/AuditPanel.js +1 -1
- package/dist/packem_chunks/ExportImportPanel.js +1 -1
- package/dist/packem_chunks/FileBrowser.js +1 -1
- package/dist/packem_chunks/FunctionRunner.js +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
- package/dist/packem_chunks/HealthPanel.js +1 -1
- package/dist/packem_chunks/InsightsPanel.js +1 -1
- package/dist/packem_chunks/LogsPanel.js +1 -1
- package/dist/packem_chunks/MailPanel.js +2 -2
- package/dist/packem_chunks/MetricsPanel.js +1 -1
- package/dist/packem_chunks/NotificationsPanel.js +1 -1
- package/dist/packem_chunks/PitrPanel.js +1 -1
- package/dist/packem_chunks/SchemaViewer.js +1 -1
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -1
- package/dist/packem_chunks/SettingsPanel.js +1 -1
- package/dist/packem_chunks/SqlEditorPanel.js +6 -6
- package/dist/packem_chunks/TableEditor.js +1 -1
- package/dist/packem_chunks/agents-panel.js +1 -1
- package/dist/packem_chunks/auth-audit-panel.js +1 -1
- package/dist/packem_chunks/containers-panel.js +1 -1
- package/dist/packem_chunks/dashboards-panel.js +1 -1
- package/dist/packem_chunks/fanout-panel.js +1 -1
- package/dist/packem_chunks/flags-panel.js +1 -1
- package/dist/packem_chunks/issues-panel.js +1 -1
- package/dist/packem_chunks/kv-browser.js +1 -1
- package/dist/packem_chunks/log-drains-panel.js +1 -1
- package/dist/packem_chunks/migrations-route.js +1 -1
- package/dist/packem_chunks/organizations-panel.js +1 -1
- package/dist/packem_chunks/payments-panel.js +1 -1
- package/dist/packem_chunks/permissions-panel.js +1 -1
- package/dist/packem_chunks/queues-panel.js +1 -1
- package/dist/packem_chunks/rls-panel.js +1 -1
- package/dist/packem_chunks/storage-rules-panel.js +1 -1
- package/dist/packem_chunks/subscriptions-panel.js +1 -1
- package/dist/packem_chunks/traces-panel.js +1 -1
- package/dist/packem_chunks/workflows-panel.js +1 -1
- package/dist/packem_shared/ADMIN_FUNCTIONS-CZESgd10.js +1 -0
- package/dist/packem_shared/{ApiDocsPanel-DfUQ1ZAF.js → ApiDocsPanel-fYS9NiLg.js} +1 -1
- package/dist/packem_shared/DataBrowser-C4J4gVUu.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-CSttudUx.js +1 -0
- package/dist/packem_shared/{HomePanel-Dcs4a3Ax.js → HomePanel-BYsfMhKh.js} +1 -1
- package/dist/packem_shared/{MigrationsPanel-C2OnsqRb.js → MigrationsPanel-2JbQ2HwG.js} +1 -1
- package/dist/packem_shared/{Studio-B26_pT8J.js → Studio-Ba9x0dG_.js} +1 -1
- package/dist/packem_shared/{StudioApp-bXhJeLlZ.js → StudioApp-B_PRdg4h.js} +1 -1
- package/dist/packem_shared/{cf-links-gbDy51nR.js → cf-links-Dmg86v1D.js} +1 -1
- package/dist/packem_shared/{home-panel-CU6MWLHG.js → home-panel-B60-5YfI.js} +1 -1
- package/dist/packem_shared/stat-card-fm_TF1mo.js +1 -0
- package/dist/packem_shared/studio-CPuoAmjh.js +2 -0
- package/dist/packem_shared/table-list-sidebar-BRv3hTLX.js +1 -0
- package/dist/packem_shared/{use-sql-assistant-CHEu2-Rk.js → use-sql-assistant-BLG9unQN.js} +1 -1
- package/dist/standalone/{chunk-RQ7AFLIV.js → chunk-2QSHLBCO.js} +1 -1
- package/dist/standalone/{chunk-33CL6OHR.js → chunk-5SQRE3VR.js} +1 -1
- package/dist/standalone/{chunk-5CVJS7ON.js → chunk-6QP5N57V.js} +1 -1
- package/dist/standalone/{chunk-JRMMYIAF.js → chunk-74DN6HIE.js} +1 -1
- package/dist/standalone/{chunk-KZ3ALMMP.js → chunk-7H7LZRLP.js} +1 -1
- package/dist/standalone/chunk-7L7FXGJU.js +1 -0
- package/dist/standalone/{chunk-FOBRNWBG.js → chunk-7YKWP4QK.js} +1 -1
- package/dist/standalone/{chunk-T7IUZIF4.js → chunk-7ZUQE3KU.js} +1 -1
- package/dist/standalone/{chunk-P4YLIBCN.js → chunk-A3KUNMU6.js} +1 -1
- package/dist/standalone/{chunk-S2VVR7HI.js → chunk-B2H5DK55.js} +1 -1
- package/dist/standalone/{chunk-FNPJ7GJZ.js → chunk-BDJCCVB6.js} +1 -1
- package/dist/standalone/{chunk-KJB7YAKB.js → chunk-C7EOC2WS.js} +1 -1
- package/dist/standalone/{chunk-KLQYC6CC.js → chunk-CGLS2ILT.js} +1 -1
- package/dist/standalone/{chunk-RJP3WBZ4.js → chunk-CU6SCYQ7.js} +1 -1
- package/dist/standalone/chunk-DGBJE7YF.js +4 -0
- package/dist/standalone/{chunk-G6PSMGLD.js → chunk-DOZAODYC.js} +1 -1
- package/dist/standalone/chunk-EQZTSISX.js +1 -0
- package/dist/standalone/chunk-ERMTJYQF.js +1 -0
- package/dist/standalone/{chunk-QZGTH6WH.js → chunk-GB6LP6UJ.js} +1 -1
- package/dist/standalone/{chunk-GYKVBKT5.js → chunk-GM67EQJU.js} +1 -1
- package/dist/standalone/chunk-GN567L2T.js +1 -0
- package/dist/standalone/{chunk-L7R74G63.js → chunk-GWHM4C4N.js} +1 -1
- package/dist/standalone/{chunk-JLOWAJRR.js → chunk-GWQIPIYA.js} +1 -1
- package/dist/standalone/{chunk-6YTSSIEJ.js → chunk-HEB6GQQ6.js} +1 -1
- package/dist/standalone/chunk-HOR3JLUY.js +6 -0
- package/dist/standalone/{chunk-7LWMHTJ3.js → chunk-I6A5C46N.js} +1 -1
- package/dist/standalone/chunk-JOFD43OI.js +1 -0
- package/dist/standalone/{chunk-H6YOWRFB.js → chunk-KAPSM6AI.js} +1 -1
- package/dist/standalone/{chunk-6NY7SPDL.js → chunk-KSRP7GZV.js} +1 -1
- package/dist/standalone/chunk-KXSSTTEY.js +1 -0
- package/dist/standalone/chunk-LLF5KWDZ.js +2 -0
- package/dist/standalone/chunk-NRCXRCJX.js +1 -0
- package/dist/standalone/chunk-OE465DVY.js +1 -0
- package/dist/standalone/chunk-PD4LANXJ.js +1 -0
- package/dist/standalone/{chunk-HJ3E4YF5.js → chunk-PXYWCZ7T.js} +1 -1
- package/dist/standalone/{chunk-PZVU2QMX.js → chunk-Q7QTRX2E.js} +1 -1
- package/dist/standalone/{chunk-E3NMX2VU.js → chunk-S4ILMYP5.js} +1 -1
- package/dist/standalone/{chunk-KC44QCN6.js → chunk-SDQBPFLO.js} +1 -1
- package/dist/standalone/chunk-SV52HB7D.js +1 -0
- package/dist/standalone/{chunk-WBYSSCV2.js → chunk-T242WITF.js} +1 -1
- package/dist/standalone/{chunk-VHWOCPRK.js → chunk-TBRZQICB.js} +1 -1
- package/dist/standalone/{chunk-6LNCYDZO.js → chunk-TQXZ7LG4.js} +1 -1
- package/dist/standalone/{chunk-34D36UCW.js → chunk-UDVB4URN.js} +1 -1
- package/dist/standalone/{chunk-6IKEW5LG.js → chunk-UETNCBWU.js} +1 -1
- package/dist/standalone/{chunk-OY2RVUZL.js → chunk-UU2QJMGJ.js} +1 -1
- package/dist/standalone/chunk-VC5SSRUP.js +1 -0
- package/dist/standalone/{chunk-GXSZH7VJ.js → chunk-VCXH5V3Z.js} +1 -1
- package/dist/standalone/{chunk-RNRJKBY3.js → chunk-VTLYN3CX.js} +1 -1
- package/dist/standalone/{chunk-3O3HAXW7.js → chunk-WDG4WFUV.js} +1 -1
- package/dist/standalone/{chunk-3STOIE7Q.js → chunk-WJGOI3FZ.js} +1 -1
- package/dist/standalone/{chunk-W6SAOXGH.js → chunk-WLZ7YPBH.js} +1 -1
- package/dist/standalone/{chunk-2VDFV5TD.js → chunk-WQVVA5NB.js} +1 -1
- package/dist/standalone/{chunk-TTGOOYLF.js → chunk-WZ3B3MEV.js} +1 -1
- package/dist/standalone/{chunk-SKW6J4VW.js → chunk-Y7A5NCXT.js} +1 -1
- package/dist/standalone/{chunk-GAX5IZYG.js → chunk-YTA2HGRD.js} +1 -1
- package/dist/standalone/chunk-ZHBIKP5G.js +1 -0
- package/dist/standalone/{chunk-IHQC7J35.js → chunk-ZI5ZVNIN.js} +1 -1
- package/dist/standalone/{chunk-CCVXYYPJ.js → chunk-ZK3XKFCI.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/packem_shared/ADMIN_FUNCTIONS-BnD4aovm.js +0 -1
- package/dist/packem_shared/DataBrowser-CuRlztBz.js +0 -1
- package/dist/packem_shared/GlobalDataBrowser-DB-vQ2_H.js +0 -1
- package/dist/packem_shared/studio-q-C-acL7.js +0 -2
- package/dist/packem_shared/table-list-sidebar-BFkSQwlB.js +0 -1
- package/dist/standalone/chunk-2GA4SHO7.js +0 -1
- package/dist/standalone/chunk-2WOIRKEI.js +0 -1
- package/dist/standalone/chunk-6PNPIW6I.js +0 -2
- package/dist/standalone/chunk-6YI4WJO4.js +0 -1
- package/dist/standalone/chunk-A74VSSA2.js +0 -4
- package/dist/standalone/chunk-CT5MMH4O.js +0 -1
- package/dist/standalone/chunk-GB6U2BPU.js +0 -1
- package/dist/standalone/chunk-GEDMLM4A.js +0 -6
- package/dist/standalone/chunk-S252DAFP.js +0 -1
- package/dist/standalone/chunk-XS5LDR52.js +0 -1
- package/dist/standalone/chunk-YJYTMQJI.js +0 -1
- package/dist/standalone/chunk-Z2V42P7J.js +0 -1
- /package/dist/standalone/{chunk-SKHEGARW.js → chunk-XF2B7P5A.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as me,e as _}from"./chunk-Y5Y7DHFW.js";import{a as ue}from"./chunk-CTNB2KIA.js";import"./chunk-CU55Y5TV.js";import"./chunk-4UOFSGUS.js";import"./chunk-ILNELDFC.js";import{a as de}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{b as P}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as M}from"./chunk-ERMTJYQF.js";import{c as ce}from"./chunk-XDAT7LHC.js";import{f as ne,g as oe}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as A}from"./chunk-UZERI5YC.js";import{d as D,f as j,g as W,h as X,m as K,q as ie}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as h,e as I,f as qe,g as ae,h as le,j as q}from"./chunk-3XIESWL4.js";var Z=I(ae(),1);var f=I(qe(),1);var fe=I(ae(),1);var $=I(le(),1);var Me={connected:"bg-success",connecting:"bg-warning",idle:"bg-muted-foreground",offline:"bg-destructive"},pe=h(()=>{let t=(0,fe.c)(16),e=D(),a=oe(),s;e:switch(a){case"connected":{let n;t[0]!==e?(n=e("Connected"),t[0]=e,t[1]=n):n=t[1],s=n;break e}case"connecting":{let n;t[2]!==e?(n=e("Connecting\u2026"),t[2]=e,t[3]=n):n=t[3],s=n;break e}case"idle":{let n;t[4]!==e?(n=e("Idle"),t[4]=e,t[5]=n):n=t[5],s=n;break e}case"offline":{let n;t[6]!==e?(n=e("Offline"),t[6]=e,t[7]=n):n=t[7],s=n;break e}default:s=a}let l=Me[a],c;t[8]!==l?(c=q("size-2 rounded-full",l),t[8]=l,t[9]=c):c=t[9];let o;t[10]!==c?(o=(0,$.jsx)("span",{"aria-hidden":"true",className:c}),t[10]=c,t[11]=o):o=t[11];let i;return t[12]!==a||t[13]!==o||t[14]!==s?(i=(0,$.jsxs)("span",{"aria-live":"polite",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","data-status":a,"data-testid":"dash-connection",role:"status",children:[o,s]}),t[12]=a,t[13]=o,t[14]=s,t[15]=i):i=t[15],i},"j");var r=I(le(),1);var Ae={crit:"destructive",ok:"secondary",warn:"default"},U=h((t,e)=>e===0?"\u2014":`${(t/e*100).toFixed(1)}%`,"_"),Y=h((t,e,a)=>Number.isNaN(t)?"ok":t>=a?"crit":t>=e?"warn":"ok","V"),xe=.01,ve=.05,je=h(t=>{let e=(0,Z.c)(36),{errorCount:a,logsError:s,topErrors:l,worstFunctions:c}=t,o=D(),i;e[0]!==o?(i=o("Functions by error rate"),e[0]=o,e[1]=i):i=e[1];let n;e[2]!==i?(n=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[2]=i,e[3]=n):n=e[3];let p;e[4]!==o||e[5]!==c?(p=c.length===0?(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-functions-empty",children:o("No function activity yet.")}):(0,r.jsx)("ul",{className:"divide-y divide-border",children:c.map(w=>(0,r.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs","data-testid":"hl-fn-row",children:[(0,r.jsx)("span",{className:"truncate font-mono text-foreground",children:w.path}),(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsx)("span",{className:"tabular-nums text-muted-foreground",children:o("{count} calls",{count:w.calls.toString()})}),(0,r.jsx)(P,{variant:Ae[Y(w.errors/w.calls,xe,ve)],children:U(w.errors,w.calls)})]})]},w.path))}),e[4]=o,e[5]=c,e[6]=p):p=e[6];let g;e[7]!==n||e[8]!==p?(g=(0,r.jsxs)(A,{className:"gap-0 py-0","data-testid":"hl-functions",children:[n,p]}),e[7]=n,e[8]=p,e[9]=g):g=e[9];let N;e[10]!==o?(N=o("Recent errors"),e[10]=o,e[11]=N):N=e[11];let d;e[12]!==N?(d=(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:N}),e[12]=N,e[13]=d):d=e[13];let u=a>0?"destructive":"outline",x;e[14]!==a||e[15]!==u?(x=(0,r.jsx)(P,{"data-testid":"hl-error-count",variant:u,children:a}),e[14]=a,e[15]=u,e[16]=x):x=e[16];let v;e[17]!==d||e[18]!==x?(v=(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[d,x]}),e[17]=d,e[18]=x,e[19]=v):v=e[19];let k;e[20]!==s?(k=s!==null&&(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"hl-logs-error",role:"alert",children:s}),e[20]=s,e[21]=k):k=e[21];let S;e[22]!==s||e[23]!==o||e[24]!==l.length?(S=s===null&&l.length===0&&(0,r.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"hl-errors-empty",children:o("No recent errors.")}),e[22]=s,e[23]=o,e[24]=l.length,e[25]=S):S=e[25];let E;e[26]!==l?(E=l.length>0&&(0,r.jsx)("ul",{className:"divide-y divide-border",children:l.map(Ce)}),e[26]=l,e[27]=E):E=e[27];let b;e[28]!==k||e[29]!==S||e[30]!==E||e[31]!==v?(b=(0,r.jsxs)(A,{className:"gap-0 py-0",children:[v,k,S,E]}),e[28]=k,e[29]=S,e[30]=E,e[31]=v,e[32]=b):b=e[32];let y;return e[33]!==b||e[34]!==g?(y=(0,r.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[g,b]}),e[33]=b,e[34]=g,e[35]=y):y=e[35],y},"Se");function Ce(t,e){return(0,r.jsxs)("li",{className:"flex flex-col gap-0.5 px-4 py-2 text-xs","data-testid":"hl-error-row",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("time",{className:"shrink-0 text-muted-foreground",children:ie(t.timestamp)}),t.functionPath!==void 0&&(0,r.jsx)("span",{className:"truncate font-mono text-foreground",children:t.functionPath})]}),(0,r.jsx)("span",{className:"text-destructive",children:t.message})]},`${t.timestamp.toString()}-${e.toString()}`)}h(Ce,"Ee");var he={completed:0,failed:2,in_progress:1},Ie=h(t=>{let e=0,a=0,s=0,l=0,c=[];for(let{metrics:o}of t){if(o===null){l+=1;continue}s+=1,e+=o.requests,a+=o.errors,c.push(...o.history??[])}return{errors:a,failed:l,history:c,reachable:s,requests:e}},"Me"),De=h(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.path);if(l===void 0){e.set(s.path,{...s});continue}l.calls+=s.calls,l.errors+=s.errors,l.totalDurationMs+=s.totalDurationMs,l.scans=(l.scans??0)+(s.scans??0),l.maxDurationMs=Math.max(l.maxDurationMs,s.maxDurationMs),l.lastCalledAt=Math.max(l.lastCalledAt,s.lastCalledAt),(s.lastErrorAt??0)>(l.lastErrorAt??0)&&(l.lastErrorAt=s.lastErrorAt,l.lastErrorMessage=s.lastErrorMessage)}return[...e.values()]},"qe"),Pe=h(t=>{let e=new Map;for(let a of t)for(let s of a){let l=e.get(s.id);if(l===void 0){e.set(s.id,s);continue}let c=he[s.status]-he[l.status];(c>0||c===0&&(s.updatedAt??0)>(l.updatedAt??0))&&e.set(s.id,s)}return[...e.values()]},"$e"),Fe=j(M.getAuthMetrics),Le=j(M.getFunctionStats),Te=j(M.getLogs),Re=j(M.getMetrics),ze=j(M.migrationStatus),Oe=5,ge=2e3,Ke=5,_e=.1,$e=.3,He=1,Ue=50,Ge=h((t,e,a)=>t>=a?"crit":t>=e?"warn":"ok","_e"),Qe=h(t=>{let e=new Map;for(let s of t??[]){let l=e.get(s.bucketMs)??{calls:0,errors:0};l.calls+=s.calls,l.errors+=s.errors,e.set(s.bucketMs,l)}let a=[...e.entries()].toSorted((s,l)=>s[0]-l[0]);return{errors:a.map(([,s])=>s.errors),requests:a.map(([,s])=>s.calls)}},"ze"),Je=h(t=>{let e=0,a=0;for(let l of t)l.status==="failed"?e+=1:l.status==="in_progress"&&(a+=1);let s="ok";return e>0?s="crit":a>0&&(s="warn"),{failed:e,level:s,running:a}},"Ke"),Ve=h((t,e)=>t.failed>0?e("{count} failed",{count:t.failed.toString()}):t.running>0?e("{count} running",{count:t.running.toString()}):e("OK"),"He"),Ne={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},be={crit:"text-destructive",ok:"text-foreground",warn:"text-warning"},We={crit:"bg-destructive/10 text-destructive",ok:"bg-success/10 text-success",warn:"bg-warning/10 text-warning"},Xe=h(t=>t.includes("crit")?"crit":t.includes("warn")?"warn":"ok","Be"),H=h(t=>{let e=(0,Z.c)(19),{chart:a,label:s,level:l,testId:c,value:o}=t,i=Ne[l],n;e[0]!==i?(n=q("size-1.5 shrink-0 rounded-full",i),e[0]=i,e[1]=n):n=e[1];let p;e[2]!==n?(p=(0,r.jsx)("span",{"aria-hidden":"true",className:n}),e[2]=n,e[3]=p):p=e[3];let g;e[4]!==s||e[5]!==p?(g=(0,r.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[p,s]}),e[4]=s,e[5]=p,e[6]=g):g=e[6];let N=be[l],d;e[7]!==N?(d=q("truncate text-2xl font-semibold tabular-nums",N),e[7]=N,e[8]=d):d=e[8];let u;e[9]!==d||e[10]!==c||e[11]!==o?(u=(0,r.jsx)("span",{className:d,"data-testid":c,children:o}),e[9]=d,e[10]=c,e[11]=o,e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==u?(x=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[u,a]}),e[13]=a,e[14]=u,e[15]=x):x=e[15];let v;return e[16]!==g||e[17]!==x?(v=(0,r.jsx)(A,{className:"gap-0 py-0",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[g,x]})}),e[16]=g,e[17]=x,e[18]=v):v=e[18],v},"T"),Ye=h(async(t,e,a)=>{let s=await Promise.all(a.map(d=>{let u=W(d);return Promise.allSettled([t.query(Re,{},u),t.query(Le,{},u),t.query(ze,{},u)])})),l=W(e),c=typeof t.schedulerStatus=="function"?t.schedulerStatus():Promise.reject(new Error("scheduler status unavailable")),[o,i,n]=await Promise.allSettled([t.query(Te,{},l),t.query(Fe,{},l),c]),p=s.map(([d,u,x])=>({functions:u.status==="fulfilled"?u.value.functions:[],metrics:d.status==="fulfilled"?d.value:null,migrations:x.status==="fulfilled"?x.value.migrations:[]})),g=Ie(p),N=s[0]?.[0];return{auth:i.status==="fulfilled"?i.value:null,entries:o.status==="fulfilled"?o.value.entries:[],functions:De(p.map(d=>d.functions)),logsError:o.status==="rejected"?X(o.reason):null,metricsError:g.reachable===0&&N?.status==="rejected"?X(N.reason):null,migrations:Pe(p.map(d=>d.migrations)),scheduler:n.status==="fulfilled"?n.value:null,totals:g}},"Ge"),Ze=h(t=>{let e=t?.history??[];return{attempts:e.map(a=>a.attempts),failures:e.map(a=>a.failures)}},"Qe"),xt=h(({initialShardKey:t})=>{let e=ne(),a=D(),[s,l]=(0,f.useState)([]),[c,o]=(0,f.useState)(null),[i,n]=(0,f.useState)(null),[p,g]=(0,f.useState)(null),[N,d]=(0,f.useState)([]),[u,x]=(0,f.useState)(null),[v,k]=(0,f.useState)(null),[S,E]=(0,f.useState)([]),[b]=(0,f.useState)(de),y=(0,f.useRef)(!1),w=(0,f.useRef)(!0);(0,f.useEffect)(()=>(w.current=!0,()=>{w.current=!1}),[]);let F=t??"",L=(0,f.useCallback)(async()=>{if(y.current)return;y.current=!0;let m=await Ye(e,F,me(F,b));if(!w.current){y.current=!1;return}n(m.totals),g(m.metricsError),d(m.functions),E(m.migrations),l(m.entries),o(m.logsError),x(m.auth),k(m.scheduler),y.current=!1},[e,b,F]);(0,f.useEffect)(()=>{K(L())},[L]);let G=(0,f.useRef)(0),C=(0,f.useRef)(null),we=h(()=>{let m=Date.now()-G.current;if(m>=ge){G.current=Date.now(),K(L());return}C.current===null&&(C.current=setTimeout(()=>{C.current=null,G.current=Date.now(),K(L())},ge-m))},"de");(0,f.useEffect)(()=>()=>{C.current!==null&&clearTimeout(C.current)},[]);let{data:B,liveError:ye}=ce(M.getMetrics,{},{live:!0,shardKey:F});(0,f.useEffect)(()=>{B!==void 0&&we()},[B]);let ee=s.filter(m=>m.level==="error"),ke=ee.slice(0,Oe),T=Qe(i?.history),te=Ze(u),Se=N.filter(m=>m.calls>0).toSorted((m,V)=>V.errors/V.calls-m.errors/m.calls||V.calls-m.calls).slice(0,Ke),Q=Je(S),Ee=i===null||i.requests===0?0:i.errors/i.requests,J=Y(Ee,xe,ve),re=u===null?"ok":Y(u.failureRate,_e,$e),se=v===null?"ok":Ge(v.backlog,He,Ue),R=Xe([J,re,se,Q.level]),z,O;return R==="crit"?(z=a("Critical"),O=a("One or more service levels are breached.")):R==="warn"?(z=a("Degraded"),O=a("Some service levels need attention.")):(z=a("All systems healthy"),O=a("All service levels are within target.")),(0,r.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-health",children:[(0,r.jsxs)(A,{className:"gap-0 py-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:q("flex size-10 shrink-0 items-center justify-center rounded-full",We[R]),children:(0,r.jsx)("span",{className:q("size-3 rounded-full",Ne[R])})}),(0,r.jsxs)("div",{className:"grid leading-tight",children:[(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"hl-status",children:z}),(0,r.jsx)("span",{className:"text-[13px] text-muted-foreground",children:O})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,r.jsxs)("div",{className:"text-end",children:[(0,r.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Requests")}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[T.requests.length>=2&&(0,r.jsx)(_,{ariaLabel:a("Requests over time"),className:"h-6 w-20 text-foreground",series:T.requests,testId:"hl-spark-requests"}),(0,r.jsx)("span",{className:"text-lg font-semibold tabular-nums text-foreground","data-testid":"hl-requests",children:(i?.requests??0).toString()})]})]}),(0,r.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),(0,r.jsxs)("div",{className:"text-end",children:[(0,r.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:a("Error rate")}),(0,r.jsx)("div",{className:q("text-lg font-semibold tabular-nums",be[J]),"data-testid":"hl-error-rate",children:i===null?"\u2014":U(i.errors,i.requests)})]}),(0,r.jsx)("span",{"aria-hidden":"true",className:"h-9 w-px bg-border"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(pe,{}),(0,r.jsx)(ue,{message:ye,prefix:"hl"})]})]})]}),p!==null&&(0,r.jsx)("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive","data-testid":"hl-metrics-error",role:"alert",children:p})]}),(0,r.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"hl-slo",children:[(0,r.jsx)(H,{chart:T.errors.length>=2?(0,r.jsx)(_,{ariaLabel:a("Errors over time"),className:"h-7 w-20 text-destructive",series:T.errors,testId:"hl-spark-errors"}):void 0,label:a("Error rate"),level:J,testId:"hl-slo-errorrate",value:i===null?"\u2014":U(i.errors,i.requests)}),(0,r.jsx)(H,{chart:te.failures.length>=2?(0,r.jsx)(_,{ariaLabel:a("Auth failures over time"),className:"h-7 w-20 text-destructive",series:te.failures,testId:"hl-spark-auth"}):void 0,label:a("Auth failures"),level:re,testId:"hl-slo-auth",value:u===null?"\u2014":U(u.failures,u.attempts)}),(0,r.jsx)(H,{label:a("Scheduler backlog"),level:se,testId:"hl-slo-backlog",value:v===null?"\u2014":v.backlog.toString()}),(0,r.jsx)(H,{label:a("Migrations"),level:Q.level,testId:"hl-slo-migrations",value:Ve(Q,a)})]}),(0,r.jsx)(je,{errorCount:ee.length,logsError:c,topErrors:ke,worstFunctions:Se}),(0,r.jsxs)(A,{className:"gap-0 py-0",children:[(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Shards seen")}),(0,r.jsx)(P,{"data-testid":"hl-shard-count",variant:"outline",children:b.length})]}),b.length>0&&(0,r.jsx)("ul",{className:"flex flex-wrap gap-1.5 p-4",children:b.map(m=>(0,r.jsx)("li",{"data-testid":"hl-shard",children:(0,r.jsx)(P,{variant:"secondary",children:m})},m))})]})]})},"dt");export{xt as HealthPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as h}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{b as S}from"./chunk-XDAT7LHC.js";import{f as k}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as y,e as A}from"./chunk-UZERI5YC.js";import{d as I}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as u,e as w,g as $,h as j}from"./chunk-3XIESWL4.js";var N=w($(),1);var a=w(j(),1);var z=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),g=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:r}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let n;i[2]!==t?(n=(0,a.jsx)(A,{className:"p-3",children:t}),i[2]=t,i[3]=n):n=i[3];let c;return i[4]!==l||i[5]!==n||i[6]!==r?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":r,children:[l,n]}),i[4]=l,i[5]=n,i[6]=r,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,r;i[0]!==t?(r=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=r):r=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let n;return i[4]!==r||i[5]!==l?(n=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[r,l]}),i[4]=r,i[5]=l,i[6]=n):n=i[6],n},"c"),T=u(()=>{let e=(0,N.c)(20),i=k(),t=I(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let r;e[1]!==i?(r=u(()=>i.getAuthConfig(),"s"),e[1]=i,e[2]=r):r=e[2];let{data:l,error:n}=S(d,r),c;e[3]!==t?(c=u(s=>(0,a.jsx)(h,{variant:s?"success":"outline",children:t(s?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,p;e[5]!==n?(p=n!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:n}),e[5]=n,e[6]=p):p=e[6];let f;e[7]!==l||e[8]!==n||e[9]!==t?(f=n===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=n,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==n||e[13]!==m||e[14]!==t?(x=n===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:z.map(s=>{let P=l.capabilities[s.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${s.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(s.label)}),m(P)]},s.key)})})}),(0,a.jsx)(g,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(L)})}),(0,a.jsx)(g,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(q)})})]})}),l.organization.enabled&&(0,a.jsx)(g,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(g,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(g,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(g,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(s=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${s.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:s.name}),s.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:s.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:s.type}),s.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),s.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},s.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=n,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==p||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[p,f,x]}),e[16]=p,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"M");function L(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(L,"P");function q(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(q,"z");export{T as AuthConfigPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as We,b as qe,c as De,d as Oe,e as be}from"./chunk-OY2RVUZL.js";import"./chunk-2PJNAWB3.js";import{a as Re}from"./chunk-U6TNNM5U.js";import{a as Ve}from"./chunk-CTNB2KIA.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import"./chunk-RQ7AFLIV.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import{a as ze}from"./chunk-LFKCLLPT.js";import"./chunk-T6VMSOBB.js";import"./chunk-QLQADHFE.js";import{c as _e}from"./chunk-XDAT7LHC.js";import{a as Le,b as je,c as Fe,d as pe,e as q,f as R}from"./chunk-MIQTKZAR.js";import{a as Me,e as Ae}from"./chunk-UZERI5YC.js";import"./chunk-QBWRC5YX.js";import{a as Ke}from"./chunk-X665E2HU.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as ke}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as ne}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as me}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as D}from"./chunk-2WOIRKEI.js";import{f as Ne}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as Ce}from"./chunk-XQCVZAGU.js";import{d as ue,f as oe,g as we,h as Ee,m as de,q as Te}from"./chunk-OG4N2XHD.js";import{a as Ie,b as $e}from"./chunk-AADILRJW.js";import{a as o,e as ye,f as Be,g as Ge,h as He}from"./chunk-3XIESWL4.js";var ge=ye(Ge(),1);var O=ye(Be(),1);var t=ye(He(),1);var Se="none",Pe=["all","open","resolved","ignored"],Je=["critical","high","medium","low"],Qe=oe(D.resolveIssue),Xe=oe(D.ignoreIssue),Ue=oe(D.assignIssue),Ye=oe(D.setIssueSeverity),Ze=oe(D.explainIssue),es=o(n=>Array.isArray(n?.issues)?n.issues:[],"Xe"),ss=o(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Ye"),ts=o(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Ze"),as=o(n=>{let e=(0,ge.c)(44),{expanded:d,issue:s,shardKey:$}=n,i=Ne(),r=ue(),[a,C]=(0,O.useState)(void 0),{busy:E,error:T,run:F}=Re(),_;e[0]!==i||e[1]!==s||e[2]!==F||e[3]!==$?(_=o(()=>{C(void 0),F(async()=>{let f={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},I=await i.query(Ze,f,we($));C(I)})},"E"),e[0]=i,e[1]=s,e[2]=F,e[3]=$,e[4]=_):_=e[4];let K=_;if(!d)return null;let h;if(e[5]!==s.sampleMessage){let f=$e(s.sampleMessage);h=f===void 0?void 0:Ie(f.body),e[5]=s.sampleMessage,e[6]=h}else h=e[6];let M=h,z=`issues-detail-${s.hash}`,c;e[7]!==s.sampleMessage?(c=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=c):c=e[8];let x;e[9]!==r?(x=r("Suggested fix"),e[9]=r,e[10]=x):x=e[10];let y;e[11]!==x?(y=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=y):y=e[12];let w;e[13]!==M||e[14]!==s.hash||e[15]!==r?(w=M===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:r("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:M}),e[13]=M,e[14]=s.hash,e[15]=r,e[16]=w):w=e[16];let u;e[17]!==y||e[18]!==w?(u=(0,t.jsxs)("div",{children:[y,w]}),e[17]=y,e[18]=w,e[19]=u):u=e[19];let A=`issues-explain-${s.hash}`,m;e[20]!==E||e[21]!==r?(m=r(E?"Explaining\u2026":"Explain in plain language"),e[20]=E,e[21]=r,e[22]=m):m=e[22];let b;e[23]!==E||e[24]!==K||e[25]!==m||e[26]!==A?(b=(0,t.jsx)("div",{children:(0,t.jsx)(ne,{"data-testid":A,disabled:E,onClick:K,size:"sm",type:"button",variant:"outline",children:m})}),e[23]=E,e[24]=K,e[25]=m,e[26]=A,e[27]=b):b=e[27];let p;e[28]!==T||e[29]!==s.hash?(p=T!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:T}),e[28]=T,e[29]=s.hash,e[30]=p):p=e[30];let v;e[31]!==a||e[32]!==s.hash||e[33]!==r?(v=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?r("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):r("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:r("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:r("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:r("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=r,e[34]=v):v=e[34];let g;e[35]!==b||e[36]!==p||e[37]!==v||e[38]!==c||e[39]!==u?(g=(0,t.jsx)(R,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[c,u,b,p,v]})}),e[35]=b,e[36]=p,e[37]=v,e[38]=c,e[39]=u,e[40]=g):g=e[40];let S;return e[41]!==g||e[42]!==z?(S=(0,t.jsx)(pe,{"data-testid":z,children:g}),e[41]=g,e[42]=z,e[43]=S):S=e[43],S},"et"),is=o(n=>{let e=(0,ge.c)(119),{busy:d,issue:s,rowError:$,runTriage:i,shardKey:r}=n,a=ue(),[C,E]=(0,O.useState)(!1),T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o(()=>{E(ls)},"_"),e[0]=T):T=e[0];let F=T,_;e[1]!==s.hash||e[2]!==i?(_=o(re=>{let ce=re===null||re===Se?null:re;de(i(s.hash,Ye,{severity:ce}))},"E"),e[1]=s.hash,e[2]=i,e[3]=_):_=e[3];let K=_,h;e[4]!==s.hash||e[5]!==i?(h=o(re=>{if(re.key!=="Enter")return;let ce=re.currentTarget.value.trim();de(i(s.hash,Ue,{assignee:ce===""?null:ce}))},"d"),e[4]=s.hash,e[5]=i,e[6]=h):h=e[6];let M=h,z=`issues-row-${s.hash}`,c;e[7]!==a?(c=a("Toggle issue details"),e[7]=a,e[8]=c):c=e[8];let x=`issues-toggle-${s.hash}`,y=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${C?"rotate-90":""}`,w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=w):w=e[9];let u;e[10]!==y?(u=(0,t.jsx)("svg",{"aria-hidden":"true",className:y,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:w}),e[10]=y,e[11]=u):u=e[11];let A;e[12]!==s.title?(A=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=A):A=e[13];let m;e[14]!==s.culprit?(m=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=m):m=e[15];let b;e[16]!==A||e[17]!==m?(b=(0,t.jsxs)("span",{className:"min-w-0",children:[A,m]}),e[16]=A,e[17]=m,e[18]=b):b=e[18];let p;e[19]!==C||e[20]!==b||e[21]!==c||e[22]!==x||e[23]!==u?(p=(0,t.jsxs)("button",{"aria-expanded":C,"aria-label":c,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:F,type:"button",children:[u,b]}),e[19]=C,e[20]=b,e[21]=c,e[22]=x,e[23]=u,e[24]=p):p=e[24];let v;e[25]!==s.hash||e[26]!==$?(v=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=v):v=e[27];let g;e[28]!==p||e[29]!==v?(g=(0,t.jsxs)(R,{className:"max-w-80",children:[p,v]}),e[28]=p,e[29]=v,e[30]=g):g=e[30];let S=`issues-status-${s.hash}`,f;e[31]!==s.status?(f=ss(s.status),e[31]=s.status,e[32]=f):f=e[32];let I;e[33]!==s.status||e[34]!==S||e[35]!==f?(I=(0,t.jsx)(R,{children:(0,t.jsx)(me,{"data-testid":S,variant:f,children:s.status})}),e[33]=s.status,e[34]=S,e[35]=f,e[36]=I):I=e[36];let j=s.severity??Se,L;e[37]!==a?(L=a("Set severity"),e[37]=a,e[38]=L):L=e[38];let l=`issues-severity-${s.hash}`,V;e[39]!==a?(V=a("\u2014"),e[39]=a,e[40]=V):V=e[40];let W;e[41]!==s.severity||e[42]!==a?(W=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=W):W=e[43];let N;e[44]!==V||e[45]!==W?(N=(0,t.jsx)(qe,{placeholder:V,children:W}),e[44]=V,e[45]=W,e[46]=N):N=e[46];let k;e[47]!==L||e[48]!==l||e[49]!==N?(k=(0,t.jsx)(De,{"aria-label":L,className:"h-7 w-[110px]","data-testid":l,children:N}),e[47]=L,e[48]=l,e[49]=N,e[50]=k):k=e[50];let U;e[51]===Symbol.for("react.memo_cache_sentinel")?(U=Je.map(rs),e[51]=U):U=e[51];let B;e[52]!==a?(B=a("Clear"),e[52]=a,e[53]=B):B=e[53];let G;e[54]!==B?(G=(0,t.jsxs)(Oe,{children:[U,(0,t.jsx)(be,{value:Se,children:B})]}),e[54]=B,e[55]=G):G=e[55];let H;e[56]!==d||e[57]!==K||e[58]!==j||e[59]!==k||e[60]!==G?(H=(0,t.jsx)(R,{children:(0,t.jsxs)(We,{disabled:d,onValueChange:K,value:j,children:[k,G]})}),e[56]=d,e[57]=K,e[58]=j,e[59]=k,e[60]=G,e[61]=H):H=e[61];let P;e[62]!==a?(P=a("Assignee"),e[62]=a,e[63]=P):P=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",J;e[64]!==a?(J=a("Unassigned"),e[64]=a,e[65]=J):J=e[65];let Q;e[66]!==d||e[67]!==M||e[68]!==P||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==J?(Q=(0,t.jsx)(R,{children:(0,t.jsx)(ke,{"aria-label":P,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:d,onKeyDown:M,placeholder:J},ve)}),e[66]=d,e[67]=M,e[68]=P,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=J,e[73]=Q):Q=e[73];let X;e[74]!==s.count?(X=(0,t.jsx)(R,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=X):X=e[75];let Y;e[76]!==s.lastSeen?(Y=Te(s.lastSeen),e[76]=s.lastSeen,e[77]=Y):Y=e[77];let Z;e[78]!==Y?(Z=(0,t.jsx)(R,{className:"text-xs tabular-nums text-muted-foreground",children:Y}),e[78]=Y,e[79]=Z):Z=e[79];let ee;e[80]!==d||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(ee=s.status!=="resolved"&&(0,t.jsx)(ne,{"data-testid":`issues-resolve-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=d,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=ee):ee=e[85];let se;e[86]!==d||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(se=s.status!=="ignored"&&(0,t.jsx)(ne,{"data-testid":`issues-ignore-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=d,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=se):se=e[91];let te;e[92]!==d||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(te=s.status!=="open"&&(0,t.jsx)(ne,{"data-testid":`issues-reopen-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Ue,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=d,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=te):te=e[98];let ae;e[99]!==ee||e[100]!==se||e[101]!==te?(ae=(0,t.jsx)(R,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[ee,se,te]})}),e[99]=ee,e[100]=se,e[101]=te,e[102]=ae):ae=e[102];let ie;e[103]!==g||e[104]!==I||e[105]!==H||e[106]!==Q||e[107]!==X||e[108]!==Z||e[109]!==z||e[110]!==ae?(ie=(0,t.jsxs)(pe,{"data-testid":z,children:[g,I,H,Q,X,Z,ae]}),e[103]=g,e[104]=I,e[105]=H,e[106]=Q,e[107]=X,e[108]=Z,e[109]=z,e[110]=ae,e[111]=ie):ie=e[111];let le;e[112]!==C||e[113]!==s||e[114]!==r?(le=(0,t.jsx)(as,{expanded:C,issue:s,shardKey:r},s.sampleMessage),e[112]=C,e[113]=s,e[114]=r,e[115]=le):le=e[115];let he;return e[116]!==ie||e[117]!==le?(he=(0,t.jsxs)(t.Fragment,{children:[ie,le]}),e[116]=ie,e[117]=le,e[118]=he):he=e[118],he},"tt"),ks=o(n=>{let e=(0,ge.c)(38),{initialShardKey:d}=n,s=ue(),$=Ne(),[i,r]=(0,O.useState)(d??""),[a,C]=(0,O.useState)("all"),[E,T]=(0,O.useState)(ns),[F,_]=(0,O.useState)(os),K;e[0]!==i?(K=i.trim(),e[0]=i,e[1]=K):K=e[1];let h=ze(K,400),M;e[2]!==a?(M=a==="all"?{}:{status:a},e[2]=a,e[3]=M):M=e[3];let z;e[4]!==h?(z={live:!0,shardKey:h},e[4]=h,e[5]=z):z=e[5];let{data:c,error:x,liveError:y}=_e(D.getIssues,M,z),w=c!==void 0,u;if(e[6]!==F||e[7]!==E||e[8]!==$||e[9]!==c||e[10]!==h||e[11]!==x||e[12]!==y||e[13]!==w||e[14]!==i||e[15]!==a||e[16]!==s){let A=es(c),m;e[18]!==$||e[19]!==h?(m=o(async(l,V,W)=>{_(N=>{if(!N.has(l))return N;let k=new Map(N);return k.delete(l),k}),T(N=>new Set(N).add(l));try{await $.query(V,{...W,hash:l},we(h))}catch(N){let k=Ee(N);_(U=>new Map(U).set(l,k))}T(N=>{let k=new Set(N);return k.delete(l),k})},"u"),e[18]=$,e[19]=h,e[20]=m):m=e[20];let b=m,p;e[21]!==s?(p=o(l=>s(l==="all"?"All":l==="open"?"Open":l==="resolved"?"Resolved":"Ignored"),"m"),e[21]=s,e[22]=p):p=e[22];let v=p,g;e[23]!==x?(g=x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:x}),e[23]=x,e[24]=g):g=e[24];let S;e[25]!==i?(S=(0,t.jsx)(Ke,{onChange:r,testId:"issues-shard-input",value:i}),e[25]=i,e[26]=S):S=e[26];let f;e[27]!==y?(f=(0,t.jsx)(Ve,{message:y,prefix:"issues"}),e[27]=y,e[28]=f):f=e[28];let I;e[29]!==a||e[30]!==v?(I=Pe.map(l=>(0,t.jsx)(ne,{"data-active":a===l?"":void 0,"data-testid":`issues-filter-${l}`,onClick:o(()=>{C(l)},"onClick"),size:"xs",variant:a===l?"default":"outline",children:v(l)},l)),e[29]=a,e[30]=v,e[31]=I):I=e[31];let j;e[32]!==I?(j=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:I}),e[32]=I,e[33]=j):j=e[33];let L;e[34]!==j||e[35]!==S||e[36]!==f?(L=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[S,f,j]}),e[34]=j,e[35]=S,e[36]=f,e[37]=L):L=e[37],u=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[g,L,w&&A.length===0?(0,t.jsx)(Ce,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ae,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(je,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(q,{children:s("Issue")}),(0,t.jsx)(q,{children:s("Status")}),(0,t.jsx)(q,{children:s("Severity")}),(0,t.jsx)(q,{children:s("Assignee")}),(0,t.jsx)(q,{className:"text-right",children:s("Events")}),(0,t.jsx)(q,{children:s("Last seen")}),(0,t.jsx)(q,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Fe,{children:A.map(l=>(0,t.jsx)(is,{busy:E.has(l.hash),issue:l,rowError:F.get(l.hash),runTriage:b,shardKey:h},l.hash))})]})})})]}),e[6]=F,e[7]=E,e[8]=$,e[9]=c,e[10]=h,e[11]=x,e[12]=y,e[13]=w,e[14]=i,e[15]=a,e[16]=s,e[17]=u}else u=e[17];return u},"kt");function ls(n){return!n}o(ls,"st");function rs(n){return(0,t.jsx)(be,{value:n,children:n},n)}o(rs,"at");function ns(){return new Set}o(ns,"it");function os(){return new Map}o(os,"rt");export{ks as IssuesPanel};
|
|
1
|
+
import{a as We,b as qe,c as De,d as Oe,e as be}from"./chunk-UU2QJMGJ.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as Re}from"./chunk-U6TNNM5U.js";import{a as Ve}from"./chunk-CTNB2KIA.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as Ke}from"./chunk-X665E2HU.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{a as ze}from"./chunk-LFKCLLPT.js";import{R as ke}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as ne}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as me}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as D}from"./chunk-ERMTJYQF.js";import{c as _e}from"./chunk-XDAT7LHC.js";import{f as Ne}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as Ce}from"./chunk-XQCVZAGU.js";import{a as Le,b as je,c as Fe,d as pe,e as q,f as R}from"./chunk-MIQTKZAR.js";import{a as Me,e as Ae}from"./chunk-UZERI5YC.js";import{d as ue,f as oe,g as we,h as Ee,m as de,q as Te}from"./chunk-OG4N2XHD.js";import{a as Ie,b as $e}from"./chunk-AADILRJW.js";import{a as o,e as ye,f as Be,g as Ge,h as He}from"./chunk-3XIESWL4.js";var ge=ye(Ge(),1);var O=ye(Be(),1);var t=ye(He(),1);var Se="none",Pe=["all","open","resolved","ignored"],Je=["critical","high","medium","low"],Qe=oe(D.resolveIssue),Xe=oe(D.ignoreIssue),Ue=oe(D.assignIssue),Ye=oe(D.setIssueSeverity),Ze=oe(D.explainIssue),es=o(n=>Array.isArray(n?.issues)?n.issues:[],"Xe"),ss=o(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Ye"),ts=o(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Ze"),as=o(n=>{let e=(0,ge.c)(44),{expanded:d,issue:s,shardKey:$}=n,i=Ne(),r=ue(),[a,C]=(0,O.useState)(void 0),{busy:E,error:T,run:F}=Re(),_;e[0]!==i||e[1]!==s||e[2]!==F||e[3]!==$?(_=o(()=>{C(void 0),F(async()=>{let f={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},I=await i.query(Ze,f,we($));C(I)})},"E"),e[0]=i,e[1]=s,e[2]=F,e[3]=$,e[4]=_):_=e[4];let K=_;if(!d)return null;let h;if(e[5]!==s.sampleMessage){let f=$e(s.sampleMessage);h=f===void 0?void 0:Ie(f.body),e[5]=s.sampleMessage,e[6]=h}else h=e[6];let M=h,z=`issues-detail-${s.hash}`,c;e[7]!==s.sampleMessage?(c=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=c):c=e[8];let x;e[9]!==r?(x=r("Suggested fix"),e[9]=r,e[10]=x):x=e[10];let y;e[11]!==x?(y=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=y):y=e[12];let w;e[13]!==M||e[14]!==s.hash||e[15]!==r?(w=M===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:r("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:M}),e[13]=M,e[14]=s.hash,e[15]=r,e[16]=w):w=e[16];let u;e[17]!==y||e[18]!==w?(u=(0,t.jsxs)("div",{children:[y,w]}),e[17]=y,e[18]=w,e[19]=u):u=e[19];let A=`issues-explain-${s.hash}`,m;e[20]!==E||e[21]!==r?(m=r(E?"Explaining\u2026":"Explain in plain language"),e[20]=E,e[21]=r,e[22]=m):m=e[22];let b;e[23]!==E||e[24]!==K||e[25]!==m||e[26]!==A?(b=(0,t.jsx)("div",{children:(0,t.jsx)(ne,{"data-testid":A,disabled:E,onClick:K,size:"sm",type:"button",variant:"outline",children:m})}),e[23]=E,e[24]=K,e[25]=m,e[26]=A,e[27]=b):b=e[27];let p;e[28]!==T||e[29]!==s.hash?(p=T!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:T}),e[28]=T,e[29]=s.hash,e[30]=p):p=e[30];let v;e[31]!==a||e[32]!==s.hash||e[33]!==r?(v=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?r("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):r("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:r("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:r("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:r("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=r,e[34]=v):v=e[34];let g;e[35]!==b||e[36]!==p||e[37]!==v||e[38]!==c||e[39]!==u?(g=(0,t.jsx)(R,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[c,u,b,p,v]})}),e[35]=b,e[36]=p,e[37]=v,e[38]=c,e[39]=u,e[40]=g):g=e[40];let S;return e[41]!==g||e[42]!==z?(S=(0,t.jsx)(pe,{"data-testid":z,children:g}),e[41]=g,e[42]=z,e[43]=S):S=e[43],S},"et"),is=o(n=>{let e=(0,ge.c)(119),{busy:d,issue:s,rowError:$,runTriage:i,shardKey:r}=n,a=ue(),[C,E]=(0,O.useState)(!1),T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o(()=>{E(ls)},"_"),e[0]=T):T=e[0];let F=T,_;e[1]!==s.hash||e[2]!==i?(_=o(re=>{let ce=re===null||re===Se?null:re;de(i(s.hash,Ye,{severity:ce}))},"E"),e[1]=s.hash,e[2]=i,e[3]=_):_=e[3];let K=_,h;e[4]!==s.hash||e[5]!==i?(h=o(re=>{if(re.key!=="Enter")return;let ce=re.currentTarget.value.trim();de(i(s.hash,Ue,{assignee:ce===""?null:ce}))},"d"),e[4]=s.hash,e[5]=i,e[6]=h):h=e[6];let M=h,z=`issues-row-${s.hash}`,c;e[7]!==a?(c=a("Toggle issue details"),e[7]=a,e[8]=c):c=e[8];let x=`issues-toggle-${s.hash}`,y=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${C?"rotate-90":""}`,w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=w):w=e[9];let u;e[10]!==y?(u=(0,t.jsx)("svg",{"aria-hidden":"true",className:y,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:w}),e[10]=y,e[11]=u):u=e[11];let A;e[12]!==s.title?(A=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=A):A=e[13];let m;e[14]!==s.culprit?(m=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=m):m=e[15];let b;e[16]!==A||e[17]!==m?(b=(0,t.jsxs)("span",{className:"min-w-0",children:[A,m]}),e[16]=A,e[17]=m,e[18]=b):b=e[18];let p;e[19]!==C||e[20]!==b||e[21]!==c||e[22]!==x||e[23]!==u?(p=(0,t.jsxs)("button",{"aria-expanded":C,"aria-label":c,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:F,type:"button",children:[u,b]}),e[19]=C,e[20]=b,e[21]=c,e[22]=x,e[23]=u,e[24]=p):p=e[24];let v;e[25]!==s.hash||e[26]!==$?(v=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=v):v=e[27];let g;e[28]!==p||e[29]!==v?(g=(0,t.jsxs)(R,{className:"max-w-80",children:[p,v]}),e[28]=p,e[29]=v,e[30]=g):g=e[30];let S=`issues-status-${s.hash}`,f;e[31]!==s.status?(f=ss(s.status),e[31]=s.status,e[32]=f):f=e[32];let I;e[33]!==s.status||e[34]!==S||e[35]!==f?(I=(0,t.jsx)(R,{children:(0,t.jsx)(me,{"data-testid":S,variant:f,children:s.status})}),e[33]=s.status,e[34]=S,e[35]=f,e[36]=I):I=e[36];let j=s.severity??Se,L;e[37]!==a?(L=a("Set severity"),e[37]=a,e[38]=L):L=e[38];let l=`issues-severity-${s.hash}`,V;e[39]!==a?(V=a("\u2014"),e[39]=a,e[40]=V):V=e[40];let W;e[41]!==s.severity||e[42]!==a?(W=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=W):W=e[43];let N;e[44]!==V||e[45]!==W?(N=(0,t.jsx)(qe,{placeholder:V,children:W}),e[44]=V,e[45]=W,e[46]=N):N=e[46];let k;e[47]!==L||e[48]!==l||e[49]!==N?(k=(0,t.jsx)(De,{"aria-label":L,className:"h-7 w-[110px]","data-testid":l,children:N}),e[47]=L,e[48]=l,e[49]=N,e[50]=k):k=e[50];let U;e[51]===Symbol.for("react.memo_cache_sentinel")?(U=Je.map(rs),e[51]=U):U=e[51];let B;e[52]!==a?(B=a("Clear"),e[52]=a,e[53]=B):B=e[53];let G;e[54]!==B?(G=(0,t.jsxs)(Oe,{children:[U,(0,t.jsx)(be,{value:Se,children:B})]}),e[54]=B,e[55]=G):G=e[55];let H;e[56]!==d||e[57]!==K||e[58]!==j||e[59]!==k||e[60]!==G?(H=(0,t.jsx)(R,{children:(0,t.jsxs)(We,{disabled:d,onValueChange:K,value:j,children:[k,G]})}),e[56]=d,e[57]=K,e[58]=j,e[59]=k,e[60]=G,e[61]=H):H=e[61];let P;e[62]!==a?(P=a("Assignee"),e[62]=a,e[63]=P):P=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",J;e[64]!==a?(J=a("Unassigned"),e[64]=a,e[65]=J):J=e[65];let Q;e[66]!==d||e[67]!==M||e[68]!==P||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==J?(Q=(0,t.jsx)(R,{children:(0,t.jsx)(ke,{"aria-label":P,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:d,onKeyDown:M,placeholder:J},ve)}),e[66]=d,e[67]=M,e[68]=P,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=J,e[73]=Q):Q=e[73];let X;e[74]!==s.count?(X=(0,t.jsx)(R,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=X):X=e[75];let Y;e[76]!==s.lastSeen?(Y=Te(s.lastSeen),e[76]=s.lastSeen,e[77]=Y):Y=e[77];let Z;e[78]!==Y?(Z=(0,t.jsx)(R,{className:"text-xs tabular-nums text-muted-foreground",children:Y}),e[78]=Y,e[79]=Z):Z=e[79];let ee;e[80]!==d||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(ee=s.status!=="resolved"&&(0,t.jsx)(ne,{"data-testid":`issues-resolve-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=d,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=ee):ee=e[85];let se;e[86]!==d||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(se=s.status!=="ignored"&&(0,t.jsx)(ne,{"data-testid":`issues-ignore-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=d,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=se):se=e[91];let te;e[92]!==d||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(te=s.status!=="open"&&(0,t.jsx)(ne,{"data-testid":`issues-reopen-${s.hash}`,disabled:d,onClick:o(()=>{de(i(s.hash,Ue,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=d,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=te):te=e[98];let ae;e[99]!==ee||e[100]!==se||e[101]!==te?(ae=(0,t.jsx)(R,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[ee,se,te]})}),e[99]=ee,e[100]=se,e[101]=te,e[102]=ae):ae=e[102];let ie;e[103]!==g||e[104]!==I||e[105]!==H||e[106]!==Q||e[107]!==X||e[108]!==Z||e[109]!==z||e[110]!==ae?(ie=(0,t.jsxs)(pe,{"data-testid":z,children:[g,I,H,Q,X,Z,ae]}),e[103]=g,e[104]=I,e[105]=H,e[106]=Q,e[107]=X,e[108]=Z,e[109]=z,e[110]=ae,e[111]=ie):ie=e[111];let le;e[112]!==C||e[113]!==s||e[114]!==r?(le=(0,t.jsx)(as,{expanded:C,issue:s,shardKey:r},s.sampleMessage),e[112]=C,e[113]=s,e[114]=r,e[115]=le):le=e[115];let he;return e[116]!==ie||e[117]!==le?(he=(0,t.jsxs)(t.Fragment,{children:[ie,le]}),e[116]=ie,e[117]=le,e[118]=he):he=e[118],he},"tt"),ks=o(n=>{let e=(0,ge.c)(38),{initialShardKey:d}=n,s=ue(),$=Ne(),[i,r]=(0,O.useState)(d??""),[a,C]=(0,O.useState)("all"),[E,T]=(0,O.useState)(ns),[F,_]=(0,O.useState)(os),K;e[0]!==i?(K=i.trim(),e[0]=i,e[1]=K):K=e[1];let h=ze(K,400),M;e[2]!==a?(M=a==="all"?{}:{status:a},e[2]=a,e[3]=M):M=e[3];let z;e[4]!==h?(z={live:!0,shardKey:h},e[4]=h,e[5]=z):z=e[5];let{data:c,error:x,liveError:y}=_e(D.getIssues,M,z),w=c!==void 0,u;if(e[6]!==F||e[7]!==E||e[8]!==$||e[9]!==c||e[10]!==h||e[11]!==x||e[12]!==y||e[13]!==w||e[14]!==i||e[15]!==a||e[16]!==s){let A=es(c),m;e[18]!==$||e[19]!==h?(m=o(async(l,V,W)=>{_(N=>{if(!N.has(l))return N;let k=new Map(N);return k.delete(l),k}),T(N=>new Set(N).add(l));try{await $.query(V,{...W,hash:l},we(h))}catch(N){let k=Ee(N);_(U=>new Map(U).set(l,k))}T(N=>{let k=new Set(N);return k.delete(l),k})},"u"),e[18]=$,e[19]=h,e[20]=m):m=e[20];let b=m,p;e[21]!==s?(p=o(l=>s(l==="all"?"All":l==="open"?"Open":l==="resolved"?"Resolved":"Ignored"),"m"),e[21]=s,e[22]=p):p=e[22];let v=p,g;e[23]!==x?(g=x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:x}),e[23]=x,e[24]=g):g=e[24];let S;e[25]!==i?(S=(0,t.jsx)(Ke,{onChange:r,testId:"issues-shard-input",value:i}),e[25]=i,e[26]=S):S=e[26];let f;e[27]!==y?(f=(0,t.jsx)(Ve,{message:y,prefix:"issues"}),e[27]=y,e[28]=f):f=e[28];let I;e[29]!==a||e[30]!==v?(I=Pe.map(l=>(0,t.jsx)(ne,{"data-active":a===l?"":void 0,"data-testid":`issues-filter-${l}`,onClick:o(()=>{C(l)},"onClick"),size:"xs",variant:a===l?"default":"outline",children:v(l)},l)),e[29]=a,e[30]=v,e[31]=I):I=e[31];let j;e[32]!==I?(j=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:I}),e[32]=I,e[33]=j):j=e[33];let L;e[34]!==j||e[35]!==S||e[36]!==f?(L=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[S,f,j]}),e[34]=j,e[35]=S,e[36]=f,e[37]=L):L=e[37],u=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[g,L,w&&A.length===0?(0,t.jsx)(Ce,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ae,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(je,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(q,{children:s("Issue")}),(0,t.jsx)(q,{children:s("Status")}),(0,t.jsx)(q,{children:s("Severity")}),(0,t.jsx)(q,{children:s("Assignee")}),(0,t.jsx)(q,{className:"text-right",children:s("Events")}),(0,t.jsx)(q,{children:s("Last seen")}),(0,t.jsx)(q,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Fe,{children:A.map(l=>(0,t.jsx)(is,{busy:E.has(l.hash),issue:l,rowError:F.get(l.hash),runTriage:b,shardKey:h},l.hash))})]})})})]}),e[6]=F,e[7]=E,e[8]=$,e[9]=c,e[10]=h,e[11]=x,e[12]=y,e[13]=w,e[14]=i,e[15]=a,e[16]=s,e[17]=u}else u=e[17];return u},"kt");function ls(n){return!n}o(ls,"st");function rs(n){return(0,t.jsx)(be,{value:n,children:n},n)}o(rs,"at");function ns(){return new Set}o(ns,"it");function os(){return new Map}o(os,"rt");export{ks as IssuesPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{R as Q}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as W}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{f as F}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as Z}from"./chunk-XQCVZAGU.js";import{a as q,b as L,c as B,d as f,e as c,f as d}from"./chunk-MIQTKZAR.js";import{a as I,e as j}from"./chunk-UZERI5YC.js";import{d as K,h as S,l as $,m as V}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as h,e as C,f as R,g as P,h as U}from"./chunk-3XIESWL4.js";var A=C(P(),1);var n=C(R(),1);var e=C(U(),1);var X=10,g=h(v=>{let l=(0,A.c)(7),{label:m,value:a}=v,r;l[0]!==m?(r=(0,e.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:m}),l[0]=m,l[1]=r):r=l[1];let p=a??"\u2014",s;l[2]!==p?(s=(0,e.jsx)("span",{className:"font-mono text-sm",children:p}),l[2]=p,l[3]=s):s=l[3];let u;return l[4]!==r||l[5]!==s?(u=(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r,s]}),l[4]=r,l[5]=s,l[6]=u):u=l[6],u},"g"),se=h(({loadIndexes:v,runQuery:l}={})=>{let m=F(),a=K(),[r,p]=(0,n.useState)(null),[s,u]=(0,n.useState)(null),[N,E]=(0,n.useState)(null),[b,D]=(0,n.useState)(""),[x,y]=(0,n.useState)(null),[M,w]=(0,n.useState)(null),[T,z]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let t={cancelled:!1};return V((async()=>{try{let i=await(v??(()=>m.listVectorIndexes()))();t.cancelled||(p(i),u(null),E(k=>k??i[0]?.name??null))}catch(i){t.cancelled||(p(null),u(S(i)))}})()),()=>{t.cancelled=!0}},[m,v]);let o=r?.find(t=>t.name===N)??null,G=h(t=>{E(t.currentTarget.dataset.index??null),y(null),w(null)},"K"),H=h(t=>{D(t.target.value)},"T"),J=h(async()=>{let t=b.trim();if(!(N===null||t==="")){z(!0),w(null);try{let i=await(l??(k=>m.queryVectorIndex(k)))({name:N,text:t,topK:X});y(i)}catch(i){y(null),w(S(i))}z(!1)}},"Z"),O=h(()=>{V(J())},"z");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-vector-browser",children:[s!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"vector-error",role:"alert",children:s}),r!==null&&r.length===0&&(0,e.jsx)(Z,{description:a("Indexes declared with .vectorize() or defineVectorIndex() appear here."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"})}),testId:"vector-empty",title:a("No vector indexes.")}),r!==null&&r.length>0&&(0,e.jsx)(I,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(q,{"data-testid":"vector-table",children:[(0,e.jsx)(L,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(c,{children:a("name")}),(0,e.jsx)(c,{children:a("table")}),(0,e.jsx)(c,{children:a("dimensions")}),(0,e.jsx)(c,{children:a("metric")}),(0,e.jsx)(c,{children:a("vectors")})]})}),(0,e.jsx)(B,{children:r.map(t=>(0,e.jsxs)(f,{className:t.name===N?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-index":t.name,"data-testid":`vector-row-${t.name}`,onClick:G,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:t.name}),(0,e.jsx)(d,{className:"font-mono text-xs",children:t.table}),(0,e.jsx)(d,{className:"tabular-nums",children:t.dimensions??"\u2014"}),(0,e.jsx)(d,{children:t.metric??"\u2014"}),(0,e.jsx)(d,{className:"tabular-nums",children:t.vectorsCount??"\u2014"})]},t.name))})]})})}),o!==null&&(0,e.jsxs)("section",{className:"border border-border bg-card p-3","data-testid":"vector-detail",children:[(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,e.jsx)(g,{label:a("field"),value:o.field}),(0,e.jsx)(g,{label:a("dimensions"),value:o.dimensions}),(0,e.jsx)(g,{label:a("metric"),value:o.metric}),(0,e.jsx)(g,{label:a("vectors"),value:o.vectorsCount})]}),o.metadata!==void 0&&o.metadata.length>0&&(0,e.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground","data-testid":"vector-metadata",children:[a("metadata"),": ",(0,e.jsx)("span",{className:"font-mono",children:o.metadata.join(", ")})]}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,e.jsx)(Q,{className:"min-w-[18rem] flex-1","data-testid":"vector-query-input",onChange:H,placeholder:a("Search by similarity\u2026"),value:b}),(0,e.jsx)(W,{"data-testid":"vector-search",disabled:T||b.trim()==="",onClick:O,children:a(T?"Searching\u2026":"Search")})]}),M!==null&&(0,e.jsx)("p",{className:"mt-2 text-sm text-destructive","data-testid":"vector-query-error",role:"alert",children:M}),x!==null&&x.length===0&&(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground","data-testid":"vector-no-matches",children:a("No matches.")}),x!==null&&x.length>0&&(0,e.jsx)(I,{className:"mt-3 overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(q,{"data-testid":"vector-matches",children:[(0,e.jsx)(L,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(c,{children:a("id")}),(0,e.jsx)(c,{children:a("score")}),(0,e.jsx)(c,{children:a("metadata")})]})}),(0,e.jsx)(B,{children:x.map(t=>(0,e.jsxs)(f,{"data-testid":`vector-match-${t.id}`,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:t.id}),(0,e.jsx)(d,{className:"tabular-nums",children:t.score.toFixed(4)}),(0,e.jsx)(d,{className:"max-w-md truncate font-mono text-xs",children:t.metadata===void 0?"\u2014":$(t.metadata)})]},t.id))})]})})})]})]})},"ce");export{se as VectorBrowser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-54MMVNPT.js";import{
|
|
1
|
+
import{a as E}from"./chunk-54MMVNPT.js";import{c as w}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{b as $}from"./chunk-XDAT7LHC.js";import{f as b}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as j}from"./chunk-XQCVZAGU.js";import{a as z,b as B,c as C,d as g,e as n,f as i}from"./chunk-MIQTKZAR.js";import{a as S,e as I}from"./chunk-UZERI5YC.js";import{d as k,m as R,q as _}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as h,e as y,g as O,h as P}from"./chunk-3XIESWL4.js";var L=y(O(),1);var s=y(P(),1);var T=200,U=h(()=>{let e=(0,L.c)(21),l=b(),t=k(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=["lunora-auth-sessions",T],e[0]=u):u=e[0];let p;e[1]!==l?(p=h(()=>l.listAuthSessions({limit:T}),"u"),e[1]=l,e[2]=p):p=e[2];let o=$(u,p),{error:f}=o,a=o.data?.rows??null,x;e[3]!==o?(x=h(()=>{o.refetch()},"f"),e[3]=o,e[4]=x):x=e[4],E(x,!0);let N;e[5]!==l||e[6]!==o?(N=h(r=>{R((async()=>{await l.revokeAuthSession({sessionId:r}),o.refetch()})())},"x"),e[5]=l,e[6]=o,e[7]=N):N=e[7];let A=N,d;e[8]!==f?(d=f!==null&&(0,s.jsx)("p",{className:"text-sm text-destructive","data-testid":"auth-sessions-error",role:"alert",children:f}),e[8]=f,e[9]=d):d=e[9];let c;e[10]!==a||e[11]!==t?(c=a!==null&&a.length===0&&(0,s.jsx)(j,{testId:"auth-sessions-empty",title:t("No active sessions.")}),e[10]=a,e[11]=t,e[12]=c):c=e[12];let m;e[13]!==A||e[14]!==a||e[15]!==t?(m=a!==null&&a.length>0&&(0,s.jsx)(S,{className:"overflow-hidden py-0",children:(0,s.jsx)(I,{className:"px-0",children:(0,s.jsxs)(z,{"data-testid":"auth-sessions-table",children:[(0,s.jsx)(B,{children:(0,s.jsxs)(g,{children:[(0,s.jsx)(n,{children:t("user")}),(0,s.jsx)(n,{children:t("expires")}),(0,s.jsx)(n,{children:t("ip")}),(0,s.jsx)(n,{children:t("user agent")}),(0,s.jsx)(n,{children:t("impersonated by")}),(0,s.jsx)(n,{"aria-label":t("Actions")})]})}),(0,s.jsx)(C,{children:a.map(r=>(0,s.jsxs)(g,{"data-testid":`auth-session-${r.id}`,children:[(0,s.jsx)(i,{className:"font-mono text-xs",children:r.userId}),(0,s.jsx)(i,{className:"text-muted-foreground tabular-nums",children:_(r.expiresAt)}),(0,s.jsx)(i,{children:r.ipAddress??""}),(0,s.jsx)(i,{className:"max-w-40 truncate",children:r.userAgent??""}),(0,s.jsx)(i,{className:"font-mono text-xs",children:r.impersonatedBy??""}),(0,s.jsx)(i,{children:(0,s.jsx)(w,{"data-testid":`auth-session-revoke-${r.id}`,onClick:h(()=>{A(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Revoke")})})]},r.id))})]})})}),e[13]=A,e[14]=a,e[15]=t,e[16]=m):m=e[16];let v;return e[17]!==d||e[18]!==c||e[19]!==m?(v=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-sessions",children:[d,c,m]}),e[17]=d,e[18]=c,e[19]=m,e[20]=v):v=e[20],v},"Q");export{U as AuthSessionsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as B}from"./chunk-
|
|
1
|
+
import{b as B}from"./chunk-XF2B7P5A.js";import{b as A}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as P}from"./chunk-53WEPGUD.js";import"./chunk-XXQUMVWH.js";import"./chunk-RNL6BSFM.js";import"./chunk-QLQADHFE.js";import{a as M}from"./chunk-ERMTJYQF.js";import{c as F}from"./chunk-XDAT7LHC.js";import"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as R,b as q,c as z,d as K,e as _,f as C}from"./chunk-MIQTKZAR.js";import{a as D,e as j}from"./chunk-UZERI5YC.js";import{d as V}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as k,e as O,g as H,h as W}from"./chunk-3XIESWL4.js";var G=O(H(),1);var t=O(W(),1);var $={binding:"outline",secret:"destructive",var:"secondary"},J=k((n,e)=>{if(n===void 0)return[];let m=[];return n.workerUrl!==void 0&&m.push({label:e("URL"),value:n.workerUrl}),n.environment!==void 0&&m.push({label:e("Environment"),value:n.environment}),n.deploymentId!==void 0&&m.push({label:e("Deployment"),value:n.deploymentId}),n.versionTag!==void 0&&m.push({label:e("Version"),value:n.versionTag}),m},"B"),le=k(n=>{let e=(0,G.c)(52),{initialShardKey:m}=n,r=V(),w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];let E=m??"",S;e[1]!==E?(S={shardKey:E},e[1]=E,e[2]=S):S=e[2];let{data:s,error:l,errorSource:b,isLoading:U}=F(M.getSettings,w,S),a,c,p,d,o,i,u;if(e[3]!==l||e[4]!==b||e[5]!==s?.deploy||e[6]!==s?.settings||e[7]!==r){let L=J(s?.deploy,r),T;e[15]!==s?.settings?(T=s?.settings??[],e[15]=s?.settings,e[16]=T):T=e[16],a=T,c="flex flex-col gap-4",p="lunora-settings";let y;e[17]!==r?(y=r("Open in Cloudflare"),e[17]=r,e[18]=y):y=e[18],e[19]!==y?(d=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:B,rel:"noreferrer",target:"_blank",children:y})}),e[19]=y,e[20]=d):d=e[20];let N;e[21]!==r?(N=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=N):N=e[22],e[23]!==N?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:N}),e[23]=N,e[24]=o):o=e[24],e[25]!==l||e[26]!==b?(i=l!==null&&(0,t.jsx)(P,{error:b,testId:"set-error"}),e[25]=l,e[26]=b,e[27]=i):i=e[27],u=L.length>0&&(0,t.jsxs)(D,{className:"py-0","data-testid":"set-deploy",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,t.jsx)(j,{className:"py-3",children:(0,t.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:L.map(Q)})})]}),e[3]=l,e[4]=b,e[5]=s?.deploy,e[6]=s?.settings,e[7]=r,e[8]=a,e[9]=c,e[10]=p,e[11]=d,e[12]=o,e[13]=i,e[14]=u}else a=e[8],c=e[9],p=e[10],d=e[11],o=e[12],i=e[13],u=e[14];let h;e[28]!==r?(h=r("Environment & bindings"),e[28]=r,e[29]=h):h=e[29];let f;e[30]!==h?(f=(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h})}),e[30]=h,e[31]=f):f=e[31];let g;e[32]!==l||e[33]!==U||e[34]!==a.length||e[35]!==r?(g=l===null&&!U&&a.length===0&&(0,t.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[32]=l,e[33]=U,e[34]=a.length,e[35]=r,e[36]=g):g=e[36];let x;e[37]!==a||e[38]!==r?(x=a.length>0&&(0,t.jsx)(j,{className:"px-0 py-0",children:(0,t.jsxs)(R,{"data-testid":"set-table",children:[(0,t.jsx)(q,{children:(0,t.jsxs)(K,{children:[(0,t.jsx)(_,{children:r("name")}),(0,t.jsx)(_,{children:r("kind")}),(0,t.jsx)(_,{children:r("value")})]})}),(0,t.jsx)(z,{children:a.map(X)})]})}),e[37]=a,e[38]=r,e[39]=x):x=e[39];let v;e[40]!==f||e[41]!==g||e[42]!==x?(v=(0,t.jsxs)(D,{className:"py-0",children:[f,g,x]}),e[40]=f,e[41]=g,e[42]=x,e[43]=v):v=e[43];let I;return e[44]!==v||e[45]!==c||e[46]!==p||e[47]!==d||e[48]!==o||e[49]!==i||e[50]!==u?(I=(0,t.jsxs)("div",{className:c,"data-testid":p,children:[d,o,i,u,v]}),e[44]=v,e[45]=c,e[46]=p,e[47]=d,e[48]=o,e[49]=i,e[50]=u,e[51]=I):I=e[51],I},"le");function Q(n){return(0,t.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:n.label}),(0,t.jsx)("dd",{className:"truncate font-mono text-xs",title:n.value,children:n.value})]},n.label)}k(Q,"G");function X(n){return(0,t.jsxs)(K,{"data-testid":"set-row",children:[(0,t.jsx)(C,{className:"font-mono text-xs font-medium",children:n.name}),(0,t.jsx)(C,{children:(0,t.jsx)(A,{variant:$[n.kind],children:n.bindingType??n.kind})}),(0,t.jsx)(C,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:n.value??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},n.name)}k(X,"H");export{le as SettingsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Nt,b as Ve,c as dt,d as gt,e as Tt,f as dr}from"./chunk-2PJNAWB3.js";import{a as ar,b as cr,c as ur,d as pr,e as mr}from"./chunk-SD4BERSA.js";import{a as fr}from"./chunk-IC4L6G56.js";import{A as _o,B as Uo,C as ko,D as P,G as a,H as Fo,L as Bo,Z as Ho,a as Eo,ca as jo,d as wo,da as zo,ha as Wo,ia as Go,ja as mt,k as Ht,la as qo,ma as $o,n as Vo,oa as Ko,pa as Jo,q as Oo,qa as Zo,ra as Qo,ta as er,ua as tr,va as or,wa as rr,x as Do,y as Lo}from"./chunk-RQ7AFLIV.js";import{a as To,b as Xo}from"./chunk-BGBLQ563.js";import{a as Po,b as Mo,c as Yo}from"./chunk-IVFHIQOT.js";import{a as nr,b as sr,i as lr,j as ir,k as At}from"./chunk-QBWRC5YX.js";import{C as pt,F as Ao,I as _e,K as Xe,L as ft,M as ro,N as No,O as ge,P as xe,a as Ut,b as ut,c as Ro,e as bo,f as yo,g as Ft,h as Ct,i as Io,p as Bt,y as vo,z as Co}from"./chunk-CFPZYHPY.js";import{b as jt}from"./chunk-FXCBF4XT.js";import{a as ee,c as de,e as kt}from"./chunk-2OUPA2WJ.js";import{a as wt,c as je,d as So,e as ho,h as oo,i as xo,j as O}from"./chunk-6ST5ECQA.js";import{a as r,d as mn,e as I,f as _,g as dn,h as Me,j as ot}from"./chunk-3XIESWL4.js";var Ot=I(dn(),1),Ec=I(_(),1);var me={};mn(me,{Arrow:()=>Zr,Backdrop:()=>kr,Group:()=>cn,GroupLabel:()=>pn,Icon:()=>Or,Item:()=>qr,ItemIndicator:()=>Xr,ItemText:()=>Kr,Label:()=>Nr,List:()=>Gr,Popup:()=>zr,Portal:()=>_r,Positioner:()=>Fr,Root:()=>Er,ScrollDownArrow:()=>on,ScrollUpArrow:()=>sn,Separator:()=>fr,Trigger:()=>Tr,Value:()=>Mr});var j=I(_(),1);var St=I(_(),1);var no=St.createContext(null),so=St.createContext(null);function U(){let e=St.useContext(no);if(e===null)throw new Error(je(60));return e}r(U,"useSelectRootContext");function zt(){let e=St.useContext(so);if(e===null)throw new Error(je(61));return e}r(zt,"useSelectFloatingContext");var gr=r((e,t)=>Object.is(e,t),"defaultItemEquality");function Ue(e,t,o){return e==null||t==null?Object.is(e,t):o(e,t)}r(Ue,"compareItemEquality");function Sr(e,t,o){return!e||e.length===0?!1:e.some(n=>n===void 0?!1:Ue(t,n,o))}r(Sr,"selectedValueIncludes");function rt(e,t,o){return!e||e.length===0?-1:e.findIndex(n=>n===void 0?!1:Ue(n,t,o))}r(rt,"findItemIndex");function hr(e,t,o){return e.filter(n=>!Ue(t,n,o))}r(hr,"removeItem");var xr=I(_(),1);function Wt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}r(Wt,"serializeValue");var Rr=I(Me(),1);function br(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}r(br,"isGroupedItems");function yr(e){if(!Array.isArray(e))return e!=null&&"null"in e;let t=e;if(br(t)){for(let o of t)for(let n of o.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(let o of t)if(o&&o.value==null&&o.label!=null)return!0;return!1}r(yr,"hasNullItemLabel");function lo(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Wt(e)}r(lo,"stringifyAsLabel");function ze(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Wt(e.value):Wt(e)}r(ze,"stringifyAsValue");function io(e,t,o){function n(){return lo(e,o)}if(r(n,"fallback"),o&&e!=null)return o(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??n();if(Array.isArray(t)){let l=t,c=br(l)?l.flatMap(s=>s.items):l;if(e==null||typeof e!="object"){let s=c.find(m=>m.value===e);return s&&s.label!=null?s.label:n()}if("value"in e){let s=c.find(m=>m&&m.value===e.value);if(s&&s.label!=null)return s.label}}return n()}r(io,"resolveSelectedLabel");function Ir(e,t,o){return e.reduce((n,l,c)=>(c>0&&n.push(", "),n.push((0,Rr.jsx)(xr.Fragment,{children:io(l,t,o)},c)),n),[])}r(Ir,"resolveMultipleLabels");var i={id:P(e=>e.id),labelId:P(e=>e.labelId),modal:P(e=>e.modal),multiple:P(e=>e.multiple),items:P(e=>e.items),itemToStringLabel:P(e=>e.itemToStringLabel),itemToStringValue:P(e=>e.itemToStringValue),isItemEqualToValue:P(e=>e.isItemEqualToValue),value:P(e=>e.value),hasSelectedValue:P(e=>{let{value:t,multiple:o,itemToStringValue:n}=e;return t==null?!1:o&&Array.isArray(t)?t.length>0:ze(t,n)!==""}),hasNullItemLabel:P((e,t)=>t?yr(e.items):!1),open:P(e=>e.open),mounted:P(e=>e.mounted),forceMount:P(e=>e.forceMount),transitionStatus:P(e=>e.transitionStatus),openMethod:P(e=>e.openMethod),activeIndex:P(e=>e.activeIndex),selectedIndex:P(e=>e.selectedIndex),isActive:P((e,t)=>e.activeIndex===t),isSelected:P((e,t)=>{let o=e.isItemEqualToValue,n=e.value;return e.multiple?Array.isArray(n)&&n.some(l=>Ue(t,l,o)):Ue(t,n,o)}),isSelectedByFocus:P((e,t)=>e.selectedIndex===t),popupProps:P(e=>e.popupProps),triggerProps:P(e=>e.triggerProps),triggerElement:P(e=>e.triggerElement),positionerElement:P(e=>e.positionerElement),listElement:P(e=>e.listElement),popupSide:P(e=>e.popupSide),scrollUpArrowVisible:P(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:P(e=>e.scrollDownArrowVisible),hasScrollArrows:P(e=>e.hasScrollArrows)};function vr(e,t,o=(n,l)=>n===l){return e.length===t.length&&e.every((n,l)=>o(n,t[l]))}r(vr,"areArraysEqual");var ht=I(Me(),1);function Er(e){let{id:t,value:o,defaultValue:n=null,onValueChange:l,open:c,defaultOpen:s=!1,onOpenChange:m,name:p,form:f,autoComplete:g,disabled:h=!1,readOnly:R=!1,required:v=!1,modal:C=!0,actionsRef:k,inputRef:x,onOpenChangeComplete:J,items:B,multiple:A=!1,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M=gr,highlightItemOnHover:ae=!0,children:te}=e,{clearErrors:$}=Ro(),{setDirty:se,setTouched:Se,setFocused:Re,validityData:z,setFilled:X,name:D,disabled:ce,validation:N,validationMode:Z}=ut(),H=Ft({id:t}),V=ce||h,u=D??p,[S,le]=ro({controlled:o,default:A?n??oo:n,name:"Select",state:"value"}),[F,be]=ro({controlled:c,default:s,name:"Select",state:"open"}),he=j.useRef([]),d=j.useRef([]),w=j.useRef(null),ue=j.useRef(null),Ae=j.useRef(0),T=j.useRef(null),K=j.useRef([]),W=j.useRef(!1),Ie=j.useRef(null),ie=j.useRef(null),pe=j.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),fe=j.useRef(!1),{mounted:oe,setMounted:Ne,transitionStatus:Q}=ft(F),{openMethod:G,triggerProps:re}=qo(F),y=So(()=>new Fo({id:H,labelId:void 0,modal:C,multiple:A,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M,value:S,open:F,mounted:oe,transitionStatus:Q,items:B,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,We=a(y,i.activeIndex),Te=a(y,i.selectedIndex),Oe=a(y,i.triggerElement),ke=a(y,i.positionerElement),Ge=rr(G),Je=G??Ge??null,It=j.useMemo(()=>A?"":ze(S,L),[A,S,L]),Fe=j.useMemo(()=>A&&Array.isArray(S)?S.map(E=>ze(E,L)):ze(S,L),[A,S,L]),Ze=Ht(y.state.triggerElement),ne=de(()=>Fe);No(Ze,H,S,ne,!V,p);let Be=j.useRef(S),He=A?Array.isArray(S)&&S.length>0:S!=null&&ze(S,L)!=="";ee(()=>{S!==Be.current&&y.set("forceMount",!0)},[y,S]),ee(()=>{X(He)},[He,X]),ee(r(function(){let Y=K.current,ve;if(A){let ye=Array.isArray(S)?S:[];if(ye.length===0)ve=null;else{let $e=ye[ye.length-1],tt=rt(Y,$e,M);ve=tt===-1?null:tt}}else{let ye=rt(Y,S,M);ve=ye===-1?null:ye}ve===null&&(ie.current=null),!F&&y.set("selectedIndex",ve)},"syncSelectedIndex"),[He,A,F,S,K,M,y,ie]);function De(E){let Y=z.initialValue;return Array.isArray(E)&&Array.isArray(Y)?!vr(E,Y,(ve,ye)=>Ue(ve,ye,M)):E!==Y}r(De,"isSelectedValueDirty"),Yo(S,()=>{$(u),se(De(S)),N.change(S)});let st=de((E,Y)=>{m?.(E,Y),!Y.isCanceled&&(be(E),!E&&(Y.reason===ge.focusOut||Y.reason===ge.outsidePress)&&(Se(!0),Re(!1),Z==="onBlur"&&N.commit(S)))}),lt=de(()=>{Ne(!1),y.update({activeIndex:null,openMethod:null}),J?.(!1)});Xe({enabled:!k,open:F,ref:w,onComplete(){F||lt()}}),j.useImperativeHandle(k,()=>({unmount:lt}),[lt]);let Ye=de((E,Y)=>{l?.(E,Y),!Y.isCanceled&&le(E)}),Le=de(()=>{let E=y.state.listElement||w.current;if(!E)return;let Y=dt(E.scrollHeight,E.clientHeight),ve=gt(E.scrollTop,Y),ye=ve>0,$e=ve<Y;y.state.scrollUpArrowVisible!==ye&&y.set("scrollUpArrowVisible",ye),y.state.scrollDownArrowVisible!==$e&&y.set("scrollDownArrowVisible",$e)}),Qe=Ho({open:F,onOpenChange:st,elements:{reference:Oe,floating:ke}}),it=Lo(Qe,{enabled:!R&&!V,event:"mousedown"}),at=_o(Qe),qe=jo(Qe,{enabled:!R&&!V,listRef:he,activeIndex:We,selectedIndex:Te,disabledIndices:oo,onNavigate(E){E===null&&!F||y.set("activeIndex",E)},focusItemOnHover:ae}),et=zo(Qe,{enabled:!R&&!V&&(F||!A),listRef:d,activeIndex:We,selectedIndex:Te,disabledIndices:r(E=>mr(he.current[E]),"disabledIndices"),onMatch(E){F?y.set("activeIndex",E):Ye(K.current[E],xe("none"))},onTyping(E){W.current=E}}),vt=j.useMemo(()=>{let E=wt(et.reference,qe.reference,at.reference,it.reference,re);return H&&(E.id=H),E},[it.reference,et.reference,qe.reference,at.reference,re,H]),Et=j.useMemo(()=>wt(Bo,et.floating,qe.floating,at.floating),[et.floating,qe.floating,at.floating]),Dt=qe.item??xo;ko(()=>{y.update({popupProps:Et,triggerProps:vt})}),ee(()=>{y.update({id:H,modal:C,multiple:A,value:S,open:F,mounted:oe,transitionStatus:Q,popupProps:Et,triggerProps:vt,items:B,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M,openMethod:Je})},[y,H,C,A,S,F,oe,Q,Et,vt,B,b,L,M,Je]);let Pe=j.useMemo(()=>({store:y,name:u,required:v,disabled:V,readOnly:R,multiple:A,highlightItemOnHover:ae,setValue:Ye,setOpen:st,listRef:he,popupRef:w,scrollHandlerRef:ue,handleScrollArrowVisibility:Le,scrollArrowsMountedCountRef:Ae,itemProps:Dt,valueRef:T,valuesRef:K,labelsRef:d,typingRef:W,selectionRef:pe,firstItemTextRef:Ie,selectedItemTextRef:ie,validation:N,onOpenChangeComplete:J,alignItemWithTriggerActiveRef:fe,initialValueRef:Be}),[y,u,v,V,R,A,ae,Ye,st,Dt,N,J,Le]),ct=ho(x,N.inputRef),Lt=A&&Array.isArray(S)&&S.length>0,_t=A?void 0:u,eo=j.useMemo(()=>!A||!Array.isArray(S)||!u?null:S.map(E=>{let Y=ze(E,L);return(0,ht.jsx)("input",{type:"hidden",form:f,name:u,value:Y,disabled:V},Y)}),[A,S,f,u,L,V]);return(0,ht.jsx)(no.Provider,{value:Pe,children:(0,ht.jsxs)(so.Provider,{value:Qe,children:[te,(0,ht.jsx)("input",{...N.getValidationProps(V,{onFocus(){y.state.triggerElement?.focus({focusVisible:!0})},onChange(E){if(E.nativeEvent.defaultPrevented||V||R)return;let Y=E.currentTarget.value,ve=xe(ge.none,E.nativeEvent);function ye(){if(A)return;let $e=Y.toLowerCase(),tt=K.current.findIndex(to=>ze(to,L).toLowerCase()===$e||lo(to,b).toLowerCase()===$e);tt===-1&&(tt=K.current.findIndex((to,fn)=>{let go=d.current[fn];return go!=null&&go.toLowerCase()===$e}));let mo=tt===-1?void 0:K.current[tt];mo!=null&&Ye(mo,ve)}r(ye,"handleChange"),y.set("forceMount",!0),queueMicrotask(ye)}}),id:H&&_t==null?`${H}-hidden-input`:void 0,form:f,name:_t,autoComplete:g,value:It,disabled:V,required:v&&!Lt,readOnly:R,ref:ct,style:u?Mo:Po,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),eo]})})}r(Er,"SelectRoot");var Ar=I(_(),1);function wr(e){return e==null?void 0:`${e}-label`}r(wr,"getDefaultLabelId");function Cr(e,t){return e??t}r(Cr,"resolveAriaLabelledBy");var Nr=Ar.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,m=s;delete m.id;let p=ut(),{store:f}=U(),g=a(f,i.triggerElement),h=a(f,i.id),R=wr(h),v=Co({id:R,fallbackControlId:g?.id??h,setLabelId(C){f.set("labelId",C)}});return O("div",t,{ref:o,state:p.state,props:[v,s],stateAttributesMapping:Ut})},"SelectLabel"));var xt=I(_(),1);var Gt=2,gn=400,Sn={...Go,...Ut,popupSide:r(e=>e?{"data-popup-side":e}:null,"popupSide"),value:r(()=>null,"value")},Tr=xt.forwardRef(r(function(t,o){let{render:n,className:l,id:c,disabled:s=!1,nativeButton:m=!0,style:p,...f}=t,{setTouched:g,setFocused:h,validationMode:R,state:v,disabled:C}=ut(),{labelId:k}=yo(),{store:x,setOpen:J,selectionRef:B,validation:A,readOnly:b,required:L,alignItemWithTriggerActiveRef:M,disabled:ae}=U(),te=C||ae||s,$=a(x,i.open),se=a(x,i.mounted),Se=a(x,i.value),Re=a(x,i.triggerProps),z=a(x,i.positionerElement),X=a(x,i.listElement),D=a(x,i.popupSide),ce=a(x,i.id),N=a(x,i.labelId),Z=a(x,i.hasSelectedValue),H=se&&z?D:null,V=c??ce,u=Cr(k,N);Ft({id:V});let S=Ht(z),le=xt.useRef(null),{getButtonProps:F,buttonRef:be}=jt({disabled:te,native:m}),he=de(W=>{x.set("triggerElement",W)}),d=pt(),w=pt(),ue=pt();xt.useEffect(()=>{if($)return ue.start(gn,()=>{B.current.allowUnselectedMouseUp=!0,B.current.allowSelectedMouseUp=!0}),()=>{ue.clear()};B.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},w.clear()},[$,B,w,ue]);let Ae=wt(Re,{id:V,role:"combobox","aria-expanded":$?"true":"false","aria-haspopup":"listbox","aria-controls":$?X?.id??vo(z)?.id:void 0,"aria-labelledby":u,"aria-readonly":b||void 0,"aria-required":L||void 0,tabIndex:te?-1:0,onFocus(W){h(!0),$&&M.current&&J(!1,xe(ge.none,W.nativeEvent)),d.start(0,()=>{x.set("forceMount",!0)})},onBlur(W){Bt(z,W.relatedTarget)||(g(!0),h(!1),R==="onBlur"&&A.commit(Se))},onMouseDown(W){if($)return;let Ie=Ct(W.currentTarget);function ie(pe){if(!le.current)return;let fe=pe.target;if(Bt(le.current,fe)||Bt(S.current,fe))return;let oe=pr(le.current);pe.clientX>=oe.left-Gt&&pe.clientX<=oe.right+Gt&&pe.clientY>=oe.top-Gt&&pe.clientY<=oe.bottom+Gt||J(!1,xe(ge.cancelOpen,pe))}r(ie,"handleMouseUp"),w.start(0,()=>{Ie.addEventListener("mouseup",ie,{once:!0})})}},f,F),T=A.getValidationProps(te,Ae);T.role="combobox";let K={...v,open:$,disabled:te,value:Se,readOnly:b,popupSide:H,placeholder:!Z};return O("button",t,{ref:[o,le,be,he],state:K,stateAttributesMapping:Sn,props:T})},"SelectTrigger"));var Pr=I(_(),1);var hn={value:r(()=>null,"value")},Mr=Pr.forwardRef(r(function(t,o){let{className:n,render:l,children:c,placeholder:s,style:m,...p}=t,{store:f,valueRef:g}=U(),h=a(f,i.value),R=a(f,i.items),v=a(f,i.itemToStringLabel),C=a(f,i.hasSelectedValue),k=!C&&s!=null&&c==null,x=a(f,i.hasNullItemLabel,k),J={value:h,placeholder:!C},B=null;return typeof c=="function"?B=c(h):c!=null?B=c:!C&&s!=null&&!x?B=s:Array.isArray(h)?B=Ir(h,R,v):B=io(h,R,v),O("span",t,{state:J,ref:[o,g],props:[{children:B},p],stateAttributesMapping:hn})},"SelectValue"));var Vr=I(_(),1);var Or=Vr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),f={open:a(m,i.open)};return O("span",t,{state:f,ref:o,props:[{"aria-hidden":!0,children:"\u25BC"},s],stateAttributesMapping:Wo})},"SelectIcon"));var Lr=I(_(),1);var ao=I(_(),1);var Dr=ao.createContext(void 0);var co=I(Me(),1);var _r=Lr.forwardRef(r(function(t,o){let{store:n}=U(),l=a(n,i.mounted),c=a(n,i.forceMount);return l||c?(0,co.jsx)(Dr.Provider,{value:!0,children:(0,co.jsx)(Oo,{ref:o,...t})}):null},"SelectPortal"));var Ur=I(_(),1);var xn={...mt,..._e},kr=Ur.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),p=a(m,i.open),f=a(m,i.mounted),g=a(m,i.transitionStatus);return O("div",t,{state:{open:p,transitionStatus:g},ref:o,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:xn})},"SelectBackdrop"));var Ee=I(_(),1);var Yt=I(_(),1);var uo=Yt.createContext(void 0);function Ke(){let e=Yt.useContext(uo);if(!e)throw new Error(je(59));return e}r(Ke,"useSelectPositionerContext");function Rt(e,t){e&&Object.assign(e.style,t)}r(Rt,"clearStyles");var qt={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var Pt=I(Me(),1);var Rn={position:"fixed"},Fr=Ee.forwardRef(r(function(t,o){let{anchor:n,positionMethod:l="absolute",className:c,render:s,side:m="bottom",align:p="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:h="clipping-ancestors",collisionPadding:R,arrowPadding:v=5,sticky:C=!1,disableAnchorTracking:k,alignItemWithTrigger:x=!0,collisionAvoidance:J=Vo,style:B,...A}=t,{store:b,listRef:L,labelsRef:M,alignItemWithTriggerActiveRef:ae,selectedItemTextRef:te,valuesRef:$,initialValueRef:se,popupRef:Se,setValue:Re}=U(),z=zt(),X=a(b,i.open),D=a(b,i.mounted),ce=a(b,i.modal),N=a(b,i.value),Z=a(b,i.openMethod),H=a(b,i.positionerElement),V=a(b,i.triggerElement),u=a(b,i.isItemEqualToValue),S=a(b,i.transitionStatus),le=Ee.useRef(null),F=Ee.useRef(null),[be,he]=Ee.useState(x),d=D&&be&&Z!=="touch";!D&&be!==x&&he(x),ee(()=>{D||(i.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),i.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,D]),Ee.useImperativeHandle(ae,()=>d),er((d||ce)&&X,Z==="touch",H,V);let w=Ko({anchor:n,floatingRootContext:z,positionMethod:l,mounted:D,side:m,sideOffset:f,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:h,collisionPadding:R,sticky:C,disableAnchorTracking:k??d,collisionAvoidance:J,keepMounted:!0}),ue=d?"none":w.side,Ae=d?Rn:w.positionerStyles,T={open:X,side:ue,align:w.align,anchorHidden:w.anchorHidden};ee(()=>{b.set("popupSide",w.side)},[b,w.side]);let K=de(fe=>{b.set("positionerElement",fe)}),W=Qo(t,T,{styles:Ae,transitionStatus:S,props:A,refs:[o,K],hidden:!D,inert:!X}),Ie=Ee.useRef(0),ie=de(fe=>{if(fe.size===0&&Ie.current===0||$.current.length===0)return;let oe=Ie.current;if(Ie.current=fe.size,fe.size===oe)return;let Ne=xe(ge.none);if(oe!==0&&!b.state.multiple&&N!==null&&rt($.current,N,u)===-1){let G=se.current,y=G!=null&&rt($.current,G,u)!==-1?G:null;Re(y,Ne),y===null&&(b.set("selectedIndex",null),te.current=null)}if(oe!==0&&b.state.multiple&&Array.isArray(N)){let Q=r(re=>rt($.current,re,u)!==-1,"hasVisibleItem"),G=N.filter(re=>Q(re));(G.length!==N.length||G.some(re=>!Sr(N,re,u)))&&(Re(G,Ne),G.length===0&&(b.set("selectedIndex",null),te.current=null))}if(X&&d){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let Q={height:""};Rt(H,Q),Rt(Se.current,Q)}}),pe=Ee.useMemo(()=>({...w,side:ue,alignItemWithTriggerActive:d,setControlledAlignItemWithTrigger:he,scrollUpArrowRef:le,scrollDownArrowRef:F}),[w,ue,d,he]);return(0,Pt.jsx)(ur,{elementsRef:L,labelsRef:M,onMapChange:ie,children:(0,Pt.jsxs)(uo.Provider,{value:pe,children:[D&&ce&&(0,Pt.jsx)(Jo,{inert:$o(!X),cutout:V}),W]})})},"SelectPositioner"));var we=I(_(),1);var Kt=I(Me(),1);var bn={...mt,..._e},zr=we.forwardRef(r(function(t,o){let{render:n,className:l,style:c,finalFocus:s,...m}=t,{store:p,popupRef:f,onOpenChangeComplete:g,setOpen:h,valueRef:R,firstItemTextRef:v,selectedItemTextRef:C,multiple:k,handleScrollArrowVisibility:x,scrollHandlerRef:J,listRef:B,highlightItemOnHover:A}=U(),{side:b,align:L,alignItemWithTriggerActive:M,isPositioned:ae,setControlledAlignItemWithTrigger:te}=Ke(),$=or(!0)!=null,se=zt(),Se=Xo(),{nonce:Re,disableStyleElements:z}=dr(),X=a(p,i.id),D=a(p,i.open),ce=a(p,i.openMethod),N=a(p,i.mounted),Z=a(p,i.popupProps),H=a(p,i.transitionStatus),V=a(p,i.triggerElement),u=a(p,i.positionerElement),S=a(p,i.listElement),le=we.useRef(!1),F=we.useRef(!1),be=we.useRef({}),he=Ao(),d=de(T=>{if(!u||!f.current||!F.current)return;if(le.current||!M){x();return}let K=u.style.top==="0px",W=u.style.bottom==="0px";if(!K&&!W){x();return}let Ie=Hr(u),ie=Mt(u.getBoundingClientRect().height,"y",Ie),pe=Ct(u),fe=kt(u),oe=fe.getComputedStyle(u),Ne=parseFloat(oe.marginTop),Q=parseFloat(oe.marginBottom),G=Br(fe.getComputedStyle(f.current)),re=Math.min(pe.documentElement.clientHeight-Ne-Q,G),y=T.scrollTop,We=$t(T),Te=0,Oe=null,ke=!1,Ge=!1,Je=r(ne=>{u.style.height=`${ne}px`},"setHeight"),It=r((ne,Be)=>{let He=Nt(ne,0,re-ie);He>0&&Je(ie+He),T.scrollTop=Be,re-(ie+He)<=Ve&&(le.current=!0),x()},"handleSmallDiff"),Fe=K?We-y:y,Ze=Math.min(ie+Fe,re);if(Te=Ze,Fe<=Ve){It(Fe,K?We:0);return}if(re-Ze>Ve)K?Ge=!0:Oe=0;else if(ke=!0,W&&y<We){let ne=ie+Fe-re;Oe=y-(Fe-ne)}if(Te=Math.ceil(Te),Te!==0&&Je(Te),Ge||Oe!=null){let ne=$t(T),Be=Ge?ne:Nt(Oe,0,ne);Math.abs(T.scrollTop-Be)>Ve&&(T.scrollTop=Be)}(ke||Te>=re-Ve)&&(le.current=!0),x()});we.useImperativeHandle(J,()=>d,[d]),Xe({open:D,ref:f,onComplete(){D&&g?.(!0)}});let w={open:D,transitionStatus:H,side:b,align:L};ee(()=>{!u||!f.current||Object.keys(be.current).length||(be.current={top:u.style.top||"0",left:u.style.left||"0",right:u.style.right,height:u.style.height,bottom:u.style.bottom,minHeight:u.style.minHeight,maxHeight:u.style.maxHeight,marginTop:u.style.marginTop,marginBottom:u.style.marginBottom})},[f,u]),ee(()=>{D||M||(F.current=!1,le.current=!1,Rt(u,be.current))},[D,M,u,f]),ee(()=>{let T=f.current;if(!D||!V||!u||!T||M&&!ae||p.state.transitionStatus==="ending")return;if(!M){F.current=!0,he.request(x),T.style.removeProperty("--transform-origin");return}let K=yn(T);T.style.removeProperty("--transform-origin");try{let W=C.current;W?.isConnected||(W=!i.hasSelectedValue(p.state)&&v.current?.isConnected?v.current:null);let Ie=R.current,ie=kt(u),pe=ie.getComputedStyle(u),fe=ie.getComputedStyle(T),oe=Ct(V),Ne=Hr(V),Q=Xt(V.getBoundingClientRect(),Ne),G=Xt(u.getBoundingClientRect(),Ne),re=Q.height,y=S||T,We=y.scrollHeight,Te=parseFloat(fe.borderBottomWidth),Oe=parseFloat(pe.marginTop)||10,ke=parseFloat(pe.marginBottom)||10,Ge=parseFloat(pe.minHeight)||100,Je=Br(fe),It=5,Fe=5,Ze=20,ne=oe.documentElement.clientHeight-Oe-ke,Be=oe.documentElement.clientWidth,He=ne-Q.bottom+re,De,st=Se==="rtl"?Q.right-G.width:Q.left,lt=0;if(W&&Ie){let Pe=Xt(Ie.getBoundingClientRect(),Ne);De=Xt(W.getBoundingClientRect(),Ne),st=G.left+(Se==="rtl"?Pe.right-De.right:Pe.left-De.left);let ct=Pe.top-Q.top+Pe.height/2;lt=De.top-G.top+De.height/2-ct}let Ye=He+lt+ke+Te,Le=Math.min(ne,Ye),Qe=ne-Oe-ke,it=Ye-Le,at=Be-Fe;u.style.left=`${Nt(st,It,at-G.width)}px`,u.style.height=`${Le}px`,u.style.maxHeight="none",u.style.marginTop=`${Oe}px`,u.style.marginBottom=`${ke}px`,T.style.height="100%";let qe=$t(y),et=it>=qe-Ve;et&&(Le=Math.min(ne,G.height)-(it-qe));let vt=Q.top<Ze||Q.bottom>ne-Ze||Math.ceil(Le)+Ve<Math.min(We,Ge),Et=(ie.visualViewport?.scale??1)!==1&&Io.engine.webkit;if(vt||Et){F.current=!0,Rt(u,be.current),te(!1);return}let Dt=Math.max(Ge,Le);if(et){let Pe=Math.max(0,ne-Ye);u.style.top=G.height>=Qe?"0":`${Pe}px`,u.style.height=`${Le}px`,y.scrollTop=$t(y)}else u.style.bottom="0",y.scrollTop=it;if(De){let Pe=G.top,ct=G.height,Lt=De.top+De.height/2,_t=ct>0?(Lt-Pe)/ct*100:50,eo=Nt(_t,0,100);T.style.setProperty("--transform-origin",`50% ${eo}%`)}(Dt===ne||Le>=Je)&&(le.current=!0),x(),A&&p.state.selectedIndex===null&&p.state.activeIndex===null&&B.current[0]!=null&&p.set("activeIndex",0),F.current=!0}finally{K()}},[p,D,u,V,R,v,C,f,x,M,te,he,S,B,A,Se,ae]),we.useEffect(()=>{if(!M||!u||!D)return;let T=kt(u);function K(W){h(!1,xe(ge.windowResize,W))}return r(K,"handleResize"),To(T,"resize",K)},[h,M,u,D]);let ue={...S?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":k||void 0,id:`${X}-list`},onKeyDown(T){$&&tr.has(T.key)&&T.stopPropagation()},onScroll(T){S||d(T.currentTarget)},...M&&{style:S?{height:"100%"}:qt}},Ae=O("div",t,{ref:[o,f],state:w,stateAttributesMapping:bn,props:[Z,ue,Zo(H),{className:!S&&M?Tt.className:void 0},m]});return(0,Kt.jsxs)(we.Fragment,{children:[!z&&Tt.getElement(Re),(0,Kt.jsx)(Do,{context:se,modal:!1,disabled:!N,openInteractionType:ce,returnFocus:s,restoreFocus:!0,children:Ae})]})},"SelectPopup"));function Br(e){let t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}r(Br,"getMaxPopupHeight");function $t(e){return dt(e.scrollHeight,e.clientHeight)}r($t,"getMaxScrollTop");function Hr(e){return Uo.getScale(e)}r(Hr,"getScale");function Mt(e,t,o){return e/o[t]}r(Mt,"normalizeSize");function Xt(e,t){return wo({x:Mt(e.x,"x",t),y:Mt(e.y,"y",t),width:Mt(e.width,"x",t),height:Mt(e.height,"y",t)})}r(Xt,"normalizeRect");var jr=[["transform","none"],["scale","1"],["translate","0 0"]];function yn(e){let{style:t}=e,o={};for(let[n,l]of jr)o[n]=t.getPropertyValue(n),t.setProperty(n,l,"important");return()=>{for(let[n]of jr){let l=o[n];l?t.setProperty(n,l):t.removeProperty(n)}}}r(yn,"unsetTransformStyles");var Wr=I(_(),1);var Gr=Wr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m,scrollHandlerRef:p}=U(),{alignItemWithTriggerActive:f}=Ke(),g=a(m,i.hasScrollArrows),h=a(m,i.openMethod),R=a(m,i.multiple),C={id:`${a(m,i.id)}-list`,role:"listbox","aria-multiselectable":R||void 0,onScroll(x){p.current?.(x.currentTarget)},...f&&{style:qt},className:g&&h!=="touch"?Tt.className:void 0},k=de(x=>{m.set("listElement",x)});return O("div",t,{ref:[o,k],props:[C,s]})},"SelectList"));var Ce=I(_(),1);var Jt=I(_(),1);var po=Jt.createContext(void 0);function Vt(){let e=Jt.useContext(po);if(!e)throw new Error(je(57));return e}r(Vt,"useSelectItemContext");var Yr=I(Me(),1);var qr=Ce.memo(Ce.forwardRef(r(function(t,o){let{render:n,className:l,style:c,value:s=null,label:m,disabled:p=!1,nativeButton:f=!1,...g}=t,h=Ce.useRef(null),R=cr({label:m,textRef:h,indexGuessBehavior:ar.GuessFromOrder}),{store:v,itemProps:C,setOpen:k,setValue:x,selectionRef:J,typingRef:B,valuesRef:A,multiple:b,selectedItemTextRef:L,disabled:M,readOnly:ae}=U(),te=a(v,i.isActive,R.index),$=a(v,i.open),se=a(v,i.isSelected,s),Se=a(v,i.isSelectedByFocus,R.index),Re=a(v,i.isItemEqualToValue),z=R.index,X=z!==-1,D=Ce.useRef(null);ee(()=>{if(!X)return;let d=A.current;return d[z]=s,()=>{delete d[z]}},[X,z,s,A]),ee(()=>{if(!X)return;let d=v.state.value,w=d;b&&Array.isArray(d)&&(w=d.length>0?d[d.length-1]:void 0),w!==void 0&&Ue(s,w,Re)&&(v.set("selectedIndex",z),h.current&&(L.current=h.current))},[X,z,b,Re,v,s,L]);let ce=Ce.useRef(null),N=Ce.useRef("mouse"),Z=Ce.useRef(!1),{getButtonProps:H,buttonRef:V}=jt({disabled:p,focusableWhenDisabled:!0,native:f,composite:!0}),u={disabled:p,selected:se,highlighted:te};function S(d){if(M||ae)return;let w=v.state.value;if(b){let ue=Array.isArray(w)?w:[],Ae=se?hr(ue,s,Re):[...ue,s];x(Ae,xe(ge.itemPress,d))}else x(s,xe(ge.itemPress,d)),k(!1,xe(ge.itemPress,d))}r(S,"commitSelection");function le(){J.current.dragY=0}r(le,"resetDragMovement");let F={role:"option","aria-selected":se,tabIndex:$&&te?0:-1,onKeyDown(d){ce.current=d.key,v.set("activeIndex",z),d.key===" "&&B.current&&d.preventDefault()},onClick(d){let w=d.type==="click"&&N.current!=="touch",ue=d.nativeEvent.pointerType,Ae=w&&Eo(d.nativeEvent)&&(ue!==void 0||te),T=w&&!Ae&&!Z.current;Z.current=!1,!(d.type==="keydown"&&ce.current===null)&&(p||d.type==="keydown"&&ce.current===" "&&B.current||T||(ce.current=null,S(d.nativeEvent)))},onPointerEnter(d){N.current=d.pointerType},onPointerMove(d){if(d.pointerType==="mouse"&&d.buttons===1){let w=J.current;w.dragY+=d.movementY,w.dragY**2>=64&&(w.allowUnselectedMouseUp=!0)}},onPointerDown(d){N.current=d.pointerType,Z.current=!0,le()},onMouseUp(){if(le(),p||N.current==="touch"||Z.current)return;let d=!J.current.allowSelectedMouseUp&&se,w=!J.current.allowUnselectedMouseUp&&!se;d||w||(Z.current=!0,D.current?.click(),Z.current=!1)}},be=O("div",t,{ref:[V,o,R.ref,D],state:u,props:[C,F,g,H]}),he=Ce.useMemo(()=>({selected:se,index:z,textRef:h,selectedByFocus:Se,hasRegistered:X}),[se,z,h,Se,X]);return(0,Yr.jsx)(po.Provider,{value:he,children:be})},"SelectItem")));var nt=I(_(),1);var $r=I(Me(),1);var Xr=nt.forwardRef(r(function(t,o){let n=t.keepMounted??!1,{selected:l}=Vt();return n||l?(0,$r.jsx)(In,{...t,ref:o}):null},"SelectItemIndicator")),In=nt.memo(nt.forwardRef((e,t)=>{let{render:o,className:n,style:l,keepMounted:c,...s}=e,{selected:m}=Vt(),p=nt.useRef(null),{transitionStatus:f,setMounted:g}=ft(m),R=O("span",e,{ref:[t,p],state:{selected:m,transitionStatus:f},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},s],stateAttributesMapping:_e});return Xe({open:m,ref:p,onComplete(){m||g(!1)}}),R}));var bt=I(_(),1);var Kr=bt.memo(bt.forwardRef(r(function(t,o){let{index:n,textRef:l,selectedByFocus:c,hasRegistered:s}=Vt(),{firstItemTextRef:m,selectedItemTextRef:p}=U(),{render:f,className:g,style:h,...R}=t,v=bt.useCallback(k=>{k&&(s&&n===0&&(m.current=k),s&&c&&(p.current=k))},[m,p,n,c,s]);return O("div",t,{ref:[v,o,l],props:R})},"SelectItemText")));var Jr=I(_(),1);var vn={...mt,..._e},Zr=Jr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),{side:p,align:f,arrowRef:g,arrowStyles:h,arrowUncentered:R,alignItemWithTriggerActive:v}=Ke(),k={open:a(m,i.open),side:p,align:f,uncentered:R},x=O("div",t,{state:k,ref:[g,o],props:[{style:h,"aria-hidden":!0},s],stateAttributesMapping:vn});return v?null:x},"SelectArrow"));var en=I(_(),1);var Qr=I(_(),1);var Zt=Qr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,direction:s,keepMounted:m=!1,...p}=t,f=s==="up",{store:g,popupRef:h,listRef:R,handleScrollArrowVisibility:v,scrollArrowsMountedCountRef:C}=U(),{side:k,scrollDownArrowRef:x,scrollUpArrowRef:J}=Ke(),B=f?i.scrollUpArrowVisible:i.scrollDownArrowVisible,A=a(g,B),b=a(g,i.openMethod),L=A&&b!=="touch",M=pt(),ae=f?J:x,{mounted:te,transitionStatus:$,setMounted:se}=ft(L);ee(()=>(C.current+=1,g.state.hasScrollArrows||g.set("hasScrollArrows",!0),()=>{C.current=Math.max(0,C.current-1),C.current===0&&g.state.hasScrollArrows&&g.set("hasScrollArrows",!1)}),[g,C]),Xe({open:L,ref:ae,onComplete(){L||se(!1)}});let z=O("div",t,{ref:[o,ae],state:{direction:s,visible:L,side:k,transitionStatus:$},props:[{"aria-hidden":!0,children:f?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(D){if(D.movementX===0&&D.movementY===0||M.isStarted())return;g.set("activeIndex",null);function ce(){let N=g.state.listElement??h.current;if(!N)return;g.set("activeIndex",null),v();let Z=dt(N.scrollHeight,N.clientHeight),H=gt(N.scrollTop,Z),V=H===(f?0:Z),u=R.current;if(H!==N.scrollTop&&(N.scrollTop=H),u.length===0&&g.set(f?"scrollUpArrowVisible":"scrollDownArrowVisible",!V),V){M.clear();return}if(u.length>0){let S=ae.current?.offsetHeight||0;N.scrollTop=En(u,f,H,N.clientHeight,S,Z)}M.start(40,ce)}r(ce,"scrollNextItem"),M.start(40,ce)},onMouseLeave(){M.clear()}},p],stateAttributesMapping:_e});return te||m?z:null},"SelectScrollArrow"));function En(e,t,o,n,l,c){if(t){let g=0,h=o+l-Ve;for(let C=0;C<e.length;C+=1){let k=e[C];if(k&&k.offsetTop>=h){g=C;break}}let R=Math.max(0,g-1),v=e[R];return R<g&&v?gt(v.offsetTop-l,c):0}let s=e.length-1,m=o+n-l+Ve;for(let g=0;g<e.length;g+=1){let h=e[g];if(h&&h.offsetTop+h.offsetHeight>m){s=Math.max(0,g-1);break}}let p=Math.min(e.length-1,s+1),f=e[p];return p>s&&f?gt(f.offsetTop+f.offsetHeight-n+l,c):c}r(En,"getTargetScrollTop");var tn=I(Me(),1);var on=en.forwardRef(r(function(t,o){return(0,tn.jsx)(Zt,{...t,ref:o,direction:"down"})},"SelectScrollDownArrow"));var rn=I(_(),1);var nn=I(Me(),1);var sn=rn.forwardRef(r(function(t,o){return(0,nn.jsx)(Zt,{...t,ref:o,direction:"up"})},"SelectScrollUpArrow"));var yt=I(_(),1);var Qt=I(_(),1);var fo=Qt.createContext(void 0);function ln(){let e=Qt.useContext(fo);if(e===void 0)throw new Error(je(56));return e}r(ln,"useSelectGroupContext");var an=I(Me(),1);var cn=yt.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,[m,p]=yt.useState(),f=yt.useMemo(()=>({labelId:m,setLabelId:p}),[m,p]),g=O("div",t,{ref:o,props:[{role:"group","aria-labelledby":m},s]});return(0,an.jsx)(fo.Provider,{value:f,children:g})},"SelectGroup"));var un=I(_(),1);var pn=un.forwardRef(r(function(t,o){let{render:n,className:l,style:c,id:s,...m}=t,{setLabelId:p}=ln(),f=bo(s);return ee(()=>{p(f)},[f,p]),O("div",t,{ref:o,props:[{id:f},m]})},"SelectGroupLabel"));var q=I(Me(),1);var Tc=me.Root;function Pc(e){let t=(0,Ot.c)(8),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("flex flex-1 text-start",o),t[3]=o,t[4]=l):l=t[4];let c;return t[5]!==n||t[6]!==l?(c=(0,q.jsx)(me.Value,{"data-slot":"select-value",className:l,...n}),t[5]=n,t[6]=l,t[7]=c):c=t[7],c}r(Pc,"W");function Mc({className:e,size:t="default",children:o,...n}){return(0,q.jsxs)(me.Trigger,{"data-slot":"select-trigger","data-size":t,className:ot("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[o,(0,q.jsx)(me.Icon,{render:(0,q.jsx)(At,{icon:ir,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"})})]})}r(Mc,"T");function Vc({className:e,children:t,side:o="bottom",sideOffset:n=4,align:l="center",alignOffset:c=0,alignItemWithTrigger:s=!0,...m}){return(0,q.jsx)(me.Portal,{children:(0,q.jsx)(me.Positioner,{side:o,sideOffset:n,align:l,alignOffset:c,alignItemWithTrigger:s,className:"isolate z-50",children:(0,q.jsxs)(me.Popup,{"data-slot":"select-content","data-align-trigger":s,className:ot("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...m,children:[(0,q.jsx)(wn,{}),(0,q.jsx)(me.List,{children:t}),(0,q.jsx)(Cn,{})]})})})}r(Vc,"$");function Oc(e){let t=(0,Ot.c)(13),o,n,l;t[0]!==e?({className:n,children:o,...l}=e,t[0]=e,t[1]=o,t[2]=n,t[3]=l):(o=t[1],n=t[2],l=t[3]);let c;t[4]!==n?(c=ot("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),t[4]=n,t[5]=c):c=t[5];let s;t[6]!==o?(s=(0,q.jsx)(me.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:o}),t[6]=o,t[7]=s):s=t[7];let m;t[8]===Symbol.for("react.memo_cache_sentinel")?(m=(0,q.jsx)(me.ItemIndicator,{render:(0,q.jsx)("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:(0,q.jsx)(At,{icon:lr,strokeWidth:2,className:"pointer-events-none"})}),t[8]=m):m=t[8];let p;return t[9]!==l||t[10]!==c||t[11]!==s?(p=(0,q.jsxs)(me.Item,{"data-slot":"select-item",className:c,...l,children:[s,m]}),t[9]=l,t[10]=c,t[11]=s,t[12]=p):p=t[12],p}r(Oc,"A");function wn(e){let t=(0,Ot.c)(9),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",o),t[3]=o,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,q.jsx)(At,{icon:sr,strokeWidth:2}),t[5]=c):c=t[5];let s;return t[6]!==n||t[7]!==l?(s=(0,q.jsx)(me.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:l,...n,children:c}),t[6]=n,t[7]=l,t[8]=s):s=t[8],s}r(wn,"x");function Cn(e){let t=(0,Ot.c)(9),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",o),t[3]=o,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,q.jsx)(At,{icon:nr,strokeWidth:2}),t[5]=c):c=t[5];let s;return t[6]!==n||t[7]!==l?(s=(0,q.jsx)(me.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:l,...n,children:c}),t[6]=n,t[7]=l,t[8]=s):s=t[8],s}r(Cn,"w");export{Tc as a,Pc as b,Mc as c,Vc as d,Oc as e};
|
|
1
|
+
import{a as Nt,b as Ve,c as dt,d as gt,e as Tt,f as dr}from"./chunk-2PJNAWB3.js";import{a as ar,b as cr,c as ur,d as pr,e as mr}from"./chunk-SD4BERSA.js";import{a as fr}from"./chunk-IC4L6G56.js";import{A as _o,B as Uo,C as ko,D as P,G as a,H as Fo,L as Bo,Z as Ho,a as Eo,ca as jo,d as wo,da as zo,ha as Wo,ia as Go,ja as mt,k as Ht,la as qo,ma as $o,n as Vo,oa as Ko,pa as Jo,q as Oo,qa as Zo,ra as Qo,ta as er,ua as tr,va as or,wa as rr,x as Do,y as Lo}from"./chunk-2QSHLBCO.js";import{a as To,b as Xo}from"./chunk-BGBLQ563.js";import{a as Po,b as Mo,c as Yo}from"./chunk-IVFHIQOT.js";import{a as nr,b as sr,i as lr,j as ir,k as At}from"./chunk-QBWRC5YX.js";import{C as pt,F as Ao,I as _e,K as Xe,L as ft,M as ro,N as No,O as ge,P as xe,a as Ut,b as ut,c as Ro,e as bo,f as yo,g as Ft,h as Ct,i as Io,p as Bt,y as vo,z as Co}from"./chunk-CFPZYHPY.js";import{b as jt}from"./chunk-FXCBF4XT.js";import{a as ee,c as de,e as kt}from"./chunk-2OUPA2WJ.js";import{a as wt,c as je,d as So,e as ho,h as oo,i as xo,j as O}from"./chunk-6ST5ECQA.js";import{a as r,d as mn,e as I,f as _,g as dn,h as Me,j as ot}from"./chunk-3XIESWL4.js";var Ot=I(dn(),1),Ec=I(_(),1);var me={};mn(me,{Arrow:()=>Zr,Backdrop:()=>kr,Group:()=>cn,GroupLabel:()=>pn,Icon:()=>Or,Item:()=>qr,ItemIndicator:()=>Xr,ItemText:()=>Kr,Label:()=>Nr,List:()=>Gr,Popup:()=>zr,Portal:()=>_r,Positioner:()=>Fr,Root:()=>Er,ScrollDownArrow:()=>on,ScrollUpArrow:()=>sn,Separator:()=>fr,Trigger:()=>Tr,Value:()=>Mr});var j=I(_(),1);var St=I(_(),1);var no=St.createContext(null),so=St.createContext(null);function U(){let e=St.useContext(no);if(e===null)throw new Error(je(60));return e}r(U,"useSelectRootContext");function zt(){let e=St.useContext(so);if(e===null)throw new Error(je(61));return e}r(zt,"useSelectFloatingContext");var gr=r((e,t)=>Object.is(e,t),"defaultItemEquality");function Ue(e,t,o){return e==null||t==null?Object.is(e,t):o(e,t)}r(Ue,"compareItemEquality");function Sr(e,t,o){return!e||e.length===0?!1:e.some(n=>n===void 0?!1:Ue(t,n,o))}r(Sr,"selectedValueIncludes");function rt(e,t,o){return!e||e.length===0?-1:e.findIndex(n=>n===void 0?!1:Ue(n,t,o))}r(rt,"findItemIndex");function hr(e,t,o){return e.filter(n=>!Ue(t,n,o))}r(hr,"removeItem");var xr=I(_(),1);function Wt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}r(Wt,"serializeValue");var Rr=I(Me(),1);function br(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}r(br,"isGroupedItems");function yr(e){if(!Array.isArray(e))return e!=null&&"null"in e;let t=e;if(br(t)){for(let o of t)for(let n of o.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(let o of t)if(o&&o.value==null&&o.label!=null)return!0;return!1}r(yr,"hasNullItemLabel");function lo(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Wt(e)}r(lo,"stringifyAsLabel");function ze(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Wt(e.value):Wt(e)}r(ze,"stringifyAsValue");function io(e,t,o){function n(){return lo(e,o)}if(r(n,"fallback"),o&&e!=null)return o(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??n();if(Array.isArray(t)){let l=t,c=br(l)?l.flatMap(s=>s.items):l;if(e==null||typeof e!="object"){let s=c.find(m=>m.value===e);return s&&s.label!=null?s.label:n()}if("value"in e){let s=c.find(m=>m&&m.value===e.value);if(s&&s.label!=null)return s.label}}return n()}r(io,"resolveSelectedLabel");function Ir(e,t,o){return e.reduce((n,l,c)=>(c>0&&n.push(", "),n.push((0,Rr.jsx)(xr.Fragment,{children:io(l,t,o)},c)),n),[])}r(Ir,"resolveMultipleLabels");var i={id:P(e=>e.id),labelId:P(e=>e.labelId),modal:P(e=>e.modal),multiple:P(e=>e.multiple),items:P(e=>e.items),itemToStringLabel:P(e=>e.itemToStringLabel),itemToStringValue:P(e=>e.itemToStringValue),isItemEqualToValue:P(e=>e.isItemEqualToValue),value:P(e=>e.value),hasSelectedValue:P(e=>{let{value:t,multiple:o,itemToStringValue:n}=e;return t==null?!1:o&&Array.isArray(t)?t.length>0:ze(t,n)!==""}),hasNullItemLabel:P((e,t)=>t?yr(e.items):!1),open:P(e=>e.open),mounted:P(e=>e.mounted),forceMount:P(e=>e.forceMount),transitionStatus:P(e=>e.transitionStatus),openMethod:P(e=>e.openMethod),activeIndex:P(e=>e.activeIndex),selectedIndex:P(e=>e.selectedIndex),isActive:P((e,t)=>e.activeIndex===t),isSelected:P((e,t)=>{let o=e.isItemEqualToValue,n=e.value;return e.multiple?Array.isArray(n)&&n.some(l=>Ue(t,l,o)):Ue(t,n,o)}),isSelectedByFocus:P((e,t)=>e.selectedIndex===t),popupProps:P(e=>e.popupProps),triggerProps:P(e=>e.triggerProps),triggerElement:P(e=>e.triggerElement),positionerElement:P(e=>e.positionerElement),listElement:P(e=>e.listElement),popupSide:P(e=>e.popupSide),scrollUpArrowVisible:P(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:P(e=>e.scrollDownArrowVisible),hasScrollArrows:P(e=>e.hasScrollArrows)};function vr(e,t,o=(n,l)=>n===l){return e.length===t.length&&e.every((n,l)=>o(n,t[l]))}r(vr,"areArraysEqual");var ht=I(Me(),1);function Er(e){let{id:t,value:o,defaultValue:n=null,onValueChange:l,open:c,defaultOpen:s=!1,onOpenChange:m,name:p,form:f,autoComplete:g,disabled:h=!1,readOnly:R=!1,required:v=!1,modal:C=!0,actionsRef:k,inputRef:x,onOpenChangeComplete:J,items:B,multiple:A=!1,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M=gr,highlightItemOnHover:ae=!0,children:te}=e,{clearErrors:$}=Ro(),{setDirty:se,setTouched:Se,setFocused:Re,validityData:z,setFilled:X,name:D,disabled:ce,validation:N,validationMode:Z}=ut(),H=Ft({id:t}),V=ce||h,u=D??p,[S,le]=ro({controlled:o,default:A?n??oo:n,name:"Select",state:"value"}),[F,be]=ro({controlled:c,default:s,name:"Select",state:"open"}),he=j.useRef([]),d=j.useRef([]),w=j.useRef(null),ue=j.useRef(null),Ae=j.useRef(0),T=j.useRef(null),K=j.useRef([]),W=j.useRef(!1),Ie=j.useRef(null),ie=j.useRef(null),pe=j.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),fe=j.useRef(!1),{mounted:oe,setMounted:Ne,transitionStatus:Q}=ft(F),{openMethod:G,triggerProps:re}=qo(F),y=So(()=>new Fo({id:H,labelId:void 0,modal:C,multiple:A,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M,value:S,open:F,mounted:oe,transitionStatus:Q,items:B,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,We=a(y,i.activeIndex),Te=a(y,i.selectedIndex),Oe=a(y,i.triggerElement),ke=a(y,i.positionerElement),Ge=rr(G),Je=G??Ge??null,It=j.useMemo(()=>A?"":ze(S,L),[A,S,L]),Fe=j.useMemo(()=>A&&Array.isArray(S)?S.map(E=>ze(E,L)):ze(S,L),[A,S,L]),Ze=Ht(y.state.triggerElement),ne=de(()=>Fe);No(Ze,H,S,ne,!V,p);let Be=j.useRef(S),He=A?Array.isArray(S)&&S.length>0:S!=null&&ze(S,L)!=="";ee(()=>{S!==Be.current&&y.set("forceMount",!0)},[y,S]),ee(()=>{X(He)},[He,X]),ee(r(function(){let Y=K.current,ve;if(A){let ye=Array.isArray(S)?S:[];if(ye.length===0)ve=null;else{let $e=ye[ye.length-1],tt=rt(Y,$e,M);ve=tt===-1?null:tt}}else{let ye=rt(Y,S,M);ve=ye===-1?null:ye}ve===null&&(ie.current=null),!F&&y.set("selectedIndex",ve)},"syncSelectedIndex"),[He,A,F,S,K,M,y,ie]);function De(E){let Y=z.initialValue;return Array.isArray(E)&&Array.isArray(Y)?!vr(E,Y,(ve,ye)=>Ue(ve,ye,M)):E!==Y}r(De,"isSelectedValueDirty"),Yo(S,()=>{$(u),se(De(S)),N.change(S)});let st=de((E,Y)=>{m?.(E,Y),!Y.isCanceled&&(be(E),!E&&(Y.reason===ge.focusOut||Y.reason===ge.outsidePress)&&(Se(!0),Re(!1),Z==="onBlur"&&N.commit(S)))}),lt=de(()=>{Ne(!1),y.update({activeIndex:null,openMethod:null}),J?.(!1)});Xe({enabled:!k,open:F,ref:w,onComplete(){F||lt()}}),j.useImperativeHandle(k,()=>({unmount:lt}),[lt]);let Ye=de((E,Y)=>{l?.(E,Y),!Y.isCanceled&&le(E)}),Le=de(()=>{let E=y.state.listElement||w.current;if(!E)return;let Y=dt(E.scrollHeight,E.clientHeight),ve=gt(E.scrollTop,Y),ye=ve>0,$e=ve<Y;y.state.scrollUpArrowVisible!==ye&&y.set("scrollUpArrowVisible",ye),y.state.scrollDownArrowVisible!==$e&&y.set("scrollDownArrowVisible",$e)}),Qe=Ho({open:F,onOpenChange:st,elements:{reference:Oe,floating:ke}}),it=Lo(Qe,{enabled:!R&&!V,event:"mousedown"}),at=_o(Qe),qe=jo(Qe,{enabled:!R&&!V,listRef:he,activeIndex:We,selectedIndex:Te,disabledIndices:oo,onNavigate(E){E===null&&!F||y.set("activeIndex",E)},focusItemOnHover:ae}),et=zo(Qe,{enabled:!R&&!V&&(F||!A),listRef:d,activeIndex:We,selectedIndex:Te,disabledIndices:r(E=>mr(he.current[E]),"disabledIndices"),onMatch(E){F?y.set("activeIndex",E):Ye(K.current[E],xe("none"))},onTyping(E){W.current=E}}),vt=j.useMemo(()=>{let E=wt(et.reference,qe.reference,at.reference,it.reference,re);return H&&(E.id=H),E},[it.reference,et.reference,qe.reference,at.reference,re,H]),Et=j.useMemo(()=>wt(Bo,et.floating,qe.floating,at.floating),[et.floating,qe.floating,at.floating]),Dt=qe.item??xo;ko(()=>{y.update({popupProps:Et,triggerProps:vt})}),ee(()=>{y.update({id:H,modal:C,multiple:A,value:S,open:F,mounted:oe,transitionStatus:Q,popupProps:Et,triggerProps:vt,items:B,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M,openMethod:Je})},[y,H,C,A,S,F,oe,Q,Et,vt,B,b,L,M,Je]);let Pe=j.useMemo(()=>({store:y,name:u,required:v,disabled:V,readOnly:R,multiple:A,highlightItemOnHover:ae,setValue:Ye,setOpen:st,listRef:he,popupRef:w,scrollHandlerRef:ue,handleScrollArrowVisibility:Le,scrollArrowsMountedCountRef:Ae,itemProps:Dt,valueRef:T,valuesRef:K,labelsRef:d,typingRef:W,selectionRef:pe,firstItemTextRef:Ie,selectedItemTextRef:ie,validation:N,onOpenChangeComplete:J,alignItemWithTriggerActiveRef:fe,initialValueRef:Be}),[y,u,v,V,R,A,ae,Ye,st,Dt,N,J,Le]),ct=ho(x,N.inputRef),Lt=A&&Array.isArray(S)&&S.length>0,_t=A?void 0:u,eo=j.useMemo(()=>!A||!Array.isArray(S)||!u?null:S.map(E=>{let Y=ze(E,L);return(0,ht.jsx)("input",{type:"hidden",form:f,name:u,value:Y,disabled:V},Y)}),[A,S,f,u,L,V]);return(0,ht.jsx)(no.Provider,{value:Pe,children:(0,ht.jsxs)(so.Provider,{value:Qe,children:[te,(0,ht.jsx)("input",{...N.getValidationProps(V,{onFocus(){y.state.triggerElement?.focus({focusVisible:!0})},onChange(E){if(E.nativeEvent.defaultPrevented||V||R)return;let Y=E.currentTarget.value,ve=xe(ge.none,E.nativeEvent);function ye(){if(A)return;let $e=Y.toLowerCase(),tt=K.current.findIndex(to=>ze(to,L).toLowerCase()===$e||lo(to,b).toLowerCase()===$e);tt===-1&&(tt=K.current.findIndex((to,fn)=>{let go=d.current[fn];return go!=null&&go.toLowerCase()===$e}));let mo=tt===-1?void 0:K.current[tt];mo!=null&&Ye(mo,ve)}r(ye,"handleChange"),y.set("forceMount",!0),queueMicrotask(ye)}}),id:H&&_t==null?`${H}-hidden-input`:void 0,form:f,name:_t,autoComplete:g,value:It,disabled:V,required:v&&!Lt,readOnly:R,ref:ct,style:u?Mo:Po,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),eo]})})}r(Er,"SelectRoot");var Ar=I(_(),1);function wr(e){return e==null?void 0:`${e}-label`}r(wr,"getDefaultLabelId");function Cr(e,t){return e??t}r(Cr,"resolveAriaLabelledBy");var Nr=Ar.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,m=s;delete m.id;let p=ut(),{store:f}=U(),g=a(f,i.triggerElement),h=a(f,i.id),R=wr(h),v=Co({id:R,fallbackControlId:g?.id??h,setLabelId(C){f.set("labelId",C)}});return O("div",t,{ref:o,state:p.state,props:[v,s],stateAttributesMapping:Ut})},"SelectLabel"));var xt=I(_(),1);var Gt=2,gn=400,Sn={...Go,...Ut,popupSide:r(e=>e?{"data-popup-side":e}:null,"popupSide"),value:r(()=>null,"value")},Tr=xt.forwardRef(r(function(t,o){let{render:n,className:l,id:c,disabled:s=!1,nativeButton:m=!0,style:p,...f}=t,{setTouched:g,setFocused:h,validationMode:R,state:v,disabled:C}=ut(),{labelId:k}=yo(),{store:x,setOpen:J,selectionRef:B,validation:A,readOnly:b,required:L,alignItemWithTriggerActiveRef:M,disabled:ae}=U(),te=C||ae||s,$=a(x,i.open),se=a(x,i.mounted),Se=a(x,i.value),Re=a(x,i.triggerProps),z=a(x,i.positionerElement),X=a(x,i.listElement),D=a(x,i.popupSide),ce=a(x,i.id),N=a(x,i.labelId),Z=a(x,i.hasSelectedValue),H=se&&z?D:null,V=c??ce,u=Cr(k,N);Ft({id:V});let S=Ht(z),le=xt.useRef(null),{getButtonProps:F,buttonRef:be}=jt({disabled:te,native:m}),he=de(W=>{x.set("triggerElement",W)}),d=pt(),w=pt(),ue=pt();xt.useEffect(()=>{if($)return ue.start(gn,()=>{B.current.allowUnselectedMouseUp=!0,B.current.allowSelectedMouseUp=!0}),()=>{ue.clear()};B.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},w.clear()},[$,B,w,ue]);let Ae=wt(Re,{id:V,role:"combobox","aria-expanded":$?"true":"false","aria-haspopup":"listbox","aria-controls":$?X?.id??vo(z)?.id:void 0,"aria-labelledby":u,"aria-readonly":b||void 0,"aria-required":L||void 0,tabIndex:te?-1:0,onFocus(W){h(!0),$&&M.current&&J(!1,xe(ge.none,W.nativeEvent)),d.start(0,()=>{x.set("forceMount",!0)})},onBlur(W){Bt(z,W.relatedTarget)||(g(!0),h(!1),R==="onBlur"&&A.commit(Se))},onMouseDown(W){if($)return;let Ie=Ct(W.currentTarget);function ie(pe){if(!le.current)return;let fe=pe.target;if(Bt(le.current,fe)||Bt(S.current,fe))return;let oe=pr(le.current);pe.clientX>=oe.left-Gt&&pe.clientX<=oe.right+Gt&&pe.clientY>=oe.top-Gt&&pe.clientY<=oe.bottom+Gt||J(!1,xe(ge.cancelOpen,pe))}r(ie,"handleMouseUp"),w.start(0,()=>{Ie.addEventListener("mouseup",ie,{once:!0})})}},f,F),T=A.getValidationProps(te,Ae);T.role="combobox";let K={...v,open:$,disabled:te,value:Se,readOnly:b,popupSide:H,placeholder:!Z};return O("button",t,{ref:[o,le,be,he],state:K,stateAttributesMapping:Sn,props:T})},"SelectTrigger"));var Pr=I(_(),1);var hn={value:r(()=>null,"value")},Mr=Pr.forwardRef(r(function(t,o){let{className:n,render:l,children:c,placeholder:s,style:m,...p}=t,{store:f,valueRef:g}=U(),h=a(f,i.value),R=a(f,i.items),v=a(f,i.itemToStringLabel),C=a(f,i.hasSelectedValue),k=!C&&s!=null&&c==null,x=a(f,i.hasNullItemLabel,k),J={value:h,placeholder:!C},B=null;return typeof c=="function"?B=c(h):c!=null?B=c:!C&&s!=null&&!x?B=s:Array.isArray(h)?B=Ir(h,R,v):B=io(h,R,v),O("span",t,{state:J,ref:[o,g],props:[{children:B},p],stateAttributesMapping:hn})},"SelectValue"));var Vr=I(_(),1);var Or=Vr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),f={open:a(m,i.open)};return O("span",t,{state:f,ref:o,props:[{"aria-hidden":!0,children:"\u25BC"},s],stateAttributesMapping:Wo})},"SelectIcon"));var Lr=I(_(),1);var ao=I(_(),1);var Dr=ao.createContext(void 0);var co=I(Me(),1);var _r=Lr.forwardRef(r(function(t,o){let{store:n}=U(),l=a(n,i.mounted),c=a(n,i.forceMount);return l||c?(0,co.jsx)(Dr.Provider,{value:!0,children:(0,co.jsx)(Oo,{ref:o,...t})}):null},"SelectPortal"));var Ur=I(_(),1);var xn={...mt,..._e},kr=Ur.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),p=a(m,i.open),f=a(m,i.mounted),g=a(m,i.transitionStatus);return O("div",t,{state:{open:p,transitionStatus:g},ref:o,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:xn})},"SelectBackdrop"));var Ee=I(_(),1);var Yt=I(_(),1);var uo=Yt.createContext(void 0);function Ke(){let e=Yt.useContext(uo);if(!e)throw new Error(je(59));return e}r(Ke,"useSelectPositionerContext");function Rt(e,t){e&&Object.assign(e.style,t)}r(Rt,"clearStyles");var qt={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var Pt=I(Me(),1);var Rn={position:"fixed"},Fr=Ee.forwardRef(r(function(t,o){let{anchor:n,positionMethod:l="absolute",className:c,render:s,side:m="bottom",align:p="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:h="clipping-ancestors",collisionPadding:R,arrowPadding:v=5,sticky:C=!1,disableAnchorTracking:k,alignItemWithTrigger:x=!0,collisionAvoidance:J=Vo,style:B,...A}=t,{store:b,listRef:L,labelsRef:M,alignItemWithTriggerActiveRef:ae,selectedItemTextRef:te,valuesRef:$,initialValueRef:se,popupRef:Se,setValue:Re}=U(),z=zt(),X=a(b,i.open),D=a(b,i.mounted),ce=a(b,i.modal),N=a(b,i.value),Z=a(b,i.openMethod),H=a(b,i.positionerElement),V=a(b,i.triggerElement),u=a(b,i.isItemEqualToValue),S=a(b,i.transitionStatus),le=Ee.useRef(null),F=Ee.useRef(null),[be,he]=Ee.useState(x),d=D&&be&&Z!=="touch";!D&&be!==x&&he(x),ee(()=>{D||(i.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),i.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,D]),Ee.useImperativeHandle(ae,()=>d),er((d||ce)&&X,Z==="touch",H,V);let w=Ko({anchor:n,floatingRootContext:z,positionMethod:l,mounted:D,side:m,sideOffset:f,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:h,collisionPadding:R,sticky:C,disableAnchorTracking:k??d,collisionAvoidance:J,keepMounted:!0}),ue=d?"none":w.side,Ae=d?Rn:w.positionerStyles,T={open:X,side:ue,align:w.align,anchorHidden:w.anchorHidden};ee(()=>{b.set("popupSide",w.side)},[b,w.side]);let K=de(fe=>{b.set("positionerElement",fe)}),W=Qo(t,T,{styles:Ae,transitionStatus:S,props:A,refs:[o,K],hidden:!D,inert:!X}),Ie=Ee.useRef(0),ie=de(fe=>{if(fe.size===0&&Ie.current===0||$.current.length===0)return;let oe=Ie.current;if(Ie.current=fe.size,fe.size===oe)return;let Ne=xe(ge.none);if(oe!==0&&!b.state.multiple&&N!==null&&rt($.current,N,u)===-1){let G=se.current,y=G!=null&&rt($.current,G,u)!==-1?G:null;Re(y,Ne),y===null&&(b.set("selectedIndex",null),te.current=null)}if(oe!==0&&b.state.multiple&&Array.isArray(N)){let Q=r(re=>rt($.current,re,u)!==-1,"hasVisibleItem"),G=N.filter(re=>Q(re));(G.length!==N.length||G.some(re=>!Sr(N,re,u)))&&(Re(G,Ne),G.length===0&&(b.set("selectedIndex",null),te.current=null))}if(X&&d){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let Q={height:""};Rt(H,Q),Rt(Se.current,Q)}}),pe=Ee.useMemo(()=>({...w,side:ue,alignItemWithTriggerActive:d,setControlledAlignItemWithTrigger:he,scrollUpArrowRef:le,scrollDownArrowRef:F}),[w,ue,d,he]);return(0,Pt.jsx)(ur,{elementsRef:L,labelsRef:M,onMapChange:ie,children:(0,Pt.jsxs)(uo.Provider,{value:pe,children:[D&&ce&&(0,Pt.jsx)(Jo,{inert:$o(!X),cutout:V}),W]})})},"SelectPositioner"));var we=I(_(),1);var Kt=I(Me(),1);var bn={...mt,..._e},zr=we.forwardRef(r(function(t,o){let{render:n,className:l,style:c,finalFocus:s,...m}=t,{store:p,popupRef:f,onOpenChangeComplete:g,setOpen:h,valueRef:R,firstItemTextRef:v,selectedItemTextRef:C,multiple:k,handleScrollArrowVisibility:x,scrollHandlerRef:J,listRef:B,highlightItemOnHover:A}=U(),{side:b,align:L,alignItemWithTriggerActive:M,isPositioned:ae,setControlledAlignItemWithTrigger:te}=Ke(),$=or(!0)!=null,se=zt(),Se=Xo(),{nonce:Re,disableStyleElements:z}=dr(),X=a(p,i.id),D=a(p,i.open),ce=a(p,i.openMethod),N=a(p,i.mounted),Z=a(p,i.popupProps),H=a(p,i.transitionStatus),V=a(p,i.triggerElement),u=a(p,i.positionerElement),S=a(p,i.listElement),le=we.useRef(!1),F=we.useRef(!1),be=we.useRef({}),he=Ao(),d=de(T=>{if(!u||!f.current||!F.current)return;if(le.current||!M){x();return}let K=u.style.top==="0px",W=u.style.bottom==="0px";if(!K&&!W){x();return}let Ie=Hr(u),ie=Mt(u.getBoundingClientRect().height,"y",Ie),pe=Ct(u),fe=kt(u),oe=fe.getComputedStyle(u),Ne=parseFloat(oe.marginTop),Q=parseFloat(oe.marginBottom),G=Br(fe.getComputedStyle(f.current)),re=Math.min(pe.documentElement.clientHeight-Ne-Q,G),y=T.scrollTop,We=$t(T),Te=0,Oe=null,ke=!1,Ge=!1,Je=r(ne=>{u.style.height=`${ne}px`},"setHeight"),It=r((ne,Be)=>{let He=Nt(ne,0,re-ie);He>0&&Je(ie+He),T.scrollTop=Be,re-(ie+He)<=Ve&&(le.current=!0),x()},"handleSmallDiff"),Fe=K?We-y:y,Ze=Math.min(ie+Fe,re);if(Te=Ze,Fe<=Ve){It(Fe,K?We:0);return}if(re-Ze>Ve)K?Ge=!0:Oe=0;else if(ke=!0,W&&y<We){let ne=ie+Fe-re;Oe=y-(Fe-ne)}if(Te=Math.ceil(Te),Te!==0&&Je(Te),Ge||Oe!=null){let ne=$t(T),Be=Ge?ne:Nt(Oe,0,ne);Math.abs(T.scrollTop-Be)>Ve&&(T.scrollTop=Be)}(ke||Te>=re-Ve)&&(le.current=!0),x()});we.useImperativeHandle(J,()=>d,[d]),Xe({open:D,ref:f,onComplete(){D&&g?.(!0)}});let w={open:D,transitionStatus:H,side:b,align:L};ee(()=>{!u||!f.current||Object.keys(be.current).length||(be.current={top:u.style.top||"0",left:u.style.left||"0",right:u.style.right,height:u.style.height,bottom:u.style.bottom,minHeight:u.style.minHeight,maxHeight:u.style.maxHeight,marginTop:u.style.marginTop,marginBottom:u.style.marginBottom})},[f,u]),ee(()=>{D||M||(F.current=!1,le.current=!1,Rt(u,be.current))},[D,M,u,f]),ee(()=>{let T=f.current;if(!D||!V||!u||!T||M&&!ae||p.state.transitionStatus==="ending")return;if(!M){F.current=!0,he.request(x),T.style.removeProperty("--transform-origin");return}let K=yn(T);T.style.removeProperty("--transform-origin");try{let W=C.current;W?.isConnected||(W=!i.hasSelectedValue(p.state)&&v.current?.isConnected?v.current:null);let Ie=R.current,ie=kt(u),pe=ie.getComputedStyle(u),fe=ie.getComputedStyle(T),oe=Ct(V),Ne=Hr(V),Q=Xt(V.getBoundingClientRect(),Ne),G=Xt(u.getBoundingClientRect(),Ne),re=Q.height,y=S||T,We=y.scrollHeight,Te=parseFloat(fe.borderBottomWidth),Oe=parseFloat(pe.marginTop)||10,ke=parseFloat(pe.marginBottom)||10,Ge=parseFloat(pe.minHeight)||100,Je=Br(fe),It=5,Fe=5,Ze=20,ne=oe.documentElement.clientHeight-Oe-ke,Be=oe.documentElement.clientWidth,He=ne-Q.bottom+re,De,st=Se==="rtl"?Q.right-G.width:Q.left,lt=0;if(W&&Ie){let Pe=Xt(Ie.getBoundingClientRect(),Ne);De=Xt(W.getBoundingClientRect(),Ne),st=G.left+(Se==="rtl"?Pe.right-De.right:Pe.left-De.left);let ct=Pe.top-Q.top+Pe.height/2;lt=De.top-G.top+De.height/2-ct}let Ye=He+lt+ke+Te,Le=Math.min(ne,Ye),Qe=ne-Oe-ke,it=Ye-Le,at=Be-Fe;u.style.left=`${Nt(st,It,at-G.width)}px`,u.style.height=`${Le}px`,u.style.maxHeight="none",u.style.marginTop=`${Oe}px`,u.style.marginBottom=`${ke}px`,T.style.height="100%";let qe=$t(y),et=it>=qe-Ve;et&&(Le=Math.min(ne,G.height)-(it-qe));let vt=Q.top<Ze||Q.bottom>ne-Ze||Math.ceil(Le)+Ve<Math.min(We,Ge),Et=(ie.visualViewport?.scale??1)!==1&&Io.engine.webkit;if(vt||Et){F.current=!0,Rt(u,be.current),te(!1);return}let Dt=Math.max(Ge,Le);if(et){let Pe=Math.max(0,ne-Ye);u.style.top=G.height>=Qe?"0":`${Pe}px`,u.style.height=`${Le}px`,y.scrollTop=$t(y)}else u.style.bottom="0",y.scrollTop=it;if(De){let Pe=G.top,ct=G.height,Lt=De.top+De.height/2,_t=ct>0?(Lt-Pe)/ct*100:50,eo=Nt(_t,0,100);T.style.setProperty("--transform-origin",`50% ${eo}%`)}(Dt===ne||Le>=Je)&&(le.current=!0),x(),A&&p.state.selectedIndex===null&&p.state.activeIndex===null&&B.current[0]!=null&&p.set("activeIndex",0),F.current=!0}finally{K()}},[p,D,u,V,R,v,C,f,x,M,te,he,S,B,A,Se,ae]),we.useEffect(()=>{if(!M||!u||!D)return;let T=kt(u);function K(W){h(!1,xe(ge.windowResize,W))}return r(K,"handleResize"),To(T,"resize",K)},[h,M,u,D]);let ue={...S?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":k||void 0,id:`${X}-list`},onKeyDown(T){$&&tr.has(T.key)&&T.stopPropagation()},onScroll(T){S||d(T.currentTarget)},...M&&{style:S?{height:"100%"}:qt}},Ae=O("div",t,{ref:[o,f],state:w,stateAttributesMapping:bn,props:[Z,ue,Zo(H),{className:!S&&M?Tt.className:void 0},m]});return(0,Kt.jsxs)(we.Fragment,{children:[!z&&Tt.getElement(Re),(0,Kt.jsx)(Do,{context:se,modal:!1,disabled:!N,openInteractionType:ce,returnFocus:s,restoreFocus:!0,children:Ae})]})},"SelectPopup"));function Br(e){let t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}r(Br,"getMaxPopupHeight");function $t(e){return dt(e.scrollHeight,e.clientHeight)}r($t,"getMaxScrollTop");function Hr(e){return Uo.getScale(e)}r(Hr,"getScale");function Mt(e,t,o){return e/o[t]}r(Mt,"normalizeSize");function Xt(e,t){return wo({x:Mt(e.x,"x",t),y:Mt(e.y,"y",t),width:Mt(e.width,"x",t),height:Mt(e.height,"y",t)})}r(Xt,"normalizeRect");var jr=[["transform","none"],["scale","1"],["translate","0 0"]];function yn(e){let{style:t}=e,o={};for(let[n,l]of jr)o[n]=t.getPropertyValue(n),t.setProperty(n,l,"important");return()=>{for(let[n]of jr){let l=o[n];l?t.setProperty(n,l):t.removeProperty(n)}}}r(yn,"unsetTransformStyles");var Wr=I(_(),1);var Gr=Wr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m,scrollHandlerRef:p}=U(),{alignItemWithTriggerActive:f}=Ke(),g=a(m,i.hasScrollArrows),h=a(m,i.openMethod),R=a(m,i.multiple),C={id:`${a(m,i.id)}-list`,role:"listbox","aria-multiselectable":R||void 0,onScroll(x){p.current?.(x.currentTarget)},...f&&{style:qt},className:g&&h!=="touch"?Tt.className:void 0},k=de(x=>{m.set("listElement",x)});return O("div",t,{ref:[o,k],props:[C,s]})},"SelectList"));var Ce=I(_(),1);var Jt=I(_(),1);var po=Jt.createContext(void 0);function Vt(){let e=Jt.useContext(po);if(!e)throw new Error(je(57));return e}r(Vt,"useSelectItemContext");var Yr=I(Me(),1);var qr=Ce.memo(Ce.forwardRef(r(function(t,o){let{render:n,className:l,style:c,value:s=null,label:m,disabled:p=!1,nativeButton:f=!1,...g}=t,h=Ce.useRef(null),R=cr({label:m,textRef:h,indexGuessBehavior:ar.GuessFromOrder}),{store:v,itemProps:C,setOpen:k,setValue:x,selectionRef:J,typingRef:B,valuesRef:A,multiple:b,selectedItemTextRef:L,disabled:M,readOnly:ae}=U(),te=a(v,i.isActive,R.index),$=a(v,i.open),se=a(v,i.isSelected,s),Se=a(v,i.isSelectedByFocus,R.index),Re=a(v,i.isItemEqualToValue),z=R.index,X=z!==-1,D=Ce.useRef(null);ee(()=>{if(!X)return;let d=A.current;return d[z]=s,()=>{delete d[z]}},[X,z,s,A]),ee(()=>{if(!X)return;let d=v.state.value,w=d;b&&Array.isArray(d)&&(w=d.length>0?d[d.length-1]:void 0),w!==void 0&&Ue(s,w,Re)&&(v.set("selectedIndex",z),h.current&&(L.current=h.current))},[X,z,b,Re,v,s,L]);let ce=Ce.useRef(null),N=Ce.useRef("mouse"),Z=Ce.useRef(!1),{getButtonProps:H,buttonRef:V}=jt({disabled:p,focusableWhenDisabled:!0,native:f,composite:!0}),u={disabled:p,selected:se,highlighted:te};function S(d){if(M||ae)return;let w=v.state.value;if(b){let ue=Array.isArray(w)?w:[],Ae=se?hr(ue,s,Re):[...ue,s];x(Ae,xe(ge.itemPress,d))}else x(s,xe(ge.itemPress,d)),k(!1,xe(ge.itemPress,d))}r(S,"commitSelection");function le(){J.current.dragY=0}r(le,"resetDragMovement");let F={role:"option","aria-selected":se,tabIndex:$&&te?0:-1,onKeyDown(d){ce.current=d.key,v.set("activeIndex",z),d.key===" "&&B.current&&d.preventDefault()},onClick(d){let w=d.type==="click"&&N.current!=="touch",ue=d.nativeEvent.pointerType,Ae=w&&Eo(d.nativeEvent)&&(ue!==void 0||te),T=w&&!Ae&&!Z.current;Z.current=!1,!(d.type==="keydown"&&ce.current===null)&&(p||d.type==="keydown"&&ce.current===" "&&B.current||T||(ce.current=null,S(d.nativeEvent)))},onPointerEnter(d){N.current=d.pointerType},onPointerMove(d){if(d.pointerType==="mouse"&&d.buttons===1){let w=J.current;w.dragY+=d.movementY,w.dragY**2>=64&&(w.allowUnselectedMouseUp=!0)}},onPointerDown(d){N.current=d.pointerType,Z.current=!0,le()},onMouseUp(){if(le(),p||N.current==="touch"||Z.current)return;let d=!J.current.allowSelectedMouseUp&&se,w=!J.current.allowUnselectedMouseUp&&!se;d||w||(Z.current=!0,D.current?.click(),Z.current=!1)}},be=O("div",t,{ref:[V,o,R.ref,D],state:u,props:[C,F,g,H]}),he=Ce.useMemo(()=>({selected:se,index:z,textRef:h,selectedByFocus:Se,hasRegistered:X}),[se,z,h,Se,X]);return(0,Yr.jsx)(po.Provider,{value:he,children:be})},"SelectItem")));var nt=I(_(),1);var $r=I(Me(),1);var Xr=nt.forwardRef(r(function(t,o){let n=t.keepMounted??!1,{selected:l}=Vt();return n||l?(0,$r.jsx)(In,{...t,ref:o}):null},"SelectItemIndicator")),In=nt.memo(nt.forwardRef((e,t)=>{let{render:o,className:n,style:l,keepMounted:c,...s}=e,{selected:m}=Vt(),p=nt.useRef(null),{transitionStatus:f,setMounted:g}=ft(m),R=O("span",e,{ref:[t,p],state:{selected:m,transitionStatus:f},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},s],stateAttributesMapping:_e});return Xe({open:m,ref:p,onComplete(){m||g(!1)}}),R}));var bt=I(_(),1);var Kr=bt.memo(bt.forwardRef(r(function(t,o){let{index:n,textRef:l,selectedByFocus:c,hasRegistered:s}=Vt(),{firstItemTextRef:m,selectedItemTextRef:p}=U(),{render:f,className:g,style:h,...R}=t,v=bt.useCallback(k=>{k&&(s&&n===0&&(m.current=k),s&&c&&(p.current=k))},[m,p,n,c,s]);return O("div",t,{ref:[v,o,l],props:R})},"SelectItemText")));var Jr=I(_(),1);var vn={...mt,..._e},Zr=Jr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),{side:p,align:f,arrowRef:g,arrowStyles:h,arrowUncentered:R,alignItemWithTriggerActive:v}=Ke(),k={open:a(m,i.open),side:p,align:f,uncentered:R},x=O("div",t,{state:k,ref:[g,o],props:[{style:h,"aria-hidden":!0},s],stateAttributesMapping:vn});return v?null:x},"SelectArrow"));var en=I(_(),1);var Qr=I(_(),1);var Zt=Qr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,direction:s,keepMounted:m=!1,...p}=t,f=s==="up",{store:g,popupRef:h,listRef:R,handleScrollArrowVisibility:v,scrollArrowsMountedCountRef:C}=U(),{side:k,scrollDownArrowRef:x,scrollUpArrowRef:J}=Ke(),B=f?i.scrollUpArrowVisible:i.scrollDownArrowVisible,A=a(g,B),b=a(g,i.openMethod),L=A&&b!=="touch",M=pt(),ae=f?J:x,{mounted:te,transitionStatus:$,setMounted:se}=ft(L);ee(()=>(C.current+=1,g.state.hasScrollArrows||g.set("hasScrollArrows",!0),()=>{C.current=Math.max(0,C.current-1),C.current===0&&g.state.hasScrollArrows&&g.set("hasScrollArrows",!1)}),[g,C]),Xe({open:L,ref:ae,onComplete(){L||se(!1)}});let z=O("div",t,{ref:[o,ae],state:{direction:s,visible:L,side:k,transitionStatus:$},props:[{"aria-hidden":!0,children:f?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(D){if(D.movementX===0&&D.movementY===0||M.isStarted())return;g.set("activeIndex",null);function ce(){let N=g.state.listElement??h.current;if(!N)return;g.set("activeIndex",null),v();let Z=dt(N.scrollHeight,N.clientHeight),H=gt(N.scrollTop,Z),V=H===(f?0:Z),u=R.current;if(H!==N.scrollTop&&(N.scrollTop=H),u.length===0&&g.set(f?"scrollUpArrowVisible":"scrollDownArrowVisible",!V),V){M.clear();return}if(u.length>0){let S=ae.current?.offsetHeight||0;N.scrollTop=En(u,f,H,N.clientHeight,S,Z)}M.start(40,ce)}r(ce,"scrollNextItem"),M.start(40,ce)},onMouseLeave(){M.clear()}},p],stateAttributesMapping:_e});return te||m?z:null},"SelectScrollArrow"));function En(e,t,o,n,l,c){if(t){let g=0,h=o+l-Ve;for(let C=0;C<e.length;C+=1){let k=e[C];if(k&&k.offsetTop>=h){g=C;break}}let R=Math.max(0,g-1),v=e[R];return R<g&&v?gt(v.offsetTop-l,c):0}let s=e.length-1,m=o+n-l+Ve;for(let g=0;g<e.length;g+=1){let h=e[g];if(h&&h.offsetTop+h.offsetHeight>m){s=Math.max(0,g-1);break}}let p=Math.min(e.length-1,s+1),f=e[p];return p>s&&f?gt(f.offsetTop+f.offsetHeight-n+l,c):c}r(En,"getTargetScrollTop");var tn=I(Me(),1);var on=en.forwardRef(r(function(t,o){return(0,tn.jsx)(Zt,{...t,ref:o,direction:"down"})},"SelectScrollDownArrow"));var rn=I(_(),1);var nn=I(Me(),1);var sn=rn.forwardRef(r(function(t,o){return(0,nn.jsx)(Zt,{...t,ref:o,direction:"up"})},"SelectScrollUpArrow"));var yt=I(_(),1);var Qt=I(_(),1);var fo=Qt.createContext(void 0);function ln(){let e=Qt.useContext(fo);if(e===void 0)throw new Error(je(56));return e}r(ln,"useSelectGroupContext");var an=I(Me(),1);var cn=yt.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,[m,p]=yt.useState(),f=yt.useMemo(()=>({labelId:m,setLabelId:p}),[m,p]),g=O("div",t,{ref:o,props:[{role:"group","aria-labelledby":m},s]});return(0,an.jsx)(fo.Provider,{value:f,children:g})},"SelectGroup"));var un=I(_(),1);var pn=un.forwardRef(r(function(t,o){let{render:n,className:l,style:c,id:s,...m}=t,{setLabelId:p}=ln(),f=bo(s);return ee(()=>{p(f)},[f,p]),O("div",t,{ref:o,props:[{id:f},m]})},"SelectGroupLabel"));var q=I(Me(),1);var Tc=me.Root;function Pc(e){let t=(0,Ot.c)(8),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("flex flex-1 text-start",o),t[3]=o,t[4]=l):l=t[4];let c;return t[5]!==n||t[6]!==l?(c=(0,q.jsx)(me.Value,{"data-slot":"select-value",className:l,...n}),t[5]=n,t[6]=l,t[7]=c):c=t[7],c}r(Pc,"W");function Mc({className:e,size:t="default",children:o,...n}){return(0,q.jsxs)(me.Trigger,{"data-slot":"select-trigger","data-size":t,className:ot("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[o,(0,q.jsx)(me.Icon,{render:(0,q.jsx)(At,{icon:ir,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"})})]})}r(Mc,"T");function Vc({className:e,children:t,side:o="bottom",sideOffset:n=4,align:l="center",alignOffset:c=0,alignItemWithTrigger:s=!0,...m}){return(0,q.jsx)(me.Portal,{children:(0,q.jsx)(me.Positioner,{side:o,sideOffset:n,align:l,alignOffset:c,alignItemWithTrigger:s,className:"isolate z-50",children:(0,q.jsxs)(me.Popup,{"data-slot":"select-content","data-align-trigger":s,className:ot("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...m,children:[(0,q.jsx)(wn,{}),(0,q.jsx)(me.List,{children:t}),(0,q.jsx)(Cn,{})]})})})}r(Vc,"$");function Oc(e){let t=(0,Ot.c)(13),o,n,l;t[0]!==e?({className:n,children:o,...l}=e,t[0]=e,t[1]=o,t[2]=n,t[3]=l):(o=t[1],n=t[2],l=t[3]);let c;t[4]!==n?(c=ot("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),t[4]=n,t[5]=c):c=t[5];let s;t[6]!==o?(s=(0,q.jsx)(me.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:o}),t[6]=o,t[7]=s):s=t[7];let m;t[8]===Symbol.for("react.memo_cache_sentinel")?(m=(0,q.jsx)(me.ItemIndicator,{render:(0,q.jsx)("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:(0,q.jsx)(At,{icon:lr,strokeWidth:2,className:"pointer-events-none"})}),t[8]=m):m=t[8];let p;return t[9]!==l||t[10]!==c||t[11]!==s?(p=(0,q.jsxs)(me.Item,{"data-slot":"select-item",className:c,...l,children:[s,m]}),t[9]=l,t[10]=c,t[11]=s,t[12]=p):p=t[12],p}r(Oc,"A");function wn(e){let t=(0,Ot.c)(9),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",o),t[3]=o,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,q.jsx)(At,{icon:sr,strokeWidth:2}),t[5]=c):c=t[5];let s;return t[6]!==n||t[7]!==l?(s=(0,q.jsx)(me.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:l,...n,children:c}),t[6]=n,t[7]=l,t[8]=s):s=t[8],s}r(wn,"x");function Cn(e){let t=(0,Ot.c)(9),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",o),t[3]=o,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,q.jsx)(At,{icon:nr,strokeWidth:2}),t[5]=c):c=t[5];let s;return t[6]!==n||t[7]!==l?(s=(0,q.jsx)(me.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:l,...n,children:c}),t[6]=n,t[7]=l,t[8]=s):s=t[8],s}r(Cn,"w");export{Tc as a,Pc as b,Mc as c,Vc as d,Oc as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Et}from"./chunk-KUVMORDQ.js";import{a as me}from"./chunk-EQZTSISX.js";import{a as Lt,b as At,c as Kt,d as Ot,e as ot}from"./chunk-Y5Y7DHFW.js";import{a as zt}from"./chunk-QWGT25SE.js";import{e as Dt}from"./chunk-XF2B7P5A.js";import{a as It,b as Ct,c as Tt,d as Rt,e as Pe}from"./chunk-UU2QJMGJ.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as _t}from"./chunk-CTNB2KIA.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as et,b as tt,c as rt,d as yt,e as Nt,f as at,g as st,h as wt,i as St}from"./chunk-CU55Y5TV.js";import"./chunk-4UOFSGUS.js";import"./chunk-ILNELDFC.js";import{a as $t}from"./chunk-X665E2HU.js";import{a as qt,b as kt}from"./chunk-GRL5MG3Z.js";import{e as ut}from"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import{a as Mt}from"./chunk-LFKCLLPT.js";import"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as Ze}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as Be}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as Ae}from"./chunk-ERMTJYQF.js";import{c as Ee}from"./chunk-XDAT7LHC.js";import{f as mt}from"./chunk-EN2QAEO4.js";import"./chunk-XBDKZZ67.js";import{a as ft}from"./chunk-XQCVZAGU.js";import{a as lt,b as nt,c as it,d as je,e as de,f as B}from"./chunk-MIQTKZAR.js";import{a as fe,b as Ke,c as Oe,d as gt,e as pe}from"./chunk-UZERI5YC.js";import{d as ge,f as pt,g as xt,h as bt,i as vt,m as Qe,p as Ge}from"./chunk-OG4N2XHD.js";import"./chunk-AADILRJW.js";import{a as o,e as Ye,f as Ft,g as Jt,h as Ht,j as ht}from"./chunk-3XIESWL4.js";var j=Ye(Ft(),1);var xe=Ye(Jt(),1);var t=Ye(Ht(),1);var Wt=o((s,e)=>s<e?-1:s>e?1:0,"Jt"),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(s===null||typeof s!="object")return JSON.stringify(s);if(Array.isArray(s))return`[${s.map(d=>dt(d)).join(",")}]`;let e=Object.getPrototypeOf(s);if(e!==null&&e!==Object.prototype){let d=s.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${d} 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).toSorted(Wt),r=[];for(let d of a){let i=l[d];i!==void 0&&r.push(`${JSON.stringify(d)}:${dt(i)}`)}return`{${r.join(",")}}`},"Ze"),Pt=o((s,e,l)=>`${s}:${e}:${dt(l??{})}`,"gt"),Ut=o((s,e)=>s==="gauge"?e.last:s==="histogram"?e.sum/Math.max(1,e.count):e.sum,"ft"),Bt=o((s,e)=>Ut(s,e),"Ht"),Gt=o(s=>Ut(s.kind,s),"Gt"),ct=o(s=>Number.isInteger(s)?s.toLocaleString():s.toLocaleString(void 0,{maximumFractionDigits:2}),"Xe"),Vt=o(s=>Array.isArray(s?.series)?s.series:[],"Wt"),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},"Yt"),Zt={counter:"secondary",gauge:"default",histogram:"outline"},Qt=o(s=>{let e=(0,xe.c)(18),{name:l,onOpenTrace:a,traceId:r}=s,d=ge();if(r===void 0){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=u):u=e[0],u}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 u=`mt-instrument-trace-${l}`,m;return e[3]!==n||e[4]!==u||e[5]!==r?(m=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":u,title:r,children:n}),e[3]=n,e[4]=u,e[5]=r,e[6]=m):m=e[6],m}let w=`mt-instrument-trace-${l}`,x;e[7]!==a||e[8]!==r?(x=o(()=>{a(r)},"x"),e[7]=a,e[8]=r,e[9]=x):x=e[9];let S;e[10]!==d||e[11]!==r?(S=d("Open the exemplar trace {trace}",{trace:r}),e[10]=d,e[11]=r,e[12]=S):S=e[12];let f;return e[13]!==n||e[14]!==w||e[15]!==x||e[16]!==S?(f=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":w,onClick:x,title:S,type:"button",children:n}),e[13]=n,e[14]=w,e[15]=x,e[16]=S,e[17]=f):f=e[17],f},"Zt"),er=o(s=>{let e=(0,xe.c)(105),{onOpenTrace:l,shardKey:a}=s,r=ge(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={},e[0]=d):d=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:w,errorSource:x}=Ee(Ae.getMetricSeries,d,i),S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S={},e[3]=S):S=e[3];let f;e[4]!==a?(f={live:!0,shardKey:a},e[4]=a,e[5]=f):f=e[5];let{data:u}=Ee(Ae.getMetricHistory,S,f),m,M,b,q,_,c,g,p,k,$,y,D,I;if(e[6]!==n||e[7]!==w||e[8]!==x||e[9]!==u||e[10]!==l||e[11]!==r){p=Symbol.for("react.early_return_sentinel");e:{let K=Vt(n),E=vt(x)===Xt;if(w!==null&&!E){let h;e[25]!==r?(h=r("Instruments"),e[25]=r,e[26]=h):h=e[26];let P;e[27]!==h?(P=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:h}),e[27]=h,e[28]=P):P=e[28];let U;e[29]!==w||e[30]!==r?(U=r("Instruments unavailable: {error}",{error:w}),e[29]=w,e[30]=r,e[31]=U):U=e[31];let F;e[32]!==U?(F=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:U}),e[32]=U,e[33]=F):F=e[33];let ce;e[34]!==P||e[35]!==F?(ce=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[P,F]}),e[34]=P,e[35]=F,e[36]=ce):ce=e[36],p=ce;break e}if(K.length===0){p=null;break e}let J=Yt(u),L;e[37]!==r?(L=o(h=>r(h==="counter"?"Counter":h==="gauge"?"Gauge":"Histogram"),"L"),e[37]=r,e[38]=L):L=e[38];let H=L;_="flex flex-col gap-2",c="mt-instruments";let A;e[39]!==r?(A=r("Instruments"),e[39]=r,e[40]=A):A=e[40],e[41]!==A?(g=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:A}),e[41]=A,e[42]=g):g=e[42],q=fe,I="overflow-hidden py-0",b=pe,D="px-0",M=lt,$="mt-instruments-table";let O;e[43]!==r?(O=r("name"),e[43]=r,e[44]=O):O=e[44];let G;e[45]!==O?(G=(0,t.jsx)(de,{children:O}),e[45]=O,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)(de,{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)(de,{className:"text-right",children:Y}),e[53]=Y,e[54]=Z):Z=e[54];let Q;e[55]!==r?(Q=r("count"),e[55]=r,e[56]=Q):Q=e[56];let ee;e[57]!==Q?(ee=(0,t.jsx)(de,{className:"text-right",children:Q}),e[57]=Q,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)(de,{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)(de,{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)(de,{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)(de,{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?(y=(0,t.jsx)(nt,{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]=y):y=e[83],m=it,k=K.map(h=>{let P=zt(h.attributes),U=Pt(h.kind,h.name,h.attributes),F=(J.get(U)??[]).map(ce=>Bt(h.kind,ce));return(0,t.jsxs)(je,{"data-testid":`mt-instrument-${h.name}`,children:[(0,t.jsx)(B,{className:"font-mono text-xs",title:h.functionPath,children:h.name}),(0,t.jsx)(B,{children:(0,t.jsx)(Be,{variant:Zt[h.kind],children:H(h.kind)})}),(0,t.jsx)(B,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${h.name}`,children:ct(Gt(h))}),(0,t.jsx)(B,{className:"text-right tabular-nums text-muted-foreground",children:h.count.toLocaleString()}),(0,t.jsx)(B,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:h.min===h.max?"\u2014":`${ct(h.min)}\u2013${ct(h.max)}`}),(0,t.jsx)(B,{children:F.length>=2?(0,t.jsx)(ot,{ariaLabel:r("{name} trend",{name:h.name}),className:"h-6 w-24 text-foreground",series:F,testId:`mt-instrument-trend-${h.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(B,{className:"font-mono text-xs",children:(0,t.jsx)(Qt,{name:h.name,onOpenTrace:l,traceId:h.exemplarTraceId})}),(0,t.jsx)(B,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:P,children:P===""?"\u2014":P})]},U)})}e[6]=n,e[7]=w,e[8]=x,e[9]=u,e[10]=l,e[11]=r,e[12]=m,e[13]=M,e[14]=b,e[15]=q,e[16]=_,e[17]=c,e[18]=g,e[19]=p,e[20]=k,e[21]=$,e[22]=y,e[23]=D,e[24]=I}else m=e[12],M=e[13],b=e[14],q=e[15],_=e[16],c=e[17],g=e[18],p=e[19],k=e[20],$=e[21],y=e[22],D=e[23],I=e[24];if(p!==Symbol.for("react.early_return_sentinel"))return p;let C;e[84]!==m||e[85]!==k?(C=(0,t.jsx)(m,{children:k}),e[84]=m,e[85]=k,e[86]=C):C=e[86];let T;e[87]!==M||e[88]!==C||e[89]!==$||e[90]!==y?(T=(0,t.jsxs)(M,{"data-testid":$,children:[y,C]}),e[87]=M,e[88]=C,e[89]=$,e[90]=y,e[91]=T):T=e[91];let N;e[92]!==b||e[93]!==T||e[94]!==D?(N=(0,t.jsx)(b,{className:D,children:T}),e[92]=b,e[93]=T,e[94]=D,e[95]=N):N=e[95];let v;e[96]!==q||e[97]!==N||e[98]!==I?(v=(0,t.jsx)(q,{className:I,children:N}),e[96]=q,e[97]=N,e[98]=I,e[99]=v):v=e[99];let z;return e[100]!==_||e[101]!==c||e[102]!==g||e[103]!==v?(z=(0,t.jsxs)("section",{className:_,"data-testid":c,children:[g,v]}),e[100]=_,e[101]=c,e[102]=g,e[103]=v,e[104]=z):z=e[104],z},"er"),tr=o(s=>{let e=(0,xe.c)(74),{aggregate:l,shardResults:a}=s,r=ge(),d;e[0]!==r?(d=r("Shards"),e[0]=r,e[1]=d):d=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]!==d||e[7]!==i?(n=(0,t.jsx)(me,{label:d,testId:"mt-agg-shards",value:i}),e[6]=d,e[7]=i,e[8]=n):n=e[8];let w;e[9]!==r?(w=r("Total requests"),e[9]=r,e[10]=w):w=e[10];let x;e[11]!==l.totalRequests||e[12]!==w?(x=(0,t.jsx)(me,{label:w,testId:"mt-agg-requests",value:l.totalRequests}),e[11]=l.totalRequests,e[12]=w,e[13]=x):x=e[13];let S;e[14]!==r?(S=r("Total errors"),e[14]=r,e[15]=S):S=e[15];let f;e[16]!==l.totalErrors||e[17]!==S?(f=(0,t.jsx)(me,{label:S,testId:"mt-agg-errors",value:l.totalErrors}),e[16]=l.totalErrors,e[17]=S,e[18]=f):f=e[18];let u;e[19]!==r?(u=r("Total database size"),e[19]=r,e[20]=u):u=e[20];let m;e[21]!==l.totalDatabaseSize?(m=Ge(l.totalDatabaseSize),e[21]=l.totalDatabaseSize,e[22]=m):m=e[22];let M;e[23]!==u||e[24]!==m?(M=(0,t.jsx)(me,{label:u,testId:"mt-agg-db-size",value:m}),e[23]=u,e[24]=m,e[25]=M):M=e[25];let b;e[26]!==r?(b=r("Combined cache hit rate"),e[26]=r,e[27]=b):b=e[27];let q;e[28]!==l.hitRate||e[29]!==r?(q=l.hitRate===null?r("no cache configured"):`${(l.hitRate*100).toFixed(1)}%`,e[28]=l.hitRate,e[29]=r,e[30]=q):q=e[30];let _;e[31]!==b||e[32]!==q?(_=(0,t.jsx)(me,{label:b,testId:"mt-agg-cache",value:q}),e[31]=b,e[32]=q,e[33]=_):_=e[33];let c;e[34]!==M||e[35]!==_||e[36]!==n||e[37]!==x||e[38]!==f?(c=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,x,f,M,_]}),e[34]=M,e[35]=_,e[36]=n,e[37]=x,e[38]=f,e[39]=c):c=e[39];let g;e[40]!==r?(g=r("shard"),e[40]=r,e[41]=g):g=e[41];let p;e[42]!==g?(p=(0,t.jsx)(de,{children:g}),e[42]=g,e[43]=p):p=e[43];let k;e[44]!==r?(k=r("requests"),e[44]=r,e[45]=k):k=e[45];let $;e[46]!==k?($=(0,t.jsx)(de,{children:k}),e[46]=k,e[47]=$):$=e[47];let y;e[48]!==r?(y=r("errors"),e[48]=r,e[49]=y):y=e[49];let D;e[50]!==y?(D=(0,t.jsx)(de,{children:y}),e[50]=y,e[51]=D):D=e[51];let I;e[52]!==r?(I=r("db size"),e[52]=r,e[53]=I):I=e[53];let C;e[54]!==I?(C=(0,t.jsx)(de,{children:I}),e[54]=I,e[55]=C):C=e[55];let T;e[56]!==p||e[57]!==$||e[58]!==D||e[59]!==C?(T=(0,t.jsx)(nt,{children:(0,t.jsxs)(je,{children:[p,$,D,C]})}),e[56]=p,e[57]=$,e[58]=D,e[59]=C,e[60]=T):T=e[60];let N;if(e[61]!==a||e[62]!==r){let E;e[64]!==r?(E=o(J=>(0,t.jsxs)(je,{"data-testid":`mt-agg-row-${J.shard}`,children:[(0,t.jsx)(B,{children:J.shard}),J.metrics===null?(0,t.jsx)(B,{className:"text-destructive",colSpan:3,children:J.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{className:"tabular-nums",children:J.metrics.requests}),(0,t.jsx)(B,{className:"tabular-nums",children:J.metrics.errors}),(0,t.jsx)(B,{className:"tabular-nums",children:Ge(J.metrics.databaseSize)})]})]},J.shard),"E"),e[64]=r,e[65]=E):E=e[65],N=a.map(E),e[61]=a,e[62]=r,e[63]=N}else N=e[63];let v;e[66]!==N?(v=(0,t.jsx)(it,{children:N}),e[66]=N,e[67]=v):v=e[67];let z;e[68]!==T||e[69]!==v?(z=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(pe,{className:"px-0",children:(0,t.jsxs)(lt,{"data-testid":"mt-agg-table",children:[T,v]})})}),e[68]=T,e[69]=v,e[70]=z):z=e[70];let K;return e[71]!==c||e[72]!==z?(K=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[c,z]}),e[71]=c,e[72]=z,e[73]=K):K=e[73],K},"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)}%`},"ar"),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:d,metrics:i}=s,n=ge(),w;e[0]!==r||e[1]!==n?(w=r.length>=2?(0,t.jsx)(ot,{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]=w):w=e[2];let x;e[3]!==l||e[4]!==r.length||e[5]!==n?(x=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]=x):x=e[6];let S;e[7]!==n?(S=n("Requests"),e[7]=n,e[8]=S):S=e[8];let f;e[9]!==i.requests||e[10]!==w||e[11]!==x||e[12]!==S?(f=(0,t.jsx)(me,{chart:w,footer:x,label:S,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=w,e[11]=x,e[12]=S,e[13]=f):f=e[13];let u;e[14]!==a||e[15]!==n?(u=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=u):u=e[16];let m;e[17]!==n?(m=n("Errors"),e[17]=n,e[18]=m):m=e[18];let M;e[19]!==a||e[20]!==i.errors?(M=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=M):M=e[21];let b;e[22]!==u||e[23]!==m||e[24]!==M?(b=(0,t.jsx)(me,{footer:u,label:m,testId:"mt-errors",value:M}),e[22]=u,e[23]=m,e[24]=M,e[25]=b):b=e[25];let q;e[26]!==d.p90?(q=d.p90>0?`P90 ${jt(d.p90)}`:void 0,e[26]=d.p90,e[27]=q):q=e[27];let _;e[28]!==n?(_=n("P95 latency"),e[28]=n,e[29]=_):_=e[29];let c;e[30]!==d.p95?(c=d.p95>0?jt(d.p95):"\u2014",e[30]=d.p95,e[31]=c):c=e[31];let g;e[32]!==_||e[33]!==c||e[34]!==q?(g=(0,t.jsx)(me,{footer:q,label:_,testId:"mt-p95",value:c}),e[32]=_,e[33]=c,e[34]=q,e[35]=g):g=e[35];let p;e[36]!==i.cache||e[37]!==n?(p=i.cache===null?void 0:`${i.cache.entries.toLocaleString()} ${n("cache entries")}`,e[36]=i.cache,e[37]=n,e[38]=p):p=e[38];let k;e[39]!==n?(k=n("Database size"),e[39]=n,e[40]=k):k=e[40];let $;e[41]!==i.databaseSize?($=Ge(i.databaseSize),e[41]=i.databaseSize,e[42]=$):$=e[42];let y;e[43]!==p||e[44]!==k||e[45]!==$?(y=(0,t.jsx)(me,{footer:p,label:k,testId:"mt-db-size",value:$}),e[43]=p,e[44]=k,e[45]=$,e[46]=y):y=e[46];let D;e[47]!==n?(D=n("Shard"),e[47]=n,e[48]=D):D=e[48];let I;e[49]!==i.shard||e[50]!==D?(I=(0,t.jsx)(me,{label:D,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=D,e[51]=I):I=e[51];let C;e[52]!==n?(C=n("Uptime"),e[52]=n,e[53]=C):C=e[53];let T;e[54]!==i.uptimeMs?(T=rr(i.uptimeMs),e[54]=i.uptimeMs,e[55]=T):T=e[55];let N;e[56]!==C||e[57]!==T?(N=(0,t.jsx)(me,{label:C,testId:"mt-uptime",value:T}),e[56]=C,e[57]=T,e[58]=N):N=e[58];let v;e[59]!==n?(v=n("Cache hit rate"),e[59]=n,e[60]=v):v=e[60];let z;e[61]!==i.cache||e[62]!==n?(z=i.cache===null?n("no cache configured"):n("{rate} ({count} entries)",{count:i.cache.entries,rate:ar(i.cache.hits,i.cache.misses)}),e[61]=i.cache,e[62]=n,e[63]=z):z=e[63];let K;e[64]!==v||e[65]!==z?(K=(0,t.jsx)(me,{label:v,testId:"mt-cache",value:z}),e[64]=v,e[65]=z,e[66]=K):K=e[66];let E;return e[67]!==g||e[68]!==y||e[69]!==I||e[70]!==N||e[71]!==K||e[72]!==f||e[73]!==b?(E=(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:[f,b,g,y,I,N,K]}),e[67]=g,e[68]=y,e[69]=I,e[70]=N,e[71]=K,e[72]=f,e[73]=b,e[74]=E):E=e[74],E},"lr"),Xe=o(s=>s>=100?"critical":s>=50?"warning":"good","Ge"),Ue=o(s=>s<1?`${(s*1e3).toFixed(0)}\u03BCs`:s<1e3?`${s.toFixed(1)}ms`:`${(s/1e3).toFixed(2)}s`,"Oe"),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(),"Be"),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)(Be,{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},"sr"),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},"nr"),ir=o(s=>{let e=(0,xe.c)(161),{queryStats:l}=s,a=ge(),[r,d]=(0,j.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,w]=(0,j.useState)(i),x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=o(I=>{I!==null&&d(I)},"x"),e[1]=x):x=e[1];let S=x,f,u,m,M,b,q,_,c,g,p;if(e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==a){m=Symbol.for("react.early_return_sentinel");e:{let I=nr(l,r),C;e[16]!==l?(C=l.filter(or),e[16]=l,e[17]=C):C=e[17];let T=C.length,N;e[18]!==l?(N=l.filter(cr),e[18]=l,e[19]=N):N=e[19];let v=N.length,z;e[20]!==l?(z=l.filter(dr),e[20]=l,e[21]=z):z=e[21];let K=z.length,E;e[22]===Symbol.for("react.memo_cache_sentinel")?(E=o(R=>{w(ue=>{let W=new Set(ue);return W.has(R)?W.delete(R):W.add(R),W})},"E"),e[22]=E):E=e[22];let J=E;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 W;e[27]!==a?(W=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=W):W=e[28];let he;e[29]!==W?(he=(0,t.jsx)("p",{className:"mt-1 text-sm",children:W}),e[29]=W,e[30]=he):he=e[30];let We;e[31]!==ue||e[32]!==he?(We=(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]=We):We=e[33],m=We;break e}_="space-y-4",c="qi-root";let L;e[34]!==a?(L=a("Critical queries"),e[34]=a,e[35]=L):L=e[35];let H;e[36]!==L?(H=(0,t.jsx)(Ke,{className:"pb-2",children:(0,t.jsx)(Oe,{className:"text-sm font-medium",children:L})}),e[36]=L,e[37]=H):H=e[37];let A;e[38]!==T?(A=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:T}),e[38]=T,e[39]=A):A=e[39];let O;e[40]!==a?(O=a(">100ms avg execution"),e[40]=a,e[41]=O):O=e[41];let G;e[42]!==O?(G=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:O}),e[42]=O,e[43]=G):G=e[43];let V;e[44]!==A||e[45]!==G?(V=(0,t.jsxs)(pe,{children:[A,G]}),e[44]=A,e[45]=G,e[46]=V):V=e[46];let X;e[47]!==H||e[48]!==V?(X=(0,t.jsxs)(fe,{children:[H,V]}),e[47]=H,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)(Ke,{className:"pb-2",children:(0,t.jsx)(Oe,{className:"text-sm font-medium",children:Y})}),e[52]=Y,e[53]=Z):Z=e[53];let Q;e[54]!==v?(Q=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:v}),e[54]=v,e[55]=Q):Q=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]!==Q||e[61]!==te?(re=(0,t.jsxs)(pe,{children:[Q,te]}),e[60]=Q,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)(Ke,{className:"pb-2",children:(0,t.jsx)(Oe,{className:"text-sm font-medium",children:se})}),e[68]=se,e[69]=le):le=e[69];let ne;e[70]!==K?(ne=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:K}),e[70]=K,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 h;e[76]!==ne||e[77]!==oe?(h=(0,t.jsxs)(pe,{children:[ne,oe]}),e[76]=ne,e[77]=oe,e[78]=h):h=e[78];let P;e[79]!==le||e[80]!==h?(P=(0,t.jsxs)(fe,{children:[le,h]}),e[79]=le,e[80]=h,e[81]=P):P=e[81],e[82]!==X||e[83]!==ae||e[84]!==P?(g=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[X,ae,P]}),e[82]=X,e[83]=ae,e[84]=P,e[85]=g):g=e[85];let U;e[86]!==a?(U=a("Query leaderboard"),e[86]=a,e[87]=U):U=e[87];let F;e[88]!==U?(F=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:U}),e[88]=U,e[89]=F):F=e[89];let ce;e[90]!==r||e[91]!==a?(ce=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=ce):ce=e[92];let be;e[93]!==ce?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:ce}),e[93]=ce,e[94]=be):be=e[94];let ve;e[95]!==F||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[F,be]}),e[95]=F,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 we;e[102]!==a?(we=a("Sort queries by"),e[102]=a,e[103]=we):we=e[103];let Fe;e[104]===Symbol.for("react.memo_cache_sentinel")?(Fe=(0,t.jsx)(Ct,{}),e[104]=Fe):Fe=e[104];let Se;e[105]!==we?(Se=(0,t.jsx)(Tt,{"aria-label":we,className:"w-[140px]","data-testid":"qi-sort",children:Fe}),e[105]=we,e[106]=Se):Se=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let ke;e[109]!==qe?(ke=(0,t.jsx)(Pe,{value:"totalTime",children:qe}),e[109]=qe,e[110]=ke):ke=e[110];let $e;e[111]!==a?($e=a("Avg time"),e[111]=a,e[112]=$e):$e=e[112];let Me;e[113]!==$e?(Me=(0,t.jsx)(Pe,{value:"avgTime",children:$e}),e[113]=$e,e[114]=Me):Me=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 Ie;e[119]!==a?(Ie=a("Rows read"),e[119]=a,e[120]=Ie):Ie=e[120];let Ce;e[121]!==Ie?(Ce=(0,t.jsx)(Pe,{value:"rowsRead",children:Ie}),e[121]=Ie,e[122]=Ce):Ce=e[122];let Te;e[123]!==ke||e[124]!==Me||e[125]!==De||e[126]!==Ce?(Te=(0,t.jsxs)(Rt,{children:[ke,Me,De,Ce]}),e[123]=ke,e[124]=Me,e[125]=De,e[126]=Ce,e[127]=Te):Te=e[127];let Re;e[128]!==r||e[129]!==Se||e[130]!==Te?(Re=(0,t.jsxs)(It,{onValueChange:S,value:r,children:[Se,Te]}),e[128]=r,e[129]=Se,e[130]=Te,e[131]=Re):Re=e[131];let ze;e[132]!==Ne||e[133]!==Re?(ze=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,Re]}),e[132]=Ne,e[133]=Re,e[134]=ze):ze=e[134],e[135]!==ve||e[136]!==ze?(p=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,ze]}),e[135]=ve,e[136]=ze,e[137]=p):p=e[137],u=fe;let Le;e[138]!==a?(Le=a("Statements"),e[138]=a,e[139]=Le):Le=e[139];let Je;e[140]!==Le?(Je=(0,t.jsx)(Oe,{children:Le}),e[140]=Le,e[141]=Je):Je=e[141],q=(0,t.jsxs)(Ke,{children:[Je,(0,t.jsx)(gt,{children:a("{count} tracked statements",{count:I.length})})]}),f=pe,M="space-y-2";let He;e[142]!==n||e[143]!==a?(He=o(R=>{let ue=R.normalizedSql,W=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":W,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:o(()=>{J(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:Ue(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:Ue(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:Ue(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")})]})]})]}),W&&(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:Ue(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:Ue(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],b=I.map(He)}e[2]=n,e[3]=l,e[4]=r,e[5]=a,e[6]=f,e[7]=u,e[8]=m,e[9]=M,e[10]=b,e[11]=q,e[12]=_,e[13]=c,e[14]=g,e[15]=p}else f=e[6],u=e[7],m=e[8],M=e[9],b=e[10],q=e[11],_=e[12],c=e[13],g=e[14],p=e[15];if(m!==Symbol.for("react.early_return_sentinel"))return m;let k;e[145]!==M||e[146]!==b?(k=(0,t.jsx)("div",{className:M,children:b}),e[145]=M,e[146]=b,e[147]=k):k=e[147];let $;e[148]!==f||e[149]!==k?($=(0,t.jsx)(f,{children:k}),e[148]=f,e[149]=k,e[150]=$):$=e[150];let y;e[151]!==u||e[152]!==$||e[153]!==q?(y=(0,t.jsxs)(u,{children:[q,$]}),e[151]=u,e[152]=$,e[153]=q,e[154]=y):y=e[154];let D;return e[155]!==y||e[156]!==_||e[157]!==c||e[158]!==g||e[159]!==p?(D=(0,t.jsxs)("div",{className:_,"data-testid":c,children:[g,p,y]}),e[155]=y,e[156]=_,e[157]=c,e[158]=g,e[159]=p,e[160]=D):D=e[160],D},"ir");function or(s){return Xe(s.avgDurationMs)==="critical"}o(or,"or");function cr(s){return Xe(s.avgDurationMs)==="warning"}o(cr,"cr");function dr(s){return Xe(s.avgDurationMs)==="good"}o(dr,"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)})),"hr"),gr=o(({shardKey:s=""})=>{let e=ge(),[l,a]=(0,j.useState)("15m"),r=Ee(Ae.getQueryInsights,{range:l},{live:!0,shardKey:s}).data,d=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:ht("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)(Be,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),d.length===0?(0,t.jsx)(ft,{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)(et,{height:140,width:"100%",children:(0,t.jsxs)(St,{data:d,children:[(0,t.jsx)(rt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(at,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(st,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(tt,{}),(0,t.jsx)(Nt,{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)(et,{height:140,width:"100%",children:(0,t.jsxs)(wt,{data:d,children:[(0,t.jsx)(rt,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(at,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(st,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(tt,{}),(0,t.jsx)(yt,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(ir,{queryStats:r?.entries??[]})]})},"gr"),fr=pt(Ae.getMetrics),pr=o((s,e)=>s?e:"overview","pr"),Pr=o(({initialShardKey:s})=>{let e=mt(),l=ge(),a=ut(),[r,d]=(0,j.useState)(s??""),[i,n]=(0,j.useState)("overview"),[w,x]=(0,j.useState)([]),S=(0,j.useRef)(null),f=(0,j.useRef)(null),u=(0,j.useRef)(!0);(0,j.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let m=Mt(r.trim(),400),M=o(L=>{Et({shardKey:m,traceId:L}),Qe(a({to:"/traces"}))},"M"),{data:b,error:q,liveError:_}=Ee(Ae.getMetrics,{},{live:!0,shardKey:m}),c=b??null;(0,j.useEffect)(()=>{if(b===void 0)return;kt(m);let L=b,H=S.current,A=f.current!==null&&f.current!==L.shard;if(f.current=L.shard,S.current=L.requests,A){x([]);return}H!==null&&L.requests>=H&&x(O=>[...O,L.requests-H].slice(-30))},[b,m]);let[g,p]=(0,j.useState)(null),[k,$]=(0,j.useState)(!1),y=o(async()=>{$(!0);let L=At(r,qt());try{let H=await Promise.all(L.map(async A=>{try{let O=await e.query(fr,{},xt(A));return{error:null,metrics:O,shard:A===""?O.shard:A}}catch(O){return{error:bt(O),metrics:null,shard:A===""?"__root__":A}}}));u.current&&p(H)}finally{u.current&&$(!1)}},"y"),D=g===null?null:Lt(g),I=c===null||c.requests===0?"\u2014":`${(c.errors/c.requests*100).toFixed(1)}%`,C=w.length>0?w.at(-1):0,T=c?Kt(c):{p90:0,p95:0},N=(0,j.useMemo)(()=>{if(!c||!("queryStats"in c))return;let L=c.queryStats;if(!(!L||!Array.isArray(L)))return Ot(L)},[c]),v=pr(N!==void 0,i),z=o(()=>{Qe(y())},"T"),K=o(()=>{p(null)},"z"),E=o(()=>{n("overview")},"E"),J=o(()=>{n("query-insights")},"Q");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)($t,{onChange:d,testId:"mt-shard-input",value:r}),(0,t.jsx)(_t,{message:_,prefix:"mt"}),(0,t.jsx)(Ze,{"data-testid":"mt-aggregate",disabled:k,onClick:z,size:"sm",type:"button",variant:"secondary",children:l(k?"Aggregating\u2026":"All shards")}),g!==null&&(0,t.jsx)(Ze,{"data-testid":"mt-aggregate-clear",onClick:K,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:Dt,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}),N!==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:E,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:J,type:"button",children:[l("Query insights"),N.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:N.length})]})]}),v==="query-insights"&&N!==void 0&&(0,t.jsx)(gr,{shardKey:m}),v==="overview"&&c!==null&&(0,t.jsx)(sr,{currentDelta:C,errorRate:I,history:w,latencyPercentiles:T,metrics:c}),v==="overview"&&c===null&&null,v==="overview"&&(0,t.jsx)(er,{onOpenTrace:M,shardKey:m}),v==="overview"&&D!==null&&g!==null&&(0,t.jsx)(tr,{aggregate:D,shardResults:g})]})},"Ur");export{Pr as MetricsPanel};
|