import{r as e,j as s}from"./vendor-react-Dp9pL_Wn.js";import{I as a,w as i,M as t,ar as o,S as n}from"./c2ee0272b-DPDuX889.js";import{u as r,M as d}from"./vendor-intl-D2wGIp4M.js";import{aG as c,aH as l,aI as m,T as u,U as p,aJ as j}from"./index-XoaBlZfC.js";import{U as k}from"./c97b955f1-DCBQtt_p.js";import{e as v,B as h}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";import"./cc2095605-BGMoEd1A.js";import"./c24eb05d1-rJy5ns--.js";const g=e.memo(({conversationUuid:g})=>{const f=a(),x=r(),_=i(),b=t(g),M=c(b?.project_uuid??void 0),y=l(e=>e.tip),C=l(e=>e.dismissed),w=l(e=>e.dismiss),N=l(e=>e.clearIfNotConversation);e.useEffect(()=>{N(g)},[N,g]);const{scheduledTasks:z}=m("schedule"===y?.ctaMode),q=e.useMemo(()=>new Set(z.map(o)),[z]),[F,I]=e.useState(!1),[S,U]=e.useState(null);e.useEffect(()=>{u().then(U)},[]);const{downloadAndOpenModal:D,modal:G}=p("schedule_cowork_task_tip"),O=y?.cadenceForAnalytics??"other",P=e.useCallback(()=>{f.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"schedule",suggested_cadence:O,variant:"tip"}),I(!0)},[f,O]),T=e.useCallback(()=>{f.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"upgrade",suggested_cadence:O,variant:"tip"}),_.push(j)},[f,O,_]),W=e.useCallback(()=>{f.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"get_desktop",suggested_cadence:O,variant:"tip"}),D(S)},[f,O,D,S]),A=e.useCallback(()=>{f.track({event_key:"claudeai.schedule_cowork_task.dismissed",variant:"tip"}),w(g)},[f,w,g]),E=e.useCallback(e=>{_.push(`${n}/${encodeURIComponent(e.id)}`)},[_]),H=e.useMemo(()=>y?{prompt:y.prompt||void 0,isModelSuggested:!0,name:y.initialName,localNameFallback:y.localNameFallback,description:y.initialDescription,frequency:y.initialFrequency,hour:y.initialHour,minute:y.initialMinute,dayOfWeek:y.initialDayOfWeek}:void 0,[y]);return!y||y.conversationUuid!==g||C.has(g)?null:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex min-h-11 w-full items-center gap-sm rounded-xl bg-surface-1 py-xs pl-md pr-sm shadow-card-ring",children:[s.jsx(v,{variant:"neutral",icon:"Calendar",className:"shrink-0",children:s.jsx(d,{defaultMessage:"Tip",id:"4j1TGZubAJ"})}),s.jsx("span",{className:"text-caption text-primary line-clamp-2 min-w-0 flex-1 leading-4",children:s.jsx(d,{defaultMessage:"Want this every morning? Claude can run it on a schedule.",id:"IfGbKXDlq/"})}),s.jsxs("div",{className:"flex shrink-0 items-center gap-xs",children:["schedule"===y.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:P,children:s.jsx(d,{defaultMessage:"Schedule it",id:"Pi+HE5pWni"})}):"upgrade"===y.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:T,children:s.jsx(d,{defaultMessage:"Upgrade",id:"0h/lPMeYkq"})}):"download"===y.ctaMode?s.jsx(h,{variant:"ghost",size:"sm",onClick:W,children:s.jsx(d,{defaultMessage:"Get desktop",id:"87RqeXlPL6"})}):null,s.jsx(h,{variant:"ghost",size:"sm",iconOnly:!0,icon:"X","aria-label":x.formatMessage({defaultMessage:"Dismiss",id:"TDaF6JVgG6"}),onClick:A})]})]}),"schedule"===y.ctaMode?s.jsx(k,{isOpen:F,onClose:()=>I(!1),onCreated:E,existingNames:q,entryPoint:"schedule_upsell_tip",initialValues:H,spaceId:M?.id}):G]})});export{g as ScheduleCoworkTaskTipBand,g as default};
