import{u as y}from"./useQuery-DB4moXtm.js";import{a as d}from"./setup-DezDOKqx.js";import{w as p,i as a,x as m}from"./index-CXwCk-SR.js";function g(u){const r=d();p(()=>r.tickCount,()=>{u()})}function F(u,r,l){const n=a(()=>u.value.key),i=a(()=>JSON.stringify({topN:r.value.topN,orderBy:r.value.orderBy,columns:r.value.columns,spark:r.value.spark,throughput:r.value.throughput})),s=l??a(()=>null),c=a(()=>{const e=s.value;return e?`${e.step}:${Math.floor(e.startMs/6e4)}:${Math.floor(e.endMs/6e4)}`:null}),t=y({queryKey:["layer-landing",n,i,c],queryFn:()=>m.layer.landing(n.value,r.value,s.value??void 0),staleTime:1/0,refetchOnWindowFocus:!1,retry:1});g(()=>t.refetch());const o=a(()=>t.data.value??null),v=a(()=>{var e;return((e=o.value)==null?void 0:e.rows)??[]}),h=a(()=>{var e;return((e=o.value)==null?void 0:e.reachable)??!1}),f=a(()=>{var e;return((e=o.value)==null?void 0:e.error)??(t.error.value?String(t.error.value):void 0)});return{isLoading:t.isLoading,isFetching:t.isFetching,data:o,rows:v,reachable:h,error:f,refetch:t.refetch}}export{g as a,F as u};
