{"version":3,"sources":["emptyTtData.tsx","components/Timetable.tsx","ttPersistance.tsx","components/TimetableList.tsx","App.tsx","serviceWorkerRegistration.ts","index.tsx"],"names":["emptyTtData","name","data","wdays","times","days","subject","teacher","room","color","fcolor","Timetable","ttId","useParams","classes","makeStyles","theme","createStyles","root","flexGrow","menuButton","marginRight","spacing","title","formControl","margin","useStyles","loadedTtData","JSON","parse","window","localStorage","getItem","useState","ttData","setTtData","drawerOpen","setDrawerOpen","editSubject","setEditSubject","editTeacher","setEditTeacher","editRoom","setEditRoom","editColor","setEditColor","editPosDay","setEditPosDay","editPosLesson","setEditPosLesson","timeDiaOpen","setTimeDiaOpen","Date","editTimeFrom","editTimeTo","colorPalette","getBGCCode","getCCode","forEach","v","parseInt","substr","saveEdit","weekDay","lesson","newTT","splice","id","setItem","stringify","tts","lsid","includes","push","saveTt","AppBar","position","Toolbar","to","IconButton","edge","className","Typography","variant","Drawer","anchor","open","onClose","style","overflowY","Fab","onClick","TextField","label","width","defaultValue","onChange","e","target","value","FormControl","fullWidth","InputLabel","Select","labelId","map","MenuItem","backgroundColor","Dialog","DialogTitle","DialogContent","utils","DateFnsUtils","TimePicker","clearable","ampm","date","DialogActions","Button","ButtonBase","i","from","el","j","TimetableList","history","useHistory","menuEl","setMenuEl","openRename","setOpenRename","openDelete","setOpenDelete","targetTt","setTargetTt","newName","setNewName","marginTop","Menu","anchorEl","keepMounted","Boolean","DialogContentText","autoFocus","type","tmpTtData","tmpTts","removeItem","console","log","length","indexOf","List","item","ListItem","button","ListItemText","primary","ListItemSecondaryAction","currentTarget","right","bottom","newId","addNewTt","App","React","useMemo","createTheme","overrides","MuiDrawer","paper","palette","ThemeProvider","CssBaseline","path","isLocalhost","location","hostname","match","registerValidSW","swUrl","config","navigator","serviceWorker","register","then","registration","onupdatefound","installingWorker","installing","onstatechange","state","controller","onUpdate","onSuccess","catch","error","ReactDOM","render","StrictMode","document","getElementById","URL","process","href","origin","addEventListener","fetch","headers","response","contentType","get","status","ready","unregister","reload","checkValidServiceWorker","serviceWorkerRegistration"],"mappings":"ggBAEaA,G,OAAsB,CAClCC,KAAM,cACNC,KAAM,CACLC,MAAO,CAAE,MAAO,MAAO,MAAO,MAAO,OACrCC,MAAO,CAAE,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,IACzCC,KAAM,CACL,CACC,CACCC,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,KAER,CACD,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,IAET,CACCJ,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,MAAO,GACPC,OAAQ,I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OY,UACpBZ,EAAOY,SAASP,KAMjBtC,QAAQC,IAAI,sCAGRgC,GAAUA,EAAOa,WACpBb,EAAOa,UAAUR,WAOtBS,OAAM,SAACC,GACPhD,QAAQgD,MAAM,4CAA6CA,MC7F9DC,IAASC,OACR,cAAC,IAAMC,WAAP,UACC,cAAC,GAAD,MAEDC,SAASC,eAAe,SDelB,SAAkBpB,GACxB,GAA6C,kBAAmBC,UAAW,CAG1E,GADkB,IAAIoB,IAAIC,GAAwB7K,OAAOkJ,SAAS4B,MACpDC,SAAW/K,OAAOkJ,SAAS6B,OAIxC,OAGD/K,OAAOgL,iBAAiB,QAAQ,WAC/B,IAAM1B,EAAK,UAAMuB,GAAN,sBAEP5B,KAgEP,SAAiCK,EAAeC,GAE/C0B,MAAM3B,EAAO,CACZ4B,QAAS,CAAE,iBAAkB,YAE5BvB,MAAK,SAACwB,GAEN,IAAMC,EAAcD,EAASD,QAAQG,IAAI,gBAEpB,MAApBF,EAASG,QACO,MAAfF,IAA8D,IAAvCA,EAAY3D,QAAQ,cAG5C+B,UAAUC,cAAc8B,MAAM5B,MAAK,SAACC,GACnCA,EAAa4B,aAAa7B,MAAK,WAC9B3J,OAAOkJ,SAASuC,eAKlBpC,GAAgBC,EAAOC,MAGxBc,OAAM,WACN/C,QAAQC,IAAI,oEAtFXmE,CAAwBpC,EAAOC,GAI/BC,UAAUC,cAAc8B,MAAM5B,MAAK,WAClCrC,QAAQC,IACP,+GAMF8B,GAAgBC,EAAOC,OCxC3BoC,K","file":"static/js/main.b7d9fcc9.chunk.js","sourcesContent":["import { ttData } from \"./components/Timetable\"\n\nexport const emptyTtData: ttData = {\n\tname: \"Stundenplan\",\n\tdata: {\n\t\twdays: [ \"Mo.\", \"Di.\", \"Mi.\", \"Do.\", \"Fr.\" ],\n\t\ttimes: [ {}, {}, {}, {}, {}, {}, {}, {}, {} ],\n\t\tdays: [\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t}\n\t\t\t],[\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t}\n\t\t\t],[\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t}\n\t\t\t],[\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t}\n\t\t\t],[\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsubject: \"\",\n\t\t\t\t\tteacher: \"\",\n\t\t\t\t\troom: \"\",\n\t\t\t\t\tcolor: \"\",\n\t\t\t\t\tfcolor: \"\"\n\t\t\t\t}\n\t\t\t]\n\t\t]\n\t}\n}\n","import React, { useState } from \"react\";\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport AppBar from '@material-ui/core/AppBar';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Drawer from \"@material-ui/core/Drawer\";\nimport Typography from '@material-ui/core/Typography';\nimport Button from '@material-ui/core/Button';\nimport Fab from \"@material-ui/core/Fab\";\nimport DoneIcon from \"@material-ui/icons/Done\"\nimport TextField from \"@material-ui/core/TextField\";\nimport ButtonBase from '@material-ui/core/ButtonBase';\nimport IconButton from '@material-ui/core/IconButton';\nimport ArrowBackIcon from '@material-ui/icons/ArrowBack';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport FormControl from '@material-ui/core/FormControl';\nimport Select from '@material-ui/core/Select';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport \"date-fns\";\nimport DateFnsUtils from '@date-io/date-fns';\nimport { MuiPickersUtilsProvider, TimePicker } from \"@material-ui/pickers\";\nimport \"./Timetable.css\";\nimport { addNewTt, saveTt } from \"../ttPersistance\";\nimport { TTJustus } from \"../TTJustus\";\nimport { emptyTtData } from \"../emptyTtData\";\nimport { useParams } from \"react-router\";\nimport { Link } from \"react-router-dom\";\n\nexport interface lesson {\n\tsubject: string | null,\n\tteacher: string | null,\n\troom: string | null,\n\tcolor: string | null,\n\tfcolor?: string | null\n}\n\nexport interface ttData {\n\tname: string,\n\tdata: {\n\t\twdays: Array\n\t\tdays: Array>\n\t\ttimes: Array<{ from?: string, to?: string }>\n\t}\n}\n\nexport default function Timetable() {\n\n\t// set Timetable ID\n\tlet { ttId } = useParams<{ttId: string}>()\n\n\tconst useStyles = makeStyles((theme: Theme) =>\n\t\tcreateStyles({\n\t\t\troot: {\n\t\t\t\tflexGrow: 1,\n\t\t\t},\n\t\t\tmenuButton: {\n\t\t\t\tmarginRight: theme.spacing(2),\n\t\t\t},\n\t\t\ttitle: {\n\t\t\t\tflexGrow: 1,\n\t\t\t},\n\t\t\tformControl: {\n\t\t\t\tmargin: 0,\n\t\t\t},\n\t\t}),\n\t);\n\tconst classes = useStyles();\n\n\t// const exampleTtData = TTJustus\n\tconst loadedTtData = JSON.parse(window.localStorage.getItem(`ttData-${ttId}`) || \"false\") || emptyTtData\n\n\t// eslint-disable-next-line\n\tconst [ttData, setTtData] = useState(loadedTtData)\n\tconst [drawerOpen, setDrawerOpen] = useState(false)\n\tconst [editSubject, setEditSubject] = useState(\"\")\n\tconst [editTeacher, setEditTeacher] = useState(\"\")\n\tconst [editRoom, setEditRoom] = useState(\"\")\n\tconst [editColor, setEditColor] = useState(\"\")\n\tconst [editPosDay, setEditPosDay] = useState(0)\n\tconst [editPosLesson, setEditPosLesson] = useState(0)\n\tconst [timeDiaOpen, setTimeDiaOpen] = useState(false)\n\tconst [editTimeFrom, setEditTimeFrom] = useState(new Date())\n\tconst [editTimeTo, setEditTimeTo] = useState(new Date())\n\n\tconst colorPalette = [\n\t\t{\n\t\t\tname: \"Grau\",\n\t\t\tcolor: \"#303030\",\n\t\t\tfcolor: \"#ffffff\"\n\t\t},\n\t\t{\n\t\t\tname: \"Gelb\",\n\t\t\tcolor: \"#ffeb3c\",\n\t\t\tfcolor: \"#000000\"\n\t\t},\n\t\t{\n\t\t\tname: \"Grün\",\n\t\t\tcolor: \"#4cb050\",\n\t\t\tfcolor: \"#ffffff\"\n\t\t},\n\t\t{\n\t\t\tname: \"Lila\",\n\t\t\tcolor: \"#9c28b1\",\n\t\t\tfcolor: \"#ffffff\"\n\t\t},\n\t\t{\n\t\t\tname: \"Rot\",\n\t\t\tcolor: \"#f44236\",\n\t\t\tfcolor: \"#ffffff\"\n\t\t},\n\t\t{\n\t\t\tname: \"Schwarz\",\n\t\t\tcolor: \"#000000\",\n\t\t\tfcolor: \"#ffffff\"\n\t\t},\n\t\t{\n\t\t\tname: \"Orange\",\n\t\t\tcolor: \"#ff9700\",\n\t\t\tfcolor: \"#ffffff\"\n\t\t},\n\t\t{\n\t\t\tname: \"Blau\",\n\t\t\tcolor: \"#3f51b5\",\n\t\t\tfcolor: \"#ffffff\"\n\t\t},\n\t\t{\n\t\t\tname: \"Hellgrün\",\n\t\t\tcolor: \"#8bc24a\",\n\t\t\tfcolor: \"#ffffff\"\n\t\t},\n\t\t{\n\t\t\tname: \"Weiß\",\n\t\t\tcolor: \"#ffffff\",\n\t\t\tfcolor: \"#000000\"\n\t\t},\n\t]\n\n\t/**\n\t * Get the hex color code from a word\n\t * @param {string} color - The color as a word (yellow, green, ...)\n\t * @returns {string} Hex color code.\n\t */\n\tfunction getBGCCode(color: string | null): string | null {\n\t\tswitch (color) {\n\t\t\tcase \"yellow\":\n\t\t\t\treturn \"#ffeb3c\"\n\t\t\tcase \"green\":\n\t\t\t\treturn \"#4cb050\"\n\t\t\tcase \"purple\":\n\t\t\t\treturn \"#9c28b1\"\n\t\t\tcase \"red\":\n\t\t\t\treturn \"#f44236\"\n\t\t\tcase \"black\":\n\t\t\t\treturn \"#000000\"\n\t\t\tcase \"orange\":\n\t\t\t\treturn \"#ff9700\"\n\t\t\tcase \"blue\":\n\t\t\t\treturn \"#3f51b5\"\n\t\t\tcase \"lightgreen\":\n\t\t\t\treturn \"#8bc24a\"\n\t\t\tcase \"white\":\n\t\t\t\treturn \"#ffffff\"\n\t\t\tdefault:\n\t\t\t\t// return \"#303030\"\n\t\t\t\treturn null\n\t\t}\n\t}\n\n\tfunction getCCode(color: string): string {\n\t\tlet fcolor: string = \"\"\n\t\tcolorPalette.forEach((v) => {\n\t\t\tif (v.color === color) {\n\t\t\t\tfcolor = v.fcolor\n\t\t\t}\n\t\t})\n\t\tif (fcolor === \"\") {\n\t\t\treturn calcCCode(color)\n\t\t}\n\t\treturn fcolor\n\t}\n\n\t/**\n\t * \n\t * @param {string} hexcolor - The BG color as Hex\n\t * @returns {string} - The appropriate font color so that the contrast is roughly sufficiant.\n\t */\n\t// eslint-disable-next-line\n\tfunction calcCCode(hexcolor: string): string {\n\t\treturn (\n\t\t\t(\n\t\t\t\tparseInt(hexcolor.substr(1), 16) > 0xffffff/2\n\t\t\t) ? '#000000' : '#ffffff'\n\t\t)\n\t}\n\n\t/**\n\t * \n\t * @param {number} weekDay - The weekday index (i)\n\t * @param {number} lesson - The lesson index (j)\n\t */\n\tfunction editLesson(weekDay: number, lesson: number) {\n\t\tsetEditPosDay(weekDay)\n\t\tsetEditPosLesson(lesson)\n\t\tsetEditSubject(ttData.data.days[weekDay][lesson].subject || \"\")\n\t\tsetEditTeacher(ttData.data.days[weekDay][lesson].teacher || \"\")\n\t\tsetEditRoom(ttData.data.days[weekDay][lesson].room || \"\")\n\t\tsetEditColor(ttData.data.days[weekDay][lesson].color || \"#303030\")\n\t\tsetDrawerOpen(true)\n\t}\n\n\t/**\n\t * \n\t * @param {number} weekDay - The weekday index (i)\n\t * @param {number} lesson - The lesson index (j)\n\t * @param {lesson} data - The lesson data\n\t */\n\tfunction saveEdit(weekDay: number, lesson: number, data: lesson) {\n\t\tconst newTT = [...ttData.data.days]\n\t\tnewTT[weekDay].splice(lesson, 1, data)\n\t\tsetTtData({\n\t\t\t...ttData,\n\t\t\tdata: {\n\t\t\t\t...ttData.data,\n\t\t\t\tdays: newTT\n\t\t\t}\n\t\t})\n\t\tsaveTt(ttId, ttData)\n\t\tsetDrawerOpen(false)\n\t}\n\n\treturn (\n\t\t
\n\t\t\t\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\n\t\t\t\t\t{ttData.name}\n\t\t\t\t\n\t\t\t\n\t\t\tsetDrawerOpen(false)} style={{overflowY: \"inherit\"}}>\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{/* Add-button */}\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tsaveEdit(editPosDay, editPosLesson, {\n\t\t\t\t\t\t\t\tsubject: editSubject,\n\t\t\t\t\t\t\t\tteacher: editTeacher,\n\t\t\t\t\t\t\t\troom: editRoom,\n\t\t\t\t\t\t\t\tcolor: editColor,\n\t\t\t\t\t\t\t\tfcolor: getCCode(editColor)\n\t\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{/* Input for subject */}\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetEditSubject(e.target.value)\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{/* Input for teacher */}\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetEditTeacher(e.target.value)\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{/* Input for room */}\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetEditRoom(e.target.value)\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\tFarbe\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\tif (typeof e.target.value === \"string\") {\n\t\t\t\t\t\t\t\t\t\tsetEditColor(e.target.value)\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tsetEditColor(\"#303030\")\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\tlabel=\"Farbe\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{colorPalette.map((v) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t{v.name}\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
\n\t\t\t
\n\t\t\t setTimeDiaOpen(false)} aria-labelledby=\"time-dialog-title\">\n\t\t\t\tZeiten einstellen\n\t\t\t\t\n\t\t\t\t\t{/* \n\t\t\t\t\t\tStelle hier die Zeiten ein.\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/>\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\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\t
\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
S
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t{/* Function for generating the number of lessons. TODO: make this dynamic and add begin and end time. */}\n\t\t\t\t\t\t{ttData.data.times.map((v, i) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t// setTimeDiaOpen(true)\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\t\t{!(v.from || v.to) ?
{i+1}
: null}\n\t\t\t\t\t\t\t\t\t{v.from ?
{v.from}
: null}\n\t\t\t\t\t\t\t\t\t{v.to ?
{v.to}
: null}\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
\n\t\t\t\t{/* Iterate through each day */}\n\t\t\t\t{ttData.data.days.map((el, i) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
{ttData.data.wdays[i]}
\n\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\t{/* Iterate through each lesson on a given day */}\n\t\t\t\t\t\t\t\t{el.map((el, j)=>{\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t// i: weekDay; j: lesson\n\t\t\t\t\t\t\t\t\t\t\t\t// console.log(i, j)\n\t\t\t\t\t\t\t\t\t\t\t\teditLesson(i, j)\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t
{el.subject}
\n\t\t\t\t\t\t\t\t\t\t\t
{el.teacher}
\n\t\t\t\t\t\t\t\t\t\t\t
{el.room}
\n\t\t\t\t\t\t\t\t\t\t\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\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})}\n\t\t\t
\n\t\t\n\t)\n}\n","import { emptyTtData } from \"./emptyTtData\"\nimport { ttData } from \"./components/Timetable\"\n\nexport function addNewTt(id?: string) {\n\tif (!localStorage[\"tts\"]) {\n\t\tlocalStorage.setItem(\"tts\", JSON.stringify([]))\n\t}\n\tconst tts: Array = JSON.parse(localStorage.getItem(\"tts\") || \"[]\")\n\tlet newId = id ? \"ttData-\"+id : \"ttData-\"+(tts.length+1)\n\tif (localStorage[newId]) {\n\t\tnewId = newId+\"-new\"\n\t}\n\tlocalStorage.setItem(newId, JSON.stringify(emptyTtData))\n\ttts.push(newId)\n\tlocalStorage.setItem(\"tts\", JSON.stringify(tts))\n\n\treturn newId.substr(7)\n}\nexport function saveTt(id: string, ttData: ttData) {\n\tif (!localStorage[\"tts\"]) {\n\t\tlocalStorage.setItem(\"tts\", JSON.stringify([]))\n\t}\n\tconst tts: Array = JSON.parse(localStorage.getItem(\"tts\") || \"[]\")\n\tconst lsid = `ttData-${id}` // lsid: Local Storage ID\n\tif (!tts.includes(lsid)) {\n\t\ttts.push(lsid)\n\t}\n\tlocalStorage.setItem(\"tts\", JSON.stringify(tts))\n\tlocalStorage.setItem(lsid, JSON.stringify(ttData))\n}\n","import React, { useState } from \"react\";\nimport AppBar from \"@material-ui/core/AppBar\";\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Typography from '@material-ui/core/Typography';\nimport List from '@material-ui/core/List';\nimport ListItem, { ListItemProps } from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport MoreVertIcon from \"@material-ui/icons/MoreVert\";\nimport IconButton from '@material-ui/core/IconButton';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Button from '@material-ui/core/Button';\nimport TextField from '@material-ui/core/TextField';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Fab from '@material-ui/core/Fab';\nimport AddIcon from '@material-ui/icons/Add';\nimport { Link, useHistory } from \"react-router-dom\";\nimport { addNewTt } from \"../ttPersistance\";\nimport { ttData } from \"./Timetable\";\n\nfunction ListItemLink(props: any) {\n\tconst { icon, primary, to } = props;\n\n\tconst CustomLink = React.useMemo(\n\t\t() =>\n\t\t\tReact.forwardRef((linkProps, ref) => (\n\t\t\t\t\n\t\t\t)),\n\t\t[to],\n\t)\n\n\treturn (\n\t\t
  • \n\t\t\t\n\t\t\t\t{/* {icon} */}\n\t\t\t\t\n\t\t\t\n\t\t
  • \n\t)\n}\n\nexport default function TimetableList() {\n\tconst history = useHistory()\n\n\tconst [menuEl, setMenuEl] = useState(null)\n\tconst [openRename, setOpenRename] = useState(false)\n\tconst [openDelete, setOpenDelete] = useState(false)\n\tconst [targetTt, setTargetTt] = useState(null)\n\tconst [newName, setNewName] = useState(\"\")\n\n\tfunction getTtList() {\n\t\tif (!localStorage[\"tts\"]) {\n\t\t\tlocalStorage.setItem(\"tts\", JSON.stringify([]))\n\t\t}\n\t\tconst tts: Array = JSON.parse(localStorage.getItem(\"tts\") || \"[]\")\n\n\t\treturn tts.map((item) => {\n\t\t\tif (!localStorage[item]) return {name: null, id: null}\n\t\t\treturn (\n\t\t\t\t{\n\t\t\t\t\tname: JSON.parse(localStorage.getItem(item) || \"\").name,\n\t\t\t\t\tid: item.substr(7)\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\n\t\t\t\t\tStundenpläne\n\t\t\t\t\n\t\t\t\n\t\t\t
    \n\t\t\t\t{/* */}\n\t\t\t\t {\n\t\t\t\t\t\tsetMenuEl(null)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t {\n\t\t\t\t\t\tsetMenuEl(null)\n\t\t\t\t\t\tsetOpenRename(true)\n\t\t\t\t\t}}>Umbenennen\n\t\t\t\t\t {\n\t\t\t\t\t\tsetMenuEl(null)\n\t\t\t\t\t\tsetOpenDelete(true)\n\t\t\t\t\t}}>Löschen\n\t\t\t\t\n\t\t\t\t setOpenRename(false)} aria-labelledby=\"rename-dialog-title\">\n\t\t\t\t\tUmbenennen\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tGib hier den neuen Namen für den Stundenplan ein.\n\t\t\t\t\t\t\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tsetNewName(e.target.value)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tfullWidth\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\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t setOpenDelete(false)}\n\t\t\t\t\taria-labelledby=\"delete-dialog-title\"\n\t\t\t\t\taria-describedby=\"delete-dialog-description\"\n\t\t\t\t>\n\t\t\t\t\tStundenplan löschen?\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tWillst du diesen Stundenplan wirklich löschen?\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\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{getTtList().map((item) => {\n\t\t\t\t\t\tif (item) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t {history.push(`/timetable/${(item.id || \"\")}`)}}>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tsetMenuEl(e.currentTarget)\n\t\t\t\t\t\t\t\t\t\tsetTargetTt(item.id)\n\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\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} else return null\n\t\t\t\t\t})}\n\t\t\t\t\n\t\t\t\t {\n\t\t\t\t\t\thistory.push(`/timetable/${addNewTt()}`)\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
    \n\t\t
    \n\t)\n}\n","import React from \"react\";\n// import useMediaQuery from '@material-ui/core/useMediaQuery';\n// import Button from \"@material-ui/core/Button\";\nimport { createTheme, ThemeProvider } from '@material-ui/core/styles';\nimport CssBaseline from '@material-ui/core/CssBaseline';\n\nimport {\n\tBrowserRouter as Router,\n\tSwitch,\n\tRoute,\n\t// Link,\n\t// Redirect\n} from \"react-router-dom\";\nimport Timetable from \"./components/Timetable\";\nimport TimetableList from \"./components/TimetableList\";\n\nfunction App() {\n\tconst prefersDarkMode = true // useMediaQuery('(prefers-color-scheme: dark)');\n\tconst theme = React.useMemo(\n\t\t() =>\n\t\t\tcreateTheme({\n\t\t\t\toverrides: {\n\t\t\t\t\tMuiDrawer: {\n\t\t\t\t\t\tpaper: {\n\t\t\t\t\t\t\toverflowY: \"unset\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tpalette: {\n\t\t\t\t\ttype: prefersDarkMode ? 'dark' : 'light',\n\t\t\t\t},\n\t\t\t}),\n\t\t[prefersDarkMode],\n\t);\n\n\treturn (\n\t\t\n\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\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\n\t\t\t\t\n\t\t\n\t\t\n\t);\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://cra.link/PWA\n\nconst isLocalhost = Boolean(\n\twindow.location.hostname === 'localhost' ||\n\t\t// [::1] is the IPv6 localhost address.\n\t\twindow.location.hostname === '[::1]' ||\n\t\t// 127.0.0.0/8 are considered localhost for IPv4.\n\t\twindow.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\ntype Config = {\n\tonSuccess?: (registration: ServiceWorkerRegistration) => void;\n\tonUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n\tif (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n\t\t// The URL constructor is available in all browsers that support SW.\n\t\tconst publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n\t\tif (publicUrl.origin !== window.location.origin) {\n\t\t\t// Our service worker won't work if PUBLIC_URL is on a different origin\n\t\t\t// from what our page is served on. This might happen if a CDN is used to\n\t\t\t// serve assets; see https://github.com/facebook/create-react-app/issues/2374\n\t\t\treturn;\n\t\t}\n\n\t\twindow.addEventListener('load', () => {\n\t\t\tconst swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n\t\t\tif (isLocalhost) {\n\t\t\t\t// This is running on localhost. Let's check if a service worker still exists or not.\n\t\t\t\tcheckValidServiceWorker(swUrl, config);\n\n\t\t\t\t// Add some additional logging to localhost, pointing developers to the\n\t\t\t\t// service worker/PWA documentation.\n\t\t\t\tnavigator.serviceWorker.ready.then(() => {\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t'This web app is being served cache-first by a service ' +\n\t\t\t\t\t\t\t'worker. To learn more, visit https://cra.link/PWA'\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Is not localhost. Just register service worker\n\t\t\t\tregisterValidSW(swUrl, config);\n\t\t\t}\n\t\t});\n\t}\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n\tnavigator.serviceWorker\n\t\t.register(swUrl)\n\t\t.then((registration) => {\n\t\t\tregistration.onupdatefound = () => {\n\t\t\t\tconst installingWorker = registration.installing;\n\t\t\t\tif (installingWorker == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tinstallingWorker.onstatechange = () => {\n\t\t\t\t\tif (installingWorker.state === 'installed') {\n\t\t\t\t\t\tif (navigator.serviceWorker.controller) {\n\t\t\t\t\t\t\t// At this point, the updated precached content has been fetched,\n\t\t\t\t\t\t\t// but the previous service worker will still serve the older\n\t\t\t\t\t\t\t// content until all client tabs are closed.\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t'New content is available and will be used when all ' +\n\t\t\t\t\t\t\t\t\t'tabs for this page are closed. See https://cra.link/PWA.'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Execute callback\n\t\t\t\t\t\t\tif (config && config.onUpdate) {\n\t\t\t\t\t\t\t\tconfig.onUpdate(registration);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// At this point, everything has been precached.\n\t\t\t\t\t\t\t// It's the perfect time to display a\n\t\t\t\t\t\t\t// \"Content is cached for offline use.\" message.\n\t\t\t\t\t\t\tconsole.log('Content is cached for offline use.');\n\n\t\t\t\t\t\t\t// Execute callback\n\t\t\t\t\t\t\tif (config && config.onSuccess) {\n\t\t\t\t\t\t\t\tconfig.onSuccess(registration);\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})\n\t\t.catch((error) => {\n\t\t\tconsole.error('Error during service worker registration:', error);\n\t\t});\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n\t// Check if the service worker can be found. If it can't reload the page.\n\tfetch(swUrl, {\n\t\theaders: { 'Service-Worker': 'script' },\n\t})\n\t\t.then((response) => {\n\t\t\t// Ensure service worker exists, and that we really are getting a JS file.\n\t\t\tconst contentType = response.headers.get('content-type');\n\t\t\tif (\n\t\t\t\tresponse.status === 404 ||\n\t\t\t\t(contentType != null && contentType.indexOf('javascript') === -1)\n\t\t\t) {\n\t\t\t\t// No service worker found. Probably a different app. Reload the page.\n\t\t\t\tnavigator.serviceWorker.ready.then((registration) => {\n\t\t\t\t\tregistration.unregister().then(() => {\n\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Service worker found. Proceed as normal.\n\t\t\t\tregisterValidSW(swUrl, config);\n\t\t\t}\n\t\t})\n\t\t.catch(() => {\n\t\t\tconsole.log('No internet connection found. App is running in offline mode.');\n\t\t});\n}\n\nexport function unregister() {\n\tif ('serviceWorker' in navigator) {\n\t\tnavigator.serviceWorker.ready\n\t\t\t.then((registration) => {\n\t\t\t\tregistration.unregister();\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error.message);\n\t\t\t});\n\t}\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorkerRegistration from './serviceWorkerRegistration';\n\nReactDOM.render(\n\t\n\t\t\n\t,\n\tdocument.getElementById('root')\n);\n\nserviceWorkerRegistration.register();\n"],"sourceRoot":""}