1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3341],{59813:(e,r,t)=>{t.d(r,{default:()=>f});var a=t(95155),n=t(52619),l=t.n(n),c=t(97262),s=t(15239),i=t(94520),o=t(78539),d=t(40876),u=t(60854);function f(e){var r,t,n,f,h,x=e.article,g=e.articleId,m=x.createdAt?new Date(x.createdAt).getTime():NaN,p=Number.isFinite(m)?(0,c.fw)(m):null,v=(0,i.Wq)(null==(r=x.featuredImage)?void 0:r.url),b=(0,d.r)(v),j=b.showFallback,y=b.onError;return(0,a.jsxs)(l(),{href:"/article/".concat(x.slug),title:x.title,prefetch:!1,"data-id":g,className:"group flex h-full flex-col overflow-hidden rounded-xl border border-gray-200 bg-white transition-all hover:shadow-lg hover:border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:hover:border-gray-600",children:[(0,a.jsxs)("div",{className:"relative aspect-[16/9] w-full flex-shrink-0 overflow-hidden bg-gray-100 dark:bg-gray-900",children:[j?(0,a.jsx)(u.A,{label:null!=(f=x.title)?f:"",className:"absolute inset-0 text-2xl"}):(0,a.jsx)(s.default,{src:v,alt:null!=(h=x.title)?h:"",fill:!0,sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw",quality:75,className:"object-cover transition-transform duration-300 group-hover:scale-105",onError:y}),(null==(t=x.category)?void 0:t.displayName)&&(0,a.jsx)("div",{className:"absolute left-2.5 top-2.5",children:(0,a.jsx)(o.A,{label:x.category.displayName,className:"bg-white/90 dark:bg-gray-900/90"})})]}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col p-4",children:[(0,a.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5 text-[11px] text-gray-500 dark:text-gray-400",children:[null!=x.readingTime&&(0,a.jsxs)("span",{children:[x.readingTime," min read"]}),null!=x.readingTime&&p&&(0,a.jsx)("span",{"aria-hidden":!0,children:"\xb7"}),p&&(0,a.jsx)("span",{children:p})]}),(0,a.jsx)("h3",{className:"text-base font-bold leading-snug text-gray-900 line-clamp-2 group-hover:text-accent dark:text-gray-100",children:x.title}),(0,a.jsx)("p",{className:"mt-1.5 text-sm text-gray-600 line-clamp-2 dark:text-gray-400",children:x.excerpt}),(null==(n=x.author)?void 0:n.name)&&(0,a.jsx)("div",{className:"mt-3 text-xs font-semibold text-gray-500 dark:text-gray-400",children:x.author.name})]})]})}},75722:(e,r,t)=>{t.d(r,{default:()=>g});var a=t(61975),n=t(79703),l=t(22043),c=t(45377),s=t(71450),i=t(95155),o=t(12115),d=t(52619),u=t.n(d),f=t(6132),h=t(59813);function x(){return(0,i.jsxs)("div",{"data-testid":"article-skeleton",className:"flex h-full flex-col overflow-hidden rounded-xl border border-ink-line bg-ink-850 animate-pulse",children:[(0,i.jsx)("div",{className:"aspect-[16/9] w-full flex-shrink-0 bg-ink-800"}),(0,i.jsxs)("div",{className:"flex flex-1 flex-col gap-2 p-4",children:[(0,i.jsx)("div",{className:"h-3 w-1/3 rounded bg-ink-800"}),(0,i.jsx)("div",{className:"h-4 w-full rounded bg-ink-800"}),(0,i.jsx)("div",{className:"h-4 w-2/3 rounded bg-ink-800"})]})]})}function g(e){var r,t,d,g,m,p,v,b,j,y,N,k,w=e.initialArticles,M=e.category,S=e.author,_=e.initialHasMore,A=e.pageSize,T=(0,l._)((0,o.useState)(w),2),I=T[0],E=T[1],R=(0,l._)((0,o.useState)(2),2),F=R[0],z=R[1],C=(0,l._)((0,o.useState)(void 0===_||_),2),L=C[0],P=C[1],U=(0,l._)((0,o.useState)(!1),2),q=U[0],H=U[1],Y=(0,l._)((0,o.useState)(null),2),B=Y[0],D=Y[1],V=(0,o.useRef)(!1),W=(0,o.useCallback)(function(){return(0,a._)(function(){var e,r,t,a;return(0,s.YH)(this,function(l){switch(l.label){case 0:if(V.current||!L)return[2];V.current=!0,H(!0),D(null),l.label=1;case 1:return l.trys.push([1,4,5,6]),e=new URLSearchParams({page:F.toString()}),A&&e.append("pageSize",A.toString()),M&&e.append("category",M),S&&e.append("author",S),[4,fetch("/api/articles/load-more?".concat(e.toString()))];case 2:if(!(r=l.sent()).ok)throw Error("HTTP ".concat(r.status,": ").concat(r.statusText));return[4,r.json()];case 3:return(t=l.sent()).articles&&t.articles.length>0?(E(function(e){return(0,c._)(e).concat((0,c._)(t.articles))}),z(function(e){return e+1}),P(t.hasMore)):P(!1),[3,6];case 4:return a=l.sent(),D((0,n._)(a,Error)?a.message:"Failed to load more articles"),P(!1),[3,6];case 5:return V.current=!1,H(!1),[7];case 6:return[2]}})})()},[F,M,S,L,A]),X=(t=(r={hasMore:L,isLoading:q,onLoadMore:W,threshold:.1,rootMargin:"200px"}).hasMore,d=r.isLoading,g=r.onLoadMore,p=void 0===(m=r.threshold)?.1:m,b=void 0===(v=r.rootMargin)?"100px":v,j=(0,o.useRef)(null),y=(0,o.useRef)(g),N=(0,o.useRef)(t),k=(0,o.useRef)(d),y.current=g,N.current=t,k.current=d,(0,o.useEffect)(function(){var e=j.current;if(e){var r=new IntersectionObserver(function(e){(0,l._)(e,1)[0].isIntersecting&&N.current&&!k.current&&y.current()},{threshold:p,rootMargin:b});return r.observe(e),function(){r.disconnect()}}},[p,b]),{ref:j}).ref;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:I.map(function(e,r){return(0,i.jsx)(h.default,{article:e,articleId:r},"".concat(e.id,"-").concat(r))})}),L&&(0,i.jsx)("div",{ref:X,className:"py-8 min-h-20",children:q?(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[(0,i.jsx)(x,{}),(0,i.jsx)(x,{}),(0,i.jsx)(x,{})]}):B?(0,i.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,i.jsx)(f.A,{size:32,className:"text-bad"}),(0,i.jsxs)("p",{className:"text-ink-t2",children:["Error loading articles: ",B]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("button",{onClick:W,className:"px-4 py-2 bg-accent text-white rounded-full font-semibold hover:brightness-95 transition-colors",children:"Try Again"}),(0,i.jsx)(u(),{href:"/games/all",prefetch:!1,className:"px-4 py-2 rounded-full font-semibold border border-ink-line-2 text-ink-t2 hover:bg-ink-800 transition-colors",children:"Browse games"})]})]}):(0,i.jsx)("div",{className:"flex justify-center items-center text-ink-t3",children:"Scroll down to load more articles..."})}),!L&&!q&&I.length>0&&(0,i.jsx)("div",{className:"text-center py-8 text-ink-t2",children:(0,i.jsx)("p",{children:"You've reached the end! No more articles to load."})})]})}},78539:(e,r,t)=>{t.d(r,{A:()=>n});var a=t(95155);function n(e){var r=e.label,t=e.className;return r?(0,a.jsx)("span",{className:"inline-flex items-center rounded-full bg-accent/10 px-2.5 py-1 text-[11px] font-bold uppercase tracking-wide text-accent ".concat(void 0===t?"":t),children:r}):null}},94520:(e,r,t)=>{t.d(r,{MB:()=>l,Wq:()=>n});var a="https://cdn.getjar.com/default-app-icon.svg";function n(e){return e?e.replace("strapistaticupload.s3.us-east-1.amazonaws.com","cdn.getjar.com"):""}function l(e){if(!e.icon)return a;
1if("legacy"===e.applicationType&&e.legacyAppId&&e.icon.hash&&e.icon.ext){var r=(function(e){for(var r=0,t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r&=r;return Math.abs(r).toString(16).padStart(8,"0")})(e.legacyAppId.toString()).slice(0,2);return"https://legacy-download.getjar.com/icon-50x50/".concat(r,"/").concat(e.icon.hash,"_thm").concat(e.icon.ext)}return e.icon.url?n(e.icon.url):a}},97262:(e,r,t)=>{function a(e){return new Intl.NumberFormat("en-US").format(e)}function n(e){var r=Number.isFinite(e)&&e>0?Math.floor(e):0,t=Math.floor(r/3600),a=Math.floor(r%3600/60);return t>0?"".concat(t,"h ").concat(a,"m"):"".concat(a,"m")}function l(e){return a(null!=e?e:0)}function c(e,r){return"number"==typeof r&&r>0?"".concat(e,"/").concat(r):"".concat(e," XP")}function s(e,r){if(null==e||e<=0)return"Unranked";var t="#".concat(a(e));return"number"==typeof r&&r>0?"".concat(t," of ").concat(a(r)):t}function i(e,r){return null==e||e<=0||null==r||r<=0?null:"".concat(a(e)," XP behind ").concat(s(r))}function o(e){if(!Number.isFinite(e)||e<=0)return"Recently";var r=Math.floor((Date.now()-e)/864e5);if(r<=0)return"Today";if(1===r)return"Yesterday";if(r<7)return"".concat(r," days ago");var t=Math.floor(r/7);return t<5?1===t?"1 week ago":"".concat(t," weeks ago"):"Recently"}t.d(r,{Ir:()=>l,Uf:()=>s,V7:()=>c,ZV:()=>a,Zg:()=>n,cj:()=>i,fw:()=>o})}}]);
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.