var k=function(){var e=[];return{j:function(d,a){var b=d.querySelector("span.items-count");if(b){var c=d.getAttribute("data-feed-id"),e=d.querySelector("h2:first-of-type");e.className="loading-icon";var l=new XMLHttpRequest;l.onload=function(){e.className="";d.removeAttribute("data-feed-error");var c=d.querySelector(".feed-last-checked");c&&(c.innerHTML=c.getAttribute("data-after-update"));c=JSON.parse(this.responseText);c.result?b.innerHTML=c.items_count.items_unread+"/"+c.items_count.items_total: d.setAttribute("data-feed-error","1");a?a(c):g.a()};l.open("POST","?action=refresh-feed&feed_id="+c,!0);l.send()}},k:function(){var d=Array.prototype.slice.call(document.querySelectorAll("article:not([data-feed-disabled])")),a=setInterval(function(){for(;0e.length;){var b=d.shift();e.push(parseInt(b.getAttribute("data-feed-id"),10));k.j(b,function(b){b=e.indexOf(b.feed_id);0<=b&&e.splice(b,1);0===d.length&&0===e.length&&(clearInterval(a),g.a())})}},100)}}}(),g=function(){function e(a){return item_id= a.getAttribute("data-item-id")}function d(a){if(a&&a.hasAttribute("data-reverse-label")){var b=a.innerHTML;a.innerHTML=a.getAttribute("data-reverse-label");a.setAttribute("data-reverse-label",b)}}function a(a){"mouse"!==m.c&&t.d();a.parentNode.removeChild(a);r--}function b(){-1l[e])l[e]=f.time,"unread"===f.status&&(c=!0)}document.hidden||d.nbUnread===n&&!q?document.hidden&&!a&&c&&(q=!0,document.title="\u21bb "+document.title):(q=!1,n=d.nbUnread,b())};a.open("POST","?action=latest-feeds-items",!0);a.send()}}}}(),m=function(){function e(a){if(63!==a.keyCode&&63!==a.which&&(a.ctrlKey||a.shiftKey||a.altKey||a.metaKey))return!0;a=a.target||a.srcElement;return"INPUT"=== a.tagName||"TEXTAREA"===a.tagName?!0:!1}var d=[];return{c:"",n:function(){document.onclick=function(a){var b=a.target.getAttribute("data-action");b&&"original-link"!==b&&a.preventDefault()};document.onmouseup=function(a){if(2!==a.button)if("INPUT"===a.target.nodeName&&"auto-select"===a.target.className)a.target.select();else{var b=a.target.getAttribute("data-action");if(b){m.c="mouse";var c;a:{for(element=a.target;element&&element.parentNode;)if(element=element.parentNode,element.tagName&&"article"=== element.tagName.toLowerCase()){c=element;break a}c=void 0}switch(b){case "refresh-all":k.k();break;case "refresh-feed":c&&k.j(c);break;case "mark-read":c&&g.p(c);break;case "mark-unread":c&&g.r(c);break;case "mark-removed":c&&g.q(c);break;case "bookmark":c&&g.i(c);break;case "download-item":c&&g.e(c);break;case "original-link":c&&g.g(c);break;case "mark-all-read":g.f("?action=unread");break;case "mark-feed-read":g.f("?action=feed-items&feed_id="+a.target.getAttribute("data-feed-id"))}}}}},m:function(){document.onkeypress= function(a){if(!e(a))if(m.c="keyboard",d.push(a.keyCode||a.which),103===d[0])switch(d[1]){case void 0:break;case 117:window.location.href="?action=unread";d=[];break;case 98:window.location.href="?action=bookmarks";d=[];break;case 104:window.location.href="?action=history";d=[];break;case 115:window.location.href="?action=feeds";d=[];break;case 112:window.location.href="?action=config";d=[];break;default:d=[]}else{d=[];var b=document.getElementById("current-item");switch(a.keyCode||a.which){case 100:b&& g.e(b);break;case 112:case 107:t.h();break;case 110:case 106:t.d();break;case 118:b&&g.g(b);break;case 111:b&&g.v(b);break;case 109:b&&g.A(b);break;case 102:b&&g.i(b);break;case 104:t.t();break;case 108:t.s();break;case 114:k.k();break;case 63:t.w();break;case 122:g.B()}}};document.onkeydown=function(a){if(!e(a))switch(m.c="keyboard",a.keyCode||a.which){case 37:t.h();break;case 39:t.d()}}},o:function(){document.addEventListener("visibilitychange",function(){!document.hidden&&g.C()&&g.a()})}}}(),t= function(){function e(a){var b=pageYOffset+document.documentElement.clientHeight;(0>b-(a.offsetTop+a.offsetHeight)||b-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function d(){return document.getElementById("listing")?!0:!1}return{s:function(){var a=document.getElementById("next-page");a&&a.click()},t:function(){var a=document.getElementById("previous-page");a&&a.click()},d:function(){var a=document.getElementById("next-item");if(a)a.click();else if(d())if(a= document.getElementsByTagName("article"),document.getElementById("current-item"))for(var b=0,c=a.length;b