1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="4b713adf-b38c-c497-c83c-231399778083")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,900359,e=>{"use strict";var t=e.i(478902),s=e.i(197649),n=e.i(695287),o=e.i(862460),a=e.i(389959),i=e.i(55343);e.i(523121);var l=e.i(867411),d=e.i(542398);e.i(871346);var r=e.i(969699),c=e.i(34321);e.i(282655);var u=e.i(817048),m=e.i(563281),p=e.i(988073),C=e.i(211400),f=e.i(225803),y=e.i(210982),x=e.i(597406),h=e.i(798240),S=e.i(396902),P=e.i(623690),k=e.i(198821),M=e.i(228837),T=e.i(649784),j=e.i(465149),g=e.i(547551),v=e.i(624334),E=e.i(860047),_=e.i(925677),R=e.i(736636),b=e.i(385799),F=e.i(323157),I=e.i(593296),N=e.i(738886),w=e.i(640978);e.i(444461);var O=e.i(33703),L=e.i(742841),D=e.i(553662),A=e.i(678460);let U=({filterMode:e,emptyState:s,onClickBackToTop:n})=>{let o=s?"There's nothing here yet":"You're all caught up",a=((e,t)=>{if(t)return"Create a new post or reply to get the discussion started";let s="There aren't any more posts";return e===E.FanPostsMode.MOST_RECS?s+=" with recs from the last week":e===E.FanPostsMode.MOST_REPLIES&&(s+=" with replies from the last week"),s})(e,s);return(0,t.jsxs)("div",{className:"_17zyd5s0",children:[(0,t.jsx)("span",{className:"_17zyd5s1",children:o}),(0,t.jsx)("span",{className:"_17zyd5s2",children:a}),!s&&(0,t.jsx)(N.default,{className:"_17zyd5s3",text:"Back to top",displayType:"cycloneSecondary",onClick:n})]})};var W="_1mj9kj89",B="_1mj9kj8a";let H=(0,n.observer)(function({tabIndex:e,fanPost:s,onDelete:n,onToggleRec:o,onPin:i,onUnpin:l,onReject:d,onReport:c,onOpenOrCloseReplies:u,displayType:m,filterMode:p,onClick:C}){let f=(0,y.useAnalytics)(),{contentStore:x,communityStore:S}=(0,I.useStore)(),P=x.get(s.id),k=(0,h.useCurrentCycloneCommunity)(),M=(0,D.getCommunityPostPath)(P?.shortID??"",k.cycloneCommunityPrefix),T=(0,a.useCallback)(()=>{f?.emit({event:"feedpost_click",feedpost_click:{component_name:"feed_index_page",url:`${window.location.origin}${M}`,title:P?.title}}),C&&P?.id&&C(P.id)},[f,M,C,P]);return P?(0,t.jsx)(r.default,{fanPost:P,onDelete:n,onToggleRec:o,onReject:d,onReport:c,onPin:i,onUnpin:l,onOpenOrCloseReplies:u,pinnedContentID:S.pinnedContentID,displayType:m,onClick:T,postPath:M,tabIndex:e,filterMode:p},P.id):null}),z=({hasNext:e,filterMode:s,numVisibleItems:n,onClickBackToTop:o,showFilterMessage:a})=>(0,t.jsx)(t.Fragment,{children:e?(0,t.jsx)(c.default,{}):(0,t.jsx)(t.Fragment,{children:(a||s===E.FanPostsMode.NEWEST)&&(0,t.jsx)(U,{filterMode:s,emptyState:0===n,onClickBackToTop:o})})}),V=(0,n.observer)(()=>{let{articleRef:e}=(0,L.useNavigationContext)(),n=(0,y.useAnalytics)(),{viewer:r,viewerBans:p,viewerSuspensions:C,viewerHasUnacknowledgedWarning:f}=(0,P.useCyclone)(),{communityStore:j,fanPostIndexStore:F}=(0,I.useStore)(),{userLoading:D}=(0,x.useAuth)(),[U,V]=(0,a.useState)(w.FanPostCardDisplayType.full),$=(0,h.useCurrentCycloneCommunity)(),K=j.pinnedContent,G=(0,a.useRef)(null),Y=(0,o.useSearchParams)().get("filterMode"),q=F.filterMode,J=q===E.FanPostsMode.MOST_RECS||q===E.FanPostsMode.MOST_REPLIES,[Q,X]=(0,a.useState)(!1),[Z,ee]=(0,a.useState)(!0),[et,es]=(0,a.useState)(null),[en,eo]=(0,a.useState)(null),[ea,ei]=(0,a.useState)(!0),[el,ed]=(0,a.useState)(!0),er=!!K&&q===E.FanPostsMode.NEWEST,ec=(0,a.useMemo)(()=>!Z&&!ea&&null!==en,[Z,ea,en]),eu=(0,a.useCallback)(()=>{G.current&&0!==en&&setTimeout(()=>{G.current?.scrollToIndex({index:en??0,behavior:"smooth"})},1200)},[en]);(0,a.useEffect)(()=>{ec&&(eu(),(0,g.updateNextToLastPageVisited)({alreadyLoaded:!0}))},[ec,eu]);let em=(0,a.useCallback)(async(e,t=!0)=>{if(es(null),F.setFilterMode(e??E.FanPostsMode.NEWEST),ee(!0),X(!1),await F.reload(r?.token,10,!0),t){let e=new URL(window.location.href);e.searchParams.delete("filterMode"),window.history.replaceState({},"",e)}ee(!1),setTimeout(()=>{(0,k.installAds)(),X(!0)},1e3)},[F,r?.token]),ep=(0,a.useCallback)(async()=>{let{nextToLastPageVisited:e,history:t}=(0,g.getFeedNavigationHistory)();if(!e||"feed_index"!==e.page||0===t.length||e.alreadyLoaded||(e.displayType&&e.displayType!==U&&V(e.displayType),e.filterMode&&e.filterMode!==q&&await em(e.filterMode),e.pinned))return void eo(0);if(e.state&&es(e.state),e.data){let t=e.data.findIndex(t=>"object"==typeof t&&t.id===e.postClicked);-1!==t&&eo(t)}},[q,em,U]);(0,a.useEffect)(()=>{ep()},[ep]),(0,a.useEffect)(()=>{D?ed(!0):setTimeout(()=>{ed(!1)},500)},[D]),(0,a.useEffect)(()=>
2{if(!el){if(!r||!r.settings||!r.settings.fanPostFeedMode)return void ei(!1);V(r.settings.fanPostFeedMode),ei(!1)}},[r,el]);let{cycloneConfig:{serverURL:eC}}=(0,S.useConfigContext)(),{contentStore:ef}=(0,I.useStore)(),ey=(0,A.useCoalescedCallback)(async e=>{r&&"isRecced"in e!=!1&&(e.isRecced?await (0,R.unrecContent)(e,eC,r.token,ef,{optimisticResponse:!0}):await (0,R.recContent)(e,eC,r.token,ef,{optimisticResponse:!0}))},[eC,r,ef]),ex=(0,a.useCallback)(()=>{ec&&!F.loadingMore&&F.loadMore()},[F,ec]),eh=(0,a.useCallback)(e=>{e&&F.setItems([{...e},...F.items])},[F]),eS=(0,a.useCallback)(e=>{n?.emit({event:"feed_click",feed_click:{name:e}})},[n]),eP=(0,a.useCallback)(e=>{let t=e.value;V(t),eS(t),r?.id&&(0,b.updateUserSettings)($.cycloneCommunityId,r.id,{fanPostFeedMode:t},eC,r.token)},[eC,r,eS,V,$]),ek=(0,a.useCallback)(e=>{let t=e===E.FanPostsMode.MOST_RECS?"feed_most_recs":e===E.FanPostsMode.MOST_REPLIES?"feed_most_replies":"feed_all_posts";n?.emit({event:t})},[n]);(0,a.useEffect)(()=>{Y?("mostRecs"===Y&&em(E.FanPostsMode.MOST_RECS,!1),"mostReplies"===Y&&em(E.FanPostsMode.MOST_REPLIES,!1)):ee(!1)},[Y,em]);let eM=(0,a.useCallback)(({id:e,deletedAt:t})=>{F.delete({id:e,deletedAt:t})},[F]),eT=(0,a.useCallback)(({id:e})=>{j.setPinnedContentID(e)},[j]),ej=(0,a.useCallback)(()=>{j.setPinnedContentID(null)},[j]),eg=(0,a.useCallback)(e=>{F.insert(e)},[F]),ev=(0,a.useCallback)(e=>{F.insert(e)},[F]),eE=(0,a.useCallback)(async(e,t)=>{if(!e.community||!r)return;let s=null;(s=t?await (0,_.openReplies)(e.community.id,e.id,eC,r.token):await (0,v.closeReplies)(e.community.id,e.id,eC,r.token))&&ef.insert(s)},[ef,eC,r]),e_=(0,a.useCallback)((e,t)=>{eE(e,t)},[eE]),eR=(0,a.useCallback)(()=>{G.current?.scrollToIndex({index:0,behavior:"smooth"})},[G]),eb=(0,a.useCallback)(()=>(0,t.jsx)(z,{hasNext:F.hasNext,filterMode:q,numVisibleItems:F.visibleItems.length,onClickBackToTop:eR,showFilterMessage:Q}),[F.hasNext,q,F.visibleItems.length,eR,Q]),eF=p.length>0||C.length>0||f,eI=(0,a.useCallback)(e=>{let t;G.current&&G.current.getState(e=>{t=e}),(0,g.addPageToFeedNavigationHistory)({page:"feed_index",postClicked:e,pinned:j.pinnedContentID===e,filterMode:q,displayType:U,state:t,data:F.visibleItemsWithNativeAds.slice(),endCursor:F.endCursor,hasNext:F.hasNext})},[j.pinnedContentID,q,U,G,F.visibleItemsWithNativeAds,F.endCursor,F.hasNext]);return(0,t.jsx)("div",{className:"_1mj9kj80",ref:e,children:(0,t.jsxs)("div",{className:"_1mj9kj82",children:[(0,t.jsxs)("div",{className:"_1mj9kj81",children:[(0,t.jsx)(O.default,{size:"medium",title:$.isPrimaryCommunity?"The Feed":`The ${$.displayName} Feed`,description:$.isPrimaryCommunity?'Community discussions<span class="extraDescription"> to feed your fandom</span>.':`Share your fandom with the ${$.displayName} community`}),(0,t.jsx)(l.FanPostComposer,{onSubmit:eh})]}),(0,t.jsx)(M.default,{}),!!eF&&(0,t.jsx)(d.default,{bans:p,suspensions:C,hasUnacknowledgedWarning:f,currentCommunity:$}),(0,t.jsxs)("div",{className:"_1mj9kj84",children:[(0,t.jsxs)("div",{className:"_1mj9kj85",children:[(0,t.jsxs)("div",{className:"_1mj9kj86",children:[(0,t.jsx)(N.default,{className:(0,s.default)(W,q===E.FanPostsMode.NEWEST&&B),text:"All",displayType:"cyclone",onClick:()=>{em(),ek(E.FanPostsMode.NEWEST)},active:q===E.FanPostsMode.NEWEST}),(0,t.jsx)(N.default,{className:(0,s.default)(W,q===E.FanPostsMode.MOST_RECS&&B),text:"Most Recs",displayType:"cyclone",onClick:()=>{em(E.FanPostsMode.MOST_RECS),ek(E.FanPostsMode.MOST_RECS)},active:q===E.FanPostsMode.MOST_RECS}),(0,t.jsx)(N.default,{className:(0,s.default)(W,q===E.FanPostsMode.MOST_REPLIES&&B),text:"Most Replies",displayType:"cyclone",onClick:()=>{em(E.FanPostsMode.MOST_REPLIES),ek(E.FanPostsMode.MOST_REPLIES)},active:q===E.FanPostsMode.MOST_REPLIES})]}),(0,t.jsx)("div",{className:"_1mj9kj87",children:(0,t.jsx)(m.Select,{value:U,options:[{value:w.FanPostCardDisplayType.full,display:"Expanded"},{value:w.FanPostCardDisplayType.compact,display:"Compact"}],onChange:eP})})]}),J&&(0,t.jsxs)("span",{className:"_1mj9kj88",children:["Posts from the last week with the most"," ",q===E.FanPostsMode.MOST_RECS?"recs":"replies"]})]}),!!er&&(0,t.jsx)(H,{tabIndex:0,fanPost:K,onDelete:eM,onPin:eT,onUnpin:ej,onToggleRec:ey,onOpenOrCloseReplies:e_,displayType:U,onReject:ev,onReport:eg,filterMode:q,onClick:eI}),ec?(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(i.Virtuoso,{id:"fanpost-feed-container",increaseViewportBy:{top:4e3,bottom:4e3}
2,ref:G,overscan:50,restoreStateFrom:et??void 0,useWindowScroll:!0,data:F.visibleItemsWithNativeAds.slice(),itemContent:function(e,s){return s===T.NATIVE_AD_PLACEHOLDER?(0,t.jsx)(u.default,{displayType:U}):(0,t.jsx)(H,{tabIndex:e,fanPost:s,onDelete:eM,onPin:eT,onUnpin:ej,onToggleRec:ey,displayType:U,onReject:ev,onReport:eg,onOpenOrCloseReplies:e_,filterMode:q,onClick:e=>{eI(e)}})},endReached:ex,components:{Footer:eb}})}):(0,t.jsx)(c.default,{})]})})}),$=(0,n.observer)(function(){let{cycloneConfig:{serverURL:e},networkConfig:{networkId:s}}=(0,S.useConfigContext)(),{cycloneCommunityId:n}=(0,h.useCurrentCycloneCommunity)(),{items:o,hasNext:i,endCursor:l}=(0,a.useContext)(p.LoadingContext),{viewer:d,viewerToken:r,loadPending:c}=(0,C.useCycloneAuthGate)(),u=(0,a.useMemo)(()=>{let t=new F.RootStore(e,s,n),{nextToLastPageVisited:a,history:d}=(0,g.getFeedNavigationHistory)();return!a?.alreadyLoaded&&d.length>0&&a?.page==="feed_index"&&a.data?(t.fanPostIndexStore.setItems(a.data),t.fanPostIndexStore.setEndCursor(a.endCursor??null),t.fanPostIndexStore.setHasNext(!!a.hasNext)):(t.fanPostIndexStore.setEndCursor(l??null),t.fanPostIndexStore.setHasNext(!!i),t.fanPostIndexStore.setItems(o)),t},[n,l,i,o,e,s]),m=(0,a.useCallback)(async()=>{await u.fanPostIndexStore.reload(r)},[u,r]);return(0,a.useEffect)(()=>{r&&u.setToken(r),d?.ignoredUsers&&u.setIgnoredUsers(d.ignoredUsers)},[r,u,d?.ignoredUsers]),(0,f.useRunWhenAuthSettles)(c,m,u),(0,t.jsx)(I.StoreProvider,{store:u,children:(0,t.jsx)(j.ContentLocationProvider,{location:j.ContentLocation.List,children:(0,t.jsx)(V,{})})})});e.s(["InternalLiveLayout",0,V,"LiveLayout",0,$],900359)},893916,function(e){e.n(e.i(900359))}]); 3 4//# debugId=4b713adf-b38c-c497-c83c-231399778083 5//# sourceMappingURL=3nfzwudzvgg9s.js.map
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.