import { localizeWithPath } from '../../../../nls.js';
import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
import { language } from '../../../../base/common/platform.js';
const _moduleId = "vs/workbench/contrib/speech/common/speechService";
const HasSpeechProvider = ( (new RawContextKey('hasSpeechProvider', false, { type: 'boolean', description: ( localizeWithPath(_moduleId, 0, "A speech provider is registered to the speech service.")) })));
const SpeechToTextInProgress = ( (new RawContextKey(
    'speechToTextInProgress',
    false,
    { type: 'boolean', description: ( localizeWithPath(_moduleId, 1, "A speech-to-text session is in progress.")) }
)));
const TextToSpeechInProgress = ( (new RawContextKey(
    'textToSpeechInProgress',
    false,
    { type: 'boolean', description: ( localizeWithPath(_moduleId, 2, "A text-to-speech session is in progress.")) }
)));
var SpeechToTextStatus;
( ((function(SpeechToTextStatus) {
    SpeechToTextStatus[SpeechToTextStatus["Started"] = 1] = "Started";
    SpeechToTextStatus[SpeechToTextStatus["Recognizing"] = 2] = "Recognizing";
    SpeechToTextStatus[SpeechToTextStatus["Recognized"] = 3] = "Recognized";
    SpeechToTextStatus[SpeechToTextStatus["Stopped"] = 4] = "Stopped";
    SpeechToTextStatus[SpeechToTextStatus["Error"] = 5] = "Error";
})(SpeechToTextStatus || (SpeechToTextStatus = {}))));
var TextToSpeechStatus;
( ((function(TextToSpeechStatus) {
    TextToSpeechStatus[TextToSpeechStatus["Started"] = 1] = "Started";
    TextToSpeechStatus[TextToSpeechStatus["Stopped"] = 2] = "Stopped";
    TextToSpeechStatus[TextToSpeechStatus["Error"] = 3] = "Error";
})(TextToSpeechStatus || (TextToSpeechStatus = {}))));
var KeywordRecognitionStatus;
( ((function(KeywordRecognitionStatus) {
    KeywordRecognitionStatus[KeywordRecognitionStatus["Recognized"] = 1] = "Recognized";
    KeywordRecognitionStatus[KeywordRecognitionStatus["Stopped"] = 2] = "Stopped";
    KeywordRecognitionStatus[KeywordRecognitionStatus["Canceled"] = 3] = "Canceled";
})(KeywordRecognitionStatus || (KeywordRecognitionStatus = {}))));
var AccessibilityVoiceSettingId;
( ((function(AccessibilityVoiceSettingId) {
    AccessibilityVoiceSettingId["SpeechTimeout"] = "accessibility.voice.speechTimeout";
    AccessibilityVoiceSettingId["AutoSynthesize"] = "accessibility.voice.autoSynthesize";
    AccessibilityVoiceSettingId["SpeechLanguage"] = "accessibility.voice.speechLanguage";
})(AccessibilityVoiceSettingId || (AccessibilityVoiceSettingId = {}))));
const SPEECH_LANGUAGE_CONFIG = AccessibilityVoiceSettingId.SpeechLanguage;
const SPEECH_LANGUAGES = {
    ['da-DK']: {
        name: ( localizeWithPath(_moduleId, 3, "Danish (Denmark)"))
    },
    ['de-DE']: {
        name: ( localizeWithPath(_moduleId, 4, "German (Germany)"))
    },
    ['en-AU']: {
        name: ( localizeWithPath(_moduleId, 5, "English (Australia)"))
    },
    ['en-CA']: {
        name: ( localizeWithPath(_moduleId, 6, "English (Canada)"))
    },
    ['en-GB']: {
        name: ( localizeWithPath(_moduleId, 7, "English (United Kingdom)"))
    },
    ['en-IE']: {
        name: ( localizeWithPath(_moduleId, 8, "English (Ireland)"))
    },
    ['en-IN']: {
        name: ( localizeWithPath(_moduleId, 9, "English (India)"))
    },
    ['en-NZ']: {
        name: ( localizeWithPath(_moduleId, 10, "English (New Zealand)"))
    },
    ['en-US']: {
        name: ( localizeWithPath(_moduleId, 11, "English (United States)"))
    },
    ['es-ES']: {
        name: ( localizeWithPath(_moduleId, 12, "Spanish (Spain)"))
    },
    ['es-MX']: {
        name: ( localizeWithPath(_moduleId, 13, "Spanish (Mexico)"))
    },
    ['fr-CA']: {
        name: ( localizeWithPath(_moduleId, 14, "French (Canada)"))
    },
    ['fr-FR']: {
        name: ( localizeWithPath(_moduleId, 15, "French (France)"))
    },
    ['hi-IN']: {
        name: ( localizeWithPath(_moduleId, 16, "Hindi (India)"))
    },
    ['it-IT']: {
        name: ( localizeWithPath(_moduleId, 17, "Italian (Italy)"))
    },
    ['ja-JP']: {
        name: ( localizeWithPath(_moduleId, 18, "Japanese (Japan)"))
    },
    ['ko-KR']: {
        name: ( localizeWithPath(_moduleId, 19, "Korean (South Korea)"))
    },
    ['nl-NL']: {
        name: ( localizeWithPath(_moduleId, 20, "Dutch (Netherlands)"))
    },
    ['pt-PT']: {
        name: ( localizeWithPath(_moduleId, 21, "Portuguese (Portugal)"))
    },
    ['pt-BR']: {
        name: ( localizeWithPath(_moduleId, 22, "Portuguese (Brazil)"))
    },
    ['ru-RU']: {
        name: ( localizeWithPath(_moduleId, 23, "Russian (Russia)"))
    },
    ['sv-SE']: {
        name: ( localizeWithPath(_moduleId, 24, "Swedish (Sweden)"))
    },
    ['tr-TR']: {
        name: ( localizeWithPath(_moduleId, 25, "Turkish (Türkiye)"))
    },
    ['zh-CN']: {
        name: ( localizeWithPath(_moduleId, 26, "Chinese (Simplified, China)"))
    },
    ['zh-HK']: {
        name: ( localizeWithPath(_moduleId, 27, "Chinese (Traditional, Hong Kong)"))
    },
    ['zh-TW']: {
        name: ( localizeWithPath(_moduleId, 28, "Chinese (Traditional, Taiwan)"))
    }
};
function speechLanguageConfigToLanguage(config, lang = language) {
    if (typeof config === 'string') {
        if (config === 'auto') {
            if (lang !== 'en') {
                const langParts = lang.split('-');
                return speechLanguageConfigToLanguage(`${langParts[0]}-${(langParts[1] ?? langParts[0]).toUpperCase()}`);
            }
        }
        else {
            if (SPEECH_LANGUAGES[config]) {
                return config;
            }
        }
    }
    return 'en-US';
}
export { AccessibilityVoiceSettingId, HasSpeechProvider, KeywordRecognitionStatus, SPEECH_LANGUAGES, SPEECH_LANGUAGE_CONFIG, SpeechToTextInProgress, SpeechToTextStatus, TextToSpeechInProgress, TextToSpeechStatus, speechLanguageConfigToLanguage };
