define(["asyncPageLoad","helper"],(function(e,t){return{itemClick:function(a){a.preventDefault(),a.stopPropagation();var n=a.target,o=t.parent(n,"li"),i=n.dataset.href,s=o.dataset.id,c=o.dataset.type;if(s&&c&&i)if(e.noAdsReloading(i,!0),o.classList.contains("unread"))Z.post("/profile/activity",{update_activity_status:s,type:c},(function(t){if(t&&t.data&&t.data.success){o.classList.remove("unread");var a=document.querySelector(".notify-center-icon"),n=a.querySelector(".unread");a.classList.remove("open"),n||a.classList.remove("active")}e.goTo(i)}));else{var r=document.querySelector(".notify-center-icon");r.classList.remove("open"),e.goTo(i)}},iconClick:function(e){var t=e.target;t.classList.contains("notify-center-icon")&&(t.classList.contains("open")?t.classList.remove("open"):(t.querySelector(".list-content").innerHTML="",t.classList.add("open","loading"),Z.get("/profile/activity",{get_notifications:1},(function(e){e&&e.html&&(t.classList.remove("loading"),t.querySelector(".list-content").innerHTML=e.html)}))))},updateTitle:function(e){var t,a=document.querySelector(".notify-center-icon");if(a)return t=a.getAttribute("data-count"),t=parseInt(t,10),"number"==typeof+e?(a.setAttribute("data-count",e),void(e>0?a.classList.add("active"):a.classList.remove("active"))):(isNaN(t)&&a.setAttribute("data-count",t+1),t<=0?(a.setAttribute("data-count",0),void a.classList.remove("active")):void a.classList.add("active"))},goToProfile:function(t){t.preventDefault();var a=document.querySelector(".notify-center-icon"),n=t.target,o=n.getAttribute("data-href");o&&a&&(e.noAdsReloading(o,!0),e.goTo(o),a.className=a.className.replace("open",""))},setAllRead:function(e){var t=this;e.preventDefault(),e.stopPropagation();var a=e.currentTarget||e.target;return!(a.className.indexOf("disable")>=0)&&(a.className+=" disable",void Z.post("/profile/activity",{notifications_set_read:1},(function(e){e&&e.data&&e.data.success&&(a.parentNode.removeChild(a),t.removeUnread())})))},removeUnread:function(){var e=document.querySelectorAll(".notify-center-list .unread"),t=document.querySelector(".notify-center-icon");[].forEach.call(e,(function(e){e.className=e.className.replace("unread","")})),t&&(t.className=t.className.replace(" active",""))},closeByDocumentClick:function(e){for(var t=e.target,a=e.target,n=document.querySelector(".notify-center-icon"),o=!0;t&&t!==document.body&&t.classList&&t.nodeName&&"#document"!==t.nodeName;){if(t.classList&&t.classList.contains("notify-center-icon")){o=!1;break}t=t.parentNode}o&&n&&n.classList&&a.classList&&n.classList.contains("open")&&!a.classList.contains("notify-center-icon")&&n.classList.remove("open")}}})); //# sourceMappingURL=notificationsCenter-161c11c51f.min.js.map