import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Mi as s,ki as o}from"./vendor-frame-CwiylG4Y.js";import{r as a}from"./shared-6-Cf_fMhRZ.js";import{nn as r}from"./vendor-all-2-BJdkbLSj.js";import{Pn as n}from"./shared-4-6CEyRAHb.js";import{q as t}from"./shared-14-BNdP3DJt.js";var i=e(s()),l=o(),m=(0,i.memo)(({onDismiss:e,onAction:s})=>{const{data:o}=n(!0),[m,u]=(0,i.useState)(!1),d=o?.organizations?.filter(e=>!e.has_pending_request)??[],c=d.length>0,f=(0,i.useRef)(!1),j=(0,i.useCallback)(()=>{f.current=!0,u(!0)},[]),g=(0,i.useCallback)(()=>{u(!1),f.current&&s()},[s]);if(!c&&!m)return null;const h=1===d.length?d[0]:null;return(0,l.jsxs)(l.Fragment,{children:[d.length>0&&(0,l.jsx)(a,{message:h?(0,l.jsx)(r,{defaultMessage:"{orgName} is on Claude. Join your team to share projects and chats.",id:"7U3S+cHC20",values:{orgName:(0,l.jsx)("strong",{children:h.name})}}):(0,l.jsx)(r,{defaultMessage:"{count, plural, one {# team from your company is on Claude.} other {# teams from your company are on Claude.}}",id:"rCfcYOkcYs",values:{count:d.length}}),button:{children:h?(0,l.jsx)(r,{defaultMessage:"Request to join",id:"CVbwp6HiQE"}):(0,l.jsx)(r,{defaultMessage:"View teams",id:"bY1U+Iziei"}),onClick:j},onDismiss:e}),(0,l.jsx)(t,{isOpen:m,onClose:g})]})});export{m as JoinDiscoverableOrgBanner};