{"version":3,"sources":["components/Nav/LoginButton.js","components/Nav/LogoutButton.js","components/Nav/AuthNav.js","components/Nav/PublicNav.js","components/Nav/index.js","components/Nav/Nav.js","components/Loading.js","components/Header.js","components/Footer.js","components/Layout.js","pages/Public.js","components/Todo.js","pages/Todo.js","pages/Poll.js","pages/Profile.js","components/ContentReview/ContentReview.js","components/ContentReview/index.js","pages/ContentReview.js","auth/ProtectedRoute.js","App.js","auth/auth0-provider-with-history.js","serviceWorker.js","index.js"],"names":["LoginButton","loginWithRedirect","useAuth0","className","onClick","LogoutButton","logout","returnTo","window","location","origin","AuthNav","isAuthenticated","href","id","data-bs-toggle","aria-expanded","src","alt","width","height","aria-labelledby","PublicNav","children","xlinkHref","aria-current","Nav","type","placeholder","aria-label","Loading","React","Component","Header","style","Footer","Date","getFullYear","Layout","Public","Todo","todo","setTodos","setAuthorOptions","getAuthorOptions","getPublisherOptions","setPublisherOptions","authorOptions","publisherOptions","extra","useState","edit","setEdit","author","publisher","uri","content","draftTodoValue","setDraftTodoValue","getAccessTokenSilently","formatTodoComponent","data","reactSelect","map","value","_id","label","name","console","log","handleEdit","a","async","handleReset","onSubmit","e","preventDefault","token","axios","post","process","headers","Authorization","then","oldTodos","index","catch","error","title","isMulti","defaultOptions","onChange","changedInput","action","option","removedValue","selectObject","o","target","htmlFor","rows","length","reduce","accumulator","currentValue","concat","open","pubDate","TodoList","todos","useEffect","options","initAuthorOptions","initPublisherOptions","input","get","key","updateTodos","getTodos","fetchTodos","filter","item","Poll","withAuthenticationRequired","user","picture","email","JSON","stringify","onRedirecting","Fragment","fragment","setRatings","category","ratings","rating","setRating","handleChange","OverlayTrigger","placement","trigger","rootClose","overlay","props","Popover","Title","as","Content","includes","toString","Button","variant","ContentReview","record","setRecord","disabledSubmit","setDisabledSubmit","modalShow","setModalShow","getArrayURI","split","unratedElements","getInitialContent","setFragmentRating","fragmentRating","updatedRecord","ratingIndex","findIndex","element","arr","disabled","Modal","size","centered","Body","onHide","show","ProtectedRoute","component","args","App","isLoading","path","exact","Profile","Auth0ProviderWithHistory","history","useHistory","domain","clientId","redirectUri","onRedirectCallback","appState","push","pathname","audience","Boolean","hostname","match","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"wLAgBeA,EAZK,WAAO,IACjBC,EAAsBC,cAAtBD,kBACR,OACE,4BACEE,UAAU,4BACVC,QAAS,kBAAMH,MAFjB,WCaWI,EAhBM,WAAO,IAClBC,EAAWJ,cAAXI,OACR,OACE,4BACEH,UAAU,+BACVC,QAAS,kBACPE,EAAO,CACLC,SAAUC,OAAOC,SAASC,WAJhC,YCkBWC,EAjBC,WAGf,OAF4BT,cAApBU,gBAGP,yBAAKT,UAAU,0BACd,uBAAGU,KAAK,IAAIV,UAAU,yDAAyDW,GAAG,gBAAgBC,iBAAe,WAAWC,gBAAc,SACzI,yBAAKC,IAAI,6BAA6BC,IAAI,MAAMC,MAAM,KAAKC,OAAO,KAAKjB,UAAU,oBAElF,wBAAIA,UAAU,kCAAkCkB,kBAAgB,gBAC/D,4BAAI,uBAAGlB,UAAU,gBAAgBU,KAAK,KAAlC,YACJ,4BAAI,wBAAIV,UAAU,sBAClB,4BAAI,kBAAC,EAAD,SAGH,kBAAC,EAAD,OCEUmB,EArBG,SAACC,GAAc,IACxBX,EAAoBV,cAApBU,gBAER,OACC,yBAAKT,UAAU,YACd,uBAAGU,KAAK,IAAIV,UAAU,iGAAiGW,GAAG,kBAAkBC,iBAAe,WAAWC,gBAAc,SACnL,yBAAKb,UAAU,UAAUgB,MAAM,KAAKC,OAAO,MAAK,yBAAKI,UAAU,iBAEhE,wBAAIrB,UAAU,kCAAkCkB,kBAAgB,mBAC/D,4BAAI,uBAAGlB,UAAU,uBAAuBU,KAAK,IAAIY,eAAa,QAA1D,aACJ,4BAAI,uBAAGtB,UAAU,gBAAgBU,KAAK,KAAlC,YACHD,EACD,oCACC,4BAAI,wBAAIT,UAAU,sBAClB,4BAAI,uBAAGA,UAAU,gBAAgBU,K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YAA2BuD,EAAW,CAC/CjD,cAAe,kBAAM,kBAAC,EAAD,UAEnBkD,KCwBOC,MAlBf,WAGC,OAFsBlL,cAAdmL,UAGE,kBAAC,EAAD,MAIT,kBAAC,IAAD,KACC,kBAAC,IAAD,CAAOC,KAAK,IAAIC,OAAK,EAACL,UAAW3I,IACjC,kBAAC,EAAD,CAAgB+I,KAAK,QAAQJ,UAAW1I,IACxC,kBAAC,EAAD,CAAgB8I,KAAK,WAAWJ,UAAWM,IAC3C,kBAAC,EAAD,CAAgBF,KAAK,QAAQJ,UAAWxD,IACxC,kBAAC,EAAD,CAAgB4D,KAAK,oBAAoBJ,UAAW1B,M,QCDxCiC,EAxBkB,SAAC,GAAkB,IAAhBlK,EAAe,EAAfA,SAK5BmK,EAAUC,cAMhB,OACE,kBAAC,IAAD,CACEC,OAZW5G,4BAaX6G,SAZa7G,mCAab8G,YAAatL,OAAOC,SAASC,OAC7BqL,mBATuB,SAACC,GAC1BN,EAAQO,MAAa,OAARD,QAAQ,IAARA,OAAA,EAAAA,EAAUzL,WAAYC,OAAOC,SAASyL,WASpDC,SAdenH,4BAgBXzD,ICba6K,QACW,cAA7B5L,OAAOC,SAAS4L,UAEe,UAA7B7L,OAAOC,SAAS4L,UAEhB7L,OAAOC,SAAS4L,SAASC,MACvB,2DCRNC,IAASC,OACR,kBAAC,IAAD,KACG,kBAAC,EAAD,KACD,kBAAC,EAAD,QAEUC,SAASC,eAAe,SDoH/B,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM1H,MAAK,SAAA2H,GACjCA,EAAaC,iB","file":"static/js/main.17580d8d.chunk.js","sourcesContent":["//https://auth0.com/blog/complete-guide-to-react-user-authentication/\nimport React from \"react\";\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nconst LoginButton = () => {\n const { loginWithRedirect } = useAuth0();\n return (\n loginWithRedirect()}\n >\n Log In\n \n );\n};\n\nexport default LoginButton;","//https://auth0.com/blog/complete-guide-to-react-user-authentication/\nimport React from \"react\";\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nconst LogoutButton = () => {\n const { logout } = useAuth0();\n return (\n \n logout({\n returnTo: window.location.origin,\n })\n }\n >\n Log Out\n \n );\n};\n\nexport default LogoutButton;","//https://auth0.com/blog/complete-guide-to-react-user-authentication/\nimport React from \"react\";\n\nimport LoginButton from \"./LoginButton\";\nimport LogoutButton from \"./LogoutButton\";\n\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nconst AuthNav = () => {\n\tconst { isAuthenticated } = useAuth0();\n\n\treturn isAuthenticated ? (\n\t\t
\n\t\t\t\n\t\t\t\t\"mdo\"\n\t\t\t\n\t\t\t
    \n\t\t\t\t
  • Profile
  • \n\t\t\t\t

  • \n\t\t\t\t
  • \n\t\t\t
\n\t\t
\n\t) : \n}\n\nexport default AuthNav;","import React from \"react\";\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nconst PublicNav = (children) => {\n\tconst { isAuthenticated } = useAuth0();\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t
    \n\t\t\t\t
  • Overview
  • \n\t\t\t\t
  • Ratings
  • \n\t\t\t\t{isAuthenticated ? \n\t\t\t\t<>\n\t\t\t\t\t

  • \n\t\t\t\t\t
  • Todo
  • \n\t\t\t\t : <>\n\t\t\t\t}\n\t\t\t
\n\t\t
\n)}\n\nexport default PublicNav;","import Nav from \"./Nav\";\n\nexport default Nav;","import React from 'react';\nimport { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';\n\nimport AuthNav from './AuthNav';\nimport PublicNav from './PublicNav';\n\nconst Nav = () => {\n\n\treturn (<>\n\t\t\n\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\n\t\t\t\n\t\t
\n\t);\n}\n\nexport default Nav;","//https://github.com/auth0-blog/auth0-react-sample-classes/blob/main/src/components/loading.js\n\nimport React from \"react\";\nconst loadingImg =\n \"https://cdn.auth0.com/blog/auth0-react-sample/assets/loading.svg\";\n\nclass Loading extends React.Component {\n render() {\n return (\n
\n \"Loading...\"\n
\n );\n }\n}\n\nexport default Loading;","import React from 'react';\nimport { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';\nimport Nav from './Nav';\n\nconst Header = () => {\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t
\n\t);\n}\n\nexport default Header;","import React from 'react';\nimport { Link } from '@reach/router';\n\nconst Footer = () => {\n\treturn (\t\n\t\t<>\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\tCopyright © {new Date().getFullYear()}\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t);\n}\n\nexport default Footer;","import React from 'react';\nimport Header from './Header';\nimport Footer from './Footer';\n\nconst Layout = ({children}) => {\n\treturn (\n\t\t\t<>\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\n\t);\n}\n\nexport default Layout;","import React from 'react';\nimport Layout from '../components/Layout';\n\nconst Public = ({location}) => {\n return (\n \n

Public Page

\n

Static HTML Page

\n
\n )\n}\nexport default Public;","import React, {useState, useEffect} from 'react';\nimport axios from 'axios';\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nimport AsyncCreatableSelect from 'react-select/async-creatable';\n\n\nexport const Todo = ({ todo, setTodos, getAuthorOptions, getPublisherOptions, setAuthorOptions, setPublisherOptions, authorOptions, publisherOptions, ...extra }) => {\n\tconst [edit, setEdit] = useState(false);\n\tconst [updatedTodo, setUpdatedTodo] = useState({});\n\n\tconst [draftTodoValue, setDraftTodoValue] = useState({\n\t\tauthor: todo.author,\n\t\tpublisher: todo.publisher,\n\t\turi: todo.uri,\n\t\tcontent: todo.content ? todo.content : \"\"\n\t});\n\n\tconst { getAccessTokenSilently } = useAuth0();\n\n\t//data to be transformed; type is data type; reactSelect is TRUE/FALSE on which format to use - for TRUE use {value: *, label: *}\n\tconst formatTodoComponent = (data, type, reactSelect) => {\n\t\tswitch(type){\n\t\t\tcase \"author\":\n\t\t\t\treturn reactSelect ? data.map( ({_id, name}) => ({\n\t\t\t\t\tvalue: _id,\n\t\t\t\t\tlabel: name\n\t\t\t\t})) : data.map(({value, label}) => ({\n\t\t\t\t\t_id: value,\n\t\t\t\t\tname: label\n\t\t\t\t}) );\n\t\t\tbreak;\n\t\t\tcase \"publisher\":\n\t\t\t\treturn reactSelect ? {\n\t\t\t\t\tvalue: data._id,\n\t\t\t\t\tlabel: data.name\n\t\t\t\t} : {\n\t\t\t\t\t_id: data.value,\n\t\t\t\t\tname: data.label\n\t\t\t\t};\n\t\t\tbreak;\n\t\t\tcase \"quality\":\n\t\t\t\tconsole.log(\"format todo function not configured\");\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tconst handleEdit = async () => {\n setEdit(!edit);\n }\n\tconst handleCancel = async () => {\t\t\n\t\tawait handleReset();\n\t\tawait handleEdit();\n\t}\n\tconst handleReset = async () => {\t\n\t\tawait setDraftTodoValue({ ...todo});\n\t\treturn(true);\n\t}\n\tconst handleChange = (e) => {\n\t\te.preventDefault();\n\t\tsetDraftTodoValue({...draftTodoValue, [e.target.name]: e.target.value});\n\t}\n\n\tconst handleAuthorChange = async (changedInput, {action, option, removedValue, name}) => {\n\t\tconst token = await getAccessTokenSilently();\n\t\tswitch(action){\n\t\t\tcase 'create-option':\n\t\t\t\tawait axios.post(process.env.REACT_APP_SERVER_URL+'/api/authors/add', { name: option.label }, {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t\t.then(async ({data}) => {\n\t\t\t\t\t\tlet selectObject = { value: data._id, label: data.name };\n\t\t\t\t\t\tsetAuthorOptions( o => [...o, selectObject] );\n\t\t\t\t\t\tsetDraftTodoValue( o => ({ ...draftTodoValue,\n\t\t\t\t\t\t\tauthor: [...o, formatTodoComponent(data,\"author\",false)]\n\t\t\t\t\t\t}) );\n\t\t\t\t\t})\n\t\t\t\t\t.catch( error => {\n\t\t\t\t\t\tconsole.log(\"There was an error handling the Author creation: \", error);\n\t\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'select-option':\n\t\t\tcase 'deselect-option':\n\t\t\tcase 'remove-value':\n\t\t\tcase 'clear':\t\n\t\t\tcase 'pop-value':\n\t\t\t\tconsole.log(changedInput)\n\t\t\t\tawait setDraftTodoValue( (o) => ({...draftTodoValue, \n\t\t\t\t\tauthor: formatTodoComponent(changedInput,\"author\",false)\n\t\t\t\t}) );\n\t\t\t\tbreak;\n\t\t\tcase 'set-value':\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tconst handlePublisherChange = async (changedInput, {action, option, removedValue, name}) => {\n\t\tconst token = await getAccessTokenSilently();\n\t\tswitch(action){\n\t\t\tcase 'create-option':\n\t\t\t\tawait axios.post(process.env.REACT_APP_SERVER_URL+'/api/publishers/add', { name: option.label }, {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t\t.then(({data}) => {\n\t\t\t\t\t\tlet selectObject = { value: data._id, label: data.name };\n\t\t\t\t\t\tsetPublisherOptions( o => [...o, selectObject] );\n\t\t\t\t\t\tsetDraftTodoValue( o => ({...draftTodoValue,\n\t\t\t\t\t\t\tpublisher: [formatTodoComponent(data,\"publisher\",false)]\n\t\t\t\t\t\t}) );\n\t\t\t\t\t})\n\t\t\t\t\t.catch( error => {\n\t\t\t\t\t\tconsole.log(\"There was an error handling the Publisher creation: \", error);\n\t\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase 'select-option':\n\t\t\tcase 'deselect-option':\n\t\t\tcase 'remove-value':\n\t\t\tcase 'clear':\t\n\t\t\tcase 'pop-value':\n\t\t\t\tawait setDraftTodoValue( (o) => ({...draftTodoValue,\n\t\t\t\t\tpublisher: formatTodoComponent(changedInput,\"publisher\",false)\n\t\t\t\t}) );\n\t\t\t\tbreak;\n\t\t\tcase 'set-value':\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tconst handleSubmit = async (e) => {\n\t\te.preventDefault();\n\t\tconst token = await getAccessTokenSilently();\n\t\taxios.post(process.env.REACT_APP_SERVER_URL+'/api/articles/edit/'+todo._id, draftTodoValue, {\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then( ({data}) => {\n\t\t\t\thandleEdit();\n\t\t\t\tsetTodos(oldTodos => {\n\t\t\t\t\tlet newTodos = oldTodos.map((todo, index) => {\n\t\t\t\t\t\tif(todo._id == data._id){\n\t\t\t\t\t\t\treturn data;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn todo;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\treturn newTodos;\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.log(\"There was an error saving the item: \", error)\n\t\t\t});\n\t}\n\t\n\tconst authorReducer = (accumulator, currentValue, index) => index > 0 ? accumulator.concat(\", \", currentValue.name) : currentValue.name;\n\n\treturn (\n\t\t
\n\t\t{!edit ? (\n\t\t\t<>\n\t\t\t
\n\t\t\t\t
{todo.title ? todo.title : \"\"}
\n\t\t\t\t
{todo._id}
\n\t\t\t\t

Author: {todo.author && todo.author.length > 0 ? todo.author.reduce(authorReducer, \"\") : \"\"}

\n\t\t\t\t

Publisher: {todo.publisher && todo.publisher.name ? todo.publisher.name : \"\"}

\n\t\t\t\tOpen\n\t\t\t\t
{todo.content.length > 0 ? (\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\tAdded on {todo.pubDate}\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t) : (\n\t\t\t\t<>
\n\t\t\t\t\t
{todo.title}
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tAuthor(s)\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tPublisher\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tGo to article.\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t)\n\t\t}\n\t\t
\n\t);\n}\n\nconst TodoList = ({ todos, setTodos }) => {\n\tconst [authorOptions, setAuthorOptions] = useState([]);\n\tconst [publisherOptions, setPublisherOptions] = useState([]);\n\tconst { getAccessTokenSilently } = useAuth0();\n\n\t//loads the options initially\n\tuseEffect( () => {\n\t\tconst initAuthorOptions = async () => {\n\t\t\tconst options = await getAuthorOptions(\"\");\n\t\t\tsetAuthorOptions(options);\n\t\t}\n\t\tconst initPublisherOptions = async () => {\n\t\t\tconst options = await getPublisherOptions(\"\");\n\t\t\tsetPublisherOptions(options);\n\t\t}\n\t\tinitAuthorOptions();\n\t\tinitPublisherOptions();\n\t}, []);\n\n\n\tconst getAuthorOptions = async (input) => {\n\t\tconst token = await getAccessTokenSilently();\n\t\treturn axios.get(process.env.REACT_APP_SERVER_URL+'/api/authors/'+input, {\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then(async ({data}) => {\n\t\t\t\treturn data.map( ({_id, name}) => ({ value: _id, label: name }) );\n\t\t\t})\n\t\t\t.catch( error => {\n\t\t\t\tconsole.log(error);\n\t\t\t});\n\t}\n\tconst getPublisherOptions = async (input) => {\n\t\tconst token = await getAccessTokenSilently();\n\t\treturn axios.get(process.env.REACT_APP_SERVER_URL+'/api/publishers/'+input, {\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then(async ({data}) => {\n\t\t\t\treturn data.map( ({_id, name}) => ({ value: _id, label: name }) );\n\t\t\t})\n\t\t\t.catch( error => {\n\t\t\t\tconsole.log(error);\n\t\t\t});\n\t}\n\n\n\treturn (\n <>\n {(todos || []).map((todo, index) => (\n \n ))}\n \n)};\n\nexport default TodoList;","//pending articles to assess or assign to publisher and/or author\nimport React, {useEffect, useState} from 'react';\nimport axios from 'axios';\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nimport Layout from '../components/Layout';\nimport TodoList from '../components/Todo';\n\nconst Todo = () => {\n\tconst [todos, setTodos] = useState([]);\n\tconst { getAccessTokenSilently } = useAuth0();\n\t\n\tconst updateTodos = (content) => {\n\t\tconsole.log(\"this is an update: \", content)\n\t\tsetTodos(content)\n\t};\n\n\tuseEffect( () => { \n\t\tasync function fetchTodos(){\n\t\t\tconst token = await getAccessTokenSilently();\n\t\t\tconst getTodos = await axios.get(process.env.REACT_APP_SERVER_URL+'/api/todos/', {\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t}\n\t\t\t})\n\t\t\t\n\t\t\tsetTodos(getTodos.data);\n\t\t}\n\t\tfetchTodos();\n\t}, [])\n\n return (\n \n

Content Todos

\n\t\t\t<>\n\t\t\t\t !(item.content.length > 0) )} setTodos={updateTodos} />\n\t\t\t\n\t\t\t

Rating Todos

\n\t\t\t<>\n\t\t\t\t item.content.length > 0 )} setTodos={updateTodos} />\n\t\t\t\n
\n )\n}\n\nexport default Todo;","import React, {useState} from 'react';\nimport Layout from '../components/Layout';\nimport axios from 'axios';\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nconst Poll = ({location}) => {\n\tconst { getAccessTokenSilently } = useAuth0();\n\n\tconst getPoll = async (e) => {\n\t\te.preventDefault();\n\n\t\tconst token = await getAccessTokenSilently();\n\t\treturn axios.get(process.env.REACT_APP_SERVER_URL+'/api/articles/poll', {\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t}\n\t\t\t})\n\t\t\t.then(async ({data}) => {\n\t\t\t\tconsole.log(data);\n\t\t\t})\n\t\t\t.catch( error => {\n\t\t\t\tconsole.log(error);\n\t\t\t});\n\t}\n return (\n \n

Polling Page

\n

Use the button below to poll for articles. Be very careful with this button as its use is metered by NewsAPI.

\n\t\t\t\n\t\t\t
\n
\n )\n}\nexport default Poll;","// https://auth0.com/blog/complete-guide-to-react-user-authentication/\nimport React from \"react\";\n\nimport { useAuth0, withAuthenticationRequired } from \"@auth0/auth0-react\";\nimport Loading from \"../components/Loading\";\n\nconst Profile = () => {\n const { user } = useAuth0();\n const { name, picture, email } = user;\n\n return (\n
\n
\n
\n \n
\n
\n

{name}

\n

{email}

\n
\n
\n
\n
\n          {JSON.stringify(user, null, 2)}\n        
\n
\n
\n );\n};\n\nexport default withAuthenticationRequired(Profile, {\n onRedirecting: () => ,\n});","import React, {useState, useEffect} from 'react';\nimport Button from 'react-bootstrap/Button';\nimport Modal from 'react-bootstrap/Modal';\nimport Popover from 'react-bootstrap/Popover'; \nimport OverlayTrigger from 'react-bootstrap/OverlayTrigger';\nimport axios from 'axios';\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nimport \"./ContentReview.css\";\n\nconst Fragment = ({ fragment, setRatings }) => {\n\tconst [rating, setRating] = useState({\n\t\tcategory: fragment.ratings[0] ? fragment.ratings[0].category : null,\n\t\trating: fragment.ratings[0] ? fragment.ratings[0].rating : null\n\t});\n\n\tconst handleChange = (e) => {\n\t\t//update local component state\n\t\tif(e.target.name == \"category\") {\n\t\t\tsetRating({\n\t\t\t\t[e.target.name]: e.target.value,\n\t\t\t})\n\t\t} else {\n\t\t\tsetRating({ ...rating,\n\t\t\t\t[e.target.name]: e.target.value\n\t\t\t})\n\t\t}\n\t\t//update parent component state\n\t\tsetRatings({ \n\t\t\t_id: fragment._id,\n\t\t\tcategory: e.target.name == \"category\" ? e.target.value : rating.category,\n\t\t\trating: e.target.name == \"rating\" ? e.target.value : rating.rating,\n\t\t});\n\t}\n\n\tconst renderPopoverContent = (props) => {\n\t\treturn (\n\t\t\t\n\t\t\t\tClassify sentence\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t{ rating.category === \"fact\" ?\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t: \"\"}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nconst ReviewContent = ({ todo }) => {\n\tconst [record, setRecord] = useState([]);\n\tconst [disabledSubmit, setDisabledSubmit] = useState(true);\n\tconst [modalShow, setModalShow] = useState(false);\n\tconst { getAccessTokenSilently } = useAuth0();\n\n\t//loads initial content\n\tuseEffect(() => {\n\t\tsetDisabledSubmit(true);\n\n\t\tconst getInitialContent = async () => {\n\t\t\tconst token = await getAccessTokenSilently();\n\t\t\tconst getArrayURI = (window.location.href).split(\"/\");\n\t\t\tconst id = getArrayURI[getArrayURI.length-1];\n\t\t\tawait axios.get(process.env.REACT_APP_SERVER_URL+'/api/articles/'+id, {\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t}\n\t\t\t})\n\t\t\t\t.then(async ({data}) => {\n\t\t\t\t\tsetRecord(data);\n\t\t\t\t\tsetDisabledSubmit(unratedElements(data));\n\t\t\t\t})\n\t\t\t\t.catch( error => {\n\t\t\t\t\tconsole.log(\"There was an error handling the submit: \", error);\n\t\t\t\t});\n\n\t\t}\n\n\t\tgetInitialContent();\n\t}, []);\n\n\tconst setFragmentRating = ( fragmentRating ) => {\n\t\tif(fragmentRating._id){\n\t\t\tconst updatedRecord = record;\n\t\t\tconst ratingIndex = record.content.findIndex(element => element._id === fragmentRating._id)\n\t\t\tupdatedRecord.content[ratingIndex].ratings = [{\n\t\t\t\tcategory: fragmentRating.category,\n\t\t\t\trating: fragmentRating.rating\n\t\t\t}];\n\t\t\tsetRecord(updatedRecord);\n\t\t\tsetDisabledSubmit(unratedElements(updatedRecord));\n\t\t} else {\n\t\t}\n\t}\n\n\tlet unratedElements = (record) => {\n\t\tconst content = record.content;\n\n\t\tlet filteredRecords = content.filter( (element) => {\n\t\t\treturn (\n\t\t\t\telement.fragment && element.fragment.length > 0 &&\n\t\t\t\telement.ratings && \n\t\t\t\t\t(\n\t\t\t\t\t\telement.ratings.length > 0 && !( \n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t[\"analysis\", \"other\"].includes(element.ratings[0].category) || \n\t\t\t\t\t\t\t( \n\t\t\t\t\t\t\t\telement.ratings[0].category == \"fact\" && [\n\t\t\t\t\t\t\t\t\"0\", \"1\", \"2\", \"3\", \"4\", \"5\"].includes(element.ratings[0].rating ? \n\t\t\t\t\t\t\t\t\telement.ratings[0].rating.toString() : \n\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) \n\t\t\t\t\t\t)\n\t\t\t\t\t) || \n\t\t\t\t\telement.ratings.length == 0\n\t\t\t\t)\n\t\t\t)\n\t\t});\n\t\treturn(filteredRecords.length > 0);\n\t}\n\n\tconst handleSubmit = async (e) => {\n\t\tsetDisabledSubmit(true);\n\t\tconst token = await getAccessTokenSilently();\n\t\tconst getArrayURI = (window.location.href).split(\"/\");\n\t\tconst id = getArrayURI[getArrayURI.length-1];\n\n\t\tawait axios.post(process.env.REACT_APP_SERVER_URL+'/api/articles/edit/'+id, { content: record.content }, {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t\t.then(async ({data}) => {\n\t\t\t\t\t\tsetDisabledSubmit(false);\n\t\t\t\t\t\tsetModalShow(true);\n\t\t\t\t\t})\n\t\t\t\t\t.catch( error => {\n\t\t\t\t\t\tsetDisabledSubmit(false);\n\t\t\t\t\t\tconsole.log(\"There was an error handling the submit: \", error);\n\t\t\t\t\t});\n\t}\n\n\tlet ModalSaveComplete = (props) => {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tSave Complete\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t

\n\t\t\t\t\t\tYour assessment has saved successfully. You can now close this tab or return to modify your ratings.\n\t\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ((record ? record.content : [] ) || []).map(function(fragment, index, arr){\n\t\t\t\tif(fragment.fragment === \"\") {} else {\n\t\t\t\t\tif(index === (arr.length - 1) ) { //if last item in array\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) }\n\t\t\t\t\n\t\t\t\t setModalShow(false)}\n\t\t\t\t/>\n\t\t\n\t);\n}\n\nexport default ReviewContent;","import ContentReview from \"./ContentReview\";\n\nexport default ContentReview;","import React from 'react';\n\nimport Layout from '../components/Layout';\nimport ReviewContent from '../components/ContentReview';\n\nconst ContentReview = () => {\n return (\n \n \n \n )\n}\n\nexport default ContentReview;","// https://auth0.com/blog/complete-guide-to-react-user-authentication/#Retrieving-User-Information\n\nimport React from \"react\";\nimport { Route } from \"react-router-dom\";\nimport { withAuthenticationRequired } from \"@auth0/auth0-react\";\nimport Loading from \"../components/Loading\";\n\nconst ProtectedRoute = ({ component, ...args }) => (\n ,\n })}\n {...args}\n />\n);\n\nexport default ProtectedRoute;","import React from 'react';\nimport { BrowserRouter as Router, Route, Switch } from 'react-router-dom';\nimport { useAuth0 } from \"@auth0/auth0-react\";\n\nimport Nav from \"./components/Nav\";\nimport Loading from \"./components/Loading\";\n\nimport './App.css';\n\nimport Public from './pages/Public';\nimport Home from './pages/Home';\nimport Todo from './pages/Todo';\nimport Poll from './pages/Poll';\nimport Profile from \"./pages/Profile\";\nimport ContentReview from \"./pages/ContentReview\";\n\nimport ProtectedRoute from \"./auth/ProtectedRoute\";\n\nfunction App() {\n\tconst { isLoading } = useAuth0();\n\n\tif (isLoading) {\n return ;\n }\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n}\n\nexport default App;","//https://auth0.com/blog/complete-guide-to-react-user-authentication/\n\nimport React from \"react\";\nimport { useHistory } from \"react-router-dom\";\nimport { Auth0Provider } from \"@auth0/auth0-react\";\n\nconst Auth0ProviderWithHistory = ({ children }) => {\n const domain = process.env.REACT_APP_AUTH0_DOMAIN;\n const clientId = process.env.REACT_APP_AUTH0_CLIENT_ID;\n\tconst audience = process.env.REACT_APP_AUTH0_AUDIENCE;\t\n\n const history = useHistory();\n\n const onRedirectCallback = (appState) => {\n history.push(appState?.returnTo || window.location.pathname);\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport default Auth0ProviderWithHistory;","// 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.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\n\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport Auth0ProviderWithHistory from \"./auth/auth0-provider-with-history\";\n\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n\t\n \n\t\t\t \n\t\t\n , 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":""}