UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 7.19 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Qt as t,Xt as n}from"./control-ui-connection-Bfj9beF_.js";import{bD as r,dj as i,mj as a,vD as o}from"./control-ui-boot-shared-DFTSUQQ0.js";import{C as s,F as c,I as l,O as u,Rt as d,S as ee,U as f,d as p,f as m,g as h,j as g,l as _,s as v,u as y,w as te,x as b,yt as ne}from"./solid-runtime-C416s-HC.js";function re(e){let t=()=>e.view.read().review?.items.filter(t=>t.kind===e.kind)??[],n=t=>{let n=e.view.read().choices?.excluded;return n?!n.includes(t.id):t.included};return g(u,{get when(){return t().length>0},get children(){var r=C(),i=r.firstChild,o=i.firstChild,c=o.nextSibling;return p(i,()=>e.title,o),p(c,()=>t().length),p(r,g(s,{get each(){return t()},keyed:e=>e.id,children:t=>(()=>{var r=w(),i=r.firstChild,o=i.firstChild,s=o.nextSibling,c=i.nextSibling.firstChild,l=c.nextSibling;return o.addEventListener(`change`,n=>{let r=e.view.read().choices;if(!r)return;let i=new Set(r.excluded);n.currentTarget.checked?i.delete(t().id):i.add(t().id),e.flow.updateChoices({...r,excluded:[...i]})}),p(s,()=>t().label),p(c,()=>a(`templatesDraft.view`)),p(l,()=>t().detail),_(()=>({e:n(t()),t:e.publishing}),({e,t},n)=>{o.checked=e,t!==n?.t&&h(o,`disabled`,t)}),r})()}),null),r}})}function x(e){let t=()=>e.view.read(),i=()=>t().review,o=()=>t().choices,[c,f]=l(!1),v=()=>c()||t().busy===`publishing`,y=ne(function*(e,t){f(!0);try{yield Promise.race([e,t])}catch(e){r({message:n(e)})}});async function b(){let t=e.flow.presentationLifetime.promise,n=e.flow.publish();await Promise.resolve(),await y(n,t)}var x=O(),S=x.firstChild,C=S.firstChild,w=C.nextSibling,j=w.nextSibling,M=j.firstChild,P=M.firstChild,F=P.nextSibling,I=M.nextSibling.firstChild,L=I.nextSibling,R=j.nextSibling,z=R.firstChild,B=z.nextSibling.firstChild,V=B.nextSibling.firstChild,H=V.nextSibling,U=H.nextSibling,W=U.nextSibling,G=W.nextSibling,ie=G.nextSibling,K=R.nextSibling,q=K.firstChild,J=q.firstChild,ae=J.nextSibling,oe=q.nextSibling,Y=K.nextSibling,X=Y.nextSibling,Z=X.firstChild,Q=Z.nextSibling,$=Q.firstChild,se=$.nextSibling;return x.addEventListener(`modal-cancel`,t=>{t.preventDefault(),e.flow.close()}),x._$owner=d(),p(C,()=>a(`templatesDraft.reviewTitle`)),p(w,()=>a(`templatesDraft.intro`)),p(P,()=>a(`templatesDraft.name`)),F._$$input=t=>{let n=o();n&&e.flow.updateChoices({...n,displayName:t.currentTarget.value})},p(I,()=>a(`templatesDraft.description`)),L._$$input=t=>{let n=o();n&&e.flow.updateChoices({...n,description:t.currentTarget.value})},p(z,()=>a(`templatesDraft.behavior`)),p(B,()=>i().scope.job),p(V,()=>a(`templatesDraft.input`)),p(H,()=>i().scope.input),p(U,()=>a(`templatesDraft.output`)),p(W,()=>i().scope.output),p(G,()=>a(`templatesDraft.authority`)),p(ie,()=>i().scope.authority),p(S,g(s,{each:N,children:([t,n])=>g(re,{get flow(){return e.flow},get view(){return e.view},kind:t,get title(){return a(n)},get publishing(){return v()}})}),K),p(q,()=>a(`templatesDraft.packageContents`),J),p(ae,()=>i().files.length),p(oe,()=>a(`templatesDraft.packageNote`)),p(K,g(u,{get when(){return t().reviewCurrent},get children(){return g(s,{get each(){return i().files},keyed:e=>e.path,children:e=>(()=>{var t=k(),n=t.firstChild,r=n.nextSibling;return p(n,()=>e().path),p(r,()=>e().content),t})()})}}),null),p(S,g(u,{get when(){return t().error},children:e=>(()=>{var t=A();return p(t,e),t})()}),Y),p(S,g(u,{get when(){return!t().reviewCurrent},get children(){return g(te,{get on(){return e.reviewReceipt},get fallback(){var e=T();return p(e,()=>a(`templatesDraft.updating`)),e},get children(){return g(ee,{get fallback(){var e=T();return p(e,()=>a(`templatesDraft.reviewNeeded`)),e},get children(){return[m(()=>e.reviewRead()),(()=>{var e=T();return p(e,()=>a(`templatesDraft.reviewNeeded`)),e})()]}})}})}}),X),X._$owner=d(),Z._$$click=()=>e.flow.close(),p(Z,()=>a(`templatesDraft.askChanges`)),p(X,g(u,{get when(){return m(()=>!t().reviewCurrent)()&&t().busy===null},get children(){var t=E();return t._$$click=()=>e.flow.retryReview(),p(t,()=>a(`templatesDraft.refreshReview`)),t}}),Q),Q._$$click=()=>void b(),p(Q,g(u,{get when(){return v()},get children(){return D()}}),$),p(Q,()=>a(v()?`templatesDraft.publishing`:`templatesDraft.publish`),se),_(()=>({e:a(`templatesDraft.reviewTitle`),t:o()?.displayName??``,a:o()?.description??``,o:v()||!t().reviewCurrent||t().busy!==null,i:v()?`true`:void 0}),({e,t,a:n,o:r,i},a)=>{e!==a?.e&&h(x,`label`,e),F.value=t??``,L.value=n??``,r!==a?.o&&h(Q,`disabled`,r),i!==a?.i&&h(Q,`aria-busy`,i)}),x}function S(e){let t=()=>e.flow,n=()=>e.view,r=c(()=>n().read().reviewRead),i=c(async()=>(await r()?.result,null));return[g(u,{get when(){return m(()=>!!n().read().modalOpen)()?n().read().review:n().read().modalOpen},get children(){return g(x,{get flow(){return t()},get view(){return n()},reviewRead:i,get reviewReceipt(){return r()}})}}),g(u,{get when(){return m(()=>!(!n().read().hasActiveDraft||n().read().modalOpen||n().read().publication))()?n().read().error:n().read().hasActiveDraft&&!n().read().modalOpen&&!n().read().publication},children:e=>(()=>{var n=M(),r=n.firstChild;return p(n,e,r),r._$$click=()=>t().retryReview(),p(r,()=>a(`templatesDraft.retryReview`)),n})()}),g(u,{get when(){return m(()=>!(!n().read().review||n().read().modalOpen||n().read().publication))()?!n().read().error:n().read().review&&!n().read().modalOpen&&!n().read().publication},get children(){var e=j();return e._$$click=()=>t().reopen(),p(e,()=>a(`templatesDraft.reopen`)),e}})]}var C,w,T,E,D,O,k,A,j,M,N;function P(){return(P=e((()=>{y(),f(),t(),i(),o(),C=b(`<section class=template-creator__section><h3> <span>`),w=b(`<div class=template-creator__row><label class=template-creator__row-choice><input type=checkbox><span></span></label><details><summary></summary><pre>`),T=b(`<p role=status class=template-creator__status>`),E=b(`<button type=button class=btn>`),D=b(`<span class=btn__spinner aria-hidden=true>`),O=b(`<openclaw-modal-dialog style=--openclaw-modal-width:720px><div class="exec-approval-card template-creator"><h2></h2><p class=template-creator__intro></p><div class=template-creator__identity><label><span></span><input class=settings-input></label><label><span></span><textarea class=settings-input rows=2></textarea></label></div><section class=template-creator__section><h3></h3><details class=template-creator__summary><summary></summary><dl><dt></dt><dd></dd><dt></dt><dd></dd><dt></dt><dd></dd></dl></details></section><section class=template-creator__section><h3> <span></span></h3><p></p></section><!><openclaw-modal-actions><button type=button class=btn></button><button type=button class="btn primary"><!><!>`,1),k=b(`<details class=template-creator__archive-file><summary></summary><pre>`),A=b(`<p class="callout danger"role=alert>`),j=b(`<button class="template-creator__reopen btn btn--sm">`),M=b(`<div class="template-creator__notice template-creator__notice--error"role=alert><button class="btn btn--sm">`),N=[[`file`,`templatesDraft.workspaceFiles`],[`skill`,`templatesDraft.skills`],[`plugin`,`templatesDraft.plugins`],[`mcp`,`templatesDraft.mcpServers`],[`automation`,`templatesDraft.automations`]],v([`input`,`click`])})))()}P();export{S as TemplateCreatorReviewView};