"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[27962,32762,96084],{42667:function(e,n,t){t.r(n);var r=t(62540),a=t(63696),o=t(9055),u=t(5898),i=t(89166),l=t(46782),c=t(7397),s=(t(79845),t(10353),t(41765),function(e,n,t,r){return new(t||(t=Promise))((function(a,o){function u(e){try{l(r.next(e))}catch(e){o(e)}}function i(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(u,i)}l((r=r.apply(e,n||[])).next())}))}),f=function(e,n){var t,r,a,o,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function i(i){return function(l){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(u=0)),u;)try{if(t=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((a=(a=u.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){u.label=i[1];break}if(6===i[0]&&u.label<a[1]){u.label=a[1],a=i;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(i);break}a[2]&&u.ops.pop(),u.trys.pop();continue}i=n.call(e,u)}catch(e){i=[6,e],r=0}finally{t=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};n.default=function(){var e,n=function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,a,o=t.call(e),u=[];try{for(;(void 0===n||n-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(a)throw a.error}}return u}((0,o.ok)(),1)[0],d=parseInt(null!==(e=n.get("tab"))&&void 0!==e?e:"0",10),b=(0,a.useMemo)((function(){return s(void 0,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return[4,Promise.all([t.e(45642),t.e(45568),t.e(73233),t.e(40367)]).then(t.bind(t,73233))];case 1:return[2,e.sent().default]}}))}))}),[]),v=(0,a.useMemo)((function(){return t.e(25091).then(t.bind(t,25091))}),[]),h=(0,a.useRef)(),m=(0,a.useMemo)((function(){return[]}),[]),p=(0,a.useRef)(null),y=function(){return[{name:u.Ay.translate("Home")},{name:u.Ay.translate("Favorites")}]},k=function(){var e;return null===(e=p.current)||void 0===e?void 0:e.querySelectorAll(".tabContent")},w=(0,a.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,r=n.default,a=m[e];return a||(a=new r(null===(t=p.current)||void 0===t?void 0:t.querySelector(".tabContent[data-index='"+e+"']"),null),m[e]=a),a}))}),[m]),x=(0,a.useCallback)((function(e,n){w(e).then((function(e){var t=!e.refreshed;e.onResume({autoFocus:null==n&&l.A.tv,refresh:t}),e.refreshed=!0,h.current=e})).catch((function(e){console.error("[Home] failed to get tab controller",e)}))}),[w]),g=(0,a.useCallback)((function(e){var n=parseInt(e.detail.selectedTabIndex,10),t=e.detail.previousIndex,r=null==t?null:m[t];(null==r?void 0:r.onPause)&&r.onPause(),x(n,t)}),[x,m]),C=(0,a.useCallback)((function(){return s(void 0,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return[4,v];case 1:return e.sent().setTabs(p.current,d,y,k,null,g,!1),[2]}}))}))}),[d,v,g]),P=(0,a.useCallback)((function(){return s(void 0,void 0,void 0,(function(){var e;return f(this,(function(n){switch(n.label){case 0:return s(void 0,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return[4,b];case 1:return e.sent().setTitle(null),[2]}}))})),(0,i.gJ)(),(e=h.current)?[3,2]:[4,v];case 1:return n.sent().selectedTabIndex(d),[3,3];case 2:(null==e?void 0:e.onResume)&&e.onResume({}),n.label=3;case 3:return document.querySelector(".skinHeader").classList.add("noHomeButtonHeader"),[2]}}))}))}),[d,v]),T=(0,a.useCallback)((function(){var e=h.current;(null==e?void 0:e.onPause)&&e.onPause(),document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")}),[]);return(0,a.useEffect)((function(){return C(),P(),function(){T()}}),[T,P,C]),(0,r.jsx)("div",{ref:p,children:(0,r.jsxs)(c.A,{id:"indexPage",className:"mainAnimatedPage homePage libraryPage allLibraryPage backdropPage pageWithAbsoluteTabs withTabs",isBackButtonEnabled:!1,backDropType:"movie,series,book",children:[(0,r.jsx)("div",{className:"tabContent pageTabContent",id:"homeTab","data-index":"0",children:(0,r.jsx)("div",{className:"sections"})}),(0,r.jsx)("div",{className:"tabContent pageTabContent",id:"favoritesTab","data-index":"1",children:(0,r.jsx)("div",{className:"sections"})})]})})}}}]);