!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]="48b1d51f-4c95-460d-8f9d-793f2b7e4d40",e._sentryDebugIdIdentifier="sentry-dbid-48b1d51f-4c95-460d-8f9d-793f2b7e4d40")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5484],{90749:function(e,t,i){i.d(t,{Xx:function(){return b},ZA:function(){return v},cw:function(){return c},h3:function(){return y},nc:function(){return h},p6:function(){return w},rU:function(){return m},wt:function(){return p},xv:function(){return f},y:function(){return g},zx:function(){return P}});var n=i(82731),o=i(38949),r=i(62725),a=i(27689),s=i(53873),l=i(79351),d=i(29278),u=i(44835);const c=(0,n.ZP)(r.Q).withConfig({componentId:"sc-10vf2cu-0"})(["height:100%;font-weight:",";"],(e=>{let{theme:t}=e;return t.font.weight.bold})),h=n.ZP.div.withConfig({componentId:"sc-10vf2cu-1"})(["display:flex;flex-direction:row;align-items:center;justify-content:space-between;"]),p=(0,n.ZP)(a.S).withConfig({componentId:"sc-10vf2cu-2"})(["height:",";& > div{font-size:",";}"],(e=>{let{theme:t}=e;return t.spacing[40]}),(e=>{let{theme:t}=e;return t.font.size.h1LMobile})),m=(n.ZP.span.withConfig({componentId:"sc-10vf2cu-3"})(["display:",";font-weight:",";color:",";"],(e=>{let{isLoading:t}=e;return t?"none":"block"}),(e=>{let{theme:t}=e;return t.font.weight.bold}),(e=>{let{theme:t}=e;return t.color.primary})),(0,n.ZP)(s.L).withConfig({componentId:"sc-10vf2cu-4"})(["display:inline !important;span{font-size:",";","{font-size:",";}}"],(e=>{let{theme:t}=e;return t.font.size.legalMobile}),(e=>{let{theme:t}=e;return t.mediaQuery.tabletSmall}),(e=>{let{theme:t}=e;return t.font.size.captionMobile}))),f=(0,n.ZP)(l.T).withConfig({componentId:"sc-10vf2cu-5"})(["line-height:1.5;"]),g=(0,n.ZP)(f).withConfig({componentId:"sc-10vf2cu-6"})(["color:",";font-weight:",";"],(e=>{let{theme:t}=e;return t.color.primary}),(e=>{let{theme:t}=e;return t.font.weight.bold})),y=(0,n.ZP)(d.B).withConfig({componentId:"sc-10vf2cu-7"})(["white-space:pre-wrap;"]),b=(0,n.ZP)(u.L).withConfig({componentId:"sc-10vf2cu-8"})(["width:max-content;"]),w=n.ZP.span.withConfig({componentId:"sc-10vf2cu-9"})(["font-weight:",";"],(e=>{let{$boldHelperText:t}=e;return t?600:"initial"})),v=(0,n.ZP)(o.Qc).withConfig({componentId:"sc-10vf2cu-10"})(["margin-top:var(--theme-spacing-16);","{margin-top:var(--theme-spacing-24);}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),P=(0,n.ZP)(d.B).withConfig({componentId:"sc-10vf2cu-11"})(["width:100%;"])},43399:function(e,t,i){i.d(t,{O:function(){return o}});const n="The requested quantity is not available",o={DEFAULT:"Something went wrong. Please try again.",QTY_EXCEEDS_MAXIMUM:n,QTY_NOT_AVAILABLE:n,NON_EXISTENT_CART:n,NON_EXISTENT_PRODUCT:n,QTY_INVALID:n}},67831:function(e,t,i){var n=i(2784),o=i(64897),r=i(56675),a=i(13610),s=i(10137),l=i(90749),d=i(79149),u=i(98087),c=i(76454),h=i(52322);t.Z=e=>{const{locale:t}=(0,o.Z)(),i=(0,r.x)(),p=(0,a.useMaintenance)(),m=(0,a.useAccounts)(),f=(0,a.useCart)(),{trackAddToCart:g}=(0,a.useAnalytics)(),y=(0,a.useCustomer)(),{text:b,price:w,date:v}=(0,a.useLocalizer)(),{__typename:P,availability:C,nsuid:T,requiresSubscription:D,sku:I,requiresCoupon:k,requiresLogin:A,platinumPoints:S,eshopDetails:L,prePurchase:N,prices:_,loadingPricing:x,isSalableQty:M,releaseDate:R,releaseDateDisplay:q,soldOutPermanent:E,isPreorderable:Z,inviteRequired:Q,variations:O,voucherNsuid:z,startShippingDate:U,shipDateDisplay:j,enableRetailCrawler:G,waitlist:$,qtyAllowedPerCustomer:B,consumerLaunchHoldDate:X}=e,{data:H,loading:Y}=(0,u.aM)(c.o$._X,{sku:e?.sku},{fetchPolicy:"network-only",skip:!y?.isCustomerLoggedIn||"number"!==typeof B}),V=H?.customer?.quantityPurchased,F=x||f?.loading||f?.updating||p?.loading||y?.loading||$?.loadingInvites||Y,{0:W,1:J}=(0,n.useState)(!1),{0:K,1:ee}=(0,n.useState)(1),{0:te,1:ie}=(0,n.useState)({}),ne=(0,s.u)(),oe="MOBILE"===T,re=(0,d.EE)(e),ae=$?.campaigns,se=$?.invites,le=se?.length>0?se[0]:null,de=ae?.filter((e=>!0===e?.allowRequests)).length>0,ue=(C?.includes(b("Pre-order"))||C?.includes(b("Available now"))||M||N)&&!oe,{consentedGroups:ce}=(0,a.useCookies)(),he=(0,n.useMemo)((()=>{if(!G)return null;const e=ce?.has(a.ConsentGroups.PERFORMANCE);if(!e)return null;if(T&&O?.length){const e=O.find((e=>!e.product?.nsuid));if(e)return e.product.sku}return T?null:I}),[ce,T,I,O,G]),pe=y?.data?.account?.membershipStatus?.active,me=f?.addableQty(e),fe=K>=me,ge=!M&&!oe||!!O?.length&&O.every((e=>{let{product:t}=e;return!t.isSalableQty})),ye=N&&j&&!M,be=(D||S||A)&&!m.isLoggedIn,we=D&&!pe,ve=new Date,{buttonDisabled:Pe,promptLogin:Ce,disableQuantity:Te,buttonCopy:De,helperText:Ie,boldHelperText:ke}=(0,n.useMemo)((()=>{if(oe)return{};const e="number"===typeof B&&V>=B;let i="",n="",o=!1,r=!1,a=re,s=!1,d=p?.store?.active;const u=(0,h.jsx)(l.rU,{href:"/store/products/nintendo-switch-game-vouchers/",locale:t,children:b("Learn more about vouchers")}),c=(0,h.jsx)(l.rU,{href:"/online/",children:b("Learn more or sign up now >")}),m=(0,h.jsx)("strong",{children:b("Nintendo Switch Online")});D&&(n=b("This item is only for paid {0} members. {1}",{args:[m,c]}));const f=ae?.length>0;if((Q||f)&&"active"!==le?.status){if(n=f?`${b("Active invitation required to purchase Nintendo Switch\u2122 2 system and accessories from the My Nintendo Store. Register your interest to be contacted when it's your time to shop:")} {0}`:"",be)i="Sign in",r=!0;else if(!1!==de||le)if(le)if(s=!0,"pending"===le?.status)i="Invite requested",n=`${b("You're already on the waitlist! We will let you know when you are up!")} `+n;else if("redeemed"===le?.status){const e=ae?.find((e=>{let{id:t}=e;return t===le?.campaignId}))?.meta?.primarySku?.[0];i=e===I?"Purchased":"Invite required"}else i=b("Unavailable");else i="Get on Waitlist",n=`${b("Get on the waitlist and we will let you know when you are up!")} `+n;else i="Invite required",n=`${b("Attention: Invite required.")} `+n,s=!0;n=b(n,{args:[(0,h.jsx)(l.rU,{href:"/gaming-systems/switch-2/how-to-buy/",children:b("Registration page")},"registration-page")]})}else if(re)if(p?.eshop?.active)o=!0,n=b("Direct downloads are not possible during maintenance"),s=!0,i="Direct download";else if("MarketingProduct"===P)s=!0,i=b("Releases {0}",{args:[q||R&&v(R,{format:{day:"numeric",month:"numeric",year:"2-digit"}})]});else if(ye)s=!0,a=!0,i=b("Releases {0}",{args:[q]});else if(be)i="Sign in to download",r=!0;else if(we)s=!0,i="Direct download";else if(L?.isPreordered)s=!0,i="Already pre-ordered";else if(L?.isPurchased)s=!0,i="Already downloaded";else if(L?.isPreorderable)i="Pre-order",n=z?b("Pre-order or redeem a Game Voucher to pre-load this game and start playing as soon as it\u2019s released. {0}",{args:[u]}):b("This lets you pre-load the game, so you'll be able to play as soon as the game is released.");else if(L?.isPurchasable)0==_?.finalPrice?i="Free download":z?(i="Direct download",n=b("This item will be sent to your system automatically after purchase or Nintendo Switch Game Voucher redemption. {0}",{args:[u]})):(i="Direct download",n="This item will be sent to your system automatically after purchase.");else{const e=new Date(R);s=!0,q?i=b("Releases {0}",{args:[q]}):venew Date(X)&&ve({regPrice:w(_?.regularPrice,{formatZero:!0})??null,salePrice:_?.discounted?w(_?.finalPrice):""})),[_,w]),Se=(0,n.useCallback)((()=>{if(Ce)m.promptLogin();else{i.cache.evict({id:i.cache.identify(e),fieldName:"eshopDetails",args:{personalized:!0},broadcast:!1});const n="string"===typeof De?De:"CTA";g(e),ne.trackEvent({eventName:`PDP: ${n} Clicked`,objectId:I,isConversion:!0},t)}}),[Ce,De,t,I,ne,g,m,i.cache,e]),Le=(0,n.useCallback)(((i,n)=>{const{customAnalytics:o}=n||{};if(Ce)m.promptLogin();else{if(!e.requiresCoupon||i)return g(e,o?.itemListDetails),ne.addToCart(I,{eventName:o?.eventName||"PDP: Add to Cart Clicked",locale:t}),f.addProduct(e,{couponCode:i?.trim(),selectedOptions:Object.values(te),quantity:K});J(!0)}}),[I,Ce,ne,m,f,e,K,t,g,te]);return(0,n.useMemo)((()=>({state:{isLoading:F,isUpdating:f?.updating,account:m,quantity:K,isMobileGame:oe,isDigitalProduct:re,isPurchasable:ue,retailerSku:he,membershipActive:pe,membershipRequired:we,addableQty:me,itemLimitReached:fe,soldOut:ge,loginToPurchase:be,buttonDisabled:Pe,promptLogin:Ce,disableQuantity:Te,buttonCopy:De,helperText:Ie,boldHelperText:ke,displayPrice:Ae,showRedemptionCodeModal:W,selectedOptionsByTitle:te},actions:{setQuantity:ee,setSelectedOptionsByTitle:ie,handleDirectDownloadClick:Se,handleAddToCart:Le,setShowRedemptionCodeModal:J}})),[F,m,K,oe,re,ue,he,pe,we,me,fe,ge,be,Pe,Ce,Te,De,Ie,ke,Ae,ee,Se,Le,W,J,te,ie,f?.updating])}}}]); //# sourceMappingURL=5484-ab64c090efa0fb96.js.map