import{r as e,j as o}from"./vendor-react-AXa6hZO5.js";import{M as s}from"./vendor-intl-BdADXLLt.js";import{I as r,G as t,J as n}from"./index-C_tZnXTW.js";import"./vendor-infra-CFC-WJ8N.js";import"./vendor-zod-CMvj0_Fd.js";import"./cec18ad9a-DiLjrOUd.js";import"./vendor-radix-glKlawmm.js";import"./vendor-zustand-CcZsBpBq.js";import"./vendor-icons-Dy3Nea9p.js";import"./vendor-lodash-BKAXkXVe.js";import"./vendor-motion-0BJMgYoH.js";import"./vendor-router-BSYVf8By.js";import"./vendor-query-D7SPXjZv.js";import"./vendor-growthbook-XJcBFzji.js";import"./cdd5b9598-juLasKsB.js";import"./c2591c98b-9UrrTnB9.js";import"./vendor-luxon-D0OkDiyb.js";import"./c51f8bc6d-BS9P5nN1.js";import"./tree-sitter-BFuuT2ac.js";const a=e.memo(({onDismiss:a,onAction:i})=>{const{data:m}=r(!0),[d,l]=e.useState(!1),c=m?.organizations?.filter(e=>!e.has_pending_request)??[],u=c.length>0,j=e.useRef(!1),p=e.useCallback(()=>{j.current=!0,l(!0)},[]),g=e.useCallback(()=>{l(!1),j.current&&i()},[i]);if(!u&&!d)return null;const v=1===c.length?c[0]:null;return o.jsxs(o.Fragment,{children:[c.length>0&&o.jsx(t,{message:v?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:v.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:c.length}}),button:{children:v?o.jsx(s,{defaultMessage:"Request to join",id:"CVbwp6HiQE"}):o.jsx(s,{defaultMessage:"View teams",id:"bY1U+Iziei"}),onClick:p},onDismiss:a}),o.jsx(n,{isOpen:d,onClose:g})]})});a.displayName="JoinDiscoverableOrgBanner";export{a as JoinDiscoverableOrgBanner};
