"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[17],{49:(e,a,r)=>{r.d(a,{a:()=>o});var t=r(0),i=r(4),s=r(369),n=r(22);const{wrapper:l,noEnlarge:d}=n.a,o=({onClick:e,disableDesktopEnlarge:a=!1})=>(0,t.jsx)("button",Object.assign({type:"button","aria-label":"Quick add",className:(0,s.b)(l,a&&d),onClick:a=>{a.stopPropagation(),a.preventDefault(),(0,s.c)("quickAdd:button:clicked"),e()}},{children:(0,t.jsx)(i.M,{})}))},65:(e,a,r)=>{r.d(a,{a:()=>q});var t=r(0),i=r(18),s=r(369),n=r(9),l=r(170),d=r(2);const o=e=>Array.from(e.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter((e=>null!==e.offsetParent));var c=r(4),u=r(20);const{wrapper:p,wrapperIcon:h}=u.a,v=({title:e,titleId:a,handleShowCart:r})=>(0,t.jsxs)("div",Object.assign({className:p},{children:[(0,t.jsx)("h1",Object.assign({id:a},{children:e})),(0,t.jsx)("button",Object.assign({type:"button","aria-label":"Close",className:h,onClick:e=>{e.stopPropagation(),r()}},{children:(0,t.jsx)(c.m,{})}))]}));var b=r(171),C=r(68),j=r(95),g=r(172),m=r(21);const{wrapper:x,wrapperButton:f,wrapperLink:k,spinner:A,spinnerPath:S,btnBusy:y}=m.a,O=({productLink:e,handleAddToCart:a,isDisabled:r,isBusy:i})=>(0,t.jsxs)("div",Object.assign({className:x},{children:[(0,t.jsxs)("button",Object.assign({type:"button",disabled:r,className:f,onClick:()=>{(0,s.c)("quickAdd:button:addToCart:clicked"),a()}},{children:["Add To Cart",i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("svg",Object.assign({className:A,viewBox:"0 0 50 50"},{children:(0,t.jsx)("circle",{className:(0,s.b)(S),cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"})})),(0,t.jsx)("span",{className:y})]})]})),(0,t.jsx)("a",Object.assign({className:k,href:e,onClick:e=>e.stopPropagation()},{children:"View full details"}))]}));var N=r(116),w=r(53);const{wrapperContent:E,wrapperTitle:z,wrapperColor:P,wrapperParagraph:I,wrapperSize:F,wrapperSizes:L,freeGiftBadge:V}=i.a,T=({titleId:e,quickAddProductData:a,currentVariant:r,currentColor:i,currentColorForSlider:s,availableSizes:n,excludedSizes:l,sizesNotExistInCurrentVariant:d,variantUnavailable:o,currentProductLink:c,isBusy:u,colorPickerRef:p,isGiftCard:h,isFreeGift:m=!1,error:x,isLoading:f=!1,modalIsLoading:k=!1,handleSetCurrentVariantBySize:A,handleColorChange:S,handleColorValueChange:y,handleAddToCart:T,handleQuickAdd:Q})=>{var D,B,M,G,q;if(x)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{title:"Quick Add",titleId:e,handleShowCart:Q},"Quick Add Error"),(0,t.jsxs)("div",Object.assign({className:E},{children:[(0,t.jsx)("p",{children:"Unable to load product details. Please try again."}),(0,t.jsx)("button",Object.assign({onClick:Q},{children:"Close"}))]}))]});if(f||!a)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{title:"Quick Add",titleId:e,handleShowCart:Q},"Quick Add Loading"),(0,t.jsx)("div",Object.assign({className:E},{children:(0,t.jsx)("p",{children:"Loading product details..."})}))]});if(!a.variants||0===a.variants.length)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{title:"Quick Add",titleId:e,handleShowCart:Q},"Quick Add Error"),(0,t.jsxs)("div",Object.assign({className:E},{children:[(0,t.jsx)("p",{children:"This product is not available for Quick Add."}),(0,t.jsx)("button",Object.assign({onClick:Q},{children:"Close"}))]}))]});const R=h&&(null===(D=a.options.find((e=>e.name===w.a.GIFT_CARD.OPTION_NAME)))||void 0===D?void 0:D.values)||[],U=null===(B=a.variantsMessage)||void 0===B?void 0:B.find((e=>e.variantId===(null==r?void 0:r.id))),$=!!U&&("preOrderMessage"===U.type||U.message.toLowerCase().includes("pre-order")),_=(null==U?void 0:U.message)?[{message:U.message,isActive:!0}]:null!==(M=a.saleMessage)&&void 0!==M?M:[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{title:m?"Select Size and Color":"Quick Add",titleId:e,handleShowCart:Q},"Quick Add"),(0,t.jsx)(b.a,{slides:a.imageMap[s]||[],showQuickAdd:!0,currentColor:i,isGiftCard:h}),(0,t.jsxs)("div",Object.assign({className:E},{children:[m&&(0,t.jsx)("span",Object.assign({className:V},{children:"FREE GIFT"})),(0,t.jsx)("h2",Object.assign({className:z},{children:a.title})),!m&&(0,t.jsx)(g.a,{currentVariant:r,productCompareAtPrice:Number(a.compareAtPrice),isFinalSale:(null==r?void 0:r.isFinalSale)||(null==a?void 0:a.showFinalSale)||!1}),h?(0,t.jsxs)("div",Object.assign({className:F,style:{opacity:k?.5:1,pointerEvents:k?"none":"auto"}},{children:[(0,t.jsx)("p",Object.assign({className:I},{children:"Value:"})),(0,t.jsx)("div",Object.assign({className:L},{children:R.map(((e,r)=>(0,t.jsx)(j.a,{actualSize:i,setCurrentVariantBySize:y,unavailableSizes:[],sizeLabel:e,isOutfit:!1,sizesNotExistInCurrentVariant:[]},`${e}-${a.title}-${r}`)))}))]})):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",Object.assign({className:P,style:{opacity:k?.5:1,pointerEvents:k?"none":"auto"}},{children:[(0,t.jsx)("p",Object.assign({className:I},{children:"Color:"})),(0,t.jsx)(C.a,{colors:a.colors||[],variants:a.variants,currentVariant:null!=r?r:{availableForSale:!1,compareAtPrice:{amount:"",currencyCode:"USD"},id:"",optionMap:{Color:"",Size:""},priceCurrency:"USD",priceV2:{amount:"",currencyCode:"USD"},quantityAvailable:0,sku:""},currentColor:i,ref:p,onChangeHandler:S,currency:"$",isOutfit:!1,isQuickAddModal:!0})]})),(0,t.jsxs)("div",Object.assign({className:F,style:{opacity:k?.5:1,pointerEvents:k?"none":"auto"}},{children:[(0,t.jsx)("p",Object.assign({className:I},{children:"Size:"})),(0,t.jsx)("div",Object.assign({className:L},{children:n.map(((e,i)=>(0,t.jsx)(j.a,{actualSize:(null==r?void 0:r.optionMap.Size)||"",setCurrentVariantBySize:A,unavailableSizes:[...l,...d],sizeLabel:e,isOutfit:!1,sizesNotExistInCurrentVariant:d},`${e}-${a.title}-${i}`)))}))]}))]})]})),(0,t.jsx)(N.a,{saleMessage:_,preOrderTooltip:{isPreOrderMessage:$,message:null!==(G=a.preOrderTooltipContent)&&void 0!==G?G:""},currentVariantId:null!==(q=null==r?void 0:r.id)&&void 0!==q?q:"",isQuickAdd:!0}),(0,t.jsx)(O,{productLink:c,handleAddToCart:T,isDisabled:o||k,isBusy:u})]})},Q="quick-add-modal-title",{wrapper:D,wrapperOpen:B,overlay:M,overlayActive:G}=i.a,q=({handleQuickAdd:e,showQuickAdd:a,quickAddProductData:r,addToCart:i,isBusy:c,currentColorFromColorPicker:u,variantId:p,disableBodyScrollLock:h=!1,error:v,isLoading:b=!1,isFreeGift:C=!1})=>{(0,n.a)(a&&!h);const{currentVariant:j,currentColor:g,currentColorForSlider:m,availableSizes:x,excludedSizes:f,sizesNotExistInCurrentVariant:k,variantUnavailable:A,currentProductLink:S,colorPickerRef:y,isGiftCard:O,isLoading:N,handleSetCurrentVariantBySize:E,handleColorChange:z,handleColorValueChange:P,handleAddToCart:I}=(0,l.a)({quickAddProductData:r,currentColorFromColorPicker:u,addToCart:i,variantId:p,showQuickAdd:a,handleQuickAdd:e,isLoading:b,cartProperties:C?{_isGift:"true"}:void 0}),[F,L]=(0,d.useState)(!1),[V,q]=(0,d.useState)(null);var R;return(0,d.useEffect)((()=>{if(a){const e=setTimeout((()=>{L(!0)}),w.a.ANIMATION.MODAL_OPEN_DELAY_MS);return()=>clearTimeout(e)}L(!1)}),[a]),((e,a,r)=>{const t=(0,d.useRef)(null),i=(0,d.useRef)(r);i.current=r,(0,d.useEffect)((()=>{var r;if(!e||!a)return;t.current=document.activeElement,(null!==(r=o(a)[0])&&void 0!==r?r:a).focus();const s=e=>{if("Escape"===e.key||"Esc"===e.key)return void i.current();if("Tab"!==e.key)return;const r=o(a);if(0===r.length)return void e.preventDefault();const t=r[0],s=r[r.length-1];if(!t||!s)return;const n=document.activeElement;e.shiftKey&&n===t?(e.preventDefault(),s.focus()):e.shiftKey||n!==s||(e.preventDefault(),t.focus())};return a.addEventListener("keydown",s),()=>{a.removeEventListener("keydown",s);const e=t.current;e&&requestAnimationFrame((()=>{document.body.contains(e)&&e.focus()}))}}),[e,a])})(a,V,e),R=a&&!!V,(0,d.useEffect)((()=>{if(!R)return;const e=document.getElementById("portal"),a=null==e?void 0:e.parentElement;if(!e||!a)return;const r=Array.from(a.children).filter((a=>a!==e));return r.forEach((e=>{e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")})),()=>{r.forEach((e=>{e.removeAttribute("inert"),e.removeAttribute("aria-hidden")}))}}),[R]),r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,s.b)(M,F&&G),onClick:a=>{a.stopPropagation(),e()}}),(0,t.jsx)("div",Object.assign({ref:q,role:"dialog","aria-modal":"true","aria-labelledby":Q,tabIndex:-1,className:(0,s.b)(D,F&&B)},{children:(0,t.jsx)(T,{titleId:Q,quickAddProductData:r,currentVariant:j,currentColor:g,currentColorForSlider:m,availableSizes:x,excludedSizes:f,sizesNotExistInCurrentVariant:k,variantUnavailable:A,currentProductLink:S,isBusy:c,colorPickerRef:y,isGiftCard:O,isFreeGift:C,error:v,isLoading:b,modalIsLoading:N,handleSetCurrentVariantBySize:E,handleColorChange:z,handleColorValueChange:P,handleAddToCart:I,handleQuickAdd:e})}))]}):null}}}]);