openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 984 B
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ot as t,jt as n}from"./control-ui-connection-Bfj9beF_.js";import{A_ as r,N_ as i,ej as a,fD as o,nj as s,pD as c}from"./control-ui-boot-shared-DFTSUQQ0.js";import{F as l,U as u}from"./solid-runtime-C416s-HC.js";function d(e,n,r){let a=s(),c=a?i(a.gateway):void 0,u=l(()=>{let n=c?.read()?.snapshot;if(!(n&&(!n.client||n.phase===`stopped`||n.lastErrorAuthReason||n.phase===`connected`&&n.hello&&!t(n.hello.auth??null))))return{key:e(),client:n?.client,scope:a?o(a.gateway).key:0}},{equals:(e,t)=>e?.key===t?.key&&e?.client===t?.client&&e?.scope===t?.scope}),d=l(e=>{let t=u();if(!t)return;let i=n();return e?.identity===t&&(r()||c&&c.read().snapshot.phase!==`connected`)?e:{identity:t,src:i}});return{identity:u,src:()=>d()?.src,active:()=>{let e=a?.gateway.snapshot;return!e||e.phase===`connected`&&!e.lastErrorAuthReason&&t(e.hello?.auth??null)}}}function f(){return(f=e((()=>{u(),c(),n(),r(),a()})))()}export{f as n,d as t};