PageSourceSearch

https://vizops360.ai/assets/openMeetingSchedule-OlZDiB1X.js

js vizops360.ai collected 2026-10-05 13:51:57 UTC 10,284 bytes, 1 lines download raw bytes

1import{iq as q,ir as Q,r as V,is as O,it as _,aW as H,iu as K,j as e,ab as W,as as l,Y as X,da as N,M as Z,af as ee,U as te,v as A,w as L,X as S,ap as R,fn as se,c6 as ae,bq as ne,br as ie,bN as re,bO as le,gx as G,bP as oe,bs as de,aI as y}from"./index-CpeGhXo5.js";import{i as ce}from"./useSalesTeamEmployees-B4P2K3K2.js";function k(a){return a?.userId||a?.id||""}function me({participants:a,users:x}){const c=a.slice(0,3),b=Math.max(0,a.length-c.length),u=s=>x.get(k(s)),g=s=>u(s)?.fullName||s?.actor?.fullName||s?.fullName||"Participant",j=s=>{const r=u(s);return r?.initials?r.initials:g(s).trim().split(/\s+/).slice(0,2).map(d=>d[0]||"").join("").toUpperCase()||"?"};return e.jsxs(ne,{children:[e.jsx(ie,{asChild:!0,children:e.jsxs("button",{type:"button",className:"inline-flex items-center rounded-full pl-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Show ${a.length} meeting participants`,children:[c.map((s,r)=>{const o=u(s),d=k(s)||`participant-${r}`;return e.jsxs(re,{children:[e.jsx(le,{asChild:!0,children:e.jsx("span",{className:l("relative inline-flex rounded-full",r>0&&"-ml-2"),style:{zIndex:c.length-r},children:e.jsx(G,{userId:d,avatar:o?.avatar||s?.actor?.avatar,initials:j(s),sizeClass:"h-7 w-7 text-[9px]",className:"shadow-sm"})})}),e.jsx(oe,{side:"top",className:"text-xs",children:g(s)})]},d)}),b>0&&e.jsxs("span",{className:"relative z-10 -ml-2 flex h-7 w-7 items-center justify-center rounded-full border-2 border-background bg-muted text-[9px] font-semibold text-muted-foreground shadow-sm",children:["+",b]})]})}),e.jsx(de,{align:"start",className:"w-64 p-1",children:e.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:a.map((s,r)=>{const o=u(s),d=k(s)||`participant-${r}`;return e.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-2",children:[e.jsx(G,{userId:d,avatar:o?.avatar||s?.actor?.avatar,initials:j(s),sizeClass:"h-8 w-8 text-[10px]"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-xs font-medium text-foreground",children:g(s)}),e.jsx("div",{className:"truncate text-[10px] capitalize text-muted-foreground",children:s.role||s.status||"Attendee"})]})]},d)})})})]})}function ge({meeting:a,currentUserId:x="",onOpenCalendar:c,className:b,participantUsers:u=new Map,showParticipantAvatars:g=!1}){const[j,{isLoading:s}]=q(),[r,{isLoading:o}]=Q(),[d,v]=V.useState(!1),$=O(n=>n.setEditingMeeting),{data:F}=_(a?.id,{skip:!a?.id}),t=F||a,i=t.participants?.find(n=>n.userId===x)?.status?.toUpperCase()||"PENDING",m=t.organizerId===x,D=String(t.source||"").toLowerCase()==="google"||!!t.googleCalendarId,C=!D&&(t.permissions?.canEdit===!0||m),w=!D&&(t.permissions?.canCancel===!0||m),{data:J}=H(),I=J?.items||[],E=I.find(n=>n.id===t.organizerId||n.userId===t.organizerId),Y=m?"You":E?`${E.firstName||""} ${E.lastName||""}`.trim():t.organizerName||"Colleague",f=(t.participants||[]).filter(n=>{const T=n.userId||n.email,P=I.find(M=>M.userId===T||M.id===T||M.workEmail===T);return P?ce(P.status):!0}),z=K(new Date(t.endTime||t.startTime)),p=String(t.status||"").toUpperCase()==="CANCELLED"||String(t.status||"").toLowerCase()==="cancelled",h=async n=>{try{await j({id:t.id,status:n}).unwrap(),y.success(`Meeting marked as ${n}`)}catch{y.error("Failed to respond to meeting")}},U=()=>{!C||!t?.id||$({...t})},B=async()=>{if(!(!w||!t?.id))try{await r(t.id).unwrap(),y.success("Meeting cancelled — attendees notified"),v(!1)}catch(n){y.error(n?.data?.message||n?.message||"Failed to cancel meeting")}};return e.jsxs("div",{"data-meeting-id":t.id,className:l("w-full max-w-[400px] bg-surface border border-border/60 shadow-sm rounded-xl overflow-hidden transition-all hover:shadow-md",i==="REJECTED"&&"opacity-60",b),children:[e.jsxs("div",{className:"bg-primary/10 px-4 py-3 flex items-start gap-3 border-b border-border/50",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary text-primary-foreground flex items-center justify-center shrink-0 shadow-sm mt-0.5",children:e.jsx(W,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[10px] font-semibold tracking-wider text-primary uppercase mb-0.5",children:"Meeting Invite"}),e.jsx("div",{className:l("font-bold text-sm truncate",i==="REJECTED"?"line-through text-muted-foreground":"text-foreground"),children:t.title}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["Organized by"," ",e.jsx("span",{className:"font-medium text-foreground",children:Y})]})]}),p&&e.jsx("span",{className:"text-[9px] font-bold uppercase px-2 py-0.5 rounded-full bg-zinc-200 text-zinc-700 shrink-0 mt-1",children:"CANCELLED"}
1),!p&&!m&&i!=="PENDING"&&e.jsx("span",{className:l("text-[9px] font-bold uppercase px-2 py-0.5 rounded-full shrink-0 mt-1",i==="ACCEPTED"&&"bg-emerald-100 text-emerald-700",i==="REJECTED"&&"bg-red-100 text-red-700",i==="MAYBE"&&"bg-amber-100 text-amber-700"),children:i}),!p&&m&&e.jsx("span",{className:"text-[9px] font-bold uppercase px-2 py-0.5 rounded-full bg-primary/10 text-primary shrink-0 mt-1",children:"Organizer"})]}),e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx(X,{className:"w-4 h-4 shrink-0"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium text-foreground",children:t.startTime?N(new Date(t.startTime),"EEEE, MMM d, yyyy"):"No Date"}),e.jsx("span",{children:t.startTime&&t.endTime?`${N(new Date(t.startTime),"h:mm a")} - ${N(new Date(t.endTime),"h:mm a")}`:t.startTime?N(new Date(t.startTime),"h:mm a"):"No Time"})]})]}),t.location&&e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx(Z,{className:"w-4 h-4 shrink-0"}),e.jsx("span",{className:"truncate",children:t.location})]}),t.meetingLink&&e.jsxs("div",{className:"flex items-start gap-3 text-xs text-muted-foreground",children:[e.jsx(ee,{className:"w-4 h-4 shrink-0 text-blue-500 mt-0.5"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("a",{href:t.meetingLink,target:"_blank",rel:"noreferrer",className:"font-medium text-blue-500 hover:underline",onClick:n=>n.stopPropagation(),children:t.meetingType==="google_meet"?"Google Meet":t.meetingType==="zoom"?"Zoom":"Join meeting"}),e.jsx("div",{className:"truncate text-[10px] text-muted-foreground/80 mt-0.5",title:t.meetingLink,children:t.meetingLink})]})]}),f&&f.length>0&&e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx(te,{className:"w-4 h-4 shrink-0"}),g?e.jsx(me,{participants:f,users:u}):e.jsxs("span",{children:[f.length," participant",f.length!==1?"s":""]})]})]}),!p&&!m&&!z&&i==="PENDING"&&e.jsxs("div",{className:"grid grid-cols-3 divide-x border-t border-border/60 bg-zinc-50",children:[e.jsxs("button",{type:"button",onClick:()=>h("ACCEPTED"),disabled:s,className:l("flex flex-col items-center justify-center py-2.5 transition-colors disabled:opacity-50","text-emerald-600 hover:bg-emerald-50"),children:[e.jsx(A,{className:"w-4 h-4 mb-0.5"}),e.jsx("span",{className:"text-[10px] font-medium",children:"Accept"})]}),e.jsxs("button",{type:"button",onClick:()=>h("MAYBE"),disabled:s,className:l("flex flex-col items-center justify-center py-2.5 transition-colors disabled:opacity-50","text-yellow-600 hover:bg-yellow-50"),children:[e.jsx(L,{className:"w-4 h-4 mb-0.5"}),e.jsx("span",{className:"text-[10px] font-medium",children:"Maybe"})]}),e.jsxs("button",{type:"button",onClick:()=>h("REJECTED"),disabled:s,className:l("flex flex-col items-center justify-center py-2.5 transition-colors disabled:opacity-50","text-red-600 hover:bg-red-50"),children:[e.jsx(S,{className:"w-4 h-4 mb-0.5"}),e.jsx("span",{className:"text-[10px] font-medium",children:"Reject"})]})]}),!p&&!m&&!z&&i!=="PENDING"&&e.jsxs("div",{className:"grid grid-cols-3 divide-x border-t border-border/60 bg-zinc-50",children:[e.jsxs("button",{type:"button",onClick:()=>h("ACCEPTED"),disabled:s,className:l("flex flex-col items-center justify-center py-2.5 transition-colors disabled:opacity-50",i==="ACCEPTED"?"bg-emerald-500 text-white":"text-emerald-600 hover:bg-emerald-50"),children:[e.jsx(A,{className:"w-4 h-4 mb-0.5"}),e.jsx("span",{className:"text-[10px] font-medium",children:"Accept"})]}),e.jsxs("button",{type:"button",onClick:()=>h("MAYBE"),disabled:s,className:l("flex flex-col items-center justify-center py-2.5 transition-colors disabled:opacity-50",i==="MAYBE"?"bg-yellow-500 text-white":"text-yellow-600 hover:bg-yellow-50"),children:[e.jsx(L,{className:"w-4 h-4 mb-0.5"}),e.jsx("span",{className:"text-[10px] font-medium",children:"Maybe"})]}),e.jsxs("button",{type:"button",onClick:()=>h("REJECTED"),disabled:s,className:l("flex flex-col items-center justify-center py-2.5 transition-colors disabled:opacity-50",i==="REJECTED"?"bg-red-500 text-white":"text-red-600 hover:bg-red-50"),children:[e.jsx(S,{className:"w-4 h-4 mb-0.5"}),e.jsx("span",{className:"text-[10px] font-medium",children:"Reject"})]})]}),e.jsxs("div",{className:"border-t border-border/60 bg-zinc-50 p-2 flex flex-wrap items-center justify-center gap-2",children:[(C||w)&&!p&&e.jsxs(e.Fragment,{children:[C&&e.jsxs(R,{type:"button",variant:"outline",size:"sm",className:"h-7 text-[11px] gap-1",onClick:U,children:[e.jsx(se,{className:"w-3 h-3"}),"Edit"]}),w&&e.jsx(R,{type:"button",variant:"outline",size:"sm",className:"h-7 text-[11px] text-red-600 border-red-200 hover:bg-red-50 hover:text-red-700",onClick:()=>v(!0),disabled:o,children:"Cancel"})]}),e.jsx("button",{type:"button",onClick:()=>c(t.id),className:"text-xs font-medium text-primary hover:underline px-1",children:"View in Calendar"})]}),e.jsx(ae,{isOpen:d,onClose:()=>!o&&v(!1),onConfirm:()=>{B()},title:"Cancel this meeting?",description:"Attendees will be notified and this meeting will be removed. This cannot be undone.",confirmText:o?"Cancelling…":"Yes, Cancel Meeting",cancelText:"Keep Meeting",variant:"destructive",isLoading:o})]})}function xe(a){const x=a?.startTime??new Date,c=a?.employeeId??"me";O.getState().setQuickScheduleSlot({employeeId:c,startTime:x,crmContext:a?.crmContext})}function fe(a){xe({employeeId:"me",startTime:new Date,crmContext:a})}export{ge as M,xe as a,fe as o};

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.