import{r as o,j as a}from"./vendor-react-Dp9pL_Wn.js";import{a as r}from"./cd27d5348-DPZVK3vw.js";import{o as t,_ as i,s as e,n as s,b as n}from"./vendor-zod-B8MhECV7.js";import{ag as c,x as m,D as p}from"./c2ee0272b-DPDuX889.js";import{aA as d}from"./index-XoaBlZfC.js";import{u as l,f as j,C as v}from"./vendor-ant-cds-BLsR_p72.js";import{m as b}from"./vendor-motion-EDlUw66k.js";import"./c9a5287df-D_Z7ffFR.js";import"./c62933a29-BTmwOnJk.js";import"./caf7c7e06-DiSIOZ2Y.js";import"./vendor-base-5_f7mmWg.js";import"./ca4e68303-2GEI1XEE.js";import"./ce5824dc6-DCrxq2nV.js";import"./cb3073067-VsOwq8wi.js";import"./c1e35bcba-VJ15EpPv.js";import"./c80791b3a-C9RrC3yS.js";import"./c7d6fc21a-XgEBZrGw.js";import"./vendor-intl-D2wGIp4M.js";import"./c86a1b907-DGD2pwio.js";import"./vendor-luxon-CZxT8ieM.js";import"./c33b2042a-BXM4oh1L.js";import"./c6a992d55-BwJodww6.js";import"./cba0eac33-DiCKjNP1.js";import"./vendor-base-ui-N1VQ4ctE.js";import"./vendor-radix-Dv3qPI0v.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-infra-DayZK7Ds.js";import"./vendor-growthbook-HDTqppl-.js";import"./c51e217b4-CQax1dv1.js";import"./c627fcdb6-1_bsVTpt.js";import"./vendor-virtual-DRz8lJfQ.js";const f=t({title:e(),body:e(),imageUrl:e().optional(),imageUrlDark:e().optional(),pictogramName:e().optional(),pictogramAnimated:n().optional(),pictogramSize:i(["sm","md","lg"]).optional().catch(void 0),pictogramBackground:i(["alpha-1","surface-0","surface-1","surface-2","surface-3"]).optional().catch(void 0),imageFit:i(["cover","contain"]).optional(),imageHeight:s().optional().catch(void 0),cardWidth:s().optional().catch(void 0),buttonText:e(),buttonHref:e(),ctaType:i(["href","cowork-upsell"]).optional()}),u=o.memo(({content:t,enabled:i,onDismiss:e,onAction:s})=>{const n=f.safeParse(t),u=l(50),g=j(),h=n.success?n.data.buttonHref:"",k=/^https?:\/\//i.test(h),x=k?h:c(h),C=o.useCallback(o=>{k&&(o.preventDefault(),m({href:x})),s()},[s,k,x]),D=o.useCallback(()=>{},[]),y=o.useCallback(o=>{o.preventDefault(),o.stopPropagation(),e()},[e]);if(!i||!n.success)return null;const w={...n.data,imageUrl:"dark"===g&&n.data.imageUrlDark?n.data.imageUrlDark:n.data.imageUrl};return a.jsx(b.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"fixed bottom-10 right-10",style:{zIndex:u},children:a.jsx(v,{children:a.jsx(p,{href:x,webBehavior:k?"new-tab":"navigate",desktopBehavior:k?"open-in-browser":"navigate",rel:"noreferrer",onClick:C,className:"block cursor-pointer",children:a.jsx(r,{content:w,onCtaClick:D,onDismiss:y,ImageComponent:d})})})})});export{u as CoworkNudgeV1};
