export const DB_NAME = 'whisper-web';
export const DB_VERSION = 1;
export const DB_OBJECT_STORE_NAME = 'models';

export const MODELS = [
	'tiny',
	'tiny.en',
	'base',
	'base.en',
	'small',
	'small.en',
] as const;

export type WhisperWebModel = (typeof MODELS)[number];

export const LANGUAGES = [
	// whisper allows passing 'auto' to auto-detect the language
	'auto',
	// short codes
	'en',
	'zh',
	'de',
	'es',
	'ru',
	'ko',
	'fr',
	'ja',
	'pt',
	'tr',
	'pl',
	'ca',
	'nl',
	'ar',
	'sv',
	'it',
	'id',
	'hi',
	'fi',
	'vi',
	'he',
	'uk',
	'el',
	'ms',
	'cs',
	'ro',
	'da',
	'hu',
	'ta',
	'no',
	'th',
	'ur',
	'hr',
	'bg',
	'lt',
	'la',
	'mi',
	'ml',
	'cy',
	'sk',
	'te',
	'fa',
	'lv',
	'bn',
	'sr',
	'az',
	'sl',
	'kn',
	'et',
	'mk',
	'br',
	'eu',
	'is',
	'hy',
	'ne',
	'mn',
	'bs',
	'kk',
	'sq',
	'sw',
	'gl',
	'mr',
	'pa',
	'si',
	'km',
	'sn',
	'yo',
	'so',
	'af',
	'oc',
	'ka',
	'be',
	'tg',
	'sd',
	'gu',
	'am',
	'yi',
	'lo',
	'uz',
	'fo',
	'ht',
	'ps',
	'tk',
	'nn',
	'mt',
	'sa',
	'lb',
	'my',
	'bo',
	'tl',
	'mg',
	'as',
	'tt',
	'haw',
	'ln',
	'ha',
	'ba',
	'jw',
	'su',
	'yue',
	// aliases
	'english',
	'chinese',
	'german',
	'spanish',
	'russian',
	'korean',
	'french',
	'japanese',
	'portuguese',
	'turkish',
	'polish',
	'catalan',
	'dutch',
	'arabic',
	'swedish',
	'italian',
	'indonesian',
	'hindi',
	'finnish',
	'vietnamese',
	'hebrew',
	'ukrainian',
	'greek',
	'malay',
	'czech',
	'romanian',
	'danish',
	'hungarian',
	'tamil',
	'norwegian',
	'thai',
	'urdu',
	'croatian',
	'bulgarian',
	'lithuanian',
	'latin',
	'maori',
	'malayalam',
	'welsh',
	'slovak',
	'telugu',
	'persian',
	'latvian',
	'bengali',
	'serbian',
	'azerbaijani',
	'slovenian',
	'kannada',
	'estonian',
	'macedonian',
	'breton',
	'basque',
	'icelandic',
	'armenian',
	'nepali',
	'mongolian',
	'bosnian',
	'kazakh',
	'albanian',
	'swahili',
	'galician',
	'marathi',
	'punjabi',
	'sinhala',
	'khmer',
	'shona',
	'yoruba',
	'somali',
	'afrikaans',
	'occitan',
	'georgian',
	'belarusian',
	'tajik',
	'sindhi',
	'gujarati',
	'amharic',
	'yiddish',
	'lao',
	'uzbek',
	'faroese',
	'haitian creole',
	'pashto',
	'turkmen',
	'nynorsk',
	'maltese',
	'sanskrit',
	'luxembourgish',
	'myanmar',
	'tibetan',
	'tagalog',
	'malagasy',
	'assamese',
	'tatar',
	'hawaiian',
	'lingala',
	'hausa',
	'bashkir',
	'javanese',
	'sundanese',
	'cantonese',
] as const;

export type WhisperWebLanguage = (typeof LANGUAGES)[number];

export const SIZES: {[key in WhisperWebModel]: number} = {
	tiny: 77691713,
	'tiny.en': 77704715,
	base: 147951465,
	'base.en': 147964211,
	small: 487601967,
	'small.en': 487614201,
};
