"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[21152],{21152:function(e,t,r){r.r(t),r.d(t,{default:function(){return d}}),r(77575);var n=r(24468),a=r(58782),o=r(46782),i=r(56869),s=r(80633),l=r(89100);function c(){return!o.A.desktop}function d(e,t,r){var d,u,m=this;r.querySelector("#upcomingRecordings .recordingItems").addEventListener("timercancelled",(function(){m.preRender(),m.renderTab()})),m.preRender=function(){d=ApiClient.getLiveTvRecordings({UserId:l.default.getCurrentUserId(),IsInProgress:!0,Fields:"CanDelete,PrimaryImageAspectRatio",EnableTotalRecordCount:!1,EnableImageTypes:"Primary,Thumb,Backdrop"}),u=ApiClient.getLiveTvTimers({IsActive:!1,IsScheduled:!0})},m.renderTab=function(){var e;i.Ay.show(),e=r,d.then((function(t){!function(e,t,r){t.length?e.classList.remove("hide"):e.classList.add("hide");var i=e.querySelector(".recordingItems");c()?(i.classList.add("scrollX"),o.A.tv&&i.classList.add("smoothScrollX"),i.classList.add("hiddenScrollX"),i.classList.remove("vertical-wrap")):(i.classList.remove("scrollX"),i.classList.remove("smoothScrollX"),i.classList.remove("hiddenScrollX"),i.classList.add("vertical-wrap")),i.innerHTML=n.default.getCardsHtml(Object.assign({items:t,shape:c()?"autooverflow":"auto",showTitle:!0,showParentTitle:!0,coverImage:!0,cardLayout:!1,centerText:!0,allowBottomPadding:!c(),preferThumb:"auto"},r||{})),a.default.lazyChildren(i)}(e.querySelector("#activeRecordings"),t.Items,{shape:c()?"autooverflow":"auto",defaultShape:(0,s.UI)(c()),showParentTitle:!1,showParentTitleOrTitle:!0,showTitle:!0,showAirTime:!0,showAirEndTime:!0,showChannelName:!0,coverImage:!0,overlayText:!1,overlayMoreButton:!0})})),function(e,t){t.then((function(t){!function(e,t,r){LiveTvHelpers.getTimersHtml(t,void 0).then((function(t){var r=e;t?r.classList.remove("hide"):r.classList.add("hide"),r.querySelector(".recordingItems").innerHTML=t,a.default.lazyChildren(r)}))}(e.querySelector("#upcomingRecordings"),t.Items),i.Ay.hide()}))}(r,u)}}r(10353),r(1177),r(22777)},22777:function(e,t,r){r(29305),r(32733),r(84701),r(69892),r(44962),r(86584),r(89336),r(78557),r(90076),r(95021),r(73687),r(83994),r(82367);var n=r(24468),a=r(46782),o=r(80633),i=r(98320);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(){return!a.A.desktop}window.LiveTvHelpers={getTimersHtml:function(e,t){t=t||{};var r,c=[],d="",u=[],m=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}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 o,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw o}}}}(e.map((function(e){return e.Type="Timer",e})));try{for(m.s();!(r=m.n()).done;){var h=r.value,f="";if(!1!==t.indexByDate&&h.StartDate)try{var v=i.Ay.parseISO8601Date(h.StartDate,!0);f=i.Ay.toLocaleDateString(v,{weekday:"long",month:"short",day:"numeric"})}catch(e){console.error("error parsing premiereDate:"+h.StartDate+"; error: "+e)}f!=d?(u.length&&c.push({name:d,items:u}),d=f,u=[h]):u.push(h)}}catch(e){m.e(e)}finally{m.f()}u.length&&c.push({name:d,items:u});for(var p="",y=0,g=c;y<g.length;y++){var T=g[y];if(T.name&&(p+='<div class="verticalSection">',p+='<h2 class="sectionTitle sectionTitle-cards padded-left">'+T.name+"</h2>"),l()){var w="scrollX hiddenScrollX";a.A.tv&&(w+=" smoothScrollX"),p+='<div is="emby-itemscontainer" class="itemsContainer '+w+' padded-left padded-right">'}else p+='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap padded-left padded-right">';p+=n.default.getCardsHtml({items:T.items,shape:(0,o.UI)(l()),showTitle:!0,showParentTitleOrTitle:!0,showAirTime:!0,showAirEndTime:!0,showChannelName:!1,cardLayout:!0,centerText:!1,action:"edit",cardFooterAside:"none",preferThumb:!0,defaultShape:null,coverImage:!0,allowBottomPadding:!1,overlayText:!1,showChannelLogo:!0}),p+="</div>",T.name&&(p+="</div>")}return Promise.resolve(p)}}}}]);