1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7154],{2142:(e,t,a)=>{a.d(t,{useAppConfiguration:()=>i});var r=a(50549),o=a(23691);let i=()=>{let e=(0,r.useContext)(o.B);if(!e)throw Error("useAppConfiguration must be used within an AppConfigProvider");return{...e,resertSettings:()=>{document.cookie="alias=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"}}}},3392:(e,t,a)=>{a.d(t,{x:()=>l});var r=a(64721),o=a(61177);let i=(0,a(13700).F)(["object-cover","inset-0","absolute","h-full","w-full"],{variants:{variant:{top:["bg-fade-top"],bottom:["bg-fade-bottom"],left:["bg-fade-left"],right:["bg-fade-right"],"top-half":["bg-fade-top-half"],"bottom-half":["bg-fade-bottom-half"],"left-half":["bg-fade-left-half"],"right-half":["bg-fade-right-half"]}},defaultVariants:{variant:"bottom"}}),l=e=>{let{className:t,variant:a,...l}=e;return(0,r.jsx)("div",{className:(0,o.cn)(i({variant:a}),t),...l})}},4871:(e,t,a)=>{a.d(t,{T:()=>o});var r=a(50549);let o=()=>{let[e,t]=(0,r.useState)(!1),a=(0,r.useRef)(null),o=(0,r.useRef)(null),i=(0,r.useCallback)(()=>(o.current||(o.current=new IntersectionObserver(e=>{let a=e[0];a&&(a.isIntersecting&&a.intersectionRatio>0?t(!0):t(!1))},{root:null,rootMargin:"100px",threshold:[0,.1,.5,1]})),o.current),[]),l=(0,r.useCallback)(e=>{a.current&&o.current&&o.current.unobserve(a.current),a.current=e,e&&(i().observe(e),setTimeout(()=>{if(!a.current)return;let e=a.current.getBoundingClientRect();e.top<window.innerHeight&&e.bottom>0&&t(!0)},100))},[i]);return(0,r.useEffect)(()=>()=>{o.current&&o.current.disconnect()},[]),{containerRef:l,isContainerVisible:e}}},5069:(e,t,a)=>{a.d(t,{A:()=>i});var r=a(64721),o=a(61177);let i=e=>{let{className:t=""}=e;return(0,r.jsxs)("div",{className:(0,o.cn)("flex h-screen items-center justify-center space-x-2 bg-background-primary",t),children:[(0,r.jsx)("div",{className:"h-6 w-6 animate-bounce rounded-full bg-text-highlight [animation-delay:-0.3s]"}),(0,r.jsx)("div",{className:"h-6 w-6 animate-bounce rounded-full bg-text-highlight [animation-delay:-0.15s]"}),(0,r.jsx)("div",{className:"h-6 w-6 animate-bounce rounded-full bg-text-highlight"})]})}},7961:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(64721),o=a(84970),i=a(24512),l=a(93401);let n=e=>{let{assetId:t}=e;return(0,r.jsxs)(o.Link,{href:"/video/".concat(t),className:"group/{asset} w-11","data-testid":"video-button",children:[(0,r.jsx)(l.A,{className:"hidden h-11 w-11 group-hover/{asset}:block"}),(0,r.jsx)(i.A,{className:" h-11 w-11 group-hover/{asset}:hidden"})]})}},9305:(e,t,a)=>{a.d(t,{F:()=>_});var r=a(18808),o=a(12615),i=a(42308),l=a(50549),n=a(62589),s=a(90878),c=a(1315),d=a(81385),u=a(89910);let p=c.Ik({id:c.Yj(),name:c.Yj(),assetIds:c.YO(c.Yj())}),h=c.Ik({data:c.YO(p)}),m="Watchlist-Assets",v="Watchlist-Categories",g=e=>{let{jwt:t,subprofileToken:a,key:r}=e,o={method:"POST",headers:{"content-type":"application/json",accept:"application/json",...t&&{authorization:"Bearer ".concat(t)},...a&&{"X-Vimond-Subprofile":a}},redirect:"follow",body:JSON.stringify({name:r,assetIds:[]})};return(0,d.C)("https://".concat((0,u.l)("NEXT_PUBLIC_TENANT"),".playlist.cf.").concat((0,u.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/playlists"),o).then(e=>e.json()).then(e=>h.parse(e).data[0])},f=async e=>{var t;let{jwt:a,subprofileToken:r}=e;return null!=(t=await y({jwt:a,subprofileToken:r,key:m}))?t:await (e=>{let{jwt:t,subprofileToken:a}=e;return g({jwt:t,subprofileToken:a,key:m})})({jwt:a,subprofileToken:r})},j=async e=>{var t;let{jwt:a,subprofileToken:r}=e;return null!=(t=await y({jwt:a,subprofileToken:r,key:v}))?t:await (e=>{let{jwt:t,subprofileToken:a}=e;return g({jwt:t,subprofileToken:a,key:v})})({jwt:a,subprofileToken:r})},y=async e=>{let{jwt:t,subprofileToken:a,key:r}=e;return(await (e=>{let{jwt:t,subprofileToken:a}=e;if(!t)return Promise.resolve([]);let r={"content-type":"application/json",accept:"application/json",...t&&{authorization:"Bearer ".concat(t)},...a&&{"X-Vimond-Subprofile":a}};return(0,d.C)("https://".concat((0,u.l)("NEXT_PUBLIC_TENANT"),".playlist.cf.").concat((0,u.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/playlists"),{method:"GET",headers:r,redirect:"follow"}).then(e=>e.json()).then(e=>h.parse(e).data||[])})({jwt:t,subprofileToken:a})).find(e=>e.name===r)},b=async e=>{let{jwt:t,subprofileToken:a,assetId:r}=e,o=await f({jwt:t,subprofileToken:a});if(!o)throw Error("Watchlist not found");return N({jwt:t,subprofileToken:a,key:o.id,id:r})},x=async e=>{let{jwt:t,subprofileToken:a,categoryId:r}=e,o=await j({jwt:t,subprofileToken:a});if(!o)throw Error("Watchlist not found");return N({jwt:t,subprofileToken:a,key:o.id,id:r})},N=async e=>{let{jwt:t,subprofileToken:a,key:r,id:o}=e,i={"content-type":"application/json",accept:"application/json",...t&&{authorization:"Bearer ".concat(t)},...a&&{"X-Vimond-Subprofile":a}};return(0,d.C)("https://".concat((0,u.l)("NEXT_PUBLIC_TENANT"),".playlist.cf.").concat((0,u.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/playlists/").concat(r,"/assets/").concat(o),{method:"POST",headers:i,redirect:"follow"}).then(e=>e.json()).then(e=>h.parse(e).data||[])},Y=async e=>{let{jwt:t,subprofileToken:a,assetId:r}=e,o=await f({jwt:t,subprofileToken:a});if(!o)throw Error("Watchlist not found");return I({jwt:t,subprofileToken:a,key:o.id,id:r})},w=async e=>{let{jwt:t,subprofileToken:a,categoryId:r}=e,o=await j({jwt:t,subprofileToken:a});if(!o)throw Error("Watchlist not found");return I({jwt:t,subprofileToken:a,key:o.id,id:r})},I=async e=>{let{jwt:t,subprofileToken:a,key:r,id:o}=e,i={"content-type":"application/json",accept:"application/json",...t&&{authorization:"Bearer ".concat(t)},...a&&{"X-Vimond-Subprofile":a}};return(0,d.C)("https://".concat((0,u.l)("NEXT_PUBLIC_TENANT"),".playlist.cf.").concat((0,u.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/playlists/").concat(r,"/assets/").concat(o),{method:"DELETE",headers:i,redirect:"follow"}).then(e=>e.json()).then(e=>h.parse(e).data||[])};var T=a(58595),E=a(25380);let k="pendingAssetOperations",S="pendingCategoryOperations",_=e=>{let{jwt:t}=(0,T.useAuthentication)(),{subprofileToken:a}=(0,E.useSubprofiles)(),c=(0,l.useRef)(a),d=(0,l.useMemo)(()=>["watchlist","assets"],[]),u=(0,l.useMemo)(()=>["watchlist","categories"],[]),p=(0,r.jE)(),{data:h,isLoading:m}=(0,o.I)({queryKey:d,queryFn:async()=>
1{if(!t||!a)return[];let r=await f({jwt:t,subprofileToken:a}),o=null==r?void 0:r.assetIds;if(!o)return[];let i=await (0,n.Y)({assetIds:o,locale:e});return null!=i?i:[]},enabled:!!t&&!!a}),{data:v,isLoading:g}=(0,o.I)({queryKey:u,queryFn:async()=>{if(!t||!a)return[];let r=await j({jwt:t,subprofileToken:a}),o=null==r?void 0:r.assetIds;if(!o)return[];let i=await (0,s.bW)({categoryIds:o,locale:e});return null!=i?i:[]},enabled:!!t&&!!a}),y=(0,l.useCallback)(async(e,t,a)=>{var r;if("undefined"==typeof localStorage)return;let o=Date.now(),i=JSON.parse(null!=(r=localStorage.getItem(e))?r:"{}");Object.keys(i).some(e=>i[e]&&o-i[e]>t)&&(localStorage.setItem(e,JSON.stringify({})),await a.invalidateQueries({queryKey:e===k?d:u}))},[d,u]);(0,l.useEffect)(()=>{c.current!==a&&(p.invalidateQueries({queryKey:["watchlist"]}),c.current=a)},[a,p]),(0,l.useEffect)(()=>{let e=setInterval(()=>{y(k,3e4,p),y(S,3e4,p)},5e3);return()=>clearInterval(e)},[p,y]);let N=(e,t)=>{var a;let r=JSON.parse(null!=(a=localStorage.getItem(e))?a:"{}");r[t]=Date.now(),localStorage.setItem(e,JSON.stringify(r))},I=(e,t)=>{var a;if(!t)return;let r=JSON.parse(null!=(a=localStorage.getItem(e))?a:"{}");delete r[t],localStorage.setItem(e,JSON.stringify(r))},_=(0,i.n)({mutationFn:async e=>{let{asset:r,category:o}=e;if(t&&a){if(null==r?void 0:r.id)return await b({jwt:t,subprofileToken:a,assetId:r.id});if(null==o?void 0:o.id)return await x({jwt:t,subprofileToken:a,categoryId:o.id})}},onMutate:async e=>{var t,a;let{asset:r,category:o}=e;if(null==r?void 0:r.id){await p.cancelQueries({queryKey:d});let e=null!=(t=p.getQueryData(d))?t:[],a=[r,...e.filter(e=>e.id!==r.id)];return p.setQueryData(d,a),N(k,r.id),{previousAssets:e}}if(null==o?void 0:o.id){await p.cancelQueries({queryKey:u});let e=null!=(a=p.getQueryData(u))?a:[],t=[o,...e.filter(e=>e.id!==o.id)];return p.setQueryData(u,t),N(S,o.id),{previousCategories:e}}return{}},onError:(e,t,a)=>{(null==a?void 0:a.previousAssets)&&p.setQueryData(d,a.previousAssets),(null==a?void 0:a.previousCategories)&&p.setQueryData(u,a.previousCategories)},onSettled:(e,t,a)=>{let{asset:r,category:o}=a;(null==r?void 0:r.id)&&I(k,r.id),(null==o?void 0:o.id)&&I(S,o.id)}}),P=(0,i.n)({mutationFn:async e=>{let{asset:r,category:o}=e;t&&a&&((null==r?void 0:r.id)&&await Y({jwt:t,subprofileToken:a,assetId:r.id}),(null==o?void 0:o.id)&&await w({jwt:t,subprofileToken:a,categoryId:o.id}))},onMutate:async e=>{var t,a;let{asset:r,category:o}=e;if(null==r?void 0:r.id){await p.cancelQueries({queryKey:d});let e=null!=(t=p.getQueryData(d))?t:[],a=e.filter(e=>e.id!==r.id);return p.setQueryData(d,a),N(k,r.id),{previousAssets:e}}if(null==o?void 0:o.id){await p.cancelQueries({queryKey:u});let e=null!=(a=p.getQueryData(u))?a:[],t=e.filter(e=>e.id!==o.id);return p.setQueryData(u,t),N(S,o.id),{previousCategories:e}}return{}},onError:(e,t,a)=>{(null==a?void 0:a.previousAssets)&&p.setQueryData(d,a.previousAssets),(null==a?void 0:a.previousCategories)&&p.setQueryData(u,a.previousCategories)},onSettled:(e,t,a)=>{let{asset:r,category:o}=a;(null==r?void 0:r.id)&&I(k,r.id),(null==o?void 0:o.id)&&I(S,o.id)}});return{assets:h,categories:v,isLoading:m||g,isInWatchlist:e=>{let{assetId:t,categoryId:a}=e;if(t){let e=p.getQueryData(d);if(!e)return!1;if(t)return e.some(e=>(null==e?void 0:e.id)===t)}else if(a){let e=p.getQueryData(u);if(!e)return!1;if(a)return e.some(e=>(null==e?void 0:e.id)===a)}return!1},addToWatchlist:_.mutateAsync,removeFromWatchlist:P.mutateAsync,addToWatchlistStatus:_.status,removeFromWatchlistStatus:P.status}}},17154:(e,t,a)=>{a.d(t,{Ad:()=>o.WatchListButton,YB:()=>r.AddToWatchListButton});var r=a(71913),o=a(34787);a(88826)},23241:(e,t,a)=>{a.r(t),a.d(t,{Artwork:()=>n});var r=a(64721),o=a(24581),i=a(47961),l=a(50549);let n=e=>{let{alt:t,fallbackToDefault:a,height:n,location:s="main",onLoadError:c,src:d,title:u,width:p,...h}=e,m=(0,o.$)({source:d,location:s}),[v,g]=(0,l.useState)(m),f=(0,l.useRef)(null);return d&&v?(0,r.jsx)("div",{ref:f,className:"contents",children:(0,r.jsx)(i.default,{...h,title:null!=u?u:t,alt:t,src:v,width:p,height:n,onError:()=>{if(!a||v===d){f.current&&(f.current.className="hidden"),null==c||c();return}g((0,o.$)({source:d}
1))}})}):null}},23691:(e,t,a)=>{a.d(t,{AppConfigProvider:()=>i,B:()=>o});var r=a(64721);let o=(0,a(50549).createContext)(null),i=e=>{let{authenticationEnabled:t=!0,children:a,themeBrandColor:i}=e;return(0,r.jsx)(o.Provider,{value:{authenticationEnabled:t,themeBrandColor:i},children:a})}},25380:(e,t,a)=>{a.d(t,{useSubprofiles:()=>m});var r=a(18808),o=a(12615),i=a(42308),l=a(1315),n=a(81385),s=a(89910);let c=l.Ik({subProfileId:l.Yj(),subProfileName:l.Yj(),birthDate:l.Yj().optional(),properties:l.Ik({color:l.Yj().optional()}).optional()}),d=l.Ik({data:l.YO(c).optional()});var u=a(50549),p=a(58595),h=a(73055);let m=()=>{let{jwt:e}=(0,p.useAuthentication)(),t=(0,u.useContext)(h.z);if(!t)throw Error("useSubprofiles must be used within an SubprofileProvider");let{setActiveSubprofile:a,setSubprofileToken:l}=t,c=(0,r.jE)(),m=["subprofiles"],{data:v,error:g,isLoading:f,isFetched:j}=(0,o.I)({queryKey:m,queryFn:()=>e?(e=>e?(0,n.C)("https://".concat((0,s.l)("NEXT_PUBLIC_TENANT"),".subprofile.cf.").concat((0,s.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/subprofiles"),{method:"GET",headers:{accept:"application/json",authorization:"Bearer ".concat(e)},redirect:"follow"}).then(e=>e.json()).then(e=>{var t;return null!=(t=d.parse(e).data)?t:[]}):Promise.resolve([]))(e):Promise.resolve([]),enabled:!!e}),y=(0,i.n)({mutationFn:async t=>{if(e)return((e,t)=>{let a={method:"POST",headers:{"content-type":"application/json",accept:"application/json",authorization:"Bearer ".concat(e)},body:JSON.stringify(t),redirect:"follow"};return(0,n.C)("https://".concat((0,s.l)("NEXT_PUBLIC_TENANT"),".subprofile.cf.").concat((0,s.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/subprofiles"),a).then(e=>e.json()).then(e=>e.data)})(e,t)},onSuccess:(e,t)=>{var a;let r=[...null!=(a=c.getQueryData(m))?a:[],t];c.setQueryData(m,r)}}),b=(0,i.n)({mutationFn:async t=>{if(e)return(0,n.C)("https://".concat((0,s.l)("NEXT_PUBLIC_TENANT"),".subprofile.cf.").concat((0,s.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/subprofiles/").concat(t.subProfileId),{method:"DELETE",headers:{accept:"application/json",authorization:"Bearer ".concat(e)},redirect:"follow"})},onSuccess:(e,t)=>{let a=c.getQueryData(m).filter(e=>e.subProfileId!==t.subProfileId);c.setQueryData(m,a)}}),x=(0,i.n)({mutationFn:async t=>{if(e)return((e,t)=>{let a={method:"PUT",headers:{"content-type":"application/json",accept:"application/json",authorization:"Bearer ".concat(e)},body:JSON.stringify(t),redirect:"follow"};return(0,n.C)("https://".concat((0,s.l)("NEXT_PUBLIC_TENANT"),".subprofile.cf.").concat((0,s.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/subprofiles/").concat(t.subProfileId),a).then(e=>e.json()).then(e=>e.data)})(e,t)},onSuccess(e,t){let a=c.getQueryData(m).map(e=>e.subProfileId===t.subProfileId?t:e);c.setQueryData(m,a)}}),N=async r=>{if(!e)return;let o=await (e=>{let{jwt:t,subprofile:a}=e;return(0,n.C)("https://".concat((0,s.l)("NEXT_PUBLIC_TENANT"),".subprofile.cf.").concat((0,s.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/subprofiles/").concat(a.subProfileId,"/token"),{method:"GET",headers:{accept:"application/json",authorization:"Bearer ".concat(t)},redirect:"follow"}).then(e=>e.headers.get("X-Vimond-Subprofile")).then(e=>null!=e?e:"")})({jwt:e,subprofile:r});if("web"===t.app){let e=o.split(".")[1];if(!e)return;let t=new Date(1e3*JSON.parse(atob(e)).exp);t.setMinutes(t.getMinutes()-5);let a=JSON.stringify(r);document.cookie="subprofile=".concat(a,"; path=/; Secure; SameSite=Strict");let i=JSON.stringify(o);document.cookie="subprofile_token=".concat(i,"; path=/; Secure; SameSite=Strict; expires=").concat(t)}if(a(r),l(o),"web"===t.app){let e=new URLSearchParams(window.location.search).get("returnUrl"),t="auth_redirect_url",a=sessionStorage.getItem(t);sessionStorage.removeItem(t);let r="/browse";e&&e.startsWith("/")&&!e.startsWith("//")?r=decodeURIComponent(e):a&&a.startsWith("/")&&!a.startsWith("//")&&(r=a),window.location.replace(r)}};return{...t,setActiveSubprofile:N,subprofiles:v,isSubprofilesLoading:f,isSubprofilesFetched:j,subprofilesError:g,createSubprofile:y.mutateAsync,deleteSubProfile:b.mutateAsync,updateProfile:x.mutateAsync}}},27443:(e,t,a)=>{a.d(t,{z:()=>i});var r=a(15363),o=a(89910);new r.q({max:100,ttl:864e5,ignoreFetchAbort:!0,allowStale:!0});let i=()=>{var e;return(0,o.l)("NEXT_PUBLIC_REVALIDATE_TIME_SECONDS")?parseInt(null!=(e=(0,o.l)("NEXT_PUBLIC_REVALIDATE_TIME_SECONDS"))?e:"60",10):60}},31951:(e,t,a)=>{a.d(t,{CategoryCard:()=>m});var r=a(64721),o=a(26235),i=a(17154),l=a(73020),n=a(3392),s=a(23241),c=a(54348),d=a(41454),u=a(16492),p=a(61177),h=a(94106);let m=e=>{var t,a,m,v,g,f;let{category:j,className:y,...b}=e,{t:x}=(0,o.B)(),N=(0,h.useRouter)(),Y=void 0!==j.content?j.content:j;return Y?(0,r.jsxs)("div",{onClick:()=>N.push("/category/".concat(Y.id)),className:"cursor-pointer","data-testid":"category-card-".concat(Y.id),children:[(0,r.jsxs)("article",{...b,className:(0,p.cn)("group relative mx-1 box-content max-h-full border border-background-secondary transition-all ease-in",y&&y),children:[(0,r.jsxs)("div",{className:"relative flex h-[230px] cursor-pointer flex-col",children:[(null==(t=Y.images)?void 0:t.defaultUrl)&&(0,r.jsx)(s.Artwork,{alt:"",src:null==(a=Y.images)?void 0:a.defaultUrl,location:"portal-carousel",fallbackToDefault:!0,fill:!0,sizes:"25vw",className:"object-cover"}),(0,r.jsx)(n.x,{})]}),(0,r.jsx)("div",{className:"absolute left-0 right-0 top-0 z-[100] hidden h-[230px] text-white lg:block",children:(0,r.jsxs)("div",{className:"border-background-secondary bg-background-secondary absolute bottom-0 left-0 right-0 top-0 border opacity-0 transition-all duration-300 ease-out group-hover:scale-110 group-hover:opacity-100 group-hover:delay-700",children:[(0,r.jsxs)("div",{className:"absolute hidden h-full w-full flex-col group-hover:flex",children:[(null==(m=Y.images)?void 0:m.defaultUrl)&&(0,r.jsx)(s.Artwork,{alt:"",src:Y.images.defaultUrl,location:"portal-carousel",fallbackToDefault:!0,fill:!0,sizes:"25vw",className:"object-cover"}),(0,r.jsx)(n.x,{})]}),(0,r.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-2",children:[(null==(v=Y.images)?void 0:v.defaultUrl)&&(0,r.jsx)("div",{className:"max-w-[30%]",children:(0,r.jsx)(c.s,{src:null==(g=Y.images)?void 0:g.defaultUrl})}),(0,r.jsxs)("div",{className:"flex items-center gap-1 ",children:[(0,r.jsx)(l.CategoryButton,{categoryId:Y.id}),(0,r.jsx)(i.YB,{category:Y})]}),(0,r.jsxs)("div",{className:"mx-1 mt-1 flex items-center gap-4 text-xs opacity-70",children:[Y["age-rating"]&&(0,r.jsx)(d.t,{ageRating:Y["age-rating"]}),!u.q&&Y.season&&(0,r.jsx)("span",{children:x("season",{count:Y.season})}),!u.q&&"SHOW"===Y.categoryType&&Y.children.length>0&&(0,r.jsx)("span",{children:x("seasons",{count:Y.children.length})})]}),(0,r.jsx)("div",{className:"mx-1 mt-1 w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs",children:null==(f=Y.labels)?void 0:f.split(",").map(e=>(0,r.jsx)("span",{className:"mr-1 uppercase opacity-50",children:e},e))})]})]})})]}),(0,r.jsx)("div",{className:"text-shadow mx-1 mt-2 text-left text-primary lg:mt-4",children:(0,r.jsx)("h1",{className:"lg:text-md text-sm font-bold xl:text-lg",children:Y.title})})]}):(0,r.jsx)(r.Fragment,{})}},34787:(e,t,a)=>{a.d(t,{WatchListButton:()=>u});var r=a(64721),o=a(56467),i=a(26235),l=a(84970),n=a(82480),s=a(83148),c=a(25380),d=a(46369);let u=e=>{let{active:t}=e,{t:a}=(0,i.B)(),{subprofileToken:u}=(0,c.useSubprofiles)(),{authenticationEnabled:p}=(0,o.hn)();return p&&d.s?u?(0,r.jsx)(l.Link,{href:"/browse/watchlist",className:t?"text-text-highlight":"text-white opacity-70 hover:opacity-100","data-testid":"watchlist-button",children:(0,r.jsx)(n.A,{className:"h-6 w-6"})}):(0,r.jsx)(l.Link,{href:"/auth/signin",className:"text-white opacity-70 hover:opacity-100","data-testid":"watchlist-button-login",children:(0,r.jsxs)("div",{className:"group relative cursor-pointer",title:a("you-need-to-login-before-you-can-add-content-to-your-watchlist"),children:[(0,r.jsx)(n.A,{className:" h-6 w-6"}),(0,r.jsx)(s.A,{className:"text-text-highlight absolute bottom-0 right-0 h-4 w-4"})]})}):(0,r.jsx)(r.Fragment,{})}},41454:(e,t,a)=>{a.d(t,{t:()=>o});var r=a(64721);let o=e=>{let{ageRating:t}=e;return(0,r.jsx)("span",{className:"min-w-6 rounded-md border px-2 text-center w-fit",children:t})}},42399:(e,t,a)=>{a.d(t,{q:()=>r.VideoBackdrop});var r=a(90399)},46369:(e,t,a)=>{a.d(t,{s:()=>r});let r=!1},51992:(e,t,a)=>{a.d(t,{usePlayback:()=>I});var r=a(12615),o=a(1315),i=a(81385),l=a(89910),n=a(58303),s=a.n(n);let c=o.Ik({headers:o.KC([o.YO(o.bz()),o.g1(o.Yj(),o.bz())]),uri:o.Yj()}),d=o.Ik({uri:o.Yj(),headers:o.Ik({}),certificateUrl:o.Yj().optional()}),u=o.Ik({id:o.Yj(),bitrate:o.ai(),mediaFormat:o.Yj(),mimeType:o.Yj(),manifest:c,drmProxyType:o.Yj().optional(),drm:d.optional()}),p=o.Ik({name:o.Yj(),locale:o.Yj(),audience:o.Yj(),contentType:o.Yj(),url:o.Yj()}),h=o.Ik({buildName:o.Yj(),buildVersion:o.Yj(),countryCode:o.Yj(),deviceId:o.Yj(),deviceOS:o.Yj(),deviceType:o.Yj(),drm:o.Yj(),envPlatform:o.Yj(),envVersion:o.Yj(),pageUrl:o.Yj(),platform:o.Yj(),playerEvent:o.Yj(),playerState:o.Yj(),streamUrl:o.Yj(),userAgent:o.Yj(),videoFormat:o.Yj(),videoProtocol:o.Yj(),viewingSession:o.Yj()}),m=o.Ik({duration:o.ai(),position:o.Yj()}),v=o.Ik({onLiveEdge:o.Yj(),liveResumePossible:o.Yj(),position:o.Yj()}),g=o.Ik({assetId:o.Yj(),categoryId:o.Yj(),title:o.Yj(),assetType:o.Yj(),playbackType:o.Yj(),eventNumber:o.ai(),vod:m.optional(),live:v.optional()}),f=o.Ik({title:o.Yj().optional(),type:o.Yj(),startTime:o.ai(),endTime:o.ai(),images:o.Ik({defaultUrl:o.Yj()}).optional()}),j=o.Ik({eventName:o.Yj(),originator:o.Yj(),originatorId:o.Yj(),subProfileId:o.Yj(),versions:o.YO(o.Yj()),tenant:o.Yj(),logData:o.Yj(),client:h,progress:g,timestamp:o.Yj(),eventInterval:o.ai()}),y=o.Ik({body:j,eventInterval:o.ai(),uri:o.Yj()}),b=o.Ik({assetId:o.Yj(),assetTitle:o.Yj(),categoryId:o.Yj(),startTime:o.ai(),endTime:o.ai(),duration:o.ai(),transmissionTime:o.Yj(),isDrmProtected:o.zM(),isLive:o.zM(),recommendedStream:u.optional(),alternativeStreams:o.YO(u).optional(),subtitles:o.YO(p).optional(),playerEventRequest:y.optional(),markers:o.YO(f).optional()}),x=o.Ik({title:o.Yj().optional(),detail:o.Yj().optional(),code:o.Yj().optional()}),N=o.Ik({data:o.YO(b).optional(),errors:o.YO(x).optional()});var Y=a(58595),w=a(25380);let I=(e,t,a)=>{var o,n,c;let{jwt:d}=(0,Y.useAuthentication)(),{subprofileToken:u}=(0,w.useSubprofiles)(),p=["play",e];d&&p.push(d),u&&p.push(u);let{data:h,error:m,isLoading:v}=(0,r.I)({queryKey:p,queryFn:async()=>await ((e,t,a,r,o)=>{let n=o?o.split(",")[0]:"",c={method:"POST",headers:{"content-type":"application/json",accept:"application/json","user-agent":t,...o&&{"x-forwarded-for":n},...a&&{authorization:"Bearer ".concat(a)},...r&&{"X-Vimond-Subprofile":r}},redirect:"follow",body:JSON.stringify(a?{device:(e=>({label:(e=>{var t,a,r,o,i;let l=s()(e),n=null!=(t=l.device.model)?t:"Unknown",c=null!=(a=l.os.name)?a:"Unknown",d=null!=(r=l.os.version)?r:"Unknown",u=null!=(o=l.browser.name)?o:"Unknown",p=null!=(i=l.browser.version)?i:"Unknown";return"".concat(n," ").concat(c," (").concat(d,") ").concat(u," (").concat(p,")")})(e),udid:(e=>{let t=e.replace(/[^a-z0-9]/gi,"-");return t.length>=36?t.substring(0,36):t.padEnd(36,"-")})(e)}))(t)}:{})};return(0,i.C)("https://".concat((0,l.l)("NEXT_PUBLIC_TENANT"),".play.cf.").concat((0,l.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v2/asset/").concat(e,"/play?extraFields=markers,alternativeStreams,streamsTemplate"),c).then(e=>e.json()).then(e=>N.parse(e))})(e,t,d,u)||null,initialData:a&&{data:[a]},enabled:!!e,refetchOnWindowFocus:!1});return{playback:null==h||null==(o=h.data)?void 0:o[0],error:null!=(c=null==h||null==(n=h.errors)?void 0:n[0])?c:m?{title:null==m?void 0:m.name,code:void 0,dettail:void 0}:void 0,isLoading:v}}},54348:(e,t,a)=>{a.d(t,{s:()=>n});var r=a(64721),o=a(61177),i=a(23241),l=a(89910);let n=e=>{let{className:t,fallbackToDefault:a,src:n}=e;return n&&"false"!==(0,l.l)("NEXT_PUBLIC_ARTWORK_LOGO_ENABLED")?(0,r.jsx)(i.Artwork,{src:n,alt:"",location:"thumb",fallbackToDefault:a,width:300,height:200,className:(0,o.cn)("my-3 h-auto max-w-[80%] rounded-md",t)}):null}},56467:(e,t,a)=>{a.d(t,{Nj:()=>r.AppSwitcher,hn:()=>o.useAppConfiguration});var r=a(88592),o=a(2142);a(23691)},56884:(e,t,a)=>{a.d(t,{s:()=>r});let r=e=>
1{let t=Math.floor(e),a=Math.floor(t/3600),r=Math.floor(t%3600/60),o=t%60;return a>0?"".concat(a.toString().padStart(2,"0"),":").concat(r.toString().padStart(2,"0"),":").concat(o.toString().padStart(2,"0")):"".concat(r.toString().padStart(2,"0"),":").concat(o.toString().padStart(2,"0"))}},60177:(e,t,a)=>{a.d(t,{n:()=>r});let r=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-GB",r=Date.now()-new Date(e).getTime(),o=Math.floor(r/6e4),i=Math.floor(o/60);return 0===o?t("relative-time.just-now"):o<60?t(r>0?"relative-time.minutes-ago":"relative-time.minutes-in",{count:Math.abs(o)}):i<24?t(r>0?"relative-time.hours-ago":"relative-time.hours-in",{count:Math.abs(i)}):new Date(e).toLocaleDateString(a,{day:"numeric",month:"short",year:"numeric"}).replace(/\s/g," ")}},62589:(e,t,a)=>{a.d(t,{GU:()=>I,Vd:()=>j,Y:()=>Y,qb:()=>w}),a(94106);var r=a(1315),o=a(27443),i=a(89910),l=a(81385);let n=(0,i.l)("NEXT_PUBLIC_PUBLISHER_ID"),s=(0,i.l)("NEXT_PUBLIC_DEFAULT_ASSET_SORT_BY"),c="https://".concat((0,i.l)("NEXT_PUBLIC_TENANT"),".content-discovery.cf.").concat((0,i.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v2/assets"),d=r.Ik({regions:r.YO(r.Yj()),locations:r.YO(r.Yj()),withRegion:r.Yj(),withLocation:r.Yj(),complete:r.Yj()}),u=r.Ik({defaultUrl:r.Yj(),version:r.Yj(),templates:d}),p=r.Ik({start:r.Yj().optional(),platform:r.Yj(),geoExpressions:r.YO(r.Yj())}),h=r.Ik({id:r.Yj(),name:r.Yj(),accessType:r.Yj()}),m=r.Ik({accessType:r.Yj()}),v=r.Ik({path:r.Yj().optional(),link:r.Yj(),id:r.Yj()}),g=r.Ik({available:r.YO(r.Yj()),type:r.Yj()}),f=r.Ik({id:r.Yj(),title:r.Yj().optional(),type:r.Yj(),startTime:r.ai().optional(),endTime:r.ai().optional()}),j=r.Ik({id:r.Yj(),timestamp:r.Yj(),createTime:r.Yj(),images:u.optional(),content:r.Ik({images:u.optional()}).optional(),category:v,labeledAsFree:r.zM(),drmProtected:r.zM(),duration:r.ai(),assetType:r.Yj(),aspect16x9:r.zM().optional(),isLive:r.zM(),channelNumber:r.ai().optional(),isParent:r.zM(),transmissionTime:r.Yj(),relatedAssets:r.YO(r.L5()),qualities:r.YO(r.L5()).optional(),startTime:r.ai().optional(),endTime:r.ai().optional(),version:g,publishing:p,products:r.YO(h),accessInfo:m.optional(),"publisher-id":r.ai().optional(),"description-short":r.Yj().optional(),description:r.Yj().optional(),title:r.Yj(),labels:r.Yj().optional(),people:r.Yj().optional(),tags:r.Yj().optional(),keywords:r.Yj().optional(),"age-rating":r.Yj().optional(),markers:r.YO(f).optional(),season:r.ai().optional(),episode:r.ai().optional(),adProfile:r.Yj().optional(),"reference-links":r.Yj().optional()}),y=r.Ik({numberOfHits:r.ai(),totalPages:r.ai().optional(),pageSize:r.ai().optional()}),b=r.Ik({self:r.Yj(),first:r.Yj(),last:r.Yj()}),x=r.Ik({title:r.Yj(),detail:r.Yj(),code:r.Yj()}),N=r.Ik({data:r.YO(j).optional(),meta:y.optional(),links:b.optional(),errors:r.YO(x).optional()}),Y=async e=>{let{assetIds:t,locale:a}=e,r={accept:"application/json",...a&&{"Accept-Language":a}};if((null==t?void 0:t.length)===0)return Promise.resolve(void 0);let o="id:(".concat(t.join(" "),")")+(n?" AND publisher-id:".concat(n):"");return(0,l.C)("".concat(c,"?query=").concat(o),{method:"GET",headers:r,redirect:"follow"}).then(e=>e.json()).then(e=>N.parse(e).data)},w=async e=>{let{categoryId:t,includeAssetsFromChildCategories:a,extraQueryClause:r,locale:i,page:d}=e,u={method:"GET",headers:{accept:"application/json",...i&&{"Accept-Language":i}},redirect:"follow",next:{revalidate:(0,o.z)()}},p="query=".concat((a?"category.path:".concat(t):"category.id:".concat(t))+(null!=r?r:"")+(n?" AND publisher-id:".concat(n):""))+"&extraFields=markers"+(s?"&sort=".concat(s):""),h="".concat(c,"?").concat(p);return d.number&&(h+="&page[number]=".concat(d.number)),d.size&&(h+="&page[size]=".concat(d.size)),(0,l.C)(h,u).then(e=>e.json()).then(e=>{var t,a,r,o,i;let l=N.parse(e),n=null!=(r=l.data)?r:[],s=null==(t=l.meta)?void 0:t.totalPages,c=null!=(o=null==(a=l.meta)?void 0:a.pageSize)?o:d.size,u=null!=(i=d.number)?i:1,p=s?u<s:n.length>=d.size;return{assets:n,hasMore:p,totalPages:s,pageSize:c}}).catch(e=>(console.error("Error fetching paginated assets by category",e),{assets:[],hasMore:!1,totalPages:0,pageSize:d.size}))},I=async function(e,t){let a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r={accept:"application/json",...t&&{"Accept-Language":t}},o=(0,i.l)("NEXT_PUBLIC_PUBLISHER_ID"),n=(0,i.l)("NEXT_PUBLIC_LIVE_PROGRAMS_CATEGORY_ID"),s="(".concat(e,")")+(o?" AND publisher-id:".concat(o):"");n&&(s+=" AND -category.id:".concat(n));let d=a?encodeURIComponent(s):s;return(0,l.C)("".concat(c,"?query=").concat(d,"&page[size]=50"),{method:"GET",headers:r,redirect:"follow"}).then(e=>e.json()).then(e=>{var t;let a=N.parse(e);return a.errors?(console.error("searchAssets query returned errors",a.errors),[]):null!=(t=a.data)?t:[]})}},71913:(e,t,a)=>{a.d(t,{AddToWatchListButton:()=>g});var r=a(64721),o=a(56467),i=a(26235),l=a(84970),n=a(82480),s=a(83148),c=a(84827),d=a(25380),u=a(46369),p=a(9305),h=a(27453),m=a(50549);let v=e=>{let{asset:t,category:a}=e,{t:u}=(0,i.B)(),{subprofileToken:v}=(0,d.useSubprofiles)(),{locale:g}=(0,h.useLocale)(),{addToWatchlist:f,addToWatchlistStatus:j,isInWatchlist:y,removeFromWatchlist:b,removeFromWatchlistStatus:x}=(0,p.F)(g),[N,Y]=(0,m.useState)(!1),{authenticationEnabled:w}=(0,o.hn)();if((0,m.useEffect)(()=>{"pending"===x||"pending"===j?Y(!0):Y(!1)},[x,j]),!w)return;if(!v)return(0,r.jsx)(l.Link,{href:"/auth/signin",children:(0,r.jsxs)("div",{className:"group relative cursor-pointer",title:u("you-need-to-login-before-you-can-add-content-to-your-watchlist"),children:[(0,r.jsx)(n.A,{className:" h-11 w-11"}),(0,r.jsx)(s.A,{className:"text-text-highlight absolute bottom-0 right-1 h-5 w-5"})]})});let I=async e=>{e.stopPropagation(),e.preventDefault(),await f({asset:t,category:a})},T=async e=>{e.stopPropagation(),e.preventDefault(),await b({asset:t,category:a})};return y({assetId:null==t?void 0:t.id,categoryId:null==a?void 0:a.id})?(0,r.jsxs)("div",{className:"cursor-pointer relative group h-11 w-11",onClick:T,title:u("remove-from-watchlist"),children:[(0,r.jsx)(c.A,{className:"h-11 w-11 text-primary group-hover:text-primary-dark"}),N&&(0,r.jsx)("div",{className:"absolute right-0 bottom-0 w-5 h-5 border-2 border-button-primary-border border-t-transparent roun
1ded-full animate-spin [animation-delay:-0.15s]"})]}):(0,r.jsxs)("div",{className:"cursor-pointer relative group h-11 w-11",onClick:I,title:u("add-to-watchlist"),children:[(0,r.jsx)(n.A,{className:"h-11 w-11"}),N&&(0,r.jsx)("div",{className:"absolute right-0 bottom-0 w-5 h-5 border-2 border-button-primary-border border-t-transparent rounded-full animate-spin [animation-delay:-0.15s]"})]})},g=e=>u.s?(0,r.jsx)(v,{...e}):null},73020:(e,t,a)=>{a.r(t),a.d(t,{CategoryButton:()=>s});var r=a(64721),o=a(84970),i=a(24339),l=a(63744),n=a(89910);let s=e=>{let{categoryId:t}=e;if("false"!==(0,n.l)("NEXT_PUBLIC_CATEGORY_BUTTON_ENABLED"))return(0,r.jsx)("div",{className:"group/{category} w-11","data-testid":"category-button",children:(0,r.jsxs)(o.Link,{href:"/category/".concat(t),children:[(0,r.jsx)(l.A,{className:"hidden h-11 w-11 group-hover/{category}:block"}),(0,r.jsx)(i.A,{className:" h-11 w-11 group-hover/{category}:hidden"})]})})}},73055:(e,t,a)=>{a.d(t,{SubprofileProvider:()=>l,z:()=>i});var r=a(64721),o=a(50549);let i=(0,o.createContext)(null),l=e=>{let{app:t,children:a}=e,[l,n]=(0,o.useState)(),[s,c]=(0,o.useState)();return(0,o.useEffect)(()=>{if("web"!==t)return;let e=document.cookie,a=e.split("; ").find(e=>e.startsWith("subprofile")),r=null==a?void 0:a.split("=")[1];c(a&&r?JSON.parse(r):void 0);let o=e.split("; ").find(e=>e.startsWith("subprofile_token")),i=null==o?void 0:o.split("=")[1];n(o&&i?JSON.parse(i):void 0)},[t]),(0,r.jsx)(i.Provider,{value:{app:t,subprofileToken:l,activeSubprofile:s,setSubprofileToken:n,setActiveSubprofile:c,isSelected:!!l},children:a})}},74197:(e,t,a)=>{a.d(t,{U:()=>l});var r=a(64721),o=a(79798),i=a(27453);let l=e=>{let{asset:t}=e,{locale:a}=(0,i.useLocale)(),{progress:l}=(0,o.r)(t.id,a);if(!t.duration)return(0,r.jsx)(r.Fragment,{});let n=l/t.duration*100;return(0,r.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-black bg-opacity-50",children:(0,r.jsx)("div",{className:"bg-text-highlight h-full",style:{width:n+"%"}})})}},79798:(e,t,a)=>{a.d(t,{r:()=>N});var r=a(12660),o=a.n(r),i=a(679),l=a.n(i),n=a(50549),s=a(18808),c=a(12615),d=a(42308),u=a(62589),p=a(1315),h=a(81385),m=a(89910);let v=p.Ik({position:p.Yj(),date:p.Yj(),updateTime:p.Yj()}),g=p.Ik({dates:p.YO(p.Yj()),viewCount:p.ai(),updateTime:p.Yj()}),f=p.Ik({assetId:p.Yj(),categoryId:p.Yj(),totalTime:p.Yj(),progress:v.optional(),completed:g.optional()}),j=p.Ik({title:p.Yj(),detail:p.Yj(),code:p.Yj()}),y=p.Ik({data:p.YO(f).optional(),errors:p.YO(j).optional()});var b=a(58595),x=a(25380);let N=(e,t)=>{let{viewingProgress:a,isLoadingViewingProgress:r}=(e=>{let{jwt:t}=(0,b.useAuthentication)(),{subprofileToken:a,activeSubprofile:r}=(0,x.useSubprofiles)(),[o,i]=(0,n.useState)([]),l=(0,s.jE)(),p=["progress",null==r?void 0:r.subProfileId],{data:v,error:g,isLoading:f}=(0,c.I)({queryKey:p,refetchOnWindowFocus:!1,queryFn:async()=>{var r;if(!t||!a)return[];let o=await (e=>{let{jwt:t,subprofileToken:a}=e;return(null==t?void 0:t.length)===0?(console.error("No JWT found"),Promise.resolve(void 0)):(null==a?void 0:a.length)===0?(console.error("No subprofile token found"),Promise.resolve(void 0)):"true"!==(0,m.l)("NEXT_PUBLIC_ENABLE_VIEWING_HISTORY")?Promise.resolve([]):(0,h.C)("https://".concat((0,m.l)("NEXT_PUBLIC_TENANT"),".viewing-history.cf.").concat((0,m.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/viewinghistory/progress?maxResults=20&skipOlderThan=P1M"),{method:"GET",headers:{"content-type":"application/json",accept:"application/json",authorization:"Bearer ".concat(t),"X-Vimond-Subprofile":a},redirect:"follow"}).then(e=>e.json()).then(e=>{let t=y.parse(e);if(t.errors){var a;console.error(null==(a=t.errors[0])?void 0:a.detail)}return t.data})})({jwt:t,subprofileToken:a});if(!(null==o?void 0:o.length))return[];let l=null!=(r=null==o?void 0:o.map(e=>e.assetId))?r:[];return i(await (0,u.Y)({assetIds:l,locale:e})),o},enabled:!!t&&!!a}),j=(0,d.n)({mutationFn:async e=>{if(t&&a)return(e=>{let{jwt:t,subprofileToken:a,assetId:r}=e;return(null==t?void 0:t.length)===0?(console.error("No JWT found"),Promise.resolve(void 0)):(null==a?void 0:a.length)===0?(console.error("No subprofile token found"),Promise.resolve(void 0)):(0,h.C
1)("https://".concat((0,m.l)("NEXT_PUBLIC_TENANT"),".viewing-history.cf.").concat((0,m.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/viewinghistory/").concat(r),{method:"DELETE",headers:{"content-type":"application/json",accept:"application/json",authorization:"Bearer ".concat(t),"X-Vimond-Subprofile":a},redirect:"follow"})})({jwt:t,subprofileToken:a,assetId:e})},onSuccess:(e,t)=>{let a=l.getQueryData(p).filter(e=>e.assetId!==t);l.setQueryData(p,a)}});return(0,n.useEffect)(()=>{(async()=>{await l.invalidateQueries({queryKey:["progress"]}),i(void 0)})()},[a,l]),{viewingProgress:v,assets:o,isLoadingViewingProgress:f,viewingProgressError:g,deleteVideoProgress:j.mutateAsync}})(t);return(0,n.useMemo)(()=>{var t,i;if(!e)return{isLoadingViewingProgress:r,progress:0};o().extend(l());let n=null==a||null==(i=a.find(t=>t.assetId===e))||null==(t=i.progress)?void 0:t.position;return n?{isLoadingViewingProgress:r,progress:o().duration(n).asSeconds()}:{isLoadingViewingProgress:r,progress:0}},[e,a,r])}},88517:(e,t,a)=>{a.d(t,{t:()=>l});var r=a(64721),o=a(31951),i=a(50549);let l=e=>{let{categories:t,title:a}=e;return(0,r.jsxs)("section",{className:"mx-3 p-4 lg:mx-10",children:[(0,r.jsx)("h1",{className:"my-2 text-2xl font-bold",children:a}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:null==t?void 0:t.map(e=>(0,r.jsx)(i.Suspense,{children:(0,r.jsx)(o.CategoryCard,{category:e},e.id)},e.id))})]})}},88592:(e,t,a)=>{a.d(t,{AppSwitcher:()=>n});var r=a(64721),o=a(94836),i=a(50549),l=a(2142);let n=()=>{var e;let[t,a]=i.useState(!1),{resertSettings:n}=(0,l.useAppConfiguration)();if((0,i.useEffect)(()=>{a(!0)},[]),!t)return(0,r.jsx)(r.Fragment,{});let s=null==(e=document)?void 0:e.cookie.split("; ").find(e=>e.startsWith("alias="));return s?(0,r.jsxs)("div",{className:"text-text-secondary text-center",children:[(0,r.jsxs)("div",{children:["You are currently viewing site:"," ",(0,r.jsx)("span",{className:"text-text-primary font-bold",children:s.split("=")[1]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(o.Button,{variant:"destructiveSmall",onClick:()=>{n(),window.location.href="/"},children:"Go back to default site"})})]}):(0,r.jsx)(r.Fragment,{})}},88826:(e,t,a)=>{a.d(t,{Watchlist:()=>s});var r=a(64721),o=a(5069),i=a(97219),l=a(88517),n=a(9305);let s=e=>{let{title:t}=e,{assets:a,categories:s,isLoading:c}=(0,n.F)();return c?(0,r.jsx)(o.A,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.t,{title:t,categories:s}),(0,r.jsx)(i.AssetGrid,{assets:a})]})}},90399:(e,t,a)=>{a.d(t,{VideoBackdrop:()=>v});var r=a(64721),o=a(4871),i=a(18702),l=a(55888),n=a(35154),s=a(98074),c=a(51992),d=a(89910),u=a(30627),p=a(50549);let h=(0,u.default)(()=>Promise.all([a.e(6438),a.e(9909),a.e(2537),a.e(4337),a.e(944)]).then(a.bind(a,92532)).then(e=>e.VideoJSPlayerPreview),{loadableGenerated:{webpack:()=>[92532]},ssr:!1}),m="preview-muted",v=e=>{var t,a,u;let{asset:v,heroItem:g=!1}=e,f=void 0!==v.content?v.content:v,[j,y]=(0,p.useState)(!1),[b,x]=(0,p.useState)(!1),[N,Y]=(0,p.useState)(!1),{playback:w}=(0,c.usePlayback)(f.id,window.navigator.userAgent),I=null==(t=f.markers)?void 0:t.find(e=>e.type===(0,d.l)("NEXT_PUBLIC_PREVIEW_MARKER_TYPE"));(0,p.useEffect)(()=>{let e=localStorage.getItem(m);y(null===e||"true"===e)},[]);let{containerRef:T,isContainerVisible:E}=(0,o.T)();if(!w||!I)return(0,r.jsx)(r.Fragment,{});if(!E)return(0,r.jsx)("div",{className:"absolute top-0 left-0 w-full h-full",ref:T});let k=e=>{localStorage.setItem(m,e.toString()),y(e)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"absolute top-0 left-0 w-full h-full",children:[(0,r.jsx)(p.Suspense,{fallback:(0,r.jsx)(r.Fragment,{}),children:(0,r.jsx)(h,{playback:{...w,startTime:null!=(a=null==I?void 0:I.startTime)?a:w.startTime,endTime:null!=(u=null==I?void 0:I.endTime)?u:w.endTime},forceLowQuality:!g,finished:b,muted:j,onPlaybackFinished:()=>x(!0),onPlaybackReady:()=>Y(!0),onMutedChange:e=>y(e)},w.assetId)}),i.bl&&(0,r.jsx)("div",{className:"absolute bottom-0 left-0 right-0 pointer-events-none h-1/3 bg-gradient-to-t from-black/70 via-black/30 to-transparent"})]}),N&&(0,r.jsxs)("div",{className:"absolute right-0 top-16 z-50 flex gap-4 bg-black bg-opacity-30 p-5 text-white lg:bottom-16 lg:top-auto",children:[b&&(0,r.jsx)(l.A,{className:"inline-block w-6 h-6 mr-1 text-white cursor-pointer opacity-70 hover:opacity-100",onClick:e=>{x(!1),e.preventDefault(),e.stopPropagation()}}),j?(0,r.jsx)(n.A,{className:"inline-block w-6 h-6 mr-1 text-white cursor-pointer opacity-70 hover:opacity-100",onClick:e=>{k(!1),e.preventDefault(),e.stopPropagation()}}):(0,r.jsx)(s.A,{className:"inline-block w-6 h-6 mr-1 text-white cursor-pointer opacity-70 hover:opacity-100",onClick:e=>{k(!0),e.preventDefault(),e.stopPropagation()}})]})]})}},90878:(e,t,a)=>{a.d(t,{b7:()=>p,bW:()=>v,pk:()=>g});var r=a(1315),o=a(89910),i=a(81385);let l=(0,o.l)("NEXT_PUBLIC_PUBLISHER_ID");(0,o.l)("NEXT_PUBLIC_DEFAULT_CATEGORY_SORT_BY");let n=r.Ik({regions:r.YO(r.Yj()),locations:r.YO(r.Yj()),withRegion:r.Yj(),withLocation:r.Yj(),complete:r.Yj()}),s=r.Ik({defaultUrl:r.Yj(),version:r.Yj(),templates:n}),c=r.Ik({start:r.Yj(),platform:r.Yj(),geoExpressions:r.YO(r.Yj())}),d=r.Ik({id:r.Yj(),name:r.Yj(),accessType:r.Yj()}),u=r.Ik({id:r.Yj(),timestamp:r.Yj(),images:s.optional(),categoryType:r.Yj(),parentId:r.Yj(),path:r.Yj(),children:r.YO(r.L5()),publishing:c,products:r.YO(d),"publisher-id":r.ai().optional(),"description-short":r.Yj().optional(),title:r.Yj().optional()}),p=r.Ik({id:r.Yj(),timestamp:r.Yj(),images:s.optional(),categoryType:r.Yj(),parentId:r.Yj().optional(),path:r.Yj(),children:r.YO(u),publishing:c,products:r.YO(d),"publisher-id":r.ai().optional(),"description-short":r.Yj().optional(),title:r.Yj().optional(),people:r.Yj().optional(),tags:r.Yj().optional(),labels:r.Yj().optional(),season:r.ai().optional(),"age-rating":r.Yj().optional(),"reference-links":r.Yj().optional()}),h=r.Ik({title:r.Yj(),detail:r.Yj(),code:r.Yj()}),m=r.Ik({data:r.YO(p).optional(),errors:r.YO(h).optional()}),v=async e=>{let{categoryIds:t,locale:a}=e,r={accept:"application/json",...a&&{"Accept-Language":a}};if((null==t?void 0:t.length)===0)return Promise.resolve(void 0);let n="id:(".concat(t.join(" "),")")+(l?" AND publisher-id:".concat(l):"");return(0,i.C)("https://".concat((0,o.l)("NEXT_PUBLIC_TENANT"),".content-discovery.cf.").concat((0,o.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/categories?query=").concat(n,")"),{method:"GET",headers:r,redirect:"follow"}).then(e=>e.json()).then(e=>m.parse(e).data)},g=async e=>(0,i.C)("https://".concat((0,o.l)("NEXT_PUBLIC_TENANT"),".content-discovery.cf.").concat((0,o.l)("NEXT_PUBLIC_ENVIRONMENT"),".vmnd.tv/api/v1/categories?query=").concat(e,"~ AND categoryType:(SHOW,SPORT,NEWS_PROGRAM)").concat(l?" AND publisher-id:".concat(l):"","&page[size]=50"),{method:"GET",headers:{accept:"application/json"},redirect:"follow"}).then(e=>e.json()).then(e=>{var t;let a=m.parse(e);return a.errors?(console.error("searchCategories query returned errors",a.errors),[]):null!=(t=a.data)?t:[]})},91576:(e,t,a)=>{a.d(t,{O:()=>Y});var r=a(64721),o=a(26235),i=a(74197),l=a(42399),n=a(17154),s=a(84970),c=a(7961),d=a(23241),u=a(54348),p=a(41454),h=a(92814),m=a(18702),v=a(16492),g=a(81685),f=a(61177),j=a(56884),y=a(60177),b=a(89910),x=a(94106),N=a(50549);let Y=e=>{var t,a,Y,w,I,T,E;let{asset:k,className:S,..._}=e,[P,C]=(0,N.useState)(!1),A=(0,N.useRef)(null),L=(0,x.useRouter)(),{i18n:O,t:B}=(0,o.B)(),{language:U}=O,D=void 0!==k.content?k.content:k;if(!D)return(0,r.jsx)(r.Fragment,{});let R=null==(t=D.markers)?void 0:t.some(e=>e.type===(0,b.l)("NEXT_PUBLIC_PREVIEW_MARKER_TYPE")),X=!1===D.aspect16x9;return(0,r.jsx)("div",{onClick:()=>L.push("/".concat(!m.XJ?"video":"watch","/").concat(D.id)),className:"cursor-pointer","data-testid":"video-card-".concat(D.id),children:(0,r.jsxs)("article",{..._,className:(0,f.cn)("group relative",S&&S),children:[(0,r.jsxs)("div",{className:"relative border-background-secondary mx-1 box-content border flex h-0 pb-[56%] cursor-pointer flex-col overflow-hidden rounded-lg",children:[(null==(a=D.images)?void 0:a.defaultUrl)&&(0,r.jsx)(d.Artwork,{alt:"",src:null==(Y=D.images)?void 0:Y.defaultUrl,location:"portal-carousel",fallbackToDefault:!0,fill:!0,sizes:"25vw",className:"object-cover"}),D.duration>0&&(0,r.jsx)("div",{className:"bg-black bg-opacity-55 rounded-sm absolute bottom-2 right-2 z-50 px-2",children:(0,r.jsx)("span",{className:"text-xs lg:text-sm font-bold text-white",children:(0,j.s)(D.duration)})}),(0,r.jsx)(i.U,{asset:D})]}),(0,r.jsxs)("div",{className:"mx-1 mt-2 text-left text-primary lg:mt-4","data-testid":"video-card-title",children:[(0,r.jsx)("h1",{className:"text-sm lg:text-base font-bold",children:D.title}),"true"===(0,b.l)("NEXT_PUBLIC_SHOW_PUBLISH_DATE")&&D.publishing.start&&(0,r.jsx)("div",{className:"mt-1",children:(0,r.jsx)("span",{className:"text-xs lg:text-sm",children:(0,y.n)(D.publishing.start,B,U)})})]}),(0,r.jsx)("div",{className:"absolute left-0 right-0 top-0 z-[100] hidden aspect-video lg:block",children:(0,r.jsxs)("div",{className:"border-background-secondary bg-background-secondary absolute bottom-0 left-0 right-0 top-0 border opacity-0 transition-all duration-300 ease-out group-hover:scale-110 group-hover:opacity-100 group-hover:delay-700",onMouseEnter:()=>{A.current&&(clearTimeout(A.current),A.current=null),A.current=setTimeout(()=>{C(!0)},500)},onMouseLeave:()=>{A.current&&(clearTimeout(A.current),A.current=null),C(!1)},children:[(0,r.jsxs)("div",{className:"absolute hidden h-full w-full flex-col group-hover:flex",children:[(null==(w=D.images)?void 0:w.defaultUrl)&&(0,r.jsx)(d.Artwork,{alt:"",src:D.images.defaultUrl,location:"portal-carousel",fallbackToDefault:!0,fill:!0,sizes:"25vw",className:"object-cover"}),P&&(m.d2?(0,r.jsx)(h.A,{asset:D,isVertical:X}):R&&(0,r.jsx)(l.q,{asset:D}))]}),(0,r.jsxs)("div",{className:"absolute bottom-0 left-0 right-0",children:[(null==(I=D.images)?void 0:I.defaultUrl)&&(0,r.jsx)("div",{className:"max-w-[30%]",children:(0,r.jsx)(u.s,{src:null==(T=D.images)?void 0:T.defaultUrl})}),(0,r.jsxs)("div",{className:"flex items-center gap-1 ",children:[(0,r.jsx)(s.Link,{href:"/watch/".concat(D.id),children:(0,r.jsx)(g.A,{className:"h-11 w-11"})}),(0,r.jsx)(n.YB,{asset:D}),!m.XJ&&(0,r.jsx)(c.A,{assetId:D.id})]}),(0,r.jsxs)("div",{className:"mt-1 flex items-center gap-4 text-xs opacity-70",children:[D["age-rating"]&&(0,r.jsx)(p.t,{ageRating:D["age-rating"]}),!v.q&&(0,r.jsxs)("div",{children:[D.season&&(0,r.jsxs)("span",{children:["S",D.season]}),D.episode&&(0,r.jsxs)("span",{children:["E",D.episode]})]})]}),(0,r.jsx)("div",{className:"mt-1 w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs",children:null==(E=D.labels)?void 0:E.split(",").map(e=>(0,r.jsx)("span",{className:"mr-1 uppercase opacity-50",children:e},e))})]})]})})]})})}},92814:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(64721),o=a(23241),i=a(18702);let l=e=>{var t,a;let{alt:l="Preview image",asset:n,containerClass:s="",eagerLoad:c=!1,isVertical:d=!1,onLoad:u,onPreviewError:p,previewImageClass:h=""}=e,m="content"in n&&void 0!==n.content?null==(t=n.content.images)?void 0:t.defaultUrl:null==(a=n.images)?void 0:a.defaultUrl,v=d?i.jn:i.ov;return(0,r.jsx)("div",{className:s,children:(0,r.jsx)(o.Artwork,{className:"object-cover object-center ".concat(h),src:null!=m?m:"",location:v,alt:l,fill:!0,onLoadError:p,onLoad:u,unoptimized:!0,...c?{priority:!0}:{loading:"lazy"}})})}},97219:(e,t,a)=>{a.d(t,{AssetGrid:()=>n});var r=a(64721),o=a(91576),i=a(46698),l=a(50549);let n=e=>{let{assets:t=[],fetchMoreAssets:a,hasMore:n,isFetchingMore:s,onLoadMore:c,title:d}=e,u="function"==typeof c,p=t.length||4,[h,m]=(0,l.useState)(t),[v,g]=(0,l.useState)(2),[f,j]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!0),[x,N]=(0,l.useState)(t),Y=u?t:h,w=u?!!n:y,I=u?!!s:f;u||t===x||(N(t),m(t),g(2),b(!0),j(!1));let T=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=new IntersectionObserver(async e=>{let[t]=e;if((null==t?void 0:t.isIntersecting)&&!I&&w)if(u)c();else{if(!a)return;j(!0);try{let e=await a(v);e.length<p&&b(!1),m(t=>[...t,...e]),g(e=>e+1)}catch(e){i.vF.error("Error fetching more assets:",e),b(!1)}finally{j(!1)}}},{threshold:.1,rootMargin:"100px"}),t=T.current;return t&&e.observe(t),()=>{t&&e.disconnect()}},[v,w,I,a,u,p,c]),(0,r.jsxs)("section",{className:"relative isolate mx-3 p-4 lg:mx-10","data-testid":"asset-grid",children:[d&&(0,r.jsx)("h1",{className:"my-2 text-2xl font-bold",children:d}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:null==Y?void 0:Y.map(e=>(0,r.jsx)(l.Suspense,{children:(0,r.jsx)(o.O,{asset:e})},e.id))}),(0,r.jsx)("div",{ref:T,className:"h-10 w-full","aria-hidden":"true"}),I&&(0,r.jsx)("div",{role:"status","aria-live":"polite",className:"mt-4 text-center",children:"Loading more..."})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.