(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{17:function(e,t,o){e.exports={poButton:"style_poButton__3x8Ka"}},18:function(e,t,o){e.exports=o(26)},26:function(e,t,o){"use strict";o.r(t);var n=o(8),s=o.n(n),r=o(15),i=o.n(r),a=o(6),l=o(0),p=o(1),c=o(2),u=o(3),d=o(13),f=o(17),m=o.n(f),g=function(e){Object(c.a)(o,e);var t=Object(u.a)(o);function o(e){var n;Object(l.a)(this,o),(n=t.call(this,e)).render=function(){return s.a.createElement("span",null,s.a.createElement("button",{className:m.a.poButton,onClick:n._onClicked,disabled:n.props.disabled,onFocus:n._onFocus,onBlur:n._onBlur},s.a.createElement("span",null,s.a.createElement("img",{style:{margin:"0px 3px 2px 0px"},src:"./img/pollination.png",alt:"logo"})),"Get ",n.state.isPollinationModel?"Pollination Model":"Geometry",Boolean(n.props.args.syncToken)&&" (Sync)"))},n._setStateNow=function(e){n.setState((function(t){return Object(a.a)(Object(a.a)({},t),{},{geometry:e.geometry,identifier:e.identifier,isPollinationModel:e.isPollinationModel,syncToken:e.syncToken,platform:e.platform})}),(function(){return d.a.setComponentValue(n.state.geometry)})),console.log("[POLLINATION-DEBUG]: JSON string sent.")},n._rubyRun=function(){if("undefined"!=typeof window.parent.sketchup){var e=null;return n.props.args.isPollinationModel?(window.parent.sketchup.get_model(),null==(e=window.parent.sketchup.hb_model)?n.state:(console.log(e),{geometry:e.Geometry,identifier:e.Identifier,isPollinationModel:n.props.args.isPollinationModel,syncToken:n.props.args.syncToken,platform:n.props.args.platform})):(console.log("[POLLINATION-DEBUG]: sketchup geometry only not supported."),n.state)}return console.log("[POLLINATION-DEBUG]: sketchup not found."),n.state},n._dotNetRun=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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=null;if(null==(t=n.props.args.isPollinationModel?window.parent.chrome.webview.hostObjects.sync.hbjson.PassPollinationModel(e):window.parent.chrome.webview.hostObjects.sync.geometry.PassJsonGeometry(n.props.args.key,e)))return n.state;var o={geometry:t.Geometry,identifier:t.Identifier,isPollinationModel:n.props.args.isPollinationModel,syncToken:n.props.args.syncToken,platform:n.props.args.platform};return o}return console.log("[POLLINATION-DEBUG]: chrome not found."),n.state},n._onClicked=function(){var e=n.props.args.platform,t={platform:e};"Rhino"==e?t=n._dotNetRun(!0):"Sketchup"==e&&(t=n._rubyRun()),n._setStateNow(t)},n._onFocus=function(){n.setState({isFocused:!0})},n._onBlur=function(){n.setState({isFocused:!1})};var r={geometry:"",identifier:"",isPollinationModel:n.props.args.isPollinationModel,platform:n.props.args.platform};return n.state=Object(a.a)({},r),n}return Object(p.a)(o,[{key:"componentDidUpdate",value:function(){if(""!==this.state.identifier&&this.props.args.syncToken!==this.state.syncToken){var e=JSON.parse(this.state.identifier);if(e){var t=this.props.args.syncToken.split(":",1)[0];if(e.includes(t)&&this.state.syncToken!==this.props.args.syncToken){var o={};"Rhino"==this.state.platform&&(o=this._dotNetRun()),this._setStateNow(o),console.log("[POLLINATION-DEBUG]: auto-update.")}}}}}]),o}(d.b),y=Object(d.c)(g);i.a.render(s.a.createElement(s.a.StrictMode,null,s.a.createElement(y,null)),document.getElementById("root"))}},[[18,1,2]]]);
//# sourceMappingURL=main.719c821c.chunk.js.map