1(this["webpackJsonpreact-rest-countries-api"]=this["webpackJsonpreact-rest-countries-api"]||[]).push([[0],{29:function(e,t,c){},36:function(e,t,c){"use strict";c.r(t);var a=c(2),s=c.n(a),n=c(19),r=c.n(n),i=(c(29),c(17)),l=c(5),j=c(20),o=c(1),b=Object(o.jsx)(j.a,{size:68,color:"blue"}),d=function(e){var t=e.text;return Object(o.jsxs)("div",{className:"loader",children:[Object(o.jsx)("span",{className:"loading",children:b}),Object(o.jsxs)("p",{children:["Please Wait while loading ",t,", this should take a second."]})]})},h=c(21),O=Object(o.jsx)(h.a,{size:68,color:"red"}),u=function(e){var t=e.text,c=e.msg;return Object(o.jsxs)("div",{className:"loader",children:[Object(o.jsx)("span",{className:"error",children:O}),Object(o.jsxs)("p",{children:["could Not be Loaded: ",c," ",t]})]})},x=function(e){var t=e.flag,c=e.name,a=e.population,s=e.region,n=e.capital,r=e.id;return Object(o.jsx)(o.Fragment,{children:Object(o.jsxs)("div",{className:"card",children:[Object(o.jsx)("div",{className:"card-image",children:Object(o.jsx)("img",{src:t,alt:c})}),Object(o.jsxs)("div",{className:"card-content",children:[Object(o.jsx)("h2",{className:"card-name",children:c}),Object(o.jsxs)("ol",{className:"card-list",children:[Object(o.jsxs)("li",{children:["population: ",Object(o.jsx)("span",{children:a})]}),Object(o.jsxs)("li",{children:["Region: ",Object(o.jsx)("span",{children:s})]}),Object(o.jsxs)("li",{children:["Capital: ",Object(o.jsx)("span",{children:n})]})]})]})]},r)})},m=c(6),p=function(){var e=Object(a.useState)(null),t=Object(l.a)(e,2),c=t[0],s=t[1],n=Object(a.useState)(!1),r=Object(l.a)(n,2),i=r[0],j=r[1],b=Object(a.useState)([]),h=Object(l.a)(b,2),O=h[0],p=h[1],g=Object(a.useState)(""),f=Object(l.a)(g,2),v=f[0],N=f[1],S=Object(a.useState)(["capital","name"]),w=Object(l.a)(S,1)[0],C=Object(a.useState)(["All"]),F=Object(l.a)(C,2),k=F[0],L=F[1];return Object(a.useEffect)((function(){fetch("https://restcountries.eu/rest/v2/all").then((function(e){return e.json()})).then((function(e){j(!0),p(e)}),(function(e){j(!0),s(e)}))}),[]),c?Object(o.jsx)(o.Fragment,{children:Object(o.jsx)(u,{text:"Countries",msg:c.message})}):i?Object(o.jsxs)(o.Fragment,{children:[Object(o.jsxs)("div",{className:"search-wrapper",children:[Object(o.jsxs)("label",{htmlFor:"search-form",children:[Object(o.jsx)("input",{type:"search",name:"search-form",id:"search-form",className:"search-input",placeholder:"Search for...",value:v,onChange:function(e){return N(e.target.value)}}),Object(o.jsx)("span",{className:"sr-only",children:"Search countries here"})]}),Object(o.jsxs)("div",{className:"select",children:[Object(o.jsxs)("select",{onChange:function(e){L(e.target.value)},className:"custom-select","aria-label":"Filter Countries By Countries",children:[Object(o.jsx)("option",{value:"All",children:"Filter By Region"}),Object(o.jsx)("option",{value:"Africa",children:"Africa"}),Object(o.jsx)("option",{value:"Americas",children:"America"}),Object(o.jsx)("option",{value:"Asia",children:"Asia"}),Object(o.jsx)("option",{value:"Europe",children:"Europe"}),Object(o.jsx)("option",{value:"Oceania",children:"Oceania"})]}),Object(o.jsx)("span",{className:"focus"})]})]}),Object(o.jsx)("ul",{className:"card-grid",children:function(e){return e.filter((function(e){return e.region==k||"All"==k?w.some((function(t){return e[t].toString().toLowerCase().indexOf(v.toLowerCase())>-1})):void 0}))}(O).map((function(e){return Object(o.jsx)("li",{children:Object(o.jsx)(m.b,{to:"/".concat(e.name),children:Object(o.jsx)(x,{id:e.callingCodes,flag:e.flag,name:e.name,population:e.population,region:e.region,capital:e.capital})})})}))}),Object(o.jsx)("div",{className:"marginBtm"})]}):Object(o.jsx)(o.Fragment,{children:Object(o.jsx)(d,{text:"Countries"})})},g=function(e){var t=e.text,c=e.altText,a=e.className,s=e.onclick;return Object(o.jsxs)("button",{className:a,onClick:s,children:[t," ",Object(o.jsx)("span",{className:"not-mobile",children:c})]})};g.defaultProps={text:"button",color:"transparent"};var f=g,v=c(23),N=Object(o.jsx)(v.a,{size:18}),S=function(){return Object(o.jsx)("header",{className:"header",children:Object(o.jsxs)("div",{className:"wrapper flex f-center-y f-btw",children:[Object(o.jsx)("h1",{children:"Where in the world?"}),Object(o.jsx)(f,{text:N,altText:"Dark Mode",className:"header-btn",onclick:function(){var e=document.querySelector(".header-btn");e.classList.toggle("active"),e.classList.contains("active")?(localStorage.setItem("data-theme","dark"),document.documentElement.setAttribute("data-theme",localStorage.getItem("data-theme"))):(localStorage.setItem("data-theme","light"),document.documentElement.setAttribute("data-theme",localStorage.getItem("data-theme")))}})]})})},w=function(){return Object(o.jsx)("footer",{className:"footer",children:Object(o.jsxs)("div",{className:"wrapper footer__inner",children:[Object(o.jsxs)("p",{className:"footer__item",children:[Object(o.jsx)("strong",{children:"\xa9 2021"}
1),Object(o.jsx)("br",{}),Object(o.jsx)("a",{href:"https://spruce.com.ng/about/",children:"Spruce"})]}),Object(o.jsxs)("p",{className:"footer__item",children:[Object(o.jsx)("strong",{children:"Social"}),Object(o.jsx)("br",{}),Object(o.jsx)("a",{href:"https://github.com/iamspruce",children:"Github"}),"/",Object(o.jsx)("a",{href:"https://twitter.com/sprucekhalifa",children:"Twitter"})]}),Object(o.jsxs)("p",{className:"footer__item",children:[Object(o.jsx)("strong",{children:"Project files"}),Object(o.jsx)("br",{}),Object(o.jsx)("a",{href:"https://github.com/iamspruce/react-rest-countries-api",children:"View project files"})]})]})})},C=function(e){var t=e.flag,c=e.name,a=e.nativeName,s=e.population,n=e.region,r=e.subregion,i=e.capital,l=e.topLevelDomain,j=e.currencies,b=e.languages,d=e.borders;return Object(o.jsx)(o.Fragment,{children:Object(o.jsxs)("article",{children:[Object(o.jsx)("aside",{className:"article-flag",children:Object(o.jsx)("img",{src:t,alt:""})}),Object(o.jsxs)("div",{className:"article-main",children:[Object(o.jsx)("h3",{children:c}),Object(o.jsxs)("div",{className:"flex f-btw",children:[Object(o.jsx)("div",{className:"row",children:Object(o.jsxs)("ol",{className:"items",children:[Object(o.jsxs)("li",{children:["Native Name: ",Object(o.jsx)("span",{children:a})]}),Object(o.jsxs)("li",{children:["Population: ",Object(o.jsx)("span",{children:s})]}),Object(o.jsxs)("li",{children:["Region: ",Object(o.jsx)("span",{children:n})]}),Object(o.jsxs)("li",{children:["Sub Region: ",Object(o.jsx)("span",{children:r})]}),Object(o.jsxs)("li",{children:["Capital: ",Object(o.jsx)("span",{children:i})]})]})}),Object(o.jsx)("div",{className:"last-row",children:Object(o.jsxs)("ol",{className:"items",children:[Object(o.jsxs)("li",{children:["Top Level Domain: ",Object(o.jsx)("span",{children:l})]}),Object(o.jsxs)("li",{children:["Currencies: ",Object(o.jsx)("span",{children:j})]}),Object(o.jsxs)("li",{children:["Languages: ",Object(o.jsx)("span",{children:b})]})]})})]}),Object(o.jsxs)("div",{className:"article-end",children:[Object(o.jsx)("h4",{children:"Border Countries: "}),d.map((function(e){return Object(o.jsx)(m.b,{to:"/".concat(c,"/border/").concat(e),children:Object(o.jsx)("span",{children:e})})}))]})]})]})})},F=c(12),k=Object(o.jsx)(F.a,{size:18}),L=function(e){var t=e.match,c=Object(a.useState)(null),s=Object(l.a)(c,2),n=s[0],r=s[1],i=Object(a.useState)(!1),j=Object(l.a)(i,2),b=j[0],h=j[1],O=Object(a.useState)([]),x=Object(l.a)(O,2),p=x[0],g=x[1];return Object(a.useEffect)((function(){fetch("https://restcountries.eu/rest/v2/name/".concat(t.params.name,"?fullText=true")).then((function(e){return e.json()})).then((function(e){h(!0),g(e)}),(function(e){h(!0),r(e)}))}),[]),n?Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{className:"search-wrapper",children:Object(o.jsx)(m.b,{to:"/",children:Object(o.jsx)(f,{text:k,altText:"Back",className:"btn"})})}),Object(o.jsx)(u,{text:t.params.name,msg:n.message})]}):b?Object(o.jsxs)("div",{value:[p],children:[Object(o.jsx)("div",{className:"search-wrapper",children:Object(o.jsx)(m.b,{to:"/",children:Object(o.jsx)(f,{text:k,altText:"Back",className:"btn"})})}),p.map((function(e){return Object(o.jsx)(C,{flag:e.flag,name:e.name,nativeName:e.nativeName,population:e.population,region:e.region,subregion:e.subregion,capital:e.capital,topLevelDomain:e.topLevelDomain,currencies:e.currencies[0].name,languages:e.languages[0].name,borders:e.borders})}))]}):Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{className:"search-wrapper",children:Object(o.jsx)(m.b,{to:"/",children:Object(o.jsx)(f,{text:k,altText:"Back",className:"btn"})})}),Object(o.jsx)(d,{text:t.params.name})]})},T=Object(o.jsx)(F.a,{size:18}),B=function(e){var t=e.match,c=Object(a.useState)(null),s=Object(l.a)(c,2),n=s[0],r=s[1],i=Object(a.useState)(!1),j=Object(l.a)(i,2),b=j[0],h=j[1],O=Object(a.useState)([]),x=Object(l.a)(O,2),p=x[0],g=x[1],v=Object(a.useState)([t.params.name]),N=Object(l.a)(v,1)[0];return Object(a.useEffect)((function(){fetch("https://restcountries.eu/rest/v2/all").then((function(e){return e.json()})).then((function(e){h(!0),g(e)}),(function(e){h(!0),r(e)}))}),[]),n?Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{className:"search-wrapper",children:Object(o.jsx)(m.b,{to:"/",children:Object(o.jsx)(f,{text:T,altText:"Back",className:"btn"})})}),Object(o.jsx)(u,{text:t.params.name,msg:n.message})]}
1):b?Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{className:"search-wrapper",children:Object(o.jsx)(m.b,{to:"/",children:Object(o.jsx)(f,{text:T,altText:"Back",className:"btn"})})}),p.map((function(e){if(e.alpha3Code==N)return Object(o.jsx)(C,{flag:e.flag,name:e.name,nativeName:e.nativeName,population:e.population,region:e.region,subregion:e.subregion,capital:e.capital,topLevelDomain:e.topLevelDomain,currencies:e.currencies[0].name,languages:e.languages[0].name,borders:e.borders},e.numericCode)}))]}):Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{className:"search-wrapper",children:Object(o.jsx)(m.b,{to:"/",children:Object(o.jsx)(f,{text:T,altText:"Back",className:"btn"})})}),Object(o.jsx)(d,{text:t.params.name})]})},A=c(3);var y=function(){return Object(o.jsxs)(m.a,{children:[Object(o.jsx)(S,{}),Object(o.jsx)("div",{className:"wrapper",children:Object(o.jsxs)(A.c,{children:[Object(o.jsx)(A.a,{path:"/",exact:!0,component:p}),Object(o.jsx)(A.a,{path:"/:name",exact:!0,component:L}),Object(o.jsx)(A.a,{path:"/:country/border/:name",exact:!0,component:function(e){return Object(a.createElement)(B,Object(i.a)(Object(i.a)({},e),{},{key:window.location.pathname}))}})]})}),Object(o.jsx)(w,{})]})},E=function(e){e&&e instanceof Function&&c.e(3).then(c.bind(null,37)).then((function(t){var c=t.getCLS,a=t.getFID,s=t.getFCP,n=t.getLCP,r=t.getTTFB;c(e),a(e),s(e),n(e),r(e)}))},D=c(24);c.n(D).a.load({google:{families:["Nunito:300,400,700","sans-serif"]}}),r.a.render(Object(o.jsx)(s.a.StrictMode,{children:Object(o.jsx)(y,{})}),document.getElementById("root")),E()}},[[36,1,2]]]); 2//# sourceMappingURL=main.f37dcee3.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.