"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[1428],{71428:(e,a,t)=>{t.r(a),t.d(a,{default:()=>g});var n=t(71633),r=t.n(n),l=t(36418),s=t.n(l),c=t(14778),o=t(37270),i=t(81911),d=t(71892),u=t(77440),m=t(62563),h=t(2386),b=t(75270),p=t(45697),C=t(78451),_=t(3295);t(29206);const k=e=>s().createElement("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 14 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s().createElement("path",{d:"M11.7952 0.00524884C12.1312 0.00524884 12.4144 0.125249 12.6448 0.365248C12.8848 0.595648 13.0048 0.878848 13.0048 1.21485V8.41485C13.0048 8.75085 12.8848 9.03405 12.6448 9.26445C12.4144 9.49485 12.1312 9.61005 11.7952 9.61005H3.4L0.9952 12.0148V1.21485C0.9952 0.878848 1.1104 0.595648 1.3408 0.365248C1.5808 0.125249 1.8688 0.00524884 2.2048 0.00524884H11.7952ZM2.2048 1.21485V9.10605L2.896 8.41485H11.7952V1.21485H2.2048ZM3.4 3.01485H10.6V4.21005H3.4V3.01485ZM3.4 5.40525H8.8V6.61485H3.4V5.40525Z"}));var f=t(3490);const g=()=>{const{formatMessage:e}=(0,c.useIntl)(),a=(0,o.useDispatch)(),t=(0,o.useSelector)(u.WW),{url:n}=(0,i.useRouteMatch)(),{pathname:g}=(0,i.useLocation)(),v=null!=(0,i.matchPath)(g,{path:"/:team/threads/:threadIdentifier?"}),{currentTeamId:I,currentUserId:E}=(0,f.K)(),w=(0,o.useSelector)(m.kL),S=null==w?void 0:w.total_unread_threads,L=(0,o.useSelector)(b.A),H=(0,o.useSelector)(b.bM),M=(0,l.useCallback)((e=>{e.stopPropagation(),performance.mark(_.CU.GlobalThreadsLinkClicked),L&&H===C._n.EDIT_HISTORY&&a((0,h.bP)())}),[L,H]);return(0,l.useEffect)((()=>{t&&a((0,d.H_)(E,I))}),[E,I,t]),t?s().createElement("ul",{className:"SidebarGlobalThreads NavGroupContent nav nav-pills__container"},s().createElement("li",{id:"sidebar-threads-button",className:r()("SidebarChannel",{active:v,unread:S}),tabIndex:-1},s().createElement(i.Link,{onClick:M,to:"".concat(n,"/threads"),id:"sidebarItem_threads",draggable:"false",className:r()("SidebarLink sidebar-item",{"unread-title":Boolean(S)}),tabIndex:0},s().createElement("span",{className:"icon"},s().createElement(k,null)),s().createElement("div",{className:"SidebarChannelLinkLabel_wrapper"},s().createElement("span",{className:"SidebarChannelLinkLabel sidebar-item__name"},e({id:"globalThreads.sidebarLink",defaultMessage:"Threads"}))),(null==w?void 0:w.total_unread_mentions)>0&&s().createElement(p.A,{unreadMentions:w.total_unread_mentions,hasUrgent:Boolean(null==w?void 0:w.total_unread_urgent_mentions)})))):null}},3490:(e,a,t)=>{t.d(a,{K:()=>o}),t(3188),t(59297);var n=t(36418),r=t(37270),l=t(81911),s=t(14776),c=t(7430);function o(){const e=(0,l.useParams)(),a=(0,n.useMemo)((()=>e),[e.threadIdentifier,e.team]),t=(0,l.useHistory)(),o=(0,r.useSelector)(s.Sy,r.shallowEqual),i=(0,r.useSelector)(c.WR,r.shallowEqual),d=(0,n.useCallback)((e=>t.push("/".concat(a.team,"/threads").concat(e?"/"+e:""))),[a.team]),u=(0,n.useCallback)((()=>t.replace("/".concat(a.team,"/threads"))),[a.team]),m=(0,n.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.team;return t.push("/".concat(n,"/pl/").concat(null!=e?e:a.threadIdentifier))}),[a.threadIdentifier,a.team]);return{params:a,history:t,currentTeamId:o,currentUserId:i,clear:u,select:d,goToInChannel:m}}}}]);
//# sourceMappingURL=1428.e00bb22210de7a5edc5e.js.map