"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[87094],{93348:function(e,t,r){r.r(t),r.d(t,{default:function(){return i}}),r(44962),r(78557),r(90076),r(83994),r(82367);var s=r(22622),n=(r(10353),r(46782)),c=r(89100);function i(e,t){e.querySelector(".btnLogout").addEventListener("click",(function(){c.default.logout()})),e.querySelector(".selectServer").addEventListener("click",(function(){c.default.selectServer()})),e.querySelector(".clientSettings").addEventListener("click",(function(){window.NativeShell.openClientSettings()})),e.querySelector(".exitApp").addEventListener("click",(function(){s.g.exit()})),e.addEventListener("viewshow",(function(){var i=t.userId||c.default.getCurrentUserId(),l=this;l.querySelector(".lnkUserProfile").setAttribute("href","#/userprofile?userId="+i),l.querySelector(".lnkDisplayPreferences").setAttribute("href","#/mypreferencesdisplay?userId="+i),l.querySelector(".lnkHomePreferences").setAttribute("href","#/mypreferenceshome?userId="+i),l.querySelector(".lnkPlaybackPreferences").setAttribute("href","#/mypreferencesplayback?userId="+i),l.querySelector(".lnkSubtitlePreferences").setAttribute("href","#/mypreferencessubtitles?userId="+i),l.querySelector(".lnkQuickConnectPreferences").setAttribute("href","#/quickconnect?userId="+i),l.querySelector(".lnkControlsPreferences").setAttribute("href","#/mypreferencescontrols?userId="+i);var u=s.g.supports("clientsettings");l.querySelector(".clientSettings").classList.toggle("hide",!u);var o=s.g.supports("exitmenu");l.querySelector(".exitApp").classList.toggle("hide",!o);var d=s.g.supports("multiserver");l.querySelector(".selectServer").classList.toggle("hide",!d),l.querySelector(".lnkControlsPreferences").classList.toggle("hide",n.A.mobile),ApiClient.getQuickConnect("Enabled").then((function(e){!0===e&&l.querySelector(".lnkQuickConnectPreferences").classList.remove("hide")})).catch((function(){console.debug("Failed to get QuickConnect status")})),ApiClient.getUser(i).then((function(e){l.querySelector(".headerUsername").innerText=e.Name,e.Policy.IsAdministrator&&!n.A.tv&&l.querySelector(".adminSection").classList.remove("hide")})),t.userId&&t.userId!==c.default.getCurrentUserId&&(l.querySelector(".userSection").classList.add("hide"),l.querySelector(".adminSection").classList.add("hide"),l.querySelector(".lnkControlsPreferences").classList.add("hide")),Promise.resolve().then(r.bind(r,84069)).then((function(t){t.default.autoFocus(e)}))}))}}}]);