PageSourceSearch

https://slovonline.ru/assets/NoticesView-DL6859RW.js

js slovonline.ru collected 2026-10-02 20:48:50 UTC 5,508 bytes, 1 lines download raw bytes

1import{r,j as t}from"./vendor-CIikcnY8.js";import{u as R,l as V,e as q,S as K,A as Q}from"./index-CGFDy_im.js";import{w as W}from"./history-DpyTbjEV.js";import{m as H}from"./mentions-Z6-aGvF_.js";import"./priority-B-jcXK3z.js";const o=i=>i.kind==="comment"||i.kind==="mention";function ee({items:i,due:N,tasks:j,people:k,holders:d,departments:p,taskGroups:f,linked:$,onOpenTask:D,onReadAll:M}){const n=R(),[c,L]=r.useState("all"),[x,b]=r.useState(""),w=r.useMemo(()=>new Map(k.map(e=>[e.id,e])),[k]),h=r.useMemo(()=>new Map(j.map(e=>[e.id,e])),[j]),A=r.useMemo(()=>W(n,{person:e=>w.get(e)?.fullName??"",holder:e=>d.find(a=>a.id===e)?.name??"",dept:e=>p.find(a=>a.id===e)?.name??"",group:e=>f.find(a=>a.id===e)?.name??"",zone:e=>d.flatMap(a=>a.areas).find(a=>a.id===e)?.name??"",task:e=>h.get(e)?.title??""}),[n,w,d,p,f,h]),l=e=>{const a=d.find(s=>s.id===(e.projectId??e.toolId));return a?a.name:p.find(s=>s.id===e.departmentId)?.name??""},m=i.filter(e=>!e.read).length,y=x.trim().toLowerCase(),S=(...e)=>!y||e.some(a=>!!a&&a.toLowerCase().includes(y)),v=i.filter(e=>(c==="unread"?!e.read:c==="said"?o(e):c==="changed"?!o(e):!0)&&S(e.taskTitle,e.byName,o(e)?String(e.data.text??""):"",l(e))),I=N.filter(e=>{const a=h.get(e.taskId);return S(e.title,a?l(a):"")}),g=V(n.lang),O=e=>new Date(e).toLocaleTimeString(g,{hour:"2-digit",minute:"2-digit"}),E=e=>new Date(e).toLocaleString(g,{dateStyle:"medium",timeStyle:"short"}),F=e=>new Date(e).toISOString().slice(0,10),z=e=>{const a=new Date,s=a.toISOString().slice(0,10),Y=new Date(a.getTime()-864e5).toISOString().slice(0,10);if(e===s)return n("Today");if(e===Y)return n("Yesterday");const C=new Date(`${e}T00:00:00`),B=C.getFullYear()===a.getFullYear()?{day:"numeric",month:"long"}:{dateStyle:"long"};return C.toLocaleDateString(g,B)},P=e=>e.split("-").reverse().join("."),u=[];for(const e of v){const a=F(e.at),s=u[u.length-1];s&&s.day===a?s.rows.push(e):u.push({day:a,rows:[e]})}const T=e=>D(e),U=[{key:"all",label:"Everything",n:i.length},{key:"unread",label:"Unread",n:m},{key:"said",label:"Messages",n:i.filter(o).length},{key:"changed",label:"Changes",n:i.filter(e=>!o(e)).length}];return t.jsxs("div",{className:"notices",children:[t.jsxs("header",{className:"notices-head",children:[t.jsxs("div",{className:"notices-title",children:[t.jsx("h2",{children:n("Notifications")}),m>0&&t.jsx("span",{className:"notices-badge",children:n("{n} unread",{n:m})})]}),t.jsxs("div",{className:"notices-tools",children:[(i.length>0||N.length>0)&&t.jsx("input",{className:"team-search","data-find":!0,value:x,onChange:e=>b(e.target.value),onKeyDown:q(x,()=>b("")),placeholder:n("Search the notifications…")}),m>0&&t.jsx("button",{type:"button",className:"btn",onClick:M,children:n("Mark all read")})]})]}),!$&&t.jsx("p",{className:"hint pad",children:n("This account is not tied to anybody on the map yet, so there is no work of its own to hear about. Settings → Users.")}),I.length>0&&t.jsxs("section",{className:"notices-block","data-help":"notices-due",children:[t.jsx("h3",{className:"notices-when",children:n("Needs you")}),t.jsx("div",{className:"notice-list",children:I.map(e=>{const a=h.get(e.taskId);return t.jsxs("button",{type:"button",className:`notice-row due ${e.kind}`,"data-ctx":`task:${e.taskId}`,onClick:()=>T(e.taskId),children:[t.jsx("span",{className:"notice-mark","aria-hidden":"true",children:a?t.jsx(K,{state:a.state,size:15}):null}),t.jsxs("span",{className:"notice-text",children:[t.jsx("span",{className:"notice-line",children:e.title}),t.jsxs("span",{className:"notice-sub",children:[t.jsx("span",{className:e.kind==="late"?"late":"",children:e.kind==="late"?n("overdue"):e.kind==="today"?n("due today"):n("due tomorrow")}),e.on&&` · ${P(e.on)}`,a&&l(a)&&` · ${l(a)}`]})]})]},e.id)})})]}),t.jsxs("section",{className:"notices-block",children:[t.jsx("div",{className:"notices-filters","data-help":"notices-filters",children:U.map(e=>t.jsxs("button",{type:"button",className:`tfilter ${c===e.key?"on":""}`,"aria-pressed":c===e.key,onClick:()=>L(e.key),children:[n(e.label),!!e.n&&t.jsx("span",{className:"tfilter-n",children:e.n})]},e.key))}),v.length===0?t.jsx("p",{className:"hint pad",children:i.length===0?n("Nothing yet. A task handed to you, a reply in a conversation, a change to work of yours — all of it appears here."):n(y?"Nothing matches":"Nothing under this filter.")}):u.map(({day:e,rows:a})=>t.jsxs("div",{children:[t.jsx("h3",{className:"notices-when",children:z(e)}),t.jsx("div",{className:"notice-list",children:a.map(s=>t.jsxs("button",{type:"button",className:`notice-row ${s.read?"":"unread"} ${o(s)?"said":""}`,"data-ctx":`task:${s.taskId}`,onClick:()=>T(s.taskId),title:E(s.at),children:[t.jsx("span",{className:"notice-mark","aria-hidden":"true",children:s.byPerson?t.jsx(Q,{person:{id:s.byPerson,fullName:s.byName??"",photoVersion:s.byPhoto},size:26}):t.jsx("span",{className:"notice-ava",children:(s.byName??"?").trim().charAt(0).toUpperCase()})}),t.jsxs("span",{className:"notice-text",children:[t.jsxs("span",{className:"notice-line",children:[s.byName&&t.jsx("strong",{children:s.byName})," ",s.kind==="mention"?n(s.data.text?"mentioned you":"mentioned you in the description"):o(s)?n("wrote in the conversation"):A(s)]}),o(s)&&!!s.data.text&&t.jsx("span",{className:"notice-said",children:H(String(s.data.text))}),t.jsxs("span",{className:"notice-sub",children:[s.taskTitle,l(s)&&` · ${l(s)}`]})]}),t.jsx("span",{className:"notice-at",children:O(s.at)})]},s.id))})]},e))]})]})}export{ee as NoticesView};

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.