(window["webpackJsonpstreamlit-browser"]=window["webpackJsonpstreamlit-browser"]||[]).push([[39],{2212:function(e,t,a){"use strict";a.r(t);var n=a(5),r=a(10),o=a(13),l=a(11),i=a(12),s=a(0),u=a.n(s),c=a(1230),p=a(139),v=a(1169),d=function(e){function t(){var e,a;Object(n.a)(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return(a=Object(o.a)(this,(e=Object(l.a)(t)).call.apply(e,[this].concat(i)))).state={value:a.props.element.get("default").toArray()},a.setWidgetValue=function(e){var t=a.props.element.get("id");a.props.widgetMgr.setIntArrayValue(t,a.state.value,e)},a.onChange=function(e){var t=a.generateNewState(e);a.setState(t,function(){return a.setWidgetValue({fromUi:!0})})},a}return Object(i.a)(t,e),Object(r.a)(t,[{key:"componentDidMount",value:function(){this.setWidgetValue({fromUi:!1})}},{key:"generateNewState",value:function(e){var t=function(){var t=e.option.value;return parseInt(t,10)};switch(e.type){case"remove":return{value:c.without(this.state.value,t())};case"clear":return{value:[]};case"select":return{value:this.state.value.concat([t()])};default:throw new Error("State transition is unkonwn: {data.type}")}}},{key:"render",value:function(){var e=this.props,t=e.element,a={width:e.width},n=t.get("label"),r=t.get("options"),o=0===r.size||this.props.disabled,l=0===r.size?"No options to select.":"Choose an option",i=r.map(function(e,t){return{label:e,value:t.toString()}}).toArray();return u.a.createElement("div",{className:"Widget row-widget stMultiSelect",style:a},u.a.createElement("label",null,n),u.a.createElement(v.Select,{options:i,labelKey:"label",valueKey:"value",placeholder:l,type:v.TYPE.search,multi:!0,onChange:this.onChange,value:this.valueFromState,disabled:o,overrides:p.f}))}},{key:"valueFromState",get:function(){var e=this;return this.state.value.map(function(t){var a=e.props.element.get("options").get(t);return{value:t.toString(),label:a}})}}]),t}(u.a.PureComponent);a.d(t,"default",function(){return d})}}]);
//# sourceMappingURL=39.a320ba0e.chunk.js.map