// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0 (()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return t};var t={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),l=new L(n||[]);return i(a,"_invoke",{value:E(t,r,l)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var v={};function h(){}function p(){}function y(){}var m={};s(m,l,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(O([])));b&&b!==e&&o.call(b,l)&&(m=b);var w=y.prototype=h.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(i,a,l,c){var u=d(t[i],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==r(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,l,c)}),(function(t){n("throw",t,l,c)})):e.resolve(f).then((function(t){s.value=t,l(s)}),(function(t){return n("throw",t,l,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return a=a?a.then(o,o):o()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return I()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var l=S(a,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=d(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function O(t){if(t){var e=t[l];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),v}},t}function o(t,e,r,n,o,i,a){try{var l=t[i](a),c=l.value}catch(t){return void r(t)}l.done?e(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function l(t){o(a,n,i,l,c,"next",t)}function c(t){o(a,n,i,l,c,"throw",t)}l(void 0)}))}}function a(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw i}}}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rf});var u=!1,s={prefix:"/web"};function f(t){var e;u?console.log("already initialized"):(u=!0,"string"==typeof t?s={prefix:t}:Object.assign(s,t),(e=v)(),setInterval(e,d))}var d=1e3;function v(){var t=y.length;!function(){var t=document.location.href.match(/\/embed\/([-_a-zA-Z0-9]{11})/);if(t)console.log("this is a embed for %s",t[1]),g("#player",(function(){return{vid:t[1]}}));else{g("div#flashcontent"),g("div#playerDiv > div#movie_player"),g("div#watch-player.flash-player"),g("div#watch7-player.flash-player"),document.querySelector("ytd-app")?g("ytd-app ytd-watch-flexy ytd-player")||g("ytd-app ytd-player:not(.ytd-video-preview)"):g("#player:not(.skeleton) #player-api")}}(),t!=y.length&&console.log("players=%o",y);var e,r=l(y);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.target&&(n.disconnected||(n.target.isConnected?n.discoverVideoInfo():(console.log("%o: node %s was removed from DOM",n,n.target),n.disconnected=!0)))}}catch(t){r.e(t)}finally{r.f()}}var h=[null,null,"The requested video has been archived but is not currently available for playback.","We have not been able to archive the video associated with this YouTube page.",null,null,"The Wayback Machine does not have this video archived."],p=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.target=e,r&&(this.vinfo=r)}var e,r,o,c,u;return e=t,r=[{key:"playerNode",value:function(){var t=this.target.querySelector("embed#movie_player");if(t)return t;var e=this.target.querySelector("div.html5-video-player");return e||this.target}},{key:"discoverVideoInfo",value:function(){var t=this;if(!this.vinfo){var e=function(t){for(var e=0;e %s",r,o.status),void 0===e.video_status&&(e.video_status="Sorry, the Wayback Machine does not have this video ("+e.vid+") archived."),this.displayError(e.video_status),t.abrupt("return");case 10:i=o.headers.get("content-location"),e.location=i||r,console.log("vinfo.location=%s",e.location),a=o.headers.get("content-type"),e.ctype=a,a.indexOf("webm")>=0?e.ptype="webm":a.indexOf("flv")>=0?e.ptype="flv":a.indexOf("mp4")>=0?e.ptype="video/mp4":e.ptype="webm";case 16:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"replacePlayer",value:function(){this.vinfo&&this.vinfo.location&&(this.target.origId||"watch-player"==this.target.id||(this.target.origId=this.target.id,this.target.id="--wm--"+(this.target.id||Date.now())),function(t){var e=t.vinfo;if(!e||!e.location)return!1;var r=t.playerNode();if(!r)return!1;if(t.fullImgUrl=S("yt/img/"+t.vinfo.vid),window.ytplayer&&(window.ytplayer.config={},window.ytplayer.load=function(){}),E){var n=r.querySelector("video.html5-main-video");if(n)return console.log("replacing src of %o with %s",n,e.location),n.src=e.location,!0}return function(t,e,r,n){if(jwplayer||console.log("jwplayer is not loaded"),!t.setupInitiated){var o=t.playerNode();if(!o)return!1;o.id||(o.id="--wm--"+Date.now()),o.parentElement.style.zIndex=1e3;var i=o.clientWidth||"100%",a=o.clientHeight||"100%";if(t.setupInitiated=!0,"flv"!=t.vinfo.ptype){console.log("initializing jwplayer on %o (vo=%o)",o,t),jwplayer.key="sZbikYlI/xtW0U/3Tw1DOdjC1EahhtUCJF5KggVdqDY=";var l=jwplayer(o);return l.setup?(l.setup({height:a,width:i,autostart:r,image:t.fullImgUrl,primary:_()?"flash":"html5",playlist:[{image:t.fullImgUrl,sources:[{file:t.vinfo.location,type:t.vinfo.ptype}]}],events:{onError:n},analytics:{enabled:!1}}),!0):(console.log("failed to initialize jwplayer"),!1)}var c=function(){o.style.display="flex",o.style.flexDirection="column";try{var e=document.createElement("video");e.autoplay=!0,e.controls=!0,e.style.width="100%";var r=o.querySelector("embed");r?o.replaceChild(e,r):o.appendChild(e);var n=flvjs.createPlayer({type:"flv",url:t.vinfo.location});n.attachMediaElement(e),n.load()}catch(t){console.log("error setting up flvjs: ".concat(t)),o.parentElement.removeChild(o)}};if(console.log("initializing flvjs on %o (vo=%o)",o,t),"undefined"==typeof flvjs){var u=document.createElement("script");u.src="".concat(__wm.sp(),"js/flv.min.js"),u.addEventListener("load",c),document.head.appendChild(u)}else c()}}(t,e.ptype,!1)}(this)&&(this.replaced=!0))}},{key:"displayError",value:function(t){var e=this.target,r=e.querySelector("div#wm-video-error");r||((r=document.createElement("div")).id="wm-video-error",r.setAttribute("style","position:absolute;top:0;background:#000000c0;z-index:9999;padding:20px;left:10%;right:10%;text-align:center;height:10%;color:#fff;border-bottom-left-radius:20px;border-bottom-right-radius:20px;border:solid 4px #ffffff;border-top:none;font-size:12pt;"),e.insertBefore(r,e.firstChild)),r.innerHTML=t}}],r&&a(e.prototype,r),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}(),y=[];function m(t,e){if(t._wm_videoplayer)return!1;var r=new p(t,e);return t._wm_videoplayer=r,t.classList.add("wm-videoplayer"),y.push(r),!0}function g(t,e){e=e||function(){return null};var r,n=!1,o=l(document.querySelectorAll(t));try{for(o.s();!(r=o.n()).done;){var i=r.value;m(i,e(i))&&(console.log("player el=%o %o",i,i._wm_videoplayer),n=!0)}}catch(t){o.e(t)}finally{o.f()}return n}var b=/\?video_id=([-_a-zA-Z0-9]+)/,w=/\&video_id=([-_a-zA-Z0-9]+)/,x=[function(t){var e=(t.querySelector("video")||t).src;if(console.log("video.src = %s",e),e){var r=e.match(b);if(r)return{vid:r[1]}}return null},function(t){if("EMBED"!=t.tagName&&!(t=t.querySelector("embed")))return null;var e=t.getAttribute("flashvars");if(console.log("attr flashvars = %s",e),e){var r=e.match(w);if(r)return{vid:r[1]}}return null},function(t){var e=t.querySelector("div.ytp-cued-thumbnail-overlay-image");if(console.log("thumbnail = %o",e),e){var r=window.getComputedStyle(e).backgroundImage;if(r){var n=r.match(/\/vi\/([-_a-zA-Z0-9]+)\/hqdefault/);if(n)return{vid:n[1]}}}return null},function(t){var e=function(t,e){var r=t.parentElement;for(;r&&r!=document.body;){if(r.tagName==e)return r;r=r.parentElement}return null}(t,"YTD-WATCH-FLEXY");if(console.log("ytd-watch-flexy = %o",e),e){var r=e.getAttribute("video-id");if(e.hasAttribute("player-unavailable")){e.removeAttribute("player-unavailable");var n=e.querySelector("#error-screen");n?n.parentElement.removeChild(n):console.log("#error-screen element is not found")}if(r)return{vid:r}}return null},function(t){var e=document.querySelector('div#content meta[itemprop="videoId"]');if(console.log('div#content meta[itemprop="vidoId"] = %o',e),e){var r=e.getAttribute("content");if(r)return{vid:r}}return null},function(t){var e=document.querySelector('div#watch7-content meta[itemprop="videoId"]');if(console.log('div#watch7-content meta[itemprop="videoId"] = %o',e),e){var r=e.content;if(r)return{vid:r}}return null},function(t){if("undefined"!=typeof ytplayer&&ytplayer.config&&ytplayer.config.args){var e=ytplayer.config.args.video_id;if(e)return{vid:e}}}];function _(){return-1!=navigator.userAgent.indexOf("Safari")&&-1!=navigator.userAgent.indexOf("Mac")&&-1==navigator.userAgent.indexOf("Chrome")}var E=!1;function S(t){return"".concat(s.prefix,"/2oe_/http://wayback-fakeurl.archive.org/").concat(t)}window._wmVideos_=e})(); // @license-end