import{n as e}from"./rolldown-runtime-Czos8NxU.js";import{K as t,Tl as n,W as r,vl as i}from"./app-initial~app-main~worktree-init-v2-page~appgen-settings-page~page~appgen-publication-ter~fzo5ij6p-BKVLyD1q.js";import{Tr as a,wr as o}from"./app-initial~app-main~onboarding-page-CNHnOMz8.js";import{O as s,S as c,dt as l,ut as u,w as d}from"./app-initial~app-main~remote-conversation-page~new-thread-panel-page~onboarding-page~project~okyna5mq-CgvyzQvO.js";import{Sx as f,nx as p,rx as m,wx as h,yx as g}from"./app-initial~app-main~new-thread-panel-page-BZHGOlMi.js";import{Ei as _,Ti as v}from"./app-initial~app-main~remote-conversation-page~new-thread-panel-page~onboarding-page~appgen-~o4yhvtva-CRxLUCiX.js";import{B as y,I as b}from"./app-initial~app-main~remote-conversation-page~new-thread-panel-page~appgen-library-page~hot~djo67r4n-DfdeaLvo.js";import{c as x,l as S}from"./app-initial~app-main~appgen-page~remote-conversation-page~projects-index-page~appgen-librar~i4jkvfhy-BLsuVbVi.js";function C(e){let n=(0,E.c)(43),{connectedRemoteConnections:r,disabled:i,onSelectHost:a,remoteConnectionHostIds:s,selectedHostId:l,align:p,contentWidth:m,localIcon:g,localLabel:_,showConnectedIndicator:v,triggerClassName:y,triggerColor:x,useRemoteHostColors:S}=e,C=i===void 0?!1:i,O=g===void 0?o:g,k=v===void 0?!1:v,A=S===void 0?!0:S,j=h(),M;n[0]!==r||n[1]!==l?(M=r.find(e=>e.hostId===l)??null,n[0]=r,n[1]=l,n[2]=M):M=n[2];let N=M,P;n[3]!==j||n[4]!==_?(P=_??j.formatMessage({id:`settings.hostDropdown.local`,defaultMessage:`Local`,description:`Label for the local host in settings connection dropdowns`}),n[3]=j,n[4]=_,n[5]=P):P=n[5];let F=P,I=N?.displayName??F,L;n[6]===F?L=n[7]:(L={hostId:t,displayName:F},n[6]=F,n[7]=L);let R;n[8]!==r||n[9]!==L?(R=[L,...r],n[8]=r,n[9]=L,n[10]=R):R=n[10];let z=R,B=C?`hidden`:void 0,V;n[11]!==O||n[12]!==s||n[13]!==N||n[14]!==A?(V=N==null?(0,D.jsx)(O,{className:`icon-xs shrink-0 text-token-foreground`}):(0,D.jsx)(T,{className:`icon-xs shrink-0`,hostId:N.hostId,hostIdsForColorAssignment:s,useRemoteHostColors:A}),n[11]=O,n[12]=s,n[13]=N,n[14]=A,n[15]=V):V=n[15];let H;n[16]===I?H=n[17]:(H=(0,D.jsx)(`span`,{className:`truncate text-left text-token-foreground`,children:I}),n[16]=I,n[17]=H);let U;n[18]!==N||n[19]!==k?(U=N!=null&&k?(0,D.jsx)(w,{}):null,n[18]=N,n[19]=k,n[20]=U):U=n[20];let W;n[21]!==C||n[22]!==V||n[23]!==H||n[24]!==U||n[25]!==B||n[26]!==y||n[27]!==x?(W=(0,D.jsxs)(b,{className:y,color:x,disabled:C,chevronClassName:B,children:[V,H,U]}),n[21]=C,n[22]=V,n[23]=H,n[24]=U,n[25]=B,n[26]=y,n[27]=x,n[28]=W):W=n[28];let G=W;if(C)return G;let K=p??`end`,q=m??`menuWide`,J;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,D.jsx)(d.Title,{children:(0,D.jsx)(f,{id:`settings.hostDropdown.title`,defaultMessage:`Host`,description:`Title for the Host dropdown shown in settings pages`})}),n[29]=J):J=n[29];let Y;n[30]!==O||n[31]!==z||n[32]!==a||n[33]!==s||n[34]!==l||n[35]!==k||n[36]!==A?(Y=(0,D.jsx)(d.Section,{className:`max-h-40 overflow-y-auto`,children:z.map(e=>(0,D.jsx)(d.Item,{RightIcon:e.hostId===l?u:void 0,onSelect:()=>{a(e.hostId)},children:(0,D.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e.hostId===`local`?(0,D.jsx)(O,{className:`icon-xs shrink-0`}):(0,D.jsx)(T,{className:`icon-xs shrink-0`,hostId:e.hostId,hostIdsForColorAssignment:s,useRemoteHostColors:A}),(0,D.jsx)(`span`,{className:`truncate`,children:e.displayName}),e.hostId!==`local`&&k?(0,D.jsx)(w,{}):null]})},e.hostId))}),n[30]=O,n[31]=z,n[32]=a,n[33]=s,n[34]=l,n[35]=k,n[36]=A,n[37]=Y):Y=n[37];let X;return n[38]!==K||n[39]!==q||n[40]!==Y||n[41]!==G?(X=(0,D.jsxs)(c,{align:K,contentWidth:q,triggerButton:G,children:[J,Y]}),n[38]=K,n[39]=q,n[40]=Y,n[41]=G,n[42]=X):X=n[42],X}function w(){let e=(0,E.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(`span`,{"aria-hidden":!0,className:`block size-2 shrink-0 rounded-full bg-green-500`}),e[0]=t):t=e[0],t}function T(e){let t=(0,E.c)(8),{className:n,hostId:r,hostIdsForColorAssignment:i,useRemoteHostColors:a}=e;if(!a){let e;t[0]===n?e=t[1]:(e=p(n,`text-token-foreground`),t[0]=n,t[1]=e);let r;return t[2]===e?r=t[3]:(r=(0,D.jsx)(v,{className:e}),t[2]=e,t[3]=r),r}let o;return t[4]!==n||t[5]!==r||t[6]!==i?(o=(0,D.jsx)(x,{className:n,hostId:r,hostIdsForColorAssignment:i}),t[4]=n,t[5]=r,t[6]=i,t[7]=o):o=t[7],o}var E,D,O=e((()=>{E=n(),m(),g(),s(),S(),l(),_(),a(),r(),y(),D=i()}));export{O as n,C as t};
//# sourceMappingURL=settings-host-dropdown-BRR4ddBk.js.map