1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[24303],{24303:(e,t,a)=>{a.r(t),a.d(t,{GlobalChatNotifier:()=>u});var n=a(12115),s=a(73321),o=a(21627),i=a(15433),r=a(62697),c=a(19402),d=a(36162);function u(){let e=(0,o.B5)(),t=(0,s.useRouter)(),a=(0,s.usePathname)(),{user:u}=(0,i.As)(),{hasAccess:l,isLoading:h}=(0,r.P)(),f=(0,n.useRef)(a);(0,n.useEffect)(()=>{f.current=a},[a]);let m=(0,n.useCallback)(a=>{if(!h&&!l("chat"))return;let n=e?.notificationLevel==="none",s=a.payload,i=s.senderId,r=s.senderName||"Someone",m=s.conversationId||a.conversationId;if(!u?.userId||i===u.userId)return;let g=Array.isArray(s.mentions)&&s.mentions.includes(u.userId);if(m&&!g)try{if(new Set(JSON.parse(localStorage.getItem("wrrk-chat-muted")||"[]")).has(m)||new Set(JSON.parse(localStorage.getItem("wrrk-chat-archived")||"[]")).has(m))return}catch{}let p=s.contentPlain||s.content||"",N=p.length>100?p.slice(0,100)+"...":p,S=f.current===`/chat/c/${m}`&&!document.hidden;if(n||(0,d.$)(),g||!S){let a=g?`${r} mentioned you`:"New Message",i=g?N:`${r}: ${N}`;n||c.toast.info(i,{title:a,duration:6e3,onClick:m?()=>t.push(`/chat/c/${m}`):()=>t.push("/chat")}),(0,o.T8)({type:g?"chat_mention":"chat_message",title:g?a:`Message from ${r}`,message:N,link:m?`/chat/c/${m}`:"/chat",metadata:{conversationId:m},dedupKey:`chat:${m||""}:${s.messageId||""}`}),document.hidden&&"undefined"!=typeof Notification&&"granted"===Notification.permission&&(e?.allowBrowserNotification?.("chat_message")??!0)&&new Notification(g?a:`Message from ${r}`,{body:N,icon:"/icons/icon-192.png",tag:`chat-${m||Date.now()}`})}},[t,u?.userId,l,h,e]);return(0,n.useEffect)(()=>{if(e)return e.addMessageHandler("CHAT_MESSAGE_SENT",m),()=>{e.removeMessageHandler("CHAT_MESSAGE_SENT",m)}},[e,m]),null}}}]); 2//# sourceMappingURL=24303.8e2f385e020857e5.js.map
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.