define(["layoutManager","navDrawerContent","connectionManager","loading","apphost","focusManager","emby-scroller","listViewStyle","css!./settings"],function(layoutManager,navDrawerContent,connectionManager,loading,apphost,focusManager){"use strict";return function(view,params){view.querySelector(".appInfo").innerHTML=apphost.appName()+" "+apphost.appVersion(),view.addEventListener("viewbeforeshow",function(e){var apiClient,isRestored=e.detail.isRestored;loading.hide(),isRestored||(apiClient=params.serverId?connectionManager.getApiClient(params.serverId):connectionManager.currentApiClient()).getUser(params.userId||apiClient.getCurrentUserId()).then(function(user){apiClient.getCurrentUser().then(function(loggedInUser){!function(apiClient,user,loggedInUser){var options={apiClient:apiClient,user:user,loggedInUser:loggedInUser,userImage:!0,selectServer:!0,signOut:!0,itemClass:"navMenuOption-settings",home:!1,collapsible:!1,header:!1};navDrawerContent.getSettingsDrawerHtml(options).then(function(html){var routesElem=view.querySelector(".dynamicRoutes");routesElem.innerHTML=html,navDrawerContent.initItemsContainers(routesElem,options).then(function(){focusManager.autoFocus(routesElem)})})}(apiClient,user,loggedInUser)})})})}});