UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines • 4.56 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./deferred-ui-support-D-VedBtc.js","./markdown-runtime-DmM7zNej.js","./control-ui-boot-chat-styles-CEPkk0Pv.js","./chat-message-media-runtime-BIOBdIgm.js","./virtual-core-runtime-BYd4CRBu.js","./control-ui-connection-D5QrEAFW.css","./control-ui-boot-shared-styles-BorAdMVO.css","./control-ui-boot-chat-styles-BoDuSoES.css"])))=>i.map(i=>d[i]); import{n as e,r as t}from"./rolldown-runtime-CNOWq4Kh.js";import{Ns as n,Qt as r,Xt as i,ks as a,lu as o,uu as s}from"./control-ui-connection-Bfj9beF_.js";import{QS as c,ZS as l,dj as u,mj as d,pj as f}from"./control-ui-boot-shared-DFTSUQQ0.js";import{C as p,F as m,O as h,Rt as g,T as _,U as v,a as y,d as b,f as x,g as S,gt as C,j as w,k as T,l as E,o as D,p as O,u as k,x as A}from"./solid-runtime-C416s-HC.js";var j=t({FocusDashboard:()=>M});function M(e){let t=m(()=>e.route),n=()=>e.snapshot.phase===`connected`,r=m(()=>{let e=t();return e.kind===`error`||e.kind===`not-found`?e:void 0}),i=()=>{let e=r();return e?.kind===`error`?d(`dashboardDocument.loadFailed`,{error:e.message}):d(`dashboardDocument.notFound`)},a=m(()=>{let e=t();return e.kind===`ambiguous`?e.data:void 0}),o=m(()=>{let e=t();return e.kind===`session`?e.data:void 0});return w(h,{get when(){return t()},children:t=>(C(()=>e.onReady()),w(T,{get children(){return[w(_,{get when(){return t().kind===`loading`},get children(){return e.renderSplash()}}),w(_,{get when(){return r()},children:t=>(()=>{var n=N(),r=n.firstChild,a=r.firstChild;return b(a,i),b(r,()=>e.renderEscape(),null),E(()=>({e:O(t().kind===`error`?`board-document__state board-document__state--error stack`:`board-document__state stack`),t:t().kind===`error`?`alert`:`status`}),({e,t},n)=>{D(r,e,n?.e),t!==n?.t&&S(r,`role`,t)}),n})()}),w(_,{get when(){return a()},children:t=>(()=>{var n=F(),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=a.nextSibling,s=o.nextSibling,c=s.nextSibling;return b(i,()=>d(`chat.sessionRoute.chooseTitle`)),b(a,(()=>{var e=x(()=>t().candidates.length>1);return()=>e()?d(`chat.sessionRoute.multipleMatches`,{shortId:t().shortId}):d(`chat.sessionRoute.additionalMatches`)})()),b(r,w(p,{get each(){return t().candidates},children:e=>(()=>{var t=I(),n=t.firstChild,r=n.nextSibling.nextSibling,i=r.firstChild,a=i.nextSibling,o=g();return b(n,()=>e.displayName),b(r,()=>e.agentId,i),b(r,()=>e.idPrefix,a),E(()=>e.href,e=>{S(n,`href`,e),y(n,o)}),t})()}),o),b(r,w(h,{get when(){return t().truncated},get children(){var e=P(),t=e.firstChild;return b(t,()=>d(`chat.sessionRoute.additionalMatches`)),e}}),s),b(r,()=>e.renderEscape(),c),n})()}),w(_,{get when(){return o()},children:t=>[x(()=>e.renderDocument({sessionKey:t().sessionKey,preparedSession:t().agentId?{sessionKey:t().sessionKey,agentId:t().agentId}:null})),w(h,{get when(){return x(()=>!n())()&&e.snapshot.lastError===null},get children(){return e.renderSplash()}})]})]}}))})}var N,P,F,I;function L(){return(L=e((()=>{k(),v(),l(),u(),N=A(`<main class=board-document><section><span>`),P=A(`<p><small>`),F=A(`<main class=board-document><section class="card board-document__state"><h2></h2><p></p><!><!><!>`),I=A(`<p><a></a><br><small> · <!>`),f(c)})))()}var R=t({loadFocusDashboard:()=>B});function z(e){return`type`in e&&e.type===`notFound`}async function B(e,t,r){let a=(t,i)=>{if(r.aborted)return;let[a,o]=[i,t].map(t=>n({kind:`dashboard`,path:`${t.pathname}${t.search}${t.hash}`},e.basePath)),s=`${globalThis.location.pathname}${globalThis.location.search}${globalThis.location.hash}`;a&&o&&s===a&&o!==s&&globalThis.history.replaceState(globalThis.history.state,``,o)};try{let{loadChatRoute:i}=await o(async()=>{let{loadChatRoute:e}=await import(`./control-ui-boot-chat-DewxEbIm.js`).then(e=>(e.t(),e.n));return{loadChatRoute:e}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),s=await i(e,t.route,`dashboard`,r);if(r.aborted)return{kind:`loading`};if(z(s)||s.kind===`missing-session`||s.kind===`unavailable-home`)return{kind:`not-found`};if(s.kind===`route-error`)return{kind:`error`,message:s.message};if(s.kind===`ambiguous`)return{kind:`ambiguous`,data:{...s,candidates:s.candidates.map(t=>({...t,href:n({kind:`dashboard`,path:t.href},e.basePath)??t.href}))}};s.canonicalLocation&&s.canonicalLocationSource&&a(s.canonicalLocation,s.canonicalLocationSource);let c=s.canonicalLocationSource;return s.canonicalLocationReady&&c&&s.canonicalLocationReady.then(e=>{e&&a(e,c)}),{kind:`session`,data:s}}catch(e){return{kind:`error`,message:i(e)}}}function V(){return(V=e((()=>{a(),r(),s()})))()}export{L as i,V as n,j as r,R as t};