define(["exports","./../modules/tabbedview/tabbedview.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-apiclient/connectionmanager.js","./../modules/maintabsmanager.js"],function(_exports,_tabbedview,_embyScroller,_embyButton,_connectionmanager,_maintabsmanager){function HomeView(view,params){_tabbedview.default.apply(this,arguments),this.selectedItemInfoElement=view.querySelector(".selectedItemInfoInner"),this.enableBackMenu=!0}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["css!home_horiz/home.css"]),Object.assign(HomeView.prototype,_tabbedview.default.prototype),HomeView.prototype.getTabs=function(){var items=this.item.UserViews;return function(instance){if(!instance.tabsCreated){instance.tabsCreated=!0;for(var html="",i=0,length=instance.item.UserViews.length;i<length;i++)html+='<div style="overflow:hidden;" class="tabContent tabContent-positioned home-horiz-tabContent flex focuscontainer-x" data-index="'+i+'"></div>';instance.view.insertAdjacentHTML("afterbegin",html)}}(this),items.map(function(i){return{name:i.Name,id:i.Id+"_"+(i.CollectionType||"")}})},HomeView.prototype.getAutoBackdropItemTypes=function(){return["Movie","Series","Game","Book"]},HomeView.prototype.fetchItem=function(){var apiClient=_connectionmanager.default.currentApiClient();return apiClient.getUserViews({},apiClient.getCurrentUserId()).then(function(result){return{UserViews:result.Items||result}})},HomeView.prototype.setTitle=function(){},HomeView.prototype.loadTabController=function(id){switch(id.split("_")[1]){case"homevideos":case"musicvideos":return Emby.importModule("./home_horiz/views.videos.js");case"movies":return Emby.importModule("./home_horiz/views.movies.js");case"music":case"audiobooks":return Emby.importModule("./home_horiz/views.music.js");case"tvshows":return Emby.importModule("./home_horiz/views.tv.js");case"livetv":return Emby.importModule("./home_horiz/views.livetv.js");default:return Emby.importModule("./modules/tabbedview/folderstab.js")}},HomeView.prototype.getTabControllerParams=function(id){var params=_tabbedview.default.prototype.getTabControllerParams.apply(this,arguments);return id=id.split("_")[0],params.parentId=id,params},HomeView.prototype.getTabControllerOptions=function(id){var _this$item,options=_tabbedview.default.prototype.getTabControllerOptions.apply(this,arguments);return id=id.split("_")[0],options.item=null==(_this$item=this.item)?void 0:_this$item.UserViews.filter(function(i){return i.Id===id})[0],options},HomeView.prototype.supportsHorizontalTabScroll=function(){return!0},HomeView.prototype.tabScrollDirection=function(){return"x"},HomeView.prototype.onWindowInputCommand=function(e){"home"===e.detail.command?(_maintabsmanager.default.selectedTabIndex(0),e.preventDefault()):_tabbedview.default.prototype.onWindowInputCommand.apply(this,arguments)};_exports.default=HomeView});