1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,939651,e=>{"use strict";var t=e.i(843476),n=e.i(979818),l=e.i(770703),i=e.i(271645);let a=(0,l.default)(()=>e.A(967764),{loadableGenerated:{modules:[319836]},ssr:!1,loading:()=>(0,t.jsx)(n.PollCardSkeleton,{})});e.s(["default",0,function(e){let[l,r]=(0,i.useState)(!1);return((0,i.useEffect)(()=>{let e=null,t=!1,n=()=>{t||r(!0)},l=()=>{if("requestIdleCallback"in window){e=window.requestIdleCallback(n,{timeout:2e3});return}n()};return"complete"===document.readyState?l():window.addEventListener("load",l,{once:!0}),()=>{t=!0,window.removeEventListener("load",l),null!==e&&"cancelIdleCallback"in window&&window.cancelIdleCallback(e)}},[]),l)?(0,t.jsx)(a,{...e}):(0,t.jsx)(n.PollCardSkeleton,{})}])},847518,e=>{"use strict";var t=e.i(843476),n=e.i(760477),l=e.i(979818);function i(){return(0,t.jsxs)("div",{className:"flex min-h-[245px] w-full flex-col overflow-hidden rounded-[20px] p-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-overlay-secondary h-3 w-[96px] animate-pulse rounded-xl"}),(0,t.jsx)("div",{className:"bg-overlay-secondary h-3 w-[68px] animate-pulse rounded-xl"})]}),(0,t.jsx)("div",{className:"bg-overlay-secondary mt-3 h-5 w-[210px] animate-pulse rounded-xl"}),(0,t.jsx)("div",{className:"bg-overlay-secondary mt-auto h-9 w-[72px] animate-pulse rounded-full"})]})}function a(){return(0,t.jsxs)("div",{className:"border-tertiary bg-overlay-tertiary flex min-h-[132px] w-full flex-col rounded-[20px] border p-5",children:[(0,t.jsx)("div",{className:"bg-overlay-secondary mb-3 h-4 w-[180px] animate-pulse rounded-xl"}),(0,t.jsx)("div",{className:"bg-overlay-secondary h-3 w-[240px] animate-pulse rounded-xl"}),(0,t.jsx)("div",{className:"bg-overlay-secondary mt-auto h-9 w-full animate-pulse rounded-full"})]})}function r({showHomepageExtras:e=!1}={}){return(0,t.jsxs)("div",{className:"flex w-sidebar max-w-sidebar flex-col gap-4",children:[(0,t.jsx)(l.PollCardSkeleton,{}),e?(0,t.jsx)(i,{}):null,(0,t.jsx)(l.PopularAnimeCardSkeleton,{}),e?(0,t.jsx)(a,{}):null]})}var s=e.i(240936),o=e.i(519227),u=e.i(131073),d=e.i(184531),c=e.i(863176),m=e.i(842239),f=e.i(328379),h=e.i(955098);let p="homepage-community-selector-section mb-8 hidden w-full min-[1074px]:block",g="mb-3 text-tertiary text-[11px] font-medium uppercase tracking-[0.16em]",x="homepage-community-selector-grid";function b(e){return 168*e+(e-1)*14}function y(){return(0,t.jsx)("div",{className:"h-[240px] w-full min-w-0 animate-pulse rounded-[20px] bg-overlay-tertiary","aria-hidden":!0})}function v(){return(0,t.jsxs)("section",{className:p,"aria-hidden":!0,children:[(0,t.jsx)("div",{className:g,children:"Communities"}),(0,t.jsx)("div",{className:x,children:Array.from({length:6},(e,n)=>(0,t.jsx)(y,{},`skeleton-${n}`))})]})}b(6),b(5),b(4);var C=e.i(558184),E=e.i(581794),w=e.i(840278),N=e.i(42469),j=e.i(366096),M=e.i(296557),S=e.i(138413),I=e.i(522016),T=e.i(271645);let _=new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1});function k(){let{authenticated:e}=(0,E.useAuth)(),{data:n,loading:l,error:i}=(0,S.useQuery)(h.GET_HOMEPAGE_COMMUNITIES_GALLERY_PUBLIC,{fetchPolicy:"cache-first",context:{skipAuth:!0,skipAuthReadyRefetch:!0}}),{data:a,loading:r,error:s}=(0,S.useQuery)(h.GET_HOMEPAGE_COMMUNITIES_GALLERY_VIEWER_OVERLAY,{skip:!e,fetchPolicy:"cache-and-network"});(0,T.useEffect)(()=>{i&&console.error("[HomepageCommunitySelector] public query failed",{error:i})},[i]),(0,T.useEffect)(()=>{s&&console.error("[HomepageCommunitySelector] viewer query failed",{error:s})},[s]);let o=(0,T.useMemo)(()=>{let e=new Set;for(let t of a?.communities??[])t.isJoinedByMe&&e.add(t.slug);for(let t of a?.myCommunities??[])t.isJoinedByMe&&e.add(t.slug);return e},[a?.communities,a?.myCommunities]),u=(0,T.useMemo)(()=>{let e=n?.communities??[],t=e.find(e=>e.slug===N.GENERAL_COMMUNITY_SLUG),l=e.find(e=>e.slug===j.ONE_PIECE_COMMUNITY_SLUG),i=e.find(e=>e.slug===M.ROMANCE_ANIME_COMMUNITY_SLUG),a=[...t?[t]:[],...l?[l]:[],...i?[i]:[]],r=new Set(a.map(e=>e.slug)),s=6-a.length;return[...a,...e.filter(e=>!r.has(e.slug)).slice().sort((e,t)=>
1t.memberCount-e.memberCount).slice(0,s)]},[n?.communities]);if(!l&&0===u.length)return null;let d=e&&r&&!a,c=l&&0===u.length;return(0,t.jsxs)("section",{className:p,"aria-label":"Communities",children:[(0,t.jsx)("h2",{className:g,children:"Communities"}),(0,t.jsx)("div",{className:x,children:c?Array.from({length:6},(e,n)=>(0,t.jsx)(y,{},`skeleton-${n}`)):u.map((e,n)=>(0,t.jsx)(A,{community:e,isJoined:o.has(e.slug),isLoadingMembership:d,position:n},e.id))})]})}function A({community:e,isJoined:n,isLoadingMembership:l,position:i}){let a,r,{trackEvent:s}=(0,C.usePosthogMetrics)(),o=`/c/${e.slug}`,u=(0,w.convertToMediumImageUrl)(e.backdropImageUrl??e.posterImageUrl??"https://animedotcom.b-cdn.net/metadata_images/homepage.png"),d=(0,N.shouldShowCommunityMemberCounts)(e.slug),c=i<6,h=i<3,p=(0,T.useMemo)(()=>({communitySlug:e.slug,communityName:e.name,position:i,source:"homepage_community_selector"}),[e.name,e.slug,i]),g=(0,T.useCallback)(()=>{s("homepageCommunitySelectorCommunityClicked",p)},[s,p]),x=(0,T.useCallback)(e=>{s("homepageCommunitySelectorJoinClicked",{...p,action:e?"join":"leave"})},[s,p]),b=(0,T.useCallback)(e=>{s("homepageCommunitySelectorJoinCompleted",{...p,action:e?"join":"leave"})},[s,p]),y=(0,T.useCallback)((e,t)=>{s("homepageCommunitySelectorJoinFailed",{...p,action:e?"join":"leave",error:t instanceof Error?t.message:"Unknown error"})},[s,p]);return(0,t.jsxs)("article",{className:"group relative h-[240px] min-w-0 overflow-hidden rounded-[20px] border border-white/[0.06] bg-l1 shadow-glow-sm",children:[(0,t.jsx)("img",{src:u,alt:"",loading:c?"eager":"lazy",decoding:"async",fetchPriority:h?"high":void 0,className:"absolute inset-0 size-full scale-[1.02] object-cover transition-transform duration-200 group-hover:scale-[1.05]"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-black/50 via-black/70 to-black/95","aria-hidden":!0}),(0,j.isNewCommunitySlug)(e.slug)?(0,t.jsx)(f.CommunityNewBadge,{className:"left-4 top-4"}):null,(0,t.jsx)(I.default,{href:o,prefetch:!1,onClick:g,className:"absolute inset-0 z-[1] block outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-l0","aria-label":`Open ${e.name}`}),(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 z-[2] flex flex-col justify-end gap-1.5 p-4 pr-11",children:[(0,t.jsx)("h3",{className:"text-alwaysWhite pointer-events-none line-clamp-2 text-base font-bold leading-tight",children:(0,t.jsx)(I.default,{href:o,prefetch:!1,onClick:g,className:"pointer-events-auto outline-none focus-visible:underline",children:e.name})}),d?(0,t.jsxs)("div",{className:"pointer-events-none flex min-w-0 items-center gap-2 text-[12px] text-white/70 tabular-nums",children:[(0,t.jsxs)("span",{className:"truncate",children:[(0,t.jsx)("strong",{className:"text-alwaysWhite font-semibold",children:(a=e.memberCount,_.format(a))})," ","members"]}),e.onlineMemberCount>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"size-[3px] shrink-0 rounded-full bg-white/30"}),(0,t.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"size-1.5 rounded-full bg-[#2BD964] shadow-[0_0_6px_rgba(43,217,100,0.6)]"}),(0,t.jsx)("strong",{className:"text-alwaysWhite font-semibold",children:(r=e.onlineMemberCount,_.format(r))})," ","online"]})]}):null]}):null]}),(0,t.jsx)("div",{className:"pointer-events-auto absolute bottom-4 right-4 z-[3]",children:(0,t.jsx)(m.CommunityJoinButton,{slug:e.slug,isJoined:n,isLoading:l,iconOnly:!0,variant:"secondary",stopPropagation:!0,onToggleStarted:x,onToggleCompleted:b,onToggleFailed:y})})]})}var O=e.i(574368),P=e.i(554448),L=e.i(165419),R=e.i(618566);let U=[N.GENERAL_COMMUNITY_SLUG,j.ONE_PIECE_COMMUNITY_SLUG,M.ROMANCE_ANIME_COMMUNITY_SLUG,c.APOTHECARY_DIARIES_SLUG,"frieren-beyond-journeys-end","attack-on-titan","chainsaw-man"],G=new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1});function D(){let{authenticated:e,ready:n}=(0,E.useAuth)(),{trackEvent:l}=(0,C.usePosthogMetrics)(),i=(0,R.useRouter)(),a=(0,P.useNavigationFallback)({timeoutMs:600,warningSource:"HomepageMobileCommunityBrowser"}),r=(0,T.useRef)(new Set),s=(0,T.useRef)(null),o=(0,T.useRef)(0),{data:u,loading:d,error:c}=(0,S.useQuery)(h.GET_HOMEPAGE_COMMUNITIES_GALLERY_PUBLIC,{fetchPolicy:"cache-first",context:{skipAuth:!0,skipAuthReadyRefetch:!0}}),{data:m,loading:f,error:p}=(0,S.useQuery)(h.GET_HOMEPAGE_COMMUNITIES_GALLERY_VIEWER_OVERLAY,{skip:!n||!e,fetchPolicy:"cache-and-network"});(0,T.useEffect)(()=>{c&&console.error("[HomepageMobileCommunityBrowser] public query failed",{error:c})},[c]),(0,T.useEffect)(()=>{p&&console.error("[HomepageMobileCommunityBrowser] viewer query failed",{error:p})},[p]);let g=(0,T.useMemo)(()=>{let e=new Set;for(let t of m?.communities??[])t.isJoinedByMe&&e.add(t.slug);for(let t of m?.myCommunities??[])t.isJoinedByMe&&e.add(t.slug);return e},[m?.communities,m?.myCommunities]),x=(0,T.useMemo)(()=>{let e=new Map((u?.communities??[]).map(e=>[e.slug,e]));return U.map(t=>e.get(t)).filter(e=>!!e)},[u?.communities]),b=(0,T.useMemo)(()=>{let e=x.find(e=>e.slug===N.GENERAL_COMMUNITY_SLUG),t=x.find(e=>e.slug===j.ONE_PIECE_COMMUNITY_SLUG),n=x.find(e=>e.slug===M.ROMANCE_ANIME_COMMUNITY_SLUG),l=new Set([N.GENERAL_COMMUNITY_SLUG,j.ONE_PIECE_COMMUNITY_SLUG,M.ROMANCE_ANIME_COMMUNITY_SLUG]),i=x.filter(e=>!l.has(e.slug));return[...e?[e]:[],...t?[t]:[],...n?[n]:[],...i.filter(e=>!g.has(e.slug)),...i.filter(e=>g.has(e.slug))]},[x,g]),y=(0,T.useCallback)(e=>{r.current.has(e)||(r.current.add(e),i.prefetch(e))},[i]),v=(0,T.useCallback)(()=>{l("mobileCommunityBrowserSeeMoreClicked",{source:"homepage",communityCount:b.length})},[b.length,l]),w=(0,T.useCallback)(e=>{if("mouse"!==e.pointerType||0!==e.button)return;let t=e.target;if(t instanceof Element&&t.closest("button"))return;let n=e.currentTarget;n.scrollWidth<=n.clientWidth||(s.current={pointerId:e.pointerId,startX:e.clientX,scrollLeft:n.scrollLeft,didDrag:!1})},[]),_=(0,T.useCallback)(e=>{let t=s.current;if(!t||t.pointerId!==e.pointerId)return;let n=e.clientX-t.startX;!t.didDrag&&5>Math.abs(n)||(t.didDrag=!0,e.currentTarget.hasPointerCapture(e.pointerId)||e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.currentTarget.scrollLeft=t.scrollLeft-n)},[]),k=(0,T.useCallback)(e=>{let t=s.current;t&&t.pointerId===e.pointerId&&(t.didDrag&&(o.current=Date.now()+350),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),s.current=null)},[]),A=(0,T.useCallback)(e=>{let t=s.current;!t||t.pointerId!==e.pointerId||t.didDrag||(s.current=null)},[]),O=(0,T.useCallback)(e=>{Date.now()>o.current||(e.preventDefault(),e.stopPropagation(),o.current=0)},[]),G=(0,T.useCallback)(e=>{e.preventDefault()},[]);return d||0!==b.length?(0,t.jsx)("div",{className:"-mx-page-content-x pb-2 sm:-mx-page-content-x-sm",children:(0,t.jsxs)("div",{className:"no-scrollbar flex cursor-grab select-none gap-2 overflow-x-auto px-page-content-x pb-2 active:cursor-grabbing sm:px-page-content-x-sm",onClickCapture:O,onDragStart:G,onPointerCancel:k,onPointerDown:w,onPointerLeave:A,onPointerMove:_,onPointerUp:k,children:[b.map((l,i)=>(0,t.jsx)(Y,{community:l,isJoined:g.has(l.slug),isLoadingMembership:e&&(!n||f)&&!m,position:i,onPrefetch:y,onNavigateStart:a},l.id)),d&&0===b.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H,{}),(0,t.jsx)(H,{})]}):null,(0,t.jsxs)(I.default,{href:"/communities",className:"relative inline-flex h-[154px] w-[92px] shrink-0 flex-col items-center justify-center gap-2 whitespace-nowrap rounded-2xl border border-dashed border-tertiary bg-transparent px-3 text-center text-xs font-medium text-secondary hover:bg-overlay-secondary hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",onClick:v,children:[(0,t.jsx)(L.ArrowRightIcon,{className:"size-4","aria-hidden":!0}),"See more"]})]})}):null}function Y({community:e,isJoined:n,isLoadingMembership:l,position:i,onPrefetch:a,onNavigateStart:r}){let s,{trackEvent:o}=(0,C.usePosthogMetrics)(),u=`/c/${e.slug}`,d=(0,w.convertToMediumImageUrl)(e.backdropImageUrl??e.posterImageUrl??O.COMMUNITY_GALLERY_CARD_HERO_FALLBACK)||O.COMMUNITY_GALLERY_CARD_HERO_FALLBACK,c=(0,N.shouldShowCommunityMemberCounts)(e.slug),h=i<3,p=0===i,g=(0,T.useMemo)(()=>
1({communitySlug:e.slug,communityName:e.name,position:i,source:"homepage_mobile_community_browser"}),[e.name,e.slug,i]),x=(0,T.useCallback)(e=>{var t;e.defaultPrevented||0!==(t=e).button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||"_blank"===t.currentTarget.target||r(u),o("mobileCommunityBrowserCommunityClicked",g)},[u,r,o,g]),b=(0,T.useCallback)(()=>{a(u)},[u,a]),y=(0,T.useCallback)(e=>{o("mobileCommunityBrowserJoinClicked",{...g,action:e?"join":"leave"})},[o,g]),v=(0,T.useCallback)(e=>{o("mobileCommunityBrowserJoinCompleted",{...g,action:e?"join":"leave"})},[o,g]),E=(0,T.useCallback)((e,t)=>{o("mobileCommunityBrowserJoinFailed",{...g,action:e?"join":"leave",error:t instanceof Error?t.message:"Unknown error"})},[o,g]);return(0,t.jsxs)("article",{className:"relative h-[154px] w-[148px] shrink-0 overflow-hidden rounded-2xl border border-tertiary bg-l1",children:[(0,t.jsxs)(I.default,{href:u,prefetch:!1,onClick:x,onTouchStart:b,className:"group absolute inset-0 z-[1] block outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-l0","aria-label":`Open ${e.name}`,children:[(0,t.jsx)("img",{src:d,alt:"",loading:h?"eager":"lazy",decoding:"async",fetchPriority:p?"high":void 0,className:"absolute inset-0 size-full scale-[1.02] object-cover opacity-80 transition-transform duration-200 group-hover:scale-[1.05]"}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-black/50 via-black/70 to-black/95","aria-hidden":!0})]}),(0,j.isNewCommunitySlug)(e.slug)?(0,t.jsx)(f.CommunityNewBadge,{className:"left-4 top-4 z-10"}):null,(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 z-[2] flex flex-col justify-end gap-1.5 p-4 pr-11",children:[(0,t.jsx)("h3",{className:"text-alwaysWhite pointer-events-none line-clamp-2 text-sm font-bold leading-[1.12]",children:e.name}),c?(0,t.jsxs)("p",{className:"pointer-events-none text-[11px] font-medium text-white/70 tabular-nums",children:[(s=e.memberCount,G.format(s))," members"]}):null]}),(0,t.jsx)("div",{className:"pointer-events-auto absolute bottom-4 right-4 z-[3]",children:(0,t.jsx)(m.CommunityJoinButton,{slug:e.slug,isJoined:n,isLoading:l,iconOnly:!0,variant:"secondary",stopPropagation:!0,onToggleStarted:y,onToggleCompleted:v,onToggleFailed:E})})]})}function H(){return(0,t.jsx)("div",{className:"h-[154px] w-[148px] shrink-0 animate-pulse rounded-2xl bg-overlay-secondary","aria-hidden":!0})}function B(){return(0,t.jsxs)("section",{className:"mb-4 w-full min-[1074px]:hidden","aria-label":"Communities",children:[(0,t.jsx)("h2",{className:g,children:"Communities"}),(0,t.jsx)(D,{})]})}var F=e.i(344201),W=e.i(772500),z=e.i(939651),$=e.i(11408),J=e.i(618592),V=e.i(619357),q=e.i(458980),K=e.i(738692);let Q={skipAuth:!0,skipAuthReadyRefetch:!0};var X=e.i(597486),Z=e.i(272220),ee=e.i(591103),et=e.i(77977),en=e.i(534471),el=e.i(705971),ei=e.i(846932),ea=e.i(770703);let er=new Set,es={contentVisibility:"auto",containIntrinsicSize:"none auto 400px"},eo="TODAY",eu="THIS_WEEK",ed="TOP_MONTH",ec=(0,ea.default)(()=>e.A(77992),{loadableGenerated:{modules:[15892]},ssr:!1,loading:()=>(0,t.jsx)(eM,{})}),em=(0,ea.default)(()=>e.A(780770),{loadableGenerated:{modules:[375348]},ssr:!1,loading:()=>(0,t.jsx)(eM,{})}),ef=(0,ea.default)(()=>e.A(868623),{loadableGenerated:{modules:[899234]},ssr:!1,loading:()=>(0,t.jsx)(l.PopularAnimeCardSkeleton,{})}),eh=(0,ea.default)(()=>e.A(676912),{loadableGenerated:{modules:[37711]},ssr:!1,loading:()=>null}),ep=(0,ea.default)(()=>e.A(841498),{loadableGenerated:{modules:[319176]}}),eg=(0,ea.default)(()=>e.A(525295),{loadableGenerated:{modules:[741955]}}),ex=(0,ea.default)(()=>e.A(604627).then(e=>e.CommunityApothecaryWordPuzzleCard),{loadableGenerated:{modules:[298866]},ssr:!1,loading:()=>(0,t.jsx)(d.CommunityApothecaryWordPuzzleCardShell,{community:c.HOMEPAGE_APOTHECARY_WORD_PUZZLE_CARD_COMMUNITY,containerClassName:"sidebar-breakpoint:hidden"})}),eb=(0,ea.default)(()=>e.A(690129),{loadableGenerated:{modules:[949492]},ssr:!1}),ey=(0,ea.default)(()=>e.A(99611),{loadableGenerated:{modules:[249851]},ssr:!1}),ev=[{label:"Hot",value:"HOT"},{label:"Top",value:"TOP"},{label:"New",value:"NEW"}],eC=[{label:"Posts",value:"DISCUSSIONS"},{label:"Episode Discussions",value:"EPISODE_TALK"},{label:"Memes",value:"MEMES"},{label:"Tier Lists",value:"TIER_LISTS"},{label:"Grids",value:"THREE_BY_THREES"},{label:"Polls",value:"POLLS"},{label:"Reviews",value:"REVIEWS"},{label:"Guides",value:"GUIDES"}],eE={ALL_TIME:"TOP_ALL_TIME",[eo]:"TOP_DAY",[eu]:"TOP_WEEK",THIS_MONTH:ed},ew={DISCUSSIONS:["GENERAL_DISCUSSION"],EPISODE_TALK:["DISCUSSION"],MEMES:["MEME"],TIER_LISTS:["TIER_LIST"],THREE_BY_THREES:["THREE_BY_THREE"],POLLS:["POLL"],REVIEWS:["REVIEW"],GUIDES:["GUIDE","COSPLAY"]};function eN({children:e,className:n,isActive:l=!1,rightIcon:i,type:a="button",...r}){return(0,t.jsxs)("button",{type:a,className:(0,en.cn)("inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-full px-3 text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-40",l?"bg-cta-primary-neutral text-primary-inverse hover:opacity-80":"bg-overlay-secondary text-secondary hover:bg-overlay-primary hover:text-primary",n),...r,children:[e,i?(0,t.jsx)("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:i}):null]})}function ej(){return(0,t.jsxs)("div",{className:"relative z-[2] flex h-full min-h-[calc(100vh-145px)] w-full flex-col items-center justify-center",children:[(0,t.jsx)("div",{className:"mb-4 h-[200px] w-[200px]",children:(0,t.jsx)("img",{src:"https://animedotcom.b-cdn.net/stickers/first-fans/default/25.png",alt:"",loading:"lazy",decoding:"async",className:"h-full w-full"})}),(0,t.jsx)("div",{className:"text-secondary font-medium",children:"Oops! Something went wrong."})]})}function eM(){return(0,t.jsxs)("div",{className:"border-tertiary bg-overlay-tertiary relative flex flex-col gap-5 rounded-[20px] border px-5 py-5 sm:px-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("div",{className:"bg-overlay-secondary h-12 w-12 shrink-0 animate-pulse rounded-[12px] border border-secondary"}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)("p",{className:"text-primary text-sm font-medium",children:"You"})})]}),(0,t.jsx)("div",{className:"text-tertiary mb-8 text-base leading-[1.64]",children:"What's on your mind?"}),(0,t.jsxs)("div",{className:"flex items-end justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-h-9 min-w-0 flex-1 items-center gap-2",children:[(0,t.jsx)("span",{className:"bg-overlay-secondary inline-flex h-9 w-9 shrink-0 rounded-full","aria-hidden":!0}),(0,t.jsx)("span",{className:"bg-overlay-secondary inline-flex h-9 w-[86px] shrink-0 rounded-full","aria-hidden":!0}),(0,t.jsx)("span",{className:"bg-overlay-secondary inline-flex h-9 w-9 shrink-0 rounded-full","aria-hidden":!0})]}),(0,t.jsx)("span",{className:"bg-overlay-secondary text-primary inline-flex h-9 shrink-0 items-center justify-center rounded-full px-4 text-sm font-medium",children:"Post"})]})]})}function eS({children:e}){let[n,l]=(0,T.useState)(!1),i=(0,T.useRef)(null),a=(0,T.useRef)(!1);return(0,T.useEffect)(()=>
1{if(a.current)return;let e=i.current;if(!e)return;let t=()=>{a.current||(a.current=!0,l(!0))};if("u"<typeof IntersectionObserver)return void t();let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(t(),n.disconnect())},{rootMargin:"600px 0px"});return n.observe(e),()=>n.disconnect()},[]),(0,t.jsx)("div",{ref:i,className:"min-h-px sm:hidden",children:n?e:null})}e.s(["default",0,function({sidebar:e,seasonalSnapshotDateIso:l,showMobileCommunityBrowser:i=!1,showHomepageCommunitySelector:a=!1,showComposer:d=!0}){let{authenticated:m,ready:f}=(0,E.useAuth)(),[h,p]=(0,T.useState)(!1),g=a?5e3:2e3;(0,T.useEffect)(()=>{let e=window.setTimeout(()=>p(!0),g);return()=>window.clearTimeout(e)},[g]);let{trackEvent:x}=(0,C.usePosthogMetrics)(),{isDesktop:b}=(0,ee.useDevice)(),y=(0,Z.useMedia)("(min-width: 1074px)",b),w=(0,Z.useMedia)("(min-width: 1280px)",b);(0,Z.useMedia)(F.MOBILE_BOTTOM_BAR_VIEWPORT_QUERY,!b);let[j,,M]=(0,X.useContainerWidth)(20,w),I=(0,T.useRef)(null),_=(0,T.useRef)(null),A=(0,T.useRef)(null),[O,P]=(0,T.useState)(!1),[L,R]=(0,T.useState)(!1),[U,G]=(0,T.useState)("HOT"),[D,Y]=(0,T.useState)(null),[H,ea]=(0,T.useState)([]),[eI,eT]=(0,T.useState)(null),[e_,ek]=(0,T.useState)(!0),[eA,eO]=(0,T.useState)([]),eP=(0,T.useMemo)(()=>0===H.length||H.length===eC.length?null:H.flatMap(e=>ew[e]),[H]),eL=f&&m?eo:eu,eR=D??A.current??eL,eU=(0,T.useMemo)(()=>({...null===eP?{communityContentOnly:!0}:{sourceTypes:eP},dateWindow:"TOP"===U?eR:void 0,sortByType:"NEW"===U?"CREATED_AT":"TOP"===U?eE[eR]??ed:void 0}),[eR,U,eP]),eG=(0,T.useMemo)(()=>({...eU,communitySlugs:[N.GENERAL_COMMUNITY_SLUG]}),[eU]),{updates:eD,loading:eY,error:eH,hasMoreToLoad:eB,loadMore:eF,refetch:eW}=(({first:e=20,loadMoreFirst:t=e,after:n,skip:l=!1,filter:i,publicFilter:a,usePublicQuery:r=!1,publicFirst:s=!1}={})=>{let{languageCode:o,countryCode:u}=(0,K.getLocale)(),{authenticated:d,hasSession:c,ready:m}=(0,E.useAuth)(),{setRecommendationId:f}=(0,q.useContentEvents)(),[h,p]=(0,T.useState)(!1),g=(0,T.useRef)(!1),[x,b]=(0,T.useState)(!1),[y,v]=(0,T.useState)(null),C=!!(i?.bookmarksOnly||i?.watchlistOnly||i?.joinedCommunitiesOnly),w=s&&(!C||!!a),N=(0,T.useMemo)(()=>({...a??i}),[i,a]),j=(0,T.useMemo)(()=>({...i,personalizedRecommendationId:y}),[i,y]),M=(0,T.useMemo)(()=>({languageCode:o,countryCode:u,mainPagination:{first:e,after:n},mainFilter:N}),[n,u,e,o,N]),I=(0,T.useMemo)(()=>({...M,mainFilter:j}),[j,M]),{data:_,loading:k,error:A,fetchMore:O,refetch:P}=(0,S.useQuery)(J.GET_COMMUNITY_CONTENT_PUBLIC,{variables:M,skip:l||!r&&!w,fetchPolicy:"cache-first",context:Q,notifyOnNetworkStatusChange:!0}),{data:L,loading:R,error:U,fetchMore:G,refetch:D}=(0,S.useQuery)(J.GET_COMMUNITY_CONTENT,{variables:I,skip:l||r||(w?!d:!m),notifyOnNetworkStatusChange:!0}),Y=function({shouldUsePublicFirst:e,hasSession:t,ready:n,hasAuthenticatedOnlyFilter:l}){return!!e&&!!t&&(l||!n)}({shouldUsePublicFirst:w,hasSession:c,ready:m,hasAuthenticatedOnlyFilter:C}),{data:H,loading:B,error:F}=function({shouldUsePublicFirst:e,usePublicQuery:t,waitForAuthFeed:n,authReady:l,publicData:i,authData:a,publicLoading:r,authLoading:s,publicError:o,authError:u}){return e?a?.main&&l?{data:a,loading:!1,error:void 0}:n?{data:void 0,loading:!l||s,error:l?u:void 0}:{data:i,loading:!i?.main&&r,error:i?.main?void 0:o??u}:t?{data:i,loading:r,error:o}:{data:a,loading:s,error:u}}({shouldUsePublicFirst:w,usePublicQuery:r,waitForAuthFeed:Y,authReady:m,publicData:_,authData:L,publicLoading:k,authLoading:R,publicError:A,authError:U}),W=r||w&&!L?.main?O:G,z=r||w&&!L?.main?J.GET_COMMUNITY_CONTENT_PUBLIC:J.GET_COMMUNITY_CONTENT,$=r||w&&!L?.main?N:j,X=(0,T.useMemo)(()=>F?[]:H?.main?.edges?.map(({node:e})=>e)??[],[H,F]),Z=(0,T.useMemo)(()=>{let e=new Map;return X.forEach(t=>{e.set(t.id,t)}),Array.from(e.values())},[X]),ee=(0,T.useMemo)(()=>H?.main?.pageInfo??null,[H]);(0,T.useEffect)(()=>{if(r||w&&!L?.main){v(null),f(H?.main?.recommendationId||null);return}H?.main?.recommendationId&&v(H.main.recommendationId),f(H?.main?.recommendationId||null)},[L?.main,H?.main?.recommendationId,f,w,r]);let et=(0,T.useRef)(H);et.current=H;let en=(0,T.useCallback)(async()=>
1{if(g.current||w&&d&&!L?.main)return;let e=et.current;if(e?.main?.pageInfo?.hasNextPage&&e?.main?.pageInfo?.endCursor){g.current=!0,p(!0);try{await W({query:z,variables:{languageCode:o,countryCode:u,mainPagination:{first:t,after:e.main.pageInfo.endCursor},mainFilter:$},updateQuery:(e,{fetchMoreResult:t})=>t?.main?{...e,main:{...t.main,edges:[...e.main?.edges??[],...t.main.edges]}}:e})}catch(e){console.error("Error loading more community content embeddings:",e)}finally{g.current=!1,p(!1)}}},[u,d,L?.main,W,o,t,$,z,w]),el=(0,T.useCallback)(async()=>{try{b(!0),r?await P():w?await Promise.all([P(),d?D():Promise.resolve()]):await D()}finally{b(!1)}},[d,D,P,w,r]),ei=(0,T.useMemo)(()=>ee?.hasNextPage&&!!ee?.endCursor,[ee?.hasNextPage,ee?.endCursor]);return(0,V.useTierListPrefetch)({updates:Z,languageCode:o,countryCode:u}),{updates:Z,loading:!H&&B||x,error:F,pageInfo:ee,loadMore:en,refetch:el,hasMoreToLoad:ei,isLoadingMore:h}})({first:4,loadMoreFirst:12,filter:(0,T.useMemo)(()=>({...eU,...f&&m?{joinedCommunitiesOnly:!0}:{communitySlugs:[N.GENERAL_COMMUNITY_SLUG]}}),[m,eU,f]),publicFilter:eG,publicFirst:!0,skip:!1}),ez=(0,T.useMemo)(()=>{let e=new Set(eA.map(e=>e.id));return[...eA,...eD.filter(t=>!e.has(t.id))]},[eD,eA]),e$=0===ez.length&&!eY&&!eH&&f,eJ=(0,T.useMemo)(()=>!O||y?[]:[{key:"mobile-community-polls",afterIndex:1,element:(0,t.jsx)(eS,{children:(0,t.jsx)(z.default,{isInlineWithFeed:!0})})},{key:"mobile-community-popular-anime",afterIndex:3,element:(0,t.jsx)(eS,{children:(0,t.jsx)(ef,{isInlineWithFeed:!0,seasonalSnapshotDateIso:l})})}],[y,O,l]),eV=(0,T.useMemo)(()=>i?{key:"mobile-community-rate-and-sort",afterIndex:2,element:(0,t.jsx)(eS,{children:(0,t.jsx)(eb,{containerClassName:"sidebar-breakpoint:hidden"})})}:null,[i]),eq=(0,T.useMemo)(()=>i?{key:"mobile-community-apothecary-word-puzzle",afterIndex:2,element:(0,t.jsx)(eS,{children:(0,t.jsx)(ex,{community:c.HOMEPAGE_APOTHECARY_WORD_PUZZLE_CARD_COMMUNITY,analyticsSource:"homepage_mobile_feed",containerClassName:"sidebar-breakpoint:hidden",hideWhenCompleted:!0,requireJoined:!0})})}:null,[i]),eK=eq&&ez.length>0?Math.min(eq.afterIndex,ez.length-1):null,eQ=()=>{(0,en.scrollTargetTo)((0,en.getScrollTarget)(I.current),0,"auto")},eX=()=>{eO([]),eQ()},eZ=()=>{eX(),eW()},e0=e=>{eO(t=>[e,...t]),eQ()},e1=()=>f?m?(0,t.jsx)(ec,{source:"community",hideCreatorTools:!0,onPostCreated:e0}):(0,t.jsx)(em,{}):(0,t.jsx)(eM,{}),e2=(0,T.useRef)(eZ);e2.current=eZ,(0,T.useEffect)(()=>{let e=()=>e2.current();return window.addEventListener("home-feed-refresh",e),()=>window.removeEventListener("home-feed-refresh",e)},[]),(0,T.useEffect)(()=>{x("pageView",{feedType:"All"})},[x]),(0,T.useEffect)(()=>{P(!0)},[]),(0,T.useEffect)(()=>{let e=null,t=null,n=!1,l=()=>{n||R(!0)},i=()=>{if("function"==typeof window.requestIdleCallback){t=window.requestIdleCallback(l,{timeout:3e3});return}e=setTimeout(l,3e3)};return"complete"===document.readyState?i():window.addEventListener("load",i,{once:!0}),()=>{n=!0,window.removeEventListener("load",i),null!==t&&"function"==typeof window.cancelIdleCallback&&window.cancelIdleCallback(t),null!==e&&clearTimeout(e)}},[]),(0,T.useEffect)(()=>{f&&null===D&&null===A.current&&(A.current=eL)},[eL,f,D]),(0,T.useEffect)(()=>{eX()},[U,eR,H]);let e4=(0,T.useRef)(!1);(0,T.useEffect)(()=>{e4.current=!0},[]);let e7=`${U}-${"TOP"===U?eR:""}-${[...H].sort().join(",")}`;(0,T.useEffect)(()=>{let e=_.current;if(!L||!e||!eB||eY||eH)return;let t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&eF?.()},{threshold:0,rootMargin:"0px 0px 600px 0px"});return t.observe(e),()=>t.disconnect()},[L,eB,eF,eY,eH,ez.length]);let e3=(e,n,l="compact-card")=>(0,t.jsx)("div",{style:es,children:(0,t.jsx)(s.default,{contentEmbedding:e,areVideosMuted:e_,setAreVideosMuted:ek,activeVideoRef:eI,setActiveVideoRef:eT,showPins:!1,index:n,selectedTopics:er,feedType:"community",variant:l})});return(0,t.jsxs)("div",{ref:I,className:"w-full min-h-screen",children:[h?(0,t.jsx)(ey,{}):null,(0,t.jsxs)("div",{className:"pb-12 w-full px-page-content-x pt-page-content-top sm:px-page-content-x-sm sm:pt-page-content-top-sm",children:[a?y?(0,t.jsx)(k,{}):(0,t.jsx)(v,{}):null,(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-5",children:[ev.map(e=>{let n=U===e.value;return(0,t.jsx)(eN,{type:"button","aria-pressed":n,isActive:n,onClick:()=>{G(e.value),Y(null),ea([])},children:e.label},e.value)}),(0,t.jsx)(eg,{value:H,options:eC,onChange:e=>ea(e),placeholder:"All types",selectedLabel:e=>0===e||e===eC.length?"All types":`${e} Type${1===e?"":"s"}`,trigger:(0,t.jsx)(eN,{rightIcon:(0,t.jsx)(el.ChevronDownIcon,{className:"h-4 w-4"}),children:0===H.length||H.length===eC.length?"All types":`${H.length} Type${1===H.length?"":"s"}`})}),"TOP"===U&&(0,t.jsx)(ep,{value:f?eR:"",options:n.COMMUNITY_DATE_WINDOW_OPTIONS,onChange:e=>Y(e),placeholder:"Date",disabled:!f})]}),i?(0,t.jsx)(B,{}):null,(0,t.jsxs)("div",{className:"hfs-row w-full !justify-between sidebar-breakpoint:!flex-row sidebar-breakpoint:!items-start sidebar-breakpoint:!gap-4",children:[(0,t.jsx)("div",{ref:j,className:"flex flex-col flex-1 gap-4 w-full min-w-0",children:(0,t.jsx)(ei.motion.div,{initial:!!e4.current&&{opacity:0}
1,animate:{opacity:1},transition:{duration:.2,ease:[.23,1,.32,1]},className:"flex flex-col gap-4 w-full min-w-0",children:(()=>{if(eH&&0===ez.length)return(0,t.jsx)(ej,{});if(eY&&0===ez.length){let e=[...d?[{key:"feed-actions-skeleton",node:(0,t.jsx)("div",{className:"flex flex-col gap-4",children:(0,t.jsx)(eM,{})}),estimatedHeight:230}]:[],...Array.from({length:4},(e,n)=>({key:`skeleton-${n}`,node:(0,t.jsx)(u.CommunityFeedCardSkeleton,{flat:a}),estimatedHeight:160}))];return w?(0,t.jsx)(o.MasonryGrid,{items:e,className:"mb-6",desktopOnly:!0}):(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:(0,en.cn)("flex flex-col",a?"":"gap-4"),children:[d?(0,t.jsx)(eM,{}):null,Array.from({length:4},(e,n)=>(0,t.jsx)(u.CommunityFeedCardSkeleton,{flat:a},n))]})})}if(e$)return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:"flex min-h-[calc(100vh-280px)] w-full flex-col items-center justify-center",children:(0,t.jsx)("div",{className:"flex flex-col justify-center items-center",children:(0,t.jsx)("p",{className:"text-disabled",children:"No community posts for this filter."})})})});let e=[...d?[{key:"feed-actions",node:(0,t.jsx)("div",{className:"flex flex-col gap-4",children:e1()}),estimatedHeight:230}]:[],...ez.map((e,t)=>({key:`${e.id}-${t}`,node:e3(e,t,"compact-card"),estimatedHeight:w?(0,et.estimateFeedCardHeight)(e,M):400}))],n=w?(0,t.jsx)(o.MasonryGrid,{items:e,className:"mb-6",desktopOnly:!0}):(0,t.jsxs)("div",{children:[d?(0,t.jsx)("div",{className:"mb-4 flex flex-col gap-4",children:e1()}):null,(0,t.jsx)("div",{className:(0,en.cn)("mb-6 flex flex-col",a?"sm:gap-2":"gap-4"),children:ez.map((e,n)=>(0,t.jsxs)(T.Fragment,{children:[e3(e,n,a?"flat":"compact-card"),eV&&eK===n?(0,t.jsx)(T.Fragment,{children:eV.element},eV.key):null,eK===n&&eq?(0,t.jsx)(T.Fragment,{children:eq.element},eq.key):null,eJ.filter(e=>e.afterIndex===n).map(e=>(0,t.jsx)(T.Fragment,{children:e.element},e.key))]},`${e.id}-${n}`))})]});return(0,t.jsxs)(t.Fragment,{children:[n,eB?(0,t.jsx)("div",{ref:_,className:"mb-5",children:(0,t.jsx)(W.default,{})}):(0,t.jsx)(eh,{refreshUpdates:eZ})]})})()},e7)}),(0,t.jsx)($.default,{className:"hfs-sidebar sidebar-breakpoint:!flex w-sidebar shrink-0 self-start",enabled:O&&y,children:(0,t.jsx)("div",{className:"flex w-sidebar max-w-sidebar flex-col gap-4 text-primary",children:O&&y?e:(0,t.jsx)(r,{showHomepageExtras:a})})})]})]})]})}],847518)},858580,e=>{"use strict";var t=e.i(843476),n=e.i(581794),l=e.i(770703),i=e.i(271645);let a=(0,l.default)(()=>e.A(112223),{loadableGenerated:{modules:[997449]},ssr:!1});e.s(["default",0,function({alwaysShow:e,deferMount:l}={}){let{authenticated:r,ready:s}=(0,n.useAuth)(),o=e||s&&r,[u,d]=(0,i.useState)(!l);return((0,i.useEffect)(()=>{if(!l)return void d(!0);if(!o||u)return;let e=null,t=null,n=!1,i=()=>{n||d(!0)},a=()=>{if(!n){if("requestIdleCallback"in window){t=window.requestIdleCallback(i,{timeout:2e3});return}i()}},r=()=>{e=setTimeout(a,5e3)};return"complete"===document.readyState?r():window.addEventListener("load",r,{once:!0}),()=>{n=!0,window.removeEventListener("load",r),null!==e&&clearTimeout(e),null!==t&&"cancelIdleCallback"in window&&window.cancelIdleCallback(t)}},[u,l,o]),o&&u)?(0,t.jsx)(a,{}):null}])},27886,e=>{"use strict";var t=e.i(843476),n=e.i(337863),l=e.i(631197),i=e.i(511434),a=e.i(840278),r=e.i(979818),s=e.i(770703),o=e.i(271645);let u=(0,s.default)(()=>e.A(432346),{loadableGenerated:{modules:[735597]},ssr:!1,loading:()=>(0,t.jsx)(r.PopularAnimeCardSkeleton,{})});function d(e){let[n,l]=(0,o.useState)(!1);return((0,o.useEffect)(()=>{let e=null,t=null,n=!1,i=()=>{n||l(!0)},a=()=>{if("requestIdleCallback"in window){t=window.requestIdleCallback(i,{timeout:2e3});return}i()},r=()=>{e=setTimeout(a,2500)};return"complete"===document.readyState?r():window.addEventListener("load",r,{once:!0}),()=>{n=!0,window.removeEventListener("load",r),null!==e&&clearTimeout(e),null!==t&&"cancelIdleCallback"in window&&window.cancelIdleCallback(t)}},[]),n)?(0,t.jsx)(u,{...e}):(0,t.jsx)(r.PopularAnimeCardSkeleton,{})}var c=e.i(229505);let m={WINTER:l.AnimeScheduleSeason.Winter,SPRING:l.AnimeScheduleSeason.Spring,SUMMER:l.AnimeScheduleSeason.Summer,FALL:l.AnimeScheduleSeason.Fall};function f({season:e,year:t}){return{season:m[e],year:t}}function h(e){return e.map(e=>(0,c.toHomepagePopularAnimeItem)(e)).filter(e=>
1null!==e).slice(0,c.HOMEPAGE_POPULAR_ANIME_MAX_TITLES)}e.s(["default",0,function({className:e}){let{airing:s,upcoming:o,upcomingLabel:u}=(0,n.getAnimeScheduleBrowseSeasons)(),m=f(s),p=f(o),g=(0,i.useIpTitles)({filter:{sortByVoteCount:!0,sortByAirDate:!1,sortOrder:l.SortOrder.Desc,adult:!1,types:a.SHOW_TYPES,animeScheduleSeason:m},first:c.HOMEPAGE_POPULAR_ANIME_MAX_TITLES}),x=(0,i.useIpTitles)({filter:{sortByVoteCount:!0,sortByAirDate:!1,sortOrder:l.SortOrder.Desc,adult:!1,types:a.SHOW_TYPES,animeScheduleSeason:p},first:c.HOMEPAGE_POPULAR_ANIME_MAX_TITLES});if(g.loading||x.loading)return(0,t.jsx)(r.PopularAnimeCardSkeleton,{});g.error&&console.error("[HomepagePopularAnimeCached] Failed to fetch airing titles:",g.error),x.error&&console.error("[HomepagePopularAnimeCached] Failed to fetch upcoming titles:",x.error);let b=h(g.ipTitles),y=h(x.ipTitles);return 0===b.length&&0===y.length?null:(0,t.jsx)(d,{className:e,airingTitles:b,upcomingTitles:y,upcomingModeTitle:`Upcoming ${u} Anime`})}],27886)}]);
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.