import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,p as i,t as a,tt as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{l,p as u}from"./debug-otxXY3j-.js";import{lC as d,uC as f}from"./loadAgentsDir-C_wFhytF.js";import{t as p}from"./useKeybinding-DPOUuymz.js";import{t as m}from"./lib-Cf16LgKj.js";function h({onDone:e}){let t=f(e=>e.remoteSessionUrl),[n,a]=(0,_.useState)(``);if((0,_.useEffect)(()=>{if(!t)return;let e=t;async function n(){a(await(0,g.toString)(e,{type:`utf8`,errorCorrectionLevel:`L`}))}n().catch(e=>{u(`QR code generation failed`,e)})},[t]),o(`confirm:no`,e,{context:`Confirmation`}),!t)return(0,v.jsxs)(i,{children:[(0,v.jsx)(r,{color:`warning`,children:"Not in remote mode. Start with `claude --remote` to use this command."}),(0,v.jsx)(r,{dimColor:!0,children:`(press esc to close)`})]});let c=n.split(`
`).filter(e=>e.length>0),l=c.length===0;return(0,v.jsxs)(i,{children:[(0,v.jsx)(s,{marginBottom:1,children:(0,v.jsx)(r,{bold:!0,children:`Remote session`})}),l?(0,v.jsx)(r,{dimColor:!0,children:`Generating QR code…`}):c.map((e,t)=>(0,v.jsx)(r,{children:e},t)),(0,v.jsxs)(s,{marginTop:1,children:[(0,v.jsx)(r,{dimColor:!0,children:`Open in browser: `}),(0,v.jsx)(r,{color:`ide`,children:t})]}),(0,v.jsx)(s,{marginTop:1,children:(0,v.jsx)(r,{dimColor:!0,children:`(press esc to close)`})})]})}var g,_,v,y;e((()=>{g=m(),n(),_=t(n(),1),a(),p(),d(),l(),v=c(),y=async e=>(0,v.jsx)(h,{onDone:e})}))();export{y as call};