import{r as o,j as e}from"./vendor-react-Dp9pL_Wn.js";import{a as s}from"./cd27d5348-ivimUdOU.js";import{k as r,a8 as t,a9 as a,aa as i,ab as n,ac as c,z as d,A as m,a6 as p,D as j,a7 as l}from"./c4b350ac1-KLFM4jkb.js";import{u as f}from"./vendor-intl-BDR1NhN_.js";import{K as b}from"./index-CSvjYuL_.js";import{u,e as k,C as v}from"./vendor-ant-cds-DvTmcYA1.js";import{m as h}from"./vendor-motion-D7Z1qgzM.js";import"./ca8998c31-P9hjFFxa.js";import"./vendor-zod-DIcz3Rbr.js";import"./c62933a29-Bny4k5NF.js";import"./cdabaac79-3sBTRaya.js";import"./ca4e68303-2GEI1XEE.js";import"./ce5824dc6-DCrxq2nV.js";import"./c5decd681-BZUxtT_J.js";import"./ca9bd5d1a-BwvQdQH8.js";import"./c1f96d614-CNpmgQ8l.js";import"./c393cb7f5-HUvLXarC.js";import"./ccca85712-CxU_jF8g.js";import"./c0f96d0e0-DGUPaEDS.js";import"./vendor-base-ui-CdQU4JQh.js";import"./vendor-radix-D3USJ4lr.js";import"./vendor-base-5_f7mmWg.js";import"./vendor-zustand-CI9omAwJ.js";import"./vendor-icons-BBStP_8q.js";import"./vendor-lodash-CIro4mst.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-DgCRID2b.js";import"./vendor-luxon-Y8l99kBI.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-growthbook-C66YtMMX.js";import"./c40b9b8f5-CcFpJKg-.js";import"./cbf215181-Bsdk_iVX.js";import"./c82022b5f-v1T93ITZ.js";import"./c627fcdb6-v1yU0Z6G.js";import"./c85adc124-DaXgLnIc.js";import"./c4b43b0ae-CSVSIKUp.js";import"./ce61829b3-0upsP-GZ.js";import"./c0632795f-DFHAnV4h.js";import"./c2591c98b-B0JYd9Jp.js";import"./c9bba154c-Bw59591Y.js";import"./c2a658aad-Db1B4w67.js";import"./c0e977562-B_Zbx8nl.js";import"./c9f4bb49e-CrIVzJHt.js";import"./cc2dfdfd3-BrnuP9el.js";import"./c6a992d55-BgxzHrh5.js";import"./c9e81e7b9-CQ79hI5E.js";import"./cdd5b9598-DXIbe6ku.js";import"./cf57f6351-BOW8NPIt.js";import"./c5669b8e4-B4xCGVen.js";import"./c93f725a0-BmtJGQGk.js";import"./c26148d62-Db4ihZzY.js";import"./vendor-virtual-DRz8lJfQ.js";import"./c3a36db6f-BVEOyI7C.js";import"./cc2e285cb-ERZJd0nP.js";import"./c4526f334-DmmtJSHf.js";import"./cb59e2e62-DU7B8aps.js";import"./c009a87a0-BdYPxNaw.js";import"./c8c15d455-BRkvbsON.js";function w(){}const g=o.memo(({content:g,enabled:x,onDismiss:C,onAction:M})=>{const D=g,y=u(50),E=f(),_=r("claude_ai_sot_has_desktop"),q=t(),z=a(),A=i(),N=b(),T="cowork-upsell"===D.ctaType,U=n({when:x&&T}),I=c(),O=k(),[P,B]=o.useState(null);o.useEffect(()=>{d().then(o=>B(o))},[]);const[H,S]=o.useState(!1),{downloadAndOpenModal:Y,modal:F}=m("home_nudge_v1",{onClose:()=>{S(!1),M({cta:"download"})}}),K=o.useCallback(()=>{M()},[M]),V=o.useCallback(()=>{M({cta:"open-cowork"})},[M]),G=o.useCallback(()=>{M({cta:"open-desktop"})},[M]),J=o.useCallback(o=>{o.preventDefault(),Y(P),S(!0)},[Y,P]),L=o.useCallback(o=>{o.preventDefault(),o.stopPropagation(),C()},[C]);if(!x)return null;const Q=!A&&(q||z);let R,W,X;if(T&&U.routesInApp)R={kind:"open-cowork"};else if(T&&Q&&_)R={kind:"open-desktop"};else if(T&&Q&&N)R={kind:"download"};else{const o=D.buttonHref,e=/^https?:\/\//i.test(o);R={kind:"href",href:e?o:p(o),isExternal:e}}let Z,$=!1;switch(R.kind){case"open-cowork":W=I,X=D.buttonText??E.formatMessage({defaultMessage:"Open Cowork",id:"PfEq6+YMsC"}),Z=V;break;case"open-desktop":W="claude://cowork/new",X=E.formatMessage({defaultMessage:"Open Cowork",id:"PfEq6+YMsC"}),Z=G;break;case"download":W="#",X=E.formatMessage({defaultMessage:"Download",id:"5q3qC0sC3r"}),Z=J;break;case"href":W=R.href,X=D.buttonText,$=R.isExternal,Z=K}const oo={...D,buttonText:X,imageUrl:"dark"===O&&D.imageUrlDark?D.imageUrlDark:D.imageUrl};return e.jsxs(e.Fragment,{children:[!H&&e.jsx(h.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"fixed bottom-10 right-10",style:{zIndex:y},children:e.jsx(v,{children:e.jsx(j,{href:W,webBehavior:$?"new-tab":"navigate",desktopBehavior:$?"open-in-browser":"navigate",rel:"noreferrer",onClick:Z,className:"block cursor-pointer",children:e.jsx(s,{content:oo,onCtaClick:"href"===R.kind?K:w,onDismiss:L,ImageComponent:l})})})}),"download"===R.kind&&F]})});g.displayName="HomeNudgeV1";export{g as HomeNudgeV1};
