"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[5215],{35215:(e,t,i)=>{i.r(t),i.d(t,{default:()=>h});var n=i(70314),a=i(61057),s=i(86332),r=i.n(s),o=(i(92189),i(84390)),l=i.n(o),u=i(21214),c=i(23712),p=i(35887),d=i(70174);function b(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.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:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class m extends l().PureComponent{constructor(e){super(e),b(this,"handleClick",((e,t)=>{var i;t.preventDefault(),this.props.updateTab(e.name),null===(i=t.target.closest(".settings-modal"))||void 0===i||i.classList.add("display--content")})),b(this,"handleKeyUp",((e,t)=>{(0,p.p)(t,c.default.KeyCodes.UP)?e>0&&(this.props.updateTab(this.props.tabs[e-1].name),(0,d.Y_)(this.buttonRefs[e-1].current)):(0,p.p)(t,c.default.KeyCodes.DOWN)&&e<this.props.tabs.length-1&&(this.props.updateTab(this.props.tabs[e+1].name),(0,d.Y_)(this.buttonRefs[e+1].current))})),this.buttonRefs=this.props.tabs.map((()=>l().createRef()))}componentDidMount(){var e;u.vU()&&(null===(e=document.querySelector(".settings-modal .settings-table .nav"))||void 0===e||e.classList.add("position--top"))}render(){const e=this.props.tabs.map(((e,t)=>{const i="".concat(e.name,"_li"),n=this.props.activeTab===e.name;let a="";return n&&(a="active"),l().createElement("li",{id:"".concat(e.name,"Li"),key:i,className:a,role:"presentation"},l().createElement("button",{ref:this.buttonRefs[t],id:"".concat(e.name,"Button"),className:"cursor--pointer style--none",onClick:this.handleClick.bind(null,e),onKeyUp:this.handleKeyUp.bind(null,t),"aria-label":e.uiName.toLowerCase(),role:"tab","aria-selected":n,tabIndex:n||this.props.isMobileView?0:-1},l().createElement("i",{className:e.icon,title:e.iconTitle}),e.uiName))}));return l().createElement("div",null,l().createElement("ul",{id:"tabList",className:"nav nav-pills nav-stacked",role:"tablist","aria-orientation":"vertical"},e))}}b(m,"propTypes",{activeTab:r().string,tabs:r().arrayOf(r().shape({icon:r().string.isRequired,iconTitle:r().string.isRequired,name:r().string.isRequired,uiName:r().string.isRequired})).isRequired,updateTab:r().func.isRequired,isMobileView:r().bool.isRequired});const h=(0,n.connect)((function(e){return{isMobileView:(0,a.E7)(e)}}))(m)}}]);
//# sourceMappingURL=5215.7381e5810fd574a6a946.js.map