import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{Ei as t,Oi as n,er as r,wn as i}from"./control-ui-foundation-CeFMP1Ly.js";import{S as a,ei as o,fl as s,fs as c,ml as ee,ms as te,ni as l,ti as ne,w as re}from"./control-ui-core-pH6nakZ-.js";import{G as u,J as d,W as f,Z as p,rt as m}from"./lit-runtime-BEtFSUCp.js";import{Cn as h,ln as g,m as _,p as v}from"./control-ui-core-DGVkFhVB.js";import{Dt as ie,Ht as ae,Ot as oe,qt as y}from"./control-ui-core-Br5DB0Zj.js";import{F as se,I as ce,In as le,L as ue,Ln as b,z as x}from"./control-ui-boot-wpHCbPL9.js";import{Ns as S,Ps as C,as as w,bn as T,es as E,gn as D,is as O,ns as k,on as A,rs as j,ts as M,un as N,xn as P}from"./control-ui-boot-Cdpgu1Gm.js";import{i as F,r as I}from"./control-ui-boot-DdPrPuw0.js";import{n as L,t as R}from"./settings-workspace-Bo4nqRhI.js";import{n as de,t as z}from"./stream-auto-follow-controller-DQpG-yCd.js";import{n as B,t as V}from"./gateway-page-controller-bzyUg03c.js";function H(e){let t=[];for(let n of Object.keys(e)){if(!/^\d+$/.test(n))continue;let r=e[n];typeof r==`string`?t.push(r):r!=null&&t.push(JSON.stringify(r))}return t.join(` `)}function U(e){if(typeof e!=`string`)return{};try{let t=JSON.parse(e);return{subsystem:typeof t.subsystem==`string`?t.subsystem:void 0,module:typeof t.module==`string`?t.module:void 0,plugin:typeof t.plugin==`string`?t.plugin:void 0}}catch{return{}}}function fe(e,t){let n=U(t?.name),r=U(e[0]);return{subsystem:n.subsystem??r.subsystem,module:n.module??r.module,plugin:n.plugin??r.plugin}}function pe(e){try{let t=JSON.parse(e);if(!i(t))return null;let r=i(t._meta)?t._meta:void 0,a=fe(t,r),o=typeof r?.logLevelName==`string`?r.logLevelName:void 0;return{time:typeof t.time==`string`?t.time:typeof r?.date==`string`?r.date:void 0,level:n(o),subsystem:a.subsystem,module:a.module,plugin:a.plugin,message:typeof t.message==`string`?t.message:H(t),raw:e}}catch{return null}}function W(){return(W=e((()=>{})))()}function me(e){if(typeof e!=`string`)return null;let n=t(e);return q.has(n)?n:null}function G(e){let t=pe(e);if(!t)return{raw:e,message:F(e)};let n=t.subsystem??t.module;return{raw:t.raw,time:t.time??null,level:me(t.level),subsystem:n?F(n):null,message:F(t.message)}}var K,q;function J(){return(J=e((()=>{I(),W(),K={trace:!0,debug:!0,info:!0,warn:!0,error:!0,fatal:!0},q=new Set([`trace`,`debug`,`info`,`warn`,`error`,`fatal`])})))()}function he(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:a(t.getTime(),void 0,e)}function ge(e,n){return!n||t([e.message,e.subsystem,e.raw].filter(Boolean).join(` `)).includes(n)}function _e(e){let n=t(e.filterText),r=Y.some(t=>!e.levelFilters[t]),i=e.entries.filter(t=>t.level&&!e.levelFilters[t.level]?!1:ge(t,n)),a=n||r?`filtered`:`visible`,o=y(`gatewayLogs.exportLabels.${a}`),s=e.status.hasLoaded?i.length===0?N(y(`gatewayLogs.empty`)):i.map(e=>d`