import{r as e,j as o}from"./vendor-react-AXa6hZO5.js";import{M as s}from"./vendor-intl-BdADXLLt.js";import{N as r,G as n,J as t}from"./index-D35RxkWr.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-zod-1gcJXWab.js";import"./c6eedc03a-C8LSdtro.js";import"./vendor-lodash-D-zrMTUO.js";import"./vendor-zustand-CcZsBpBq.js";import"./vendor-icons-DsiQAprm.js";import"./vendor-motion-DGh7M6mr.js";import"./vendor-radix-jAWPQP1f.js";import"./vendor-router-B4CxQ1po.js";import"./vendor-query-B8PP3rYl.js";import"./vendor-growthbook-XJcBFzji.js";import"./c365fd3fe-Dmpsm876.js";import"./c70a3d12b-BI7Bbafv.js";import"./vendor-luxon-Y8l99kBI.js";import"./tree-sitter-BFuuT2ac.js";const a=e.memo(({onDismiss:a,onAction:i})=>{const{data:d}=r(!0),[m,l]=e.useState(!1),u=d?.organizations?.filter(e=>!e.has_pending_request)??[],c=u.length>0,j=e.useRef(!1),p=e.useCallback(()=>{j.current=!0,l(!0)},[]),g=e.useCallback(()=>{l(!1),j.current&&i()},[i]);if(!c&&!m)return null;const f=1===u.length?u[0]:null;return o.jsxs(o.Fragment,{children:[u.length>0&&o.jsx(n,{message:f?o.jsx(s,{defaultMessage:"{orgName} is on Claude. Join your team to share projects and chats.",id:"7U3S+cHC20",values:{orgName:o.jsx("strong",{children:f.name})}}):o.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:u.length}}),button:{children:f?o.jsx(s,{defaultMessage:"Request to join",id:"CVbwp6HiQE"}):o.jsx(s,{defaultMessage:"View teams",id:"bY1U+Iziei"}),onClick:p},onDismiss:a}),o.jsx(t,{isOpen:m,onClose:g})]})});a.displayName="JoinDiscoverableOrgBanner";export{a as JoinDiscoverableOrgBanner};
