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