"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[766],{47800:(e,t,n)=>{n.d(t,{Z:()=>r,s:()=>o}),n(14078);var a=n(84390),i=n(72060);const s=4e3;function r(e){const[t,n]=(0,a.useState)(!1),[i,r]=(0,a.useState)(!1),o=(0,a.useRef)(null);let l=s;return(e.successCopyTimeout||0===e.successCopyTimeout)&&(l=e.successCopyTimeout),{copiedRecently:t,copyError:i,onClick:(0,a.useCallback)((()=>{e.trackCallback&&e.trackCallback(),o.current&&(clearTimeout(o.current),o.current=null);const t=navigator.clipboard;if(t)t.writeText(e.text).then((()=>{n(!0),r(!1)})).catch((()=>{n(!1),r(!0)}));else{const t=document.createElement("textarea");t.innerText=e.text,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();try{const e=document.execCommand("copy");n(e),r(!e)}catch(e){n(!1),r(!0)}t.remove()}o.current=setTimeout((()=>{n(!1),r(!1)}),l)}),[e.text,l])}}const o=(0,i.defineMessages)({copy:{id:"copy_text.copy",defaultMessage:"Copy"},copied:{id:"copy_text.copied",defaultMessage:"Copied"}})},61782:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(23615),i=n.n(a),s=(n(40895),n(84390)),r=n.n(s);const o=e=>r().createElement("svg",{width:e.width?e.width.toString():"110",height:e.height?e.height.toString():"100",viewBox:"0 0 110 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r().createElement("path",{d:"M26.4736 81.0278C23.2554 81.0278 21.7973 78.708 23.2333 75.8728L49.2438 24.7796C50.7166 21.9517 53.0364 21.9517 54.4798 24.7796L80.483 75.8728C81.9558 78.7006 80.483 81.0278 77.2427 81.0278H26.4736Z",fill:"#FFBC1F"}),r().createElement("path",{d:"M47.7783 43.6764L50.4515 61.6378C50.4773 61.9942 50.6371 62.3276 50.8988 62.571C51.1604 62.8144 51.5045 62.9497 51.8618 62.9497C52.2192 62.9497 52.5632 62.8144 52.8249 62.571C53.0865 62.3276 53.2463 61.9942 53.2721 61.6378L55.9453 43.6764C56.4314 36.673 47.2849 36.673 47.7783 43.6764Z",fill:"#2D3039"}),r().createElement("path",{d:"M51.8582 64.8853C52.6677 64.8867 53.4586 65.1281 54.1309 65.5789C54.8033 66.0297 55.327 66.6697 55.6358 67.418C55.9446 68.1663 56.0246 68.9893 55.8657 69.7831C55.7069 70.5769 55.3164 71.3058 54.7435 71.8777C54.1706 72.4496 53.441 72.8388 52.6469 72.9962C51.8529 73.1536 51.03 73.0721 50.2822 72.7619C49.5345 72.4518 48.8954 71.927 48.4458 71.2538C47.9963 70.5806 47.7563 69.7893 47.7563 68.9798C47.7563 68.4415 47.8624 67.9084 48.0686 67.4112C48.2749 66.9139 48.5772 66.4622 48.9582 66.0819C49.3392 65.7016 49.7914 65.4002 50.2891 65.1948C50.7867 64.9895 51.3199 64.8843 51.8582 64.8853Z",fill:"#2D3039"}));o.propTypes={width:i().number.isRequired,height:i().number.isRequired};const l=o},18161:(e,t,n)=>{n.r(t),n.d(t,{default:()=>na});var a=n(70314),i=n(9448),s=n(36891),r=n(43618),o=n(11298),l=n(39183),c=n(73737),d=n(84459),h=n(23712),u=n(23615),m=n.n(u),p=(n(92189),n(60042)),g=n.n(p),b=n(84390),f=n.n(b),E=n(28176),_=n(73443),v=n(97042),C=n(66900),y=n(84073),R=n(23894),N=n(33115),M=n(20827),x=n(40364),P=n(61057),T=n(30368),w=n(70174),S=n(85939),I=n.n(S),H=n(11796),k=n(27085),q=n(34208),A=n(34097),F=n(24036),L=n(41894),B=(n(95623),n(61514),n(72060)),O=n(27468);const Z=I().button.withConfig({displayName:"EditButton"})(["border:0;margin:0px;padding:0px;border-radius:4px;background:rgba(var(--center-channel-color-rgb),0.04);color:rgba(var(--center-channel-color-rgb),0.75);&:hover{background:rgba(var(--center-channel-color-rgb),0.08);color:rgba(var(--center-channel-color-rgb),0.75);}width:24px;height:24px;i.icon{font-size:14.4px;}"]),D=I().button.withConfig({displayName:"EmptyPlace"})(["padding:0px;background:transparent;border:0px;color:rgba(var(--center-channel-color-rgb),0.75);i{display:none;font-size:14px;margin-left:4px;}&:hover{color:rgba(var(--center-channel-color-rgb),0.75);i{display:inline-block;}}"]),U=e=>{let{editable:t,content:n,emptyLabel:a,onEdit:i,className:s}=e;const{formatMessage:r}=(0,B.useIntl)(),o=t&&n;return f().createElement("div",{className:s},f().createElement("div",{className:"EditableArea__content"},n,!n&&t&&f().createElement(D,{onClick:i,"aria-label":r({id:"channel_info_rhs.edit_link",defaultMessage:"Edit"})},a,f().createElement("i",{className:"icon icon-pencil-outline edit-icon"}))),f().createElement("div",{className:"EditableArea__edit"},o?f().createElement(Z,{onClick:i,"aria-label":r({id:"channel_info_rhs.edit_link",defaultMessage:"Edit"})},f().createElement("i",{className:"icon icon-pencil-outline"})):""))};U.propTypes={editable:m().bool.isRequired,content:m().node.isRequired,emptyLabel:m().string.isRequired,onEdit:m().func.isRequired,className:m().string};const V=I()(U).withConfig({displayName:"EditableArea"})(["display:flex;&>.EditableArea__content{flex:1;p:last-child{margin-bottom:0;}}&:hover{&>.EditableArea__edit{visibility:visible;}}&>.EditableArea__edit{visibility:hidden;width:24px;}"]);n(14078);var z=n(82365);const G=e=>{let{children:t,maxLines:n,lineHeight:a,moreText:i,lessText:s,errorMargin:r=.1,className:o}=e;const l=n*a,[c,d]=(0,b.useState)(!1),[h,u]=(0,b.useState)(!1),[m,p]=(0,b.useState)("inherit"),g=(0,b.useRef)(null);return(0,b.useEffect)((()=>{if(null===g||null===g.current)return;const e=g.current.scrollHeight;e>l+l*r?(d(!0),p("".concat(h?e:l,"px"))):(d(!1),p("inherit"))}),[t,h]),f().createElement(z.Z,{in:h,timeout:500,classNames:"LineLimiter--Transition-"},f().createElement(f().Fragment,null,f().createElement("div",{className:o,style:{maxHeight:m}},f().createElement("div",null,f().createElement("div",{ref:g},t))),c&&f().createElement(j,{className:"LineLimiter__toggler",onClick:()=>u(!h)},h?s:i)))};G.propTypes={children:m().node.isRequired,maxLines:m().number.isRequired,lineHeight:m().number.isRequired,moreText:m().string.isRequired,lessText:m().string.isRequired,className:m().string,errorMargin:m().number};const j=I().button.withConfig({displayName:"ToggleButton"})(["border:0px;background-color:var(--center-channel-bg);color:var(--button-bg);padding:0;margin:0;"]),W=I()(G).withConfig({displayName:"LineLimiter"})(["transition:max-height 0.5s ease;line-height:","px;overflow:hidden;p{margin-bottom:","px;}span[data-emoticon]{max-height:","px;.emoticon{max-height:","px;min-height:","px;}}.markdown-inline-img__container img.markdown-inline-img{max-height:","px !important;margin-top:0 !important;margin-bottom:0 !important;}& > *{overflow:hidden;}"],(e=>e.lineHeight),(e=>e.lineHeight),(e=>e.lineHeight),(e=>e.lineHeight),(e=>e.lineHeight),(e=>e.lineHeight)),J=I().div.withConfig({displayName:"ChannelId"})(["margin-bottom:12px;font-size:11px;line-height:16px;letter-spacing:0.02em;color:rgba(var(--center-channel-color-rgb),0.75);"]),K=I().div.withConfig({displayName:"ChannelPurpose"})(["margin-bottom:12px;&.ChannelPurpose--is-dm{margin-bottom:16px;}"]),Y=I().div.withConfig({displayName:"ChannelDescriptionHeading"})(["color:rgba(var(--center-channel-color-rgb),0.75);font-size:12px;font-style:normal;font-weight:600;line-height:16px;letter-spacing:0.24px;text-transform:uppercase;padding:6px 0px;"]),Q=I().div.withConfig({displayName:"ChannelHeader"})(["margin-bottom:12px;"]),$=e=>{let{channel:t,canEditChannelProperties:n,actions:a}=e;const{formatMessage:i}=(0,B.useIntl)();return f().createElement(f().Fragment,null,(t.purpose||n)&&f().createElement(K,null,f().createElement(Y,null,i({id:"channel_info_rhs.about_area.channel_purpose.heading",defaultMessage:"Channel Purpose"})),f().createElement(V,{editable:n,content:t.purpose&&f().createElement(W,{maxLines:4,lineHeight:20,moreText:i({id:"channel_info_rhs.about_area.channel_purpose.line_limiter.more",defaultMessage:"more"}),lessText:i({id:"channel_info_rhs.about_area.channel_purpose.line_limiter.less",defaultMessage:"less"})},f().createElement(O.Z,{message:t.purpose})),onEdit:a.editChannelPurpose,emptyLabel:i({id:"channel_info_rhs.about_area.add_channel_purpose",defaultMessage:"Add a channel purpose"})})),(t.header||n)&&f().createElement(Q,null,f().createElement(Y,null,i({id:"channel_info_rhs.about_area.channel_header.heading",defaultMessage:"Channel Header"})),f().createElement(V,{content:t.header&&f().createElement(W,{maxLines:4,lineHeight:20,moreText:i({id:"channel_info_rhs.about_area.channel_header.line_limiter.more",defaultMessage:"more"}),lessText:i({id:"channel_info_rhs.about_area.channel_header.line_limiter.less",defaultMessage:"less"})},f().createElement(O.Z,{message:t.header})),editable:n,onEdit:a.editChannelHeader,emptyLabel:i({id:"channel_info_rhs.about_area.add_channel_header",defaultMessage:"Add a channel header"})})),f().createElement(J,null,i({id:"channel_info_rhs.about_area_id",defaultMessage:"ID:"})," ",t.id))};$.propTypes={canEditChannelProperties:m().bool.isRequired,actions:m().shape({editChannelPurpose:m().func.isRequired,editChannelHeader:m().func.isRequired}).isRequired};const X=$;var ee=n(80139),te=n(44967),ne=n(56859),ae=n(90186);const ie=I().p.withConfig({displayName:"Username"})(["font-family:Metropolis,sans-serif;font-size:18px;line-height:24px;color:rgb(var(--center-channel-color-rgb));font-weight:600;margin:0;"]),se=I().div.withConfig({displayName:"ChannelHeader"})(["margin-bottom:12px;"]),re=I().div.withConfig({displayName:"UserInfoContainer"})(["display:flex;align-items:center;margin-bottom:12px;"]),oe=I().div.withConfig({displayName:"UserAvatar"})([".status{bottom:0;right:0;height:18px;width:18px;& svg{min-height:14.4px;}}"]),le=I().div.withConfig({displayName:"UserInfo"})(["margin-left:12px;display:flex;flex-direction:column;"]),ce=I().div.withConfig({displayName:"UsernameContainer"})(["display:flex;gap:8px"]),de=I().div.withConfig({displayName:"UserPosition"})(["line-height:20px;p{margin-bottom:0;}"]),he=I().div.withConfig({displayName:"ChannelId"})(["margin-bottom:12px;font-size:11px;line-height:16px;letter-spacing:0.02em;color:rgba(var(--center-channel-color-rgb),0.75);"]),ue=e=>{let{channel:t,dmUser:n,actions:a}=e;const{formatMessage:i}=(0,B.useIntl)();return f().createElement(f().Fragment,null,f().createElement(re,null,f().createElement(oe,null,f().createElement(te.Z,{src:ee.je.getProfilePictureUrl(n.user.id,n.user.last_picture_update),isBot:n.user.is_bot,status:n.status?n.status:void 0,username:n.display_name,userId:n.user.id,channelId:t.id,size:"xl"})),f().createElement(le,null,f().createElement(ce,null,f().createElement(ie,null,n.display_name),n.user.is_bot&&f().createElement(ne.Z,null),n.is_guest&&f().createElement(ae.Z,null)),f().createElement(de,null,f().createElement(O.Z,{message:n.user.is_bot?n.user.bot_description:n.user.position})))),!n.user.is_bot&&f().createElement(se,null,f().createElement(V,{content:t.header&&f().createElement(W,{maxLines:4,lineHeight:20,moreText:i({id:"channel_info_rhs.about_area.channel_header.line_limiter.more",defaultMessage:"more"}),lessText:i({id:"channel_info_rhs.about_area.channel_header.line_limiter.less",defaultMessage:"less"})},f().createElement(O.Z,{message:t.header})),editable:!0,onEdit:a.editChannelHeader,emptyLabel:i({id:"channel_info_rhs.about_area.add_channel_header",defaultMessage:"Add a channel header"})})),f().createElement(he,null,i({id:"channel_info_rhs.about_area_id",defaultMessage:"ID:"})," ",t.id))};ue.propTypes={actions:m().shape({editChannelHeader:m().func.isRequired}).isRequired};const me=ue;var pe=n(22767);const ge=I().p.withConfig({displayName:"Usernames"})(["font-family:Metropolis,sans-serif;font-size:18px;line-height:24px;color:rgb(var(--center-channel-color-rgb));font-weight:600;margin:0;"]),be=I().div.withConfig({displayName:"ProfilePictures"})(["margin-bottom:10px;"]),fe=I().div.withConfig({displayName:"ProfilePictureContainer"})(["display:inline-block;position:relative;left:","px;& img{border:2px solid white;}"],(e=>-15*e.position)),Ee=I().div.withConfig({displayName:"UsersArea"})(["margin-bottom:12px;&.ChannelPurpose--is-dm{margin-bottom:16px;}"]),_e=I().div.withConfig({displayName:"ChannelHeader"})(["margin-bottom:12px;"]),ve=I().div.withConfig({displayName:"ChannelId"})(["margin-bottom:12px;font-size:11px;line-height:16px;letter-spacing:0.02em;color:rgba(var(--center-channel-color-rgb),0.75);"]),Ce=e=>{let{channel:t,gmUsers:n,actions:a}=e;const{formatMessage:i}=(0,B.useIntl)();return f().createElement(f().Fragment,null,f().createElement(Ee,null,f().createElement(be,null,n.map(((e,n)=>f().createElement(fe,{key:e.id,position:n},f().createElement(te.Z,{src:ee.je.getProfilePictureUrl(e.id,e.last_picture_update),size:"xl",userId:e.id,username:e.username,channelId:t.id}))))),f().createElement(ge,null,n.map(((e,n,a)=>{let{length:i}=a;return f().createElement(f().Fragment,{key:e.id},f().createElement(pe.Z,{userId:e.id,channelId:t.id}),n+1!==i&&f().createElement("span",null,", "))})))),f().createElement(_e,null,f().createElement(V,{content:t.header&&f().createElement(W,{maxLines:4,lineHeight:20,moreText:i({id:"channel_info_rhs.about_area.channel_header.line_limiter.more",defaultMessage:"more"}),lessText:i({id:"channel_info_rhs.about_area.channel_header.line_limiter.less",defaultMessage:"less"})},f().createElement(O.Z,{message:t.header})),editable:!0,onEdit:a.editChannelHeader,emptyLabel:i({id:"channel_info_rhs.about_area.add_channel_header",defaultMessage:"Add a channel header"})})),f().createElement(ve,null,i({id:"channel_info_rhs.about_area_id",defaultMessage:"ID:"})," ",t.id))};Ce.propTypes={gmUsers:m().array.isRequired,actions:m().shape({editChannelHeader:m().func.isRequired}).isRequired};const ye=Ce,Re=I().div.withConfig({displayName:"Container"})(["overflow-wrap:anywhere;padding:24px;padding-bottom:12px;font-size:14px;line-height:20px;& .status-wrapper{height:50px;}& .text-empty{padding:0px;background:transparent;border:0px;color:rgba(var(--center-channel-color-rgb),0.75);}"]),Ne=e=>{let{channel:t,dmUser:n,gmUsers:a,canEditChannelProperties:i,actions:s}=e;return f().createElement(Re,null,t.type===h.default.DM_CHANNEL&&n&&f().createElement(me,{channel:t,dmUser:n,actions:{editChannelHeader:s.editChannelHeader}}),t.type===h.default.GM_CHANNEL&&a&&f().createElement(ye,{channel:t,gmUsers:a,actions:{editChannelHeader:s.editChannelHeader}}),[h.default.OPEN_CHANNEL,h.default.PRIVATE_CHANNEL].includes(t.type)&&f().createElement(X,{channel:t,canEditChannelProperties:i,actions:s}))};Ne.propTypes={gmUsers:m().array,canEditChannelProperties:m().bool.isRequired,actions:m().shape({editChannelPurpose:m().func.isRequired,editChannelHeader:m().func.isRequired}).isRequired};const Me=Ne;var xe=n(34575);const Pe=I().i.withConfig({displayName:"Icon"})(["font-size:12px;"]),Te=I().span.withConfig({displayName:"HeaderTitle"})(["line-height:2.4rem;"]),we=e=>{let{channel:t,isArchived:n,isMobile:a,onClose:i}=e;const{formatMessage:s}=(0,B.useIntl)();return f().createElement("div",{className:"sidebar--right__header"},f().createElement("span",{className:"sidebar--right__title"},a&&f().createElement("button",{className:"sidebar--right__back btn btn-icon btn-sm",onClick:i,"aria-label":s({id:"rhs_header.back.icon",defaultMessage:"Back Icon"})},f().createElement("i",{className:"icon icon-arrow-back-ios"})),f().createElement(Te,null,f().createElement(B.FormattedMessage,{id:"channel_info_rhs.header.title",defaultMessage:"Info"})),t.display_name&&f().createElement("span",{className:"style--none sidebar--right__title__subtitle"},n&&f().createElement(Pe,{className:"icon icon-archive-outline"}),t.display_name)),f().createElement(xe.Z,{id:"closeSidebarTooltip",placement:"top",title:f().createElement(B.FormattedMessage,{id:"rhs_header.closeSidebarTooltip",defaultMessage:"Close"})},f().createElement("button",{id:"rhsCloseButton",type:"button",className:"sidebar--right__close btn btn-icon btn-sm","aria-label":s({id:"rhs_header.closeTooltip.icon",defaultMessage:"Close Sidebar Icon"}),onClick:i},f().createElement("i",{className:"icon icon-close"}))))};we.propTypes={isArchived:m().bool.isRequired,isMobile:m().bool.isRequired,onClose:m().func.isRequired};const Se=we;var Ie=n(26337);const He=I().div.withConfig({displayName:"MenuItemContainer"})(["padding:8px 16px;flex:1;display:flex;"]),ke=I().div.withConfig({displayName:"Icon"})(["color:rgba(var(--center-channel-color-rgb),var(--icon-opacity));"]),qe=I().div.withConfig({displayName:"MenuItemText"})(["padding-left:8px;flex:1;"]),Ae=I().div.withConfig({displayName:"RightSide"})(["display:flex;color:rgba(var(--center-channel-color-rgb),0.75);"]),Fe=I().div.withConfig({displayName:"Badge"})(["font-size:12px;line-height:18px;width:20px;display:flex;place-content:center;"]),Le=I()((e=>{let{icon:t,text:n,className:a,opensSubpanel:i,badge:s,onClick:r}=e;const o=void 0!==s||i;return f().createElement("div",{className:a},f().createElement(He,{onClick:r},f().createElement(ke,null,t),f().createElement(qe,null,n),o&&f().createElement(Ae,null,void 0!==s&&f().createElement(Fe,null,s),i&&f().createElement(ke,null,f().createElement("i",{className:"icon icon-chevron-right"})))))})).withConfig({displayName:"MenuItem"})(["display:flex;width:100%;height:40px;flex-direction:row;align-items:center;cursor:pointer;&:hover{background:rgba(var(--center-channel-color-rgb),0.08);","{color:rgba(var(--center-channel-color-rgb),var(--icon-opacity-hover));}}"],ke),Be=e=>{let{channel:t,channelStats:n,isArchived:a,className:i,actions:s}=e;const{formatMessage:r}=(0,B.useIntl)(),[o,l]=(0,b.useState)(!0),c=t.type!==h.Constants.DM_CHANNEL&&!a,d=t.type!==h.Constants.DM_CHANNEL,u=(null==n?void 0:n.files_count)>=0?null==n?void 0:n.files_count:0;return(0,b.useEffect)((()=>(s.getChannelStats(t.id,!0).then((()=>{l(!1)})),()=>{l(!0)})),[t.id]),f().createElement("div",{className:i,"data-testid":"channel_info_rhs-menu"},c&&f().createElement(Le,{icon:f().createElement("i",{className:"icon icon-bell-outline"}),text:r({id:"channel_info_rhs.menu.notification_preferences",defaultMessage:"Notification Preferences"}),onClick:s.openNotificationSettings}),d&&f().createElement(Le,{icon:f().createElement("i",{className:"icon icon-account-outline"}),text:r({id:"channel_info_rhs.menu.members",defaultMessage:"Members"}),opensSubpanel:!0,badge:n.member_count,onClick:()=>s.showChannelMembers(t.id)}),f().createElement(Le,{icon:f().createElement("i",{className:"icon icon-pin-outline"}),text:r({id:"channel_info_rhs.menu.pinned",defaultMessage:"Pinned messages"}),opensSubpanel:!0,badge:null==n?void 0:n.pinnedpost_count,onClick:()=>s.showPinnedPosts(t.id)}),f().createElement(Le,{icon:f().createElement("i",{className:"icon icon-file-text-outline"}),text:r({id:"channel_info_rhs.menu.files",defaultMessage:"Files"}),opensSubpanel:!0,badge:o?f().createElement(Ie.Z,null):u,onClick:()=>s.showChannelFiles(t.id)}))};Be.propTypes={isArchived:m().bool.isRequired,className:m().string,actions:m().shape({openNotificationSettings:m().func.isRequired,showChannelFiles:m().func.isRequired,showPinnedPosts:m().func.isRequired,showChannelMembers:m().func.isRequired,getChannelStats:m().func.isRequired}).isRequired};const Oe=I()(Be).withConfig({displayName:"StyledMenu"})(["display:flex;flex-direction:column;align-items:flex-start;padding:16px 0;font-size:14px;line-height:20px;color:rgb(var(--center-channel-color-rgb));"]);var Ze=n(47800);const De=I().div.withConfig({displayName:"ChannelInfoRhsTopButtons"})(["display:flex;color:rgba(var(--center-channel-color-rgb),0.75);margin-top:24px;padding:0 18px;"]),Ue=I().button.withConfig({displayName:"Button"})(["flex:1;padding:12px 0 10px 0;border:0;margin:0 6px;background:rgba(var(--center-channel-color-rgb),0.04);border-radius:4px;&:hover{background:rgba(var(--center-channel-color-rgb),0.08);color:rgba(var(--center-channel-color-rgb),0.8);& i{color:rgba(var(--center-channel-color-rgb),var(--icon-opacity-hover));}}&:active,&.active{background:rgba(var(--button-bg-rgb),0.08);color:var(--button-bg);& i{color:var(--button-bg-rgb);}}& i{color:rgba(var(--center-channel-color-rgb),var(--icon-opacity));font-size:24px;}& span{font-size:10px;font-weight:600;line-height:16px;}"]),Ve=I()(Ue).withConfig({displayName:"CopyButton"})(["transition:background-color 0.5s ease;&:active,&.active{background:rgba(var(--center-channel-color-rgb),0.08);color:rgba(var(--center-channel-color-rgb),0.75);transition:none;}&.success{background:var(--denim-status-online);color:var(--button-color);}"]);function ze(e){let{channelType:t,channelURL:n,isFavorite:a,isMuted:i,isInvitingPeople:s,canAddPeople:r,actions:o}=e;const{formatMessage:l}=(0,B.useIntl)(),c=(0,Ze.Z)({text:n||"",successCopyTimeout:1e3}),d=[h.default.OPEN_CHANNEL,h.default.PRIVATE_CHANNEL].includes(t)&&r||t===h.default.GM_CHANNEL,u=[h.default.OPEN_CHANNEL,h.default.PRIVATE_CHANNEL].includes(t),m=a?"icon-star":"icon-star-outline",p=l(a?{id:"channel_info_rhs.top_buttons.favorited",defaultMessage:"Favorited"}:{id:"channel_info_rhs.top_buttons.favorite",defaultMessage:"Favorite"}),g=i?"icon-bell-off-outline":"icon-bell-outline",b=l(i?{id:"channel_info_rhs.top_buttons.muted",defaultMessage:"Muted"}:{id:"channel_info_rhs.top_buttons.mute",defaultMessage:"Mute"}),E=c.copiedRecently?"icon-check":"icon-link-variant",_=c.copiedRecently?l({id:"channel_info_rhs.top_buttons.copied",defaultMessage:"Copied"}):l({id:"channel_info_rhs.top_buttons.copy",defaultMessage:"Copy Link"});return f().createElement(De,null,f().createElement(Ue,{onClick:o.toggleFavorite,className:a?"active":""},f().createElement("div",null,f().createElement("i",{className:"icon "+m})),f().createElement("span",null,p)),f().createElement(Ue,{onClick:o.toggleMute,className:i?"active":""},f().createElement("div",null,f().createElement("i",{className:"icon "+g})),f().createElement("span",null,b)),d&&f().createElement(Ue,{onClick:o.addPeople,className:s?"active":""},f().createElement("div",null,f().createElement("i",{className:"icon icon-account-plus-outline"})),f().createElement("span",null,f().createElement(B.FormattedMessage,{id:"channel_info_rhs.top_buttons.add_people",defaultMessage:"Add People"}))),u&&f().createElement(Ve,{onClick:c.onClick,className:c.copiedRecently?"success":""},f().createElement("div",null,f().createElement("i",{className:"icon "+E})),f().createElement("span",null,_)))}ze.propTypes={channelType:m().string.isRequired,channelURL:m().string,isFavorite:m().bool.isRequired,isMuted:m().bool.isRequired,isInvitingPeople:m().bool.isRequired,canAddPeople:m().bool.isRequired,actions:m().shape({toggleFavorite:m().func.isRequired,toggleMute:m().func.isRequired,addPeople:m().func.isRequired}).isRequired};const Ge=I().div.withConfig({displayName:"Divider"})(["width:88%;border:1px solid rgba(var(--center-channel-color-rgb),0.04);margin:0 auto;"]),je=e=>{let{channel:t,channelStats:n,isArchived:a,isFavorite:i,isMuted:s,isInvitingPeople:r,isMobile:o,currentTeam:l,currentUser:c,dmUser:d,channelMembers:u,canManageMembers:m,canManageProperties:p,actions:g}=e;const b=c.id,E=(0,L.fO)()+"/"+l.name+"/channels/"+t.name,_=u.filter((e=>e.id!==c.id)),v=!a&&p;return f().createElement("div",{id:"rhsContainer",className:"sidebar-right__body"},f().createElement(Se,{channel:t,isArchived:a,isMobile:o,onClose:g.closeRightHandSide}),f().createElement(ze,{channelType:t.type,channelURL:E,isFavorite:i,isMuted:s,isInvitingPeople:r,canAddPeople:m,actions:{toggleFavorite:()=>{i?g.unfavoriteChannel(t.id):g.favoriteChannel(t.id)},toggleMute:()=>{s?g.unmuteChannel(b,t.id):g.muteChannel(b,t.id)},addPeople:()=>t.type===h.default.GM_CHANNEL?g.openModal({modalId:h.r8.CREATE_DM_CHANNEL,dialogType:F.default,dialogProps:{isExistingChannel:!0}}):g.openModal({modalId:h.r8.CHANNEL_INVITE,dialogType:H.Z,dialogProps:{channel:t}})}}),f().createElement(Me,{channel:t,dmUser:d,gmUsers:_,canEditChannelProperties:v,actions:{editChannelHeader:()=>g.openModal({modalId:h.r8.EDIT_CHANNEL_HEADER,dialogType:q.Z,dialogProps:{channel:t}}),editChannelPurpose:()=>g.openModal({modalId:h.r8.EDIT_CHANNEL_PURPOSE,dialogType:A.Z,dialogProps:{channel:t}})}}),f().createElement(Ge,null),f().createElement(Oe,{channel:t,channelStats:n,isArchived:a,actions:{openNotificationSettings:()=>g.openModal({modalId:h.r8.CHANNEL_NOTIFICATIONS,dialogType:k.Z,dialogProps:{channel:t,currentUser:c}}),showChannelFiles:g.showChannelFiles,showPinnedPosts:g.showPinnedPosts,showChannelMembers:g.showChannelMembers,getChannelStats:g.getChannelStats}}))};je.propTypes={isArchived:m().bool.isRequired,isFavorite:m().bool.isRequired,isMuted:m().bool.isRequired,isInvitingPeople:m().bool.isRequired,isMobile:m().bool.isRequired,canManageMembers:m().bool.isRequired,canManageProperties:m().bool.isRequired,dmUser:m().shape({display_name:m().string.isRequired,is_guest:m().bool.isRequired,status:m().string.isRequired}),channelMembers:m().array.isRequired,actions:m().shape({closeRightHandSide:m().func.isRequired,unfavoriteChannel:m().func.isRequired,favoriteChannel:m().func.isRequired,unmuteChannel:m().func.isRequired,muteChannel:m().func.isRequired,openModal:m().func.isRequired,showChannelFiles:m().func.isRequired,showPinnedPosts:m().func.isRequired,showChannelMembers:m().func.isRequired,getChannelStats:m().func.isRequired}).isRequired};const We=(0,b.memo)(je),Je={member_count:0,guest_count:0,pinnedpost_count:0,files_count:0},Ke=(0,a.connect)((function(e){const t=(0,r.TB)(e),n=(0,C.ts)(e),a=(0,o.kA)(e),i=(0,r.Bw)(e)||Je,s=(0,r.Vl)(e),l=(0,r.CA)(e),c=(0,r.D7)(e),d=(0,T.g)(e,h.r8.CHANNEL_INVITE)||(0,T.g)(e,h.r8.CREATE_DM_CHANNEL),u=(0,P.E7)(e),m=(null==t?void 0:t.type)===h.Constants.PRIVATE_CHANNEL,p={channel:t,currentUser:n,currentTeam:a,isArchived:s,isFavorite:l,isMuted:c,isInvitingPeople:d,isMobile:u,canManageMembers:(0,y.Ai)(e,null==a?void 0:a.id,null==t?void 0:t.id,m?v.Pl.MANAGE_PRIVATE_CHANNEL_MEMBERS:v.Pl.MANAGE_PUBLIC_CHANNEL_MEMBERS),canManageProperties:(0,y.Ai)(e,null==a?void 0:a.id,null==t?void 0:t.id,m?v.Pl.MANAGE_PRIVATE_CHANNEL_PROPERTIES:v.Pl.MANAGE_PUBLIC_CHANNEL_PROPERTIES),channelStats:i,channelMembers:(0,R.OX)(e)};if((null==t?void 0:t.type)===h.Constants.DM_CHANNEL){const a=(0,R.PR)(e,(0,w.uD)(t.name,n.id));p.dmUser={user:a,display_name:(0,w.hI)(e,a),is_guest:(0,N.nJ)(a.roles),status:(0,R.ZO)(e,a.id)}}return p}),(function(e){return{actions:(0,s.bindActionCreators)({closeRightHandSide:l.Lg,unfavoriteChannel:_.Dn,favoriteChannel:_.ZE,unmuteChannel:M.rA,muteChannel:M.D0,openModal:x.h,showChannelFiles:l.Cj,showPinnedPosts:l.B7,showChannelMembers:l.yn,getChannelStats:_.mx},e)}}))(We);n(69217),n(52077),n(83526),n(20266);var Ye=n(4500),Qe=n(83905),$e=n(98876),Xe=n(57235),et=(n(61418),n(66726)),tt=n.n(et),nt=n(31435),at=n(22171),it=n(35683),st=n(35887);const rt=I().div.withConfig({displayName:"Title"})(["flex:1;font-family:'Open Sans',sans-serif;font-weight:600;font-size:14px;line-height:20px;"]),ot=I().div.withConfig({displayName:"Actions"})(["button + button{margin-left:8px;}"]),lt=I().button.withConfig({displayName:"Button"})(["border:none;background:transparent;width:fit-content;padding:8px 16px;border-radius:4px;font-size:12px;font-weight:600;line-height:16px;&.add-members,&.manage-members-done{background-color:var(--button-bg);color:var(--button-color);&:hover,&:active,&:focus{background:linear-gradient(0deg,rgba(var(--center-channel-color-rgb),0.16),rgba(var(--center-channel-color-rgb),0.16)),var(--button-bg);color:var(--button-color);}}&.manage-members{background:rgba(var(--button-bg-rgb),0.08);color:var(--button-bg);&:hover,&:focus{background:rgba(var(--button-bg-rgb),0.12);}&:active{background:rgba(var(--button-bg-rgb),0.16);}}"]),ct=I().i.withConfig({displayName:"ButtonIcon"})(["font-size:14.4px;"]),dt=e=>{let{className:t,channelType:n,membersCount:a,canManageMembers:i,editing:s,actions:r}=e;const o=n!==h.default.GM_CHANNEL&&a>1,l=(0,b.useCallback)((e=>{(0,st.p)(e,h.default.KeyCodes.ESCAPE)&&s&&r.stopEditing()}),[s,r]);return(0,b.useEffect)((()=>(document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)})),[l]),f().createElement("div",{className:t},f().createElement(rt,null,s?f().createElement(B.FormattedMessage,{id:"channel_members_rhs.action_bar.managing_title",defaultMessage:"Managing Members"}):f().createElement(B.FormattedMessage,{id:"channel_members_rhs.action_bar.members_count_title",defaultMessage:"{members_count} members",values:{members_count:a}})),i&&f().createElement(ot,null,s?f().createElement(lt,{onClick:r.stopEditing,className:"manage-members-done"},f().createElement(B.FormattedMessage,{id:"channel_members_rhs.action_bar.done_button",defaultMessage:"Done"})):f().createElement(f().Fragment,null,o&&f().createElement(lt,{className:"manage-members",onClick:r.startEditing},f().createElement(B.FormattedMessage,{id:"channel_members_rhs.action_bar.manage_button",defaultMessage:"Manage"})),f().createElement(lt,{onClick:r.inviteMembers,className:"add-members"},f().createElement(ct,{className:"icon-account-plus-outline",title:"Add Icon"}),f().createElement(B.FormattedMessage,{id:"channel_members_rhs.action_bar.add_button",defaultMessage:"Add"})))))};dt.propTypes={className:m().string,channelType:m().string.isRequired,membersCount:m().number.isRequired,canManageMembers:m().bool.isRequired,editing:m().bool.isRequired,actions:m().shape({startEditing:m().func.isRequired,stopEditing:m().func.isRequired,inviteMembers:m().func.isRequired}).isRequired};const ht=I()(dt)(["display:flex;flex-direction:row;align-items:center;padding:16px 20px;"]),ut=I().span.withConfig({displayName:"HeaderTitle"})(["line-height:2.4rem;"]),mt=e=>{let{channel:t,canGoBack:n,onClose:a,goBack:i}=e;const{formatMessage:s}=(0,B.useIntl)();return f().createElement("div",{className:"sidebar--right__header"},f().createElement("span",{className:"sidebar--right__title"},n&&f().createElement("button",{className:"sidebar--right__back btn btn-icon btn-sm",onClick:i,"aria-label":s({id:"rhs_header.back.icon",defaultMessage:"Back Icon"})},f().createElement("i",{className:"icon icon-arrow-back-ios"})),f().createElement(ut,null,f().createElement(B.FormattedMessage,{id:"channel_members_rhs.header.title",defaultMessage:"Members"})),t.display_name&&f().createElement("span",{className:"style--none sidebar--right__title__subtitle"},t.display_name)),f().createElement(xe.Z,{id:"closeSidebarTooltip",placement:"top",title:f().createElement(B.FormattedMessage,{id:"rhs_header.closeSidebarTooltip",defaultMessage:"Close"})},f().createElement("button",{id:"rhsCloseButton",type:"button",className:"sidebar--right__close btn btn-icon btn-sm","aria-label":s({id:"rhs_header.closeTooltip.icon",defaultMessage:"Close Sidebar Icon"}),onClick:a},f().createElement("i",{className:"icon icon-close"}))))};mt.propTypes={canGoBack:m().bool.isRequired,onClose:m().func.isRequired,goBack:m().func.isRequired};const pt=mt;var gt=n(12595),bt=n(83398);const ft=e=>{let{className:t,terms:n,onInput:a}=e;const{formatMessage:i}=(0,B.useIntl)();let s;return n.length>0&&(s=f().createElement("button",{className:"style--none",onClick:()=>a(""),"aria-label":i({id:"channel_members_rhs.search_bar.aria.cancel_search_button",defaultMessage:"cancel members search"})},f().createElement("i",{className:"icon icon-close-circle"}))),f().createElement("div",{className:t},f().createElement(bt.Z,{"data-testid":"channel-member-rhs-search",value:n,onInput:e=>a(e.currentTarget.value),inputPrefix:f().createElement("i",{className:"icon icon-magnify"}),inputSuffix:s,placeholder:i({id:"channel_members_rhs.search_bar.placeholder",defaultMessage:"Search members"}),useLegend:!1}))};ft.propTypes={className:m().string,terms:m().string.isRequired,onInput:m().func.isRequired};const Et=I()(ft)(["display:flex;padding:0px 20px 12px;.Input_container .Input_wrapper{padding:0 8px;}"]),_t=I().div.withConfig({displayName:"MembersContainer"})(["flex:1 1 auto;padding:0 4px 16px;"]);let vt=function(e){return e.Member="member",e.FirstSeparator="first-separator",e.Separator="separator",e}({});function Ct(e){let{channel:t,currentUserIsChannelAdmin:n,searchTerms:a,membersCount:s,canGoBack:r,teamUrl:o,channelMembers:l,canManageMembers:c,editing:d=!1,actions:u}=e;const m=(0,i.useHistory)(),[p,g]=(0,b.useState)([]),[E,_]=(0,b.useState)(0),[v,C]=(0,b.useState)(!1),{formatMessage:y}=(0,B.useIntl)(),R=""!==a,N=t.name===h.default.DEFAULT_CHANNEL,M=R||s>=20;(0,b.useEffect)((()=>()=>{u.setChannelMembersRhsSearchTerm("")}),[]),(0,b.useEffect)((()=>{const e=[];let t=!1;for(let i=0;i{if(t.type===h.default.DM_CHANNEL){let e=u.closeRightHandSide;return r&&(e=u.goBack),void e()}_(0),C(!1),u.setChannelMembersRhsSearchTerm(""),u.loadProfilesAndReloadChannelMembers(0,100,t.id,nt.xT.Admin),u.loadMyChannelMemberAndRole(t.id)}),[t.id,t.type]);const x=(0,b.useCallback)(tt()((async e=>{await u.searchProfilesAndChannelMembers(e,{in_team_id:t.team_id,in_channel_id:t.id})}),h.default.SEARCH_TIMEOUT_MILLISECONDS),[u.searchProfilesAndChannelMembers]);(0,b.useEffect)((()=>{a&&x(a)}),[a]);const P=(0,b.useCallback)((async e=>{await u.openDirectChannelToUserId(e.id),m.push(o+"/messages/@"+e.username),await u.closeRightHandSide()}),[u.openDirectChannelToUserId,m,o,u.closeRightHandSide]),T=(0,b.useCallback)((async()=>{C(!0),await u.loadProfilesAndReloadChannelMembers(E+1,100,t.id,nt.xT.Admin),_(E+1),C(!1)}),[u.loadProfilesAndReloadChannelMembers,E,t.id]);return f().createElement("div",{id:"rhsContainer",className:"sidebar-right__body"},f().createElement(pt,{channel:t,canGoBack:r,onClose:u.closeRightHandSide,goBack:u.goBack}),f().createElement(ht,{channelType:t.type,membersCount:s,canManageMembers:c,editing:d,actions:{startEditing:()=>u.setEditChannelMembers(!0),stopEditing:()=>u.setEditChannelMembers(!1),inviteMembers:()=>t.type===h.default.GM_CHANNEL?u.openModal({modalId:h.r8.CREATE_DM_CHANNEL,dialogType:F.default,dialogProps:{isExistingChannel:!0}}):u.openModal({modalId:h.r8.CHANNEL_INVITE,dialogType:H.Z,dialogProps:{channel:t}})}}),d&&N&&!n&&f().createElement(Nt,null,f().createElement(at.Z,{mode:"info",variant:"app",message:y({id:"channel_members_rhs.default_channel_moderation_restrictions",defaultMessage:"In this channel, you can only remove guests. Only channel admins can manage other members."},{link:e=>f().createElement(it.Z,{href:"https://docs.mattermost.com/welcome/about-user-roles.html#channel-admin",location:"channel_members_rhs"},e)})})),M&&f().createElement(Et,{terms:a,onInput:async e=>{u.setChannelMembersRhsSearchTerm(e)}}),f().createElement(_t,null,l.length>0&&f().createElement(gt.Z,{searchTerms:a,members:p,editing:d,channel:t,openDirectMessage:P,loadMore:T,hasNextPage:l.length{const i=[];return e.forEach((e=>{a[e.id]&&i.push({user:e,membership:a[e.id],status:t[e.id],displayName:(0,N.fw)(e,n)})})),i.sort(((e,t)=>{var n,a,i;return(null===(n=e.membership)||void 0===n?void 0:n.scheme_admin)===(null===(a=t.membership)||void 0===a?void 0:a.scheme_admin)?e.displayName.localeCompare(t.displayName):!0===(null===(i=e.membership)||void 0===i?void 0:i.scheme_admin)?-1:1})),i},xt=(0,Ye.P1)("getProfiles",R.yu,R.aH,Qe.kl,r.ii,Mt),Pt=(0,Ye.P1)("searchProfiles",((e,t)=>(0,R.rW)(e,t,!1)),R.aH,Qe.kl,r.ii,Mt),Tt=(0,a.connect)((function(e){const t=(0,r.TB)(e),n=(0,o.kA)(e),a=(0,r.HU)(e),{member_count:i}=(0,r.Bw)(e)||{member_count:0};if(!t)return{channel:{},currentUserIsChannelAdmin:!1,channelMembers:[],channelAdmins:[],searchTerms:"",membersCount:i,canManageMembers:!1,canGoBack:!1,teamUrl:""};const s=(0,r.Vl)(e),l=t.type===h.Constants.PRIVATE_CHANNEL,c=(0,y.Ai)(e,null==n?void 0:n.id,t.id,l?v.Pl.MANAGE_PRIVATE_CHANNEL_MEMBERS:v.Pl.MANAGE_PUBLIC_CHANNEL_MEMBERS)&&!s,u=e.views.search.channelMembersRhsSearch||"";let m=[];m=""===u?xt(e):Pt(e,u.trim());const p=(0,o.gm)(e),g=(0,d.ZR)(e),b=g===h.Hp.CHANNEL_INFO||g===h.Hp.CHANNEL_FILES||g===h.Hp.PIN,f=Boolean(b),E=(0,d.dF)(e);return{channel:t,currentUserIsChannelAdmin:a&&a.scheme_admin,membersCount:i,searchTerms:u,teamUrl:p,canGoBack:f,canManageMembers:c,channelMembers:m,editing:E}}),(function(e){return{actions:(0,s.bindActionCreators)({openModal:x.h,openDirectChannelToUserId:M.Pn,closeRightHandSide:l.Lg,goBack:l.Hm,setChannelMembersRhsSearchTerm:Xe.fg,loadProfilesAndReloadChannelMembers:$e.bN,loadMyChannelMemberAndRole:_.L1,setEditChannelMembers:l.VH,searchProfilesAndChannelMembers:$e.K},e)}}))(Ct);var wt=n(70153),St=n(25598),It=n(3901),Ht=(n(48410),n(27998)),kt=n(6352),qt=n(61782),At=n(50755),Ft=n(9760),Lt=n(48332),Bt=n(45448),Ot=n(1514);function Zt(e){let{content:t,onExited:n,className:a}=e;const{formatMessage:i}=(0,B.useIntl)(),s=(0,b.useCallback)((()=>{n()}),[n]),r=(0,b.useCallback)((()=>{var e;null===(e=t.undo)||void 0===e||e.call(t),n()}),[t.undo,n]),o=g()("info-toast",a);return(0,b.useEffect)((()=>{const e=setTimeout((()=>{n()}),5e3);return()=>clearTimeout(e)}),[n]),f().createElement(z.Z,{in:Boolean(t),classNames:"toast",mountOnEnter:!0,unmountOnExit:!0,timeout:300,appear:!0},f().createElement("div",{className:o},t.icon,f().createElement("span",null,t.message),t.undo&&f().createElement("button",{onClick:r,className:"info-toast__undo"},i({id:"post_info.edit.undo",defaultMessage:"Undo"})),f().createElement(Lt.ZP,{className:"info-toast__icon_button",onClick:s,icon:"close",size:"sm",inverted:!0})))}Zt.propTypes={content:m().shape({icon:m().element,message:m().string.isRequired,undo:m().func}).isRequired,className:m().string,onExited:m().func.isRequired};const Dt=f().memo(Zt);var Ut=n(75377),Vt=n(6221),zt=n(52576),Gt=n(11832),jt=n(6098);const Wt=(0,B.defineMessages)({title:{id:"post_info.edit.restore",defaultMessage:"Restore this version"},titleQuestion:{id:"post_info.edit.restore_question",defaultMessage:"Restore this version?"}}),Jt=e=>{let{post:t,postHeader:n,actions:a,onExited:i}=e;const{formatMessage:s}=(0,B.useIntl)(),r=()=>i(),o=f().createElement("div",{className:"edit-post-history__restore__modal__header"},s(Wt.titleQuestion));return f().createElement(jt.$E,{compassDesign:!0,onExited:r,enforceFocus:!1,id:"restorePostModal","aria-labelledby":"restorePostModalLabel",modalHeaderText:o,handleCancel:r,cancelButtonClassName:"cancel-button",handleConfirm:async()=>{await a.handleRestore(t),r()}},f().createElement("div",{className:"edit-post-history__restore__modal__content"},n,f().createElement(Vt.Z,{post:t,overflowType:"ellipsis",maxHeight:100,showPostEditedIndicator:!1})))};Jt.propTypes={postHeader:m().element.isRequired,actions:m().shape({handleRestore:m().func.isRequired}).isRequired,onExited:m().func.isRequired};const Kt=(0,b.memo)(Jt),Yt=[zt.ap.aS,zt.ap.o$],Qt=(0,B.defineMessages)({helpText:{id:"post_info.edit.restore",defaultMessage:"Restore this version"},currentVersionText:{id:"post_info.edit.current_version",defaultMessage:"Current Version"},ariaLabelMessage:{id:"post_info.edit.aria_label",defaultMessage:"Select to restore an old message."}}),$t=e=>{let{post:t,isCurrent:n=!1,postCurrentVersion:a,theme:i,actions:s}=e;const{formatMessage:r}=(0,B.useIntl)(),[o,l]=(0,b.useState)(n),c=(0,b.useCallback)((()=>{const e={modalId:h.r8.RESTORE_POST_MODAL,dialogType:Kt,dialogProps:{post:t,postHeader:_,actions:{handleRestore:d}}};s.openModal(e)}),[s,t]);if(!t)return null;const d=async()=>{if(!a||!t||a.message===t.message)return void s.closeRightHandSide();const e={message:t.message,id:a.id,channel_id:a.channel_id};(await s.editPost(e)).data&&(s.closeRightHandSide(),(()=>{const e={modalId:h.r8.INFO_TOAST,dialogType:Dt,dialogProps:{content:{icon:f().createElement(Bt.CheckIcon,{size:18}),message:"Restored Message",undo:u}}};s.openModal(e)})())},u=async()=>{a?await s.editPost(a):s.closeRightHandSide()},m=n?f().createElement("div",{className:"edit-post-history__current__indicator"},r(Qt.currentVersionText)):null,p=(0,w.bb)(t.user_id),E=t.props?t.props.override_username:"",_=f().createElement("div",{className:"edit-post-history__header"},f().createElement("span",{className:"profile-icon"},f().createElement(Gt.Z,{size:"sm",url:p,className:"avatar-post-preview"})),f().createElement("div",{className:"edit-post-history__header__username"},f().createElement(pe.Z,{userId:t.user_id,disablePopover:!0,overwriteName:E}))),v=f().createElement(Vt.Z,{post:t,isRHS:!0,showPostEditedIndicator:!1}),C=f().createElement("div",{className:"edit-post-history__content_container"},_,f().createElement("div",{className:"post__content"},f().createElement("div",{className:"search-item-snippet post__body"},v))),y=n?null:f().createElement(xe.Z,{id:"editPostRestoreTooltip",placement:"left",title:r(Qt.helpText)},f().createElement(Lt.ZP,{className:"edit-post-history__icon__button restore-icon",size:"sm",icon:"restore",onClick:c,compact:!0,"aria-label":r(Qt.ariaLabelMessage)})),R=g()("edit-post-history__container",{"edit-post-history__container__background":o}),N=0===t.edit_at?t.create_at:t.edit_at;return f().createElement(Ot.default,{theme:i},f().createElement("div",{className:R,onClick:()=>l((e=>!e))},f().createElement(Ut.Z,{className:"a11y__section post",id:"searchResult_"+t.id,post:t},f().createElement("div",{className:"edit-post-history__title__container","aria-hidden":"true"},f().createElement("div",{className:"edit-post-history__date__badge__container"},f().createElement(Lt.ZP,{size:"sm",icon:o?"chevron-down":"chevron-right",compact:!0,"aria-label":"Toggle to see an old message.",className:"edit-post-history__icon__button"}),f().createElement("span",{className:"edit-post-history__date"},f().createElement(zt.ZP,{value:N,ranges:Yt})),m),y),o&&C)))};$t.propTypes={isCurrent:m().bool};const Xt=(0,b.memo)($t),en=(0,a.connect)((function(e){const t=(0,d.Bh)(e)||"";return{theme:(0,Qe.gh)(e),postCurrentVersion:(0,It.xl)(e,t)}}),(function(e){return{actions:(0,s.bindActionCreators)({editPost:Ft.dq,closeRightHandSide:l.Lg,openModal:x.h},e)}}))(Xt),tn=e=>f().createElement("div",Object.assign({},e,{className:"scrollbar--view"})),nn=e=>f().createElement("div",Object.assign({},e,{className:"scrollbar--horizontal"})),an=e=>f().createElement("div",Object.assign({},e,{className:"scrollbar--vertical"})),sn=e=>{let{channelDisplayName:t,originalPost:n}=e;const[i,s]=(0,b.useState)([]),[r,o]=(0,b.useState)(!1),[l,c]=(0,b.useState)(!1),d=(0,a.useDispatch)(),h=(0,b.useRef)(null),{formatMessage:u}=(0,B.useIntl)(),m=u({id:"post_info.edit.history.retrieveError",defaultMessage:"Unable to load edit history"}),p=u({id:"post_info.edit.history.retrieveErrorVerbose",defaultMessage:"There was an error loading the history for this message. Check your network connection or try again later."});(0,b.useEffect)((()=>{var e;(async()=>{c(!0);const e=await d((0,kt.db)(n.id));e.data?(s(e.data),o(!1)):(o(!0),s([])),c(!1)})(),null===(e=h.current)||void 0===e||e.scrollToTop()}),[n,d]),(0,b.useEffect)((()=>{s([]),o(!1)}),[n.id]);const g=u({id:"search_header.title_edit.history",defaultMessage:"Edit History"}),E=f().createElement("div",{className:"edit-post-history__error_container"},f().createElement("div",{className:"edit-post-history__error_item"},f().createElement(qt.Z,{width:127,height:127}),f().createElement("p",{className:"edit-post-history__error_heading"},m),f().createElement("p",{className:"edit-post-history__error_subheading"},p)));if(l&&0===i.length)return f().createElement("div",{id:"rhsContainer",className:"sidebar-right__body sidebar-right__edit-post-history"},f().createElement(St.Z,{style:{display:"grid",placeContent:"center",flex:"1"}}));const _=[f().createElement(en,{post:n,key:n.id,isCurrent:!0}),...i.map((e=>f().createElement(en,{key:e.id,post:e})))];return f().createElement("div",{id:"rhsContainer",className:"sidebar-right__body sidebar-right__edit-post-history"},f().createElement(Ht.ZP,{ref:h,autoHide:!0,autoHideTimeout:500,autoHideDuration:500,renderThumbHorizontal:nn,renderThumbVertical:an,renderView:tn},f().createElement(At.Z,null,g,f().createElement("div",{className:"sidebar--right__title__channel"},t)),r?E:_))},rn=(0,b.memo)(sn),on=(0,a.connect)((function(e){var t;const n=(0,d.Bh)(e)||"",a=(0,It.xl)(e,n),i=null!==(t=(0,r.TB)(e))&&void 0!==t?t:(0,r.mr)(e,a.channel_id);return{channelDisplayName:(null==i?void 0:i.display_name)||"",originalPost:a}}))(rn);var ln=n(83282),cn=n(56403),dn=n(21128);function hn(e){let{role:t,children:n,id:i,className:s,rightWidthHolderRef:r}=e;const o=(0,b.useRef)(null),l=(0,a.useSelector)(d.HN),c=(0,a.useSelector)(d.OZ),[h,u]=(0,b.useState)(!1),m=ln.yf[l].default,p=(0,dn.lB)(l),g=(e,t)=>{const n=r.current;n&&n.style.removeProperty(t)};return(0,b.useEffect)((()=>{const e=o.current;e&&(u(c),h&&!c&&(e.classList.add("resize-disabled"),setTimeout((()=>{e.classList.remove("resize-disabled")}),1e3)))}),[c]),f().createElement("div",{id:i,className:s,role:t,ref:o},n,f().createElement(cn.Z,{name:"rhsResizeHandle",globalCssVar:ln.P6.RHS,defaultWidth:m,dir:ln._w.RIGHT,disabled:c,containerRef:o,onResize:(e,t,n)=>{const a=r.current;a&&(p||a.style.setProperty(t,n))},onResizeEnd:g,onDividerDoubleClick:(e,t)=>{g(0,t),document.body.classList.add("layout-changing"),setTimeout((()=>{document.body.classList.remove("layout-changing")}),1e3)}}))}hn.propTypes={children:m().node.isRequired};const un=hn;var mn=n(19601),pn=n(66471),gn=n.n(pn),bn=n(68679),fn=n(98904),En=n(9906);function _n(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class vn extends f().PureComponent{constructor(){super(...arguments),_n(this,"handleBack",(e=>{switch(e.preventDefault(),this.props.previousRhsState){case h.Hp.CHANNEL_FILES:case h.Hp.SEARCH:this.props.actions.showSearchResults();break;case h.Hp.MENTION:this.props.actions.showMentions();break;case h.Hp.FLAG:this.props.actions.showFlaggedPosts();break;case h.Hp.PIN:this.props.actions.showPinnedPosts()}}))}render(){let e,t;switch(this.props.previousRhsState){case h.Hp.SEARCH:case h.Hp.MENTION:t=f().createElement(B.FormattedMessage,{id:"rhs_header.backToResultsTooltip",defaultMessage:"Back to search results"});break;case h.Hp.FLAG:t=f().createElement(B.FormattedMessage,{id:"rhs_header.backToFlaggedTooltip",defaultMessage:"Back to saved messages"});break;case h.Hp.PIN:t=f().createElement(B.FormattedMessage,{id:"rhs_header.backToPinnedTooltip",defaultMessage:"Back to pinned messages"})}const n=f().createElement(f().Fragment,null,f().createElement(B.FormattedMessage,{id:"rhs_header.expandSidebarTooltip",defaultMessage:"Expand the right sidebar"}),f().createElement(En.Z,{shortcut:En.r.navExpandSidebar,hideDescription:!0,isInsideTooltip:!0})),a=f().createElement(f().Fragment,null,f().createElement(B.FormattedMessage,{id:"rhs_header.collapseSidebarTooltip",defaultMessage:"Collapse the right sidebar"}),f().createElement(En.Z,{shortcut:En.r.navExpandSidebar,hideDescription:!0,isInsideTooltip:!0}));return t&&(e=f().createElement(xe.Z,{id:"backToResultsTooltip",title:t,placement:"top"},f().createElement("button",{className:"sidebar--right__back btn btn-icon btn-sm",onClick:this.handleBack,"aria-label":this.props.intl.formatMessage({id:"rhs_header.back.icon",defaultMessage:"Back Icon"})},f().createElement("i",{className:"icon icon-arrow-back-ios"})))),f().createElement("div",{className:"sidebar--right__header"},f().createElement("span",{className:"sidebar--right__title"},e,f().createElement(B.FormattedMessage,{id:"search_header.title5",defaultMessage:"Extra information"})),f().createElement("div",{className:"pull-right"},f().createElement(xe.Z,{id:this.props.isExpanded?"shrinkSidebarTooltip":"expandSidebarTooltip",title:this.props.isExpanded?a:n,placement:"bottom"},f().createElement("button",{type:"button",className:"sidebar--right__expand btn btn-icon btn-sm","aria-label":"Expand",onClick:this.props.actions.toggleRhsExpanded},f().createElement("i",{className:"icon icon-arrow-expand","aria-label":this.props.intl.formatMessage({id:"rhs_header.expandSidebarTooltip.icon",defaultMessage:"Expand Sidebar Icon"})}),f().createElement("i",{className:"icon icon-arrow-collapse","aria-label":this.props.intl.formatMessage({id:"rhs_header.collapseSidebarTooltip.icon",defaultMessage:"Collapse Sidebar Icon"})}))),f().createElement(xe.Z,{id:"closeSidebarTooltip",title:f().createElement(B.FormattedMessage,{id:"rhs_header.closeSidebarTooltip",defaultMessage:"Close"}),placement:"top"},f().createElement("button",{type:"button",className:"sidebar--right__close btn btn-icon btn-sm","aria-label":"Close",onClick:this.props.actions.closeRightHandSide},f().createElement("i",{className:"icon icon-close","aria-label":this.props.intl.formatMessage({id:"rhs_header.closeTooltip.icon",defaultMessage:"Close Sidebar Icon"})})))))}}_n(vn,"propTypes",{isExpanded:m().bool.isRequired,actions:m().shape({showMentions:m().func.isRequired,showSearchResults:m().func.isRequired,showFlaggedPosts:m().func.isRequired,showPinnedPosts:m().func.isRequired,closeRightHandSide:m().func.isRequired,toggleRhsExpanded:m().func.isRequired}).isRequired});const Cn=(0,B.injectIntl)(vn),yn=(0,a.connect)((function(e){return{isExpanded:(0,d.OZ)(e)}}),(function(e){return{actions:(0,s.bindActionCreators)({showMentions:l.rb,showSearchResults:l.O8,showFlaggedPosts:l.Yv,showPinnedPosts:l.B7,closeRightHandSide:l.Lg,toggleRhsExpanded:l.fV},e)}}))(Cn);var Rn=n(69883);function Nn(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mn(e){return f().createElement("div",Object.assign({},e,{className:"scrollbar--view"}))}function xn(e){return f().createElement("div",Object.assign({},e,{className:"scrollbar--horizontal"}))}function Pn(e){return f().createElement("div",Object.assign({},e,{className:"scrollbar--vertical"}))}class Tn extends f().Component{constructor(e){super(e),Nn(this,"handleScroll",(()=>{this.state.isScrolling||this.setState({isScrolling:!0}),this.scrollStopAction.fireAfter(h.default.SCROLL_DELAY)})),Nn(this,"handleScrollStop",(()=>{this.setState({isScrolling:!1})})),Nn(this,"handleClick",(()=>{this.props.isMobileView&&(0,bn.Fy)()})),this.scrollStopAction=new Rn.Z(this.handleScrollStop),this.state={isScrolling:!1}}shouldComponentUpdate(e,t){var n,a,i,s;return!gn()(null===(n=e.selected)||void 0===n||null===(a=n.props)||void 0===a?void 0:a.card,null===(i=this.props.selected)||void 0===i||null===(s=i.props)||void 0===s?void 0:s.card)||t.isScrolling!==this.state.isScrolling}render(){if(null==this.props.selected)return f().createElement("div",null);const{selected:e,pluginPostCardTypes:t,teamUrl:n}=this.props,a=e.type;let s=null;if(null!=t&&t.hasOwnProperty(a)){const n=t[a].component;s=f().createElement(n,{post:e})}s||(s=f().createElement("div",{className:"info-card"},f().createElement(O.Z,{message:e.props&&e.props.card||""})));let r=f().createElement(pe.Z,{userId:e.user_id,hideStatus:!0,disablePopover:!0});e.props.override_username&&this.props.enablePostUsernameOverride&&(r=f().createElement(pe.Z,{userId:e.user_id,hideStatus:!0,disablePopover:!0,overwriteName:e.props.override_username}));const o=f().createElement(fn.Z,{compactDisplay:!1,post:e,userId:e.user_id});return f().createElement("div",{className:"sidebar-right__body sidebar-right__card"},f().createElement(yn,{previousRhsState:this.props.previousRhsState}),f().createElement(Ht.ZP,{autoHide:!0,autoHideTimeout:500,autoHideDuration:500,renderThumbHorizontal:xn,renderThumbVertical:Pn,renderView:Mn,onScroll:this.handleScroll},f().createElement("div",{className:"post-right__scroll"},s,f().createElement("div",{className:"d-flex post-card--info"},f().createElement("div",{className:"post-card--post-by overflow--ellipsis"},f().createElement(B.FormattedMessage,{id:"rhs_card.message_by",defaultMessage:"Message by {avatar} {user}",values:{user:r,avatar:o}})),f().createElement("div",{className:"post-card--view-post"},f().createElement(i.Link,{to:"".concat(n,"/pl/").concat(e.id),className:"post__permalink",onClick:this.handleClick},f().createElement(B.FormattedMessage,{id:"rhs_card.jump",defaultMessage:"Jump"})))))))}}Nn(Tn,"defaultProps",{pluginPostCardTypes:{}});const wn=(0,a.connect)((function(e){const t=(0,d.Kj)(e);return{enablePostUsernameOverride:"true"===(0,mn.iE)(e).EnablePostUsernameOverride,isMobileView:(0,P.E7)(e),selected:t,pluginPostCardTypes:e.plugins.postCardTypes,teamUrl:(0,o.gm)(e)}}))(Tn);var Sn=n(26219),In=n(4195),Hn=n(22589),kn=n(88676),qn=n(83098),An=(n(40895),n(32394));const Fn={x:2,y:25},Ln=()=>{const e=(0,a.useDispatch)(),{formatMessage:t}=(0,B.useIntl)(),n=(0,a.useSelector)(C.rc),i=(0,jt.li)("sidebar-right"),s=f().createElement(B.FormattedMessage,{id:"tutorial_threads.threads_pane.title",defaultMessage:"Viewing a thread in the sidebar"}),r=f().createElement("p",null,t({id:"tutorial_threads.threads_pane.description",defaultMessage:"Click the Follow button to be notified about replies and see it in your Threads view. Within a thread, the New Messages line shows you where you left off."},{b:e=>f().createElement("b",null,e)})),o=t=>{t.preventDefault();const a=[{user_id:n,category:h.uP.CRT_THREAD_PANE_STEP,name:n,value:h.Constants.CrtThreadPaneSteps.FINISHED.toString()}];e((0,An.$A)(n,a))},l=(0,jt.kt)(["rhsContainer"],[null==i?void 0:i.width]);return f().createElement(jt.In,{show:!0,screen:r,title:s,overlayPunchOut:l,placement:"left",pulsatingDotPlacement:"top-start",pulsatingDotTranslate:Fn,step:1,singleTip:!0,showOptOut:!1,handleDismiss:o,handleNext:o,interactivePunchOut:!0,nextBtn:f().createElement(B.FormattedMessage,{id:"tutorial_tip.got_it",defaultMessage:"Got it"})})};var Bn=n(8243);function On(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Zn extends f().PureComponent{constructor(){super(...arguments),On(this,"handleBack",(e=>{switch(e.preventDefault(),this.props.previousRhsState){case h.Hp.SEARCH:case h.Hp.MENTION:case h.Hp.FLAG:case h.Hp.PIN:this.props.goBack()}})),On(this,"handleJumpClick",(()=>{this.props.isMobileView&&this.props.closeRightHandSide(),this.props.setRhsExpanded(!1);const e=this.props.relativeTeamUrl;(0,Bn.s)().push("".concat(e,"/pl/").concat(this.props.rootPostId))})),On(this,"handleFollowChange",(()=>{const{currentTeamId:e,currentUserId:t,rootPostId:n,isFollowingThread:a}=this.props;this.props.setThreadFollow(t,e,n,!a)}))}render(){let e;const{isFollowingThread:t}=this.props,{formatMessage:n}=this.props.intl,a=f().createElement(B.FormattedMessage,{id:"rhs_header.closeSidebarTooltip",defaultMessage:"Close"});let i;switch(this.props.previousRhsState){case h.Hp.SEARCH:case h.Hp.MENTION:i=f().createElement(B.FormattedMessage,{id:"rhs_header.backToResultsTooltip",defaultMessage:"Back to search results"});break;case h.Hp.FLAG:i=f().createElement(B.FormattedMessage,{id:"rhs_header.backToFlaggedTooltip",defaultMessage:"Back to saved messages"});break;case h.Hp.PIN:i=f().createElement(B.FormattedMessage,{id:"rhs_header.backToPinnedTooltip",defaultMessage:"Back to pinned messages"})}const s=this.props.isExpanded?f().createElement(f().Fragment,null,f().createElement(B.FormattedMessage,{id:"rhs_header.collapseSidebarTooltip",defaultMessage:"Collapse the right sidebar"}),f().createElement(En.Z,{shortcut:En.r.navExpandSidebar,hideDescription:!0,isInsideTooltip:!0})):f().createElement(f().Fragment,null,f().createElement(B.FormattedMessage,{id:"rhs_header.expandSidebarTooltip",defaultMessage:"Expand the right sidebar"}),f().createElement(En.Z,{shortcut:En.r.navExpandSidebar,hideDescription:!0,isInsideTooltip:!0})),r=this.props.channel.display_name;return i&&(e=f().createElement(xe.Z,{id:"backToResultsTooltip",placement:"top",title:i},f().createElement("button",{className:"sidebar--right__back btn btn-icon btn-sm",onClick:this.handleBack,"aria-label":n({id:"rhs_header.back.icon",defaultMessage:"Back Icon"})},f().createElement("i",{className:"icon icon-arrow-back-ios"})))),f().createElement("div",{className:"sidebar--right__header"},f().createElement("span",{className:"sidebar--right__title"},e,f().createElement(B.FormattedMessage,{id:"rhs_header.details",defaultMessage:"Thread"}),r&&f().createElement("button",{onClick:this.handleJumpClick,className:"style--none sidebar--right__title__channel"},r)),f().createElement("div",{className:"controls"},this.props.isCollapsedThreadsEnabled?f().createElement(qn.Z,{className:"sidebar--right__follow__thread",isFollowing:t,onClick:this.handleFollowChange}):null,f().createElement(xe.Z,{id:this.props.isExpanded?"shrinkSidebarTooltip":"expandSidebarTooltip",placement:"bottom",title:s},f().createElement("button",{type:"button",className:"sidebar--right__expand btn btn-icon btn-sm","aria-label":"Expand",onClick:this.props.toggleRhsExpanded},f().createElement("i",{className:"icon icon-arrow-expand","aria-label":n({id:"rhs_header.expandSidebarTooltip.icon",defaultMessage:"Expand Sidebar Icon"})}),f().createElement("i",{className:"icon icon-arrow-collapse","aria-label":n({id:"rhs_header.collapseSidebarTooltip.icon",defaultMessage:"Collapse Sidebar Icon"})}))),f().createElement(xe.Z,{id:"closeSidebarTooltip",placement:"top",title:a},f().createElement("button",{id:"rhsCloseButton",type:"button",className:"sidebar--right__close btn btn-icon btn-sm","aria-label":"Close",onClick:this.props.closeRightHandSide},f().createElement("i",{className:"icon icon-close","aria-label":n({id:"rhs_header.closeTooltip.icon",defaultMessage:"Close Sidebar Icon"})})))),this.props.showThreadsTutorialTip&&f().createElement(Ln,null))}}On(Zn,"propTypes",{isExpanded:m().bool.isRequired,isMobileView:m().bool.isRequired,rootPostId:m().string.isRequired,relativeTeamUrl:m().string.isRequired,isCollapsedThreadsEnabled:m().bool.isRequired,isFollowingThread:m().bool,currentTeamId:m().string.isRequired,showThreadsTutorialTip:m().bool.isRequired,currentUserId:m().string.isRequired,setRhsExpanded:m().func.isRequired,showMentions:m().func.isRequired,showSearchResults:m().func.isRequired,showFlaggedPosts:m().func.isRequired,showPinnedPosts:m().func.isRequired,goBack:m().func.isRequired,closeRightHandSide:m().func.isRequired,toggleRhsExpanded:m().func.isRequired,setThreadFollow:m().func.isRequired});const Dn=(0,B.injectIntl)(Zn),Un={setRhsExpanded:l.JI,showSearchResults:l.O8,showMentions:l.rb,showFlaggedPosts:l.Yv,showPinnedPosts:l.B7,showChannelFiles:l.Cj,closeRightHandSide:l.Lg,toggleRhsExpanded:l.fV,setThreadFollow:Sn.NC,goBack:l.Hm},Vn=(0,a.connect)((function(){const e=(0,In.SP)();return function(t,n){let{rootPostId:a}=n,i=!1;const s=(0,Qe.ym)(t),r=(0,It.xl)(t,a),l=(0,R.rc)(t),c=(0,Qe.wS)(t,h.uP.CRT_THREAD_PANE_STEP,l);if(r&&s){const n=e(t,r);if(i=n.is_following,null===i&&0===n.reply_count){const e=(0,R.b7)(t),n=(0,kn.Nn)(r.message);i=(0,Hn.zp)(e,n)}}const u=c===h.yU.THREADS_PANE_POPOVER&&(0,Qe.ym)(t)&&(0,Qe.dn)(t);return{isExpanded:(0,d.OZ)(t),isMobileView:(0,P.E7)(t),relativeTeamUrl:(0,o.gm)(t),currentTeamId:(0,o.ev)(t),currentUserId:l,isCollapsedThreadsEnabled:s,isFollowingThread:i,showThreadsTutorialTip:u}}}),Un)(Dn);var zn=n(69810);const Gn=e=>{let{currentTeam:t,channel:n,selected:i,previousRhsState:s}=e;const r=(0,a.useDispatch)();return(0,b.useEffect)((()=>{null!=n&&n.team_id&&n.team_id!==(null==t?void 0:t.id)&&r((0,l.Lg)())}),[t,n]),null!=i&&n?f().createElement("div",{id:"rhsContainer",className:"sidebar-right__body"},f().createElement(Vn,{rootPostId:i.id,channel:n,previousRhsState:s}),f().createElement(zn.Z,{rootPostId:i.id,useRelativeTimestamp:!0,isThreadView:!1})):f().createElement("div",null)},jn=(0,b.memo)(Gn),Wn=(0,a.connect)((function(e){return{selected:(0,d.ct)(e),channel:(0,d.Gu)(e),currentTeam:(0,o.kA)(e)}}))(jn);var Jn=n(30074),Kn=n(26742);const Yn=e=>{let{showPluggable:t,pluggableId:n,title:a}=e;return f().createElement("div",{id:"rhsContainer",className:"sidebar-right__body"},f().createElement(At.Z,null,a),t&&f().createElement(Kn.default,{pluggableName:"RightHandSidebarComponent",pluggableId:n}))};Yn.propTypes={showPluggable:m().bool.isRequired,pluggableId:m().string.isRequired,title:m().node.isRequired};const Qn=f().memo(Yn),$n=(0,a.connect)((function(e){const t=e.plugins.components.RightHandSidebarComponent,n=(0,d.n_)(e),a=t.find((e=>e.id===n)),i=a?a.title:"";return{showPluggable:Boolean(a),pluggableId:n,title:i}}))(Qn);var Xn=n(21214);function ea(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ta extends f().PureComponent{constructor(e){super(e),ea(this,"previous",void 0),ea(this,"setPrevious",(()=>{this.props.isOpen&&(this.previous={searchVisible:this.props.searchVisible,isPinnedPosts:this.props.isPinnedPosts,isChannelFiles:this.props.isChannelFiles,isChannelInfo:this.props.isChannelInfo,isChannelMembers:this.props.isChannelMembers,isPostEditHistory:this.props.isPostEditHistory,selectedPostId:this.props.selectedPostId,selectedPostCardId:this.props.selectedPostCardId,previousRhsState:this.props.previousRhsState})})),ea(this,"handleShortcut",(e=>{const t=(0,Xn.V5)()&&e.shiftKey,n=!(0,Xn.V5)()&&e.altKey;(0,st._)(e,!0)&&(e.shiftKey&&(0,st.p)(e,h.default.KeyCodes.PERIOD)?(e.preventDefault(),this.props.isOpen?this.props.isExpanded?this.props.actions.setRhsExpanded(!1):this.props.actions.setRhsExpanded(!0):this.props.actions.openAtPrevious(this.previous)):(0,st.p)(e,h.default.KeyCodes.PERIOD)?(e.preventDefault(),this.props.isOpen?this.props.actions.closeRightHandSide():this.props.actions.openAtPrevious(this.previous)):(0,st.p)(e,h.default.KeyCodes.I)&&(t||n)&&(e.preventDefault(),this.props.isOpen&&this.props.isChannelInfo?this.props.actions.closeRightHandSide():this.props.channel&&this.props.actions.showChannelInfo(this.props.channel.id)))})),ea(this,"handleClickOutside",(e=>{var t,n,a,i;!(this.props.isOpen&&this.props.isExpanded&&e.target&&null!==(t=document.getElementById("root"))&&void 0!==t&&t.contains(e.target))||null!==(n=this.sidebarRight.current)&&void 0!==n&&n.contains(e.target)||null!==(a=document.getElementById("global-header"))&&void 0!==a&&a.contains(e.target)||null!==(i=document.querySelector(".app-bar"))&&void 0!==i&&i.contains(e.target)||this.props.actions.setRhsExpanded(!1)})),ea(this,"handleUpdateSearchTerms",(e=>{var t;this.props.actions.updateSearchTerms(e),null===(t=this.focusSearchBar)||void 0===t||t.call(this)})),ea(this,"getSearchBarFocus",(e=>{this.focusSearchBar=e})),this.sidebarRightWidthHolder=f().createRef(),this.sidebarRight=f().createRef(),this.state={isOpened:!1}}componentDidMount(){document.addEventListener("keydown",this.handleShortcut),document.addEventListener("mousedown",this.handleClickOutside)}componentWillUnmount(){document.removeEventListener("keydown",this.handleShortcut),document.removeEventListener("mousedown",this.handleClickOutside)}componentDidUpdate(e){var t,n;const a=e.searchVisible||e.postRightVisible,i=this.props.searchVisible||this.props.postRightVisible;!a&&i&&(0,E.L9)("ui","ui_rhs_opened");const{actions:s,isChannelFiles:r,isPinnedPosts:o,rhsChannel:l,channel:c}=this.props;o&&e.isPinnedPosts===o&&l&&l.id!==(null===(t=e.rhsChannel)||void 0===t?void 0:t.id)&&s.showPinnedPosts(l.id),r&&e.isChannelFiles===r&&l&&l.id!==(null===(n=e.rhsChannel)||void 0===n?void 0:n.id)&&s.showChannelFiles(l.id),(c&&e.channel&&c.id!==e.channel.id||c&&!e.channel)&&this.props.actions.setRhsExpanded(!1),(e.teamId&&this.props.teamId!==e.teamId||this.props.productId!==e.productId)&&this.props.actions.closeRightHandSide(),this.setPrevious()}render(){const{team:e,channel:t,rhsChannel:n,postRightVisible:a,postCardVisible:i,previousRhsState:s,searchVisible:r,isPluginView:o,isOpen:l,isChannelInfo:c,isChannelMembers:d,isExpanded:h,isPostEditHistory:u}=this.props;if(!l)return null;let m,p,b=null;a?(m=!0,b=f().createElement("div",{className:"post-right__container"},f().createElement(wt.default,{overlayType:"right"}),f().createElement(Wn,{previousRhsState:s}))):i?b=f().createElement(wn,{previousRhsState:s}):o?b=f().createElement($n,null):c?(p=!0,b=f().createElement(Ke,null)):d?(p=!0,b=f().createElement(Tt,null)):u&&(b=f().createElement(on,null));const E=Boolean(!e||m&&!n||p&&!t),_=n?n.display_name:"",v=(a||i||o||r||u)&&h,C=g()("sidebar--right","move--left is-open",{"sidebar--right--expanded expanded":v});return f().createElement(f().Fragment,null,f().createElement("div",{className:"sidebar--right sidebar--right--width-holder",ref:this.sidebarRightWidthHolder}),f().createElement(un,{className:C,id:"sidebar-right",role:"complementary",rightWidthHolderRef:this.sidebarRightWidthHolder},f().createElement("div",{className:"sidebar-right-container",ref:this.sidebarRight},E?f().createElement("div",{className:"sidebar-right__body"},f().createElement(St.Z,{centered:!0})):f().createElement(Jn.Z,{isSideBarRight:!0,isSideBarRightOpen:!0,getFocus:this.getSearchBarFocus,channelDisplayName:_},b))))}}ea(ta,"propTypes",{isExpanded:m().bool.isRequired,isOpen:m().bool.isRequired,postRightVisible:m().bool.isRequired,postCardVisible:m().bool.isRequired,searchVisible:m().bool.isRequired,isPinnedPosts:m().bool.isRequired,isChannelFiles:m().bool.isRequired,isChannelInfo:m().bool.isRequired,isChannelMembers:m().bool.isRequired,isPluginView:m().bool.isRequired,isPostEditHistory:m().bool.isRequired,selectedPostId:m().string.isRequired,selectedPostCardId:m().string.isRequired,actions:m().shape({setRhsExpanded:m().func.isRequired,showPinnedPosts:m().func.isRequired,openRHSSearch:m().func.isRequired,closeRightHandSide:m().func.isRequired,openAtPrevious:m().func.isRequired,updateSearchTerms:m().func.isRequired,showChannelFiles:m().func.isRequired,showChannelInfo:m().func.isRequired}).isRequired});const na=(0,i.withRouter)((0,a.connect)((function(e,t){var n;const a=(0,d.kV)(e),i=(0,r.TB)(e),s=(0,o.kA)(e),l=null!==(n=null==s?void 0:s.id)&&void 0!==n?n:"",u=(0,c.uJ)(e,t.location.pathname),m=(0,d.Bh)(e),p=(0,d.lW)(e);return{isExpanded:(0,d.OZ)(e),isOpen:(0,d.aC)(e),channel:i,postRightVisible:Boolean(m)&&a!==h.Hp.EDIT_HISTORY,postCardVisible:Boolean(p),searchVisible:Boolean(a)&&a!==h.Hp.PLUGIN,previousRhsState:(0,d.ZR)(e),isPinnedPosts:a===h.Hp.PIN,isChannelFiles:a===h.Hp.CHANNEL_FILES,isChannelInfo:a===h.Hp.CHANNEL_INFO,isChannelMembers:a===h.Hp.CHANNEL_MEMBERS,isPluginView:a===h.Hp.PLUGIN,isPostEditHistory:a===h.Hp.EDIT_HISTORY,rhsChannel:(0,d.Gu)(e),selectedPostId:m,selectedPostCardId:p,team:s,teamId:l,productId:u}}),(function(e){return{actions:(0,s.bindActionCreators)({setRhsExpanded:l.JI,showPinnedPosts:l.B7,openRHSSearch:l.Xv,closeRightHandSide:l.Lg,openAtPrevious:l.DQ,updateSearchTerms:l.MR,showChannelFiles:l.Cj,showChannelInfo:l.P_},e)}}))(ta))}}]); //# sourceMappingURL=766.6e930b2c9a4562a4e0e7.js.map