import{r as s,j as e,c as a}from"./vendor-react-LhvuxEgB.js";import{c as l,bz as t,bA as c,t as i,bB as r,bC as o,bD as n,B as m,bE as d,bo as x,bF as p}from"./index-ltw-H9qF.js";import{u as g}from"./usePolling-B8Eekr8J.js";import{P as h,b as j,B as u,a as y,L as b}from"./PageLayout-B3DDdQE6.js";import{C as f}from"./Card-Cg82k1Z3.js";import"./maplibre-gl-b91ci4Kr.js";import"./vendor-core-DtiSmTrl.js";const v=l("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),N=l("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]),w=s.memo(function({log:s}){return e.jsx("div",{className:"p-3 radius-card bg-subtle-fill hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:a("type-data-sm w-14 shrink-0",p(s.level)),children:s.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:s.message}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(s.timestamp).toLocaleString()})]})]})})});function k({showDebug:s,onToggle:l}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:a("type-data-sm",s?"text-sys-orange":"text-sys-cyan"),children:s?"DEBUG":"INFO"}),e.jsx(x,{enabled:s,onChange:l,size:"sm"})]})}function C(){const l=t(),x=c(),p=i(),C=r(),D=o(),[B,L]=s.useState(!1),P=s.useCallback(()=>{L(s=>!s)},[]),E=B?l:l.filter(s=>"DEBUG"!==s.level);return g(C,d.logs,p),e.jsxs(h,{children:[e.jsx(j,{title:"System Logs",icon:e.jsx(n,{}),controls:e.jsx(k,{showDebug:B,onToggle:P})}),e.jsx(u,{children:e.jsxs(y,{neomorphic:!0,noPadding:!0,children:[e.jsx(f,{listHeader:!0,icon:e.jsx(n,{className:"icon-sm"}),title:"Log Entries",actions:e.jsx(m,{plain:!0,color:p?"danger":"primary",onClick:()=>D(!p),title:p?"Pause":"Resume",className:a(!p&&"animate-pulse-slow"),children:p?e.jsx(N,{"data-slot":"icon",className:"!w-5 !h-5"}):e.jsx(v,{"data-slot":"icon",className:"!w-5 !h-5"})})}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:x&&0===l.length?e.jsx(b,{count:10}):0===E.length?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:0===l.length?"No logs available":"No logs match selected filters"}):E.map((s,a)=>e.jsx(w,{log:s},`${s.timestamp}-${a}`))})]})})]})}export{C as default};
