!function(e, t, s) { "use strict"; String.prototype.replaceTagsToValues = String.prototype.replaceTagsToValues || function(e) { let t = this; for (let s in e) t = t.replace(RegExp(`<${s}>`, "g"), e[s]); return t } , XF.Messenger = e.extend(XF.Messenger || {}, { noticesUrl: "", popupUrl: "", popup: null, enableSound: !1, soundPath: "", $audio: null, init() { setTimeout(()=>{ this.noticesUrl = XF.config.messenger.noticesUrl, this.popupUrl = XF.config.messenger.popupUrl, t.getWebsocketsPromise?.().then(({manager: e})=>{ e.channels.visitor.listen("XFM.NewMessage", XF.proxy(this, "onNewMessage")) } ), XF.config.messenger.popupEnabled && (this.popup = new XF.ChatPopup({ url: this.popupUrl, eventPrefix: "XFM", draggable: !0 }), this.isValidPage() && this.popup.setupFromCookie()), XF.config.messenger.enableSound && (this.enableSound = !0, this.soundPath = XF.config.messenger.soundPath, this.$audio = e("