{"version":3,"sources":["pages/NotFoundPage/NotFoundPage.module.scss","../node_modules/@material-ui/icons/History.js","pages/NotFoundPage/NotFoundPage.js","pages/NotFoundPage/index.js","components/Layouts/PublicBasePage/index.tsx","components/Layouts/PublicBasePage/PublicBasePage.module.scss","../node_modules/@material-ui/icons/Map.js"],"names":["module","exports","box","contentWrapper","title","formControl","actionsWrapper","passwordResetLink","infoText","submitButton","_interopRequireDefault","__webpack_require__","_interopRequireWildcard","Object","defineProperty","value","default","React","_default","createElement","d","NotFoundPage","goBackToHome","window","location","href","PublicBasePage","simple","Paper","className","styles","FormattedMessage","id","Grid","container","spacing","item","xs","alignItems","alignContent","document","pathname","sm","Button","size","variant","color","component","startIcon","MapIcon","onClick","HistoryIcon","__webpack_exports__","HEADER_HEIGHT","HEADER_SIMPLE_HEIGHT","FOOTER_HEIGHT","_ref","children","_ref$simple","_ref$match","match","_useLazyQuery","useLazyQuery","GET_CURRENT_USER_ID","_useLazyQuery2","_slicedToArray","checkUserTokenStatus","userIdData","data","locale","localStorage","getItem","DEFAULT_LANGUAGE","formatMessage","useFormatMessage","headerHeight","_useState","useState","innerHeight","_useState2","windowHeight","setWindowHeight","_useState3","_useState4","contentHeight","setContentHeight","useEffect","routes_paths","find","x","path","indexOf","params","alertId","_","get","carId","concat","addEventListener","debouncedUpdateHeight","removeEventListener","currentUserId","toast","debounce","classnames","pageWrapper","locale-en","style","height","Header","minHeight","Footer"],"mappings":"gFACAA,EAAAC,QAAA,CAAkBC,IAAA,0BAAAC,eAAA,qCAAAC,MAAA,4BAAAC,YAAA,kCAAAC,eAAA,qCAAAC,kBAAA,wCAAAC,SAAA,+BAAAC,aAAA,uECClB,IAAAC,EAA6BC,EAAQ,KACrCC,EAA8BD,EAAQ,KACtCE,OAAAC,eAAAb,EAAA,cACAc,OAAA,IAEAd,EAAAe,aAAA,EACA,IAAAC,EAAAL,EAAoCD,EAAQ,IAE5CO,GAAA,EADAR,EAA4CC,EAAQ,MACpDK,SAAAC,EAAAE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epB,KAGD,KAEvD,OACEtC,IAAAE,cAAA,OACEU,UAAW2E,IAAW1E,IAAO2E,YAAa,CACxCC,YAAwB,OAAXrC,IAEfsC,MAAO,CAAEC,OAAQ5B,IAEjB/D,IAAAE,cAAC0F,IAAM,CAAClF,OAAQA,IAChBV,IAAAE,cAAA,OAAKU,UAAWC,IAAO3B,eAAgBwG,MAAO,CAAEG,UAAW1B,IACxD3B,GAEHxC,IAAAE,cAAC4F,IAAM,6BCnGb/G,EAAAC,QAAA,CAAkBwG,YAAA,oCAAAtG,eAAA,0ECClB,IAAAO,EAA6BC,EAAQ,KACrCC,EAA8BD,EAAQ,KACtCE,OAAAC,eAAAb,EAAA,cACAc,OAAA,IAEAd,EAAAe,aAAA,EACA,IAAAC,EAAAL,EAAoCD,EAAQ,IAE5CO,GAAA,EADAR,EAA4CC,EAAQ,MACpDK,SAAAC,EAAAE,cAAA,QACAC,EAAA,yLACC,OACDnB,EAAAe,QAAAE","file":"static/js/622.8159cc9c.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"box\":\"NotFoundPage_box__1AC8-\",\"contentWrapper\":\"NotFoundPage_contentWrapper__2-dWR\",\"title\":\"NotFoundPage_title__3_2bs\",\"formControl\":\"NotFoundPage_formControl__3S3q9\",\"actionsWrapper\":\"NotFoundPage_actionsWrapper__rfATq\",\"passwordResetLink\":\"NotFoundPage_passwordResetLink__UQr6p\",\"infoText\":\"NotFoundPage_infoText__5V9mP\",\"submitButton\":\"NotFoundPage_submitButton__2UCAT\"};","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _default = (0, _createSvgIcon.default)(/*#__PURE__*/React.createElement(\"path\", {\n  d: \"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z\"\n}), 'History');\nexports.default = _default;","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\n\nimport { Grid } from '@material-ui/core';\nimport Button from '@material-ui/core/Button';\nimport Paper from '@material-ui/core/Paper';\nimport HistoryIcon from '@material-ui/icons/History';\nimport MapIcon from '@material-ui/icons/Map';\n\nimport { PublicBasePage } from '../../components/Layouts/PublicBasePage';\nimport styles from './NotFoundPage.module.scss';\n\nexport default function NotFoundPage() {\n  const goBackToHome = () => {\n    window.location.href = '/';\n  };\n\n  return (\n    <PublicBasePage simple>\n      <Paper className={styles.box}>\n        <div className={styles.contentWrapper}>\n          <h1 className={styles.title}>\n            <FormattedMessage id='routes.page_not_found' />\n          </h1>\n          <Grid container spacing={3}>\n            <Grid item xs={12} alignItems='center' alignContent='center'>\n              {\n                document.location.pathname\n              }\n              <FormattedMessage id='routes.page_not_found_description' />\n            </Grid>\n            <Grid item sm={6} xs={12}>\n              <Button\n                size='small'\n                variant='contained'\n                color='primary'\n                component='span'\n                startIcon={<MapIcon />}\n                onClick={goBackToHome}\n              >\n                <FormattedMessage id='routes.page_not_found_home' />\n              </Button>\n            </Grid>\n            <Grid item sm={6} xs={12}>\n              <Button\n                size='small'\n                variant='contained'\n                color='secondary'\n                component='span'\n                startIcon={<HistoryIcon />}\n                onClick={goBackToHome}\n              >\n                <FormattedMessage id='routes.page_not_found_back' />\n              </Button>\n            </Grid>\n          </Grid>\n        </div>\n      </Paper>\n    </PublicBasePage>\n  );\n}\n","export { default } from './NotFoundPage';\n","import React, { useEffect, useState } from 'react';\nimport { RouteComponentProps } from 'react-router-dom';\n\nimport { useLazyQuery } from '@apollo/react-hooks';\nimport classnames from 'classnames';\nimport _ from 'lodash';\n\nimport { routes_paths } from '@core/routes/Routes';\nimport useFormatMessage from '@hooks/useFormatMessage';\n\nimport { DEFAULT_LANGUAGE } from '@helpers/locale';\nimport toast from '@helpers/toast';\nimport { GET_CURRENT_USER_ID } from '@models/InMemoryCache/localFields';\n\nimport { Footer } from '../Footer';\nimport Header from '../Header';\nimport styles from './PublicBasePage.module.scss';\n\nconst HEADER_HEIGHT = 100;\nconst HEADER_SIMPLE_HEIGHT = 50;\nconst FOOTER_HEIGHT = 30;\n\nexport interface IPublicBasePageProps {\n  children: React.ReactNode;\n  simple?: boolean;\n  match?: any;\n}\n\nexport function PublicBasePage({ children, simple = false, match = null }: IPublicBasePageProps) {\n  const [checkUserTokenStatus, { data: userIdData }] = useLazyQuery(GET_CURRENT_USER_ID);\n\n  const locale = localStorage.getItem('locale') || DEFAULT_LANGUAGE;\n  const formatMessage = useFormatMessage();\n\n  const headerHeight = simple ? HEADER_SIMPLE_HEIGHT : HEADER_HEIGHT;\n  const [windowHeight, setWindowHeight] = useState(window.innerHeight);\n  const [contentHeight, setContentHeight] = useState(window.innerHeight - (headerHeight + FOOTER_HEIGHT));\n\n  useEffect(() => {\n    // TODO\n    //  improve way to change title\n    const pathname = routes_paths.find((x) => x.path === window.location.pathname);\n    if (pathname) {\n      document.title = 'Mapbiomas Alerta | ' + formatMessage(pathname ? pathname.title : '');\n    } else if (window.location.pathname.indexOf('/alerta/') > -1) {\n      if (match) {\n        const { params } = match;\n        const alertId = _.get(params, 'alertId');\n        const carId = _.get(params, 'carId');\n        if (carId) {\n          document.title = 'Mapbiomas Alerta | ' + formatMessage('pages.report') + ` ${alertId} / ${carId}`;\n        } else {\n          document.title = 'Mapbiomas Alerta | ' + formatMessage('pages.report') + ` ${alertId}`;\n        }\n      } else {\n        document.title = 'Mapbiomas Alerta | ' + formatMessage('pages.reports');\n      }\n    }\n\n    if (localStorage.getItem('token') !== null) {\n      checkUserTokenStatus();\n    }\n  }, []);\n\n  useEffect(() => {\n    window.addEventListener('resize', debouncedUpdateHeight);\n\n    return () => {\n      window.removeEventListener('resize', debouncedUpdateHeight);\n    };\n  }, []);\n\n  useEffect(() => {\n    if (userIdData) {\n      const { currentUserId } = userIdData;\n      if (!currentUserId) {\n        toast(formatMessage('auth.session.expirated_token'));\n        //window.location.href = '/sign-in?callback_url='+ window.location.pathname\n      }\n    }\n  }, [userIdData]);\n\n  function updateHeight() {\n    setWindowHeight(window.innerHeight);\n    setContentHeight(window.innerHeight - (headerHeight + FOOTER_HEIGHT));\n  }\n\n  const debouncedUpdateHeight = _.debounce(updateHeight, 500);\n\n  return (\n    <div\n      className={classnames(styles.pageWrapper, {\n        'locale-en': locale === 'en',\n      })}\n      style={{ height: windowHeight }}\n    >\n      <Header simple={simple} />\n      <div className={styles.contentWrapper} style={{ minHeight: contentHeight }}>\n        {children}\n      </div>\n      <Footer />\n    </div>\n  );\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"pageWrapper\":\"PublicBasePage_pageWrapper__OxzMp\",\"contentWrapper\":\"PublicBasePage_contentWrapper__14Xqk\"};","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar React = _interopRequireWildcard(require(\"react\"));\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _default = (0, _createSvgIcon.default)(/*#__PURE__*/React.createElement(\"path\", {\n  d: \"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z\"\n}), 'Map');\nexports.default = _default;"],"sourceRoot":""}