text: (this["webpackJsonpreact-pokedex"]=this["webpackJsonpreact-pokedex"]||[]).push([[0],{36:function(e,a,t){e.exports=t.p+"static/media/spinner.8cb992dc.gif"},40:function(e,a,t){e.exports=t(70)},45:function(e,a,t){},47:function(e,a,t){},70:function(e,a,t){"use strict";t.r(a);var s=t(0),n=t.n(s),c=t(35),l=t.n(c),r=(t(45),t(19)),o=t(1),i=(t(46),t(47),t(7)),m=t(8),d=t(10),p=t(9),u=function(e){Object(d.a)(t,e);var a=Object(p.a)(t);function t(){return Object(i.a)(this,t),a.apply(this,arguments)}return Object(m.a)(t,[{key:"render",value:function(){return n.a.createElement("div",null,n.a.createElement("nav",{className:"navbar navbar-expand-md fixed-top"},n.a.createElement("a",{style:{color:"#fff"},className:"navbar-brand col-sm-3 col-md-2 mr-0 align-items-center"},"Pokedex")))}}]),t}(s.Component),h=t(12),v=t.n(h),E=t(18),g=t(20),f=t(15),N=t(36),b=t.n(N);function k(){var e=Object(g.a)(["\n  text-decoration: none;\n  color: black;\n  &:focus,\n  &:hover,\n  &:visited,\n  &:link,\n  &:active {\n    text-decoration: none;\n  }\n"]);return k=function(){return e},e}function x(){var e=Object(g.a)(["\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n\n  &:hover {\n    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.25), 0 10px 15px rgba(0, 0, 0, 0.22);\n  }\n"]);return x=function(){return e},e}function w(){var e=Object(g.a)(["\n    width: 5em,\n    height: 5em,\n    display: none\n"]);return w=function(){return e},e}var y=f.a.img(w()),j=f.a.div(x()),O=Object(f.a)(r.b)(k()),B=function(e){Object(d.a)(t,e);var a=Object(p.a)(t);function t(){var e;Object(i.a)(this,t);for(var s=arguments.length,n=new Array(s),c=0;c<s;c++)n[c]=arguments[c];return(e=a.call.apply(a,[this].concat(n))).state={name:"",imageUrl:"",pokemonIndex:"",imageLoading:!0,toManyRequests:!1},e}return Object(m.a)(t,[{key:"componentDidMount",value:function(){var e=this.props,a=e.name,t=e.url,s=t.split("/")[t.split("/").length-2],n="https://github.com/PokeAPI/sprites/blob/master/sprites/pokemon/".concat(s,".png?raw=true");this.setState({name:a,imageUrl:n,pokemonIndex:s})}},{key:"render",value:function(){var e=this;return n.a.createElement("div",{className:"col-md-3 col-sm-6 mb-5"},n.a.createElement(O,{to:"pokemon/".concat(this.state.pokemonIndex)},n.a.createElement(j,{className:"card"},n.a.createElement("h5",{className:"card-header"},this.state.pokemonIndex),this.state.imageLoading?n.a.createElement("img",{src:b.a,style:{width:"5em",height:"5em"},className:"card-img-top rounded mx-auto d-block mt-2",alt:"pokemon"}):null,n.a.createElement(y,{className:"card-img-top rounded mx-auto mt-2",onLoad:function(){return e.setState({imageLoading:!1})},onError:function(){return e.setState({toManyRequests:!0})},src:this.state.imageUrl,style:this.state.toManyRequests?{display:"none"}:this.state.imageLoading?null:{display:"block"}}),this.state.toManyRequests?n.a.createElement("h6",{className:"mx-auto"},n.a.createElement("span",{className:"badge badge-danger mt-e"},"Too Many Requests")):null,n.a.createElement("div",{className:"card-body mx-auto"},n.a.createElement("h6",{className:"card-title text-capitalize"},this.state.name)))))}}]),t}(s.Component),C=t(17),A=t.n(C),D=function(e){Object(d.a)(t,e);var a=Object(p.a)(t);function t(){var e;Object(i.a)(this,t);for(var s=arguments.length,n=new Array(s),c=0;c<s;c++)n[c]=arguments[c];return(e=a.call.apply(a,[this].concat(n))).state={url:"https://pokeapi.co/api/v2/pokemon?limit=151",pokemon:null},e}return Object(m.a)(t,[{key:"componentDidMount",value:function(){var e=Object(E.a)(v.a.mark((function e(){var a;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A.a.get(this.state.url);case 2:a=e.sent,this.setState({pokemon:a.data.results});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return n.a.createElement(n.a.Fragment,null,this.state.pokemon?n.a.createElement("div",{className:"row"},this.state.pokemon.map((function(e){return n.a.createElement(B,{key:e.name,name:e.name,url:e.url})}))):n.a.createElement("h1",{className:"text-center"},"Loading Pokemon..."))}}]),t}(s.Component),R=function(e){Object(d.a)(t,e);var a=Object(p.a)(t);function t(){return Object(i.a)(this,t),a.apply(this,arguments)}return Object(m.a)(t,[{key:"render",value:function(){return n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col"},n.a.createElement(D,null)))}}]),t}(s.Component),M={bug:"B1C12E",dark:"4F3A2D",dragon:"755EDF",electric:"FCBC17",fairy:"F481F4",fighting:"82351D",fire:"E73B0C",flying:"A3B3F7",ghost:"6060B2",grass:"74C236",ground:"D3B357",ice:"A3E7FD",normal:"C8C4BC",poison:"934594",psychic:"ED4882",rock:"B9A156",steel:"B5B5C3",water:"3295F6"},S=function(e){Object(d.a)(t,e);var a=Object(p.a)(t);function t(){var e;Object(i.a)(this,t);for(var s=arguments.length,n=new Array(s),c=0;c<s;c++)n[c]=arguments[c];return(e=a.call.apply(a,[this].concat(n))).state={name:"",pokemonIndex:"",imageUrl:"",types:[],description:"",stats:{hp:"",attack:"",defense:"",speed:"",specialAttack:"",specialDefense:""},height:"",weight:"",eggGroup:"",abilities:"",genderRatioMale:"",genderRatioFemale:"",evs:"",hatchSteps:""},e}return Object(m.a)(t,[{key:"componentDidMount",value:function(){var e=Object(E.a)(v.a.mark((function e(){var a,t,s,n,c,l,r,o,i,m,d,p,u,h,E,g,f,N=this;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.props.match.params.pokemonIndex,t="https://pokeapi.co/api/v2/pokemon/".concat(a,"/"),s="https://pokeapi.co/api/v2/pokemon-species/".concat(a,"/"),e.next=5,A.a.get(t);case 5:return n=e.sent,c=n.data.name,l=n.data.sprites.front_default,"",r="".hp,o="".attack,i="".defense,m="".speed,d="".specialAttack,p="".specialDefense,n.data.stats.map((function(e){switch(e.stat.name){case"hp":r=e.base_stat;break;case"attack":o=e.base_stat;break;case"defense":i=e.base_stat;break;case"speed":m=e.base_stat;break;case"special-attack":d=e.base_stat;break;case"special-defense":p=e.base_stat}})),u=Math.round(100*(.328084*n.data.height+1e-4))/100,h=Math.round(100*(.220462*n.data.weight+1e-4))/100,E=n.data.types.map((function(e){return e.type.name})),g=n.data.abilities.map((function(e){return e.ability.name})).join(", "),f=n.data.stats.filter((function(e){return e.effort>0})).map((function(e){return"".concat(e.effort," ").concat(e.stat.name)})).join(", "),e.next=17,A.a.get(s).then((function(e){var a="";e.data.flavor_text_entries.some((function(e){"en"!==e.language.name||(a=e.flavor_text)}));var t=e.data.gender_rate,s=12.5*t,n=12.5*(8-t),c=Math.round(100/255*e.data.capture_rate),l=e.data.egg_groups.map((function(e){return e.name})).join(", "),r=255*(e.data.hatch_counter+1);N.setState({description:a,genderRatioFemale:s,genderRatioMale:n,catchRate:c,eggGroups:l,hatchSteps:r})}));case 17:this.setState({imageUrl:l,pokemonIndex:a,name:c,types:E,stats:{hp:r,attack:o,defense:i,speed:m,specialAttack:d,specialDefense:p},height:u,weight:h,abilities:g,evs:f});case 18:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){return n.a.createElement("div",{className:"col"},n.a.createElement("div",{className:"card"},n.a.createElement("div",{className:"card-header"},n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-5"},n.a.createElement("h5",null,this.state.pokemonIndex)),n.a.createElement("div",{className:"col-7"},n.a.createElement("div",{className:"float-right"},this.state.types.map((function(e){return n.a.createElement("span",{key:e,className:"badge badge-pill mr-1 text-capitalize",style:{backgroundColor:"#".concat(M[e]),color:"white"}},e)})))))),n.a.createElement("div",{className:"card-body"},n.a.createElement("div",{className:"row align-items-center"},n.a.createElement("div",{className:"col-md-3"},n.a.createElement("img",{src:this.state.imageUrl,alt:"pokemon",className:"card-img-top rounded mx-auto mt-2"})),n.a.createElement("div",{className:"col-md-9"},n.a.createElement("h4",{className:"mx-auto text-capitalize"},this.state.name),n.a.createElement("div",{className:"row align-items-center"},n.a.createElement("div",{className:"col-12 col-md-3"},"HP"),n.a.createElement("div",{className:"col-12 col-md-9"},n.a.createElement("div",{className:"progress"},n.a.createElement("div",{className:"progress-bar",role:"progressBar",style:{width:"".concat(this.state.stats.hp,"%")},"aria-valuenow":"25","aria-valuemin":"0","aria-valuemax":"100"},n.a.createElement("small",null,this.state.stats.hp)))),n.a.createElement("div",{className:"col-12 col-md-3"},"Attack"),n.a.createElement("div",{className:"col-12 col-md-9"},n.a.createElement("div",{className:"progress"},n.a.createElement("div",{className:"progress-bar",role:"progressBar",style:{width:"".concat(this.state.stats.attack,"%")},"aria-valuenow":"25","aria-valuemin":"0","aria-valuemax":"100"},n.a.createElement("small",null,this.state.stats.attack)))),n.a.createElement("div",{className:"col-12 col-md-3"},"Defense"),n.a.createElement("div",{className:"col-12 col-md-9"},n.a.createElement("div",{className:"progress"},n.a.createElement("div",{className:"progress-bar",role:"progressBar",style:{width:"".concat(this.state.stats.defense,"%")},"aria-valuenow":"25","aria-valuemin":"0","aria-valuemax":"100"},n.a.createElement("small",null,this.state.stats.defense)))),n.a.createElement("div",{className:"col-12 col-md-3"},"Speed"),n.a.createElement("div",{className:"col-12 col-md-9"},n.a.createElement("div",{className:"progress"},n.a.createElement("div",{className:"progress-bar",role:"progressBar",style:{width:"".concat(this.state.stats.speed,"%")},"aria-valuenow":"25","aria-valuemin":"0","aria-valuemax":"100"},n.a.createElement("small",null,this.state.stats.speed)))),n.a.createElement("div",{className:"col-12 col-md-3"},"Special Attack"),n.a.createElement("div",{className:"col-12 col-md-9"},n.a.createElement("div",{className:"progress"},n.a.createElement("div",{className:"progress-bar",role:"progressBar",style:{width:"".concat(this.state.stats.specialAttack,"%")},"aria-valuenow":"25","aria-valuemin":"0","aria-valuemax":"100"},n.a.createElement("small",null,this.state.stats.specialAttack)))),n.a.createElement("div",{className:"col-12 col-md-3"},"Special Defense"),n.a.createElement("div",{className:"col-12 col-md-9"},n.a.createElement("div",{className:"progress"},n.a.createElement("div",{className:"progress-bar",role:"progressBar",style:{width:"".concat(this.state.stats.specialDefense,"%")},"aria-valuenow":"25","aria-valuemin":"0","aria-valuemax":"100"},n.a.createElement("small",null,this.state.stats.specialDefense))))),n.a.createElement("div",{className:"row mt-1"},n.a.createElement("div",{className:"col"},n.a.createElement("p",{className:"mt-4"},this.state.description))))),n.a.createElement("hr",null),n.a.createElement("div",{className:"card-body"},n.a.createElement("h5",{className:"card-title text-center"},"Profile"),n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-right"},"Height:")),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-left"},this.state.height," ft."))),n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-right"},"Weight:")),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-left"},this.state.weight," lbs."))),n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-right"},"Catch Rate:")),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-left"},this.state.catchRate," %"))),n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-right"},"Gender Ratio:")),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("div",{className:"progress"},n.a.createElement("div",{className:"progress-bar",role:"progressBar",style:{width:"".concat(this.state.genderRatioFemale,"%"),backgroundColor:"#C2185B"},"aria-valuenow":"15","aria-valuemin":"0","aria-valuemax":"100"},n.a.createElement("small",null,this.state.genderRatioFemale)),n.a.createElement("div",{className:"progress-bar",role:"progressBar",style:{width:"".concat(this.state.genderRatioMale,"%"),backgroundColor:"#1976D2"},"aria-valuenow":"30","aria-valuemin":"0","aria-valuemax":"100"},n.a.createElement("small",null,this.state.genderRatioMale)))))),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-right"},"Egg Groups:")),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-left text-capitalize"},this.state.eggGroups))),n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-right"},"Hatch Steps:")),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-left text-capitalize"},this.state.hatchSteps))),n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-right"},"Abilities:")),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-left text-capitalize"},this.state.abilities))),n.a.createElement("div",{className:"row"},n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-right"},"EVs:")),n.a.createElement("div",{className:"col-md-6"},n.a.createElement("h6",{className:"float-left text-capitalize"},this.state.evs)))))))))}}]),t}(s.Component);var _=function(){return n.a.createElement(r.a,null,n.a.createElement("div",{className:"App"},n.a.createElement(u,null),n.a.createElement("div",{className:"container"},n.a.createElement(o.c,null,n.a.createElement(o.a,{exact:!0,path:"/",component:R}),n.a.createElement(o.a,{exact:!0,path:"/pokemon/:pokemonIndex",component:S})))))};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(n.a.createElement(n.a.StrictMode,null,n.a.createElement(_,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[40,1,2]]]);
  //# sourceMappingURL=main.8ee61738.chunk.js.map