"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[31],{217:(e,t,i)=>{function a(e){return e.replace(/[^a-zA-Z0-9]/g,"_")}function s(){"undefined"!=typeof window&&window.amzn&&window.amzn("trackEvent","PageView")}function r(e){if("undefined"!=typeof window&&window.amzn){const t=`Add_to_cart_${a(e)}`;window.amzn("trackEvent",t)}}function n(e){if("undefined"!=typeof window&&window.amzn){const t=`Product_View_${a(e)}`;window.amzn("trackEvent",t)}}function o(e){if("undefined"!=typeof window&&window.amzn){const t=`Collection_${a(e)}`;window.amzn("trackEvent",t)}}i.d(t,{a:()=>r,b:()=>o,c:()=>s,d:()=>n})},203:(e,t,i)=>{i.d(t,{a:()=>r});var a=i(4);const s={hanger:(0,a.z)(),"tshirt-pants":(0,a.X)()},r=e=>s[e]},199:(e,t,i)=>{i.d(t,{a:()=>h});var a=i(0),s=i(2),r=i(364),n=i(305),o=i(200);const l=({message:e,duration:t=3e3,onClose:i})=>{const[r,n]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{const e=setTimeout((()=>n(!0)),10),a=setTimeout((()=>{n(!1),setTimeout((()=>null==i?void 0:i()),300)}),t);return()=>{clearTimeout(e),clearTimeout(a)}}),[]),(0,a.jsxs)("div",Object.assign({className:`${o.a.toast} ${r?o.a.toastVisible:""}`},{children:[(0,a.jsx)("span",Object.assign({className:o.a.toastMessage},{children:e})),(0,a.jsx)("button",Object.assign({className:o.a.toastClose,onClick:()=>{n(!1),setTimeout((()=>null==i?void 0:i()),300)},"aria-label":"Close"},{children:(0,a.jsx)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:(0,a.jsx)("path",{d:"M1 1L13 13M13 1L1 13",stroke:"#000",strokeWidth:"1.5",strokeLinecap:"round"})}))}))]}))};var c=i(201),d=i(4),u=i(24),p=i(362);const m=e=>{if("undefined"==typeof document)return null;const t=document.cookie.split("; ").find((t=>t.startsWith(e+"=")));return t?decodeURIComponent(t.split("=").slice(1).join("=")):null};let v=!1;const h=({productId:e,productHandle:t,selectedColor:i,selectedSize:o,title:h,imageUrl:f,price:w,compareAtPrice:j,initialInWishlist:g=!1,className:b,inline:x=!1,source:S="pdp",useSharedState:O})=>{const C=O(),{isInWishlist:P,add:N,remove:M}=(0,r.b)(C),[z,k]=(0,s.useState)(!1),[y,D]=(0,s.useState)(null);(0,s.useEffect)((()=>{k(!0)}),[]),(0,s.useEffect)((()=>{if(v)return;const e=new URL(window.location.href);"1"===e.searchParams.get("wishlist_added")&&(v=!0,D("Product added to wishlist"),e.searchParams.delete("wishlist_added"),window.history.replaceState({},"",e.toString()))}),[]);const $=z?P(e):g;return(0,a.jsxs)("div",Object.assign({className:x?c.a.wrapperInline:`${c.a.wrapper}${b?` ${b}`:""}`},{children:[(0,a.jsx)("button",Object.assign({className:`${c.a.button} ${$?c.a.buttonActive:""}`,onClick:a=>{a.preventDefault(),a.stopPropagation();const s=m("authToken");if(!s){const a={productId:e,productHandle:t,selectedColor:i,selectedSize:o,title:h,imageUrl:f,price:w,compareAtPrice:j};return(0,n.f)(a,window.location.href),void(window.location.href="/customer")}const r=m("userID");$?M(e,s,r):((0,p.b)("plp"===S?"plpWishlistButtonClicked":"pdpWishlistButtonClicked"),N({productId:e,productHandle:t,selectedColor:i,selectedSize:o,title:h,imageUrl:f,price:w,compareAtPrice:j},s,r),D("Product added to wishlist"))},"aria-label":$?"Remove from wishlist":"Add to wishlist"},{children:$?(0,a.jsx)(d._,{}):(0,a.jsx)(d.$,{})})),y&&(0,a.jsx)(u.a,{children:(0,a.jsx)(l,{message:y,onClose:()=>D(null)})})]}))}},204:(e,t,i)=>{i.d(t,{a:()=>ne});var a=i(1),s=i(0),r=i(7),n=i(362),o=i(67),l=i(89),c=i(205);const{wrapper:d,wrapperBadge:u,wrapperImage:p}=c.a,m=({imageMap:e,currentColor:t,alt:i,productLink:a,isDesktopDevice:r,selectedSize:n})=>{const o=["1X","2X","3X","4X","5X","6X","7X","8X","9X","10X"].includes(n)?`${t} Plus`:t;return(0,s.jsx)("div",Object.assign({className:d},{children:(0,s.jsxs)("div",Object.assign({className:p},{children:[a&&(0,s.jsx)("a",Object.assign({href:a,target:r?"_blank":"_self",className:u},{children:"View product details"})),(0,s.jsx)("img",{src:e[o]||e[t],alt:i})]}))}))};var v=i(206);const{wrapper:h,wrapperActualPrice:f,wrapperComparePrice:w,wrapperCrossedPrice:j,wrapperActualPriceRed:g,wrapperPercentage:b}=v.a,x=({currentVariant:e,currency:t="$",discountValue:i=0})=>{var a;if(!e)return(0,s.jsx)(s.Fragment,{});const r=(o=Number(e.priceV2.amount),l=i,parseFloat((o-o*(l/100)).toFixed(2))).toFixed(2);var o,l;const c=(null===(a=e.compareAtPrice)||void 0===a?void 0:a.amount)||e.priceV2.amount,d=Number(c)>Number(r),u=((e,t)=>{if(e<=0||t<0||t>e)throw new Error("Invalid price values");return(e-t)/e*100})(Number(c),Number(r)),p=u>15;return(0,s.jsxs)("div",Object.assign({className:h},{children:[d&&(0,s.jsx)("p",Object.assign({className:(0,n.a)(w,j)},{children:`${t}${c}`})),(0,s.jsx)("p",Object.assign({className:(0,n.a)(f,d&&g)},{children:`${t}${r}`})),p&&(0,s.jsx)("p",Object.assign({className:b},{children:`(${u.toFixed(0)}% off)`}))]}))};var S=i(2),O=i(207);const{wrapper:C,wrapperTitle:P,wrapperDetails:N,wrapperSize:M,wrapperColor:z,wrapperParagraph:k}=O.a,y=({title:e,imageMap:t,options:i,variants:a,colors:r,handle:n,isMainProduct:c,mainProductCurrentVariant:d,outfitDiscount:u,vendor:p,id:v,handleSelectProduct:h,isDesktopDevice:f,handleSoldOutMissyAndPlus:w})=>{var j,g;const b=(null===(j=i[1])||void 0===j?void 0:j.values)||[],{selectedColor:O,selectedSize:y,selectedVariant:D,excludedSizes:$,availableSizes:A,handleColorChange:V,createProductLink:T,ref:B,setSelectedSize:I,isOutfit:E}=(({variants:e,handle:t,title:i,vendor:a,id:s,isMainProduct:r,mainProductCurrentVariant:n,handleSelectProduct:o,outfitDiscount:l,allSizes:c,handleSoldOutMissyAndPlus:d})=>{var u,p;const m=e.find((e=>e.availableForSale)),v=null!==(u=null==m?void 0:m.optionMap.Size)&&void 0!==u?u:"",h=null!==(p=null==m?void 0:m.optionMap.Color)&&void 0!==p?p:"",[f,w]=(0,S.useState)(r&&n?n.optionMap.Color||"":h),[j,g]=(0,S.useState)(r&&n?n.optionMap.Size||"":v),b=(0,S.useCallback)(((e,t)=>t?`/products/${e}?variant=${t}`:`/products/${e}`),[]),x=(0,S.useRef)(null),O=(0,S.useMemo)((()=>{var r;const n=e.find((e=>e.optionMap.Color===f&&e.optionMap.Size===j));return n?(d&&d(!1),Object.assign(Object.assign({},n),{title:(null==n?void 0:n.title)||i,vendor:a,url:b(t,n.id),productId:s,outfitDiscount:null!==(r=null==n?void 0:n.outfitDiscount)&&void 0!==r?r:l})):(d&&d(!0),x.current)}),[f,j,e,i,a,t,s,b]);(0,S.useEffect)((()=>{O&&(x.current=O)}),[null==O?void 0:O.id]);const{availableSizes:C,excludedSizes:P}=(0,S.useMemo)((()=>{const t=e.filter((e=>e.optionMap.Color===f)),i=new Set(c),a=[];return t.forEach((({optionMap:e,availableForSale:t})=>{const s=e.Size;s&&(i.add(s),t||a.push(s))})),{availableSizes:Array.from(i),excludedSizes:a}}),[f,e]),N=(0,S.useCallback)((e=>{w(e.target.value)}),[]);return(0,S.useEffect)((()=>{O&&o(O)}),[null==O?void 0:O.id]),{selectedColor:f,selectedSize:j,selectedVariant:O,excludedSizes:P,availableSizes:C,handleColorChange:N,createProductLink:b,ref:(0,S.useRef)(null),setSelectedSize:g,isOutfit:!0}})({variants:a,handle:n,title:e,vendor:p,id:v,isMainProduct:c,mainProductCurrentVariant:d,handleSelectProduct:h,outfitDiscount:u,allSizes:b,handleSoldOutMissyAndPlus:w}),_=(0,S.useMemo)((()=>{const e=a.filter((e=>e.optionMap.Color===O));return b.filter((t=>!e.some((e=>e.optionMap.Size===t))))}),[O,a]);return(0,s.jsxs)("div",Object.assign({className:C},{children:[(0,s.jsx)(m,{imageMap:t,currentColor:O,alt:e,productLink:c?"":T(n,null==D?void 0:D.id),isDesktopDevice:f,selectedSize:y}),(0,s.jsxs)("div",Object.assign({className:N},{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",Object.assign({className:P},{children:(null==D?void 0:D.title)||e})),(0,s.jsx)(x,{currentVariant:D,discountValue:null!==(g=null==D?void 0:D.outfitDiscount)&&void 0!==g?g:u})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",Object.assign({className:z},{children:[(0,s.jsx)("p",Object.assign({className:k},{children:"Color:"})),(0,s.jsx)(o.a,{colors:r,variants:a,currentVariant:null!=D?D:{availableForSale:!1,compareAtPrice:{amount:"",currencyCode:"USD"},id:"",optionMap:{Color:"",Size:""},priceCurrency:"USD",priceV2:{amount:"",currencyCode:"USD"},quantityAvailable:0,sku:""},currentColor:O,ref:B,onChangeHandler:V,currency:"$",isOutfit:E})]})),(0,s.jsxs)("div",Object.assign({className:M},{children:[(0,s.jsx)("p",Object.assign({className:k},{children:"Size:"})),A.map(((t,i)=>(0,s.jsx)(l.a,{actualSize:y,setCurrentVariantBySize:e=>I(e),unavailableSizes:[...$,..._],sizeLabel:t,isOutfit:E,sizesNotExistInCurrentVariant:_},t+e+i)))]}))]})]}))]}))};var D=i(4),$=i(208);const{wrapper:A,wrapperIcon:V,wrapperTitle:T,wrapperTitleNoModal:B}=$.a,I=({handleShowOutfit:e,discountTitle:t,noModal:i=!1})=>(0,s.jsxs)("div",Object.assign({className:A},{children:[!i&&(0,s.jsx)("div",Object.assign({onClick:e,className:V},{children:(0,s.jsx)(D.m,{})})),t&&(0,s.jsx)("h1",Object.assign({className:(0,n.a)(T,i&&B)},{children:t}))]}));var E=i(209);const{wrapper:_,wrapperButton:F,spinner:L,spinnerPath:X,btnBusy:W,wrapperButtonNoModal:R,wrapperNoModal:U,wrapperButtonNoModalMarginBottom:H,discountLabel:q,priceOriginal:Y,priceDiscounted:Z,priceWrapper:G,wrapperButtonMarginTop:J}=E.a,K=({totalPriceWithDiscount:e,totalOriginalPrice:t,discountPercentage:i,addToCartOutfit:a,selectedProduct:r,isDisabledAddToCartButton:o,isBusy:l,handleShowOutfit:c,noModal:d=!1,isSoldOutMissyAndPlus:u=!1})=>{const p=()=>{const e=(new Date).getTime();return r.map((t=>({id:t.id,quantity:1,properties:{_outfitId:e},image:"",product_title:t.title,variant_title:"",variant_id:Number(t.id),price:100*Number(t.priceV2.amount),final_price:100*Number(t.priceV2.amount),url:t.url,vendor:t.vendor,sku:t.sku})))},m=e>0,v=o||u,h=m&&i>0;return(0,s.jsxs)("div",Object.assign({class:(0,n.a)(_,d&&U)},{children:[h&&(0,s.jsx)("p",Object.assign({className:q},{children:`Extra ${i}% Off Outfit Discount Applied`})),(0,s.jsxs)("button",Object.assign({disabled:v,onClick:()=>{a({items:p()},c),(0,n.b)("outfit:addToCartButton:clicked")},className:(0,n.a)(F,d&&R,H,h&&J)},{children:["Add Outfit to Cart —",m&&(0,s.jsxs)("span",Object.assign({className:G},{children:[(0,s.jsx)("s",Object.assign({className:Y},{children:`$${t.toFixed(2)}`})),(0,s.jsx)("span",Object.assign({className:Z},{children:`$${e.toFixed(2)}`}))]})),l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("svg",Object.assign({className:L,viewBox:"0 0 50 50"},{children:(0,s.jsx)("circle",{className:(0,n.a)(X),cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"})})),(0,s.jsx)("span",{className:W})]})]}))]}))};var Q=i(210);const{wrapper:ee,overlay:te,overlayActive:ie,wrapperOpen:ae,wrapperOutfitProducts:se,wrapperRelative:re}=Q.a,ne=({outfitsProducts:e,handleShowOutfit:t,showOutfit:i,mainProductId:o,currentVariant:l,addToCartOutfit:c,isMobile:d,isBusy:u,pdpButtonText:p,isDesktopDevice:m,discountTitle:v,noModal:h=!1})=>{(0,r.a)(i);const{top:f}=((e,t)=>{const[i,a]=(0,S.useState)(0),s=(0,S.useMemo)((()=>140),[]),r=(0,S.useMemo)((()=>0),[]),n=(0,S.useCallback)((()=>{const e=document.querySelector("header");return e?e.getBoundingClientRect().height:0}),[]),o=(0,S.useCallback)((()=>{if(t)return;const i=window.scrollY;if(0===i)return void a(e?r:s);if(e)return void(i>r&&a("auto"));const o=n(),l=Math.max(o,s-i);a(l)}),[e,s,r,n]);return(0,S.useEffect)((()=>(window.addEventListener("scroll",o),o(),()=>{window.removeEventListener("scroll",o)})),[o]),{top:i}})(d,i),[w,j]=(0,S.useState)([]),[g,b]=(0,S.useState)(!1),x=e=>{b(e)},O=e=>{if(!e.availableForSale)return void j(w.filter((t=>t.productId!==e.productId)));const t=w.findIndex((t=>t.productId===e.productId));if(-1===t)return void j((t=>[...t,e]));const i=[...w];i[t]=e,j(i)},C=!(e.length===w.length)||u,P=w.reduce(((e,t)=>{const i=t.priceV2.amount,a=t.outfitDiscount;return e+((s=Number(i))-s*a/100);var s}),0),N=w.reduce(((e,t)=>{var i;const a=null!==(i=t.compareAtPrice)&&void 0!==i?i:t.priceV2;return e+Number(a.amount)}),0),M=e.map((e=>{var t;return null!==(t=e.outfitDiscount)&&void 0!==t?t:0})),z=M.every((e=>e===M[0]))?M[0]:Math.round(100*(1-M.reduce(((e,t)=>e*(1-t/100)),1)));return(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)("div",{className:(0,n.a)(te,i&&!h&&ie),onClick:t}),(0,s.jsxs)("div",Object.assign({style:{top:f},className:(0,n.a)(ee,i&&ae,h&&re)},{children:[(0,s.jsx)(I,{handleShowOutfit:t,discountTitle:v,noModal:h}),(0,s.jsx)("div",Object.assign({className:se},{children:e.map(((e,t)=>(0,a.createElement)(y,Object.assign({},e,{key:e.title,isMainProduct:e.id===o,mainProductCurrentVariant:l,handleSelectProduct:O,isDesktopDevice:m,handleSoldOutMissyAndPlus:x}))))})),(0,s.jsx)(K,{selectedProduct:w,totalPriceWithDiscount:P,totalOriginalPrice:N,discountPercentage:null!=z?z:0,addToCartOutfit:c,isDisabledAddToCartButton:C,isBusy:u,handleShowOutfit:t,noModal:h,isSoldOutMissyAndPlus:g})]}))]})}}}]);