/*! For license information please see notifications_common.a7868bd177c8d6071a4f.min.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([[2539,7602],{"lCk/":(t,i,e)=>{"use strict";e("e7ca"),e("ACdA");var n,o=e("vRey"),a=e("ZE5E"),s=(e("m3pm"),e("i8mr")),r=null,u=function(){return null!=n&&0!=n.length};function c(){n.is(":visible")&&n.hide(),s("#sub_menus .sub_menu").hide()}function l(t){if(t.preventDefault(),s("body").hasClass("side_menu_open"))return window.location.href="/Notifications",!0;var i=s(this),e=i.offset(),n=s("div#notification_popup"),o=s("div#notifications_placeholder");return n.is(":visible")?(n.hide(),!0):(n.css({top:e.top+s(this).outerHeight(!0),left:e.left+i.outerWidth(!0)-n.outerWidth()}),s.ajax({type:"GET",dataType:"json",beforeSend:function(){o.html(""),s("div#notification_loading").show(),n.show()},url:"/Api/NotificationPopup",success:function(t){s("div#notification_loading").hide(),o.html(t.Html),s(".timeago").each((function(){var t=s(this);t.attr("title",t.data("ts"))})).timeago(),r.invoke("updateLastNotificationTime"),setTimeout((function(){f(0),s("#notification_button").removeClass("notification_button_active")}),1e3)},error:function(){n.hide(),alert("We couldn't fetch your latest notifications. Please refresh and try again.")}}),!1)}function f(t){s("span#notification_count").html(t),s("span#side_menu_notification_count").html(t)}function d(t){t.preventDefault();var i=s(t.target).closest(".button"),e=i.offset(),n=i.attr("data-sub-menu-name"),o=s("div#sub_menus div.sub_menu."+n);return o.is(":visible")?o.hide():(s("#sub_menus .sub_menu").hide(),o.css({top:e.top+(i.outerHeight(!0)-10),left:e.left-10}),o.show()),!1}s((function(){n=s("div#notification_popup"),s(document).on("click","li#notification_button",l),s(document).on("click","body",c),s(document).on("click","li.button.has_submenu",d),s(document).on("click","div#notification_popup",(function(t){t.stopPropagation()})),u&&n.appendTo("body")})),s((function(){r=(new o.$I).withUrl("/ws/notificationevents").build(),u()&&(r.on("increaseNotificationCount",(function(){var t=parseInt(s("span#notification_count").html());f(++t),t<1?s("#notification_button").removeClass("notification_button_active"):s("#notification_button").addClass("notification_button_active")})),r.on("setNotificationCount",(function(t){f(t),t<1?s("#notification_button").removeClass("notification_button_active"):s("#notification_button").addClass("notification_button_active")})),(0,a.a)(r))}))},ZE5E:(t,i,e)=>{"use strict";function n(t,i){!function(t){t.start().catch((function(t){console.log("There was an error whilst trying to connect: ".concat(t))}))}(t),function(t,i){t.onclose((function(t){console.log("The connection closed"),void 0!==i&&null!=i&&i()}))}(t,i)}e.d(i,{a:()=>n})},i8mr:(t,i,e)=>{var n=e("qIEf"),o=e("JP1s");void 0===o.jQuery&&(o.jQuery={}),o.jQuery.$=n,t.exports=n},JP1s:(t,i,e)=>{"use strict";t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==e.g)return e.g}return t}()},m3pm:(t,i,e)=>{var n,o,a;o=[e("i8mr")],void 0===(a="function"==typeof(n=function(t){t.timeago=function(i){return i instanceof Date?o(i):o("string"==typeof i?t.timeago.parse(i):"number"==typeof i?new Date(i):t.timeago.datetime(i))};var i=t.timeago;t.extend(t.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,autoDispose:!0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(i){if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var e=this.settings.strings,n=e.prefixAgo,o=e.suffixAgo;if(this.settings.allowFuture&&i<0&&(n=e.prefixFromNow,o=e.suffixFromNow),!this.settings.allowPast&&i>=0)return this.settings.strings.inPast;var a=Math.abs(i)/1e3,s=a/60,r=s/60,u=r/24,c=u/365;function l(n,o){var a=t.isFunction(n)?n(o,i):n,s=e.numbers&&e.numbers[o]||o;return a.replace(/%d/i,s)}var f=a<45&&l(e.seconds,Math.round(a))||a<90&&l(e.minute,1)||s<45&&l(e.minutes,Math.round(s))||s<90&&l(e.hour,1)||r<24&&l(e.hours,Math.round(r))||r<42&&l(e.day,1)||u<30&&l(e.days,Math.round(u))||u<45&&l(e.month,1)||u<365&&l(e.months,Math.round(u/30))||c<1.5&&l(e.year,1)||l(e.years,Math.round(c)),d=e.wordSeparator||"";return void 0===e.wordSeparator&&(d=" "),t.trim([n,f,o].join(d))},parse:function(i){var e=t.trim(i);return e=(e=(e=(e=(e=e.replace(/\.\d+/,"")).replace(/-/,"/").replace(/-/,"/")).replace(/T/," ").replace(/Z/," UTC")).replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2")).replace(/([\+\-]\d\d)$/," $100"),new Date(e)},datetime:function(e){var n=i.isTime(e)?t(e).attr("datetime"):t(e).attr("title");return i.parse(n)},isTime:function(i){return"time"===t(i).get(0).tagName.toLowerCase()}});var e={init:function(){e.dispose.call(this);var o=t.proxy(n,this);o();var a=i.settings;a.refreshMillis>0&&(this._timeagoInterval=setInterval(o,a.refreshMillis))},update:function(e){var o=e instanceof Date?e:i.parse(e);t(this).data("timeago",{datetime:o}),i.settings.localeTitle&&t(this).attr("title",o.toLocaleString()),n.apply(this)},updateFromDOM:function(){t(this).data("timeago",{datetime:i.parse(i.isTime(this)?t(this).attr("datetime"):t(this).attr("title"))}),n.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};function n(){var e=i.settings;if(e.autoDispose&&!t.contains(document.documentElement,this))return t(this).timeago("dispose"),this;var n=function(e){if(!(e=t(e)).data("timeago")){e.data("timeago",{datetime:i.datetime(e)});var n=t.trim(e.text());i.settings.localeTitle?e.attr("title",e.data("timeago").datetime.toLocaleString()):!(n.length>0)||i.isTime(e)&&e.attr("title")||e.attr("title",n)}return e.data("timeago")}(this);return isNaN(n.datetime)||(0===e.cutoff||Math.abs(a(n.datetime))0&&t(this).text(t(this).attr("title"))),this}function o(t){return i.inWords(a(t))}function a(t){return(new Date).getTime()-t.getTime()}t.fn.timeago=function(t,i){var n=t?e[t]:e.init;if(!n)throw new Error("Unknown function name '"+t+"' for timeago");return this.each((function(){n.call(this,i)})),this},document.createElement("abbr"),document.createElement("time")})?n.apply(i,o):n)||(t.exports=a)}},t=>{t.O(0,[5914,1603,1544],(()=>("lCk/",t(t.s="lCk/")))),t.O()}]);