"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[32],{133:(e,t,n)=>{n.d(t,{a:()=>E});var o=n(0),i=n(4),a=n(25),l=n(3),s=n(59),r=n(124),d=n(39);function c({groupColorsByOptionName:e=!1,newColorSectionName:t,coreColorSectionName:n,sizeGuideCodeBasedFlag:c=!1,defaultSizeGuideOptionName:u="",product:p,selectedVariant:v,setSelectedVariantId:m,compact:U=!1,productApp:f}){var h;const S=null==f?void 0:f.product.value,O=null==f?void 0:f.selectedVariant.value,{getOptionNameForColor:g,getHexForOptionColor:x}=(0,l.d)((e=>({getOptionNameForColor:e.getOptionNameForColor,getHexForOptionColor:e.getHexForOptionColor}))),b=null!=p?p:S,j=null!=v?v:O,C=null!=m?m:e=>{e&&f&&f.setSelectedVariantId({variantId:e})},N=(0,r.b)({product:b,newColorSectionName:t,coreColorSectionName:n,clearanceColors:null===(h=null==f?void 0:f.product.value)||void 0===h?void 0:h.clearanceColors,getOptionNameForColor:e?g:()=>{}});if(!b||!N)return(0,o.jsx)(i.Fragment,{});const E="sizeGuide"in b?b.sizeGuide:void 0;return(0,o.jsx)("div",{class:a.a.container,children:N.map((e=>{var t;return(0,o.jsx)(s.a,{product:b,option:e,getHexForOptionColor:x,selectedVariant:j,findProductVariantWithOption:e=>{var t,n,o,i;return null!==(o=null===(n=null==f?void 0:(t=f.findProductVariantWithOption).value)||void 0===n?void 0:n.call(t,e,b,j))&&void 0!==o?o:(0,d.a)({option:e,variants:b.variants,currentOptions:null!==(i=null==j?void 0:j.selectedOptions)&&void 0!==i?i:{},fallbackVariant:j})},setSelectedVariantId:C,sizeGuide:E,sizeGuideCodeBasedFlag:c,defaultSizeGuideOptionName:u,compact:U,productApp:f},`${b.handle}-${null!==(t=e.optionName)&&void 0!==t?t:e.name}`)}))})}var u=n(1),p=n(60),v=n(2),m=n(68);function U(e,t){const n=f[`${e} (${t})`];if(!n)return e;for(const e of n.split(" / "))if(e.includes("US"))return e.split(" (")[0];return e}const f={"DD (US)":"DD (US,UK) / E (EU)","E (US)":"DD (US,UK) / E (EU)","DD (UK)":"DD (US,UK) / E (EU)","E (EU)":"DD (US,UK) / E (EU)","DDD (US)":"DDD (US) / E (UK) / F (EU)","F (US)":"DDD (US) / E (UK) / F (EU)","E (UK)":"DDD (US) / E (UK) / F (EU)","F (EU)":"DDD (US) / E (UK) / F (EU)","G (US)":"G (US,EU) / F (UK)","G (EU)":"G (US,EU) / F (UK)","F (UK)":"G (US,EU) / F (UK)","H (US)":"H (US,EU) / FF (UK)","FF (US)":"H (US,EU) / FF (UK)","H (EU)":"H (US,EU) / FF (UK)","FF (UK)":"H (US,EU) / FF (UK)","I (US)":"I (US,EU) / G (UK)","I (EU)":"I (US,EU) / G (UK)","G (UK)":"I (US,EU) / G (UK)","J (US)":"J (US,EU) / GG (UK)","GG (US)":"J (US,EU) / GG (UK)","J (EU)":"J (US,EU) / GG (UK)","GG (UK)":"J (US,EU) / GG (UK)","K (US)":"K (US,EU) / H (UK)","K (EU)":"K (US,EU) / H (UK)","H (UK)":"K (US,EU) / H (UK)","L (US)":"L (US,EU) / HH (UK)","L (EU)":"L (US,EU) / HH (UK)","HH (UK)":"L (US,EU) / HH (UK)","M (US)":"M (US,EU) / J (UK)","M (EU)":"M (US,EU) / J (UK)","J (UK)":"M (US,EU) / J (UK)","N (US)":"N (US,EU) / JJ (UK)","N (EU)":"N (US,EU) / JJ (UK)","JJ (UK)":"N (US,EU) / JJ (UK)","O (US)":"O (US,EU) / K (UK)","O (EU)":"O (US,EU) / K (UK)","K (UK)":"O (US,EU) / K (UK)","P (US)":"P (US,EU) / KK (UK)","KK (US)":"P (US,EU) / KK (UK)","P (EU)":"P (US,EU) / KK (UK)","KK (UK)":"P (US,EU) / KK (UK)","Q (US)":"Q (US,EU) / L (UK)","Q (EU)":"Q (US,EU) / L (UK)","L (UK)":"Q (US,EU) / L (UK)"};function h({option:e,displayedOptions:t,fieldsetName:n,placeholder:a,isUnselectedSize:s,isVariantUnavailable:r}){var d,c,f,h,O,g;const x=(0,l.d)((e=>e.device)),[b,j]=(0,u.useState)(!1),C=t.find((e=>e.isSelected)),N=null==C?void 0:C.value,E=r||C&&!C.availableForSale&&!s,K=null!==(d=null!=a?a:e.optionName)&&void 0!==d?d:e.name,w=s?K:null!=N?N:K,z=e.sizing,V=e.name.toLowerCase().includes("cup"),F=!!z&&"US"!==z&&V,I=(0,o.jsxs)("div",{className:p.a.dropdownOptions,children:[F&&(0,o.jsxs)("div",{className:p.a.dropdownColumnHeader,children:[(0,o.jsx)("span",{children:z}),(0,o.jsx)("span",{children:"US"})]}),t.map((e=>(0,o.jsx)("button",{type:"button",className:[p.a.dropdownOption,F?p.a.dropdownOptionRow:"",e.isSelected&&!s?p.a.dropdownOptionSelected:"",e.availableForSale?"":p.a.dropdownOptionUnavailable].filter(Boolean).join(" "),onClick:()=>(e=>{var t,n,o;e.setSelectedVariantId(null===(t=e.variant)||void 0===t?void 0:t.variantId),"stayOpen"!==(0,v.getAssignment)(`${x}_sizeDropdownSelect`)&&("desktop"!==x?j(!1):null===(o=null===(n=document.activeElement)||void 0===n?void 0:n.blur)||void 0===o||o.call(n))})(e),role:"option","aria-selected":e.isSelected&&!s,children:F?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:e.value}),(0,o.jsx)("span",{className:p.a.usEquivalent,children:U(e.value,z)})]}):e.value},e.value)))]});return(0,o.jsxs)(i.Fragment,{children:[(0,o.jsxs)("div",{className:p.a.dropdownContainerDesktop,children:[(0,o.jsxs)("button",{type:"button",className:[p.a.dropdownTrigger,!N||s?p.a.placeholder:"",E?p.a.dropdownTriggerUnavailable:""].filter(Boolean).join(" "),onMouseDown:e=>{const t=e.currentTarget;document.activeElement===t?(t.blur(),e.preventDefault()):t.focus()},"aria-haspopup":"listbox",children:[(0,o.jsx)("span",{className:p.a.dropdownTriggerText,children:w}),(0,o.jsx)(S,{})]}),(0,o.jsx)("div",{className:p.a.dropdownPanel,role:"listbox",children:I}),(0,o.jsx)("input",{type:"hidden",name:n,value:null!==(f=null===(c=null==C?void 0:C.variant)||void 0===c?void 0:c.variantId)&&void 0!==f?f:""})]}),(0,o.jsxs)("div",{className:p.a.dropdownContainerMobile,children:[(0,o.jsxs)("button",{type:"button",className:[p.a.dropdownTrigger,!N||s?p.a.placeholder:"",E?p.a.dropdownTriggerUnavailable:""].filter(Boolean).join(" "),onClick:()=>{"desktop"!==x&&j(!b)},"aria-haspopup":"listbox","aria-expanded":b,children:[(0,o.jsx)("span",{className:p.a.dropdownTriggerText,children:w}),(0,o.jsx)(S,{className:b?p.a.chevronUp:""})]}),(0,o.jsx)(m.a,{isOpen:b,onClose:()=>j(!1),title:`Select ${null!==(h=e.optionName)&&void 0!==h?h:e.name}`,children:I}),(0,o.jsx)("input",{type:"hidden",name:n,value:null!==(g=null===(O=null==C?void 0:C.variant)||void 0===O?void 0:O.variantId)&&void 0!==g?g:""})]})]})}function S({className:e}){return(0,o.jsx)("svg",{className:[p.a.chevronIcon,e].filter(Boolean).join(" "),width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var O=n(139),g=n(28);function x({product:e,sizeOptions:t,selectedVariant:n,setSelectedVariantId:i,sizeGuide:a,sizeGuideCodeBasedData:l,sizeGuideId:s,combinedSizeOptions:r,productApp:d}){var c;const u=r&&r.length>0&&r.every((e=>t.some((t=>t.name.toLowerCase()===e.toLowerCase())))),v=null===(c=t.find((e=>e.sizing)))||void 0===c?void 0:c.sizing,m=!!v&&"US"!==v;return(0,o.jsxs)("fieldset",{className:p.a.sizeSection,children:[(0,o.jsxs)("legend",{className:p.a.visuallyHidden,children:[e.title," Size Selection"]}),(0,o.jsxs)("div",{className:p.a.sizeHeader,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:p.a.sizeLabel,children:"Size"}),m&&(0,o.jsxs)("span",{className:p.a.sizingSubtext,children:["This product is sold in ",v," sizes"]})]}),(0,o.jsx)(O.a,{sizeGuide:a,sizeGuideCodeBasedData:l,sizeGuideId:s})]}),(0,o.jsx)("div",{className:p.a.sizeDropdowns,children:u?(0,o.jsx)(j,{product:e,combinedOptionNames:r,sizeOptions:t,selectedVariant:n,setSelectedVariantId:i,productApp:d}):t.map(((a,l)=>(0,o.jsx)(b,{product:e,option:a,selectedVariant:n,precedingOptions:t.slice(0,l),allOtherOptions:t.filter(((e,t)=>t!==l)),setSelectedVariantId:i,productApp:d},a.name)))})]})}function b({product:e,option:t,selectedVariant:n,precedingOptions:a,allOtherOptions:l,setSelectedVariantId:s,productApp:r}){var d,c,p,v;const m=r?(e,t)=>{var n;if(t){const o=null===(n=t.mappedSizes)||void 0===n?void 0:n[e],i=1===(null==o?void 0:o.length)?o[0]:t.selectedOptions[e];r.selectOption({optionName:e,value:i})}}:void 0,U=null!==(d=null==r?void 0:r.selectedOptions.value)&&void 0!==d?d:{},f=null!==(c=null==r?void 0:r.defaultUnselected.value)&&void 0!==c&&c,S=(0,g.a)(r,n,t.name),O=null!==(p=null==n?void 0:n.selectedOptions[t.name])&&void 0!==p?p:null===(v=null==n?void 0:n.displayOptions)||void 0===v?void 0:v[t.name],x=(0,u.useMemo)((()=>{const e={};for(const t of a){const o=null==n?void 0:n.selectedOptions[t.name];o&&(e[t.name]=o)}return e}),[a,null==n?void 0:n.selectedOptions]),b=(0,u.useMemo)((()=>{const e={};for(const t of l){const o=null==n?void 0:n.selectedOptions[t.name];o&&(e[t.name]=o)}return e}),[l,null==n?void 0:n.selectedOptions]),j=null==n?void 0:n.selectedOptions.Color,C=(0,u.useMemo)((()=>{const e={};for(const t of l){const o=null==n?void 0:n.selectedOptions[t.name];o&&(f&&void 0===U[t.name]||(e[t.name]=o))}return e}),[l,null==n?void 0:n.selectedOptions,f,U]),N=(0,u.useMemo)((()=>t.values.map((n=>{var o;const i=e.variants.find((e=>{if(e.selectedOptions[t.name]!==n)return!1;if(e.oos)return!1;for(const[t,n]of Object.entries(x))if(e.selectedOptions[t]!==n)return!1;return!0})),a=j?e.variants.find((e=>{if(e.selectedOptions[t.name]!==n)return!1;if(e.oos)return!1;for(const[t,n]of Object.entries(C))if(e.selectedOptions[t]!==n)return!1;return e.selectedOptions.Color===j})):i,l=e.variants.find((e=>{if(e.selectedOptions[t.name]!==n)return!1;for(const[t,n]of Object.entries(b))if(e.selectedOptions[t]!==n)return!1;return!j||e.selectedOptions.Color===j})),r=e.variants.find((e=>{if(e.selectedOptions[t.name]!==n)return!1;for(const[t,n]of Object.entries(b))if(e.selectedOptions[t]!==n)return!1;return!0})),d=null!==(o=null!=l?l:r)&&void 0!==o?o:i;return{value:n,variant:d,isSelected:O===n&&!S,matchesSelectedValue:O===n,availableForSale:!!a,setSelectedVariantId:e=>{null==m||m(t.name,d),l?s(l.variantId):r?s(r.variantId):i?s(i.variantId):d&&s(d.variantId)}}}))),[t.values,t.name,e.variants,O,x,b,C,j,S,m,s]),E=(0,u.useMemo)((()=>!(S||!j||!O||e.variants.some((e=>{if(e.selectedOptions[t.name]!==O)return!1;if(e.oos)return!1;for(const[t,n]of Object.entries(C))if(e.selectedOptions[t]!==n)return!1;return e.selectedOptions.Color===j})))),[S,j,O,e.variants,t.name,C]);if(0===N.length)return(0,o.jsx)(i.Fragment,{});const K=`${e.handle}-${t.name}`.replaceAll(" ","-");return(0,o.jsx)(h,{displayedOptions:N,option:t,fieldsetName:K,isUnselectedSize:S,isVariantUnavailable:E})}function j({product:e,combinedOptionNames:t,sizeOptions:n,selectedVariant:a,setSelectedVariantId:l,productApp:s}){var r;const d=s?(e,t)=>{var n;if(t){const o=null===(n=t.mappedSizes)||void 0===n?void 0:n[e],i=1===(null==o?void 0:o.length)?o[0]:t.selectedOptions[e];s.selectOption({optionName:e,value:i})}}:void 0,c=(0,g.a)(s,a),p=(0,u.useMemo)((()=>t.map((e=>n.find((t=>t.name.toLowerCase()===e.toLowerCase())))).filter((e=>!!e))),[t,n]),v=null===(r=p.find((e=>e.sizing)))||void 0===r?void 0:r.sizing,m=!!v&&"US"!==v,f=(0,u.useMemo)((()=>p.map((e=>{var t;return null!==(t=null==a?void 0:a.selectedOptions[e.name])&&void 0!==t?t:""})).join("")),[p,null==a?void 0:a.selectedOptions]),S=null==a?void 0:a.selectedOptions.Color,O=(0,u.useMemo)((()=>{const t=new Map;for(const n of e.variants){const e={};let o="";for(const t of p){const i=n.selectedOptions[t.name];i&&(e[t.name]=i,o+=i)}Object.keys(e).length===p.length&&(t.get(o)||n.unavailable||t.set(o,{combinedValue:o,optionValues:e,variant:n,availableForSale:!n.oos}))}const n=Array.from(t.values());return n.sort(((e,t)=>{for(const n of p){const o=n.values.indexOf(e.optionValues[n.name]),i=n.values.indexOf(t.optionValues[n.name]);if(o!==i)return o-i}return 0})),n.map((t=>{const n=f===t.combinedValue&&!c;let o=t.variant,i=t.availableForSale;if(S){const n=e.variants.find((e=>{for(const[n,o]of Object.entries(t.optionValues))if(e.selectedOptions[n]!==o)return!1;return e.selectedOptions.Color===S}));n?(o=n,i=!n.oos):i=!1}let a=t.combinedValue;if(m&&v){const e=p.map((e=>{const n=t.optionValues[e.name];return e.name.toLowerCase().includes("cup")?U(n,v):n})).join("");e!==t.combinedValue&&(a=`${t.combinedValue} (${e} US)`)}return{value:a,variant:o,isSelected:n,matchesSelectedValue:f===t.combinedValue,availableForSale:i,setSelectedVariantId:()=>{for(const e of Object.keys(t.optionValues))null==d||d(e,o);l(o.variantId)}}}))}),[e.variants,p,f,c,S,d,l]),x=(0,u.useMemo)((()=>{if(c||!S||!f)return!1;const e=O.find((e=>e.isSelected));return!!e&&!e.availableForSale}),[c,S,f,O]);if(0===O.length)return(0,o.jsx)(i.Fragment,{});const b={name:"Size",values:O.map((e=>e.value))},j=`${e.handle}-combined-size`.replaceAll(" ","-");return(0,o.jsx)(h,{displayedOptions:O,option:b,fieldsetName:j,isUnselectedSize:c,isVariantUnavailable:x})}function C({groupColorsByOptionName:e=!1,newColorSectionName:t,coreColorSectionName:n,sizeGuideCodeBasedFlag:c=!1,defaultSizeGuideOptionName:p="",combinedSizeOptions:v,product:m,selectedVariant:U,setSelectedVariantId:f,compact:h=!1,productApp:S}){var O;const g=null==S?void 0:S.product.value,b=null==S?void 0:S.selectedVariant.value,{getOptionNameForColor:j,getHexForOptionColor:C}=(0,l.d)((e=>({getOptionNameForColor:e.getOptionNameForColor,getHexForOptionColor:e.getHexForOptionColor}))),N=null!=m?m:g,E=null!=U?U:b,K=null==S?void 0:S.findProductVariantWithOption.value,w=null!=K?K:(e,t,n)=>{var o,i,a,l;return(0,d.a)({option:e,variants:null!==(i=null===(o=null!=t?t:N)||void 0===o?void 0:o.variants)&&void 0!==i?i:[],currentOptions:null!==(l=null===(a=null!=n?n:E)||void 0===a?void 0:a.selectedOptions)&&void 0!==l?l:{},fallbackVariant:null!=n?n:E})},z=null!=f?f:e=>{e&&S&&S.setSelectedVariantId({variantId:e})},V=(0,r.b)({product:N,newColorSectionName:t,coreColorSectionName:n,clearanceColors:null===(O=null==S?void 0:S.product.value)||void 0===O?void 0:O.clearanceColors,getOptionNameForColor:e?j:()=>{}}),{sizeOptions:F,nonSizeOptions:I}=(0,u.useMemo)((()=>V?{sizeOptions:V.filter((e=>e.name.toLowerCase().includes("size"))),nonSizeOptions:V.filter((e=>!e.name.toLowerCase().includes("size")))}:{sizeOptions:[],nonSizeOptions:[]}),[V]);if(!N||!V)return(0,o.jsx)(i.Fragment,{});const k="sizeGuide"in N?N.sizeGuide:void 0,D=c?N.sizeGuideCodeBasedData:void 0;return(0,o.jsxs)("div",{className:a.a.container,children:[F.length>0&&(0,o.jsx)(x,{product:N,sizeOptions:F,selectedVariant:E,findProductVariantWithOption:e=>w(e,N,E),setSelectedVariantId:z,sizeGuide:k,sizeGuideCodeBasedData:D,sizeGuideId:N.sizeGuideId,compact:h,combinedSizeOptions:v}),I.map((e=>{var t;return(0,o.jsx)(s.a,{product:N,option:e,getHexForOptionColor:C,selectedVariant:E,findProductVariantWithOption:e=>w(e,N,E),setSelectedVariantId:z,compact:h,productApp:S},`${N.handle}-${null!==(t=e.optionName)&&void 0!==t?t:e.name}`)}))]})}var N=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i{n.d(t,{a:()=>i});var o=n(0);function i({direction:e,onClick:t,className:n,ariaLabel:i,disabled:a}){return(0,o.jsx)("button",{className:n,onClick:t,disabled:a,"data-orly-type":"left"===e?"carousel-prev-btn":"carousel-next-btn","aria-label":i||("left"===e?"Previous":"Next")+" slide",children:(0,o.jsx)("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:"right"===e?"rotate(180deg)":"none"},"aria-hidden":"true",children:(0,o.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.35408 9.2621C5.40065 9.21566 5.43759 9.16048 5.4628 9.09974C5.488 9.03899 5.50098 8.97387 5.50098 8.9081C5.50098 8.84233 5.488 8.77721 5.4628 8.71647C5.43759 8.65572 5.40065 8.60055 5.35408 8.5541L1.70708 4.9081L5.35408 1.2621C5.44797 1.16822 5.50071 1.04088 5.50071 0.908102C5.50071 0.775327 5.44797 0.647989 5.35408 0.554102C5.2602 0.460216 5.13286 0.407471 5.00008 0.407471C4.86731 0.407471 4.73997 0.460216 4.64608 0.554102L0.646083 4.5541C0.59952 4.60055 0.562577 4.65572 0.53737 4.71647C0.512164 4.77721 0.499189 4.84234 0.499189 4.9081C0.499189 4.97387 0.512164 5.03899 0.53737 5.09974C0.562577 5.16048 0.59952 5.21566 0.646083 5.2621L4.64608 9.2621C4.69253 9.30867 4.7477 9.34561 4.80845 9.37081C4.86919 9.39602 4.93432 9.409 5.00008 9.409C5.06585 9.409 5.13097 9.39602 5.19172 9.37081C5.25246 9.34561 5.30764 9.30867 5.35408 9.2621Z",fill:"currentColor"})})})}},68:(e,t,n)=>{n.d(t,{a:()=>d});var o=n(0),i=n(1),a=n(14),l=n(87),s=n(111),r=n(138);function d({isOpen:e,onClose:t,children:n,title:d,showTitle:c=!1,size:u="default"}){const[p,v]=(0,i.useState)(!1),m=(0,i.useRef)(null),U=(0,i.useRef)(!1);(0,r.a)(e);const f=(0,i.useCallback)((()=>{U.current=!0,v(!0)}),[]),h=(0,i.useCallback)((e=>{U.current&&e.target===m.current&&(U.current=!1,v(!1),t())}),[t]),S=(0,i.useCallback)((()=>{f()}),[f]);return(0,o.jsx)(s.a,{isOpen:e,onEscape:f,children:(0,o.jsxs)("div",{className:a.a.modalOverlayBottomSheet,"aria-hidden":!e,children:[(0,o.jsx)("div",{className:a.a.modalBackground,onClick:S,role:"presentation"}),(0,o.jsxs)("div",{ref:m,"data-animate":!0,role:"dialog","aria-modal":!0,tabIndex:-1,"aria-label":d,className:[a.a.modalBottomSheet,p?a.a.closing:"","large"===u?a.a.large:""].join(" "),onAnimationEnd:h,children:[c?(0,o.jsxs)("div",{className:a.a.bottomSheetHeader,children:[(0,o.jsx)("h2",{className:a.a.bottomSheetTitle,children:d}),(0,o.jsx)("button",{className:a.a.bottomSheetCloseBtn,onClick:f,"aria-label":"Close dialog",children:(0,o.jsx)(l.a,{size:"16px",iconClass:a.a.closeIconSVG})})]}):(0,o.jsx)("button",{className:a.a.bottomSheetCloseBtnFloating,onClick:f,"aria-label":"Close dialog",children:(0,o.jsx)(l.a,{size:"20px",iconClass:a.a.closeIconSVG})}),(0,o.jsx)("div",{className:a.a.bottomSheetContent,children:n})]})]})})}},88:(e,t,n)=>{n.d(t,{a:()=>b});var o=n(0),i=n(1),a=n(3),l=n(133),s=n(53),r=n(7),d=n(63),c=n(31),u=n(11),p=n(27),v=n(64),m=n(38),U=n(112),f=n(6),h=n(49),S=n(37),O=n(2),g=n(9),x=function(e,t,n,o){return new(n||(n=Promise))((function(i,a){function l(e){try{r(o.next(e))}catch(e){a(e)}}function s(e){try{r(o.throw(e))}catch(e){a(e)}}function r(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,s)}r((o=o.apply(e,t||[])).next())}))};function b(e){var t,n,b,j;const{product:C,onClose:N,buttonMessage:E,addToCartProperties:K,hidePrice:w=!1,initialVariantId:z,cartApp:V,productApp:F}=e,I=m.a,{pathname:k,isMobile:D,showVendor:G,themeColor:y,getHexForOptionColor:M}=(0,a.d)((e=>({pathname:e.pathname,isMobile:e.isMobile,showVendor:e.showVendor,themeColor:e.themeColor,getHexForOptionColor:e.getHexForOptionColor}))),L=(0,i.useCallback)((e=>x(this,void 0,void 0,(function*(){var t;try{return null!==(t=yield(0,O.getLazyState)("refreshProduct",{handle:e}))&&void 0!==t?t:void 0}catch(e){return}}))),[]),H=null!==(t=(0,O.getAssignment)("productModalDropdown"))&&void 0!==t?t:"disabled",B="enabled"===H||"combined"===H,[A,P]=(0,i.useState)(null),[$,T]=(0,i.useState)(null),J=(0,i.useRef)(!1);(0,i.useEffect)((()=>{A&&$&&!J.current&&(J.current=!0,null==F||F.logViewVariant({product:A,variantId:$.variantId}))}),[A,$,F]);const W=(e,t)=>{if(!t)return e;const n=t.selectedOptions.Color;if(!n)return e;const o=e.filter((e=>e.selectedOptions.Color===n));return o.length>0?o:e},R=(0,i.useRef)(!1);(0,i.useEffect)((()=>{if(!R.current){if(!e.skipFetch){let e=!1;return(()=>{x(this,void 0,void 0,(function*(){try{const t=yield L(C.handle);if(!e&&t){P(t);const e=z?t.variants.find((e=>e.variantId===z)):void 0,n=W(t.variants,e),o=(0,S.a)(n);o&&T(o),R.current=!0}}catch(e){console.error("Failed to fetch full product:",e)}}))})(),()=>{e=!0}}{const t=e.product;P(t);const n=z?t.variants.find((e=>e.variantId===z)):void 0,o=W(t.variants,n),i=(0,S.a)(o);i&&T(i),R.current=!0}}}),[C.handle,e.skipFetch,e.product,z,L]);const Q=A,q=(0,i.useMemo)((()=>{if("combined"!==H||!Q)return;const e=Q.options.filter((e=>e.name.toLowerCase().includes("size"))).map((e=>e.name));return e.length>1?e:void 0}),[H,Q]),Z=z&&C.variants.find((e=>e.variantId===z))||(0,U.c)(C)||C.variants[0],_=(0,i.useMemo)((()=>Q&&$?(0,c.c)(Q.imageMap,$):Z?(0,c.c)(C.imageMap,Z):[]),[null==Q?void 0:Q.imageMap,$,C.imageMap,Z]),X=!!Q&&!!$,[Y,ee]=(0,i.useState)(0),te=(0,i.useRef)(null);(0,i.useEffect)((()=>{ee(0),te.current&&(te.current.scrollLeft=0)}),[null==$?void 0:$.variantId]);const ne=e=>{const t=te.current;t&&t.scrollTo({left:e*t.offsetWidth,behavior:"smooth"})},{title:oe,subtitle:ie}=(0,u.c)(null!==(n=null==Q?void 0:Q.title)&&void 0!==n?n:C.title),ae=(0,p.b)(null!=Q?Q:C,null!=$?$:void 0),le=(0,i.useMemo)((()=>E||"Add to Cart"),[E]),se=(0,i.useMemo)((()=>{var e;if(y||!$)return;const{hexColor:t,color:n}=(0,f.c)({selectedVariant:$,getHexForOptionColor:M,colorOption:(0,h.a)(null!==(e=null==Q?void 0:Q.options)&&void 0!==e?e:[])});return{"--a2c-background-color":t,"--a2c-text-color":n}}),[y,$,M]),re=(0,i.useRef)(!1),de=V.cartStatus.value;if((0,i.useEffect)((()=>{de.status===g.a.updating&&de.variantId===(null==$?void 0:$.variantId)?re.current=!0:re.current&&de.status===g.a.ready&&(re.current=!1,N())}),[de.status,de.variantId,null==$?void 0:$.variantId,N]),0===_.length)return null;const ce=$&&K?Object.assign(Object.assign({},$),{addToCartProperties:Object.assign(Object.assign({},$.addToCartProperties),K)}):$,ue=_.length>1;return(0,o.jsxs)("div",{className:I.productCard,"data-layout":D?"mobile":"desktop",style:se,children:[(0,o.jsxs)("div",{className:I.productImageContainer,children:[ue&&!D&&(0,o.jsx)(d.a,{direction:"left",onClick:()=>ne(Math.max(0,Y-1)),disabled:0===Y,className:`${I.imageArrow} ${I.imageArrowLeft} ${0===Y?I.imageArrowDisabled:""}`,ariaLabel:"Previous image"}),(0,o.jsx)("div",{className:I.imageGallery,ref:te,onScroll:()=>{const e=te.current;if(!e||_.length<=1)return;const t=e.scrollLeft,n=e.offsetWidth,o=Math.round(t/n);ee(Math.min(o,_.length-1))},"data-has-multiple":ue,children:_.map(((e,t)=>{var n,i,a;return(0,o.jsx)("div",{className:I.imageSlide,children:(0,o.jsx)(r.a,{src:e.src,initialWidth:400,cssClass:I.productImage,alt:`${null!==(n=null==Q?void 0:Q.title)&&void 0!==n?n:C.title}: ${null!==(a=null!==(i=e.model)&&void 0!==i?i:e.altText)&&void 0!==a?a:""}`,height:400,width:400,fullSizeWidth:400})},e.src)}))}),ue&&!D&&(0,o.jsx)(d.a,{direction:"right",onClick:()=>ne(Math.min(_.length-1,Y+1)),disabled:Y===_.length-1,className:`${I.imageArrow} ${I.imageArrowRight} ${Y===_.length-1?I.imageArrowDisabled:""}`,ariaLabel:"Next image"}),ue&&(0,o.jsx)("div",{className:I.imageDots,children:_.map(((e,t)=>(0,o.jsx)("button",{type:"button",className:`${I.imageDot} ${t===Y?I.imageDotActive:""}`,onClick:()=>ne(t),"aria-label":`View image ${t+1}`},t)))})]}),(0,o.jsxs)("div",{className:I.productDetails,children:[G&&(null!==(b=null==Q?void 0:Q.vendor)&&void 0!==b?b:C.vendor)&&(0,o.jsx)("div",{className:I.productBrand,children:null!==(j=null==Q?void 0:Q.vendor)&&void 0!==j?j:C.vendor}),(0,o.jsx)("h3",{className:I.productTitle,children:oe}),ie&&(0,o.jsx)("div",{className:I.productSubtitle,children:ie}),!w&&(0,o.jsx)("div",{className:I.productPriceContainer,children:X?(0,o.jsx)(s.c,{selectedVariant:$,product:Q}):(0,o.jsx)("div",{className:I.skeletonPrice})}),(0,o.jsx)("div",{className:I.productOptions,children:X?(0,o.jsx)(l.a,{useSizeDropdowns:B,combinedSizeOptions:q,product:Q,selectedVariant:$,setSelectedVariantId:e=>{const t=Q.variants.find((t=>t.variantId===e));t&&(T(t),null==F||F.logViewVariant({product:Q,variantId:t.variantId}))}}):(0,o.jsxs)("div",{className:I.skeletonOptions,children:[(0,o.jsx)("div",{className:I.skeletonOptionLabel}),(0,o.jsxs)("div",{className:I.skeletonOptionButtons,children:[(0,o.jsx)("div",{className:I.skeletonButton}),(0,o.jsx)("div",{className:I.skeletonButton}),(0,o.jsx)("div",{className:I.skeletonButton})]}),(0,o.jsx)("div",{className:I.skeletonOptionLabel}),(0,o.jsxs)("div",{className:I.skeletonOptionButtons,children:[(0,o.jsx)("div",{className:I.skeletonButton}),(0,o.jsx)("div",{className:I.skeletonButton}),(0,o.jsx)("div",{className:I.skeletonButton}),(0,o.jsx)("div",{className:I.skeletonButton})]})]})}),X&&ce?(0,o.jsx)(v.a,{selectedVariant:ce,pathname:k,cartApp:V,buttonMessage:le}):(0,o.jsx)("div",{className:I.skeletonAddToCart}),(0,o.jsx)("a",{href:ae,className:I.viewDetailsLink,children:"View Full Details"})]})]})}}}]);