1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53378,e=>{"use strict";var a=e.i(43476),s=e.i(37902),l=e.i(71645),t=e.i(57688),r=e.i(932),o=e.i(22016);function n(e){let s,l,n,i,m,p,f,u,h,b,g,j,v,w,y,N,k,_,C,S,A,P,B=(0,r.c)(54),{anime:F,rank:L,platform:$}=e,z=`/anime/where-to-watch/${F.slug}`;B[0]!==F.coverImage||B[1]!==F.title?(s=F.coverImage?(0,a.jsx)(t.default,{src:F.coverImage,alt:F.title,fill:!0,className:"object-cover group-hover:scale-105 transition-transform duration-300"}):(0,a.jsx)("div",{className:"flex items-center justify-center h-full bg-gradient-to-br from-gray-300 to-gray-400",children:(0,a.jsx)("span",{className:"text-gray-600 text-4xl",children:"ðº"})}),B[0]=F.coverImage,B[1]=F.title,B[2]=s):s=B[2],B[3]!==L?(l=L&&(0,a.jsxs)("div",{className:"absolute top-3 right-3 border-2 bg-purple-600 text-white font-bold px-3 py-1.5 rounded-full shadow-lg text-lg",children:["#",L]}),B[3]=L,B[4]=l):l=B[4],B[5]!==$?(n=$&&(0,a.jsx)("div",{className:"absolute top-3 left-3 bg-blue-600 text-white px-3 py-1 rounded-full text-xs font-bold",children:$}),B[5]=$,B[6]=n):n=B[6],B[7]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black via-trans
1parent to-transparent opacity-40"}),B[7]=i):i=B[7],B[8]!==s||B[9]!==l||B[10]!==n?(m=(0,a.jsxs)("div",{className:"relative w-full h-64",children:[s,l,n,i]}),B[8]=s,B[9]=l,B[10]=n,B[11]=m):m=B[11],B[12]!==z||B[13]!==m?(p=(0,a.jsx)(o.default,{href:z,children:m}),B[12]=z,B[13]=m,B[14]=p):p=B[14];let M=`/anime/where-to-watch/${F.slug}`;B[15]!==F.title?(f=(0,a.jsx)("h3",{className:"font-bold text-white text-xl line-clamp-2 mb-2 hover:underline cursor-pointer",children:F.title}),B[15]=F.title,B[16]=f):f=B[16],B[17]!==M||B[18]!==f?(u=(0,a.jsx)(o.default,{href:M,children:f}),B[17]=M,B[18]=f,B[19]=u):u=B[19],B[20]!==F.year?(h=(0,a.jsx)("span",{className:"font-semibold text-sm",children:F.year}),B[20]=F.year,B[21]=h):h=B[21],B[22]!==F.format?(b=(0,a.jsx)("span",{className:"font-semibold text-sm",children:F.format}),B[22]=F.format,B[23]=b):b=B[23],B[24]!==F.episodes?(g=F.episodes&&(0,a.jsxs)("span",{className:"font-semibold text-sm",children:[F.episodes," eps"]}),B[24]=F.episodes,B[25]=g):g=B[25],B[26]!==h||B[27]!==b||B[28]!==g?(j=(0,a.jsxs)("div",{className:"flex justify-between items-center text-xl text-gray-200 mb-3",children:[h,b,g]}),B[26]=h,B[27]=b,B[28]=g,B[29]=j):j=B[29],B[30]!==F.rating?(v=F.rating&&(0,a.jsxs)("div",{className:"flex items-center gap-1 text-lg font-bold text-yellow-500",children:["â ",(F.rating/10).toFixed(1),"/10"]}),B[30]=F.rating,B[31]=v):v=B[31],B[32]!==F.genres?(w=F.genres?.slice(0,2).map(x),B[32]=F.genres,B[33]=w):w=B[33],B[34]!==w?(y=(0,a.jsx)("div",{className:"mt-3 flex flex-wrap gap-1",children:w}),B[34]=w,B[35]=y):y=B[35],B[36]===Symbol.for("react.memo_cache_sentinel")?(N=(0,a.jsx)("p",{className:"text-base font-bold text-gray-200 mb-2",children:"Available on:"}),B[36]=N):N=B[36],B[37]!==F.streamingPlatforms?(k=F.streamingPlatforms?.map(d),B[37]=F.streamingPlatforms,B[38]=k):k=B[38],B[39]!==k?(_=(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[N,(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:k})]}),B[39]=k,B[40]=_):_=B[40];let T=`/anime/where-to-watch/${F.slug}`;return B[41]===Symbol.for("react.memo_cache_sentinel")?(C=(0,a.jsx)("button",{className:"mt-3 w-full bg-black border-2 border-gray-400 text-white font-bold py-2 rounded hover:bg-blue-900/95 transition-colors text-sm cursor-pointer",onClick:c,children:"Know More â"}),B[41]=C):C=B[41],B[42]!==T?(S=(0,a.jsx)(o.default,{href:T,children:C}),B[42]=T,B[43]=S):S=B[43],B[44]!==u||B[45]!==j||B[46]!==v||B[47]!==y||B[48]!==_||B[49]!==S?(A=(0,a.jsxs)("div",{className:"p-4 bg-blue-950",children:[u,j,v,y,_,S]}),B[44]=u,B[45]=j,B[46]=v,B[47]=y,B[48]=_,B[49]=S,B[50]=A):A=B[50],B[51]!==A||B[52]!==p?(P=(0,a.jsx)("div",{className:"group cursor-pointer border-2 border-blue-100 rounded-xl",children:(0,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-lg overflow-hidden hover:shadow-white/50 transition-shadow",children:[p,A]})}),B[51]=A,B[52]=p,B[53]=P):P=B[53],P}function c(e){return e.stopPropagation()}function d(e){return(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm bg-green-100 text-green-800 px-2 py-1 rounded hover:bg-green-200 transition-colors font-bold",onClick:i,children:[e.name," â"]},e.name)}function i(e){return e.stopPropagation()}function x(e){return(0,a.jsx)("span",{className:"text-lg bg-blue-100 text-blue-800 px-4 py-0.5 rounded",children:e},e)}let m=[{name:"Crunchyroll",icon:"ð",color:"purple"},{name:"Netflix",icon:"ð¬",color:"purple"},{name:"HIDIVE",icon:"ð¯",color:"purple"},{name:"Amazon Prime Video",icon:"ðª",color:"purple"},{name:"Hulu",icon:"ð",color:"purple"}];function p(e){let s,l,t,o,n,c=(0,r.c)(12),{selectedPlatform:d,onPlatformChange:i}=e;c[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)("p",{className:"font-bold text-white text-2xl mb-3",children:"ðº Trending On:"}),c[0]=s):s=c[0],c[1]!==i?(l=()=>i(null),c[1]=i,c[2]=l):l=c[2];let x=`px-4 py-2 border-2 border-purple-100 rounded-full font-bold whitespace-nowrap transition-all ${null===d?"bg-gradient-to-r from-purple-600 to-blue-600 text-white shadow-lg":"bg-gray-200 text-gray-700 hover:bg-gray-300"}`;return c[3]!==l||c[4]!==x?(t=(0,a.jsx)("button",{onClick:l,className:x,children:"ð All Platforms"}),c[3]=l,c[4]=x,c[5]=t):t=c[5],c[6]!==i||c[7]!==d?(o=m.map(e=>(0,a.jsxs)("button",{onClick:()=>i(e.name),className:`px-4 py-2 rounded-full font-bold whitespace-nowrap transition-all ${d===e.name?`bg-${e.color}-600 text-white shadow-lg`:"bg-gray-200 text-gray-700 hover:bg-gray-300"}`,children:[e.icon," ",e.name]},e.name)),c[6]=i,c[7]=d,c[8]=o):o=c[8],c[9]!==t||c[10]!==o?(n=(0,a.jsxs)("div",{className:"bg-black/50 rounded-lg shadow p-4 mb-6",children:[s,(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[t,o]})]}
1),c[9]=t,c[10]=o,c[11]=n):n=c[11],n}var f=e.i(28243),u=e.i(77177);function h(){let[e,r]=(0,l.useState)(null),[o,c]=(0,l.useState)([]),[d,i]=(0,l.useState)([]),[x,m]=(0,l.useState)([]),[h,b]=(0,l.useState)([]),[g,j]=(0,l.useState)(!1),[v,w]=(0,l.useState)(null),[y,N]=(0,l.useState)(1),[k,_]=(0,l.useState)(!1);(0,l.useEffect)(()=>{C()},[e]),(0,l.useEffect)(()=>{S()},[o,d,x]);let C=async()=>{j(!0),w(null),N(1);try{let a=e?`/api/trending?type=platform&platform=${e}&limit=20`:"/api/trending?type=overall&limit=100";console.log(`ð¡ Fetching: ${a}`);let s=await fetch(a),l=await s.json();l.success?(m(l.data||[]),console.log(`â
Loaded ${l.total} anime`)):w(l.error||"Failed to load trending")}catch(e){console.error("Error:",e),w(e.message)}finally{j(!1)}},S=()=>{let e=x;o.length>0&&(e=e.filter(e=>o.some(a=>e.genres?.includes(a)))),d.length>0&&(e=e.filter(e=>d.includes(e.format))),b(e),N(1)},A=h.slice((y-1)*20,20*y),P=Math.ceil(h.length/20);return(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 min-h-screen bg-gradient-to-r from-blue-900 via-blue-[#00008B] to-blue-900",children:[(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 bg-gradient-to-r from-blue-900 via-blue-[#00008B] to-blue-900 text-white sm:py-3 lg:py-5 shadow-[0_4px_20px_rgba(124,58,237,0.5)]",children:[(0,a.jsx)(t.default,{src:u.default,alt:"Cover Image",fill:!0,className:"object-cover z-0 opacity-90 w-full h-full"}),(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 max-w-7xl relative mx-auto z-10 px-4",children:[(0,a.jsx)("h1",{className:"jsx-70aa1ecff6c2ed53 text-3xl sm:text-4xl z-20 lg:text-5xl font-bold mb-2 text-transparent bg-clip-text bg-gradient-to-r from-yellow-400 via-yellow-500 to-orange-500 inline-block",children:"ð¥ Trending Anime"}),(0,a.jsxs)("p",{className:"jsx-70aa1ecff6c2ed53 text-purple-100 mt-2 text-xl sm:text-base",children:[e?`Top anime on ${e}`:"Top trending anime across all platforms"," "]})]}),(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 absolute inset-0 bg-black/50"})]}),(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 bg-gradient-to-r from-red-900 via-blue-[#00008B] to-blue-900 backdrop-blur-xl border-b border-purple-500/20 top-16 z-20 py-1 shadow-[0_2px_10px_rgba(124,58,237,0.3)]",children:(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 max-w-7xl mx-auto px-4",children:(0,a.jsx)(p,{selectedPlatform:e,onPlatformChange:r})})}),(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 lg:hidden bg-gradient-to-r from-blue-900 via-blue-[#00008B] to-blue-900 border-b border-purple-500/20 py-3 sticky top-17 z-20",children:(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 max-w-7xl mx-auto px-4",children:(0,a.jsxs)("button",{onClick:()=>_(!0),className:"jsx-70aa1ecff6c2ed53 w-full flex items-center justify-center gap-2 bg-purple-500 hover:bg-purple-600 text-white px-4 py-3 rounded-lg font-semibold transition-all duration-300 shadow-[0_4px_15px_rgba(124,58,237,0.4)]",children:[(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",className:"jsx-70aa1ecff6c2ed53 w-5 h-5",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",className:"jsx-70aa1ecff6c2ed53"})}),(0,a.jsx)("span",{className:"jsx-70aa1ecff6c2ed53",children:"Filters"}),(o.length>0||d.length>0)&&(0,a.jsx)("span",{className:"jsx-70aa1ecff6c2ed53 bg-gradient-to-r from-yellow-400 to-orange-500 text-white px-2.5 py-0.5 rounded-full text-xs font-bold shadow-[0_0_10px_rgba(245,158,11,0.5)]",children:o.length+d.length})]})})}),k&&(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 lg:hidden fixed inset-0 bg-black/60 z-50 flex items-end sm:items-center sm:justify-center backdrop-blur-sm",children:[(0,a.jsx)("div",{onClick:()=>_(!1),className:"jsx-70aa1ecff6c2ed53 absolute inset-0"}),(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 relative bg-[#1A0B2E]/95 backdrop-blur-xl rounded-t-2xl sm:rounded-2xl max-h-[85vh] w-full sm:max-w-lg overflow-hidden border-t-4 border-purple-500 shadow-[0_-4px_30px_rgba(124,58,237,0.5)] animate-slide-up",children:[(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 flex items-center justify-between p-4 border-b border-purple-500/30 bg-purple-500/10",children:[(0,a.jsxs)("h3",{className:"jsx-70aa1ecff6c2ed53 text-lg font-bold text-white flex items-center gap-2",children:[(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",className:"jsx-70aa1ecff6c2ed53 w-5 h-5 text-yellow-400",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",className:"jsx-70aa1ecff6c2ed53"})}),(0,a.jsx)("span",{className:"jsx-70aa1ecff6c2ed53 text-transparent bg-clip-text bg-gradient-to-r from-yellow-400 to-orange-500",children:"Filters"})]}),(0,a.jsx)("button",{onClick:()=>_(!1),className:"jsx-70aa1ecff6c2ed53 text-purple-300 hover:text-yellow-400 p-1 rounded-lg hover:bg-purple-500/20 transition-all duration-300",children:(0,a.jsx)("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",className:"jsx-70aa1ecff6c2ed53 w-6 h-6",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12",className:"jsx-70aa1ecff6c2ed53"})})})]}),(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 overflow-y-auto max-h-[calc(85vh-140px)] p-4",children:(0,a.jsx)(f.default,{selectedGenres:o,selectedFormats:d,onGenreChange:c,onFormatChange:i})}),(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 border-t border-purple-500/30 bg-purple-500/10 p-4 flex gap-3",children:[(o.length>0||d.length>0)&&(0,a.jsx)("button",{onClick:()=>{c([]),i([])},className:"jsx-70aa1ecff6c2ed53 flex-1 bg-purple-500/20 hover:bg-purple-500/30 text-purple-200 hover:text-white px-4 py-2.5 rounded-lg font-semibold transition-all duration-300 border border-purple-500/30",children:"Clear All"}),(0,a.jsx)("button",{onClick:()=>_(!1),className:"jsx-70aa1ecff6c2ed53 flex-1 bg-gradient-to-r from-yellow-400 via-yellow-500 to-orange-500 hover:shadow-[0_4px_20px_rgba(245,158,11,0.6)] text-white px-4 py-2.5 rounded-lg font-semibold transition-all duration-300",children:"Apply Filters"})]})]})]}),(0,a.jsx)("hr",{className:"jsx-70aa1ecff6c2ed53 border-t border-gray-300"}),(0,a.jsx)("hr",{className:"jsx-70aa1ecff6c2ed53 border-t border-gray-300"}),(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 max-w-7xl mx-auto px-4 py-6 sm:py-8",children:(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 grid grid-cols-1 lg:grid-cols-4 gap-6",children:[(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 hidden lg:block lg:col-span-1",children:(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53",children:(0,a.jsx)(f.default,{selectedGenres:o,selectedFormats:d,onGenreChange:c,onFormatChange:i})})}),(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 lg:col-span-3",children:[g&&(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 text-center py-12",children:[(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 relative inline-block mb-4",children:[(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 animate-spin w-12 h-12 sm:w-16 sm:h-16 border-4 border-purple-500 border-t-transparent roun
1ded-full"}),(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 absolute inset-0 blur-xl bg-purple-500 opacity-50 animate-pulse"})]}),(0,a.jsx)("p",{className:"jsx-70aa1ecff6c2ed53 text-purple-200 text-sm sm:text-base",children:"Loading trending anime..."})]}),v&&(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 bg-red-500/10 border-2 border-red-500/50 text-red-300 p-6 rounded-xl shadow-[0_4px_20px_rgba(239,68,68,0.3)]",children:(0,a.jsxs)("p",{className:"jsx-70aa1ecff6c2ed53 font-bold",children:["â Error: ",v]})}),!g&&h.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 bg-[#1A0B2E]/60 backdrop-blur-sm rounded-lg p-3 mb-6 border border-purple-500/20",children:(0,a.jsxs)("p",{className:"jsx-70aa1ecff6c2ed53 text-purple-200 text-sm sm:text-base",children:["Showing ",(y-1)*20+1," - ",Math.min(20*y,h.length)," of ",h.length," anime"]})}),(0,a.jsx)("div",{className:"jsx-70aa1ecff6c2ed53 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6",children:A.map((s,l)=>{let t=s.platformRankings?.find(a=>a.platform===e),r=t?.rank||(y-1)*20+l+1;return(0,a.jsx)(n,{anime:s,rank:r,platform:e||void 0},s._id?.toString())})}),(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 flex justify-center gap-3 sm:gap-4 mt-8 flex-wrap",children:[(0,a.jsx)("button",{onClick:()=>N(Math.max(1,y-1)),disabled:1===y,className:"jsx-70aa1ecff6c2ed53 px-4 sm:px-6 py-2 sm:py-3 bg-purple-500 hover:bg-purple-600 text-white rounded-lg font-bold transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed hover:shadow-[0_4px_20px_rgba(124,58,237,0.5)] text-sm sm:text-base",children:"â Previous"}),(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 px-4 sm:px-6 py-2 sm:py-3 bg-gradient-to-r from-yellow-400 via-yellow-500 to-orange-500 rounded-lg text-white font-bold shadow-[0_4px_20px_rgba(245,158,11,0.4)] text-sm sm:text-base",children:["Page ",y," of ",P]}),(0,a.jsx)("button",{onClick:()=>N(Math.min(P,y+1)),disabled:y===P,className:"jsx-70aa1ecff6c2ed53 px-4 sm:px-6 py-2 sm:py-3 bg-purple-500 hover:bg-purple-600 text-white rounded-lg font-bold transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed hover:shadow-[0_4px_20px_rgba(124,58,237,0.5)] text-sm sm:text-base",children:"Next â"})]})]}),!g&&0===h.length&&!v&&(0,a.jsxs)("div",{className:"jsx-70aa1ecff6c2ed53 text-center py-12 bg-[#1A0B2E]/80 backdrop-blur-xl rounded-xl border border-purple-500/20 shadow-[0_8px_30px_rgba(124,58,237,0.3)]",children:[(0,a.jsx)("p",{className:"jsx-70aa1ecff6c2ed53 text-6xl sm:text-7xl mb-4",children:"ð´"}),(0,a.jsx)("p",{className:"jsx-70aa1ecff6c2ed53 text-purple-200 text-base sm:text-lg",children:"No anime found with those filters. Try adjusting your selection!"})]})]})]})}),(0,a.jsx)(s.default,{id:"70aa1ecff6c2ed53",children:"@keyframes slide-up{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}.animate-slide-up.jsx-70aa1ecff6c2ed53{animation:.3s ease-out slide-up}@media (width>=640px){@keyframes slide-up{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}}"})]})}e.s(["default",()=>h],53378)}]);
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.