module.exports=[912532,a=>{"use strict";var b=a.i(22169);a.s(["Card",()=>b.default])},833354,(a,b,c)=>{"use strict";c._=function(a){return a&&a.__esModule?a:{default:a}}},551746,a=>{"use strict";var b=a.i(532547);a.s(["ModelSelectModal",()=>b.default])},257871,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(238246);a.i(807284);var e=a.i(539204),f=a.i(333923);a.i(367434);var g=a.i(387945);a.i(436513);var h=a.i(716480),h=h,i=a.i(22321),i=i,j=a.i(475806),j=j,k=a.i(36416),k=k,l=a.i(676238),l=l,m=a.i(12407),m=m,n=a.i(16596),n=n,o=a.i(297918),o=o,p=a.i(311122),p=p,q=a.i(740222),q=q,r=a.i(777622),r=r,s=a.i(352802),s=s,t=a.i(151540),t=t;let u=process.env.NEXT_PUBLIC_CLOUD_URL;a.s(["default",0,function({toolId:a,machineId:v}){let w=f.CLI_TOOLS[a],[x,y]=(0,c.useState)([]),[z,A]=(0,c.useState)(!0),[B,C]=(0,c.useState)({}),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(""),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(""),[N,O]=(0,c.useState)([]);(0,c.useEffect)(()=>{let a=!0;return(async()=>{try{let[b,c,d,e]=await Promise.all([fetch("/api/providers"),fetch("/api/settings"),fetch("/api/tunnel/status"),fetch("/api/keys")]);if(!a)return;if(b.ok){let a=await b.json();y(a.connections||[])}if(c.ok){let a=await c.json();E(a.cloudEnabled||!1)}if(d.ok){let a=await d.json();G(!!(a.tunnel?.enabled||a.tunnel?.settingsEnabled)),I(a.tunnel?.publicUrl||""),K(!!(a.tailscale?.enabled||a.tailscale?.settingsEnabled)),M(a.tailscale?.tunnelUrl||"")}if(e.ok){let a=await e.json();O(a.keys||[])}}catch(a){console.log("Error loading tool data:",a)}finally{a&&A(!1)}})(),()=>{a=!1}},[]);let P=()=>x.filter(a=>!1!==a.isActive),Q=(0,c.useCallback)((a,b,c)=>{C(d=>d[a]?.[b]===c?d:{...d,[a]:{...d[a],[b]:c}})},[]);return w?(0,b.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,b.jsxs)(d.default,{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,b.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)("h1",{className:"text-xl font-semibold text-text-main sm:text-2xl",children:w.name}),(0,b.jsx)("p",{className:"text-sm text-text-muted",children:w.description})]}),z?(0,b.jsx)(e.CardSkeleton,{}):(()=>{let c,d,e,f=(c=P(),d=[],e=new Set,c.forEach(a=>{let b=g.PROVIDER_ID_TO_ALIAS[a.provider]||a.provider;(0,g.getModelsByProviderId)(a.provider).forEach(c=>{let f=`${b}/${c.id}`;e.has(f)||(e.add(f),d.push({value:f,label:`${b}/${c.id}`,provider:a.provider,alias:b,connectionName:a.name,modelId:c.id}))})}),d).length>0,v={tool:w,isExpanded:!0,onToggle:()=>{},baseUrl:F&&H?H:D&&u?u:"http://localhost:20128",apiKeys:N,tunnelEnabled:F,tunnelPublicUrl:H,tailscaleEnabled:J,tailscaleUrl:L};switch(a){case"claude":return(0,b.jsx)(h.default,{...v,activeProviders:P(),modelMappings:B[a]||{},onModelMappingChange:(b,c)=>Q(a,b,c),hasActiveProviders:f,cloudEnabled:D});case"codex":return(0,b.jsx)(i.default,{...v,activeProviders:P(),cloudEnabled:D});case"opencode":return(0,b.jsx)(n.default,{...v,activeProviders:P(),cloudEnabled:D});case"cowork":return(0,b.jsx)(o.default,{...v,activeProviders:P(),hasActiveProviders:f,cloudEnabled:D,cloudUrl:u,tunnelEnabled:F,tunnelPublicUrl:H,tailscaleEnabled:J,tailscaleUrl:L});case"droid":return(0,b.jsx)(j.default,{...v,activeProviders:P(),hasActiveProviders:f,cloudEnabled:D});case"openclaw":return(0,b.jsx)(k.default,{...v,activeProviders:P(),hasActiveProviders:f,cloudEnabled:D});case"hermes":return(0,b.jsx)(l.default,{...v,activeProviders:P(),hasActiveProviders:f,cloudEnabled:D});case"copilot":return(0,b.jsx)(p.default,{...v,activeProviders:P(),cloudEnabled:D});case"cline":return(0,b.jsx)(q.default,{...v,activeProviders:P(),cloudEnabled:D});case"kilo":return(0,b.jsx)(r.default,{...v,activeProviders:P(),cloudEnabled:D});case"deepseek-tui":return(0,b.jsx)(s.default,{...v,activeProviders:P(),hasActiveProviders:f,cloudEnabled:D});case"jcode":return(0,b.jsx)(t.default,{...v,activeProviders:P(),hasActiveProviders:f,cloudEnabled:D});default:return(0,b.jsx)(m.default,{toolId:a,...v,activeProviders:P(),cloudEnabled:D,tunnelEnabled:F})}})()]}):(0,b.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-4 px-1 sm:px-0",children:[(0,b.jsxs)(d.default,{href:"/dashboard/cli-tools",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary w-fit",children:[(0,b.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"arrow_back"}),"Back to CLI Tools"]}),(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"Tool not found or disabled."})]})}],257871)}];

//# sourceMappingURL=_08wmlgq._.js.map