1"use strict";(globalThis["__LOADABLE_LOADED_CHUNKS__"]||=[]).push([[4852,9417],{14580(e,t,s){s.d(t,{j:()=>E,A:()=>T});var n=s(71468),r=s(86532),a=s(49245),i=s(17638),o=s(65760),d=s(27189),l=s(47124),c=s(86128),m=s(87291),u=s(5032),p=s(26960),h=s(27357),x=s(65525),g=s(91560),f=s(71198),j=s(69314),y=s(51674),k=s(41466),b=s(21525);var v=s(10999),w=s(7581),I=s(29914),A=s(71347),C=s(32951),S=s(24842);const P=(e,t)=>`https://${o.A.host}/${t}/${e}`,E="Verkkokauppa.com - todennäköisesti aina halvempi!",B=(e,t,s,n,r,a,d,l,c)=>{const m=d?.attributes?.seoMetaDescription||((e="")=>e.replace(/(<([^>]+)>)/gi,"").replace(/\n/g," ").replace(/\[([^\]]*)\]\([^)]*\)/gim,"$1").trim()||E)(d?.attributes?.shortDescription),p=d?.attributes?.seoMetaTitle??d?.attributes.label??s[s.length-1]?.label??"",x=(c?[a,p]:[p]).filter(Boolean);return{pageProps:{category:d,type:"category",main:!0},metaProps:{canonical:P(l??e,r),description:t?.fields.metaDescription??m,socialUrl:d?`https://${o.A.host}${(0,u.dm)(d,r)}`:void 0,socialTitle:p,title:x,...d?.attributes?.slugs&&{hreflangLinks:(0,h.b)((0,i.xE)(d),d.attributes.slugs,c?"products":void 0)}},indexableByRobots:n}},T=(e,t)=>{const{language:s}=(0,I.A)(),i=(0,n.d4)((0,j.TW)(e)),T=(0,n.d4)((0,j.Ec)(e)),N=(0,A.A)(),M=(0,n.d4)((0,y.l1)(N))??void 0,D=(0,C.A)(M),$=(0,n.d4)((0,x.hT)(N,(0,m.wE)(M)?.externalId)),L=(0,v.A)(T),R=(0,w.A)(),F=(0,n.d4)((0,g.pW)(L)),X=(0,n.d4)((0,f.I7)(R)),O=(0,n.d4)((0,f.nt)(R)),{t:W}=(0,S.A)(),z=i?.fields.title??"",{pathname:U}=(0,r.zy)(),Y=(e=>e in(0,b.q)(k.DT))((0,u.vt)(U)),J=(0,u.rG)(U),V=l.EY.includes(s)&&!1!==i?.fields.indexable,q=V&&(!(0,u.rG)(U)||Y);if("etusivu"===e)return((e,t,s=!0,n)=>({pageProps:{type:"home",main:!0},metaProps:{canonical:P(e,n),description:t?.fields.metaDescription??"Verkkokauppa.com on Suomen tunnetuin ja vierailluin verkossa toimiva suomalainen vähittäiskauppa, jonka "+"tavoitteena on olla asiakkailleen todennäköisesti aina halvempi paikka tehdä ostoksia.",rawTitle:E},indexableByRobots:s}))(e,i,V,s);if(e===u.TW||e.startsWith("product")||M)return(({product:e,productArticle:t,page:s,language:n,availability:r,indexableByRobots:i=!0})=>{const{active:l,name:u="",pid:x,price:g,visible:f,href:j,localizedHrefs:y}=e||{},k=(0,m.$j)({article:t,language:n,fallback:u}),b=e?.pim_primary_category?{id:e?.pim_primary_category}:void 0,v=(e=>e?"images"in e?e.images.slice(0,5).map(({orig:e})=>e):"imageUrl"in e&&e.imageUrl?[e.imageUrl]:[]:[])(e),w=e?(0,a.I6)(e,r):null,I=e?(0,m.im)(e,n):void 0,A=[{label:`Tuote ${x}`,to:j??`/${n}/product/${x}`}],C=Object.keys(y??{}).includes(n),S=i&&(0,m.Bt)(l,f,C);return{pageProps:{breadcrumbItems:A,category:b,pid:x,type:"item",main:!0},metaProps:{breadcrumbItems:A,canonical:j||x?I:void 0,description:s?.fields.metaDescription??e?.descriptionShort,robots:S?void 0:d.G9,socialUrl:j?`https://${o.A.host}${j}`:void 0,socialImages:v,socialTitle:u?`${u}${g?.current?` ${(0,c.$g)(g.current)}`:""}`:"",title:k,...y&&{hreflangLinks:(0,h.Al)(y)},...x&&(0,p.R)(w)&&(0,p.R)(g?.current)&&{socialProduct:{availability:w,condition:"new",price:{amount:g.current.toFixed(2),currency:"EUR"},retailer_item_id:`${x}
1`},socialType:"product.item"}},indexableByRobots:S}})({product:M,productArticle:D,page:i,language:s,availability:$,indexableByRobots:V});if(e===u.rd||e.startsWith("catalog")||X)return B(e,i,O,q,s,W(e=>e.breadcrumbs.allProducts),X,t,J);if(e===u.oe||e.startsWith("brand")||F){const n=i?.fields.route===u.oe&&F?.name||z;return(({route:e,page:t,brand:s,title:n,canonical:r,indexableByRobots:a=!0,language:i})=>({pageProps:{brand:s,type:"brand",main:!0},metaProps:{canonical:P(r??e,i),description:t?.fields.metaDescription??E,socialImages:[],title:n},indexableByRobots:a}))({route:e,page:i,brand:F?.name??L,title:n,canonical:t,indexableByRobots:V,language:s})}return{pageProps:{type:"generic",main:!0},metaProps:{breadcrumbItems:[],canonical:P(t??e,s),description:i?.fields.metaDescription??"",title:z,socialImages:[],socialTitle:""},indexableByRobots:V}}},98840(e,t,s){var n=s(96540),r=s(71468),a=s(37166),i=s(20042),o=s(43955);const d="main",l=(e=d,t)=>{const s=(0,r.d4)((0,i.H_)(t)),l=(0,o.A)();return(0,n.useMemo)(()=>{if(!s)return null;const t=({area:t=e})=>(0,a.a)(s,l)[t]??null;return t&&(t.displayName="SisuContent"),t},[s,e,l])};s.d(t,["A",0,l])},2073(e,t,s){s.r(t),s.d(t,{default:()=>P});var n=s(14181),r=s(96540),a=s(71468),i=s(86532),o=s(10999),d=s(7581),l=s(14580),c=s(29914),m=s(71347),u=s(26960),p=s(17644),h=s(13375),x=s(55567);const g=e=>{const t=(0,a.d4)(p.Zz),s=(0,x.A)(),n=(0,r.useMemo)(()=>Object.entries(e?.relations??{}).reduce((e,[,t])=>[...e,...t],[e?.pid]).concat(e?.bundleProducts?.map(({pid:e})=>e)).filter(u.zz),[e]);(0,r.useEffect)(()=>{t&&n.length&&s((0,h.m2)({pids:n}))},[s,n,t])};s(87291);var f=s(5032),j=(s(170),s(91560)),y=s(71198),k=s(51674),b=s(15648),v=s(4311),w=s(56361),I=s(51223),A=s(28911),C=s(74848);const S=({canonical:e,route:t})=>{const{language:s}=(0,c.A)(),{pageProps:r,metaProps:u,indexableByRobots:p}=(0,l.A)(t,e),h=(0,m.A)(),x=(0,a.d4)((0,k.l1)(h)),S=(0,a.d4)((0,k.xz)(h)),P=(0,a.d4)((0,k.NQ)(h));g(x);const E=(0,o.A)({}),B=(0,a.d4)((0,j.hZ)(E)),T=(0,a.d4)((0,j.y2)(E)),N=(0,d.A)(),[M]=(0,a.d4)((0,y.HG)(N?[N]:void 0));if(h){if(!x)return P?(0,C.jsx)(v.A,{title:"Tuote on poistunut valikoimasta"}):(0,C.jsxs)(A.A,{background:n.color.background.primary,forceMinHeight:!0,...r,showBreadcrumbs:!1,children:[(0,C.jsx)(I.A.NoIndex,{title:"Ladataan tuotetta"}),(0,C.jsx)(w.A,{message:"Ladataan tuotteen tietoja...",reflow:!0})]});if(3===x.visible){if(S)return(0,C.jsxs)(A.A,{background:n.color.background.primary,forceMinHeight:!0,...r,showBreadcrumbs:!1,children:[(0,C.jsx)(I.A.NoIndex,{title:"Ladataan tuotetta"}),(0,C.jsx)(w.A,{message:"Ladataan tuotteen tietoja...",reflow:!0})]});const e=x.name?.replace("-","").slice(0,75)??"";return(0,C.jsx)(i.C5,{replace:!0,to:(0,f.cY)(e,{language:s})})}}if(E){if(T)return(0,C.jsxs)(A.A,{background:n.color.background.primary,forceMinHeight:!0,...r,showBreadcrumbs:!1,children:[(0,C.jsx)(I.A.NoIndex,{title:"Ladataan brändiä"}),(0,C.jsx)(w.A,{message:"Ladataan brändin tietoja...",reflow:!0})]});if(B)return(0,C.jsx)(v.A,{title:"Brändiä ei löytynyt"})}if(N){if(!M||M.loading)return(0,C.jsxs)(A.A,{background:n.color.background.primary,forceMinHeight:!0,...r,showBreadcrumbs:!1,children:[(0,C.jsx)(I.A.NoIndex,{title:"Ladataan tuotealuetta"}),(0,C.jsx)(w.A,{message:"Ladataan tuotealueen tietoja...",reflow:!0})]});if(M.failed)return(0,C.jsx)(v.A,{title:"Tuotealuetta ei löytynyt"})}const D=p?I.A:I.A.NoIndex;return(0,C.jsxs)(A.A,{background:n.color.background.primary,forceMinHeight:!0,...r,container:!1,showBreadcrumbs:!1,children:[(0,C.jsx)(D,{...u}),(0,C.jsx)(b.A,{page:t})]})},P=(0,r.memo)(S)},33303(e,t,s){s.r(t),s.d(t,{default:()=>Ra});var n=s(96540),r=s(71468),a=s(86532),i=s(21525),o=s(97809),d=s(41466),l=s(47124),c=s(5032),m=s(984),u=s(17644),p=s(69314),h=s(2073),x=s(94484),g=s(60951),f=s(55567),j=s(24842),y=s(41194),k=s(19134),b=s(55679),v=s(87130),w=s(18723),I=s(88467),A=s(74848);const C=()=>{const e=(0,f.A)(y.J.checkout.addressPage),t=(0,r.d4)(v.G5),{t:s}=(0,j.A)("checkout.ondemand"),a=(0,n.useCallback)(t=>{e((0,b.SX)(t.id))},[e]);return(0,A.jsx)(I.A,{step:k.BD,title:s(e=>e.addressPage.title),children:(0,A.jsx)(w.A,{selectedAddressId:t,type:"shipping",onAddressSelect:a})})};var S=s(61311),P=s(49937),E=s(14181),B=s(14218),T=s(34899),N=s(6596),M=s(69442),D=s(2046),$=s(92228),L=s(82947),R=s(8078),F=s(23812),X=s(8563),O=s(50600);const W=()=>{const{buildPathWithLanguage:e}=(0,o.A)(),t=(0,r.d4)(R.l7),s=(0,r.d4)(X.yl),a=(0,r.d4)(R.NZ),i=(0,r.d4)(R.cm),d=(0,r.d4)(R.pk),l=(0,r.d4)(R.p1),{t:m}=(0,j.A)("order-view.ondemand"),u=t&&!s&&!a&&!i&&!d&&!l,p=(0,f.A)(y.J.checkout.confirmedPage),h=(0,n.useCallback)(()=>{p((0,L.P9)())},[p]);return u?(0,A.jsx)(O.A,{to:e(c.Cg),onClick:h,children:m(e=>e.confirmedPage.continueShopping)}):null};var z=s(17277),U=s(163),Y=s(29430),J=s(82105),V=s(81267),q=s(9600),H=s(39779),G=s(11309),_=s(56361),K=s(82999),Q=s(87344),Z=s(75177),ee=s(21169),te=s(18492),se=s(68592);const ne=(0,P.styled)("p",{base:{textStyle:"ui.medium",margin:"none",_lastOfType:{marginBottom:"none"}},variants:{weight:{semiBold:{fontWeight:"semiBold"},regular:{}}}}),re=(0,P.styled)("ol",{base:{textStyle:"ui.medium",margin:"none",_lastOfType:{marginBottom:"none"}}}),ae=N["default"].li.withConfig({componentId:"sc-1hhsqpp-0"})({":last-of-type":{marginBottom:E.space.XS}}),ie=()=>{const{t:e}=(0,j.A)("common"),t=(0,r.d4)(R.m1),s=(0,r.d4)(R.vu),a=(0,r.d4)(R.j0),i=(0,r.d4)(R.J8),o=(0,r.d4)(R.c3),d=(0,r.d4)(R.NZ),l=(0,f.A)(y.J.tiha.orderView),c=(0,n.useCallback)(()=>l((0,H.E1)()),[l]),m=(0,n.useCallback)(()=>{t?.orderId&&l(H.v_.started(t.orderId))},[l,t]),u=t?.selectedShipmentMethodId,p=Boolean((0,se.tg)(u)&&se.rg[u]),h=(0,n.useMemo)(()=>`${((e,t)=>`${e?"Voit noutaa saatavilla olevat tuotteet":"Lähetämme sinulle osan tuotteista"}${t?", kun olet maksanut tilauksen":" heti"}.`)(p,d)}${((e,t,s)=>(0,$.GO)(s)&&t?` Maksat vain ${e?"saatavilla olevat tuotteet":"lähetetyt tuotteet sekä niiden toimituskulut"}.`:"")(p,d,t?.selectedPaymentMethodIds)}`,[p,d,t]),x=(0,n.useMemo)(()=>`${(e=>`${e?"Voit noutaa":"Lähetämme"} loput tuotteet niiden saavuttua varastoon. `)(p)}${((e,t,s)=>(0,ee.CJ)(s)?(0,$.GO)(s)&&e?" Maksat loput tuotteet erillisellä tilauksella.":te.v7 in s?" Lopuista tuotteista ja jälkitoimituksen toimituskuluista tulee tehdä uusi katevaraus.":te.G_ in s||te.a5 in s?" Maksat tämän lähetyksen toimituskulut erillisellä tilauksella.":!("lasku"in s)||e||t?(0,$.u9)(s)?e?" Maksat mahdolliset lisäkulut erillisellä tilauksella.":" Maksat tämän lähetyksen toimituskulut ja laskutuslisän erillisellä tilauksella.":"":" Maksat loput tuotteet sekä lähetyksen toimituskulut erillisellä laskulla.":"")(p,d,t?.selectedPaymentMethodIds)}`,[p,d,t]),g=(0,n.useMemo)(()=>
1{if(!a)return o||i?[{onClick:c,children:"Sulje"}]:[{onClick:c,children:"Peruuta",appearance:"secondary"},{onClick:m,children:"Lähetä pyyntö"}]},[c,i,a,m,o]),k=(0,n.useMemo)(()=>a?"Lähetetään jälkitoimituspyyntöä...":i?"Jälkitoimituspyynnön lähettäminen epäonnistui":o?"Jälkitoimituspyyntö lähetettiin":"Tilauksen jakaminen",[i,a,o]);return(0,A.jsx)(B.lG,{actions:g,closeButtonLabel:e(e=>e.dialog.closeButtonLabel),id:"backorder-submit",isOpen:s,title:k,onClose:c,children:a?(0,A.jsx)(_.A,{}):i?(0,A.jsx)(ne,{children:"Tapahtui odottamaton virhe, yritä myöhemmin uudestaan."}):o?(0,A.jsx)(ne,{children:"Jälkitoimituspyyntö lähetettiin onnistuneesti."}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(ne,{children:["Voit pyytää meitä jakamaan tilauksesi kahtia. Silloin"," ",p?"voit noutaa":"lähetämme sinulle"," ne tuotteet, jotka ovat heti saatavilla, ja siirrämme loput tuotteet uudelle tilaukselle."]}),(0,A.jsx)(ne,{weight:"semiBold",children:"Kuinka tilauksen jakaminen toimii?"}),(0,A.jsxs)(re,{children:[(0,A.jsx)(ae,{children:h}),(0,A.jsx)(ae,{children:x})]}),t?.selectedPaymentMethodIds&&(0,A.jsx)(ne,{children:"Saat ilmoituksen uudesta tilauksesta sähköpostiisi, kun olemme käsitelleet pyyntösi. Vahvistusviestin saat yleensä vuorokauden sisällä."})]})})};var oe=s(1462);const de=({className:e,orderId:t})=>(0,r.d4)(R.eH)?null:(0,A.jsx)("div",{className:e,children:(0,A.jsx)(oe.A,{height:50,value:`TIL${t}`,width:280})});de.displayName="Barcode";const le=(0,N["default"])(de).withConfig({componentId:"sc-1dm7vu0-0"})({display:"flex",justifyContent:"center",margin:E.space.XS});var ce=s(49785);const me=(0,N["default"])(B.lG.Footer).withConfig({componentId:"sc-d30d2e-0"})({margin:`${E.space.XS} 0 0 0`,paddingBottom:0}),ue=(0,P.styled)("p",{base:{textStyle:"ui.medium",margin:"none",_lastOfType:{marginBottom:"none"}},variants:{weight:{semiBold:{fontWeight:"semiBold"},regular:{}}}}),pe=N["default"].fieldset.withConfig({componentId:"sc-d30d2e-1"})({border:"none",display:"block",flexDirection:"column",marginTop:E.space.XXS,padding:0,"& .stm-radio__root":{width:"100%"}}),he=1e3,xe=()=>{const{t:e}=(0,j.A)(["common","order-view.ondemand"]),{register:t,handleSubmit:s,watch:i}=(0,ce.mN)({defaultValues:{reason:"",other:""}}),o=(0,a.Zp)(),d=(0,r.d4)(R.l7),l=(0,r.d4)(R["do"]),c=(0,r.d4)(R.O7),m=(0,r.d4)(R.ac),u=(0,r.d4)(R.Q6),p=(0,f.A)(y.J.tiha.orderView),h=(0,n.useMemo)(()=>[{key:2,label:e(e=>e.cancelReason.tooLongDeliveryTime,{ns:"order-view.ondemand"})},{key:6,label:e(e=>e.cancelReason.paymentProblems,{ns:"order-view.ondemand"})},{key:7,label:e(e=>e.cancelReason.foundCheaperElsewhere,{ns:"order-view.ondemand"})},{key:8,label:e(e=>e.cancelReason.otherReason,{ns:"order-view.ondemand"})}],[e]),x=(0,n.useCallback)(()=>{p((0,H.Pd)())},[p]),g=(0,n.useCallback)(e=>p(H.N4.started({...e,orderId:d??0,orderTotalPrice:l??0,navigate:o})),[p,o,l,d]),k=i("reason"),b=i("other"),v="8"===k,w=(new TextEncoder).encode(b).length,I=u?[{onClick:x,children:"Sulje"}]:[{onClick:x,children:"Ãlä peru tilausta",type:"button",appearance:"secondary"},{disabled:""===k||v&&!(w>0&&w<=he),appearance:"danger",onClick:void 0,children:"Peru tilaus",type:"submit"}],C=m?"Perutaan tilausta...":u?"Tilauksen peruminen epäonnistui":"Peru tilaus",P=v&&w>he?`Enintään ${he} merkkiä`:void 0;return(0,A.jsx)(B.lG,{closeButtonLabel:e(e=>e.dialog.closeButtonLabel,{ns:"common"}),id:"cancel-order",isOpen:c,title:C,onClose:x,children:m?(0,A.jsx)(_.A,{}):(0,A.jsxs)("form",{onSubmit:s(g),children:[u?(0,A.jsx)("p",{className:(0,S.css)({textStyle:"ui.medium",margin:"none"}),children:"Tapahtui odottamaton virhe. Yritä hetken kuluttua uudelleen. Ota yhteys asiakaspalveluun jos ongelmatilanne jatkuu."}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ue,{children:"Auta meitä palvelemaan sinua jatkossa paremmin vastaamalla kyselyyn."}),(0,A.jsx)(ue,{weight:"semiBold",children:"Valitse perumisen syy:"}),(0,A.jsx)(pe,{children:h.map(({key:e,label:s})=>(0,A.jsx)(B.sx,{...t("reason"),label:s,value:e},e))}),v&&(0,A.jsx)(B.fs,{...t("other"),css:{marginTop:"xs",paddingTop:"3xs",paddingBottom:"3xs"},errorMsg:P,id:"other",label:e(e=>e.cancelReason.otherReason,{ns:"order-view.ondemand"}),placeholder:"Kerro omin sanoin",autoFocus:!0,hideLabel:!0})]}),(0,A.jsx)(me,{actions:I})]})})};var ge=s(25274);const fe=N["default"].div.withConfig({componentId:"sc-1eq36e5-0"})({textAlign:"center",padding:`${E.space.XS} 0`,"button:nth-of-type(2)":{marginLeft:E.space.XS}});var je=s(59108),ye=s(87873),ke=s(10167),be=s(17957),ve=s(97670);const we=(0,P.styled)(B.EY.UI,{base:{marginTop:"4xs"}}),Ie=(0,P.styled)("div",{base:{textStyle:"ui.medium",margin:"none",marginTop:"4xs",pointerEvents:"auto"}}),Ae=N["default"].div.withConfig({componentId:"sc-8sl1qk-0"})({pointerEvents:"none",a:{pointerEvents:"auto"}}),Ce=(0,P.styled)(we,{base:{paddingBottom:"3xs"}}),Se=({product:e,inNewOrder:t,isLast:s,showDeliveryEstimate:a=!0,trackingCodes:i,hideBottomBorder:o})=>{const d=(0,r.d4)(R.wB),l=(0,r.d4)(R.gb),{t:c}=(0,j.A)("order-view.ondemand"),m=(0,f.A)(y.J.tiha.orderView),u=(0,n.useCallback)(t=>{t.stopPropagation(),t.preventDefault(),m((0,H.Nq)(e.pid))},[m,e.pid]),p=(0,n.useMemo)(()=>d.some(t=>t.rid===e.rid),[e.rid,d]),h=(0,n.useCallback)(()=>{m((0,H.dt)(p?d.filter(t=>t.rid!==e.rid):[...d,e]))},[p,m,e,d]);return(0,A.jsxs)(ye["default"],{hasCheckbox:l&&!t,hideBottomBorder:o,noLink:l,product:e,showDisclaimer:!1,showInput:!1,ignoreVatToggle:!0,onClick:!l||t||s&&!p?void 0:h,children:[Boolean(e.pid||e.outletId)&&(0,A.jsx)(Ie,{children:e.outletId?(0,A.jsx)("a",{className:(0,S.css)({textStyle:"ui.small",margin:"none",color:"text.secondary"}),href:c(e=>e.cartProduct.outletWarrantyUrl),rel:"noopener noreferrer",target:"_blank",children:c(e=>e.cartProduct.warrantyInfo)}):e.pid?(0,A.jsx)(B.vx,{"aria-haspopup":"dialog",size:"small",onClick:u,children:c(e=>e.cartProduct.warrantyInfo)}):null}),a&&e.rid&&(0,A.jsx)(ve.A,{rowId:e.rid}),Array.isArray(e.references)&&Boolean(e.references.length)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Ce,{children:c(e=>e.cartProduct.references)}),(0,A.jsx)(be.A,{children:e.references.map((e,t)=>(0,A.jsx)("li",{className:(0,S.css)({textStyle:"ui.medium",margin:"none"}),children:e.value},t))})]}),Array.isArray(i)&&Boolean(i.length)&&(0,A.jsxs)(Ae,{children:[(0,A.jsx)(Ce,{children:c(e=>e.cartProduct.trackingCode,{count:i.length})}),(0,A.jsx)(be.A,{children:i.map(e=>(0,A.jsx)("li",{children:e.url?(0,A.jsx)(ke.A,{href:e.url,children:e.code}):e.code},e.code))})]}),l&&!t&&(0,A.jsx)(B.Sc,{checked:p,className:(0,S.css)({position:"absolute",left:"2xs",top:"50%",transform:"translateY(-50%)"}),disabled:s&&!p,name:`select-${e.rid}`,title:c(p?e=>e.cartProduct.deselectProduct:e=>e.cartProduct.selectProduct,{name:e.name}),onChange:h})]})},Pe=({bundleItems:e,trackingCodes:t,waitingForTrackingCodes:s})=>{const{t:r}=(0,j.A)("order-view.ondemand"),a=(0,n.useCallback)(e=>e?.reduce((e,n)=>{const a=t?.find(e=>e.items?.find(e=>e.pid===n.pid)),i=s?.find(e=>e.pid===n.pid);return void 0!==a?e.concat({code:a.code,url:a.url}):void 0!==i?e.concat({code:r(e=>e.items.partiallyWaitingForTrackingCode)}):e},[]),[r,t,s]);return 0===e.length?null:(0,A.jsx)(A.Fragment,{children:e.map((t,s)=>
1(0,A.jsx)(Se,{hideBottomBorder:(0,je.OK)(t,s,e),product:t,trackingCodes:a(t._embedded?.items)},t.pid))})};var Ee=s(7286);const Be=(0,P.styled)(B.EY.H2,{base:{paddingBlock:"2xs",paddingInline:"none",borderBottom:"1px solid {colors.border.secondary}"}},{defaultProps:{size:"m"}}),Te=({items:e,externalWarehouses:t})=>{const{t:s}=(0,j.A)("order-view.ondemand");if(e.length){const n=null!==t[0].deliveryEstimate?(0,Ee.Yq)(t[0].deliveryEstimate,"date"):null;return(0,A.jsxs)(A.Fragment,{children:[n?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Be,{style:{borderBottom:0},children:s(e=>e.items.productsFromExternalWarehouses)}),(0,A.jsxs)(B.EY.UI,{children:[s(e=>e.items.estimatedArrival)," ",n]})]}):(0,A.jsx)(Be,{children:s(e=>e.items.productsFromExternalWarehouses)}),e.map((t,s)=>(0,A.jsx)(Se,{hideBottomBorder:(0,je.OK)(t,s,e),product:t,showDeliveryEstimate:!1},t.rid))]})}return null},Ne=(0,P.styled)(B.EY.H3,{base:{paddingBlock:"2xs",paddingInline:"none",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"border.secondary"}},{defaultProps:{size:"s"}}),Me=(0,P.styled)("ul",{base:{margin:"0",paddingBlockEnd:"2xs",borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"border.secondary"}}),De=({trackingCodes:e,items:t})=>{const{t:s}=(0,j.A)("order-view.ondemand"),r=(0,n.useMemo)(()=>{if(1===e.length)return(0,$.qM)(e[0].items,t);const s=new Set(e.flatMap(e=>e.rowIds));return t.filter(e=>s.has(e.rid))},[e,t]);return 0===r.length?null:(0,A.jsxs)("div",{children:[(0,A.jsxs)(Ne,{css:e.length>1?{borderBottomWidth:"0",borderBottomStyle:"none"}:void 0,children:[s(e=>e.items.trackingCodesHeadingLabel,{count:e.length})," ",1===e.length&&(0,A.jsx)(ke.A,{href:e[0].url,children:e[0].code})]}),e.length>1&&(0,A.jsx)(Me,{children:e.map(e=>(0,A.jsx)("li",{children:(0,A.jsx)(ke.A,{href:e.url,children:e.code})},e.code))}),r.map((e,t)=>(0,A.jsx)(Se,{hideBottomBorder:(0,je.OK)(e,t,r),product:e},e.pid))]})},$e=(0,P.styled)(B.EY.H3,{base:{paddingBlock:"2xs",paddingInline:"none",borderBottom:"1px solid {colors.border.secondary}"}},{defaultProps:{size:"s"}}),Le=({waitingForTrackingCodes:e,items:t})=>{const{t:s}=(0,j.A)("order-view.ondemand"),r=(0,n.useMemo)(()=>(0,$.qM)(e,t),[t,e]);return 0===r.length?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($e,{children:s(e=>e.items.waitingForTrackingCode)}),r.map((e,t)=>(0,A.jsx)(Se,{hideBottomBorder:(0,je.OK)(e,t,r),product:e},e.pid))]})},Re=(0,P.styled)(B.EY.H2,{base:{paddingBlock:"2xs",paddingInline:"none",borderBottom:"1px solid {colors.border.secondary}"}},{defaultProps:{size:"m"}}),Fe=({order:e})=>{const t=(0,r.d4)(R.gb),s=(0,r.d4)(R.CZ),a=(0,r.d4)(R.M2),i=(0,r.d4)(R.iX),o=(0,r.d4)(R.Xx),{t:d}=(0,j.A)("order-view.ondemand"),l=(0,n.useMemo)(()=>s.filter(e=>"softbundle"===e.type),[s]),c=(0,n.useMemo)(()=>s.filter(e=>"softbundle"!==e.type),[s]),{trackingCodes:m=[],waitingForTrackingCodes:u=[]}=e,p=(0,n.useMemo)(()=>{const t=new Map;for(const s of e.trackingCodes??[]){const e=[...s.rowIds??[]].sort((e,t)=>(e??0)-(t??0)).join(","),n=t.get(e);n?n.push(s):t.set(e,[s])}return[...t.values()]},[e]),h=(0,$.fW)(e.selectedShipmentMethodId);return t?null:m.length||u.length?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Re,{children:d(e=>e.items.products)}),(0,A.jsx)(Pe,{bundleItems:l,trackingCodes:m,waitingForTrackingCodes:u}),u&&(0,A.jsx)(Le,{items:c,waitingForTrackingCodes:u}),p.map((e,t)=>(0,A.jsx)(De,{items:c,trackingCodes:e},`${e.map(e=>e.code).join("-")}-${t}`)),(0,A.jsx)(Te,{externalWarehouses:o,items:i})]}):!h&&i.length?(0,A.jsxs)(A.Fragment,{children:[a.length?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Re,{children:d(e=>e.items.productsFromLocalWarehouses)}),a.map((e,t)=>(0,A.jsx)(Se,{hideBottomBorder:(0,je.OK)(e,t,a),product:e},e.rid))]}):null,(0,A.jsx)(Te,{externalWarehouses:o,items:i})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Re,{children:d(e=>e.items.products)}),s.map((e,t)=>(0,A.jsx)(Se,{hideBottomBorder:(0,je.OK)(e,t,s),product:e,showDeliveryEstimate:!e.serviceFor},e.rid))]})};var Xe=s(63037);s(65377);const Oe=(0,P.styled)(B.EY.UI,{base:{padding:"none"}}),We=(0,P.styled)(B.EY.H2,{base:{paddingBottom:"xs"}},{defaultProps:{size:"m"}}),ze=N["default"].div.withConfig({componentId:"sc-1hf2t6t-0"})({marginTop:E.space.XS,display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"}),Ue=({className:e})=>{const t=(0,r.d4)(R.m1),s=(0,Xe.A)(t),{t:n}=(0,j.A)("order-view.ondemand"),a=(e=>{const{orderPickSelfService:t,isServiceOrder:s,isCancelable:n,isEditable:r,selectedPaymentMethodIds:a,selectedPaymentMethodSubIds:i,selectedCustomer:o}=e??{},d=t?.status,l=Boolean(o?.isCompany);if("in-progress"===d||"scheduled"===d)return"pickupInProgress";if(s)return"serviceOrder";if(!n&&!r)return l?"notEditableOrCancelable":"notEditable";if(!r)return te.wb in a&&15===(0,$.qT)(i[te.wb])?"notEditableWalleyCredit":(0,$.bs)(a)?"notEditableWalley":"notEditable";if(!n){if(!l)return;return"notCancelable"}})(t);return t&&t.orderstate!==$.cH.Processed?!a&&t.isEditable&&s?null:(0,A.jsx)("div",{className:e,children:a?(0,A.jsx)(ze,{children:(0,A.jsx)(B.Eg,{appearance:"info",css:{maxWidth:"70%",minWidth:"280px"},children:(0,A.jsx)(B.EY.UI,{children:n(e=>e.stateNotice[a])})})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(We,{children:n(e=>e.stateNotice.forgotSomethingTitle)}),(0,A.jsx)(Oe,{children:n(e=>e.stateNotice.editDescription)})]})}):null};
1Ue.displayName="StateNotice";const Ye=(0,N["default"])(Ue).withConfig({componentId:"sc-1hf2t6t-1"})({marginLeft:E.space.XXS,marginRight:E.space.XXS}),Je=({className:e})=>{const t=(0,r.d4)(R.m1),s=(0,f.A)(y.J.tiha.orderView),i=(0,r.d4)(R.gb),{buildPathWithLanguage:d}=(0,o.A)(),l=(0,a.Zp)(),{t:m}=(0,j.A)("order-view.ondemand"),u=(0,n.useCallback)(()=>{if(t){if(!t.orderId)return;t?.orderId&&s((0,L.gX)(t?.orderId)),(0,je.jD)(t._embedded.cart.items)?l(d(c.JE.pendingOutletUuid,{orderId:t.orderId})):l(d(c.JE.editOrder,{orderId:t.orderId}))}},[s,t,l,d]),p=t?.orderstate===$.cH.Processed;if(!t||i||p)return null;const{isEditable:h}=t;return(0,A.jsxs)(B.az,{className:e,css:{paddingBlockEnd:"2xs"},children:[(0,A.jsx)(Ye,{}),(0,A.jsx)(ze,{children:(0,A.jsx)(U.A,{appearance:"secondary",disabled:!h,prefixContent:(0,A.jsx)(B.In,{iconName:"FaPencil"}),onClick:u,children:m(e=>e.actions.editOrder)})})]})};Je.displayName="OrderActions";const Ve=(0,N["default"])(Je).withConfig({componentId:"sc-fsje3q-0"})({marginTop:E.space.XS,alignSelf:"flex-end"});var qe=s(86128),He=s(22748);const Ge=N["default"].div.withConfig({componentId:"sc-tq0t6a-0"})({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",width:"100%",alignSelf:"flex-end"}),_e=(0,P.styled)("dt",{base:{textStyle:"ui.small",margin:"none",padding:"none"},variants:{bigPrice:{true:{textStyle:"ui.medium",fontWeight:"semiBold"}}}}),Ke=(0,P.styled)("dd",{base:{textStyle:"ui.small",margin:"none",paddingTop:"none",paddingRight:"none",paddingBottom:"4xs",paddingLeft:"none",textAlign:"right"},variants:{bigPrice:{true:{textStyle:"ui.medium",fontWeight:"semiBold"}},redPrice:{true:{color:"text.brand"}}}}),Qe=(e,t,s)=>{const n=t[e]?.fields.paymentMethod?.fields.name;if(n)return n;const r=Object.entries(t).find(([t])=>new RegExp(`^${e}\\|`).test(t))?.[1].fields.paymentMethod?.fields.name;if(r)return r;const a=s?.find(t=>t.id===e)?.title;return a||e},Ze=({className:e})=>{const t=(0,r.d4)(R.m1),s=(0,r.d4)(He.m),{t:n}=(0,j.A)("order-view.ondemand");if(!t)return null;const{_embedded:a,selectedPaymentMethodIds:i,selectedPaymentMethods:o,orderTotalPrice:d,selectedShipmentMethod:l,selectedVouchers:c,orderOpenPrice:m=0,customerAccountBalanceUsed:u=0}=t,p=Array.isArray(c)?c.filter($.MW).reduce((e,t)=>e+t.sum,0):0;return(0,A.jsxs)("dl",{className:e,children:[(0,A.jsxs)(Ge,{children:[(0,A.jsx)(_e,{children:n(e=>e.orderSum.totalQuantity,{count:a?.cart?.totalQuantity??0})}),(0,A.jsx)(Ke,{children:(0,qe.$g)(a?.cart?.totalPrice??"")})]}),(0,A.jsxs)(Ge,{children:[(0,A.jsx)(_e,{children:n(e=>e.orderSum.deliveryCosts)}),(0,A.jsx)(Ke,{children:(0,qe.$g)(l?.price??"")})]}),Object.entries(i).filter(([e])=>!$.Fd.includes(e)).map(([e,t])=>(0,A.jsxs)(Ge,{"data-testid":`order-sum-payment-method-${e}`,children:[(0,A.jsx)(_e,{children:n(e=>e.orderSum.paymentMethod,{name:Qe(e,s,o)})}),(0,A.jsx)(Ke,{children:(0,qe.$g)(t/100)})]},e)),(0,A.jsx)(B.cG,{appearance:"highlight",css:{marginBlock:"2xs"}}),(0,A.jsxs)(Ge,{children:[(0,A.jsx)(_e,{bigPrice:!0,children:n(e=>e.orderSum.orderTotal)}),(0,A.jsx)(Ke,{bigPrice:!0,children:(0,qe.$g)(d)})]}),p>0&&(0,A.jsxs)(Ge,{children:[(0,A.jsx)(_e,{children:n(e=>e.orderSum.giftCard)}),(0,A.jsx)(Ke,{children:(0,qe.$g)(p)})]}),u>0&&(0,A.jsxs)(Ge,{children:[(0,A.jsx)(_e,{children:n(e=>e.orderSum.customerAccountBalance)}),(0,A.jsxs)(Ke,{children:["-",(0,qe.$g)(u)]})]}),Boolean(m)&&m>0&&(0,A.jsxs)(Ge,{children:[(0,A.jsx)(_e,{bigPrice:!0,children:n(e=>e.orderSum.amountDue)}),(0,A.jsx)(Ke,{bigPrice:!0,redPrice:!0,children:(0,qe.$g)(m)})]})]})};Ze.displayName="OrderSum";const et=(0,N["default"])(Ze).withConfig({componentId:"sc-tq0t6a-1"})({display:"flex",flexDirection:"column"}),tt=N["default"].ul.withConfig({componentId:"sc-19knimc-0"})({listStyle:"none",margin:0,padding:0}),st=N["default"].h3.withConfig({componentId:"sc-rjspjc-0"})({padding:E.space.XS,margin:0,backgroundColor:E.color.background.secondary,borderBottom:`1px solid ${E.color.border.secondary}`});var nt=s(58816),rt=s(82979);const at=N["default"].span.withConfig({componentId:"sc-1r92pod-0"})({color:"black",fontWeight:600}),it=N["default"].span.withConfig({componentId:"sc-1r92pod-1"})({display:"block",color:nt.c,textDecoration:"underline",fontSize:"85%",paddingLeft:"18px"}),ot=({className:e,pickupLocationText:t,pickupAddressText:s,pickupLocationUrl:n})=>t?(0,A.jsxs)("header",{className:e,children:[(0,A.jsx)(rt.A,{color:"green"}),(0,A.jsx)(at,{children:t}),(0,A.jsx)(it,{children:(0,A.jsx)("a",{href:n,children:s})})]}):null;ot.displayName="StorePickupLocation";const dt=(0,N["default"])(ot).withConfig({componentId:"sc-1r92pod-2"})({display:"block",padding:"12px"}),lt=N["default"].div.withConfig({componentId:"sc-1w57uy8-0"})({border:`1px solid ${E.color.border.secondary}`,backgroundColor:E.color.fundaments.blues[200]}),ct=()=>{const e=(0,r.d4)(R.l7),{currentItems:t,newItems:s}=(0,r.d4)(R.TE),a=(0,r.d4)(R.wB),i=(0,r.d4)(R.gb),o=(0,f.A)(y.J.tiha.orderView),d=(0,n.useCallback)(()=>{o((0,H.aE)())},[o]),l=a.length>0;return i?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(lt,{children:[(0,A.jsxs)(st,{children:["Tuotteet - tilaus ",e]}),(0,A.jsx)(tt,{children:t.map(e=>[(0,A.jsx)(dt,{...e},`spl-1-${e.rid}`),(0,A.jsx)(Se,{isLast:t.length-a.length<=1,product:e},`cp-1-${e.rid}`)])})]}),(0,A.jsx)(fe,{children:(0,A.jsx)(U.A,{appearance:"secondary",disabled:!l,prefixContent:(0,A.jsx)(B.In,{iconName:"FaArrowDown"}),onClick:d,children:"Siirrä"})}),(0,A.jsxs)(lt,{children:[(0,A.jsx)(st,{children:"Tuotteet - uusi tilaus"}),(0,A.jsx)(tt,{children:s.map(e=>[(0,A.jsx)(dt,{...e},`spl-2-${e.rid}`),(0,A.jsx)(Se,{product:e,inNewOrder:!0},`cp-2-${e.rid}`)])})]})]}):null},mt=N["default"].div.withConfig({componentId:"sc-al1kyy-0"})({margin:`0 -${E.space.XS} -${E.space.XS} -${E.space.XS}`,padding:E.space.XS},({splittingOrder:e})=>e?{marginBottom:0,paddingBottom:0,backgroundColor:E.color.background.info}:{}),ut=({className:e})=>{const t=(0,r.d4)(R.l7),s=(0,r.d4)(R.gb),a=(0,f.A)(y.J.tiha.orderView),i=(0,r.d4)(R.m1),o=(0,n.useCallback)(()=>{a(H.DB.started(t))},[a,t]),d=(0,n.useCallback)(()=>{a((0,H.VN)())},[a]);return(0,A.jsxs)("section",{className:e,children:[(0,A.jsxs)(mt,{splittingOrder:s,children:[(0,A.jsxs)("div",{children:[(0,A.jsx)(ct,{}),i&&(0,A.jsx)(Fe,{order:i})]}),s&&(0,A.jsxs)(fe,{children:[(0,A.jsx)(U.A,{appearance:"secondary",onClick:d,children:"Peruuta"}),(0,A.jsx)(U.A,{onClick:o,children:"Vahvista jako"})]})]}),(0,A.jsx)(et,{}),(0,A.jsx)(ge.A,{tradeIn:i?.tradeIn}),(0,A.jsx)(Ve,{})]})};
1ut.displayName="CartInfo";const pt=(0,N["default"])(ut).withConfig({componentId:"sc-al1kyy-1"})({margin:"0 auto",maxWidth:"800px"}),ht=N["default"].form.withConfig({componentId:"sc-1sd18zz-0"})({display:"flex",flexDirection:"column",alignItems:"center",width:"100%"}),xt=({className:e})=>{const t=(0,r.d4)(R.l7),s=(0,r.d4)(R.NZ),a=(0,r.d4)(R.q5),i=(0,r.d4)(R.LF),o=(0,r.d4)(R.Y7),{t:d}=(0,j.A)(["order-view.ondemand","common"]),l=(0,f.A)(y.J.tiha.orderView),{register:c,reset:m,handleSubmit:u,watch:p}=(0,ce.mN)({defaultValues:{customerComment:i}}),h=p("customerComment");(0,n.useEffect)(()=>{m({customerComment:i})},[i,m]);const x=(0,n.useCallback)(()=>l((0,H.Gd)(!o.editing)),[l,o.editing]),g=(0,n.useCallback)(e=>{t&&l(H.fV.started({orderId:t,comment:e.customerComment}))},[l,t]),k=(0,n.useMemo)(()=>i?"FaPencil":o.editing?"FaMinusCircleLight":"FaPlusCircleLight",[i,o]),b=o.error?d(e=>e.comment.saveError,{ns:"order-view.ondemand"}):void 0,v=o.saving||h===i;return!t||s&&!i||!a&&!i?null:(0,A.jsx)(B.M6,{className:e,headerSlot:a?(0,A.jsx)(B.vx,{css:{whiteSpace:"nowrap"},prefixContent:(0,A.jsx)(B.In,{iconName:k,size:"xs"}),underlined:!1,onClick:x,children:d(i?e=>e.comment.edit:e=>e.comment.add,{ns:"order-view.ondemand"})}):void 0,title:d(e=>e.comment.title,{ns:"order-view.ondemand"}),compact:!0,children:a&&o.editing?(0,A.jsxs)(ht,{onSubmit:u(g),children:[(0,A.jsx)(B.fs,{...c("customerComment"),css:{width:"100%",marginBottom:"2xs"},errorMsg:b,id:"customerComment",label:d(e=>e.comment.label,{ns:"order-view.ondemand"}),autoFocus:!0,hideLabel:!0}),(0,A.jsxs)("div",{children:[(0,A.jsx)(U.A,{appearance:"secondary",css:{marginTop:"2xs",marginInline:"3xs"},onClick:x,children:d(e=>e.cancel,{ns:"common"})}),(0,A.jsx)(U.A,{css:{marginTop:"2xs",marginInline:"3xs"},disabled:v,type:"submit",children:d(e=>e.save,{ns:"common"})})]})]}):i?(0,A.jsx)(B.EY.UI,{children:i}):(0,A.jsx)("em",{className:(0,S.css)({textStyle:"ui.medium",margin:"none",color:"text.secondary"}),children:d(e=>e.comment.empty,{ns:"order-view.ondemand"})})})};xt.displayName="Comment";const gt=(0,N["default"])(xt).withConfig({componentId:"sc-1sd18zz-1"})({}),ft=(0,P.styled)(B.EY.H3,{base:{paddingTop:"0",marginBottom:"3xs"}},{defaultProps:{size:"xs"}}),jt=({className:e})=>{const{t}=(0,j.A)("orders");return(0,A.jsxs)("div",{className:e,children:[(0,A.jsx)(ft,{children:t(e=>e.customerServiceInfo.title)}),(0,A.jsxs)(ke.A,{confirmation:!1,href:t(e=>e.customerServiceInfo.linkHref),children:[(0,A.jsx)(B.In,{css:{marginRight:"4xs"},iconName:"FaUserLight",size:"xs",isInline:!0}),(0,A.jsx)(B.EY.UI,{children:t(e=>e.customerServiceInfo.linkText)})]})]})};jt.displayName="CustomerServiceInfo";const yt=(0,N["default"])(jt).withConfig({componentId:"sc-272vom-0"})({});var kt=s(60595);const bt=()=>{const{t:e}=(0,j.A)("order-view.ondemand"),t=(0,f.A)(),s=(0,n.useCallback)(()=>{t((0,L.so)())},[t]);return(0,A.jsx)("div",{className:(0,S.css)({float:"right",marginTop:"xs",textAlign:"right"}),children:(0,A.jsx)(kt.A,{appearance:"secondary",href:e(e=>e.cancelOrderUrl),postfixContent:(0,A.jsx)(B.In,{iconName:"FaExternalLink"}),target:"_blank",onClick:s,children:e(e=>e.cancelOrder)})})};bt.displayName="FallbackCancelButton";const vt=bt;var wt=s(40912);const It=({className:e,order:t,isConfirmedPage:s})=>{const{t:r}=(0,j.A)("orders"),a=(0,wt.A)(),i=(0,n.useMemo)(()=>{if((0,$.fW)(t?.selectedShipmentMethodId)&&"ready"===t?.orderPickSelfService?.status){const e=(0,$.Eg)(t?.orderPickSelfService?.status);return a(e)}return s?r(e=>e.heading.orderReceived):r(e=>e.heading.orderIdTitle,{orderId:t?.orderId??""})},[t?.selectedShipmentMethodId,t?.orderPickSelfService?.status,t?.orderId,s,r,a]);return(0,A.jsx)(B.EY.H1,{className:e,size:s?"l":void 0,children:i})};It.displayName="Heading";const At=(0,N["default"])(It).withConfig({componentId:"sc-7vbl9f-0"})({});var Ct=s(76492);const St=e=>{const t=(0,r.d4)(R.cm),s=(0,r.d4)(R.Kv);return(0,n.useMemo)(()=>Boolean(e?.isReady&&e?.orderPickSelfService?.available&&(t||s)&&!(0,$.bm)(e)&&!(0,$.lW)(e?.orderstate)),[e,t,s])};var Pt=s(21799),Et=s(86861),Bt=s(50263),Tt=s(79530),Nt=s(71002),Mt=s(27189);const Dt=(e,t)=>
1{const s=(0,n.useRef)(Mt.zG);(0,n.useEffect)(()=>{s.current=e},[e]),(0,n.useEffect)(()=>{const e=setInterval(()=>s.current(),t);return()=>clearInterval(e)},[t])},$t=({pickup:e,setDay:t})=>{const s=(0,r.d4)(R.e4),a=(0,r.d4)(X.md),{t:i}=(0,j.A)("order-view.ondemand"),o=(0,n.useMemo)(()=>Object.keys(s).map(e=>({value:e,label:(0,Ee.Ur)(e,(0,l.MI)(a)),disabled:!s[e].earliest||!s[e].latest})),[s,a]),d=(0,n.useMemo)(()=>e?(0,Ee.d$)(e):"",[e]),c=(0,n.useCallback)(n=>{const[r,a,i]=n.target.value.split("-").map(Number),{earliest:o,latest:d}=s[n.target.value],l=(0,Ee.YZ)(o),c=(0,Ee.YZ)(d),m=(0,Ee.qE)(e.set({year:r,month:a,day:i}),l,c);t(m,l,c)},[s,e,t]);return(0,A.jsx)(B.l6,{"aria-label":i(e=>e.remoteGather.selectPickupDay),id:"pickup_day",name:"pickup-day",value:d,onChange:c,children:o.map(({value:e,label:t,disabled:s})=>(0,A.jsx)("option",{disabled:s,value:e,children:t},e))})};var Lt=s(90377);const Rt=(e,t)=>{const[s,r]=(0,n.useState)(!1),a=(0,n.useRef)(void 0);(0,n.useEffect)(()=>(s?a.current=window.setTimeout(e,t):clearTimeout(a.current),()=>clearTimeout(a.current)),[e,t,s]);const i=(0,n.useCallback)(t=>{t.preventDefault(),e()},[e]),o=(0,n.useCallback)(e=>{e.stopPropagation(),r(!0)},[]),d=(0,n.useCallback)(e=>{e.stopPropagation(),r(!1)},[]);return{onClick:i,onMouseDown:o,onTouchStart:o,onMouseUp:d,onMouseLeave:d,onTouchEnd:d}};var Ft=s(98148);const Xt=N["default"].button.withConfig({componentId:"sc-1tm2uco-0"})({...Lt.nD,":disabled":{color:E.color.text.disabled,cursor:"default"}},({large:e})=>e&&{padding:E.space.XS}),Ot=(0,N["default"])(B.pd).withConfig({componentId:"sc-1tm2uco-1"})({width:E.size.L,input:{textAlign:"center"}}),Wt=({atMax:e,atMin:t,name:s="",shouldRound:r,step:a=1,title:i,value:o,setValue:d,className:l})=>{const{t:c}=(0,j.A)("order-view.ondemand"),[m,u]=(0,n.useState)((0,V.pj)(o)),p=(0,n.useCallback)((e=0)=>d(r?(0,V.sl)(e):e),[d,r]),[h]=(0,Ft.A)(p,1e3);(0,n.useEffect)(()=>{u((0,V.pj)(o))},[o]);const x=(0,n.useCallback)(()=>{d(o+a)},[d,a,o]),g=(0,n.useCallback)(()=>{d(o-a)},[d,a,o]),f=(0,n.useCallback)(s=>{"ArrowUp"!==s.key&&"ArrowDown"!==s.key||(s.preventDefault(),"ArrowUp"!==s.key||e?"ArrowDown"!==s.key||t||g():x())},[x,e,t,g]),y=Rt(x,200),k=Rt(g,200),b=(0,n.useCallback)(({target:e})=>{/^\d{0,2}$/.test(e?.value)&&(u(e.value),h((0,V.YR)(e.value)))},[h]),v=(0,n.useCallback)(()=>{const s=""===m?0:Number.parseInt(m,10);isNaN(s)||e&&s>o||t&&s<o?u(`${o}`):p(s)},[e,t,m,p,o]);return(0,A.jsxs)("div",{className:l,children:[(0,A.jsx)(Xt,{disabled:e,title:c(e=>e.remoteGather.increaseValue,{title:i}),large:!0,...y,children:(0,A.jsx)(B.In,{iconName:"FaChevronUp"})}),(0,A.jsx)(Ot,{"aria-label":i,id:s,inputMode:"numeric",label:i,name:s,pattern:"[0-9]{0,2}",size:"L",type:"text",value:m,hideLabel:!0,onBlur:v,onChange:b,onKeyDown:f}),(0,A.jsx)(Xt,{disabled:t,title:c(e=>e.remoteGather.decreaseValue,{title:i}),large:!0,...k,children:(0,A.jsx)(B.In,{iconName:"FaChevronDown"})})]})},zt=(0,N["default"])(Wt).withConfig({componentId:"sc-1tm2uco-2"})({alignItems:"center",display:"flex",flexDirection:"column","&:last-child":{marginRight:E.space.M}}),Ut=N["default"].div.withConfig({componentId:"sc-1g2h0w3-0"})({alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"center"}),Yt=(0,P.styled)(B.EY.UI,{base:{paddingInline:"2xs",paddingBlock:"none"}}),Jt=(0,P.styled)(B.EY.UI,{base:{paddingInline:"2xs",paddingBlock:"none",fontSize:"2xs",lineHeight:"relaxed"}},{defaultProps:{weight:"semiBold"}}),Vt=({pickup:e,earliest:t,latest:s,setPickup:r})=>{const{t:a}=(0,j.A)("order-view.ondemand"),{t:i}=(0,j.A)(),o=(0,n.useMemo)(()=>e.hasSame(s,"minute"),[s,e]),d=(0,n.useMemo)(()=>e.hasSame(t,"minute"),[t,e]),l=(0,n.useMemo)(()=>e.hour,[e]),c=(0,n.useMemo)(()=>e.minute,[e]),m=(0,n.useCallback)(e=>{r((0,Ee.qE)(e,t,s))},[t,s,r]),u=(0,n.useCallback)(t=>{m(e.set({hour:t}))},[m,e]),p=(0,n.useCallback)(t=>{m(e.set({minute:t}))},[m,e]),h=(0,n.useCallback)(e=>{e.preventDefault()},[]);return(0,A.jsxs)(Ut,{onContextMenu:h,children:[(0,A.jsx)(Yt,{children:i(e=>e.timePrefix)}),(0,A.jsx)(zt,{atMax:o,atMin:d,name:"hour",setValue:u,title:a(e=>e.remoteGather.hours),value:l}),(0,A.jsx)(Jt,{children:":"}),(0,A.jsx)(zt,{atMax:o,atMin:d,name:"minute",setValue:p,step:5,title:a(e=>e.remoteGather.minutes),value:c,shouldRound:!0})]})},qt=N["default"].div.withConfig({componentId:"sc-3wh869-0"})({display:"flex",flexDirection:"column",marginTop:E.space.XS}),Ht=(0,P.styled)(B.EY.UI,{base:{marginTop:"4xs",color:"text.secondary"}},{defaultProps:{size:"small"}}),Gt=N["default"].div.withConfig({componentId:"sc-3wh869-1"})({display:"flex",justifyContent:"center"}),_t=({pickup:e,setPickup:t,className:s,description:a,onRemoteGatherClick:i})=>{const o=(0,r.d4)(R.e4),d=(0,r.d4)(R.sF),{t:l}
1=(0,j.A)("order-view.ondemand"),[c,m]=(0,n.useState)(null),[u,p]=(0,n.useState)(null),[h,x]=(0,n.useState)(null),g=(0,n.useMemo)(()=>e?(0,Ee.og)(e):null,[e]);(0,n.useEffect)(()=>{if(Object.keys(o).length>0&&(!g||!c&&!u)){const{earliest:e,latest:s}=g?o[(0,Ee.d$)(g)]:Object.values(o).find(({earliest:e,latest:t})=>e&&t)??{};if(!e||!s)return;const n=(0,Ee.og)(e),r=(0,Ee.og)(s);m(n),p(r),(!g||g<n)&&t(n)}},[o,c,u,g,t]),(0,n.useEffect)(()=>{if(e){const s=o?.[(0,Ee.d$)(e)]??{},n=s.earliest?(0,Ee.og)(s.earliest):null,r=s.latest?(0,Ee.og)(s.latest):null;n&&c&&n!==c&&(m(n),t((0,Ee.qE)(e,n,r)))}},[o]),(0,n.useEffect)(()=>{if(!d||!g)return;const e=d.filter(e=>g>(0,Ee.og)(e.starts)&&g<(0,Ee.og)(e.ends)||g===(0,Ee.og)(e.starts)||g===(0,Ee.og)(e.ends));x(e?.[0]??null)},[g,d]);const f=(0,n.useCallback)((e,s,n)=>{t(e),m(s),p(n)},[t]);return e?(0,A.jsxs)("div",{className:s,children:[h?(0,A.jsxs)(B.Eg,{css:{marginTop:"xs"},children:[h.title&&(0,A.jsx)(B.Eg.Title,{children:h.title}),h.bodyText&&(0,A.jsx)(B.Eg.Paragraph,{children:h.bodyText})]}):null,(0,A.jsxs)(Gt,{children:[a?(0,A.jsxs)(qt,{children:[(0,A.jsx)($t,{pickup:e,setDay:f}),(0,A.jsx)(Ht,{children:a})]}):(0,A.jsx)($t,{pickup:e,setDay:f}),c&&u&&(0,A.jsx)(Vt,{earliest:c,latest:u,pickup:e,setPickup:t}),(0,A.jsx)(U.A,{appearance:"primary",prefixContent:(0,A.jsx)(B.In,{iconName:"FaCalendarAlt",size:"xs"}),size:"L",onClick:i,children:l(e=>e.remoteGather.confirmPickupTime)})]})]}):null},Kt=(0,N["default"])(_t).withConfig({componentId:"sc-3wh869-2"})({display:"flex",justifyContent:"center",flexDirection:"column",[z.breakpoint.min.S]:{alignItems:"center"},[Gt]:{flexDirection:"column",marginBottom:E.space.XXS,marginTop:E.space.XXS,width:"auto",[z.breakpoint.min.S]:{alignItems:"center",flexDirection:"row"}}}),Qt=(0,P.styled)("p",{base:{textStyle:"ui.medium",margin:"none",marginTop:"xs",display:"block"}}),Zt=5*60*1e3,es=(0,P.styled)(U.A,{base:{marginTop:"xs"}}),ts=({className:e,order:t})=>{const s=(0,a.zy)(),i=(0,r.d4)(R.FK),o=(0,r.d4)(R.b0),d=(0,r.d4)(R.rF),c=(0,r.d4)(R.Pl),m=(0,r.d4)(X.md),{t:u}=(0,j.A)("order-view.ondemand"),p=(0,f.A)(y.J.tiha.orderView),h=(0,n.useMemo)(()=>i||d,[d,i]),x=(0,n.useMemo)(()=>t?.orderPickSelfService?.pickUpAt?(0,Ee.og)(t.orderPickSelfService.pickUpAt):null,[t]),[g,k]=(0,n.useState)(null),b=Boolean(t?.isReady)&&Boolean(t?.orderPickSelfService?.modifiable);(0,n.useEffect)(()=>{k(x)},[x]);const v=(0,n.useCallback)(()=>{p((0,H.fK)()),p(H.Wz.started({orderId:t.orderId}))},[p,t]);(0,n.useEffect)(()=>{h||c[0]||o||!b||v()},[b,o,h,c,v]),Dt(()=>{b&&p(H.Wz.started({orderId:t.orderId,skipLoading:!0}))},Zt);const w=s.pathname.includes("/confirmed")?y.J.checkoutContextByStep.confirmed:y.J.checkout.orderPage,I=(0,n.useCallback)(()=>{const e=g?g.toISO():null;e&&p(H.uJ.started({previousPickUpTime:t?.orderPickSelfService?.pickUpAt,orderId:t.orderId,pickUpTime:e,location:c[0],gatherStartLocation:w}))},[p,t,g,c,w]),C=(0,n.useCallback)(()=>{p(H.r$.started(t.orderId)),v()},[p,t.orderId,v]),S=(0,n.useMemo)(()=>(0,A.jsx)(A.Fragment,{children:(0,A.jsx)("span",{children:u(i?e=>e.remoteGather.confirmingTitle:o?e=>e.remoteGather.errorTitle:d?e=>e.remoteGather.loadingTitle:e=>e.remoteGather.pickupTimeQuestion)})}),[o,d,i,u]),P=(0,n.useMemo)(()=>{const e=(0,$.BS)(t);return e?u(e=>e.remoteGather.lastPickupDate,{date:(0,Ee.Ur)(e,(0,l.MI)(m)).toLowerCase()}):null},[t,u,m]);return(0,A.jsxs)("div",{className:e,children:[(0,A.jsx)(B.EY.H2,{size:"xs",children:S}),h?(0,A.jsx)(_.A,{}):o?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Qt,{children:o===$.yd?u(e=>e.remoteGather.timeNotAvailableError):u(e=>e.remoteGather.unexpectedError)}),(0,A.jsx)(es,{onClick:C,children:u(e=>e.remoteGather.retry)})]}):b?(0,A.jsx)(Kt,{description:P,pickup:g,setPickup:k,onRemoteGatherClick:I}):null]})},ss=(0,N["default"])(ts).withConfig({componentId:"sc-wf4xr-0"})({width:"100%",marginBottom:E.space.XXS}),ns=({className:e,orderId:t})=>{const{t:s}=(0,j.A)("order-view.ondemand");return(0,A.jsxs)(B.az,{appearance:"primary",className:e,children:[(0,A.jsx)(B.EY.UI,{css:{marginBottom:"2xs"},size:"small",children:s(e=>e.pickupBarcode.speedUpPickup)}),(0,A.jsx)(oe.A,{height:50,titleText:s(e=>e.pickupBarcode.barcodeTitle),value:`TIL${t}`,width:260})]})};ns.displayName="PickupBarcode";const rs=(0,N["default"])(ns).withConfig({componentId:"sc-h9h0jz-0"})({display:"flex",flexDirection:"column",alignItems:"center",padding:E.space.XXS,width:"321px"});var as=s(83452),is=s(33995),os=s(26960),ds=s(82226),ls=s(41366),cs=s(26807);const ms=({order:{orderId:e,orderstate:t,isInvoicePdfAvailable:s,offerId:a,isServiceOrder:i=!1,_embedded:d}})=>{const{buildPathWithLanguage:l}=(0,o.A)(),m=(0,r.d4)(R.Zk),u=(0,r.d4)(ls.Wx),p=(0,r.d4)((0,ds.Ll)(d?.cart?.items)),{t:h}=(0,j.A)("order-view.ondemand"),x=(0,f.A)(),g=!i&&!d?.cart?.items.some(e=>Boolean(e.outletId))&&p,y=(0,n.useCallback)(()=>{x((0,L.Hf)()),x((0,cs.nx)({eventName:as.QE})),x(H.O8.started())},[x]),k=(0,n.useCallback)(()=>{x((0,cs.nx)({eventName:as.Dc}))},[x]);return(0,A.jsxs)(A.Fragment,{children:[g&&(0,A.jsx)(U.A,{appearance:"secondary",onClick:y,children:m?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(B.y$,{})," ",h(e=>e.processedActions.pleaseWait)]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(B.In,{iconName:"FaShoppingBasketSolid"})," ",h(e=>e.processedActions.reorder)]})}),(0,A.jsx)(Et.A,{...(0,is.Px)({orderId:`${e}`,orderstate:`${t}`}),title:h(e=>e.processedActions.downloadReceipt),onClick:k}),s&&(0,A.jsx)(Et.A,{...(0,is.ch)({orderId:`${e}`}),title:h(e=>t===$.cH.Processed?e.processedActions.downloadInvoice:e.processedActions.downloadProformaInvoice)}),u&&(0,A.jsx)(Et.A,{...(0,is.Ls)({orderId:`${e}`,orderstate:`${t}`}),loadingTitle:h(e=>e.processedActions.downloadCustomsReceipt),title:h(e=>e.processedActions.downloadCustomsReceipt)}),(0,os.zz)(a)&&(0,A.jsx)(O.A,{to:l(c.Y.offers.viewOffer,{offerId:a}),children:h(e=>e.processedActions.viewOffer)})]})},us=({className:e,order:t})=>{const{orderId:s,isReady:a,orderPickSelfService:i,orderstate:o,isBackorderPossible:d,isBackorderRequested:l,selectedShipmentMethodId:c,locker:m}=t,u=(0,r.d4)(R.NZ),p=(0,r.d4)(R.rg),h=(0,r.d4)(R.Kv),{t:x}
1=(0,j.A)("order-view.ondemand"),[g,k]=(0,n.useState)(!1),v=(0,n.useMemo)(()=>a&&(0,Bt.hD)(i)&&!u,[a,i,u]),w=(0,n.useMemo)(()=>a&&(0,Bt.mC)(i)&&!u,[a,i,u]),I=(0,r.d4)(R.eH),C=(0,n.useMemo)(()=>(0,$.El)(c,o),[c,o]),S=(0,n.useMemo)(()=>(0,$.G9)(t),[t]),P=(0,n.useMemo)(()=>d&&!S&&!l,[d,S,l]),E=(0,n.useMemo)(()=>u||v||w||I||C||o===$.cH.Processed||S||P,[u,v,w,I,C,o,S,P]),T=(0,f.A)(),N=(0,n.useCallback)(()=>{s&&(T((0,L.GC)("Edit Started")),T((0,H.hv)()))},[T,s]),M=(0,n.useCallback)(()=>{T((0,H.Tr)())},[T]),D=(0,n.useCallback)(()=>{T((0,H._P)())},[T]),F=(0,n.useCallback)(e=>{e.preventDefault(),s&&(T((0,L.ET)({trackingContext:y.J.tiha.orderView,orderId:s})),T(b.EW.started({orderId:s})),k(!0))},[T,s]);if(!E)return null;const X=(0,$.X2)(t.orderstate),O=(0,$.lW)(t.orderstate),W=g||O&&!p,z=v||w&&h;return(0,A.jsxs)("div",{className:e,children:[u&&(0,A.jsx)(U.A,{disabled:W,onClick:F,children:x(X?e=>e.actions.proceedToIdentification:e=>e.actions.payOrder)}),z?(0,A.jsx)(ss,{order:t}):w?(0,A.jsx)(U.A,{appearance:"secondary",prefixContent:(0,A.jsx)(B.In,{iconName:"FaPencil",size:"xs"}),onClick:N,children:x(e=>e.actions.editPickupTime)}):null,I&&s&&(0,A.jsx)(rs,{orderId:s}),C&&m&&s&&(0,A.jsx)(Tt.A,{locker:m,orderId:s}),o===$.cH.Processed&&(0,A.jsx)(ms,{order:t}),(S||P)&&(0,A.jsx)(U.A,{appearance:"secondary",onClick:S?M:D,children:x(e=>e.actions.splitOrder)}),g&&(0,A.jsx)(Nt.A,{redirectingToPayment:!X,redirectingToStrongAuth:X})]})};us.displayName="Actions";const ps=(0,N["default"])(us).withConfig({componentId:"sc-1c8lnrn-0"})({display:"flex",flexWrap:"wrap",gap:E.space.XS},({remoteGatherInterfaceOpen:e})=>!e&&{flexDirection:"row",alignItems:"center",justifyContent:"center"}),hs=()=>{const{t:e}=(0,j.A)("order-view.ondemand");return(0,A.jsx)(B.EY.UI,{children:e(e=>e.identificationInfo.identificationRequired)})};var xs=s(87617),gs=s(60936);const fs=(0,P.styled)(B.EY.H3,{base:{margin:"none"}},{defaultProps:{size:"xs"}}),js=(0,P.styled)(B.s7,{base:{"& p":{lineHeight:"normal",marginTop:"2xs"}}}),ys=({order:e})=>{const{selectedShipmentMethodId:t,selectedPaymentMethodSubIds:s,orderPickSelfService:a,orderstate:i,selectedTimeSlot:o}=e??{},d=(0,r.d4)(X.md),c=(0,$.fW)(t),m=(0,$.u1)(t),u=(0,$.Th)(t),p=(0,$.dY)(t),h=(0,$.ci)(t),x=i===$.$k,g=(0,$.gX)(i),f=(0,$.MX)(s,i),y=(0,$.tK)(e),[k]=(0,xs.A)("whatNext"),{t:b}=(0,j.A)("order-view.ondemand"),{t:v}=(0,j.A)(),w=v(e=>e.timePrefix),I=(0,n.useMemo)(()=>o?(0,$.$2)(o,(0,l.MI)(d),`${w} `):b(e=>e.nextInfo.atAgreedTime),[o,b,d,w]),C=(0,n.useMemo)(()=>f?k.pendingWalleyCreditDecision:g?k.waitingForLeasingDecision:u?k.digitalDelivery:p?k.woltDelivery:h?k.woltParcelDelivery:o?k.deliveryTimeSlotSelected:x?c?y?k.processingPickupForAccountOwner:k.processingPickupForRecipient:m?y?k.processingDeliveryToAccountOwner:k.processingDeliveryToRecipient:y?k.processingDeliveryNearbyForAccountOwner:k.processingDeliveryNearbyForRecipient:c?"ready"===a?.status?k.pendingPickupStart:"finished"===a?.status?k.pendingPickup:y?k.pickupStartedForAccountOwner:k.pickupStartedForRecipient:y?k.pendingDispatchForAccountOwner:k.pendingDispatchForRecipient,[k,m,u,c,x,y,f,p,h,a?.status,o,g]),S=(0,n.useMemo)(()=>((e,t)=>e?Object.entries(t).reduce((e,[t,s])=>null==s?e:e.replace(t,s),e):void 0)(C,{"%timeslot%":I}),[C,I]);return S?(0,A.jsxs)("div",{children:[(0,A.jsx)(fs,{children:k.title}),(0,A.jsx)(gs.A,{text:S,wrapper:js,small:!0})]}):null};var ks=s(88036),bs=s(17875),vs=s(32490);const ws=(0,P.styled)("p",{base:{textStyle:"ui.small",margin:"none",marginTop:"2xs",marginInline:"2xs"}}),Is=N["default"].dl.withConfig({componentId:"sc-17v3s37-0"})({margin:0,display:"flex",flexDirection:"column"}),As=(0,P.styled)("dt",{base:{textStyle:"ui.small",margin:"none"}}),Cs=(0,P.styled)("dd",{base:{textStyle:"ui.medium",fontWeight:"semiBold",margin:"none"}}),Ss="order-description-pickup-info",Ps=({order:e})=>{const{t}=(0,j.A)("order-view.ondemand"),s=(0,$.sL)(e),{selectedShipmentMethodId:n,selectedPaymentMethodIds:r,orderPickSelfService:a}=e,i=(0,se.Kk)(n),o=(0,$.E4)(n),d=(0,bs.A)(n||void 0);return(0,A.jsxs)("div",{children:[(0,A.jsxs)(Is,{children:[(0,A.jsx)(As,{id:Ss,children:t(a?.destination?e=>e.pickupInfo.pickupLocation:e=>e.pickupInfo.deliveryMethod)}),(0,A.jsx)(Cs,{"aria-labelledby":Ss,children:(0,se.mk)(d,"long")})]}),(0,A.jsxs)(B.EY.UI,{children:[i?.streetAddressLine1,", ",i?.postalCode," ",i?.addressLocality]}),!o&&(0,A.jsx)(A.Fragment,{children:(0,$.M1)(r)&&s.length?(0,A.jsx)(B.Eg,{appearance:"alert",css:{marginTop:"2xs"},children:(0,A.jsx)(T.x6,{components:{ExternalLink:(0,A.jsx)(ke.A,{confirmation:!1,href:t(e=>e.identificationText.identificationUrl)}),Icon:(0,A.jsx)(B.In,{iconName:"FaChevronRightSolid",size:"2xs"})},i18nKey:e=>e.pickupInfo.identityCheck,t})}):(0,A.jsx)(ws,{children:(0,A.jsx)(vs.A,{order:e})})})]})},Es=(0,P.styled)(B.EY.H3,{base:{margin:"none"}},{defaultProps:{size:"xs"}}
1),Bs=(0,P.styled)("p",{base:{textStyle:"ui.medium",margin:"none",marginTop:"2xs"}}),Ts=({order:e})=>{const{t}=(0,j.A)("order-view.ondemand"),s=(0,$.fW)(e.selectedShipmentMethodId),n=(0,$.ES)(e.selectedPaymentMethodIds),r=(0,$.q3)(e.selectedPaymentMethodIds),a=(0,$.Lk)(e.selectedPaymentMethodIds),i=(e.selectedVouchers?.length??0)>0;return(0,A.jsxs)("div",{children:[(0,A.jsx)(Es,{children:t(e=>e.splitInfo.title)}),(0,$.G9)(e)?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Bs,{children:t(e=>e.splitInfo.splitPossible)}),!s&&n&&(0,A.jsx)(Bs,{children:t(e=>e.splitInfo.billPaymentDeliveryFee)}),!s&&r&&(0,A.jsx)(Bs,{children:t(e=>e.splitInfo.ePaymentDeliveryFee)}),!s&&a&&(0,A.jsx)(Bs,{children:t(e=>e.splitInfo.cardPaymentDeliveryFee)}),!s&&i&&(0,A.jsx)(Bs,{children:t(e=>e.splitInfo.voucherPaymentDeliveryFee)})]}):(0,A.jsx)(Bs,{children:t(e=>e.splitInfo.backorderOnly)})]})};var Ns=s(54328);const Ms=N["default"].div.withConfig({componentId:"sc-1cjh0ul-0"})({marginTop:E.space.XXS}),Ds=({lastPickupDate:e})=>{const{t}=(0,j.A)("order-view.ondemand");return(0,A.jsxs)(Ms,{children:[(0,A.jsx)(B.EY.UI,{children:t(e=>e.storeLockerInfo.availableForTwoDays)}),e&&(0,A.jsx)(B.EY.UI,{weight:"semiBold",children:(0,A.jsx)(T.x6,{components:{FormattedDate:(0,A.jsx)(Ns.A,{date:e,type:"weekday"})},i18nKey:e=>e.storeLockerInfo.lastPickupDate,t})})]})},$s=({className:e,order:t})=>{const{selectedShipmentMethodId:s,selectedPaymentMethodSubIds:r,orderStatus:a,orderstate:i,isBackorderRequested:o,isBackorderPossible:d,lastPickupDate:l,orderProcessedAt:c,orderPickSelfService:m,_embedded:{cart:u}}=t,p=(0,n.useMemo)(()=>a===$.lX,[a]),h=(0,n.useMemo)(()=>!p&&!o&&d,[p,o,d]),x=(0,$.gX)(i),g=(0,$.MX)(r,i),f=(0,n.useMemo)(()=>(0,$.fW)(s),[s]),j=(0,n.useMemo)(()=>(0,$.gX)(i)||!p&&!h&&a?.startsWith("pending")||!c&&m?.pickUpAt,[i,p,h,a,c,m?.pickUpAt]),y=(0,n.useMemo)(()=>!p&&!h&&!x&&!g&&i!==$.cH.Processed&&f,[p,h,x,g,i,f]),k=(0,n.useMemo)(()=>(0,$.El)(s,i),[s,i]),b=(0,$.X2)(i);return(0,A.jsxs)("div",{className:e,children:[p&&(0,A.jsx)(ks.A,{cartItems:u.items}),h&&(0,A.jsx)(Ts,{order:t}),y&&(0,A.jsx)(Ps,{order:t}),j&&(0,A.jsx)(ys,{order:t}),k&&(0,A.jsx)(Ds,{lastPickupDate:l}),b&&(0,A.jsx)(hs,{})]})};$s.displayName="Description";const Ls=(0,N["default"])($s).withConfig({componentId:"sc-hll3u8-0"})({display:"flex",flexDirection:"column",gap:E.space.XS});var Rs=s(51585);const Fs=(0,P.styled)("dt",{base:{textStyle:"ui.small",margin:"none"}}),Xs=(0,P.styled)("dd",{base:{textStyle:"ui.medium",margin:"none",marginTop:"2xs"},variants:{weight:{semiBold:{fontWeight:"semiBold"},regular:{}}}}),Os=({className:e,term:t,definition:s,dateType:n,capitalize:r,bold:a})=>{const i=`order-information-chunk-${t.toLowerCase().replaceAll(" ","_").replace(/ä/gi,"a").replace(/ö/gi,"o")}`,o=s instanceof Date?s.toISOString():s;return(0,A.jsxs)("dl",{className:e,children:[(0,A.jsx)(Fs,{id:i,children:t}),(0,A.jsx)(Xs,{"aria-labelledby":i,weight:a?"semiBold":"regular",children:n?(0,A.jsx)(Ns.A,{capitalize:r,date:s,type:n}):o})]})};Os.displayName="Chunk";const Ws=(0,N["default"])(Os).withConfig({componentId:"sc-1p7degt-0"})({display:"flex",flexDirection:"column",margin:0}),zs=({className:e,order:t})=>{const{t:s}=(0,j.A)("order-view.ondemand"),{orderstate:a,billingDueDate:i,selectedPaymentMethodIds:o,isBillingStatusOk:d,orderPickSelfService:l,selectedShipmentMethodId:c,selectedCustomerAddress:m,customerName:u,orderStatus:p,orderCreatedAt:h,selectedShipmentMethod:x,orderProcessedAt:g,locker:f,killDate:y}=t,k=(0,r.d4)(Rs.J0),b=(0,Ct.A)(t),v=(0,n.useMemo)(()=>Boolean(y)&&[$.ay,$.vA].includes(a??""),[a,y]),w=(0,n.useMemo)(()=>a===$.cH.Processed&&Boolean(i)&&"lasku"in o&&!d,[a,i,o,d]),I=(0,$.BS)(t),C=(0,$.fW)(c),S=(0,n.useMemo)(()=>Boolean(p)&&Boolean(p?.startsWith("pending"))&&a!==$.$k,[p,a]),P=(0,n.useMemo)(()=>!S&&a!==$.cH.Processed&&!k&&C&&b?.length>0,[S,a,k,C,b]),E=(0,n.useMemo)(()=>!C&&!S&&p!==$.lX,[C,S,p]),B=(0,n.useMemo)(()=>{const e=(0,$.dc)(c,f);return C&&!e&&a===$.cH.Processed&&Boolean(g)},[c,f,C,a,g]);return(0,A.jsxs)("div",{className:e,children:[(0,A.jsx)(Ws,{dateType:"short",definition:h??"",term:s(e=>e.information.orderCreated)}),v&&(0,A.jsx)(Ws,{dateType:"date",definition:y??"",term:s(e=>e.information.lastPaymentDate)}),w&&(0,A.jsx)(Ws,{dateType:"date",definition:i??"",term:s(e=>e.information.billDueDate),bold:!0}),I&&(0,A.jsx)(Ws,{dateType:"date",definition:I,term:s(e=>e.information.lastPickupDate),bold:!0}),P&&(0,A.jsx)(Ws,{definition:b,term:s(e=>e.information.pickupPerson)}),l?.pickUpAt&&(0,A.jsx)(Ws,{dateType:"verbose",definition:l.pickUpAt,term:s(e=>e.information.pickupTime),capitalize:!0}),E&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Ws,{definition:m?.name??u,term:s(e=>e.information.recipient),bold:!0}),x?.title&&(0,A.jsx)(Ws,{definition:x.title,term:s(e=>e.information.deliveryMethod)})]}),B&&(0,A.jsx)(Ws,{dateType:"short",definition:`${g??""}`,term:s(e=>e.information.orderPickedUp)})]})};zs.displayName="Information";const Us=(0,N["default"])(zs).withConfig({componentId:"sc-s1k0mw-0"})({display:"flex",flexDirection:"row",flexWrap:"wrap",flexShrink:0,minWidth:"160px",gap:E.space.XS,[z.breakpoint.min.S]:{maxWidth:`calc(270px + ${E.space.XS} * 2)`},margin:"0",[`> ${Ws}`]:{width:"135px"}}),Ys=({className:e,rmaDays:t,asColumn:s})=>{const{t:r}=(0,j.A)("order-view.ondemand"),a=(0,f.A)(),i=(0,S.cx)((0,S.css)({alignItems:{smDown:"flex-end"},flexDirection:{smDown:"row"}}),s?(0,S.css)({alignItems:"center",flexDirection:"column"}):(0,S.css)({alignItems:"flex-start",flexDirection:"row"}),e),o=(0,n.useCallback)(()=>{a((0,L.so)())},[a]);return(0,A.jsxs)(B.ob,{align:"space-between",className:i,gap:"xs",children:[(0,A.jsxs)(B.aP,{alignInline:"start",ga
1p:"2xs",children:[(0,A.jsx)("dt",{className:(0,S.css)({textStyle:"ui.small"}),children:r(e=>e.information.returnPeriodRemaining)}),(0,A.jsx)("dd",{className:(0,S.css)({textStyle:"ui.medium",margin:"none"}),children:r(e=>e.information.daysRemaining,{count:t})})]}),(0,A.jsx)(kt.A,{appearance:"secondary",href:"https://q.surveypal.com/Palautuslomake/0",postfixContent:(0,A.jsx)(B.In,{iconName:"FaExternalLink"}),target:"_blank",onClick:o,children:r(e=>e.cancelOrder)})]})},Js=({order:e})=>{const{t}=(0,j.A)("order-view.ondemand"),{t:s}=(0,j.A)("account"),n=(0,$.u3)(e.selectedPaymentMethodSubIds),r=e.orderStatus===$.Ju;if(!(n&&r))return null;const a=s(e=>e.creditAccount.customerService.email);return(0,A.jsx)("p",{className:(0,S.css)({textStyle:"ui.medium",margin:"none"}),children:(0,A.jsx)(T.x6,{components:{EmailLink:(0,A.jsx)("a",{href:`mailto:${a}`,children:a})},i18nKey:e=>e.stateDescription.walleyRejected,t})})};var Vs=s(25573);const qs=({order:{billingStatusComment:e,orderPickSelfService:t,orderstate:s,orderStatus:n,selectedPaymentMethodIds:r,isBillingStatusOk:a,selectedShipmentMethodId:i,locker:o}})=>{const d=(0,wt.A)(),l="lasku"in r&&!a,c=(0,$.TU)(s,e,t?.status,i,l,o);return(0,A.jsxs)("div",{className:(0,S.css)({display:"flex",flexDirection:"row",alignItems:"center"}),children:[(0,A.jsx)(Vs.A,{color:(0,$.mJ)(n,s,l)}),(0,A.jsx)(B.EY.H2,{className:(0,S.css)({textStyle:"heading.s",margin:"none"}),children:d(c)})]})},Hs=(0,P.styled)("div",{base:{display:"flex",flexDirection:"column",gap:"xs"}}),Gs=(0,P.styled)("div",{base:{display:"flex",flexDirection:{base:"column",sm:"row"},gap:"xs"}}),_s=(0,P.styled)("div",{base:{textAlign:"center"}}),Ks=(0,P.styled)(Et.A,{base:{display:"flex",marginTop:"2xs","& svg":{marginRight:"2xs"}}}),Qs=({order:e})=>{const{t}=(0,j.A)("order-view.ondemand"),{_embedded:s,orderId:r,orderstate:a,orderStatus:i,isBackorderRequested:o,isBackorderPossible:d,selectedShipmentMethodId:l,selectedPaymentMethodIds:c,selectedPaymentMethodSubIds:m,rmaDays:u}=e,p=(0,n.useMemo)(()=>a===$.$k||a===$.cH.Processed||a?.startsWith("processed")||i?.startsWith("pending")&&!d?{appearance:"secondary"}:{appearance:"info"},[a,i,d]),h=(0,n.useMemo)(()=>i===$.lX&&s?.cart?.items?.[0]?.killdate||!o&&d||i?.startsWith("pending")||a!==$.cH.Processed&&(0,$.fW)(l)||(0,$.X2)(a),[s,a,i,o,d,l]),x=(0,$.lW)(e.orderstate),g=te.Pp in c&&1===(0,$.qT)(m[te.Pp]),f="ok"===i,y=(0,$.bm)(e),k=!f&&g&&!y,b=(0,Ct.A)(e),v=St(e),w=(0,$.yV)(e);return(0,A.jsx)("div",{className:(0,S.css)({maxWidth:"widths.cartContentMaxWidth",margin:"{spacing.xs} auto 0"}),children:(0,A.jsx)(B.az,{...p,radius:"XS",children:v?(0,A.jsxs)(Hs,{children:[(0,A.jsx)(ps,{order:e,remoteGatherInterfaceOpen:!0}),(0,A.jsxs)(_s,{children:[(0,A.jsxs)(B.EY.UI,{children:[t(e=>e.mainBox.pickupPersonLabel)," "]})," ",(0,A.jsx)(B.EY.UI,{weight:"semiBold",children:b})]})]}):(0,A.jsxs)(Hs,{children:[(0,A.jsxs)(B.ob,{align:"space-between",gap:"xs",children:[(0,A.jsx)(qs,{order:e}),!h&&!x&&(0,A.jsx)(ps,{order:e})]}),(0,A.jsx)(Js,{order:e}),(0,A.jsxs)(Gs,{children:[(0,A.jsx)(Us,{order:e}),(0,A.jsx)(Ls,{className:(0,S.css)({flexGrow:"1"}),order:e}),w&&(0,A.jsx)(Ys,{asColumn:Boolean(h),className:(0,S.css)({flexShrink:0}),rmaDays:u??0})]}),h&&!x&&(0,A.jsx)(ps,{order:e}),k&&(0,A.jsx)(Ks,{context:"credit-account-hp:contract",title:t(e=>e.mainBox.creditContractDownload),url:`${Pt.dN}/api/v1/customer/financing/credit-purchase-contract?orderId=${r}`,asButtonLink:!0})]})})})};Qs.displayName="MainBox";const Zs=Qs;var en=s(98840),tn=s(22462),sn=s(97999),nn=s(20042);const rn=N["default"].div.withConfig({componentId:"sc-1gdd35r-0"})({marginLeft:E.space.XS,marginRight:E.space.XS}),an="fi/uutiskirje/tilaussivu-uutiskirje",on=({className:e})=>{const t=(0,f.A)(y.J.tiha.orderView),s=(0,en.A)(void 0,an),a=(0,r.d4)(tn.rE),i=(0,r.d4)((0,nn.aV)(an));return(0,n.useEffect)(()=>{t(sn._.started({slug:an}))},[t]),a?null:i?(0,A.jsx)(_.A,{message:"Haetaan tietoja...",reflow:!0}):s?(0,A.jsx)("div",{className:e,children:(0,A.jsx)(rn,{children:(0,A.jsx)(s,{})})}):null};on.displayName="Newsletter";const dn=(0,N["default"])(on).withConfig({componentId:"sc-1gdd35r-1"})({display:"flex",flexDirection:"column",background:E.color.background.info,borderRadius:E.border.radiu
1s.XXS,alignSelf:"flex-end",marginTop:E.space.XS,paddingTop:E.space.XS,paddingBottom:E.space.XS}),ln=(0,P.styled)(B.EY.UI,{base:{border:`solid {borderWidths.l}`,padding:"2xs",borderRadius:"2xs",fontSize:"xl"}},{defaultProps:{weight:"semiBold"}}),cn=(0,P.styled)(B.EY.UI,{base:{fontSize:"xl",paddingRight:"2xs"}}),mn=N["default"].div.withConfig({componentId:"sc-v0wzow-0"})({textAlign:"center"}),un={A:"#F0373A",B:"#FF880E",C:"#FFDD36",D:"#55BA43",E:"#6EAEE6",F:"#083880",G:"#5F2879"},pn=({locker:e,orderId:t})=>{const{t:s}=(0,j.A)(["common","order-view.ondemand"]),a=(0,r.d4)(R.PN),i=(0,r.d4)(R.pU),o=(0,r.d4)(R.cR),d=(0,f.A)(y.J.tiha.orderView),l=(0,n.useCallback)(()=>d((0,H.mS)()),[d]),c=(0,n.useCallback)(()=>{d(H.rZ.started({orderId:t}))},[d,t]),m=(0,n.useMemo)(()=>[{children:s(e=>e.cancel,{ns:"common"}),onClick:l,appearance:"secondary"},{children:s(e=>e.openLockerDialog.openLocker,{ns:"order-view.ondemand"}),onClick:c}],[c,l,s]);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(B.lG,{actions:m,closeButtonLabel:s(e=>e.dialog.closeButtonLabel,{ns:"common"}),isOpen:a,title:s(e=>e.openLockerDialog.title,{ns:"order-view.ondemand"}),onClose:l,children:[(0,A.jsx)(B.EY.UI,{children:s(e=>e.openLockerDialog.description,{ns:"order-view.ondemand"})}),(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),(0,A.jsx)(mn,{children:(0,A.jsxs)(ln,{style:{borderColor:e.lockerArea?un[e.lockerArea]:"black"},children:[e.lockerArea,e.lockerNumber]})}),(0,A.jsx)("br",{}),o&&(0,A.jsx)(B.Eg,{appearance:"danger",children:(0,A.jsx)(B.Eg.Paragraph,{children:s(e=>e.openLockerDialog.error,{ns:"order-view.ondemand"})})})]}),(0,A.jsx)(B.lG,{closeButtonLabel:s(e=>e.dialog.closeButtonLabel,{ns:"common"}),isOpen:i,title:s(e=>e.openLockerDialog.successTitle,{ns:"order-view.ondemand"}),onClose:l,children:(0,A.jsxs)(mn,{children:[(0,A.jsx)(cn,{children:s(e=>e.openLockerDialog.locker,{ns:"order-view.ondemand"})}),(0,A.jsxs)(ln,{style:{borderColor:e.lockerArea?un[e.lockerArea]:"black"},children:[e.lockerArea,e.lockerNumber]}),(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),(0,A.jsx)(B.EY.UI,{children:s(e=>e.openLockerDialog.thankYou,{ns:"order-view.ondemand"})}),(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),(0,A.jsx)(B.EY.UI,{children:s(e=>e.openLockerDialog.closeLockerDoor,{ns:"order-view.ondemand"})}),(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),(0,A.jsx)(U.A,{onClick:l,children:"OK"})]})})]})};var hn=s(64779);const xn=(0,N["default"])(hn.Ay).withConfig({componentId:"sc-mu9frf-0"})({display:"inline"}),gn=({className:e})=>{const t=(0,r.d4)(R.KW),s=(0,r.d4)(R.bW),{t:n}=(0,j.A)("order-view.ondemand");return t?(0,A.jsxs)(B.Eg,{appearance:"alert",className:e,children:[(0,A.jsx)(B.Eg.Title,{children:"Tunnistautumispalvelussa väliaikainen häiriö"}),(0,A.jsxs)(B.Eg.Paragraph,{children:["Näyttää siltä, että tunnistautumispalveluun ei juuri nyt saada yhteyttä. Voit yrittää myöhemmin uudelleen painamalla Siirry tunnistautumaan. Jos ongelma jatkuu, ole yhteydessä"," ",(0,A.jsx)(xn,{href:"https://asiakaspalvelu.verkkokauppa.com/hc/fi",children:"asiakaspalveluun"}),"."]})]}):s?(0,A.jsxs)(B.Eg,{appearance:"alert",className:e,children:[(0,A.jsx)(B.Eg.Title,{children:n(e=>e.tradeInRejectedNotification.title)}),(0,A.jsx)(B.Eg.Paragraph,{children:(0,A.jsx)(T.x6,{components:{ExternalLink:(0,A.jsx)(ke.A,{confirmation:!1,href:n(e=>e.tradeInRejectedNotification.contactUrl)})},i18nKey:e=>e.tradeInRejectedNotification.body,t:n})})]}):null};gn.displayName="OrderNotifications";const fn=(0,N["default"])(gn).withConfig({componentId:"sc-mu9frf-1"})({});var jn=s(58773),yn=s(96990),kn=s(45944);const bn=({className:e})=>{const{pathname:t}=(0,a.zy)(),s=c.JE.confirmedOrder.matchPath(t)?kn.O9.purchaseCompletedPageRecs:kn.O9.viewOrderPageRecs,{data:n,isLoading:r,products:i}=(0,yn.A)(s);return(0,A.jsx)("div",{className:e,children:(0,A.jsx)(jn.A,{dataLayerListName:`DY Campaign: ${s}`,dyCampaignId:s,loading:r,products:i,title:n?.title,extraSmall:!0})})};bn.displayName="OrderRecommendations";const vn=(0,P.styled)(bn,{base:{background:E.color.fundaments.greys[150],"& > *":{background:E.color.fundaments.greys[150]}}}),wn=N["default"].div.withConfig({componentId:"sc-ydpi6a-0"})({width:"25%",textAlign:"right"}),In=(0,N["default"])(wn).withConfig({componentId:"sc-ydpi6a-1"})({textAlign:"left"}),An=N["default"].div.withConfig({componentId:"sc-ydpi6a-2"})({height:E.space.L,display:"flex",justifyContent:"space-between",alignItems:"center"}),Cn=({downloadUrl:e,refund:t})=>(0,A.jsxs)(An,{children:[(0,A.jsxs)(In,{children:[(0,A.jsx)("div",{children:1===t.vatRefundType?"ALV-hyvitys":"Tilaushyvitys"}),(0,A.jsx)("div",{children:t.id})]}),(0,A.jsx)(wn,{children:"paid"===t.state?"Maksettu":"Maksamaton"}),(0,A.jsx)(wn,{children:(0,qe.$g)(t.refundedSum)}),(0,A.jsx)(wn,{children:(0,A.jsx)(Et.A,{context:`order:refund:${t.id}`,title:"Lataa hyvityskuitti",type:"refund",url:e,isCompact:!0})})]},t.id),Sn=`calc(${E.space.XS} - ${E.space.XXXS})`,Pn=N["default"].div.withConfig({componentId:"sc-1n2po4v-0"})({margin:"0 auto",border:`1px solid ${E.color.fundaments.greys[200
1]}`,maxWidth:"800px"}),En=N["default"].h3.withConfig({componentId:"sc-1n2po4v-1"})({padding:Sn,margin:0,backgroundColor:E.color.fundaments.greys[50],borderBottom:`1px solid ${E.color.fundaments.greys[200]}`}),Bn=N["default"].div.withConfig({componentId:"sc-1n2po4v-2"})({padding:Sn}),Tn=()=>{const{refunds:e,orderId:t}=(0,r.d4)(R.m1)||{},s=e?.filter(({vatRefundType:e})=>1===e)??[];return 0===s.length?null:(0,A.jsxs)(Pn,{children:[(0,A.jsx)(En,{children:"Hyvitykset"}),(0,A.jsx)(Bn,{children:s.map(e=>(0,A.jsx)(Cn,{downloadUrl:`${Pt.dN}/api/v3/order/${t}/refund/${e.id}`,refund:e},e.id))})]})};var Nn=s(38658);const Mn=(0,P.styled)("p",{base:{textStyle:"ui.medium",marginTop:"none","&:last-of-type":{marginBottom:"none"}}}),Dn=()=>{const{t:e}=(0,j.A)("common"),{buildPathWithLanguage:t}=(0,o.A)(),s=(0,a.Zp)({conditionalScrollTo:0}),i=(0,r.d4)(R.Cj),d=(0,r.d4)(R.l7),l=(0,r.d4)(R.QV),m=(0,r.d4)(R.w8),u=(0,r.d4)(R.P0),p=(0,r.d4)(R.m1),h=(0,f.A)(y.J.tiha.orderView),x=!(0,$.fW)(p?.selectedShipmentMethodId)||p&&(0,$.Lk)(p?.selectedPaymentMethodIds),g=(0,n.useCallback)(()=>{h((0,H.LJ)()),x&&u&&!l&&(h((0,H.Uy)()),s(t(c.JE.viewOrder,{orderId:u})))},[h,x,u,l,s,t]),k=(0,n.useMemo)(()=>{if(!l)return[{onClick:g,children:"Sulje"}]},[g,l]),b=(0,n.useMemo)(()=>l?"Jaetaan tilausta...":m?"Tilauksen jakaminen epäonnistui":"Tilauksen jakaminen onnistui!",[m,l]);return!i||l||m||d!==u||(Nn.A.warn({orderId:d,newOrderId:u,redirectToNewOrder:x}),Nn.A.error('Customer saw "Tilauksen jakaminen onnistui!" with no change in orderId')),(0,A.jsx)(B.lG,{actions:k,closeButtonLabel:e(e=>e.dialog.closeButtonLabel),isOpen:i,title:b,onClose:g,children:l?(0,A.jsx)(_.A,{}):m?(0,A.jsx)(B.EY.P,{children:"Tapahtui odottamaton virhe, yritä myöhemmin uudestaan."}):u?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(Mn,{children:["Olet siirtänyt osan tilauksen ",d," tuotteista uuteen tilaukseen."]}),(0,A.jsxs)(Mn,{children:["Uuden tilauksen numero on ",u,"."]}),(0,A.jsx)(Mn,{children:"Voit tarkistaa kaikkien tilaustesi tilan omalta tilaussivultasi."})]}):null})};var $n=s(63455),Ln=s(8278);const Rn=N["default"].div.withConfig({componentId:"sc-1n5ez02-0"})({display:"flex",flexDirection:"column",gap:E.space.XS,[Ln.A]:{flex:1,maxWidth:"100%"},[$n.A]:{flex:1,marginBottom:0},[z.breakpoint.min.S]:{flexDirection:"row"}}),Fn=({order:e,className:t})=>(0,$.lW)(e.orderstate)?(0,A.jsxs)(B.az,{appearance:"secondary",className:t,radius:"XS",children:[(0,A.jsx)(B.EY.H3,{css:{marginBottom:"xs",width:"100%"},size:"2xs",children:"Hyväksy ehdot sekä tunnistaudu viimeistelläksesi Walley-maksun hakemus"}),(0,A.jsxs)(Rn,{children:[(0,A.jsx)($n.A,{}),(0,A.jsx)(Ln.A,{isOpenOrder:!0})]}),(0,A.jsx)(ps,{order:e})]}):null;Fn.displayName="WalleyCreditCheck";const Xn=(0,N["default"])(Fn).withConfig({componentId:"sc-1n5ez02-1"})({display:"flex",flexDirection:"column",marginTop:E.space.XS,[ps]:{marginTop:E.space.XS,width:"100%"}});var On=s(13375),Wn=s(51674);const zn=N["default"].dl.withConfig({componentId:"sc-1u52z4i-0"})({dt:{color:E.color.text.secondary},dd:{marginLeft:E.space.XXS},"dt:not(:first-child), dd":{marginTop:E.space.XXS}}),Un=()=>{const e=(0,r.d4)(R.BB),t=(0,r.d4)((0,Wn.xz)(e)),s=(0,r.d4)((0,Wn.l1)(e)),a=(0,r.d4)((0,Wn.NQ)(e)),{t:i}=(0,j.A)(["product"]),{t:o}=(0,j.A)(["common"]),d=(0,V.YR)(s?.warranty,-1),l=(0,f.A)(y.J.tiha.orderView),c=(0,r.wA)();(0,n.useEffect)(()=>{!e||a||t||s||c((0,On.d$)({pids:[e]}))},[c,e,a,t,s]);const m=(0,n.useCallback)(()=>{l((0,H.x1)())},[l]);return(0,A.jsx)(B.lG,{actions:[{onClick:m,children:o(e=>e.close),appearance:"secondary"}],closeButtonLabel:o(e=>e.dialog.closeButtonLabel),id:"warranty-dialog",isOpen:Boolean(e),title:i(e=>e.productDetails.warranty.title),onClose:m,children:t?(0,A.jsx)(_.A,{}):s&&!a?(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(zn,{children:[d>0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("dt",{children:i(e=>e.productDetails.warranty.duration)}),(0,A.jsx)("dd",{children:i(e=>e.productDetails.warranty.durationValue,{count:d})})]}),(0,A.jsx)("dt",{children:i(e=>e.productDetails.warranty.instructions)}),(0,A.jsx)("dd",{dangerouslySetInnerHTML:{__html:(s.brand?.support??"").replace(/([^'"])(https?:\/\/[.\w]+\/?([/\-.\w?=&]+[/\-\w])?)(\.?)/gi,'$1<a href="$2">$2</a>$4')}})]})}):(0,A.jsx)(B.EY.UI,{children:(0,A.jsx)(T.x6,{components:{supportPagesLink:(0,A.jsx)(ke.A,{href:"https://asiakaspalvelu.verkkokauppa.com/hc/fi/categories/200090383-Takuu-tuki-huolto",confirmation:!1})},i18nKey:e=>e.productDetails.warranty.supportInfo,t:i})})})},Yn=(0,N["default"])(Z.nd).withConfig({componentId:"sc-4zb7cf-0"})({[Q.A]:{margin:0}}),Jn=(0,N["default"])(Z.Ay).withConfig({componentId:"sc-4zb7cf-1"})({[`${pt}, ${le}, ${gt}, ${fn}`]:{marginTop:E.space.XS}}),Vn=(0,P.styled)(At,{base:{maxWidth:"widths.mainColumnMaxWidth",marginBlock:"3xs",marginInline:"auto"}},{shouldForwardProp:e=>"order"===e}),qn=(0,P.styled)(yt,{base:{margin:"2xs",md:{marginTop:"xs",marginRight:"none",marginBottom:"none",marginLeft:"2xs"}}}),Hn=(0,N["default"])(vn).withConfig({componentId:"sc-4zb7cf-2"})({marginRight:E.space.XS,[z.breakpoint.min.M]:{gridColumn:"span 2",marginLeft:`
1-${E.space.XXS}`,marginRight:0}}),Gn=(0,P.styled)(U.A,{base:{float:"right",marginTop:"xs"}},{defaultProps:{id:"cancel-order",appearance:"secondary"},forwardProps:["appearance"]}),_n=N["default"].div.withConfig({componentId:"sc-4zb7cf-3"})({marginTop:E.space.XS}),Kn=({children:e,hideHeading:t,context:s=y.J.tiha.orderView,isConfirmedPage:i})=>{const{buildPathWithLanguage:d}=(0,o.A)(),{orderId:l}=(0,a.g)(),{state:m}=(0,a.zy)(),u=(0,r.d4)(R.m1),p=(0,r.d4)(R.QW),h=(0,r.d4)(R.Q5),x=(0,f.A)(s),g=u?.orderId&&`${u?.orderId}`!==l,k=p||g,b=(0,r.d4)(R.cm),v=(0,r.d4)(R.zt),{t:w}=(0,j.A)("order-view.ondemand");(0,J.A)(u?.orderstate?w(e=>e.pageTitle,{orderId:u.orderId}):"");const I=(0,n.useCallback)(()=>{x((0,H.Zr)())},[x]),C=u?.orderstate===$.cH.Processed?"processed":u?.isReady?"ready":"open",P=m?.returnPage??d(c.JE.list,{type:C});return(0,n.useEffect)(()=>{u?.orderstate&&!g||h||p||(x(H.r$.started((0,V.YR)(l))),x(H.WL.started((0,V.YR)(l))))},[x,h,p,l,u,g]),(0,n.useEffect)(()=>()=>{x((0,H.Uy)())},[x]),(0,n.useEffect)(()=>{x(G.j.started())},[x]),h?(0,A.jsxs)(Yn,{children:[(0,A.jsx)(Q.A,{href:P,children:w(e=>e.backToOrdersPage)}),(0,A.jsx)(K.A,{error:(0,q.GN)(h)})]}):(0,A.jsxs)(Y.A.Provider,{value:s,children:[k&&(0,A.jsx)(Yn,{children:(0,A.jsx)(_.A,{message:w(e=>e.loadingOrder,{orderId:l}),reflow:!0})}),!k&&u?.orderstate&&(0,A.jsx)(Jn,{below:(0,A.jsx)(Hn,{items:u._embedded?.cart?.items,orderId:l}),order:u,side:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(qn,{}),(0,A.jsx)(dn,{})]}),children:(0,A.jsxs)(A.Fragment,{children:[!t&&(0,A.jsx)(Vn,{order:u}),e&&(0,A.jsx)(Z.kR,{children:e}),(0,A.jsx)(fn,{}),(0,A.jsx)(Xn,{order:u}),(0,A.jsx)(Zs,{order:u}),b&&i&&(0,A.jsxs)(_n,{children:[(0,A.jsx)(B.EY.P,{size:"small",children:w(e=>e.confirmationSentToEmail,{email:u?.customerEmail?` ${u.customerEmail}`:""})}),(0,A.jsx)(B.EY.P,{size:"small",children:(0,A.jsx)(T.x6,{components:{Bold:(0,A.jsx)("strong",{className:(0,S.css)({textStyle:"ui.medium",margin:"none",fontWeight:"semiBold"})})},i18nKey:e=>e.orderNumber,t:w,values:{orderId:l}})})]}),(0,A.jsx)(Tn,{}),(0,A.jsx)(pt,{}),(0,A.jsx)(gt,{}),(0,A.jsx)(le,{orderId:u.orderId}),u.isCancelable&&(0,A.jsx)(Gn,{onClick:I,children:w(e=>e.cancelOrder)}),v&&(0,A.jsx)(vt,{})]})}),(0,A.jsx)(Dn,{}),(0,A.jsx)(xe,{}),(0,A.jsx)(ie,{}),(0,A.jsx)(Un,{}),u?.locker&&u?.orderId&&(0,A.jsx)(pn,{locker:u.locker,orderId:u.orderId})]})},Qn=N["default"].div.withConfig({componentId:"sc-1ud1507-0"})({display:"flex",alignItems:"center",marginTop:E.space.XS}),Zn=N["default"].div.withConfig({componentId:"sc-1ud1507-1"})({flexGrow:2}),er=N["default"].div.withConfig({componentId:"sc-1ud1507-2"})({flexGrow:1,textAlign:"right",whiteSpace:"nowrap",marginLeft:E.space.S}),tr=(0,N["default"])(At).attrs({isConfirmedPage:!0}).withConfig({componentId:"sc-1ud1507-3"})({marginBottom:E.space.XS}),sr=(0,P.styled)(B.EY.P,{base:{marginTop:"2xs"}}),nr=()=>{const{buildPathWithLanguage:e}=(0,o.A)(),{orderId:t}=(0,a.g)(),[s,i]=(0,D.A)(["payment_status"]),d=(0,r.d4)(R.m1),l=(0,r.d4)(R.cm),m=(0,r.d4)(R.pk),{t:u}=(0,j.A)("order-view.ondemand"),p=(0,f.A)();return(0,M.A)(()=>{s.payment_status&&d?.orderId&&(p((0,L.O0)({order:d,status:s.payment_status})),i({payment_status:null}))},Boolean(s.payment_status&&d?.orderId)),(0,n.useEffect)(()=>{d&&d.orderId&&(0,$.k3)(d.orderStatus)&&p((0,b.qr)({orderId:d.orderId}))},[p,d]),(0,n.useEffect)(()=>()=>{p((0,b.yA)())},[p]),d?.orderId&&d?.orderstate===$.cH.Processed?(0,A.jsx)(a.C5,{to:e(c.JE.viewOrder,{orderId:d.orderId}),replace:!0}):(0,A.jsxs)(Kn,{context:y.J.checkout.confirmedPage,hideHeading:!0,isConfirmedPage:!0,children:[(0,A.jsx)(F.A,{completed:!0,newCheckoutStyles:!0}),(0,A.jsxs)(Qn,{children:[(0,A.jsxs)(Zn,{children:[(0,A.jsx)(tr,{order:d}),l?u(e=>e.confirmedPage.remoteGatherReadyMessage):m?u(e=>e.confirmedPage.thankYou):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(sr,{children:u(e=>e.confirmedPage.thankYouConfirmation,{email:d?.customerEmail?` ${d.customerEmail}`:""})}),(0,A.jsx)(sr,{children:(0,A.jsx)(T.x6,{components:{Bold:(0,A.jsx)("strong",{className:(0,S.css)({textStyle:"ui.medium",margin:"none",fontWeight:"semiBold"})})},i18nKey:e=>e.orderNumber,t:u,values:{orderId:t}})})]})]}),(0,A.jsx)(er,{children:(0,A.jsx)(W,{})})]})]})};nr.displayName="ConfirmedPage";const rr=nr,ar=(0,N["default"])(Z.nd).withConfig({componentId:"sc-1etmo6f-0"})({[Q.A]:{margin:0}}),ir=new q.pj,or=()=>{const e=(0,r.d4)(v.Q5),t=(0,f.A)(y.J.checkout.editPage),{buildPathWithLanguage:s}
1=(0,o.A)(),[a]=(0,n.useState)(e);return(0,n.useEffect)(()=>{t((0,b.k3)())},[t]),(0,A.jsxs)(ar,{children:[(0,A.jsx)(Q.A,{href:s(c.JE.list,{type:"open"}),children:"Takaisin tilaukset-sivulle"}),(0,A.jsx)(K.A,{error:a||ir})]})};or.displayName="EditErrorPage";const dr=(0,N["default"])(or).withConfig({componentId:"sc-1etmo6f-1"})({});var lr=s(90368),cr=s(86998),mr=s(82672),ur=s(84493),pr=s(4526),hr=s(51223),xr=s(28911),gr=s(77819);const fr=({className:e,oneRow:t,orderCart:s})=>s?(0,A.jsx)(gr.A,{className:e,oneRow:t,price:s.totalPrice,priceTaxless:s.excludingVatTotal,totalQuantity:s.totalQuantity}):null;fr.displayName="OrderPriceSummary";const jr=(0,N["default"])(fr).withConfig({componentId:"sc-1y8gp62-0"})({});var yr=s(16947),kr=s(84392),br=s(87291),vr=s(14574),wr=s(55362),Ir=s(38714),Ar=s(99044);const Cr=N["default"].span.withConfig({componentId:"sc-de8dku-0"})({display:"inline-block",fontSize:"16px",color:nt.JQ,fontWeight:600,paddingRight:"6px",position:"relative",whiteSpace:"nowrap"},({large:e,inactive:t,original:s})=>({...e?{fontSize:"28px","> small":{fontSize:"18px"}}:{},...t?{fontSize:"14px",color:nt.Dn,fontWeight:400,lineHeight:"28px"}:{},...s?{color:nt.Dn,"::before":{borderTop:`1px solid ${nt.av}`,content:'""',left:"-5%",position:"absolute",width:"100%",top:"50%"}}:{}})),Sr=({price:e})=>(0,A.jsx)(Cr,{original:!0,children:(0,qe.$g)(e,{symbol:""}).split(",").map((e,t)=>0===t?(0,A.jsx)(n.Fragment,{children:e},t):(0,A.jsx)("small",{children:`,${e}`},t))});Sr.displayName="OriginalPrice";const Pr=(0,N["default"])(Sr).withConfig({componentId:"sc-nrzcfe-0"})({}),Er=.01,Br=N["default"].p.withConfig({componentId:"sc-r92qk4-0"})({marginBottom:E.space.XS}),Tr=(0,P.styled)(B.EY.UI,{base:{backgroundColor:"yellow.400",lineHeight:"1.15"}},{defaultProps:{weight:"semiBold",appearance:"brand",size:"large"},forwardProps:["appearance"]}),Nr=N["default"].small.withConfig({componentId:"sc-r92qk4-1"})({display:"inline-block",verticalAlign:"bottom",paddingRight:E.space.XXS,fontSize:E.font.size.XXXS}),Mr=({className:e,active:t,children:s,discount:n=!1,large:a=!1,original:i=!1,pid:o,price:d})=>{const l=(0,r.d4)((0,Wn.u7)(o)),c=(0,r.d4)(u.Zz),m=(0,r.d4)(cr.w),p=(0,r.d4)(Ar.K2),{t:h}=(0,j.A)(["common","product"]);if(!d)return null;if(!t)return(0,A.jsx)("div",{className:e,children:(0,A.jsx)(Cr,{inactive:!0,children:h(e=>e.price.discontinued,{ns:"product"})})});const{current:x,original:g,currentTaxless:f,originalTaxless:y,discountAmount:k=null,discountPercentage:b}=c&&l||d,v=(0,V.YR)(p?x:f),[w,I]=(0,qe.$g)(v,{symbol:""}).split(",").map(e=>e.trim()),C=!m&&i&&(0,V.YR)(k)>0&&!c;return(0,A.jsxs)("div",{className:e,children:[(0,A.jsxs)(Cr,{large:a,children:[w,(0,A.jsx)("small",{children:`,${I}`})]}),!p&&(0,A.jsx)(Nr,{children:h(e=>e.price.vatText,{ns:"common"})}),C&&(0,A.jsx)(Pr,{price:p?g:y}),!m&&n&&!c&&k&&k>=Er&&(0,A.jsxs)(Br,{children:[(0,A.jsx)(B.EY.UI,{size:"large",weight:"semiBold",children:h(e=>e.price.save,{ns:"product"})}),"Â ",(0,A.jsx)(Tr,{children:(0,qe.$g)(k)}),"Â ",b," %"]}),!c&&s]})};Mr.displayName="Price";const Dr=(0,N["default"])(Mr).withConfig({componentId:"sc-r92qk4-2"})(({large:e})=>({lineHeight:e?"30px":"18px"})),$r=N["default"].ul.withConfig({componentId:"sc-sqwiao-0"})({listStyleType:"none",display:"flex",flexDirection:"row",padding:0,margin:E.space.XXS,justifyContent:"space-between",borderBottom:`solid 1px ${E.color.border.secondary}`}),Lr=N["default"].div.withConfig({componentId:"sc-sqwiao-1"})({display:"flex",flexDirection:"column",boxSizing:"border-box",flexGrow:1}),Rr=(0,N["default"])(Dr).withConfig({componentId:"sc-sqwiao-2"})({paddingTop:E.space.XXS}),Fr=N["default"].div.withConfig({componentId:"sc-sqwiao-3"})({alignSelf:"center",paddingRight:E.space.XS}),Xr=(0,vr.Du)([vr.P5[64]]),Or=({product:e,index:t})=>{const s=(0,r.d4)(X.md),a=(0,n.useMemo)(()=>(0,br.wE)(e,null),[e]),{imgSrc:i,imgSrcSet:o}=(0,n.useMemo)(()=>Xr(a?.images??e?.images),[a?.images,e?.images]),d=e?(0,br.$j)({article:a,language:s,fallback:e.name}):void 0,l=a?.price??e?.price;return void 0===e?(0,A.jsx)($r,{"data-testid":"placeholder",children:(0,A.jsx)(kr.A,{loading:!0})}):(0,A.jsxs)($r,{children:[(0,A.jsx)(kr.A,{disabled:!e.active,id:e.pid,imgSrc:i,imgSrcSet:o,name:d,children:(0,A.jsxs)(Lr,{children:[(0,A.jsxs)(B.EY.UI,{appearance:"secondary",size:"small",children:["Tuotenumero ",e?.pid]}),(0,A.jsx)(Ir.A,{bundleProducts:e.bundleProducts,externalId:a?.externalId,pid:e.pid}),(0,A.jsx)(Rr,{active:e.active,pid:e.pid,price:l??e.price,original:!0})]})}),(0,A.jsx)(Fr,{children:(0,A.jsx)(wr.A,{context:y.J.checkout.editPage,index:t,product:e,productArticle:a,isEditing:!0})})]})};Or.displayName="SearchProductResult";const Wr=(0,N["default"])(Or).withConfig({componentId:"sc-sqwiao-4"})({}),zr=N["default"].div.withConfig({componentId:"sc-1kmrx4k-0"})({paddingTop:E.space.XS,margin:"0 auto"}),Ur=N["default"].div.withConfig({componentId:"sc-1kmrx4k-1"})({display:"flex",flexDirection:"column",flexWrap:"wrap",justifyContent:"center",border:`solid 0.5px ${E.color.border.primary}
1`,borderRadius:E.border.radius.S,boxShadow:`0 1px 1px -1px ${E.color.fundaments.blackOpacities[900]}`,background:E.color.background.primary}),Yr=N["default"].div.withConfig({componentId:"sc-1kmrx4k-2"})({display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",padding:E.space.XS}),Jr=(0,P.styled)(B.EY.UI,{base:{padding:"xs"}}),Vr=(0,P.styled)(B.EY.P,{base:{paddingTop:"xs"}},{defaultProps:{size:"small"}}),qr=N["default"].div.withConfig({componentId:"sc-1kmrx4k-3"})({paddingTop:E.space.S,paddingBottom:E.space.S,margin:"0 auto",[(0,z.bV)("464px")]:{maxWidth:"100%",paddingTop:E.space.S,paddingBottom:E.space.S},[z.breakpoint.min.M]:{maxWidth:"60%",padding:E.space.S}}),Hr=({message:e})=>(0,A.jsx)(Yr,{children:(0,A.jsxs)(B.EY.P,{size:"medium",children:[e," "]})}),Gr=400,_r=3,Kr=()=>Array.from({length:_r},()=>{}),Qr=({className:e})=>{const t=(0,f.A)(),{t:s}=(0,j.A)("common"),[a,i]=(0,n.useState)(""),o=(0,r.d4)(v.a4),d=(0,r.d4)(v.BN),l=(0,r.d4)(v.O_),c=(0,r.d4)(v.eg),m=(0,r.d4)(v.oL),u=(0,r.d4)(v.yL),p=(0,n.useMemo)(()=>d?o?o.concat(Kr()):Kr():o??[],[o,d]),h=c<m,[x,g]=(0,Ft.A)(async e=>{t((0,b.zh)({query:e}))},Gr),y=(0,n.useCallback)(()=>{i(""),g(),t((0,b.m9)())},[t,g]),k=(0,n.useCallback)(e=>{e.preventDefault();const t=e.target.value;i(t),t.length>2&&x((0,yr.Mo)(t)),0===t.length&&y()},[x,y]);(0,n.useEffect)(()=>()=>{y()},[y]);const w=(0,n.useCallback)(()=>{a.length>0&&x((0,yr.Mo)(a))},[x,a]),I=(0,n.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),a.length>0&&w())},[w,a.length]),C=(0,n.useCallback)(async()=>{const e=c+1;e>m||t((0,b.zh)({query:a,pageNo:e}))},[c,a,m,t]);return(0,A.jsxs)("div",{className:e,children:[(0,A.jsx)(B.EY.H2,{size:"s",children:"Unohditko jotain tilauksestasi?"}),(0,A.jsx)(Vr,{children:"Eipä hätää: voit lisätä tilaukseesi tuotteita, jotka ovat heti saatavilla. Voit hakea tuotteita hakusanalla tai tuotenumerolla."}),(0,A.jsx)(qr,{children:(0,A.jsx)(B.DO,{appearance:"secondary",clearButtonLabel:s(e=>e.searchInput.clearButtonLabel),handleClearQuery:y,handleSubmitQuery:w,placeholder:"Etsi tuotteita...",query:a,searchButtonLabel:s(e=>e.searchInput.searchButtonLabel),onChange:k,onKeyDown:I})}),p.length>0&&(0,A.jsx)(zr,{children:(0,A.jsxs)(Ur,{children:[p.map((e,t)=>(0,A.jsx)(Wr,{index:t,product:e},e?.pid??t)),o?.length&&(0,A.jsxs)(Yr,{children:[(0,A.jsxs)(Jr,{children:["tuotteet ",1," - ",o.length," /"," ",h?u:o.length]}),h&&!l&&(0,A.jsx)(U.A,{appearance:"secondary",onClick:C,children:"Näytä lisää"})]})]})}),0===u&&!l&&(0,A.jsx)(Hr,{message:"Ei hakutuloksia"}),l&&(0,A.jsx)(Hr,{message:l})]})};Qr.displayName="SearchEditPage";const Zr=(0,N["default"])(Qr).withConfig({componentId:"sc-1kmrx4k-4"})({background:E.color.background.info,padding:E.space.XS,borderRadius:E.space.XXXS,marginTop:E.space.L}),ea=N["default"].div.withConfig({componentId:"sc-oep21d-0"})({marginTop:E.space.XS}),ta=N["default"].div.withConfig({componentId:"sc-oep21d-1"})({paddingTop:E.space.XS,margin:"0 auto",[jr]:{margin:`${E.space.XS} ${E.space.XS}`}}),sa=y.J.checkout.editPage,na=()=>{const e=(0,a.g)(),{translateError:t}=(0,lr.A)(),s=(0,f.A)(sa),i=(0,r.d4)(cr.w),o=(0,r.d4)(v.QW),d=(0,r.d4)(v.p5),l=(0,r.d4)(v.m1),c=(0,r.d4)(v.lu),m=(0,Xe.A)(l);(0,n.useEffect)(()=>{e.orderId&&s(H.WL.started((0,V.YR)(e.orderId)))},[s,e.orderId]);const u=(0,n.useCallback)((e,t,n,r,a)=>{s(b.mq.started({pid:e,externalId:t,quantity:n,serviceFor:r,rowId:a}))},[s]),p=(0,n.useMemo)(()=>l?._embedded?.cart?.items||[],[l]);if(i||o||0===p.length&&!d)return(0,A.jsxs)(xr.A,{type:"cart",variant:"standard",main:!0,children:[(0,A.jsx)(hr.A.NoIndex,{title:"Muokkaa tilausta"}),(0,A.jsx)(_.A,{message:"Odota hetki..."})]});const h=!l?.offerId&&!m;return(0,A.jsxs)(I.A,{context:sa,step:(0,je.v3)(e?.step),title:`Tilauksen ${e.orderId} tuotteet`,isEditPage:!0,children:[d.cart.length>0&&(0,A.jsx)(ea,{children:d.cart.map(e=>(0,A.jsx)(B.Eg,{appearance:"danger",children:(0,A.jsx)(B.Eg.Title,{children:t(e)})},e.messageCode))}),(0,A.jsx)(mr.A,{isEditing:!0}),Boolean(p.length)&&null!==c&&(0,A.jsxs)(ta,{children:[(0,A.jsx)(pr.A,{children:p.map(e=>(0,A.jsx)(ur.A,{editOrderPristineItem:c[e.pid],isEditing:!0,item:e,setItemSalesUnitCount:u,showInput:h},`item-${e.pid}-row-${e.rid}`))}),(0,A.jsx)(jr,{orderCart:l?._embedded?.cart})]}),h&&(0,A.jsx)(Zr,{})]})};var ra=s(3594),aa=s(33844),ia=s(52912),oa=s(75163),da=s(27147),la=s(57455),ca=s(71140);const ma=({count:e=0,orders:t,title:s,type:n})=>{const{buildPathWithLanguage:r}=(0,o.A)();return 0===e?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(la.A,{items:t,itemsCount:e,listItemType:"orders",title:s}),e>t.length&&(0,A.jsxs)(ca.A,{className:"more-link",to:r(c.JE.list,{type:n}),children:["Kaikki ",s.toLowerCase()," ",(0,A.jsx)(B.In,{iconName:"FaChevronRight",size:"xs",isInline:!0})]})]})},ua=()=>
1{const e=(0,ra.A)(),[t,s]=(0,n.useState)(""),[a,i]=(0,n.useState)(!1),[o,d]=(0,n.useState)({orders:[],total:0}),[l,c]=(0,n.useState)({orders:[],total:0}),m=(0,r.d4)(X.EF),{t:u}=(0,j.A)("orders");(0,J.A)(u(e=>e.orderListView.pageTitle,{sectionTitle:u(e=>e.orderType,{context:"open"})}));const p=(0,n.useCallback)(async()=>{i(!0);try{const{orders:t}=await(0,aa.hv)(m),{open:s,ready:n,totalOpen:r,totalReady:a}=t;if(!e())return;d({orders:s,total:r}),c({orders:n,total:a})}catch{if(!e())return;s("Tilausten lataaminen epäonnistui. Ota yhteys asiakaspalveluun jos ongelma toistuu.")}finally{e()&&i(!1)}},[e,m]);if((0,n.useEffect)(()=>{p()},[p]),a)return(0,A.jsx)("div",{className:"view view--loading",children:(0,A.jsx)(_.A,{message:"Haetaan tilauksia..."})});if(t)return(0,A.jsx)("div",{className:"view view--error",children:(0,A.jsx)(da.A,{type:"error",children:t})});const h=l.total+o.total;return(0,A.jsxs)(A.Fragment,{children:[0===h&&(0,A.jsx)(oa.A,{blue:!0,children:(0,A.jsx)("h2",{className:"align-center",children:"Ei avoimia tilauksia"})}),h>0&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ma,{count:l.total,orders:l.orders.map(e=>ia.KQ(e,m)),title:"Valmiit tilaukset",type:"ready"}),(0,A.jsx)(ma,{count:o.total,orders:o.orders.map(e=>ia.KQ(e,m)),title:"Avoimet tilaukset",type:"open"})]})]})};var pa=s(47169),ha=s(38921),xa=s(89275);const ga=N["default"].form.withConfig({componentId:"sc-1cd2ohz-0"})({flex:"0 1 50%",display:"block"}),fa=({className:e,initialQuery:t,onEmptySubmit:s,onValue:r,placeholder:a})=>{const{t:i}=(0,j.A)(["common","checkout.ondemand"]),[o,d]=(0,n.useState)(t??""),l=(0,n.useCallback)(e=>d("string"==typeof e?e:e.target.value),[]),c=(0,n.useCallback)(e=>{e.preventDefault(),d(o),o.length>0&&r&&r((0,yr.Mo)(o))},[r,o]),m=(0,n.useCallback)(()=>{d(""),s&&s()},[s]);return(0,A.jsx)("aside",{className:e,children:(0,A.jsx)(ga,{acceptCharset:"UTF-8","aria-label":i(e=>e.searchBox.ariaLabel,{ns:"checkout.ondemand"}),role:"search",onSubmit:c,children:(0,A.jsx)(B.DO,{clearButtonLabel:i(e=>e.searchInput.clearButtonLabel,{ns:"common"}),disabled:!o.length,handleClearQuery:m,placeholder:a??i(e=>e.searchBox.placeholder,{ns:"checkout.ondemand"}),query:o,searchButtonLabel:i(e=>e.searchInput.searchButtonLabel,{ns:"common"}),onInput:l})})})},ja=(0,N["default"])(fa).withConfig({componentId:"sc-1cd2ohz-1"})({margin:`${E.space.XS} auto`,whiteSpace:"nowrap",width:"90%",[z.breakpoint.min.S]:{margin:`${E.space.S} auto`,display:"flex",justifyContent:"center"}}),ya=(0,Ee.og)(),ka={xlsx:"Excel",csv:"CSV"},ba=(0,N["default"])("input").withConfig({componentId:"sc-ybxi9j-0"})({textIndent:"0px",fontFamily:E.font.family.default,fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",background:E.color.fundaments.white,border:"none",boxShadow:`${E.color.border.primary} 0px 0px 0px ${E.border.size.S} inset`,padding:`0 ${E.space.XXS}`,boxSizing:"border-box",borderRadius:E.space.XXXS,width:"auto",outline:"none",height:E.size.M}),va=()=>{const[e,t]=(0,n.useState)(()=>(0,Ee.og)().minus({months:1})),[s,r]=(0,n.useState)(ya),[a,i]=(0,n.useState)("xlsx"),{t:o}=(0,j.A)("orders-list.ondemand"),d=(0,n.useCallback)(e=>{const s=(0,Ee.og)(e.target.value);s&&t(s)},[]),l=(0,n.useCallback)(e=>{const t=(0,Ee.og)(e.target.value);t&&r(t)},[]),c=(0,n.useCallback)(e=>{i(e.target.value)},[]),m=(0,is.J)({startDate:e,endDate:s,fileFormat:a});return(0,A.jsxs)(B.ob,{alignBlock:"center",css:{marginTop:"xs",marginBottom:"xs"},gap:"2xs",children:[(0,A.jsx)("div",{className:"orders-report--title",children:(0,A.jsx)("strong",{children:o(e=>e.ordersReport.title)})}),(0,A.jsxs)(B.ob,{alignBlock:"center",gap:"2xs",children:[(0,A.jsx)("div",{children:(0,A.jsx)(ba,{"aria-label":o(e
1=>e.ordersReport.startDateLabel),id:"report-start-date",max:(0,Ee.d$)(s),name:"report-start-date",type:"date",value:(0,Ee.d$)(e),onChange:d})}),(0,A.jsx)("div",{children:"â"}),(0,A.jsx)("div",{children:(0,A.jsx)(ba,{"aria-label":o(e=>e.ordersReport.endDateLabel),id:"report-end-date",max:(0,Ee.d$)(ya),min:(0,Ee.d$)(e),name:"report-end-date",type:"date",value:(0,Ee.d$)(s),onChange:l})})]}),(0,A.jsx)("div",{children:(0,A.jsx)(B.l6,{id:"report-format",name:"report-format",size:"M",onChange:c,children:Object.entries(ka).map(([e,t])=>(0,A.jsx)("option",{"aria-label":e,value:e,children:t},e))})}),(0,A.jsx)(Et.A,{...m,title:o(e=>e.ordersReport.download)}),m.dateError&&(0,A.jsx)("small",{className:"orders-report--error",children:o(e=>e.ordersReport.dateError)})]})},wa="unpaid",Ia=["open","processed","ready",wa],Aa=(0,P.styled)("p",{base:{textStyle:"ui.medium",margin:"none",marginLeft:"2xs"}}),Ca=()=>{const e=(0,a.Zp)(),{page:t="1",type:s="open"}=(0,a.g)(),i=(0,pa.A)(t),d=(0,pa.A)(s),l=(0,ra.A)(),p=(0,r.d4)(Rs.J0),h=(0,r.d4)(u.N9),{buildPathWithLanguage:x}=(0,o.A)(),{t:g}=(0,j.A)("orders"),[f,y]=(0,n.useState)(""),[k,b]=(0,n.useState)(!1),[v,w]=(0,n.useState)({orders:[],totalPages:0,currentPage:1,total:0}),I=(0,r.d4)(X.EF),[C,S]=(0,Ft.A)((e,t)=>{b(!0),(0,aa.$C)(e,t,I).then(({orders:e,total:t,totalPages:s,currentPage:n})=>({orders:e,total:t,totalPages:s,currentPage:n})).catch(()=>(y(g(e=>e.orderListView.fetchError)),!1)).then(e=>{l()&&(0,ee.CJ)(e)&&w(e)}).finally(()=>{b(!1)})},50),P=(0,n.useCallback)((e,t)=>{const s=Math.max(1,(0,V.YR)(e));"function"==typeof S&&S(),C(t,s)},[S,C]),E=(0,n.useCallback)(t=>{e(`${x(c.JE.search)}?query=${encodeURIComponent(t)}`)},[x,e]),{orders:T,total:N,totalPages:M,currentPage:D}=v,L=(0,n.useMemo)(()=>T.map(e=>(0,$.VS)(e)?(0,ia.$G)(e,I):(0,ia.KQ)(e,I)),[T,I]),R="processed"===s&&N>0&&(0,m.m7)(h);return(0,n.useEffect)(()=>{Ia.includes(s)?P(t,s):(Nn.A.warn(`Invalid order list type '${s}', redirecting to main order list view`),e(x(c.JE.main),{replace:!0}))},[s,t,P,e,x]),(0,n.useEffect)(()=>{t===i&&s===d||P(t,s)},[P,t,i,d,s]),(0,n.useEffect)(()=>()=>{"function"==typeof S&&S()},[S]),(0,J.A)(g(e=>e.orderListView.pageTitle,{sectionTitle:g(e=>e.orderType,{context:s})})),k&&0===T.length?(0,A.jsx)("div",{className:"view view--loading",children:(0,A.jsx)(_.A,{message:g(e=>e.orderListView.loading)})}):(0,A.jsxs)(A.Fragment,{children:[!p&&s===wa&&(0,A.jsxs)(Aa,{children:[g(e=>e.orderListView.apuraha.text)," ",(0,A.jsx)(ca.A,{to:x(c.Y.financing.main),children:g(e=>e.orderListView.apuraha.linkText)}),"."]}),0===T.length&&(0,A.jsx)(oa.A,{blue:!0,children:(0,A.jsx)("h2",{className:"align-center",children:g(e=>e.noOrders,{context:s})})}),f&&(0,A.jsx)("div",{className:"view view--error",children:(0,A.jsxs)(oa.A,{red:!0,children:[(0,A.jsx)(B.In,{iconName:"FaTimesOctagon",isInline:!0})," ",f]})}),"processed"===s&&(0,A.jsx)(ja,{onValue:E}),L.length>0&&(0,A.jsx)(la.A,{items:L,itemsCount:N,listItemType:"orders",loading:k,title:g(e=>e.orderType,{context:s})}),M>1&&(0,A.jsx)(xa.A,{hrefPrefix:`${x(c.JE.list,{type:s})}`,pageCount:M,pageNo:D,isPathParam:!0}),R&&(0,A.jsxs)(B.mc,{css:{maxWidth:"100vw",marginBlock:"s"},gutter:"none",children:[(0,A.jsx)(ha.A,{children:(0,A.jsx)(B.EY.H3,{size:"s",children:g(e=>e.orderListView.orderActions)})}),(0,A.jsx)("div",{className:"order-actions-container",children:(0,A.jsx)(va,{})})]})]})};var Sa=s(50620),Pa=s(80711);const Ea=(0,P.styled)(B.Eg,{base:{margin:"s"}},{shouldForwardProp:e=>"appearance"===e}),Ba=N["default"].aside.withConfig({componentId:"sc-13kj0eb-0"})({display:"flex",justifyContent:"flex-end",marginBlock:E.space.S}),Ta=({className:e})=>{const t=(0,a.Zp)(),s=(0,a.zy)(),i=(0,a.g)(),{buildPathWithLanguage:d}=(0,o.A)(),{t:l}=(0,j.A)("orders"),m=(0,r.d4)(X.EF),[u,p]=(0,n.useState)(!1),[h,x]=(0,n.useState)(!1),[g,f]=(0,n.useState)(!1),[y,k]=(0,n.useState)({matches:[],totalItems:0,totalPages:0}),b=(0,pa.A)(s.search),v=(0,pa.A)(i.page);(0,J.A)(l(e=>e.orderListView.pageTitle,{sectionTitle:l(e=>e.orderType,{context:"search"})}));const w=(0,n.useCallback)((e,t)=>{(0,Sa.Ud)(`${Pt.dN}/api/v3/orders/search?query=${encodeURIComponent(t)}&page=${e}`).then(({matches:e,totalItems:t,totalPages:s})=>{k({matches:e,totalItems:t,totalPages:s})}).catch(e=>{const t=Boolean(e.response)&&404===e.response.status;p(!t),k(({matches:e,totalItems:s,totalPages:n})=>({matches:t?[]:e,totalItems:t?0:s,totalPages:t?0:n}))}).finally(()=>{x(!1),f(!0)})},[]);(0,n.useEffect)(()=>{const e=new URLSearchParams(s.search),t=Math.max(1,(0,V.YR)(i.page));w(t,e.get("query")??"")},[w,s.search,i.page]),(0,n.useEffect)(()=>{const e=new URLSearchParams(s.search),t=Math.max(1,(0,V.YR)(i.page));v===i.page&&b===s.search||w(t,e.get("query")??"")},[w,s.search,i.page,v,b]);const I=(0,n.useCallback)(e=>{t({pathname:d(c.JE.search),search:`?query=${encodeURIComponent(e)}`})},[d,t]),C=(0,n.useCallback)(()=>t({pathname:d(c.JE.list,{type:"processed"})}),[d,t]),S=(0,n.useCallback)(e=>{const{matches:t}=y,s=Math.max(1,(0,V.YR)(i.page)),n=t.reduce((e,t)=>
1{const s=t.processedAt.slice(0,19).replace("T"," "),n=t.trackingCodes.map(e=>e.trackingCode||e.trackingUrl).join("\n"),r=`${t.price.toString().replace(".",",")} â¬`;return e.concat([`"${t.orderId}";${s};"${n}";${r}`])},["Tilausnumero;Käsitelty;Seurantakoodit;Hinta"]).join("\n"),r=(0,Ee.Yq)(new Date,"short").replace(/\./g,"-").replace(/ /g,"_");(0,Pa.U)(new Blob([n],{type:"text/csv;charset=utf-8"}),`verkkokauppa-com_tilaukset_${r}_sivu${s}.csv`),e.preventDefault()},[i.page,y]),{matches:P,totalItems:E,totalPages:T}=y,N=new URLSearchParams(s.search).get("query")||"",M=Math.max(1,(0,V.YR)(i.page));return g?(0,A.jsxs)(B.mc,{className:e,css:{maxWidth:"100vw"},gutter:"none",children:[(0,A.jsx)(ja,{initialQuery:N,onEmptySubmit:C,onValue:I}),P.length>0?(0,A.jsx)(la.A,{items:P.map(e=>(0,ia.$G)(e,m)),itemsCount:E,listItemType:"orders",loading:h,title:`Tulokset haulle '${N}'`}):!u&&(0,A.jsx)(Ea,{appearance:"alert",children:(0,A.jsx)(B.Eg.Title,{children:"Ei hakutuloksia"})}),P.length>0&&(0,A.jsx)(Ba,{children:(0,A.jsxs)(U.A,{appearance:"secondary",onClick:S,children:[(0,A.jsx)(B.In,{iconName:"FaFileDownload"})," Lataa hakutulossivu CSV:nä"]})}),(0,A.jsx)(xa.A,{hrefPrefix:d(c.JE.search),hrefSuffix:`?query=${encodeURIComponent(N)}`,pageCount:T,pageNo:M,isPathParam:!0}),u&&(0,A.jsx)(Ea,{appearance:"danger",children:(0,A.jsx)(B.Eg.Title,{children:"Hakua suoritettaessa tapahtui odottamaton virhe"})})]}):(0,A.jsx)("div",{className:"view view--is-loading",children:(0,A.jsx)(_.A,{message:"Etsitään tilauksia..."})})};Ta.displayName="OrderSearchView";const Na=(0,N["default"])(Ta).withConfig({componentId:"sc-13kj0eb-1"})({});var Ma=s(49278);const Da=()=>{const{buildPathWithLanguage:e}=(0,o.A)(),{t}=(0,j.A)("orders");return(0,A.jsx)(Ma.A,{name:"orders",tabs:[{href:e(c.JE.main),label:t(e=>e.orderType,{context:"open"}),matchPath:e(c.JE.main)},{href:e(c.JE.list,{type:"unpaid"}),label:t(e=>e.orderType,{context:"unpaid"}),end:!1},{href:e(c.JE.list,{type:"processed"}),label:t(e=>e.orderType,{context:"processed"}),end:!1,matchPath:[e(c.JE.list,{type:"processed"}),e(c.JE.search)]}]})},$a=()=>{const e=(0,i.q)(d.DT);return(0,r.d4)((0,p.Z5)((0,l.bX)(c.tD),e))?(0,A.jsx)(h["default"],{route:c.tD}):(0,A.jsx)(g.A,{})},La=()=>{const e=(0,i.q)(d.DT);return(0,r.d4)((0,p.Z5)((0,l.bX)(c.Fn),e))?(0,A.jsx)(h["default"],{route:c.Fn}):(0,A.jsx)(g.A,{})},Ra=()=>{const{buildPathWithLanguage:e}=(0,o.A)(),t=(0,r.d4)(u.N9),s=(0,m.IO)(t),i=(0,n.useMemo)(()=>e(c.JE.main),[e]);return s?(0,A.jsxs)(a.BV,{children:[(0,A.jsx)(a.qh,{element:(0,A.jsx)(dr,{}),path:c.JE.editErrorPage.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsx)(C,{}),path:c.JE.address.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsx)($a,{}),path:c.JE.shipmentMethods.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsx)(La,{}),path:c.JE.paymentMethods.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsxs)(x.A,{viewPermission:2,children:[(0,A.jsx)(Da,{}),(0,A.jsx)(ua,{})]}),path:c.JE.main.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsxs)(x.A,{viewPermission:2,children:[(0,A.jsx)(Da,{}),(0,A.jsx)(Ca,{})]}),path:c.JE.openList.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsxs)(x.A,{viewPermission:2,children:[(0,A.jsx)(Da,{}),(0,A.jsx)(Ca,{})]}),path:c.JE.list.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsxs)(x.A,{viewPermission:2,children:[(0,A.jsx)(Da,{}),(0,A.jsx)(Na,{})]}),path:c.JE.search.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsx)(na,{}),path:c.JE.editOrder.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsx)(x.A,{viewPermission:2,orderRoute:!0,children:(0,A.jsx)(rr,{})}),path:c.JE.confirmedOrder.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsx)(x.A,{viewPermission:2,orderRoute:!0,children:(0,A.jsx)(Kn,{})}),path:c.JE.viewOrder.fromParent}),(0,A.jsx)(a.qh,{element:(0,A.jsx)(a.C5,{replace:!0,to:i}),path:"*"})]}):(0,A.jsx)(a.C5,{replace:!0,to:`${e(c.Y.customer.main)}?redirect=${c.JE.main.slug}`})}}}]); 2//# sourceMappingURL=/assets/maps/4852.5c92bb4370.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.