text: (this.webpackJsonpapp1=this.webpackJsonpapp1||[]).push([[0],{196:function(e,t,a){e.exports=a(385)},201:function(e,t,a){},202:function(e,t,a){},385:function(e,t,a){"use strict";a.r(t);var n=a(1),l=a.n(n),r=a(61),c=a.n(r),i=(a(201),a(202),a(93)),s=a(94),o=a.n(s),u=a(153),m=a(32),h=a(33),d=a(25),f=a(38),E=a(39),p=a(22),b=a(387),v=a(388),y=a(389),g=a(42),w=a(26),O=a(166),j=function(e){Object(E.a)(a,e);var t=Object(f.a)(a);function a(e){var n;return Object(m.a)(this,a),(n=t.call(this,e)).callApi=Object(u.a)(o.a.mark((function e(){var t,a,l,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t="/api/hello?",a=0;a<2;a++)t+="switch"+a+"="+n.state["switch"+a]+"&",t+="start"+a+"="+n.state["start"+a]+"&",t+="end"+a+"="+n.state["end"+a]+"&",t+="eff"+a+"="+n.state["eff"+a]+"&";return t=t.substring(0,t.length-1),e.next=5,fetch(t);case 5:return l=e.sent,e.next=8,l.json();case 8:if(r=e.sent,200===l.status){e.next=11;break}throw Error(r.message);case 11:return e.abrupt("return",r);case 12:case"end":return e.stop()}}),e)}))),n.state={response:"",data:[{name:1,uv:0}],switch0:!1,start0:10,end0:40,eff0:70,switch1:!1,start1:10,end1:40,eff1:70},n.handleChange=n.handleChange.bind(Object(d.a)(n)),n.handleSwitch=n.handleSwitch.bind(Object(d.a)(n)),n.askModel=n.askModel.bind(Object(d.a)(n)),n.createData=n.createData.bind(Object(d.a)(n)),n}return Object(h.a)(a,[{key:"askModel",value:function(){var e=this;this.callApi().then((function(t){return e.setState({response:e.createData(t.express)})})).catch((function(e){return console.log(e)}))}},{key:"handleChange",value:function(e){this.setState(Object.assign({},this.state,Object(i.a)({},e.target.name,e.target.value)))}},{key:"handleSwitch",value:function(e){this.setState(Object.assign({},this.state,Object(i.a)({},e.target.name,!this.state[e.target.name])))}},{key:"createData",value:function(e){for(var t=e.trim(),a=t.substring(1,t.length-1).split(" "),n=[],l=0;l<a.length;l++)n.push({name:l,uv:parseFloat(a[l].trim(","))});return this.setState(Object.assign({},this.state,{data:n})),this.state.response}},{key:"render",value:function(){var e=this,t=["Self Quarantine","Social Distancing"],a=t.map((function(a){return l.a.createElement(b.a,null,l.a.createElement(w.a,{style:(window.innerWidth,{height:300})},l.a.createElement(w.a.Body,null,l.a.createElement(w.a.Title,null,a),l.a.createElement("div",null,l.a.createElement("input",{type:"checkbox",name:"switch"+t.indexOf(a),onChange:e.handleSwitch})),l.a.createElement("div",null,e.state["switch"+t.indexOf(a)]?l.a.createElement(p.a,null,l.a.createElement(p.a.Label,null,"Start Date (from 0 to 360)"),l.a.createElement(p.a.Control,{type:"text",value:e.state["start"+t.indexOf(a)],name:"start"+t.indexOf(a),onChange:e.handleChange,placeholder:"Start"}),l.a.createElement(p.a.Label,null,"End Date (from 0 to 360)"),l.a.createElement(p.a.Control,{type:"text",value:e.state["end"+t.indexOf(a)],name:"end"+t.indexOf(a),onChange:e.handleChange,placeholder:"End"}),l.a.createElement(p.a.Label,null,"Effectivness (from 0 to 100 %)"),l.a.createElement(p.a.Control,{type:"text",value:e.state["eff"+t.indexOf(a)],name:"eff"+t.indexOf(a),onChange:e.handleChange,placeholder:"Effectivness"})):null))))})),n=l.a.createElement(g.c,{width:window.innerWidth/1.4,height:300,data:this.state.data},l.a.createElement(g.b,{type:"monotone",dataKey:"uv",stroke:"#8884d8"}),l.a.createElement(g.a,{stroke:"#ccc"}),l.a.createElement(g.d,{dataKey:"name"}),l.a.createElement(g.e,null)),r=l.a.createElement(v.a,{style:(window.innerWidth,{height:50})});return l.a.createElement(v.a,null,r,l.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.a.createElement("h1",null,"Covid19 Pandemic Simulator"),l.a.createElement("h2",null,this.state.response)),r,l.a.createElement(y.a,null,a),r,l.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.a.createElement(O.a,{size:"lg",variant:"outline-primary",onClick:this.askModel},"Run Model")," "),r,l.a.createElement(v.a,null,l.a.createElement(y.a,null,l.a.createElement(b.a,null,l.a.createElement(w.a,{style:{width:window.innerWidth/1.2}},l.a.createElement(w.a.Body,null,l.a.createElement(w.a.Title,null,"Infected asymtomatic"),n))))))}}]),a}(n.Component),x=function(e){Object(E.a)(a,e);var t=Object(f.a)(a);function a(){return Object(m.a)(this,a),t.apply(this,arguments)}return Object(h.a)(a,[{key:"render",value:function(){var e=l.a.createElement(v.a,{style:(window.innerWidth,{height:50})});return l.a.createElement(v.a,null,e,l.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.a.createElement("h1",null,"Covid19 Pandemic Simulator")),e,l.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.a.createElement("h2",null,"Test the full model yourself")),l.a.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.a.createElement("h2",null,"https://github.com/kaetze66/coronamodel")))}}]),a}(n.Component),C=a(390),k=a(391),S=a(392),D=a(393),W=a(394),M=function(e){Object(E.a)(a,e);var t=Object(f.a)(a);function a(){return Object(m.a)(this,a),t.apply(this,arguments)}return Object(h.a)(a,[{key:"render",value:function(){return l.a.createElement("div",null,l.a.createElement(C.a,{className:"navbar-light bg-light",expand:"md"},l.a.createElement(k.a,{href:"/"},"Covid19 Pandemic Simulator"),l.a.createElement(S.a,{className:"ml-auto",navbar:!0},l.a.createElement(D.a,null,l.a.createElement(W.a,{href:"/"},"Home")),l.a.createElement(D.a,null,l.a.createElement(W.a,{href:"/about"},"About")))))}}]),a}(n.Component),B=a(43);var N=function(){return l.a.createElement("div",null,l.a.createElement(M,null),l.a.createElement(B.a,null,l.a.createElement(B.c,null,l.a.createElement(B.b,{path:"/",exact:!0,component:j}),l.a.createElement(B.b,{path:"/about",exact:!0,component:x}),l.a.createElement(B.b,{path:"*",component:function(){return"404 NOT FOUND"}}))))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));a(384);c.a.render(l.a.createElement(l.a.StrictMode,null,l.a.createElement(N,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[196,1,2]]]);
  //# sourceMappingURL=main.f71873fa.chunk.js.map