{"version":3,"sources":["Places.js","App.js","serviceWorker.js","index.js"],"names":["Places","useState","places","setPlaces","loading","setLoading","search","setSearch","filteredPlaces","setFilteredPlaces","useEffect","a","fetch","response","json","data","fetchData","console","log","filter","place","name","toLowerCase","includes","location","type","placeholder","onChange","e","target","value","map","id","src","img","alt","height","width","img_credit","description","key","lat","lng","href","class","App","className","Boolean","window","hostname","match","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch","error","message"],"mappings":"sQAoFeA,EA9EA,WAAO,IAAD,EAESC,mBAAS,IAFlB,mBAEZC,EAFY,KAEJC,EAFI,OAGWF,oBAAS,GAHpB,mBAGZG,EAHY,KAGHC,EAHG,OAISJ,mBAAS,IAJlB,mBAIZK,EAJY,KAIJC,EAJI,OAKyBN,mBAAS,IALlC,mBAKZO,EALY,KAKIC,EALJ,KAkDjB,OAxCJC,qBAAU,WAAM,4CAEZ,8BAAAC,EAAA,sEAEyBC,MAAM,uDAF/B,cAEQC,EAFR,gBAIqBA,EAASC,OAJ9B,OAIQC,EAJR,OAKEZ,EAAUY,GACVV,GAAW,GANb,4CAFY,sBACZA,GAAW,GADC,mCAUZW,KACC,IAgBCN,qBAAU,WACV,OAAO,WACLO,QAAQC,IAAI,iCAEb,IAEHR,qBAAU,WACRD,EACEP,EAAOiB,QAAQ,SAAAC,GACb,OAAOA,EAAMC,KAAKC,cAAcC,SAAUjB,EAAOgB,gBAAmBF,EAAMI,SAASF,cAAcC,SAAUjB,EAAOgB,qBAErH,CAAChB,EAAQJ,IAERE,EACK,yDAKT,oCACA,2BAAOqB,KAAK,OAAOC,YAAY,SAASC,SAAW,SAAAC,GAAC,OAAIrB,EAAUqB,EAAEC,OAAOC,UAE3E,4BAGGtB,EAAeuB,KAAI,SAACX,EAAOY,GAAR,OAClB,oCACA,yBAAKC,IAAKb,EAAMc,IAAKC,IAAKf,EAAMC,KAAMe,OAAO,MAAMC,MAAM,QACzD,oCAAajB,EAAMkB,YACnB,4BAAKlB,EAAMC,MACX,4BAAKD,EAAMI,UACX,4BAAKJ,EAAMmB,aACX,wBAAIC,IAAKpB,EAAMY,IAAf,aAA8BZ,EAAMqB,IAApC,eAAqDrB,EAAMsB,IAA3D,SAAqE,uBAAGC,KAAI,0CAAqCvB,EAAMY,IAAMY,MAAM,aAAYf,OAAO,SAAjF,+BCvD9DgB,MAff,WAEE,OACE,yBAAKC,UAAU,OACb,4BAAQA,UAAU,cAChB,yBAAKb,IAAK,8RAA+Ra,UAAU,WAAWX,IAAI,SAClU,kEAGA,kBAAC,EAAD,SCFYY,QACW,cAA7BC,OAAOxB,SAASyB,UAEe,UAA7BD,OAAOxB,SAASyB,UAEhBD,OAAOxB,SAASyB,SAASC,MACvB,2DCZNC,IAASC,OAAO,kBAAC,EAAD,MAASC,SAASC,eAAe,SD6H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBC,MAAK,SAAAC,GACJA,EAAaC,gBAEdC,OAAM,SAAAC,GACL7C,QAAQ6C,MAAMA,EAAMC,a","file":"static/js/main.689ee189.chunk.js","sourcesContent":["import React, { useState, useEffect } from 'react';\n// import Place from './Place.js';\n// import SearchBar from './SearchBar.js';\n// import { render } from '@testing-library/react';\n\n\nconst Places = () => {\n\n const [places, setPlaces] = useState([]);\n const [loading, setLoading] = useState(false);\n const [search, setSearch] = useState('');\n const [filteredPlaces, setFilteredPlaces] = useState([]);\n\n // const [inputValue, setInputValue] = useState(\"\");\n\n\nuseEffect(() => {\n setLoading(true);\n async function fetchData() {\n // You can await here\n const response = await fetch('https://hidden-anchorage-29107.herokuapp.com/places');\n // ...\n const data = await response.json();\n setPlaces(data);\n setLoading(false);\n }\n fetchData();\n }, []); // Or [] if effect doesn't need props or state\n\n \n // const placesList = places.map(\n // (place, id) => \n // <>\n // {/* */}\n // {place.name}\n //
{place.img_credit}
\n //

{place.name}

\n //

{place.location}

\n //

{place.description}

\n //
  • Latitude: {place.lat} Longitude: {place.lng} Url: Atlas Obscura Entry\n //
  • \n // \n // ); \n useEffect(() => {\n return function logWillUnmount() {\n console.log(\"Unmounting place component\");\n };\n }, []);\n\n useEffect(() => {\n setFilteredPlaces(\n places.filter( place => {\n return place.name.toLowerCase().includes( search.toLowerCase() ) || place.location.toLowerCase().includes( search.toLowerCase() )\n }))\n }, [search, places]);\n\n if (loading) {\n return

    Loading Obscura Places...

    ;\n };\n\n return (\n\n <>\n setSearch(e.target.value)}/>\n {/* */}\n \n \n );\n}\n\nexport default Places;","import React from 'react';\n// import logo from './logo.svg';\nimport './App.css';\nimport Places from './Places.js';\n\nfunction App() {\n\n return (\n
    \n
    \n \"logo\"\n

    \n Atlas Obscura Tribute 🖤\n

    \n \n
    \n
    \n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' }\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}