(self.webpackChunkrotor=self.webpackChunkrotor||[]).push([[713],{357:()=>{$(document).ready(function(){var e=new Audio("/assets/ding.mp3"),t=$(".js-messages-block .app-nav__item"),a=document.title.trim();function s(s){if(t.length&&null!=s&&s.success&&!(s.countMessages<=0)){var o=s.countMessages,n=t.find(".badge");n.length?n.text(o):t.append('<span class="badge bg-notify">'.concat(o,"</span>")),o>parseInt(localStorage.getItem("messageCount")||"0")&&(e.play().catch(function(){}),document.title="🔴 ".concat(a)),localStorage.setItem("messageCount",o)}}$(window).on("storage",function(e){"messageData"===e.originalEvent.key&&s(JSON.parse(e.originalEvent.newValue))}),setInterval(function(){var e=Date.now();e-parseInt(localStorage.getItem("messageTime")||"0")<59900||localStorage.getItem("messageLock")||(localStorage.setItem("messageLock","1"),localStorage.setItem("messageTime",e),$.get("/messages/new").then(function(e){localStorage.setItem("messageData",JSON.stringify(e)),s(e),localStorage.removeItem("messageLock")}).catch(function(){localStorage.removeItem("messageLock")}))},6e4)})}},e=>{var t;t=357,e(e.s=t)}]);