PageSourceSearch

https://thetool.company/_next/static/chunks/3ubdt0wzjlbb7.js

js thetool.company collected 2026-10-02 01:53:50 UTC 53,727 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,474911,795465,e=>{"use strict";var t=e.i(843476),n=e.i(494913),a=e.i(21218),r=e.i(342920),l=e.i(788699),s=e.i(178583),o=e.i(514764),i=e.i(263488),c=e.i(406321),c=c,d=e.i(283086),u=e.i(221345),m=e.i(440160),x=e.i(373884),h=e.i(286536),p=e.i(191741),f=e.i(656272),g=e.i(194983),b=e.i(826707),v=e.i(343432),y=e.i(514052),j=e.i(117697),w=e.i(955716),N=e.i(551804),k=e.i(551348),_=e.i(852008),C=e.i(63804),S=e.i(82735),E=e.i(805899),T=e.i(248256),M=e.i(341256),R=e.i(459648),D=e.i(773993),P=e.i(264325);let L={name:"Name",email:"Email",phone:"Phone",job_title:"Job title",company_id:"Company",status:"Status",location:"Location",headline:"Headline",linkedin_url:"LinkedIn URL",notes:"Notes",domain:"Domain",industry:"Industry",headquarters:"Headquarters",employee_range:"Employee range",website_url:"Website",assigned_to:"Assigned to",contact_id:"Primary contact",title:"Title",description:"Description",target_date:"Target date",due_at:"Due date",color:"Color",icon:"Icon",icon_color:"Icon color",priority:"Priority",kind:"Type",visibility:"Visibility",cover_image_url:"Cover image",intro_video_url:"Intro video",accent_color:"Accent color",customer_company_name:"Customer company",deal_id:"Linked deal",slack_channel_id:"Slack channel",slack_channel_name:"Slack channel",assignee_user_id:"Assignee",assignee_contact_id:"Assignee"};function I(e){return L[e]||e.replace(/_/g," ")}let A={record_created:{label:"Record created",icon:R.AddPersonIcon,color:"text-green-500"},field_updated:{label:"Field updated",icon:l.Pencil,color:"text-blue-500"},document_linked:{label:"Document linked",icon:s.FileText,color:"text-muted-foreground"},document_sent:{label:"Document sent",icon:o.Send,color:"text-muted-foreground"},document_signed:{label:"Document signed",icon:c.default,color:"text-green-500"},document_completed:{label:"Document completed",icon:c.default,color:"text-green-600"},document_viewed:{label:"Document viewed",icon:h.Eye,color:"text-muted-foreground"},document_downloaded:{label:"Downloaded document",icon:m.Download,color:"text-muted-foreground"},document_cancelled:{label:"Document cancelled",icon:x.XCircle,color:"text-red-500"},email_verified:{label:"Email verified",icon:i.Mail,color:"text-blue-500"},email_enriched:{label:"Email enriched",icon:d.Sparkles,color:"text-purple-500"},linkedin_enriched:{label:"LinkedIn data enriched",icon:u.Link,color:"text-blue-600"},status_changed:{label:"Status changed",icon:d.Sparkles,color:"text-amber-500"},company_linked:{label:"Company linked",icon:r.Building,color:"text-muted-foreground"},assigned_to_changed:{label:"Assigned to changed",icon:P.PersonCheckIcon,color:"text-muted-foreground"},note_updated:{label:"Notes updated",icon:l.Pencil,color:"text-muted-foreground"},custom_field_updated:{label:"Custom field updated",icon:l.Pencil,color:"text-muted-foreground"},task_assigned:{label:"Task assigned",icon:p.ClipboardList,color:"text-blue-500"},task_completed:{label:"Task completed",icon:f.CheckSquare,color:"text-green-500"},task_auto_completed:{label:"Task cleared by reply",icon:f.CheckSquare,color:"text-green-500"},email_sent:{label:"Email sent",icon:i.Mail,color:"text-blue-500"},email_received:{label:"Email received",icon:i.Mail,color:"text-green-500"},scheduled_email_sent:{label:"Scheduled email sent",icon:i.Mail,color:"text-blue-400"},linkedin_message_sent:{label:"LinkedIn message sent",icon:k.Linkedin,color:"text-blue-600"},linkedin_connect_sent:{label:"Connection request sent",icon:k.Linkedin,color:"text-blue-600"},linkedin_connect_accepted:{label:"Connection accepted",icon:k.Linkedin,color:"text-green-600"},whatsapp_sent:{label:"WhatsApp message sent",icon:g.MessageCircle,color:"text-green-500"},sms_sent:{label:"SMS sent",icon:b.Smartphone,color:"text-purple-500"},call_initiated:{label:"Call initiated",icon:v.Phone,color:"text-blue-500"},call_completed:{label:"Call completed",icon:y.PhoneOff,color:"text-muted-foreground"},sequence_enrolled:{label:"Added to sequence",icon:j.PlayCircle,color:"text-indigo-500"},sequence_step_executed:{label:"Sequence step executed",icon:w.GitBranch,color:"text-indigo-400"},sequence_completed:{label:"Sequence completed",icon:c.default,color:"text-green-500"},meeting_booked:{label:"Meeting booked",icon:N.CalendarCheck,color:"text-amber-500"},plan_created:{label:"Plan created",icon:E.Flag,color:"text-green-500"},plan_status_changed:{label:"Plan status changed",icon:d.Sparkles,color:"text-amber-500"},plan_invited:{label:"Invite sent",icon:o.Send,color:"text-blue-500"},plan_viewed:{label:"Viewed plan",icon:h.Eye,color:"text-indigo-500"},plan_revisited:{label:"Revisited plan",icon:h.Eye,color:"text-indigo-400"},stage_created:{label:"Stage added",icon:_.Layers,color:"text-blue-500"},stage_updated:{label:"Stage updated",icon:l.Pencil,color:"text-muted-foreground"}
1,stage_deleted:{label:"Stage removed",icon:M.TrashIcon,color:"text-red-500"},step_created:{label:"Step added",icon:C.ListChecks,color:"text-blue-500"},step_updated:{label:"Step updated",icon:l.Pencil,color:"text-muted-foreground"},step_deleted:{label:"Step removed",icon:M.TrashIcon,color:"text-red-500"},task_created:{label:"Task added",icon:p.ClipboardList,color:"text-blue-500"},task_updated:{label:"Task updated",icon:l.Pencil,color:"text-muted-foreground"},task_deleted:{label:"Task removed",icon:M.TrashIcon,color:"text-red-500"},asset_added:{label:"Asset added",icon:S.Paperclip,color:"text-blue-500"},asset_removed:{label:"Asset removed",icon:M.TrashIcon,color:"text-red-500"},website_visit:{label:"Visited website",icon:T.Globe,color:"text-cyan-500"},website_identified:{label:"Identified on website",icon:D.PeopleIcon,color:"text-emerald-500"}};e.s(["ACTIVITY_ACTION_CONFIG",0,A,"getFieldLabel",0,I],795465);var z=e.i(402370),U=e.i(210578),B=e.i(428605);function F({log:e}){let r=A[e.action]??{label:e.action.replace(/_/g," "),icon:a.Activity,color:"text-muted-foreground"},l=r.icon,s=e.actor?.full_name??null,o=e.visitor?.name||e.visitor?.email||null,i=s??o,c=!s&&!!e.visitor,d=e.metadata?._contact_name,u=e.metadata?._contact_image_url;return(0,t.jsxs)("div",{className:"flex gap-3 py-2 relative",children:[(0,t.jsxs)("div",{className:"relative shrink-0 z-10",children:[i?(0,t.jsx)(U.ContactAvatar,{imageUrl:c?null:e.actor?.avatar_url,name:i,size:"sm"}):(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center squircle bg-muted",children:(0,t.jsx)(l,{className:`h-4 w-4 ${r.color}`})}),i&&(0,t.jsx)("div",{className:"absolute -bottom-0.5 -right-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-background border border-border",children:(0,t.jsx)(l,{className:`h-2.5 w-2.5 ${r.color}`})})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,t.jsxs)("span",{className:"text-sm",children:[i&&(0,t.jsx)("span",{className:"font-semibold",children:i}),c&&(0,t.jsx)("span",{className:"ml-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"guest"}),i&&(0,t.jsx)("span",{className:"text-muted-foreground",children:" · "}),(0,t.jsx)("span",{className:"font-medium",children:r.label})]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,n.formatDistanceToNow)(new Date(e.created_at),{addSuffix:!0})})]}),d&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)(U.ContactAvatar,{imageUrl:u,name:d,size:"xs"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:d})]}),(0,t.jsx)(q,{log:e})]})]})}function q({log:e}){let n=e.metadata;if(!n)return null;if("field_updated"===e.action&&n.changes){let e=Object.entries(n.changes);return 0===e.length?null:(0,t.jsx)("div",{className:"mt-1 space-y-0.5",children:e.map(([e,n])=>(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium text-foreground/70",children:I(e)}),": ",n.from?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"line-through opacity-60",children:$(n.from)})," → "]}):"set to ",(0,t.jsx)("span",{children:n.to?$(n.to):(0,t.jsx)("span",{className:"italic",children:"cleared"})})]},e))})}if("record_created"===e.action&&n.name)return(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:n.name});if(n.document_title)return(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:n.document_title});if(n.email)return(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:[n.email,n.status?` - ${String(n.status)}`:null]});if("task_auto_completed"===e.action&&n.task_title)return(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:[n.task_title," — ",(0,z.describeAutoComplete)(String(n.channel))]});if(("task_assigned"===e.action||"task_completed"===e.action)&&n.task_title)return(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:n.task_title});if("email_sent"===e.action||"email_received"===e.action||"scheduled_email_sent"===e.action){let e=n.subject,a=n.to,r=n.from;return(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e?(0,t.jsx)("span",{className:"font-medium text-foreground
1/70",children:$(e)}):null,a?(0,t.jsxs)("span",{className:"block",children:["To: ",$(a,80)]}):null,r?(0,t.jsxs)("span",{className:"block",children:["From: ",$(r,80)]}):null]})}if("linkedin_message_sent"===e.action||"whatsapp_sent"===e.action||"sms_sent"===e.action){let e=n.message_preview,a=n.phone;return(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e?(0,t.jsxs)("span",{children:["“",$(e),"”"]}):null,a?(0,t.jsx)("span",{className:"block",children:a}):null]})}if("linkedin_connect_sent"===e.action){let e=n.profile_name;return(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e?`To ${e}`:"Connection request sent"})}if("call_initiated"===e.action||"call_completed"===e.action){let e=n.to_number,a=n.duration,r=n.disposition;return(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e?(0,t.jsx)("span",{children:e}):null,a?(0,t.jsxs)("span",{className:"ml-1",children:["(",a,")"]}):null,r?(0,t.jsxs)("span",{className:"ml-1",children:["— ",r]}):null]})}if("sequence_enrolled"===e.action||"sequence_step_executed"===e.action||"sequence_completed"===e.action){let e=n.sequence_name,a=n.step_type;return(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e?(0,t.jsx)("span",{className:"font-medium text-foreground/70",children:e}):null,a?(0,t.jsxs)("span",{className:"block",children:["Step: ",a.replace(/_/g," ")]}):null]})}if("meeting_booked"===e.action){let e=n.meeting_title;if(e)return(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e})}if("website_visit"===e.action){let e=n.landing_path||"/",a=n.referrer,r=n.utm_campaign,l="";if(a)try{l=new URL(a).hostname.replace(/^www\./,"")}catch{l=""}return(0,t.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-mono",children:$(e,60)}),l?(0,t.jsxs)(t.Fragment,{children:[" · from ",l]}):null,r?(0,t.jsxs)(t.Fragment,{children:[" · utm: ",r]}):null]})}if("website_identified"===e.action){let e=n.email,a=n.prior_pageview_count;return(0,t.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[e?(0,t.jsx)("span",{className:"font-medium text-foreground/70",children:e}):null,a?(0,t.jsxs)(t.Fragment,{children:[" · stitched ",a," prior pageview",1===a?"":"s"]}):null]})}return null}function $(e,t=60){let n=(0,B.decodeHtmlEntities)(e);return n.length<=t?n:n.slice(0,t)+"…"}e.s(["ActivityRow",0,F,"ActivityTimeline",0,function({logs:e}){return 0===e.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,t.jsx)(a.Activity,{className:"h-8 w-8 mb-2 opacity-40"}),(0,t.jsx)("p",{className:"text-sm",children:"No activity yet."})]}):(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute left-[15px] top-4 bottom-4 w-px bg-muted-foreground/25"}),(0,t.jsx)("div",{className:"space-y-1",children:e.map(e=>(0,t.jsx)(F,{log:e},e.id))})]})}],474911)},606530,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(401851),r=e.i(980797),l=e.i(383482),s=e.i(647163);function o({src:e,name:a}){let[r,l]=(0,n.useState)(null),s=!!e&&r===e;return!e||s?(0,t.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center squircle avatar-border bg-muted text-[8px] font-medium text-muted-foreground",children:(a||"?")[0]}):(0,t.jsx)("img",{src:e,alt:"",onError:()=>l(e),referrerPolicy:"no-referrer",className:"h-4 w-4 shrink-0 squircle avatar-border object-cover"})}e.s(["QuotedReply",0,function({name:e,text:n,avatarUrl:i,timestamp:c,onClick:d,className:u}){let m,x=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(o,{src:i,name:e}),(0,t.jsx)("span",{className:"truncate text-[12px] font-semibold text-foreground",children:e})]}),(0,t.jsx)("p",{className:"mt-0.5 line-clamp-2 text-[12px] leading-snug text-foreground/80",children:n}),c&&(0,t.jsx)("span",{className:"mt-0.5 block text-[11px] text-muted-foreground",children:(m=(0,r.isToday)(c)?"Today":(0,l.isYesterday)(c)?"Yesterday":(0,a.format)(c,"MMM d"),`${m} at ${(0,a.format)(c,"h:mm a")}`)})]}
1),h="mb-1 w-full border-l-2 border-foreground/[0.14] pl-2.5 text-left";return d?(0,t.jsx)("button",{type:"button",onClick:d,title:"Go to message",className:(0,s.cn)(h,"cursor-pointer transition-colors hover:border-foreground/30",u),children:x}):(0,t.jsx)("div",{className:(0,s.cn)(h,u),children:x})}])},841074,344984,503738,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(643531),r=e.i(844700),l=e.i(920755),s=e.i(705599),o=e.i(916371),i=e.i(494913),c=e.i(541071),d=e.i(367240),u=e.i(788699),m=e.i(903659),x=e.i(993899),h=e.i(167881),p=e.i(463415),f=e.i(63270),g=e.i(846696),b=e.i(101380),v=e.i(740043);function y({body:e,variant:a="inline"}){let r=(0,b.tokenizeBody)(e);return(0,t.jsx)("div",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:r.map((e,r)=>"mention"===e.kind?(0,t.jsx)(v.MentionPill,{type:e.entity_type,id:e.entity_id,name:e.display_name,variant:a},r):(0,t.jsx)(n.Fragment,{children:e.value},r))})}e.s(["CommentBody",0,y],344984);var j=e.i(178583),w=e.i(37727),N=e.i(761691),k=e.i(609216);function _({attachments:e}){let[a,r]=(0,n.useState)(null);return 0===e.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>{let n=e.mime_type.startsWith("image/"),a=e.mime_type.startsWith("video/");return n?(0,t.jsx)("button",{type:"button",onClick:()=>r(e),className:"block focus:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded-lg",children:(0,t.jsx)("img",{src:e.url,alt:e.name,className:"max-h-48 max-w-[16rem] rounded-lg border object-cover hover:opacity-90 transition-opacity"})},e.id):a?(0,t.jsx)(k.VideoPlayer,{src:e.url,className:"rounded-lg border",videoClassName:"max-h-48 max-w-[16rem]"},e.id):(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-lg border bg-muted/40 px-2.5 py-1.5 text-xs hover:bg-muted transition-colors max-w-[14rem]",children:[(0,N.isPdfFile)(e.mime_type,e.name)?(0,t.jsx)(N.PdfIcon,{className:"h-3.5 w-3.5 shrink-0"}):(0,t.jsx)(j.FileText,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:e.name||"Attachment"})]},e.id)})}),a&&(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-sm",onClick:()=>r(null),children:[(0,t.jsx)("button",{type:"button",onClick:()=>r(null),className:"absolute top-4 right-4 h-9 w-9 flex items-center justify-center rounded-full bg-white/10 backdrop-blur-md text-white hover:bg-white/20 transition-colors z-10",children:(0,t.jsx)(w.X,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"max-w-[90vw] max-h-[85vh]",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("img",{src:a.url,alt:a.name,className:"max-w-full max-h-[85vh] object-contain rounded-xl"}),a.name&&(0,t.jsx)("p",{className:"text-center text-white/60 text-xs mt-2 truncate",children:a.name})]})]})]})}var C=e.i(341256);function S(e){return e&&((e.full_name||e.email).match(/\b\w/g)||[]).slice(0,2).join("").toUpperCase()||"?"}function E(e){return e?e.full_name||e.email:"Unknown"}function T({comment:e,replies:l,authors:s,attachmentsByComment:v,currentUserId:j,isReply:w,variant:N="default",showConnector:k=!1,onReply:M,onUpdate:R,onDelete:D}
1){let P=s[e.owner_id],L=j===e.owner_id,[I,A]=(0,n.useState)(!1),[z,U]=(0,n.useState)(!1),[B,F]=(0,n.useState)(!1),[q,$]=(0,n.useState)(!1),[O,W]=(0,n.useState)([]),X=!!e.resolved_at,H=v[e.id]??[];return z?(0,t.jsx)("div",{className:X?"opacity-60":"",children:(0,t.jsx)(o.CommentComposer,{autoFocus:!0,submitLabel:"Save",placeholder:"Edit comment",initialText:(0,b.parseStoredBody)(e.body).text,initialMentions:(0,b.parseStoredBody)(e.body).mentions,initialAttachments:(H??[]).map(e=>({url:e.url,mime_type:e.mime_type,name:e.name,size_bytes:e.size_bytes,width:e.width,height:e.height})),onCancel:()=>U(!1),onSubmit:async({body:t,mentions:n,attachments:a})=>{await R(e.id,{body:t,mentions:n,attachments:a}),U(!1)}})}):"compact"===N?(0,t.jsxs)("li",{className:"group/comment relative flex gap-2.5 text-sm",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center shrink-0",children:[(0,t.jsxs)(f.Avatar,{className:"h-6 w-6",children:[P?.avatar_url&&(0,t.jsx)(f.AvatarImage,{src:P.avatar_url,alt:E(P)}),(0,t.jsx)(f.AvatarFallback,{className:"text-[10px]",children:S(P)})]}),k&&(0,t.jsx)("div",{className:"w-px flex-1 bg-border/60 mt-1"})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 pb-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 h-6",children:[(0,t.jsx)("span",{className:"text-sm font-semibold leading-none",children:E(P)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-none",children:function(e){let t=Math.floor((Date.now()-e.getTime())/1e3);if(t<60)return`${Math.max(t,1)}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let a=Math.floor(n/60);if(a<24)return`${a}h`;let r=Math.floor(a/24);if(r<7)return`${r}d`;let l=Math.floor(r/7);if(l<5)return`${l}w`;let s=Math.floor(r/30);return s<12?`${s}mo`:`${Math.floor(r/365)}y`}(new Date(e.created_at))}),e.updated_at!==e.created_at&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/70 leading-none",children:"(edited)"})]}),(0,t.jsxs)("div",{className:"mt-1",children:[e.body.trim().length>0&&(0,t.jsx)(y,{body:e.body}),H.length>0&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(_,{attachments:H})}),O.length>0&&(0,t.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:O.map((e,n)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-xs",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:"1"})]},`${e}-${n}`))})]})]}),(0,t.jsxs)("div",{className:"absolute right-0 -top-2 z-10 flex items-center gap-0.5 rounded-md border border-border/60 bg-white dark:bg-card p-0.5 shadow-sm opacity-0 pointer-events-none transition-opacity group-hover/comment:opacity-100 group-hover/comment:pointer-events-auto has-[[data-state=open]]:opacity-100 has-[[data-state=open]]:pointer-events-auto",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("button",{type:"button",onClick:()=>$(e=>!e),className:"h-6 w-6 inline-flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted rounded","aria-label":"Add reaction",title:"Add reaction",children:(0,t.jsx)(m.SmilePlus,{className:"h-3.5 w-3.5"})}),q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[199]",onClick:()=>$(!1)}),(0,t.jsx)("div",{ref:e=>{if(!e)return;let t=e.getBoundingClientRect();t.right>window.innerWidth-8&&(e.style.left="auto",e.style.right="0"),t.bottom>window.innerHeight-8&&(e.style.top="auto",e.style.bottom="100%",e.style.marginTop="0",e.style.marginBottom="4px")},className:"absolute top-full left-0 mt-1 z-[200]",children:(0,t.jsx)(x.EmojiPicker,{onSelect:e=>{W(t=>[...t,e]),$(!1)},onClose:()=>$(!1)})})]})]}),L&&(0,t.jsxs)(p.DropdownMenu,{children:[(0,t.jsx)(p.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"h-6 w-6 inline-flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted rounded","aria-label":"More actions",children:(0,t.jsx)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})})}),(0,t.jsxs)(p.DropdownMenuContent,{align:"end",sideOffset:4,collisionPadding:8,children:[(0,t.jsxs)(p.DropdownMenuItem,{onClick:()=>U(!0),children:[(0,t.jsx)(u.Pencil,{className:"!h-3.5 !w-3.5"}),"Edit"]}),(0,t.jsxs)(p.DropdownMenuItem,{onClick:()=>F(!0),className:"text-destructive focus:text-destructive",children:[(0,t.jsx)(C.TrashIcon,{className:"!h-3.5 !w-3.5"}),"Delete"]})]})]})]}),B&&(0,t.jsxs)("div",{className:"absolute right-0 top-7 z-20 flex items-center gap-2 rounded-lg border bg-background shadow-md px-3 py-2 text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Delete?"}),(0,t.jsx)(h.Button,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(h.Button,{variant:"destructive",size:"sm",className:"h-6 px-2 text-xs",onClick:async()=>{try{await D(e.id)}catch(e){g.toast.error(e instanceof Error?e.message:"Failed to delete")}F(!1)},children:"Delete"})]})]}):(0,t.jsxs)("div",{className:X?"opacity-60":"",children:[(0,t.jsx)("div",{className:"rounded-2xl border border-card-border bg-light-oat dark:bg-black p-3 hover:border-foreground
1/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)(f.Avatar,{className:"h-8 w-8 shrink-0",children:[P?.avatar_url&&(0,t.jsx)(f.AvatarImage,{src:P.avatar_url,alt:E(P)}),(0,t.jsx)(f.AvatarFallback,{children:S(P)})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"font-medium truncate",children:E(P)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,i.formatDistanceToNow)(new Date(e.created_at),{addSuffix:!0})}),e.updated_at!==e.created_at&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground/70",children:"(edited)"}),X&&(0,t.jsxs)("span",{className:"ml-1 inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-success",children:[(0,t.jsx)(a.Check,{className:"h-3 w-3"})," Resolved"]})]}),e.body.trim().length>0&&(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)(y,{body:e.body})}),H.length>0&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(_,{attachments:H})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[!w&&M&&(0,t.jsxs)(h.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground hover:bg-accent",onClick:()=>A(e=>!e),children:[(0,t.jsx)(r.ChatBubbleIcon,{className:"!h-3.5 !w-3.5"}),"Reply"]}),!w&&(0,t.jsx)(h.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-muted-foreground hover:text-foreground hover:bg-accent",onClick:()=>R(e.id,{resolved:!X}).catch(e=>g.toast.error(e instanceof Error?e.message:"Failed")),children:X?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.RotateCcw,{className:"!h-3.5 !w-3.5"}),"Reopen"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Check,{className:"!h-3.5 !w-3.5"}),"Resolve"]})})]}),L&&(0,t.jsxs)(p.DropdownMenu,{children:[(0,t.jsx)(p.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:"h-7 w-7 flex items-center justify-center squircle text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:(0,t.jsx)(c.MoreHorizontal,{className:"h-4 w-4"})})}),(0,t.jsxs)(p.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(p.DropdownMenuItem,{onClick:()=>U(!0),children:[(0,t.jsx)(u.Pencil,{className:"!h-3.5 !w-3.5"}),"Edit"]}),(0,t.jsxs)(p.DropdownMenuItem,{onClick:()=>F(!0),className:"text-destructive focus:text-destructive",children:[(0,t.jsx)(C.TrashIcon,{className:"!h-3.5 !w-3.5"}),"Delete"]})]})]})]})]})]})}),B&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Delete this comment?"}),(0,t.jsx)(h.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(h.Button,{variant:"destructive",size:"sm",className:"h-7 px-2 text-xs",onClick:async()=>{try{await D(e.id)}catch(e){g.toast.error(e instanceof Error?e.message:"Failed to delete")}F(!1)},children:"Delete"})]}),l.length>0&&(0,t.jsx)("div",{className:"mt-3 space-y-3 border-l-2 border-border/60 pl-4",children:l.map(e=>(0,t.jsx)(T,{comment:e,replies:[],authors:s,attachmentsByComment:v,currentUserId:j,isReply:!0,onUpdate:R,onDelete:D},e.id))}),I&&M&&(0,t.jsx)("div",{className:"mt-3 pl-4 border-l-2 border-border/60",children:(0,t.jsx)(o.CommentComposer,{autoFocus:!0,submitLabel:"Reply",placeholder:"Reply to this thread… use @ to mention someone",onCancel:()=>A(!1),onSubmit:async({body:e,mentions:t,attachments:n})=>{await M({body:e,mentions:t,attachments:n}),A(!1)}})})]})}e.s(["CommentItem",0,T],503738);let M=[{value:"open",label:"Open"},{value:"resolved",label:"Resolved"},{value:"all",label:"All"}];e.s(["CommentsSection",0,function({entityType:e,entityId:i,hideEmpty:c=!1,variant:d="default",headerLabel:u}){let{comments:m,authors:x,attachmentsByComment:h,loading:p,error:f,createComment:g,updateComment:b,deleteComment:v}
1=(0,s.useComments)(e,i),[y,j]=(0,n.useState)(null),[w,N]=(0,n.useState)("open");(0,n.useEffect)(()=>{let e=!1;return(async()=>{let t=(0,l.createClient)(),{data:{user:n}}=await t.auth.getUser();e||j(n?.id??null)})(),()=>{e=!0}},[]);let k=(0,n.useMemo)(()=>{let e=m.filter(e=>!e.parent_comment_id),t=new Map;for(let e of m){if(!e.parent_comment_id)continue;let n=t.get(e.parent_comment_id)??[];n.push(e),t.set(e.parent_comment_id,n)}return e.slice().sort((e,t)=>t.created_at<e.created_at?-1:1).map(e=>({comment:e,replies:(t.get(e.id)??[]).slice().sort((e,t)=>e.created_at<t.created_at?-1:1)}))},[m]),_=(0,n.useMemo)(()=>"all"===w?k:"resolved"===w?k.filter(e=>!!e.comment.resolved_at):k.filter(e=>!e.comment.resolved_at),[k,w]),C=(0,n.useMemo)(()=>{let e=0,t=0;for(let n of k)n.comment.resolved_at?t+=1:e+=1;return{open:e,resolved:t,all:k.length}},[k]);if("compact"===d){let e=m.filter(e=>!e.resolved_at).slice().sort((e,t)=>e.created_at<t.created_at?-1:1);return(0,t.jsxs)("div",{className:"group/thread space-y-3",children:[u&&(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4 min-h-[1.25rem]",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:u}),e.length>0&&(0,t.jsxs)("button",{type:"button",onClick:async()=>{for(let t of e)await b(t.id,{resolved:!0})},className:"inline-flex items-center gap-1 rounded-md px-2 h-6 text-xs text-muted-foreground opacity-0 transition-opacity hover:text-foreground hover:bg-muted group-hover/thread:opacity-100","aria-label":"Resolve thread",title:"Resolve thread",children:[(0,t.jsx)(a.Check,{className:"h-3.5 w-3.5"}),"Resolve"]})]}),e.length>0&&(0,t.jsx)("ul",{className:"space-y-0",children:e.map((n,a)=>(0,t.jsx)(T,{comment:n,replies:[],authors:x,attachmentsByComment:h,currentUserId:y,variant:"compact",showConnector:a<e.length-1,onUpdate:b,onDelete:v},n.id))}),(0,t.jsx)(o.CommentComposer,{onSubmit:async({body:e,mentions:t,attachments:n})=>{await g({body:e,mentions:t,attachments:n})}})]})}return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsx)(o.CommentComposer,{onSubmit:async({body:e,mentions:t,attachments:n})=>{await g({body:e,mentions:t,attachments:n})}}),k.length>0&&(0,t.jsx)("div",{className:"flex items-center gap-1 text-xs",children:M.map(e=>{let n=C[e.value],a=w===e.value;return(0,t.jsxs)("button",{type:"button",onClick:()=>N(e.value),className:"rounded-full px-3 py-1 transition-colors "+(a?"bg-foreground text-background":"bg-muted/50 text-muted-foreground hover:bg-muted"),children:[e.label,(0,t.jsx)("span",{className:"ml-1.5 text-[10px] opacity-70",children:n})]},e.value)})}),f&&(0,t.jsx)("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:f}),p?(0,t.jsx)("div",{className:"space-y-4",children:[0,1,2].map(e=>(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("div",{className:"h-8 w-8 shrink-0 rounded-full bg-muted animate-pulse"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsx)("div",{className:"h-3 w-32 rounded bg-muted animate-pulse"}),(0,t.jsx)("div",{className:"h-3 w-full rounded bg-muted animate-pulse"}),(0,t.jsx)("div",{className:"h-3 w-2/3 rounded bg-muted animate-pulse"})]})]},e))}):0===_.length?c?null:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 rounded-2xl border border-dashed py-10 text-center",children:[(0,t.jsx)("div",{className:"rounded-full bg-muted/60 p-2.5",children:(0,t.jsx)(r.ChatBubbleIcon,{className:"h-4 w-4 text-muted-foreground"})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:0===k.length?"No comments yet - start the conversation above.":"open"===w?"No open comments.":"No resolved comments."})]}):(0,t.jsx)("div",{className:"space-y-6",children:_.map(e=>(0,t.jsx)(T,{comment:e.comment,replies:e.replies,authors:x,attachmentsByComment:h,currentUserId:y,onReply:async({body:t,mentions:n,attachments:a})=>{await g({body:t,mentions:n,attachments:a,parentCommentId:e.comment.id})},onUpdate:b,onDelete:v},e.comment.id))})]})}],841074)},740043,e=>{"use strict";var t=e.i(843476),n=e.i(522016),a=e.i(271645),r=e.i(149685),l=e.i(839124),s=e.i(620278),o=e.i(213788),i=e.i(210578),c=e.i(290593),d=e.i(920755),u=e.i(647163),m=e.i(783618);let x={user:()=>null,contact:e=>`/people/${e}`,company:e=>`/companies/${e}`,deal:e=>`/deals/${e}`,goal:()=>"/goals",plan:e=>`/plans/${e}`,plan_task:()=>null,visitor:()=>null},h=new Map,p=new Map;async function f(e,t){let n=`${e}:${t}`,a=h.get(n);if(a)return a;let r=p.get(n);if(r)return r;let l=(async()=>{let a=(0,d.createClient)(),r=null,l=null;try{if("user"===e){let{data:e}=await a.from("profiles").select("avatar_url").eq("id",t).maybeSingle();r=e?.avatar_url??null}else if("contact"===e){let{data:e}=await a.from("contacts").select("image_url").eq("id",t).maybeSingle();r=e?.image_url??null}else if("company"===e){let{data:e}=await a.from("companies").select("logo_url, domain").eq("id",t).maybeSingle();r=e?.logo_url??null,l=e?.domain??null}}catch{}let s={imageUrl:r,domain:l};return h.set(n,s),p.delete(n),s})();return p.set(n,l),l}function g(e,t){let[n,r]=(0,a.useState)(()=>h.get(`${e}:${t}`)??null);return(0,a.useEffect)(()=>
1{if(null!==n||"user"!==e&&"contact"!==e&&"company"!==e)return;let a=!1;return f(e,t).then(e=>{a||r(e)}),()=>{a=!0}},[e,t,n]),n}let b=(0,m.pillClass)("default","sq-capsule align-middle"),v={deal:r.Handshake,goal:l.Goal,plan:s.Target,plan_task:s.Target};function y({type:e,name:n,imageUrl:a,domain:c,size:d="inline"}){let m="card"===d,x=m?"h-5 w-5":"h-4 w-4",h=m?"h-3 w-3":"h-2.5 w-2.5";return"company"===e?(0,t.jsx)(o.CompanyLogo,{domain:c,companyName:n,logoUrl:a,size:"xs",className:(0,u.cn)("shrink-0",m?"!h-5 !w-5":"!h-4 !w-4")}):"deal"===e?(0,t.jsx)("span",{className:(0,u.cn)("flex items-center justify-center squircle bg-muted avatar-border shrink-0",x),children:(0,t.jsx)(r.Handshake,{className:(0,u.cn)("text-foreground/70",h)})}):"goal"===e?(0,t.jsx)("span",{className:(0,u.cn)("flex items-center justify-center squircle bg-muted avatar-border shrink-0",x),children:(0,t.jsx)(l.Goal,{className:(0,u.cn)("text-foreground/70",h)})}):"plan"===e||"plan_task"===e?(0,t.jsx)("span",{className:(0,u.cn)("flex items-center justify-center squircle bg-muted avatar-border shrink-0",x),children:(0,t.jsx)(s.Target,{className:(0,u.cn)("text-foreground/70",h)})}):(0,t.jsx)(i.ContactAvatar,{imageUrl:a,name:n,size:"xs",className:(0,u.cn)("shrink-0",x,m?"text-[11px]":"text-[8px]")})}e.s(["EditableMentionChip",0,function({type:e,id:n,name:a}){let r=g(e,n);return(0,t.jsxs)("span",{"data-mention":"","data-mention-type":e,"data-mention-id":n,"data-mention-name":a,contentEditable:!1,className:(0,u.cn)(b,"cursor-default select-none"),children:[(0,t.jsx)(y,{type:e,name:a,imageUrl:r?.imageUrl??null,domain:r?.domain??null,size:"card"}),(0,t.jsx)("span",{className:"truncate max-w-[160px]",children:a})]})},"MentionAvatar",0,y,"MentionPill",0,function({type:e,id:a,name:r,variant:l="inline"}){let s=g(e,a),d=x[e](a);if("pill"===l){let n=v[e];return(0,t.jsx)(c.ItemPill,{href:d??void 0,label:r,icon:n?(0,t.jsx)(n,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):"company"===e?(0,t.jsx)(o.CompanyLogo,{domain:s?.domain??null,companyName:r,logoUrl:s?.imageUrl??null,size:"xs",className:"shrink-0 !h-4 !w-4"}):(0,t.jsx)(i.ContactAvatar,{imageUrl:s?.imageUrl??null,name:r,size:"xs",className:"h-4 w-4 text-[8px] shrink-0"})})}let m="card"===l?b:"inline-flex items-center gap-1 rounded-lg border border-border bg-white dark:bg-card pl-0.5 pr-2 py-0.5 align-middle text-[11px] font-medium text-foreground/85 transition-colors hover:border-foreground
1/30",h=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y,{type:e,name:r,imageUrl:s?.imageUrl??null,domain:s?.domain??null,size:l}),(0,t.jsx)("span",{className:(0,u.cn)("truncate","card"===l?"max-w-[160px]":"max-w-[140px]"),children:r})]});return d?(0,t.jsx)(n.default,{href:d,className:m,onClick:e=>e.stopPropagation(),children:h}):(0,t.jsx)("span",{className:m,children:h})},"primeMentionMeta",0,function(e,t,n){h.set(`${e}:${t}`,n)},"useEntityMeta",0,g])},403986,e=>{"use strict";var t=e.i(843476),n=e.i(37727),a=e.i(440160),r=e.i(373375),l=e.i(463059),s=e.i(271645),o=e.i(647163),i=e.i(609216);e.s(["MediaPreviewModal",0,function({media:e,initialIndex:c=0,onClose:d}){let[u,m]=(0,s.useState)(c),[x,h]=(0,s.useState)(!1),p=(0,s.useRef)(null),f=e[u];(0,s.useEffect)(()=>(requestAnimationFrame(()=>h(!0)),document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);let g=(0,s.useCallback)(()=>{h(!1),setTimeout(d,200)},[d]),b=(0,s.useCallback)(()=>m(t=>t>0?t-1:e.length-1),[e.length]),v=(0,s.useCallback)(()=>m(t=>t<e.length-1?t+1:0),[e.length]);(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&g(),"ArrowLeft"===e.key&&b(),"ArrowRight"===e.key&&v()}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,b,v]),(0,s.useEffect)(()=>{p.current&&p.current.load()},[u]);let y=async()=>{try{let e=await fetch(f.url,{mode:"cors",credentials:"include"});if(e.ok){let t=await e.blob(),n=URL.createObjectURL(t),a=document.createElement("a");a.href=n,a.download=f.filename||"media",document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(n),1e3)}else window.open(f.url,"_blank")}catch{window.open(f.url,"_blank")}},j=f?.mediaType?.startsWith("video/"),w=f?.mediaType?.startsWith("image/"),N=f?.filename||(j?"Video":w?"Image":"Media");return f?(0,t.jsxs)("div",{className:(0,o.cn)("fixed inset-0 z-[9999] flex items-center justify-center transition-all duration-200",x?"bg-black/80 backdrop-blur-sm":"bg-black/0"),onClick:e=>{e.target===e.currentTarget&&g()},children:[(0,t.jsxs)("div",{className:(0,o.cn)("absolute top-0 left-0 right-0 z-10 flex items-center justify-between px-5 py-4 transition-opacity duration-200","bg-gradient-to-b from-black/70 to-transparent",x?"opacity-100":"opacity-0"),children:[(0,t.jsxs)("span",{className:"text-white text-sm font-semibold truncate max-w-[60%] drop-shadow-md",children:[N,e.length>1&&(0,t.jsxs)("span",{className:"ml-2 text-white/60 font-normal",children:[u+1," / ",e.length]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:y,className:"h-9 w-9 rounded-full flex items-center justify-center bg-white/10 border border-white/20 text-white hover:bg-white/20 transition-all hover:scale-105",title:"Download",children:(0,t.jsx)(a.Download,{className:"h-4 w-4"})}),(0,t.jsx)("button",{type:"button",onClick:g,className:"h-9 w-9 rounded-full flex items-center justify-center bg-white/10 border border-white/20 text-white hover:bg-white/20 transition-all hover:scale-105",title:"Close",children:(0,t.jsx)(n.X,{className:"h-4 w-4"})})]})]}),e.length>1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),b()},className:"absolute left-4 z-10 h-10 w-10 rounded-full flex items-center justify-center bg-black/40 border border-white/20 text-white hover:bg-black/60 transition-all hover:scale-105",children:(0,t.jsx)(r.ChevronLeft,{className:"h-5 w-5"})}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),v()},className:"absolute right-4 z-10 h-10 w-10 rounded-full flex items-center justify-center bg-black/40 border border-white/20 text-white hover:bg-black/60 transition-all hover:scale-105",children:(0,t.jsx)(l.ChevronRight,{className:"h-5 w-5"})})]}),(0,t.jsx)("div",{className:(0,o.cn)("transition-all duration-200",x?"scale-100 opacity-100":"scale-95 opacity-0"),children:j?(0,t.jsxs)(i.VideoPlayer,{videoRef:p,autoPlay:!0,className:"rounded-xl shadow-2xl",videoClassName:"max-w-[90vw] max-h-[85vh] object-contain",children:[(0,t.jsx)("source",{src:f.url,type:"video/mp4"}),"video/mp4"!==f.mediaType&&(0,t.jsx)("source",{src:f.url,type:f.mediaType})]}):(0,t.jsx)("img",{src:f.url,alt:N,className:"max-w-[90vw] max-h-[85vh] rounded-xl object-contain shadow-2xl",referrerPolicy:"no-referrer"})})]}):null}])},691551,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(643531),r=e.i(174886),l=e.i(870273),s=e.i(647163),o=e.i(526286),i=e.i(728231),c=e.i(920755);let d=new Set,u=new Set,m=new Set,x=null,h=new Set;function p(e,t){return`${e}:${t}`}function f(){for(let e of h)e()}function g(e){return h.add(e),()=>{h.delete(e)}}async function b(){x=null;let e=m;if(m=new Set,0===e.size)return;let t=(0,c.createClient)(),{data:n}=await t.auth.getUser(),a=n.user?.id;if(!a){for(let t of e)u.add(t);f();return}let r=new Map;for(let t of e){let e=t.indexOf(":"),n=t.slice(0,e),a=t.slice(e+1),l=r.get(n);l?l.push(a):r.set(n,[a])}await Promise.all([...r.entries()].map(async([e,n])=>{let{data:r,error:l}=await t.from("message_stars").select("message_id").eq("user_id",a).eq("channel",e).in("message_id",n);if(!l){for(let t of n)u.add(p(e,t));for(let t of r??[])d.add(p(e,t.message_id))}})),f()}function v(e,t,n){let a=p(e,t);u.add(a),n?d.add(a):d.delete(a),f()}async function y(e,t,n){v(e,t,n);let a=await fetch("/api/inbox/message-star",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageIds:[t],channel:e,starred:n})}).catch(()=>null);return!!a&&!!a.ok||(v(e,t,!n),!1)}let j={group:"group-hover:opacity-100 group-hover:pointer-events-auto",row:"group-hover/row:opacity-100 group-hover/row:pointer-events-auto",msg:"group-hover/msg:opacity-100 group-hover/msg:pointer-events-auto",bubble:"group-hover/bubble:opacity-100 group-hover/bubble:pointer-events-auto",none:""};function w(e){let t=e?.closest("[data-radix-popper-content-wrapper]");t&&(t.style.pointerEvents="none")}let N=(0,n.forwardRef)(function({label:e,disabled:n,disabledReason:a,destructive:r,className:l,onClick:o,children:c,...d},u){let m=n?a??e:e;return(0,t.jsxs)(i.Tooltip,{children:[(0,t.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{ref:u,type:"button","aria-label":e,"aria-disabled":n||void 0,onClick:n?void 0:o,className:(0,s.cn)("flex h-6 w-6 shrink-0 items-center justify-center squircle transition-colors",n?"cursor-not-allowed text-muted-foreground opacity-40":r?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"text-muted-foreground hover:bg-accent hover:text-foreground",l),...d,children:c})}),(0,t.jsx)(i.TooltipContent,{ref:w,side:"top",className:"pointer-events-none max-w-[220px]",children:m})]})});e.s(["MessageActionButton",0,N,"MessageActionPill",0,function({revealed:e,onDismiss:a,orientation:r,isOutbound:l,forceVisible:o,hoverGroup:i="group",notice:c,className:d,children:u}
1){let[m,x]=(0,n.useState)(!1),h=(0,n.useRef)(null),p=(0,n.useRef)(null),f=e||!!o||m,g=(0,n.useCallback)(()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]);(0,n.useEffect)(()=>g,[g]),(0,n.useEffect)(()=>{if(!m)return;let e=e=>{let t=h.current;if(!t)return;let n=t.getBoundingClientRect();e.clientX>=n.left-6&&e.clientX<=n.right+6&&e.clientY>=n.top-6&&e.clientY<=n.bottom+6?g():p.current||(p.current=setTimeout(()=>{p.current=null,x(!1)},180))},t=()=>{g(),x(!1)};return window.addEventListener("pointermove",e,!0),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("pointermove",e,!0),window.removeEventListener("scroll",t,!0),g()}},[m,g]);let b=(0,n.useCallback)(e=>{"touch"!==e.pointerType&&(g(),x(!0))},[g]);return(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsx)("div",{className:"fixed inset-0 z-[5]",onClick:a}),(0,t.jsx)("div",{ref:h,onPointerEnter:b,onPointerMove:b,className:(0,s.cn)("absolute z-20 flex transition-opacity pointer-events-none hover:pointer-events-auto",f?"opacity-100 pointer-events-auto":(0,s.cn)("opacity-0 hover:opacity-100",j[i]),"above"===r?(0,s.cn)("bottom-full pb-1",l?"right-0":"left-0"):(0,s.cn)("top-1/2 -translate-y-1/2",l?"right-full pr-1 md:pr-1.5":"left-full pl-1 md:pl-1.5"),d),children:(0,t.jsxs)("div",{className:(0,s.cn)("flex rounded-lg border border-border bg-card shadow-sm","vertical"===r?"flex-col items-center gap-1 px-1 py-1.5":"flex-row items-center gap-0.5 px-1.5 py-1"),children:[u,e&&c&&(0,t.jsx)("p",{className:"max-w-[200px] px-1 text-[11px] leading-snug text-muted-foreground",children:c})]})})]})},"MessageCopyButton",0,function({text:e,label:l="Copy"}){let[s,o]=(0,n.useState)(!1),i=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]);let c=(0,n.useCallback)(()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>o(!1),1200)}).catch(()=>{})},[e]);return(0,t.jsx)(N,{label:s?"Copied":l,onClick:c,children:s?(0,t.jsx)(a.Check,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.Copy,{className:"h-3.5 w-3.5"})})},"MessageStarButton",0,function({channel:e,messageId:a}){let r=((0,n.useEffect)(()=>{let t;t=p(e,a),u.has(t)||m.has(t)||(m.add(t),null===x&&(x=setTimeout(()=>void b(),0)))},[e,a]),(0,n.useSyncExternalStore)(g,()=>d.has(p(e,a)),()=>!1));return!a||a.startsWith("temp-")?null:(0,t.jsx)(N,{label:r?"Unstar message":"Star message",onClick:()=>void y(e,a,!r),className:r?"text-yellow-500 hover:text-yellow-500":void 0,children:(0,t.jsx)(l.Star,{className:`h-3.5 w-3.5 ${r?"fill-yellow-400 text-yellow-500":""}`})})},"useMessageActionPill",0,function(e,t){let[a,r]=(0,n.useState)(!1),l=function(e,t,a=140,r=44){let[l,s]=(0,n.useState)("horizontal");return(0,n.useEffect)(()=>{let n=e.current;if(!n)return;let l=()=>{let e=n.parentElement;for(;e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflowX)return e;e=e.parentElement}return null},o=()=>{let e=n.getBoundingClientRect();if(0===e.width)return;let o=l()?.getBoundingClientRect()??{left:0,right:window.innerWidth},i=t?e.left-o.left:o.right-e.right;s(i>=a?"horizontal":i>=r?"vertical":"above")};o();let i=new ResizeObserver(o);i.observe(n);let c=l();return c&&i.observe(c),window.addEventListener("resize",o),()=>{i.disconnect(),window.removeEventListener("resize",o)}},[e,t,a,r]),l}(e,t),s=(0,n.useCallback)(()=>r(!0),[]),i=(0,n.useCallback)(()=>r(!1),[]),c=(0,o.useLongPress)(s);return(0,n.useEffect)(()=>{if(!a)return;let e=()=>r(!1);return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[a]),{revealed:a,reveal:s,dismiss:i,orientation:l,touchProps:{onTouchStart:c.onTouchStart,onTouchMove:c.onTouchMove,onTouchEnd:c.onTouchEnd,onContextMenu:c.onContextMenu}}}],691551)},625458,602944,e=>{"use strict";var t=e.i(843476),n=e.i(271645),a=e.i(476819),r=e.i(647163);e.s(["ReplyRunBracket",0,function({side:e,edge:l=10,stub:s=6,radius:o=8,className:i}){let c=(0,n.useRef)(null),d="right"===e;return(0,n.useLayoutEffect)(()=>{let e=c.current,t=e?.parentElement;if(!e||!t)return;let n=()=>{let n=t.closest("[data-reply-run-scope]")??document,a=t.querySelector("[data-reply-quote]"),r=null;for(let e of n.querySelectorAll("[data-reply-run-end]"))if(t.contains(e)||t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING){r=e;break}if(!a||!r){e.style.display="none";return}let l=t.getBoundingClientRect(),s=a.getBoundingClientRect(),i=r.getBoundingClientRect(),c=s.bottom-l.top+3,d=i.top+i.height/2-l.top-c;if(d<o){e.style.display="none";return}e.style.display="",e.style.top=`${c}px`,e.style.height=`${d}px`};n();let a=new ResizeObserver(n);a.observe(t);let r=t.closest("[data-reply-run-scope]");return r&&a.observe(r),()=>a.disconnect()}
1,[o]),(0,t.jsx)("span",{ref:c,"aria-hidden":!0,className:(0,r.cn)("pointer-events-none absolute z-0 border-b-2 border-border/70 dark:border-border/50",d?"border-r-2":"border-l-2",i),style:{[d?"right":"left"]:(0,a.designPx)(-l),width:(0,a.designPx)(Math.max(s,o)),[d?"borderBottomRightRadius":"borderBottomLeftRadius"]:(0,a.designPx)(o),display:"none"}})}],625458),e.s(["replyRunPositions",0,function(e,t){let n=e.length,a=Array(n).fill(null);if(0===n)return a;let r=n=>{if(0===n||t.breakBefore?.(e[n],n))return!1;let a=t.target(e[n]);return!!a&&t.target(e[n-1])===a&&t.sender(e[n-1])===t.sender(e[n])};for(let l=0;l<n;l++){if(!t.target(e[l]))continue;let s=r(l),o=l+1<n&&r(l+1);a[l]=s?o?"middle":"end":o?"start":"solo"}return a},"showsReplyQuote",0,function(e){return"solo"===e||"start"===e}],602944)},184189,e=>{"use strict";let t=["bg-[#E3E7ED] dark:bg-[#101318]","bg-[#EDE3E7] dark:bg-[#181014]","bg-[#E3EDE6] dark:bg-[#101813]","bg-[#E7E3ED] dark:bg-[#141018]","bg-[#EDEBE3] dark:bg-[#171610]","bg-[#E3EDEB] dark:bg-[#101816]"];e.s(["buildParticipantColorMap",0,function(e){let n=new Map,a=0;for(let r of e)!(r.isOutbound||n.has(r.key))&&(0===n.size?n.set(r.key,null):(n.set(r.key,t[a%t.length]),a++));return n}])},705599,e=>{"use strict";var t=e.i(271645),n=e.i(287751);function a(e,t){let n=new URLSearchParams({entity_type:e,entity_id:t});return`/api/comments?${n.toString()}`}let r=[],l=[];e.s(["prefetchComments",0,function(e,t){(0,n.prefetch)(a(e,t))},"useComments",0,function(e,s){let o=a(e,s),{data:i,error:c,isLoading:d,refetch:u}=(0,n.useCachedFetch)(o),m=(0,t.useMemo)(()=>{let e={};for(let t of i?.attachments??[]){let n=e[t.comment_id]??[];n.push(t),e[t.comment_id]=n}return e},[i]),x=(0,t.useMemo)(()=>{let e={};for(let t of i?.authors??[])e[t.id]=t;return e},[i]),h=(0,t.useCallback)(async()=>{await u()},[u]),p=(0,t.useCallback)(async t=>{let n=await fetch("/api/comments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity_type:e,entity_id:s,parent_comment_id:t.parentCommentId??null,body:t.body,mentions:t.mentions??[],attachments:t.attachments??[]})});if(!n.ok)throw Error((await n.json().catch(()=>({}))).error||"Failed to post comment");await u()},[e,s,u]),f=(0,t.useCallback)(async(e,t)=>{let n=await fetch(`/api/comments/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw Error((await n.json().catch(()=>({}))).error||"Failed to update comment");await u()},[u]),g=(0,t.useCallback)(async e=>{let t=await fetch(`/api/comments/${e}`,{method:"DELETE"});if(!t.ok)throw Error((await t.json().catch(()=>({}))).error||"Failed to delete comment");await u()},[u]);return{comments:i?.comments??r,mentions:i?.mentions??l,attachmentsByComment:m,authors:x,loading:d,error:c?c instanceof Error?c.message:"Failed to load comments":null,refetch:h,createComment:p,updateComment:f,deleteComment:g}}])},150513,e=>{"use strict";var t=e.i(271645),n=e.i(992427);e.s(["useDoubleTap",0,function(e,a,{delay:r=280}={}){let l=(0,n.useIsMobile)(),s=(0,t.useRef)(0),o=(0,t.useRef)(null),i=(0,t.useRef)(null),c=(0,t.useRef)(!1);(0,t.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let d=(0,t.useCallback)(()=>{let t=Date.now();if(s.current&&t-s.current<r){o.current&&(clearTimeout(o.current),o.current=null),s.current=0,a();return}s.current=t,o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{o.current=null,s.current=0,e()},r)},[r,e,a]),u=(0,t.useCallback)(e=>{if(1!==e.touches.length){i.current=null;return}let t=e.touches[0];i.current={x:t.clientX,y:t.clientY,t:Date.now()}},[]),m=(0,t.useCallback)(e=>{let t=i.current;if(i.current=null,!t||Date.now()-t.t>400)return;let n=e.changedTouches[0];if(!n)return;let a=Math.abs(n.clientX-t.x),r=Math.abs(n.clientY-t.y);a>10||r>10||(e.preventDefault(),c.current=!0,setTimeout(()=>{c.current=!1},500),d())},[d]);return{onClick:(0,t.useCallback)(t=>{if(c.current){t.preventDefault(),t.stopPropagation();return}l?d():e()},[l,e,d]),onTouchStart:u,onTouchEnd:m}}])},526286,e=>{"use strict";var t=e.i(271645);e.s(["useLongPress",0,function(e,{maxDuration:n=300,moveThreshold:a=10}={}){let r=(0,t.useRef)(null),l=(0,t.useRef)(!1),s=(0,t.useCallback)(e=>{let t=e.target;if(t instanceof Element&&t.closest('button, a, input, textarea, select, audio, video, label, [role="button"], [role="link"], [role="slider"], [data-no-tap-action]')){r.current=null,l.current=!0;return}let n=e.touches[0];r.current={x:n.clientX,y:n.clientY,t:Date.now()},l.current=!1},[]),o=(0,t.useCallback)(e=>{if(!r.current||l.current)return;let t=e.touches[0],n=t.clientX-r.current.x,s=t.clientY-r.current.y;(Math.abs(n)>a||Math.abs(s)>a)&&(l.current=!0)},[a]);return{onTouchStart:s,onTouchMove:o,onTouchEnd:(0,t.useCallback)(()=>
1{if(!r.current||l.current){r.current=null;return}let t=Date.now()-r.current.t;r.current=null,t<n&&e()},[e,n]),onContextMenu:(0,t.useCallback)(e=>{e.preventDefault()},[])}}])},617516,e=>{"use strict";var t=e.i(920755);let n=new Map,a=new Map;function r(e){return`slack:${e}`}async function l(e){try{let a=(0,t.createClient)(),{data:l}=await a.from("slack_conversations").select("*").eq("id",e).single();if(!l)return null;let s=await fetch("/api/slack/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversationId:e,limit:50})}),o=await s.json(),i={conversation:l,messages:o.messages??[],timestamp:Date.now()};return n.set(r(e),i),i}catch{return null}}function s(e){let t=r(e.conversationId);if(n.has(t)||a.has(t))return;let s=l(e.conversationId).finally(()=>a.delete(t));a.set(t,s)}let o=null,i=null;function c(){return o?Date.now()-o.timestamp>6e4?(o=null,null):o.connected:null}function d(e){o={connected:e,timestamp:Date.now()}}async function u(){return i||(i=fetch("/api/slack/status").then(e=>e.json()).then(e=>{let t=!!e.connected;return d(t),t}).catch(()=>!1).finally(()=>{i=null}))}let m=new Map,x=new Map;function h(e){return`slack-contact:${e}`}async function p(e,t){try{let n=await fetch("/api/slack/conversation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contactId:e,workspaceId:t})});if(!n.ok)return null;let a=await n.json(),r=a.conversations||(a.conversation?[a.conversation]:[]),l=a.messages||[],s={conversations:r,messages:l,timestamp:Date.now()};return m.set(h(e),s),s}catch{return null}}e.s(["getCachedSlackByContact",0,function(e){let t=m.get(h(e));return t?Date.now()-t.timestamp>12e4?(m.delete(h(e)),null):t:null},"getCachedSlackConnected",0,c,"getCachedSlackConversation",0,function(e){let t=n.get(r(e));return t?Date.now()-t.timestamp>12e4?(n.delete(r(e)),null):t:null},"prefetchSlackByContact",0,function(e){let t=h(e.contactId);if(m.has(t)||x.has(t))return;let n=(async()=>{if(!(c()??await u()))return null;let t=await p(e.contactId,e.workspaceId);if(t?.conversations)for(let e of t.conversations)s({conversationId:e.id});return t})().finally(()=>x.delete(t));x.set(t,n)},"prefetchSlackConversation",0,s,"setCachedSlackByContact",0,function(e,t){m.set(h(e),{...t,timestamp:Date.now()})},"setCachedSlackConnected",0,d,"setCachedSlackConversation",0,function(e,t){n.set(r(e),{...t,timestamp:Date.now()})}])},298489,e=>{"use strict";e.s(["generateVideoThumbnail",0,function(e){return new Promise((t,n)=>{let a=document.createElement("video");a.preload="metadata",a.muted=!0,a.playsInline=!0;let r=URL.createObjectURL(e);a.src=r,a.onloadeddata=()=>{a.currentTime=Math.min(1,a.duration/2)},a.onseeked=()=>{try{let e=document.createElement("canvas");e.width=a.videoWidth,e.height=a.videoHeight;let l=e.getContext("2d");if(!l)return void n(Error("Canvas context unavailable"));l.drawImage(a,0,0),e.toBlob(e=>{URL.revokeObjectURL(r),e?t(URL.createObjectURL(e)):n(Error("Failed to create thumbnail blob"))},"image/jpeg",.7)}catch(e){URL.revokeObjectURL(r),n(e)}},a.onerror=()=>{URL.revokeObjectURL(r),n(Error("Failed to load video"))}})}])},551804,e=>{"use strict";var t=e.i(68274);e.s(["CalendarCheck",()=>t.default])},655900,e=>{"use strict";var t=e.i(399219);e.s(["ChevronUp",()=>t.default])},406321,e=>{"use strict";let t=(0,e.i(475254).default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);e.s(["default",0,t])},798031,e=>{"use strict";let t=(0,e.i(475254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",0,t])},373884,e=>{"use strict";var t=e.i(798031);e.s(["XCircle",()=>t.default])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.