import{r as e,j as o}from"./vendor-react-Dp9pL_Wn.js";import{N as r,O as t,E as s,P as i}from"./index-CBEPphRm.js";import{s as n}from"./c6eedc03a-CsEFTfjy.js";import{u as d}from"./vendor-intl-D2wGIp4M.js";import{u as a}from"./cd2515372-BZ_mqLXP.js";import{ChatTooltipV1 as m}from"./c8ce600ec-DewQfVZl.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-zod-0xcuG3aM.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-ant-cds-bBedrtIN.js";import"./vendor-base-ui-DNypCIlh.js";import"./vendor-radix-Ch96tRrt.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-virtual-DRz8lJfQ.js";import"./vendor-query-BwvgHhJ1.js";import"./vendor-zustand-BeF8W8xk.js";import"./caf7c7e06-DJYXCm3T.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-icons-CokWnmlw.js";import"./vendor-motion-EDlUw66k.js";import"./c5669b8e4-DFSq88jr.js";import"./vendor-luxon-CZxT8ieM.js";import"./c5f4e1303-CiyIFgnl.js";import"./cbaad2c48-DaP34LG2.js";import"./vendor-growthbook-C66YtMMX.js";import"./vendor-zod-v3-CZy0YPWu.js";const l=e.memo(({enabled:l,onDismiss:u,onAction:c})=>{const{model:p,isSettled:j}=a(),f=r(),v=t("chat-tooltip"),b=j&&f(p),g=e.useRef(!1);e.useEffect(()=>{!j||b||g.current||(g.current=!0,u())},[j,b,u]);const{shouldGate:x,memberCanRequest:y,isUsageCreditsFunded:h,creditsRequiredClickRoute:q,isBillingStateSettled:k,creditPromoOutranksGate:R}=s({enabled:b}),A=x||y,M=d(),T=e.useMemo(()=>{if(!p)return;const e={model:i(p)},o={type:"model-selector",nuxTitle:n({id:"fxw77i",intl:M,dangerouslyVisiblePublicValues:e}),nuxText:n({id:h?"1yod0ea":"request"===q?y?"p3jdos":"1o1tfnn":"enable"===q?"1g2ehd2":"1o1tfnn",intl:M,dangerouslyVisiblePublicValues:e})};return A?{...o,ctaAction:{text:"request"===q?M.formatMessage({defaultMessage:"Request usage credits",id:"3gNFS1DF0J"}):"enable"===q?M.formatMessage({defaultMessage:"Turn on usage credits",id:"RF538op5DA"}):n({id:"hgk1x2",intl:M}),type:"credits_required_modal",value:p}}:o},[p,A,y,h,q,M]);return b&&l&&k&&!R&&T?o.jsx(m,{experienceKey:v?.key??v?.id??"",experienceId:v?.id??"",content:T,enabled:l,onDismiss:u,onAction:c}):null});l.displayName="CreditsTransitionTooltip";export{l as CreditsTransitionTooltip};
