"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[745],{30708:(e,a,t)=>{t.d(a,{Bq:()=>i,Gn:()=>n,H4:()=>c,wx:()=>l}),t(43617),t(81975),t(93991);var s=t(95106),r=t(8361);function n(e){const{byId:a,allIds:t}=e.entities.recaps;return t.map((e=>a[e]))}(0,r.Mz)("getRecapsByStatus",n,((e,a)=>a),((e,a)=>e.filter((e=>e.status===a)))),(0,r.Mz)("getSortedRecaps",n,(e=>[...e].sort(((e,a)=>a.create_at-e.create_at)))),(0,r.Mz)("getCompletedRecaps",n,(e=>e.filter((e=>e.status===s.A.COMPLETED)).sort(((e,a)=>a.create_at-e.create_at)))),(0,r.Mz)("getPendingRecaps",n,(e=>e.filter((e=>e.status===s.A.PENDING||e.status===s.A.PROCESSING))));const l=(0,r.Mz)("getUnreadRecaps",n,(e=>e.filter((e=>0===e.read_at)).sort(((e,a)=>a.create_at-e.create_at)))),c=(0,r.Mz)("getReadRecaps",n,(e=>e.filter((e=>e.read_at>0)).sort(((e,a)=>a.read_at-e.read_at)))),i=(0,r.Mz)("getUnreadFinishedRecapsBadge",(e=>e.entities.recaps),(e=>{let{byId:a,allIds:t}=e,r=0,n=!1;for(const e of t){const t=a[e];t&&0===t.viewed_at&&(t.status===s.A.COMPLETED?r++:t.status===s.A.FAILED&&(r++,n=!0))}return{count:r,hasFailed:n}}))},30745:(e,a,t)=>{t.r(a),t.d(a,{default:()=>_});var s=t(71633),r=t.n(s),n=t(36418),l=t.n(n),c=t(14778),i=t(37270),d=t(81911),o=t(85406),p=t(49664),u=t(30708),m=t(14776),E=t(7430),b=t(45222),f=t(45697);const I=(0,c.defineMessage)({id:"recaps.sidebarLink.failedTooltip",defaultMessage:"One or more recaps failed"}),_=()=>{const{formatMessage:e}=(0,c.useIntl)(),{url:a}=(0,d.useRouteMatch)(),{pathname:t}=(0,d.useLocation)(),s=(0,i.useSelector)(m.Sy),n=(0,i.useSelector)(E.WR),{count:_,hasFailed:g}=(0,i.useSelector)(u.Bq,i.shallowEqual),M=(0,b.A)("EnableAIRecaps"),h=null!=(0,d.matchPath)(t,{path:"/:team/recaps/:recapId?"});if(!s||!n||"true"!==M)return null;const R=_>0;return l().createElement("ul",{className:"SidebarRecaps NavGroupContent nav nav-pills__container"},l().createElement("li",{id:"sidebar-recaps-button",className:r()("SidebarChannel",{active:h,unread:R}),tabIndex:-1},l().createElement(d.Link,{to:`${a}/recaps`,id:"sidebarItem_recaps",draggable:"false",className:r()("SidebarLink sidebar-item",{"unread-title":R}),tabIndex:0},l().createElement("span",{className:"icon"},l().createElement(o.CreationOutlineIcon,{size:18})),l().createElement("div",{className:"SidebarChannelLinkLabel_wrapper"},l().createElement("span",{className:"SidebarChannelLinkLabel sidebar-item__name"},l().createElement(c.FormattedMessage,{id:"recaps.sidebarLink",defaultMessage:"Recaps"}))),R&&(g?l().createElement(p.WithTooltip,{title:I},l().createElement("span",{className:"RecapsFailedIcon","aria-label":e(I)},l().createElement(o.AlertOutlineIcon,{size:14}))):l().createElement(f.A,{unreadMentions:_})))))}},95106:(e,a)=>{var t;a.A=void 0,function(e){e.PENDING="pending",e.PROCESSING="processing",e.COMPLETED="completed",e.FAILED="failed"}(t||(a.A=t={}))}}]);
//# sourceMappingURL=745.e1fb6143fdb16ac4c37d.js.map