"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[27962,96084,32762],{42667:function(e,n,t){t.r(n);var a=t(62540),o=t(63696),r=t(9055),u=t(9482),l=t(73233),i=t(89166),s=t(46782),c=t(25091),d=(t(79845),t(10353),t(41765),t(7397));n.default=function(){var e,n=function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var a,o,r=t.call(e),u=[];try{for(;(void 0===n||n-- >0)&&!(a=r.next()).done;)u.push(a.value)}catch(e){o={error:e}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return u}((0,r.ok)(),1)[0],v=parseInt(null!==(e=n.get("tab"))&&void 0!==e?e:"0",10),f=(0,o.useRef)(),b=(0,o.useMemo)((function(){return[]}),[]),h=(0,o.useRef)(null),m=function(){return[{name:u.Ay.translate("Home")},{name:u.Ay.translate("Favorites")}]},p=function(){var e;return null===(e=h.current)||void 0===e?void 0:e.querySelectorAll(".tabContent")},k=(0,o.useCallback)((function(e){if(null==e)throw new Error("index cannot be null");var n="";switch(e){case 0:n="hometab";break;case 1:n="favorites"}return t(7062)("./".concat(n)).then((function(n){var t,a=n.default,o=b[e];return o||(o=new a(null===(t=h.current)||void 0===t?void 0:t.querySelector(".tabContent[data-index='"+e+"']"),null),b[e]=o),o}))}),[b]),y=(0,o.useCallback)((function(){b&&b.forEach((function(e){e.destroy&&e.destroy()})),f.current=null}),[b]),w=(0,o.useCallback)((function(e,n){k(e).then((function(e){var t=!e.refreshed;e.onResume({autoFocus:null==n&&s.A.tv,refresh:t}),e.refreshed=!0,f.current=e})).catch((function(e){console.error("[Home] failed to get tab controller",e)}))}),[k]),C=(0,o.useCallback)((function(e){var n=parseInt(e.detail.selectedTabIndex,10),t=e.detail.previousIndex,a=null==t?null:b[t];(null==a?void 0:a.onPause)&&a.onPause(),w(n,t)}),[w,b]),g=(0,o.useCallback)((function(){l.default.setTitle(null),(0,i.gJ)();var e=f.current;e?(null==e?void 0:e.onResume)&&e.onResume({}):c.selectedTabIndex(v),document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")}),[v]),E=(0,o.useCallback)((function(){var e=f.current;(null==e?void 0:e.onPause)&&e.onPause(),document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")}),[]);return(0,o.useEffect)((function(){return c.setTabs(h.current,v,m,p,null,C,!1),g(),function(){E()}}),[v,E,g,C,y]),(0,a.jsx)("div",{ref:h,children:(0,a.jsxs)(d.A,{id:"indexPage",className:"mainAnimatedPage homePage libraryPage allLibraryPage backdropPage pageWithAbsoluteTabs withTabs",isBackButtonEnabled:!1,backDropType:"movie,series,book",children:[(0,a.jsx)("div",{className:"tabContent pageTabContent",id:"homeTab","data-index":"0",children:(0,a.jsx)("div",{className:"sections"})}),(0,a.jsx)("div",{className:"tabContent pageTabContent",id:"favoritesTab","data-index":"1",children:(0,a.jsx)("div",{className:"sections"})})]})})}},7397:function(e,n,t){var a=t(62540),o=t(63696),r=t(62156);n.A=function(e){var n=e.children,t=e.id,u=e.className,l=void 0===u?"":u,i=e.title,s=e.isBackButtonEnabled,c=void 0===s||s,d=e.isMenuButtonEnabled,v=void 0!==d&&d,f=e.isNowPlayingBarEnabled,b=void 0===f||f,h=e.isThemeMediaSupported,m=void 0!==h&&h,p=e.backDropType,k=(0,o.useRef)(null);return(0,o.useEffect)((function(){r.A.hideView()}),[]),(0,o.useEffect)((function(){var e,n,t,a,o={bubbles:!0,cancelable:!1,detail:{isRestored:!1,options:{enableMediaControl:b,supportsThemeMedia:m}}};null===(e=k.current)||void 0===e||e.dispatchEvent(new CustomEvent("viewbeforeshow",o)),null===(n=k.current)||void 0===n||n.dispatchEvent(new CustomEvent("pagebeforeshow",o)),null===(t=k.current)||void 0===t||t.dispatchEvent(new CustomEvent("viewshow",o)),null===(a=k.current)||void 0===a||a.dispatchEvent(new CustomEvent("pageshow",o))}),[k,b,m]),(0,a.jsx)("div",{ref:k,id:t,"data-role":"page",className:"page ".concat(l),"data-title":i,"data-backbutton":c,"data-menubutton":v,"data-backdroptype":p,children:n})}}}]);