const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TrinoCluster-ClWq1Yly.js","assets/index-Cox3ZWL0.js","assets/index-BcNQiHhj.css","assets/TrinoClusterMonitor-BtvJz6KD.js","assets/types-Cay-L1a6.js","assets/trinoUtils-CkYt6rPZ.js","assets/AreaChart-BXuLkydu.js","assets/generateCategoricalChart-r3YBne8p.js","assets/isEqual-ChfZXzNw.js","assets/bump-BmRQ39WQ.js","assets/linear-C3cNlZpH.js","assets/string-cKWu9XK9.js","assets/max-DBeXZoyG.js","assets/Area-BOC2c8fg.js","assets/QueryHistory-CNYHYKdz.js","assets/Queries-D3eV92s_.js","assets/styles-BKOcRT3k.js","assets/QueryProgressBar-CbIZ5f8t.js","assets/CardLabel-BY3XrrkN.js","assets/QueryRunner-D0rSRGBJ.js","assets/QueryOverview-DzchdvOb.js","assets/Query-CURFOt5v.js","assets/ResponsiveContainer-9FOBZSeS.js","assets/BarChart-CUfJgmZ6.js","assets/index-Ck37e_Tb.js","assets/zoom-D5h43YeK.js","assets/transform-C2GfmqNu.js"])))=>i.map(i=>d[i]);
import{lL as E,j as e,L as v,q as p,c as b,a4 as f,a5 as q,d as T,R as o,x as s,r as i,G as x,bG as R,bH as P,u as A,at as C,bx as O,T as w,t as L,lM as Q,d2 as I,S}from"./index-Cox3ZWL0.js";import{$ as y}from"./Project-CBPFwDml.js";import"./alertManagerConfig.selectors-D5v0uPxO.js";import"./defineProperty-Bl0iR0r2.js";import"./HumanizedCronExpression-CCEBWMyY.js";import"./index-CvEisYn5.js";import"./form-_K_-Blw_.js";import"./useScreenWithScroll-zcr7TMGO.js";import"./symmetricDifference-DM6mun8f.js";import"./index-uwkRD1BL.js";import"./git-BLdzamrJ.js";import"./useCopyToClipboard-C9cjFU4I.js";const D=({children:a})=>{const{isLoadingTrino:n,trinoStatus:t}=E();return n?e.jsx(v,{}):t&&t.isConfiguring?e.jsxs(p,{justifyContent:"center",height:"100%",children:[e.jsx(b,{sx:{fontSize:"16px",position:"absolute",top:"55%",left:"45%",maxWidth:"600px"},children:t.message}),e.jsx(v,{})]}):e.jsxs(e.Fragment,{children:[t&&!t.isConfiguring&&e.jsx(p,{children:e.jsx(f,{content:e.jsx(p,{alignItems:"center",children:e.jsx(T,{children:t.message})}),type:q.warning,mb:"10px"})}),a]})},k=i.lazy(()=>x(()=>import("./TrinoCluster-ClWq1Yly.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),z=i.lazy(()=>x(()=>import("./QueryHistory-CNYHYKdz.js"),__vite__mapDeps([14,1,2,15,16,5,17,18]))),g=i.lazy(()=>x(()=>import("./QueryRunner-D0rSRGBJ.js"),__vite__mapDeps([19,1,2]))),H=i.lazy(()=>x(()=>import("./QueryOverview-DzchdvOb.js"),__vite__mapDeps([20,1,2,21,17,5,18,22,7,8,9,10,11,12,23,6,13,24,25,26]))),V=[e.jsx(o,{path:s.project.queryEngine.cluster,element:e.jsx(k,{})},"cluster"),e.jsx(o,{path:s.project.queryEngine.queryHistory,element:e.jsx(z,{})},"history"),e.jsx(o,{path:s.project.queryEngine.queryRunner,element:e.jsx(g,{})},"runner"),e.jsx(o,{path:s.project.queryEngine.queryOverview,element:e.jsx(H,{})},"queryOverview"),e.jsx(o,{path:"*",element:e.jsx(g,{})},"fallback")],Z=()=>{R(P.queryEngine);const{queryId:a}=A(),{project:n,id:t}=C(),u=O(),{data:m}=w("trino_enabled"),r=i.useCallback(c=>L(c,`${s.project.value}${s.project.queryEngine.overview}`,{id:t,queryId:a}),[t,a]),l=Q(),_=i.useMemo(()=>{const{cluster:c,queryHistory:j,queryRunner:d,queryOverviewActive:h}=s.project.queryEngine;return[...m?[{title:"SQL Runner",isActive:l(r(d)),onClick:()=>u(r(d)),tooltipProps:{mainText:"SQL Runner"}},{title:"Cluster Overview",isActive:l([s.project.queryEngine.overview,r(c)]),onClick:()=>u(r(c)),tooltipProps:{mainText:"Overview"}},{title:"Queries",isActive:l([r(j),`${r(h)}/*`]),onClick:()=>u(r(j)),tooltipProps:{mainText:"Queries"}}]:[]]},[l,r,u,m]);return m?n!=null&&n.services.includes("Trino")?e.jsxs(p,{flexDirection:"column",minWidth:"1234px",children:[e.jsx(I,{title:"Cluster",tabs:_,mb:"20px"}),e.jsx(D,{children:e.jsx(S,{children:V})})]}):e.jsx(y,{message:"Trino is not enabled for this project"}):e.jsx(y,{message:"Trino is not enabled for this cluster"})};export{Z as default};
