import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Tu as a,Vi as s,bi as i,ts as t}from"./shared-0-C4kdVF7Y.js";import{Mi as l,ki as o}from"./vendor-frame-CwiylG4Y.js";import{Ls as r}from"./shared-1-3-6x7RKF.js";import{uo as n,xo as d}from"./shared-6-Cf_fMhRZ.js";import{nn as c,rn as u}from"./vendor-all-2-BJdkbLSj.js";import{R as m}from"./shared-frame-DbQbH4Yr.js";import{t as p}from"./c97b955f1-D0OcXiKN.js";import{ll as h}from"./shared-4-6CEyRAHb.js";import{Vr as k}from"./shared-5-UQAFGbWu.js";import{vi as f}from"./shared-3-D-Ux4aGn.js";import{_t as g,yt as j}from"./shared-7-VxUxSmVa.js";var v=e(l()),x=o(),_=(0,v.memo)(({conversationUuid:e})=>{const l=i(),o=u(),_=a(),M=h(r(e)?.project_uuid??void 0),y=j(e=>e.tip),C=j(e=>e.dismissed),b=j(e=>e.dismiss),w=j(e=>e.clearIfNotConversation);(0,v.useEffect)(()=>{w(e)},[w,e]);const{scheduledTasks:N}=k("schedule"===y?.ctaMode),F=(0,v.useMemo)(()=>new Set(N.map(f)),[N]),[q,D]=(0,v.useState)(!1),[O,S]=(0,v.useState)(null);(0,v.useEffect)(()=>{d().then(S)},[]);const{downloadAndOpenModal:T,modal:U}=n("schedule_cowork_task_tip"),z=y?.cadenceForAnalytics??"other",G=(0,v.useCallback)(()=>{l.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"schedule",suggested_cadence:z,variant:"tip"}),D(!0)},[l,z]),I=(0,v.useCallback)(()=>{l.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"upgrade",suggested_cadence:z,variant:"tip"}),_.push(g)},[l,z,_]),P=(0,v.useCallback)(()=>{l.track({event_key:"claudeai.schedule_cowork_task.cta_clicked",action:"get_desktop",suggested_cadence:z,variant:"tip"}),T(O)},[l,z,T,O]),V=(0,v.useCallback)(()=>{l.track({event_key:"claudeai.schedule_cowork_task.dismissed",variant:"tip"}),b(e)},[l,b,e]),W=(0,v.useCallback)(e=>{_.push(`${t}/${encodeURIComponent(e.id)}`)},[_]),A=(0,v.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!==e||C.has(e)?null:(0,x.jsxs)(x.Fragment,{children:[(0,x.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:[(0,x.jsx)(s,{variant:"neutral",icon:"Calendar",className:"shrink-0",children:(0,x.jsx)(c,{defaultMessage:"Tip",id:"4j1TGZubAJ"})}),(0,x.jsx)("span",{className:"text-caption text-primary line-clamp-2 min-w-0 flex-1 leading-4",children:(0,x.jsx)(c,{defaultMessage:"Want this every morning? Claude can run it on a schedule.",id:"IfGbKXDlq/"})}),(0,x.jsxs)("div",{className:"flex shrink-0 items-center gap-xs",children:["schedule"===y.ctaMode?(0,x.jsx)(m,{variant:"ghost",size:"sm",onClick:G,children:(0,x.jsx)(c,{defaultMessage:"Schedule it",id:"Pi+HE5pWni"})}):"upgrade"===y.ctaMode?(0,x.jsx)(m,{variant:"ghost",size:"sm",onClick:I,children:(0,x.jsx)(c,{defaultMessage:"Upgrade",id:"0h/lPMeYkq"})}):"download"===y.ctaMode?(0,x.jsx)(m,{variant:"ghost",size:"sm",onClick:P,children:(0,x.jsx)(c,{defaultMessage:"Get desktop",id:"87RqeXlPL6"})}):null,(0,x.jsx)(m,{variant:"ghost",size:"sm",iconOnly:!0,icon:"X","aria-label":o.formatMessage({defaultMessage:"Dismiss",id:"TDaF6JVgG6"}),onClick:V})]})]}),"schedule"===y.ctaMode?(0,x.jsx)(p,{isOpen:q,onClose:()=>D(!1),onCreated:W,existingNames:F,entryPoint:"schedule_upsell_tip",initialValues:A,spaceId:M?.id}):U]})});export{_ as ScheduleCoworkTaskTipBand,_ as default};