import{r as e,j as s}from"./vendor-react-Dp9pL_Wn.js";import{_ as r,$ as n,a0 as o,s as i}from"./c2ee0272b-DPDuX889.js";import{u as t,M as a}from"./vendor-intl-D2wGIp4M.js";import{a2 as d,H as l,g as c}from"./index-XoaBlZfC.js";import{u as m}from"./ce86bcde3-Clmn3KKw.js";import{e as u}from"./vendor-ant-cds-BLsR_p72.js";import"./vendor-base-ui-N1VQ4ctE.js";import"./vendor-radix-Dv3qPI0v.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-zod-B8MhECV7.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-infra-DayZK7Ds.js";import"./vendor-growthbook-HDTqppl-.js";import"./c9a5287df-D_Z7ffFR.js";import"./c51e217b4-CQax1dv1.js";import"./c627fcdb6-1_bsVTpt.js";import"./vendor-virtual-DRz8lJfQ.js";const j=c.__built("desktop_dusty_gondola_home_nudge_main"),p=e.memo(function({enabled:o,onDismiss:a,onAction:l}){const c=t(),{addError:u}=r(),j=n("desktop_dusty_gondola_home_nudge_main"),{partner:p}=m(),[g,f]=e.useState(p);null===g&&null!==p&&f(p);const[v,x]=e.useState(!1),h=e.useRef(!0);e.useEffect(()=>(h.current=!0,()=>{h.current=!1}),[]);const _=e.useCallback(()=>{if(!g||v)return;const e=d(g.partnerId,"home_nudge");if(!e)return;x(!0);const s=e=>{u(i({intl:c,id:e?"s4awtj":"160f0pf",dangerouslyVisiblePublicValues:{partnerName:g.displayName}}),{messageForLogging:"Home credential nudge connect failed"})};e.then(e=>{h.current&&(x(!1),e.paired?l({cta:"connect"}):"authPromptDeniedByUser"!==e.error&&s("rateLimited"===e.error))}).catch(()=>{h.current&&(x(!1),s(!1))})},[g,v,l,u,c]);return o&&g&&j?s.jsx(b,{partner:g,connecting:v,onConnect:_,onDismiss:a}):null}),b=e.memo(function({partner:r,connecting:n,onConnect:i,onDismiss:t}){const d={partnerName:r.displayName};return s.jsx(l,{variant:"always-visible",size:"large",onDismiss:t,onClick:i,media:s.jsx("div",{className:"h-full w-full bg-orange-500/20",children:s.jsx(e.Suspense,{fallback:null,children:s.jsx(j,{})})}),title:s.jsxs(s.Fragment,{children:[s.jsx(u,{variant:"accent",className:"mb-1",children:s.jsx(o,{id:"15yghke",dangerouslyVisiblePublicValues:d})}),s.jsx("span",{className:"block",children:s.jsx(o,{id:"168i84j",dangerouslyVisiblePublicValues:d})})]}),body:s.jsx(o,{id:"xfk2k7",dangerouslyVisiblePublicValues:d}),actionText:n?s.jsx(a,{defaultMessage:"Connecting\u2026",id:"YtxGgOZEIf"}):s.jsx(o,{id:"lp7nkr",dangerouslyVisiblePublicValues:d})})});export{p as DustyGondolaHomeNudge,b as DustyGondolaHomeNudgeCard};
