(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],[,,,,,,,,function(e,t,n){e.exports=n(16)},,,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),o=n(7),l=n.n(o),c=(n(13),n(1)),i=n(2),u=n(5),s=n(4),m=n(3),p=function(e){Object(s.a)(n,e);var t=Object(m.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"search",value:function(){var e=document.querySelector("#select");fetch("http://localhost:80/api/generation/"+e.value).then((function(e){return e.json()})).then((function(e){var t=document.querySelector("#reportingArea");e.error?t.innerHTML=e.error:e.map((function(e,n){0===n?t.innerHTML=e.name:t.innerHTML+="<br>"+e.name}))}))}},{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement("h1",null,"Search By Generation/Region"),r.a.createElement("select",{id:"select",onChange:this.search},r.a.createElement("option",{value:""}),r.a.createElement("option",{value:"1"},"(1)Kanto"),r.a.createElement("option",{value:"2"},"(2)Johto"),r.a.createElement("option",{value:"3"},"(3)Hoenn"),r.a.createElement("option",{value:"4"},"(4)Sinnoh"),r.a.createElement("option",{value:"5"},"(5)Unova"),r.a.createElement("option",{value:"6"},"(6)Kalos"),r.a.createElement("option",{value:"7"},"(7)Alola"),r.a.createElement("option",{value:"8"},"(8)Galar")))}}]),n}(r.a.Component),h=function(e){Object(s.a)(n,e);var t=Object(m.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"nameSearch",value:function(){var e=document.querySelector("#name"),t=(e=e.value.toLowerCase()).slice(1);e=e[0].toUpperCase()+t,fetch("http://localhost:80/api/name/"+e).then((function(e){return e.json()})).then((function(e){var t=document.querySelector("#reportingArea");e.error?t.innerHTML=e.error:(t.innerHTML="<strong>ID:</strong> "+e[0].id+"<br><strong>Name:</strong>"+e[0].name+"<br><strong>Type(s):</strong> "+e[0].type+"<br><strong>Abilities:</strong><br>",e[0].ability.map((function(e){!0===e.hidden?t.innerHTML+="<em>Hidden:</em><br> "+e.name+"<br>":t.innerHTML+=e.name+"<br>"})),t.innerHTML+="<strong>Egg Group(s):</strong> "+e[0].eggGroup+"<br><strong>Base Stats:</strong><br>Health: "+e[0].baseStats.H+"<br>Attack: "+e[0].baseStats.A+"<br>Defense: "+e[0].baseStats.B+"<br>Special Attack: "+e[0].baseStats.C+"<br>Special Defense: "+e[0].baseStats.D+"<br>Speed: "+e[0].baseStats.S+"<br>")}))}},{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement("h1",null,"Search By Name"),r.a.createElement("label",{htmlFor:"name"},"Pokemon Name: "),r.a.createElement("input",{type:"text",id:"name",name:"name"}),r.a.createElement("button",{value:"submit",onClick:this.nameSearch},"Search"))}}]),n}(r.a.Component),v=function(e){Object(s.a)(n,e);var t=Object(m.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"idSearch",value:function(){var e=document.querySelector("#id");fetch("http://localhost:80/api/id/"+e.value).then((function(e){return e.json()})).then((function(e){var t=document.querySelector("#reportingArea");e.error?t.innerHTML=e.error:(t.innerHTML="<strong>ID:</strong> "+e[0].id+"<br><strong>Name:</strong>"+e[0].name+"<br><strong>Type(s):</strong> "+e[0].type+"<br><strong>Abilities:</strong><br>",e[0].ability.map((function(e){!0===e.hidden?t.innerHTML+="<em>Hidden:</em><br> "+e.name+"<br>":t.innerHTML+=e.name+"<br>"})),t.innerHTML+="<strong>Egg Group(s):</strong> "+e[0].eggGroup+"<br><strong>Base Stats:</strong><br>Health: "+e[0].baseStats.H+"<br>Attack: "+e[0].baseStats.A+"<br>Defense: "+e[0].baseStats.B+"<br>Special Attack: "+e[0].baseStats.C+"<br>Special Defense: "+e[0].baseStats.D+"<br>Speed: "+e[0].baseStats.S+"<br>")}))}},{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement("h1",null,"Search By ID"),r.a.createElement("label",{htmlFor:"id"},"Pokemon Id #: "),r.a.createElement("input",{type:"number",id:"id",name:"id"}),r.a.createElement("button",{value:"submit",onClick:this.idSearch},"Search"))}}]),n}(r.a.Component),b=function(e){Object(s.a)(n,e);var t=Object(m.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"typeSearch",value:function(){var e=document.querySelector("#type"),t=document.querySelector("#type2");""===t.value?fetch("http://localhost:80/api/type/"+e.value).then((function(e){return e.json()})).then((function(t){var n=document.querySelector("#reportingArea");n.setAttribute("class",e.value),t.error?n.innerHTML=t.error:t.sort((function(e,t){return e.id-t.id})).map((function(e,t){0===t?n.innerHTML=e.name:e.formName?n.innerHTML+="<br>"+e.name+"("+e.formName+")":n.innerHTML+="<br>"+e.name}))})):fetch("http://localhost:80/api/type/"+e.value+"/type2/"+t.value).then((function(e){return e.json()})).then((function(n){var a=document.querySelector("#reportingArea");a.setAttribute("class",e.value+"/"+t.value),n.error?a.innerHTML=n.error:n.sort((function(e,t){return e.id-t.id})).map((function(e,t){0===t?a.innerHTML=e.name:e.formName?a.innerHTML+="<br>"+e.name+"("+e.formName+")":a.innerHTML+="<br>"+e.name}))}))}},{key:"toggle",value:function(e){var t=document.querySelector("#type2");!0===e.target.checked?t.setAttribute("disabled",!0):t.removeAttribute("disabled")}},{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement("h1",null,"Search By Type"),r.a.createElement("label",{className:"switch"},"Types",r.a.createElement("input",{type:"checkbox",onClick:this.toggle}),r.a.createElement("span",{className:"slider round"})),r.a.createElement("select",{id:"type",onChange:this.typeSearch},r.a.createElement("option",{value:""}),r.a.createElement("option",{value:"Fire"},"Fire"),r.a.createElement("option",{value:"Water"},"Water"),r.a.createElement("option",{value:"Grass"},"Grass"),r.a.createElement("option",{value:"Electric"},"Electric"),r.a.createElement("option",{value:"Ice"},"Ice"),r.a.createElement("option",{value:"Steel"},"Steel"),r.a.createElement("option",{value:"Rock"},"Rock"),r.a.createElement("option",{value:"Ground"},"Ground"),r.a.createElement("option",{value:"Ghost"},"Ghost"),r.a.createElement("option",{value:"Psychic"},"Psychic"),r.a.createElement("option",{value:"Dark"},"Dark"),r.a.createElement("option",{value:"Bug"},"Bug"),r.a.createElement("option",{value:"Fighting"},"Fighting"),r.a.createElement("option",{value:"Normal"},"Normal"),r.a.createElement("option",{value:"Dragon"},"Dragon"),r.a.createElement("option",{value:"Flying"},"Flying"),r.a.createElement("option",{value:"Fairy"},"Fairy"),r.a.createElement("option",{value:"Poison"},"Poison")),r.a.createElement("select",{id:"type2",onChange:this.typeSearch},r.a.createElement("option",{value:""}),r.a.createElement("option",{value:"Fire"},"Fire"),r.a.createElement("option",{value:"Water"},"Water"),r.a.createElement("option",{value:"Grass"},"Grass"),r.a.createElement("option",{value:"Electric"},"Electric"),r.a.createElement("option",{value:"Ice"},"Ice"),r.a.createElement("option",{value:"Steel"},"Steel"),r.a.createElement("option",{value:"Rock"},"Rock"),r.a.createElement("option",{value:"Ground"},"Ground"),r.a.createElement("option",{value:"Ghost"},"Ghost"),r.a.createElement("option",{value:"Psychic"},"Psychic"),r.a.createElement("option",{value:"Dark"},"Dark"),r.a.createElement("option",{value:"Bug"},"Bug"),r.a.createElement("option",{value:"Fighting"},"Fighting"),r.a.createElement("option",{value:"Normal"},"Normal"),r.a.createElement("option",{value:"Dragon"},"Dragon"),r.a.createElement("option",{value:"Flying"},"Flying"),r.a.createElement("option",{value:"Fairy"},"Fairy"),r.a.createElement("option",{value:"Poison"},"Poison")))}}]),n}(r.a.Component),d=function(e){Object(s.a)(n,e);var t=Object(m.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"eggSearch",value:function(){var e=document.querySelector("#egg");fetch("http://localhost:80/api/egg/"+e.value).then((function(e){return e.json()})).then((function(t){var n=document.querySelector("#reportingArea");n.setAttribute("class",e.value),t.error?n.innerHTML=t.error:t.sort((function(e,t){return e.id-t.id})).map((function(e,t){0===t?n.innerHTML=e.name:e.formName?n.innerHTML+="<br>"+e.name+"("+e.formName+")":n.innerHTML+="<br>"+e.name}))}))}},{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement("h1",null,"Search By Egg Group"),r.a.createElement("select",{id:"egg",size:"0",onChange:this.eggSearch},r.a.createElement("option",{value:""}),r.a.createElement("option",{value:"Amorphous"},"Amorphous"),r.a.createElement("option",{value:"Bug"},"Bug"),r.a.createElement("option",{value:"Dragon"},"Dragon"),r.a.createElement("option",{value:"Fairy"},"Fairy"),r.a.createElement("option",{value:"Field"},"Field"),r.a.createElement("option",{value:"Flying"},"Flying"),r.a.createElement("option",{value:"Grass"},"Grass"),r.a.createElement("option",{value:"Human-Like"},"Human-like"),r.a.createElement("option",{value:"Mineral"},"Mineral"),r.a.createElement("option",{value:"Monster"},"Monster"),r.a.createElement("option",{value:"Water1"},"Water 1"),r.a.createElement("option",{value:"Water2"},"Water 2"),r.a.createElement("option",{value:"Water3"},"Water 3"),r.a.createElement("option",{value:"Ditto"},"Ditto"),r.a.createElement("option",{value:"Undiscovered"},"Undiscovered")))}}]),n}(r.a.Component),g=function(e){Object(s.a)(n,e);var t=Object(m.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"render",value:function(){return r.a.createElement("p",null,"In Progress")}}]),n}(r.a.Component),E=(n(14),function(e){Object(s.a)(n,e);var t=Object(m.a)(n);function n(e){var a;return Object(c.a)(this,n),(a=t.call(this,e)).show=a.show.bind(Object(u.a)(a)),a.search=a.search.bind(Object(u.a)(a)),a}return Object(i.a)(n,[{key:"search",value:function(){var e=document.querySelector("#input");e.removeAttribute("disabled"),""!=e.value&&null!=e.value&&"undefined"!=e.value&&" "!=e.value&&fetch("http://localhost:80/api/pokedex/find/"+e.value).then((function(e){return e.json()})).then((function(e){var t=document.querySelector("#reportingArea");e.map((function(e,n){0===n?t.innerHTML=e.name+"<br>":t.innerHTML+=e.name+"<br>"}))}))}},{key:"show",value:function(){document.querySelector("#input").setAttribute("disabled","true"),fetch("http://localhost:80/api/pokedex/all").then((function(e){return e.json()})).then((function(e){var t=document.querySelector("#reportingArea");e.map((function(e,n){0===n?t.innerHTML=e.name+"<br>":t.innerHTML+=e.name+="<br>"}))}))}},{key:"add",value:function(){var e=document.querySelector("#add"),t=document.querySelector("#insert");e.style.display="block",t.style.display="block"}},{key:"insert",value:function(){var e=document.querySelector("#add");console.log(e.value),fetch("http//localhost:80/api/pokedex/add/"+e.value).then((function(e){return e.json()})).then((function(e){document.querySelector("#reportingArea").innerHTML=e}))}},{key:"caught",value:function(){document.querySelector("#input").setAttribute("disabled","true"),fetch("http://localhost:80/api/pokedex/caught").then((function(e){return e.json()})).then((function(e){var t=document.querySelector("#reportingArea");e.map((function(e,n){0===n?t.innerHTML=e.name+"<br>":t.innerHTML+=e.name+"<br>"}))}))}},{key:"notCaught",value:function(){document.querySelector("#input").setAttribute("disabled","true"),fetch("http://localhost:80/api/pokedex/notCaught").then((function(e){return e.json()})).then((function(e){var t=document.querySelector("#reportingArea");e.map((function(e,n){0===n?t.innerHTML=e.name+"<br>":t.innerHTML+=e.name+"<br>"}))}))}},{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement("h2",null,"Show Caught Pokemon"),r.a.createElement("button",{value:"pokemonList",onClick:this.show},"All Pokemon"),r.a.createElement("button",{value:"caught",onClick:this.caught},"Pokemon Caught"),r.a.createElement("button",{value:"notCaught",onClick:this.notCaught},"Uncaught Pokemon"),r.a.createElement("button",{value:"addPokemon",onClick:this.add},"Add Pokemon to List"),r.a.createElement("button",{value:"search",onClick:this.search},"Search for Pokemon"),r.a.createElement("br",null),r.a.createElement("input",{type:"text",id:"input",disabled:!0,onChange:this.search}),r.a.createElement("input",{type:"text",id:"add"}),r.a.createElement("button",{id:"insert",value:"Add Pokemon",onClick:this.insert},"Add Pokemon"))}}]),n}(r.a.Component)),f=(n(15),function(e){Object(s.a)(n,e);var t=Object(m.a)(n);function n(e){var a;return Object(c.a)(this,n),(a=t.call(this,e)).changeTask=a.changeTask.bind(Object(u.a)(a)),a.state={view:""},a}return Object(i.a)(n,[{key:"changeTask",value:function(e){this.setState({view:e})}},{key:"render",value:function(){var e=this;return r.a.createElement("div",{className:"App"},"generation"===this.state.view?r.a.createElement(p,null):"name"===this.state.view?r.a.createElement(h,null):"id"===this.state.view?r.a.createElement(v,null):"type"===this.state.view?r.a.createElement(b,null):"egg"===this.state.view?r.a.createElement(d,null):"caught"===this.state.view?r.a.createElement(E,null):r.a.createElement(g,null),r.a.createElement("div",{id:"reportingArea"}),r.a.createElement("nav",{id:"navigation",className:"btn-group"},r.a.createElement("button",{className:"buttonClass",onClick:function(){return e.changeTask()}},"Home"),r.a.createElement("button",{className:"buttonClass",onClick:function(){return e.changeTask("id")}},"Id"),r.a.createElement("button",{className:"buttonClass",onClick:function(){return e.changeTask("name")}},"Name"),r.a.createElement("button",{className:"buttonClass",onClick:function(){return e.changeTask("type")}},"Type"),r.a.createElement("button",{className:"buttonClass",onClick:function(){return e.changeTask("generation")}},"Generation"),r.a.createElement("button",{className:"buttonClass",onClick:function(){return e.changeTask("egg")}},"Egg Group"),r.a.createElement("button",{className:"buttonClass",onClick:function(){return e.changeTask("caught")}},"Caught")))}}]),n}(r.a.Component));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}$/));l.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(f,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}],[[8,1,2]]]);
//# sourceMappingURL=main.e5792e4e.chunk.js.map