text: (this["webpackJsonpstreamlit-browser"]=this["webpackJsonpstreamlit-browser"]||[]).push([[23],{2784:function(e,t,n){"use strict";n(0);var r,o=n(43),i=n(136),a=n(11),u=n(187),c=n(13),s=n.n(c),l=n(92),p=Object(l.keyframes)(r||(r=Object(u.a)(["\n  50% {\n    color: rgba(0, 0, 0, 0);\n  }\n"]))),f=s()("span",{target:"e1m4n6jn0"})((function(e){var t=e.includeDot,n=e.shouldBlink,r=e.theme;return Object(a.a)(Object(a.a)({},t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:r.colors.gray,margin:"0 5px"}}:{}),n?{color:r.colors.red,animationName:"".concat(p),animationDuration:"0.5s",animationIterationCount:5}:{})}),""),d=n(5);t.a=function(e){var t=e.dirty,n=e.value,r=e.maxLength,a=e.className,u=e.type,c=[],s=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c.push(Object(d.jsx)(f,{includeDot:c.length>0,shouldBlink:t,children:e},c.length))};return t&&("multiline"===(void 0===u?"single":u)?Object(o.f)()?s("Press \u2318+Enter to apply"):s("Press Ctrl+Enter to apply"):s("Press Enter to apply")),r&&s("".concat(n.length,"/").concat(r),t&&n.length>=r),Object(d.jsx)(i.a,{className:a,children:c})}},3850:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return A}));var r=n(6),o=n(9),i=n(7),a=n(8),u=n(0),c=n.n(u),s=n(232),l=n(17),p=n(2921),f=n(90),d=n(28),b=n(2744);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=Object(d.a)("div",(function(e){return Object(b.j)(m({},e,{$hasIconTrailing:!1}))}));v.displayName="StyledTextAreaRoot";var g=Object(d.a)("div",(function(e){return m({},Object(b.h)(e))}));g.displayName="StyledTextareaContainer";var j=Object(d.a)("textarea",(function(e){return m({},Object(b.i)(e),{resize:"none"})}));function O(e){return(O="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(){return(w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(c){o=!0,i=c}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function C(e,t){return!t||"object"!==O(t)&&"function"!==typeof t?k(e):t}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}j.displayName="StyledTextarea";var V=function(e){function t(){var e,n;x(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return E(k(n=C(this,(e=F(t)).call.apply(e,[this].concat(o)))),"state",{isFocused:n.props.autoFocus||!1}),E(k(n),"onFocus",(function(e){n.setState({isFocused:!0}),n.props.onFocus(e)})),E(k(n),"onBlur",(function(e){n.setState({isFocused:!1}),n.props.onBlur(e)})),n}var n,r,o;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,n=P(Object(l.c)(t.Root,v),2),r=n[0],o=n[1],i=Object(l.e)({Input:{component:j},InputContainer:{component:g}},t);return u.createElement(r,w({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required},o),u.createElement(p.a,w({},this.props,{type:f.b.textarea,overrides:i,onFocus:this.onFocus,onBlur:this.onBlur})))}}])&&S(n.prototype,r),o&&S(n,o),t}(u.Component);E(V,"defaultProps",{autoFocus:!1,disabled:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:f.d.default,value:""});var U=V,B=n(2784),K=n(136),T=n(137),_=n(70),I=n(43),W=n(5),A=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){var e;Object(r.a)(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return(e=t.call.apply(t,[this].concat(i))).formClearHelper=new s.b,e.state={dirty:!1,value:e.initialValue},e.commitWidgetValue=function(t){e.props.widgetMgr.setStringValue(e.props.element,e.state.value,t),e.setState({dirty:!1})},e.onFormCleared=function(){e.setState({value:e.props.element.default},(function(){return e.commitWidgetValue({fromUi:!0})}))},e.onBlur=function(){e.state.dirty&&e.commitWidgetValue({fromUi:!0})},e.onChange=function(t){var n=t.target.value,r=e.props.element.maxChars;0!==r&&n.length>r||(Object(I.h)(e.props.element)?e.setState({dirty:!1,value:n},(function(){return e.commitWidgetValue({fromUi:!0})})):e.setState({dirty:!0,value:n}))},e.isEnterKeyPressed=function(e){var t=e.keyCode;return"Enter"===e.key||13===t||10===t},e.onKeyDown=function(t){var n=t.metaKey,r=t.ctrlKey,o=e.state.dirty;e.isEnterKeyPressed(t)&&(r||n)&&o&&(t.preventDefault(),e.commitWidgetValue({fromUi:!0}))},e.render=function(){var t=e.props,n=t.element,r=t.disabled,o=t.width,i=t.widgetMgr,a=e.state,u=a.value,c=a.dirty,s={width:o},l=n.height;return e.formClearHelper.manageFormClearListener(i,n.formId,e.onFormCleared),Object(W.jsxs)("div",{className:"stTextArea",style:s,children:[Object(W.jsxs)(K.b,{children:[n.label,n.help&&Object(W.jsx)(K.c,{children:Object(W.jsx)(T.a,{content:n.help,placement:_.a.TOP_RIGHT})})]}),Object(W.jsx)(U,{value:u,onBlur:e.onBlur,onChange:e.onChange,onKeyDown:e.onKeyDown,disabled:r,overrides:{Input:{style:{height:l?"".concat(l,"px"):"",minHeight:"95px",resize:l?"vertical":"none"}}}}),Object(W.jsx)(B.a,{dirty:c,value:u,maxLength:n.maxChars,type:"multiline"})]})},e}return Object(o.a)(n,[{key:"initialValue",get:function(){var e=this.props.widgetMgr.getStringValue(this.props.element);return void 0!==e?e:this.props.element.default}},{key:"componentDidMount",value:function(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}},{key:"componentDidUpdate",value:function(){this.maybeUpdateFromProtobuf()}},{key:"componentWillUnmount",value:function(){this.formClearHelper.disconnect()}},{key:"maybeUpdateFromProtobuf",value:function(){this.props.element.setValue&&this.updateFromProtobuf()}},{key:"updateFromProtobuf",value:function(){var e=this,t=this.props.element.value;this.props.element.setValue=!1,this.setState({value:t},(function(){e.commitWidgetValue({fromUi:!1})}))}}]),n}(c.a.PureComponent)}}]);