"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5505],{75505:function(e,t,r){r.d(t,{UT:function(){return me},tw:function(){return Ae},St:function(){return ye},P0:function(){return Fe},WA:function(){return l},QV:function(){return A},xb:function(){return V},GV:function(){return ee},Sf:function(){return Ue}});var n=r(2784),i=r(7307),s=r(86409);const a=(0,i.default)(s.He).withConfig({componentId:"sc-1lwtses-0"})(["margin-bottom:",";"],(e=>{let{theme:t}=e;return t.spacing[40]}));var o=r(52322);var l=function(e){let{children:t}=e;return(0,o.jsx)(a,{children:t})},c=r(14625),d=r(51855),u=r(12192),p=r(70510),m=r(34693),h=r(90929),g=r(79185),f=r(68215),x=r(77216),j=r(63046),y=r(81062);const b=i.default.span.withConfig({componentId:"sc-aicnew-0"})(["","{display:none;}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),w=i.default.span.withConfig({componentId:"sc-aicnew-1"})(["display:none;","{display:inline;}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),v=(0,i.default)(s.He).attrs({as:"section"}).withConfig({componentId:"sc-aicnew-2"})(["display:flex;align-items:center;position:relative;"]),k=i.default.div.withConfig({componentId:"sc-aicnew-3"})(["display:flex;flex-direction:column;","{flex:0 0 ",";}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>{let{theme:t}=e;return t.pxToRem(300)})),I=i.default.div.withConfig({componentId:"sc-aicnew-4"})(["width:100%;"]),C=i.default.div.withConfig({componentId:"sc-aicnew-5"})(["display:flex;flex:1 1 auto;flex-direction:column;padding:"," 0;","{flex-direction:row;align-items:center;padding:",";}"],(e=>{let{theme:t}=e;return t.spacing[24]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>{let{theme:t}=e;return t.spacing[24]})),O=i.default.div.withConfig({componentId:"sc-aicnew-6"})(["&::after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;}"]),P=i.default.div.withConfig({componentId:"sc-aicnew-7"})(["color:",";flex-shrink:0;","{padding-right:",";}"],(e=>{let{theme:t}=e;return t.color.primary}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>{let{theme:t}=e;return t.spacing[24]})),S=(0,i.default)(x.H).attrs({large:!0,variant:"h2"}).withConfig({componentId:"sc-aicnew-8"})(["margin-top:0;margin-bottom:",";"],(e=>{let{theme:t}=e;return t.spacing[4]})),T=(0,i.default)(j.T).attrs({variant:"body"}).withConfig({componentId:"sc-aicnew-9"})(["margin-top:0;margin-bottom:",";"],(e=>{let{theme:t}=e;return t.spacing[4]})),N=(0,i.default)(y.P).attrs((e=>({regPrice:e.regPrice}))).withConfig({componentId:"sc-aicnew-10"})(["font-size:16px;"]);var A=e=>{let{purchase:t}=e;const r=(0,m.useLocalizer)(),{text:n}=r,i=(0,f.tv)(),s=new Date(t.date).toLocaleString(i.locale,{month:"long",day:"2-digit",year:"numeric"}),a=(0,g.T4)(t.amount,t.currency,r);let l=(0,o.jsx)(c.d_,{status:t.status}),x=(0,o.jsxs)(T,{children:[n("Ship to:")," ",t.shipping?.firstName," ",t.shipping?.lastName]});return"digital"===t.type&&(l=null,x=(0,o.jsx)(T,{children:n(t.platform||"")})),(0,o.jsxs)(v,{children:[(0,o.jsxs)(C,{children:[(0,o.jsxs)(k,{children:[(0,o.jsx)(S,{children:s}),(0,o.jsx)(N,{regPrice:`${a}`}),(0,o.jsxs)(T,{children:[n("Purchase type:")," ",n((0,h.zf)(t.type))]}),x,n("Order Number:")," ",t.id]}),(0,o.jsxs)(I,{children:[l,(0,o.jsx)(V,{purchase:t})]})]}),(0,o.jsxs)(P,{children:[(0,o.jsxs)(b,{children:[(0,o.jsx)(f.rU,{href:`/orders/${t.id}`,children:(0,o.jsx)(O,{})}),(0,o.jsx)(d.Z,{})]}),(0,o.jsx)(w,{children:(0,o.jsx)(u.D,{href:`/orders/${t.id}`,icon:p.Z,locale:i.locale,children:n("View details")})})]})]})},$=r(95235);const L=i.default.div.withConfig({componentId:"sc-2cetgr-0"})(["display:flex;gap:",";align-items:center;margin-top:",";flex:1 0 auto;"],(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.spacing[16]})),Q=i.default.span.withConfig({componentId:"sc-2cetgr-1"})(["display:none;","{display:inline;}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),q=i.default.span.withConfig({componentId:"sc-2cetgr-2"})(["","{display:none;}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),D=(0,i.default)(L).withConfig({componentId:"sc-2cetgr-3"})(["align-items:flex-start;"]),z=i.default.div.withConfig({componentId:"sc-2cetgr-4"})(["display:none;","{display:flex;}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),B=i.default.div.withConfig({componentId:"sc-2cetgr-5"})(["font-weight:bold;display:block;"]),H=i.default.div.withConfig({componentId:"sc-2cetgr-6"})(["overflow:hidden;flex-shrink:0;"]),_=(0,i.default)(j.T).attrs({variant:"title"}).withConfig({componentId:"sc-2cetgr-7"})(["margin-top:0;text-overflow:ellipsis;overflow:hidden;"]),Z=i.default.div.withConfig({componentId:"sc-2cetgr-8"})(["font-size:",";&:first-of-type{margin-top:4px;}"],(e=>{let{theme:t}=e;return t.font.size.legalDesktop}));var G=r(87136);function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t{const{amount:t}=e;return(0,o.jsx)(Q,{children:(0,o.jsxs)(B,{children:["+",t]})})},M=e=>{const{amount:t}=e;return(0,o.jsx)(q,{children:(0,o.jsxs)(B,{children:["+",t]})})},R=3,W=2,Y=e=>{const{items:t}=e,r=t.slice(0,W),[i]=t.slice(W,W+1);return(0,o.jsxs)(L,{children:[r.map((e=>(0,o.jsxs)(n.Fragment,{children:[(0,o.jsx)(c.qN,{alt:e.name,publicId:e.image||G.BY}),1===t.length&&(0,o.jsxs)("div",{children:[(0,o.jsx)(_,{children:e.name}),!!e.bundleOptions?.length&&(0,o.jsx)("div",{children:e.bundleOptions.map((e=>(0,o.jsx)(Z,{children:e.values?.[0]?.product?.name},e.id)))})]})]},`item-${e.sku}`))),t.length>R?(0,o.jsx)(z,{children:(0,o.jsx)(c.qN,{alt:i.name,publicId:i.image||G.BY})}):null,t.length>R?(0,o.jsx)(E,{amount:t.length-R}):null,t.length>W?(0,o.jsx)(M,{amount:t.length-W}):null]})},K=e=>{let{image:t,name:r}=e;return(0,o.jsxs)(D,{children:[(0,o.jsx)(H,{children:(0,o.jsx)(c.qN,{alt:"Product art",publicId:t||G.BY})}),(0,o.jsx)(_,{children:r})]})};var V=e=>{let{purchase:t}=e;return"physical"===t.type?(0,o.jsx)(Y,U({},t)):(0,o.jsx)(K,U({},t))},J=r(84433);const X=(0,i.default)(J.S).withConfig({componentId:"sc-19mpt7o-0"})(["> div{height:175px;margin-bottom:50px;}"]);var ee=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.h8,{}),(0,o.jsxs)(s.$0,{constrained:!0,children:[(0,o.jsx)(X,{}),(0,o.jsx)(X,{}),(0,o.jsx)(X,{})]})]}),te=r(67512),re=r(88162),ne=r(1505);i.default.div.withConfig({componentId:"sc-1wh0o51-0"})(["display:flex;justify-content:center;align-items:center;flex-direction:column;margin-top:",";"],(e=>{let{theme:t}=e;return t.spacing[64]})),(0,i.default)(j.T).attrs({variant:"title"}).withConfig({componentId:"sc-1wh0o51-1"})(["display:flex;flex-direction:column;margin-top:",";","{display:block;}"],(e=>{let{theme:t}=e;return t.spacing[32]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop}));const ie=i.default.div.withConfig({componentId:"sc-1wh0o51-2"})(["margin-top:",";display:flex;justify-content:center;"],(e=>{let{theme:t}=e;return t.spacing[24]})),se=(0,i.default)(re.B).withConfig({componentId:"sc-1wh0o51-3"})(["min-width:150px;"]),ae=(0,i.default)(s.He).withConfig({componentId:"sc-1wh0o51-4"})(["display:flex;flex-direction:column;","{align-items:flex-end;flex-direction:row;justify-content:space-between;gap:",";}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>e.theme.spacing[20])),oe=(i.default.div.withConfig({componentId:"sc-1wh0o51-5"})(["","{width:100%;max-width:",";}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>{let{theme:t}=e;return t.pxToRem(260)})),i.default.div.withConfig({componentId:"sc-1wh0o51-6"})(["display:flex;flex-direction:row;gap:",";align-items:center;"],(e=>{let{theme:t}=e;return t.spacing[16]}))),le=(0,i.default)(j.T).attrs({variant:"title"}).withConfig({componentId:"sc-1wh0o51-7"})(["margin-right:",";margin-bottom:",";","{display:flex;align-items:center;margin-bottom:0;}"],(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.spacing[8]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),ce=i.default.div.withConfig({componentId:"sc-1wh0o51-8"})(["margin-bottom:",";","{display:flex;align-items:center;}"],(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),de=i.default.span.withConfig({componentId:"sc-1wh0o51-9"})(["display:none;","{display:inline;}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop}));var ue=r(92167);function pe(e){if(!e)return[];return e.map((e=>(0,ue.ZP)(e)))}var me=e=>{let{fetchMore:t,refetch:r,purchases:i,loading:a,totals:c}=e;const{text:d}=(0,m.useLocalizer)(),u=(0,f.tv)(),{0:p,1:h}=(0,n.useState)(pe(i)),{0:g,1:x}=(0,n.useState)(!1),{0:j,1:y}=(0,n.useState)(2),{0:b,1:w}=(0,n.useState)(null),{0:v,1:k}=(0,n.useState)(0),I=(0,n.useCallback)((e=>{w(e),x(!0);r({page:1,where:{type:{eq:e}}}).then((e=>{const t=pe(e.data?.customer?.orderHistory?.orders);h(t),y(2),x(!1)}))}),[r]);return(0,n.useEffect)((()=>{null===b?k(c.digital+c.physical):"DIGITAL"===b?k(c.digital):"PHYSICAL"===b&&k(c.physical)}),[c.digital,c.physical,b]),a?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.h5,{title:"Purchase history",children:(0,o.jsxs)(te.B,{currentPage:u.pathname,children:[(0,o.jsx)(f.rU,{href:"/",children:(0,o.jsx)("a",{children:d("Home")})}),(0,o.jsx)(f.rU,{href:"/orders",children:(0,o.jsx)("a",{children:d("Purchase history")})})]})}),p.length||null!==b?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ae,{children:(0,o.jsxs)(ce,{children:[(0,o.jsx)(le,{children:d("Category:")}),(0,o.jsxs)(oe,{children:[(0,o.jsxs)(re.B,{still:!0,size:"small",variant:"quaternary",round:!0,selected:null===b,onClick:()=>I(null),children:[d("Show all")," ",(0,o.jsxs)(de,{children:["(",c.digital+c.physical,")"]})]}),(0,o.jsxs)(re.B,{still:!0,size:"small",variant:"quaternary",round:!0,selected:"DIGITAL"===b,disabled:0===c.digital,onClick:()=>I("DIGITAL"),children:[d("Digital")," ",(0,o.jsxs)(de,{children:["(",c.digital,")"]})]}),(0,o.jsxs)(re.B,{still:!0,size:"small",variant:"quaternary",round:!0,selected:"PHYSICAL"===b,disabled:0===c.physical,onClick:()=>I("PHYSICAL"),children:[d("Physical")," ",(0,o.jsxs)(de,{children:["(",c.physical,")"]})]})]})]})}),p.map((e=>(0,o.jsxs)(n.Fragment,{children:[(0,o.jsx)(s.He,{children:(0,o.jsx)(s.Hr,{})}),(0,o.jsx)(A,{purchase:e})]},`purchase-${e.id}`))),(0,o.jsxs)(l,{children:[(0,o.jsx)(s.Hr,{}),p.length(x(!0),void t({variables:{page:j}}).then((e=>{const t=pe(e.data?.customer?.orderHistory?.orders);h([...p,...t]),y(j+1),x(!1)}))),children:d("Load more")})}):null]})]}):(0,o.jsx)(ye,{})]})},he=r(96447),ge=r(92951);const fe=i.default.div.withConfig({componentId:"sc-1bq8esa-0"})(["display:flex;justify-content:center;align-items:center;flex-direction:column;margin-top:",";"],(e=>{let{theme:t}=e;return t.spacing[64]})),xe=(0,i.default)(ge.Z).withConfig({componentId:"sc-1bq8esa-1"})(["height:",";width:auto;"],(e=>{let{theme:t}=e;return t.spacing[48]})),je=(0,i.default)(j.T).attrs({variant:"title"}).withConfig({componentId:"sc-1bq8esa-2"})(["display:flex;flex-direction:column;margin-top:",";","{display:block;}"],(e=>{let{theme:t}=e;return t.spacing[32]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop}));var ye=function(){const{text:e}=(0,m.useLocalizer)(),t=(0,f.tv)();return(0,o.jsx)(s.$0,{constrained:!0,children:(0,o.jsxs)(fe,{children:[(0,o.jsx)(xe,{}),(0,o.jsxs)(je,{children:[(0,o.jsx)("span",{children:e("No purchase history to show.")})," ",(0,o.jsxs)("span",{children:[e("Why not add")," ",(0,o.jsx)(he.L,{href:"/store",locale:t.locale,children:e("something fun")}),"?"]})]})]})})},be=r(51014),we=r(80437),ve=r(15820);const ke=i.default.div.withConfig({componentId:"sc-au0dvl-0"})(["display:flex;flex-direction:column;margin-bottom:",";","{flex-direction:row;justify-content:space-between;align-items:center;}"],(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),Ie=(0,i.default)(j.T).attrs({variant:"title"}).withConfig({componentId:"sc-au0dvl-1"})(["margin-top:0;"]),Ce=(0,i.default)(j.T).attrs({variant:"caption"}).withConfig({componentId:"sc-au0dvl-2"})(["margin:0;font-weight:bold;"]),Oe=i.default.div.withConfig({componentId:"sc-au0dvl-3"})(["display:grid;grid-template-columns:1fr;column-gap:",";margin-bottom:",";max-width:",";width:100%;","{grid-template-columns:1fr 1fr;}"],(e=>{let{theme:t}=e;return t.spacing[32]}),(e=>{let{theme:t}=e;return t.spacing[32]}),(e=>{let{theme:t}=e;return t.pxToRem(800)}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),Pe=i.default.div.withConfig({componentId:"sc-au0dvl-4"})(["","{grid-column:1 / 3;}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),Se=i.default.div.withConfig({componentId:"sc-au0dvl-5"})(["margin-bottom:",";","{grid-column:1 / 3;}"],(e=>{let{theme:t}=e;return t.spacing[48]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),Te=(0,i.default)(s.$0).attrs({constrained:!0}).withConfig({componentId:"sc-au0dvl-6"})(["margin-top:",";"],(e=>{let{theme:t}=e;return t.spacing[64]})),Ne=(0,i.default)(j.T).attrs({variant:"title"}).withConfig({componentId:"sc-au0dvl-7"})(["margin-bottom:",";"],(e=>{let{theme:t}=e;return t.spacing[16]}));var Ae=()=>{const{text:e}=(0,m.useLocalizer)(),t=(0,m.useAccounts)(),r=(0,f.tv)(),[n,{loading:i,error:a,data:l}]=(0,ve.td)(ve.o$.LN);if(l?.guestOrder&&!a){const e=(0,ue.ZP)(l.guestOrder,r.locale);return(0,o.jsx)(Fe,{order:e})}return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.h5,{title:"Track order status",children:(0,o.jsxs)(te.B,{currentPage:r.pathname,children:[(0,o.jsx)(f.rU,{href:"/",children:(0,o.jsx)("a",{children:e("Home")})}),(0,o.jsx)(f.rU,{href:"/orders",children:(0,o.jsx)("a",{children:e("Track order status")})})]})}),(0,o.jsx)(s.$0,{constrained:!0,children:(0,o.jsxs)("form",{onSubmit:e=>{e.preventDefault();const t=e.currentTarget.elements.number,i=e.currentTarget.elements.postcode,s=e.currentTarget.elements.lastname;n({orderNumber:t.value,postcode:i.value,lastname:s.value,locale:r.locale})},children:[(0,o.jsxs)(Oe,{children:[(a||null===l?.guestOrder)&&(0,o.jsx)(Se,{children:(0,o.jsx)(be.N,{type:"error",children:e("Sorry, but we could not find that order. Please check your entry and try again.")})}),(0,o.jsx)(Pe,{children:(0,o.jsxs)(ke,{children:[(0,o.jsx)(Ie,{children:e("Order information")}),(0,o.jsx)(Ce,{children:e("* Required fields")})]})}),(0,o.jsx)(we.I,{placeholder:e("Order number"),label:e("Order number"),name:"number",required:!0}),(0,o.jsx)(we.I,{placeholder:e("Billing Zip/postal code"),label:e("Billing Zip/postal code"),name:"postcode",required:!0}),(0,o.jsx)(Pe,{children:(0,o.jsx)(we.I,{placeholder:e("Billing last name"),label:e("Billing last name"),name:"lastname",required:!0})}),l?.guestOrder&&!a&&(0,o.jsx)(Se,{children:(0,o.jsx)(be.N,{type:"success",children:e("Order found!")})})]}),(0,o.jsx)(re.B,{isLoading:i,children:e("Continue")})]})}),(0,o.jsxs)(Te,{children:[(0,o.jsx)(Ne,{children:e("Can't find your order number? Log in to access your order history.")}),(0,o.jsx)(re.B,{variant:"secondary",onClick:()=>t.promptLogin(),children:e("Log in")})]})]})},$e=r(20669),Le=r(43499);const Qe=i.default.div.withConfig({componentId:"sc-l9j285-0"})(["border-radius:",";"],(e=>{let{theme:t}=e;return t.borderRadius})),qe=(0,i.default)(s.h5).withConfig({componentId:"sc-l9j285-1"})(["margin-bottom:",";","{margin-bottom:",";}"],(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>{let{theme:t}=e;return t.spacing[24]})),De=i.default.div.withConfig({componentId:"sc-l9j285-2"})(["display:flex;flex-direction:column;margin:0 0 ",";gap:",";"],(e=>{let{theme:t}=e;return t.spacing[32]}),(e=>{let{theme:t}=e;return t.spacing[8]})),ze=i.default.div.withConfig({componentId:"sc-l9j285-3"})(["display:flex;gap:",";flex-direction:column;","{gap:",";align-items:flex-end;flex-direction:row;}"],(e=>{let{theme:t}=e;return t.spacing[8]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>{let{theme:t}=e;return t.spacing[32]})),Be=((0,i.default)(Qe).withConfig({componentId:"sc-l9j285-4"})(["display:flex;flex-direction:column;margin-bottom:",";"," & > *{flex:1;padding:",";&:not(:last-child){border-bottom:solid 1px ",";}}","{flex-direction:row;& > *{&:not(:last-child){border-bottom:0;border-right:solid 1px ",";}}}"],(e=>{let{theme:t}=e;return t.spacing[32]}),(e=>{let{theme:t}=e;return(0,i.css)(["border:solid 1px ",";"],t.color.lightGray2)}),(e=>{let{theme:t}=e;return t.spacing[24]}),(e=>{let{theme:t}=e;return t.color.lightGray2}),(e=>{let{theme:t}=e;return t.mediaQuery.tablet}),(e=>{let{theme:t}=e;return t.color.lightGray2})),i.default.div.withConfig({componentId:"sc-l9j285-5"})(["display:flex;margin-bottom:",";font-weight:bold;svg{margin-right:",";}"],(e=>{let{theme:t}=e;return t.spacing[32]}),(e=>{let{theme:t}=e;return t.spacing[8]}))),He=(0,i.default)(Qe).withConfig({componentId:"sc-l9j285-6"})(["margin-bottom:",";& > *{&:first-child{border-bottom:solid 1px ",";padding-bottom:",";}}","{"," & > *{padding:",";&:first-child{padding:",";margin:0;border-bottom:solid 1px ",";}}}"],(e=>{let{theme:t}=e;return t.spacing[32]}),(e=>{let{theme:t}=e;return t.color.lightGray2}),(e=>{let{theme:t}=e;return t.spacing[8]}),(e=>{let{theme:t}=e;return t.mediaQuery.tablet}),(e=>{let{theme:t}=e;return(0,i.css)(["border:solid 1px ",";margin-bottom:",";"],t.color.lightGray2,t.spacing[32])}),(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.spacing[16]}),(e=>{let{theme:t}=e;return t.color.lightGray2})),_e=i.default.div.withConfig({componentId:"sc-l9j285-7"})(["display:flex;justify-content:space-between;flex-direction:column;","{flex-direction:row;}"],(e=>{let{theme:t}=e;return t.mediaQuery.tablet})),Ze=(0,i.default)(j.T).attrs({variant:"caption"}).withConfig({componentId:"sc-l9j285-8"})(["display:flex;align-items:center;margin-top:",";","{margin-top:0;}"],(e=>{let{theme:t}=e;return t.spacing[4]}),(e=>{let{theme:t}=e;return t.mediaQuery.tablet})),Ge=(i.default.div.withConfig({componentId:"sc-l9j285-9"})(["margin-top:",";"],(e=>{let{theme:t}=e;return t.spacing[16]})),i.default.span.withConfig({componentId:"sc-l9j285-10"})(["font-weight:bold;"]));var Fe=e=>{let{order:t,customer:r}=e;const n=(0,m.useLocalizer)(),{text:i}=n,a=(0,f.tv)(),d=(0,m.useAccounts)(),p=new Date(t.date).toLocaleString(a.locale,{month:"2-digit",day:"2-digit",year:"numeric"}),{currency:h,totals:x,type:j}=t,y=(0,g.T4)(x.grand,h,n);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(qe,{title:"Order details",children:(0,o.jsxs)(te.B,{currentPage:a.asPath,children:[(0,o.jsx)(f.rU,{href:"/",children:(0,o.jsx)("a",{children:i("Home")})}),(0,o.jsx)(f.rU,{href:"/orders",children:(0,o.jsx)("a",{children:i("Purchase history")})}),(0,o.jsx)(f.rU,{href:`/orders/${t.id}/`,children:(0,o.jsx)("a",{children:`${i("Order #")} ${t.id}`})})]})}),(0,o.jsxs)(s.He,{children:["physical"===j?(0,o.jsx)(De,{children:(0,o.jsxs)(ze,{children:[(0,o.jsx)("div",{children:(0,o.jsx)(c.d_,{status:t.status})}),(0,o.jsxs)("div",{children:[(0,o.jsx)(Ge,{children:i("Transaction date:")})," ",p]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(Ge,{children:i("Order total:")})," ",y]})]})}):(0,o.jsxs)(De,{children:[(0,o.jsxs)(ze,{children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(Ge,{children:i("Transaction date:")})," ",p]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(Ge,{children:i("Order total:")})," ",y]})]}),(0,o.jsxs)(ze,{children:[t.platform&&(0,o.jsxs)("div",{children:[(0,o.jsx)(Ge,{children:i("Device type:")})," ",t.platform]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(Ge,{children:i("Associated Nintendo Account:")})," ",r?.email]})]})]}),"physical"===j?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.qR,{billingAddress:t.billing,shippingAddress:t.shipping,paymentMethod:t.payment,shippingMethod:t.shipping.method,shipments:t.shipments}),(0,o.jsx)($e.S,{size:32})]}):null,(0,o.jsxs)(Be,{children:[i("Need a hand?"),(0,o.jsx)($e.S,{size:4,axis:"horizontal"}),(0,o.jsx)(he.L,{href:"https://en-americas-support.nintendo.com/app/contact",target:"_blank",children:i("Contact Customer Support")})]}),t.shipments.map(((e,r)=>{const{items:n}=e,[s]=e.tracking;return(0,o.jsxs)(He,{children:[(0,o.jsxs)(_e,{children:[(0,o.jsx)(Ue,{tracking:s,variant:"title"}),(0,o.jsxs)(Ze,{children:[i("{0} of {1}",{args:[r+1,t.shipments.length]})," ","(",n.length,")"]})]}),(0,o.jsx)("div",{children:n.map((e=>{const r=e.bundleName||e.name,n=e.bundleName?e.name:null;return(0,o.jsx)(c.Dd,{locale:a.locale,finalprice:e.finalPricePerItem,quantity:e.quantity,name:r,subtitle:n,publicId:e.image,currency:t.currency,type:j,title:e.name||e.product?.name,urlKey:e.urlKey||e.product?.urlKey,hidePrice:!0},`order-${e.sku}`)}))})]},e.number)})),(0,o.jsx)(c.a3,{couponCode:t.couponCode,currency:t.currency,shippingMethod:t.shipping.method,totals:x,type:j}),(0,o.jsx)(c.iQ,{items:t.items,currency:h,locale:a.locale,type:j}),(0,o.jsx)($e.S,{size:32})]}),(0,o.jsx)(l,{children:d.isLoggedIn?(0,o.jsx)(u.D,{href:"/orders",icon:Le.Z,locale:a.locale,children:i("Back to purchase history")}):(0,o.jsx)(u.D,{onClick:()=>a.reload(window.location.pathname),icon:Le.Z,locale:a.locale,children:i("Look up another order")})})]})};var Ue=e=>{let{tracking:t,variant:r}=e;const{text:n}=(0,m.useLocalizer)();return(0,o.jsxs)(j.T,{variant:r,children:[n("{0} tracking",{args:[t?.carrier?.toUpperCase()]})," ",(0,o.jsx)(he.L,{href:t.url,target:"_blank",children:t.number})]})}},92167:function(e,t,r){r.d(t,{ZP:function(){return c}});var n=r(95235),i=r(90929);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t({sku:e.product?.sku,bundleOptions:e.bundleOptions,name:e.product?.name,image:e.product?.productImage?.publicId,isDiscounted:e.product?.prices?.minimum?.discounted,finalPricePerItem:e.productSalePrice,regularPricePerItem:e.product?.prices?.minimum?.regularPrice,platform:e.product?.platform?.label,quantity:e.quantityOrdered,amount:e.productSalePrice,platinumPoints:e.product?.platinumPoints,urlKey:e.product?.urlKey}),l=e=>(e.items||[]).reduce(((t,r)=>{let{orderItem:n,parentSku:i}=r;if(n.productSku.split("-").length>2)return t;const s=e.items.find((e=>{let{orderItem:t}=e;return t.productSku===i}));return[...t,a(a({},o(a(a({},n),{},{productSalePrice:s?.orderItem?.product?.prices?.minimum?.regularPrice||n?.product?.prices?.minimum?.regularPrice}))),{},{image:s?s.orderItem?.product?.productImage?.publicId:n?.product?.productImage?.publicId,quantity:n.quantityShipped,parentSku:i,bundleName:s?.orderItem?.product?.name})]}),[]);function c(e,t){const r=e.items.map(o),n=e.shipments?.map((e=>((e,t)=>{const r=(0,i.$w)(t);return{number:e.number,items:l(e),tracking:e.tracking.map((e=>((e,t)=>{const r={en:{fedex:`https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=${e.number}`,ups:`https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=${e.number}`,"ups mi":`https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=${e.number}`,usps:`https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=${e.number}`,puro:`https://www.purolator.com/${t}/shipping/tracker?pin=${e.number}`,"canada post":`https://www.canadapost-postescanada.ca/track-reperage/${t}#/search?searchFor=${e.number}`},fr:{fedex:`https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber=${e.number}`,ups:`https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=${e.number}`,"ups mi":`https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=${e.number}`,usps:`https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=${e.number}`,puro:`https://www.purolator.com/${t}/expedition/faire-le-suivi-dun-envoi?pin=${e.number}`,"canada post":`https://www.canadapost-postescanada.ca/track-reperage/${t}#/search?searchFor=${e.number}`}};return{title:e.title,number:e.number,carrier:e.carrier,url:r[t][e.carrier]||"#"}})(e,r)))}})(e,t)));return{id:e.id||e.number,couponCode:e.couponCode,name:r[0].name||e.contentName,type:"StoreOrder"==e.__typename||"GuestOrder"==e.__typename?"physical":"digital",date:e.orderDate,amount:e.total.grandTotal,platform:r[0].platform,image:r[0].image,status:e.status||null,billing:{firstName:e.billingAddress?.firstName,lastName:e.billingAddress?.lastName,street:e.billingAddress?.street,city:e.billingAddress?.city,postcode:e.billingAddress?.postcode,region:e.billingAddress?.region?.name,country:e.billingAddress?.country?.fillNameEnglish,telephone:e.billingAddress?.telephone},shipping:{firstName:e.shippingAddress?.firstName,lastName:e.shippingAddress?.lastName,street:e.shippingAddress?.street,city:e.shippingAddress?.city,postcode:e.shippingAddress?.postcode,region:e.shippingAddress?.region?.name,country:e.shippingAddress?.country?.fillNameEnglish,telephone:e.shippingAddress?.telephone,method:e.shippingMethod,carrier:e.shipments?.tracking?.carrier,number:e.shipments?.tracking?.number,title:e.shipments?.tracking?.title},payment:{method:e.paymentMethod?.method,type:e.paymentMethod?.type,last4:e.paymentMethod?.last4},totals:{discounts:e.total.discounts,grand:e.total.grandTotal,sub:e.total.subtotal,tax:e.total.totalTax,taxes:e.total.taxes,shipping:e.total.totalShipping},shipments:n||[],items:r}}}}]);