define(["exports","./../list/list.js","./../modules/common/globalize.js","./../modules/emby-elements/emby-input/emby-input.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-elements/emby-button/paper-icon-button-light.js","./../modules/emby-elements/emby-checkbox/emby-checkbox.js","./../modules/emby-elements/emby-select/emby-select.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/approuter.js","./../modules/layoutmanager.js","./../modules/common/servicelocator.js","./../modules/actionsheet/actionsheet.js","./notificationeditor.js","./../modules/common/pluginmanager.js","./usernotificationcontroller.js"],function(_exports,_list,_globalize,_embyInput,_embyButton,_paperIconButtonLight,_embyCheckbox,_embySelect,_embyScroller,_approuter,_layoutmanager,_servicelocator,_actionsheet,_notificationeditor,_pluginmanager,_usernotificationcontroller){function getEventTypes(instance){return instance.getApiClient().getNotificationTypes({userId:instance.getUserId()})}function mapService(service){return service.Icon||(service.Icon="notifications"),service}function addEntryWithService(instance,service){getEventTypes(instance).then(function(allEventTypes){!function(instance,service){var apiClient=instance.getApiClient();return apiClient.getJSON(apiClient.getUrl("Notifications/Services/Defaults",{UserId:instance.getUserId(),NotifierKey:service.Id}))}(instance,service).then(function(entry){var url,apiClient=instance.getApiClient();require([(url=entry.SetupModuleUrl,_pluginmanager.default.getConfigurationResourceUrl(url))],function(entryFormEditor){(new _notificationeditor.default).show({entry:entry,apiClient:apiClient,eventTypes:allEventTypes,entryFormEditor:entryFormEditor,userId:instance.getUserId()})})})})}function showNewItemDialog(e){var instance=this,apiClient=instance.getApiClient();return apiClient.getJSON(apiClient.getUrl("Notifications/Services",{UserId:instance.getUserId()})).then(function(services){return apiClient.getCurrentUser().then(function(currentUser){currentUser=currentUser.Policy.IsAdministrator&&_servicelocator.appHost.supports("serversetup")?_globalize.default.translate("ForAdditionalNotificationOptions",'',""):_globalize.default.translate("ForAdditionalNotificationOptions","","");return _actionsheet.default.show({positionTo:e.target.closest("button"),positionY:"bottom",items:services.map(mapService),title:_globalize.default.translate("AddNotification"),bottomText:currentUser,hasItemIcon:!0}).then(function(id){id=function(services,id){return services.filter(function(i){return i.Id===id})[0]}(services,id);addEntryWithService(instance,id)})})})}function UserNotificationsView(view,params){this.enableAlphaNumericShortcuts=!1,this.enableTotalRecordCountDisplay=!1,this.hasOtherViewButtons=!0,this.supportsViewSettings=!1,_list.default.apply(this,arguments),function(instance,view){var container=view.querySelector(".itemsViewSettingsContainer");container.classList.add("justify-content-flex-start","readOnlyContent"),container.classList.remove("justify-content-center"),container.style.justifyContent="flex-start",view.querySelector(".listTotalRecordCount").insertAdjacentHTML("afterend",'
'+_globalize.default.translate("NotificationsDescription")+'