{"version":3,"sources":["pages/InspectionMonitorPage/InspectionMonitorPage.module.scss","pages/InspectionMonitorPage/InspectionMonitorPage.js","pages/InspectionMonitorPage/index.js","components/Layouts/PublicBasePage/index.tsx","components/Layouts/PublicBasePage/PublicBasePage.module.scss"],"names":["module","exports","containerInspectionMonitor","section","title","downloadBox","definitionListWrapper","InspectionMonitorPage","path_url_dashboard_pt","getEnvVar","path_url_dashboard_en","path_url_dashboard","localStorage","getItem","React","createElement","PublicBasePage","simple","className","minHeight","styles","src","frameBorder","border","scrolling","__webpack_require__","d","__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","DEFAULT_LANGUAGE","formatMessage","useFormatMessage","headerHeight","_useState","useState","window","innerHeight","_useState2","windowHeight","setWindowHeight","_useState3","_useState4","contentHeight","setContentHeight","useEffect","pathname","routes_paths","find","x","path","location","document","indexOf","params","alertId","_","get","carId","concat","addEventListener","debouncedUpdateHeight","removeEventListener","currentUserId","toast","debounce","classnames","pageWrapper","locale-en","style","height","Header","contentWrapper","Footer"],"mappings":"gFACAA,EAAAC,QAAA,CAAkBC,2BAAA,0DAAAC,QAAA,uCAAAC,MAAA,qCAAAC,YAAA,2CAAAC,sBAAA,wJCKH,SAASC,IACtB,IAAMC,EAAwBC,YAAU,0BAClCC,EAAwBD,YAAU,8BAAgCD,EAElEG,EAAwD,OAAnCC,aAAaC,QAAQ,UAAqBH,EAAwBF,EAE7F,OACEM,IAAAC,cAACC,IAAc,CAACC,QAAM,EAACC,UAAW,CAAEC,UAAW,WAC7CL,IAAAC,cAAA,OAAKG,UAAWE,IAAOlB,4BACrBY,IAAAC,cAAA,UACEX,MAAM,qBACNiB,IAAKV,EACLW,YAAY,IACZJ,UAAW,CAAEK,OAAQ,KACrBC,UAAU,UCpBpBC,EAA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B,WACLzB,OAAO0B,oBAAoB,SAAUD,KAEtC,IAEHhB,oBAAU,WACJlB,IACwBA,EAAlBoC,eAENC,YAAMjC,EAAc,mCAIvB,CAACJ,IAOJ,IAAMkC,EAAwBL,IAAES,SALhC,WACEzB,EAAgBJ,OAAOC,aACvBO,EAAiBR,OAAOC,aAAeJ,EAAelB,KAGD,KAEvD,OACEhB,IAAAC,cAAA,OACEG,UAAW+D,IAAW7D,IAAO8D,YAAa,CACxCC,YAAwB,OAAXvC,IAEfwC,MAAO,CAAEC,OAAQ/B,IAEjBxC,IAAAC,cAACuE,IAAM,CAACrE,OAAQA,IAChBH,IAAAC,cAAA,OAAKG,UAAWE,IAAOmE,eAAgBH,MAAO,CAAEjE,UAAWuC,IACxD1B,GAEHlB,IAAAC,cAACyE,IAAM,6BCnGbxF,EAAAC,QAAA,CAAkBiF,YAAA,oCAAAK,eAAA","file":"static/js/627.83c5af30.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"containerInspectionMonitor\":\"InspectionMonitorPage_containerInspectionMonitor__3pExF\",\"section\":\"InspectionMonitorPage_section__m_MB_\",\"title\":\"InspectionMonitorPage_title__JPJG8\",\"downloadBox\":\"InspectionMonitorPage_downloadBox__2GVjd\",\"definitionListWrapper\":\"InspectionMonitorPage_definitionListWrapper__3SQfl\"};","import React from 'react';\n\nimport { PublicBasePage } from '../../components/Layouts/PublicBasePage';\nimport { getEnvVar } from '../../helpers/tenant';\nimport styles from './InspectionMonitorPage.module.scss';\n\nexport default function InspectionMonitorPage() {\n const path_url_dashboard_pt = getEnvVar('inspection_monitor_url');\n const path_url_dashboard_en = getEnvVar('inspection_monitor_url_en') || path_url_dashboard_pt;\n\n const path_url_dashboard = localStorage.getItem('locale') === 'en' ? path_url_dashboard_en : path_url_dashboard_pt;\n\n return (\n <PublicBasePage simple className={{ minHeight: '1000px' }}>\n <div className={styles.containerInspectionMonitor}>\n <iframe\n title='inspection monitor'\n src={path_url_dashboard}\n frameBorder='0'\n className={{ border: '0' }}\n scrolling='yes'\n />\n </div>\n </PublicBasePage>\n );\n}\n","export { default } from './InspectionMonitorPage';\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\"};"],"sourceRoot":""}