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