import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{Dvt as t,HB as n,JB as r,Jlt as i,Jr as a,KS as o,Mvt as s,Rft as c,Vft as l,WB as u,Wft as d,Zr as f,ch as p,qS as m,qlt as h,sh as g,xot as _,yot as v}from"./app-initial-BHB6SClA.js";function y(e){let t=(0,x.c)(39),{connectedRemoteConnections:r,disabled:i,onSelectHost:s,selectedHostId:c,align:f,contentWidth:p,localIcon:m,localLabel:v,showConnectedIndicator:y,triggerClassName:C,triggerColor:w}=e,T=i===void 0?!1:i,E=m===void 0?o:m,D=y===void 0?!1:y,O=d(),k;t[0]!==r||t[1]!==c?(k=r.find(e=>e.hostId===c)??null,t[0]=r,t[1]=c,t[2]=k):k=t[2];let A=k,j;t[3]!==O||t[4]!==v?(j=v??O.formatMessage({id:`settings.hostDropdown.local`,defaultMessage:`Local`,description:`Label for the local host in settings connection dropdowns`}),t[3]=O,t[4]=v,t[5]=j):j=t[5];let M=j,N=A?.displayName??M,P;t[6]===M?P=t[7]:(P={hostId:_,displayName:M},t[6]=M,t[7]=P);let F;t[8]!==r||t[9]!==P?(F=[P,...r],t[8]=r,t[9]=P,t[10]=F):F=t[10];let I=F,L=T?`hidden`:void 0,R;t[11]!==E||t[12]!==A?(R=A==null?(0,S.jsx)(E,{className:`icon-xs shrink-0 text-token-foreground`}):(0,S.jsx)(g,{className:`icon-xs shrink-0`,hostId:A.hostId}),t[11]=E,t[12]=A,t[13]=R):R=t[13];let z;t[14]===N?z=t[15]:(z=(0,S.jsx)(`span`,{className:`truncate text-left text-token-foreground`,children:N}),t[14]=N,t[15]=z);let B;t[16]!==A||t[17]!==D?(B=A!=null&&D?(0,S.jsx)(b,{}):null,t[16]=A,t[17]=D,t[18]=B):B=t[18];let V;t[19]!==T||t[20]!==z||t[21]!==B||t[22]!==L||t[23]!==R||t[24]!==C||t[25]!==w?(V=(0,S.jsxs)(a,{className:C,color:w,disabled:T,chevronClassName:L,children:[R,z,B]}),t[19]=T,t[20]=z,t[21]=B,t[22]=L,t[23]=R,t[24]=C,t[25]=w,t[26]=V):V=t[26];let H=V;if(T)return H;let U=f??`end`,W=p??`menuWide`,G;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,S.jsx)(u.Title,{children:(0,S.jsx)(l,{id:`settings.hostDropdown.title`,defaultMessage:`Host`,description:`Title for the Host dropdown shown in settings pages`})}),t[27]=G):G=t[27];let K;t[28]!==E||t[29]!==I||t[30]!==s||t[31]!==c||t[32]!==D?(K=(0,S.jsx)(u.Section,{className:`max-h-40 overflow-y-auto`,children:I.map(e=>(0,S.jsx)(u.Item,{RightIcon:e.hostId===c?h:void 0,onSelect:()=>{s(e.hostId)},children:(0,S.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e.hostId===`local`?(0,S.jsx)(E,{className:`icon-xs shrink-0`}):(0,S.jsx)(g,{className:`icon-xs shrink-0`,hostId:e.hostId}),(0,S.jsx)(`span`,{className:`truncate`,children:e.displayName}),e.hostId!==`local`&&D?(0,S.jsx)(b,{}):null]})},e.hostId))}),t[28]=E,t[29]=I,t[30]=s,t[31]=c,t[32]=D,t[33]=K):K=t[33];let q;return t[34]!==U||t[35]!==W||t[36]!==K||t[37]!==H?(q=(0,S.jsxs)(n,{align:U,contentWidth:W,triggerButton:H,children:[G,K]}),t[34]=U,t[35]=W,t[36]=K,t[37]=H,t[38]=q):q=t[38],q}function b(){let e=(0,x.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,S.jsx)(`span`,{"aria-hidden":!0,className:`block size-2 shrink-0 rounded-full bg-green-500`}),e[0]=t):t=e[0],t}var x,S,C=e((()=>{x=s(),c(),r(),p(),i(),m(),v(),f(),S=t()}));export{C as n,y as t};
//# sourceMappingURL=settings-host-dropdown-zO83iEBq.js.map