// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0 !function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([function(t,e,n){"use strict";function o(t){return(o="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})(t)}function r(t,e){for(var n=0;n=0}function v(t,e){var n=window["HTML".concat(t,"Element")];if(void 0!==n){var o=Object.getOwnPropertyDescriptor(n.prototype,e);void 0!==o&&Object.defineProperty(n.prototype,"_wm_".concat(e),o)}}function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"src",n="_wm_".concat(e);return n in t.__proto__?t[n]:t[e]}v("Image","src"),v("Media","src"),v("Embed","src"),v("IFrame","src"),v("Script","src"),v("Link","href"),v("Anchor","href")},function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return c}));var o=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i={Y:function(t){return t.getUTCFullYear()},m:function(t){return t.getUTCMonth()+1},b:function(t){return r[t.getUTCMonth()]},B:function(t){return o[t.getUTCMonth()]},d:function(t){return t.getUTCDate()},H:function(t){return("0"+t.getUTCHours()).slice(-2)},M:function(t){return("0"+t.getUTCMinutes()).slice(-2)},S:function(t){return("0"+t.getUTCSeconds()).slice(-2)},"%":function(){return"%"}};function s(t){var e=function(t){return"number"==typeof t&&(t=t.toString()),[t.slice(-14,-10),t.slice(-10,-8),t.slice(-8,-6),t.slice(-6,-4),t.slice(-4,-2),t.slice(-2)]}(t);return new Date(Date.UTC(e[0],e[1]-1,e[2],e[3],e[4],e[5]))}function a(t){return r[t]}function c(t,e){return e.replace(/%./g,(function(e){var n=i[e[1]];return n?n(s(t)):e}))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return c}));var o=n(0);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})(t)}function i(t,e){for(var n=0;n=400?r.failure&&r.failure(t):r.success&&r.success(t)}),{"Content-Type":"application/json"},s.stringify({url:t,snapshot:e,tags:n||[]})),!1}var c=function(){function t(e,n,r){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this.url=n,this.timestamp=r,e.onclick=this.save.bind(this),document.addEventListener("DOMContentLoaded",(function(){i.enableSaveSnapshot(Object(o.c)("logged-in-user"))}))}var e,n,r;return e=t,(n=[{key:"save",value:function(t){this.start(),a(this.url,this.timestamp,[],{failure:this.failure.bind(this),success:this.success.bind(this)})}},{key:"start",value:function(){this.hide(["wm-save-snapshot-fail","wm-save-snapshot-open","wm-save-snapshot-success"]),this.show(["wm-save-snapshot-in-progress"])}},{key:"failure",value:function(t){401==t.status?this.userNotLoggedIn(t):(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: "'+t.responseText+'"'),console.log('status: "'+t.status+'"'))}},{key:"success",value:function(t){this.hide(["wm-save-snapshot-fail","wm-save-snapshot-in-progress"]),this.show(["wm-save-snapshot-open","wm-save-snapshot-success"])}},{key:"enableSaveSnapshot",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?(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"))}},{key:"show",value:function(t){this.setDisplayStyle(t,"inline-block")}},{key:"hide",value:function(t){this.setDisplayStyle(t,"none")}},{key:"setDisplayStyle",value:function(t,e){var n=this;(Object(o.d)(t)?t:[t]).forEach((function(t){var o=n.el.getRootNode().getElementById(t);o&&(o.style.display=e)}))}}])&&i(e.prototype,n),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},,,,,,,function(t,e,n){"use strict";var o;n.r(e);var r,i={createElementNS:document.createElementNS};var s=!0;function a(t){s=t}function c(t){try{a(!1),t()}finally{a(!0)}}function l(t){!function(t,e,n){if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3);var r="; expires="+o.toGMTString()}else r="";document.cookie=t+"="+e+r+"; path=/"}(t,"",-1)}var u=n(0),f=n(1),h=window.Date;function p(t,e){return(t=t.toString()).length>=e?t:"00000000".substring(0,e-t.length)+t}function d(t){for(var e=0,n=0;n3}(t)){var o=[];for(n=0;n=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:"src",i=window.location.origin,s=T(window,t),c=m(s);try{for(c.s();!(o=c.n()).done;){var l=o.value;if(!n||n(l)){var f=Object(u.b)(l,r);f&&!f.startsWith(e)&&f.startsWith(i)&&(f.startsWith("data:")||a.push(f))}}}catch(t){c.e(t)}finally{c.f()}}c("img"),c("frame"),c("iframe",(function(t){return"playback"!==t.id})),c("script"),c("link",(function(t){return"stylesheet"===t.rel}),"href");var l=a.filter((function(t,e,n){return n.indexOf(t)===e}));l.length>0?(s=0,l.map((function(t){t.match("^https?://")&&(s++,Object(u.a)("HEAD",t,(function(t){if(200==t.status){var e=t.getResponseHeader("Memento-Datetime");if(null==e)console.log("%s: no Memento-Datetime",u);else{var n=document.createElement("span"),a=function(t,e){var n=new Date(t).getTime()-e,o="";n<0?(o+="-",n=Math.abs(n)):o+="+";var r=!1;if(n<1e3)return{delta:n,text:"",highlight:r};var i=n,s=Math.floor(n/1e3/60/60/24/30/12);n-=1e3*s*60*60*24*30*12;var a=Math.floor(n/1e3/60/60/24/30);n-=1e3*a*60*60*24*30;var c=Math.floor(n/1e3/60/60/24);n-=1e3*c*60*60*24;var l=Math.floor(n/1e3/60/60);n-=1e3*l*60*60;var u=Math.floor(n/1e3/60);n-=1e3*u*60;var f=Math.floor(n/1e3),h=[];s>1?(h.push(s+" years"),r=!0):1==s&&(h.push(s+" year"),r=!0);a>1?(h.push(a+" months"),r=!0):1==a&&(h.push(a+" month"),r=!0);c>1?h.push(c+" days"):1==c&&h.push(c+" day");l>1?h.push(l+" hours"):1==l&&h.push(l+" hour");u>1?h.push(u+" minutes"):1==u&&h.push(u+" minute");f>1?h.push(f+" seconds"):1==f&&h.push(f+" second");h.length>2&&(h=h.slice(0,2));return{delta:i,text:o+h.join(" "),highlight:r}}(e,i),c=a.highlight?"color:red;":"";n.innerHTML=" "+a.text,n.title=e,n.setAttribute("style",c);var l=t.getResponseHeader("Content-Type"),u=t.responseURL.replace(window.location.origin,""),f=document.createElement("a");f.innerHTML=u.split("/").splice(3).join("/"),f._wm_href=u,f.title=l,f.onmouseover=w,f.onmouseout=S;var h=document.createElement("div");h.setAttribute("data-delta",a.delta),h.appendChild(f),h.append(n),o.appendChild(h);var p=Array.prototype.slice.call(o.childNodes,0);p.sort((function(t,e){return e.getAttribute("data-delta")-t.getAttribute("data-delta")})),o.innerHTML="";for(var d=0,m=p.length;d0)for(var n=0;n0)for(var n=0;n0?this.sc.scrollTop=r+this.sc.suggestionHeight+o-this.sc.maxHeight:r<0&&(this.sc.scrollTop=r+o)}}},{key:"blurHandler",value:function(){var t=this;try{var e=this.root.querySelector(".wb-autocomplete-suggestions:hover")}catch(t){e=null}e?this.input!==document.activeElement&&setTimeout((function(){return t.focus()}),20):(this.last_val=this.input.value,this.sc.style.display="none",setTimeout((function(){return t.sc.style.display="none"}),350))}},{key:"suggest",value:function(t){var e=this.input.value;if(this.cache[e]=t,t.length&&e.length>=this.minChars){for(var n="",o=0;o40)&&13!=n&&27!=n){var o=this.input.value;if(o.length>=this.minChars){if(o!=this.last_val){if(this.last_val=o,clearTimeout(this.timer),this.cache){if(o in this.cache)return void this.suggest(this.cache[o]);for(var r=1;r'+t.replace(n,"$1")+""}},{key:"onSelect",value:function(t,e,n){}}]),t}(),L=function(){function t(e,n){_(this,t);var o=e.getRootNode();if(o.querySelector){var r="object"==M(e)?[e]:o.querySelectorAll(e);this.elems=r.map((function(t){return new j(t,n)}))}}return x(t,[{key:"destroy",value:function(){for(;this.elems.length>0;)this.elems.pop().unload()}}]),t}(),A=n(2);function R(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return N(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n0&&i<60,i)}))}window.__wm={init:function(t){!function(){var t=document.cookie.split(";");if(t.length>40)for(var e=0;e1?e-1:0),o=1;o0;)E.appendChild(O.children[0]);if(m)for(var H=0;H'+((""+n).replace(/\B(?=(\d{3})+$)/g,",")+" ")+(n>1?"captures":"capture")+"",h=f.a(r,"%d %b %Y");s!=r&&(h+=" - "+f.a(s,"%d %b %Y")),u+='
'+h+"
",e.innerHTML=u}(o),function(t,e,n,o,r,i,s){var a=o.getContext("2d");if(a){a.fillStyle="#FFF";var c=(new h).getUTCFullYear(),l=e/(c-r+1),u=d(t.years),f=u[0],p=n/u[1];if(i>=r){var m=_(i);a.fillStyle="#FFFFA5",a.fillRect(m,0,l,n)}for(var v=r;v<=c;v++){m=_(v);a.beginPath(),a.moveTo(m,0),a.lineTo(m,n),a.lineWidth=1,a.strokeStyle="#CCC",a.stroke()}s=parseInt(s)-1;for(var y=(l-1)/12,g=0;g0){var M=Math.ceil(T*p);a.fillStyle=v==i&&S==s?"#EC008C":"#000",a.fillRect(Math.round(w),Math.ceil(n-M),Math.ceil(y),Math.round(M))}w+=y}}}function _(t){return Math.ceil((t-r)*l)+.5}}(o,t,e,rt,a,M,_)}}))}else{var st=new Image;st.src="/__wb/sparkline?url="+encodeURIComponent(i)+"&width="+t+"&height="+e+"&selected_year="+M+"&selected_month="+_+(r&&"&collection="+r||""),st.alt="sparkline",st.width=t,st.height=e,st.id="sparklineImgId",st.border="0",ot.parentNode.replaceChild(st,ot)}function at(t){for(var e=[],n=t.length,o=0;o0)try{var o=document.createElement("div");o.setAttribute("style","background-color:#666;color:#fff;font-weight:bold;text-align:center"),o.textContent="NOTICE";var r=document.createElement("div");r.className="wm-capinfo-content";var i,s=R(n);try{var a=function(){var t=i.value;"string"==typeof t.notice&&c((function(){var e=document.createElement("div");e.innerHTML=t.notice,r.appendChild(e)}))};for(s.s();!(i=s.n()).done;)a()}catch(t){s.e(t)}finally{s.f()}ct.appendChild(o),c((function(){return ct.appendChild(r)})),J(!0)}catch(t){console.error("failed to build content of %o - maybe notice text is malformed: %s",ct,n)}}))}else J(!0);new A.a(X("wm-save-snapshot-open"),i,Y)},ex:function(t){t.stopPropagation(),J(!1)},ajax:u.a,sp:function(){return $}}}]); // @license-end