import{n as e,t}from"./IconPlayerPlay-DWxG9t9z.js";import{$t as n,Bt as r,Cn as i,Gt as a,L as o,Nn as s,Ot as c,Pn as l,Qt as u,U as d,Xt as f,Yt as p,Zt as m,_n as h,bn as g,d as _,en as v,gn as y,it as b,kn as x,rn as S,sn as C,tn as w,u as T,vn as E,xn as D}from"./index-BZbSGIBZ.js";var O=i(`<span>`),k=i(`<span class=opacity-70>`),A=i(`<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 shrink-0 input-primary"></div><div class="overflow-x-auto rounded-md bg-base-300 whitespace-nowrap">`),j=()=>{let i,[h]=d(),[j,M]=l(``),{logs:N,paused:P,setPaused:F}=b(),[I,L]=r(l([]),{name:`logsTableSorting`,storage:localStorage}),[R,z]=l([]),B=e=>{let t=e.match(/^\[([^\]]+)\]/);return t?t[1]:``},V=[{id:`seq`,header:h(`sequence`),accessorFn:e=>e.seq,enableGrouping:!1},{id:`level`,header:h(`level`),accessorFn:e=>e.type,cell:({row:e})=>{let t=e.original.type,n=``;switch(t){case a.Error:n=`text-error`;break;case a.Warning:n=`text-warning`;break;case a.Info:n=`text-info`;break;case a.Debug:n=`text-success`;break}return(()=>{var t=O();return y(t,n),E(t,()=>`[${e.original.type}]`),t})()}},{id:`type`,header:h(`type`),accessorFn:e=>B(e.payload),cell:({row:e})=>{let t=B(e.original.payload);return t?(()=>{var e=k();return E(e,t),e})():null}},{id:`payload`,header:h(`payload`),accessorFn:e=>e.payload,enableGrouping:!1}],H=m({filterFns:{fuzzy:o},state:{get globalFilter(){return j()},get sorting(){return I()},get grouping(){return R()}},get data(){return N()},sortDescFirst:!0,columns:V,onGlobalFilterChange:M,onSortingChange:L,onGroupingChange:z,globalFilterFn:o,getFilteredRowModel:v(),getSortedRowModel:S(),getExpandedRowModel:n(),getGroupedRowModel:w(),getCoreRowModel:u()});return[x(_,{get children(){return h(`logs`)}}),(()=>{var n=A(),r=n.firstChild,a=r.firstChild,o=r.nextSibling;return a.$$input=e=>M(e.target.value),E(r,x(p,{class:`join-item btn-sm btn-primary`,onClick:()=>F(e=>!e),get icon(){return g(()=>!!P())()?x(t,{}):x(e,{})}}),null),E(r,x(p,{class:`join-item btn-sm btn-primary`,onClick:()=>i?.showModal(),get icon(){return x(C,{})}}),null),E(o,x(f,{table:H,get size(){return c()},stickyHeader:!0,rowHover:!0,cellClass:`py-2`})),E(n,x(T,{ref:e=>i=e}),null),s(()=>D(a,`placeholder`,h(`search`))),n})()]};h([`input`]);export{j as default};