(this.webpackJsonptab_bar=this.webpackJsonptab_bar||[]).push([[0],{13:function(e,t,s){"use strict";s.r(t);var a=s(0),l=s.n(a),c=s(3),n=s.n(c),r=s(4),i=s.n(r),o=s(1);class d extends o.b{constructor(e){super(e),this.state={numClicks:0,selectedId:1,list:[]},this.MenuItem=e=>{let{item:t,selectedId:s}=e;const a=s===t.id;return console.log("MenuItem ".concat(t.id,": selectedId=").concat(s,", item.id=").concat(t.id,", isActive=").concat(a)),l.a.createElement("div",{className:"menu-item ".concat(a?"active":""),onClick:()=>{console.log("MenuItem clicked:",t.id,t.title),this.onSelect(t.id)},style:{cursor:"pointer"}},l.a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"}},t.title.startsWith("material:")?l.a.createElement("span",{className:"material-icons",style:{marginRight:"4px"}},t.title.replace("material:","")):t.title),l.a.createElement("div",{style:{fontWeight:"normal",fontStyle:"italic"}},t.description))},this.Arrow=e=>{let{text:t,className:s}=e;return l.a.createElement("div",{className:s},t)},this.ArrowLeft=this.Arrow({text:"<",className:"arrow-prev"}),this.ArrowRight=this.Arrow({text:">",className:"arrow-next"}),this.render=()=>(console.log("TabBar render - current state:",this.state),l.a.createElement("div",null,l.a.createElement(i.a,{alignCenter:!1,data:this.Menu(this.state.list,this.state.selectedId),wheel:!0,scrollToSelected:!0,selected:"".concat(this.state.selectedId),onSelect:this.onSelect}))),this.onSelect=e=>{console.log("onSelect called with id:",e,"type:",typeof e),this.setState((t,s)=>(console.log("Setting state, new selectedId:",e),{selectedId:Number(e)}),()=>{console.log("State updated, sending to Streamlit:",e),o.a.setComponentValue(e)})},console.log("TabBar constructor - props:",e),console.log("TabBar constructor - args:",e.args),this.state.list=this.props.args.data,this.state.selectedId=Number(this.props.args.selectedId)||1,console.log("TabBar constructor - initial state:",this.state)}Menu(e,t){return e.map(e=>l.a.createElement(this.MenuItem,{item:e,selectedId:t,key:e.id}))}}var m=Object(o.c)(d);n.a.render(l.a.createElement(l.a.StrictMode,null,l.a.createElement(m,null)),document.getElementById("root"))},6:function(e,t,s){e.exports=s(13)}},[[6,1,2]]]);