Build 533169stable
Module 672341
7,014 characters · in 3ee4253b98e73f4f.jsDependencies
Required by (1)
Lazily required by (0)none
Requires (53)
58149647006614974114221059222823265869287809309010311907321073326337327337349435357179371741375901378570381941383233397927405269432371452082454148486227513272540385613907626360627968636922637384640708652176652215655377661191667532675171715757718468775602806621816144829444843472857069881020922529927813928764985018
Lazily requires (0)none
Source Raw
function(e,t,n){n.d(t,{A:()=>en}),n(321073),n(667532);var i=n(627968),l=n(64700),a=n(311907),s=n(397927),r=n(843472),o=n(432371),c=n(775602),d=n(58149),u=n(486227),h=n(454148),m=n(718468),A=n(655377),g=n(816144),p=n(928764),_=n(640708),f=n(265869),E=n(715757),C=n(378570),x=n(349435),S=n(452082),I=n(357179),T=n(74114),v=n(221059),N=n(513272),y=n(881020),b=n(637384),j=n(383233),R=n(222823),M=n(309010),L=n(287809),D=n(405269),O=n(927813),P=n(661191),k=n(326337),w=n(375901),U=n(857069),G=n(675171),F=n(806621),B=n(636922),H=n(371741),V=n(66149),W=n(922529),K=n(652176),z=n(540385),Y=n(613907),J=n(829444),q=n(626360),$=n(381941),Z=n(652215),X=n(327337),Q=n(985018);function ee(e){return null!=e&&e.type===Z.TZK.MESSAGE&&e.content.id===e.groupId}let et=l.memo(function(e){let{file:t,channel:n,user:l,isGroupStart:a,compact:s}=e;return(0,i.jsx)(B.A,{compact:s,isGroupStart:a,channel:n,message:new j.Ay({id:t.id,key:`pending-upload-${t.id}`,type:Z.lAJ.DEFAULT,author:l,channel_id:n.id,customRenderedContent:{hasSpoilerEmbeds:!1,hasBailedAst:!1,content:(0,i.jsx)(m.e,{channelId:n.id,file:t})}})})});function en(e){let t,n,{channel:l,messages:m,unreadCount:B,showNewMessagesBar:en,messageDisplayCompact:ei,channelStream:el,uploads:ea,scrollManager:es,specs:er,filterAfterTimestamp:eo,showingQuarantineBanner:ec,hideSummaries:ed,jumpBarClassName:eu}=e,eh=L.default.getCurrentUser(),em=()=>es.isInitialized()||m.ready,eA=(0,F.r)(l),eg=m.length>0&&m.first()?.isFirstMessageInForumPost(l),ep=(0,o.cI)(l),e_=(0,a.bG)([N.A],()=>N.A.shouldShowTopicsBar()&&!ed),ef=(0,T.l)(l.id),eE=(0,S.j)(l.id,X.Rx),eC=(0,u.E)(l.id),ex=(0,G.A)(),eS=function(e,t){if(e.isDM()&&null!=t)if(t.type===x._j.STRANGER_DANGER)return(0,i.jsx)(v.e,{channelId:e.id,warningId:t.id,senderId:e.getRecipientId()});else if(t.type===x._j.LIKELY_ATO)return(0,i.jsx)(h.L,{channelId:e.id,warningId:t.id,senderId:e.getRecipientId()});else return(0,i.jsx)(I._,{channelId:e.id,warningId:t.id,senderId:e.getRecipientId()});return null}(l,ef??eE??eC),eI=l.isForumPost()&&!eg?(0,i.jsx)(p.A,{postId:l.id}):null,eT=(0,f.A)(l.id),ev=(0,E.W1)(l);(0,J.A)();let eN=null,ey=[],eb=el.map((e,t)=>{if(e.type===Z.TZK.DIVIDER){let n=null!=e.unreadId;return null!=eo?null:e.isConversationDivider?(0,i.jsx)(A.A,{index:t,item:e,channel:l},`conv-divider-${e.contentKey??t}`):e.isSummaryDivider?(0,i.jsx)(b.A,{index:t,item:e,channel:l,isBeforeGroup:null==e.content&&ee(el[t+1])}):(0,i.jsx)(W.A,{isUnread:n,isBeforeGroup:null==e.content&&ee(el[t+1]),id:n?$.q4:void 0,itemId:null!=e.content?`divider-${e.contentKey??t}`:void 0,children:e.content},`divider-${e.contentKey??e.unreadId??t}`)}if(e.type===Z.TZK.FORUM_POST_ACTION_BAR)return(0,i.jsx)(p.A,{parentChannelId:l.parent_id,postId:l.id,isLastItem:t+1===el.length,isFirstMessage:!0},`forum-post-action-bar-${l.id}`);if(e.type===Z.TZK.MESSAGE_GROUP_BLOCKED||e.type===Z.TZK.MESSAGE_GROUP_IGNORED||e.type===Z.TZK.MESSAGE_GROUP_SPAMMER||e.type===Z.TZK.MESSAGE_GROUP_SUSPENDED_USER){let t,n=!0;return e.type===Z.TZK.MESSAGE_GROUP_BLOCKED?t=Q.t["+FcYM/"]:e.type===Z.TZK.MESSAGE_GROUP_IGNORED?t=Q.t["VFWjc+"]:e.type===Z.TZK.MESSAGE_GROUP_SUSPENDED_USER?(t=Q.t.rHRovo,n=!1):t=Q.t.xfkfTK,(0,i.jsx)(V.A,{unreadId:$.q4,messages:e,channel:l,compact:ei,collapsedReason:t,canUncollapse:n},e.key)}if(null!=eo&&eo>e.content.timestamp.getTime()*O.A.Millis.SECOND)return;e.type===Z.TZK.MESSAGE&&null==eN&&(eN=e);let n=e.groupId===eN?.groupId?eN.content.id:e.groupId,a=ev&&e.content.isFirstMessageInForumPost(l),s=e.type===Z.TZK.THREAD_STARTER_MESSAGE?H.VO:H.Ay;return(0,i.jsx)(s,{compact:ei&&!a,channel:l,message:e.content,groupId:n,flashKey:e.flashKey,id:(0,w.j)(l.id,e.content.id),isLastItem:t>=el.length-1,renderContentOnly:eT||a},e.content.id)});ey.push(...eb);let ej=el[el.length-1];if(null!=eh&&ea.forEach((e,t)=>{let n=0===t&&(0,U.l)(l,ej,new j.Ay({type:Z.lAJ.DEFAULT,author:eh}));ey.push((0,i.jsx)(et,{file:e,channel:l,user:eh,isGroupStart:n,compact:ei},`upload-${e.id}`))}),m.hasMoreBefore&&null==eo){m.length>0&&ey.unshift((0,i.jsx)("div",{style:{height:$.N0,flex:"0 0 auto"}},"buffer"));let{useReducedMotion:e}=c.A;(e&&em()||!e)&&ey.unshift((0,i.jsx)(z.Ay,{compact:ei,...er},"has-more"))}if(m.hasMoreBefore&&null==eo||ey.unshift((0,i.jsx)(g.A,{channel:l,showingBanner:ec},"empty-message")),m.hasMoreAfter&&ey.push((0,i.jsx)(z.Ay,{compact:ei,...er},"has-more-after")),!ec&&eA&&em()&&ey.push((0,i.jsx)(Y.A,{channel:l})),B>0&&en&&em()){let e,n,a=R.Ay.getOldestUnreadTimestamp(l.id),r=0!==a?a:P.default.extractTimestamp(l.id),c=(0,D.ro)(new Date,new Date(r));if(R.Ay.isEstimated(l.id)?(e=c?Q.t.wvtbbG:Q.t.tHqbtg,n=Q.t.vaPWFe):(e=c?Q.t["BctFH/"]:Q.t["3wXb9P"],n=Q.t["4H8ldG"]),ep&&(0,o.Kc)(l)&&ex.includes(q.i.SUMMARIES)){let a=R.Ay.ackMessageId(l.id),c=(0,y.L)(l.id,R.Ay.getOldestUnreadMessageId(l.id));if((0,d.zV)(Z.HAw.SUMMARIES_UNREAD_BAR_VIEWED,{num_unread_summaries:c,num_unread_messages:B,last_ack_message_id:a,summaries_enabled_by_user:e_,summaries_enabled_for_channel:(0,o.pk)(l)}),(0,o.pk)(l)){let a=e_?Q.intl.format(n,{count:B}):Q.intl.format(e,{count:B,timestamp:r});if(e_){let e=c>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Text,{variant:"text-sm/medium",color:"currentColor",children:Q.intl.format(n,{count:B})}),(0,i.jsx)(_.A,{style:{paddingLeft:8,paddingRight:8},height:4,width:4}),(0,i.jsx)(s.Text,{variant:"text-sm/medium",color:"currentColor",children:Q.intl.format(Q.t.CBftDc,{count:c})})]}):(0,i.jsx)(s.Text,{variant:"text-sm/medium",color:"currentColor",children:a});t=(0,i.jsx)(K.OZ,{scrollManager:es,content:e,channel:l})}else{let e=(0,i.jsx)("div",{style:{display:"flex",textTransform:"none",alignItems:"center"},children:c>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Text,{variant:"text-sm/medium",color:"currentColor",children:Q.intl.format(n,{count:B})}),(0,i.jsx)(_.A,{style:{paddingLeft:8,paddingRight:8},height:4,width:4}),(0,i.jsx)(s.Text,{variant:"text-sm/medium",color:"currentColor",children:Q.intl.format(Q.t.CBftDc,{count:c})})]}):(0,i.jsx)(s.Text,{variant:"text-sm/medium",color:"currentColor",children:a})});t=(0,i.jsx)(K.GN,{content:e,channelId:l.id})}}}else ex.includes(q.i.NEW_MESSAGES)&&(t=(0,i.jsx)(K.GN,{content:Q.intl.format(e,{count:B,timestamp:r}),channelId:l.id}))}if(null==t&&(0,o.pk)(l)&&e_&&ex.includes(q.i.SUMMARIES)&&(t=(0,i.jsx)(K.UK,{channel:l,scrollManager:es})),m.error)n=(0,i.jsx)(K.Ez,{loading:m.loadingMore,onClick:()=>{var e;return e=l.id,void r.A.fetchMessages({channelId:e,limit:(0,k.h)("renderStream.reload"),truncate:!0})},className:eu});else if(m.hasMoreAfter&&em()){let{jumpReturnTargetId:e}=m;n=m.loadingMore&&m.jumpedToPresent?(0,i.jsx)(K.Ab,{className:eu}):null!=e?(0,i.jsx)(K.Ab,{type:K.ks.REPLY,onClick:()=>{r.A.jumpToMessage({channelId:l.id,messageId:e,flash:!0})},className:eu}):(0,i.jsx)(K.Ab,{onClick:()=>{let e;return r.A.jumpToPresent(l.id,(0,k.h)("renderStream.jumpToPresent")),e=M.A.getChannelId(),void(l.id===e&&(0,C.iN)(l.id))},className:eu})}return{channelStreamMarkup:ey,newMessagesBar:t,jumpToPresentBar:n,forumPostActionBar:eI,safetyWarningBanner:eS}}}