import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{A_ as s}from"./shared-0-C4kdVF7Y.js";import{Mi as a,ki as d}from"./vendor-frame-CwiylG4Y.js";import{Am as i}from"./shared-1-3-6x7RKF.js";import{io as l,uo as o,xo as n}from"./shared-6-Cf_fMhRZ.js";import{rn as r}from"./vendor-all-2-BJdkbLSj.js";import{rl as t}from"./shared-5-UQAFGbWu.js";import{c,hi as m,r as p}from"./shared-2-CMUBhYOn.js";import{X as u}from"./index-C9LAU4f-.js";import{HandWaveDef as x}from"./cdabaac79-Bn-AgiGo.js";var g=e(a()),_=d(),b=(0,_.jsx)("div",{className:"absolute inset-0 flex items-center justify-center overflow-hidden rounded-[6px] bg-[#F6F5EF] text-[#141413]",children:(0,_.jsx)(t,{asset:x,size:"sm"})}),h={both:null,code:(0,_.jsxs)("div",{"aria-hidden":!0,className:"absolute inset-0 overflow-hidden rounded-[6px] bg-[#F6F5EF]",children:[(0,_.jsx)("img",{src:"/images/clawd/persona/Clawd-Magnifier.gif",alt:"",className:"absolute right-[6px] top-[16px] z-0 w-[62px] max-w-none [image-rendering:pixelated]"}),(0,_.jsxs)("div",{className:"absolute inset-x-[12px] top-[52px] z-10 h-full rounded-t-lg border-[0.5px] border-[#E8E6DC] bg-white px-3 pt-2 shadow-[0_4px_24px_rgba(0,0,0,0.06)]",children:[(0,_.jsxs)("div",{className:"flex gap-[4px]",children:[(0,_.jsx)("span",{className:"size-[6px] rounded-full bg-[#ED6A5E]"}),(0,_.jsx)("span",{className:"size-[6px] rounded-full bg-[#F5BE4F]"}),(0,_.jsx)("span",{className:"size-[6px] rounded-full bg-[#61C454]"})]}),(0,_.jsx)("p",{className:"mt-[9px] font-mono text-[10px] text-[#D97757]",children:"* Contemplating..."})]})]}),cowork:(0,_.jsxs)("div",{"aria-hidden":!0,className:"absolute inset-0 overflow-hidden rounded-[6px] bg-[#F6F5EF]",children:[(0,_.jsx)("img",{src:"/images/cowork/work_priorities.svg",alt:"",className:"absolute left-[10px] top-[4px] w-[84px]"}),(0,_.jsxs)("div",{className:"absolute inset-x-[20px] top-[42px] z-10 rounded-lg border-[0.5px] border-[#E8E6DC] bg-white px-2.5 py-2 shadow-[0_4px_24px_rgba(0,0,0,0.08)]",children:[(0,_.jsx)("p",{className:"text-[10px] leading-snug text-[#141413]",children:"Collect updates and send a weekly summary"}),(0,_.jsx)("p",{className:"mt-[2px] text-[9.5px] text-[#91908A]",children:"Fridays at 5:00 PM"})]})]})},j={shown:"claudeai.gilded_compass_end_user_nudge.shown",dismissed:"claudeai.gilded_compass_end_user_nudge.dismissed",clicked:"claudeai.gilded_compass_end_user_nudge.clicked"},w={both:"6889gw",code:"688w2k",cowork:"jk7x9o"},f={both:"m65quy",code:"m66dgm",cowork:"1wntcs6"},v=(0,g.memo)(({enabled:e,onDismiss:a,onAction:d})=>{const t=r(),x=l(),v=s("gilded_compass_end_user_nudge",null,p),k=v?.admin_nudged_cutoff,y=!!v?.all_eligible_nudge_enabled,F=m("gilded_compass_main"),{data:N}=c(x&&(!!k||y)&&F),[E,D]=(0,g.useState)(null);(0,g.useEffect)(()=>{n().then(e=>D(e))},[]);const[C,z]=(0,g.useState)(!1),{downloadAndOpenModal:A,modal:M}=o("gilded_compass_end_user_nudge",{onClose:()=>{z(!1),d()}}),P=(0,g.useCallback)(e=>{e.preventDefault(),A(E),z(!0)},[E,A]),S=!!N?.admin_nudged_at&&!!k&&Date.parse(N.admin_nudged_at)>=Date.parse(k),T=e&&x&&F&&(S||y)&&!!N&&"eligible"===N.status&&(N.allows_claude_code||N.allows_cowork),V=(0,g.useRef)(null);T&&null===V.current&&(V.current={reason:S?"admin_invite":"all_eligible",variant:N.allows_claude_code&&N.allows_cowork?"both":N.allows_claude_code?"code":"cowork"});const q=V.current?.reason??"all_eligible",B=V.current?.variant??"cowork",H=N?.end_date?t.formatDate(N.end_date,{month:"long",day:"numeric",timeZone:"America/Los_Angeles"}):null;return(0,_.jsxs)(_.Fragment,{children:[T&&!C&&(0,_.jsx)(u,{actionHref:"#",size:"large",openInNewTab:!1,media:"admin_invite"===q?b:h[B]??void 0,imageUrl:"all_eligible"===q&&null===h[B]?"/images/spotlights/gilded-compass-try-nudge.svg":void 0,onDismiss:a,onClick:P,analyticsEvents:j,analyticsProps:{variant:B,nudge_reason:q},variant:"always-visible",title:"admin_invite"===q?(0,_.jsx)(i,{id:"1m6a9my"}):(0,_.jsx)(i,{id:f[B]}),body:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(i,{id:w[B]}),H&&(0,_.jsxs)(_.Fragment,{children:[" ",(0,_.jsx)(i,{id:"4f9k86",dangerouslyVisiblePublicValues:{endDate:H}})]})]}),actionText:(0,_.jsx)(i,{id:"5dr4oy"})}),M]})});export{v as GildedCompassEndUserNudge};