!function(){var n;function i(){return n.currentId++}(n={worker:new Worker(URL.createObjectURL(new Blob(["(",function(){var e={};self.onmessage=function(t){"setInterval"===t.data.type?e[t.data.id]=setInterval(function(){self.postMessage({type:"fire",id:t.data.id})},t.data.delay):"clearInterval"===t.data.type?(clearInterval(e[t.data.id]),delete e[t.data.id]):"setTimeout"===t.data.type?e[t.data.id]=setTimeout(function(){self.postMessage({type:"fire",id:t.data.id}),delete e[t.data.id]},t.data.delay):"clearCallback"===t.data.type&&(clearTimeout(e[t.data.id]),delete e[t.data.id])}}.toString(),")();"],{type:"application/javascript"}))),idToCallback:{},currentId:0}).worker.onmessage=function(t){"fire"===t.data.type&&void 0!==n.idToCallback[t.data.id]&&n.idToCallback[t.data.id]()},window.$momentum=n,window.setInterval=function(t,e){var a=i();return n.idToCallback[a]=t,n.worker.postMessage({type:"setInterval",delay:e,id:a}),a},window.clearInterval=function(t){n.worker.postMessage({type:"clearInterval",id:t}),delete n.idToCallback[t]},window.setTimeout=function(t,e){var a=i();return n.idToCallback[a]=function(){t(),delete n.idToCallback[a]},n.worker.postMessage({type:"setTimeout",delay:e,id:a}),a},window.clearTimeout=function(t){n.worker.postMessage({type:"clearInterval",id:t}),delete n.idToCallback[t]}}();var App=function(){var o=this;this.updateInterval=2e3,this.tabId=Math.random().toString(36).substring(7),this.tabsCounter=0,this.onTabCountUpdate=[],this.updateActiveInterval=0,this.textToPutOnClipboard=void 0,this.isIe=-1!=navigator.userAgent.toLowerCase().indexOf("msie")||-1!=navigator.userAgent.toLowerCase().indexOf("trident"),this.tabsCount=function(t){void 0===t&&(t=!0);var e=o.getData(),a=Object.keys(e.list),n=Date.now(),i=0;return a.forEach(function(t){e.list[t].lastActive+1.2*o.updateInterval>n&&i++}),t||o.tabsCounter===i||(o.onTabCountUpdate.forEach(function(t){t(i)}),localStorage.setItem("lastActiveTab",o.tabId)),o.tabsCounter=i},this.updateActive=function(){var t=o.getData(),e=Date.now();void 0===t.list[o.tabId]&&(t.list[o.tabId]={TabOpenedTimeStamp:e}),t.list[o.tabId].url=window.location.href,t.list[o.tabId].lastActive=e,(void 0===t.lastCleaned||+t.lastCleaned+2e4<e)&&(t=o.clearList(t)),o.updateData(t),o.tabsCount(!1)},this.clearList=function(e){var t=Object.keys(e.list),a=Date.now();return t.forEach(function(t){e.list[t].lastActive+Math.max(8e3,1.5*o.updateInterval)<a&&delete e.list[t]}),e.lastCleaned=a,e},this.onTabChange=function(t,e){void 0===e&&(e=!1),"function"==typeof t&&(o.onTabCountUpdate.push(t),e&&t(o.tabsCount()))},this.updateData=function(t){localStorage.setItem("tabCountData","string"==typeof t?t:JSON.stringify(t))},this.getData=function(){var t=localStorage.getItem("tabCountData");return null==t?{list:{},lastCleaned:0}:JSON.parse(t)},this.getUrls=function(e){void 0===e&&(e=!1);var a=o.getData(),n=[];return Object.keys(a.list).forEach(function(t){e&&-1!==n.indexOf(a.list[t].url)||n.push(a.list[t].url)}),n},this.setUpdateInterval=function(t){void 0===t&&(t=o.updateInterval),null!==o.updateActiveInterval&&o.pause(),o.start(t)},this.pause=function(){clearInterval(o.updateActiveInterval),o.updateActiveInterval=0},this.start=function(t){void 0===t&&(t=o.updateInterval),o.updateActiveInterval=setInterval(function(){o.updateActive()},o.updateInterval=t)},this.lastActiveTab=function(){return o.tabId==localStorage.getItem("lastActiveTab")},this.updateActive(),this.start(),window.onbeforeunload=function(){var t=o.getData();delete t.list[o.tabId],o.updateData(t)},window.onmouseover=function(){localStorage.setItem("lastActiveTab",app.tabId)},document.oncopy=function(t){null!=o.textToPutOnClipboard&&(o.isIe?window.clipboardData.setData("Text",o.textToPutOnClipboard):t.clipboardData.setData("text/plain",o.textToPutOnClipboard),o.textToPutOnClipboard=void 0,t.preventDefault())},this.textCopy=function(t){o.textToPutOnClipboard=t,document.execCommand("copy")},this.playSound=function(t){const a=new(window.AudioContext||window.webkitAudioContext),e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){a.decodeAudioData(e.response,function(t){let e=a.createBufferSource();e.buffer=t,e.connect(a.destination),e.loop=!1,e.start()})},e.send()}},app=new App;