{"version":3,"sources":["_platform/src/utils/getReturnUrlPath.js","containers/LoginPage/LoginPage.js","containers/LoginPage/images/LoginPage.png","../node_modules/memoize-one/dist/memoize-one.esm.js","_platform/src/components/MessageBox/MessageBox.js","_platform/src/utils/checkPermissions.js","_platform/src/utils/checkRoles.js","_platform/src/utils/PrivateComponent.js","_platform/src/utils/PublicComponent.js"],"names":["pageQueryString","qs","parse","history","location","search","replace","ignoreQueryPrefix","LoginProvider","LoadAsync","__webpack_require__","e","then","bind","LoginForm","Promise","all","PageContainer","styled","div","_templateObject","thd","BgLogin","LogosContainer","_templateObject2","WelcomeText","p","_templateObject3","LoginContainer","_templateObject4","withTheme","withSettings","_ref","settings","react_default","a","createElement","PublicComponent","redirectOnError","getReturnUrlPath","settingsApp","loginPagePath","Helmet_default","smooth_ui_core_sc_es","justifyContent","xs","sm","md","className","src","Logo","alt","Logo2","disableMeta","formLabels","labelUserName","href","module","exports","safeIsNaN","Number","isNaN","value","areInputsEqual","newInputs","lastInputs","length","i","first","second","__webpack_exports__","resultFn","isEqual","lastThis","lastResult","lastArgs","calledOnce","newArgs","_i","arguments","this","apply","StyledAlert","Alert","Title","Multiline","MessageBox","children","_ref$title","title","undefined","_ref$variant","variant","react__WEBPACK_IMPORTED_MODULE_1___default","defaultProps","checkPermissions","currentUser","requiredPermissions","Array","isArray","permissions","some","item","indexOf","propTypes","PropTypes","object","isRequired","array","checkPermissionsMemoized","memoizeOne","checkRoles","requiredRoles","roles","checkRolesMemoized","PrivateComponent","_this$props","props","deniedPermissions","deniedRoles","displayError","errorMessage","publicOnly","tempAuthAllowed","user","_this$props2","currentUserTemp","UnauthorisedComponent","RedirectOnErrorComponent","react_router","push","to","userObject","token","userId","Component","mapStateToProps","createStructuredSelector","selectCurrentUser","selectCurrentUserTemp","connect","react__WEBPACK_IMPORTED_MODULE_0__","react__WEBPACK_IMPORTED_MODULE_0___default","n","_PrivateComponent__WEBPACK_IMPORTED_MODULE_1__","Object","assign"],"mappings":"+MAWeA,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CAA6BK,YAAU","file":"static/js/loginPage.6e16f489.chunk.js","sourcesContent":["import qs from 'qs';\nimport history from '_platform/src/utils/history';\n\nconst pageQueryString = qs.parse(\n // Normalise key\n history.location.search.replace(/returnUrl/gi, 'returnUrl'),\n {\n ignoreQueryPrefix: true,\n }\n);\n\nexport default pageQueryString.returnUrl;\n","/**\n * Login Page\n */\n\n// Core imports\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\n// Style, SEO and settings\nimport Helmet from 'react-helmet';\nimport { Col, Grid, Row, thd, styled, withTheme } from '@smooth-ui/core-sc';\n\n// Additional Components/Containers\nimport LoadAsync from '_platform/src/utils/LoadAsync';\nimport PublicComponent from '_platform/src/utils/PublicComponent';\nimport getReturnUrlPath from '_platform/src/utils/getReturnUrlPath';\n\nimport { withSettings } from 'containers/WebApp/SettingsContext';\nimport Logo from 'theme/Logo-AusReo-LoginPage@2x.png';\nimport Logo2 from 'theme/Logo-ReoRewards-LoginPage@2x.png';\nimport BgLogin from './images/LoginPage.png';\n\nconst LoginProvider = LoadAsync(() =>\n import(\n /* webpackChunkName: \"loginProvider\" */ '_platform/src/containers/LoginProvider/LoginProvider'\n )\n);\nconst LoginForm = LoadAsync(() =>\n import(\n /* webpackChunkName: \"loginForm\" */ '_platform/src/components/LoginForm/LoginForm'\n )\n);\n\nconst PageContainer = styled.div`\n align-items: center;\n background-color: ${thd('primary', '#003E7E')};\n background-image: url('${BgLogin}');\n background-size: cover;\n background-position: top center;\n display: flex;\n flex: 1 0 auto;\n height: 100%;\n min-height: 86vh;\n justify-content: center;\n`;\n\nconst LogosContainer = styled.div`\n background: white;\n padding: 5% 10%;\n margin-top: 5%;\n h1 {\n margin: 0;\n line-height: 0;\n }\n .login__logo {\n height: auto;\n width: 40%;\n vertical-align: middle;\n margin-right: 8%;\n }\n .login__logo2 {\n height: auto;\n width: 50%;\n vertical-align: middle;\n }\n`;\n\nconst WelcomeText = styled.p`\n margin-top: 0;\n text-transform: uppercase;\n color: white;\n font-size: 1.15em;\n font-weight: bold;\n`;\n\nconst LoginContainer = styled.div`\n background-color: ${thd('primary', '#003E7E')};\n max-width: 1000px;\n min-width: 300px;\n padding: 5% 10%;\n margin-bottom: 5%;\n width: 100%;\n label {\n color: #fff;\n font-size: 0.95em;\n }\n .login-form {\n .sui-button {\n margin-bottom: 1.6rem;\n }\n }\n .reset-password,\n p.enquires {\n font-size: 14px;\n color: white;\n a {\n color: white;\n &:hover,\n &:focus {\n text-decoration: none;\n }\n }\n }\n .profile-form {\n color: white;\n .lori-input-help-text {\n color: #fff;\n a {\n color: #fff;\n text-decoration: underline;\n &:hover {\n text-decoration: none;\n }\n }\n }\n }\n\n input {\n border-color: ${thd('primary', '#003E7E')};\n &:focus {\n border-color: ${thd('secondary', '#63ADCA')};\n }\n }\n\n input:checked + .sui-checkbox-content,\n .sui-checkbox .sui-checkbox-content {\n background-color: white !important;\n border-color: ${thd('primary', '#003E7E')} !important;\n }\n\n .sui-checkbox-check {\n color: ${thd('primary', '#003E7E')} !important;\n }\n\n input,\n textarea {\n font-size: 1em;\n padding: 10px 15px;\n }\n\n button.sui-button {\n color: ${thd('primary', '#003E7E')};\n font-weight: bold;\n background-color: ${thd('secondary', '#63ADCA')};\n border: 1px ${thd('secondary', '#63ADCA')} solid;\n border-radius: ${thd('inputBtnMinWidth', '20px')};\n min-width: 280px;\n margin-bottom: 0 !important;\n &:focus,\n &:hover {\n background-color: white;\n border: 1px ${thd('secondary', '#63ADCA')} solid;\n }\n }\n`;\n\nconst LoginPage = ({ settings }) => (\n \n \n Login\n {/**/}\n \n\n \n \n \n \n \n

\n \"AUSREO\n \"REOREWARDS\"\n

\n
\n \n Welcome to REOREWARDS\n \n \n \n

\n {' '}\n Looking to join the REOREWARDS program?{' '}\n \n Click here\n \n

\n

\n {' '}\n For queries email:{' '}\n \n info@reorewards.com.au\n \n

\n
\n \n
\n
\n
\n \n);\n\nLoginPage.propTypes = {\n settings: PropTypes.object.isRequired,\n};\n\nexport default withTheme(withSettings(LoginPage));\n","module.exports = __webpack_public_path__ + \"static/media/LoginPage.d8d1e9b9.png\";","var safeIsNaN = Number.isNaN || function ponyfill(value) {\n return typeof value === 'number' && value !== value;\n};\n\nfunction isEqual(first, second) {\n if (first === second) {\n return true;\n }\n\n if (safeIsNaN(first) && safeIsNaN(second)) {\n return true;\n }\n\n return false;\n}\n\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n\n for (var i = 0; i < newInputs.length; i++) {\n if (!isEqual(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) {\n isEqual = areInputsEqual;\n }\n\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n\n function memoized() {\n var newArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n }\n\n return memoized;\n}\n\nexport default memoizeOne;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Alert, styled } from '@smooth-ui/core-sc';\n\nconst StyledAlert = styled(Alert)`\n margin-top: 1rem;\n`;\n\nexport const Title = styled.div`\n font-weight: bold;\n`;\n\nexport const Multiline = styled.div`\n white-space: pre-line;\n`;\n\nconst MessageBox = ({ children, title = undefined, variant = 'primary' }) => {\n return (\n \n {title ? {title} : null}\n {children}\n \n );\n};\n\nMessageBox.propTypes = {\n children: PropTypes.node.isRequired,\n title: PropTypes.string,\n variant: PropTypes.string,\n};\n\nMessageBox.defaultProps = {\n title: undefined,\n variant: 'primary',\n};\n\nexport default MessageBox;\n","/**\n * Check Permissions - Check if the user has ANY of the required permissions\n *\n * @param {object} currentUser The user object containing the permissions property\n * @param {array} requiredPermissions The array of required permissions\n *\n */\n\nimport memoizeOne from 'memoize-one';\nimport PropTypes from 'prop-types';\n\nconst checkPermissions = (currentUser, requiredPermissions) => {\n if (\n !requiredPermissions ||\n !Array.isArray(requiredPermissions) ||\n !currentUser ||\n !currentUser.permissions ||\n !Array.isArray(currentUser.permissions)\n )\n return false;\n\n return currentUser.permissions.some(\n item => requiredPermissions.indexOf(item) >= 0\n );\n};\n\ncheckPermissions.propTypes = {\n currentUser: PropTypes.object.isRequired,\n requiredPermissions: PropTypes.array.isRequired,\n};\n\nconst checkPermissionsMemoized = memoizeOne(checkPermissions);\n\nexport default checkPermissionsMemoized;\n","/**\n * Check Roles - Check if the user has ANY of the required roles\n *\n * @param {object} currentUser The user object containing the roles property\n * @param {array} requiredRoles The array of required roles\n *\n */\n\nimport memoizeOne from 'memoize-one';\nimport PropTypes from 'prop-types';\n\nconst checkRoles = (currentUser, requiredRoles) => {\n if (\n !requiredRoles ||\n !Array.isArray(requiredRoles) ||\n !currentUser ||\n !currentUser.roles ||\n !Array.isArray(currentUser.roles)\n )\n return false;\n\n return currentUser.roles.some(item => requiredRoles.indexOf(item) >= 0);\n};\n\ncheckRoles.propTypes = {\n currentUser: PropTypes.object.isRequired,\n requiredRoles: PropTypes.array.isRequired,\n};\n\nconst checkRolesMemoized = memoizeOne(checkRoles);\n\nexport default checkRolesMemoized;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { createStructuredSelector } from 'reselect';\nimport { Redirect } from 'react-router-dom';\nimport {\n selectCurrentUser,\n selectCurrentUserTemp,\n} from '../containers/App/selectors'; // _platform\nimport checkPermissions from '../utils/checkPermissions'; // _platform\nimport checkRoles from '../utils/checkRoles'; // _platform\nimport MessageBox from '../components/MessageBox/MessageBox'; // _platform\n\n/**\n * Private Component - HoC to determine whether a component should be displayed\n * based on authentication, permissions and/or roles\n *\n * TODO: Extend with prop to supply function to determine permission `verifyFn` similar to LoadAsync\n *\n * The `user` prop can be either currentUser or currentUserTemp, depending on what the parent component determines is applicable.\n * If the `user` prop is not supplied, then this component will retrieve the user data via the App selectors.\n * The `tempAuthAllowed` prop determines whether currentUserTemp can be used\n *\n * `publicOnly` prop inverts the check so that the child component is only displayed to unauthenticated users (use `PublicComponent`)\n *\n * `deniedPermissions` and `deniedRoles` props take precedence over `requiredPermissions` and `requiredRoles`.\n * For example, if the props are `requiredRoles={['Administrator']} deniedRoles={['Administrator']}`,\n * users with the `Administrator` role will be denied access to the child component.\n *\n * If the checks determine that the access should be denied to the child component:\n * - By default the child component is skipped silently\n * - If the `redirectOnError` prop is supplied, the user will be redirected to the supplied local path\n * - Otherwise, if the `displayError` prop is supplied, the user will be shown an error\n * which can be customised via the `errorMessage` prop\n */\n\nclass PrivateComponent extends Component {\n render() {\n const {\n deniedPermissions,\n deniedRoles,\n displayError,\n errorMessage,\n publicOnly,\n redirectOnError,\n requiredPermissions,\n requiredRoles,\n tempAuthAllowed,\n user,\n } = this.props;\n const { currentUser, currentUserTemp } = this.props;\n\n const UnauthorisedComponent = displayError ? (\n \n {errorMessage || 'Unauthorised'}\n \n ) : null;\n\n const RedirectOnErrorComponent = redirectOnError ? (\n \n ) : null;\n\n // Determine which user object to use\n // 1. Use `user` prop if supplied\n // 2. If `tempAuthAllowed` prop:\n // 1. Is true: use `currentUserTemp` if available, if not use currentUser\n // 3. Is false: use currentUser\n //\n // Check for user.token and currentUserTemp.token to ensure they're not the\n // default empty objects. Cleaner than using Object.keys\n let userObject = {};\n if (user && user.token && user.userId) {\n userObject = user;\n } else if (tempAuthAllowed && currentUserTemp && currentUserTemp.token) {\n userObject = currentUserTemp;\n } else {\n userObject = currentUser;\n }\n\n // Invert the check if the publicOnly prop is supplied - used in PublicComponent\n if (publicOnly) {\n return !userObject.token\n ? this.props.children\n : RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n // Check granular permissions if supplied\n if (\n !!userObject.token &&\n ((deniedPermissions && checkPermissions(userObject, deniedPermissions)) ||\n (requiredPermissions &&\n !checkPermissions(userObject, requiredPermissions)))\n ) {\n return RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n // Check granular roles if supplied\n if (\n !!userObject.token &&\n ((deniedRoles && checkRoles(userObject, deniedRoles)) ||\n (requiredRoles && !checkRoles(userObject, requiredRoles)))\n ) {\n return RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n return !!userObject.token\n ? this.props.children\n : RedirectOnErrorComponent || UnauthorisedComponent;\n }\n}\n\nPrivateComponent.propTypes = {\n children: PropTypes.node.isRequired,\n currentUser: PropTypes.object.isRequired,\n currentUserTemp: PropTypes.object.isRequired,\n deniedPermissions: PropTypes.array,\n deniedRoles: PropTypes.array,\n displayError: PropTypes.bool,\n errorMessage: PropTypes.string,\n publicOnly: PropTypes.bool, // Inverts PrivateComponent - displays component to unauthenticated users only. Used by PublicComponent wrapper\n redirectOnError: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n requiredPermissions: PropTypes.array,\n requiredRoles: PropTypes.array,\n tempAuthAllowed: PropTypes.bool,\n user: PropTypes.object,\n};\n\nPrivateComponent.defaultProps = {\n deniedPermissions: undefined,\n deniedRoles: undefined,\n displayError: false,\n errorMessage: undefined,\n publicOnly: false,\n redirectOnError: undefined,\n requiredPermissions: undefined,\n requiredRoles: undefined,\n tempAuthAllowed: false,\n user: {},\n};\n\nconst mapStateToProps = createStructuredSelector({\n currentUser: selectCurrentUser(),\n currentUserTemp: selectCurrentUserTemp(),\n});\n\nexport default connect(\n mapStateToProps,\n null\n)(PrivateComponent);\n","/**\n * Public Component - Wrapper for PrivateComponent with the publicOnly flag\n */\n\nimport React from 'react';\nimport PrivateComponent from './PrivateComponent';\n\nconst PublicComponent = props => ;\n\nexport default PublicComponent;\n"],"sourceRoot":""}