import { i18n } from '@kbn/i18n' ; import { getEMSSettings } from '../kibana_services' ; export function getEmsUnavailableMessage ( ) { const emsSettings = getEMSSettings ( ) ; if ( ! emsSettings . isIncludeElasticMapsService ( ) ) { return i18n . translate ( 'xpack.maps.source.ems.disabledDescription' , { defaultMessage : 'Access to Elastic Maps Service has been disabled. Ask your system administrator to set "map.includeElasticMapsService" in kibana.yml.' , } ) ; } if ( emsSettings . isEMSUrlSet ( ) ) { if ( ! emsSettings . hasOnPremLicense ( ) ) { return i18n . translate ( 'xpack.maps.source.ems.noOnPremLicenseDescription' , { defaultMessage : 'An enterprise license is required to connect to local Elastic Maps Server installations.' , } ) ; } else { return i18n . translate ( 'xpack.maps.source.ems.noOnPremConnectionDescription' , { defaultMessage : 'Cannot connect to {host}.' , values : { host : emsSettings . getEMSRoot ( ) , } , } ) ; } } return i18n . translate ( 'xpack.maps.source.ems.noAccessDescription' , { defaultMessage : 'Kibana is unable to access Elastic Maps Service. Contact your system administrator.' , } ) ; }