UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 5.99 kB
import{n as e,r as t}from"./rolldown-runtime-CNOWq4Kh.js";import{Wo as n}from"./_4____________________________.js";import{GN as r,JN as i,fk as a,mb as o,mk as s,pb as c,qN as l}from"./_2_____________________________.js";import{B as u,O as d,Rt as f,T as p,U as m,d as h,g,gt as ee,j as _,k as te,l as v,m as ne,s as y,u as b,x}from"./_6____________________.js";import"./exec-approval-card-DGfgNbQP.js";import{n as S,t as C}from"./en-openclaw-id-dialogs-BFGCHK4v.js";import{n as w,t as T}from"./en-openclaw-id-Don6YXzi.js";import{l as re,n as E,t as D}from"./account-BSv2LwQC.js";import{n as O,t as k}from"./feature-lifetime-BHVdXhSD.js";import{r as A,t as j}from"./ui-error-Bk6jJOft.js";import{n as M,t as N}from"./error-message-B7DmySYB.js";import{i as ie,n as ae,r as P,t as oe}from"./rebind-Cs3NDOde.js";var F=t({showMoveKeysDialog:()=>L});function se(e,t){switch(e.code){case`bad_kit`:return i(`openclawId.moveKeysBadKit`);case`wrong_kit`:return i(`openclawId.moveKeysWrongKit`,{fp:e.kitRoot,host:t});case`published_unverifiable`:return i(`openclawId.moveKeysUnverifiable`);case`published_unavailable`:case`binding_seq_too_low`:return i(`openclawId.moveKeysUnavailable`);default:return e}}function I(e){var t=R(),n=t.firstChild,r=n.nextSibling.firstChild,i=r.nextSibling.nextSibling;return h(n,()=>e.label),h(r,()=>e.from),h(i,()=>e.to),t}function L(e){let t=D(e.signedIn),r=O();return r.aborted?Promise.resolve(!1):o(void 0,a=>{a.render(()=>{let[o,c]=u(``),[l,m]=u(null),[y,b]=u(!1),[x,S]=u(null),[C,w]=u(null),T=e=>w(A(e,`setup`)),E=!1,D=!1,O=!1,k,j=()=>{O=!0,m(null),c(``),k&&(k.value=``,k.defaultValue=``),D||a.finish(!1)};ee(()=>{let e=re(()=>{try{t()}catch{j()}}),i=n(r,`abort`,j,{once:!0});return r.aborted&&j(),()=>{e(),i(),k&&(k.value=``,k.defaultValue=``),c(``),m(null)}});let M=async e=>{E=!0,b(!0);try{await e()}finally{E=!1,b(!1)}},P=t=>M(async()=>{S(null),w(null);try{let n=await ie({client:e.client,signedIn:e.signedIn,kitText:t});if(O||a.settled)return;n.ok?(c(``),m(n.plan)):S(se(n,e.hostname))}catch(e){if(O||a.settled)return;T(e)}}),F=t=>M(async()=>{w(null);let n;try{if(O||r.aborted){j();return}D=!0,n=await ae(e.client,t)}catch(e){O?(s({severity:`error`,message:A(e,`setup`).message}),a.finish(!1)):T(e);return}finally{D=!1}m(null),s(n.followUpError===void 0?{severity:`success`,message:i(`openclawId.moveKeysDone`)}:{severity:`warning`,message:i(`openclawId.moveKeysDone`),description:i(`openclawId.moveKeysFollowUpFailed`,{command:n.nextStep}),detail:n.followUpError}),a.finish(!0)}),L=t=>{E?t?.preventDefault():(l()&&oe(e.client).catch(()=>void 0),m(null),c(``),a.finish(!1))};var R=B(),q=R.firstChild,J=q.firstChild,Y=J.nextSibling,X=Y.nextSibling,Z=X.nextSibling,Q=Z.nextSibling,$=Q.firstChild;return R.addEventListener(`modal-cancel`,L),R._$owner=f(),h(J,()=>i(`openclawId.moveToNewKeys`)),h(Y,()=>i(`openclawId.moveKeysBody`,{host:e.hostname})),h(q,_(te,{get children(){return[_(p,{get when(){return l()},children:e=>[(()=>{var e=V();return h(e,()=>i(`openclawId.moveKeysConfirm`)),e})(),(()=>{var t=H(),n=t.firstChild,r=n.firstChild,a=r.nextSibling.firstChild,o=a.nextSibling.nextSibling,s=n.nextSibling,c=s.nextSibling,l=c.nextSibling;return h(r,()=>i(`openclawId.moveKeysRoot`)),h(a,()=>e().root),h(o,()=>i(`openclawId.moveKeysRootMatches`)),h(t,_(I,{get label(){return i(`openclawId.moveKeysBinding`)},get from(){return String(e().bindingSeq.from)},get to(){return String(e().bindingSeq.to)}}),s),h(t,_(I,{get label(){return i(`openclawId.moveKeysEndpoint`)},get from(){return e().endpoint.from},get to(){return e().endpoint.to}}),c),h(t,_(I,{get label(){return i(`openclawId.moveKeysGateway`)},get from(){return e().gateway.from},get to(){return e().gateway.to}}),l),t})()]}),_(p,{get when(){return!l()},get children(){var e=z(),t=e.firstChild.firstChild,n=t.nextSibling,r=n.nextSibling;return e.addEventListener(`submit`,e=>{e.preventDefault(),P(o())}),h(t,()=>i(`openclawId.moveKeysKit`)),n._$$input=e=>c(e.currentTarget.value),ne(()=>e=>k=e,n),h(r,()=>i(`openclawId.moveKeysKitHint`)),v(()=>({e:o(),t:y()}),({e,t},r)=>{n.value=e??``,t!==r?.t&&g(n,`disabled`,t)}),e}})]}}),X),h(q,_(d,{get when(){return x()},children:e=>(()=>{var t=U();return h(t,e),t})()}),Z),h(q,_(d,{get when(){return C()},children:e=>(()=>{var t=W();return h(t,_(N,{get error(){return e()}})),t})()}),Q),Q._$owner=f(),$._$$click=L,h($,()=>i(`common.cancel`)),h(Q,_(d,{get when(){return l()},get fallback(){var e=G();return h(e,()=>i(`openclawId.moveKeysCheck`)),v(()=>y()||!o().trim(),t=>{g(e,`disabled`,t)}),e},children:e=>(()=>{var t=K();return t._$$click=()=>void F(e()),h(t,()=>i(`openclawId.moveKeysMove`)),v(()=>y(),e=>{g(t,`disabled`,e)}),t})()}),null),v(()=>({e:i(`openclawId.moveToNewKeys`),t:y()}),({e,t},n)=>{e!==n?.e&&g(R,`label`,e),t!==n?.t&&g($,`disabled`,t)}),R})})}var R,z,B,V,H,U,W,G,K;function q(){return(q=e((()=>{b(),m(),C(),T(),E(),k(),P(),j(),r(),a(),c(),M(),R=x(`<div class="openclaw-id-move-keys__row exec-approval-meta-row"><span></span><span><span class="openclaw-id-move-keys__fp mono"></span> → <span class="openclaw-id-move-keys__fp mono">`),z=x(`<form id=openclaw-id-move-keys-form><label class=field><span></span><input type=password name=recovery-code autocomplete=off spellcheck=false class=mono><small>`),B=x(`<openclaw-modal-dialog><div class="exec-approval-card openclaw-id-move-keys"><h2></h2><p></p><!><!><openclaw-modal-actions class=exec-approval-actions><button type=button class=btn>`,1),V=x(`<h3>`),H=x(`<div class="openclaw-id-move-keys__keys exec-approval-meta"><div class="openclaw-id-move-keys__row exec-approval-meta-row"><span></span><span><span class="openclaw-id-move-keys__fp mono"></span> <span class=muted></span></span></div><!><!><!>`),U=x(`<p class="callout danger"role=alert>`),W=x(`<div class="callout danger"role=alert>`),G=x(`<button type=submit form=openclaw-id-move-keys-form class="btn primary">`),K=x(`<button type=button class="btn primary">`),l(S),l(w),y([`input`,`click`])})))()}export{F as n,L as r,q as t};