@dropins/storefront-order 4.1.1-alpha-20261019104443 → 4.1.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/containers/CreateReturn.js +1 -1
- package/containers/CustomerDetails.js +1 -1
- package/containers/CustomerDetails.js.map +1 -1
- package/containers/OrderCancelForm.js +1 -1
- package/containers/OrderComments.js +1 -1
- package/containers/OrderCostSummary.js +1 -1
- package/containers/OrderHeader.js +1 -1
- package/containers/OrderProductList.js +1 -1
- package/containers/OrderReturns.js +1 -1
- package/containers/OrderSearch.js +1 -1
- package/containers/OrderStatus.js +1 -1
- package/containers/ReturnsList.js +1 -1
- package/containers/ShippingStatus.js +1 -1
- package/package.json +1 -1
- package/render.js +1 -1
- package/render.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{C as n,C as x}from"./CustomerDetails.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-
|
|
3
|
+
import{C as n,C as x}from"./CustomerDetails.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-bundle.js";import"@dropins/tools/preact-bundle.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-bundle.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/preact.js";import"../api.js";import"@dropins/tools/recaptcha.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";export{n as CreateReturn,x as default};
|
|
4
4
|
//# sourceMappingURL=CreateReturn.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{Slot as W,classes as R,debounce as ot,sanitizeHtml as ut}from"@dropins/tools/lib.js";import{Text as F,useText as Z}from"@dropins/tools/i18n.js";import*as L from"@dropins/tools/preact-compat.js";import{useMemo as Ge,memo as ze,useCallback as ge}from"@dropins/tools/preact-compat.js";import{jsx as r,jsxs as f,Fragment as A}from"@dropins/tools/preact-jsx-runtime.js";import{Icon as J,Price as P,Card as U,Header as B,IllustratedMessage as mt,Field as fe,Picker as Ue,Input as ht,InputDate as pt,Checkbox as Be,TextArea as gt,Button as Q,InLineAlert as Ee,Modal as ft,Skeleton as Le,SkeletonRow as $,CartItemSkeleton as ye,Accordion as be,AccordionSection as Ne,Image as he,CartItem as Qe,Incrementer as yt,ContentGrid as xe,Pagination as Ct}from"@dropins/tools/components.js";import{useMemo as oe,useRef as je,useState as x,useEffect as H,useCallback as q}from"@dropins/tools/preact-hooks.js";import{events as G}from"@dropins/tools/event-bus.js";import{createRef as _t,Fragment as Ye}from"@dropins/tools/preact.js";import{r as ae,getStoreConfig as Ot,getAttributesList as Lt,requestReturn as vt,requestGuestReturn as bt,getAttributesForm as Nt,c as xt,t as we,getCustomer as Ve,getGuestOrder as St,getCustomerOrdersReturn as Tt,confirmCancelOrder as Et,confirmGuestReturn as wt,requestGuestOrderCancel as Mt,cancelOrder as Rt,reorderItems as At}from"../api.js";import"@dropins/tools/recaptcha.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";const kt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.00718 5H22.1507C22.7047 5 23.1579 5.45323 23.1579 6.00718V7.51794C23.1579 7.51794 1.01007 7.58844 1 7.55823V6.00718C1 5.45323 1.45323 5 2.00718 5Z",stroke:"currentColor",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M23.1579 9.78409V18.3451C23.1579 18.899 22.7047 19.3523 22.1507 19.3523H2.00718C1.45323 19.3523 1 18.899 1 18.3451V9.78409H23.1579Z",stroke:"currentColor",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M3.01465 15.9682H8.40305",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.6192 17.5897C18.4535 17.5897 19.1299 16.9133 19.1299 16.0789C19.1299 15.2446 18.4535 14.5682 17.6192 14.5682C16.7848 14.5682 16.1084 15.2446 16.1084 16.0789C16.1084 16.9133 16.7848 17.5897 17.6192 17.5897Z",stroke:"currentColor",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8848 17.5897C20.7192 17.5897 21.3956 16.9133 21.3956 16.0789C21.3956 15.2446 20.7192 14.5682 19.8848 14.5682C19.0504 14.5682 18.374 15.2446 18.374 16.0789C18.374 16.9133 19.0504 17.5897 19.8848 17.5897Z",stroke:"currentColor",strokeWidth:1})),It=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),Vt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square",strokeLinejoin:"round"})),Pe=e=>L.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...e},L.createElement("g",{id:"Large"},L.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),L.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},L.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),Pt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square",strokeLinejoin:"round"})),$t=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"currentColor"})),Ht=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{d:"M12.002 21L11.8275 21.4686C11.981 21.5257 12.1528 21.5041 12.2873 21.4106C12.4218 21.3172 12.502 21.1638 12.502 21H12.002ZM3.89502 17.9823H3.39502C3.39502 18.1912 3.52485 18.378 3.72059 18.4509L3.89502 17.9823ZM3.89502 8.06421L4.07193 7.59655C3.91831 7.53844 3.74595 7.55948 3.61082 7.65284C3.47568 7.74619 3.39502 7.89997 3.39502 8.06421H3.89502ZM12.0007 21H11.5007C11.5007 21.1638 11.5809 21.3172 11.7154 21.4106C11.8499 21.5041 12.0216 21.5257 12.1751 21.4686L12.0007 21ZM20.1076 17.9823L20.282 18.4509C20.4778 18.378 20.6076 18.1912 20.6076 17.9823H20.1076ZM20.1076 8.06421H20.6076C20.6076 7.89997 20.527 7.74619 20.3918 7.65284C20.2567 7.55948 20.0843 7.53844 19.9307 7.59655L20.1076 8.06421ZM12.0007 11.1311L11.8238 10.6634C11.6293 10.737 11.5007 10.9232 11.5007 11.1311H12.0007ZM20.2858 8.53191C20.5441 8.43421 20.6743 8.14562 20.5766 7.88734C20.4789 7.62906 20.1903 7.49889 19.932 7.5966L20.2858 8.53191ZM12.002 4.94826L12.1775 4.48008C12.0605 4.43623 11.9314 4.43775 11.8154 4.48436L12.002 4.94826ZM5.87955 6.87106C5.62334 6.97407 5.49915 7.26528 5.60217 7.52149C5.70518 7.77769 5.99639 7.90188 6.2526 7.79887L5.87955 6.87106ZM18.1932 7.80315C18.4518 7.90008 18.74 7.76904 18.8369 7.51047C18.9338 7.2519 18.8028 6.96371 18.5442 6.86678L18.1932 7.80315ZM12 4.94827L11.5879 5.23148C11.6812 5.36719 11.8353 5.44827 12 5.44827C12.1647 5.44827 12.3188 5.36719 12.4121 5.23148L12 4.94827ZM14.0263 2L14.2028 1.53218C13.9875 1.45097 13.7446 1.52717 13.6143 1.71679L14.0263 2ZM21.8421 4.94827L22.2673 5.2113C22.3459 5.08422 22.3636 4.92863 22.3154 4.78717C22.2673 4.64571 22.1584 4.53319 22.0186 4.48045L21.8421 4.94827ZM9.97368 2L10.3857 1.71679C10.2554 1.52717 10.0125 1.45097 9.79721 1.53218L9.97368 2ZM2.15789 4.94827L1.98142 4.48045C1.84161 4.53319 1.73271 4.64571 1.68456 4.78717C1.63641 4.92863 1.65406 5.08422 1.73267 5.2113L2.15789 4.94827ZM12 11.1256L11.6702 11.5014C11.8589 11.667 12.1411 11.667 12.3298 11.5014L12 11.1256ZM15.0395 8.45812L14.8732 7.98659C14.8131 8.00779 14.7576 8.04028 14.7097 8.08232L15.0395 8.45812ZM23 5.65024L23.3288 6.0269C23.5095 5.86916 23.5527 5.60532 23.4318 5.39817C23.3109 5.19102 23.0599 5.09893 22.8337 5.17871L23 5.65024ZM8.96053 8.45812L9.29034 8.08232C9.24244 8.04028 9.18695 8.00779 9.12685 7.98659L8.96053 8.45812ZM1 5.65024L1.16632 5.17871C0.940115 5.09893 0.689119 5.19102 0.568192 5.39817C0.447264 5.60532 0.49048 5.86916 0.671176 6.0269L1 5.65024ZM12.1764 20.5314L4.06945 17.5137L3.72059 18.4509L11.8275 21.4686L12.1764 20.5314ZM4.39502 17.9823V8.06421H3.39502V17.9823H4.39502ZM3.71811 8.53187L11.8251 11.5987L12.1789 10.6634L4.07193 7.59655L3.71811 8.53187ZM11.502 11.1311V21H12.502V11.1311H11.502ZM12.1751 21.4686L20.282 18.4509L19.9332 17.5137L11.8262 20.5314L12.1751 21.4686ZM20.6076 17.9823V8.06421H19.6076V17.9823H20.6076ZM19.9307 7.59655L11.8238 10.6634L12.1776 11.5987L20.2845 8.53187L19.9307 7.59655ZM11.5007 11.1311V21H12.5007V11.1311H11.5007ZM19.932 7.5966L11.8251 10.6634L12.1789 11.5987L20.2858 8.53191L19.932 7.5966ZM11.8154 4.48436L5.87955 6.87106L6.2526 7.79887L12.1885 5.41217L11.8154 4.48436ZM11.8265 5.41645L18.1932 7.80315L18.5442 6.86678L12.1775 4.48008L11.8265 5.41645ZM11.502 4.94826V11.1311H12.502V4.94826H11.502ZM12.4121 5.23148L14.4384 2.28321L13.6143 1.71679L11.5879 4.66507L12.4121 5.23148ZM13.8498 2.46782L21.6656 5.4161L22.0186 4.48045L14.2028 1.53218L13.8498 2.46782ZM21.4169 4.68525L20.5485 6.08919L21.3989 6.61524L22.2673 5.2113L21.4169 4.68525ZM12.4121 4.66507L10.3857 1.71679L9.56162 2.28321L11.5879 5.23148L12.4121 4.66507ZM9.79721 1.53218L1.98142 4.48045L2.33437 5.4161L10.1502 2.46782L9.79721 1.53218ZM1.73267 5.2113L2.60109 6.61524L3.45154 6.08919L2.58312 4.68525L1.73267 5.2113ZM12.3298 11.5014L15.3693 8.83392L14.7097 8.08232L11.6702 10.7498L12.3298 11.5014ZM15.2058 8.92965L23.1663 6.12177L22.8337 5.17871L14.8732 7.98659L15.2058 8.92965ZM22.6712 5.27358L19.7764 7.80067L20.4341 8.554L23.3288 6.0269L22.6712 5.27358ZM12.3298 10.7498L9.29034 8.08232L8.63072 8.83392L11.6702 11.5014L12.3298 10.7498ZM9.12685 7.98659L1.16632 5.17871L0.83368 6.12177L8.79421 8.92965L9.12685 7.98659ZM0.671176 6.0269L3.56591 8.554L4.22356 7.80067L1.32882 5.27358L0.671176 6.0269Z",fill:"currentColor"})),Zt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 12.8571V6.75774C22 6.33761 21.5848 6 21.0884 6H2.91155C2.40614 6 2 6.34511 2 6.75774V12.8571M22 12.8571H2M22 12.8571V17.0049C22 17.5468 21.5939 18 21.0884 18H2.91155C2.41516 18 2 17.5567 2 17.0049V12.8571M5.18182 16.0886L8.64545 12.8229M8.64545 12.8229L12.1087 16.0886M8.64545 12.8229C8.64545 12.8229 8.09964 10.4743 7.56328 9.96857C7.02692 9.46286 6.15419 9.46286 5.61783 9.96857C5.08146 10.4743 5.08146 11.2971 5.61783 11.8029C6.15419 12.3086 8.64545 12.8229 8.64545 12.8229ZM8.64545 12.8229C8.64545 12.8229 11.1542 12.2914 11.6905 11.7857C12.2269 11.28 12.2269 10.4571 11.6905 9.95141C11.1542 9.4457 10.2814 9.4457 9.74507 9.95141C9.2087 10.4571 8.64545 12.8229 8.64545 12.8229ZM8.64506 17.2886V6.70286",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"})),qt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("g",{clipPath:"url(#clip0_4797_15077)"},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.15 20.85L1.5 17.53V6.63L10.15 10V20.85Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.63001L10.15 3.20001L18.8 6.63001L10.15 10L1.5 6.63001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.17969 4.77002L14.8297 8.15002V11.47",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.7896 12.64V6.63L10.1396 10V20.85L14.8296 19.05",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:1}),L.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M15.71 17.26C15.71 15.38 17.23 13.86 19.11 13.86C20.99 13.86 22.51 15.38 22.51 17.26C22.51 19.14 20.99 20.66 19.11 20.66C17.23 20.66 15.71 19.14 15.71 17.26Z",stroke:"currentColor",strokeWidth:1}),L.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M17.4805 17.49L18.5605 18.41L20.7205 16.33",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round",strokeWidth:1})),L.createElement("defs",null,L.createElement("clipPath",{id:"clip0_4797_15077"},L.createElement("rect",{width:22,height:18.65,fill:"white",transform:"translate(1 2.70001)"})))),Wt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.8052 14.4968C10.8552 14.4968 9.9752 14.0268 9.4452 13.2368L9.4152 13.1868L9.3852 13.1268C8.1352 11.2268 7.5352 8.96681 7.6852 6.68681C7.7552 4.42681 9.6052 2.61681 11.8652 2.60681H12.0052C14.2752 2.47681 16.2152 4.21681 16.3452 6.47681C16.3452 6.55681 16.3452 6.62681 16.3452 6.70681C16.4852 8.94681 15.9052 11.1768 14.6852 13.0568L14.6052 13.1768C14.0552 13.9868 13.1352 14.4668 12.1652 14.4768H12.0052C11.9352 14.4768 11.8652 14.4868 11.7952 14.4868L11.8052 14.4968Z",stroke:"currentColor"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M4.3252 21.5469C4.3552 20.4169 4.4752 19.2869 4.6752 18.1769C4.8952 17.1669 6.4752 16.0269 8.9052 15.1569C9.2352 15.0369 9.4852 14.7869 9.5952 14.4569L9.8052 14.0269",stroke:"currentColor"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M14.425 14.4069L14.165 14.1569C14.375 14.5969 14.725 14.9569 15.155 15.1869C16.945 15.7969 19.125 16.9569 19.375 18.2069C19.585 19.3069 19.685 20.4269 19.675 21.5369",stroke:"currentColor"})),Ft=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Gt=e=>L.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("g",{clipPath:"url(#clip0_841_1324)"},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),L.createElement("defs",null,L.createElement("clipPath",{id:"clip0_841_1324"},L.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)",strokeWidth:1})))),zt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"})),Xe=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"}));var ve=(e=>(e.CANCEL="CANCEL",e.RETURN="RETURN",e.REORDER="REORDER",e))(ve||{}),me=(e=>(e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.DROPDOWN="DROPDOWN",e.FILE="FILE",e.GALLERY="GALLERY",e.HIDDEN="HIDDEN",e.IMAGE="IMAGE",e.MEDIA_IMAGE="MEDIA_IMAGE",e.MULTILINE="MULTILINE",e.MULTISELECT="MULTISELECT",e.PRICE="PRICE",e.SELECT="SELECT",e.TEXT="TEXT",e.TEXTAREA="TEXTAREA",e.UNDEFINED="UNDEFINED",e.VISUAL="VISUAL",e.WEIGHT="WEIGHT",e.EMPTY="",e))(me||{}),Ke=(e=>(e.PENDING="pending",e.SHIPPING="shipping",e.COMPLETE="complete",e.PROCESSING="processing",e.HOLD="on hold",e.CANCELED="Canceled",e.SUSPECTED_FRAUD="suspected fraud",e.PAYMENT_REVIEW="payment review",e))(Ke||{});const Je=e=>{if(!e)return null;const n=new FormData(e);if(e.querySelectorAll('input[type="checkbox"]').forEach(t=>{n.has(t.name)||n.set(t.name,"false"),t.checked&&n.set(t.name,"true")}),n&&typeof n.entries=="function"){const t=n.entries();if(t&&typeof t[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(t)))||{}}return{}},Ut={PENDING:"pending",AUTHORIZED:"authorized",PARTIALLY_AUTHORIZED:"partiallyAuthorized",RECEIVED:"received",PARTIALLY_RECEIVED:"partiallyReceived",APPROVED:"approved",PARTIALLY_APPROVED:"partiallyApproved",REJECTED:"rejected",PARTIALLY_REJECTED:"partiallyRejected",DENIED:"denied",PROCESSED_AND_CLOSED:"processedAndClosed",CLOSED:"closed"},De=(e,n)=>({id:`${e.id}_${e.fieldType}_${n+1}`,name:`${e.name}_${e.fieldType}_${n+1}`,code:`${e.code}_${e.fieldType}_${n+1}`,customUpperCode:`${e.customUpperCode}_${e.fieldType}_${n+1}`}),Bt=e=>{const n={};return!e||typeof e!="object"||Object.keys(e).length===0||Object.keys(e).forEach(i=>{if(/_(\d+)$/.exec(i)){const s=i==null?void 0:i.replace(/_\d+$/,"");n[s]=e[i]}else n[i]=e[i]}),n},Qt=(e,n)=>e.map(i=>({...i,...De(i,n)})),jt=(e,n)=>e==null?void 0:e.flatMap(i=>Array.from({length:n},(t,s)=>({...i,...De(i,s)}))),Yt=e=>{const n=[],i=[];return Object.entries(e).forEach(([t,s])=>{const c=t.lastIndexOf("_"),l=t.slice(0,c),d=t.slice(c+1);d===me.MULTISELECT||d===me.SELECT?n.push({attributeCode:l,value:s}):i.push({attributeCode:l,value:s})}),{selectedCustomAttributes:n,enteredCustomAttributes:i}},Se=e=>typeof e!="string"?"":Ut[e]??"",Xt=e=>{var i;const n=[];if(e!=null&&e.current.length)for(const{current:t}of e.current){if(!t)continue;const s=t.name.replace(/_\d+$/,""),c=((i=t==null?void 0:t.dataset)==null?void 0:i.quantity)??1,l=Je(t),d=Bt(l);n.push({orderItemUid:s,quantityToReturn:+c,...Yt(d)})}return n},Kt=e=>{var n;return(n=e==null?void 0:e.items)!=null&&n.length?[...(e==null?void 0:e.items)??[]].sort((i,t)=>{const s=i.quantityShipped-i.quantityReturnRequested===0,c=t.quantityShipped-t.quantityReturnRequested===0;return i.eligibleForReturn&&!t.eligibleForReturn?-1:!i.eligibleForReturn&&t.eligibleForReturn||s&&!c?1:!s&&c?-1:0}):[]},Jt={day:"2-digit",month:"2-digit",year:"numeric"},Dt={year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},Ce=new Map,er=16;function tr(e){let n=Ce.get(e);if(!n){if(Ce.size>=er){const i=Ce.keys().next().value;i!==void 0&&Ce.delete(i)}n=new Intl.DateTimeFormat(e,Dt),Ce.set(e,n)}return n}const et="datetime",_e=(e,n="en-US",i={})=>{const t=new Date(e);if(isNaN(t.getTime()))return"Invalid Date";if(i===et)return tr(n).format(t);const s={...Jt,...i};return new Intl.DateTimeFormat(n,s).format(t)},$e=(e,n)=>{var t;const i=s=>{const c=Array.isArray(s.value)?s.value.join(" "):s==null?void 0:s.value;return s.label?`${s.label}: ${c}`:c};return(t=e[n])==null?void 0:t.map((s,c)=>r("p",{children:i(s)},`${s.value}${c}`))},rr=e=>{var c,l;const n=e&&e.length>0,i=n?(c=e[0])==null?void 0:c.name:"",t=n?(l=e[0])==null?void 0:l.code:"";return{selectedPaymentMethod:i,selectedPaymentMethodCode:t,hasToDisplayPaymentMethod:n&&i!==""}},nr=({loading:e,order:n,withHeader:i=!0,title:t,paymentIconsMap:s={},normalizeAddress:c,translations:l,slots:d})=>{var j,D,Y,k;const p=!!(n!=null&&n.returnNumber),o=!!(n!=null&&n.isVirtual),u=(j=n==null?void 0:n.returns)==null?void 0:j[0],m=oe(()=>({checkmo:Ft,card:kt,...s}),[s]);if(!n||e)return r(kr,{});const g=(n==null?void 0:n.email)??"",a=(D=n==null?void 0:n.shipping)==null?void 0:D.code,C=(Y=n==null?void 0:n.shipping)==null?void 0:Y.amount,h=(k=n==null?void 0:n.shipping)==null?void 0:k.currency,O=n==null?void 0:n.payments,{selectedPaymentMethod:_,selectedPaymentMethodCode:y,hasToDisplayPaymentMethod:E}=rr(O),b=m[y],w=$e(c,"shippingAddress")??[],I=$e(c,"billingAddress")??[],v=f("div",{className:"order-customer-details-content__container-email",children:[r("div",{className:"order-customer-details-content__container-title",children:l==null?void 0:l.emailTitle}),r("p",{children:g})]}),M=p?f("div",{className:"order-customer-details-content__container-return-information","data-testid":"returnDetailsBlock",children:[r("div",{className:"order-customer-details-content__container-title",children:l==null?void 0:l.returnInformationTitle}),r("div",{className:"order-customer-details-content__container-description",children:r(W,{"data-testid":"OrderReturnInformation",name:"OrderReturnInformation",slot:d==null?void 0:d.OrderReturnInformation,context:u,children:f(A,{children:[f("p",{children:[l.createdReturnAt,r("span",{children:_e((u==null?void 0:u.createdReturnAt)??"")})]}),f("p",{children:[l.returnStatusLabel,r(F,{id:`Order.CustomerDetails.returnStatus.${Se((u==null?void 0:u.returnStatus)??"")}`})]}),f("p",{children:[l.orderNumberLabel,r("span",{children:u==null?void 0:u.orderNumber})]})]})})})]}):null,S=!o&&w.length?f("div",{className:"order-customer-details-content__container-shipping_address",children:[r("h3",{className:"order-customer-details-content__container-title",children:l.shippingAddressTitle}),r("div",{className:"order-customer-details-content__container-description",children:w})]}):null,T=I.length?f("div",{className:R(["order-customer-details-content__container-billing_address",["order-customer-details-content__container-billing_address--fullwidth",!w.length||o]]),children:[r("h3",{className:"order-customer-details-content__container-title",children:l.billingAddressTitle}),r("div",{className:"order-customer-details-content__container-description",children:I})]}):null,N=E?f("div",{className:R(["order-customer-details-content__container-payment_methods",["order-customer-details-content__container-payment_methods--fullwidth",!a]]),children:[r("div",{className:"order-customer-details-content__container-title",children:l==null?void 0:l.paymentMethodsTitle}),f("p",{"data-testid":"payment_methods_description",className:R([["order-customer-details-content__container-payment_methods--icon",!!b]]),children:[r(W,{"data-testid":"PaymentMethodIcon",name:"PaymentMethodIcon",slot:d==null?void 0:d.PaymentMethodIcon,context:{selectedPaymentMethodCode:y},children:b?r(J,{source:b}):null}),_]})]}):null,z=a?f("div",{className:"order-customer-details-content__container-shipping_methods",children:[r("div",{className:"order-customer-details-content__container-title",children:l==null?void 0:l.shippingMethodsTitle}),C?f("p",{"data-testid":"shipping_methods_price",children:[r(P,{amount:C,currency:h})," ",a]}):r("p",{"data-testid":"shipping_methods_placeholder",children:l==null?void 0:l.freeShipping})]}):null,ce=p?M:f(A,{children:[T,z,N]});return f(U,{"data-testid":"order-details",variant:"secondary",className:R(["order-customer-details-content"]),children:[i?r(B,{title:t??(l==null?void 0:l.headerText),level:2}):null,f("div",{className:R(["order-customer-details-content__container",["order-customer-details-content__container--no-margin",w.length||I.length]]),children:[v,S,ce]})]})},He=({typeList:e,isEmpty:n,minifiedView:i,message:t})=>{const s=Ge(()=>{switch(e){case"orders":return{icon:Ht,text:r("p",{children:t}),className:"order-empty-list--empty-box"};default:return{icon:"",text:"",className:""}}},[e,t]);return!n||!e||!s.text?null:r(mt,{className:R(["order-empty-list",s.className,i?"order-empty-list--minified":""]),message:s.text,icon:r(J,{source:s.icon}),"data-testid":"emptyList"})},ir=e=>e.reduce((n,{code:i,required:t,defaultValue:s})=>(t&&(n[i]=s),n),{}),tt=({fieldsConfig:e,onSubmit:n})=>{const{requiredFieldError:i}=Z({requiredFieldError:"Order.Form.notifications.requiredFieldError"}),t=je(null),[s,c]=x({}),[l,d]=x({});H(()=>{if(c({}),!e||!e.length)return;const g=ir(e);c(g)},[e==null?void 0:e.length]),H(()=>()=>{var g;c({}),(g=t.current)==null||g.reset()},[]);const p=q((g,a)=>{const C=e.find(O=>O.code===g);return C!=null&&C.required&&!a?i:""},[e,i]),o=q(g=>{const{name:a,value:C,type:h,checked:O}=g==null?void 0:g.target,_=h==="checkbox"?O:C;c(y=>({...y,[a]:_}))},[]),u=q(g=>{const{name:a,value:C,type:h,checked:O}=g==null?void 0:g.target,_=h==="checkbox"?O:C;d(y=>({...y,[a]:p(a,_)}))},[p]),m=q(g=>{g.preventDefault();let a=!0;const C={};let h=null;for(const[O,_]of Object.entries(s)){const y=p(O,_);y&&(C[O]=y,a=!1,h||(h=O))}if(d(C),h&&t.current){const O=t.current.elements.namedItem(h);O==null||O.focus()}n==null||n(g,a)},[s,p,n]);return{formData:s,errors:l,formRef:t,handleChange:o,handleBlur:u,handleSubmit:m}},ar={email:"email",lastname:"family-name"},rt=ze(({loading:e,values:n,fields:i=[],errors:t,className:s="",onChange:c,onBlur:l})=>{const d=`${s}__item`,p=ge((a,C,h)=>{const O=a.options.map(_=>({text:_.label,value:_.value}));return r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(Ue,{name:a.id,floatingLabel:`${a.label} ${a.required?"*":""}`,placeholder:a.label,"aria-label":a.label,options:O,onBlur:l,handleSelect:c,value:C||a.defaultValue})},a.id)},[s,e,d,l,c]),o=ge((a,C,h)=>{const _=a.id==="email"?r(Wt,{}):void 0,y=ar[a.id]??"";return r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a==null?void 0:a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(ht,{"aria-label":a.label,"aria-required":a.required,autoComplete:y,icon:_,type:"text",name:a.id,value:C||a.defaultValue,placeholder:a.label,floatingLabel:`${a.label} ${a.required?"*":""}`,onBlur:l,onChange:c})},a.id)},[s,e,d,l,c]),u=ge((a,C,h)=>r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(pt,{type:"text",name:a.id,value:C||a.defaultValue,placeholder:a.label,floatingLabel:`${a.label} ${a.required?"*":""}`,onBlur:l,onChange:c})},a.id),[s,e,d,l,c]),m=ge((a,C,h)=>r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(Be,{name:a.id,checked:C||a.defaultValue,placeholder:a.label,label:`${a.label} ${a.required?"*":""}`,onBlur:l,onChange:c})},a.id),[s,e,d,l,c]),g=ge((a,C,h)=>r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(gt,{type:"text",name:a.id,value:C===void 0?a.defaultValue:C,label:`${a.label} ${a.required?"*":""}`,onBlur:l,onChange:c})},a.id),[s,e,d,l,c]);return i.length?r(A,{children:i.map(a=>{var O;const C=(t==null?void 0:t[a.id])??"",h=(n==null?void 0:n[a.id])??"";switch(a.fieldType){case"TEXT":return(O=a==null?void 0:a.options)!=null&&O.length?p(a,h,C):o(a,h,C);case"MULTILINE":return o(a,h,C);case"SELECT":return p(a,h,C);case"DATE":return u(a,h,C);case"BOOLEAN":return m(a,h,C);case"TEXTAREA":return g(a,h,C);default:return null}})}):null}),nt=ze(({name:e,loading:n,children:i,className:t="defaultForm",fieldsConfig:s,onSubmit:c})=>{const{formData:l,errors:d,formRef:p,handleChange:o,handleBlur:u,handleSubmit:m}=tt({fieldsConfig:s,onSubmit:c});return f("form",{className:R(["order-form",t]),onSubmit:m,name:e,ref:p,children:[r(rt,{className:t,loading:n,fields:s,onChange:o,onBlur:u,errors:d,values:l}),i]})}),sr=({className:e,orderData:n,slots:i,routeCreateReturn:t,routeOnSuccess:s,onError:c})=>{const l=Z({cancel:"Order.OrderStatusContent.actions.cancel",createReturn:"Order.OrderStatusContent.actions.createReturn",createAnotherReturn:"Order.OrderStatusContent.actions.createAnotherReturn",reorder:"Order.OrderStatusContent.actions.reorder"}),d=Ge(()=>{const p=n==null?void 0:n.availableActions,o=!!(p!=null&&p.length),u=!!(n!=null&&n.returnNumber),m=()=>{ae(t,{},n)};return r(A,{children:i!=null&&i.OrderActions?r(W,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:i==null?void 0:i.OrderActions,context:n}):r("div",{"data-testid":"availableActionsList",className:R(["order-order-actions__wrapper",["order-order-actions__wrapper--empty",!o]]),children:p==null?void 0:p.map(g=>{switch(g){case ve.CANCEL:return r(A,{children:u?null:r(Ar,{orderRef:(n==null?void 0:n.token)||(n==null?void 0:n.id)||""})});case ve.RETURN:return r(Q,{variant:"secondary",onClick:m,children:u?l.createAnotherReturn:l.createReturn});case ve.REORDER:return r(A,{children:u?null:r(Xr,{orderData:n,onError:c,routeOnSuccess:s,children:l.reorder})})}})})})},[c,n,s,t,i,l]);return r("div",{className:R(["order-order-actions",e]),children:d})},se=()=>{const[e,n]=x(null);return H(()=>{var s;const i="orderStoreConfigPromise",t=sessionStorage.getItem("orderStoreConfig");if(t){const c=JSON.parse(t);n(c)}else{const c=window;c[i]||(c[i]=Ot().then(l=>(l&&sessionStorage.setItem("orderStoreConfig",JSON.stringify(l)),l))),(s=c[i])==null||s.then(l=>{l&&n(l)})}},[]),e},Te=(e,n)=>{try{return new URL(n??window.location.href).searchParams.get(e)??""}catch{return""}},cr=({onSuccess:e,onError:n,handleSetInLineAlert:i,orderData:t})=>{const[s,c]=x(!1),[l,d]=x({id:"",email:"",...t}),[p,o]=x("products"),[u,m]=x(!0),[g,a]=x([]),[C,h]=x([]),[O,_]=x([]),y=je([]);y.current.length!==g.length&&(y.current=g.map((v,M)=>y.current[M]||_t())),H(()=>{const v=G.on("order/data",M=>{var T;d(M);const S=Kt(M);_(S),c(((T=Te("orderRef"))==null?void 0:T.length)>20),m(!1)},{eager:!0});return()=>{v==null||v.off()}},[]),H(()=>{Lt("RMA_ITEM").then(v=>{v!=null&&v.length&&(h(v),m(!1))})},[]);const E=q(v=>{a(M=>M.findIndex(T=>(T==null?void 0:T.productSku)===(v==null?void 0:v.productSku))>-1?M.filter(T=>(T==null?void 0:T.productSku)!==(v==null?void 0:v.productSku)):[...M,v])},[]),b=q(v=>{o(v),i(),v==="products"&&a([])},[i]),w=q((v,M)=>{const S=g.map(T=>T.productSku===M?{...T,currentReturnOrderQuantity:v}:T);a(S)},[g]),I=q(async(v,M)=>{if(!M)return;m(!0);const S={orderUid:l.id,contactEmail:l.email},T=Xt(y);s?bt({token:Te("orderRef"),contactEmail:S.contactEmail,items:T,commentText:"."}).then(N=>{e==null||e(N),b("success"),i()}).catch(N=>{n==null||n(N.message),i({type:"error",heading:N.message})}):vt({...S,items:T}).then(N=>{e==null||e(N),b("success"),i()}).catch(N=>{n==null||n(N.message),i({type:"error",heading:N.message})}),m(!1)},[b,n,e,i,l,s]);return{order:l,steps:p,loading:u,formsRef:y,attributesList:C,selectedProductList:g,itemsEligibleForReturn:O,handleSelectedProductList:E,handleSetQuantity:w,handleChangeStep:b,onSubmit:I}},lr=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],dr=({orderData:e})=>{const[n,i]=x(!0),[t,s]=x(e),[c,l]=x([]);H(()=>{const o=G.on("order/data",u=>{s(u)},{eager:!0});return()=>{o==null||o.off()}},[]),H(()=>{Nt("shortRequest").then(o=>{if(o){const u=o.map(({name:m,orderNumber:g,label:a})=>({name:xt(m),orderNumber:g,label:lr.includes(m)?null:a}));l(u)}}).finally(()=>{i(!1)})},[]);const d=q(o=>{if(!c.length||!t||!t[o])return[];const u=t[o]?Object.fromEntries(Object.entries(t[o]).map(([m,g])=>[m.toLowerCase(),g])):{};return c.filter(({name:m})=>u[m.toLowerCase()]).map(m=>({name:m.name,orderNumber:m.orderNumber,value:u[m.name.toLowerCase()],label:m.label}))},[c,t]),p=oe(()=>({billingAddress:d("billingAddress"),shippingAddress:d("shippingAddress")}),[d]);return{order:t,normalizeAddress:p,loading:n}},de=e=>{let n=!1,i=!1;switch(e){case 1:i=!0;break;case 2:n=!0;break;case 3:n=!0,i=!0;break;default:n=!1,i=!1}return{taxIncluded:n,taxExcluded:i}},or=({orderData:e,config:n})=>{const[i,t]=x(!0),[s,c]=x(e),[l,d]=x(null);return H(()=>{if(n){const{shoppingOrderDisplayPrice:p,shoppingOrdersDisplayShipping:o,shoppingOrdersDisplaySubtotal:u,...m}=n;d(g=>({...g,...m,shoppingOrderDisplayPrice:de(p),shoppingOrdersDisplayShipping:de(o),shoppingOrdersDisplaySubtotal:de(u),salesPrintedCard:de(n.salesPrintedCard),salesGiftWrapping:de(n.salesGiftWrapping)})),t(!1)}},[n]),H(()=>{const p=G.on("order/data",o=>{c(o)},{eager:!0});return()=>{p==null||p.off()}},[]),{loading:i,storeConfig:l,order:s}},ur=({orderData:e,handleEmailAvailability:n,handleSignUpClick:i})=>{const[t,s]=x(e),[c,l]=x(),[d,p]=x(n?void 0:!0),o=t==null?void 0:t.email,m=i&&t!==void 0&&c===!1&&d===!0?()=>{const g=t.shippingAddress,a=t.billingAddress,C=[{code:"email",defaultValue:t.email},{code:"firstname",defaultValue:(a==null?void 0:a.firstName)??""},{code:"lastname",defaultValue:(a==null?void 0:a.lastName)??""}];let h=[];if(g){const O={...we(g),default_shipping:!0};h=[{...we(a),default_billing:!0},O]}else h=[{...we(a),default_billing:!0,default_shipping:!0}];i({inputsDefaultValueSet:C,addressesData:h})}:void 0;return H(()=>{const g=G.on("authenticated",a=>{l(a)},{eager:!0});return()=>{g==null||g.off()}},[]),H(()=>{const g=G.on("order/data",a=>{s(a)},{eager:!0});return()=>{g==null||g.off()}},[]),H(()=>{n&&c!==void 0&&(c||!o||n(o).then(g=>p(g)).catch(()=>p(!0)))},[c,n,o]),{order:t,onSignUpClickHandler:m}},mr=({orderData:e})=>{const[n,i]=x(e??null),[t,s]=x((e==null?void 0:e.comments)??[]);return H(()=>{const c=G.on("order/data",l=>{i(l),s((l==null?void 0:l.comments)??[])},{eager:!0});return()=>{c==null||c.off()}},[]),{comments:t,order:n}},hr=({orderData:e})=>{const[n,i]=x(!0),[t,s]=x(e);return H(()=>{const c=G.on("order/data",l=>{s(l),i(!1)},{eager:!0});return()=>{c==null||c.off()}},[]),{loading:n,order:t}},pr=({onError:e,isAuth:n,renderSignIn:i,routeCustomerOrder:t,routeGuestOrder:s})=>{const[c,l]=x({text:"",type:"success"}),[d,p]=x(!1),o=Z({invalidSearch:"Order.Errors.invalidSearch",email:"Order.OrderSearchForm.email",lastname:"Order.OrderSearchForm.lastname",number:"Order.OrderSearchForm.orderNumber"}),u=q(async a=>{const C=Te("orderRef"),h=C&&C.length>20;if(!a&&!C||!(a!=null&&a.number)&&!(a!=null&&a.token)&&!C)return null;if(n){const _=await Ve();(_==null?void 0:_.email)===a.email?ae(t,{orderRef:a==null?void 0:a.number}):h||ae(s,{orderRef:a.token})}else h||ae(s,{orderRef:(a==null?void 0:a.token)??""})},[n,t,s]);H(()=>{const a=G.on("order/data",C=>{u(C)},{eager:!0});return()=>{a==null||a.off()}},[u]),H(()=>{const a=Te("orderRef"),C=a&&a.length>20?a:null;a&&(C?ae(s,{orderRef:a}):n?ae(t,{orderRef:a}):i==null||i({render:!0,formValues:{number:a}}))},[n,t,s,i]);const m=oe(()=>[{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:o.email,options:[],defaultValue:"",fieldType:me.TEXT,className:"",required:!0,orderNumber:1,name:"email",id:"email",code:"email",isUnique:!1},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:o.lastname,options:[],defaultValue:"",fieldType:me.TEXT,className:"",required:!0,orderNumber:2,name:"lastname",id:"lastname",code:"lastname",isUnique:!1},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:o.number,options:[],defaultValue:"",fieldType:me.TEXT,className:"",required:!0,orderNumber:3,name:"number",id:"number",code:"number",isUnique:!1}],[o]);return{onSubmit:q(async(a,C)=>{if(!C)return null;p(!0);const h=Je(a.target);await St(h).then(O=>{O||l({text:o.invalidSearch,type:"warning"}),G.emit("order/data",O)}).catch(async O=>{var b;let _=!0;e==null||e({error:O.message});const y=n?await Ve():{email:""};if((y==null?void 0:y.email)===(h==null?void 0:h.email)){ae(t,{orderRef:h.number});return}_=i==null?void 0:i({render:y===null||((b=O==null?void 0:O.message)==null?void 0:b.includes("Please login to view the order.")),formValues:h}),_&&l({text:O.message,type:"warning"})}).finally(()=>{p(!1)})},[n,e,i,t,o.invalidSearch]),inLineAlert:c,loading:d,normalizeFieldsConfig:m}},gr=({orderData:e})=>{const[n,i]=x(e),[t,s]=x(e==null?void 0:e.status);return H(()=>{const c=G.on("order/data",l=>{i(l),s(l.status)},{eager:!0});return()=>{c==null||c.off()}},[]),{orderStatus:t,order:n}},Ze={totalPages:1,currentPage:1,pageSize:1},fr=({returnPageSize:e})=>{const[n,i]=x(!0),[t,s]=x([]),[c,l]=x(Ze),[d,p]=x(1);H(()=>{Tt(e,d).then(u=>{s((u==null?void 0:u.ordersReturn)??[]),l((u==null?void 0:u.pageInfo)??Ze)}).finally(()=>{i(!1)})},[e,d]),H(()=>{((window==null?void 0:window.scrollY)??0)>0&&(window==null||window.scrollTo({top:100,behavior:"smooth"}))},[d]);const o=q(u=>{p(u)},[]);return{pageInfo:c,selectedPage:d,loading:n,orderReturns:t,handleSetSelectPage:o}},yr=({orderData:e})=>{const[n,i]=x(!0),[t,s]=x(e),[c,l]=x(!1);return H(()=>{const d=G.on("order/data",p=>{s(p),l(p==null?void 0:p.isVirtual),i(!1)},{eager:!0});return e!=null&&e.id&&i(!1),()=>{d==null||d.off()}},[e]),{loading:n,order:t,isVirtualProduct:c}},qe=e=>{const n=new URL(window.location.href);e.forEach(i=>{n.searchParams.has(i)&&n.searchParams.delete(i)}),window.history.replaceState({},document.title,n.toString())},Cr=({enableOrderCancellation:e})=>{const n=Z({cancelOrderHeading:"Order.OrderStatusContent.actions.cancel",confirmGuestReturnHeading:"Order.OrderStatusContent.actions.confirmGuestReturn",orderCancelled:"Order.OrderStatusContent.orderCanceled.message",guestRequestReturnMessage:"Order.OrderStatusContent.actions.confirmGuestReturnMessage"}),[i,t]=x(!1),[s,c]=x(!1),[l,d]=x({heading:"",text:"",status:void 0}),p=q(()=>{t(!0),qe(["order_id","confirmation_key","action"])},[]),o=q((u,m,g)=>{d({heading:u,text:m,status:g}),qe(["action"])},[]);return H(()=>{const u=new URLSearchParams(window.location.search),m=u.get("order_id")??"",g=u.get("confirmation_key")??"",a=u.get("action")??"";s||!m||!g||!a||(e&&a==="cancel"&&(c(!0),Et(m,g).then(()=>{d({heading:n.cancelOrderHeading,text:n.orderCancelled,status:"success"})}).catch(C=>{d({heading:n.cancelOrderHeading,text:C.message,status:"warning"})})),a==="return"&&(c(!0),wt(m,g).then(()=>{d({heading:n.confirmGuestReturnHeading,text:n.guestRequestReturnMessage,status:"success"})}).catch(C=>{d({heading:n.confirmGuestReturnHeading,text:C.message,status:"warning"})})))},[e,n,o,s]),{orderActionStatus:l,isDismissed:i,onDismiss:p}},_r={success:It,warning:Gt,error:Xe},Or=()=>{const[e,n]=x({type:"success",heading:""}),i=q(t=>{if(!(t!=null&&t.type)){n({type:"success",heading:""});return}const s=r(J,{source:_r[t.type]});n({...t,icon:s})},[]);return{inLineAlertProps:e,handleSetInLineAlert:i}},ke=()=>{const[e,n]=x(window.innerWidth<768),i=q(ot(()=>{n(window.innerWidth<768)},1e3),[]);return H(()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}),[i]),e},Lr=({paymentIconsMap:e,orderData:n,title:i,className:t,slots:s})=>{const c=Z({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",paymentMethodsTitle:"Order.CustomerDetails.paymentMethods.title",returnInformationTitle:"Order.CustomerDetails.returnInformation.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping",createdReturnAt:"Order.CustomerDetails.orderReturnLabels.createdReturnAt",orderNumberLabel:"Order.CustomerDetails.orderReturnLabels.orderNumberLabel",returnStatusLabel:"Order.CustomerDetails.orderReturnLabels.returnStatusLabel"}),{order:l,normalizeAddress:d,loading:p}=dr({orderData:n});return r("div",{className:R(["order-customer-details",t]),children:r(nr,{slots:s,loading:p,order:l,title:i,paymentIconsMap:e,normalizeAddress:d,translations:c})})};Lr.displayName="CustomerDetails";const it=({orderRef:e,pickerProps:n,submitButtonProps:i,cancelReasons:t})=>{const s=Z({ErrorHeading:"Order.OrderCancelForm.errorHeading",ErrorDescription:"Order.OrderCancelForm.errorDescription",orderCancellationLabel:"Order.OrderCancelForm.label"}),[c,l]=x(0),[d,p]=x(!1),[o,u]=x(!1);G.on("authenticated",a=>{a&&u(!0)},{eager:!0});const m=a=>{a.preventDefault();const C=Number(a.target.value);l(C)};return f(nt,{onSubmit:async a=>(a.preventDefault(),(e.length>20?Mt:Rt)(e,t[c].text,h=>{o||(h.status="guest order cancellation requested"),G.emit("order/data",h)},()=>{p(!0)})),"data-testid":"order-order-cancel-reasons-form__text",children:[d&&r(Ee,{heading:s.ErrorHeading,description:s.ErrorDescription}),r("div",{className:"order-order-cancel-reasons-form__text",children:r(F,{id:"Order.OrderCancelForm.description"})}),r(Ue,{name:"cancellationReasons",floatingLabel:s.orderCancellationLabel,defaultOption:t[0],variant:"primary",options:t,value:String(c),handleSelect:m,required:!0,"data-testid":"order-cancellation-reasons-selector",...n}),r("div",{className:"order-order-cancel-reasons-form__button-container",children:r(Q,{variant:"primary","data-testid":"order-cancel-submit-button",...i,children:r(F,{id:"Order.OrderCancelForm.button"})})})]})};it.displayName="OrderCancelForm";const vr=({withHeader:e,orderData:n,children:i,className:t,...s})=>{const c=se(),{loading:l,storeConfig:d,order:p}=or({orderData:n,config:c}),o=Z({subtotal:"Order.OrderCostSummary.subtotal.title",shipping:"Order.OrderCostSummary.shipping.title",freeShipping:"Order.OrderCostSummary.shipping.freeShipping",tax:"Order.OrderCostSummary.tax.title",incl:"Order.OrderCostSummary.tax.incl",excl:"Order.OrderCostSummary.tax.excl",discount:"Order.OrderCostSummary.discount.title",discountSubtitle:"Order.OrderCostSummary.discount.subtitle",total:"Order.OrderCostSummary.total.title",totalFree:"Order.OrderCostSummary.totalFree",accordionTitle:"Order.OrderCostSummary.tax.accordionTitle",accordionTotalTax:"Order.OrderCostSummary.tax.accordionTotalTax",totalExcludingTaxes:"Order.OrderCostSummary.tax.totalExcludingTaxes",headerText:"Order.OrderCostSummary.headerText",printedCardTitle:"Order.OrderCostSummary.giftOptionsTax.printedCard.title",printedCardTitleInclTax:"Order.OrderCostSummary.giftOptionsTax.printedCard.inclTax",printedCardTitleExclTax:"Order.OrderCostSummary.giftOptionsTax.printedCard.exclTax",itemGiftWrappingTitle:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.title",itemGiftWrappingInclTax:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.inclTax",itemGiftWrappingExclTax:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.exclTax",orderGiftWrappingTitle:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.title",orderGiftWrappingInclTax:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.inclTax",orderGiftWrappingExclTax:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.exclTax"});return r("div",{...s,className:R(["order-cost-summary",t]),children:r(Fr,{order:p,withHeader:e,loading:l,storeConfig:d,translations:o})})};vr.displayName="OrderCostSummary";const br=e=>{var t;const{order:n,onSignUpClickHandler:i}=ur(e);return r("div",{children:n?r(Gr,{customerName:(t=n.billingAddress)==null?void 0:t.firstName,onSignUpClick:i,orderNumber:n.number}):r(Ir,{})})};br.displayName="OrderHeader";const Nr=({slots:e,className:n,orderData:i,withHeader:t,showConfigurableOptions:s,routeProductDetails:c})=>{const l=se(),{loading:d,order:p}=hr({orderData:i});return r("div",{className:R(["order-order-product-list",n]),children:r(Ur,{slots:e,loading:d,placeholderImage:(l==null?void 0:l.baseMediaUrl)??"",taxConfig:de((l==null?void 0:l.shoppingOrderDisplayPrice)??0),order:p,withHeader:t,showConfigurableOptions:s,routeProductDetails:c})})};Nr.displayName="OrderProductList";const xr=({orderData:e})=>{const[n,i]=x(e),[t,s]=x([]);return H(()=>{const c=G.on("order/data",l=>{i(l),s(l==null?void 0:l.returns)},{eager:!0});return()=>{c==null||c.off()}},[]),{order:n,orderReturns:t}},Sr=({slots:e,className:n,orderData:i,withHeader:t,withThumbnails:s,routeReturnDetails:c,routeProductDetails:l,routeTracking:d})=>{const p=se(),{orderReturns:o}=xr({orderData:i}),u=ke(),m="fullSizeView",g=(p==null?void 0:p.baseMediaUrl)??"",a=Z({minifiedViewTitle:`Order.Returns.${m}.returnsList.minifiedViewTitle`,ariaLabelLink:`Order.Returns.${m}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${m}.returnsList.emptyOrdersListMessage`,orderNumber:`Order.Returns.${m}.returnsList.orderNumber`,returnNumber:`Order.Returns.${m}.returnsList.returnNumber`,carrier:`Order.Returns.${m}.returnsList.carrier`});return r("div",{className:R(["order-order-returns",n]),children:o.length?r(dt,{placeholderImage:g,pageInfo:{pageSize:1,totalPages:1,currentPage:1},minifiedViewKey:m,slots:e,isMobile:u,withOrderNumber:!1,withReturnNumber:!0,orderReturns:o,translations:a,withHeader:t,withThumbnails:s,minifiedView:!1,routeReturnDetails:c,routeProductDetails:l,routeTracking:d,loading:!1}):null})};Sr.displayName="OrderReturns";const Tr=({className:e,isAuth:n,renderSignIn:i,routeCustomerOrder:t,routeGuestOrder:s,onError:c})=>{const{onSubmit:l,loading:d,inLineAlert:p,normalizeFieldsConfig:o}=pr({onError:c,isAuth:n,renderSignIn:i,routeCustomerOrder:t,routeGuestOrder:s});return r("div",{className:R(["order-order-search",e]),children:r(jr,{onSubmit:l,loading:d,inLineAlert:p,fieldsConfig:o})})};Tr.displayName="OrderSearch";const Er=({slots:e,orderData:n,className:i,statusTitle:t,status:s,routeCreateReturn:c,onError:l,routeOnSuccess:d})=>{const{orderStatus:p,order:o}=gr({orderData:n}),u=se(),{orderActionStatus:m,isDismissed:g,onDismiss:a}=Cr({enableOrderCancellation:u==null?void 0:u.orderCancellationEnabled});return f("div",{className:R(["order-order-status",i]),children:[!g&&(m==null?void 0:m.status)!==void 0?r(Ee,{style:{marginBottom:"1rem"},heading:m.heading,onDismiss:a,description:m.text,type:m.status}):null,o?r(Yr,{title:t,status:s||p,slots:e,orderData:o,routeCreateReturn:c,onError:l,routeOnSuccess:d}):r(Oe,{withCard:!1})]})};Er.displayName="OrderStatus";const wr=({slots:e,withReturnsListButton:n,className:i,minifiedView:t,withHeader:s,withThumbnails:c,returnPageSize:l,returnsInMinifiedView:d,routeReturnDetails:p,routeOrderDetails:o,routeTracking:u,routeReturnsList:m,routeProductDetails:g})=>{const a=se(),{pageInfo:C,selectedPage:h,handleSetSelectPage:O,loading:_,orderReturns:y}=fr({returnPageSize:l}),E=ke(),b=t?"minifiedView":"fullSizeView",w=Z({viewAllOrdersButton:`Order.Returns.${b}.returnsList.viewAllOrdersButton`,ariaLabelLink:`Order.Returns.${b}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${b}.returnsList.emptyOrdersListMessage`,minifiedViewTitle:`Order.Returns.${b}.returnsList.minifiedViewTitle`,orderNumber:`Order.Returns.${b}.returnsList.orderNumber`,returnNumber:`Order.Returns.${b}.returnsList.returnNumber`,carrier:`Order.Returns.${b}.returnsList.carrier`});return r("div",{className:R(["order-returns-list",i]),children:r(dt,{placeholderImage:(a==null?void 0:a.baseMediaUrl)??"",minifiedViewKey:b,withOrderNumber:!0,withReturnNumber:!0,slots:e,selectedPage:h,handleSetSelectPage:O,pageInfo:C,withReturnsListButton:n,isMobile:E,orderReturns:y,translations:w,withHeader:s,returnsInMinifiedView:d,withThumbnails:c,minifiedView:t,routeReturnDetails:p,routeOrderDetails:o,routeTracking:u,routeReturnsList:m,routeProductDetails:g,loading:_})})};wr.displayName="ReturnsList";const Mr=({slots:e,className:n,collapseThreshold:i,orderData:t,routeOrderDetails:s,routeTracking:c,routeProductDetails:l})=>{const{loading:d,order:p,isVirtualProduct:o}=yr({orderData:t}),u=se(),m=Z({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",returnOrderCardTitle:"Order.ShippingStatusCard.returnOrderCardTitle",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",noInfoTitle:"Order.ShippingStatusCard.noInfoTitle",returnNumber:"Order.ShippingStatusCard.returnNumber",shipmentNumber:"Order.ShippingStatusCard.shipmentNumber",orderNumber:"Order.ShippingStatusCard.orderNumber",trackButton:"Order.ShippingStatusCard.trackButton"});if(!d&&o)return null;const g=(u==null?void 0:u.baseMediaUrl)??"";return r("div",{className:R(["order-shipping-status",n]),children:!d&&p?r(tn,{placeholderImage:g,translations:m,routeOrderDetails:s,routeTracking:c,slots:e,orderData:p,collapseThreshold:i,routeProductDetails:l}):r(Oe,{withCard:!1})})};Mr.displayName="ShippingStatus";const Rr=({orderData:e,className:n,...i})=>{const{comments:t,order:s}=mr({orderData:e});return s?r("div",{...i,className:R(["order-order-comments-container",n]),children:r(an,{comments:t})}):r("div",{className:R(["order-order-comments-container",n]),children:r(Oe,{withCard:!1})})};Rr.displayName="OrderComments";const Ar=({orderRef:e})=>{const[n,i]=x(!1),t=()=>{i(!0)},s=()=>{i(!1)},c=se(),l=(c==null?void 0:c.orderCancellationReasons)??[],d=p=>p.map((o,u)=>({text:o==null?void 0:o.description,value:u.toString()}));return G.on("order/data",p=>{const o=String((p==null?void 0:p.status)??"").toLocaleLowerCase();(o==="guest order cancellation requested"||o==="canceled")&&s()}),f(A,{children:[r(Q,{variant:"secondary",onClick:t,"data-testid":"cancel-button",children:r(F,{id:"Order.OrderStatusContent.actions.cancel"})}),n&&r(ft,{centered:!0,size:"medium",onClose:s,className:"order-order-cancel__modal",title:r("h2",{className:"order-order-cancel__title",children:r(F,{id:"Order.OrderCancelForm.title"})}),"data-testid":"order-cancellation-reasons-modal",children:r(it,{orderRef:e,cancelReasons:d(l)})})]})},Oe=({testId:e,withCard:n=!0})=>{const i=f(Le,{"data-testid":e??"skeletonLoader",children:[r($,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),r($,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),r($,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1})]});return n?i:r(U,{variant:"secondary",className:R(["order-order-loaders","order-order-loaders--card-loader"]),children:i})},kr=e=>r(U,{variant:"secondary",...e,children:f(Le,{"data-testid":"order-details-skeleton",children:[r($,{variant:"heading",size:"medium",fullWidth:!0}),r($,{size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{size:"xlarge"}),r($,{size:"xlarge"}),r($,{size:"xlarge"}),r($,{size:"xlarge"})]})}),at=()=>f(Le,{"data-testid":"order-product-list-skeleton",style:{gridTemplateColumns:"1fr"},children:[r($,{variant:"heading",fullWidth:!0,size:"medium"}),r(ye,{}),r(ye,{}),r(ye,{}),r(ye,{}),r(ye,{})]}),st=()=>f(Le,{"data-testid":"order-cost-summary-content-skeleton",className:"order-cost-summary-content",children:[r($,{variant:"heading",size:"small"}),r($,{variant:"empty",size:"small"}),r($,{variant:"empty",size:"small"}),r($,{variant:"empty",size:"small"}),r($,{variant:"heading",size:"small",fullWidth:!0,lines:3})]}),Ir=()=>f(Le,{"data-testid":"order-header-skeleton",className:"order-header",children:[r($,{variant:"empty",size:"xlarge",fullWidth:!0}),r($,{variant:"empty",size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{size:"small",fullWidth:!0}),r($,{variant:"heading",size:"xsmall",fullWidth:!0})]}),We=({salesGiftWrapping:e,giftWrappingPrice:n,giftWrappingPriceInclTax:i,giftWrappingTitle:t,giftWrappingExclTaxText:s,giftWrappingInclTaxText:c})=>{const l=e==null?void 0:e.taxIncluded,d=e==null?void 0:e.taxExcluded,p=l&&!d,o=d&&!l,u=d&&l;if(n.value===0||i.value===0)return null;const m=p?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:c}),r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:i.currency,amount:i.value})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:r("span",{children:c})})]}):null,g=o?f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:t}),r("span",{children:r(P,{weight:"normal",currency:n.currency,amount:n.value})})]}):null,a=u?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:t}),r("span",{children:r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:i.currency,amount:i.value})})]}),f("div",{className:"order-cost-summary-content__description--subheader",children:[r(P,{currency:n.currency,amount:n.value,size:"small",weight:"bold"})," ",r("span",{children:s})]})]}):null;return f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--gift-wrapping",children:[m,g,a]})},Vr=({translations:e,order:n,salesPrintedCard:i})=>{const t=n==null?void 0:n.totalGiftOptions,{printedCard:s,printedCardInclTax:c}=t,l=i==null?void 0:i.taxIncluded,d=i==null?void 0:i.taxExcluded;if(s.value===0||c.value===0)return null;const p=l&&!d?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.printedCardTitle}),r("span",{children:r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:c.currency,amount:c.value})})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:r("span",{children:r("span",{children:e.printedCardTitleInclTax})})})]}):null,o=d&&!l?f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.printedCardTitle}),r("span",{children:r(P,{weight:"normal",currency:s.currency,amount:s.value})})]}):null,u=d&&l?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.printedCardTitle}),r("span",{children:r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:c.currency,amount:c.value})})]}),f("div",{className:"order-cost-summary-content__description--subheader",children:[r(P,{currency:s.currency,amount:s.value,size:"small",weight:"bold"})," ",r("span",{children:e.printedCardTitleExclTax})]})]}):null;return f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--printed-card",children:[p,o,u]})},Pr=({translations:e,order:n,subtotalInclTax:i,subtotalExclTax:t,shoppingOrdersDisplaySubtotal:s})=>{var u,m,g,a;const c=s.taxIncluded,l=s.taxExcluded,d=c&&!l?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.subtotal}),r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(u=n==null?void 0:n.subtotalInclTax)==null?void 0:u.currency,amount:i})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:r("span",{children:e.incl})})]}):null,p=l&&!c?f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.subtotal}),r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(m=n==null?void 0:n.subtotalExclTax)==null?void 0:m.currency,amount:t})]}):null,o=l&&c?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.subtotal}),r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(g=n==null?void 0:n.subtotalInclTax)==null?void 0:g.currency,amount:i})]}),f("div",{className:"order-cost-summary-content__description--subheader",children:[r(P,{currency:(a=n==null?void 0:n.subtotalExclTax)==null?void 0:a.currency,amount:t,size:"small",weight:"bold"})," ",r("span",{children:e.excl})]})]}):null;return f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--subtotal",children:[d,p,o]})},$r=({translations:e,shoppingOrdersDisplayShipping:n,order:i,totalShipping:t})=>{var s,c,l,d;return i!=null&&i.isVirtual?null:f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--shipping",children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.shipping}),(s=i==null?void 0:i.totalShipping)!=null&&s.value?r(P,{weight:"normal",currency:(c=i==null?void 0:i.totalShipping)==null?void 0:c.currency,amount:t}):r("span",{children:e.freeShipping})]}),f("div",{className:"order-cost-summary-content__description--subheader",children:[n.taxIncluded&&n.taxExcluded?f(A,{children:[r(P,{weight:"normal",currency:(l=i==null?void 0:i.totalShipping)==null?void 0:l.currency,amount:(d=i==null?void 0:i.totalShipping)==null?void 0:d.value,size:"small"}),f("span",{children:[" ",e.excl]})]}):null,n.taxIncluded&&!n.taxExcluded?r("span",{children:e.incl}):null]})]})},Hr=({translations:e,order:n})=>{var c,l;const i=n==null?void 0:n.coupons,t=n==null?void 0:n.discounts,s=(t==null?void 0:t.reduce((d,p)=>d+(p.amount.value??0),0))||0;return!((c=n==null?void 0:n.discounts)!=null&&c.length)&&s===0?null:f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.discount}),r("span",{children:r(P,{weight:"normal",sale:!0,currency:(l=t[0])==null?void 0:l.amount.currency,amount:-s})})]}),i.map(d=>r("div",{className:"order-cost-summary-content__description--subheader",children:f("span",{children:[r(J,{source:$t,size:"16",className:"order-cost-summary-content__description--coupon-icon"}),r("span",{children:d.code})]})},d.code))]})},Zr=({translations:e,shoppingOrdersDisplaySubtotal:n,order:i})=>{var s,c,l,d,p;const t=((s=i==null?void 0:i.grandTotal)==null?void 0:s.value)===0;return f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--total",children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.total}),t?r("span",{className:"order-cost-summary-content__description--total-free",children:e.totalFree}):r(P,{currency:(c=i==null?void 0:i.grandTotal)==null?void 0:c.currency,amount:(l=i==null?void 0:i.grandTotal)==null?void 0:l.value,weight:"bold",size:"medium"})]}),n.taxExcluded&&n.taxIncluded&&!t?f("div",{className:"order-cost-summary-content__description--subheader",children:[r("span",{children:e.totalExcludingTaxes}),r(P,{currency:(d=i==null?void 0:i.grandTotalExclTax)==null?void 0:d.currency,amount:(p=i==null?void 0:i.grandTotalExclTax)==null?void 0:p.value,weight:"normal",size:"small"})]}):null]})},qr=({translations:e,renderTaxAccordion:n,totalAccordionTaxValue:i,order:t})=>{var l,d,p;const[s,c]=x(!1);return n?r(be,{"data-testid":"tax-accordionTaxes",className:"order-cost-summary-content__accordion",iconOpen:Vt,iconClose:Pt,children:f(Ne,{onStateChange:c,title:e.accordionTitle,secondaryText:r(A,{children:s?null:r(P,{weight:"normal",amount:i,currency:(d=t==null?void 0:t.totalTax)==null?void 0:d.currency})}),renderContentWhenClosed:!1,children:[(p=t==null?void 0:t.taxes)==null?void 0:p.map((o,u)=>{var m,g,a;return f("div",{className:"order-cost-summary-content__accordion-row",children:[r("p",{children:o==null?void 0:o.title}),r("p",{children:r(P,{weight:"normal",amount:(m=o==null?void 0:o.amount)==null?void 0:m.value,currency:(g=o==null?void 0:o.amount)==null?void 0:g.currency})})]},`${(a=o==null?void 0:o.amount)==null?void 0:a.value}${u}`)}),f("div",{className:"order-cost-summary-content__accordion-row order-cost-summary-content__accordion-total",children:[r("p",{children:e.accordionTotalTax}),r("p",{children:r(P,{weight:"normal",amount:i,currency:t.totalTax.currency,size:"medium"})})]})]})}):r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--tax",children:f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.tax}),r(P,{currency:(l=t==null?void 0:t.totalTax)==null?void 0:l.currency,amount:t==null?void 0:t.totalTax.value,weight:"normal",size:"small"})]})})},Wr=({totalGiftCardValue:e,totalGiftCardCurrency:n,order:i})=>{const t=i==null?void 0:i.appliedGiftCards;return e?f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:r(F,{id:"Order.OrderCostSummary.appliedGiftCards.label",plural:t==null?void 0:t.length,fields:{count:t==null?void 0:t.length}})}),r("span",{children:r(P,{weight:"normal",sale:!0,currency:n,amount:-e})})]}),t.map(s=>r("div",{className:"order-cost-summary-content__description--subheader",children:f("span",{children:[r(J,{source:Zt,size:"16",className:"order-cost-summary-content__description--giftcard-icon"}),r("span",{children:s.code})]})},s.code))]}):null},Me={taxIncluded:!1,taxExcluded:!1},Fr=({translations:e,loading:n,storeConfig:i,order:t,withHeader:s=!0})=>{var g,a,C,h,O,_,y;if(n||!t)return r(st,{});const c=((g=t==null?void 0:t.totalGiftCard)==null?void 0:g.value)??0,l=((a=t.totalGiftCard)==null?void 0:a.currency)??"",d=((C=t.subtotalInclTax)==null?void 0:C.value)??0,p=((h=t.subtotalExclTax)==null?void 0:h.value)??0,o=((O=t.totalShipping)==null?void 0:O.value)??0,u=!!((_=t==null?void 0:t.taxes)!=null&&_.length)&&!!(i!=null&&i.shoppingOrdersDisplayFullSummary),m=u?(y=t==null?void 0:t.taxes)==null?void 0:y.reduce((E,b)=>{var w;return+((w=b==null?void 0:b.amount)==null?void 0:w.value)+E},0):0;return f(U,{variant:"secondary",className:R(["order-cost-summary-content"]),children:[s?r(B,{title:e.headerText,level:2}):null,f("div",{className:"order-cost-summary-content__wrapper",children:[r(Pr,{translations:e,order:t,subtotalInclTax:d,subtotalExclTax:p,shoppingOrdersDisplaySubtotal:(i==null?void 0:i.shoppingOrdersDisplaySubtotal)??Me}),r($r,{translations:e,order:t,totalShipping:o,shoppingOrdersDisplayShipping:(i==null?void 0:i.shoppingOrdersDisplayShipping)??Me}),r(Vr,{order:t,translations:e,salesPrintedCard:i==null?void 0:i.salesPrintedCard}),r(We,{salesGiftWrapping:i==null?void 0:i.salesGiftWrapping,giftWrappingPrice:t.totalGiftOptions.giftWrappingForItems,giftWrappingPriceInclTax:t.totalGiftOptions.giftWrappingForItemsInclTax,giftWrappingTitle:e.itemGiftWrappingTitle,giftWrappingExclTaxText:e.itemGiftWrappingExclTax,giftWrappingInclTaxText:e.itemGiftWrappingInclTax}),r(We,{salesGiftWrapping:i==null?void 0:i.salesGiftWrapping,giftWrappingPrice:t.totalGiftOptions.giftWrappingForOrder,giftWrappingPriceInclTax:t.totalGiftOptions.giftWrappingForOrderInclTax,giftWrappingTitle:e.orderGiftWrappingTitle,giftWrappingExclTaxText:e.orderGiftWrappingExclTax,giftWrappingInclTaxText:e.orderGiftWrappingInclTax}),r(Hr,{translations:e,order:t}),r(Wr,{order:t,totalGiftCardValue:c,totalGiftCardCurrency:l}),r(qr,{order:t,translations:e,renderTaxAccordion:u,totalAccordionTaxValue:m}),r(Zr,{translations:e,shoppingOrdersDisplaySubtotal:(i==null?void 0:i.shoppingOrdersDisplaySubtotal)??Me,order:t})]})]})},Gr=({customerName:e,orderNumber:n,onSignUpClick:i})=>{const t=Z({title:r(F,{id:"Order.OrderHeader.title",fields:{name:e}}),defaultTitle:"Order.OrderHeader.defaultTitle",order:r(F,{id:"Order.OrderHeader.order",fields:{order:n}}),createAccountMessage:"Order.OrderHeader.CreateAccount.message",createAccountButton:"Order.OrderHeader.CreateAccount.button"});return f("div",{"data-testid":"order-header",className:"order-header order-header__card",children:[r(J,{source:qt,size:"64",className:"order-header__icon"}),r(B,{className:"order-header__title",title:t.title,size:"large",divider:!1,children:e?t.title:t.defaultTitle}),r("p",{className:"order-header__order",children:t.order}),i&&f("div",{className:"order-header-create-account",children:[r("p",{className:"order-header-create-account__message",children:t.createAccountMessage}),r(Q,{"data-testid":"create-account-button",className:"order-header-create-account__button",size:"medium",variant:"secondary",type:"submit",onClick:i,children:t.createAccountButton})]})]})},zr=e=>{const n=(e==null?void 0:e.items)??[],i=n.filter(c=>(c==null?void 0:c.eligibleForReturn)&&(c==null?void 0:c.quantityReturnRequested)).map(c=>({...c,totalQuantity:c.quantityReturnRequested})),t=new Map(i.map(c=>[c.id,c])),s=n.map(c=>{const l=t.get(c==null?void 0:c.id);if(l){const d=c.totalQuantity-l.quantityReturnRequested;return d===0?null:{...c,totalQuantity:d}}return c}).filter(c=>c!==null);return{returnedList:i,canceledItems:s==null?void 0:s.filter(c=>c.quantityCanceled),nonCanceledItems:s==null?void 0:s.filter(c=>!c.quantityCanceled)}},Ur=({slots:e,placeholderImage:n,loading:i,taxConfig:t,order:s=null,withHeader:c=!0,showConfigurableOptions:l,routeProductDetails:d})=>{const p=!!(s!=null&&s.returnNumber),o=Z({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",returned:"Order.OrderProductListContent.returnedTitle",refunded:"Order.OrderProductListContent.refundedTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),u=oe(()=>{var g,a;if(!s)return[];if(!p){const{returnedList:C,canceledItems:h,nonCanceledItems:O}=zr(s);return[{type:"returned",list:C,title:o.returned},{type:"cancelled",list:h,title:o.cancelled},{type:"allItems",list:O,title:o.allOrders}].filter(_=>{var y;return((y=_==null?void 0:_.list)==null?void 0:y.length)>0})}return[{type:"returned",list:((a=(g=s.returns.find(C=>C.returnNumber===(s==null?void 0:s.returnNumber)))==null?void 0:g.items)==null?void 0:a.map(C=>({...C,totalQuantity:C.requestQuantity})))??[],title:o.returned}]},[s,p,o]);return s?u.every(m=>m.list.length===0)?null:r(U,{variant:"secondary",className:"order-order-product-list-content",children:u.map((m,g)=>{var C;const a=m.list.filter(h=>h!==null).reduce((h,{totalQuantity:O})=>O+h,0);return f(Ye,{children:[c?r(B,{title:`${m.title} (${a})`,level:2}):null,r("ul",{className:"order-order-product-list-content__items",children:(C=m.list)==null?void 0:C.filter(h=>h!==null).map(h=>r("li",{"data-testid":"order-product-list-content-item",children:r(lt,{slots:e,placeholderImage:n,loading:i,product:h,itemType:m.type,taxConfig:t,translations:o,showConfigurableOptions:l,routeProductDetails:d})},h.id))})]},g)})}):r(at,{})};function Br(e){var t,s,c,l,d,p,o,u,m,g;const n=((t=e.regularPrice)==null?void 0:t.value)??0;if(n>0)return{value:n,currency:((s=e.regularPrice)==null?void 0:s.currency)??((c=e.price)==null?void 0:c.currency)??"USD"};const i=((d=(l=e.itemPrices)==null?void 0:l.originalPrice)==null?void 0:d.value)??0;return i>0?{value:i,currency:((o=(p=e.itemPrices)==null?void 0:p.originalPrice)==null?void 0:o.currency)??((u=e.price)==null?void 0:u.currency)??"USD"}:{value:0,currency:((m=e.price)==null?void 0:m.currency)??((g=e.regularPrice)==null?void 0:g.currency)??"USD"}}function ct(e){var i,t,s;const n=((i=e.price)==null?void 0:i.value)??0;return n>0?{value:n,currency:((t=e.price)==null?void 0:t.currency)??((s=e.regularPrice)==null?void 0:s.currency)??"USD"}:Br(e)}function Qr(e){const n=ct(e),i=e.totalQuantity??1;return{value:n.value*i,currency:n.currency}}const lt=({slots:e,placeholderImage:n="",loading:i,product:t,itemType:s,taxConfig:c,translations:l,disabledIncrementer:d,onQuantity:p,showConfigurableOptions:o,routeProductDetails:u})=>{var ee,te,re,ne,ie,pe;const{taxExcluded:m,taxIncluded:g}=c,a=q((V,X,K)=>r(P,{amount:V,currency:X,weight:"normal",...K}),[]),C=q(V=>{var ue,Ie;const X=(V==null?void 0:V.productName)??"",K={title:X,src:((Ie=(ue=V==null?void 0:V.product)==null?void 0:ue.thumbnail)==null?void 0:Ie.url)??n,alt:X,width:90,height:120,loading:"lazy"};return r(W,{slotTag:"span",contentTag:"span","data-testid":`cartSummaryItemImage-${V.id}`,name:"CartSummaryItemImage",slot:e==null?void 0:e.CartSummaryItemImage,context:{data:V,defaultImageProps:K},children:r(he,{...K})})},[n,e==null?void 0:e.CartSummaryItemImage]);if(!t)return r(st,{});let h={};const O=s==="cancelled",_=(te=(ee=t==null?void 0:t.product)==null?void 0:ee.stockStatus)==null?void 0:te.includes("IN_STOCK"),y=t==null?void 0:t.giftCard,E=t.totalQuantity>1?{quantity:t.totalQuantity}:{},b=t.discounted,{includeAndExcludeTax:w,includeTax:I,excludeTax:v}=t.taxCalculations,M=t==null?void 0:t.totalQuantity,S={...(t==null?void 0:t.configurableOptions)||{},...(t==null?void 0:t.bundleOptions)||{},...y!=null&&y.senderName?{[l.sender]:y==null?void 0:y.senderName}:{},...y!=null&&y.senderEmail?{[l.sender]:y==null?void 0:y.senderEmail}:{},...y!=null&&y.senderName?{[l.sender]:y==null?void 0:y.senderName}:{},...y!=null&&y.recipientEmail?{[l.recipient]:y==null?void 0:y.recipientEmail}:{},...y!=null&&y.message?{[l.message]:y==null?void 0:y.message}:{},...t!=null&&t.downloadableLinks?{[`${(re=t==null?void 0:t.downloadableLinks)==null?void 0:re.count} ${l.downloadableCount}`]:(ne=t==null?void 0:t.downloadableLinks)==null?void 0:ne.result}:{}},T=t==null?void 0:t.freeGiftLabel,N=!!((t==null?void 0:t.isFreeGift)??T),z=T?r("div",{className:"cart-summary-item__discount-labels",children:r("div",{className:"cart-summary-item__discount-label",children:T})}):null,ce=()=>z,j=()=>{const V=Qr(t);return V.value===0?a(0,V.currency,{weight:"bold"}):f(A,{children:[a(V.value,V.currency,{variant:"strikethrough",weight:"bold"}),a(0,V.currency,{sale:!0,weight:"bold"})]})},Y=f(A,{children:[(()=>{const V=ct(t);return r(P,{amount:V.value,currency:V.currency,weight:"normal","data-testid":"free-gift-unit-price"})})(),ce()]}),k=j(),le=a(0,((ie=t.price)==null?void 0:ie.currency)??"USD",{weight:"bold"});if(N)h={taxExcluded:g&&m?!0:void 0,taxIncluded:g&&!m?!0:void 0,price:Y,total:k,...m?{totalExcludingTax:le}:{}};else if(g&&m){const V=a(w.originalPrice.value,w.originalPrice.currency),X=a(w.baseOriginalPrice.value*M,w.baseOriginalPrice.currency,{variant:t.discounted?"strikethrough":"default",weight:"bold"}),K=a(w.baseDiscountedPrice.value*M,w.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),ue=a(w.baseExcludingTax.value*M,w.baseExcludingTax.currency,{weight:"bold"});h={taxExcluded:!0,taxIncluded:void 0,price:V,total:f(A,{children:[X,t.discounted?K:null]}),totalExcludingTax:ue}}else if(!g&&m){const V=a(v.originalPrice.value,v.originalPrice.currency),X=a(v.baseOriginalPrice.value*M,v.baseOriginalPrice.currency,{variant:b?"strikethrough":"default",weight:"bold"}),K=a(v.baseDiscountedPrice.value*M,v.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),ue=a(v.baseExcludingTax.value*M,v.baseExcludingTax.currency,{weight:"bold"});h={taxExcluded:void 0,taxIncluded:void 0,price:V,total:f(A,{children:[X,b?K:null]}),totalExcludingTax:ue}}else if(g&&!m){const V=a(I.singleItemPrice.value,I.singleItemPrice.currency),X=a(I.baseOriginalPrice.value*M,I.baseOriginalPrice.currency,{variant:b?"strikethrough":"default",weight:"bold"}),K=a(I.baseDiscountedPrice.value*M,I.baseDiscountedPrice.currency,{sale:!0,weight:"bold"});h={taxExcluded:void 0,taxIncluded:!0,price:V,total:f(A,{children:[X,b?K:null]})}}return r(Qe,{loading:i,alert:O&&!_?f("span",{children:[r(J,{source:Xe}),l.outOfStock]}):r(A,{}),configurations:(o==null?void 0:o(S))??S,title:r("h3",{"data-testid":"product-name",className:"cart-summary-item__title",children:u?r("a",{href:u(t),children:t==null?void 0:t.productName}):t==null?void 0:t.productName}),sku:r("div",{children:(pe=t==null?void 0:t.product)==null?void 0:pe.sku}),...E,image:u?r("a",{href:u(t),children:C(t)}):C(t),...h,footer:f(A,{children:[p&&!d?r(yt,{value:1,min:1,max:t==null?void 0:t.totalQuantity,onValue:V=>p==null?void 0:p(Number(V)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0,r(W,{"data-testid":"Footer",name:"Footer",slot:e==null?void 0:e.Footer,context:{item:t}})]})})},jr=({onSubmit:e,loading:n,inLineAlert:i,fieldsConfig:t})=>f(U,{variant:"secondary",className:"order-order-search-form",children:[r("h2",{className:"order-order-search-form__title",children:r(F,{id:"Order.OrderSearchForm.title"})}),r("p",{children:r(F,{id:"Order.OrderSearchForm.description"})}),i.text?r(Ee,{"data-testid":"orderAlert",className:"order-order-search-form__alert",type:i.type,variant:"secondary",heading:i.text,icon:r(J,{source:zt})}):null,r(nt,{className:"order-order-search-form__wrapper",name:"orderSearchForm",loading:n,fieldsConfig:t,onSubmit:e,children:r("div",{className:"order-order-search-form__button-container",children:r(Q,{className:"order-order-search-form__button",size:"medium",variant:"primary",type:"submit",disabled:n,children:r(F,{id:"Order.OrderSearchForm.button"})},"logIn")})})]}),Ae=e=>e&&e.charAt(0).toLocaleUpperCase()+e.slice(1).toLocaleLowerCase(),Re={pending:"orderPending",shiping:"orderShipped",complete:"orderComplete",processing:"orderProcessing","on hold":"orderOnHold",canceled:"orderCanceled","suspected fraud":"orderSuspectedFraud","payment Review":"orderPaymentReview","order received":"orderReceived","guest order cancellation requested":"guestOrderCancellationRequested","pending payment":"orderPendingPayment",rejected:"orderRejected",authorized:"orderAuthorized","paypal canceled reversal":"orderPaypalCanceledReversal","pending paypal":"orderPendingPaypal","paypal reversed":"orderPaypalReversed",closed:"orderClosed"},Yr=({slots:e,title:n,status:i,orderData:t,routeCreateReturn:s,onError:c,routeOnSuccess:l})=>{var S,T,N;const d=!!(t!=null&&t.returnNumber),p=String(i).toLocaleLowerCase(),o=(S=t==null?void 0:t.returns)==null?void 0:S[0],u=(o==null?void 0:o.returnStatus)??"",m=(o==null?void 0:o.createdReturnAt)??"",g=Z({message:"Order.OrderStatusContent.orderPlaceholder.message",messageWithoutDate:"Order.OrderStatusContent.orderPlaceholder.messageWithoutDate"}),a=Z(`Order.OrderStatusContent.${Re[p]}.title`),C=Z(`Order.OrderStatusContent.${Re[p]}.message`),h=Z(`Order.OrderStatusContent.${Re[p]}.messageWithoutDate`),O=Z({title:`Order.OrderStatusContent.returnStatus.${Se(u)}`,returnMessage:"Order.OrderStatusContent.returnMessage"}),_=Z({adminAssistedLabel:"Order.OrderStatusContent.adminAssistedLabel"});if(!i)return r("div",{});const y=a!=null&&a.title?a:{title:Ae(p)},E=C!=null&&C.message?C:g,b=h!=null&&h.messageWithoutDate?h:g,w=t!=null&&t.orderStatusChangeDate?E==null?void 0:E.message.replace("{DATE}",_e(t==null?void 0:t.orderStatusChangeDate)):b.messageWithoutDate,I=t==null?void 0:t.adminAssistedOrder,v=((N=(T=O==null?void 0:O.returnMessage)==null?void 0:T.replace("{ORDER_CREATE_DATE}",_e((t==null?void 0:t.orderDate)??"")))==null?void 0:N.replace("{RETURN_CREATE_DATE}",_e(m)))??"",M=d?n??(O.title||Ae(u)):n??y.title;return f(U,{className:"order-order-status-content",variant:"secondary",children:[r(B,{title:M,level:2}),f("div",{className:"order-order-status-content__wrapper",children:[f("div",{className:R(["order-order-status-content__wrapper-description",["order-order-status-content__wrapper-description--actions-slot",!!(e!=null&&e.OrderActions)]]),children:[I&&r("p",{className:"order-order-status-content__admin-assisted",children:_==null?void 0:_.adminAssistedLabel}),r("p",{children:d?v:w})]}),r(sr,{orderData:t,slots:e,routeCreateReturn:s,routeOnSuccess:l,onError:c})]})]})},Xr=({onError:e,routeOnSuccess:n,orderData:i,children:t})=>{const[s,c]=x(!1),l=q(()=>{c(!0);const d=(i==null?void 0:i.number)??"";At(d).then(({success:p,userInputErrors:o})=>{p&&ae(n,{}),o.length&&(e==null||e(o))}).catch(p=>{e==null||e(p.message)}).finally(()=>{c(!1)})},[i,n,e]);return r(Q,{type:"button",disabled:s,variant:"secondary",className:"order-reorder",onClick:l,children:t})},Kr=({routeReturnSuccess:e,translations:n,orderData:i})=>f("div",{className:"order-return-order-message",children:[r("p",{className:"order-return-order-message__title",children:n.successTitle}),r("p",{className:"order-return-order-message__subtitle",children:n.successMessage}),r(Q,{href:(e==null?void 0:e(i))??"#",children:n.backStore})]}),Jr=({placeholderImage:e,itemsEligibleForReturn:n,slots:i,loading:t,taxConfig:s,translations:c,selectedProductList:l,handleSelectedProductList:d,showConfigurableOptions:p,handleSetQuantity:o,handleChangeStep:u})=>f("ul",{className:"order-return-order-product-list",children:[n==null?void 0:n.map((m,g)=>{const{quantityReturnRequested:a,quantityShipped:C,eligibleForReturn:h}=m,O=l.some(E=>(E==null?void 0:E.productSku)===m.productSku&&m.eligibleForReturn),_=C===a&&h||!h,y=C-a===0?a:C-a;return f("li",{className:R(["order-return-order-product-list__item",["order-return-order-product-list__item--blur",_]]),children:[r(Be,{"data-testid":`key_${g}`,name:`key_${g}`,checked:O,disabled:_,onChange:()=>{d({...m,currentReturnOrderQuantity:1})}}),r(lt,{slots:i,placeholderImage:e,loading:t,product:{...m,totalQuantity:y||1},itemType:"",taxConfig:s,translations:c,showConfigurableOptions:p,disabledIncrementer:!O,onQuantity:y>1?E=>{o(E,m.productSku)}:void 0}),r(W,{"data-testid":"returnOrderItem",name:"ReturnOrderItem",slot:i==null?void 0:i.ReturnOrderItem})]},m.id)}),r("li",{className:"order-return-order-product-list__item",children:r(Q,{type:"button",onClick:()=>u("attributes"),disabled:!l.length,children:c.nextStep})})]}),Dr=({placeholderImage:e,slots:n,formsRef:i,selectedProductList:t,loading:s,fieldsConfig:c,translations:l,handleChangeStep:d,onSubmit:p})=>{const{formData:o,errors:u,formRef:m,handleChange:g,handleBlur:a,handleSubmit:C}=tt({fieldsConfig:jt(c,t==null?void 0:t.length),onSubmit:p});return f("form",{className:"order-return-reason-form",ref:m,onSubmit:C,name:"returnReasonForm",children:[t.map((h,O)=>{var S,T,N,z;const _=h==null?void 0:h.giftCard,y=h==null?void 0:h.product,E=Qt(c,O),b=`${h==null?void 0:h.id}_${O}`,w=(h==null?void 0:h.currentReturnOrderQuantity)??1,I={...h!=null&&h.currentReturnOrderQuantity?{[l.configurationsListQuantity]:w}:{},...h.configurableOptions||{},...h.bundleOptions||{},..._!=null&&_.senderName?{[l.sender]:_==null?void 0:_.senderName}:{},..._!=null&&_.senderEmail?{[l.sender]:_==null?void 0:_.senderEmail}:{},..._!=null&&_.recipientName?{[l.recipient]:_==null?void 0:_.recipientName}:{},..._!=null&&_.recipientEmail?{[l.recipient]:_==null?void 0:_.recipientEmail}:{},..._!=null&&_.message?{[l.message]:_==null?void 0:_.message}:{},...h!=null&&h.downloadableLinks?{[`${(S=h==null?void 0:h.downloadableLinks)==null?void 0:S.count} ${l.downloadableCount}`]:(T=h==null?void 0:h.downloadableLinks)==null?void 0:T.result}:{}},v=(N=h==null?void 0:h.product)==null?void 0:N.name,M={title:v,src:((z=y==null?void 0:y.thumbnail)==null?void 0:z.url)??e,alt:v,width:90,height:120,loading:"lazy"};return f(Ye,{children:[r(Qe,{loading:s,title:r("div",{"data-testid":"product-name",children:v}),sku:r("div",{children:y==null?void 0:y.sku}),image:r(W,{name:"ReturnReasonFormImage",slot:n==null?void 0:n.ReturnReasonFormImage,context:{data:h,defaultImageProps:M},children:r(he,{...M})}),configurations:I}),r("form",{name:b,ref:i==null?void 0:i.current[O],"data-quantity":w,children:r(rt,{className:"className",loading:s,fields:E,onChange:g,onBlur:a,errors:u,values:o})})]},h.id)}),r(W,{"data-testid":"returnFormActions",name:"ReturnFormActions",slot:n==null?void 0:n.ReturnFormActions,context:{handleChangeStep:d},children:f("div",{className:"order-return-reason-form__actions",children:[r(Q,{variant:"secondary",type:"button",onClick:()=>{d("products")},children:l.backStep}),r(Q,{children:l.submit})]})})]})},Fe={size:"32",stroke:"2"},dt=({placeholderImage:e,minifiedViewKey:n,withReturnNumber:i=!1,withOrderNumber:t=!1,slots:s,pageInfo:c,withReturnsListButton:l=!0,isMobile:d=!1,returnsInMinifiedView:p=1,translations:o={},orderReturns:u=[],minifiedView:m=!1,withHeader:g=!0,withThumbnails:a=!0,selectedPage:C=1,handleSetSelectPage:h,routeReturnDetails:O,routeOrderDetails:_,routeTracking:y,routeReturnsList:E,routeProductDetails:b,loading:w})=>{const I=m?p:u.length,v=b!=null&&b()?"a":"span",M=oe(()=>u.slice(0,I).map((N,z)=>{var D,Y;const j=((N==null?void 0:N.items)??[]).reduce((k,le)=>(le.requestQuantity??0)+k,0);return r(U,{variant:"secondary",className:"order-returns-list-content__cards-list",children:f("div",{className:"order-returns-list-content__cards-grid",children:[f("div",{className:"order-returns-list-content__descriptions",children:[r("p",{className:"order-returns-list-content__return-status",children:Se(N.returnStatus)?r(F,{id:`Order.Returns.${n}.returnsList.returnStatus.${Se(N.returnStatus)}`}):r("span",{children:Ae(N.returnStatus)})}),i?f("p",{children:[o.returnNumber," ",r("a",{href:(O==null?void 0:O({returnNumber:N.returnNumber,orderNumber:N.orderNumber,token:N.token}))??"#",rel:"noreferrer",children:N.returnNumber})]}):null,t?f("p",{children:[o.orderNumber," ",r("a",{href:(_==null?void 0:_({orderNumber:N.orderNumber,token:N.token}))??"#",rel:"noreferrer",children:N.orderNumber})]}):null,(D=N==null?void 0:N.tracking)==null?void 0:D.map((k,le)=>{var ne,ie;const ee={title:"",number:(k==null?void 0:k.trackingNumber)??"",carrier:((ne=k==null?void 0:k.carrier)==null?void 0:ne.label)??""},te=y==null?void 0:y(ee),re=`${ee.number}_${le}`;return f("p",{children:[`${o.carrier} `,`${(ie=ee.carrier)==null?void 0:ie.toLocaleUpperCase()} | `,te?r("a",{href:te,target:"_blank",rel:"noreferrer","data-testid":`${re}_link`,children:k.trackingNumber}):r("span",{"data-testid":`${re}_span`,children:k.trackingNumber})]},re)}),s!=null&&s.ReturnItemsDetails?r(W,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:s==null?void 0:s.ReturnItemsDetails,context:{items:N.items}}):null,!(s!=null&&s.ReturnItemsDetails)&&N.items.length?f("p",{children:[j," ",r(F,{id:`Order.Returns.${n}.returnsList.itemText`,plural:j,fields:{count:j}})]}):null]}),a?r(xe,{maxColumns:d?3:9,emptyGridContent:r(A,{}),className:R(["order-returns-list-content__images",["order-returns-list-content__images-3",d]]),children:(Y=N==null?void 0:N.items)==null?void 0:Y.map((k,le)=>{var ie,pe;const ee=`key_${le}_${k.uid}`,te=((ie=k==null?void 0:k.product)==null?void 0:ie.name)??"",re=((pe=k==null?void 0:k.thumbnail)==null?void 0:pe.url)??e??"",ne={title:te,src:re,alt:te,width:85,height:114,loading:"eager"};return r(v,{"data-testid":ee,href:(b==null?void 0:b(k))??"#",children:r(W,{slotTag:"span",contentTag:"span",name:"ReturnListImage",slot:s==null?void 0:s.ReturnListImage,context:{data:k,defaultImageProps:ne},children:r(he,{...ne})})},ee)})}):null,s!=null&&s.DetailsActionParams?r(W,{className:"order-returns-list-content__actions","data-testid":"detailsActionParams",name:"DetailsActionParams",slot:s==null?void 0:s.DetailsActionParams,context:{returnOrderItem:N}}):r("a",{href:(O==null?void 0:O({returnNumber:N.returnNumber,token:N.token,orderNumber:N.orderNumber}))??"#",className:"order-returns-list-content__actions",children:r(J,{source:Pe,...Fe})})]})},z)}),[u,I,n,i,o,t,s,a,d,e,v,y,b,O,_]),S=oe(()=>f(A,{children:[g?r(B,{title:o.minifiedViewTitle,divider:!1,className:"order-returns__header--minified",level:2}):null,w?r(Oe,{withCard:!1}):f(A,{children:[M,r(He,{minifiedView:m,typeList:"orders",isEmpty:!u.length,message:o.emptyOrdersListMessage}),l?r("a",{className:"order-returns-list-content__actions",href:(E==null?void 0:E())??"#",children:r(U,{variant:"secondary",className:"order-returns-list-content__card",children:f("div",{className:"order-returns-list-content__card-wrapper",children:[r("p",{children:o.viewAllOrdersButton}),r(J,{source:Pe,...Fe})]})})}):null]})]}),[E,l,g,o,M,m,u.length,w]),T=oe(()=>f(A,{children:[g?r(B,{title:o.minifiedViewTitle,divider:!0,className:"order-returns__header--full-size",level:1}):null,w?r(Oe,{withCard:!1}):f(A,{children:[r(He,{minifiedView:m,typeList:"orders",isEmpty:!u.length,message:o.emptyOrdersListMessage}),M,(c==null?void 0:c.totalPages)>1?r(Ct,{totalPages:c==null?void 0:c.totalPages,currentPage:C,onChange:h}):null]})]}),[M,m,u,o,c==null?void 0:c.totalPages,C,h,w,g]);return r("div",{className:"order-returns-list-content",children:m?S:T})},en=({placeholderImage:e,slots:n,collapseThreshold:i,translations:t,returnData:s,routeTracking:c,routeProductDetails:l})=>{var o;const d=ke(),p=l?"a":"span";return f(U,{variant:"secondary",className:R(["order-shipping-status-card","order-shipping-status-card--return-order"]),children:[r(B,{title:t.returnOrderCardTitle,level:2}),f("div",{children:[(o=s==null?void 0:s.tracking)==null?void 0:o.map((u,m)=>{var h,O;const g={title:"",number:(u==null?void 0:u.trackingNumber)??"",carrier:((h=u==null?void 0:u.carrier)==null?void 0:h.label)??""},a=c==null?void 0:c(g),C=a?()=>{window.open(a,"_blank","noreferrer")}:null;return f("div",{className:"order-shipping-status-card__header",children:[f("div",{children:[`${t.carrier} `,`${(O=g.carrier)==null?void 0:O.toLocaleUpperCase()} | `,g.number]}),C?r(Q,{onClick:C,children:t.trackButton}):null]},`${g.number}_${m}`)}),n!=null&&n.ReturnItemsDetails?r(W,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:n==null?void 0:n.ReturnItemsDetails,context:{items:s.items}}):null,r(be,{actionIconPosition:"right","data-testid":"dropinAccordion",children:r(Ne,{defaultOpen:i>=s.items.length,title:r(F,{id:"Order.ShippingStatusCard.itemText",plural:s.items.reduce((u,m)=>u+m.requestQuantity,0),fields:{count:s.items.reduce((u,m)=>u+m.requestQuantity,0)}}),children:r(xe,{maxColumns:d?3:9,emptyGridContent:r(A,{}),className:R(["order-shipping-status-card__images",["order-shipping-status-card__images-3",d]]),children:s.items.map((u,m)=>{var a,C,h;const g={title:((a=u.thumbnail)==null?void 0:a.label)??"",src:((C=u.thumbnail)==null?void 0:C.url)??e,alt:((h=u.thumbnail)==null?void 0:h.label)??"",width:85,height:114,loading:"lazy"};return r(p,{href:(l==null?void 0:l(u))??"#","data-testid":`${m}${u.uid}`,children:r(W,{slotTag:"span",contentTag:"span",name:"ShippingStatusCardImage",slot:n==null?void 0:n.ShippingStatusReturnCardImage,context:{data:u,defaultImageProps:g},children:r(he,{...g})})},`${m}${u.uid}`)})})})})]})]})},tn=({placeholderImage:e,translations:n,slots:i,orderData:t,collapseThreshold:s=10,routeProductDetails:c,routeTracking:l})=>{var a,C,h,O,_;const d=!!(t!=null&&t.returnNumber),p=t==null?void 0:t.returnNumber,o=c?"a":"span",u=(a=t==null?void 0:t.status)==null?void 0:a.toLocaleLowerCase(),m=(C=t==null?void 0:t.items)==null?void 0:C.filter(y=>(y==null?void 0:y.quantityShipped)===0||(y==null?void 0:y.quantityShipped)<(y==null?void 0:y.quantityOrdered)),g=(h=t==null?void 0:t.items)==null?void 0:h.reduce((y,E)=>{const b=E.quantityOrdered-E.quantityShipped;return y+(b>0?b:0)},0);if(d&&(t!=null&&t.returns.length)){const y=t.returns.find(E=>E.returnNumber===p);return!y||y.tracking.length===0?null:r(en,{placeholderImage:e,slots:i,collapseThreshold:s,translations:n,returnData:y,routeTracking:l,routeProductDetails:c})}return!t||u!=null&&u.includes(Ke.CANCELED)?null:(O=t==null?void 0:t.shipments)!=null&&O.length?f(A,{children:[(_=t==null?void 0:t.shipments)==null?void 0:_.map(({tracking:y,items:E,id:b,number:w},I)=>{const v=E??[],M=v.reduce((S,T)=>S+((T==null?void 0:T.quantityShipped)??T.orderItem.quantityShipped??0),0);return f(U,{variant:"secondary",className:"order-shipping-status-card",children:[r(B,{title:n.shippingCardTitle,level:2}),w?r("div",{className:"order-shipping-status-card__header","data-testid":"shipmentNumber",children:r("div",{className:"order-shipping-status-card__header--content",children:f("p",{children:[n.shipmentNumber," ",w]})})}):null,y==null?void 0:y.map(S=>{var z;const T=l==null?void 0:l(S),N=T?()=>{window.open(T,"_blank","noreferrer")}:null;return f("div",{className:"order-shipping-status-card__header",role:"status",children:[f("div",{className:"order-shipping-status-card__header--content",children:[f("p",{children:[n.carrier," ",(z=S==null?void 0:S.carrier)==null?void 0:z.toLocaleUpperCase()," | ",S==null?void 0:S.number]}),r("p",{children:S==null?void 0:S.title})]}),i!=null&&i.DeliveryTrackActions?r(W,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:i==null?void 0:i.DeliveryTrackActions,context:{trackInformation:S}}):N?r(Q,{onClick:N,children:n.trackButton}):null]},S.number)}),r(be,{actionIconPosition:"right","data-testid":"dropinAccordion",children:r(Ne,{"data-position":I+1,defaultOpen:s>=(v==null?void 0:v.length),title:r(F,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:M,fields:{count:M}}),children:r(xe,{maxColumns:6,emptyGridContent:r(A,{}),className:"order-shipping-status-card__images",children:v==null?void 0:v.map(S=>{var z,ce,j,D,Y,k;const T=((j=(ce=(z=S==null?void 0:S.orderItem)==null?void 0:z.product)==null?void 0:ce.thumbnail)==null?void 0:j.label)??"",N={title:T,src:((k=(Y=(D=S==null?void 0:S.orderItem)==null?void 0:D.product)==null?void 0:Y.thumbnail)==null?void 0:k.url)??e,alt:T,width:85,height:114,loading:"eager"};return r(o,{href:(c==null?void 0:c(S))??"#",children:r(W,{slotTag:"span",contentTag:"span",name:"ShippingStatusCardImage",slot:i==null?void 0:i.ShippingStatusCardImage,context:{data:S,defaultImageProps:N},children:r(he,{...N})})},S.id)})})})}),i!=null&&i.DeliveryTimeLine?r(W,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:i==null?void 0:i.DeliveryTimeLine,context:{}}):null]},b)}),m!=null&&m.length?f(U,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[r(B,{title:n.notYetShippedTitle,level:2}),r(be,{actionIconPosition:"right",children:r(Ne,{defaultOpen:s>=(m==null?void 0:m.length),title:r(F,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:g,fields:{count:g}}),children:r(xe,{maxColumns:6,emptyGridContent:r(A,{}),className:"order-shipping-status-card__images",children:m==null?void 0:m.map(y=>{var b,w,I;const E={title:((b=y.thumbnail)==null?void 0:b.label)??"",src:((w=y.thumbnail)==null?void 0:w.url)??"",alt:((I=y.thumbnail)==null?void 0:I.label)??"",width:85,height:114,loading:"lazy"};return r(o,{href:(c==null?void 0:c(y))??"#",children:r(W,{slotTag:"span",contentTag:"span",name:"NotYetShippedProductImage",slot:i==null?void 0:i.NotYetShippedProductImage,context:{data:y,defaultImageProps:E},children:r(he,{...E})})},y.id)})})})})]}):null]}):f(U,{variant:"secondary",className:"order-shipping-status-card",children:[r(B,{title:n.shippingInfoTitle,level:2}),r("div",{className:"order-shipping-status-card__header",children:f("div",{className:"order-shipping-status-card__header--content",children:[t!=null&&t.carrier?r("p",{children:t==null?void 0:t.carrier}):null,n.noInfoTitle?r("p",{children:n.noInfoTitle}):null]})})]})},rn=["br","b","i"];function nn(e){return ut(e,{ALLOWED_TAGS:rn,ALLOWED_ATTR:[]})}const an=({className:e,comments:n=[],...i})=>{const t=Z({emptyState:"Order.OrderComments.emptyState",title:"Order.OrderComments.title"}),s=!n||n.length===0?r("ul",{className:R(["order-order-comments","order-order-comments--empty"]),"data-testid":"order-comments-list",children:r("li",{className:"order-order-comments__empty-state","data-testid":"order-comments-empty-state",children:t.emptyState})}):r("ul",{className:"order-order-comments","data-testid":"order-comments-list",children:n.map((c,l)=>f("li",{className:"order-order-comments__item","data-testid":`order-comment-${l}`,children:[r("div",{className:"order-order-comments__header",children:r("time",{className:"order-order-comments__date",dateTime:c.timestamp,"data-testid":`order-comment-date-${l}`,children:_e(c.timestamp,"en-US",et)})}),r("p",{className:"order-order-comments__text","data-testid":`order-comment-text-${l}`,dangerouslySetInnerHTML:{__html:nn(c.message)}})]},l))});return f(U,{...i,variant:"secondary",className:R(["order-order-comments-card",e]),"data-testid":"order-comments-card",children:[r(B,{title:t.title,level:2}),r("div",{className:"order-order-comments-card__container",children:s})]})},sn=({className:e,orderData:n,slots:i,onSuccess:t,onError:s,routeReturnSuccess:c,showConfigurableOptions:l})=>{const d=Z({headerText:"Order.CreateReturn.headerText",successTitle:"Order.CreateReturn.success.title",successMessage:"Order.CreateReturn.success.message",sender:"Order.CreateReturn.giftCard.sender",recipient:"Order.CreateReturn.giftCard.recipient",message:"Order.CreateReturn.giftCard.message",outOfStock:"Order.CreateReturn.stockStatus.outOfStock",nextStep:"Order.CreateReturn.buttons.nextStep",backStep:"Order.CreateReturn.buttons.backStep",submit:"Order.CreateReturn.buttons.submit",backStore:"Order.CreateReturn.buttons.backStore",downloadableCount:"Order.CreateReturn.downloadableCount",returnedItems:"Order.CreateReturn.returnedItems",configurationsListQuantity:"Order.CreateReturn.configurationsList.quantity"}),{inLineAlertProps:p,handleSetInLineAlert:o}=Or(),u=se(),{order:m,itemsEligibleForReturn:g,formsRef:a,attributesList:C,steps:h,loading:O,selectedProductList:_,handleSelectedProductList:y,handleSetQuantity:E,handleChangeStep:b,onSubmit:w}=cr({orderData:n,onSuccess:t,onError:s,handleSetInLineAlert:o});if(O)return r("div",{children:r(at,{})});if(!O&&!C.length)return r("div",{});const I=(u==null?void 0:u.baseMediaUrl)??"",v={products:r(Jr,{itemsEligibleForReturn:g,placeholderImage:I,taxConfig:de((u==null?void 0:u.shoppingOrderDisplayPrice)??0),slots:i,translations:d,loading:O,selectedProductList:_,handleSelectedProductList:y,showConfigurableOptions:l,handleSetQuantity:E,handleChangeStep:b}),attributes:r(Dr,{placeholderImage:I,slots:i,formsRef:a,loading:O,fieldsConfig:C,selectedProductList:_,handleChangeStep:b,translations:d,onSubmit:w}),success:r(Kr,{translations:d,routeReturnSuccess:c,orderData:m}),error:null};return f("div",{className:R(["order-create-return",e]),children:[r(B,{title:d.headerText,level:1}),p.heading?r(Ee,{className:"order-create-return_notification",variant:"secondary","data-testid":"orderCreateReturnNotification",...p}):null,v[h]]})};sn.displayName="CreateReturn";export{sn as C,Lr as CustomerDetails,it as O,wr as R,Mr as S,vr as a,br as b,Nr as c,Sr as d,Lr as default,Tr as e,Er as f,Rr as g};
|
|
3
|
+
import{Slot as W,classes as R,debounce as ot,sanitizeHtml as ut}from"@dropins/tools/lib.js";import{Text as F,useText as Z}from"@dropins/tools/i18n.js";import*as L from"@dropins/tools/preact-bundle.js";import{useMemo as Ge,memo as ze,useCallback as ge}from"@dropins/tools/preact-bundle.js";import{jsx as r,jsxs as f,Fragment as A}from"@dropins/tools/preact-bundle.js";import{Icon as J,Price as P,Card as U,Header as B,IllustratedMessage as mt,Field as fe,Picker as Ue,Input as ht,InputDate as pt,Checkbox as Be,TextArea as gt,Button as Q,InLineAlert as Ee,Modal as ft,Skeleton as Le,SkeletonRow as $,CartItemSkeleton as ye,Accordion as be,AccordionSection as Ne,Image as he,CartItem as Qe,Incrementer as yt,ContentGrid as xe,Pagination as Ct}from"@dropins/tools/components.js";import{useMemo as oe,useRef as je,useState as x,useEffect as H,useCallback as q}from"@dropins/tools/preact-bundle.js";import{events as G}from"@dropins/tools/event-bus.js";import{createRef as _t,Fragment as Ye}from"@dropins/tools/preact.js";import{r as ae,getStoreConfig as Ot,getAttributesList as Lt,requestReturn as vt,requestGuestReturn as bt,getAttributesForm as Nt,c as xt,t as we,getCustomer as Ve,getGuestOrder as St,getCustomerOrdersReturn as Tt,confirmCancelOrder as Et,confirmGuestReturn as wt,requestGuestOrderCancel as Mt,cancelOrder as Rt,reorderItems as At}from"../api.js";import"@dropins/tools/recaptcha.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";const kt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.00718 5H22.1507C22.7047 5 23.1579 5.45323 23.1579 6.00718V7.51794C23.1579 7.51794 1.01007 7.58844 1 7.55823V6.00718C1 5.45323 1.45323 5 2.00718 5Z",stroke:"currentColor",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M23.1579 9.78409V18.3451C23.1579 18.899 22.7047 19.3523 22.1507 19.3523H2.00718C1.45323 19.3523 1 18.899 1 18.3451V9.78409H23.1579Z",stroke:"currentColor",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M3.01465 15.9682H8.40305",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.6192 17.5897C18.4535 17.5897 19.1299 16.9133 19.1299 16.0789C19.1299 15.2446 18.4535 14.5682 17.6192 14.5682C16.7848 14.5682 16.1084 15.2446 16.1084 16.0789C16.1084 16.9133 16.7848 17.5897 17.6192 17.5897Z",stroke:"currentColor",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8848 17.5897C20.7192 17.5897 21.3956 16.9133 21.3956 16.0789C21.3956 15.2446 20.7192 14.5682 19.8848 14.5682C19.0504 14.5682 18.374 15.2446 18.374 16.0789C18.374 16.9133 19.0504 17.5897 19.8848 17.5897Z",stroke:"currentColor",strokeWidth:1})),It=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),Vt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square",strokeLinejoin:"round"})),Pe=e=>L.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...e},L.createElement("g",{id:"Large"},L.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),L.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},L.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),Pt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square",strokeLinejoin:"round"})),$t=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"currentColor"})),Ht=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{d:"M12.002 21L11.8275 21.4686C11.981 21.5257 12.1528 21.5041 12.2873 21.4106C12.4218 21.3172 12.502 21.1638 12.502 21H12.002ZM3.89502 17.9823H3.39502C3.39502 18.1912 3.52485 18.378 3.72059 18.4509L3.89502 17.9823ZM3.89502 8.06421L4.07193 7.59655C3.91831 7.53844 3.74595 7.55948 3.61082 7.65284C3.47568 7.74619 3.39502 7.89997 3.39502 8.06421H3.89502ZM12.0007 21H11.5007C11.5007 21.1638 11.5809 21.3172 11.7154 21.4106C11.8499 21.5041 12.0216 21.5257 12.1751 21.4686L12.0007 21ZM20.1076 17.9823L20.282 18.4509C20.4778 18.378 20.6076 18.1912 20.6076 17.9823H20.1076ZM20.1076 8.06421H20.6076C20.6076 7.89997 20.527 7.74619 20.3918 7.65284C20.2567 7.55948 20.0843 7.53844 19.9307 7.59655L20.1076 8.06421ZM12.0007 11.1311L11.8238 10.6634C11.6293 10.737 11.5007 10.9232 11.5007 11.1311H12.0007ZM20.2858 8.53191C20.5441 8.43421 20.6743 8.14562 20.5766 7.88734C20.4789 7.62906 20.1903 7.49889 19.932 7.5966L20.2858 8.53191ZM12.002 4.94826L12.1775 4.48008C12.0605 4.43623 11.9314 4.43775 11.8154 4.48436L12.002 4.94826ZM5.87955 6.87106C5.62334 6.97407 5.49915 7.26528 5.60217 7.52149C5.70518 7.77769 5.99639 7.90188 6.2526 7.79887L5.87955 6.87106ZM18.1932 7.80315C18.4518 7.90008 18.74 7.76904 18.8369 7.51047C18.9338 7.2519 18.8028 6.96371 18.5442 6.86678L18.1932 7.80315ZM12 4.94827L11.5879 5.23148C11.6812 5.36719 11.8353 5.44827 12 5.44827C12.1647 5.44827 12.3188 5.36719 12.4121 5.23148L12 4.94827ZM14.0263 2L14.2028 1.53218C13.9875 1.45097 13.7446 1.52717 13.6143 1.71679L14.0263 2ZM21.8421 4.94827L22.2673 5.2113C22.3459 5.08422 22.3636 4.92863 22.3154 4.78717C22.2673 4.64571 22.1584 4.53319 22.0186 4.48045L21.8421 4.94827ZM9.97368 2L10.3857 1.71679C10.2554 1.52717 10.0125 1.45097 9.79721 1.53218L9.97368 2ZM2.15789 4.94827L1.98142 4.48045C1.84161 4.53319 1.73271 4.64571 1.68456 4.78717C1.63641 4.92863 1.65406 5.08422 1.73267 5.2113L2.15789 4.94827ZM12 11.1256L11.6702 11.5014C11.8589 11.667 12.1411 11.667 12.3298 11.5014L12 11.1256ZM15.0395 8.45812L14.8732 7.98659C14.8131 8.00779 14.7576 8.04028 14.7097 8.08232L15.0395 8.45812ZM23 5.65024L23.3288 6.0269C23.5095 5.86916 23.5527 5.60532 23.4318 5.39817C23.3109 5.19102 23.0599 5.09893 22.8337 5.17871L23 5.65024ZM8.96053 8.45812L9.29034 8.08232C9.24244 8.04028 9.18695 8.00779 9.12685 7.98659L8.96053 8.45812ZM1 5.65024L1.16632 5.17871C0.940115 5.09893 0.689119 5.19102 0.568192 5.39817C0.447264 5.60532 0.49048 5.86916 0.671176 6.0269L1 5.65024ZM12.1764 20.5314L4.06945 17.5137L3.72059 18.4509L11.8275 21.4686L12.1764 20.5314ZM4.39502 17.9823V8.06421H3.39502V17.9823H4.39502ZM3.71811 8.53187L11.8251 11.5987L12.1789 10.6634L4.07193 7.59655L3.71811 8.53187ZM11.502 11.1311V21H12.502V11.1311H11.502ZM12.1751 21.4686L20.282 18.4509L19.9332 17.5137L11.8262 20.5314L12.1751 21.4686ZM20.6076 17.9823V8.06421H19.6076V17.9823H20.6076ZM19.9307 7.59655L11.8238 10.6634L12.1776 11.5987L20.2845 8.53187L19.9307 7.59655ZM11.5007 11.1311V21H12.5007V11.1311H11.5007ZM19.932 7.5966L11.8251 10.6634L12.1789 11.5987L20.2858 8.53191L19.932 7.5966ZM11.8154 4.48436L5.87955 6.87106L6.2526 7.79887L12.1885 5.41217L11.8154 4.48436ZM11.8265 5.41645L18.1932 7.80315L18.5442 6.86678L12.1775 4.48008L11.8265 5.41645ZM11.502 4.94826V11.1311H12.502V4.94826H11.502ZM12.4121 5.23148L14.4384 2.28321L13.6143 1.71679L11.5879 4.66507L12.4121 5.23148ZM13.8498 2.46782L21.6656 5.4161L22.0186 4.48045L14.2028 1.53218L13.8498 2.46782ZM21.4169 4.68525L20.5485 6.08919L21.3989 6.61524L22.2673 5.2113L21.4169 4.68525ZM12.4121 4.66507L10.3857 1.71679L9.56162 2.28321L11.5879 5.23148L12.4121 4.66507ZM9.79721 1.53218L1.98142 4.48045L2.33437 5.4161L10.1502 2.46782L9.79721 1.53218ZM1.73267 5.2113L2.60109 6.61524L3.45154 6.08919L2.58312 4.68525L1.73267 5.2113ZM12.3298 11.5014L15.3693 8.83392L14.7097 8.08232L11.6702 10.7498L12.3298 11.5014ZM15.2058 8.92965L23.1663 6.12177L22.8337 5.17871L14.8732 7.98659L15.2058 8.92965ZM22.6712 5.27358L19.7764 7.80067L20.4341 8.554L23.3288 6.0269L22.6712 5.27358ZM12.3298 10.7498L9.29034 8.08232L8.63072 8.83392L11.6702 11.5014L12.3298 10.7498ZM9.12685 7.98659L1.16632 5.17871L0.83368 6.12177L8.79421 8.92965L9.12685 7.98659ZM0.671176 6.0269L3.56591 8.554L4.22356 7.80067L1.32882 5.27358L0.671176 6.0269Z",fill:"currentColor"})),Zt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 12.8571V6.75774C22 6.33761 21.5848 6 21.0884 6H2.91155C2.40614 6 2 6.34511 2 6.75774V12.8571M22 12.8571H2M22 12.8571V17.0049C22 17.5468 21.5939 18 21.0884 18H2.91155C2.41516 18 2 17.5567 2 17.0049V12.8571M5.18182 16.0886L8.64545 12.8229M8.64545 12.8229L12.1087 16.0886M8.64545 12.8229C8.64545 12.8229 8.09964 10.4743 7.56328 9.96857C7.02692 9.46286 6.15419 9.46286 5.61783 9.96857C5.08146 10.4743 5.08146 11.2971 5.61783 11.8029C6.15419 12.3086 8.64545 12.8229 8.64545 12.8229ZM8.64545 12.8229C8.64545 12.8229 11.1542 12.2914 11.6905 11.7857C12.2269 11.28 12.2269 10.4571 11.6905 9.95141C11.1542 9.4457 10.2814 9.4457 9.74507 9.95141C9.2087 10.4571 8.64545 12.8229 8.64545 12.8229ZM8.64506 17.2886V6.70286",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"})),qt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("g",{clipPath:"url(#clip0_4797_15077)"},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.15 20.85L1.5 17.53V6.63L10.15 10V20.85Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.63001L10.15 3.20001L18.8 6.63001L10.15 10L1.5 6.63001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.17969 4.77002L14.8297 8.15002V11.47",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.7896 12.64V6.63L10.1396 10V20.85L14.8296 19.05",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:1}),L.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M15.71 17.26C15.71 15.38 17.23 13.86 19.11 13.86C20.99 13.86 22.51 15.38 22.51 17.26C22.51 19.14 20.99 20.66 19.11 20.66C17.23 20.66 15.71 19.14 15.71 17.26Z",stroke:"currentColor",strokeWidth:1}),L.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M17.4805 17.49L18.5605 18.41L20.7205 16.33",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round",strokeWidth:1})),L.createElement("defs",null,L.createElement("clipPath",{id:"clip0_4797_15077"},L.createElement("rect",{width:22,height:18.65,fill:"white",transform:"translate(1 2.70001)"})))),Wt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.8052 14.4968C10.8552 14.4968 9.9752 14.0268 9.4452 13.2368L9.4152 13.1868L9.3852 13.1268C8.1352 11.2268 7.5352 8.96681 7.6852 6.68681C7.7552 4.42681 9.6052 2.61681 11.8652 2.60681H12.0052C14.2752 2.47681 16.2152 4.21681 16.3452 6.47681C16.3452 6.55681 16.3452 6.62681 16.3452 6.70681C16.4852 8.94681 15.9052 11.1768 14.6852 13.0568L14.6052 13.1768C14.0552 13.9868 13.1352 14.4668 12.1652 14.4768H12.0052C11.9352 14.4768 11.8652 14.4868 11.7952 14.4868L11.8052 14.4968Z",stroke:"currentColor"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M4.3252 21.5469C4.3552 20.4169 4.4752 19.2869 4.6752 18.1769C4.8952 17.1669 6.4752 16.0269 8.9052 15.1569C9.2352 15.0369 9.4852 14.7869 9.5952 14.4569L9.8052 14.0269",stroke:"currentColor"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M14.425 14.4069L14.165 14.1569C14.375 14.5969 14.725 14.9569 15.155 15.1869C16.945 15.7969 19.125 16.9569 19.375 18.2069C19.585 19.3069 19.685 20.4269 19.675 21.5369",stroke:"currentColor"})),Ft=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Gt=e=>L.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("g",{clipPath:"url(#clip0_841_1324)"},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),L.createElement("defs",null,L.createElement("clipPath",{id:"clip0_841_1324"},L.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)",strokeWidth:1})))),zt=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"})),Xe=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),L.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"}));var ve=(e=>(e.CANCEL="CANCEL",e.RETURN="RETURN",e.REORDER="REORDER",e))(ve||{}),me=(e=>(e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.DROPDOWN="DROPDOWN",e.FILE="FILE",e.GALLERY="GALLERY",e.HIDDEN="HIDDEN",e.IMAGE="IMAGE",e.MEDIA_IMAGE="MEDIA_IMAGE",e.MULTILINE="MULTILINE",e.MULTISELECT="MULTISELECT",e.PRICE="PRICE",e.SELECT="SELECT",e.TEXT="TEXT",e.TEXTAREA="TEXTAREA",e.UNDEFINED="UNDEFINED",e.VISUAL="VISUAL",e.WEIGHT="WEIGHT",e.EMPTY="",e))(me||{}),Ke=(e=>(e.PENDING="pending",e.SHIPPING="shipping",e.COMPLETE="complete",e.PROCESSING="processing",e.HOLD="on hold",e.CANCELED="Canceled",e.SUSPECTED_FRAUD="suspected fraud",e.PAYMENT_REVIEW="payment review",e))(Ke||{});const Je=e=>{if(!e)return null;const n=new FormData(e);if(e.querySelectorAll('input[type="checkbox"]').forEach(t=>{n.has(t.name)||n.set(t.name,"false"),t.checked&&n.set(t.name,"true")}),n&&typeof n.entries=="function"){const t=n.entries();if(t&&typeof t[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(t)))||{}}return{}},Ut={PENDING:"pending",AUTHORIZED:"authorized",PARTIALLY_AUTHORIZED:"partiallyAuthorized",RECEIVED:"received",PARTIALLY_RECEIVED:"partiallyReceived",APPROVED:"approved",PARTIALLY_APPROVED:"partiallyApproved",REJECTED:"rejected",PARTIALLY_REJECTED:"partiallyRejected",DENIED:"denied",PROCESSED_AND_CLOSED:"processedAndClosed",CLOSED:"closed"},De=(e,n)=>({id:`${e.id}_${e.fieldType}_${n+1}`,name:`${e.name}_${e.fieldType}_${n+1}`,code:`${e.code}_${e.fieldType}_${n+1}`,customUpperCode:`${e.customUpperCode}_${e.fieldType}_${n+1}`}),Bt=e=>{const n={};return!e||typeof e!="object"||Object.keys(e).length===0||Object.keys(e).forEach(i=>{if(/_(\d+)$/.exec(i)){const s=i==null?void 0:i.replace(/_\d+$/,"");n[s]=e[i]}else n[i]=e[i]}),n},Qt=(e,n)=>e.map(i=>({...i,...De(i,n)})),jt=(e,n)=>e==null?void 0:e.flatMap(i=>Array.from({length:n},(t,s)=>({...i,...De(i,s)}))),Yt=e=>{const n=[],i=[];return Object.entries(e).forEach(([t,s])=>{const c=t.lastIndexOf("_"),l=t.slice(0,c),d=t.slice(c+1);d===me.MULTISELECT||d===me.SELECT?n.push({attributeCode:l,value:s}):i.push({attributeCode:l,value:s})}),{selectedCustomAttributes:n,enteredCustomAttributes:i}},Se=e=>typeof e!="string"?"":Ut[e]??"",Xt=e=>{var i;const n=[];if(e!=null&&e.current.length)for(const{current:t}of e.current){if(!t)continue;const s=t.name.replace(/_\d+$/,""),c=((i=t==null?void 0:t.dataset)==null?void 0:i.quantity)??1,l=Je(t),d=Bt(l);n.push({orderItemUid:s,quantityToReturn:+c,...Yt(d)})}return n},Kt=e=>{var n;return(n=e==null?void 0:e.items)!=null&&n.length?[...(e==null?void 0:e.items)??[]].sort((i,t)=>{const s=i.quantityShipped-i.quantityReturnRequested===0,c=t.quantityShipped-t.quantityReturnRequested===0;return i.eligibleForReturn&&!t.eligibleForReturn?-1:!i.eligibleForReturn&&t.eligibleForReturn||s&&!c?1:!s&&c?-1:0}):[]},Jt={day:"2-digit",month:"2-digit",year:"numeric"},Dt={year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0},Ce=new Map,er=16;function tr(e){let n=Ce.get(e);if(!n){if(Ce.size>=er){const i=Ce.keys().next().value;i!==void 0&&Ce.delete(i)}n=new Intl.DateTimeFormat(e,Dt),Ce.set(e,n)}return n}const et="datetime",_e=(e,n="en-US",i={})=>{const t=new Date(e);if(isNaN(t.getTime()))return"Invalid Date";if(i===et)return tr(n).format(t);const s={...Jt,...i};return new Intl.DateTimeFormat(n,s).format(t)},$e=(e,n)=>{var t;const i=s=>{const c=Array.isArray(s.value)?s.value.join(" "):s==null?void 0:s.value;return s.label?`${s.label}: ${c}`:c};return(t=e[n])==null?void 0:t.map((s,c)=>r("p",{children:i(s)},`${s.value}${c}`))},rr=e=>{var c,l;const n=e&&e.length>0,i=n?(c=e[0])==null?void 0:c.name:"",t=n?(l=e[0])==null?void 0:l.code:"";return{selectedPaymentMethod:i,selectedPaymentMethodCode:t,hasToDisplayPaymentMethod:n&&i!==""}},nr=({loading:e,order:n,withHeader:i=!0,title:t,paymentIconsMap:s={},normalizeAddress:c,translations:l,slots:d})=>{var j,D,Y,k;const p=!!(n!=null&&n.returnNumber),o=!!(n!=null&&n.isVirtual),u=(j=n==null?void 0:n.returns)==null?void 0:j[0],m=oe(()=>({checkmo:Ft,card:kt,...s}),[s]);if(!n||e)return r(kr,{});const g=(n==null?void 0:n.email)??"",a=(D=n==null?void 0:n.shipping)==null?void 0:D.code,C=(Y=n==null?void 0:n.shipping)==null?void 0:Y.amount,h=(k=n==null?void 0:n.shipping)==null?void 0:k.currency,O=n==null?void 0:n.payments,{selectedPaymentMethod:_,selectedPaymentMethodCode:y,hasToDisplayPaymentMethod:E}=rr(O),b=m[y],w=$e(c,"shippingAddress")??[],I=$e(c,"billingAddress")??[],v=f("div",{className:"order-customer-details-content__container-email",children:[r("div",{className:"order-customer-details-content__container-title",children:l==null?void 0:l.emailTitle}),r("p",{children:g})]}),M=p?f("div",{className:"order-customer-details-content__container-return-information","data-testid":"returnDetailsBlock",children:[r("div",{className:"order-customer-details-content__container-title",children:l==null?void 0:l.returnInformationTitle}),r("div",{className:"order-customer-details-content__container-description",children:r(W,{"data-testid":"OrderReturnInformation",name:"OrderReturnInformation",slot:d==null?void 0:d.OrderReturnInformation,context:u,children:f(A,{children:[f("p",{children:[l.createdReturnAt,r("span",{children:_e((u==null?void 0:u.createdReturnAt)??"")})]}),f("p",{children:[l.returnStatusLabel,r(F,{id:`Order.CustomerDetails.returnStatus.${Se((u==null?void 0:u.returnStatus)??"")}`})]}),f("p",{children:[l.orderNumberLabel,r("span",{children:u==null?void 0:u.orderNumber})]})]})})})]}):null,S=!o&&w.length?f("div",{className:"order-customer-details-content__container-shipping_address",children:[r("h3",{className:"order-customer-details-content__container-title",children:l.shippingAddressTitle}),r("div",{className:"order-customer-details-content__container-description",children:w})]}):null,T=I.length?f("div",{className:R(["order-customer-details-content__container-billing_address",["order-customer-details-content__container-billing_address--fullwidth",!w.length||o]]),children:[r("h3",{className:"order-customer-details-content__container-title",children:l.billingAddressTitle}),r("div",{className:"order-customer-details-content__container-description",children:I})]}):null,N=E?f("div",{className:R(["order-customer-details-content__container-payment_methods",["order-customer-details-content__container-payment_methods--fullwidth",!a]]),children:[r("div",{className:"order-customer-details-content__container-title",children:l==null?void 0:l.paymentMethodsTitle}),f("p",{"data-testid":"payment_methods_description",className:R([["order-customer-details-content__container-payment_methods--icon",!!b]]),children:[r(W,{"data-testid":"PaymentMethodIcon",name:"PaymentMethodIcon",slot:d==null?void 0:d.PaymentMethodIcon,context:{selectedPaymentMethodCode:y},children:b?r(J,{source:b}):null}),_]})]}):null,z=a?f("div",{className:"order-customer-details-content__container-shipping_methods",children:[r("div",{className:"order-customer-details-content__container-title",children:l==null?void 0:l.shippingMethodsTitle}),C?f("p",{"data-testid":"shipping_methods_price",children:[r(P,{amount:C,currency:h})," ",a]}):r("p",{"data-testid":"shipping_methods_placeholder",children:l==null?void 0:l.freeShipping})]}):null,ce=p?M:f(A,{children:[T,z,N]});return f(U,{"data-testid":"order-details",variant:"secondary",className:R(["order-customer-details-content"]),children:[i?r(B,{title:t??(l==null?void 0:l.headerText),level:2}):null,f("div",{className:R(["order-customer-details-content__container",["order-customer-details-content__container--no-margin",w.length||I.length]]),children:[v,S,ce]})]})},He=({typeList:e,isEmpty:n,minifiedView:i,message:t})=>{const s=Ge(()=>{switch(e){case"orders":return{icon:Ht,text:r("p",{children:t}),className:"order-empty-list--empty-box"};default:return{icon:"",text:"",className:""}}},[e,t]);return!n||!e||!s.text?null:r(mt,{className:R(["order-empty-list",s.className,i?"order-empty-list--minified":""]),message:s.text,icon:r(J,{source:s.icon}),"data-testid":"emptyList"})},ir=e=>e.reduce((n,{code:i,required:t,defaultValue:s})=>(t&&(n[i]=s),n),{}),tt=({fieldsConfig:e,onSubmit:n})=>{const{requiredFieldError:i}=Z({requiredFieldError:"Order.Form.notifications.requiredFieldError"}),t=je(null),[s,c]=x({}),[l,d]=x({});H(()=>{if(c({}),!e||!e.length)return;const g=ir(e);c(g)},[e==null?void 0:e.length]),H(()=>()=>{var g;c({}),(g=t.current)==null||g.reset()},[]);const p=q((g,a)=>{const C=e.find(O=>O.code===g);return C!=null&&C.required&&!a?i:""},[e,i]),o=q(g=>{const{name:a,value:C,type:h,checked:O}=g==null?void 0:g.target,_=h==="checkbox"?O:C;c(y=>({...y,[a]:_}))},[]),u=q(g=>{const{name:a,value:C,type:h,checked:O}=g==null?void 0:g.target,_=h==="checkbox"?O:C;d(y=>({...y,[a]:p(a,_)}))},[p]),m=q(g=>{g.preventDefault();let a=!0;const C={};let h=null;for(const[O,_]of Object.entries(s)){const y=p(O,_);y&&(C[O]=y,a=!1,h||(h=O))}if(d(C),h&&t.current){const O=t.current.elements.namedItem(h);O==null||O.focus()}n==null||n(g,a)},[s,p,n]);return{formData:s,errors:l,formRef:t,handleChange:o,handleBlur:u,handleSubmit:m}},ar={email:"email",lastname:"family-name"},rt=ze(({loading:e,values:n,fields:i=[],errors:t,className:s="",onChange:c,onBlur:l})=>{const d=`${s}__item`,p=ge((a,C,h)=>{const O=a.options.map(_=>({text:_.label,value:_.value}));return r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(Ue,{name:a.id,floatingLabel:`${a.label} ${a.required?"*":""}`,placeholder:a.label,"aria-label":a.label,options:O,onBlur:l,handleSelect:c,value:C||a.defaultValue})},a.id)},[s,e,d,l,c]),o=ge((a,C,h)=>{const _=a.id==="email"?r(Wt,{}):void 0,y=ar[a.id]??"";return r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a==null?void 0:a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(ht,{"aria-label":a.label,"aria-required":a.required,autoComplete:y,icon:_,type:"text",name:a.id,value:C||a.defaultValue,placeholder:a.label,floatingLabel:`${a.label} ${a.required?"*":""}`,onBlur:l,onChange:c})},a.id)},[s,e,d,l,c]),u=ge((a,C,h)=>r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(pt,{type:"text",name:a.id,value:C||a.defaultValue,placeholder:a.label,floatingLabel:`${a.label} ${a.required?"*":""}`,onBlur:l,onChange:c})},a.id),[s,e,d,l,c]),m=ge((a,C,h)=>r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(Be,{name:a.id,checked:C||a.defaultValue,placeholder:a.label,label:`${a.label} ${a.required?"*":""}`,onBlur:l,onChange:c})},a.id),[s,e,d,l,c]),g=ge((a,C,h)=>r(fe,{error:h,className:R([d,`${d}--${a.id}`,[`${d}--${a.id}-hidden`,a.is_hidden],a.className]),"data-testid":`${s}--${a.id}`,disabled:e,children:r(gt,{type:"text",name:a.id,value:C===void 0?a.defaultValue:C,label:`${a.label} ${a.required?"*":""}`,onBlur:l,onChange:c})},a.id),[s,e,d,l,c]);return i.length?r(A,{children:i.map(a=>{var O;const C=(t==null?void 0:t[a.id])??"",h=(n==null?void 0:n[a.id])??"";switch(a.fieldType){case"TEXT":return(O=a==null?void 0:a.options)!=null&&O.length?p(a,h,C):o(a,h,C);case"MULTILINE":return o(a,h,C);case"SELECT":return p(a,h,C);case"DATE":return u(a,h,C);case"BOOLEAN":return m(a,h,C);case"TEXTAREA":return g(a,h,C);default:return null}})}):null}),nt=ze(({name:e,loading:n,children:i,className:t="defaultForm",fieldsConfig:s,onSubmit:c})=>{const{formData:l,errors:d,formRef:p,handleChange:o,handleBlur:u,handleSubmit:m}=tt({fieldsConfig:s,onSubmit:c});return f("form",{className:R(["order-form",t]),onSubmit:m,name:e,ref:p,children:[r(rt,{className:t,loading:n,fields:s,onChange:o,onBlur:u,errors:d,values:l}),i]})}),sr=({className:e,orderData:n,slots:i,routeCreateReturn:t,routeOnSuccess:s,onError:c})=>{const l=Z({cancel:"Order.OrderStatusContent.actions.cancel",createReturn:"Order.OrderStatusContent.actions.createReturn",createAnotherReturn:"Order.OrderStatusContent.actions.createAnotherReturn",reorder:"Order.OrderStatusContent.actions.reorder"}),d=Ge(()=>{const p=n==null?void 0:n.availableActions,o=!!(p!=null&&p.length),u=!!(n!=null&&n.returnNumber),m=()=>{ae(t,{},n)};return r(A,{children:i!=null&&i.OrderActions?r(W,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:i==null?void 0:i.OrderActions,context:n}):r("div",{"data-testid":"availableActionsList",className:R(["order-order-actions__wrapper",["order-order-actions__wrapper--empty",!o]]),children:p==null?void 0:p.map(g=>{switch(g){case ve.CANCEL:return r(A,{children:u?null:r(Ar,{orderRef:(n==null?void 0:n.token)||(n==null?void 0:n.id)||""})});case ve.RETURN:return r(Q,{variant:"secondary",onClick:m,children:u?l.createAnotherReturn:l.createReturn});case ve.REORDER:return r(A,{children:u?null:r(Xr,{orderData:n,onError:c,routeOnSuccess:s,children:l.reorder})})}})})})},[c,n,s,t,i,l]);return r("div",{className:R(["order-order-actions",e]),children:d})},se=()=>{const[e,n]=x(null);return H(()=>{var s;const i="orderStoreConfigPromise",t=sessionStorage.getItem("orderStoreConfig");if(t){const c=JSON.parse(t);n(c)}else{const c=window;c[i]||(c[i]=Ot().then(l=>(l&&sessionStorage.setItem("orderStoreConfig",JSON.stringify(l)),l))),(s=c[i])==null||s.then(l=>{l&&n(l)})}},[]),e},Te=(e,n)=>{try{return new URL(n??window.location.href).searchParams.get(e)??""}catch{return""}},cr=({onSuccess:e,onError:n,handleSetInLineAlert:i,orderData:t})=>{const[s,c]=x(!1),[l,d]=x({id:"",email:"",...t}),[p,o]=x("products"),[u,m]=x(!0),[g,a]=x([]),[C,h]=x([]),[O,_]=x([]),y=je([]);y.current.length!==g.length&&(y.current=g.map((v,M)=>y.current[M]||_t())),H(()=>{const v=G.on("order/data",M=>{var T;d(M);const S=Kt(M);_(S),c(((T=Te("orderRef"))==null?void 0:T.length)>20),m(!1)},{eager:!0});return()=>{v==null||v.off()}},[]),H(()=>{Lt("RMA_ITEM").then(v=>{v!=null&&v.length&&(h(v),m(!1))})},[]);const E=q(v=>{a(M=>M.findIndex(T=>(T==null?void 0:T.productSku)===(v==null?void 0:v.productSku))>-1?M.filter(T=>(T==null?void 0:T.productSku)!==(v==null?void 0:v.productSku)):[...M,v])},[]),b=q(v=>{o(v),i(),v==="products"&&a([])},[i]),w=q((v,M)=>{const S=g.map(T=>T.productSku===M?{...T,currentReturnOrderQuantity:v}:T);a(S)},[g]),I=q(async(v,M)=>{if(!M)return;m(!0);const S={orderUid:l.id,contactEmail:l.email},T=Xt(y);s?bt({token:Te("orderRef"),contactEmail:S.contactEmail,items:T,commentText:"."}).then(N=>{e==null||e(N),b("success"),i()}).catch(N=>{n==null||n(N.message),i({type:"error",heading:N.message})}):vt({...S,items:T}).then(N=>{e==null||e(N),b("success"),i()}).catch(N=>{n==null||n(N.message),i({type:"error",heading:N.message})}),m(!1)},[b,n,e,i,l,s]);return{order:l,steps:p,loading:u,formsRef:y,attributesList:C,selectedProductList:g,itemsEligibleForReturn:O,handleSelectedProductList:E,handleSetQuantity:w,handleChangeStep:b,onSubmit:I}},lr=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],dr=({orderData:e})=>{const[n,i]=x(!0),[t,s]=x(e),[c,l]=x([]);H(()=>{const o=G.on("order/data",u=>{s(u)},{eager:!0});return()=>{o==null||o.off()}},[]),H(()=>{Nt("shortRequest").then(o=>{if(o){const u=o.map(({name:m,orderNumber:g,label:a})=>({name:xt(m),orderNumber:g,label:lr.includes(m)?null:a}));l(u)}}).finally(()=>{i(!1)})},[]);const d=q(o=>{if(!c.length||!t||!t[o])return[];const u=t[o]?Object.fromEntries(Object.entries(t[o]).map(([m,g])=>[m.toLowerCase(),g])):{};return c.filter(({name:m})=>u[m.toLowerCase()]).map(m=>({name:m.name,orderNumber:m.orderNumber,value:u[m.name.toLowerCase()],label:m.label}))},[c,t]),p=oe(()=>({billingAddress:d("billingAddress"),shippingAddress:d("shippingAddress")}),[d]);return{order:t,normalizeAddress:p,loading:n}},de=e=>{let n=!1,i=!1;switch(e){case 1:i=!0;break;case 2:n=!0;break;case 3:n=!0,i=!0;break;default:n=!1,i=!1}return{taxIncluded:n,taxExcluded:i}},or=({orderData:e,config:n})=>{const[i,t]=x(!0),[s,c]=x(e),[l,d]=x(null);return H(()=>{if(n){const{shoppingOrderDisplayPrice:p,shoppingOrdersDisplayShipping:o,shoppingOrdersDisplaySubtotal:u,...m}=n;d(g=>({...g,...m,shoppingOrderDisplayPrice:de(p),shoppingOrdersDisplayShipping:de(o),shoppingOrdersDisplaySubtotal:de(u),salesPrintedCard:de(n.salesPrintedCard),salesGiftWrapping:de(n.salesGiftWrapping)})),t(!1)}},[n]),H(()=>{const p=G.on("order/data",o=>{c(o)},{eager:!0});return()=>{p==null||p.off()}},[]),{loading:i,storeConfig:l,order:s}},ur=({orderData:e,handleEmailAvailability:n,handleSignUpClick:i})=>{const[t,s]=x(e),[c,l]=x(),[d,p]=x(n?void 0:!0),o=t==null?void 0:t.email,m=i&&t!==void 0&&c===!1&&d===!0?()=>{const g=t.shippingAddress,a=t.billingAddress,C=[{code:"email",defaultValue:t.email},{code:"firstname",defaultValue:(a==null?void 0:a.firstName)??""},{code:"lastname",defaultValue:(a==null?void 0:a.lastName)??""}];let h=[];if(g){const O={...we(g),default_shipping:!0};h=[{...we(a),default_billing:!0},O]}else h=[{...we(a),default_billing:!0,default_shipping:!0}];i({inputsDefaultValueSet:C,addressesData:h})}:void 0;return H(()=>{const g=G.on("authenticated",a=>{l(a)},{eager:!0});return()=>{g==null||g.off()}},[]),H(()=>{const g=G.on("order/data",a=>{s(a)},{eager:!0});return()=>{g==null||g.off()}},[]),H(()=>{n&&c!==void 0&&(c||!o||n(o).then(g=>p(g)).catch(()=>p(!0)))},[c,n,o]),{order:t,onSignUpClickHandler:m}},mr=({orderData:e})=>{const[n,i]=x(e??null),[t,s]=x((e==null?void 0:e.comments)??[]);return H(()=>{const c=G.on("order/data",l=>{i(l),s((l==null?void 0:l.comments)??[])},{eager:!0});return()=>{c==null||c.off()}},[]),{comments:t,order:n}},hr=({orderData:e})=>{const[n,i]=x(!0),[t,s]=x(e);return H(()=>{const c=G.on("order/data",l=>{s(l),i(!1)},{eager:!0});return()=>{c==null||c.off()}},[]),{loading:n,order:t}},pr=({onError:e,isAuth:n,renderSignIn:i,routeCustomerOrder:t,routeGuestOrder:s})=>{const[c,l]=x({text:"",type:"success"}),[d,p]=x(!1),o=Z({invalidSearch:"Order.Errors.invalidSearch",email:"Order.OrderSearchForm.email",lastname:"Order.OrderSearchForm.lastname",number:"Order.OrderSearchForm.orderNumber"}),u=q(async a=>{const C=Te("orderRef"),h=C&&C.length>20;if(!a&&!C||!(a!=null&&a.number)&&!(a!=null&&a.token)&&!C)return null;if(n){const _=await Ve();(_==null?void 0:_.email)===a.email?ae(t,{orderRef:a==null?void 0:a.number}):h||ae(s,{orderRef:a.token})}else h||ae(s,{orderRef:(a==null?void 0:a.token)??""})},[n,t,s]);H(()=>{const a=G.on("order/data",C=>{u(C)},{eager:!0});return()=>{a==null||a.off()}},[u]),H(()=>{const a=Te("orderRef"),C=a&&a.length>20?a:null;a&&(C?ae(s,{orderRef:a}):n?ae(t,{orderRef:a}):i==null||i({render:!0,formValues:{number:a}}))},[n,t,s,i]);const m=oe(()=>[{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:o.email,options:[],defaultValue:"",fieldType:me.TEXT,className:"",required:!0,orderNumber:1,name:"email",id:"email",code:"email",isUnique:!1},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:o.lastname,options:[],defaultValue:"",fieldType:me.TEXT,className:"",required:!0,orderNumber:2,name:"lastname",id:"lastname",code:"lastname",isUnique:!1},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:o.number,options:[],defaultValue:"",fieldType:me.TEXT,className:"",required:!0,orderNumber:3,name:"number",id:"number",code:"number",isUnique:!1}],[o]);return{onSubmit:q(async(a,C)=>{if(!C)return null;p(!0);const h=Je(a.target);await St(h).then(O=>{O||l({text:o.invalidSearch,type:"warning"}),G.emit("order/data",O)}).catch(async O=>{var b;let _=!0;e==null||e({error:O.message});const y=n?await Ve():{email:""};if((y==null?void 0:y.email)===(h==null?void 0:h.email)){ae(t,{orderRef:h.number});return}_=i==null?void 0:i({render:y===null||((b=O==null?void 0:O.message)==null?void 0:b.includes("Please login to view the order.")),formValues:h}),_&&l({text:O.message,type:"warning"})}).finally(()=>{p(!1)})},[n,e,i,t,o.invalidSearch]),inLineAlert:c,loading:d,normalizeFieldsConfig:m}},gr=({orderData:e})=>{const[n,i]=x(e),[t,s]=x(e==null?void 0:e.status);return H(()=>{const c=G.on("order/data",l=>{i(l),s(l.status)},{eager:!0});return()=>{c==null||c.off()}},[]),{orderStatus:t,order:n}},Ze={totalPages:1,currentPage:1,pageSize:1},fr=({returnPageSize:e})=>{const[n,i]=x(!0),[t,s]=x([]),[c,l]=x(Ze),[d,p]=x(1);H(()=>{Tt(e,d).then(u=>{s((u==null?void 0:u.ordersReturn)??[]),l((u==null?void 0:u.pageInfo)??Ze)}).finally(()=>{i(!1)})},[e,d]),H(()=>{((window==null?void 0:window.scrollY)??0)>0&&(window==null||window.scrollTo({top:100,behavior:"smooth"}))},[d]);const o=q(u=>{p(u)},[]);return{pageInfo:c,selectedPage:d,loading:n,orderReturns:t,handleSetSelectPage:o}},yr=({orderData:e})=>{const[n,i]=x(!0),[t,s]=x(e),[c,l]=x(!1);return H(()=>{const d=G.on("order/data",p=>{s(p),l(p==null?void 0:p.isVirtual),i(!1)},{eager:!0});return e!=null&&e.id&&i(!1),()=>{d==null||d.off()}},[e]),{loading:n,order:t,isVirtualProduct:c}},qe=e=>{const n=new URL(window.location.href);e.forEach(i=>{n.searchParams.has(i)&&n.searchParams.delete(i)}),window.history.replaceState({},document.title,n.toString())},Cr=({enableOrderCancellation:e})=>{const n=Z({cancelOrderHeading:"Order.OrderStatusContent.actions.cancel",confirmGuestReturnHeading:"Order.OrderStatusContent.actions.confirmGuestReturn",orderCancelled:"Order.OrderStatusContent.orderCanceled.message",guestRequestReturnMessage:"Order.OrderStatusContent.actions.confirmGuestReturnMessage"}),[i,t]=x(!1),[s,c]=x(!1),[l,d]=x({heading:"",text:"",status:void 0}),p=q(()=>{t(!0),qe(["order_id","confirmation_key","action"])},[]),o=q((u,m,g)=>{d({heading:u,text:m,status:g}),qe(["action"])},[]);return H(()=>{const u=new URLSearchParams(window.location.search),m=u.get("order_id")??"",g=u.get("confirmation_key")??"",a=u.get("action")??"";s||!m||!g||!a||(e&&a==="cancel"&&(c(!0),Et(m,g).then(()=>{d({heading:n.cancelOrderHeading,text:n.orderCancelled,status:"success"})}).catch(C=>{d({heading:n.cancelOrderHeading,text:C.message,status:"warning"})})),a==="return"&&(c(!0),wt(m,g).then(()=>{d({heading:n.confirmGuestReturnHeading,text:n.guestRequestReturnMessage,status:"success"})}).catch(C=>{d({heading:n.confirmGuestReturnHeading,text:C.message,status:"warning"})})))},[e,n,o,s]),{orderActionStatus:l,isDismissed:i,onDismiss:p}},_r={success:It,warning:Gt,error:Xe},Or=()=>{const[e,n]=x({type:"success",heading:""}),i=q(t=>{if(!(t!=null&&t.type)){n({type:"success",heading:""});return}const s=r(J,{source:_r[t.type]});n({...t,icon:s})},[]);return{inLineAlertProps:e,handleSetInLineAlert:i}},ke=()=>{const[e,n]=x(window.innerWidth<768),i=q(ot(()=>{n(window.innerWidth<768)},1e3),[]);return H(()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}),[i]),e},Lr=({paymentIconsMap:e,orderData:n,title:i,className:t,slots:s})=>{const c=Z({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",paymentMethodsTitle:"Order.CustomerDetails.paymentMethods.title",returnInformationTitle:"Order.CustomerDetails.returnInformation.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping",createdReturnAt:"Order.CustomerDetails.orderReturnLabels.createdReturnAt",orderNumberLabel:"Order.CustomerDetails.orderReturnLabels.orderNumberLabel",returnStatusLabel:"Order.CustomerDetails.orderReturnLabels.returnStatusLabel"}),{order:l,normalizeAddress:d,loading:p}=dr({orderData:n});return r("div",{className:R(["order-customer-details",t]),children:r(nr,{slots:s,loading:p,order:l,title:i,paymentIconsMap:e,normalizeAddress:d,translations:c})})};Lr.displayName="CustomerDetails";const it=({orderRef:e,pickerProps:n,submitButtonProps:i,cancelReasons:t})=>{const s=Z({ErrorHeading:"Order.OrderCancelForm.errorHeading",ErrorDescription:"Order.OrderCancelForm.errorDescription",orderCancellationLabel:"Order.OrderCancelForm.label"}),[c,l]=x(0),[d,p]=x(!1),[o,u]=x(!1);G.on("authenticated",a=>{a&&u(!0)},{eager:!0});const m=a=>{a.preventDefault();const C=Number(a.target.value);l(C)};return f(nt,{onSubmit:async a=>(a.preventDefault(),(e.length>20?Mt:Rt)(e,t[c].text,h=>{o||(h.status="guest order cancellation requested"),G.emit("order/data",h)},()=>{p(!0)})),"data-testid":"order-order-cancel-reasons-form__text",children:[d&&r(Ee,{heading:s.ErrorHeading,description:s.ErrorDescription}),r("div",{className:"order-order-cancel-reasons-form__text",children:r(F,{id:"Order.OrderCancelForm.description"})}),r(Ue,{name:"cancellationReasons",floatingLabel:s.orderCancellationLabel,defaultOption:t[0],variant:"primary",options:t,value:String(c),handleSelect:m,required:!0,"data-testid":"order-cancellation-reasons-selector",...n}),r("div",{className:"order-order-cancel-reasons-form__button-container",children:r(Q,{variant:"primary","data-testid":"order-cancel-submit-button",...i,children:r(F,{id:"Order.OrderCancelForm.button"})})})]})};it.displayName="OrderCancelForm";const vr=({withHeader:e,orderData:n,children:i,className:t,...s})=>{const c=se(),{loading:l,storeConfig:d,order:p}=or({orderData:n,config:c}),o=Z({subtotal:"Order.OrderCostSummary.subtotal.title",shipping:"Order.OrderCostSummary.shipping.title",freeShipping:"Order.OrderCostSummary.shipping.freeShipping",tax:"Order.OrderCostSummary.tax.title",incl:"Order.OrderCostSummary.tax.incl",excl:"Order.OrderCostSummary.tax.excl",discount:"Order.OrderCostSummary.discount.title",discountSubtitle:"Order.OrderCostSummary.discount.subtitle",total:"Order.OrderCostSummary.total.title",totalFree:"Order.OrderCostSummary.totalFree",accordionTitle:"Order.OrderCostSummary.tax.accordionTitle",accordionTotalTax:"Order.OrderCostSummary.tax.accordionTotalTax",totalExcludingTaxes:"Order.OrderCostSummary.tax.totalExcludingTaxes",headerText:"Order.OrderCostSummary.headerText",printedCardTitle:"Order.OrderCostSummary.giftOptionsTax.printedCard.title",printedCardTitleInclTax:"Order.OrderCostSummary.giftOptionsTax.printedCard.inclTax",printedCardTitleExclTax:"Order.OrderCostSummary.giftOptionsTax.printedCard.exclTax",itemGiftWrappingTitle:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.title",itemGiftWrappingInclTax:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.inclTax",itemGiftWrappingExclTax:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.exclTax",orderGiftWrappingTitle:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.title",orderGiftWrappingInclTax:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.inclTax",orderGiftWrappingExclTax:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.exclTax"});return r("div",{...s,className:R(["order-cost-summary",t]),children:r(Fr,{order:p,withHeader:e,loading:l,storeConfig:d,translations:o})})};vr.displayName="OrderCostSummary";const br=e=>{var t;const{order:n,onSignUpClickHandler:i}=ur(e);return r("div",{children:n?r(Gr,{customerName:(t=n.billingAddress)==null?void 0:t.firstName,onSignUpClick:i,orderNumber:n.number}):r(Ir,{})})};br.displayName="OrderHeader";const Nr=({slots:e,className:n,orderData:i,withHeader:t,showConfigurableOptions:s,routeProductDetails:c})=>{const l=se(),{loading:d,order:p}=hr({orderData:i});return r("div",{className:R(["order-order-product-list",n]),children:r(Ur,{slots:e,loading:d,placeholderImage:(l==null?void 0:l.baseMediaUrl)??"",taxConfig:de((l==null?void 0:l.shoppingOrderDisplayPrice)??0),order:p,withHeader:t,showConfigurableOptions:s,routeProductDetails:c})})};Nr.displayName="OrderProductList";const xr=({orderData:e})=>{const[n,i]=x(e),[t,s]=x([]);return H(()=>{const c=G.on("order/data",l=>{i(l),s(l==null?void 0:l.returns)},{eager:!0});return()=>{c==null||c.off()}},[]),{order:n,orderReturns:t}},Sr=({slots:e,className:n,orderData:i,withHeader:t,withThumbnails:s,routeReturnDetails:c,routeProductDetails:l,routeTracking:d})=>{const p=se(),{orderReturns:o}=xr({orderData:i}),u=ke(),m="fullSizeView",g=(p==null?void 0:p.baseMediaUrl)??"",a=Z({minifiedViewTitle:`Order.Returns.${m}.returnsList.minifiedViewTitle`,ariaLabelLink:`Order.Returns.${m}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${m}.returnsList.emptyOrdersListMessage`,orderNumber:`Order.Returns.${m}.returnsList.orderNumber`,returnNumber:`Order.Returns.${m}.returnsList.returnNumber`,carrier:`Order.Returns.${m}.returnsList.carrier`});return r("div",{className:R(["order-order-returns",n]),children:o.length?r(dt,{placeholderImage:g,pageInfo:{pageSize:1,totalPages:1,currentPage:1},minifiedViewKey:m,slots:e,isMobile:u,withOrderNumber:!1,withReturnNumber:!0,orderReturns:o,translations:a,withHeader:t,withThumbnails:s,minifiedView:!1,routeReturnDetails:c,routeProductDetails:l,routeTracking:d,loading:!1}):null})};Sr.displayName="OrderReturns";const Tr=({className:e,isAuth:n,renderSignIn:i,routeCustomerOrder:t,routeGuestOrder:s,onError:c})=>{const{onSubmit:l,loading:d,inLineAlert:p,normalizeFieldsConfig:o}=pr({onError:c,isAuth:n,renderSignIn:i,routeCustomerOrder:t,routeGuestOrder:s});return r("div",{className:R(["order-order-search",e]),children:r(jr,{onSubmit:l,loading:d,inLineAlert:p,fieldsConfig:o})})};Tr.displayName="OrderSearch";const Er=({slots:e,orderData:n,className:i,statusTitle:t,status:s,routeCreateReturn:c,onError:l,routeOnSuccess:d})=>{const{orderStatus:p,order:o}=gr({orderData:n}),u=se(),{orderActionStatus:m,isDismissed:g,onDismiss:a}=Cr({enableOrderCancellation:u==null?void 0:u.orderCancellationEnabled});return f("div",{className:R(["order-order-status",i]),children:[!g&&(m==null?void 0:m.status)!==void 0?r(Ee,{style:{marginBottom:"1rem"},heading:m.heading,onDismiss:a,description:m.text,type:m.status}):null,o?r(Yr,{title:t,status:s||p,slots:e,orderData:o,routeCreateReturn:c,onError:l,routeOnSuccess:d}):r(Oe,{withCard:!1})]})};Er.displayName="OrderStatus";const wr=({slots:e,withReturnsListButton:n,className:i,minifiedView:t,withHeader:s,withThumbnails:c,returnPageSize:l,returnsInMinifiedView:d,routeReturnDetails:p,routeOrderDetails:o,routeTracking:u,routeReturnsList:m,routeProductDetails:g})=>{const a=se(),{pageInfo:C,selectedPage:h,handleSetSelectPage:O,loading:_,orderReturns:y}=fr({returnPageSize:l}),E=ke(),b=t?"minifiedView":"fullSizeView",w=Z({viewAllOrdersButton:`Order.Returns.${b}.returnsList.viewAllOrdersButton`,ariaLabelLink:`Order.Returns.${b}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${b}.returnsList.emptyOrdersListMessage`,minifiedViewTitle:`Order.Returns.${b}.returnsList.minifiedViewTitle`,orderNumber:`Order.Returns.${b}.returnsList.orderNumber`,returnNumber:`Order.Returns.${b}.returnsList.returnNumber`,carrier:`Order.Returns.${b}.returnsList.carrier`});return r("div",{className:R(["order-returns-list",i]),children:r(dt,{placeholderImage:(a==null?void 0:a.baseMediaUrl)??"",minifiedViewKey:b,withOrderNumber:!0,withReturnNumber:!0,slots:e,selectedPage:h,handleSetSelectPage:O,pageInfo:C,withReturnsListButton:n,isMobile:E,orderReturns:y,translations:w,withHeader:s,returnsInMinifiedView:d,withThumbnails:c,minifiedView:t,routeReturnDetails:p,routeOrderDetails:o,routeTracking:u,routeReturnsList:m,routeProductDetails:g,loading:_})})};wr.displayName="ReturnsList";const Mr=({slots:e,className:n,collapseThreshold:i,orderData:t,routeOrderDetails:s,routeTracking:c,routeProductDetails:l})=>{const{loading:d,order:p,isVirtualProduct:o}=yr({orderData:t}),u=se(),m=Z({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",returnOrderCardTitle:"Order.ShippingStatusCard.returnOrderCardTitle",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",noInfoTitle:"Order.ShippingStatusCard.noInfoTitle",returnNumber:"Order.ShippingStatusCard.returnNumber",shipmentNumber:"Order.ShippingStatusCard.shipmentNumber",orderNumber:"Order.ShippingStatusCard.orderNumber",trackButton:"Order.ShippingStatusCard.trackButton"});if(!d&&o)return null;const g=(u==null?void 0:u.baseMediaUrl)??"";return r("div",{className:R(["order-shipping-status",n]),children:!d&&p?r(tn,{placeholderImage:g,translations:m,routeOrderDetails:s,routeTracking:c,slots:e,orderData:p,collapseThreshold:i,routeProductDetails:l}):r(Oe,{withCard:!1})})};Mr.displayName="ShippingStatus";const Rr=({orderData:e,className:n,...i})=>{const{comments:t,order:s}=mr({orderData:e});return s?r("div",{...i,className:R(["order-order-comments-container",n]),children:r(an,{comments:t})}):r("div",{className:R(["order-order-comments-container",n]),children:r(Oe,{withCard:!1})})};Rr.displayName="OrderComments";const Ar=({orderRef:e})=>{const[n,i]=x(!1),t=()=>{i(!0)},s=()=>{i(!1)},c=se(),l=(c==null?void 0:c.orderCancellationReasons)??[],d=p=>p.map((o,u)=>({text:o==null?void 0:o.description,value:u.toString()}));return G.on("order/data",p=>{const o=String((p==null?void 0:p.status)??"").toLocaleLowerCase();(o==="guest order cancellation requested"||o==="canceled")&&s()}),f(A,{children:[r(Q,{variant:"secondary",onClick:t,"data-testid":"cancel-button",children:r(F,{id:"Order.OrderStatusContent.actions.cancel"})}),n&&r(ft,{centered:!0,size:"medium",onClose:s,className:"order-order-cancel__modal",title:r("h2",{className:"order-order-cancel__title",children:r(F,{id:"Order.OrderCancelForm.title"})}),"data-testid":"order-cancellation-reasons-modal",children:r(it,{orderRef:e,cancelReasons:d(l)})})]})},Oe=({testId:e,withCard:n=!0})=>{const i=f(Le,{"data-testid":e??"skeletonLoader",children:[r($,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),r($,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),r($,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1})]});return n?i:r(U,{variant:"secondary",className:R(["order-order-loaders","order-order-loaders--card-loader"]),children:i})},kr=e=>r(U,{variant:"secondary",...e,children:f(Le,{"data-testid":"order-details-skeleton",children:[r($,{variant:"heading",size:"medium",fullWidth:!0}),r($,{size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{size:"xlarge"}),r($,{size:"xlarge"}),r($,{size:"xlarge"}),r($,{size:"xlarge"})]})}),at=()=>f(Le,{"data-testid":"order-product-list-skeleton",style:{gridTemplateColumns:"1fr"},children:[r($,{variant:"heading",fullWidth:!0,size:"medium"}),r(ye,{}),r(ye,{}),r(ye,{}),r(ye,{}),r(ye,{})]}),st=()=>f(Le,{"data-testid":"order-cost-summary-content-skeleton",className:"order-cost-summary-content",children:[r($,{variant:"heading",size:"small"}),r($,{variant:"empty",size:"small"}),r($,{variant:"empty",size:"small"}),r($,{variant:"empty",size:"small"}),r($,{variant:"heading",size:"small",fullWidth:!0,lines:3})]}),Ir=()=>f(Le,{"data-testid":"order-header-skeleton",className:"order-header",children:[r($,{variant:"empty",size:"xlarge",fullWidth:!0}),r($,{variant:"empty",size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{variant:"empty",size:"medium"}),r($,{size:"small",fullWidth:!0}),r($,{variant:"heading",size:"xsmall",fullWidth:!0})]}),We=({salesGiftWrapping:e,giftWrappingPrice:n,giftWrappingPriceInclTax:i,giftWrappingTitle:t,giftWrappingExclTaxText:s,giftWrappingInclTaxText:c})=>{const l=e==null?void 0:e.taxIncluded,d=e==null?void 0:e.taxExcluded,p=l&&!d,o=d&&!l,u=d&&l;if(n.value===0||i.value===0)return null;const m=p?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:c}),r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:i.currency,amount:i.value})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:r("span",{children:c})})]}):null,g=o?f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:t}),r("span",{children:r(P,{weight:"normal",currency:n.currency,amount:n.value})})]}):null,a=u?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:t}),r("span",{children:r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:i.currency,amount:i.value})})]}),f("div",{className:"order-cost-summary-content__description--subheader",children:[r(P,{currency:n.currency,amount:n.value,size:"small",weight:"bold"})," ",r("span",{children:s})]})]}):null;return f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--gift-wrapping",children:[m,g,a]})},Vr=({translations:e,order:n,salesPrintedCard:i})=>{const t=n==null?void 0:n.totalGiftOptions,{printedCard:s,printedCardInclTax:c}=t,l=i==null?void 0:i.taxIncluded,d=i==null?void 0:i.taxExcluded;if(s.value===0||c.value===0)return null;const p=l&&!d?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.printedCardTitle}),r("span",{children:r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:c.currency,amount:c.value})})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:r("span",{children:r("span",{children:e.printedCardTitleInclTax})})})]}):null,o=d&&!l?f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.printedCardTitle}),r("span",{children:r(P,{weight:"normal",currency:s.currency,amount:s.value})})]}):null,u=d&&l?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.printedCardTitle}),r("span",{children:r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:c.currency,amount:c.value})})]}),f("div",{className:"order-cost-summary-content__description--subheader",children:[r(P,{currency:s.currency,amount:s.value,size:"small",weight:"bold"})," ",r("span",{children:e.printedCardTitleExclTax})]})]}):null;return f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--printed-card",children:[p,o,u]})},Pr=({translations:e,order:n,subtotalInclTax:i,subtotalExclTax:t,shoppingOrdersDisplaySubtotal:s})=>{var u,m,g,a;const c=s.taxIncluded,l=s.taxExcluded,d=c&&!l?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.subtotal}),r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(u=n==null?void 0:n.subtotalInclTax)==null?void 0:u.currency,amount:i})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:r("span",{children:e.incl})})]}):null,p=l&&!c?f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.subtotal}),r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(m=n==null?void 0:n.subtotalExclTax)==null?void 0:m.currency,amount:t})]}):null,o=l&&c?f(A,{children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.subtotal}),r(P,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(g=n==null?void 0:n.subtotalInclTax)==null?void 0:g.currency,amount:i})]}),f("div",{className:"order-cost-summary-content__description--subheader",children:[r(P,{currency:(a=n==null?void 0:n.subtotalExclTax)==null?void 0:a.currency,amount:t,size:"small",weight:"bold"})," ",r("span",{children:e.excl})]})]}):null;return f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--subtotal",children:[d,p,o]})},$r=({translations:e,shoppingOrdersDisplayShipping:n,order:i,totalShipping:t})=>{var s,c,l,d;return i!=null&&i.isVirtual?null:f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--shipping",children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.shipping}),(s=i==null?void 0:i.totalShipping)!=null&&s.value?r(P,{weight:"normal",currency:(c=i==null?void 0:i.totalShipping)==null?void 0:c.currency,amount:t}):r("span",{children:e.freeShipping})]}),f("div",{className:"order-cost-summary-content__description--subheader",children:[n.taxIncluded&&n.taxExcluded?f(A,{children:[r(P,{weight:"normal",currency:(l=i==null?void 0:i.totalShipping)==null?void 0:l.currency,amount:(d=i==null?void 0:i.totalShipping)==null?void 0:d.value,size:"small"}),f("span",{children:[" ",e.excl]})]}):null,n.taxIncluded&&!n.taxExcluded?r("span",{children:e.incl}):null]})]})},Hr=({translations:e,order:n})=>{var c,l;const i=n==null?void 0:n.coupons,t=n==null?void 0:n.discounts,s=(t==null?void 0:t.reduce((d,p)=>d+(p.amount.value??0),0))||0;return!((c=n==null?void 0:n.discounts)!=null&&c.length)&&s===0?null:f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.discount}),r("span",{children:r(P,{weight:"normal",sale:!0,currency:(l=t[0])==null?void 0:l.amount.currency,amount:-s})})]}),i.map(d=>r("div",{className:"order-cost-summary-content__description--subheader",children:f("span",{children:[r(J,{source:$t,size:"16",className:"order-cost-summary-content__description--coupon-icon"}),r("span",{children:d.code})]})},d.code))]})},Zr=({translations:e,shoppingOrdersDisplaySubtotal:n,order:i})=>{var s,c,l,d,p;const t=((s=i==null?void 0:i.grandTotal)==null?void 0:s.value)===0;return f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--total",children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.total}),t?r("span",{className:"order-cost-summary-content__description--total-free",children:e.totalFree}):r(P,{currency:(c=i==null?void 0:i.grandTotal)==null?void 0:c.currency,amount:(l=i==null?void 0:i.grandTotal)==null?void 0:l.value,weight:"bold",size:"medium"})]}),n.taxExcluded&&n.taxIncluded&&!t?f("div",{className:"order-cost-summary-content__description--subheader",children:[r("span",{children:e.totalExcludingTaxes}),r(P,{currency:(d=i==null?void 0:i.grandTotalExclTax)==null?void 0:d.currency,amount:(p=i==null?void 0:i.grandTotalExclTax)==null?void 0:p.value,weight:"normal",size:"small"})]}):null]})},qr=({translations:e,renderTaxAccordion:n,totalAccordionTaxValue:i,order:t})=>{var l,d,p;const[s,c]=x(!1);return n?r(be,{"data-testid":"tax-accordionTaxes",className:"order-cost-summary-content__accordion",iconOpen:Vt,iconClose:Pt,children:f(Ne,{onStateChange:c,title:e.accordionTitle,secondaryText:r(A,{children:s?null:r(P,{weight:"normal",amount:i,currency:(d=t==null?void 0:t.totalTax)==null?void 0:d.currency})}),renderContentWhenClosed:!1,children:[(p=t==null?void 0:t.taxes)==null?void 0:p.map((o,u)=>{var m,g,a;return f("div",{className:"order-cost-summary-content__accordion-row",children:[r("p",{children:o==null?void 0:o.title}),r("p",{children:r(P,{weight:"normal",amount:(m=o==null?void 0:o.amount)==null?void 0:m.value,currency:(g=o==null?void 0:o.amount)==null?void 0:g.currency})})]},`${(a=o==null?void 0:o.amount)==null?void 0:a.value}${u}`)}),f("div",{className:"order-cost-summary-content__accordion-row order-cost-summary-content__accordion-total",children:[r("p",{children:e.accordionTotalTax}),r("p",{children:r(P,{weight:"normal",amount:i,currency:t.totalTax.currency,size:"medium"})})]})]})}):r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--tax",children:f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:e.tax}),r(P,{currency:(l=t==null?void 0:t.totalTax)==null?void 0:l.currency,amount:t==null?void 0:t.totalTax.value,weight:"normal",size:"small"})]})})},Wr=({totalGiftCardValue:e,totalGiftCardCurrency:n,order:i})=>{const t=i==null?void 0:i.appliedGiftCards;return e?f("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[f("div",{className:"order-cost-summary-content__description--header",children:[r("span",{children:r(F,{id:"Order.OrderCostSummary.appliedGiftCards.label",plural:t==null?void 0:t.length,fields:{count:t==null?void 0:t.length}})}),r("span",{children:r(P,{weight:"normal",sale:!0,currency:n,amount:-e})})]}),t.map(s=>r("div",{className:"order-cost-summary-content__description--subheader",children:f("span",{children:[r(J,{source:Zt,size:"16",className:"order-cost-summary-content__description--giftcard-icon"}),r("span",{children:s.code})]})},s.code))]}):null},Me={taxIncluded:!1,taxExcluded:!1},Fr=({translations:e,loading:n,storeConfig:i,order:t,withHeader:s=!0})=>{var g,a,C,h,O,_,y;if(n||!t)return r(st,{});const c=((g=t==null?void 0:t.totalGiftCard)==null?void 0:g.value)??0,l=((a=t.totalGiftCard)==null?void 0:a.currency)??"",d=((C=t.subtotalInclTax)==null?void 0:C.value)??0,p=((h=t.subtotalExclTax)==null?void 0:h.value)??0,o=((O=t.totalShipping)==null?void 0:O.value)??0,u=!!((_=t==null?void 0:t.taxes)!=null&&_.length)&&!!(i!=null&&i.shoppingOrdersDisplayFullSummary),m=u?(y=t==null?void 0:t.taxes)==null?void 0:y.reduce((E,b)=>{var w;return+((w=b==null?void 0:b.amount)==null?void 0:w.value)+E},0):0;return f(U,{variant:"secondary",className:R(["order-cost-summary-content"]),children:[s?r(B,{title:e.headerText,level:2}):null,f("div",{className:"order-cost-summary-content__wrapper",children:[r(Pr,{translations:e,order:t,subtotalInclTax:d,subtotalExclTax:p,shoppingOrdersDisplaySubtotal:(i==null?void 0:i.shoppingOrdersDisplaySubtotal)??Me}),r($r,{translations:e,order:t,totalShipping:o,shoppingOrdersDisplayShipping:(i==null?void 0:i.shoppingOrdersDisplayShipping)??Me}),r(Vr,{order:t,translations:e,salesPrintedCard:i==null?void 0:i.salesPrintedCard}),r(We,{salesGiftWrapping:i==null?void 0:i.salesGiftWrapping,giftWrappingPrice:t.totalGiftOptions.giftWrappingForItems,giftWrappingPriceInclTax:t.totalGiftOptions.giftWrappingForItemsInclTax,giftWrappingTitle:e.itemGiftWrappingTitle,giftWrappingExclTaxText:e.itemGiftWrappingExclTax,giftWrappingInclTaxText:e.itemGiftWrappingInclTax}),r(We,{salesGiftWrapping:i==null?void 0:i.salesGiftWrapping,giftWrappingPrice:t.totalGiftOptions.giftWrappingForOrder,giftWrappingPriceInclTax:t.totalGiftOptions.giftWrappingForOrderInclTax,giftWrappingTitle:e.orderGiftWrappingTitle,giftWrappingExclTaxText:e.orderGiftWrappingExclTax,giftWrappingInclTaxText:e.orderGiftWrappingInclTax}),r(Hr,{translations:e,order:t}),r(Wr,{order:t,totalGiftCardValue:c,totalGiftCardCurrency:l}),r(qr,{order:t,translations:e,renderTaxAccordion:u,totalAccordionTaxValue:m}),r(Zr,{translations:e,shoppingOrdersDisplaySubtotal:(i==null?void 0:i.shoppingOrdersDisplaySubtotal)??Me,order:t})]})]})},Gr=({customerName:e,orderNumber:n,onSignUpClick:i})=>{const t=Z({title:r(F,{id:"Order.OrderHeader.title",fields:{name:e}}),defaultTitle:"Order.OrderHeader.defaultTitle",order:r(F,{id:"Order.OrderHeader.order",fields:{order:n}}),createAccountMessage:"Order.OrderHeader.CreateAccount.message",createAccountButton:"Order.OrderHeader.CreateAccount.button"});return f("div",{"data-testid":"order-header",className:"order-header order-header__card",children:[r(J,{source:qt,size:"64",className:"order-header__icon"}),r(B,{className:"order-header__title",title:t.title,size:"large",divider:!1,children:e?t.title:t.defaultTitle}),r("p",{className:"order-header__order",children:t.order}),i&&f("div",{className:"order-header-create-account",children:[r("p",{className:"order-header-create-account__message",children:t.createAccountMessage}),r(Q,{"data-testid":"create-account-button",className:"order-header-create-account__button",size:"medium",variant:"secondary",type:"submit",onClick:i,children:t.createAccountButton})]})]})},zr=e=>{const n=(e==null?void 0:e.items)??[],i=n.filter(c=>(c==null?void 0:c.eligibleForReturn)&&(c==null?void 0:c.quantityReturnRequested)).map(c=>({...c,totalQuantity:c.quantityReturnRequested})),t=new Map(i.map(c=>[c.id,c])),s=n.map(c=>{const l=t.get(c==null?void 0:c.id);if(l){const d=c.totalQuantity-l.quantityReturnRequested;return d===0?null:{...c,totalQuantity:d}}return c}).filter(c=>c!==null);return{returnedList:i,canceledItems:s==null?void 0:s.filter(c=>c.quantityCanceled),nonCanceledItems:s==null?void 0:s.filter(c=>!c.quantityCanceled)}},Ur=({slots:e,placeholderImage:n,loading:i,taxConfig:t,order:s=null,withHeader:c=!0,showConfigurableOptions:l,routeProductDetails:d})=>{const p=!!(s!=null&&s.returnNumber),o=Z({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",returned:"Order.OrderProductListContent.returnedTitle",refunded:"Order.OrderProductListContent.refundedTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),u=oe(()=>{var g,a;if(!s)return[];if(!p){const{returnedList:C,canceledItems:h,nonCanceledItems:O}=zr(s);return[{type:"returned",list:C,title:o.returned},{type:"cancelled",list:h,title:o.cancelled},{type:"allItems",list:O,title:o.allOrders}].filter(_=>{var y;return((y=_==null?void 0:_.list)==null?void 0:y.length)>0})}return[{type:"returned",list:((a=(g=s.returns.find(C=>C.returnNumber===(s==null?void 0:s.returnNumber)))==null?void 0:g.items)==null?void 0:a.map(C=>({...C,totalQuantity:C.requestQuantity})))??[],title:o.returned}]},[s,p,o]);return s?u.every(m=>m.list.length===0)?null:r(U,{variant:"secondary",className:"order-order-product-list-content",children:u.map((m,g)=>{var C;const a=m.list.filter(h=>h!==null).reduce((h,{totalQuantity:O})=>O+h,0);return f(Ye,{children:[c?r(B,{title:`${m.title} (${a})`,level:2}):null,r("ul",{className:"order-order-product-list-content__items",children:(C=m.list)==null?void 0:C.filter(h=>h!==null).map(h=>r("li",{"data-testid":"order-product-list-content-item",children:r(lt,{slots:e,placeholderImage:n,loading:i,product:h,itemType:m.type,taxConfig:t,translations:o,showConfigurableOptions:l,routeProductDetails:d})},h.id))})]},g)})}):r(at,{})};function Br(e){var t,s,c,l,d,p,o,u,m,g;const n=((t=e.regularPrice)==null?void 0:t.value)??0;if(n>0)return{value:n,currency:((s=e.regularPrice)==null?void 0:s.currency)??((c=e.price)==null?void 0:c.currency)??"USD"};const i=((d=(l=e.itemPrices)==null?void 0:l.originalPrice)==null?void 0:d.value)??0;return i>0?{value:i,currency:((o=(p=e.itemPrices)==null?void 0:p.originalPrice)==null?void 0:o.currency)??((u=e.price)==null?void 0:u.currency)??"USD"}:{value:0,currency:((m=e.price)==null?void 0:m.currency)??((g=e.regularPrice)==null?void 0:g.currency)??"USD"}}function ct(e){var i,t,s;const n=((i=e.price)==null?void 0:i.value)??0;return n>0?{value:n,currency:((t=e.price)==null?void 0:t.currency)??((s=e.regularPrice)==null?void 0:s.currency)??"USD"}:Br(e)}function Qr(e){const n=ct(e),i=e.totalQuantity??1;return{value:n.value*i,currency:n.currency}}const lt=({slots:e,placeholderImage:n="",loading:i,product:t,itemType:s,taxConfig:c,translations:l,disabledIncrementer:d,onQuantity:p,showConfigurableOptions:o,routeProductDetails:u})=>{var ee,te,re,ne,ie,pe;const{taxExcluded:m,taxIncluded:g}=c,a=q((V,X,K)=>r(P,{amount:V,currency:X,weight:"normal",...K}),[]),C=q(V=>{var ue,Ie;const X=(V==null?void 0:V.productName)??"",K={title:X,src:((Ie=(ue=V==null?void 0:V.product)==null?void 0:ue.thumbnail)==null?void 0:Ie.url)??n,alt:X,width:90,height:120,loading:"lazy"};return r(W,{slotTag:"span",contentTag:"span","data-testid":`cartSummaryItemImage-${V.id}`,name:"CartSummaryItemImage",slot:e==null?void 0:e.CartSummaryItemImage,context:{data:V,defaultImageProps:K},children:r(he,{...K})})},[n,e==null?void 0:e.CartSummaryItemImage]);if(!t)return r(st,{});let h={};const O=s==="cancelled",_=(te=(ee=t==null?void 0:t.product)==null?void 0:ee.stockStatus)==null?void 0:te.includes("IN_STOCK"),y=t==null?void 0:t.giftCard,E=t.totalQuantity>1?{quantity:t.totalQuantity}:{},b=t.discounted,{includeAndExcludeTax:w,includeTax:I,excludeTax:v}=t.taxCalculations,M=t==null?void 0:t.totalQuantity,S={...(t==null?void 0:t.configurableOptions)||{},...(t==null?void 0:t.bundleOptions)||{},...y!=null&&y.senderName?{[l.sender]:y==null?void 0:y.senderName}:{},...y!=null&&y.senderEmail?{[l.sender]:y==null?void 0:y.senderEmail}:{},...y!=null&&y.senderName?{[l.sender]:y==null?void 0:y.senderName}:{},...y!=null&&y.recipientEmail?{[l.recipient]:y==null?void 0:y.recipientEmail}:{},...y!=null&&y.message?{[l.message]:y==null?void 0:y.message}:{},...t!=null&&t.downloadableLinks?{[`${(re=t==null?void 0:t.downloadableLinks)==null?void 0:re.count} ${l.downloadableCount}`]:(ne=t==null?void 0:t.downloadableLinks)==null?void 0:ne.result}:{}},T=t==null?void 0:t.freeGiftLabel,N=!!((t==null?void 0:t.isFreeGift)??T),z=T?r("div",{className:"cart-summary-item__discount-labels",children:r("div",{className:"cart-summary-item__discount-label",children:T})}):null,ce=()=>z,j=()=>{const V=Qr(t);return V.value===0?a(0,V.currency,{weight:"bold"}):f(A,{children:[a(V.value,V.currency,{variant:"strikethrough",weight:"bold"}),a(0,V.currency,{sale:!0,weight:"bold"})]})},Y=f(A,{children:[(()=>{const V=ct(t);return r(P,{amount:V.value,currency:V.currency,weight:"normal","data-testid":"free-gift-unit-price"})})(),ce()]}),k=j(),le=a(0,((ie=t.price)==null?void 0:ie.currency)??"USD",{weight:"bold"});if(N)h={taxExcluded:g&&m?!0:void 0,taxIncluded:g&&!m?!0:void 0,price:Y,total:k,...m?{totalExcludingTax:le}:{}};else if(g&&m){const V=a(w.originalPrice.value,w.originalPrice.currency),X=a(w.baseOriginalPrice.value*M,w.baseOriginalPrice.currency,{variant:t.discounted?"strikethrough":"default",weight:"bold"}),K=a(w.baseDiscountedPrice.value*M,w.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),ue=a(w.baseExcludingTax.value*M,w.baseExcludingTax.currency,{weight:"bold"});h={taxExcluded:!0,taxIncluded:void 0,price:V,total:f(A,{children:[X,t.discounted?K:null]}),totalExcludingTax:ue}}else if(!g&&m){const V=a(v.originalPrice.value,v.originalPrice.currency),X=a(v.baseOriginalPrice.value*M,v.baseOriginalPrice.currency,{variant:b?"strikethrough":"default",weight:"bold"}),K=a(v.baseDiscountedPrice.value*M,v.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),ue=a(v.baseExcludingTax.value*M,v.baseExcludingTax.currency,{weight:"bold"});h={taxExcluded:void 0,taxIncluded:void 0,price:V,total:f(A,{children:[X,b?K:null]}),totalExcludingTax:ue}}else if(g&&!m){const V=a(I.singleItemPrice.value,I.singleItemPrice.currency),X=a(I.baseOriginalPrice.value*M,I.baseOriginalPrice.currency,{variant:b?"strikethrough":"default",weight:"bold"}),K=a(I.baseDiscountedPrice.value*M,I.baseDiscountedPrice.currency,{sale:!0,weight:"bold"});h={taxExcluded:void 0,taxIncluded:!0,price:V,total:f(A,{children:[X,b?K:null]})}}return r(Qe,{loading:i,alert:O&&!_?f("span",{children:[r(J,{source:Xe}),l.outOfStock]}):r(A,{}),configurations:(o==null?void 0:o(S))??S,title:r("h3",{"data-testid":"product-name",className:"cart-summary-item__title",children:u?r("a",{href:u(t),children:t==null?void 0:t.productName}):t==null?void 0:t.productName}),sku:r("div",{children:(pe=t==null?void 0:t.product)==null?void 0:pe.sku}),...E,image:u?r("a",{href:u(t),children:C(t)}):C(t),...h,footer:f(A,{children:[p&&!d?r(yt,{value:1,min:1,max:t==null?void 0:t.totalQuantity,onValue:V=>p==null?void 0:p(Number(V)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0,r(W,{"data-testid":"Footer",name:"Footer",slot:e==null?void 0:e.Footer,context:{item:t}})]})})},jr=({onSubmit:e,loading:n,inLineAlert:i,fieldsConfig:t})=>f(U,{variant:"secondary",className:"order-order-search-form",children:[r("h2",{className:"order-order-search-form__title",children:r(F,{id:"Order.OrderSearchForm.title"})}),r("p",{children:r(F,{id:"Order.OrderSearchForm.description"})}),i.text?r(Ee,{"data-testid":"orderAlert",className:"order-order-search-form__alert",type:i.type,variant:"secondary",heading:i.text,icon:r(J,{source:zt})}):null,r(nt,{className:"order-order-search-form__wrapper",name:"orderSearchForm",loading:n,fieldsConfig:t,onSubmit:e,children:r("div",{className:"order-order-search-form__button-container",children:r(Q,{className:"order-order-search-form__button",size:"medium",variant:"primary",type:"submit",disabled:n,children:r(F,{id:"Order.OrderSearchForm.button"})},"logIn")})})]}),Ae=e=>e&&e.charAt(0).toLocaleUpperCase()+e.slice(1).toLocaleLowerCase(),Re={pending:"orderPending",shiping:"orderShipped",complete:"orderComplete",processing:"orderProcessing","on hold":"orderOnHold",canceled:"orderCanceled","suspected fraud":"orderSuspectedFraud","payment Review":"orderPaymentReview","order received":"orderReceived","guest order cancellation requested":"guestOrderCancellationRequested","pending payment":"orderPendingPayment",rejected:"orderRejected",authorized:"orderAuthorized","paypal canceled reversal":"orderPaypalCanceledReversal","pending paypal":"orderPendingPaypal","paypal reversed":"orderPaypalReversed",closed:"orderClosed"},Yr=({slots:e,title:n,status:i,orderData:t,routeCreateReturn:s,onError:c,routeOnSuccess:l})=>{var S,T,N;const d=!!(t!=null&&t.returnNumber),p=String(i).toLocaleLowerCase(),o=(S=t==null?void 0:t.returns)==null?void 0:S[0],u=(o==null?void 0:o.returnStatus)??"",m=(o==null?void 0:o.createdReturnAt)??"",g=Z({message:"Order.OrderStatusContent.orderPlaceholder.message",messageWithoutDate:"Order.OrderStatusContent.orderPlaceholder.messageWithoutDate"}),a=Z(`Order.OrderStatusContent.${Re[p]}.title`),C=Z(`Order.OrderStatusContent.${Re[p]}.message`),h=Z(`Order.OrderStatusContent.${Re[p]}.messageWithoutDate`),O=Z({title:`Order.OrderStatusContent.returnStatus.${Se(u)}`,returnMessage:"Order.OrderStatusContent.returnMessage"}),_=Z({adminAssistedLabel:"Order.OrderStatusContent.adminAssistedLabel"});if(!i)return r("div",{});const y=a!=null&&a.title?a:{title:Ae(p)},E=C!=null&&C.message?C:g,b=h!=null&&h.messageWithoutDate?h:g,w=t!=null&&t.orderStatusChangeDate?E==null?void 0:E.message.replace("{DATE}",_e(t==null?void 0:t.orderStatusChangeDate)):b.messageWithoutDate,I=t==null?void 0:t.adminAssistedOrder,v=((N=(T=O==null?void 0:O.returnMessage)==null?void 0:T.replace("{ORDER_CREATE_DATE}",_e((t==null?void 0:t.orderDate)??"")))==null?void 0:N.replace("{RETURN_CREATE_DATE}",_e(m)))??"",M=d?n??(O.title||Ae(u)):n??y.title;return f(U,{className:"order-order-status-content",variant:"secondary",children:[r(B,{title:M,level:2}),f("div",{className:"order-order-status-content__wrapper",children:[f("div",{className:R(["order-order-status-content__wrapper-description",["order-order-status-content__wrapper-description--actions-slot",!!(e!=null&&e.OrderActions)]]),children:[I&&r("p",{className:"order-order-status-content__admin-assisted",children:_==null?void 0:_.adminAssistedLabel}),r("p",{children:d?v:w})]}),r(sr,{orderData:t,slots:e,routeCreateReturn:s,routeOnSuccess:l,onError:c})]})]})},Xr=({onError:e,routeOnSuccess:n,orderData:i,children:t})=>{const[s,c]=x(!1),l=q(()=>{c(!0);const d=(i==null?void 0:i.number)??"";At(d).then(({success:p,userInputErrors:o})=>{p&&ae(n,{}),o.length&&(e==null||e(o))}).catch(p=>{e==null||e(p.message)}).finally(()=>{c(!1)})},[i,n,e]);return r(Q,{type:"button",disabled:s,variant:"secondary",className:"order-reorder",onClick:l,children:t})},Kr=({routeReturnSuccess:e,translations:n,orderData:i})=>f("div",{className:"order-return-order-message",children:[r("p",{className:"order-return-order-message__title",children:n.successTitle}),r("p",{className:"order-return-order-message__subtitle",children:n.successMessage}),r(Q,{href:(e==null?void 0:e(i))??"#",children:n.backStore})]}),Jr=({placeholderImage:e,itemsEligibleForReturn:n,slots:i,loading:t,taxConfig:s,translations:c,selectedProductList:l,handleSelectedProductList:d,showConfigurableOptions:p,handleSetQuantity:o,handleChangeStep:u})=>f("ul",{className:"order-return-order-product-list",children:[n==null?void 0:n.map((m,g)=>{const{quantityReturnRequested:a,quantityShipped:C,eligibleForReturn:h}=m,O=l.some(E=>(E==null?void 0:E.productSku)===m.productSku&&m.eligibleForReturn),_=C===a&&h||!h,y=C-a===0?a:C-a;return f("li",{className:R(["order-return-order-product-list__item",["order-return-order-product-list__item--blur",_]]),children:[r(Be,{"data-testid":`key_${g}`,name:`key_${g}`,checked:O,disabled:_,onChange:()=>{d({...m,currentReturnOrderQuantity:1})}}),r(lt,{slots:i,placeholderImage:e,loading:t,product:{...m,totalQuantity:y||1},itemType:"",taxConfig:s,translations:c,showConfigurableOptions:p,disabledIncrementer:!O,onQuantity:y>1?E=>{o(E,m.productSku)}:void 0}),r(W,{"data-testid":"returnOrderItem",name:"ReturnOrderItem",slot:i==null?void 0:i.ReturnOrderItem})]},m.id)}),r("li",{className:"order-return-order-product-list__item",children:r(Q,{type:"button",onClick:()=>u("attributes"),disabled:!l.length,children:c.nextStep})})]}),Dr=({placeholderImage:e,slots:n,formsRef:i,selectedProductList:t,loading:s,fieldsConfig:c,translations:l,handleChangeStep:d,onSubmit:p})=>{const{formData:o,errors:u,formRef:m,handleChange:g,handleBlur:a,handleSubmit:C}=tt({fieldsConfig:jt(c,t==null?void 0:t.length),onSubmit:p});return f("form",{className:"order-return-reason-form",ref:m,onSubmit:C,name:"returnReasonForm",children:[t.map((h,O)=>{var S,T,N,z;const _=h==null?void 0:h.giftCard,y=h==null?void 0:h.product,E=Qt(c,O),b=`${h==null?void 0:h.id}_${O}`,w=(h==null?void 0:h.currentReturnOrderQuantity)??1,I={...h!=null&&h.currentReturnOrderQuantity?{[l.configurationsListQuantity]:w}:{},...h.configurableOptions||{},...h.bundleOptions||{},..._!=null&&_.senderName?{[l.sender]:_==null?void 0:_.senderName}:{},..._!=null&&_.senderEmail?{[l.sender]:_==null?void 0:_.senderEmail}:{},..._!=null&&_.recipientName?{[l.recipient]:_==null?void 0:_.recipientName}:{},..._!=null&&_.recipientEmail?{[l.recipient]:_==null?void 0:_.recipientEmail}:{},..._!=null&&_.message?{[l.message]:_==null?void 0:_.message}:{},...h!=null&&h.downloadableLinks?{[`${(S=h==null?void 0:h.downloadableLinks)==null?void 0:S.count} ${l.downloadableCount}`]:(T=h==null?void 0:h.downloadableLinks)==null?void 0:T.result}:{}},v=(N=h==null?void 0:h.product)==null?void 0:N.name,M={title:v,src:((z=y==null?void 0:y.thumbnail)==null?void 0:z.url)??e,alt:v,width:90,height:120,loading:"lazy"};return f(Ye,{children:[r(Qe,{loading:s,title:r("div",{"data-testid":"product-name",children:v}),sku:r("div",{children:y==null?void 0:y.sku}),image:r(W,{name:"ReturnReasonFormImage",slot:n==null?void 0:n.ReturnReasonFormImage,context:{data:h,defaultImageProps:M},children:r(he,{...M})}),configurations:I}),r("form",{name:b,ref:i==null?void 0:i.current[O],"data-quantity":w,children:r(rt,{className:"className",loading:s,fields:E,onChange:g,onBlur:a,errors:u,values:o})})]},h.id)}),r(W,{"data-testid":"returnFormActions",name:"ReturnFormActions",slot:n==null?void 0:n.ReturnFormActions,context:{handleChangeStep:d},children:f("div",{className:"order-return-reason-form__actions",children:[r(Q,{variant:"secondary",type:"button",onClick:()=>{d("products")},children:l.backStep}),r(Q,{children:l.submit})]})})]})},Fe={size:"32",stroke:"2"},dt=({placeholderImage:e,minifiedViewKey:n,withReturnNumber:i=!1,withOrderNumber:t=!1,slots:s,pageInfo:c,withReturnsListButton:l=!0,isMobile:d=!1,returnsInMinifiedView:p=1,translations:o={},orderReturns:u=[],minifiedView:m=!1,withHeader:g=!0,withThumbnails:a=!0,selectedPage:C=1,handleSetSelectPage:h,routeReturnDetails:O,routeOrderDetails:_,routeTracking:y,routeReturnsList:E,routeProductDetails:b,loading:w})=>{const I=m?p:u.length,v=b!=null&&b()?"a":"span",M=oe(()=>u.slice(0,I).map((N,z)=>{var D,Y;const j=((N==null?void 0:N.items)??[]).reduce((k,le)=>(le.requestQuantity??0)+k,0);return r(U,{variant:"secondary",className:"order-returns-list-content__cards-list",children:f("div",{className:"order-returns-list-content__cards-grid",children:[f("div",{className:"order-returns-list-content__descriptions",children:[r("p",{className:"order-returns-list-content__return-status",children:Se(N.returnStatus)?r(F,{id:`Order.Returns.${n}.returnsList.returnStatus.${Se(N.returnStatus)}`}):r("span",{children:Ae(N.returnStatus)})}),i?f("p",{children:[o.returnNumber," ",r("a",{href:(O==null?void 0:O({returnNumber:N.returnNumber,orderNumber:N.orderNumber,token:N.token}))??"#",rel:"noreferrer",children:N.returnNumber})]}):null,t?f("p",{children:[o.orderNumber," ",r("a",{href:(_==null?void 0:_({orderNumber:N.orderNumber,token:N.token}))??"#",rel:"noreferrer",children:N.orderNumber})]}):null,(D=N==null?void 0:N.tracking)==null?void 0:D.map((k,le)=>{var ne,ie;const ee={title:"",number:(k==null?void 0:k.trackingNumber)??"",carrier:((ne=k==null?void 0:k.carrier)==null?void 0:ne.label)??""},te=y==null?void 0:y(ee),re=`${ee.number}_${le}`;return f("p",{children:[`${o.carrier} `,`${(ie=ee.carrier)==null?void 0:ie.toLocaleUpperCase()} | `,te?r("a",{href:te,target:"_blank",rel:"noreferrer","data-testid":`${re}_link`,children:k.trackingNumber}):r("span",{"data-testid":`${re}_span`,children:k.trackingNumber})]},re)}),s!=null&&s.ReturnItemsDetails?r(W,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:s==null?void 0:s.ReturnItemsDetails,context:{items:N.items}}):null,!(s!=null&&s.ReturnItemsDetails)&&N.items.length?f("p",{children:[j," ",r(F,{id:`Order.Returns.${n}.returnsList.itemText`,plural:j,fields:{count:j}})]}):null]}),a?r(xe,{maxColumns:d?3:9,emptyGridContent:r(A,{}),className:R(["order-returns-list-content__images",["order-returns-list-content__images-3",d]]),children:(Y=N==null?void 0:N.items)==null?void 0:Y.map((k,le)=>{var ie,pe;const ee=`key_${le}_${k.uid}`,te=((ie=k==null?void 0:k.product)==null?void 0:ie.name)??"",re=((pe=k==null?void 0:k.thumbnail)==null?void 0:pe.url)??e??"",ne={title:te,src:re,alt:te,width:85,height:114,loading:"eager"};return r(v,{"data-testid":ee,href:(b==null?void 0:b(k))??"#",children:r(W,{slotTag:"span",contentTag:"span",name:"ReturnListImage",slot:s==null?void 0:s.ReturnListImage,context:{data:k,defaultImageProps:ne},children:r(he,{...ne})})},ee)})}):null,s!=null&&s.DetailsActionParams?r(W,{className:"order-returns-list-content__actions","data-testid":"detailsActionParams",name:"DetailsActionParams",slot:s==null?void 0:s.DetailsActionParams,context:{returnOrderItem:N}}):r("a",{href:(O==null?void 0:O({returnNumber:N.returnNumber,token:N.token,orderNumber:N.orderNumber}))??"#",className:"order-returns-list-content__actions",children:r(J,{source:Pe,...Fe})})]})},z)}),[u,I,n,i,o,t,s,a,d,e,v,y,b,O,_]),S=oe(()=>f(A,{children:[g?r(B,{title:o.minifiedViewTitle,divider:!1,className:"order-returns__header--minified",level:2}):null,w?r(Oe,{withCard:!1}):f(A,{children:[M,r(He,{minifiedView:m,typeList:"orders",isEmpty:!u.length,message:o.emptyOrdersListMessage}),l?r("a",{className:"order-returns-list-content__actions",href:(E==null?void 0:E())??"#",children:r(U,{variant:"secondary",className:"order-returns-list-content__card",children:f("div",{className:"order-returns-list-content__card-wrapper",children:[r("p",{children:o.viewAllOrdersButton}),r(J,{source:Pe,...Fe})]})})}):null]})]}),[E,l,g,o,M,m,u.length,w]),T=oe(()=>f(A,{children:[g?r(B,{title:o.minifiedViewTitle,divider:!0,className:"order-returns__header--full-size",level:1}):null,w?r(Oe,{withCard:!1}):f(A,{children:[r(He,{minifiedView:m,typeList:"orders",isEmpty:!u.length,message:o.emptyOrdersListMessage}),M,(c==null?void 0:c.totalPages)>1?r(Ct,{totalPages:c==null?void 0:c.totalPages,currentPage:C,onChange:h}):null]})]}),[M,m,u,o,c==null?void 0:c.totalPages,C,h,w,g]);return r("div",{className:"order-returns-list-content",children:m?S:T})},en=({placeholderImage:e,slots:n,collapseThreshold:i,translations:t,returnData:s,routeTracking:c,routeProductDetails:l})=>{var o;const d=ke(),p=l?"a":"span";return f(U,{variant:"secondary",className:R(["order-shipping-status-card","order-shipping-status-card--return-order"]),children:[r(B,{title:t.returnOrderCardTitle,level:2}),f("div",{children:[(o=s==null?void 0:s.tracking)==null?void 0:o.map((u,m)=>{var h,O;const g={title:"",number:(u==null?void 0:u.trackingNumber)??"",carrier:((h=u==null?void 0:u.carrier)==null?void 0:h.label)??""},a=c==null?void 0:c(g),C=a?()=>{window.open(a,"_blank","noreferrer")}:null;return f("div",{className:"order-shipping-status-card__header",children:[f("div",{children:[`${t.carrier} `,`${(O=g.carrier)==null?void 0:O.toLocaleUpperCase()} | `,g.number]}),C?r(Q,{onClick:C,children:t.trackButton}):null]},`${g.number}_${m}`)}),n!=null&&n.ReturnItemsDetails?r(W,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:n==null?void 0:n.ReturnItemsDetails,context:{items:s.items}}):null,r(be,{actionIconPosition:"right","data-testid":"dropinAccordion",children:r(Ne,{defaultOpen:i>=s.items.length,title:r(F,{id:"Order.ShippingStatusCard.itemText",plural:s.items.reduce((u,m)=>u+m.requestQuantity,0),fields:{count:s.items.reduce((u,m)=>u+m.requestQuantity,0)}}),children:r(xe,{maxColumns:d?3:9,emptyGridContent:r(A,{}),className:R(["order-shipping-status-card__images",["order-shipping-status-card__images-3",d]]),children:s.items.map((u,m)=>{var a,C,h;const g={title:((a=u.thumbnail)==null?void 0:a.label)??"",src:((C=u.thumbnail)==null?void 0:C.url)??e,alt:((h=u.thumbnail)==null?void 0:h.label)??"",width:85,height:114,loading:"lazy"};return r(p,{href:(l==null?void 0:l(u))??"#","data-testid":`${m}${u.uid}`,children:r(W,{slotTag:"span",contentTag:"span",name:"ShippingStatusCardImage",slot:n==null?void 0:n.ShippingStatusReturnCardImage,context:{data:u,defaultImageProps:g},children:r(he,{...g})})},`${m}${u.uid}`)})})})})]})]})},tn=({placeholderImage:e,translations:n,slots:i,orderData:t,collapseThreshold:s=10,routeProductDetails:c,routeTracking:l})=>{var a,C,h,O,_;const d=!!(t!=null&&t.returnNumber),p=t==null?void 0:t.returnNumber,o=c?"a":"span",u=(a=t==null?void 0:t.status)==null?void 0:a.toLocaleLowerCase(),m=(C=t==null?void 0:t.items)==null?void 0:C.filter(y=>(y==null?void 0:y.quantityShipped)===0||(y==null?void 0:y.quantityShipped)<(y==null?void 0:y.quantityOrdered)),g=(h=t==null?void 0:t.items)==null?void 0:h.reduce((y,E)=>{const b=E.quantityOrdered-E.quantityShipped;return y+(b>0?b:0)},0);if(d&&(t!=null&&t.returns.length)){const y=t.returns.find(E=>E.returnNumber===p);return!y||y.tracking.length===0?null:r(en,{placeholderImage:e,slots:i,collapseThreshold:s,translations:n,returnData:y,routeTracking:l,routeProductDetails:c})}return!t||u!=null&&u.includes(Ke.CANCELED)?null:(O=t==null?void 0:t.shipments)!=null&&O.length?f(A,{children:[(_=t==null?void 0:t.shipments)==null?void 0:_.map(({tracking:y,items:E,id:b,number:w},I)=>{const v=E??[],M=v.reduce((S,T)=>S+((T==null?void 0:T.quantityShipped)??T.orderItem.quantityShipped??0),0);return f(U,{variant:"secondary",className:"order-shipping-status-card",children:[r(B,{title:n.shippingCardTitle,level:2}),w?r("div",{className:"order-shipping-status-card__header","data-testid":"shipmentNumber",children:r("div",{className:"order-shipping-status-card__header--content",children:f("p",{children:[n.shipmentNumber," ",w]})})}):null,y==null?void 0:y.map(S=>{var z;const T=l==null?void 0:l(S),N=T?()=>{window.open(T,"_blank","noreferrer")}:null;return f("div",{className:"order-shipping-status-card__header",role:"status",children:[f("div",{className:"order-shipping-status-card__header--content",children:[f("p",{children:[n.carrier," ",(z=S==null?void 0:S.carrier)==null?void 0:z.toLocaleUpperCase()," | ",S==null?void 0:S.number]}),r("p",{children:S==null?void 0:S.title})]}),i!=null&&i.DeliveryTrackActions?r(W,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:i==null?void 0:i.DeliveryTrackActions,context:{trackInformation:S}}):N?r(Q,{onClick:N,children:n.trackButton}):null]},S.number)}),r(be,{actionIconPosition:"right","data-testid":"dropinAccordion",children:r(Ne,{"data-position":I+1,defaultOpen:s>=(v==null?void 0:v.length),title:r(F,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:M,fields:{count:M}}),children:r(xe,{maxColumns:6,emptyGridContent:r(A,{}),className:"order-shipping-status-card__images",children:v==null?void 0:v.map(S=>{var z,ce,j,D,Y,k;const T=((j=(ce=(z=S==null?void 0:S.orderItem)==null?void 0:z.product)==null?void 0:ce.thumbnail)==null?void 0:j.label)??"",N={title:T,src:((k=(Y=(D=S==null?void 0:S.orderItem)==null?void 0:D.product)==null?void 0:Y.thumbnail)==null?void 0:k.url)??e,alt:T,width:85,height:114,loading:"eager"};return r(o,{href:(c==null?void 0:c(S))??"#",children:r(W,{slotTag:"span",contentTag:"span",name:"ShippingStatusCardImage",slot:i==null?void 0:i.ShippingStatusCardImage,context:{data:S,defaultImageProps:N},children:r(he,{...N})})},S.id)})})})}),i!=null&&i.DeliveryTimeLine?r(W,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:i==null?void 0:i.DeliveryTimeLine,context:{}}):null]},b)}),m!=null&&m.length?f(U,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[r(B,{title:n.notYetShippedTitle,level:2}),r(be,{actionIconPosition:"right",children:r(Ne,{defaultOpen:s>=(m==null?void 0:m.length),title:r(F,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:g,fields:{count:g}}),children:r(xe,{maxColumns:6,emptyGridContent:r(A,{}),className:"order-shipping-status-card__images",children:m==null?void 0:m.map(y=>{var b,w,I;const E={title:((b=y.thumbnail)==null?void 0:b.label)??"",src:((w=y.thumbnail)==null?void 0:w.url)??"",alt:((I=y.thumbnail)==null?void 0:I.label)??"",width:85,height:114,loading:"lazy"};return r(o,{href:(c==null?void 0:c(y))??"#",children:r(W,{slotTag:"span",contentTag:"span",name:"NotYetShippedProductImage",slot:i==null?void 0:i.NotYetShippedProductImage,context:{data:y,defaultImageProps:E},children:r(he,{...E})})},y.id)})})})})]}):null]}):f(U,{variant:"secondary",className:"order-shipping-status-card",children:[r(B,{title:n.shippingInfoTitle,level:2}),r("div",{className:"order-shipping-status-card__header",children:f("div",{className:"order-shipping-status-card__header--content",children:[t!=null&&t.carrier?r("p",{children:t==null?void 0:t.carrier}):null,n.noInfoTitle?r("p",{children:n.noInfoTitle}):null]})})]})},rn=["br","b","i"];function nn(e){return ut(e,{ALLOWED_TAGS:rn,ALLOWED_ATTR:[]})}const an=({className:e,comments:n=[],...i})=>{const t=Z({emptyState:"Order.OrderComments.emptyState",title:"Order.OrderComments.title"}),s=!n||n.length===0?r("ul",{className:R(["order-order-comments","order-order-comments--empty"]),"data-testid":"order-comments-list",children:r("li",{className:"order-order-comments__empty-state","data-testid":"order-comments-empty-state",children:t.emptyState})}):r("ul",{className:"order-order-comments","data-testid":"order-comments-list",children:n.map((c,l)=>f("li",{className:"order-order-comments__item","data-testid":`order-comment-${l}`,children:[r("div",{className:"order-order-comments__header",children:r("time",{className:"order-order-comments__date",dateTime:c.timestamp,"data-testid":`order-comment-date-${l}`,children:_e(c.timestamp,"en-US",et)})}),r("p",{className:"order-order-comments__text","data-testid":`order-comment-text-${l}`,dangerouslySetInnerHTML:{__html:nn(c.message)}})]},l))});return f(U,{...i,variant:"secondary",className:R(["order-order-comments-card",e]),"data-testid":"order-comments-card",children:[r(B,{title:t.title,level:2}),r("div",{className:"order-order-comments-card__container",children:s})]})},sn=({className:e,orderData:n,slots:i,onSuccess:t,onError:s,routeReturnSuccess:c,showConfigurableOptions:l})=>{const d=Z({headerText:"Order.CreateReturn.headerText",successTitle:"Order.CreateReturn.success.title",successMessage:"Order.CreateReturn.success.message",sender:"Order.CreateReturn.giftCard.sender",recipient:"Order.CreateReturn.giftCard.recipient",message:"Order.CreateReturn.giftCard.message",outOfStock:"Order.CreateReturn.stockStatus.outOfStock",nextStep:"Order.CreateReturn.buttons.nextStep",backStep:"Order.CreateReturn.buttons.backStep",submit:"Order.CreateReturn.buttons.submit",backStore:"Order.CreateReturn.buttons.backStore",downloadableCount:"Order.CreateReturn.downloadableCount",returnedItems:"Order.CreateReturn.returnedItems",configurationsListQuantity:"Order.CreateReturn.configurationsList.quantity"}),{inLineAlertProps:p,handleSetInLineAlert:o}=Or(),u=se(),{order:m,itemsEligibleForReturn:g,formsRef:a,attributesList:C,steps:h,loading:O,selectedProductList:_,handleSelectedProductList:y,handleSetQuantity:E,handleChangeStep:b,onSubmit:w}=cr({orderData:n,onSuccess:t,onError:s,handleSetInLineAlert:o});if(O)return r("div",{children:r(at,{})});if(!O&&!C.length)return r("div",{});const I=(u==null?void 0:u.baseMediaUrl)??"",v={products:r(Jr,{itemsEligibleForReturn:g,placeholderImage:I,taxConfig:de((u==null?void 0:u.shoppingOrderDisplayPrice)??0),slots:i,translations:d,loading:O,selectedProductList:_,handleSelectedProductList:y,showConfigurableOptions:l,handleSetQuantity:E,handleChangeStep:b}),attributes:r(Dr,{placeholderImage:I,slots:i,formsRef:a,loading:O,fieldsConfig:C,selectedProductList:_,handleChangeStep:b,translations:d,onSubmit:w}),success:r(Kr,{translations:d,routeReturnSuccess:c,orderData:m}),error:null};return f("div",{className:R(["order-create-return",e]),children:[r(B,{title:d.headerText,level:1}),p.heading?r(Ee,{className:"order-create-return_notification",variant:"secondary","data-testid":"orderCreateReturnNotification",...p}):null,v[h]]})};sn.displayName="CreateReturn";export{sn as C,Lr as CustomerDetails,it as O,wr as R,Mr as S,vr as a,br as b,Nr as c,Sr as d,Lr as default,Tr as e,Er as f,Rr as g};
|
|
4
4
|
//# sourceMappingURL=CustomerDetails.js.map
|