(window.webpackJsonp=window.webpackJsonp||[]).push([["121j"],{og3G:function(e,t,n){"use strict";var a=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var a={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var o=s?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(a,r,o):a[r]=e[r]}a.default=e,n&&n.set(e,a);return a}(n("q1tI")),r=n("mR6N"),o=a(n("Taw3")),i=n("4PhQ");function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function l(e,t){if(!e.length)throw new i.KAError("TabbedPanel expects at least one tab.",i.Errors.Internal);const n=e.findIndex((e=>e.key===t));return n>=0?n:0}function b(e,t){return e[l(e,t)]}class c extends s.Component{constructor(e){super(e),this.state=this.getSelectedTabStateFromProps(),this.tabContentPanelRefs={}}componentDidUpdate(e,t){if(this.isControlledComponent()){const{key:t}=b(e.tabs,e.selectedTabKey),{key:n}=b(this.props.tabs,this.props.selectedTabKey);t!==n&&this.setState(this.getSelectedTabStateFromProps())}if(t.selectedTabIdentifier.index!==this.state.selectedTabIdentifier.index){const{tabContentId:e}=this.getTabIdentifiers(this.state.selectedTabIdentifier.index),t=this.tabContentPanelRefs[e];if(!t)throw new i.KAError(`Tab content not found: ${e}`,i.Errors.Internal);t.current.focus()}}getSelectedTabStateFromProps(){const{key:e}=b(this.props.tabs,this.props.selectedTabKey);return{selectedTabIdentifier:{tabKey:e,index:l(this.props.tabs,this.props.selectedTabKey)}}}isControlledComponent(){return!!this.props.onTabChanged}onTabClick(e){const t=this.props.tabs[e].key;if(e!==this.state.selectedTabIdentifier.index)if(this.isControlledComponent()){if(!this.props.onTabChanged)throw new i.KAError("TabbedPanel is controlled but this.props.onTabChanged is not present. Something is wrong.",i.Errors.Internal);this.props.onTabChanged(t)}else this.setState({selectedTabIdentifier:{tabKey:t,index:e}})}getTabIdentifiers(e){const{id:t}=this.props;return{tabId:`ka-${t}-tabbedpanel-tab-${e}`,tabContentId:`ka-${t}-tabbedpanel-content`}}renderTab(e,t,...n){const{tabId:a,tabContentId:i}=this.getTabIdentifiers(t),d=e.key===this.state.selectedTabIdentifier.tabKey,l=d?"true":"false",{tabHeader:b,isTabDisabled:c}=e.renderTab(d,{id:a+"-inner"});return s.createElement(o.default,{"aria-controls":i,"aria-expanded":l,"aria-selected":l,className:r.css.apply(void 0,n),disabled:c,id:a,onClick:()=>this.onTabClick(t),role:"tab",testId:e.key},(()=>b))}renderTabs(e,t,...n){const{tabs:a}=this.props;return s.createElement("nav",{key:"tablist",className:(0,r.css)(p.tabsNav)},s.createElement("div",{role:"tablist",className:(0,r.css)(p.tablist,e)},a.map(((e,a)=>s.createElement("span",{key:e.key,className:(0,r.css)(p.tab,t)},this.renderTab(e,a,n))))))}renderTabContentPanel(...e){const{tabs:t}=this.props,{tabContentId:n}=this.getTabIdentifiers(this.state.selectedTabIdentifier.index);return this.tabContentPanelRefs[n]=s.createRef(),s.createElement("div",{id:n,key:n,ref:this.tabContentPanelRefs[n],className:r.css.apply(void 0,[p.tabContent].concat(e)),tabIndex:"0",role:"tabpanel"},t[this.state.selectedTabIdentifier.index].renderContent())}render(){const{children:e,orientation:t}=this.props;return s.createElement("div",{style:{height:"100%"},className:(0,r.css)("horizontal"===t&&p.horizontal)},e(((e,t,n)=>this.renderTabs(e,t,n)),(e=>this.renderTabContentPanel(e))))}}c.defaultProps={orientation:"vertical"};const p=r.StyleSheet.create({tabsNav:{width:"auto"},tablist:{flex:"0 0 auto",display:"flex"},tab:{flex:"0 0 auto",display:"flex"},tabContent:{flex:"1 1 auto",overflow:"auto"},collapsedTabContent:{display:"none"},horizontal:{display:"flex",flex:"1 1 0",overflow:"hidden"}});var f=c;t.default=f}}]);
//# sourceMappingURL=../../sourcemaps/en/121j.34af7ca6b91ade8f473e.js.map