!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]="b7587160-c672-4a9f-9aac-f2cbdf187e62",e._sentryDebugIdIdentifier="sentry-dbid-b7587160-c672-4a9f-9aac-f2cbdf187e62")}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(82090)),d=a(52322);var p=!0;t.default=function(e){let{page:t,preview:a}=e;const p=(0,n.Z)(),h=t.content.pageHeader.heading,f=t.content?.productsCategoryUid,g=[{href:"/",title:"Home"},{href:"/store",title:"My Nintendo Store"},{href:"/store/games",title:"Games"},{href:"/store/games/[slug]",title:h}],m=r.e.GAMES,b=(0,u.XD)({category:m,productsCategoryUid:f,merchandisedGrid:t?.content?.merchandisedGrid,router:p});return f?(0,d.jsx)(s.X$,{router:p,categoryConfig:b,defaultCategory:m,searchParamWhitelist:i.uy,preserveQueryParamKeys:i.aq,children:(0,d.jsx)(o.Z,{preview:a,breadcrumbLinks:g,page:t.content,pageIcon:"d-pad",cachePrefix:`${(0,l.GL)(h)}`,filterSections:r.G,analytics:{eventPrefix:`Games:${h}`,pageName:`Games PLP - ${h}`}})}):(0,d.jsx)(c.Z,{preview:a,breadcrumbLinks:g,page:t.content,showRating:t.showRating,filterSections:r.G,analytics:{pageName:`Games PLP - ${h}`}})}},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),f=a(37364),g=a(98803),m=a(1505),b=a(26856),y=a(88053),j=a(31837),v=a(9873),x=a(90862),P=a(2002),w=a(95395),k=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{preview:t,breadcrumbLinks:a,filterSections:s,lightScrim:F,page:I,pageIcon:Z,sortByOptions:G,showRating:R,analytics:$,enableStickyCollectionNav:A,fullBleedHero:q,cmsProductPageSize:V,hiddenFilters:U,disableDefaultMarketingPageHeading:X}=e;const{pageHeader:K,ctaCollection:Q,merchandisedGrid:Y,legalText:J,marketingPage:W}=I||{},ee=W?N[W?.templateName??"plmpStandard"]:null,te=X?l.Fragment:f.H.NewLevel,ae=(0,w.O_)(),{text:re}=(0,o.useLocalizer)(),{trackLoadMoreProducts:se}=(0,u.u)(),le=(0,n.useRouter)(),{asPath:ne,pathname:ie,query:oe}=le,ce=(0,w.D9)(oe?.slug),ue=(0,o.useFeature)("wdev-1631-horizontal-tiles"),de=ue?.variant?.payload?.value,pe=(0,k.Z)(k.o.TABLET_SMALL),he="horizontal"===de&&!pe,fe=(0,o.deserializeHash)(ne),ge=(0,l.useRef)(),{0:me,1:be}=(0,l.useState)((()=>G.find((e=>{let{param:t}=e;return t===fe.sort}))?.value||G[0].value)),{0:ye,1:je}=(0,l.useState)((()=>parseInt(fe.p)||0)),{isFilterModalOpen:ve,selectedSortByOption:xe,toggleModalFiltersMenu:Pe,handleSortByChange:we}=(0,d.sI)({sortBy:me,sortByOptions:G,analytics:$,applySortBy:e=>{be((()=>e))}}),ke=(0,l.useMemo)((()=>G.map((e=>{let{value:t,label:a}=e;return{value:t,label:re(a)}}))),[G,re]),Se=(0,l.useMemo)((()=>({value:xe.value,label:re(xe.label)})),[xe,re]),Oe=(0,l.useMemo)((()=>s.map((e=>{let{attribute:t}=e;return t}))),[s]),Fe=(Y||[]).flat(),Me=(Y||[]).flat().filter((e=>{let{sku:t}=e;return Boolean(t)})),{appliedFilters:Ce,appliedFiltersQuery:_e,filteredProducts:Le,filteredState:Ne,refine:De,refineByQuery:He,clearFilters:Ee}=(0,w.x3)(Me,Oe,{operator:w.fP.AND,queryToInitializeFilters:fe,hidden:U}),Be=0===Ce?.length&&xe.value===G[0].value,Ie=(0,k.Z)(k.o.DESKTOP),ze=(0,l.useRef)();ze.current=Ie;const Te=Be?Fe:Le,Ze=(0,l.useMemo)((()=>Te.slice(0,(V||Te.length)*(ye+1))),[ye,Te,V]),Ge=Ze.lengthme?[...Ze].sort(me):Ze),[Ze,me]),$e=(0,l.useCallback)((()=>{const e=(0,o.deserializeHash)(ne),t=G.find((t=>{let{param:a}=t;return a===e.sort}))?.value||G[0].value;He(e),be((()=>t)),je(parseInt(e.p)||0)}),[G,ne,He]),Ae=(0,l.useCallback)((e=>{const t=G.find((e=>{let{value:t}=e;return t===me}))?.param||G[0].value;return`#${new URLSearchParams(z(z({},e),{},{sort:t,p:ye})).toString()}`}),[G,me,ye]),qe=(0,l.useCallback)((e=>(je((()=>0)),e)),[]),Ve=(0,l.useCallback)((function(){qe(De)(...arguments)}),[De,qe]),Ue=(0,l.useCallback)((function(){qe(Ee)(...arguments)}),[Ee,qe]),Xe=(0,l.useCallback)((function(){qe(we)(...arguments)}),[we,qe]),Ke=(0,l.useCallback)((()=>{const{pageName:e}=$;se(e);const t=(0,o.deserializeHash)(),a=ye+1;t.p=a,je((()=>a))}),[ye,$,se]),Qe=(0,l.useMemo)((()=>Ae(_e)),[_e,Ae]),Ye=(0,l.useMemo)((()=>Ce.map((e=>({attribute:e.split(w.HA)[0],label:e.split(w.HA)[1],value:e})))),[Ce]),Je=(0,l.useMemo)((()=>$?.featureFlag?{featureFlag:$.featureFlag}:{featureFlag:ue?.id,featureFlagVariant:de}),[$,ue,de]),We=(0,l.useMemo)((()=>s.filter((e=>{let{attribute:t}=e;return Ne[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&&re(a),startCollapsed:0!==t,refine:Ve,items:Ne[s]?.items||[],showMoreLabel:re("Show more"),showLessLabel:re("Show less"),collapsible:!0,limit:5,showMore:!0,analytics:{pageName:$?.pageName}},l),s)}))),[s,Ne,Ve,re,$]),et=(0,l.useMemo)((()=>(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O.en,{$singleColumnMobile:he,children:Re.map(((e,t)=>e.sku?(0,l.createElement)(x.I8,z(z(z({},Je),{},{key:e.sku+t},e),{},{constrain:!1,showRating:R||Boolean(le.query[M.Tx.UTM_CODE])||!1,mobileHorizontal:he,analytics:{listDetails:{id:`clp-${(0,P.GL)($.pageName)}`,name:$.pageName}}})):(0,E.jsx)(_.Z,{asset:e.asset.primary.assetPath,cta:e.cta,heading:e.heading},e.heading+t)))}),Ge&&(0,E.jsx)(H.VR,{children:(0,E.jsx)(g.B,{variant:"tertiary",icon:m.Z,onClick:Ke,children:re("Load more")})})]})),[le.query,$,Je,R,Ge,Re,he,Ke,re]);(0,S.Z)({isDesktop:Ie,scrollToRef:ge,scrollToElementID:T,enableStickyCollectionNav:A,pillFarm:Q.list}),(0,l.useEffect)((()=>{i().push({pathname:i().pathname,query:i().query,hash:Qe},null,{shallow:!0}).catch((e=>{if(!e.cancelled)throw e}))}),[Qe]),(0,P.nw)((()=>{$e()})),(0,l.useEffect)((()=>{!0===ze.current&&ge.current&&(0,P.n5)(ge.current,{offsetY:A&&D.d})}),[Ce.length,A]),(0,l.useEffect)((()=>{A&&ge.current&&oe?.slug!==ce&&(0,P.n5)(ge.current,{offsetY:D.d,behavior:"smooth",onlyScrollIfAbove:!0})}),[A,oe?.slug,ce]),(0,l.useEffect)((()=>{const e=oe?.slug;Boolean(ce)&&Boolean(e)&&e!==ce&&$e()}),[$e,ce,oe?.slug]);const tt=(0,l.useMemo)((()=>a?(0,E.jsx)(b.B,{currentPage:ie,children:a.map(((e,t)=>(0,E.jsx)(c.Z,{href:e.href,children:(0,E.jsx)("a",{children:re(e.title)})},e.title+t)))}):null),[a,re,ie]),at=(0,l.useMemo)((()=>K?.asset?.primary?.assetPath?q?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(y.F,{heading:K.heading,subtitle:K.description,image:{desktop:{assetPath:K.asset?.primary?.assetPath},mobile:{assetPath:K.asset?.secondary?.assetPath}},pillFarm:Q.list,icon:Z}),(0,E.jsx)(O.Hr,{})]}):(0,E.jsx)(O.tm,{iconName:Z,content:{assetPath:K.asset?.primary?.assetPath,assetPathAlt:K.asset?.alt,background:K.background,cta:K.cta,description:K.description,heading:K.heading,modifiers:K.modifiers},lightScrim:F}):null),[K,q,Z,F,Q]);return(0,E.jsxs)(L.Kq,{preview:t,children:[W&&(0,E.jsx)(te,{children:(0,E.jsx)(ee,{marketingPage:W})}),a&&(0,E.jsx)(O.JL,{children:tt}),at,(0,E.jsxs)(f.H.NewLevel,{children:[!q&&Q?.list.length>0&&(0,E.jsx)(O.$0,{constrained:!0,small:!0,divider:["bottom"],children:(0,E.jsx)(O.l6,{center:!0,items:Q.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:!!a,children:[(0,E.jsx)(p.D,{children:tt}),(0,E.jsx)(h.S,{label:re("Sort by"),onSelect:Xe,options:ke,dropdownValue:ae?Se:null}),(0,E.jsx)(p.M,{children:(0,E.jsx)(O.Lb,{icon:v.Z,variant:"tertiary",onClick:Pe,children:re("Filter")})})]}),(0,E.jsx)(j.S,{size:32,axis:"vertical"}),(0,E.jsx)(O.dA,{enableStickyFilterPanel:!0,isFilterModalOpen:ve,toggleModalFiltersMenu:Pe,attributeFilterSets:We,isDesktop:Ie,stickyOffset:A&&parseInt(C.TH)+16,customizeFilters:{clearFilters:Ue,removeFilter:Ve,activeFilters:Ye,totalHits:Le.length},children:et}),J&&(0,E.jsx)(H.VH,{children:(0,E.jsx)(O.Ho,{data:J,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]-518e886ae257d1a8.js.map