"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8e3],{1824:(e,t,a)=>{a.d(t,{A:()=>g});var r=a(5155),s=a(2115),l=a(6874),o=a.n(l),i=a(6766),n=a(7132),d=a(2690),c=a(4020),m=a(5690),p=a(3311),u=a(8564);let g=e=>{var t;let{item:a,priority:l=!1,onClick:g,customActions:x}=e,[h,b]=(0,s.useState)(!1),[f,v]=(0,s.useState)(!1),[w,y]=(0,s.useState)(!1);if(!a||a instanceof Promise)return(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-gray-800/80 to-gray-900/80 backdrop-blur-sm aspect-[2/3] w-full animate-pulse",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"}),(0,r.jsx)("div",{className:"h-full w-full flex items-center justify-center text-gray-400 text-sm font-medium",children:(0,r.jsx)("div",{className:"animate-spin w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full"})})]});let j="movie"===a.media_type?a.title:a.name,N="movie"===a.media_type?a.release_date:a.first_air_date,k="movie"===a.media_type?(0,d.GV)(a.id,j||"untitled"):(0,d.pK)(a.id,j||"untitled"),_=N?N.substring(0,4):"N/A",S=a.poster_path&&!f?"".concat(n.im,"w500").concat(a.poster_path):"/images/placeholder-poster.png",A=a.vote_average?Math.round(10*a.vote_average):null,z=N&&new Date(N)>new Date(Date.now()-5184e6),C=a.genres&&(null==(t=a.genres[0])?void 0:t.name)?a.genres[0].name:null,E={"@context":"https://schema.org","@type":"movie"===a.media_type?"Movie":"TV Show",name:j||"Untitled",genre:C||"Unknown",datePublished:N||"Unknown",aggregateRating:a.vote_average&&a.vote_count&&a.vote_average>0?{"@type":"AggregateRating",ratingValue:a.vote_average.toFixed(1),bestRating:"10",worstRating:"0",ratingCount:a.vote_count}:void 0},T=(e,t)=>{e.preventDefault(),e.stopPropagation(),t.onClick(),y(!1)};return(0,r.jsxs)("div",{className:"relative group cursor-pointer",onClick:g,children:[(0,r.jsx)("script",{type:"application/ld+json",children:JSON.stringify(E)}),(0,r.jsxs)(o(),{href:k,className:"block relative overflow-hidden rounded-xl transition-all duration-500 ease-out bg-gradient-to-br from-gray-900/50 to-black/50 backdrop-blur-sm shadow-sm hover:shadow-lg hover:shadow-blue-500/20 group transform hover:md:-translate-y-1 hover:md:scale-102 active:scale-98",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),onTouchStart:()=>b(!0),onTouchEnd:()=>setTimeout(()=>b(!1),2e3),"aria-label":"View details for ".concat(j||"Untitled"," (").concat("movie"===a.media_type?"Movie":"TV Show",")"),children:[(0,r.jsx)("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-r from-blue-500/50 via-purple-500/50 to-pink-500/50 opacity-0 group-hover:opacity-100 transition-opacity duration-500 blur-sm -z-10"}),z&&(0,r.jsxs)("div",{className:"absolute top-1 left-1 md:top-2 md:left-2 z-20 flex items-center gap-0.5 px-1 py-0.5 md:px-2 md:py-1 bg-gradient-to-r from-blue-600 to-blue-700 text-white text-xs font-bold rounded-full shadow-lg backdrop-blur-sm border border-blue-400/30",children:[" ",(0,r.jsx)(p.A,{className:"w-2.5 h-2.5 md:w-2.5 md:h-2.5"}),(0,r.jsx)("span",{className:"text-[9px] md:text-xs",children:"NEW"})]}),A&&(0,r.jsxs)("div",{className:"absolute top-1 right-1 md:top-2 md:right-2 z-20 flex items-center gap-0.5 px-1 py-0.5 md:px-2 md:py-1 bg-gradient-to-r ".concat(A?A>=75?"from-emerald-500 to-green-600":A>=60?"from-amber-500 to-orange-600":"from-red-500 to-rose-600":"from-gray-600 to-gray-700"," rounded-full shadow-lg backdrop-blur-sm border border-white/20"),children:[" ",(0,r.jsx)(u.A,{className:"w-2.5 h-2.5 md:w-2.5 md:h-2.5 text-white fill-current"}),(0,r.jsxs)("span",{className:"text-white font-bold text-[9px] md:text-xs",children:[A,"%"]})]}),(0,r.jsxs)("div",{className:"relative aspect-[2/3] w-full overflow-hidden rounded-xl bg-gradient-to-br from-gray-800 to-gray-900",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 via-black/20 to-transparent z-10 transition-all duration-500 ".concat(h?"opacity-100":"opacity-0")}),(0,r.jsx)(i.default,{src:S,alt:j?"".concat(j," poster"):"".concat(a.media_type," poster"),fill:!0,sizes:"(max-width: 640px) 50vw, (max-width: 768px) 33vw, (max-width: 1024px) 25vw, (max-width: 1280px) 20vw, 16.6vw",className:"object-cover transition-all duration-700 ease-out ".concat(h?"scale-110 brightness-110 contrast-110 saturate-110":"scale-100 brightness-100 contrast-100 saturate-100"),priority:l,onError:()=>v(!0),loading:l?"eager":"lazy"}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/20 via-transparent to-transparent"})]}),(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center transition-all duration-500 ".concat(h?"opacity-100 scale-100":"opacity-0 scale-75"),children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-blue-500/30 rounded-full animate-ping"}),(0,r.jsx)("div",{className:"absolute inset-0 bg-blue-500/20 rounded-full animate-pulse"})," ",(0,r.jsx)("div",{className:"relative w-8 h-8 md:w-12 md:h-12 bg-gradient-to-r from-blue-600 to-blue-700 rounded-full flex items-center justify-center shadow-xl border-2 border-blue-400/50 backdrop-blur-sm transform transition-transform duration-300 hover:scale-110 active:scale-95",children:(0,r.jsx)(m.A,{className:"h-3 w-3 md:h-5 md:w-5 text-white ml-0.5 fill-current"})})]})}),(0,r.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-500 ".concat(h?"opacity-0 translate-y-2":"opacity-100 translate-y-0"),children:[" ",(0,r.jsx)("div",{className:"bg-gradient-to-t from-black/60 via-black/20 to-transparent p-1 md:p-1.5",children:(0,r.jsxs)("div",{className:"flex items-center justify-between text-[9px] md:text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 md:gap-1.5",children:[(0,r.jsx)("span",{className:"text-white/80 font-medium bg-black/40 backdrop-blur-sm px-1 py-0.5 md:px-1.5 rounded text-[9px] md:text-xs",children:_}),(0,r.jsx)("span",{className:"text-white/90 font-medium bg-black/40 backdrop-blur-sm px-1 py-0.5 md:px-1.5 rounded text-[9px] md:text-xs",children:"movie"===a.media_type?"Movie":"TV"})]}),A&&(0,r.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,r.jsx)(u.A,{className:"w-2.5 h-2.5 md:w-2.5 md:h-2.5 text-yellow-400 fill-current"}),(0,r.jsx)("span",{className:"text-white/90 font-medium text-[9px] md:text-xs",children:(a.vote_average||0).toFixed(1)})]})]})})]})]}),x&&x.length>0&&(0,r.jsxs)("div",{className:"absolute top-1 right-1 md:top-2 md:right-2 z-20",children:[(0,r.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),y(!w)},className:"flex items-center justify-center w-8 h-8 md:w-10 md:h-10 rounded-full transition-all duration-300 ease-in-out bg-black/60 hover:bg-black/70 active:bg-black/80 shadow-md","aria-label":"Toggle actions",children:(0,r.jsx)(c.A,{className:"w-5 h-5 text-white"})}),w&&(0,r.jsx)("div",{className:"absolute top-full right-0 mt-1 bg-gray-900/95 backdrop-blur-md border border-gray-700/50 rounded-lg shadow-xl overflow-hidden z-30",children:x.map((e,t)=>(0,r.jsxs)("button",{onClick:t=>T(t,e),className:"flex items-center gap-2 w-full px-4 py-2 text-sm text-left text-white hover:bg-blue-600/20 transition-colors",children:[e.icon&&(0,r.jsx)("span",{className:"flex-shrink-0",children:e.icon}),(0,r.jsx)("span",{children:e.label})]},"action-".concat(t)))})]})]})}},2690:(e,t,a)=>{function r(e){return e&&"string"==typeof e?e.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim():"untitled"}function s(e,t){let a=r(t);return"/movie/".concat(e,"/").concat(a)}function l(e,t){let a=r(t);return"/tv/".concat(e,"/").concat(a)}a.d(t,{GV:()=>s,pK:()=>l})},7132:(e,t,a)=>{a.d(t,{im:()=>r,pe:()=>s});let r="https://image.tmdb.org/t/p/",s={poster:{tiny:"w92",small:"w154",medium:"w300",large:"w500",xlarge:"w780"},backdrop:{small:"w300",medium:"w780",large:"w1280",original:"original"},profile:{tiny:"w45",small:"w185",medium:"h632",original:"original"},logo:{small:"w92",medium:"w300",large:"w500"}}},8e3:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(5155),s=a(2115),l=a(1824);let o=()=>(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-xl bg-gray-900 shadow-md h-full animate-pulse",children:[(0,r.jsx)("div",{className:"relative aspect-[2/3] w-full bg-gray-800"}),(0,r.jsxs)("div",{className:"p-3 sm:p-3 bg-gradient-to-t from-gray-900 to-gray-800",children:[(0,r.jsx)("div",{className:"h-4 sm:h-4 bg-gray-700 rounded w-3/4 mb-2 sm:mb-2"}),(0,r.jsxs)("div",{className:"flex justify-between items-center mt-2 sm:mt-2",children:[(0,r.jsx)("div",{className:"h-3 sm:h-3 bg-gray-700 rounded w-1/4"}),(0,r.jsx)("div",{className:"h-3 sm:h-3 bg-gray-700 rounded-full w-1/5"})]})]}),(0,r.jsx)("div",{className:"absolute top-2 sm:top-2 right-2 sm:right-2 z-10 w-8 h-8 sm:w-8 sm:h-8 md:w-10 md:h-10 bg-gray-700 rounded-full"})]}),i=e=>{let{count:t=12,layout:a="grid"}=e;return"carousel"===a?(0,r.jsx)("div",{className:"flex space-x-3 sm:space-x-4 md:space-x-5 overflow-hidden pb-4 pr-10 sm:pr-20 md:pr-24",children:Array.from({length:t}).map((e,t)=>(0,r.jsx)("div",{className:"flex-none w-[142px] sm:w-[200px]",children:(0,r.jsx)(o,{})},"skeleton-".concat(t)))}):(0,r.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 2xl:grid-cols-8 gap-3 sm:gap-3 md:gap-4",children:Array.from({length:t}).map((e,t)=>(0,r.jsx)(o,{},"skeleton-".concat(t)))})};var n=a(2355),d=a(3052);let c=e=>{let{items:t,listTitle:a,isLoading:o=!1,error:c=null,onRetry:m,layout:p="grid"}=e,[u,g]=(0,s.useState)(!1),[x,h]=(0,s.useState)(!0),b=(0,s.useRef)(null),[f,v]=(0,s.useState)([]),[w,y]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(async()=>{if(t){y(!0);try{if(t instanceof Promise){let e=await t;v(e)}else v(t)}catch(e){v([])}finally{y(!1)}}})()},[t]),(0,s.useEffect)(()=>{if("carousel"===p&&b.current){let e=b.current,t=()=>{let{scrollLeft:t,scrollWidth:a,clientWidth:r}=e;g(t>0),h(te.removeEventListener("scroll",t)}},[p,f]);let j=e=>{if(!b.current)return;let t=.75*b.current.clientWidth,a="left"===e?b.current.scrollLeft-t:b.current.scrollLeft+t;b.current.scrollTo({left:a,behavior:"smooth"})};return c?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center p-8 bg-gray-900/50 rounded-lg",children:[(0,r.jsx)("p",{className:"text-red-400 mb-4",children:"Failed to load content"}),m&&(0,r.jsx)("button",{onClick:m,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors",children:"Retry"})]}):o||w?(0,r.jsx)(i,{count:"grid"===p?12:8,layout:p}):f&&0!==f.length?"grid"===p?(0,r.jsx)("div",{"aria-label":a,className:"grid grid-cols-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4 md:gap-6",children:f.map((e,t)=>e&&e.id&&e.media_type?(0,r.jsx)(l.A,{item:e,priority:t<6},"".concat(e.media_type,"-").concat(e.id)):null)}):(0,r.jsxs)("div",{className:"relative group",children:[" ",(0,r.jsx)("div",{ref:b,"aria-label":a,className:"flex overflow-x-auto pb-4 space-x-3 scrollbar-hide scroll-smooth pr-10 sm:pr-20 md:pr-24",style:{scrollbarWidth:"none",msOverflowStyle:"none",scrollSnapType:"x proximity"},children:f.map((e,t)=>e&&e.id&&e.media_type?(0,r.jsx)("div",{className:"flex-none w-[142px] sm:w-[200px] transition-all duration-300",style:{scrollSnapAlign:"start"},children:(0,r.jsx)(l.A,{item:e,priority:t<4})},"".concat(e.media_type,"-").concat(e.id)):null)}),u&&(0,r.jsx)("button",{className:"absolute left-0 top-1/2 transform -translate-y-1/2 bg-black/70 p-2 rounded-full hover:bg-black z-10 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>j("left"),"aria-label":"Scroll left",children:(0,r.jsx)(n.A,{className:"h-6 w-6 text-white"})}),x&&(0,r.jsx)("button",{className:"absolute right-0 top-1/2 transform -translate-y-1/2 bg-black/70 p-2 rounded-full hover:bg-black z-10 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>j("right"),"aria-label":"Scroll right",children:(0,r.jsx)(d.A,{className:"h-6 w-6 text-white"})}),(0,r.jsx)("div",{className:"absolute left-0 top-0 bottom-4 w-8 bg-gradient-to-r from-gray-900 to-transparent pointer-events-none z-10 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),(0,r.jsx)("div",{className:"absolute right-0 top-0 bottom-4 w-16 sm:w-20 bg-gradient-to-l from-gray-900 to-transparent pointer-events-none z-10 opacity-70 transition-opacity duration-300"})]}):(0,r.jsx)("p",{className:"text-gray-400 p-4",children:"No items to display."})}}}]);