!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="547947b6-6d66-47aa-b5cc-9e912f866002",e._sentryDebugIdIdentifier="sentry-dbid-547947b6-6d66-47aa-b5cc-9e912f866002")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8417],{18756:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return p}});var r=a(94922),s=a(46420),l=a(2002),n=a(64897),i=a(36734),o=a(15188),c=a(84553),u=(a(98670),a(50802)),d=a(52322);var p=!0;t.default=function(e){let{page:t}=e;const a=(0,n.Z)(),p=t.content.pageHeader.heading,h=t.content?.productsCategoryUid,g=[{href:"/",title:"Home"},{href:"/store",title:"My Nintendo Store"},{href:"/store/games",title:"Games"},{href:"/store/games/[slug]",title:p}],f=r.e.GAMES,m=(0,u.XD)({category:f,productsCategoryUid:h,merchandisedGrid:t?.content?.merchandisedGrid,router:a});return h?(0,d.jsx)(s.X$,{router:a,categoryConfig:m,defaultCategory:f,searchParamWhitelist:i.uy,preserveQueryParamKeys:i.aq,children:(0,d.jsx)(o.Z,{breadcrumbLinks:g,page:t.content,pageIcon:"d-pad",cachePrefix:`${(0,l.GL)(p)}`,filterSections:r.G,analytics:{eventPrefix:`Games:${p}`,pageName:`Games PLP - ${p}`}})}):(0,d.jsx)(c.Z,{breadcrumbLinks:g,page:t.content,showRating:t.showRating,filterSections:r.G,analytics:{pageName:`Games PLP - ${p}`}})}},84553:function(e,t,a){"use strict";var r=a(82269),s=a(95235),l=a(2784),n=a(5632),i=a.n(n),o=a(82091),c=a(97224),u=a(94922),d=a(46420),p=a(51505),h=a(82732),g=a(13154),f=a(47725),m=a(1505),b=a(62203),y=a(1626),j=a(73387),x=a(9873),v=a(90862),P=a(2002),k=a(95395),w=a(83533),S=a(62156),O=a(88627),F=(a(64629),a(36734)),M=a(99140),C=a(23089),_=a(26378),L=a(402),N=a(49481),D=a(73353),H=a(33831),E=a(52322);const B=["title","attribute"];function I(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function z(e){for(var t=1;t{let{breadcrumbLinks:t,filterSections:a,lightScrim:s,page:F,pageIcon:I,sortByOptions:Z,showRating:G,analytics:R,enableStickyCollectionNav:$,fullBleedHero:A,cmsProductPageSize:q,hiddenFilters:V,disableDefaultMarketingPageHeading:U}=e;const{pageHeader:X,ctaCollection:K,merchandisedGrid:Q,legalText:Y,marketingPage:J}=F||{},W=J?N[J?.templateName??"plmpStandard"]:null,ee=U?l.Fragment:g.H.NewLevel,te=(0,k.O_)(),{text:ae}=(0,o.useLocalizer)(),{trackLoadMoreProducts:re}=(0,u.u)(),se=(0,n.useRouter)(),{asPath:le,pathname:ne,query:ie}=se,oe=(0,k.D9)(ie?.slug),ce=(0,o.useFeature)("wdev-1631-horizontal-tiles"),ue=ce?.variant?.payload?.value,de=(0,w.Z)(w.o.TABLET_SMALL),pe="horizontal"===ue&&!de,he=(0,o.deserializeHash)(le),ge=(0,l.useRef)(),{0:fe,1:me}=(0,l.useState)((()=>Z.find((e=>{let{param:t}=e;return t===he.sort}))?.value||Z[0].value)),{0:be,1:ye}=(0,l.useState)((()=>parseInt(he.p)||0)),{isFilterModalOpen:je,selectedSortByOption:xe,toggleModalFiltersMenu:ve,handleSortByChange:Pe}=(0,d.sI)({sortBy:fe,sortByOptions:Z,analytics:R,applySortBy:e=>{me((()=>e))}}),ke=(0,l.useMemo)((()=>Z.map((e=>{let{value:t,label:a}=e;return{value:t,label:ae(a)}}))),[Z,ae]),we=(0,l.useMemo)((()=>({value:xe.value,label:ae(xe.label)})),[xe,ae]),Se=(0,l.useMemo)((()=>a.map((e=>{let{attribute:t}=e;return t}))),[a]),Oe=(Q||[]).flat(),Fe=(Q||[]).flat().filter((e=>{let{sku:t}=e;return Boolean(t)})),{appliedFilters:Me,appliedFiltersQuery:Ce,filteredProducts:_e,filteredState:Le,refine:Ne,refineByQuery:De,clearFilters:He}=(0,k.x3)(Fe,Se,{operator:k.fP.AND,queryToInitializeFilters:he,hidden:V}),Ee=0===Me?.length&&xe.value===Z[0].value,Be=(0,w.Z)(w.o.DESKTOP),Ie=(0,l.useRef)();Ie.current=Be;const ze=Ee?Oe:_e,Te=(0,l.useMemo)((()=>ze.slice(0,(q||ze.length)*(be+1))),[be,ze,q]),Ze=Te.lengthfe?[...Te].sort(fe):Te),[Te,fe]),Re=(0,l.useCallback)((()=>{const e=(0,o.deserializeHash)(le),t=Z.find((t=>{let{param:a}=t;return a===e.sort}))?.value||Z[0].value;De(e),me((()=>t)),ye(parseInt(e.p)||0)}),[Z,le,De]),$e=(0,l.useCallback)((e=>{const t=Z.find((e=>{let{value:t}=e;return t===fe}))?.param||Z[0].value;return`#${new URLSearchParams(z(z({},e),{},{sort:t,p:be})).toString()}`}),[Z,fe,be]),Ae=(0,l.useCallback)((e=>(ye((()=>0)),e)),[]),qe=(0,l.useCallback)((function(){Ae(Ne)(...arguments)}),[Ne,Ae]),Ve=(0,l.useCallback)((function(){Ae(He)(...arguments)}),[He,Ae]),Ue=(0,l.useCallback)((function(){Ae(Pe)(...arguments)}),[Pe,Ae]),Xe=(0,l.useCallback)((()=>{const{pageName:e}=R;re(e);const t=(0,o.deserializeHash)(),a=be+1;t.p=a,ye((()=>a))}),[be,R,re]),Ke=(0,l.useMemo)((()=>$e(Ce)),[Ce,$e]),Qe=(0,l.useMemo)((()=>Me.map((e=>({attribute:e.split(k.HA)[0],label:e.split(k.HA)[1],value:e})))),[Me]),Ye=(0,l.useMemo)((()=>R?.featureFlag?{featureFlag:R.featureFlag}:{featureFlag:ce?.id,featureFlagVariant:ue}),[R,ce,ue]),Je=(0,l.useMemo)((()=>a.filter((e=>{let{attribute:t}=e;return Le[t]?.items?.length>0})).map(((e,t)=>{let{title:a,attribute:s}=e,l=(0,r.Z)(e,B);return(0,E.jsx)(O.vT,z({attribute:s,title:a&&ae(a),startCollapsed:0!==t,refine:qe,items:Le[s]?.items||[],showMoreLabel:ae("Show more"),showLessLabel:ae("Show less"),collapsible:!0,limit:5,showMore:!0,analytics:{pageName:R?.pageName}},l),s)}))),[a,Le,qe,ae,R]),We=(0,l.useMemo)((()=>(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O.en,{$singleColumnMobile:pe,children:Ge.map(((e,t)=>e.sku?(0,l.createElement)(v.I8,z(z(z({},Ye),{},{key:e.sku+t},e),{},{constrain:!1,showRating:G||Boolean(se.query[M.Tx.UTM_CODE])||!1,mobileHorizontal:pe,analytics:{listDetails:{id:`clp-${(0,P.GL)(R.pageName)}`,name:R.pageName}}})):(0,E.jsx)(_.Z,{asset:e.asset.primary.assetPath,cta:e.cta,heading:e.heading},e.heading+t)))}),Ze&&(0,E.jsx)(H.VR,{children:(0,E.jsx)(f.B,{variant:"tertiary",icon:m.Z,onClick:Xe,children:ae("Load more")})})]})),[se.query,R,Ye,G,Ze,Ge,pe,Xe,ae]);(0,S.Z)({isDesktop:Be,scrollToRef:ge,scrollToElementID:T,enableStickyCollectionNav:$,pillFarm:K.list}),(0,l.useEffect)((()=>{i().push({pathname:i().pathname,query:i().query,hash:Ke},null,{shallow:!0}).catch((e=>{if(!e.cancelled)throw e}))}),[Ke]),(0,P.nw)((()=>{Re()})),(0,l.useEffect)((()=>{!0===Ie.current&&ge.current&&(0,P.n5)(ge.current,{offsetY:$&&D.d})}),[Me.length,$]),(0,l.useEffect)((()=>{$&&ge.current&&ie?.slug!==oe&&(0,P.n5)(ge.current,{offsetY:D.d,behavior:"smooth",onlyScrollIfAbove:!0})}),[$,ie?.slug,oe]),(0,l.useEffect)((()=>{const e=ie?.slug;Boolean(oe)&&Boolean(e)&&e!==oe&&Re()}),[Re,oe,ie?.slug]);const et=(0,l.useMemo)((()=>t?(0,E.jsx)(b.B,{currentPage:ne,children:t.map(((e,t)=>(0,E.jsx)(c.Z,{href:e.href,children:(0,E.jsx)("a",{children:ae(e.title)})},e.title+t)))}):null),[t,ae,ne]),tt=(0,l.useMemo)((()=>X?.asset?.primary?.assetPath?A?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(y.F,{heading:X.heading,subtitle:X.description,image:{desktop:{assetPath:X.asset?.primary?.assetPath},mobile:{assetPath:X.asset?.secondary?.assetPath}},pillFarm:K.list,icon:I}),(0,E.jsx)(O.Hr,{})]}):(0,E.jsx)(O.tm,{iconName:I,content:{assetPath:X.asset?.primary?.assetPath,assetPathAlt:X.asset?.alt,background:X.background,cta:X.cta,description:X.description,heading:X.heading,modifiers:X.modifiers},lightScrim:s}):null),[X,A,I,s,K]);return(0,E.jsxs)(L.Kq,{children:[J&&(0,E.jsx)(ee,{children:(0,E.jsx)(W,{marketingPage:J})}),t&&(0,E.jsx)(O.JL,{children:et}),tt,(0,E.jsxs)(g.H.NewLevel,{children:[!A&&K?.list.length>0&&(0,E.jsx)(O.$0,{constrained:!0,small:!0,divider:["bottom"],children:(0,E.jsx)(O.l6,{center:!0,items:K.list})}),(0,E.jsx)("span",{ref:ge,id:"products","data-drawer-id":T}),(0,E.jsx)(j.S,{size:36,axis:"vertical"}),(0,E.jsxs)(O.He,{children:[(0,E.jsxs)(H.zB,{$breadcrumbs:!!t,children:[(0,E.jsx)(p.D,{children:et}),(0,E.jsx)(h.S,{label:ae("Sort by"),onSelect:Ue,options:ke,dropdownValue:te?we:null}),(0,E.jsx)(p.M,{children:(0,E.jsx)(O.Lb,{icon:x.Z,variant:"tertiary",onClick:ve,children:ae("Filter")})})]}),(0,E.jsx)(j.S,{size:32,axis:"vertical"}),(0,E.jsx)(O.dA,{enableStickyFilterPanel:!0,isFilterModalOpen:je,toggleModalFiltersMenu:ve,attributeFilterSets:Je,isDesktop:Be,stickyOffset:$&&parseInt(C.TH)+16,customizeFilters:{clearFilters:Ve,removeFilter:qe,activeFilters:Qe,totalHits:_e.length},children:We}),Y&&(0,E.jsx)(H.VH,{children:(0,E.jsx)(O.Ho,{data:Y,textVariant:"legal"})})]}),(0,E.jsx)(O.y4,{})]})]})};Z.defaultProps={sortByOptions:F.Op},t.Z=Z},86236:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/store/games/[slug]",function(){return a(18756)}])}},function(e){e.O(0,[8286,4511,402,5806,5188,9774,2888,179],(function(){return t=86236,e(e.s=t);var t}));var t=e.O();_N_E=t}]); //# sourceMappingURL=[slug]-342bc9344ecb4eff.js.map