diff --git a/goodtube.js b/goodtube.js index 9372c92..9afe0da 100644 --- a/goodtube.js +++ b/goodtube.js @@ -12,7 +12,7 @@ let goodTube_csp = false; if (window.trustedTypes && window.trustedTypes.createPolicy && DOMPurify) { goodTube_csp = window.trustedTypes.createPolicy("GoodTubePolicy", { - createHTML: (input) => DOMPurify.sanitize(input, { RETURN_TRUSTED_TYPE: false }) + createHTML: (input) => DOMPurify.sanitize(input, { RETURN_TRUSTED_TYPE: true }) }); } diff --git a/goodtube.min.js b/goodtube.min.js index 2f2150c..53a9d76 100644 --- a/goodtube.min.js +++ b/goodtube.min.js @@ -1,4 +1,4 @@ -(()=>{(function(){"use strict";var Gi=Object.defineProperty,f=(e,t)=>Gi(e,"name",{value:t,configurable:!0}),{entries:po,setPrototypeOf:fo,isFrozen:Qi,getPrototypeOf:ji,getOwnPropertyDescriptor:qi}=Object,{freeze:C,seal:z,create:kt}=Object,{apply:wt,construct:At}=typeof Reflect<"u"&&Reflect;C||(C=f(function(e){return e},"freeze")),z||(z=f(function(e){return e},"seal")),wt||(wt=f(function(e,t){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l1?t-1:0),a=1;a1?i-1:0),l=1;l2&&arguments[2]!==void 0?arguments[2]:Qe;fo&&fo(e,null);let a=t.length;for(;a--;){let l=t[a];if(typeof l=="string"){let u=i(l);u!==l&&(Qi(t)||(t[a]=u),l=u)}e[l]=!0}return e}f(c,"addToSet");function bo(e){for(let t=0;t/gm),oa=z(/\$\{[\w\W]*/gm),ia=z(/^data-[\-\w.\u00B7-\uFFFF]+$/),aa=z(/^aria-[\-\w]+$/),xo=z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),na=z(/^(?:\w+script|data):/i),ra=z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vo=z(/^html$/i),da=z(/^[a-z][.\w]*(-[.\w]+)+$/i),ko=Object.freeze({__proto__:null,ARIA_ATTR:aa,ATTR_WHITESPACE:ra,CUSTOM_ELEMENT:da,DATA_ATTR:ia,DOCTYPE_NAME:vo,ERB_EXPR:ta,IS_ALLOWED_URI:xo,IS_SCRIPT_OR_DATA:na,MUSTACHE_EXPR:ea,TMPLIT_EXPR:oa}),Re={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},la=f(function(){return typeof window>"u"?null:window},"getGlobal"),sa=f(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(i=t.getAttribute(a));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"),wo=f(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function Ct(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:la(),t=f(o=>Ct(o),"DOMPurify");if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Re.document||!e.Element)return t.isSupported=!1,t;let{document:i}=e,a=i,l=a.currentScript,{DocumentFragment:u,HTMLTemplateElement:m,Node:k,Element:T,NodeFilter:w,NamedNodeMap:te=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:Ve,DOMParser:P,trustedTypes:ue}=e,oe=T.prototype,ct=me(oe,"cloneNode"),Fe=me(oe,"remove"),pt=me(oe,"nextSibling"),U=me(oe,"childNodes"),H=me(oe,"parentNode");if(typeof m=="function"){let o=i.createElement("template");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let _,O="",{implementation:ve,createNodeIterator:ft,createDocumentFragment:mt,getElementsByTagName:gt}=i,{importNode:Wa}=a,N=wo();t.isSupported=typeof po=="function"&&typeof H=="function"&&ve&&ve.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Jt,ERB_EXPR:Xt,TMPLIT_EXPR:$t,DATA_ATTR:Za,ARIA_ATTR:Ka,IS_SCRIPT_OR_DATA:Ja,ATTR_WHITESPACE:Ti,CUSTOM_ELEMENT:Xa}=ko,{IS_ALLOWED_URI:xi}=ko,A=null,vi=c({},[...yo,...It,...Lt,...Dt,..._o]),I=null,ki=c({},[...ho,...Mt,...To,...je]),x=Object.seal(kt(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}})),Ue=null,eo=null,ke=Object.seal(kt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),wi=!0,to=!0,Ai=!1,Ei=!0,we=!1,bt=!0,ce=!1,oo=!1,io=!1,Ae=!1,yt=!1,_t=!1,Si=!0,Ii=!1,$a="user-content-",ao=!0,He=!1,Ee={},Se=null,Li=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"]),Di=null,Mi=c({},["audio","video","img","source","image","track"]),no=null,Ci=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ht="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",X="http://www.w3.org/1999/xhtml",Ie=X,ro=!1,lo=null,en=c({},[ht,Tt,X],Et),xt=c({},["mi","mo","mn","ms","mtext"]),vt=c({},["annotation-xml"]),tn=c({},["title","style","font","a","script"]),Ye=null,on=["application/xhtml+xml","text/html"],an="text/html",E=null,Le=null,nn=i.createElement("form"),Ri=f(function(o){return o instanceof RegExp||o instanceof Function},"isRegexOrFunction"),so=f(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Le&&Le===o)){if((!o||typeof o!="object")&&(o={}),o=j(o),Ye=on.indexOf(o.PARSER_MEDIA_TYPE)===-1?an:o.PARSER_MEDIA_TYPE,E=Ye==="application/xhtml+xml"?Et:Qe,A=Y(o,"ALLOWED_TAGS")?c({},o.ALLOWED_TAGS,E):vi,I=Y(o,"ALLOWED_ATTR")?c({},o.ALLOWED_ATTR,E):ki,lo=Y(o,"ALLOWED_NAMESPACES")?c({},o.ALLOWED_NAMESPACES,Et):en,no=Y(o,"ADD_URI_SAFE_ATTR")?c(j(Ci),o.ADD_URI_SAFE_ATTR,E):Ci,Di=Y(o,"ADD_DATA_URI_TAGS")?c(j(Mi),o.ADD_DATA_URI_TAGS,E):Mi,Se=Y(o,"FORBID_CONTENTS")?c({},o.FORBID_CONTENTS,E):Li,Ue=Y(o,"FORBID_TAGS")?c({},o.FORBID_TAGS,E):j({}),eo=Y(o,"FORBID_ATTR")?c({},o.FORBID_ATTR,E):j({}),Ee=Y(o,"USE_PROFILES")?o.USE_PROFILES:!1,wi=o.ALLOW_ARIA_ATTR!==!1,to=o.ALLOW_DATA_ATTR!==!1,Ai=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Ei=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=o.SAFE_FOR_TEMPLATES||!1,bt=o.SAFE_FOR_XML!==!1,ce=o.WHOLE_DOCUMENT||!1,Ae=o.RETURN_DOM||!1,yt=o.RETURN_DOM_FRAGMENT||!1,_t=o.RETURN_TRUSTED_TYPE||!1,io=o.FORCE_BODY||!1,Si=o.SANITIZE_DOM!==!1,Ii=o.SANITIZE_NAMED_PROPS||!1,ao=o.KEEP_CONTENT!==!1,He=o.IN_PLACE||!1,xi=o.ALLOWED_URI_REGEXP||xo,Ie=o.NAMESPACE||X,xt=o.MATHML_TEXT_INTEGRATION_POINTS||xt,vt=o.HTML_INTEGRATION_POINTS||vt,x=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Ri(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(x.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Ri(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(x.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(x.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),we&&(to=!1),yt&&(Ae=!0),Ee&&(A=c({},_o),I=[],Ee.html===!0&&(c(A,yo),c(I,ho)),Ee.svg===!0&&(c(A,It),c(I,Mt),c(I,je)),Ee.svgFilters===!0&&(c(A,Lt),c(I,Mt),c(I,je)),Ee.mathMl===!0&&(c(A,Dt),c(I,To),c(I,je))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?ke.tagCheck=o.ADD_TAGS:(A===vi&&(A=j(A)),c(A,o.ADD_TAGS,E))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?ke.attributeCheck=o.ADD_ATTR:(I===ki&&(I=j(I)),c(I,o.ADD_ATTR,E))),o.ADD_URI_SAFE_ATTR&&c(no,o.ADD_URI_SAFE_ATTR,E),o.FORBID_CONTENTS&&(Se===Li&&(Se=j(Se)),c(Se,o.FORBID_CONTENTS,E)),ao&&(A["#text"]=!0),ce&&c(A,["html","head","body"]),A.table&&(c(A,["tbody"]),delete Ue.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ce('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ce('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=o.TRUSTED_TYPES_POLICY,O=_.createHTML("")}else _===void 0&&(_=sa(ue,l)),_!==null&&typeof O=="string"&&(O=_.createHTML(""));C&&C(o),Le=o}},"_parseConfig"),Ni=c({},[...It,...Lt,...Xi]),Oi=c({},[...Dt,...$i]),rn=f(function(o){let r=H(o);(!r||!r.tagName)&&(r={namespaceURI:Ie,tagName:"template"});let n=Qe(o.tagName),b=Qe(r.tagName);return lo[o.namespaceURI]?o.namespaceURI===Tt?r.namespaceURI===X?n==="svg":r.namespaceURI===ht?n==="svg"&&(b==="annotation-xml"||xt[b]):!!Ni[n]:o.namespaceURI===ht?r.namespaceURI===X?n==="math":r.namespaceURI===Tt?n==="math"&&vt[b]:!!Oi[n]:o.namespaceURI===X?r.namespaceURI===Tt&&!vt[b]||r.namespaceURI===ht&&!xt[b]?!1:!Oi[n]&&(tn[n]||!Ni[n]):!!(Ye==="application/xhtml+xml"&&lo[o.namespaceURI]):!1},"_checkValidNamespace"),pe=f(function(o){De(t.removed,{element:o});try{H(o).removeChild(o)}catch{Fe(o)}},"_forceRemove"),fe=f(function(o,r){try{De(t.removed,{attribute:r.getAttributeNode(o),from:r})}catch{De(t.removed,{attribute:null,from:r})}if(r.removeAttribute(o),o==="is")if(Ae||yt)try{pe(r)}catch{}else try{r.setAttribute(o,"")}catch{}},"_removeAttribute"),Bi=f(function(o){let r=null,n=null;if(io)o=""+o;else{let h=St(o,/^[\r\n\t ]+/);n=h&&h[0]}Ye==="application/xhtml+xml"&&Ie===X&&(o=''+o+"");let b=_?_.createHTML(o):o;if(Ie===X)try{r=new P().parseFromString(b,Ye)}catch{}if(!r||!r.documentElement){r=ve.createDocument(Ie,"template",null);try{r.documentElement.innerHTML=ro?O:b}catch{}}let L=r.body||r.documentElement;return o&&n&&L.insertBefore(i.createTextNode(n),L.childNodes[0]||null),Ie===X?gt.call(r,ce?"html":"body")[0]:ce?r.documentElement:L},"_initDocument"),Pi=f(function(o){return ft.call(o.ownerDocument||o,o,w.SHOW_ELEMENT|w.SHOW_COMMENT|w.SHOW_TEXT|w.SHOW_PROCESSING_INSTRUCTION|w.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),uo=f(function(o){return o instanceof Ve&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof te)||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 k=="function"&&o instanceof k},"_isNode");function K(o,r,n){Ge(o,b=>{b.call(t,r,n,Le)})}f(K,"_executeHooks");let Vi=f(function(o){let r=null;if(K(N.beforeSanitizeElements,o,null),uo(o))return pe(o),!0;let n=E(o.nodeName);if(K(N.uponSanitizeElement,o,{tagName:n,allowedTags:A}),bt&&o.hasChildNodes()&&!zi(o.firstElementChild)&&R(/<[/\w!]/g,o.innerHTML)&&R(/<[/\w!]/g,o.textContent)||o.nodeType===Re.progressingInstruction||bt&&o.nodeType===Re.comment&&R(/<[/\w]/g,o.data))return pe(o),!0;if(!(ke.tagCheck instanceof Function&&ke.tagCheck(n))&&(!A[n]||Ue[n])){if(!Ue[n]&&Ui(n)&&(x.tagNameCheck instanceof RegExp&&R(x.tagNameCheck,n)||x.tagNameCheck instanceof Function&&x.tagNameCheck(n)))return!1;if(ao&&!Se[n]){let b=H(o)||o.parentNode,L=U(o)||o.childNodes;if(L&&b){let h=L.length;for(let $=h-1;$>=0;--$){let G=ct(L[$],!0);G.__removalCount=(o.__removalCount||0)+1,b.insertBefore(G,pt(o))}}}return pe(o),!0}return o instanceof T&&!rn(o)||(n==="noscript"||n==="noembed"||n==="noframes")&&R(/<\/no(script|embed|frames)/i,o.innerHTML)?(pe(o),!0):(we&&o.nodeType===Re.text&&(r=o.textContent,Ge([Jt,Xt,$t],b=>{r=Me(r,b," ")}),o.textContent!==r&&(De(t.removed,{element:o.cloneNode()}),o.textContent=r)),K(N.afterSanitizeElements,o,null),!1)},"_sanitizeElements"),Fi=f(function(o,r,n){if(Si&&(r==="id"||r==="name")&&(n in i||n in nn))return!1;if(!(to&&!eo[r]&&R(Za,r))&&!(wi&&R(Ka,r))&&!(ke.attributeCheck instanceof Function&&ke.attributeCheck(r,o))){if(!I[r]||eo[r]){if(!(Ui(o)&&(x.tagNameCheck instanceof RegExp&&R(x.tagNameCheck,o)||x.tagNameCheck instanceof Function&&x.tagNameCheck(o))&&(x.attributeNameCheck instanceof RegExp&&R(x.attributeNameCheck,r)||x.attributeNameCheck instanceof Function&&x.attributeNameCheck(r,o))||r==="is"&&x.allowCustomizedBuiltInElements&&(x.tagNameCheck instanceof RegExp&&R(x.tagNameCheck,n)||x.tagNameCheck instanceof Function&&x.tagNameCheck(n))))return!1}else if(!no[r]&&!R(xi,Me(n,Ti,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&o!=="script"&&Ki(n,"data:")===0&&Di[o])&&!(Ai&&!R(Ja,Me(n,Ti,"")))&&n)return!1}return!0},"_isValidAttribute"),Ui=f(function(o){return o!=="annotation-xml"&&St(o,Xa)},"_isBasicCustomElement"),Hi=f(function(o){K(N.beforeSanitizeAttributes,o,null);let{attributes:r}=o;if(!r||uo(o))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},b=r.length;for(;b--;){let L=r[b],{name:h,namespaceURI:$,value:G}=L,Q=E(h),co=G,D=h==="value"?co:Ji(co);if(n.attrName=Q,n.attrValue=D,n.keepAttr=!0,n.forceKeepAttr=void 0,K(N.uponSanitizeAttribute,o,n),D=n.attrValue,Ii&&(Q==="id"||Q==="name")&&(fe(h,o),D=$a+D),bt&&R(/((--!?|])>)|<\/(style|title|textarea)/i,D)){fe(h,o);continue}if(Q==="attributename"&&St(D,"href")){fe(h,o);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){fe(h,o);continue}if(!Ei&&R(/\/>/i,D)){fe(h,o);continue}we&&Ge([Jt,Xt,$t],ln=>{D=Me(D,ln," ")});let Yi=E(o.nodeName);if(!Fi(Yi,Q,D)){fe(h,o);continue}if(_&&typeof ue=="object"&&typeof ue.getAttributeType=="function"&&!$)switch(ue.getAttributeType(Yi,Q)){case"TrustedHTML":{D=_.createHTML(D);break}case"TrustedScriptURL":{D=_.createScriptURL(D);break}}if(D!==co)try{$?o.setAttributeNS($,h,D):o.setAttribute(h,D),uo(o)?pe(o):mo(t.removed)}catch{fe(h,o)}}K(N.afterSanitizeAttributes,o,null)},"_sanitizeAttributes"),dn=f(function o(r){let n=null,b=Pi(r);for(K(N.beforeSanitizeShadowDOM,r,null);n=b.nextNode();)K(N.uponSanitizeShadowNode,n,null),Vi(n),Hi(n),n.content instanceof u&&o(n.content);K(N.afterSanitizeShadowDOM,r,null)},"_sanitizeShadowDOM");return t.sanitize=function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,b=null,L=null,h=null;if(ro=!o,ro&&(o=""),typeof o!="string"&&!zi(o))if(typeof o.toString=="function"){if(o=o.toString(),typeof o!="string")throw Ce("dirty is not a string, aborting")}else throw Ce("toString is not a function");if(!t.isSupported)return o;if(oo||so(r),t.removed=[],typeof o=="string"&&(He=!1),He){if(o.nodeName){let Q=E(o.nodeName);if(!A[Q]||Ue[Q])throw Ce("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof k)n=Bi(""),b=n.ownerDocument.importNode(o,!0),b.nodeType===Re.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?n=b:n.appendChild(b);else{if(!Ae&&!we&&!ce&&o.indexOf("<")===-1)return _&&_t?_.createHTML(o):o;if(n=Bi(o),!n)return Ae?null:_t?O:""}n&&io&&pe(n.firstChild);let $=Pi(He?o:n);for(;L=$.nextNode();)Vi(L),Hi(L),L.content instanceof u&&dn(L.content);if(He)return o;if(Ae){if(yt)for(h=mt.call(n.ownerDocument);n.firstChild;)h.appendChild(n.firstChild);else h=n;return(I.shadowroot||I.shadowrootmode)&&(h=Wa.call(a,h,!0)),h}let G=ce?n.outerHTML:n.innerHTML;return ce&&A["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&R(vo,n.ownerDocument.doctype.name)&&(G=""+G),we&&Ge([Jt,Xt,$t],Q=>{G=Me(G,Q," ")}),_&&_t?_.createHTML(G):G},t.setConfig=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};so(o),oo=!0},t.clearConfig=function(){Le=null,oo=!1},t.isValidAttribute=function(o,r,n){Le||so({});let b=E(o),L=E(r);return Fi(b,L,n)},t.addHook=function(o,r){typeof r=="function"&&De(N[o],r)},t.removeHook=function(o,r){if(r!==void 0){let n=Wi(N[o],r);return n===-1?void 0:Zi(N[o],n,1)[0]}return mo(N[o])},t.removeHooks=function(o){N[o]=[]},t.removeAllHooks=function(){N=wo()},t}f(Ct,"createDOMPurify");var Ao=Ct();let Ne=!1;window.trustedTypes&&window.trustedTypes.createPolicy&&Ao&&(Ne=window.trustedTypes.createPolicy("GoodTubePolicy",{createHTML:e=>Ao.sanitize(e,{RETURN_TRUSTED_TYPE:!1})}));function Eo(){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 a=i[1].split("?");e.v=a[a.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 V(e){e=e+"_new";let t=document.cookie.split(";");for(let i=0;i{(function(){"use strict";var Gi=Object.defineProperty,f=(e,t)=>Gi(e,"name",{value:t,configurable:!0}),{entries:po,setPrototypeOf:fo,isFrozen:Qi,getPrototypeOf:ji,getOwnPropertyDescriptor:qi}=Object,{freeze:C,seal:z,create:kt}=Object,{apply:wt,construct:At}=typeof Reflect<"u"&&Reflect;C||(C=f(function(e){return e},"freeze")),z||(z=f(function(e){return e},"seal")),wt||(wt=f(function(e,t){for(var i=arguments.length,a=new Array(i>2?i-2:0),l=2;l1?t-1:0),a=1;a1?i-1:0),l=1;l2&&arguments[2]!==void 0?arguments[2]:Qe;fo&&fo(e,null);let a=t.length;for(;a--;){let l=t[a];if(typeof l=="string"){let u=i(l);u!==l&&(Qi(t)||(t[a]=u),l=u)}e[l]=!0}return e}f(c,"addToSet");function bo(e){for(let t=0;t/gm),oa=z(/\$\{[\w\W]*/gm),ia=z(/^data-[\-\w.\u00B7-\uFFFF]+$/),aa=z(/^aria-[\-\w]+$/),xo=z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),na=z(/^(?:\w+script|data):/i),ra=z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vo=z(/^html$/i),da=z(/^[a-z][.\w]*(-[.\w]+)+$/i),ko=Object.freeze({__proto__:null,ARIA_ATTR:aa,ATTR_WHITESPACE:ra,CUSTOM_ELEMENT:da,DATA_ATTR:ia,DOCTYPE_NAME:vo,ERB_EXPR:ta,IS_ALLOWED_URI:xo,IS_SCRIPT_OR_DATA:na,MUSTACHE_EXPR:ea,TMPLIT_EXPR:oa}),Re={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},la=f(function(){return typeof window>"u"?null:window},"getGlobal"),sa=f(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(i=t.getAttribute(a));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"),wo=f(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function Ct(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:la(),t=f(o=>Ct(o),"DOMPurify");if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Re.document||!e.Element)return t.isSupported=!1,t;let{document:i}=e,a=i,l=a.currentScript,{DocumentFragment:u,HTMLTemplateElement:m,Node:k,Element:T,NodeFilter:w,NamedNodeMap:te=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:Ve,DOMParser:P,trustedTypes:ue}=e,oe=T.prototype,ct=me(oe,"cloneNode"),Fe=me(oe,"remove"),pt=me(oe,"nextSibling"),U=me(oe,"childNodes"),H=me(oe,"parentNode");if(typeof m=="function"){let o=i.createElement("template");o.content&&o.content.ownerDocument&&(i=o.content.ownerDocument)}let _,O="",{implementation:ve,createNodeIterator:ft,createDocumentFragment:mt,getElementsByTagName:gt}=i,{importNode:Wa}=a,N=wo();t.isSupported=typeof po=="function"&&typeof H=="function"&&ve&&ve.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Jt,ERB_EXPR:Xt,TMPLIT_EXPR:$t,DATA_ATTR:Za,ARIA_ATTR:Ka,IS_SCRIPT_OR_DATA:Ja,ATTR_WHITESPACE:Ti,CUSTOM_ELEMENT:Xa}=ko,{IS_ALLOWED_URI:xi}=ko,A=null,vi=c({},[...yo,...It,...Lt,...Dt,..._o]),I=null,ki=c({},[...ho,...Mt,...To,...je]),x=Object.seal(kt(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}})),Ue=null,eo=null,ke=Object.seal(kt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),wi=!0,to=!0,Ai=!1,Ei=!0,we=!1,bt=!0,ce=!1,oo=!1,io=!1,Ae=!1,yt=!1,_t=!1,Si=!0,Ii=!1,$a="user-content-",ao=!0,He=!1,Ee={},Se=null,Li=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"]),Di=null,Mi=c({},["audio","video","img","source","image","track"]),no=null,Ci=c({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ht="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",X="http://www.w3.org/1999/xhtml",Ie=X,ro=!1,lo=null,en=c({},[ht,Tt,X],Et),xt=c({},["mi","mo","mn","ms","mtext"]),vt=c({},["annotation-xml"]),tn=c({},["title","style","font","a","script"]),Ye=null,on=["application/xhtml+xml","text/html"],an="text/html",E=null,Le=null,nn=i.createElement("form"),Ri=f(function(o){return o instanceof RegExp||o instanceof Function},"isRegexOrFunction"),so=f(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Le&&Le===o)){if((!o||typeof o!="object")&&(o={}),o=j(o),Ye=on.indexOf(o.PARSER_MEDIA_TYPE)===-1?an:o.PARSER_MEDIA_TYPE,E=Ye==="application/xhtml+xml"?Et:Qe,A=Y(o,"ALLOWED_TAGS")?c({},o.ALLOWED_TAGS,E):vi,I=Y(o,"ALLOWED_ATTR")?c({},o.ALLOWED_ATTR,E):ki,lo=Y(o,"ALLOWED_NAMESPACES")?c({},o.ALLOWED_NAMESPACES,Et):en,no=Y(o,"ADD_URI_SAFE_ATTR")?c(j(Ci),o.ADD_URI_SAFE_ATTR,E):Ci,Di=Y(o,"ADD_DATA_URI_TAGS")?c(j(Mi),o.ADD_DATA_URI_TAGS,E):Mi,Se=Y(o,"FORBID_CONTENTS")?c({},o.FORBID_CONTENTS,E):Li,Ue=Y(o,"FORBID_TAGS")?c({},o.FORBID_TAGS,E):j({}),eo=Y(o,"FORBID_ATTR")?c({},o.FORBID_ATTR,E):j({}),Ee=Y(o,"USE_PROFILES")?o.USE_PROFILES:!1,wi=o.ALLOW_ARIA_ATTR!==!1,to=o.ALLOW_DATA_ATTR!==!1,Ai=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Ei=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=o.SAFE_FOR_TEMPLATES||!1,bt=o.SAFE_FOR_XML!==!1,ce=o.WHOLE_DOCUMENT||!1,Ae=o.RETURN_DOM||!1,yt=o.RETURN_DOM_FRAGMENT||!1,_t=o.RETURN_TRUSTED_TYPE||!1,io=o.FORCE_BODY||!1,Si=o.SANITIZE_DOM!==!1,Ii=o.SANITIZE_NAMED_PROPS||!1,ao=o.KEEP_CONTENT!==!1,He=o.IN_PLACE||!1,xi=o.ALLOWED_URI_REGEXP||xo,Ie=o.NAMESPACE||X,xt=o.MATHML_TEXT_INTEGRATION_POINTS||xt,vt=o.HTML_INTEGRATION_POINTS||vt,x=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Ri(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(x.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Ri(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(x.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(x.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),we&&(to=!1),yt&&(Ae=!0),Ee&&(A=c({},_o),I=[],Ee.html===!0&&(c(A,yo),c(I,ho)),Ee.svg===!0&&(c(A,It),c(I,Mt),c(I,je)),Ee.svgFilters===!0&&(c(A,Lt),c(I,Mt),c(I,je)),Ee.mathMl===!0&&(c(A,Dt),c(I,To),c(I,je))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?ke.tagCheck=o.ADD_TAGS:(A===vi&&(A=j(A)),c(A,o.ADD_TAGS,E))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?ke.attributeCheck=o.ADD_ATTR:(I===ki&&(I=j(I)),c(I,o.ADD_ATTR,E))),o.ADD_URI_SAFE_ATTR&&c(no,o.ADD_URI_SAFE_ATTR,E),o.FORBID_CONTENTS&&(Se===Li&&(Se=j(Se)),c(Se,o.FORBID_CONTENTS,E)),ao&&(A["#text"]=!0),ce&&c(A,["html","head","body"]),A.table&&(c(A,["tbody"]),delete Ue.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ce('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ce('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=o.TRUSTED_TYPES_POLICY,O=_.createHTML("")}else _===void 0&&(_=sa(ue,l)),_!==null&&typeof O=="string"&&(O=_.createHTML(""));C&&C(o),Le=o}},"_parseConfig"),Ni=c({},[...It,...Lt,...Xi]),Oi=c({},[...Dt,...$i]),rn=f(function(o){let r=H(o);(!r||!r.tagName)&&(r={namespaceURI:Ie,tagName:"template"});let n=Qe(o.tagName),b=Qe(r.tagName);return lo[o.namespaceURI]?o.namespaceURI===Tt?r.namespaceURI===X?n==="svg":r.namespaceURI===ht?n==="svg"&&(b==="annotation-xml"||xt[b]):!!Ni[n]:o.namespaceURI===ht?r.namespaceURI===X?n==="math":r.namespaceURI===Tt?n==="math"&&vt[b]:!!Oi[n]:o.namespaceURI===X?r.namespaceURI===Tt&&!vt[b]||r.namespaceURI===ht&&!xt[b]?!1:!Oi[n]&&(tn[n]||!Ni[n]):!!(Ye==="application/xhtml+xml"&&lo[o.namespaceURI]):!1},"_checkValidNamespace"),pe=f(function(o){De(t.removed,{element:o});try{H(o).removeChild(o)}catch{Fe(o)}},"_forceRemove"),fe=f(function(o,r){try{De(t.removed,{attribute:r.getAttributeNode(o),from:r})}catch{De(t.removed,{attribute:null,from:r})}if(r.removeAttribute(o),o==="is")if(Ae||yt)try{pe(r)}catch{}else try{r.setAttribute(o,"")}catch{}},"_removeAttribute"),Bi=f(function(o){let r=null,n=null;if(io)o=""+o;else{let h=St(o,/^[\r\n\t ]+/);n=h&&h[0]}Ye==="application/xhtml+xml"&&Ie===X&&(o=''+o+"");let b=_?_.createHTML(o):o;if(Ie===X)try{r=new P().parseFromString(b,Ye)}catch{}if(!r||!r.documentElement){r=ve.createDocument(Ie,"template",null);try{r.documentElement.innerHTML=ro?O:b}catch{}}let L=r.body||r.documentElement;return o&&n&&L.insertBefore(i.createTextNode(n),L.childNodes[0]||null),Ie===X?gt.call(r,ce?"html":"body")[0]:ce?r.documentElement:L},"_initDocument"),Pi=f(function(o){return ft.call(o.ownerDocument||o,o,w.SHOW_ELEMENT|w.SHOW_COMMENT|w.SHOW_TEXT|w.SHOW_PROCESSING_INSTRUCTION|w.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),uo=f(function(o){return o instanceof Ve&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof te)||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 k=="function"&&o instanceof k},"_isNode");function K(o,r,n){Ge(o,b=>{b.call(t,r,n,Le)})}f(K,"_executeHooks");let Vi=f(function(o){let r=null;if(K(N.beforeSanitizeElements,o,null),uo(o))return pe(o),!0;let n=E(o.nodeName);if(K(N.uponSanitizeElement,o,{tagName:n,allowedTags:A}),bt&&o.hasChildNodes()&&!zi(o.firstElementChild)&&R(/<[/\w!]/g,o.innerHTML)&&R(/<[/\w!]/g,o.textContent)||o.nodeType===Re.progressingInstruction||bt&&o.nodeType===Re.comment&&R(/<[/\w]/g,o.data))return pe(o),!0;if(!(ke.tagCheck instanceof Function&&ke.tagCheck(n))&&(!A[n]||Ue[n])){if(!Ue[n]&&Ui(n)&&(x.tagNameCheck instanceof RegExp&&R(x.tagNameCheck,n)||x.tagNameCheck instanceof Function&&x.tagNameCheck(n)))return!1;if(ao&&!Se[n]){let b=H(o)||o.parentNode,L=U(o)||o.childNodes;if(L&&b){let h=L.length;for(let $=h-1;$>=0;--$){let G=ct(L[$],!0);G.__removalCount=(o.__removalCount||0)+1,b.insertBefore(G,pt(o))}}}return pe(o),!0}return o instanceof T&&!rn(o)||(n==="noscript"||n==="noembed"||n==="noframes")&&R(/<\/no(script|embed|frames)/i,o.innerHTML)?(pe(o),!0):(we&&o.nodeType===Re.text&&(r=o.textContent,Ge([Jt,Xt,$t],b=>{r=Me(r,b," ")}),o.textContent!==r&&(De(t.removed,{element:o.cloneNode()}),o.textContent=r)),K(N.afterSanitizeElements,o,null),!1)},"_sanitizeElements"),Fi=f(function(o,r,n){if(Si&&(r==="id"||r==="name")&&(n in i||n in nn))return!1;if(!(to&&!eo[r]&&R(Za,r))&&!(wi&&R(Ka,r))&&!(ke.attributeCheck instanceof Function&&ke.attributeCheck(r,o))){if(!I[r]||eo[r]){if(!(Ui(o)&&(x.tagNameCheck instanceof RegExp&&R(x.tagNameCheck,o)||x.tagNameCheck instanceof Function&&x.tagNameCheck(o))&&(x.attributeNameCheck instanceof RegExp&&R(x.attributeNameCheck,r)||x.attributeNameCheck instanceof Function&&x.attributeNameCheck(r,o))||r==="is"&&x.allowCustomizedBuiltInElements&&(x.tagNameCheck instanceof RegExp&&R(x.tagNameCheck,n)||x.tagNameCheck instanceof Function&&x.tagNameCheck(n))))return!1}else if(!no[r]&&!R(xi,Me(n,Ti,""))&&!((r==="src"||r==="xlink:href"||r==="href")&&o!=="script"&&Ki(n,"data:")===0&&Di[o])&&!(Ai&&!R(Ja,Me(n,Ti,"")))&&n)return!1}return!0},"_isValidAttribute"),Ui=f(function(o){return o!=="annotation-xml"&&St(o,Xa)},"_isBasicCustomElement"),Hi=f(function(o){K(N.beforeSanitizeAttributes,o,null);let{attributes:r}=o;if(!r||uo(o))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},b=r.length;for(;b--;){let L=r[b],{name:h,namespaceURI:$,value:G}=L,Q=E(h),co=G,D=h==="value"?co:Ji(co);if(n.attrName=Q,n.attrValue=D,n.keepAttr=!0,n.forceKeepAttr=void 0,K(N.uponSanitizeAttribute,o,n),D=n.attrValue,Ii&&(Q==="id"||Q==="name")&&(fe(h,o),D=$a+D),bt&&R(/((--!?|])>)|<\/(style|title|textarea)/i,D)){fe(h,o);continue}if(Q==="attributename"&&St(D,"href")){fe(h,o);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){fe(h,o);continue}if(!Ei&&R(/\/>/i,D)){fe(h,o);continue}we&&Ge([Jt,Xt,$t],ln=>{D=Me(D,ln," ")});let Yi=E(o.nodeName);if(!Fi(Yi,Q,D)){fe(h,o);continue}if(_&&typeof ue=="object"&&typeof ue.getAttributeType=="function"&&!$)switch(ue.getAttributeType(Yi,Q)){case"TrustedHTML":{D=_.createHTML(D);break}case"TrustedScriptURL":{D=_.createScriptURL(D);break}}if(D!==co)try{$?o.setAttributeNS($,h,D):o.setAttribute(h,D),uo(o)?pe(o):mo(t.removed)}catch{fe(h,o)}}K(N.afterSanitizeAttributes,o,null)},"_sanitizeAttributes"),dn=f(function o(r){let n=null,b=Pi(r);for(K(N.beforeSanitizeShadowDOM,r,null);n=b.nextNode();)K(N.uponSanitizeShadowNode,n,null),Vi(n),Hi(n),n.content instanceof u&&o(n.content);K(N.afterSanitizeShadowDOM,r,null)},"_sanitizeShadowDOM");return t.sanitize=function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,b=null,L=null,h=null;if(ro=!o,ro&&(o=""),typeof o!="string"&&!zi(o))if(typeof o.toString=="function"){if(o=o.toString(),typeof o!="string")throw Ce("dirty is not a string, aborting")}else throw Ce("toString is not a function");if(!t.isSupported)return o;if(oo||so(r),t.removed=[],typeof o=="string"&&(He=!1),He){if(o.nodeName){let Q=E(o.nodeName);if(!A[Q]||Ue[Q])throw Ce("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof k)n=Bi(""),b=n.ownerDocument.importNode(o,!0),b.nodeType===Re.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?n=b:n.appendChild(b);else{if(!Ae&&!we&&!ce&&o.indexOf("<")===-1)return _&&_t?_.createHTML(o):o;if(n=Bi(o),!n)return Ae?null:_t?O:""}n&&io&&pe(n.firstChild);let $=Pi(He?o:n);for(;L=$.nextNode();)Vi(L),Hi(L),L.content instanceof u&&dn(L.content);if(He)return o;if(Ae){if(yt)for(h=mt.call(n.ownerDocument);n.firstChild;)h.appendChild(n.firstChild);else h=n;return(I.shadowroot||I.shadowrootmode)&&(h=Wa.call(a,h,!0)),h}let G=ce?n.outerHTML:n.innerHTML;return ce&&A["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&R(vo,n.ownerDocument.doctype.name)&&(G=""+G),we&&Ge([Jt,Xt,$t],Q=>{G=Me(G,Q," ")}),_&&_t?_.createHTML(G):G},t.setConfig=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};so(o),oo=!0},t.clearConfig=function(){Le=null,oo=!1},t.isValidAttribute=function(o,r,n){Le||so({});let b=E(o),L=E(r);return Fi(b,L,n)},t.addHook=function(o,r){typeof r=="function"&&De(N[o],r)},t.removeHook=function(o,r){if(r!==void 0){let n=Wi(N[o],r);return n===-1?void 0:Zi(N[o],n,1)[0]}return mo(N[o])},t.removeHooks=function(o){N[o]=[]},t.removeAllHooks=function(){N=wo()},t}f(Ct,"createDOMPurify");var Ao=Ct();let Ne=!1;window.trustedTypes&&window.trustedTypes.createPolicy&&Ao&&(Ne=window.trustedTypes.createPolicy("GoodTubePolicy",{createHTML:e=>Ao.sanitize(e,{RETURN_TRUSTED_TYPE:!0})}));function Eo(){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 a=i[1].split("?");e.v=a[a.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 V(e){e=e+"_new";let t=document.cookie.split(";");for(let i=0;i