import{r as o,j as a}from"./vendor-react-Dp9pL_Wn.js";import{a as r}from"./cd27d5348-DUijrm77.js";import{o as t,_ as i,s as e,n as s,b as n}from"./vendor-zod-0xcuG3aM.js";import{a8 as c,q as m,D as p}from"./c6eedc03a-CsEFTfjy.js";import{av as d}from"./index-DhMXk6CR.js";import{u as l,e as j,C as v}from"./vendor-ant-cds-bBedrtIN.js";import{m as f}from"./vendor-motion-EDlUw66k.js";import"./caf7c7e06-DJYXCm3T.js";import"./c62933a29-BojHUSii.js";import"./c60f5ad19-R8w-svgU.js";import"./vendor-base-5_f7mmWg.js";import"./c32c0d97f-BRKlKuDE.js";import"./ca4e68303-2GEI1XEE.js";import"./ce5824dc6-DCrxq2nV.js";import"./c393cb7f5-B9bpbpka.js";import"./c41323917-D2qX4YRv.js";import"./vendor-intl-D2wGIp4M.js";import"./c57c2877c-CDK50aMX.js";import"./cd78d010c-Dyg6Wpc_.js";import"./c5f3f4681-re2ND0pU.js";import"./vendor-base-ui-DNypCIlh.js";import"./vendor-radix-Ch96tRrt.js";import"./vendor-zustand-BeF8W8xk.js";import"./vendor-icons-CokWnmlw.js";import"./vendor-lodash-BvMLws5K.js";import"./vendor-router-qG5OCEmI.js";import"./vendor-query-BwvgHhJ1.js";import"./vendor-zod-v3-CZy0YPWu.js";import"./vendor-luxon-CZxT8ieM.js";import"./vendor-growthbook-C66YtMMX.js";import"./vendor-infra-DayZK7Ds.js";import"./c5669b8e4-DFSq88jr.js";import"./c5f4e1303-CiyIFgnl.js";import"./cbaad2c48-DaP34LG2.js";import"./vendor-virtual-DRz8lJfQ.js";const u=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()}),g=o.memo(({content:t,enabled:i,onDismiss:e,onAction:s})=>{const n=u.safeParse(t),g=l(50),b=j(),h=n.success?n.data.buttonHref:"",k=/^https?:\/\//i.test(h),x=k?h:c(h),y=o.useCallback(o=>{k&&(o.preventDefault(),m({href:x})),s()},[s,k,x]),C=o.useCallback(()=>{},[]),D=o.useCallback(o=>{o.preventDefault(),o.stopPropagation(),e()},[e]);if(!i||!n.success)return null;const w={...n.data,imageUrl:"dark"===b&&n.data.imageUrlDark?n.data.imageUrlDark:n.data.imageUrl};return a.jsx(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"fixed bottom-10 right-10",style:{zIndex:g},children:a.jsx(v,{children:a.jsx(p,{href:x,webBehavior:k?"new-tab":"navigate",desktopBehavior:k?"open-in-browser":"navigate",rel:"noreferrer",onClick:y,className:"block cursor-pointer",children:a.jsx(r,{content:w,onCtaClick:C,onDismiss:D,ImageComponent:d})})})})});g.displayName="CoworkNudgeV1";export{g as CoworkNudgeV1};
