diff --git a/dist/vot-cloudflare-min.user.js b/dist/vot-cloudflare-min.user.js index 2018c423..4e007eba 100644 --- a/dist/vot-cloudflare-min.user.js +++ b/dist/vot-cloudflare-min.user.js @@ -127,4 +127,4 @@ // @supportURL https://github.com/ilyhalight/voice-over-translation/issues // ==/UserScript== -(()=>{var t={"./node_modules/bowser/es5.js":function(t){t.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(n,a,function(e){return t[e]}.bind(null,a));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=90)}({17:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n=o(18),a=function(){function t(){}return t.getFirstMatch=function(t,e){var o=e.match(t);return o&&o.length>0&&o[1]||""},t.getSecondMatch=function(t,e){var o=e.match(t);return o&&o.length>1&&o[2]||""},t.matchAndReturnConst=function(t,e,o){if(t.test(e))return o},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,o,n){void 0===n&&(n=!1);var a=t.getVersionPrecision(e),i=t.getVersionPrecision(o),r=Math.max(a,i),s=0,l=t.map([e,o],(function(e){var o=r-t.getVersionPrecision(e),n=e+new Array(o+1).join(".0");return t.map(n.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(n&&(s=r-Math.min(a,i)),r-=1;r>=s;){if(l[0][r]>l[1][r])return 1;if(l[0][r]===l[1][r]){if(r===s)return 0;r-=1}else if(l[0][r]1?a-1:0),r=1;r0){var r=Object.keys(o),l=s.default.find(r,(function(t){return e.isOS(t)}));if(l){var d=this.satisfies(o[l]);if(void 0!==d)return d}var c=s.default.find(r,(function(t){return e.isPlatform(t)}));if(c){var u=this.satisfies(o[c]);if(void 0!==u)return u}}if(i>0){var h=Object.keys(a),p=s.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==p)return this.compareVersion(a[p])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var o=this.getBrowserName().toLowerCase(),n=t.toLowerCase(),a=s.default.getBrowserTypeByAlias(n);return e&&a&&(n=a.toLowerCase()),n===o},e.compareVersion=function(t){var e=[0],o=t,n=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===t[0]||"<"===t[0]?(o=t.substr(1),"="===t[1]?(n=!0,o=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?o=t.substr(1):"~"===t[0]&&(n=!0,o=t.substr(1)),e.indexOf(s.default.compareVersions(a,o,n))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=d,t.exports=e.default},92:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},o=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},o=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},o=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},o=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},o=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},o=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},o=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},o=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},o=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},o=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},o=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},o=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return o&&(e.version=o),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},o=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},o=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},o=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},o=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},o=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},o=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},o=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},o=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},o=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},o=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},o=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},o=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e={name:"Android Browser"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(e,t),version:a.default.getSecondMatch(e,t)}}}];e.default=r,t.exports=e.default},93:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:[/Roku\/DVP/],describe:function(t){var e=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:i.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),o=a.default.getWindowsVersionName(e);return{name:i.OS_MAP.Windows,version:e,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:i.OS_MAP.iOS},o=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return o&&(e.version=o),e}},{test:[/macintosh/i],describe:function(t){var e=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),o=a.default.getMacOSVersionName(e),n={name:i.OS_MAP.MacOS,version:e};return o&&(n.versionName=o),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),o=a.default.getAndroidVersionName(e),n={name:i.OS_MAP.Android,version:e};return o&&(n.versionName=o),n}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),o={name:i.OS_MAP.WebOS};return e&&e.length&&(o.version=e),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||a.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:i.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.PlayStation4,version:e}}}];e.default=r,t.exports=e.default},94:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=a.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",o={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(o.model=e),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),o=t.test(/like (ipod|iphone)/i);return e&&!o},describe:function(t){var e=a.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];e.default=r,t.exports=e.default},95:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:i.ENGINE_MAP.Blink};var e=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:i.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:i.ENGINE_MAP.Trident},o=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:i.ENGINE_MAP.Presto},o=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=t.test(/gecko/i),o=t.test(/like gecko/i);return e&&!o},describe:function(t){var e={name:i.ENGINE_MAP.Gecko},o=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:i.ENGINE_MAP.WebKit},o=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}}];e.default=r,t.exports=e.default}})},"./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/main.scss":(t,e,o)=>{"use strict";o.d(e,{A:()=>s});var n=o("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),a=o.n(n),i=o("./node_modules/css-loader/dist/runtime/api.js"),r=o.n(i)()(a());r.push([t.id,'.vot-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );--vot-helper-ontheme: var( --vot-ontheme-rgb, var(--vot-onprimary-rgb, 255, 255, 255) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;border-radius:4px;padding:0 16px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-ontheme));background-color:rgb(var(--vot-helper-theme));box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer;transition:box-shadow .2s}.vot-button[hidden]{display:none !important}.vot-button::-moz-focus-inner{border:none}.vot-button::before,.vot-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-button::before{background-color:rgb(var(--vot-helper-ontheme));transition:opacity .2s}.vot-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-button:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.vot-button:hover::before{opacity:.08}.vot-button:active{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.vot-button:active::after{opacity:.32;background-size:100% 100%;transition:background-size 0s}.vot-button:disabled{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.12);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);box-shadow:none;cursor:initial}.vot-button:disabled::before,.vot-button:disabled::after{opacity:0}.vot-outlined-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:solid 1px;border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.24);border-radius:4px;padding:0 16px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:34px;outline:none;cursor:pointer}.vot-outlined-button[hidden]{display:none !important}.vot-outlined-button::-moz-focus-inner{border:none}.vot-outlined-button::before,.vot-outlined-button::after{content:"";position:absolute;border-radius:3px;top:0;right:0;bottom:0;left:0;opacity:0}.vot-outlined-button::before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-outlined-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-outlined-button:hover::before{opacity:.04}.vot-outlined-button:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-outlined-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-outlined-button:disabled::before,.vot-outlined-button:disabled::after{opacity:0}.vot-text-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none;border-radius:4px;padding:0 8px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer}.vot-text-button[hidden]{display:none !important}.vot-text-button::-moz-focus-inner{border:none}.vot-text-button::before,.vot-text-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-text-button::before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-text-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-text-button:hover::before{opacity:.04}.vot-text-button:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-text-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-text-button:disabled::before,.vot-text-button:disabled::after{opacity:0}.vot-icon-button{--vot-helper-onsurface: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87);position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none;border-radius:50%;padding:0;width:36px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;fill:var(--vot-helper-onsurface);color:var(--vot-helper-onsurface);background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer}.vot-icon-button[hidden]{display:none !important}.vot-icon-button::-moz-focus-inner{border:none}.vot-icon-button::before,.vot-icon-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-icon-button::before{background-color:var(--vot-helper-onsurface);transition:opacity .2s}.vot-icon-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity .3s,background-size .4s}.vot-icon-button:hover::before{opacity:.04}.vot-icon-button:active::after{opacity:.32;background-size:100% 100%;transition:background-size 0s,opacity 0s}.vot-icon-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);fill:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-icon-button:disabled::before,.vot-icon-button:disabled::after{opacity:0}.vot-textfield{--vot-helper-theme: rgb( var(--vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243)) ) !important;--vot-helper-safari1: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.38 ) !important;--vot-helper-safari2: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;--vot-helper-safari3: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.87 ) !important;position:relative !important;display:inline-block;padding-top:6px !important;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system) !important;font-size:16px !important;line-height:1.5 !important;text-align:start !important}.vot-textfield[hidden]{display:none !important}.vot-textfield>input,.vot-textfield>textarea{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin:0 !important;border-style:solid !important;border-width:1px !important;border-color:rgba(0,0,0,0) var(--vot-helper-safari2) var(--vot-helper-safari2) !important;border-radius:4px !important;padding:15px 13px 15px !important;width:100% !important;height:inherit !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important;-webkit-text-fill-color:currentColor !important;background-color:rgba(0,0,0,0) !important;box-shadow:inset 1px 0 rgba(0,0,0,0),inset -1px 0 rgba(0,0,0,0),inset 0 -1px rgba(0,0,0,0) !important;font-family:inherit !important;font-size:inherit !important;line-height:inherit !important;caret-color:var(--vot-helper-theme) !important;transition:border .2s,box-shadow .2s !important}.vot-textfield>input:not(:focus):placeholder-shown,.vot-textfield>textarea:not(:focus):placeholder-shown{border-top-color:var(--vot-helper-safari2) !important}.vot-textfield>input+span,.vot-textfield>textarea+span{position:absolute !important;top:0 !important;left:0 !important;display:flex !important;width:100% !important;max-height:100% !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;font-size:75% !important;line-height:15px !important;cursor:text !important;transition:color .2s,font-size .2s,line-height .2s !important;pointer-events:none !important}.vot-textfield>input:not(:focus):placeholder-shown+span,.vot-textfield>textarea:not(:focus):placeholder-shown+span{font-size:inherit !important;line-height:68px !important}.vot-textfield>input+span::before,.vot-textfield>input+span::after,.vot-textfield>textarea+span::before,.vot-textfield>textarea+span::after{content:"" !important;display:block !important;-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin-top:6px !important;border-top:solid 1px var(--vot-helper-safari2) !important;min-width:10px !important;height:8px !important;pointer-events:none !important;box-shadow:inset 0 1px rgba(0,0,0,0) !important;transition:border .2s,box-shadow .2s !important}.vot-textfield>input+span::before,.vot-textfield>textarea+span::before{margin-right:4px !important;border-left:solid 1px rgba(0,0,0,0) !important;border-radius:4px 0 !important}.vot-textfield>input+span::after,.vot-textfield>textarea+span::after{flex-grow:1 !important;margin-left:4px !important;border-right:solid 1px rgba(0,0,0,0) !important;border-radius:0 4px !important}.vot-textfield>input:not(:focus):placeholder-shown+span::before,.vot-textfield>input:not(:focus):placeholder-shown+span::after,.vot-textfield>textarea:not(:focus):placeholder-shown+span::before,.vot-textfield>textarea:not(:focus):placeholder-shown+span::after{border-top-color:rgba(0,0,0,0) !important}.vot-textfield:hover>input,.vot-textfield:hover>textarea{border-color:rgba(0,0,0,0) var(--vot-helper-safari3) var(--vot-helper-safari3) !important}.vot-textfield:hover>input+span::before,.vot-textfield:hover>input+span::after,.vot-textfield:hover>textarea+span::before,.vot-textfield:hover>textarea+span::after{border-top-color:var(--vot-helper-safari3) !important}.vot-textfield:hover>input:not(:focus):placeholder-shown,.vot-textfield:hover>textarea:not(:focus):placeholder-shown{border-color:var(--vot-helper-safari3) !important}.vot-textfield>input:focus,.vot-textfield>textarea:focus{border-color:rgba(0,0,0,0) var(--vot-helper-theme) var(--vot-helper-theme) !important;box-shadow:inset 1px 0 var(--vot-helper-theme),inset -1px 0 var(--vot-helper-theme),inset 0 -1px var(--vot-helper-theme) !important;outline:none !important}.vot-textfield>input:focus+span,.vot-textfield>textarea:focus+span{color:var(--vot-helper-theme) !important}.vot-textfield>input:focus+span::before,.vot-textfield>input:focus+span::after,.vot-textfield>textarea:focus+span::before,.vot-textfield>textarea:focus+span::after{border-top-color:var(--vot-helper-theme) !important;box-shadow:inset 0 1px var(--vot-helper-theme) !important}.vot-textfield>input:disabled,.vot-textfield>input:disabled+span,.vot-textfield>textarea:disabled,.vot-textfield>textarea:disabled+span{border-color:rgba(0,0,0,0) var(--vot-helper-safari1) var(--vot-helper-safari1) !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important;pointer-events:none !important}.vot-textfield>input:disabled+span::before,.vot-textfield>input:disabled+span::after,.vot-textfield>textarea:disabled+span::before,.vot-textfield>textarea:disabled+span::after{border-top-color:var(--vot-helper-safari1) !important}.vot-textfield>input:disabled:placeholder-shown,.vot-textfield>input:disabled:placeholder-shown+span,.vot-textfield>textarea:disabled:placeholder-shown,.vot-textfield>textarea:disabled:placeholder-shown+span{border-top-color:var(--vot-helper-safari1) !important}.vot-textfield>input:disabled:placeholder-shown+span::before,.vot-textfield>input:disabled:placeholder-shown+span::after,.vot-textfield>textarea:disabled:placeholder-shown+span::before,.vot-textfield>textarea:disabled:placeholder-shown+span::after{border-top-color:rgba(0,0,0,0) !important}@media not all and (min-resolution: 0.001dpcm){@supports(-webkit-appearance: none){.vot-textfield>input,.vot-textfield>input+span,.vot-textfield>textarea,.vot-textfield>textarea+span,.vot-textfield>input+span::before,.vot-textfield>input+span::after,.vot-textfield>textarea+span::before,.vot-textfield>textarea+span::after{transition-duration:.1s !important}}}.vot-checkbox{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );--vot-helper-ontheme: var( --vot-ontheme-rgb, var(--vot-onprimary-rgb, 255, 255, 255) );z-index:0;position:relative;display:inline-block;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;text-align:start}.vot-checkbox[hidden]{display:none !important}.vot-checkbox>input{appearance:none;-moz-appearance:none;-webkit-appearance:none;z-index:1;position:absolute;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:3px 1px;border:solid 2px;background:rgba(0,0,0,0);border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6);border-radius:2px;width:18px;height:18px;outline:none;cursor:pointer;transition:border-color .2s,background-color .2s}.vot-checkbox>input+span{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding-left:30px;width:inherit;cursor:pointer}.vot-checkbox>input+span::before{content:"";position:absolute;left:-10px;top:-8px;display:block;border-radius:50%;width:40px;height:40px;background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0));opacity:0;transform:scale(1);pointer-events:none;transition:opacity .3s,transform .2s}.vot-checkbox>input+span::after{content:"";z-index:1;display:block;position:absolute;top:3px;left:1px;-webkit-box-sizing:content-box !important;-moz-box-sizing:content-box !important;box-sizing:content-box !important;width:10px;height:5px;border:solid 2px rgba(0,0,0,0);border-right-width:0;border-top-width:0;pointer-events:none;transform:translate(3px, 4px) rotate(-45deg);transition:border-color .2s}.vot-checkbox>input:checked,.vot-checkbox>input:indeterminate{border-color:rgb(var(--vot-helper-theme));background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span::before,.vot-checkbox>input:indeterminate+span::before{background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span::after,.vot-checkbox>input:indeterminate+span::after{border-color:rgb(var(--vot-helper-ontheme, 255, 255, 255))}.vot-checkbox>input:indeterminate+span::after{border-left-width:0;transform:translate(4px, 3px)}.vot-checkbox:hover>input+span::before{opacity:.04}.vot-checkbox:active>input,.vot-checkbox:active:hover>input{border-color:rgb(var(--vot-helper-theme))}.vot-checkbox:active>input:checked{border-color:rgba(0,0,0,0);background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6)}.vot-checkbox:active>input+span::before{opacity:1;transform:scale(0);transition:transform 0s,opacity 0s}.vot-checkbox>input:disabled{border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-checkbox>input:disabled:checked,.vot-checkbox>input:disabled:indeterminate{border-color:rgba(0,0,0,0);background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38)}.vot-checkbox>input:disabled+span{color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-checkbox>input:disabled+span::before{opacity:0;transform:scale(0)}.vot-slider{--vot-safari-helper1: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.04 ) !important;--vot-safari-helper2: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.12 ) !important;--vot-safari-helper3: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.16 ) !important;--vot-safari-helper4: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.24 ) !important;display:inline-block;width:100% !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important;font-family:var(--vot-font, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system) !important;font-size:16px !important;line-height:1.5 !important;text-align:start !important}.vot-slider[hidden]{display:none !important}.vot-slider>input{-webkit-appearance:none !important;appearance:none !important;position:relative !important;top:24px !important;display:block !important;margin:0 0 -36px !important;width:100% !important;height:36px !important;background-color:rgba(0,0,0,0) !important;cursor:pointer !important}.vot-slider>input:last-child{position:static !important;margin:0 !important}.vot-slider>span{display:inline-block !important;margin-bottom:36px !important}.vot-slider>input:disabled{cursor:default !important;opacity:.38 !important}.vot-slider>input:disabled+span{color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input::-webkit-slider-runnable-track{margin:17px 0 !important;border-radius:1px !important;width:100% !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-webkit-slider-thumb{margin:0 !important;appearance:none !important;-webkit-appearance:none !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider:hover>input::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper1) !important}.vot-slider>input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper4) !important}.vot-slider>input:disabled::-webkit-slider-runnable-track{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-webkit-slider-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;color:rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::-moz-range-track{margin:17px 0 !important;border-radius:1px !important;width:100% !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-moz-range-thumb{appearance:none !important;-moz-appearance:none !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider>input::-moz-range-progress{border-radius:1px !important;height:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-slider:hover>input:hover::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.04) !important}.vot-slider>input:active::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input:disabled::-moz-range-track{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-moz-range-progress{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important}.vot-slider>input:disabled::-moz-range-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::-moz-focus-outer{border:none !important}.vot-slider>input::-ms-track{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin:17px 0 !important;border:none !important;border-radius:1px !important;padding:0 17px !important;width:100% !important;height:2px !important;background-color:rgba(0,0,0,0) !important}.vot-slider>input::-ms-fill-lower{border-radius:1px !important;height:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-slider>input::-ms-fill-upper{border-radius:1px !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-ms-thumb{appearance:none !important;margin:0 17px !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider:hover>input::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.04) !important}.vot-slider>input:active::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input:disabled::-ms-fill-lower{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-ms-fill-upper{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important;opacity:.38 !important}.vot-slider>input:disabled::-ms-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::before{content:"" !important;display:block !important;position:absolute !important;width:calc(100%*var(--vot-progress, 0)) !important;height:2px !important;top:calc(50% - 1px) !important;background:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-select{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0) !important;--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87) !important;--vot-helper-safari1: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;--vot-helper-safari2: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.87 ) !important;display:flex;align-items:center;justify-content:space-between;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;line-height:1.5;text-align:start;color:var(--vot-helper-theme);fill:var(--vot-helper-theme)}.vot-select[hidden]{display:none !important}.vot-select-label{font-size:16px}.vot-select-outer{display:flex;align-items:center;justify-content:space-between;max-width:120px;width:120px;padding:0 5px;border-style:solid !important;border-width:1px !important;border-color:var(--vot-helper-safari1) !important;border-radius:4px !important;cursor:pointer;transition:border .2s !important}.vot-select-outer:hover{border-color:var(--vot-helper-safari2) !important}.vot-select-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vot-select-arrow-icon{width:20px;height:32px;display:flex;justify-content:center;align-items:center}.vot-select-content-list{display:flex;flex-direction:column}.vot-select-content-list .vot-select-content-item{padding:5px 10px;border-radius:8px;cursor:pointer}.vot-select-content-list .vot-select-content-item:not([inert]):hover{background-color:#2a2c31}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]{color:rgb(var(--vot-primary-rgb, 33, 150, 243));background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.2)}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]:hover{background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.1) !important}.vot-select-content-list .vot-select-content-item[data-vot-disabled=true]{cursor:default}.vot-select-content-list .vot-select-content-item[hidden]{display:none !important}.vot-header{color:rgba(var(--vot-helper-onsurface-rgb), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-weight:bold;line-height:1.5;text-align:start}.vot-header[hidden]{display:none !important}.vot-header:not(:first-child){padding-top:8px}.vot-header-level-1{font-size:2em}.vot-header-level-2{font-size:1.5em}.vot-header-level-3{font-size:1.17em}.vot-header-level-4{font-size:1em}.vot-header-level-5{font-size:.83em}.vot-header-level-6{font-size:.67em}.vot-info{display:flex;color:rgba(var(--vot-helper-onsurface-rgb), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;text-align:start}.vot-info[hidden]{display:none !important}.vot-info>:not(:first-child){color:rgba(var(--vot-helper-onsurface-rgb), 0.5);flex:1;margin-left:8px}.vot-lang-select{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87);display:flex;align-items:center;justify-content:space-between;color:var(--vot-helper-theme);fill:var(--vot-helper-theme)}.vot-lang-select[hidden]{display:none !important}.vot-lang-select-icon{width:32px;height:32px;display:flex;justify-content:center;align-items:center}.vot-segmented-button{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87);overflow:hidden;position:absolute;left:50%;top:5rem;transform:translate(-50%);user-select:none;display:flex;align-items:center;height:32px;max-width:100vw;background:rgb(var(--vot-surface-rgb, 255, 255, 255));color:var(--vot-helper-theme);fill:var(--vot-helper-theme);border-radius:4px;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;cursor:default;transition:opacity .5s;z-index:100}.vot-segmented-button[hidden]{display:none !important}.vot-segmented-button *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-segmented-button .vot-separator{width:1px;height:50%;background:rgba(var(--vot-helper-theme-rgb), 0.1)}.vot-segmented-button .vot-separator[hidden]{display:none !important}.vot-segmented-button .vot-segment,.vot-segmented-button .vot-segment-only-icon{position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;height:100%;padding:0 8px;background-color:rgba(0,0,0,0);color:inherit;transition:background-color 100ms ease-in-out;border:none}.vot-segmented-button .vot-segment[hidden],.vot-segmented-button [hidden].vot-segment-only-icon{display:none !important}.vot-segmented-button .vot-segment::before,.vot-segmented-button .vot-segment-only-icon::before,.vot-segmented-button .vot-segment::after,.vot-segmented-button .vot-segment-only-icon::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-segmented-button .vot-segment::before,.vot-segmented-button .vot-segment-only-icon::before{background-color:rgb(var(--vot-helper-theme-rgb));transition:opacity .2s}.vot-segmented-button .vot-segment::after,.vot-segmented-button .vot-segment-only-icon::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-segmented-button .vot-segment:hover::before,.vot-segmented-button .vot-segment-only-icon:hover::before{opacity:.04}.vot-segmented-button .vot-segment:active::after,.vot-segmented-button .vot-segment-only-icon:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-segmented-button .vot-segment-only-icon{min-width:32px;padding:0}.vot-segmented-button .vot-segment-label{margin-left:8px;white-space:nowrap}.vot-segmented-button[data-status=success] .vot-translate-button{color:rgb(var(--vot-primary-rgb, 33, 150, 243));fill:rgb(var(--vot-primary-rgb, 33, 150, 243))}.vot-segmented-button[data-status=error] .vot-translate-button{color:#f28b82;fill:#f28b82}.vot-segmented-button svg{width:fit-content}.vot-menu{--vot-helper-surface-rgb: var(--vot-surface-rgb, 255, 255, 255);--vot-helper-surface: rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-onsurface: rgba(var(--vot-helper-onsurface-rgb), 0.87);overflow:hidden;position:absolute;left:50%;top:calc(5rem + 32px + 16px);user-select:none;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);border-radius:8px;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;min-width:300px;cursor:default;z-index:100;visibility:visible;opacity:1;transform-origin:top;transform:translate(-50%) scale(1);transition:opacity .3s,transform .1s}.vot-menu *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-menu[hidden]{pointer-events:none;display:block !important;visibility:hidden;opacity:0;transform:translate(-50%) scale(0)}.vot-menu-content-wrapper{display:flex;flex-direction:column;min-height:100px;max-height:calc(var(--vot-container-height, 75vh) - (5rem + 32px + 16px)*2);overflow:auto}.vot-menu-header-container{flex-shrink:0;align-items:flex-start;display:flex;min-height:31px}.vot-menu-header-container:empty{padding:0 0 16px 0}.vot-menu-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-menu-title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:0;text-align:start}.vot-menu-title{flex:1;font-size:16px;line-height:1;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-menu-body-container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto;padding:0 16px;gap:8px;overscroll-behavior:contain;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb), 0.1) var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar,.vot-menu-body-container::-webkit-scrollbar-track{height:12px !important;width:12px !important;background:var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb), 0.1) !important;-webkit-border-radius:1ex !important;border:5px solid var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface) !important}.vot-menu-footer-container{flex-shrink:0;display:flex;justify-content:flex-end;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-menu-footer-container:empty{padding:16px 0 0 0}.vot-dialog-container{visibility:visible;position:absolute;z-index:10000}.vot-dialog-container[hidden]{display:block !important;pointer-events:none;visibility:hidden}.vot-dialog-container *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-dialog-backdrop{background-color:rgba(0,0,0,.6);position:fixed;top:0;right:0;bottom:0;left:0;opacity:1;transition:opacity .3s}[hidden]>.vot-dialog-backdrop{pointer-events:none;opacity:0}.vot-dialog{--vot-helper-surface-rgb: var(--vot-surface-rgb, 255, 255, 255);--vot-helper-surface: rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-onsurface: rgba(var(--vot-helper-onsurface-rgb), 0.87);display:block;position:fixed;top:50%;bottom:50%;max-width:initial;max-height:initial;width:min(var(--vot-dialog-width, 512px),100%);height:fit-content;inset-inline-start:0px;inset-inline-end:0px;inset-block-start:0px;inset-block-end:0px;border-radius:8px;margin:auto;padding:0;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);box-shadow:0 0 16px rgba(0,0,0,.12),0 16px 16px rgba(0,0,0,.24);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;user-select:none;visibility:visible;overflow:auto;overflow-y:hidden;opacity:1;transform-origin:center;transform:scale(1);transition:opacity .3s,transform .1s}[hidden]>.vot-dialog{pointer-events:none;opacity:0;transform:scale(0.5);transition:opacity .1s,transform .2s}.vot-dialog-content-wrapper{display:flex;flex-direction:column;max-height:75vh;overflow:auto}.vot-dialog-header-container{flex-shrink:0;align-items:flex-start;display:flex;min-height:31px}.vot-dialog-header-container:empty{padding:0 0 20px 0}.vot-dialog-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-dialog-title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:0}.vot-dialog-title{flex:1;font-size:115.3846153846%;font-weight:bold;line-height:1;padding-bottom:16px;padding-inline-end:20px;padding-inline-start:20px;padding-top:20px}.vot-dialog-body-container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto;padding:0 20px;gap:16px;overscroll-behavior:contain;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb), 0.1) var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar,.vot-dialog-body-container::-webkit-scrollbar-track{height:12px !important;width:12px !important;background:var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb), 0.1) !important;-webkit-border-radius:1ex !important;border:5px solid var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface) !important}.vot-dialog-footer-container{flex-shrink:0;display:flex;justify-content:flex-end;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-dialog-footer-container:empty{padding:20px 0 0 0}.vot-subtitles-widget{display:flex;justify-content:center;align-items:center;position:absolute;width:50%;max-height:100%;min-height:20%;z-index:100;left:25%;top:75%;pointer-events:none}.vot-subtitles{position:relative;max-width:100%;max-height:100%;width:max-content;background:var(--vot-subtitles-background, rgba(46, 47, 52, 0.8));color:var(--vot-subtitles-color, rgb(227, 227, 227));border-radius:1rem;pointer-events:all;padding:1rem;font-size:2rem;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vot-subtitles .passed{color:var(--vot-subtitles-passed-color, rgb(33, 150, 243))}:root{--vot-font-family: "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system;--vot-primary-rgb: 139, 180, 245;--vot-onprimary-rgb: 32, 33, 36;--vot-surface-rgb: 32, 33, 36;--vot-onsurface-rgb: 227, 227, 227;--vot-subtitles-background: rgba(var(--vot-surface-rgb, 46, 47, 52), 0.8);--vot-subtitles-color: rgb(var(--vot-onsurface-rgb, 227, 227, 227));--vot-subtitles-passed-color: rgb(var(--vot-primary-rgb, 33, 150, 243))}vot-block{display:block}',""]);const s=r},"./node_modules/css-loader/dist/runtime/api.js":t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,a,i){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(n)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),a&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=a):c[4]="".concat(a)),e.push(c))}},e}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":t=>{"use strict";t.exports=function(t){return t[1]}},"./node_modules/requestidlecallback-polyfill/index.js":()=>{window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)},window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":t=>{"use strict";var e=[];function o(t){for(var o=-1,n=0;n{"use strict";var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(t,e,o)=>{"use strict";t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var n="";o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var a=void 0!==o.layer;a&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,a&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}");var i=o.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},"./node_modules/webpack-monkey/lib/node/deps/style-loader-insertStyleElement.js":t=>{t.exports=function(){return function(t){return t.styleTagTransform=function(t,e){e?.remove(),GM_addStyle(t)},document.createElement("style")}.apply(null,arguments)}},"./src/config/config.js":(t,e,o)=>{"use strict";o.d(e,{Cc:()=>r,JD:()=>s,K2:()=>d,Pm:()=>a,QL:()=>c,S7:()=>i,mE:()=>l,rw:()=>u,se:()=>n});const n="m3u8-proxy.toil.cc",a="vot.toil.cc",i="xtGCyGdTY2Jy6OMEKdTuXev3Twhkamgm",r="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 YaBrowser/23.7.1.1140 Yowser/2.5 Safari/537.36",s=.15,l="yandex",d="yandex",c={yandex:"https://translate.toil.cc/detect",rustServer:"https://rust-server-531j.onrender.com/detect"},u={yandex:"https://translate.toil.cc/translate"}},"./src/utils/debug.js":(t,e,o)=>{"use strict";o.d(e,{A:()=>a});const n={log:(...t)=>{}},a=n},"./src/utils/storage.js":(t,e,o)=>{"use strict";o.d(e,{d:()=>a});var n=o("./src/utils/debug.js");const a=new class{constructor(){this.gmSupport="function"==typeof GM_getValue,n.A.log(`GM Storage Status: ${this.gmSupport}`)}syncGet(t,e=void 0,o=!1){if(this.gmSupport)return GM_getValue(t,e);let n=window.localStorage.getItem(t);if("udemyData"===t&&"string"==typeof n)try{n=JSON.parse(n)}catch{n=e}return o?Number(n)??Number(e):n??e}async get(t,e=void 0,o=!1){return this.gmSupport?await GM_getValue(t,e):Promise.resolve(this.syncGet(t,e,o))}syncSet(t,e){return this.gmSupport?GM_setValue(t,e):("udemyData"===t&&(e=JSON.stringify(e)),window.localStorage.setItem(t,e))}async set(t,e){return this.gmSupport?await GM_setValue(t,e):Promise.resolve(this.syncSet(t,e))}syncDelete(t){return this.gmSupport?GM_deleteValue(t):window.localStorage.removeItem(t)}async delete(t){return this.gmSupport?await GM_deleteValue(t):Promise.resolve(this.syncDelete(t))}syncList(){return this.gmSupport?GM_listValues():["autoTranslate","dontTranslateLanguage","dontTranslateYourLang","autoSetVolumeYandexStyle","showVideoSlider","syncVolume","subtitlesMaxLength","highlightWords","responseLanguage","defaultVolume","udemyData","audioProxy","showPiPButton","locale-version","locale-lang","locale-phrases"]}async list(){return this.gmSupport?await GM_listValues():Promise.resolve(this.syncList())}}},"./src/yandexRequest-cloudflare.js":(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>r});var n=o("./src/config/config.js"),a=o("./src/utils/debug.js"),i=o("./src/utils/storage.js");const r=async function(t,e,o,r){let s,l;try{a.A.log("yandexRequest:",t);const r={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":n.Cc,Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors",...o},body:Array.from(e)})},d=await i.d.get("proxyWorkerHost",n.Pm);s=await fetch(`https://${d}${t}`,r),a.A.log("yandexRequest:",s.status,s),l=await s.arrayBuffer()}catch(t){console.error("[VOT]",t),s={status:-1},l=t}r(200==s.status,l)}}},e={};function o(n){var a=e[n];if(void 0!==a)return a.exports;var i=e[n]={id:n,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nc=void 0,(()=>{"use strict";const t=["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"],e=["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"],n=["proxitok.pabloferreiro.es","proxitok.pussthecat.org","tok.habedieeh.re","proxitok.esmailelbob.xyz","proxitok.privacydev.net","tok.artemislena.eu","tok.adminforge.de","tik.hostux.net","tt.vern.cc","cringe.whatever.social","proxitok.lunar.icu","proxitok.privacy.com.de"],a=["peertube.1312.media","tube.shanti.cafe","bee-tube.fr","video.sadmin.io","dalek.zone","review.peertube.biz","peervideo.club","tube.la-dina.net","peertube.tmp.rcp.tf"];var i=o("./src/config/config.js");const r=["ru","en","zh","ko","lt","lv","ar","fr","it","es","de","ja"],s=["kk","bn","pt","cs","hi","mr","te","tr","ms","vi","ta","jv","ur","fa","gu","id","uk","da","fi","uz","pl","sv","az","sq","am","hy","af","eu","my","bg","bs","cy","hu","gl","el","zu","kn","ca","km","lo","mk","ml","mt","mn","ne","nl","pa","ro","sr","si","sk","sl","sw","su","hr","et"],l=["ru","en","kk"],d=JSON.parse('{"__version__":3,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","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! {0} 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":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyAccessTokenExpired":"Your entered Udemy Access Token has expired","udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","enterUdemyAccessToken":"Enter Udemy Access Token","VOTUdemyData":"Udemy Data","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings"}');var c=o("./src/utils/debug.js"),u=o("./src/utils/storage.js");const h=["auto","en","ru","af","am","ar","az","bg","bn","bs","ca","cs","cy","da","de","el","es","et","eu","fa","fi","fr","gl","hi","hr","hu","hy","id","it","ja","jv","kk","km","kn","ko","lo","mk","ml","mn","ms","mt","my","ne","nl","pa","pl","pt","ro","si","sk","sl","sq","sr","su","sv","sw","tr","uk","ur","uz","vi","zh","zu"],p=new class{lang="en";locale={};gmValues=["locale-phrases","locale-lang","locale-version","locale-lang-override"];constructor(){const t=u.d.syncGet("locale-lang-override","auto");this.lang=t&&"auto"!==t?t:(navigator.language||navigator.userLanguage)?.substr(0,2)?.toLowerCase()??"en",this.setLocaleFromJsonString(u.d.syncGet("locale-phrases",""))}reset(){this.gmValues.forEach((t=>u.d.syncDelete(t)))}async update(t=!1){(t||2!==await u.d.get("locale-version",0,!0)||await u.d.get("locale-lang")!==this.lang)&&(c.A.log("Updating locale..."),await fetch(`https://raw.githubusercontent.com/ilyhalight/voice-over-translation/master/src/localization/locales/${this.lang}.json`).then((t=>{if(200===t.status)return t.text();throw t.status})).then((async t=>{await u.d.set("locale-phrases",t),this.setLocaleFromJsonString(t);const e=this.getFromLocale(this.locale,"__version__");"number"==typeof e&&await u.d.set("locale-version",e),await u.d.set("locale-lang",this.lang)})).catch((async t=>{console.error("[VOT] [localizationProvider] failed get locale, cause:",t),this.setLocaleFromJsonString(await u.d.get("locale-phrases",""))})))}setLocaleFromJsonString(t){try{this.locale=JSON.parse(t)??{}}catch(t){console.error("[VOT] [localizationProvider]",t),this.locale={}}}getFromLocale(t,e){const o=e.split(".").reduce(((t,e)=>{if("object"==typeof t&&t)return t[e]}),t);return void 0===o&&console.warn("[VOT] [localizationProvider] locale",t,"doesn't contain key",e),o}getDefault(t){return this.getFromLocale(d,t)??t}get(t){return this.getFromLocale(this.locale,t)??this.getFromLocale(d,t)??t}};var g=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),v=o.n(g),m=o("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),b=o.n(m),f=o("./node_modules/style-loader/dist/runtime/insertBySelector.js"),y=o.n(f),w=o("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),x=o.n(w),S=o("./node_modules/webpack-monkey/lib/node/deps/style-loader-insertStyleElement.js"),k=o.n(S),T=o("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),V=o.n(T),M=o("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/main.scss"),L={};L.styleTagTransform=V(),L.setAttributes=x(),L.insert=y().bind(null,"head"),L.domAPI=b(),L.insertStyleElement=k();v()(M.A,L);M.A&&M.A.locals&&M.A.locals;function A(t){const e=document.createElement("vot-block");return e.classList.add("vot-icon-button"),e.innerHTML=t,e}function P(t){const e=parseFloat(t.value),o=""===t.min?0:parseFloat(t.min),n=(e-o)/((""===t.max?100:parseFloat(t.max))-o);t.parentElement.setAttribute("style",`--vot-progress: ${n}`)}function O(t,e="",o=" ",n=!1){const a=document.createElement("vot-block");a.classList.add("vot-textfield");const i=document.createElement(n?"textarea":"input");i.placeholder=o,i.value=e;const r=document.createElement("span");return r.innerHTML=t,a.appendChild(i),a.appendChild(r),{container:a,input:i,label:r}}function E(t){const e=document.createElement("vot-block");e.classList.add("vot-dialog-container"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-dialog-backdrop");const n=document.createElement("vot-block");n.classList.add("vot-dialog");const a=document.createElement("vot-block");a.classList.add("vot-dialog-content-wrapper");const i=document.createElement("vot-block");i.classList.add("vot-dialog-header-container");const r=document.createElement("vot-block");r.classList.add("vot-dialog-body-container");const s=document.createElement("vot-block");s.classList.add("vot-dialog-footer-container");const l=document.createElement("vot-block");l.classList.add("vot-dialog-title-container");const d=A('');d.classList.add("vot-dialog-close-button"),o.onclick=d.onclick=()=>{e.hidden=!0};const c=document.createElement("vot-block");return c.classList.add("vot-dialog-title"),c.innerHTML=t,e.appendChild(o),e.appendChild(n),n.appendChild(a),a.appendChild(i),a.appendChild(r),a.appendChild(s),i.appendChild(l),i.appendChild(d),l.appendChild(c),{container:e,backdrop:o,dialog:n,contentWrapper:a,headerContainer:i,bodyContainer:r,footerContainer:s,titleContainer:l,closeButton:d,title:c}}function C(t,e,o,n={}){const a=n.onSelectCb||function(){},i=n.labelElement||"";let r=[];const s=document.createElement("vot-block");s.classList.add("vot-select"),i&&s.appendChild(i);const l=document.createElement("vot-block");l.classList.add("vot-select-outer");const d=document.createElement("span");d.classList.add("vot-select-title"),d.innerText=t,void 0===t&&(d.innerText=o.find((t=>!0===t.selected))?.label);const c=document.createElement("vot-block");c.classList.add("vot-select-arrow-icon"),c.innerHTML='',l.append(d,c),l.onclick=()=>{const t=E(e);t.container.classList.add("vot-dialog-temp"),t.container.hidden=!1,document.documentElement.appendChild(t.container);const n=document.createElement("vot-block");n.classList.add("vot-select-content-list");for(const t of o){const e=document.createElement("vot-block");e.classList.add("vot-select-content-item"),e.innerText=t.label,e.dataset.votSelected=t.selected,e.dataset.votValue=t.value,t.disabled&&(e.inert=!0),e.onclick=async i=>{if(i.target.inert)return;n.childNodes.forEach((t=>t.dataset.votSelected=!1)),o.forEach((e=>e.selected=e.value===t.value)),e.dataset.votSelected=!0,d.innerText=t.label,await a(i)},n.appendChild(e)}const i=O(p.get("searchField"));i.input.oninput=t=>{const e=t.target.value.toLowerCase();Array.from(r).forEach((t=>t.hidden=!t.innerText.toLowerCase().includes(e)))},t.bodyContainer.append(i.container,n),r=n.childNodes,t.backdrop.onclick=t.closeButton.onclick=()=>{t.container.remove(),r=[]}},s.append(l);return{container:s,title:d,arrowIcon:c,labelElement:i,setTitle:t=>{d.innerText=t},setSelected:t=>{Array.from(r).filter((t=>!t.inert)).forEach((e=>e.dataset.votSelected=e.dataset.votValue===t)),o.forEach((e=>e.selected=String(e.value)===t))},updateItems:t=>{o=t}}}const B={createHeader:function(t,e=4){const o=document.createElement("vot-block");return o.classList.add("vot-header"),o.classList.add(`vot-header-level-${e}`),o.innerHTML=t,o},createInformation:function(t,e){const o=document.createElement("vot-block");o.classList.add("vot-info");const n=document.createElement("vot-block");n.innerHTML=t;const a=document.createElement("vot-block");return a.innerHTML=e,o.appendChild(n),o.appendChild(a),{container:o,header:n,value:a}},createButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-button"),e.innerHTML=t,e},createTextButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-text-button"),e.innerHTML=t,e},createOutlinedButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-outlined-button"),e.innerHTML=t,e},createIconButton:A,createCheckbox:function(t,e=!1){const o=document.createElement("label");o.classList.add("vot-checkbox");const n=document.createElement("input");n.type="checkbox",n.checked=Boolean(e);const a=document.createElement("span");return a.innerHTML=t,o.appendChild(n),o.appendChild(a),{container:o,input:n,label:a}},createSlider:function(t,e=50,o=0,n=100){const a=document.createElement("vot-block");a.classList.add("vot-slider");const i=document.createElement("input");i.type="range",i.min=o,i.max=n,i.value=e;const r=document.createElement("span");return r.innerHTML=t,a.appendChild(i),a.appendChild(r),i.addEventListener("input",(t=>P(t.target))),P(i),{container:a,input:i,label:r}},createTextfield:O,createDialog:E,createVOTButton:function(t){const e=document.createElement("vot-block");e.classList.add("vot-segmented-button");const o=document.createElement("vot-block");o.classList.add("vot-segment"),o.classList.add("vot-translate-button"),o.innerHTML='';const n=document.createElement("vot-block");n.classList.add("vot-separator");const a=document.createElement("vot-block");a.classList.add("vot-segment-only-icon"),a.innerHTML='';const i=document.createElement("vot-block");i.classList.add("vot-separator");const r=document.createElement("vot-block");r.classList.add("vot-segment-only-icon"),r.innerHTML='';const s=document.createElement("span");return s.classList.add("vot-segment-label"),s.innerHTML=t,e.appendChild(o),e.appendChild(n),e.appendChild(a),e.appendChild(i),e.appendChild(r),o.appendChild(s),{container:e,translateButton:o,separator:n,pipButton:a,separator2:i,menuButton:r,label:s}},createVOTMenu:function(t){const e=document.createElement("vot-block");e.classList.add("vot-menu"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-menu-content-wrapper");const n=document.createElement("vot-block");n.classList.add("vot-menu-header-container");const a=document.createElement("vot-block");a.classList.add("vot-menu-body-container");const i=document.createElement("vot-block");i.classList.add("vot-menu-footer-container");const r=document.createElement("vot-block");r.classList.add("vot-menu-title-container");const s=document.createElement("vot-block");return s.classList.add("vot-menu-title"),s.innerHTML=t,e.appendChild(o),o.appendChild(n),o.appendChild(a),o.appendChild(i),n.appendChild(r),r.appendChild(s),{container:e,contentWrapper:o,headerContainer:n,bodyContainer:a,footerContainer:i,titleContainer:r,title:s}},createVOTSelectLabel:function(t){const e=document.createElement("span");return e.classList.add("vot-select-label"),e.innerText=t,e},createVOTSelect:C,createVOTLanguageSelect:function(t){const e=t.fromTitle||"#UNDEFINED",o=t.fromDialogTitle||"#UNDEFINED",n=t.fromItems||[],a=t.fromOnSelectCB||function(){},i=t.toTitle||"#UNDEFINED",r=t.toDialogTitle||"#UNDEFINED",s=t.toItems||[],l=t.toOnSelectCB||function(){},d=document.createElement("vot-block");d.classList.add("vot-lang-select");const c=C(e,o,n,{onSelectCb:a}),u=document.createElement("vot-block");u.classList.add("vot-lang-select-icon"),u.innerHTML='';const h=C(i,r,s,{onSelectCb:l});return d.append(c.container,u,h.container),{container:d,fromSelect:c,icon:u,toSelect:h}},updateSlider:P};class F extends Error{constructor(t){super(p.getDefault(t)),this.name="VOTLocalizedError",this.unlocalizedMessage=t,this.localizedMessage=p.get(t)}}async function _(t,e){const o=new AbortController,n=setTimeout((()=>o.abort()),3e3);try{return await fetch(t,{...e,signal:o.signal})}catch(t){return console.error("Fetch timed-out. Error:",t),t}finally{clearTimeout(n)}}const R={async translate(t,e){try{const o=await _(i.rw.yandex,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,lang:e})});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.text[0]}catch(e){return console.error("Error translating text:",e),t}},async detect(t,e){try{const o=await _(i.QL.yandex,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,lang:e})});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.lang??"en"}catch(t){return console.error("Error translating text:",t),"en"}}},q={async detect(t){try{const e=await fetch(i.QL.rustServer,{method:"POST",body:t});if(e instanceof Error)throw e;return await e.text()}catch(t){return console.error("Error getting lang from text:",t),"en"}}};const D=["yandex"],z=["yandex","rust-server"];async function I(t,e,o,n){if(!window.location.hostname.includes("m.youtube.com")&&t?.getAudioTrack){const e=t.getAudioTrack(),o=e?.getLanguageInfo();if("und"!==o?.id)return Z(o.id.split(".")[0])}const a=e?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(a?.length){const t=a.find((t=>"asr"===t.kind));if(t&&t.languageCode)return Z(t.languageCode)}const r=[/(?:https?|ftp):\/\/[\S]+/g,/https?:\/\/\S+|www\.\S+/gm,/\b\S+\.\S+/gm,/#[^\s#]+/g,/Auto-generated by YouTube/g,/Provided to YouTube by/g,/Released on/g,/Bitcoin/g,/USDT/g,/Paypal/g],s=[o,n?n.split("\n\n").filter((t=>!r.some((e=>e.test(t))))).join("\n\n"):""].join(" ").replace(/[^\p{L}\s]/gu," ").trim().replace(/\s+/g," ").slice(0,1e3);return await async function(t){switch(await u.d.get("detectService",i.K2)){case"yandex":return await R.detect(t);case"rust-server":return await q.detect(t);default:return"en"}}(s)}function $(){return/^m\.youtube\.com$/.test(window.location.hostname)}function N(){return window.location.pathname.startsWith("/shorts/")?$()?document.querySelector("#movie_player"):document.querySelector("#shorts-player"):document.querySelector("#movie_player")}function H(){const t=N();return t?.getPlayerResponse?t?.getPlayerResponse?.call()??null:t?.data?.playerResponse??null}function j(){const t=N();return t?.getVideoData?t?.getVideoData?.call()??null:t?.data?.playerResponse?.videoDetails??null}const U={isMobile:$,getPlayer:N,getPlayerResponse:H,getPlayerData:j,getVideoVolume:function(){const t=N();return t?.getVolume?t.getVolume.call()/100:1},getSubtitles:function(){const t=H();let e=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks??[];return e=e.reduce(((t,e)=>{if("languageCode"in e){const o=e?.languageCode?Z(e?.languageCode):void 0,n=e?.url||e?.baseUrl;o&&n&&t.push({source:"youtube",language:o,isAutoGenerated:"asr"===e?.kind,url:`${n.startsWith("http")?n:`${window.location.origin}/${n}`}&fmt=json3`})}return t}),[]),c.A.log("youtube subtitles:",e),e},getVideoData:async function(){const t=N(),e=H(),o=j(),{title:n}=o??{},{shortDescription:a,isLive:i}=e?.videoDetails??{};let s=n?await I(t,e,n,a):"en";s=r.includes(s)?s:"en";const l={isLive:!!i,title:n,description:a,detectedLanguage:s};return c.A.log("youtube video data:",l),console.log("[VOT] Detected language: ",l.detectedLanguage),l},setVideoVolume:function(t){const e=N();if(e?.setVolume)return e.setVolume(Math.round(100*t)),!0},videoSeek:function(t,e){c.A.log("videoSeek",e);const o=(N()?.getProgressState()?.seekableEnd||t.currentTime)-e;t.currentTime=o}},W=navigator.language||navigator.userLanguage,G=W?.substr(0,2)?.toLowerCase()??"en",Y=(t,e)=>{let o=new URL(window.location.href);switch(t){case"piped":case"invidious":case"youtube":if(o.searchParams.has("enablejsapi")){const t=U.getPlayer().getVideoUrl();o=new URL(t)}return o.pathname.match(/(?:watch|embed|shorts)\/([^/]+)/)?.[1]||o.searchParams.get("v");case"vk":return o.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)?o.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)[0].slice(1):o.searchParams.get("z")?o.searchParams.get("z").split("/")[0]:!(!o.searchParams.get("oid")||!o.searchParams.get("id"))&&`video-${Math.abs(o.searchParams.get("oid"))}_${o.searchParams.get("id")}`;case"nine_gag":case"9gag":case"gag":return o.pathname.match(/gag\/([^/]+)/)?.[1];case"twitch":if(/^m\.twitch\.tv$/.test(window.location.hostname)){const t=document.head.querySelector('link[rel="canonical"]');return t?.href.match(/videos\/([^/]+)/)?.[0]||o.pathname.slice(1)}if(/^player\.twitch\.tv$/.test(window.location.hostname))return`videos/${o.searchParams.get("video")}`;if(/^clips\.twitch\.tv$/.test(window.location.hostname)){const t=document.querySelector(".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']");if(!t)return!1;return`${t.href.replace("https://www.twitch.tv/","")}/clip/${o.searchParams.get("clip")}`}return o.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)?o.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)[0]:o.pathname.match(/(?:videos)\/([^/]+)/)?.[0];case"proxytok":return o.pathname.match(/([^/]+)\/video\/([^/]+)/)?.[0];case"tiktok":{let t=o.pathname.match(/([^/]+)\/video\/([^/]+)/)?.[0];if(!t){const o=e.closest(".xgplayer-playing, .tiktok-web-player"),n=o?.closest('div[data-e2e="recommend-list-item-container"]'),a=n?.querySelector('a[data-e2e="video-author-avatar"]');if(o&&a){const e=o.id?.match(/^xgwrapper-[0-9]+-(.*)$/)?.at(1),n=a.href?.match(/.*(@.*)$/)?.at(1);e&&n&&(t=`${n}/video/${e}`)}}return t}case"vimeo":{const t=o.searchParams.get("app_id"),e=o.pathname.match(/[^/]+\/[^/]+$/)?.[0]||o.pathname.match(/[^/]+$/)?.[0];return t?`${e}?app_id=${t}`:e}case"xvideos":return o.pathname.match(/[^/]+\/[^/]+$/)?.[0];case"pornhub":return o.searchParams.get("viewkey")||o.pathname.match(/embed\/([^/]+)/)?.[1];case"twitter":return o.pathname.match(/status\/([^/]+)/)?.[1];case"udemy":case"rumble":case"facebook":return o.pathname;case"rutube":return o.pathname.match(/(?:video|embed)\/([^/]+)/)?.[1];case"coub":return o.pathname.includes("/view")?o.pathname.match(/view\/([^/]+)/)?.[1]:o.pathname.includes("/embed")?o.pathname.match(/embed\/([^/]+)/)?.[1]:document.querySelector(".coub.active")?.dataset?.permalink;case"bilibili":{const t=o.searchParams.get("bvid");if(t)return t;{let t=o.pathname.match(/video\/([^/]+)/)?.[1];return t&&o.search&&null!==o.searchParams.get("p")&&(t+=`/?p=${o.searchParams.get("p")}`),t}}case"mail_ru":if(o.pathname.startsWith("/v/")||o.pathname.startsWith("/mail/"))return o.pathname;if(o.pathname.match(/video\/embed\/([^/]+)/)){const t=document.querySelector(".b-video-controls__mymail-link");return!!t&&t?.href.split("my.mail.ru")?.[1]}return!1;case"bitchute":return o.pathname.match(/video\/([^/]+)/)?.[1];case"coursera":return o.pathname.match(/learn\/([^/]+)\/lecture\/([^/]+)/)?.[0];case"eporner":return o.pathname.match(/video-([^/]+)\/([^/]+)/)?.[0];case"peertube":return o.pathname.match(/\/w\/([^/]+)/)?.[0];case"dailymotion":{const t=Array.from(document.querySelectorAll("*")).filter((t=>t.innerHTML.trim().includes(".m3u8")));try{let e=t[1].lastChild.src;return e.match(/\/video\/(\w+)\.m3u8/)?.[1]}catch(t){return console.error("[VOT]",t),!1}}case"trovo":{if(!o.pathname.startsWith("/s/"))return!1;const t=o.searchParams.get("vid");if(!t)return!1;const e=o.pathname.match(/([^/]+)\/([\d]+)/)?.[0];return!!e&&`${e}?vid=${t}`}case"yandexdisk":return o.pathname.match(/\/i\/([^/]+)/)?.[1];case"coursehunter":{const t=o.pathname.match(/\/course\/([^/]+)/)?.[1];return!!t&&t+o.search}case"ok.ru":return o.pathname.match(/\/video\/(\d+)/)?.[0];case"googledrive":return o.searchParams.get("docid");case"bannedvideo":return o.searchParams.get("id");case"weverse":return o.pathname.match(/([^/]+)\/(live|media)\/([^/]+)/)?.[0];case"newgrounds":return o.pathname.match(/([^/]+)\/(view)\/([^/]+)/)?.[0];case"egghead":return o.pathname;case"youku":return o.pathname.match(/v_show\/id_[\w=]+/)?.[0];default:return!1}};function Z(t){return t.toLowerCase().split(";")[0].trim().split("-")[0].split("_")[0]}function K(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}function J(){return"undefined"!=typeof Hls&&Hls?.isSupported()?new Hls({debug:!1,lowLatencyMode:!0,backBufferLength:90}):void 0}function Q(t,e,o,n){let a=e;return e>n?(a=o+(e-n),a=a>100?100:Math.max(a,0),t.volume=a/100):e100?100:Math.max(a,0),t.volume=a/100),a}const X=new protobuf.Type("VideoTranslationHelpObject").add(new protobuf.Field("target",1,"string")).add(new protobuf.Field("targetUrl",2,"string")),tt=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("duration",6,"double")).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,"VideoTranslationHelpObject","repeated")).add(new protobuf.Field("responseLanguage",14,"string")).add(new protobuf.Field("unknown5",15,"int32")).add(new protobuf.Field("unknown6",16,"int32")).add(new protobuf.Field("unknown7",17,"int32")),et=new protobuf.Type("VideoSubtitlesRequest").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("language",2,"string")),ot=new protobuf.Type("VideoStreamRequest").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("language",2,"string")).add(new protobuf.Field("responseLanguage",3,"string")),nt=new protobuf.Type("VideoStreamPingRequest").add(new protobuf.Field("pingId",1,"int32")),at=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("unknown0",6,"int32")).add(new protobuf.Field("unknown1",7,"string")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("message",9,"string")),it=new protobuf.Type("VideoSubtitlesObject").add(new protobuf.Field("language",1,"string")).add(new protobuf.Field("url",2,"string")).add(new protobuf.Field("unknown2",3,"int32")).add(new protobuf.Field("translatedLanguage",4,"string")).add(new protobuf.Field("translatedUrl",5,"string")).add(new protobuf.Field("unknown5",6,"int32")).add(new protobuf.Field("unknown6",7,"int32")),rt=new protobuf.Type("VideoSubtitlesResponse").add(new protobuf.Field("unknown0",1,"int32")).add(new protobuf.Field("subtitles",2,"VideoSubtitlesObject","repeated")),st=new protobuf.Type("VideoStreamObject").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("timestamp",2,"int64")),lt=new protobuf.Type("VideoStreamResponse").add(new protobuf.Field("interval",1,"int32")).add(new protobuf.Field("translatedInfo",2,"VideoStreamObject")).add(new protobuf.Field("pingId",3,"int32")),dt=(new protobuf.Root).define("yandex").add(X).add(tt).add(at).add(et).add(it).add(rt).add(nt).add(ot).add(st).add(lt),ct={encodeTranslationRequest:(t,e,o,n,a)=>dt.VideoTranslationRequest.encode({url:t,firstRequest:!0,duration:e,unknown2:1,language:o,unknown3:0,unknown4:0,translationHelp:a,responseLanguage:n,unknown5:0,unknown6:1,unknown7:0}).finish(),decodeTranslationResponse:t=>dt.VideoTranslationResponse.decode(new Uint8Array(t)),encodeSubtitlesRequest:(t,e)=>dt.VideoSubtitlesRequest.encode({url:t,language:e}).finish(),decodeSubtitlesResponse:t=>dt.VideoSubtitlesResponse.decode(new Uint8Array(t)),encodeStreamPingRequest:t=>dt.VideoStreamPingRequest.encode({pingId:t}).finish(),encodeStreamRequest:(t,e,o)=>dt.VideoStreamRequest.encode({url:t,language:e,responseLanguage:o}).finish(),decodeStreamResponse:t=>dt.VideoStreamResponse.decode(new Uint8Array(t))};var ut=o("./node_modules/bowser/es5.js");function ht(t){const e=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)));return t?e:e.toUpperCase()}async function pt(t){const e=new TextEncoder("utf-8"),o=await window.crypto.subtle.importKey("raw",e.encode(i.S7),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),n=await window.crypto.subtle.sign("HMAC",o,t);return Array.from(new Uint8Array(n),(t=>t.toString(16).padStart(2,"0"))).join("")}const gt=async function(t,e){try{c.A.log("requestStreamPing");const n=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest-cloudflare.js"))).default;c.A.log("Inited yandexRequest...");const a=ct.encodeStreamPingRequest(t);await n("/stream-translation/ping-stream",a,{"Vtrans-Signature":await pt(a),"Sec-Vtrans-Token":ht(!1)},e)}catch(t){console.error("[VOT]",t),e(!1)}};const vt=async function(t,e,n,a){try{c.A.log("requestStreamTranslation");const i=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest-cloudflare.js"))).default;c.A.log("Inited yandexRequest...");const r=ct.encodeStreamRequest(t,e,n);await i("/stream-translation/translate-stream",r,{"Vtrans-Signature":await pt(r),"Sec-Vtrans-Token":ht(!1)},a)}catch(t){console.error("[VOT]",t),a(!1)}};const mt=async function(t,e,n,a,i,r){try{c.A.log("requestVideoTranslation");const s=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest-cloudflare.js"))).default;c.A.log("Inited yandexRequest...");const l=ct.encodeTranslationRequest(t,e,n,a,i);await s("/video-translation/translate",l,{"Vtrans-Signature":await pt(l),"Sec-Vtrans-Token":ht(!1)},r)}catch(t){console.error("[VOT]",t),r(!1)}};const bt=async function(t,e,n){try{c.A.log("requestVideoSubtitles");const a=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest-cloudflare.js"))).default;c.A.log("Inited yandexRequest...");const i=ct.encodeSubtitlesRequest(t,e);await a("/video-subtitles/get-subtitles",i,{"Vsubs-Signature":await pt(i),"Sec-Vsubs-Token":ht(!1)},n)}catch(t){console.error("[VOT]",t),n(!1)}};function ft(t){const e=t.startMs+t.durationMs;return t.tokens.reduce(((o,n,a)=>{const i=t.tokens[a+1];let r;o.length>0&&(r=o[o.length-1]);const s=r?.alignRange?.end??0,l=s+n.text.length;if(n.alignRange={start:s,end:l},o.push(n),i){const t=n.startMs+n.durationMs,a=i.startMs?i.startMs-t:e-t;o.push({text:" ",startMs:t,durationMs:a,alignRange:{start:l,end:l+1}})}return o}),[])}function yt(t,e){const o=t.text.split(/([\n \t])/).reduce(((t,o)=>{if(o.length){const n=t[t.length-1]??e,a=n?.alignRange?.end??0,i=a+o.length;t.push({text:o,alignRange:{start:a,end:i}})}return t}),[]),n=Math.floor(t.durationMs/o.length),a=t.startMs+t.durationMs;return o.map(((e,i)=>{const r=i===o.length-1,s=t.startMs+n*i;return{...e,startMs:s,durationMs:r?a-s:n}}))}async function wt(t){let e=!1,o=await Promise.race([new Promise((t=>{setTimeout((()=>{e||(console.error("[VOT] Failed to fetch subtitles. Reason: timeout"),t([]))}),5e3)})),new Promise((o=>{c.A.log("Fetching subtitles:",t),fetch(t.url).then((t=>t.json())).then((t=>{e=!0,o(t)})).catch((t=>{console.error("[VOT] Failed to fetch subtitles. Reason:",t),e=!0,o({containsTokens:!1,subtitles:[]})}))}))]);return"youtube"===t.source&&(o=function(t){const e={containsTokens:!1,subtitles:[]};if("object"!=typeof t||!("events"in t)||!Array.isArray(t.events))return console.error("[VOT] Failed to format youtube subtitles",t),e;for(let o=0;ot.utf8.replace(/^ +| +$/g,""))).join(" ");let a=t.events[o].dDurationMs;t.events[o+1]&&t.events[o].tStartMs+t.events[o].dDurationMs>t.events[o+1].tStartMs&&(a=t.events[o+1].tStartMs-t.events[o].tStartMs),"\n"!==n&&e.subtitles.push({text:n,startMs:t.events[o].tStartMs,durationMs:a})}return e}(o)),o.subtitles=function(t,e){const o=[];let n;for(const a of t.subtitles){let i;if(a?.tokens?.length){if("yandex"!==e)return console.warn("[VOT] Unsupported subtitles tokens type: ",e),t.containsTokens=!1,null;i=ft(a)}else i=yt(a,n);n=i[i.length-1],o.push({...a,tokens:i})}return t.containsTokens=!0,o}(o,t.source),console.log("[VOT] subtitles:",o),o}class xt{dragging=!1;subtitlesContainerRect=null;containerRect=null;offsetX=null;offsetY=null;lastContent=null;highlightWords=!1;subtitles=null;maxLength=300;maxLengthRegexp=/.{1,300}(?:\s|$)/g;constructor(t,e,o){this.site=o,this.video=t,"youtube"===this.site.host&&"mobile"!==this.site.additionalData?this.container=e.parentElement:this.container=e,this.votSubtitlesContainer=document.createElement("vot-block"),this.votSubtitlesContainer.classList.add("vot-subtitles-widget"),this.container.appendChild(this.votSubtitlesContainer),this.onMouseDownBound=this.onMouseDown.bind(this),this.onMouseUpBound=this.onMouseUp.bind(this),this.onMouseMoveBound=this.onMouseMove.bind(this),this.onTimeUpdateBound=this.onTimeUpdate.bind(this),document.addEventListener("mousedown",this.onMouseDownBound),document.addEventListener("mouseup",this.onMouseUpBound),document.addEventListener("mousemove",this.onMouseMoveBound),this.video?.addEventListener("timeupdate",this.onTimeUpdateBound)}release(){this.video?.removeEventListener("timeupdate",this.onTimeUpdateBound),document.removeEventListener("mousedown",this.onMouseDownBound),document.removeEventListener("mouseup",this.onMouseUpBound),document.removeEventListener("mousemove",this.onMouseMoveBound),this.votSubtitlesContainer.remove()}onMouseDown(t){this.votSubtitlesContainer.contains(t.target)&&(this.subtitlesContainerRect=this.votSubtitlesContainer.getBoundingClientRect(),this.containerRect=this.container.getBoundingClientRect(),this.offsetX=t.clientX-this.subtitlesContainerRect.x,this.offsetY=t.clientY-this.subtitlesContainerRect.y,this.dragging=!0)}onMouseUp(){this.dragging=!1}onMouseMove(t){if(this.dragging){t.preventDefault();const e=t.clientX-this.offsetX,o=t.clientY-this.offsetY,n=o>=this.containerRect.top,a=o+this.subtitlesContainerRect.height<=this.containerRect.bottom,i=e>=this.containerRect.left,r=e+this.subtitlesContainerRect.width<=this.containerRect.right;this.votSubtitlesContainer.style.top=n&&a?o-this.containerRect.y+"px":n?this.containerRect.height-this.subtitlesContainerRect.height+"px":"0px",this.votSubtitlesContainer.style.left=i&&r?e-this.containerRect.x+"px":i?this.containerRect.width-this.subtitlesContainerRect.width+"px":"0px"}}onTimeUpdate(){this.update()}setContent(t){t&&this.video?(this.subtitles=t,this.update()):(this.subtitles=null,this.votSubtitlesContainer.innerHTML="")}setMaxLength(t){"number"==typeof t&&t&&(this.maxLength=t,this.maxLengthRegexp=new RegExp(`.{1,${t}}(?:\\s|$)`,"g"),this.update())}setHighlightWords(t){this.highlightWords!==!!t&&(this.highlightWords=!!t,this.update())}update(){if(!this.video)return;let t="",e=this.highlightWords&&this.subtitles?.containsTokens;const o=1e3*this.video.currentTime,n=this.subtitles?.subtitles?.findLast((t=>t.startMsthis.maxLength){let t=[],n=0,a=0,i=0;for(let o=0;othis.maxLength){let r=e.slice(n,a+1);r.at(0)&&" "===r.at(0).text&&(r=r.slice(1)),r.at(-1)&&" "===r.at(-1).text&&(r=r.slice(0,r.length-1)),t.push({startMs:e[n].startMs,durationMs:e[a].startMs+e[a].durationMs-e[n].startMs,tokens:r}),n=o,i=0}a=o}for(const n of t)if(n.startMse||o>n.startMs-100&&e-o<275?'class="passed"':""}>${n.text}`}}else if(n.text.length>this.maxLength){let e=n.text.match(this.maxLengthRegexp),a=n.durationMs/e.length;for(let i=0;i${t.replace("\\n","
")}`:"")}}const St={getVideoData:async function(){const t=window.course_id??document.querySelector('input[name="course_id"]')?.value,e=window.lessons??await async function(t){const e=await fetch(`https://coursehunter.net/api/v1/course/${t}/lessons`);return await e.json()}(t),o=parseInt(document.querySelector(".lessons-item_active")?.dataset?.index??1),n=e?.[o-1],{file:a,duration:i}=n;return c.A.log("coursehunter course data:",e),{url:a,duration:i}}};function kt(){return Tt()?.player}function Tt(){return document.querySelector(".vjs-v6")}const Vt={getPlayer:Tt,getPlayerData:kt,getVideoData:async function(t="en"){let e=null;const o=kt(),{duration:n}=o?.cache_||{},{courseId:a,tracks:i,sources:s}=o?.options_||{},l=function(t){const e=t?.find((t=>"video/mp4"===t.type));return e?.src}(s),d=await async function(t){const e=await fetch(`https://www.coursera.org/api/onDemandCourses.v1/${t}`),o=await e.json();return o?.elements?.[0]}(a);let u=d?.primaryLanguageCodes?.[0];u=u?Z(u):"en",r.includes(u)||(u="en");const h=function(t,e,o){let n=t?.find((t=>Z(t.srclang)===e));return n||(n=t?.find((t=>Z(t.srclang)===o))||t?.[0]),n?.src}(i,u,t);console.log(`videoURL: ${l}, subtitlesURL: ${h}`),h&&l?e=[{target:"video_file_url",targetUrl:l},{target:"subtitles_file_url",targetUrl:`https://www.coursera.org${h}`}]:console.error(`Failed to find subtitlesURL or videoURL. videoURL: ${l}, subtitlesURL: ${h}`);const p={duration:n,detectedLanguage:u,translationHelp:e};return c.A.log("coursera video data:",p),console.log("[VOT] Detected language: ",p.detectedLanguage),p}},Mt="https://www.udemy.com/api-2.0",Lt=2592e6;async function At(t){const e=await fetch(`${Mt}/courses/${t}/?`+new URLSearchParams({"fields[course]":"locale",use_remote_version:"true",caching_intent:"true"}));return await e.json()}async function Pt(t,e,o){if(!(n=t.expires,n+Lt>(new Date).getTime()&&t.accessToken))return void console.error(p.get("udemyAccessTokenExpired"));var n;const a=`Bearer ${t.accessToken}`,i=await fetch(`${Mt}/users/me/subscribed-courses/${e}/lectures/${o}/?`+new URLSearchParams({"fields[lecture]":"asset","fields[asset]":"length,media_sources,captions"}),{headers:{"x-udemy-authorization":a,authorization:a}});return await i.json()}function Ot(){return Ct()?.player}function Et(){const t=document.querySelector(".ud-app-loader[data-module-id='course-taking']")?.dataset?.moduleArgs;return t?JSON.parse(t):(console.error(p.get("udemyModuleArgsNotFound")),{})}function Ct(){return document.querySelector(".vjs-v7")}const Bt={getPlayer:Ct,getPlayerData:Ot,getVideoData:async function(t,e="en"){let o=null;const n=Ot();c.A.log("udemyData",t);const a=Et();c.A.log("moduleData: ",a);const i=a.courseId,s=window.location.pathname.match(/learn\/lecture\/([^/]+)/)?.[1];c.A.log(`CourseId: ${i}, lectureId: ${s}`);const l=await At(i);c.A.log("courseLang Data:",l);const d=await Pt(t,i,s);console.log("lecture Data:",d);let u=l?.locale?.locale;u=u?Z(u):"en",r.includes(u)||(u="en");const h=d?.asset?.length||n?.cache_?.duration,p=function(t){const e=t?.find((t=>"video/webm"===t.type||"video/mp4"===t.type));return e?.src}(d?.asset?.media_sources)||function(){const t=Ct()?.querySelector("video")?.src;return!t?.startsWith("blob:")&&t}(),g=function(t,e,o){let n=t?.find((t=>Z(t.locale_id)===e));return n||(n=t?.find((t=>Z(t.locale_id)===o))||t?.[0]),n?.url}(d?.asset?.captions,u,e);console.log(`videoURL: ${p}, subtitlesURL: ${g}`),g&&p?o=[{target:"video_file_url",targetUrl:p},{target:"subtitles_file_url",targetUrl:g}]:console.error(`Failed to find subtitlesURL or videoURL. videoURL: ${p}, subtitlesURL: ${g}`);const v={duration:h,detectedLanguage:u,translationHelp:o};return c.A.log("udemy video data:",v),console.log("[VOT] Detected language: ",v.detectedLanguage),v},getModuleData:Et,getCourseLang:At,getLectureData:Pt};const Ft={getVideoData:async function(t){const e=await async function(t){return await fetch("https://api.banned.video/graphql",{method:"POST",body:JSON.stringify({operationName:"GetVideo",query:"query GetVideo($id: String!) {\n getVideo(id: $id) {\n ...DisplayVideoFields\n videoUrl: directUrl\n live\n }\n }\n\n fragment DisplayVideoFields on Video {\n title\n description: summary\n duration: videoDuration\n }",variables:{id:t}}),headers:{"User-Agent":"bannedVideoFrontEnd","apollographql-client-name":"banned-web","apollographql-client-version":"1.3","content-type":"application/json"}}).then((t=>t.json())).catch((t=>(console.error(t),{data:{getVideo:{}}})))}(t);c.A.log("banned.video video data:",e);const{videoUrl:o,duration:n,live:a,description:i,title:r}=e.data.getVideo;return{url:o,duration:n,live:a,title:r,description:i}}};const _t="https://global.apis.naver.com/weverse/wevweb",Rt="be4d79eb8fc7bd008ee82c8ec4ff6fd4",qt="1b9cb6378d959b45714bec49971ade22e6e24e42";async function Dt(t){const e=Date.now();let o=t.substring(0,Math.min(255,t.length))+e;const n=await async function(t,e){const o=new TextEncoder("utf-8");return e=o.encode(e),window.crypto.subtle.importKey("raw",o.encode(t),{name:"HMAC",hash:{name:"SHA-1"}},!1,["sign","verify"]).then((t=>window.crypto.subtle.sign("HMAC",t,e))).then((t=>btoa(String.fromCharCode(...new Uint8Array(t))))).catch((t=>(console.error(t),!1)))}(qt,o);return{wmsgpad:e,wmd:n}}function zt(){return{appId:Rt,language:"en",os:"WEB",platform:"WEB",wpf:"pc"}}const It={getVideoData:async function(){const t=new URL(window.location).pathname.match(/([^/]+)\/(live|media)\/([^/]+)/)?.[3],e=await async function(t){const e=`/post/v1.0/post-${t}/preview?`+new URLSearchParams({fieldSet:"postForPreview",...zt()}),o=await Dt(e);return await fetch(_t+e+"&"+new URLSearchParams(o)).then((t=>t.json())).catch((t=>(console.error(t),{extension:{video:{}}})))}(t);c.A.log("weverse video preview data:",e);const{videoId:o,serviceId:n,infraVideoId:a}=e.extension.video;if(!(o&&n&&a))return!1;const{inKey:i}=await async function(t){const e=`/video/v1.1/vod/${t}/inKey?`+new URLSearchParams({gcc:"RU",...zt()}),o=await Dt(e);return await fetch(_t+e+"&"+new URLSearchParams(o),{method:"POST"}).then((t=>t.json())).catch((t=>(console.error(t),{})))}(o);if(c.A.log("weverse video inKey data:",e),!i)return!1;const r=await async function(t,e,o){const n=Date.now();return await fetch(`https://global.apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/${t}?`+new URLSearchParams({key:e,sid:o,nonce:n,devt:"html5_pc",prv:"N",aup:"N",stpb:"N",cpl:"en",env:"prod",lc:"en",adi:[{adSystem:null}],adu:"/"})).then((t=>t.json())).catch((t=>(console.error(t),{videos:{list:[]}})))}(a,i,n);c.A.log("weverse video data:",r);const s=r.videos.list.find((t=>!1===t.useP2P&&t.source.includes(".mp4")));if(!s)return!1;const{source:l,duration:d}=s;return{url:l,duration:d}}},$t=[{additionalData:"mobile",host:"youtube",url:"https://youtu.be/",match:/^m.youtube(-nocookie)?.com$/,selector:"shorts-video #player"},{additionalData:"mobile",host:"youtube",url:"https://youtu.be/",match:/^m.youtube(-nocookie)?.com$/,selector:".player-container"},{host:"youtube",url:"https://youtu.be/",match:/^(www.)?youtube(-nocookie|kids)?.com$/,selector:".html5-video-container:not(#inline-player *)"},{host:"tiktok",url:"https://www.tiktok.com/",match:/^(www.)?tiktok.com$/,selector:null},{host:"proxytok",url:"https://www.tiktok.com/",match:n,selector:".column.has-text-centered"},{host:"twitch",url:"https://twitch.tv/",match:[/^m.twitch.tv$/,/^www.twitch.tv$/,/^clips.twitch.tv$/,/^player.twitch.tv$/],selector:".video-ref, main > div > section > div > div > div"},{host:"xvideos",url:"https://www.xvideos.com/",match:/^www.xvideos.com$/,selector:".video-bg-pic"},{host:"pornhub",url:"https://rt.pornhub.com/view_video.php?viewkey=",match:/^[a-z]+.pornhub.com$/,selector:".mainPlayerDiv > .video-element-wrapper-js > div"},{additionalData:"embed",host:"pornhub",url:"https://rt.pornhub.com/view_video.php?viewkey=",match:t=>t.host.includes("pornhub.com")&&t.pathname.startsWith("/embed/"),selector:"#player"},{additionalData:"mobile",host:"vk",url:"https://vk.com/video?z=",match:/^m.vk.(com|ru)$/,selector:"vk-video-player",shadowRoot:!0},{host:"vk",url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:".videoplayer_media"},{host:"vimeo",url:"https://vimeo.com/",match:/^vimeo.com$/,selector:".player"},{additionalData:"embed",host:"vimeo",url:"https://player.vimeo.com/",match:/^player.vimeo.com$/,selector:".player"},{host:"ok.ru",url:"https://ok.ru/",match:/^ok.ru$/,selector:".html5-vpl_vid"},{host:"nine_gag",url:"https://9gag.com/gag/",match:/^9gag.com$/,selector:".video-post"},{host:"coub",url:"https://coub.com/view/",match:/^coub.com$/,selector:".viewer__player"},{host:"bitchute",url:"https://www.bitchute.com/video/",match:/^(www.)?bitchute.com$/,selector:"#player"},{host:"rutube",url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:".video-player > div > div > div:nth-child(2)"},{additionalData:"embed",host:"rutube",url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:"#app > div > div"},{host:"bilibili",url:"https://www.bilibili.com/video/",match:/^(www|m|player).bilibili.com$/,selector:".bpx-player-video-wrap"},{additionalData:"old",host:"bilibili",url:"https://www.bilibili.com/video/",match:/^(www|m).bilibili.com$/,selector:null},{host:"twitter",url:"https://twitter.com/i/status/",match:/^twitter.com$/,selector:'div[data-testid="videoComponent"] > div:nth-child(1) > div'},{host:"mail_ru",url:"https://my.mail.ru/",match:/^my.mail.ru$/,selector:"#b-video-wrapper"},{host:"coursera",url:"https://www.coursera.org/",match:/coursera.org$/,selector:".vjs-v6"},{host:"udemy",url:"https://www.udemy.com",match:/udemy.com$/,selector:'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)'},{host:"invidious",url:"https://youtu.be/",match:t,selector:"#player"},{host:"piped",url:"https://youtu.be/",match:e,selector:".shaka-video-container"},{host:"rumble",url:"https://rumble.com",match:/^rumble.com$/,selector:"#videoPlayer > .videoPlayer-Rumble-cls > div"},{host:"eporner",url:"https://www.eporner.com/",match:/^(www.)?eporner.com$/,selector:".vjs-v7"},{host:"peertube",url:"tube.shanti.cafe",match:a,selector:".vjs-v7"},{host:"dailymotion",url:"https://www.dailymotion.com/video/",match:/^geo.dailymotion.com$/,selector:".player"},{host:"trovo",url:"https://trovo.live/s/",match:/^trovo.live$/,selector:".player-video"},{host:"yandexdisk",url:"https://disk.yandex.ru/i/",match:/^disk.yandex.ru$/,selector:"yaplayertag > div:nth-of-type(1)"},{host:"coursehunter",url:"https://coursehunter.net/course/",match:/^coursehunter.net$/,selector:"#oframeplayer > pjsdiv:nth-of-type(1)"},{host:"googledrive",url:"https://drive.google.com/file/d/",match:/^youtube.googleapis.com$/,selector:".html5-video-container"},{host:"bannedvideo",url:"https://banned.video/watch?id=",match:/^(www.)?banned.video$/,selector:".vjs-v7"},{host:"facebook",url:"https://facebook.com",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/videos/"),selector:'div[data-pagelet="WatchPermalinkVideo"]'},{additionalData:"reels",host:"facebook",url:"https://facebook.com",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/reel/"),selector:'div[role="main"]'},{host:"weverse",url:"https://weverse.io/",match:/^weverse.io$/,selector:".webplayer-internal-source-wrapper"},{host:"newgrounds",url:"https://www.newgrounds.com/",match:/^www.newgrounds.com$/,selector:".ng-video-player"},{host:"egghead",url:"https://egghead.io",match:/^egghead.io$/,selector:".cueplayer-react-video-holder"},{host:"youku",url:"https://v.youku.com/",match:/^v.youku.com$/,selector:"#ykPlayer"}];o("./node_modules/requestidlecallback-polyfill/index.js");class Nt{constructor(){this.listeners=new Set}hasListener(t){return this.listeners.has(t)}dispatchToListener(t,...e){try{t(...e)}catch(t){console.error("[VOT]",t)}}addListener(t){if(this.hasListener(t))throw new Error("[VOT] The listener has already been added.");this.listeners.add(t)}removeListener(t){if(!this.hasListener(t))throw new Error("[VOT] The listener has not been added yet.");this.listeners.delete(t)}dispatch(...t){for(const e of Array.from(this.listeners))this.dispatchToListener(e,...t)}}function Ht(t){return Array.from(t).flatMap((t=>t instanceof HTMLVideoElement?[t]:t instanceof HTMLElement?Array.from(t.querySelectorAll("video")):t.shadowRoot?Array.from(t.shadowRoot.querySelectorAll("video")):[]))}const jt=ut.getParser(window.navigator.userAgent).getResult(),Ut=[...t,...e],Wt=["playing","ratechange","play","waiting","pause"];function Gt(t,e,o=!1){return t.map((t=>({label:`${o&&!l.includes(t)?"❌ ":""}${p.get("langs")[t]??t.toUpperCase()}`,value:t,selected:e===t})))}var Yt=!1;function Zt(t,e,o,n,a,i){c.A.log(`Translate video (url: ${t}, duration: ${e}, requestLang: ${o}, responseLang: ${n})`),c.A.log("translationHelp:",a),Yt?c.A.log("translationPanding return"):(Yt=!0,mt(t,e,o,n,a,((t,e)=>{if(Yt=!1,c.A.log("[exec callback] Requesting video translation"),!t)return void i(!1,p.get("requestTranslationFailed"));const o=ct.decodeTranslationResponse(e);switch(console.log("[VOT] Translation response: ",o),o.status){case 0:i(!1,o.message);break;case 1:i(!!o.url,o.url||p.get("audioNotReceived"));break;case 2:i(!1,o.remainingTime?function(t){const e=Math.floor(t/60),o=Math.floor(t%60);return e>=60?p.get("translationTakeMoreThanHour"):e>=10&&e%10?p.get("translationTakeApproximatelyMinutes").replace("{0}",e):1==e||0==e&&o>0?p.get("translationTakeAboutMinute"):p.get("translationTakeApproximatelyMinute").replace("{0}",e)}(o.remainingTime):p.get("translationTakeFewMinutes"));break;case 3:case 6:i(!1,p.get("videoBeingTranslated"))}})))}class Kt{translateFromLang="en";translateToLang=G;timer;ytData="";videoData="";firstPlay=!0;audio=new Audio;hls=J();videoTranslations=[];videoTranslationTTL=7200;downloadTranslationUrl=null;downloadSubtitlesUrl=null;autoRetry;streamPing;volumeOnStart;tempOriginalVolume;tempVolume;subtitlesList=[];subtitlesListVideoId=null;videoLastSrcObject=null;constructor(t,e,o){c.A.log("[VideoHandler] add video:",t,"container:",e,this),this.video=t,this.container=e,this.site=o,this.handleSrcChangedBound=this.handleSrcChanged.bind(this),this.video.addEventListener("loadedmetadata",this.handleSrcChangedBound),this.stopTranslationBound=this.stopTranslation.bind(this),this.handleVideoEventBound=this.handleVideoEvent.bind(this),this.changeOpacityOnEventBound=this.changeOpacityOnEvent.bind(this),this.resetTimerBound=this.resetTimer.bind(this),this.init()}async init(){if(this.initialized)return;const t="uk"===G?1:0,e={autoTranslate:u.d.get("autoTranslate",0,!0),dontTranslateLanguage:u.d.get("dontTranslateLanguage",G),dontTranslateYourLang:u.d.get("dontTranslateYourLang",1,!0),autoSetVolumeYandexStyle:u.d.get("autoSetVolumeYandexStyle",1,!0),autoVolume:u.d.get("autoVolume",i.JD,!0),showVideoSlider:u.d.get("showVideoSlider",1,!0),syncVolume:u.d.get("syncVolume",0,!0),subtitlesMaxLength:u.d.get("subtitlesMaxLength",300,!0),highlightWords:u.d.get("highlightWords",0,!0),responseLanguage:u.d.get("responseLanguage",G),defaultVolume:u.d.get("defaultVolume",100,!0),udemyData:u.d.get("udemyData",{accessToken:"",expires:0}),audioProxy:u.d.get("audioProxy",t,!0),showPiPButton:u.d.get("showPiPButton",0,!0),translateAPIErrors:u.d.get("translateAPIErrors",1,!0),translationService:u.d.get("translationService",i.mE),detectService:u.d.get("detectService",i.K2),m3u8ProxyHost:u.d.get("m3u8ProxyHost",i.se),proxyWorkerHost:u.d.get("proxyWorkerHost",i.Pm)},o=await Promise.all(Object.entries(e).map((async([t,e])=>[t,await e])));this.data=Object.fromEntries(o),this.videoData=await this.getVideoData(),console.log("[db] data from db: ",this.data),this.subtitlesWidget=new xt(this.video,this.container,this.site),this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength),this.subtitlesWidget.setHighlightWords(this.data.highlightWords),this.initUI(),this.initUIEvents();const n=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=n,n&&(this.votMenu.container.hidden=!0),await this.updateSubtitles(),await this.changeSubtitlesLang("disabled"),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage??"ru"),this.translateToLang=this.data.responseLanguage??"ru",this.initExtraEvents(),this.initialized=!0}transformBtn(t="none",e){this.votButton.container.dataset.status=t,this.votButton.label.innerHTML=e}initUI(){this.votButton=B.createVOTButton(p.get("translateVideo")),this.container.appendChild(this.votButton.container),this.votButton.pipButton.hidden=!K()||!this.data?.showPiPButton,this.votButton.separator2.hidden=!K()||!this.data?.showPiPButton,this.votButton.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votMenu=B.createVOTMenu(p.get("VOTSettings")),this.container.appendChild(this.votMenu.container),this.votDownloadButton=B.createIconButton(''),this.votDownloadButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadButton),this.votDownloadSubtitlesButton=B.createIconButton(''),this.votDownloadSubtitlesButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadSubtitlesButton),this.votSettingsButton=B.createIconButton(''),this.votMenu.headerContainer.appendChild(this.votSettingsButton),this.votTranslationLanguageSelect=B.createVOTLanguageSelect({fromTitle:p.get("langs")[this.video.detectedLanguage],fromDialogTitle:p.get("videoLanguage"),fromItems:[{label:p.get("langs").auto,value:"auto",selected:""},...Gt(r,this.videoData.detectedLanguage)],fromOnSelectCB:async t=>{c.A.log("[fromOnSelectCB] select from language",t.target.dataset.votValue),this.videoData=await this.getVideoData(),this.setSelectMenuValues(t.target.dataset.votValue,this.videoData.responseLanguage)},toTitle:p.get("langs")[this.video.responseLanguage],toDialogTitle:p.get("translationLanguage"),toItems:[...Gt(r,this.videoData.responseLanguage,!0),{label:"─────────",value:"separator",disabled:!0},...Gt(s,this.videoData.responseLanguage,!0)],toOnSelectCB:async t=>{const e=t.target.dataset.votValue;c.A.log("[toOnSelectCB] select to language",e),this.data.responseLanguage=this.translateToLang=e,await u.d.set("responseLanguage",this.data.responseLanguage),c.A.log("Response Language value changed. New value: ",this.data.responseLanguage),this.videoData=await this.getVideoData(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage)}}),this.votMenu.bodyContainer.appendChild(this.votTranslationLanguageSelect.container),this.votSubtitlesSelect=B.createVOTSelect(p.get("VOTSubtitlesDisabled"),p.get("VOTSubtitles"),[{label:p.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1}],{onSelectCb:async t=>{await this.changeSubtitlesLang(t.target.dataset.votValue)},labelElement:B.createVOTSelectLabel(p.get("VOTSubtitles"))}),this.votMenu.bodyContainer.appendChild(this.votSubtitlesSelect.container),this.votVideoVolumeSlider=B.createSlider(`${p.get("VOTVolume")}: ${100*this.getVideoVolume()}%`,100*this.getVideoVolume()),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoVolumeSlider.container),this.votVideoTranslationVolumeSlider=B.createSlider(`${p.get("VOTVolumeTranslation")}: ${this.data?.defaultVolume??100}%`,this.data?.defaultVolume??100),this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoTranslationVolumeSlider.container),this.votMenu.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votSettingsDialog=B.createDialog(p.get("VOTSettings")),document.documentElement.appendChild(this.votSettingsDialog.container),this.votTranslationHeader=B.createHeader(p.get("translationSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationHeader),this.votAutoTranslateCheckbox=B.createCheckbox(p.get("VOTAutoTranslate"),this.data?.autoTranslate??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoTranslateCheckbox.container),this.votDontTranslateYourLangSelect=B.createVOTSelect(p.get("langs")[u.d.syncGet("dontTranslateLanguage",G)],p.get("VOTDontTranslateYourLang"),Gt(r,u.d.syncGet("dontTranslateLanguage",G)),{onSelectCb:async t=>{this.data.dontTranslateLanguage=t.target.dataset.votValue,await u.d.set("dontTranslateLanguage",this.data.dontTranslateLanguage)},labelElement:B.createCheckbox(p.get("VOTDontTranslateYourLang"),this.data?.dontTranslateYourLang??!0).container}),this.votSettingsDialog.bodyContainer.appendChild(this.votDontTranslateYourLangSelect.container),this.votAutoSetVolumeCheckbox=B.createCheckbox(`${p.get("VOTAutoSetVolume")}`,this.data?.autoSetVolumeYandexStyle??!0),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeCheckbox.container),this.votAutoSetVolumeSlider=B.createSlider(`${100*(this.data?.autoVolume??i.JD)}%`,100*(this.data?.autoVolume??i.JD),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=B.createCheckbox(p.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votUdemyDataTextfield=B.createTextfield(p.get("VOTUdemyData"),this.data?.udemyData?.accessToken??""),this.votUdemyDataTextfield.container.hidden="udemy"!==this.site.host,this.votSettingsDialog.bodyContainer.appendChild(this.votUdemyDataTextfield.container),this.votSyncVolumeCheckbox=B.createCheckbox(p.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSyncVolumeCheckbox.container.hidden=!["youtube","googledrive"].includes(this.site.host)||"mobile"===this.site.additionalData,this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votTranslationServiceSelect=B.createVOTSelect(u.d.syncGet("translationService",i.mE),p.get("VOTTranslationService"),Gt(D,u.d.syncGet("translationService",i.mE)),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await u.d.set("translationService",this.data.translationService)},labelElement:B.createCheckbox(p.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===p.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=B.createVOTSelect(u.d.syncGet("detectService",i.K2),p.get("VOTDetectService"),Gt(z,u.d.syncGet("detectService",i.K2)),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await u.d.set("detectService",this.data.detectService)},labelElement:B.createVOTSelectLabel(p.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=B.createHeader(p.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesMaxLengthSlider=B.createSlider(`${p.get("VOTSubtitlesMaxLength")}: ${this.data?.subtitlesMaxLength??300}`,this.data?.subtitlesMaxLength??300,50,300),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesMaxLengthSlider.container),this.votSubtitlesHighlightWordsCheckbox=B.createCheckbox(p.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votProxyHeader=B.createHeader(p.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=B.createTextfield(p.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,i.se),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=B.createTextfield(p.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,i.Pm),this.votProxyWorkerHostTextfield.container.hidden=!1,this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=B.createCheckbox(p.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votAudioProxyCheckbox.container.hidden=!1,this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votAboutHeader=B.createHeader(p.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=B.createVOTSelect(p.get("langs")[u.d.syncGet("locale-lang-override","auto")],p.get("VOTMenuLanguage"),Gt(h,u.d.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await u.d.set("locale-lang-override",t.target.dataset.votValue)},labelElement:B.createVOTSelectLabel(p.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=B.createCheckbox(p.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!K(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=B.createInformation(`${p.get("VOTVersion")}:`,`cloudflare ${GM_info.script.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=B.createInformation(`${p.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=B.createInformation(`${p.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=B.createInformation(`${p.get("VOTBrowser")}:`,`${jt.browser.name} ${jt.browser.version} (${jt.os.name} ${jt.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votResetSettingsButton=B.createButton(p.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}initUIEvents(){this.votButton.translateButton.addEventListener("click",(()=>{(async()=>{if(this.audio.src)return c.A.log("[click translationBtn] audio.src is not empty"),void this.stopTranslate();if(this.hls.url)return c.A.log("[click translationBtn] hls is not empty"),void this.stopTranslate();try{if(c.A.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new F("VOTNoVideoIDFound");await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t)}})()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votDownloadButton.addEventListener("click",(()=>{this.downloadTranslationUrl&&window.open(this.downloadTranslationUrl,"_blank").focus()})),this.votDownloadSubtitlesButton.addEventListener("click",(()=>{console.log(this.downloadSubtitlesUrl),this.downloadSubtitlesUrl&&window.open(this.downloadSubtitlesUrl,"_blank").focus()})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);if(this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${e}%`,this.setVideoVolume(e/100),1===this.data.syncVolume){const t=Number(this.votVideoTranslationVolumeSlider.input.value),o=Q(this.audio,e,t,this.tempOriginalVolume);this.votVideoTranslationVolumeSlider.input.value=o,this.votVideoTranslationVolumeSlider.label.querySelector("strong").innerHTML=`${o}%`,B.updateSlider(this.votVideoTranslationVolumeSlider.input),this.tempVolume=o,this.tempOriginalVolume=e}})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await u.d.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").innerHTML=`${this.data.defaultVolume}%`,this.audio.volume=this.data.defaultVolume/100,1===this.data.syncVolume&&this.syncTranslationWithVideo(this.data.defaultVolume)})()})),this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await u.d.set("autoTranslate",this.data.autoTranslate),c.A.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await u.d.set("dontTranslateYourLang",this.data.dontTranslateYourLang),c.A.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await u.d.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),c.A.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await u.d.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").innerHTML=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await u.d.set("showVideoSlider",this.data.showVideoSlider),c.A.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votUdemyDataTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.udemyData={accessToken:t.target.value,expires:(new Date).getTime()},await u.d.set("udemyData",this.data.udemyData),c.A.log("udemyData value changed. New value: ",this.data.udemyData),window.location.reload()})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await u.d.set("syncVolume",this.data.syncVolume),c.A.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await u.d.set("translateAPIErrors",this.data.translateAPIErrors),c.A.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesMaxLengthSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesMaxLength=Number(t.target.value),await u.d.set("subtitlesMaxLength",this.data.subtitlesMaxLength),this.votSubtitlesMaxLengthSlider.label.querySelector("strong").innerHTML=`${this.data.subtitlesMaxLength}`,this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength)})()})),this.votSubtitlesHighlightWordsCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.highlightWords=Number(t.target.checked),await u.d.set("highlightWords",this.data.highlightWords),c.A.log("highlightWords value changed. New value: ",this.data.highlightWords),this.subtitlesWidget.setHighlightWords(this.data.highlightWords)})()})),this.votShowPiPButtonCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showPiPButton=Number(t.target.checked),await u.d.set("showPiPButton",this.data.showPiPButton),c.A.log("showPiPButton value changed. New value: ",this.data.showPiPButton),this.votButton.pipButton.hidden=!K()||!this.data.showPiPButton,this.votButton.separator2.hidden=!K()||!this.data.showPiPButton})()})),this.votM3u8ProxyHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.m3u8ProxyHost=t.target.value||i.se,await u.d.set("m3u8ProxyHost",this.data.m3u8ProxyHost),c.A.log("m3u8ProxyHost value changed. New value: ",this.data.m3u8ProxyHost)})()})),this.votProxyWorkerHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.proxyWorkerHost=t.target.value||i.Pm,await u.d.set("proxyWorkerHost",this.data.proxyWorkerHost),c.A.log("proxyWorkerHost value changed. New value: ",this.data.proxyWorkerHost),window.location.reload()})()})),this.votAudioProxyCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioProxy=Number(t.target.checked),await u.d.set("audioProxy",this.data.audioProxy),c.A.log("audioProxy value changed. New value: ",this.data.audioProxy)})()})),this.votResetSettingsButton.addEventListener("click",(()=>{(async()=>{p.reset();(await u.d.list()).filter((t=>!p.gmValues.includes(t))).forEach((t=>u.d.syncDelete(t))),window.location.reload()})()}))}releaseExtraEvents(){clearInterval(this.resizeInterval),this.resizeObserver?.disconnect(),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.syncVolumeObserver?.disconnect(),this.extraEvents?.forEach((t=>{t.element.removeEventListener(t.event,t.handler)}))}initExtraEvents(){this.extraEvents=[];const t=(t,e,o)=>{this.extraEvents.push({element:t,event:e,handler:o}),t.addEventListener(e,o)},e=(e,o,n)=>{o.forEach((o=>{t(e,o,n)}))};if(this.resizeObserver=new ResizeObserver((t=>{t.forEach((t=>{this.votMenu.container.setAttribute("style",`--vot-container-height: ${t.contentRect.height}px`)}))})),this.resizeObserver.observe(this.video),this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`),this.resizeInterval=setInterval((()=>{this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`)}),500),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData){this.syncVolumeObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"aria-valuenow"===t.attributeName&&this.syncVideoVolumeSlider()}))}));const t=document.querySelector(".ytp-volume-panel");t&&this.syncVolumeObserver.observe(t,{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0})}let o;document.addEventListener("click",(t=>{const e=t.target,o=this.votButton.container,n=this.votMenu.container,a=this.container,i=this.votSettingsDialog.container,r=document.querySelector(".vot-dialog-temp"),s=o.contains(e),l=n.contains(e),d=a.contains(e),u=i.contains(e),h=r?.contains(e)??!1;c.A.log(`[document click] ${s} ${l} ${d} ${u} ${h}`),s||l||u||h||(d||this.logout(0),this.votMenu.container.hidden=!0)})),o="pornhub"===this.site.host?"embed"===this.site.additionalData?document.querySelector("#player"):this.container.querySelector(".video-element-wrapper-js > div"):"twitter"===this.site.host?document.querySelector('div[data-testid="videoPlayer"]'):"yandexdisk"===this.site.host?document.querySelector(".video-player__player"):this.container,o&&e(o,["mousemove","mouseout"],this.resetTimerBound),t(this.votButton.container,"mousemove",this.changeOpacityOnEventBound),t(this.votMenu.container,"mousemove",this.changeOpacityOnEventBound),e(document,["touchstart","touchmove","touchend"],this.changeOpacityOnEventBound),t(this.votButton.container,"mousedown",(t=>{t.stopImmediatePropagation()})),t(this.votMenu.container,"mousedown",(t=>{t.stopImmediatePropagation()})),"youtube"===this.site.host&&(this.container.draggable=!1),t(this.video,"emptied",(()=>{c.A.log("lipsync mode is emptied"),this.stopTranslation()})),t(this.video,"progress",(async()=>{if(this.firstPlay&&1===this.data.autoTranslate&&Y(this.site.host,this.video)===this.videoData.videoId){if(!this.videoData.videoId)throw new F("VOTNoVideoIDFound");try{this.firstPlay=!1,await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t),this.firstPlay=!1}}}))}logout(t){this.votMenu.container.hidden&&(this.votButton.container.style.opacity=t)}resetTimer(){clearTimeout(this.timer),this.logout(1),this.timer=setTimeout((()=>{this.logout(0)}),1e3)}changeOpacityOnEvent(t){clearTimeout(this.timer),this.logout(1),t.stopPropagation()}async changeSubtitlesLang(t){if(c.A.log("[onchange] subtitles",t),this.votSubtitlesSelect.setSelected(t),"disabled"===t)this.votSubtitlesSelect.setTitle(p.get("VOTSubtitlesDisabled")),this.subtitlesWidget.setContent(null),this.votDownloadSubtitlesButton.hidden=!0,this.downloadSubtitlesUrl=null;else{const e=await wt(this.subtitlesList.at(parseInt(t)));this.subtitlesWidget.setContent(e),this.votDownloadSubtitlesButton.hidden=!1,this.downloadSubtitlesUrl=this.subtitlesList.at(parseInt(t))?.url}}async updateSubtitlesLangSelect(){const t=[{label:p.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1},...this.subtitlesList.map(((t,e)=>({label:(p.get("langs")[t.language]??t.language.toUpperCase())+(t.translatedFromLanguage?` ${p.get("VOTTranslatedFrom")} ${p.get("langs")[t.translatedFromLanguage]??t.translatedFromLanguage.toUpperCase()}`:"")+("yandex"!==t.source?` ${t.source}`:"")+(t.isAutoGenerated?` (${p.get("VOTAutogenerated")})`:""),value:e,selected:!1,disabled:!1})))];this.votSubtitlesSelect.updateItems(t),await this.changeSubtitlesLang(t[0].value)}async updateSubtitles(){if(await this.changeSubtitlesLang("disabled"),!this.videoData.videoId)return console.error(`[VOT] ${p.getDefault("VOTNoVideoIDFound")}`),this.subtitlesList=[],this.subtitlesListVideoId=null,void await this.updateSubtitlesLangSelect();this.subtitlesListVideoId!==this.videoData.videoId&&(this.subtitlesList=await async function(t,e,o){const n="youtube"===t.host?U.getSubtitles():[];let a=!1;const i=[...await Promise.race([new Promise((t=>{setTimeout((()=>{a||(console.error("[VOT] Failed get yandex subtitles. Reason: timeout"),t([]))}),5e3)})),new Promise((n=>{bt(`${t.url}${e}`,o,((t,e)=>{c.A.log("[exec callback] Requesting video subtitles"),t||(console.error("[VOT] Failed get yandex subtitles"),a=!0,n([]));const o=ct.decodeSubtitlesResponse(e);console.log("[VOT] Subtitles response: ",o);let i=o.subtitles??[];i=i.reduce(((t,e)=>(e.language&&!t.find((t=>{if("yandex"===t.source&&t.language===e.language&&!t.translatedFromLanguage)return t}))&&t.push({source:"yandex",language:e.language,url:e.url}),e.translatedLanguage&&t.push({source:"yandex",language:e.translatedLanguage,translatedFromLanguage:e.language,url:e.translatedUrl}),t)),[]),a=!0,n(i)}))}))]),...n].sort(((t,e)=>{if(t.source!==e.source)return"yandex"===t.source?-1:1;if(t.language!==e.language&&(t.language===G||e.language===G))return t.language===G?-1:1;if("yandex"===t.source){if(t.translatedFromLanguage!==e.translatedFromLanguage)return t.translatedFromLanguage&&e.translatedFromLanguage?t.translatedFromLanguage===o?-1:1:t.language===e.language?t.translatedFromLanguage?1:-1:t.translatedFromLanguage?-1:1;if(!t.translatedFromLanguage)return t.language===o?-1:1}return"youtube"===t.source&&t.isAutoGenerated!==e.isAutoGenerated?t.isAutoGenerated?1:-1:0}));return console.log("[VOT] subtitles list",i),i}(this.site,this.videoData.videoId,this.videoData.detectedLanguage),this.subtitlesList?this.subtitlesListVideoId=this.videoData.videoId:await this.changeSubtitlesLang("disabled"),await this.updateSubtitlesLangSelect())}getVideoVolume(){let t=this.video?.volume;return["youtube","googledrive"].includes(this.site.host)&&(t=U.getVideoVolume()||t),t}setVideoVolume(t){if(["youtube","googledrive"].includes(this.site.host)){if(U.setVideoVolume(t))return}this.video.volume=t}syncVideoVolumeSlider(){const t=Math.round(100*this.getVideoVolume());this.votVideoVolumeSlider.input.value=t,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${t}%`,B.updateSlider(this.votVideoVolumeSlider.input),1===this.data.syncVolume&&(this.tempOriginalVolume=Number(t))}setSelectMenuValues(t,e){this.votTranslationLanguageSelect.fromSelect.setTitle(p.get("langs")[t]),this.votTranslationLanguageSelect.toSelect.setTitle(p.get("langs")[e]),this.votTranslationLanguageSelect.fromSelect.setSelected(t),this.votTranslationLanguageSelect.toSelect.setSelected(e),console.log(`[VOT] Set translation from ${t} to ${e}`),this.videoData.detectedLanguage=t,this.videoData.responseLanguage=e}syncTranslationWithVideo(t){const e=Number(this.votVideoVolumeSlider.input.value),o=Q(this.video,t,e,this.tempVolume);this.votVideoVolumeSlider.input.value=o,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${o}%`,B.updateSlider(this.votVideoVolumeSlider.input),this.tempOriginalVolume=o,this.tempVolume=t}async getVideoData(){const t={translationHelp:null,isStream:!1,duration:this.video?.duration||343,videoId:Y(this.site.host,this.video),detectedLanguage:this.translateFromLang,responseLanguage:this.translateToLang};if(!t.videoId)return this.ytData={},t;if(window.location.hostname.includes("youtube.com"))this.ytData=await U.getVideoData(),t.isStream=this.ytData.isLive,""!==this.ytData.author&&(t.detectedLanguage=this.ytData.detectedLanguage,t.responseLanguage=this.translateToLang);else if(window.location.hostname.includes("rutube")||window.location.hostname.includes("ok.ru")||window.location.hostname.includes("my.mail.ru"))t.detectedLanguage="ru";else if(["bilibili","youku"].includes(this.site.host))t.detectedLanguage="zh";else if(["vk"].includes(this.site.host)){const e=document.getElementsByTagName("track")?.[0]?.srclang;t.detectedLanguage=e||"auto"}else if(window.location.hostname.includes("coursera.org")){const e=await Vt.getVideoData(this.translateToLang);t.duration=e.duration||t.duration,t.detectedLanguage=e.detectedLanguage,t.translationHelp=e.translationHelp}else if(window.location.hostname.includes("coursehunter.net")){const e=await St.getVideoData();t.translationHelp={url:e.url},t.duration=e.duration||t.duration}else if(window.location.hostname.includes("banned.video")){const e=await Ft.getVideoData(t.videoId);t.translationHelp={url:e.url},t.duration=e.duration||t.duration,t.isStream=e.live}else if(window.location.hostname.includes("weverse.io")){const e=await It.getVideoData();t.detectedLanguage="ko",e&&(t.translationHelp={url:e.url},t.duration=e.duration||t.duration)}else if(window.location.hostname.includes("udemy.com")){const e=await Bt.getVideoData(this.data.udemyData,this.translateToLang);t.duration=e.duration||t.duration,t.detectedLanguage=e.detectedLanguage,t.translationHelp=e.translationHelp}else["piped","invidious","bitchute","rumble","peertube","dailymotion","trovo","yandexdisk","coursehunter"].includes(this.site.host)&&(t.detectedLanguage="auto");return t}videoValidator(){if(["youtube","ok.ru","vk"].includes(this.site.host)){if(c.A.log("VideoValidator videoData: ",this.videoData),1===this.data.dontTranslateYourLang&&this.videoData.detectedLanguage===this.data.dontTranslateLanguage&&this.videoData.responseLanguage===this.data.dontTranslateLanguage)throw new F("VOTDisableFromYourLang");if(!this.videoData.isStream&&this.videoData.duration>14400)throw new F("VOTVideoIsTooLong")}return!0}lipSync(t=!1){if(c.A.log("lipsync video",this.video),this.video)if(this.audio.currentTime=this.video.currentTime,this.audio.playbackRate=this.video.playbackRate,t)if("play"!=t)["pause","stop","waiting"].includes(t)&&(c.A.log(`lipsync mode is ${t}`),this.audio.pause()),"playing"==t&&(c.A.log("lipsync mode is playing"),this.audio.play());else{c.A.log("lipsync mode is play");const t=this.audio.play();void 0!==t&&t.catch((t=>{if(console.error("[VOT]",t),"NotAllowedError"===t.name)throw this.transformBtn("error",p.get("grantPermissionToAutoPlay")),new F("grantPermissionToAutoPlay");if("NotSupportedError"===t.name)throw this.transformBtn("error",Ut.includes(window.location.hostname)?p.get("neededAdditionalExtension"):p.get("audioFormatNotSupported")),Ut.includes(window.location.hostname)?new F("neededAdditionalExtension"):new F("audioFormatNotSupported")}))}else c.A.log("lipsync mode is not set")}handleVideoEvent(t){c.A.log(`video ${t.type}`),this.lipSync(t.type)}stopTranslate(){Wt.forEach((t=>this.video.removeEventListener(t,this.handleVideoEventBound))),this.audio.pause(),this.audio.src="",this.audio.removeAttribute("src"),this.votVideoVolumeSlider.container.hidden=!0,this.votVideoTranslationVolumeSlider.container.hidden=!0,this.votDownloadButton.hidden=!0,this.downloadTranslationUrl=null,this.transformBtn("none",p.get("translateVideo")),c.A.log(`Volume on start: ${this.volumeOnStart}`),this.volumeOnStart&&this.setVideoVolume(this.volumeOnStart),this.volumeOnStart="",clearInterval(this.streamPing),this.hls?.destroy(),this.hls=J()}async translateExecutor(t){c.A.log("Run translateFunc"),this.translateFunc(t,this.videoData.isStream,this.videoData.detectedLanguage,this.videoData.responseLanguage,this.videoData.translationHelp)}async updateTranslationErrorMsg(t){const e=p.get("translationTake"),o=p.get("VOTTranslatingError"),n=p.lang;if("VOTLocalizedError"===t?.name)this.transformBtn("error",t.localizedMessage);else if(1!==this.data.translateAPIErrors||t.includes(e)||"ru"===n)this.transformBtn("error",t);else{const e=await async function(t,e="",o="ru"){if("yandex"===await u.d.get("translationService",i.mE)){const n=e&&o?`${e}-${o}`:o;return await R.translate(t,n)}return t}(t,"ru",n);this.transformBtn("error",o),this.transformBtn("error",e)}}afterUpdateTranslation(t){this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,1===this.data.autoSetVolumeYandexStyle&&(this.votVideoVolumeSlider.input.value=100*this.data.autoVolume,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=100*this.data.autoVolume+"%",B.updateSlider(this.votVideoVolumeSlider.input)),this.votDownloadButton.hidden=!1,this.downloadTranslationUrl=t}updateTranslation(t){if(this.audio.src=t,1===this.data.audioProxy&&t.startsWith("https://vtrans.s3-private.mds.yandex.net/tts/prod/")){const e=t.replace("https://vtrans.s3-private.mds.yandex.net/tts/prod/",""),o=`https://${this.data.proxyWorkerHost}/video-translation/audio-proxy/${e}`;console.log(`[VOT] Audio proxied via ${o}`),this.audio.src=o}if(this.volumeOnStart=this.getVideoVolume(),"number"==typeof this.data.defaultVolume&&(this.audio.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume),"twitter"===this.site.host)document.querySelector('div[data-testid="app-bar-back"][role="button"]').addEventListener("click",this.stopTranslationBound);this.video&&!this.video.paused&&this.lipSync("play"),Wt.forEach((t=>this.video.addEventListener(t,this.handleVideoEventBound))),this.transformBtn("success",p.get("disableTranslate")),this.afterUpdateTranslation(t)}translateFunc(t,e,o,n,a){console.log("[VOT] Video Data: ",this.videoData);const i=a?.url?a.url:`${this.site.url}${t}`;if(c.A.log("Run videoValidator"),this.videoValidator(),e)return c.A.log("Executed stream translation"),void function(t,e,o,n){c.A.log(`Translate stream (url: ${t}, requestLang: ${e}, responseLang: ${o})`),vt(t,e,o,((t,e)=>{if(c.A.log("[exec callback] Requesting stream translation"),!t)return void n(!1,p.get("requestTranslationFailed"));const o=ct.decodeStreamResponse(e);switch(console.log("[VOT] Stream Translation response: ",o),o.interval){case 10:n(!1,o.interval,p.get("translationTakeFewMinutes"));break;case 20:n(!0,o.interval,o||p.get("audioNotReceived"));break;case 0:n(!1,o.interval,p.get("streamNoConnectionToServer"))}}))}(i,o,n,(async(i,r,s)=>{if(c.A.log("[exec callback] translateStream callback"),Y(this.site.host,this.video)!==t)return;if(!i||!s.translatedInfo)return await this.updateTranslationErrorMsg(s),void(10===r&&(clearTimeout(this.autoRetry),this.autoRetry=setTimeout((()=>this.translateFunc(t,e,o,n,a)),1e3*r)));this.transformBtn("success",p.get("disableTranslate")),console.log(s);const l=s.pingId;c.A.log(`Stream pingId: ${l}`),this.streamPing=setInterval((async()=>await gt(l,(t=>c.A.log("Stream ping result: ",t)))),1e3*r),c.A.log(s.translatedInfo.url);const d=`https://${this.data.m3u8ProxyHost}/?all=yes&origin=${encodeURIComponent("https://strm.yandex.ru")}&referer=${encodeURIComponent("https://strm.yandex.ru")}&url=${encodeURIComponent(s.translatedInfo.url)}`;if(c.A.log(d),this.hls)this.hls.on(Hls.Events.MEDIA_ATTACHED,(function(){c.A.log("audio and hls.js are now bound together !")})),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(t){c.A.log("manifest loaded, found "+t?.levels?.length+" quality level")})),this.hls.loadSource(d),this.hls.attachMedia(this.audio),this.hls.on(Hls.Events.ERROR,(function(t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),this.hls.recoverMediaError();break;case Hls.ErrorTypes.NETWORK_ERROR:console.error("fatal network error encountered",t);break;default:this.hls.destroy()}})),c.A.log(this.hls);else{if(!this.audio.canPlayType("application/vnd.apple.mpegurl"))throw new F("audioFormatNotSupported");this.audio.src=d}"youtube"===this.site.host&&U.videoSeek(this.video,10),this.volumeOnStart=this.getVideoVolume(),"number"==typeof this.data.defaultVolume&&(this.audio.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume),this.video.src||this.video.currentSrc||this.video.srcObject?(this.video&&!this.video.paused&&this.lipSync("play"),Wt.forEach((t=>this.video.addEventListener(t,this.handleVideoEventBound))),this.afterUpdateTranslation(d)):this.stopTranslation()}));if(["udemy","coursera"].includes(this.site.host)&&!a)throw new F("VOTTranslationHelpNull");const r=this.videoTranslations.find((e=>e.videoId===t&&e.expires>Date.now()/1e3&&e.from===o&&e.to===n));if(r)return this.updateTranslation(r.url),void c.A.log("[translateFunc] A cached translate was received");Zt(i,this.videoData.duration,o,n,a,(async(i,r)=>{if(c.A.log("[exec callback] translateVideo callback"),Y(this.site.host,this.video)===t){if(!i)return await this.updateTranslationErrorMsg(r),r.includes(p.get("translationTake"))&&(clearTimeout(this.autoRetry),this.autoRetry=setTimeout((()=>this.translateFunc(t,e,o,n,a)),6e4)),void console.error("[VOT]",r);this.updateTranslation(r),this.videoTranslations.push({videoId:t,from:o,to:n,url:r,expires:Date.now()/1e3+this.videoTranslationTTL})}}))}stopTranslation(){this.stopTranslate(),this.syncVideoVolumeSlider()}async handleSrcChanged(){c.A.log("[VideoHandler] src changed",this),this.stopTranslation(),this.firstPlay=!0,this.videoData=await this.getVideoData(),this.videoData.detectedLanguage&&this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage);const t=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=t,t&&(this.votMenu.container.hidden=t),this.site.selector||(this.container=this.video.parentElement),this.container.contains(this.votButton.container)||(this.container.appendChild(this.votButton.container),this.container.appendChild(this.votMenu.container)),await this.updateSubtitles(),await this.changeSubtitlesLang("disabled"),this.translateToLang=this.data.responseLanguage??"ru"}async release(){c.A.log("[VideoHandler] release"),this.initialized=!1,this.stopTranslation(),this.releaseExtraEvents(),this.subtitlesWidget.release(),this.votButton.container.remove(),this.votMenu.container.remove()}}const Jt=new class{constructor(){this.onVideoAdded=new Nt,this.onVideoRemoved=new Nt,this.handleVideoAddedBound=this.handleVideoAdded.bind(this),this.handleVideoRemovedBound=this.handleVideoRemoved.bind(this),this.observer=new MutationObserver((t=>{window.requestIdleCallback((()=>{t.forEach((t=>{"childList"===t.type&&(Ht(t.addedNodes).forEach(this.handleVideoAddedBound),Ht(t.removedNodes).forEach(this.handleVideoRemovedBound))}))}),{timeout:1e3})}))}enable(){this.observer.observe(document,{childList:!0,subtree:!0}),document.querySelectorAll("video").forEach(this.handleVideoAddedBound)}disable(){this.observer.disconnect()}handleVideoAdded(t){this.onVideoAdded.dispatch(t)}handleVideoRemoved(t){document.contains(t)||this.onVideoRemoved.dispatch(t)}},Qt=new WeakMap;(async function(){c.A.log("Loading extension..."),await p.update(),c.A.log(`Selected menu language: ${p.lang}`),c.A.log("Extension compatibility passed..."),Jt.onVideoAdded.addListener((t=>{for(const e of $t.filter((t=>{const e=t=>t instanceof RegExp&&t.test(window.location.hostname)||"string"==typeof t&&window.location.hostname.includes(t)||"function"==typeof t&&t(new URL(window.location));return!!(e(t.match)||t.match instanceof Array&&t.match.some((t=>e(t))))&&t.host&&t.url}))){if(!e)continue;let o;if(e.shadowRoot)o=e.selector?Object.values(document.querySelectorAll(e.selector)).find((e=>e.shadowRoot.contains(t))):t.parentElement,o=o&&o.shadowRoot?o.parentElement:o;else{const n=jt.browser.version.split(".")?.[0];if(e.selector?.includes(":not")&&e.selector?.includes("*")&&n&&("Chrome"===jt.browser.name&&Number(n)<88||"Firefox"===jt.browser.name&&Number(n)<84)){const n=e.selector?.split(" *")?.[0];o=n?Object.values(document.querySelectorAll(n)).find((e=>e.contains(t))):t.parentElement}else o=e.selector?Object.values(document.querySelectorAll(e.selector)).find((e=>e.contains(t))):t.parentElement}if(o&&!("rumble"===e.host&&o.querySelector("vot-block")||("peertube"===e.host&&(e.url=window.location.origin),Qt.has(t)))){Qt.set(t,new Kt(t,o,e));break}}})),Jt.onVideoRemoved.addListener((async t=>{Qt.has(t)&&(await Qt.get(t).release(),Qt.delete(t))})),Jt.enable()})().catch((t=>{console.error("[VOT]",t)}))})()})(); \ No newline at end of file +(()=>{var t={"./node_modules/bowser/es5.js":function(t){t.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(n,a,function(e){return t[e]}.bind(null,a));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=90)}({17:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n=o(18),a=function(){function t(){}return t.getFirstMatch=function(t,e){var o=e.match(t);return o&&o.length>0&&o[1]||""},t.getSecondMatch=function(t,e){var o=e.match(t);return o&&o.length>1&&o[2]||""},t.matchAndReturnConst=function(t,e,o){if(t.test(e))return o},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,o,n){void 0===n&&(n=!1);var a=t.getVersionPrecision(e),i=t.getVersionPrecision(o),r=Math.max(a,i),s=0,l=t.map([e,o],(function(e){var o=r-t.getVersionPrecision(e),n=e+new Array(o+1).join(".0");return t.map(n.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(n&&(s=r-Math.min(a,i)),r-=1;r>=s;){if(l[0][r]>l[1][r])return 1;if(l[0][r]===l[1][r]){if(r===s)return 0;r-=1}else if(l[0][r]1?a-1:0),r=1;r0){var r=Object.keys(o),l=s.default.find(r,(function(t){return e.isOS(t)}));if(l){var d=this.satisfies(o[l]);if(void 0!==d)return d}var c=s.default.find(r,(function(t){return e.isPlatform(t)}));if(c){var u=this.satisfies(o[c]);if(void 0!==u)return u}}if(i>0){var h=Object.keys(a),p=s.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==p)return this.compareVersion(a[p])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var o=this.getBrowserName().toLowerCase(),n=t.toLowerCase(),a=s.default.getBrowserTypeByAlias(n);return e&&a&&(n=a.toLowerCase()),n===o},e.compareVersion=function(t){var e=[0],o=t,n=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===t[0]||"<"===t[0]?(o=t.substr(1),"="===t[1]?(n=!0,o=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?o=t.substr(1):"~"===t[0]&&(n=!0,o=t.substr(1)),e.indexOf(s.default.compareVersions(a,o,n))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=d,t.exports=e.default},92:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},o=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},o=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},o=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},o=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},o=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},o=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},o=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},o=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},o=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},o=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},o=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},o=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return o&&(e.version=o),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},o=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},o=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},o=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},o=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},o=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},o=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},o=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},o=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},o=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},o=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},o=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},o=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e={name:"Android Browser"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(e,t),version:a.default.getSecondMatch(e,t)}}}];e.default=r,t.exports=e.default},93:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:[/Roku\/DVP/],describe:function(t){var e=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:i.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),o=a.default.getWindowsVersionName(e);return{name:i.OS_MAP.Windows,version:e,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:i.OS_MAP.iOS},o=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return o&&(e.version=o),e}},{test:[/macintosh/i],describe:function(t){var e=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),o=a.default.getMacOSVersionName(e),n={name:i.OS_MAP.MacOS,version:e};return o&&(n.versionName=o),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),o=a.default.getAndroidVersionName(e),n={name:i.OS_MAP.Android,version:e};return o&&(n.versionName=o),n}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),o={name:i.OS_MAP.WebOS};return e&&e.length&&(o.version=e),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||a.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:i.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.PlayStation4,version:e}}}];e.default=r,t.exports=e.default},94:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=a.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",o={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(o.model=e),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),o=t.test(/like (ipod|iphone)/i);return e&&!o},describe:function(t){var e=a.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];e.default=r,t.exports=e.default},95:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:i.ENGINE_MAP.Blink};var e=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:i.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:i.ENGINE_MAP.Trident},o=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:i.ENGINE_MAP.Presto},o=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=t.test(/gecko/i),o=t.test(/like gecko/i);return e&&!o},describe:function(t){var e={name:i.ENGINE_MAP.Gecko},o=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:i.ENGINE_MAP.WebKit},o=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}}];e.default=r,t.exports=e.default}})},"./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/main.scss":(t,e,o)=>{"use strict";o.d(e,{A:()=>s});var n=o("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),a=o.n(n),i=o("./node_modules/css-loader/dist/runtime/api.js"),r=o.n(i)()(a());r.push([t.id,'.vot-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );--vot-helper-ontheme: var( --vot-ontheme-rgb, var(--vot-onprimary-rgb, 255, 255, 255) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;border-radius:4px;padding:0 16px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-ontheme));background-color:rgb(var(--vot-helper-theme));box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer;transition:box-shadow .2s}.vot-button[hidden]{display:none !important}.vot-button::-moz-focus-inner{border:none}.vot-button::before,.vot-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-button::before{background-color:rgb(var(--vot-helper-ontheme));transition:opacity .2s}.vot-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-button:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.vot-button:hover::before{opacity:.08}.vot-button:active{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.vot-button:active::after{opacity:.32;background-size:100% 100%;transition:background-size 0s}.vot-button:disabled{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.12);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);box-shadow:none;cursor:initial}.vot-button:disabled::before,.vot-button:disabled::after{opacity:0}.vot-outlined-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:solid 1px;border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.24);border-radius:4px;padding:0 16px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:34px;outline:none;cursor:pointer}.vot-outlined-button[hidden]{display:none !important}.vot-outlined-button::-moz-focus-inner{border:none}.vot-outlined-button::before,.vot-outlined-button::after{content:"";position:absolute;border-radius:3px;top:0;right:0;bottom:0;left:0;opacity:0}.vot-outlined-button::before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-outlined-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-outlined-button:hover::before{opacity:.04}.vot-outlined-button:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-outlined-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-outlined-button:disabled::before,.vot-outlined-button:disabled::after{opacity:0}.vot-text-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none;border-radius:4px;padding:0 8px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer}.vot-text-button[hidden]{display:none !important}.vot-text-button::-moz-focus-inner{border:none}.vot-text-button::before,.vot-text-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-text-button::before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-text-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-text-button:hover::before{opacity:.04}.vot-text-button:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-text-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-text-button:disabled::before,.vot-text-button:disabled::after{opacity:0}.vot-icon-button{--vot-helper-onsurface: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87);position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none;border-radius:50%;padding:0;width:36px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;fill:var(--vot-helper-onsurface);color:var(--vot-helper-onsurface);background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer}.vot-icon-button[hidden]{display:none !important}.vot-icon-button::-moz-focus-inner{border:none}.vot-icon-button::before,.vot-icon-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-icon-button::before{background-color:var(--vot-helper-onsurface);transition:opacity .2s}.vot-icon-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity .3s,background-size .4s}.vot-icon-button:hover::before{opacity:.04}.vot-icon-button:active::after{opacity:.32;background-size:100% 100%;transition:background-size 0s,opacity 0s}.vot-icon-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);fill:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-icon-button:disabled::before,.vot-icon-button:disabled::after{opacity:0}.vot-textfield{--vot-helper-theme: rgb( var(--vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243)) ) !important;--vot-helper-safari1: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.38 ) !important;--vot-helper-safari2: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;--vot-helper-safari3: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.87 ) !important;position:relative !important;display:inline-block;padding-top:6px !important;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system) !important;font-size:16px !important;line-height:1.5 !important;text-align:start !important}.vot-textfield[hidden]{display:none !important}.vot-textfield>input,.vot-textfield>textarea{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin:0 !important;border-style:solid !important;border-width:1px !important;border-color:rgba(0,0,0,0) var(--vot-helper-safari2) var(--vot-helper-safari2) !important;border-radius:4px !important;padding:15px 13px 15px !important;width:100% !important;height:inherit !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important;-webkit-text-fill-color:currentColor !important;background-color:rgba(0,0,0,0) !important;box-shadow:inset 1px 0 rgba(0,0,0,0),inset -1px 0 rgba(0,0,0,0),inset 0 -1px rgba(0,0,0,0) !important;font-family:inherit !important;font-size:inherit !important;line-height:inherit !important;caret-color:var(--vot-helper-theme) !important;transition:border .2s,box-shadow .2s !important}.vot-textfield>input:not(:focus):placeholder-shown,.vot-textfield>textarea:not(:focus):placeholder-shown{border-top-color:var(--vot-helper-safari2) !important}.vot-textfield>input+span,.vot-textfield>textarea+span{position:absolute !important;top:0 !important;left:0 !important;display:flex !important;width:100% !important;max-height:100% !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;font-size:75% !important;line-height:15px !important;cursor:text !important;transition:color .2s,font-size .2s,line-height .2s !important;pointer-events:none !important}.vot-textfield>input:not(:focus):placeholder-shown+span,.vot-textfield>textarea:not(:focus):placeholder-shown+span{font-size:inherit !important;line-height:68px !important}.vot-textfield>input+span::before,.vot-textfield>input+span::after,.vot-textfield>textarea+span::before,.vot-textfield>textarea+span::after{content:"" !important;display:block !important;-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin-top:6px !important;border-top:solid 1px var(--vot-helper-safari2) !important;min-width:10px !important;height:8px !important;pointer-events:none !important;box-shadow:inset 0 1px rgba(0,0,0,0) !important;transition:border .2s,box-shadow .2s !important}.vot-textfield>input+span::before,.vot-textfield>textarea+span::before{margin-right:4px !important;border-left:solid 1px rgba(0,0,0,0) !important;border-radius:4px 0 !important}.vot-textfield>input+span::after,.vot-textfield>textarea+span::after{flex-grow:1 !important;margin-left:4px !important;border-right:solid 1px rgba(0,0,0,0) !important;border-radius:0 4px !important}.vot-textfield>input:not(:focus):placeholder-shown+span::before,.vot-textfield>input:not(:focus):placeholder-shown+span::after,.vot-textfield>textarea:not(:focus):placeholder-shown+span::before,.vot-textfield>textarea:not(:focus):placeholder-shown+span::after{border-top-color:rgba(0,0,0,0) !important}.vot-textfield:hover>input,.vot-textfield:hover>textarea{border-color:rgba(0,0,0,0) var(--vot-helper-safari3) var(--vot-helper-safari3) !important}.vot-textfield:hover>input+span::before,.vot-textfield:hover>input+span::after,.vot-textfield:hover>textarea+span::before,.vot-textfield:hover>textarea+span::after{border-top-color:var(--vot-helper-safari3) !important}.vot-textfield:hover>input:not(:focus):placeholder-shown,.vot-textfield:hover>textarea:not(:focus):placeholder-shown{border-color:var(--vot-helper-safari3) !important}.vot-textfield>input:focus,.vot-textfield>textarea:focus{border-color:rgba(0,0,0,0) var(--vot-helper-theme) var(--vot-helper-theme) !important;box-shadow:inset 1px 0 var(--vot-helper-theme),inset -1px 0 var(--vot-helper-theme),inset 0 -1px var(--vot-helper-theme) !important;outline:none !important}.vot-textfield>input:focus+span,.vot-textfield>textarea:focus+span{color:var(--vot-helper-theme) !important}.vot-textfield>input:focus+span::before,.vot-textfield>input:focus+span::after,.vot-textfield>textarea:focus+span::before,.vot-textfield>textarea:focus+span::after{border-top-color:var(--vot-helper-theme) !important;box-shadow:inset 0 1px var(--vot-helper-theme) !important}.vot-textfield>input:disabled,.vot-textfield>input:disabled+span,.vot-textfield>textarea:disabled,.vot-textfield>textarea:disabled+span{border-color:rgba(0,0,0,0) var(--vot-helper-safari1) var(--vot-helper-safari1) !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important;pointer-events:none !important}.vot-textfield>input:disabled+span::before,.vot-textfield>input:disabled+span::after,.vot-textfield>textarea:disabled+span::before,.vot-textfield>textarea:disabled+span::after{border-top-color:var(--vot-helper-safari1) !important}.vot-textfield>input:disabled:placeholder-shown,.vot-textfield>input:disabled:placeholder-shown+span,.vot-textfield>textarea:disabled:placeholder-shown,.vot-textfield>textarea:disabled:placeholder-shown+span{border-top-color:var(--vot-helper-safari1) !important}.vot-textfield>input:disabled:placeholder-shown+span::before,.vot-textfield>input:disabled:placeholder-shown+span::after,.vot-textfield>textarea:disabled:placeholder-shown+span::before,.vot-textfield>textarea:disabled:placeholder-shown+span::after{border-top-color:rgba(0,0,0,0) !important}@media not all and (min-resolution: 0.001dpcm){@supports(-webkit-appearance: none){.vot-textfield>input,.vot-textfield>input+span,.vot-textfield>textarea,.vot-textfield>textarea+span,.vot-textfield>input+span::before,.vot-textfield>input+span::after,.vot-textfield>textarea+span::before,.vot-textfield>textarea+span::after{transition-duration:.1s !important}}}.vot-checkbox{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );--vot-helper-ontheme: var( --vot-ontheme-rgb, var(--vot-onprimary-rgb, 255, 255, 255) );z-index:0;position:relative;display:inline-block;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;text-align:start}.vot-checkbox[hidden]{display:none !important}.vot-checkbox>input{appearance:none;-moz-appearance:none;-webkit-appearance:none;z-index:1;position:absolute;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:3px 1px;border:solid 2px;background:rgba(0,0,0,0);border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6);border-radius:2px;width:18px;height:18px;outline:none;cursor:pointer;transition:border-color .2s,background-color .2s}.vot-checkbox>input+span{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding-left:30px;width:inherit;cursor:pointer}.vot-checkbox>input+span::before{content:"";position:absolute;left:-10px;top:-8px;display:block;border-radius:50%;width:40px;height:40px;background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0));opacity:0;transform:scale(1);pointer-events:none;transition:opacity .3s,transform .2s}.vot-checkbox>input+span::after{content:"";z-index:1;display:block;position:absolute;top:3px;left:1px;-webkit-box-sizing:content-box !important;-moz-box-sizing:content-box !important;box-sizing:content-box !important;width:10px;height:5px;border:solid 2px rgba(0,0,0,0);border-right-width:0;border-top-width:0;pointer-events:none;transform:translate(3px, 4px) rotate(-45deg);transition:border-color .2s}.vot-checkbox>input:checked,.vot-checkbox>input:indeterminate{border-color:rgb(var(--vot-helper-theme));background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span::before,.vot-checkbox>input:indeterminate+span::before{background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span::after,.vot-checkbox>input:indeterminate+span::after{border-color:rgb(var(--vot-helper-ontheme, 255, 255, 255))}.vot-checkbox>input:indeterminate+span::after{border-left-width:0;transform:translate(4px, 3px)}.vot-checkbox:hover>input+span::before{opacity:.04}.vot-checkbox:active>input,.vot-checkbox:active:hover>input{border-color:rgb(var(--vot-helper-theme))}.vot-checkbox:active>input:checked{border-color:rgba(0,0,0,0);background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6)}.vot-checkbox:active>input+span::before{opacity:1;transform:scale(0);transition:transform 0s,opacity 0s}.vot-checkbox>input:disabled{border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-checkbox>input:disabled:checked,.vot-checkbox>input:disabled:indeterminate{border-color:rgba(0,0,0,0);background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38)}.vot-checkbox>input:disabled+span{color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-checkbox>input:disabled+span::before{opacity:0;transform:scale(0)}.vot-slider{--vot-safari-helper1: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.04 ) !important;--vot-safari-helper2: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.12 ) !important;--vot-safari-helper3: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.16 ) !important;--vot-safari-helper4: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.24 ) !important;display:inline-block;width:100% !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important;font-family:var(--vot-font, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system) !important;font-size:16px !important;line-height:1.5 !important;text-align:start !important}.vot-slider[hidden]{display:none !important}.vot-slider>input{-webkit-appearance:none !important;appearance:none !important;position:relative !important;top:24px !important;display:block !important;margin:0 0 -36px !important;width:100% !important;height:36px !important;background-color:rgba(0,0,0,0) !important;cursor:pointer !important}.vot-slider>input:last-child{position:static !important;margin:0 !important}.vot-slider>span{display:inline-block !important;margin-bottom:36px !important}.vot-slider>input:disabled{cursor:default !important;opacity:.38 !important}.vot-slider>input:disabled+span{color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input::-webkit-slider-runnable-track{margin:17px 0 !important;border-radius:1px !important;width:100% !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-webkit-slider-thumb{margin:0 !important;appearance:none !important;-webkit-appearance:none !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider:hover>input::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper1) !important}.vot-slider>input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper4) !important}.vot-slider>input:disabled::-webkit-slider-runnable-track{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-webkit-slider-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;color:rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::-moz-range-track{margin:17px 0 !important;border-radius:1px !important;width:100% !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-moz-range-thumb{appearance:none !important;-moz-appearance:none !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider>input::-moz-range-progress{border-radius:1px !important;height:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-slider:hover>input:hover::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.04) !important}.vot-slider>input:active::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input:disabled::-moz-range-track{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-moz-range-progress{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important}.vot-slider>input:disabled::-moz-range-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::-moz-focus-outer{border:none !important}.vot-slider>input::-ms-track{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin:17px 0 !important;border:none !important;border-radius:1px !important;padding:0 17px !important;width:100% !important;height:2px !important;background-color:rgba(0,0,0,0) !important}.vot-slider>input::-ms-fill-lower{border-radius:1px !important;height:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-slider>input::-ms-fill-upper{border-radius:1px !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-ms-thumb{appearance:none !important;margin:0 17px !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider:hover>input::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.04) !important}.vot-slider>input:active::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input:disabled::-ms-fill-lower{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-ms-fill-upper{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important;opacity:.38 !important}.vot-slider>input:disabled::-ms-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::before{content:"" !important;display:block !important;position:absolute !important;width:calc(100%*var(--vot-progress, 0)) !important;height:2px !important;top:calc(50% - 1px) !important;background:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-select{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0) !important;--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87) !important;--vot-helper-safari1: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;--vot-helper-safari2: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.87 ) !important;display:flex;align-items:center;justify-content:space-between;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;line-height:1.5;text-align:start;color:var(--vot-helper-theme);fill:var(--vot-helper-theme)}.vot-select[hidden]{display:none !important}.vot-select-label{font-size:16px}.vot-select-outer{display:flex;align-items:center;justify-content:space-between;max-width:120px;width:120px;padding:0 5px;border-style:solid !important;border-width:1px !important;border-color:var(--vot-helper-safari1) !important;border-radius:4px !important;cursor:pointer;transition:border .2s !important}.vot-select-outer:hover{border-color:var(--vot-helper-safari2) !important}.vot-select-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vot-select-arrow-icon{width:20px;height:32px;display:flex;justify-content:center;align-items:center}.vot-select-content-list{display:flex;flex-direction:column}.vot-select-content-list .vot-select-content-item{padding:5px 10px;border-radius:8px;cursor:pointer}.vot-select-content-list .vot-select-content-item:not([inert]):hover{background-color:#2a2c31}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]{color:rgb(var(--vot-primary-rgb, 33, 150, 243));background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.2)}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]:hover{background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.1) !important}.vot-select-content-list .vot-select-content-item[data-vot-disabled=true]{cursor:default}.vot-select-content-list .vot-select-content-item[hidden]{display:none !important}.vot-header{color:rgba(var(--vot-helper-onsurface-rgb), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-weight:bold;line-height:1.5;text-align:start}.vot-header[hidden]{display:none !important}.vot-header:not(:first-child){padding-top:8px}.vot-header-level-1{font-size:2em}.vot-header-level-2{font-size:1.5em}.vot-header-level-3{font-size:1.17em}.vot-header-level-4{font-size:1em}.vot-header-level-5{font-size:.83em}.vot-header-level-6{font-size:.67em}.vot-info{display:flex;color:rgba(var(--vot-helper-onsurface-rgb), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;text-align:start}.vot-info[hidden]{display:none !important}.vot-info>:not(:first-child){color:rgba(var(--vot-helper-onsurface-rgb), 0.5);flex:1;margin-left:8px}.vot-lang-select{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87);display:flex;align-items:center;justify-content:space-between;color:var(--vot-helper-theme);fill:var(--vot-helper-theme)}.vot-lang-select[hidden]{display:none !important}.vot-lang-select-icon{width:32px;height:32px;display:flex;justify-content:center;align-items:center}.vot-segmented-button{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87);overflow:hidden;position:absolute;left:50%;top:5rem;transform:translate(-50%);user-select:none;display:flex;align-items:center;height:32px;max-width:100vw;background:rgb(var(--vot-surface-rgb, 255, 255, 255));color:var(--vot-helper-theme);fill:var(--vot-helper-theme);border-radius:4px;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;cursor:default;transition:opacity .5s;z-index:100}.vot-segmented-button[hidden]{display:none !important}.vot-segmented-button *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-segmented-button .vot-separator{width:1px;height:50%;background:rgba(var(--vot-helper-theme-rgb), 0.1)}.vot-segmented-button .vot-separator[hidden]{display:none !important}.vot-segmented-button .vot-segment,.vot-segmented-button .vot-segment-only-icon{position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;height:100%;padding:0 8px;background-color:rgba(0,0,0,0);color:inherit;transition:background-color 100ms ease-in-out;border:none}.vot-segmented-button .vot-segment[hidden],.vot-segmented-button [hidden].vot-segment-only-icon{display:none !important}.vot-segmented-button .vot-segment::before,.vot-segmented-button .vot-segment-only-icon::before,.vot-segmented-button .vot-segment::after,.vot-segmented-button .vot-segment-only-icon::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-segmented-button .vot-segment::before,.vot-segmented-button .vot-segment-only-icon::before{background-color:rgb(var(--vot-helper-theme-rgb));transition:opacity .2s}.vot-segmented-button .vot-segment::after,.vot-segmented-button .vot-segment-only-icon::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-segmented-button .vot-segment:hover::before,.vot-segmented-button .vot-segment-only-icon:hover::before{opacity:.04}.vot-segmented-button .vot-segment:active::after,.vot-segmented-button .vot-segment-only-icon:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-segmented-button .vot-segment-only-icon{min-width:32px;padding:0}.vot-segmented-button .vot-segment-label{margin-left:8px;white-space:nowrap}.vot-segmented-button[data-status=success] .vot-translate-button{color:rgb(var(--vot-primary-rgb, 33, 150, 243));fill:rgb(var(--vot-primary-rgb, 33, 150, 243))}.vot-segmented-button[data-status=error] .vot-translate-button{color:#f28b82;fill:#f28b82}.vot-segmented-button svg{width:fit-content}.vot-menu{--vot-helper-surface-rgb: var(--vot-surface-rgb, 255, 255, 255);--vot-helper-surface: rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-onsurface: rgba(var(--vot-helper-onsurface-rgb), 0.87);overflow:hidden;position:absolute;left:50%;top:calc(5rem + 32px + 16px);user-select:none;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);border-radius:8px;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;min-width:300px;cursor:default;z-index:100;visibility:visible;opacity:1;transform-origin:top;transform:translate(-50%) scale(1);transition:opacity .3s,transform .1s}.vot-menu *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-menu[hidden]{pointer-events:none;display:block !important;visibility:hidden;opacity:0;transform:translate(-50%) scale(0)}.vot-menu-content-wrapper{display:flex;flex-direction:column;min-height:100px;max-height:calc(var(--vot-container-height, 75vh) - (5rem + 32px + 16px)*2);overflow:auto}.vot-menu-header-container{flex-shrink:0;align-items:flex-start;display:flex;min-height:31px}.vot-menu-header-container:empty{padding:0 0 16px 0}.vot-menu-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-menu-title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:0;text-align:start}.vot-menu-title{flex:1;font-size:16px;line-height:1;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-menu-body-container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto;padding:0 16px;gap:8px;overscroll-behavior:contain;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb), 0.1) var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar,.vot-menu-body-container::-webkit-scrollbar-track{height:12px !important;width:12px !important;background:var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb), 0.1) !important;-webkit-border-radius:1ex !important;border:5px solid var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface) !important}.vot-menu-footer-container{flex-shrink:0;display:flex;justify-content:flex-end;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-menu-footer-container:empty{padding:16px 0 0 0}.vot-dialog-container{visibility:visible;position:absolute;z-index:10000}.vot-dialog-container[hidden]{display:block !important;pointer-events:none;visibility:hidden}.vot-dialog-container *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-dialog-backdrop{background-color:rgba(0,0,0,.6);position:fixed;top:0;right:0;bottom:0;left:0;opacity:1;transition:opacity .3s}[hidden]>.vot-dialog-backdrop{pointer-events:none;opacity:0}.vot-dialog{--vot-helper-surface-rgb: var(--vot-surface-rgb, 255, 255, 255);--vot-helper-surface: rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-onsurface: rgba(var(--vot-helper-onsurface-rgb), 0.87);display:block;position:fixed;top:50%;bottom:50%;max-width:initial;max-height:initial;width:min(var(--vot-dialog-width, 512px),100%);height:fit-content;inset-inline-start:0px;inset-inline-end:0px;inset-block-start:0px;inset-block-end:0px;border-radius:8px;margin:auto;padding:0;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);box-shadow:0 0 16px rgba(0,0,0,.12),0 16px 16px rgba(0,0,0,.24);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;user-select:none;visibility:visible;overflow:auto;overflow-y:hidden;opacity:1;transform-origin:center;transform:scale(1);transition:opacity .3s,transform .1s}[hidden]>.vot-dialog{pointer-events:none;opacity:0;transform:scale(0.5);transition:opacity .1s,transform .2s}.vot-dialog-content-wrapper{display:flex;flex-direction:column;max-height:75vh;overflow:auto}.vot-dialog-header-container{flex-shrink:0;align-items:flex-start;display:flex;min-height:31px}.vot-dialog-header-container:empty{padding:0 0 20px 0}.vot-dialog-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-dialog-title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:0}.vot-dialog-title{flex:1;font-size:115.3846153846%;font-weight:bold;line-height:1;padding-bottom:16px;padding-inline-end:20px;padding-inline-start:20px;padding-top:20px}.vot-dialog-body-container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto;padding:0 20px;gap:16px;overscroll-behavior:contain;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb), 0.1) var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar,.vot-dialog-body-container::-webkit-scrollbar-track{height:12px !important;width:12px !important;background:var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb), 0.1) !important;-webkit-border-radius:1ex !important;border:5px solid var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface) !important}.vot-dialog-footer-container{flex-shrink:0;display:flex;justify-content:flex-end;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-dialog-footer-container:empty{padding:20px 0 0 0}.vot-subtitles-widget{display:flex;justify-content:center;align-items:center;position:absolute;width:50%;max-height:100%;min-height:20%;z-index:100;left:25%;top:75%;pointer-events:none}.vot-subtitles{position:relative;max-width:100%;max-height:100%;width:max-content;background:var(--vot-subtitles-background, rgba(46, 47, 52, 0.8));color:var(--vot-subtitles-color, rgb(227, 227, 227));border-radius:1rem;pointer-events:all;padding:1rem;font-size:2rem;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vot-subtitles .passed{color:var(--vot-subtitles-passed-color, rgb(33, 150, 243))}:root{--vot-font-family: "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system;--vot-primary-rgb: 139, 180, 245;--vot-onprimary-rgb: 32, 33, 36;--vot-surface-rgb: 32, 33, 36;--vot-onsurface-rgb: 227, 227, 227;--vot-subtitles-background: rgba(var(--vot-surface-rgb, 46, 47, 52), 0.8);--vot-subtitles-color: rgb(var(--vot-onsurface-rgb, 227, 227, 227));--vot-subtitles-passed-color: rgb(var(--vot-primary-rgb, 33, 150, 243))}vot-block{display:block}',""]);const s=r},"./node_modules/css-loader/dist/runtime/api.js":t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,a,i){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(n)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),a&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=a):c[4]="".concat(a)),e.push(c))}},e}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":t=>{"use strict";t.exports=function(t){return t[1]}},"./node_modules/requestidlecallback-polyfill/index.js":()=>{window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)},window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":t=>{"use strict";var e=[];function o(t){for(var o=-1,n=0;n{"use strict";var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(t,e,o)=>{"use strict";t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var n="";o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var a=void 0!==o.layer;a&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,a&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}");var i=o.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},"./node_modules/webpack-monkey/lib/node/deps/style-loader-insertStyleElement.js":t=>{t.exports=function(){return function(t){return t.styleTagTransform=function(t,e){e?.remove(),GM_addStyle(t)},document.createElement("style")}.apply(null,arguments)}},"./src/config/config.js":(t,e,o)=>{"use strict";o.d(e,{Cc:()=>r,JD:()=>s,K2:()=>d,Pm:()=>a,QL:()=>c,S7:()=>i,mE:()=>l,rw:()=>u,se:()=>n});const n="m3u8-proxy.toil.cc",a="vot.toil.cc",i="xtGCyGdTY2Jy6OMEKdTuXev3Twhkamgm",r="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 YaBrowser/23.7.1.1140 Yowser/2.5 Safari/537.36",s=.15,l="yandex",d="yandex",c={yandex:"https://translate.toil.cc/detect",rustServer:"https://rust-server-531j.onrender.com/detect"},u={yandex:"https://translate.toil.cc/translate"}},"./src/utils/debug.js":(t,e,o)=>{"use strict";o.d(e,{A:()=>a});const n={log:(...t)=>{}},a=n},"./src/utils/storage.js":(t,e,o)=>{"use strict";o.d(e,{d:()=>a});var n=o("./src/utils/debug.js");const a=new class{constructor(){this.gmSupport="function"==typeof GM_getValue,n.A.log(`GM Storage Status: ${this.gmSupport}`)}syncGet(t,e=void 0,o=!1){if(this.gmSupport)return GM_getValue(t,e);let n=window.localStorage.getItem(t);if("udemyData"===t&&"string"==typeof n)try{n=JSON.parse(n)}catch{n=e}return o?Number(n)??Number(e):n??e}async get(t,e=void 0,o=!1){return this.gmSupport?await GM_getValue(t,e):Promise.resolve(this.syncGet(t,e,o))}syncSet(t,e){return this.gmSupport?GM_setValue(t,e):("udemyData"===t&&(e=JSON.stringify(e)),window.localStorage.setItem(t,e))}async set(t,e){return this.gmSupport?await GM_setValue(t,e):Promise.resolve(this.syncSet(t,e))}syncDelete(t){return this.gmSupport?GM_deleteValue(t):window.localStorage.removeItem(t)}async delete(t){return this.gmSupport?await GM_deleteValue(t):Promise.resolve(this.syncDelete(t))}syncList(){return this.gmSupport?GM_listValues():["autoTranslate","dontTranslateLanguage","dontTranslateYourLang","autoSetVolumeYandexStyle","showVideoSlider","syncVolume","subtitlesMaxLength","highlightWords","responseLanguage","defaultVolume","udemyData","audioProxy","showPiPButton","locale-version","locale-lang","locale-phrases"]}async list(){return this.gmSupport?await GM_listValues():Promise.resolve(this.syncList())}}},"./src/yandexRequest-cloudflare.js":(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>r});var n=o("./src/config/config.js"),a=o("./src/utils/debug.js"),i=o("./src/utils/storage.js");const r=async function(t,e,o,r){let s,l;try{a.A.log("yandexRequest:",t);const r={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":n.Cc,Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors",...o},body:Array.from(e)})},d=await i.d.get("proxyWorkerHost",n.Pm);s=await fetch(`https://${d}${t}`,r),a.A.log("yandexRequest:",s.status,s),l=await s.arrayBuffer()}catch(t){console.error("[VOT]",t),s={status:-1},l=t}r(200==s.status,l)}}},e={};function o(n){var a=e[n];if(void 0!==a)return a.exports;var i=e[n]={id:n,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nc=void 0,(()=>{"use strict";const t=["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"],e=["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"],n=["proxitok.pabloferreiro.es","proxitok.pussthecat.org","tok.habedieeh.re","proxitok.esmailelbob.xyz","proxitok.privacydev.net","tok.artemislena.eu","tok.adminforge.de","tik.hostux.net","tt.vern.cc","cringe.whatever.social","proxitok.lunar.icu","proxitok.privacy.com.de"],a=["peertube.1312.media","tube.shanti.cafe","bee-tube.fr","video.sadmin.io","dalek.zone","review.peertube.biz","peervideo.club","tube.la-dina.net","peertube.tmp.rcp.tf"];var i=o("./src/config/config.js");const r=["ru","en","zh","ko","lt","lv","ar","fr","it","es","de","ja"],s=["kk","bn","pt","cs","hi","mr","te","tr","ms","vi","ta","jv","ur","fa","gu","id","uk","da","fi","uz","pl","sv","az","sq","am","hy","af","eu","my","bg","bs","cy","hu","gl","el","zu","kn","ca","km","lo","mk","ml","mt","mn","ne","nl","pa","ro","sr","si","sk","sl","sw","su","hr","et"],l=["ru","en","kk"],d=JSON.parse('{"__version__":3,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","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! {0} 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":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyAccessTokenExpired":"Your entered Udemy Access Token has expired","udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","enterUdemyAccessToken":"Enter Udemy Access Token","VOTUdemyData":"Udemy Data","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings"}');var c=o("./src/utils/debug.js"),u=o("./src/utils/storage.js");const h=["auto","en","ru","af","am","ar","az","bg","bn","bs","ca","cs","cy","da","de","el","es","et","eu","fa","fi","fr","gl","hi","hr","hu","hy","id","it","ja","jv","kk","km","kn","ko","lo","mk","ml","mn","ms","mt","my","ne","nl","pa","pl","pt","ro","si","sk","sl","sq","sr","su","sv","sw","tr","uk","ur","uz","vi","zh","zu"],p=new class{lang="en";locale={};gmValues=["locale-phrases","locale-lang","locale-version","locale-lang-override"];constructor(){const t=u.d.syncGet("locale-lang-override","auto");this.lang=t&&"auto"!==t?t:(navigator.language||navigator.userLanguage)?.substr(0,2)?.toLowerCase()??"en",this.setLocaleFromJsonString(u.d.syncGet("locale-phrases",""))}reset(){this.gmValues.forEach((t=>u.d.syncDelete(t)))}async update(t=!1){(t||2!==await u.d.get("locale-version",0,!0)||await u.d.get("locale-lang")!==this.lang)&&(c.A.log("Updating locale..."),await fetch(`https://raw.githubusercontent.com/ilyhalight/voice-over-translation/master/src/localization/locales/${this.lang}.json`).then((t=>{if(200===t.status)return t.text();throw t.status})).then((async t=>{await u.d.set("locale-phrases",t),this.setLocaleFromJsonString(t);const e=this.getFromLocale(this.locale,"__version__");"number"==typeof e&&await u.d.set("locale-version",e),await u.d.set("locale-lang",this.lang)})).catch((async t=>{console.error("[VOT] [localizationProvider] failed get locale, cause:",t),this.setLocaleFromJsonString(await u.d.get("locale-phrases",""))})))}setLocaleFromJsonString(t){try{this.locale=JSON.parse(t)??{}}catch(t){console.error("[VOT] [localizationProvider]",t),this.locale={}}}getFromLocale(t,e){const o=e.split(".").reduce(((t,e)=>{if("object"==typeof t&&t)return t[e]}),t);return void 0===o&&console.warn("[VOT] [localizationProvider] locale",t,"doesn't contain key",e),o}getDefault(t){return this.getFromLocale(d,t)??t}get(t){return this.getFromLocale(this.locale,t)??this.getFromLocale(d,t)??t}};var g=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),v=o.n(g),m=o("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),b=o.n(m),f=o("./node_modules/style-loader/dist/runtime/insertBySelector.js"),y=o.n(f),w=o("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),x=o.n(w),S=o("./node_modules/webpack-monkey/lib/node/deps/style-loader-insertStyleElement.js"),k=o.n(S),T=o("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),V=o.n(T),M=o("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/main.scss"),L={};L.styleTagTransform=V(),L.setAttributes=x(),L.insert=y().bind(null,"head"),L.domAPI=b(),L.insertStyleElement=k();v()(M.A,L);M.A&&M.A.locals&&M.A.locals;function A(t){const e=document.createElement("vot-block");return e.classList.add("vot-icon-button"),e.innerHTML=t,e}function P(t){const e=parseFloat(t.value),o=""===t.min?0:parseFloat(t.min),n=(e-o)/((""===t.max?100:parseFloat(t.max))-o);t.parentElement.setAttribute("style",`--vot-progress: ${n}`)}function E(t,e="",o=" ",n=!1){const a=document.createElement("vot-block");a.classList.add("vot-textfield");const i=document.createElement(n?"textarea":"input");i.placeholder=o,i.value=e;const r=document.createElement("span");return r.innerHTML=t,a.appendChild(i),a.appendChild(r),{container:a,input:i,label:r}}function O(t){const e=document.createElement("vot-block");e.classList.add("vot-dialog-container"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-dialog-backdrop");const n=document.createElement("vot-block");n.classList.add("vot-dialog");const a=document.createElement("vot-block");a.classList.add("vot-dialog-content-wrapper");const i=document.createElement("vot-block");i.classList.add("vot-dialog-header-container");const r=document.createElement("vot-block");r.classList.add("vot-dialog-body-container");const s=document.createElement("vot-block");s.classList.add("vot-dialog-footer-container");const l=document.createElement("vot-block");l.classList.add("vot-dialog-title-container");const d=A('');d.classList.add("vot-dialog-close-button"),o.onclick=d.onclick=()=>{e.hidden=!0};const c=document.createElement("vot-block");return c.classList.add("vot-dialog-title"),c.innerHTML=t,e.appendChild(o),e.appendChild(n),n.appendChild(a),a.appendChild(i),a.appendChild(r),a.appendChild(s),i.appendChild(l),i.appendChild(d),l.appendChild(c),{container:e,backdrop:o,dialog:n,contentWrapper:a,headerContainer:i,bodyContainer:r,footerContainer:s,titleContainer:l,closeButton:d,title:c}}function C(t,e,o,n={}){const a=n.onSelectCb||function(){},i=n.labelElement||"";let r=[];const s=document.createElement("vot-block");s.classList.add("vot-select"),i&&s.appendChild(i);const l=document.createElement("vot-block");l.classList.add("vot-select-outer");const d=document.createElement("span");d.classList.add("vot-select-title"),d.innerText=t,void 0===t&&(d.innerText=o.find((t=>!0===t.selected))?.label);const c=document.createElement("vot-block");c.classList.add("vot-select-arrow-icon"),c.innerHTML='',l.append(d,c),l.onclick=()=>{const t=O(e);t.container.classList.add("vot-dialog-temp"),t.container.hidden=!1,document.documentElement.appendChild(t.container);const n=document.createElement("vot-block");n.classList.add("vot-select-content-list");for(const t of o){const e=document.createElement("vot-block");e.classList.add("vot-select-content-item"),e.innerText=t.label,e.dataset.votSelected=t.selected,e.dataset.votValue=t.value,t.disabled&&(e.inert=!0),e.onclick=async i=>{if(i.target.inert)return;n.childNodes.forEach((t=>t.dataset.votSelected=!1)),o.forEach((e=>e.selected=e.value===t.value)),e.dataset.votSelected=!0,d.innerText=t.label,await a(i)},n.appendChild(e)}const i=E(p.get("searchField"));i.input.oninput=t=>{const e=t.target.value.toLowerCase();Array.from(r).forEach((t=>t.hidden=!t.innerText.toLowerCase().includes(e)))},t.bodyContainer.append(i.container,n),r=n.childNodes,t.backdrop.onclick=t.closeButton.onclick=()=>{t.container.remove(),r=[]}},s.append(l);return{container:s,title:d,arrowIcon:c,labelElement:i,setTitle:t=>{d.innerText=t},setSelected:t=>{Array.from(r).filter((t=>!t.inert)).forEach((e=>e.dataset.votSelected=e.dataset.votValue===t)),o.forEach((e=>e.selected=String(e.value)===t))},updateItems:t=>{o=t}}}const B={createHeader:function(t,e=4){const o=document.createElement("vot-block");return o.classList.add("vot-header"),o.classList.add(`vot-header-level-${e}`),o.innerHTML=t,o},createInformation:function(t,e){const o=document.createElement("vot-block");o.classList.add("vot-info");const n=document.createElement("vot-block");n.innerHTML=t;const a=document.createElement("vot-block");return a.innerHTML=e,o.appendChild(n),o.appendChild(a),{container:o,header:n,value:a}},createButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-button"),e.innerHTML=t,e},createTextButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-text-button"),e.innerHTML=t,e},createOutlinedButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-outlined-button"),e.innerHTML=t,e},createIconButton:A,createCheckbox:function(t,e=!1){const o=document.createElement("label");o.classList.add("vot-checkbox");const n=document.createElement("input");n.type="checkbox",n.checked=Boolean(e);const a=document.createElement("span");return a.innerHTML=t,o.appendChild(n),o.appendChild(a),{container:o,input:n,label:a}},createSlider:function(t,e=50,o=0,n=100){const a=document.createElement("vot-block");a.classList.add("vot-slider");const i=document.createElement("input");i.type="range",i.min=o,i.max=n,i.value=e;const r=document.createElement("span");return r.innerHTML=t,a.appendChild(i),a.appendChild(r),i.addEventListener("input",(t=>P(t.target))),P(i),{container:a,input:i,label:r}},createTextfield:E,createDialog:O,createVOTButton:function(t){const e=document.createElement("vot-block");e.classList.add("vot-segmented-button");const o=document.createElement("vot-block");o.classList.add("vot-segment"),o.classList.add("vot-translate-button"),o.innerHTML='';const n=document.createElement("vot-block");n.classList.add("vot-separator");const a=document.createElement("vot-block");a.classList.add("vot-segment-only-icon"),a.innerHTML='';const i=document.createElement("vot-block");i.classList.add("vot-separator");const r=document.createElement("vot-block");r.classList.add("vot-segment-only-icon"),r.innerHTML='';const s=document.createElement("span");return s.classList.add("vot-segment-label"),s.innerHTML=t,e.appendChild(o),e.appendChild(n),e.appendChild(a),e.appendChild(i),e.appendChild(r),o.appendChild(s),{container:e,translateButton:o,separator:n,pipButton:a,separator2:i,menuButton:r,label:s}},createVOTMenu:function(t){const e=document.createElement("vot-block");e.classList.add("vot-menu"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-menu-content-wrapper");const n=document.createElement("vot-block");n.classList.add("vot-menu-header-container");const a=document.createElement("vot-block");a.classList.add("vot-menu-body-container");const i=document.createElement("vot-block");i.classList.add("vot-menu-footer-container");const r=document.createElement("vot-block");r.classList.add("vot-menu-title-container");const s=document.createElement("vot-block");return s.classList.add("vot-menu-title"),s.innerHTML=t,e.appendChild(o),o.appendChild(n),o.appendChild(a),o.appendChild(i),n.appendChild(r),r.appendChild(s),{container:e,contentWrapper:o,headerContainer:n,bodyContainer:a,footerContainer:i,titleContainer:r,title:s}},createVOTSelectLabel:function(t){const e=document.createElement("span");return e.classList.add("vot-select-label"),e.innerText=t,e},createVOTSelect:C,createVOTLanguageSelect:function(t){const e=t.fromTitle||"#UNDEFINED",o=t.fromDialogTitle||"#UNDEFINED",n=t.fromItems||[],a=t.fromOnSelectCB||function(){},i=t.toTitle||"#UNDEFINED",r=t.toDialogTitle||"#UNDEFINED",s=t.toItems||[],l=t.toOnSelectCB||function(){},d=document.createElement("vot-block");d.classList.add("vot-lang-select");const c=C(e,o,n,{onSelectCb:a}),u=document.createElement("vot-block");u.classList.add("vot-lang-select-icon"),u.innerHTML='';const h=C(i,r,s,{onSelectCb:l});return d.append(c.container,u,h.container),{container:d,fromSelect:c,icon:u,toSelect:h}},updateSlider:P};class F extends Error{constructor(t){super(p.getDefault(t)),this.name="VOTLocalizedError",this.unlocalizedMessage=t,this.localizedMessage=p.get(t)}}async function _(t,e){const o=new AbortController,n=setTimeout((()=>o.abort()),3e3);try{return await fetch(t,{...e,signal:o.signal})}catch(t){return console.error("Fetch timed-out. Error:",t),t}finally{clearTimeout(n)}}const R={async translate(t,e){try{const o=await _(i.rw.yandex,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,lang:e})});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.text[0]}catch(e){return console.error("Error translating text:",e),t}},async detect(t,e){try{const o=await _(i.QL.yandex,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,lang:e})});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.lang??"en"}catch(t){return console.error("Error translating text:",t),"en"}}},q={async detect(t){try{const e=await fetch(i.QL.rustServer,{method:"POST",body:t});if(e instanceof Error)throw e;return await e.text()}catch(t){return console.error("Error getting lang from text:",t),"en"}}};const D=["yandex"],z=["yandex","rust-server"];async function I(t,e,o,n){if(!window.location.hostname.includes("m.youtube.com")&&t?.getAudioTrack){const e=t.getAudioTrack(),o=e?.getLanguageInfo();if("und"!==o?.id)return Z(o.id.split(".")[0])}const a=e?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(a?.length){const t=a.find((t=>"asr"===t.kind));if(t&&t.languageCode)return Z(t.languageCode)}const r=[/(?:https?|ftp):\/\/[\S]+/g,/https?:\/\/\S+|www\.\S+/gm,/\b\S+\.\S+/gm,/#[^\s#]+/g,/Auto-generated by YouTube/g,/Provided to YouTube by/g,/Released on/g,/Bitcoin/g,/USDT/g,/Paypal/g],s=[o,n?n.split("\n\n").filter((t=>!r.some((e=>e.test(t))))).join("\n\n"):""].join(" ").replace(/[^\p{L}\s]/gu," ").trim().replace(/\s+/g," ").slice(0,1e3);return await async function(t){switch(await u.d.get("detectService",i.K2)){case"yandex":return await R.detect(t);case"rust-server":return await q.detect(t);default:return"en"}}(s)}function $(){return/^m\.youtube\.com$/.test(window.location.hostname)}function N(){return window.location.pathname.startsWith("/shorts/")?$()?document.querySelector("#movie_player"):document.querySelector("#shorts-player"):document.querySelector("#movie_player")}function H(){const t=N();return t?.getPlayerResponse?t?.getPlayerResponse?.call()??null:t?.data?.playerResponse??null}function j(){const t=N();return t?.getVideoData?t?.getVideoData?.call()??null:t?.data?.playerResponse?.videoDetails??null}const U={isMobile:$,getPlayer:N,getPlayerResponse:H,getPlayerData:j,getVideoVolume:function(){const t=N();return t?.getVolume?t.getVolume.call()/100:1},getSubtitles:function(){const t=H();let e=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks??[];return e=e.reduce(((t,e)=>{if("languageCode"in e){const o=e?.languageCode?Z(e?.languageCode):void 0,n=e?.url||e?.baseUrl;o&&n&&t.push({source:"youtube",language:o,isAutoGenerated:"asr"===e?.kind,url:`${n.startsWith("http")?n:`${window.location.origin}/${n}`}&fmt=json3`})}return t}),[]),c.A.log("youtube subtitles:",e),e},getVideoData:async function(){const t=N(),e=H(),o=j(),{title:n}=o??{},{shortDescription:a,isLive:i}=e?.videoDetails??{};let s=n?await I(t,e,n,a):"en";s=r.includes(s)?s:"en";const l={isLive:!!i,title:n,description:a,detectedLanguage:s};return c.A.log("youtube video data:",l),console.log("[VOT] Detected language: ",l.detectedLanguage),l},setVideoVolume:function(t){const e=N();if(e?.setVolume)return e.setVolume(Math.round(100*t)),!0},videoSeek:function(t,e){c.A.log("videoSeek",e);const o=(N()?.getProgressState()?.seekableEnd||t.currentTime)-e;t.currentTime=o}},W=navigator.language||navigator.userLanguage,G=W?.substr(0,2)?.toLowerCase()??"en",Y=(t,e)=>{let o=new URL(window.location.href);switch(t){case"piped":case"invidious":case"youtube":if(o.searchParams.has("enablejsapi")){const t=U.getPlayer().getVideoUrl();o=new URL(t)}return o.pathname.match(/(?:watch|embed|shorts)\/([^/]+)/)?.[1]||o.searchParams.get("v");case"vk":return o.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)?o.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)[0].slice(1):o.searchParams.get("z")?o.searchParams.get("z").split("/")[0]:!(!o.searchParams.get("oid")||!o.searchParams.get("id"))&&`video-${Math.abs(o.searchParams.get("oid"))}_${o.searchParams.get("id")}`;case"nine_gag":case"9gag":case"gag":return o.pathname.match(/gag\/([^/]+)/)?.[1];case"twitch":if(/^m\.twitch\.tv$/.test(window.location.hostname)){const t=document.head.querySelector('link[rel="canonical"]');return t?.href.match(/videos\/([^/]+)/)?.[0]||o.pathname.slice(1)}if(/^player\.twitch\.tv$/.test(window.location.hostname))return`videos/${o.searchParams.get("video")}`;if(/^clips\.twitch\.tv$/.test(window.location.hostname)){const t=document.querySelector(".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']");if(!t)return!1;return`${t.href.replace("https://www.twitch.tv/","")}/clip/${o.searchParams.get("clip")}`}return o.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)?o.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)[0]:o.pathname.match(/(?:videos)\/([^/]+)/)?.[0];case"proxytok":return o.pathname.match(/([^/]+)\/video\/([^/]+)/)?.[0];case"tiktok":{let t=o.pathname.match(/([^/]+)\/video\/([^/]+)/)?.[0];if(!t){const o=e.closest(".xgplayer-playing, .tiktok-web-player"),n=o?.closest('div[data-e2e="recommend-list-item-container"]'),a=n?.querySelector('a[data-e2e="video-author-avatar"]');if(o&&a){const e=o.id?.match(/^xgwrapper-[0-9]+-(.*)$/)?.at(1),n=a.href?.match(/.*(@.*)$/)?.at(1);e&&n&&(t=`${n}/video/${e}`)}}return t}case"vimeo":{const t=o.searchParams.get("app_id"),e=o.pathname.match(/[^/]+\/[^/]+$/)?.[0]||o.pathname.match(/[^/]+$/)?.[0];return t?`${e}?app_id=${t}`:e}case"xvideos":return o.pathname.match(/[^/]+\/[^/]+$/)?.[0];case"pornhub":return o.searchParams.get("viewkey")||o.pathname.match(/embed\/([^/]+)/)?.[1];case"twitter":return o.pathname.match(/status\/([^/]+)/)?.[1];case"udemy":case"rumble":case"facebook":return o.pathname;case"rutube":return o.pathname.match(/(?:video|embed)\/([^/]+)/)?.[1];case"coub":return o.pathname.includes("/view")?o.pathname.match(/view\/([^/]+)/)?.[1]:o.pathname.includes("/embed")?o.pathname.match(/embed\/([^/]+)/)?.[1]:document.querySelector(".coub.active")?.dataset?.permalink;case"bilibili":{const t=o.searchParams.get("bvid");if(t)return t;{let t=o.pathname.match(/video\/([^/]+)/)?.[1];return t&&o.search&&null!==o.searchParams.get("p")&&(t+=`/?p=${o.searchParams.get("p")}`),t}}case"mail_ru":if(o.pathname.startsWith("/v/")||o.pathname.startsWith("/mail/"))return o.pathname;if(o.pathname.match(/video\/embed\/([^/]+)/)){const t=document.querySelector(".b-video-controls__mymail-link");return!!t&&t?.href.split("my.mail.ru")?.[1]}return!1;case"bitchute":return o.pathname.match(/video\/([^/]+)/)?.[1];case"coursera":return o.pathname.match(/learn\/([^/]+)\/lecture\/([^/]+)/)?.[0];case"eporner":return o.pathname.match(/video-([^/]+)\/([^/]+)/)?.[0];case"peertube":return o.pathname.match(/\/w\/([^/]+)/)?.[0];case"dailymotion":{const t=Array.from(document.querySelectorAll("*")).filter((t=>t.innerHTML.trim().includes(".m3u8")));try{let e=t[1].lastChild.src;return e.match(/\/video\/(\w+)\.m3u8/)?.[1]}catch(t){return console.error("[VOT]",t),!1}}case"trovo":{if(!o.pathname.startsWith("/s/"))return!1;const t=o.searchParams.get("vid");if(!t)return!1;const e=o.pathname.match(/([^/]+)\/([\d]+)/)?.[0];return!!e&&`${e}?vid=${t}`}case"yandexdisk":return o.pathname.match(/\/i\/([^/]+)/)?.[1];case"coursehunter":{const t=o.pathname.match(/\/course\/([^/]+)/)?.[1];return!!t&&t+o.search}case"ok.ru":return o.pathname.match(/\/video\/(\d+)/)?.[0];case"googledrive":return o.searchParams.get("docid");case"bannedvideo":return o.searchParams.get("id");case"weverse":return o.pathname.match(/([^/]+)\/(live|media)\/([^/]+)/)?.[0];case"newgrounds":return o.pathname.match(/([^/]+)\/(view)\/([^/]+)/)?.[0];case"egghead":return o.pathname;case"youku":return o.pathname.match(/v_show\/id_[\w=]+/)?.[0];default:return!1}};function Z(t){return t.toLowerCase().split(";")[0].trim().split("-")[0].split("_")[0]}function K(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}function J(){return"undefined"!=typeof Hls&&Hls?.isSupported()?new Hls({debug:!1,lowLatencyMode:!0,backBufferLength:90}):void 0}function Q(t,e,o,n){let a=e;return e>n?(a=o+(e-n),a=a>100?100:Math.max(a,0),t.volume=a/100):e100?100:Math.max(a,0),t.volume=a/100),a}const X=new protobuf.Type("VideoTranslationHelpObject").add(new protobuf.Field("target",1,"string")).add(new protobuf.Field("targetUrl",2,"string")),tt=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("duration",6,"double")).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,"VideoTranslationHelpObject","repeated")).add(new protobuf.Field("responseLanguage",14,"string")).add(new protobuf.Field("unknown5",15,"int32")).add(new protobuf.Field("unknown6",16,"int32")).add(new protobuf.Field("unknown7",17,"int32")),et=new protobuf.Type("VideoSubtitlesRequest").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("language",2,"string")),ot=new protobuf.Type("VideoStreamRequest").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("language",2,"string")).add(new protobuf.Field("responseLanguage",3,"string")),nt=new protobuf.Type("VideoStreamPingRequest").add(new protobuf.Field("pingId",1,"int32")),at=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("unknown0",6,"int32")).add(new protobuf.Field("unknown1",7,"string")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("message",9,"string")),it=new protobuf.Type("VideoSubtitlesObject").add(new protobuf.Field("language",1,"string")).add(new protobuf.Field("url",2,"string")).add(new protobuf.Field("unknown2",3,"int32")).add(new protobuf.Field("translatedLanguage",4,"string")).add(new protobuf.Field("translatedUrl",5,"string")).add(new protobuf.Field("unknown5",6,"int32")).add(new protobuf.Field("unknown6",7,"int32")),rt=new protobuf.Type("VideoSubtitlesResponse").add(new protobuf.Field("unknown0",1,"int32")).add(new protobuf.Field("subtitles",2,"VideoSubtitlesObject","repeated")),st=new protobuf.Type("VideoStreamObject").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("timestamp",2,"int64")),lt=new protobuf.Type("VideoStreamResponse").add(new protobuf.Field("interval",1,"int32")).add(new protobuf.Field("translatedInfo",2,"VideoStreamObject")).add(new protobuf.Field("pingId",3,"int32")),dt=(new protobuf.Root).define("yandex").add(X).add(tt).add(at).add(et).add(it).add(rt).add(nt).add(ot).add(st).add(lt),ct={encodeTranslationRequest:(t,e,o,n,a)=>dt.VideoTranslationRequest.encode({url:t,firstRequest:!0,duration:e,unknown2:1,language:o,unknown3:0,unknown4:0,translationHelp:a,responseLanguage:n,unknown5:0,unknown6:1,unknown7:0}).finish(),decodeTranslationResponse:t=>dt.VideoTranslationResponse.decode(new Uint8Array(t)),encodeSubtitlesRequest:(t,e)=>dt.VideoSubtitlesRequest.encode({url:t,language:e}).finish(),decodeSubtitlesResponse:t=>dt.VideoSubtitlesResponse.decode(new Uint8Array(t)),encodeStreamPingRequest:t=>dt.VideoStreamPingRequest.encode({pingId:t}).finish(),encodeStreamRequest:(t,e,o)=>dt.VideoStreamRequest.encode({url:t,language:e,responseLanguage:o}).finish(),decodeStreamResponse:t=>dt.VideoStreamResponse.decode(new Uint8Array(t))};var ut=o("./node_modules/bowser/es5.js");function ht(t){const e=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)));return t?e:e.toUpperCase()}async function pt(t){const e=new TextEncoder("utf-8"),o=await window.crypto.subtle.importKey("raw",e.encode(i.S7),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),n=await window.crypto.subtle.sign("HMAC",o,t);return Array.from(new Uint8Array(n),(t=>t.toString(16).padStart(2,"0"))).join("")}const gt=async function(t,e){try{c.A.log("requestStreamPing");const n=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest-cloudflare.js"))).default;c.A.log("Inited yandexRequest...");const a=ct.encodeStreamPingRequest(t);await n("/stream-translation/ping-stream",a,{"Vtrans-Signature":await pt(a),"Sec-Vtrans-Token":ht(!1)},e)}catch(t){console.error("[VOT]",t),e(!1)}};const vt=async function(t,e,n,a){try{c.A.log("requestStreamTranslation");const i=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest-cloudflare.js"))).default;c.A.log("Inited yandexRequest...");const r=ct.encodeStreamRequest(t,e,n);await i("/stream-translation/translate-stream",r,{"Vtrans-Signature":await pt(r),"Sec-Vtrans-Token":ht(!1)},a)}catch(t){console.error("[VOT]",t),a(!1)}};const mt=async function(t,e,n,a,i,r){try{c.A.log("requestVideoTranslation");const s=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest-cloudflare.js"))).default;c.A.log("Inited yandexRequest...");const l=ct.encodeTranslationRequest(t,e,n,a,i);await s("/video-translation/translate",l,{"Vtrans-Signature":await pt(l),"Sec-Vtrans-Token":ht(!1)},r)}catch(t){console.error("[VOT]",t),r(!1)}};const bt=async function(t,e,n){try{c.A.log("requestVideoSubtitles");const a=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest-cloudflare.js"))).default;c.A.log("Inited yandexRequest...");const i=ct.encodeSubtitlesRequest(t,e);await a("/video-subtitles/get-subtitles",i,{"Vsubs-Signature":await pt(i),"Sec-Vsubs-Token":ht(!1)},n)}catch(t){console.error("[VOT]",t),n(!1)}};function ft(t){const e=t.startMs+t.durationMs;return t.tokens.reduce(((o,n,a)=>{const i=t.tokens[a+1];let r;o.length>0&&(r=o[o.length-1]);const s=r?.alignRange?.end??0,l=s+n.text.length;if(n.alignRange={start:s,end:l},o.push(n),i){const t=n.startMs+n.durationMs,a=i.startMs?i.startMs-t:e-t;o.push({text:" ",startMs:t,durationMs:a,alignRange:{start:l,end:l+1}})}return o}),[])}function yt(t,e){const o=t.text.split(/([\n \t])/).reduce(((t,o)=>{if(o.length){const n=t[t.length-1]??e,a=n?.alignRange?.end??0,i=a+o.length;t.push({text:o,alignRange:{start:a,end:i}})}return t}),[]),n=Math.floor(t.durationMs/o.length),a=t.startMs+t.durationMs;return o.map(((e,i)=>{const r=i===o.length-1,s=t.startMs+n*i;return{...e,startMs:s,durationMs:r?a-s:n}}))}async function wt(t){let e=!1,o=await Promise.race([new Promise((t=>{setTimeout((()=>{e||(console.error("[VOT] Failed to fetch subtitles. Reason: timeout"),t([]))}),5e3)})),new Promise((o=>{c.A.log("Fetching subtitles:",t),fetch(t.url).then((t=>t.json())).then((t=>{e=!0,o(t)})).catch((t=>{console.error("[VOT] Failed to fetch subtitles. Reason:",t),e=!0,o({containsTokens:!1,subtitles:[]})}))}))]);return"youtube"===t.source&&(o=function(t){const e={containsTokens:!1,subtitles:[]};if("object"!=typeof t||!("events"in t)||!Array.isArray(t.events))return console.error("[VOT] Failed to format youtube subtitles",t),e;for(let o=0;ot.utf8.replace(/^ +| +$/g,""))).join(" ");let a=t.events[o].dDurationMs;t.events[o+1]&&t.events[o].tStartMs+t.events[o].dDurationMs>t.events[o+1].tStartMs&&(a=t.events[o+1].tStartMs-t.events[o].tStartMs),"\n"!==n&&e.subtitles.push({text:n,startMs:t.events[o].tStartMs,durationMs:a})}return e}(o)),o.subtitles=function(t,e){const o=[];let n;for(const a of t.subtitles){let i;if(a?.tokens?.length){if("yandex"!==e)return console.warn("[VOT] Unsupported subtitles tokens type: ",e),t.containsTokens=!1,null;i=ft(a)}else i=yt(a,n);n=i[i.length-1],o.push({...a,tokens:i})}return t.containsTokens=!0,o}(o,t.source),console.log("[VOT] subtitles:",o),o}class xt{dragging=!1;subtitlesContainerRect=null;containerRect=null;offsetX=null;offsetY=null;lastContent=null;highlightWords=!1;subtitles=null;maxLength=300;maxLengthRegexp=/.{1,300}(?:\s|$)/g;constructor(t,e,o){this.site=o,this.video=t,"youtube"===this.site.host&&"mobile"!==this.site.additionalData?this.container=e.parentElement:this.container=e,this.votSubtitlesContainer=document.createElement("vot-block"),this.votSubtitlesContainer.classList.add("vot-subtitles-widget"),this.container.appendChild(this.votSubtitlesContainer),this.onMouseDownBound=this.onMouseDown.bind(this),this.onMouseUpBound=this.onMouseUp.bind(this),this.onMouseMoveBound=this.onMouseMove.bind(this),this.onTimeUpdateBound=this.onTimeUpdate.bind(this),document.addEventListener("mousedown",this.onMouseDownBound),document.addEventListener("mouseup",this.onMouseUpBound),document.addEventListener("mousemove",this.onMouseMoveBound),this.video?.addEventListener("timeupdate",this.onTimeUpdateBound)}release(){this.video?.removeEventListener("timeupdate",this.onTimeUpdateBound),document.removeEventListener("mousedown",this.onMouseDownBound),document.removeEventListener("mouseup",this.onMouseUpBound),document.removeEventListener("mousemove",this.onMouseMoveBound),this.votSubtitlesContainer.remove()}onMouseDown(t){this.votSubtitlesContainer.contains(t.target)&&(this.subtitlesContainerRect=this.votSubtitlesContainer.getBoundingClientRect(),this.containerRect=this.container.getBoundingClientRect(),this.offsetX=t.clientX-this.subtitlesContainerRect.x,this.offsetY=t.clientY-this.subtitlesContainerRect.y,this.dragging=!0)}onMouseUp(){this.dragging=!1}onMouseMove(t){if(this.dragging){t.preventDefault();const e=t.clientX-this.offsetX,o=t.clientY-this.offsetY,n=o>=this.containerRect.top,a=o+this.subtitlesContainerRect.height<=this.containerRect.bottom,i=e>=this.containerRect.left,r=e+this.subtitlesContainerRect.width<=this.containerRect.right;this.votSubtitlesContainer.style.top=n&&a?o-this.containerRect.y+"px":n?this.containerRect.height-this.subtitlesContainerRect.height+"px":"0px",this.votSubtitlesContainer.style.left=i&&r?e-this.containerRect.x+"px":i?this.containerRect.width-this.subtitlesContainerRect.width+"px":"0px"}}onTimeUpdate(){this.update()}setContent(t){t&&this.video?(this.subtitles=t,this.update()):(this.subtitles=null,this.votSubtitlesContainer.innerHTML="")}setMaxLength(t){"number"==typeof t&&t&&(this.maxLength=t,this.maxLengthRegexp=new RegExp(`.{1,${t}}(?:\\s|$)`,"g"),this.update())}setHighlightWords(t){this.highlightWords!==!!t&&(this.highlightWords=!!t,this.update())}update(){if(!this.video)return;let t="",e=this.highlightWords&&this.subtitles?.containsTokens;const o=1e3*this.video.currentTime,n=this.subtitles?.subtitles?.findLast((t=>t.startMsthis.maxLength){let t=[],n=0,a=0,i=0;for(let o=0;othis.maxLength){let r=e.slice(n,a+1);r.at(0)&&" "===r.at(0).text&&(r=r.slice(1)),r.at(-1)&&" "===r.at(-1).text&&(r=r.slice(0,r.length-1)),t.push({startMs:e[n].startMs,durationMs:e[a].startMs+e[a].durationMs-e[n].startMs,tokens:r}),n=o,i=0}a=o}for(const n of t)if(n.startMse||o>n.startMs-100&&e-o<275?'class="passed"':""}>${n.text}`}}else if(n.text.length>this.maxLength){let e=n.text.match(this.maxLengthRegexp),a=n.durationMs/e.length;for(let i=0;i${t.replace("\\n","
")}`:"")}}const St={getVideoData:async function(){const t=window.course_id??document.querySelector('input[name="course_id"]')?.value,e=window.lessons??await async function(t){const e=await fetch(`https://coursehunter.net/api/v1/course/${t}/lessons`);return await e.json()}(t),o=parseInt(document.querySelector(".lessons-item_active")?.dataset?.index??1),n=e?.[o-1],{file:a,duration:i}=n;return c.A.log("coursehunter course data:",e),{url:a,duration:i}}};function kt(){return Tt()?.player}function Tt(){return document.querySelector(".vjs-v6")}const Vt={getPlayer:Tt,getPlayerData:kt,getVideoData:async function(t="en"){let e=null;const o=kt(),{duration:n}=o?.cache_||{},{courseId:a,tracks:i,sources:s}=o?.options_||{},l=function(t){const e=t?.find((t=>"video/mp4"===t.type));return e?.src}(s),d=await async function(t){const e=await fetch(`https://www.coursera.org/api/onDemandCourses.v1/${t}`),o=await e.json();return o?.elements?.[0]}(a);let u=d?.primaryLanguageCodes?.[0];u=u?Z(u):"en",r.includes(u)||(u="en");const h=function(t,e,o){let n=t?.find((t=>Z(t.srclang)===e));return n||(n=t?.find((t=>Z(t.srclang)===o))||t?.[0]),n?.src}(i,u,t);console.log(`videoURL: ${l}, subtitlesURL: ${h}`),h&&l?e=[{target:"video_file_url",targetUrl:l},{target:"subtitles_file_url",targetUrl:`https://www.coursera.org${h}`}]:console.error(`Failed to find subtitlesURL or videoURL. videoURL: ${l}, subtitlesURL: ${h}`);const p={duration:n,detectedLanguage:u,translationHelp:e};return c.A.log("coursera video data:",p),console.log("[VOT] Detected language: ",p.detectedLanguage),p}},Mt="https://www.udemy.com/api-2.0",Lt=2592e6;async function At(t){const e=await fetch(`${Mt}/courses/${t}/?`+new URLSearchParams({"fields[course]":"locale",use_remote_version:"true",caching_intent:"true"}));return await e.json()}async function Pt(t,e,o){if(!(n=t.expires,n+Lt>(new Date).getTime()&&t.accessToken))return void console.error(p.get("udemyAccessTokenExpired"));var n;const a=`Bearer ${t.accessToken}`,i=await fetch(`${Mt}/users/me/subscribed-courses/${e}/lectures/${o}/?`+new URLSearchParams({"fields[lecture]":"asset","fields[asset]":"length,media_sources,captions"}),{headers:{"x-udemy-authorization":a,authorization:a}});return await i.json()}function Et(){return Ct()?.player}function Ot(){const t=document.querySelector(".ud-app-loader[data-module-id='course-taking']")?.dataset?.moduleArgs;return t?JSON.parse(t):(console.error(p.get("udemyModuleArgsNotFound")),{})}function Ct(){return document.querySelector(".vjs-v7")}const Bt={getPlayer:Ct,getPlayerData:Et,getVideoData:async function(t,e="en"){let o=null;const n=Et();c.A.log("udemyData",t);const a=Ot();c.A.log("moduleData: ",a);const i=a.courseId,s=window.location.pathname.match(/learn\/lecture\/([^/]+)/)?.[1];c.A.log(`CourseId: ${i}, lectureId: ${s}`);const l=await At(i);c.A.log("courseLang Data:",l);const d=await Pt(t,i,s);console.log("lecture Data:",d);let u=l?.locale?.locale;u=u?Z(u):"en",r.includes(u)||(u="en");const h=d?.asset?.length||n?.cache_?.duration,p=function(t){const e=t?.find((t=>"video/webm"===t.type||"video/mp4"===t.type));return e?.src}(d?.asset?.media_sources)||function(){const t=Ct()?.querySelector("video")?.src;return!t?.startsWith("blob:")&&t}(),g=function(t,e,o){let n=t?.find((t=>Z(t.locale_id)===e));return n||(n=t?.find((t=>Z(t.locale_id)===o))||t?.[0]),n?.url}(d?.asset?.captions,u,e);console.log(`videoURL: ${p}, subtitlesURL: ${g}`),g&&p?o=[{target:"video_file_url",targetUrl:p},{target:"subtitles_file_url",targetUrl:g}]:console.error(`Failed to find subtitlesURL or videoURL. videoURL: ${p}, subtitlesURL: ${g}`);const v={duration:h,detectedLanguage:u,translationHelp:o};return c.A.log("udemy video data:",v),console.log("[VOT] Detected language: ",v.detectedLanguage),v},getModuleData:Ot,getCourseLang:At,getLectureData:Pt};const Ft={getVideoData:async function(t){const e=await async function(t){return await fetch("https://api.banned.video/graphql",{method:"POST",body:JSON.stringify({operationName:"GetVideo",query:"query GetVideo($id: String!) {\n getVideo(id: $id) {\n ...DisplayVideoFields\n videoUrl: directUrl\n live\n }\n }\n\n fragment DisplayVideoFields on Video {\n title\n description: summary\n duration: videoDuration\n }",variables:{id:t}}),headers:{"User-Agent":"bannedVideoFrontEnd","apollographql-client-name":"banned-web","apollographql-client-version":"1.3","content-type":"application/json"}}).then((t=>t.json())).catch((t=>(console.error(t),{data:{getVideo:{}}})))}(t);c.A.log("banned.video video data:",e);const{videoUrl:o,duration:n,live:a,description:i,title:r}=e.data.getVideo;return{url:o,duration:n,live:a,title:r,description:i}}};const _t="https://global.apis.naver.com/weverse/wevweb",Rt="be4d79eb8fc7bd008ee82c8ec4ff6fd4",qt="1b9cb6378d959b45714bec49971ade22e6e24e42";async function Dt(t){const e=Date.now();let o=t.substring(0,Math.min(255,t.length))+e;const n=await async function(t,e){const o=new TextEncoder("utf-8");return e=o.encode(e),window.crypto.subtle.importKey("raw",o.encode(t),{name:"HMAC",hash:{name:"SHA-1"}},!1,["sign","verify"]).then((t=>window.crypto.subtle.sign("HMAC",t,e))).then((t=>btoa(String.fromCharCode(...new Uint8Array(t))))).catch((t=>(console.error(t),!1)))}(qt,o);return{wmsgpad:e,wmd:n}}function zt(){return{appId:Rt,language:"en",os:"WEB",platform:"WEB",wpf:"pc"}}const It={getVideoData:async function(){const t=new URL(window.location).pathname.match(/([^/]+)\/(live|media)\/([^/]+)/)?.[3],e=await async function(t){const e=`/post/v1.0/post-${t}/preview?`+new URLSearchParams({fieldSet:"postForPreview",...zt()}),o=await Dt(e);return await fetch(_t+e+"&"+new URLSearchParams(o)).then((t=>t.json())).catch((t=>(console.error(t),{extension:{video:{}}})))}(t);c.A.log("weverse video preview data:",e);const{videoId:o,serviceId:n,infraVideoId:a}=e.extension.video;if(!(o&&n&&a))return!1;const{inKey:i}=await async function(t){const e=`/video/v1.1/vod/${t}/inKey?`+new URLSearchParams({gcc:"RU",...zt()}),o=await Dt(e);return await fetch(_t+e+"&"+new URLSearchParams(o),{method:"POST"}).then((t=>t.json())).catch((t=>(console.error(t),{})))}(o);if(c.A.log("weverse video inKey data:",e),!i)return!1;const r=await async function(t,e,o){const n=Date.now();return await fetch(`https://global.apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/${t}?`+new URLSearchParams({key:e,sid:o,nonce:n,devt:"html5_pc",prv:"N",aup:"N",stpb:"N",cpl:"en",env:"prod",lc:"en",adi:[{adSystem:null}],adu:"/"})).then((t=>t.json())).catch((t=>(console.error(t),{videos:{list:[]}})))}(a,i,n);c.A.log("weverse video data:",r);const s=r.videos.list.find((t=>!1===t.useP2P&&t.source.includes(".mp4")));if(!s)return!1;const{source:l,duration:d}=s;return{url:l,duration:d}}},$t=[{additionalData:"mobile",host:"youtube",url:"https://youtu.be/",match:/^m.youtube(-nocookie)?.com$/,selector:"shorts-video #player"},{additionalData:"mobile",host:"youtube",url:"https://youtu.be/",match:/^m.youtube(-nocookie)?.com$/,selector:".player-container"},{host:"youtube",url:"https://youtu.be/",match:/^(www.)?youtube(-nocookie|kids)?.com$/,selector:".html5-video-container:not(#inline-player *)"},{host:"tiktok",url:"https://www.tiktok.com/",match:/^(www.)?tiktok.com$/,selector:null},{host:"proxytok",url:"https://www.tiktok.com/",match:n,selector:".column.has-text-centered"},{host:"twitch",url:"https://twitch.tv/",match:[/^m.twitch.tv$/,/^www.twitch.tv$/,/^clips.twitch.tv$/,/^player.twitch.tv$/],selector:".video-ref, main > div > section > div > div > div"},{host:"xvideos",url:"https://www.xvideos.com/",match:/^www.xvideos.com$/,selector:".video-bg-pic"},{host:"pornhub",url:"https://rt.pornhub.com/view_video.php?viewkey=",match:/^[a-z]+.pornhub.com$/,selector:".mainPlayerDiv > .video-element-wrapper-js > div"},{additionalData:"embed",host:"pornhub",url:"https://rt.pornhub.com/view_video.php?viewkey=",match:t=>t.host.includes("pornhub.com")&&t.pathname.startsWith("/embed/"),selector:"#player"},{additionalData:"mobile",host:"vk",url:"https://vk.com/video?z=",match:/^m.vk.(com|ru)$/,selector:"vk-video-player",shadowRoot:!0},{host:"vk",url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:".videoplayer_media"},{host:"vimeo",url:"https://vimeo.com/",match:/^vimeo.com$/,selector:".player"},{additionalData:"embed",host:"vimeo",url:"https://player.vimeo.com/",match:/^player.vimeo.com$/,selector:".player"},{host:"ok.ru",url:"https://ok.ru/",match:/^ok.ru$/,selector:".html5-vpl_vid"},{host:"nine_gag",url:"https://9gag.com/gag/",match:/^9gag.com$/,selector:".video-post"},{host:"coub",url:"https://coub.com/view/",match:/^coub.com$/,selector:".viewer__player"},{host:"bitchute",url:"https://www.bitchute.com/video/",match:/^(www.)?bitchute.com$/,selector:"#player"},{host:"rutube",url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:".video-player > div > div > div:nth-child(2)"},{additionalData:"embed",host:"rutube",url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:"#app > div > div"},{host:"bilibili",url:"https://www.bilibili.com/video/",match:/^(www|m|player).bilibili.com$/,selector:".bpx-player-video-wrap"},{additionalData:"old",host:"bilibili",url:"https://www.bilibili.com/video/",match:/^(www|m).bilibili.com$/,selector:null},{host:"twitter",url:"https://twitter.com/i/status/",match:/^twitter.com$/,selector:'div[data-testid="videoComponent"] > div:nth-child(1) > div'},{host:"mail_ru",url:"https://my.mail.ru/",match:/^my.mail.ru$/,selector:"#b-video-wrapper"},{host:"coursera",url:"https://www.coursera.org/",match:/coursera.org$/,selector:".vjs-v6"},{host:"udemy",url:"https://www.udemy.com",match:/udemy.com$/,selector:'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)'},{host:"invidious",url:"https://youtu.be/",match:t,selector:"#player"},{host:"piped",url:"https://youtu.be/",match:e,selector:".shaka-video-container"},{host:"rumble",url:"https://rumble.com",match:/^rumble.com$/,selector:"#videoPlayer > .videoPlayer-Rumble-cls > div"},{host:"eporner",url:"https://www.eporner.com/",match:/^(www.)?eporner.com$/,selector:".vjs-v7"},{host:"peertube",url:"tube.shanti.cafe",match:a,selector:".vjs-v7"},{host:"dailymotion",url:"https://www.dailymotion.com/video/",match:/^geo.dailymotion.com$/,selector:".player"},{host:"trovo",url:"https://trovo.live/s/",match:/^trovo.live$/,selector:".player-video"},{host:"yandexdisk",url:"https://disk.yandex.ru/i/",match:/^disk.yandex.ru$/,selector:"yaplayertag > div:nth-of-type(1)"},{host:"coursehunter",url:"https://coursehunter.net/course/",match:/^coursehunter.net$/,selector:"#oframeplayer > pjsdiv:nth-of-type(1)"},{host:"googledrive",url:"https://drive.google.com/file/d/",match:/^youtube.googleapis.com$/,selector:".html5-video-container"},{host:"bannedvideo",url:"https://banned.video/watch?id=",match:/^(www.)?banned.video$/,selector:".vjs-v7"},{host:"facebook",url:"https://facebook.com",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/videos/"),selector:'div[data-pagelet="WatchPermalinkVideo"]'},{additionalData:"reels",host:"facebook",url:"https://facebook.com",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/reel/"),selector:'div[role="main"]'},{host:"weverse",url:"https://weverse.io/",match:/^weverse.io$/,selector:".webplayer-internal-source-wrapper"},{host:"newgrounds",url:"https://www.newgrounds.com/",match:/^www.newgrounds.com$/,selector:".ng-video-player"},{host:"egghead",url:"https://egghead.io",match:/^egghead.io$/,selector:".cueplayer-react-video-holder"},{host:"youku",url:"https://v.youku.com/",match:/^v.youku.com$/,selector:"#ykPlayer"}];o("./node_modules/requestidlecallback-polyfill/index.js");class Nt{constructor(){this.listeners=new Set}hasListener(t){return this.listeners.has(t)}dispatchToListener(t,...e){try{t(...e)}catch(t){console.error("[VOT]",t)}}addListener(t){if(this.hasListener(t))throw new Error("[VOT] The listener has already been added.");this.listeners.add(t)}removeListener(t){if(!this.hasListener(t))throw new Error("[VOT] The listener has not been added yet.");this.listeners.delete(t)}dispatch(...t){for(const e of Array.from(this.listeners))this.dispatchToListener(e,...t)}}function Ht(t){return Array.from(t).flatMap((t=>t instanceof HTMLVideoElement?[t]:t instanceof HTMLElement?Array.from(t.querySelectorAll("video")):t.shadowRoot?Array.from(t.shadowRoot.querySelectorAll("video")):[]))}const jt=ut.getParser(window.navigator.userAgent).getResult(),Ut=[...t,...e],Wt=["playing","ratechange","play","waiting","pause"];function Gt(t,e,o=!1){return t.map((t=>({label:`${o&&!l.includes(t)?"❌ ":""}${p.get("langs")[t]??t.toUpperCase()}`,value:t,selected:e===t})))}var Yt=!1;function Zt(t,e,o,n,a,i){c.A.log(`Translate video (url: ${t}, duration: ${e}, requestLang: ${o}, responseLang: ${n})`),c.A.log("translationHelp:",a),Yt?c.A.log("translationPanding return"):(Yt=!0,mt(t,e,o,n,a,((t,e)=>{if(Yt=!1,c.A.log("[exec callback] Requesting video translation"),!t)return void i(!1,p.get("requestTranslationFailed"));const o=ct.decodeTranslationResponse(e);switch(console.log("[VOT] Translation response: ",o),o.status){case 0:i(!1,o.message);break;case 1:i(!!o.url,o.url||p.get("audioNotReceived"));break;case 2:i(!1,o.remainingTime?function(t){const e=Math.floor(t/60),o=Math.floor(t%60);return e>=60?p.get("translationTakeMoreThanHour"):e>=10&&e%10?p.get("translationTakeApproximatelyMinutes").replace("{0}",e):1==e||0==e&&o>0?p.get("translationTakeAboutMinute"):p.get("translationTakeApproximatelyMinute").replace("{0}",e)}(o.remainingTime):p.get("translationTakeFewMinutes"));break;case 3:case 6:i(!1,p.get("videoBeingTranslated"))}})))}class Kt{translateFromLang="en";translateToLang=G;timer;ytData="";videoData="";firstPlay=!0;audio=new Audio;hls=J();videoTranslations=[];videoTranslationTTL=7200;downloadTranslationUrl=null;downloadSubtitlesUrl=null;autoRetry;streamPing;volumeOnStart;tempOriginalVolume;tempVolume;subtitlesList=[];subtitlesListVideoId=null;videoLastSrcObject=null;constructor(t,e,o){c.A.log("[VideoHandler] add video:",t,"container:",e,this),this.video=t,this.container=e,this.site=o,this.handleSrcChangedBound=this.handleSrcChanged.bind(this),this.video.addEventListener("loadedmetadata",this.handleSrcChangedBound),this.stopTranslationBound=this.stopTranslation.bind(this),this.handleVideoEventBound=this.handleVideoEvent.bind(this),this.changeOpacityOnEventBound=this.changeOpacityOnEvent.bind(this),this.resetTimerBound=this.resetTimer.bind(this),this.init()}async init(){if(this.initialized)return;const t="uk"===G?1:0,e={autoTranslate:u.d.get("autoTranslate",0,!0),dontTranslateLanguage:u.d.get("dontTranslateLanguage",G),dontTranslateYourLang:u.d.get("dontTranslateYourLang",1,!0),autoSetVolumeYandexStyle:u.d.get("autoSetVolumeYandexStyle",1,!0),autoVolume:u.d.get("autoVolume",i.JD,!0),showVideoSlider:u.d.get("showVideoSlider",1,!0),syncVolume:u.d.get("syncVolume",0,!0),subtitlesMaxLength:u.d.get("subtitlesMaxLength",300,!0),highlightWords:u.d.get("highlightWords",0,!0),responseLanguage:u.d.get("responseLanguage",G),defaultVolume:u.d.get("defaultVolume",100,!0),udemyData:u.d.get("udemyData",{accessToken:"",expires:0}),audioProxy:u.d.get("audioProxy",t,!0),showPiPButton:u.d.get("showPiPButton",0,!0),translateAPIErrors:u.d.get("translateAPIErrors",1,!0),translationService:u.d.get("translationService",i.mE),detectService:u.d.get("detectService",i.K2),m3u8ProxyHost:u.d.get("m3u8ProxyHost",i.se),proxyWorkerHost:u.d.get("proxyWorkerHost",i.Pm)},o=await Promise.all(Object.entries(e).map((async([t,e])=>[t,await e])));this.data=Object.fromEntries(o),this.videoData=await this.getVideoData(),console.log("[db] data from db: ",this.data),this.subtitlesWidget=new xt(this.video,this.container,this.site),this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength),this.subtitlesWidget.setHighlightWords(this.data.highlightWords),this.initUI(),this.initUIEvents();const n=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=n,n&&(this.votMenu.container.hidden=!0),await this.updateSubtitles(),await this.changeSubtitlesLang("disabled"),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage??"ru"),this.translateToLang=this.data.responseLanguage??"ru",this.initExtraEvents(),this.initialized=!0}transformBtn(t="none",e){this.votButton.container.dataset.status=t,this.votButton.label.innerHTML=e}initUI(){this.votButton=B.createVOTButton(p.get("translateVideo")),this.container.appendChild(this.votButton.container),this.votButton.pipButton.hidden=!K()||!this.data?.showPiPButton,this.votButton.separator2.hidden=!K()||!this.data?.showPiPButton,this.votButton.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votMenu=B.createVOTMenu(p.get("VOTSettings")),this.container.appendChild(this.votMenu.container),this.votDownloadButton=B.createIconButton(''),this.votDownloadButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadButton),this.votDownloadSubtitlesButton=B.createIconButton(''),this.votDownloadSubtitlesButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadSubtitlesButton),this.votSettingsButton=B.createIconButton(''),this.votMenu.headerContainer.appendChild(this.votSettingsButton),this.votTranslationLanguageSelect=B.createVOTLanguageSelect({fromTitle:p.get("langs")[this.video.detectedLanguage],fromDialogTitle:p.get("videoLanguage"),fromItems:[{label:p.get("langs").auto,value:"auto",selected:""},...Gt(r,this.videoData.detectedLanguage)],fromOnSelectCB:async t=>{c.A.log("[fromOnSelectCB] select from language",t.target.dataset.votValue),this.videoData=await this.getVideoData(),this.setSelectMenuValues(t.target.dataset.votValue,this.videoData.responseLanguage)},toTitle:p.get("langs")[this.video.responseLanguage],toDialogTitle:p.get("translationLanguage"),toItems:[...Gt(r,this.videoData.responseLanguage,!0),{label:"─────────",value:"separator",disabled:!0},...Gt(s,this.videoData.responseLanguage,!0)],toOnSelectCB:async t=>{const e=t.target.dataset.votValue;c.A.log("[toOnSelectCB] select to language",e),this.data.responseLanguage=this.translateToLang=e,await u.d.set("responseLanguage",this.data.responseLanguage),c.A.log("Response Language value changed. New value: ",this.data.responseLanguage),this.videoData=await this.getVideoData(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage)}}),this.votMenu.bodyContainer.appendChild(this.votTranslationLanguageSelect.container),this.votSubtitlesSelect=B.createVOTSelect(p.get("VOTSubtitlesDisabled"),p.get("VOTSubtitles"),[{label:p.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1}],{onSelectCb:async t=>{await this.changeSubtitlesLang(t.target.dataset.votValue)},labelElement:B.createVOTSelectLabel(p.get("VOTSubtitles"))}),this.votMenu.bodyContainer.appendChild(this.votSubtitlesSelect.container),this.votVideoVolumeSlider=B.createSlider(`${p.get("VOTVolume")}: ${100*this.getVideoVolume()}%`,100*this.getVideoVolume()),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoVolumeSlider.container),this.votVideoTranslationVolumeSlider=B.createSlider(`${p.get("VOTVolumeTranslation")}: ${this.data?.defaultVolume??100}%`,this.data?.defaultVolume??100),this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoTranslationVolumeSlider.container),this.votMenu.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votSettingsDialog=B.createDialog(p.get("VOTSettings")),document.documentElement.appendChild(this.votSettingsDialog.container),this.votTranslationHeader=B.createHeader(p.get("translationSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationHeader),this.votAutoTranslateCheckbox=B.createCheckbox(p.get("VOTAutoTranslate"),this.data?.autoTranslate??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoTranslateCheckbox.container),this.votDontTranslateYourLangSelect=B.createVOTSelect(p.get("langs")[u.d.syncGet("dontTranslateLanguage",G)],p.get("VOTDontTranslateYourLang"),Gt(r,u.d.syncGet("dontTranslateLanguage",G)),{onSelectCb:async t=>{this.data.dontTranslateLanguage=t.target.dataset.votValue,await u.d.set("dontTranslateLanguage",this.data.dontTranslateLanguage)},labelElement:B.createCheckbox(p.get("VOTDontTranslateYourLang"),this.data?.dontTranslateYourLang??!0).container}),this.votSettingsDialog.bodyContainer.appendChild(this.votDontTranslateYourLangSelect.container),this.votAutoSetVolumeCheckbox=B.createCheckbox(`${p.get("VOTAutoSetVolume")}`,this.data?.autoSetVolumeYandexStyle??!0),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeCheckbox.container),this.votAutoSetVolumeSlider=B.createSlider(`${100*(this.data?.autoVolume??i.JD)}%`,100*(this.data?.autoVolume??i.JD),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=B.createCheckbox(p.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votUdemyDataTextfield=B.createTextfield(p.get("VOTUdemyData"),this.data?.udemyData?.accessToken??""),this.votUdemyDataTextfield.container.hidden="udemy"!==this.site.host,this.votSettingsDialog.bodyContainer.appendChild(this.votUdemyDataTextfield.container),this.votSyncVolumeCheckbox=B.createCheckbox(p.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSyncVolumeCheckbox.container.hidden=!["youtube","googledrive"].includes(this.site.host)||"mobile"===this.site.additionalData,this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votTranslationServiceSelect=B.createVOTSelect(u.d.syncGet("translationService",i.mE),p.get("VOTTranslationService"),Gt(D,u.d.syncGet("translationService",i.mE)),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await u.d.set("translationService",this.data.translationService)},labelElement:B.createCheckbox(p.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===p.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=B.createVOTSelect(u.d.syncGet("detectService",i.K2),p.get("VOTDetectService"),Gt(z,u.d.syncGet("detectService",i.K2)),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await u.d.set("detectService",this.data.detectService)},labelElement:B.createVOTSelectLabel(p.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=B.createHeader(p.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesMaxLengthSlider=B.createSlider(`${p.get("VOTSubtitlesMaxLength")}: ${this.data?.subtitlesMaxLength??300}`,this.data?.subtitlesMaxLength??300,50,300),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesMaxLengthSlider.container),this.votSubtitlesHighlightWordsCheckbox=B.createCheckbox(p.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votProxyHeader=B.createHeader(p.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=B.createTextfield(p.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,i.se),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=B.createTextfield(p.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,i.Pm),this.votProxyWorkerHostTextfield.container.hidden=!1,this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=B.createCheckbox(p.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votAudioProxyCheckbox.container.hidden=!1,this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votAboutHeader=B.createHeader(p.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=B.createVOTSelect(p.get("langs")[u.d.syncGet("locale-lang-override","auto")],p.get("VOTMenuLanguage"),Gt(h,u.d.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await u.d.set("locale-lang-override",t.target.dataset.votValue)},labelElement:B.createVOTSelectLabel(p.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=B.createCheckbox(p.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!K(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=B.createInformation(`${p.get("VOTVersion")}:`,`cloudflare ${GM_info.script.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=B.createInformation(`${p.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=B.createInformation(`${p.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=B.createInformation(`${p.get("VOTBrowser")}:`,`${jt.browser.name} ${jt.browser.version} (${jt.os.name} ${jt.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votResetSettingsButton=B.createButton(p.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}initUIEvents(){this.votButton.translateButton.addEventListener("click",(()=>{(async()=>{if(this.audio.src)return c.A.log("[click translationBtn] audio.src is not empty"),void this.stopTranslate();if(this.hls.url)return c.A.log("[click translationBtn] hls is not empty"),void this.stopTranslate();try{if(c.A.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new F("VOTNoVideoIDFound");await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t)}})()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votDownloadButton.addEventListener("click",(()=>{this.downloadTranslationUrl&&window.open(this.downloadTranslationUrl,"_blank").focus()})),this.votDownloadSubtitlesButton.addEventListener("click",(()=>{console.log(this.downloadSubtitlesUrl),this.downloadSubtitlesUrl&&window.open(this.downloadSubtitlesUrl,"_blank").focus()})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);if(this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${e}%`,this.setVideoVolume(e/100),1===this.data.syncVolume){const t=Number(this.votVideoTranslationVolumeSlider.input.value),o=Q(this.audio,e,t,this.tempOriginalVolume);this.votVideoTranslationVolumeSlider.input.value=o,this.votVideoTranslationVolumeSlider.label.querySelector("strong").innerHTML=`${o}%`,B.updateSlider(this.votVideoTranslationVolumeSlider.input),this.tempVolume=o,this.tempOriginalVolume=e}})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await u.d.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").innerHTML=`${this.data.defaultVolume}%`,this.audio.volume=this.data.defaultVolume/100,1===this.data.syncVolume&&this.syncTranslationWithVideo(this.data.defaultVolume)})()})),this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await u.d.set("autoTranslate",this.data.autoTranslate),c.A.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await u.d.set("dontTranslateYourLang",this.data.dontTranslateYourLang),c.A.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await u.d.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),c.A.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await u.d.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").innerHTML=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await u.d.set("showVideoSlider",this.data.showVideoSlider),c.A.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votUdemyDataTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.udemyData={accessToken:t.target.value,expires:(new Date).getTime()},await u.d.set("udemyData",this.data.udemyData),c.A.log("udemyData value changed. New value: ",this.data.udemyData),window.location.reload()})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await u.d.set("syncVolume",this.data.syncVolume),c.A.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await u.d.set("translateAPIErrors",this.data.translateAPIErrors),c.A.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesMaxLengthSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesMaxLength=Number(t.target.value),await u.d.set("subtitlesMaxLength",this.data.subtitlesMaxLength),this.votSubtitlesMaxLengthSlider.label.querySelector("strong").innerHTML=`${this.data.subtitlesMaxLength}`,this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength)})()})),this.votSubtitlesHighlightWordsCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.highlightWords=Number(t.target.checked),await u.d.set("highlightWords",this.data.highlightWords),c.A.log("highlightWords value changed. New value: ",this.data.highlightWords),this.subtitlesWidget.setHighlightWords(this.data.highlightWords)})()})),this.votShowPiPButtonCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showPiPButton=Number(t.target.checked),await u.d.set("showPiPButton",this.data.showPiPButton),c.A.log("showPiPButton value changed. New value: ",this.data.showPiPButton),this.votButton.pipButton.hidden=!K()||!this.data.showPiPButton,this.votButton.separator2.hidden=!K()||!this.data.showPiPButton})()})),this.votM3u8ProxyHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.m3u8ProxyHost=t.target.value||i.se,await u.d.set("m3u8ProxyHost",this.data.m3u8ProxyHost),c.A.log("m3u8ProxyHost value changed. New value: ",this.data.m3u8ProxyHost)})()})),this.votProxyWorkerHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.proxyWorkerHost=t.target.value||i.Pm,await u.d.set("proxyWorkerHost",this.data.proxyWorkerHost),c.A.log("proxyWorkerHost value changed. New value: ",this.data.proxyWorkerHost),window.location.reload()})()})),this.votAudioProxyCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioProxy=Number(t.target.checked),await u.d.set("audioProxy",this.data.audioProxy),c.A.log("audioProxy value changed. New value: ",this.data.audioProxy)})()})),this.votResetSettingsButton.addEventListener("click",(()=>{(async()=>{p.reset();(await u.d.list()).filter((t=>!p.gmValues.includes(t))).forEach((t=>u.d.syncDelete(t))),window.location.reload()})()}))}releaseExtraEvents(){clearInterval(this.resizeInterval),this.resizeObserver?.disconnect(),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.syncVolumeObserver?.disconnect(),this.extraEvents?.forEach((t=>{t.element.removeEventListener(t.event,t.handler)}))}initExtraEvents(){this.extraEvents=[];const t=(t,e,o)=>{this.extraEvents.push({element:t,event:e,handler:o}),t.addEventListener(e,o)},e=(e,o,n)=>{o.forEach((o=>{t(e,o,n)}))};if(this.resizeObserver=new ResizeObserver((t=>{t.forEach((t=>{this.votMenu.container.setAttribute("style",`--vot-container-height: ${t.contentRect.height}px`)}))})),this.resizeObserver.observe(this.video),this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`),this.resizeInterval=setInterval((()=>{this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`)}),500),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData){this.syncVolumeObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"aria-valuenow"===t.attributeName&&this.syncVideoVolumeSlider()}))}));const t=document.querySelector(".ytp-volume-panel");t&&this.syncVolumeObserver.observe(t,{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0})}let o;document.addEventListener("click",(t=>{const e=t.target,o=this.votButton.container,n=this.votMenu.container,a=this.container,i=this.votSettingsDialog.container,r=document.querySelector(".vot-dialog-temp"),s=o.contains(e),l=n.contains(e),d=a.contains(e),u=i.contains(e),h=r?.contains(e)??!1;c.A.log(`[document click] ${s} ${l} ${d} ${u} ${h}`),s||l||u||h||(d||this.logout(0),this.votMenu.container.hidden=!0)})),o="pornhub"===this.site.host?"embed"===this.site.additionalData?document.querySelector("#player"):this.container.querySelector(".video-element-wrapper-js > div"):"twitter"===this.site.host?document.querySelector('div[data-testid="videoPlayer"]'):"yandexdisk"===this.site.host?document.querySelector(".video-player__player"):this.container,o&&e(o,["mousemove","mouseout"],this.resetTimerBound),t(this.votButton.container,"mousemove",this.changeOpacityOnEventBound),t(this.votMenu.container,"mousemove",this.changeOpacityOnEventBound),e(document,["touchstart","touchmove","touchend"],this.changeOpacityOnEventBound),t(this.votButton.container,"mousedown",(t=>{t.stopImmediatePropagation()})),t(this.votMenu.container,"mousedown",(t=>{t.stopImmediatePropagation()})),"youtube"===this.site.host&&(this.container.draggable=!1),t(this.video,"progress",(async()=>{if(this.videoData.videoId&&this.firstPlay&&1===this.data.autoTranslate&&Y(this.site.host,this.video)===this.videoData.videoId)try{this.firstPlay=!1,await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t),this.firstPlay=!1}}))}logout(t){this.votMenu.container.hidden&&(this.votButton.container.style.opacity=t)}resetTimer(){clearTimeout(this.timer),this.logout(1),this.timer=setTimeout((()=>{this.logout(0)}),1e3)}changeOpacityOnEvent(t){clearTimeout(this.timer),this.logout(1),t.stopPropagation()}async changeSubtitlesLang(t){if(c.A.log("[onchange] subtitles",t),this.votSubtitlesSelect.setSelected(t),"disabled"===t)this.votSubtitlesSelect.setTitle(p.get("VOTSubtitlesDisabled")),this.subtitlesWidget.setContent(null),this.votDownloadSubtitlesButton.hidden=!0,this.downloadSubtitlesUrl=null;else{const e=await wt(this.subtitlesList.at(parseInt(t)));this.subtitlesWidget.setContent(e),this.votDownloadSubtitlesButton.hidden=!1,this.downloadSubtitlesUrl=this.subtitlesList.at(parseInt(t))?.url}}async updateSubtitlesLangSelect(){const t=[{label:p.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1},...this.subtitlesList.map(((t,e)=>({label:(p.get("langs")[t.language]??t.language.toUpperCase())+(t.translatedFromLanguage?` ${p.get("VOTTranslatedFrom")} ${p.get("langs")[t.translatedFromLanguage]??t.translatedFromLanguage.toUpperCase()}`:"")+("yandex"!==t.source?` ${t.source}`:"")+(t.isAutoGenerated?` (${p.get("VOTAutogenerated")})`:""),value:e,selected:!1,disabled:!1})))];this.votSubtitlesSelect.updateItems(t),await this.changeSubtitlesLang(t[0].value)}async updateSubtitles(){if(await this.changeSubtitlesLang("disabled"),!this.videoData.videoId)return console.error(`[VOT] ${p.getDefault("VOTNoVideoIDFound")}`),this.subtitlesList=[],this.subtitlesListVideoId=null,void await this.updateSubtitlesLangSelect();this.subtitlesListVideoId!==this.videoData.videoId&&(this.subtitlesList=await async function(t,e,o){const n="youtube"===t.host?U.getSubtitles():[];let a=!1;const i=[...await Promise.race([new Promise((t=>{setTimeout((()=>{a||(console.error("[VOT] Failed get yandex subtitles. Reason: timeout"),t([]))}),5e3)})),new Promise((n=>{bt(`${t.url}${e}`,o,((t,e)=>{c.A.log("[exec callback] Requesting video subtitles"),t||(console.error("[VOT] Failed get yandex subtitles"),a=!0,n([]));const o=ct.decodeSubtitlesResponse(e);console.log("[VOT] Subtitles response: ",o);let i=o.subtitles??[];i=i.reduce(((t,e)=>(e.language&&!t.find((t=>{if("yandex"===t.source&&t.language===e.language&&!t.translatedFromLanguage)return t}))&&t.push({source:"yandex",language:e.language,url:e.url}),e.translatedLanguage&&t.push({source:"yandex",language:e.translatedLanguage,translatedFromLanguage:e.language,url:e.translatedUrl}),t)),[]),a=!0,n(i)}))}))]),...n].sort(((t,e)=>{if(t.source!==e.source)return"yandex"===t.source?-1:1;if(t.language!==e.language&&(t.language===G||e.language===G))return t.language===G?-1:1;if("yandex"===t.source){if(t.translatedFromLanguage!==e.translatedFromLanguage)return t.translatedFromLanguage&&e.translatedFromLanguage?t.translatedFromLanguage===o?-1:1:t.language===e.language?t.translatedFromLanguage?1:-1:t.translatedFromLanguage?-1:1;if(!t.translatedFromLanguage)return t.language===o?-1:1}return"youtube"===t.source&&t.isAutoGenerated!==e.isAutoGenerated?t.isAutoGenerated?1:-1:0}));return console.log("[VOT] subtitles list",i),i}(this.site,this.videoData.videoId,this.videoData.detectedLanguage),this.subtitlesList?this.subtitlesListVideoId=this.videoData.videoId:await this.changeSubtitlesLang("disabled"),await this.updateSubtitlesLangSelect())}getVideoVolume(){let t=this.video?.volume;return["youtube","googledrive"].includes(this.site.host)&&(t=U.getVideoVolume()||t),t}setVideoVolume(t){if(["youtube","googledrive"].includes(this.site.host)){if(U.setVideoVolume(t))return}this.video.volume=t}syncVideoVolumeSlider(){const t=Math.round(100*this.getVideoVolume());this.votVideoVolumeSlider.input.value=t,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${t}%`,B.updateSlider(this.votVideoVolumeSlider.input),1===this.data.syncVolume&&(this.tempOriginalVolume=Number(t))}setSelectMenuValues(t,e){this.votTranslationLanguageSelect.fromSelect.setTitle(p.get("langs")[t]),this.votTranslationLanguageSelect.toSelect.setTitle(p.get("langs")[e]),this.votTranslationLanguageSelect.fromSelect.setSelected(t),this.votTranslationLanguageSelect.toSelect.setSelected(e),console.log(`[VOT] Set translation from ${t} to ${e}`),this.videoData.detectedLanguage=t,this.videoData.responseLanguage=e}syncTranslationWithVideo(t){const e=Number(this.votVideoVolumeSlider.input.value),o=Q(this.video,t,e,this.tempVolume);this.votVideoVolumeSlider.input.value=o,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${o}%`,B.updateSlider(this.votVideoVolumeSlider.input),this.tempOriginalVolume=o,this.tempVolume=t}async getVideoData(){const t={translationHelp:null,isStream:!1,duration:this.video?.duration||343,videoId:Y(this.site.host,this.video),detectedLanguage:this.translateFromLang,responseLanguage:this.translateToLang};if(!t.videoId)return this.ytData={},t;if(window.location.hostname.includes("youtube.com"))this.ytData=await U.getVideoData(),t.isStream=this.ytData.isLive,""!==this.ytData.author&&(t.detectedLanguage=this.ytData.detectedLanguage,t.responseLanguage=this.translateToLang);else if(window.location.hostname.includes("rutube")||window.location.hostname.includes("ok.ru")||window.location.hostname.includes("my.mail.ru"))t.detectedLanguage="ru";else if(["bilibili","youku"].includes(this.site.host))t.detectedLanguage="zh";else if(["vk"].includes(this.site.host)){const e=document.getElementsByTagName("track")?.[0]?.srclang;t.detectedLanguage=e||"auto"}else if(window.location.hostname.includes("coursera.org")){const e=await Vt.getVideoData(this.translateToLang);t.duration=e.duration||t.duration,t.detectedLanguage=e.detectedLanguage,t.translationHelp=e.translationHelp}else if(window.location.hostname.includes("coursehunter.net")){const e=await St.getVideoData();t.translationHelp={url:e.url},t.duration=e.duration||t.duration}else if(window.location.hostname.includes("banned.video")){const e=await Ft.getVideoData(t.videoId);t.translationHelp={url:e.url},t.duration=e.duration||t.duration,t.isStream=e.live}else if(window.location.hostname.includes("weverse.io")){const e=await It.getVideoData();t.detectedLanguage="ko",e&&(t.translationHelp={url:e.url},t.duration=e.duration||t.duration)}else if(window.location.hostname.includes("udemy.com")){const e=await Bt.getVideoData(this.data.udemyData,this.translateToLang);t.duration=e.duration||t.duration,t.detectedLanguage=e.detectedLanguage,t.translationHelp=e.translationHelp}else["piped","invidious","bitchute","rumble","peertube","dailymotion","trovo","yandexdisk","coursehunter"].includes(this.site.host)&&(t.detectedLanguage="auto");return t}videoValidator(){if(["youtube","ok.ru","vk"].includes(this.site.host)){if(c.A.log("VideoValidator videoData: ",this.videoData),1===this.data.dontTranslateYourLang&&this.videoData.detectedLanguage===this.data.dontTranslateLanguage&&this.videoData.responseLanguage===this.data.dontTranslateLanguage)throw new F("VOTDisableFromYourLang");if(!this.videoData.isStream&&this.videoData.duration>14400)throw new F("VOTVideoIsTooLong")}return!0}lipSync(t=!1){if(c.A.log("lipsync video",this.video),this.video)if(this.audio.currentTime=this.video.currentTime,this.audio.playbackRate=this.video.playbackRate,t)if("play"!=t)["pause","stop","waiting"].includes(t)&&(c.A.log(`lipsync mode is ${t}`),this.audio.pause()),"playing"==t&&(c.A.log("lipsync mode is playing"),this.audio.play()),"emptied"==t&&(c.A.log("lipsync mode is emptied"),this.stopTranslation());else{c.A.log("lipsync mode is play");const t=this.audio.play();void 0!==t&&t.catch((t=>{if(console.error("[VOT]",t),"NotAllowedError"===t.name)throw this.transformBtn("error",p.get("grantPermissionToAutoPlay")),new F("grantPermissionToAutoPlay");if("NotSupportedError"===t.name)throw this.transformBtn("error",Ut.includes(window.location.hostname)?p.get("neededAdditionalExtension"):p.get("audioFormatNotSupported")),Ut.includes(window.location.hostname)?new F("neededAdditionalExtension"):new F("audioFormatNotSupported")}))}else c.A.log("lipsync mode is not set")}handleVideoEvent(t){c.A.log(`video ${t.type}`),this.lipSync(t.type)}stopTranslate(){Wt.forEach((t=>this.video.removeEventListener(t,this.handleVideoEventBound))),this.audio.pause(),this.audio.src="",this.audio.removeAttribute("src"),this.votVideoVolumeSlider.container.hidden=!0,this.votVideoTranslationVolumeSlider.container.hidden=!0,this.votDownloadButton.hidden=!0,this.downloadTranslationUrl=null,this.transformBtn("none",p.get("translateVideo")),c.A.log(`Volume on start: ${this.volumeOnStart}`),this.volumeOnStart&&this.setVideoVolume(this.volumeOnStart),this.volumeOnStart="",clearInterval(this.streamPing),this.hls?.destroy(),this.hls=J()}async translateExecutor(t){c.A.log("Run translateFunc"),this.translateFunc(t,this.videoData.isStream,this.videoData.detectedLanguage,this.videoData.responseLanguage,this.videoData.translationHelp)}async updateTranslationErrorMsg(t){const e=p.get("translationTake"),o=p.get("VOTTranslatingError"),n=p.lang;if("VOTLocalizedError"===t?.name)this.transformBtn("error",t.localizedMessage);else if(1!==this.data.translateAPIErrors||t.includes(e)||"ru"===n)this.transformBtn("error",t);else{const e=await async function(t,e="",o="ru"){if("yandex"===await u.d.get("translationService",i.mE)){const n=e&&o?`${e}-${o}`:o;return await R.translate(t,n)}return t}(t,"ru",n);this.transformBtn("error",o),this.transformBtn("error",e)}}afterUpdateTranslation(t){this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,1===this.data.autoSetVolumeYandexStyle&&(this.votVideoVolumeSlider.input.value=100*this.data.autoVolume,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=100*this.data.autoVolume+"%",B.updateSlider(this.votVideoVolumeSlider.input)),this.votDownloadButton.hidden=!1,this.downloadTranslationUrl=t}updateTranslation(t){if(this.audio.src=t,1===this.data.audioProxy&&t.startsWith("https://vtrans.s3-private.mds.yandex.net/tts/prod/")){const e=t.replace("https://vtrans.s3-private.mds.yandex.net/tts/prod/",""),o=`https://${this.data.proxyWorkerHost}/video-translation/audio-proxy/${e}`;console.log(`[VOT] Audio proxied via ${o}`),this.audio.src=o}if(this.volumeOnStart=this.getVideoVolume(),"number"==typeof this.data.defaultVolume&&(this.audio.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume),"twitter"===this.site.host)document.querySelector('div[data-testid="app-bar-back"][role="button"]').addEventListener("click",this.stopTranslationBound);this.video&&!this.video.paused&&this.lipSync("play"),Wt.forEach((t=>this.video.addEventListener(t,this.handleVideoEventBound))),this.transformBtn("success",p.get("disableTranslate")),this.afterUpdateTranslation(t)}translateFunc(t,e,o,n,a){console.log("[VOT] Video Data: ",this.videoData);const i=a?.url?a.url:`${this.site.url}${t}`;if(c.A.log("Run videoValidator"),this.videoValidator(),e)return c.A.log("Executed stream translation"),void function(t,e,o,n){c.A.log(`Translate stream (url: ${t}, requestLang: ${e}, responseLang: ${o})`),vt(t,e,o,((t,e)=>{if(c.A.log("[exec callback] Requesting stream translation"),!t)return void n(!1,p.get("requestTranslationFailed"));const o=ct.decodeStreamResponse(e);switch(console.log("[VOT] Stream Translation response: ",o),o.interval){case 10:n(!1,o.interval,p.get("translationTakeFewMinutes"));break;case 20:n(!0,o.interval,o||p.get("audioNotReceived"));break;case 0:n(!1,o.interval,p.get("streamNoConnectionToServer"))}}))}(i,o,n,(async(i,r,s)=>{if(c.A.log("[exec callback] translateStream callback"),Y(this.site.host,this.video)!==t)return;if(!i||!s.translatedInfo)return await this.updateTranslationErrorMsg(s),void(10===r&&(clearTimeout(this.autoRetry),this.autoRetry=setTimeout((()=>this.translateFunc(t,e,o,n,a)),1e3*r)));this.transformBtn("success",p.get("disableTranslate")),console.log(s);const l=s.pingId;c.A.log(`Stream pingId: ${l}`),this.streamPing=setInterval((async()=>await gt(l,(t=>c.A.log("Stream ping result: ",t)))),1e3*r),c.A.log(s.translatedInfo.url);const d=`https://${this.data.m3u8ProxyHost}/?all=yes&origin=${encodeURIComponent("https://strm.yandex.ru")}&referer=${encodeURIComponent("https://strm.yandex.ru")}&url=${encodeURIComponent(s.translatedInfo.url)}`;if(c.A.log(d),this.hls)this.hls.on(Hls.Events.MEDIA_ATTACHED,(function(){c.A.log("audio and hls.js are now bound together !")})),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(t){c.A.log("manifest loaded, found "+t?.levels?.length+" quality level")})),this.hls.loadSource(d),this.hls.attachMedia(this.audio),this.hls.on(Hls.Events.ERROR,(function(t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),this.hls.recoverMediaError();break;case Hls.ErrorTypes.NETWORK_ERROR:console.error("fatal network error encountered",t);break;default:this.hls.destroy()}})),c.A.log(this.hls);else{if(!this.audio.canPlayType("application/vnd.apple.mpegurl"))throw new F("audioFormatNotSupported");this.audio.src=d}"youtube"===this.site.host&&U.videoSeek(this.video,10),this.volumeOnStart=this.getVideoVolume(),"number"==typeof this.data.defaultVolume&&(this.audio.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume),this.video.src||this.video.currentSrc||this.video.srcObject?(this.video&&!this.video.paused&&this.lipSync("play"),Wt.forEach((t=>this.video.addEventListener(t,this.handleVideoEventBound))),this.afterUpdateTranslation(d)):this.stopTranslation()}));if(["udemy","coursera"].includes(this.site.host)&&!a)throw new F("VOTTranslationHelpNull");const r=this.videoTranslations.find((e=>e.videoId===t&&e.expires>Date.now()/1e3&&e.from===o&&e.to===n));if(r)return this.updateTranslation(r.url),void c.A.log("[translateFunc] A cached translate was received");Zt(i,this.videoData.duration,o,n,a,(async(i,r)=>{if(c.A.log("[exec callback] translateVideo callback"),Y(this.site.host,this.video)===t){if(!i)return await this.updateTranslationErrorMsg(r),r.includes(p.get("translationTake"))&&(clearTimeout(this.autoRetry),this.autoRetry=setTimeout((()=>this.translateFunc(t,e,o,n,a)),6e4)),void console.error("[VOT]",r);this.updateTranslation(r),this.videoTranslations.push({videoId:t,from:o,to:n,url:r,expires:Date.now()/1e3+this.videoTranslationTTL})}}))}stopTranslation(){this.stopTranslate(),this.syncVideoVolumeSlider()}async handleSrcChanged(){c.A.log("[VideoHandler] src changed",this),this.stopTranslation(),this.firstPlay=!0,this.videoData=await this.getVideoData(),this.videoData.detectedLanguage&&this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage);const t=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject||!this.videoData.videoId;this.votButton.container.hidden=t,t&&(this.votMenu.container.hidden=t),this.site.selector||(this.container=this.video.parentElement),this.container.contains(this.votButton.container)||(this.container.appendChild(this.votButton.container),this.container.appendChild(this.votMenu.container)),await this.updateSubtitles(),await this.changeSubtitlesLang("disabled"),this.translateToLang=this.data.responseLanguage??"ru"}async release(){c.A.log("[VideoHandler] release"),this.initialized=!1,this.stopTranslation(),this.releaseExtraEvents(),this.subtitlesWidget.release(),this.votButton.container.remove(),this.votMenu.container.remove()}}const Jt=new class{constructor(){this.onVideoAdded=new Nt,this.onVideoRemoved=new Nt,this.handleVideoAddedBound=this.handleVideoAdded.bind(this),this.handleVideoRemovedBound=this.handleVideoRemoved.bind(this),this.observer=new MutationObserver((t=>{window.requestIdleCallback((()=>{t.forEach((t=>{"childList"===t.type&&(Ht(t.addedNodes).forEach(this.handleVideoAddedBound),Ht(t.removedNodes).forEach(this.handleVideoRemovedBound))}))}),{timeout:1e3})}))}enable(){this.observer.observe(document,{childList:!0,subtree:!0}),document.querySelectorAll("video").forEach(this.handleVideoAddedBound)}disable(){this.observer.disconnect()}handleVideoAdded(t){this.onVideoAdded.dispatch(t)}handleVideoRemoved(t){document.contains(t)||this.onVideoRemoved.dispatch(t)}},Qt=new WeakMap;(async function(){c.A.log("Loading extension..."),await p.update(),c.A.log(`Selected menu language: ${p.lang}`),c.A.log("Extension compatibility passed..."),Jt.onVideoAdded.addListener((t=>{for(const e of $t.filter((t=>{const e=t=>t instanceof RegExp&&t.test(window.location.hostname)||"string"==typeof t&&window.location.hostname.includes(t)||"function"==typeof t&&t(new URL(window.location));return!!(e(t.match)||t.match instanceof Array&&t.match.some((t=>e(t))))&&t.host&&t.url}))){if(!e)continue;let o;if(e.shadowRoot)o=e.selector?Object.values(document.querySelectorAll(e.selector)).find((e=>e.shadowRoot.contains(t))):t.parentElement,o=o&&o.shadowRoot?o.parentElement:o;else{const n=jt.browser.version.split(".")?.[0];if(e.selector?.includes(":not")&&e.selector?.includes("*")&&n&&("Chrome"===jt.browser.name&&Number(n)<88||"Firefox"===jt.browser.name&&Number(n)<84)){const n=e.selector?.split(" *")?.[0];o=n?Object.values(document.querySelectorAll(n)).find((e=>e.contains(t))):t.parentElement}else o=e.selector?Object.values(document.querySelectorAll(e.selector)).find((e=>e.contains(t))):t.parentElement}if(o&&!("rumble"===e.host&&o.querySelector("vot-block")||("peertube"===e.host&&(e.url=window.location.origin),Qt.has(t)))){Qt.set(t,new Kt(t,o,e));break}}})),Jt.onVideoRemoved.addListener((async t=>{Qt.has(t)&&(await Qt.get(t).release(),Qt.delete(t))})),Jt.enable()})().catch((t=>{console.error("[VOT]",t)}))})()})(); \ No newline at end of file diff --git a/dist/vot-cloudflare.user.js b/dist/vot-cloudflare.user.js index c447f102..d5ca789d 100644 --- a/dist/vot-cloudflare.user.js +++ b/dist/vot-cloudflare.user.js @@ -5442,23 +5442,16 @@ class VideoHandler { this.container.draggable = false; } - addExtraEventListener(this.video, "emptied", () => { - debug/* default */.A.log("lipsync mode is emptied"); - this.stopTranslation(); - }); - addExtraEventListener(this.video, "progress", async () => { if ( - !(this.firstPlay && this.data.autoTranslate === 1) || + !this.videoData.videoId || + !this.firstPlay || + this.data.autoTranslate !== 1 || getVideoId(this.site.host, this.video) !== this.videoData.videoId ) { return; } - if (!this.videoData.videoId) { - throw new VOTLocalizedError("VOTNoVideoIDFound"); - } - try { this.firstPlay = false; await this.translateExecutor(this.videoData.videoId); @@ -5814,6 +5807,10 @@ class VideoHandler { debug/* default */.A.log("lipsync mode is playing"); this.audio.play(); } + if (mode == "emptied") { + debug/* default */.A.log("lipsync mode is emptied"); + this.stopTranslation(); + } } // Define a function to handle common events @@ -6187,7 +6184,8 @@ class VideoHandler { } const hide = - !this.video.src && !this.video.currentSrc && !this.video.srcObject; + (!this.video.src && !this.video.currentSrc && !this.video.srcObject) || + !this.videoData.videoId; this.votButton.container.hidden = hide; hide && (this.votMenu.container.hidden = hide); diff --git a/dist/vot-min.user.js b/dist/vot-min.user.js index 1a91780f..ac3d9b51 100644 --- a/dist/vot-min.user.js +++ b/dist/vot-min.user.js @@ -128,4 +128,4 @@ // @supportURL https://github.com/ilyhalight/voice-over-translation/issues // ==/UserScript== -(()=>{var t={"./node_modules/bowser/es5.js":function(t){t.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(n,a,function(e){return t[e]}.bind(null,a));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=90)}({17:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n=o(18),a=function(){function t(){}return t.getFirstMatch=function(t,e){var o=e.match(t);return o&&o.length>0&&o[1]||""},t.getSecondMatch=function(t,e){var o=e.match(t);return o&&o.length>1&&o[2]||""},t.matchAndReturnConst=function(t,e,o){if(t.test(e))return o},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,o,n){void 0===n&&(n=!1);var a=t.getVersionPrecision(e),i=t.getVersionPrecision(o),r=Math.max(a,i),s=0,l=t.map([e,o],(function(e){var o=r-t.getVersionPrecision(e),n=e+new Array(o+1).join(".0");return t.map(n.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(n&&(s=r-Math.min(a,i)),r-=1;r>=s;){if(l[0][r]>l[1][r])return 1;if(l[0][r]===l[1][r]){if(r===s)return 0;r-=1}else if(l[0][r]1?a-1:0),r=1;r0){var r=Object.keys(o),l=s.default.find(r,(function(t){return e.isOS(t)}));if(l){var d=this.satisfies(o[l]);if(void 0!==d)return d}var c=s.default.find(r,(function(t){return e.isPlatform(t)}));if(c){var u=this.satisfies(o[c]);if(void 0!==u)return u}}if(i>0){var h=Object.keys(a),p=s.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==p)return this.compareVersion(a[p])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var o=this.getBrowserName().toLowerCase(),n=t.toLowerCase(),a=s.default.getBrowserTypeByAlias(n);return e&&a&&(n=a.toLowerCase()),n===o},e.compareVersion=function(t){var e=[0],o=t,n=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===t[0]||"<"===t[0]?(o=t.substr(1),"="===t[1]?(n=!0,o=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?o=t.substr(1):"~"===t[0]&&(n=!0,o=t.substr(1)),e.indexOf(s.default.compareVersions(a,o,n))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=d,t.exports=e.default},92:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},o=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},o=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},o=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},o=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},o=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},o=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},o=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},o=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},o=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},o=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},o=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},o=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return o&&(e.version=o),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},o=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},o=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},o=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},o=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},o=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},o=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},o=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},o=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},o=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},o=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},o=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},o=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e={name:"Android Browser"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(e,t),version:a.default.getSecondMatch(e,t)}}}];e.default=r,t.exports=e.default},93:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:[/Roku\/DVP/],describe:function(t){var e=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:i.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),o=a.default.getWindowsVersionName(e);return{name:i.OS_MAP.Windows,version:e,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:i.OS_MAP.iOS},o=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return o&&(e.version=o),e}},{test:[/macintosh/i],describe:function(t){var e=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),o=a.default.getMacOSVersionName(e),n={name:i.OS_MAP.MacOS,version:e};return o&&(n.versionName=o),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),o=a.default.getAndroidVersionName(e),n={name:i.OS_MAP.Android,version:e};return o&&(n.versionName=o),n}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),o={name:i.OS_MAP.WebOS};return e&&e.length&&(o.version=e),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||a.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:i.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.PlayStation4,version:e}}}];e.default=r,t.exports=e.default},94:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=a.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",o={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(o.model=e),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),o=t.test(/like (ipod|iphone)/i);return e&&!o},describe:function(t){var e=a.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];e.default=r,t.exports=e.default},95:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:i.ENGINE_MAP.Blink};var e=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:i.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:i.ENGINE_MAP.Trident},o=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:i.ENGINE_MAP.Presto},o=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=t.test(/gecko/i),o=t.test(/like gecko/i);return e&&!o},describe:function(t){var e={name:i.ENGINE_MAP.Gecko},o=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:i.ENGINE_MAP.WebKit},o=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}}];e.default=r,t.exports=e.default}})},"./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/main.scss":(t,e,o)=>{"use strict";o.d(e,{A:()=>s});var n=o("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),a=o.n(n),i=o("./node_modules/css-loader/dist/runtime/api.js"),r=o.n(i)()(a());r.push([t.id,'.vot-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );--vot-helper-ontheme: var( --vot-ontheme-rgb, var(--vot-onprimary-rgb, 255, 255, 255) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;border-radius:4px;padding:0 16px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-ontheme));background-color:rgb(var(--vot-helper-theme));box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer;transition:box-shadow .2s}.vot-button[hidden]{display:none !important}.vot-button::-moz-focus-inner{border:none}.vot-button::before,.vot-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-button::before{background-color:rgb(var(--vot-helper-ontheme));transition:opacity .2s}.vot-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-button:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.vot-button:hover::before{opacity:.08}.vot-button:active{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.vot-button:active::after{opacity:.32;background-size:100% 100%;transition:background-size 0s}.vot-button:disabled{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.12);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);box-shadow:none;cursor:initial}.vot-button:disabled::before,.vot-button:disabled::after{opacity:0}.vot-outlined-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:solid 1px;border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.24);border-radius:4px;padding:0 16px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:34px;outline:none;cursor:pointer}.vot-outlined-button[hidden]{display:none !important}.vot-outlined-button::-moz-focus-inner{border:none}.vot-outlined-button::before,.vot-outlined-button::after{content:"";position:absolute;border-radius:3px;top:0;right:0;bottom:0;left:0;opacity:0}.vot-outlined-button::before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-outlined-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-outlined-button:hover::before{opacity:.04}.vot-outlined-button:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-outlined-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-outlined-button:disabled::before,.vot-outlined-button:disabled::after{opacity:0}.vot-text-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none;border-radius:4px;padding:0 8px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer}.vot-text-button[hidden]{display:none !important}.vot-text-button::-moz-focus-inner{border:none}.vot-text-button::before,.vot-text-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-text-button::before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-text-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-text-button:hover::before{opacity:.04}.vot-text-button:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-text-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-text-button:disabled::before,.vot-text-button:disabled::after{opacity:0}.vot-icon-button{--vot-helper-onsurface: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87);position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none;border-radius:50%;padding:0;width:36px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;fill:var(--vot-helper-onsurface);color:var(--vot-helper-onsurface);background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer}.vot-icon-button[hidden]{display:none !important}.vot-icon-button::-moz-focus-inner{border:none}.vot-icon-button::before,.vot-icon-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-icon-button::before{background-color:var(--vot-helper-onsurface);transition:opacity .2s}.vot-icon-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity .3s,background-size .4s}.vot-icon-button:hover::before{opacity:.04}.vot-icon-button:active::after{opacity:.32;background-size:100% 100%;transition:background-size 0s,opacity 0s}.vot-icon-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);fill:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-icon-button:disabled::before,.vot-icon-button:disabled::after{opacity:0}.vot-textfield{--vot-helper-theme: rgb( var(--vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243)) ) !important;--vot-helper-safari1: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.38 ) !important;--vot-helper-safari2: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;--vot-helper-safari3: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.87 ) !important;position:relative !important;display:inline-block;padding-top:6px !important;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system) !important;font-size:16px !important;line-height:1.5 !important;text-align:start !important}.vot-textfield[hidden]{display:none !important}.vot-textfield>input,.vot-textfield>textarea{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin:0 !important;border-style:solid !important;border-width:1px !important;border-color:rgba(0,0,0,0) var(--vot-helper-safari2) var(--vot-helper-safari2) !important;border-radius:4px !important;padding:15px 13px 15px !important;width:100% !important;height:inherit !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important;-webkit-text-fill-color:currentColor !important;background-color:rgba(0,0,0,0) !important;box-shadow:inset 1px 0 rgba(0,0,0,0),inset -1px 0 rgba(0,0,0,0),inset 0 -1px rgba(0,0,0,0) !important;font-family:inherit !important;font-size:inherit !important;line-height:inherit !important;caret-color:var(--vot-helper-theme) !important;transition:border .2s,box-shadow .2s !important}.vot-textfield>input:not(:focus):placeholder-shown,.vot-textfield>textarea:not(:focus):placeholder-shown{border-top-color:var(--vot-helper-safari2) !important}.vot-textfield>input+span,.vot-textfield>textarea+span{position:absolute !important;top:0 !important;left:0 !important;display:flex !important;width:100% !important;max-height:100% !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;font-size:75% !important;line-height:15px !important;cursor:text !important;transition:color .2s,font-size .2s,line-height .2s !important;pointer-events:none !important}.vot-textfield>input:not(:focus):placeholder-shown+span,.vot-textfield>textarea:not(:focus):placeholder-shown+span{font-size:inherit !important;line-height:68px !important}.vot-textfield>input+span::before,.vot-textfield>input+span::after,.vot-textfield>textarea+span::before,.vot-textfield>textarea+span::after{content:"" !important;display:block !important;-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin-top:6px !important;border-top:solid 1px var(--vot-helper-safari2) !important;min-width:10px !important;height:8px !important;pointer-events:none !important;box-shadow:inset 0 1px rgba(0,0,0,0) !important;transition:border .2s,box-shadow .2s !important}.vot-textfield>input+span::before,.vot-textfield>textarea+span::before{margin-right:4px !important;border-left:solid 1px rgba(0,0,0,0) !important;border-radius:4px 0 !important}.vot-textfield>input+span::after,.vot-textfield>textarea+span::after{flex-grow:1 !important;margin-left:4px !important;border-right:solid 1px rgba(0,0,0,0) !important;border-radius:0 4px !important}.vot-textfield>input:not(:focus):placeholder-shown+span::before,.vot-textfield>input:not(:focus):placeholder-shown+span::after,.vot-textfield>textarea:not(:focus):placeholder-shown+span::before,.vot-textfield>textarea:not(:focus):placeholder-shown+span::after{border-top-color:rgba(0,0,0,0) !important}.vot-textfield:hover>input,.vot-textfield:hover>textarea{border-color:rgba(0,0,0,0) var(--vot-helper-safari3) var(--vot-helper-safari3) !important}.vot-textfield:hover>input+span::before,.vot-textfield:hover>input+span::after,.vot-textfield:hover>textarea+span::before,.vot-textfield:hover>textarea+span::after{border-top-color:var(--vot-helper-safari3) !important}.vot-textfield:hover>input:not(:focus):placeholder-shown,.vot-textfield:hover>textarea:not(:focus):placeholder-shown{border-color:var(--vot-helper-safari3) !important}.vot-textfield>input:focus,.vot-textfield>textarea:focus{border-color:rgba(0,0,0,0) var(--vot-helper-theme) var(--vot-helper-theme) !important;box-shadow:inset 1px 0 var(--vot-helper-theme),inset -1px 0 var(--vot-helper-theme),inset 0 -1px var(--vot-helper-theme) !important;outline:none !important}.vot-textfield>input:focus+span,.vot-textfield>textarea:focus+span{color:var(--vot-helper-theme) !important}.vot-textfield>input:focus+span::before,.vot-textfield>input:focus+span::after,.vot-textfield>textarea:focus+span::before,.vot-textfield>textarea:focus+span::after{border-top-color:var(--vot-helper-theme) !important;box-shadow:inset 0 1px var(--vot-helper-theme) !important}.vot-textfield>input:disabled,.vot-textfield>input:disabled+span,.vot-textfield>textarea:disabled,.vot-textfield>textarea:disabled+span{border-color:rgba(0,0,0,0) var(--vot-helper-safari1) var(--vot-helper-safari1) !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important;pointer-events:none !important}.vot-textfield>input:disabled+span::before,.vot-textfield>input:disabled+span::after,.vot-textfield>textarea:disabled+span::before,.vot-textfield>textarea:disabled+span::after{border-top-color:var(--vot-helper-safari1) !important}.vot-textfield>input:disabled:placeholder-shown,.vot-textfield>input:disabled:placeholder-shown+span,.vot-textfield>textarea:disabled:placeholder-shown,.vot-textfield>textarea:disabled:placeholder-shown+span{border-top-color:var(--vot-helper-safari1) !important}.vot-textfield>input:disabled:placeholder-shown+span::before,.vot-textfield>input:disabled:placeholder-shown+span::after,.vot-textfield>textarea:disabled:placeholder-shown+span::before,.vot-textfield>textarea:disabled:placeholder-shown+span::after{border-top-color:rgba(0,0,0,0) !important}@media not all and (min-resolution: 0.001dpcm){@supports(-webkit-appearance: none){.vot-textfield>input,.vot-textfield>input+span,.vot-textfield>textarea,.vot-textfield>textarea+span,.vot-textfield>input+span::before,.vot-textfield>input+span::after,.vot-textfield>textarea+span::before,.vot-textfield>textarea+span::after{transition-duration:.1s !important}}}.vot-checkbox{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );--vot-helper-ontheme: var( --vot-ontheme-rgb, var(--vot-onprimary-rgb, 255, 255, 255) );z-index:0;position:relative;display:inline-block;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;text-align:start}.vot-checkbox[hidden]{display:none !important}.vot-checkbox>input{appearance:none;-moz-appearance:none;-webkit-appearance:none;z-index:1;position:absolute;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:3px 1px;border:solid 2px;background:rgba(0,0,0,0);border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6);border-radius:2px;width:18px;height:18px;outline:none;cursor:pointer;transition:border-color .2s,background-color .2s}.vot-checkbox>input+span{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding-left:30px;width:inherit;cursor:pointer}.vot-checkbox>input+span::before{content:"";position:absolute;left:-10px;top:-8px;display:block;border-radius:50%;width:40px;height:40px;background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0));opacity:0;transform:scale(1);pointer-events:none;transition:opacity .3s,transform .2s}.vot-checkbox>input+span::after{content:"";z-index:1;display:block;position:absolute;top:3px;left:1px;-webkit-box-sizing:content-box !important;-moz-box-sizing:content-box !important;box-sizing:content-box !important;width:10px;height:5px;border:solid 2px rgba(0,0,0,0);border-right-width:0;border-top-width:0;pointer-events:none;transform:translate(3px, 4px) rotate(-45deg);transition:border-color .2s}.vot-checkbox>input:checked,.vot-checkbox>input:indeterminate{border-color:rgb(var(--vot-helper-theme));background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span::before,.vot-checkbox>input:indeterminate+span::before{background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span::after,.vot-checkbox>input:indeterminate+span::after{border-color:rgb(var(--vot-helper-ontheme, 255, 255, 255))}.vot-checkbox>input:indeterminate+span::after{border-left-width:0;transform:translate(4px, 3px)}.vot-checkbox:hover>input+span::before{opacity:.04}.vot-checkbox:active>input,.vot-checkbox:active:hover>input{border-color:rgb(var(--vot-helper-theme))}.vot-checkbox:active>input:checked{border-color:rgba(0,0,0,0);background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6)}.vot-checkbox:active>input+span::before{opacity:1;transform:scale(0);transition:transform 0s,opacity 0s}.vot-checkbox>input:disabled{border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-checkbox>input:disabled:checked,.vot-checkbox>input:disabled:indeterminate{border-color:rgba(0,0,0,0);background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38)}.vot-checkbox>input:disabled+span{color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-checkbox>input:disabled+span::before{opacity:0;transform:scale(0)}.vot-slider{--vot-safari-helper1: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.04 ) !important;--vot-safari-helper2: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.12 ) !important;--vot-safari-helper3: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.16 ) !important;--vot-safari-helper4: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.24 ) !important;display:inline-block;width:100% !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important;font-family:var(--vot-font, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system) !important;font-size:16px !important;line-height:1.5 !important;text-align:start !important}.vot-slider[hidden]{display:none !important}.vot-slider>input{-webkit-appearance:none !important;appearance:none !important;position:relative !important;top:24px !important;display:block !important;margin:0 0 -36px !important;width:100% !important;height:36px !important;background-color:rgba(0,0,0,0) !important;cursor:pointer !important}.vot-slider>input:last-child{position:static !important;margin:0 !important}.vot-slider>span{display:inline-block !important;margin-bottom:36px !important}.vot-slider>input:disabled{cursor:default !important;opacity:.38 !important}.vot-slider>input:disabled+span{color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input::-webkit-slider-runnable-track{margin:17px 0 !important;border-radius:1px !important;width:100% !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-webkit-slider-thumb{margin:0 !important;appearance:none !important;-webkit-appearance:none !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider:hover>input::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper1) !important}.vot-slider>input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper4) !important}.vot-slider>input:disabled::-webkit-slider-runnable-track{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-webkit-slider-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;color:rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::-moz-range-track{margin:17px 0 !important;border-radius:1px !important;width:100% !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-moz-range-thumb{appearance:none !important;-moz-appearance:none !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider>input::-moz-range-progress{border-radius:1px !important;height:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-slider:hover>input:hover::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.04) !important}.vot-slider>input:active::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input:disabled::-moz-range-track{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-moz-range-progress{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important}.vot-slider>input:disabled::-moz-range-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::-moz-focus-outer{border:none !important}.vot-slider>input::-ms-track{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin:17px 0 !important;border:none !important;border-radius:1px !important;padding:0 17px !important;width:100% !important;height:2px !important;background-color:rgba(0,0,0,0) !important}.vot-slider>input::-ms-fill-lower{border-radius:1px !important;height:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-slider>input::-ms-fill-upper{border-radius:1px !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-ms-thumb{appearance:none !important;margin:0 17px !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider:hover>input::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.04) !important}.vot-slider>input:active::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input:disabled::-ms-fill-lower{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-ms-fill-upper{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important;opacity:.38 !important}.vot-slider>input:disabled::-ms-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::before{content:"" !important;display:block !important;position:absolute !important;width:calc(100%*var(--vot-progress, 0)) !important;height:2px !important;top:calc(50% - 1px) !important;background:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-select{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0) !important;--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87) !important;--vot-helper-safari1: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;--vot-helper-safari2: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.87 ) !important;display:flex;align-items:center;justify-content:space-between;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;line-height:1.5;text-align:start;color:var(--vot-helper-theme);fill:var(--vot-helper-theme)}.vot-select[hidden]{display:none !important}.vot-select-label{font-size:16px}.vot-select-outer{display:flex;align-items:center;justify-content:space-between;max-width:120px;width:120px;padding:0 5px;border-style:solid !important;border-width:1px !important;border-color:var(--vot-helper-safari1) !important;border-radius:4px !important;cursor:pointer;transition:border .2s !important}.vot-select-outer:hover{border-color:var(--vot-helper-safari2) !important}.vot-select-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vot-select-arrow-icon{width:20px;height:32px;display:flex;justify-content:center;align-items:center}.vot-select-content-list{display:flex;flex-direction:column}.vot-select-content-list .vot-select-content-item{padding:5px 10px;border-radius:8px;cursor:pointer}.vot-select-content-list .vot-select-content-item:not([inert]):hover{background-color:#2a2c31}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]{color:rgb(var(--vot-primary-rgb, 33, 150, 243));background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.2)}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]:hover{background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.1) !important}.vot-select-content-list .vot-select-content-item[data-vot-disabled=true]{cursor:default}.vot-select-content-list .vot-select-content-item[hidden]{display:none !important}.vot-header{color:rgba(var(--vot-helper-onsurface-rgb), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-weight:bold;line-height:1.5;text-align:start}.vot-header[hidden]{display:none !important}.vot-header:not(:first-child){padding-top:8px}.vot-header-level-1{font-size:2em}.vot-header-level-2{font-size:1.5em}.vot-header-level-3{font-size:1.17em}.vot-header-level-4{font-size:1em}.vot-header-level-5{font-size:.83em}.vot-header-level-6{font-size:.67em}.vot-info{display:flex;color:rgba(var(--vot-helper-onsurface-rgb), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;text-align:start}.vot-info[hidden]{display:none !important}.vot-info>:not(:first-child){color:rgba(var(--vot-helper-onsurface-rgb), 0.5);flex:1;margin-left:8px}.vot-lang-select{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87);display:flex;align-items:center;justify-content:space-between;color:var(--vot-helper-theme);fill:var(--vot-helper-theme)}.vot-lang-select[hidden]{display:none !important}.vot-lang-select-icon{width:32px;height:32px;display:flex;justify-content:center;align-items:center}.vot-segmented-button{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87);overflow:hidden;position:absolute;left:50%;top:5rem;transform:translate(-50%);user-select:none;display:flex;align-items:center;height:32px;max-width:100vw;background:rgb(var(--vot-surface-rgb, 255, 255, 255));color:var(--vot-helper-theme);fill:var(--vot-helper-theme);border-radius:4px;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;cursor:default;transition:opacity .5s;z-index:100}.vot-segmented-button[hidden]{display:none !important}.vot-segmented-button *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-segmented-button .vot-separator{width:1px;height:50%;background:rgba(var(--vot-helper-theme-rgb), 0.1)}.vot-segmented-button .vot-separator[hidden]{display:none !important}.vot-segmented-button .vot-segment,.vot-segmented-button .vot-segment-only-icon{position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;height:100%;padding:0 8px;background-color:rgba(0,0,0,0);color:inherit;transition:background-color 100ms ease-in-out;border:none}.vot-segmented-button .vot-segment[hidden],.vot-segmented-button [hidden].vot-segment-only-icon{display:none !important}.vot-segmented-button .vot-segment::before,.vot-segmented-button .vot-segment-only-icon::before,.vot-segmented-button .vot-segment::after,.vot-segmented-button .vot-segment-only-icon::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-segmented-button .vot-segment::before,.vot-segmented-button .vot-segment-only-icon::before{background-color:rgb(var(--vot-helper-theme-rgb));transition:opacity .2s}.vot-segmented-button .vot-segment::after,.vot-segmented-button .vot-segment-only-icon::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-segmented-button .vot-segment:hover::before,.vot-segmented-button .vot-segment-only-icon:hover::before{opacity:.04}.vot-segmented-button .vot-segment:active::after,.vot-segmented-button .vot-segment-only-icon:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-segmented-button .vot-segment-only-icon{min-width:32px;padding:0}.vot-segmented-button .vot-segment-label{margin-left:8px;white-space:nowrap}.vot-segmented-button[data-status=success] .vot-translate-button{color:rgb(var(--vot-primary-rgb, 33, 150, 243));fill:rgb(var(--vot-primary-rgb, 33, 150, 243))}.vot-segmented-button[data-status=error] .vot-translate-button{color:#f28b82;fill:#f28b82}.vot-segmented-button svg{width:fit-content}.vot-menu{--vot-helper-surface-rgb: var(--vot-surface-rgb, 255, 255, 255);--vot-helper-surface: rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-onsurface: rgba(var(--vot-helper-onsurface-rgb), 0.87);overflow:hidden;position:absolute;left:50%;top:calc(5rem + 32px + 16px);user-select:none;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);border-radius:8px;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;min-width:300px;cursor:default;z-index:100;visibility:visible;opacity:1;transform-origin:top;transform:translate(-50%) scale(1);transition:opacity .3s,transform .1s}.vot-menu *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-menu[hidden]{pointer-events:none;display:block !important;visibility:hidden;opacity:0;transform:translate(-50%) scale(0)}.vot-menu-content-wrapper{display:flex;flex-direction:column;min-height:100px;max-height:calc(var(--vot-container-height, 75vh) - (5rem + 32px + 16px)*2);overflow:auto}.vot-menu-header-container{flex-shrink:0;align-items:flex-start;display:flex;min-height:31px}.vot-menu-header-container:empty{padding:0 0 16px 0}.vot-menu-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-menu-title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:0;text-align:start}.vot-menu-title{flex:1;font-size:16px;line-height:1;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-menu-body-container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto;padding:0 16px;gap:8px;overscroll-behavior:contain;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb), 0.1) var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar,.vot-menu-body-container::-webkit-scrollbar-track{height:12px !important;width:12px !important;background:var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb), 0.1) !important;-webkit-border-radius:1ex !important;border:5px solid var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface) !important}.vot-menu-footer-container{flex-shrink:0;display:flex;justify-content:flex-end;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-menu-footer-container:empty{padding:16px 0 0 0}.vot-dialog-container{visibility:visible;position:absolute;z-index:10000}.vot-dialog-container[hidden]{display:block !important;pointer-events:none;visibility:hidden}.vot-dialog-container *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-dialog-backdrop{background-color:rgba(0,0,0,.6);position:fixed;top:0;right:0;bottom:0;left:0;opacity:1;transition:opacity .3s}[hidden]>.vot-dialog-backdrop{pointer-events:none;opacity:0}.vot-dialog{--vot-helper-surface-rgb: var(--vot-surface-rgb, 255, 255, 255);--vot-helper-surface: rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-onsurface: rgba(var(--vot-helper-onsurface-rgb), 0.87);display:block;position:fixed;top:50%;bottom:50%;max-width:initial;max-height:initial;width:min(var(--vot-dialog-width, 512px),100%);height:fit-content;inset-inline-start:0px;inset-inline-end:0px;inset-block-start:0px;inset-block-end:0px;border-radius:8px;margin:auto;padding:0;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);box-shadow:0 0 16px rgba(0,0,0,.12),0 16px 16px rgba(0,0,0,.24);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;user-select:none;visibility:visible;overflow:auto;overflow-y:hidden;opacity:1;transform-origin:center;transform:scale(1);transition:opacity .3s,transform .1s}[hidden]>.vot-dialog{pointer-events:none;opacity:0;transform:scale(0.5);transition:opacity .1s,transform .2s}.vot-dialog-content-wrapper{display:flex;flex-direction:column;max-height:75vh;overflow:auto}.vot-dialog-header-container{flex-shrink:0;align-items:flex-start;display:flex;min-height:31px}.vot-dialog-header-container:empty{padding:0 0 20px 0}.vot-dialog-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-dialog-title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:0}.vot-dialog-title{flex:1;font-size:115.3846153846%;font-weight:bold;line-height:1;padding-bottom:16px;padding-inline-end:20px;padding-inline-start:20px;padding-top:20px}.vot-dialog-body-container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto;padding:0 20px;gap:16px;overscroll-behavior:contain;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb), 0.1) var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar,.vot-dialog-body-container::-webkit-scrollbar-track{height:12px !important;width:12px !important;background:var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb), 0.1) !important;-webkit-border-radius:1ex !important;border:5px solid var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface) !important}.vot-dialog-footer-container{flex-shrink:0;display:flex;justify-content:flex-end;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-dialog-footer-container:empty{padding:20px 0 0 0}.vot-subtitles-widget{display:flex;justify-content:center;align-items:center;position:absolute;width:50%;max-height:100%;min-height:20%;z-index:100;left:25%;top:75%;pointer-events:none}.vot-subtitles{position:relative;max-width:100%;max-height:100%;width:max-content;background:var(--vot-subtitles-background, rgba(46, 47, 52, 0.8));color:var(--vot-subtitles-color, rgb(227, 227, 227));border-radius:1rem;pointer-events:all;padding:1rem;font-size:2rem;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vot-subtitles .passed{color:var(--vot-subtitles-passed-color, rgb(33, 150, 243))}:root{--vot-font-family: "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system;--vot-primary-rgb: 139, 180, 245;--vot-onprimary-rgb: 32, 33, 36;--vot-surface-rgb: 32, 33, 36;--vot-onsurface-rgb: 227, 227, 227;--vot-subtitles-background: rgba(var(--vot-surface-rgb, 46, 47, 52), 0.8);--vot-subtitles-color: rgb(var(--vot-onsurface-rgb, 227, 227, 227));--vot-subtitles-passed-color: rgb(var(--vot-primary-rgb, 33, 150, 243))}vot-block{display:block}',""]);const s=r},"./node_modules/css-loader/dist/runtime/api.js":t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,a,i){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(n)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),a&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=a):c[4]="".concat(a)),e.push(c))}},e}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":t=>{"use strict";t.exports=function(t){return t[1]}},"./node_modules/requestidlecallback-polyfill/index.js":()=>{window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)},window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":t=>{"use strict";var e=[];function o(t){for(var o=-1,n=0;n{"use strict";var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(t,e,o)=>{"use strict";t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var n="";o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var a=void 0!==o.layer;a&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,a&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}");var i=o.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},"./node_modules/webpack-monkey/lib/node/deps/style-loader-insertStyleElement.js":t=>{t.exports=function(){return function(t){return t.styleTagTransform=function(t,e){e?.remove(),GM_addStyle(t)},document.createElement("style")}.apply(null,arguments)}},"./src/config/config.js":(t,e,o)=>{"use strict";o.d(e,{Cc:()=>s,JD:()=>l,K2:()=>c,Pm:()=>i,QL:()=>u,S7:()=>r,mE:()=>d,rl:()=>n,rw:()=>h,se:()=>a});const n="api.browser.yandex.ru",a="m3u8-proxy.toil.cc",i="vot.toil.cc",r="xtGCyGdTY2Jy6OMEKdTuXev3Twhkamgm",s="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 YaBrowser/23.7.1.1140 Yowser/2.5 Safari/537.36",l=.15,d="yandex",c="yandex",u={yandex:"https://translate.toil.cc/detect",rustServer:"https://rust-server-531j.onrender.com/detect"},h={yandex:"https://translate.toil.cc/translate"}},"./src/utils/debug.js":(t,e,o)=>{"use strict";o.d(e,{A:()=>a});const n={log:(...t)=>{}},a=n},"./src/yandexRequest.js":(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>i});var n=o("./src/config/config.js"),a=o("./src/utils/debug.js");const i=async function(t,e,o,i){try{a.A.log("yandexRequest:",t);const r={url:`https://${n.rl}${t}`,method:"POST",headers:{Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf","User-Agent":n.Cc,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,...o},binary:!0,data:new Blob([e]),responseType:"arraybuffer"};GM_xmlhttpRequest({...r,onload:t=>{a.A.log("yandexRequest:",t.status,t),i(200===t.status,t.response)},onerror:t=>{console.error("[VOT]",t),i(!1)}})}catch(t){console.error("[VOT]",t),i(!1)}}}},e={};function o(n){var a=e[n];if(void 0!==a)return a.exports;var i=e[n]={id:n,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nc=void 0,(()=>{"use strict";const t=["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"],e=["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"],n=["proxitok.pabloferreiro.es","proxitok.pussthecat.org","tok.habedieeh.re","proxitok.esmailelbob.xyz","proxitok.privacydev.net","tok.artemislena.eu","tok.adminforge.de","tik.hostux.net","tt.vern.cc","cringe.whatever.social","proxitok.lunar.icu","proxitok.privacy.com.de"],a=["peertube.1312.media","tube.shanti.cafe","bee-tube.fr","video.sadmin.io","dalek.zone","review.peertube.biz","peervideo.club","tube.la-dina.net","peertube.tmp.rcp.tf"];var i=o("./src/config/config.js");const r=["ru","en","zh","ko","lt","lv","ar","fr","it","es","de","ja"],s=["kk","bn","pt","cs","hi","mr","te","tr","ms","vi","ta","jv","ur","fa","gu","id","uk","da","fi","uz","pl","sv","az","sq","am","hy","af","eu","my","bg","bs","cy","hu","gl","el","zu","kn","ca","km","lo","mk","ml","mt","mn","ne","nl","pa","ro","sr","si","sk","sl","sw","su","hr","et"],l=["ru","en","kk"],d=["Violentmonkey","FireMonkey","Greasemonkey","AdGuard","OrangeMonkey"],c=JSON.parse('{"__version__":3,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","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! {0} 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":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyAccessTokenExpired":"Your entered Udemy Access Token has expired","udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","enterUdemyAccessToken":"Enter Udemy Access Token","VOTUdemyData":"Udemy Data","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings"}');var u=o("./src/utils/debug.js");const h=new class{constructor(){this.gmSupport="function"==typeof GM_getValue,u.A.log(`GM Storage Status: ${this.gmSupport}`)}syncGet(t,e=void 0,o=!1){if(this.gmSupport)return GM_getValue(t,e);let n=window.localStorage.getItem(t);if("udemyData"===t&&"string"==typeof n)try{n=JSON.parse(n)}catch{n=e}return o?Number(n)??Number(e):n??e}async get(t,e=void 0,o=!1){return this.gmSupport?await GM_getValue(t,e):Promise.resolve(this.syncGet(t,e,o))}syncSet(t,e){return this.gmSupport?GM_setValue(t,e):("udemyData"===t&&(e=JSON.stringify(e)),window.localStorage.setItem(t,e))}async set(t,e){return this.gmSupport?await GM_setValue(t,e):Promise.resolve(this.syncSet(t,e))}syncDelete(t){return this.gmSupport?GM_deleteValue(t):window.localStorage.removeItem(t)}async delete(t){return this.gmSupport?await GM_deleteValue(t):Promise.resolve(this.syncDelete(t))}syncList(){return this.gmSupport?GM_listValues():["autoTranslate","dontTranslateLanguage","dontTranslateYourLang","autoSetVolumeYandexStyle","showVideoSlider","syncVolume","subtitlesMaxLength","highlightWords","responseLanguage","defaultVolume","udemyData","audioProxy","showPiPButton","locale-version","locale-lang","locale-phrases"]}async list(){return this.gmSupport?await GM_listValues():Promise.resolve(this.syncList())}},p=["auto","en","ru","af","am","ar","az","bg","bn","bs","ca","cs","cy","da","de","el","es","et","eu","fa","fi","fr","gl","hi","hr","hu","hy","id","it","ja","jv","kk","km","kn","ko","lo","mk","ml","mn","ms","mt","my","ne","nl","pa","pl","pt","ro","si","sk","sl","sq","sr","su","sv","sw","tr","uk","ur","uz","vi","zh","zu"],g=new class{lang="en";locale={};gmValues=["locale-phrases","locale-lang","locale-version","locale-lang-override"];constructor(){const t=h.syncGet("locale-lang-override","auto");this.lang=t&&"auto"!==t?t:(navigator.language||navigator.userLanguage)?.substr(0,2)?.toLowerCase()??"en",this.setLocaleFromJsonString(h.syncGet("locale-phrases",""))}reset(){this.gmValues.forEach((t=>h.syncDelete(t)))}async update(t=!1){(t||2!==await h.get("locale-version",0,!0)||await h.get("locale-lang")!==this.lang)&&(u.A.log("Updating locale..."),await fetch(`https://raw.githubusercontent.com/ilyhalight/voice-over-translation/master/src/localization/locales/${this.lang}.json`).then((t=>{if(200===t.status)return t.text();throw t.status})).then((async t=>{await h.set("locale-phrases",t),this.setLocaleFromJsonString(t);const e=this.getFromLocale(this.locale,"__version__");"number"==typeof e&&await h.set("locale-version",e),await h.set("locale-lang",this.lang)})).catch((async t=>{console.error("[VOT] [localizationProvider] failed get locale, cause:",t),this.setLocaleFromJsonString(await h.get("locale-phrases",""))})))}setLocaleFromJsonString(t){try{this.locale=JSON.parse(t)??{}}catch(t){console.error("[VOT] [localizationProvider]",t),this.locale={}}}getFromLocale(t,e){const o=e.split(".").reduce(((t,e)=>{if("object"==typeof t&&t)return t[e]}),t);return void 0===o&&console.warn("[VOT] [localizationProvider] locale",t,"doesn't contain key",e),o}getDefault(t){return this.getFromLocale(c,t)??t}get(t){return this.getFromLocale(this.locale,t)??this.getFromLocale(c,t)??t}};var v=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),m=o.n(v),b=o("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),f=o.n(b),y=o("./node_modules/style-loader/dist/runtime/insertBySelector.js"),w=o.n(y),x=o("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),S=o.n(x),k=o("./node_modules/webpack-monkey/lib/node/deps/style-loader-insertStyleElement.js"),T=o.n(k),V=o("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),M=o.n(V),L=o("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/main.scss"),A={};A.styleTagTransform=M(),A.setAttributes=S(),A.insert=w().bind(null,"head"),A.domAPI=f(),A.insertStyleElement=T();m()(L.A,A);L.A&&L.A.locals&&L.A.locals;function P(t){const e=document.createElement("vot-block");return e.classList.add("vot-icon-button"),e.innerHTML=t,e}function E(t){const e=parseFloat(t.value),o=""===t.min?0:parseFloat(t.min),n=(e-o)/((""===t.max?100:parseFloat(t.max))-o);t.parentElement.setAttribute("style",`--vot-progress: ${n}`)}function O(t,e="",o=" ",n=!1){const a=document.createElement("vot-block");a.classList.add("vot-textfield");const i=document.createElement(n?"textarea":"input");i.placeholder=o,i.value=e;const r=document.createElement("span");return r.innerHTML=t,a.appendChild(i),a.appendChild(r),{container:a,input:i,label:r}}function C(t){const e=document.createElement("vot-block");e.classList.add("vot-dialog-container"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-dialog-backdrop");const n=document.createElement("vot-block");n.classList.add("vot-dialog");const a=document.createElement("vot-block");a.classList.add("vot-dialog-content-wrapper");const i=document.createElement("vot-block");i.classList.add("vot-dialog-header-container");const r=document.createElement("vot-block");r.classList.add("vot-dialog-body-container");const s=document.createElement("vot-block");s.classList.add("vot-dialog-footer-container");const l=document.createElement("vot-block");l.classList.add("vot-dialog-title-container");const d=P('');d.classList.add("vot-dialog-close-button"),o.onclick=d.onclick=()=>{e.hidden=!0};const c=document.createElement("vot-block");return c.classList.add("vot-dialog-title"),c.innerHTML=t,e.appendChild(o),e.appendChild(n),n.appendChild(a),a.appendChild(i),a.appendChild(r),a.appendChild(s),i.appendChild(l),i.appendChild(d),l.appendChild(c),{container:e,backdrop:o,dialog:n,contentWrapper:a,headerContainer:i,bodyContainer:r,footerContainer:s,titleContainer:l,closeButton:d,title:c}}function B(t,e,o,n={}){const a=n.onSelectCb||function(){},i=n.labelElement||"";let r=[];const s=document.createElement("vot-block");s.classList.add("vot-select"),i&&s.appendChild(i);const l=document.createElement("vot-block");l.classList.add("vot-select-outer");const d=document.createElement("span");d.classList.add("vot-select-title"),d.innerText=t,void 0===t&&(d.innerText=o.find((t=>!0===t.selected))?.label);const c=document.createElement("vot-block");c.classList.add("vot-select-arrow-icon"),c.innerHTML='',l.append(d,c),l.onclick=()=>{const t=C(e);t.container.classList.add("vot-dialog-temp"),t.container.hidden=!1,document.documentElement.appendChild(t.container);const n=document.createElement("vot-block");n.classList.add("vot-select-content-list");for(const t of o){const e=document.createElement("vot-block");e.classList.add("vot-select-content-item"),e.innerText=t.label,e.dataset.votSelected=t.selected,e.dataset.votValue=t.value,t.disabled&&(e.inert=!0),e.onclick=async i=>{if(i.target.inert)return;n.childNodes.forEach((t=>t.dataset.votSelected=!1)),o.forEach((e=>e.selected=e.value===t.value)),e.dataset.votSelected=!0,d.innerText=t.label,await a(i)},n.appendChild(e)}const i=O(g.get("searchField"));i.input.oninput=t=>{const e=t.target.value.toLowerCase();Array.from(r).forEach((t=>t.hidden=!t.innerText.toLowerCase().includes(e)))},t.bodyContainer.append(i.container,n),r=n.childNodes,t.backdrop.onclick=t.closeButton.onclick=()=>{t.container.remove(),r=[]}},s.append(l);return{container:s,title:d,arrowIcon:c,labelElement:i,setTitle:t=>{d.innerText=t},setSelected:t=>{Array.from(r).filter((t=>!t.inert)).forEach((e=>e.dataset.votSelected=e.dataset.votValue===t)),o.forEach((e=>e.selected=String(e.value)===t))},updateItems:t=>{o=t}}}const F={createHeader:function(t,e=4){const o=document.createElement("vot-block");return o.classList.add("vot-header"),o.classList.add(`vot-header-level-${e}`),o.innerHTML=t,o},createInformation:function(t,e){const o=document.createElement("vot-block");o.classList.add("vot-info");const n=document.createElement("vot-block");n.innerHTML=t;const a=document.createElement("vot-block");return a.innerHTML=e,o.appendChild(n),o.appendChild(a),{container:o,header:n,value:a}},createButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-button"),e.innerHTML=t,e},createTextButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-text-button"),e.innerHTML=t,e},createOutlinedButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-outlined-button"),e.innerHTML=t,e},createIconButton:P,createCheckbox:function(t,e=!1){const o=document.createElement("label");o.classList.add("vot-checkbox");const n=document.createElement("input");n.type="checkbox",n.checked=Boolean(e);const a=document.createElement("span");return a.innerHTML=t,o.appendChild(n),o.appendChild(a),{container:o,input:n,label:a}},createSlider:function(t,e=50,o=0,n=100){const a=document.createElement("vot-block");a.classList.add("vot-slider");const i=document.createElement("input");i.type="range",i.min=o,i.max=n,i.value=e;const r=document.createElement("span");return r.innerHTML=t,a.appendChild(i),a.appendChild(r),i.addEventListener("input",(t=>E(t.target))),E(i),{container:a,input:i,label:r}},createTextfield:O,createDialog:C,createVOTButton:function(t){const e=document.createElement("vot-block");e.classList.add("vot-segmented-button");const o=document.createElement("vot-block");o.classList.add("vot-segment"),o.classList.add("vot-translate-button"),o.innerHTML='';const n=document.createElement("vot-block");n.classList.add("vot-separator");const a=document.createElement("vot-block");a.classList.add("vot-segment-only-icon"),a.innerHTML='';const i=document.createElement("vot-block");i.classList.add("vot-separator");const r=document.createElement("vot-block");r.classList.add("vot-segment-only-icon"),r.innerHTML='';const s=document.createElement("span");return s.classList.add("vot-segment-label"),s.innerHTML=t,e.appendChild(o),e.appendChild(n),e.appendChild(a),e.appendChild(i),e.appendChild(r),o.appendChild(s),{container:e,translateButton:o,separator:n,pipButton:a,separator2:i,menuButton:r,label:s}},createVOTMenu:function(t){const e=document.createElement("vot-block");e.classList.add("vot-menu"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-menu-content-wrapper");const n=document.createElement("vot-block");n.classList.add("vot-menu-header-container");const a=document.createElement("vot-block");a.classList.add("vot-menu-body-container");const i=document.createElement("vot-block");i.classList.add("vot-menu-footer-container");const r=document.createElement("vot-block");r.classList.add("vot-menu-title-container");const s=document.createElement("vot-block");return s.classList.add("vot-menu-title"),s.innerHTML=t,e.appendChild(o),o.appendChild(n),o.appendChild(a),o.appendChild(i),n.appendChild(r),r.appendChild(s),{container:e,contentWrapper:o,headerContainer:n,bodyContainer:a,footerContainer:i,titleContainer:r,title:s}},createVOTSelectLabel:function(t){const e=document.createElement("span");return e.classList.add("vot-select-label"),e.innerText=t,e},createVOTSelect:B,createVOTLanguageSelect:function(t){const e=t.fromTitle||"#UNDEFINED",o=t.fromDialogTitle||"#UNDEFINED",n=t.fromItems||[],a=t.fromOnSelectCB||function(){},i=t.toTitle||"#UNDEFINED",r=t.toDialogTitle||"#UNDEFINED",s=t.toItems||[],l=t.toOnSelectCB||function(){},d=document.createElement("vot-block");d.classList.add("vot-lang-select");const c=B(e,o,n,{onSelectCb:a}),u=document.createElement("vot-block");u.classList.add("vot-lang-select-icon"),u.innerHTML='';const h=B(i,r,s,{onSelectCb:l});return d.append(c.container,u,h.container),{container:d,fromSelect:c,icon:u,toSelect:h}},updateSlider:E};class _ extends Error{constructor(t){super(g.getDefault(t)),this.name="VOTLocalizedError",this.unlocalizedMessage=t,this.localizedMessage=g.get(t)}}async function R(t,e){const o=new AbortController,n=setTimeout((()=>o.abort()),3e3);try{return await fetch(t,{...e,signal:o.signal})}catch(t){return console.error("Fetch timed-out. Error:",t),t}finally{clearTimeout(n)}}const q={async translate(t,e){try{const o=await R(i.rw.yandex,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,lang:e})});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.text[0]}catch(e){return console.error("Error translating text:",e),t}},async detect(t,e){try{const o=await R(i.QL.yandex,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,lang:e})});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.lang??"en"}catch(t){return console.error("Error translating text:",t),"en"}}},D={async detect(t){try{const e=await fetch(i.QL.rustServer,{method:"POST",body:t});if(e instanceof Error)throw e;return await e.text()}catch(t){return console.error("Error getting lang from text:",t),"en"}}};const z=["yandex"],I=["yandex","rust-server"];async function $(t,e,o,n){if(!window.location.hostname.includes("m.youtube.com")&&t?.getAudioTrack){const e=t.getAudioTrack(),o=e?.getLanguageInfo();if("und"!==o?.id)return K(o.id.split(".")[0])}const a=e?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(a?.length){const t=a.find((t=>"asr"===t.kind));if(t&&t.languageCode)return K(t.languageCode)}const r=[/(?:https?|ftp):\/\/[\S]+/g,/https?:\/\/\S+|www\.\S+/gm,/\b\S+\.\S+/gm,/#[^\s#]+/g,/Auto-generated by YouTube/g,/Provided to YouTube by/g,/Released on/g,/Bitcoin/g,/USDT/g,/Paypal/g],s=[o,n?n.split("\n\n").filter((t=>!r.some((e=>e.test(t))))).join("\n\n"):""].join(" ").replace(/[^\p{L}\s]/gu," ").trim().replace(/\s+/g," ").slice(0,1e3);return await async function(t){switch(await h.get("detectService",i.K2)){case"yandex":return await q.detect(t);case"rust-server":return await D.detect(t);default:return"en"}}(s)}function N(){return/^m\.youtube\.com$/.test(window.location.hostname)}function H(){return window.location.pathname.startsWith("/shorts/")?N()?document.querySelector("#movie_player"):document.querySelector("#shorts-player"):document.querySelector("#movie_player")}function j(){const t=H();return t?.getPlayerResponse?t?.getPlayerResponse?.call()??null:t?.data?.playerResponse??null}function U(){const t=H();return t?.getVideoData?t?.getVideoData?.call()??null:t?.data?.playerResponse?.videoDetails??null}const W={isMobile:N,getPlayer:H,getPlayerResponse:j,getPlayerData:U,getVideoVolume:function(){const t=H();return t?.getVolume?t.getVolume.call()/100:1},getSubtitles:function(){const t=j();let e=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks??[];return e=e.reduce(((t,e)=>{if("languageCode"in e){const o=e?.languageCode?K(e?.languageCode):void 0,n=e?.url||e?.baseUrl;o&&n&&t.push({source:"youtube",language:o,isAutoGenerated:"asr"===e?.kind,url:`${n.startsWith("http")?n:`${window.location.origin}/${n}`}&fmt=json3`})}return t}),[]),u.A.log("youtube subtitles:",e),e},getVideoData:async function(){const t=H(),e=j(),o=U(),{title:n}=o??{},{shortDescription:a,isLive:i}=e?.videoDetails??{};let s=n?await $(t,e,n,a):"en";s=r.includes(s)?s:"en";const l={isLive:!!i,title:n,description:a,detectedLanguage:s};return u.A.log("youtube video data:",l),console.log("[VOT] Detected language: ",l.detectedLanguage),l},setVideoVolume:function(t){const e=H();if(e?.setVolume)return e.setVolume(Math.round(100*t)),!0},videoSeek:function(t,e){u.A.log("videoSeek",e);const o=(H()?.getProgressState()?.seekableEnd||t.currentTime)-e;t.currentTime=o}},G=navigator.language||navigator.userLanguage,Y=G?.substr(0,2)?.toLowerCase()??"en",Z=(t,e)=>{let o=new URL(window.location.href);switch(t){case"piped":case"invidious":case"youtube":if(o.searchParams.has("enablejsapi")){const t=W.getPlayer().getVideoUrl();o=new URL(t)}return o.pathname.match(/(?:watch|embed|shorts)\/([^/]+)/)?.[1]||o.searchParams.get("v");case"vk":return o.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)?o.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)[0].slice(1):o.searchParams.get("z")?o.searchParams.get("z").split("/")[0]:!(!o.searchParams.get("oid")||!o.searchParams.get("id"))&&`video-${Math.abs(o.searchParams.get("oid"))}_${o.searchParams.get("id")}`;case"nine_gag":case"9gag":case"gag":return o.pathname.match(/gag\/([^/]+)/)?.[1];case"twitch":if(/^m\.twitch\.tv$/.test(window.location.hostname)){const t=document.head.querySelector('link[rel="canonical"]');return t?.href.match(/videos\/([^/]+)/)?.[0]||o.pathname.slice(1)}if(/^player\.twitch\.tv$/.test(window.location.hostname))return`videos/${o.searchParams.get("video")}`;if(/^clips\.twitch\.tv$/.test(window.location.hostname)){const t=document.querySelector(".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']");if(!t)return!1;return`${t.href.replace("https://www.twitch.tv/","")}/clip/${o.searchParams.get("clip")}`}return o.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)?o.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)[0]:o.pathname.match(/(?:videos)\/([^/]+)/)?.[0];case"proxytok":return o.pathname.match(/([^/]+)\/video\/([^/]+)/)?.[0];case"tiktok":{let t=o.pathname.match(/([^/]+)\/video\/([^/]+)/)?.[0];if(!t){const o=e.closest(".xgplayer-playing, .tiktok-web-player"),n=o?.closest('div[data-e2e="recommend-list-item-container"]'),a=n?.querySelector('a[data-e2e="video-author-avatar"]');if(o&&a){const e=o.id?.match(/^xgwrapper-[0-9]+-(.*)$/)?.at(1),n=a.href?.match(/.*(@.*)$/)?.at(1);e&&n&&(t=`${n}/video/${e}`)}}return t}case"vimeo":{const t=o.searchParams.get("app_id"),e=o.pathname.match(/[^/]+\/[^/]+$/)?.[0]||o.pathname.match(/[^/]+$/)?.[0];return t?`${e}?app_id=${t}`:e}case"xvideos":return o.pathname.match(/[^/]+\/[^/]+$/)?.[0];case"pornhub":return o.searchParams.get("viewkey")||o.pathname.match(/embed\/([^/]+)/)?.[1];case"twitter":return o.pathname.match(/status\/([^/]+)/)?.[1];case"udemy":case"rumble":case"facebook":return o.pathname;case"rutube":return o.pathname.match(/(?:video|embed)\/([^/]+)/)?.[1];case"coub":return o.pathname.includes("/view")?o.pathname.match(/view\/([^/]+)/)?.[1]:o.pathname.includes("/embed")?o.pathname.match(/embed\/([^/]+)/)?.[1]:document.querySelector(".coub.active")?.dataset?.permalink;case"bilibili":{const t=o.searchParams.get("bvid");if(t)return t;{let t=o.pathname.match(/video\/([^/]+)/)?.[1];return t&&o.search&&null!==o.searchParams.get("p")&&(t+=`/?p=${o.searchParams.get("p")}`),t}}case"mail_ru":if(o.pathname.startsWith("/v/")||o.pathname.startsWith("/mail/"))return o.pathname;if(o.pathname.match(/video\/embed\/([^/]+)/)){const t=document.querySelector(".b-video-controls__mymail-link");return!!t&&t?.href.split("my.mail.ru")?.[1]}return!1;case"bitchute":return o.pathname.match(/video\/([^/]+)/)?.[1];case"coursera":return o.pathname.match(/learn\/([^/]+)\/lecture\/([^/]+)/)?.[0];case"eporner":return o.pathname.match(/video-([^/]+)\/([^/]+)/)?.[0];case"peertube":return o.pathname.match(/\/w\/([^/]+)/)?.[0];case"dailymotion":{const t=Array.from(document.querySelectorAll("*")).filter((t=>t.innerHTML.trim().includes(".m3u8")));try{let e=t[1].lastChild.src;return e.match(/\/video\/(\w+)\.m3u8/)?.[1]}catch(t){return console.error("[VOT]",t),!1}}case"trovo":{if(!o.pathname.startsWith("/s/"))return!1;const t=o.searchParams.get("vid");if(!t)return!1;const e=o.pathname.match(/([^/]+)\/([\d]+)/)?.[0];return!!e&&`${e}?vid=${t}`}case"yandexdisk":return o.pathname.match(/\/i\/([^/]+)/)?.[1];case"coursehunter":{const t=o.pathname.match(/\/course\/([^/]+)/)?.[1];return!!t&&t+o.search}case"ok.ru":return o.pathname.match(/\/video\/(\d+)/)?.[0];case"googledrive":return o.searchParams.get("docid");case"bannedvideo":return o.searchParams.get("id");case"weverse":return o.pathname.match(/([^/]+)\/(live|media)\/([^/]+)/)?.[0];case"newgrounds":return o.pathname.match(/([^/]+)\/(view)\/([^/]+)/)?.[0];case"egghead":return o.pathname;case"youku":return o.pathname.match(/v_show\/id_[\w=]+/)?.[0];default:return!1}};function K(t){return t.toLowerCase().split(";")[0].trim().split("-")[0].split("_")[0]}function J(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}function Q(){return"undefined"!=typeof Hls&&Hls?.isSupported()?new Hls({debug:!1,lowLatencyMode:!0,backBufferLength:90}):void 0}function X(t,e,o,n){let a=e;return e>n?(a=o+(e-n),a=a>100?100:Math.max(a,0),t.volume=a/100):e100?100:Math.max(a,0),t.volume=a/100),a}const tt=new protobuf.Type("VideoTranslationHelpObject").add(new protobuf.Field("target",1,"string")).add(new protobuf.Field("targetUrl",2,"string")),et=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("duration",6,"double")).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,"VideoTranslationHelpObject","repeated")).add(new protobuf.Field("responseLanguage",14,"string")).add(new protobuf.Field("unknown5",15,"int32")).add(new protobuf.Field("unknown6",16,"int32")).add(new protobuf.Field("unknown7",17,"int32")),ot=new protobuf.Type("VideoSubtitlesRequest").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("language",2,"string")),nt=new protobuf.Type("VideoStreamRequest").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("language",2,"string")).add(new protobuf.Field("responseLanguage",3,"string")),at=new protobuf.Type("VideoStreamPingRequest").add(new protobuf.Field("pingId",1,"int32")),it=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("unknown0",6,"int32")).add(new protobuf.Field("unknown1",7,"string")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("message",9,"string")),rt=new protobuf.Type("VideoSubtitlesObject").add(new protobuf.Field("language",1,"string")).add(new protobuf.Field("url",2,"string")).add(new protobuf.Field("unknown2",3,"int32")).add(new protobuf.Field("translatedLanguage",4,"string")).add(new protobuf.Field("translatedUrl",5,"string")).add(new protobuf.Field("unknown5",6,"int32")).add(new protobuf.Field("unknown6",7,"int32")),st=new protobuf.Type("VideoSubtitlesResponse").add(new protobuf.Field("unknown0",1,"int32")).add(new protobuf.Field("subtitles",2,"VideoSubtitlesObject","repeated")),lt=new protobuf.Type("VideoStreamObject").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("timestamp",2,"int64")),dt=new protobuf.Type("VideoStreamResponse").add(new protobuf.Field("interval",1,"int32")).add(new protobuf.Field("translatedInfo",2,"VideoStreamObject")).add(new protobuf.Field("pingId",3,"int32")),ct=(new protobuf.Root).define("yandex").add(tt).add(et).add(it).add(ot).add(rt).add(st).add(at).add(nt).add(lt).add(dt),ut={encodeTranslationRequest:(t,e,o,n,a)=>ct.VideoTranslationRequest.encode({url:t,firstRequest:!0,duration:e,unknown2:1,language:o,unknown3:0,unknown4:0,translationHelp:a,responseLanguage:n,unknown5:0,unknown6:1,unknown7:0}).finish(),decodeTranslationResponse:t=>ct.VideoTranslationResponse.decode(new Uint8Array(t)),encodeSubtitlesRequest:(t,e)=>ct.VideoSubtitlesRequest.encode({url:t,language:e}).finish(),decodeSubtitlesResponse:t=>ct.VideoSubtitlesResponse.decode(new Uint8Array(t)),encodeStreamPingRequest:t=>ct.VideoStreamPingRequest.encode({pingId:t}).finish(),encodeStreamRequest:(t,e,o)=>ct.VideoStreamRequest.encode({url:t,language:e,responseLanguage:o}).finish(),decodeStreamResponse:t=>ct.VideoStreamResponse.decode(new Uint8Array(t))};var ht=o("./node_modules/bowser/es5.js");function pt(t){const e=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)));return t?e:e.toUpperCase()}async function gt(t){const e=new TextEncoder("utf-8"),o=await window.crypto.subtle.importKey("raw",e.encode(i.S7),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),n=await window.crypto.subtle.sign("HMAC",o,t);return Array.from(new Uint8Array(n),(t=>t.toString(16).padStart(2,"0"))).join("")}const vt=async function(t,e){try{u.A.log("requestStreamPing");const n=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest.js"))).default;u.A.log("Inited yandexRequest...");const a=ut.encodeStreamPingRequest(t);await n("/stream-translation/ping-stream",a,{"Vtrans-Signature":await gt(a),"Sec-Vtrans-Token":pt(!1)},e)}catch(t){console.error("[VOT]",t),e(!1)}};const mt=async function(t,e,n,a){try{u.A.log("requestStreamTranslation");const i=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest.js"))).default;u.A.log("Inited yandexRequest...");const r=ut.encodeStreamRequest(t,e,n);await i("/stream-translation/translate-stream",r,{"Vtrans-Signature":await gt(r),"Sec-Vtrans-Token":pt(!1)},a)}catch(t){console.error("[VOT]",t),a(!1)}};const bt=async function(t,e,n,a,i,r){try{u.A.log("requestVideoTranslation");const s=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest.js"))).default;u.A.log("Inited yandexRequest...");const l=ut.encodeTranslationRequest(t,e,n,a,i);await s("/video-translation/translate",l,{"Vtrans-Signature":await gt(l),"Sec-Vtrans-Token":pt(!1)},r)}catch(t){console.error("[VOT]",t),r(!1)}};const ft=async function(t,e,n){try{u.A.log("requestVideoSubtitles");const a=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest.js"))).default;u.A.log("Inited yandexRequest...");const i=ut.encodeSubtitlesRequest(t,e);await a("/video-subtitles/get-subtitles",i,{"Vsubs-Signature":await gt(i),"Sec-Vsubs-Token":pt(!1)},n)}catch(t){console.error("[VOT]",t),n(!1)}};function yt(t){const e=t.startMs+t.durationMs;return t.tokens.reduce(((o,n,a)=>{const i=t.tokens[a+1];let r;o.length>0&&(r=o[o.length-1]);const s=r?.alignRange?.end??0,l=s+n.text.length;if(n.alignRange={start:s,end:l},o.push(n),i){const t=n.startMs+n.durationMs,a=i.startMs?i.startMs-t:e-t;o.push({text:" ",startMs:t,durationMs:a,alignRange:{start:l,end:l+1}})}return o}),[])}function wt(t,e){const o=t.text.split(/([\n \t])/).reduce(((t,o)=>{if(o.length){const n=t[t.length-1]??e,a=n?.alignRange?.end??0,i=a+o.length;t.push({text:o,alignRange:{start:a,end:i}})}return t}),[]),n=Math.floor(t.durationMs/o.length),a=t.startMs+t.durationMs;return o.map(((e,i)=>{const r=i===o.length-1,s=t.startMs+n*i;return{...e,startMs:s,durationMs:r?a-s:n}}))}async function xt(t){let e=!1,o=await Promise.race([new Promise((t=>{setTimeout((()=>{e||(console.error("[VOT] Failed to fetch subtitles. Reason: timeout"),t([]))}),5e3)})),new Promise((o=>{u.A.log("Fetching subtitles:",t),fetch(t.url).then((t=>t.json())).then((t=>{e=!0,o(t)})).catch((t=>{console.error("[VOT] Failed to fetch subtitles. Reason:",t),e=!0,o({containsTokens:!1,subtitles:[]})}))}))]);return"youtube"===t.source&&(o=function(t){const e={containsTokens:!1,subtitles:[]};if("object"!=typeof t||!("events"in t)||!Array.isArray(t.events))return console.error("[VOT] Failed to format youtube subtitles",t),e;for(let o=0;ot.utf8.replace(/^ +| +$/g,""))).join(" ");let a=t.events[o].dDurationMs;t.events[o+1]&&t.events[o].tStartMs+t.events[o].dDurationMs>t.events[o+1].tStartMs&&(a=t.events[o+1].tStartMs-t.events[o].tStartMs),"\n"!==n&&e.subtitles.push({text:n,startMs:t.events[o].tStartMs,durationMs:a})}return e}(o)),o.subtitles=function(t,e){const o=[];let n;for(const a of t.subtitles){let i;if(a?.tokens?.length){if("yandex"!==e)return console.warn("[VOT] Unsupported subtitles tokens type: ",e),t.containsTokens=!1,null;i=yt(a)}else i=wt(a,n);n=i[i.length-1],o.push({...a,tokens:i})}return t.containsTokens=!0,o}(o,t.source),console.log("[VOT] subtitles:",o),o}class St{dragging=!1;subtitlesContainerRect=null;containerRect=null;offsetX=null;offsetY=null;lastContent=null;highlightWords=!1;subtitles=null;maxLength=300;maxLengthRegexp=/.{1,300}(?:\s|$)/g;constructor(t,e,o){this.site=o,this.video=t,"youtube"===this.site.host&&"mobile"!==this.site.additionalData?this.container=e.parentElement:this.container=e,this.votSubtitlesContainer=document.createElement("vot-block"),this.votSubtitlesContainer.classList.add("vot-subtitles-widget"),this.container.appendChild(this.votSubtitlesContainer),this.onMouseDownBound=this.onMouseDown.bind(this),this.onMouseUpBound=this.onMouseUp.bind(this),this.onMouseMoveBound=this.onMouseMove.bind(this),this.onTimeUpdateBound=this.onTimeUpdate.bind(this),document.addEventListener("mousedown",this.onMouseDownBound),document.addEventListener("mouseup",this.onMouseUpBound),document.addEventListener("mousemove",this.onMouseMoveBound),this.video?.addEventListener("timeupdate",this.onTimeUpdateBound)}release(){this.video?.removeEventListener("timeupdate",this.onTimeUpdateBound),document.removeEventListener("mousedown",this.onMouseDownBound),document.removeEventListener("mouseup",this.onMouseUpBound),document.removeEventListener("mousemove",this.onMouseMoveBound),this.votSubtitlesContainer.remove()}onMouseDown(t){this.votSubtitlesContainer.contains(t.target)&&(this.subtitlesContainerRect=this.votSubtitlesContainer.getBoundingClientRect(),this.containerRect=this.container.getBoundingClientRect(),this.offsetX=t.clientX-this.subtitlesContainerRect.x,this.offsetY=t.clientY-this.subtitlesContainerRect.y,this.dragging=!0)}onMouseUp(){this.dragging=!1}onMouseMove(t){if(this.dragging){t.preventDefault();const e=t.clientX-this.offsetX,o=t.clientY-this.offsetY,n=o>=this.containerRect.top,a=o+this.subtitlesContainerRect.height<=this.containerRect.bottom,i=e>=this.containerRect.left,r=e+this.subtitlesContainerRect.width<=this.containerRect.right;this.votSubtitlesContainer.style.top=n&&a?o-this.containerRect.y+"px":n?this.containerRect.height-this.subtitlesContainerRect.height+"px":"0px",this.votSubtitlesContainer.style.left=i&&r?e-this.containerRect.x+"px":i?this.containerRect.width-this.subtitlesContainerRect.width+"px":"0px"}}onTimeUpdate(){this.update()}setContent(t){t&&this.video?(this.subtitles=t,this.update()):(this.subtitles=null,this.votSubtitlesContainer.innerHTML="")}setMaxLength(t){"number"==typeof t&&t&&(this.maxLength=t,this.maxLengthRegexp=new RegExp(`.{1,${t}}(?:\\s|$)`,"g"),this.update())}setHighlightWords(t){this.highlightWords!==!!t&&(this.highlightWords=!!t,this.update())}update(){if(!this.video)return;let t="",e=this.highlightWords&&this.subtitles?.containsTokens;const o=1e3*this.video.currentTime,n=this.subtitles?.subtitles?.findLast((t=>t.startMsthis.maxLength){let t=[],n=0,a=0,i=0;for(let o=0;othis.maxLength){let r=e.slice(n,a+1);r.at(0)&&" "===r.at(0).text&&(r=r.slice(1)),r.at(-1)&&" "===r.at(-1).text&&(r=r.slice(0,r.length-1)),t.push({startMs:e[n].startMs,durationMs:e[a].startMs+e[a].durationMs-e[n].startMs,tokens:r}),n=o,i=0}a=o}for(const n of t)if(n.startMse||o>n.startMs-100&&e-o<275?'class="passed"':""}>${n.text}`}}else if(n.text.length>this.maxLength){let e=n.text.match(this.maxLengthRegexp),a=n.durationMs/e.length;for(let i=0;i${t.replace("\\n","
")}`:"")}}const kt={getVideoData:async function(){const t=window.course_id??document.querySelector('input[name="course_id"]')?.value,e=window.lessons??await async function(t){const e=await fetch(`https://coursehunter.net/api/v1/course/${t}/lessons`);return await e.json()}(t),o=parseInt(document.querySelector(".lessons-item_active")?.dataset?.index??1),n=e?.[o-1],{file:a,duration:i}=n;return u.A.log("coursehunter course data:",e),{url:a,duration:i}}};function Tt(){return Vt()?.player}function Vt(){return document.querySelector(".vjs-v6")}const Mt={getPlayer:Vt,getPlayerData:Tt,getVideoData:async function(t="en"){let e=null;const o=Tt(),{duration:n}=o?.cache_||{},{courseId:a,tracks:i,sources:s}=o?.options_||{},l=function(t){const e=t?.find((t=>"video/mp4"===t.type));return e?.src}(s),d=await async function(t){const e=await fetch(`https://www.coursera.org/api/onDemandCourses.v1/${t}`),o=await e.json();return o?.elements?.[0]}(a);let c=d?.primaryLanguageCodes?.[0];c=c?K(c):"en",r.includes(c)||(c="en");const h=function(t,e,o){let n=t?.find((t=>K(t.srclang)===e));return n||(n=t?.find((t=>K(t.srclang)===o))||t?.[0]),n?.src}(i,c,t);console.log(`videoURL: ${l}, subtitlesURL: ${h}`),h&&l?e=[{target:"video_file_url",targetUrl:l},{target:"subtitles_file_url",targetUrl:`https://www.coursera.org${h}`}]:console.error(`Failed to find subtitlesURL or videoURL. videoURL: ${l}, subtitlesURL: ${h}`);const p={duration:n,detectedLanguage:c,translationHelp:e};return u.A.log("coursera video data:",p),console.log("[VOT] Detected language: ",p.detectedLanguage),p}},Lt="https://www.udemy.com/api-2.0",At=2592e6;async function Pt(t){const e=await fetch(`${Lt}/courses/${t}/?`+new URLSearchParams({"fields[course]":"locale",use_remote_version:"true",caching_intent:"true"}));return await e.json()}async function Et(t,e,o){if(!(n=t.expires,n+At>(new Date).getTime()&&t.accessToken))return void console.error(g.get("udemyAccessTokenExpired"));var n;const a=`Bearer ${t.accessToken}`,i=await fetch(`${Lt}/users/me/subscribed-courses/${e}/lectures/${o}/?`+new URLSearchParams({"fields[lecture]":"asset","fields[asset]":"length,media_sources,captions"}),{headers:{"x-udemy-authorization":a,authorization:a}});return await i.json()}function Ot(){return Bt()?.player}function Ct(){const t=document.querySelector(".ud-app-loader[data-module-id='course-taking']")?.dataset?.moduleArgs;return t?JSON.parse(t):(console.error(g.get("udemyModuleArgsNotFound")),{})}function Bt(){return document.querySelector(".vjs-v7")}const Ft={getPlayer:Bt,getPlayerData:Ot,getVideoData:async function(t,e="en"){let o=null;const n=Ot();u.A.log("udemyData",t);const a=Ct();u.A.log("moduleData: ",a);const i=a.courseId,s=window.location.pathname.match(/learn\/lecture\/([^/]+)/)?.[1];u.A.log(`CourseId: ${i}, lectureId: ${s}`);const l=await Pt(i);u.A.log("courseLang Data:",l);const d=await Et(t,i,s);console.log("lecture Data:",d);let c=l?.locale?.locale;c=c?K(c):"en",r.includes(c)||(c="en");const h=d?.asset?.length||n?.cache_?.duration,p=function(t){const e=t?.find((t=>"video/webm"===t.type||"video/mp4"===t.type));return e?.src}(d?.asset?.media_sources)||function(){const t=Bt()?.querySelector("video")?.src;return!t?.startsWith("blob:")&&t}(),g=function(t,e,o){let n=t?.find((t=>K(t.locale_id)===e));return n||(n=t?.find((t=>K(t.locale_id)===o))||t?.[0]),n?.url}(d?.asset?.captions,c,e);console.log(`videoURL: ${p}, subtitlesURL: ${g}`),g&&p?o=[{target:"video_file_url",targetUrl:p},{target:"subtitles_file_url",targetUrl:g}]:console.error(`Failed to find subtitlesURL or videoURL. videoURL: ${p}, subtitlesURL: ${g}`);const v={duration:h,detectedLanguage:c,translationHelp:o};return u.A.log("udemy video data:",v),console.log("[VOT] Detected language: ",v.detectedLanguage),v},getModuleData:Ct,getCourseLang:Pt,getLectureData:Et};const _t={getVideoData:async function(t){const e=await async function(t){return await fetch("https://api.banned.video/graphql",{method:"POST",body:JSON.stringify({operationName:"GetVideo",query:"query GetVideo($id: String!) {\n getVideo(id: $id) {\n ...DisplayVideoFields\n videoUrl: directUrl\n live\n }\n }\n\n fragment DisplayVideoFields on Video {\n title\n description: summary\n duration: videoDuration\n }",variables:{id:t}}),headers:{"User-Agent":"bannedVideoFrontEnd","apollographql-client-name":"banned-web","apollographql-client-version":"1.3","content-type":"application/json"}}).then((t=>t.json())).catch((t=>(console.error(t),{data:{getVideo:{}}})))}(t);u.A.log("banned.video video data:",e);const{videoUrl:o,duration:n,live:a,description:i,title:r}=e.data.getVideo;return{url:o,duration:n,live:a,title:r,description:i}}};const Rt="https://global.apis.naver.com/weverse/wevweb",qt="be4d79eb8fc7bd008ee82c8ec4ff6fd4",Dt="1b9cb6378d959b45714bec49971ade22e6e24e42";async function zt(t){const e=Date.now();let o=t.substring(0,Math.min(255,t.length))+e;const n=await async function(t,e){const o=new TextEncoder("utf-8");return e=o.encode(e),window.crypto.subtle.importKey("raw",o.encode(t),{name:"HMAC",hash:{name:"SHA-1"}},!1,["sign","verify"]).then((t=>window.crypto.subtle.sign("HMAC",t,e))).then((t=>btoa(String.fromCharCode(...new Uint8Array(t))))).catch((t=>(console.error(t),!1)))}(Dt,o);return{wmsgpad:e,wmd:n}}function It(){return{appId:qt,language:"en",os:"WEB",platform:"WEB",wpf:"pc"}}const $t={getVideoData:async function(){const t=new URL(window.location).pathname.match(/([^/]+)\/(live|media)\/([^/]+)/)?.[3],e=await async function(t){const e=`/post/v1.0/post-${t}/preview?`+new URLSearchParams({fieldSet:"postForPreview",...It()}),o=await zt(e);return await fetch(Rt+e+"&"+new URLSearchParams(o)).then((t=>t.json())).catch((t=>(console.error(t),{extension:{video:{}}})))}(t);u.A.log("weverse video preview data:",e);const{videoId:o,serviceId:n,infraVideoId:a}=e.extension.video;if(!(o&&n&&a))return!1;const{inKey:i}=await async function(t){const e=`/video/v1.1/vod/${t}/inKey?`+new URLSearchParams({gcc:"RU",...It()}),o=await zt(e);return await fetch(Rt+e+"&"+new URLSearchParams(o),{method:"POST"}).then((t=>t.json())).catch((t=>(console.error(t),{})))}(o);if(u.A.log("weverse video inKey data:",e),!i)return!1;const r=await async function(t,e,o){const n=Date.now();return await fetch(`https://global.apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/${t}?`+new URLSearchParams({key:e,sid:o,nonce:n,devt:"html5_pc",prv:"N",aup:"N",stpb:"N",cpl:"en",env:"prod",lc:"en",adi:[{adSystem:null}],adu:"/"})).then((t=>t.json())).catch((t=>(console.error(t),{videos:{list:[]}})))}(a,i,n);u.A.log("weverse video data:",r);const s=r.videos.list.find((t=>!1===t.useP2P&&t.source.includes(".mp4")));if(!s)return!1;const{source:l,duration:d}=s;return{url:l,duration:d}}},Nt=[{additionalData:"mobile",host:"youtube",url:"https://youtu.be/",match:/^m.youtube(-nocookie)?.com$/,selector:"shorts-video #player"},{additionalData:"mobile",host:"youtube",url:"https://youtu.be/",match:/^m.youtube(-nocookie)?.com$/,selector:".player-container"},{host:"youtube",url:"https://youtu.be/",match:/^(www.)?youtube(-nocookie|kids)?.com$/,selector:".html5-video-container:not(#inline-player *)"},{host:"tiktok",url:"https://www.tiktok.com/",match:/^(www.)?tiktok.com$/,selector:null},{host:"proxytok",url:"https://www.tiktok.com/",match:n,selector:".column.has-text-centered"},{host:"twitch",url:"https://twitch.tv/",match:[/^m.twitch.tv$/,/^www.twitch.tv$/,/^clips.twitch.tv$/,/^player.twitch.tv$/],selector:".video-ref, main > div > section > div > div > div"},{host:"xvideos",url:"https://www.xvideos.com/",match:/^www.xvideos.com$/,selector:".video-bg-pic"},{host:"pornhub",url:"https://rt.pornhub.com/view_video.php?viewkey=",match:/^[a-z]+.pornhub.com$/,selector:".mainPlayerDiv > .video-element-wrapper-js > div"},{additionalData:"embed",host:"pornhub",url:"https://rt.pornhub.com/view_video.php?viewkey=",match:t=>t.host.includes("pornhub.com")&&t.pathname.startsWith("/embed/"),selector:"#player"},{additionalData:"mobile",host:"vk",url:"https://vk.com/video?z=",match:/^m.vk.(com|ru)$/,selector:"vk-video-player",shadowRoot:!0},{host:"vk",url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:".videoplayer_media"},{host:"vimeo",url:"https://vimeo.com/",match:/^vimeo.com$/,selector:".player"},{additionalData:"embed",host:"vimeo",url:"https://player.vimeo.com/",match:/^player.vimeo.com$/,selector:".player"},{host:"ok.ru",url:"https://ok.ru/",match:/^ok.ru$/,selector:".html5-vpl_vid"},{host:"nine_gag",url:"https://9gag.com/gag/",match:/^9gag.com$/,selector:".video-post"},{host:"coub",url:"https://coub.com/view/",match:/^coub.com$/,selector:".viewer__player"},{host:"bitchute",url:"https://www.bitchute.com/video/",match:/^(www.)?bitchute.com$/,selector:"#player"},{host:"rutube",url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:".video-player > div > div > div:nth-child(2)"},{additionalData:"embed",host:"rutube",url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:"#app > div > div"},{host:"bilibili",url:"https://www.bilibili.com/video/",match:/^(www|m|player).bilibili.com$/,selector:".bpx-player-video-wrap"},{additionalData:"old",host:"bilibili",url:"https://www.bilibili.com/video/",match:/^(www|m).bilibili.com$/,selector:null},{host:"twitter",url:"https://twitter.com/i/status/",match:/^twitter.com$/,selector:'div[data-testid="videoComponent"] > div:nth-child(1) > div'},{host:"mail_ru",url:"https://my.mail.ru/",match:/^my.mail.ru$/,selector:"#b-video-wrapper"},{host:"coursera",url:"https://www.coursera.org/",match:/coursera.org$/,selector:".vjs-v6"},{host:"udemy",url:"https://www.udemy.com",match:/udemy.com$/,selector:'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)'},{host:"invidious",url:"https://youtu.be/",match:t,selector:"#player"},{host:"piped",url:"https://youtu.be/",match:e,selector:".shaka-video-container"},{host:"rumble",url:"https://rumble.com",match:/^rumble.com$/,selector:"#videoPlayer > .videoPlayer-Rumble-cls > div"},{host:"eporner",url:"https://www.eporner.com/",match:/^(www.)?eporner.com$/,selector:".vjs-v7"},{host:"peertube",url:"tube.shanti.cafe",match:a,selector:".vjs-v7"},{host:"dailymotion",url:"https://www.dailymotion.com/video/",match:/^geo.dailymotion.com$/,selector:".player"},{host:"trovo",url:"https://trovo.live/s/",match:/^trovo.live$/,selector:".player-video"},{host:"yandexdisk",url:"https://disk.yandex.ru/i/",match:/^disk.yandex.ru$/,selector:"yaplayertag > div:nth-of-type(1)"},{host:"coursehunter",url:"https://coursehunter.net/course/",match:/^coursehunter.net$/,selector:"#oframeplayer > pjsdiv:nth-of-type(1)"},{host:"googledrive",url:"https://drive.google.com/file/d/",match:/^youtube.googleapis.com$/,selector:".html5-video-container"},{host:"bannedvideo",url:"https://banned.video/watch?id=",match:/^(www.)?banned.video$/,selector:".vjs-v7"},{host:"facebook",url:"https://facebook.com",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/videos/"),selector:'div[data-pagelet="WatchPermalinkVideo"]'},{additionalData:"reels",host:"facebook",url:"https://facebook.com",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/reel/"),selector:'div[role="main"]'},{host:"weverse",url:"https://weverse.io/",match:/^weverse.io$/,selector:".webplayer-internal-source-wrapper"},{host:"newgrounds",url:"https://www.newgrounds.com/",match:/^www.newgrounds.com$/,selector:".ng-video-player"},{host:"egghead",url:"https://egghead.io",match:/^egghead.io$/,selector:".cueplayer-react-video-holder"},{host:"youku",url:"https://v.youku.com/",match:/^v.youku.com$/,selector:"#ykPlayer"}];o("./node_modules/requestidlecallback-polyfill/index.js");class Ht{constructor(){this.listeners=new Set}hasListener(t){return this.listeners.has(t)}dispatchToListener(t,...e){try{t(...e)}catch(t){console.error("[VOT]",t)}}addListener(t){if(this.hasListener(t))throw new Error("[VOT] The listener has already been added.");this.listeners.add(t)}removeListener(t){if(!this.hasListener(t))throw new Error("[VOT] The listener has not been added yet.");this.listeners.delete(t)}dispatch(...t){for(const e of Array.from(this.listeners))this.dispatchToListener(e,...t)}}function jt(t){return Array.from(t).flatMap((t=>t instanceof HTMLVideoElement?[t]:t instanceof HTMLElement?Array.from(t.querySelectorAll("video")):t.shadowRoot?Array.from(t.shadowRoot.querySelectorAll("video")):[]))}const Ut=ht.getParser(window.navigator.userAgent).getResult(),Wt=[...t,...e],Gt=["playing","ratechange","play","waiting","pause"];function Yt(t,e,o=!1){return t.map((t=>({label:`${o&&!l.includes(t)?"❌ ":""}${g.get("langs")[t]??t.toUpperCase()}`,value:t,selected:e===t})))}function Zt(t,e,o,n,a,i){u.A.log(`Translate video (url: ${t}, duration: ${e}, requestLang: ${o}, responseLang: ${n})`),u.A.log("translationHelp:",a),!0,bt(t,e,o,n,a,((t,e)=>{if(!1,u.A.log("[exec callback] Requesting video translation"),!t)return void i(!1,g.get("requestTranslationFailed"));const o=ut.decodeTranslationResponse(e);switch(console.log("[VOT] Translation response: ",o),o.status){case 0:i(!1,o.message);break;case 1:i(!!o.url,o.url||g.get("audioNotReceived"));break;case 2:i(!1,o.remainingTime?function(t){const e=Math.floor(t/60),o=Math.floor(t%60);return e>=60?g.get("translationTakeMoreThanHour"):e>=10&&e%10?g.get("translationTakeApproximatelyMinutes").replace("{0}",e):1==e||0==e&&o>0?g.get("translationTakeAboutMinute"):g.get("translationTakeApproximatelyMinute").replace("{0}",e)}(o.remainingTime):g.get("translationTakeFewMinutes"));break;case 3:case 6:i(!1,g.get("videoBeingTranslated"))}}))}class Kt{translateFromLang="en";translateToLang=Y;timer;ytData="";videoData="";firstPlay=!0;audio=new Audio;hls=Q();videoTranslations=[];videoTranslationTTL=7200;downloadTranslationUrl=null;downloadSubtitlesUrl=null;autoRetry;streamPing;volumeOnStart;tempOriginalVolume;tempVolume;subtitlesList=[];subtitlesListVideoId=null;videoLastSrcObject=null;constructor(t,e,o){u.A.log("[VideoHandler] add video:",t,"container:",e,this),this.video=t,this.container=e,this.site=o,this.handleSrcChangedBound=this.handleSrcChanged.bind(this),this.video.addEventListener("loadedmetadata",this.handleSrcChangedBound),this.stopTranslationBound=this.stopTranslation.bind(this),this.handleVideoEventBound=this.handleVideoEvent.bind(this),this.changeOpacityOnEventBound=this.changeOpacityOnEvent.bind(this),this.resetTimerBound=this.resetTimer.bind(this),this.init()}async init(){if(this.initialized)return;const t={autoTranslate:h.get("autoTranslate",0,!0),dontTranslateLanguage:h.get("dontTranslateLanguage",Y),dontTranslateYourLang:h.get("dontTranslateYourLang",1,!0),autoSetVolumeYandexStyle:h.get("autoSetVolumeYandexStyle",1,!0),autoVolume:h.get("autoVolume",i.JD,!0),showVideoSlider:h.get("showVideoSlider",1,!0),syncVolume:h.get("syncVolume",0,!0),subtitlesMaxLength:h.get("subtitlesMaxLength",300,!0),highlightWords:h.get("highlightWords",0,!0),responseLanguage:h.get("responseLanguage",Y),defaultVolume:h.get("defaultVolume",100,!0),udemyData:h.get("udemyData",{accessToken:"",expires:0}),audioProxy:h.get("audioProxy",0,!0),showPiPButton:h.get("showPiPButton",0,!0),translateAPIErrors:h.get("translateAPIErrors",1,!0),translationService:h.get("translationService",i.mE),detectService:h.get("detectService",i.K2),m3u8ProxyHost:h.get("m3u8ProxyHost",i.se),proxyWorkerHost:h.get("proxyWorkerHost",i.Pm)},e=await Promise.all(Object.entries(t).map((async([t,e])=>[t,await e])));this.data=Object.fromEntries(e),this.videoData=await this.getVideoData(),console.log("[db] data from db: ",this.data),this.subtitlesWidget=new St(this.video,this.container,this.site),this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength),this.subtitlesWidget.setHighlightWords(this.data.highlightWords),this.initUI(),this.initUIEvents();const o=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=o,o&&(this.votMenu.container.hidden=!0),await this.updateSubtitles(),await this.changeSubtitlesLang("disabled"),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage??"ru"),this.translateToLang=this.data.responseLanguage??"ru",this.initExtraEvents(),this.initialized=!0}transformBtn(t="none",e){this.votButton.container.dataset.status=t,this.votButton.label.innerHTML=e}initUI(){this.votButton=F.createVOTButton(g.get("translateVideo")),this.container.appendChild(this.votButton.container),this.votButton.pipButton.hidden=!J()||!this.data?.showPiPButton,this.votButton.separator2.hidden=!J()||!this.data?.showPiPButton,this.votButton.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votMenu=F.createVOTMenu(g.get("VOTSettings")),this.container.appendChild(this.votMenu.container),this.votDownloadButton=F.createIconButton(''),this.votDownloadButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadButton),this.votDownloadSubtitlesButton=F.createIconButton(''),this.votDownloadSubtitlesButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadSubtitlesButton),this.votSettingsButton=F.createIconButton(''),this.votMenu.headerContainer.appendChild(this.votSettingsButton),this.votTranslationLanguageSelect=F.createVOTLanguageSelect({fromTitle:g.get("langs")[this.video.detectedLanguage],fromDialogTitle:g.get("videoLanguage"),fromItems:[{label:g.get("langs").auto,value:"auto",selected:""},...Yt(r,this.videoData.detectedLanguage)],fromOnSelectCB:async t=>{u.A.log("[fromOnSelectCB] select from language",t.target.dataset.votValue),this.videoData=await this.getVideoData(),this.setSelectMenuValues(t.target.dataset.votValue,this.videoData.responseLanguage)},toTitle:g.get("langs")[this.video.responseLanguage],toDialogTitle:g.get("translationLanguage"),toItems:[...Yt(r,this.videoData.responseLanguage,!0),{label:"─────────",value:"separator",disabled:!0},...Yt(s,this.videoData.responseLanguage,!0)],toOnSelectCB:async t=>{const e=t.target.dataset.votValue;u.A.log("[toOnSelectCB] select to language",e),this.data.responseLanguage=this.translateToLang=e,await h.set("responseLanguage",this.data.responseLanguage),u.A.log("Response Language value changed. New value: ",this.data.responseLanguage),this.videoData=await this.getVideoData(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage)}}),this.votMenu.bodyContainer.appendChild(this.votTranslationLanguageSelect.container),this.votSubtitlesSelect=F.createVOTSelect(g.get("VOTSubtitlesDisabled"),g.get("VOTSubtitles"),[{label:g.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1}],{onSelectCb:async t=>{await this.changeSubtitlesLang(t.target.dataset.votValue)},labelElement:F.createVOTSelectLabel(g.get("VOTSubtitles"))}),this.votMenu.bodyContainer.appendChild(this.votSubtitlesSelect.container),this.votVideoVolumeSlider=F.createSlider(`${g.get("VOTVolume")}: ${100*this.getVideoVolume()}%`,100*this.getVideoVolume()),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoVolumeSlider.container),this.votVideoTranslationVolumeSlider=F.createSlider(`${g.get("VOTVolumeTranslation")}: ${this.data?.defaultVolume??100}%`,this.data?.defaultVolume??100),this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoTranslationVolumeSlider.container),this.votMenu.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votSettingsDialog=F.createDialog(g.get("VOTSettings")),document.documentElement.appendChild(this.votSettingsDialog.container),this.votTranslationHeader=F.createHeader(g.get("translationSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationHeader),this.votAutoTranslateCheckbox=F.createCheckbox(g.get("VOTAutoTranslate"),this.data?.autoTranslate??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoTranslateCheckbox.container),this.votDontTranslateYourLangSelect=F.createVOTSelect(g.get("langs")[h.syncGet("dontTranslateLanguage",Y)],g.get("VOTDontTranslateYourLang"),Yt(r,h.syncGet("dontTranslateLanguage",Y)),{onSelectCb:async t=>{this.data.dontTranslateLanguage=t.target.dataset.votValue,await h.set("dontTranslateLanguage",this.data.dontTranslateLanguage)},labelElement:F.createCheckbox(g.get("VOTDontTranslateYourLang"),this.data?.dontTranslateYourLang??!0).container}),this.votSettingsDialog.bodyContainer.appendChild(this.votDontTranslateYourLangSelect.container),this.votAutoSetVolumeCheckbox=F.createCheckbox(`${g.get("VOTAutoSetVolume")}`,this.data?.autoSetVolumeYandexStyle??!0),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeCheckbox.container),this.votAutoSetVolumeSlider=F.createSlider(`${100*(this.data?.autoVolume??i.JD)}%`,100*(this.data?.autoVolume??i.JD),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=F.createCheckbox(g.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votUdemyDataTextfield=F.createTextfield(g.get("VOTUdemyData"),this.data?.udemyData?.accessToken??""),this.votUdemyDataTextfield.container.hidden="udemy"!==this.site.host,this.votSettingsDialog.bodyContainer.appendChild(this.votUdemyDataTextfield.container),this.votSyncVolumeCheckbox=F.createCheckbox(g.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSyncVolumeCheckbox.container.hidden=!["youtube","googledrive"].includes(this.site.host)||"mobile"===this.site.additionalData,this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votTranslationServiceSelect=F.createVOTSelect(h.syncGet("translationService",i.mE),g.get("VOTTranslationService"),Yt(z,h.syncGet("translationService",i.mE)),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await h.set("translationService",this.data.translationService)},labelElement:F.createCheckbox(g.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===g.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=F.createVOTSelect(h.syncGet("detectService",i.K2),g.get("VOTDetectService"),Yt(I,h.syncGet("detectService",i.K2)),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await h.set("detectService",this.data.detectService)},labelElement:F.createVOTSelectLabel(g.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=F.createHeader(g.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesMaxLengthSlider=F.createSlider(`${g.get("VOTSubtitlesMaxLength")}: ${this.data?.subtitlesMaxLength??300}`,this.data?.subtitlesMaxLength??300,50,300),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesMaxLengthSlider.container),this.votSubtitlesHighlightWordsCheckbox=F.createCheckbox(g.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votProxyHeader=F.createHeader(g.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=F.createTextfield(g.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,i.se),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=F.createTextfield(g.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,i.Pm),this.votProxyWorkerHostTextfield.container.hidden=!0,this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=F.createCheckbox(g.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votAudioProxyCheckbox.container.hidden=!0,this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votAboutHeader=F.createHeader(g.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=F.createVOTSelect(g.get("langs")[h.syncGet("locale-lang-override","auto")],g.get("VOTMenuLanguage"),Yt(p,h.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await h.set("locale-lang-override",t.target.dataset.votValue)},labelElement:F.createVOTSelectLabel(g.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=F.createCheckbox(g.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!J(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=F.createInformation(`${g.get("VOTVersion")}:`,GM_info.script.version),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=F.createInformation(`${g.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=F.createInformation(`${g.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=F.createInformation(`${g.get("VOTBrowser")}:`,`${Ut.browser.name} ${Ut.browser.version} (${Ut.os.name} ${Ut.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votResetSettingsButton=F.createButton(g.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}initUIEvents(){this.votButton.translateButton.addEventListener("click",(()=>{(async()=>{if(this.audio.src)return u.A.log("[click translationBtn] audio.src is not empty"),void this.stopTranslate();if(this.hls.url)return u.A.log("[click translationBtn] hls is not empty"),void this.stopTranslate();try{if(u.A.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new _("VOTNoVideoIDFound");await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t)}})()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votDownloadButton.addEventListener("click",(()=>{this.downloadTranslationUrl&&window.open(this.downloadTranslationUrl,"_blank").focus()})),this.votDownloadSubtitlesButton.addEventListener("click",(()=>{console.log(this.downloadSubtitlesUrl),this.downloadSubtitlesUrl&&window.open(this.downloadSubtitlesUrl,"_blank").focus()})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);if(this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${e}%`,this.setVideoVolume(e/100),1===this.data.syncVolume){const t=Number(this.votVideoTranslationVolumeSlider.input.value),o=X(this.audio,e,t,this.tempOriginalVolume);this.votVideoTranslationVolumeSlider.input.value=o,this.votVideoTranslationVolumeSlider.label.querySelector("strong").innerHTML=`${o}%`,F.updateSlider(this.votVideoTranslationVolumeSlider.input),this.tempVolume=o,this.tempOriginalVolume=e}})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await h.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").innerHTML=`${this.data.defaultVolume}%`,this.audio.volume=this.data.defaultVolume/100,1===this.data.syncVolume&&this.syncTranslationWithVideo(this.data.defaultVolume)})()})),this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await h.set("autoTranslate",this.data.autoTranslate),u.A.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await h.set("dontTranslateYourLang",this.data.dontTranslateYourLang),u.A.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await h.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),u.A.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await h.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").innerHTML=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await h.set("showVideoSlider",this.data.showVideoSlider),u.A.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votUdemyDataTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.udemyData={accessToken:t.target.value,expires:(new Date).getTime()},await h.set("udemyData",this.data.udemyData),u.A.log("udemyData value changed. New value: ",this.data.udemyData),window.location.reload()})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await h.set("syncVolume",this.data.syncVolume),u.A.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await h.set("translateAPIErrors",this.data.translateAPIErrors),u.A.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesMaxLengthSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesMaxLength=Number(t.target.value),await h.set("subtitlesMaxLength",this.data.subtitlesMaxLength),this.votSubtitlesMaxLengthSlider.label.querySelector("strong").innerHTML=`${this.data.subtitlesMaxLength}`,this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength)})()})),this.votSubtitlesHighlightWordsCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.highlightWords=Number(t.target.checked),await h.set("highlightWords",this.data.highlightWords),u.A.log("highlightWords value changed. New value: ",this.data.highlightWords),this.subtitlesWidget.setHighlightWords(this.data.highlightWords)})()})),this.votShowPiPButtonCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showPiPButton=Number(t.target.checked),await h.set("showPiPButton",this.data.showPiPButton),u.A.log("showPiPButton value changed. New value: ",this.data.showPiPButton),this.votButton.pipButton.hidden=!J()||!this.data.showPiPButton,this.votButton.separator2.hidden=!J()||!this.data.showPiPButton})()})),this.votM3u8ProxyHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.m3u8ProxyHost=t.target.value||i.se,await h.set("m3u8ProxyHost",this.data.m3u8ProxyHost),u.A.log("m3u8ProxyHost value changed. New value: ",this.data.m3u8ProxyHost)})()})),this.votProxyWorkerHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.proxyWorkerHost=t.target.value||i.Pm,await h.set("proxyWorkerHost",this.data.proxyWorkerHost),u.A.log("proxyWorkerHost value changed. New value: ",this.data.proxyWorkerHost),window.location.reload()})()})),this.votAudioProxyCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioProxy=Number(t.target.checked),await h.set("audioProxy",this.data.audioProxy),u.A.log("audioProxy value changed. New value: ",this.data.audioProxy)})()})),this.votResetSettingsButton.addEventListener("click",(()=>{(async()=>{g.reset();(await h.list()).filter((t=>!g.gmValues.includes(t))).forEach((t=>h.syncDelete(t))),window.location.reload()})()}))}releaseExtraEvents(){clearInterval(this.resizeInterval),this.resizeObserver?.disconnect(),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.syncVolumeObserver?.disconnect(),this.extraEvents?.forEach((t=>{t.element.removeEventListener(t.event,t.handler)}))}initExtraEvents(){this.extraEvents=[];const t=(t,e,o)=>{this.extraEvents.push({element:t,event:e,handler:o}),t.addEventListener(e,o)},e=(e,o,n)=>{o.forEach((o=>{t(e,o,n)}))};if(this.resizeObserver=new ResizeObserver((t=>{t.forEach((t=>{this.votMenu.container.setAttribute("style",`--vot-container-height: ${t.contentRect.height}px`)}))})),this.resizeObserver.observe(this.video),this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`),this.resizeInterval=setInterval((()=>{this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`)}),500),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData){this.syncVolumeObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"aria-valuenow"===t.attributeName&&this.syncVideoVolumeSlider()}))}));const t=document.querySelector(".ytp-volume-panel");t&&this.syncVolumeObserver.observe(t,{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0})}let o;document.addEventListener("click",(t=>{const e=t.target,o=this.votButton.container,n=this.votMenu.container,a=this.container,i=this.votSettingsDialog.container,r=document.querySelector(".vot-dialog-temp"),s=o.contains(e),l=n.contains(e),d=a.contains(e),c=i.contains(e),h=r?.contains(e)??!1;u.A.log(`[document click] ${s} ${l} ${d} ${c} ${h}`),s||l||c||h||(d||this.logout(0),this.votMenu.container.hidden=!0)})),o="pornhub"===this.site.host?"embed"===this.site.additionalData?document.querySelector("#player"):this.container.querySelector(".video-element-wrapper-js > div"):"twitter"===this.site.host?document.querySelector('div[data-testid="videoPlayer"]'):"yandexdisk"===this.site.host?document.querySelector(".video-player__player"):this.container,o&&e(o,["mousemove","mouseout"],this.resetTimerBound),t(this.votButton.container,"mousemove",this.changeOpacityOnEventBound),t(this.votMenu.container,"mousemove",this.changeOpacityOnEventBound),e(document,["touchstart","touchmove","touchend"],this.changeOpacityOnEventBound),t(this.votButton.container,"mousedown",(t=>{t.stopImmediatePropagation()})),t(this.votMenu.container,"mousedown",(t=>{t.stopImmediatePropagation()})),"youtube"===this.site.host&&(this.container.draggable=!1),t(this.video,"emptied",(()=>{u.A.log("lipsync mode is emptied"),this.stopTranslation()})),t(this.video,"progress",(async()=>{if(this.firstPlay&&1===this.data.autoTranslate&&Z(this.site.host,this.video)===this.videoData.videoId){if(!this.videoData.videoId)throw new _("VOTNoVideoIDFound");try{this.firstPlay=!1,await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t),this.firstPlay=!1}}}))}logout(t){this.votMenu.container.hidden&&(this.votButton.container.style.opacity=t)}resetTimer(){clearTimeout(this.timer),this.logout(1),this.timer=setTimeout((()=>{this.logout(0)}),1e3)}changeOpacityOnEvent(t){clearTimeout(this.timer),this.logout(1),t.stopPropagation()}async changeSubtitlesLang(t){if(u.A.log("[onchange] subtitles",t),this.votSubtitlesSelect.setSelected(t),"disabled"===t)this.votSubtitlesSelect.setTitle(g.get("VOTSubtitlesDisabled")),this.subtitlesWidget.setContent(null),this.votDownloadSubtitlesButton.hidden=!0,this.downloadSubtitlesUrl=null;else{const e=await xt(this.subtitlesList.at(parseInt(t)));this.subtitlesWidget.setContent(e),this.votDownloadSubtitlesButton.hidden=!1,this.downloadSubtitlesUrl=this.subtitlesList.at(parseInt(t))?.url}}async updateSubtitlesLangSelect(){const t=[{label:g.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1},...this.subtitlesList.map(((t,e)=>({label:(g.get("langs")[t.language]??t.language.toUpperCase())+(t.translatedFromLanguage?` ${g.get("VOTTranslatedFrom")} ${g.get("langs")[t.translatedFromLanguage]??t.translatedFromLanguage.toUpperCase()}`:"")+("yandex"!==t.source?` ${t.source}`:"")+(t.isAutoGenerated?` (${g.get("VOTAutogenerated")})`:""),value:e,selected:!1,disabled:!1})))];this.votSubtitlesSelect.updateItems(t),await this.changeSubtitlesLang(t[0].value)}async updateSubtitles(){if(await this.changeSubtitlesLang("disabled"),!this.videoData.videoId)return console.error(`[VOT] ${g.getDefault("VOTNoVideoIDFound")}`),this.subtitlesList=[],this.subtitlesListVideoId=null,void await this.updateSubtitlesLangSelect();this.subtitlesListVideoId!==this.videoData.videoId&&(this.subtitlesList=await async function(t,e,o){const n="youtube"===t.host?W.getSubtitles():[];let a=!1;const i=[...await Promise.race([new Promise((t=>{setTimeout((()=>{a||(console.error("[VOT] Failed get yandex subtitles. Reason: timeout"),t([]))}),5e3)})),new Promise((n=>{ft(`${t.url}${e}`,o,((t,e)=>{u.A.log("[exec callback] Requesting video subtitles"),t||(console.error("[VOT] Failed get yandex subtitles"),a=!0,n([]));const o=ut.decodeSubtitlesResponse(e);console.log("[VOT] Subtitles response: ",o);let i=o.subtitles??[];i=i.reduce(((t,e)=>(e.language&&!t.find((t=>{if("yandex"===t.source&&t.language===e.language&&!t.translatedFromLanguage)return t}))&&t.push({source:"yandex",language:e.language,url:e.url}),e.translatedLanguage&&t.push({source:"yandex",language:e.translatedLanguage,translatedFromLanguage:e.language,url:e.translatedUrl}),t)),[]),a=!0,n(i)}))}))]),...n].sort(((t,e)=>{if(t.source!==e.source)return"yandex"===t.source?-1:1;if(t.language!==e.language&&(t.language===Y||e.language===Y))return t.language===Y?-1:1;if("yandex"===t.source){if(t.translatedFromLanguage!==e.translatedFromLanguage)return t.translatedFromLanguage&&e.translatedFromLanguage?t.translatedFromLanguage===o?-1:1:t.language===e.language?t.translatedFromLanguage?1:-1:t.translatedFromLanguage?-1:1;if(!t.translatedFromLanguage)return t.language===o?-1:1}return"youtube"===t.source&&t.isAutoGenerated!==e.isAutoGenerated?t.isAutoGenerated?1:-1:0}));return console.log("[VOT] subtitles list",i),i}(this.site,this.videoData.videoId,this.videoData.detectedLanguage),this.subtitlesList?this.subtitlesListVideoId=this.videoData.videoId:await this.changeSubtitlesLang("disabled"),await this.updateSubtitlesLangSelect())}getVideoVolume(){let t=this.video?.volume;return["youtube","googledrive"].includes(this.site.host)&&(t=W.getVideoVolume()||t),t}setVideoVolume(t){if(["youtube","googledrive"].includes(this.site.host)){if(W.setVideoVolume(t))return}this.video.volume=t}syncVideoVolumeSlider(){const t=Math.round(100*this.getVideoVolume());this.votVideoVolumeSlider.input.value=t,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${t}%`,F.updateSlider(this.votVideoVolumeSlider.input),1===this.data.syncVolume&&(this.tempOriginalVolume=Number(t))}setSelectMenuValues(t,e){this.votTranslationLanguageSelect.fromSelect.setTitle(g.get("langs")[t]),this.votTranslationLanguageSelect.toSelect.setTitle(g.get("langs")[e]),this.votTranslationLanguageSelect.fromSelect.setSelected(t),this.votTranslationLanguageSelect.toSelect.setSelected(e),console.log(`[VOT] Set translation from ${t} to ${e}`),this.videoData.detectedLanguage=t,this.videoData.responseLanguage=e}syncTranslationWithVideo(t){const e=Number(this.votVideoVolumeSlider.input.value),o=X(this.video,t,e,this.tempVolume);this.votVideoVolumeSlider.input.value=o,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${o}%`,F.updateSlider(this.votVideoVolumeSlider.input),this.tempOriginalVolume=o,this.tempVolume=t}async getVideoData(){const t={translationHelp:null,isStream:!1,duration:this.video?.duration||343,videoId:Z(this.site.host,this.video),detectedLanguage:this.translateFromLang,responseLanguage:this.translateToLang};if(!t.videoId)return this.ytData={},t;if(window.location.hostname.includes("youtube.com"))this.ytData=await W.getVideoData(),t.isStream=this.ytData.isLive,""!==this.ytData.author&&(t.detectedLanguage=this.ytData.detectedLanguage,t.responseLanguage=this.translateToLang);else if(window.location.hostname.includes("rutube")||window.location.hostname.includes("ok.ru")||window.location.hostname.includes("my.mail.ru"))t.detectedLanguage="ru";else if(["bilibili","youku"].includes(this.site.host))t.detectedLanguage="zh";else if(["vk"].includes(this.site.host)){const e=document.getElementsByTagName("track")?.[0]?.srclang;t.detectedLanguage=e||"auto"}else if(window.location.hostname.includes("coursera.org")){const e=await Mt.getVideoData(this.translateToLang);t.duration=e.duration||t.duration,t.detectedLanguage=e.detectedLanguage,t.translationHelp=e.translationHelp}else if(window.location.hostname.includes("coursehunter.net")){const e=await kt.getVideoData();t.translationHelp={url:e.url},t.duration=e.duration||t.duration}else if(window.location.hostname.includes("banned.video")){const e=await _t.getVideoData(t.videoId);t.translationHelp={url:e.url},t.duration=e.duration||t.duration,t.isStream=e.live}else if(window.location.hostname.includes("weverse.io")){const e=await $t.getVideoData();t.detectedLanguage="ko",e&&(t.translationHelp={url:e.url},t.duration=e.duration||t.duration)}else if(window.location.hostname.includes("udemy.com")){const e=await Ft.getVideoData(this.data.udemyData,this.translateToLang);t.duration=e.duration||t.duration,t.detectedLanguage=e.detectedLanguage,t.translationHelp=e.translationHelp}else["piped","invidious","bitchute","rumble","peertube","dailymotion","trovo","yandexdisk","coursehunter"].includes(this.site.host)&&(t.detectedLanguage="auto");return t}videoValidator(){if(["youtube","ok.ru","vk"].includes(this.site.host)){if(u.A.log("VideoValidator videoData: ",this.videoData),1===this.data.dontTranslateYourLang&&this.videoData.detectedLanguage===this.data.dontTranslateLanguage&&this.videoData.responseLanguage===this.data.dontTranslateLanguage)throw new _("VOTDisableFromYourLang");if(!this.videoData.isStream&&this.videoData.duration>14400)throw new _("VOTVideoIsTooLong")}return!0}lipSync(t=!1){if(u.A.log("lipsync video",this.video),this.video)if(this.audio.currentTime=this.video.currentTime,this.audio.playbackRate=this.video.playbackRate,t)if("play"!=t)["pause","stop","waiting"].includes(t)&&(u.A.log(`lipsync mode is ${t}`),this.audio.pause()),"playing"==t&&(u.A.log("lipsync mode is playing"),this.audio.play());else{u.A.log("lipsync mode is play");const t=this.audio.play();void 0!==t&&t.catch((t=>{if(console.error("[VOT]",t),"NotAllowedError"===t.name)throw this.transformBtn("error",g.get("grantPermissionToAutoPlay")),new _("grantPermissionToAutoPlay");if("NotSupportedError"===t.name)throw this.transformBtn("error",Wt.includes(window.location.hostname)?g.get("neededAdditionalExtension"):g.get("audioFormatNotSupported")),Wt.includes(window.location.hostname)?new _("neededAdditionalExtension"):new _("audioFormatNotSupported")}))}else u.A.log("lipsync mode is not set")}handleVideoEvent(t){u.A.log(`video ${t.type}`),this.lipSync(t.type)}stopTranslate(){Gt.forEach((t=>this.video.removeEventListener(t,this.handleVideoEventBound))),this.audio.pause(),this.audio.src="",this.audio.removeAttribute("src"),this.votVideoVolumeSlider.container.hidden=!0,this.votVideoTranslationVolumeSlider.container.hidden=!0,this.votDownloadButton.hidden=!0,this.downloadTranslationUrl=null,this.transformBtn("none",g.get("translateVideo")),u.A.log(`Volume on start: ${this.volumeOnStart}`),this.volumeOnStart&&this.setVideoVolume(this.volumeOnStart),this.volumeOnStart="",clearInterval(this.streamPing),this.hls?.destroy(),this.hls=Q()}async translateExecutor(t){u.A.log("Run translateFunc"),this.translateFunc(t,this.videoData.isStream,this.videoData.detectedLanguage,this.videoData.responseLanguage,this.videoData.translationHelp)}async updateTranslationErrorMsg(t){const e=g.get("translationTake"),o=g.get("VOTTranslatingError"),n=g.lang;if("VOTLocalizedError"===t?.name)this.transformBtn("error",t.localizedMessage);else if(1!==this.data.translateAPIErrors||t.includes(e)||"ru"===n)this.transformBtn("error",t);else{const e=await async function(t,e="",o="ru"){if("yandex"===await h.get("translationService",i.mE)){const n=e&&o?`${e}-${o}`:o;return await q.translate(t,n)}return t}(t,"ru",n);this.transformBtn("error",o),this.transformBtn("error",e)}}afterUpdateTranslation(t){this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,1===this.data.autoSetVolumeYandexStyle&&(this.votVideoVolumeSlider.input.value=100*this.data.autoVolume,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=100*this.data.autoVolume+"%",F.updateSlider(this.votVideoVolumeSlider.input)),this.votDownloadButton.hidden=!1,this.downloadTranslationUrl=t}updateTranslation(t){if(this.audio.src=t,this.volumeOnStart=this.getVideoVolume(),"number"==typeof this.data.defaultVolume&&(this.audio.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume),"twitter"===this.site.host)document.querySelector('div[data-testid="app-bar-back"][role="button"]').addEventListener("click",this.stopTranslationBound);this.video&&!this.video.paused&&this.lipSync("play"),Gt.forEach((t=>this.video.addEventListener(t,this.handleVideoEventBound))),this.transformBtn("success",g.get("disableTranslate")),this.afterUpdateTranslation(t)}translateFunc(t,e,o,n,a){console.log("[VOT] Video Data: ",this.videoData);const i=a?.url?a.url:`${this.site.url}${t}`;if(u.A.log("Run videoValidator"),this.videoValidator(),e)return u.A.log("Executed stream translation"),void function(t,e,o,n){u.A.log(`Translate stream (url: ${t}, requestLang: ${e}, responseLang: ${o})`),mt(t,e,o,((t,e)=>{if(u.A.log("[exec callback] Requesting stream translation"),!t)return void n(!1,g.get("requestTranslationFailed"));const o=ut.decodeStreamResponse(e);switch(console.log("[VOT] Stream Translation response: ",o),o.interval){case 10:n(!1,o.interval,g.get("translationTakeFewMinutes"));break;case 20:n(!0,o.interval,o||g.get("audioNotReceived"));break;case 0:n(!1,o.interval,g.get("streamNoConnectionToServer"))}}))}(i,o,n,(async(i,r,s)=>{if(u.A.log("[exec callback] translateStream callback"),Z(this.site.host,this.video)!==t)return;if(!i||!s.translatedInfo)return await this.updateTranslationErrorMsg(s),void(10===r&&(clearTimeout(this.autoRetry),this.autoRetry=setTimeout((()=>this.translateFunc(t,e,o,n,a)),1e3*r)));this.transformBtn("success",g.get("disableTranslate")),console.log(s);const l=s.pingId;u.A.log(`Stream pingId: ${l}`),this.streamPing=setInterval((async()=>await vt(l,(t=>u.A.log("Stream ping result: ",t)))),1e3*r),u.A.log(s.translatedInfo.url);const d=`https://${this.data.m3u8ProxyHost}/?all=yes&origin=${encodeURIComponent("https://strm.yandex.ru")}&referer=${encodeURIComponent("https://strm.yandex.ru")}&url=${encodeURIComponent(s.translatedInfo.url)}`;if(u.A.log(d),this.hls)this.hls.on(Hls.Events.MEDIA_ATTACHED,(function(){u.A.log("audio and hls.js are now bound together !")})),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(t){u.A.log("manifest loaded, found "+t?.levels?.length+" quality level")})),this.hls.loadSource(d),this.hls.attachMedia(this.audio),this.hls.on(Hls.Events.ERROR,(function(t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),this.hls.recoverMediaError();break;case Hls.ErrorTypes.NETWORK_ERROR:console.error("fatal network error encountered",t);break;default:this.hls.destroy()}})),u.A.log(this.hls);else{if(!this.audio.canPlayType("application/vnd.apple.mpegurl"))throw new _("audioFormatNotSupported");this.audio.src=d}"youtube"===this.site.host&&W.videoSeek(this.video,10),this.volumeOnStart=this.getVideoVolume(),"number"==typeof this.data.defaultVolume&&(this.audio.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume),this.video.src||this.video.currentSrc||this.video.srcObject?(this.video&&!this.video.paused&&this.lipSync("play"),Gt.forEach((t=>this.video.addEventListener(t,this.handleVideoEventBound))),this.afterUpdateTranslation(d)):this.stopTranslation()}));if(["udemy","coursera"].includes(this.site.host)&&!a)throw new _("VOTTranslationHelpNull");const r=this.videoTranslations.find((e=>e.videoId===t&&e.expires>Date.now()/1e3&&e.from===o&&e.to===n));if(r)return this.updateTranslation(r.url),void u.A.log("[translateFunc] A cached translate was received");Zt(i,this.videoData.duration,o,n,a,(async(i,r)=>{if(u.A.log("[exec callback] translateVideo callback"),Z(this.site.host,this.video)===t){if(!i)return await this.updateTranslationErrorMsg(r),r.includes(g.get("translationTake"))&&(clearTimeout(this.autoRetry),this.autoRetry=setTimeout((()=>this.translateFunc(t,e,o,n,a)),6e4)),void console.error("[VOT]",r);this.updateTranslation(r),this.videoTranslations.push({videoId:t,from:o,to:n,url:r,expires:Date.now()/1e3+this.videoTranslationTTL})}}))}stopTranslation(){this.stopTranslate(),this.syncVideoVolumeSlider()}async handleSrcChanged(){u.A.log("[VideoHandler] src changed",this),this.stopTranslation(),this.firstPlay=!0,this.videoData=await this.getVideoData(),this.videoData.detectedLanguage&&this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage);const t=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=t,t&&(this.votMenu.container.hidden=t),this.site.selector||(this.container=this.video.parentElement),this.container.contains(this.votButton.container)||(this.container.appendChild(this.votButton.container),this.container.appendChild(this.votMenu.container)),await this.updateSubtitles(),await this.changeSubtitlesLang("disabled"),this.translateToLang=this.data.responseLanguage??"ru"}async release(){u.A.log("[VideoHandler] release"),this.initialized=!1,this.stopTranslation(),this.releaseExtraEvents(),this.subtitlesWidget.release(),this.votButton.container.remove(),this.votMenu.container.remove()}}const Jt=new class{constructor(){this.onVideoAdded=new Ht,this.onVideoRemoved=new Ht,this.handleVideoAddedBound=this.handleVideoAdded.bind(this),this.handleVideoRemovedBound=this.handleVideoRemoved.bind(this),this.observer=new MutationObserver((t=>{window.requestIdleCallback((()=>{t.forEach((t=>{"childList"===t.type&&(jt(t.addedNodes).forEach(this.handleVideoAddedBound),jt(t.removedNodes).forEach(this.handleVideoRemovedBound))}))}),{timeout:1e3})}))}enable(){this.observer.observe(document,{childList:!0,subtree:!0}),document.querySelectorAll("video").forEach(this.handleVideoAddedBound)}disable(){this.observer.disconnect()}handleVideoAdded(t){this.onVideoAdded.dispatch(t)}handleVideoRemoved(t){document.contains(t)||this.onVideoRemoved.dispatch(t)}},Qt=new WeakMap;(async function(){if(u.A.log("Loading extension..."),await g.update(),u.A.log(`Selected menu language: ${g.lang}`),GM_info?.scriptHandler&&d.includes(GM_info.scriptHandler))return console.error(`[VOT] ${g.getDefault("unSupportedExtensionError").replace("{0}",GM_info.scriptHandler)}`),alert(`[VOT] ${g.get("unSupportedExtensionError").replace("{0}",GM_info.scriptHandler)}`);u.A.log("Extension compatibility passed..."),Jt.onVideoAdded.addListener((t=>{for(const e of Nt.filter((t=>{const e=t=>t instanceof RegExp&&t.test(window.location.hostname)||"string"==typeof t&&window.location.hostname.includes(t)||"function"==typeof t&&t(new URL(window.location));return!!(e(t.match)||t.match instanceof Array&&t.match.some((t=>e(t))))&&t.host&&t.url}))){if(!e)continue;let o;if(e.shadowRoot)o=e.selector?Object.values(document.querySelectorAll(e.selector)).find((e=>e.shadowRoot.contains(t))):t.parentElement,o=o&&o.shadowRoot?o.parentElement:o;else{const n=Ut.browser.version.split(".")?.[0];if(e.selector?.includes(":not")&&e.selector?.includes("*")&&n&&("Chrome"===Ut.browser.name&&Number(n)<88||"Firefox"===Ut.browser.name&&Number(n)<84)){const n=e.selector?.split(" *")?.[0];o=n?Object.values(document.querySelectorAll(n)).find((e=>e.contains(t))):t.parentElement}else o=e.selector?Object.values(document.querySelectorAll(e.selector)).find((e=>e.contains(t))):t.parentElement}if(o&&!("rumble"===e.host&&o.querySelector("vot-block")||("peertube"===e.host&&(e.url=window.location.origin),Qt.has(t)))){Qt.set(t,new Kt(t,o,e));break}}})),Jt.onVideoRemoved.addListener((async t=>{Qt.has(t)&&(await Qt.get(t).release(),Qt.delete(t))})),Jt.enable()})().catch((t=>{console.error("[VOT]",t)}))})()})(); \ No newline at end of file +(()=>{var t={"./node_modules/bowser/es5.js":function(t){t.exports=function(t){var e={};function o(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(n,a,function(e){return t[e]}.bind(null,a));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=90)}({17:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n=o(18),a=function(){function t(){}return t.getFirstMatch=function(t,e){var o=e.match(t);return o&&o.length>0&&o[1]||""},t.getSecondMatch=function(t,e){var o=e.match(t);return o&&o.length>1&&o[2]||""},t.matchAndReturnConst=function(t,e,o){if(t.test(e))return o},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,o,n){void 0===n&&(n=!1);var a=t.getVersionPrecision(e),i=t.getVersionPrecision(o),r=Math.max(a,i),s=0,l=t.map([e,o],(function(e){var o=r-t.getVersionPrecision(e),n=e+new Array(o+1).join(".0");return t.map(n.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(n&&(s=r-Math.min(a,i)),r-=1;r>=s;){if(l[0][r]>l[1][r])return 1;if(l[0][r]===l[1][r]){if(r===s)return 0;r-=1}else if(l[0][r]1?a-1:0),r=1;r0){var r=Object.keys(o),l=s.default.find(r,(function(t){return e.isOS(t)}));if(l){var d=this.satisfies(o[l]);if(void 0!==d)return d}var c=s.default.find(r,(function(t){return e.isPlatform(t)}));if(c){var u=this.satisfies(o[c]);if(void 0!==u)return u}}if(i>0){var h=Object.keys(a),p=s.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==p)return this.compareVersion(a[p])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var o=this.getBrowserName().toLowerCase(),n=t.toLowerCase(),a=s.default.getBrowserTypeByAlias(n);return e&&a&&(n=a.toLowerCase()),n===o},e.compareVersion=function(t){var e=[0],o=t,n=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===t[0]||"<"===t[0]?(o=t.substr(1),"="===t[1]?(n=!0,o=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?o=t.substr(1):"~"===t[0]&&(n=!0,o=t.substr(1)),e.indexOf(s.default.compareVersions(a,o,n))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=d,t.exports=e.default},92:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},o=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},o=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},o=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},o=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},o=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},o=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},o=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},o=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},o=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},o=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},o=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},o=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return o&&(e.version=o),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},o=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},o=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},o=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},o=a.default.getFirstMatch(i,t)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},o=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},o=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},o=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},o=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},o=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},o=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},o=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},o=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},o=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e={name:"Android Browser"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},o=a.default.getFirstMatch(i,t);return o&&(e.version=o),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(e,t),version:a.default.getSecondMatch(e,t)}}}];e.default=r,t.exports=e.default},93:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:[/Roku\/DVP/],describe:function(t){var e=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:i.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),o=a.default.getWindowsVersionName(e);return{name:i.OS_MAP.Windows,version:e,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:i.OS_MAP.iOS},o=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return o&&(e.version=o),e}},{test:[/macintosh/i],describe:function(t){var e=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),o=a.default.getMacOSVersionName(e),n={name:i.OS_MAP.MacOS,version:e};return o&&(n.versionName=o),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),o=a.default.getAndroidVersionName(e),n={name:i.OS_MAP.Android,version:e};return o&&(n.versionName=o),n}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),o={name:i.OS_MAP.WebOS};return e&&e.length&&(o.version=e),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||a.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:i.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:i.OS_MAP.PlayStation4,version:e}}}];e.default=r,t.exports=e.default},94:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=a.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",o={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(o.model=e),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),o=t.test(/like (ipod|iphone)/i);return e&&!o},describe:function(t){var e=a.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];e.default=r,t.exports=e.default},95:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var n,a=(n=o(17))&&n.__esModule?n:{default:n},i=o(18),r=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:i.ENGINE_MAP.Blink};var e=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:i.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:i.ENGINE_MAP.Trident},o=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:i.ENGINE_MAP.Presto},o=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=t.test(/gecko/i),o=t.test(/like gecko/i);return e&&!o},describe:function(t){var e={name:i.ENGINE_MAP.Gecko},o=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:i.ENGINE_MAP.WebKit},o=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}}];e.default=r,t.exports=e.default}})},"./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/main.scss":(t,e,o)=>{"use strict";o.d(e,{A:()=>s});var n=o("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),a=o.n(n),i=o("./node_modules/css-loader/dist/runtime/api.js"),r=o.n(i)()(a());r.push([t.id,'.vot-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );--vot-helper-ontheme: var( --vot-ontheme-rgb, var(--vot-onprimary-rgb, 255, 255, 255) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;border-radius:4px;padding:0 16px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-ontheme));background-color:rgb(var(--vot-helper-theme));box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer;transition:box-shadow .2s}.vot-button[hidden]{display:none !important}.vot-button::-moz-focus-inner{border:none}.vot-button::before,.vot-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-button::before{background-color:rgb(var(--vot-helper-ontheme));transition:opacity .2s}.vot-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-button:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.vot-button:hover::before{opacity:.08}.vot-button:active{box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12)}.vot-button:active::after{opacity:.32;background-size:100% 100%;transition:background-size 0s}.vot-button:disabled{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.12);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);box-shadow:none;cursor:initial}.vot-button:disabled::before,.vot-button:disabled::after{opacity:0}.vot-outlined-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:solid 1px;border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.24);border-radius:4px;padding:0 16px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:34px;outline:none;cursor:pointer}.vot-outlined-button[hidden]{display:none !important}.vot-outlined-button::-moz-focus-inner{border:none}.vot-outlined-button::before,.vot-outlined-button::after{content:"";position:absolute;border-radius:3px;top:0;right:0;bottom:0;left:0;opacity:0}.vot-outlined-button::before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-outlined-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-outlined-button:hover::before{opacity:.04}.vot-outlined-button:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-outlined-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-outlined-button:disabled::before,.vot-outlined-button:disabled::after{opacity:0}.vot-text-button{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none;border-radius:4px;padding:0 8px;min-width:64px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;color:rgb(var(--vot-helper-theme));background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer}.vot-text-button[hidden]{display:none !important}.vot-text-button::-moz-focus-inner{border:none}.vot-text-button::before,.vot-text-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-text-button::before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-text-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-text-button:hover::before{opacity:.04}.vot-text-button:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-text-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-text-button:disabled::before,.vot-text-button:disabled::after{opacity:0}.vot-icon-button{--vot-helper-onsurface: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87);position:relative;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none;border-radius:50%;padding:0;width:36px;height:36px;vertical-align:middle;text-align:center;text-overflow:ellipsis;fill:var(--vot-helper-onsurface);color:var(--vot-helper-onsurface);background-color:rgba(0,0,0,0);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;font-weight:500;line-height:36px;outline:none;cursor:pointer}.vot-icon-button[hidden]{display:none !important}.vot-icon-button::-moz-focus-inner{border:none}.vot-icon-button::before,.vot-icon-button::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-icon-button::before{background-color:var(--vot-helper-onsurface);transition:opacity .2s}.vot-icon-button::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity .3s,background-size .4s}.vot-icon-button:hover::before{opacity:.04}.vot-icon-button:active::after{opacity:.32;background-size:100% 100%;transition:background-size 0s,opacity 0s}.vot-icon-button:disabled{background-color:rgba(0,0,0,0);color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);fill:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-icon-button:disabled::before,.vot-icon-button:disabled::after{opacity:0}.vot-textfield{--vot-helper-theme: rgb( var(--vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243)) ) !important;--vot-helper-safari1: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.38 ) !important;--vot-helper-safari2: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;--vot-helper-safari3: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.87 ) !important;position:relative !important;display:inline-block;padding-top:6px !important;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system) !important;font-size:16px !important;line-height:1.5 !important;text-align:start !important}.vot-textfield[hidden]{display:none !important}.vot-textfield>input,.vot-textfield>textarea{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin:0 !important;border-style:solid !important;border-width:1px !important;border-color:rgba(0,0,0,0) var(--vot-helper-safari2) var(--vot-helper-safari2) !important;border-radius:4px !important;padding:15px 13px 15px !important;width:100% !important;height:inherit !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important;-webkit-text-fill-color:currentColor !important;background-color:rgba(0,0,0,0) !important;box-shadow:inset 1px 0 rgba(0,0,0,0),inset -1px 0 rgba(0,0,0,0),inset 0 -1px rgba(0,0,0,0) !important;font-family:inherit !important;font-size:inherit !important;line-height:inherit !important;caret-color:var(--vot-helper-theme) !important;transition:border .2s,box-shadow .2s !important}.vot-textfield>input:not(:focus):placeholder-shown,.vot-textfield>textarea:not(:focus):placeholder-shown{border-top-color:var(--vot-helper-safari2) !important}.vot-textfield>input+span,.vot-textfield>textarea+span{position:absolute !important;top:0 !important;left:0 !important;display:flex !important;width:100% !important;max-height:100% !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;font-size:75% !important;line-height:15px !important;cursor:text !important;transition:color .2s,font-size .2s,line-height .2s !important;pointer-events:none !important}.vot-textfield>input:not(:focus):placeholder-shown+span,.vot-textfield>textarea:not(:focus):placeholder-shown+span{font-size:inherit !important;line-height:68px !important}.vot-textfield>input+span::before,.vot-textfield>input+span::after,.vot-textfield>textarea+span::before,.vot-textfield>textarea+span::after{content:"" !important;display:block !important;-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin-top:6px !important;border-top:solid 1px var(--vot-helper-safari2) !important;min-width:10px !important;height:8px !important;pointer-events:none !important;box-shadow:inset 0 1px rgba(0,0,0,0) !important;transition:border .2s,box-shadow .2s !important}.vot-textfield>input+span::before,.vot-textfield>textarea+span::before{margin-right:4px !important;border-left:solid 1px rgba(0,0,0,0) !important;border-radius:4px 0 !important}.vot-textfield>input+span::after,.vot-textfield>textarea+span::after{flex-grow:1 !important;margin-left:4px !important;border-right:solid 1px rgba(0,0,0,0) !important;border-radius:0 4px !important}.vot-textfield>input:not(:focus):placeholder-shown+span::before,.vot-textfield>input:not(:focus):placeholder-shown+span::after,.vot-textfield>textarea:not(:focus):placeholder-shown+span::before,.vot-textfield>textarea:not(:focus):placeholder-shown+span::after{border-top-color:rgba(0,0,0,0) !important}.vot-textfield:hover>input,.vot-textfield:hover>textarea{border-color:rgba(0,0,0,0) var(--vot-helper-safari3) var(--vot-helper-safari3) !important}.vot-textfield:hover>input+span::before,.vot-textfield:hover>input+span::after,.vot-textfield:hover>textarea+span::before,.vot-textfield:hover>textarea+span::after{border-top-color:var(--vot-helper-safari3) !important}.vot-textfield:hover>input:not(:focus):placeholder-shown,.vot-textfield:hover>textarea:not(:focus):placeholder-shown{border-color:var(--vot-helper-safari3) !important}.vot-textfield>input:focus,.vot-textfield>textarea:focus{border-color:rgba(0,0,0,0) var(--vot-helper-theme) var(--vot-helper-theme) !important;box-shadow:inset 1px 0 var(--vot-helper-theme),inset -1px 0 var(--vot-helper-theme),inset 0 -1px var(--vot-helper-theme) !important;outline:none !important}.vot-textfield>input:focus+span,.vot-textfield>textarea:focus+span{color:var(--vot-helper-theme) !important}.vot-textfield>input:focus+span::before,.vot-textfield>input:focus+span::after,.vot-textfield>textarea:focus+span::before,.vot-textfield>textarea:focus+span::after{border-top-color:var(--vot-helper-theme) !important;box-shadow:inset 0 1px var(--vot-helper-theme) !important}.vot-textfield>input:disabled,.vot-textfield>input:disabled+span,.vot-textfield>textarea:disabled,.vot-textfield>textarea:disabled+span{border-color:rgba(0,0,0,0) var(--vot-helper-safari1) var(--vot-helper-safari1) !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important;pointer-events:none !important}.vot-textfield>input:disabled+span::before,.vot-textfield>input:disabled+span::after,.vot-textfield>textarea:disabled+span::before,.vot-textfield>textarea:disabled+span::after{border-top-color:var(--vot-helper-safari1) !important}.vot-textfield>input:disabled:placeholder-shown,.vot-textfield>input:disabled:placeholder-shown+span,.vot-textfield>textarea:disabled:placeholder-shown,.vot-textfield>textarea:disabled:placeholder-shown+span{border-top-color:var(--vot-helper-safari1) !important}.vot-textfield>input:disabled:placeholder-shown+span::before,.vot-textfield>input:disabled:placeholder-shown+span::after,.vot-textfield>textarea:disabled:placeholder-shown+span::before,.vot-textfield>textarea:disabled:placeholder-shown+span::after{border-top-color:rgba(0,0,0,0) !important}@media not all and (min-resolution: 0.001dpcm){@supports(-webkit-appearance: none){.vot-textfield>input,.vot-textfield>input+span,.vot-textfield>textarea,.vot-textfield>textarea+span,.vot-textfield>input+span::before,.vot-textfield>input+span::after,.vot-textfield>textarea+span::before,.vot-textfield>textarea+span::after{transition-duration:.1s !important}}}.vot-checkbox{--vot-helper-theme: var( --vot-theme-rgb, var(--vot-primary-rgb, 33, 150, 243) );--vot-helper-ontheme: var( --vot-ontheme-rgb, var(--vot-onprimary-rgb, 255, 255, 255) );z-index:0;position:relative;display:inline-block;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;text-align:start}.vot-checkbox[hidden]{display:none !important}.vot-checkbox>input{appearance:none;-moz-appearance:none;-webkit-appearance:none;z-index:1;position:absolute;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:3px 1px;border:solid 2px;background:rgba(0,0,0,0);border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6);border-radius:2px;width:18px;height:18px;outline:none;cursor:pointer;transition:border-color .2s,background-color .2s}.vot-checkbox>input+span{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding-left:30px;width:inherit;cursor:pointer}.vot-checkbox>input+span::before{content:"";position:absolute;left:-10px;top:-8px;display:block;border-radius:50%;width:40px;height:40px;background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0));opacity:0;transform:scale(1);pointer-events:none;transition:opacity .3s,transform .2s}.vot-checkbox>input+span::after{content:"";z-index:1;display:block;position:absolute;top:3px;left:1px;-webkit-box-sizing:content-box !important;-moz-box-sizing:content-box !important;box-sizing:content-box !important;width:10px;height:5px;border:solid 2px rgba(0,0,0,0);border-right-width:0;border-top-width:0;pointer-events:none;transform:translate(3px, 4px) rotate(-45deg);transition:border-color .2s}.vot-checkbox>input:checked,.vot-checkbox>input:indeterminate{border-color:rgb(var(--vot-helper-theme));background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span::before,.vot-checkbox>input:indeterminate+span::before{background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span::after,.vot-checkbox>input:indeterminate+span::after{border-color:rgb(var(--vot-helper-ontheme, 255, 255, 255))}.vot-checkbox>input:indeterminate+span::after{border-left-width:0;transform:translate(4px, 3px)}.vot-checkbox:hover>input+span::before{opacity:.04}.vot-checkbox:active>input,.vot-checkbox:active:hover>input{border-color:rgb(var(--vot-helper-theme))}.vot-checkbox:active>input:checked{border-color:rgba(0,0,0,0);background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6)}.vot-checkbox:active>input+span::before{opacity:1;transform:scale(0);transition:transform 0s,opacity 0s}.vot-checkbox>input:disabled{border-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-checkbox>input:disabled:checked,.vot-checkbox>input:disabled:indeterminate{border-color:rgba(0,0,0,0);background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38)}.vot-checkbox>input:disabled+span{color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38);cursor:initial}.vot-checkbox>input:disabled+span::before{opacity:0;transform:scale(0)}.vot-slider{--vot-safari-helper1: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.04 ) !important;--vot-safari-helper2: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.12 ) !important;--vot-safari-helper3: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.16 ) !important;--vot-safari-helper4: rgba( var(--vot-primary-rgb, 33, 150, 243), 0.24 ) !important;display:inline-block;width:100% !important;color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important;font-family:var(--vot-font, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system) !important;font-size:16px !important;line-height:1.5 !important;text-align:start !important}.vot-slider[hidden]{display:none !important}.vot-slider>input{-webkit-appearance:none !important;appearance:none !important;position:relative !important;top:24px !important;display:block !important;margin:0 0 -36px !important;width:100% !important;height:36px !important;background-color:rgba(0,0,0,0) !important;cursor:pointer !important}.vot-slider>input:last-child{position:static !important;margin:0 !important}.vot-slider>span{display:inline-block !important;margin-bottom:36px !important}.vot-slider>input:disabled{cursor:default !important;opacity:.38 !important}.vot-slider>input:disabled+span{color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input::-webkit-slider-runnable-track{margin:17px 0 !important;border-radius:1px !important;width:100% !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-webkit-slider-thumb{margin:0 !important;appearance:none !important;-webkit-appearance:none !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider:hover>input::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper1) !important}.vot-slider>input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper4) !important}.vot-slider>input:disabled::-webkit-slider-runnable-track{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-webkit-slider-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;color:rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::-moz-range-track{margin:17px 0 !important;border-radius:1px !important;width:100% !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-moz-range-thumb{appearance:none !important;-moz-appearance:none !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider>input::-moz-range-progress{border-radius:1px !important;height:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-slider:hover>input:hover::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.04) !important}.vot-slider>input:active::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input:disabled::-moz-range-track{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-moz-range-progress{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.87) !important}.vot-slider>input:disabled::-moz-range-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::-moz-focus-outer{border:none !important}.vot-slider>input::-ms-track{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important;margin:17px 0 !important;border:none !important;border-radius:1px !important;padding:0 17px !important;width:100% !important;height:2px !important;background-color:rgba(0,0,0,0) !important}.vot-slider>input::-ms-fill-lower{border-radius:1px !important;height:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-slider>input::-ms-fill-upper{border-radius:1px !important;height:2px !important;background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input::-ms-thumb{appearance:none !important;margin:0 17px !important;border:none !important;border-radius:50% !important;height:2px !important;width:2px !important;background-color:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important;transform:scale(6, 6) !important;transition:box-shadow .2s !important}.vot-slider:hover>input::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.04) !important}.vot-slider>input:active::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb, 33, 150, 243), 0.24) !important}.vot-slider>input:disabled::-ms-fill-lower{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important}.vot-slider>input:disabled::-ms-fill-upper{background-color:rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.38) !important;opacity:.38 !important}.vot-slider>input:disabled::-ms-thumb{background-color:rgb(var(--vot-onsurface-rgb, 0, 0, 0)) !important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb, 255, 255, 255)) !important;transform:scale(4, 4) !important}.vot-slider>input::before{content:"" !important;display:block !important;position:absolute !important;width:calc(100%*var(--vot-progress, 0)) !important;height:2px !important;top:calc(50% - 1px) !important;background:rgb(var(--vot-primary-rgb, 33, 150, 243)) !important}.vot-select{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0) !important;--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87) !important;--vot-helper-safari1: rgba(var(--vot-onsurface-rgb, 0, 0, 0), 0.6) !important;--vot-helper-safari2: rgba( var(--vot-onsurface-rgb, 0, 0, 0), 0.87 ) !important;display:flex;align-items:center;justify-content:space-between;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:14px;line-height:1.5;text-align:start;color:var(--vot-helper-theme);fill:var(--vot-helper-theme)}.vot-select[hidden]{display:none !important}.vot-select-label{font-size:16px}.vot-select-outer{display:flex;align-items:center;justify-content:space-between;max-width:120px;width:120px;padding:0 5px;border-style:solid !important;border-width:1px !important;border-color:var(--vot-helper-safari1) !important;border-radius:4px !important;cursor:pointer;transition:border .2s !important}.vot-select-outer:hover{border-color:var(--vot-helper-safari2) !important}.vot-select-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vot-select-arrow-icon{width:20px;height:32px;display:flex;justify-content:center;align-items:center}.vot-select-content-list{display:flex;flex-direction:column}.vot-select-content-list .vot-select-content-item{padding:5px 10px;border-radius:8px;cursor:pointer}.vot-select-content-list .vot-select-content-item:not([inert]):hover{background-color:#2a2c31}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]{color:rgb(var(--vot-primary-rgb, 33, 150, 243));background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.2)}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]:hover{background-color:rgba(var(--vot-primary-rgb, 33, 150, 243), 0.1) !important}.vot-select-content-list .vot-select-content-item[data-vot-disabled=true]{cursor:default}.vot-select-content-list .vot-select-content-item[hidden]{display:none !important}.vot-header{color:rgba(var(--vot-helper-onsurface-rgb), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-weight:bold;line-height:1.5;text-align:start}.vot-header[hidden]{display:none !important}.vot-header:not(:first-child){padding-top:8px}.vot-header-level-1{font-size:2em}.vot-header-level-2{font-size:1.5em}.vot-header-level-3{font-size:1.17em}.vot-header-level-4{font-size:1em}.vot-header-level-5{font-size:.83em}.vot-header-level-6{font-size:.67em}.vot-info{display:flex;color:rgba(var(--vot-helper-onsurface-rgb), 0.87);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;text-align:start}.vot-info[hidden]{display:none !important}.vot-info>:not(:first-child){color:rgba(var(--vot-helper-onsurface-rgb), 0.5);flex:1;margin-left:8px}.vot-lang-select{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87);display:flex;align-items:center;justify-content:space-between;color:var(--vot-helper-theme);fill:var(--vot-helper-theme)}.vot-lang-select[hidden]{display:none !important}.vot-lang-select-icon{width:32px;height:32px;display:flex;justify-content:center;align-items:center}.vot-segmented-button{--vot-helper-theme-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-theme: rgba(var(--vot-helper-theme-rgb), 0.87);overflow:hidden;position:absolute;left:50%;top:5rem;transform:translate(-50%);user-select:none;display:flex;align-items:center;height:32px;max-width:100vw;background:rgb(var(--vot-surface-rgb, 255, 255, 255));color:var(--vot-helper-theme);fill:var(--vot-helper-theme);border-radius:4px;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;cursor:default;transition:opacity .5s;z-index:100}.vot-segmented-button[hidden]{display:none !important}.vot-segmented-button *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-segmented-button .vot-separator{width:1px;height:50%;background:rgba(var(--vot-helper-theme-rgb), 0.1)}.vot-segmented-button .vot-separator[hidden]{display:none !important}.vot-segmented-button .vot-segment,.vot-segmented-button .vot-segment-only-icon{position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;height:100%;padding:0 8px;background-color:rgba(0,0,0,0);color:inherit;transition:background-color 100ms ease-in-out;border:none}.vot-segmented-button .vot-segment[hidden],.vot-segmented-button [hidden].vot-segment-only-icon{display:none !important}.vot-segmented-button .vot-segment::before,.vot-segmented-button .vot-segment-only-icon::before,.vot-segmented-button .vot-segment::after,.vot-segmented-button .vot-segment-only-icon::after{content:"";position:absolute;border-radius:inherit;top:0;right:0;bottom:0;left:0;opacity:0}.vot-segmented-button .vot-segment::before,.vot-segmented-button .vot-segment-only-icon::before{background-color:rgb(var(--vot-helper-theme-rgb));transition:opacity .2s}.vot-segmented-button .vot-segment::after,.vot-segmented-button .vot-segment-only-icon::after{background:radial-gradient(circle at center, currentColor 1%, transparent 1%) center/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-segmented-button .vot-segment:hover::before,.vot-segmented-button .vot-segment-only-icon:hover::before{opacity:.04}.vot-segmented-button .vot-segment:active::after,.vot-segmented-button .vot-segment-only-icon:active::after{opacity:.16;background-size:100% 100%;transition:background-size 0s}.vot-segmented-button .vot-segment-only-icon{min-width:32px;padding:0}.vot-segmented-button .vot-segment-label{margin-left:8px;white-space:nowrap}.vot-segmented-button[data-status=success] .vot-translate-button{color:rgb(var(--vot-primary-rgb, 33, 150, 243));fill:rgb(var(--vot-primary-rgb, 33, 150, 243))}.vot-segmented-button[data-status=error] .vot-translate-button{color:#f28b82;fill:#f28b82}.vot-segmented-button svg{width:fit-content}.vot-menu{--vot-helper-surface-rgb: var(--vot-surface-rgb, 255, 255, 255);--vot-helper-surface: rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-onsurface: rgba(var(--vot-helper-onsurface-rgb), 0.87);overflow:hidden;position:absolute;left:50%;top:calc(5rem + 32px + 16px);user-select:none;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);border-radius:8px;font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;min-width:300px;cursor:default;z-index:100;visibility:visible;opacity:1;transform-origin:top;transform:translate(-50%) scale(1);transition:opacity .3s,transform .1s}.vot-menu *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-menu[hidden]{pointer-events:none;display:block !important;visibility:hidden;opacity:0;transform:translate(-50%) scale(0)}.vot-menu-content-wrapper{display:flex;flex-direction:column;min-height:100px;max-height:calc(var(--vot-container-height, 75vh) - (5rem + 32px + 16px)*2);overflow:auto}.vot-menu-header-container{flex-shrink:0;align-items:flex-start;display:flex;min-height:31px}.vot-menu-header-container:empty{padding:0 0 16px 0}.vot-menu-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-menu-title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:0;text-align:start}.vot-menu-title{flex:1;font-size:16px;line-height:1;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-menu-body-container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto;padding:0 16px;gap:8px;overscroll-behavior:contain;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb), 0.1) var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar,.vot-menu-body-container::-webkit-scrollbar-track{height:12px !important;width:12px !important;background:var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb), 0.1) !important;-webkit-border-radius:1ex !important;border:5px solid var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface) !important}.vot-menu-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface) !important}.vot-menu-footer-container{flex-shrink:0;display:flex;justify-content:flex-end;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-menu-footer-container:empty{padding:16px 0 0 0}.vot-dialog-container{visibility:visible;position:absolute;z-index:10000}.vot-dialog-container[hidden]{display:block !important;pointer-events:none;visibility:hidden}.vot-dialog-container *{-webkit-box-sizing:border-box !important;-moz-box-sizing:border-box !important;box-sizing:border-box !important}.vot-dialog-backdrop{background-color:rgba(0,0,0,.6);position:fixed;top:0;right:0;bottom:0;left:0;opacity:1;transition:opacity .3s}[hidden]>.vot-dialog-backdrop{pointer-events:none;opacity:0}.vot-dialog{--vot-helper-surface-rgb: var(--vot-surface-rgb, 255, 255, 255);--vot-helper-surface: rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb: var(--vot-onsurface-rgb, 0, 0, 0);--vot-helper-onsurface: rgba(var(--vot-helper-onsurface-rgb), 0.87);display:block;position:fixed;top:50%;bottom:50%;max-width:initial;max-height:initial;width:min(var(--vot-dialog-width, 512px),100%);height:fit-content;inset-inline-start:0px;inset-inline-end:0px;inset-block-start:0px;inset-block-end:0px;border-radius:8px;margin:auto;padding:0;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);box-shadow:0 0 16px rgba(0,0,0,.12),0 16px 16px rgba(0,0,0,.24);font-family:var(--vot-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);font-size:16px;line-height:1.5;user-select:none;visibility:visible;overflow:auto;overflow-y:hidden;opacity:1;transform-origin:center;transform:scale(1);transition:opacity .3s,transform .1s}[hidden]>.vot-dialog{pointer-events:none;opacity:0;transform:scale(0.5);transition:opacity .1s,transform .2s}.vot-dialog-content-wrapper{display:flex;flex-direction:column;max-height:75vh;overflow:auto}.vot-dialog-header-container{flex-shrink:0;align-items:flex-start;display:flex;min-height:31px}.vot-dialog-header-container:empty{padding:0 0 20px 0}.vot-dialog-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-dialog-title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:0}.vot-dialog-title{flex:1;font-size:115.3846153846%;font-weight:bold;line-height:1;padding-bottom:16px;padding-inline-end:20px;padding-inline-start:20px;padding-top:20px}.vot-dialog-body-container{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto;padding:0 20px;gap:16px;overscroll-behavior:contain;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb), 0.1) var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar,.vot-dialog-body-container::-webkit-scrollbar-track{height:12px !important;width:12px !important;background:var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb), 0.1) !important;-webkit-border-radius:1ex !important;border:5px solid var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface) !important}.vot-dialog-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface) !important}.vot-dialog-footer-container{flex-shrink:0;display:flex;justify-content:flex-end;padding-bottom:16px;padding-inline-end:16px;padding-inline-start:16px;padding-top:16px}.vot-dialog-footer-container:empty{padding:20px 0 0 0}.vot-subtitles-widget{display:flex;justify-content:center;align-items:center;position:absolute;width:50%;max-height:100%;min-height:20%;z-index:100;left:25%;top:75%;pointer-events:none}.vot-subtitles{position:relative;max-width:100%;max-height:100%;width:max-content;background:var(--vot-subtitles-background, rgba(46, 47, 52, 0.8));color:var(--vot-subtitles-color, rgb(227, 227, 227));border-radius:1rem;pointer-events:all;padding:1rem;font-size:2rem;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vot-subtitles .passed{color:var(--vot-subtitles-passed-color, rgb(33, 150, 243))}:root{--vot-font-family: "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system;--vot-primary-rgb: 139, 180, 245;--vot-onprimary-rgb: 32, 33, 36;--vot-surface-rgb: 32, 33, 36;--vot-onsurface-rgb: 227, 227, 227;--vot-subtitles-background: rgba(var(--vot-surface-rgb, 46, 47, 52), 0.8);--vot-subtitles-color: rgb(var(--vot-onsurface-rgb, 227, 227, 227));--vot-subtitles-passed-color: rgb(var(--vot-primary-rgb, 33, 150, 243))}vot-block{display:block}',""]);const s=r},"./node_modules/css-loader/dist/runtime/api.js":t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(t,o,n,a,i){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(n)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),a&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=a):c[4]="".concat(a)),e.push(c))}},e}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":t=>{"use strict";t.exports=function(t){return t[1]}},"./node_modules/requestidlecallback-polyfill/index.js":()=>{window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)},window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":t=>{"use strict";var e=[];function o(t){for(var o=-1,n=0;n{"use strict";var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(t,e,o)=>{"use strict";t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var n="";o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var a=void 0!==o.layer;a&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,a&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}");var i=o.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},"./node_modules/webpack-monkey/lib/node/deps/style-loader-insertStyleElement.js":t=>{t.exports=function(){return function(t){return t.styleTagTransform=function(t,e){e?.remove(),GM_addStyle(t)},document.createElement("style")}.apply(null,arguments)}},"./src/config/config.js":(t,e,o)=>{"use strict";o.d(e,{Cc:()=>s,JD:()=>l,K2:()=>c,Pm:()=>i,QL:()=>u,S7:()=>r,mE:()=>d,rl:()=>n,rw:()=>h,se:()=>a});const n="api.browser.yandex.ru",a="m3u8-proxy.toil.cc",i="vot.toil.cc",r="xtGCyGdTY2Jy6OMEKdTuXev3Twhkamgm",s="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 YaBrowser/23.7.1.1140 Yowser/2.5 Safari/537.36",l=.15,d="yandex",c="yandex",u={yandex:"https://translate.toil.cc/detect",rustServer:"https://rust-server-531j.onrender.com/detect"},h={yandex:"https://translate.toil.cc/translate"}},"./src/utils/debug.js":(t,e,o)=>{"use strict";o.d(e,{A:()=>a});const n={log:(...t)=>{}},a=n},"./src/yandexRequest.js":(t,e,o)=>{"use strict";o.r(e),o.d(e,{default:()=>i});var n=o("./src/config/config.js"),a=o("./src/utils/debug.js");const i=async function(t,e,o,i){try{a.A.log("yandexRequest:",t);const r={url:`https://${n.rl}${t}`,method:"POST",headers:{Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf","User-Agent":n.Cc,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,...o},binary:!0,data:new Blob([e]),responseType:"arraybuffer"};GM_xmlhttpRequest({...r,onload:t=>{a.A.log("yandexRequest:",t.status,t),i(200===t.status,t.response)},onerror:t=>{console.error("[VOT]",t),i(!1)}})}catch(t){console.error("[VOT]",t),i(!1)}}}},e={};function o(n){var a=e[n];if(void 0!==a)return a.exports;var i=e[n]={id:n,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nc=void 0,(()=>{"use strict";const t=["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"],e=["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"],n=["proxitok.pabloferreiro.es","proxitok.pussthecat.org","tok.habedieeh.re","proxitok.esmailelbob.xyz","proxitok.privacydev.net","tok.artemislena.eu","tok.adminforge.de","tik.hostux.net","tt.vern.cc","cringe.whatever.social","proxitok.lunar.icu","proxitok.privacy.com.de"],a=["peertube.1312.media","tube.shanti.cafe","bee-tube.fr","video.sadmin.io","dalek.zone","review.peertube.biz","peervideo.club","tube.la-dina.net","peertube.tmp.rcp.tf"];var i=o("./src/config/config.js");const r=["ru","en","zh","ko","lt","lv","ar","fr","it","es","de","ja"],s=["kk","bn","pt","cs","hi","mr","te","tr","ms","vi","ta","jv","ur","fa","gu","id","uk","da","fi","uz","pl","sv","az","sq","am","hy","af","eu","my","bg","bs","cy","hu","gl","el","zu","kn","ca","km","lo","mk","ml","mt","mn","ne","nl","pa","ro","sr","si","sk","sl","sw","su","hr","et"],l=["ru","en","kk"],d=["Violentmonkey","FireMonkey","Greasemonkey","AdGuard","OrangeMonkey"],c=JSON.parse('{"__version__":3,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","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! {0} 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":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyAccessTokenExpired":"Your entered Udemy Access Token has expired","udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","enterUdemyAccessToken":"Enter Udemy Access Token","VOTUdemyData":"Udemy Data","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings"}');var u=o("./src/utils/debug.js");const h=new class{constructor(){this.gmSupport="function"==typeof GM_getValue,u.A.log(`GM Storage Status: ${this.gmSupport}`)}syncGet(t,e=void 0,o=!1){if(this.gmSupport)return GM_getValue(t,e);let n=window.localStorage.getItem(t);if("udemyData"===t&&"string"==typeof n)try{n=JSON.parse(n)}catch{n=e}return o?Number(n)??Number(e):n??e}async get(t,e=void 0,o=!1){return this.gmSupport?await GM_getValue(t,e):Promise.resolve(this.syncGet(t,e,o))}syncSet(t,e){return this.gmSupport?GM_setValue(t,e):("udemyData"===t&&(e=JSON.stringify(e)),window.localStorage.setItem(t,e))}async set(t,e){return this.gmSupport?await GM_setValue(t,e):Promise.resolve(this.syncSet(t,e))}syncDelete(t){return this.gmSupport?GM_deleteValue(t):window.localStorage.removeItem(t)}async delete(t){return this.gmSupport?await GM_deleteValue(t):Promise.resolve(this.syncDelete(t))}syncList(){return this.gmSupport?GM_listValues():["autoTranslate","dontTranslateLanguage","dontTranslateYourLang","autoSetVolumeYandexStyle","showVideoSlider","syncVolume","subtitlesMaxLength","highlightWords","responseLanguage","defaultVolume","udemyData","audioProxy","showPiPButton","locale-version","locale-lang","locale-phrases"]}async list(){return this.gmSupport?await GM_listValues():Promise.resolve(this.syncList())}},p=["auto","en","ru","af","am","ar","az","bg","bn","bs","ca","cs","cy","da","de","el","es","et","eu","fa","fi","fr","gl","hi","hr","hu","hy","id","it","ja","jv","kk","km","kn","ko","lo","mk","ml","mn","ms","mt","my","ne","nl","pa","pl","pt","ro","si","sk","sl","sq","sr","su","sv","sw","tr","uk","ur","uz","vi","zh","zu"],g=new class{lang="en";locale={};gmValues=["locale-phrases","locale-lang","locale-version","locale-lang-override"];constructor(){const t=h.syncGet("locale-lang-override","auto");this.lang=t&&"auto"!==t?t:(navigator.language||navigator.userLanguage)?.substr(0,2)?.toLowerCase()??"en",this.setLocaleFromJsonString(h.syncGet("locale-phrases",""))}reset(){this.gmValues.forEach((t=>h.syncDelete(t)))}async update(t=!1){(t||2!==await h.get("locale-version",0,!0)||await h.get("locale-lang")!==this.lang)&&(u.A.log("Updating locale..."),await fetch(`https://raw.githubusercontent.com/ilyhalight/voice-over-translation/master/src/localization/locales/${this.lang}.json`).then((t=>{if(200===t.status)return t.text();throw t.status})).then((async t=>{await h.set("locale-phrases",t),this.setLocaleFromJsonString(t);const e=this.getFromLocale(this.locale,"__version__");"number"==typeof e&&await h.set("locale-version",e),await h.set("locale-lang",this.lang)})).catch((async t=>{console.error("[VOT] [localizationProvider] failed get locale, cause:",t),this.setLocaleFromJsonString(await h.get("locale-phrases",""))})))}setLocaleFromJsonString(t){try{this.locale=JSON.parse(t)??{}}catch(t){console.error("[VOT] [localizationProvider]",t),this.locale={}}}getFromLocale(t,e){const o=e.split(".").reduce(((t,e)=>{if("object"==typeof t&&t)return t[e]}),t);return void 0===o&&console.warn("[VOT] [localizationProvider] locale",t,"doesn't contain key",e),o}getDefault(t){return this.getFromLocale(c,t)??t}get(t){return this.getFromLocale(this.locale,t)??this.getFromLocale(c,t)??t}};var v=o("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),m=o.n(v),b=o("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),f=o.n(b),y=o("./node_modules/style-loader/dist/runtime/insertBySelector.js"),w=o.n(y),x=o("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),S=o.n(x),k=o("./node_modules/webpack-monkey/lib/node/deps/style-loader-insertStyleElement.js"),T=o.n(k),V=o("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),M=o.n(V),L=o("./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/main.scss"),A={};A.styleTagTransform=M(),A.setAttributes=S(),A.insert=w().bind(null,"head"),A.domAPI=f(),A.insertStyleElement=T();m()(L.A,A);L.A&&L.A.locals&&L.A.locals;function P(t){const e=document.createElement("vot-block");return e.classList.add("vot-icon-button"),e.innerHTML=t,e}function E(t){const e=parseFloat(t.value),o=""===t.min?0:parseFloat(t.min),n=(e-o)/((""===t.max?100:parseFloat(t.max))-o);t.parentElement.setAttribute("style",`--vot-progress: ${n}`)}function O(t,e="",o=" ",n=!1){const a=document.createElement("vot-block");a.classList.add("vot-textfield");const i=document.createElement(n?"textarea":"input");i.placeholder=o,i.value=e;const r=document.createElement("span");return r.innerHTML=t,a.appendChild(i),a.appendChild(r),{container:a,input:i,label:r}}function C(t){const e=document.createElement("vot-block");e.classList.add("vot-dialog-container"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-dialog-backdrop");const n=document.createElement("vot-block");n.classList.add("vot-dialog");const a=document.createElement("vot-block");a.classList.add("vot-dialog-content-wrapper");const i=document.createElement("vot-block");i.classList.add("vot-dialog-header-container");const r=document.createElement("vot-block");r.classList.add("vot-dialog-body-container");const s=document.createElement("vot-block");s.classList.add("vot-dialog-footer-container");const l=document.createElement("vot-block");l.classList.add("vot-dialog-title-container");const d=P('');d.classList.add("vot-dialog-close-button"),o.onclick=d.onclick=()=>{e.hidden=!0};const c=document.createElement("vot-block");return c.classList.add("vot-dialog-title"),c.innerHTML=t,e.appendChild(o),e.appendChild(n),n.appendChild(a),a.appendChild(i),a.appendChild(r),a.appendChild(s),i.appendChild(l),i.appendChild(d),l.appendChild(c),{container:e,backdrop:o,dialog:n,contentWrapper:a,headerContainer:i,bodyContainer:r,footerContainer:s,titleContainer:l,closeButton:d,title:c}}function B(t,e,o,n={}){const a=n.onSelectCb||function(){},i=n.labelElement||"";let r=[];const s=document.createElement("vot-block");s.classList.add("vot-select"),i&&s.appendChild(i);const l=document.createElement("vot-block");l.classList.add("vot-select-outer");const d=document.createElement("span");d.classList.add("vot-select-title"),d.innerText=t,void 0===t&&(d.innerText=o.find((t=>!0===t.selected))?.label);const c=document.createElement("vot-block");c.classList.add("vot-select-arrow-icon"),c.innerHTML='',l.append(d,c),l.onclick=()=>{const t=C(e);t.container.classList.add("vot-dialog-temp"),t.container.hidden=!1,document.documentElement.appendChild(t.container);const n=document.createElement("vot-block");n.classList.add("vot-select-content-list");for(const t of o){const e=document.createElement("vot-block");e.classList.add("vot-select-content-item"),e.innerText=t.label,e.dataset.votSelected=t.selected,e.dataset.votValue=t.value,t.disabled&&(e.inert=!0),e.onclick=async i=>{if(i.target.inert)return;n.childNodes.forEach((t=>t.dataset.votSelected=!1)),o.forEach((e=>e.selected=e.value===t.value)),e.dataset.votSelected=!0,d.innerText=t.label,await a(i)},n.appendChild(e)}const i=O(g.get("searchField"));i.input.oninput=t=>{const e=t.target.value.toLowerCase();Array.from(r).forEach((t=>t.hidden=!t.innerText.toLowerCase().includes(e)))},t.bodyContainer.append(i.container,n),r=n.childNodes,t.backdrop.onclick=t.closeButton.onclick=()=>{t.container.remove(),r=[]}},s.append(l);return{container:s,title:d,arrowIcon:c,labelElement:i,setTitle:t=>{d.innerText=t},setSelected:t=>{Array.from(r).filter((t=>!t.inert)).forEach((e=>e.dataset.votSelected=e.dataset.votValue===t)),o.forEach((e=>e.selected=String(e.value)===t))},updateItems:t=>{o=t}}}const F={createHeader:function(t,e=4){const o=document.createElement("vot-block");return o.classList.add("vot-header"),o.classList.add(`vot-header-level-${e}`),o.innerHTML=t,o},createInformation:function(t,e){const o=document.createElement("vot-block");o.classList.add("vot-info");const n=document.createElement("vot-block");n.innerHTML=t;const a=document.createElement("vot-block");return a.innerHTML=e,o.appendChild(n),o.appendChild(a),{container:o,header:n,value:a}},createButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-button"),e.innerHTML=t,e},createTextButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-text-button"),e.innerHTML=t,e},createOutlinedButton:function(t){const e=document.createElement("vot-block");return e.classList.add("vot-outlined-button"),e.innerHTML=t,e},createIconButton:P,createCheckbox:function(t,e=!1){const o=document.createElement("label");o.classList.add("vot-checkbox");const n=document.createElement("input");n.type="checkbox",n.checked=Boolean(e);const a=document.createElement("span");return a.innerHTML=t,o.appendChild(n),o.appendChild(a),{container:o,input:n,label:a}},createSlider:function(t,e=50,o=0,n=100){const a=document.createElement("vot-block");a.classList.add("vot-slider");const i=document.createElement("input");i.type="range",i.min=o,i.max=n,i.value=e;const r=document.createElement("span");return r.innerHTML=t,a.appendChild(i),a.appendChild(r),i.addEventListener("input",(t=>E(t.target))),E(i),{container:a,input:i,label:r}},createTextfield:O,createDialog:C,createVOTButton:function(t){const e=document.createElement("vot-block");e.classList.add("vot-segmented-button");const o=document.createElement("vot-block");o.classList.add("vot-segment"),o.classList.add("vot-translate-button"),o.innerHTML='';const n=document.createElement("vot-block");n.classList.add("vot-separator");const a=document.createElement("vot-block");a.classList.add("vot-segment-only-icon"),a.innerHTML='';const i=document.createElement("vot-block");i.classList.add("vot-separator");const r=document.createElement("vot-block");r.classList.add("vot-segment-only-icon"),r.innerHTML='';const s=document.createElement("span");return s.classList.add("vot-segment-label"),s.innerHTML=t,e.appendChild(o),e.appendChild(n),e.appendChild(a),e.appendChild(i),e.appendChild(r),o.appendChild(s),{container:e,translateButton:o,separator:n,pipButton:a,separator2:i,menuButton:r,label:s}},createVOTMenu:function(t){const e=document.createElement("vot-block");e.classList.add("vot-menu"),e.hidden=!0;const o=document.createElement("vot-block");o.classList.add("vot-menu-content-wrapper");const n=document.createElement("vot-block");n.classList.add("vot-menu-header-container");const a=document.createElement("vot-block");a.classList.add("vot-menu-body-container");const i=document.createElement("vot-block");i.classList.add("vot-menu-footer-container");const r=document.createElement("vot-block");r.classList.add("vot-menu-title-container");const s=document.createElement("vot-block");return s.classList.add("vot-menu-title"),s.innerHTML=t,e.appendChild(o),o.appendChild(n),o.appendChild(a),o.appendChild(i),n.appendChild(r),r.appendChild(s),{container:e,contentWrapper:o,headerContainer:n,bodyContainer:a,footerContainer:i,titleContainer:r,title:s}},createVOTSelectLabel:function(t){const e=document.createElement("span");return e.classList.add("vot-select-label"),e.innerText=t,e},createVOTSelect:B,createVOTLanguageSelect:function(t){const e=t.fromTitle||"#UNDEFINED",o=t.fromDialogTitle||"#UNDEFINED",n=t.fromItems||[],a=t.fromOnSelectCB||function(){},i=t.toTitle||"#UNDEFINED",r=t.toDialogTitle||"#UNDEFINED",s=t.toItems||[],l=t.toOnSelectCB||function(){},d=document.createElement("vot-block");d.classList.add("vot-lang-select");const c=B(e,o,n,{onSelectCb:a}),u=document.createElement("vot-block");u.classList.add("vot-lang-select-icon"),u.innerHTML='';const h=B(i,r,s,{onSelectCb:l});return d.append(c.container,u,h.container),{container:d,fromSelect:c,icon:u,toSelect:h}},updateSlider:E};class _ extends Error{constructor(t){super(g.getDefault(t)),this.name="VOTLocalizedError",this.unlocalizedMessage=t,this.localizedMessage=g.get(t)}}async function R(t,e){const o=new AbortController,n=setTimeout((()=>o.abort()),3e3);try{return await fetch(t,{...e,signal:o.signal})}catch(t){return console.error("Fetch timed-out. Error:",t),t}finally{clearTimeout(n)}}const q={async translate(t,e){try{const o=await R(i.rw.yandex,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,lang:e})});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.text[0]}catch(e){return console.error("Error translating text:",e),t}},async detect(t,e){try{const o=await R(i.QL.yandex,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,lang:e})});if(o instanceof Error)throw o;const n=await o.json();if(200!==n.code)throw n.message;return n.lang??"en"}catch(t){return console.error("Error translating text:",t),"en"}}},D={async detect(t){try{const e=await fetch(i.QL.rustServer,{method:"POST",body:t});if(e instanceof Error)throw e;return await e.text()}catch(t){return console.error("Error getting lang from text:",t),"en"}}};const z=["yandex"],I=["yandex","rust-server"];async function $(t,e,o,n){if(!window.location.hostname.includes("m.youtube.com")&&t?.getAudioTrack){const e=t.getAudioTrack(),o=e?.getLanguageInfo();if("und"!==o?.id)return K(o.id.split(".")[0])}const a=e?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(a?.length){const t=a.find((t=>"asr"===t.kind));if(t&&t.languageCode)return K(t.languageCode)}const r=[/(?:https?|ftp):\/\/[\S]+/g,/https?:\/\/\S+|www\.\S+/gm,/\b\S+\.\S+/gm,/#[^\s#]+/g,/Auto-generated by YouTube/g,/Provided to YouTube by/g,/Released on/g,/Bitcoin/g,/USDT/g,/Paypal/g],s=[o,n?n.split("\n\n").filter((t=>!r.some((e=>e.test(t))))).join("\n\n"):""].join(" ").replace(/[^\p{L}\s]/gu," ").trim().replace(/\s+/g," ").slice(0,1e3);return await async function(t){switch(await h.get("detectService",i.K2)){case"yandex":return await q.detect(t);case"rust-server":return await D.detect(t);default:return"en"}}(s)}function N(){return/^m\.youtube\.com$/.test(window.location.hostname)}function H(){return window.location.pathname.startsWith("/shorts/")?N()?document.querySelector("#movie_player"):document.querySelector("#shorts-player"):document.querySelector("#movie_player")}function j(){const t=H();return t?.getPlayerResponse?t?.getPlayerResponse?.call()??null:t?.data?.playerResponse??null}function U(){const t=H();return t?.getVideoData?t?.getVideoData?.call()??null:t?.data?.playerResponse?.videoDetails??null}const W={isMobile:N,getPlayer:H,getPlayerResponse:j,getPlayerData:U,getVideoVolume:function(){const t=H();return t?.getVolume?t.getVolume.call()/100:1},getSubtitles:function(){const t=j();let e=t?.captions?.playerCaptionsTracklistRenderer?.captionTracks??[];return e=e.reduce(((t,e)=>{if("languageCode"in e){const o=e?.languageCode?K(e?.languageCode):void 0,n=e?.url||e?.baseUrl;o&&n&&t.push({source:"youtube",language:o,isAutoGenerated:"asr"===e?.kind,url:`${n.startsWith("http")?n:`${window.location.origin}/${n}`}&fmt=json3`})}return t}),[]),u.A.log("youtube subtitles:",e),e},getVideoData:async function(){const t=H(),e=j(),o=U(),{title:n}=o??{},{shortDescription:a,isLive:i}=e?.videoDetails??{};let s=n?await $(t,e,n,a):"en";s=r.includes(s)?s:"en";const l={isLive:!!i,title:n,description:a,detectedLanguage:s};return u.A.log("youtube video data:",l),console.log("[VOT] Detected language: ",l.detectedLanguage),l},setVideoVolume:function(t){const e=H();if(e?.setVolume)return e.setVolume(Math.round(100*t)),!0},videoSeek:function(t,e){u.A.log("videoSeek",e);const o=(H()?.getProgressState()?.seekableEnd||t.currentTime)-e;t.currentTime=o}},G=navigator.language||navigator.userLanguage,Y=G?.substr(0,2)?.toLowerCase()??"en",Z=(t,e)=>{let o=new URL(window.location.href);switch(t){case"piped":case"invidious":case"youtube":if(o.searchParams.has("enablejsapi")){const t=W.getPlayer().getVideoUrl();o=new URL(t)}return o.pathname.match(/(?:watch|embed|shorts)\/([^/]+)/)?.[1]||o.searchParams.get("v");case"vk":return o.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)?o.pathname.match(/^\/video-?[0-9]{8,9}_[0-9]{9}$/)[0].slice(1):o.searchParams.get("z")?o.searchParams.get("z").split("/")[0]:!(!o.searchParams.get("oid")||!o.searchParams.get("id"))&&`video-${Math.abs(o.searchParams.get("oid"))}_${o.searchParams.get("id")}`;case"nine_gag":case"9gag":case"gag":return o.pathname.match(/gag\/([^/]+)/)?.[1];case"twitch":if(/^m\.twitch\.tv$/.test(window.location.hostname)){const t=document.head.querySelector('link[rel="canonical"]');return t?.href.match(/videos\/([^/]+)/)?.[0]||o.pathname.slice(1)}if(/^player\.twitch\.tv$/.test(window.location.hostname))return`videos/${o.searchParams.get("video")}`;if(/^clips\.twitch\.tv$/.test(window.location.hostname)){const t=document.querySelector(".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']");if(!t)return!1;return`${t.href.replace("https://www.twitch.tv/","")}/clip/${o.searchParams.get("clip")}`}return o.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)?o.pathname.match(/([^/]+)\/(?:clip)\/([^/]+)/)[0]:o.pathname.match(/(?:videos)\/([^/]+)/)?.[0];case"proxytok":return o.pathname.match(/([^/]+)\/video\/([^/]+)/)?.[0];case"tiktok":{let t=o.pathname.match(/([^/]+)\/video\/([^/]+)/)?.[0];if(!t){const o=e.closest(".xgplayer-playing, .tiktok-web-player"),n=o?.closest('div[data-e2e="recommend-list-item-container"]'),a=n?.querySelector('a[data-e2e="video-author-avatar"]');if(o&&a){const e=o.id?.match(/^xgwrapper-[0-9]+-(.*)$/)?.at(1),n=a.href?.match(/.*(@.*)$/)?.at(1);e&&n&&(t=`${n}/video/${e}`)}}return t}case"vimeo":{const t=o.searchParams.get("app_id"),e=o.pathname.match(/[^/]+\/[^/]+$/)?.[0]||o.pathname.match(/[^/]+$/)?.[0];return t?`${e}?app_id=${t}`:e}case"xvideos":return o.pathname.match(/[^/]+\/[^/]+$/)?.[0];case"pornhub":return o.searchParams.get("viewkey")||o.pathname.match(/embed\/([^/]+)/)?.[1];case"twitter":return o.pathname.match(/status\/([^/]+)/)?.[1];case"udemy":case"rumble":case"facebook":return o.pathname;case"rutube":return o.pathname.match(/(?:video|embed)\/([^/]+)/)?.[1];case"coub":return o.pathname.includes("/view")?o.pathname.match(/view\/([^/]+)/)?.[1]:o.pathname.includes("/embed")?o.pathname.match(/embed\/([^/]+)/)?.[1]:document.querySelector(".coub.active")?.dataset?.permalink;case"bilibili":{const t=o.searchParams.get("bvid");if(t)return t;{let t=o.pathname.match(/video\/([^/]+)/)?.[1];return t&&o.search&&null!==o.searchParams.get("p")&&(t+=`/?p=${o.searchParams.get("p")}`),t}}case"mail_ru":if(o.pathname.startsWith("/v/")||o.pathname.startsWith("/mail/"))return o.pathname;if(o.pathname.match(/video\/embed\/([^/]+)/)){const t=document.querySelector(".b-video-controls__mymail-link");return!!t&&t?.href.split("my.mail.ru")?.[1]}return!1;case"bitchute":return o.pathname.match(/video\/([^/]+)/)?.[1];case"coursera":return o.pathname.match(/learn\/([^/]+)\/lecture\/([^/]+)/)?.[0];case"eporner":return o.pathname.match(/video-([^/]+)\/([^/]+)/)?.[0];case"peertube":return o.pathname.match(/\/w\/([^/]+)/)?.[0];case"dailymotion":{const t=Array.from(document.querySelectorAll("*")).filter((t=>t.innerHTML.trim().includes(".m3u8")));try{let e=t[1].lastChild.src;return e.match(/\/video\/(\w+)\.m3u8/)?.[1]}catch(t){return console.error("[VOT]",t),!1}}case"trovo":{if(!o.pathname.startsWith("/s/"))return!1;const t=o.searchParams.get("vid");if(!t)return!1;const e=o.pathname.match(/([^/]+)\/([\d]+)/)?.[0];return!!e&&`${e}?vid=${t}`}case"yandexdisk":return o.pathname.match(/\/i\/([^/]+)/)?.[1];case"coursehunter":{const t=o.pathname.match(/\/course\/([^/]+)/)?.[1];return!!t&&t+o.search}case"ok.ru":return o.pathname.match(/\/video\/(\d+)/)?.[0];case"googledrive":return o.searchParams.get("docid");case"bannedvideo":return o.searchParams.get("id");case"weverse":return o.pathname.match(/([^/]+)\/(live|media)\/([^/]+)/)?.[0];case"newgrounds":return o.pathname.match(/([^/]+)\/(view)\/([^/]+)/)?.[0];case"egghead":return o.pathname;case"youku":return o.pathname.match(/v_show\/id_[\w=]+/)?.[0];default:return!1}};function K(t){return t.toLowerCase().split(";")[0].trim().split("-")[0].split("_")[0]}function J(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}function Q(){return"undefined"!=typeof Hls&&Hls?.isSupported()?new Hls({debug:!1,lowLatencyMode:!0,backBufferLength:90}):void 0}function X(t,e,o,n){let a=e;return e>n?(a=o+(e-n),a=a>100?100:Math.max(a,0),t.volume=a/100):e100?100:Math.max(a,0),t.volume=a/100),a}const tt=new protobuf.Type("VideoTranslationHelpObject").add(new protobuf.Field("target",1,"string")).add(new protobuf.Field("targetUrl",2,"string")),et=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("duration",6,"double")).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,"VideoTranslationHelpObject","repeated")).add(new protobuf.Field("responseLanguage",14,"string")).add(new protobuf.Field("unknown5",15,"int32")).add(new protobuf.Field("unknown6",16,"int32")).add(new protobuf.Field("unknown7",17,"int32")),ot=new protobuf.Type("VideoSubtitlesRequest").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("language",2,"string")),nt=new protobuf.Type("VideoStreamRequest").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("language",2,"string")).add(new protobuf.Field("responseLanguage",3,"string")),at=new protobuf.Type("VideoStreamPingRequest").add(new protobuf.Field("pingId",1,"int32")),it=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("unknown0",6,"int32")).add(new protobuf.Field("unknown1",7,"string")).add(new protobuf.Field("language",8,"string")).add(new protobuf.Field("message",9,"string")),rt=new protobuf.Type("VideoSubtitlesObject").add(new protobuf.Field("language",1,"string")).add(new protobuf.Field("url",2,"string")).add(new protobuf.Field("unknown2",3,"int32")).add(new protobuf.Field("translatedLanguage",4,"string")).add(new protobuf.Field("translatedUrl",5,"string")).add(new protobuf.Field("unknown5",6,"int32")).add(new protobuf.Field("unknown6",7,"int32")),st=new protobuf.Type("VideoSubtitlesResponse").add(new protobuf.Field("unknown0",1,"int32")).add(new protobuf.Field("subtitles",2,"VideoSubtitlesObject","repeated")),lt=new protobuf.Type("VideoStreamObject").add(new protobuf.Field("url",1,"string")).add(new protobuf.Field("timestamp",2,"int64")),dt=new protobuf.Type("VideoStreamResponse").add(new protobuf.Field("interval",1,"int32")).add(new protobuf.Field("translatedInfo",2,"VideoStreamObject")).add(new protobuf.Field("pingId",3,"int32")),ct=(new protobuf.Root).define("yandex").add(tt).add(et).add(it).add(ot).add(rt).add(st).add(at).add(nt).add(lt).add(dt),ut={encodeTranslationRequest:(t,e,o,n,a)=>ct.VideoTranslationRequest.encode({url:t,firstRequest:!0,duration:e,unknown2:1,language:o,unknown3:0,unknown4:0,translationHelp:a,responseLanguage:n,unknown5:0,unknown6:1,unknown7:0}).finish(),decodeTranslationResponse:t=>ct.VideoTranslationResponse.decode(new Uint8Array(t)),encodeSubtitlesRequest:(t,e)=>ct.VideoSubtitlesRequest.encode({url:t,language:e}).finish(),decodeSubtitlesResponse:t=>ct.VideoSubtitlesResponse.decode(new Uint8Array(t)),encodeStreamPingRequest:t=>ct.VideoStreamPingRequest.encode({pingId:t}).finish(),encodeStreamRequest:(t,e,o)=>ct.VideoStreamRequest.encode({url:t,language:e,responseLanguage:o}).finish(),decodeStreamResponse:t=>ct.VideoStreamResponse.decode(new Uint8Array(t))};var ht=o("./node_modules/bowser/es5.js");function pt(t){const e=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)));return t?e:e.toUpperCase()}async function gt(t){const e=new TextEncoder("utf-8"),o=await window.crypto.subtle.importKey("raw",e.encode(i.S7),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),n=await window.crypto.subtle.sign("HMAC",o,t);return Array.from(new Uint8Array(n),(t=>t.toString(16).padStart(2,"0"))).join("")}const vt=async function(t,e){try{u.A.log("requestStreamPing");const n=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest.js"))).default;u.A.log("Inited yandexRequest...");const a=ut.encodeStreamPingRequest(t);await n("/stream-translation/ping-stream",a,{"Vtrans-Signature":await gt(a),"Sec-Vtrans-Token":pt(!1)},e)}catch(t){console.error("[VOT]",t),e(!1)}};const mt=async function(t,e,n,a){try{u.A.log("requestStreamTranslation");const i=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest.js"))).default;u.A.log("Inited yandexRequest...");const r=ut.encodeStreamRequest(t,e,n);await i("/stream-translation/translate-stream",r,{"Vtrans-Signature":await gt(r),"Sec-Vtrans-Token":pt(!1)},a)}catch(t){console.error("[VOT]",t),a(!1)}};const bt=async function(t,e,n,a,i,r){try{u.A.log("requestVideoTranslation");const s=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest.js"))).default;u.A.log("Inited yandexRequest...");const l=ut.encodeTranslationRequest(t,e,n,a,i);await s("/video-translation/translate",l,{"Vtrans-Signature":await gt(l),"Sec-Vtrans-Token":pt(!1)},r)}catch(t){console.error("[VOT]",t),r(!1)}};const ft=async function(t,e,n){try{u.A.log("requestVideoSubtitles");const a=(await Promise.resolve().then(o.bind(o,"./src/yandexRequest.js"))).default;u.A.log("Inited yandexRequest...");const i=ut.encodeSubtitlesRequest(t,e);await a("/video-subtitles/get-subtitles",i,{"Vsubs-Signature":await gt(i),"Sec-Vsubs-Token":pt(!1)},n)}catch(t){console.error("[VOT]",t),n(!1)}};function yt(t){const e=t.startMs+t.durationMs;return t.tokens.reduce(((o,n,a)=>{const i=t.tokens[a+1];let r;o.length>0&&(r=o[o.length-1]);const s=r?.alignRange?.end??0,l=s+n.text.length;if(n.alignRange={start:s,end:l},o.push(n),i){const t=n.startMs+n.durationMs,a=i.startMs?i.startMs-t:e-t;o.push({text:" ",startMs:t,durationMs:a,alignRange:{start:l,end:l+1}})}return o}),[])}function wt(t,e){const o=t.text.split(/([\n \t])/).reduce(((t,o)=>{if(o.length){const n=t[t.length-1]??e,a=n?.alignRange?.end??0,i=a+o.length;t.push({text:o,alignRange:{start:a,end:i}})}return t}),[]),n=Math.floor(t.durationMs/o.length),a=t.startMs+t.durationMs;return o.map(((e,i)=>{const r=i===o.length-1,s=t.startMs+n*i;return{...e,startMs:s,durationMs:r?a-s:n}}))}async function xt(t){let e=!1,o=await Promise.race([new Promise((t=>{setTimeout((()=>{e||(console.error("[VOT] Failed to fetch subtitles. Reason: timeout"),t([]))}),5e3)})),new Promise((o=>{u.A.log("Fetching subtitles:",t),fetch(t.url).then((t=>t.json())).then((t=>{e=!0,o(t)})).catch((t=>{console.error("[VOT] Failed to fetch subtitles. Reason:",t),e=!0,o({containsTokens:!1,subtitles:[]})}))}))]);return"youtube"===t.source&&(o=function(t){const e={containsTokens:!1,subtitles:[]};if("object"!=typeof t||!("events"in t)||!Array.isArray(t.events))return console.error("[VOT] Failed to format youtube subtitles",t),e;for(let o=0;ot.utf8.replace(/^ +| +$/g,""))).join(" ");let a=t.events[o].dDurationMs;t.events[o+1]&&t.events[o].tStartMs+t.events[o].dDurationMs>t.events[o+1].tStartMs&&(a=t.events[o+1].tStartMs-t.events[o].tStartMs),"\n"!==n&&e.subtitles.push({text:n,startMs:t.events[o].tStartMs,durationMs:a})}return e}(o)),o.subtitles=function(t,e){const o=[];let n;for(const a of t.subtitles){let i;if(a?.tokens?.length){if("yandex"!==e)return console.warn("[VOT] Unsupported subtitles tokens type: ",e),t.containsTokens=!1,null;i=yt(a)}else i=wt(a,n);n=i[i.length-1],o.push({...a,tokens:i})}return t.containsTokens=!0,o}(o,t.source),console.log("[VOT] subtitles:",o),o}class St{dragging=!1;subtitlesContainerRect=null;containerRect=null;offsetX=null;offsetY=null;lastContent=null;highlightWords=!1;subtitles=null;maxLength=300;maxLengthRegexp=/.{1,300}(?:\s|$)/g;constructor(t,e,o){this.site=o,this.video=t,"youtube"===this.site.host&&"mobile"!==this.site.additionalData?this.container=e.parentElement:this.container=e,this.votSubtitlesContainer=document.createElement("vot-block"),this.votSubtitlesContainer.classList.add("vot-subtitles-widget"),this.container.appendChild(this.votSubtitlesContainer),this.onMouseDownBound=this.onMouseDown.bind(this),this.onMouseUpBound=this.onMouseUp.bind(this),this.onMouseMoveBound=this.onMouseMove.bind(this),this.onTimeUpdateBound=this.onTimeUpdate.bind(this),document.addEventListener("mousedown",this.onMouseDownBound),document.addEventListener("mouseup",this.onMouseUpBound),document.addEventListener("mousemove",this.onMouseMoveBound),this.video?.addEventListener("timeupdate",this.onTimeUpdateBound)}release(){this.video?.removeEventListener("timeupdate",this.onTimeUpdateBound),document.removeEventListener("mousedown",this.onMouseDownBound),document.removeEventListener("mouseup",this.onMouseUpBound),document.removeEventListener("mousemove",this.onMouseMoveBound),this.votSubtitlesContainer.remove()}onMouseDown(t){this.votSubtitlesContainer.contains(t.target)&&(this.subtitlesContainerRect=this.votSubtitlesContainer.getBoundingClientRect(),this.containerRect=this.container.getBoundingClientRect(),this.offsetX=t.clientX-this.subtitlesContainerRect.x,this.offsetY=t.clientY-this.subtitlesContainerRect.y,this.dragging=!0)}onMouseUp(){this.dragging=!1}onMouseMove(t){if(this.dragging){t.preventDefault();const e=t.clientX-this.offsetX,o=t.clientY-this.offsetY,n=o>=this.containerRect.top,a=o+this.subtitlesContainerRect.height<=this.containerRect.bottom,i=e>=this.containerRect.left,r=e+this.subtitlesContainerRect.width<=this.containerRect.right;this.votSubtitlesContainer.style.top=n&&a?o-this.containerRect.y+"px":n?this.containerRect.height-this.subtitlesContainerRect.height+"px":"0px",this.votSubtitlesContainer.style.left=i&&r?e-this.containerRect.x+"px":i?this.containerRect.width-this.subtitlesContainerRect.width+"px":"0px"}}onTimeUpdate(){this.update()}setContent(t){t&&this.video?(this.subtitles=t,this.update()):(this.subtitles=null,this.votSubtitlesContainer.innerHTML="")}setMaxLength(t){"number"==typeof t&&t&&(this.maxLength=t,this.maxLengthRegexp=new RegExp(`.{1,${t}}(?:\\s|$)`,"g"),this.update())}setHighlightWords(t){this.highlightWords!==!!t&&(this.highlightWords=!!t,this.update())}update(){if(!this.video)return;let t="",e=this.highlightWords&&this.subtitles?.containsTokens;const o=1e3*this.video.currentTime,n=this.subtitles?.subtitles?.findLast((t=>t.startMsthis.maxLength){let t=[],n=0,a=0,i=0;for(let o=0;othis.maxLength){let r=e.slice(n,a+1);r.at(0)&&" "===r.at(0).text&&(r=r.slice(1)),r.at(-1)&&" "===r.at(-1).text&&(r=r.slice(0,r.length-1)),t.push({startMs:e[n].startMs,durationMs:e[a].startMs+e[a].durationMs-e[n].startMs,tokens:r}),n=o,i=0}a=o}for(const n of t)if(n.startMse||o>n.startMs-100&&e-o<275?'class="passed"':""}>${n.text}`}}else if(n.text.length>this.maxLength){let e=n.text.match(this.maxLengthRegexp),a=n.durationMs/e.length;for(let i=0;i${t.replace("\\n","
")}`:"")}}const kt={getVideoData:async function(){const t=window.course_id??document.querySelector('input[name="course_id"]')?.value,e=window.lessons??await async function(t){const e=await fetch(`https://coursehunter.net/api/v1/course/${t}/lessons`);return await e.json()}(t),o=parseInt(document.querySelector(".lessons-item_active")?.dataset?.index??1),n=e?.[o-1],{file:a,duration:i}=n;return u.A.log("coursehunter course data:",e),{url:a,duration:i}}};function Tt(){return Vt()?.player}function Vt(){return document.querySelector(".vjs-v6")}const Mt={getPlayer:Vt,getPlayerData:Tt,getVideoData:async function(t="en"){let e=null;const o=Tt(),{duration:n}=o?.cache_||{},{courseId:a,tracks:i,sources:s}=o?.options_||{},l=function(t){const e=t?.find((t=>"video/mp4"===t.type));return e?.src}(s),d=await async function(t){const e=await fetch(`https://www.coursera.org/api/onDemandCourses.v1/${t}`),o=await e.json();return o?.elements?.[0]}(a);let c=d?.primaryLanguageCodes?.[0];c=c?K(c):"en",r.includes(c)||(c="en");const h=function(t,e,o){let n=t?.find((t=>K(t.srclang)===e));return n||(n=t?.find((t=>K(t.srclang)===o))||t?.[0]),n?.src}(i,c,t);console.log(`videoURL: ${l}, subtitlesURL: ${h}`),h&&l?e=[{target:"video_file_url",targetUrl:l},{target:"subtitles_file_url",targetUrl:`https://www.coursera.org${h}`}]:console.error(`Failed to find subtitlesURL or videoURL. videoURL: ${l}, subtitlesURL: ${h}`);const p={duration:n,detectedLanguage:c,translationHelp:e};return u.A.log("coursera video data:",p),console.log("[VOT] Detected language: ",p.detectedLanguage),p}},Lt="https://www.udemy.com/api-2.0",At=2592e6;async function Pt(t){const e=await fetch(`${Lt}/courses/${t}/?`+new URLSearchParams({"fields[course]":"locale",use_remote_version:"true",caching_intent:"true"}));return await e.json()}async function Et(t,e,o){if(!(n=t.expires,n+At>(new Date).getTime()&&t.accessToken))return void console.error(g.get("udemyAccessTokenExpired"));var n;const a=`Bearer ${t.accessToken}`,i=await fetch(`${Lt}/users/me/subscribed-courses/${e}/lectures/${o}/?`+new URLSearchParams({"fields[lecture]":"asset","fields[asset]":"length,media_sources,captions"}),{headers:{"x-udemy-authorization":a,authorization:a}});return await i.json()}function Ot(){return Bt()?.player}function Ct(){const t=document.querySelector(".ud-app-loader[data-module-id='course-taking']")?.dataset?.moduleArgs;return t?JSON.parse(t):(console.error(g.get("udemyModuleArgsNotFound")),{})}function Bt(){return document.querySelector(".vjs-v7")}const Ft={getPlayer:Bt,getPlayerData:Ot,getVideoData:async function(t,e="en"){let o=null;const n=Ot();u.A.log("udemyData",t);const a=Ct();u.A.log("moduleData: ",a);const i=a.courseId,s=window.location.pathname.match(/learn\/lecture\/([^/]+)/)?.[1];u.A.log(`CourseId: ${i}, lectureId: ${s}`);const l=await Pt(i);u.A.log("courseLang Data:",l);const d=await Et(t,i,s);console.log("lecture Data:",d);let c=l?.locale?.locale;c=c?K(c):"en",r.includes(c)||(c="en");const h=d?.asset?.length||n?.cache_?.duration,p=function(t){const e=t?.find((t=>"video/webm"===t.type||"video/mp4"===t.type));return e?.src}(d?.asset?.media_sources)||function(){const t=Bt()?.querySelector("video")?.src;return!t?.startsWith("blob:")&&t}(),g=function(t,e,o){let n=t?.find((t=>K(t.locale_id)===e));return n||(n=t?.find((t=>K(t.locale_id)===o))||t?.[0]),n?.url}(d?.asset?.captions,c,e);console.log(`videoURL: ${p}, subtitlesURL: ${g}`),g&&p?o=[{target:"video_file_url",targetUrl:p},{target:"subtitles_file_url",targetUrl:g}]:console.error(`Failed to find subtitlesURL or videoURL. videoURL: ${p}, subtitlesURL: ${g}`);const v={duration:h,detectedLanguage:c,translationHelp:o};return u.A.log("udemy video data:",v),console.log("[VOT] Detected language: ",v.detectedLanguage),v},getModuleData:Ct,getCourseLang:Pt,getLectureData:Et};const _t={getVideoData:async function(t){const e=await async function(t){return await fetch("https://api.banned.video/graphql",{method:"POST",body:JSON.stringify({operationName:"GetVideo",query:"query GetVideo($id: String!) {\n getVideo(id: $id) {\n ...DisplayVideoFields\n videoUrl: directUrl\n live\n }\n }\n\n fragment DisplayVideoFields on Video {\n title\n description: summary\n duration: videoDuration\n }",variables:{id:t}}),headers:{"User-Agent":"bannedVideoFrontEnd","apollographql-client-name":"banned-web","apollographql-client-version":"1.3","content-type":"application/json"}}).then((t=>t.json())).catch((t=>(console.error(t),{data:{getVideo:{}}})))}(t);u.A.log("banned.video video data:",e);const{videoUrl:o,duration:n,live:a,description:i,title:r}=e.data.getVideo;return{url:o,duration:n,live:a,title:r,description:i}}};const Rt="https://global.apis.naver.com/weverse/wevweb",qt="be4d79eb8fc7bd008ee82c8ec4ff6fd4",Dt="1b9cb6378d959b45714bec49971ade22e6e24e42";async function zt(t){const e=Date.now();let o=t.substring(0,Math.min(255,t.length))+e;const n=await async function(t,e){const o=new TextEncoder("utf-8");return e=o.encode(e),window.crypto.subtle.importKey("raw",o.encode(t),{name:"HMAC",hash:{name:"SHA-1"}},!1,["sign","verify"]).then((t=>window.crypto.subtle.sign("HMAC",t,e))).then((t=>btoa(String.fromCharCode(...new Uint8Array(t))))).catch((t=>(console.error(t),!1)))}(Dt,o);return{wmsgpad:e,wmd:n}}function It(){return{appId:qt,language:"en",os:"WEB",platform:"WEB",wpf:"pc"}}const $t={getVideoData:async function(){const t=new URL(window.location).pathname.match(/([^/]+)\/(live|media)\/([^/]+)/)?.[3],e=await async function(t){const e=`/post/v1.0/post-${t}/preview?`+new URLSearchParams({fieldSet:"postForPreview",...It()}),o=await zt(e);return await fetch(Rt+e+"&"+new URLSearchParams(o)).then((t=>t.json())).catch((t=>(console.error(t),{extension:{video:{}}})))}(t);u.A.log("weverse video preview data:",e);const{videoId:o,serviceId:n,infraVideoId:a}=e.extension.video;if(!(o&&n&&a))return!1;const{inKey:i}=await async function(t){const e=`/video/v1.1/vod/${t}/inKey?`+new URLSearchParams({gcc:"RU",...It()}),o=await zt(e);return await fetch(Rt+e+"&"+new URLSearchParams(o),{method:"POST"}).then((t=>t.json())).catch((t=>(console.error(t),{})))}(o);if(u.A.log("weverse video inKey data:",e),!i)return!1;const r=await async function(t,e,o){const n=Date.now();return await fetch(`https://global.apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/${t}?`+new URLSearchParams({key:e,sid:o,nonce:n,devt:"html5_pc",prv:"N",aup:"N",stpb:"N",cpl:"en",env:"prod",lc:"en",adi:[{adSystem:null}],adu:"/"})).then((t=>t.json())).catch((t=>(console.error(t),{videos:{list:[]}})))}(a,i,n);u.A.log("weverse video data:",r);const s=r.videos.list.find((t=>!1===t.useP2P&&t.source.includes(".mp4")));if(!s)return!1;const{source:l,duration:d}=s;return{url:l,duration:d}}},Nt=[{additionalData:"mobile",host:"youtube",url:"https://youtu.be/",match:/^m.youtube(-nocookie)?.com$/,selector:"shorts-video #player"},{additionalData:"mobile",host:"youtube",url:"https://youtu.be/",match:/^m.youtube(-nocookie)?.com$/,selector:".player-container"},{host:"youtube",url:"https://youtu.be/",match:/^(www.)?youtube(-nocookie|kids)?.com$/,selector:".html5-video-container:not(#inline-player *)"},{host:"tiktok",url:"https://www.tiktok.com/",match:/^(www.)?tiktok.com$/,selector:null},{host:"proxytok",url:"https://www.tiktok.com/",match:n,selector:".column.has-text-centered"},{host:"twitch",url:"https://twitch.tv/",match:[/^m.twitch.tv$/,/^www.twitch.tv$/,/^clips.twitch.tv$/,/^player.twitch.tv$/],selector:".video-ref, main > div > section > div > div > div"},{host:"xvideos",url:"https://www.xvideos.com/",match:/^www.xvideos.com$/,selector:".video-bg-pic"},{host:"pornhub",url:"https://rt.pornhub.com/view_video.php?viewkey=",match:/^[a-z]+.pornhub.com$/,selector:".mainPlayerDiv > .video-element-wrapper-js > div"},{additionalData:"embed",host:"pornhub",url:"https://rt.pornhub.com/view_video.php?viewkey=",match:t=>t.host.includes("pornhub.com")&&t.pathname.startsWith("/embed/"),selector:"#player"},{additionalData:"mobile",host:"vk",url:"https://vk.com/video?z=",match:/^m.vk.(com|ru)$/,selector:"vk-video-player",shadowRoot:!0},{host:"vk",url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:".videoplayer_media"},{host:"vimeo",url:"https://vimeo.com/",match:/^vimeo.com$/,selector:".player"},{additionalData:"embed",host:"vimeo",url:"https://player.vimeo.com/",match:/^player.vimeo.com$/,selector:".player"},{host:"ok.ru",url:"https://ok.ru/",match:/^ok.ru$/,selector:".html5-vpl_vid"},{host:"nine_gag",url:"https://9gag.com/gag/",match:/^9gag.com$/,selector:".video-post"},{host:"coub",url:"https://coub.com/view/",match:/^coub.com$/,selector:".viewer__player"},{host:"bitchute",url:"https://www.bitchute.com/video/",match:/^(www.)?bitchute.com$/,selector:"#player"},{host:"rutube",url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:".video-player > div > div > div:nth-child(2)"},{additionalData:"embed",host:"rutube",url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:"#app > div > div"},{host:"bilibili",url:"https://www.bilibili.com/video/",match:/^(www|m|player).bilibili.com$/,selector:".bpx-player-video-wrap"},{additionalData:"old",host:"bilibili",url:"https://www.bilibili.com/video/",match:/^(www|m).bilibili.com$/,selector:null},{host:"twitter",url:"https://twitter.com/i/status/",match:/^twitter.com$/,selector:'div[data-testid="videoComponent"] > div:nth-child(1) > div'},{host:"mail_ru",url:"https://my.mail.ru/",match:/^my.mail.ru$/,selector:"#b-video-wrapper"},{host:"coursera",url:"https://www.coursera.org/",match:/coursera.org$/,selector:".vjs-v6"},{host:"udemy",url:"https://www.udemy.com",match:/udemy.com$/,selector:'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)'},{host:"invidious",url:"https://youtu.be/",match:t,selector:"#player"},{host:"piped",url:"https://youtu.be/",match:e,selector:".shaka-video-container"},{host:"rumble",url:"https://rumble.com",match:/^rumble.com$/,selector:"#videoPlayer > .videoPlayer-Rumble-cls > div"},{host:"eporner",url:"https://www.eporner.com/",match:/^(www.)?eporner.com$/,selector:".vjs-v7"},{host:"peertube",url:"tube.shanti.cafe",match:a,selector:".vjs-v7"},{host:"dailymotion",url:"https://www.dailymotion.com/video/",match:/^geo.dailymotion.com$/,selector:".player"},{host:"trovo",url:"https://trovo.live/s/",match:/^trovo.live$/,selector:".player-video"},{host:"yandexdisk",url:"https://disk.yandex.ru/i/",match:/^disk.yandex.ru$/,selector:"yaplayertag > div:nth-of-type(1)"},{host:"coursehunter",url:"https://coursehunter.net/course/",match:/^coursehunter.net$/,selector:"#oframeplayer > pjsdiv:nth-of-type(1)"},{host:"googledrive",url:"https://drive.google.com/file/d/",match:/^youtube.googleapis.com$/,selector:".html5-video-container"},{host:"bannedvideo",url:"https://banned.video/watch?id=",match:/^(www.)?banned.video$/,selector:".vjs-v7"},{host:"facebook",url:"https://facebook.com",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/videos/"),selector:'div[data-pagelet="WatchPermalinkVideo"]'},{additionalData:"reels",host:"facebook",url:"https://facebook.com",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/reel/"),selector:'div[role="main"]'},{host:"weverse",url:"https://weverse.io/",match:/^weverse.io$/,selector:".webplayer-internal-source-wrapper"},{host:"newgrounds",url:"https://www.newgrounds.com/",match:/^www.newgrounds.com$/,selector:".ng-video-player"},{host:"egghead",url:"https://egghead.io",match:/^egghead.io$/,selector:".cueplayer-react-video-holder"},{host:"youku",url:"https://v.youku.com/",match:/^v.youku.com$/,selector:"#ykPlayer"}];o("./node_modules/requestidlecallback-polyfill/index.js");class Ht{constructor(){this.listeners=new Set}hasListener(t){return this.listeners.has(t)}dispatchToListener(t,...e){try{t(...e)}catch(t){console.error("[VOT]",t)}}addListener(t){if(this.hasListener(t))throw new Error("[VOT] The listener has already been added.");this.listeners.add(t)}removeListener(t){if(!this.hasListener(t))throw new Error("[VOT] The listener has not been added yet.");this.listeners.delete(t)}dispatch(...t){for(const e of Array.from(this.listeners))this.dispatchToListener(e,...t)}}function jt(t){return Array.from(t).flatMap((t=>t instanceof HTMLVideoElement?[t]:t instanceof HTMLElement?Array.from(t.querySelectorAll("video")):t.shadowRoot?Array.from(t.shadowRoot.querySelectorAll("video")):[]))}const Ut=ht.getParser(window.navigator.userAgent).getResult(),Wt=[...t,...e],Gt=["playing","ratechange","play","waiting","pause"];function Yt(t,e,o=!1){return t.map((t=>({label:`${o&&!l.includes(t)?"❌ ":""}${g.get("langs")[t]??t.toUpperCase()}`,value:t,selected:e===t})))}function Zt(t,e,o,n,a,i){u.A.log(`Translate video (url: ${t}, duration: ${e}, requestLang: ${o}, responseLang: ${n})`),u.A.log("translationHelp:",a),!0,bt(t,e,o,n,a,((t,e)=>{if(!1,u.A.log("[exec callback] Requesting video translation"),!t)return void i(!1,g.get("requestTranslationFailed"));const o=ut.decodeTranslationResponse(e);switch(console.log("[VOT] Translation response: ",o),o.status){case 0:i(!1,o.message);break;case 1:i(!!o.url,o.url||g.get("audioNotReceived"));break;case 2:i(!1,o.remainingTime?function(t){const e=Math.floor(t/60),o=Math.floor(t%60);return e>=60?g.get("translationTakeMoreThanHour"):e>=10&&e%10?g.get("translationTakeApproximatelyMinutes").replace("{0}",e):1==e||0==e&&o>0?g.get("translationTakeAboutMinute"):g.get("translationTakeApproximatelyMinute").replace("{0}",e)}(o.remainingTime):g.get("translationTakeFewMinutes"));break;case 3:case 6:i(!1,g.get("videoBeingTranslated"))}}))}class Kt{translateFromLang="en";translateToLang=Y;timer;ytData="";videoData="";firstPlay=!0;audio=new Audio;hls=Q();videoTranslations=[];videoTranslationTTL=7200;downloadTranslationUrl=null;downloadSubtitlesUrl=null;autoRetry;streamPing;volumeOnStart;tempOriginalVolume;tempVolume;subtitlesList=[];subtitlesListVideoId=null;videoLastSrcObject=null;constructor(t,e,o){u.A.log("[VideoHandler] add video:",t,"container:",e,this),this.video=t,this.container=e,this.site=o,this.handleSrcChangedBound=this.handleSrcChanged.bind(this),this.video.addEventListener("loadedmetadata",this.handleSrcChangedBound),this.stopTranslationBound=this.stopTranslation.bind(this),this.handleVideoEventBound=this.handleVideoEvent.bind(this),this.changeOpacityOnEventBound=this.changeOpacityOnEvent.bind(this),this.resetTimerBound=this.resetTimer.bind(this),this.init()}async init(){if(this.initialized)return;const t={autoTranslate:h.get("autoTranslate",0,!0),dontTranslateLanguage:h.get("dontTranslateLanguage",Y),dontTranslateYourLang:h.get("dontTranslateYourLang",1,!0),autoSetVolumeYandexStyle:h.get("autoSetVolumeYandexStyle",1,!0),autoVolume:h.get("autoVolume",i.JD,!0),showVideoSlider:h.get("showVideoSlider",1,!0),syncVolume:h.get("syncVolume",0,!0),subtitlesMaxLength:h.get("subtitlesMaxLength",300,!0),highlightWords:h.get("highlightWords",0,!0),responseLanguage:h.get("responseLanguage",Y),defaultVolume:h.get("defaultVolume",100,!0),udemyData:h.get("udemyData",{accessToken:"",expires:0}),audioProxy:h.get("audioProxy",0,!0),showPiPButton:h.get("showPiPButton",0,!0),translateAPIErrors:h.get("translateAPIErrors",1,!0),translationService:h.get("translationService",i.mE),detectService:h.get("detectService",i.K2),m3u8ProxyHost:h.get("m3u8ProxyHost",i.se),proxyWorkerHost:h.get("proxyWorkerHost",i.Pm)},e=await Promise.all(Object.entries(t).map((async([t,e])=>[t,await e])));this.data=Object.fromEntries(e),this.videoData=await this.getVideoData(),console.log("[db] data from db: ",this.data),this.subtitlesWidget=new St(this.video,this.container,this.site),this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength),this.subtitlesWidget.setHighlightWords(this.data.highlightWords),this.initUI(),this.initUIEvents();const o=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=o,o&&(this.votMenu.container.hidden=!0),await this.updateSubtitles(),await this.changeSubtitlesLang("disabled"),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage??"ru"),this.translateToLang=this.data.responseLanguage??"ru",this.initExtraEvents(),this.initialized=!0}transformBtn(t="none",e){this.votButton.container.dataset.status=t,this.votButton.label.innerHTML=e}initUI(){this.votButton=F.createVOTButton(g.get("translateVideo")),this.container.appendChild(this.votButton.container),this.votButton.pipButton.hidden=!J()||!this.data?.showPiPButton,this.votButton.separator2.hidden=!J()||!this.data?.showPiPButton,this.votButton.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votMenu=F.createVOTMenu(g.get("VOTSettings")),this.container.appendChild(this.votMenu.container),this.votDownloadButton=F.createIconButton(''),this.votDownloadButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadButton),this.votDownloadSubtitlesButton=F.createIconButton(''),this.votDownloadSubtitlesButton.hidden=!0,this.votMenu.headerContainer.appendChild(this.votDownloadSubtitlesButton),this.votSettingsButton=F.createIconButton(''),this.votMenu.headerContainer.appendChild(this.votSettingsButton),this.votTranslationLanguageSelect=F.createVOTLanguageSelect({fromTitle:g.get("langs")[this.video.detectedLanguage],fromDialogTitle:g.get("videoLanguage"),fromItems:[{label:g.get("langs").auto,value:"auto",selected:""},...Yt(r,this.videoData.detectedLanguage)],fromOnSelectCB:async t=>{u.A.log("[fromOnSelectCB] select from language",t.target.dataset.votValue),this.videoData=await this.getVideoData(),this.setSelectMenuValues(t.target.dataset.votValue,this.videoData.responseLanguage)},toTitle:g.get("langs")[this.video.responseLanguage],toDialogTitle:g.get("translationLanguage"),toItems:[...Yt(r,this.videoData.responseLanguage,!0),{label:"─────────",value:"separator",disabled:!0},...Yt(s,this.videoData.responseLanguage,!0)],toOnSelectCB:async t=>{const e=t.target.dataset.votValue;u.A.log("[toOnSelectCB] select to language",e),this.data.responseLanguage=this.translateToLang=e,await h.set("responseLanguage",this.data.responseLanguage),u.A.log("Response Language value changed. New value: ",this.data.responseLanguage),this.videoData=await this.getVideoData(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage)}}),this.votMenu.bodyContainer.appendChild(this.votTranslationLanguageSelect.container),this.votSubtitlesSelect=F.createVOTSelect(g.get("VOTSubtitlesDisabled"),g.get("VOTSubtitles"),[{label:g.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1}],{onSelectCb:async t=>{await this.changeSubtitlesLang(t.target.dataset.votValue)},labelElement:F.createVOTSelectLabel(g.get("VOTSubtitles"))}),this.votMenu.bodyContainer.appendChild(this.votSubtitlesSelect.container),this.votVideoVolumeSlider=F.createSlider(`${g.get("VOTVolume")}: ${100*this.getVideoVolume()}%`,100*this.getVideoVolume()),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoVolumeSlider.container),this.votVideoTranslationVolumeSlider=F.createSlider(`${g.get("VOTVolumeTranslation")}: ${this.data?.defaultVolume??100}%`,this.data?.defaultVolume??100),this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoTranslationVolumeSlider.container),this.votMenu.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votSettingsDialog=F.createDialog(g.get("VOTSettings")),document.documentElement.appendChild(this.votSettingsDialog.container),this.votTranslationHeader=F.createHeader(g.get("translationSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationHeader),this.votAutoTranslateCheckbox=F.createCheckbox(g.get("VOTAutoTranslate"),this.data?.autoTranslate??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoTranslateCheckbox.container),this.votDontTranslateYourLangSelect=F.createVOTSelect(g.get("langs")[h.syncGet("dontTranslateLanguage",Y)],g.get("VOTDontTranslateYourLang"),Yt(r,h.syncGet("dontTranslateLanguage",Y)),{onSelectCb:async t=>{this.data.dontTranslateLanguage=t.target.dataset.votValue,await h.set("dontTranslateLanguage",this.data.dontTranslateLanguage)},labelElement:F.createCheckbox(g.get("VOTDontTranslateYourLang"),this.data?.dontTranslateYourLang??!0).container}),this.votSettingsDialog.bodyContainer.appendChild(this.votDontTranslateYourLangSelect.container),this.votAutoSetVolumeCheckbox=F.createCheckbox(`${g.get("VOTAutoSetVolume")}`,this.data?.autoSetVolumeYandexStyle??!0),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeCheckbox.container),this.votAutoSetVolumeSlider=F.createSlider(`${100*(this.data?.autoVolume??i.JD)}%`,100*(this.data?.autoVolume??i.JD),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=F.createCheckbox(g.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votUdemyDataTextfield=F.createTextfield(g.get("VOTUdemyData"),this.data?.udemyData?.accessToken??""),this.votUdemyDataTextfield.container.hidden="udemy"!==this.site.host,this.votSettingsDialog.bodyContainer.appendChild(this.votUdemyDataTextfield.container),this.votSyncVolumeCheckbox=F.createCheckbox(g.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSyncVolumeCheckbox.container.hidden=!["youtube","googledrive"].includes(this.site.host)||"mobile"===this.site.additionalData,this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votTranslationServiceSelect=F.createVOTSelect(h.syncGet("translationService",i.mE),g.get("VOTTranslationService"),Yt(z,h.syncGet("translationService",i.mE)),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await h.set("translationService",this.data.translationService)},labelElement:F.createCheckbox(g.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===g.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=F.createVOTSelect(h.syncGet("detectService",i.K2),g.get("VOTDetectService"),Yt(I,h.syncGet("detectService",i.K2)),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await h.set("detectService",this.data.detectService)},labelElement:F.createVOTSelectLabel(g.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=F.createHeader(g.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesMaxLengthSlider=F.createSlider(`${g.get("VOTSubtitlesMaxLength")}: ${this.data?.subtitlesMaxLength??300}`,this.data?.subtitlesMaxLength??300,50,300),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesMaxLengthSlider.container),this.votSubtitlesHighlightWordsCheckbox=F.createCheckbox(g.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votProxyHeader=F.createHeader(g.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=F.createTextfield(g.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,i.se),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=F.createTextfield(g.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,i.Pm),this.votProxyWorkerHostTextfield.container.hidden=!0,this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=F.createCheckbox(g.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votAudioProxyCheckbox.container.hidden=!0,this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votAboutHeader=F.createHeader(g.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=F.createVOTSelect(g.get("langs")[h.syncGet("locale-lang-override","auto")],g.get("VOTMenuLanguage"),Yt(p,h.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await h.set("locale-lang-override",t.target.dataset.votValue)},labelElement:F.createVOTSelectLabel(g.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=F.createCheckbox(g.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!J(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=F.createInformation(`${g.get("VOTVersion")}:`,GM_info.script.version),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=F.createInformation(`${g.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=F.createInformation(`${g.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=F.createInformation(`${g.get("VOTBrowser")}:`,`${Ut.browser.name} ${Ut.browser.version} (${Ut.os.name} ${Ut.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votResetSettingsButton=F.createButton(g.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}initUIEvents(){this.votButton.translateButton.addEventListener("click",(()=>{(async()=>{if(this.audio.src)return u.A.log("[click translationBtn] audio.src is not empty"),void this.stopTranslate();if(this.hls.url)return u.A.log("[click translationBtn] hls is not empty"),void this.stopTranslate();try{if(u.A.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new _("VOTNoVideoIDFound");await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t)}})()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votDownloadButton.addEventListener("click",(()=>{this.downloadTranslationUrl&&window.open(this.downloadTranslationUrl,"_blank").focus()})),this.votDownloadSubtitlesButton.addEventListener("click",(()=>{console.log(this.downloadSubtitlesUrl),this.downloadSubtitlesUrl&&window.open(this.downloadSubtitlesUrl,"_blank").focus()})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);if(this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${e}%`,this.setVideoVolume(e/100),1===this.data.syncVolume){const t=Number(this.votVideoTranslationVolumeSlider.input.value),o=X(this.audio,e,t,this.tempOriginalVolume);this.votVideoTranslationVolumeSlider.input.value=o,this.votVideoTranslationVolumeSlider.label.querySelector("strong").innerHTML=`${o}%`,F.updateSlider(this.votVideoTranslationVolumeSlider.input),this.tempVolume=o,this.tempOriginalVolume=e}})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await h.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").innerHTML=`${this.data.defaultVolume}%`,this.audio.volume=this.data.defaultVolume/100,1===this.data.syncVolume&&this.syncTranslationWithVideo(this.data.defaultVolume)})()})),this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await h.set("autoTranslate",this.data.autoTranslate),u.A.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await h.set("dontTranslateYourLang",this.data.dontTranslateYourLang),u.A.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await h.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),u.A.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await h.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").innerHTML=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await h.set("showVideoSlider",this.data.showVideoSlider),u.A.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votUdemyDataTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.udemyData={accessToken:t.target.value,expires:(new Date).getTime()},await h.set("udemyData",this.data.udemyData),u.A.log("udemyData value changed. New value: ",this.data.udemyData),window.location.reload()})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await h.set("syncVolume",this.data.syncVolume),u.A.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await h.set("translateAPIErrors",this.data.translateAPIErrors),u.A.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesMaxLengthSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesMaxLength=Number(t.target.value),await h.set("subtitlesMaxLength",this.data.subtitlesMaxLength),this.votSubtitlesMaxLengthSlider.label.querySelector("strong").innerHTML=`${this.data.subtitlesMaxLength}`,this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength)})()})),this.votSubtitlesHighlightWordsCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.highlightWords=Number(t.target.checked),await h.set("highlightWords",this.data.highlightWords),u.A.log("highlightWords value changed. New value: ",this.data.highlightWords),this.subtitlesWidget.setHighlightWords(this.data.highlightWords)})()})),this.votShowPiPButtonCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showPiPButton=Number(t.target.checked),await h.set("showPiPButton",this.data.showPiPButton),u.A.log("showPiPButton value changed. New value: ",this.data.showPiPButton),this.votButton.pipButton.hidden=!J()||!this.data.showPiPButton,this.votButton.separator2.hidden=!J()||!this.data.showPiPButton})()})),this.votM3u8ProxyHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.m3u8ProxyHost=t.target.value||i.se,await h.set("m3u8ProxyHost",this.data.m3u8ProxyHost),u.A.log("m3u8ProxyHost value changed. New value: ",this.data.m3u8ProxyHost)})()})),this.votProxyWorkerHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.proxyWorkerHost=t.target.value||i.Pm,await h.set("proxyWorkerHost",this.data.proxyWorkerHost),u.A.log("proxyWorkerHost value changed. New value: ",this.data.proxyWorkerHost),window.location.reload()})()})),this.votAudioProxyCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioProxy=Number(t.target.checked),await h.set("audioProxy",this.data.audioProxy),u.A.log("audioProxy value changed. New value: ",this.data.audioProxy)})()})),this.votResetSettingsButton.addEventListener("click",(()=>{(async()=>{g.reset();(await h.list()).filter((t=>!g.gmValues.includes(t))).forEach((t=>h.syncDelete(t))),window.location.reload()})()}))}releaseExtraEvents(){clearInterval(this.resizeInterval),this.resizeObserver?.disconnect(),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.syncVolumeObserver?.disconnect(),this.extraEvents?.forEach((t=>{t.element.removeEventListener(t.event,t.handler)}))}initExtraEvents(){this.extraEvents=[];const t=(t,e,o)=>{this.extraEvents.push({element:t,event:e,handler:o}),t.addEventListener(e,o)},e=(e,o,n)=>{o.forEach((o=>{t(e,o,n)}))};if(this.resizeObserver=new ResizeObserver((t=>{t.forEach((t=>{this.votMenu.container.setAttribute("style",`--vot-container-height: ${t.contentRect.height}px`)}))})),this.resizeObserver.observe(this.video),this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`),this.resizeInterval=setInterval((()=>{this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`)}),500),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData){this.syncVolumeObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"aria-valuenow"===t.attributeName&&this.syncVideoVolumeSlider()}))}));const t=document.querySelector(".ytp-volume-panel");t&&this.syncVolumeObserver.observe(t,{attributes:!0,childList:!1,subtree:!0,attributeOldValue:!0})}let o;document.addEventListener("click",(t=>{const e=t.target,o=this.votButton.container,n=this.votMenu.container,a=this.container,i=this.votSettingsDialog.container,r=document.querySelector(".vot-dialog-temp"),s=o.contains(e),l=n.contains(e),d=a.contains(e),c=i.contains(e),h=r?.contains(e)??!1;u.A.log(`[document click] ${s} ${l} ${d} ${c} ${h}`),s||l||c||h||(d||this.logout(0),this.votMenu.container.hidden=!0)})),o="pornhub"===this.site.host?"embed"===this.site.additionalData?document.querySelector("#player"):this.container.querySelector(".video-element-wrapper-js > div"):"twitter"===this.site.host?document.querySelector('div[data-testid="videoPlayer"]'):"yandexdisk"===this.site.host?document.querySelector(".video-player__player"):this.container,o&&e(o,["mousemove","mouseout"],this.resetTimerBound),t(this.votButton.container,"mousemove",this.changeOpacityOnEventBound),t(this.votMenu.container,"mousemove",this.changeOpacityOnEventBound),e(document,["touchstart","touchmove","touchend"],this.changeOpacityOnEventBound),t(this.votButton.container,"mousedown",(t=>{t.stopImmediatePropagation()})),t(this.votMenu.container,"mousedown",(t=>{t.stopImmediatePropagation()})),"youtube"===this.site.host&&(this.container.draggable=!1),t(this.video,"progress",(async()=>{if(this.videoData.videoId&&this.firstPlay&&1===this.data.autoTranslate&&Z(this.site.host,this.video)===this.videoData.videoId)try{this.firstPlay=!1,await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t),this.firstPlay=!1}}))}logout(t){this.votMenu.container.hidden&&(this.votButton.container.style.opacity=t)}resetTimer(){clearTimeout(this.timer),this.logout(1),this.timer=setTimeout((()=>{this.logout(0)}),1e3)}changeOpacityOnEvent(t){clearTimeout(this.timer),this.logout(1),t.stopPropagation()}async changeSubtitlesLang(t){if(u.A.log("[onchange] subtitles",t),this.votSubtitlesSelect.setSelected(t),"disabled"===t)this.votSubtitlesSelect.setTitle(g.get("VOTSubtitlesDisabled")),this.subtitlesWidget.setContent(null),this.votDownloadSubtitlesButton.hidden=!0,this.downloadSubtitlesUrl=null;else{const e=await xt(this.subtitlesList.at(parseInt(t)));this.subtitlesWidget.setContent(e),this.votDownloadSubtitlesButton.hidden=!1,this.downloadSubtitlesUrl=this.subtitlesList.at(parseInt(t))?.url}}async updateSubtitlesLangSelect(){const t=[{label:g.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1},...this.subtitlesList.map(((t,e)=>({label:(g.get("langs")[t.language]??t.language.toUpperCase())+(t.translatedFromLanguage?` ${g.get("VOTTranslatedFrom")} ${g.get("langs")[t.translatedFromLanguage]??t.translatedFromLanguage.toUpperCase()}`:"")+("yandex"!==t.source?` ${t.source}`:"")+(t.isAutoGenerated?` (${g.get("VOTAutogenerated")})`:""),value:e,selected:!1,disabled:!1})))];this.votSubtitlesSelect.updateItems(t),await this.changeSubtitlesLang(t[0].value)}async updateSubtitles(){if(await this.changeSubtitlesLang("disabled"),!this.videoData.videoId)return console.error(`[VOT] ${g.getDefault("VOTNoVideoIDFound")}`),this.subtitlesList=[],this.subtitlesListVideoId=null,void await this.updateSubtitlesLangSelect();this.subtitlesListVideoId!==this.videoData.videoId&&(this.subtitlesList=await async function(t,e,o){const n="youtube"===t.host?W.getSubtitles():[];let a=!1;const i=[...await Promise.race([new Promise((t=>{setTimeout((()=>{a||(console.error("[VOT] Failed get yandex subtitles. Reason: timeout"),t([]))}),5e3)})),new Promise((n=>{ft(`${t.url}${e}`,o,((t,e)=>{u.A.log("[exec callback] Requesting video subtitles"),t||(console.error("[VOT] Failed get yandex subtitles"),a=!0,n([]));const o=ut.decodeSubtitlesResponse(e);console.log("[VOT] Subtitles response: ",o);let i=o.subtitles??[];i=i.reduce(((t,e)=>(e.language&&!t.find((t=>{if("yandex"===t.source&&t.language===e.language&&!t.translatedFromLanguage)return t}))&&t.push({source:"yandex",language:e.language,url:e.url}),e.translatedLanguage&&t.push({source:"yandex",language:e.translatedLanguage,translatedFromLanguage:e.language,url:e.translatedUrl}),t)),[]),a=!0,n(i)}))}))]),...n].sort(((t,e)=>{if(t.source!==e.source)return"yandex"===t.source?-1:1;if(t.language!==e.language&&(t.language===Y||e.language===Y))return t.language===Y?-1:1;if("yandex"===t.source){if(t.translatedFromLanguage!==e.translatedFromLanguage)return t.translatedFromLanguage&&e.translatedFromLanguage?t.translatedFromLanguage===o?-1:1:t.language===e.language?t.translatedFromLanguage?1:-1:t.translatedFromLanguage?-1:1;if(!t.translatedFromLanguage)return t.language===o?-1:1}return"youtube"===t.source&&t.isAutoGenerated!==e.isAutoGenerated?t.isAutoGenerated?1:-1:0}));return console.log("[VOT] subtitles list",i),i}(this.site,this.videoData.videoId,this.videoData.detectedLanguage),this.subtitlesList?this.subtitlesListVideoId=this.videoData.videoId:await this.changeSubtitlesLang("disabled"),await this.updateSubtitlesLangSelect())}getVideoVolume(){let t=this.video?.volume;return["youtube","googledrive"].includes(this.site.host)&&(t=W.getVideoVolume()||t),t}setVideoVolume(t){if(["youtube","googledrive"].includes(this.site.host)){if(W.setVideoVolume(t))return}this.video.volume=t}syncVideoVolumeSlider(){const t=Math.round(100*this.getVideoVolume());this.votVideoVolumeSlider.input.value=t,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${t}%`,F.updateSlider(this.votVideoVolumeSlider.input),1===this.data.syncVolume&&(this.tempOriginalVolume=Number(t))}setSelectMenuValues(t,e){this.votTranslationLanguageSelect.fromSelect.setTitle(g.get("langs")[t]),this.votTranslationLanguageSelect.toSelect.setTitle(g.get("langs")[e]),this.votTranslationLanguageSelect.fromSelect.setSelected(t),this.votTranslationLanguageSelect.toSelect.setSelected(e),console.log(`[VOT] Set translation from ${t} to ${e}`),this.videoData.detectedLanguage=t,this.videoData.responseLanguage=e}syncTranslationWithVideo(t){const e=Number(this.votVideoVolumeSlider.input.value),o=X(this.video,t,e,this.tempVolume);this.votVideoVolumeSlider.input.value=o,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=`${o}%`,F.updateSlider(this.votVideoVolumeSlider.input),this.tempOriginalVolume=o,this.tempVolume=t}async getVideoData(){const t={translationHelp:null,isStream:!1,duration:this.video?.duration||343,videoId:Z(this.site.host,this.video),detectedLanguage:this.translateFromLang,responseLanguage:this.translateToLang};if(!t.videoId)return this.ytData={},t;if(window.location.hostname.includes("youtube.com"))this.ytData=await W.getVideoData(),t.isStream=this.ytData.isLive,""!==this.ytData.author&&(t.detectedLanguage=this.ytData.detectedLanguage,t.responseLanguage=this.translateToLang);else if(window.location.hostname.includes("rutube")||window.location.hostname.includes("ok.ru")||window.location.hostname.includes("my.mail.ru"))t.detectedLanguage="ru";else if(["bilibili","youku"].includes(this.site.host))t.detectedLanguage="zh";else if(["vk"].includes(this.site.host)){const e=document.getElementsByTagName("track")?.[0]?.srclang;t.detectedLanguage=e||"auto"}else if(window.location.hostname.includes("coursera.org")){const e=await Mt.getVideoData(this.translateToLang);t.duration=e.duration||t.duration,t.detectedLanguage=e.detectedLanguage,t.translationHelp=e.translationHelp}else if(window.location.hostname.includes("coursehunter.net")){const e=await kt.getVideoData();t.translationHelp={url:e.url},t.duration=e.duration||t.duration}else if(window.location.hostname.includes("banned.video")){const e=await _t.getVideoData(t.videoId);t.translationHelp={url:e.url},t.duration=e.duration||t.duration,t.isStream=e.live}else if(window.location.hostname.includes("weverse.io")){const e=await $t.getVideoData();t.detectedLanguage="ko",e&&(t.translationHelp={url:e.url},t.duration=e.duration||t.duration)}else if(window.location.hostname.includes("udemy.com")){const e=await Ft.getVideoData(this.data.udemyData,this.translateToLang);t.duration=e.duration||t.duration,t.detectedLanguage=e.detectedLanguage,t.translationHelp=e.translationHelp}else["piped","invidious","bitchute","rumble","peertube","dailymotion","trovo","yandexdisk","coursehunter"].includes(this.site.host)&&(t.detectedLanguage="auto");return t}videoValidator(){if(["youtube","ok.ru","vk"].includes(this.site.host)){if(u.A.log("VideoValidator videoData: ",this.videoData),1===this.data.dontTranslateYourLang&&this.videoData.detectedLanguage===this.data.dontTranslateLanguage&&this.videoData.responseLanguage===this.data.dontTranslateLanguage)throw new _("VOTDisableFromYourLang");if(!this.videoData.isStream&&this.videoData.duration>14400)throw new _("VOTVideoIsTooLong")}return!0}lipSync(t=!1){if(u.A.log("lipsync video",this.video),this.video)if(this.audio.currentTime=this.video.currentTime,this.audio.playbackRate=this.video.playbackRate,t)if("play"!=t)["pause","stop","waiting"].includes(t)&&(u.A.log(`lipsync mode is ${t}`),this.audio.pause()),"playing"==t&&(u.A.log("lipsync mode is playing"),this.audio.play()),"emptied"==t&&(u.A.log("lipsync mode is emptied"),this.stopTranslation());else{u.A.log("lipsync mode is play");const t=this.audio.play();void 0!==t&&t.catch((t=>{if(console.error("[VOT]",t),"NotAllowedError"===t.name)throw this.transformBtn("error",g.get("grantPermissionToAutoPlay")),new _("grantPermissionToAutoPlay");if("NotSupportedError"===t.name)throw this.transformBtn("error",Wt.includes(window.location.hostname)?g.get("neededAdditionalExtension"):g.get("audioFormatNotSupported")),Wt.includes(window.location.hostname)?new _("neededAdditionalExtension"):new _("audioFormatNotSupported")}))}else u.A.log("lipsync mode is not set")}handleVideoEvent(t){u.A.log(`video ${t.type}`),this.lipSync(t.type)}stopTranslate(){Gt.forEach((t=>this.video.removeEventListener(t,this.handleVideoEventBound))),this.audio.pause(),this.audio.src="",this.audio.removeAttribute("src"),this.votVideoVolumeSlider.container.hidden=!0,this.votVideoTranslationVolumeSlider.container.hidden=!0,this.votDownloadButton.hidden=!0,this.downloadTranslationUrl=null,this.transformBtn("none",g.get("translateVideo")),u.A.log(`Volume on start: ${this.volumeOnStart}`),this.volumeOnStart&&this.setVideoVolume(this.volumeOnStart),this.volumeOnStart="",clearInterval(this.streamPing),this.hls?.destroy(),this.hls=Q()}async translateExecutor(t){u.A.log("Run translateFunc"),this.translateFunc(t,this.videoData.isStream,this.videoData.detectedLanguage,this.videoData.responseLanguage,this.videoData.translationHelp)}async updateTranslationErrorMsg(t){const e=g.get("translationTake"),o=g.get("VOTTranslatingError"),n=g.lang;if("VOTLocalizedError"===t?.name)this.transformBtn("error",t.localizedMessage);else if(1!==this.data.translateAPIErrors||t.includes(e)||"ru"===n)this.transformBtn("error",t);else{const e=await async function(t,e="",o="ru"){if("yandex"===await h.get("translationService",i.mE)){const n=e&&o?`${e}-${o}`:o;return await q.translate(t,n)}return t}(t,"ru",n);this.transformBtn("error",o),this.transformBtn("error",e)}}afterUpdateTranslation(t){this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,1===this.data.autoSetVolumeYandexStyle&&(this.votVideoVolumeSlider.input.value=100*this.data.autoVolume,this.votVideoVolumeSlider.label.querySelector("strong").innerHTML=100*this.data.autoVolume+"%",F.updateSlider(this.votVideoVolumeSlider.input)),this.votDownloadButton.hidden=!1,this.downloadTranslationUrl=t}updateTranslation(t){if(this.audio.src=t,this.volumeOnStart=this.getVideoVolume(),"number"==typeof this.data.defaultVolume&&(this.audio.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume),"twitter"===this.site.host)document.querySelector('div[data-testid="app-bar-back"][role="button"]').addEventListener("click",this.stopTranslationBound);this.video&&!this.video.paused&&this.lipSync("play"),Gt.forEach((t=>this.video.addEventListener(t,this.handleVideoEventBound))),this.transformBtn("success",g.get("disableTranslate")),this.afterUpdateTranslation(t)}translateFunc(t,e,o,n,a){console.log("[VOT] Video Data: ",this.videoData);const i=a?.url?a.url:`${this.site.url}${t}`;if(u.A.log("Run videoValidator"),this.videoValidator(),e)return u.A.log("Executed stream translation"),void function(t,e,o,n){u.A.log(`Translate stream (url: ${t}, requestLang: ${e}, responseLang: ${o})`),mt(t,e,o,((t,e)=>{if(u.A.log("[exec callback] Requesting stream translation"),!t)return void n(!1,g.get("requestTranslationFailed"));const o=ut.decodeStreamResponse(e);switch(console.log("[VOT] Stream Translation response: ",o),o.interval){case 10:n(!1,o.interval,g.get("translationTakeFewMinutes"));break;case 20:n(!0,o.interval,o||g.get("audioNotReceived"));break;case 0:n(!1,o.interval,g.get("streamNoConnectionToServer"))}}))}(i,o,n,(async(i,r,s)=>{if(u.A.log("[exec callback] translateStream callback"),Z(this.site.host,this.video)!==t)return;if(!i||!s.translatedInfo)return await this.updateTranslationErrorMsg(s),void(10===r&&(clearTimeout(this.autoRetry),this.autoRetry=setTimeout((()=>this.translateFunc(t,e,o,n,a)),1e3*r)));this.transformBtn("success",g.get("disableTranslate")),console.log(s);const l=s.pingId;u.A.log(`Stream pingId: ${l}`),this.streamPing=setInterval((async()=>await vt(l,(t=>u.A.log("Stream ping result: ",t)))),1e3*r),u.A.log(s.translatedInfo.url);const d=`https://${this.data.m3u8ProxyHost}/?all=yes&origin=${encodeURIComponent("https://strm.yandex.ru")}&referer=${encodeURIComponent("https://strm.yandex.ru")}&url=${encodeURIComponent(s.translatedInfo.url)}`;if(u.A.log(d),this.hls)this.hls.on(Hls.Events.MEDIA_ATTACHED,(function(){u.A.log("audio and hls.js are now bound together !")})),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(t){u.A.log("manifest loaded, found "+t?.levels?.length+" quality level")})),this.hls.loadSource(d),this.hls.attachMedia(this.audio),this.hls.on(Hls.Events.ERROR,(function(t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),this.hls.recoverMediaError();break;case Hls.ErrorTypes.NETWORK_ERROR:console.error("fatal network error encountered",t);break;default:this.hls.destroy()}})),u.A.log(this.hls);else{if(!this.audio.canPlayType("application/vnd.apple.mpegurl"))throw new _("audioFormatNotSupported");this.audio.src=d}"youtube"===this.site.host&&W.videoSeek(this.video,10),this.volumeOnStart=this.getVideoVolume(),"number"==typeof this.data.defaultVolume&&(this.audio.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume),this.video.src||this.video.currentSrc||this.video.srcObject?(this.video&&!this.video.paused&&this.lipSync("play"),Gt.forEach((t=>this.video.addEventListener(t,this.handleVideoEventBound))),this.afterUpdateTranslation(d)):this.stopTranslation()}));if(["udemy","coursera"].includes(this.site.host)&&!a)throw new _("VOTTranslationHelpNull");const r=this.videoTranslations.find((e=>e.videoId===t&&e.expires>Date.now()/1e3&&e.from===o&&e.to===n));if(r)return this.updateTranslation(r.url),void u.A.log("[translateFunc] A cached translate was received");Zt(i,this.videoData.duration,o,n,a,(async(i,r)=>{if(u.A.log("[exec callback] translateVideo callback"),Z(this.site.host,this.video)===t){if(!i)return await this.updateTranslationErrorMsg(r),r.includes(g.get("translationTake"))&&(clearTimeout(this.autoRetry),this.autoRetry=setTimeout((()=>this.translateFunc(t,e,o,n,a)),6e4)),void console.error("[VOT]",r);this.updateTranslation(r),this.videoTranslations.push({videoId:t,from:o,to:n,url:r,expires:Date.now()/1e3+this.videoTranslationTTL})}}))}stopTranslation(){this.stopTranslate(),this.syncVideoVolumeSlider()}async handleSrcChanged(){u.A.log("[VideoHandler] src changed",this),this.stopTranslation(),this.firstPlay=!0,this.videoData=await this.getVideoData(),this.videoData.detectedLanguage&&this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage);const t=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject||!this.videoData.videoId;this.votButton.container.hidden=t,t&&(this.votMenu.container.hidden=t),this.site.selector||(this.container=this.video.parentElement),this.container.contains(this.votButton.container)||(this.container.appendChild(this.votButton.container),this.container.appendChild(this.votMenu.container)),await this.updateSubtitles(),await this.changeSubtitlesLang("disabled"),this.translateToLang=this.data.responseLanguage??"ru"}async release(){u.A.log("[VideoHandler] release"),this.initialized=!1,this.stopTranslation(),this.releaseExtraEvents(),this.subtitlesWidget.release(),this.votButton.container.remove(),this.votMenu.container.remove()}}const Jt=new class{constructor(){this.onVideoAdded=new Ht,this.onVideoRemoved=new Ht,this.handleVideoAddedBound=this.handleVideoAdded.bind(this),this.handleVideoRemovedBound=this.handleVideoRemoved.bind(this),this.observer=new MutationObserver((t=>{window.requestIdleCallback((()=>{t.forEach((t=>{"childList"===t.type&&(jt(t.addedNodes).forEach(this.handleVideoAddedBound),jt(t.removedNodes).forEach(this.handleVideoRemovedBound))}))}),{timeout:1e3})}))}enable(){this.observer.observe(document,{childList:!0,subtree:!0}),document.querySelectorAll("video").forEach(this.handleVideoAddedBound)}disable(){this.observer.disconnect()}handleVideoAdded(t){this.onVideoAdded.dispatch(t)}handleVideoRemoved(t){document.contains(t)||this.onVideoRemoved.dispatch(t)}},Qt=new WeakMap;(async function(){if(u.A.log("Loading extension..."),await g.update(),u.A.log(`Selected menu language: ${g.lang}`),GM_info?.scriptHandler&&d.includes(GM_info.scriptHandler))return console.error(`[VOT] ${g.getDefault("unSupportedExtensionError").replace("{0}",GM_info.scriptHandler)}`),alert(`[VOT] ${g.get("unSupportedExtensionError").replace("{0}",GM_info.scriptHandler)}`);u.A.log("Extension compatibility passed..."),Jt.onVideoAdded.addListener((t=>{for(const e of Nt.filter((t=>{const e=t=>t instanceof RegExp&&t.test(window.location.hostname)||"string"==typeof t&&window.location.hostname.includes(t)||"function"==typeof t&&t(new URL(window.location));return!!(e(t.match)||t.match instanceof Array&&t.match.some((t=>e(t))))&&t.host&&t.url}))){if(!e)continue;let o;if(e.shadowRoot)o=e.selector?Object.values(document.querySelectorAll(e.selector)).find((e=>e.shadowRoot.contains(t))):t.parentElement,o=o&&o.shadowRoot?o.parentElement:o;else{const n=Ut.browser.version.split(".")?.[0];if(e.selector?.includes(":not")&&e.selector?.includes("*")&&n&&("Chrome"===Ut.browser.name&&Number(n)<88||"Firefox"===Ut.browser.name&&Number(n)<84)){const n=e.selector?.split(" *")?.[0];o=n?Object.values(document.querySelectorAll(n)).find((e=>e.contains(t))):t.parentElement}else o=e.selector?Object.values(document.querySelectorAll(e.selector)).find((e=>e.contains(t))):t.parentElement}if(o&&!("rumble"===e.host&&o.querySelector("vot-block")||("peertube"===e.host&&(e.url=window.location.origin),Qt.has(t)))){Qt.set(t,new Kt(t,o,e));break}}})),Jt.onVideoRemoved.addListener((async t=>{Qt.has(t)&&(await Qt.get(t).release(),Qt.delete(t))})),Jt.enable()})().catch((t=>{console.error("[VOT]",t)}))})()})(); \ No newline at end of file diff --git a/dist/vot.user.js b/dist/vot.user.js index cbf3a626..bc7dbcf6 100644 --- a/dist/vot.user.js +++ b/dist/vot.user.js @@ -5421,23 +5421,16 @@ class VideoHandler { this.container.draggable = false; } - addExtraEventListener(this.video, "emptied", () => { - debug/* default */.A.log("lipsync mode is emptied"); - this.stopTranslation(); - }); - addExtraEventListener(this.video, "progress", async () => { if ( - !(this.firstPlay && this.data.autoTranslate === 1) || + !this.videoData.videoId || + !this.firstPlay || + this.data.autoTranslate !== 1 || getVideoId(this.site.host, this.video) !== this.videoData.videoId ) { return; } - if (!this.videoData.videoId) { - throw new VOTLocalizedError("VOTNoVideoIDFound"); - } - try { this.firstPlay = false; await this.translateExecutor(this.videoData.videoId); @@ -5793,6 +5786,10 @@ class VideoHandler { debug/* default */.A.log("lipsync mode is playing"); this.audio.play(); } + if (mode == "emptied") { + debug/* default */.A.log("lipsync mode is emptied"); + this.stopTranslation(); + } } // Define a function to handle common events @@ -6156,7 +6153,8 @@ class VideoHandler { } const hide = - !this.video.src && !this.video.currentSrc && !this.video.srcObject; + (!this.video.src && !this.video.currentSrc && !this.video.srcObject) || + !this.videoData.videoId; this.votButton.container.hidden = hide; hide && (this.votMenu.container.hidden = hide); diff --git a/src/index.js b/src/index.js index ae5bf57d..a7b48f2b 100644 --- a/src/index.js +++ b/src/index.js @@ -1278,23 +1278,16 @@ class VideoHandler { this.container.draggable = false; } - addExtraEventListener(this.video, "emptied", () => { - debug.log("lipsync mode is emptied"); - this.stopTranslation(); - }); - addExtraEventListener(this.video, "progress", async () => { if ( - !(this.firstPlay && this.data.autoTranslate === 1) || + !this.videoData.videoId || + !this.firstPlay || + this.data.autoTranslate !== 1 || getVideoId(this.site.host, this.video) !== this.videoData.videoId ) { return; } - if (!this.videoData.videoId) { - throw new VOTLocalizedError("VOTNoVideoIDFound"); - } - try { this.firstPlay = false; await this.translateExecutor(this.videoData.videoId); @@ -1650,6 +1643,10 @@ class VideoHandler { debug.log("lipsync mode is playing"); this.audio.play(); } + if (mode == "emptied") { + debug.log("lipsync mode is emptied"); + this.stopTranslation(); + } } // Define a function to handle common events @@ -2023,7 +2020,8 @@ class VideoHandler { } const hide = - !this.video.src && !this.video.currentSrc && !this.video.srcObject; + (!this.video.src && !this.video.currentSrc && !this.video.srcObject) || + !this.videoData.videoId; this.votButton.container.hidden = hide; hide && (this.votMenu.container.hidden = hide);