(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{13:function(e,t,o){e.exports={poCheckboxLabel:"style_poCheckboxLabel__2IHB4",poCheckboxSpan:"style_poCheckboxSpan__ltXcy",poCheckbox:"style_poCheckbox__3Q56z"}},18:function(e,t,o){e.exports=o(26)},26:function(e,t,o){"use strict";o.r(t);var n=o(8),a=o.n(n),s=o(16),i=o.n(s),l=o(6),r=o(0),c=o(1),d=o(2),p=o(3),u=o(14),b=o(13),h=o.n(b),g=function(e){Object(d.a)(o,e);var t=Object(p.a)(o);function o(e){var n;Object(r.a)(this,o),(n=t.call(this,e))._autoUpdate=function(e){setTimeout((function(){var e=n.state.isPollinationModel?"CombinedRenderingPollinationModel":"CombinedRendering",t=n._sendMessageTo(e);n._setStateNow(t,!0),console.log("[POLLINATION-DEBUG]: auto-update.")}),e)},n.render=function(){return a.a.createElement("label",{className:h.a.poCheckboxLabel},a.a.createElement("input",{className:h.a.poCheckbox,type:"checkbox",defaultChecked:n.state.defaultChecked,onChange:n._onChange,disabled:n.props.disabled,onFocus:n._onFocus,onBlur:n._onBlur}),a.a.createElement("span",{className:h.a.poCheckboxSpan},n.state.label))},n._setStateNow=function(e,t){n.setState((function(o){return Object(l.a)(Object(l.a)({},o),{},{action:e.action,data:e.data,uniqueId:e.uniqueId,options:e.options,isChecked:t})})),console.log("[POLLINATION-DEBUG]: JSON string sent.")},n._sendMessageTo=function(e){if("undefined"!=typeof window.parent.chrome){if("undefined"==typeof window.parent.chrome.webview)return console.log("[POLLINATION-DEBUG]: webview not found."),n.state;var t={action:e,data:n.props.args.data,uniqueId:n.props.args.uniqueId,options:n.props.args.options},o=JSON.stringify(t);return window.parent.chrome.webview.postMessage(o),t}return console.log("[POLLINATION-DEBUG]: chrome not found."),n.state},n._onChange=function(e){var t=e.target.checked,o=t?"DrawGeometry":"DisableDraw";n.state.isPollinationModel&&(o=t?"DrawPollinationModel":"DisableDrawPollinationModel");var a=n._sendMessageTo(o);n._setStateNow(a,t)},n._onFocus=function(){n.setState({isFocused:!0})},n._onBlur=function(){n.setState({isFocused:!1})};var s=n.props.args.data,i=n.props.args.uniqueId,c=n.props.args.defaultChecked,d=n.props.args.options,p=n.props.args.label,u=n.props.args.delay,b=n.props.args.isPollinationModel,g={action:"",data:s,uniqueId:i,defaultChecked:c,options:d,label:p,delay:u,isPollinationModel:b,isChecked:!!c};if(n.state=Object(l.a)({},g),c){var m=b?"CombinedRenderingPollinationModel":"CombinedRendering";n._sendMessageTo(m),n.setState({action:m})}return n}return Object(c.a)(o,[{key:"componentWillUnmount",value:function(){if(this.state.isChecked){var e=this.state.isPollinationModel?"CombinedRenderingPollinationModel":"CombinedRendering";this._sendMessageTo(e);console.log("[POLLINATION-DEBUG]: unmount.")}}},{key:"componentDidUpdate",value:function(){this.state.isChecked&&this.state.data!=this.props.args.data&&this._autoUpdate(this.state.delay)}}]),o}(u.a),m=Object(u.b)(g);i.a.render(a.a.createElement(a.a.StrictMode,null,a.a.createElement(m,null)),document.getElementById("root"))}},[[18,1,2]]]);
//# sourceMappingURL=main.59e9064c.chunk.js.map