import { getOS , getBrowser , getDevice } from '@proton/shared/lib/helpers/browser' ; import { CLIENT_ID_KEYS , CLIENT_IDS } from '@proton/shared/lib/constants' ; export const getClient = ( clientID ) => { return CLIENT_IDS [ clientID ] ; } ; const getIsTouchDevice = ( ) => navigator . maxTouchPoints > 1 ; const getArtificialOSName = ( osName ) => { if ( ! getIsTouchDevice ( ) ) { return ; } if ( osName === 'Mac OS' ) { return 'iOS' ; } if ( osName === 'Linux' ) { return 'Android' ; } } ; const getEnhancedOSInfo = ( ) => { const os = getOS ( ) ; const artificialOSName = getArtificialOSName ( os . name ) ; if ( artificialOSName ) { return { name : artificialOSName , version : '' , artificial : true , } ; } return { ... os , artificial : false , } ; } ; export const getReportInfo = ( ) => { const browser = getBrowser ( ) ; const device = getDevice ( ) ; const os = getEnhancedOSInfo ( ) ; return { OS : os . name , OSVersion : os . version || '' , OSArtificial : os . artificial , Browser : browser . name , BrowserVersion : browser . version , Resolution : `${ window . innerHeight } x ${ window . innerWidth }` , DeviceName : device . vendor , DeviceModel : device . model , } ; } ;