import{a as j,f as A,s as z,d as H,b as M,g as V,h as W}from"../chunks/r0JawsZc.js";import{t as C,s as i,c as t,r as e,p as I,u as O,w as D,y as f,z as L,o as P}from"../chunks/CZHsSL_X.js";import{a as v,s as T}from"../chunks/CQjSATpv.js";import{g as E}from"../chunks/CrVuYlkB.js";import{p as F}from"../chunks/CNmDAqoQ.js";var G=A('<div><span class="status-dot"></span> <span> </span></div>');function J(u,c){function s(a){switch(a){case"degraded":return"Degraded";case"error":return"Offline";case"healthy":return"Online";default:return"Checking"}}function p(a){switch(a){case"degraded":return"degraded";case"error":return"offline";case"healthy":return"online";default:return""}}var n=G(),r=i(t(n),2),d=t(r,!0);e(r),e(n),C((a,h)=>{v(n,1,`status-badge ${a??""}`),z(d,h)},[()=>p(c.status),()=>s(c.status)]),j(u,n)}var K=A('<div class="app"><header class="header"><div class="header-content"><a href="/" class="logo"><img src="/app-icon.png" alt="Shooter" class="logo-icon" width="24" height="24"/> <span class="logo-text">Shooter</span></a> <div class="nav-right svelte-12qhfyh"><!> <button aria-label="Settings"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button></div></div></header> <div class="content-area svelte-12qhfyh"><!></div> <nav class="bottom-tabs svelte-12qhfyh"><div class="bottom-tabs-inner svelte-12qhfyh"><a href="/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg> <span>Projects</span></a> <a href="/terminals"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg> <span>Terminals</span></a></div></nav></div>');function Y(u,c){I(c,!0);const s=()=>W(F,"$page",p),[p,n]=V();let r=P("unknown");O(()=>{d();const o=setInterval(()=>{d()},3e4);return()=>{clearInterval(o)}});async function d(){try{const o=await fetch("/api/health");if(!o.ok){f(r,"error");return}const l=await o.json();f(r,l.status==="healthy"||l.status==="degraded"||l.status==="error"?l.status:"unknown",!0)}catch{f(r,"error")}}var a=K(),h=t(a),m=t(h),y=i(t(m),2),k=t(y);J(k,{get status(){return L(r)}});var b=i(k,2);e(y),e(m),e(h);var g=i(h,2),$=t(g);T($,()=>c.children),e(g);var w=i(g,2),_=t(w),x=t(_);let S;var B=i(x,2);let q;e(_),e(w),e(a),C((o,l)=>{v(b,1,`btn-gear ${s().url.pathname==="/config"?"btn-gear-active":""}`,"svelte-12qhfyh"),S=v(x,1,"tab-item svelte-12qhfyh",null,S,o),q=v(B,1,"tab-item svelte-12qhfyh",null,q,l)},[()=>({active:s().url.pathname==="/"||s().url.pathname.startsWith("/project")||s().url.pathname.startsWith("/session")}),()=>({active:s().url.pathname.startsWith("/terminals")})]),M("click",b,()=>E("/config")),j(u,a),D(),n()}H(["click"]);export{Y as component};
