(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3554],{85309:(e,t,a)=>{"use strict";a.d(t,{default:()=>v});var s=a(95155),l=a(12115),r=a(98500),i=a.n(r),n=a(35497),o=a(3534),c=a(28777),d=a(43666);let u=a(41463).env.NEXT_PUBLIC_CLOUD_URL;function v({toolId:e,machineId:t}){let a=o.dM[e],[r,x]=(0,l.useState)([]),[h,p]=(0,l.useState)(!0),[b,f]=(0,l.useState)({}),[m,E]=(0,l.useState)(!1),[j,P]=(0,l.useState)(!1),[k,w]=(0,l.useState)(""),[g,N]=(0,l.useState)(!1),[S,_]=(0,l.useState)(""),[A,U]=(0,l.useState)([]);(0,l.useEffect)(()=>{let e=!0;return(async()=>{try{let[t,a,s,l]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!e)return;if(t.ok){let e=await t.json();x(e.connections||[])}if(a.ok){let e=await a.json();E(e.cloudEnabled||!1)}if(s.ok){let e=await s.json();P(!!(e.tunnel?.enabled||e.tunnel?.settingsEnabled)),w(e.tunnel?.publicUrl||""),N(!!(e.tailscale?.enabled||e.tailscale?.settingsEnabled)),_(e.tailscale?.tunnelUrl||"")}if(l.ok){let e=await l.json();U(e.keys||[])}}catch(e){console.log("Error loading tool data:",e)}finally{e&&p(!1)}})(),()=>{e=!1}},[]);let y=()=>r.filter(e=>!1!==e.isActive),C=(0,l.useCallback)((e,t,a)=>{f(s=>s[e]?.[t]===a?s:{...s,[e]:{...s[e],[t]:a}})},[]);return(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,s.jsxs)(i(),{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:a.name}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:a.description})]}),h?(0,s.jsx)(n.Qv,{}):(()=>{let t,l,r,i=(t=y(),l=[],r=new Set,t.forEach(e=>{let t=c.Xg[e.provider]||e.provider;(0,c.KC)(e.provider).forEach(a=>{let s=`${t}/${a.id}`;r.has(s)||(r.add(s),l.push({value:s,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))})}),l).length>0,n={tool:a,isExpanded:!0,onToggle:()=>{},baseUrl:j&&k?k:m&&u?u:window.location.origin,apiKeys:A,tunnelEnabled:j,tunnelPublicUrl:k,tailscaleEnabled:g,tailscaleUrl:S};switch(e){case"claude":return(0,s.jsx)(d.Tk,{...n,activeProviders:y(),modelMappings:b[e]||{},onModelMappingChange:(t,a)=>C(e,t,a),hasActiveProviders:i,cloudEnabled:m});case"codex":return(0,s.jsx)(d.Ah,{...n,activeProviders:y(),cloudEnabled:m});case"opencode":return(0,s.jsx)(d.qO,{...n,activeProviders:y(),cloudEnabled:m});case"cowork":return(0,s.jsx)(d.Q6,{...n,activeProviders:y(),hasActiveProviders:i,cloudEnabled:m,cloudUrl:u,tunnelEnabled:j,tunnelPublicUrl:k,tailscaleEnabled:g,tailscaleUrl:S});case"droid":return(0,s.jsx)(d.ZM,{...n,activeProviders:y(),hasActiveProviders:i,cloudEnabled:m});case"openclaw":return(0,s.jsx)(d.yZ,{...n,activeProviders:y(),hasActiveProviders:i,cloudEnabled:m});case"hermes":return(0,s.jsx)(d.RF,{...n,activeProviders:y(),hasActiveProviders:i,cloudEnabled:m});case"copilot":return(0,s.jsx)(d.h1,{...n,activeProviders:y(),cloudEnabled:m});case"cline":return(0,s.jsx)(d.aG,{...n,activeProviders:y(),cloudEnabled:m});case"kilo":return(0,s.jsx)(d.c9,{...n,activeProviders:y(),cloudEnabled:m});case"deepseek-tui":return(0,s.jsx)(d.lF,{...n,activeProviders:y(),hasActiveProviders:i,cloudEnabled:m});case"jcode":return(0,s.jsx)(d.mW,{...n,activeProviders:y(),hasActiveProviders:i,cloudEnabled:m});default:return(0,s.jsx)(d.a7,{toolId:e,...n,activeProviders:y(),cloudEnabled:m,tunnelEnabled:j})}})()]})}},87764:(e,t,a)=>{Promise.resolve().then(a.bind(a,85309))}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,6069,8441,3794,7358],()=>e(e.s=87764)),_N_E=e.O()}]);