{"version":3,"sources":["services/axios.service.js","components/affichage/Chargement.js","components/affichage/Erreur.js","components/affichage/InformationSG.js","components/affichage/Menu.js","components/affichage/InformationsComplementaires.js","services/ICSG.service.js","components/affichage/Page.js","App.js","index.js"],"names":["getAxios","url","a","config","cache","promise","axios","get","catch","error","afficherDialogueAuthentication","response","dataPromise","then","data","interceptors","request","use","Promise","reject","Chargement","Box","display","alignItems","justifyContent","height","CircularProgress","Component","Erreur","urlLocalisateur","this","props","serviceGarde","className","href","InformationSG","nomProvince","province","codePostal","console","log","undefined","length","slice","nom","type","placesPermis","numeroCivique","rue","municipalite","obtenirNomProvince","formaterCodePostal","Menu","menus","compo","window","location","search","map","menu","key","target","rel","InformationsComplementaires","estMonte","state","message","enChargementServiceGarde","enChargementMenu","URL","pathname","startsWith","obtenirServiceGarde","reponse","setState","obtenirMenu","erreur","Page","titre","adresseRoutes","proprietesRoutes","dictionnaireRoutes","fermetureSessionInfo","App","includes","baseUrl","document","getElementsByTagName","getAttribute","rootElement","getElementById","ReactDOM","render","basename"],"mappings":"4UAGO,SAAeA,EAAtB,kC,4CAAO,WAAwBC,GAAxB,mBAAAC,EAAA,6DACCC,EAAS,CACTC,MAAO,YAELC,EAAUC,IAAMC,IAAIN,EAAKE,GAC1BK,OAAM,SAAAC,GACHC,yCAA+BD,EAAME,aAEvCC,EAAcP,EAAQQ,MAAK,SAACF,GAAD,OAA2B,MAAZA,EAAmB,GAAKA,EAASG,QAR9E,kBASIF,GATJ,4C,sBAuDPN,IAAMS,aAAaC,QAAQC,KAAI,SAAAd,GAC3B,OAAOA,KACR,SAAAM,GACC,OAAOS,QAAQC,OAAOV,MAG1BH,IAAMS,aAAaJ,SAASM,KAAI,SAACN,GAC7B,OAAOA,KACR,SAAAF,GACC,OAAOS,QAAQC,OAAOV,M,uBChEbW,EAAb,uKAEQ,OACI,kBAACC,EAAA,EAAD,CAAKC,QAAQ,OAAOC,WAAW,SAASC,eAAe,SAASC,OAAO,SACnE,kBAACC,EAAA,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,gCAExB,kBAAC,EAAD,U,GAXkB3C,aCG3B0D,EAAUC,SAASC,qBAAqB,QAAQ,GAAGC,aAAa,QAChEC,EAAcH,SAASI,eAAe,QAE5CC,IAASC,OACL,kBAAC,gBAAD,CAAeC,SAAUR,GACrB,kBAAC,EAAD,OAEJI,I","file":"static/js/main.fa7d8c2d.chunk.js","sourcesContent":["import axios from 'axios';\r\nimport { afficherDialogueAuthentication } from '@mfa/commun-react';\r\n\r\nexport async function getAxios(url) {\r\n let config = {\r\n cache: 'no-store',\r\n }\r\n const promise = axios.get(url, config)\r\n .catch(error => {\r\n afficherDialogueAuthentication(error.response);\r\n })\r\n const dataPromise = promise.then((response) => (response == null ? [] : response.data))\r\n return dataPromise;\r\n}\r\n\r\nexport async function delAxios(url, contexte) {\r\n let config = {\r\n headers: {\r\n Authentication: contexte.contexteSAI,\r\n }\r\n }\r\n return axios.delete(url, config)\r\n .then(() => true)\r\n .catch(error => {\r\n afficherDialogueAuthentication(error.response, contexte);\r\n })\r\n}\r\n\r\nexport async function putAxios(url, contexte) {\r\n let config = {\r\n headers: {\r\n Authentication: contexte.contexteSAI,\r\n }\r\n }\r\n return axios.put(url, config)\r\n .then(() => true)\r\n .catch(error => {\r\n afficherDialogueAuthentication(error.response, contexte);\r\n })\r\n}\r\n\r\nexport async function postAxiosFile(url, fichier, contexte) {\r\n\r\n const config = {\r\n headers: {\r\n Authentication: contexte.contexteSAI,\r\n contentType: 'application/pdf',\r\n 'Content-Type': 'multipart/form-data',\r\n }\r\n }\r\n\r\n return axios.post(url, fichier, config)\r\n .then(() => true)\r\n .catch(error => {\r\n afficherDialogueAuthentication(error.response, contexte);\r\n });\r\n}\r\n\r\naxios.interceptors.request.use(config => {\r\n return config;\r\n}, error => {\r\n return Promise.reject(error);\r\n});\r\n\r\naxios.interceptors.response.use((response) => {\r\n return response;\r\n}, error => {\r\n return Promise.reject(error);\r\n});\r\n\r\n","import { Box, CircularProgress } from '@material-ui/core';\r\nimport React, { Component } from 'react';\r\n\r\nexport class Chargement extends Component {\r\n render() {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","import React, { Component } from 'react';\r\nimport './Erreur.js.css';\r\n\r\nexport class Erreur extends Component {\r\n render() {\r\n const { urlLocalisateur } = this.props.serviceGarde;\r\n\r\n return (\r\n
\r\n \r\n Pour obtenir des renseignements sur les sanctions pénales, un service de garde doit être identifié au préalable.\r\n Veuillez utiliser le lien suivant pour choisir un service de garde : cliquez ici\r\n \r\n
\r\n );\r\n }\r\n}\r\n","import React, { Component } from 'react';\r\nimport './InformationSG.js.css';\r\n\r\nexport class InformationSG extends Component {\r\n obtenirNomProvince() {\r\n const { province } = this.props.serviceGarde;\r\n let nomProvince;\r\n switch (province) {\r\n case 'QC':\r\n nomProvince = 'Québec';\r\n break;\r\n default:\r\n nomProvince = province;\r\n }\r\n return nomProvince;\r\n }\r\n\r\n formaterCodePostal() {\r\n const { codePostal } = this.props.serviceGarde;\r\n console.log(codePostal)\r\n if (codePostal !== undefined && codePostal.length === 6) {\r\n return codePostal.slice(0, 3) + ' ' + codePostal.slice(3);\r\n }\r\n return codePostal;\r\n }\r\n\r\n render() {\r\n const { nom, type, placesPermis, numeroCivique, rue, municipalite } = this.props.serviceGarde;\r\n\r\n return (\r\n
\r\n
\r\n {nom} ({type} - {placesPermis} places)\r\n
\r\n
\r\n {numeroCivique ? numeroCivique + ', ' : ''} {rue}\r\n
\r\n
\r\n {municipalite}, {this.obtenirNomProvince()} {this.formaterCodePostal()}\r\n
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n","import React, { Component } from 'react';\r\nimport './Menu.js.css';\r\n\r\nexport class Menu extends Component {\r\n render() {\r\n const { menus } = this.props;\r\n const compo = window.location.search;\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n}\r\n","import React, { Component } from 'react';\r\nimport { obtenirMenu, obtenirServiceGarde } from '../../services/ICSG.service';\r\nimport { Chargement } from './Chargement';\r\nimport { Erreur } from './Erreur';\r\nimport { InformationSG } from './InformationSG';\r\nimport { Menu } from './Menu';\r\n\r\nexport class InformationsComplementaires extends Component {\r\n estMonte = false;\r\n\r\n constructor(props) {\r\n super(props)\r\n this.state = {\r\n message: \"Chargement...\",\r\n serviceGarde: null,\r\n menus: null,\r\n enChargementServiceGarde: true,\r\n enChargementMenu: true,\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n this.estMonte = true;\r\n obtenirServiceGarde().then(reponse => {\r\n const serviceGarde = reponse;\r\n if (this.estMonte) {\r\n this.setState({ serviceGarde: serviceGarde, enChargementServiceGarde: false });\r\n }\r\n obtenirMenu().then(reponse => {\r\n const menus = reponse;\r\n if (this.estMonte) {\r\n this.setState({ menus: menus, enChargementMenu: false });\r\n }\r\n });\r\n });\r\n }\r\n\r\n componentWillUnmount() {\r\n this.estMonte = false;\r\n }\r\n\r\n render() {\r\n const { enChargementServiceGarde, enChargementMenu, serviceGarde, menus } = this.state;\r\n\r\n if (enChargementServiceGarde || enChargementMenu) {\r\n return ;\r\n }\r\n\r\n const { erreur } = serviceGarde;\r\n if (erreur) {\r\n return ;\r\n }\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n","import { getAxios } from './axios.service';\r\n\r\nconst urlServiceGarde = 'api/ICSG/ServiceGarde';\r\nconst urlMenu = 'api/ICSG/Menu';\r\n\r\nexport function obtenirServiceGarde() {\r\n const url = new URL(window.location);\r\n if (url.pathname.startsWith('/Apps/ICSG/')) {\r\n url.pathname = '/Apps/ICSG/' + urlServiceGarde;\r\n }\r\n else {\r\n url.pathname = urlServiceGarde;\r\n }\r\n return getAxios(url);\r\n}\r\n\r\nexport function obtenirMenu() {\r\n const url = new URL(window.location);\r\n if (url.pathname.startsWith('/Apps/ICSG/')) {\r\n url.pathname = '/Apps/ICSG/' + urlMenu;\r\n }\r\n else {\r\n url.pathname = urlMenu;\r\n }\r\n return getAxios(url);\r\n}\r\n","import { MfaPage } from '@mfa/commun-react';\r\nimport React, { Component } from 'react';\r\nimport { InformationsComplementaires } from './InformationsComplementaires';\r\nimport './Page.js.css';\r\n\r\nexport class Page extends Component {\r\n render() {\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","import React, { Component } from 'react';\r\nimport { Page } from './components/affichage/Page';\r\n\r\nexport default class App extends Component {\r\n obtenirVariablesGlobales() {\r\n return [\r\n ];\r\n }\r\n\r\n render() {\r\n const chemin = window.location.pathname;\r\n if (!chemin.includes('/InformationsComplementaires')) {\r\n window.location.pathname = '/InformationsComplementaires';\r\n }\r\n return ;\r\n }\r\n}\r\n\r\n","import 'bootstrap/dist/css/bootstrap.css';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { BrowserRouter } from 'react-router-dom';\r\nimport App from './App';\r\n\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\r\nconst rootElement = document.getElementById('root');\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n rootElement);\r\n\r\n\r\n"],"sourceRoot":""}