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