{"version":3,"sources":["converters/2ddoc.ts","converters/eudcc.ts","components/CovidCard.tsx","App.tsx","index.tsx"],"names":["DDOC_PREFIX","ALPHA","regex","parse","s","ALPHANUM","NUM","parseInt","DATE","day","substr","month","year","hours","minutes","Date","CERTIFICATE_AUTHORITIES","Map","getCertificateAuthority","certificateAuthorityId","get","PUBLIC_KEYS","getPublicKey","publicKeyId","getSex","sex","getAnalysisResult","analysisResult","fieldRegex","f","chars","type","terminator","minlen","maxlen","code","name","TEST_FIELDS","VACCINE_FIELDS","parse_2ddoc_date","date_str","ms","jan_2001","extract_data","fields","o","document_data","Object","fromEntries","map","Error","header","creation_date","signature_date","certificate_authority_id","public_key_id","document_version","document_type","document_perimeter","document_country","signature","TEST_REGEX","x","join","VACCINE_REGEX","TOTAL_REGEX","RegExp","getCertificateInfo","cert","vaccination_date","last_dose_date","prophylactic_agent","doses_received","doses_expected","first_name","vaccinated_first_name","last_name","vaccinated_last_name","date_of_birth","vaccinated_birth_date","source","format","test_date","analysis_datetime","is_negative","analysis_result","is_inconclusive","tested_first_name","tested_last_name","tested_birth_date","JSON","stringify","doc","a","groups","match","raw_data","EUDCC_PREFIX","formatISODate","date","toISOString","split","decodeEUDCC","hcert","startsWith","value","cbor","decodeFirstSync","zlib","inflateSync","base45","decode","length","rawPayload","rawHeader","alg","kid","toString","payload","iss","iat","exp","sig","DocType","EUCCInfoTable","passType","eudcc","className","ci","is","co","tg","vp","mp","ma","dn","sd","dt","tt","nm","sc","tr","tc","fr","df","du","DDOCInfoTable","ddoc","cycle_state","disease","vaccine","vaccine_maker","analysis_code","CovidCard","props","state","docType","data","trim","EUDCC","DDOC","this","setState","decode2DDoc","then","e","console","error","toUpperCase","v","t","r","src","bwipjs","toCanvas","bcid","scale","text","toDataURL","nam","gn","fn","dob","isWithAd","crypto","update","digest","React","Component","TAC_WALLET_DCC_URL","TAC_WALLET_DDOC_URL","App","isScanning","isSettingsVisible","cards","count","onAppend","bind","appendHCERT","onScan","newCards","i","push","filter","k","now","qr","decodeURIComponent","replace","alert","Modal","show","Header","closeButton","Title","Body","htmlFor","id","min","onChange","target","checked","Footer","Button","variant","onClick","onError","log","facingMode","Jumbotron","fluid","autoFocus","placeholder","window","print","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"6fACaA,EAAc,KAErBC,EAAQ,CACZC,MAAO,cACPC,MAAO,SAACC,GAAD,OAAeA,IAElBC,EAAW,CACfH,MAAO,iBACPC,MAAO,SAACC,GAAD,OAAeA,IAElBE,EAAM,CACVJ,MAAO,MACPC,MAAO,SAACC,GAAD,OAAeG,SAASH,KAE3BI,EAAO,CACXN,MAAO,MACPC,MAAO,SAACC,GACN,IAAMK,EAAML,EAAEM,OAAO,EAAG,GAClBC,EAAQP,EAAEM,OAAO,EAAG,GACpBE,EAAOR,EAAEM,OAAO,EAAG,GACnBG,EAAQT,EAAEM,OAAO,EAAG,IAAM,KAC1BI,EAAUV,EAAEM,OAAO,GAAI,IAAM,KACnC,OAAO,IAAIK,KAAJ,UAAYH,EAAZ,YAAoBD,EAApB,YAA6BF,EAA7B,YAAoCI,EAApC,YAA6CC,MAIlDE,EAA0B,IAAIC,IAAoB,CACtD,CAAC,OAAQ,aACT,CAAC,OAAQ,eACT,CAAC,OAAQ,aACT,CAAC,OAAQ,aACT,CAAC,OAAQ,UAGJ,SAASC,EAAyBC,GAAyC,IAAD,EAC/E,iBAAOH,EAAwBI,IAAID,UAAnC,QAA8D,UAGhE,IAAME,EAAc,IAAIJ,IAAoB,CAC1C,CAAC,OAAQ,QACT,CAAC,OAAQ,QACT,CAAC,OAAQ,QACT,CAAC,OAAQ,UAGJ,SAASK,EAAcC,GAA8B,IAAD,EACzD,iBAAOF,EAAYD,IAAIG,UAAvB,QAAuC,UAGlC,SAASC,EAAQC,GACtB,OAAQA,GACN,IAAK,IACH,MAAO,OACT,IAAK,IACH,MAAO,SACT,QACE,MAAO,WAIN,SAASC,EAAmBC,GACjC,OAAQA,GACN,IAAK,IACH,MAAO,WACT,IAAK,I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H,EAAOnH,SACxD+H,YAAW,UAAKvI,EAAL,cAAuBjG,KAC5C,sBAAK+H,UAAU,YAAf,UACE,cAACgG,GAAA,EAAD,CAAQC,QAAQ,UAAUC,QAAShE,KAAKmC,SAAxC,oBACA,cAAC2B,GAAA,EAAD,CAAQC,QAAQ,UAAUC,QAAS,kBAAM,EAAK/D,SAAS,CAAE+B,mBAAmB,KAA5E,0BACA,cAAC8B,GAAA,EAAD,CAAQC,QAAQ,SAASC,QAAS,kBAAM,EAAK/D,SAAS,CAAEgC,MAAO,GAAI3F,MAAO,MAA1E,0BACA,cAACwH,GAAA,EAAD,CAAQC,QAAQ,YAAYC,QAASQ,OAAOC,MAA5C,sCAGJ,0BAEF,qBAAKjB,GAAG,QAAR,SAAiBxD,KAAKN,MAAMuC,e,GAhHhBP,IAAMC,WCdxB+C,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,GAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.17ac5b9a.chunk.js","sourcesContent":["/* eslint-disable camelcase */\nexport const DDOC_PREFIX = 'DC'\n\nconst ALPHA = {\n regex: 'A-Z\\\\-\\\\./ ',\n parse: (s: string) => s\n}\nconst ALPHANUM = {\n regex: '0-9A-Z\\\\-\\\\./ ',\n parse: (s: string) => s\n}\nconst NUM = {\n regex: '0-9',\n parse: (s: string) => parseInt(s)\n}\nconst DATE = {\n regex: '0-9',\n parse: (s: string) => {\n const day = s.substr(0, 2)\n const month = s.substr(2, 2)\n const year = s.substr(4, 4)\n const hours = s.substr(8, 2) || '12'\n const minutes = s.substr(10, 2) || '00'\n return new Date(`${year}/${month}/${day} ${hours}:${minutes}`)\n }\n}\n\nconst CERTIFICATE_AUTHORITIES = new Map([\n ['FR01', 'AriadNEXT'],\n ['FR02', 'LEX PERSONA'],\n ['FR03', 'Dhimyotis'],\n ['FR04', 'AriadNEXT'],\n ['FR05', 'ANTS']\n])\n\nexport function getCertificateAuthority (certificateAuthorityId: string): string {\n return CERTIFICATE_AUTHORITIES.get(certificateAuthorityId) ?? 'Unknown'\n}\n\nconst PUBLIC_KEYS = new Map([\n ['AHP1', 'APHP'],\n ['AHP2', 'APHP'],\n ['AV01', 'CNAM'],\n ['AV02', 'CNAM']\n])\n\nexport function getPublicKey (publicKeyId: string): string {\n return PUBLIC_KEYS.get(publicKeyId) ?? 'Unknown'\n}\n\nexport function getSex (sex: string): string {\n switch (sex) {\n case 'M':\n return 'Male'\n case 'F':\n return 'Female'\n default:\n return 'Unknown'\n }\n}\n\nexport function getAnalysisResult (analysisResult: string): string {\n switch (analysisResult) {\n case 'P':\n return 'Positive'\n case 'N':\n return 'Negative'\n case 'X':\n return 'Non-compliant sample'\n default:\n return 'Undetermined'\n }\n}\n\ntype PossibleFieldType = Date | string | number;\n\ninterface Field {\nreadonly code: string;\nreadonly name: string;\nreadonly minlen: number;\nreadonly maxlen: number;\nreadonly type: { readonly regex: string; parse: (x: string) => T };\n}\n\nfunction fieldRegex (f: Field): string {\n const chars = f.type.regex\n const terminator = f.minlen !== f.maxlen ? '[\\\\x1D\\\\x1E]' : ''\n return `${f.code}(?<${f.name}>[${chars}]{${f.minlen},${f.maxlen}})${terminator}`\n}\n\nconst TEST_FIELDS = [\n { code: 'F0', name: 'tested_first_name', minlen: 0, maxlen: 60, type: ALPHA },\n { code: 'F1', name: 'tested_last_name', minlen: 0, maxlen: 38, type: ALPHA },\n { code: 'F2', name: 'tested_birth_date', minlen: 8, maxlen: 8, type: DATE },\n { code: 'F3', name: 'sex', minlen: 1, maxlen: 1, type: ALPHA },\n { code: 'F4', name: 'analysis_code', minlen: 3, maxlen: 7, type: ALPHANUM },\n { code: 'F5', name: 'analysis_result', minlen: 1, maxlen: 1, type: ALPHA },\n { code: 'F6', name: 'analysis_datetime', minlen: 12, maxlen: 12, type: DATE }\n] as const\n\nconst VACCINE_FIELDS = [\n { code: 'L0', name: 'vaccinated_last_name', minlen: 0, maxlen: 80, type: ALPHA },\n { code: 'L1', name: 'vaccinated_first_name', minlen: 0, maxlen: 80, type: ALPHA },\n { code: 'L2', name: 'vaccinated_birth_date', minlen: 8, maxlen: 8, type: DATE },\n { code: 'L3', name: 'disease', minlen: 0, maxlen: 30, type: ALPHANUM },\n { code: 'L4', name: 'prophylactic_agent', minlen: 5, maxlen: 15, type: ALPHANUM },\n { code: 'L5', name: 'vaccine', minlen: 5, maxlen: 30, type: ALPHANUM },\n { code: 'L6', name: 'vaccine_maker', minlen: 5, maxlen: 30, type: ALPHANUM },\n { code: 'L7', name: 'doses_received', minlen: 1, maxlen: 1, type: NUM },\n { code: 'L8', name: 'doses_expected', minlen: 1, maxlen: 1, type: NUM },\n { code: 'L9', name: 'last_dose_date', minlen: 8, maxlen: 8, type: DATE },\n { code: 'LA', name: 'cycle_state', minlen: 2, maxlen: 2, type: ALPHA }\n] as const\n\ntype FIELDS_TYPES = typeof TEST_FIELDS | typeof VACCINE_FIELDS;\ntype OBJECT_WITH_FIELDS = {\n[T in FIELDS[number] as T['name']]: ReturnType;\n};\n\nexport type TestCertificate = OBJECT_WITH_FIELDS;\nexport type VaccineCertificate = OBJECT_WITH_FIELDS;\ninterface HeaderData {\ncode: string;\ncreation_date?: Date;\nsignature_date?: Date;\ncertificate_authority_id: string;\npublic_key_id: string;\ndocument_version: string;\ndocument_type: string;\ndocument_perimeter: string;\ndocument_country: string;\n}\nexport type Certificate2ddoc = (VaccineCertificate | TestCertificate) & HeaderData & { signature?: string };\n\nfunction parse_2ddoc_date (date_str: string): Date | undefined {\n if (!date_str || date_str === 'FFFF') return undefined\n const days = parseInt(date_str, 16)\n const ms = days * 24 * 60 * 60 * 1000\n const jan_2001 = new Date('2000-01-01')\n return new Date(+jan_2001 + ms)\n}\n\nfunction extract_data (\n code: string,\n fields: F,\n o: Record\n): OBJECT_WITH_FIELDS & HeaderData {\n const document_data = Object.fromEntries(\n fields.map((f: Field) => {\n if (!(f.name in o)) throw new Error(`Missing data for field ${f.name}`)\n return [f.name, f.type.parse(o[f.name])]\n })\n ) as OBJECT_WITH_FIELDS\n const header: HeaderData = {\n code,\n creation_date: parse_2ddoc_date(o.creation_date),\n signature_date: parse_2ddoc_date(o.signature_date),\n certificate_authority_id: o.certificate_authority_id,\n public_key_id: o.public_key_id,\n document_version: o.document_version,\n document_type: o.document_type,\n document_perimeter: o.document_perimeter,\n document_country: o.document_country\n }\n return { ...header, ...document_data, signature: o.signature }\n}\n\nconst TEST_REGEX = TEST_FIELDS.map((x) => fieldRegex(x)).join('')\nconst VACCINE_REGEX = VACCINE_FIELDS.map((x) => fieldRegex(x)).join('')\n\nconst HEADER_REGEX =\nDDOC_PREFIX +\n'(?[0-9]{2})' +\n'(?[A-Z\\\\d]{4})' +\n'(?[A-Z\\\\d]{4})' +\n'(?[A-Z\\\\d]{4})' +\n'(?[A-Z\\\\d]{4})' +\n'(?[A-Z\\\\d]{2})' +\n'(?[A-Z\\\\d]{2})' +\n'(?[A-Z]{2})'\n\nconst SIGNATURE_REGEX =\n'\\\\x1F{1}' + '(?[A-Z\\\\d\\\\=]+)'\n\nconst TOTAL_REGEX = new RegExp(\n`^(?${HEADER_REGEX}(?:${VACCINE_REGEX}|${TEST_REGEX}))${SIGNATURE_REGEX}$`\n)\n\nfunction getCertificateInfo (cert: Certificate2ddoc): CommonCertificateInfo {\n if ('vaccinated_first_name' in cert) {\n return {\n type: 'vaccination',\n vaccination_date: cert.last_dose_date,\n prophylactic_agent: cert.prophylactic_agent,\n doses_received: cert.doses_received,\n doses_expected: cert.doses_expected,\n first_name: cert.vaccinated_first_name,\n last_name: cert.vaccinated_last_name,\n date_of_birth: cert.vaccinated_birth_date,\n code: cert.code,\n source: { format: '2ddoc', cert }\n }\n } else if ('tested_first_name' in cert) {\n return {\n type: 'test',\n test_date: cert.analysis_datetime,\n is_negative: cert.analysis_result === 'N',\n is_inconclusive: cert.analysis_result === 'X',\n first_name: cert.tested_first_name,\n last_name: cert.tested_last_name,\n date_of_birth: cert.tested_birth_date,\n code: cert.code,\n source: { format: '2ddoc', cert }\n }\n }\n throw new Error('Unsupported or empty certificate: ' + JSON.stringify(cert))\n}\n\nexport async function decode2DDoc (doc: string): Promise {\n const groups = doc.match(TOTAL_REGEX)?.groups\n if (!groups) throw new Error('Format de certificat invalide')\n const fields = groups.document_type === 'B2' ? TEST_FIELDS : VACCINE_FIELDS\n const raw_data = extract_data(doc, fields, groups)\n return getCertificateInfo(raw_data)\n}\n\nexport interface CommonVaccineInfo {\n type: 'vaccination'\n vaccination_date: Date\n prophylactic_agent: string\n doses_received: number\n doses_expected: number\n}\n\nexport interface CommonTestInfo {\n type: 'test';\n test_date: Date;\n is_negative: boolean;\n is_inconclusive: boolean;\n}\n\nexport interface AllCommonInfo {\n first_name: string;\n last_name: string;\n date_of_birth: Date;\n code: string;\n source: { format: '2ddoc'; cert: Certificate2ddoc };\n}\n\nexport type CommonCertificateInfo = AllCommonInfo & (CommonVaccineInfo | CommonTestInfo);\n","import cbor from 'cbor'\nimport zlib from 'zlib'\nimport base45 from 'base45'\nimport { EUDCC } from '../types/dgc-combined-schema'\n\nexport const EUDCC_PREFIX = 'HC1:'\n\nconst formatISODate = (date: Date) => date.toISOString().split('T')[0]\n\nexport type DecodedEUDCC = {\n header: {\n alg: number,\n kid: string\n },\n payload: {\n iss: string,\n iat: string,\n exp: string,\n hcert: EUDCC\n },\n sig: string\n}\n\nexport function decodeEUDCC (hcert: string): DecodedEUDCC {\n if (!hcert.startsWith(EUDCC_PREFIX)) throw new Error(`QR content must starts with ${EUDCC_PREFIX}`)\n const { value } = cbor.decodeFirstSync(zlib.inflateSync(base45.decode(hcert.substr(EUDCC_PREFIX.length, hcert.length))))\n const rawPayload = cbor.decodeFirstSync(value[2])\n const rawHeader = cbor.decodeFirstSync(value[0])\n\n const header = { alg: rawHeader.get(1), kid: rawHeader.get(4).toString('base64') }\n const payload = {\n iss: rawPayload.get(1),\n iat: formatISODate(new Date(rawPayload.get(6) * 1E3)),\n exp: formatISODate(new Date(rawPayload.get(6) * 1E3)),\n hcert: rawPayload.get(-260).get(1)\n }\n\n return {\n header,\n payload,\n sig: value[3].toString('base64')\n }\n}\n","/* eslint-disable no-unused-vars */\nimport React from 'react'\nimport '../style/card.scss'\nimport { RecoveryEntry, TestEntry, VaccinationEntry } from '../types/dgc-combined-schema'\n\nimport {\n getCertificateAuthority,\n getPublicKey,\n VaccineCertificate,\n CommonCertificateInfo,\n TestCertificate, getAnalysisResult, getSex, decode2DDoc\n} from '../converters/2ddoc'\nimport bwipjs from 'bwip-js'\nimport * as crypto from 'crypto'\nimport { DecodedEUDCC, decodeEUDCC, EUDCC_PREFIX } from '../converters/eudcc'\n\nexport enum DocType {\n EUDCC,\n DDOC\n}\n\ninterface Props {\n data: string\n isWithAd?: boolean\n}\n\ninterface State {\n eudcc?: DecodedEUDCC\n ddoc?: CommonCertificateInfo\n docType: DocType\n}\n\ntype PassType = 'VACCINATION' | 'TEST' | 'RECOVERY'\n\nconst formatISODate = (date: Date) => date.toISOString().split('T')[0]\nconst formatISODateTime = (date: Date) => date.toISOString().split('.')[0]\n\nfunction EUCCInfoTable (passType: PassType, eudcc?: VaccinationEntry | TestEntry | RecoveryEntry) {\n return <>\n \n Unique certificate identifier\n {eudcc?.ci}\n \n \n Certificate issuer\n {eudcc?.is}\n \n \n Country of {passType === 'VACCINATION' ? 'vaccination' : 'test'}\n {eudcc?.co}\n \n {\n passType === 'VACCINATION' && <>\n \n Disease or agent targeted\n {eudcc?.tg}\n \n \n Vaccine or prophylaxis\n {eudcc?.vp as string}\n \n \n Vaccine product\n {eudcc?.mp as string}\n \n \n Vaccine marketing authorization holder\n {eudcc?.ma as string}\n \n \n Number in a series of doses\n {eudcc?.dn as string}\n \n \n The overall number of doses\n {eudcc?.sd as string}\n \n \n Date of vaccination\n {eudcc?.dt as string}\n \n \n }\n {\n passType === 'TEST' && <>\n \n Disease or agent targeted\n {eudcc?.tg}\n \n \n The type of test\n {eudcc?.tt as string}\n \n \n The name of the NAAT used\n {eudcc?.nm as string}\n \n \n The device identifier of the RAT used\n {eudcc?.ma as string}\n \n \n Date and time of the test sample collection\n {eudcc?.sc as string}\n \n \n Result of the test\n {eudcc?.tr as string}\n \n \n Testing centre or facility\n {eudcc?.tc as string}\n \n \n }\n {\n passType === 'RECOVERY' && <>\n \n Disease or agent targeted\n {eudcc?.tg}\n \n \n Date of the holder’s first positive\n {eudcc?.fr as string}\n \n \n Certificate valid from\n {eudcc?.df as string}\n \n \n Certificate valid until\n {eudcc?.du as string}\n \n \n }\n \n}\n\nfunction DDOCInfoTable (ddoc: CommonCertificateInfo) {\n return <>\n \n Issuing country\n {ddoc.source.cert.document_country}\n \n \n Certificate authority\n {getCertificateAuthority(ddoc.source.cert.certificate_authority_id)}\n \n \n Encryption key\n {getPublicKey(ddoc.source.cert.public_key_id)}\n \n \n Signature date\n {formatISODate(ddoc.source.cert.signature_date as Date)}\n \n \n Type of document\n {ddoc.source.cert.document_type}\n \n {\n ddoc?.type === 'vaccination'\n ? <>\n \n Doses received\n {ddoc.doses_received}\n \n \n Doses expected\n {ddoc.doses_expected}\n \n \n Prophylactic agent\n {ddoc.prophylactic_agent}\n \n \n Date of vaccination\n {formatISODate((ddoc.source.cert as VaccineCertificate).last_dose_date)}\n \n \n Vaccination cycle state\n {(ddoc.source.cert as VaccineCertificate).cycle_state}\n \n \n Disease\n {(ddoc.source.cert as VaccineCertificate).disease}\n \n \n Vaccine name\n {(ddoc.source.cert as VaccineCertificate).vaccine}\n \n \n Vaccine manufacturer\n {(ddoc.source.cert as VaccineCertificate).vaccine_maker}\n \n \n : <>\n \n Gender\n {getSex((ddoc.source.cert as TestCertificate).sex)}\n \n \n Analysis code\n {(ddoc.source.cert as TestCertificate).analysis_code}\n \n \n Analysis date/time\n { formatISODateTime((ddoc.source.cert as TestCertificate).analysis_datetime) }\n \n \n Result\n {getAnalysisResult((ddoc.source.cert as TestCertificate).analysis_result)}\n \n \n }\n \n}\n\nexport class CovidCard extends React.Component {\n constructor (props: Props) {\n super(props)\n this.state = {\n docType: props.data.trim().startsWith(EUDCC_PREFIX) ? DocType.EUDCC : DocType.DDOC\n }\n }\n\n componentDidMount () {\n try {\n switch (this.state.docType) {\n case DocType.EUDCC:\n this.setState({ eudcc: decodeEUDCC(this.props.data.trim()) })\n break\n case DocType.DDOC:\n decode2DDoc(this.props.data.trim()).then(ddoc => this.setState({ ddoc }))\n break\n default:\n throw new Error('Not a certificate.')\n }\n } catch (e) {\n console.error(e)\n }\n }\n\n render () {\n if (typeof this.state.eudcc === 'undefined' && typeof this.state.ddoc === 'undefined') {\n return \n }\n const passType = this.state.docType === DocType.DDOC ? this.state.ddoc?.type.toUpperCase() as PassType : this.state.eudcc?.payload.hcert ? 'v' in this.state.eudcc?.payload.hcert ? 'VACCINATION' : 't' in this.state.eudcc?.payload.hcert ? 'TEST' : 'RECOVERY' : 'VACCINATION'\n const eudccEntry = passType === 'VACCINATION' ? this.state.eudcc?.payload.hcert.v : passType === 'TEST' ? this.state.eudcc?.payload.hcert.t : this.state.eudcc?.payload.hcert.r\n const [eudcc] = eudccEntry || []\n return \n \n \n \n \n \n \n
\n

{this.state.docType === DocType.EUDCC ? 'EU Digital COVID Certificate' : '2D-Doc'}

\n {}\n {this.state.eudcc?.payload.hcert.nam?.gn || this.state.ddoc?.first_name} {this.state.eudcc?.payload.hcert.nam?.fn || this.state.ddoc?.last_name}

\n

Date of\n birth {this.state.eudcc?.payload.hcert.dob || formatISODate(this.state.ddoc?.date_of_birth as Date)}

\n {this.props.isWithAd && covid-pass.pages.dev}\n
\n

{passType}

\n \n \n {this.state.docType === DocType.EUDCC ? EUCCInfoTable(passType, eudcc) : DDOCInfoTable(this.state.ddoc as CommonCertificateInfo)}\n \n
\n {this.state.docType === DocType.EUDCC && {crypto.createHash('sha256').update(eudcc?.co.toUpperCase() as string + eudcc?.ci).digest('hex')}

}\n
\n }\n}\n","import React from 'react'\nimport { CovidCard } from './components/CovidCard'\nimport { Button, Jumbotron, Modal } from 'react-bootstrap'\nimport QrReader from 'react-qr-reader'\nimport { EUDCC_PREFIX } from './converters/eudcc'\nimport { DDOC_PREFIX } from './converters/2ddoc'\n\nconst TAC_WALLET_DCC_URL = 'https://bonjour.tousanticovid.gouv.fr/app/walletdcc#'\nconst TAC_WALLET_DDOC_URL = 'https://bonjour.tousanticovid.gouv.fr/app/wallet?v='\n\ninterface State {\n hcert: string\n cards: JSX.Element[]\n isScanning: boolean\n isSettingsVisible: boolean\n isWithAd: boolean\n count: number\n}\n\nclass App extends React.Component {\n constructor (props: object) {\n super(props)\n this.state = {\n isScanning: false,\n isSettingsVisible: false,\n isWithAd: true,\n hcert: '',\n cards: [],\n count: 1\n }\n this.onAppend = this.onAppend.bind(this)\n this.appendHCERT = this.appendHCERT.bind(this)\n this.onScan = this.onScan.bind(this)\n }\n\n /**\n * Ajouter une carte à partir des données du code bidimensionnel.\n * @param hcert La donnée du code bidimensionnel.\n */\n appendHCERT (hcert: string) {\n const newCards = []\n for (let i = 0; i < this.state.count; i++) {\n newCards.push(...hcert.trim().split('\\n').filter(e => e.startsWith(EUDCC_PREFIX) || e.startsWith(DDOC_PREFIX)).map((e: string, k: number) =>\n ))\n }\n this.setState({\n cards: [...this.state.cards, ...newCards]\n })\n }\n\n /**\n * @param qr La donnée décodée à partir du code QR.\n */\n onScan (qr: string | null) {\n if (qr === null) return\n this.setState({ isScanning: false })\n if (qr.startsWith(EUDCC_PREFIX) || qr.startsWith(DDOC_PREFIX)) return this.appendHCERT(qr)\n if (qr.startsWith(TAC_WALLET_DCC_URL)) return this.appendHCERT(decodeURIComponent(qr.replace(TAC_WALLET_DCC_URL, '')))\n if (qr.startsWith(TAC_WALLET_DDOC_URL)) return this.appendHCERT(decodeURIComponent(qr.replace(TAC_WALLET_DDOC_URL, '')))\n }\n\n /**\n * Vérifier si le certificat à importer débute par le bon préfixe.\n */\n onAppend () {\n if (!this.state.hcert.startsWith(EUDCC_PREFIX) && !this.state.hcert.startsWith(DDOC_PREFIX)) return alert(`QR content must starts with ${EUDCC_PREFIX} or ${DDOC_PREFIX}`)\n this.setState({ hcert: '' })\n this.appendHCERT(this.state.hcert)\n }\n\n render () {\n return <>\n \n \n Paramètres\n \n \n
\n \n
\n this.setState({ count: parseInt(target.value) })}/>\n
\n \n
\n this.setState({ isWithAd: !this.state.isWithAd })}/>\n
\n
\n
\n \n \n \n
\n \n \n Scan QR Code\n \n \n \n \n \n \n \n \n \n

Imprimer Pass sanitaire / Print Digital COVID Certificate

\n

Toutes les étapes sont effectuées sur votre terminal. Aucun échange de données n'est effectué entre\n votre appareil et le serveur une fois la page chargée.
This tool respects your personal data. The certificate is decoded on your device and no\n information\n about it is sent anywhere.

\n
\n \n