"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[46634],{46634:function(e,t,r){r.d(t,{deleteItem:function(){return c},q:function(){return y}}),r(78557),r(90076);var n=r(11444),a=r(41177),i=r(47602),l=r(70267),o=r(5898),s=r(67430);function u(e){return(0,a.A)(e)}function c(e){var t=e.item,r=t.SeasonId||t.SeriesId||t.ParentId,a=s.tF.getApiClient(t.ServerId);return(0,i.A)(function(e){if(e.Type===n.D.Series){var t=e.RecursiveItemCount;return{title:o.Ay.translate("HeaderDeleteSeries"),text:o.Ay.translate("ConfirmDeleteSeries",t),confirmText:o.Ay.translate("DeleteEntireSeries",t),primary:"delete"}}return e.Type===n.D.BoxSet?{title:o.Ay.translate("HeaderDeleteCollection"),text:o.Ay.translate("ConfirmDeleteCollection"),confirmText:o.Ay.translate("Delete"),primary:"delete"}:e.Type===n.D.Playlist?{title:o.Ay.translate("HeaderDeletePlaylist"),text:o.Ay.translate("ConfirmDeletePlaylist"),confirmText:o.Ay.translate("Delete"),primary:"delete"}:{title:o.Ay.translate("HeaderDeleteItem"),text:o.Ay.translate("ConfirmDeleteItem"),confirmText:o.Ay.translate("Delete"),primary:"delete"}}(t)).then((function(){return a.deleteItem(t.Id).then((function(){e.navigate&&(r?l.appRouter.showItem(r,t.ServerId):l.appRouter.goHome())}),(function(e){var t=function(){return Promise.reject(e)};return u(o.Ay.translate("ErrorDeletingItem")).then(t,t)}))}))}function y(e){return(0,i.A)({title:o.Ay.translate("HeaderDeleteLyrics"),text:o.Ay.translate("ConfirmDeleteLyrics"),confirmText:o.Ay.translate("Delete"),primary:"delete"}).then((function(){var t=s.tF.getApiClient(e.ServerId);return t.ajax({url:t.getUrl("Audio/"+e.Id+"/Lyrics"),type:"DELETE"}).catch((function(e){var t=function(){return Promise.reject(e)};return u(o.Ay.translate("ErrorDeletingLyrics")).then(t,t)}))}))}}}]);