From 483ac7b805388f4d82536bf91f5353491ff68087 Mon Sep 17 00:00:00 2001 From: SashaXser <24498484+SashaXser@users.noreply.github.com> Date: Sun, 6 Aug 2023 01:04:48 +0400 Subject: [PATCH] Add files via upload --- dist/vot-cloudflare-min.user.js | 2 +- dist/vot-cloudflare.user.js | 4 ++-- dist/vot-min.user.js | 2 +- dist/vot.user.js | 4 ++-- src/index.js | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/vot-cloudflare-min.user.js b/dist/vot-cloudflare-min.user.js index dfe648ed..399c879c 100644 --- a/dist/vot-cloudflare-min.user.js +++ b/dist/vot-cloudflare-min.user.js @@ -84,4 +84,4 @@ // @updateURL https://raw.githubusercontent.com/ilyhalight/voice-over-translation/master/dist/vot-cloudflare.user.js // ==/UserScript== -(()=>{"use strict";var e={"./node_modules/css-loader/dist/cjs.js!./src/styles/main.css":(e,t,n)=>{n.d(t,{Z:()=>s});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),a=n.n(o),i=n("./node_modules/css-loader/dist/runtime/api.js"),r=n.n(i)()(a());r.push([e.id,'.translationBlock {\n padding: 0.45rem !important;\n width: max-content;\n position: absolute;\n background: #2e2f34;\n border-radius: 0.5rem !important;\n left: 50%;\n top: 5rem;\n transform: translate(-50%);\n text-align: center;\n opacity: 0;\n transition: opacity 1s;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n z-index: 100;\n}\n\n.translationBtn {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n color: #fff;\n padding-right: 0.25rem !important;\n cursor: pointer;\n font: 600 12px / 14px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif;\n}\n\n.translationBlock:hover {\n opacity: 1;\n}\n\n.translationMenu {\n display: inline-block;\n vertical-align: middle;\n border-left: 1px solid #424348;\n max-height: 16px;\n max-width: 24px;\n cursor: pointer;\n}\n\n.translationMenuIcon {\n padding: 0 10px !important;\n width: 24px;\n}\n\n.translationIAlice {\n display: inline-block;\n vertical-align: middle;\n max-height: 26px;\n max-width: 50px;\n}\n\n.translationIconAlice {\n height: 24px !important;\n width: 24px !important;\n}\n\n.translationITranslate {\n display: inline-block;\n vertical-align: middle;\n max-height: 20px;\n max-width: 20px;\n}\n\n.translationMenuContent {\n position: absolute;\n background: #2e2f34;\n color: #fff;\n display: none;\n border-radius: 1rem !important;\n left: 50%;\n top: 10rem;\n transform: translate(-50%);\n text-align: left;\n font: 600 14px / 16px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif !important;\n\n width: 300px;\n /* height: 375px; */\n opacity: 0;\n z-index: 100;\n transition: opacity 0.5s ease;\n}\n\n.VOTMenuSlider {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 268px !important;\n height: 8px !important;\n outline: none !important;\n margin-top: 0.5rem;\n opacity: 0.7;\n /* background: #3C3F4D !important; */\n background: rgb(253, 222, 85, 0.6) !important;\n border: none !important;\n border-radius: 2rem !important;\n -webkit-transition: 0.2s !important;\n transition: opacity 0.2s ease !important;\n}\n\n.VOTMenuSlider:hover {\n opacity: 1;\n}\n\n.VOTMenuSlider::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-moz-range-thumb {\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-ms-thumb {\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-ms-fill-lower {\n height: 8px !important;\n border-radius: 2rem !important;\n background: linear-gradient(\n 90.1deg,\n rgba(186, 153, 244, 0.85) -5.78%,\n rgba(236, 138, 202, 0.7) 56.46%,\n rgba(239, 168, 117, 0.6) 108.93%\n ) !important;\n}\n\n.VOTMenuSlider::-moz-range-progress {\n height: 8px !important;\n border-radius: 2rem !important;\n background: linear-gradient(\n 90.1deg,\n rgba(186, 153, 244, 0.85) -5.78%,\n rgba(236, 138, 202, 0.7) 56.46%,\n rgba(239, 168, 117, 0.6) 108.93%\n ) !important;\n}\n\n.translationHeader {\n padding-bottom: 0.5rem !important;\n}\n\n.translationMainHeader {\n margin: 16px !important;\n color: #fff;\n font: 900 14px / 16px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif !important;\n}\n\n.translationMenuOptions {\n display: flex;\n flex-flow: column wrap;\n}\n\n.translationMenuContainer {\n /* width: 100%; */\n padding-left: 16px !important;\n padding-top: 5px !important;\n display: inline-block !important;\n}\n\n.translationMenuContainer > input {\n appearance: auto !important;\n vertical-align: text-bottom;\n}\n\n.translationMenuText {\n color: #fff;\n display: inline-flex;\n width: 80%;\n}\n\n.translationVolumeBox,\n.translationVideoVolumeBox {\n padding-top: 0.5rem !important;\n}\n\n.translationDropDB {\n border: none !important;\n border-radius: 4px !important;\n background: #5426ff !important;\n color: #fff !important;\n padding: 6px 16px !important;\n margin-left: auto !important;\n cursor: pointer !important;\n}\n\n.translationDownload {\n background: #5426ff !important;\n color: #fff !important;\n padding: 2px 10px !important;\n border-radius: 4px !important;\n cursor: pointer;\n display: none;\n}\n\n.translationMenuFunctional {\n display: flex;\n margin: 16px !important;\n}\n\n.VOTMenuSelect {\n width: 110px;\n border-radius: 5px !important;\n border: 1px solid #dadce0 !important;\n box-shadow: 0 1px 3px -2px #9098a9;\n box-sizing: border-box !important;\n color: #2e2f34 !important;\n background: #fff !important;\n padding: 5px !important;\n}\n\n.VOTMenuSelect:focus {\n outline: none;\n}\n\n.VOTMenuSelect:focus {\n outline: none;\n border-color: #0077ff;\n box-shadow: 0 0 0 2px rgba(#0077ff, 0.2);\n}\n\n#VOTSelectLanguages {\n display: flex !important;\n margin-left: 5px;\n}\n\n#VOTSelectLanguages svg {\n margin: 0 5px;\n}\n',""]);const s=r},"./node_modules/css-loader/dist/runtime/api.js":e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,a,i){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(o)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),t.push(u))}},t}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":e=>{e.exports=function(e){return e[1]}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":e=>{var t=[];function n(e){for(var n=-1,o=0;o{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},"./node_modules/style-loader/dist/runtime/insertStyleElement.js":e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var a=void 0!==n.layer;a&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,a&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},"./src/config/config-cloudflare.js":(e,t,n)=>{n.d(t,{I:()=>a,i:()=>o});const o="vot.toil-dump.workers.dev",a="gnnde87s24kcuMH8rbWhLyfeuEKDkGGm"},"./src/config/config.js":(e,t,n)=>{n.d(t,{IM:()=>a,Rr:()=>o});const o="Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 CriOS/104.0.5112.114 YaBrowser/22.9.4.633.10 SA/3 Mobile/15E148 Safari/604.1",a=.15},"./src/config/constants.js":(e,t,n)=>{n.d(t,{Iz:()=>r,ey:()=>o,g$:()=>i,tW:()=>a});const o=0x4075500000000000,a={ru:"Russian",en:"English",zh:"Chinese",fr:"French",it:"Italian",es:"Spanish",de:"German"},i={youtube:"https://youtu.be/",twitch:"https://twitch.tv/",vimeo:"https://vimeo.com/","9gag":"https://9gag.com/gag/",vk:"https://vk.com/video?z=",xvideos:"https://www.xvideos.com/",pornhub:"https://rt.pornhub.com/view_video.php?viewkey=",udemy:"https://www.udemy.com",twitter:"https://twitter.com/i/status/",facebook:"https://www.facebook.com/",rutube:"https://rutube.ru/video/","bilibili.com":"https://www.bilibili.com/video/","mail.ru":"https://my.mail.ru/",coub:"https://coub.com/view/"},r={ru:{recommended:"рекомендуется",translateVideo:"Перевести видео",disableTranslate:"Выключить",translationSettings:"Настройки перевода",resetSettings:"Сбросить настройки",videoBeingTranslated:"Видео переводится",videoLanguage:"Язык видео",translationLanguage:"Язык перевода",translationTake:"Перевод займёт",translationTakeMoreThanHour:"Перевод займёт больше часа",translationTakeAboutMinute:"Перевод займёт около минуты",translationTakeFewMinutes:"Перевод займёт несколько минут",translationTakeApproximatelyMinutes:"Перевод займёт примерно {0} минут",translationTakeApproximatelyMinute:"Перевод займёт примерно {0} минуты",unSupportedExtensionError:`Ошибка! ${GM_info.scriptHandler} не поддерживается этой версией расширения!\n\nПожалуйста, используйте cloudflare-версию расширения VOT.`,requestTranslationFailed:"Не удалось запросить перевод видео",audioNotReceived:"Не получена ссылка на аудио",grantPermissionToAutoPlay:"Предоставьте разрешение на автовоспроизведение",neededAdditionalExtension:"Для поддержки этого сайта необходимо дополнительное расширение",audioFormatNotSupported:"Формат аудио не поддерживается",VOTAutoTranslate:"Переводить при открытии",VOTDontTranslateYourLang:"Не переводить с родного языка",VOTVolume:"Громкость видео",VOTVolumeTranslation:"Громкость перевода",VOTAutoSetVolume:"Уменьшать громкость видео до ",VOTShowVideoSlider:"Слайдер громкости видео",VOTSyncVolume:"Связать громкость перевода и видео",VOTAudioProxy:"Проксировать полученное аудио",VOTDisableFromYourLang:"VOT: Вы отключили перевод видео на вашем языке",VOTLiveNotSupported:"VOT: Не поддерживается перевод трансляций в прямом эфире",VOTPremiere:"VOT: Дождитесь окончания премьеры перед переводом",VOTVideoIsTooLong:"VOT: Видео слишком длинное",VOTNoVideoIDFound:"VOT: Не найдено ID видео",VOTFailedInitDB:"VOT: Не удалось инициализовать базу данных",VOTDBNeedUpdate:"VOT: Базе данных нужно обновление, пожалуйста, перезагрузите страницу",VOTDisabledForDBUpdating:`VOT отключен из-за ошибки при обновление Базы Данных. Закройте все открытые вкладки с ${window.location.hostname} и попробуйте снова`,VOTFailedWriteToDB:"VOT: Не удалось записать данные в базу данных",VOTFailedReadFromDB:"VOT: Не удалось получить данные из базы данных",Russian:"Русский",English:"Английский",Chinese:"Китайский",French:"Французский",Italian:"Итальянский",Spanish:"Испанский",German:"Немецкий"},en:{recommended:"recommended",translateVideo:"Translate video",disableTranslate:"Turn off",translationSettings:"Translation settings",resetSettings:"Reset settings",videoBeingTranslated:"The video is being translated",videoLanguage:"Video language",translationLanguage:"Translation language",translationTake:"The translation will take",translationTakeMoreThanHour:"The translation will take more than an hour",translationTakeAboutMinute:"The translation will take about a minute",translationTakeFewMinutes:"The translation will take a few minutes",translationTakeApproximatelyMinutes:"The translation will take approximately {0} minutes",translationTakeApproximatelyMinute:"The translation will take approximately {0} minutes",unSupportedExtensionError:`Error! ${GM_info.scriptHandler} is not supported by this version of the extension!\n\nPlease use the cloudflare version of the VOT extension.`,requestTranslationFailed:"Failed to request video translation",audioNotReceived:"Audio link not received",grantPermissionToAutoPlay:"Grant permission to autoplay",neededAdditionalExtension:"An additional extension is needed to support this site",audioFormatNotSupported:"The audio format is not supported",VOTAutoTranslate:"Translate on open",VOTDontTranslateYourLang:"Do not translate from my language",VOTVolume:"Video volume",VOTVolumeTranslation:"Translation Volume",VOTAutoSetVolume:"Reduce video volume to ",VOTShowVideoSlider:"Video volume slider",VOTSyncVolume:"Link translation and video volume",VOTAudioProxy:"Proxy received audio",VOTDisableFromYourLang:"VOT: You have disabled the translation of the video in your language",VOTLiveNotSupported:"VOT: Translation of live streams is not supported",VOTPremiere:"VOT: Wait for the premiere to end before translating",VOTVideoIsTooLong:"VOT: Video is too long",VOTNoVideoIDFound:"VOT: No video ID found",VOTFailedInitDB:"VOT: Failed to initialize database",VOTDBNeedUpdate:"VOT: The database needs an update, please reload the page",VOTDisabledForDBUpdating:`VOT is disabled due to an error when updating the Database. Close all open tabs with ${window.location.hostname} and try again`,VOTFailedWriteToDB:"VOT: Data could not be written to the database",VOTFailedReadFromDB:"VOT: Data could not be retrieved from the database",Russian:"Russian",English:"English",Chinese:"Chinese",French:"French",Italian:"Italian",Spanish:"Spanish",German:"German"},zh:{recommended:"推荐使用",translateVideo:"翻译视频",disableTranslate:"关掉",translationSettings:"翻译需要一个多小时",resetSettings:"重置设置",videoBeingTranslated:"视频正在翻译中",videoLanguage:"视频语言",translationLanguage:"翻译语言",translationTake:"翻译将采取",translationTakeMoreThanHour:"翻译将采取一个多小时",translationTakeAboutMinute:"翻译将采取一分钟",translationTakeFewMinutes:"翻译将采取几分钟",translationTakeApproximatelyMinutes:"翻译将采取大约需要{0}分钟",translationTakeApproximatelyMinute:"翻译将采取大约需要{0}分钟",unSupportedExtensionError:`错误! 此版本的扩展不支持 ${GM_info.scriptHandler}!\n\n请使用cloudflare版本的VOT扩展.`,requestTranslationFailed:"请求视频翻译失败",audioNotReceived:"未收到音频链接",grantPermissionToAutoPlay:"授予自动播放权限",neededAdditionalExtension:"需要一个额外的扩展来支持这个网站",audioFormatNotSupported:"不支持音频格式",VOTAutoTranslate:"打开时翻译",VOTDontTranslateYourLang:"不要从你的语言翻译过来",VOTVolume:"视频量",VOTVolumeTranslation:"翻译量",VOTAutoSetVolume:"将视频音量降低到",VOTShowVideoSlider:"视频音量滑块",VOTSyncVolume:"链接翻译和视频音量",VOTAudioProxy:"代理接收的音频",VOTDisableFromYourLang:"VOT:你已经禁用了你的语言的视频翻译",VOTLiveNotSupported:"VOT:不支持直播流的翻译",VOTPremiere:"VOT:等待首映结束后再翻译",VOTVideoIsTooLong:"VOT:视频太长",VOTNoVideoIDFound:"VOT: 没有找到视频ID",VOTFailedInitDB:"VOT: 初始化数据库失败",VOTDBNeedUpdate:"VOT: 数据库需要更新,请重新加载页面",VOTDisabledForDBUpdating:`VOT由于更新数据库时出错而被禁用。 关闭所有打开的选项卡${window.location.hostname} 再试一次`,VOTFailedWriteToDB:"VOT: 无法将数据写入数据库",VOTFailedReadFromDB:"VOT: 无法从数据库中检索数据",Russian:"俄语",English:"英语",Chinese:"中文",French:"法语",Italian:"意大利语",Spanish:"西班牙语",German:"德语"},de:{recommended:"es wird empfohlen",translateVideo:"Video übersetzen",disableTranslate:"Ausschalten",translationSettings:"Übersetzungseinstellungen",resetSettings:"Einstellungen zurücksetzen",videoBeingTranslated:"Das Video wird übersetzt",videoLanguage:"Sprache Video",translationLanguage:"Zielsprache",translationTake:"Die Übersetzung dauert",translationTakeMoreThanHour:"Die Übersetzung dauert mehr als eine Stunde",translationTakeAboutMinute:"Die Übersetzung dauert ungefähr eine Minute",translationTakeFewMinutes:"Die Übersetzung dauert einige Minuten",translationTakeApproximatelyMinutes:"Die Übersetzung dauert ungefähr {0} Minuten",translationTakeApproximatelyMinute:"Die Übersetzung dauert ungefähr {0} Minuten",unSupportedExtensionError:`Fehler! ${GM_info.scriptHandler} wird von dieser Version der Erweiterung nicht unterstützt!\n\nBitte verwenden Sie die Cloudflare-Version der VOT-Erweiterung.`,requestTranslationFailed:"Videoübersetzung konnte nicht angefordert werden",audioNotReceived:"Audiolink nicht empfangen",grantPermissionToAutoPlay:"Erteilen Sie die Berechtigung zur automatischen Wiedergabe",neededAdditionalExtension:"Eine zusätzliche Erweiterung ist erforderlich, um diese Website zu unterstützen",audioFormatNotSupported:"Das Audioformat wird nicht unterstützt",VOTAutoTranslate:"Beim Öffnen übersetzen",VOTDontTranslateYourLang:"Nicht aus Ihrer Sprache übersetzen",VOTVolume:"Video Lautstärke",VOTVolumeTranslation:"Übersetzungsvolumen",VOTAutoSetVolume:"Video-Lautstärke auf reduzieren ",VOTShowVideoSlider:"Video-Lautstärkeregler",VOTSyncVolume:"Übersetzungs- und Videolautstärke verknüpfen",VOTAudioProxy:"Empfangenes Audio proxyen",VOTDisableFromYourLang:"VOT: Sie haben die Übersetzung des Videos in Ihrer Sprache deaktiviert",VOTLiveNotSupported:"VOT: Übersetzung von Live-Streams wird nicht unterstützt",VOTPremiere:"VOT: Warten Sie, bis die Premiere beendet ist, bevor Sie übersetzen",VOTVideoIsTooLong:"VOT: Video ist zu lang",VOTNoVideoIDFound:"VOT: Keine Video-ID gefunden",VOTFailedInitDB:"VOT: Datenbank konnte nicht initialisiert werden",VOTDBNeedUpdate:"VOT: Die Datenbank muss aktualisiert werden, bitte laden Sie die Seite neu",VOTDisabledForDBUpdating:`VOT wurde aufgrund eines Fehlers beim Aktualisieren der Datenbank deaktiviert. Schließen Sie alle geöffneten Tabs mit ${window.location.hostname} und versuchen Sie es erneut`,VOTFailedWriteToDB:"VOT: Daten konnten nicht in die Datenbank geschrieben werden",VOTFailedReadFromDB:"VOT: Konnte keine Daten aus der Datenbank abrufen",Russian:"Russisch",English:"Englisch",Chinese:"Chinesisch",French:"Französisch",Italian:"Italienisch",Spanish:"Spanisch",German:"Deutsch"},es:{recommended:"es recomendable",translateVideo:"Traducir video",disableTranslate:"Apagar",translationSettings:"Ajustes de traducción",resetSettings:"Restablecer ajustes",videoBeingTranslated:"El video está siendo traducido",videoLanguage:"Idioma del video",translationLanguage:"Idioma de la traducción",translationTake:"La traducción tardará",translationTakeMoreThanHour:"La traducción tardará más de una hora",translationTakeAboutMinute:"La traducción tardará aproximadamente un minuto",translationTakeFewMinutes:"La traducción tardará unos minutos",translationTakeApproximatelyMinutes:"La traducción tardará aproximadamente {0} minutos",translationTakeApproximatelyMinute:"La traducción tardará aproximadamente {0} minutos",unSupportedExtensionError:`Error! ${GM_info.scriptHandler} no es compatible con esta versión de la extensión!\n\nUtilice la versión cloudflare de la extensión VOT.`,requestTranslationFailed:"Error al solicitar la traducción de vídeo",audioNotReceived:"Audiolink nicht empfangen",grantPermissionToAutoPlay:"Conceder permiso de reproducción automática",neededAdditionalExtension:"Se necesita una extensión adicional para admitir este sitio",audioFormatNotSupported:"El formato de audio no es compatible",VOTAutoTranslate:"Traducir al abrir",VOTDontTranslateYourLang:"No traduzca de su lengua",VOTVolume:"Volumen de vídeo",VOTVolumeTranslation:"Volumen de traducción",VOTAutoSetVolume:"Reducir el volumen del video al ",VOTShowVideoSlider:"Deslizador de volumen de video",VOTSyncVolume:"Vincular el volumen de traducción y video",VOTAudioProxy:"Proxificar el audio recibido",VOTDisableFromYourLang:"VOT: Ha desactivado la traducción del vídeo en su idioma",VOTLiveNotSupported:"VOT: No se admite la traducción de transmisiones en vivo",VOTPremiere:"VOT: Espere a que termine el estreno antes de traducir",VOTVideoIsTooLong:"VOT: El video es demasiado largo",VOTNoVideoIDFound:"VOT: No se encontró id de video",VOTFailedInitDB:"VOT: No se pudo inicializar la base de datos",VOTDBNeedUpdate:"VOT: la Base de datos necesita una actualización, por favor vuelva a cargar la página",VOTDisabledForDBUpdating:`VOT está deshabilitado debido a un error al actualizar la Base de Datos. Cierre todas las pestañas abiertas con ${window.location.hostname} y vuelve a intentarlo`,VOTFailedWriteToDB:"VOT: No se pudo escribir datos en la base de datos",VOTFailedReadFromDB:"VOT: No se pudo recuperar datos de la base de datos",Russian:"Ruso",English:"Inglés",Chinese:"Chino",French:"Francés",Italian:"Italiano",Spanish:"Español",German:"Alemán"},fr:{recommended:"recommande",translateVideo:"Traduire la vidéo",disableTranslate:"Désactiver",translationSettings:"Paramètres de traduction",resetSettings:"Réinitialiser les paramètres",videoBeingTranslated:"La vidéo est en cours de traduction",videoLanguage:"Langue vidéo",translationLanguage:"Langue cible",translationTake:"La traduction prendra",translationTakeMoreThanHour:"La traduction prendra plus d'une heure",translationTakeAboutMinute:"La traduction prendra environ une minute",translationTakeFewMinutes:"La traduction prendra quelques minutes",translationTakeApproximatelyMinutes:"La traduction prendra environ {0} minutes",translationTakeApproximatelyMinute:"La traduction prendra environ {0} minutes",unSupportedExtensionError:`Erreur! ${GM_info.scriptHandler} n'est pas supporté par cette version de l'extension!!\n\nVeuillez utiliser la version cloudflare de l'extension VOT.`,requestTranslationFailed:"Impossible de demander la traduction de la vidéo",audioNotReceived:"Lien audio non reçu",grantPermissionToAutoPlay:"Accorder l'autorisation de lecture automatique",neededAdditionalExtension:"Une extension supplémentaire est nécessaire pour prendre en charge ce site",audioFormatNotSupported:"Format audio non pris en charge",VOTAutoTranslate:"Traduire à l'ouverture",VOTDontTranslateYourLang:"Ne pas traduire à partir de votre langue",VOTVolume:"Volume de la vidéo",VOTVolumeTranslation:"Volume de traduction",VOTAutoSetVolume:"Réduire le volume de la vidéo à ",VOTShowVideoSlider:"Curseur de volume vidéo",VOTSyncVolume:"Lier le volume de la traduction et de la vidéo",VOTAudioProxy:"Proxy audio reçu",VOTDisableFromYourLang:"VOT: Vous avez désactivé la traduction de la vidéo dans votre langue",VOTLiveNotSupported:"VOT: La traduction des flux en direct n'est pas prise en charge",VOTPremiere:"VOT: Attendez la fin de la première avant de traduire",VOTVideoIsTooLong:"VOT: La vidéo est trop longue",VOTNoVideoIDFound:"VOT: ID vidéo introuvable",VOTFailedInitDB:"VOT: Impossible d'initialiser la base de données",VOTDBNeedUpdate:"VOT: la Base de données a besoin d'une mise à jour, veuillez recharger la page",VOTDisabledForDBUpdating:`VOT est désactivé en raison d'une erreur lors de la mise à jour de la Base de Données. Fermez tous les onglets ouverts avec ${window.location.hostname} et essayez à nouveau`,VOTFailedWriteToDB:"VOT: Impossible d'écrire les données dans la base de données",VOTFailedReadFromDB:"VOT: Impossible de récupérer les données de la base de données",Russian:"Russe",English:"Anglais",Chinese:"Chinois",French:"Français",Italian:"Italien",Spanish:"Espagnol",German:"Allemand"},it:{recommended:"è consigliabile",translateVideo:"Traduci il video",disableTranslate:"Spegnere",translationSettings:"Impostazioni di traduzione",resetSettings:"Ripristina impostazioni",videoBeingTranslated:"Il video è in fase di traduzione",videoLanguage:"Lingua Video",translationLanguage:"Lingua di traduzione",translationTake:"La traduzione richiederà",translationTakeMoreThanHour:"La traduzione richiederà più di un'ora",translationTakeAboutMinute:"La traduzione richiederà circa un minuto",translationTakeFewMinutes:"La traduzione richiederà alcuni minuti",translationTakeApproximatelyMinutes:"La traduzione richiederà circa {0} minuti",translationTakeApproximatelyMinute:"La traduzione richiederà circa {0} minuti",unSupportedExtensionError:`Errore! ${GM_info.scriptHandler} non è supportato da questa versione dell'estensione!\n\nUtilizzare la versione cloudflare dell'estensione VOT.`,requestTranslationFailed:"Richiesta di traduzione video non riuscita",audioNotReceived:"Collegamento audio non ricevuto",grantPermissionToAutoPlay:"Concedere l'Autorizzazione per la riproduzione automatica",neededAdditionalExtension:"Per supportare questo sito è necessaria un'estensione aggiuntiva",audioFormatNotSupported:"Il formato audio non è supportato",VOTAutoTranslate:"Traduci all'apertura",VOTDontTranslateYourLang:"Non traducete dalla vostra lingua",VOTVolume:"Volume video",VOTVolumeTranslation:"Volume di traduzione",VOTAutoSetVolume:"Riduci il volume del video al ",VOTShowVideoSlider:"Cursore del volume del video",VOTSyncVolume:"Collega il volume della traduzione e del video",VOTAudioProxy:"Proxy audio ricevuto",VOTDisableFromYourLang:"VOT: Avete disabilitato la traduzione del video nella vostra lingua",VOTLiveNotSupported:"VOT: La traduzione dei flussi dal vivo non è supportata",VOTPremiere:"VOT: Aspetta che la prima finisca prima di tradurre",VOTVideoIsTooLong:"VOT: Il video è troppo lungo",VOTNoVideoIDFound:"VOT: ID video non trovato",VOTFailedInitDB:"VOT: Impossibile inizializzare il database",VOTDBNeedUpdate:"VOT: Il database ha bisogno di aggiornamento, si prega di ricaricare la pagina",VOTDisabledForDBUpdating:`VOT è disabilitato a causa di un errore durante l'aggiornamento del database. CHIUDI tutte le schede aperte con ${window.location.hostname} e riprova`,VOTFailedWriteToDB:"VOT: Impossibile scrivere dati nel database",VOTFailedReadFromDB:"VOT: Impossibile recuperare i dati dal database",Russian:"Russo",English:"Inglese",Chinese:"Cinese",French:"Francese",Italian:"Italiano",Spanish:"Spagnolo",German:"Tedesco"}}},"./src/rvt-cloudflare.js":(e,t,n)=>{function o(e){const t=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)));return e?t:t.toUpperCase()}n.r(t),n.d(t,{default:()=>l});var a=n("./src/yandexRequests.js"),i=n("./src/config/config-cloudflare.js"),r=n("./src/config/config.js"),s=n("./src/utils/debug.js");const l=async function(e,t,n,l,d){let u,c;const p=o(!0),m=a.G.encodeRequest(e,p,t,n,l);try{s.Z.log("requestVideoTranslation");const e=new TextEncoder("utf-8"),t=await window.crypto.subtle.importKey("raw",e.encode(i.I),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),n=await window.crypto.subtle.sign("HMAC",t,m),a=Array.from(new Uint8Array(n),(e=>e.toString(16).padStart(2,"0"))).join(""),l={method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify({headers:{Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf","User-Agent":r.Rr,Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors","Vtrans-Signature":a,"Sec-Vtrans-Token":o(!1)},body:String.fromCharCode(...m)})};u=await fetch(`https://${i.i}/video-translation/translate`,l),c=await u.arrayBuffer()}catch(e){s.Z.log(e),u={status:-1},c=e}d(200==u.status,c)}},"./src/utils/debug.js":(e,t,n)=>{n.d(t,{Z:()=>o}),n("./src/config/constants.js");const o={log:(...e)=>{},translations:e=>{}}},"./src/yandexRequests.js":(e,t,n)=>{n.d(t,{G:()=>r});const o=new protobuf.Type("VideoTranslationRequest").add(new protobuf.Field("url",3,"string")).add(new protobuf.Field("deviceId",4,"string")).add(new protobuf.Field("firstRequest",5,"bool")).add(new protobuf.Field("unknown1",6,"fixed64")).add(new protobuf.Field("unknown2",7,"int32")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("unknown3",9,"int32")).add(new protobuf.Field("unknown4",10,"int32")).add(new protobuf.Field("translationHelp",11,"int32")).add(new protobuf.Field("responseLanguage",14,"string")),a=new protobuf.Type("VideoTranslationResponse").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("duration",2,"double")).add(new protobuf.Field("status",4,"int32")).add(new protobuf.Field("remainingTime",5,"int32")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("message",9,"string")),i=(new protobuf.Root).define("yandex").add(o).add(a),r={encodeRequest:(e,t,n,o,a)=>i.VideoTranslationRequest.encode({url:e,deviceId:t,firstRequest:!0,unknown1:n,unknown2:1,language:o,unknown3:0,unknown4:0,responseLanguage:a}).finish(),decodeResponse:e=>i.VideoTranslationResponse.decode(new Uint8Array(e))}}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,(()=>{var e=n("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),t=n.n(e),o=n("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),a=n.n(o),i=n("./node_modules/style-loader/dist/runtime/insertBySelector.js"),r=n.n(i),s=n("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),l=n.n(s),d=n("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),u=n.n(d),c=n("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),p=n.n(c),m=n("./node_modules/css-loader/dist/cjs.js!./src/styles/main.css"),g={};async function h(e,t,n,o,a){if(!window.location.hostname.includes("m.youtube.com")){const t=e.getAudioTrack(),n=t?.getLanguageInfo();if("und"!==n?.id)return n.id.split(".")[0]}const i=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(i?.length){const e=i.find((e=>"asr"===e.kind));if(e)return e.languageCode}const r=[n,o,a].join(" ").replace(/https?:\/\/\S+/g,"").replace(/[^\p{L}\s]/gu,"").trim().slice(0,250);return await async function(e){const t=await fetch("https://rust-server-531j.onrender.com/detect",{method:"POST",body:e});return await t.text()}(r)}g.styleTagTransform=p(),g.setAttributes=l(),g.insert=r().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=u(),t()(m.Z,g),m.Z&&m.Z.locals&&m.Z.locals;var T=n("./src/yandexRequests.js"),v=n("./src/config/constants.js"),y=n("./src/utils/debug.js");let b=(navigator.language||navigator.userLanguage).substr(0,2).toLowerCase();function f(e){document.querySelector(".translationBtn").style.color=e}function V(e="none"){document.querySelector(".translationBtn").dataset.state=e}function w(e="none"){let t;switch(e){case"error":t="#7A7A7D";break;case"success":t="#A36EFF";break;default:t="#FFFFFF"}document.querySelector(".translateIcon").style.fill=t}function O(e="none",t){switch(e){case"error":w(e),f("#7A7A7D"),V(e);break;case"success":w(e),f("#A36EFF"),V(e);break;default:w("none"),f("#FFFFFF"),V("none")}document.querySelector(".translationBtn").innerText=t}function S(e,t,n){const o=document.createElement("div"),a=document.createElement("input"),i=document.createElement("label");return a.type="checkbox",a.id=e,a.checked=Boolean(t),i.htmlFor=e,i.innerHTML=n,o.classList.add("translationMenuContainer"),o.appendChild(a),o.appendChild(i),o}function x(e,t,n){const o=document.createElement("div"),a=document.createElement("input"),i=document.createElement("label");return a.type="range",a.id=e,a.classList.add("VOTMenuSlider"),a.min=0,a.max=100,a.value=t,i.htmlFor=e,i.classList.add("translationHeader"),i.innerHTML=n,o.classList.add("translationMenuContainer"),o.appendChild(i),o.appendChild(a),o}function k(e,t){const n=document.createElement("div"),o=document.createElement("select");o.id=e,o.classList.add("VOTMenuSelect");for(const e of t){const t=document.createElement("option");t.innerText=e.label,t.value=e.value,Object.prototype.hasOwnProperty.call(e,"selected")&&e.selected&&t.setAttribute("selected","selected"),Object.prototype.hasOwnProperty.call(e,"disabled")&&(t.disabled=e.disabled),o.appendChild(t)}return n.classList.add("translationMenuContainer"),n.appendChild(o),n}function L(e){return new Promise((t=>{const n=document.querySelector(e);if(n)return t(n);const o=new MutationObserver((()=>{const n=document.querySelector(e);n&&(t(n),o.disconnect())}));o.observe(document.body,{childList:!0,subtree:!0,once:!0})}))}b in v.Iz||(b="en"),String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,(function(t,n){return void 0!==e[n]?e[n]:t}))});const F=e=>new Promise((t=>setTimeout(t,e))),I=e=>{const t=new URL(window.location.href);switch(e){case"youtube":return t.pathname.match(/(?:watch|embed)\/([^/]+)/)?.[1]||t.searchParams.get("v");case"vk":return t.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)?t.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)[0].slice(1):t.searchParams.get("z")?t.searchParams.get("z").split("/")[0]:!(!t.searchParams.get("oid")||!t.searchParams.get("id"))&&`video-${Math.abs(t.searchParams.get("oid"))}_${t.searchParams.get("id")}`;case"9gag":case"gag":return t.pathname.match(/gag\/([^/]+)/)?.[1];case"twitch":if(/^m\.twitch\.tv$/.test(window.location.hostname)){const e=document.head.querySelector('link[rel="canonical"]');return e?.href.match(/videos\/([^/]+)/)?.[0]||t.pathname.slice(1)}if(/^player\.twitch\.tv$/.test(window.location.hostname))return`videos/${t.searchParams.get("video")}`;if(/^clips\.twitch\.tv$/.test(window.location.hostname)){const e=document.querySelector(".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']");return!!e&&`${e.href.replace("https://www.twitch.tv/","")}/clip/${t.searchParams.get("clip")}`}return t.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)?t.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)[0]:t.pathname.match(/(?:videos)\/([^/]+)/)?.[0];case"tiktok":return t.pathname.match(/video\/([^/]+)/)?.[1];case"vimeo":return t.pathname.match(/[^/]+\/[^/]+$/)?.[0]||t.pathname.match(/[^/]+$/)?.[0];case"xvideos":return t.pathname.match(/[^/]+\/[^/]+$/)?.[0];case"pornhub":return t.searchParams.get("viewkey")||t.pathname.match(/embed\/([^/]+)/)?.[1];case"twitter":return t.pathname.match(/status\/([^/]+)/)?.[1];case"udemy":case"facebook":return t.pathname;case"rutube":return t.pathname.match(/(?:video|embed)\/([^/]+)/)?.[1];case"coub":return t.pathname.match(/view\/([^/]+)/)?.[1];case"bilibili.com":const e=t.searchParams.get("bvid");if(e)return e;{let e=t.pathname.match(/video\/([^/]+)/)?.[1];return e&&t.search&&null!==t.searchParams.get("p")&&(e+=`/?p=${t.searchParams.get("p")}`),e}case"mail.ru":if(t.pathname.startsWith("/v/")||t.pathname.startsWith("/mail/"))return t.pathname;if(t.pathname.match(/video\/embed\/([^/]+)/)){const e=document.querySelector(".b-video-controls__mymail-link");return!!e&&e?.href.split("my.mail.ru")?.[1]}default:return!1}};var D=n("./src/config/config.js");const M=["invidious.snopyta.org","yewtu.be","invidious.kavin.rocks","vid.puffyan.us","invidious.namazso.eu","inv.riverside.rocks","yt.artemislena.eu","invidious.flokinet.to","invidious.esmailelbob.xyz","y.com.sb","invidious.nerdvpn.de","inv.vern.cc","invidious.slipfox.xyz","invidio.xamh.de","invidious.dhusch.de"],A=["piped.video","piped.tokhmi.xyz","piped.moomoo.me","piped.syncpundit.io","piped.mha.fi","watch.whatever.social","piped.garudalinux.org","efy.piped.pages.dev","watch.leptons.xyz","piped.lunar.icu","yt.dc09.ru","piped.mint.lgbt","il.ax","piped.privacy.com.de","piped.esmailelbob.xyz","piped.projectsegfau.lt","piped.in.projectsegfau.lt","piped.us.projectsegfau.lt","piped.privacydev.net","piped.palveluntarjoaja.eu","piped.smnz.de","piped.adminforge.de","piped.qdi.fi","piped.hostux.net","piped.chauvet.pro","piped.jotoma.de","piped.pfcd.me","piped.frontendfriendly.xyz"],z=2,q={key:"settings",autoTranslate:0,defaultVolume:100,showVideoSlider:0,syncVolume:0,autoSetVolumeYandexStyle:1,dontTranslateYourLang:1},E={audioProxy:0};function P(e){return indexedDB.open(e,z)}async function B(){return new Promise(((e,t)=>{const n=P("VOT");n.onerror=()=>{console.error(`${v.Iz[b].VOTFailedInitDB}: ${n.error.message}`),t(!1)},n.onupgradeneeded=o=>{const a=n.result;if(a.onerror=()=>{const e=v.Iz[b].VOTFailedInitDB;alert(e),console.error(e,n.error),t(!1)},o.oldVersion<1){const n=a.createObjectStore("settings",{keyPath:"key"});for(const e of Object.keys(q).filter((e=>"key"!==e)))n.createIndex(e,e,{unique:!1});console.log("VOT: Database Created"),n.transaction.oncomplete=n=>{const o=a.transaction("settings","readwrite").objectStore("settings").add(q);o.onsuccess=()=>{console.log("VOT: Standard settings added to the Database: ",o.result),e(!0)},o.onerror=()=>{console.log("VOT: Error when adding standard settings to the Database: ",o.error),t(!1)}}}o.oldVersion<2&&function(n,o,a,i={}){const r=n.objectStore("settings");for(const e of Object.keys(a))r.createIndex(e,e,{unique:!1});console.log("VOT: The database has been updated"),r.transaction.oncomplete=n=>{const r=o.transaction("settings","readwrite").objectStore("settings"),s=r.get("settings");s.onerror=e=>{console.error("VOT: Data could not be retrieved from the Database: ",e.error),t(!1)},s.onsuccess=()=>{const n=s.result||Object.assign(q,i);for(const e in a)n[e]=a[e];const o=r.put(n);o.onerror=e=>{console.error("VOT: Failed to update the Database to new version",e.error),t(!1)},o.onsuccess=()=>{console.log("VOT: Standard settings of the new version have been added to the Database."),e(!0)}}}}(n.transaction,a,E)},n.onsuccess=()=>{const o=n.result;o.onversionchange=()=>{o.close();const e=v.Iz[b].VOTDBNeedUpdate;alert(e),console.log(e),window.location.reload(),t(!1)},e(!0)},n.onblocked=()=>{const e=n.result,o=v.Iz[b].VOTDisabledForDBUpdating;console.error(o,e),alert(o),t(!1)}}))}async function C({autoTranslate:e,defaultVolume:t,showVideoSlider:n,syncVolume:o,autoSetVolumeYandexStyle:a,dontTranslateYourLang:i,audioProxy:r}){return new Promise(((s,l)=>{if("number"==typeof e||"number"==typeof t||"number"==typeof n||"number"==typeof o||"number"==typeof a||"number"==typeof i||"number"==typeof r){const d=P("VOT");d.onerror=()=>{const e=v.Iz[b].VOTFailedWriteToDB;alert(e),console.error(e,d.error.message),l(!1)},d.onupgradeneeded=async()=>{d.result.close(),await B(),s(!0)},d.onsuccess=()=>{const u=d.result;u.onversionchange=()=>{u.close(),console.log("VOT: The database needs an update, please reload the page if it didn't happen automatically"),window.location.reload(),l(!1)};const c=u.transaction("settings","readwrite").objectStore("settings"),p=c.get("settings");p.onerror=e=>{console.error("VOT: Data could not be retrieved from the Database: ",e.error),l(!1)},p.onsuccess=()=>{const d=p.result;"number"==typeof e&&(d.autoTranslate=e),"number"==typeof t&&(d.defaultVolume=t),"number"==typeof n&&(d.showVideoSlider=n),"number"==typeof o&&(d.syncVolume=o),"number"==typeof a&&(d.autoSetVolumeYandexStyle=a),"number"==typeof i&&(d.dontTranslateYourLang=i),"number"==typeof r&&(d.audioProxy=r);const u=c.put(d);u.onerror=e=>{console.error("VOT: Не удалось обновить данные в Базе Данных: ",e.error),l(!1)},u.onsuccess=()=>{s(!0)}}},d.onblocked=()=>{const e=d.result,t=v.Iz[b].VOTDisabledForDBUpdating;console.error(t,e),alert(t),l(!1)}}}))}function N(){indexedDB.deleteDatabase("VOT")}function j(e,t,n,o){let a;return t>o?(a=n+(t-o),a=a>100?100:Math.max(a,0),e.volume=a/100):t100?100:Math.max(a,0),e.volume=a/100),a}var R=n("./src/config/config-cloudflare.js");const Z={youtubeRegex:/^(www.|m.)?youtube(-nocookie)?.com$/},$=".html5-video-container",_=".video-ref",H="main > div > section > div > div > div",U=".shaka-video-container",Y=".videoplayer_media",W='div[data-testid="videoComponent"] > div:nth-child(1) > div',G=".player",K=".video-post",J=".bpx-player-video-wrap",X="#b-video-wrapper",Q=[...M,...A];let ee="";(async function(){y.Z.log("Loading extension..."),y.Z.log(`Selected menu language: ${b}`);const e=(await Promise.resolve().then(n.bind(n,"./src/rvt-cloudflare.js"))).default;let t;y.Z.log("Inited requestVideoTranslation..."),y.Z.log("Extension compatibility passed...");const o=new Audio;let a=.9,i=!1;var r=!1;function s(e){i||(document.querySelector(".translationBlock").style.opacity=e)}function l(){clearTimeout(t),s(1),t=setTimeout((()=>{s(0)}),2e3)}function d(e,t,n){clearTimeout(t),s(n),e.stopPropagation()}async function u(n,u,c){let p,m,g,f,V,w,L,F,M,A,z,q;y.Z.log("[translateProccessor] execute on element: ",n);let E,Z=!0,$="";y.Z.log("videoContainer",n),p="vimeo"===u?n.querySelector(".vp-video-wrapper > .vp-video > .vp-telecine > video"):n.querySelector("video"),y.Z.log("video",p);const _="pornhub"===u&&window.location.pathname.includes("view_video.php")?document.querySelector(".original.mainPlayerDiv"):"pornhub"===u&&window.location.pathname.includes("embed/")?document.querySelector("body"):window.location.hostname.includes("m.youtube.com")?document.querySelector("#player-control-container"):n;!function(e){if(!e||e.querySelector(".translationBlock"))return;const t=document.createElement("div");t.classList.add("translationBlock"),t.innerHTML=`\n \n \n \n \n \n \n ${v.Iz[b].translateVideo}\n \n \n \n \n \n \n `,e.appendChild(t),y.Z.log("VOT: Added translation button to ",e)}(_),function(e){if(e.querySelector(".translationMenuContent"))return;const t=function(){const e=document.createElement("div");return e.classList.add("translationMenuContent"),e.innerHTML=`\n

${v.Iz[b].translationSettings}

\n
\n
\n \n \n \n \n \n \n
\n `,e.onclick=e=>e.stopPropagation(),e}();e.appendChild(t),document.querySelector(".translationMenu")?.addEventListener("click",(e=>{e.stopPropagation();const t=document.querySelector(".translationMenuContent");t.style.display=i?"none":"block",t.style.opacity=a,i=!i})),document.querySelector(".translationDropDB").addEventListener("click",(e=>{e.stopPropagation(),N(),location.reload()})),y.Z.log("VOT: Added translation menu to ",e)}(_);try{E=await B()}catch(e){console.error("[VOT] Failed to initialize database settings. All changes made will not be saved",e)}const H=document.querySelector(".translationMenuOptions");if(H&&!H.querySelector("#VOTTranslateFromLang")){const e=[{label:v.Iz[b].videoLanguage,value:"default",disabled:!0},...Object.entries(v.tW).map((([e,t])=>({label:v.Iz[b][t],value:e,selected:$.detectedLanguage===e})))],t=[{label:v.Iz[b].translationLanguage,value:"default",disabled:!0},...Object.entries(v.tW).map((([e,t])=>({label:v.Iz[b][t],value:e,selected:$.responseLanguage===e})))],n=k("VOTTranslateFromLang",e),o=k("VOTTranslateToLang",t).firstElementChild;n.id="VOTSelectLanguages",n.innerHTML+='\n \n \n \n ',n.appendChild(o),H.appendChild(n),H.querySelector("#VOTTranslateFromLang").addEventListener("change",(async e=>{y.Z.log("[onchange] select from language",e.target.value),await Y($,e.target.value)})),H.querySelector("#VOTTranslateToLang").addEventListener("change",(async e=>{y.Z.log("[onchange] select to language",e.target.value),await W($,e.target.value)}))}if(E){const e=await async function(){return new Promise(((e,t)=>{const n=P("VOT");n.onerror=()=>{const e=v.Iz[b].VOTFailedReadFromDB;alert(e),console.error(e,n.error.message),t(!1)},n.onupgradeneeded=async()=>{n.result.close(),await B(),e(!0)},n.onsuccess=()=>{const o=n.result;o.onversionchange=()=>{o.close();const e=v.Iz[b].VOTDBNeedUpdate;alert(e),console.error(e),t(!1)};const a=o.transaction("settings").objectStore("settings").get("settings");a.onerror=e=>{console.error(v.Iz[b].VOTFailedReadFromDB,e.error),console.error(e),t(!1)},a.onsuccess=()=>{void 0===a.result&&(o.close(),N(),t(!1));const n=a.result;e(n)}},n.onblocked=()=>{const e=n.result,o=v.Iz[b].VOTDisabledForDBUpdating;console.error(o,e),alert(o),t(!1)}}))}();if(e){if(w=e.autoTranslate,L=e.defaultVolume,F=e.showVideoSlider,M=e.autoSetVolumeYandexStyle,A=e.dontTranslateYourLang,q=e.audioProxy,z=e.syncVolume,y.Z.log("[db] data from db: ",e),void 0!==w&&H&&!H.querySelector("#VOTAutoTranslate")){const e=S("VOTAutoTranslate",w,v.Iz[b].VOTAutoTranslate+("vk"===u||window.location.hostname.includes("m.twitch.tv")?` (${v.Iz[b].recommended})`:""));e.querySelector("#VOTAutoTranslate").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({autoTranslate:t}),w=t,y.Z.log("autoTranslate value changed. New value: ",w)},H.appendChild(e)}if(window.location.hostname.includes("youtube.com")&&void 0!==A&&H&&!H.querySelector("#VOTDontTranslateYourLang")){const e=S("VOTDontTranslateYourLang",A,v.Iz[b].VOTDontTranslateYourLang);e.querySelector("#VOTDontTranslateYourLang").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({dontTranslateYourLang:t}),A=t,y.Z.log("dontTranslateYourLang value changed. New value: ",A)},H.appendChild(e)}if(void 0!==M&&H&&!H.querySelector("#VOTAutoSetVolume")){const e=S("VOTAutoSetVolume",M,v.Iz[b].VOTAutoSetVolume+(100*D.IM+"%"));e.querySelector("#VOTAutoSetVolume").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({autoSetVolumeYandexStyle:t}),M=t,y.Z.log("autoSetVolumeYandexStyle value changed. New value: ",M)},H.appendChild(e)}if(void 0!==F&&H&&!H.querySelector("#VOTShowVideoSlider")){const e=S("VOTShowVideoSlider",F,v.Iz[b].VOTShowVideoSlider);e.querySelector("#VOTShowVideoSlider").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({showVideoSlider:t}),F=t,y.Z.log("showVideoSlider value changed. New value: ",F),1===F&&"success"===document.querySelector(".translationBtn").dataset.state?X():document.querySelector("#VOTVideoSlider")?.parentElement.remove()},H.appendChild(e)}if(window.location.hostname.includes("youtube.com")&&!window.location.hostname.includes("m.youtube.com")&&void 0!==z&&H&&!H.querySelector("#VOTSyncVolume")){const e=S("VOTSyncVolume",z,v.Iz[b].VOTSyncVolume);e.querySelector("#VOTSyncVolume").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({syncVolume:t}),z=t,y.Z.log("syncVolume value changed. New value: ",z)},H.appendChild(e)}if(void 0!==q&&H&&!H.querySelector("#VOTAudioProxy")){const e=S("VOTAudioProxy",q,v.Iz[b].VOTAudioProxy);e.querySelector("#VOTAudioProxy").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({audioProxy:t}),q=t,y.Z.log("audioProxy value changed. New value: ",q)},H.appendChild(e)}}}async function U(e,t,n){document.querySelector("#VOTSelectLanguages")&&(console.log(`Set translation from ${t} to ${n}`),document.querySelector("#VOTTranslateFromLang").value=t,document.querySelector("#VOTTranslateToLang").value=n,e.responseLanguage=n)}async function Y(e,t){return e.detectedLanguage=t,e.responseLanguage=b,Object.keys(v.tW).includes(t)?(await U(e,e.detectedLanguage,e.responseLanguage),e):Y(e,"en")}async function W(e,t){if("en"===t)e.responseLanguage=t,"ru"==b&&(e.detectedLanguage="ru");else{if(!Object.keys(v.tW).includes(t))return W(e,"ru");e.detectedLanguage&&e.responseLanguage===b&&(e.detectedLanguage="en"),e.responseLanguage=t||b}return await U(e,e.detectedLanguage,e.responseLanguage),e}async function G(){o.pause(),p.removeEventListener(".translate",G,!1),await(async()=>{o.src="",o.removeAttribute("src")})(),document.querySelector("#VOTVideoSlider")?.parentElement.remove(),document.querySelector("#VOTTranslationSlider")?.parentElement.remove();const e=document.querySelector(".translationDownload");e.href="",e.style.display="none",O("none",v.Iz[b].translateVideo),g&&(p.volume=g)}async function K(){const e=document.querySelector(".ytp-volume-panel").getAttribute("aria-valuenow"),t=document.querySelector("#VOTVideoSlider");if(!t)return;t.value=e;const n=document.querySelector("#VOTVideoVolume");n&&(n.innerText=`${e}%`),1===z&&(f=Number(e))}O("none",v.Iz[b].translateVideo),window.location.hostname.includes("youtube.com")&&!window.location.hostname.includes("m.youtube.com")&&new MutationObserver((async function(e){e.forEach((async function(e){"attributes"===e.type&&"aria-valuenow"===e.attributeName&&document.querySelector("#VOTVideoSlider")&&K()}))})).observe(document.querySelector(".ytp-volume-panel"),{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0});const J=async(e=!1)=>{if(y.Z.log("lipsync video",p),p)if(o.currentTime=p.currentTime,o.playbackRate=p.playbackRate,e)if("play"!==e)"pause"===e&&(y.Z.log("lipsync mode is pause"),o.pause()),"stop"===e&&(y.Z.log("lipsync mode is stop"),o.pause()),"waiting"===e&&(y.Z.log("lipsync mode is waiting"),o.pause()),"playing"===e&&(y.Z.log("lipsync mode is playing"),o.play());else{y.Z.log("lipsync mode is play");const e=o.play();void 0!==e&&e.catch((e=>{if(console.error(e),"NotAllowedError"===e.name){const e=v.Iz[b].grantPermissionToAutoPlay;throw O("error",e),`VOT: ${e}`}if("NotSupportedError"===e.name){const e=Q.includes(window.location.hostname)?v.Iz[b].neededAdditionalExtension:v.Iz[b].audioFormatNotSupported;throw O("error",e),`VOT: ${e}`}}))}else y.Z.log("lipsync mode is not set")};async function X(){if(1!==F||document.querySelector("#VOTVideoSlider")||"success"!==document.querySelector(".translationBtn").dataset.state)return;const e=window.location.hostname.includes("youtube.com")&&!M?document.querySelector(".ytp-volume-panel")?.getAttribute("aria-valuenow"):Math.round(100*p.volume);f=e;const t=x("VOTVideoSlider",e,`${v.Iz[b].VOTVolume}: ${e}%`);t.querySelector("#VOTVideoSlider").oninput=async e=>{const{value:n}=e.target;if(p.volume=n/100,t.querySelector("#VOTOriginalVolume").innerText=`${n}%`,1!==z)return;const a=document.querySelector("#VOTTranslationSlider");if(!a)return;const i=Number(a.value),r=j(o,n,i,f);a.value=r;const s=document.querySelector("#VOTTranslationVolume");s&&(s.innerText=`${r}%`),V=r,f=n},document.querySelector(".translationMenuOptions").appendChild(t)}const te=async e=>{$.detectedLanguage||($=await async function(){const e={};return e.duration=p?.duration||0,e.videoId=I(u),e.detectedLanguage="en",e.responseLanguage="ru",window.location.hostname.includes("youtube.com")?(ee=await async function(){const e=document.querySelector("#movie_player"),t=e.getVideoData(),n=e.getPlayerResponse(),{isLive:o,isPremiere:a,title:i,author:r}=t,{shortDescription:s}=n?.videoDetails??{},l={isLive:o,isPremiere:a,title:i,description:s,author:r,detectedLanguage:await h(e,n,i,s,r)};return console.log("VOT Detected language: ",l.detectedLanguage),l}(),""!==ee.author&&(ee=await Y(ee,ee.detectedLanguage),e.detectedLanguage=ee.detectedLanguage)):window.location.hostname.includes("rutube")||window.location.hostname.includes("my.mail.ru")?(e.detectedLanguage="ru",e.responseLanguage="en"):window.location.hostname.includes("bilibili.com")&&(e.detectedLanguage="zh"),e}()),y.Z.log("Run videoValidator"),await async function(){if(window.location.hostname.includes("youtube.com")){if(y.Z.log("VideoValidator videoData: ",$),1===A&&$.detectedLanguage===b&&$.responseLanguage===b)throw v.Iz[b].VOTDisableFromYourLang;if(ee.isLive)throw v.Iz[b].VOTLiveNotSupported;if(ee.isPremiere)throw v.Iz[b].VOTPremiere;if($.duration>14400)throw v.Iz[b].VOTVideoIsTooLong}return!0}(),y.Z.log("Run translateFunc"),await ae(e,$.detectedLanguage,$.responseLanguage)};async function ne(e){y.Z.log(`video ${e.type}`),await J(e.type)}async function oe(){await G(),await K()}async function ae(t,a,i){console.log("VOT Video Data: ",$);const s=`${v.g$[u]}${t}`;await async function(t,n,o,a,i){y.Z.log(`Translate video (url: ${t}, unknown1: ${n}, requestLang: ${o}, responseLang: ${a})`),r?y.Z.log("translationPanding return"):(r=!0,await e(t,n,o,a,((e,t)=>{if(r=!1,y.Z.log("[exec callback] Requesting video translation"),!e)return void i(!1,v.Iz[b].requestTranslationFailed);const n=T.G.decodeResponse(t);switch(console.log("VOT Response: ",n),n.status){case 0:i(!1,n.message);break;case 1:i(!!n.url,n.url||v.Iz[b].audioNotReceived);break;case 2:i(!1,n.remainingTime?function(e){const t=Math.floor(e/60),n=Math.floor(e%60);return t>=60?v.Iz[b].translationTakeMoreThanHour:t>=10&&t%10?v.Iz[b].translationTakeApproximatelyMinutes.format(t):1==t||0==t&&n>0?v.Iz[b].translationTakeAboutMinute:v.Iz[b].translationTakeApproximatelyMinute.format(t)}(n.remainingTime):v.Iz[b].translationTakeFewMinutes);break;case 3:i(!1,v.Iz[b].videoBeingTranslated)}})))}(s,v.ey,a,i,(async(e,r)=>{if(y.Z.log("[exec callback] translateVideo"),I(u)!==t)return;if(!e)throw O("error",r),r.includes(v.Iz[b].translationTake)&&(clearTimeout(m),m=setTimeout((()=>ae(t,a,i)),6e4)),r;if(o.src=r,1===q&&r.startsWith("https://")){const e=r.replace("https://vtrans.s3-private.mds.yandex.net/tts/prod/",""),t=`https://${R.i}/video-translation/audio-proxy/${e}`;console.log(`VOT Audio proxied via ${t}`),o.src=t}switch(g=p?.volume,"number"==typeof L&&(o.volume=L/100),"number"==typeof M&&M&&(p.volume=D.IM),u){case"twitter":document.querySelector('div[data-testid="app-bar-back"][role="button"]').addEventListener("click",oe);break;case"invidious":case"piped":break;default:null!==c&&document.body.addEventListener(c,oe)}const s=["twitch","vimeo","facebook","rutube","twitter","bilibili.com","mail.ru"];for(let e=0;e{e.forEach((async e=>{"attributes"===e.type&&"src"===e.attributeName&&e.target===p&&""!==e.target.src&&(oe(),Z=!0)}))})).observe(n,{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0});break}p&&!p.paused&&J("play");const l=document.querySelectorAll("video"),d=["playing","ratechange","play","waiting","pause"];l.forEach((e=>d.forEach((t=>e.addEventListener(t,ne))))),O("success",v.Iz[b].disableTranslate),await X(),await async function(){if(document.querySelector("#VOTTranslationSlider")||"success"!==document.querySelector(".translationBtn").dataset.state)return;const e="number"==typeof L?L:100;f=e;const t=x("VOTTranslationSlider",e,`${v.Iz[b].VOTVolumeTranslation}: ${e}%`);t.querySelector("#VOTTranslationSlider").oninput=async({target:{value:e}})=>{o.volume=e/100,document.querySelector("#VOTTranslationVolume").innerText=`${e}%`,await C({defaultVolume:Number(e)}),L=Number(e),1===z&&await async function(e){const t=document.querySelector("#VOTVideoSlider");if(!t)return;const n=Number(t.value),o=j(p,e,n,V);t.value=o;const a=document.querySelector("#VOTOriginalVolume");a&&(a.innerText=`${o}%`),f=o,V=e}(e)},document.querySelector(".translationMenuOptions").appendChild(t)}();const h=document.querySelector("#VOTVideoSlider");h&&(h.value=100*D.IM);const T=document.querySelector("#VOTOriginalVolume");T&&(T.innerText=100*D.IM+"%");const w=document.querySelector(".translationDownload");w.href=r,w.style.display="initial"}))}document.addEventListener("click",(async e=>{const t=document.querySelector(".translationBlock"),o=document.querySelector(".translationMenuContent"),a=!(!t&&e.target!==t)&&t.contains(e.target),r=!(!o&&e.target!==o)&&o.contains(e.target),l=!(!n&&e.target!==n)&&n.contains(e.target);y.Z.log(`[document click] ${a} ${r} ${l}`),a||r||(l||s(0),o.style.display="none",i=!1)}));const ie=(e,t,n)=>{t.forEach((t=>e.addEventListener(t,(async e=>{await n(e)}))))};"pornhub"===u?window.location.pathname.includes("view_video.php")?ie(document.querySelector(".original.mainPlayerDiv > video-element > div"),["mousemove","mouseout"],l):window.location.pathname.includes("embed/")&&ie(document.querySelector("#player"),["mousemove","mouseout"],l):ie("twitter"===u?document.querySelector('div[data-testid="videoPlayer"'):n,["mousemove","mouseout"],l),document.querySelector(".translationBlock").addEventListener("mousemove",(e=>d(e,t,a))),document.querySelector(".translationMenuContent").addEventListener("mousemove",(e=>d(e,t,a))),document.addEventListener("touchstart",(e=>d(e,t,a))),document.addEventListener("touchmove",(e=>d(e,t,a))),document.addEventListener("touchend",(e=>d(e,t,a))),document.querySelectorAll("video").forEach((e=>{e.addEventListener("abort",(async()=>{y.Z.log("lipsync mode is abort"),$.detectedLanguage="",await oe()}))})),document.querySelector(".translationBtn").addEventListener("click",(async e=>{if(y.Z.log("[click translationBtn] before all functions & methods"),e.stopPropagation(),e.stopImmediatePropagation(),o.src)return y.Z.log("[click translationBtn] audio.src is not empty"),$.detectedLanguage="",void await G();try{y.Z.log("[click translationBtn] trying execute translation");const e=I(u);if(!e)throw v.Iz[b].VOTNoVideoIDFound;await te(e)}catch(e){O("error",String(e).substring(4,e.length)),console.error(e)}})),p.addEventListener("progress",(async e=>{if(e.stopPropagation(),!Z||1!==w)return;const t=I(u);if(!t)throw v.Iz[b].VOTNoVideoIDFound;try{await te(t),Z=!1}catch(e){O("error",String(e).substring(4,e.length)),Z=!1}}))}await async function(){if(y.Z.log("Runned initWebsite function"),Z.youtubeRegex.test(window.location.hostname)){if(window.location.pathname.includes("embed")){const e=document.querySelector(".html5-video-container");return void await u(e,"youtube",null)}y.Z.log("[initWebsite] Found a match with youtube hostname");const e=()=>{const e=document.querySelector($);if(e)y.Z.log("[exec] translateProccessor youtube on page enter"),u(e,"youtube","yt-translate-stop");else{if(!ytplayer||!ytplayer.config)return void y.Z.log("[exec] ytplayer is null");ytplayer.config.args.jsapicallback=()=>{y.Z.log("[exec] translateProccessor youtube on page enter (ytplayer.config.args.jsapicallback)"),u(e,"youtube","yt-translate-stop")}}};document.addEventListener("spfdone",e),document.addEventListener("yt-navigate-finish",e);const t=async()=>{document.body.dispatchEvent(new Event("yt-translate-stop"))};if(document.addEventListener("spfrequest",t),document.addEventListener("yt-navigate-start",t),window.location.hostname.includes("m.youtube.com")){let e=await L("#player");e&&(await F(1e3),await u(e,"youtube","yt-translate-stop"),new MutationObserver((async t=>{for(const n of t)"attributes"===n.type&&"src"===n.attributeName&&(e=await L("#player"),await F(1e3),await u(e,"youtube","yt-translate-stop"))})).observe(e,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0}));const t=async()=>{document.body.dispatchEvent(new Event("yt-translate-stop"))};document.addEventListener("spfdone",t),document.addEventListener("yt-navigate-finish",t),document.addEventListener("spfrequest",t),document.addEventListener("yt-navigate-start",t)}}else if(window.location.hostname.includes("twitch.tv")){if(y.Z.log("[initWebsite] Found a match with twitch.tv"),window.location.hostname.includes("m.twitch.tv")&&(window.location.pathname.includes("/videos/")||window.location.pathname.includes("/clip/"))){if(y.Z.log("[initWebsite] Matched Twitch Mobile"),await L(H)){await F(200);const e=document.querySelector(H);await u(e,"twitch",null),new MutationObserver((async t=>{for(const n of t)"attributes"===n.type&&"src"===n.attributeName&&n.target===e?.querySelector("video")&&(await F(1e3),await u(e,"twitch",null))})).observe(e,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})}}else if(window.location.hostname.includes("player.twitch.tv")||window.location.hostname.includes("clips.twitch.tv")||window.location.pathname.includes("/videos/")||window.location.pathname.includes("/clip/")){y.Z.log("[initWebsite] Matched Twitch Desktop");const e=await L(_);e&&(await F(200),await u(e,"twitch",null))}y.Z.log("[initWebsite] Exit function in the twitch section")}else{if(window.location.hostname.includes("xvideos.com"))return y.Z.log("[entered] xvideos"),await F(1e3),void await u(document.querySelector(".video-bg-pic"),"xvideos",null);if(window.location.hostname.includes("pornhub.com"))return y.Z.log("[entered] pornhub"),await F(1e3),void await u(document.querySelector(".mgp_videoWrapper"),"pornhub",null);if(M.includes(window.location.hostname))y.Z.log("[entered] invidious"),await u(document.querySelector("#player"),"youtube",null);else if(A.includes(window.location.hostname)){y.Z.log("[entered] piped");const e=await L(U);if(e){let t,n=I("youtube");await u(e,"youtube","piped"),setInterval((async()=>{t=I("youtube"),n!==t&&(t&&await u(document.querySelector(U),"youtube","piped"),n=t)}),3e3)}}else if(/^(www.|m.)?vk.(com|ru)$/.test(window.location.hostname)){if(y.Z.log("[entered] vk.com"),await L(Y)){let e;await u(document.querySelector(Y),"vk",null);let t=I("vk");setInterval((async()=>{if(e=I("vk"),t!==e){if(e){const e=await L(Y);e&&await u(e,"vk",null)}t=e}}),3e3)}}else if(window.location.hostname.includes("vimeo.com"))y.Z.log("[entered] vimeo.com"),await L(G)&&(await F(1e3),await u(document.querySelector(G),"vimeo",null));else if(window.location.hostname.includes("9gag.com"))await F(1e3),await u(document.querySelector(K),"9gag",null);else if(window.location.hostname.includes("coub.com"))await F(1e3),await u(document.querySelector(".viewer__player"),"coub",null);else if(window.location.hostname.includes("rutube.ru")){const e=window.location.pathname.includes("/play/embed")?"#app > div > div":".video-player > div > div > div:nth-child(2)",t=await L(e);t&&await u(t,"rutube",null)}else if(window.location.hostname.includes("bilibili.com")){if(window.location.pathname.includes("/video/")){const e=await L(J);e&&await u(e,"bilibili.com",null)}else if(window.location.pathname.includes("/blackboard/webplayer/embed-old.html")){const e=await L("video");e&&await u(e.parentElement,"bilibili.com",null)}}else if(window.location.hostname.includes("twitter.com")){const e=await L(W);if(e){let t,n=I("twitter");await u(e,"twitter",null),setInterval((async()=>{t=I("twitter"),n!==t&&(t&&await u(document.querySelector(W),"twitter",null),n=t)}),3e3)}}else if(window.location.hostname.includes("my.mail.ru")){const e=await L(X);if(e){let t,n=I("mail.ru");await u(e,"mail.ru",null),setInterval((async()=>{t=I("mail.ru"),n!==t&&(t&&await u(document.querySelector(X),"mail.ru",null),n=t)}),3e3)}}}}()})().catch((e=>{console.error(e)}))})()})(); \ No newline at end of file +(()=>{"use strict";var e={"./node_modules/css-loader/dist/cjs.js!./src/styles/main.css":(e,t,n)=>{n.d(t,{Z:()=>s});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),a=n.n(o),i=n("./node_modules/css-loader/dist/runtime/api.js"),r=n.n(i)()(a());r.push([e.id,'.translationBlock {\n padding: 0.45rem !important;\n width: max-content;\n position: absolute;\n background: #2e2f34;\n border-radius: 0.5rem !important;\n left: 50%;\n top: 5rem;\n transform: translate(-50%);\n text-align: center;\n opacity: 0;\n transition: opacity 1s;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n z-index: 100;\n}\n\n.translationBtn {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n color: #fff;\n padding-right: 0.25rem !important;\n cursor: pointer;\n font: 600 12px / 14px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif;\n}\n\n.translationBlock:hover {\n opacity: 1;\n}\n\n.translationMenu {\n display: inline-block;\n vertical-align: middle;\n border-left: 1px solid #424348;\n max-height: 16px;\n max-width: 24px;\n cursor: pointer;\n}\n\n.translationMenuIcon {\n padding: 0 10px !important;\n width: 24px;\n}\n\n.translationIAlice {\n display: inline-block;\n vertical-align: middle;\n max-height: 26px;\n max-width: 50px;\n}\n\n.translationIconAlice {\n height: 24px !important;\n width: 24px !important;\n}\n\n.translationITranslate {\n display: inline-block;\n vertical-align: middle;\n max-height: 20px;\n max-width: 20px;\n}\n\n.translationMenuContent {\n position: absolute;\n background: #2e2f34;\n color: #fff;\n display: none;\n border-radius: 1rem !important;\n left: 50%;\n top: 10rem;\n transform: translate(-50%);\n text-align: left;\n font: 600 14px / 16px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif !important;\n\n width: 300px;\n /* height: 375px; */\n opacity: 0;\n z-index: 100;\n transition: opacity 0.5s ease;\n}\n\n.VOTMenuSlider {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 268px !important;\n height: 8px !important;\n outline: none !important;\n margin-top: 0.5rem;\n opacity: 0.7;\n /* background: #3C3F4D !important; */\n background: rgb(253, 222, 85, 0.6) !important;\n border: none !important;\n border-radius: 2rem !important;\n -webkit-transition: 0.2s !important;\n transition: opacity 0.2s ease !important;\n}\n\n.VOTMenuSlider:hover {\n opacity: 1;\n}\n\n.VOTMenuSlider::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-moz-range-thumb {\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-ms-thumb {\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-ms-fill-lower {\n height: 8px !important;\n border-radius: 2rem !important;\n background: linear-gradient(\n 90.1deg,\n rgba(186, 153, 244, 0.85) -5.78%,\n rgba(236, 138, 202, 0.7) 56.46%,\n rgba(239, 168, 117, 0.6) 108.93%\n ) !important;\n}\n\n.VOTMenuSlider::-moz-range-progress {\n height: 8px !important;\n border-radius: 2rem !important;\n background: linear-gradient(\n 90.1deg,\n rgba(186, 153, 244, 0.85) -5.78%,\n rgba(236, 138, 202, 0.7) 56.46%,\n rgba(239, 168, 117, 0.6) 108.93%\n ) !important;\n}\n\n.translationHeader {\n padding-bottom: 0.5rem !important;\n}\n\n.translationMainHeader {\n margin: 16px !important;\n color: #fff;\n font: 900 14px / 16px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif !important;\n}\n\n.translationMenuOptions {\n display: flex;\n flex-flow: column wrap;\n}\n\n.translationMenuContainer {\n /* width: 100%; */\n padding-left: 16px !important;\n padding-top: 5px !important;\n display: inline-block !important;\n}\n\n.translationMenuContainer > input {\n appearance: auto !important;\n vertical-align: text-bottom;\n}\n\n.translationMenuText {\n color: #fff;\n display: inline-flex;\n width: 80%;\n}\n\n.translationVolumeBox,\n.translationVideoVolumeBox {\n padding-top: 0.5rem !important;\n}\n\n.translationDropDB {\n border: none !important;\n border-radius: 4px !important;\n background: #5426ff !important;\n color: #fff !important;\n padding: 6px 16px !important;\n margin-left: auto !important;\n cursor: pointer !important;\n}\n\n.translationDownload {\n background: #5426ff !important;\n color: #fff !important;\n padding: 2px 10px !important;\n border-radius: 4px !important;\n cursor: pointer;\n display: none;\n}\n\n.translationMenuFunctional {\n display: flex;\n margin: 16px !important;\n}\n\n.VOTMenuSelect {\n width: 110px;\n border-radius: 5px !important;\n border: 1px solid #dadce0 !important;\n box-shadow: 0 1px 3px -2px #9098a9;\n box-sizing: border-box !important;\n color: #2e2f34 !important;\n background: #fff !important;\n padding: 5px !important;\n}\n\n.VOTMenuSelect:focus {\n outline: none;\n}\n\n.VOTMenuSelect:focus {\n outline: none;\n border-color: #0077ff;\n box-shadow: 0 0 0 2px rgba(#0077ff, 0.2);\n}\n\n#VOTSelectLanguages {\n display: flex !important;\n margin-left: 5px;\n}\n\n#VOTSelectLanguages svg {\n margin: 0 5px;\n}\n',""]);const s=r},"./node_modules/css-loader/dist/runtime/api.js":e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,a,i){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(o)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),t.push(u))}},t}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":e=>{e.exports=function(e){return e[1]}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":e=>{var t=[];function n(e){for(var n=-1,o=0;o{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},"./node_modules/style-loader/dist/runtime/insertStyleElement.js":e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var a=void 0!==n.layer;a&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,a&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},"./src/config/config-cloudflare.js":(e,t,n)=>{n.d(t,{I:()=>a,i:()=>o});const o="vot.toil-dump.workers.dev",a="gnnde87s24kcuMH8rbWhLyfeuEKDkGGm"},"./src/config/config.js":(e,t,n)=>{n.d(t,{IM:()=>a,Rr:()=>o});const o="Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 CriOS/104.0.5112.114 YaBrowser/22.9.4.633.10 SA/3 Mobile/15E148 Safari/604.1",a=.15},"./src/config/constants.js":(e,t,n)=>{n.d(t,{Iz:()=>r,ey:()=>o,g$:()=>i,tW:()=>a});const o=0x4075500000000000,a={ru:"Russian",en:"English",zh:"Chinese",fr:"French",it:"Italian",es:"Spanish",de:"German"},i={youtube:"https://youtu.be/",twitch:"https://twitch.tv/",vimeo:"https://vimeo.com/","9gag":"https://9gag.com/gag/",vk:"https://vk.com/video?z=",xvideos:"https://www.xvideos.com/",pornhub:"https://rt.pornhub.com/view_video.php?viewkey=",udemy:"https://www.udemy.com",twitter:"https://twitter.com/i/status/",facebook:"https://www.facebook.com/",rutube:"https://rutube.ru/video/","bilibili.com":"https://www.bilibili.com/video/","mail.ru":"https://my.mail.ru/",coub:"https://coub.com/view/"},r={ru:{recommended:"рекомендуется",translateVideo:"Перевести видео",disableTranslate:"Выключить",translationSettings:"Настройки перевода",resetSettings:"Сбросить настройки",videoBeingTranslated:"Видео переводится",videoLanguage:"Язык видео",translationLanguage:"Язык перевода",translationTake:"Перевод займёт",translationTakeMoreThanHour:"Перевод займёт больше часа",translationTakeAboutMinute:"Перевод займёт около минуты",translationTakeFewMinutes:"Перевод займёт несколько минут",translationTakeApproximatelyMinutes:"Перевод займёт примерно {0} минут",translationTakeApproximatelyMinute:"Перевод займёт примерно {0} минуты",unSupportedExtensionError:`Ошибка! ${GM_info.scriptHandler} не поддерживается этой версией расширения!\n\nПожалуйста, используйте cloudflare-версию расширения VOT.`,requestTranslationFailed:"Не удалось запросить перевод видео",audioNotReceived:"Не получена ссылка на аудио",grantPermissionToAutoPlay:"Предоставьте разрешение на автовоспроизведение",neededAdditionalExtension:"Для поддержки этого сайта необходимо дополнительное расширение",audioFormatNotSupported:"Формат аудио не поддерживается",VOTAutoTranslate:"Переводить при открытии",VOTDontTranslateYourLang:"Не переводить с родного языка",VOTVolume:"Громкость видео",VOTVolumeTranslation:"Громкость перевода",VOTAutoSetVolume:"Уменьшать громкость видео до ",VOTShowVideoSlider:"Слайдер громкости видео",VOTSyncVolume:"Связать громкость перевода и видео",VOTAudioProxy:"Проксировать полученное аудио",VOTDisableFromYourLang:"VOT: Вы отключили перевод видео на вашем языке",VOTLiveNotSupported:"VOT: Не поддерживается перевод трансляций в прямом эфире",VOTPremiere:"VOT: Дождитесь окончания премьеры перед переводом",VOTVideoIsTooLong:"VOT: Видео слишком длинное",VOTNoVideoIDFound:"VOT: Не найдено ID видео",VOTFailedInitDB:"VOT: Не удалось инициализовать базу данных",VOTDBNeedUpdate:"VOT: Базе данных нужно обновление, пожалуйста, перезагрузите страницу",VOTDisabledForDBUpdating:`VOT отключен из-за ошибки при обновление Базы Данных. Закройте все открытые вкладки с ${window.location.hostname} и попробуйте снова`,VOTFailedWriteToDB:"VOT: Не удалось записать данные в базу данных",VOTFailedReadFromDB:"VOT: Не удалось получить данные из базы данных",Russian:"Русский",English:"Английский",Chinese:"Китайский",French:"Французский",Italian:"Итальянский",Spanish:"Испанский",German:"Немецкий"},en:{recommended:"recommended",translateVideo:"Translate video",disableTranslate:"Turn off",translationSettings:"Translation settings",resetSettings:"Reset settings",videoBeingTranslated:"The video is being translated",videoLanguage:"Video language",translationLanguage:"Translation language",translationTake:"The translation will take",translationTakeMoreThanHour:"The translation will take more than an hour",translationTakeAboutMinute:"The translation will take about a minute",translationTakeFewMinutes:"The translation will take a few minutes",translationTakeApproximatelyMinutes:"The translation will take approximately {0} minutes",translationTakeApproximatelyMinute:"The translation will take approximately {0} minutes",unSupportedExtensionError:`Error! ${GM_info.scriptHandler} is not supported by this version of the extension!\n\nPlease use the cloudflare version of the VOT extension.`,requestTranslationFailed:"Failed to request video translation",audioNotReceived:"Audio link not received",grantPermissionToAutoPlay:"Grant permission to autoplay",neededAdditionalExtension:"An additional extension is needed to support this site",audioFormatNotSupported:"The audio format is not supported",VOTAutoTranslate:"Translate on open",VOTDontTranslateYourLang:"Do not translate from my language",VOTVolume:"Video volume",VOTVolumeTranslation:"Translation Volume",VOTAutoSetVolume:"Reduce video volume to ",VOTShowVideoSlider:"Video volume slider",VOTSyncVolume:"Link translation and video volume",VOTAudioProxy:"Proxy received audio",VOTDisableFromYourLang:"VOT: You have disabled the translation of the video in your language",VOTLiveNotSupported:"VOT: Translation of live streams is not supported",VOTPremiere:"VOT: Wait for the premiere to end before translating",VOTVideoIsTooLong:"VOT: Video is too long",VOTNoVideoIDFound:"VOT: No video ID found",VOTFailedInitDB:"VOT: Failed to initialize database",VOTDBNeedUpdate:"VOT: The database needs an update, please reload the page",VOTDisabledForDBUpdating:`VOT is disabled due to an error when updating the Database. Close all open tabs with ${window.location.hostname} and try again`,VOTFailedWriteToDB:"VOT: Data could not be written to the database",VOTFailedReadFromDB:"VOT: Data could not be retrieved from the database",Russian:"Russian",English:"English",Chinese:"Chinese",French:"French",Italian:"Italian",Spanish:"Spanish",German:"German"},zh:{recommended:"推荐使用",translateVideo:"翻译视频",disableTranslate:"关掉",translationSettings:"翻译需要一个多小时",resetSettings:"重置设置",videoBeingTranslated:"视频正在翻译中",videoLanguage:"视频语言",translationLanguage:"翻译语言",translationTake:"翻译将采取",translationTakeMoreThanHour:"翻译将采取一个多小时",translationTakeAboutMinute:"翻译将采取一分钟",translationTakeFewMinutes:"翻译将采取几分钟",translationTakeApproximatelyMinutes:"翻译将采取大约需要{0}分钟",translationTakeApproximatelyMinute:"翻译将采取大约需要{0}分钟",unSupportedExtensionError:`错误! 此版本的扩展不支持 ${GM_info.scriptHandler}!\n\n请使用cloudflare版本的VOT扩展.`,requestTranslationFailed:"请求视频翻译失败",audioNotReceived:"未收到音频链接",grantPermissionToAutoPlay:"授予自动播放权限",neededAdditionalExtension:"需要一个额外的扩展来支持这个网站",audioFormatNotSupported:"不支持音频格式",VOTAutoTranslate:"打开时翻译",VOTDontTranslateYourLang:"不要从你的语言翻译过来",VOTVolume:"视频量",VOTVolumeTranslation:"翻译量",VOTAutoSetVolume:"将视频音量降低到",VOTShowVideoSlider:"视频音量滑块",VOTSyncVolume:"链接翻译和视频音量",VOTAudioProxy:"代理接收的音频",VOTDisableFromYourLang:"VOT:你已经禁用了你的语言的视频翻译",VOTLiveNotSupported:"VOT:不支持直播流的翻译",VOTPremiere:"VOT:等待首映结束后再翻译",VOTVideoIsTooLong:"VOT:视频太长",VOTNoVideoIDFound:"VOT: 没有找到视频ID",VOTFailedInitDB:"VOT: 初始化数据库失败",VOTDBNeedUpdate:"VOT: 数据库需要更新,请重新加载页面",VOTDisabledForDBUpdating:`VOT由于更新数据库时出错而被禁用。 关闭所有打开的选项卡${window.location.hostname} 再试一次`,VOTFailedWriteToDB:"VOT: 无法将数据写入数据库",VOTFailedReadFromDB:"VOT: 无法从数据库中检索数据",Russian:"俄语",English:"英语",Chinese:"中文",French:"法语",Italian:"意大利语",Spanish:"西班牙语",German:"德语"},de:{recommended:"es wird empfohlen",translateVideo:"Video übersetzen",disableTranslate:"Ausschalten",translationSettings:"Übersetzungseinstellungen",resetSettings:"Einstellungen zurücksetzen",videoBeingTranslated:"Das Video wird übersetzt",videoLanguage:"Sprache Video",translationLanguage:"Zielsprache",translationTake:"Die Übersetzung dauert",translationTakeMoreThanHour:"Die Übersetzung dauert mehr als eine Stunde",translationTakeAboutMinute:"Die Übersetzung dauert ungefähr eine Minute",translationTakeFewMinutes:"Die Übersetzung dauert einige Minuten",translationTakeApproximatelyMinutes:"Die Übersetzung dauert ungefähr {0} Minuten",translationTakeApproximatelyMinute:"Die Übersetzung dauert ungefähr {0} Minuten",unSupportedExtensionError:`Fehler! ${GM_info.scriptHandler} wird von dieser Version der Erweiterung nicht unterstützt!\n\nBitte verwenden Sie die Cloudflare-Version der VOT-Erweiterung.`,requestTranslationFailed:"Videoübersetzung konnte nicht angefordert werden",audioNotReceived:"Audiolink nicht empfangen",grantPermissionToAutoPlay:"Erteilen Sie die Berechtigung zur automatischen Wiedergabe",neededAdditionalExtension:"Eine zusätzliche Erweiterung ist erforderlich, um diese Website zu unterstützen",audioFormatNotSupported:"Das Audioformat wird nicht unterstützt",VOTAutoTranslate:"Beim Öffnen übersetzen",VOTDontTranslateYourLang:"Nicht aus Ihrer Sprache übersetzen",VOTVolume:"Video Lautstärke",VOTVolumeTranslation:"Übersetzungsvolumen",VOTAutoSetVolume:"Video-Lautstärke auf reduzieren ",VOTShowVideoSlider:"Video-Lautstärkeregler",VOTSyncVolume:"Übersetzungs- und Videolautstärke verknüpfen",VOTAudioProxy:"Empfangenes Audio proxyen",VOTDisableFromYourLang:"VOT: Sie haben die Übersetzung des Videos in Ihrer Sprache deaktiviert",VOTLiveNotSupported:"VOT: Übersetzung von Live-Streams wird nicht unterstützt",VOTPremiere:"VOT: Warten Sie, bis die Premiere beendet ist, bevor Sie übersetzen",VOTVideoIsTooLong:"VOT: Video ist zu lang",VOTNoVideoIDFound:"VOT: Keine Video-ID gefunden",VOTFailedInitDB:"VOT: Datenbank konnte nicht initialisiert werden",VOTDBNeedUpdate:"VOT: Die Datenbank muss aktualisiert werden, bitte laden Sie die Seite neu",VOTDisabledForDBUpdating:`VOT wurde aufgrund eines Fehlers beim Aktualisieren der Datenbank deaktiviert. Schließen Sie alle geöffneten Tabs mit ${window.location.hostname} und versuchen Sie es erneut`,VOTFailedWriteToDB:"VOT: Daten konnten nicht in die Datenbank geschrieben werden",VOTFailedReadFromDB:"VOT: Konnte keine Daten aus der Datenbank abrufen",Russian:"Russisch",English:"Englisch",Chinese:"Chinesisch",French:"Französisch",Italian:"Italienisch",Spanish:"Spanisch",German:"Deutsch"},es:{recommended:"es recomendable",translateVideo:"Traducir video",disableTranslate:"Apagar",translationSettings:"Ajustes de traducción",resetSettings:"Restablecer ajustes",videoBeingTranslated:"El video está siendo traducido",videoLanguage:"Idioma del video",translationLanguage:"Idioma de la traducción",translationTake:"La traducción tardará",translationTakeMoreThanHour:"La traducción tardará más de una hora",translationTakeAboutMinute:"La traducción tardará aproximadamente un minuto",translationTakeFewMinutes:"La traducción tardará unos minutos",translationTakeApproximatelyMinutes:"La traducción tardará aproximadamente {0} minutos",translationTakeApproximatelyMinute:"La traducción tardará aproximadamente {0} minutos",unSupportedExtensionError:`Error! ${GM_info.scriptHandler} no es compatible con esta versión de la extensión!\n\nUtilice la versión cloudflare de la extensión VOT.`,requestTranslationFailed:"Error al solicitar la traducción de vídeo",audioNotReceived:"Audiolink nicht empfangen",grantPermissionToAutoPlay:"Conceder permiso de reproducción automática",neededAdditionalExtension:"Se necesita una extensión adicional para admitir este sitio",audioFormatNotSupported:"El formato de audio no es compatible",VOTAutoTranslate:"Traducir al abrir",VOTDontTranslateYourLang:"No traduzca de su lengua",VOTVolume:"Volumen de vídeo",VOTVolumeTranslation:"Volumen de traducción",VOTAutoSetVolume:"Reducir el volumen del video al ",VOTShowVideoSlider:"Deslizador de volumen de video",VOTSyncVolume:"Vincular el volumen de traducción y video",VOTAudioProxy:"Proxificar el audio recibido",VOTDisableFromYourLang:"VOT: Ha desactivado la traducción del vídeo en su idioma",VOTLiveNotSupported:"VOT: No se admite la traducción de transmisiones en vivo",VOTPremiere:"VOT: Espere a que termine el estreno antes de traducir",VOTVideoIsTooLong:"VOT: El video es demasiado largo",VOTNoVideoIDFound:"VOT: No se encontró id de video",VOTFailedInitDB:"VOT: No se pudo inicializar la base de datos",VOTDBNeedUpdate:"VOT: la Base de datos necesita una actualización, por favor vuelva a cargar la página",VOTDisabledForDBUpdating:`VOT está deshabilitado debido a un error al actualizar la Base de Datos. Cierre todas las pestañas abiertas con ${window.location.hostname} y vuelve a intentarlo`,VOTFailedWriteToDB:"VOT: No se pudo escribir datos en la base de datos",VOTFailedReadFromDB:"VOT: No se pudo recuperar datos de la base de datos",Russian:"Ruso",English:"Inglés",Chinese:"Chino",French:"Francés",Italian:"Italiano",Spanish:"Español",German:"Alemán"},fr:{recommended:"recommande",translateVideo:"Traduire la vidéo",disableTranslate:"Désactiver",translationSettings:"Paramètres de traduction",resetSettings:"Réinitialiser les paramètres",videoBeingTranslated:"La vidéo est en cours de traduction",videoLanguage:"Langue vidéo",translationLanguage:"Langue cible",translationTake:"La traduction prendra",translationTakeMoreThanHour:"La traduction prendra plus d'une heure",translationTakeAboutMinute:"La traduction prendra environ une minute",translationTakeFewMinutes:"La traduction prendra quelques minutes",translationTakeApproximatelyMinutes:"La traduction prendra environ {0} minutes",translationTakeApproximatelyMinute:"La traduction prendra environ {0} minutes",unSupportedExtensionError:`Erreur! ${GM_info.scriptHandler} n'est pas supporté par cette version de l'extension!!\n\nVeuillez utiliser la version cloudflare de l'extension VOT.`,requestTranslationFailed:"Impossible de demander la traduction de la vidéo",audioNotReceived:"Lien audio non reçu",grantPermissionToAutoPlay:"Accorder l'autorisation de lecture automatique",neededAdditionalExtension:"Une extension supplémentaire est nécessaire pour prendre en charge ce site",audioFormatNotSupported:"Format audio non pris en charge",VOTAutoTranslate:"Traduire à l'ouverture",VOTDontTranslateYourLang:"Ne pas traduire à partir de votre langue",VOTVolume:"Volume de la vidéo",VOTVolumeTranslation:"Volume de traduction",VOTAutoSetVolume:"Réduire le volume de la vidéo à ",VOTShowVideoSlider:"Curseur de volume vidéo",VOTSyncVolume:"Lier le volume de la traduction et de la vidéo",VOTAudioProxy:"Proxy audio reçu",VOTDisableFromYourLang:"VOT: Vous avez désactivé la traduction de la vidéo dans votre langue",VOTLiveNotSupported:"VOT: La traduction des flux en direct n'est pas prise en charge",VOTPremiere:"VOT: Attendez la fin de la première avant de traduire",VOTVideoIsTooLong:"VOT: La vidéo est trop longue",VOTNoVideoIDFound:"VOT: ID vidéo introuvable",VOTFailedInitDB:"VOT: Impossible d'initialiser la base de données",VOTDBNeedUpdate:"VOT: la Base de données a besoin d'une mise à jour, veuillez recharger la page",VOTDisabledForDBUpdating:`VOT est désactivé en raison d'une erreur lors de la mise à jour de la Base de Données. Fermez tous les onglets ouverts avec ${window.location.hostname} et essayez à nouveau`,VOTFailedWriteToDB:"VOT: Impossible d'écrire les données dans la base de données",VOTFailedReadFromDB:"VOT: Impossible de récupérer les données de la base de données",Russian:"Russe",English:"Anglais",Chinese:"Chinois",French:"Français",Italian:"Italien",Spanish:"Espagnol",German:"Allemand"},it:{recommended:"è consigliabile",translateVideo:"Traduci il video",disableTranslate:"Spegnere",translationSettings:"Impostazioni di traduzione",resetSettings:"Ripristina impostazioni",videoBeingTranslated:"Il video è in fase di traduzione",videoLanguage:"Lingua Video",translationLanguage:"Lingua di traduzione",translationTake:"La traduzione richiederà",translationTakeMoreThanHour:"La traduzione richiederà più di un'ora",translationTakeAboutMinute:"La traduzione richiederà circa un minuto",translationTakeFewMinutes:"La traduzione richiederà alcuni minuti",translationTakeApproximatelyMinutes:"La traduzione richiederà circa {0} minuti",translationTakeApproximatelyMinute:"La traduzione richiederà circa {0} minuti",unSupportedExtensionError:`Errore! ${GM_info.scriptHandler} non è supportato da questa versione dell'estensione!\n\nUtilizzare la versione cloudflare dell'estensione VOT.`,requestTranslationFailed:"Richiesta di traduzione video non riuscita",audioNotReceived:"Collegamento audio non ricevuto",grantPermissionToAutoPlay:"Concedere l'Autorizzazione per la riproduzione automatica",neededAdditionalExtension:"Per supportare questo sito è necessaria un'estensione aggiuntiva",audioFormatNotSupported:"Il formato audio non è supportato",VOTAutoTranslate:"Traduci all'apertura",VOTDontTranslateYourLang:"Non traducete dalla vostra lingua",VOTVolume:"Volume video",VOTVolumeTranslation:"Volume di traduzione",VOTAutoSetVolume:"Riduci il volume del video al ",VOTShowVideoSlider:"Cursore del volume del video",VOTSyncVolume:"Collega il volume della traduzione e del video",VOTAudioProxy:"Proxy audio ricevuto",VOTDisableFromYourLang:"VOT: Avete disabilitato la traduzione del video nella vostra lingua",VOTLiveNotSupported:"VOT: La traduzione dei flussi dal vivo non è supportata",VOTPremiere:"VOT: Aspetta che la prima finisca prima di tradurre",VOTVideoIsTooLong:"VOT: Il video è troppo lungo",VOTNoVideoIDFound:"VOT: ID video non trovato",VOTFailedInitDB:"VOT: Impossibile inizializzare il database",VOTDBNeedUpdate:"VOT: Il database ha bisogno di aggiornamento, si prega di ricaricare la pagina",VOTDisabledForDBUpdating:`VOT è disabilitato a causa di un errore durante l'aggiornamento del database. CHIUDI tutte le schede aperte con ${window.location.hostname} e riprova`,VOTFailedWriteToDB:"VOT: Impossibile scrivere dati nel database",VOTFailedReadFromDB:"VOT: Impossibile recuperare i dati dal database",Russian:"Russo",English:"Inglese",Chinese:"Cinese",French:"Francese",Italian:"Italiano",Spanish:"Spagnolo",German:"Tedesco"}}},"./src/rvt-cloudflare.js":(e,t,n)=>{function o(e){const t=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)));return e?t:t.toUpperCase()}n.r(t),n.d(t,{default:()=>l});var a=n("./src/yandexRequests.js"),i=n("./src/config/config-cloudflare.js"),r=n("./src/config/config.js"),s=n("./src/utils/debug.js");const l=async function(e,t,n,l,d){let u,c;const p=o(!0),m=a.G.encodeRequest(e,p,t,n,l);try{s.Z.log("requestVideoTranslation");const e=new TextEncoder("utf-8"),t=await window.crypto.subtle.importKey("raw",e.encode(i.I),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),n=await window.crypto.subtle.sign("HMAC",t,m),a=Array.from(new Uint8Array(n),(e=>e.toString(16).padStart(2,"0"))).join(""),l={method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify({headers:{Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf","User-Agent":r.Rr,Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors","Vtrans-Signature":a,"Sec-Vtrans-Token":o(!1)},body:String.fromCharCode(...m)})};u=await fetch(`https://${i.i}/video-translation/translate`,l),c=await u.arrayBuffer()}catch(e){s.Z.log(e),u={status:-1},c=e}d(200==u.status,c)}},"./src/utils/debug.js":(e,t,n)=>{n.d(t,{Z:()=>o}),n("./src/config/constants.js");const o={log:(...e)=>{},translations:e=>{}}},"./src/yandexRequests.js":(e,t,n)=>{n.d(t,{G:()=>r});const o=new protobuf.Type("VideoTranslationRequest").add(new protobuf.Field("url",3,"string")).add(new protobuf.Field("deviceId",4,"string")).add(new protobuf.Field("firstRequest",5,"bool")).add(new protobuf.Field("unknown1",6,"fixed64")).add(new protobuf.Field("unknown2",7,"int32")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("unknown3",9,"int32")).add(new protobuf.Field("unknown4",10,"int32")).add(new protobuf.Field("translationHelp",11,"int32")).add(new protobuf.Field("responseLanguage",14,"string")),a=new protobuf.Type("VideoTranslationResponse").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("duration",2,"double")).add(new protobuf.Field("status",4,"int32")).add(new protobuf.Field("remainingTime",5,"int32")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("message",9,"string")),i=(new protobuf.Root).define("yandex").add(o).add(a),r={encodeRequest:(e,t,n,o,a)=>i.VideoTranslationRequest.encode({url:e,deviceId:t,firstRequest:!0,unknown1:n,unknown2:1,language:o,unknown3:0,unknown4:0,responseLanguage:a}).finish(),decodeResponse:e=>i.VideoTranslationResponse.decode(new Uint8Array(e))}}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,(()=>{var e=n("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),t=n.n(e),o=n("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),a=n.n(o),i=n("./node_modules/style-loader/dist/runtime/insertBySelector.js"),r=n.n(i),s=n("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),l=n.n(s),d=n("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),u=n.n(d),c=n("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),p=n.n(c),m=n("./node_modules/css-loader/dist/cjs.js!./src/styles/main.css"),g={};async function h(e,t,n,o,a){if(!window.location.hostname.includes("m.youtube.com")){const t=e.getAudioTrack(),n=t?.getLanguageInfo();if("und"!==n?.id)return n.id.split(".")[0]}const i=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(i?.length){const e=i.find((e=>"asr"===e.kind));if(e)return e.languageCode}const r=[n,o,a].join(" ").replace(/https?:\/\/\S+/g,"").replace(/[^\p{L}\s]/gu,"").trim().slice(0,250);return await async function(e){const t=await fetch("https://rust-server-531j.onrender.com/detect",{method:"POST",body:e});return await t.text()}(r)}g.styleTagTransform=p(),g.setAttributes=l(),g.insert=r().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=u(),t()(m.Z,g),m.Z&&m.Z.locals&&m.Z.locals;var T=n("./src/yandexRequests.js"),v=n("./src/config/constants.js"),y=n("./src/utils/debug.js");let b=(navigator.language||navigator.userLanguage).substr(0,2).toLowerCase();function f(e){document.querySelector(".translationBtn").style.color=e}function V(e="none"){document.querySelector(".translationBtn").dataset.state=e}function w(e="none"){let t;switch(e){case"error":t="#7A7A7D";break;case"success":t="#A36EFF";break;default:t="#FFFFFF"}document.querySelector(".translateIcon").style.fill=t}function O(e="none",t){switch(e){case"error":w(e),f("#7A7A7D"),V(e);break;case"success":w(e),f("#A36EFF"),V(e);break;default:w("none"),f("#FFFFFF"),V("none")}document.querySelector(".translationBtn").innerText=t}function S(e,t,n){const o=document.createElement("div"),a=document.createElement("input"),i=document.createElement("label");return a.type="checkbox",a.id=e,a.checked=Boolean(t),i.htmlFor=e,i.innerHTML=n,o.classList.add("translationMenuContainer"),o.appendChild(a),o.appendChild(i),o}function x(e,t,n){const o=document.createElement("div"),a=document.createElement("input"),i=document.createElement("label");return a.type="range",a.id=e,a.classList.add("VOTMenuSlider"),a.min=0,a.max=100,a.value=t,i.htmlFor=e,i.classList.add("translationHeader"),i.innerHTML=n,o.classList.add("translationMenuContainer"),o.appendChild(i),o.appendChild(a),o}function k(e,t){const n=document.createElement("div"),o=document.createElement("select");o.id=e,o.classList.add("VOTMenuSelect");for(const e of t){const t=document.createElement("option");t.innerText=e.label,t.value=e.value,Object.prototype.hasOwnProperty.call(e,"selected")&&e.selected&&t.setAttribute("selected","selected"),Object.prototype.hasOwnProperty.call(e,"disabled")&&(t.disabled=e.disabled),o.appendChild(t)}return n.classList.add("translationMenuContainer"),n.appendChild(o),n}function L(e){return new Promise((t=>{const n=document.querySelector(e);if(n)return t(n);const o=new MutationObserver((()=>{const n=document.querySelector(e);n&&(t(n),o.disconnect())}));o.observe(document.body,{childList:!0,subtree:!0,once:!0})}))}b in v.Iz||(b="en"),String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,(function(t,n){return void 0!==e[n]?e[n]:t}))});const F=e=>new Promise((t=>setTimeout(t,e))),I=e=>{const t=new URL(window.location.href);switch(e){case"youtube":return t.pathname.match(/(?:watch|embed)\/([^/]+)/)?.[1]||t.searchParams.get("v");case"vk":return t.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)?t.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)[0].slice(1):t.searchParams.get("z")?t.searchParams.get("z").split("/")[0]:!(!t.searchParams.get("oid")||!t.searchParams.get("id"))&&`video-${Math.abs(t.searchParams.get("oid"))}_${t.searchParams.get("id")}`;case"9gag":case"gag":return t.pathname.match(/gag\/([^/]+)/)?.[1];case"twitch":if(/^m\.twitch\.tv$/.test(window.location.hostname)){const e=document.head.querySelector('link[rel="canonical"]');return e?.href.match(/videos\/([^/]+)/)?.[0]||t.pathname.slice(1)}if(/^player\.twitch\.tv$/.test(window.location.hostname))return`videos/${t.searchParams.get("video")}`;if(/^clips\.twitch\.tv$/.test(window.location.hostname)){const e=document.querySelector(".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']");return!!e&&`${e.href.replace("https://www.twitch.tv/","")}/clip/${t.searchParams.get("clip")}`}return t.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)?t.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)[0]:t.pathname.match(/(?:videos)\/([^/]+)/)?.[0];case"tiktok":return t.pathname.match(/video\/([^/]+)/)?.[1];case"vimeo":return t.pathname.match(/[^/]+\/[^/]+$/)?.[0]||t.pathname.match(/[^/]+$/)?.[0];case"xvideos":return t.pathname.match(/[^/]+\/[^/]+$/)?.[0];case"pornhub":return t.searchParams.get("viewkey")||t.pathname.match(/embed\/([^/]+)/)?.[1];case"twitter":return t.pathname.match(/status\/([^/]+)/)?.[1];case"udemy":case"facebook":return t.pathname;case"rutube":return t.pathname.match(/(?:video|embed)\/([^/]+)/)?.[1];case"coub":return t.pathname.match(/view\/([^/]+)/)?.[1];case"bilibili.com":const e=t.searchParams.get("bvid");if(e)return e;{let e=t.pathname.match(/video\/([^/]+)/)?.[1];return e&&t.search&&null!==t.searchParams.get("p")&&(e+=`/?p=${t.searchParams.get("p")}`),e}case"mail.ru":if(t.pathname.startsWith("/v/")||t.pathname.startsWith("/mail/"))return t.pathname;if(t.pathname.match(/video\/embed\/([^/]+)/)){const e=document.querySelector(".b-video-controls__mymail-link");return!!e&&e?.href.split("my.mail.ru")?.[1]}default:return!1}};var D=n("./src/config/config.js");const M=["invidious.snopyta.org","yewtu.be","invidious.kavin.rocks","vid.puffyan.us","invidious.namazso.eu","inv.riverside.rocks","yt.artemislena.eu","invidious.flokinet.to","invidious.esmailelbob.xyz","y.com.sb","invidious.nerdvpn.de","inv.vern.cc","invidious.slipfox.xyz","invidio.xamh.de","invidious.dhusch.de"],A=["piped.video","piped.tokhmi.xyz","piped.moomoo.me","piped.syncpundit.io","piped.mha.fi","watch.whatever.social","piped.garudalinux.org","efy.piped.pages.dev","watch.leptons.xyz","piped.lunar.icu","yt.dc09.ru","piped.mint.lgbt","il.ax","piped.privacy.com.de","piped.esmailelbob.xyz","piped.projectsegfau.lt","piped.in.projectsegfau.lt","piped.us.projectsegfau.lt","piped.privacydev.net","piped.palveluntarjoaja.eu","piped.smnz.de","piped.adminforge.de","piped.qdi.fi","piped.hostux.net","piped.chauvet.pro","piped.jotoma.de","piped.pfcd.me","piped.frontendfriendly.xyz"],z=2,q={key:"settings",autoTranslate:0,defaultVolume:100,showVideoSlider:0,syncVolume:0,autoSetVolumeYandexStyle:1,dontTranslateYourLang:1},E={audioProxy:0};function P(e){return indexedDB.open(e,z)}async function B(){return new Promise(((e,t)=>{const n=P("VOT");n.onerror=()=>{console.error(`${v.Iz[b].VOTFailedInitDB}: ${n.error.message}`),t(!1)},n.onupgradeneeded=o=>{const a=n.result;if(a.onerror=()=>{const e=v.Iz[b].VOTFailedInitDB;alert(e),console.error(e,n.error),t(!1)},o.oldVersion<1){const n=a.createObjectStore("settings",{keyPath:"key"});for(const e of Object.keys(q).filter((e=>"key"!==e)))n.createIndex(e,e,{unique:!1});console.log("VOT: Database Created"),n.transaction.oncomplete=n=>{const o=a.transaction("settings","readwrite").objectStore("settings").add(q);o.onsuccess=()=>{console.log("VOT: Standard settings added to the Database: ",o.result),e(!0)},o.onerror=()=>{console.log("VOT: Error when adding standard settings to the Database: ",o.error),t(!1)}}}o.oldVersion<2&&function(n,o,a,i={}){const r=n.objectStore("settings");for(const e of Object.keys(a))r.createIndex(e,e,{unique:!1});console.log("VOT: The database has been updated"),r.transaction.oncomplete=n=>{const r=o.transaction("settings","readwrite").objectStore("settings"),s=r.get("settings");s.onerror=e=>{console.error("VOT: Data could not be retrieved from the Database: ",e.error),t(!1)},s.onsuccess=()=>{const n=s.result||Object.assign(q,i);for(const e in a)n[e]=a[e];const o=r.put(n);o.onerror=e=>{console.error("VOT: Failed to update the Database to new version",e.error),t(!1)},o.onsuccess=()=>{console.log("VOT: Standard settings of the new version have been added to the Database."),e(!0)}}}}(n.transaction,a,E)},n.onsuccess=()=>{const o=n.result;o.onversionchange=()=>{o.close();const e=v.Iz[b].VOTDBNeedUpdate;alert(e),console.log(e),window.location.reload(),t(!1)},e(!0)},n.onblocked=()=>{const e=n.result,o=v.Iz[b].VOTDisabledForDBUpdating;console.error(o,e),alert(o),t(!1)}}))}async function C({autoTranslate:e,defaultVolume:t,showVideoSlider:n,syncVolume:o,autoSetVolumeYandexStyle:a,dontTranslateYourLang:i,audioProxy:r}){return new Promise(((s,l)=>{if("number"==typeof e||"number"==typeof t||"number"==typeof n||"number"==typeof o||"number"==typeof a||"number"==typeof i||"number"==typeof r){const d=P("VOT");d.onerror=()=>{const e=v.Iz[b].VOTFailedWriteToDB;alert(e),console.error(e,d.error.message),l(!1)},d.onupgradeneeded=async()=>{d.result.close(),await B(),s(!0)},d.onsuccess=()=>{const u=d.result;u.onversionchange=()=>{u.close(),console.log("VOT: The database needs an update, please reload the page if it didn't happen automatically"),window.location.reload(),l(!1)};const c=u.transaction("settings","readwrite").objectStore("settings"),p=c.get("settings");p.onerror=e=>{console.error("VOT: Data could not be retrieved from the Database: ",e.error),l(!1)},p.onsuccess=()=>{const d=p.result;"number"==typeof e&&(d.autoTranslate=e),"number"==typeof t&&(d.defaultVolume=t),"number"==typeof n&&(d.showVideoSlider=n),"number"==typeof o&&(d.syncVolume=o),"number"==typeof a&&(d.autoSetVolumeYandexStyle=a),"number"==typeof i&&(d.dontTranslateYourLang=i),"number"==typeof r&&(d.audioProxy=r);const u=c.put(d);u.onerror=e=>{console.error("VOT: Не удалось обновить данные в Базе Данных: ",e.error),l(!1)},u.onsuccess=()=>{s(!0)}}},d.onblocked=()=>{const e=d.result,t=v.Iz[b].VOTDisabledForDBUpdating;console.error(t,e),alert(t),l(!1)}}}))}function N(){indexedDB.deleteDatabase("VOT")}function j(e,t,n,o){let a;return t>o?(a=n+(t-o),a=a>100?100:Math.max(a,0),e.volume=a/100):t100?100:Math.max(a,0),e.volume=a/100),a}var R=n("./src/config/config-cloudflare.js");const Z={youtubeRegex:/^(www.|m.)?youtube(-nocookie)?.com$/},$=".html5-video-container",_=".video-ref",H="main > div > section > div > div > div",U=".shaka-video-container",Y=".videoplayer_media",W='div[data-testid="videoComponent"] > div:nth-child(1) > div',G=".player",K=".video-post",J=".bpx-player-video-wrap",X="#b-video-wrapper",Q=[...M,...A];let ee="";(async function(){y.Z.log("Loading extension..."),y.Z.log(`Selected menu language: ${b}`);const e=(await Promise.resolve().then(n.bind(n,"./src/rvt-cloudflare.js"))).default;let t;y.Z.log("Inited requestVideoTranslation..."),y.Z.log("Extension compatibility passed...");const o=new Audio;let a=.9,i=!1;var r=!1;function s(e){i||(document.querySelector(".translationBlock").style.opacity=e)}function l(){clearTimeout(t),s(1),t=setTimeout((()=>{s(0)}),2e3)}function d(e,t,n){clearTimeout(t),s(n),e.stopPropagation()}async function u(n,u,c){let p,m,g,f,V,w,L,F,M,A,z,q;y.Z.log("[translateProccessor] execute on element: ",n);let E,Z=!0,$="";y.Z.log("videoContainer",n),p="vimeo"===u?n.querySelector(".vp-video-wrapper > .vp-video > .vp-telecine > video"):n.querySelector("video"),y.Z.log("video",p);const _="pornhub"===u&&window.location.pathname.includes("view_video.php")?document.querySelector(".original.mainPlayerDiv"):"pornhub"===u&&window.location.pathname.includes("embed/")?document.querySelector("body"):window.location.hostname.includes("m.youtube.com")?document.querySelector("#player-control-container"):n;!function(e){if(!e||e.querySelector(".translationBlock"))return;const t=document.createElement("div");t.classList.add("translationBlock"),t.innerHTML=`\n \n \n \n \n \n \n ${v.Iz[b].translateVideo}\n \n \n \n \n \n \n `,e.appendChild(t),y.Z.log("VOT: Added translation button to ",e)}(_),function(e){if(e.querySelector(".translationMenuContent"))return;const t=function(){const e=document.createElement("div");return e.classList.add("translationMenuContent"),e.innerHTML=`\n

${v.Iz[b].translationSettings}

\n
\n
\n \n \n \n \n \n \n
\n `,e.onclick=e=>e.stopPropagation(),e}();e.appendChild(t),document.querySelector(".translationMenu")?.addEventListener("click",(e=>{e.stopPropagation();const t=document.querySelector(".translationMenuContent");t.style.display=i?"none":"block",t.style.opacity=a,i=!i})),document.querySelector(".translationDropDB").addEventListener("click",(e=>{e.stopPropagation(),N(),location.reload()})),y.Z.log("VOT: Added translation menu to ",e)}(_);try{E=await B()}catch(e){console.error("[VOT] Failed to initialize database settings. All changes made will not be saved",e)}const H=document.querySelector(".translationMenuOptions");if(H&&!H.querySelector("#VOTTranslateFromLang")){const e=[{label:v.Iz[b].videoLanguage,value:"default",disabled:!0},...Object.entries(v.tW).map((([e,t])=>({label:v.Iz[b][t],value:e,selected:$.detectedLanguage===e})))],t=[{label:v.Iz[b].translationLanguage,value:"default",disabled:!0},...Object.entries(v.tW).map((([e,t])=>({label:v.Iz[b][t],value:e,selected:$.responseLanguage===e})))],n=k("VOTTranslateFromLang",e),o=k("VOTTranslateToLang",t).firstElementChild;n.id="VOTSelectLanguages",n.innerHTML+='\n \n \n \n ',n.appendChild(o),H.appendChild(n),H.querySelector("#VOTTranslateFromLang").addEventListener("change",(async e=>{y.Z.log("[onchange] select from language",e.target.value),await Y($,e.target.value)})),H.querySelector("#VOTTranslateToLang").addEventListener("change",(async e=>{y.Z.log("[onchange] select to language",e.target.value),await W($,e.target.value)}))}if(E){const e=await async function(){return new Promise(((e,t)=>{const n=P("VOT");n.onerror=()=>{const e=v.Iz[b].VOTFailedReadFromDB;alert(e),console.error(e,n.error.message),t(!1)},n.onupgradeneeded=async()=>{n.result.close(),await B(),e(!0)},n.onsuccess=()=>{const o=n.result;o.onversionchange=()=>{o.close();const e=v.Iz[b].VOTDBNeedUpdate;alert(e),console.error(e),t(!1)};const a=o.transaction("settings").objectStore("settings").get("settings");a.onerror=e=>{console.error(v.Iz[b].VOTFailedReadFromDB,e.error),console.error(e),t(!1)},a.onsuccess=()=>{void 0===a.result&&(o.close(),N(),t(!1));const n=a.result;e(n)}},n.onblocked=()=>{const e=n.result,o=v.Iz[b].VOTDisabledForDBUpdating;console.error(o,e),alert(o),t(!1)}}))}();if(e){if(w=e.autoTranslate,L=e.defaultVolume,F=e.showVideoSlider,M=e.autoSetVolumeYandexStyle,A=e.dontTranslateYourLang,q=e.audioProxy,z=e.syncVolume,y.Z.log("[db] data from db: ",e),void 0!==w&&H&&!H.querySelector("#VOTAutoTranslate")){const e=S("VOTAutoTranslate",w,v.Iz[b].VOTAutoTranslate+("vk"===u||window.location.hostname.includes("m.twitch.tv")?` (${v.Iz[b].recommended})`:""));e.querySelector("#VOTAutoTranslate").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({autoTranslate:t}),w=t,y.Z.log("autoTranslate value changed. New value: ",w)},H.appendChild(e)}if(window.location.hostname.includes("youtube.com")&&void 0!==A&&H&&!H.querySelector("#VOTDontTranslateYourLang")){const e=S("VOTDontTranslateYourLang",A,v.Iz[b].VOTDontTranslateYourLang);e.querySelector("#VOTDontTranslateYourLang").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({dontTranslateYourLang:t}),A=t,y.Z.log("dontTranslateYourLang value changed. New value: ",A)},H.appendChild(e)}if(void 0!==M&&H&&!H.querySelector("#VOTAutoSetVolume")){const e=S("VOTAutoSetVolume",M,v.Iz[b].VOTAutoSetVolume+(100*D.IM+"%"));e.querySelector("#VOTAutoSetVolume").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({autoSetVolumeYandexStyle:t}),M=t,y.Z.log("autoSetVolumeYandexStyle value changed. New value: ",M)},H.appendChild(e)}if(void 0!==F&&H&&!H.querySelector("#VOTShowVideoSlider")){const e=S("VOTShowVideoSlider",F,v.Iz[b].VOTShowVideoSlider);e.querySelector("#VOTShowVideoSlider").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({showVideoSlider:t}),F=t,y.Z.log("showVideoSlider value changed. New value: ",F),1===F&&"success"===document.querySelector(".translationBtn").dataset.state?X():document.querySelector("#VOTVideoSlider")?.parentElement.remove()},H.appendChild(e)}if(window.location.hostname.includes("youtube.com")&&!window.location.hostname.includes("m.youtube.com")&&void 0!==z&&H&&!H.querySelector("#VOTSyncVolume")){const e=S("VOTSyncVolume",z,v.Iz[b].VOTSyncVolume);e.querySelector("#VOTSyncVolume").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({syncVolume:t}),z=t,y.Z.log("syncVolume value changed. New value: ",z)},H.appendChild(e)}if(void 0!==q&&H&&!H.querySelector("#VOTAudioProxy")){const e=S("VOTAudioProxy",q,v.Iz[b].VOTAudioProxy);e.querySelector("#VOTAudioProxy").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await C({audioProxy:t}),q=t,y.Z.log("audioProxy value changed. New value: ",q)},H.appendChild(e)}}}async function U(e,t,n){document.querySelector("#VOTSelectLanguages")&&(console.log(`Set translation from ${t} to ${n}`),document.querySelector("#VOTTranslateFromLang").value=t,document.querySelector("#VOTTranslateToLang").value=n,e.responseLanguage=n)}async function Y(e,t){return e.detectedLanguage=t,e.responseLanguage=b,Object.keys(v.tW).includes(t)?(await U(e,e.detectedLanguage,e.responseLanguage),e):Y(e,"en")}async function W(e,t){if("en"===t)e.responseLanguage=t,"ru"==b&&(e.detectedLanguage="ru");else{if(!Object.keys(v.tW).includes(t))return W(e,"ru");e.detectedLanguage&&e.responseLanguage===b&&(e.detectedLanguage="en"),e.responseLanguage=t||b}return await U(e,e.detectedLanguage,e.responseLanguage),e}async function G(){o.pause(),p.removeEventListener(".translate",G,!1),await(async()=>{o.src="",o.removeAttribute("src")})(),document.querySelector("#VOTVideoSlider")?.parentElement.remove(),document.querySelector("#VOTTranslationSlider")?.parentElement.remove();const e=document.querySelector(".translationDownload");e.href="",e.style.display="none",O("none",v.Iz[b].translateVideo),g&&(p.volume=g)}async function K(){const e=document.querySelector(".ytp-volume-panel").getAttribute("aria-valuenow"),t=document.querySelector("#VOTVideoSlider");if(!t)return;t.value=e;const n=document.querySelector("#VOTVideoVolume");n&&(n.innerText=`${e}%`),1===z&&(f=Number(e))}O("none",v.Iz[b].translateVideo),window.location.hostname.includes("youtube.com")&&!window.location.hostname.includes("m.youtube.com")&&new MutationObserver((async function(e){e.forEach((async function(e){"attributes"===e.type&&"aria-valuenow"===e.attributeName&&document.querySelector("#VOTVideoSlider")&&K()}))})).observe(document.querySelector(".ytp-volume-panel"),{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0});const J=async(e=!1)=>{if(y.Z.log("lipsync video",p),p)if(o.currentTime=p.currentTime,o.playbackRate=p.playbackRate,e)if("play"!==e)"pause"===e&&(y.Z.log("lipsync mode is pause"),o.pause()),"stop"===e&&(y.Z.log("lipsync mode is stop"),o.pause()),"waiting"===e&&(y.Z.log("lipsync mode is waiting"),o.pause()),"playing"===e&&(y.Z.log("lipsync mode is playing"),o.play());else{y.Z.log("lipsync mode is play");const e=o.play();void 0!==e&&e.catch((e=>{if(console.error(e),"NotAllowedError"===e.name){const e=v.Iz[b].grantPermissionToAutoPlay;throw O("error",e),`VOT: ${e}`}if("NotSupportedError"===e.name){const e=Q.includes(window.location.hostname)?v.Iz[b].neededAdditionalExtension:v.Iz[b].audioFormatNotSupported;throw O("error",e),`VOT: ${e}`}}))}else y.Z.log("lipsync mode is not set")};async function X(){if(1!==F||document.querySelector("#VOTVideoSlider")||"success"!==document.querySelector(".translationBtn").dataset.state)return;const e=window.location.hostname.includes("youtube.com")&&!M?document.querySelector(".ytp-volume-panel")?.getAttribute("aria-valuenow"):Math.round(100*p.volume);f=e;const t=x("VOTVideoSlider",e,`${v.Iz[b].VOTVolume}: ${e}%`);t.querySelector("#VOTVideoSlider").oninput=async e=>{const{value:n}=e.target;if(p.volume=n/100,t.querySelector("#VOTOriginalVolume").innerText=`${n}%`,1!==z)return;const a=document.querySelector("#VOTTranslationSlider");if(!a)return;const i=Number(a.value),r=j(o,n,i,f);a.value=r;const s=document.querySelector("#VOTTranslationVolume");s&&(s.innerText=`${r}%`),V=r,f=n},document.querySelector(".translationMenuOptions").appendChild(t)}const te=async e=>{$.detectedLanguage||($=await async function(){const e={};return e.duration=p?.duration||0,e.videoId=I(u),e.detectedLanguage="en",e.responseLanguage="ru",window.location.hostname.includes("youtube.com")?(ee=await async function(){const e=document.querySelector("#movie_player"),t=e.getVideoData(),n=e.getPlayerResponse(),{isLive:o,isPremiere:a,title:i,author:r}=t,{shortDescription:s}=n?.videoDetails??{},l={isLive:o,isPremiere:a,title:i,description:s,author:r,detectedLanguage:await h(e,n,i,s,r)};return console.log("VOT Detected language: ",l.detectedLanguage),l}(),""!==ee.author&&(ee=await Y(ee,ee.detectedLanguage),e.detectedLanguage=ee.detectedLanguage)):window.location.hostname.includes("rutube")||window.location.hostname.includes("my.mail.ru")?(e.detectedLanguage="ru",e.responseLanguage="en"):window.location.hostname.includes("bilibili.com")&&(e.detectedLanguage="zh"),e}()),y.Z.log("Run videoValidator"),await async function(){if(window.location.hostname.includes("youtube.com")){if(y.Z.log("VideoValidator videoData: ",$),1===A&&$.detectedLanguage===b&&$.responseLanguage===b)throw v.Iz[b].VOTDisableFromYourLang;if(ee.isLive)throw v.Iz[b].VOTLiveNotSupported;if(ee.isPremiere)throw v.Iz[b].VOTPremiere;if($.duration>14400)throw v.Iz[b].VOTVideoIsTooLong}return!0}(),y.Z.log("Run translateFunc"),await ae(e,$.detectedLanguage,$.responseLanguage)};async function ne(e){y.Z.log(`video ${e.type}`),await J(e.type)}async function oe(){await G(),await K()}async function ae(t,a,i){console.log("VOT Video Data: ",$);const s=`${v.g$[u]}${t}`;await async function(t,n,o,a,i){y.Z.log(`Translate video (url: ${t}, unknown1: ${n}, requestLang: ${o}, responseLang: ${a})`),r?y.Z.log("translationPanding return"):(r=!0,await e(t,n,o,a,((e,t)=>{if(r=!1,y.Z.log("[exec callback] Requesting video translation"),!e)return void i(!1,v.Iz[b].requestTranslationFailed);const n=T.G.decodeResponse(t);switch(console.log("VOT Response: ",n),n.status){case 0:i(!1,n.message);break;case 1:i(!!n.url,n.url||v.Iz[b].audioNotReceived);break;case 2:i(!1,n.remainingTime?function(e){const t=Math.floor(e/60),n=Math.floor(e%60);return t>=60?v.Iz[b].translationTakeMoreThanHour:t>=10&&t%10?v.Iz[b].translationTakeApproximatelyMinutes.format(t):1==t||0==t&&n>0?v.Iz[b].translationTakeAboutMinute:v.Iz[b].translationTakeApproximatelyMinute.format(t)}(n.remainingTime):v.Iz[b].translationTakeFewMinutes);break;case 3:i(!1,v.Iz[b].videoBeingTranslated)}})))}(s,v.ey,a,i,(async(e,r)=>{if(y.Z.log("[exec callback] translateVideo"),I(u)!==t)return;if(!e)throw O("error",r),r.includes(v.Iz[b].translationTake)&&(clearTimeout(m),m=setTimeout((()=>ae(t,a,i)),6e4)),r;if(o.src=r,1===q&&r.startsWith("https://")){const e=r.replace("https://vtrans.s3-private.mds.yandex.net/tts/prod/",""),t=`https://${R.i}/video-translation/audio-proxy/${e}`;console.log(`VOT Audio proxied via ${t}`),o.src=t}switch(g=p?.volume,"number"==typeof L&&(o.volume=L/100),"number"==typeof M&&M&&(p.volume=D.IM),u){case"twitter":document.querySelector('div[data-testid="app-bar-back"][role="button"]').addEventListener("click",oe);break;case"invidious":case"piped":break;default:null!==c&&document.body.addEventListener(c,oe)}const s=["twitch","vimeo","facebook","rutube","twitter","bilibili.com","mail.ru"];for(let e=0;e{e.forEach((async e=>{"attributes"===e.type&&"src"===e.attributeName&&e.target===p&&""!==e.target.src&&(await oe(),Z=!0)}))})).observe(n,{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0});break}p&&!p.paused&&J("play");const l=document.querySelectorAll("video"),d=["playing","ratechange","play","waiting","pause"];l.forEach((e=>d.forEach((t=>e.addEventListener(t,ne))))),O("success",v.Iz[b].disableTranslate),await X(),await async function(){if(document.querySelector("#VOTTranslationSlider")||"success"!==document.querySelector(".translationBtn").dataset.state)return;const e="number"==typeof L?L:100;f=e;const t=x("VOTTranslationSlider",e,`${v.Iz[b].VOTVolumeTranslation}: ${e}%`);t.querySelector("#VOTTranslationSlider").oninput=async({target:{value:e}})=>{o.volume=e/100,document.querySelector("#VOTTranslationVolume").innerText=`${e}%`,await C({defaultVolume:Number(e)}),L=Number(e),1===z&&await async function(e){const t=document.querySelector("#VOTVideoSlider");if(!t)return;const n=Number(t.value),o=j(p,e,n,V);t.value=o;const a=document.querySelector("#VOTOriginalVolume");a&&(a.innerText=`${o}%`),f=o,V=e}(e)},document.querySelector(".translationMenuOptions").appendChild(t)}();const h=document.querySelector("#VOTVideoSlider");h&&(h.value=100*D.IM);const T=document.querySelector("#VOTOriginalVolume");T&&(T.innerText=100*D.IM+"%");const w=document.querySelector(".translationDownload");w.href=r,w.style.display="initial"}))}document.addEventListener("click",(async e=>{const t=document.querySelector(".translationBlock"),o=document.querySelector(".translationMenuContent"),a=!(!t&&e.target!==t)&&t.contains(e.target),r=!(!o&&e.target!==o)&&o.contains(e.target),l=!(!n&&e.target!==n)&&n.contains(e.target);y.Z.log(`[document click] ${a} ${r} ${l}`),a||r||(l||s(0),o.style.display="none",i=!1)}));const ie=(e,t,n)=>{t.forEach((t=>e.addEventListener(t,(async e=>{await n(e)}))))};"pornhub"===u?window.location.pathname.includes("view_video.php")?ie(document.querySelector(".original.mainPlayerDiv > video-element > div"),["mousemove","mouseout"],l):window.location.pathname.includes("embed/")&&ie(document.querySelector("#player"),["mousemove","mouseout"],l):ie("twitter"===u?document.querySelector('div[data-testid="videoPlayer"'):n,["mousemove","mouseout"],l),document.querySelector(".translationBlock").addEventListener("mousemove",(e=>d(e,t,a))),document.querySelector(".translationMenuContent").addEventListener("mousemove",(e=>d(e,t,a))),document.addEventListener("touchstart",(e=>d(e,t,a))),document.addEventListener("touchmove",(e=>d(e,t,a))),document.addEventListener("touchend",(e=>d(e,t,a))),document.querySelectorAll("video").forEach((e=>{e.addEventListener("abort",(async()=>{y.Z.log("lipsync mode is abort"),$.detectedLanguage="",await oe()}))})),document.querySelector(".translationBtn").addEventListener("click",(async e=>{if(y.Z.log("[click translationBtn] before all functions & methods"),e.stopPropagation(),e.stopImmediatePropagation(),o.src)return y.Z.log("[click translationBtn] audio.src is not empty"),await oe(),void($.detectedLanguage="");try{y.Z.log("[click translationBtn] trying execute translation");const e=I(u);if(!e)throw v.Iz[b].VOTNoVideoIDFound;await te(e)}catch(e){O("error",String(e).substring(4,e.length)),console.error(e)}})),p.addEventListener("progress",(async e=>{if(e.stopPropagation(),!Z||1!==w)return;const t=I(u);if(!t)throw v.Iz[b].VOTNoVideoIDFound;try{await te(t),Z=!1}catch(e){O("error",String(e).substring(4,e.length)),Z=!1}}))}await async function(){if(y.Z.log("Runned initWebsite function"),Z.youtubeRegex.test(window.location.hostname)){if(window.location.pathname.includes("embed")){const e=document.querySelector(".html5-video-container");return void await u(e,"youtube",null)}y.Z.log("[initWebsite] Found a match with youtube hostname");const e=()=>{const e=document.querySelector($);if(e)y.Z.log("[exec] translateProccessor youtube on page enter"),u(e,"youtube","yt-translate-stop");else{if(!ytplayer||!ytplayer.config)return void y.Z.log("[exec] ytplayer is null");ytplayer.config.args.jsapicallback=()=>{y.Z.log("[exec] translateProccessor youtube on page enter (ytplayer.config.args.jsapicallback)"),u(e,"youtube","yt-translate-stop")}}};document.addEventListener("spfdone",e),document.addEventListener("yt-navigate-finish",e);const t=async()=>{document.body.dispatchEvent(new Event("yt-translate-stop"))};if(document.addEventListener("spfrequest",t),document.addEventListener("yt-navigate-start",t),window.location.hostname.includes("m.youtube.com")){let e=await L("#player");e&&(await F(1e3),await u(e,"youtube","yt-translate-stop"),new MutationObserver((async t=>{for(const n of t)"attributes"===n.type&&"src"===n.attributeName&&(e=await L("#player"),await F(1e3),await u(e,"youtube","yt-translate-stop"))})).observe(e,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0}));const t=async()=>{document.body.dispatchEvent(new Event("yt-translate-stop"))};document.addEventListener("spfdone",t),document.addEventListener("yt-navigate-finish",t),document.addEventListener("spfrequest",t),document.addEventListener("yt-navigate-start",t)}}else if(window.location.hostname.includes("twitch.tv")){if(y.Z.log("[initWebsite] Found a match with twitch.tv"),window.location.hostname.includes("m.twitch.tv")&&(window.location.pathname.includes("/videos/")||window.location.pathname.includes("/clip/"))){if(y.Z.log("[initWebsite] Matched Twitch Mobile"),await L(H)){await F(200);const e=document.querySelector(H);await u(e,"twitch",null),new MutationObserver((async t=>{for(const n of t)"attributes"===n.type&&"src"===n.attributeName&&n.target===e?.querySelector("video")&&(await F(1e3),await u(e,"twitch",null))})).observe(e,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})}}else if(window.location.hostname.includes("player.twitch.tv")||window.location.hostname.includes("clips.twitch.tv")||window.location.pathname.includes("/videos/")||window.location.pathname.includes("/clip/")){y.Z.log("[initWebsite] Matched Twitch Desktop");const e=await L(_);e&&(await F(200),await u(e,"twitch",null))}y.Z.log("[initWebsite] Exit function in the twitch section")}else{if(window.location.hostname.includes("xvideos.com"))return y.Z.log("[entered] xvideos"),await F(1e3),void await u(document.querySelector(".video-bg-pic"),"xvideos",null);if(window.location.hostname.includes("pornhub.com"))return y.Z.log("[entered] pornhub"),await F(1e3),void await u(document.querySelector(".mgp_videoWrapper"),"pornhub",null);if(M.includes(window.location.hostname))y.Z.log("[entered] invidious"),await u(document.querySelector("#player"),"youtube",null);else if(A.includes(window.location.hostname)){y.Z.log("[entered] piped");const e=await L(U);if(e){let t,n=I("youtube");await u(e,"youtube","piped"),setInterval((async()=>{t=I("youtube"),n!==t&&(t&&await u(document.querySelector(U),"youtube","piped"),n=t)}),3e3)}}else if(/^(www.|m.)?vk.(com|ru)$/.test(window.location.hostname)){if(y.Z.log("[entered] vk.com"),await L(Y)){let e;await u(document.querySelector(Y),"vk",null);let t=I("vk");setInterval((async()=>{if(e=I("vk"),t!==e){if(e){const e=await L(Y);e&&await u(e,"vk",null)}t=e}}),3e3)}}else if(window.location.hostname.includes("vimeo.com"))y.Z.log("[entered] vimeo.com"),await L(G)&&(await F(1e3),await u(document.querySelector(G),"vimeo",null));else if(window.location.hostname.includes("9gag.com"))await F(1e3),await u(document.querySelector(K),"9gag",null);else if(window.location.hostname.includes("coub.com"))await F(1e3),await u(document.querySelector(".viewer__player"),"coub",null);else if(window.location.hostname.includes("rutube.ru")){const e=window.location.pathname.includes("/play/embed")?"#app > div > div":".video-player > div > div > div:nth-child(2)",t=await L(e);t&&await u(t,"rutube",null)}else if(window.location.hostname.includes("bilibili.com")){if(window.location.pathname.includes("/video/")){const e=await L(J);e&&await u(e,"bilibili.com",null)}else if(window.location.pathname.includes("/blackboard/webplayer/embed-old.html")){const e=await L("video");e&&await u(e.parentElement,"bilibili.com",null)}}else if(window.location.hostname.includes("twitter.com")){const e=await L(W);if(e){let t,n=I("twitter");await u(e,"twitter",null),setInterval((async()=>{t=I("twitter"),n!==t&&(t&&await u(document.querySelector(W),"twitter",null),n=t)}),3e3)}}else if(window.location.hostname.includes("my.mail.ru")){const e=await L(X);if(e){let t,n=I("mail.ru");await u(e,"mail.ru",null),setInterval((async()=>{t=I("mail.ru"),n!==t&&(t&&await u(document.querySelector(X),"mail.ru",null),n=t)}),3e3)}}}}()})().catch((e=>{console.error(e)}))})()})(); \ No newline at end of file diff --git a/dist/vot-cloudflare.user.js b/dist/vot-cloudflare.user.js index 71dc754c..56d53d53 100644 --- a/dist/vot-cloudflare.user.js +++ b/dist/vot-cloudflare.user.js @@ -3420,7 +3420,7 @@ async function src_main() { mutation.target === video && mutation.target.src !== "" ) { - stopTranslation(); + await stopTranslation(); firstPlay = true; } }); @@ -3565,8 +3565,8 @@ async function src_main() { // check if the audio source is not empty if (audio.src) { debug/* default */.Z.log("[click translationBtn] audio.src is not empty"); + await stopTranslation(); videoData.detectedLanguage = "" - await stopTraslate(); return; } diff --git a/dist/vot-min.user.js b/dist/vot-min.user.js index ef332d8f..1a9b0478 100644 --- a/dist/vot-min.user.js +++ b/dist/vot-min.user.js @@ -83,4 +83,4 @@ // @updateURL https://raw.githubusercontent.com/ilyhalight/voice-over-translation/master/dist/vot.user.js // ==/UserScript== -(()=>{"use strict";var e={"./node_modules/css-loader/dist/cjs.js!./src/styles/main.css":(e,t,n)=>{n.d(t,{Z:()=>s});var a=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),o=n.n(a),i=n("./node_modules/css-loader/dist/runtime/api.js"),r=n.n(i)()(o());r.push([e.id,'.translationBlock {\n padding: 0.45rem !important;\n width: max-content;\n position: absolute;\n background: #2e2f34;\n border-radius: 0.5rem !important;\n left: 50%;\n top: 5rem;\n transform: translate(-50%);\n text-align: center;\n opacity: 0;\n transition: opacity 1s;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n z-index: 100;\n}\n\n.translationBtn {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n color: #fff;\n padding-right: 0.25rem !important;\n cursor: pointer;\n font: 600 12px / 14px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif;\n}\n\n.translationBlock:hover {\n opacity: 1;\n}\n\n.translationMenu {\n display: inline-block;\n vertical-align: middle;\n border-left: 1px solid #424348;\n max-height: 16px;\n max-width: 24px;\n cursor: pointer;\n}\n\n.translationMenuIcon {\n padding: 0 10px !important;\n width: 24px;\n}\n\n.translationIAlice {\n display: inline-block;\n vertical-align: middle;\n max-height: 26px;\n max-width: 50px;\n}\n\n.translationIconAlice {\n height: 24px !important;\n width: 24px !important;\n}\n\n.translationITranslate {\n display: inline-block;\n vertical-align: middle;\n max-height: 20px;\n max-width: 20px;\n}\n\n.translationMenuContent {\n position: absolute;\n background: #2e2f34;\n color: #fff;\n display: none;\n border-radius: 1rem !important;\n left: 50%;\n top: 10rem;\n transform: translate(-50%);\n text-align: left;\n font: 600 14px / 16px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif !important;\n\n width: 300px;\n /* height: 375px; */\n opacity: 0;\n z-index: 100;\n transition: opacity 0.5s ease;\n}\n\n.VOTMenuSlider {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 268px !important;\n height: 8px !important;\n outline: none !important;\n margin-top: 0.5rem;\n opacity: 0.7;\n /* background: #3C3F4D !important; */\n background: rgb(253, 222, 85, 0.6) !important;\n border: none !important;\n border-radius: 2rem !important;\n -webkit-transition: 0.2s !important;\n transition: opacity 0.2s ease !important;\n}\n\n.VOTMenuSlider:hover {\n opacity: 1;\n}\n\n.VOTMenuSlider::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-moz-range-thumb {\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-ms-thumb {\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-ms-fill-lower {\n height: 8px !important;\n border-radius: 2rem !important;\n background: linear-gradient(\n 90.1deg,\n rgba(186, 153, 244, 0.85) -5.78%,\n rgba(236, 138, 202, 0.7) 56.46%,\n rgba(239, 168, 117, 0.6) 108.93%\n ) !important;\n}\n\n.VOTMenuSlider::-moz-range-progress {\n height: 8px !important;\n border-radius: 2rem !important;\n background: linear-gradient(\n 90.1deg,\n rgba(186, 153, 244, 0.85) -5.78%,\n rgba(236, 138, 202, 0.7) 56.46%,\n rgba(239, 168, 117, 0.6) 108.93%\n ) !important;\n}\n\n.translationHeader {\n padding-bottom: 0.5rem !important;\n}\n\n.translationMainHeader {\n margin: 16px !important;\n color: #fff;\n font: 900 14px / 16px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif !important;\n}\n\n.translationMenuOptions {\n display: flex;\n flex-flow: column wrap;\n}\n\n.translationMenuContainer {\n /* width: 100%; */\n padding-left: 16px !important;\n padding-top: 5px !important;\n display: inline-block !important;\n}\n\n.translationMenuContainer > input {\n appearance: auto !important;\n vertical-align: text-bottom;\n}\n\n.translationMenuText {\n color: #fff;\n display: inline-flex;\n width: 80%;\n}\n\n.translationVolumeBox,\n.translationVideoVolumeBox {\n padding-top: 0.5rem !important;\n}\n\n.translationDropDB {\n border: none !important;\n border-radius: 4px !important;\n background: #5426ff !important;\n color: #fff !important;\n padding: 6px 16px !important;\n margin-left: auto !important;\n cursor: pointer !important;\n}\n\n.translationDownload {\n background: #5426ff !important;\n color: #fff !important;\n padding: 2px 10px !important;\n border-radius: 4px !important;\n cursor: pointer;\n display: none;\n}\n\n.translationMenuFunctional {\n display: flex;\n margin: 16px !important;\n}\n\n.VOTMenuSelect {\n width: 110px;\n border-radius: 5px !important;\n border: 1px solid #dadce0 !important;\n box-shadow: 0 1px 3px -2px #9098a9;\n box-sizing: border-box !important;\n color: #2e2f34 !important;\n background: #fff !important;\n padding: 5px !important;\n}\n\n.VOTMenuSelect:focus {\n outline: none;\n}\n\n.VOTMenuSelect:focus {\n outline: none;\n border-color: #0077ff;\n box-shadow: 0 0 0 2px rgba(#0077ff, 0.2);\n}\n\n#VOTSelectLanguages {\n display: flex !important;\n margin-left: 5px;\n}\n\n#VOTSelectLanguages svg {\n margin: 0 5px;\n}\n',""]);const s=r},"./node_modules/css-loader/dist/runtime/api.js":e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",a=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),a&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),a&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,a,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(a)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":e=>{e.exports=function(e){return e[1]}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":e=>{var t=[];function n(e){for(var n=-1,a=0;a{var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},"./node_modules/style-loader/dist/runtime/insertStyleElement.js":e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,o&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},"./src/config/config.js":(e,t,n)=>{n.d(t,{I1:()=>o,IM:()=>r,Rr:()=>i,iF:()=>a});const a="api.browser.yandex.ru",o="gnnde87s24kcuMH8rbWhLyfeuEKDkGGm",i="Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 CriOS/104.0.5112.114 YaBrowser/22.9.4.633.10 SA/3 Mobile/15E148 Safari/604.1",r=.15},"./src/rvt.js":(e,t,n)=>{function a(e){const t=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)));return e?t:t.toUpperCase()}n.r(t),n.d(t,{default:()=>r});var o=n("./src/yandexRequests.js"),i=n("./src/config/config.js");const r=async function(e,t,n,r,s){const l=a(!0),d=o.G.encodeRequest(e,l,t,n,r);try{const e=new TextEncoder("utf-8"),t=await window.crypto.subtle.importKey("raw",e.encode(i.I1),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),n=await window.crypto.subtle.sign("HMAC",t,d),o=Array.from(new Uint8Array(n),(e=>e.toString(16).padStart(2,"0"))).join(""),r={url:`https://${i.iF}/video-translation/translate`,method:"POST",headers:{Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf","User-Agent":i.Rr,Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors","sec-ch-ua":null,"sec-ch-ua-mobile":null,"sec-ch-ua-platform":null,"Vtrans-Signature":o,"Sec-Vtrans-Token":a(!1)},data:String.fromCharCode(...d),responseType:"arraybuffer"};GM_xmlhttpRequest({...r,onload:e=>{s(200===e.status,e.response)},onerror:e=>{s(!1)}})}catch(e){s(!1)}}},"./src/yandexRequests.js":(e,t,n)=>{n.d(t,{G:()=>r});const a=new protobuf.Type("VideoTranslationRequest").add(new protobuf.Field("url",3,"string")).add(new protobuf.Field("deviceId",4,"string")).add(new protobuf.Field("firstRequest",5,"bool")).add(new protobuf.Field("unknown1",6,"fixed64")).add(new protobuf.Field("unknown2",7,"int32")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("unknown3",9,"int32")).add(new protobuf.Field("unknown4",10,"int32")).add(new protobuf.Field("translationHelp",11,"int32")).add(new protobuf.Field("responseLanguage",14,"string")),o=new protobuf.Type("VideoTranslationResponse").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("duration",2,"double")).add(new protobuf.Field("status",4,"int32")).add(new protobuf.Field("remainingTime",5,"int32")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("message",9,"string")),i=(new protobuf.Root).define("yandex").add(a).add(o),r={encodeRequest:(e,t,n,a,o)=>i.VideoTranslationRequest.encode({url:e,deviceId:t,firstRequest:!0,unknown1:n,unknown2:1,language:a,unknown3:0,unknown4:0,responseLanguage:o}).finish(),decodeResponse:e=>i.VideoTranslationResponse.decode(new Uint8Array(e))}}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var i=t[a]={id:a,exports:{}};return e[a](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,(()=>{var e=n("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),t=n.n(e),a=n("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),o=n.n(a),i=n("./node_modules/style-loader/dist/runtime/insertBySelector.js"),r=n.n(i),s=n("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),l=n.n(s),d=n("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),u=n.n(d),c=n("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),p=n.n(c),m=n("./node_modules/css-loader/dist/cjs.js!./src/styles/main.css"),g={};async function h(e,t,n,a,o){if(!window.location.hostname.includes("m.youtube.com")){const t=e.getAudioTrack(),n=t?.getLanguageInfo();if("und"!==n?.id)return n.id.split(".")[0]}const i=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(i?.length){const e=i.find((e=>"asr"===e.kind));if(e)return e.languageCode}const r=[n,a,o].join(" ").replace(/https?:\/\/\S+/g,"").replace(/[^\p{L}\s]/gu,"").trim().slice(0,250);return await async function(e){const t=await fetch("https://rust-server-531j.onrender.com/detect",{method:"POST",body:e});return await t.text()}(r)}g.styleTagTransform=p(),g.setAttributes=l(),g.insert=r().bind(null,"head"),g.domAPI=o(),g.insertStyleElement=u(),t()(m.Z,g),m.Z&&m.Z.locals&&m.Z.locals;var T=n("./src/yandexRequests.js");const v={ru:"Russian",en:"English",zh:"Chinese",fr:"French",it:"Italian",es:"Spanish",de:"German"},y={youtube:"https://youtu.be/",twitch:"https://twitch.tv/",vimeo:"https://vimeo.com/","9gag":"https://9gag.com/gag/",vk:"https://vk.com/video?z=",xvideos:"https://www.xvideos.com/",pornhub:"https://rt.pornhub.com/view_video.php?viewkey=",udemy:"https://www.udemy.com",twitter:"https://twitter.com/i/status/",facebook:"https://www.facebook.com/",rutube:"https://rutube.ru/video/","bilibili.com":"https://www.bilibili.com/video/","mail.ru":"https://my.mail.ru/",coub:"https://coub.com/view/"},b={ru:{recommended:"рекомендуется",translateVideo:"Перевести видео",disableTranslate:"Выключить",translationSettings:"Настройки перевода",resetSettings:"Сбросить настройки",videoBeingTranslated:"Видео переводится",videoLanguage:"Язык видео",translationLanguage:"Язык перевода",translationTake:"Перевод займёт",translationTakeMoreThanHour:"Перевод займёт больше часа",translationTakeAboutMinute:"Перевод займёт около минуты",translationTakeFewMinutes:"Перевод займёт несколько минут",translationTakeApproximatelyMinutes:"Перевод займёт примерно {0} минут",translationTakeApproximatelyMinute:"Перевод займёт примерно {0} минуты",unSupportedExtensionError:`Ошибка! ${GM_info.scriptHandler} не поддерживается этой версией расширения!\n\nПожалуйста, используйте cloudflare-версию расширения VOT.`,requestTranslationFailed:"Не удалось запросить перевод видео",audioNotReceived:"Не получена ссылка на аудио",grantPermissionToAutoPlay:"Предоставьте разрешение на автовоспроизведение",neededAdditionalExtension:"Для поддержки этого сайта необходимо дополнительное расширение",audioFormatNotSupported:"Формат аудио не поддерживается",VOTAutoTranslate:"Переводить при открытии",VOTDontTranslateYourLang:"Не переводить с родного языка",VOTVolume:"Громкость видео",VOTVolumeTranslation:"Громкость перевода",VOTAutoSetVolume:"Уменьшать громкость видео до ",VOTShowVideoSlider:"Слайдер громкости видео",VOTSyncVolume:"Связать громкость перевода и видео",VOTAudioProxy:"Проксировать полученное аудио",VOTDisableFromYourLang:"VOT: Вы отключили перевод видео на вашем языке",VOTLiveNotSupported:"VOT: Не поддерживается перевод трансляций в прямом эфире",VOTPremiere:"VOT: Дождитесь окончания премьеры перед переводом",VOTVideoIsTooLong:"VOT: Видео слишком длинное",VOTNoVideoIDFound:"VOT: Не найдено ID видео",VOTFailedInitDB:"VOT: Не удалось инициализовать базу данных",VOTDBNeedUpdate:"VOT: Базе данных нужно обновление, пожалуйста, перезагрузите страницу",VOTDisabledForDBUpdating:`VOT отключен из-за ошибки при обновление Базы Данных. Закройте все открытые вкладки с ${window.location.hostname} и попробуйте снова`,VOTFailedWriteToDB:"VOT: Не удалось записать данные в базу данных",VOTFailedReadFromDB:"VOT: Не удалось получить данные из базы данных",Russian:"Русский",English:"Английский",Chinese:"Китайский",French:"Французский",Italian:"Итальянский",Spanish:"Испанский",German:"Немецкий"},en:{recommended:"recommended",translateVideo:"Translate video",disableTranslate:"Turn off",translationSettings:"Translation settings",resetSettings:"Reset settings",videoBeingTranslated:"The video is being translated",videoLanguage:"Video language",translationLanguage:"Translation language",translationTake:"The translation will take",translationTakeMoreThanHour:"The translation will take more than an hour",translationTakeAboutMinute:"The translation will take about a minute",translationTakeFewMinutes:"The translation will take a few minutes",translationTakeApproximatelyMinutes:"The translation will take approximately {0} minutes",translationTakeApproximatelyMinute:"The translation will take approximately {0} minutes",unSupportedExtensionError:`Error! ${GM_info.scriptHandler} is not supported by this version of the extension!\n\nPlease use the cloudflare version of the VOT extension.`,requestTranslationFailed:"Failed to request video translation",audioNotReceived:"Audio link not received",grantPermissionToAutoPlay:"Grant permission to autoplay",neededAdditionalExtension:"An additional extension is needed to support this site",audioFormatNotSupported:"The audio format is not supported",VOTAutoTranslate:"Translate on open",VOTDontTranslateYourLang:"Do not translate from my language",VOTVolume:"Video volume",VOTVolumeTranslation:"Translation Volume",VOTAutoSetVolume:"Reduce video volume to ",VOTShowVideoSlider:"Video volume slider",VOTSyncVolume:"Link translation and video volume",VOTAudioProxy:"Proxy received audio",VOTDisableFromYourLang:"VOT: You have disabled the translation of the video in your language",VOTLiveNotSupported:"VOT: Translation of live streams is not supported",VOTPremiere:"VOT: Wait for the premiere to end before translating",VOTVideoIsTooLong:"VOT: Video is too long",VOTNoVideoIDFound:"VOT: No video ID found",VOTFailedInitDB:"VOT: Failed to initialize database",VOTDBNeedUpdate:"VOT: The database needs an update, please reload the page",VOTDisabledForDBUpdating:`VOT is disabled due to an error when updating the Database. Close all open tabs with ${window.location.hostname} and try again`,VOTFailedWriteToDB:"VOT: Data could not be written to the database",VOTFailedReadFromDB:"VOT: Data could not be retrieved from the database",Russian:"Russian",English:"English",Chinese:"Chinese",French:"French",Italian:"Italian",Spanish:"Spanish",German:"German"},zh:{recommended:"推荐使用",translateVideo:"翻译视频",disableTranslate:"关掉",translationSettings:"翻译需要一个多小时",resetSettings:"重置设置",videoBeingTranslated:"视频正在翻译中",videoLanguage:"视频语言",translationLanguage:"翻译语言",translationTake:"翻译将采取",translationTakeMoreThanHour:"翻译将采取一个多小时",translationTakeAboutMinute:"翻译将采取一分钟",translationTakeFewMinutes:"翻译将采取几分钟",translationTakeApproximatelyMinutes:"翻译将采取大约需要{0}分钟",translationTakeApproximatelyMinute:"翻译将采取大约需要{0}分钟",unSupportedExtensionError:`错误! 此版本的扩展不支持 ${GM_info.scriptHandler}!\n\n请使用cloudflare版本的VOT扩展.`,requestTranslationFailed:"请求视频翻译失败",audioNotReceived:"未收到音频链接",grantPermissionToAutoPlay:"授予自动播放权限",neededAdditionalExtension:"需要一个额外的扩展来支持这个网站",audioFormatNotSupported:"不支持音频格式",VOTAutoTranslate:"打开时翻译",VOTDontTranslateYourLang:"不要从你的语言翻译过来",VOTVolume:"视频量",VOTVolumeTranslation:"翻译量",VOTAutoSetVolume:"将视频音量降低到",VOTShowVideoSlider:"视频音量滑块",VOTSyncVolume:"链接翻译和视频音量",VOTAudioProxy:"代理接收的音频",VOTDisableFromYourLang:"VOT:你已经禁用了你的语言的视频翻译",VOTLiveNotSupported:"VOT:不支持直播流的翻译",VOTPremiere:"VOT:等待首映结束后再翻译",VOTVideoIsTooLong:"VOT:视频太长",VOTNoVideoIDFound:"VOT: 没有找到视频ID",VOTFailedInitDB:"VOT: 初始化数据库失败",VOTDBNeedUpdate:"VOT: 数据库需要更新,请重新加载页面",VOTDisabledForDBUpdating:`VOT由于更新数据库时出错而被禁用。 关闭所有打开的选项卡${window.location.hostname} 再试一次`,VOTFailedWriteToDB:"VOT: 无法将数据写入数据库",VOTFailedReadFromDB:"VOT: 无法从数据库中检索数据",Russian:"俄语",English:"英语",Chinese:"中文",French:"法语",Italian:"意大利语",Spanish:"西班牙语",German:"德语"},de:{recommended:"es wird empfohlen",translateVideo:"Video übersetzen",disableTranslate:"Ausschalten",translationSettings:"Übersetzungseinstellungen",resetSettings:"Einstellungen zurücksetzen",videoBeingTranslated:"Das Video wird übersetzt",videoLanguage:"Sprache Video",translationLanguage:"Zielsprache",translationTake:"Die Übersetzung dauert",translationTakeMoreThanHour:"Die Übersetzung dauert mehr als eine Stunde",translationTakeAboutMinute:"Die Übersetzung dauert ungefähr eine Minute",translationTakeFewMinutes:"Die Übersetzung dauert einige Minuten",translationTakeApproximatelyMinutes:"Die Übersetzung dauert ungefähr {0} Minuten",translationTakeApproximatelyMinute:"Die Übersetzung dauert ungefähr {0} Minuten",unSupportedExtensionError:`Fehler! ${GM_info.scriptHandler} wird von dieser Version der Erweiterung nicht unterstützt!\n\nBitte verwenden Sie die Cloudflare-Version der VOT-Erweiterung.`,requestTranslationFailed:"Videoübersetzung konnte nicht angefordert werden",audioNotReceived:"Audiolink nicht empfangen",grantPermissionToAutoPlay:"Erteilen Sie die Berechtigung zur automatischen Wiedergabe",neededAdditionalExtension:"Eine zusätzliche Erweiterung ist erforderlich, um diese Website zu unterstützen",audioFormatNotSupported:"Das Audioformat wird nicht unterstützt",VOTAutoTranslate:"Beim Öffnen übersetzen",VOTDontTranslateYourLang:"Nicht aus Ihrer Sprache übersetzen",VOTVolume:"Video Lautstärke",VOTVolumeTranslation:"Übersetzungsvolumen",VOTAutoSetVolume:"Video-Lautstärke auf reduzieren ",VOTShowVideoSlider:"Video-Lautstärkeregler",VOTSyncVolume:"Übersetzungs- und Videolautstärke verknüpfen",VOTAudioProxy:"Empfangenes Audio proxyen",VOTDisableFromYourLang:"VOT: Sie haben die Übersetzung des Videos in Ihrer Sprache deaktiviert",VOTLiveNotSupported:"VOT: Übersetzung von Live-Streams wird nicht unterstützt",VOTPremiere:"VOT: Warten Sie, bis die Premiere beendet ist, bevor Sie übersetzen",VOTVideoIsTooLong:"VOT: Video ist zu lang",VOTNoVideoIDFound:"VOT: Keine Video-ID gefunden",VOTFailedInitDB:"VOT: Datenbank konnte nicht initialisiert werden",VOTDBNeedUpdate:"VOT: Die Datenbank muss aktualisiert werden, bitte laden Sie die Seite neu",VOTDisabledForDBUpdating:`VOT wurde aufgrund eines Fehlers beim Aktualisieren der Datenbank deaktiviert. Schließen Sie alle geöffneten Tabs mit ${window.location.hostname} und versuchen Sie es erneut`,VOTFailedWriteToDB:"VOT: Daten konnten nicht in die Datenbank geschrieben werden",VOTFailedReadFromDB:"VOT: Konnte keine Daten aus der Datenbank abrufen",Russian:"Russisch",English:"Englisch",Chinese:"Chinesisch",French:"Französisch",Italian:"Italienisch",Spanish:"Spanisch",German:"Deutsch"},es:{recommended:"es recomendable",translateVideo:"Traducir video",disableTranslate:"Apagar",translationSettings:"Ajustes de traducción",resetSettings:"Restablecer ajustes",videoBeingTranslated:"El video está siendo traducido",videoLanguage:"Idioma del video",translationLanguage:"Idioma de la traducción",translationTake:"La traducción tardará",translationTakeMoreThanHour:"La traducción tardará más de una hora",translationTakeAboutMinute:"La traducción tardará aproximadamente un minuto",translationTakeFewMinutes:"La traducción tardará unos minutos",translationTakeApproximatelyMinutes:"La traducción tardará aproximadamente {0} minutos",translationTakeApproximatelyMinute:"La traducción tardará aproximadamente {0} minutos",unSupportedExtensionError:`Error! ${GM_info.scriptHandler} no es compatible con esta versión de la extensión!\n\nUtilice la versión cloudflare de la extensión VOT.`,requestTranslationFailed:"Error al solicitar la traducción de vídeo",audioNotReceived:"Audiolink nicht empfangen",grantPermissionToAutoPlay:"Conceder permiso de reproducción automática",neededAdditionalExtension:"Se necesita una extensión adicional para admitir este sitio",audioFormatNotSupported:"El formato de audio no es compatible",VOTAutoTranslate:"Traducir al abrir",VOTDontTranslateYourLang:"No traduzca de su lengua",VOTVolume:"Volumen de vídeo",VOTVolumeTranslation:"Volumen de traducción",VOTAutoSetVolume:"Reducir el volumen del video al ",VOTShowVideoSlider:"Deslizador de volumen de video",VOTSyncVolume:"Vincular el volumen de traducción y video",VOTAudioProxy:"Proxificar el audio recibido",VOTDisableFromYourLang:"VOT: Ha desactivado la traducción del vídeo en su idioma",VOTLiveNotSupported:"VOT: No se admite la traducción de transmisiones en vivo",VOTPremiere:"VOT: Espere a que termine el estreno antes de traducir",VOTVideoIsTooLong:"VOT: El video es demasiado largo",VOTNoVideoIDFound:"VOT: No se encontró id de video",VOTFailedInitDB:"VOT: No se pudo inicializar la base de datos",VOTDBNeedUpdate:"VOT: la Base de datos necesita una actualización, por favor vuelva a cargar la página",VOTDisabledForDBUpdating:`VOT está deshabilitado debido a un error al actualizar la Base de Datos. Cierre todas las pestañas abiertas con ${window.location.hostname} y vuelve a intentarlo`,VOTFailedWriteToDB:"VOT: No se pudo escribir datos en la base de datos",VOTFailedReadFromDB:"VOT: No se pudo recuperar datos de la base de datos",Russian:"Ruso",English:"Inglés",Chinese:"Chino",French:"Francés",Italian:"Italiano",Spanish:"Español",German:"Alemán"},fr:{recommended:"recommande",translateVideo:"Traduire la vidéo",disableTranslate:"Désactiver",translationSettings:"Paramètres de traduction",resetSettings:"Réinitialiser les paramètres",videoBeingTranslated:"La vidéo est en cours de traduction",videoLanguage:"Langue vidéo",translationLanguage:"Langue cible",translationTake:"La traduction prendra",translationTakeMoreThanHour:"La traduction prendra plus d'une heure",translationTakeAboutMinute:"La traduction prendra environ une minute",translationTakeFewMinutes:"La traduction prendra quelques minutes",translationTakeApproximatelyMinutes:"La traduction prendra environ {0} minutes",translationTakeApproximatelyMinute:"La traduction prendra environ {0} minutes",unSupportedExtensionError:`Erreur! ${GM_info.scriptHandler} n'est pas supporté par cette version de l'extension!!\n\nVeuillez utiliser la version cloudflare de l'extension VOT.`,requestTranslationFailed:"Impossible de demander la traduction de la vidéo",audioNotReceived:"Lien audio non reçu",grantPermissionToAutoPlay:"Accorder l'autorisation de lecture automatique",neededAdditionalExtension:"Une extension supplémentaire est nécessaire pour prendre en charge ce site",audioFormatNotSupported:"Format audio non pris en charge",VOTAutoTranslate:"Traduire à l'ouverture",VOTDontTranslateYourLang:"Ne pas traduire à partir de votre langue",VOTVolume:"Volume de la vidéo",VOTVolumeTranslation:"Volume de traduction",VOTAutoSetVolume:"Réduire le volume de la vidéo à ",VOTShowVideoSlider:"Curseur de volume vidéo",VOTSyncVolume:"Lier le volume de la traduction et de la vidéo",VOTAudioProxy:"Proxy audio reçu",VOTDisableFromYourLang:"VOT: Vous avez désactivé la traduction de la vidéo dans votre langue",VOTLiveNotSupported:"VOT: La traduction des flux en direct n'est pas prise en charge",VOTPremiere:"VOT: Attendez la fin de la première avant de traduire",VOTVideoIsTooLong:"VOT: La vidéo est trop longue",VOTNoVideoIDFound:"VOT: ID vidéo introuvable",VOTFailedInitDB:"VOT: Impossible d'initialiser la base de données",VOTDBNeedUpdate:"VOT: la Base de données a besoin d'une mise à jour, veuillez recharger la page",VOTDisabledForDBUpdating:`VOT est désactivé en raison d'une erreur lors de la mise à jour de la Base de Données. Fermez tous les onglets ouverts avec ${window.location.hostname} et essayez à nouveau`,VOTFailedWriteToDB:"VOT: Impossible d'écrire les données dans la base de données",VOTFailedReadFromDB:"VOT: Impossible de récupérer les données de la base de données",Russian:"Russe",English:"Anglais",Chinese:"Chinois",French:"Français",Italian:"Italien",Spanish:"Espagnol",German:"Allemand"},it:{recommended:"è consigliabile",translateVideo:"Traduci il video",disableTranslate:"Spegnere",translationSettings:"Impostazioni di traduzione",resetSettings:"Ripristina impostazioni",videoBeingTranslated:"Il video è in fase di traduzione",videoLanguage:"Lingua Video",translationLanguage:"Lingua di traduzione",translationTake:"La traduzione richiederà",translationTakeMoreThanHour:"La traduzione richiederà più di un'ora",translationTakeAboutMinute:"La traduzione richiederà circa un minuto",translationTakeFewMinutes:"La traduzione richiederà alcuni minuti",translationTakeApproximatelyMinutes:"La traduzione richiederà circa {0} minuti",translationTakeApproximatelyMinute:"La traduzione richiederà circa {0} minuti",unSupportedExtensionError:`Errore! ${GM_info.scriptHandler} non è supportato da questa versione dell'estensione!\n\nUtilizzare la versione cloudflare dell'estensione VOT.`,requestTranslationFailed:"Richiesta di traduzione video non riuscita",audioNotReceived:"Collegamento audio non ricevuto",grantPermissionToAutoPlay:"Concedere l'Autorizzazione per la riproduzione automatica",neededAdditionalExtension:"Per supportare questo sito è necessaria un'estensione aggiuntiva",audioFormatNotSupported:"Il formato audio non è supportato",VOTAutoTranslate:"Traduci all'apertura",VOTDontTranslateYourLang:"Non traducete dalla vostra lingua",VOTVolume:"Volume video",VOTVolumeTranslation:"Volume di traduzione",VOTAutoSetVolume:"Riduci il volume del video al ",VOTShowVideoSlider:"Cursore del volume del video",VOTSyncVolume:"Collega il volume della traduzione e del video",VOTAudioProxy:"Proxy audio ricevuto",VOTDisableFromYourLang:"VOT: Avete disabilitato la traduzione del video nella vostra lingua",VOTLiveNotSupported:"VOT: La traduzione dei flussi dal vivo non è supportata",VOTPremiere:"VOT: Aspetta che la prima finisca prima di tradurre",VOTVideoIsTooLong:"VOT: Il video è troppo lungo",VOTNoVideoIDFound:"VOT: ID video non trovato",VOTFailedInitDB:"VOT: Impossibile inizializzare il database",VOTDBNeedUpdate:"VOT: Il database ha bisogno di aggiornamento, si prega di ricaricare la pagina",VOTDisabledForDBUpdating:`VOT è disabilitato a causa di un errore durante l'aggiornamento del database. CHIUDI tutte le schede aperte con ${window.location.hostname} e riprova`,VOTFailedWriteToDB:"VOT: Impossibile scrivere dati nel database",VOTFailedReadFromDB:"VOT: Impossibile recuperare i dati dal database",Russian:"Russo",English:"Inglese",Chinese:"Cinese",French:"Francese",Italian:"Italiano",Spanish:"Spagnolo",German:"Tedesco"}},f={log:(...e)=>{},translations:e=>{}};let V=(navigator.language||navigator.userLanguage).substr(0,2).toLowerCase();function w(e){document.querySelector(".translationBtn").style.color=e}function O(e="none"){document.querySelector(".translationBtn").dataset.state=e}function S(e="none"){let t;switch(e){case"error":t="#7A7A7D";break;case"success":t="#A36EFF";break;default:t="#FFFFFF"}document.querySelector(".translateIcon").style.fill=t}function x(e="none",t){switch(e){case"error":S(e),w("#7A7A7D"),O(e);break;case"success":S(e),w("#A36EFF"),O(e);break;default:S("none"),w("#FFFFFF"),O("none")}document.querySelector(".translationBtn").innerText=t}function k(e,t,n){const a=document.createElement("div"),o=document.createElement("input"),i=document.createElement("label");return o.type="checkbox",o.id=e,o.checked=Boolean(t),i.htmlFor=e,i.innerHTML=n,a.classList.add("translationMenuContainer"),a.appendChild(o),a.appendChild(i),a}function L(e,t,n){const a=document.createElement("div"),o=document.createElement("input"),i=document.createElement("label");return o.type="range",o.id=e,o.classList.add("VOTMenuSlider"),o.min=0,o.max=100,o.value=t,i.htmlFor=e,i.classList.add("translationHeader"),i.innerHTML=n,a.classList.add("translationMenuContainer"),a.appendChild(i),a.appendChild(o),a}function F(e,t){const n=document.createElement("div"),a=document.createElement("select");a.id=e,a.classList.add("VOTMenuSelect");for(const e of t){const t=document.createElement("option");t.innerText=e.label,t.value=e.value,Object.prototype.hasOwnProperty.call(e,"selected")&&e.selected&&t.setAttribute("selected","selected"),Object.prototype.hasOwnProperty.call(e,"disabled")&&(t.disabled=e.disabled),a.appendChild(t)}return n.classList.add("translationMenuContainer"),n.appendChild(a),n}function D(e){return new Promise((t=>{const n=document.querySelector(e);if(n)return t(n);const a=new MutationObserver((()=>{const n=document.querySelector(e);n&&(t(n),a.disconnect())}));a.observe(document.body,{childList:!0,subtree:!0,once:!0})}))}V in b||(V="en"),String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,(function(t,n){return void 0!==e[n]?e[n]:t}))});const M=e=>new Promise((t=>setTimeout(t,e))),A=e=>{const t=new URL(window.location.href);switch(e){case"youtube":return t.pathname.match(/(?:watch|embed)\/([^/]+)/)?.[1]||t.searchParams.get("v");case"vk":return t.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)?t.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)[0].slice(1):t.searchParams.get("z")?t.searchParams.get("z").split("/")[0]:!(!t.searchParams.get("oid")||!t.searchParams.get("id"))&&`video-${Math.abs(t.searchParams.get("oid"))}_${t.searchParams.get("id")}`;case"9gag":case"gag":return t.pathname.match(/gag\/([^/]+)/)?.[1];case"twitch":if(/^m\.twitch\.tv$/.test(window.location.hostname)){const e=document.head.querySelector('link[rel="canonical"]');return e?.href.match(/videos\/([^/]+)/)?.[0]||t.pathname.slice(1)}if(/^player\.twitch\.tv$/.test(window.location.hostname))return`videos/${t.searchParams.get("video")}`;if(/^clips\.twitch\.tv$/.test(window.location.hostname)){const e=document.querySelector(".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']");return!!e&&`${e.href.replace("https://www.twitch.tv/","")}/clip/${t.searchParams.get("clip")}`}return t.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)?t.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)[0]:t.pathname.match(/(?:videos)\/([^/]+)/)?.[0];case"tiktok":return t.pathname.match(/video\/([^/]+)/)?.[1];case"vimeo":return t.pathname.match(/[^/]+\/[^/]+$/)?.[0]||t.pathname.match(/[^/]+$/)?.[0];case"xvideos":return t.pathname.match(/[^/]+\/[^/]+$/)?.[0];case"pornhub":return t.searchParams.get("viewkey")||t.pathname.match(/embed\/([^/]+)/)?.[1];case"twitter":return t.pathname.match(/status\/([^/]+)/)?.[1];case"udemy":case"facebook":return t.pathname;case"rutube":return t.pathname.match(/(?:video|embed)\/([^/]+)/)?.[1];case"coub":return t.pathname.match(/view\/([^/]+)/)?.[1];case"bilibili.com":const e=t.searchParams.get("bvid");if(e)return e;{let e=t.pathname.match(/video\/([^/]+)/)?.[1];return e&&t.search&&null!==t.searchParams.get("p")&&(e+=`/?p=${t.searchParams.get("p")}`),e}case"mail.ru":if(t.pathname.startsWith("/v/")||t.pathname.startsWith("/mail/"))return t.pathname;if(t.pathname.match(/video\/embed\/([^/]+)/)){const e=document.querySelector(".b-video-controls__mymail-link");return!!e&&e?.href.split("my.mail.ru")?.[1]}default:return!1}};var q=n("./src/config/config.js");const E=["invidious.snopyta.org","yewtu.be","invidious.kavin.rocks","vid.puffyan.us","invidious.namazso.eu","inv.riverside.rocks","yt.artemislena.eu","invidious.flokinet.to","invidious.esmailelbob.xyz","y.com.sb","invidious.nerdvpn.de","inv.vern.cc","invidious.slipfox.xyz","invidio.xamh.de","invidious.dhusch.de"],I=["piped.video","piped.tokhmi.xyz","piped.moomoo.me","piped.syncpundit.io","piped.mha.fi","watch.whatever.social","piped.garudalinux.org","efy.piped.pages.dev","watch.leptons.xyz","piped.lunar.icu","yt.dc09.ru","piped.mint.lgbt","il.ax","piped.privacy.com.de","piped.esmailelbob.xyz","piped.projectsegfau.lt","piped.in.projectsegfau.lt","piped.us.projectsegfau.lt","piped.privacydev.net","piped.palveluntarjoaja.eu","piped.smnz.de","piped.adminforge.de","piped.qdi.fi","piped.hostux.net","piped.chauvet.pro","piped.jotoma.de","piped.pfcd.me","piped.frontendfriendly.xyz"],P=2,B={key:"settings",autoTranslate:0,defaultVolume:100,showVideoSlider:0,syncVolume:0,autoSetVolumeYandexStyle:1,dontTranslateYourLang:1},z={audioProxy:0};function C(e){return indexedDB.open(e,P)}async function N(){return new Promise(((e,t)=>{const n=C("VOT");n.onerror=()=>{console.error(`${b[V].VOTFailedInitDB}: ${n.error.message}`),t(!1)},n.onupgradeneeded=a=>{const o=n.result;if(o.onerror=()=>{const e=b[V].VOTFailedInitDB;alert(e),console.error(e,n.error),t(!1)},a.oldVersion<1){const n=o.createObjectStore("settings",{keyPath:"key"});for(const e of Object.keys(B).filter((e=>"key"!==e)))n.createIndex(e,e,{unique:!1});console.log("VOT: Database Created"),n.transaction.oncomplete=n=>{const a=o.transaction("settings","readwrite").objectStore("settings").add(B);a.onsuccess=()=>{console.log("VOT: Standard settings added to the Database: ",a.result),e(!0)},a.onerror=()=>{console.log("VOT: Error when adding standard settings to the Database: ",a.error),t(!1)}}}a.oldVersion<2&&function(n,a,o,i={}){const r=n.objectStore("settings");for(const e of Object.keys(o))r.createIndex(e,e,{unique:!1});console.log("VOT: The database has been updated"),r.transaction.oncomplete=n=>{const r=a.transaction("settings","readwrite").objectStore("settings"),s=r.get("settings");s.onerror=e=>{console.error("VOT: Data could not be retrieved from the Database: ",e.error),t(!1)},s.onsuccess=()=>{const n=s.result||Object.assign(B,i);for(const e in o)n[e]=o[e];const a=r.put(n);a.onerror=e=>{console.error("VOT: Failed to update the Database to new version",e.error),t(!1)},a.onsuccess=()=>{console.log("VOT: Standard settings of the new version have been added to the Database."),e(!0)}}}}(n.transaction,o,z)},n.onsuccess=()=>{const a=n.result;a.onversionchange=()=>{a.close();const e=b[V].VOTDBNeedUpdate;alert(e),console.log(e),window.location.reload(),t(!1)},e(!0)},n.onblocked=()=>{const e=n.result,a=b[V].VOTDisabledForDBUpdating;console.error(a,e),alert(a),t(!1)}}))}async function R({autoTranslate:e,defaultVolume:t,showVideoSlider:n,syncVolume:a,autoSetVolumeYandexStyle:o,dontTranslateYourLang:i,audioProxy:r}){return new Promise(((s,l)=>{if("number"==typeof e||"number"==typeof t||"number"==typeof n||"number"==typeof a||"number"==typeof o||"number"==typeof i||"number"==typeof r){const d=C("VOT");d.onerror=()=>{const e=b[V].VOTFailedWriteToDB;alert(e),console.error(e,d.error.message),l(!1)},d.onupgradeneeded=async()=>{d.result.close(),await N(),s(!0)},d.onsuccess=()=>{const u=d.result;u.onversionchange=()=>{u.close(),console.log("VOT: The database needs an update, please reload the page if it didn't happen automatically"),window.location.reload(),l(!1)};const c=u.transaction("settings","readwrite").objectStore("settings"),p=c.get("settings");p.onerror=e=>{console.error("VOT: Data could not be retrieved from the Database: ",e.error),l(!1)},p.onsuccess=()=>{const d=p.result;"number"==typeof e&&(d.autoTranslate=e),"number"==typeof t&&(d.defaultVolume=t),"number"==typeof n&&(d.showVideoSlider=n),"number"==typeof a&&(d.syncVolume=a),"number"==typeof o&&(d.autoSetVolumeYandexStyle=o),"number"==typeof i&&(d.dontTranslateYourLang=i),"number"==typeof r&&(d.audioProxy=r);const u=c.put(d);u.onerror=e=>{console.error("VOT: Не удалось обновить данные в Базе Данных: ",e.error),l(!1)},u.onsuccess=()=>{s(!0)}}},d.onblocked=()=>{const e=d.result,t=b[V].VOTDisabledForDBUpdating;console.error(t,e),alert(t),l(!1)}}}))}function j(){indexedDB.deleteDatabase("VOT")}function $(e,t,n,a){let o;return t>a?(o=n+(t-a),o=o>100?100:Math.max(o,0),e.volume=o/100):t100?100:Math.max(o,0),e.volume=o/100),o}const _={youtubeRegex:/^(www.|m.)?youtube(-nocookie)?.com$/},H=".html5-video-container",U=".video-ref",Y="main > div > section > div > div > div",G=".shaka-video-container",W=".videoplayer_media",Z='div[data-testid="videoComponent"] > div:nth-child(1) > div',K=".player",J=".video-post",X=".bpx-player-video-wrap",Q="#b-video-wrapper",ee=[...E,...I];let te="";(async function(){f.log("Loading extension..."),f.log(`Selected menu language: ${V}`);const e=(await Promise.resolve().then(n.bind(n,"./src/rvt.js"))).default;if(f.log("Inited requestVideoTranslation..."),GM_info?.scriptHandler&&["Violentmonkey","FireMonkey","Greasemonkey","AdGuard"].includes(GM_info.scriptHandler)){const e=b[V].unSupportedExtensionError;return console.error(e),alert(e)}let t;f.log("Extension compatibility passed...");const a=new Audio;let o=.9,i=!1;function r(e){i||(document.querySelector(".translationBlock").style.opacity=e)}function s(){clearTimeout(t),r(1),t=setTimeout((()=>{r(0)}),2e3)}function l(e,t,n){clearTimeout(t),r(n),e.stopPropagation()}async function d(n,d,u){let c,p,m,g,w,O,S,D,M,E,I,P;f.log("[translateProccessor] execute on element: ",n);let B,z=!0,_="";f.log("videoContainer",n),c="vimeo"===d?n.querySelector(".vp-video-wrapper > .vp-video > .vp-telecine > video"):n.querySelector("video"),f.log("video",c);const H="pornhub"===d&&window.location.pathname.includes("view_video.php")?document.querySelector(".original.mainPlayerDiv"):"pornhub"===d&&window.location.pathname.includes("embed/")?document.querySelector("body"):window.location.hostname.includes("m.youtube.com")?document.querySelector("#player-control-container"):n;!function(e){if(!e||e.querySelector(".translationBlock"))return;const t=document.createElement("div");t.classList.add("translationBlock"),t.innerHTML=`\n \n \n \n \n \n \n ${b[V].translateVideo}\n \n \n \n \n \n \n `,e.appendChild(t),f.log("VOT: Added translation button to ",e)}(H),function(e){if(e.querySelector(".translationMenuContent"))return;const t=function(){const e=document.createElement("div");return e.classList.add("translationMenuContent"),e.innerHTML=`\n

${b[V].translationSettings}

\n
\n
\n \n \n \n \n \n \n
\n `,e.onclick=e=>e.stopPropagation(),e}();e.appendChild(t),document.querySelector(".translationMenu")?.addEventListener("click",(e=>{e.stopPropagation();const t=document.querySelector(".translationMenuContent");t.style.display=i?"none":"block",t.style.opacity=o,i=!i})),document.querySelector(".translationDropDB").addEventListener("click",(e=>{e.stopPropagation(),j(),location.reload()})),f.log("VOT: Added translation menu to ",e)}(H);try{B=await N()}catch(e){console.error("[VOT] Failed to initialize database settings. All changes made will not be saved",e)}const U=document.querySelector(".translationMenuOptions");if(U&&!U.querySelector("#VOTTranslateFromLang")){const e=[{label:b[V].videoLanguage,value:"default",disabled:!0},...Object.entries(v).map((([e,t])=>({label:b[V][t],value:e,selected:_.detectedLanguage===e})))],t=[{label:b[V].translationLanguage,value:"default",disabled:!0},...Object.entries(v).map((([e,t])=>({label:b[V][t],value:e,selected:_.responseLanguage===e})))],n=F("VOTTranslateFromLang",e),a=F("VOTTranslateToLang",t).firstElementChild;n.id="VOTSelectLanguages",n.innerHTML+='\n \n \n \n ',n.appendChild(a),U.appendChild(n),U.querySelector("#VOTTranslateFromLang").addEventListener("change",(async e=>{f.log("[onchange] select from language",e.target.value),await G(_,e.target.value)})),U.querySelector("#VOTTranslateToLang").addEventListener("change",(async e=>{f.log("[onchange] select to language",e.target.value),await W(_,e.target.value)}))}if(B){const e=await async function(){return new Promise(((e,t)=>{const n=C("VOT");n.onerror=()=>{const e=b[V].VOTFailedReadFromDB;alert(e),console.error(e,n.error.message),t(!1)},n.onupgradeneeded=async()=>{n.result.close(),await N(),e(!0)},n.onsuccess=()=>{const a=n.result;a.onversionchange=()=>{a.close();const e=b[V].VOTDBNeedUpdate;alert(e),console.error(e),t(!1)};const o=a.transaction("settings").objectStore("settings").get("settings");o.onerror=e=>{console.error(b[V].VOTFailedReadFromDB,e.error),console.error(e),t(!1)},o.onsuccess=()=>{void 0===o.result&&(a.close(),j(),t(!1));const n=o.result;e(n)}},n.onblocked=()=>{const e=n.result,a=b[V].VOTDisabledForDBUpdating;console.error(a,e),alert(a),t(!1)}}))}();if(e){if(O=e.autoTranslate,S=e.defaultVolume,D=e.showVideoSlider,M=e.autoSetVolumeYandexStyle,E=e.dontTranslateYourLang,P=e.audioProxy,I=e.syncVolume,f.log("[db] data from db: ",e),void 0!==O&&U&&!U.querySelector("#VOTAutoTranslate")){const e=k("VOTAutoTranslate",O,b[V].VOTAutoTranslate+("vk"===d||window.location.hostname.includes("m.twitch.tv")?` (${b[V].recommended})`:""));e.querySelector("#VOTAutoTranslate").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({autoTranslate:t}),O=t,f.log("autoTranslate value changed. New value: ",O)},U.appendChild(e)}if(window.location.hostname.includes("youtube.com")&&void 0!==E&&U&&!U.querySelector("#VOTDontTranslateYourLang")){const e=k("VOTDontTranslateYourLang",E,b[V].VOTDontTranslateYourLang);e.querySelector("#VOTDontTranslateYourLang").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({dontTranslateYourLang:t}),E=t,f.log("dontTranslateYourLang value changed. New value: ",E)},U.appendChild(e)}if(void 0!==M&&U&&!U.querySelector("#VOTAutoSetVolume")){const e=k("VOTAutoSetVolume",M,b[V].VOTAutoSetVolume+(100*q.IM+"%"));e.querySelector("#VOTAutoSetVolume").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({autoSetVolumeYandexStyle:t}),M=t,f.log("autoSetVolumeYandexStyle value changed. New value: ",M)},U.appendChild(e)}if(void 0!==D&&U&&!U.querySelector("#VOTShowVideoSlider")){const e=k("VOTShowVideoSlider",D,b[V].VOTShowVideoSlider);e.querySelector("#VOTShowVideoSlider").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({showVideoSlider:t}),D=t,f.log("showVideoSlider value changed. New value: ",D),1===D&&"success"===document.querySelector(".translationBtn").dataset.state?X():document.querySelector("#VOTVideoSlider")?.parentElement.remove()},U.appendChild(e)}if(window.location.hostname.includes("youtube.com")&&!window.location.hostname.includes("m.youtube.com")&&void 0!==I&&U&&!U.querySelector("#VOTSyncVolume")){const e=k("VOTSyncVolume",I,b[V].VOTSyncVolume);e.querySelector("#VOTSyncVolume").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({syncVolume:t}),I=t,f.log("syncVolume value changed. New value: ",I)},U.appendChild(e)}}}async function Y(e,t,n){document.querySelector("#VOTSelectLanguages")&&(console.log(`Set translation from ${t} to ${n}`),document.querySelector("#VOTTranslateFromLang").value=t,document.querySelector("#VOTTranslateToLang").value=n,e.responseLanguage=n)}async function G(e,t){return e.detectedLanguage=t,e.responseLanguage=V,Object.keys(v).includes(t)?(await Y(e,e.detectedLanguage,e.responseLanguage),e):G(e,"en")}async function W(e,t){if("en"===t)e.responseLanguage=t,"ru"==V&&(e.detectedLanguage="ru");else{if(!Object.keys(v).includes(t))return W(e,"ru");e.detectedLanguage&&e.responseLanguage===V&&(e.detectedLanguage="en"),e.responseLanguage=t||V}return await Y(e,e.detectedLanguage,e.responseLanguage),e}async function Z(){a.pause(),c.removeEventListener(".translate",Z,!1),await(async()=>{a.src="",a.removeAttribute("src")})(),document.querySelector("#VOTVideoSlider")?.parentElement.remove(),document.querySelector("#VOTTranslationSlider")?.parentElement.remove();const e=document.querySelector(".translationDownload");e.href="",e.style.display="none",x("none",b[V].translateVideo),m&&(c.volume=m)}async function K(){const e=document.querySelector(".ytp-volume-panel").getAttribute("aria-valuenow"),t=document.querySelector("#VOTVideoSlider");if(!t)return;t.value=e;const n=document.querySelector("#VOTVideoVolume");n&&(n.innerText=`${e}%`),1===I&&(g=Number(e))}x("none",b[V].translateVideo),window.location.hostname.includes("youtube.com")&&!window.location.hostname.includes("m.youtube.com")&&new MutationObserver((async function(e){e.forEach((async function(e){"attributes"===e.type&&"aria-valuenow"===e.attributeName&&document.querySelector("#VOTVideoSlider")&&K()}))})).observe(document.querySelector(".ytp-volume-panel"),{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0});const J=async(e=!1)=>{if(f.log("lipsync video",c),c)if(a.currentTime=c.currentTime,a.playbackRate=c.playbackRate,e)if("play"!==e)"pause"===e&&(f.log("lipsync mode is pause"),a.pause()),"stop"===e&&(f.log("lipsync mode is stop"),a.pause()),"waiting"===e&&(f.log("lipsync mode is waiting"),a.pause()),"playing"===e&&(f.log("lipsync mode is playing"),a.play());else{f.log("lipsync mode is play");const e=a.play();void 0!==e&&e.catch((e=>{if(console.error(e),"NotAllowedError"===e.name){const e=b[V].grantPermissionToAutoPlay;throw x("error",e),`VOT: ${e}`}if("NotSupportedError"===e.name){const e=ee.includes(window.location.hostname)?b[V].neededAdditionalExtension:b[V].audioFormatNotSupported;throw x("error",e),`VOT: ${e}`}}))}else f.log("lipsync mode is not set")};async function X(){if(1!==D||document.querySelector("#VOTVideoSlider")||"success"!==document.querySelector(".translationBtn").dataset.state)return;const e=window.location.hostname.includes("youtube.com")&&!M?document.querySelector(".ytp-volume-panel")?.getAttribute("aria-valuenow"):Math.round(100*c.volume);g=e;const t=L("VOTVideoSlider",e,`${b[V].VOTVolume}: ${e}%`);t.querySelector("#VOTVideoSlider").oninput=async e=>{const{value:n}=e.target;if(c.volume=n/100,t.querySelector("#VOTOriginalVolume").innerText=`${n}%`,1!==I)return;const o=document.querySelector("#VOTTranslationSlider");if(!o)return;const i=Number(o.value),r=$(a,n,i,g);o.value=r;const s=document.querySelector("#VOTTranslationVolume");s&&(s.innerText=`${r}%`),w=r,g=n},document.querySelector(".translationMenuOptions").appendChild(t)}const Q=async e=>{_.detectedLanguage||(_=await async function(){const e={};return e.duration=c?.duration||0,e.videoId=A(d),e.detectedLanguage="en",e.responseLanguage="ru",window.location.hostname.includes("youtube.com")?(te=await async function(){const e=document.querySelector("#movie_player"),t=e.getVideoData(),n=e.getPlayerResponse(),{isLive:a,isPremiere:o,title:i,author:r}=t,{shortDescription:s}=n?.videoDetails??{},l={isLive:a,isPremiere:o,title:i,description:s,author:r,detectedLanguage:await h(e,n,i,s,r)};return console.log("VOT Detected language: ",l.detectedLanguage),l}(),""!==te.author&&(te=await G(te,te.detectedLanguage),e.detectedLanguage=te.detectedLanguage)):window.location.hostname.includes("rutube")||window.location.hostname.includes("my.mail.ru")?(e.detectedLanguage="ru",e.responseLanguage="en"):window.location.hostname.includes("bilibili.com")&&(e.detectedLanguage="zh"),e}()),f.log("Run videoValidator"),await async function(){if(window.location.hostname.includes("youtube.com")){if(f.log("VideoValidator videoData: ",_),1===E&&_.detectedLanguage===V&&_.responseLanguage===V)throw b[V].VOTDisableFromYourLang;if(te.isLive)throw b[V].VOTLiveNotSupported;if(te.isPremiere)throw b[V].VOTPremiere;if(_.duration>14400)throw b[V].VOTVideoIsTooLong}return!0}(),f.log("Run translateFunc"),await oe(e,_.detectedLanguage,_.responseLanguage)};async function ne(e){f.log(`video ${e.type}`),await J(e.type)}async function ae(){await Z(),await K()}async function oe(t,o,i){console.log("VOT Video Data: ",_);const r=`${y[d]}${t}`;await async function(t,n,a,o,i){f.log(`Translate video (url: ${t}, unknown1: ${n}, requestLang: ${a}, responseLang: ${o})`),await e(t,n,a,o,((e,t)=>{if(f.log("[exec callback] Requesting video translation"),!e)return void i(!1,b[V].requestTranslationFailed);const n=T.G.decodeResponse(t);switch(console.log("VOT Response: ",n),n.status){case 0:i(!1,n.message);break;case 1:i(!!n.url,n.url||b[V].audioNotReceived);break;case 2:i(!1,n.remainingTime?function(e){const t=Math.floor(e/60),n=Math.floor(e%60);return t>=60?b[V].translationTakeMoreThanHour:t>=10&&t%10?b[V].translationTakeApproximatelyMinutes.format(t):1==t||0==t&&n>0?b[V].translationTakeAboutMinute:b[V].translationTakeApproximatelyMinute.format(t)}(n.remainingTime):b[V].translationTakeFewMinutes);break;case 3:i(!1,b[V].videoBeingTranslated)}}))}(r,0x4075500000000000,o,i,(async(e,r)=>{if(f.log("[exec callback] translateVideo"),A(d)!==t)return;if(!e)throw x("error",r),r.includes(b[V].translationTake)&&(clearTimeout(p),p=setTimeout((()=>oe(t,o,i)),6e4)),r;switch(a.src=r,m=c?.volume,"number"==typeof S&&(a.volume=S/100),"number"==typeof M&&M&&(c.volume=q.IM),d){case"twitter":document.querySelector('div[data-testid="app-bar-back"][role="button"]').addEventListener("click",ae);break;case"invidious":case"piped":break;default:null!==u&&document.body.addEventListener(u,ae)}const s=["twitch","vimeo","facebook","rutube","twitter","bilibili.com","mail.ru"];for(let e=0;e{e.forEach((async e=>{"attributes"===e.type&&"src"===e.attributeName&&e.target===c&&""!==e.target.src&&(ae(),z=!0)}))})).observe(n,{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0});break}c&&!c.paused&&J("play");const l=document.querySelectorAll("video"),h=["playing","ratechange","play","waiting","pause"];l.forEach((e=>h.forEach((t=>e.addEventListener(t,ne))))),x("success",b[V].disableTranslate),await X(),await async function(){if(document.querySelector("#VOTTranslationSlider")||"success"!==document.querySelector(".translationBtn").dataset.state)return;const e="number"==typeof S?S:100;g=e;const t=L("VOTTranslationSlider",e,`${b[V].VOTVolumeTranslation}: ${e}%`);t.querySelector("#VOTTranslationSlider").oninput=async({target:{value:e}})=>{a.volume=e/100,document.querySelector("#VOTTranslationVolume").innerText=`${e}%`,await R({defaultVolume:Number(e)}),S=Number(e),1===I&&await async function(e){const t=document.querySelector("#VOTVideoSlider");if(!t)return;const n=Number(t.value),a=$(c,e,n,w);t.value=a;const o=document.querySelector("#VOTOriginalVolume");o&&(o.innerText=`${a}%`),g=a,w=e}(e)},document.querySelector(".translationMenuOptions").appendChild(t)}();const T=document.querySelector("#VOTVideoSlider");T&&(T.value=100*q.IM);const v=document.querySelector("#VOTOriginalVolume");v&&(v.innerText=100*q.IM+"%");const y=document.querySelector(".translationDownload");y.href=r,y.style.display="initial"}))}document.addEventListener("click",(async e=>{const t=document.querySelector(".translationBlock"),a=document.querySelector(".translationMenuContent"),o=!(!t&&e.target!==t)&&t.contains(e.target),s=!(!a&&e.target!==a)&&a.contains(e.target),l=!(!n&&e.target!==n)&&n.contains(e.target);f.log(`[document click] ${o} ${s} ${l}`),o||s||(l||r(0),a.style.display="none",i=!1)}));const ie=(e,t,n)=>{t.forEach((t=>e.addEventListener(t,(async e=>{await n(e)}))))};"pornhub"===d?window.location.pathname.includes("view_video.php")?ie(document.querySelector(".original.mainPlayerDiv > video-element > div"),["mousemove","mouseout"],s):window.location.pathname.includes("embed/")&&ie(document.querySelector("#player"),["mousemove","mouseout"],s):ie("twitter"===d?document.querySelector('div[data-testid="videoPlayer"'):n,["mousemove","mouseout"],s),document.querySelector(".translationBlock").addEventListener("mousemove",(e=>l(e,t,o))),document.querySelector(".translationMenuContent").addEventListener("mousemove",(e=>l(e,t,o))),document.addEventListener("touchstart",(e=>l(e,t,o))),document.addEventListener("touchmove",(e=>l(e,t,o))),document.addEventListener("touchend",(e=>l(e,t,o))),document.querySelectorAll("video").forEach((e=>{e.addEventListener("abort",(async()=>{f.log("lipsync mode is abort"),_.detectedLanguage="",await ae()}))})),document.querySelector(".translationBtn").addEventListener("click",(async e=>{if(f.log("[click translationBtn] before all functions & methods"),e.stopPropagation(),e.stopImmediatePropagation(),a.src)return f.log("[click translationBtn] audio.src is not empty"),_.detectedLanguage="",void await Z();try{f.log("[click translationBtn] trying execute translation");const e=A(d);if(!e)throw b[V].VOTNoVideoIDFound;await Q(e)}catch(e){x("error",String(e).substring(4,e.length)),console.error(e)}})),c.addEventListener("progress",(async e=>{if(e.stopPropagation(),!z||1!==O)return;const t=A(d);if(!t)throw b[V].VOTNoVideoIDFound;try{await Q(t),z=!1}catch(e){x("error",String(e).substring(4,e.length)),z=!1}}))}await async function(){if(f.log("Runned initWebsite function"),_.youtubeRegex.test(window.location.hostname)){if(window.location.pathname.includes("embed")){const e=document.querySelector(".html5-video-container");return void await d(e,"youtube",null)}f.log("[initWebsite] Found a match with youtube hostname");const e=()=>{const e=document.querySelector(H);if(e)f.log("[exec] translateProccessor youtube on page enter"),d(e,"youtube","yt-translate-stop");else{if(!ytplayer||!ytplayer.config)return void f.log("[exec] ytplayer is null");ytplayer.config.args.jsapicallback=()=>{f.log("[exec] translateProccessor youtube on page enter (ytplayer.config.args.jsapicallback)"),d(e,"youtube","yt-translate-stop")}}};document.addEventListener("spfdone",e),document.addEventListener("yt-navigate-finish",e);const t=async()=>{document.body.dispatchEvent(new Event("yt-translate-stop"))};if(document.addEventListener("spfrequest",t),document.addEventListener("yt-navigate-start",t),window.location.hostname.includes("m.youtube.com")){let e=await D("#player");e&&(await M(1e3),await d(e,"youtube","yt-translate-stop"),new MutationObserver((async t=>{for(const n of t)"attributes"===n.type&&"src"===n.attributeName&&(e=await D("#player"),await M(1e3),await d(e,"youtube","yt-translate-stop"))})).observe(e,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0}));const t=async()=>{document.body.dispatchEvent(new Event("yt-translate-stop"))};document.addEventListener("spfdone",t),document.addEventListener("yt-navigate-finish",t),document.addEventListener("spfrequest",t),document.addEventListener("yt-navigate-start",t)}}else if(window.location.hostname.includes("twitch.tv")){if(f.log("[initWebsite] Found a match with twitch.tv"),window.location.hostname.includes("m.twitch.tv")&&(window.location.pathname.includes("/videos/")||window.location.pathname.includes("/clip/"))){if(f.log("[initWebsite] Matched Twitch Mobile"),await D(Y)){await M(200);const e=document.querySelector(Y);await d(e,"twitch",null),new MutationObserver((async t=>{for(const n of t)"attributes"===n.type&&"src"===n.attributeName&&n.target===e?.querySelector("video")&&(await M(1e3),await d(e,"twitch",null))})).observe(e,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})}}else if(window.location.hostname.includes("player.twitch.tv")||window.location.hostname.includes("clips.twitch.tv")||window.location.pathname.includes("/videos/")||window.location.pathname.includes("/clip/")){f.log("[initWebsite] Matched Twitch Desktop");const e=await D(U);e&&(await M(200),await d(e,"twitch",null))}f.log("[initWebsite] Exit function in the twitch section")}else{if(window.location.hostname.includes("xvideos.com"))return f.log("[entered] xvideos"),await M(1e3),void await d(document.querySelector(".video-bg-pic"),"xvideos",null);if(window.location.hostname.includes("pornhub.com"))return f.log("[entered] pornhub"),await M(1e3),void await d(document.querySelector(".mgp_videoWrapper"),"pornhub",null);if(E.includes(window.location.hostname))f.log("[entered] invidious"),await d(document.querySelector("#player"),"youtube",null);else if(I.includes(window.location.hostname)){f.log("[entered] piped");const e=await D(G);if(e){let t,n=A("youtube");await d(e,"youtube","piped"),setInterval((async()=>{t=A("youtube"),n!==t&&(t&&await d(document.querySelector(G),"youtube","piped"),n=t)}),3e3)}}else if(/^(www.|m.)?vk.(com|ru)$/.test(window.location.hostname)){if(f.log("[entered] vk.com"),await D(W)){let e;await d(document.querySelector(W),"vk",null);let t=A("vk");setInterval((async()=>{if(e=A("vk"),t!==e){if(e){const e=await D(W);e&&await d(e,"vk",null)}t=e}}),3e3)}}else if(window.location.hostname.includes("vimeo.com"))f.log("[entered] vimeo.com"),await D(K)&&(await M(1e3),await d(document.querySelector(K),"vimeo",null));else if(window.location.hostname.includes("9gag.com"))await M(1e3),await d(document.querySelector(J),"9gag",null);else if(window.location.hostname.includes("coub.com"))await M(1e3),await d(document.querySelector(".viewer__player"),"coub",null);else if(window.location.hostname.includes("rutube.ru")){const e=window.location.pathname.includes("/play/embed")?"#app > div > div":".video-player > div > div > div:nth-child(2)",t=await D(e);t&&await d(t,"rutube",null)}else if(window.location.hostname.includes("bilibili.com")){if(window.location.pathname.includes("/video/")){const e=await D(X);e&&await d(e,"bilibili.com",null)}else if(window.location.pathname.includes("/blackboard/webplayer/embed-old.html")){const e=await D("video");e&&await d(e.parentElement,"bilibili.com",null)}}else if(window.location.hostname.includes("twitter.com")){const e=await D(Z);if(e){let t,n=A("twitter");await d(e,"twitter",null),setInterval((async()=>{t=A("twitter"),n!==t&&(t&&await d(document.querySelector(Z),"twitter",null),n=t)}),3e3)}}else if(window.location.hostname.includes("my.mail.ru")){const e=await D(Q);if(e){let t,n=A("mail.ru");await d(e,"mail.ru",null),setInterval((async()=>{t=A("mail.ru"),n!==t&&(t&&await d(document.querySelector(Q),"mail.ru",null),n=t)}),3e3)}}}}()})().catch((e=>{console.error(e)}))})()})(); \ No newline at end of file +(()=>{"use strict";var e={"./node_modules/css-loader/dist/cjs.js!./src/styles/main.css":(e,t,n)=>{n.d(t,{Z:()=>s});var a=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),o=n.n(a),i=n("./node_modules/css-loader/dist/runtime/api.js"),r=n.n(i)()(o());r.push([e.id,'.translationBlock {\n padding: 0.45rem !important;\n width: max-content;\n position: absolute;\n background: #2e2f34;\n border-radius: 0.5rem !important;\n left: 50%;\n top: 5rem;\n transform: translate(-50%);\n text-align: center;\n opacity: 0;\n transition: opacity 1s;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n z-index: 100;\n}\n\n.translationBtn {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n color: #fff;\n padding-right: 0.25rem !important;\n cursor: pointer;\n font: 600 12px / 14px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif;\n}\n\n.translationBlock:hover {\n opacity: 1;\n}\n\n.translationMenu {\n display: inline-block;\n vertical-align: middle;\n border-left: 1px solid #424348;\n max-height: 16px;\n max-width: 24px;\n cursor: pointer;\n}\n\n.translationMenuIcon {\n padding: 0 10px !important;\n width: 24px;\n}\n\n.translationIAlice {\n display: inline-block;\n vertical-align: middle;\n max-height: 26px;\n max-width: 50px;\n}\n\n.translationIconAlice {\n height: 24px !important;\n width: 24px !important;\n}\n\n.translationITranslate {\n display: inline-block;\n vertical-align: middle;\n max-height: 20px;\n max-width: 20px;\n}\n\n.translationMenuContent {\n position: absolute;\n background: #2e2f34;\n color: #fff;\n display: none;\n border-radius: 1rem !important;\n left: 50%;\n top: 10rem;\n transform: translate(-50%);\n text-align: left;\n font: 600 14px / 16px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif !important;\n\n width: 300px;\n /* height: 375px; */\n opacity: 0;\n z-index: 100;\n transition: opacity 0.5s ease;\n}\n\n.VOTMenuSlider {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 268px !important;\n height: 8px !important;\n outline: none !important;\n margin-top: 0.5rem;\n opacity: 0.7;\n /* background: #3C3F4D !important; */\n background: rgb(253, 222, 85, 0.6) !important;\n border: none !important;\n border-radius: 2rem !important;\n -webkit-transition: 0.2s !important;\n transition: opacity 0.2s ease !important;\n}\n\n.VOTMenuSlider:hover {\n opacity: 1;\n}\n\n.VOTMenuSlider::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-moz-range-thumb {\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-ms-thumb {\n width: 10px !important;\n height: 10px !important;\n border-radius: 50% !important;\n border: none !important;\n background: #fff !important;\n cursor: pointer !important;\n}\n\n.VOTMenuSlider::-ms-fill-lower {\n height: 8px !important;\n border-radius: 2rem !important;\n background: linear-gradient(\n 90.1deg,\n rgba(186, 153, 244, 0.85) -5.78%,\n rgba(236, 138, 202, 0.7) 56.46%,\n rgba(239, 168, 117, 0.6) 108.93%\n ) !important;\n}\n\n.VOTMenuSlider::-moz-range-progress {\n height: 8px !important;\n border-radius: 2rem !important;\n background: linear-gradient(\n 90.1deg,\n rgba(186, 153, 244, 0.85) -5.78%,\n rgba(236, 138, 202, 0.7) 56.46%,\n rgba(239, 168, 117, 0.6) 108.93%\n ) !important;\n}\n\n.translationHeader {\n padding-bottom: 0.5rem !important;\n}\n\n.translationMainHeader {\n margin: 16px !important;\n color: #fff;\n font: 900 14px / 16px "Segoe UI", BlinkMacSystemFont, Arial, sans-serif !important;\n}\n\n.translationMenuOptions {\n display: flex;\n flex-flow: column wrap;\n}\n\n.translationMenuContainer {\n /* width: 100%; */\n padding-left: 16px !important;\n padding-top: 5px !important;\n display: inline-block !important;\n}\n\n.translationMenuContainer > input {\n appearance: auto !important;\n vertical-align: text-bottom;\n}\n\n.translationMenuText {\n color: #fff;\n display: inline-flex;\n width: 80%;\n}\n\n.translationVolumeBox,\n.translationVideoVolumeBox {\n padding-top: 0.5rem !important;\n}\n\n.translationDropDB {\n border: none !important;\n border-radius: 4px !important;\n background: #5426ff !important;\n color: #fff !important;\n padding: 6px 16px !important;\n margin-left: auto !important;\n cursor: pointer !important;\n}\n\n.translationDownload {\n background: #5426ff !important;\n color: #fff !important;\n padding: 2px 10px !important;\n border-radius: 4px !important;\n cursor: pointer;\n display: none;\n}\n\n.translationMenuFunctional {\n display: flex;\n margin: 16px !important;\n}\n\n.VOTMenuSelect {\n width: 110px;\n border-radius: 5px !important;\n border: 1px solid #dadce0 !important;\n box-shadow: 0 1px 3px -2px #9098a9;\n box-sizing: border-box !important;\n color: #2e2f34 !important;\n background: #fff !important;\n padding: 5px !important;\n}\n\n.VOTMenuSelect:focus {\n outline: none;\n}\n\n.VOTMenuSelect:focus {\n outline: none;\n border-color: #0077ff;\n box-shadow: 0 0 0 2px rgba(#0077ff, 0.2);\n}\n\n#VOTSelectLanguages {\n display: flex !important;\n margin-left: 5px;\n}\n\n#VOTSelectLanguages svg {\n margin: 0 5px;\n}\n',""]);const s=r},"./node_modules/css-loader/dist/runtime/api.js":e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",a=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),a&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),a&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,a,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(a)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":e=>{e.exports=function(e){return e[1]}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":e=>{var t=[];function n(e){for(var n=-1,a=0;a{var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},"./node_modules/style-loader/dist/runtime/insertStyleElement.js":e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a="";n.supports&&(a+="@supports (".concat(n.supports,") {")),n.media&&(a+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(a+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),a+=n.css,o&&(a+="}"),n.media&&(a+="}"),n.supports&&(a+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(a,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},"./src/config/config.js":(e,t,n)=>{n.d(t,{I1:()=>o,IM:()=>r,Rr:()=>i,iF:()=>a});const a="api.browser.yandex.ru",o="gnnde87s24kcuMH8rbWhLyfeuEKDkGGm",i="Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 CriOS/104.0.5112.114 YaBrowser/22.9.4.633.10 SA/3 Mobile/15E148 Safari/604.1",r=.15},"./src/rvt.js":(e,t,n)=>{function a(e){const t=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)));return e?t:t.toUpperCase()}n.r(t),n.d(t,{default:()=>r});var o=n("./src/yandexRequests.js"),i=n("./src/config/config.js");const r=async function(e,t,n,r,s){const l=a(!0),d=o.G.encodeRequest(e,l,t,n,r);try{const e=new TextEncoder("utf-8"),t=await window.crypto.subtle.importKey("raw",e.encode(i.I1),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),n=await window.crypto.subtle.sign("HMAC",t,d),o=Array.from(new Uint8Array(n),(e=>e.toString(16).padStart(2,"0"))).join(""),r={url:`https://${i.iF}/video-translation/translate`,method:"POST",headers:{Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf","User-Agent":i.Rr,Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors","sec-ch-ua":null,"sec-ch-ua-mobile":null,"sec-ch-ua-platform":null,"Vtrans-Signature":o,"Sec-Vtrans-Token":a(!1)},data:String.fromCharCode(...d),responseType:"arraybuffer"};GM_xmlhttpRequest({...r,onload:e=>{s(200===e.status,e.response)},onerror:e=>{s(!1)}})}catch(e){s(!1)}}},"./src/yandexRequests.js":(e,t,n)=>{n.d(t,{G:()=>r});const a=new protobuf.Type("VideoTranslationRequest").add(new protobuf.Field("url",3,"string")).add(new protobuf.Field("deviceId",4,"string")).add(new protobuf.Field("firstRequest",5,"bool")).add(new protobuf.Field("unknown1",6,"fixed64")).add(new protobuf.Field("unknown2",7,"int32")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("unknown3",9,"int32")).add(new protobuf.Field("unknown4",10,"int32")).add(new protobuf.Field("translationHelp",11,"int32")).add(new protobuf.Field("responseLanguage",14,"string")),o=new protobuf.Type("VideoTranslationResponse").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("duration",2,"double")).add(new protobuf.Field("status",4,"int32")).add(new protobuf.Field("remainingTime",5,"int32")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("message",9,"string")),i=(new protobuf.Root).define("yandex").add(a).add(o),r={encodeRequest:(e,t,n,a,o)=>i.VideoTranslationRequest.encode({url:e,deviceId:t,firstRequest:!0,unknown1:n,unknown2:1,language:a,unknown3:0,unknown4:0,responseLanguage:o}).finish(),decodeResponse:e=>i.VideoTranslationResponse.decode(new Uint8Array(e))}}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var i=t[a]={id:a,exports:{}};return e[a](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,(()=>{var e=n("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),t=n.n(e),a=n("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),o=n.n(a),i=n("./node_modules/style-loader/dist/runtime/insertBySelector.js"),r=n.n(i),s=n("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),l=n.n(s),d=n("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),u=n.n(d),c=n("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),p=n.n(c),m=n("./node_modules/css-loader/dist/cjs.js!./src/styles/main.css"),g={};async function h(e,t,n,a,o){if(!window.location.hostname.includes("m.youtube.com")){const t=e.getAudioTrack(),n=t?.getLanguageInfo();if("und"!==n?.id)return n.id.split(".")[0]}const i=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(i?.length){const e=i.find((e=>"asr"===e.kind));if(e)return e.languageCode}const r=[n,a,o].join(" ").replace(/https?:\/\/\S+/g,"").replace(/[^\p{L}\s]/gu,"").trim().slice(0,250);return await async function(e){const t=await fetch("https://rust-server-531j.onrender.com/detect",{method:"POST",body:e});return await t.text()}(r)}g.styleTagTransform=p(),g.setAttributes=l(),g.insert=r().bind(null,"head"),g.domAPI=o(),g.insertStyleElement=u(),t()(m.Z,g),m.Z&&m.Z.locals&&m.Z.locals;var T=n("./src/yandexRequests.js");const v={ru:"Russian",en:"English",zh:"Chinese",fr:"French",it:"Italian",es:"Spanish",de:"German"},y={youtube:"https://youtu.be/",twitch:"https://twitch.tv/",vimeo:"https://vimeo.com/","9gag":"https://9gag.com/gag/",vk:"https://vk.com/video?z=",xvideos:"https://www.xvideos.com/",pornhub:"https://rt.pornhub.com/view_video.php?viewkey=",udemy:"https://www.udemy.com",twitter:"https://twitter.com/i/status/",facebook:"https://www.facebook.com/",rutube:"https://rutube.ru/video/","bilibili.com":"https://www.bilibili.com/video/","mail.ru":"https://my.mail.ru/",coub:"https://coub.com/view/"},b={ru:{recommended:"рекомендуется",translateVideo:"Перевести видео",disableTranslate:"Выключить",translationSettings:"Настройки перевода",resetSettings:"Сбросить настройки",videoBeingTranslated:"Видео переводится",videoLanguage:"Язык видео",translationLanguage:"Язык перевода",translationTake:"Перевод займёт",translationTakeMoreThanHour:"Перевод займёт больше часа",translationTakeAboutMinute:"Перевод займёт около минуты",translationTakeFewMinutes:"Перевод займёт несколько минут",translationTakeApproximatelyMinutes:"Перевод займёт примерно {0} минут",translationTakeApproximatelyMinute:"Перевод займёт примерно {0} минуты",unSupportedExtensionError:`Ошибка! ${GM_info.scriptHandler} не поддерживается этой версией расширения!\n\nПожалуйста, используйте cloudflare-версию расширения VOT.`,requestTranslationFailed:"Не удалось запросить перевод видео",audioNotReceived:"Не получена ссылка на аудио",grantPermissionToAutoPlay:"Предоставьте разрешение на автовоспроизведение",neededAdditionalExtension:"Для поддержки этого сайта необходимо дополнительное расширение",audioFormatNotSupported:"Формат аудио не поддерживается",VOTAutoTranslate:"Переводить при открытии",VOTDontTranslateYourLang:"Не переводить с родного языка",VOTVolume:"Громкость видео",VOTVolumeTranslation:"Громкость перевода",VOTAutoSetVolume:"Уменьшать громкость видео до ",VOTShowVideoSlider:"Слайдер громкости видео",VOTSyncVolume:"Связать громкость перевода и видео",VOTAudioProxy:"Проксировать полученное аудио",VOTDisableFromYourLang:"VOT: Вы отключили перевод видео на вашем языке",VOTLiveNotSupported:"VOT: Не поддерживается перевод трансляций в прямом эфире",VOTPremiere:"VOT: Дождитесь окончания премьеры перед переводом",VOTVideoIsTooLong:"VOT: Видео слишком длинное",VOTNoVideoIDFound:"VOT: Не найдено ID видео",VOTFailedInitDB:"VOT: Не удалось инициализовать базу данных",VOTDBNeedUpdate:"VOT: Базе данных нужно обновление, пожалуйста, перезагрузите страницу",VOTDisabledForDBUpdating:`VOT отключен из-за ошибки при обновление Базы Данных. Закройте все открытые вкладки с ${window.location.hostname} и попробуйте снова`,VOTFailedWriteToDB:"VOT: Не удалось записать данные в базу данных",VOTFailedReadFromDB:"VOT: Не удалось получить данные из базы данных",Russian:"Русский",English:"Английский",Chinese:"Китайский",French:"Французский",Italian:"Итальянский",Spanish:"Испанский",German:"Немецкий"},en:{recommended:"recommended",translateVideo:"Translate video",disableTranslate:"Turn off",translationSettings:"Translation settings",resetSettings:"Reset settings",videoBeingTranslated:"The video is being translated",videoLanguage:"Video language",translationLanguage:"Translation language",translationTake:"The translation will take",translationTakeMoreThanHour:"The translation will take more than an hour",translationTakeAboutMinute:"The translation will take about a minute",translationTakeFewMinutes:"The translation will take a few minutes",translationTakeApproximatelyMinutes:"The translation will take approximately {0} minutes",translationTakeApproximatelyMinute:"The translation will take approximately {0} minutes",unSupportedExtensionError:`Error! ${GM_info.scriptHandler} is not supported by this version of the extension!\n\nPlease use the cloudflare version of the VOT extension.`,requestTranslationFailed:"Failed to request video translation",audioNotReceived:"Audio link not received",grantPermissionToAutoPlay:"Grant permission to autoplay",neededAdditionalExtension:"An additional extension is needed to support this site",audioFormatNotSupported:"The audio format is not supported",VOTAutoTranslate:"Translate on open",VOTDontTranslateYourLang:"Do not translate from my language",VOTVolume:"Video volume",VOTVolumeTranslation:"Translation Volume",VOTAutoSetVolume:"Reduce video volume to ",VOTShowVideoSlider:"Video volume slider",VOTSyncVolume:"Link translation and video volume",VOTAudioProxy:"Proxy received audio",VOTDisableFromYourLang:"VOT: You have disabled the translation of the video in your language",VOTLiveNotSupported:"VOT: Translation of live streams is not supported",VOTPremiere:"VOT: Wait for the premiere to end before translating",VOTVideoIsTooLong:"VOT: Video is too long",VOTNoVideoIDFound:"VOT: No video ID found",VOTFailedInitDB:"VOT: Failed to initialize database",VOTDBNeedUpdate:"VOT: The database needs an update, please reload the page",VOTDisabledForDBUpdating:`VOT is disabled due to an error when updating the Database. Close all open tabs with ${window.location.hostname} and try again`,VOTFailedWriteToDB:"VOT: Data could not be written to the database",VOTFailedReadFromDB:"VOT: Data could not be retrieved from the database",Russian:"Russian",English:"English",Chinese:"Chinese",French:"French",Italian:"Italian",Spanish:"Spanish",German:"German"},zh:{recommended:"推荐使用",translateVideo:"翻译视频",disableTranslate:"关掉",translationSettings:"翻译需要一个多小时",resetSettings:"重置设置",videoBeingTranslated:"视频正在翻译中",videoLanguage:"视频语言",translationLanguage:"翻译语言",translationTake:"翻译将采取",translationTakeMoreThanHour:"翻译将采取一个多小时",translationTakeAboutMinute:"翻译将采取一分钟",translationTakeFewMinutes:"翻译将采取几分钟",translationTakeApproximatelyMinutes:"翻译将采取大约需要{0}分钟",translationTakeApproximatelyMinute:"翻译将采取大约需要{0}分钟",unSupportedExtensionError:`错误! 此版本的扩展不支持 ${GM_info.scriptHandler}!\n\n请使用cloudflare版本的VOT扩展.`,requestTranslationFailed:"请求视频翻译失败",audioNotReceived:"未收到音频链接",grantPermissionToAutoPlay:"授予自动播放权限",neededAdditionalExtension:"需要一个额外的扩展来支持这个网站",audioFormatNotSupported:"不支持音频格式",VOTAutoTranslate:"打开时翻译",VOTDontTranslateYourLang:"不要从你的语言翻译过来",VOTVolume:"视频量",VOTVolumeTranslation:"翻译量",VOTAutoSetVolume:"将视频音量降低到",VOTShowVideoSlider:"视频音量滑块",VOTSyncVolume:"链接翻译和视频音量",VOTAudioProxy:"代理接收的音频",VOTDisableFromYourLang:"VOT:你已经禁用了你的语言的视频翻译",VOTLiveNotSupported:"VOT:不支持直播流的翻译",VOTPremiere:"VOT:等待首映结束后再翻译",VOTVideoIsTooLong:"VOT:视频太长",VOTNoVideoIDFound:"VOT: 没有找到视频ID",VOTFailedInitDB:"VOT: 初始化数据库失败",VOTDBNeedUpdate:"VOT: 数据库需要更新,请重新加载页面",VOTDisabledForDBUpdating:`VOT由于更新数据库时出错而被禁用。 关闭所有打开的选项卡${window.location.hostname} 再试一次`,VOTFailedWriteToDB:"VOT: 无法将数据写入数据库",VOTFailedReadFromDB:"VOT: 无法从数据库中检索数据",Russian:"俄语",English:"英语",Chinese:"中文",French:"法语",Italian:"意大利语",Spanish:"西班牙语",German:"德语"},de:{recommended:"es wird empfohlen",translateVideo:"Video übersetzen",disableTranslate:"Ausschalten",translationSettings:"Übersetzungseinstellungen",resetSettings:"Einstellungen zurücksetzen",videoBeingTranslated:"Das Video wird übersetzt",videoLanguage:"Sprache Video",translationLanguage:"Zielsprache",translationTake:"Die Übersetzung dauert",translationTakeMoreThanHour:"Die Übersetzung dauert mehr als eine Stunde",translationTakeAboutMinute:"Die Übersetzung dauert ungefähr eine Minute",translationTakeFewMinutes:"Die Übersetzung dauert einige Minuten",translationTakeApproximatelyMinutes:"Die Übersetzung dauert ungefähr {0} Minuten",translationTakeApproximatelyMinute:"Die Übersetzung dauert ungefähr {0} Minuten",unSupportedExtensionError:`Fehler! ${GM_info.scriptHandler} wird von dieser Version der Erweiterung nicht unterstützt!\n\nBitte verwenden Sie die Cloudflare-Version der VOT-Erweiterung.`,requestTranslationFailed:"Videoübersetzung konnte nicht angefordert werden",audioNotReceived:"Audiolink nicht empfangen",grantPermissionToAutoPlay:"Erteilen Sie die Berechtigung zur automatischen Wiedergabe",neededAdditionalExtension:"Eine zusätzliche Erweiterung ist erforderlich, um diese Website zu unterstützen",audioFormatNotSupported:"Das Audioformat wird nicht unterstützt",VOTAutoTranslate:"Beim Öffnen übersetzen",VOTDontTranslateYourLang:"Nicht aus Ihrer Sprache übersetzen",VOTVolume:"Video Lautstärke",VOTVolumeTranslation:"Übersetzungsvolumen",VOTAutoSetVolume:"Video-Lautstärke auf reduzieren ",VOTShowVideoSlider:"Video-Lautstärkeregler",VOTSyncVolume:"Übersetzungs- und Videolautstärke verknüpfen",VOTAudioProxy:"Empfangenes Audio proxyen",VOTDisableFromYourLang:"VOT: Sie haben die Übersetzung des Videos in Ihrer Sprache deaktiviert",VOTLiveNotSupported:"VOT: Übersetzung von Live-Streams wird nicht unterstützt",VOTPremiere:"VOT: Warten Sie, bis die Premiere beendet ist, bevor Sie übersetzen",VOTVideoIsTooLong:"VOT: Video ist zu lang",VOTNoVideoIDFound:"VOT: Keine Video-ID gefunden",VOTFailedInitDB:"VOT: Datenbank konnte nicht initialisiert werden",VOTDBNeedUpdate:"VOT: Die Datenbank muss aktualisiert werden, bitte laden Sie die Seite neu",VOTDisabledForDBUpdating:`VOT wurde aufgrund eines Fehlers beim Aktualisieren der Datenbank deaktiviert. Schließen Sie alle geöffneten Tabs mit ${window.location.hostname} und versuchen Sie es erneut`,VOTFailedWriteToDB:"VOT: Daten konnten nicht in die Datenbank geschrieben werden",VOTFailedReadFromDB:"VOT: Konnte keine Daten aus der Datenbank abrufen",Russian:"Russisch",English:"Englisch",Chinese:"Chinesisch",French:"Französisch",Italian:"Italienisch",Spanish:"Spanisch",German:"Deutsch"},es:{recommended:"es recomendable",translateVideo:"Traducir video",disableTranslate:"Apagar",translationSettings:"Ajustes de traducción",resetSettings:"Restablecer ajustes",videoBeingTranslated:"El video está siendo traducido",videoLanguage:"Idioma del video",translationLanguage:"Idioma de la traducción",translationTake:"La traducción tardará",translationTakeMoreThanHour:"La traducción tardará más de una hora",translationTakeAboutMinute:"La traducción tardará aproximadamente un minuto",translationTakeFewMinutes:"La traducción tardará unos minutos",translationTakeApproximatelyMinutes:"La traducción tardará aproximadamente {0} minutos",translationTakeApproximatelyMinute:"La traducción tardará aproximadamente {0} minutos",unSupportedExtensionError:`Error! ${GM_info.scriptHandler} no es compatible con esta versión de la extensión!\n\nUtilice la versión cloudflare de la extensión VOT.`,requestTranslationFailed:"Error al solicitar la traducción de vídeo",audioNotReceived:"Audiolink nicht empfangen",grantPermissionToAutoPlay:"Conceder permiso de reproducción automática",neededAdditionalExtension:"Se necesita una extensión adicional para admitir este sitio",audioFormatNotSupported:"El formato de audio no es compatible",VOTAutoTranslate:"Traducir al abrir",VOTDontTranslateYourLang:"No traduzca de su lengua",VOTVolume:"Volumen de vídeo",VOTVolumeTranslation:"Volumen de traducción",VOTAutoSetVolume:"Reducir el volumen del video al ",VOTShowVideoSlider:"Deslizador de volumen de video",VOTSyncVolume:"Vincular el volumen de traducción y video",VOTAudioProxy:"Proxificar el audio recibido",VOTDisableFromYourLang:"VOT: Ha desactivado la traducción del vídeo en su idioma",VOTLiveNotSupported:"VOT: No se admite la traducción de transmisiones en vivo",VOTPremiere:"VOT: Espere a que termine el estreno antes de traducir",VOTVideoIsTooLong:"VOT: El video es demasiado largo",VOTNoVideoIDFound:"VOT: No se encontró id de video",VOTFailedInitDB:"VOT: No se pudo inicializar la base de datos",VOTDBNeedUpdate:"VOT: la Base de datos necesita una actualización, por favor vuelva a cargar la página",VOTDisabledForDBUpdating:`VOT está deshabilitado debido a un error al actualizar la Base de Datos. Cierre todas las pestañas abiertas con ${window.location.hostname} y vuelve a intentarlo`,VOTFailedWriteToDB:"VOT: No se pudo escribir datos en la base de datos",VOTFailedReadFromDB:"VOT: No se pudo recuperar datos de la base de datos",Russian:"Ruso",English:"Inglés",Chinese:"Chino",French:"Francés",Italian:"Italiano",Spanish:"Español",German:"Alemán"},fr:{recommended:"recommande",translateVideo:"Traduire la vidéo",disableTranslate:"Désactiver",translationSettings:"Paramètres de traduction",resetSettings:"Réinitialiser les paramètres",videoBeingTranslated:"La vidéo est en cours de traduction",videoLanguage:"Langue vidéo",translationLanguage:"Langue cible",translationTake:"La traduction prendra",translationTakeMoreThanHour:"La traduction prendra plus d'une heure",translationTakeAboutMinute:"La traduction prendra environ une minute",translationTakeFewMinutes:"La traduction prendra quelques minutes",translationTakeApproximatelyMinutes:"La traduction prendra environ {0} minutes",translationTakeApproximatelyMinute:"La traduction prendra environ {0} minutes",unSupportedExtensionError:`Erreur! ${GM_info.scriptHandler} n'est pas supporté par cette version de l'extension!!\n\nVeuillez utiliser la version cloudflare de l'extension VOT.`,requestTranslationFailed:"Impossible de demander la traduction de la vidéo",audioNotReceived:"Lien audio non reçu",grantPermissionToAutoPlay:"Accorder l'autorisation de lecture automatique",neededAdditionalExtension:"Une extension supplémentaire est nécessaire pour prendre en charge ce site",audioFormatNotSupported:"Format audio non pris en charge",VOTAutoTranslate:"Traduire à l'ouverture",VOTDontTranslateYourLang:"Ne pas traduire à partir de votre langue",VOTVolume:"Volume de la vidéo",VOTVolumeTranslation:"Volume de traduction",VOTAutoSetVolume:"Réduire le volume de la vidéo à ",VOTShowVideoSlider:"Curseur de volume vidéo",VOTSyncVolume:"Lier le volume de la traduction et de la vidéo",VOTAudioProxy:"Proxy audio reçu",VOTDisableFromYourLang:"VOT: Vous avez désactivé la traduction de la vidéo dans votre langue",VOTLiveNotSupported:"VOT: La traduction des flux en direct n'est pas prise en charge",VOTPremiere:"VOT: Attendez la fin de la première avant de traduire",VOTVideoIsTooLong:"VOT: La vidéo est trop longue",VOTNoVideoIDFound:"VOT: ID vidéo introuvable",VOTFailedInitDB:"VOT: Impossible d'initialiser la base de données",VOTDBNeedUpdate:"VOT: la Base de données a besoin d'une mise à jour, veuillez recharger la page",VOTDisabledForDBUpdating:`VOT est désactivé en raison d'une erreur lors de la mise à jour de la Base de Données. Fermez tous les onglets ouverts avec ${window.location.hostname} et essayez à nouveau`,VOTFailedWriteToDB:"VOT: Impossible d'écrire les données dans la base de données",VOTFailedReadFromDB:"VOT: Impossible de récupérer les données de la base de données",Russian:"Russe",English:"Anglais",Chinese:"Chinois",French:"Français",Italian:"Italien",Spanish:"Espagnol",German:"Allemand"},it:{recommended:"è consigliabile",translateVideo:"Traduci il video",disableTranslate:"Spegnere",translationSettings:"Impostazioni di traduzione",resetSettings:"Ripristina impostazioni",videoBeingTranslated:"Il video è in fase di traduzione",videoLanguage:"Lingua Video",translationLanguage:"Lingua di traduzione",translationTake:"La traduzione richiederà",translationTakeMoreThanHour:"La traduzione richiederà più di un'ora",translationTakeAboutMinute:"La traduzione richiederà circa un minuto",translationTakeFewMinutes:"La traduzione richiederà alcuni minuti",translationTakeApproximatelyMinutes:"La traduzione richiederà circa {0} minuti",translationTakeApproximatelyMinute:"La traduzione richiederà circa {0} minuti",unSupportedExtensionError:`Errore! ${GM_info.scriptHandler} non è supportato da questa versione dell'estensione!\n\nUtilizzare la versione cloudflare dell'estensione VOT.`,requestTranslationFailed:"Richiesta di traduzione video non riuscita",audioNotReceived:"Collegamento audio non ricevuto",grantPermissionToAutoPlay:"Concedere l'Autorizzazione per la riproduzione automatica",neededAdditionalExtension:"Per supportare questo sito è necessaria un'estensione aggiuntiva",audioFormatNotSupported:"Il formato audio non è supportato",VOTAutoTranslate:"Traduci all'apertura",VOTDontTranslateYourLang:"Non traducete dalla vostra lingua",VOTVolume:"Volume video",VOTVolumeTranslation:"Volume di traduzione",VOTAutoSetVolume:"Riduci il volume del video al ",VOTShowVideoSlider:"Cursore del volume del video",VOTSyncVolume:"Collega il volume della traduzione e del video",VOTAudioProxy:"Proxy audio ricevuto",VOTDisableFromYourLang:"VOT: Avete disabilitato la traduzione del video nella vostra lingua",VOTLiveNotSupported:"VOT: La traduzione dei flussi dal vivo non è supportata",VOTPremiere:"VOT: Aspetta che la prima finisca prima di tradurre",VOTVideoIsTooLong:"VOT: Il video è troppo lungo",VOTNoVideoIDFound:"VOT: ID video non trovato",VOTFailedInitDB:"VOT: Impossibile inizializzare il database",VOTDBNeedUpdate:"VOT: Il database ha bisogno di aggiornamento, si prega di ricaricare la pagina",VOTDisabledForDBUpdating:`VOT è disabilitato a causa di un errore durante l'aggiornamento del database. CHIUDI tutte le schede aperte con ${window.location.hostname} e riprova`,VOTFailedWriteToDB:"VOT: Impossibile scrivere dati nel database",VOTFailedReadFromDB:"VOT: Impossibile recuperare i dati dal database",Russian:"Russo",English:"Inglese",Chinese:"Cinese",French:"Francese",Italian:"Italiano",Spanish:"Spagnolo",German:"Tedesco"}},f={log:(...e)=>{},translations:e=>{}};let V=(navigator.language||navigator.userLanguage).substr(0,2).toLowerCase();function w(e){document.querySelector(".translationBtn").style.color=e}function O(e="none"){document.querySelector(".translationBtn").dataset.state=e}function S(e="none"){let t;switch(e){case"error":t="#7A7A7D";break;case"success":t="#A36EFF";break;default:t="#FFFFFF"}document.querySelector(".translateIcon").style.fill=t}function x(e="none",t){switch(e){case"error":S(e),w("#7A7A7D"),O(e);break;case"success":S(e),w("#A36EFF"),O(e);break;default:S("none"),w("#FFFFFF"),O("none")}document.querySelector(".translationBtn").innerText=t}function k(e,t,n){const a=document.createElement("div"),o=document.createElement("input"),i=document.createElement("label");return o.type="checkbox",o.id=e,o.checked=Boolean(t),i.htmlFor=e,i.innerHTML=n,a.classList.add("translationMenuContainer"),a.appendChild(o),a.appendChild(i),a}function L(e,t,n){const a=document.createElement("div"),o=document.createElement("input"),i=document.createElement("label");return o.type="range",o.id=e,o.classList.add("VOTMenuSlider"),o.min=0,o.max=100,o.value=t,i.htmlFor=e,i.classList.add("translationHeader"),i.innerHTML=n,a.classList.add("translationMenuContainer"),a.appendChild(i),a.appendChild(o),a}function F(e,t){const n=document.createElement("div"),a=document.createElement("select");a.id=e,a.classList.add("VOTMenuSelect");for(const e of t){const t=document.createElement("option");t.innerText=e.label,t.value=e.value,Object.prototype.hasOwnProperty.call(e,"selected")&&e.selected&&t.setAttribute("selected","selected"),Object.prototype.hasOwnProperty.call(e,"disabled")&&(t.disabled=e.disabled),a.appendChild(t)}return n.classList.add("translationMenuContainer"),n.appendChild(a),n}function D(e){return new Promise((t=>{const n=document.querySelector(e);if(n)return t(n);const a=new MutationObserver((()=>{const n=document.querySelector(e);n&&(t(n),a.disconnect())}));a.observe(document.body,{childList:!0,subtree:!0,once:!0})}))}V in b||(V="en"),String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,(function(t,n){return void 0!==e[n]?e[n]:t}))});const M=e=>new Promise((t=>setTimeout(t,e))),A=e=>{const t=new URL(window.location.href);switch(e){case"youtube":return t.pathname.match(/(?:watch|embed)\/([^/]+)/)?.[1]||t.searchParams.get("v");case"vk":return t.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)?t.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)[0].slice(1):t.searchParams.get("z")?t.searchParams.get("z").split("/")[0]:!(!t.searchParams.get("oid")||!t.searchParams.get("id"))&&`video-${Math.abs(t.searchParams.get("oid"))}_${t.searchParams.get("id")}`;case"9gag":case"gag":return t.pathname.match(/gag\/([^/]+)/)?.[1];case"twitch":if(/^m\.twitch\.tv$/.test(window.location.hostname)){const e=document.head.querySelector('link[rel="canonical"]');return e?.href.match(/videos\/([^/]+)/)?.[0]||t.pathname.slice(1)}if(/^player\.twitch\.tv$/.test(window.location.hostname))return`videos/${t.searchParams.get("video")}`;if(/^clips\.twitch\.tv$/.test(window.location.hostname)){const e=document.querySelector(".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']");return!!e&&`${e.href.replace("https://www.twitch.tv/","")}/clip/${t.searchParams.get("clip")}`}return t.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)?t.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)[0]:t.pathname.match(/(?:videos)\/([^/]+)/)?.[0];case"tiktok":return t.pathname.match(/video\/([^/]+)/)?.[1];case"vimeo":return t.pathname.match(/[^/]+\/[^/]+$/)?.[0]||t.pathname.match(/[^/]+$/)?.[0];case"xvideos":return t.pathname.match(/[^/]+\/[^/]+$/)?.[0];case"pornhub":return t.searchParams.get("viewkey")||t.pathname.match(/embed\/([^/]+)/)?.[1];case"twitter":return t.pathname.match(/status\/([^/]+)/)?.[1];case"udemy":case"facebook":return t.pathname;case"rutube":return t.pathname.match(/(?:video|embed)\/([^/]+)/)?.[1];case"coub":return t.pathname.match(/view\/([^/]+)/)?.[1];case"bilibili.com":const e=t.searchParams.get("bvid");if(e)return e;{let e=t.pathname.match(/video\/([^/]+)/)?.[1];return e&&t.search&&null!==t.searchParams.get("p")&&(e+=`/?p=${t.searchParams.get("p")}`),e}case"mail.ru":if(t.pathname.startsWith("/v/")||t.pathname.startsWith("/mail/"))return t.pathname;if(t.pathname.match(/video\/embed\/([^/]+)/)){const e=document.querySelector(".b-video-controls__mymail-link");return!!e&&e?.href.split("my.mail.ru")?.[1]}default:return!1}};var q=n("./src/config/config.js");const E=["invidious.snopyta.org","yewtu.be","invidious.kavin.rocks","vid.puffyan.us","invidious.namazso.eu","inv.riverside.rocks","yt.artemislena.eu","invidious.flokinet.to","invidious.esmailelbob.xyz","y.com.sb","invidious.nerdvpn.de","inv.vern.cc","invidious.slipfox.xyz","invidio.xamh.de","invidious.dhusch.de"],I=["piped.video","piped.tokhmi.xyz","piped.moomoo.me","piped.syncpundit.io","piped.mha.fi","watch.whatever.social","piped.garudalinux.org","efy.piped.pages.dev","watch.leptons.xyz","piped.lunar.icu","yt.dc09.ru","piped.mint.lgbt","il.ax","piped.privacy.com.de","piped.esmailelbob.xyz","piped.projectsegfau.lt","piped.in.projectsegfau.lt","piped.us.projectsegfau.lt","piped.privacydev.net","piped.palveluntarjoaja.eu","piped.smnz.de","piped.adminforge.de","piped.qdi.fi","piped.hostux.net","piped.chauvet.pro","piped.jotoma.de","piped.pfcd.me","piped.frontendfriendly.xyz"],P=2,B={key:"settings",autoTranslate:0,defaultVolume:100,showVideoSlider:0,syncVolume:0,autoSetVolumeYandexStyle:1,dontTranslateYourLang:1},z={audioProxy:0};function C(e){return indexedDB.open(e,P)}async function N(){return new Promise(((e,t)=>{const n=C("VOT");n.onerror=()=>{console.error(`${b[V].VOTFailedInitDB}: ${n.error.message}`),t(!1)},n.onupgradeneeded=a=>{const o=n.result;if(o.onerror=()=>{const e=b[V].VOTFailedInitDB;alert(e),console.error(e,n.error),t(!1)},a.oldVersion<1){const n=o.createObjectStore("settings",{keyPath:"key"});for(const e of Object.keys(B).filter((e=>"key"!==e)))n.createIndex(e,e,{unique:!1});console.log("VOT: Database Created"),n.transaction.oncomplete=n=>{const a=o.transaction("settings","readwrite").objectStore("settings").add(B);a.onsuccess=()=>{console.log("VOT: Standard settings added to the Database: ",a.result),e(!0)},a.onerror=()=>{console.log("VOT: Error when adding standard settings to the Database: ",a.error),t(!1)}}}a.oldVersion<2&&function(n,a,o,i={}){const r=n.objectStore("settings");for(const e of Object.keys(o))r.createIndex(e,e,{unique:!1});console.log("VOT: The database has been updated"),r.transaction.oncomplete=n=>{const r=a.transaction("settings","readwrite").objectStore("settings"),s=r.get("settings");s.onerror=e=>{console.error("VOT: Data could not be retrieved from the Database: ",e.error),t(!1)},s.onsuccess=()=>{const n=s.result||Object.assign(B,i);for(const e in o)n[e]=o[e];const a=r.put(n);a.onerror=e=>{console.error("VOT: Failed to update the Database to new version",e.error),t(!1)},a.onsuccess=()=>{console.log("VOT: Standard settings of the new version have been added to the Database."),e(!0)}}}}(n.transaction,o,z)},n.onsuccess=()=>{const a=n.result;a.onversionchange=()=>{a.close();const e=b[V].VOTDBNeedUpdate;alert(e),console.log(e),window.location.reload(),t(!1)},e(!0)},n.onblocked=()=>{const e=n.result,a=b[V].VOTDisabledForDBUpdating;console.error(a,e),alert(a),t(!1)}}))}async function R({autoTranslate:e,defaultVolume:t,showVideoSlider:n,syncVolume:a,autoSetVolumeYandexStyle:o,dontTranslateYourLang:i,audioProxy:r}){return new Promise(((s,l)=>{if("number"==typeof e||"number"==typeof t||"number"==typeof n||"number"==typeof a||"number"==typeof o||"number"==typeof i||"number"==typeof r){const d=C("VOT");d.onerror=()=>{const e=b[V].VOTFailedWriteToDB;alert(e),console.error(e,d.error.message),l(!1)},d.onupgradeneeded=async()=>{d.result.close(),await N(),s(!0)},d.onsuccess=()=>{const u=d.result;u.onversionchange=()=>{u.close(),console.log("VOT: The database needs an update, please reload the page if it didn't happen automatically"),window.location.reload(),l(!1)};const c=u.transaction("settings","readwrite").objectStore("settings"),p=c.get("settings");p.onerror=e=>{console.error("VOT: Data could not be retrieved from the Database: ",e.error),l(!1)},p.onsuccess=()=>{const d=p.result;"number"==typeof e&&(d.autoTranslate=e),"number"==typeof t&&(d.defaultVolume=t),"number"==typeof n&&(d.showVideoSlider=n),"number"==typeof a&&(d.syncVolume=a),"number"==typeof o&&(d.autoSetVolumeYandexStyle=o),"number"==typeof i&&(d.dontTranslateYourLang=i),"number"==typeof r&&(d.audioProxy=r);const u=c.put(d);u.onerror=e=>{console.error("VOT: Не удалось обновить данные в Базе Данных: ",e.error),l(!1)},u.onsuccess=()=>{s(!0)}}},d.onblocked=()=>{const e=d.result,t=b[V].VOTDisabledForDBUpdating;console.error(t,e),alert(t),l(!1)}}}))}function j(){indexedDB.deleteDatabase("VOT")}function $(e,t,n,a){let o;return t>a?(o=n+(t-a),o=o>100?100:Math.max(o,0),e.volume=o/100):t100?100:Math.max(o,0),e.volume=o/100),o}const _={youtubeRegex:/^(www.|m.)?youtube(-nocookie)?.com$/},H=".html5-video-container",U=".video-ref",Y="main > div > section > div > div > div",G=".shaka-video-container",W=".videoplayer_media",Z='div[data-testid="videoComponent"] > div:nth-child(1) > div',K=".player",J=".video-post",X=".bpx-player-video-wrap",Q="#b-video-wrapper",ee=[...E,...I];let te="";(async function(){f.log("Loading extension..."),f.log(`Selected menu language: ${V}`);const e=(await Promise.resolve().then(n.bind(n,"./src/rvt.js"))).default;if(f.log("Inited requestVideoTranslation..."),GM_info?.scriptHandler&&["Violentmonkey","FireMonkey","Greasemonkey","AdGuard"].includes(GM_info.scriptHandler)){const e=b[V].unSupportedExtensionError;return console.error(e),alert(e)}let t;f.log("Extension compatibility passed...");const a=new Audio;let o=.9,i=!1;function r(e){i||(document.querySelector(".translationBlock").style.opacity=e)}function s(){clearTimeout(t),r(1),t=setTimeout((()=>{r(0)}),2e3)}function l(e,t,n){clearTimeout(t),r(n),e.stopPropagation()}async function d(n,d,u){let c,p,m,g,w,O,S,D,M,E,I,P;f.log("[translateProccessor] execute on element: ",n);let B,z=!0,_="";f.log("videoContainer",n),c="vimeo"===d?n.querySelector(".vp-video-wrapper > .vp-video > .vp-telecine > video"):n.querySelector("video"),f.log("video",c);const H="pornhub"===d&&window.location.pathname.includes("view_video.php")?document.querySelector(".original.mainPlayerDiv"):"pornhub"===d&&window.location.pathname.includes("embed/")?document.querySelector("body"):window.location.hostname.includes("m.youtube.com")?document.querySelector("#player-control-container"):n;!function(e){if(!e||e.querySelector(".translationBlock"))return;const t=document.createElement("div");t.classList.add("translationBlock"),t.innerHTML=`\n \n \n \n \n \n \n ${b[V].translateVideo}\n \n \n \n \n \n \n `,e.appendChild(t),f.log("VOT: Added translation button to ",e)}(H),function(e){if(e.querySelector(".translationMenuContent"))return;const t=function(){const e=document.createElement("div");return e.classList.add("translationMenuContent"),e.innerHTML=`\n

${b[V].translationSettings}

\n
\n
\n \n \n \n \n \n \n
\n `,e.onclick=e=>e.stopPropagation(),e}();e.appendChild(t),document.querySelector(".translationMenu")?.addEventListener("click",(e=>{e.stopPropagation();const t=document.querySelector(".translationMenuContent");t.style.display=i?"none":"block",t.style.opacity=o,i=!i})),document.querySelector(".translationDropDB").addEventListener("click",(e=>{e.stopPropagation(),j(),location.reload()})),f.log("VOT: Added translation menu to ",e)}(H);try{B=await N()}catch(e){console.error("[VOT] Failed to initialize database settings. All changes made will not be saved",e)}const U=document.querySelector(".translationMenuOptions");if(U&&!U.querySelector("#VOTTranslateFromLang")){const e=[{label:b[V].videoLanguage,value:"default",disabled:!0},...Object.entries(v).map((([e,t])=>({label:b[V][t],value:e,selected:_.detectedLanguage===e})))],t=[{label:b[V].translationLanguage,value:"default",disabled:!0},...Object.entries(v).map((([e,t])=>({label:b[V][t],value:e,selected:_.responseLanguage===e})))],n=F("VOTTranslateFromLang",e),a=F("VOTTranslateToLang",t).firstElementChild;n.id="VOTSelectLanguages",n.innerHTML+='\n \n \n \n ',n.appendChild(a),U.appendChild(n),U.querySelector("#VOTTranslateFromLang").addEventListener("change",(async e=>{f.log("[onchange] select from language",e.target.value),await G(_,e.target.value)})),U.querySelector("#VOTTranslateToLang").addEventListener("change",(async e=>{f.log("[onchange] select to language",e.target.value),await W(_,e.target.value)}))}if(B){const e=await async function(){return new Promise(((e,t)=>{const n=C("VOT");n.onerror=()=>{const e=b[V].VOTFailedReadFromDB;alert(e),console.error(e,n.error.message),t(!1)},n.onupgradeneeded=async()=>{n.result.close(),await N(),e(!0)},n.onsuccess=()=>{const a=n.result;a.onversionchange=()=>{a.close();const e=b[V].VOTDBNeedUpdate;alert(e),console.error(e),t(!1)};const o=a.transaction("settings").objectStore("settings").get("settings");o.onerror=e=>{console.error(b[V].VOTFailedReadFromDB,e.error),console.error(e),t(!1)},o.onsuccess=()=>{void 0===o.result&&(a.close(),j(),t(!1));const n=o.result;e(n)}},n.onblocked=()=>{const e=n.result,a=b[V].VOTDisabledForDBUpdating;console.error(a,e),alert(a),t(!1)}}))}();if(e){if(O=e.autoTranslate,S=e.defaultVolume,D=e.showVideoSlider,M=e.autoSetVolumeYandexStyle,E=e.dontTranslateYourLang,P=e.audioProxy,I=e.syncVolume,f.log("[db] data from db: ",e),void 0!==O&&U&&!U.querySelector("#VOTAutoTranslate")){const e=k("VOTAutoTranslate",O,b[V].VOTAutoTranslate+("vk"===d||window.location.hostname.includes("m.twitch.tv")?` (${b[V].recommended})`:""));e.querySelector("#VOTAutoTranslate").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({autoTranslate:t}),O=t,f.log("autoTranslate value changed. New value: ",O)},U.appendChild(e)}if(window.location.hostname.includes("youtube.com")&&void 0!==E&&U&&!U.querySelector("#VOTDontTranslateYourLang")){const e=k("VOTDontTranslateYourLang",E,b[V].VOTDontTranslateYourLang);e.querySelector("#VOTDontTranslateYourLang").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({dontTranslateYourLang:t}),E=t,f.log("dontTranslateYourLang value changed. New value: ",E)},U.appendChild(e)}if(void 0!==M&&U&&!U.querySelector("#VOTAutoSetVolume")){const e=k("VOTAutoSetVolume",M,b[V].VOTAutoSetVolume+(100*q.IM+"%"));e.querySelector("#VOTAutoSetVolume").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({autoSetVolumeYandexStyle:t}),M=t,f.log("autoSetVolumeYandexStyle value changed. New value: ",M)},U.appendChild(e)}if(void 0!==D&&U&&!U.querySelector("#VOTShowVideoSlider")){const e=k("VOTShowVideoSlider",D,b[V].VOTShowVideoSlider);e.querySelector("#VOTShowVideoSlider").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({showVideoSlider:t}),D=t,f.log("showVideoSlider value changed. New value: ",D),1===D&&"success"===document.querySelector(".translationBtn").dataset.state?X():document.querySelector("#VOTVideoSlider")?.parentElement.remove()},U.appendChild(e)}if(window.location.hostname.includes("youtube.com")&&!window.location.hostname.includes("m.youtube.com")&&void 0!==I&&U&&!U.querySelector("#VOTSyncVolume")){const e=k("VOTSyncVolume",I,b[V].VOTSyncVolume);e.querySelector("#VOTSyncVolume").onclick=async e=>{e.stopPropagation();const t=Number(e.target.checked);await R({syncVolume:t}),I=t,f.log("syncVolume value changed. New value: ",I)},U.appendChild(e)}}}async function Y(e,t,n){document.querySelector("#VOTSelectLanguages")&&(console.log(`Set translation from ${t} to ${n}`),document.querySelector("#VOTTranslateFromLang").value=t,document.querySelector("#VOTTranslateToLang").value=n,e.responseLanguage=n)}async function G(e,t){return e.detectedLanguage=t,e.responseLanguage=V,Object.keys(v).includes(t)?(await Y(e,e.detectedLanguage,e.responseLanguage),e):G(e,"en")}async function W(e,t){if("en"===t)e.responseLanguage=t,"ru"==V&&(e.detectedLanguage="ru");else{if(!Object.keys(v).includes(t))return W(e,"ru");e.detectedLanguage&&e.responseLanguage===V&&(e.detectedLanguage="en"),e.responseLanguage=t||V}return await Y(e,e.detectedLanguage,e.responseLanguage),e}async function Z(){a.pause(),c.removeEventListener(".translate",Z,!1),await(async()=>{a.src="",a.removeAttribute("src")})(),document.querySelector("#VOTVideoSlider")?.parentElement.remove(),document.querySelector("#VOTTranslationSlider")?.parentElement.remove();const e=document.querySelector(".translationDownload");e.href="",e.style.display="none",x("none",b[V].translateVideo),m&&(c.volume=m)}async function K(){const e=document.querySelector(".ytp-volume-panel").getAttribute("aria-valuenow"),t=document.querySelector("#VOTVideoSlider");if(!t)return;t.value=e;const n=document.querySelector("#VOTVideoVolume");n&&(n.innerText=`${e}%`),1===I&&(g=Number(e))}x("none",b[V].translateVideo),window.location.hostname.includes("youtube.com")&&!window.location.hostname.includes("m.youtube.com")&&new MutationObserver((async function(e){e.forEach((async function(e){"attributes"===e.type&&"aria-valuenow"===e.attributeName&&document.querySelector("#VOTVideoSlider")&&K()}))})).observe(document.querySelector(".ytp-volume-panel"),{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0});const J=async(e=!1)=>{if(f.log("lipsync video",c),c)if(a.currentTime=c.currentTime,a.playbackRate=c.playbackRate,e)if("play"!==e)"pause"===e&&(f.log("lipsync mode is pause"),a.pause()),"stop"===e&&(f.log("lipsync mode is stop"),a.pause()),"waiting"===e&&(f.log("lipsync mode is waiting"),a.pause()),"playing"===e&&(f.log("lipsync mode is playing"),a.play());else{f.log("lipsync mode is play");const e=a.play();void 0!==e&&e.catch((e=>{if(console.error(e),"NotAllowedError"===e.name){const e=b[V].grantPermissionToAutoPlay;throw x("error",e),`VOT: ${e}`}if("NotSupportedError"===e.name){const e=ee.includes(window.location.hostname)?b[V].neededAdditionalExtension:b[V].audioFormatNotSupported;throw x("error",e),`VOT: ${e}`}}))}else f.log("lipsync mode is not set")};async function X(){if(1!==D||document.querySelector("#VOTVideoSlider")||"success"!==document.querySelector(".translationBtn").dataset.state)return;const e=window.location.hostname.includes("youtube.com")&&!M?document.querySelector(".ytp-volume-panel")?.getAttribute("aria-valuenow"):Math.round(100*c.volume);g=e;const t=L("VOTVideoSlider",e,`${b[V].VOTVolume}: ${e}%`);t.querySelector("#VOTVideoSlider").oninput=async e=>{const{value:n}=e.target;if(c.volume=n/100,t.querySelector("#VOTOriginalVolume").innerText=`${n}%`,1!==I)return;const o=document.querySelector("#VOTTranslationSlider");if(!o)return;const i=Number(o.value),r=$(a,n,i,g);o.value=r;const s=document.querySelector("#VOTTranslationVolume");s&&(s.innerText=`${r}%`),w=r,g=n},document.querySelector(".translationMenuOptions").appendChild(t)}const Q=async e=>{_.detectedLanguage||(_=await async function(){const e={};return e.duration=c?.duration||0,e.videoId=A(d),e.detectedLanguage="en",e.responseLanguage="ru",window.location.hostname.includes("youtube.com")?(te=await async function(){const e=document.querySelector("#movie_player"),t=e.getVideoData(),n=e.getPlayerResponse(),{isLive:a,isPremiere:o,title:i,author:r}=t,{shortDescription:s}=n?.videoDetails??{},l={isLive:a,isPremiere:o,title:i,description:s,author:r,detectedLanguage:await h(e,n,i,s,r)};return console.log("VOT Detected language: ",l.detectedLanguage),l}(),""!==te.author&&(te=await G(te,te.detectedLanguage),e.detectedLanguage=te.detectedLanguage)):window.location.hostname.includes("rutube")||window.location.hostname.includes("my.mail.ru")?(e.detectedLanguage="ru",e.responseLanguage="en"):window.location.hostname.includes("bilibili.com")&&(e.detectedLanguage="zh"),e}()),f.log("Run videoValidator"),await async function(){if(window.location.hostname.includes("youtube.com")){if(f.log("VideoValidator videoData: ",_),1===E&&_.detectedLanguage===V&&_.responseLanguage===V)throw b[V].VOTDisableFromYourLang;if(te.isLive)throw b[V].VOTLiveNotSupported;if(te.isPremiere)throw b[V].VOTPremiere;if(_.duration>14400)throw b[V].VOTVideoIsTooLong}return!0}(),f.log("Run translateFunc"),await oe(e,_.detectedLanguage,_.responseLanguage)};async function ne(e){f.log(`video ${e.type}`),await J(e.type)}async function ae(){await Z(),await K()}async function oe(t,o,i){console.log("VOT Video Data: ",_);const r=`${y[d]}${t}`;await async function(t,n,a,o,i){f.log(`Translate video (url: ${t}, unknown1: ${n}, requestLang: ${a}, responseLang: ${o})`),await e(t,n,a,o,((e,t)=>{if(f.log("[exec callback] Requesting video translation"),!e)return void i(!1,b[V].requestTranslationFailed);const n=T.G.decodeResponse(t);switch(console.log("VOT Response: ",n),n.status){case 0:i(!1,n.message);break;case 1:i(!!n.url,n.url||b[V].audioNotReceived);break;case 2:i(!1,n.remainingTime?function(e){const t=Math.floor(e/60),n=Math.floor(e%60);return t>=60?b[V].translationTakeMoreThanHour:t>=10&&t%10?b[V].translationTakeApproximatelyMinutes.format(t):1==t||0==t&&n>0?b[V].translationTakeAboutMinute:b[V].translationTakeApproximatelyMinute.format(t)}(n.remainingTime):b[V].translationTakeFewMinutes);break;case 3:i(!1,b[V].videoBeingTranslated)}}))}(r,0x4075500000000000,o,i,(async(e,r)=>{if(f.log("[exec callback] translateVideo"),A(d)!==t)return;if(!e)throw x("error",r),r.includes(b[V].translationTake)&&(clearTimeout(p),p=setTimeout((()=>oe(t,o,i)),6e4)),r;switch(a.src=r,m=c?.volume,"number"==typeof S&&(a.volume=S/100),"number"==typeof M&&M&&(c.volume=q.IM),d){case"twitter":document.querySelector('div[data-testid="app-bar-back"][role="button"]').addEventListener("click",ae);break;case"invidious":case"piped":break;default:null!==u&&document.body.addEventListener(u,ae)}const s=["twitch","vimeo","facebook","rutube","twitter","bilibili.com","mail.ru"];for(let e=0;e{e.forEach((async e=>{"attributes"===e.type&&"src"===e.attributeName&&e.target===c&&""!==e.target.src&&(await ae(),z=!0)}))})).observe(n,{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0});break}c&&!c.paused&&J("play");const l=document.querySelectorAll("video"),h=["playing","ratechange","play","waiting","pause"];l.forEach((e=>h.forEach((t=>e.addEventListener(t,ne))))),x("success",b[V].disableTranslate),await X(),await async function(){if(document.querySelector("#VOTTranslationSlider")||"success"!==document.querySelector(".translationBtn").dataset.state)return;const e="number"==typeof S?S:100;g=e;const t=L("VOTTranslationSlider",e,`${b[V].VOTVolumeTranslation}: ${e}%`);t.querySelector("#VOTTranslationSlider").oninput=async({target:{value:e}})=>{a.volume=e/100,document.querySelector("#VOTTranslationVolume").innerText=`${e}%`,await R({defaultVolume:Number(e)}),S=Number(e),1===I&&await async function(e){const t=document.querySelector("#VOTVideoSlider");if(!t)return;const n=Number(t.value),a=$(c,e,n,w);t.value=a;const o=document.querySelector("#VOTOriginalVolume");o&&(o.innerText=`${a}%`),g=a,w=e}(e)},document.querySelector(".translationMenuOptions").appendChild(t)}();const T=document.querySelector("#VOTVideoSlider");T&&(T.value=100*q.IM);const v=document.querySelector("#VOTOriginalVolume");v&&(v.innerText=100*q.IM+"%");const y=document.querySelector(".translationDownload");y.href=r,y.style.display="initial"}))}document.addEventListener("click",(async e=>{const t=document.querySelector(".translationBlock"),a=document.querySelector(".translationMenuContent"),o=!(!t&&e.target!==t)&&t.contains(e.target),s=!(!a&&e.target!==a)&&a.contains(e.target),l=!(!n&&e.target!==n)&&n.contains(e.target);f.log(`[document click] ${o} ${s} ${l}`),o||s||(l||r(0),a.style.display="none",i=!1)}));const ie=(e,t,n)=>{t.forEach((t=>e.addEventListener(t,(async e=>{await n(e)}))))};"pornhub"===d?window.location.pathname.includes("view_video.php")?ie(document.querySelector(".original.mainPlayerDiv > video-element > div"),["mousemove","mouseout"],s):window.location.pathname.includes("embed/")&&ie(document.querySelector("#player"),["mousemove","mouseout"],s):ie("twitter"===d?document.querySelector('div[data-testid="videoPlayer"'):n,["mousemove","mouseout"],s),document.querySelector(".translationBlock").addEventListener("mousemove",(e=>l(e,t,o))),document.querySelector(".translationMenuContent").addEventListener("mousemove",(e=>l(e,t,o))),document.addEventListener("touchstart",(e=>l(e,t,o))),document.addEventListener("touchmove",(e=>l(e,t,o))),document.addEventListener("touchend",(e=>l(e,t,o))),document.querySelectorAll("video").forEach((e=>{e.addEventListener("abort",(async()=>{f.log("lipsync mode is abort"),_.detectedLanguage="",await ae()}))})),document.querySelector(".translationBtn").addEventListener("click",(async e=>{if(f.log("[click translationBtn] before all functions & methods"),e.stopPropagation(),e.stopImmediatePropagation(),a.src)return f.log("[click translationBtn] audio.src is not empty"),await ae(),void(_.detectedLanguage="");try{f.log("[click translationBtn] trying execute translation");const e=A(d);if(!e)throw b[V].VOTNoVideoIDFound;await Q(e)}catch(e){x("error",String(e).substring(4,e.length)),console.error(e)}})),c.addEventListener("progress",(async e=>{if(e.stopPropagation(),!z||1!==O)return;const t=A(d);if(!t)throw b[V].VOTNoVideoIDFound;try{await Q(t),z=!1}catch(e){x("error",String(e).substring(4,e.length)),z=!1}}))}await async function(){if(f.log("Runned initWebsite function"),_.youtubeRegex.test(window.location.hostname)){if(window.location.pathname.includes("embed")){const e=document.querySelector(".html5-video-container");return void await d(e,"youtube",null)}f.log("[initWebsite] Found a match with youtube hostname");const e=()=>{const e=document.querySelector(H);if(e)f.log("[exec] translateProccessor youtube on page enter"),d(e,"youtube","yt-translate-stop");else{if(!ytplayer||!ytplayer.config)return void f.log("[exec] ytplayer is null");ytplayer.config.args.jsapicallback=()=>{f.log("[exec] translateProccessor youtube on page enter (ytplayer.config.args.jsapicallback)"),d(e,"youtube","yt-translate-stop")}}};document.addEventListener("spfdone",e),document.addEventListener("yt-navigate-finish",e);const t=async()=>{document.body.dispatchEvent(new Event("yt-translate-stop"))};if(document.addEventListener("spfrequest",t),document.addEventListener("yt-navigate-start",t),window.location.hostname.includes("m.youtube.com")){let e=await D("#player");e&&(await M(1e3),await d(e,"youtube","yt-translate-stop"),new MutationObserver((async t=>{for(const n of t)"attributes"===n.type&&"src"===n.attributeName&&(e=await D("#player"),await M(1e3),await d(e,"youtube","yt-translate-stop"))})).observe(e,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0}));const t=async()=>{document.body.dispatchEvent(new Event("yt-translate-stop"))};document.addEventListener("spfdone",t),document.addEventListener("yt-navigate-finish",t),document.addEventListener("spfrequest",t),document.addEventListener("yt-navigate-start",t)}}else if(window.location.hostname.includes("twitch.tv")){if(f.log("[initWebsite] Found a match with twitch.tv"),window.location.hostname.includes("m.twitch.tv")&&(window.location.pathname.includes("/videos/")||window.location.pathname.includes("/clip/"))){if(f.log("[initWebsite] Matched Twitch Mobile"),await D(Y)){await M(200);const e=document.querySelector(Y);await d(e,"twitch",null),new MutationObserver((async t=>{for(const n of t)"attributes"===n.type&&"src"===n.attributeName&&n.target===e?.querySelector("video")&&(await M(1e3),await d(e,"twitch",null))})).observe(e,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})}}else if(window.location.hostname.includes("player.twitch.tv")||window.location.hostname.includes("clips.twitch.tv")||window.location.pathname.includes("/videos/")||window.location.pathname.includes("/clip/")){f.log("[initWebsite] Matched Twitch Desktop");const e=await D(U);e&&(await M(200),await d(e,"twitch",null))}f.log("[initWebsite] Exit function in the twitch section")}else{if(window.location.hostname.includes("xvideos.com"))return f.log("[entered] xvideos"),await M(1e3),void await d(document.querySelector(".video-bg-pic"),"xvideos",null);if(window.location.hostname.includes("pornhub.com"))return f.log("[entered] pornhub"),await M(1e3),void await d(document.querySelector(".mgp_videoWrapper"),"pornhub",null);if(E.includes(window.location.hostname))f.log("[entered] invidious"),await d(document.querySelector("#player"),"youtube",null);else if(I.includes(window.location.hostname)){f.log("[entered] piped");const e=await D(G);if(e){let t,n=A("youtube");await d(e,"youtube","piped"),setInterval((async()=>{t=A("youtube"),n!==t&&(t&&await d(document.querySelector(G),"youtube","piped"),n=t)}),3e3)}}else if(/^(www.|m.)?vk.(com|ru)$/.test(window.location.hostname)){if(f.log("[entered] vk.com"),await D(W)){let e;await d(document.querySelector(W),"vk",null);let t=A("vk");setInterval((async()=>{if(e=A("vk"),t!==e){if(e){const e=await D(W);e&&await d(e,"vk",null)}t=e}}),3e3)}}else if(window.location.hostname.includes("vimeo.com"))f.log("[entered] vimeo.com"),await D(K)&&(await M(1e3),await d(document.querySelector(K),"vimeo",null));else if(window.location.hostname.includes("9gag.com"))await M(1e3),await d(document.querySelector(J),"9gag",null);else if(window.location.hostname.includes("coub.com"))await M(1e3),await d(document.querySelector(".viewer__player"),"coub",null);else if(window.location.hostname.includes("rutube.ru")){const e=window.location.pathname.includes("/play/embed")?"#app > div > div":".video-player > div > div > div:nth-child(2)",t=await D(e);t&&await d(t,"rutube",null)}else if(window.location.hostname.includes("bilibili.com")){if(window.location.pathname.includes("/video/")){const e=await D(X);e&&await d(e,"bilibili.com",null)}else if(window.location.pathname.includes("/blackboard/webplayer/embed-old.html")){const e=await D("video");e&&await d(e.parentElement,"bilibili.com",null)}}else if(window.location.hostname.includes("twitter.com")){const e=await D(Z);if(e){let t,n=A("twitter");await d(e,"twitter",null),setInterval((async()=>{t=A("twitter"),n!==t&&(t&&await d(document.querySelector(Z),"twitter",null),n=t)}),3e3)}}else if(window.location.hostname.includes("my.mail.ru")){const e=await D(Q);if(e){let t,n=A("mail.ru");await d(e,"mail.ru",null),setInterval((async()=>{t=A("mail.ru"),n!==t&&(t&&await d(document.querySelector(Q),"mail.ru",null),n=t)}),3e3)}}}}()})().catch((e=>{console.error(e)}))})()})(); \ No newline at end of file diff --git a/dist/vot.user.js b/dist/vot.user.js index d9afe205..6f0f34c0 100644 --- a/dist/vot.user.js +++ b/dist/vot.user.js @@ -3339,7 +3339,7 @@ async function src_main() { mutation.target === video && mutation.target.src !== "" ) { - stopTranslation(); + await stopTranslation(); firstPlay = true; } }); @@ -3484,8 +3484,8 @@ async function src_main() { // check if the audio source is not empty if (audio.src) { utils_debug.log("[click translationBtn] audio.src is not empty"); + await stopTranslation(); videoData.detectedLanguage = "" - await stopTraslate(); return; } diff --git a/src/index.js b/src/index.js index 589428fe..ef016db1 100644 --- a/src/index.js +++ b/src/index.js @@ -980,7 +980,7 @@ async function main() { mutation.target === video && mutation.target.src !== "" ) { - stopTranslation(); + await stopTranslation(); firstPlay = true; } }); @@ -1125,8 +1125,8 @@ async function main() { // check if the audio source is not empty if (audio.src) { debug.log("[click translationBtn] audio.src is not empty"); + await stopTranslation(); videoData.detectedLanguage = "" - await stopTraslate(); return; }