define(["tabbedView","layoutManager","require","globalize","userSettings","emby-itemscontainer","emby-tabs","emby-button","emby-scroller"],function(TabbedView,layoutManager,require,globalize,userSettings){"use strict";function getDefaultTabIndex(folderId){switch(userSettings.get("landing-"+folderId)){case"suggestions":return 1;case"favorites":return 3;case"genres":return 4;case"folders":return 7;default:return 0}}function getTabs(){return[{name:globalize.translate("sharedcomponents#Shows")},{name:globalize.translate("sharedcomponents#Suggestions")},{name:globalize.translate("sharedcomponents#Upcoming")},{name:globalize.translate("sharedcomponents#Favorites")},{name:globalize.translate("sharedcomponents#Genres")},{name:globalize.translate("sharedcomponents#Networks")},{name:globalize.translate("sharedcomponents#Episodes"),enabled:!layoutManager.tv},{name:globalize.translate("sharedcomponents#Folders")}]}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function getTabController(index){if(null==index)throw new Error("index cannot be null");var depends=[];switch(index){case 0:depends.push("./series");break;case 1:depends.push("./suggestions");break;case 2:depends.push("./upcoming");break;case 3:depends.push("./favorites");break;case 4:depends.push("./genres");break;case 5:depends.push("./studios");break;case 6:depends.push("./episodes");break;case 7:depends.push("foldersTab")}var instance=this;return getRequirePromise(depends).then(function(controllerFactory){var controller=instance.tabControllers[index];if(!controller){controller=new controllerFactory(instance.view.querySelector(".tabContent[data-index='"+index+"']"),instance.params),instance.tabControllers[index]=controller}return controller})}function TVView(view,params){TabbedView.call(this,view,params)}return Object.assign(TVView.prototype,TabbedView.prototype),TVView.prototype.getTabs=getTabs,TVView.prototype.getDefaultTabIndex=getDefaultTabIndex,TVView.prototype.getTabController=getTabController,TVView});