(this.webpackJsonpstreamlit_component_template=this.webpackJsonpstreamlit_component_template||[]).push([[0],{17:function(t,e,o){t.exports={poButton:"style_poButton__3x8Ka"}},18:function(t,e,o){t.exports=o(26)},26:function(t,e,o){"use strict";o.r(e);var n,a=o(8),r=o.n(a),s=o(15),i=o.n(s),p=o(6),u=o(0),c=o(1),l=o(2),d=o(3),m=o(13),f=o(17),g=o.n(f);!function(t){t[t.sketchup=0]="sketchup",t[t.rhino=1]="rhino",t[t.revit=2]="revit"}(n||(n={}));var w=function(t){Object(l.a)(o,t);var e=Object(d.a)(o);function o(t){var a;Object(c.a)(this,o),(a=e.call(this,t)).render=function(){var t={BakeGeometry:"Bake Geometry",ClearGeometry:"Clear Geometry",DrawGeometry:"Draw Geometry",DisableDraw:"Disable Draw",BakePollinationModel:"Bake Pollination Model",SaveResults:"Save Results"};return r.a.createElement("span",null,a.props.args.action in t&&r.a.createElement("button",{className:g.a.poButton,onClick:a._onClicked,disabled:a.props.disabled,onFocus:a._onFocus,onBlur:a._onBlur},r.a.createElement("span",null,r.a.createElement("img",{style:{margin:"0px 3px 2px 0px"},src:"./img/pollination.png",alt:"logo"})),t[a.props.args.action]))},a._onClicked=function(){var t=a.props.args.platform,e={platform:t.toLowerCase()};t.toLowerCase()==n[n.rhino]||t.toLowerCase()==n[n.revit]?e=a._dotNetRun():t.toLowerCase()==n[n.sketchup]&&(e=a._rubyRun()),a._setStateNow(e)},a._rubyRun=function(){if("undefined"!=typeof window.parent.sketchup){var t={action:a.props.args.action,data:a.props.args.data,uniqueId:a.props.args.uniqueId,options:a.props.args.options},e=JSON.stringify(t);window.parent.sketchup.send_geometry(e);var o=a.props.args.platform,n={action:t.action,data:t.data,uniqueId:t.uniqueId,options:t.options,platform:o.toLowerCase()};return console.log("[POLLINATION-DEBUG]: JSON string sent."),n}return console.log("[POLLINATION-DEBUG]: sketchup not found."),a.state},a._dotNetRun=function(){if("undefined"!=typeof window.parent.chrome){if("undefined"==typeof window.parent.chrome.webview)return console.log("[POLLINATION-DEBUG]: webview not found."),a.state;var t={action:a.props.args.action,data:a.props.args.data,uniqueId:a.props.args.uniqueId,options:a.props.args.options},e=JSON.stringify(t);window.parent.chrome.webview.postMessage(e);var o=a.props.args.platform,n={action:t.action,data:t.data,uniqueId:t.uniqueId,options:t.options,platform:o.toLowerCase()};return console.log("[POLLINATION-DEBUG]: JSON string sent."),n}return console.log("[POLLINATION-DEBUG]: chrome not found."),a.state},a._setStateNow=function(t){a.setState((function(e){return Object(p.a)(Object(p.a)({},e),{},{action:t.action,data:t.data,uniqueId:t.uniqueId,options:t.options})}),(function(){return m.a.setComponentValue(a.state.action)}))},a._onFocus=function(){a.setState({isFocused:!0})},a._onBlur=function(){a.setState({isFocused:!1})};var s={action:a.props.args.action,data:a.props.args.data,uniqueId:a.props.args.uniqueId,options:a.props.args.options,platform:a.props.args.platform.toLowerCase()};return a.state=Object(p.a)({},s),a}return Object(u.a)(o)}(m.b),I=Object(m.c)(w);i.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(I,null)),document.getElementById("root"))}},[[18,1,2]]]);
//# sourceMappingURL=main.cea260d2.chunk.js.map