"use strict";(self.webpackChunkfeno_web=self.webpackChunkfeno_web||[]).push([["4361"],{7616(e,s,t){t.r(s),t.d(s,{DaemonStatus:()=>i});var l=t(10199),n=t(90063),a=t(84185);function i(){let[e,s]=(0,n.useState)(null),[t,i]=(0,n.useState)(null);return((0,n.useEffect)(()=>{let e=(0,a.em)(),t=new a.Ve({http:e.http,eventStream:e.eventStream}),l=e.subscribe(e=>s(e)),n=t.subscribe(e=>i(e));return e.start(),t.start(),()=>{l(),n(),t.stop()}},[]),e)?(0,l.jsxs)("div",{style:{padding:24,fontFamily:"ui-monospace, monospace",lineHeight:1.5},children:[(0,l.jsx)("h1",{style:{fontSize:22,marginBottom:16},children:"Daemon transport smoke test"}),(0,l.jsxs)(r,{title:"Connection",children:[(0,l.jsx)(o,{label:"state",value:e.state}),(0,l.jsx)(o,{label:"sseState",value:e.sseState}),(0,l.jsx)(o,{label:"gatewayNodeId",value:e.gatewayNodeId??"—"}),(0,l.jsx)(o,{label:"homeDir",value:e.homeDir??"(not in this daemon)"}),(0,l.jsx)(o,{label:"lastStatusLatencyMs",value:null==e.lastStatusLatencyMs?"—":`${e.lastStatusLatencyMs} ms`}),(0,l.jsx)(o,{label:"lastError",value:e.lastError??"—"})]}),"connected"===e.state&&e.homeDir&&(0,l.jsxs)("p",{style:{color:"green",marginTop:8},children:["✓ connected to ",e.homeDir]}),(0,l.jsx)(r,{title:`Peers (${e.peers.length})`,children:e.peers.map(e=>(0,l.jsxs)("div",{style:{marginBottom:4},children:[(0,l.jsxs)("strong",{children:[e.isLocal?"[local] ":"",e.nodeId]})," — ","online: ",String(e.online),null!==e.latencyMs?` • ${e.latencyMs}ms`:"",null!==e.lastSeen?` • lastSeen: ${new Date(e.lastSeen).toISOString()}`:""]},e.nodeId))}),(0,l.jsxs)(r,{title:"Preferences schema",children:[(null==t?void 0:t.schema)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o,{label:"sections",value:t.schema.sections.map(e=>e.id).join(", ")}),(0,l.jsx)(o,{label:"fields",value:String(t.schema.fields.length)}),(0,l.jsxs)("details",{style:{marginTop:8},children:[(0,l.jsx)("summary",{children:"fields[] (raw)"}),(0,l.jsx)("pre",{style:{fontSize:11},children:JSON.stringify(t.schema.fields,null,2)})]})]}):(0,l.jsx)(o,{label:"schema",value:"(loading)"}),(null==t?void 0:t.lastError)&&(0,l.jsx)(o,{label:"lastError",value:t.lastError})]})]}):(0,l.jsx)("div",{style:{padding:24},children:"Booting daemon transport…"})}function r(e){let{title:s,children:t}=e;return(0,l.jsxs)("section",{style:{marginBottom:24,padding:12,border:"1px solid #ccc",borderRadius:6},children:[(0,l.jsx)("h2",{style:{fontSize:14,marginBottom:8,opacity:.7},children:s}),t]})}function o(e){let{label:s,value:t}=e;return(0,l.jsxs)("div",{style:{display:"flex",gap:12,fontSize:12},children:[(0,l.jsx)("span",{style:{minWidth:200,opacity:.6},children:s}),(0,l.jsx)("span",{children:t})]})}}}]);