(this.webpackJsonpfrontend=this.webpackJsonpfrontend||[]).push([[0],{70:function(e,t,a){e.exports=a(97)},75:function(e,t,a){},93:function(e,t,a){},97:function(e,t,a){"use strict";a.r(t);var n=a(0),o=a.n(n),l=a(8),r=a.n(l),c=(a(75),a(149)),s=a(148),i=a(44),u=a(61),m=Object(u.a)({palette:{primary:{main:"#556cd6"},secondary:{main:"#19857b"},error:{main:i.a.A400},background:{default:"#fff"}}}),p=a(15),d=a(12),h=a(19),f=a(20),k=a(24),b=a(16),g=a.n(b),E=a(4),v=a(135),S=a(63),y=(a(93),a(11)),C=a(150),j=a(151),O=a(138),P=function(e){function t(){var e,a;Object(p.a)(this,t);for(var n=arguments.length,o=new Array(n),l=0;l0},a}return Object(k.a)(t,e),Object(d.a)(t,[{key:"render",value:function(){return o.a.createElement(v.a,{className:this.props.classes.PalletProductionPaper},o.a.createElement(S.a,{color:"textSecondary",variant:"button",gutterBottom:!0},"Production"),o.a.createElement("form",null,o.a.createElement(O.a,{container:!0,direction:"row",justify:"flex-start",alignItems:"flex-end"},o.a.createElement(C.a,{style:{minWidth:"140px"},id:"cookie",select:!0,label:"Select Cookie",value:this.state.cookie,onChange:this.handleInputChange,name:"cookie",SelectProps:{native:!0}},o.a.createElement("option",{value:""}),this.props.cookies.map((function(e){return o.a.createElement("option",{key:e.name,value:e.name},e.name)}))),o.a.createElement(j.a,{style:{marginLeft:"10px"},variant:"contained",onClick:this.handleSubmit,disabled:!this.isFormValid()},"Produce pallet!"))))}}]),t}(n.Component),x=Object(E.a)((function(e){return{PalletProductionPaper:{padding:"10px",marginBottom:"15px"}}}))(P),w=function(e){function t(){var e,a;Object(p.a)(this,t);for(var n=arguments.length,o=new Array(n),l=0;l0})).forEach((function(a){return t[a]=e[a]})),g.a.get("pallets",{params:t}).then((function(e){console.log(e),e.data&&e.data.pallets?a.setState({pallets:e.data.pallets,palletStatus:e.data.pallets&&0!==e.data.pallets.length?"":"Pallet request success, but no pallets returned from API."}):a.setState({palletStatus:"Couldn't fetch pallets from REST server"})})).catch((function(e){console.log(e),a.setState({disconnected:!0})}))},a.setStatus=function(e){a.setState({status:e})},a.setPalletsFilter=function(e){a.setState({palletsFilter:e}),a.fetchPallets(e)},a.mainArea=function(){return o.a.createElement("div",null,o.a.createElement(x,{cookies:a.state.cookies,refresh:a.refresh,setStatus:a.setStatus}),o.a.createElement(B,{cookies:a.state.cookies,pallets:a.state.pallets,palletsFilter:a.setPalletsFilter}),o.a.createElement(q,{refresh:a.refresh,setStatus:a.setStatus}))},a}return Object(k.a)(t,e),Object(d.a)(t,[{key:"componentDidMount",value:function(){this.refresh()}},{key:"render",value:function(){var e=[this.state.cookieStatus,this.state.palletStatus].join(" - ");this.state.disconnected&&(e=o.a.createElement("b",null,"Disconnected. Couldn't connect to REST server (",g.a.defaults.baseURL,")"));var t=null;return this.state.disconnected||(t=this.mainArea()),o.a.createElement("div",{className:"App"},o.a.createElement(S.a,{variant:"h3",gutterBottom:!0},"Krusty"),o.a.createElement(v.a,{className:this.props.classes.StatusPaper},o.a.createElement("div",null,o.a.createElement("b",null,"Status:")," ",e)),t)}}]),t}(n.Component),U=Object(E.a)((function(e){return{StatusPaper:{padding:"10px",marginBottom:"15px"}}}))(J);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}$/));g.a.defaults.baseURL="/api/v1",r.a.render(o.a.createElement(s.a,{theme:m},o.a.createElement(c.a,null),o.a.createElement(U,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[70,1,2]]]); //# sourceMappingURL=main.4ee489f9.chunk.js.map