openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 3.03 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ti as t,dj as n,mj as r,wi as i}from"./control-ui-boot-shared-DFTSUQQ0.js";import{O as a,Rt as o,U as s,d as c,f as l,g as u,j as d,l as f,m as p,s as m,u as h,x as g}from"./solid-runtime-C416s-HC.js";function _(e){let t=()=>e.busy||e.disabled,n=()=>[(()=>{var t=v();return t._$$click=()=>e.onCancel(),c(t,()=>r(`common.cancel`)),f(()=>e.busy,e=>{u(t,`disabled`,e)}),t})(),(()=>{var n=y();return c(n,(()=>{var t=l(()=>!!e.busy);return()=>t()?r(`mcpServers.adding`):r(`mcpServers.add`)})()),f(()=>({e:e.blockedReason??``,t:t()}),({e,t},r)=>{e!==r?.e&&u(n,`title`,e),t!==r?.t&&u(n,`disabled`,t)}),n})()];var i=x(),s=i.firstChild,m=s.firstChild,h=m.nextSibling,g=s.nextSibling,_=g.firstChild,w=_.nextSibling,T=w.firstChild,E=T.nextSibling,D=E.nextSibling,O=g.nextSibling,k=O.firstChild,A=k.nextSibling,j=O.nextSibling,M=j.nextSibling;i.addEventListener(`submit`,t=>{t.preventDefault();let n=new FormData(t.currentTarget),r=n.get(`mcp-name`),i=n.get(`mcp-transport`),a=n.get(`mcp-target`);e.onSubmit({name:typeof r==`string`?r.trim():``,transport:i===`sse`||i===`stdio`?i:`streamable-http`,target:typeof a==`string`?a.trim():``})}),c(m,()=>r(`mcpServers.nameLabel`));var N=e.onNameRef;return typeof N==`function`||Array.isArray(N)?p(()=>N,h):e.onNameRef=h,c(_,()=>r(`mcpServers.transportLabel`)),c(T,()=>r(`mcpServers.transportStreamableHttp`)),c(E,()=>r(`mcpServers.transportSse`)),c(D,()=>r(`mcpServers.transportStdio`)),c(k,()=>r(`mcpServers.targetLabel`)),c(i,d(a,{get when(){return e.error},children:e=>(()=>{var t=S();return c(t,e),t})()}),j),c(i,d(a,{get when(){return e.presentation===`modal`},get fallback(){var e=C();return c(e,n),e},get children(){var e=b();return e._$owner=o(),c(e,n),e}}),M),f(()=>({e:e.autofocus,t:e.blockedReason??``,a:t(),o:e.blockedReason??``,i:t(),n:e.blockedReason??``,s:t()}),({e,t,a:n,o:r,i,n:a,s:o},s)=>{e!==s?.e&&u(h,`autofocus`,e),t!==s?.t&&u(h,`title`,t),n!==s?.a&&u(h,`disabled`,n),r!==s?.o&&u(w,`title`,r),i!==s?.i&&u(w,`disabled`,i),a!==s?.n&&u(A,`title`,a),o!==s?.s&&u(A,`disabled`,o)}),i}var v,y,b,x,S,C;function w(){return(w=e((()=>{h(),s(),i(),n(),v=g(`<button type=button class="btn btn--sm">`),y=g(`<button type=submit class="btn btn--sm">`),b=g(`<openclaw-modal-actions class=mcp-server-form__actions>`,1),x=g(`<form class=mcp-server-form><label><span></span><input name=mcp-name class=settings-input type=text required placeholder=context7 autocomplete=off></label><label><span></span><select name=mcp-transport class=settings-select><option value=streamable-http></option><option value=sse></option><option value=stdio></option></select></label><label class=mcp-server-form__target><span></span><input name=mcp-target class=settings-input type=text required placeholder="https://mcp.example.com/mcp · npx some-mcp-server"autocomplete=off></label><!><!>`),S=g(`<div class="mcp-server-message mcp-server-message--error"role=alert>`),C=g(`<div class=mcp-server-form__actions>`),t(),m([`click`])})))()}export{w as n,_ as t};