import{r as o,j as e}from"./vendor-react-Dp9pL_Wn.js";import{M as s}from"./vendor-intl-D2wGIp4M.js";import{L as r,G as t,J as n}from"./index-XoaBlZfC.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-zod-B8MhECV7.js";import"./c2ee0272b-DPDuX889.js";import"./vendor-ant-cds-BLsR_p72.js";import"./vendor-base-ui-N1VQ4ctE.js";import"./vendor-radix-Dv3qPI0v.js";import"./vendor-virtual-DRz8lJfQ.js";import"./vendor-zustand-BeF8W8xk.js";import"./vendor-icons-DGChWNxR.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-CRl6sF7K.js";import"./vendor-zod-v3-CZy0YPWu.js";import"./vendor-motion-EDlUw66k.js";import"./vendor-luxon-CZxT8ieM.js";import"./vendor-growthbook-HDTqppl-.js";import"./c9a5287df-D_Z7ffFR.js";import"./c51e217b4-CQax1dv1.js";import"./c627fcdb6-1_bsVTpt.js";const i=o.memo(({onDismiss:i,onAction:a})=>{const{data:d}=r(!0),[m,j]=o.useState(!1),l=d?.organizations?.filter(o=>!o.has_pending_request)??[],u=l.length>0,p=o.useRef(!1),c=o.useCallback(()=>{p.current=!0,j(!0)},[]),v=o.useCallback(()=>{j(!1),p.current&&a()},[a]);if(!u&&!m)return null;const f=1===l.length?l[0]:null;return e.jsxs(e.Fragment,{children:[l.length>0&&e.jsx(t,{message:f?e.jsx(s,{defaultMessage:"{orgName} is on Claude. Join your team to share projects and chats.",id:"7U3S+cHC20",values:{orgName:e.jsx("strong",{children:f.name})}}):e.jsx(s,{defaultMessage:"{count, plural, one {# team from your company is on Claude.} other {# teams from your company are on Claude.}}",id:"rCfcYOkcYs",values:{count:l.length}}),button:{children:f?e.jsx(s,{defaultMessage:"Request to join",id:"CVbwp6HiQE"}):e.jsx(s,{defaultMessage:"View teams",id:"bY1U+Iziei"}),onClick:c},onDismiss:i}),e.jsx(n,{isOpen:m,onClose:v})]})});export{i as JoinDiscoverableOrgBanner};
