import{u as O,d as e,t as h,i as t,ab as I,ac as V,F as x,ad as q,ae as H,af as d,ag as Z,ah as Q,g as C,ai as W,aj as X,ak as Y,al as J,Q as K,b as U,y as ee,A as z,am as te,T as re,Y as F,E as ae,B as j,a0 as le,_ as A,a1 as se,Z as G,a7 as ne,a9 as ie,n as oe}from"./index-BfxF6Zjo.js";import{c as ce,I as de,a as ge,f as P,b as ue,d as he,g as ve,i as me,j as fe,r as be}from"./index-CXfh_Ffl.js";import{D as pe}from"./DocumentTitle-qgMGpI7d.js";var _e=h('<div class="flex flex-col gap-4"><div><select class=select></select></div><div><select class=select></select></div><div><select class=select>'),k=h("<option>");const $e=v=>{const[l]=O();return e(K,{ref:n=>{var o;return(o=v.ref)==null?void 0:o.call(v,n)},get icon(){return e(J,{size:24})},get title(){return l("logsSettings")},get children(){var n=_e(),o=n.firstChild,c=o.firstChild,_=o.nextSibling,f=_.firstChild,y=_.nextSibling,b=y.firstChild;return t(o,e(I,{withDivider:!0,get children(){return l("tableSize")}}),c),c.addEventListener("change",r=>V(r.target.value)),t(c,e(x,{get each(){return Object.values(q)},children:r=>(()=>{var s=k();return s.value=r,t(s,()=>l(r)),s})()})),t(_,e(I,{withDivider:!0,get children(){return l("logLevel")}}),f),f.addEventListener("change",r=>H(r.target.value)),t(f,e(x,{get each(){return[d.Info,d.Error,d.Warning,d.Debug,d.Silent]},children:r=>(()=>{var s=k();return s.value=r,t(s,()=>l(r)),s})()})),t(y,e(I,{withDivider:!0,get children(){return l("logMaxRows")}}),b),b.addEventListener("change",r=>Z(parseInt(r.target.value))),t(b,e(x,{each:Q,children:r=>(()=>{var s=k();return s.value=r,t(s,r),s})()})),C(()=>c.value=W()),C(()=>f.value=X()),C(()=>b.value=Y()),n}})};var Se=h("<span>"),xe=h('<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>'),Ce=h("<tr>"),ye=h('<th class=bg-base-200><div class="flex items-center"><div>'),we=h('<tr class="hover:!bg-primary hover:text-primary-content">'),Le=h("<td class=py-2>");const N=(v,l,n,o)=>{const c=be(v.getValue(l),n);return o({itemRank:c}),c.passed},Me=()=>{const v=U();if(!ee())return v("/setup",{replace:!0}),null;let l;const[n]=O(),[o,c]=z(""),{logs:_,paused:f,setPaused:y}=te(),[b,r]=re(z([]),{name:"logsTableSorting",storage:localStorage}),s=[{header:n("sequence"),accessorFn:i=>i.seq},{header:n("type"),accessorFn:i=>i.type,cell:({row:i})=>{const p=i.original.type;let g="";switch(p){case d.Error:g="text-error";break;case d.Warning:g="text-warning";break;case d.Info:g="text-info";break;case d.Debug:g="text-success";break}return(()=>{var $=Se();return F($,g),t($,()=>`[${i.original.type}]`),$})()}},{header:n("payload"),accessorFn:i=>i.payload}],M=ce({filterFns:{fuzzy:N},state:{get globalFilter(){return o()},get sorting(){return b()}},get data(){return _()},sortDescFirst:!0,columns:s,onGlobalFilterChange:c,onSortingChange:r,globalFilterFn:N,getFilteredRowModel:fe(),getSortedRowModel:me(),getCoreRowModel:ve()});return[e(pe,{get children(){return n("logs")}}),(()=>{var i=xe(),p=i.firstChild,g=p.firstChild,$=p.nextSibling,E=$.firstChild,R=E.firstChild,B=R.nextSibling;return g.$$input=a=>c(a.target.value),t(p,e(j,{class:"join-item btn-sm btn-primary",onClick:()=>y(a=>!a),get icon(){return ae(()=>!!f())()?e(de,{}):e(ge,{})}}),null),t(p,e(j,{class:"join-item btn-sm btn-primary",onClick:()=>l==null?void 0:l.showModal(),get icon(){return e(le,{})}}),null),t(R,e(A,{get each(){return M.getHeaderGroups()},children:a=>{const m=a();return(()=>{var u=Ce();return t(u,e(A,{get each(){return m.headers},children:w=>{const S=w();return(()=>{var D=ye(),T=D.firstChild,L=T.firstChild;return se(L,"click",S.column.getToggleSortingHandler(),!0),t(L,()=>P(S.column.columnDef.header,S.getContext())),t(T,()=>({asc:e(he,{}),desc:e(ue,{})})[S.column.getIsSorted()]??null,null),C(()=>F(L,G(S.column.getCanSort()&&"cursor-pointer select-none","flex-1"))),D})()}})),u})()}})),t(B,e(x,{get each(){return M.getRowModel().rows},children:a=>(()=>{var m=we();return t(m,e(x,{get each(){return a.getVisibleCells()},children:u=>(()=>{var w=Le();return t(w,()=>P(u.column.columnDef.cell,u.getContext())),w})()})),m})()})),t(i,e($e,{ref:a=>l=a}),null),C(a=>{var m=n("search"),u=G(ne(W()),"table relative rounded-none");return m!==a.e&&ie(g,"placeholder",a.e=m),u!==a.t&&F(E,a.t=u),a},{e:void 0,t:void 0}),i})()]};oe(["input","click"]);export{Me as default};
