"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[9527],{59527:(e,n,t)=>{t.r(n),t.d(n,{default:()=>k});var a=t(62688),l=t.n(a),r=(t(17046),t(36418)),o=t.n(r),c=t(14778),s=t(37270),u=t(47958),i=t(57898),d=t(65952);const b=(e,n)=>{const t=(0,d.c3)(e,n),a=(0,d.c)(e,n);return Boolean(a&&(a.type===i.Bz.OPEN_CHANNEL||a.type===i.Bz.PRIVATE_CHANNEL))&&(0,u.z)(t)};var h=t(26614),f=t(63324),m=t(18515),_=t(87131),p=t(52231);const g={singleline:!0,mentionHighlight:!1};function k(e){let{channelId:n}=e;const t=(0,s.useSelector)((e=>(0,d.c3)(e,n))),a=(0,s.useSelector)(h.Ay),l=(0,p.$X)(a),u=(0,s.useSelector)((e=>b(e,n))),i=l&&u,k=(0,r.useRef)(null),[E,N]=o().useState(!1);(0,r.useEffect)((()=>{if(!k.current)return;const e=k.current.offsetWidth<k.current.scrollWidth,n=k.current.offsetHeight<k.current.scrollHeight;N(e||n)}),[null==t?void 0:t.text]);const x=(0,c.useIntl)().formatMessage({id:"channel_banner.aria_label",defaultMessage:"Channel banner text"}),y=o().createElement(m.A,{message:null==t?void 0:t.text,options:g}),B=(0,r.useMemo)((()=>({backgroundColor:null==t?void 0:t.background_color})),[t]),C=(0,r.useMemo)((()=>{if(!t||!t.background_color)return{};const e=(0,f.Up)(t.background_color);return{color:e,"--channel-banner-text-color":e}}),[t]);return t&&i?o().createElement(_.A,{title:y,className:"channelBannerTooltip",delayClose:!0,forcedPlacement:"bottom",disabled:!E},o().createElement("div",{className:"channel_banner","data-testid":"channel_banner_container",style:B},o().createElement("span",{"data-testid":"channel_banner_text",className:"channel_banner_text","aria-label":x,style:C,ref:k},y))):null}k.propTypes={channelId:l().string.isRequired}},47958:(e,n)=>{n.z=function(e){return!!e&&(Boolean(e.enabled)&&Boolean(e.text)&&Boolean(e.background_color))}}}]);
//# sourceMappingURL=9527.ac6883feaa5f446fe004.js.map