{"version":3,"sources":["components/Error.js","components/Fetching.js","lib/shapes.js","components/partials/AttributeRow.js","components/partials/Attributes.js","components/partials/FactorySelection.js","components/partials/FormFieldsForOwner.js","components/partials/Traits.js","components/framework.js","components/FactoryForm.js","components/FactoryMalfunction.js","components/icons/ExternalLinkIcon.js","components/ObjectCard.js","components/ObjectUnderConstruction.js","components/Factories.js","lib/api.js","App.js","lib/hooks.js","reportWebVitals.js","index.js"],"names":["Error","Fetching","attributesShape","PropTypes","shape","name","string","isRequired","traitsShape","attributes","arrayOf","traits","AttributeRow","props","Form","Row","Col","Label","Control","as","disabled","className","value","attribute","onChange","event","onChangeName","children","onChangeValue","Traits","useState","inputAttributes","setInputAttributes","remainingAttributeOptions","useMemo","a","b","bNames","Set","map","item","filter","has","attrDiff","attr","addAttribute","replaceAttribute","ii","replacement","newAttributes","slice","splice","Group","controlId","target","setAttributeName","setAttributeValue","length","displayName","blueprint","owner","association","factory","class_name","FactorySelection","options","label","list","autoComplete","id","FormFieldsForOwner","type","styles","StyleSheet","create","display","flexDirection","flexWrap","maxHeight","css","trait","Check","classes","classNames","x","join","buttons","justifyContent","FactoryForm","blueprints","inquiry","factoryInput","setFactoryInput","indexedBluePrints","items","func","indexed","forEach","indexBy","selectedBlueprint","validSelection","prevOwner","ref","useRef","useEffect","current","usePrevious","other","ownerType","ownerId","otherOwnerType","otherOwnerId","sameOwner","form","onSubmit","handleSubmit","Attributes","Button","variant","onClick","reset","startOver","FactoryMalfunction","message","Alert","ExternalLinkIcon","width","height","viewBox","style","stroke-width","stroke","fill","stroke-linecap","stroke-linejoin","points","d","active","boxShadow","object","border","borderRadius","padding","marginRight","position","cursor","transition","objectDetails","flex","objectTitle","borderBottom","marginBottom","ObjectCard","isNew","isActive","animationClass","new","activate","link","href","url","rel","key","hasOwnProperty","ObjectUnderConstruction","overflow","objectList","margin","Factories","factories","constructing","setConstructing","error","setError","fetching","setFetching","newObjectIndex","setNewObjectIndex","objects","setObjects","selectedObjectIndex","setSelectedObjectIndex","factoryList","selectedObject","associationFactories","association_factories","find","f","factory_name","association_name","findAssociationFactory","data","submitPath","fetch","method","body","response","json","responseData","ok","handleResponseData","console","JSON","stringify","handleSubmitError","log","concat","handleObject","selectObject","preventDefault","submit","FormData","append","csrfToken","formData","index","then","res","App","loadFn","dependencies","setResponse","asyncFetch","done","catch","useRemoteData","api","class","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"gSAQeA,MANf,WACE,OACE,wECIWC,MANf,WACE,OACE,sD,uDCFEC,EAAkBC,IAAUC,MAAM,CACtCC,KAAMF,IAAUG,OAAOC,aAGnBC,EAAcL,IAAUC,MAAM,CAClCC,KAAMF,IAAUG,OAAOC,a,GAGJJ,IAAUC,MAAM,CACnCK,WAAYN,IAAUO,QAAQR,GAC9BG,KAAMF,IAAUG,OAAOC,WACvBI,OAAQR,IAAUO,QAAQF,K,8BCoCbI,MA1Cf,SAAsBC,GACpB,OACE,eAACC,EAAA,EAAKC,IAAN,WACE,eAACC,EAAA,EAAD,WACE,cAACF,EAAA,EAAKG,MAAN,6BACA,eAACH,EAAA,EAAKI,QAAN,CACEC,GAAG,SACHC,SAAUP,EAAMO,SAChBf,KAAI,qBACJgB,UAAU,eACVC,MAAOT,EAAMU,UAAUlB,KACvBmB,SAAU,SAAAC,GAAK,OAAIZ,EAAMa,aAAaD,IANxC,UAQE,wBAAQH,MAAOT,EAAMU,UAAUlB,KAA/B,SAAsCQ,EAAMU,UAAUlB,OACrDQ,EAAMc,eAGX,eAACX,EAAA,EAAD,WACE,cAACF,EAAA,EAAKG,MAAN,oBACA,uBACEG,SAAUP,EAAMO,WAAaP,EAAMU,UAAUlB,KAC7CA,KAAI,sBACJgB,UAAU,eACVC,MAAOT,EAAMU,UAAUD,MACvBE,SAAU,SAAAC,GAAK,OAAIZ,EAAMe,cAAcH,aCiDlCI,MAjEf,SAAgBhB,GACd,IAAQJ,EAAeI,EAAfJ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AiByB,EAAjB,KAHuD,SAUxCC,IAVwC,2EAUvD,sBAAA3L,EAAA,+EACSwL,KADT,4CAVuD,sBAcvD,SAASI,IACPhD,GAAY,GAOd,OAjBAvE,qBAAU,WACRuE,GAAY,GACZ+C,IAAaN,KAAKK,GAAaG,MAAMnD,GAAU2C,KAAKO,KACnDH,GAUW1L,mBAAQ,WACpB,MAAO,CAAC0I,QAAOE,WAAUsB,cACxB,CAACxB,EAAOE,EAAUsB,IDvBH6B,CAAcC,GAIhC,OAFA1H,qBAAU,WAAQiG,QAAQI,IAAIpC,KAAc,CAACA,IAG3C,sBAAKpJ,UAAU,MAAf,UACE,iCACE,qBAAK8M,MAAM,cAAX,uBAEF,iCACG1D,EAAUK,UAAY,cAAC,EAAD,IACtBL,EAAUG,OAAS,cAAC,EAAD,IACnBH,EAAU2B,UACT,cAAC,EAAD,CACEiB,UAAU,GACVrB,WAAW,UACXvB,UAAWA,EAAU2B,kBElBlBgC,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqBd,MAAK,YAAkD,IAA/Ce,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1BZ,M","file":"static/js/main.b7479be0.chunk.js","sourcesContent":["import React from \"react\";\n\nfunction Error() {\n return (\n
86 on that ... something went wrong.
\n );\n}\n\nexport default Error;\n","import React from \"react\";\n\nfunction Fetching() {\n return (\n
Coming right up...
\n );\n}\n\nexport default Fetching;\n","import PropTypes from 'prop-types';\n\nconst attributesShape = PropTypes.shape({\n name: PropTypes.string.isRequired,\n});\n\nconst traitsShape = PropTypes.shape({\n name: PropTypes.string.isRequired,\n});\n\nconst factoryShape = PropTypes.shape({\n attributes: PropTypes.arrayOf(attributesShape),\n name: PropTypes.string.isRequired,\n traits: PropTypes.arrayOf(traitsShape),\n});\n\nexport {\n attributesShape,\n factoryShape,\n traitsShape,\n};\n","import React from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Col from \"react-bootstrap/Col\";\nimport Form from \"react-bootstrap/Form\";\n\nfunction AttributeRow(props) {\n return (\n \n \n Attribute Name\n props.onChangeName(event)}\n >\n \n {props.children}\n \n \n \n Value\n props.onChangeValue(event)}\n />\n \n \n );\n}\n\nAttributeRow.propTypes = {\n attribute: PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.string,\n }),\n children: PropTypes.node,\n disabled: PropTypes.bool,\n onChangeName: PropTypes.func.isRequired,\n onChangeValue: PropTypes.func.isRequired,\n};\n\nexport default AttributeRow;\n","import React, { useMemo, useState } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Form from \"react-bootstrap/Form\";\n\nimport AttributeRow from \"./AttributeRow\";\n\nimport { attributesShape } from \"lib/shapes\";\n\nfunction attrDiff(a, b) {\n const bNames = new Set(b.map(item => item.name));\n return a.filter(item => !bNames.has(item.name));\n}\n\nfunction Traits(props) {\n const { attributes } = props;\n\n const [inputAttributes, setInputAttributes] = useState([]);\n const remainingAttributes = useMemo(() => attrDiff(attributes, inputAttributes));\n\n const remainingAttributeOptions = remainingAttributes.map(attr => (\n \n ));\n\n function addAttribute({name, value}) {\n setInputAttributes([...inputAttributes, {name, value}]);\n }\n\n function setAttributeName(ii, event) {\n const replacement = {name: event.target.value, value: inputAttributes[ii].value};\n replaceAttribute(ii, replacement);\n }\n\n function setAttributeValue(ii, event) {\n const replacement = {name: inputAttributes[ii].name, value: event.target.value};\n replaceAttribute(ii, replacement);\n }\n\n function replaceAttribute(ii, replacement) {\n const newAttributes = inputAttributes.slice();\n newAttributes.splice(ii, 1, replacement);\n setInputAttributes(newAttributes);\n }\n\n return (\n \n Pickles or onions?\n\n {inputAttributes.map((attr, ii) => (\n setAttributeName(ii, event)}\n onChangeValue={event => setAttributeValue(ii, event)}\n >\n {remainingAttributeOptions}\n \n ))}\n\n addAttribute({name: event.target.value, value: \"\"})}\n onChangeValue={event => addAttribute({name: \"\", value: event.target.value})}\n >\n {remainingAttributeOptions}\n \n\n \n );\n}\n\nTraits.propTypes = {\n disabled: PropTypes.bool,\n attributes: PropTypes.arrayOf(attributesShape).isRequired,\n};\n\nexport default Traits;\n","import React from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Form from \"react-bootstrap/Form\";\n\nimport { factoryShape } from \"lib/shapes\";\n\nfunction displayName(blueprint, owner) {\n if (owner) {\n return `${blueprint.association} (${blueprint.factory.name}, ${blueprint.factory.class_name})`;\n } else {\n return `${blueprint.factory.name} (${blueprint.factory.class_name})` ;\n }\n}\n\nfunction FactorySelection(props) {\n const { options, label, value, onChange, owner } = props;\n return (\n \n {label}\n \n \n {options.map(blueprint => (\n \n ))}\n \n \n );\n}\n\nFactorySelection.propTypes = {\n options: PropTypes.arrayOf(\n PropTypes.shape({\n factory: factoryShape.isRequired,\n association: PropTypes.string,\n })\n ).isRequired,\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n label: PropTypes.string,\n owner: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.any,\n }),\n};\n\nexport default FactorySelection;\n","import React from \"react\";\n\nimport PropTypes from 'prop-types';\n\nimport Form from \"react-bootstrap/Form\";\n\nfunction FormFieldsForOwner(props) {\n const { association, owner } = props;\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n );\n}\n\nFormFieldsForOwner.propTypes = {\n association: PropTypes.string,\n owner: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.any,\n }),\n};\n\nexport default FormFieldsForOwner;\n","import React from \"react\";\n\nimport { StyleSheet, css } from \"aphrodite\";\nimport PropTypes from \"prop-types\";\n\nimport Form from \"react-bootstrap/Form\";\n\nimport { traitsShape } from \"lib/shapes\";\n\nfunction Traits(props) {\n const { traits } = props;\n\n return (\n \n How would you like that cooked?\n
\n {traits.map(trait => (\n \n ))}\n
\n
\n );\n}\n\nTraits.propTypes = {\n disabled: PropTypes.bool,\n traits: PropTypes.arrayOf(traitsShape).isRequired,\n};\n\nconst styles = StyleSheet.create({\n traits: {\n display: \"flex\",\n flexDirection: \"column\",\n flexWrap: \"wrap\",\n maxHeight: \"6em\",\n },\n});\n\nexport default Traits;\n","import { useEffect, useRef } from \"react\";\n\nexport function classes(...classNames) {\n return classNames.filter(x => x).join(\" \");\n}\n\nexport function indexBy(items, func) {\n const indexed = {};\n items.forEach(item => indexed[func(item)] = item);\n return indexed;\n}\n\nexport function usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n","import React, { useEffect, useMemo, useState, useRef } from 'react';\n\nimport { css, StyleSheet } from 'aphrodite';\nimport PropTypes from 'prop-types';\n\nimport Button from \"react-bootstrap/Button\";\nimport Form from \"react-bootstrap/Form\";\n\nimport Attributes from \"./partials/Attributes\";\nimport FactorySelection from \"./partials/FactorySelection\";\nimport FormFieldsForOwner from \"./partials/FormFieldsForOwner\";\nimport Traits from \"./partials/Traits\";\n\nimport { factoryShape } from \"lib/shapes\";\nimport { indexBy, usePrevious } from \"./framework\";\n\nfunction FactoryForm(props) {\n const blueprints = props.blueprints || [];\n const owner = props.owner;\n const inquiry = props.inquiry || \"What'll it be?\";\n\n const [factoryInput, setFactoryInput] = useState(\"\");\n\n function handleFactory(event) {\n const value = event.target.value;\n setFactoryInput(value);\n }\n\n const indexedBluePrints = useMemo(() => indexBy(blueprints, blueprint => blueprint.factory.name), [blueprints]);\n const selectedBlueprint = useMemo(() => indexedBluePrints[factoryInput], [factoryInput]);\n const attributes = useMemo(() => selectedBlueprint && selectedBlueprint.factory.attributes || [], [selectedBlueprint]);\n const traits = useMemo(() => selectedBlueprint && selectedBlueprint.factory.traits || [], [selectedBlueprint]);\n const validSelection = !!selectedBlueprint;\n\n const prevOwner = usePrevious(props.owner);\n\n function sameOwner(owner, other) {\n const ownerType = owner && owner.type;\n const ownerId = owner && owner.id;\n const otherOwnerType = other && other.type;\n const otherOwnerId = other && other.id;\n return ownerType === otherOwnerType && ownerId == otherOwnerId;\n }\n\n useEffect(() => {\n if (!sameOwner(props.owner, prevOwner)) { setFactoryInput(\"\"); }\n }, [props.owner]);\n\n const form = useRef(null);\n\n function startOver() {\n form.current && form.current.reset();\n setFactoryInput(\"\");\n props.startOver();\n }\n\n return (\n
\n\n \n\n \n\n {traits.length > 0 && (\n \n )}\n\n {attributes.length > 0 && (\n \n )}\n\n
\n \n {' '}\n
\n \n );\n}\n\nFactoryForm.propTypes = {\n blueprints: PropTypes.arrayOf(\n PropTypes.shape({\n factory: factoryShape.isRequired,\n association: PropTypes.string,\n })\n ).isRequired,\n disabled: PropTypes.bool,\n handleSubmit: PropTypes.func,\n inquiry: PropTypes.string,\n owner: PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.any,\n }),\n startOver: PropTypes.func,\n};\n\nconst styles = StyleSheet.create({\n buttons: {\n display: \"flex\",\n justifyContent: \"space-between\",\n },\n});\n\nexport default FactoryForm;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport Alert from \"react-bootstrap/Alert\";\n\nfunction FactoryMalfunction(props) {\n const message = props.message || \"Something went wrong\";\n return (\n \n {message}\n \n );\n}\n\nFactoryMalfunction.propTypes = {\n message: PropTypes.string,\n};\n\nexport default FactoryMalfunction;\n","import React from \"react\";\n\nfunction ExternalLinkIcon() {\n return (\n \n \n \n \n \n \n )\n}\n\nexport default ExternalLinkIcon;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { StyleSheet, css } from \"aphrodite\";\n\nimport ExternalLinkIcon from \"./icons/ExternalLinkIcon\";\n\nimport { classes } from \"./framework\";\n\nfunction animationClass({ isNew, isActive }) {\n if (isNew) {\n return \"created\";\n } else if (isActive) {\n return \"selected\";\n } else {\n return null;\n }\n}\n\nfunction ObjectCard(props) {\n const { object = {} } = props;\n const attributes = object.attributes || {};\n const className = animationClass({isNew: props.new, isActive: props.active});\n return (\n
\n
\n {object.type}\n {object.link && (\n \n \n \n )}\n
\n
\n {[\"id\", \"name\"].map(key => {\n return attributes.hasOwnProperty(key) && (\n
\n {`${key}: ${attributes[key]}`}\n
\n );\n })}\n
\n
\n );\n}\n\nObjectCard.propTypes = {\n activate: PropTypes.func.isRequired,\n active: PropTypes.bool,\n new: PropTypes.bool,\n object: PropTypes.shape({\n attributes: PropTypes.object.isRequired,\n type: PropTypes.string.isRequired,\n }).isRequired,\n};\n\nconst styles = StyleSheet.create({\n active: {\n boxShadow: \"5px 5px 0px #333\",\n },\n object: {\n border: \"2px solid #222\",\n borderRadius: \"1em\",\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"0.5em\",\n marginRight: \"0.5em\",\n position: \"relative\",\n cursor: \"pointer\",\n transition: \"background-color 0.2s\",\n },\n objectDetails: {\n flex: 1,\n width: \"100%\",\n },\n objectTitle: {\n flex: 0,\n width: \"100%\",\n borderBottom: \"2px solid #222\",\n marginBottom: \"3px\",\n },\n});\n\nexport default ObjectCard;\n","import React from \"react\";\n\nimport ObjectCard from \"./ObjectCard\";\n\nfunction ObjectUnderConstruction() {\n return (\n
\n \n
\n );\n}\n\nexport default ObjectUnderConstruction;\n","import React, { useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { StyleSheet, css } from \"aphrodite\";\n\nimport { factoryShape } from \"lib/shapes\";\n\nimport FactoryForm from \"./FactoryForm\";\nimport FactoryMalfunction from \"./FactoryMalfunction\";\nimport ObjectCard from \"./ObjectCard\";\nimport ObjectUnderConstruction from \"./ObjectUnderConstruction.js\";\n\nfunction findAssociationFactory(factories, association) {\n return {\n factory: factories.find(f => f.name === association.factory_name),\n association: association.association_name,\n };\n}\n\nfunction objectId(object) {\n return {\n type: object.type,\n id: object.attributes.id,\n };\n}\n\nfunction Factories(props) {\n const { factories } = props;\n\n // Just use this for testing objects without having to create them\n // const staticObject = [{type: \"test\", attributes: {id: 1, name: \"first\"}}, {type: \"test\", attributes: {id: 1, name: \"second\"}}];\n const staticObject = [];\n\n const [constructing, setConstructing] = useState(false);\n const [error, setError] = useState(null);\n const [fetching, setFetching] = useState(false);\n const [newObjectIndex, setNewObjectIndex] = useState(null);\n const [objects, setObjects] = useState([...staticObject]);\n const [selectedObjectIndex, setSelectedObjectIndex] = useState(null);\n\n const factoryList = factories.map(factory => ({factory}));\n const selectedObject = selectedObjectIndex !== null && objects.length > 0 && objects[selectedObjectIndex];\n\n const associationFactories = useMemo(() => {\n if (!selectedObject || !selectedObject.association_factories) { return []; }\n const matchingFactories = selectedObject.association_factories.map(\n item => findAssociationFactory(factories, item)\n );\n return matchingFactories;\n }, [selectedObject]);\n\n const blueprints = selectedObject ? associationFactories : factoryList;\n const inquiry = selectedObject ? `Would you like fries with that ${selectedObject.type}?` : null;\n\n function startOver() {\n setNewObjectIndex(null);\n setNewObjectIndex(null);\n setObjects([]);\n setSelectedObjectIndex(null);\n }\n\n function selectObject(ii) {\n setNewObjectIndex(null);\n setSelectedObjectIndex(ii);\n }\n\n function handleSubmit(event) {\n event.preventDefault();\n setConstructing(true);\n setError(null);\n setFetching(true);\n const data = formData(event.target);\n submit(data);\n }\n\n async function submit(data) {\n const url = props.submitPath;\n\n const response = await fetch(url, {\n method: \"POST\",\n body: data,\n });\n\n const responseData = await response.json();\n\n if (!response.ok) {\n // eslint-disable-next-line no-console\n console.error(JSON.stringify(responseData));\n handleSubmitError(responseData.error || \"Uh oh, something broke.\");\n } else {\n handleResponseData(responseData);\n }\n }\n\n function handleResponseData(responseData) {\n if (responseData.ok) {\n // eslint-disable-next-line no-console\n console.log(JSON.stringify(responseData));\n handleObject(responseData.data);\n } else {\n // eslint-disable-next-line no-console\n console.error(responseData.error);\n handleSubmitError(responseData.error || \"Uh oh, something went wrong.\");\n }\n }\n\n function handleSubmitError(message) {\n setConstructing(false);\n setError(message);\n setFetching(false);\n }\n\n function handleObject(object) {\n setConstructing(false);\n setError(null);\n setFetching(false);\n setObjects(objects.slice().concat([object]));\n if (objects.length === 0) {\n setSelectedObjectIndex(0);\n }\n setNewObjectIndex(objects.length);\n }\n\n function formData(form) {\n const data = new FormData(form);\n data.append(\"authenticity_token\", props.csrfToken);\n return data;\n }\n\n return (\n
\n

Order Up!

\n\n {(constructing || (objects.length > 0)) && (\n <>\n {constructing ? \"Comin' right up!\" : \"Here you go!\"}\n {objects.length > 1 && (\n {\" \"}P.S. -- select any object to build out its dependencies.\n )}\n
\n {objects.map((object, ii) => (\n selectObject(ii)}\n new={newObjectIndex === ii}\n />\n ))}\n {constructing && }\n
\n \n )}\n\n {error && }\n\n
\n \n
\n
\n );\n}\n\nFactories.propTypes = {\n csrfToken: PropTypes.string,\n factories: PropTypes.arrayOf(factoryShape),\n submitPath: PropTypes.string,\n};\n\nconst styles = StyleSheet.create({\n form: {\n marginBottom: \"2em\",\n transition: \"opacity 0.5s ease-out\",\n overflow: \"hidden\",\n },\n objectList: {\n display: \"flex\",\n margin: \"0.5em 0 1em\",\n },\n});\n\nexport default Factories;\n","export function index() {\n return fetch(\"./data\")\n .then(res => res.json());\n}\n","import { useEffect } from \"react\";\n\nimport './App.css';\nimport './burgers.css';\nimport './layout.css';\n\nimport Error from \"components/Error\";\nimport Fetching from \"components/Fetching\";\nimport Factories from \"components/Factories\";\n\nimport * as api from \"lib/api\";\nimport { useRemoteData } from \"lib/hooks\";\n\nfunction App() {\n const factories = useRemoteData(api.index);\n\n useEffect(() => { console.log(factories) }, [factories]);\n\n return (\n
\n
\n
testing
\n
\n
\n {factories.fetching && }\n {factories.error && }\n {factories.response && (\n \n )}\n
\n
\n );\n}\n\nexport default App;\n","// useRemoteData -- fetch remote data with standardized fetching and error states\n//\n// USAGE\n//\n// function fetchMyData() {\n// // ... return your data or a promise for your data ...\n// }\n//\n// const data = useRemoteData(fetchMyData);\n// // -- OR --\n// const data = useRemoteData(fetchMyData, dependencies);\n//\n// Similar to `useEffect`, `dependencies` will trigger the fetch to occur again.\n// `dependencies` defaults to [], meaning the fetch will happen only once.\n\n\nimport { useEffect, useMemo, useState } from \"react\";\nexport function useRemoteData(loadFn, dependencies = []) {\n const [error, setError] = useState(null);\n const [fetching, setFetching] = useState(dependencies.length === 0);\n const [response, setResponse] = useState(null);\n\n useEffect(() => {\n setFetching(true);\n asyncFetch().then(setResponse).catch(setError).then(done);\n }, dependencies);\n\n async function asyncFetch() {\n return loadFn();\n }\n\n function done() {\n setFetching(false);\n }\n\n const value = useMemo(() => {\n return {error, fetching, response};\n }, [error, fetching, response]);\n\n return value;\n}\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}