import{a as V,e as F,f as G,c as H}from"../chunks/BPDiEZo0.js";import{p as J,E as Q,v as X,t as Y,w as Z,b as y,c as a,d as i,g as c,r as s,B as g,s as $,x as k}from"../chunks/DWmC0QM7.js";import{P as tt,B as et,a as at,c as v,s as p}from"../chunks/B1bOvemT.js";import{g as st}from"../chunks/Bj5wFimK.js";import{p as nt}from"../chunks/fcNfTA-E.js";import{B as rt}from"../chunks/Bn-6X1BO.js";import{S as ot}from"../chunks/CG453M9q.js";import{T as it}from"../chunks/CSjf4fBs.js";const lt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
  <rect x="3" y="3" width="7" height="7"/>
  <rect x="14" y="3" width="7" height="7"/>
  <rect x="3" y="14" width="7" height="7"/>
  <rect x="14" y="14" width="7" height="7"/>
</svg>
`,ct=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>
</svg>
`;var vt=G('<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"><!> <!></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="/"><!> <span>Dashboard</span></a> <a href="/activity"><!> <span>Activity</span></a> <a href="/terminals"><!> <span>Terminals</span></a> <a href="/sos"><!> <span>SoS</span></a></div></nav></div>');function wt(j,n){J(n,!0);const r=()=>H(nt,"$page",T),[T,C]=F();Q(()=>{if(!n.data?.aiProviders)return;window.__aiProviders=n.data.aiProviders;const t=window;(!t.process||typeof t.process!="object")&&(t.process={env:{}});const e=t.process;(!e.env||typeof e.env!="object")&&(e.env={});const o=e.env;n.data.neurolinkProvider&&(o.NEUROLINK_PROVIDER=n.data.neurolinkProvider),n.data.litellmBaseUrl&&(o.LITELLM_BASE_URL=n.data.litellmBaseUrl),n.data.litellmModel&&(o.LITELLM_MODEL=n.data.litellmModel)});let l=$("unknown");const D={degraded:"Degraded",error:"Offline",healthy:"Online",unknown:"Checking"},O={degraded:"pill-status-degraded",error:"pill-status-offline",healthy:"pill-status-online",unknown:"pill-status-unknown"};X(()=>{b();const t=setInterval(()=>{b()},3e4);return()=>{clearInterval(t)}});async function b(){try{const t=await fetch("/api/health");if(!t.ok){y(l,"error");return}const e=await t.json();y(l,e.status==="healthy"||e.status==="degraded"||e.status==="error"?e.status:"unknown",!0)}catch{y(l,"error")}}var f=vt(),m=a(f),S=a(m),x=i(a(S),2),L=a(x);{let t=k(()=>D[c(l)]||"Checking"),e=k(()=>O[c(l)]||"pill-status-unknown");tt(L,{get text(){return c(t)},get classes(){return c(e)}})}var W=i(L,2);{const t=o=>{v(o,{get svg(){return ot},classes:"icon-18"})};let e=k(()=>r().url.pathname==="/config"?"btn-gear-active":"");et(W,{get classes(){return`btn-gear ${c(e)??""}`},onclick:()=>{st("/config")},ariaLabel:"Settings",icon:t,$$slots:{icon:!0}})}s(x),s(S),s(m);var _=i(m,2),R=a(_);at(R,()=>n.children),s(_);var B=i(_,2),q=a(B),d=a(q);let E;var U=a(d);v(U,{get svg(){return lt},classes:"icon-26"}),g(2),s(d);var h=i(d,2);let P;var A=a(h);v(A,{get svg(){return rt},classes:"icon-26"}),g(2),s(h);var u=i(h,2);let I;var N=a(u);v(N,{get svg(){return it},classes:"icon-26"}),g(2),s(u);var w=i(u,2);let M;var z=a(w);v(z,{get svg(){return ct},classes:"icon-26"}),g(2),s(w),s(q),s(B),s(f),Y((t,e,o,K)=>{E=p(d,1,"tab-item svelte-12qhfyh",null,E,t),P=p(h,1,"tab-item svelte-12qhfyh",null,P,e),I=p(u,1,"tab-item svelte-12qhfyh",null,I,o),M=p(w,1,"tab-item svelte-12qhfyh",null,M,K)},[()=>({active:r().url.pathname==="/"||r().url.pathname.startsWith("/project")||r().url.pathname.startsWith("/session")}),()=>({active:r().url.pathname.startsWith("/activity")}),()=>({active:r().url.pathname.startsWith("/terminals")}),()=>({active:r().url.pathname.startsWith("/sos")})]),V(j,f),Z(),C()}export{wt as component};
