Build 618874stable
Module 355216
1,572 characters · in f276b460ada933b3.jsDependencies
Source Raw
function(e,n,t){t.d(n,{HN:()=>E,ux:()=>p});var i=t(477900),s=t(582128),a=t(503698),o=t.n(a),r=t(17928),l=t(812993),u=t(85463),d=t(834730),c=t(409686),h=t(851109),b=t(599486),g=t(394953),T=t(849077);t(445368);var m=t(445382);function E(){let{setSelectedFilter:e}=(0,b.A)();return()=>{e(T.Io.ALL)}}function p(e){let n,t,a,{isSelected:b}=e,{unreadRecentMentionsCount:T,unreadChannelIds:E}=(0,g.U4)(),p=(n=function(){let{unreadRecentMentionsCount:e}=(0,g.U4)(),{hasMoreMentions:n,mentionsLoading:t}=(0,r.cf)([c.Ay],()=>({hasMoreMentions:c.Ay.hasMore,mentionsLoading:c.Ay.loading})),i=Math.min(e,25),s=e>i||n||t,a=(0,l.o6)(i)+6*!!s;return{clampedCount:i,isEstimated:s,width:a}}(),t=s.useCallback(e=>n.isEstimated?`${e}+`:e,[n.isEstimated]),a=s.useMemo(()=>(function(e,n){let{clampedCount:t,width:s}=e;return(0,i.jsx)(l.hV,{count:t,renderBadgeCount:n,style:{width:s},className:m.xF})})(n,t),[n,t]),s.useMemo(()=>({badge:a,badgeType:"mentions",dimensions:{height:16,width:n.width}}),[a,n.width])),{entrypoint:_}=(0,h.X8)({location:"useInboxBadgeInfo"}),A=(0,u.N)();return s.useMemo(()=>{if(T>0)return p;let e=E.length;if(0===e)return{badge:null,badgeType:null};if(_===h.RK.SERVER_RAIL_TOP){let n,t=(0,l.o6)(e)-3;return{badge:(n=(0,l.o6)(e)-3,(0,i.jsx)(l.hV,{count:e,style:{width:n,lineHeight:13,height:13,minHeight:13,minWidth:13},className:o()(m.xF,m.pw,{[m.wH]:b})})),badgeType:"unread",dimensions:{height:13,width:t}}}return _===h.RK.TITLE_BAR_LEFT?{badge:(0,i.jsx)(d.E,{variant:A,children:(0,l.Gu)(e)}),badgeType:"unread"}:{badge:null,badgeType:null}},[T,p,E.length,_,b,A])}}