VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /opt/mattermost/client/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/mattermost/client/6743.0044bcd54c3717f53eed.js
"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[6743],{58628:(e,t,n)=>{n.d(t,{Ht:()=>d,uN:()=>c,Fu:()=>h,ng:()=>m,_M:()=>u}),n(43813);var a=n(23877),s=n(40693),r=n(92159),i=n(1418),o=n(87988),l=n(21413);function c(e,t){return(n,i)=>{const o=i(),c=(0,l.K7)(o);return n(function(e,t,n){return async(i,o)=>{const l=o(),c=(0,r.K)(l,e,t);try{await s.mT.deleteChannelBookmark(e,t,n),i({type:a.Fi.BOOKMARK_DELETED,data:c})}catch(e){return{data:!1,error:e}}return{data:!0}}}(e,t,c))}}function d(e,t){return(n,r)=>{const i=r(),o=(0,l.K7)(i);return n(function(e,t,n){return async r=>{try{const i=await s.mT.createChannelBookmark(e,t,n);r({type:a.Fi.RECEIVED_BOOKMARK,data:i})}catch(e){return{data:!1,error:e}}return{data:!0}}}(e,t,o))}}function h(e,t,n){return async(r,i)=>{const o=i(),c=(0,l.K7)(o);return r(function(e,t,n,r){return async i=>{try{const{updated:o,deleted:l}=await s.mT.updateChannelBookmark(e,t,n,r);o&&i({type:a.Fi.RECEIVED_BOOKMARK,data:o}),l&&i({type:a.Fi.BOOKMARK_DELETED,data:l})}catch(e){return{data:!1,error:e}}return{data:!0}}}(e,t,n,c))}}function u(e,t,n){return(r,i)=>{const o=i(),c=(0,l.K7)(o);return r(function(e,t,n,r){return async i=>{try{const o=await s.mT.updateChannelBookmarkSortOrder(e,t,n,r);i({type:a.Fi.RECEIVED_BOOKMARKS,data:{channelId:e,bookmarks:o}})}catch(e){return{data:!1,error:e}}return{data:!0}}}(e,t,n,c))}}function m(e){return function(e){return async(t,n)=>{let r;try{r=await s.mT.getChannelBookmarks(e),t({type:a.Fi.RECEIVED_BOOKMARKS,data:{channelId:e,bookmarks:r}})}catch(e){return(0,o.UP)(e,t,n),t((0,i.vV)(e)),{error:e}}return{data:r}}}(e)}},52073:(e,t,n)=>{n.d(t,{Go:()=>C,Jb:()=>u,Lt:()=>g,U5:()=>m,lE:()=>E,nh:()=>f,wf:()=>b,zZ:()=>p,zk:()=>h}),n(43813),n(74883);var a=n(4629),s=n(57898),r=n(8907),i=n(57676),o=n(65952),l=n(24380),c=n(9916),d=n(78451);function h(e){return{type:d.Q3.SET_UNREAD_FILTER_ENABLED,enabled:e}}function u(e){return{type:d.Q3.SIDEBAR_DRAGGING_SET_STATE,data:e}}function m(){return{type:d.Q3.SIDEBAR_DRAGGING_STOP}}function p(e,t,n){return async(s,r)=>{if(n){const e=r().views.channelSidebar.multiSelectedChannelIds;n.forEach((t=>{e.indexOf(t)>=0&&s(b(t))}))}const i=await s((0,a.zZ)(e,t,n));return s({type:d.Q3.ADD_NEW_CATEGORY_ID,data:i.data.id})}}function g(e,t){return f(e,0,t,!1)}function f(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(d,h)=>{const u=h(),m=u.views.channelSidebar.multiSelectedChannelIds;let p=[];if(m.length&&-1!==m.indexOf(n)){const t=(0,c.WJ)(u),a=(0,c.sC)(u);let i=[n];const o=t.find((t=>t.id===e));i=m.filter((e=>{const t=a.find((t=>e===t.id)),n=(null==t?void 0:t.type)===s.Bz.DM_CHANNEL||(null==t?void 0:t.type)===s.Bz.GM_CHANNEL;return(null==o?void 0:o.type)===r.e.CUSTOM||(null==o?void 0:o.type)===r.e.FAVORITES||n&&(null==o?void 0:o.type)===r.e.DIRECT_MESSAGES||!n&&(null==o?void 0:o.type)!==r.e.DIRECT_MESSAGES}));const l=a.map((e=>e.id));i.sort(((e,t)=>l.indexOf(e)-l.indexOf(t))),i.forEach((e=>d(b(e)))),p=i}else p=[n];const g=function(e,t,n,a,s){if(0===a)return 0;const r=(0,i.p7)(e,t),o=(0,i.n7)()(e,r),c=o.filter(((e,t)=>e!==s&&-1!==n.indexOf(e)&&t<=a)),d=a-c.length;if(r.channel_ids.length===o.length)return d;const h=(0,l.q3)(o,n,d),u=h[h.indexOf(n[0])-1];let m=r.channel_ids.indexOf(u)+1;const p=r.channel_ids.indexOf(n[0]);return-1!==p&&p<m&&(m-=1),Math.max(m-c.length,0)}(u,e,p,t,n);return d((0,a.jN)(e,p,g,o))}}function E(){return(e,t)=>0===t().views.channelSidebar.multiSelectedChannelIds.length?{data:!1}:(e({type:d.Q3.MULTISELECT_CHANNEL_CLEAR}),{data:!0})}function b(e){return(t,n)=>{const a=n();if(!a.views.channelSidebar.multiSelectedChannelIds.length){const e=(0,o.eH)(a);t({type:d.Q3.MULTISELECT_CHANNEL,data:e})}return t({type:d.Q3.MULTISELECT_CHANNEL_ADD,data:e})}}function C(e){return(t,n)=>{const a=n(),s=a.views.channelSidebar.multiSelectedChannelIds;let r=a.views.channelSidebar.lastSelectedChannel;if(!s.length){const e=(0,o.eH)(a);t({type:d.Q3.MULTISELECT_CHANNEL,data:e}),r=e}const i=(0,c.qY)(a).map((e=>e.id)),l=i.indexOf(e),h=i.indexOf(r);if(l===h)return{data:!1};const u=Math.min(h,l),m=Math.max(h,l),p=i.slice(u,m+1);return t({type:d.Q3.MULTISELECT_CHANNEL_TO,data:p})}}},40142:(e,t,n)=>{n.d(t,{A:()=>w}),n(3188),n(30973),n(97309),n(10844);var a=n(23453),s=n(52602),r=n(87373),i=n(23739),o=n(65952),l=n(75616),c=n(89247),d=n(62688),h=n.n(d),u=(n(43813),n(17046),n(29206),n(4290),n(97023)),m=n.n(u),p=n(34529),g=n(14778),f=n(65657),E=n(50375),b=n(83873),C=n(78451);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function v(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class _ extends m().PureComponent{constructor(e){super(e),v(this,"handleHide",(()=>{this.props.actions.setModalSearchTerm(""),this.setState({show:!1})})),v(this,"handleResponse",(e=>{let t=null;e&&e.message&&(t=e.message),this.setState({saving:!1,addError:t})})),v(this,"handleSubmit",(async()=>{const e=this.state.values.map((e=>e.id));if(0!==e.length){if(this.props.skipCommit)return this.props.onAddCallback&&this.props.onAddCallback(e),void this.handleHide();this.setState({saving:!0}),await Promise.all(e.map((async e=>{const{error:t}=await this.props.actions.linkGroupSyncable(e,this.props.currentChannelId,f.CL.Channel,{auto_add:!0});this.handleResponse(t),t||this.handleHide()})))}})),v(this,"addValue",(e=>{const t=Object.assign([],this.state.values),n=t.map((e=>e.id));e&&e.id&&-1===n.indexOf(e.id)&&t.push(e),this.setState({values:t})})),v(this,"setGroupsLoadingState",(e=>{this.setState({loadingGroups:e})})),v(this,"handlePageChange",((e,t)=>{e>t&&(this.setGroupsLoadingState(!0),this.props.actions.getGroupsNotAssociatedToChannel(this.props.currentChannelId,this.props.searchTerm,e,51,!0).then((()=>{this.setGroupsLoadingState(!1)})))})),v(this,"handleDelete",(e=>{this.setState({values:e})})),v(this,"search",(e=>{this.props.actions.setModalSearchTerm(e)})),v(this,"renderOption",((e,t,n,a)=>{const s=t?"more-modal__row--selected":"";return m().createElement("div",{key:e.id,ref:t?this.selectedItemRef:e.id,className:"more-modal__row clickable "+s,onClick:()=>n(e),onMouseMove:()=>a?a(e):void 0},m().createElement("img",{className:"more-modal__image",src:b,alt:"group picture",width:"32",height:"32"}),m().createElement("div",{className:"more-modal__details"},m().createElement("div",{className:"more-modal__name"},e.display_name," - ",m().createElement("span",{className:"more-modal__name_sub"},m().createElement(g.FormattedMessage,{id:"numMembers",defaultMessage:"{num, number} {num, plural, one {member} other {members}}",values:{num:e.member_count}})))),m().createElement("div",{className:"more-modal__actions"},m().createElement("div",{className:"more-modal__actions--round"},m().createElement("i",{className:"icon icon-plus"}))))})),this.searchTimeoutId=0,this.state={values:[],show:!0,search:!1,saving:!1,addError:null,loadingGroups:!0},this.selectedItemRef=m().createRef()}componentDidMount(){Promise.all([this.props.actions.getTeam(this.props.teamID),this.props.actions.getAllGroupsAssociatedToTeam(this.props.teamID,!1,!0),this.props.actions.getGroupsNotAssociatedToChannel(this.props.currentChannelId,"",0,51,!0),this.props.actions.getAllGroupsAssociatedToChannel(this.props.currentChannelId,!1,!0)]).then((()=>{this.setGroupsLoadingState(!1)}))}componentDidUpdate(e){if(this.props.searchTerm!==e.searchTerm){clearTimeout(this.searchTimeoutId);const e=this.props.searchTerm;if(""===e)return;this.searchTimeoutId=window.setTimeout((async()=>{this.setGroupsLoadingState(!0),await this.props.actions.getGroupsNotAssociatedToChannel(this.props.currentChannelId,e,void 0,void 0,!0),this.setGroupsLoadingState(!1)}),C.Ay.SEARCH_TIMEOUT_MILLISECONDS)}}renderValue(e){return e.data.display_name}render(){const e=m().createElement("div",{id:"numGroupsRemaining"},m().createElement(g.FormattedMessage,{id:"multiselect.numGroupsRemaining",defaultMessage:"Use ↑↓ to browse, ↵ to select. You can add {num, number} more {num, plural, one {group} other {groups}}. ",values:{num:10-this.state.values.length}})),t=(0,g.defineMessage)({id:"multiselect.add",defaultMessage:"Add"}),n=(0,g.defineMessage)({id:"multiselect.adding",defaultMessage:"Adding..."});let a=null;this.state.addError&&(a=m().createElement("div",{className:"has-error col-sm-12"},m().createElement("label",{className:"control-label font-weight--normal"},this.state.addError)));let s=this.props.groups;if(this.props.excludeGroups){const e=e=>!this.props.excludeGroups.find((t=>t.id===e.id));s=s.filter(e)}if(this.props.includeGroups){const e=e=>this.props.includeGroups.find((t=>t.id===e.id));s=[...s,...this.props.includeGroups.filter(e)]}const r=s.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({label:e.display_name,value:e.id},e)));return m().createElement(p.Modal,{id:"addGroupsToChannelModal",dialogClassName:"a11y__modal more-modal more-direct-channels",show:this.state.show,onHide:this.handleHide,onExited:this.props.onExited},m().createElement(p.Modal.Header,{closeButton:!0},m().createElement(p.Modal.Title,{componentClass:"h1"},m().createElement(g.FormattedMessage,{id:"add_groups_to_channel.title",defaultMessage:"Add New Groups to {channelName} Channel",values:{channelName:m().createElement("strong",null,this.props.currentChannelName)}}))),m().createElement(p.Modal.Body,null,a,m().createElement(E.A,{key:"addGroupsToChannelKey",options:r,optionRenderer:this.renderOption,intl:this.props.intl,selectedItemRef:this.selectedItemRef,values:this.state.values,valueRenderer:this.renderValue,perPage:50,handlePageChange:this.handlePageChange,handleInput:this.search,handleDelete:this.handleDelete,handleAdd:this.addValue,handleSubmit:this.handleSubmit,maxValues:10,numRemainingText:e,buttonSubmitText:t,buttonSubmitLoadingText:n,saving:this.state.saving,loading:this.state.loadingGroups,placeholderText:(0,g.defineMessage)({id:"multiselect.addGroupsPlaceholder",defaultMessage:"Search and add groups"})})))}}v(_,"propTypes",{currentChannelName:h().string.isRequired,currentChannelId:h().string.isRequired,teamID:h().string.isRequired,searchTerm:h().string.isRequired,groups:h().array.isRequired,excludeGroups:h().array,includeGroups:h().array,onExited:h().func.isRequired,skipCommit:h().bool,onAddCallback:h().func,actions:h().shape({getGroupsNotAssociatedToChannel:h().func.isRequired,setModalSearchTerm:h().func.isRequired,linkGroupSyncable:h().func.isRequired,getAllGroupsAssociatedToChannel:h().func.isRequired,getTeam:h().func.isRequired,getAllGroupsAssociatedToTeam:h().func.isRequired}).isRequired});const M=(0,g.injectIntl)(_),w=(0,a.connect)((function(e,t){const n=e.views.search.modalSearch,a=t.channel||(0,o.Lw)(e)||{};let s=(0,l.m5)(e,a.id,a.team_id);if(n){const e=RegExp(n,"i");s=s.filter((t=>e.test(t.display_name)||e.test(t.name)))}return{currentChannelName:a.display_name,currentChannelId:a.id,skipCommit:t.skipCommit,onAddCallback:t.onAddCallback,excludeGroups:t.excludeGroups,searchTerm:n,groups:s,teamID:a.team_id}}),(function(e){return{actions:(0,s.bindActionCreators)({getGroupsNotAssociatedToChannel:r.m5,setModalSearchTerm:c.qv,linkGroupSyncable:r.PY,getAllGroupsAssociatedToChannel:r.oj,getTeam:i.Uo,getAllGroupsAssociatedToTeam:r.UT},e)}}))(M)},89427:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ee});var a=n(23453),s=n(52602),r=n(30413),i=n(57898),o=n(8361),l=n(65952),c=n(26614),d=n(14776),h=n(7430),u=n(61185),m=n(79751),p=n(2386),g=n(75270),f=n(77212),E=n(78451),b=n(62688),C=n.n(b),y=(n(3188),n(30973),n(43813),n(10844),n(74883),n(17046),n(54823),n(29012),n(4290),n(71633)),v=n.n(y),_=n(97023),M=n.n(_),w=n(14778),S=n(14696),T=n(16983),A=n(1396),I=n(98089),N=n(26808),L=n(85406),R=n(16230);n(29206);const P=e=>M().createElement("svg",Object.assign({width:140,height:141,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),M().createElement("path",{opacity:.4,d:"M37.593 38.008c4.754-4.815 10.754-7.295 17.989-7.428 7.101.133 13.065 2.601 17.892 7.428 4.815 4.827 7.295 10.791 7.428 17.892-.133 7.235-2.601 13.223-7.428 17.99-4.827 4.754-10.791 7.27-17.892 7.512-7.235-.254-13.223-2.758-17.99-7.513-4.754-4.766-7.258-10.766-7.512-18 .254-7.102 2.758-13.066 7.513-17.881Z",fill:"#fff"}),M().createElement("path",{d:"M78.887 51.382c-2.151-6.992-6.225-12.225-12.226-15.69-6.001-3.465-12.57-4.376-19.701-2.743-3.9.995-7.297 2.717-10.22 5.162 3.269-3.567 7.415-6.037 12.428-7.416 7.13-1.633 13.732-.703 19.787 2.793s10.161 8.748 12.313 15.74c1.323 5.037 1.257 9.862-.21 14.47-1.454 4.614-4.066 8.49-7.84 11.611 2.833-3.087 4.783-6.713 5.844-10.894 1.05-4.187.991-8.522-.175-13.033Z",fill:"#000",fillOpacity:.4}),M().createElement("path",{d:"M86.76 53.929c-.508-7.506-3.553-14.097-9.125-19.774-6.346-6.05-13.67-9.08-21.974-9.08-8.303 0-15.616 3.03-21.961 9.08-6.08 6.315-9.126 13.591-9.126 21.855 0 8.262 3.046 15.551 9.126 21.854 5.826 5.556 12.485 8.551 19.967 8.984 7.481.445 14.383-1.611 20.728-6.146l4.75 4.727 6.08-6.05-4.75-4.727c4.69-6.302 6.78-13.218 6.285-20.723Zm-13.126 19.87c-4.823 4.726-10.781 7.228-17.876 7.468-7.228-.252-13.21-2.742-17.973-7.469-4.75-4.727-7.252-10.692-7.506-17.885.254-7.06 2.756-12.99 7.506-17.789 4.75-4.787 10.745-7.252 17.973-7.385 7.095.133 13.053 2.586 17.876 7.385 4.81 4.8 7.288 10.73 7.421 17.79-.133 7.192-2.599 13.157-7.421 17.884Z",fill:"#BABEC9"}),M().createElement("path",{d:"M106.202 114.187c-1.567.449-2.728.291-3.482-.472L78.06 86.651c-.753-.762-1.064-1.743-.945-2.954.12-1.211.874-2.567 2.262-4.093 1.507-1.393 2.847-2.192 4.044-2.385 1.196-.194 2.165.157 2.92 1.053l26.921 24.957c.753.763.873 1.901.37 3.427-.502 1.525-1.447 3.051-2.823 4.577-1.496 1.526-3.039 2.506-4.607 2.954Z",fill:"#FFBC1F"}),M().createElement("path",{d:"m108.007 98.343-10.08 10.164-12.154-13.34 8.914-9.106 13.32 12.282Z",fill:"#7A5600"}));var O=n(18986),k=n(86255),D=n(59050),x=n(90617),F=n(55476),H=n(78064),U=n(19513),B=n(4715);function q(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class j extends M().PureComponent{static getDerivedStateFromProps(e,t){return{isSearch:e.isSearch,page:e.isSearch&&!t.isSearch?0:t.page}}constructor(e){super(e),q(this,"onKeyDown",(e=>{const t=e.target,n=(0,U.e)(e,E.Ay.KeyCodes.ENTER);n&&(e.shiftKey||e.ctrlKey||e.altKey)||n&&null!=t&&t.classList.contains("more-modal__row")&&t.click()})),q(this,"handleJoin",((e,t)=>{t.stopPropagation(),this.setState({joiningChannel:e.id}),this.props.handleJoin(e,(()=>{this.setState({joiningChannel:""})})),this.isMemberOfChannel(e.id)&&this.props.closeModal(E.IQ.MORE_CHANNELS)})),q(this,"createChannelRow",(e=>{var t;const n="".concat(e.display_name,", ").concat(e.purpose).toLowerCase();let a;a=(0,H.Oj)(e)?M().createElement(L.ArchiveOutlineIcon,{size:18}):(0,R.Zp)(e)?M().createElement(L.LockOutlineIcon,{size:18}):M().createElement(L.GlobeIcon,{size:18});let s=0;null!==(t=this.props.channelsMemberCount)&&void 0!==t&&t[e.id]&&(s=this.props.channelsMemberCount[e.id]);const r=this.isMemberOfChannel(e.id)?M().createElement("div",{id:"membershipIndicatorContainer","aria-label":this.props.intl.formatMessage({id:"more_channels.membership_indicator",defaultMessage:"Membership Indicator: Joined"})},M().createElement(L.CheckIcon,{size:14}),M().createElement(w.FormattedMessage,{id:"more_channels.joined",defaultMessage:"Joined"})):null,i=this.props.intl.formatMessage(V.channelPurpose,{memberCount:s,channelPurpose:e.purpose||""}),o=M().createElement("div",{id:"channelPurposeContainer","aria-label":i},r,r?M().createElement("span",{className:"dot"}):null,M().createElement(L.AccountOutlineIcon,{size:14}),M().createElement("span",{"data-testid":"channelMemberCount-".concat(e.name)},s),e.purpose.length>0?M().createElement("span",{className:"dot"}):null,M().createElement("span",{className:"more-modal__description"},e.purpose)),l=v()("btn btn-sm",{"btn-secondary outlineButton":this.isMemberOfChannel(e.id),"btn-primary primaryButton":!this.isMemberOfChannel(e.id)}),c=M().createElement("button",{id:"joinViewChannelButton",onClick:t=>this.handleJoin(e,t),className:l,disabled:Boolean(this.state.joiningChannel),tabIndex:-1,"aria-label":this.isMemberOfChannel(e.id)?this.props.intl.formatMessage({id:"more_channels.view",defaultMessage:"View"}):this.props.intl.formatMessage({id:"joinChannel.JoinButton",defaultMessage:"Join"})},M().createElement(F.A,{loading:this.state.joiningChannel===e.id,text:V.joiningButton},M().createElement(w.FormattedMessage,{id:this.isMemberOfChannel(e.id)?"more_channels.view":"joinChannel.JoinButton",defaultMessage:this.isMemberOfChannel(e.id)?"View":"Join"}))),d=e.shared?M().createElement(D.A,{className:"shared-channel-icon",withTooltip:!0}):null;return M().createElement("div",{className:"more-modal__row",key:e.id,id:"ChannelRow-".concat(e.name),"data-testid":"ChannelRow-".concat(e.name),"aria-label":n,onClick:t=>this.handleJoin(e,t),tabIndex:0},M().createElement("div",{className:"more-modal__details"},M().createElement("div",{className:"style--none more-modal__name"},a,M().createElement("span",{id:"channelName"},e.display_name),d),o),M().createElement("div",{className:"more-modal__actions"},c))})),q(this,"nextPage",(e=>{var t;e.preventDefault(),this.setState({page:this.state.page+1,nextDisabled:!0}),this.nextTimeoutId=setTimeout((()=>this.setState({nextDisabled:!1})),500),this.props.nextPage(this.state.page+1),null===(t=this.channelListScroll.current)||void 0===t||t.scrollTo({top:0})})),q(this,"previousPage",(e=>{var t;e.preventDefault(),this.setState({page:this.state.page-1}),null===(t=this.channelListScroll.current)||void 0===t||t.scrollTo({top:0})})),q(this,"doSearch",(()=>{this.props.search(this.state.channelSearchValue),""===this.state.channelSearchValue&&this.setState({page:0})})),q(this,"handleChange",(e=>{null!=e&&e.currentTarget&&this.setState({channelSearchValue:null==e?void 0:e.currentTarget.value},(()=>this.doSearch()))})),q(this,"handleClear",(()=>{this.setState({channelSearchValue:""},(()=>this.doSearch()))})),q(this,"handleChecked",(()=>{this.props.rememberHideJoinedChannelsChecked?this.props.hideJoinedChannelsPreference(!1):this.props.hideJoinedChannelsPreference(!0)})),q(this,"getEmptyStateMessage",(()=>{if(this.state.channelSearchValue.length>0)return M().createElement(w.FormattedMessage,{id:"more_channels.noMore",tagName:"strong",defaultMessage:"No results for {text}",values:{text:this.state.channelSearchValue}});switch(this.props.filter){case Y.Archived:return M().createElement(w.FormattedMessage,{id:"more_channels.noArchived",tagName:"strong",defaultMessage:"No archived channels"});case Y.Private:return M().createElement(w.FormattedMessage,{id:"more_channels.noPrivate",tagName:"strong",defaultMessage:"No private channels"});case Y.Public:return M().createElement(w.FormattedMessage,{id:"more_channels.noPublic",tagName:"strong",defaultMessage:"No public channels"});default:return M().createElement(w.FormattedMessage,{id:"more_channels.noChannels",tagName:"strong",defaultMessage:"No channels"})}})),q(this,"getFilterLabel",(()=>{switch(this.props.filter){case Y.Archived:return M().createElement(w.FormattedMessage,{id:"more_channels.show_archived_channels",defaultMessage:"Channel Type: Archived"});case Y.Public:return M().createElement(w.FormattedMessage,{id:"more_channels.show_public_channels",defaultMessage:"Channel Type: Public"});case Y.Private:return M().createElement(w.FormattedMessage,{id:"more_channels.show_private_channels",defaultMessage:"Channel Type: Private"});default:return M().createElement(w.FormattedMessage,{id:"more_channels.show_all_channels",defaultMessage:"Channel Type: All"})}})),this.nextTimeoutId=0,this.state={joiningChannel:"",page:0,nextDisabled:!1,channelSearchValue:""},this.filter=M().createRef(),this.channelListScroll=M().createRef()}componentDidMount(){!B.Fr()&&this.filter.current&&this.filter.current.focus(),document.addEventListener("keydown",this.onKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.onKeyDown)}isMemberOfChannel(e){return this.props.myChannelMemberships[e]}render(){const e=this.props.channels;let t,n,a;if(this.props.loading&&0===e.length)t=M().createElement(A.A,null);else if(0===e.length)t=M().createElement("div",{className:"no-channel-message","aria-label":this.state.channelSearchValue.length>0?this.props.intl.formatMessage(V.noMore,{text:this.state.channelSearchValue}):this.props.intl.formatMessage({id:"widgets.channels_input.empty",defaultMessage:"No channels found"})},M().createElement(P,null),M().createElement("h3",{className:"primary-message"},this.getEmptyStateMessage()),this.props.noResultsText);else{const e=this.state.page*this.props.channelsPerPage,s=e+this.props.channelsPerPage,r=this.props.channels.slice(e,s);t=r.map(this.createChannelRow),r.length>=this.props.channelsPerPage&&s<this.props.channels.length&&(n=M().createElement("button",{className:"btn btn-sm btn-tertiary filter-control filter-control__next",onClick:this.nextPage,disabled:this.state.nextDisabled,"aria-label":this.props.intl.formatMessage({id:"more_channels.next",defaultMessage:"Next"})},M().createElement(w.FormattedMessage,{id:"more_channels.next",defaultMessage:"Next"}))),this.state.page>0&&(a=M().createElement("button",{className:"btn btn-sm btn-tertiary filter-control filter-control__prev",onClick:this.previousPage,"aria-label":this.props.intl.formatMessage({id:"more_channels.prev",defaultMessage:"Previous"})},M().createElement(w.FormattedMessage,{id:"more_channels.prev",defaultMessage:"Previous"})))}const s=M().createElement("div",{className:"filter-row filter-row--full"},M().createElement("span",{id:"searchIcon","aria-hidden":"true"},M().createElement("i",{className:"icon icon-magnify"})),M().createElement(k.A,{id:"searchChannelsTextbox",ref:this.filter,className:"form-control filter-textbox",placeholder:this.props.intl.formatMessage({id:"filtered_channels_list.search",defaultMessage:"Search channels"}),onInput:this.handleChange,clearable:!0,onClear:this.handleClear,value:this.state.channelSearchValue,"aria-label":this.props.intl.formatMessage({id:"filtered_channels_list.search",defaultMessage:"Search Channels"})})),r=M().createElement(L.CheckIcon,{size:18,color:"var(--button-bg)"}),i=[M().createElement(O.q7,{key:"channelsMoreDropdownAll",id:"channelsMoreDropdownAll",onClick:()=>this.props.changeFilter(Y.All),leadingElement:M().createElement(L.GlobeCheckedIcon,{size:16}),labels:M().createElement(w.FormattedMessage,{id:"suggestion.all",defaultMessage:"All channel types"}),trailingElements:this.props.filter===Y.All?r:null,"aria-label":this.props.intl.formatMessage({id:"suggestion.all",defaultMessage:"All channel types"})}),M().createElement(O.q7,{key:"channelsMoreDropdownPublic",id:"channelsMoreDropdownPublic",onClick:()=>this.props.changeFilter(Y.Public),leadingElement:M().createElement(L.GlobeIcon,{size:16}),labels:M().createElement(w.FormattedMessage,{id:"suggestion.public",defaultMessage:"Public channels"}),trailingElements:this.props.filter===Y.Public?r:null,"aria-label":this.props.intl.formatMessage({id:"suggestion.public",defaultMessage:"Public channels"})}),M().createElement(O.q7,{key:"channelsMoreDropdownPrivate",id:"channelsMoreDropdownPrivate",onClick:()=>this.props.changeFilter(Y.Private),leadingElement:M().createElement(L.LockOutlineIcon,{size:16}),labels:M().createElement(w.FormattedMessage,{id:"suggestion.private",defaultMessage:"Private channels"}),trailingElements:this.props.filter===Y.Private?r:null,"aria-label":this.props.intl.formatMessage({id:"suggestion.private",defaultMessage:"Private channels"})})];this.props.canShowArchivedChannels&&i.push(M().createElement(O.wv,{key:"channelsMoreDropdownSeparator"}),M().createElement(O.q7,{key:"channelsMoreDropdownArchived",id:"channelsMoreDropdownArchived",onClick:()=>this.props.changeFilter(Y.Archived),leadingElement:M().createElement(L.ArchiveOutlineIcon,{size:16}),labels:M().createElement(w.FormattedMessage,{id:"suggestion.archive",defaultMessage:"Archived channels"}),trailingElements:this.props.filter===Y.Archived?r:null,"aria-label":this.props.intl.formatMessage({id:"suggestion.archive",defaultMessage:"Archived channels"})}));const o=M().createElement(M().Fragment,null,this.getFilterLabel(),M().createElement(L.ChevronDownIcon,{color:"rgba(var(--center-channel-color-rgb), 0.64)",size:16})),l=M().createElement(O.mc,{menuButton:{id:"menuWrapper",children:o},menu:{id:"browseChannelsDropdown","aria-label":this.props.intl.formatMessage({id:"more_channels.title",defaultMessage:"Browse channels"})}},i.map((e=>e))),c=v()("get-app__checkbox",{checked:this.props.rememberHideJoinedChannelsChecked}),d=M().createElement("div",{id:"hideJoinedPreferenceCheckbox",onClick:this.handleChecked},M().createElement("button",{className:c,"aria-label":this.props.rememberHideJoinedChannelsChecked?this.props.intl.formatMessage({id:"more_channels.hide_joined_checked",defaultMessage:"Hide joined channels checkbox, checked"}):this.props.intl.formatMessage({id:"more_channels.hide_joined_not_checked",defaultMessage:"Hide joined channels checkbox, not checked"})},this.props.rememberHideJoinedChannelsChecked?M().createElement(x.A,null):null),M().createElement(w.FormattedMessage,{id:"more_channels.hide_joined",defaultMessage:"Hide Joined"}));let h;h=0===e.length?this.props.intl.formatMessage({id:"more_channels.count_zero",defaultMessage:"0 Results"}):1===e.length?this.props.intl.formatMessage({id:"more_channels.count_one",defaultMessage:"1 Result"}):e.length>1?this.props.intl.formatMessage(V.channelCount,{count:e.length}):this.props.intl.formatMessage({id:"more_channels.count_zero",defaultMessage:"0 Results"});const u=M().createElement("div",{className:"more-modal__dropdown"},M().createElement("span",{id:"channelCountLabel"},h),M().createElement("div",{id:"modalPreferenceContainer"},l,d));return M().createElement("div",{className:"filtered-user-list"},s,u,M().createElement("div",{role:"search",className:"more-modal__list",tabIndex:-1},M().createElement("div",{id:"moreChannelsList",tabIndex:-1,ref:this.channelListScroll},t)),M().createElement("div",{className:"filter-controls"},a,n))}}q(j,"propTypes",{channels:C().array.isRequired,channelsPerPage:C().number.isRequired,nextPage:C().func.isRequired,isSearch:C().bool.isRequired,search:C().func.isRequired,handleJoin:C().func.isRequired,noResultsText:C().element.isRequired,changeFilter:C().func.isRequired,closeModal:C().func.isRequired,hideJoinedChannelsPreference:C().func.isRequired,rememberHideJoinedChannelsChecked:C().bool.isRequired,canShowArchivedChannels:C().bool,loading:C().bool,channelsMemberCount:C().objectOf(C().number)});const V=(0,w.defineMessages)({channelCount:{id:"more_channels.count",defaultMessage:"{count} Results"},channelPurpose:{id:"more_channels.channel_purpose",defaultMessage:"Channel Information: Membership Indicator: Joined, Member count {memberCount} , Purpose: {channelPurpose}"},joiningButton:{id:"joinChannel.joiningButton",defaultMessage:"Joining..."},noMore:{id:"more_channels.noMore",defaultMessage:"No results for {text}"}}),G=(0,w.injectIntl)(j);var W=n(83007),z=n(63155),K=n(85873);function J(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Y=function(e){return e.All="All",e.Public="Public",e.Private="Private",e.Archived="Archived",e}({});class Q extends M().PureComponent{constructor(e){super(e),J(this,"activeChannels",[]),J(this,"loadComplete",(()=>{this.setState({loading:!1})})),J(this,"handleNewChannel",(()=>{this.handleExit(),this.closeEditRHS(),this.props.actions.openModal({modalId:E.IQ.NEW_CHANNEL_MODAL,dialogType:I.default})})),J(this,"handleExit",(()=>{this.props.actions.closeModal(E.IQ.MORE_CHANNELS)})),J(this,"closeEditRHS",(()=>{this.props.rhsOpen&&this.props.rhsState===E._n.EDIT_HISTORY&&this.props.actions.closeRightHandSide()})),J(this,"onChange",(e=>{this.state.search&&!e||this.setState({searchedChannels:[],serverError:null})})),J(this,"nextPage",(e=>{this.props.actions.getChannels(this.props.teamId,e+1,50).then((e=>{e.data&&e.data.length>0&&this.props.actions.getChannelsMemberCount(e.data.map((e=>e.id)))}))})),J(this,"handleJoin",(async(e,t)=>{var n;const{actions:a,currentUserId:s,teamId:r,teamName:i}=this.props;let o;this.isMemberOfChannel(e.id)||(o=await a.joinChannel(s,r,e.id)),null!==(n=o)&&void 0!==n&&n.error?this.setState({serverError:o.error.message}):(this.props.actions.getChannelsMemberCount([e.id]),(0,W.J)().push((0,z.d7)(i,e.name)),this.closeEditRHS()),t&&t()})),J(this,"search",(e=>{if(clearTimeout(this.searchTimeoutId),""===e)return this.onChange(!0),this.setState({search:!1,searchedChannels:[],searching:!1,searchTerm:e}),void(this.searchTimeoutId=0);this.setState({search:!0,searching:!0,searchTerm:e});const t=window.setTimeout((async()=>{try{const{data:n}=await this.props.actions.searchAllChannels(e,{team_ids:[this.props.teamId],nonAdminSearch:!0,include_deleted:!0});if(t!==this.searchTimeoutId)return;if(n){const e=n.map((e=>e.id));e.length>0&&this.props.actions.getChannelsMemberCount(e),this.setSearchResults(n.filter((e=>e.team_id===this.props.teamId)))}else this.setState({searchedChannels:[],searching:!1})}catch(e){this.setState({searchedChannels:[],searching:!1})}}),100);this.searchTimeoutId=t})),J(this,"setSearchResults",(e=>{let t=e.filter((e=>e.type!==E.Ay.PRIVATE_CHANNEL||this.isMemberOfChannel(e.id)));this.state.filter===Y.Private&&(t=e.filter((e=>e.type===E.Ay.PRIVATE_CHANNEL&&this.isMemberOfChannel(e.id)))),this.state.filter===Y.Public&&(t=e.filter((e=>e.type===E.Ay.OPEN_CHANNEL&&0===e.delete_at))),this.state.filter===Y.Archived&&(t=e.filter((e=>0!==e.delete_at))),this.props.shouldHideJoinedChannels&&(t=this.getChannelsWithoutJoined(t)),this.setState({searchedChannels:t,searching:!1})})),J(this,"changeFilter",(e=>{this.search(this.state.searchTerm),this.setState({filter:e})})),J(this,"handleShowJoinedChannelsPreference",(e=>{this.search(this.state.searchTerm),this.props.actions.setGlobalItem(E.eN.HIDE_JOINED_CHANNELS,e.toString())})),J(this,"getChannelsWithoutJoined",(e=>e.filter((e=>!this.isMemberOfChannel(e.id))))),J(this,"getActiveChannels",(()=>{const{channels:e,archivedChannels:t,shouldHideJoinedChannels:n,privateChannels:a}=this.props,{search:s,searchedChannels:r,filter:i}=this.state,o=e.concat(a).sort(((e,t)=>e.display_name.localeCompare(t.display_name))),l=this.getChannelsWithoutJoined(o),c=this.getChannelsWithoutJoined(e),d=this.getChannelsWithoutJoined(t),h=this.getChannelsWithoutJoined(a),u={[Y.All]:n?l:o,[Y.Archived]:n?d:t,[Y.Private]:n?h:a,[Y.Public]:n?c:e};return s?r:u[i]||u[Y.All]})),this.searchTimeoutId=0,this.state={loading:!0,filter:Y.All,search:!1,searchedChannels:[],serverError:null,searching:!1,searchTerm:""}}componentDidMount(){if(!this.props.teamId)return void this.loadComplete();const e=[this.props.actions.getChannels(this.props.teamId,0,100)];this.props.canShowArchivedChannels&&e.push(this.props.actions.getArchivedChannels(this.props.teamId,0,100)),Promise.all(e).then((e=>{const t=e.flatMap((e=>e.data?e.data.map((e=>e.id)):[]));this.props.privateChannels.forEach((e=>t.push(e.id))),t.length>0&&this.props.actions.getChannelsMemberCount(t)})),this.loadComplete()}isMemberOfChannel(e){return this.props.myChannelMemberships[e]}render(){const{teamId:e,channelsRequestStarted:t,shouldHideJoinedChannels:n}=this.props,{search:a,serverError:s,searching:r}=this.state;let i;this.activeChannels=this.getActiveChannels(),s&&(i=M().createElement("div",{className:"form-group has-error"},M().createElement("label",{className:"control-label"},s)));const o=(t,n)=>{const a=v()("btn",t);return M().createElement(N.A,{teamId:e,permissions:[T.A.CREATE_PUBLIC_CHANNEL]},M().createElement("button",{type:"button",id:"createNewChannelButton",className:a,onClick:this.handleNewChannel,"aria-label":(0,K.Vw)({id:"more_channels.create",defaultMessage:"Create New Channel"})},n,M().createElement(w.FormattedMessage,{id:"more_channels.create",defaultMessage:"Create New Channel"})))},l=M().createElement(M().Fragment,null,M().createElement("p",{className:"secondary-message"},M().createElement(w.FormattedMessage,{id:"more_channels.searchError",defaultMessage:"Try searching different keywords, checking for typos or adjusting the filters."})),o("btn-primary",M().createElement("i",{className:"icon-plus"}))),c=this.state.loading?M().createElement(A.A,null):M().createElement(M().Fragment,null,M().createElement(G,{channels:this.activeChannels,channelsPerPage:50,nextPage:this.nextPage,isSearch:a,search:this.search,handleJoin:this.handleJoin,noResultsText:l,loading:a?r:t,changeFilter:this.changeFilter,filter:this.state.filter,canShowArchivedChannels:this.props.canShowArchivedChannels,myChannelMemberships:this.props.myChannelMemberships,closeModal:this.props.actions.closeModal,hideJoinedChannelsPreference:this.handleShowJoinedChannelsPreference,rememberHideJoinedChannelsChecked:n,channelsMemberCount:this.props.channelsMemberCount}),i),d=M().createElement(w.FormattedMessage,{id:"more_channels.title",defaultMessage:"Browse Channels"});return M().createElement(S.zW,{id:"browseChannelsModal","aria-labelledby":"browseChannelsModalLabel",onExited:this.handleExit,compassDesign:!0,modalHeaderText:d,headerButton:o("btn-secondary btn-sm"),autoCloseOnConfirmButton:!1,"aria-modal":!0,enforceFocus:!1,bodyPadding:!1},c)}}J(Q,"propTypes",{channels:C().array.isRequired,archivedChannels:C().array.isRequired,privateChannels:C().array.isRequired,currentUserId:C().string.isRequired,teamId:C().string.isRequired,teamName:C().string,channelsRequestStarted:C().bool,canShowArchivedChannels:C().bool,shouldHideJoinedChannels:C().bool.isRequired,rhsOpen:C().bool,channelsMemberCount:C().objectOf(C().number),actions:C().shape({getChannels:C().func.isRequired,getArchivedChannels:C().func.isRequired,joinChannel:C().func.isRequired,searchAllChannels:C().func.isRequired,openModal:C().func.isRequired,closeModal:C().func.isRequired,setGlobalItem:C().func.isRequired,closeRightHandSide:C().func.isRequired,getChannelsMemberCount:C().func.isRequired}).isRequired});const Z=(0,o.Mz)("getChannelsWithoutArchived",l.aW,(e=>e&&e.filter((e=>0===e.delete_at&&e.type!==E.Ay.PRIVATE_CHANNEL)))),X=(0,o.Mz)("getArchivedOtherChannels",l.aW,(e=>e&&e.filter((e=>0!==e.delete_at)))),$=(0,o.Mz)("getPrivateChannelsSelector",l.aW,(e=>e&&e.filter((e=>e.type===E.Ay.PRIVATE_CHANNEL)))),ee=(0,a.connect)((function(e){const t=(0,d.H7)(e),n=(0,f.zR)(E.eN.HIDE_JOINED_CHANNELS,"false");return{channels:Z(e)||[],archivedChannels:X(e)||[],privateChannels:$(e)||[],currentUserId:(0,h.WR)(e),teamId:(0,d.Sy)(e),teamName:null==t?void 0:t.name,channelsRequestStarted:e.requests.channels.getChannels.status===i.IZ.STARTED,canShowArchivedChannels:"true"===(0,c.zj)(e).ExperimentalViewArchivedChannels,myChannelMemberships:(0,l.vd)(e)||{},shouldHideJoinedChannels:"true"===n(e),rhsState:(0,g.bM)(e),rhsOpen:(0,g.A)(e),channelsMemberCount:(0,l.kV)(e)}}),(function(e){return{actions:(0,s.bindActionCreators)({getChannels:r.Jp,getArchivedChannels:r.xM,joinChannel:r.Cg,searchAllChannels:r.Q1,openModal:m.q,closeModal:m.O,setGlobalItem:u.X2,closeRightHandSide:p.bP,getChannelsMemberCount:r.kV},e)}}))(Q)},97026:(e,t,n)=>{n.d(t,{GX:()=>S,PM:()=>f,_4:()=>M,_E:()=>I,bY:()=>T,wR:()=>A}),n(74883),n(17046),n(76409),n(43813);var a=n(97023),s=n(23453),r=n(57898),i=n(92159),o=n(65952),l=n(26614),c=n(80635),d=n(24380),h=n(58628),u=n(33172),m=n(78451),p=n(78138),g=n(68124);const f=50,{OPEN_CHANNEL:E,PRIVATE_CHANNEL:b,GM_CHANNEL:C,DM_CHANNEL:y}=m.Ay,v=(e,t)=>"".concat(e).concat(t),_={[v("add",E)]:r.xB.ADD_BOOKMARK_PUBLIC_CHANNEL,[v("edit",E)]:r.xB.EDIT_BOOKMARK_PUBLIC_CHANNEL,[v("delete",E)]:r.xB.DELETE_BOOKMARK_PUBLIC_CHANNEL,[v("order",E)]:r.xB.ORDER_BOOKMARK_PUBLIC_CHANNEL,[v("add",b)]:r.xB.ADD_BOOKMARK_PRIVATE_CHANNEL,[v("edit",b)]:r.xB.EDIT_BOOKMARK_PRIVATE_CHANNEL,[v("delete",b)]:r.xB.DELETE_BOOKMARK_PRIVATE_CHANNEL,[v("order",b)]:r.xB.ORDER_BOOKMARK_PRIVATE_CHANNEL},M=(e,t)=>(0,s.useSelector)((n=>w(n,e,t))),w=(e,t,n)=>{const a=(0,o.c)(e,t);if(!a)return!1;if(0!==a.delete_at)return!1;const{type:s}=a;if("threads"===s)return!1;if(s===C||s===y){const n=(0,o.MQ)(e,t);return(null==n?void 0:n.channel_id)===t}const r=_[v(n,s)];return a&&r&&(0,c.Ec)(e,a.team_id,t,r)},S=()=>(0,s.useSelector)((e=>(0,g.DE)((0,l.zj)(e)))),T=()=>(0,s.useSelector)((e=>(0,g.kc)((0,l.zj)(e)))),A=e=>{if("true"!==(0,l.Y6)(e,"ChannelBookmarks"))return!1;const t=(0,l.Ay)(e);return"true"===(null==t?void 0:t.IsLicensed)},I=e=>{const t=(0,s.useDispatch)(),n=(0,s.useSelector)((t=>(0,i.H)(t,e))),r=(0,a.useMemo)((()=>Object.keys(n).sort(((e,t)=>n[e].sort_order-n[t].sort_order))),[n]),[o,l]=(0,a.useState)();return(0,a.useEffect)((()=>{o&&l(void 0)}),[r]),(0,a.useEffect)((()=>{e&&t((0,h.ng)(e))}),[e]),(0,a.useEffect)((()=>{const e=Object.values(n).reduce(((e,t)=>{let{emoji:n}=t;return n&&e.push((0,p.at)(n)),e}),[]);e.length&&t((0,u.fS)(e))}),[n]),{bookmarks:n,order:null!=o?o:r,reorder:async(n,a,s)=>{l((0,d.wq)(r,n,s));const{error:i}=await t((0,h._M)(e,n,s));i&&l(void 0)}}}},30135:(e,t,n)=>{n.d(t,{A:()=>o}),n(17046);var a=n(97023),s=n(11039),r=n(35412);const i=(e,t)=>t&&null!=e?e:Number.MAX_VALUE;function o(){const e=(0,r.A)(),[t,n]=(0,s.A)();return(0,a.useMemo)((()=>{var a,s,r;return{files:{totalStorage:e.files.totalStorage-i(null===(a=t.files)||void 0===a?void 0:a.total_storage,n),totalStorageLoaded:e.files.totalStorageLoaded},messages:{history:e.messages.history-i(null===(s=t.messages)||void 0===s?void 0:s.history,n),historyLoaded:e.messages.historyLoaded},teams:{active:e.teams.active-i(null===(r=t.teams)||void 0===r?void 0:r.active,n),cloudArchived:e.teams.cloudArchived,teamsLoaded:e.teams.teamsLoaded}}}),[e,t,n])}},12555:(e,t,n)=>{n.r(t),n.d(t,{default:()=>C});var a=n(23453),s=n(52602),r=n(4629),i=n(14776),o=n(52073),l=n(62688),c=n.n(l),d=(n(4290),n(97023)),h=n.n(d),u=n(14778),m=n(14696),p=n(59671),g=n(86255),f=n(85873);function E(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class b extends h().PureComponent{constructor(e){super(e),E(this,"timeoutId",null),E(this,"isProcessing",!1),E(this,"handleClear",(()=>{this.setState({categoryName:""})})),E(this,"handleChange",(e=>{this.setState({categoryName:e.target.value})})),E(this,"handleCancel",(()=>{this.handleClear()})),E(this,"handleConfirm",(()=>{this.isProcessing||(this.isProcessing=!0,this.timeoutId=setTimeout((()=>{this.isProcessing=!1}),1e3),this.props.categoryId?this.props.actions.renameCategory(this.props.categoryId,this.state.categoryName):(this.props.actions.createCategory(this.props.currentTeamId,this.state.categoryName,this.props.channelIdsToAdd),(0,p.sx)("ui","ui_sidebar_created_category")))})),E(this,"isConfirmDisabled",(()=>!this.state.categoryName||Boolean(this.props.initialCategoryName)&&this.props.initialCategoryName===this.state.categoryName||this.state.categoryName.length>22)),E(this,"getText",(()=>{let e,t,n;return this.props.categoryId?(e=h().createElement(u.FormattedMessage,{id:"rename_category_modal.renameCategory",defaultMessage:"Rename Category"}),t=h().createElement(u.FormattedMessage,{id:"rename_category_modal.rename",defaultMessage:"Rename"})):(e=h().createElement(u.FormattedMessage,{id:"create_category_modal.createCategory",defaultMessage:"Create New Category"}),t=h().createElement(u.FormattedMessage,{id:"create_category_modal.create",defaultMessage:"Create"}),n=h().createElement(u.FormattedMessage,{id:"edit_category_modal.helpText",defaultMessage:"Drag channels into this category to organize your sidebar."})),{modalHeaderText:e,editButtonText:t,helpText:n}})),this.state={categoryName:e.initialCategoryName||""}}componentWillUnmount(){this.timeoutId&&clearTimeout(this.timeoutId)}render(){const{modalHeaderText:e,editButtonText:t,helpText:n}=this.getText();return h().createElement(m.zW,{id:"editCategoryModal",ariaLabel:(0,f.Vw)({id:"rename_category_modal.renameCategory",defaultMessage:"Rename Category"}),modalHeaderText:e,confirmButtonText:t,compassDesign:!0,onExited:this.props.onExited,handleEnterKeyPress:this.handleConfirm,handleConfirm:this.handleConfirm,handleCancel:this.handleCancel,isConfirmDisabled:this.isConfirmDisabled()},h().createElement(g.A,{inputComponent:g.P,autoFocus:!0,className:"form-control filter-textbox",type:"text",value:this.state.categoryName,placeholder:(0,f.Vw)({id:"edit_category_modal.placeholder",defaultMessage:"Name your category"}),clearable:!0,onClear:this.handleClear,onChange:this.handleChange,maxLength:22}),Boolean(n)&&h().createElement("span",{className:"edit-category__helpText"},n))}}E(b,"propTypes",{onExited:c().func.isRequired,currentTeamId:c().string.isRequired,categoryId:c().string,initialCategoryName:c().string,channelIdsToAdd:c().arrayOf(c().string),actions:c().shape({createCategory:c().func.isRequired,renameCategory:c().func.isRequired}).isRequired});const C=(0,a.connect)((function(e){return{currentTeamId:(0,i.Sy)(e)}}),(function(e){return{actions:(0,s.bindActionCreators)({createCategory:o.zZ,renameCategory:r.D8},e)}}))(b)},83642:(e,t,n)=>{n.d(t,{t:()=>h});var a=n(62688),s=n.n(a),r=n(71633),i=n.n(r),o=n(97023),l=n.n(o),c=n(95025),d=n(4715);const h=e=>{let{className:t,variant:n}=e;const a=(0,d.cX)()?"⌘":"Ctrl",s=n||c.l.Contrast;return l().createElement("span",{className:i()("search-shortcut",t)},l().createElement(c.e,{variant:s},a),!(0,d.y3)()&&l().createElement(c.e,{variant:s},"Shift"),l().createElement(c.e,{variant:s},"F"))};h.propTypes={className:s().string}},19174:(e,t,n)=>{n.d(t,{A:()=>E});var a=n(62688),s=n.n(a),r=(n(29206),n(57406),n(55448),n(97023)),i=n.n(r),o=n(14778),l=n(23453),c=n(85406),d=n(59671),h=n(79751),u=n(12555),m=n(18986),p=n(78451);const g=["id"],f=e=>{let{id:t}=e,n=function(e,t){if(null==e)return{};var n,a,s=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}(e,g);const a=(0,l.useDispatch)(),s=(0,r.useCallback)((()=>{a((0,h.q)({modalId:p.IQ.EDIT_CATEGORY,dialogType:u.default})),(0,d.sx)("ui","ui_sidebar_category_menu_createCategory")}),[a]);return i().createElement(m.q7,Object.assign({id:"create-".concat(t),onClick:s,"aria-haspopup":!0,leadingElement:i().createElement(c.FolderPlusOutlineIcon,{size:18}),labels:i().createElement(o.FormattedMessage,{id:"sidebar_left.sidebar_category_menu.createCategory",defaultMessage:"Create New Category"})},n))};f.propTypes={id:s().string.isRequired};const E=f},51877:(e,t,n)=>{n.d(t,{A:()=>C});var a=n(62688),s=n.n(a),r=(n(29206),n(57406),n(55448),n(97023)),i=n.n(r),o=n(14778),l=n(23453),c=n(85406),d=n(79751),h=n(18986),u=n(78451),m=n(14696);const p=()=>null,g=e=>{let{handleConfirm:t,numChannels:n,onExited:a}=e;const s=(0,o.useIntl)(),r=s.formatMessage({id:"mark_as_read_confirm_modal.header",defaultMessage:"Mark as read"}),l=s.formatMessage({id:"mark_as_read_confirm_modal.body",defaultMessage:"Are you sure you want to mark {numChannels} channels as read?"},{numChannels:n}),c=s.formatMessage({id:"mark_as_read_confirm_modal.confirm",defaultMessage:"Mark as read"});return i().createElement(m.zW,{ariaLabel:r,compassDesign:!0,modalHeaderText:r,handleConfirm:t,handleCancel:p,onExited:a,confirmButtonText:c},i().createElement("span",{className:"mark-as-read__helpText"},l))};g.propTypes={handleConfirm:s().func.isRequired,numChannels:s().number.isRequired,onExited:s().func.isRequired};const f=g,E=["id","handleViewCategory","numChannels"],b=e=>{let{id:t,handleViewCategory:n,numChannels:a}=e,s=function(e,t){if(null==e)return{};var n,a,s=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}(e,E);const m=(0,l.useDispatch)(),p=(0,r.useCallback)((()=>{a<=0||(1!==a?m((0,d.q)({modalId:u.IQ.DELETE_CATEGORY,dialogType:f,dialogProps:{handleConfirm:n,numChannels:a}})):n())}),[m,n,a]);return i().createElement(h.q7,Object.assign({id:"view-".concat(t),onClick:p,"aria-haspopup":a>1,leadingElement:i().createElement(c.MarkAsUnreadIcon,{size:18}),labels:i().createElement(o.FormattedMessage,{id:"sidebar_left.sidebar_category_menu.viewCategory",defaultMessage:"Mark category as read"})},s))};b.propTypes={id:s().string.isRequired,handleViewCategory:s().func.isRequired,numChannels:s().number.isRequired};const C=b},77813:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(62688),s=n.n(a),r=(n(17046),n(71633)),i=n.n(r),o=n(97023),l=n.n(o),c=n(14778),d=n(85406),h=n(18986);const u=e=>{let{id:t,children:n}=e;const[a,s]=(0,o.useState)(!1),{formatMessage:r}=(0,c.useIntl)();return l().createElement("div",{className:i()("SidebarMenu","MenuWrapper",{"MenuWrapper--open":a,menuOpen:a})},l().createElement(h.mc,{menuButton:{id:"SidebarCategoryMenu-Button-".concat(t),"aria-label":r({id:"sidebar_left.sidebar_category_menu.editCategory",defaultMessage:"Category options"}),class:"SidebarMenu_menuButton",children:l().createElement(d.DotsVerticalIcon,{size:16})},menuButtonTooltip:{text:r({id:"sidebar_left.sidebar_category_menu.editCategory",defaultMessage:"Category options"}),class:"hidden-xs"},menu:{id:"SidebarChannelMenu-MenuList-".concat(t),"aria-label":r({id:"sidebar_left.sidebar_category_menu.dropdownAriaLabel",defaultMessage:"Edit category menu"}),onToggle:function(e){s(e)}}},n))};u.propTypes={id:s().string.isRequired,children:s().arrayOf(s().node).isRequired};const m=(0,o.memo)(u)},66039:(e,t,n)=>{n.d(t,{U:()=>d,w:()=>h});var a=n(62688),s=n.n(a),r=(n(29206),n(71633)),i=n.n(r),o=n(97023),l=n.n(o),c=n(78138);const d=l().forwardRef(((e,t)=>l().createElement("div",{className:"SidebarChannelGroupHeader SidebarChannelGroupHeader--static"},l().createElement("div",{ref:t,className:"SidebarChannelGroupHeader_groupButton"},l().createElement("div",{className:"SidebarChannelGroupHeader_text"},(0,c.uN)(e.displayName)),e.children))));d.propTypes={children:s().node,displayName:s().string.isRequired},d.displayName="SidebarCategoryHeaderStatic";const h=l().forwardRef(((e,t)=>{const{dragHandleProps:n}=e;return n&&n.role&&Reflect.deleteProperty(n,"role"),l().createElement("div",{className:i()("SidebarChannelGroupHeader",{muted:e.muted,dragging:e.isDragging})},l().createElement("button",{ref:t,className:i()("SidebarChannelGroupHeader_groupButton"),"aria-label":e.displayName,onClick:e.onClick},l().createElement("i",{className:i()("icon icon-chevron-down",{"icon-rotate-minus-90":e.isCollapsed,"hide-arrow":!e.isCollapsible})}),l().createElement("div",Object.assign({className:"SidebarChannelGroupHeader_text"},n),(0,c.uN)(e.displayName))),e.children)}));h.propTypes={children:s().node,displayName:s().string.isRequired,isCollapsed:s().bool.isRequired,isCollapsible:s().bool,isDragging:s().bool,isDraggingOver:s().bool,muted:s().bool.isRequired,onClick:s().func.isRequired},h.defaultProps={isCollapsible:!0,isDragging:!1,isDraggingOver:!1},h.displayName="SidebarCategoryHeader"},45697:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(62688),s=n.n(a),r=n(71633),i=n.n(r),o=n(97023),l=n.n(o);function c(e){let{unreadMentions:t,hasUrgent:n,icon:a,className:s}=e;return t>0?l().createElement("span",{id:"unreadMentions",className:i()({badge:!0,urgent:n},s)},a,l().createElement("span",{className:"unreadMentions"},t)):null}c.propTypes={unreadMentions:s().number.isRequired,hasUrgent:s().bool,icon:s().node,className:s().string}},50418:(e,t,n)=>{n.d(t,{A:()=>Oe});var a=n(23453),s=n(65952),r=n(14776),i=n(9916),o=(n(17046),n(29206),n(71633)),l=n.n(o),c=n(97023),d=n.n(c),h=n(22005),u=n(14778),m=n(78451),p=n(52602),g=n(25778),f=n(79751),E=n(62688),b=n.n(E),C=n(59671),y=n(69238),v=n(3569),_=n(26614),M=n(77440),w=n(16230),S=n(87778),T=n(52073),A=n(2386),I=n(51140),N=n(75270),L=n(53791),R=n(99243),P=(n(4290),n(81911)),O=n(67277),k=n(59050),D=n(64766),x=n(87131),F=n(694),H=n(78138),U=n(19513),B=n(3295),q=n(45697);function j(e){let{hasDraft:t}=e;return t?d().createElement("i",{"data-testid":"draftIcon",className:"icon icon-pencil-outline channel-pencil-icon"}):null}n(76685),j.propTypes={hasDraft:b().bool.isRequired};const V=(0,c.memo)(j);function G(e,t,n){return null!==e&&Boolean(e.message.trim()||e.fileInfos.length||e.uploadsInProgress.length)&&n!==t}const W=(0,a.connect)((function(e,t){const n=(0,s.eH)(e);return{hasDraft:G((0,N.UR)(e,m.eN.DRAFT,t.id),t.id,n)}}))(V);function z(e){let{isDeleted:t,icon:n}=e;return t?d().createElement("i",{className:"icon icon-archive-outline"}):n}z.propTypes={icon:b().oneOfType([b().element,b().oneOf([null])]),isDeleted:b().bool.isRequired};const K=z;var J=n(30413),Y=n(16983),Q=n(80635),Z=n(15755),X=n(63155),$=n(85406),ee=n(46),te=(n(57406),n(55448),n(8907)),ne=n(57676),ae=n(12555),se=n(18986);const re=e=>{const{formatMessage:t}=(0,u.useIntl)(),n=(0,a.useDispatch)(),o=(0,a.useSelector)(s.ou),l=(0,a.useSelector)((e=>e.views.channelSidebar.multiSelectedChannelIds)),c=(0,a.useSelector)(r.H7),h=(0,a.useSelector)((e=>c?(0,i.WJ)(e):void 0)),p=(0,a.useSelector)((t=>c?(0,ne.oT)(t,(null==c?void 0:c.id)||"",e.channel.id):void 0));function g(t,a){t.preventDefault(),(null==p?void 0:p.id)!==a&&(n((0,T.Lt)(a,e.channel.id)),(0,C.sx)("ui","ui_sidebar_channel_menu_moveToExistingCategory"))}function E(){n((0,f.q)({modalId:m.IQ.EDIT_CATEGORY,dialogType:ae.default,dialogProps:{channelIdsToAdd:-1===l.indexOf(e.channel.id)?[e.channel.id]:l}})),(0,C.sx)("ui","ui_sidebar_channel_menu_createCategory")}function b(t,n){return[...t.map((t=>{let a=d().createElement("span",null,t.display_name);t.type===te.e.FAVORITES&&(a=d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.favorites",defaultMessage:"Favorites"})),t.type===te.e.CHANNELS&&(a=d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.channels",defaultMessage:"Channels"}));let s=null;return n&&n.display_name===t.display_name&&(s=d().createElement($.CheckIcon,{color:"var(--button-bg)",size:18})),d().createElement(se.q7,{id:"moveToCategory-".concat(e.channel.id,"-").concat(t.id),key:"moveToCategory-".concat(e.channel.id,"-").concat(t.id),leadingElement:t.type===te.e.FAVORITES?d().createElement($.StarOutlineIcon,{size:18}):d().createElement($.FolderOutlineIcon,{size:18}),labels:a,trailingElements:s,onClick:e=>g(e,t.id)})})),d().createElement(se.wv,{key:"ChannelMenu-moveToDivider"}),d().createElement(se.q7,{id:"moveToNewCategory-".concat(e.channel.id),key:"moveToNewCategory-".concat(e.channel.id),"aria-haspopup":!0,leadingElement:d().createElement($.FolderMoveOutlineIcon,{size:18}),labels:d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.moveToNewCategory",defaultMessage:"New Category"}),onClick:E})]}function y(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e.filter((e=>e.type!==te.e.CHANNELS)):e.filter((e=>e.type!==te.e.DIRECT_MESSAGES))}return h?d().createElement(se.g8,{id:"moveTo-".concat(e.channel.id),labels:d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.moveTo",defaultMessage:"Move to..."}),leadingElement:e.inHeaderDropdown?null:d().createElement($.FolderMoveOutlineIcon,{size:18}),trailingElements:d().createElement($.ChevronRightIcon,{size:16}),menuId:"moveTo-".concat(e.channel.id,"-menu"),menuAriaLabel:t({id:"sidebar_left.sidebar_channel_menu.moveTo.dropdownAriaLabel",defaultMessage:"Move to submenu"})},function(t,n){const a=l.includes(e.channel.id);return e.inHeaderDropdown||!a?b(y(t,e.channel.type===m.Ay.DM_CHANNEL||e.channel.type===m.Ay.GM_CHANNEL),n):l.every((e=>o[e].type===m.Ay.DM_CHANNEL||o[e].type===m.Ay.GM_CHANNEL))?b(y(t,!0),n):l.every((e=>o[e].type!==m.Ay.DM_CHANNEL&&o[e].type!==m.Ay.GM_CHANNEL))?b(y(t,!1),n):b(t.filter((e=>e.type!==te.e.CHANNELS&&e.type!==te.e.DIRECT_MESSAGES)),n)}(h,p)):null},ie=(0,c.memo)(re);var oe=n(85873);const le=e=>{let{channel:t,channelLink:n,currentUserId:a,favoriteChannel:s,isFavorite:r,isMuted:i,isUnread:o,managePrivateChannelMembers:l,managePublicChannelMembers:h,readMultipleChannels:p,markMostRecentPostInChannelAsUnread:g,muteChannel:f,onMenuToggle:E,openModal:b,unfavoriteChannel:y,unmuteChannel:v,channelLeaveHandler:_}=e;const M=(0,c.useRef)(!1),{formatMessage:w}=(0,u.useIntl)();let S=null;if(o){function R(){p([t.id]),(0,C.sx)("ui","ui_sidebar_channel_menu_markAsRead")}S=d().createElement(se.q7,{id:"markAsRead-".concat(t.id),onClick:R,leadingElement:d().createElement($.MarkAsUnreadIcon,{size:18}),labels:d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.markAsRead",defaultMessage:"Mark as Read"})})}else{function P(){g(t.id),(0,C.sx)("ui","ui_sidebar_channel_menu_markAsUnread")}S=d().createElement(se.q7,{id:"markAsUnread-".concat(t.id),onClick:P,leadingElement:d().createElement($.MarkAsUnreadIcon,{size:18}),labels:d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.markAsUnread",defaultMessage:"Mark as Unread"})})}let T=null;if(r){function O(){y(t.id),(0,C.sx)("ui","ui_sidebar_channel_menu_unfavorite")}T=d().createElement(se.q7,{id:"unfavorite-".concat(t.id),onClick:O,leadingElement:d().createElement($.StarIcon,{size:18}),labels:d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.unfavoriteChannel",defaultMessage:"Unfavorite"})})}else{function k(){s(t.id),(0,C.sx)("ui","ui_sidebar_channel_menu_favorite")}T=d().createElement(se.q7,{id:"favorite-".concat(t.id),onClick:k,leadingElement:d().createElement($.StarOutlineIcon,{size:18}),labels:d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.favoriteChannel",defaultMessage:"Favorite"})})}let A=null;if(i){let D=d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.unmuteChannel",defaultMessage:"Unmute Channel"});function x(){v(a,t.id)}t.type!==m.Ay.DM_CHANNEL&&t.type!==m.Ay.GM_CHANNEL||(D=d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.unmuteConversation",defaultMessage:"Unmute Conversation"})),A=d().createElement(se.q7,{id:"unmute-".concat(t.id),onClick:x,leadingElement:d().createElement($.BellOffOutlineIcon,{size:18}),labels:D})}else{let F=d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.muteChannel",defaultMessage:"Mute Channel"});function H(){f(a,t.id)}t.type!==m.Ay.DM_CHANNEL&&t.type!==m.Ay.GM_CHANNEL||(F=d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.muteConversation",defaultMessage:"Mute Conversation"})),A=d().createElement(se.q7,{id:"mute-".concat(t.id),onClick:H,leadingElement:d().createElement($.BellOutlineIcon,{size:18}),labels:F})}let I=null;if(t.type===m.Ay.OPEN_CHANNEL||t.type===m.Ay.PRIVATE_CHANNEL){function U(){(0,oe.lW)(n)}I=d().createElement(se.q7,{id:"copyLink-".concat(t.id),onClick:U,leadingElement:d().createElement($.LinkVariantIcon,{size:18}),labels:d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.copyLink",defaultMessage:"Copy Link"})})}let N=null;if(t.type===m.Ay.PRIVATE_CHANNEL&&l||t.type===m.Ay.OPEN_CHANNEL&&h){function B(){b({modalId:m.IQ.CHANNEL_INVITE,dialogType:ee.A,dialogProps:{channel:t}}),(0,C.sx)("ui","ui_sidebar_channel_menu_addMembers")}N=d().createElement(se.q7,{id:"addMembers-".concat(t.id),onClick:B,"aria-haspopup":"true",leadingElement:d().createElement($.AccountPlusOutlineIcon,{size:18}),labels:d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.addMembers",defaultMessage:"Add Members"})})}let L=null;if(t.name!==m.Ay.DEFAULT_CHANNEL){let q=d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.leaveChannel",defaultMessage:"Leave Channel"});function j(){!M.current&&_&&(M.current=!0,_((()=>{M.current=!1})),(0,C.sx)("ui","ui_sidebar_channel_menu_leave"))}t.type!==m.Ay.DM_CHANNEL&&t.type!==m.Ay.GM_CHANNEL||(q=d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel_menu.leaveConversation",defaultMessage:"Close Conversation"})),L=d().createElement(se.q7,{id:"leave-".concat(t.id),onClick:j,leadingElement:d().createElement($.ExitToAppIcon,{size:18}),labels:q,isDestructive:!0})}return d().createElement(se.mc,{menuButton:{id:"SidebarChannelMenu-Button-".concat(t.id),class:"SidebarMenu_menuButton","aria-label":w({id:"sidebar_left.sidebar_channel_menu.editChannel.ariaLabel",defaultMessage:"Channel options for {channelName}"},{channelName:t.name}),children:d().createElement($.DotsVerticalIcon,{size:16})},menuButtonTooltip:{class:"hidden-xs",text:w({id:"sidebar_left.sidebar_channel_menu.editChannel",defaultMessage:"Channel options"})},menu:{id:"SidebarChannelMenu-MenuList-".concat(t.id),"aria-label":w({id:"sidebar_left.sidebar_channel_menu.dropdownAriaLabel",defaultMessage:"Edit channel menu"}),onToggle:E}},S,T,A,d().createElement(se.wv,null),d().createElement(ie,{channel:t}),(I||N)&&d().createElement(se.wv,null),I,N,L&&d().createElement(se.wv,null),L)},ce=(0,c.memo)(le),de={readMultipleChannels:J.Zi,markMostRecentPostInChannelAsUnread:S.pr,favoriteChannel:J.yc,unfavoriteChannel:J.XJ,muteChannel:Z.vW,unmuteChannel:Z.c2,openModal:f.q},he=(0,a.connect)((function(e,t){const n=(0,v.vd)(e)[t.channel.id],a=(0,r.H7)(e);let i=!1,o=!1;return a&&(i=(0,Q.Ec)(e,a.id,t.channel.id,Y.A.MANAGE_PUBLIC_CHANNEL_MEMBERS),o=(0,Q.Ec)(e,a.id,t.channel.id,Y.A.MANAGE_PRIVATE_CHANNEL_MEMBERS)),{currentUserId:(0,v.WR)(e),isFavorite:(0,s.g1)(e,t.channel.id),isMuted:(0,w.X4)(n),channelLink:"".concat((0,X.vV)()).concat(t.channelLink),managePublicChannelMembers:i,managePrivateChannelMembers:o}}),de)(ce);function ue(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class me extends d().PureComponent{constructor(e){super(e),ue(this,"enableToolTipIfNeeded",(()=>{const e=this.labelRef.current,t=e&&e.offsetWidth<e.scrollWidth;this.setState({showTooltip:Boolean(t)})})),ue(this,"getAriaLabel",(()=>{const{label:e,ariaLabelPrefix:t,unreadMentions:n,intl:a}=this.props;let s=e;return t&&(s+=" ".concat(t)),1===n?s+=" ".concat(n," ").concat(a.formatMessage({id:"accessibility.sidebar.types.mention",defaultMessage:"mention"})):n>1&&(s+=" ".concat(n," ").concat(a.formatMessage({id:"accessibility.sidebar.types.mentions",defaultMessage:"mentions"}))),this.props.isUnread&&0===n&&(s+=" ".concat(a.formatMessage({id:"accessibility.sidebar.types.unread",defaultMessage:"unread"}))),s.toLowerCase()})),ue(this,"handleChannelClick",(e=>{(0,C.Gy)(B.CU.ChannelLinkClicked),this.handleSelectChannel(e),this.props.rhsOpen&&this.props.rhsState===m._n.EDIT_HISTORY&&this.props.actions.closeRightHandSide(),setTimeout((()=>{(0,C.sx)("ui","ui_channel_selected_v2")}),0)})),ue(this,"handleSelectChannel",(e=>{e.defaultPrevented||0!==e.button||((0,U.r)(e)?(e.preventDefault(),this.props.actions.multiSelectChannelAdd(this.props.channel.id)):e.shiftKey?(e.preventDefault(),this.props.actions.multiSelectChannelTo(this.props.channel.id)):e.altKey&&!this.props.isUnread?(e.preventDefault(),this.props.actions.markMostRecentPostInChannelAsUnread(this.props.channel.id)):this.props.actions.clearChannelSelection())})),ue(this,"handleMenuToggle",(e=>{this.setState({isMenuOpen:e})})),this.labelRef=d().createRef(),this.state={isMenuOpen:!1,showTooltip:!1}}componentDidMount(){this.enableToolTipIfNeeded()}componentDidUpdate(e){e.label!==this.props.label&&this.enableToolTipIfNeeded()}render(){const{channel:e,icon:t,isChannelSelected:n,isMuted:a,isUnread:s,label:r,link:i,unreadMentions:o,firstChannelName:c,showChannelsTutorialStep:h,hasUrgent:u}=this.props;let p=null;(c===e.name||!c&&h&&e.name===m.Ay.DEFAULT_CHANNEL)&&(p=c?d().createElement(D.Pr,{firstChannelName:e.display_name}):d().createElement(D.Pr,null));let g=d().createElement("span",{ref:this.labelRef,className:"SidebarChannelLinkLabel"},(0,H.uN)(r));this.state.showTooltip&&(g=d().createElement(x.A,{title:r},g));const f=this.props.teammateId?d().createElement(O.A,{userID:this.props.teammateId,showTooltip:!0,spanStyle:{height:18},emojiStyle:{marginTop:-4,marginBottom:0,opacity:.8}}):null,E=this.props.isSharedChannel?d().createElement(k.A,{className:"icon",withTooltip:!0}):null,b=d().createElement(d().Fragment,null,d().createElement(K,{isDeleted:0!==e.delete_at,icon:t}),d().createElement("div",{className:"SidebarChannelLinkLabel_wrapper"},g,f,d().createElement(F.default,{pluggableName:"SidebarChannelLinkLabel",channel:this.props.channel}),E),d().createElement(W,{id:e.id}),d().createElement(q.A,{unreadMentions:o,hasUrgent:u}),d().createElement("div",{className:l()("SidebarMenu","MenuWrapper",{menuOpen:this.state.isMenuOpen},{"MenuWrapper--open":this.state.isMenuOpen})},d().createElement(he,{channel:e,channelLink:i,isUnread:s,channelLeaveHandler:this.props.channelLeaveHandler,onMenuToggle:this.handleMenuToggle}))),C=l()(["SidebarLink",{menuOpen:this.state.isMenuOpen,muted:a,"unread-title":this.props.isUnread,selected:n}]);return d().createElement(P.Link,{className:C,id:"sidebarItem_".concat(e.name),"aria-label":this.getAriaLabel(),to:i,onClick:this.handleChannelClick,tabIndex:0},b,p)}}ue(me,"propTypes",{link:b().string.isRequired,label:b().string.isRequired,ariaLabelPrefix:b().string,channelLeaveHandler:b().func,icon:b().oneOfType([b().element,b().oneOf([null])]),unreadMentions:b().number.isRequired,isUnread:b().bool.isRequired,isMuted:b().bool.isRequired,isChannelSelected:b().bool.isRequired,teammateId:b().string,firstChannelName:b().string,showChannelsTutorialStep:b().bool.isRequired,hasUrgent:b().bool.isRequired,rhsOpen:b().bool,isSharedChannel:b().bool,actions:b().shape({markMostRecentPostInChannelAsUnread:b().func.isRequired,clearChannelSelection:b().func.isRequired,multiSelectChannelTo:b().func.isRequired,multiSelectChannelAdd:b().func.isRequired,unsetEditingPost:b().func.isRequired,closeRightHandSide:b().func.isRequired}).isRequired});const pe=(0,u.injectIntl)(me),ge=(0,a.connect)((function(){const e=(0,s.KP)();return(t,n)=>{const a=(0,v.vd)(t)[n.channel.id],s=e(t,n.channel.id),r=(0,_.zj)(t),o="true"===r.EnableTutorial,l=(0,v.WR)(t),c=(0,M.yW)(t,R.AG.ONBOARDING_TUTORIAL_STEP,l,0),d=(0,M.yW)(t,L.XV,L.Z.CHANNELS_TOUR,R.BL)===L.gy.STARTED,h=r.EnableOnboardingFlow,u=o&&c===R.NI.CHANNELS_AND_DIRECT_MESSAGES&&d&&"true"===h;return{unreadMentions:s.mentions,unreadMsgs:s.messages,isUnread:s.showUnread,isMuted:(0,w.X4)(a),hasUrgent:s.hasUrgent,isChannelSelected:(0,i.T$)(t,n.channel.id),firstChannelName:u?(0,I.Hd)(t):"",showChannelsTutorialStep:u,rhsState:(0,N.bM)(t),rhsOpen:(0,N.A)(t)}}}),(function(e){return{actions:(0,p.bindActionCreators)({markMostRecentPostInChannelAsUnread:S.pr,unsetEditingPost:S.K4,clearChannelSelection:T.lE,multiSelectChannelTo:T.Go,multiSelectChannelAdd:T.wf,closeRightHandSide:A.bP},e)}}))(pe),fe=e=>{let{channelType:t}=e;return t===m.Ay.OPEN_CHANNEL?d().createElement("i",{className:"icon icon-globe"}):t===m.Ay.PRIVATE_CHANNEL?d().createElement("i",{className:"icon icon-lock-outline"}):null},Ee=e=>{let{channel:t,currentTeamName:n,actions:a}=e;const s=(0,u.useIntl)(),r=(0,c.useCallback)((e=>{a.leaveChannel(t.id),(0,C.sx)("ui","ui_public_channel_x_button_clicked"),e()}),[t.id,a.leaveChannel]),i=(0,c.useCallback)((e=>{a.openModal({modalId:m.IQ.LEAVE_PRIVATE_CHANNEL_MODAL,dialogType:y.A,dialogProps:{channel:t}}),(0,C.sx)("ui","ui_private_channel_x_button_clicked"),e()}),[t,a.openModal]);let o=null;t.type===m.Ay.OPEN_CHANNEL&&t.name!==m.Ay.DEFAULT_CHANNEL?o=r:t.type===m.Ay.PRIVATE_CHANNEL&&(o=i);const l=d().createElement(fe,{channelType:t.type});let h;return t.type===m.Ay.OPEN_CHANNEL?h=s.formatMessage({id:"accessibility.sidebar.types.public",defaultMessage:"public channel"}):t.type===m.Ay.PRIVATE_CHANNEL&&(h=s.formatMessage({id:"accessibility.sidebar.types.private",defaultMessage:"private channel"})),d().createElement(ge,{channel:t,link:"/".concat(n,"/channels/").concat(t.name),label:t.display_name,ariaLabelPrefix:h,channelLeaveHandler:o,icon:l,isSharedChannel:t.shared})};Ee.propTypes={currentTeamName:b().string.isRequired};const be=Ee,Ce=(0,a.connect)(null,(function(e){return{actions:(0,p.bindActionCreators)({leaveChannel:g.nE,openModal:f.q},e)}}))(be);var ye=n(35631),ve=n(7430),_e=n(40693),Me=n(61767),we=n(83007);function Se(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Te extends d().PureComponent{constructor(){super(...arguments),Se(this,"handleLeaveChannel",(e=>{const t=this.props.channel.teammate_id,n=m.YM.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW,a=this.props.currentUserId;this.props.actions.savePreferences(a,[{user_id:a,category:n,name:t,value:"false"}]).then(e),this.props.actions.leaveDirectChannel(this.props.channel.name),(0,C.sx)("ui","ui_direct_channel_x_button_clicked"),this.props.active&&(0,we.J)().push("/".concat(this.props.currentTeamName,"/channels/").concat(this.props.redirectChannel))})),Se(this,"getIcon",(()=>{const{channel:e,teammate:t}=this.props;if(!t)return null;if(t.id&&t.delete_at)return d().createElement("i",{className:"icon icon-archive-outline"});let n="";return"online"===e.status?n="status-online":"away"===e.status?n="status-away":"dnd"===e.status&&(n="status-dnd"),d().createElement(Me.A,{src:_e.mT.getProfilePictureUrl(t.id,t.last_picture_update),size:"xs",status:t.is_bot?"":e.status,wrapperClass:"DirectChannel__profile-picture",newStatusIcon:!0,statusClass:"DirectChannel__status-icon ".concat(n)})}))}render(){const{channel:e,teammate:t,currentTeamName:n}=this.props;if(!t)return null;let a=e.display_name;return this.props.currentUserId===t.id&&(a=this.props.intl.formatMessage({id:"sidebar.directchannel.you",defaultMessage:"{displayname} (you)"},{displayname:e.display_name})),d().createElement(ge,{teammateId:t.id,channel:e,link:"/".concat(n,"/messages/@").concat(t.username),label:a,channelLeaveHandler:this.handleLeaveChannel,icon:this.getIcon(),isSharedChannel:Boolean(t.remote_id)})}}Se(Te,"propTypes",{currentTeamName:b().string.isRequired,currentUserId:b().string.isRequired,redirectChannel:b().string.isRequired,active:b().bool.isRequired,actions:b().shape({savePreferences:b().func.isRequired,leaveDirectChannel:b().func.isRequired}).isRequired});const Ae=(0,u.injectIntl)(Te),Ie=(0,a.connect)((function(e,t){const n=(0,ve.wz)(e,t.channel.teammate_id),a=(0,ve.HW)(e),i=(0,r.H7)(e),o=i?(0,s.Dn)(e,i.id):"",l=(0,s.eH)(e),c=t.channel.id===l;return{teammate:n,currentUserId:a.id,redirectChannel:o,active:c}}),(function(e){return{actions:(0,p.bindActionCreators)({savePreferences:ye.SF,leaveDirectChannel:g.iq},e)}}))(Ae),Ne=e=>{let{channel:t,currentUserId:n,actions:a,active:s,currentTeamName:r,redirectChannel:i,membersCount:o}=e;const l=(0,c.useCallback)((e=>{const o=t.id,l=m.Ay.Preferences.CATEGORY_GROUP_CHANNEL_SHOW;a.savePreferences(n,[{user_id:n,category:l,name:o,value:"false"}]).then(e),(0,C.sx)("ui","ui_direct_channel_x_button_clicked"),s&&(0,we.J)().push("/".concat(r,"/channels/").concat(i))}),[t.id,a,s,r,i,n]);return d().createElement(ge,{channel:t,link:"/".concat(r,"/messages/").concat(t.name),label:t.display_name,channelLeaveHandler:l,icon:d().createElement("div",{className:"status status--group"},o)})};Ne.propTypes={currentTeamName:b().string.isRequired,currentUserId:b().string.isRequired,redirectChannel:b().string.isRequired,active:b().bool.isRequired,membersCount:b().number.isRequired,actions:b().shape({savePreferences:b().func.isRequired}).isRequired};const Le=(0,c.memo)(Ne),Re=(0,a.connect)((function(){const e=(0,s.fV)();return(t,n)=>{const a=(0,ve.WR)(t),i=(0,r.H7)(t),o=i?(0,s.Dn)(t,i.id):"",l=(0,s.eH)(t),c=e(t,n.channel);return{currentUserId:a,redirectChannel:o,active:n.channel.id===l,membersCount:c}}}),(function(e){return{actions:(0,p.bindActionCreators)({savePreferences:ye.SF},e)}}))(Le),Pe=(0,a.connect)((function(){const e=(0,s.s9)(),t=(0,s.KP)();return(n,a)=>{const o=e(n,a.channelId),l=(0,r.H7)(n),c=(0,s.eH)(n),d=t(n,(null==o?void 0:o.id)||"");return{channel:o,isCurrentChannel:(null==o?void 0:o.id)===c,currentTeamName:null==l?void 0:l.name,unreadMentions:d.mentions,isUnread:d.showUnread,draggingState:(0,i.NX)(n),isChannelSelected:(0,i.T$)(n,a.channelId),multiSelectedChannelIds:n.views.channelSidebar.multiSelectedChannelIds,autoSortedCategoryIds:(0,i.VM)(n)}}})),Oe=Pe((function(e){let{isCategoryCollapsed:t,isCategoryDragged:n,isUnread:a,isCurrentChannel:s,setChannelRef:r,channel:i,currentTeamName:o,isDraggable:p,isChannelSelected:g,draggingState:f,multiSelectedChannelIds:E,channelIndex:b,isAutoSortedCategory:C,autoSortedCategoryIds:y}=e;const[v,_]=(0,c.useState)(!0);if(!i)return null;if(!o)return null;function M(){return n||t&&!a&&!s}function w(e){return t=>{r((null==i?void 0:i.id)||"",t),null==e||e(t)}}function S(e){e&&"toOpaqueAnimation"===e.animationName&&!M()&&_(!0)}function T(e){e&&"toTransparentAnimation"===e.animationName&&M()&&_(!1)}let A;if(A=v?i.type===m.Ay.DM_CHANNEL?d().createElement(Ie,{channel:i,currentTeamName:o}):i.type===m.Ay.GM_CHANNEL?d().createElement(Re,{channel:i,currentTeamName:o}):d().createElement(Ce,{channel:i,currentTeamName:o}):null,p){let e;return g&&f.state&&f.id===i.id&&E.length>1&&(e=v?d().createElement("div",{className:"SidebarChannel__selectedCount"},d().createElement(u.FormattedMessage,{id:"sidebar_left.sidebar_channel.selectedCount",defaultMessage:"{count} selected",values:{count:E.length}})):null),d().createElement(h.Draggable,{draggableId:i.id,index:b},((t,n)=>d().createElement("li",Object.assign({draggable:"false",ref:w(t.innerRef),className:l()("SidebarChannel",{collapsed:M(),expanded:!M(),unread:a,active:s,dragging:n.isDragging,selectedDragging:g&&f.state&&f.id!==i.id,fadeOnDrop:n.isDropAnimating&&n.draggingOver&&y.has(n.draggingOver),noFloat:C&&!n.isDragging})},t.draggableProps,t.dragHandleProps,{onAnimationStart:S,onAnimationEnd:T,role:"listitem",tabIndex:-1}),A,e)))}return d().createElement("li",{ref:w(),className:l()("SidebarChannel",{collapsed:M(),expanded:!M(),unread:a,active:s}),onAnimationStart:S,onAnimationEnd:T,role:"listitem"},A)}))},57997:(e,t,n)=>{n.r(t),n.d(t,{default:()=>qr}),n(3188),n(6552);var a=n(23453),s=n(30413),r=n(65952),i=n(26614),o=n(14776),l=n(7430),c=n(25778),d=n(75270),h=n(10189),u=(n(43813),n(4290),n(1418)),m=n(87373),p=n(87988),g=n(23739),f=n(3569),E=n(77440),b=n(59935),C=n(46859),y=n(30388),v=n(83949);function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){return async(t,n)=>{t((0,g.Uv)(e.id));const a=n(),r=(0,l.HW)(a);y.A.setPreviousTeamId(r.id,e.id);try{await t((0,s.DC)(e.id))}catch(e){return(0,p.UP)(e,t,n),t((0,u.vV)(e)),{error:e}}(0,f.F4)(a)&&t((0,b.I8)());const o=(0,i.Ay)(a),c=(0,E.h7)(a);if(o&&"true"===o.IsLicensed&&("true"===o.LDAPGroups||c)){const n={filter_allow_reference:!1,page:0,per_page:60,include_member_count:!0,include_member_ids:!0,include_archived:!1},a=M(M({},n),{},{filter_has_member:r.id});r&&t((0,m.N9)(a)),"true"===o.LDAPGroups&&t((0,m.jM)(e.id,!0)),e.group_constrained&&"true"===o.LDAPGroups?t((0,m.UT)(e.id,!0)):t((0,m.f)(n))}return{data:e}}}var T=n(20553),A=n(92387),I=n.n(A),N=(n(17046),n(74883),n(57406),n(55448),n(70727)),L=n.n(N),R=n(97023),P=n.n(R),O=n(81911),k=n(55171),D=n(15252),x=n(62688),F=n.n(x),H=n(71633),U=n.n(H),B=n(11925),q=n(52602),j=n(17085),V=n(49176),G=n(35664),W=n(7380),z=n(78451),K=(n(29206),n(97309),n(10844),n(59297),n(40693)),J=n(79342),Y=n(15755),Q=n(91767),Z=n(78064),X=n(85873);const $=new RegExp("^[a-zA-Z0-9]{".concat(26,"}__[a-zA-Z0-9]{").concat(26,"}$"));function ee(e){let{match:t,history:n}=e;return async(e,a)=>{const i=a(),{path:c,identifier:d,team:h}=t.params;if(!d)return{data:void 0};const u=(0,o.Uj)(i,h);if(!u)return{data:void 0};const m=await async function(e,t,n){if("channels"===t){const t=(0,r.Os)(e,n),a=(0,r.pd)(e).find((e=>e.name===n));if(26===n.length){if(!t&&!a)try{return await K.mT.getChannel(n),"channel_id"}catch(e){return 404===e.status_code?"channel_name":"error"}return"channel_name"}return!t&&!a&&40===n.length||t&&t.type===z.YM.GM_CHANNEL||a&&a.type===z.YM.GM_CHANNEL?"group_channel_group_id":function(e){return 54===e.length&&$.test(e)}(n)?"direct_channel_user_ids":"channel_name"}return"messages"===t?0===n.indexOf("@")?"direct_channel_username":n.indexOf("@")>0?"direct_channel_email":26===n.length?"direct_channel_user_id":40===n.length?"group_channel_group_id":"error":"error"}(i,c,d);switch(m){case"channel_name":e(function(e,t){return async(n,a)=>{const i=a(),{team:c,identifier:d}=e.params,h=d.toLowerCase(),u=(0,o.Uj)(i,c);if(!u)return{data:void 0};let m,p=(0,r.wX)(i,u.id)[h];if(!p){const e=await n((0,s.lB)(c,h,!0));"data"in e&&(p=e.data)}if(p&&(m=i.entities.channels.myMembers[p.id],!m)){const e=await n((0,s.UB)(p.id,(0,l.WR)(i)));"data"in e&&(m=e.data)}if(!p||!m){var g,f;if((null===(g=p)||void 0===g?void 0:g.type)===z.YM.PRIVATE_CHANNEL){const e=(0,l.HW)(a());let t=!1;if(J.FV(null==e?void 0:e.roles))t=!0;else{const e=(0,o.AG)(i,u.id);t=Boolean(e&&e.scheme_admin)}if(t){const e=await n((0,Z.DT)(u,p.display_name));if("data"in e&&!e.data.join)return{data:void 0}}}const d=await n((0,s.Cg)((0,l.WR)(i),u.id,(null===(f=p)||void 0===f?void 0:f.id)||"",h));if("error"in d){if(!p){const a=await n((0,s.lB)(c,h,!0));if("error"in a||0===a.data.delete_at)return await n((0,s.DC)(u.id)),re(e,t,(0,r.Dn)(i,u.id)),{data:void 0};p=a.data}}else p=d.data.channel}return p.type===z.YM.DM_CHANNEL?n(ne(e,t)):p.type===z.YM.GM_CHANNEL?t.replace("/".concat(c,"/messages/").concat(p.name)):ae(p),{data:void 0}}}(t,n));break;case"channel_id":e(function(e,t){return async(n,a)=>{const i=a(),{team:c,identifier:d}=e.params,h=d.toLowerCase();let u=(0,r.c)(i,h);const m=i.entities.channels.myMembers[h],p=(0,o.Uj)(i,c);if(!u||!m){const a=await n((0,s.Cg)((0,l.WR)(i),p.id,h,""));if("error"in a)return await n((0,s.DC)(p.id)),re(e,t,(0,r.Dn)(i,p.id)),{data:void 0};u=a.data.channel}return u.type===z.YM.DM_CHANNEL?n(te(e,t,X.zj(u.name,(0,l.WR)(i)))):u.type===z.YM.GM_CHANNEL?t.replace("/".concat(c,"/messages/").concat(u.name)):t.replace("/".concat(c,"/channels/").concat(u.name)),{data:void 0}}}(t,n));break;case"group_channel_group_id":e(function(e,t){return async(n,a)=>{const i=a(),{identifier:c,team:d}=e.params,h=c.toLowerCase();t.replace(e.url.replace("/channels/","/messages/"));let u=(0,r.Os)(i,h);const m=(0,o.Uj)(i,d);if(!u){const a=await n((0,s.Cg)((0,l.WR)(i),m.id,"",h));if("error"in a)return await n((0,s.DC)(m.id)),se(e,t,(0,r.Dn)(i,m.id)),{data:void 0};u=a.data.channel}return n((0,s.wO)(u.id)),ae(u),{data:void 0}}}(t,n));break;case"direct_channel_username":e(function(e,t){return async(n,a)=>{const i=a(),{team:c,identifier:d}=e.params,h=d.slice(1,d.length).toLowerCase(),u=(0,o.Uj)(i,c);let m=(0,l.JE)(i,h);if(!m){const a=await n((0,j.JE)(h));if("error"in a)return await n((0,s.DC)(u.id)),se(e,t,(0,r.Dn)(i,u.id)),{data:void 0};m=a.data}const p=await n((0,Y.q6)(m.id));return"error"in p?(await n((0,s.DC)(u.id)),se(e,t,(0,r.Dn)(i,u.id)),{data:void 0}):(ae(p.data),{data:void 0})}}(t,n));break;case"direct_channel_email":e(function(e,t){return async(n,a)=>{const i=a(),{team:c,identifier:d}=e.params,h=d.toLowerCase(),u=(0,o.Uj)(i,c);let m=(0,l.ht)(i,h);if(!m){const a=await n((0,j.ht)(h));if("error"in a)return await n((0,s.DC)(u.id)),se(e,t,(0,r.Dn)(i,u.id)),{data:void 0};m=a.data}return t.replace("/".concat(c,"/messages/@").concat(m.username)),{data:void 0}}}(t,n));break;case"direct_channel_user_ids":e(ne(t,n));break;case"direct_channel_user_id":e(te(t,n,d));break;case"error":await e((0,s.DC)(u.id)),se(t,n,(0,r.Dn)(i,u.id))}return{data:void 0}}}function te(e,t,n){return async(a,i)=>{const c=i(),{team:d}=e.params,h=(0,o.Uj)(c,d);let u=(0,l.wz)(c,n);if(!u){const i=await a((0,j.wz)(n));if("error"in i)return await a((0,s.DC)(h.id)),se(e,t,(0,r.Dn)(c,h.id)),{data:void 0};u=i.data}return t.replace("/".concat(d,"/messages/@").concat(u.username)),{data:void 0}}}function ne(e,t){return async(n,a)=>{const i=a(),{team:c,identifier:d}=e.params,h=X.zj(d.toLowerCase(),(0,l.WR)(a())),u=(0,o.Uj)(i,c);let m=(0,l.wz)(i,h);if(!m){const a=await n((0,j.wz)(h));if("error"in a)return await n((0,s.DC)(u.id)),se(e,t,(0,r.Dn)(i,u.id)),{data:void 0};m=a.data}return t.replace("/".concat(c,"/messages/@").concat(m.username)),{data:void 0}}}function ae(e){Q.tk(e)}function se(e,t,n){const{team:a}=e.params;t.push(a?"/".concat(a,"/channels/").concat(n):"/")}async function re(e,t,n){const{team:a}=e.params;t.push(a?"/error?type=channel_not_found&returnTo=/".concat(a,"/channels/").concat(n):"/")}var ie=n(35073),oe=n(97026),le=n(14778),ce=n(87818),de=n(78417),he=n(1396),ue=n(57898),me=n(52729),pe=n(78546),ge=n(30112),fe=n(92008),Ee=n(59671),be=n(28764),Ce=n(78608),ye=n(72870),ve=n(99255),_e=n(45955),Me=n(92269),we=n(87778),Se=n(69410),Te=n(85406),Ae=n(11039),Ie=n(27191),Ne=n(19408),Le=n(61436);function Re(e){var t;const n=(0,le.useIntl)(),s=(0,Ne.A)(),r=(0,J.qc)((0,a.useSelector)(l.HW).roles),[i,c]=(0,Ae.A)(),d=(0,a.useSelector)(o.H7),h=(0,a.useSelector)((t=>(0,me.Bz)(t,e.channelId||"")))||function(e){return void 0===e?0:e+864e5}(e.firstInaccessiblePostTime),[u,m,p]=(0,Le.o)({ctaText:n.formatMessage({id:"workspace_limits.message_history.locked.cta.end_user",defaultMessage:"Notify Admin"})},{required_feature:z.W0.UNLIMITED_MESSAGES,required_plan:z.gS.Professional,trial_notification:!1});if(!c)return null;const g={month:"long",day:"numeric"};Date.now()-h>=31536e6&&(g.year="numeric");const f={date:n.formatDate(h,g),team:null==d?void 0:d.display_name},E=n.formatNumber((null==i||null===(t=i.messages)||void 0===t?void 0:t.history)||0);let b=n.formatMessage({id:"workspace_limits.message_history.locked.title.end_user",defaultMessage:"Notify your admin to unlock messages prior to {date} in {team}"},f),C=n.formatMessage({id:"workspace_limits.message_history.locked.description.end_user",defaultMessage:"Some older messages may not be shown because your workspace has over {limit} messages. Select Notify Admin to send an automatic request to your System Admins to upgrade."},{limit:E}),y=P().createElement("button",{className:"btn btn-primary",onClick:e=>m(e,"center_channel_posts_over_limit_banner"),disabled:p===Ie.Q.AlreadyComplete},u);return r&&(b=n.formatMessage({id:"workspace_limits.message_history.locked.title.admin",defaultMessage:"Unlock messages prior to {date} in {team}"},f),C=n.formatMessage({id:"workspace_limits.message_history.locked.description.admin",defaultMessage:"To view and search all of the messages in your workspace’s history, rather than just the most recent {limit} messages, upgrade to one of our paid plans. <a>Review our plan options and pricing.</a>"},{limit:E,a:e=>P().createElement("a",{href:"#",onClick:e=>{e.preventDefault(),s({trackingLocation:"center_channel_posts_over_limit_banner"})}},e)}),y=P().createElement("button",{className:"btn is-admin",onClick:()=>s({trackingLocation:"center_channel_posts_over_limit_banner"})},n.formatMessage({id:"workspace_limits.message_history.locked.cta.admin",defaultMessage:"Upgrade now"}))),P().createElement("div",{className:"CenterMessageLock"},P().createElement("div",{className:"CenterMessageLock__left"},P().createElement(Te.EyeOffOutlineIcon,{color:"rgba(var(--center-channel-color-rgb), 0.75)"})),P().createElement("div",{className:"CenterMessageLock__right"},P().createElement("div",{className:"CenterMessageLock__title"},b),P().createElement("div",{className:"CenterMessageLock__description"},C),P().createElement("div",{className:"CenterMessageLock__cta"},y)))}Re.propTypes={channelId:F().string,firstInaccessiblePostTime:F().number};var Pe=n(51703),Oe=n(69657),ke=n(62351),De=n(16230),xe=n(69669),Fe=n(64109);const He=e=>{var t,n;return R.createElement("svg",Object.assign({width:null!==(t=e.width)&&void 0!==t?t:"130",height:null!==(n=e.height)&&void 0!==n?n:"102",viewBox:"0 0 130 102",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),R.createElement("g",{clipPath:"url(#clip0_4212_90419)"},R.createElement("path",{d:"M2.50001 16L2.5 31L127.5 31L127.5 75L66 75",stroke:"var(--center-channel-color)",strokeOpacity:"0.32",strokeLinecap:"round"}),R.createElement("path",{d:"M2.5 69L2.5 42L29 42",stroke:"var(--center-channel-color)",strokeOpacity:"0.32",strokeLinecap:"round"}),R.createElement("path",{d:"M18.5 70.5L18.5 56.5L106 56.5",stroke:"var(--center-channel-color)",strokeOpacity:"0.32",strokeLinecap:"round"}),R.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 0 16)",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 0 74)",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 16 74)",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"71",cy:"59",r:"43",fill:"var(--center-channel-color)",fillOpacity:"0.12"}),R.createElement("path",{d:"M110.748 91.5258L119 100V56C119 54.8954 118.105 54 117 54H76.0005C74.8959 54 74.0005 54.8954 74.0005 56V88.9211C74.0005 90.0256 74.8959 90.9211 76.0005 90.9211H109.316C109.855 90.9211 110.372 91.1391 110.748 91.5258Z",fill:"#28427B"}),R.createElement("circle",{opacity:"0.48",cx:"86.831",cy:"65.831",r:"5.83099",fill:"var(--button-color)"}),R.createElement("path",{opacity:"0.4",d:"M96 64H112",stroke:"var(--button-color-rgb)",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M82 79H103.38",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M82 83H96.2535",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M96 68H110",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M82 75H93.0141",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M95.6064 75H107.268",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),R.createElement("path",{d:"M28.605 67.5638L15 81V12C15 10.8954 15.8954 10 17 10H83C84.1046 10 85 10.8954 85 12V64.9868C85 66.0914 84.1046 66.9868 83 66.9868H30.0103C29.4842 66.9868 28.9793 67.1941 28.605 67.5638Z",fill:"var(--center-channel-bg)"}),R.createElement("path",{d:"M28.2536 67.2081L15.5 79.8035V12C15.5 11.1716 16.1716 10.5 17 10.5H83C83.8284 10.5 84.5 11.1716 84.5 12V64.9868C84.5 65.8153 83.8284 66.4868 83 66.4868H30.0103C29.3527 66.4868 28.7215 66.746 28.2536 67.2081Z",stroke:"var(--center-channel-color)",strokeOpacity:"0.8"}),R.createElement("circle",{cx:"33",cy:"29",r:"9",fill:"var(--center-channel-color)",fillOpacity:"0.4"}),R.createElement("path",{d:"M48 25H64",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M25 49H62",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M25 55H47",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M48 31H73",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M25 43H42",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M46 43H64",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("circle",{cx:"78",cy:"19",r:"19",fill:"#32539A"}),R.createElement("path",{d:"M98 49L80 49",stroke:"var(--center-channel-color)",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"round"}),R.createElement("path",{d:"M76 49L70 49",stroke:"var(--center-channel-color)",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"round"}),R.createElement("path",{d:"M67 49L65 49",stroke:"var(--center-channel-color)",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"round"}),R.createElement("circle",{cx:"44",cy:"75",r:"2",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"52",cy:"75",r:"2",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"60",cy:"75",r:"2",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("rect",{x:"70.5",y:"15.5",width:"15",height:"12",rx:"1.5",stroke:"var(--button-color)"}),R.createElement("path",{d:"M73 16V13C73 10.2386 75.2386 8 78 8V8C80.7614 8 83 10.2386 83 13V16",stroke:"var(--button-color)"})),R.createElement("defs",null,R.createElement("clipPath",{id:"clip0_4212_90419"},R.createElement("rect",{width:"130",height:"102",fill:"white"}))))};He.propTypes={width:F().number,height:F().number};const Ue=He,Be=e=>{var t,n;return P().createElement("svg",{width:null!==(t=e.width)&&void 0!==t?t:"130",height:null!==(n=e.height)&&void 0!==n?n:"102",viewBox:"0 0 130 102",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},P().createElement("g",{clipPath:"url(#clip0_4212_90121)"},P().createElement("path",{d:"M2.50001 16L2.5 31L127.5 31L127.5 75L66 75",stroke:"rgba(var(--center-channel-color-rgb), 0.32)",strokeLinecap:"round"}),P().createElement("path",{d:"M2.5 69L2.5 42L29 42",stroke:"rgba(var(--center-channel-color-rgb), 0.32)",strokeLinecap:"round"}),P().createElement("path",{d:"M18.5 70.5L18.5 56.5L106 56.5",stroke:"rgba(var(--center-channel-color-rgb), 0.32)",strokeLinecap:"round"}),P().createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 0 16)",fill:"rgba(var(--center-channel-color-rgb), 0.32)"}),P().createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 0 74)",fill:"rgba(var(--center-channel-color-rgb), 0.32)"}),P().createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 16 74)",fill:"rgba(var(--center-channel-color-rgb), 0.32)"}),P().createElement("circle",{cx:"71",cy:"59",r:"43",fill:"rgba(var(--center-channel-color-rgb), 0.12)"}),P().createElement("path",{d:"M110.748 91.5258L119 100V56C119 54.8954 118.105 54 117 54H76.0005C74.8959 54 74.0005 54.8954 74.0005 56V88.9211C74.0005 90.0256 74.8959 90.9211 76.0005 90.9211H109.316C109.855 90.9211 110.372 91.1391 110.748 91.5258Z",fill:"#28427B"}),P().createElement("circle",{opacity:"0.48",cx:"86.831",cy:"65.831",r:"5.83099",fill:"var(--button-color)"}),P().createElement("path",{opacity:"0.4",d:"M96 64H112",stroke:"var(--button-color-rgb)",strokeLinecap:"round"}),P().createElement("path",{opacity:"0.4",d:"M82 79H103.38",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),P().createElement("path",{opacity:"0.4",d:"M82 83H96.2535",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),P().createElement("path",{opacity:"0.4",d:"M96 68H110",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),P().createElement("path",{opacity:"0.4",d:"M82 75H93.0141",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),P().createElement("path",{opacity:"0.4",d:"M95.6064 75H107.268",stroke:"rgba(var(--button-color-rgb))",strokeLinecap:"round"}),P().createElement("path",{d:"M28.605 67.5638L15 81V12C15 10.8954 15.8954 10 17 10H83C84.1046 10 85 10.8954 85 12V64.9868C85 66.0914 84.1046 66.9868 83 66.9868H30.0103C29.4842 66.9868 28.9793 67.1941 28.605 67.5638Z",fill:"rgba(var(--center-channel-bg-rgb))"}),P().createElement("path",{d:"M28.2536 67.2081L15.5 79.8035V12C15.5 11.1716 16.1716 10.5 17 10.5H83C83.8284 10.5 84.5 11.1716 84.5 12V64.9868C84.5 65.8153 83.8284 66.4868 83 66.4868H30.0103C29.3527 66.4868 28.7215 66.746 28.2536 67.2081Z",stroke:"rgba(var(--center-channel-color-rgb), 0.8)"}),P().createElement("circle",{cx:"33",cy:"29",r:"9",fill:"rgba(var(--center-channel-color-rgb), 0.4)"}),P().createElement("path",{d:"M48 25H64",stroke:"rgba(var(--center-channel-color-rgb), 0.4)",strokeLinecap:"round"}),P().createElement("path",{d:"M25 49H62",stroke:"rgba(var(--center-channel-color-rgb), 0.4)",strokeLinecap:"round"}),P().createElement("path",{d:"M25 55H47",stroke:"rgba(var(--center-channel-color-rgb), 0.4)",strokeLinecap:"round"}),P().createElement("path",{d:"M48 31H73",stroke:"rgba(var(--center-channel-color-rgb), 0.4)",strokeLinecap:"round"}),P().createElement("path",{d:"M25 43H42",stroke:"rgba(var(--center-channel-color-rgb), 0.4)",strokeLinecap:"round"}),P().createElement("path",{d:"M46 43H64",stroke:"rgba(var(--center-channel-color-rgb), 0.4)",strokeLinecap:"round"}),P().createElement("circle",{cx:"78",cy:"19",r:"19",fill:"#32539A"}),P().createElement("path",{d:"M98 49L80 49",stroke:"rgba(var(--center-channel-color-rgb), 0.8)",strokeLinecap:"round",strokeLinejoin:"round"}),P().createElement("path",{d:"M76 49L70 49",stroke:"rgba(var(--center-channel-color-rgb), 0.8)",strokeLinecap:"round",strokeLinejoin:"round"}),P().createElement("path",{d:"M67 49L65 49",stroke:"rgba(var(--center-channel-color-rgb), 0.8)",strokeLinecap:"round",strokeLinejoin:"round"}),P().createElement("circle",{cx:"44",cy:"75",r:"2",fill:"rgba(var(--center-channel-color-rgb), 0.32)"}),P().createElement("circle",{cx:"52",cy:"75",r:"2",fill:"rgba(var(--center-channel-color-rgb), 0.32)"}),P().createElement("circle",{cx:"60",cy:"75",r:"2",fill:"rgba(var(--center-channel-color-rgb), 0.32)"}),P().createElement("circle",{cx:"78",cy:"19",r:"9.5",stroke:"rgba(var(--button-color-rgb))"}),P().createElement("path",{d:"M87.5 20.2525C86.1859 21.8482 82.4292 23 78 23C73.5708 23 69.8141 21.8482 68.5 20.2525",stroke:"rgba(var(--button-color-rgb))"}),P().createElement("path",{d:"M86.6622 15C84.9331 16.1956 81.7014 17 78 17C74.2986 17 71.0669 16.1956 69.3378 15",stroke:"rgba(var(--button-color-rgb))"}),P().createElement("path",{d:"M81.5 19C81.5 21.7141 81.059 24.1482 80.3642 25.8854C80.0162 26.7553 79.6144 27.4258 79.1937 27.8706C78.7741 28.3143 78.3705 28.5 78 28.5C77.6295 28.5 77.2259 28.3143 76.8063 27.8706C76.3856 27.4258 75.9838 26.7553 75.6358 25.8854C74.941 24.1482 74.5 21.7141 74.5 19C74.5 16.2859 74.941 13.8518 75.6358 12.1146C75.9838 11.2447 76.3856 10.5742 76.8063 10.1294C77.2259 9.6857 77.6295 9.5 78 9.5C78.3705 9.5 78.7741 9.6857 79.1937 10.1294C79.6144 10.5742 80.0162 11.2447 80.3642 12.1146C81.059 13.8518 81.5 16.2859 81.5 19Z",stroke:"rgba(var(--button-color-rgb))"})),P().createElement("defs",null,P().createElement("clipPath",{id:"clip0_4212_90121"},P().createElement("rect",{width:"130",height:"102",fill:"rgba(var(--center-channel-bg-rgb))"}))))};Be.propTypes={width:F().number,height:F().number};const qe=Be,je=e=>{var t,n;return R.createElement("svg",Object.assign({width:null!==(t=e.width)&&void 0!==t?t:"130",height:null!==(n=e.height)&&void 0!==n?n:"92",viewBox:"0 0 130 92",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),R.createElement("g",{clipPath:"url(#clip0_4210_88396)"},R.createElement("path",{d:"M2.50001 6.00001L2.5 21L127.5 21L127.5 65L66 65",stroke:"var(--center-channel-color)",strokeOpacity:"0.24",strokeLinecap:"round"}),R.createElement("path",{d:"M2.49999 59L2.49999 32L29 32",stroke:"var(--center-channel-color)",strokeOpacity:"0.24",strokeLinecap:"round"}),R.createElement("path",{d:"M18.5 60.5L18.5 46.5L106 46.5",stroke:"var(--center-channel-color)",strokeOpacity:"0.24",strokeLinecap:"round"}),R.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 0 6)",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 0 64)",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",transform:"matrix(1 8.74228e-08 8.74228e-08 -1 16 64)",fill:"var(--center-channel-color)",fillOpacity:"0.4"}),R.createElement("circle",{cx:"71",cy:"49",r:"43",fill:"var(--center-channel-color)",fillOpacity:"0.12"}),R.createElement("path",{d:"M109.748 82.5258L117.999 91V47C117.999 45.8954 117.104 45 115.999 45H74.9998C73.8952 45 72.9998 45.8954 72.9998 47V79.9211C72.9998 81.0256 73.8952 81.9211 74.9998 81.9211H108.315C108.855 81.9211 109.371 82.1391 109.748 82.5258Z",fill:"#28427B"}),R.createElement("circle",{opacity:"0.48",cx:"85.8309",cy:"56.831",r:"5.83099",fill:"#FFFFFF"}),R.createElement("path",{opacity:"0.4",d:"M94.9999 55H111",stroke:"#FFFFFF",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M80.9999 70H102.38",stroke:"#FFFFFF",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M80.9999 74H95.2535",stroke:"#FFFFFF",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M94.9999 59H109",stroke:"#FFFFFF",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M80.9999 66H92.014",stroke:"#FFFFFF",strokeLinecap:"round"}),R.createElement("path",{opacity:"0.4",d:"M94.6064 66H106.268",stroke:"#FFFFFF",strokeLinecap:"round"}),R.createElement("path",{d:"M28.605 57.5638L15 71V2C15 0.895431 15.8954 0 17 0H83C84.1046 0 85 0.89543 85 2V54.9868C85 56.0914 84.1046 56.9868 83 56.9868H30.0103C29.4842 56.9868 28.9793 57.1941 28.605 57.5638Z",fill:"var(--center-channel-bg)"}),R.createElement("path",{d:"M28.2536 57.2081L15.5 69.8035V2C15.5 1.17157 16.1716 0.5 17 0.5H83C83.8284 0.5 84.5 1.17157 84.5 2V54.9868C84.5 55.8153 83.8284 56.4868 83 56.4868H30.0103C29.3527 56.4868 28.7215 56.746 28.2536 57.2081Z",stroke:"var(--center-channel-color)",strokeOpacity:"0.8"}),R.createElement("circle",{cx:"33",cy:"19",r:"9",fill:"var(--center-channel-color)",fillOpacity:"0.4"}),R.createElement("path",{d:"M48 15H64",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M25 39H69",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M25 45H47",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M48 21H73",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M25 33H42",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("path",{d:"M46 33H64",stroke:"var(--center-channel-color)",strokeOpacity:"0.4",strokeLinecap:"round"}),R.createElement("circle",{cx:"44",cy:"65",r:"2",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"52",cy:"65",r:"2",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("circle",{cx:"60",cy:"65",r:"2",fill:"var(--center-channel-color)",fillOpacity:"0.32"}),R.createElement("path",{d:"M101 33L83 33",stroke:"var(--center-channel-color)",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"round"}),R.createElement("path",{d:"M79 33L73 33",stroke:"var(--center-channel-color)",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"round"}),R.createElement("path",{d:"M70 33L68 33",stroke:"var(--center-channel-color)",strokeOpacity:"0.8",strokeLinecap:"round",strokeLinejoin:"round"})),R.createElement("defs",null,R.createElement("clipPath",{id:"clip0_4210_88396"},R.createElement("rect",{width:"130",height:"92",fill:"white"}))))};je.propTypes={width:F().number,height:F().number};const Ve=je;var Ge=n(36051),We=n(57486),ze=n(26808),Ke=n(61767),Je=n(12762),Ye=n(72180),Qe=n(45036),Ze=n(40142),Xe=n(46),$e=n(49888),et=n(53654);const tt=e=>{let{totalUsers:t,usersLimit:n,channel:s,pluginButtons:r}=e;const i=(0,a.useSelector)(o.Sy);if(!t)return P().createElement(et.A,null);const l=t<n;return P().createElement(ze.A,{teamId:i,permissions:[ue.xB.ADD_USER_TO_TEAM,ue.xB.INVITE_GUEST]},l?P().createElement(nt,{pluginButtons:r}):P().createElement(at,{channel:s,pluginButtons:r}))};tt.propTypes={totalUsers:F().number,usersLimit:F().number.isRequired,pluginButtons:F().node};const nt=e=>{let{pluginButtons:t}=e;const{formatMessage:n}=(0,le.useIntl)();return P().createElement(P().Fragment,null,t,P().createElement("div",{className:"LessThanMaxFreeUsers"},P().createElement(Je.A,{ariaLabel:n({id:"intro_messages.inviteOthers",defaultMessage:"Invite others to the workspace"}),id:"introTextInvite",className:"btn btn-sm btn-primary",modalId:z.IQ.INVITATION,dialogType:$e.default,onClick:()=>(0,Ee.sx)("channel_intro_message","click_invite_button")},P().createElement("i",{className:"icon-email-plus-outline",title:n({id:"generic_icons.add",defaultMessage:"Add Icon"})}),P().createElement(le.FormattedMessage,{id:"intro_messages.inviteOthersToWorkspace.button",defaultMessage:"Invite others to the workspace"}))))},at=e=>{let{channel:t,pluginButtons:n}=e;const{formatMessage:a}=(0,le.useIntl)(),s=t.group_constrained?z.IQ.ADD_GROUPS_TO_CHANNEL:z.IQ.CHANNEL_INVITE,r=t.group_constrained?Ze.A:Xe.A;if(0!==t.delete_at)return null;const i=t.type===z.YM.PRIVATE_CHANNEL;return P().createElement("div",{className:"MoreThanMaxFreeUsersWrapper"},P().createElement("div",{className:"MoreThanMaxFreeUsers"},P().createElement(We.A,{channelId:t.id,teamId:t.team_id,permissions:[i?ue.xB.MANAGE_PRIVATE_CHANNEL_MEMBERS:ue.xB.MANAGE_PUBLIC_CHANNEL_MEMBERS]},P().createElement(Je.A,{className:"action-button",modalId:s,dialogType:r,dialogProps:{channel:t}},P().createElement("i",{className:"icon-account-plus-outline",title:a({id:"generic_icons.add",defaultMessage:"Add Icon"})}),t.group_constrained&&P().createElement(le.FormattedMessage,{id:"intro_messages.inviteGropusToChannel.button",defaultMessage:"Add groups"}),!t.group_constrained&&P().createElement(le.FormattedMessage,{id:"intro_messages.inviteMembersToChannel.button",defaultMessage:"Add people"})))),n)},st=P().memo(tt);var rt=n(21650);const it=P().memo((e=>{if(0!==e.channel.delete_at||0===e.pluginButtons.length)return null;const t=e.pluginButtons.map((t=>P().createElement("button",{key:t.id,className:"action-button",onClick:()=>{var n;return null===(n=t.action)||void 0===n?void 0:n.call(t,e.channel,e.channelMember)}},t.icon,t.text)));return P().createElement(P().Fragment,null,t)}));it.propTypes={pluginButtons:F().array.isRequired},it.displayName="PluggableIntroButtons";const ot=it,lt=(0,a.connect)((function(e,t){return{channelMember:(0,r.M9)(e,t.channel.id),pluginButtons:(0,rt.qm)(e)}}))(ot);function ct(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class dt extends P().PureComponent{constructor(){super(...arguments),ct(this,"toggleFavorite",(()=>{this.props.channel&&(this.props.isFavorite?this.props.actions.unfavoriteChannel(this.props.channel.id):this.props.actions.favoriteChannel(this.props.channel.id))}))}componentDidMount(){var e;null!==(e=this.props.stats)&&void 0!==e&&e.total_users_count||this.props.actions.getTotalUsersStats()}render(){const{currentUserId:e,channel:t,fullWidth:n,locale:a,channelProfiles:s,enableUserCreation:r,isReadOnly:i,isFavorite:o,teamIsGroupConstrained:l,creatorName:c,teammate:d,teammateName:h,currentUser:u,stats:m,usersLimit:p,channelMember:g,isMobileView:f}=this.props;let E="";return n||(E="channel-intro--centered"),t?t.type===z.YM.DM_CHANNEL?function(e,t,n,a,s,r,i,o){const l="channelIntro";if(i){const n=i?X.RG(i.id,i.last_picture_update):"";let s=null,c=null;null!=i&&i.is_bot||(s=P().createElement(lt,{channel:e}),c=mt(e));const d=P().createElement("div",{className:"channel-intro__actions"},pt(a,r),c,s);return P().createElement("div",{id:l,className:"channel-intro "+t},P().createElement("div",{className:"post-profile-img__container channel-intro-img"},P().createElement(Ke.A,{src:n,size:"xl-custom-DM",status:i.is_bot?"":e.status,userId:null==i?void 0:i.id,username:null==i?void 0:i.username})),P().createElement("h2",{className:"channel-intro__title"},P().createElement(Ye.A,{userId:null==i?void 0:i.id})),P().createElement("p",{className:"channel-intro__text"},P().createElement(le.FormattedMessage,{id:"intro_messages.DM",defaultMessage:"This is the start of your direct message history with {teammate}. Messages and files shared here are not shown to anyone else.",values:{teammate:o}})),d)}return P().createElement("div",{id:l,className:"channel-intro "+t},P().createElement("p",{className:"channel-intro__text"},P().createElement(le.FormattedMessage,{id:"intro_messages.teammate",defaultMessage:"This is the start of your direct message history with this teammate. Messages and files shared here are not shown to anyone else."})))}(t,E,0,o,0,this.toggleFavorite,d,h):t.type===z.YM.GM_CHANNEL?function(e,t,n,a,s,r,i,o,l){const c="channelIntro";if(r.length>0){const d=r.find((e=>e.id===i)),h=r.filter((e=>e.id!==i)).map((e=>P().createElement(Ke.A,{key:"introprofilepicture"+e.id,src:X.RG(e.id,e.last_picture_update),size:"xl-custom-GM",userId:e.id,username:e.username}))),u=P().createElement("div",{className:"channel-intro__actions"},pt(n,s),mt(e),!a&&gt(e,o),P().createElement(lt,{channel:e}));return P().createElement("div",{id:c,className:"channel-intro "+t},P().createElement("div",{className:"post-profile-img__container channel-intro-img channel-intro-img__group"},h),P().createElement("h2",{className:"channel-intro__title"},e.display_name),P().createElement("p",{className:"channel-intro__text"},P().createElement(le.FormattedMessage,{id:"intro_messages.group_message",defaultMessage:"This is the start of your group message history with these teammates. "}),ut(d,l)),u)}return P().createElement("div",{id:c,className:"channel-intro "+t},P().createElement("p",{className:"channel-intro__text"},P().createElement(le.FormattedMessage,{id:"intro_messages.group_message",defaultMessage:"This is the start of your group message history with these teammates. Messages and files shared here are not shown to people outside this area."})))}(t,E,o,f,this.toggleFavorite,s,e,u,g):t.name===z.YM.DEFAULT_CHANNEL?function(e,t,n,a,s,r,i,o,l,c,d){let h=null;const u=i.total_users_count,m=e.type===z.YM.PRIVATE_CHANNEL,p=u<o;let g=null,f=null,E=null;if(!c){f=P().createElement(lt,{channel:e});const t=mt(e);t&&(g=P().createElement(We.A,{teamId:e.team_id,channelId:e.id,permissions:[m?ue.xB.MANAGE_PRIVATE_CHANNEL_PROPERTIES:ue.xB.MANAGE_PUBLIC_CHANNEL_PROPERTIES]},t))}return!c&&l&&(h=P().createElement(ze.A,{teamId:e.team_id,permissions:[ue.xB.INVITE_USER]},P().createElement(ze.A,{teamId:e.team_id,permissions:[ue.xB.ADD_USER_TO_TEAM]},!d&&P().createElement(st,{totalUsers:u,usersLimit:o,channel:e,pluginButtons:f}),d&&P().createElement(Je.A,{className:"intro-links color--link",modalId:z.IQ.ADD_GROUPS_TO_TEAM,dialogType:xe.A,dialogProps:{channel:e}},P().createElement("i",{className:"fa fa-user-plus"}),P().createElement(le.FormattedMessage,{id:"intro_messages.addGroupsToTeam",defaultMessage:"Add other groups to this team"}))))),E=p?P().createElement("div",{className:"channel-intro__actions"},E=h):P().createElement("div",{className:"channel-intro__actions"},pt(a,r),g,gt(e,n),d&&f),P().createElement("div",{id:"channelIntro",className:"channel-intro "+t},P().createElement(Ve,null),P().createElement("h2",{className:"channel-intro__title"},e.display_name),P().createElement("p",{className:"channel-intro__text"},!c&&P().createElement(le.FormattedMessage,{id:"intro_messages.default",defaultMessage:"Welcome to {display_name}. Post messages here that you want everyone to see. Everyone automatically becomes a member of this channel when they join the team.",values:{display_name:e.display_name}}),c&&P().createElement(le.FormattedMessage,{id:"intro_messages.readonly.default",defaultMessage:"Welcome to {display_name}. Messages can only be posted by admins. Everyone automatically becomes a permanent member of this channel when they join the team.",values:{display_name:e.display_name}})),E)}(t,E,u,o,0,this.toggleFavorite,m,p,r,i,l):t.name===z.YM.OFFTOPIC_CHANNEL?function(e,t,n,a,s,r,i,o){const l=e.type===z.YM.PRIVATE_CHANNEL,c=mt(e),d=i.total_users_count,h=d<o;let u=null,m=null;c&&(u=P().createElement(We.A,{teamId:e.team_id,channelId:e.id,permissions:[l?ue.xB.MANAGE_PRIVATE_CHANNEL_PROPERTIES:ue.xB.MANAGE_PUBLIC_CHANNEL_PROPERTIES]},c));const p=P().createElement(st,{totalUsers:d,usersLimit:o,channel:e,pluginButtons:P().createElement(lt,{channel:e})});return m=h?P().createElement("div",{className:"channel-intro__actions"},m=p):P().createElement("div",{className:"channel-intro__actions"},pt(n,r),u,gt(e,s)),P().createElement("div",{id:"channelIntro",className:"channel-intro "+t},P().createElement(qe,null),P().createElement("h2",{className:"channel-intro__title"},e.display_name),P().createElement("p",{className:"channel-intro__text"},P().createElement(le.FormattedMessage,{id:"intro_messages.offTopic",defaultMessage:"This is the start of {display_name}, a channel for non-work-related conversations.",values:{display_name:e.display_name}})),m)}(t,E,o,0,u,this.toggleFavorite,m,p):t.type===z.YM.OPEN_CHANNEL||t.type===z.YM.PRIVATE_CHANNEL?function(e,t,n,a,s,r,i,o,l,c){const d=e.display_name;let h,u=null;const m=0!==e.delete_at,p=i.total_users_count,g=p<o;h=m?"":e.type===z.YM.PRIVATE_CHANNEL?P().createElement(le.FormattedMessage,{id:"intro_messages.onlyInvited",defaultMessage:"This is the start of {display_name}. Only invited members can see this private channel.",values:{display_name:e.display_name}}):P().createElement(le.FormattedMessage,{id:"intro_messages.anyMember",defaultMessage:"This is the start of {display_name}. Any team member can join and read this channel.",values:{display_name:e.display_name}});const f=P().createElement(le.FormattedDate,{value:e.create_at,month:(0,Qe.FS)(l),day:"2-digit",year:"numeric"});let E,b;""===c?e.type===z.YM.PRIVATE_CHANNEL?E=P().createElement(le.FormattedMessage,{id:"intro_messages.noCreatorPrivate",defaultMessage:"Private channel created on {date}.",values:{name:d,date:f}}):e.type===z.YM.OPEN_CHANNEL&&(E=P().createElement(le.FormattedMessage,{id:"intro_messages.noCreator",defaultMessage:"Public channel created on {date}.",values:{name:d,date:f}})):e.type===z.YM.PRIVATE_CHANNEL?E=P().createElement("span",null,P().createElement(le.FormattedMessage,{id:"intro_messages.creatorPrivate",defaultMessage:"Private channel created by {creator} on {date}.",values:{name:d,creator:c,date:f}})):e.type===z.YM.OPEN_CHANNEL&&(E=P().createElement("span",null,P().createElement(le.FormattedMessage,{id:"intro_messages.creator",defaultMessage:"Public channel created by {creator} on {date}.",values:{name:d,creator:c,date:f}}))),e.purpose&&""!==e.purpose&&(b=P().createElement("span",null,P().createElement(le.FormattedMessage,{id:"intro_messages.purpose",defaultMessage:" This channel's purpose is: {purpose}",values:{purpose:e.purpose}})));const C=e.type===z.YM.PRIVATE_CHANNEL;let y=null,v=null;const _=mt(e);return _&&(y=P().createElement(We.A,{teamId:e.team_id,channelId:e.id,permissions:[C?ue.xB.MANAGE_PRIVATE_CHANNEL_PROPERTIES:ue.xB.MANAGE_PUBLIC_CHANNEL_PROPERTIES]},_)),u=P().createElement(st,{totalUsers:p,usersLimit:o,channel:e,pluginButtons:P().createElement(lt,{channel:e})}),v=g?P().createElement("div",{className:"channel-intro__actions"},v=u):P().createElement("div",{className:"channel-intro__actions"},pt(a,r),u,y,!s&&gt(e,n),P().createElement(lt,{channel:e})),P().createElement("div",{id:"channelIntro",className:"channel-intro "+t},C?P().createElement(Ue,null):P().createElement(qe,null),P().createElement("h2",{className:"channel-intro__title"},e.display_name),P().createElement("div",{className:"channel-intro__created"},C?P().createElement(Te.LockOutlineIcon,{size:14}):P().createElement(Te.GlobeIcon,{size:14}),E),P().createElement("p",{className:"channel-intro__text"},h,b),v)}(t,E,u,o,f,this.toggleFavorite,m,p,a,c):null:null}}ct(dt,"propTypes",{currentUserId:F().string.isRequired,fullWidth:F().bool.isRequired,locale:F().string.isRequired,channelProfiles:F().array.isRequired,enableUserCreation:F().bool,isReadOnly:F().bool,isFavorite:F().bool.isRequired,teamIsGroupConstrained:F().bool,creatorName:F().string.isRequired,teammateName:F().string,stats:F().any.isRequired,usersLimit:F().number.isRequired,isMobileView:F().bool.isRequired,actions:F().shape({getTotalUsersStats:F().func.isRequired,favoriteChannel:F().func.isRequired,unfavoriteChannel:F().func.isRequired}).isRequired});const ht=(0,le.defineMessages)({muted:{id:"intro_messages.GM.muted",defaultMessage:"This group message is currently <b>muted</b>, so you will not be notified."},[ke.S.ALL]:{id:"intro_messages.GM.all",defaultMessage:"You'll be notified <b>for all activity</b> in this group message."},[ke.S.DEFAULT]:{id:"intro_messages.GM.all",defaultMessage:"You'll be notified <b>for all activity</b> in this group message."},[ke.S.MENTION]:{id:"intro_messages.GM.mention",defaultMessage:"You have selected to be notified <b>only when mentioned</b> in this group message."},[ke.S.NONE]:{id:"intro_messages.GM.none",defaultMessage:"You have selected to <b>never</b> be notified in this group message."}}),ut=(e,t)=>{var n,a;if((0,De.X4)(t))return P().createElement(le.FormattedMessage,Object.assign({},ht.muted,{values:{b:e=>P().createElement("b",null,e)}}));const s=(null==t||null===(n=t.notify_props)||void 0===n?void 0:n.desktop)||ke.S.DEFAULT,r=(null==e||null===(a=e.notify_props)||void 0===a?void 0:a.desktop)||ke.S.MENTION;let i=s;return i===ke.S.DEFAULT&&(i=r),s===ke.S.DEFAULT&&r===ke.S.MENTION&&(i=ke.S.ALL),P().createElement(le.FormattedMessage,Object.assign({},ht[i],{values:{b:e=>P().createElement("b",null,e)}}))};function mt(e){return 0!==e.delete_at?null:P().createElement(Je.A,{modalId:z.IQ.EDIT_CHANNEL_HEADER,ariaLabel:X.Vw({id:"intro_messages.setHeader",defaultMessage:"Set header"}),className:"action-button",dialogType:Ge.A,dialogProps:{channel:e}},P().createElement(Te.PencilOutlineIcon,{size:24}),P().createElement(le.FormattedMessage,{id:"intro_messages.setHeader",defaultMessage:"Set header"}))}function pt(e,t,n){let a;return a=e?P().createElement(le.FormattedMessage,{id:"channel_info_rhs.top_buttons.favorited",defaultMessage:"Favorited"}):P().createElement(le.FormattedMessage,{id:"channel_info_rhs.top_buttons.favorite",defaultMessage:"Favorite"}),P().createElement("button",{id:"toggleFavoriteIntroButton",className:"action-button ".concat(e?"active":"","  ").concat(n),onClick:t,"aria-label":"Favorite"},e?P().createElement(Te.StarIcon,{size:24}):P().createElement(Te.StarOutlineIcon,{size:24}),a)}function gt(e,t){return P().createElement(Je.A,{modalId:z.IQ.CHANNEL_NOTIFICATIONS,ariaLabel:X.Vw({id:"intro_messages.notificationPreferences",defaultMessage:"Notification Preferences"}),className:"action-button",dialogType:Fe.A,dialogProps:{channel:e,currentUser:t}},P().createElement(Te.BellRingOutlineIcon,{size:24}),P().createElement(le.FormattedMessage,{id:"intro_messages.notificationPreferences",defaultMessage:"Notifications"}))}const ft=(0,a.connect)((function(e){const t="true"===(0,i.zj)(e).EnableUserCreation,n=(0,o.H7)(e),a=(0,r.Lw)(e),s=(0,r.tW)(e),c=a?(0,r.yH)(e,a.id):void 0,d=(0,l.HW)(e),h=a?(0,l.wz)(e,a.creator_id):void 0,u=(0,l.ig)(e)||{total_users_count:0};return{currentUserId:(0,l.WR)(e),channel:a,fullWidth:(0,E.Jt)(e,z.pm.CATEGORY_DISPLAY_SETTINGS,z.pm.CHANNEL_DISPLAY_MODE,z.pm.CHANNEL_DISPLAY_MODE_DEFAULT)===z.pm.CHANNEL_DISPLAY_MODE_FULL_SCREEN,locale:(0,Oe.k)(e),channelProfiles:(0,l.Gv)(e),enableUserCreation:t,isReadOnly:!1,isFavorite:(0,r.TJ)(e),teamIsGroupConstrained:Boolean(null==n?void 0:n.group_constrained),creatorName:(0,X.GZ)(e,h),teammate:c,teammateName:(0,X.GZ)(e,c),currentUser:d,stats:u,usersLimit:10,channelMember:s,isMobileView:(0,W.w3)(e)}}),(function(e){return{actions:(0,q.bindActionCreators)({getTotalUsersStats:j.ig,favoriteChannel:s.yc,unfavoriteChannel:s.XJ},e)}}))(dt);var Et,bt,Ct,yt=n(42599),vt=n(50800),_t=n(76261);class Mt extends P().PureComponent{blockShortcutReactToLastPostForNonMessages(e){const{actions:{emitShortcutReactToLastPostFrom:t}}=this.props;(0,fe.Bn)(e)&&t(z.Hc.NO_WHERE)}componentDidUpdate(e){const{listId:t,isLastPost:n,shortcutReactToLastPostEmittedFrom:a}=this.props,s=e.shortcutReactToLastPostEmittedFrom!==a&&a===z.Hc.CENTER;n&&s&&this.blockShortcutReactToLastPostForNonMessages(t)}render(){const{listId:e,previousListId:t,loadingOlderPosts:n,loadingNewerPosts:a}=this.props,{OLDER_MESSAGES_LOADER:s,NEWER_MESSAGES_LOADER:r,CHANNEL_INTRO_MESSAGE:i,LOAD_OLDER_MESSAGES_TRIGGER:o,LOAD_NEWER_MESSAGES_TRIGGER:l}=z.D3;if(ge.fE(e)){const t=ge.GG(e);return P().createElement(vt.A,{key:t,date:t})}if(ge.OO(e))return P().createElement(_t.A,{separatorId:e,newMessagesSeparatorActions:this.props.newMessagesSeparatorActions,channelId:this.props.channelId});if(this.props.exceededLimitChannelId)return P().createElement(Re,{channelId:this.props.exceededLimitChannelId,firstInaccessiblePostTime:this.props.firstInaccessiblePostTime});if(e===i)return P().createElement(ft,null);if(e===o||e===l)return P().createElement("button",{className:"more-messages-text theme style--none color--link",onClick:e===o?this.props.loadOlderPosts:this.props.loadNewerPosts},P().createElement(le.FormattedMessage,{id:"posts_view.loadMore",defaultMessage:"Load More Messages"}));if(e===s||e===r){const e=!n&&!a;return P().createElement("div",{className:"loading-screen"},P().createElement("div",{className:U()("loading__content",{hideAnimation:e})},P().createElement("div",{className:"round round-1"}),P().createElement("div",{className:"round round-2"}),P().createElement("div",{className:"round round-3"})))}const c={previousPostId:t,shouldHighlight:Boolean(this.props.shouldHighlight),togglePostMenu:this.props.togglePostMenu,isLastPost:this.props.isLastPost};return ge.mD(e)?P().createElement(yt.A,Object.assign({location:z.Hc.CENTER,combinedId:e},c)):P().createElement(Pe.A,Object.assign({post:this.props.post,location:z.Hc.CENTER},c))}}Et=Mt,bt="propTypes",Ct={listId:F().string.isRequired,previousListId:F().string,fullWidth:F().bool,shouldHighlight:F().bool,loadOlderPosts:F().func.isRequired,loadNewerPosts:F().func.isRequired,togglePostMenu:F().func.isRequired,isLastPost:F().bool.isRequired,shortcutReactToLastPostEmittedFrom:F().string.isRequired,loadingNewerPosts:F().bool.isRequired,loadingOlderPosts:F().bool.isRequired,limitsLoaded:F().bool.isRequired,exceededLimitChannelId:F().string,firstInaccessiblePostTime:F().number,channelId:F().string.isRequired,newMessagesSeparatorActions:F().array.isRequired,actions:F().shape({emitShortcutReactToLastPostFrom:F().any.isRequired}).isRequired},(bt=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(bt))in Et?Object.defineProperty(Et,bt,{value:Ct,enumerable:!0,configurable:!0,writable:!0}):Et[bt]=Ct;const wt=(0,a.connect)((function(e,t){const n=(0,Se.l6)(e),a=(0,Me.y)(e),s=(0,_e.Os)(e),r=(0,_e.rd)(e),i={shortcutReactToLastPostEmittedFrom:n,usage:a,limits:s,limitsLoaded:r,post:(0,me.f5)(e,t.listId),currentUserId:(0,f.WR)(e),newMessagesSeparatorActions:e.plugins.components.NewMessagesSeparatorAction};if((t.listId===z.D3.OLDER_MESSAGES_LOADER||t.listId===z.D3.CHANNEL_INTRO_MESSAGE)&&r){const t=(0,f.eH)(e),n=(0,me.VT)(e).channels[t];(Boolean(n)||0===n)&&(i.exceededLimitChannelId=t,i.firstInaccessiblePostTime=n)}return i}),(function(e){return{actions:(0,q.bindActionCreators)({emitShortcutReactToLastPostFrom:we.Sq},e)}}))(Mt);function St(e){const{formatMessage:t}=(0,le.useIntl)();return P().createElement("span",e,P().createElement("svg",{x:"0px",y:"0px",viewBox:"-239 239 21 23",enableBackground:"new -239 239 21 23",role:"img","aria-label":t({id:"generic_icons.arrow.down",defaultMessage:"Down Arrow Icon"})},P().createElement("path",{d:"M-239,241.4l2.4-2.4l8.1,8.2l8.1-8.2l2.4,2.4l-10.5,10.6L-239,241.4z M-228.5,257.2l8.1-8.2l2.4,2.4l-10.5,10.6l-10.5-10.6 l2.4-2.4L-228.5,257.2z"})))}const Tt=e=>{let{isScrolling:t,atBottom:n,onClick:a}=e;return window.innerWidth>768?null:P().createElement("div",{className:U()("post-list__arrows",{scrolling:t&&!1===n}),onClick:a},P().createElement(St,null))};Tt.propTypes={isScrolling:F().bool.isRequired,atBottom:F().bool,onClick:F().func.isRequired};const At=Tt;n(76409);var It=n(8361),Nt=n(99044);const Lt=e=>{let{children:t,onDismiss:n}=e;return P().createElement("div",{"data-testid":"hint-toast",className:"hint-toast"},P().createElement("div",{className:"hint-toast__message"},t),P().createElement("div",{className:"hint-toast__dismiss",onClick:()=>{"function"==typeof n&&n()},"data-testid":"dismissHintToast"},P().createElement(Nt.A,{className:"close-btn",id:"dismissHintToast"})))};Lt.propTypes={children:F().node.isRequired,onDismiss:F().func.isRequired};var Rt=n(87383);const Pt=e=>{let{onDismiss:t,onClick:n}=e;const{formatMessage:a}=(0,le.useIntl)(),s=a({id:"postlist.toast.scrollToBottom",defaultMessage:"Jump to recents"});return P().createElement("div",{"data-testid":"scroll-to-bottom-toast",className:"scroll-to-bottom-toast btn btn-primary",onClick:e=>{e.preventDefault(),n()}},P().createElement(Rt.A,null),s,P().createElement("div",{className:"scroll-to-bottom-toast__dismiss",onClick:e=>{e.preventDefault(),e.stopPropagation(),t()},"data-testid":"scroll-to-bottom-toast--dismiss-button"},P().createElement(Nt.A,{className:"close-btn",id:"dismissScrollToBottomToast"})))};Pt.propTypes={onDismiss:F().func.isRequired,onClick:F().func.isRequired};const Ot=Pt;var kt=n(83642),Dt=n(77828),xt=n(89227),Ft=n(83007),Ht=n(36397),Ut=n(19513);function Bt(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qt=[Dt.hp.t8];class jt extends P().PureComponent{constructor(e){var t;super(e),t=this,Bt(this,"handleShortcut",(e=>{(0,Ut.e)(e,z.Ay.KeyCodes.ESCAPE)&&(this.state.showUnreadToast?this.hideUnreadToast():this.state.showNewMessagesToast?this.hideNewMessagesToast():this.state.showUnreadWithBottomStartToast?this.hideUnreadWithBottomStartToast():this.hideArchiveToast())})),Bt(this,"hideUnreadToast",(()=>{this.state.showUnreadToast&&this.setState({showUnreadToast:!1})})),Bt(this,"hideArchiveToast",(()=>{this.state.showMessageHistoryToast&&this.setState({showMessageHistoryToast:!1})})),Bt(this,"hideNewMessagesToast",(function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t.state.showNewMessagesToast&&(t.setState({showNewMessagesToast:!1}),e&&t.props.updateLastViewedBottomAt())})),Bt(this,"hideSearchHintToast",(()=>{this.props.onSearchHintDismiss&&this.props.onSearchHintDismiss()})),Bt(this,"hideUnreadWithBottomStartToast",(()=>{this.state.showUnreadWithBottomStartToast&&this.setState({showUnreadWithBottomStartToast:!1})})),Bt(this,"newMessagesToastText",((e,t)=>this.props.width>500&&void 0!==t?P().createElement(le.FormattedMessage,{id:"postlist.toast.newMessagesSince",defaultMessage:"{count, number} new {count, plural, one {message} other {messages}} {isToday, select, true {} other {since}} {date}",values:{count:e,isToday:(0,Ht.cK)(new Date(t)).toString(),date:P().createElement(Dt.Ay,{value:t,useTime:!1,ranges:qt})}}):P().createElement(le.FormattedMessage,{id:"postlist.toast.newMessages",defaultMessage:"{count, number} new {count, plural, one {message} other {messages}}",values:{count:e}}))),Bt(this,"archiveToastText",(()=>P().createElement(le.FormattedMessage,{id:"postlist.toast.history",defaultMessage:"Viewing message history"}))),Bt(this,"getSearchHintToastText",(()=>P().createElement(le.FormattedMessage,{id:"postlist.toast.searchHint",defaultMessage:"Tip: Try {searchShortcut} to search this channel",values:{searchShortcut:P().createElement(kt.t,null)}}))),Bt(this,"changeUrlToRemountChannelView",(()=>{const{match:e}=this.props;(0,Ft.J)().replace("/".concat(e.params.team))})),Bt(this,"scrollToNewMessage",(()=>{const{focusedPostId:e,atLatestPost:t,scrollToNewMessage:n,updateLastViewedBottomAt:a}=this.props;!e||t?(n(),a(),this.hideNewMessagesToast()):this.changeUrlToRemountChannelView()})),Bt(this,"scrollToLatestMessages",(()=>{var e,t;const{focusedPostId:n,atLatestPost:a,scrollToLatestMessages:s}=this.props;if(n){if(!a)return void this.changeUrlToRemountChannelView();this.hideArchiveToast()}s(),this.hideUnreadToast(),null===(e=(t=this.props).hideScrollToBottomToast)||void 0===e||e.call(t)})),Bt(this,"scrollToUnreadMessages",(()=>{this.props.scrollToUnreadMessages(),this.hideUnreadWithBottomStartToast()})),this.state={unreadCountInChannel:e.unreadCountInChannel,unreadCount:0}}static getDerivedStateFromProps(e,t){let n,{showUnreadToast:a,showNewMessagesToast:s,showMessageHistoryToast:r,showUnreadWithBottomStartToast:i}=t;return n=e.atLatestPost?e.unreadScrollPosition===ue.pm.UNREAD_SCROLL_POSITION_START_FROM_NEWEST&&t.unreadCountInChannel?t.unreadCountInChannel+e.newRecentMessagesCount:jt.countNewMessages(e.rootPosts,e.isCollapsedThreadsEnabled,e.postListIds):e.channelMarkedAsUnread?e.unreadScrollPosition===ue.pm.UNREAD_SCROLL_POSITION_START_FROM_NEWEST?e.unreadCountInChannel+e.newRecentMessagesCount:t.unreadCountInChannel:t.unreadCountInChannel+e.newRecentMessagesCount,void 0===a&&null!==e.atBottom&&(a=n>0&&!e.atBottom),void 0===r&&""!==e.focusedPostId&&null!==e.atBottom&&(r=e.initScrollOffsetFromBottom>1e3||!e.atLatestPost),!e.channelMarkedAsUnread||!1!==e.atBottom||t.channelMarkedAsUnread||t.showUnreadToast||(a=!0),e.channelMarkedAsUnread&&e.lastViewedAt!==t.lastViewedAt&&!1===e.atBottom&&(a=!0),!a&&n>0&&!1===e.atBottom&&e.latestPostTimeStamp&&e.lastViewedBottom<e.latestPostTimeStamp&&(s=!0),e.unreadScrollPosition!==ue.pm.UNREAD_SCROLL_POSITION_START_FROM_NEWEST||e.channelMarkedAsUnread||(a=!1),n||(a=!1,s=!1),e.isNewMessageLineReached&&(i=!1),void 0===i&&e.lastViewedAt&&e.lastViewedAt!==t.lastViewedAt&&e.shouldStartFromBottomWhenUnread&&n>0&&!e.isNewMessageLineReached&&(i=!0),{unreadCount:n,showUnreadToast:a,showNewMessagesToast:s,showUnreadWithBottomStartToast:i,lastViewedAt:e.lastViewedAt,atBottom:e.atBottom,channelMarkedAsUnread:e.channelMarkedAsUnread,showMessageHistoryToast:r}}componentDidMount(){this.mounted=!0;const{showUnreadToast:e,showNewMessagesToast:t,showMessageHistoryToast:n,showUnreadWithBottomStartToast:a}=this.state,s=Boolean(e||t||n||a);document.addEventListener("keydown",this.handleShortcut),this.props.actions.updateToastStatus(s)}componentDidUpdate(e,t){const{showUnreadToast:n,showNewMessagesToast:a,showMessageHistoryToast:s,showUnreadWithBottomStartToast:r}=this.state,{atBottom:i,atLatestPost:o,postListIds:l,lastViewedBottom:c,updateNewMessagesAtInChannel:d,actions:h}=this.props;!e.atBottom&&i&&o&&(this.hideNewMessagesToast(!1),this.hideUnreadToast(),this.hideArchiveToast());const u=e.postListIds.length,m=l.length;if(m!==u&&l[0]!==e.postListIds[0]&&!1===i&&o&&m>0&&!n&&d(c),t.showUnreadToast!==n||t.showNewMessagesToast!==a||t.showMessageHistoryToast!==s||t.showUnreadWithBottomStartToast!==r){const e=Boolean(n||a||s||r);h.updateToastStatus(e)}}componentWillUnmount(){document.removeEventListener("keydown",this.handleShortcut)}getToastToRender(){const{atLatestPost:e,atBottom:t,width:n,lastViewedAt:a,showSearchHintToast:s,showScrollToBottomToast:r}=this.props,{showUnreadToast:i,showNewMessagesToast:o,showMessageHistoryToast:l,showUnreadWithBottomStartToast:c,unreadCount:d}=this.state,h={show:!0,width:n,onDismiss:this.hideUnreadToast,onClick:this.scrollToLatestMessages,onClickMessage:P().createElement(le.FormattedMessage,{id:"postlist.toast.scrollToBottom",defaultMessage:"Jump to recents"}),showActions:!e||e&&!1===t};if(i&&d>0)return P().createElement(xt.A,h,this.newMessagesToastText(d,a));const u={show:!0,width:n,onDismiss:this.hideUnreadWithBottomStartToast,onClick:this.scrollToUnreadMessages,onClickMessage:P().createElement(le.FormattedMessage,{id:"postlist.toast.scrollToUnread",defaultMessage:"Jump to unreads"}),showActions:!0,jumpDirection:"up"};if(c&&d>0)return P().createElement(xt.A,u,this.newMessagesToastText(d,a));if(o){const e={onDismiss:this.hideNewMessagesToast,onClick:this.scrollToNewMessage,onClickMessage:P().createElement(le.FormattedMessage,{id:"postlist.toast.scrollToLatest",defaultMessage:"Jump to new messages"})};return P().createElement(xt.A,Object.assign({},h,e),this.newMessagesToastText(d,a))}if(l){const e={show:!0,width:n,onDismiss:this.hideArchiveToast,onClick:this.scrollToLatestMessages,onClickMessage:P().createElement(le.FormattedMessage,{id:"postlist.toast.scrollToBottom",defaultMessage:"Jump to recents"}),showActions:!0,extraClasses:"toast__history"};return P().createElement(xt.A,e,this.archiveToastText())}const m=[];return r&&m.push(P().createElement(Ot,{key:"scroll-to-bottom-toast",onClick:this.scrollToLatestMessages,onDismiss:this.props.onScrollToBottomToastDismiss})),s&&m.push(P().createElement(Lt,{key:"search-hint-toast",onDismiss:this.hideSearchHintToast},this.getSearchHintToastText())),m.length>0?P().createElement("div",{className:"toasts-wrapper"},m):null}render(){const e=this.getToastToRender();return P().createElement(P().Fragment,null,e)}}Bt(jt,"propTypes",{channelMarkedAsUnread:F().bool,postListIds:F().arrayOf(F().string).isRequired,latestPostTimeStamp:F().number,atBottom:F().oneOfType([F().bool,F().oneOf([null])]),lastViewedBottom:F().number.isRequired,width:F().number.isRequired,focusedPostId:F().string,initScrollOffsetFromBottom:F().number.isRequired,updateNewMessagesAtInChannel:F().func.isRequired,scrollToNewMessage:F().func.isRequired,scrollToLatestMessages:F().func.isRequired,scrollToUnreadMessages:F().func.isRequired,updateLastViewedBottomAt:F().func.isRequired,showSearchHintToast:F().bool.isRequired,onSearchHintDismiss:F().func.isRequired,showScrollToBottomToast:F().bool.isRequired,onScrollToBottomToastDismiss:F().func.isRequired,hideScrollToBottomToast:F().func.isRequired,shouldStartFromBottomWhenUnread:F().bool.isRequired,isNewMessageLineReached:F().bool.isRequired,rootPosts:F().objectOf(F().bool).isRequired,lastViewedAt:F().number.isRequired,newRecentMessagesCount:F().number.isRequired,unreadScrollPosition:F().string.isRequired,isCollapsedThreadsEnabled:F().bool.isRequired}),Bt(jt,"defaultProps",{focusedPostId:""}),Bt(jt,"countNewMessages",(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const a=(0,ge.V)(n);if(a<=0)return 0;let s=n.slice(0,a).filter((e=>!(0,fe.Bn)(e)));return t&&(s=s.filter((t=>e[t]))),s.length}));const Vt=(0,le.injectIntl)(jt),Gt=(0,O.withRouter)((0,a.connect)((function(){const e=(0,It.Mz)("makeCountUnreadsBelow",me.zX,l.WR,((e,t)=>t),((e,t,n)=>n),E.WW,((e,t,n,a,s)=>n?n.map((t=>e[t])).filter((e=>e&&e.user_id!==t&&e.state!==ue.AF.POST_DELETED&&e.create_at>a&&(!s||""===e.root_id))).length:0)),t=(0,It.Mz)("makeGetRootPosts",me.zX,l.WR,r.Lw,((e,t,n)=>Object.values(e).filter((e=>""===e.root_id&&e.channel_id===(null==n?void 0:n.id)&&e.state!==ue.AF.POST_DELETED)).reduce(((e,t)=>(e[t.id]=!0,e)),{}))),n=(0,ge.fG)();return function(a,s){let i=0;const o=(0,r.PW)(a,s.channelId),l=a.views.channel.lastChannelViewTime[s.channelId],c=(0,E.z0)(a);if(!s.atLatestPost){let t=(0,me.Lf)(a,s.channelId)||[];t&&(t=n(a,{postIds:t,lastViewedAt:l})),i=e(a,t,l)}return{rootPosts:t(a),lastViewedAt:l,newRecentMessagesCount:i,unreadScrollPosition:c,isCollapsedThreadsEnabled:(0,E.WW)(a),unreadCountInChannel:(0,r.zk)(a),channelMarkedAsUnread:o}}}),(function(e){return{actions:(0,q.bindActionCreators)({updateToastStatus:c.p4},e)}}))(Vt));var Wt=n(694),zt=n(89092);const Kt=e=>{const{postIds:t}=e,n=(0,R.useMemo)((()=>(0,fe.h7)(t||[])),[t]),s=(0,a.useSelector)((e=>(0,me.f5)(e,n))),r=(0,fe.VD)(s);return P().createElement("span",{className:"sr-only","aria-live":"polite"},r)};Kt.propTypes={postIds:F().arrayOf(F().string)};const Jt=Kt;function Yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yt(Object(n),!0).forEach((function(t){Zt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zt(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xt={padding:"14px 0px 7px"},$t={position:"absolute",bottom:"0",maxHeight:"100%"};class en extends P().PureComponent{constructor(e){var t;super(e),t=this,Zt(this,"scrollStopAction",null),Zt(this,"handleWindowResize",(()=>{this.showSearchHintThreshold=this.getShowSearchHintThreshold()})),Zt(this,"togglePostMenu",(e=>{let t=this.state.dynamicListStyle;this.props.isMobileView&&(t=Qt(Qt({},t),{},{willChange:e?"unset":"transform"})),this.setState({postMenuOpened:e,dynamicListStyle:t})})),Zt(this,"onNewMessageLineReached",(()=>{this.setState({isNewMessageLineReached:!0})})),Zt(this,"renderRow",(e=>{let{data:t,itemId:n,style:a}=e;const s=t.indexOf(n);let r="";const i="post-row__padding",o=-1!==s&&s<t.length-1?t[s+1]:"",l=s>0&&s<t.length?t[s-1]:"";((0,ge.fE)(l)||(0,ge.OO)(l))&&(r+=i+" bottom"),((0,ge.fE)(o)||(0,ge.OO)(o))&&(r.includes(i)?r+=" top":r+=i+" top");const c=n===this.state.postListIds[0];return P().createElement("div",{style:a,className:r},P().createElement(wt,{listId:n,previousListId:(0,fe.fn)(t,s),shouldHighlight:n===this.props.focusedPostId,loadOlderPosts:this.props.actions.loadOlderPosts,loadNewerPosts:this.props.actions.loadNewerPosts,togglePostMenu:this.togglePostMenu,isLastPost:c,loadingNewerPosts:this.props.loadingNewerPosts,loadingOlderPosts:this.props.loadingOlderPosts,channelId:this.props.channelId}))})),Zt(this,"scrollToFailed",(e=>{0===e?this.props.actions.changeUnreadChunkTimeStamp(0):this.props.actions.changeUnreadChunkTimeStamp(this.props.lastViewedAt)})),Zt(this,"onScroll",(e=>{let{scrollDirection:t,scrollOffset:n,scrollUpdateWasRequested:a,clientHeight:s,scrollHeight:r}=e;if(r<=0)return;const i="backward"===t&&!a,o="forward"===t&&!a,l=n<1e3,c=this.getOffsetFromBottom(n,r,s),d=c<1e3;if(i&&l&&!this.props.atOldestPost?this.props.actions.loadOlderPosts():o&&d&&!this.props.atLatestPost&&this.props.actions.loadNewerPosts(),this.props.isMobileView&&(this.state.isScrolling||this.setState({isScrolling:!0}),this.scrollStopAction&&this.scrollStopAction.fireAfter(z.Ay.SCROLL_DELAY)),this.checkBottom(n,r,s),a){var h;const e=null===(h=this.listRef.current)||void 0===h?void 0:h._getRangeToRender();e&&e[3]<=1&&!this.props.atLatestPost&&this.props.actions.canLoadMorePosts(z.DL.AFTER_ID),!this.state.atBottom&&r&&this.setState({initScrollOffsetFromBottom:c})}this.props.isMobileView&&this.state.showSearchHint&&this.setState({showSearchHint:!1}),this.props.isMobileView||this.state.isSearchHintDismissed||this.setState({showSearchHint:c>this.showSearchHintThreshold}),this.updateScrollToBottomToastVisibility(n,r,s)})),Zt(this,"getShowSearchHintThreshold",(()=>3*window.screen.height)),Zt(this,"checkBottom",((e,t,n)=>{this.updateAtBottom(this.isAtBottom(e,t,n))})),Zt(this,"getOffsetFromBottom",((e,t,n)=>t-n-e)),Zt(this,"isAtBottom",((e,t,n)=>this.getOffsetFromBottom(e,t,n)<=10&&t>0)),Zt(this,"updateAtBottom",(e=>{if(e!==this.state.atBottom){let t=Date.now();this.props.latestPostTimeStamp&&this.props.latestPostTimeStamp>t&&(t=this.props.latestPostTimeStamp),this.setState({atBottom:e,lastViewedBottom:t})}})),Zt(this,"updateLastViewedBottomAt",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();t.setState({lastViewedBottom:e})})),Zt(this,"handleScrollStop",(()=>{this.mounted&&this.setState({isScrolling:!1})})),Zt(this,"handleSearchHintDismiss",(()=>{this.setState({showSearchHint:!1,isSearchHintDismissed:!0})})),Zt(this,"handleScrollToBottomToastDismiss",(()=>{this.setState({showScrollToBottomToast:!1,isScrollToBottomDismissed:!0})})),Zt(this,"hideScrollToBottomToast",(()=>{this.setState({showScrollToBottomToast:!1})})),Zt(this,"updateScrollToBottomToastVisibility",((e,t,n)=>{if(this.state.showScrollToBottomToast&&this.state.atBottom)this.setState({showScrollToBottomToast:!1});else if(!this.state.isScrollToBottomDismissed){const a=this.getOffsetFromBottom(e,t,n);this.setState({showScrollToBottomToast:a>this.showSearchHintThreshold})}})),Zt(this,"updateFloatingTimestamp",(e=>{this.props.isMobileView&&this.props.postListIds&&this.setState({topPostId:(0,fe.h7)(this.props.postListIds.slice(e))})})),Zt(this,"onItemsRendered",(e=>{let{visibleStartIndex:t,visibleStopIndex:n}=e;this.updateFloatingTimestamp(t),this.newMessageLineIndex>0&&!this.state.isNewMessageLineReached&&this.newMessageLineIndex<=t&&this.newMessageLineIndex>=n&&this.onNewMessageLineReached()})),Zt(this,"initScrollToIndex",(()=>{if(this.props.focusedPostId)return{index:this.state.postListIds.findIndex((e=>e===this.props.focusedPostId)),position:"center"};if(this.props.shouldStartFromBottomWhenUnread)return{index:0,position:"end"};const e=(0,ge.V)(this.state.postListIds);return e>0?(0,ge.fE)(this.state.postListIds[e+1])?{index:e+1,position:"start",offset:-50}:{index:e,position:"start",offset:-50}:{index:0,position:"end"}})),Zt(this,"scrollToLatestMessages",(()=>{this.props.atLatestPost?this.scrollToBottom():(this.updateNewMessagesAtInChannel(),this.props.actions.changeUnreadChunkTimeStamp(0))})),Zt(this,"scrollToUnreadMessages",(()=>{this.props.actions.toggleShouldStartFromBottomWhenUnread()})),Zt(this,"scrollToBottom",(()=>{var e;null===(e=this.listRef.current)||void 0===e||e.scrollToItem(0,"end")})),Zt(this,"scrollToNewMessage",(()=>{var e;null===(e=this.listRef.current)||void 0===e||e.scrollToItem((0,ge.V)(this.state.postListIds),"start",-50)})),Zt(this,"updateNewMessagesAtInChannel",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();t.props.actions.updateNewMessagesAtInChannel(t.props.channelId,e)})),Zt(this,"renderToasts",(e=>P().createElement(Gt,{atLatestPost:this.props.atLatestPost,postListIds:this.state.postListIds,atBottom:this.state.atBottom,width:e,lastViewedBottom:this.state.lastViewedBottom,latestPostTimeStamp:this.props.latestPostTimeStamp,scrollToUnreadMessages:this.scrollToUnreadMessages,scrollToNewMessage:this.scrollToNewMessage,scrollToLatestMessages:this.scrollToLatestMessages,updateNewMessagesAtInChannel:this.updateNewMessagesAtInChannel,updateLastViewedBottomAt:this.updateLastViewedBottomAt,shouldStartFromBottomWhenUnread:this.props.shouldStartFromBottomWhenUnread,isNewMessageLineReached:this.state.isNewMessageLineReached,channelId:this.props.channelId,focusedPostId:this.props.focusedPostId,initScrollOffsetFromBottom:this.state.initScrollOffsetFromBottom,onSearchHintDismiss:this.handleSearchHintDismiss,showSearchHintToast:this.state.showSearchHint,showScrollToBottomToast:this.state.showScrollToBottomToast,onScrollToBottomToastDismiss:this.handleScrollToBottomToastDismiss,hideScrollToBottomToast:this.hideScrollToBottomToast})));const n=z.D3.CHANNEL_INTRO_MESSAGE;this.mounted=!0,this.state={isScrolling:!1,atBottom:null,lastViewedBottom:Date.now(),postListIds:[n],topPostId:"",postMenuOpened:!1,dynamicListStyle:{willChange:"transform"},initScrollCompleted:!1,initScrollOffsetFromBottom:0,showSearchHint:!1,isSearchHintDismissed:!1,isNewMessageLineReached:!1,showScrollToBottomToast:!1,isScrollToBottomDismissed:!1},this.listRef=P().createRef(),this.postListRef=P().createRef(),this.props.isMobileView&&(this.scrollStopAction=new zt.A(this.handleScrollStop)),this.initRangeToRender=this.props.focusedPostId?[0,100]:[0,50];let a=0;a=e.focusedPostId?(this.props.postListIds||[]).findIndex((e=>e===this.props.focusedPostId)):(0,ge.V)(e.postListIds||[]),this.newMessageLineIndex=(0,ge.V)(e.postListIds||[]);const s=e.focusedPostId?100:50;this.initRangeToRender=[Math.max(a-30,0),Math.max(a+30,Math.min((e.postListIds||[]).length-1,s))],this.showSearchHintThreshold=this.getShowSearchHintThreshold()}componentDidMount(){this.mounted=!0,window.addEventListener("resize",this.handleWindowResize),ye.A.addListener(z.wf.POST_LIST_SCROLL_TO_BOTTOM,this.scrollToLatestMessages)}getSnapshotBeforeUpdate(e){if(this.postListRef&&this.postListRef.current){const n=this.props.postListIds&&this.props.postListIds.length!==(e.postListIds||[]).length&&this.props.postListIds[0]===(e.postListIds||[])[0],a=this.props.atOldestPost!==e.atOldestPost;if((n||a)&&!1===this.state.atBottom){var t;const e=this.postListRef.current;return{previousScrollTop:null===(t=e.parentElement)||void 0===t?void 0:t.scrollTop,previousScrollHeight:e.scrollHeight}}}return null}componentDidUpdate(e,t,n){if(this.props.isMobileView&&!e.isMobileView&&(this.scrollStopAction=new zt.A(this.handleScrollStop)),!this.postListRef.current)return;const a=(e.postListIds||[]).length,s=(this.props.postListIds||[]).length;if(this.newMessageLineIndex=(0,ge.V)(this.props.postListIds||[]),n){const t=this.postListRef.current.scrollHeight,i=s!==a&&(this.props.postListIds||[])[0]===(e.postListIds||[])[0],o=this.props.atOldestPost!==e.atOldestPost;if((i||o)&&!this.state.atBottom&&n){const e=n.previousScrollTop+(t-n.previousScrollHeight);var r;0!==e&&e-n.previousScrollTop!=0&&(null===(r=this.listRef.current)||void 0===r||r.scrollTo(e,e-n.previousScrollTop,!0))}}}componentWillUnmount(){this.mounted=!1,window.removeEventListener("resize",this.handleWindowResize),ye.A.removeListener(z.wf.POST_LIST_SCROLL_TO_BOTTOM,this.scrollToLatestMessages)}static getDerivedStateFromProps(e,t){const n=e.postListIds||[];let a;a=e.atOldestPost?[...n,z.D3.CHANNEL_INTRO_MESSAGE]:e.autoRetryEnable?[...n,z.D3.OLDER_MESSAGES_LOADER]:[...n,z.D3.LOAD_OLDER_MESSAGES_TRIGGER],e.atLatestPost||(a=e.autoRetryEnable?[z.D3.NEWER_MESSAGES_LOADER,...a]:[z.D3.LOAD_NEWER_MESSAGES_TRIGGER,...a]);const s={postListIds:a};if(e.isMobileView!==t.isMobileView){s.isMobileView=e.isMobileView;const n=t.dynamicListStyle;t.postMenuOpened&&(e.isMobileView||"unset"!==n.willChange?e.isMobileView&&"transform"===n.willChange&&(s.dynamicListStyle=Qt(Qt({},n),{},{willChange:"unset"})):s.dynamicListStyle=Qt(Qt({},n),{},{willChange:"transform"}))}return s}render(){const{channelId:e}=this.props,{dynamicListStyle:t}=this.state;return P().createElement("div",{className:"a11y__region","data-a11y-sort-order":"1","data-a11y-focus-child":!0,"data-a11y-order-reversed":!0,"data-a11y-loop-navigation":!1,"aria-label":X.Vw({id:"accessibility.sections.centerContent",defaultMessage:"message list main region"})},this.props.isMobileView&&P().createElement(P().Fragment,null,P().createElement(ve.A,{isScrolling:this.state.isScrolling,postId:this.state.topPostId}),P().createElement(At,{isScrolling:this.state.isScrolling,atBottom:Boolean(this.state.atBottom),onClick:this.scrollToBottom})),P().createElement("div",{className:"post-list-holder-by-time",key:"postlist-"+e},P().createElement("div",{className:"post-list__table"},P().createElement("div",{id:"postListContent",className:"post-list__content"},P().createElement(Jt,{postIds:this.props.postListIds}),P().createElement(Ce.A,null,(e=>{let{height:n,width:a}=e;return P().createElement(P().Fragment,null,P().createElement("div",null,P().createElement(Wt.default,{pluggableName:"ChannelToast"}),this.renderToasts(a)),P().createElement(be.T,{ref:this.listRef,height:n,width:a,className:"post-list__dynamic",itemData:this.state.postListIds,overscanCountForward:80,overscanCountBackward:80,onScroll:this.onScroll,initScrollToIndex:this.initScrollToIndex,canLoadMorePosts:this.props.actions.canLoadMorePosts,innerRef:this.postListRef,style:Qt(Qt({},$t),t),innerListStyle:Xt,initRangeToRender:this.initRangeToRender,loaderId:z.D3.OLDER_MESSAGES_LOADER,correctScrollToBottom:this.props.atLatestPost,onItemsRendered:this.onItemsRendered,scrollToFailed:this.scrollToFailed},this.renderRow))}))))))}}Zt(en,"propTypes",{postListIds:F().arrayOf(F().string),channelId:F().string.isRequired,autoRetryEnable:F().bool.isRequired,loadingNewerPosts:F().bool.isRequired,loadingOlderPosts:F().bool.isRequired,isMobileView:F().bool.isRequired,atOldestPost:F().bool,atLatestPost:F().bool,latestPostTimeStamp:F().number,lastViewedAt:F().number.isRequired,focusedPostId:F().string,shouldStartFromBottomWhenUnread:F().bool.isRequired,actions:F().shape({loadOlderPosts:F().func.isRequired,loadNewerPosts:F().func.isRequired,canLoadMorePosts:F().func.isRequired,changeUnreadChunkTimeStamp:F().func.isRequired,updateNewMessagesAtInChannel:F().any.isRequired,toggleShouldStartFromBottomWhenUnread:F().func.isRequired}).isRequired});var tn=n(3295);function nn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function an(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,Ee.Gy)(tn.CU.PostListLoaded);const t=(0,tn.uB)({name:tn.t$.ChannelSwitch,startMark:tn.CU.ChannelLinkClicked,endMark:tn.CU.PostListLoaded,labels:{fresh:e.toString()},canFail:!0}),n=(0,tn.uB)({name:tn.t$.TeamSwitch,startMark:tn.CU.TeamLinkClicked,endMark:tn.CU.PostListLoaded,labels:{fresh:e.toString()},canFail:!0});if((0,Ee.dW)()){if(t){const n=(0,Ee.kA)(tn.CU.ChannelLinkClicked,tn.CU.PostListLoaded);(0,Ee.sx)("performance",tn.t$.ChannelSwitch,{duration:Math.round(t.duration),fresh:e,requestCount:n})}if(n){const t=(0,Ee.kA)(tn.CU.TeamLinkClicked,tn.CU.PostListLoaded);(0,Ee.sx)("performance",tn.t$.TeamSwitch,{duration:Math.round(n.duration),fresh:e,requestCount:t})}}(0,Ee.MR)([tn.CU.ChannelLinkClicked,tn.CU.TeamLinkClicked,tn.CU.PostListLoaded])}class sn extends P().PureComponent{constructor(e){var t;super(e),t=this,nn(this,"postsOnLoad",(async e=>{const{focusedPostId:t,isFirstLoad:n,latestPostTimeStamp:a,isPrefetchingInProcess:s,actions:r}=this.props;t?await r.loadPostsAround(e,t):n?s||await r.loadUnreads(e):a?await r.syncPostsInChannel(e,a,!1):await r.loadLatestPosts(e),t||this.props.actions.markChannelAsRead(e),this.mounted&&this.setState({loadingOlderPosts:!1,loadingNewerPosts:!1})})),nn(this,"callLoadPosts",(async(e,t,n)=>{const{error:a}=await this.props.actions.loadPosts({channelId:e,postId:t,type:n});return n===z.DL.BEFORE_ID?this.setState({loadingOlderPosts:!1}):this.setState({loadingNewerPosts:!1}),a?this.autoRetriesCount<3?(this.autoRetriesCount++,await this.callLoadPosts(e,t,n)):this.mounted&&this.setState({autoRetryEnable:!1}):(this.mounted&&this.setState({autoRetryEnable:!0}),this.state.autoRetryEnable||(this.autoRetriesCount=0)),{error:a}})),nn(this,"getOldestVisiblePostId",(()=>(0,fe.J3)(this.props.postListIds||[]))),nn(this,"getLatestVisiblePostId",(()=>(0,fe.h7)(this.props.postListIds||[]))),nn(this,"canLoadMorePosts",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z.DL.BEFORE_ID;t.props.hasInaccessiblePosts||t.props.postListIds&&(t.state.loadingOlderPosts||t.state.loadingNewerPosts||(t.extraPagesLoaded>10?t.state.autoRetryEnable&&t.setState({autoRetryEnable:!1}):(t.props.atOldestPost||e!==z.DL.BEFORE_ID?t.props.atLatestPost||await t.getPostsAfter():await t.getPostsBefore(),t.extraPagesLoaded+=1)))})),nn(this,"getPostsBefore",(async()=>{if(this.state.loadingOlderPosts)return;this.state.autoRetryEnable||(this.extraPagesLoaded=0);const e=this.getOldestVisiblePostId();this.setState({loadingOlderPosts:!0}),await this.callLoadPosts(this.props.channelId,e,z.DL.BEFORE_ID)})),nn(this,"getPostsAfter",(async()=>{if(this.state.loadingNewerPosts)return;this.state.autoRetryEnable||(this.extraPagesLoaded=0);const e=this.getLatestVisiblePostId();this.setState({loadingNewerPosts:!0}),await this.callLoadPosts(this.props.channelId,e,z.DL.AFTER_ID)})),this.state={loadingNewerPosts:!1,loadingOlderPosts:!1,autoRetryEnable:!0},this.extraPagesLoaded=0,this.autoRetriesCount=0,this.actionsForPostList={loadOlderPosts:this.getPostsBefore,loadNewerPosts:this.getPostsAfter,canLoadMorePosts:this.canLoadMorePosts,changeUnreadChunkTimeStamp:e.changeUnreadChunkTimeStamp,toggleShouldStartFromBottomWhenUnread:e.toggleShouldStartFromBottomWhenUnread,updateNewMessagesAtInChannel:this.props.actions.updateNewMessagesAtInChannel}}componentDidMount(){this.mounted=!0,this.props.channelId&&(this.postsOnLoad(this.props.channelId),this.props.postListIds&&an())}componentDidUpdate(e){this.props.channelId!==e.channelId&&this.postsOnLoad(this.props.channelId),null!=this.props.postListIds&&null==e.postListIds&&an(!0)}componentWillUnmount(){this.mounted=!1}render(){return this.props.postListIds?P().createElement("div",{className:"post-list-holder-by-time",key:"postlist-"+this.props.channelId},P().createElement("div",{className:"post-list__table"},P().createElement("div",{id:"virtualizedPostListContent",className:"post-list__content"},P().createElement(en,{loadingNewerPosts:this.state.loadingNewerPosts,loadingOlderPosts:this.state.loadingOlderPosts,atOldestPost:this.props.atOldestPost,atLatestPost:this.props.atLatestPost,focusedPostId:this.props.focusedPostId,channelId:this.props.channelId,autoRetryEnable:this.state.autoRetryEnable,shouldStartFromBottomWhenUnread:this.props.shouldStartFromBottomWhenUnread,actions:this.actionsForPostList,postListIds:this.props.formattedPostIds,latestPostTimeStamp:this.props.latestPostTimeStamp,isMobileView:this.props.isMobileView,lastViewedAt:this.props.lastViewedAt})))):P().createElement(he.A,{centered:!0})}}nn(sn,"propTypes",{formattedPostIds:F().arrayOf(F().string),postListIds:F().arrayOf(F().string),channelId:F().string.isRequired,focusedPostId:F().string,atLatestPost:F().bool.isRequired,atOldestPost:F().bool,isFirstLoad:F().bool.isRequired,latestPostTimeStamp:F().number,changeUnreadChunkTimeStamp:F().func.isRequired,isPrefetchingInProcess:F().bool.isRequired,isMobileView:F().bool.isRequired,lastViewedAt:F().number.isRequired,toggleShouldStartFromBottomWhenUnread:F().func.isRequired,shouldStartFromBottomWhenUnread:F().bool.isRequired,hasInaccessiblePosts:F().bool.isRequired,actions:F().shape({loadPostsAround:F().func.isRequired,loadUnreads:F().func.isRequired,loadPosts:F().func.isRequired,syncPostsInChannel:F().func.isRequired,loadLatestPosts:F().func.isRequired,markChannelAsRead:F().func.isRequired,updateNewMessagesAtInChannel:F().any.isRequired}).isRequired});const rn=(e,t)=>!e.entities.posts.postsInChannel[t],on=(0,pe.el)((e=>(0,fe.h7)(e))),ln=(0,a.connect)((function(){const e=(0,me.A8)(),t=(0,ge.fG)();return function(n,a){let s,r,i,o=0,l=!1,c=!1;const{focusedPostId:d,unreadChunkTimeStamp:h,channelId:u,shouldStartFromBottomWhenUnread:m}=a,p=n.views.channel,g=p.lastChannelViewTime[u],f=p.channelPrefetchStatus[u]===ue.IZ.STARTED,E=(0,me.VT)(n),b=Boolean(E.channels[u])||0===E.channels[u],C=(0,me.f5)(n,d||"");r=d&&void 0!==C?e(n,d,u):h&&!m?(0,me.AB)(n,u,h):(0,me.Gn)(n,u),r&&(s=r.order,l=Boolean(r.recent),c=Boolean(r.oldest));let y=!1;if(null!=h&&(y=m&&!(0,me.dH)(n,r,h)),s&&(i=t(n,{postIds:s,lastViewedAt:g,indicateNewMessages:!y}),s.length)){const e=on(s);o=(0,me.f5)(n,e).create_at}return{lastViewedAt:g,isFirstLoad:rn(n,u),formattedPostIds:i,atLatestPost:l,atOldestPost:c,latestPostTimeStamp:o,postListIds:s,isPrefetchingInProcess:f,shouldStartFromBottomWhenUnread:m,isMobileView:(0,W.w3)(n),hasInaccessiblePosts:b}}}),(function(e){return{actions:(0,q.bindActionCreators)({loadUnreads:c.jw,loadPosts:c.i,loadLatestPosts:c.F8,loadPostsAround:c.zp,syncPostsInChannel:c.LD,markChannelAsRead:s.Zn,updateNewMessagesAtInChannel:Q.Lg},e)}}))(sn);function cn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class dn extends P().PureComponent{constructor(e){super(e),cn(this,"changeUnreadChunkTimeStamp",(e=>{this.setState({unreadChunkTimeStamp:e,loaderForChangeOfPostsChunk:!0},(()=>{window.requestAnimationFrame((()=>{this.setState({loaderForChangeOfPostsChunk:!1})}))}))})),cn(this,"toggleShouldStartFromBottomWhenUnread",(()=>{this.setState((e=>({loaderForChangeOfPostsChunk:!0,shouldStartFromBottomWhenUnread:!e.shouldStartFromBottomWhenUnread})),(()=>{window.requestAnimationFrame((()=>{this.setState({loaderForChangeOfPostsChunk:!1})}))}))}));const t=this.props.unreadScrollPosition===z.pm.UNREAD_SCROLL_POSITION_START_FROM_NEWEST;this.state={unreadChunkTimeStamp:e.lastViewedAt,shouldStartFromBottomWhenUnread:t,loaderForChangeOfPostsChunk:!1,channelLoading:e.channelLoading}}static getDerivedStateFromProps(e,t){return null===t.unreadChunkTimeStamp&&e.lastViewedAt?{unreadChunkTimeStamp:e.lastViewedAt}:e.channelLoading!==t.channelLoading?{unreadChunkTimeStamp:e.lastViewedAt,channelLoading:e.channelLoading}:null}render(){return this.props.channelLoading||this.state.loaderForChangeOfPostsChunk?P().createElement("div",{id:"post-list"},P().createElement(he.A,{centered:!0})):P().createElement("div",{id:"post-list",role:"main"},P().createElement(ln,{unreadChunkTimeStamp:this.state.unreadChunkTimeStamp,channelId:this.props.channelId,changeUnreadChunkTimeStamp:this.changeUnreadChunkTimeStamp,shouldStartFromBottomWhenUnread:this.state.shouldStartFromBottomWhenUnread,toggleShouldStartFromBottomWhenUnread:this.toggleShouldStartFromBottomWhenUnread,focusedPostId:this.props.focusedPostId}))}}cn(dn,"propTypes",{lastViewedAt:F().number,channelLoading:F().bool.isRequired,channelId:F().string.isRequired,focusedPostId:F().string,unreadScrollPosition:F().string.isRequired});const hn=(0,O.withRouter)((0,a.connect)((function(){return function(e,t){var n;const a=null===(n=t.match)||void 0===n?void 0:n.params,s=(0,o.Uj)(e,(null==a?void 0:a.team)||"");let i;const c=(0,r.c)(e,t.channelId);let d=e.views.channel.lastChannelViewTime[t.channelId];c&&(c.type===z.YM.DM_CHANNEL&&c.teammate_id&&(i=(0,l.wz)(e,c.teammate_id)),d=c.last_post_at?d:c.last_post_at);const h=((e,t,n,a,s)=>{var r;if(e.postid)return!1;const i=null===(r=e.identifier)||void 0===r?void 0:r.toLowerCase();if(t&&n){if(t.type!==z.YM.DM_CHANNEL&&t.name!==i)return!0;if(t.type===z.YM.DM_CHANNEL&&a&&i!=="@".concat(a.username))return!0;const e=n.id;return!!(t.team_id&&t.team_id!==e||s&&!s[e])}return!0})(a,c,s,i,(0,o.bO)(e));return{unreadScrollPosition:(0,E.z0)(e),lastViewedAt:d,channelLoading:h}}}))(dn));var un=n(7344);const mn=()=>{location.reload()},pn=e=>{let{updateWaitForLoader:t}=e;const[n,a]=(0,R.useState)(!1);return(0,R.useEffect)((()=>{let e=setTimeout((()=>{a(!0),t(!0),e=setTimeout((()=>{t(!1)}),2e3)}),5e3);return()=>{clearTimeout(e),t(!1)}}),[]),P().createElement("div",{className:"AdvancedTextEditor__skeleton"},n&&P().createElement(P().Fragment,null,P().createElement(le.FormattedMessage,{id:"center_panel.input.cannot_load_component",defaultMessage:"Something went wrong while loading the component. Please wait a moment, or try reloading the app."}),P().createElement("button",{className:"btn btn-tertiary channel-archived__close-btn",onClick:mn},P().createElement(le.FormattedMessage,{id:"center_panel.reloadPage",defaultMessage:"Reload"}))))};pn.propTypes={updateWaitForLoader:F().func.isRequired};const gn=pn;function fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function En(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(n),!0).forEach((function(t){bn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Cn=(0,D.S)("ChannelHeader",(0,R.lazy)((()=>Promise.all([n.e(1852),n.e(6532),n.e(4446),n.e(6799),n.e(3836)]).then(n.bind(n,52886))))),yn=(0,D.S)("FileUploadOverlay",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,77143))))),vn=(0,D.S)("ChannelBookmarks",(0,R.lazy)((()=>Promise.all([n.e(4446),n.e(1119)]).then(n.bind(n,39403))))),_n=(0,D.S)("AdvancedCreatePost",(0,R.lazy)((()=>n.e(3797).then(n.bind(n,73797)))));class Mn extends P().PureComponent{static getDerivedStateFromProps(e,t){let n={};const a=e.match.params.postid;return e.match.url!==t.url&&e.channelId!==t.channelId&&(n={deferredPostView:Mn.createDeferredPostView(),url:e.match.url,focusedPostId:a}),e.channelId!==t.channelId&&(n=En(En({},n),{},{channelId:e.channelId,focusedPostId:a})),a&&a!==t.focusedPostId&&(n=En(En({},n),{},{focusedPostId:a})),Object.keys(n).length?n:null}constructor(e){super(e),bn(this,"onClickCloseChannel",(()=>{this.props.goToLastViewedChannel()})),bn(this,"onUpdateInputShowLoader",(e=>{this.setState({waitForLoader:e})})),this.state={url:e.match.url,channelId:e.channelId,focusedPostId:e.match.params.postid,deferredPostView:Mn.createDeferredPostView(),waitForLoader:!1},this.channelViewRef=P().createRef()}componentDidUpdate(e){e.channelId!==this.props.channelId&&this.props.enableWebSocketEventScope&&un.A.updateActiveChannel(this.props.channelId),e.channelId===this.props.channelId&&e.channelIsArchived===this.props.channelIsArchived||this.props.channelIsArchived&&!this.props.viewArchivedChannels&&this.props.goToLastViewedChannel()}render(){let e;e=this.props.deactivatedChannel?P().createElement("div",{className:"post-create__container AdvancedTextEditor__ctr",id:"post-create"},P().createElement("div",{className:"channel-archived__message"},P().createElement(le.FormattedMessage,{id:"channelView.archivedChannelWithDeactivatedUser",defaultMessage:"You are viewing an archived channel with a <b>deactivated user</b>. New messages cannot be posted.",values:{b:e=>P().createElement("b",null,e)}}),P().createElement("button",{className:"btn btn-primary channel-archived__close-btn",onClick:this.onClickCloseChannel},P().createElement(le.FormattedMessage,{id:"center_panel.archived.closeChannel",defaultMessage:"Close Channel"})))):this.props.channelIsArchived?P().createElement("div",{className:"post-create__container",id:"post-create"},P().createElement("div",{id:"channelArchivedMessage",className:"channel-archived__message"},P().createElement(le.FormattedMessage,{id:"channelView.archivedChannel",defaultMessage:"You are viewing an <b>archived channel</b>. New messages cannot be posted.",values:{b:e=>P().createElement("b",null,e)}}),P().createElement("button",{className:"btn btn-primary channel-archived__close-btn",onClick:this.onClickCloseChannel},P().createElement(le.FormattedMessage,{id:"center_panel.archived.closeChannel",defaultMessage:"Close Channel"})))):this.props.missingChannelRole||this.state.waitForLoader?P().createElement(gn,{updateWaitForLoader:this.onUpdateInputShowLoader}):P().createElement("div",{id:"post-create","data-testid":"post-create",className:"post-create__container AdvancedTextEditor__ctr"},P().createElement(_n,null));const t=this.state.deferredPostView;return P().createElement("div",{ref:this.channelViewRef,id:"app-content",className:"app__content"},P().createElement(yn,{overlayType:"center",id:de.nY}),P().createElement(Cn,this.props),this.props.isChannelBookmarksEnabled&&P().createElement(vn,{channelId:this.props.channelId}),P().createElement(t,{channelId:this.props.channelId,focusedPostId:this.state.focusedPostId}),e)}}bn(Mn,"createDeferredPostView",(()=>(0,ce.A)(hn,P().createElement("div",{id:"post-list",className:"a11y__region","data-a11y-sort-order":"1","data-a11y-focus-child":!0,"data-a11y-order-reversed":!0}))));const wn={goToLastViewedChannel:c.TJ},Sn=(0,a.connect)((function(e){const t=(0,r.Lw)(e),n=(0,i.zj)(e),a="true"===n.ExperimentalViewArchivedChannels,s="true"===n.EnableOnboardingFlow,c="true"===n.FeatureFlagWebSocketEventScope,d=function(e,t){var n;return!(t&&(null===(n=(0,r.M9)(e,t.id))||void 0===n?void 0:n.roles)||"").split(" ").some((t=>Boolean((0,ie.O0)(e)[t])))}(e,t);return{channelId:t?t.id:"",deactivatedChannel:!!t&&(0,r.nO)(e,t.id),enableOnboardingFlow:s,channelIsArchived:!!t&&0!==t.delete_at,viewArchivedChannels:a,isCloud:"true"===(0,i.Ay)(e).Cloud,teamUrl:(0,o._p)(e),isFirstAdmin:(0,l.OK)(e),enableWebSocketEventScope:c,isChannelBookmarksEnabled:(0,oe.wR)(e),missingChannelRole:d}}),wn),Tn=(0,O.withRouter)(Sn(Mn));function An(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class In extends P().PureComponent{constructor(e){super(e),An(this,"replaceUrlIfPermalink",(()=>{this.props.match.params.postid&&(this.replaceUrlTimeout=setTimeout((()=>{const e=this.props.match.url.split("/").slice(0,-1).join("/");(0,Ft.J)().replace(e)}),z.Ay.PERMALINK_FADEOUT))})),this.state={prevProps:e}}componentDidUpdate(e){this.props.match.params.team===e.match.params.team&&this.props.match.params.identifier===e.match.params.identifier||(clearTimeout(this.replaceUrlTimeout),this.props.actions.onChannelByIdentifierEnter(this.props),this.replaceUrlIfPermalink())}componentDidMount(){this.props.actions.onChannelByIdentifierEnter(this.props),this.replaceUrlIfPermalink()}componentWillUnmount(){clearTimeout(this.replaceUrlTimeout)}render(){return P().createElement(Tn,null)}}An(In,"propTypes",{match:F().shape({params:F().shape({identifier:F().string.isRequired,team:F().string.isRequired,postid:F().string,path:F().string.isRequired}).isRequired,url:F().string.isRequired}).isRequired,actions:F().shape({onChannelByIdentifierEnter:F().func.isRequired}).isRequired,history:F().any.isRequired});const Nn=(0,O.withRouter)((0,a.connect)(null,(function(e){return{actions:(0,q.bindActionCreators)({onChannelByIdentifierEnter:ee},e)}}))(In));var Ln=n(82739);const Rn=(0,D.S)("ChannelHeaderMobile",(0,R.lazy)((()=>Promise.all([n.e(6532),n.e(4446),n.e(6799),n.e(8697)]).then(n.bind(n,2283))))),Pn=(0,D.S)("GlobalThreads",(0,R.lazy)((()=>n.e(678).then(n.bind(n,20678)))),P().createElement("div",{className:"app__content"},P().createElement(he.A,null))),On=(0,D.S)("Drafts",(0,R.lazy)((()=>n.e(7003).then(n.bind(n,57003)))),P().createElement("div",{className:"app__content"},P().createElement(he.A,null))),kn=(0,D.S)("PermalinkView",(0,R.lazy)((()=>n.e(1300).then(n.bind(n,21300))))),Dn=(0,D.S)("PlaybookRunner",(0,R.lazy)((()=>n.e(7422).then(n.bind(n,87422)))));class xn extends P().PureComponent{constructor(e){super(e),this.state={returnTo:"",lastReturnTo:""}}static getDerivedStateFromProps(e,t){return t.lastReturnTo!==e.location.pathname&&e.location.pathname.includes("/pl/")?{lastReturnTo:e.location.pathname,returnTo:t.lastReturnTo}:{lastReturnTo:e.location.pathname}}async componentDidMount(){const{actions:e}=this.props;await e.getProfiles()}render(){const{lastChannelPath:e,isCollapsedThreadsEnabled:t,isMobileView:n}=this.props,a=this.props.match.url;return P().createElement("div",{key:"inner-wrap",className:U()("inner-wrap","channel__wrap",{"move--right":this.props.lhsOpen,"move--left":this.props.rhsOpen,"move--left-small":this.props.rhsMenuOpen})},n&&P().createElement(P().Fragment,null,P().createElement("div",{className:"row header"},P().createElement("div",{id:"navbar_wrapper"},P().createElement(Rn,null)))),P().createElement("div",{className:"row main"},P().createElement(O.Switch,null,P().createElement(O.Route,{path:"".concat(a,"/pl/:postid(").concat(Ln.Zv,")"),render:e=>P().createElement(kn,Object.assign({},e,{returnTo:this.state.returnTo}))}),P().createElement(O.Route,{path:"/:team(".concat(Ln.LD,")/:path(channels|messages)/:identifier(").concat(Ln.x,")/:postid(").concat(Ln.Zv,")?"),component:Nn}),P().createElement(O.Route,{path:"/:team(".concat(Ln.LD,")/_playbooks/:playbookId(").concat(Ln.Zv,")/run")},P().createElement(Dn,null)),t?P().createElement(O.Route,{path:"/:team(".concat(Ln.LD,")/threads/:threadIdentifier(").concat(Ln.Zv,")?"),component:Pn}):null,P().createElement(O.Route,{path:"/:team(".concat(Ln.LD,")/drafts"),component:On}),P().createElement(O.Route,{path:"/:team(".concat(Ln.LD,")/").concat(z.pj),component:On}),P().createElement(O.Redirect,{to:e}))))}}const Fn=(0,a.connect)(((e,t)=>{const n=(0,G.Gw)(e,t.match.params.team);let a=(0,G.y1)(e,t.match.params.team);const s=(0,G.Kf)(e),i=(0,o.Uj)(e,t.match.params.team);let c,h;return s!==(null==i?void 0:i.id)&&(c=(0,G.Jl)(e)),a||(a=(0,r.Dn)(e,i.id)),h=!(0,E.WW)(e)||c!==z.po.THREADS&&n!==z.po.THREADS?"".concat(t.match.url,"/channels/").concat(a):"".concat(t.match.url,"/threads"),{lastChannelPath:h,lhsOpen:(0,V.Cu)(e),rhsOpen:(0,d.A)(e),rhsMenuOpen:(0,d.ZE)(e),isCollapsedThreadsEnabled:(0,E.WW)(e),currentUserId:(0,l.WR)(e),isMobileView:(0,W.w3)(e)}}),(function(e){return{actions:(0,q.bindActionCreators)({getProfiles:j.r7},e)}})),Hn=(0,O.withRouter)(Fn(xn));n(36169),n(30973);var Un=n(79751);const Bn=function(){const e=(0,O.useLocation)(),t=(0,a.useDispatch)(),n=(0,O.useHistory)(),s={open_invitation_modal:{modalId:z.IQ.INVITATION,dialogType:$e.default}};return(0,R.useEffect)((()=>{const a=new URLSearchParams(e.search),r=a.get("action");r&&s[r]&&(t((0,Un.q)(s[r])),a.delete("action"),n.replace({search:a.toString()}))}),[e,s]),null};var qn=n(4629),jn=n(16983),Vn=n(80635),Gn=n(52073),Wn=n(2386),zn=n(9916),Kn=n(98496);function Jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Yn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jn(Object(n),!0).forEach((function(t){Qn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Zn=!0;function Xn(e){return(t,n)=>{var a,s,i;const o=n(),l=(0,r.L9)(o);(0,Ee.sx)("performance","preloaded_channels",{numHigh:(null===(a=e[1])||void 0===a?void 0:a.length)||0,numMedium:(null===(s=e[2])||void 0===s?void 0:s.length)||0,numLow:(null===(i=e[3])||void 0===i?void 0:i.length)||0,numTotal:l.length,isFirstPreload:Zn}),Zn=!1}}var $n=function(e){return e[e.high=1]="high",e[e.medium=2]="medium",e[e.low=3]="low",e}($n||{}),ea=function(e){return e[e.mentionMax=10]="mentionMax",e[e.unreadMax=20]="unreadMax",e}(ea||{});const ta=(0,pe.el)(((e,t,n)=>{const a=e.length;let s={[$n.high]:[],[$n.medium]:[],[$n.low]:[]};if(!a||a>ea.unreadMax)return s;for(const r of e){const e=r.id,i=t[e];if(a>=ea.mentionMax&&s[$n.high].length>=ea.mentionMax)break;i&&!(0,De.X4)(i)&&((n?i.mention_count_root:i.mention_count)?s=Yn(Yn({},s),{},{[$n.high]:[...s[$n.high],e]}):i.notify_props&&"mention"!==i.notify_props.mark_unread&&a<ea.mentionMax&&(s=Yn(Yn({},s),{},{[$n.medium]:[...s[$n.medium],e]})))}return s}));var na=n(79030),aa=n(65357);function sa(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ra=new na.A({concurrency:2});class ia extends P().PureComponent{constructor(){super(...arguments),sa(this,"prefetchPosts",(e=>{let t;const n=this.props.unreadChannels.find((t=>e===t.id));return!n||n.type!==z.YM.PRIVATE_CHANNEL&&n.type!==z.YM.OPEN_CHANNEL||Date.now()-n.last_post_at<=1e3&&(t=1e3*Math.random()),this.props.actions.prefetchChannelPosts(e,t)})),sa(this,"prefetchData",(()=>{const{prefetchRequestStatus:e,prefetchQueueObj:t}=this.props;for(const n in t){if(!Object.hasOwn(t,n))continue;const a=t[n];for(const t of a)Object.hasOwn(e,t)||ra.add((async()=>this.prefetchPosts(t)))}}))}async componentDidUpdate(e){const{currentChannelId:t,prefetchQueueObj:n,sidebarLoaded:a}=this.props;a&&!e.sidebarLoaded&&(0,aa.mp)(),!t||!a||e.currentChannelId&&e.sidebarLoaded?e.prefetchQueueObj!==n&&(clearTimeout(this.prefetchTimeout),await ra.clear(),this.prefetchData()):(ra.add((async()=>this.prefetchPosts(t))),this.prefetchData()),!t||!a||e.currentChannelId&&e.sidebarLoaded||this.props.actions.trackPreloadedChannels(n)}render(){return null}}function oa(e){return(0,zn.WJ)(e).length>0}sa(ia,"propTypes",{currentChannelId:F().string.isRequired,prefetchQueueObj:F().objectOf(F().arrayOf(F().string)).isRequired,prefetchRequestStatus:F().objectOf(F().string).isRequired,sidebarLoaded:F().bool.isRequired,unreadChannels:F().array.isRequired,actions:F().shape({prefetchChannelPosts:F().func.isRequired,trackPreloadedChannels:F().func.isRequired}).isRequired});const la=(0,a.connect)((function(e){const t=e.views.channel.lastUnreadChannel,n=(0,f.vd)(e),a=(0,r.OM)(e,t),s=ta(a,n,(0,E.WW)(e)),i=e.views.channel.channelPrefetchStatus;return{currentChannelId:(0,r.eH)(e),prefetchQueueObj:s,prefetchRequestStatus:i,sidebarLoaded:oa(e),unreadChannels:a}}),(function(e){return{actions:(0,q.bindActionCreators)({prefetchChannelPosts:c.At,trackPreloadedChannels:Xn},e)}}))(ia);var ca=n(71769),da=n(7021);function ha(e){let{children:t,id:n,className:a}=e;const s=(0,R.useRef)(null);return P().createElement("div",{id:n,className:a,ref:s},t,P().createElement(da.A,{name:"lhsResizeHandle",globalCssVar:ca.Oq.LHS,defaultWidth:ca.LA,dir:ca.Cr.LEFT,containerRef:s}))}ha.propTypes={children:F().node.isRequired};const ua=ha;var ma=n(33919),pa=n(24028);function ga(e){return e.views.addChannelDropdown.isOpen}function fa(e){return e.views.addChannelCtaDropdown.isOpen}var Ea=n(30135),ba=n(65664),Ca=n(71409),ya=n(64766),va=n(17153),_a=n(99068),Ma=n(87131);const wa=e=>{let{canCreateChannel:t,canJoinPublicChannel:n,showMoreChannelsModal:a,showCreateUserGroupModal:s,invitePeopleModal:r,showNewChannelModal:i,showCreateCategoryModal:o,handleOpenDirectMessagesModal:l,unreadFilterEnabled:c,showCreateTutorialTip:d,showInviteTutorialTip:h,isAddChannelOpen:u,openAddChannelOpen:m,canCreateCustomGroups:p}=e;const g=(0,le.useIntl)();return t||n?P().createElement(_a.A,{className:"AddChannelDropdown",onToggle:e=>{m(e),e&&(0,Ee.sx)("ui","ui_add_channel_dropdown_opened")},open:u},P().createElement(Ma.A,{title:g.formatMessage({id:"sidebar_left.add_channel_dropdown.browseOrCreateChannels",defaultMessage:"Browse or create channels"})},P().createElement("button",{className:"AddChannelDropdown_dropdownButton","aria-label":g.formatMessage({id:"sidebar_left.add_channel_dropdown.dropdownAriaLabel",defaultMessage:"Add Channel Dropdown"})},P().createElement("i",{className:"icon-plus"}))),P().createElement(va.A,{id:"AddChannelDropdown",ariaLabel:g.formatMessage({id:"sidebar_left.add_channel_dropdown.dropdownAriaLabel",defaultMessage:"Add Channel Dropdown"})},(()=>{const e=P().createElement(va.A.Group,null,P().createElement(va.A.ItemAction,{id:"invitePeople",onClick:r,icon:P().createElement("i",{className:"icon-account-plus-outline"}),text:g.formatMessage({id:"sidebar_left.add_channel_dropdown.invitePeople",defaultMessage:"Invite people"}),extraText:g.formatMessage({id:"sidebar_left.add_channel_dropdown.invitePeopleExtraText",defaultMessage:"Add people to the team"})}),h&&P().createElement(ya.d8,null));let u,m,f;n&&(u=P().createElement(va.A.ItemAction,{id:"showMoreChannels",onClick:a,icon:P().createElement("i",{className:"icon-globe"}),text:g.formatMessage({id:"sidebar_left.add_channel_dropdown.browseChannels",defaultMessage:"Browse channels"})})),t&&(m=P().createElement(va.A.ItemAction,{id:"showNewChannel",onClick:i,icon:P().createElement("i",{className:"icon-plus"}),text:g.formatMessage({id:"sidebar_left.add_channel_dropdown.createNewChannel",defaultMessage:"Create new channel"})})),c||(f=P().createElement(va.A.Group,null,P().createElement(va.A.ItemAction,{id:"createCategory",onClick:o,icon:P().createElement("i",{className:"icon-folder-plus-outline"}),text:g.formatMessage({id:"sidebar_left.add_channel_dropdown.createCategory",defaultMessage:"Create new category"})})));const E=P().createElement(va.A.ItemAction,{id:"openDirectMessageMenuItem",onClick:l,icon:P().createElement("i",{className:"icon-account-outline"}),text:g.formatMessage({id:"sidebar.openDirectMessage",defaultMessage:"Open a direct message"})});let b;return p&&(b=P().createElement(va.A.ItemAction,{id:"createUserGroup",onClick:s,icon:P().createElement("i",{className:"icon-account-multiple-plus-outline"}),text:g.formatMessage({id:"sidebar.createUserGroup",defaultMessage:"Create New User Group"})})),P().createElement(P().Fragment,null,P().createElement(va.A.Group,null,m,u,E,d&&P().createElement(ya.GI,null),b),f,e)})())):null};wa.propTypes={canCreateChannel:F().bool.isRequired,canJoinPublicChannel:F().bool.isRequired,userGroupsEnabled:F().bool.isRequired,showMoreChannelsModal:F().func.isRequired,showCreateUserGroupModal:F().func.isRequired,invitePeopleModal:F().func.isRequired,showNewChannelModal:F().func.isRequired,showCreateCategoryModal:F().func.isRequired,handleOpenDirectMessagesModal:F().func.isRequired,unreadFilterEnabled:F().bool.isRequired,showCreateTutorialTip:F().bool.isRequired,showInviteTutorialTip:F().bool.isRequired,isAddChannelOpen:F().bool.isRequired,openAddChannelOpen:F().func.isRequired,canCreateCustomGroups:F().bool.isRequired};const Sa=wa;var Ta=n(99243);const Aa=I()(ma.A).attrs((()=>({element:"header",row:!0,justify:"space-between",alignment:"center"}))).withConfig({displayName:"SidebarHeaderContainer"})(["height:55px;padding:0 16px;gap:8px;.dropdown-menu{position:absolute;transform:translate(0,0);margin-left:0;min-width:210px;}#SidebarContainer & .AddChannelDropdown_dropdownButton{border-radius:16px;font-size:18px;}"]),Ia=e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)((e=>(0,o.H7)(e))),s=(0,ya.E7)(Ta.NI.CREATE_AND_JOIN_CHANNELS),r=(0,ya.E7)(Ta.NI.INVITE_PEOPLE),i=(0,Ea.A)(),l=(0,a.useSelector)(ga),c=(0,a.useSelector)(E.O4),d=(0,R.useCallback)((e=>{t((0,pa.E)(e))}),[]),[h,u]=(0,R.useState)(!1);return n?P().createElement(ba.default,{theme:c},P().createElement(Aa,{id:"sidebar-header-container"},P().createElement(_a.A,{onToggle:()=>{u(!h)},className:"SidebarHeaderMenuWrapper test-team-header"},P().createElement(Ma.A,{title:n.description?n.description:n.display_name},P().createElement("h1",{className:"sidebarHeader"},P().createElement("button",{className:"style--none sidebar-header"},P().createElement("span",{className:"title"},n.display_name),P().createElement("i",{className:"icon icon-chevron-down"})))),P().createElement(Ca.A,{id:"sidebarDropdownMenu",usageDeltaTeams:i.teams.active})),P().createElement(Sa,{showNewChannelModal:e.showNewChannelModal,showMoreChannelsModal:e.showMoreChannelsModal,invitePeopleModal:e.invitePeopleModal,showCreateCategoryModal:e.showCreateCategoryModal,canCreateChannel:e.canCreateChannel,canJoinPublicChannel:e.canJoinPublicChannel,handleOpenDirectMessagesModal:e.handleOpenDirectMessagesModal,unreadFilterEnabled:e.unreadFilterEnabled,showCreateTutorialTip:s,showInviteTutorialTip:r,isAddChannelOpen:l,openAddChannelOpen:d,canCreateCustomGroups:e.canCreateCustomGroups,showCreateUserGroupModal:e.showCreateUserGroupModal,userGroupsEnabled:e.userGroupsEnabled}))):null};Ia.propTypes={showNewChannelModal:F().func.isRequired,showMoreChannelsModal:F().func.isRequired,showCreateUserGroupModal:F().func.isRequired,invitePeopleModal:F().func.isRequired,showCreateCategoryModal:F().func.isRequired,canCreateChannel:F().bool.isRequired,canJoinPublicChannel:F().bool.isRequired,handleOpenDirectMessagesModal:F().func.isRequired,unreadFilterEnabled:F().bool.isRequired,userGroupsEnabled:F().bool.isRequired,canCreateCustomGroups:F().bool.isRequired};const Na=Ia;var La=n(34529),Ra=n(70659),Pa=n(92243),Oa=n(32269),ka=n(4565),Da=n(26562),xa=n(4715);function Fa(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ha="channel";class Ua extends P().PureComponent{constructor(e){super(e),Fa(this,"focusTextbox",(()=>{if(null===this.switchBox)return;const e=this.switchBox.getTextbox();document.activeElement!==e&&(e.focus(),X.PO(e))})),Fa(this,"setSwitchBoxRef",(e=>{this.switchBox=e,this.focusTextbox()})),Fa(this,"hideOnSelect",(()=>{this.focusPostTextbox(),this.setState({text:""}),this.props.onExited()})),Fa(this,"focusPostTextbox",(()=>{xa.Fr()||setTimeout((()=>{const e=document.querySelector("#post_textbox");e&&e.focus()}))})),Fa(this,"hideOnCancel",(()=>{var e,t;null===(e=(t=this.props).onExited)||void 0===e||e.call(t),setTimeout((()=>{const e=document.querySelector(".SidebarChannelNavigator_jumpToButton");e&&e.focus()}))})),Fa(this,"onChange",(e=>{this.setState({text:e.target.value,shouldShowLoadingSpinner:!0})})),Fa(this,"handleSubmit",(async e=>{if(e)if(this.props.rhsOpen&&this.props.rhsState===z._n.EDIT_HISTORY&&this.props.actions.closeRightHandSide(),this.state.mode===Ha){const{joinChannelById:t,switchToChannel:n}=this.props.actions,a=e.channel;e.type===z.Ay.MENTION_MORE_CHANNELS&&a.type===z.Ay.OPEN_CHANNEL&&await t(a.id),n(a).then((e=>{"data"in e&&this.hideOnSelect()}))}else(0,Ft.J)().push("/"+e.name),this.hideOnSelect()})),Fa(this,"handleSuggestionsReceived",(e=>{const t=e.items.some((e=>e.loading));this.setState({shouldShowLoadingSpinner:t,pretext:e.matchedPretext,hasSuggestions:e.items.length>0})})),Fa(this,"render",(()=>{const e=this.channelProviders,t=P().createElement("h1",{id:"quickSwitchHeader"},P().createElement(le.FormattedMessage,{id:"quick_switch_modal.switchChannels",defaultMessage:"Find Channels"}));let n;return n=this.props.isMobileView?P().createElement(le.FormattedMessage,{id:"quick_switch_modal.help_mobile",defaultMessage:"Type to find a channel."}):P().createElement(le.FormattedMessage,{id:"quickSwitchModal.help_no_team",defaultMessage:"Type to find a channel. Use <b>UP/DOWN</b> to browse, <b>ENTER</b> to select, <b>ESC</b> to dismiss.",values:{b:e=>P().createElement("b",null,e)}}),P().createElement(La.Modal,{dialogClassName:"a11y__modal channel-switcher",show:!0,onHide:this.hideOnCancel,enforceFocus:!1,restoreFocus:!1,role:"none","aria-labelledby":"quickSwitchHeader","aria-describedby":"quickSwitchHeaderWithHint",animation:!1},P().createElement(La.Modal.Header,{className:"modal-header",id:"quickSwitchModalLabel",closeButton:!0},P().createElement("div",{className:"channel-switcher__header",id:"quickSwitchHeaderWithHint"},t,P().createElement("div",{className:"channel-switcher__hint",id:"quickSwitchHint"},n))),P().createElement(La.Modal.Body,null,P().createElement("div",{className:"channel-switcher__suggestion-box"},P().createElement("i",{className:"icon icon-magnify icon-16"}),P().createElement(Oa.A,{ref:this.setSwitchBoxRef,id:"quickSwitchInput","aria-label":X.Vw({id:"quick_switch_modal.input",defaultMessage:"quick switch input"}),className:"form-control focused",onChange:this.onChange,value:this.state.text,onItemSelected:this.handleSubmit,listComponent:ka.A,listPosition:"bottom",maxLength:"64",providers:e,completeOnTab:!1,spellCheck:"false",delayInputUpdate:!0,openWhenEmpty:!0,onSuggestionsReceived:this.handleSuggestionsReceived,forceSuggestionsWhenBlur:!0,renderDividers:[z.Ay.MENTION_UNREAD,z.Ay.MENTION_RECENT_CHANNELS],shouldSearchCompleteText:!0}),!this.state.shouldShowLoadingSpinner&&!this.state.hasSuggestions&&this.state.text&&P().createElement(Ra.A,{variant:Pa.L.Search,titleValues:{channelName:"".concat(this.state.pretext)}}))))})),this.channelProviders=[new Da.A],this.switchBox=null,this.state={text:"",mode:Ha,hasSuggestions:!0,shouldShowLoadingSpinner:!0,pretext:""}}}Fa(Ua,"propTypes",{onExited:F().func.isRequired,isMobileView:F().bool.isRequired,rhsOpen:F().bool,actions:F().shape({joinChannelById:F().func.isRequired,switchToChannel:F().func.isRequired,closeRightHandSide:F().func.isRequired}).isRequired});const Ba=(0,a.connect)((function(e){return{isMobileView:(0,W.w3)(e),rhsState:(0,d.bM)(e),rhsOpen:(0,d.A)(e)}}),(function(e){return{actions:(0,q.bindActionCreators)({joinChannelById:c.yO,switchToChannel:c.BX,closeRightHandSide:Wn.bP},e)}}))(Ua);var qa=n(61190);function ja(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Va=(0,le.defineMessages)({disableTooltip:{id:"sidebar_left.channel_filter.showAllChannels",defaultMessage:"Show all channels"},enableTooltip:{id:"sidebar_left.channel_filter.filterByUnread",defaultMessage:"Filter by unread"}}),Ga={default:[qa.f.ctrl,qa.f.shift,"U"],mac:[qa.f.cmd,qa.f.shift,"U"]};class Wa extends P().PureComponent{constructor(){super(...arguments),ja(this,"handleUnreadFilterClick",(e=>{null==e||e.preventDefault(),null==e||e.stopPropagation(),this.toggleUnreadFilter()})),ja(this,"handleUnreadFilterKeyPress",(e=>{Ut.r(e)&&e.shiftKey&&Ut.e(e,z.Ay.KeyCodes.U)&&(e.preventDefault(),e.stopPropagation(),this.toggleUnreadFilter())})),ja(this,"toggleUnreadFilter",(()=>{const{unreadFilterEnabled:e}=this.props;e?(0,Ee.sx)("ui","ui_sidebar_unread_filter_disabled"):(0,Ee.sx)("ui","ui_sidebar_unread_filter_enabled"),this.props.actions.setUnreadFilterEnabled(!e)}))}componentDidMount(){document.addEventListener("keydown",this.handleUnreadFilterKeyPress)}componentWillUnmount(){document.removeEventListener("keydown",this.handleUnreadFilterKeyPress)}render(){const{intl:e,unreadFilterEnabled:t}=this.props,n=e.formatMessage({id:"sidebar_left.channel_filter.filterUnreadAria",defaultMessage:"unreads filter"});return P().createElement("div",{className:"SidebarFilters"},P().createElement(Ma.A,{title:t?Va.disableTooltip:Va.enableTooltip,shortcut:Ga},P().createElement("a",{href:"#",className:U()("SidebarFilters_filterButton",{active:t}),onClick:this.toggleUnreadFilter,"aria-label":n},P().createElement("i",{className:"icon icon-filter-variant"}))))}}ja(Wa,"propTypes",{unreadFilterEnabled:F().bool.isRequired,actions:F().shape({setUnreadFilterEnabled:F().func.isRequired}).isRequired});const za=(0,le.injectIntl)(Wa),Ka=(0,a.connect)((function(e){const t=(0,o.vt)(e);return{hasMultipleTeams:t&&t.length>1,unreadFilterEnabled:(0,zn.ZM)(e)}}),(function(e){return{actions:(0,q.bindActionCreators)({setUnreadFilterEnabled:Gn.zk},e)}}))(za);function Ja(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ya extends P().PureComponent{constructor(){super(...arguments),Ja(this,"openQuickSwitcher",(e=>{e.preventDefault(),(0,Ee.sx)("ui","ui_sidebar_open_channel_switcher_v2"),this.props.actions.openModal({modalId:z.IQ.QUICK_SWITCH,dialogType:Ba})})),Ja(this,"handleShortcut",(e=>{const{actions:{closeModal:t}}=this.props;Ut.r(e)&&e.shiftKey&&(Ut.e(e,z.Ay.KeyCodes.M)&&(e.preventDefault(),t(z.IQ.QUICK_SWITCH)),Ut.e(e,z.Ay.KeyCodes.L)&&t(z.IQ.QUICK_SWITCH))})),Ja(this,"handleQuickSwitchKeyPress",(e=>{Ut.r(e)&&!e.shiftKey&&Ut.e(e,z.Ay.KeyCodes.K)&&(e.altKey||X.Xz(e)||(e.preventDefault(),this.toggleQuickSwitchModal()))})),Ja(this,"toggleQuickSwitchModal",(()=>{const{isQuickSwitcherOpen:e,actions:{openModal:t,closeModal:n}}=this.props;e?n(z.IQ.QUICK_SWITCH):t({modalId:z.IQ.QUICK_SWITCH,dialogType:Ba})}))}componentDidMount(){document.addEventListener("keydown",this.handleShortcut),document.addEventListener("keydown",this.handleQuickSwitchKeyPress)}componentWillUnmount(){document.removeEventListener("keydown",this.handleShortcut),document.removeEventListener("keydown",this.handleQuickSwitchKeyPress)}render(){return P().createElement("div",{className:"SidebarChannelNavigator webapp"},!this.props.showUnreadsCategory&&P().createElement(Ka,null),P().createElement("button",{className:"SidebarChannelNavigator_jumpToButton",onClick:this.openQuickSwitcher,"aria-label":X.Vw({id:"sidebar_left.channel_navigator.channelSwitcherLabel",defaultMessage:"Channel Switcher"}),"aria-haspopup":"dialog","data-testid":"SidebarChannelNavigatorButton"},P().createElement("i",{className:"icon icon-magnify"}),P().createElement(le.FormattedMessage,{id:"sidebar_left.channel_navigator.jumpTo",defaultMessage:"Find channel"}),P().createElement("div",{className:"SidebarChannelNavigator_shortcutText"},"".concat(xa.cX()?"⌘":"Ctrl+","K"))))}}Ja(Ya,"propTypes",{showUnreadsCategory:F().bool.isRequired,isQuickSwitcherOpen:F().bool.isRequired,actions:F().shape({openModal:F().func.isRequired,closeModal:F().func.isRequired}).isRequired});const Qa=(0,a.connect)((function(e){return{showUnreadsCategory:(0,E.pE)(e),isQuickSwitcherOpen:(0,Kn.o)(e,z.IQ.QUICK_SWITCH)}}),(function(e){return{actions:(0,q.bindActionCreators)({openModal:Un.q,closeModal:Un.O},e)}}))(Ya);var Za=n(62563),Xa=n(62844),$a=(n(6889),n(46177)),es=n.n($a),ts=n(22005),ns=n(35880),as=n(77234),ss=n(35631),rs=n(76509),is=n(8907),os=n(22789),ls=n(19202),cs=n(14696);function ds(e){const t=(0,le.useIntl)(),n=(0,R.useCallback)((()=>{e.actions.deleteCategory(e.category.id)}),[e.actions.deleteCategory,e.category]);return P().createElement(cs.zW,{compassDesign:!0,ariaLabel:t.formatMessage({id:"delete_category_modal.deleteCategory",defaultMessage:"Delete this category?"}),onExited:e.onExited,modalHeaderText:P().createElement(le.FormattedMessage,{id:"delete_category_modal.deleteCategory",defaultMessage:"Delete this category?"}),handleCancel:e.onExited,handleConfirm:n,confirmButtonText:P().createElement(le.FormattedMessage,{id:"delete_category_modal.delete",defaultMessage:"Delete"}),confirmButtonClassName:"delete"},P().createElement("span",{className:"delete-category__helpText"},P().createElement(le.FormattedMessage,{id:"delete_category_modal.helpText",defaultMessage:"Channels in <b>{category_name}</b> will move back to the Channels and Direct messages categories. You're not removed from any channels.",values:{category_name:e.category.display_name,b:e=>P().createElement("b",null,e)}})))}ds.propTypes={onExited:F().func.isRequired,actions:F().shape({deleteCategory:F().func.isRequired}).isRequired},(0,le.defineMessages)({cancel:{id:"generic_modal.cancel",defaultMessage:"Cancel"},confirm:{id:"generic_modal.confirm",defaultMessage:"Confirm"},paginationCount:{id:"footer_pagination.count",defaultMessage:"Showing {startCount, number}-{endCount, number} of {total, number}"},paginationNext:{id:"footer_pagination.next",defaultMessage:"Next"},paginationPrev:{id:"footer_pagination.prev",defaultMessage:"Previous"}});const hs=(0,a.connect)(null,(function(e){return{actions:(0,q.bindActionCreators)({deleteCategory:qn.K7},e)}}))(ds);var us=n(12555),ms=n(18986),ps=n(19174),gs=n(51877),fs=n(77813);const Es=e=>{let{category:t}=e;const n=(0,a.useDispatch)(),r=(0,a.useSelector)(E.pE),i=(0,R.useMemo)(zn.vk,[t]),o=(0,a.useSelector)((e=>i(e,t))),{formatMessage:l}=(0,le.useIntl)();let c=null;if(t.type!==is.e.DIRECT_MESSAGES){function C(){n((0,qn.qh)(t.id,!t.muted))}c=P().createElement(ms.q7,{id:"mute-".concat(t.id),onClick:C,leadingElement:P().createElement(Te.BellOutlineIcon,{size:18}),labels:t.muted?P().createElement(le.FormattedMessage,{id:"sidebar_left.sidebar_category_menu.unmuteCategory",defaultMessage:"Unmute Category"}):P().createElement(le.FormattedMessage,{id:"sidebar_left.sidebar_category_menu.muteCategory",defaultMessage:"Mute Category"})})}let d=null,h=null;if(t.type===is.e.CUSTOM){function y(){n((0,Un.q)({modalId:z.IQ.DELETE_CATEGORY,dialogType:hs,dialogProps:{category:t}}))}function v(){n((0,Un.q)({modalId:z.IQ.EDIT_CATEGORY,dialogType:us.default,dialogProps:{categoryId:t.id,initialCategoryName:t.display_name}}))}d=P().createElement(ms.q7,{id:"delete-".concat(t.id),isDestructive:!0,"aria-haspopup":!0,onClick:y,leadingElement:P().createElement(Te.TrashCanOutlineIcon,{size:18}),labels:P().createElement(le.FormattedMessage,{id:"sidebar_left.sidebar_category_menu.deleteCategory",defaultMessage:"Delete Category"})}),h=P().createElement(ms.q7,{id:"rename-".concat(t.id),onClick:v,"aria-haspopup":!0,leadingElement:P().createElement(Te.PencilOutlineIcon,{size:18}),labels:P().createElement(le.FormattedMessage,{id:"sidebar_left.sidebar_category_menu.renameCategory",defaultMessage:"Rename Category"})})}function u(e){n((0,qn.rV)(t.id,e)),(0,Ee.sx)("ui","ui_sidebar_sort_dm_".concat(e))}let m=P().createElement(le.FormattedMessage,{id:"sidebar.sortedManually",defaultMessage:"Manually"}),p=P().createElement(Te.FormatListBulletedIcon,{size:18});t.sorting===rs.b.Alphabetical?(m=P().createElement(le.FormattedMessage,{id:"user.settings.sidebar.sortAlpha",defaultMessage:"Alphabetically"}),p=P().createElement(Te.SortAlphabeticalAscendingIcon,{size:18})):t.sorting===rs.b.Recency&&(m=P().createElement(le.FormattedMessage,{id:"user.settings.sidebar.recent",defaultMessage:"Recent Activity"}),p=P().createElement(Te.ClockOutlineIcon,{size:18}));const g=P().createElement(ms.g8,{id:"sortChannels-".concat(t.id),leadingElement:p,labels:P().createElement(le.FormattedMessage,{id:"sidebar.sort",defaultMessage:"Sort"}),trailingElements:P().createElement(P().Fragment,null,m,P().createElement(Te.ChevronRightIcon,{size:16})),menuId:"sortChannels-".concat(t.id,"-menu"),menuAriaLabel:l({id:"sidebar_left.sidebar_category_menu.sort.dropdownAriaLabel",defaultMessage:"Sort submenu"})},P().createElement(ms.q7,{id:"sortAplhabetical-".concat(t.id),labels:P().createElement(le.FormattedMessage,{id:"user.settings.sidebar.sortAlpha",defaultMessage:"Alphabetically"}),onClick:()=>u(rs.b.Alphabetical),trailingElements:t.sorting===rs.b.Alphabetical?P().createElement(Te.CheckIcon,{size:16}):null}),P().createElement(ms.q7,{id:"sortByMostRecent-".concat(t.id),labels:P().createElement(le.FormattedMessage,{id:"sidebar.sortedByRecencyLabel",defaultMessage:"Recent Activity"}),onClick:()=>u(rs.b.Recency),trailingElements:t.sorting===rs.b.Recency?P().createElement(Te.CheckIcon,{size:16}):null}),P().createElement(ms.q7,{id:"sortManual-".concat(t.id),labels:P().createElement(le.FormattedMessage,{id:"sidebar.sortedManually",defaultMessage:"Manually"}),onClick:()=>u(rs.b.Manual),trailingElements:t.sorting===rs.b.Manual?P().createElement(Te.CheckIcon,{size:16}):null})),f=(0,R.useCallback)((()=>{n((0,s.Zi)(o)),(0,Ee.sx)("ui","ui_sidebar_category_menu_viewCategory")}),[n,o]),b=r?null:P().createElement(gs.A,{id:t.id,handleViewCategory:f,numChannels:o.length});return P().createElement(fs.A,{id:t.id},b,b&&P().createElement(ms.wv,null),c,h,d,P().createElement(ms.wv,null),g,P().createElement(ms.wv,null),P().createElement(ps.A,{id:t.id}))},bs=(0,R.memo)(Es),Cs=e=>{let{category:t,handleOpenDirectMessagesModal:n}=e;const[s,r]=(0,R.useState)(!1),{formatMessage:i}=(0,le.useIntl)(),o=(0,a.useDispatch)(),c=(0,a.useSelector)(E.pR),d=(0,a.useSelector)(l.WR);function h(e){o((0,qn.rV)(t.id,e)),(0,Ee.sx)("ui","ui_sidebar_sort_dm_".concat(e))}let u=P().createElement(Te.ClockOutlineIcon,{size:18}),m=P().createElement(le.FormattedMessage,{id:"user.settings.sidebar.recent",defaultMessage:"Recent Activity"});t.sorting===rs.b.Alphabetical&&(m=P().createElement(le.FormattedMessage,{id:"user.settings.sidebar.sortAlpha",defaultMessage:"Alphabetically"}),u=P().createElement(Te.SortAlphabeticalAscendingIcon,{size:18}));const p=P().createElement(ms.g8,{id:"sortDirectMessages-".concat(t.id),leadingElement:u,labels:P().createElement(le.FormattedMessage,{id:"sidebar.sort",defaultMessage:"Sort"}),trailingElements:P().createElement(P().Fragment,null,m,P().createElement(Te.ChevronRightIcon,{size:16})),menuId:"sortDirectMessages-".concat(t.id,"-menu")},P().createElement(ms.q7,{id:"sortAlphabetical-".concat(t.id),labels:P().createElement(le.FormattedMessage,{id:"user.settings.sidebar.sortAlpha",defaultMessage:"Alphabetically"}),onClick:()=>h(rs.b.Alphabetical),trailingElements:t.sorting===rs.b.Alphabetical?P().createElement(Te.CheckIcon,{size:16}):null}),P().createElement(ms.q7,{id:"sortByMostRecent-".concat(t.id),labels:P().createElement(le.FormattedMessage,{id:"sidebar.sortedByRecencyLabel",defaultMessage:"Recent Activity"}),onClick:()=>h(rs.b.Recency),trailingElements:t.sorting===rs.b.Recency?P().createElement(Te.CheckIcon,{size:16}):null}));let g=P().createElement("span",null,c);1e4===c&&(g=P().createElement(le.FormattedMessage,{id:"channel_notifications.levels.all",defaultMessage:"All"}));const f=P().createElement(ms.g8,{id:"showMessagesCount-".concat(t.id),leadingElement:P().createElement(Te.AccountMultipleOutlineIcon,{size:18}),labels:P().createElement(le.FormattedMessage,{id:"sidebar.show",defaultMessage:"Show"}),trailingElements:P().createElement(P().Fragment,null,g,P().createElement(Te.ChevronRightIcon,{size:16})),menuId:"showMessagesCount-".concat(t.id,"-menu")},z.Ay.DM_AND_GM_SHOW_COUNTS.map((e=>P().createElement(ms.q7,{id:"showDmCount-".concat(t.id,"-").concat(e),key:"showDmCount-".concat(t.id,"-").concat(e),labels:P().createElement("span",null,e),onClick:()=>{return t=e,void o((0,ss.SF)(d,[{user_id:d,category:z.Ay.Preferences.CATEGORY_SIDEBAR_SETTINGS,name:ue.pm.LIMIT_VISIBLE_DMS_GMS,value:t.toString()}]));var t},trailingElements:c===e?P().createElement(Te.CheckIcon,{size:16}):null})))),b=P().createElement(ms.q7,{id:"openDirectMessage-".concat(t.id),onClick:n,leadingElement:P().createElement(Te.AccountPlusOutlineIcon,{size:18}),labels:P().createElement(le.FormattedMessage,{id:"sidebar.openDirectMessage",defaultMessage:"Open a direct message"})});return P().createElement("div",{className:U()("SidebarMenu","MenuWrapper",{menuOpen:s},{"MenuWrapper--open":s})},P().createElement(ms.mc,{menuButton:{id:"SidebarCategorySortingMenu-Button-".concat(t.id),"aria-label":i({id:"sidebar_left.sidebar_category_menu.editCategory",defaultMessage:"Category options"}),class:"SidebarMenu_menuButton sortingMenu",children:P().createElement(Te.DotsVerticalIcon,{size:16})},menuButtonTooltip:{text:i({id:"sidebar_left.sidebar_category_menu.editCategory",defaultMessage:"Category options"}),class:"hidden-xs"},menu:{id:"SidebarCategorySortingMenu-MenuList-".concat(t.id),"aria-label":i({id:"sidebar_left.sidebar_category_menu.dropdownAriaLabel",defaultMessage:"Edit category menu"}),onToggle:function(e){r(e)}}},p,f,P().createElement(ms.wv,null),b))},ys=(0,R.memo)(Cs);var vs=n(89427),_s=n(98089);const Ms=()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(o.Sy),n=(0,le.useIntl)(),s=(0,a.useSelector)((e=>(0,E.Jz)(e,z.pm.TOUCHED,z.JS.ADD_CHANNELS_CTA))),r=(0,a.useSelector)((e=>(0,Vn.xY)(e,jn.A.CREATE_PUBLIC_CHANNEL))),i=(0,a.useSelector)((e=>(0,Vn.xY)(e,jn.A.CREATE_PRIVATE_CHANNEL)))||r,l=(0,a.useSelector)((e=>(0,Vn.xY)(e,jn.A.JOIN_PUBLIC_CHANNELS))),c=(0,a.useSelector)(fa),d=(0,a.useSelector)(f.WR),h=(0,R.useCallback)((t=>{e((0,pa.M)(t))}),[]);let u="SidebarChannelNavigator__addChannelsCtaLhsButton";if(s||(u+=" SidebarChannelNavigator__addChannelsCtaLhsButton--untouched"),!i&&!l||!t)return null;const m=()=>{e((0,Un.q)({modalId:z.IQ.MORE_CHANNELS,dialogType:vs.default})),(0,Ee.sx)("ui","browse_channels_button_is_clicked")},p=()=>{e((0,Un.q)({modalId:z.IQ.NEW_CHANNEL_MODAL,dialogType:_s.default})),(0,Ee.sx)("ui","create_new_channel_button_is_clicked")},g=e=>P().createElement("button",{className:u,id:"addChannelsCta","aria-label":n.formatMessage({id:"sidebar_left.add_channel_dropdown.dropdownAriaLabel",defaultMessage:"Add Channel Dropdown"}),onClick:()=>null==e?void 0:e()},P().createElement("div",{"aria-label":n.formatMessage({id:"sidebar_left.sidebar_channel_navigator.addChannelsCta",defaultMessage:"Add channels"})},P().createElement("i",{className:"icon-plus-box"}),P().createElement("span",null,n.formatMessage({id:"sidebar_left.addChannelsCta",defaultMessage:"Add Channels"})))),b=()=>{(0,Ee.sx)("ui","add_channels_cta_button_clicked"),s||e((0,ss.SF)(d,[{category:z.pm.TOUCHED,user_id:d,name:z.JS.ADD_CHANNELS_CTA,value:"true"}]))};return i?P().createElement(_a.A,{className:"AddChannelsCtaDropdown",onToggle:e=>{h(e),b()},open:c},g(),P().createElement(va.A,{id:"AddChannelCtaDropdown",ariaLabel:n.formatMessage({id:"sidebar_left.add_channel_cta_dropdown.dropdownAriaLabel",defaultMessage:"Add Channels Dropdown"})},(()=>{let e,t;return l&&(e=P().createElement(va.A.ItemAction,{id:"showMoreChannels",onClick:m,icon:P().createElement("i",{className:"icon-globe"}),text:n.formatMessage({id:"sidebar_left.add_channel_dropdown.browseChannels",defaultMessage:"Browse channels"})})),i&&(t=P().createElement(va.A.ItemAction,{id:"showNewChannel",onClick:p,icon:P().createElement("i",{className:"icon-plus"}),text:n.formatMessage({id:"sidebar_left.add_channel_dropdown.createNewChannel",defaultMessage:"Create new channel"})})),P().createElement(P().Fragment,null,P().createElement(va.A.Group,null,t,e))})())):g((()=>{m(),b()}))};var ws=n(53791);const Ss=e=>{const t=(0,le.useIntl)(),n=(0,a.useSelector)(o.Sy);return n?P().createElement(ze.A,{teamId:n,permissions:[ue.xB.ADD_USER_TO_TEAM,ue.xB.INVITE_GUEST]},P().createElement(Je.A,{ariaLabel:t.formatMessage({id:"sidebar_left.inviteMembers",defaultMessage:"Invite Members"}),id:"inviteMembersButton",className:"intro-links color--link cursor--pointer".concat(e.className?" ".concat(e.className):""),modalId:z.IQ.INVITATION,dialogType:$e.default,onClick:()=>{(0,Ee.sx)((0,ws.p2)(e.isAdmin),"click_sidebar_invite_members_button")}},P().createElement("div",{className:"SidebarChannelNavigator__inviteMembersLhsButton","aria-label":t.formatMessage({id:"sidebar_left.sidebar_channel_navigator.inviteUsers",defaultMessage:"Invite Members"})},P().createElement("i",{className:"icon-plus-box"}),P().createElement(le.FormattedMessage,{id:"sidebar_left.inviteMembers",defaultMessage:"Invite Members"})))):null};Ss.propTypes={className:F().string,isAdmin:F().bool.isRequired};const Ts=Ss;var As=n(66039),Is=n(50418);function Ns(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ls extends P().PureComponent{constructor(e){super(e),Ns(this,"handleA11yActivateEvent",(()=>{var e;null===(e=this.categoryTitleRef.current)||void 0===e||e.addEventListener("keydown",this.handleA11yKeyDown),this.a11yKeyDownRegistered=!0})),Ns(this,"handleA11yDeactivateEvent",(()=>{var e;null===(e=this.categoryTitleRef.current)||void 0===e||e.removeEventListener("keydown",this.handleA11yKeyDown),this.a11yKeyDownRegistered=!1})),Ns(this,"handleA11yKeyDown",(e=>{(0,Ut.e)(e,z.Ay.KeyCodes.ENTER)&&this.handleCollapse()})),Ns(this,"renderChannel",((e,t)=>{const{setChannelRef:n,category:a,draggingState:s}=this.props;return P().createElement(Is.A,{key:e,channelIndex:t,channelId:e,isDraggable:!0,setChannelRef:n,isCategoryCollapsed:a.collapsed,isCategoryDragged:s.type===z.I8.CATEGORY&&s.id===a.id,isAutoSortedCategory:a.sorting===rs.b.Alphabetical||a.sorting===rs.b.Recency})})),Ns(this,"handleCollapse",(()=>{const{category:e}=this.props;e.collapsed?(0,Ee.sx)("ui","ui_sidebar_expand_category"):(0,Ee.sx)("ui","ui_sidebar_collapse_category"),this.props.actions.setCategoryCollapsed(e.id,!e.collapsed)})),Ns(this,"removeAnimation",(()=>{this.newDropBoxRef.current&&this.newDropBoxRef.current.classList.remove("animating")})),Ns(this,"handleOpenDirectMessagesModal",(e=>{e.preventDefault(),this.props.handleOpenMoreDirectChannelsModal(e.nativeEvent),(0,Ee.sx)("ui","ui_sidebar_create_direct_message")})),Ns(this,"isDropDisabled",(()=>{const{draggingState:e,category:t}=this.props;return t.type===is.e.DIRECT_MESSAGES?e.type===z.I8.CHANNEL:t.type===is.e.CHANNELS&&e.type===z.I8.DM})),Ns(this,"renderNewDropBox",(e=>{const{draggingState:t,category:n,isNewCategory:a,channelIds:s}=this.props;return!a||null!=s&&s.length?null:P().createElement(P().Fragment,null,P().createElement(ts.Draggable,{draggableId:"NEW_CHANNEL_SPACER__".concat(n.id),isDragDisabled:!0,index:0},(e=>P().createElement("li",Object.assign({ref:e.innerRef,draggable:"false",className:"SidebarChannel noFloat newChannelSpacer"},e.draggableProps,{role:"listitem",tabIndex:-1})))),P().createElement("div",{className:"SidebarCategory_newDropBox"},P().createElement("div",{ref:this.newDropBoxRef,className:U()("SidebarCategory_newDropBox-content",{collapsed:n.collapsed||t.type===z.I8.CATEGORY&&t.id===n.id,isDraggingOver:e}),onTransitionEnd:this.removeAnimation},P().createElement("i",{className:"icon-hand-right"}),P().createElement("span",{className:"SidebarCategory_newDropBox-label"},P().createElement(le.FormattedMessage,{id:"sidebar_left.sidebar_category.newDropBoxLabel",defaultMessage:"Drag channels here..."})))))})),Ns(this,"showPlaceholder",(()=>{const{channelIds:e,draggingState:t,category:n,isNewCategory:a}=this.props;return n.sorting!==rs.b.Alphabetical&&n.sorting!==rs.b.Recency&&!a||!!e.find((e=>e===t.id))})),this.categoryTitleRef=P().createRef(),this.newDropBoxRef=P().createRef(),this.state={isMenuOpen:!1},this.a11yKeyDownRegistered=!1}componentDidUpdate(e){this.props.category.collapsed!==e.category.collapsed&&this.newDropBoxRef.current&&this.newDropBoxRef.current.classList.add("animating")}componentDidMount(){var e,t;null===(e=this.categoryTitleRef.current)||void 0===e||e.addEventListener(z.pn.ACTIVATE,this.handleA11yActivateEvent),null===(t=this.categoryTitleRef.current)||void 0===t||t.addEventListener(z.pn.DEACTIVATE,this.handleA11yDeactivateEvent)}componentWillUnmount(){var e,t;null===(e=this.categoryTitleRef.current)||void 0===e||e.removeEventListener(z.pn.ACTIVATE,this.handleA11yActivateEvent),null===(t=this.categoryTitleRef.current)||void 0===t||t.removeEventListener(z.pn.DEACTIVATE,this.handleA11yDeactivateEvent),this.a11yKeyDownRegistered&&this.handleA11yDeactivateEvent()}render(){const{category:e,categoryIndex:t,channelIds:n,isNewCategory:a}=this.props;if(!e)return null;if(e.type===is.e.FAVORITES&&(null==n||!n.length))return null;const s=n.map(this.renderChannel);let r,i,o=!0;if(a)i=P().createElement("div",{className:"SidebarCategory_newLabel"},P().createElement(le.FormattedMessage,{id:"sidebar_left.sidebar_category.newLabel",defaultMessage:"new"})),r=P().createElement(bs,{category:e});else if(e.type===is.e.DIRECT_MESSAGES){const t=(0,os.V)({id:"sidebar.createDirectMessage",defaultMessage:"Create new direct message"});r=P().createElement(P().Fragment,null,P().createElement(ys,{category:e,handleOpenDirectMessagesModal:this.handleOpenDirectMessagesModal}),P().createElement(Ma.A,{title:P().createElement(P().Fragment,null,t,P().createElement(ls.h,{shortcut:ls.A.navDMMenu,hideDescription:!0,isInsideTooltip:!0}))},P().createElement("button",{className:"SidebarChannelGroupHeader_addButton",onClick:this.handleOpenDirectMessagesModal,"aria-label":t},P().createElement("i",{className:"icon-plus"})))),n&&n.length||(o=!1)}else r=P().createElement(bs,{category:e});let l=e.display_name;if(e.type!==is.e.CUSTOM){const t=Rs[e.type];l=(0,os.V)({id:t.id,defaultMessage:t.defaultMessage})}return P().createElement(ts.Draggable,{draggableId:e.id,index:t,disableInteractiveElementBlocking:!0},((t,n)=>{let a=null;"direct_messages"!==e.type||e.collapsed||(a=P().createElement(Ts,{className:"followingSibling",isAdmin:this.props.isAdmin}));let c=null;return"channels"!==e.type||e.collapsed||(c=P().createElement(Ms,null)),P().createElement("div",Object.assign({className:U()("SidebarChannelGroup a11y__section",{dropDisabled:this.isDropDisabled(),menuIsOpen:this.state.isMenuOpen,capture:this.props.draggingState.state===z.W7.CAPTURE,isCollapsed:e.collapsed}),ref:t.innerRef},t.draggableProps),P().createElement(ts.Droppable,{droppableId:e.id,type:"SIDEBAR_CHANNEL",isDropDisabled:this.isDropDisabled()},((a,c)=>P().createElement("div",Object.assign({},a.droppableProps,{ref:a.innerRef,className:U()({draggingOver:c.isDraggingOver})}),P().createElement(As.w,{ref:this.categoryTitleRef,displayName:l,dragHandleProps:t.dragHandleProps,isCollapsed:e.collapsed,isCollapsible:o,isDragging:n.isDragging,isDraggingOver:c.isDraggingOver,muted:e.muted,onClick:this.handleCollapse},i,void 0,r),P().createElement("div",{className:U()("SidebarChannelGroup_content")},P().createElement("ul",{role:"list",className:"NavGroupContent"},this.renderNewDropBox(c.isDraggingOver),s,this.showPlaceholder()?a.placeholder:null))))),a,c)}))}}const Rs=(0,le.defineMessages)({channels:{id:"sidebar.types.channels",defaultMessage:"CHANNELS"},direct_messages:{id:"sidebar.types.direct_messages",defaultMessage:"DIRECT MESSAGES"},favorites:{id:"sidebar.types.favorites",defaultMessage:"FAVORITES"}}),Ps=(0,a.connect)((function(){const e=(0,zn._)();return(t,n)=>({channelIds:e(t,n.category),draggingState:(0,zn.NX)(t),currentUserId:(0,l.WR)(t),isAdmin:(0,J.qc)((0,l.HW)(t).roles)})}),(function(e){return{actions:(0,q.bindActionCreators)({setCategoryCollapsed:qn.AD,setCategorySorting:qn.rV,savePreferences:ss.SF},e)}}))(Ls);function Os(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ks=(0,D.S)("DraftsLink",(0,R.lazy)((()=>n.e(3635).then(n.bind(n,83635))))),Ds=(0,D.S)("GlobalThreadsLink",(0,R.lazy)((()=>n.e(7351).then(n.bind(n,31551))))),xs=(0,D.S)("UnreadChannelIndicator",(0,R.lazy)((()=>n.e(4986).then(n.bind(n,4986))))),Fs=(0,D.S)("UnreadChannels",(0,R.lazy)((()=>n.e(4526).then(n.bind(n,12145)))));function Hs(e){return P().createElement("div",Object.assign({},e,{className:"scrollbar--view"}))}function Us(e){return P().createElement("div",Object.assign({},e,{className:"scrollbar--horizontal"}))}function Bs(e){return P().createElement("div",Object.assign({},e,{className:"scrollbar--verticalTrack"}))}function qs(e){return P().createElement("div",Object.assign({},e,{className:"scrollbar--vertical"}))}const js={position:"absolute"};class Vs extends P().PureComponent{constructor(e){var t;super(e),t=this,Os(this,"channelsListScrollTimeout",null),Os(this,"getDisplayedChannelIds",(()=>this.props.displayedChannels.map((e=>e.id)))),Os(this,"getDisplayedStaticPageIds",(()=>this.props.staticPages.map((e=>e.id)))),Os(this,"setChannelRef",((e,t)=>{t?this.channelRefs.set(e,t):this.channelRefs.delete(e)})),Os(this,"getFirstUnreadChannelFromChannelIdArray",(e=>e.find((e=>e!==this.props.currentChannelId&&this.props.unreadChannelIds.includes(e))))),Os(this,"handleScrollAnimationUpdate",(e=>{const t=e.getCurrentValue();this.scrollbar.current.scrollTop(t)})),Os(this,"scrollToFirstUnreadChannel",(()=>{this.scrollToChannel(this.getFirstUnreadChannel(),!0)})),Os(this,"scrollToLastUnreadChannel",(()=>{this.scrollToChannel(this.getLastUnreadChannel(),!0)})),Os(this,"scrollToChannel",(function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return;const a=t.channelRefs.get(e);if(!a)return;const s=a.offsetTop,r=s+a.offsetHeight,i=t.scrollbar.current.getScrollTop(),o=t.scrollbar.current.getClientHeight();if(s<i+32){const a=n||!t.state.showTopUnread?10:55;let r;const i=t.getDisplayedChannelIds();r=i.length>0&&i[0]===e?0:s-a-32,t.scrollToPosition(r)}else if(r>i+o){const e=r-o+(n||!t.state.showBottomUnread?10:55);t.scrollToPosition(e)}})),Os(this,"scrollToPosition",(e=>{this.scrollAnimation.setCurrentValue(this.scrollbar.current.getScrollTop()).setAtRest(),this.scrollAnimation.setEndValue(e)})),Os(this,"updateUnreadIndicators",(()=>{if(this.props.draggingState.state)return void this.setState({showTopUnread:!1,showBottomUnread:!1});let e=!1,t=!1;const n=this.getFirstUnreadChannel(),a=this.getLastUnreadChannel();if(n){const t=this.channelRefs.get(n);t&&t.offsetTop+t.offsetHeight-10-32<this.scrollbar.current.getScrollTop()&&(e=!0)}if(a){const e=this.channelRefs.get(a);e&&e.offsetTop+10>this.scrollbar.current.getScrollTop()+this.scrollbar.current.getClientHeight()&&(t=!0)}e===this.state.showTopUnread&&t===this.state.showBottomUnread||this.setState({showTopUnread:e,showBottomUnread:t})})),Os(this,"getFirstUnreadChannel",(()=>this.getFirstUnreadChannelFromChannelIdArray(this.getDisplayedChannelIds()))),Os(this,"getLastUnreadChannel",(()=>this.getFirstUnreadChannelFromChannelIdArray(this.getDisplayedChannelIds().reverse()))),Os(this,"navigateById",(e=>{-1===this.props.staticPages.findIndex((t=>t.id===e))?this.props.actions.switchToChannelById(e):this.props.actions.switchToLhsStaticPage(e)})),Os(this,"navigateChannelShortcut",(e=>{if(!e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||!(0,Ut.e)(e,z.YM.KeyCodes.UP)&&!(0,Ut.e)(e,z.YM.KeyCodes.DOWN))(0,Ut.r)(e)&&e.shiftKey&&(0,Ut.e)(e,z.YM.KeyCodes.K)&&this.props.handleOpenMoreDirectChannelsModal(e);else{e.preventDefault();const t=this.getDisplayedStaticPageIds(),n=[...t,...this.getDisplayedChannelIds()],a=this.props.currentChannelId||this.props.currentStaticPageId,s=n.indexOf(a);let r;r=(0,Ut.e)(e,z.YM.KeyCodes.DOWN)?s+1:s-1;const i=n[(0,X.zi)(r,n.length)];this.navigateById(i),r>=t.length&&this.scrollToChannel(i)}})),Os(this,"navigateUnreadChannelShortcut",(e=>{if(e.altKey&&e.shiftKey&&!e.ctrlKey&&!e.metaKey&&((0,Ut.e)(e,z.YM.KeyCodes.UP)||(0,Ut.e)(e,z.YM.KeyCodes.DOWN))){e.preventDefault();const t=this.getDisplayedChannelIds(),n=[...this.props.unreadChannelIds];this.props.collapsedThreads&&(t.unshift(""),this.props.hasUnreadThreads&&n.unshift(""));let a=0;a=(0,Ut.e)(e,z.YM.KeyCodes.UP)?-1:1;const s=(0,Z.y9)(this.props.currentChannelId,t,n,a);if(-1!==s){const e=t[s];this.navigateById(e),this.scrollToChannel(e)}}})),Os(this,"renderCategory",((e,t)=>P().createElement(Ps,{key:e.id,category:e,categoryIndex:t,setChannelRef:this.setChannelRef,handleOpenMoreDirectChannelsModal:this.props.handleOpenMoreDirectChannelsModal,isNewCategory:this.props.newCategoryIds.includes(e.id)}))),Os(this,"onScroll",es()((()=>{this.updateUnreadIndicators()}),100)),Os(this,"onTransitionEnd",es()((()=>{this.updateUnreadIndicators()}),100)),Os(this,"onBeforeCapture",(e=>{this.channelRefs.forEach((e=>e.classList.remove("animating")));const t=[...document.querySelectorAll('[data-rbd-droppable-id*="droppable-categories"]')];t[0].style.height="".concat(t[0].scrollHeight,"px"),this.props.multiSelectedChannelIds.find((t=>e.draggableId===t))||this.props.actions.clearChannelSelection();const n={state:z.W7.CAPTURE,id:e.draggableId};if(this.props.categories.some((t=>t.id===e.draggableId)))n.type=z.I8.CATEGORY;else{const t=this.props.displayedChannels.filter((t=>-1!==this.props.multiSelectedChannelIds.indexOf(t.id)||t.id===e.draggableId));t.every((e=>e.type===ue.Bz.DM_CHANNEL||e.type===ue.Bz.GM_CHANNEL))?n.type=z.I8.DM:t.every((e=>e.type!==ue.Bz.DM_CHANNEL&&e.type!==ue.Bz.GM_CHANNEL))?n.type=z.I8.CHANNEL:n.type=z.I8.MIXED_CHANNELS}this.props.actions.setDraggingState(n)})),Os(this,"onBeforeDragStart",(()=>{this.props.actions.setDraggingState({state:z.W7.BEFORE})})),Os(this,"onDragStart",(e=>{this.props.onDragStart(e),this.props.actions.setDraggingState({state:z.W7.DURING}),[...document.querySelectorAll('[data-rbd-droppable-id*="droppable-categories"]')][0].style.height=""})),Os(this,"onDragEnd",(e=>{this.props.onDragEnd(e),"DROP"===e.reason&&e.destination&&("SIDEBAR_CHANNEL"===e.type?(this.props.actions.moveChannelsInSidebar(e.destination.droppableId,e.destination.index,e.draggableId),(0,Ee.sx)("ui","ui_sidebar_dragdrop_dropped_channel")):"SIDEBAR_CATEGORY"===e.type&&(this.props.actions.moveCategory(this.props.currentTeam.id,e.draggableId,e.destination.index),(0,Ee.sx)("ui","ui_sidebar_dragdrop_dropped_category"))),this.props.actions.stopDragging()})),Os(this,"showChannelListScrollbar",(()=>{null!==this.channelsListScrollTimeout&&clearTimeout(this.channelsListScrollTimeout),this.setState({autoHide:!1})})),Os(this,"hideChannelListScrollbar",(()=>{this.channelsListScrollTimeout=setTimeout((()=>{this.setState({autoHide:!0})}),300)})),this.channelRefs=new Map,this.state={showTopUnread:!1,showBottomUnread:!1,autoHide:!0},this.scrollbar=P().createRef(),this.animate=new as.SpringSystem,this.scrollAnimation=this.animate.createSpring(),this.scrollAnimation.setOvershootClampingEnabled(!0),this.scrollAnimation.addListener({onSpringUpdate:this.handleScrollAnimationUpdate})}componentDidMount(){document.addEventListener("keydown",this.navigateChannelShortcut),document.addEventListener("keydown",this.navigateUnreadChannelShortcut)}componentWillUnmount(){document.removeEventListener("keydown",this.navigateChannelShortcut),document.removeEventListener("keydown",this.navigateUnreadChannelShortcut)}componentDidUpdate(e){this.props.currentChannelId&&e.currentChannelId&&(this.props.currentTeam!==e.currentTeam&&this.scrollbar.current.scrollToTop(),this.props.currentChannelId,e.currentChannelId,this.props.currentChannelId!==e.currentChannelId&&this.props.actions.close(),this.updateUnreadIndicators())}render(){const{categories:e}=this.props;let t;if(this.props.isUnreadFilterEnabled)t=P().createElement(Fs,{setChannelRef:this.setChannelRef});else{let n;this.props.showUnreadsCategory&&(n=P().createElement(Fs,{setChannelRef:this.setChannelRef}));const a=e.map(this.renderCategory);t=P().createElement(P().Fragment,null,n,P().createElement(ts.DragDropContext,{onDragEnd:this.onDragEnd,onBeforeDragStart:this.onBeforeDragStart,onBeforeCapture:this.onBeforeCapture,onDragStart:this.onDragStart},P().createElement(ts.Droppable,{droppableId:"droppable-categories",type:"SIDEBAR_CATEGORY"},(e=>P().createElement("div",Object.assign({id:"sidebar-droppable-categories",ref:e.innerRef},e.droppableProps),a,e.placeholder)))))}const n=P().createElement(le.FormattedMessage,{id:"sidebar.unreads",defaultMessage:"More unreads"}),a=P().createElement(le.FormattedMessage,{id:"sidebar.unreads",defaultMessage:"More unreads"}),s=this.props.intl.formatMessage({id:"accessibility.sections.lhsList",defaultMessage:"channel sidebar region"});return P().createElement(P().Fragment,null,P().createElement(Ds,null),P().createElement(ks,null),P().createElement("div",{id:"sidebar-left",role:"application","aria-label":s,className:U()("SidebarNavContainer a11y__region",{disabled:this.props.isUnreadFilterEnabled}),"data-a11y-disable-nav":Boolean(this.props.draggingState.type),"data-a11y-sort-order":"7",onTransitionEnd:this.onTransitionEnd},P().createElement(xs,{name:"Top",show:this.state.showTopUnread,onClick:this.scrollToFirstUnreadChannel,extraClass:"nav-pills__unread-indicator-top",content:n}),P().createElement(xs,{name:"Bottom",show:this.state.showBottomUnread,onClick:this.scrollToLastUnreadChannel,extraClass:"nav-pills__unread-indicator-bottom",content:a}),P().createElement("div",{onPointerLeave:this.hideChannelListScrollbar,onPointerOver:this.showChannelListScrollbar},P().createElement(ns.Ay,{ref:this.scrollbar,autoHide:this.state.autoHide,renderThumbHorizontal:Us,renderThumbVertical:qs,renderTrackVertical:Bs,renderView:Hs,onScroll:this.onScroll,style:js},t))))}}const Gs=(0,le.injectIntl)(Vs),Ws=(0,a.connect)((function(e){const t=(0,o.H7)(e),n=(0,E.WW)(e);let a=!1;var s;return n&&(a=Boolean(null===(s=(0,Za.kL)(e))||void 0===s?void 0:s.total_unread_threads)),{currentTeam:t,currentChannelId:(0,r.eH)(e),categories:(0,zn.WJ)(e),isUnreadFilterEnabled:(0,zn.ZM)(e),unreadChannelIds:(0,r.tr)(e),displayedChannels:(0,zn.sC)(e),draggingState:(0,zn.NX)(e),newCategoryIds:e.views.channelSidebar.newCategoryIds,multiSelectedChannelIds:e.views.channelSidebar.multiSelectedChannelIds,showUnreadsCategory:(0,E.pE)(e),collapsedThreads:n,hasUnreadThreads:a,currentStaticPageId:(0,V.SM)(e),staticPages:(0,V.j4)(e)}}),(function(e){return{actions:(0,q.bindActionCreators)({close:Xa.VN,switchToChannelById:c.Tw,moveChannelsInSidebar:Gn.nh,moveCategory:qn.Ax,setDraggingState:Gn.Jb,stopDragging:Gn.U5,clearChannelSelection:Gn.lE,switchToLhsStaticPage:Xa.S_},e)}}))(Gs);function zs(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ks=(0,D.S)("MobileSidebarHeader",(0,R.lazy)((()=>n.e(7994).then(n.bind(n,97994))))),Js=(0,D.S)("MoreDirectChannels",(0,R.lazy)((()=>n.e(6532).then(n.bind(n,96532))))),Ys=(0,D.S)("BrowseChannels",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,89427))))),Qs=(0,D.S)("EditCategoryModal",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,12555))))),Zs=(0,D.S)("CreateUserGroupsModal",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,36143))))),Xs=(0,D.S)("InvitationModal",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,49888))))),$s=(0,D.S)("KeyboardShortcutsModal",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,92904))))),er=(0,D.S)("NewChannelModal",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,98089))))),tr=(0,D.S)("UserSettingsModal",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,59529)))));class nr extends P().PureComponent{constructor(e){super(e),zs(this,"handleClickClearChannelSelection",(e=>{e.defaultPrevented||this.props.actions.clearChannelSelection()})),zs(this,"handleKeyDownEvent",(e=>{(0,Ut.e)(e,z.Ay.KeyCodes.ESCAPE)?this.props.actions.clearChannelSelection():(0,Ut.r)(e,!0)&&((0,Ut.e)(e,z.Ay.KeyCodes.FORWARD_SLASH)?(e.preventDefault(),this.props.isKeyBoardShortcutModalOpen?this.props.actions.closeModal(z.IQ.KEYBOARD_SHORTCUTS_MODAL):this.props.actions.openModal({modalId:z.IQ.KEYBOARD_SHORTCUTS_MODAL,dialogType:$s})):(0,Ut.e)(e,z.Ay.KeyCodes.A)&&e.shiftKey&&(e.preventDefault(),this.props.actions.openModal({modalId:z.IQ.USER_SETTINGS,dialogType:tr,dialogProps:{isContentProductSettings:!0}})))})),zs(this,"showMoreDirectChannelsModal",(()=>{this.setState({showDirectChannelsModal:!0}),(0,Ee.sx)("ui","ui_channels_more_direct_v2")})),zs(this,"hideMoreDirectChannelsModal",(()=>{this.setState({showDirectChannelsModal:!1})})),zs(this,"showCreateCategoryModal",(()=>{this.props.actions.openModal({modalId:z.IQ.EDIT_CATEGORY,dialogType:Qs,dialogProps:{}}),(0,Ee.sx)("ui","ui_sidebar_menu_createCategory")})),zs(this,"showMoreChannelsModal",(()=>{this.props.actions.openModal({modalId:z.IQ.MORE_CHANNELS,dialogType:Ys}),(0,Ee.sx)("ui","ui_channels_more_public_v2")})),zs(this,"invitePeopleModal",(()=>{this.props.actions.openModal({modalId:z.IQ.INVITATION,dialogType:Xs}),(0,Ee.sx)("ui","ui_channels_dropdown_invite_people")})),zs(this,"showNewChannelModal",(()=>{this.props.actions.openModal({modalId:z.IQ.NEW_CHANNEL_MODAL,dialogType:er}),this.closeEditRHS(),(0,Ee.sx)("ui","ui_channels_create_channel_v2")})),zs(this,"showCreateUserGroupModal",(()=>{this.props.actions.openModal({modalId:z.IQ.USER_GROUPS_CREATE,dialogType:Zs}),(0,Ee.sx)("ui","ui_channels_create_user_group")})),zs(this,"handleOpenMoreDirectChannelsModal",(e=>{e.preventDefault(),this.state.showDirectChannelsModal?this.hideMoreDirectChannelsModal():(this.showMoreDirectChannelsModal(),this.closeEditRHS())})),zs(this,"onDragStart",(()=>{this.setState({isDragging:!0})})),zs(this,"onDragEnd",(()=>{this.setState({isDragging:!1})})),zs(this,"renderModals",(()=>{let e;return this.state.showDirectChannelsModal&&(e=P().createElement(Js,{onModalDismissed:this.hideMoreDirectChannelsModal,isExistingChannel:!1})),P().createElement(P().Fragment,null,e)})),zs(this,"closeEditRHS",(()=>{this.props.rhsOpen&&this.props.rhsState===z._n.EDIT_HISTORY&&this.props.actions.closeRightHandSide()})),this.state={showDirectChannelsModal:!1,isDragging:!1}}componentDidMount(){this.props.teamId&&this.props.actions.fetchMyCategories(this.props.teamId),window.addEventListener("click",this.handleClickClearChannelSelection),window.addEventListener("keydown",this.handleKeyDownEvent)}componentDidUpdate(e){this.props.teamId&&e.teamId!==this.props.teamId&&this.props.actions.fetchMyCategories(this.props.teamId)}componentWillUnmount(){window.removeEventListener("click",this.handleClickClearChannelSelection),window.removeEventListener("keydown",this.handleKeyDownEvent)}render(){if(!this.props.teamId)return P().createElement("div",null);const e=(0,X.Vw)({id:"accessibility.sections.lhsNavigator",defaultMessage:"channel navigator region"});return P().createElement(ua,{id:"SidebarContainer",className:U()({"move--right":this.props.isOpen&&this.props.isMobileView,dragging:this.state.isDragging})},this.props.isMobileView?P().createElement(Ks,null):P().createElement(Na,{showNewChannelModal:this.showNewChannelModal,showMoreChannelsModal:this.showMoreChannelsModal,showCreateUserGroupModal:this.showCreateUserGroupModal,invitePeopleModal:this.invitePeopleModal,showCreateCategoryModal:this.showCreateCategoryModal,canCreateChannel:this.props.canCreatePrivateChannel||this.props.canCreatePublicChannel,canJoinPublicChannel:this.props.canJoinPublicChannel,handleOpenDirectMessagesModal:this.handleOpenMoreDirectChannelsModal,unreadFilterEnabled:this.props.unreadFilterEnabled,userGroupsEnabled:this.props.userGroupsEnabled,canCreateCustomGroups:this.props.canCreateCustomGroups}),P().createElement("div",{id:"lhsNavigator",role:"application","aria-label":e,className:"a11y__region","data-a11y-sort-order":"6"},P().createElement(Qa,null)),P().createElement("div",{className:"sidebar--left__icons"},P().createElement(Wt.default,{pluggableName:"LeftSidebarHeader"})),P().createElement(Ws,{handleOpenMoreDirectChannelsModal:this.handleOpenMoreDirectChannelsModal,onDragStart:this.onDragStart,onDragEnd:this.onDragEnd}),P().createElement(la,null),this.renderModals())}}zs(nr,"propTypes",{teamId:F().string.isRequired,canCreatePublicChannel:F().bool.isRequired,canCreatePrivateChannel:F().bool.isRequired,canJoinPublicChannel:F().bool.isRequired,isOpen:F().bool.isRequired,actions:F().shape({fetchMyCategories:F().func.isRequired,openModal:F().func.isRequired,closeModal:F().func.isRequired,clearChannelSelection:F().func.isRequired,closeRightHandSide:F().func.isRequired}).isRequired,unreadFilterEnabled:F().bool.isRequired,isMobileView:F().bool.isRequired,isKeyBoardShortcutModalOpen:F().bool.isRequired,userGroupsEnabled:F().bool.isRequired,canCreateCustomGroups:F().bool.isRequired,rhsOpen:F().bool});const ar=(0,a.connect)((function(e){const t=(0,o.H7)(e),n=(0,zn.ZM)(e),a=(0,E.h7)(e);let s=!1,r=!1,i=!1;t&&(s=(0,Vn.xY)(e,jn.A.CREATE_PUBLIC_CHANNEL),r=(0,Vn.xY)(e,jn.A.CREATE_PRIVATE_CHANNEL),i=(0,Vn.xY)(e,jn.A.JOIN_PUBLIC_CHANNELS));const l=(0,Vn.y4)(e,{permission:jn.A.CREATE_CUSTOM_GROUP})&&(0,E.h7)(e);return{teamId:t?t.id:"",canCreatePrivateChannel:r,canCreatePublicChannel:s,canJoinPublicChannel:i,isOpen:(0,V.Cu)(e),unreadFilterEnabled:n,isMobileView:(0,W.w3)(e),isKeyBoardShortcutModalOpen:(0,Kn.o)(e,z.IQ.KEYBOARD_SHORTCUTS_MODAL),userGroupsEnabled:a,canCreateCustomGroups:l,rhsState:(0,d.bM)(e),rhsOpen:(0,d.A)(e)}}),(function(e){return{actions:(0,q.bindActionCreators)({clearChannelSelection:Gn.lE,fetchMyCategories:qn.pQ,openModal:Un.q,closeModal:Un.O,closeRightHandSide:Wn.bP},e)}}))(nr);var sr=n(34574);const rr=()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(E.WW),n=(0,R.useRef)(!1);return(0,R.useEffect)((()=>{n.current?e((0,sr.Eq)()):n.current=!0}),[t]),null};var ir=n(39487);const or=n.p+"files/6a2055863ca6d151ebb4.png",lr=n.p+"files/5309202966a267198738.png",cr=n.p+"files/15307d1bee6d7e48a3c1.png",dr=n.p+"files/cd8cb8b2332ebb5e7a6d.png",hr=n.p+"files/544631aa0cac60b57833.png",ur=n.p+"files/90de726ce0a2fe9958d3.png",mr=n.p+"files/940dec81931d4df6027f.png",pr=n.p+"files/bbedcb731056777d6679.png",gr=n.p+"files/3399e2ee5698233ffe44.png",fr=n.p+"files/5230b3ff762bfd3f84df.png",Er=n.p+"files/f6ea1b2c4b12cde69e70.png",br=n.p+"files/8f702b9068ad5f14443a.png",Cr=n.p+"files/9777bf12a1f691f71268.png",yr=n.p+"files/20b39a15c40e4db238f1.png",vr=n.p+"files/2c18b373ff146fd8108b.png";var _r=n(51881);function Mr(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wr=function(e){return e.Mention="Mention",e.Unread="Unread",e.None="None",e}(wr||{});class Sr extends P().PureComponent{constructor(){super(...arguments),Mr(this,"updateDesktopApp",(()=>{const{unreadStatus:e}=this.props,{isUnread:t,unreadMentionCount:n}=(0,r.pP)(e);_r.h.updateUnreadsAndMentions(t,n)})),Mr(this,"updateTitle",(()=>{const{siteName:e,currentChannel:t,currentTeam:n,currentTeammate:a,unreadStatus:s,inGlobalThreads:i,inDrafts:o}=this.props,{formatMessage:l}=this.props.intl,c=e||"",{isUnread:d,unreadMentionCount:h}=(0,r.pP)(s),u=h>0?"(".concat(h,") "):"",m=!this.isDynamicFaviconSupported&&d?"* ":"";if(t&&n&&t.id){let e=t.display_name;t.type===z.YM.DM_CHANNEL&&null!=a&&(e=a.display_name),document.title="".concat(u).concat(m).concat(e," - ").concat(n.display_name," ").concat(c)}else document.title=n&&i?l({id:"globalThreads.title",defaultMessage:"{prefix}Threads - {displayName} {siteName}"},{prefix:"".concat(u).concat(m),displayName:n.display_name,siteName:c}):n&&o?l({id:"drafts.title",defaultMessage:"{prefix}Drafts - {displayName} {siteName}"},{prefix:"".concat(u).concat(m),displayName:n.display_name,siteName:c}):l({id:"sidebar.team_select",defaultMessage:"{siteName} - Join a team"},{siteName:c||"Mattermost"})})),Mr(this,"updateFavicon",(e=>{if(!xa.gm()&&!xa.H8())return;if(!document.querySelector('link[rel="icon"]'))return;const t=document.querySelector('link[rel="icon"][sizes="16x16"]'),n=document.querySelector('link[rel="icon"][sizes="24x24"]'),a=document.querySelector('link[rel="icon"][sizes="32x32"]'),s=document.querySelector('link[rel="icon"][sizes="64x64"]'),r=document.querySelector('link[rel="icon"][sizes="96x96"]'),i=e=>(0,ir.GX)(e);switch(e){case wr.Mention:t.href=i(ur),n.href=i(mr),a.href=i(pr),s.href=i(gr),r.href=i(fr);break;case wr.Unread:t.href=i(Er),n.href=i(br),a.href=i(Cr),s.href=i(yr),r.href=i(vr);break;default:t.href=i(or),n.href=i(lr),a.href=i(cr),s.href=i(dr),r.href=i(hr)}}))}componentDidUpdate(e){this.updateTitle();const t=this.getBadgeStatus(e.unreadStatus),n=this.getBadgeStatus(this.props.unreadStatus);t!==n&&this.updateFavicon(n),this.updateDesktopApp()}get isDynamicFaviconSupported(){return xa.H8()||xa.gm()}getBadgeStatus(e){return"number"==typeof e?wr.Mention:e?wr.Unread:wr.None}render(){return null}}Mr(Sr,"propTypes",{siteName:F().string,inGlobalThreads:F().bool.isRequired,inDrafts:F().bool.isRequired});const Tr=(0,le.injectIntl)(Sr),Ar=(0,O.withRouter)((0,a.connect)((function(e,t){let{location:{pathname:n}}=t;const a=(0,i.zj)(e),s=(0,r.Lw)(e),l=s&&s.teammate_id?s:null;return{currentChannel:s,currentTeam:(0,o.H7)(e),currentTeammate:l,siteName:a.SiteName,unreadStatus:(0,r.m5)(e),inGlobalThreads:null!=(0,O.matchPath)(n,{path:"/:team/threads/:threadIdentifier?"}),inDrafts:null!=(0,O.matchPath)(n,{path:"/:team/drafts"})}}),(function(e){return{actions:(0,q.bindActionCreators)({},e)}}))(Tr)),Ir=(0,D.S)("ProductNoticesModal",(0,R.lazy)((()=>n.e(452).then(n.bind(n,20452))))),Nr=(0,D.S)("ResetStatusModal",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,58737))))),Lr=["app__body","channel-view"];function Rr(e){const t=(0,a.useSelector)(f.F4),n=(0,a.useDispatch)();return(0,R.useEffect)((()=>{var e;const t=(0,xa.VN)()||(0,xa.UP)(),{navigator:a}=window,s=(null==a||null===(e=a.userAgentData)||void 0===e?void 0:e.platform)||(null==a?void 0:a.platform)||"unknown";return document.body.classList.add(...function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=[...Lr];return"Win32"===e||"Win64"===e?n.push("os--windows"):"MacIntel"!==e&&"MacPPC"!==e||n.push("os--mac"),t&&n.push("browser--ie"),n}(s,t)),()=>{document.body.classList.remove(...Lr),n((0,B.uF)())}}),[]),(0,R.useEffect)((()=>{let e;return t&&(e=setInterval((()=>{n((0,b.I8)())}),z.YM.STATUS_INTERVAL)),()=>{clearInterval(e)}}),[t]),P().createElement(P().Fragment,null,P().createElement(rr,null),P().createElement(Bn,null),P().createElement(ar,null),P().createElement("div",{id:"channel_view",className:"channel-view","data-testid":"channel_view"},P().createElement(Ar,null),P().createElement(Ir,null),P().createElement("div",{className:U()("container-fluid channel-view-inner")},e.shouldRenderCenterChannel?P().createElement(Hn,null):P().createElement(he.A,{centered:!0}),P().createElement(Wt.default,{pluggableName:"Root"}),P().createElement(Nr,null))))}Rr.propTypes={shouldRenderCenterChannel:F().bool.isRequired};var Pr=n(854);const Or=(0,D.S)("BackstageController",(0,R.lazy)((()=>n.e(595).then(n.bind(n,34526))))),kr=(0,D.S)("Pluggable",(0,R.lazy)((()=>Promise.resolve().then(n.bind(n,694)))));var Dr=I()(kr).withConfig({displayName:"_StyledPluggable"})({gridArea:"center"});function xr(e){var t;const n=(0,O.useHistory)(),{team:s}=(0,O.useParams)(),[r,i]=(0,R.useState)(!1),[o,c]=(0,R.useState)(Fr(e.teamsList,s)),d=(0,R.useRef)(Date.now()),h=(0,R.useRef)(Date.now());async function u(t,a){c(null);const{data:s,error:r}=await e.joinTeam(t,a);r?n.push("/error?type=team_not_found"):s&&c(s)}(function(){var e,t;const n=(0,a.useSelector)(l.HW),s=null!==(e=null==n?void 0:n.id)&&void 0!==e?e:"",r=null!==(t=null==n?void 0:n.roles)&&void 0!==t?t:"";(0,R.useEffect)((()=>{s&&K.mT.setUserId(s),r&&K.mT.setUserRoles(r)}),[s,r])})(),(0,R.useEffect)((()=>{Pr.A.stop("team_controller"),_r.h.reactAppInitialized(),e.fetchAllMyChannelMembers(),async function(){await e.fetchAllMyTeamsChannels(),i(!0)}()}),[]),(0,R.useEffect)((()=>{if(e.disableWakeUpReconnectHandler)return()=>{};const t=setInterval((()=>{const e=Date.now();e-h.current>6e4&&(console.log("computer woke up - reconnecting"),(0,k.M6)()),h.current=e}),3e4);return()=>{clearInterval(t)}}),[e.disableWakeUpReconnectHandler]),(0,R.useEffect)((()=>{function t(){window.isActive=!0,e.markAsReadOnFocus(),e.disableRefetchingOnBrowserFocus||Date.now()-d.current>12e4&&e.currentTeamId&&e.fetchChannelsAndMembers(e.currentTeamId)}function n(){window.isActive=!1,d.current=Date.now(),e.unsetActiveChannelOnServer()}function a(e){if(e.shiftKey&&(0,Ut.r)(e)&&(0,Ut.e)(e,z.Ay.KeyCodes.L)){const e=document.querySelector("#sidebar-right.is-open.expanded #reply_textbox");if(e)e.focus();else{const e=document.getElementById("post_textbox");e&&e.focus()}}}return window.addEventListener("focus",t),window.addEventListener("blur",n),window.addEventListener("keydown",a),()=>{window.removeEventListener("focus",t),window.removeEventListener("blur",n),window.removeEventListener("keydown",a)}}),[e.currentTeamId]),(0,R.useEffect)((()=>{const e=(0,xa.ux)();return e&&L().enable(),window.isActive=!0,y.A.setTeamIdJoinedOnLoad(null),()=>{window.isActive=!1,e&&L().disable()}}),[]);const m=e.teamsList.map((e=>e.id)).sort().join("+");if((0,R.useEffect)((()=>{if(s){if(z.Ay.RESERVED_TEAM_NAMES.includes(s))return;const t=Fr(e.teamsList,s);t?async function(t){const{data:a,error:s}=await e.initializeTeam(t);s?n.push("/error?type=team_not_found"):a&&c(a)}(t):o&&o.name!==s?u(s,!1):o||u(s,!0)}}),[s,m]),e.mfaRequired)return n.push("/mfa/setup"),null;if(null===o)return null;const p=(null==o?void 0:o.name.toLowerCase())===(null==s?void 0:s.toLowerCase());return P().createElement(O.Switch,null,P().createElement(O.Route,{path:"/:team(".concat(Ln.LD,")/integrations"),component:Or}),P().createElement(O.Route,{path:"/:team(".concat(Ln.LD,")/emoji"),component:Or}),null===(t=e.plugins)||void 0===t?void 0:t.map((e=>P().createElement(O.Route,{key:e.id,path:"/:team(".concat(Ln.LD,")/")+e.route,render:()=>P().createElement(Dr,{pluggableName:"NeedsTeamComponent",pluggableId:e.id})}))),P().createElement(Rr,{shouldRenderCenterChannel:r&&p}))}function Fr(e,t){var n;if(!t)return null;return(null!==(n=e.find((e=>e.name===t)))&&void 0!==n?n:null)||null}const Hr=(0,R.memo)(xr),Ur={fetchChannelsAndMembers:s.DC,fetchAllMyTeamsChannels:s.al,fetchAllMyChannelMembers:s.AK,markAsReadOnFocus:c.jK,initializeTeam:S,joinTeam:function(e,t){return async(n,a)=>{const s=a(),r=(0,l.HW)(s);try{const a=await n((0,g.Uj)(e));if((0,v.o)(a)){const e=a.data;if(r&&e&&0===e.delete_at){const a=await n((0,C.$w)(e.id,r.id));if((0,v.o)(a))return t&&y.A.setTeamIdJoinedOnLoad(e.id),await n(S(e)),{data:e};throw a.error}throw new Error("Team not found or deleted")}throw a.error}catch(e){return(0,p.UP)(e,n,a),n((0,u.vV)(e)),{error:e}}}},unsetActiveChannelOnServer:s.Zw},Br=(0,a.connect)((function(e,t){const n=(0,i.Ay)(e),a=(0,i.zj)(e),s=(0,l.HW)(e),c=e.plugins.components.NeedsTeamComponent,u="true"===a.DisableRefetchingOnBrowserFocus,m="true"===a.DisableWakeUpReconnectHandler;return{currentTeamId:(0,o.Sy)(e),currentChannelId:(0,r.eH)(e),teamsList:(0,o.vt)(e),plugins:c,selectedThreadId:(0,h.EB)(e),selectedPostId:(0,d.zb)(e),mfaRequired:(0,T.T)(s,n,a,t.match.url),disableRefetchingOnBrowserFocus:u,disableWakeUpReconnectHandler:m}}),Ur),qr=Br(Hr)},90617:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(97023),s=n.n(a);const r=()=>s().createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18"},s().createElement("g",{id:"Developer-Export",stroke:"none",strokeWidth:"1",fillRule:"evenodd"},s().createElement("g",{transform:"translate(-285.000000, -933.000000)",id:"All-Team-Members"},s().createElement("g",{transform:"translate(245.000000, 698.000000)"},s().createElement("g",{id:"Channel-Administrators",transform:"translate(0.000000, 106.000000)"},s().createElement("g",{id:"data-table/column-1",transform:"translate(11.000000, 86.000000)"},s().createElement("g",{id:"row-checkbox---Public-Channels",transform:"translate(12.000000, 35.000000)"},s().createElement("g",{id:"Stacked-Group",transform:"translate(0.000000, 5.000000)"},s().createElement("g",{id:"data-table/1st/row-checkbox-label-base"},s().createElement("g",{id:"check-on-copy-11",transform:"translate(14.000000, 0.000000)"},s().createElement("path",{d:"M19,3 L5,3 C3.9,3 3,3.9 3,5 L3,19 C3,20.1 3.9,21 5,21 L19,21 C20.1,21 21,20.1 21,19 L21,5 C21,3.9 20.1,3 19,3 L19,3 Z M10,17 L5,12.1923077 L6.4,10.8461538 L10,14.3076923 L17.6,7 L19,8.34615385 L10,17 L10,17 Z",id:"checkbox---checked"}))))))))))),i=(0,a.memo)(r)},92159:(e,t,n)=>{n.d(t,{H:()=>s,K:()=>r});const a={},s=(e,t)=>e.entities.channelBookmarks.byChannelId[t]||a,r=(e,t,n)=>s(e,t)[n]},49176:(e,t,n)=>{n.d(t,{Cu:()=>r,SM:()=>i,j4:()=>l});var a=n(8361),s=n(77440);function r(e){return e.views.lhs.isOpen}function i(e){return e.views.lhs.currentStaticPageId}const o=(0,n(67173).wV)(),l=(0,a.Mz)("getVisibleSidebarStaticPages",s.WW,o,((e,t)=>{const n=[];return e&&n.push({id:"threads",isVisible:!0}),n.push({id:"drafts",isVisible:t>0}),n.filter((e=>e.isVisible))}))},83949:(e,t,n)=>{function a(e){return"data"in e&&!s(e)}function s(e){return Boolean(e.error)}n.d(t,{b:()=>s,o:()=>a})}}]);
//# sourceMappingURL=6743.0044bcd54c3717f53eed.js.map

VaKeR 2022