"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[6676],{26676:(e,t,s)=>{s.r(t),s.d(t,{default:()=>v}),s(43617),s(99930);var n=s(37270),i=s(32446),r=s(97282),o=s(35631),a=s(26366),c=s(8361),m=s(65952),d=s(26614),l=s(77440),p=s(80635),h=s(63647);const u=[];var y=s(36418),f=s.n(y),g=s(14778),_=s(37266),A=s(78451);class E extends f().PureComponent{componentDidMount(){this.props.isSystemAdmin&&this.props.actions.getStandardAnalytics()}componentDidUpdate(e){e.isSystemAdmin!==this.props.isSystemAdmin&&this.props.isSystemAdmin&&this.props.actions.getStandardAnalytics()}getCurrentNotice=()=>{for(const e of this.props.notices)if(!this.props.dismissedNotices[e.name]&&!this.props.preferences[e.name]&&(!e.adminOnly||this.props.isSystemAdmin)&&e.show?.(this.props.serverVersion,this.props.config,this.props.license,this.props.analytics,this.props.currentChannel))return e;return null};hide=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const s=e.getCurrentNotice();s&&(t||e.props.actions.savePreferences(e.props.currentUserId,[{user_id:e.props.currentUserId,category:A.pm.CATEGORY_SYSTEM_NOTICE,name:s.name,value:"dismissed"}]),e.props.actions.dismissNotice(s.name))}})();hideAndRemind=()=>{this.hide(!0)};hideAndForget=()=>{this.hide(!1)};render(){const e=this.getCurrentNotice();if(null==e)return null;let t;e.adminOnly&&(t=f().createElement("div",{className:"system-notice__info"},f().createElement("i",{className:"fa fa-eye",title:this.props.intl.formatMessage({id:"system_notice.adminVisible.icon",defaultMessage:"Only visible to System Admins Icon"})}),f().createElement(g.FormattedMessage,{id:"system_notice.adminVisible",defaultMessage:"Only visible to System Admins"})));const s=e.icon||f().createElement(_.A,null);return f().createElement("div",{className:"system-notice bg--white"},f().createElement("div",{className:"system-notice__logo"},s),f().createElement("div",{className:"system-notice__body"},f().createElement("div",{className:"system-notice__title"},e.title),e.body,t,f().createElement("div",{className:"system-notice__footer"},f().createElement("button",{id:"systemnotice_remindme",className:"btn btn-sm btn-primary",onClick:this.hideAndRemind},f().createElement(g.FormattedMessage,{id:"system_notice.remind_me",defaultMessage:"Remind Me Later"})),e.allowForget&&f().createElement("button",{id:"systemnotice_dontshow",className:"btn btn-sm btn-tertiary",onClick:this.hideAndForget},f().createElement(g.FormattedMessage,{id:"system_notice.dont_show",defaultMessage:"Don't Show Again"})))))}}const N=(0,g.injectIntl)(E),S=(0,l.dI)("getSystemNoticePreferences",A.pm.CATEGORY_SYSTEM_NOTICE),b=(0,c.Mz)("getPreferenceNameMap",S,(e=>{const t={};return e.forEach((e=>{t[e.name]=e})),t})),v=(0,n.connect)((function(e){const t=(0,d.Ay)(e),s=(0,d.zj)(e),n=e.entities.general.serverVersion,i=e.entities.admin.analytics;return{currentUserId:e.entities.users.currentUserId,preferences:b(e),dismissedNotices:e.views.notice.hasBeenDismissed,isSystemAdmin:(0,p.y4)(e,{permission:a.xB.MANAGE_SYSTEM}),notices:u,config:s,license:t,serverVersion:n,analytics:i,currentChannel:(0,m.Lw)(e)}}),(function(e){return{actions:(0,i.zH)({savePreferences:o.SF,dismissNotice:h.L,getStandardAnalytics:r.ur},e)}}))(N)}}]);
//# sourceMappingURL=6676.79704eb360641ca68331.js.map