Loading
function(e,n,t){t.d(n,{A:()=>q}),t(321073);var l=t(477900),i=t(582128),a=t(855986),s=t(789645),r=t(442433),o=t(738876),c=t(323073),u=t(149468),d=t(889812),h=t(973854),g=t(265872),m=t(165862),A=t(477782),p=t(365199),j=t(58736),f=t(287074),x=t(976860),N=t(494208),b=t(964167),C=t(792996);function I(){let[e,n]=i.useState(!1),t=i.useRef(null),a=C.intl.string(C.t["UKOtz+"]);return(0,l.jsx)(g.Y,{targetElementRef:t,shouldShow:e,animation:g.Y.Animation.NONE,position:"bottom",align:"right",autoInvert:!1,onRequestClose:()=>n(!1),renderPopout:e=>{let{closePopout:n}=e;return(0,l.jsx)(m.W,{"data-menu-migrated":!0,navId:"app-channel-chat-panel-overflow",onClose:n,onSelect:n,"aria-label":C.intl.string(C.t.Xm41aV),children:(0,l.jsx)(A.rX,{children:(0,l.jsx)(A.Dr,{id:"app-channel-open-in-full-view",label:C.intl.string(C.t.IxVmZi),action:()=>(0,x.pX)((0,b.gu)((0,x.JK)().location.pathname))})})})},children:(e,i)=>{let{isShown:s}=i;return(0,l.jsx)(j.Ay.Icon,{...e,ref:t,onClick:()=>n(e=>!e),tooltip:s?null:a,icon:p.MoreHorizontalIcon,"aria-label":a,selected:s})}})}function E(e){let{channel:n}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(N.A,{channel:n}),(0,l.jsx)(f.A,{channel:n}),(0,l.jsx)(I,{})]})}var _=t(355622),y=t(225142),T=t(701785),S=t(885071),v=t(187360),k=t(353428),R=t(857071),G=t(138298),L=t(288254),P=t(873614),O=t(522556),w=t(734057),D=t(31717),B=t(71393),H=t(596344),F=t(188567),U=t(47167),V=t(5206),Y=t(652215),M=t(172039);function q(e){let{channelId:n,baseChannelId:g,channelViewSource:m="Split View",isResourceChannelView:A}=e,p=(0,a.bG)([w.A],()=>w.A.getChannel(n)),f=(0,a.bG)([B.A],()=>B.A.getGuild(p?.getGuildId())),N=(0,U.Ay)(p),b=(0,a.bG)([R.A],()=>f?.id!=null&&R.A.isLurking(f.id),[f]),I=(0,S.A)(n),q=(0,a.bG)([T.h],()=>T.h.getResourceForChannel(f?.id,n)?.title),X=(0,c.vL)(p),z=(0,L.Uf)(p),K=i.useRef(!1);if(i.useEffect(()=>{null==p||K.current||(K.current=!0,(0,u.zV)(Y.HAw.CHANNEL_OPENED,{...(0,d.q)(p.id),channel_view:m}),(0,h.A)({channelId:p.id}))},[p,m]),null==p||null==f&&!p.isPrivate())return null;let W=n===g,$=[];b||W||$.push((0,l.jsx)(v.A,{channel:p},"notifications"));let J=W&&p.type===Y.rbe.GUILD_APP;return(J&&$.push((0,l.jsx)(E,{channel:p},"app-channel")),$.push((0,l.jsx)(j.Ay.Icon,{icon:s.XSmallIcon,tooltip:C.intl.string(C.t.cpT0Cq),onClick:()=>{G.A.closeChannelSidebar(g),J&&F._.dispatch(Y.jej.FOCUS_CHAT_BUTTON)}},"close")),X)?(0,l.jsx)(O.A,{guild:f,channelId:p.id}):null!=z?(0,l.jsx)(P.A,{guild:f,channelId:z}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.A,{channel:p,draftType:D.C.ChannelMessage}),(0,l.jsx)(j.Ay,{toolbar:$,"aria-label":C.intl.string(C.t.BIYAqa),children:(0,k.zF)({channel:p,channelName:I?q:N,guild:f,inSidebar:!0,handleContextMenu:function(e){null!=p&&null!=f&&(0,r.L3)(e,async()=>{let{default:e}=await Promise.all([t.e(926132),t.e(382563),t.e(947502),t.e(343266),t.e(309004),t.e(412255),t.e(63340),t.e(430997),t.e(379995),t.e(544058),t.e(591377),t.e(35723),t.e(256372),t.e(29542),t.e(135610)]).then(t.bind(t,834881));return n=>(0,l.jsx)(e,{...n,channel:p,guild:f})})},handleClick:W?void 0:function(){if(null==p)return;let e=H.A.getMessages(p.id);if(A){(0,x.pX)(Y.BVt.CHANNEL(p.guild_id,p.id)),(0,y.bN)(p.guild_id,null);return}(0,x.uh)(p.guild_id,p.id,e.jumpTargetId)}})}),(0,l.jsx)("div",{className:M.T,children:(0,l.jsx)(V.A,{channel:p,guild:f,chatInputType:_.oU.SIDEBAR},n)})]})}}