"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[28],{114:(e,t,n)=>{n.d(t,{a:()=>c});var r=n(3),i=n(2),a=n(48),o=n(21),d=n(28),l=n(1),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function d(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,d)}l((r=r.apply(e,t||[])).next())}))};function c({defaultSelectedVariantIds:e,bundleProducts:t}){const n=function(e){const[t,n]=(0,i.useState)(e);return(0,i.useEffect)((()=>{n(e);const t=()=>s(this,void 0,void 0,(function*(){const t={},r=yield Promise.all(e.map((e=>s(this,void 0,void 0,(function*(){var n;return t[e.handle]||(t[e.handle]=function(e){return s(this,void 0,void 0,(function*(){return yield(0,l.getLazyState)("refreshProduct",{handle:e,isPDP:!1})}))}(e.handle)),null!==(n=yield t[e.handle])&&void 0!==n?n:e})))));n(r)}));return window.addEventListener("refreshProduct",t),()=>{window.removeEventListener("refreshProduct",t)}}),[e]),"undefined"==typeof window?e:t}(t),{stateSelectedVariant:c,stateProduct:u,setStateSelectedVariantId:p}=(0,r.c)((e=>({stateProduct:e.product,stateSelectedVariant:e.selectedVariant,setStateSelectedVariantId:e.setSelectedVariantId}))),[v,m]=(0,i.useState)(n.map(((t,n)=>{const r=e[n];return t.variants.find((e=>e.variantId===r))})));(0,i.useEffect)((()=>{m(function(e,t){return e.map(((e,n)=>{const r=t[n];return e.variants.find((e=>e.variantId===r))}))}(n,e))}),[n]);const b=n.findIndex((e=>e.handle===(null==u?void 0:u.handle))),f=function({stateProductIndex:e,stateSelectedVariant:t,selectedItems:n,setSelectedItems:r,bundleProducts:o}){const[d,l]=(0,i.useState)(o.map((()=>({})))),s=(0,i.useMemo)((()=>({changedProductIndex:t,newVariant:i,oldVariant:s})=>{const c=function({oldVariant:e,newVariant:t}){if(e.variantId===t.variantId)return;const n=Object.entries(t.selectedOptions).filter((([t,n])=>e.selectedOptions[t]!==n));return n.length?Object.fromEntries(n):void 0}({oldVariant:s,newVariant:i});if(!c)return;const u=d.map(((e,n)=>n!==t?e:Object.assign(Object.assign({},e),c)));l(u);const p=n.map(((n,r)=>{if(r===t)return i;if(r===e)return n;const l=o[r],s=Object.assign(Object.assign(Object.assign({},n.selectedOptions),c),d[r]),u=(0,a.b)({variants:l.variants,currentOptions:s});return null!=u?u:n}));r(p)}),[d]);return(0,i.useMemo)((()=>{if(!t||-1===e)return;const r=n[e];r.variantId!==(null==t?void 0:t.variantId)&&s({changedProductIndex:e,newVariant:t,oldVariant:r})}),[t]),s}({stateProductIndex:b,stateSelectedVariant:c,selectedItems:v,setSelectedItems:m,bundleProducts:t,stateProduct:u});return{bundleItems:(0,i.useMemo)((()=>n.map(((e,t)=>{var n,r,i;const a=null!==(n=e.variants.find((e=>e.variantId===v[t].variantId)))&&void 0!==n?n:v[t],l=null!==(i=null===(r=(0,d.a)(e.imageMap,a)[0])||void 0===r?void 0:r.src)&&void 0!==i?i:"placeholder";return{product:e,selectedVariant:a,setSelectedVariant:e=>{f({changedProductIndex:t,newVariant:e,oldVariant:a}),t===b&&e.variantId!==a.variantId&&p(e.variantId)},heroImage:l,preOrderMessage:(0,o.d)(a)}}))),[u,c,v,n])}}},111:(e,t,n)=>{n.d(t,{a:()=>L,b:()=>R});var r=n(0),i=n(4),a=n(81),o=n(3),d=n(112),l=n(15),s=n(1),c=n(2),u=n(21),p=n(24),v=n(51),m=n(80);function b(e){const t=new Set;return t.add(e.product.handle),e.product.preorderSiblingHandle&&t.add(e.product.preorderSiblingHandle),e.product.variants.forEach((e=>{var n;const r=null===(n=e.selectedOptions)||void 0===n?void 0:n.childProductHandle;r&&t.add(r)})),Array.from(t)}function f(e,t){const n=(0,c.useMemo)((()=>{const e=new Set;return t.forEach((t=>b(t).forEach((t=>e.add(t))))),Array.from(e)}),[t]),{data:r,classNamesByHandle:i,ssrStylesByHandle:a,currencyMap:o}=(0,v.b)(n),d=(0,c.useMemo)((()=>function(e,t,n){const r=Array.from(new Set(t.flatMap((e=>b(e))))),i=t.map((e=>{var t,i,a,o,d,l,s,c;const u=b(e),p=e.selectedVariant,v=function(e,t,n,r,i,a){var o,d,l;const s=(t,n)=>{var r,i;if(n)for(const a of t){const t=e[a],o=null===(r=null==t?void 0:t.variants)||void 0===r?void 0:r.find((e=>e.id===n));if(o)return{price:o.price.asNumber,compareAt:null===(i=o.compareAtPrice)||void 0===i?void 0:i.asNumber}}};let c,u=s(n,r);if(u||(u=s(n,i)),u||(u=null!==(o=s(t,r))&&void 0!==o?o:s(t,i)),a){const e=null!==(d=s(n,a))&&void 0!==d?d:s(t,a);c=null==e?void 0:e.price}return{price:null==u?void 0:u.price,compareAt:null!==(l=null==u?void 0:u.compareAt)&&void 0!==l?l:null==u?void 0:u.price,preorderPrice:c}}(n,r,u,p.variantId,p.parentId,null===(t=p.preorderVariant)||void 0===t?void 0:t.id);return{isOOS:!!p.oos,hasPreorder:!!p.preorderVariant,price:null!==(i=v.price)&&void 0!==i?i:parseFloat(p.price),compareAt:null!==(a=v.compareAt)&&void 0!==a?a:p.compareAtPrice?parseFloat(p.compareAtPrice):parseFloat(p.price),preorderPrice:null!==(o=v.preorderPrice)&&void 0!==o?o:(null===(d=p.preorderVariant)||void 0===d?void 0:d.price)?parseFloat(p.preorderVariant.price):void 0,shipDiscount:p.maxBundleDiscount,preorderDiscount:null!==(s=null===(l=p.preorderVariant)||void 0===l?void 0:l.maxBundleDiscount)&&void 0!==s?s:p.maxBundleDiscount,usedMapPrice:void 0!==v.price,variantId:p.variantId,preorderId:null===(c=p.preorderVariant)||void 0===c?void 0:c.id}})),a=i.every((e=>!e.isOOS)),o=i.every((e=>e.hasPreorder)),d=(0,m.c)(i.reduce(((e,t)=>{var n;return e+(null!==(n=t.price)&&void 0!==n?n:0)}),0)),l=i.reduce(((e,t)=>{var n,r;return e+(null!==(r=null!==(n=t.compareAt)&&void 0!==n?n:t.price)&&void 0!==r?r:0)}),0),s=i.map((e=>{var t,n;return{id:null!==(t=e.variantId)&&void 0!==t?t:"",price:null!==(n=e.price)&&void 0!==n?n:0,isPreOrderVariant:!1,discount:e.shipDiscount}})),c=(0,m.a)(e,s)/100,u=(0,m.c)(d*(1-c)),p=i.map((e=>{var t,n,r,i;return{id:null!==(n=null!==(t=e.preorderId)&&void 0!==t?t:e.variantId)&&void 0!==n?n:"",price:null!==(i=null!==(r=e.preorderPrice)&&void 0!==r?r:e.price)&&void 0!==i?i:0,isPreOrderVariant:!0,discount:e.preorderDiscount}})),v=o?(0,m.a)(e,p)/100:0,f=(0,m.c)(i.reduce(((e,t)=>{var n,r;return e+(null!==(r=null!==(n=t.preorderPrice)&&void 0!==n?n:t.price)&&void 0!==r?r:0)}),0)*(1-v));return{compareAtBundlePrice:d,compareAtRetailBundlePrice:l,bundlePrice:!a&&o?f:u,preOrderPrice:f,mapPriceCoverage:i.reduce(((e,t)=>e+(t.usedMapPrice?1:0)),0)}}(e,t,r)),[r,n,t,e]),l=n[0];return Object.assign(Object.assign({},d),{className:(null==i?void 0:i[l])||"",ssrStyle:null==a?void 0:a[l],currencyCode:o[l]||"USD"})}var g=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function d(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,d)}l((r=r.apply(e,t||[])).next())}))};function h({bundleItems:e,addToCart:t,cartStatus:n,size:i,showPriceOnButton:a,discountConfig:p,bundleName:v,buttonMessage:m,outlined:b,buttonSubText:h}){var x;const{compareAtBundlePrice:j,compareAtRetailBundlePrice:O,bundlePrice:y,className:S,ssrStyle:V,currencyCode:I}=f(p,e),{preOrderPrice:w}=f(p,e),C=e.some((e=>(0,u.f)(e.selectedVariant))),[B,A]=(0,c.useState)(!1);(0,c.useEffect)((()=>{A(!0)}),[]);const T=e.every((({selectedVariant:e})=>!e.oos)),k=e.map((({selectedVariant:e})=>e.variantId)),D=e.map((({selectedVariant:e})=>({id:e.variantId,discount:e.maxBundleDiscount,isPreOrderVariant:(0,u.f)(e),price:parseFloat(e.price),signature:e.discountSignature}))),M=k.filter(l.c).length===k.length;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("form",{class:[d.a.container,"small"===i?d.a.small:""].join(" "),children:(0,r.jsx)("button",{type:"submit",disabled:!B||n.status===o.a.updating||!T,class:[d.a.addButton,"small"===i?d.a.small:"",b?d.a.outlined:""].join(" "),onClick:n=>g(this,void 0,void 0,(function*(){if(n.preventDefault(),!M)return void console.error("Tried to add a variant to the cart that has no ID");const r=yield(0,s.getLazyState)("signBundle",{variants:D,bundleName:v,discountConfig:p}),i=(0,u.d)(...e.map((e=>e.selectedVariant))),a=e.map((e=>({id:e.selectedVariant.variantId,quantity:1,properties:Object.assign(Object.assign(Object.assign({},r),e.selectedVariant.addToCartProperties),{_compareRetail:100*(null!=O?O:0),_compareSolo:100*(null!=j?j:0),_bundleOrder:e.product.bundleOrder,Shipping:null==i?void 0:i.propertyValue,_shipping_days:null==i?void 0:i.days,_olpre:i&&"preorder"})})));t({items:a})})),children:(0,r.jsx)(P,{showPriceOnButton:a,isUpdating:`${null===(x=e[0])||void 0===x?void 0:x.selectedVariant.variantId}_bundle${b?"_pre":""}`===n.variantId&&n.status===o.a.updating,isPreorder:C,isSoldOut:!T,compareAtRetailBundlePrice:O,compareAtBundlePrice:j,bundlePrice:C&&null!=w?w:y,buttonMessage:m,buttonSubText:h,className:S,ssrStyle:V,currencyCode:I})})})})}function P({isUpdating:e,isPreorder:t,isSoldOut:n,showPriceOnButton:i,compareAtBundlePrice:a,compareAtRetailBundlePrice:o,bundlePrice:l,buttonMessage:c,buttonMessageMobile:u,buttonSubText:v,className:m,ssrStyle:b,currencyCode:f}){const g=(0,p.c)(f||"USD");if(n)return(0,r.jsx)("span",{children:"Sold Out"});if(e)return(0,r.jsx)("span",{children:"Adding..."});const h=null!=u?u:t?"Pre-Order Bundle":"Add Bundle Now",P=null!=c?c:t?"Add Pre-Order Bundle":"Add Bundle to Cart";if(i){const e="doubleStrikeThrough"===(0,s.getAssignment)("bundleButtonTreatment");return e||(a=void 0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{class:d.a.messageMobile,children:h}),(0,r.jsx)("span",{class:d.a.message,children:P}),(0,r.jsx)("span",{"aria-hidden":"true",children:e?" ":" - "}),(0,r.jsx)("span",{class:m,style:b,children:(0,r.jsxs)("span",{children:[(0,r.jsx)(x,{compareAtPrice:o,price:null!=a?a:l,format:g}),(0,r.jsx)(x,{compareAtPrice:a,price:l,format:g}),(0,r.jsx)("span",{"aria-label":`Price: ${g(l)}`,children:g(l)})]})})]}),v&&(0,r.jsx)("div",{class:d.a.estimatedShipDate,children:v})]})}return(0,r.jsx)("span",{children:P})}function x({compareAtPrice:e,price:t,format:n}){return e?(0,r.jsx)("span",{style:{whiteSpace:"nowrap"},children:e>t&&(0,r.jsx)("s",{class:d.a.linethrough,"aria-label":`Original price: ${n(e)}`,children:n(e)})}):(0,r.jsx)(r.Fragment,{})}var j=n(34),O=n(113),y=n(5),S=n(38),V=n(25),I=n(35),w=n(66),C=n(50),B=n(28),A=n(82),T=n(16);function k(){var e,t;const{selectedVariant:n}=(0,o.c)((({selectedVariant:e})=>({selectedVariant:e}))),{siblingProducts:i,siblingProduct:a}=(0,A.b)();if(!(null==i?void 0:i.length)||1===i.length)return null;const d=null!==(e=null==n?void 0:n.selectedOptions.Color)&&void 0!==e?e:"default",l=`Style: ${null!==(t=null==a?void 0:a.title)&&void 0!==t?t:""}`;return(0,r.jsxs)("fieldset",{role:"radiogroup","aria-label":"Select a Product To Bundle",style:{border:0,padding:0},children:[(0,r.jsx)("legend",{class:T.a.legend,children:l}),i.map((e=>(0,r.jsx)(D,{selectedColor:d,product:e})))]})}function D({selectedColor:e,product:t}){var n,i;const{siblingProduct:a,setSiblingProduct:o}=(0,A.b)(),d=(null!==(i=null===(n=t.imageMap[e])||void 0===n?void 0:n[0])&&void 0!==i?i:(0,B.a)(t.imageMap,t.variants[0])[0]).src,l={backgroundImage:`url("${(0,y.b)(null!=d?d:"",80,250)}")`},s=Boolean(a&&a.id===t.id);return(0,r.jsxs)("label",{class:T.a.swatchLabel,children:[(0,r.jsx)("span",{style:l,class:s?T.a.checked:""}),(0,r.jsx)("input",{type:"radio",name:"siblingProduct",value:String(t.id),checked:s,onChange:()=>o(t)})]},t.id)}var M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i"childProductHandle"===e.name)),y=(0,I.b)(f,g),B=function(e){var{findProductVariantWithOption:t,setSelectedVariant:n}=e,r=M(e,["findProductVariantWithOption","setSelectedVariant"]);return Object.assign(Object.assign({},r),{small:!0,findProductVariantWithOption:e=>t(e,r.product,r.selectedVariant),setSelectedVariantId(e){const t=r.product.variants.find((t=>t.variantId===e));t&&n(t)}})}(Object.assign(Object.assign({},e),{findProductVariantWithOption:n,getHexForOptionColor:i,getPriceDifferences:u})),A=O?e=>{var t;const n=null!==(t=(0,s.getAssignment)("bundleLinkBehavior"))&&void 0!==t?t:"default";"noAction"===n?e.preventDefault():"newTab"===n&&(e.preventDefault(),window.open(e.currentTarget.href,"_blank"))}:void 0,T=(0,C.b)(f.options,f.variants),D=(()=>{const e=new Set;return e.add(f.handle),f.variants.forEach((t=>{var n;const r=null===(n=t.selectedOptions)||void 0===n?void 0:n.childProductHandle;r&&e.add(r)})),Array.from(e)})(),{classNamesByHandle:_,ssrStylesByHandle:H,currencyMap:W}=(0,v.b)(D),E=D[0],$=(null==_?void 0:_[E])||"",L=null==H?void 0:H[E],R=(null==W?void 0:W[E])||"USD",{variantPrice:U}=(0,v.d)(f,null==g?void 0:g.variantId),z=(null!==(p=null==U?void 0:U.price.asNumber)&&void 0!==p?p:(null==g?void 0:g.price)?parseFloat(g.price):0)||0,q=(null!==(b=null===(m=null==U?void 0:U.compareAtPrice)||void 0===m?void 0:m.asNumber)&&void 0!==b?b:(null==g?void 0:g.compareAtPrice)?parseFloat(g.compareAtPrice):z)||0;return(0,r.jsxs)("div",{class:a.a.container,children:["heroSlider"===l?(0,r.jsxs)("div",{style:"position: relative; margin-left: var(--section-padding);",children:[(0,r.jsx)(w.a,{product:f,selectedVariant:g,embedded:!0}),(0,r.jsx)(N,{})]}):"miniPDP"===l?(0,r.jsx)(F,{src:h}):(0,r.jsx)(F,{src:h,productUrl:y,linkClick:A}),(0,r.jsxs)("div",{class:a.a.buyBox,children:[(0,r.jsx)("a",{href:y,class:a.a.title,onClick:A,children:x}),("newTab"===c||"open"===c)&&(0,r.jsx)("a",{href:y,class:a.a.viewDetails,target:"newTab"===c?"_blank":void 0,children:"View full product details..."}),(0,r.jsxs)("div",{class:a.a.optionWrapper,children:[(0,r.jsx)(j.a,{compareAtRetailBundlePrice:q,compareAtBundlePrice:z,hideFinalPrice:!0,bundlePrice:z*(1-d),small:!0,currencyCode:R,className:$,ssrStyle:L}),e.preOrderMessage&&(0,r.jsx)("div",{class:a.a.preOrderMessage,children:e.preOrderMessage.displayValue}),T.map((t=>{var n;const i=function(e,t){if("childProductHandle"===e.name)return"styleSelector";return("desktop"!==t||e.values.length>8)&&"Color"!==e.name?"renderDropdown":"buttons"}(t,o);return(0,r.jsx)(S.a,Object.assign({},B,{showVariantTitle:"childProductHandle"===t.name,selectType:i,option:t}),`${e.product.handle}-${null!==(n=t.optionName)&&void 0!==n?n:t.name}`)})),t&&(0,r.jsx)(k,{})]})]})]})}function F({src:e,productUrl:t,linkClick:n}){return(0,r.jsx)("a",{class:[a.a.box,a.a.packImage].join(" "),href:t,onClick:n,children:(0,r.jsx)(y.a,{src:e,initialWidth:250,fullSizeWidth:250,width:100,height:100,cssClass:a.a.image})})}function N({size:e=24,color:t="currentColor"}){return(0,r.jsxs)("svg",{className:a.a.magnifyingGlass,width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"7",stroke:t,strokeWidth:"2"}),(0,r.jsx)("line",{x1:"11",y1:"8",x2:"11",y2:"14",stroke:t,strokeWidth:"2",strokeLinecap:"round"}),(0,r.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11",stroke:t,strokeWidth:"2",strokeLinecap:"round"}),(0,r.jsx)("line",{x1:"16.7071",y1:"16.7071",x2:"21",y2:"21",stroke:t,strokeWidth:"2",strokeLinecap:"round"})]})}var H=n(114),W=n(72),E=n(68),$=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i({selectedVariant:e.selectedVariant,product:e.product})));if(!n||!d)return(0,r.jsx)(i.Fragment,{});const{parentIndex:s}=(0,A.b)(),u=(0,c.useMemo)((()=>0===s?[d,n]:[n,d]),[d,n]),p=(0,c.useMemo)((()=>u.map((e=>{var t;return null===(t=(0,W.a)({selectedVariant:l,siblingProduct:e}))||void 0===t?void 0:t.variantId}))),[u]),{bundleItems:v}=(0,H.a)({bundleProducts:u,defaultSelectedVariantIds:p}),m=null!==(t=null==d?void 0:d.bundleTitle)&&void 0!==t?t:"Bundle and Save";return(0,r.jsx)(R,Object.assign({parentIndex:s,bundleTitle:m,bundleItems:v},a))}function R({parentIndex:e,bundleTitle:t,bundleItems:n,device:i,discountConfig:d,bundleTagMessage:l,imageTreatment:s,viewDetails:c,couponCheckboxProps:u}){const{product:p,getHexForOptionColor:v,findProductVariantWithOption:b,addToCartButtonsConfig:g}=(0,o.c)((e=>({product:e.product,selectedVariant:e.selectedVariant,findProductVariantWithOption:e.findProductVariantWithOption,getHexForOptionColor:e.getHexForOptionColor,addToCartButtonsConfig:e.config.addToCartButtonsConfig}))),{bundleDiscount:h,getPriceDifferences:P}=(0,m.b)(d,n),{compareAtBundlePrice:x,compareAtRetailBundlePrice:y,bundlePrice:S,className:V,ssrStyle:I,currencyCode:w}=f(d,n);return(0,r.jsxs)("div",{class:a.a.bundleCompleteTheLookContainer,children:[(0,r.jsx)(O.a,{heroTitle:t,headingLevel:"2",isBundle:!0}),(0,r.jsx)(j.a,{tagOverride:l,compareAtRetailBundlePrice:y,compareAtBundlePrice:x,bundlePrice:S,currencyCode:w,className:V,ssrStyle:I}),n.map(((t,n)=>(0,r.jsx)(_,{isSibling:void 0!==e&&n!==e,viewDetails:t.product.handle!==(null==p?void 0:p.handle)?c:void 0,imageTreatment:s,bundleItem:t,findProductVariantWithOption:b,getHexForOptionColor:v,device:i,bundleDiscount:h,getPriceDifferences:P},`${t.product.id}-${n}`))),u&&(0,r.jsx)(E.a,Object.assign({},u)),(0,r.jsx)(U,{bundleItems:n,discountConfig:d,bundleTitle:t,addToCartButtonsConfig:g})]})}function U({bundleItems:e,discountConfig:t,bundleTitle:n,addToCartButtonsConfig:a}){var d;const{addToCart:l,cartStatus:s,product:c}=(0,o.c)((e=>({product:e.product,addToCart:e.addToCart,cartStatus:e.cartStatus}))),p=e.every((e=>e.selectedVariant.preorderVariant)),v=[],b=e.every((({selectedVariant:e})=>!e.oos)),f={bundleItems:e,addToCart:l,cartStatus:s,product:c,showPriceOnButton:!0,discountConfig:t,bundleName:n,buttonSubText:null==a?void 0:a.add_to_cart_shipping_message};if(!b&&p||v.push(f),p){const n=Object.assign(Object.assign({},f),{bundleItems:e.map((e=>Object.assign(Object.assign({},e),{selectedVariant:(0,u.g)(e.selectedVariant)}))),buttonMessage:null==a?void 0:a.pre_order_shipping_message,buttonSubText:`${null!==(d=null==a?void 0:a.pre_order_button_shipping_prefix)&&void 0!==d?d:""}Bundle ${(0,u.b)(e.map((e=>e.selectedVariant))).displayValue}`,outlined:!0}),r=(0,m.b)(t,e),i=(0,m.b)(t,n.bundleItems);(!b||i.bundlePrice(0,r.jsx)(h,Object.assign({},e))))})}},82:(e,t,n)=>{n.d(t,{a:()=>l,b:()=>s});var r=n(0),i=n(4),a=n(2),o=n(3);const d=(0,i.createContext)(void 0);function l({siblingProducts:e,children:t}){const[n,i]=(0,a.useState)(e[0]),{product:l}=(0,o.c)((({product:e})=>({product:e}))),s=(0,a.useMemo)((()=>{var e,t;const r=null!==(e=null==l?void 0:l.bundleOrder)&&void 0!==e?e:1,i=null!==(t=n.bundleOrder)&&void 0!==t?t:2;return 1===r?0:1===i?1:0}),[l]);return(0,r.jsx)(d.Provider,{value:{parentIndex:s,siblingProducts:e,siblingProduct:n,setSiblingProduct:i},children:t})}function s(){const e=(0,a.useContext)(d);if(!e)throw new Error("useBundleContext must be used within a BundleProvider");return e}},72:(e,t,n)=>{n.d(t,{a:()=>o,b:()=>a});var r=n(2),i=n(48);function a({selectedVariant:e,siblingProduct:t}){const n=t.variants.some((t=>t.variantId===(null==e?void 0:e.variantId))),i=o({selectedVariant:e,siblingProduct:t}),[a,d]=(0,r.useState)(n?i:void 0);return[null!=a?a:i,d]}function o({selectedVariant:e,siblingProduct:t}){var n;const r=Object.assign({},null!==(n=null==e?void 0:e.selectedOptions)&&void 0!==n?n:{}),a=t.variants;Object.entries(r).forEach((([e,n])=>{t.options.find((t=>t.name===e&&t.values.includes(n)))||delete r[e]}));const o=null==r?void 0:r.Color,d=(0,i.b)({option:o?{name:"Color",value:o}:void 0,variants:a,currentOptions:r});return null!=d?d:a[0]}}}]);