import{a as e,c as t,d as n,f as r,l as i,n as a,r as o,s,t as c,u as l}from"./lib-BxRDUvxo.js";import{Bt as u,Nt as d,Qt as f,U as p,Xt as m,Yt as h,Zt as g,_t as _,an as v,at as y,c as b,en as x,f as S,gn as C,m as w,mn as T,mt as E,on as D,rn as O,s as k,tn as A,un as j,vt as M,wt as N,zt as P}from"./index-DIwJcTz_.js";var F=O(`<span>`),I=O(`<div class="flex h-full flex-col gap-2"><div class="join w-full"><input type=search class="input input-sm join-item flex-1 flex-shrink-0 input-primary"></div><div class="overflow-x-auto rounded-md bg-base-300 whitespace-nowrap"><table><thead class="sticky top-0 z-10"></thead><tbody>`),L=O(`<tr>`),R=O(`<th class=bg-base-200><div class="flex items-center"><div>`),z=O(`<tr class="hover:!bg-primary hover:text-primary-content">`),B=O(`<td class=py-2>`),V=(e,n,r,i)=>{let a=t(e.getValue(n),r);return i({itemRank:a}),a.passed},H=()=>{let t=S();if(!w())return t(`/setup`,{replace:!0}),null;let g,[O]=_(),[H,U]=C(``),{logs:W,paused:G,setPaused:K}=p(),[q,J]=M(C([]),{name:`logsTableSorting`,storage:localStorage}),Y=[{header:O(`sequence`),accessorFn:e=>e.seq},{header:O(`type`),accessorFn:e=>e.type,cell:({row:e})=>{let t=e.original.type,n=``;switch(t){case N.Error:n=`text-error`;break;case N.Warning:n=`text-warning`;break;case N.Info:n=`text-info`;break;case N.Debug:n=`text-success`;break}return(()=>{var t=F();return m(t,n),f(t,()=>`[${e.original.type}]`),t})()}},{header:O(`payload`),accessorFn:e=>e.payload}],X=c({filterFns:{fuzzy:V},state:{get globalFilter(){return H()},get sorting(){return q()}},get data(){return W()},sortDescFirst:!0,columns:Y,onGlobalFilterChange:U,onSortingChange:J,globalFilterFn:V,getFilteredRowModel:e(),getSortedRowModel:s(),getCoreRowModel:o()});return[j(b,{get children(){return O(`logs`)}}),(()=>{var e=I(),t=e.firstChild,o=t.firstChild,s=t.nextSibling,c=s.firstChild,p=c.firstChild,_=p.nextSibling;return o.$$input=e=>U(e.target.value),f(t,j(P,{class:`join-item btn-sm btn-primary`,onClick:()=>K(e=>!e),get icon(){return x(()=>!!G())()?j(n,{}):j(r,{})}}),null),f(t,j(P,{class:`join-item btn-sm btn-primary`,onClick:()=>g?.showModal(),get icon(){return j(d,{})}}),null),f(p,j(D,{get each(){return X.getHeaderGroups()},children:e=>{let t=e();return(()=>{var e=L();return f(e,j(D,{get each(){return t.headers},children:e=>{let t=e();return(()=>{var e=R(),n=e.firstChild,r=n.firstChild;return h(r,`click`,t.column.getToggleSortingHandler(),!0),f(r,()=>a(t.column.columnDef.header,t.getContext())),f(n,()=>({asc:j(l,{}),desc:j(i,{})})[t.column.getIsSorted()]??null,null),T(()=>m(r,u(t.column.getCanSort()&&`cursor-pointer select-none`,`flex-1`))),e})()}})),e})()}})),f(_,j(v,{get each(){return X.getRowModel().rows},children:e=>(()=>{var t=z();return f(t,j(v,{get each(){return e.getVisibleCells()},children:e=>(()=>{var t=B();return f(t,()=>a(e.column.columnDef.cell,e.getContext())),t})()})),t})()})),f(e,j(k,{ref:e=>g=e}),null),T(e=>{var t=O(`search`),n=u(E(y()),`table relative rounded-none`);return t!==e.e&&A(o,`placeholder`,e.e=t),n!==e.t&&m(c,e.t=n),e},{e:void 0,t:void 0}),e})()]};g([`input`,`click`]);export{H as default};