import{o as a}from"./rolldown-runtime-iuO8RvI4.js";import{Jt as o,dn as t,en as e,fn as r,vn as i}from"./vendor-all-0-fRSUBfCr.js";import{Mi as s,ki as n}from"./vendor-frame-CwiylG4Y.js";import{Th as l,gp as c,hp as m}from"./shared-1-3-6x7RKF.js";import{fo as p}from"./shared-6-Cf_fMhRZ.js";import{J as d,X as f,lt as g}from"./shared-frame-DbQbH4Yr.js";import{w as h}from"./vendor-all-3-CWo5e8Lw.js";import{t as u}from"./cc3ddf513-nvsaALAX.js";var v=r({title:i(),body:i(),imageUrl:i().optional(),imageUrlDark:i().optional(),pictogramName:i().optional(),pictogramAnimated:e().optional(),pictogramSize:o(["sm","md","lg"]).optional().catch(void 0),pictogramBackground:o(["alpha-1","surface-0","surface-1","surface-2","surface-3"]).optional().catch(void 0),imageFit:o(["cover","contain"]).optional(),imageHeight:t().optional().catch(void 0),cardWidth:t().optional().catch(void 0),buttonText:i(),buttonHref:i(),ctaType:o(["href","cowork-upsell"]).optional()}),b=a(s()),k=n(),j=(0,b.memo)(({content:a,enabled:o,onDismiss:t,onAction:e})=>{const r=v.safeParse(a),i=f(50),s=g(),n=r.success?r.data.buttonHref:"",j=/^https?:\/\//i.test(n),x=j?n:l(n),C=(0,b.useCallback)(a=>{j&&(a.preventDefault(),c({href:x})),e()},[e,j,x]),D=(0,b.useCallback)(()=>{},[]),w=(0,b.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),t()},[t]);if(!o||!r.success)return null;const y={...r.data,imageUrl:"dark"===s&&r.data.imageUrlDark?r.data.imageUrlDark:r.data.imageUrl};return(0,k.jsx)(h.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"fixed bottom-10 right-10",style:{zIndex:i},children:(0,k.jsx)(d,{children:(0,k.jsx)(m,{href:x,webBehavior:j?"new-tab":"navigate",desktopBehavior:j?"open-in-browser":"navigate",rel:"noreferrer",onClick:C,className:"block cursor-pointer",children:(0,k.jsx)(u,{content:y,onCtaClick:D,onDismiss:w,ImageComponent:p})})})})});export{j as CoworkNudgeV1};