define(["../list/list","inputManager","commandProcessor","mainTabsManager","cardBuilder","globalize","appRouter","scripts/taskbutton","dom","layoutManager","loading","listViewStyle","flexStyles","emby-itemscontainer","material-icons","emby-linkbutton","emby-button"],function(ListPage,inputManager,commandProcessor,mainTabsManager,cardBuilder,globalize,appRouter,taskButton,dom,layoutManager,loading){"use strict";function getTabs(){var list=[{href:"livetvsetup/livetvstatus.html",name:globalize.translate("Setup")}];return ApiClient.isMinServerVersion("4.6.0.44")&&list.push({href:"livetvsetup/channels",name:globalize.translate("Channels")}),list.push({href:"livetvsetup/livetvsettings.html",name:globalize.translate("Advanced")}),list}function LiveTVSetupView(view,params){params.serverId=ApiClient.serverId(),view.classList.add("withTabs"),view.setAttribute("style","padding-top:0!important;"),this.supportsPlayback=!1,this.supportsViewSettings=!1,this.enableTotalRecordCountDisplay=!1;var itemsContainer=view.querySelector(".itemsContainer");itemsContainer.setAttribute("data-monitor","ChannelManagementInfoUpdated"),itemsContainer._addOnChangeListener=!0,ListPage.apply(this,arguments),itemsContainer.addEventListener("action-null",function(e){var item=e.detail.item;if(item.Disabled)return;commandProcessor.executeCommand("edit",item,{}).then(function(){e.target.closest(".itemsContainer").notifyRefreshNeeded(!0)})}.bind(this))}return Object.assign(LiveTVSetupView.prototype,ListPage.prototype),LiveTVSetupView.prototype.onResume=function(options){ListPage.prototype.onResume.apply(this,arguments),mainTabsManager.setTabs(this,1,getTabs)},LiveTVSetupView.prototype.onPause=function(){ListPage.prototype.onPause.apply(this,arguments)},LiveTVSetupView.prototype.getApiClientQueryMethodName=function(){return"getLiveTvChannelsForManagement"},LiveTVSetupView.prototype.getItems=function(query){return ListPage.prototype.getItems.apply(this,arguments)},LiveTVSetupView.prototype.getListViewOptions=function(items,settings){var options=ListPage.prototype.getListViewOptions.apply(this,arguments),enableDragReordering=!this.getQueryInfo().hasFilters;return options=Object.assign(options,{multiSelect:!1,action:layoutManager.tv?"menu":"custom",fields:["ChannelDisabledCheckbox","ChannelNameAndNumber","MappedChannelInfo"],draggable:enableDragReordering,dragHandle:enableDragReordering,image:!0})},LiveTVSetupView.prototype.getCardOptions=function(items,settings){var options=ListPage.prototype.getCardOptions.apply(this,arguments);return options=Object.assign(options,{centerText:!0,overlayText:!1,showParentTitle:!1,draggable:!1,multiSelect:!1,action:layoutManager.tv?"menu":"custom",fields:["Name"]})},LiveTVSetupView.prototype.getSettingsKey=function(){return"managechannels"},LiveTVSetupView.prototype.getSortMenuOptions=function(){return[]},LiveTVSetupView.prototype.getVisibleFilters=function(){return["ChannelMappingStatus"]},LiveTVSetupView.prototype.setTitle=function(){},LiveTVSetupView.prototype.getVisibleViewSettings=function(){return{settings:[],fields:[]}},LiveTVSetupView.prototype.getViewSettingDefaults=function(){var viewSettings=ListPage.prototype.getViewSettingDefaults.apply(this,arguments);return viewSettings.imageType="list",viewSettings},LiveTVSetupView});