"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6332],{8642:(e,t,a)=>{a.d(t,{i:()=>i});var s=a(95155),n=a(5242),r=a(12115);let l={default:{x:0,transition:{x:{stiffness:1e3,velocity:-100}}},hover:{x:-10,scale:1.05,transition:{x:{stiffness:1e3}},delay:.3}};function i(e){let{index:t}=e,[a,i]=(0,r.useState)(!1);return(0,s.jsx)(n.P.div,{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),initial:!1,animate:a?"hover":"default",className:"group relative mr-2 max-w-64",children:(0,s.jsxs)("div",{className:"flex items-baseline",children:[(0,s.jsx)(n.P.p,{variants:l,className:"-z-10 -mr-3 text-8xl font-bold text-primary sm:text-9xl ".concat(!a&&"text-outline"),children:t<9?(0,s.jsx)("span",{className:"letter-shadow-r",children:t+1}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"letter-shadow-r",children:(t+1)/10}),(0,s.jsx)("span",{className:"letter-shadow-r -ml-5",children:"0"})]})}),(0,s.jsx)("div",{className:"h-[225px] w-[150px] rounded-xl bg-base-100"}),(0,s.jsx)("div",{className:"absolute inset-0 ml-auto grid h-[225px] w-[150px] place-content-center rounded-xl bg-transparent transition-colors ease-in-out",children:(0,s.jsx)("div",{className:"grid h-10 w-10 place-content-center",children:(0,s.jsx)("span",{className:"loading loading-spinner text-primary"})})})]})})}},46332:(e,t,a)=>{a.r(t),a.d(t,{ContentRow:()=>j});var s=a(95155),n=a(12115),r=a(6874),l=a.n(r),i=a(89863),o=a(19619),c=a(52596),d=a(14549);function x(e){let{title:t,name:a,poster_path:n,media_type:r,id:x,index:p,contentType:h,bigCard:u}=e;return(0,s.jsx)(o.FadeInContent,{duration:1,delay:!0,index:p>20?p-(p-20)*2:p,scale:1.05,classCSS:(0,c.A)("group relative overflow-hidden rounded-xl ring-primary hover:ring-2",u?"max-w-[275px]":"max-w-[200px]"),children:(0,s.jsxs)(l(),{href:"/".concat(r||h,"/").concat(x),"aria-label":"Link to details of ".concat(t||a),children:[(0,s.jsx)(i.FadeInImage,{src:n,type:"poster",alt:"Poster de ".concat(t||a),title:t||a,width:275,height:412.5,classCSS:"".concat(u?"h-[412.5px] w-[275px]":"h-[300px] w-[200px]"),imageSize:u?"bigCard":"poster"}),(0,s.jsx)("div",{className:"absolute inset-0 grid place-content-center bg-transparent transition-colors ease-in-out group-hover:bg-black/40",children:(0,s.jsx)("div",{className:"grid h-10 w-10 scale-0 place-content-center rounded-full bg-primary text-primary-content transition-transform ease-in-out group-hover:scale-100",children:(0,s.jsx)(d.Ajr,{size:24})})})]})})}var p=a(5242);let h={default:{x:0,transition:{x:{stiffness:1e3,velocity:-100}}},hover:{x:-10,scale:1.05,transition:{x:{stiffness:1e3}},delay:.3}};function u(e){let{title:t,name:a,poster_path:r,media_type:o,id:c,index:x,contentType:u}=e,[m,f]=(0,n.useState)(!1);return(0,s.jsx)(p.P.div,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),initial:!1,animate:m?"hover":"default",className:"group relative mr-2 max-w-64",children:(0,s.jsxs)(l(),{href:"/".concat(o||u,"/").concat(c),className:"relative flex items-baseline","aria-label":"Link to details of ".concat(t||a),children:[(0,s.jsx)(p.P.p,{variants:h,className:"-z-10 -mr-3 text-8xl font-bold text-primary sm:text-9xl ".concat(!m&&"text-outline"),children:x<9?(0,s.jsx)("span",{className:"letter-shadow-r",children:x+1}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"letter-shadow-r",children:(x+1)/10}),(0,s.jsx)("span",{className:"letter-shadow-r -ml-5",children:"0"})]})}),(0,s.jsx)(i.FadeInImage,{src:r,type:"poster",alt:"Poster of ".concat(t||a),title:t||a,width:150,height:225,unoptimized:!1,classCSS:"h-[225px] w-[150px] rounded-xl hover:ring-2 ring-primary",imageSize:"poster"}),(0,s.jsx)("div",{className:"absolute inset-0 ml-auto grid h-[225px] w-[150px] place-content-center rounded-xl bg-transparent transition-colors ease-in-out group-hover:bg-black/40",children:(0,s.jsx)("div",{className:"grid h-10 w-10 scale-0 place-content-center rounded-full bg-primary text-primary-content transition-transform ease-in-out group-hover:scale-100",children:(0,s.jsx)(d.Ajr,{size:24})})})]})})}var m=a(65189),f=a(86519),v=a(8642);function g(e){let{index:t,bigCard:a}=e;return(0,s.jsx)(o.FadeInContent,{duration:1,delay:!0,index:t>20?t-(t-20)*2:t,scale:1.05,classCSS:(0,c.A)("group relative overflow-hidden rounded-xl ring-primary hover:ring-2",a?"max-w-[275px]":"max-w-[200px]"),children:(0,s.jsx)("div",{className:(0,c.A)("rounded-xl bg-base-100",a?"h-[412.5px] w-[275px]":"h-[300px] w-[200px]")})})}function j(e){let{results:t,children:a,contentType:r,top10:l,bigCard:i,isMedia:o,typeMedia:c,isEditMode:d,isLoading:x,isToggled:p}=e,h=(0,n.useRef)(null),[u,f]=(0,n.useState)(0),[v,g]=(0,n.useState)(!0),j=e=>{f(Math.ceil(e.target.scrollLeft))},w=()=>{h.current&&g(u===h.current.scrollWidth-h.current.offsetWidth)};return(0,n.useEffect)(()=>{w()},[u,h.current]),(0,n.useEffect)(()=>{h.current&&(h.current.scrollLeft=0,f(0)),w()},[t]),t&&t.length>0?(0,s.jsxs)("section",{className:"space-y-4 py-4",children:[a&&(0,s.jsx)("h3",{className:"-mb-2 ml-4 text-xl font-semibold sm:ml-16 sm:text-2xl",children:a}),(0,s.jsxs)("div",{className:"relative flex items-center",children:[(0,s.jsx)("div",{className:"".concat(u?"":"hidden"," ").concat(i?"h-[440px]":"h-[320px]"," absolute left-0 z-10 flex items-center bg-gradient-to-l from-transparent to-base-300 sm:pl-2"),children:(0,s.jsx)("button",{type:"button",title:"Rolar para a esquerda",className:"h-full opacity-50 hover:opacity-100",disabled:!u,onClick:()=>{h.current&&(h.current.scrollLeft-=h.current.offsetWidth)},children:(0,s.jsx)(m.SnO,{size:25})})}),(0,s.jsx)("div",{className:"no-scrollbar flex flex-col overflow-hidden overflow-x-auto scroll-smooth px-4 sm:px-16",onScroll:e=>j(e),ref:h,children:(0,s.jsx)("div",{className:"flex w-max gap-3 py-3","data-test":"content-row",children:(0,s.jsx)(b,{opt:{isMedia:o,typeMedia:c,top10:l,results:t,isLoading:x,contentType:r,isEditMode:d,bigCard:i}})})}),(0,s.jsx)("div",{className:"".concat(v?"hidden":""," ").concat(i?"h-[440px]":"h-[320px]"," absolute right-0 z-10 flex items-center bg-gradient-to-r from-transparent to-base-300 sm:pr-2"),children:(0,s.jsx)("button",{type:"button",title:"Rolar para a direita",className:"h-full opacity-50 hover:opacity-100",disabled:v,onClick:()=>{h.current&&(h.current.scrollLeft+=h.current.offsetWidth)},children:(0,s.jsx)(m.dH8,{size:25})})})]})]}):!x&&p&&(0,s.jsx)("div",{className:"flex h-60 items-center px-4 sm:px-16",children:(0,s.jsx)("p",{className:"opacity-50",children:"No Results Found"})})}function b(e){let{opt:{isMedia:t,typeMedia:a,top10:n,results:r,isLoading:l,contentType:i,isEditMode:o,bigCard:c}}=e;return t&&a?null==r?void 0:r.map((e,t)=>(0,s.jsx)(f.Z,{...e,index:t,contentType:i,typeMedia:a,isEditMode:o},e.id)):n?(null==r?void 0:r.length)===0&&l?[...Array(8)].map((e,t)=>(0,s.jsx)(v.i,{index:t},"card-top-content-skeleton-".concat(t))):null==r?void 0:r.map((e,t)=>(0,s.jsx)(u,{...e,index:t,contentType:i},e.id)):l?[...Array(8)].map((e,t)=>(0,s.jsx)(g,{index:t},"card-skeleton-".concat(t))):null==r?void 0:r.map((e,t)=>(0,s.jsx)(x,{...e,bigCard:c,index:t,contentType:i},e.id))}},86519:(e,t,a)=>{a.d(t,{Z:()=>p});var s=a(95155),n=a(12115),r=a(6874),l=a.n(r),i=a(89863),o=a(19619),c=a(52596),d=a(14549),x=a(6557);function p(e){let{title:t,name:a,poster_path:r,media_type:p,id:h,index:u,contentType:m,bigCard:f,typeMedia:v,isEditMode:g,season_number:j,episode_number:b}=e,{removeFromFavorites:w,removeFromWatchHistory:y,removeFromWatchlist:N}=(0,x.Q)(),S=(0,n.useCallback)(()=>{"watchlist"===v?N(h):"favorite"===v?w(h):y(h)},[v,m,h]);return(0,s.jsxs)(o.FadeInContent,{duration:1,delay:!0,index:u>20?u-(u-20)*2:u,scale:1.05,classCSS:(0,c.A)("group relative overflow-hidden rounded-xl hover:ring-2",f?"max-w-[275px]":"max-w-[200px]",g?"ring-error":"ring-primary"),children:[(0,s.jsxs)(l(),{href:{pathname:"/".concat(p||m,"/").concat(h),query:"tv"===p?{season:j,episode:b}:null},"aria-label":"Link to details of ".concat(t||a),children:[(0,s.jsx)(i.FadeInImage,{src:r,type:"poster",alt:"Poster de ".concat(t||a),title:t||a,width:275,height:412.5,classCSS:"".concat(f?"h-auto sm:h-[412.5px] w-[275px]":"h-auto sm:h-[300px] w-[200px]"),imageSize:f?"bigCard":"poster"}),(0,s.jsx)("div",{className:"absolute inset-0 grid place-content-center bg-transparent transition-colors ease-in-out group-hover:bg-black/40",children:(0,s.jsx)("div",{className:"grid h-10 w-10 scale-0 place-content-center rounded-full bg-primary text-primary-content transition-transform ease-in-out group-hover:scale-100",children:(0,s.jsx)(d.Ajr,{size:24})})}),"watched"===v&&"tv"===p&&j&&b&&(0,s.jsxs)("div",{className:"absolute inset-x-0 bottom-0 flex h-1/2 items-end justify-between gap-4 bg-gradient-to-t from-black/80 to-transparent p-4 text-xs",children:[(0,s.jsx)("p",{className:"font-semibold",children:"Season ".concat(j)}),(0,s.jsx)("p",{className:"font-semibold",children:"Episode ".concat(b)})]})]}),(0,s.jsx)("div",{className:(0,c.A)("absolute inset-0 grid place-content-center bg-black/40 transition-all ease-in-out",g?"pointer-events-auto visible opacity-100":"pointer-events-none invisible opacity-0"),children:(0,s.jsx)("button",{className:(0,c.A)("grid h-10 w-10 place-content-center rounded-full bg-error text-primary-content transition-transform ease-in-out hover:scale-110",g?"pointer-events-auto scale-100":"pointer-events-none scale-0"),onClick:S,children:(0,s.jsx)(d.SXS,{size:24})})})]})}}}]);