// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0 (()=>{"use strict";var e,t,s={createElementNS:document.createElementNS};var n=!0;function i(e){n=e}function o(e){try{i(!1),e()}finally{i(!0)}}function a(e){!function(e,t,s){if(s){var n=new Date;n.setTime(n.getTime()+24*s*60*60*1e3);var i="; expires="+n.toGMTString()}else i="";document.cookie=e+"="+t+i+"; path=/"}(e,"",-1)}if(void 0!==window.XMLHttpRequest){var r=class extends XMLHttpRequest{};Object.defineProperty(r.prototype,"responseURL",Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"responseURL"))}function l(e,t,s,n,i){var o;if((o=window.XMLHttpRequest?new r:new ActiveXObject("Microsoft.XMLHTTP")).onreadystatechange=function(){4==this.readyState&&s(o)},o.open(e,t,!0),n)for(var a in n)n.hasOwnProperty(a)&&o.setRequestHeader(a,n[a]);o.withCredentials=!0,o.send(i)}function c(e){return void 0!==e&&e&&e.constructor===Array}function h(e,t){const s=window[`HTML${e}Element`];if(void 0!==s){const e=Object.getOwnPropertyDescriptor(s.prototype,t);void 0!==e&&Object.defineProperty(s.prototype,`_wm_${t}`,e)}}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"src";const s=`_wm_${t}`;return s in e.__proto__?e[s]:e[t]}h("Image","src"),h("Media","src"),h("Embed","src"),h("IFrame","src"),h("Script","src"),h("Link","href"),h("Anchor","href");var d=["January","February","March","April","May","June","July","August","September","October","November","December"],p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m={Y:function(e){return e.getUTCFullYear()},m:function(e){return e.getUTCMonth()+1},b:function(e){return p[e.getUTCMonth()]},B:function(e){return d[e.getUTCMonth()]},d:function(e){return e.getUTCDate()},H:function(e){return("0"+e.getUTCHours()).slice(-2)},M:function(e){return("0"+e.getUTCMinutes()).slice(-2)},S:function(e){return("0"+e.getUTCSeconds()).slice(-2)},"%":function(){return"%"}};function f(e){var t=function(e){return"number"==typeof e&&(e=e.toString()),[e.slice(-14,-10),e.slice(-10,-8),e.slice(-8,-6),e.slice(-6,-4),e.slice(-4,-2),e.slice(-2)]}(e);return new Date(Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5]))}function g(e){return p[e]}function w(e,t){return t.replace(/%./g,function(t){var s=m[t[1]];return s?s(f(e)):t})}const v=window.Date;function y(e,t){return(e=e.toString()).length>=t?e:"00000000".substring(0,t-e.length)+e}function b(e){for(var t=0,s=0;s3}(e)){var n=[];for(s=0;s0?this.sc.scrollTop=i+this.sc.suggestionHeight+n-this.sc.maxHeight:i<0&&(this.sc.scrollTop=i+n)}}blurHandler(){try{var e=this.root.querySelector(".wb-autocomplete-suggestions:hover")}catch(t){e=null}e?this.input!==document.activeElement&&setTimeout(()=>this.focus(),20):(this.last_val=this.input.value,this.sc.style.display="none",setTimeout(()=>this.sc.style.display="none",350))}suggest(e){var t=this.input.value;if(this.cache[t]=e,e.length&&t.length>=this.minChars){for(var s="",n=0;n{this.sc.style.display="none"},20))}}keyupHandler(e){var t=window.event?e.keyCode:e.which;if(!t||(t<35||t>40)&&13!=t&&27!=t){var s=this.input.value;if(s.length>=this.minChars){if(s!=this.last_val){if(this.last_val=s,clearTimeout(this.timer),this.cache){if(s in this.cache)return void this.suggest(this.cache[s]);for(var n=1;n{this.source(s,this.suggest.bind(this))},this.delay)}}else this.last_val=s,this.sc.style.display="none"}}focusHandler(e){this.last_val="\n",this.keyupHandler(e)}renderItem(e,t){t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var s=new RegExp("("+t.split(" ").join("|")+")","gi");return'
'+e.replace(s,"$1")+"
"}onSelect(e,t,s){}}class L{constructor(e,t){let s=e.getRootNode();if(!s.querySelector)return;let n="object"==typeof e?[e]:s.querySelectorAll(e);this.elems=n.map(e=>new _(e,t))}destroy(){for(;this.elems.length>0;)this.elems.pop().unload()}}const S=JSON;class H{constructor(e,t,s){this.el=e,this.url=t,this.timestamp=s,e.onclick=this.save.bind(this),document.addEventListener("DOMContentLoaded",()=>{var e;this.enableSaveSnapshot((e="logged-in-user",document.cookie.search(e)>=0))})}save(e){var t,s,n,i;this.start(),t=this.url,s=this.timestamp,n=[],i=(i={failure:this.failure.bind(this),success:this.success.bind(this)})||{},l("POST","/__wb/web-archive/",function(e){401===e.status?i.userNotLoggedIn&&i.userNotLoggedIn(e):e.status>=400?i.failure&&i.failure(e):i.success&&i.success(e)},{"Content-Type":"application/json"},S.stringify({url:t,snapshot:s,tags:n||[]}))}start(){this.hide(["wm-save-snapshot-fail","wm-save-snapshot-open","wm-save-snapshot-success"]),this.show(["wm-save-snapshot-in-progress"])}failure(e){401==e.status?this.userNotLoggedIn(e):(this.hide(["wm-save-snapshot-in-progress","wm-save-snapshot-success"]),this.show(["wm-save-snapshot-fail","wm-save-snapshot-open"]),console.log("You have got an error."),console.log("If you think something wrong here please send it to support."),console.log('Response: "'+e.responseText+'"'),console.log('status: "'+e.status+'"'))}success(e){this.hide(["wm-save-snapshot-fail","wm-save-snapshot-in-progress"]),this.show(["wm-save-snapshot-open","wm-save-snapshot-success"])}enableSaveSnapshot(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?(this.show("wm-save-snapshot-open"),this.hide("wm-sign-in")):(this.hide(["wm-save-snapshot-open","wm-save-snapshot-in-progress"]),this.show("wm-sign-in"))}show(e){this.setDisplayStyle(e,"inline-block")}hide(e){this.setDisplayStyle(e,"none")}setDisplayStyle(e,t){(c(e)?e:[e]).forEach(e=>{let s=this.el.getRootNode().getElementById(e);s&&(s.style.display=t)})}}function E(e,t,s){s.innerHTML="";const n=s.getRootNode().querySelector("#wm-capresources-loading");n.style.display="block";var i=f(e).getTime(),o=0;t=window.location.origin+t;var a=[];function r(e,s){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"src";const i=window.location.origin,o=R(window,e);for(let e of o){if(s&&!s(e))continue;const o=u(e,n);o&&(!o.startsWith(t)&&o.startsWith(i)&&(o.startsWith("data:")||a.push(o)))}}r("img"),r("frame"),r("iframe",e=>"playback"!==e.id),r("script"),r("link",e=>"stylesheet"===e.rel,"href");var c=a.filter(function(e,t,s){return s.indexOf(e)===t});c.length>0?(o=0,c.map(function(e){e.match("^https?://")&&(o++,l("HEAD",e,function(e){if(200==e.status){var t=e.getResponseHeader("Memento-Datetime");if(null==t)console.log("%s: no Memento-Datetime",h);else{var a=document.createElement("span"),r=function(e,t){var s=new Date(e).getTime()-t,n="";s<0?(n+="-",s=Math.abs(s)):n+="+";var i=!1;if(s<1e3)return{delta:s,text:"",highlight:i};var o=s,a=Math.floor(s/1e3/60/60/24/30/12);s-=1e3*a*60*60*24*30*12;var r=Math.floor(s/1e3/60/60/24/30);s-=1e3*r*60*60*24*30;var l=Math.floor(s/1e3/60/60/24);s-=1e3*l*60*60*24;var c=Math.floor(s/1e3/60/60);s-=1e3*c*60*60;var h=Math.floor(s/1e3/60);s-=1e3*h*60;var u=Math.floor(s/1e3),d=[];return a>1?(d.push(a+" years"),i=!0):1==a&&(d.push(a+" year"),i=!0),r>1?(d.push(r+" months"),i=!0):1==r&&(d.push(r+" month"),i=!0),l>1?d.push(l+" days"):1==l&&d.push(l+" day"),c>1?d.push(c+" hours"):1==c&&d.push(c+" hour"),h>1?d.push(h+" minutes"):1==h&&d.push(h+" minute"),u>1?d.push(u+" seconds"):1==u&&d.push(u+" second"),d.length>2&&(d=d.slice(0,2)),{delta:o,text:n+d.join(" "),highlight:i}}(t,i),l=r.highlight?"color:red;":"";a.innerHTML=" "+r.text,a.title=t,a.setAttribute("style",l);var c=e.getResponseHeader("Content-Type"),h=e.responseURL.replace(window.location.origin,""),u=document.createElement("a");u.innerHTML=h.split("/").splice(3).join("/"),u._wm_href=h,u.title=c,u.onmouseover=A,u.onmouseout=U;var d=document.createElement("div");d.setAttribute("data-delta",r.delta),d.appendChild(u),d.append(a),s.appendChild(d);var p=Array.prototype.slice.call(s.childNodes,0);p.sort(function(e,t){return t.getAttribute("data-delta")-e.getAttribute("data-delta")}),s.innerHTML="";for(var m=0,f=p.length;m0)for(var s=0;s0)for(var s=0;s0)for(const e of s)r.push(e.notice)}const l=!!e.getAttribute("birdwatch");if(l){const s=function(e){let t=e.match(/^https?:\/\/(?:twitter|x)\.com\/i\/web\/status\/(\d+)/);if(t)return t[1];if(t=e.match(/^https?:\/\/twitter\.com\/[^/]+\/status\/(\d+)/),t)return t[1];return null}(t.url);if(s){const t=new URLSearchParams([["url",`https://x.com/i/web/status/${s}`]]),n=`${B}?${t}`,i=await $(n,{credentials:"omit"}),{status:o,notes:a}=await i.json();if("success"==o&&a?.length>0){const t=(e.getAttribute("birdwatch-browse")||W)+s;r.push(`This post has ${a.length} community note${a.length>1?"s":""}`)}}}r.length>0&&function(e,t){try{const s=document.createElement("div");s.setAttribute("style","background-color:#666;color:#fff;font-weight:bold;text-align:center"),s.textContent="NOTICE";const n=document.createElement("div");n.className="wm-capinfo-content";for(let e of t)"string"==typeof e&&o(()=>{const t=document.createElement("div");t.innerHTML=e,n.appendChild(t)});e.appendChild(s),o(()=>e.appendChild(n)),P(!0)}catch(e){console.error("failed to build content of %o - maybe notice text is malformed: %s",$notice,t)}}(e,r)}(n,s):P(!0))}function P(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=O._dstate||{root:!1},s=!1;t.root?O._dstate={root:!1}:e?O._dstate={root:!1,notice:!0}:t.notice?O._dstate={root:!1}:(O._dstate={root:!0},s=!0);const{root:n,notice:i}=O._dstate;if(n?(O.style.display="block",D.classList.add("wm-open"),D.classList.remove("wm-closed")):i?(O.style.display="block",O.classList.add("notice-only"),D.classList.add("wm-open"),D.classList.remove("wm-closed")):(O.style.display="none",O.classList.remove("notice-only"),D.classList.remove("wm-open"),D.classList.add("wm-closed")),s){const e=O.querySelector("#wm-capresources");E(I.timestamp,I.staticPrefix,e)}}const j="https://wayback-api.archive.org/services/context/notices",B="https://wayback-api.archive.org/services/context/birdwatch",W="https://wayback-api.archive.org/services/context/birdwatch/_browse/";const F=window.JSON,Y=window.open,J=window.location.hash||"",X=window.Date,G=document;var z=document,V=function(e){return z.getElementById(e)};var K,Q="/static/";function Z(e,t){var s=V(e);s&&(s.style.visibility=t?"visible":"hidden")}function ee(e,t){c(e)||(e=[e]);for(var s=0;s{})}if(window.__wm={init:function(t){!function(){var e=document.cookie.split(";");if(e.length>40)for(var t=0;t1?s-1:0),o=1;o0;)A.appendChild(N.children[0]);if(h)for(var U=0;U baseHeight=%s",e,t,s),N.style.height=s+"px",document.documentElement.style.setProperty("--wm-toolbar-height",s+"px")}window.top!=window.self&&"force"!=N.getAttribute("toolbar-mode")||(N.style.display="block");var O=!1,D=!0;const I=V("donato-if")?.contentWindow;var j=V("donato");if(console.debug("$donato = %o",j),j)if(window.top!=window.self)j.style.display="none",console.debug("hid $donato as window.top != window.self");else{var B=V("donato-base");window.addEventListener("message",function(e){if(e.source===I){var t="string"==typeof e.data?F.parse(e.data):e.data;if(console.log("got message %o",t),"set height"==t.event){var s=t.value,n=t.bannerHeight;if("number"!=typeof s||s<=0)return;if(!D)return;if(t.value,O)return;j.style.height=n+"px",B.style.height=s+"px",$()}else if("open modal"==t.event)B.style.height="",document.body.classList.add("wm-modal"),window.scrollTo(0,0),O=!0;else if("close modal"==t.event)j.style.marginBottom="0px",document.body.classList.remove("wm-modal"),O=!1;else if("hide banner"==t.event){j.style.height=0,j.style.visibility="hidden";var i=new X(X.now()+24*t.value*3600*1e3);document.cookie="donation=x; domain=archive.org; path=/; expires="+i.toUTCString(),D=!1,O=!1,$()}}},!1),console.debug("installed message listener to #donato-base: %o",B)}V("wm-tb-close").addEventListener("click",e=>{V("wm-ipp-inside").style.display="none",e.preventDefault(),$()});var W=V("wm-ipp-sparkline");function Z(e){var t="mouseenter"==e.type?1:0;if(t!==x){var s=V("wm-ipp"),n=V("displayYearEl"),i=V("displayMonthEl"),o=V("displayDayEl");t?s.className="hi":(s.className="",n.innerHTML=C,i.innerHTML=g(T-1),o.innerHTML=y(M,2)),_.style.display=t?"inline":"none",S.style.display=t?"inline":"none",x=t}}V("wm-expand").addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),P()}),V("wm-graph-anchor")._no_rewrite=!0,(_=G.createElement("div")).className="yt",_.style.display="none",_.style.width=s+"px",_.style.height=t+"px",(S=G.createElement("div")).className="mt",S.style.display="none",S.style.width=n+"px",S.style.height=t+"px",W.appendChild(_),W.appendChild(S);var se=V("wm-sparkline-canvas");W.onmouseenter=Z,W.onmouseleave=Z,W.onmousemove=function(t){var i,o,a=W,l=function(e){var t=0;return e.pageX||e.pageY?t=e.pageX:(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft),t}(t),c=(i=a,o=G.documentElement,(void 0!==i.getBoundingClientRect?i.getBoundingClientRect():{top:0,left:0}).left+(window.scrollX||o.scrollLeft)-(o.clientLeft||0)),h=Math.min(Math.max(0,l-c),e),u=h%s,d=Math.floor(h/s),m=Math.min(11,Math.floor(u/n)),f=12*d+m,w=u%2==1?15:1,v=y(d+r)+y(m+1,2)+y(w,2)+"000000";if(V("displayYearEl").innerHTML=d+r,V("displayMonthEl").innerHTML=g(m),V("wm-graph-anchor").href=p.replayUrl(v),E!=d){var b=d*s;_.style.left=b+"px",E=d}if(k!=f){var C=d+f*n+1;S.style.left=C+"px",k=f}};const ne=V("wm-toolbar");var ie=V("wm-sparkline-canvas");if(ie.getContext&&ie.getContext("2d")){var oe="/__wb/sparkline?output=json&url="+encodeURIComponent(o)+(i&&"&collection="+i||"");"async"==ne.getAttribute("nav")&&(oe+=`&nav=${K}`),l("GET",oe,function(s){if(200==s.status){for(var n=F.parse(s.responseText),i=n.years,a=Object.getOwnPropertyNames(i),l=n.years=[],c=0;c1?"captures":"capture"}`;var p=w(i,"%d %b %Y");a!=i&&(p+=` - ${w(a,"%d %b %Y")}`);const m=document.createElement("div");m.className="r",m.title="Timespan for captures of this URL",m.innerText=p,t.innerHTML="",t.appendChild(h),t.appendChild(m)}(n),n.nav&&function(e,t){let{prev:s,next:n,monthPrev:i,monthNext:o,yearPrev:a,yearNext:r}=t;function l(t,s,n){if(null!=s){const i=w(s,"%H:%M:%S %b %d, %Y"),o=e.querySelector(t),a=document.createElement("a"),r=a._orig_setAttribute??a.setAttribute;r.call(a,"href",p.replayUrl(s)),r.call(a,"title",i),n&&(o.textContent=w(s,n));for(let e=o.firstChild;e;e=o.firstChild)a.appendChild(e);o.appendChild(a)}}l(".m .b",i,"%b"),l(".m .f",o,"%b"),l(".y .b",a,"%Y"),l(".y .f",r,"%Y"),l(".d .b",s),l(".d .f",n)}(ne.querySelector("div.n"),n.nav),function(e,t,s,n,i,o,a){var r=n.getContext("2d");if(r){r.fillStyle="#FFF";var l=(new v).getUTCFullYear(),c=t/(l-i+1),h=b(e.years),u=h[0],d=s/h[1];if(o>=i){var p=x(o);r.fillStyle="#FFFFA5",r.fillRect(p,0,c,s)}for(var m=i;m<=l;m++)p=x(m),r.beginPath(),r.moveTo(p,0),r.lineTo(p,s),r.lineWidth=1,r.strokeStyle="#CCC",r.stroke();a=parseInt(a)-1;for(var f=(c-1)/12,g=0;g0){var M=Math.ceil(T*d);r.fillStyle=m==o&&C==a?"#EC008C":"#000",r.fillRect(Math.round(y),Math.ceil(s-M),Math.ceil(f),Math.round(M))}y+=f}}}function x(e){return Math.ceil((e-i)*c)+.5}}(n,e,t,ie,r,C,T)}})}else{var ae=new Image(e,t);ae.src="/__wb/sparkline?url="+encodeURIComponent(o)+"&width="+e+"&height="+t+"&selected_year="+C+"&selected_month="+T+(i&&"&collection="+i||""),ae.alt="sparkline",ae.id="sparklineImgId",ae.border="0",se.parentNode.replaceChild(ae,se)}function re(e){return e.filter(e=>void 0===e.excluded).map(e=>e.display_name)}V("wm-share-facebook").onclick=function(e){const t=this.dataset.url;return Y("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t),"","height=400,width=600"),e.preventDefault(),!1},V("wm-share-twitter").onclick=function(e){const t=this.dataset.url;return Y("https://x.com/intent/post?text="+encodeURIComponent(t)+"&via=internetarchive","","height=446,width=600"),e.preventDefault(),!1},new L(V("wmtbURL"),{delay:400,source:function(e,t){l("GET","/__wb/search/host?q="+encodeURIComponent(e),function(s){if(void 0!==(s=F.parse(s.response)).hosts&&s.hosts.length>0){var n=re(s.hosts);t(n)}else void 0!==s.isUrl&&!0===s.isUrl&&void 0===s.excluded?t([e]):l("GET","/__wb/search/anchor?q="+encodeURIComponent(e),function(e){if(void 0!==(e=F.parse(e.response))&&e.length>0){var s=re(e.slice(0,5));t(s)}})})},onSelect:function(e,t,s){V("wmtb").submit()}}),V("wmtb").onsubmit=function(e){var t=V("wmtbURL").value;if(0!==t.indexOf("http://")&&0!==t.indexOf("https://")&&!t.match(/[\w\.]{2,256}\.[a-z]{2,4}/gi))return document.location.href="/web/*/"+V("wmtbURL").value,e.preventDefault(),!1},function(e,t,s){!function(e,t){l("HEAD",e,function(e){t(e.status<300,e.responseURL)})}("/web/"+t+"/http://web.archive.org/screenshot/"+e,function(e,n){if(!e)return s(!1);var i=function(e){var t=te.exec(e);return t&&t[1]?t[1]:null}(n);if(!i)return console.warn("failed to extract timestamp from %s",n),void s(!1);var o=(f(i).getTime()-f(t).getTime())/1e3;console.log("screenshot delta: "+o+"s"),s(o>0&&o<60,o)})}(o,K,function(e,t){e?(V("wm-screenshot").title="screenshot (delta: "+t+"s)",ee("wm-screenshot",!0)):ee("wm-screenshot",!1)}),u&&function(e,t){!function(e,t,s){const n="/web/"+t+"id_/http://wayback-metadata.archive.org/youtube-dl/"+e;l("GET",n,s)}(e,t,function(e){if(e.status<300){const t=F.parse(e.responseText);ee("wm-video",!0),V("wm-video").href=t.url,V("wm-video").title="Video: "+t.title}else ee("wm-video",!1)})}(o,K),q(V("wm-capinfo"),V("wm-expand"),p),new H(V("wm-save-snapshot-open"),o,K),$()},ajax:l,sp:function(){return Q},pc:function(e){(Math.random()=0&&document.cookie.search("logged-in-sig")>=0)&&window.addEventListener("load",ne)}},window.parent!==window.self){const e={event:"playbackReady",pageUrl:document.location.href,pageTitle:document.title};window.parent.postMessage(JSON.stringify(e),"*"),document.addEventListener("DOMContentLoaded",()=>{const e={event:"domContentLoaded",pageUrl:document.location.href,pageTitle:document.title};window.parent.postMessage(JSON.stringify(e),"*")}),window.addEventListener("pagehide",e=>{const t={event:"pagehide",pageUrl:e.currentTarget.document.location.href,pageTitle:e.currentTarget.document.title};window.parent.postMessage(JSON.stringify(t),"*")}),"undefined"!=typeof navigation&&navigation.addEventListener("navigate",e=>{if("replace"===e.navigationType){const t={event:"navigate",pageUrl:e.destination.url,pageTitle:document.title};window.parent.postMessage(JSON.stringify(t),"*")}})}})(); // @license-end