import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{DK as t,Dvt as n,EG as r,Ek as i,JB as a,KK as o,Mvt as s,NK as c,NV as l,PK as u,PV as d,Rft as f,Sw as p,TG as m,Tk as h,UK as g,Vft as _,WB as v,XK as y,YK as b,_w as x,blt as S,pw as C,uw as w,wK as T,xlt as E,xw as D}from"./app-initial-BHB6SClA.js";function O(e){let n=(0,j.c)(21),{cwd:r,hostId:i}=e,a;n[0]===i?a=n[1]:(a={hostId:i},n[0]=i,n[1]=a);let s=u(a),c;n[2]===s?c=n[3]:(c={enabled:s},n[2]=s,n[3]=c);let{availablePlugins:l,errorMessage:d,featuredPluginIds:f,forceReload:p,isLoading:m}=t(i,r,c),{installPlugin:h,status:g}=o(),_;n[4]!==p||n[5]!==i||n[6]!==h?(_=(e,t)=>h(e,{...t,hostId:i,onSuccess:p}),n[4]=p,n[5]=i,n[6]=h,n[7]=_):_=n[7];let v=_,y;n[8]===l?y=n[9]:(y=C(l),n[8]=l,n[9]=y);let b=y,S;n[10]!==l||n[11]!==f?(S=x({featuredPluginIds:f,plugins:l}).find(A)?.plugins.filter(k).slice(0,8)??[],n[10]=l,n[11]=f,n[12]=S):S=n[12];let w=S,T=g?.hostId===i?g:null,E=d!=null&&b.length===0,D;return n[13]!==b||n[14]!==w||n[15]!==m||n[16]!==v||n[17]!==T||n[18]!==s||n[19]!==E?(D={connectedPlugins:b,featuredPlugins:w,hasLoadError:E,isLoading:m,openPluginInstall:v,pluginsFeatureEnabled:s,pluginInstallationStatus:T},n[13]=b,n[14]=w,n[15]=m,n[16]=v,n[17]=T,n[18]=s,n[19]=E,n[20]=D):D=n[20],D}function k(e){return!e.plugin.installed&&!p(e.plugin)}function A(e){let{section:t}=e;return t.id===`plugins-featured`}var j,M=e((()=>{j=s(),c(),D(),g(),w(),T()}));function N(e){let t=(0,P.c)(10),{featuredPlugins:n,label:r,onConnectPlugin:i,onOpenPluginDirectory:a}=e,o;t[0]!==n||t[1]!==i?(o=n.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(v.Section,{className:`flex flex-col`,children:n.map(e=>(0,F.jsxs)(v.Item,{RightIcon:S,onSelect:()=>i(e),children:[(0,F.jsx)(v.ItemIcon,{size:`xs`,children:(0,F.jsx)(m,{alt:``,className:`size-full object-contain`,knownAppId:e.plugin.name,logoDarkUrl:e.logoDarkPath,logoUrl:e.logoPath,fallback:(0,F.jsx)(l,{className:`size-full text-token-text-secondary`})})}),(0,F.jsx)(`span`,{children:b(e)})]},e.plugin.id))}),(0,F.jsx)(v.Separator,{})]}):null,t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(_,{id:`composer.workMode.plugins.browseAll`,defaultMessage:`Browse all plugins`,description:`Action that opens the full plugin directory from a plugin picker`}),t[3]=s):s=t[3];let c;t[4]===a?c=t[5]:(c=(0,F.jsx)(v.Section,{className:`flex flex-col`,children:(0,F.jsx)(v.Item,{RightIcon:h,onSelect:a,children:s})}),t[4]=a,t[5]=c);let u;return t[6]!==r||t[7]!==o||t[8]!==c?(u=(0,F.jsxs)(v.FlyoutSubmenuItem,{LeftIcon:l,contentSurface:`opaque`,contentWidth:`menuWide`,label:r,children:[o,c]}),t[6]=r,t[7]=o,t[8]=c,t[9]=u):u=t[9],u}var P,F,I=e((()=>{P=s(),f(),r(),a(),d(),i(),E(),y(),F=n()}));export{O as i,I as n,M as r,N as t};
//# sourceMappingURL=connect-plugins-submenu-item-BGJE5Nx-.js.map