@daivietpda/tizentube 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/TizenTube.iml" filepath="$PROJECT_DIR$/.idea/TizenTube.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -1 +1 @@
1
- !function(){"use strict";function e(){e=function(){return t};var t={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var r=t&&t.prototype instanceof m?t:m,a=Object.create(r.prototype),l=new C(o||[]);return i(a,"_invoke",{value:k(e,n,l)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p={};function m(){}function h(){}function f(){}var v={};s(v,a,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(x([])));y&&y!==n&&o.call(y,a)&&(v=y);var b=f.prototype=m.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(i,r,a,l){var c=d(e[i],e,r);if("throw"!==c.type){var s=c.arg,u=s.value;return u&&"object"==typeof u&&o.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(u).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,l)}))}l(c.arg)}var r;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,i){n(e,o,t,i)}))}return r=r?r.then(i,i):i()}})}function k(e,t,n){var o="suspendedStart";return function(i,r){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===i)throw r;return _()}for(n.method=i,n.arg=r;;){var a=n.delegate;if(a){var l=E(a,n);if(l){if(l===p)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var c=d(e,t,n);if("normal"===c.type){if(o=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o="completed",n.method="throw",n.arg=c.arg)}}}function E(e,t){var n=t.method,o=e.iterator[n];if(void 0===o)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=d(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return h.prototype=f,i(b,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:h,configurable:!0}),h.displayName=s(f,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},w(S.prototype),s(S.prototype,l,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,o,i,r){void 0===r&&(r=Promise);var a=new S(u(e,n,o,i),r);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),s(b,c,"Generator"),s(b,a,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return a.type="throw",a.arg=e,t.next=n,o&&(t.method="next",t.arg=void 0),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var l=o.call(r,"catchLoc"),c=o.call(r,"finallyLoc");if(l&&c){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}function t(e,t,n,o,i,r,a){try{var l=e[r](a),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(o,i)}function n(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,a,l=[],c=!0,s=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=r.call(n)).done)&&(l.push(o.value),l.length!==t);c=!0);}catch(e){s=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return l}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=i(e))||t){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){c=!0,a=e},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw a}}}}!function(e){function t(e){return void 0===e?0:Number(e)}function n(e,t){return e!==t&&!(isNaN(e)&&isNaN(t))}self.DOMRect=function(e,o,i,r){var a,l,c,s,u,d,p,m;a=t(e),l=t(o),c=t(i),s=t(r),Object.defineProperties(this,{x:{get:function(){return a},set:function(e){n(a,e)&&(a=e,u=d=void 0)},enumerable:!0},y:{get:function(){return l},set:function(e){n(l,e)&&(l=e,p=m=void 0)},enumerable:!0},width:{get:function(){return c},set:function(e){n(c,e)&&(c=e,u=d=void 0)},enumerable:!0},height:{get:function(){return s},set:function(e){n(s,e)&&(s=e,p=m=void 0)},enumerable:!0},left:{get:function(){return void 0===u&&(u=a+Math.min(0,c)),u},enumerable:!0},right:{get:function(){return void 0===d&&(d=a+Math.max(0,c)),d},enumerable:!0},top:{get:function(){return void 0===p&&(p=l+Math.min(0,s)),p},enumerable:!0},bottom:{get:function(){return void 0===m&&(m=l+Math.max(0,s)),m},enumerable:!0}})}}();var l,c="ytaf-configuration",s={enableAdBlock:!0,enableSponsorBlock:!0,sponsorBlockManualSkips:["intro","outro","filler"],enableSponsorBlockSponsor:!0,enableSponsorBlockIntro:!0,enableSponsorBlockOutro:!0,enableSponsorBlockInteraction:!0,enableSponsorBlockSelfPromo:!0,enableSponsorBlockPreview:!0,enableSponsorBlockMusicOfftopic:!0,enableSponsorBlockFiller:!1,videoSpeed:1,enableDeArrow:!0,enableDeArrowThumbnails:!1,focusContainerColor:"#0f0f0f",routeColor:"#0f0f0f",enableFixedUI:!0,enableHqThumbnails:!1,enableChapters:!0,enableLongPress:!0,enableShorts:!0,dontCheckUpdateUntil:0};try{l=JSON.parse(window.localStorage[c])}catch(B){console.warn("Config read failed:",B),l=s}function u(e){return void 0===l[e]&&(console.warn("Populating key",e,"with default value",s[e]),l[e]=s[e]),l[e]}function d(e,t){console.info("Setting key",e,"to",t),l[e]=t,window.localStorage[c]=JSON.stringify(l)}function p(e,t,n){var o={openPopupAction:{popupType:"TOAST",popup:{overlayToastRenderer:{title:{simpleText:e},subtitle:{simpleText:t}}}}};n&&(o.openPopupAction.popup.overlayToastRenderer.image.thumbnails=n),b(o)}function m(e,t,n,o,i){var r="string"==typeof e?{title:e,subtitle:""}:e,a={openPopupAction:{popupType:"MODAL",popup:{overlaySectionRenderer:{overlay:{overlayTwoPanelRenderer:{actionPanel:{overlayPanelRenderer:{header:{overlayPanelHeaderRenderer:{title:{simpleText:r.title}}},content:{overlayPanelItemListRenderer:{items:t,selectedIndex:n}}}},backButton:{buttonRenderer:{accessibilityData:{accessibilityData:{label:"Back"}},command:{signalAction:{signal:"POPUP_BACK"}}}}}},dismissalCommand:{signalAction:{signal:"POPUP_BACK"}}}},uniqueId:o}};r.subtitle&&(a.openPopupAction.popup.overlaySectionRenderer.overlay.overlayTwoPanelRenderer.actionPanel.overlayPanelRenderer.header.overlayPanelHeaderRenderer.subtitle={simpleText:r.subtitle}),i&&(a.openPopupAction.shouldMatchUniqueId=!0,a.openPopupAction.updateAction=!0),b(a)}function h(e,t,n){var o={compactLinkRenderer:{serviceEndpoint:{commandExecutorCommand:{commands:n}}}};return e&&(o.compactLinkRenderer.title={simpleText:e.title}),e.subtitle&&(o.compactLinkRenderer.subtitle={simpleText:e.subtitle}),t&&(o.compactLinkRenderer.icon={iconType:t.icon}),t&&t.secondaryIcon&&(o.compactLinkRenderer.secondaryIcon={iconType:t.secondaryIcon}),o}function f(e){return{clickTrackingParams:null,showMenuCommand:{contentId:e.videoId,thumbnail:{thumbnails:e.thumbnails},title:{simpleText:e.title},subtitle:{simpleText:e.subtitle},menu:{menuRenderer:{items:[{menuNavigationItemRenderer:{text:{runs:[{text:"Play"}]},navigationEndpoint:{clickTrackingParams:null,watchEndpoint:e.watchEndpointData},trackingParams:null}},{menuServiceItemRenderer:{text:{runs:[{text:"Save to Watch Later"}]},serviceEndpoint:{clickTrackingParams:null,playlistEditEndpoint:{playlistId:"WL",actions:[{addedVideoId:e.videoId,action:"ACTION_ADD_VIDEO"}]}},trackingParams:null}},{menuNavigationItemRenderer:{text:{runs:[{text:"Save to playlist"}]},navigationEndpoint:{clickTrackingParams:null,addToPlaylistEndpoint:{videoId:e.videoId}},trackingParams:null}}],trackingParams:null,accessibility:{accessibilityData:{label:"Video options"}}}}}}}function v(e,t){for(var n=[],o=0,i=0,r=[{name:"Ad block",icon:"DOLLAR_SIGN",value:"enableAdBlock"},{name:"SponsorBlock",icon:"MONEY_HAND",value:"enableSponsorBlock"},{name:"Manual SponsorBlock Segment Skip",icon:"DOLLAR_SIGN",value:null,options:[{name:"Skip Sponsor Segments",icon:"MONEY_HEART",value:"sponsor"},{name:"Skip Intro Segments",icon:"PLAY_CIRCLE",value:"intro"},{name:"Skip Outro Segments",value:"outro"},{name:"Skip Interaction Reminder Segments",value:"interaction"},{name:"Skip Self-Promotion Segments",value:"selfpromo"},{name:"Skip Preview/Recap Segments",value:"preview"},{name:"Skip Tangents/Jokes Segments",value:"filler"},{name:"Skip Off-Topic Music Segments",value:"music_offtopic"}]},{name:"Skip Sponsor Segments",icon:"MONEY_HEART",value:"enableSponsorBlockSponsor"},{name:"Skip Intro Segments",icon:"PLAY_CIRCLE",value:"enableSponsorBlockIntro"},{name:"Skip Outro Segments",value:"enableSponsorBlockOutro"},{name:"Skip Interaction Reminder Segments",value:"enableSponsorBlockInteraction"},{name:"Skip Self-Promotion Segments",value:"enableSponsorBlockSelfPromo"},{name:"Skip Preview/Recap Segments",value:"enableSponsorBlockPreview"},{name:"Skip Tangents/Jokes Segments",value:"enableSponsorBlockFiller"},{name:"Skip Off-Topic Music Segments",value:"enableSponsorBlockMusicOfftopic"},{name:"DeArrow",icon:"VISIBILITY_OFF",value:"enableDeArrow"},{name:"DeArrow Thumbnails",icon:"TV",value:"enableDeArrowThumbnails"},{name:"Fix UI",icon:"STAR",value:"enableFixedUI"},{name:"High Quality Thumbnails",icon:"VIDEO_QUALITY",value:"enableHqThumbnails"},{name:"Long Press",value:"enableLongPress"},{name:"Shorts",icon:"YOUTUBE_SHORTS_FILL_24",value:"enableShorts"}];i<r.length;i++){var a=r[i],l=a.value?u(a.value):null;n.push(h({title:a.name,subtitle:a.subtitle},{icon:a.icon?a.icon:"CHEVRON_DOWN",secondaryIcon:null===l?"CHEVRON_RIGHT":l?"CHECK_BOX":"CHECK_BOX_OUTLINE_BLANK"},null!==l?[{setClientSettingEndpoint:{settingDatas:[{clientSettingEnum:{item:a.value},boolValue:!u(a.value)}]}},{customAction:{action:"SETTINGS_UPDATE",parameters:[o]}}]:[{customAction:{action:"OPTIONS_SHOW",parameters:{options:a.options,selectedIndex:0,update:!1}}}])),o++}m({title:"TizenTube Settings",subtitle:"Made by Reis Can (reisxd) with ❤️"},n,t&&t.length>0?t[0]:0,"tt-settings",e)}var g=setInterval((()=>{document.querySelector("video")&&(!function(){document.querySelector("video").addEventListener("canplay",(()=>{document.getElementsByTagName("video")[0].playbackRate=u("videoSpeed")}));var e=e=>{if(406==e.keyCode||191==e.keyCode)return e.preventDefault(),e.stopPropagation(),"keydown"!==e.type||(y(),!1)};document.addEventListener("keydown",e,!0),document.addEventListener("keypress",e,!0),document.addEventListener("keyup",e,!0)}(),clearInterval(g))}),1e3);function y(){for(var e=u("videoSpeed"),t=0,n=[],o=.25;o<=4;o+=.25)n.push(h({title:`${o}x`},null,[{signalAction:{signal:"POPUP_BACK"}},{setClientSettingEndpoint:{settingDatas:[{clientSettingEnum:{item:"videoSpeed"},intValue:o.toString()}]}},{customAction:{action:"SET_PLAYER_SPEED",parameters:o.toString()}}])),e===o&&(t=n.length-1);n.push(h({title:"Fix stuttering (1.0001x)"},null,[{signalAction:{signal:"POPUP_BACK"}},{setClientSettingEndpoint:{settingDatas:[{clientSettingEnum:{item:"videoSpeed"},intValue:"1.0001"}]}},{customAction:{action:"SET_PLAYER_SPEED",parameters:"1.0001"}}])),m("Playback Speed",n,t,"tt-speed")}function b(e,t){for(var n in window._yttv)if(window._yttv[n]&&window._yttv[n].instance&&window._yttv[n].instance.resolveCommand)return window._yttv[n].instance.resolveCommand(e,t)}function w(e,t){switch(e){case"SETTINGS_UPDATE":v(!0,t);break;case"OPTIONS_SHOW":!function(e,t){var n,o=[],i=u("sponsorBlockManualSkips"),r=a(e.options);try{for(r.s();!(n=r.n()).done;){var l=n.value;o.push(h({title:l.name},{icon:l.icon?l.icon:"CHEVRON_DOWN",secondaryIcon:i.includes(l.value)?"CHECK_BOX":"CHECK_BOX_OUTLINE_BLANK"},[{setClientSettingEndpoint:{settingDatas:[{clientSettingEnum:{item:"sponsorBlockManualSkips"},arrayValue:l.value}]}},{customAction:{action:"OPTIONS_SHOW",parameters:{options:e.options,selectedIndex:e.options.indexOf(l),update:!0}}}]))}}catch(e){r.e(e)}finally{r.f()}m("TizenTube Settings",o,e.selectedIndex,"tt-settings-options",t)}(t,t.update);break;case"SKIP":var n=document.createEvent("Event");n.initEvent("keydown",!0,!0),n.keyCode=27,n.which=27,document.dispatchEvent(n),document.querySelector("video").currentTime=t.time;break;case"TT_SETTINGS_SHOW":v();break;case"TT_SPEED_SETTINGS_SHOW":y();break;case"UPDATE_REMIND_LATER":d("dontCheckUpdateUntil",t);break;case"UPDATE_DOWNLOAD":window.h5vcc.tizentube.InstallAppFromURL(t),p("TizenTube Update","Downloading update, please wait...");break;case"SET_PLAYER_SPEED":var o=Number(t);document.querySelector("video").playbackRate=o}}var S=JSON.parse;for(var k in JSON.parse=function(){var e,t,n,o,i,r,l,c,s,d,p,m,h,f,v,g,y,b=S.apply(this,arguments);(b.adPlacements&&u("enableAdBlock")&&(b.adPlacements=[]),b.playerAds&&u("enableAdBlock")&&(b.playerAds=!1),b.adSlots&&u("enableAdBlock")&&(b.adSlots=[]),null!=b&&null!==(e=b.contents)&&void 0!==e&&null!==(e=e.tvBrowseRenderer)&&void 0!==e&&null!==(e=e.content)&&void 0!==e&&null!==(e=e.tvSurfaceContentRenderer)&&void 0!==e&&null!==(e=e.content)&&void 0!==e&&null!==(e=e.sectionListRenderer)&&void 0!==e&&e.contents&&u("enableAdBlock")&&(b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents=b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents.filter((e=>!e.adSlotRenderer))),!Array.isArray(b)&&null!=b&&b.entries&&u("enableAdBlock"))&&(b.entries=null===(s=b.entries)||void 0===s?void 0:s.filter((e=>{var t;return!(null!=e&&null!==(t=e.command)&&void 0!==t&&null!==(t=t.reelWatchEndpoint)&&void 0!==t&&null!==(t=t.adClientParams)&&void 0!==t&&t.isAd)})));if(null!=b&&null!==(t=b.title)&&void 0!==t&&t.runs&&(d=b,m=function(e,t,n){var o={settingCategoryCollectionRenderer:{items:t,categoryId:"tizentube_category",focused:!1,trackingParams:"null"}};return o.settingCategoryCollectionRenderer.title={runs:[{text:n}]},o}(0,[{settingActionRenderer:{title:{runs:[{text:p="TizenTube Settings"}]},serviceEndpoint:{customAction:{action:"TT_SETTINGS_SHOW",parameters:[]}},summary:{runs:[{text:"Open TizenTube Settings"}]},trackingParams:"null",actionLabel:{runs:[{text:p}]},itemId:"tizentube_open_action",thumbnail:{thumbnails:[{url:"https://www.gstatic.com/ytlr/img/parent_code.png"}]}}}],"TizenTube"),d.items.push(m)),null!=b&&null!==(n=b.contents)&&void 0!==n&&null!==(n=n.tvBrowseRenderer)&&void 0!==n&&null!==(n=n.content)&&void 0!==n&&null!==(n=n.tvSurfaceContentRenderer)&&void 0!==n&&null!==(n=n.content)&&void 0!==n&&null!==(n=n.sectionListRenderer)&&void 0!==n&&n.contents&&E(b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents),null!=b&&null!==(o=b.contents)&&void 0!==o&&null!==(o=o.sectionListRenderer)&&void 0!==o&&o.contents&&E(b.contents.sectionListRenderer.contents),null!=b&&null!==(i=b.continuationContents)&&void 0!==i&&null!==(i=i.sectionListContinuation)&&void 0!==i&&i.contents&&E(b.continuationContents.sectionListContinuation.contents),null!=b&&null!==(r=b.continuationContents)&&void 0!==r&&null!==(r=r.horizontalListContinuation)&&void 0!==r&&r.items&&(T(b.continuationContents.horizontalListContinuation.items),P(b.continuationContents.horizontalListContinuation.items),C(b.continuationContents.horizontalListContinuation.items)),!u("enableShorts")&&null!=b&&null!==(l=b.contents)&&void 0!==l&&null!==(l=l.tvBrowseRenderer)&&void 0!==l&&null!==(l=l.content)&&void 0!==l&&null!==(l=l.tvSurfaceContentRenderer)&&void 0!==l&&l.content&&(b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents=b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents.filter((e=>{var t;return"TVHTML5_SHELF_RENDERER_TYPE_SHORTS"!==(null===(t=e.shelfRenderer)||void 0===t?void 0:t.tvhtml5ShelfRendererType)}))),u("sponsorBlockManualSkips").length>0&&null!=b&&null!==(c=b.playerOverlays)&&void 0!==c&&c.playerOverlayRenderer){var w,k=u("sponsorBlockManualSkips"),x=[];if(null!==(w=window)&&void 0!==w&&null!==(w=w.sponsorblock)&&void 0!==w&&w.segments){var _,R=a(window.sponsorblock.segments);try{for(R.s();!(_=R.n()).done;){var N=_.value;if(k.includes(N.category)){var I=(h=`Skip ${N.category}`,f="SKIP_NEXT",v={clickTrackingParams:null,showEngagementPanelEndpoint:{customAction:{action:"SKIP",parameters:{time:N.segment[1]}}}},g=1e3*N.segment[0],y=1e3*N.segment[1]-1e3*N.segment[0],{timelyActionRenderer:{actionButtons:[{buttonRenderer:{isDisabled:!1,text:{runs:[{text:h}]},icon:{iconType:f},trackingParams:null,command:v}}],triggerTimeMs:g,timeoutMs:y,type:""}});x.push(I)}}}catch(e){R.e(e)}finally{R.f()}b.playerOverlays.playerOverlayRenderer.timelyActionRenderers=x}}return b},window.JSON.parse=JSON.parse,window._yttv)window._yttv[k]&&window._yttv[k].JSON&&window._yttv[k].JSON.parse&&(window._yttv[k].JSON.parse=JSON.parse);function E(e){var t,n=a(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;o.shelfRenderer&&(T(o.shelfRenderer.content.horizontalListRenderer.items),P(o.shelfRenderer.content.horizontalListRenderer.items),C(o.shelfRenderer.content.horizontalListRenderer.items))}}catch(e){n.e(e)}finally{n.f()}}function T(e){var t,n=a(e);try{var o=function(){var n=t.value;if(n.adSlotRenderer){var o=e.indexOf(n);return e.splice(o,1),"continue"}if(u("enableDeArrow")){var i=n.tileRenderer.contentId;fetch(`https://sponsor.ajay.app/api/branding?videoID=${i}`).then((e=>e.json())).then((e=>{if(e.titles.length>0){var t=e.titles.reduce(((e,t)=>e.votes>t.votes?e:t));n.tileRenderer.metadata.tileMetadataRenderer.title.simpleText=t.title}if(e.thumbnails.length>0&&u("enableDeArrowThumbnails")){var o=e.thumbnails.reduce(((e,t)=>e.votes>t.votes?e:t));o.timestamp&&(n.tileRenderer.header.tileHeaderRenderer.thumbnail.thumbnails=[{url:`https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${i}&time=${o.timestamp}`,width:1280,height:640}])}}))}};for(n.s();!(t=n.n()).done;)o()}catch(e){n.e(e)}finally{n.f()}}function P(e){var t,n=a(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;if("TILE_STYLE_YTLR_DEFAULT"===o.tileRenderer.style&&u("enableHqThumbnails")){var i=o.tileRenderer.contentId,r=o.tileRenderer.header.tileHeaderRenderer.thumbnail.thumbnails[0].url.split("?")[1];o.tileRenderer.header.tileHeaderRenderer.thumbnail.thumbnails=[{url:`https://i.ytimg.com/vi/${i}/sddefault.jpg${r?`?${r}`:""}`,width:640,height:480}]}}}catch(e){n.e(e)}finally{n.f()}}function C(e){if(u("enableLongPress")){var t,n=a(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;if("TILE_STYLE_YTLR_DEFAULT"===o.tileRenderer.style&&!o.tileRenderer.onLongPressCommand){var i=o.tileRenderer.metadata.tileMetadataRenderer.lines[0].lineRenderer.items[0].lineItemRenderer.text,r=f({videoId:o.tileRenderer.contentId,thumbnails:o.tileRenderer.header.tileHeaderRenderer.thumbnail.thumbnails,title:o.tileRenderer.metadata.tileMetadataRenderer.title.simpleText,subtitle:i.runs?i.runs[0].text:i.simpleText,watchEndpointData:o.tileRenderer.onSelectCommand.watchEndpoint});o.tileRenderer.onLongPressCommand=r}}}catch(e){n.e(e)}finally{n.f()}}}var x=function e(t){function n(e,t){return e>>>t|e<<32-t}for(var o,i,r=Math.pow,a=r(2,32),l="length",c="",s=[],u=8*t[l],d=e.h=e.h||[],p=e.k=e.k||[],m=p[l],h={},f=2;m<64;f++)if(!h[f]){for(o=0;o<313;o+=f)h[o]=f;d[m]=r(f,.5)*a|0,p[m++]=r(f,1/3)*a|0}for(t+="€";t[l]%64-56;)t+="\0";for(o=0;o<t[l];o++){if((i=t.charCodeAt(o))>>8)return;s[o>>2]|=i<<(3-o)%4*8}for(s[s[l]]=u/a|0,s[s[l]]=u,i=0;i<s[l];){var v=s.slice(i,i+=16),g=d;for(d=d.slice(0,8),o=0;o<64;o++){var y=v[o-15],b=v[o-2],w=d[0],S=d[4],k=d[7]+(n(S,6)^n(S,11)^n(S,25))+(S&d[5]^~S&d[6])+p[o]+(v[o]=o<16?v[o]:v[o-16]+(n(y,7)^n(y,18)^y>>>3)+v[o-7]+(n(b,17)^n(b,19)^b>>>10)|0);(d=[k+((n(w,2)^n(w,13)^n(w,22))+(w&d[1]^w&d[2]^d[1]&d[2]))|0].concat(d))[4]=d[4]+k|0}for(o=0;o<8;o++)d[o]=d[o]+g[o]|0}for(o=0;o<8;o++)for(i=3;i+1;i--){var E=d[o]>>8*i&255;c+=(E<16?0:"")+E.toString(16)}return c},_={sponsor:{color:"#00d400",opacity:"0.7",name:"sponsored segment"},intro:{color:"#00ffff",opacity:"0.7",name:"intro"},outro:{color:"#0202ed",opacity:"0.7",name:"outro"},interaction:{color:"#cc00ff",opacity:"0.7",name:"interaction reminder"},selfpromo:{color:"#ffff00",opacity:"0.7",name:"self-promotion"},preview:{color:"#008fd6",opacity:"0.7",name:"recap or preview"},filler:{color:"#7300FF",opacity:"0.9",name:"tangents"},music_offtopic:{color:"#ff9900",opacity:"0.7",name:"non-music part"}};class R{constructor(e){n(this,"video",null),n(this,"active",!0),n(this,"attachVideoTimeout",null),n(this,"nextSkipTimeout",null),n(this,"sliderInterval",null),n(this,"observer",null),n(this,"scheduleSkipHandler",null),n(this,"durationChangeHandler",null),n(this,"segments",null),n(this,"skippableCategories",[]),n(this,"manualSkippableCategories",[]),this.videoID=e}init(){var n,o=this;return(n=e().mark((function t(){var n,i,r,a,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=x(o.videoID).substring(0,4),i=["sponsor","intro","outro","interaction","selfpromo","preview","filler","music_offtopic"],e.next=4,fetch(`https://sponsorblock.inf.re/api/skipSegments/${n}?categories=${encodeURIComponent(JSON.stringify(i))}`);case 4:return r=e.sent,e.next=7,r.json();case 7:if(a=e.sent,l=a.find((e=>e.videoID===o.videoID)),console.info(o.videoID,"Got it:",l),l&&l.segments&&l.segments.length){e.next=13;break}return console.info(o.videoID,"No segments found."),e.abrupt("return");case 13:o.segments=l.segments,o.manualSkippableCategories=u("sponsorBlockManualSkips"),o.skippableCategories=o.getSkippableCategories(),o.scheduleSkipHandler=()=>o.scheduleSkip(),o.durationChangeHandler=()=>o.buildOverlay(),o.attachVideo(),o.buildOverlay();case 20:case"end":return e.stop()}}),t)})),function(){var e=this,o=arguments;return new Promise((function(i,r){var a=n.apply(e,o);function l(e){t(a,i,r,l,c,"next",e)}function c(e){t(a,i,r,l,c,"throw",e)}l(void 0)}))})()}getSkippableCategories(){var e=[];return u("enableSponsorBlockSponsor")&&e.push("sponsor"),u("enableSponsorBlockIntro")&&e.push("intro"),u("enableSponsorBlockOutro")&&e.push("outro"),u("enableSponsorBlockInteraction")&&e.push("interaction"),u("enableSponsorBlockSelfPromo")&&e.push("selfpromo"),u("enableSponsorBlockPreview")&&e.push("preview"),u("enableSponsorBlockFiller")&&e.push("filler"),u("enableSponsorBlockMusicOfftopic")&&e.push("music_offtopic"),e}attachVideo(){if(clearTimeout(this.attachVideoTimeout),this.attachVideoTimeout=null,this.video=document.querySelector("video"),!this.video)return console.info(this.videoID,"No video yet..."),void(this.attachVideoTimeout=setTimeout((()=>this.attachVideo()),100));console.info(this.videoID,"Video found, binding..."),this.video.addEventListener("play",this.scheduleSkipHandler),this.video.addEventListener("pause",this.scheduleSkipHandler),this.video.addEventListener("timeupdate",this.scheduleSkipHandler),this.video.addEventListener("durationchange",this.durationChangeHandler)}buildOverlay(){if(this.segmentsoverlay)console.info("Overlay already built");else if(this.video&&this.video.duration){var e=this.video.duration;this.segmentsoverlay=document.createElement("div"),this.segments.forEach((t=>{var n=o(t.segment,2),i=n[0],r=n[1],a=_[t.category]||{color:"blue",opacity:.7},l=`translateX(${i/e*100}%) scaleX(${(r-i)/e})`,c=document.createElement("div");c.classList.add("ytlr-progress-bar__played"),c.style.background=a.color,c.style.opacity=a.opacity,c.style["-webkit-transform"]=l,console.info("Generated element",c,"from",t,l),this.segmentsoverlay.appendChild(c)})),this.observer=new MutationObserver((e=>{e.forEach((e=>{if(e.removedNodes){var t,n=a(e.removedNodes);try{for(n.s();!(t=n.n()).done;){t.value===this.segmentsoverlay&&(console.info("bringing back segments overlay"),this.slider.appendChild(this.segmentsoverlay))}}catch(e){n.e(e)}finally{n.f()}}}))})),this.sliderInterval=setInterval((()=>{this.slider=document.querySelector(".ytlr-progress-bar__slider"),this.slider&&(clearInterval(this.sliderInterval),this.sliderInterval=null,this.observer.observe(this.slider,{childList:!0}),this.slider.appendChild(this.segmentsoverlay))}),500)}else console.info("No video duration yet")}scheduleSkip(){if(clearTimeout(this.nextSkipTimeout),this.nextSkipTimeout=null,this.active)if(this.video.paused)console.info(this.videoID,"Currently paused, ignoring...");else{var e=this.segments.filter((e=>e.segment[0]>this.video.currentTime-.3&&e.segment[1]>this.video.currentTime-.3));if(e.sort(((e,t)=>e.segment[0]-t.segment[0])),e.length){var t=o(e,1)[0],n=o(t.segment,2),i=n[0],r=n[1];console.info(this.videoID,"Scheduling skip of",t,"in",i-this.video.currentTime),this.nextSkipTimeout=setTimeout((()=>{var e;if(this.video.paused)console.info(this.videoID,"Currently paused, ignoring...");else if(this.skippableCategories.includes(t.category)){var n=(null===(e=_[t.category])||void 0===e?void 0:e.name)||t.category;console.info(this.videoID,"Skipping",t),this.manualSkippableCategories.includes(t.category)||(p("SponsorBlock",`Skipping ${n}`),this.video.currentTime=r+.1,this.scheduleSkip())}else console.info(this.videoID,"Segment",t.category,"is not skippable, ignoring...")}),1e3*(i-this.video.currentTime))}else console.info(this.videoID,"No more segments")}else console.info(this.videoID,"No longer active, ignoring...")}destroy(){console.info(this.videoID,"Destroying"),this.active=!1,this.nextSkipTimeout&&(clearTimeout(this.nextSkipTimeout),this.nextSkipTimeout=null),this.attachVideoTimeout&&(clearTimeout(this.attachVideoTimeout),this.attachVideoTimeout=null),this.sliderInterval&&(clearInterval(this.sliderInterval),this.sliderInterval=null),this.observer&&(this.observer.disconnect(),this.observer=null),this.segmentsoverlay&&(this.segmentsoverlay.remove(),this.segmentsoverlay=null),this.video&&(this.video.removeEventListener("play",this.scheduleSkipHandler),this.video.removeEventListener("pause",this.scheduleSkipHandler),this.video.removeEventListener("timeupdate",this.scheduleSkipHandler),this.video.removeEventListener("durationchange",this.durationChangeHandler))}}window.sponsorblock=null,window.addEventListener("hashchange",(()=>{var e=new URL(location.hash.substring(1),location.href).search.replace("?v=","").split("&")[0],t=e&&(!window.sponsorblock||window.sponsorblock.videoID!=e);if(console.info("hashchange",e,window.sponsorblock,window.sponsorblock?window.sponsorblock.videoID:null,t),t){if(window.sponsorblock){try{window.sponsorblock.destroy()}catch(e){console.warn("window.sponsorblock.destroy() failed!",e)}window.sponsorblock=null}u("enableSponsorBlock")?(window.sponsorblock=new R(e),window.sponsorblock.init()):console.info("SponsorBlock disabled, not loading")}}),!1),function(){if(!("navigate"in window)){var e={37:"left",38:"up",39:"right",40:"down"},t=null,n=null,o={element:null,rect:null},i=null;window.navigate=l,window.Element.prototype.spatialNavigationSearch=p,window.Element.prototype.focusableAreas=y,window.Element.prototype.getSpatialNavigationContainer=v,window.CSS&&CSS.registerProperty&&(""===window.getComputedStyle(document.documentElement).getPropertyValue("--spatial-navigation-contain")&&CSS.registerProperty({name:"--spatial-navigation-contain",syntax:"auto | contain",inherits:!1,initialValue:"auto"}),""===window.getComputedStyle(document.documentElement).getPropertyValue("--spatial-navigation-action")&&CSS.registerProperty({name:"--spatial-navigation-action",syntax:"auto | focus | scroll",inherits:!1,initialValue:"auto"}),""===window.getComputedStyle(document.documentElement).getPropertyValue("--spatial-navigation-function")&&CSS.registerProperty({name:"--spatial-navigation-function",syntax:"normal | grid",inherits:!1,initialValue:"normal"})),K(!1),window.addEventListener("load",(()=>{r()}))}function r(){window.addEventListener("keydown",(o=>{var i=parent&&parent.__spatialNavigation__.keyMode||window.__spatialNavigation__.keyMode,r=document.activeElement,a=e[o.keyCode];if(9===o.keyCode&&(n=null),!(!i||"NONE"===i||"SHIFTARROW"===i&&!o.shiftKey||"ARROW"===i&&o.shiftKey||o.defaultPrevented)){var c={left:!0,up:!0,right:!0,down:!0};"INPUT"!==r.nodeName&&"TEXTAREA"!==r.nodeName||(c=function(t){var n=["email","date","month","number","time","week"],o=["password","text","search","tel","url",null],i=document.activeElement,r={left:!1,up:!1,right:!1,down:!1},a=e[t.keyCode];if(void 0===a)return r;if(!n.includes(i.getAttribute("type"))||"up"!==a&&"down"!==a)if(o.includes(i.getAttribute("type"))||"TEXTAREA"===i.nodeName){var l=i.selectionStart,c=i.selectionEnd;l===c&&(0===l&&(r.left=!0,r.up=!0),c===i.value.length&&(r.right=!0,r.down=!0))}else r[a]=!0;else r[a]=!0;return r}(o)),c[a]&&(o.preventDefault(),t=new Map,l(a),t=null,n=null)}})),document.addEventListener("mouseup",(e=>{n={x:e.clientX,y:e.clientY}})),window.addEventListener("focusin",(e=>{e.target!==window&&(o.element=e.target,o.rect=e.target.getBoundingClientRect())}))}function l(e){var t=function(){var e=document.activeElement;if(!e||e===document.body&&!document.querySelector(":focus")){if(o.element&&e!==o.element){var t=window.getComputedStyle(o.element,null),n=["hidden","collapse"];if(o.element.disabled||n.includes(t.getPropertyValue("visibility")))return e=o.element}e=document.documentElement}!o.element||0!==$(o.element).height&&0!==$(o.element).width||(i=o.rect);if(!I(e)){var r=g(e);if(r&&(r===window||"auto"===S(r)))return r}return e}(),r=t,a=null;n&&(null===(a=document.elementFromPoint(n.x,n.y))&&(a=document.body),L(a)&&!T(a)?n=null:r=T(a)?a:a.getSpatialNavigationContainer()),r!==document&&r!==document.documentElement||(r=document.body||document.documentElement);var l=null;if((T(r)||"BODY"===r.nodeName)&&"INPUT"!==r.nodeName){"IFRAME"===r.nodeName&&(r=r.contentDocument.documentElement),l=r;if(document.activeElement===t||document.activeElement===document.body&&t===document.documentElement){if("scroll"===S(r)){if(s(r,e))return}else if("focus"===S(r)){if(c(r.spatialNavigationSearch(e,{container:r,candidates:u(r,{mode:"all"})}),e))return}else if("auto"===S(r)&&(c(r.spatialNavigationSearch(e,{container:r}),e)||s(r,e)))return}else l=l.getSpatialNavigationContainer()}var d=(l=r.getSpatialNavigationContainer()).parentElement?l.getSpatialNavigationContainer():null;if(d||window.location===window.parent.location||(d=window.parent.document.documentElement),"scroll"===S(l)){if(s(l,e))return}else"focus"===S(l)?k(r,l,d,e,"all"):"auto"===S(l)&&k(r,l,d,e,"visible")}function c(e,t){if(e){if(!b("beforefocus",e,null,t))return!0;var o=e.getSpatialNavigationContainer();return o!==window&&"focus"===S(o)?e.focus():e.focus({preventScroll:!0}),n=null,!0}return!1}function s(e,t){return x(e,t)&&!N(e,t)?(E(e,t),!0):!e.parentElement&&!R(e,t)&&(E(e.ownerDocument.documentElement,t),!0)}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{mode:"visible"},n=[];if(e.childElementCount>0){e.parentElement||(e=e.getElementsByTagName("body")[0]||document.body);var o,i=a(e.children);try{for(i.s();!(o=i.n()).done;){var r=o.value;P(r)?n.push(r):L(r)?(n.push(r),!T(r)&&r.childElementCount&&(n=n.concat(u(r,{mode:"all"})))):r.childElementCount&&(n=n.concat(u(r,{mode:"all"})))}}catch(e){i.e(e)}finally{i.f()}}return"all"===t.mode?n:n.filter(A)}function d(e,t,n,o){var i=e;return o=o||i.getSpatialNavigationContainer(),m(i,n=!n||n.length<=0?u(o):n,t,o)}function p(e,t){var o,r=this,a=[],l=[],c=function(e){var t=e.getSpatialNavigationContainer(),n=t.focusableAreas(),o=[];return n.forEach((t=>{e!==t&&O(t,e)&&o.push(t)})),o}(r);t||(t={});var s=r.getSpatialNavigationContainer(),p=u(s),m=t.container||s;t.container&&s.contains(t.container)&&(p=p.concat(u(m)));var v=t.candidates&&t.candidates.length>0?t.candidates.filter((e=>m.contains(e))):p.filter((e=>m.contains(e)&&m!==e));if(v&&v.length>0){v.forEach((e=>{e!==r&&(r.contains(e)&&r!==e?a:l).push(e)}));var g=c.filter((e=>!a.includes(e))),y=v.filter((e=>T(e)&&O(r,e))).map((e=>e.focusableAreas())).flat().filter((e=>e!==r));if(a=a.concat(g).filter((e=>m.contains(e))),(l=l.concat(y).filter((e=>m.contains(e)))).length>0&&(l=d(r,e,l,m)),i&&(o=h(r,d(r,e,a,m),e)),a&&a.length>0&&"INPUT"!==r.nodeName&&(o=function(e,t,o){return f(e,t,o,n?F:j)}(r,a,e)),(o=o||h(r,l,e))&&P(o)){var b=u(o,{mode:"all"}),w=b.length>0?r.spatialNavigationSearch(e,{candidates:b,container:o}):null;w?o=w:L(o)||(v.splice(v.indexOf(o),1),o=v.length?r.spatialNavigationSearch(e,{candidates:v,container:m}):null)}return o}return null}function m(e,t,n,o){var r,a=e.getSpatialNavigationContainer();return void 0===n?t:(r=a.parentElement&&o!==a&&!A(e)?$(a):i||$(e),!T(e)&&"BODY"!==e.nodeName||"INPUT"===e.nodeName?t.filter((t=>{var i=$(t),a="IFRAME"===t.nodeName?t.contentDocument.body:null;return o.contains(t)&&t!==e&&a!==e&&B(i,r,n)&&!M(r,i)})):t.filter((t=>{var i=$(t);return o.contains(t)&&(e.contains(t)&&M(r,i)&&t!==e||B(i,r,n))})))}function h(e,t,n){var o,r,a=e.getSpatialNavigationContainer(),l=getComputedStyle(a).getPropertyValue("--spatial-navigation-function"),c=i||$(e);if("grid"===l)(r=t.filter((e=>V(c,$(e),n)))).length>0&&(t=r),o=q;else o=W;return f(e,t,n,o)}function f(e,t,n,o){var r=null;window.location===window.parent.location||"BODY"!==e.nodeName&&"HTML"!==e.nodeName?r=i||e.getBoundingClientRect():((r=window.frameElement.getBoundingClientRect()).x=0,r.y=0);var a=Number.POSITIVE_INFINITY,l=[];if(t)for(var c=0;c<t.length;c++){var s=o(r,$(t[c]),n);s<a?(a=s,l=[t[c]]):s===a&&l.push(t[c])}return 0===l.length?null:l.length>1&&o===q?f(e,l,n,z):l[0]}function v(){var e=this;do{if(!e.parentElement){e=window.location!==window.parent.location?window.parent.document.documentElement:window.document.documentElement;break}e=e.parentElement}while(!T(e));return e}function g(e){var t=e;do{if(!t.parentElement){t=window.location!==window.parent.location?window.parent.document.documentElement:window.document.documentElement;break}t=t.parentElement}while(!C(t)||!A(t));return t!==document&&t!==document.documentElement||(t=window),t}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{mode:"visible"},t=this.parentElement?this:document.body,n=Array.prototype.filter.call(t.getElementsByTagName("*"),L);return"all"===e.mode?n:n.filter(A)}function b(e,t,n,o){if(["beforefocus","notarget"].includes(e)){var i=new CustomEvent("nav"+e,{bubbles:!0,cancelable:!0,detail:{causedTarget:n,dir:o}});return t.dispatchEvent(i)}}function w(e,t){return(e.style.getPropertyValue(`--${t}`)||"").trim()}function S(e){return w(e,"spatial-navigation-action")||"auto"}function k(e,t,n,o,i){for(var r={candidates:u(t,{mode:i}),container:t};n;){if(c(e.spatialNavigationSearch(o,r),o))return;if("visible"===i&&s(t,o))return;if(!b("notarget",t,e,o))return;t===document||t===document.documentElement?window.location!==window.parent.location&&(t=(e=window.frameElement).ownerDocument.documentElement):t=n,r={candidates:u(t,{mode:i}),container:t};var a=t.getSpatialNavigationContainer();n=a!==t?a:null}r={candidates:u(t,{mode:i}),container:t},!n&&t&&c(e.spatialNavigationSearch(o,r),o)||b("notarget",r.container,e,o)&&("auto"!==S(t)||"visible"!==i||s(t,o))}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e)switch(t){case"left":e.scrollLeft-=40+n;break;case"right":e.scrollLeft+=40+n;break;case"up":e.scrollTop-=40+n;break;case"down":e.scrollTop+=40+n}}function T(e){return!e.parentElement||"IFRAME"===e.nodeName||C(e)||function(e){return"contain"===w(e,"spatial-navigation-contain")}(e)}function P(e){return"delegable"===w(e,"spatial-navigation-contain")}function C(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("overflow-x"),o=t.getPropertyValue("overflow-y");return!!("visible"!==n&&"clip"!==n&&_(e,"left")||"visible"!==o&&"clip"!==o&&_(e,"down"))}function x(e,t){if(e&&"object"==typeof e){if(t&&"string"==typeof t){if(_(e,t)){var n=window.getComputedStyle(e,null),o=n.getPropertyValue("overflow-x"),i=n.getPropertyValue("overflow-y");switch(t){case"left":case"right":return"visible"!==o&&"clip"!==o&&"hidden"!==o;case"up":case"down":return"visible"!==i&&"clip"!==i&&"hidden"!==i}}return!1}return"HTML"===e.nodeName||"BODY"===e.nodeName||C(e)&&_(e)}}function _(e,t){if(e&&"object"==typeof e){if(!t||"string"!=typeof t)return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight;switch(t){case"left":case"right":return e.scrollWidth>e.clientWidth;case"up":case"down":return e.scrollHeight>e.clientHeight}return!1}}function R(e,t){var n=!1;switch(t){case"left":n=0===e.scrollLeft;break;case"right":n=e.scrollWidth-e.scrollLeft-e.clientWidth==0;break;case"up":n=0===e.scrollTop;break;case"down":n=e.scrollHeight-e.scrollTop-e.clientHeight==0}return n}function N(e,t){if(x(e,t)){var n=e.scrollTop,o=e.scrollLeft,i=e.scrollHeight-e.clientHeight,r=e.scrollWidth-e.clientWidth;switch(t){case"left":return 0===o;case"right":return Math.abs(o-r)<=1;case"up":return 0===n;case"down":return Math.abs(n-i)<=1}}return!1}function I(e){var t=e.getBoundingClientRect(),n=g(e),o=null;return!(!M(o=n!==window?$(n):new DOMRect(0,0,window.innerWidth,window.innerHeight),t)||!M(o,t))}function L(e){return!(e.tabIndex<0||function(e){return"A"===e.tagName&&null===e.getAttribute("href")&&null===e.getAttribute("tabIndex")}(e)||function(e){return!!["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(e.tagName)&&e.disabled}(e)||function(e){return e.inert&&!e.ownerDocument.documentElement.inert}(e)||!function(e){return!!D(e.parentElement)&&!(!D(e)||"0"===e.style.opacity||"0px"===window.getComputedStyle(e).height||"0px"===window.getComputedStyle(e).width)}(e))&&(!!(!e.parentElement||x(e)&&_(e)||e.tabIndex>=0)||void 0)}function A(e){return!e.parentElement||D(e)&&function(e){var t=$(e);if("IFRAME"!==e.nodeName&&(t.top<0||t.left<0||t.top>e.ownerDocument.documentElement.clientHeight||t.left>e.ownerDocument.documentElement.clientWidth))return!1;var n=parseInt(e.offsetWidth)/10,o=parseInt(e.offsetHeight)/10;n=isNaN(n)?1:n,o=isNaN(o)?1:o;var i={middle:[(t.left+t.right)/2,(t.top+t.bottom)/2],leftTop:[t.left+n,t.top+o],rightBottom:[t.right-n,t.bottom-o]};for(var r in i){var a=e.ownerDocument.elementFromPoint(...i[r]);if(e===a||e.contains(a))return!0}return!1}(e)}function O(e,t){var n=$(e),o=$(t||e.getSpatialNavigationContainer());return!(n.left<o.left||n.right>o.right||n.top<o.top||n.bottom>o.bottom)}function D(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(n)}function M(e,t){var n=e.left<=t.right&&e.right>=t.right,o=e.left<=t.left&&e.right>=t.left,i=e.top<=t.top&&e.bottom>=t.top,r=e.top<=t.bottom&&e.bottom>=t.bottom;return(n||o)&&(i||r)}function B(e,t,n){switch(n){case"left":return H(t,e);case"right":return H(e,t);case"up":return U(t,e);case"down":return U(e,t);default:return!1}}function H(e,t){return e.left>=t.right||e.left>=t.left&&e.right>t.right&&e.bottom>t.top&&e.top<t.bottom}function U(e,t){return e.top>=t.bottom||e.top>=t.top&&e.bottom>t.bottom&&e.left<t.right&&e.right>t.left}function V(e,t,n){switch(n){case"left":case"right":return e.bottom>t.top&&e.top<t.bottom;case"up":case"down":return e.right>t.left&&e.left<t.right;default:return!1}}function F(e,t,o){var i=Y(o,n,t),r=Math.abs(i.entryPoint.x-i.exitPoint.x),a=Math.abs(i.entryPoint.y-i.exitPoint.y);return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}function j(e,t,n){var o={left:"right",right:"left",up:"bottom",down:"top"}[n];return Math.abs(e[o]-t[o])}function W(e,t,n){var o,i,r=0,a=0,l=Y(n,e,t),c=Math.abs(l.entryPoint.x-l.exitPoint.x),s=Math.abs(l.entryPoint.y-l.exitPoint.y),u=Math.sqrt(Math.pow(c,2)+Math.pow(s,2)),d=function(e,t){var n={width:0,height:0,area:0},o=[Math.max(e.left,t.left),Math.max(e.top,t.top)],i=[Math.min(e.right,t.right),Math.min(e.bottom,t.bottom)];n.width=Math.abs(o[0]-i[0]),n.height=Math.abs(o[1]-i[1]),o[0]>=i[0]||o[1]>=i[1]||(n.area=Math.sqrt(n.width*n.height));return n}(e,t),p=d.area;switch(n){case"left":case"right":V(e,t,n)?a=Math.min(d.height/e.height,1):r=e.height/2,o=30*(s+r),i=5*a;break;case"up":case"down":V(e,t,n)?a=Math.min(d.width/e.width,1):r=e.width/2,o=2*(c+r),i=5*a;break;default:o=0,i=0}return u+o-i-p}function z(e,t,n){var o=Y(n,e,t),i=Math.abs(o.entryPoint.x-o.exitPoint.x),r=Math.abs(o.entryPoint.y-o.exitPoint.y);return Math.sqrt(Math.pow(i,2)+Math.pow(r,2))}function q(e,t,n){var o=Y(n,e,t);return"left"===n||"right"===n?Math.abs(o.entryPoint.x-o.exitPoint.x):Math.abs(o.entryPoint.y-o.exitPoint.y)}function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"down",t=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,i={entryPoint:{x:0,y:0},exitPoint:{x:0,y:0}};if(n){switch(i.exitPoint=t,e){case"left":i.entryPoint.x=o.right;break;case"up":i.entryPoint.y=o.bottom;break;case"right":i.entryPoint.x=o.left;break;case"down":i.entryPoint.y=o.top}switch(e){case"left":case"right":n.y<=o.top?i.entryPoint.y=o.top:n.y<o.bottom?i.entryPoint.y=n.y:i.entryPoint.y=o.bottom;break;case"up":case"down":n.x<=o.left?i.entryPoint.x=o.left:n.x<o.right?i.entryPoint.x=n.x:i.entryPoint.x=o.right}}else{switch(e){case"left":i.exitPoint.x=t.left,i.entryPoint.x=o.right<t.left?o.right:t.left;break;case"up":i.exitPoint.y=t.top,i.entryPoint.y=o.bottom<t.top?o.bottom:t.top;break;case"right":i.exitPoint.x=t.right,i.entryPoint.x=o.left>t.right?o.left:t.right;break;case"down":i.exitPoint.y=t.bottom,i.entryPoint.y=o.top>t.bottom?o.top:t.bottom}switch(e){case"left":case"right":U(t,o)?(i.exitPoint.y=t.top,i.entryPoint.y=o.bottom<t.top?o.bottom:t.top):U(o,t)?(i.exitPoint.y=t.bottom,i.entryPoint.y=o.top>t.bottom?o.top:t.bottom):(i.exitPoint.y=Math.max(t.top,o.top),i.entryPoint.y=i.exitPoint.y);break;case"up":case"down":H(t,o)?(i.exitPoint.x=t.left,i.entryPoint.x=o.right<t.left?o.right:t.left):H(o,t)?(i.exitPoint.x=t.right,i.entryPoint.x=o.left>t.right?o.left:t.right):(i.exitPoint.x=Math.max(t.left,o.left),i.entryPoint.x=i.exitPoint.x)}}return i}function $(e){var n=t&&t.get(e);if(!n){var o=e.getBoundingClientRect();n={top:Number(o.top.toFixed(2)),right:Number(o.right.toFixed(2)),bottom:Number(o.bottom.toFixed(2)),left:Number(o.left.toFixed(2)),width:Number(o.width.toFixed(2)),height:Number(o.height.toFixed(2))},t&&t.set(e,n)}return n}function K(e){var t=window.__spatialNavigation__&&window.__spatialNavigation__.keyMode;window.__spatialNavigation__=!1===e?G():Object.assign(G(),function(){function e(e,t){return x(e,t)&&!N(e,t)||!e.parentElement&&!R(e,t)}function t(t,n,o,i){var r=n,a=null;if(r!==document&&r!==document.documentElement||(r=document.body||document.documentElement),(T(r)||"BODY"===r.nodeName)&&"INPUT"!==r.nodeName){"IFRAME"===r.nodeName&&(r=r.contentDocument.body);var l=u(r,i);if(Array.isArray(l)&&l.length>0)return t?d(r,o,l):r.spatialNavigationSearch(o,{candidates:l});if(e(r,o))return t?[]:r}var c=r.getSpatialNavigationContainer(),s=c.parentElement?c.getSpatialNavigationContainer():null;for(s||window.location===window.parent.location||(s=window.parent.document.documentElement);s;){var p=m(r,u(c,i),o,c);if(Array.isArray(p)&&p.length>0){if(a=r.spatialNavigationSearch(o,{candidates:p,container:c}))return t?p:a}else{if(e(c,o))return t?[]:r;if(c===document||c===document.documentElement){if(c=window.document.documentElement,window.location!==window.parent.location){if(r=window.frameElement,!(c=window.parent.document.documentElement).parentElement){s=null;break}s=c.getSpatialNavigationContainer()}}else{if(L(c)&&(r=c),!(c=s).parentElement){s=null;break}s=c.getSpatialNavigationContainer()}}}if(!s&&c){var h=m(r,u(c,i),o,c);if(Array.isArray(h)&&h.length>0&&(a=r.spatialNavigationSearch(o,{candidates:h,container:c})))return t?h:a}if(e(c,o))return r}return{isContainer:T,isScrollContainer:C,isVisibleInScroller:I,findCandidates:t.bind(null,!0),findNextTarget:t.bind(null,!1),getDistanceFromTarget:(e,t,n)=>(T(e)||"BODY"===e.nodeName)&&"INPUT"!==e.nodeName&&u(e).includes(t)?j($(e),$(t),n):W($(e),$(t),n)}}()),window.__spatialNavigation__.keyMode=t,Object.seal(window.__spatialNavigation__)}function G(){return{enableExperimentalAPIs:K,get keyMode(){return this._keymode?this._keymode:"ARROW"},set keyMode(e){this._keymode=["SHIFTARROW","ARROW","NONE"].includes(e)?e:"ARROW"},setStartingPoint:function(e,t){n=e&&t?{x:e,y:t}:null}}}}();var N=".ytaf-ui-container {\r\n position: absolute;\r\n top: 10%;\r\n left: 10%;\r\n right: 10%;\r\n bottom: 10%;\r\n\r\n background: rgba(0, 0, 0, 0.8);\r\n color: white;\r\n border-radius: 20px;\r\n padding: 20px;\r\n font-size: 1.5rem;\r\n z-index: 1000;\r\n}\r\n\r\n.ytaf-ui-container :focus {\r\n outline: 4px red solid;\r\n}\r\n\r\n.ytaf-ui-container h1 {\r\n margin: 0;\r\n margin-bottom: 0.5em;\r\n text-align: center;\r\n}\r\n\r\n.ytaf-ui-container input[type='checkbox'] {\r\n width: 1.4rem;\r\n height: 1.4rem;\r\n}\r\n\r\n.ytaf-ui-container input[type='radio'] {\r\n width: 1.4rem;\r\n height: 1.4rem;\r\n}\r\n\r\n.ytaf-ui-container label {\r\n display: block;\r\n font-size: 1.4rem;\r\n}\r\n\r\n.ytaf-notification-container {\r\n position: absolute;\r\n right: 10px;\r\n bottom: 10px;\r\n font-size: 16pt;\r\n z-index: 1200;\r\n}\r\n\r\n.ytaf-notification-container .message {\r\n background: rgba(0, 0, 0, 0.7);\r\n color: white;\r\n padding: 1em;\r\n margin: 0.5em;\r\n transition: all 0.3s ease-in-out;\r\n opacity: 1;\r\n line-height: 1;\r\n border-right: 10px solid rgba(50, 255, 50, 0.3);\r\n display: inline-block;\r\n float: right;\r\n}\r\n\r\n.ytaf-notification-container .message-hidden {\r\n opacity: 0;\r\n margin: 0 0.5em;\r\n padding: 0 1em;\r\n line-height: 0;\r\n}\r\n\r\n/* Fixes transparency effect for the video player */\r\n\r\n.ytLrWatchDefaultShadow {\r\n background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.8) 90%) !important;\r\n background-color: rgba(0, 0, 0, 0.3) !important;\r\n display: block !important;\r\n height: 100% !important;\r\n pointer-events: none !important;\r\n position: absolute !important;\r\n width: 100% !important;\r\n}\r\n\r\n/* Fixes shorts having a black background */\r\n\r\n.ytLrTileHeaderRendererShorts {\r\n background-image: none !important;\r\n}\r\n\r\n/* Multiline support for strings in the UI */\r\n\r\n.ytLrOverlayPanelHeaderRendererSubtitle {\r\n white-space: pre-wrap !important;\r\n}",I=document.createElement("style"),L="";function A(){L=`\n ytlr-guide-response yt-focus-container {\n background-color: ${u("focusContainerColor")};\n }\n\n #container {\n background-color: ${u("routeColor")} !important;\n }\n`;var e=document.querySelector("style[nonce]");e?e.textContent+=L:I.textContent=L}document.head.appendChild(I),A();var O=setInterval((()=>{document.querySelector("video")&&(!function(){var e=document.querySelector("style[nonce]");if(e)e.textContent+=N;else{var t=document.createElement("style");t.textContent=N,document.head.appendChild(t)}if(u("enableFixedUI"))try{window.tectonicConfig.featureSwitches.isLimitedMemory=!1,window.tectonicConfig.clientData.legacyApplicationQuality="full-animation",window.tectonicConfig.featureSwitches.enableAnimations=!0,window.tectonicConfig.featureSwitches.enableOnScrollLinearAnimation=!0,window.tectonicConfig.featureSwitches.enableListAnimations=!0}catch(e){}window.__spatialNavigation__.keyMode="NONE";var n={37:"left",38:"up",39:"right",40:"down"},o=document.createElement("div");o.classList.add("ytaf-ui-container"),o.style.display="none",o.setAttribute("tabindex",0),o.addEventListener("focus",(()=>console.info("uiContainer focused!")),!0),o.addEventListener("blur",(()=>console.info("uiContainer blured!")),!0),o.addEventListener("keydown",(e=>{if(console.info("uiContainer key event:",e.type,e.keyCode,e),404!==e.keyCode&&172!==e.keyCode){var t;if(e.keyCode in n)navigate(n[e.keyCode]);else{if(13===e.keyCode||32===e.keyCode){console.log("OK button pressed");var i=document.querySelector(":focus");return"checkbox"===i.type&&(i.checked=!i.checked,i.dispatchEvent(new Event("change"))),e.preventDefault(),void e.stopPropagation()}if(27===e.keyCode&&"text"!==document.querySelector(":focus").type)o.style.display="none",o.blur();else if("text"===document.querySelector(":focus").type&&27===e.keyCode){var r=document.querySelector(":focus");r.value=r.value.slice(0,-1)}}"Enter"!==e.key&&"Enter"!==(null===(t=e.Uc)||void 0===t?void 0:t.key)||"text"===document.querySelector(":focus").type&&document.querySelector(":focus").dispatchEvent(new Event("change"))}}),!0),o.innerHTML='\n<h1>TizenTube Theme Configuration</h1>\n<label for="__barColor">Navigation Bar Color: <input type="text" id="__barColor"/></label>\n<label for="__routeColor">Main Content Color: <input type="text" id="__routeColor"/></label>\n<div><small>Sponsor segments skipping - https://sponsor.ajay.app</small></div>\n',document.querySelector("body").appendChild(o),o.querySelector("#__barColor").value=u("focusContainerColor"),o.querySelector("#__barColor").addEventListener("change",(e=>{d("focusContainerColor",e.target.value),A()})),o.querySelector("#__routeColor").value=u("routeColor"),o.querySelector("#__routeColor").addEventListener("change",(e=>{d("routeColor",e.target.value),A()}));var i=e=>(console.info("Key event:",e.type,e.keyCode,e.keyCode,e.defaultPrevented),403==e.keyCode?(console.info("Taking over!"),e.preventDefault(),e.stopPropagation(),"keydown"===e.type&&("none"===o.style.display?(console.info("Showing and focusing!"),o.style.display="block",o.focus()):(console.info("Hiding!"),o.style.display="none",o.blur())),!1):(404==e.keyCode&&"keydown"===e.type&&v(),!0));if(document.addEventListener("keydown",i,!0),document.addEventListener("keypress",i,!0),document.addEventListener("keyup",i,!0),setTimeout((()=>{p("Chào mừng đến với TizenTube","Vào cài đặt và cuộn xuống mục TizenTube để mở Cài đặt TizenTube, mở cài đặt phát lại, nhấp vào Tốc độ để mở Cài đặt tốc độ video và nhấn phím [RED] để mở Cài đặt Theme TizenTube.")}),2e3),u("enableFixedUI"))try{new MutationObserver(((e,t)=>{var n=document.body;n.classList.contains("app-quality-root")&&n.classList.remove("app-quality-root")})).observe(document.body,{attributes:!0,childList:!1,subtree:!1})}catch(e){}}(),function(){var e=function(){if(window._yttv[t]&&window._yttv[t].instance&&window._yttv[t].instance.resolveCommand){var e=window._yttv[t].instance.resolveCommand;window._yttv[t].instance.resolveCommand=function(t,n){var o,i,r;if(t.setClientSettingEndpoint){var l,c=a(t.setClientSettingEndpoint.settingDatas);try{for(c.s();!(l=c.n()).done;)if(!l.value.clientSettingEnum.item.includes("_")){var s,p=a(t.setClientSettingEndpoint.settingDatas);try{for(p.s();!(s=p.n()).done;){var m=s.value,h=Object.keys(m).find((e=>e.includes("Value"))),f="intValue"===h?Number(m[h]):m[h];if("arrayValue"===h){var v=u(m.clientSettingEnum.item);v.includes(f)?v.splice(v.indexOf(f),1):v.push(f),d(m.clientSettingEnum.item,v)}else d(m.clientSettingEnum.item,f)}}catch(e){p.e(e)}finally{p.f()}}}catch(e){c.e(e)}finally{c.f()}}else{if(t.customAction)return w(t.customAction.action,t.customAction.parameters),!0;if(null!=t&&null!==(o=t.signalAction)&&void 0!==o&&o.customAction)return w(t.signalAction.customAction.action,t.signalAction.customAction.parameters),!0;if(null!=t&&null!==(i=t.showEngagementPanelEndpoint)&&void 0!==i&&i.customAction)return w(t.showEngagementPanelEndpoint.customAction.action,t.showEngagementPanelEndpoint.customAction.parameters),!0;if("playback-settings"===(null==t||null===(r=t.openPopupAction)||void 0===r?void 0:r.uniqueId)){var g,y=a(t.openPopupAction.popup.overlaySectionRenderer.overlay.overlayTwoPanelRenderer.actionPanel.overlayPanelRenderer.content.overlayPanelItemListRenderer.items);try{for(y.s();!(g=y.n()).done;){var b,S=g.value;"SLOW_MOTION_VIDEO"===(null==S||null===(b=S.compactLinkRenderer)||void 0===b||null===(b=b.icon)||void 0===b?void 0:b.iconType)&&(S.compactLinkRenderer.subtitle&&(S.compactLinkRenderer.subtitle.simpleText="with TizenTube"),S.compactLinkRenderer.serviceEndpoint={clickTrackingParams:"null",signalAction:{customAction:{action:"TT_SPEED_SETTINGS_SHOW",parameters:[]}}})}}catch(e){y.e(e)}finally{y.f()}}}return e.call(this,t,n)}}};for(var t in window._yttv)e()}(),clearInterval(O))}),250);if(window.h5vcc&&window.h5vcc.tizentube){var D=window.h5vcc.tizentube.GetVersion();var M=Math.floor(Date.now()/1e3);function H(){fetch("https://api.github.com/repos/daivietpda/TizenTubeCobalt/releases/latest").then((e=>{if(!e.ok)throw new Error("Phản hồi của mạng không ổn");return e.json()})).then((e=>{var t=e.tag_name.replace("v",""),n=new Date(e.published_at).getTime()/1e3;if(t!==D){console.info(`Phiên bản mới có sẵn: ${t} (Hiện tại: ${D})`);var o=e.assets.map((e=>h({title:e.name,subtitle:`Kích thước: ${(e.size/1048576).toFixed(2)} MB`},{icon:"DOWN_ARROW"},[{customAction:{action:"UPDATE_DOWNLOAD",parameters:e.browser_download_url}},{signalAction:{signal:"POPUP_BACK"}}])));o.push(h({title:"Nhắc tôi sau",subtitle:"Kiểm tra cập nhật sau."},{icon:"SEARCH_HISTORY"},[{customAction:{action:"UPDATE_REMIND_LATER",parameters:M+86400}},{signalAction:{signal:"POPUP_BACK"}}])),m({title:"Cập nhật có sẵn",subtitle:`Phiên bản mới của TizenTube Cobalt đã có sẵn: ${t}\nPhiên bản hiện tại: ${D}\nNgày phát hành: ${new Date(1e3*n).toLocaleString()}\nGhi chú phát hành:\n${e.body}\n\nVui lòng chọn file để tải xuống:`},o,0,"tt-update-modal")}else console.info("Bạn đang sử dụng phiên bản mới nhất của TizenTube.")})).catch((e=>{console.error("Lỗi khi tải bản phát hành mới nhất:",e),p("TizenTube Kiểm tra cập nhật không thành công","Không thể kiểm tra cập nhật.",null)}))}u("dontCheckUpdateUntil")>M?console.info("Skipping update check until",new Date(1e3*u("dontCheckUpdateUntil")).toLocaleString()):H()}}();
1
+ !function(){"use strict";function e(){e=function(){return t};var t={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var r=t&&t.prototype instanceof m?t:m,a=Object.create(r.prototype),l=new C(o||[]);return i(a,"_invoke",{value:k(e,n,l)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p={};function m(){}function h(){}function f(){}var v={};c(v,a,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(x([])));y&&y!==n&&o.call(y,a)&&(v=y);var b=f.prototype=m.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(i,r,a,l){var s=d(e[i],e,r);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&o.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,l)}))}l(s.arg)}var r;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,i){n(e,o,t,i)}))}return r=r?r.then(i,i):i()}})}function k(e,t,n){var o="suspendedStart";return function(i,r){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===i)throw r;return _()}for(n.method=i,n.arg=r;;){var a=n.delegate;if(a){var l=E(a,n);if(l){if(l===p)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var s=d(e,t,n);if("normal"===s.type){if(o=n.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o="completed",n.method="throw",n.arg=s.arg)}}}function E(e,t){var n=t.method,o=e.iterator[n];if(void 0===o)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=d(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return h.prototype=f,i(b,"constructor",{value:f,configurable:!0}),i(f,"constructor",{value:h,configurable:!0}),h.displayName=c(f,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},w(S.prototype),c(S.prototype,l,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,o,i,r){void 0===r&&(r=Promise);var a=new S(u(e,n,o,i),r);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),c(b,s,"Generator"),c(b,a,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return a.type="throw",a.arg=e,t.next=n,o&&(t.method="next",t.arg=void 0),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var l=o.call(r,"catchLoc"),s=o.call(r,"finallyLoc");if(l&&s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},t}function t(e,t,n,o,i,r,a){try{var l=e[r](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(o,i)}function n(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r,a,l=[],s=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=r.call(n)).done)&&(l.push(o.value),l.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=i(e))||t){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,a=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw a}}}}!function(e){function t(e){return void 0===e?0:Number(e)}function n(e,t){return e!==t&&!(isNaN(e)&&isNaN(t))}self.DOMRect=function(e,o,i,r){var a,l,s,c,u,d,p,m;a=t(e),l=t(o),s=t(i),c=t(r),Object.defineProperties(this,{x:{get:function(){return a},set:function(e){n(a,e)&&(a=e,u=d=void 0)},enumerable:!0},y:{get:function(){return l},set:function(e){n(l,e)&&(l=e,p=m=void 0)},enumerable:!0},width:{get:function(){return s},set:function(e){n(s,e)&&(s=e,u=d=void 0)},enumerable:!0},height:{get:function(){return c},set:function(e){n(c,e)&&(c=e,p=m=void 0)},enumerable:!0},left:{get:function(){return void 0===u&&(u=a+Math.min(0,s)),u},enumerable:!0},right:{get:function(){return void 0===d&&(d=a+Math.max(0,s)),d},enumerable:!0},top:{get:function(){return void 0===p&&(p=l+Math.min(0,c)),p},enumerable:!0},bottom:{get:function(){return void 0===m&&(m=l+Math.max(0,c)),m},enumerable:!0}})}}();var l,s="ytaf-configuration",c={enableAdBlock:!0,enableSponsorBlock:!0,sponsorBlockManualSkips:["intro","outro","filler"],enableSponsorBlockSponsor:!0,enableSponsorBlockIntro:!0,enableSponsorBlockOutro:!0,enableSponsorBlockInteraction:!0,enableSponsorBlockSelfPromo:!0,enableSponsorBlockPreview:!0,enableSponsorBlockMusicOfftopic:!0,enableSponsorBlockFiller:!1,videoSpeed:1,enableDeArrow:!0,enableDeArrowThumbnails:!1,focusContainerColor:"#0f0f0f",routeColor:"#0f0f0f",enableFixedUI:!0,enableHqThumbnails:!1,enableChapters:!0,enableLongPress:!0,enableShorts:!0,dontCheckUpdateUntil:0};try{l=JSON.parse(window.localStorage[s])}catch(M){console.warn("Config read failed:",M),l=c}function u(e){return void 0===l[e]&&(console.warn("Populating key",e,"with default value",c[e]),l[e]=c[e]),l[e]}function d(e,t){console.info("Setting key",e,"to",t),l[e]=t,window.localStorage[s]=JSON.stringify(l)}function p(e,t,n){var o={openPopupAction:{popupType:"TOAST",popup:{overlayToastRenderer:{title:{simpleText:e},subtitle:{simpleText:t}}}}};n&&(o.openPopupAction.popup.overlayToastRenderer.image.thumbnails=n),b(o)}function m(e,t,n,o,i){var r="string"==typeof e?{title:e,subtitle:""}:e,a={openPopupAction:{popupType:"MODAL",popup:{overlaySectionRenderer:{overlay:{overlayTwoPanelRenderer:{actionPanel:{overlayPanelRenderer:{header:{overlayPanelHeaderRenderer:{title:{simpleText:r.title}}},content:{overlayPanelItemListRenderer:{items:t,selectedIndex:n}}}},backButton:{buttonRenderer:{accessibilityData:{accessibilityData:{label:"Back"}},command:{signalAction:{signal:"POPUP_BACK"}}}}}},dismissalCommand:{signalAction:{signal:"POPUP_BACK"}}}},uniqueId:o}};r.subtitle&&(a.openPopupAction.popup.overlaySectionRenderer.overlay.overlayTwoPanelRenderer.actionPanel.overlayPanelRenderer.header.overlayPanelHeaderRenderer.subtitle={simpleText:r.subtitle}),i&&(a.openPopupAction.shouldMatchUniqueId=!0,a.openPopupAction.updateAction=!0),b(a)}function h(e,t,n){var o={compactLinkRenderer:{serviceEndpoint:{commandExecutorCommand:{commands:n}}}};return e&&(o.compactLinkRenderer.title={simpleText:e.title}),e.subtitle&&(o.compactLinkRenderer.subtitle={simpleText:e.subtitle}),t&&(o.compactLinkRenderer.icon={iconType:t.icon}),t&&t.secondaryIcon&&(o.compactLinkRenderer.secondaryIcon={iconType:t.secondaryIcon}),o}function f(e){return{clickTrackingParams:null,showMenuCommand:{contentId:e.videoId,thumbnail:{thumbnails:e.thumbnails},title:{simpleText:e.title},subtitle:{simpleText:e.subtitle},menu:{menuRenderer:{items:[{menuNavigationItemRenderer:{text:{runs:[{text:"Play"}]},navigationEndpoint:{clickTrackingParams:null,watchEndpoint:e.watchEndpointData},trackingParams:null}},{menuServiceItemRenderer:{text:{runs:[{text:"Save to Watch Later"}]},serviceEndpoint:{clickTrackingParams:null,playlistEditEndpoint:{playlistId:"WL",actions:[{addedVideoId:e.videoId,action:"ACTION_ADD_VIDEO"}]}},trackingParams:null}},{menuNavigationItemRenderer:{text:{runs:[{text:"Save to playlist"}]},navigationEndpoint:{clickTrackingParams:null,addToPlaylistEndpoint:{videoId:e.videoId}},trackingParams:null}}],trackingParams:null,accessibility:{accessibilityData:{label:"Video options"}}}}}}}function v(e,t){for(var n=[],o=0,i=0,r=[{name:"Ad block",icon:"DOLLAR_SIGN",value:"enableAdBlock"},{name:"SponsorBlock",icon:"MONEY_HAND",value:"enableSponsorBlock"},{name:"Manual SponsorBlock Segment Skip",icon:"DOLLAR_SIGN",value:null,options:[{name:"Skip Sponsor Segments",icon:"MONEY_HEART",value:"sponsor"},{name:"Skip Intro Segments",icon:"PLAY_CIRCLE",value:"intro"},{name:"Skip Outro Segments",value:"outro"},{name:"Skip Interaction Reminder Segments",value:"interaction"},{name:"Skip Self-Promotion Segments",value:"selfpromo"},{name:"Skip Preview/Recap Segments",value:"preview"},{name:"Skip Tangents/Jokes Segments",value:"filler"},{name:"Skip Off-Topic Music Segments",value:"music_offtopic"}]},{name:"Skip Sponsor Segments",icon:"MONEY_HEART",value:"enableSponsorBlockSponsor"},{name:"Skip Intro Segments",icon:"PLAY_CIRCLE",value:"enableSponsorBlockIntro"},{name:"Skip Outro Segments",value:"enableSponsorBlockOutro"},{name:"Skip Interaction Reminder Segments",value:"enableSponsorBlockInteraction"},{name:"Skip Self-Promotion Segments",value:"enableSponsorBlockSelfPromo"},{name:"Skip Preview/Recap Segments",value:"enableSponsorBlockPreview"},{name:"Skip Tangents/Jokes Segments",value:"enableSponsorBlockFiller"},{name:"Skip Off-Topic Music Segments",value:"enableSponsorBlockMusicOfftopic"},{name:"DeArrow",icon:"VISIBILITY_OFF",value:"enableDeArrow"},{name:"DeArrow Thumbnails",icon:"TV",value:"enableDeArrowThumbnails"},{name:"Fix UI",icon:"STAR",value:"enableFixedUI"},{name:"High Quality Thumbnails",icon:"VIDEO_QUALITY",value:"enableHqThumbnails"},{name:"Long Press",value:"enableLongPress"},{name:"Shorts",icon:"YOUTUBE_SHORTS_FILL_24",value:"enableShorts"}];i<r.length;i++){var a=r[i],l=a.value?u(a.value):null;n.push(h({title:a.name,subtitle:a.subtitle},{icon:a.icon?a.icon:"CHEVRON_DOWN",secondaryIcon:null===l?"CHEVRON_RIGHT":l?"CHECK_BOX":"CHECK_BOX_OUTLINE_BLANK"},null!==l?[{setClientSettingEndpoint:{settingDatas:[{clientSettingEnum:{item:a.value},boolValue:!u(a.value)}]}},{customAction:{action:"SETTINGS_UPDATE",parameters:[o]}}]:[{customAction:{action:"OPTIONS_SHOW",parameters:{options:a.options,selectedIndex:0,update:!1}}}])),o++}m({title:"TizenTube Settings",subtitle:"Made by Reis Can (reisxd) with ❤️"},n,t&&t.length>0?t[0]:0,"tt-settings",e)}var g=setInterval((()=>{document.querySelector("video")&&(!function(){document.querySelector("video").addEventListener("canplay",(()=>{document.getElementsByTagName("video")[0].playbackRate=u("videoSpeed")}));var e=e=>{if(406==e.keyCode||191==e.keyCode)return e.preventDefault(),e.stopPropagation(),"keydown"!==e.type||(y(),!1)};document.addEventListener("keydown",e,!0),document.addEventListener("keypress",e,!0),document.addEventListener("keyup",e,!0)}(),clearInterval(g))}),1e3);function y(){for(var e=u("videoSpeed"),t=0,n=[],o=.25;o<=4;o+=.25)n.push(h({title:`${o}x`},null,[{signalAction:{signal:"POPUP_BACK"}},{setClientSettingEndpoint:{settingDatas:[{clientSettingEnum:{item:"videoSpeed"},intValue:o.toString()}]}},{customAction:{action:"SET_PLAYER_SPEED",parameters:o.toString()}}])),e===o&&(t=n.length-1);n.push(h({title:"Fix stuttering (1.0001x)"},null,[{signalAction:{signal:"POPUP_BACK"}},{setClientSettingEndpoint:{settingDatas:[{clientSettingEnum:{item:"videoSpeed"},intValue:"1.0001"}]}},{customAction:{action:"SET_PLAYER_SPEED",parameters:"1.0001"}}])),m("Playback Speed",n,t,"tt-speed")}function b(e,t){for(var n in window._yttv)if(window._yttv[n]&&window._yttv[n].instance&&window._yttv[n].instance.resolveCommand)return window._yttv[n].instance.resolveCommand(e,t)}function w(e,t){switch(e){case"SETTINGS_UPDATE":v(!0,t);break;case"OPTIONS_SHOW":!function(e,t){var n,o=[],i=u("sponsorBlockManualSkips"),r=a(e.options);try{for(r.s();!(n=r.n()).done;){var l=n.value;o.push(h({title:l.name},{icon:l.icon?l.icon:"CHEVRON_DOWN",secondaryIcon:i.includes(l.value)?"CHECK_BOX":"CHECK_BOX_OUTLINE_BLANK"},[{setClientSettingEndpoint:{settingDatas:[{clientSettingEnum:{item:"sponsorBlockManualSkips"},arrayValue:l.value}]}},{customAction:{action:"OPTIONS_SHOW",parameters:{options:e.options,selectedIndex:e.options.indexOf(l),update:!0}}}]))}}catch(e){r.e(e)}finally{r.f()}m("TizenTube Settings",o,e.selectedIndex,"tt-settings-options",t)}(t,t.update);break;case"SKIP":var n=document.createEvent("Event");n.initEvent("keydown",!0,!0),n.keyCode=27,n.which=27,document.dispatchEvent(n),document.querySelector("video").currentTime=t.time;break;case"TT_SETTINGS_SHOW":v();break;case"TT_SPEED_SETTINGS_SHOW":y();break;case"UPDATE_REMIND_LATER":d("dontCheckUpdateUntil",t);break;case"UPDATE_DOWNLOAD":window.h5vcc.tizentube.InstallAppFromURL(t),p("TizenTube Update","Downloading update, please wait...");break;case"SET_PLAYER_SPEED":var o=Number(t);document.querySelector("video").playbackRate=o}}var S=JSON.parse;for(var k in JSON.parse=function(){var e,t,n,o,i,r,l,s,c,d,p,m,h,f,v,g,y,b=S.apply(this,arguments);(b.adPlacements&&u("enableAdBlock")&&(b.adPlacements=[]),b.playerAds&&u("enableAdBlock")&&(b.playerAds=!1),b.adSlots&&u("enableAdBlock")&&(b.adSlots=[]),null!=b&&null!==(e=b.contents)&&void 0!==e&&null!==(e=e.tvBrowseRenderer)&&void 0!==e&&null!==(e=e.content)&&void 0!==e&&null!==(e=e.tvSurfaceContentRenderer)&&void 0!==e&&null!==(e=e.content)&&void 0!==e&&null!==(e=e.sectionListRenderer)&&void 0!==e&&e.contents&&u("enableAdBlock")&&(b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents=b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents.filter((e=>!e.adSlotRenderer))),!Array.isArray(b)&&null!=b&&b.entries&&u("enableAdBlock"))&&(b.entries=null===(c=b.entries)||void 0===c?void 0:c.filter((e=>{var t;return!(null!=e&&null!==(t=e.command)&&void 0!==t&&null!==(t=t.reelWatchEndpoint)&&void 0!==t&&null!==(t=t.adClientParams)&&void 0!==t&&t.isAd)})));if(null!=b&&null!==(t=b.title)&&void 0!==t&&t.runs&&(d=b,m=function(e,t,n){var o={settingCategoryCollectionRenderer:{items:t,categoryId:"tizentube_category",focused:!1,trackingParams:"null"}};return o.settingCategoryCollectionRenderer.title={runs:[{text:n}]},o}(0,[{settingActionRenderer:{title:{runs:[{text:p="TizenTube Settings"}]},serviceEndpoint:{customAction:{action:"TT_SETTINGS_SHOW",parameters:[]}},summary:{runs:[{text:"Open TizenTube Settings"}]},trackingParams:"null",actionLabel:{runs:[{text:p}]},itemId:"tizentube_open_action",thumbnail:{thumbnails:[{url:"https://www.gstatic.com/ytlr/img/parent_code.png"}]}}}],"TizenTube"),d.items.push(m)),null!=b&&null!==(n=b.contents)&&void 0!==n&&null!==(n=n.tvBrowseRenderer)&&void 0!==n&&null!==(n=n.content)&&void 0!==n&&null!==(n=n.tvSurfaceContentRenderer)&&void 0!==n&&null!==(n=n.content)&&void 0!==n&&null!==(n=n.sectionListRenderer)&&void 0!==n&&n.contents&&E(b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents),null!=b&&null!==(o=b.contents)&&void 0!==o&&null!==(o=o.sectionListRenderer)&&void 0!==o&&o.contents&&E(b.contents.sectionListRenderer.contents),null!=b&&null!==(i=b.continuationContents)&&void 0!==i&&null!==(i=i.sectionListContinuation)&&void 0!==i&&i.contents&&E(b.continuationContents.sectionListContinuation.contents),null!=b&&null!==(r=b.continuationContents)&&void 0!==r&&null!==(r=r.horizontalListContinuation)&&void 0!==r&&r.items&&(P(b.continuationContents.horizontalListContinuation.items),T(b.continuationContents.horizontalListContinuation.items),C(b.continuationContents.horizontalListContinuation.items)),!u("enableShorts")&&null!=b&&null!==(l=b.contents)&&void 0!==l&&null!==(l=l.tvBrowseRenderer)&&void 0!==l&&null!==(l=l.content)&&void 0!==l&&null!==(l=l.tvSurfaceContentRenderer)&&void 0!==l&&l.content&&(b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents=b.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.content.sectionListRenderer.contents.filter((e=>{var t;return"TVHTML5_SHELF_RENDERER_TYPE_SHORTS"!==(null===(t=e.shelfRenderer)||void 0===t?void 0:t.tvhtml5ShelfRendererType)}))),u("sponsorBlockManualSkips").length>0&&null!=b&&null!==(s=b.playerOverlays)&&void 0!==s&&s.playerOverlayRenderer){var w,k=u("sponsorBlockManualSkips"),x=[];if(null!==(w=window)&&void 0!==w&&null!==(w=w.sponsorblock)&&void 0!==w&&w.segments){var _,R=a(window.sponsorblock.segments);try{for(R.s();!(_=R.n()).done;){var L=_.value;if(k.includes(L.category)){var N=(h=`Skip ${L.category}`,f="SKIP_NEXT",v={clickTrackingParams:null,showEngagementPanelEndpoint:{customAction:{action:"SKIP",parameters:{time:L.segment[1]}}}},g=1e3*L.segment[0],y=1e3*L.segment[1]-1e3*L.segment[0],{timelyActionRenderer:{actionButtons:[{buttonRenderer:{isDisabled:!1,text:{runs:[{text:h}]},icon:{iconType:f},trackingParams:null,command:v}}],triggerTimeMs:g,timeoutMs:y,type:""}});x.push(N)}}}catch(e){R.e(e)}finally{R.f()}b.playerOverlays.playerOverlayRenderer.timelyActionRenderers=x}}return b},window.JSON.parse=JSON.parse,window._yttv)window._yttv[k]&&window._yttv[k].JSON&&window._yttv[k].JSON.parse&&(window._yttv[k].JSON.parse=JSON.parse);function E(e){var t,n=a(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;o.shelfRenderer&&(P(o.shelfRenderer.content.horizontalListRenderer.items),T(o.shelfRenderer.content.horizontalListRenderer.items),C(o.shelfRenderer.content.horizontalListRenderer.items))}}catch(e){n.e(e)}finally{n.f()}}function P(e){var t,n=a(e);try{var o=function(){var n=t.value;if(n.adSlotRenderer){var o=e.indexOf(n);return e.splice(o,1),"continue"}if(u("enableDeArrow")){var i=n.tileRenderer.contentId;fetch(`https://sponsor.ajay.app/api/branding?videoID=${i}`).then((e=>e.json())).then((e=>{if(e.titles.length>0){var t=e.titles.reduce(((e,t)=>e.votes>t.votes?e:t));n.tileRenderer.metadata.tileMetadataRenderer.title.simpleText=t.title}if(e.thumbnails.length>0&&u("enableDeArrowThumbnails")){var o=e.thumbnails.reduce(((e,t)=>e.votes>t.votes?e:t));o.timestamp&&(n.tileRenderer.header.tileHeaderRenderer.thumbnail.thumbnails=[{url:`https://dearrow-thumb.ajay.app/api/v1/getThumbnail?videoID=${i}&time=${o.timestamp}`,width:1280,height:640}])}}))}};for(n.s();!(t=n.n()).done;)o()}catch(e){n.e(e)}finally{n.f()}}function T(e){var t,n=a(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;if("TILE_STYLE_YTLR_DEFAULT"===o.tileRenderer.style&&u("enableHqThumbnails")){var i=o.tileRenderer.contentId,r=o.tileRenderer.header.tileHeaderRenderer.thumbnail.thumbnails[0].url.split("?")[1];o.tileRenderer.header.tileHeaderRenderer.thumbnail.thumbnails=[{url:`https://i.ytimg.com/vi/${i}/sddefault.jpg${r?`?${r}`:""}`,width:640,height:480}]}}}catch(e){n.e(e)}finally{n.f()}}function C(e){if(u("enableLongPress")){var t,n=a(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;if("TILE_STYLE_YTLR_DEFAULT"===o.tileRenderer.style&&!o.tileRenderer.onLongPressCommand){var i=o.tileRenderer.metadata.tileMetadataRenderer.lines[0].lineRenderer.items[0].lineItemRenderer.text,r=f({videoId:o.tileRenderer.contentId,thumbnails:o.tileRenderer.header.tileHeaderRenderer.thumbnail.thumbnails,title:o.tileRenderer.metadata.tileMetadataRenderer.title.simpleText,subtitle:i.runs?i.runs[0].text:i.simpleText,watchEndpointData:o.tileRenderer.onSelectCommand.watchEndpoint});o.tileRenderer.onLongPressCommand=r}}}catch(e){n.e(e)}finally{n.f()}}}var x=function e(t){function n(e,t){return e>>>t|e<<32-t}for(var o,i,r=Math.pow,a=r(2,32),l="length",s="",c=[],u=8*t[l],d=e.h=e.h||[],p=e.k=e.k||[],m=p[l],h={},f=2;m<64;f++)if(!h[f]){for(o=0;o<313;o+=f)h[o]=f;d[m]=r(f,.5)*a|0,p[m++]=r(f,1/3)*a|0}for(t+="€";t[l]%64-56;)t+="\0";for(o=0;o<t[l];o++){if((i=t.charCodeAt(o))>>8)return;c[o>>2]|=i<<(3-o)%4*8}for(c[c[l]]=u/a|0,c[c[l]]=u,i=0;i<c[l];){var v=c.slice(i,i+=16),g=d;for(d=d.slice(0,8),o=0;o<64;o++){var y=v[o-15],b=v[o-2],w=d[0],S=d[4],k=d[7]+(n(S,6)^n(S,11)^n(S,25))+(S&d[5]^~S&d[6])+p[o]+(v[o]=o<16?v[o]:v[o-16]+(n(y,7)^n(y,18)^y>>>3)+v[o-7]+(n(b,17)^n(b,19)^b>>>10)|0);(d=[k+((n(w,2)^n(w,13)^n(w,22))+(w&d[1]^w&d[2]^d[1]&d[2]))|0].concat(d))[4]=d[4]+k|0}for(o=0;o<8;o++)d[o]=d[o]+g[o]|0}for(o=0;o<8;o++)for(i=3;i+1;i--){var E=d[o]>>8*i&255;s+=(E<16?0:"")+E.toString(16)}return s},_={sponsor:{color:"#00d400",opacity:"0.7",name:"sponsored segment"},intro:{color:"#00ffff",opacity:"0.7",name:"intro"},outro:{color:"#0202ed",opacity:"0.7",name:"outro"},interaction:{color:"#cc00ff",opacity:"0.7",name:"interaction reminder"},selfpromo:{color:"#ffff00",opacity:"0.7",name:"self-promotion"},preview:{color:"#008fd6",opacity:"0.7",name:"recap or preview"},filler:{color:"#7300FF",opacity:"0.9",name:"tangents"},music_offtopic:{color:"#ff9900",opacity:"0.7",name:"non-music part"}};class R{constructor(e){n(this,"video",null),n(this,"active",!0),n(this,"attachVideoTimeout",null),n(this,"nextSkipTimeout",null),n(this,"sliderInterval",null),n(this,"observer",null),n(this,"scheduleSkipHandler",null),n(this,"durationChangeHandler",null),n(this,"segments",null),n(this,"skippableCategories",[]),n(this,"manualSkippableCategories",[]),this.videoID=e}init(){var n,o=this;return(n=e().mark((function t(){var n,i,r,a,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=x(o.videoID).substring(0,4),i=["sponsor","intro","outro","interaction","selfpromo","preview","filler","music_offtopic"],e.next=4,fetch(`https://sponsorblock.inf.re/api/skipSegments/${n}?categories=${encodeURIComponent(JSON.stringify(i))}`);case 4:return r=e.sent,e.next=7,r.json();case 7:if(a=e.sent,l=a.find((e=>e.videoID===o.videoID)),console.info(o.videoID,"Got it:",l),l&&l.segments&&l.segments.length){e.next=13;break}return console.info(o.videoID,"No segments found."),e.abrupt("return");case 13:o.segments=l.segments,o.manualSkippableCategories=u("sponsorBlockManualSkips"),o.skippableCategories=o.getSkippableCategories(),o.scheduleSkipHandler=()=>o.scheduleSkip(),o.durationChangeHandler=()=>o.buildOverlay(),o.attachVideo(),o.buildOverlay();case 20:case"end":return e.stop()}}),t)})),function(){var e=this,o=arguments;return new Promise((function(i,r){var a=n.apply(e,o);function l(e){t(a,i,r,l,s,"next",e)}function s(e){t(a,i,r,l,s,"throw",e)}l(void 0)}))})()}getSkippableCategories(){var e=[];return u("enableSponsorBlockSponsor")&&e.push("sponsor"),u("enableSponsorBlockIntro")&&e.push("intro"),u("enableSponsorBlockOutro")&&e.push("outro"),u("enableSponsorBlockInteraction")&&e.push("interaction"),u("enableSponsorBlockSelfPromo")&&e.push("selfpromo"),u("enableSponsorBlockPreview")&&e.push("preview"),u("enableSponsorBlockFiller")&&e.push("filler"),u("enableSponsorBlockMusicOfftopic")&&e.push("music_offtopic"),e}attachVideo(){if(clearTimeout(this.attachVideoTimeout),this.attachVideoTimeout=null,this.video=document.querySelector("video"),!this.video)return console.info(this.videoID,"No video yet..."),void(this.attachVideoTimeout=setTimeout((()=>this.attachVideo()),100));console.info(this.videoID,"Video found, binding..."),this.video.addEventListener("play",this.scheduleSkipHandler),this.video.addEventListener("pause",this.scheduleSkipHandler),this.video.addEventListener("timeupdate",this.scheduleSkipHandler),this.video.addEventListener("durationchange",this.durationChangeHandler)}buildOverlay(){if(this.segmentsoverlay)console.info("Overlay already built");else if(this.video&&this.video.duration){var e=this.video.duration;this.segmentsoverlay=document.createElement("div"),this.segmentsoverlay.classList.add("ytLrProgressBarHost","ytLrProgressBarFocused","ytLrWatchDefaultProgressBar");var t=document.createElement("div");t.style.setProperty("background-color","rgb(0, 0, 0, 0)"),t.style.setProperty("bottom","auto","important"),t.style.setProperty("height","0.25rem","important"),t.style.setProperty("overflow","hidden","important"),t.style.setProperty("position","absolute","important"),t.style.setProperty("top","1.625rem","important"),t.style.setProperty("width","100%","important"),this.segmentsoverlay.appendChild(t),this.segments.forEach((n=>{var i=o(n.segment,2),r=i[0],a=i[1],l=_[n.category]||{color:"blue",opacity:.7},s=`translateX(${r/e*100}%) scaleX(${(a-r)/e})`,c=document.createElement("div");c.style.setProperty("background",l.color,"important"),c.style.setProperty("opacity",l.opacity,"important"),c.style.setProperty("transform",s,"important"),c.style.setProperty("height","100%"),c.style.setProperty("pointer-events","none"),c.style.setProperty("position","absolute"),c.style.setProperty("transform-origin","left"),c.style.setProperty("width","100%"),console.info("Generated element",c,"from",n,s),t.appendChild(c)})),this.observer=new MutationObserver((e=>{e.forEach((e=>{if(e.removedNodes){var t,n=a(e.removedNodes);try{for(n.s();!(t=n.n()).done;){t.value===this.segmentsoverlay&&(console.info("bringing back segments overlay"),this.slider.appendChild(this.segmentsoverlay))}}catch(e){n.e(e)}finally{n.f()}}"false"===document.querySelector("ytlr-progress-bar").getAttribute("hybridnavfocusable")?this.segmentsoverlay.classList.remove("ytLrProgressBarFocused"):this.segmentsoverlay.classList.add("ytLrProgressBarFocused")}))})),this.sliderInterval=setInterval((()=>{this.slider=document.querySelector("ytlr-redux-connect-ytlr-progress-bar"),this.slider&&(clearInterval(this.sliderInterval),this.sliderInterval=null,this.observer.observe(this.slider,{childList:!0,subtree:!0}),this.slider.appendChild(this.segmentsoverlay))}),500)}else console.info("No video duration yet")}scheduleSkip(){if(clearTimeout(this.nextSkipTimeout),this.nextSkipTimeout=null,this.active)if(this.video.paused)console.info(this.videoID,"Currently paused, ignoring...");else{var e=this.segments.filter((e=>e.segment[0]>this.video.currentTime-.3&&e.segment[1]>this.video.currentTime-.3));if(e.sort(((e,t)=>e.segment[0]-t.segment[0])),e.length){var t=o(e,1)[0],n=o(t.segment,2),i=n[0],r=n[1];console.info(this.videoID,"Scheduling skip of",t,"in",i-this.video.currentTime),this.nextSkipTimeout=setTimeout((()=>{var e;if(this.video.paused)console.info(this.videoID,"Currently paused, ignoring...");else if(this.skippableCategories.includes(t.category)){var n=(null===(e=_[t.category])||void 0===e?void 0:e.name)||t.category;console.info(this.videoID,"Skipping",t),this.manualSkippableCategories.includes(t.category)||(p("SponsorBlock",`Skipping ${n}`),this.video.currentTime=r+.1,this.scheduleSkip())}else console.info(this.videoID,"Segment",t.category,"is not skippable, ignoring...")}),1e3*(i-this.video.currentTime))}else console.info(this.videoID,"No more segments")}else console.info(this.videoID,"No longer active, ignoring...")}destroy(){console.info(this.videoID,"Destroying"),this.active=!1,this.nextSkipTimeout&&(clearTimeout(this.nextSkipTimeout),this.nextSkipTimeout=null),this.attachVideoTimeout&&(clearTimeout(this.attachVideoTimeout),this.attachVideoTimeout=null),this.sliderInterval&&(clearInterval(this.sliderInterval),this.sliderInterval=null),this.observer&&(this.observer.disconnect(),this.observer=null),this.segmentsoverlay&&(this.segmentsoverlay.remove(),this.segmentsoverlay=null),this.video&&(this.video.removeEventListener("play",this.scheduleSkipHandler),this.video.removeEventListener("pause",this.scheduleSkipHandler),this.video.removeEventListener("timeupdate",this.scheduleSkipHandler),this.video.removeEventListener("durationchange",this.durationChangeHandler))}}window.sponsorblock=null,window.addEventListener("hashchange",(()=>{var e=new URL(location.hash.substring(1),location.href).search.replace("?v=","").split("&")[0],t=e&&(!window.sponsorblock||window.sponsorblock.videoID!=e);if(console.info("hashchange",e,window.sponsorblock,window.sponsorblock?window.sponsorblock.videoID:null,t),t){if(window.sponsorblock){try{window.sponsorblock.destroy()}catch(e){console.warn("window.sponsorblock.destroy() failed!",e)}window.sponsorblock=null}u("enableSponsorBlock")?(window.sponsorblock=new R(e),window.sponsorblock.init()):console.info("SponsorBlock disabled, not loading")}}),!1),function(){if(!("navigate"in window)){var e={37:"left",38:"up",39:"right",40:"down"},t=null,n=null,o={element:null,rect:null},i=null;window.navigate=l,window.Element.prototype.spatialNavigationSearch=p,window.Element.prototype.focusableAreas=y,window.Element.prototype.getSpatialNavigationContainer=v,window.CSS&&CSS.registerProperty&&(""===window.getComputedStyle(document.documentElement).getPropertyValue("--spatial-navigation-contain")&&CSS.registerProperty({name:"--spatial-navigation-contain",syntax:"auto | contain",inherits:!1,initialValue:"auto"}),""===window.getComputedStyle(document.documentElement).getPropertyValue("--spatial-navigation-action")&&CSS.registerProperty({name:"--spatial-navigation-action",syntax:"auto | focus | scroll",inherits:!1,initialValue:"auto"}),""===window.getComputedStyle(document.documentElement).getPropertyValue("--spatial-navigation-function")&&CSS.registerProperty({name:"--spatial-navigation-function",syntax:"normal | grid",inherits:!1,initialValue:"normal"})),K(!1),window.addEventListener("load",(()=>{r()}))}function r(){window.addEventListener("keydown",(o=>{var i=parent&&parent.__spatialNavigation__.keyMode||window.__spatialNavigation__.keyMode,r=document.activeElement,a=e[o.keyCode];if(9===o.keyCode&&(n=null),!(!i||"NONE"===i||"SHIFTARROW"===i&&!o.shiftKey||"ARROW"===i&&o.shiftKey||o.defaultPrevented)){var s={left:!0,up:!0,right:!0,down:!0};"INPUT"!==r.nodeName&&"TEXTAREA"!==r.nodeName||(s=function(t){var n=["email","date","month","number","time","week"],o=["password","text","search","tel","url",null],i=document.activeElement,r={left:!1,up:!1,right:!1,down:!1},a=e[t.keyCode];if(void 0===a)return r;if(!n.includes(i.getAttribute("type"))||"up"!==a&&"down"!==a)if(o.includes(i.getAttribute("type"))||"TEXTAREA"===i.nodeName){var l=i.selectionStart,s=i.selectionEnd;l===s&&(0===l&&(r.left=!0,r.up=!0),s===i.value.length&&(r.right=!0,r.down=!0))}else r[a]=!0;else r[a]=!0;return r}(o)),s[a]&&(o.preventDefault(),t=new Map,l(a),t=null,n=null)}})),document.addEventListener("mouseup",(e=>{n={x:e.clientX,y:e.clientY}})),window.addEventListener("focusin",(e=>{e.target!==window&&(o.element=e.target,o.rect=e.target.getBoundingClientRect())}))}function l(e){var t=function(){var e=document.activeElement;if(!e||e===document.body&&!document.querySelector(":focus")){if(o.element&&e!==o.element){var t=window.getComputedStyle(o.element,null),n=["hidden","collapse"];if(o.element.disabled||n.includes(t.getPropertyValue("visibility")))return e=o.element}e=document.documentElement}!o.element||0!==$(o.element).height&&0!==$(o.element).width||(i=o.rect);if(!N(e)){var r=g(e);if(r&&(r===window||"auto"===S(r)))return r}return e}(),r=t,a=null;n&&(null===(a=document.elementFromPoint(n.x,n.y))&&(a=document.body),I(a)&&!P(a)?n=null:r=P(a)?a:a.getSpatialNavigationContainer()),r!==document&&r!==document.documentElement||(r=document.body||document.documentElement);var l=null;if((P(r)||"BODY"===r.nodeName)&&"INPUT"!==r.nodeName){"IFRAME"===r.nodeName&&(r=r.contentDocument.documentElement),l=r;if(document.activeElement===t||document.activeElement===document.body&&t===document.documentElement){if("scroll"===S(r)){if(c(r,e))return}else if("focus"===S(r)){if(s(r.spatialNavigationSearch(e,{container:r,candidates:u(r,{mode:"all"})}),e))return}else if("auto"===S(r)&&(s(r.spatialNavigationSearch(e,{container:r}),e)||c(r,e)))return}else l=l.getSpatialNavigationContainer()}var d=(l=r.getSpatialNavigationContainer()).parentElement?l.getSpatialNavigationContainer():null;if(d||window.location===window.parent.location||(d=window.parent.document.documentElement),"scroll"===S(l)){if(c(l,e))return}else"focus"===S(l)?k(r,l,d,e,"all"):"auto"===S(l)&&k(r,l,d,e,"visible")}function s(e,t){if(e){if(!b("beforefocus",e,null,t))return!0;var o=e.getSpatialNavigationContainer();return o!==window&&"focus"===S(o)?e.focus():e.focus({preventScroll:!0}),n=null,!0}return!1}function c(e,t){return x(e,t)&&!L(e,t)?(E(e,t),!0):!e.parentElement&&!R(e,t)&&(E(e.ownerDocument.documentElement,t),!0)}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{mode:"visible"},n=[];if(e.childElementCount>0){e.parentElement||(e=e.getElementsByTagName("body")[0]||document.body);var o,i=a(e.children);try{for(i.s();!(o=i.n()).done;){var r=o.value;T(r)?n.push(r):I(r)?(n.push(r),!P(r)&&r.childElementCount&&(n=n.concat(u(r,{mode:"all"})))):r.childElementCount&&(n=n.concat(u(r,{mode:"all"})))}}catch(e){i.e(e)}finally{i.f()}}return"all"===t.mode?n:n.filter(A)}function d(e,t,n,o){var i=e;return o=o||i.getSpatialNavigationContainer(),m(i,n=!n||n.length<=0?u(o):n,t,o)}function p(e,t){var o,r=this,a=[],l=[],s=function(e){var t=e.getSpatialNavigationContainer(),n=t.focusableAreas(),o=[];return n.forEach((t=>{e!==t&&O(t,e)&&o.push(t)})),o}(r);t||(t={});var c=r.getSpatialNavigationContainer(),p=u(c),m=t.container||c;t.container&&c.contains(t.container)&&(p=p.concat(u(m)));var v=t.candidates&&t.candidates.length>0?t.candidates.filter((e=>m.contains(e))):p.filter((e=>m.contains(e)&&m!==e));if(v&&v.length>0){v.forEach((e=>{e!==r&&(r.contains(e)&&r!==e?a:l).push(e)}));var g=s.filter((e=>!a.includes(e))),y=v.filter((e=>P(e)&&O(r,e))).map((e=>e.focusableAreas())).flat().filter((e=>e!==r));if(a=a.concat(g).filter((e=>m.contains(e))),(l=l.concat(y).filter((e=>m.contains(e)))).length>0&&(l=d(r,e,l,m)),i&&(o=h(r,d(r,e,a,m),e)),a&&a.length>0&&"INPUT"!==r.nodeName&&(o=function(e,t,o){return f(e,t,o,n?F:z)}(r,a,e)),(o=o||h(r,l,e))&&T(o)){var b=u(o,{mode:"all"}),w=b.length>0?r.spatialNavigationSearch(e,{candidates:b,container:o}):null;w?o=w:I(o)||(v.splice(v.indexOf(o),1),o=v.length?r.spatialNavigationSearch(e,{candidates:v,container:m}):null)}return o}return null}function m(e,t,n,o){var r,a=e.getSpatialNavigationContainer();return void 0===n?t:(r=a.parentElement&&o!==a&&!A(e)?$(a):i||$(e),!P(e)&&"BODY"!==e.nodeName||"INPUT"===e.nodeName?t.filter((t=>{var i=$(t),a="IFRAME"===t.nodeName?t.contentDocument.body:null;return o.contains(t)&&t!==e&&a!==e&&M(i,r,n)&&!B(r,i)})):t.filter((t=>{var i=$(t);return o.contains(t)&&(e.contains(t)&&B(r,i)&&t!==e||M(i,r,n))})))}function h(e,t,n){var o,r,a=e.getSpatialNavigationContainer(),l=getComputedStyle(a).getPropertyValue("--spatial-navigation-function"),s=i||$(e);if("grid"===l)(r=t.filter((e=>V(s,$(e),n)))).length>0&&(t=r),o=q;else o=W;return f(e,t,n,o)}function f(e,t,n,o){var r=null;window.location===window.parent.location||"BODY"!==e.nodeName&&"HTML"!==e.nodeName?r=i||e.getBoundingClientRect():((r=window.frameElement.getBoundingClientRect()).x=0,r.y=0);var a=Number.POSITIVE_INFINITY,l=[];if(t)for(var s=0;s<t.length;s++){var c=o(r,$(t[s]),n);c<a?(a=c,l=[t[s]]):c===a&&l.push(t[s])}return 0===l.length?null:l.length>1&&o===q?f(e,l,n,j):l[0]}function v(){var e=this;do{if(!e.parentElement){e=window.location!==window.parent.location?window.parent.document.documentElement:window.document.documentElement;break}e=e.parentElement}while(!P(e));return e}function g(e){var t=e;do{if(!t.parentElement){t=window.location!==window.parent.location?window.parent.document.documentElement:window.document.documentElement;break}t=t.parentElement}while(!C(t)||!A(t));return t!==document&&t!==document.documentElement||(t=window),t}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{mode:"visible"},t=this.parentElement?this:document.body,n=Array.prototype.filter.call(t.getElementsByTagName("*"),I);return"all"===e.mode?n:n.filter(A)}function b(e,t,n,o){if(["beforefocus","notarget"].includes(e)){var i=new CustomEvent("nav"+e,{bubbles:!0,cancelable:!0,detail:{causedTarget:n,dir:o}});return t.dispatchEvent(i)}}function w(e,t){return(e.style.getPropertyValue(`--${t}`)||"").trim()}function S(e){return w(e,"spatial-navigation-action")||"auto"}function k(e,t,n,o,i){for(var r={candidates:u(t,{mode:i}),container:t};n;){if(s(e.spatialNavigationSearch(o,r),o))return;if("visible"===i&&c(t,o))return;if(!b("notarget",t,e,o))return;t===document||t===document.documentElement?window.location!==window.parent.location&&(t=(e=window.frameElement).ownerDocument.documentElement):t=n,r={candidates:u(t,{mode:i}),container:t};var a=t.getSpatialNavigationContainer();n=a!==t?a:null}r={candidates:u(t,{mode:i}),container:t},!n&&t&&s(e.spatialNavigationSearch(o,r),o)||b("notarget",r.container,e,o)&&("auto"!==S(t)||"visible"!==i||c(t,o))}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e)switch(t){case"left":e.scrollLeft-=40+n;break;case"right":e.scrollLeft+=40+n;break;case"up":e.scrollTop-=40+n;break;case"down":e.scrollTop+=40+n}}function P(e){return!e.parentElement||"IFRAME"===e.nodeName||C(e)||function(e){return"contain"===w(e,"spatial-navigation-contain")}(e)}function T(e){return"delegable"===w(e,"spatial-navigation-contain")}function C(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("overflow-x"),o=t.getPropertyValue("overflow-y");return!!("visible"!==n&&"clip"!==n&&_(e,"left")||"visible"!==o&&"clip"!==o&&_(e,"down"))}function x(e,t){if(e&&"object"==typeof e){if(t&&"string"==typeof t){if(_(e,t)){var n=window.getComputedStyle(e,null),o=n.getPropertyValue("overflow-x"),i=n.getPropertyValue("overflow-y");switch(t){case"left":case"right":return"visible"!==o&&"clip"!==o&&"hidden"!==o;case"up":case"down":return"visible"!==i&&"clip"!==i&&"hidden"!==i}}return!1}return"HTML"===e.nodeName||"BODY"===e.nodeName||C(e)&&_(e)}}function _(e,t){if(e&&"object"==typeof e){if(!t||"string"!=typeof t)return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight;switch(t){case"left":case"right":return e.scrollWidth>e.clientWidth;case"up":case"down":return e.scrollHeight>e.clientHeight}return!1}}function R(e,t){var n=!1;switch(t){case"left":n=0===e.scrollLeft;break;case"right":n=e.scrollWidth-e.scrollLeft-e.clientWidth==0;break;case"up":n=0===e.scrollTop;break;case"down":n=e.scrollHeight-e.scrollTop-e.clientHeight==0}return n}function L(e,t){if(x(e,t)){var n=e.scrollTop,o=e.scrollLeft,i=e.scrollHeight-e.clientHeight,r=e.scrollWidth-e.clientWidth;switch(t){case"left":return 0===o;case"right":return Math.abs(o-r)<=1;case"up":return 0===n;case"down":return Math.abs(n-i)<=1}}return!1}function N(e){var t=e.getBoundingClientRect(),n=g(e),o=null;return!(!B(o=n!==window?$(n):new DOMRect(0,0,window.innerWidth,window.innerHeight),t)||!B(o,t))}function I(e){return!(e.tabIndex<0||function(e){return"A"===e.tagName&&null===e.getAttribute("href")&&null===e.getAttribute("tabIndex")}(e)||function(e){return!!["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(e.tagName)&&e.disabled}(e)||function(e){return e.inert&&!e.ownerDocument.documentElement.inert}(e)||!function(e){return!!D(e.parentElement)&&!(!D(e)||"0"===e.style.opacity||"0px"===window.getComputedStyle(e).height||"0px"===window.getComputedStyle(e).width)}(e))&&(!!(!e.parentElement||x(e)&&_(e)||e.tabIndex>=0)||void 0)}function A(e){return!e.parentElement||D(e)&&function(e){var t=$(e);if("IFRAME"!==e.nodeName&&(t.top<0||t.left<0||t.top>e.ownerDocument.documentElement.clientHeight||t.left>e.ownerDocument.documentElement.clientWidth))return!1;var n=parseInt(e.offsetWidth)/10,o=parseInt(e.offsetHeight)/10;n=isNaN(n)?1:n,o=isNaN(o)?1:o;var i={middle:[(t.left+t.right)/2,(t.top+t.bottom)/2],leftTop:[t.left+n,t.top+o],rightBottom:[t.right-n,t.bottom-o]};for(var r in i){var a=e.ownerDocument.elementFromPoint(...i[r]);if(e===a||e.contains(a))return!0}return!1}(e)}function O(e,t){var n=$(e),o=$(t||e.getSpatialNavigationContainer());return!(n.left<o.left||n.right>o.right||n.top<o.top||n.bottom>o.bottom)}function D(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(n)}function B(e,t){var n=e.left<=t.right&&e.right>=t.right,o=e.left<=t.left&&e.right>=t.left,i=e.top<=t.top&&e.bottom>=t.top,r=e.top<=t.bottom&&e.bottom>=t.bottom;return(n||o)&&(i||r)}function M(e,t,n){switch(n){case"left":return H(t,e);case"right":return H(e,t);case"up":return U(t,e);case"down":return U(e,t);default:return!1}}function H(e,t){return e.left>=t.right||e.left>=t.left&&e.right>t.right&&e.bottom>t.top&&e.top<t.bottom}function U(e,t){return e.top>=t.bottom||e.top>=t.top&&e.bottom>t.bottom&&e.left<t.right&&e.right>t.left}function V(e,t,n){switch(n){case"left":case"right":return e.bottom>t.top&&e.top<t.bottom;case"up":case"down":return e.right>t.left&&e.left<t.right;default:return!1}}function F(e,t,o){var i=Y(o,n,t),r=Math.abs(i.entryPoint.x-i.exitPoint.x),a=Math.abs(i.entryPoint.y-i.exitPoint.y);return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}function z(e,t,n){var o={left:"right",right:"left",up:"bottom",down:"top"}[n];return Math.abs(e[o]-t[o])}function W(e,t,n){var o,i,r=0,a=0,l=Y(n,e,t),s=Math.abs(l.entryPoint.x-l.exitPoint.x),c=Math.abs(l.entryPoint.y-l.exitPoint.y),u=Math.sqrt(Math.pow(s,2)+Math.pow(c,2)),d=function(e,t){var n={width:0,height:0,area:0},o=[Math.max(e.left,t.left),Math.max(e.top,t.top)],i=[Math.min(e.right,t.right),Math.min(e.bottom,t.bottom)];n.width=Math.abs(o[0]-i[0]),n.height=Math.abs(o[1]-i[1]),o[0]>=i[0]||o[1]>=i[1]||(n.area=Math.sqrt(n.width*n.height));return n}(e,t),p=d.area;switch(n){case"left":case"right":V(e,t,n)?a=Math.min(d.height/e.height,1):r=e.height/2,o=30*(c+r),i=5*a;break;case"up":case"down":V(e,t,n)?a=Math.min(d.width/e.width,1):r=e.width/2,o=2*(s+r),i=5*a;break;default:o=0,i=0}return u+o-i-p}function j(e,t,n){var o=Y(n,e,t),i=Math.abs(o.entryPoint.x-o.exitPoint.x),r=Math.abs(o.entryPoint.y-o.exitPoint.y);return Math.sqrt(Math.pow(i,2)+Math.pow(r,2))}function q(e,t,n){var o=Y(n,e,t);return"left"===n||"right"===n?Math.abs(o.entryPoint.x-o.exitPoint.x):Math.abs(o.entryPoint.y-o.exitPoint.y)}function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"down",t=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,i={entryPoint:{x:0,y:0},exitPoint:{x:0,y:0}};if(n){switch(i.exitPoint=t,e){case"left":i.entryPoint.x=o.right;break;case"up":i.entryPoint.y=o.bottom;break;case"right":i.entryPoint.x=o.left;break;case"down":i.entryPoint.y=o.top}switch(e){case"left":case"right":n.y<=o.top?i.entryPoint.y=o.top:n.y<o.bottom?i.entryPoint.y=n.y:i.entryPoint.y=o.bottom;break;case"up":case"down":n.x<=o.left?i.entryPoint.x=o.left:n.x<o.right?i.entryPoint.x=n.x:i.entryPoint.x=o.right}}else{switch(e){case"left":i.exitPoint.x=t.left,i.entryPoint.x=o.right<t.left?o.right:t.left;break;case"up":i.exitPoint.y=t.top,i.entryPoint.y=o.bottom<t.top?o.bottom:t.top;break;case"right":i.exitPoint.x=t.right,i.entryPoint.x=o.left>t.right?o.left:t.right;break;case"down":i.exitPoint.y=t.bottom,i.entryPoint.y=o.top>t.bottom?o.top:t.bottom}switch(e){case"left":case"right":U(t,o)?(i.exitPoint.y=t.top,i.entryPoint.y=o.bottom<t.top?o.bottom:t.top):U(o,t)?(i.exitPoint.y=t.bottom,i.entryPoint.y=o.top>t.bottom?o.top:t.bottom):(i.exitPoint.y=Math.max(t.top,o.top),i.entryPoint.y=i.exitPoint.y);break;case"up":case"down":H(t,o)?(i.exitPoint.x=t.left,i.entryPoint.x=o.right<t.left?o.right:t.left):H(o,t)?(i.exitPoint.x=t.right,i.entryPoint.x=o.left>t.right?o.left:t.right):(i.exitPoint.x=Math.max(t.left,o.left),i.entryPoint.x=i.exitPoint.x)}}return i}function $(e){var n=t&&t.get(e);if(!n){var o=e.getBoundingClientRect();n={top:Number(o.top.toFixed(2)),right:Number(o.right.toFixed(2)),bottom:Number(o.bottom.toFixed(2)),left:Number(o.left.toFixed(2)),width:Number(o.width.toFixed(2)),height:Number(o.height.toFixed(2))},t&&t.set(e,n)}return n}function K(e){var t=window.__spatialNavigation__&&window.__spatialNavigation__.keyMode;window.__spatialNavigation__=!1===e?G():Object.assign(G(),function(){function e(e,t){return x(e,t)&&!L(e,t)||!e.parentElement&&!R(e,t)}function t(t,n,o,i){var r=n,a=null;if(r!==document&&r!==document.documentElement||(r=document.body||document.documentElement),(P(r)||"BODY"===r.nodeName)&&"INPUT"!==r.nodeName){"IFRAME"===r.nodeName&&(r=r.contentDocument.body);var l=u(r,i);if(Array.isArray(l)&&l.length>0)return t?d(r,o,l):r.spatialNavigationSearch(o,{candidates:l});if(e(r,o))return t?[]:r}var s=r.getSpatialNavigationContainer(),c=s.parentElement?s.getSpatialNavigationContainer():null;for(c||window.location===window.parent.location||(c=window.parent.document.documentElement);c;){var p=m(r,u(s,i),o,s);if(Array.isArray(p)&&p.length>0){if(a=r.spatialNavigationSearch(o,{candidates:p,container:s}))return t?p:a}else{if(e(s,o))return t?[]:r;if(s===document||s===document.documentElement){if(s=window.document.documentElement,window.location!==window.parent.location){if(r=window.frameElement,!(s=window.parent.document.documentElement).parentElement){c=null;break}c=s.getSpatialNavigationContainer()}}else{if(I(s)&&(r=s),!(s=c).parentElement){c=null;break}c=s.getSpatialNavigationContainer()}}}if(!c&&s){var h=m(r,u(s,i),o,s);if(Array.isArray(h)&&h.length>0&&(a=r.spatialNavigationSearch(o,{candidates:h,container:s})))return t?h:a}if(e(s,o))return r}return{isContainer:P,isScrollContainer:C,isVisibleInScroller:N,findCandidates:t.bind(null,!0),findNextTarget:t.bind(null,!1),getDistanceFromTarget:(e,t,n)=>(P(e)||"BODY"===e.nodeName)&&"INPUT"!==e.nodeName&&u(e).includes(t)?z($(e),$(t),n):W($(e),$(t),n)}}()),window.__spatialNavigation__.keyMode=t,Object.seal(window.__spatialNavigation__)}function G(){return{enableExperimentalAPIs:K,get keyMode(){return this._keymode?this._keymode:"ARROW"},set keyMode(e){this._keymode=["SHIFTARROW","ARROW","NONE"].includes(e)?e:"ARROW"},setStartingPoint:function(e,t){n=e&&t?{x:e,y:t}:null}}}}();var L=".ytaf-ui-container {\r\n position: absolute;\r\n top: 10%;\r\n left: 10%;\r\n right: 10%;\r\n bottom: 10%;\r\n\r\n background: rgba(0, 0, 0, 0.8);\r\n color: white;\r\n border-radius: 20px;\r\n padding: 20px;\r\n font-size: 1.5rem;\r\n z-index: 1000;\r\n}\r\n\r\n.ytaf-ui-container :focus {\r\n outline: 4px red solid;\r\n}\r\n\r\n.ytaf-ui-container h1 {\r\n margin: 0;\r\n margin-bottom: 0.5em;\r\n text-align: center;\r\n}\r\n\r\n.ytaf-ui-container input[type='checkbox'] {\r\n width: 1.4rem;\r\n height: 1.4rem;\r\n}\r\n\r\n.ytaf-ui-container input[type='radio'] {\r\n width: 1.4rem;\r\n height: 1.4rem;\r\n}\r\n\r\n.ytaf-ui-container label {\r\n display: block;\r\n font-size: 1.4rem;\r\n}\r\n\r\n.ytaf-notification-container {\r\n position: absolute;\r\n right: 10px;\r\n bottom: 10px;\r\n font-size: 16pt;\r\n z-index: 1200;\r\n}\r\n\r\n.ytaf-notification-container .message {\r\n background: rgba(0, 0, 0, 0.7);\r\n color: white;\r\n padding: 1em;\r\n margin: 0.5em;\r\n transition: all 0.3s ease-in-out;\r\n opacity: 1;\r\n line-height: 1;\r\n border-right: 10px solid rgba(50, 255, 50, 0.3);\r\n display: inline-block;\r\n float: right;\r\n}\r\n\r\n.ytaf-notification-container .message-hidden {\r\n opacity: 0;\r\n margin: 0 0.5em;\r\n padding: 0 1em;\r\n line-height: 0;\r\n}\r\n\r\n/* Fixes transparency effect for the video player */\r\n\r\n.ytLrWatchDefaultShadow {\r\n background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.8) 90%) !important;\r\n background-color: rgba(0, 0, 0, 0.3) !important;\r\n display: block !important;\r\n height: 100% !important;\r\n pointer-events: none !important;\r\n position: absolute !important;\r\n width: 100% !important;\r\n}\r\n\r\n/* Fixes shorts having a black background */\r\n\r\n.ytLrTileHeaderRendererShorts {\r\n background-image: none !important;\r\n}\r\n\r\n/* Multiline support for strings in the UI */\r\n\r\n.ytLrOverlayPanelHeaderRendererSubtitle {\r\n white-space: pre-wrap !important;\r\n}\r\n\r\n/* Fixes SponsorBlock segments overlapping with the playhead */\r\n\r\n.ytLrProgressBarPlayhead {\r\n z-index: 1 !important;\r\n}\r\n\r\n.ytLrProgressBarPlayed {\r\n z-index: 1 !important;\r\n}",N=document.createElement("style"),I="";function A(){I=`\n ytlr-guide-response yt-focus-container {\n background-color: ${u("focusContainerColor")};\n }\n\n #container {\n background-color: ${u("routeColor")} !important;\n }\n`;var e=document.querySelector("style[nonce]");e?e.textContent+=I:N.textContent=I}document.head.appendChild(N),A();var O=setInterval((()=>{document.querySelector("video")&&(!function(){var e=document.querySelector("style[nonce]");if(e)e.textContent+=L;else{var t=document.createElement("style");t.textContent=L,document.head.appendChild(t)}if(u("enableFixedUI"))try{window.tectonicConfig.featureSwitches.isLimitedMemory=!1,window.tectonicConfig.clientData.legacyApplicationQuality="full-animation",window.tectonicConfig.featureSwitches.enableAnimations=!0,window.tectonicConfig.featureSwitches.enableOnScrollLinearAnimation=!0,window.tectonicConfig.featureSwitches.enableListAnimations=!0}catch(e){}window.__spatialNavigation__.keyMode="NONE";var n={37:"left",38:"up",39:"right",40:"down"},o=document.createElement("div");o.classList.add("ytaf-ui-container"),o.style.display="none",o.setAttribute("tabindex",0),o.addEventListener("focus",(()=>console.info("uiContainer focused!")),!0),o.addEventListener("blur",(()=>console.info("uiContainer blured!")),!0),o.addEventListener("keydown",(e=>{if(console.info("uiContainer key event:",e.type,e.keyCode,e),404!==e.keyCode&&172!==e.keyCode){var t;if(e.keyCode in n)navigate(n[e.keyCode]);else{if(13===e.keyCode||32===e.keyCode){console.log("OK button pressed");var i=document.querySelector(":focus");return"checkbox"===i.type&&(i.checked=!i.checked,i.dispatchEvent(new Event("change"))),e.preventDefault(),void e.stopPropagation()}if(27===e.keyCode&&"text"!==document.querySelector(":focus").type)o.style.display="none",o.blur();else if("text"===document.querySelector(":focus").type&&27===e.keyCode){var r=document.querySelector(":focus");r.value=r.value.slice(0,-1)}}"Enter"!==e.key&&"Enter"!==(null===(t=e.Uc)||void 0===t?void 0:t.key)||"text"===document.querySelector(":focus").type&&document.querySelector(":focus").dispatchEvent(new Event("change"))}}),!0),o.innerHTML='\n<h1>TizenTube Theme Configuration</h1>\n<label for="__barColor">Navigation Bar Color: <input type="text" id="__barColor"/></label>\n<label for="__routeColor">Main Content Color: <input type="text" id="__routeColor"/></label>\n<div><small>Sponsor segments skipping - https://sponsor.ajay.app</small></div>\n',document.querySelector("body").appendChild(o),o.querySelector("#__barColor").value=u("focusContainerColor"),o.querySelector("#__barColor").addEventListener("change",(e=>{d("focusContainerColor",e.target.value),A()})),o.querySelector("#__routeColor").value=u("routeColor"),o.querySelector("#__routeColor").addEventListener("change",(e=>{d("routeColor",e.target.value),A()}));var i=e=>(console.info("Key event:",e.type,e.keyCode,e.keyCode,e.defaultPrevented),403==e.keyCode?(console.info("Taking over!"),e.preventDefault(),e.stopPropagation(),"keydown"===e.type&&("none"===o.style.display?(console.info("Showing and focusing!"),o.style.display="block",o.focus()):(console.info("Hiding!"),o.style.display="none",o.blur())),!1):(404==e.keyCode&&"keydown"===e.type&&v(),!0));if(document.addEventListener("keydown",i,!0),document.addEventListener("keypress",i,!0),document.addEventListener("keyup",i,!0),setTimeout((()=>{p("Chào mừng đến với TizenTube","Vào cài đặt và cuộn xuống mục TizenTube để mở Cài đặt TizenTube, mở cài đặt phát lại, nhấp vào Tốc độ để mở Cài đặt tốc độ video và nhấn phím [RED] để mở Cài đặt Theme TizenTube.")}),2e3),u("enableFixedUI"))try{new MutationObserver(((e,t)=>{var n=document.body;n.classList.contains("app-quality-root")&&n.classList.remove("app-quality-root")})).observe(document.body,{attributes:!0,childList:!1,subtree:!1})}catch(e){}}(),function(){var e=function(){if(window._yttv[t]&&window._yttv[t].instance&&window._yttv[t].instance.resolveCommand){var e=window._yttv[t].instance.resolveCommand;window._yttv[t].instance.resolveCommand=function(t,n){var o,i,r;if(t.setClientSettingEndpoint){var l,s=a(t.setClientSettingEndpoint.settingDatas);try{for(s.s();!(l=s.n()).done;)if(!l.value.clientSettingEnum.item.includes("_")){var c,p=a(t.setClientSettingEndpoint.settingDatas);try{for(p.s();!(c=p.n()).done;){var m=c.value,h=Object.keys(m).find((e=>e.includes("Value"))),f="intValue"===h?Number(m[h]):m[h];if("arrayValue"===h){var v=u(m.clientSettingEnum.item);v.includes(f)?v.splice(v.indexOf(f),1):v.push(f),d(m.clientSettingEnum.item,v)}else d(m.clientSettingEnum.item,f)}}catch(e){p.e(e)}finally{p.f()}}}catch(e){s.e(e)}finally{s.f()}}else{if(t.customAction)return w(t.customAction.action,t.customAction.parameters),!0;if(null!=t&&null!==(o=t.signalAction)&&void 0!==o&&o.customAction)return w(t.signalAction.customAction.action,t.signalAction.customAction.parameters),!0;if(null!=t&&null!==(i=t.showEngagementPanelEndpoint)&&void 0!==i&&i.customAction)return w(t.showEngagementPanelEndpoint.customAction.action,t.showEngagementPanelEndpoint.customAction.parameters),!0;if("playback-settings"===(null==t||null===(r=t.openPopupAction)||void 0===r?void 0:r.uniqueId)){var g,y=a(t.openPopupAction.popup.overlaySectionRenderer.overlay.overlayTwoPanelRenderer.actionPanel.overlayPanelRenderer.content.overlayPanelItemListRenderer.items);try{for(y.s();!(g=y.n()).done;){var b,S=g.value;"SLOW_MOTION_VIDEO"===(null==S||null===(b=S.compactLinkRenderer)||void 0===b||null===(b=b.icon)||void 0===b?void 0:b.iconType)&&(S.compactLinkRenderer.subtitle&&(S.compactLinkRenderer.subtitle.simpleText="with TizenTube"),S.compactLinkRenderer.serviceEndpoint={clickTrackingParams:"null",signalAction:{customAction:{action:"TT_SPEED_SETTINGS_SHOW",parameters:[]}}})}}catch(e){y.e(e)}finally{y.f()}}}return e.call(this,t,n)}}};for(var t in window._yttv)e()}(),clearInterval(O))}),250);if(window.h5vcc&&window.h5vcc.tizentube){var D=window.h5vcc.tizentube.GetVersion();var B=Math.floor(Date.now()/1e3);function H(){fetch("https://api.github.com/repos/daivietpda/TizenTubeCobalt/releases/latest").then((e=>{if(!e.ok)throw new Error("Phản hồi của mạng không ổn");return e.json()})).then((e=>{var t=e.tag_name.replace("v",""),n=new Date(e.published_at).getTime()/1e3;if(t!==D){console.info(`Phiên bản mới có sẵn: ${t} (Hiện tại: ${D})`);var o=e.assets.map((e=>h({title:e.name,subtitle:`Kích thước: ${(e.size/1048576).toFixed(2)} MB`},{icon:"DOWN_ARROW"},[{customAction:{action:"UPDATE_DOWNLOAD",parameters:e.browser_download_url}},{signalAction:{signal:"POPUP_BACK"}}])));o.push(h({title:"Nhắc tôi sau",subtitle:"Kiểm tra cập nhật sau."},{icon:"SEARCH_HISTORY"},[{customAction:{action:"UPDATE_REMIND_LATER",parameters:B+86400}},{signalAction:{signal:"POPUP_BACK"}}])),m({title:"Cập nhật có sẵn",subtitle:`Phiên bản mới của TizenTube Cobalt đã có sẵn: ${t}\nPhiên bản hiện tại: ${D}\nNgày phát hành: ${new Date(1e3*n).toLocaleString()}\nGhi chú phát hành:\n${e.body}\n\nVui lòng chọn file để tải xuống:`},o,0,"tt-update-modal")}else console.info("Bạn đang sử dụng phiên bản mới nhất của TizenTube.")})).catch((e=>{console.error("Lỗi khi tải bản phát hành mới nhất:",e),p("TizenTube Kiểm tra cập nhật không thành công","Không thể kiểm tra cập nhật.",null)}))}u("dontCheckUpdateUntil")>B?console.info("Skipping update check until",new Date(1e3*u("dontCheckUpdateUntil")).toLocaleString()):H()}}();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@daivietpda/tizentube",
3
3
  "appName": "TizenTube",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "description": "TizenTube is an ad-free and sponsor-free solution for your favourite streaming website on your Tizen (Samsung) TVs.",
6
6
  "packageType": "mods",
7
7
  "websiteURL": "https://youtube.com/tv?additionalDataUrl=http%3A%2F%2Flocalhost%3A8085%2Fdial%2Fapps%2FYouTube",