From b61ecd754ad6310d30c4e3aebc78f6c8247f5d78 Mon Sep 17 00:00:00 2001 From: goodtube4u Date: Sun, 16 Nov 2025 16:56:42 +1000 Subject: [PATCH] Improved homepage sizing options --- goodtube.js | 59 ++++++++++++++++++++++--------------------------- goodtube.min.js | 54 +++++++++++++++++++++++++++----------------- 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/goodtube.js b/goodtube.js index 2c7e328..8b35a73 100644 --- a/goodtube.js +++ b/goodtube.js @@ -477,6 +477,22 @@ if (goodTube_videosPerRow !== 'default') { // Debug message console.log('[GoodTube] Videos per row on the home page set to ' + goodTube_videosPerRow); + + let fixedWidthPercentage = (100 / parseFloat(goodTube_videosPerRow)) + '%'; + + cssOutput += ` + ytd-rich-item-renderer[rendered-from-rich-grid] { + width: calc(` + fixedWidthPercentage + ` - ((var(--ytd-rich-grid-item-margin) / 2)) / ` + parseFloat(goodTube_videosPerRow - 1) + ` * ` + (parseFloat(goodTube_videosPerRow - 1) * 2) + ` ) !important; + width: calc(` + fixedWidthPercentage + ` - ((var(--ytd-rich-grid-item-margin) / 2)) / ` + parseFloat(goodTube_videosPerRow - 1) + ` * ` + (parseFloat(goodTube_videosPerRow - 1) * 2) + ` ) !important; + margin-left: calc(var(--ytd-rich-grid-item-margin) / 2) !important; + margin-right: calc(var(--ytd-rich-grid-item-margin) / 2) !important; + } + + #contents.ytd-rich-grid-renderer { + padding-right: 24px !important; + box-sizing: border-box !important; + } + `; } // Add the styles to the page @@ -485,33 +501,6 @@ document.head.appendChild(style); } - // Set videos per row on the home page - let goodTube_youtube_setVideosPerRow_timeout = setTimeout(() => {}, 0); - function goodTube_youtube_setVideosPerRow(videosPerRow) { - // Make sure we're on the home page - let currentUrl = window.location.href; - currentUrl = currentUrl.replace('https://', '').replace('http://', ''); - let bits = currentUrl.split('/'); - if (bits.length <= 2) { - // Target the aspect ratio element with the CSS variables - let variableElement = document.querySelector('ytd-rich-grid-renderer #contents'); - - // Make sure we found the variable element, if not retry - if (!variableElement) { - clearTimeout(goodTube_youtube_setVideosPerRow_timeout); - goodTube_youtube_setVideosPerRow_timeout = setTimeout(() => { goodTube_youtube_setVideosPerRow(videosPerRow); }, 100); - return; - } - - // Set the videos per row - variableElement.style.setProperty("--ytd-rich-grid-items-per-row", videosPerRow); - variableElement.style.setProperty("--ytd-rich-grid-posts-per-row", videosPerRow); - variableElement.style.setProperty("--ytd-rich-grid-slim-items-per-row", videosPerRow); - variableElement.style.setProperty("--ytd-rich-grid-game-cards-per-row", videosPerRow); - variableElement.style.setProperty("--ytd-rich-grid-mini-game-cards-per-row", videosPerRow); - } - } - // Hide members only videos function goodTube_youtube_hideMembersOnlyVideos() { let videos = document.querySelectorAll('ytd-rich-item-renderer:not(.goodTube_checked)'); @@ -2116,12 +2105,6 @@ else { // Stop the video (this solves some weird edge case where the video can be playing in the background) goodTube_player.contentWindow.postMessage('goodTube_stopVideo', '*'); - - // Videos per row on the home page - if (goodTube_videosPerRow !== 'default') { - // Set videos per row on the home page - goodTube_youtube_setVideosPerRow(goodTube_videosPerRow); - } } // Hide shorts (real time) @@ -2193,6 +2176,8 @@ let videosPerRow_4 = ''; let videosPerRow_5 = ''; let videosPerRow_6 = ''; + let videosPerRow_7 = ''; + let videosPerRow_8 = ''; if (videosPerRow_default === 'default') { videosPerRow_default = ' selected'; } @@ -2211,6 +2196,12 @@ else if (goodTube_videosPerRow === '6') { videosPerRow_6 = ' selected'; } + else if (goodTube_videosPerRow === '7') { + videosPerRow_7 = ' selected'; + } + else if (goodTube_videosPerRow === '8') { + videosPerRow_8 = ' selected'; + } // Add content to the menu container goodTube_helper_innerHTML(menuContainer, ` @@ -2286,6 +2277,8 @@ 4 5 6 + 7 + 8 diff --git a/goodtube.min.js b/goodtube.min.js index 0f1ec7c..5c1344c 100644 --- a/goodtube.min.js +++ b/goodtube.min.js @@ -1,8 +1,8 @@ -(()=>{(function(){"use strict";var tn=Object.defineProperty,f=(e,t)=>tn(e,"name",{value:t,configurable:!0}),{entries:xo,setPrototypeOf:vo,isFrozen:on,getPrototypeOf:nn,getOwnPropertyDescriptor:an}=Object,{freeze:O,seal:V,create:Nt}=Object,{apply:Pt,construct:Bt}=typeof Reflect<"u"&&Reflect;O||(O=f(function(e){return e},"freeze")),V||(V=f(function(e){return e},"seal")),Pt||(Pt=f(function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),l=2;l1?t-1:0),n=1;n1?i-1:0),l=1;l2&&arguments[2]!==void 0?arguments[2]:nt;vo&&vo(e,null);let n=t.length;for(;n--;){let l=t[n];if(typeof l=="string"){let u=i(l);u!==l&&(on(t)||(t[n]=u),l=u)}e[l]=!0}return e}f(c,"addToSet");function Ao(e){for(let t=0;t/gm),mn=V(/\$\{[\w\W]*/gm),gn=V(/^data-[\-\w.\u00B7-\uFFFF]+$/),bn=V(/^aria-[\-\w]+$/),Lo=V(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yn=V(/^(?:\w+script|data):/i),_n=V(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Do=V(/^html$/i),hn=V(/^[a-z][.\w]*(-[.\w]+)+$/i),Co=Object.freeze({__proto__:null,ARIA_ATTR:bn,ATTR_WHITESPACE:_n,CUSTOM_ELEMENT:hn,DATA_ATTR:gn,DOCTYPE_NAME:Do,ERB_EXPR:fn,IS_ALLOWED_URI:Lo,IS_SCRIPT_OR_DATA:yn,MUSTACHE_EXPR:pn,TMPLIT_EXPR:mn}),Fe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Tn=f(function(){return typeof window>"u"?null:window},"getGlobal"),xn=f(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));let l="dompurify"+(i?"#"+i:"");try{return e.createPolicy(l,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},"_createTrustedTypesPolicy"),Ro=f(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function Gt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tn(),t=f(o=>Gt(o),"DOMPurify");if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Fe.document||!e.Element)return t.isSupported=!1,t;let{document:i}=e,n=i,l=n.currentScript,{DocumentFragment:u,HTMLTemplateElement:m,Node:w,Element:x,NodeFilter:k,NamedNodeMap:ie=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:pe,DOMParser:fe,trustedTypes:me}=e,ne=x.prototype,vt=_e(ne,"cloneNode"),wt=_e(ne,"remove"),Ke=_e(ne,"nextSibling"),Je=_e(ne,"childNodes"),R=_e(ne,"parentNode");if(typeof m=="function"){let o=i.createElement("template");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let A,ae="",{implementation:Se,createNodeIterator:Xe,createDocumentFragment:kt,getElementsByTagName:F}=i,{importNode:X}=n,_=Ro();t.isSupported=typeof xo=="function"&&typeof R=="function"&&Se&&Se.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:U,ERB_EXPR:Ie,TMPLIT_EXPR:Me,DATA_ATTR:At,ARIA_ATTR:Et,IS_SCRIPT_OR_DATA:St,ATTR_WHITESPACE:$e,CUSTOM_ELEMENT:aa}=Co,{IS_ALLOWED_URI:Ci}=Co,E=null,Ri=c({},[...Eo,...Ft,...Ut,...Ht,...So]),M=null,Oi=c({},[...Io,...Yt,...Mo,...at]),v=Object.seal(Nt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),et=null,uo=null,Le=Object.seal(Nt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ni=!0,co=!0,Pi=!1,Bi=!0,De=!1,It=!0,ge=!1,po=!1,fo=!1,Ce=!1,Mt=!1,Lt=!1,Vi=!0,zi=!1,ra="user-content-",mo=!0,tt=!1,Re={},Oe=null,Fi=c({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ui=null,Hi=c({},["audio","video","img","source","image","track"]),go=null,Yi=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dt="http://www.w3.org/1998/Math/MathML",Ct="http://www.w3.org/2000/svg",$="http://www.w3.org/1999/xhtml",Ne=$,bo=!1,yo=null,da=c({},[Dt,Ct,$],Vt),Rt=c({},["mi","mo","mn","ms","mtext"]),Ot=c({},["annotation-xml"]),la=c({},["title","style","font","a","script"]),ot=null,sa=["application/xhtml+xml","text/html"],ua="text/html",S=null,Pe=null,ca=i.createElement("form"),Gi=f(function(o){return o instanceof RegExp||o instanceof Function},"isRegexOrFunction"),_o=f(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Pe&&Pe===o)){if((!o||typeof o!="object")&&(o={}),o=q(o),ot=sa.indexOf(o.PARSER_MEDIA_TYPE)===-1?ua:o.PARSER_MEDIA_TYPE,S=ot==="application/xhtml+xml"?Vt:nt,E=H(o,"ALLOWED_TAGS")?c({},o.ALLOWED_TAGS,S):Ri,M=H(o,"ALLOWED_ATTR")?c({},o.ALLOWED_ATTR,S):Oi,yo=H(o,"ALLOWED_NAMESPACES")?c({},o.ALLOWED_NAMESPACES,Vt):da,go=H(o,"ADD_URI_SAFE_ATTR")?c(q(Yi),o.ADD_URI_SAFE_ATTR,S):Yi,Ui=H(o,"ADD_DATA_URI_TAGS")?c(q(Hi),o.ADD_DATA_URI_TAGS,S):Hi,Oe=H(o,"FORBID_CONTENTS")?c({},o.FORBID_CONTENTS,S):Fi,et=H(o,"FORBID_TAGS")?c({},o.FORBID_TAGS,S):q({}),uo=H(o,"FORBID_ATTR")?c({},o.FORBID_ATTR,S):q({}),Re=H(o,"USE_PROFILES")?o.USE_PROFILES:!1,Ni=o.ALLOW_ARIA_ATTR!==!1,co=o.ALLOW_DATA_ATTR!==!1,Pi=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Bi=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=o.SAFE_FOR_TEMPLATES||!1,It=o.SAFE_FOR_XML!==!1,ge=o.WHOLE_DOCUMENT||!1,Ce=o.RETURN_DOM||!1,Mt=o.RETURN_DOM_FRAGMENT||!1,Lt=o.RETURN_TRUSTED_TYPE||!1,fo=o.FORCE_BODY||!1,Vi=o.SANITIZE_DOM!==!1,zi=o.SANITIZE_NAMED_PROPS||!1,mo=o.KEEP_CONTENT!==!1,tt=o.IN_PLACE||!1,Ci=o.ALLOWED_URI_REGEXP||Lo,Ne=o.NAMESPACE||$,Rt=o.MATHML_TEXT_INTEGRATION_POINTS||Rt,Ot=o.HTML_INTEGRATION_POINTS||Ot,v=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Gi(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(v.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Gi(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(v.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(v.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(co=!1),Mt&&(Ce=!0),Re&&(E=c({},So),M=[],Re.html===!0&&(c(E,Eo),c(M,Io)),Re.svg===!0&&(c(E,Ft),c(M,Yt),c(M,at)),Re.svgFilters===!0&&(c(E,Ut),c(M,Yt),c(M,at)),Re.mathMl===!0&&(c(E,Ht),c(M,Mo),c(M,at))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Le.tagCheck=o.ADD_TAGS:(E===Ri&&(E=q(E)),c(E,o.ADD_TAGS,S))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Le.attributeCheck=o.ADD_ATTR:(M===Oi&&(M=q(M)),c(M,o.ADD_ATTR,S))),o.ADD_URI_SAFE_ATTR&&c(go,o.ADD_URI_SAFE_ATTR,S),o.FORBID_CONTENTS&&(Oe===Fi&&(Oe=q(Oe)),c(Oe,o.FORBID_CONTENTS,S)),mo&&(E["#text"]=!0),ge&&c(E,["html","head","body"]),E.table&&(c(E,["tbody"]),delete et.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ze('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=o.TRUSTED_TYPES_POLICY,ae=A.createHTML("")}else A===void 0&&(A=xn(me,l)),A!==null&&typeof ae=="string"&&(ae=A.createHTML(""));O&&O(o),Pe=o}},"_parseConfig"),Qi=c({},[...Ft,...Ut,...un]),qi=c({},[...Ht,...cn]),pa=f(function(o){let r=R(o);(!r||!r.tagName)&&(r={namespaceURI:Ne,tagName:"template"});let a=nt(o.tagName),b=nt(r.tagName);return yo[o.namespaceURI]?o.namespaceURI===Ct?r.namespaceURI===$?a==="svg":r.namespaceURI===Dt?a==="svg"&&(b==="annotation-xml"||Rt[b]):!!Qi[a]:o.namespaceURI===Dt?r.namespaceURI===$?a==="math":r.namespaceURI===Ct?a==="math"&&Ot[b]:!!qi[a]:o.namespaceURI===$?r.namespaceURI===Ct&&!Ot[b]||r.namespaceURI===Dt&&!Rt[b]?!1:!qi[a]&&(la[a]||!Qi[a]):!!(ot==="application/xhtml+xml"&&yo[o.namespaceURI]):!1},"_checkValidNamespace"),be=f(function(o){Be(t.removed,{element:o});try{R(o).removeChild(o)}catch{wt(o)}},"_forceRemove"),ye=f(function(o,r){try{Be(t.removed,{attribute:r.getAttributeNode(o),from:r})}catch{Be(t.removed,{attribute:null,from:r})}if(r.removeAttribute(o),o==="is")if(Ce||Mt)try{be(r)}catch{}else try{r.setAttribute(o,"")}catch{}},"_removeAttribute"),ji=f(function(o){let r=null,a=null;if(fo)o=""+o;else{let h=zt(o,/^[\r\n\t ]+/);a=h&&h[0]}ot==="application/xhtml+xml"&&Ne===$&&(o=''+o+"");let b=A?A.createHTML(o):o;if(Ne===$)try{r=new fe().parseFromString(b,ot)}catch{}if(!r||!r.documentElement){r=Se.createDocument(Ne,"template",null);try{r.documentElement.innerHTML=bo?ae:b}catch{}}let L=r.body||r.documentElement;return o&&a&&L.insertBefore(i.createTextNode(a),L.childNodes[0]||null),Ne===$?F.call(r,ge?"html":"body")[0]:ge?r.documentElement:L},"_initDocument"),Wi=f(function(o){return Xe.call(o.ownerDocument||o,o,k.SHOW_ELEMENT|k.SHOW_COMMENT|k.SHOW_TEXT|k.SHOW_PROCESSING_INSTRUCTION|k.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),ho=f(function(o){return o instanceof pe&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof ie)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},"_isClobbered"),Zi=f(function(o){return typeof w=="function"&&o instanceof w},"_isNode");function J(o,r,a){it(o,b=>{b.call(t,r,a,Pe)})}f(J,"_executeHooks");let Ki=f(function(o){let r=null;if(J(_.beforeSanitizeElements,o,null),ho(o))return be(o),!0;let a=S(o.nodeName);if(J(_.uponSanitizeElement,o,{tagName:a,allowedTags:E}),It&&o.hasChildNodes()&&!Zi(o.firstElementChild)&&N(/<[/\w!]/g,o.innerHTML)&&N(/<[/\w!]/g,o.textContent)||o.nodeType===Fe.progressingInstruction||It&&o.nodeType===Fe.comment&&N(/<[/\w]/g,o.data))return be(o),!0;if(!(Le.tagCheck instanceof Function&&Le.tagCheck(a))&&(!E[a]||et[a])){if(!et[a]&&Xi(a)&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,a)||v.tagNameCheck instanceof Function&&v.tagNameCheck(a)))return!1;if(mo&&!Oe[a]){let b=R(o)||o.parentNode,L=Je(o)||o.childNodes;if(L&&b){let h=L.length;for(let ee=h-1;ee>=0;--ee){let G=vt(L[ee],!0);G.__removalCount=(o.__removalCount||0)+1,b.insertBefore(G,Ke(o))}}}return be(o),!0}return o instanceof x&&!pa(o)||(a==="noscript"||a==="noembed"||a==="noframes")&&N(/<\/no(script|embed|frames)/i,o.innerHTML)?(be(o),!0):(De&&o.nodeType===Fe.text&&(r=o.textContent,it([U,Ie,Me],b=>{r=Ve(r,b," ")}),o.textContent!==r&&(Be(t.removed,{element:o.cloneNode()}),o.textContent=r)),J(_.afterSanitizeElements,o,null),!1)},"_sanitizeElements"),Ji=f(function(o,r,a){if(Vi&&(r==="id"||r==="name")&&(a in i||a in ca))return!1;if(!(co&&!uo[r]&&N(At,r))&&!(Ni&&N(Et,r))&&!(Le.attributeCheck instanceof Function&&Le.attributeCheck(r,o))){if(!M[r]||uo[r]){if(!(Xi(o)&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,o)||v.tagNameCheck instanceof Function&&v.tagNameCheck(o))&&(v.attributeNameCheck instanceof RegExp&&N(v.attributeNameCheck,r)||v.attributeNameCheck instanceof Function&&v.attributeNameCheck(r,o))||r==="is"&&v.allowCustomizedBuiltInElements&&(v.tagNameCheck instanceof RegExp&&N(v.tagNameCheck,a)||v.tagNameCheck instanceof Function&&v.tagNameCheck(a))))return!1}else if(!go[r]&&!N(Ci,Ve(a,$e,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&o!=="script"&&ln(a,"data:")===0&&Ui[o])&&!(Pi&&!N(St,Ve(a,$e,"")))&&a)return!1}return!0},"_isValidAttribute"),Xi=f(function(o){return o!=="annotation-xml"&&zt(o,aa)},"_isBasicCustomElement"),$i=f(function(o){J(_.beforeSanitizeAttributes,o,null);let{attributes:r}=o;if(!r||ho(o))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},b=r.length;for(;b--;){let L=r[b],{name:h,namespaceURI:ee,value:G}=L,Q=S(h),To=G,D=h==="value"?To:sn(To);if(a.attrName=Q,a.attrValue=D,a.keepAttr=!0,a.forceKeepAttr=void 0,J(_.uponSanitizeAttribute,o,a),D=a.attrValue,zi&&(Q==="id"||Q==="name")&&(ye(h,o),D=ra+D),It&&N(/((--!?|])>)|<\/(style|title|textarea)/i,D)){ye(h,o);continue}if(Q==="attributename"&&zt(D,"href")){ye(h,o);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){ye(h,o);continue}if(!Bi&&N(/\/>/i,D)){ye(h,o);continue}De&&it([U,Ie,Me],ma=>{D=Ve(D,ma," ")});let en=S(o.nodeName);if(!Ji(en,Q,D)){ye(h,o);continue}if(A&&typeof me=="object"&&typeof me.getAttributeType=="function"&&!ee)switch(me.getAttributeType(en,Q)){case"TrustedHTML":{D=A.createHTML(D);break}case"TrustedScriptURL":{D=A.createScriptURL(D);break}}if(D!==To)try{ee?o.setAttributeNS(ee,h,D):o.setAttribute(h,D),ho(o)?be(o):wo(t.removed)}catch{ye(h,o)}}J(_.afterSanitizeAttributes,o,null)},"_sanitizeAttributes"),fa=f(function o(r){let a=null,b=Wi(r);for(J(_.beforeSanitizeShadowDOM,r,null);a=b.nextNode();)J(_.uponSanitizeShadowNode,a,null),Ki(a),$i(a),a.content instanceof u&&o(a.content);J(_.afterSanitizeShadowDOM,r,null)},"_sanitizeShadowDOM");return t.sanitize=function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,b=null,L=null,h=null;if(bo=!o,bo&&(o=""),typeof o!="string"&&!Zi(o))if(typeof o.toString=="function"){if(o=o.toString(),typeof o!="string")throw ze("dirty is not a string, aborting")}else throw ze("toString is not a function");if(!t.isSupported)return o;if(po||_o(r),t.removed=[],typeof o=="string"&&(tt=!1),tt){if(o.nodeName){let Q=S(o.nodeName);if(!E[Q]||et[Q])throw ze("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof w)a=ji(""),b=a.ownerDocument.importNode(o,!0),b.nodeType===Fe.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?a=b:a.appendChild(b);else{if(!Ce&&!De&&!ge&&o.indexOf("<")===-1)return A&&Lt?A.createHTML(o):o;if(a=ji(o),!a)return Ce?null:Lt?ae:""}a&&fo&&be(a.firstChild);let ee=Wi(tt?o:a);for(;L=ee.nextNode();)Ki(L),$i(L),L.content instanceof u&&fa(L.content);if(tt)return o;if(Ce){if(Mt)for(h=kt.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return(M.shadowroot||M.shadowrootmode)&&(h=X.call(n,h,!0)),h}let G=ge?a.outerHTML:a.innerHTML;return ge&&E["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&N(Do,a.ownerDocument.doctype.name)&&(G=""+G),De&&it([U,Ie,Me],Q=>{G=Ve(G,Q," ")}),A&&Lt?A.createHTML(G):G},t.setConfig=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_o(o),po=!0},t.clearConfig=function(){Pe=null,po=!1},t.isValidAttribute=function(o,r,a){Pe||_o({});let b=S(o),L=S(r);return Ji(b,L,a)},t.addHook=function(o,r){typeof r=="function"&&Be(_[o],r)},t.removeHook=function(o,r){if(r!==void 0){let a=rn(_[o],r);return a===-1?void 0:dn(_[o],a,1)[0]}return wo(_[o])},t.removeHooks=function(o){_[o]=[]},t.removeAllHooks=function(){_=Ro()},t}f(Gt,"createDOMPurify");var Oo=Gt();let Ue=!1;window.trustedTypes&&window.trustedTypes.createPolicy&&Oo&&(Ue=window.trustedTypes.createPolicy("GoodTubePolicy",{createHTML:e=>Oo.sanitize(e,{RETURN_TRUSTED_TYPE:!0})}));function No(){let e={};if(document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g,function(){function t(i){return decodeURIComponent(i.split("+").join(" "))}e[t(arguments[1])]=t(arguments[2])}),z()&&typeof e.v>"u"){let t="";window.location.href.indexOf("/watch/")!==-1?t="/watch/":t="/live/";let i=window.location.href.split(t);if(i.length===2){let n=i[1].split("?");e.v=n[n.length-1]}}return e}function p(e,t,i=399){e=e+"_new",document.cookie=e+"="+encodeURIComponent(t)+";SameSite=Lax;path=/;max-age="+i*24*60*60}function P(e){e=e+"_new";let t=document.cookie.split(";");for(let i=0;i{(function(){"use strict";var en=Object.defineProperty,f=(e,t)=>en(e,"name",{value:t,configurable:!0}),{entries:wo,setPrototypeOf:ko,isFrozen:tn,getPrototypeOf:on,getOwnPropertyDescriptor:nn}=Object,{freeze:N,seal:z,create:Bt}=Object,{apply:Vt,construct:zt}=typeof Reflect<"u"&&Reflect;N||(N=f(function(e){return e},"freeze")),z||(z=f(function(e){return e},"seal")),Vt||(Vt=f(function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),l=2;l1?t-1:0),n=1;n1?i-1:0),l=1;l2&&arguments[2]!==void 0?arguments[2]:tt;ko&&ko(e,null);let n=t.length;for(;n--;){let l=t[n];if(typeof l=="string"){let u=i(l);u!==l&&(tn(t)||(t[n]=u),l=u)}e[l]=!0}return e}f(c,"addToSet");function So(e){for(let t=0;t/gm),fn=z(/\$\{[\w\W]*/gm),mn=z(/^data-[\-\w.\u00B7-\uFFFF]+$/),gn=z(/^aria-[\-\w]+$/),Co=z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bn=z(/^(?:\w+script|data):/i),yn=z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ro=z(/^html$/i),_n=z(/^[a-z][.\w]*(-[.\w]+)+$/i),Oo=Object.freeze({__proto__:null,ARIA_ATTR:gn,ATTR_WHITESPACE:yn,CUSTOM_ELEMENT:_n,DATA_ATTR:mn,DOCTYPE_NAME:Ro,ERB_EXPR:pn,IS_ALLOWED_URI:Co,IS_SCRIPT_OR_DATA:bn,MUSTACHE_EXPR:cn,TMPLIT_EXPR:fn}),Ve={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},hn=f(function(){return typeof window>"u"?null:window},"getGlobal"),Tn=f(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));let l="dompurify"+(i?"#"+i:"");try{return e.createPolicy(l,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},"_createTrustedTypesPolicy"),No=f(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function jt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn(),t=f(o=>jt(o),"DOMPurify");if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Ve.document||!e.Element)return t.isSupported=!1,t;let{document:i}=e,n=i,l=n.currentScript,{DocumentFragment:u,HTMLTemplateElement:m,Node:w,Element:x,NodeFilter:k,NamedNodeMap:ie=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:pe,DOMParser:fe,trustedTypes:me}=e,ne=x.prototype,ht=_e(ne,"cloneNode"),Tt=_e(ne,"remove"),xt=_e(ne,"nextSibling"),vt=_e(ne,"childNodes"),ae=_e(ne,"parentNode");if(typeof m=="function"){let o=i.createElement("template");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let A,M="",{implementation:Se,createNodeIterator:wt,createDocumentFragment:kt,getElementsByTagName:We}=i,{importNode:At}=n,y=No();t.isSupported=typeof wo=="function"&&typeof ae=="function"&&Se&&Se.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Y,ERB_EXPR:G,TMPLIT_EXPR:H,DATA_ATTR:Et,ARIA_ATTR:St,IS_SCRIPT_OR_DATA:It,ATTR_WHITESPACE:Ze,CUSTOM_ELEMENT:Mt}=Oo,{IS_ALLOWED_URI:Ke}=Oo,E=null,Ci=c({},[...Io,...Ut,...Yt,...Gt,...Mo]),L=null,Ri=c({},[...Lo,...Qt,...Do,...ot]),v=Object.seal(Bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Je=null,po=null,Ie=Object.seal(Bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Oi=!0,fo=!0,Ni=!1,Pi=!0,Me=!1,Lt=!0,ge=!1,mo=!1,go=!1,Le=!1,Dt=!1,Ct=!1,Bi=!0,Vi=!1,na="user-content-",bo=!0,Xe=!1,De={},Ce=null,zi=c({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Fi=null,Hi=c({},["audio","video","img","source","image","track"]),yo=null,Ui=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rt="http://www.w3.org/1998/Math/MathML",Ot="http://www.w3.org/2000/svg",$="http://www.w3.org/1999/xhtml",Re=$,_o=!1,ho=null,aa=c({},[Rt,Ot,$],Ft),Nt=c({},["mi","mo","mn","ms","mtext"]),Pt=c({},["annotation-xml"]),ra=c({},["title","style","font","a","script"]),$e=null,da=["application/xhtml+xml","text/html"],la="text/html",S=null,Oe=null,sa=i.createElement("form"),Yi=f(function(o){return o instanceof RegExp||o instanceof Function},"isRegexOrFunction"),To=f(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Oe&&Oe===o)){if((!o||typeof o!="object")&&(o={}),o=q(o),$e=da.indexOf(o.PARSER_MEDIA_TYPE)===-1?la:o.PARSER_MEDIA_TYPE,S=$e==="application/xhtml+xml"?Ft:tt,E=U(o,"ALLOWED_TAGS")?c({},o.ALLOWED_TAGS,S):Ci,L=U(o,"ALLOWED_ATTR")?c({},o.ALLOWED_ATTR,S):Ri,ho=U(o,"ALLOWED_NAMESPACES")?c({},o.ALLOWED_NAMESPACES,Ft):aa,yo=U(o,"ADD_URI_SAFE_ATTR")?c(q(Ui),o.ADD_URI_SAFE_ATTR,S):Ui,Fi=U(o,"ADD_DATA_URI_TAGS")?c(q(Hi),o.ADD_DATA_URI_TAGS,S):Hi,Ce=U(o,"FORBID_CONTENTS")?c({},o.FORBID_CONTENTS,S):zi,Je=U(o,"FORBID_TAGS")?c({},o.FORBID_TAGS,S):q({}),po=U(o,"FORBID_ATTR")?c({},o.FORBID_ATTR,S):q({}),De=U(o,"USE_PROFILES")?o.USE_PROFILES:!1,Oi=o.ALLOW_ARIA_ATTR!==!1,fo=o.ALLOW_DATA_ATTR!==!1,Ni=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Pi=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=o.SAFE_FOR_TEMPLATES||!1,Lt=o.SAFE_FOR_XML!==!1,ge=o.WHOLE_DOCUMENT||!1,Le=o.RETURN_DOM||!1,Dt=o.RETURN_DOM_FRAGMENT||!1,Ct=o.RETURN_TRUSTED_TYPE||!1,go=o.FORCE_BODY||!1,Bi=o.SANITIZE_DOM!==!1,Vi=o.SANITIZE_NAMED_PROPS||!1,bo=o.KEEP_CONTENT!==!1,Xe=o.IN_PLACE||!1,Ke=o.ALLOWED_URI_REGEXP||Co,Re=o.NAMESPACE||$,Nt=o.MATHML_TEXT_INTEGRATION_POINTS||Nt,Pt=o.HTML_INTEGRATION_POINTS||Pt,v=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Yi(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(v.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Yi(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(v.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(v.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(fo=!1),Dt&&(Le=!0),De&&(E=c({},Mo),L=[],De.html===!0&&(c(E,Io),c(L,Lo)),De.svg===!0&&(c(E,Ut),c(L,Qt),c(L,ot)),De.svgFilters===!0&&(c(E,Yt),c(L,Qt),c(L,ot)),De.mathMl===!0&&(c(E,Gt),c(L,Do),c(L,ot))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?Ie.tagCheck=o.ADD_TAGS:(E===Ci&&(E=q(E)),c(E,o.ADD_TAGS,S))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?Ie.attributeCheck=o.ADD_ATTR:(L===Ri&&(L=q(L)),c(L,o.ADD_ATTR,S))),o.ADD_URI_SAFE_ATTR&&c(yo,o.ADD_URI_SAFE_ATTR,S),o.FORBID_CONTENTS&&(Ce===zi&&(Ce=q(Ce)),c(Ce,o.FORBID_CONTENTS,S)),bo&&(E["#text"]=!0),ge&&c(E,["html","head","body"]),E.table&&(c(E,["tbody"]),delete Je.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Be('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Be('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=o.TRUSTED_TYPES_POLICY,M=A.createHTML("")}else A===void 0&&(A=Tn(me,l)),A!==null&&typeof M=="string"&&(M=A.createHTML(""));N&&N(o),Oe=o}},"_parseConfig"),Gi=c({},[...Ut,...Yt,...sn]),Qi=c({},[...Gt,...un]),ua=f(function(o){let r=ae(o);(!r||!r.tagName)&&(r={namespaceURI:Re,tagName:"template"});let a=tt(o.tagName),b=tt(r.tagName);return ho[o.namespaceURI]?o.namespaceURI===Ot?r.namespaceURI===$?a==="svg":r.namespaceURI===Rt?a==="svg"&&(b==="annotation-xml"||Nt[b]):!!Gi[a]:o.namespaceURI===Rt?r.namespaceURI===$?a==="math":r.namespaceURI===Ot?a==="math"&&Pt[b]:!!Qi[a]:o.namespaceURI===$?r.namespaceURI===Ot&&!Pt[b]||r.namespaceURI===Rt&&!Nt[b]?!1:!Qi[a]&&(ra[a]||!Gi[a]):!!($e==="application/xhtml+xml"&&ho[o.namespaceURI]):!1},"_checkValidNamespace"),be=f(function(o){Ne(t.removed,{element:o});try{ae(o).removeChild(o)}catch{Tt(o)}},"_forceRemove"),ye=f(function(o,r){try{Ne(t.removed,{attribute:r.getAttributeNode(o),from:r})}catch{Ne(t.removed,{attribute:null,from:r})}if(r.removeAttribute(o),o==="is")if(Le||Dt)try{be(r)}catch{}else try{r.setAttribute(o,"")}catch{}},"_removeAttribute"),ji=f(function(o){let r=null,a=null;if(go)o=""+o;else{let h=Ht(o,/^[\r\n\t ]+/);a=h&&h[0]}$e==="application/xhtml+xml"&&Re===$&&(o=''+o+"");let b=A?A.createHTML(o):o;if(Re===$)try{r=new fe().parseFromString(b,$e)}catch{}if(!r||!r.documentElement){r=Se.createDocument(Re,"template",null);try{r.documentElement.innerHTML=_o?M:b}catch{}}let D=r.body||r.documentElement;return o&&a&&D.insertBefore(i.createTextNode(a),D.childNodes[0]||null),Re===$?We.call(r,ge?"html":"body")[0]:ge?r.documentElement:D},"_initDocument"),qi=f(function(o){return wt.call(o.ownerDocument||o,o,k.SHOW_ELEMENT|k.SHOW_COMMENT|k.SHOW_TEXT|k.SHOW_PROCESSING_INSTRUCTION|k.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),xo=f(function(o){return o instanceof pe&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof ie)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},"_isClobbered"),Wi=f(function(o){return typeof w=="function"&&o instanceof w},"_isNode");function X(o,r,a){et(o,b=>{b.call(t,r,a,Oe)})}f(X,"_executeHooks");let Zi=f(function(o){let r=null;if(X(y.beforeSanitizeElements,o,null),xo(o))return be(o),!0;let a=S(o.nodeName);if(X(y.uponSanitizeElement,o,{tagName:a,allowedTags:E}),Lt&&o.hasChildNodes()&&!Wi(o.firstElementChild)&&P(/<[/\w!]/g,o.innerHTML)&&P(/<[/\w!]/g,o.textContent)||o.nodeType===Ve.progressingInstruction||Lt&&o.nodeType===Ve.comment&&P(/<[/\w]/g,o.data))return be(o),!0;if(!(Ie.tagCheck instanceof Function&&Ie.tagCheck(a))&&(!E[a]||Je[a])){if(!Je[a]&&Ji(a)&&(v.tagNameCheck instanceof RegExp&&P(v.tagNameCheck,a)||v.tagNameCheck instanceof Function&&v.tagNameCheck(a)))return!1;if(bo&&!Ce[a]){let b=ae(o)||o.parentNode,D=vt(o)||o.childNodes;if(D&&b){let h=D.length;for(let ee=h-1;ee>=0;--ee){let Q=ht(D[ee],!0);Q.__removalCount=(o.__removalCount||0)+1,b.insertBefore(Q,xt(o))}}}return be(o),!0}return o instanceof x&&!ua(o)||(a==="noscript"||a==="noembed"||a==="noframes")&&P(/<\/no(script|embed|frames)/i,o.innerHTML)?(be(o),!0):(Me&&o.nodeType===Ve.text&&(r=o.textContent,et([Y,G,H],b=>{r=Pe(r,b," ")}),o.textContent!==r&&(Ne(t.removed,{element:o.cloneNode()}),o.textContent=r)),X(y.afterSanitizeElements,o,null),!1)},"_sanitizeElements"),Ki=f(function(o,r,a){if(Bi&&(r==="id"||r==="name")&&(a in i||a in sa))return!1;if(!(fo&&!po[r]&&P(Et,r))&&!(Oi&&P(St,r))&&!(Ie.attributeCheck instanceof Function&&Ie.attributeCheck(r,o))){if(!L[r]||po[r]){if(!(Ji(o)&&(v.tagNameCheck instanceof RegExp&&P(v.tagNameCheck,o)||v.tagNameCheck instanceof Function&&v.tagNameCheck(o))&&(v.attributeNameCheck instanceof RegExp&&P(v.attributeNameCheck,r)||v.attributeNameCheck instanceof Function&&v.attributeNameCheck(r,o))||r==="is"&&v.allowCustomizedBuiltInElements&&(v.tagNameCheck instanceof RegExp&&P(v.tagNameCheck,a)||v.tagNameCheck instanceof Function&&v.tagNameCheck(a))))return!1}else if(!yo[r]&&!P(Ke,Pe(a,Ze,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&o!=="script"&&dn(a,"data:")===0&&Fi[o])&&!(Ni&&!P(It,Pe(a,Ze,"")))&&a)return!1}return!0},"_isValidAttribute"),Ji=f(function(o){return o!=="annotation-xml"&&Ht(o,Mt)},"_isBasicCustomElement"),Xi=f(function(o){X(y.beforeSanitizeAttributes,o,null);let{attributes:r}=o;if(!r||xo(o))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},b=r.length;for(;b--;){let D=r[b],{name:h,namespaceURI:ee,value:Q}=D,j=S(h),vo=Q,C=h==="value"?vo:ln(vo);if(a.attrName=j,a.attrValue=C,a.keepAttr=!0,a.forceKeepAttr=void 0,X(y.uponSanitizeAttribute,o,a),C=a.attrValue,Vi&&(j==="id"||j==="name")&&(ye(h,o),C=na+C),Lt&&P(/((--!?|])>)|<\/(style|title|textarea)/i,C)){ye(h,o);continue}if(j==="attributename"&&Ht(C,"href")){ye(h,o);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){ye(h,o);continue}if(!Pi&&P(/\/>/i,C)){ye(h,o);continue}Me&&et([Y,G,H],pa=>{C=Pe(C,pa," ")});let $i=S(o.nodeName);if(!Ki($i,j,C)){ye(h,o);continue}if(A&&typeof me=="object"&&typeof me.getAttributeType=="function"&&!ee)switch(me.getAttributeType($i,j)){case"TrustedHTML":{C=A.createHTML(C);break}case"TrustedScriptURL":{C=A.createScriptURL(C);break}}if(C!==vo)try{ee?o.setAttributeNS(ee,h,C):o.setAttribute(h,C),xo(o)?be(o):Ao(t.removed)}catch{ye(h,o)}}X(y.afterSanitizeAttributes,o,null)},"_sanitizeAttributes"),ca=f(function o(r){let a=null,b=qi(r);for(X(y.beforeSanitizeShadowDOM,r,null);a=b.nextNode();)X(y.uponSanitizeShadowNode,a,null),Zi(a),Xi(a),a.content instanceof u&&o(a.content);X(y.afterSanitizeShadowDOM,r,null)},"_sanitizeShadowDOM");return t.sanitize=function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,b=null,D=null,h=null;if(_o=!o,_o&&(o=""),typeof o!="string"&&!Wi(o))if(typeof o.toString=="function"){if(o=o.toString(),typeof o!="string")throw Be("dirty is not a string, aborting")}else throw Be("toString is not a function");if(!t.isSupported)return o;if(mo||To(r),t.removed=[],typeof o=="string"&&(Xe=!1),Xe){if(o.nodeName){let j=S(o.nodeName);if(!E[j]||Je[j])throw Be("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof w)a=ji(""),b=a.ownerDocument.importNode(o,!0),b.nodeType===Ve.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?a=b:a.appendChild(b);else{if(!Le&&!Me&&!ge&&o.indexOf("<")===-1)return A&&Ct?A.createHTML(o):o;if(a=ji(o),!a)return Le?null:Ct?M:""}a&&go&&be(a.firstChild);let ee=qi(Xe?o:a);for(;D=ee.nextNode();)Zi(D),Xi(D),D.content instanceof u&&ca(D.content);if(Xe)return o;if(Le){if(Dt)for(h=kt.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return(L.shadowroot||L.shadowrootmode)&&(h=At.call(n,h,!0)),h}let Q=ge?a.outerHTML:a.innerHTML;return ge&&E["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&P(Ro,a.ownerDocument.doctype.name)&&(Q=""+Q),Me&&et([Y,G,H],j=>{Q=Pe(Q,j," ")}),A&&Ct?A.createHTML(Q):Q},t.setConfig=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};To(o),mo=!0},t.clearConfig=function(){Oe=null,mo=!1},t.isValidAttribute=function(o,r,a){Oe||To({});let b=S(o),D=S(r);return Ki(b,D,a)},t.addHook=function(o,r){typeof r=="function"&&Ne(y[o],r)},t.removeHook=function(o,r){if(r!==void 0){let a=an(y[o],r);return a===-1?void 0:rn(y[o],a,1)[0]}return Ao(y[o])},t.removeHooks=function(o){y[o]=[]},t.removeAllHooks=function(){y=No()},t}f(jt,"createDOMPurify");var Po=jt();let ze=!1;window.trustedTypes&&window.trustedTypes.createPolicy&&Po&&(ze=window.trustedTypes.createPolicy("GoodTubePolicy",{createHTML:e=>Po.sanitize(e,{RETURN_TRUSTED_TYPE:!0})}));function Bo(){let e={};if(document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g,function(){function t(i){return decodeURIComponent(i.split("+").join(" "))}e[t(arguments[1])]=t(arguments[2])}),F()&&typeof e.v>"u"){let t="";window.location.href.indexOf("/watch/")!==-1?t="/watch/":t="/live/";let i=window.location.href.split(t);if(i.length===2){let n=i[1].split("?");e.v=n[n.length-1]}}return e}function p(e,t,i=399){e=e+"_new",document.cookie=e+"="+encodeURIComponent(t)+";SameSite=Lax;path=/;max-age="+i*24*60*60}function B(e){e=e+"_new";let t=document.cookie.split(";");for(let i=0;i