"use strict";var u=Object.create;var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var P=Object.getPrototypeOf;var f=Object.prototype.hasOwnProperty;var v=(e,t)=>r(e,"name",{value:t,configurable:true});var _=(e,t)=>{for(var s in t)r(e,s,{get:t[s],enumerable:true})};var b=(e,t,s,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let a of I(t))if(!f.call(e,a)&&a!==s)r(e,a,{get:()=>t[a],enumerable:!(n=d(t,a))||n.enumerable})}return e};var k=(e,t,s)=>(s=e!=null?u(P(e)):{},b(t||!e||!e.__esModule?r(s,"default",{value:e,enumerable:true}):s,e));var x=e=>b(r({},"__esModule",{value:true}),e);var y=(e,t,s,n)=>{var a=n>1?void 0:n?d(t,s):t;for(var l=e.length-1,m;l>=0;l--)if(m=e[l])a=(n?m(t,s,a):m(a))||a;if(n&&a)r(t,s,a);return a};var E={};_(E,{default:()=>R});module.exports=x(E);var i=require("react/jsx-runtime");var p=k(require("classnames"));var h=require("mobx-react");var c=require("react");let o=class extends c.Component{constructor(t){super(t);this.state={active:this.props.active||0}}switchTab(t){this.setState({active:t})}render(){const{children:t}=this.props;const s=c.Children.toArray(t);if(s.length===1){return(0,i.jsx)("div",{children:s})}return(0,i.jsxs)("div",{className:"content-tabs",children:[(0,i.jsx)("div",{className:"content-tabs__tabs",children:c.Children.map(s,(n,a)=>(0,i.jsx)("button",{className:(0,p.default)({"content-tabs__item":true,"is-active":this.state.active===a}),onClick:()=>this.switchTab(a),type:"button",children:n.props.title},a))}),(0,i.jsx)("div",{className:"content-tabs__content",children:c.Children.map(s,(n,a)=>(0,i.jsx)("div",{className:(0,p.default)({"content-tabs__item":true,"is-active":this.state.active===a}),children:n},a))})]})}};v(o,"Tab");o=y([h.observer],o);var R=o;
