define(["cardBuilder","imageLoader","loading","connectionManager","apphost","layoutManager","scrollHelper","focusManager","lazyLoader","globalize","dom","appRouter","emby-linkbutton","emby-itemscontainer","emby-scroller"],function(cardBuilder,imageLoader,loading,connectionManager,appHost,layoutManager,scrollHelper,focusManager,lazyLoader,globalize,dom,appRouter){"use strict";function GenresTab(view,params){this.view=view,this.params=params,this.apiClient=connectionManager.getApiClient(params.serverId)}function renderGenres(instance,view,items,parentId){(view.classList.contains("genresContainer")?view:view.querySelector(".genresContainer")).innerHTML='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap focuscontainer-x padded-left padded-right padded-top"></div>';var container=view.querySelector(".itemsContainer");cardBuilder.buildCards(items,{itemsContainer:container,items:items,shape:"auto",centerText:!0,showTitle:!0,parentId:parentId})}return GenresTab.prototype.onResume=function(options){var apiClient=this.apiClient;if(options.refresh){var promises=[],parentId=this.params.parentId;promises.push(apiClient.getGenres(apiClient.getCurrentUserId(),{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Series",Recursive:!0,EnableTotalRecordCount:!1,EnableImageTypes:"Primary",ImageTypeLimit:1,Fields:"PrimaryImageAspectRatio",parentId:parentId}));var view=this.view,instance=this;promises[0].then(function(result){return renderGenres(instance,view,result.Items,parentId)}),Promise.all(promises).then(function(){options.autoFocus&&focusManager.autoFocus(view)})}},GenresTab.prototype.onPause=function(){},GenresTab.prototype.destroy=function(){this.view=null,this.params=null,this.apiClient=null},GenresTab});