(window.webpackJsonp=window.webpackJsonp||[]).push([[104],{861:function(e,t,n){"use strict";n.r(t);n(22),n(43),n(84),n(83),n(57),n(15),n(8),n(34),n(59),n(63),n(58);var r=n(7);n(29),n(17);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,a){if(e){if("string"==typeof e)return l(e,a);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(e,a):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,c=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw c}}}}function l(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,n=Array(a);t<a;t++)n[t]=e[t];return n}var c={props:{value:Boolean,libraryItem:{type:Object,default:function(){}},episodes:{type:Array,default:function(){return[]}}},data:function(){return{hardDeleteFile:!1,processing:!1}},watch:{value:function(e){e&&(this.hardDeleteFile=!1)}},computed:{show:{get:function(){return this.value},set:function(e){this.$emit("input",e)}},episode:function(){return 1===this.episodes.length?this.episodes[0]:null},title:function(){return this.episodes.length>1?this.$getString("HeaderRemoveEpisodes",[this.episodes.length]):this.$strings.HeaderRemoveEpisode},btnText:function(){return this.hardDeleteFile?this.$strings.ButtonDelete:this.$strings.ButtonRemove},episodeTitle:function(){return this.episode?this.episode.title:null}},methods:{submit:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var n,r,l,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.processing=!0,n=e.hardDeleteFile?"?hard=1":"",r=o(e.episodes),t.prev=3,r.s();case 5:if((l=r.n()).done){t.next=17;break}return c=l.value,t.next=9,e.$axios.$delete("/api/podcasts/".concat(e.libraryItem.id,"/episode/").concat(c.id).concat(n)).then((function(){return!0})).catch((function(t){var n=t.response&&t.response.data?t.response.data:"Failed to remove episode";return console.error("Failed to remove episode",t),e.$toast.error(n),!1}));case 9:if(t.sent){t.next=15;break}return e.processing=!1,e.show=!1,e.$emit("clearSelected"),t.abrupt("return");case 15:t.next=5;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(3),r.e(t.t0);case 22:return t.prev=22,r.f(),t.finish(22);case 25:e.processing=!1,e.show=!1,e.$emit("clearSelected");case 28:case"end":return t.stop()}}),t,null,[[3,19,22,25]])})))()}},mounted:function(){}},d=n(4),component=Object(d.a)(c,(function(){var e=this,t=e._self._c;return t("modals-modal",{attrs:{name:"podcast-episode-remove-modal",width:500,height:"unset",processing:e.processing},scopedSlots:e._u([{key:"outer",fn:function(){return[t("div",{staticClass:"absolute top-0 left-0 p-5 w-2/3 overflow-hidden"},[t("p",{staticClass:"text-3xl text-white truncate"},[e._v(e._s(e.title))])])]},proxy:!0}]),model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[e._v(" "),t("div",{ref:"wrapper",staticClass:"px-8 py-6 w-full text-sm rounded-lg bg-bg shadow-lg border border-black-300 relative overflow-hidden"},[t("div",{staticClass:"mb-4"},[e.episode?t("p",{staticClass:"text-lg text-gray-200 mb-4"},[e._v("\n        "+e._s(e.$getString("MessageConfirmRemoveEpisode",[e.episodeTitle]))+"\n      ")]):t("p",{staticClass:"text-lg text-gray-200 mb-4"},[e._v(e._s(e.$getString("MessageConfirmRemoveEpisodes",[e.episodes.length])))]),e._v(" "),t("p",{staticClass:"text-xs font-semibold text-warning/90"},[e._v(e._s(e.$strings.MessageConfirmRemoveEpisodeNote))])]),e._v(" "),t("div",{staticClass:"flex justify-between items-center pt-4"},[t("ui-checkbox",{attrs:{label:e.$strings.LabelHardDeleteFile,"check-color":"error","checkbox-bg":"bg",small:"","label-class":"text-base text-gray-200 pl-3"},model:{value:e.hardDeleteFile,callback:function(t){e.hardDeleteFile=t},expression:"hardDeleteFile"}}),e._v(" "),t("ui-btn",{on:{click:e.submit}},[e._v(e._s(e.btnText))])],1)])])}),[],!1,null,null,null);t.default=component.exports;installComponents(component,{UiCheckbox:n(184).default,UiBtn:n(42).default,ModalsModal:n(39).default})}}]);