import{r as e,j as s}from"./vendor-react-DcxrbCFs.js";import{A as a,q as i,E as t,F as o,e as n}from"./c4b350ac1-BTR_0NaM.js";import{u as r,M as d}from"./vendor-intl-C0z7gCkr.js";import{U as c}from"./c97b955f1-Bo6zwATb.js";import{a as l,b as u,S as m}from"./c40b9b8f5-Da-ryo1W.js";import{h as p,B as k}from"./vendor-ant-cds-BOj-tX6j.js";import"./vendor-base-ui-dYhdtXSh.js";import"./vendor-radix-BZeqcGXH.js";import"./vendor-zod-Zyr3BDtu.js";import"./vendor-zustand-BLLlCrLG.js";import"./vendor-icons-ChFdOXlJ.js";import"./vendor-lodash--OmUGVwS.js";import"./vendor-router-DD4soP8u.js";import"./vendor-query-DdY22HAU.js";import"./vendor-luxon-Y8l99kBI.js";import"./vendor-infra-DayZK7Ds.js";import"./vendor-motion-HFQQEH7Z.js";import"./vendor-growthbook-Bq25eETo.js";import"./cc2095605-CrpUsyXQ.js";import"./c4fba3bc0-VDbKK-N0.js";import"./c1f96d614-DAkctE43.js";import"./c4b43b0ae-760Yu4sg.js";import"./vendor-virtual-sigx4wjL.js";const h=e.memo(({conversationUuid:h})=>{const j=a(),v=r(),f=i(),g=l(e=>e.tip),x=l(e=>e.dismissed),_=l(e=>e.dismiss),b=l(e=>e.clearIfNotConversation);e.useEffect(()=>{b(h)},[b,h]);const{scheduledTasks:M}=u("schedule"===g?.ctaMode),y=e.useMemo(()=>new Set(M.map(e=>e.displayName??e.id)),[M]),[C,w]=e.useState(!1),[N,q]=e.useState(null);e.useEffect(()=>{t().then(q)},[]);const{downloadAndOpenModal:F,modal:S}=o("schedule_cowork_task_tip"),z=g?.cadenceForAnalytics??"other",T=e.useCallback(()=>{j.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"schedule",suggested_cadence:z,variant:"tip"}),w(!0)},[j,z]),D=e.useCallback(()=>{j.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"upgrade",suggested_cadence:z,variant:"tip"}),f.push(m)},[j,z,f]),O=e.useCallback(()=>{j.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"get_desktop",suggested_cadence:z,variant:"tip"}),F(N)},[j,z,F,N]),U=e.useCallback(()=>{j.track({event_key:"claudeai.schedule_cowork_task.dismissed",variant:"tip"}),_(h)},[j,_,h]),A=e.useCallback(e=>{f.push(`${n}/${encodeURIComponent(e.id)}`)},[f]),E=e.useMemo(()=>g?{prompt:g.prompt||void 0,isModelSuggested:!0,name:g.initialName,localNameFallback:g.localNameFallback,description:g.initialDescription,frequency:g.initialFrequency,hour:g.initialHour,minute:g.initialMinute,dayOfWeek:g.initialDayOfWeek}:void 0,[g]);return!g||g.conversationUuid!==h||x.has(h)?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(p,{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"===g.ctaMode?s.jsx(k,{variant:"ghost",size:"sm",onClick:T,children:s.jsx(d,{defaultMessage:"Schedule it",id:"Pi+HE5pWni"})}):"upgrade"===g.ctaMode?s.jsx(k,{variant:"ghost",size:"sm",onClick:D,children:s.jsx(d,{defaultMessage:"Upgrade",id:"0h/lPMeYkq"})}):"download"===g.ctaMode?s.jsx(k,{variant:"ghost",size:"sm",onClick:O,children:s.jsx(d,{defaultMessage:"Get desktop",id:"87RqeXlPL6"})}):null,s.jsx(k,{variant:"ghost",size:"sm",iconOnly:!0,icon:"X","aria-label":v.formatMessage({defaultMessage:"Dismiss",id:"TDaF6JVgG6"}),onClick:U})]})]}),"schedule"===g.ctaMode?s.jsx(c,{isOpen:C,onClose:()=>w(!1),onCreated:A,existingNames:y,entryPoint:"schedule_upsell_tip",initialValues:E}):S]})});h.displayName="ScheduleCoworkTaskTipBand";export{h as ScheduleCoworkTaskTipBand,h as default};
