{"version":3,"sources":["store/WeatherForecasts.ts","store/Counter.ts","../index.tsx","../App.tsx","components/Home.tsx","components/Counter.tsx","components/FetchData.tsx","../Projects.tsx","registerServiceWorker.ts","store/index.ts","store/configureStore.ts","components/NavMenu.tsx","components/Layout.tsx"],"names":["actionCreators","requestWeatherForecasts","startDateIndex","dispatch","getState","appState","weatherForecasts","fetch","then","response","json","data","type","forecasts","unloadedState","isLoading","reducer","state","incomingAction","undefined","action","increment","decrement","count","exports","default","React","connect","className","Counter","render","id","aria-live","this","props","onClick","counter","CounterStore","FetchData","componentDidMount","ensureDataFetched","componentDidUpdate","renderForecastsTable","renderPagination","parseInt","match","params","aria-labelledby","map","forecast","key","date","temperatureC","temperatureF","summary","prevStartDateIndex","nextStartDateIndex","to","WeatherForecastsStore","createElement","isLocalhost","Boolean","window","location","hostname","register","navigator","URL","process","toString","origin","addEventListener","swUrl","contentType","headers","get","status","indexOf","serviceWorker","ready","registration","unregister","reload","registerValidSW","catch","console","log","checkValidServiceWorker","onupdatefound","installingWorker","installing","onstatechange","controller","error","reducers","WeatherForecasts","configureStore","history","initialState","middleware","thunk","routerMiddleware","rootReducer","combineReducers","router","connectRouter","enhancers","windowIfDefined","__REDUX_DEVTOOLS_EXTENSION__","push","createStore","compose","applyMiddleware","NavMenu","isOpen","toggle","setState","Navbar","Container","NavbarBrand","tag","Link","NavbarToggler","Collapse","navbar","NavItem","NavLink","children"],"mappings":"qHAGA,oEAuCO,IAAMA,EAAiB,CAC1BC,wBAA0BC,GAAwD,CAACC,EAAUC,KAEzF,IAAMC,EAAWD,IACbC,GAAYA,EAASC,kBAAoBJ,IAAmBG,EAASC,iBAAiBJ,iBACtFK,MAAM,mBACDC,KAAKC,GAAYA,EAASC,QAC1BF,KAAKG,IACFR,EAAS,CAAES,KAAM,4BAA6BV,eAAgBA,EAAgBW,UAAWF,MAGjGR,EAAS,CAAES,KAAM,4BAA6BV,eAAgBA,OAQpEY,EAAuC,CAAED,UAAW,GAAIE,WAAW,GA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D,CAAU/F,UAAU,2BAA2BsF,OAAQjF,KAAKhB,MAAMiG,OAAQU,QAAM,GAC5E,sBAAIhG,UAAU,sBACV,gBAACiG,EAAA,EAAD,CAASjG,UAAU,yBACf,gBAACkG,EAAA,EAAD,CAASN,IAAKC,IAAM7F,UAAU,qCAAqC6B,GAAG,KAAtE,SAEJ,gBAACoE,EAAA,EAAD,CAASjG,UAAU,yBACf,gBAACkG,EAAA,EAAD,CAASN,IAAKC,IAAM7F,UAAU,qCAAqC6B,GAAG,YAAtE,YAEJ,gBAACoE,EAAA,EAAD,CAASjG,UAAU,yBACf,gBAACkG,EAAA,EAAD,CAASN,IAAKC,IAAM7F,UAAU,qCAAqC6B,GAAG,aAAtE,aAEJ,gBAACoE,EAAA,EAAD,CAASjG,UAAU,yBACf,gBAACkG,EAAA,EAAD,CAASN,IAAKC,IAAM7F,UAAU,qCAAqC6B,GAAG,eAAtE,qBCzBpBvB,aACZ,gBAAC,WAAD,KACI,gBAAC,EAAD,MAEKA,EAAM6F,Y","file":"static/js/main.34a3c275.chunk.js","sourcesContent":["import { Action, Reducer } from 'redux';\r\nimport { AppThunkAction } from './';\r\n\r\n// -----------------\r\n// STATE - This defines the type of data maintained in the Redux store.\r\n\r\nexport interface WeatherForecastsState {\r\n isLoading: boolean;\r\n startDateIndex?: number;\r\n forecasts: WeatherForecast[];\r\n}\r\n\r\nexport interface WeatherForecast {\r\n date: string;\r\n temperatureC: number;\r\n temperatureF: number;\r\n summary: string;\r\n}\r\n\r\n// -----------------\r\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\r\n// They do not themselves have any side-effects; they just describe something that is going to happen.\r\n\r\ninterface RequestWeatherForecastsAction {\r\n type: 'REQUEST_WEATHER_FORECASTS';\r\n startDateIndex: number;\r\n}\r\n\r\ninterface ReceiveWeatherForecastsAction {\r\n type: 'RECEIVE_WEATHER_FORECASTS';\r\n startDateIndex: number;\r\n forecasts: WeatherForecast[];\r\n}\r\n\r\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\r\n// declared type strings (and not any other arbitrary string).\r\ntype KnownAction = RequestWeatherForecastsAction | ReceiveWeatherForecastsAction;\r\n\r\n// ----------------\r\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\r\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\r\n\r\nexport const actionCreators = {\r\n requestWeatherForecasts: (startDateIndex: number): AppThunkAction => (dispatch, getState) => {\r\n // Only load data if it's something we don't already have (and are not already loading)\r\n const appState = getState();\r\n if (appState && appState.weatherForecasts && startDateIndex !== appState.weatherForecasts.startDateIndex) {\r\n fetch(`weatherforecast`)\r\n .then(response => response.json() as Promise)\r\n .then(data => {\r\n dispatch({ type: 'RECEIVE_WEATHER_FORECASTS', startDateIndex: startDateIndex, forecasts: data });\r\n });\r\n\r\n dispatch({ type: 'REQUEST_WEATHER_FORECASTS', startDateIndex: startDateIndex });\r\n }\r\n }\r\n};\r\n\r\n// ----------------\r\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\r\n\r\nconst unloadedState: WeatherForecastsState = { forecasts: [], isLoading: false };\r\n\r\nexport const reducer: Reducer = (state: WeatherForecastsState | undefined, incomingAction: Action): WeatherForecastsState => {\r\n if (state === undefined) {\r\n return unloadedState;\r\n }\r\n\r\n const action = incomingAction as KnownAction;\r\n switch (action.type) {\r\n case 'REQUEST_WEATHER_FORECASTS':\r\n return {\r\n startDateIndex: action.startDateIndex,\r\n forecasts: state.forecasts,\r\n isLoading: true\r\n };\r\n case 'RECEIVE_WEATHER_FORECASTS':\r\n // Only accept the incoming data if it matches the most recent request. This ensures we correctly\r\n // handle out-of-order responses.\r\n if (action.startDateIndex === state.startDateIndex) {\r\n return {\r\n startDateIndex: action.startDateIndex,\r\n forecasts: action.forecasts,\r\n isLoading: false\r\n };\r\n }\r\n break;\r\n }\r\n\r\n return state;\r\n};\r\n","import { Action, Reducer } from 'redux';\r\n\r\n// -----------------\r\n// STATE - This defines the type of data maintained in the Redux store.\r\n\r\nexport interface CounterState {\r\n count: number;\r\n}\r\n\r\n// -----------------\r\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\r\n// They do not themselves have any side-effects; they just describe something that is going to happen.\r\n// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\r\n\r\nexport interface IncrementCountAction { type: 'INCREMENT_COUNT' }\r\nexport interface DecrementCountAction { type: 'DECREMENT_COUNT' }\r\n\r\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\r\n// declared type strings (and not any other arbitrary string).\r\nexport type KnownAction = IncrementCountAction | DecrementCountAction;\r\n\r\n// ----------------\r\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\r\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\r\n\r\nexport const actionCreators = {\r\n increment: () => ({ type: 'INCREMENT_COUNT' } as IncrementCountAction),\r\n decrement: () => ({ type: 'DECREMENT_COUNT' } as DecrementCountAction)\r\n};\r\n\r\n// ----------------\r\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\r\n\r\nexport const reducer: Reducer = (state: CounterState | undefined, incomingAction: Action): CounterState => {\r\n if (state === undefined) {\r\n return { count: 0 };\r\n }\r\n\r\n const action = incomingAction as KnownAction;\r\n switch (action.type) {\r\n case 'INCREMENT_COUNT':\r\n return { count: state.count + 1 };\r\n case 'DECREMENT_COUNT':\r\n return { count: state.count - 1 };\r\n default:\r\n return state;\r\n }\r\n};\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nrequire(\"bootstrap/dist/css/bootstrap.css\");\r\nvar React = require(\"react\");\r\nvar ReactDOM = require(\"react-dom\");\r\nvar react_redux_1 = require(\"react-redux\");\r\nvar connected_react_router_1 = require(\"connected-react-router\");\r\nvar history_1 = require(\"history\");\r\nvar configureStore_1 = require(\"./store/configureStore\");\r\nvar App_1 = require(\"./App\");\r\nvar registerServiceWorker_1 = require(\"./registerServiceWorker\");\r\n// Create browser history to use in the Redux store\r\nvar baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\r\nvar history = history_1.createBrowserHistory({ basename: baseUrl });\r\n// Get the application-wide store instance, prepopulating with state from the server where available.\r\nvar store = configureStore_1.default(history);\r\nReactDOM.render(React.createElement(react_redux_1.Provider, { store: store },\r\n React.createElement(connected_react_router_1.ConnectedRouter, { history: history },\r\n React.createElement(App_1.default, null))), document.getElementById('root'));\r\nregisterServiceWorker_1.default();\r\n//# sourceMappingURL=index.js.map","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar React = require(\"react\");\r\nvar react_router_1 = require(\"react-router\");\r\nvar Layout_1 = require(\"./components/Layout\");\r\nvar Home_1 = require(\"./components/Home\");\r\nvar Counter_1 = require(\"./components/Counter\");\r\nvar FetchData_1 = require(\"./components/FetchData\");\r\nvar Projects_1 = require(\"./components/Projects\");\r\nrequire(\"./custom.css\");\r\nexports.default = (function () { return (React.createElement(Layout_1.default, null,\r\n React.createElement(react_router_1.Route, { exact: true, path: '/', component: Home_1.default }),\r\n React.createElement(react_router_1.Route, { path: '/counter', component: Counter_1.default }),\r\n React.createElement(react_router_1.Route, { path: '/projects', component: Projects_1.default }),\r\n React.createElement(react_router_1.Route, { path: '/fetch-data/:startDateIndex?', component: FetchData_1.default }))); });\r\n//# sourceMappingURL=App.js.map","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\n\r\nconst Home = () => (\r\n
\r\n
\r\n

Andrew Black

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n

Dad - Web Developer - Geek

\r\n
\r\n
\r\n);\r\n\r\nexport default connect()(Home);\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { ApplicationState } from '../store';\r\nimport * as CounterStore from '../store/Counter';\r\n\r\ntype CounterProps =\r\n CounterStore.CounterState &\r\n typeof CounterStore.actionCreators &\r\n RouteComponentProps<{}>;\r\n\r\nclass Counter extends React.PureComponent {\r\n public render() {\r\n return (\r\n \r\n
\r\n
\r\n\r\n

Counter

\r\n\r\n

This is a simple example of a React component.

\r\n\r\n

Current count: {this.props.count}

\r\n\r\n \r\n
\r\n
\r\n
\r\n );\r\n }\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.counter,\r\n CounterStore.actionCreators\r\n)(Counter);\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { Link } from 'react-router-dom';\r\nimport { ApplicationState } from '../store';\r\nimport * as WeatherForecastsStore from '../store/WeatherForecasts';\r\n\r\n// At runtime, Redux will merge together...\r\ntype WeatherForecastProps =\r\n WeatherForecastsStore.WeatherForecastsState // ... state we've requested from the Redux store\r\n & typeof WeatherForecastsStore.actionCreators // ... plus action creators we've requested\r\n & RouteComponentProps<{ startDateIndex: string }>; // ... plus incoming routing parameters\r\n\r\n\r\nclass FetchData extends React.PureComponent {\r\n // This method is called when the component is first added to the document\r\n public componentDidMount() {\r\n this.ensureDataFetched();\r\n }\r\n\r\n // This method is called when the route parameters change\r\n public componentDidUpdate() {\r\n this.ensureDataFetched();\r\n }\r\n\r\n public render() {\r\n return (\r\n \r\n

Weather forecast

\r\n

This component demonstrates fetching data from the server and working with URL parameters.

\r\n {this.renderForecastsTable()}\r\n {this.renderPagination()}\r\n
\r\n );\r\n }\r\n\r\n private ensureDataFetched() {\r\n const startDateIndex = parseInt(this.props.match.params.startDateIndex, 10) || 0;\r\n this.props.requestWeatherForecasts(startDateIndex);\r\n }\r\n\r\n private renderForecastsTable() {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {this.props.forecasts.map((forecast: WeatherForecastsStore.WeatherForecast) =>\r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n
DateTemp. (C)Temp. (F)Summary
{forecast.date}{forecast.temperatureC}{forecast.temperatureF}{forecast.summary}
\r\n );\r\n }\r\n\r\n private renderPagination() {\r\n const prevStartDateIndex = (this.props.startDateIndex || 0) - 5;\r\n const nextStartDateIndex = (this.props.startDateIndex || 0) + 5;\r\n\r\n return (\r\n
\r\n Previous\r\n {this.props.isLoading && Loading...}\r\n Next\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.weatherForecasts, // Selects which state properties are merged into the component's props\r\n WeatherForecastsStore.actionCreators // Selects which action creators are merged into the component's props\r\n)(FetchData as any);\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar React = require(\"react\");\r\nvar react_redux_1 = require(\"react-redux\");\r\nvar react_helmet_1 = require(\"react-helmet\");\r\nrequire(\"./Projects.css\");\r\nvar Projects = function () { return (React.createElement(\"section\", { className: \"page-section masthead mb-0\", id: \"projects\" },\r\n React.createElement(\"div\", { className: \"container\" },\r\n React.createElement(\"h2\", { className: \"page-section-heading text-center text-uppercase text-secondary mb-0\" }, \"Projects\"),\r\n React.createElement(\"div\", { className: \"divider-custom\" },\r\n React.createElement(\"div\", { className: \"divider-custom-line\" }),\r\n React.createElement(\"div\", { className: \"divider-custom-icon\" },\r\n React.createElement(\"i\", { className: \"fas fa-star\" })),\r\n React.createElement(\"div\", { className: \"divider-custom-line\" })),\r\n React.createElement(\"div\", { className: \"row\" },\r\n React.createElement(\"div\", { className: \"col-lg-8 mx-auto\" },\r\n React.createElement(\"div\", { className: \"row\" },\r\n React.createElement(\"div\", { className: \"col-xs-12\" },\r\n React.createElement(\"h3\", null, \"Snake\"),\r\n React.createElement(\"p\", null, \"Simple snake JavaScript game.\"),\r\n React.createElement(\"canvas\", { id: \"myCanvas\", width: \"507\", height: \"601\" })))))),\r\n React.createElement(react_helmet_1.Helmet, null,\r\n React.createElement(\"script\", { src: \"./legacy/snake.js\", type: \"text/javascript\" })))); };\r\nexports.default = react_redux_1.connect()(Projects);\r\n//# sourceMappingURL=Projects.js.map","// In production, we register a service worker to serve assets from local cache.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\r\n// cached resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\r\n// This link also includes instructions on opting out of this behavior.\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport default function register() {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const url = process.env.PUBLIC_URL as string;\r\n const publicUrl = new URL(url, window.location.toString());\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Lets check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl);\r\n } else {\r\n // Is not local host. Just register service worker\r\n registerValidSW(swUrl);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing as ServiceWorker;\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the old content will have been purged and\r\n // the fresh content will have been added to the cache.\r\n // It's the perfect time to display a \"New content is\r\n // available; please refresh.\" message in your web app.\r\n console.log('New content is available; please refresh.');\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (response.status === 404 || (contentType && contentType.indexOf('javascript') === -1)) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl);\r\n }\r\n })\r\n .catch(() => {\r\n console.log('No internet connection found. App is running in offline mode.');\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import * as WeatherForecasts from './WeatherForecasts';\r\nimport * as Counter from './Counter';\r\n\r\n// The top-level state object\r\nexport interface ApplicationState {\r\n counter: Counter.CounterState | undefined;\r\n weatherForecasts: WeatherForecasts.WeatherForecastsState | undefined;\r\n}\r\n\r\n// Whenever an action is dispatched, Redux will update each top-level application state property using\r\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\r\n// acts on the corresponding ApplicationState property type.\r\nexport const reducers = {\r\n counter: Counter.reducer,\r\n weatherForecasts: WeatherForecasts.reducer\r\n};\r\n\r\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\r\n// correctly typed to match your store.\r\nexport interface AppThunkAction {\r\n (dispatch: (action: TAction) => void, getState: () => ApplicationState): void;\r\n}\r\n","import { applyMiddleware, combineReducers, compose, createStore } from 'redux';\r\nimport thunk from 'redux-thunk';\r\nimport { connectRouter, routerMiddleware } from 'connected-react-router';\r\nimport { History } from 'history';\r\nimport { ApplicationState, reducers } from './';\r\n\r\nexport default function configureStore(history: History, initialState?: ApplicationState) {\r\n const middleware = [\r\n thunk,\r\n routerMiddleware(history)\r\n ];\r\n\r\n const rootReducer = combineReducers({\r\n ...reducers,\r\n router: connectRouter(history)\r\n });\r\n\r\n const enhancers = [];\r\n const windowIfDefined = typeof window === 'undefined' ? null : window as any;\r\n if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) {\r\n enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__());\r\n }\r\n\r\n return createStore(\r\n rootReducer,\r\n initialState,\r\n compose(applyMiddleware(...middleware), ...enhancers)\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';\r\nimport { Link } from 'react-router-dom';\r\nimport './NavMenu.css';\r\n\r\nexport default class NavMenu extends React.PureComponent<{}, { isOpen: boolean }> {\r\n public state = {\r\n isOpen: false\r\n };\r\n\r\n public render() {\r\n return (\r\n
\r\n \r\n \r\n Andrew Black\r\n \r\n \r\n
    \r\n \r\n Home\r\n \r\n \r\n Counter\r\n \r\n \r\n Projects\r\n \r\n \r\n Fetch data\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n private toggle = () => {\r\n this.setState({\r\n isOpen: !this.state.isOpen\r\n });\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { Container } from 'reactstrap';\r\nimport NavMenu from './NavMenu';\r\n\r\nexport default (props: { children?: React.ReactNode }) => (\r\n \r\n \r\n\r\n {props.children}\r\n\r\n \r\n);\r\n"],"sourceRoot":""}