@lime-bundles/widget 4.6.8 → 4.6.9
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/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/lime-bundle.global.js +1 -1
- package/dist/lime-bundle.global.js.map +1 -1
- package/package.json +2 -2
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
warnings { code message target }
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
`;var le=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},Kt={none:0,subtle:6,rounded:12,round:18},ie={header:{countdownBgColor:"#B4DC7F47",countdownTextColor:"#555555"},layout:{backgroundColor:"#FCFCFC",borderColor:"#E5E5E5",borderWidth:1,borderRadius:"subtle"},productList:{textColor:"#555555",thumbnailRatio:"square",showPrice:!0,showCompareAtPrice:!0,showUnitPrice:!0,showQuantity:!0},pricing:{showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#B4DC7F",buttonTextColor:"#555555",borderWidth:0,borderColor:"#B4DC7F"},savingsBar:{visible:!0},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A"},showLowStockBadge:!0,lowStockThreshold:10,lowStockBgColor:"#FEF3C7",lowStockTextColor:"#92400E",showSearch:!0,mixMatchShowTypeFilters:!0,mixMatchShowQuantitySelector:!0,pickerBgColor:"#FCFCFC",pickerTextColor:"#555555",pickerBorderWidth:1,pickerBorderColor:"#E5E5E5",pickerBorderRadius:"subtle",pickerThumbnailRatio:"square",pickerAddBgColor:"#B4DC7F",pickerAddLabelColor:"#555555",pickerAddBorderWidth:0,pickerAddBorderColor:"#B4DC7F",multiStepAutoAdvance:!1,defaultTier:"first"};function so(e){if(!e||typeof e!="object")return ie;let t=e;return{...ie,...t,defaultTier:co(t.defaultTier),pickerBorderRadius:Yt(t.pickerBorderRadius),header:{...ie.header,...t.header??{}},layout:{...ie.layout,...t.layout??{},borderRadius:Yt(t.layout?.borderRadius)},productList:{...ie.productList,...t.productList??{}},pricing:{...ie.pricing,...t.pricing??{}},cta:{...ie.cta,...t.cta??{}},savingsBar:{...ie.savingsBar,...t.savingsBar??{}},countdown:{...ie.countdown,...t.countdown??{}},popularBadge:{...ie.popularBadge,...t.popularBadge??{}}}}function co(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:ie.defaultTier}function Yt(e){return e==="none"||e==="subtle"||e==="rounded"||e==="round"?e:ie.layout.borderRadius}function uo(e){return{primaryColor:e.cta.primaryColor,backgroundColor:e.layout.backgroundColor,textColor:e.productList.textColor,borderColor:e.layout.borderColor,borderWidth:e.layout.borderWidth,buttonTextColor:e.cta.buttonTextColor,ctaBorderWidth:e.cta.borderWidth,ctaBorderColor:e.cta.borderColor,borderRadius:Kt[e.layout.borderRadius],countdownBgColor:e.header.countdownBgColor,countdownTextColor:e.header.countdownTextColor,thumbnailRatio:e.productList.thumbnailRatio,showProductPrice:e.productList.showPrice,showProductCompareAtPrice:e.productList.showCompareAtPrice,showProductUnitPrice:e.productList.showUnitPrice,showProductQuantity:e.productList.showQuantity,showCountdown:e.countdown.showCountdown,ctaText:e.cta.ctaText,showLowStockBadge:e.showLowStockBadge,lowStockThreshold:e.lowStockThreshold,lowStockBgColor:e.lowStockBgColor,lowStockTextColor:e.lowStockTextColor,showComparePrice:e.pricing.showComparePrice,showPerUnitPrice:e.pricing.showPerUnitPrice,showItemCount:e.pricing.showItemCount,showCompareAtPrice:e.pricing.showCompareAtPrice,showMostPopular:e.popularBadge.visible,popularBadgeText:e.popularBadge.text,popularBadgeBgColor:e.popularBadge.bgColor,popularBadgeTextColor:e.popularBadge.textColor,popularBadgeBorderWidth:e.popularBadge.borderWidth,popularBadgeBorderColor:e.popularBadge.borderColor,showSearch:e.showSearch,mixMatchShowTypeFilters:e.mixMatchShowTypeFilters,pickerBgColor:e.pickerBgColor,pickerTextColor:e.pickerTextColor,pickerBorderWidth:e.pickerBorderWidth,pickerBorderColor:e.pickerBorderColor,pickerBorderRadius:Kt[e.pickerBorderRadius],pickerThumbnailRatio:e.pickerThumbnailRatio,pickerAddBgColor:e.pickerAddBgColor,pickerAddLabelColor:e.pickerAddLabelColor,pickerAddBorderWidth:e.pickerAddBorderWidth,pickerAddBorderColor:e.pickerAddBorderColor,defaultTier:e.defaultTier,...e.popularBadge.tierIndex!==void 0&&{mostPopularTierIndex:e.popularBadge.tierIndex}}}var po={primaryColor:"--lb-primary-color",backgroundColor:"--lb-bg",textColor:"--lb-text",borderColor:"--lb-border",borderWidth:"--lb-border-width",buttonTextColor:"--lb-btn-text",borderRadius:"--lb-radius",countdownBgColor:"--lb-countdown-bg",countdownTextColor:"--lb-countdown-text",ctaBorderWidth:"--lb-cta-border-width",ctaBorderColor:"--lb-cta-border-color",popularBadgeBgColor:"--lb-popular-badge-bg",popularBadgeTextColor:"--lb-popular-badge-text",popularBadgeBorderWidth:"--lb-popular-badge-border-width",popularBadgeBorderColor:"--lb-popular-badge-border-color",pickerBgColor:"--lb-picker-bg",pickerTextColor:"--lb-picker-text",pickerBorderWidth:"--lb-picker-border-width",pickerBorderColor:"--lb-picker-border-color",pickerBorderRadius:"--lb-picker-radius",pickerAddBgColor:"--lb-picker-add-bg",pickerAddLabelColor:"--lb-picker-add-label",pickerAddBorderWidth:"--lb-picker-add-border-width",pickerAddBorderColor:"--lb-picker-add-border-color"},mo=new Set(["borderRadius","borderWidth","ctaBorderWidth","popularBadgeBorderWidth","pickerBorderWidth","pickerBorderRadius","pickerAddBorderWidth"]);function gn(e,t){let n=uo(t);for(let[i,a]of Object.entries(po)){let l=n[i];if(l==null)continue;let d=mo.has(i)?`${l}px`:String(l);e.style.setProperty(a,d)}e.style.setProperty("--lb-product-price-display",t.productList.showPrice?"block":"none"),e.style.setProperty("--lb-product-compare-display",t.productList.showCompareAtPrice?"inline":"none"),e.style.setProperty("--lb-product-unit-price-display",t.productList.showUnitPrice?"block":"none"),e.style.setProperty("--lb-product-qty-chip-display",t.productList.showQuantity?"inline-flex":"none"),e.style.setProperty("--lb-product-qty-inline-display",t.productList.showQuantity?"inline":"none"),e.style.setProperty("--lb-variant-chevron",Jt(t.layout.borderColor)),e.style.setProperty("--lb-picker-variant-chevron",Jt(t.pickerBorderColor));let r=Xt(t.productList.thumbnailRatio);e.style.setProperty("--lb-thumbnail-aspect-ratio",r.aspectRatio),e.style.setProperty("--lb-thumbnail-img-fit",r.imgFit),e.style.setProperty("--lb-thumbnail-img-height",r.imgHeight);let o=Xt(t.pickerThumbnailRatio);e.style.setProperty("--lb-picker-thumbnail-aspect-ratio",o.aspectRatio),e.style.setProperty("--lb-picker-thumbnail-img-fit",o.imgFit),e.style.setProperty("--lb-picker-thumbnail-img-height",o.imgHeight)}function Jt(e){return`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='${e.replace(/#/g,"%23")}' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")`}function Xt(e){switch(e){case"tall":return{aspectRatio:"3 / 4",imgFit:"cover",imgHeight:"100%"};case"wide":return{aspectRatio:"4 / 3",imgFit:"cover",imgHeight:"100%"};case"original":return{aspectRatio:"auto",imgFit:"contain",imgHeight:"auto"};default:return{aspectRatio:"1 / 1",imgFit:"cover",imgHeight:"100%"}}}var bo=new Set(["fixed","mix_match","volume","bogo","multi_step"]),ho=new Set(["active"]);function At(e,t){try{return fo(e,t)}catch(n){if(n instanceof le)return null;throw n}}function fo(e,t){let n=new Map(t.map(k=>[k.key,k])),r=n.get("title")?.value??"Bundle",o=n.get("bundle_type")?.value,i=n.get("status")?.value;if(!o||!bo.has(o))throw new le(`Invalid or missing bundle_type: ${o??"null"}`,"invalid_type");let a=o;if(!i||!ho.has(i))throw new le(`Bundle is not active: status=${i??"null"}`,"inactive");let l=i,d=n.get("starts_at")?.value??null,s=n.get("ends_at")?.value??null,u=new Date;if(d){let k=new Date(d);if(Number.isNaN(k.getTime()))throw new le(`Invalid starts_at: ${d}`,"invalid_type");if(k>u)throw new le(`Bundle not yet started: starts_at=${d}`,"not_started")}if(s){let k=new Date(s);if(Number.isNaN(k.getTime()))throw new le(`Invalid ends_at: ${s}`,"invalid_type");if(k<u)throw new le(`Bundle has expired: ends_at=${s}`,"expired")}let c=vo(n),p=wo(n),h=_o(n),m={id:e,title:r,description:n.get("description")?.value||null,status:l,products:c,discountConfig:p,widgetConfig:h,startsAt:d,endsAt:s,discountLabel:n.get("discount_label")?.value??null,selectedVariantIds:Co(n),productQuantities:Zt(n,"product_quantities"),variantQuantities:Zt(n,"variant_quantities"),marketVisibility:ko(n),marketIds:To(n),countryCodes:St(n,"country_codes"),companyLocationIds:St(n,"company_location_ids"),abTestId:n.get("ab_test_id")?.value||null,abWeight:So(n)};switch(a){case"fixed":return{...m,bundleType:"fixed"};case"volume":return{...m,bundleType:"volume",volumeTiers:Eo(n)};case"mix_match":return{...m,bundleType:"mix_match",minQuantity:Io(n,"min_quantity",{min:1}),maxQuantity:null,productRules:Ve(n,"product_rules"),variantRules:Ve(n,"variant_rules")};case"bogo":return{...m,bundleType:"bogo",...yo(n)};case"multi_step":return{...m,bundleType:"multi_step",steps:go(n),productRules:Ve(n,"product_rules"),variantRules:Ve(n,"variant_rules"),collectionProductIds:xo(n)}}}function go(e){let t=ve(e,"steps");if(!Array.isArray(t))throw new le("Invalid or missing steps","invalid_type");let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string"):[],r=[];for(let o of t){if(!o||typeof o!="object"||Array.isArray(o))continue;let i=o;if(typeof i.name!="string")continue;let a=typeof i.minQuantity=="number"?i.minQuantity:Number(i.minQuantity),l=Number.isFinite(a)&&a>=1?Math.floor(a):1,d=null;typeof i.maxQuantity=="number"&&Number.isFinite(i.maxQuantity)&&(d=Math.max(l,Math.floor(i.maxQuantity))),r.push({name:i.name,minQuantity:l,maxQuantity:d,productIds:n(i.productIds),collectionIds:n(i.collectionIds)})}if(r.length===0)throw new le("multi_step bundle has no valid steps","invalid_type");return r}function xo(e){let t={},n=e.get("collection");if(!n?.references?.nodes)return t;for(let r of n.references.nodes)!("products"in r)||!r.products?.nodes||(t[r.id]=r.products.nodes.map(o=>o.id));return t}function yo(e){let t=ve(e,"bogo_config");if(!t||typeof t!="object"||Array.isArray(t))throw new le("Invalid or missing bogo_config","invalid_type");let n=t,r=typeof n.buyProductId=="string"?n.buyProductId:"",o=typeof n.getProductId=="string"?n.getProductId:"";if(!r||!o)throw new le("bogo_config is missing buy/get product ids","invalid_type");let i=l=>{let d=typeof l=="number"?l:Number(l);return!Number.isFinite(d)||d<1?1:Math.min(99,Math.floor(d))},a=l=>Array.isArray(l)?l.filter(d=>typeof d=="string"):[];return{buyProductId:r,getProductId:o,buyQuantity:i(n.buyQuantity),getQuantity:i(n.getQuantity),buyVariantIds:a(n.buyVariantIds),getVariantIds:a(n.getVariantIds)}}function vo(e){let t=[],n=e.get("products");if(n?.reference&&"variants"in n.reference&&t.push(n.reference),n?.references?.nodes)for(let o of n.references.nodes)"variants"in o?t.push(o):"products"in o&&o.products?.nodes&&t.push(...o.products.nodes);let r=e.get("collection");if(r?.references?.nodes)for(let o of r.references.nodes)"products"in o&&o.products?.nodes&&t.push(...o.products.nodes);return t}function wo(e){return{discountType:e.get("discount_type")?.value??"percentage",discountValue:parseFloat(e.get("discount_value")?.value??"0"),allowStacking:e.get("allow_stacking")?.value==="true"}}function _o(e){return so(ve(e,"widget_config"))}function Co(e){let t=ve(e,"selected_variant_ids");if(!Array.isArray(t))return null;let n=[];for(let r of t)Array.isArray(r)?n.push(r.filter(o=>typeof o=="string")):n.push([]);return n}function Zt(e,t){let n=ve(e,t);if(!n||typeof n!="object"||Array.isArray(n))return{};let r={};for(let[o,i]of Object.entries(n)){let a=typeof i=="number"?i:Number(i);Number.isFinite(a)&&a>=0&&a<=99&&(r[o]=Math.floor(a))}return r}function Ve(e,t){let n=ve(e,t);if(!n||typeof n!="object"||Array.isArray(n))return{};let r={};for(let[o,i]of Object.entries(n)){if(!i||typeof i!="object"||Array.isArray(i))continue;let{min:a,max:l,required:d}=i,s=typeof a=="number"?a:Number(a),u=typeof l=="number"?l:Number(l);if(!Number.isFinite(s)||!Number.isFinite(u))continue;let c=Math.max(1,Math.min(99,Math.floor(s))),p=Math.max(c,Math.min(99,Math.floor(u)));r[o]=d===!0?{min:c,max:p,required:!0}:{min:c,max:p}}return r}function ko(e){return e.get("market_visibility")?.value==="specific"?"specific":"all"}function To(e){return St(e,"markets")}function St(e,t){let n=e.get(t)?.value;if(!n)return[];try{let r=JSON.parse(n);return Array.isArray(r)?r.filter(o=>typeof o=="string"):[]}catch{return[]}}function So(e){let t=e.get("ab_weight")?.value;if(!t)return 0;let n=Number.parseInt(t,10);return Number.isNaN(n)?0:Math.min(100,Math.max(0,n))}function Eo(e){let t=ve(e,"volume_tiers");return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null).map(Ao):[]}function Ao(e){let t=Number(e.minQuantity??0),n={minQuantity:Number.isFinite(t)&&t>=0?t:0};return typeof e.percentage=="number"&&Number.isFinite(e.percentage)&&(n.percentage=e.percentage),typeof e.amount=="number"&&Number.isFinite(e.amount)&&(n.amount=e.amount),n}function ve(e,t){let n=e.get(t)?.value;if(!n)return null;try{return JSON.parse(n)}catch{return null}}function Io(e,t,n={}){let r=e.get(t)?.value;if(!r)return null;let o=parseInt(r,10);return isNaN(o)||n.min!==void 0&&o<n.min?null:o}function Lo(e){let t=typeof e=="string"?parseFloat(e):e;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:1}function It(e,t){let n=Lo(t);if(n===1)return e;let r={...e};return e.discountConfig.discountType!=="percentage"&&(r.discountConfig={...e.discountConfig,discountValue:e.discountConfig.discountValue*n}),"volumeTiers"in e&&Array.isArray(e.volumeTiers)&&(r.volumeTiers=e.volumeTiers.map(o=>typeof o.amount=="number"?{...o,amount:o.amount*n}:o)),r}function xn(e,t){let n=0,r=0;for(let o=0;o<e.length;o++){let i=t==="fixed_amount"?e[o].amount??0:e[o].percentage??0;i>n&&(n=i,r=o)}return r}function yn(e,t,n){return t<=0?0:e==="best_value"?Math.min(n,t-1):Math.max(0,Math.min(Math.floor(typeof e=="number"?e:0),t-1))}function vn(e,t,n){return t?typeof e=="number"&&Number.isFinite(e)?Math.floor(e):n:-1}var Mo="*";function Ue(e){return e.split("/").pop()??e}function en(e,t,n){if(!e||e.length===0)return!1;if(e.includes(Mo))return!0;if(!t)return!1;if(!n)return e.includes(t);let r=Ue(t);return e.some(o=>Ue(o)===r)}function wn(e,t){if(e.marketVisibility!=="specific"||en(e.countryCodes,t.countryCode,!1)||t.companyLocationId&&en(e.companyLocationIds,t.companyLocationId,!0))return!0;if(t.marketId){let n=Ue(t.marketId);if(e.marketIds.some(r=>Ue(r)===n))return!0}return!1}function Po(e,t){return e===t?!0:/^\d+$/.test(t)&&e.endsWith(`/${t}`)}function _n(e,t){let n=t?.productId?.trim();if(n){let o=e.find(i=>Po(i.id,n));if(o)return o}let r=t?.productHandle?.trim();if(r){let o=e.find(i=>i.handle===r);if(o)return o}return e[0]}function Lt(e,t,n){let r=e.variantQuantities[n];return r!==void 0?r:e.productQuantities[t]??1}function Cn(e,t){let n=e.steps[t];if(!n)return[];let r=new Set(n.productIds),o=new Set;for(let l of n.collectionIds)for(let d of e.collectionProductIds[l]??[])o.add(d);let i=new Set,a=[];for(let l of e.products)i.has(l.id)||!r.has(l.id)&&!o.has(l.id)||(i.add(l.id),a.push(l));return a}async function kn(e,t){await En(e,{shopDomain:e.shopDomain,eventType:"bundle_impression",bundleGid:t.bundleGid,bundleType:t.bundleType,productId:t.productId,occurredAt:new Date().toISOString()})}async function Tn(e,t){await En(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function Sn(e,t){if(typeof IntersectionObserver>"u")return t(),()=>{};let n=new IntersectionObserver(r=>{for(let o of r)o.isIntersecting&&(t(),n.unobserve(o.target))},{threshold:.5});return n.observe(e),()=>n.disconnect()}async function En(e,t){let n=`${e.appUrl}/api/analytics`,r=JSON.stringify(t);try{(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:r})).ok||(await new Promise(i=>setTimeout(i,2e3)),await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:r}))}catch{try{typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(n,r)}catch{}}}var tn=1e4,Bo=[[/@import/i,"@import rules"],[/@charset/i,"@charset declarations"],[/expression\s*\(/i,"CSS expressions"],[/-moz-binding/i,"-moz-binding"],[/-webkit-binding/i,"-webkit-binding"],[/behavior\s*:/i,"behavior property"]],qo=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function Mt(e){if(e.length>tn)return{ok:!1,error:`CSS exceeds ${tn.toLocaleString("en-US")} character limit`};let t=e.replace(/\/\*[\s\S]*?\*\//g,"");try{t=t.replace(/\\([0-9a-fA-F]{1,6})[ \t\n\f]?/g,(o,i)=>{let a=parseInt(i,16);return a<0||a>1114111?"\uFFFD":String.fromCodePoint(a)}),t=t.replace(/\\\r?\n/g,""),t=t.replace(/\\([^\n\r\f0-9a-fA-F])/g,"$1")}catch{return{ok:!1,error:"CSS contains invalid unicode escape sequences"}}t=t.replace(/</g,"").replace(/>/g,"");for(let[o,i]of Bo)if(o.test(t))return{ok:!1,error:`CSS contains blocked pattern: ${i}`};let n=/url\s*\(\s*([\s\S]*?)\s*\)/gi,r;for(;(r=n.exec(t))!==null;){let o=r[1].trim();if((o.startsWith("'")||o.startsWith('"'))&&(o=o.slice(1)),(o.endsWith("'")||o.endsWith('"'))&&(o=o.slice(0,-1)),o=o.trim(),o&&!qo.test(o))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Ro="lb-custom-css-";function An(e,t){if(typeof document>"u"||!t)return!1;let n=Mt(t);if(!n.ok||!n.css.trim())return!1;let r=Ro+No(e),o=document.getElementById(r);return o||(o=document.createElement("style"),o.id=r,o.setAttribute("data-lime-bundles","custom-css"),document.head.appendChild(o)),o.textContent!==n.css&&(o.textContent=n.css),!0}function No(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function Ho(e,t){let n=typeof e=="string"?parseFloat(e):e;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(n)}catch{return`${t} ${n.toFixed(2)}`}}var Do={CL:"cl",CM:"cm",FLOZ:"fl oz",FT:"ft",FT2:"ft\xB2",G:"g",GAL:"gal",IN:"in",ITEM:"each",KG:"kg",L:"l",LB:"lb",M:"m",M2:"m\xB2",M3:"m\xB3",MG:"mg",ML:"ml",MM:"mm",OZ:"oz",PT:"pt",QT:"qt",UNKNOWN:"",YD:"yd"};function In(e,t,n){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let r=parseFloat(e.amount);if(!Number.isFinite(r))return null;let o=Do[t.referenceUnit]??"";if(!o)return null;let i=e.currencyCode||n||"USD",a=Ho(r,i),l=t.referenceValue,d=l===1?o:`${l}${o}`;return`${a}/${d}`}function Oo(e,t){return Math.max(0,e-Math.floor(e*t/100))}function ze(e,t){if(t.discountType==="percentage"){let r=0;for(let o of e)r+=Oo(o.unitCents,t.discountValue)*o.quantity;return Math.max(0,r)}let n=0;for(let r of e)n+=r.unitCents*r.quantity;if(t.discountType==="flat_price"){let r=Math.round(t.discountValue*100);return Math.max(0,Math.min(r,n))}return Math.max(0,n-Math.round(t.discountValue*100))}var we={};ln(we,{computePosition:()=>Fo,emptyTypeAheadState:()=>jo,firstEnabled:()=>Fe,handleKey:()=>Qo,pushTypeAheadChar:()=>Go});var Vo=4;function Fo({trigger:e,viewportHeight:t,desiredHeight:n,margin:r=Vo,clip:o}){let i=o?Math.min(t,o.bottom):t,a=o?Math.max(0,o.top):0,l=Math.max(0,i-e.bottom-r),d=Math.max(0,e.top-a-r),s=n<=l?"down":d>l?"up":"down",c=Math.min(n,s==="down"?l:d),p=s==="down"?e.bottom+r:e.top-r-c;return{placement:s,maxHeight:c,offsetTop:p,offsetLeft:e.left,width:e.width}}var kt={type:"passthrough",preventDefault:!1};function Fe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function nn(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Uo(e,t){if(e.length===0)return-1;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r].disabled)return r}return t}function zo(e,t){if(e.length===0)return-1;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r].disabled)return r}return t}function rn(e){return e.length===1&&e!==" "&&/\S/.test(e)}function Qo(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return kt;let{key:n}=e,{isOpen:r,activeIndex:o,selectedIndex:i,options:a}=t;if(!r)switch(n){case"Enter":case" ":case"ArrowDown":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Fe(a),preventDefault:!0};case"ArrowUp":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:nn(a),preventDefault:!0};default:return rn(n)?{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Fe(a),preventDefault:!0}:kt}switch(n){case"ArrowDown":return{type:"move-active",activeIndex:Uo(a,o),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:zo(a,o),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:Fe(a),preventDefault:!0};case"End":return{type:"move-active",activeIndex:nn(a),preventDefault:!0};case"Enter":case" ":return o>=0&&!a[o]?.disabled?{type:"commit",index:o,preventDefault:!0}:{type:"passthrough",preventDefault:!0};case"Escape":return{type:"close",commit:!1,restoreFocus:!0,preventDefault:!0};case"Tab":return{type:"close",commit:!1,restoreFocus:!1,preventDefault:!1};default:return rn(n)?{type:"type-ahead",char:n,preventDefault:!1}:kt}}var Wo=500;function jo(){return{buffer:"",lastTime:0}}function Go(e,t,n,r,o=Wo){if(t.length!==1)return{newState:e,matchedIndex:null};let a=(n-e.lastTime>o?"":e.buffer)+t.toLowerCase(),l={buffer:a,lastTime:n};for(let d=0;d<r.length;d++){let s=r[d];if(!s.disabled&&s.label.toLowerCase().startsWith(a))return{newState:l,matchedIndex:d}}return{newState:l,matchedIndex:null}}var $o={};ln($o,{findVariantByOptions:()=>Ko,isOptionValueAvailable:()=>Yo,toPickerVariant:()=>Jo});function Ln(e){return e.availableForSale&&!e.currentlyNotInStock&&e.quantityAvailable!=null&&e.quantityAvailable<=0}function Ae(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null||Ln(e)?!0:e.quantityAvailable>=t:!1}function Qe(e){return e.currentlyNotInStock||e.quantityAvailable==null||Ln(e)?null:Math.max(0,e.quantityAvailable)}function Ko(e,t){if(e.length===0)return null;for(let n of e){if(n.optionValues.length!==t.length)continue;let r=!0;for(let o=0;o<n.optionValues.length;o++)if(n.optionValues[o]!==t[o]){r=!1;break}if(r)return n}return null}function Yo(e,t,n,r){for(let o of e){if(!o.available||o.optionValues[t]!==n)continue;let i=!0;for(let a=0;a<o.optionValues.length;a++)if(a!==t&&o.optionValues[a]!==r[a]){i=!1;break}if(i)return!0}return!1}function Jo(e,t){return{id:e.id,optionValues:e.selectedOptions.map(n=>n.value),available:t!==void 0?Ae(e,t):e.availableForSale}}var on="_lb_v",Tt=null;function Xo(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t>>>=0;return t>>>0}function Mn(){try{let e=window.localStorage.getItem(on);if(e)return e;let t=an();return window.localStorage.setItem(on,t),t}catch{return Tt||(Tt=an()),Tt}}function an(){return Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,10)}function Zo(e,t,n){let r=e.slice().sort((a,l)=>a.id<l.id?-1:a.id>l.id?1:0),o=Xo(t+":"+n)%100,i=0;for(let a of r)if(i+=Math.max(0,a.abWeight),o<i)return a;return r[r.length-1]}function Pn(e,t){let n=new Map;for(let o of e){if(!o.abTestId)continue;let i=n.get(o.abTestId);i?i.push(o):n.set(o.abTestId,[o])}if(n.size===0)return e.slice();let r=new Map;return n.forEach((o,i)=>{if(o.length===1){r.set(i,o[0]);return}r.set(i,Zo(o,t,i))}),e.filter(o=>!o.abTestId||r.get(o.abTestId)===o)}function se(e){return t=>{try{return new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(t/100)}catch{return e+" "+(t/100).toFixed(2)}}}var We="_lime_bundle_gid",ei="_lime_bundle_type",Bn="_lime_bundle_role",qn="get";function de(e,t){return[{key:We,value:e},{key:ei,value:t}]}var ti=["MERCHANDISE_NOT_ENOUGH_STOCK","MERCHANDISE_OUT_OF_STOCK"];function Rn(e){return!!e.code&&ti.indexOf(e.code)!==-1}function Nn(e){let t=e||[];for(let n=0;n<t.length;n++)if(Rn(t[n]))return!0;return!1}function Hn(e){let t=e||[];for(let n=0;n<t.length;n++){let r=t[n];if(Rn(r)&&r.message)return r.message}}function Pt(e){let t=Object.create(null);for(let n=0;n<e.length;n++){let r=e[n];t[r.variantId]=(t[r.variantId]||0)+(r.quantity||0)}return t}function Dn(e,t,n){let r=Pt(e),o=Pt(t),i=Pt(n);for(let a in r)if((i[a]||0)-(o[a]||0)<r[a])return!0;return!1}var ae={locale:"en",addItem:"Add",addedItem:"Added",removeItem:"Remove",swapItem:"Swap",required:"Required",soldOut:"Sold out",outOfStock:"Out of stock",itemsOutOfStock:{one:"__COUNT__ item out of stock",other:"__COUNT__ items out of stock"},cartStockError:"We couldn't add this bundle to your cart. __MESSAGE__",quantity:"Quantity",increaseQuantity:"Increase quantity",decreaseQuantity:"Decrease quantity",allTypes:"All",editSelection:"Edit selection",addToCart:"Add to cart",bundlePrice:"Bundle total",save:"Save",complete:"Complete",ofSelected:"__COUNT__ of __TOTAL__ added",moreToGo:"__COUNT__ more to go",nProductsShown:"__COUNT__ products shown",bundleComplete:"Your bundle is complete",chooseMoreUnlock:"Choose __COUNT__ more to unlock __PCT__% off",chooseMoreComplete:"Choose __COUNT__ more to complete your bundle",stepOf:"Step __STEP__ of __TOTAL__",stepsCompleted:"__COUNT__ of __TOTAL__ steps completed",doorChoose:"Choose your products",doorContinue:"Continue building",doorQuickSteps:{one:"__COUNT__ quick step",other:"__COUNT__ quick steps"},doorStepsToGo:{one:"__COUNT__ step to go",other:"__COUNT__ steps to go"},each:" each",buyQty:"Buy __COUNT__",itemCount:{one:"__COUNT__ item",other:"__COUNT__ items"},needsSpots:{one:"Needs __COUNT__ spot",other:"Needs __COUNT__ spots"}};function je(e,t){let n=e.itemsOutOfStock,r;if(n&&typeof n=="object"){let o=new Intl.PluralRules(e.locale||"en").select(t);r=n[o]||n.other}else r=n;return(r||"__COUNT__ items out of stock").split("__COUNT__").join(String(t))}var ni="We couldn't add this bundle to your cart. __MESSAGE__";function On(e,t){let n=(e||"").trim()||ni,r=(t||"").trim();return(n.indexOf("__MESSAGE__")===-1?n+" "+r:n.split("__MESSAGE__").join(r)).replace(/\s+/g," ").trim()}function Vn(e){let t=e.slice(e.lastIndexOf("/")+1),n=Number(t);return Number.isFinite(n)&&t!==""?n:e}function Ge(e){if(!e)return 0;let t=parseFloat(e);return Number.isFinite(t)?Math.round(t*100):0}function ri(e){let t=e?.width,n=e?.height;return typeof t!="number"||typeof n!="number"||t<=0||n<=0?null:t/n}function oi(e,t,n){return{id:Vn(e.id),title:e.title,options:(e.selectedOptions??[]).map(r=>r.value),available:Ae(e,t),price:Ge(e.price?.amount),compareAtPrice:Ge(e.compareAtPrice?.amount),unitPrice:In(e.unitPrice,e.unitPriceMeasurement,n),image:e.image?.url??null,inventoryQuantity:Qe(e)}}function Ce(e,t,n){let r=n.allowedVariantIds,o=e.variants.nodes.filter(s=>!r||r.length===0||r.includes(s.id)),i=e.priceRange.minVariantPrice.currencyCode,a=Lt(n.quantities,e.id,o[0]?.id??""),l=o.map(s=>{let u=Lt(n.quantities,e.id,s.id),c=oi(s,u,i);return u!==a&&(c.quantity=u),c}),d=l.find(s=>s.available)??l[0];return{productId:Vn(e.id),title:e.title,url:e.handle?"/products/"+e.handle:null,featuredImage:e.featuredImage?.url??null,featuredImageRatio:ri(e.featuredImage),quantity:a,selectedVariantId:d?d.id:"",optionNames:(o[0]?.selectedOptions??[]).map(s=>s.name),variants:l}}function $e(e){return e.products.map((t,n)=>Ce(t,e.id,{quantities:{productQuantities:e.productQuantities,variantQuantities:e.variantQuantities},allowedVariantIds:e.selectedVariantIds?.[n]??null}))}function ee(e,t){for(let n=0;n<e.variants.length;n++)if(String(e.variants[n].id)===String(t))return e.variants[n];return e.variants[0]}function Fn(e){let t=ee(e,e.selectedVariantId);if(t&&t.available!==!1)return t;for(let n=0;n<e.variants.length;n++)if(e.variants[n].available!==!1)return e.variants[n];return null}function Un(e,t){if(!e.variants||!t)return null;for(let n=0;n<e.variants.length;n++){let r=e.variants[n];if(!r.options||r.options.length!==t.length)continue;let o=!0;for(let i=0;i<r.options.length;i++)if(r.options[i]!==t[i]){o=!1;break}if(o)return r}return null}function zn(e,t,n,r){for(let o=0;o<e.length;o++){let i=e[o];if(i.available===!1||!i.options||i.options[t]!==n)continue;let a=!0;for(let l=0;l<i.options.length;l++)if(l!==t&&i.options[l]!==r[l]){a=!1;break}if(a)return!0}return!1}function Qn(e){let t=[];for(let n=0;n<e.length;n++){let r=ee(e[n],e[n].selectedVariantId),o=r.quantity||e[n].quantity||1;t.push({variantId:Number(e[n].selectedVariantId),quantity:o,priceCents:(r.price||0)*o})}return t}function ii(e,t,n){let r=0,o=0;for(let i=0;i<e.length;i++){let a=ee(e[i],e[i].selectedVariantId),l=a.quantity||e[i].quantity||1,d=a.price*l;if(r+=d,t==="percentage"){let s=Math.floor(a.price*n/100);o+=(a.price-s)*l}else o+=d}if(t==="fixed_amount"&&(o=Math.max(0,r-Math.round(n*100))),t==="flat_price"){let i=Math.round(n*100);o=i<r?i:r}return{totalPrice:r,salePrice:o,savings:r-o}}function Bt(e,t,n){let r=e.classList?.contains("lb-fixed")?e:e.querySelector(".lb-fixed");if(!r)return;let{totalPrice:o,salePrice:i,savings:a}=ii(t,r.getAttribute("data-discount-type")||"",parseFloat(r.getAttribute("data-discount-value")??"")||0),l=e.querySelector("[data-sale-price]"),d=e.querySelector("[data-compare-price]"),s=e.querySelector("[data-savings-bar]"),u=e.querySelector("[data-savings-amount]"),c=e.querySelector("[data-savings-percent]");if(l&&(l.textContent=n(i)),d&&(a>0?(d.textContent=n(o),d.style.display=""):d.style.display="none"),s)if(a>0){if(u&&(u.textContent=n(a)),c){let p=o>0?Math.round(a*100/o):0;c.textContent="("+p+"%)"}s.style.display="",s.classList.remove("lb-savings-pending")}else s.style.display="none"}function Ke(e,t,n){let r=e.querySelectorAll("[data-variant-option]");if(!r.length)return;function o(s){return parseInt(s.getAttribute("data-option-position")??"",10)}function i(){let s=[];for(let u=0;u<r.length;u++){let c=o(r[u]);!c||c<1||(s[c-1]=r[u].value)}return s}function a(s){if(!(!s||!s.options))for(let u=0;u<r.length;u++){let c=o(r[u]);if(!c||c<1)continue;let p=s.options[c-1];r[u].value!==p&&(r[u].value=p)}}function l(s,u){for(let c=0;c<r.length;c++){let p=r[c],h=o(p);if(!h||h<1)continue;let m=p.options;for(let k=0;k<m.length;k++)m[k].disabled=!zn(s.variants,h-1,m[k].value,u)}}let d=t();if(d){let s=ee(d,d.selectedVariantId);s&&s.options&&l(d,s.options)}for(let s=0;s<r.length;s++)r[s].addEventListener("change",u=>{u.stopPropagation();let c=t();if(!c)return;let p=Un(c,i());if(!p){let h=ee(c,c.selectedVariantId);a(h),h&&h.options&&l(c,h.options);return}c.selectedVariantId=p.id,l(c,p.options),n(p,c)})}function Ye(e,t,n){if(!t.variants.length)return;let r=e.querySelector(".lb-bundle-variant-badge");r&&!r.textContent&&(r.textContent=n.title);let o=e.querySelector(".lb-bundle-variant-option-groups");o&&!o.children.length&&ai(o,t,n)}function ai(e,t,n){let r=t.optionNames||[];for(let o=0;o<r.length;o++){let i=document.createElement("div");i.className="lb-bundle-variant-option-group";let a=document.createElement("span");a.className="lb-bundle-variant-option-label",a.textContent=r[o],i.appendChild(a);let l=document.createElement("select");l.className="lb-bundle-variant-select",l.setAttribute("data-variant-option",""),l.setAttribute("data-option-position",String(o+1)),l.setAttribute("data-product-id",String(t.productId)),l.name="lb-variant-"+t.productId+"-"+(o+1),l.setAttribute("aria-label",r[o]);let d=Object.create(null);for(let s of t.variants){let u=s.options&&s.options[o];if(!u||d[u])continue;d[u]=!0;let c=document.createElement("option");c.value=u,c.textContent=u,n.options&&n.options[o]===u&&(c.selected=!0),l.appendChild(c)}i.appendChild(l),e.appendChild(i)}}var Je="http://www.w3.org/2000/svg",qt="data-lb-placeholder",Wn="lb-thumb--placeholder";function li(){let e=document.createElementNS(Je,"svg");e.setAttribute("class","lb-bundle-placeholder-icon"),e.setAttribute("viewBox","0 0 48 48");let t=document.createElementNS(Je,"rect");t.setAttribute("x","15"),t.setAttribute("y","15"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("rx","2"),e.appendChild(t);let n=document.createElementNS(Je,"circle");n.setAttribute("cx","20.5"),n.setAttribute("cy","20.5"),n.setAttribute("r","1.5"),e.appendChild(n);let r=document.createElementNS(Je,"path");return r.setAttribute("d","M33 27l-5-5L17 33"),e.appendChild(r),e}var si=li;function di(){let e=si(),t=e.nodeType===1?e:null;return t&&(t.setAttribute(qt,""),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false")),e}function ke(e){let t=e.querySelector("img");t&&t.remove(),e.classList.add(Wn),!e.querySelector("["+qt+"]")&&e.appendChild(di())}function Xe(e){let t=e.querySelector("["+qt+"]");t&&t.remove(),e.classList.remove(Wn)}var Rt=new WeakMap;function Ie(e,t,n){let r=e.querySelector("[data-thumbnail]");if(!r)return;let o=r.querySelector("img");if(!Rt.has(e)){let a=n||(o?o.src:null);a&&Rt.set(e,a)}let i=t&&t.image||Rt.get(e)||null;if(!i){ke(r);return}if(Xe(r),o)o.src=i,o.srcset="";else{let a=document.createElement("img");a.src=i,a.loading="lazy",a.alt="",r.textContent="",r.appendChild(a)}}function ci(e,t){let n=e.querySelector("[data-qty-inline]");n&&(n.textContent="\xD7"+t)}function Nt(e,t,n,r){if(!t){Ie(e,null,n.featuredImage);return}Ie(e,t,n.featuredImage),ci(e,t.quantity||n.quantity||1);let o=e.querySelector("[data-product-price]");o&&t.price!=null&&(o.textContent=r(t.price));let i=e.querySelector("[data-product-compare-price]");if(i){let l=t.compareAtPrice;l&&l>t.price?(i.textContent=r(l),i.hidden=!1):(i.textContent="",i.hidden=!0)}let a=e.querySelector("[data-product-unit-price]");a&&(t.unitPrice?(a.textContent=t.unitPrice,a.hidden=!1):(a.textContent="",a.hidden=!0))}function P(e,t,n){let r=document.createElement(e);r.className=t;for(let o in n)r.setAttribute(o,n[o]);return r}function Ze(e,t,n){let r=e.variants.length,o=P("div","lb-bundle-product-row");n.isOos&&(o.classList.add("lb-bundle-product-row--oos"),o.setAttribute("aria-disabled","true")),o.setAttribute("data-product-id",String(e.productId)),n.bogoRole&&o.setAttribute("data-bogo-role",n.bogoRole);let i=P("div","lb-bundle-thumbnail",{"data-thumbnail":""}),a=e.featuredImageRatio;n.thumbnailRatio==="original"&&i.style.setProperty("--lb-row-thumb-ratio",String(a!=null&&a>0?a:1)),o.appendChild(i);let l=P("div","lb-bundle-product-info"),d=document.createElement(n.href?"a":"span");if(d.className="lb-bundle-product-name",n.href&&(d.href=n.href),d.textContent=e.title??"",l.appendChild(d),n.isOos){let u=P("span","lb-bundle-oos-label");return u.textContent=t.outOfStock||"Out of stock",l.appendChild(u),o.appendChild(l),o}r===1&&e.variants[0]?.title!=="Default Title"&&l.appendChild(P("span","lb-bundle-variant-badge"));let s=P("span","lb-bundle-product-prices");if(s.appendChild(P("span","lb-bundle-product-compare-price",{"data-product-compare-price":"",hidden:""})),s.appendChild(P("span","lb-bundle-product-price",{"data-product-price":""})),n.inlineQuantity!=null){let u=P("span","lb-bundle-qty-inline",{"data-qty-inline":""});u.textContent="\xD7"+n.inlineQuantity,s.appendChild(u)}if(l.appendChild(s),l.appendChild(P("span","lb-bundle-product-unit-price",{"data-product-unit-price":""})),r>1&&l.appendChild(P("div","lb-bundle-variant-option-groups",{style:"--lb-row-option-count: "+(e.optionNames.length||1)})),o.appendChild(l),n.inlineQuantity==null&&o.appendChild(P("span","lb-bundle-qty-chip",{"data-qty-inline":""})),n.badgeText){let u=P("span","lb-bogo__badge");u.textContent=n.badgeText,o.appendChild(u)}return o}function ce(e,t){let n=P("div",e),r=P("div","lb-bundle-header"),o=P("h3","lb-bundle-title");if(o.textContent=t.title,r.appendChild(o),t.subtitle){let p=P("p","lb-bundle-subtitle");p.textContent=t.subtitle,r.appendChild(p)}if(n.appendChild(r),t.endsAt){let p=P("div","lb-bundle-countdown",{"data-countdown":""}),h=P("div","lb-bundle-countdown__label"),m=document.createElement("span");m.textContent=t.countdownLabel??"Limited time offer",h.appendChild(m),p.appendChild(h),p.appendChild(P("span","lb-bundle-countdown__timer",{"data-countdown-timer":""})),n.appendChild(p)}let i=P("div",e+"__products lb-edge-fade");n.appendChild(i),n.appendChild(P("div","lb-bundle-divider"));let a=P("div","lb-bundle-summary",{"data-pricing-section":""}),l=P("div","lb-bundle-summary__text"),d=P("span","lb-bundle-summary__label");if(d.textContent=t.summaryLabel??"Bundle total",l.appendChild(d),t.withItemCount&&d.appendChild(P("span","",{"data-item-count":""})),t.showSavingsBar){let p=P("p","lb-bundle-savings-line",{"data-savings-bar":"",style:"display:none"});p.appendChild(document.createTextNode("Save ")),p.appendChild(P("span","",{"data-savings-amount":""})),p.appendChild(document.createTextNode(" ")),p.appendChild(P("span","",{"data-savings-percent":""})),l.appendChild(p)}a.appendChild(l);let s=P("span","lb-bundle-summary__prices");t.showComparePrice&&s.appendChild(P("span","lb-bundle-compare-price",{"data-compare-price":""})),s.appendChild(P("span","lb-bundle-sale-price",{[t.totalPriceSlot?"data-total-price":"data-sale-price"]:""})),a.appendChild(s),n.appendChild(a);let u=P("button","lb-bundle-cta",{"data-cta-text":t.ctaText,type:"button","data-add-bundle":""}),c=P("span","lb-cta-label",{"data-cta-label":""});return c.textContent=t.ctaText,u.appendChild(c),n.appendChild(u),n.appendChild(P("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),n.appendChild(P("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),{root:n,products:i,cta:u}}function jn(e,t,n={}){let r=n.showCompare!==!1,o=n.showPriceEach!==!1,i=P("div","lb-volume__tiers lb-edge-fade",{role:"radiogroup","aria-label":t,"data-tier-group":""});return e.forEach((a,l)=>{let d=P("div","lb-volume__tier",{role:"radio","aria-checked":a.selected?"true":"false",tabindex:a.selected?"0":"-1","data-tier-index":String(l),"data-tier-qty":String(a.quantity),"data-tier-pct":String(a.percent),"data-tier-amt":String(a.amountCents)}),s=P("span","lb-volume__radio");s.appendChild(P("span","lb-volume__radio-dot")),d.appendChild(s);let u=P("span","lb-volume__tier-info"),c=P("span","lb-volume__tier-label");c.textContent=a.label,u.appendChild(c);let p=P("span","lb-volume__tier-price");if(r&&(a.percent>0||a.amountCents>0)&&p.appendChild(P("span","lb-volume__tier-compare")),o&&(p.appendChild(P("span","",{"data-tier-price-each":""})),n.unitLabel)){let h=P("span","lb-volume__tier-unit");h.textContent=n.unitLabel,p.appendChild(h)}if(u.appendChild(p),d.appendChild(u),a.badgeLabel||a.savingsLabel){let h=P("span","lb-volume__tier-right");if(a.badgeLabel){let m=P("span","lb-volume__tier-badge");m.textContent=a.badgeLabel,h.appendChild(m)}if(a.savingsLabel){let m=P("span","lb-volume__tier-savings");m.textContent=a.savingsLabel,h.appendChild(m)}d.appendChild(h)}i.appendChild(d)}),i}function et(e){let t=P("div","lb-mix-match__progress",{"data-progress":""}),n=P("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)});for(let o=0;o<e;o++)n.appendChild(P("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));t.appendChild(n);let r=P("div","lb-mix-match__progress-labels");return r.appendChild(P("span","lb-mix-match__progress-count",{"data-progress-count":"","aria-live":"polite"})),r.appendChild(P("span","lb-mix-match__progress-remaining",{"data-progress-remaining":"","aria-live":"polite"})),t.appendChild(r),t}function Te(e){return e<10?"0"+e:String(e)}function ue(e){e._lbCountdownInterval&&(clearInterval(e._lbCountdownInterval),e._lbCountdownInterval=null);let t=e.querySelector("[data-countdown]");if(!t)return;let n=e.closest(".lb-bundle-widget"),r=n&&n.getAttribute("data-ends-at");if(!r){t.style.display="none";return}let o=new Date(r).getTime();if(isNaN(o)){t.style.display="none";return}let i=t.querySelector("[data-countdown-timer]");if(!i)return;let a;function l(){let d=o-Date.now();if(d<=0){n&&(n.style.display="none"),a&&clearInterval(a);return}let s=Math.floor(d/864e5),u=Math.floor(d%864e5/36e5),c=Math.floor(d%36e5/6e4),p=Math.floor(d%6e4/1e3);i.textContent=s>0?s+"d "+Te(u)+"h "+Te(c)+"m "+Te(p)+"s":Te(u)+"h "+Te(c)+"m "+Te(p)+"s"}l(),o-Date.now()>0&&(a=setInterval(l,1e3),e._lbCountdownInterval=a)}function Gn(e){let t=e.ownerDocument,n=t&&t.defaultView;if(!n)return null;let r=e.parentElement;for(;r&&r!==t.body;){let o=n.getComputedStyle(r).overflowY;if(o==="auto"||o==="scroll"||o==="hidden")return r;r=r.parentElement}return null}var re=[],tt=!1;function ui(e,t){if(e.composedPath){let r=e.composedPath();for(let o=0;o<r.length;o++)if(r[o]===t.shell||r[o]===t.listbox)return!0;return!1}let n=e.target;return t.shell.contains(n)||t.listbox.contains(n)}function nt(e){for(let t=re.length-1;t>=0;t--)ui(e,re[t])||re[t].close()}function $n(){for(let e=re.length-1;e>=0;e--)re[e].close()}function pi(){tt||(document.addEventListener("pointerdown",nt,!0),window.addEventListener("resize",$n),window.addEventListener("scroll",nt,!0),tt=!0)}function mi(){tt&&(document.removeEventListener("pointerdown",nt,!0),window.removeEventListener("resize",$n),window.removeEventListener("scroll",nt,!0),tt=!1)}function Kn(e){re.push(e),re.length===1&&pi()}function Yn(e){let t=re.indexOf(e);t>=0&&re.splice(t,1),re.length===0&&mi()}function Jn(e){for(let t=re.length-1;t>=0;t--)re[t]!==e&&re[t].close()}var bi=32,hi=8,fi=8,Ht=new WeakMap;function Xn(e){return Ht.get(e)}function Zn(e){if(e.classList.contains("lb-dropdown-state"))return null;let t=document,n=e.getAttribute("aria-label")||"",r="lb-dd-"+Math.random().toString(36).slice(2,9);e.classList.add("lb-dropdown-state"),e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1");let o=t.createElement("div");o.className="lb-dropdown",o.setAttribute("data-lb-dropdown","");let i=t.createElement("button");i.type="button",i.className="lb-dropdown-trigger",i.setAttribute("role","combobox"),i.setAttribute("aria-haspopup","listbox"),i.setAttribute("aria-expanded","false");let a=r+"-listbox";i.setAttribute("aria-controls",a),n&&i.setAttribute("aria-label",n);let l=t.createElement("span");l.className="lb-dropdown-trigger-value";let d=t.createElement("span");d.className="lb-dropdown-chevron",d.setAttribute("aria-hidden","true"),i.appendChild(l),i.appendChild(d);let s=t.createElement("ul");s.id=a,s.className="lb-dropdown-listbox",s.setAttribute("role","listbox"),n&&s.setAttribute("aria-label",n),s.hidden=!0,o.appendChild(i),e.parentNode?.insertBefore(o,e.nextSibling);let u=e.closest("[data-modal-overlay]");u?(u.appendChild(s),s.setAttribute("data-lb-dropdown-portal","")):o.appendChild(s);let c=!1,p=-1,h=we.emptyTypeAheadState(),m=[];function k(){let A=[];for(let E=0;E<e.options.length;E++){let f=e.options[E];A.push({disabled:f.disabled,label:f.textContent||f.value})}return A}function B(){i.disabled=e.disabled;let A=k(),E=e.selectedIndex;for(l.textContent=E>=0&&A[E]?A[E].label:"";s.firstChild;)s.removeChild(s.firstChild);m=[];for(let f=0;f<A.length;f++){let I=t.createElement("li");I.id=r+"-opt-"+f,I.className="lb-dropdown-option",I.setAttribute("role","option"),I.setAttribute("aria-selected",f===E?"true":"false"),A[f].disabled&&I.setAttribute("aria-disabled","true"),I.setAttribute("data-value",e.options[f].value),I.setAttribute("data-index",String(f)),I.textContent=A[f].label,s.appendChild(I),m.push(I)}}function y(A){if(p>=0&&m[p]&&m[p].classList.remove("is-active"),p=A,A<0||!m[A]){i.setAttribute("aria-activedescendant","");return}let E=m[A];E.classList.add("is-active"),i.setAttribute("aria-activedescendant",E.id);let f=E.offsetTop,I=f+E.offsetHeight,U=s.scrollTop,g=U+s.clientHeight;f<U?s.scrollTop=f:I>g&&(s.scrollTop=I-s.clientHeight)}function S(){let A=i.getBoundingClientRect();if(A.width===0)return!1;let f=Math.min(m.length||1,fi)*bi+hi,I=Gn(i),U=I?{top:I.getBoundingClientRect().top,bottom:I.getBoundingClientRect().bottom}:void 0,g=we.computePosition({trigger:{top:A.top,bottom:A.bottom,left:A.left,width:A.width},viewportHeight:window.innerHeight,desiredHeight:f,clip:U});return s.setAttribute("data-placement",g.placement),s.style.maxHeight=g.maxHeight+"px",s.hasAttribute("data-lb-dropdown-portal")&&(s.style.top=g.offsetTop+"px",s.style.left=g.offsetLeft+"px",s.style.width=g.width+"px"),!0}function N(){if(c)return;Jn(W),c=!0,s.hidden=!1,i.setAttribute("aria-expanded","true"),S()||requestAnimationFrame(()=>{S()});let A=k(),E=e.selectedIndex;E>=0&&A[E]&&!A[E].disabled?y(E):y(we.firstEnabled(A)),Kn(W)}function L(A){c&&(c=!1,s.hidden=!0,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-activedescendant",""),p>=0&&m[p]&&m[p].classList.remove("is-active"),p=-1,Yn(W),A&&i.focus())}function V(A){let E=e.options[A];!E||E.disabled||(e.value!==E.value&&(e.value=E.value,e.dispatchEvent(new Event("change",{bubbles:!0}))),B(),L(!0))}function _(A){let E=k(),f=we.handleKey({key:A.key,ctrlKey:A.ctrlKey,metaKey:A.metaKey,altKey:A.altKey,shiftKey:A.shiftKey},{isOpen:c,activeIndex:p,selectedIndex:e.selectedIndex,options:E});switch(f.preventDefault&&A.preventDefault(),f.type){case"open":N(),f.activeIndex>=0&&y(f.activeIndex);break;case"close":L(f.restoreFocus);break;case"move-active":y(f.activeIndex);break;case"commit":V(f.index);break;case"type-ahead":{let I=we.pushTypeAheadChar(h,f.char,Date.now(),E);h=I.newState,I.matchedIndex!==null&&(c||N(),y(I.matchedIndex));break}}}function w(A){A.preventDefault(),c?L(!1):N()}function b(A){let E=A.target;for(;E&&E!==s;){if(E.classList&&E.classList.contains("lb-dropdown-option")){let f=parseInt(E.getAttribute("data-index")??"",10);return isNaN(f)?null:f}E=E.parentNode}return null}function D(A){let E=b(A);E!==null&&V(E)}function H(A){let E=A.target;for(;E&&E!==s;){if(E.classList&&E.classList.contains("lb-dropdown-option")){if(E.getAttribute("aria-disabled")==="true")return;let f=parseInt(E.getAttribute("data-index")??"",10);!isNaN(f)&&f!==p&&y(f);return}E=E.parentNode}}function R(){setTimeout(()=>{c&&(o.contains(document.activeElement)||L(!1))},0)}function q(){B()}let $=new MutationObserver(()=>{B()});$.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});function G(A){A.preventDefault()}i.addEventListener("click",w),i.addEventListener("keydown",_),o.addEventListener("focusout",R),s.addEventListener("mousedown",G),s.addEventListener("click",D),s.addEventListener("mousemove",H),e.addEventListener("change",q);function J(){c&&L(!1),$.disconnect(),i.removeEventListener("click",w),i.removeEventListener("keydown",_),o.removeEventListener("focusout",R),s.removeEventListener("mousedown",G),s.removeEventListener("click",D),s.removeEventListener("mousemove",H),e.removeEventListener("change",q),o.parentNode?.removeChild(o),s.parentNode?.removeChild(s),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),Ht.delete(e)}let W={shell:o,listbox:s,select:e,close:()=>L(!1),destroy:J};return Ht.set(e,W),B(),W}var gi="select.lb-bundle-variant-select:not(.lb-dropdown-state), select.lb-mix-match__variant-select:not(.lb-dropdown-state)";function er(e){let n=(e??document).querySelectorAll(gi);for(let r=0;r<n.length;r++)Zn(n[r])}function tr(e){let n=(e??document).querySelectorAll("select.lb-dropdown-state");for(let r=0;r<n.length;r++)Xn(n[r])?.destroy()}function fe(e){return er(e),()=>tr(e)}function nr(e,t,n,r){let o=t.widgetConfig,i=$e(t);if(!i.length)return;let a=i.filter(c=>!c.variants.some(p=>p.available)),l=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",d=se(l),s=ae,u=ce("lb-fixed",{title:t.title,subtitle:t.description,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||s.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt});u.root.setAttribute("data-discount-type",t.discountConfig.discountType),u.root.setAttribute("data-discount-value",String(t.discountConfig.discountValue));for(let c of i){let p=!c.variants.some(B=>B.available),h=Ze(c,s,{isOos:p,href:c.url,thumbnailRatio:o.productList?.thumbnailRatio});if(u.products.appendChild(h),p)continue;let m=Fn(c);m&&(c.selectedVariantId=m.id);let k=m??ee(c,c.selectedVariantId);Ye(h,c,k),Nt(h,k,c,d),Ke(h,()=>c,(B,y)=>{Nt(h,B,y,d),Bt(u.root,i,d)})}if(a.length>0){u.cta.disabled=!0;let c=u.cta.querySelector("[data-cta-label]");c&&(c.textContent=je(s,a.length))}else u.cta.addEventListener("click",()=>{n(Qn(i).map(c=>({merchandiseId:"gid://shopify/ProductVariant/"+c.variantId,quantity:c.quantity,attributes:de(t.id,t.bundleType)})))});e.appendChild(u.root),ue(u.root),Bt(u.root,i,d),r?.(fe(u.root))}function Z(e,t){let n=e;for(let r in t)n=n.split("__"+r+"__").join(String(t[r]));return n}function rt(e,t){let n=t.needsSpots;if(!n)return"Needs "+e+" spots";let r=new Intl.PluralRules(t.locale||"en").select(e);return Z(n[r]||n.other||"__COUNT__",{COUNT:e})}function ot(e,t,n){return Z(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function rr(e,t){return e>0?Z(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function or(e,t,n,r){if(e<=0)return r.bundleComplete||"Your bundle is complete";let o=t==="percentage"&&n?Math.round(n):0;return o>0?Z(r.chooseMoreUnlock||"Choose __COUNT__ more to unlock __PCT__% off",{COUNT:e,PCT:o}):Z(r.chooseMoreComplete||"Choose __COUNT__ more to complete your bundle",{COUNT:e})}var xi={min:1,max:99};function te(e,t,n){if(n!=null){let o=t["gid://shopify/ProductVariant/"+n];if(o&&typeof o.min=="number"&&typeof o.max=="number")return o}let r=t["gid://shopify/Product/"+e];return!r||typeof r.min!="number"||typeof r.max!="number"?xi:r}function pe(e,t){if(e==null)return;let n=t["gid://shopify/ProductVariant/"+e];if(!(!n||typeof n.min!="number"||typeof n.max!="number"))return n}function it(e,t){let n=e??{};if(!t)return n;let r=Object.keys(t);if(r.length===0)return n;let o={...n};for(let i of r)o[i]=t[i];return o}function at(e,t,n){return te(e,t,n).min}function oe(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].quantity||1;return t}function be(e,t){for(let n=0;n<e.length;n++)if(e[n]&&e[n].variantId===t)return n;return-1}function ir(e,t){let n=be(e,t);return n===-1?0:e[n].quantity||0}function ar(e,t){return e.min<=t}function lr(e,t,n,r=0,o=0,i){let a=Math.min(e.max-o,r+t);return typeof i=="number"&&(a=Math.min(a,i)),typeof n=="number"?Math.min(a,n):a}var sr=[120,180,240],dr=[480,600,768,1024],cr="60px",ur="(max-width: 767px) 45vw, 228px";function Le(e,t){return e&&(/[?&]width=\d+/.test(e)?e.replace(/([?&])width=\d+/,"$1width="+t):e+(e.indexOf("?")===-1?"?":"&")+"width="+t)}function lt(e,t){return e?t.map(n=>Le(e,n)+" "+n+"w").join(", "):""}function st(e,t){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Se(e){return e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase():""}var yi=600;function dt(e,t,n){let{t:r,rulesMap:o,capacity:i,formatMoney:a}=n,l=te(e.id,o),d=document.createElement("div");d.className="lb-mix-match__modal-product",e.available||(d.className+=" lb-mix-match__modal-product--sold-out"),d.setAttribute("data-product-item",""),d.setAttribute("data-title",Se(e.title)),d.setAttribute("data-type",e.type||"");let s=!1,u=!1,c=document.createElement("div");c.className="lb-mix-match__modal-product-thumb";let p=document.createElement("span");p.className="lb-mix-match__modal-added-badge",p.textContent=r.addedItem||"Added",p.hidden=!0,c.appendChild(p);let h=g=>{if(!g){ke(c);return}Xe(c);let O=c.querySelector("img");O||(O=document.createElement("img"),O.sizes=ur,O.alt=e.title,O.loading="lazy",c.appendChild(O)),O.src=Le(g,yi),O.srcset=lt(g,dr)},m=e.variants.find(g=>g.available)??null;h(m&&m.image||e.featuredImage),d.appendChild(c);let k=document.createElement("div");k.className="lb-mix-match__modal-product-info";let B=document.createElement("p");if(B.className="lb-mix-match__modal-product-title",e.url){let g=document.createElement("a");g.href=e.url,g.target="_blank",g.rel="noopener noreferrer",g.textContent=e.title,B.appendChild(g)}else B.textContent=e.title;k.appendChild(B);let y=m??(e.variants.length>0?e.variants[0]:null),S=g=>te(e.id,o,g?g.id:null),N=y?S(y).min:1,L=document.createElement("p");L.className="lb-mix-match__modal-product-price",L.setAttribute("data-row-price","");let V=document.createElement("span");V.setAttribute("data-row-price-sale",""),y&&(V.textContent=a(y.price*N)),L.appendChild(V);let _=document.createElement("s");_.className="lb-mix-match__modal-product-compare",_.setAttribute("data-row-compare",""),L.appendChild(_),k.appendChild(L);function w(g,O,j){let Q=O&&O.compareAtPrice?O.compareAtPrice*j:0,K=O?O.price*j:0;Q>K?(g.textContent=a(Q),g.hidden=!1):(g.textContent="",g.hidden=!0)}w(_,y,N);let b=document.createElement("p");b.className="lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price",b.setAttribute("data-row-unit-price","");let D=y?y.unitPrice:null;D?b.textContent=D:b.hidden=!0,k.appendChild(b);let H=null,R=null,q=S(y).min,$=S(y).max,G=null,J=null;if(e.available&&n.showQtySelector){H=document.createElement("div"),H.className="lb-bundle-variant-option-group lb-mix-match__qty-stepper-group";let g=document.createElement("div");g.className="lb-mix-match__qty-stepper",g.setAttribute("role","group"),g.setAttribute("aria-label",r.quantity||"Quantity");let O=document.createElement("button");O.type="button",O.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--minus",O.setAttribute("aria-label",r.decreaseQuantity||"Decrease quantity"),O.textContent="\u2212",R=document.createElement("span"),R.className="lb-mix-match__qty-stepper-value",R.setAttribute("data-row-qty",""),R.setAttribute("aria-live","polite"),R.textContent=String(S(y).min);let j=document.createElement("button");j.type="button",j.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--plus",j.setAttribute("aria-label",r.increaseQuantity||"Increase quantity"),j.textContent="+",g.appendChild(O),g.appendChild(R),g.appendChild(j),H.appendChild(g);let Q=R;G=()=>{Q.textContent=String(q),Q.setAttribute("data-qty",String(q)),O.disabled=u||q<=S(y).min,j.disabled=u||q>=$},J=(C,T=0)=>{let x=C?C.id:null,v=x===null?0:i.ownQty(x),M=x===null?0:i.productUnitsElsewhere(e.id,x),z=x===null?0:i.swapUnits(e.id,x),F=C?C.inventoryQuantity:null,X=Math.max(0,T-v),me=typeof F=="number"?Math.max(0,F-X):void 0,he=pe(x,o)?.max,ne=S(C).min;$=z>0?typeof me=="number"?Math.min(z,me):z:lr(l,i.remainingSpots(),me,v,M,he),$<ne?q=ne:(q>$&&(q=$),q<ne&&(q=ne)),G()};let K=()=>{y&&i.commitQty(y.id,q)&&n.onCommittedQtyChanged()};O.addEventListener("click",()=>{q>S(y).min&&(q-=1),G(),K()}),j.addEventListener("click",()=>{q<$&&(q+=1),G(),K()}),y?J(y):G()}let W=e.variants.slice(),A=[];if(W.length>1){let g=e.optionNames||[];y=W.find(x=>x.available!==!1)??W[0];let O=()=>{let x=A.map(v=>v.value);for(let v of W)if(!(!v.options||v.options.length!==x.length)&&v.options.every((M,z)=>M===x[z]))return v;return null},j=x=>{if(!(!x||!x.options))for(let v=0;v<A.length&&v<x.options.length;v++)A[v].value!==x.options[v]&&(A[v].value=x.options[v])},Q=(x,v,M)=>{for(let z of W){if(z.available===!1||!z.options||z.options[x]!==v)continue;let F=!0;for(let X=0;X<z.options.length;X++)if(X!==x&&z.options[X]!==M[X]){F=!1;break}if(F)return!0}return!1},K=x=>{for(let v=0;v<A.length;v++){let M=A[v];for(let z=0;z<M.options.length;z++)M.options[z].disabled=!Q(v,M.options[z].value,x)}},C=()=>{let x=O();if(!x){j(y),y?.options&&K(y.options);return}y=x,d.setAttribute("data-selected-variant-id",String(x.id));let v=S(x).min;V.textContent=a(x.price*v),w(_,x,v),x.unitPrice?(b.textContent=x.unitPrice,b.hidden=!1):(b.textContent="",b.hidden=!0),h(x.image||e.featuredImage),J?.(x,i.variantUnitsElsewhere(x.id)),x.options&&K(x.options),U()},T=document.createElement("div");T.className="lb-bundle-variant-option-groups";for(let x=0;x<g.length;x++){let v=g[x],M=document.createElement("div");M.className="lb-bundle-variant-option-group";let z=document.createElement("span");z.className="lb-bundle-variant-option-label",z.textContent=v,M.appendChild(z);let F=document.createElement("select");F.className="lb-mix-match__variant-select",F.setAttribute("data-variant-option",""),F.setAttribute("data-option-position",String(x+1)),F.name="lb-variant-"+e.id+"-"+(x+1),F.setAttribute("aria-label",v);let X=Object.create(null),me=y?.options?.[x];for(let he of W){let ne=he.options&&he.options[x];if(!ne||X[ne])continue;X[ne]=!0;let ye=document.createElement("option");ye.value=ne,ye.textContent=ne,ne===me&&(ye.selected=!0),F.appendChild(ye)}F.addEventListener("change",C),A.push(F),M.appendChild(F),T.appendChild(M)}k.appendChild(T),y&&(d.setAttribute("data-selected-variant-id",String(y.id)),y.options&&K(y.options))}else if(W.length===1&&W[0].title!=="Default Title"){let g=document.createElement("span");g.className="lb-mix-match__filled-variant",g.textContent=W[0].title,k.appendChild(g)}let E=null;e.available&&(E=document.createElement("span"),E.className="lb-mix-match__modal-needs-spots",E.hidden=!0,k.appendChild(E));let f=null;if(e.available){let g=document.createElement("div");g.className="lb-mix-match__modal-product-actions",H&&g.appendChild(H),f=document.createElement("button"),f.type="button",f.className="lb-mix-match__modal-add",f.textContent=r.addItem||"Add",f.setAttribute("aria-label",(r.addItem||"Add")+" "+e.title),f.setAttribute("data-add-product",String(t)),g.appendChild(f),k.appendChild(g)}else{let g=document.createElement("span");g.className="lb-mix-match__modal-sold-out-label",g.textContent=r.soldOut||"Sold out",d.setAttribute("aria-disabled","true"),k.appendChild(g)}d.appendChild(k);let I=y?y.id:null;function U(){if(!y)return;let g=y,O=g.inventoryQuantity,j=typeof O=="number"?i.variantUnitsElsewhere(g.id):0,Q=i.isInBundle(g.id);if(J){let M=i.ownQty(g.id);M>0?q=M:I!==g.id&&(q=S(g).min),I=g.id,J(g,j)}let K=i.swapUnits(e.id,g.id),C=S(g),T=K>=C.min,x=i.remainingSpots(),v=!Q&&!T&&!ar(C,x);if(E&&(v&&x>0?(E.textContent=rt(C.min,r),E.hidden=!1):E.hidden=!0),f)if(Q)f.disabled=!1,i.canRemove(g.id)?(f.textContent=r.removeItem||"Remove",f.setAttribute("aria-label",(r.removeItem||"Remove")+" "+e.title),f.classList.remove("lb-mix-match__modal-add--required")):(f.disabled=!0,f.textContent=r.required||"Required",f.setAttribute("aria-label",e.title+" is required and cannot be removed"),f.classList.add("lb-mix-match__modal-add--required")),f.classList.add("lb-mix-match__modal-add--added"),d.classList.add("lb-mix-match__modal-product--in-bundle"),p.hidden=!1;else{let M=r.swapItem||"Swap",z=T?M:r.addItem||"Add";f.textContent=z,f.setAttribute("aria-label",z+" "+e.title),f.classList.remove("lb-mix-match__modal-add--added"),f.classList.remove("lb-mix-match__modal-add--required"),d.classList.remove("lb-mix-match__modal-product--in-bundle"),p.hidden=!0;let F=typeof O=="number"?Math.max(0,O-j)<C.min:!1;if(T)f.disabled=F;else{let X=l.max-i.productUnitsElsewhere(e.id,g.id)<C.min;f.disabled=F||X||v||i.isFull()}}s=!e.available,u=!e.available||!Q&&!!f?.disabled,G?.();for(let M of A)M.disabled=s}return{el:d,refresh:U}}var vi='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function ct(e){let t=e.querySelectorAll(vi),n=[];for(let r=0;r<t.length;r++)t[r].offsetParent!==null&&n.push(t[r]);return n}var Dt=0,Me=0;function ut(){if(Me++,Me>1)return;Dt=window.pageYOffset||document.documentElement.scrollTop;let e=document.body;e.style.position="fixed",e.style.top="-"+Dt+"px",e.style.left="0",e.style.right="0",e.style.overflow="hidden"}function pt(){if(Me<=0||(Me--,Me>0))return;let e=document.body;e.style.position="",e.style.top="",e.style.left="",e.style.right="",e.style.overflow="",window.scrollTo(0,Dt)}function mt(e,t,n){let r=[],o=[];for(let i=0;i<t.length;i++)(n(i)?o:r).push(t[i]);for(let i of r)e.appendChild(i);for(let i of o)e.appendChild(i)}var Pe="__all__",wi=300,_i=200;function pr(e){let{container:t,data:n,t:r,eligibleProducts:o,items:i}=e,a=t.querySelector("[data-modal-overlay]");a&&e.portalTarget&&e.portalTarget.appendChild(a);let l=f=>a?a.querySelector(f):null,d=l('[role="dialog"]'),s=l("[data-modal-search]"),u=l("[data-modal-search-clear]"),c=l("[data-modal-list]"),p=l("[data-modal-empty]"),h=l("[data-modal-live]"),m=l("[data-modal-close]"),k=l("[data-modal-done]"),B=l("[data-modal-footer-count]"),y=l("[data-modal-subtitle]"),S=l("[data-modal-filters]"),N=n.showTypeFilters!==!1,L=Pe,V=!1,_=!1,w=!1,b=[];function D(){for(let f of b)f.refresh()}function H(){let f=Math.min(oe(i),e.requiredQty),I=Math.max(0,e.requiredQty-f);B&&(B.textContent=ot(f,e.requiredQty,r)),y&&(y.textContent=or(I,n.discountType,n.discountValue,r))}function R(){D(),H()}function q(){if(c){e.dropdown?.unbindAll(c),c.innerHTML="",b=[];for(let f=0;f<o.length;f++){let I=dt(o[f],f,{t:r,rulesMap:e.rulesMap,showQtySelector:e.showQtySelector,capacity:e.rowCapacity,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),R()}});b.push(I),c.appendChild(I.el)}e.dropdown?.bindAll(c),c.addEventListener("click",$)}}function $(f){let I=f.target.closest("[data-add-product]");if(!I||I.disabled)return;let U=parseInt(I.getAttribute("data-add-product")??"",10),g=o[U];if(!g)return;let O=I.closest(".lb-mix-match__modal-product"),j=O&&O.getAttribute("data-selected-variant-id"),Q=(j?g.variants.find(v=>v.id===parseInt(j,10)):null)??null;if(Q||(Q=g.variants.find(v=>v.available)??null),!Q)return;if(e.isInBundle(Q.id)){e.removeVariant(Q.id),R();return}let K=O?.querySelector("[data-row-qty]"),C=K?Math.max(1,parseInt(K.getAttribute("data-qty")||K.textContent||"",10)||1):at(g.id,e.rulesMap,Q.id),T={productId:g.id,variantId:Q.id,title:g.title,url:g.url||null,variantTitle:Q.title,featuredImage:Q.image||g.featuredImage||null,price:Q.price,compareAtPrice:Q.compareAtPrice||null,unitPrice:Q.unitPrice||null,quantity:C},x=e.swapUnitsFor(g.id,Q.id);if(x>0){e.swapVariant(T,Math.min(C,x)),R();return}e.atCapacity()||(e.addSelection(T),R())}function G(){if(!S||!N)return;let f=[],I=Object.create(null);for(let U of o){let g=(U.type||"").trim();g&&!I[g]&&(I[g]=!0,f.push(g))}if(f.length<2){S.style.display="none",d?.classList.add("lb-mix-match__modal--filters-hidden");return}S.innerHTML="";for(let U of[Pe,...f]){let g=document.createElement("button");g.type="button",g.className="lb-mix-match__filter",g.setAttribute("data-filter",U),g.setAttribute("aria-pressed",U===L?"true":"false"),U===L&&g.classList.add("lb-mix-match__filter--active"),g.textContent=U===Pe?r.allTypes||"All":U,g.addEventListener("click",()=>{L=U,J(),W(s?s.value:"")}),S.appendChild(g)}}function J(){if(!S)return;let f=S.querySelectorAll("[data-filter]");for(let I=0;I<f.length;I++){let U=f[I].getAttribute("data-filter")===L;f[I].classList.toggle("lb-mix-match__filter--active",U),f[I].setAttribute("aria-pressed",U?"true":"false")}}function W(f){if(!c)return;let I=Se(f),U=c.querySelectorAll("[data-product-item]"),g=0;for(let O=0;O<U.length;O++){let j=U[O].getAttribute("data-title")??"",Q=U[O].getAttribute("data-type")||"",K=(!I||j.indexOf(I)!==-1)&&(L===Pe||Q===L);U[O].classList.toggle("lb-hidden",!K),K&&g++}p&&(p.style.display=g===0&&I.length>0?"":"none"),u&&(u.style.display=f.length>0?"":"none"),h&&(h.textContent=Z(r.nProductsShown||"__COUNT__ products shown",{COUNT:g}))}if(s){let f=st(()=>W(s.value),_i);s.addEventListener("input",f)}u&&u.addEventListener("click",()=>{s&&(s.value="",W(""),s.focus())});function A(){if(!(!a||w)){if(w=!0,V||(q(),V=!0),_||(G(),_=!0),R(),L=Pe,J(),s&&(s.value=""),W(s?s.value:""),c){let f=Object.create(null);for(let I of i)f[String(I.productId)]=!0;mt(c,b.map(I=>I.el),I=>f[String(o[I].id)]===!0),c.scrollTop=0}a.style.display="",a.offsetHeight,a.classList.add("lb-mix-match__modal-overlay--open"),ut(),setTimeout(()=>{m?m.focus():d?.focus()},50)}}function E(){if(!a||!w)return;w=!1,a.classList.remove("lb-mix-match__modal-overlay--open"),pt(),setTimeout(()=>{w||(a.style.display="none")},wi);let f=e.fallbackFocus;f&&typeof f.focus=="function"&&setTimeout(()=>f.focus(),0)}if(m?.addEventListener("click",E),k?.addEventListener("click",E),a){let f=null;a.addEventListener("mousedown",I=>{f=I.target}),a.addEventListener("mouseup",I=>{I.target===a&&f===a&&E(),f=null})}return document.addEventListener("keydown",f=>{if(w){if(f.key==="Escape"){f.preventDefault(),E();return}if(f.key==="Tab"&&d){let I=ct(d);if(I.length===0){f.preventDefault();return}let U=I[0],g=I[I.length-1];f.shiftKey&&document.activeElement===U?(f.preventDefault(),g.focus()):!f.shiftKey&&document.activeElement===g&&(f.preventDefault(),U.focus())}}}),{open:A,close:E,isOpen:()=>w,refresh:R,overlay:a}}function mr(e,t){return Math.max(0,t-oe(e))}function Ot(e,t){return oe(e)>=t}function br(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].variantId===t&&(n+=e[r].quantity||0);return n}function bt(e,t,n){let r=0;for(let o=0;o<e.length;o++){let i=e[o];i&&i.productId===t&&i.variantId!==n&&(r+=i.quantity||0)}return r}function Ee(e,t,n){if(pe(t.variantId,n)?.required)return!1;let r=te(t.productId,n);if(!r.required)return!0;let o=0;for(let i=0;i<e.length;i++){let a=e[i];a!==t&&a.productId===t.productId&&(o+=a.quantity||1)}return o>=r.min}function Vt(e,t,n,r){let o=te(t,r);return!o.required||o.max!==o.min||be(e,n)!==-1?0:bt(e,t,n)}function Ci(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","16"),t.setAttribute("height","16"),t.setAttribute("viewBox","0 0 20 20"),t.setAttribute("fill","none");for(let[n,r,o,i]of[["5","5","15","15"],["15","5","5","15"]]){let a=document.createElementNS(e,"line");a.setAttribute("x1",n),a.setAttribute("y1",r),a.setAttribute("x2",o),a.setAttribute("y2",i),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","2"),a.setAttribute("stroke-linecap","round"),t.appendChild(a)}return t}function ht(e,t,n,r,o,i){let a=document.createElement("div");a.className="lb-mix-match__slot lb-mix-match__slot--filled";let l=document.createElement("div");if(l.className="lb-bundle-thumbnail",e.featuredImage){let m=document.createElement("img");m.src=Le(e.featuredImage,240),m.srcset=lt(e.featuredImage,sr),m.sizes=cr,m.alt=e.title,m.loading="lazy",l.appendChild(m)}else ke(l);a.appendChild(l);let d=document.createElement("div");d.className="lb-mix-match__filled-info";let s=document.createElement("button");if(s.type="button",s.className="lb-mix-match__filled-title",s.textContent=e.title,s.setAttribute("aria-label",(t.editSelection||"Edit selection")+": "+e.title),d.appendChild(s),e.variantTitle&&e.variantTitle!=="Default Title"){let m=document.createElement("span");m.className="lb-mix-match__filled-variant",m.textContent=e.variantTitle,d.appendChild(m)}let u=document.createElement("span");u.className="lb-mix-match__filled-price";let c=e.compareAtPrice||0;if(c>e.price){let m=document.createElement("s");m.className="lb-mix-match__filled-compare",m.textContent=n(c),u.appendChild(m)}let p=document.createElement("span");p.className="lb-bundle-product-price",p.textContent=n(e.price),u.appendChild(p);let h=document.createElement("span");if(h.className="lb-bundle-qty-inline",h.textContent="\xD7"+(e.quantity||1),u.appendChild(h),d.appendChild(u),e.unitPrice){let m=document.createElement("span");m.className="lb-bundle-product-unit-price",m.textContent=e.unitPrice,d.appendChild(m)}if(a.appendChild(d),r){let m=document.createElement("button");m.type="button",m.className="lb-mix-match__slot-remove",m.setAttribute("aria-label",(t.removeItem||"Remove")+" "+e.title),m.appendChild(Ci()),m.addEventListener("click",k=>{k.stopPropagation(),o()}),a.appendChild(m)}else{let m=document.createElement("span");m.className="lb-mix-match__slot-required",m.textContent=t.required||"Required",a.appendChild(m)}return a.addEventListener("click",i),a}function hr(e,t,n,r,o){let i=r.translations||{},a=e.querySelector("[data-selection-slots]");if(a){a.innerHTML="";for(let s=0;s<t.length;s++){let u=s;a.appendChild(ht(t[u],i,o.formatMoney,Ee(t,t[u],o.rulesMap),()=>o.onRemove(u),o.onEdit))}}let l=e.querySelector("[data-add-product-trigger]");l&&(l.style.display=oe(t)>=n?"none":"");let d=e.querySelector("[data-add-bundle]");if(d){d.disabled=oe(t)<n;let s=d.querySelector("[data-cta-label]");s&&(s.textContent=d.getAttribute("data-cta-text")||i.addToCart||"Add to cart")}}function fr(e,t,n,r,o){let i=e.querySelector("[data-pricing-section]");if(oe(t)<n){i&&(i.style.display="none");return}i&&(i.style.display="");let a=t.map(d=>({unitCents:d.price,quantity:d.quantity||1})),l=0;for(let d of a)l+=d.unitCents*d.quantity;l>0&&r.discountType&&o(e,ze(a,{discountType:r.discountType,discountValue:r.discountValue??0}),l)}function gr(e,t,n,r,o){let i=Math.min(oe(n),r),a=Math.max(0,r-i),l=[e];t&&l.push(t);for(let d of l){let s=d.querySelectorAll("[data-progress-segment]");for(let h=0;h<s.length;h++)s[h].classList.toggle("lb-mix-match__progress-segment--filled",h<i);let u=d.querySelector("[data-progress-count]");u&&(u.textContent=ot(i,r,o));let c=d.querySelector("[data-progress-remaining]");c&&(c.textContent=rr(a,o));let p=d.querySelector(".lb-mix-match__progress-segments");p&&p.setAttribute("aria-valuenow",String(i))}}function ft(e){return(t,n,r)=>{let o=t.querySelector("[data-sale-price]"),i=t.querySelector("[data-compare-price]"),a=t.querySelector("[data-savings-bar]"),l=t.querySelector("[data-savings-amount]"),d=t.querySelector("[data-savings-percent]"),s=r-n;if(o&&(o.textContent=e(n)),i&&(s>0?(i.textContent=e(r),i.style.display=""):i.style.display="none"),a)if(s>0){if(l&&(l.textContent=e(s)),d){let u=r>0?Math.round(s*100/r):0;d.textContent="("+u+"%)"}a.style.display=""}else a.style.display="none"}}function xr(e,t,n,r){let o=u=>u.variants.find(c=>c.available)??null,i=(u,c,p)=>({productId:u.id,variantId:c.id,title:u.title,url:u.url||null,variantTitle:c.title,featuredImage:u.featuredImage||null,price:c.price,compareAtPrice:c.compareAtPrice||null,unitPrice:c.unitPrice||null,quantity:p}),a=[];for(let u of e){if(!u.available||!u.variants)continue;let c=!1;for(let m of u.variants){let k=pe(m.id,t);!k?.required||!m.available||(a.push(i(u,m,Math.max(1,k.min))),c=!0)}if(c)continue;let p=te(u.id,t);if(!p.required)continue;let h=o(u);h&&a.push(i(u,h,Math.max(1,p.min)))}if(a.length||!r?.enabled)return a;let l=u=>u.available&&te(u.id,t).min<=n&&o(u)!==null,d=(r.currentProductId!=null?e.find(u=>u.id===r.currentProductId&&l(u)):null)??e.find(l);if(!d)return[];let s=o(d);return s?[i(d,s,te(d.id,t).min)]:[]}function yr(e){let t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("width","20"),n.setAttribute("height","20"),n.setAttribute("viewBox","0 0 20 20"),n.setAttribute("fill","none");for(let[r,o,i,a]of e){let l=document.createElementNS(t,"line");l.setAttribute("x1",r),l.setAttribute("y1",o),l.setAttribute("x2",i),l.setAttribute("y2",a),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","2"),l.setAttribute("stroke-linecap","round"),n.appendChild(l)}return n}function Y(e,t,n={}){let r=document.createElement(e);t&&(r.className=t);for(let o in n)r.setAttribute(o,n[o]);return r}function gt(e){let t="lb-modal-title-"+e.domId,n=e.strings||{},r=Y("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.bundleGid,style:"display: none;"}),o=Y("div","lb-mix-match__modal"+(e.showTypeFilters?"":" lb-mix-match__modal--filters-hidden"),{role:"dialog","aria-modal":"true","aria-labelledby":t,tabindex:"-1"}),i=Y("div","lb-mix-match__modal-header"),a=Y("div","lb-mix-match__modal-header-top"),l=Y("div","lb-mix-match__modal-heading"),d=Y("h4","lb-mix-match__modal-title",{id:t});e.wizard&&d.setAttribute("tabindex","-1"),d.textContent=n.addToBundle||"Add to your bundle",l.appendChild(d),l.appendChild(Y("p","lb-mix-match__modal-subtitle",{"data-modal-subtitle":""})),a.appendChild(l);let s=Y("button","lb-mix-match__modal-close",{type:"button","data-modal-close":"","aria-label":n.closeModal||"Close"});s.appendChild(yr([["5","5","15","15"],["15","5","5","15"]])),a.appendChild(s),i.appendChild(a);let u=Y("div","lb-mix-match__progress lb-mix-match__modal-progress",{"data-progress":""}),c=Y("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e.segmentCount??0)});if(e.wizard)c.setAttribute("data-modal-step-segments","");else for(let B=0;B<(e.segmentCount??0);B++)c.appendChild(Y("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));if(u.appendChild(c),i.appendChild(u),o.appendChild(i),e.showSearch){let B=Y("div","lb-mix-match__modal-search"),y=Y("input","lb-mix-match__modal-search-input",{type:"text","data-modal-search":"",role:"searchbox","aria-label":n.searchProducts||"Search products",placeholder:n.searchProducts||"Search products",autocomplete:"off"});B.appendChild(y);let S=Y("button","lb-mix-match__modal-search-clear",{type:"button","data-modal-search-clear":"","aria-label":n.clearSearch||"Clear search",style:"display: none;"});S.appendChild(yr([["5","5","15","15"],["15","5","5","15"]])),B.appendChild(S),o.appendChild(B)}e.showTypeFilters&&o.appendChild(Y("div","lb-mix-match__filters",{"data-modal-filters":"",role:"group","aria-label":"Filter by type"})),o.appendChild(Y("div","lb-mix-match__modal-list",{"data-modal-list":""}));let p=Y("div","lb-mix-match__modal-empty",{"data-modal-empty":"",style:"display: none;"}),h=document.createElement("p");h.textContent=n.noSearchResults||"No products match your search",p.appendChild(h),o.appendChild(p),o.appendChild(Y("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"}));let m=Y("div",e.wizard?"lb-mix-match__modal-footer lb-multi-step__modal-footer":"lb-mix-match__modal-footer");if(e.wizard){let B=Y("button","lb-multi-step__modal-back",{type:"button","data-modal-back":"",style:"display: none;"});B.textContent=n.back||"Back",m.appendChild(B)}if(m.appendChild(Y("span","lb-mix-match__modal-footer-count",{"data-modal-footer-count":"","aria-live":"polite"})),e.wizard){let B=Y("button","lb-mix-match__modal-done",{type:"button","data-modal-next":"",style:"display: none;"});B.textContent=n.next||"Next",m.appendChild(B)}let k=Y("button","lb-mix-match__modal-done",{type:"button","data-modal-done":"",...e.wizard?{style:"display: none;"}:{}});return k.textContent=n.done||"Done",m.appendChild(k),o.appendChild(m),r.appendChild(o),r}function vr(e,t,n,r,o){let i=t.widgetConfig,a=ae,l=t.minQuantity||1,d=it(t.productRules,t.variantRules),u=$e(t).map((_,w)=>({id:Number(_.productId),title:_.title??"",url:_.url??null,type:t.products[w]?.productType??"",featuredImage:_.featuredImage??null,available:_.variants.some(b=>b.available),optionNames:_.optionNames,variants:_.variants.map(b=>({id:Number(b.id),title:b.title,options:b.options,available:b.available,price:b.price,compareAtPrice:b.compareAtPrice,unitPrice:b.unitPrice,image:b.image,inventoryQuantity:b.inventoryQuantity??null}))}));if(!u.length||u.filter(_=>_.available).length===0)return;let p=se(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),h=ce("lb-mix-match",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||a.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});h.root.setAttribute("data-required-quantity",String(l)),h.products.before(et(l));let m=document.createElement("div");m.className="lb-mix-match__slots lb-edge-fade",m.setAttribute("data-selection-slots",""),h.products.replaceWith(m);let k=document.createElement("button");k.type="button",k.className="lb-mix-match__add-product",k.setAttribute("data-add-product-trigger",""),k.textContent=(a.addItem,"Add a product"),m.after(k);let B=gt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:i.showSearch!==!1,showTypeFilters:i.mixMatchShowTypeFilters!==!1,segmentCount:l,wizard:!1});h.root.appendChild(B);let y=o?t.products.findIndex(_=>_.handle===o):-1,S=xr(u,d,l,{enabled:!!o,currentProductId:y!==-1?u[y]?.id??null:null}),N={remainingSpots:()=>mr(S,l),ownQty:_=>ir(S,_),variantUnitsElsewhere:_=>br(S,_),productUnitsElsewhere:(_,w)=>bt(S,_,w),swapUnits:(_,w)=>Vt(S,_,w,d),isInBundle:_=>be(S,_)!==-1,canRemove:_=>{let w=be(S,_);return w!==-1&&Ee(S,S[w],d)},isFull:()=>Ot(S,l),commitQty:(_,w)=>{let b=be(S,_);return b===-1||S[b].quantity===w?!1:(S[b].quantity=w,!0)}};function L(){hr(h.root,S,l,t,{formatMoney:p,rulesMap:d,onRemove:_=>{Ee(S,S[_],d)&&(S.splice(_,1),L(),V.isOpen()&&V.refresh())},onEdit:()=>V.open()}),fr(h.root,S,l,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},ft(p)),gr(h.root,V.overlay,S,l,a)}let V=pr({container:h.root,data:{translations:a,discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},t:a,rulesMap:d,eligibleProducts:u,requiredQty:l,showQtySelector:i.mixMatchShowQuantitySelector!==!1,items:S,formatMoney:p,rowCapacity:N,dropdown:void 0,portalTarget:null,fallbackFocus:k,onSelectionChanged:L,addSelection:_=>{if(oe(S)+(_.quantity||1)>l)return;let w=pe(_.variantId,d)?.max,b=te(_.productId,d).max-bt(S,_.productId,_.variantId);typeof w=="number"&&(b=Math.min(b,w)),!((_.quantity||1)>b)&&(S.push(_),L())},removeVariant:_=>{let w=be(S,_);w===-1||!Ee(S,S[w],d)||(S.splice(w,1),L())},swapVariant:(_,w)=>{let b=0;for(let D=S.length-1;D>=0&&b<w;D--){let H=S[D];if(H.productId!==_.productId||H.variantId===_.variantId)continue;let R=Math.min(H.quantity||1,w-b);R>=(H.quantity||1)?S.splice(D,1):H.quantity=(H.quantity||1)-R,b+=R}b>0&&(_.quantity=b,S.push(_),L())},swapUnitsFor:(_,w)=>Vt(S,_,w,d),isInBundle:_=>be(S,_)!==-1,atCapacity:()=>Ot(S,l)});k.addEventListener("click",()=>{V.isOpen()||V.open()}),h.cta.addEventListener("click",()=>{oe(S)<l||n(S.map(_=>({merchandiseId:"gid://shopify/ProductVariant/"+_.variantId,quantity:_.quantity||1,attributes:de(t.id,t.bundleType)})))}),e.appendChild(h.root),ue(h.root),L(),r?.(fe(h.root))}var wr="lb-volume__tier--oos";function ki(e){return parseInt(e.getAttribute("data-tier-qty")??"",10)||0}function Be(e){return e.getAttribute("aria-disabled")==="true"}function _r(e,t){for(let n=0;n<e.length;n++){let r=e[n];t!==null&&ki(r)>t?(r.classList.add(wr),r.setAttribute("aria-disabled","true")):(r.classList.remove(wr),r.removeAttribute("aria-disabled"))}}function Cr(e,t){let n=e[t];if(n&&!Be(n))return t;for(let r=0;r<e.length;r++)if(!Be(e[r]))return r;return-1}function Ft(e,t,n){let r=t+n;for(;r>=0&&r<e.length;){if(!Be(e[r]))return r;r+=n}return t}function kr(e,t,n){if(t==="fixed_amount"){let o=parseInt(n.getAttribute("data-tier-amt")??"",10)||0;return Math.max(0,e-o)}let r=parseInt(n.getAttribute("data-tier-pct")??"",10)||0;return Math.max(0,e-Math.floor(e*r/100))}function Ti(e,t,n){let r=parseInt(n.getAttribute("data-tier-qty")??"",10),o=kr(e,t,n),i=o*r,a=e*r;return{qty:r,priceEach:o,totalPrice:i,undiscountedTotal:a,totalSavings:a-i}}function Si(e,t){if(!t.itemCount)return null;let n=new Intl.PluralRules(t.locale||"en").select(e);return" ("+(t.itemCount[n]||t.itemCount.other||"__COUNT__").split("__COUNT__").join(String(e))+")"}function Tr(e,t,n,r){for(let o=0;o<e.length;o++){let i=e[o],a=i.querySelector("[data-tier-price-each]");a&&(a.textContent=r(kr(t,n,i)));let l=i.querySelector(".lb-volume__tier-compare");l&&(l.textContent=r(t))}}function Sr(e,t,n,r,o,i,a){for(let y=0;y<t.length;y++)t[y].setAttribute("aria-checked",y===o?"true":"false"),t[y].setAttribute("tabindex",y===o?"0":"-1");let{qty:l,totalPrice:d,undiscountedTotal:s,totalSavings:u}=Ti(n,r,t[o]),c=e.querySelector("[data-item-count]");if(c){let y=Si(l,i);y!==null&&(c.textContent=y)}let p=e.querySelector("[data-total-price]");p&&(p.textContent=a(d));let h=e.querySelector("[data-compare-price]");h&&(u>0?(h.textContent=a(s),h.style.display=""):h.style.display="none");let m=e.querySelector("[data-savings-bar]"),k=e.querySelector("[data-savings-amount]"),B=e.querySelector("[data-savings-percent]");if(m)if(u>0){if(k&&(k.textContent=a(u)),B){let y=s>0?Math.round(u*100/s):0;B.textContent="("+y+"%)"}m.style.display="",m.classList.remove("lb-savings-pending")}else m.style.display="none"}function Er(e,t,n,r){let o=t.widgetConfig,i=_n(t.products,r);if(!i)return;let a=i.variants.nodes,l=Math.min(...t.volumeTiers.map(w=>w.minQuantity)),d=a.find(w=>Ae(w,l))??a.find(w=>w.availableForSale)??a[0];if(!d)return;let s=Ge(d.price.amount),u=t.discountConfig.discountType,c=se(i.priceRange.minVariantPrice.currencyCode),p=ae,h=xn(t.volumeTiers,u),m=yn(o.defaultTier,t.volumeTiers.length,h),k=vn(o.popularBadge?.tierIndex,o.popularBadge?.visible!==!1,h),B=t.volumeTiers.map((w,b)=>{let D=u==="fixed_amount"?0:Math.round(w.percentage??0),H=u==="fixed_amount"?Math.round((w.amount??0)*100):0,R=u==="fixed_amount"?Math.max(0,s-H):Math.max(0,s-Math.floor(s*D/100)),q=s>0?Math.round((s-R)*100/s):0;return{quantity:w.minQuantity,percent:D,amountCents:H,label:Z(p.buyQty||"Buy __COUNT__",{COUNT:w.minQuantity}),savingsLabel:q>0?"Save "+q+"%":null,badgeLabel:b===k?o.popularBadge?.text||"Most popular":null,selected:b===m}});if(!B.length)return;let y=ce("lb-volume",{title:t.title,subtitle:t.description,summaryLabel:"Total",withItemCount:o.pricing?.showItemCount!==!1,totalPriceSlot:!0,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||p.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt}),S=jn(B,"Select quantity",{showCompare:o.pricing?.showComparePrice!==!1,showPriceEach:o.pricing?.showPerUnitPrice!==!1,unitLabel:(p.each||"each").trim()});y.products.replaceWith(S);let N=S.querySelectorAll("[data-tier-index]");Tr(N,s,u,c),_r(N,Qe(d));let L=Cr(N,m),V=L===-1;V&&(L=m);let _=()=>Sr(y.root,N,s,u,L,p,c);if(S.addEventListener("click",w=>{let b=w.target.closest("[data-tier-index]");!b||Be(b)||(L=parseInt(b.getAttribute("data-tier-index")??"",10)||0,_())}),S.addEventListener("keydown",w=>{w.key==="ArrowDown"||w.key==="ArrowRight"?(w.preventDefault(),L=Ft(N,L,1),_(),N[L].focus()):(w.key==="ArrowUp"||w.key==="ArrowLeft")&&(w.preventDefault(),L=Ft(N,L,-1),_(),N[L].focus())}),V){y.cta.disabled=!0;let w=y.cta.querySelector("[data-cta-label]");w&&(w.textContent=p.outOfStock||"Out of stock")}else y.cta.addEventListener("click",()=>{let w=parseInt(N[L].getAttribute("data-tier-qty")??"",10);n([{merchandiseId:d.id,quantity:w,attributes:de(t.id,t.bundleType)}])});e.appendChild(y.root),ue(y.root),_()}function xt(e,t){return e-Math.floor(e*t/100)}function Ei(e,t,n,r){let o=ee(e[0],e[0].selectedVariantId),i=ee(e[1],e[1].selectedVariantId),a=o.price*n+i.price*r,l=o.price*n+xt(i.price,t)*r;return{totalPrice:a,salePrice:l,savings:a-l}}function Ut(e,t,n,r,o){let i=e.querySelector("[data-product-price]"),a=e.querySelector("[data-product-compare-price]");if(i){if(r&&n>0){i.textContent=o(xt(t.price,n)),a&&(a.textContent=o(t.price),a.hidden=!1);return}if(i.textContent=o(t.price),a){let l=t.compareAtPrice;l&&l>t.price?(a.textContent=o(l),a.hidden=!1):(a.textContent="",a.hidden=!0)}}}function zt(e,t,n,r,o,i){let{totalPrice:a,salePrice:l,savings:d}=Ei(t,n,r,o),s=e.querySelector("[data-sale-price]"),u=e.querySelector("[data-compare-price]"),c=e.querySelector("[data-savings-bar]"),p=e.querySelector("[data-savings-amount]"),h=e.querySelector("[data-savings-percent]");if(s&&(s.textContent=i(l)),u&&(d>0?(u.textContent=i(a),u.style.display=""):u.style.display="none"),c)if(d>0){if(p&&(p.textContent=i(d)),h){let m=a>0?Math.round(d*100/a):0;h.textContent="("+m+"%)"}c.style.display="",c.classList.remove("lb-savings-pending")}else c.style.display="none"}function Ar(e,t,n,r){let o=ee(e[0],e[0].selectedVariantId),i=ee(e[1],e[1].selectedVariantId),a={variantId:Number(e[0].selectedVariantId),quantity:n,priceCents:(o.price||0)*n},l=xt(i.price||0,t)*r;return String(e[0].selectedVariantId)===String(e[1].selectedVariantId)?[{variantId:a.variantId,quantity:n+r,priceCents:(a.priceCents??0)+l}]:[a,{variantId:Number(e[1].selectedVariantId),quantity:r,priceCents:l,attributes:[{key:Bn,value:qn}]}]}function Ai(){let e=document.createElement("div");return e.className="lb-bogo__plus",e.setAttribute("aria-hidden","true"),e.innerHTML='<svg width="12" height="12" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><line x1="9" y1="3" x2="9" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><line x1="3" y1="9" x2="15" y2="9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',e}function Ir(e,t,n,r){let o=t.widgetConfig,i=t.products.find(N=>N.id===t.buyProductId),a=t.products.find(N=>N.id===t.getProductId);if(!i||!a)return;let l=t.buyQuantity,d=t.getQuantity,s=t.discountConfig.discountValue,u={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},c=t.buyVariantIds?.length?t.buyVariantIds:null,p=t.getVariantIds?.length?t.getVariantIds:null,h=[{...Ce(i,t.id,{quantities:u,allowedVariantIds:c}),role:"buy"},{...Ce(a,t.id,{quantities:u,allowedVariantIds:p}),role:"get"}],m=h.filter(N=>!N.variants.some(L=>L.available)).length,k=se(i.priceRange.minVariantPrice.currencyCode),B=ae,y=ce("lb-bogo",{title:t.title,subtitle:t.description,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||B.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt});y.root.setAttribute("data-discount-value",String(s)),y.root.setAttribute("data-buy-qty",String(l)),y.root.setAttribute("data-get-qty",String(d));let S=s>=100?"Free":s+"% off";if(h.forEach((N,L)=>{let V=L===1;V&&y.products.appendChild(Ai());let _=!N.variants.some(D=>D.available),w=Ze(N,B,{isOos:_,href:N.url,bogoRole:N.role,inlineQuantity:V?d:l,badgeText:V&&!_?S:null,thumbnailRatio:o.productList?.thumbnailRatio});if(y.products.appendChild(w),_)return;let b=ee(N,N.selectedVariantId);Ye(w,N,b),Ie(w,b,N.featuredImage),Ut(w,b,s,V,k),Ke(w,()=>N,D=>{Ie(w,D,N.featuredImage),Ut(w,D,s,V,k),zt(y.root,h,s,l,d,k)})}),m>0){y.cta.disabled=!0;let N=y.cta.querySelector("[data-cta-label]");N&&(N.textContent=je(B,m))}else y.cta.addEventListener("click",()=>{n(Ar(h,s,l,d).map(N=>({merchandiseId:"gid://shopify/ProductVariant/"+N.variantId,quantity:N.quantity,attributes:[...de(t.id,t.bundleType),...N.attributes??[]]})))});e.appendChild(y.root),ue(y.root),zt(y.root,h,s,l,d,k),r?.(fe(y.root))}function Qt(e,t,n){return Z(n.stepOf||"Step __STEP__ of __TOTAL__",{STEP:e+1,TOTAL:t})}function qe(e,t,n){return Z(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function Mr(e,t,n){return Z(n.stepsCompleted||"__COUNT__ of __TOTAL__ steps completed",{COUNT:e,TOTAL:t})}function Pr(e,t){return e>0?Z(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function Lr(e,t,n){let r=new Intl.PluralRules(n||"en").select(t);return Z(e[r]||e.other||"__COUNT__",{COUNT:t})}function Br(e,t){return e?t.doorContinue||"Continue building":t.doorChoose||"Choose your products"}function qr(e,t,n,r){if(!e){let o=r.doorQuickSteps;return typeof o=="string"?Z(o,{COUNT:n}):Lr(o||{one:"__COUNT__ quick step",other:"__COUNT__ quick steps"},n,r.locale)}return Lr(r.doorStepsToGo||{one:"__COUNT__ step to go",other:"__COUNT__ steps to go"},t,r.locale)}function ge(e,t){let n=0;for(let r=0;r<e[t].length;r++)n+=e[t][r].quantity||1;return n}function xe(e,t,n){return ge(e,n)>=(t[n].minQuantity||1)}function Re(e,t,n){let r=t[n].maxQuantity;return r==null?1/0:Math.max(0,r-ge(e,n))}function Ne(e,t){for(let n=0;n<t.length;n++)if(!xe(e,t,n))return!1;return!0}function He(e,t,n){if(pe(t.variantId,n)?.required)return!1;let r=te(t.productId,n);if(!r.required)return!0;let o=0;for(let i of e)for(let a of i)a!==t&&a.productId===t.productId&&(o+=a.quantity||1);return o>=r.min}function Wt(e,t,n,r,o){let i=te(n,o);if(!i.required||i.max!==i.min||_e(e,t,r)!==-1)return 0;let a=0;for(let l of e[t])l.productId===n&&l.variantId!==r&&(a+=l.quantity||1);return a}function _e(e,t,n){for(let r=0;r<e[t].length;r++)if(e[t][r].variantId===n)return r;return-1}function Rr(e){let{container:t,steps:n,selections:r,t:o}=e;for(let i=0;i<n.length;i++){let a=n[i].minQuantity||1,l=t.querySelector('[data-step-group="'+i+'"]');l&&l.setAttribute("data-step-mode",r[i].length>0?"open":"row");let d=qe(Math.min(ge(r,i),a),a,o),s=xe(r,n,i),u=t.querySelectorAll('[data-step-count="'+i+'"]');for(let p=0;p<u.length;p++)u[p].textContent=d,u[p].classList.toggle("lb-multi-step__group-count--met",s);let c=t.querySelector('[data-step-slots="'+i+'"]');if(c){c.innerHTML="";for(let p=0;p<r[i].length;p++){let h=i,m=p,k=r[h][m];c.appendChild(ht(k,o,e.formatMoney,He(r,k,e.rulesMap),()=>e.onRemove(h,m),()=>e.onEdit(h)))}}}}function Nr(e){let{container:t,steps:n,selections:r,t:o}=e,i=t.querySelector("[data-step-door]");if(!i)return;let a=-1,l=0,d=!1;for(let m=0;m<n.length;m++)r[m].length>0&&(d=!0),xe(r,n,m)||(l+=1,a===-1&&(a=m));if(a===-1){i.style.display="none",i.classList.add("lb-multi-step__door--hidden");let m=i.parentElement;m&&m.firstElementChild!==i&&m.insertBefore(i,m.firstElementChild);return}i.style.display="",i.classList.remove("lb-multi-step__door--hidden"),i.setAttribute("data-step-door",String(a));let s=Br(d,o),u=i.querySelector(".lb-mix-match__add-product-label");u&&(u.textContent=s);let c=i.querySelector(".lb-multi-step__door-sub");c&&(c.textContent=qr(d,l,n.length,o));let p=n[a].name||"";i.setAttribute("aria-label",p?s+": "+p:s);let h=t.querySelector('[data-step-group="'+a+'"]');h&&h.parentElement&&h.previousElementSibling!==i&&h.parentElement.insertBefore(i,h)}function Hr(e,t,n){let{container:r,steps:o,selections:i}=e,a=r.querySelector("[data-pricing-section]");if(!Ne(i,o)){a&&(a.style.display="none");return}a&&(a.style.display="");let l=[],d=0;for(let s of i)for(let u of s){let c={unitCents:u.price,quantity:u.quantity||1};l.push(c),d+=c.unitCents*c.quantity}d>0&&t.discountType&&n(r,ze(l,{discountType:t.discountType,discountValue:t.discountValue??0}),d)}function Dr(e){let{container:t,steps:n,selections:r,t:o}=e,i=0;for(let c=0;c<n.length;c++)xe(r,n,c)&&(i+=1);let a=n.length-i,l=t.querySelectorAll("[data-progress] [data-progress-segment]");for(let c=0;c<l.length;c++)l[c].classList.toggle("lb-mix-match__progress-segment--filled",c<i);let d=t.querySelector("[data-progress-count]");d&&(d.textContent=Mr(i,n.length,o));let s=t.querySelector("[data-progress-remaining]");s&&(s.textContent=Pr(a,o));let u=t.querySelector(".lb-mix-match__progress-segments");u&&u.setAttribute("aria-valuenow",String(i))}function Or(e){let t=e.container.querySelector("[data-add-bundle]");if(!t)return;t.disabled=!Ne(e.selections,e.steps);let n=t.querySelector("[data-cta-label]");n&&(n.textContent=t.getAttribute("data-cta-text")||e.t.addToCart||"Add to cart")}function Vr(e){let t=Object.create(null),n=[];for(let r of e)for(let o of r){let i=o.quantity||1,a=String(o.variantId);t[a]?(t[a].quantity+=i,t[a].priceCents=(t[a].priceCents??0)+(o.price||0)*i):(t[a]={variantId:o.variantId,quantity:i,priceCents:(o.price||0)*i},n.push(a))}return n.map(r=>t[r])}var De="__all__",Ii=300,Li=200,Mi=500,Pi=160;function Fr(e){let{container:t,steps:n,selections:r,t:o}=e,i=t.querySelector("[data-modal-overlay]");i&&e.portalTarget&&e.portalTarget.appendChild(i);let a=C=>i?i.querySelector(C):null,l=a('[role="dialog"]'),d=a(".lb-mix-match__modal-title"),s=a("[data-modal-search]"),u=a("[data-modal-search-clear]"),c=a("[data-modal-list]"),p=a("[data-modal-empty]"),h=a("[data-modal-live]"),m=a("[data-modal-close]"),k=a("[data-modal-back]"),B=a("[data-modal-next]"),y=a("[data-modal-done]"),S=a("[data-modal-footer-count]"),N=a("[data-modal-subtitle]"),L=a("[data-modal-step-segments]"),V=a("[data-modal-filters]"),_=De,w=!1,b=0,D=[],H=null,R=null,q=C=>n[C].eligibleProducts||[],$={remainingSpots:()=>Re(r,n,b),ownQty:C=>{let T=_e(r,b,C);return T===-1?0:r[b][T].quantity||0},variantUnitsElsewhere:C=>{let T=0;for(let x of r)for(let v of x)v.variantId===C&&(T+=v.quantity||0);return T},productUnitsElsewhere:(C,T)=>{let x=0;for(let v=0;v<r.length;v++)for(let M of r[v])M.productId===C&&(v===b&&M.variantId===T||(x+=M.quantity||0));return x},swapUnits:(C,T)=>Wt(r,b,C,T,e.rulesMap),isInBundle:C=>_e(r,b,C)!==-1,canRemove:C=>{let T=_e(r,b,C);return T!==-1&&e.canRemove(r[b][T])},isFull:()=>Re(r,n,b)===0,commitQty:(C,T)=>{let x=_e(r,b,C);return x===-1||r[b][x].quantity===T?!1:(r[b][x].quantity=T,!0)}};function G(C){if(!L)return;let T=n[C].minQuantity||1;L.innerHTML="",L.setAttribute("aria-valuemax",String(T));for(let x=0;x<T;x++){let v=document.createElement("span");v.className="lb-mix-match__progress-segment",v.setAttribute("data-progress-segment",""),L.appendChild(v)}J()}function J(){if(!L)return;let C=n[b].minQuantity||1,T=Math.min(ge(r,b),C),x=L.querySelectorAll("[data-progress-segment]");for(let v=0;v<x.length;v++)x[v].classList.toggle("lb-mix-match__progress-segment--filled",v<T);L.setAttribute("aria-valuenow",String(T))}function W(){let C=n[b].minQuantity||1,T=Math.min(ge(r,b),C);S&&(S.textContent=qe(T,C,o)),N&&(N.textContent=Qt(b,n.length,o)+" \xB7 "+(n[b].name||""));let x=xe(r,n,b),v=b===n.length-1;k&&(k.style.display=b>0?"":"none"),B&&(B.style.display=v?"none":"",B.disabled=!x),y&&(y.style.display=v?"":"none",y.disabled=!x),J()}function A(){for(let C of D)C.refresh();W()}function E(){if(!e.autoAdvance||b>=n.length-1||Re(r,n,b)!==0)return;let C=b;R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null,w&&j(C+1)},Pi)}function f(C){if(!c)return;e.dropdown?.unbindAll(c),c.innerHTML="",D=[];let T=q(C);for(let M=0;M<T.length;M++){let z=dt(T[M],M,{t:o,rulesMap:e.rulesMap,capacity:$,showQtySelector:e.showQtySelector,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),A(),E()}});D.push(z),c.appendChild(z.el)}let x=r[C]||[],v=Object.create(null);for(let M of x)v[String(M.productId)]=!0;mt(c,D.map(M=>M.el),M=>v[String(T[M].id)]===!0),e.dropdown?.bindAll(c)}function I(C){let T=C.target.closest("[data-add-product]");if(!T||T.disabled)return;let v=q(b)[parseInt(T.getAttribute("data-add-product")??"",10)];if(!v)return;let M=T.closest(".lb-mix-match__modal-product"),z=M&&M.getAttribute("data-selected-variant-id"),F=(z?v.variants.find(_t=>_t.id===parseInt(z,10)):null)??null;if(F||(F=v.variants.find(_t=>_t.available)??null),!F)return;let X=_e(r,b,F.id);if(X!==-1){if(!e.canRemove(r[b][X]))return;r[b].splice(X,1),e.onSelectionChanged(),A();return}let me=M?.querySelector("[data-row-qty]"),he=me?Math.max(1,parseInt(me.getAttribute("data-qty")||me.textContent||"",10)||1):at(v.id,e.rulesMap,F.id),ne={productId:v.id,variantId:F.id,title:v.title,url:v.url||null,variantTitle:F.title,featuredImage:F.image||v.featuredImage||null,price:F.price,compareAtPrice:F.compareAtPrice||null,unitPrice:F.unitPrice||null,quantity:he},ye=Wt(r,b,v.id,F.id,e.rulesMap);if(ye>0){e.swapVariant(b,ne,Math.min(he,ye)),A();return}let Gt=Re(r,n,b);Gt!==1/0&&he>Gt||(r[b].push(ne),e.onSelectionChanged(),A(),E())}c&&c.addEventListener("click",I);function U(C){if(!V||!e.showTypeFilters)return;let T=[],x=Object.create(null);for(let v of q(C)){let M=(v.type||"").trim();M&&!x[M]&&(x[M]=!0,T.push(M))}if(T.length<2){V.style.display="none",l?.classList.add("lb-mix-match__modal--filters-hidden");return}V.style.display="",l?.classList.remove("lb-mix-match__modal--filters-hidden"),V.innerHTML="";for(let v of[De,...T]){let M=document.createElement("button");M.type="button",M.className="lb-mix-match__filter",M.setAttribute("data-filter",v),M.setAttribute("aria-pressed",v===_?"true":"false"),v===_&&M.classList.add("lb-mix-match__filter--active"),M.textContent=v===De?o.allTypes||"All":v,M.addEventListener("click",()=>{_=v,g(),O(s?s.value:"")}),V.appendChild(M)}}function g(){if(!V)return;let C=V.querySelectorAll("[data-filter]");for(let T=0;T<C.length;T++){let x=C[T].getAttribute("data-filter")===_;C[T].classList.toggle("lb-mix-match__filter--active",x),C[T].setAttribute("aria-pressed",x?"true":"false")}}function O(C){if(!c)return;let T=Se(C),x=c.querySelectorAll("[data-product-item]"),v=0;for(let M=0;M<x.length;M++){let z=x[M].getAttribute("data-title")??"",F=x[M].getAttribute("data-type")||"",X=(!T||z.indexOf(T)!==-1)&&(_===De||F===_);x[M].classList.toggle("lb-hidden",!X),X&&v++}p&&(p.style.display=v===0&&T.length>0?"":"none"),u&&(u.style.display=C.length>0?"":"none"),h&&(h.textContent=Z(o.nProductsShown||"__COUNT__ products shown",{COUNT:v}))}if(s){let C=st(()=>O(s.value),Li);s.addEventListener("input",C)}u&&u.addEventListener("click",()=>{s&&(s.value="",O(""),s.focus())});function j(C,T={}){let x=Math.max(0,Math.min(n.length-1,C));if(R!==null&&(clearTimeout(R),R=null),l&&(H!==null&&clearTimeout(H),H=null,l.removeAttribute("data-step-transition"),T.animate!==!1&&x!==b)){l.offsetHeight,l.setAttribute("data-step-transition",x>b?"forward":"back");let v=l;H=setTimeout(()=>{H=null,v.removeAttribute("data-step-transition")},Mi)}if(b=x,f(b),U(b),_=De,g(),s&&(s.value=""),O(""),c&&(c.scrollTop=0),G(b),A(),h){let v=n[b].minQuantity||1;h.textContent=Qt(b,n.length,o)+". "+(n[b].name||"")+". "+qe(Math.min(ge(r,b),v),v,o)}!T.skipFocus&&d&&typeof d.focus=="function"&&d.focus()}function Q(C){!i||w||(w=!0,j(typeof C=="number"?C:0,{skipFocus:!0,animate:!1}),i.style.display="",i.offsetHeight,i.classList.add("lb-mix-match__modal-overlay--open"),ut(),setTimeout(()=>{m?m.focus():l?.focus()},50))}function K(){if(!i||!w)return;w=!1,R!==null&&(clearTimeout(R),R=null),H!==null&&(clearTimeout(H),H=null),i.classList.remove("lb-mix-match__modal-overlay--open"),pt(),setTimeout(()=>{w||(i.style.display="none")},Ii);let C=x=>x&&x.offsetParent!==null?x:null,T=C(t.querySelector('[data-step-row="'+b+'"]'))||C(t.querySelector("[data-step-door]"))||e.ctaButton;T&&typeof T.focus=="function"&&setTimeout(()=>T.focus(),0)}if(m?.addEventListener("click",K),y?.addEventListener("click",K),k?.addEventListener("click",()=>{b>0&&j(b-1)}),B?.addEventListener("click",()=>{b<n.length-1&&xe(r,n,b)&&j(b+1)}),i){let C=null;i.addEventListener("mousedown",T=>{C=T.target}),i.addEventListener("mouseup",T=>{T.target===i&&C===i&&K(),C=null})}return document.addEventListener("keydown",C=>{if(w){if(C.key==="Escape"){C.preventDefault(),K();return}if(C.key==="Tab"&&l){let T=ct(l);if(T.length===0){C.preventDefault();return}let x=T[0],v=T[T.length-1];C.shiftKey&&document.activeElement===x?(C.preventDefault(),v.focus()):!C.shiftKey&&document.activeElement===v&&(C.preventDefault(),x.focus())}}}),{open:Q,close:K,isOpen:()=>w,refresh:A}}function Bi(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("viewBox","0 0 18 18"),t.setAttribute("fill","none");for(let[n,r,o,i]of[["9","3","9","15"],["3","9","15","9"]]){let a=document.createElementNS(e,"line");a.setAttribute("x1",n),a.setAttribute("y1",r),a.setAttribute("x2",o),a.setAttribute("y2",i),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","2"),a.setAttribute("stroke-linecap","round"),t.appendChild(a)}return t}function Ur(e,t,n,r){let o=t.widgetConfig,i=ae,a=it(t.productRules,t.variantRules),l=t.steps??[];if(!l.length)return;let d={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},s=l.map((b,D)=>Cn(t,D).map(H=>{let R=Ce(H,t.id,{quantities:d,allowedVariantIds:null});return{id:Number(R.productId),title:R.title??"",url:R.url??null,type:H.productType??"",featuredImage:R.featuredImage??null,available:R.variants.some(q=>q.available),optionNames:R.optionNames,variants:R.variants.map(q=>({id:Number(q.id),title:q.title,options:q.options,available:q.available,price:q.price,compareAtPrice:q.compareAtPrice,unitPrice:q.unitPrice,image:q.image,inventoryQuantity:q.inventoryQuantity??null}))}}));if(!(s.length>0&&s.every(b=>b.some(D=>D.available))))return;let c=se(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),p=ce("lb-multi-step",{title:t.title,subtitle:t.description,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||i.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt});p.products.before(et(l.length));let h=document.createElement("div");h.className="lb-multi-step__groups",h.setAttribute("data-step-groups","");let m=document.createElement("button");m.type="button",m.className="lb-mix-match__add-product lb-multi-step__door",m.setAttribute("data-step-door","0");let k=document.createElement("span");k.className="lb-mix-match__add-product-icon",k.setAttribute("aria-hidden","true"),k.appendChild(Bi()),m.appendChild(k);let B=document.createElement("span");B.className="lb-multi-step__door-copy";let y=document.createElement("span");y.className="lb-mix-match__add-product-label",B.appendChild(y);let S=document.createElement("span");S.className="lb-multi-step__door-sub",B.appendChild(S),m.appendChild(B),h.appendChild(m),l.forEach((b,D)=>{let H=document.createElement("section");H.className="lb-multi-step__group",H.setAttribute("data-step-group",String(D)),H.setAttribute("data-step-mode","row");let R=()=>{let E=document.createElement("span");return E.className="lb-multi-step__group-count",E.setAttribute("data-step-count",String(D)),E},q=document.createElement("button");q.type="button",q.className="lb-multi-step__step-row",q.setAttribute("data-step-row",String(D)),q.setAttribute("aria-label","Choose products: "+b.name);let $=document.createElement("span");$.className="lb-multi-step__step-ix",$.setAttribute("aria-hidden","true"),$.textContent=String(D+1),q.appendChild($);let G=document.createElement("span");G.className="lb-multi-step__group-name",G.textContent=b.name,q.appendChild(G),q.appendChild(R()),H.appendChild(q);let J=document.createElement("div");J.className="lb-multi-step__group-heading";let W=document.createElement("span");W.className="lb-multi-step__group-name",W.textContent=b.name,J.appendChild(W),J.appendChild(R()),H.appendChild(J);let A=document.createElement("div");A.className="lb-mix-match__slots lb-edge-fade lb-multi-step__group-slots",A.setAttribute("data-step-slots",String(D)),H.appendChild(A),h.appendChild(H)}),p.products.replaceWith(h);let N=gt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:o.showSearch!==!1,showTypeFilters:o.mixMatchShowTypeFilters!==!1,segmentCount:null,wizard:!0});p.root.appendChild(N);let L=l.map(()=>[]),V={container:p.root,steps:l.map((b,D)=>({name:b.name,minQuantity:b.minQuantity,maxQuantity:b.maxQuantity,eligibleProducts:s[D]})),selections:L,t:i,rulesMap:a,formatMoney:c,onRemove:(b,D)=>{let H=L[b][D];!H||!He(L,H,a)||(L[b].splice(D,1),_(),w.isOpen()&&w.refresh())},onEdit:b=>w.open(b)};function _(){Rr(V),Nr(V),Hr(V,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},ft(c)),Dr(V),Or(V)}let w=Fr({container:p.root,steps:V.steps,selections:L,t:i,rulesMap:a,showQtySelector:o.mixMatchShowQuantitySelector!==!1,showTypeFilters:o.mixMatchShowTypeFilters!==!1,autoAdvance:o.multiStepAutoAdvance===!0,formatMoney:c,dropdown:void 0,portalTarget:null,ctaButton:p.cta,onSelectionChanged:_,swapVariant:(b,D,H)=>{let R=0,q=L[b];for(let $=q.length-1;$>=0&&R<H;$--){let G=q[$];if(G.productId!==D.productId||G.variantId===D.variantId)continue;let J=Math.min(G.quantity||1,H-R);J>=(G.quantity||1)?q.splice($,1):G.quantity=(G.quantity||1)-J,R+=J}R>0&&(D.quantity=R,q.push(D),_())},canRemove:b=>He(L,b,a)});m.addEventListener("click",()=>{w.isOpen()||w.open(parseInt(m.getAttribute("data-step-door")??"",10)||0)}),p.root.querySelectorAll("[data-step-row]").forEach(b=>{b.addEventListener("click",()=>{w.isOpen()||w.open(parseInt(b.getAttribute("data-step-row")??"",10)||0)})}),p.cta.addEventListener("click",()=>{Ne(L,V.steps)&&n(Vr(L).map(b=>({merchandiseId:"gid://shopify/ProductVariant/"+b.variantId,quantity:b.quantity,attributes:de(t.id,t.bundleType)})))}),e.appendChild(p.root),ue(p.root),_(),r?.(fe(p.root))}var qi=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),yt=new Set,vt=!1;function zr(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let n of yt)n.classList.add(e),n.classList.remove(t)}function Qr(e){qi.has(e.key)&&zr("using-keyboard")}function Wr(){zr("using-mouse")}function Ri(){vt||(vt=!0,document.addEventListener("keydown",Qr,!0),document.addEventListener("pointerdown",Wr,!0))}function Ni(){vt&&(vt=!1,document.removeEventListener("keydown",Qr,!0),document.removeEventListener("pointerdown",Wr,!0))}function wt(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),yt.add(e),Ri(),()=>{yt.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),yt.size===0&&Ni()}}var jt=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
|
|
282
|
+
`;var le=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},Kt={none:0,subtle:6,rounded:12,round:18},ie={header:{countdownBgColor:"#B4DC7F47",countdownTextColor:"#555555"},layout:{backgroundColor:"#FCFCFC",borderColor:"#E5E5E5",borderWidth:1,borderRadius:"subtle"},productList:{textColor:"#555555",thumbnailRatio:"square",showPrice:!0,showCompareAtPrice:!0,showUnitPrice:!0,showQuantity:!0},pricing:{showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#B4DC7F",buttonTextColor:"#555555",borderWidth:0,borderColor:"#B4DC7F"},savingsBar:{visible:!0},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A"},showLowStockBadge:!0,lowStockThreshold:10,lowStockBgColor:"#FEF3C7",lowStockTextColor:"#92400E",showSearch:!0,mixMatchShowTypeFilters:!0,mixMatchShowQuantitySelector:!0,pickerBgColor:"#FCFCFC",pickerTextColor:"#555555",pickerBorderWidth:1,pickerBorderColor:"#E5E5E5",pickerBorderRadius:"subtle",pickerThumbnailRatio:"square",pickerAddBgColor:"#B4DC7F",pickerAddLabelColor:"#555555",pickerAddBorderWidth:0,pickerAddBorderColor:"#B4DC7F",multiStepAutoAdvance:!1,defaultTier:"first"};function so(e){if(!e||typeof e!="object")return ie;let t=e;return{...ie,...t,defaultTier:co(t.defaultTier),pickerBorderRadius:Yt(t.pickerBorderRadius),header:{...ie.header,...t.header??{}},layout:{...ie.layout,...t.layout??{},borderRadius:Yt(t.layout?.borderRadius)},productList:{...ie.productList,...t.productList??{}},pricing:{...ie.pricing,...t.pricing??{}},cta:{...ie.cta,...t.cta??{}},savingsBar:{...ie.savingsBar,...t.savingsBar??{}},countdown:{...ie.countdown,...t.countdown??{}},popularBadge:{...ie.popularBadge,...t.popularBadge??{}}}}function co(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:ie.defaultTier}function Yt(e){return e==="none"||e==="subtle"||e==="rounded"||e==="round"?e:ie.layout.borderRadius}function uo(e){return{primaryColor:e.cta.primaryColor,backgroundColor:e.layout.backgroundColor,textColor:e.productList.textColor,borderColor:e.layout.borderColor,borderWidth:e.layout.borderWidth,buttonTextColor:e.cta.buttonTextColor,ctaBorderWidth:e.cta.borderWidth,ctaBorderColor:e.cta.borderColor,borderRadius:Kt[e.layout.borderRadius],countdownBgColor:e.header.countdownBgColor,countdownTextColor:e.header.countdownTextColor,thumbnailRatio:e.productList.thumbnailRatio,showProductPrice:e.productList.showPrice,showProductCompareAtPrice:e.productList.showCompareAtPrice,showProductUnitPrice:e.productList.showUnitPrice,showProductQuantity:e.productList.showQuantity,showCountdown:e.countdown.showCountdown,ctaText:e.cta.ctaText,showLowStockBadge:e.showLowStockBadge,lowStockThreshold:e.lowStockThreshold,lowStockBgColor:e.lowStockBgColor,lowStockTextColor:e.lowStockTextColor,showComparePrice:e.pricing.showComparePrice,showPerUnitPrice:e.pricing.showPerUnitPrice,showItemCount:e.pricing.showItemCount,showCompareAtPrice:e.pricing.showCompareAtPrice,showMostPopular:e.popularBadge.visible,popularBadgeText:e.popularBadge.text,popularBadgeBgColor:e.popularBadge.bgColor,popularBadgeTextColor:e.popularBadge.textColor,popularBadgeBorderWidth:e.popularBadge.borderWidth,popularBadgeBorderColor:e.popularBadge.borderColor,showSearch:e.showSearch,mixMatchShowTypeFilters:e.mixMatchShowTypeFilters,pickerBgColor:e.pickerBgColor,pickerTextColor:e.pickerTextColor,pickerBorderWidth:e.pickerBorderWidth,pickerBorderColor:e.pickerBorderColor,pickerBorderRadius:Kt[e.pickerBorderRadius],pickerThumbnailRatio:e.pickerThumbnailRatio,pickerAddBgColor:e.pickerAddBgColor,pickerAddLabelColor:e.pickerAddLabelColor,pickerAddBorderWidth:e.pickerAddBorderWidth,pickerAddBorderColor:e.pickerAddBorderColor,defaultTier:e.defaultTier,...e.popularBadge.tierIndex!==void 0&&{mostPopularTierIndex:e.popularBadge.tierIndex}}}var po={primaryColor:"--lb-primary-color",backgroundColor:"--lb-bg",textColor:"--lb-text",borderColor:"--lb-border",borderWidth:"--lb-border-width",buttonTextColor:"--lb-btn-text",borderRadius:"--lb-radius",countdownBgColor:"--lb-countdown-bg",countdownTextColor:"--lb-countdown-text",ctaBorderWidth:"--lb-cta-border-width",ctaBorderColor:"--lb-cta-border-color",popularBadgeBgColor:"--lb-popular-badge-bg",popularBadgeTextColor:"--lb-popular-badge-text",popularBadgeBorderWidth:"--lb-popular-badge-border-width",popularBadgeBorderColor:"--lb-popular-badge-border-color",pickerBgColor:"--lb-picker-bg",pickerTextColor:"--lb-picker-text",pickerBorderWidth:"--lb-picker-border-width",pickerBorderColor:"--lb-picker-border-color",pickerBorderRadius:"--lb-picker-radius",pickerAddBgColor:"--lb-picker-add-bg",pickerAddLabelColor:"--lb-picker-add-label",pickerAddBorderWidth:"--lb-picker-add-border-width",pickerAddBorderColor:"--lb-picker-add-border-color"},mo=new Set(["borderRadius","borderWidth","ctaBorderWidth","popularBadgeBorderWidth","pickerBorderWidth","pickerBorderRadius","pickerAddBorderWidth"]);function gn(e,t){let n=uo(t);for(let[i,a]of Object.entries(po)){let l=n[i];if(l==null)continue;let d=mo.has(i)?`${l}px`:String(l);e.style.setProperty(a,d)}e.style.setProperty("--lb-product-price-display",t.productList.showPrice?"block":"none"),e.style.setProperty("--lb-product-compare-display",t.productList.showCompareAtPrice?"inline":"none"),e.style.setProperty("--lb-product-unit-price-display",t.productList.showUnitPrice?"block":"none"),e.style.setProperty("--lb-product-qty-chip-display",t.productList.showQuantity?"inline-flex":"none"),e.style.setProperty("--lb-product-qty-inline-display",t.productList.showQuantity?"inline":"none"),e.style.setProperty("--lb-variant-chevron",Jt(t.layout.borderColor)),e.style.setProperty("--lb-picker-variant-chevron",Jt(t.pickerBorderColor));let r=Xt(t.productList.thumbnailRatio);e.style.setProperty("--lb-thumbnail-aspect-ratio",r.aspectRatio),e.style.setProperty("--lb-thumbnail-img-fit",r.imgFit),e.style.setProperty("--lb-thumbnail-img-height",r.imgHeight);let o=Xt(t.pickerThumbnailRatio);e.style.setProperty("--lb-picker-thumbnail-aspect-ratio",o.aspectRatio),e.style.setProperty("--lb-picker-thumbnail-img-fit",o.imgFit),e.style.setProperty("--lb-picker-thumbnail-img-height",o.imgHeight)}function Jt(e){return`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='${e.replace(/#/g,"%23")}' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")`}function Xt(e){switch(e){case"tall":return{aspectRatio:"3 / 4",imgFit:"cover",imgHeight:"100%"};case"wide":return{aspectRatio:"4 / 3",imgFit:"cover",imgHeight:"100%"};case"original":return{aspectRatio:"auto",imgFit:"contain",imgHeight:"auto"};default:return{aspectRatio:"1 / 1",imgFit:"cover",imgHeight:"100%"}}}var bo=new Set(["fixed","mix_match","volume","bogo","multi_step"]),ho=new Set(["active"]);function At(e,t){try{return fo(e,t)}catch(n){if(n instanceof le)return null;throw n}}function fo(e,t){let n=new Map(t.map(k=>[k.key,k])),r=n.get("title")?.value??"Bundle",o=n.get("bundle_type")?.value,i=n.get("status")?.value;if(!o||!bo.has(o))throw new le(`Invalid or missing bundle_type: ${o??"null"}`,"invalid_type");let a=o;if(!i||!ho.has(i))throw new le(`Bundle is not active: status=${i??"null"}`,"inactive");let l=i,d=n.get("starts_at")?.value??null,s=n.get("ends_at")?.value??null,u=new Date;if(d){let k=new Date(d);if(Number.isNaN(k.getTime()))throw new le(`Invalid starts_at: ${d}`,"invalid_type");if(k>u)throw new le(`Bundle not yet started: starts_at=${d}`,"not_started")}if(s){let k=new Date(s);if(Number.isNaN(k.getTime()))throw new le(`Invalid ends_at: ${s}`,"invalid_type");if(k<u)throw new le(`Bundle has expired: ends_at=${s}`,"expired")}let c=vo(n),p=wo(n),h=_o(n),m={id:e,title:r,description:n.get("description")?.value||null,status:l,products:c,discountConfig:p,widgetConfig:h,startsAt:d,endsAt:s,discountLabel:n.get("discount_label")?.value??null,selectedVariantIds:Co(n),productQuantities:Zt(n,"product_quantities"),variantQuantities:Zt(n,"variant_quantities"),marketVisibility:ko(n),marketIds:To(n),countryCodes:St(n,"country_codes"),companyLocationIds:St(n,"company_location_ids"),abTestId:n.get("ab_test_id")?.value||null,abWeight:So(n)};switch(a){case"fixed":return{...m,bundleType:"fixed"};case"volume":return{...m,bundleType:"volume",volumeTiers:Eo(n)};case"mix_match":return{...m,bundleType:"mix_match",minQuantity:Io(n,"min_quantity",{min:1}),maxQuantity:null,productRules:Ve(n,"product_rules"),variantRules:Ve(n,"variant_rules")};case"bogo":return{...m,bundleType:"bogo",...yo(n)};case"multi_step":return{...m,bundleType:"multi_step",steps:go(n),productRules:Ve(n,"product_rules"),variantRules:Ve(n,"variant_rules"),collectionProductIds:xo(n)}}}function go(e){let t=ve(e,"steps");if(!Array.isArray(t))throw new le("Invalid or missing steps","invalid_type");let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string"):[],r=[];for(let o of t){if(!o||typeof o!="object"||Array.isArray(o))continue;let i=o;if(typeof i.name!="string")continue;let a=typeof i.minQuantity=="number"?i.minQuantity:Number(i.minQuantity),l=Number.isFinite(a)&&a>=1?Math.floor(a):1,d=null;typeof i.maxQuantity=="number"&&Number.isFinite(i.maxQuantity)&&(d=Math.max(l,Math.floor(i.maxQuantity))),r.push({name:i.name,minQuantity:l,maxQuantity:d,productIds:n(i.productIds),collectionIds:n(i.collectionIds)})}if(r.length===0)throw new le("multi_step bundle has no valid steps","invalid_type");return r}function xo(e){let t={},n=e.get("collection");if(!n?.references?.nodes)return t;for(let r of n.references.nodes)!("products"in r)||!r.products?.nodes||(t[r.id]=r.products.nodes.map(o=>o.id));return t}function yo(e){let t=ve(e,"bogo_config");if(!t||typeof t!="object"||Array.isArray(t))throw new le("Invalid or missing bogo_config","invalid_type");let n=t,r=typeof n.buyProductId=="string"?n.buyProductId:"",o=typeof n.getProductId=="string"?n.getProductId:"";if(!r||!o)throw new le("bogo_config is missing buy/get product ids","invalid_type");let i=l=>{let d=typeof l=="number"?l:Number(l);return!Number.isFinite(d)||d<1?1:Math.min(99,Math.floor(d))},a=l=>Array.isArray(l)?l.filter(d=>typeof d=="string"):[];return{buyProductId:r,getProductId:o,buyQuantity:i(n.buyQuantity),getQuantity:i(n.getQuantity),buyVariantIds:a(n.buyVariantIds),getVariantIds:a(n.getVariantIds)}}function vo(e){let t=[],n=e.get("products");if(n?.reference&&"variants"in n.reference&&t.push(n.reference),n?.references?.nodes)for(let o of n.references.nodes)"variants"in o?t.push(o):"products"in o&&o.products?.nodes&&t.push(...o.products.nodes);let r=e.get("collection");if(r?.references?.nodes)for(let o of r.references.nodes)"products"in o&&o.products?.nodes&&t.push(...o.products.nodes);return t}function wo(e){return{discountType:e.get("discount_type")?.value??"percentage",discountValue:parseFloat(e.get("discount_value")?.value??"0"),allowStacking:e.get("allow_stacking")?.value==="true"}}function _o(e){return so(ve(e,"widget_config"))}function Co(e){let t=ve(e,"selected_variant_ids");if(!Array.isArray(t))return null;let n=[];for(let r of t)Array.isArray(r)?n.push(r.filter(o=>typeof o=="string")):n.push([]);return n}function Zt(e,t){let n=ve(e,t);if(!n||typeof n!="object"||Array.isArray(n))return{};let r={};for(let[o,i]of Object.entries(n)){let a=typeof i=="number"?i:Number(i);Number.isFinite(a)&&a>=0&&a<=99&&(r[o]=Math.floor(a))}return r}function Ve(e,t){let n=ve(e,t);if(!n||typeof n!="object"||Array.isArray(n))return{};let r={};for(let[o,i]of Object.entries(n)){if(!i||typeof i!="object"||Array.isArray(i))continue;let{min:a,max:l,required:d}=i,s=typeof a=="number"?a:Number(a),u=typeof l=="number"?l:Number(l);if(!Number.isFinite(s)||!Number.isFinite(u))continue;let c=Math.max(1,Math.min(99,Math.floor(s))),p=Math.max(c,Math.min(99,Math.floor(u)));r[o]=d===!0?{min:c,max:p,required:!0}:{min:c,max:p}}return r}function ko(e){return e.get("market_visibility")?.value==="specific"?"specific":"all"}function To(e){return St(e,"markets")}function St(e,t){let n=e.get(t)?.value;if(!n)return[];try{let r=JSON.parse(n);return Array.isArray(r)?r.filter(o=>typeof o=="string"):[]}catch{return[]}}function So(e){let t=e.get("ab_weight")?.value;if(!t)return 0;let n=Number.parseInt(t,10);return Number.isNaN(n)?0:Math.min(100,Math.max(0,n))}function Eo(e){let t=ve(e,"volume_tiers");return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null).map(Ao):[]}function Ao(e){let t=Number(e.minQuantity??0),n={minQuantity:Number.isFinite(t)&&t>=0?t:0};return typeof e.percentage=="number"&&Number.isFinite(e.percentage)&&(n.percentage=e.percentage),typeof e.amount=="number"&&Number.isFinite(e.amount)&&(n.amount=e.amount),n}function ve(e,t){let n=e.get(t)?.value;if(!n)return null;try{return JSON.parse(n)}catch{return null}}function Io(e,t,n={}){let r=e.get(t)?.value;if(!r)return null;let o=parseInt(r,10);return isNaN(o)||n.min!==void 0&&o<n.min?null:o}function Lo(e){let t=typeof e=="string"?parseFloat(e):e;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:1}function It(e,t){let n=Lo(t);if(n===1)return e;let r={...e};return e.discountConfig.discountType!=="percentage"&&(r.discountConfig={...e.discountConfig,discountValue:e.discountConfig.discountValue*n}),"volumeTiers"in e&&Array.isArray(e.volumeTiers)&&(r.volumeTiers=e.volumeTiers.map(o=>typeof o.amount=="number"?{...o,amount:o.amount*n}:o)),r}function xn(e,t){let n=0,r=0;for(let o=0;o<e.length;o++){let i=t==="fixed_amount"?e[o].amount??0:e[o].percentage??0;i>n&&(n=i,r=o)}return r}function yn(e,t,n){return t<=0?0:e==="best_value"?Math.min(n,t-1):Math.max(0,Math.min(Math.floor(typeof e=="number"?e:0),t-1))}function vn(e,t,n){return t?typeof e=="number"&&Number.isFinite(e)?Math.floor(e):n:-1}var Mo="*";function Ue(e){return e.split("/").pop()??e}function en(e,t,n){if(!e||e.length===0)return!1;if(e.includes(Mo))return!0;if(!t)return!1;if(!n)return e.includes(t);let r=Ue(t);return e.some(o=>Ue(o)===r)}function wn(e,t){if(e.marketVisibility!=="specific"||en(e.countryCodes,t.countryCode,!1)||t.companyLocationId&&en(e.companyLocationIds,t.companyLocationId,!0))return!0;if(t.marketId){let n=Ue(t.marketId);if(e.marketIds.some(r=>Ue(r)===n))return!0}return!1}function Po(e,t){return e===t?!0:/^\d+$/.test(t)&&e.endsWith(`/${t}`)}function _n(e,t){let n=t?.productId?.trim();if(n){let o=e.find(i=>Po(i.id,n));if(o)return o}let r=t?.productHandle?.trim();if(r){let o=e.find(i=>i.handle===r);if(o)return o}return e[0]}function Lt(e,t,n){let r=e.variantQuantities[n];return r!==void 0?r:e.productQuantities[t]??1}function Cn(e,t){let n=e.steps[t];if(!n)return[];let r=new Set(n.productIds),o=new Set;for(let l of n.collectionIds)for(let d of e.collectionProductIds[l]??[])o.add(d);let i=new Set,a=[];for(let l of e.products)i.has(l.id)||!r.has(l.id)&&!o.has(l.id)||(i.add(l.id),a.push(l));return a}async function kn(e,t){await En(e,{shopDomain:e.shopDomain,eventType:"bundle_impression",bundleGid:t.bundleGid,bundleType:t.bundleType,productId:t.productId,occurredAt:new Date().toISOString()})}async function Tn(e,t){await En(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function Sn(e,t){if(typeof IntersectionObserver>"u")return t(),()=>{};let n=new IntersectionObserver(r=>{for(let o of r)o.isIntersecting&&(t(),n.unobserve(o.target))},{threshold:.5});return n.observe(e),()=>n.disconnect()}async function En(e,t){let n=`${e.appUrl}/api/analytics`,r=JSON.stringify(t);try{(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:r})).ok||(await new Promise(i=>setTimeout(i,2e3)),await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:r}))}catch{try{typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(n,r)}catch{}}}var tn=1e4,Bo=[[/@import/i,"@import rules"],[/@charset/i,"@charset declarations"],[/expression\s*\(/i,"CSS expressions"],[/-moz-binding/i,"-moz-binding"],[/-webkit-binding/i,"-webkit-binding"],[/behavior\s*:/i,"behavior property"]],qo=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function Mt(e){if(e.length>tn)return{ok:!1,error:`CSS exceeds ${tn.toLocaleString("en-US")} character limit`};let t=e.replace(/\/\*[\s\S]*?\*\//g,"");try{t=t.replace(/\\([0-9a-fA-F]{1,6})[ \t\n\f]?/g,(o,i)=>{let a=parseInt(i,16);return a<0||a>1114111?"\uFFFD":String.fromCodePoint(a)}),t=t.replace(/\\\r?\n/g,""),t=t.replace(/\\([^\n\r\f0-9a-fA-F])/g,"$1")}catch{return{ok:!1,error:"CSS contains invalid unicode escape sequences"}}t=t.replace(/</g,"").replace(/>/g,"");for(let[o,i]of Bo)if(o.test(t))return{ok:!1,error:`CSS contains blocked pattern: ${i}`};let n=/url\s*\(\s*([\s\S]*?)\s*\)/gi,r;for(;(r=n.exec(t))!==null;){let o=r[1].trim();if((o.startsWith("'")||o.startsWith('"'))&&(o=o.slice(1)),(o.endsWith("'")||o.endsWith('"'))&&(o=o.slice(0,-1)),o=o.trim(),o&&!qo.test(o))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Ro="lb-custom-css-";function An(e,t){if(typeof document>"u"||!t)return!1;let n=Mt(t);if(!n.ok||!n.css.trim())return!1;let r=Ro+No(e),o=document.getElementById(r);return o||(o=document.createElement("style"),o.id=r,o.setAttribute("data-lime-bundles","custom-css"),document.head.appendChild(o)),o.textContent!==n.css&&(o.textContent=n.css),!0}function No(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function Ho(e,t){let n=typeof e=="string"?parseFloat(e):e;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(n)}catch{return`${t} ${n.toFixed(2)}`}}var Do={CL:"cl",CM:"cm",FLOZ:"fl oz",FT:"ft",FT2:"ft\xB2",G:"g",GAL:"gal",IN:"in",ITEM:"each",KG:"kg",L:"l",LB:"lb",M:"m",M2:"m\xB2",M3:"m\xB3",MG:"mg",ML:"ml",MM:"mm",OZ:"oz",PT:"pt",QT:"qt",UNKNOWN:"",YD:"yd"};function In(e,t,n){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let r=parseFloat(e.amount);if(!Number.isFinite(r))return null;let o=Do[t.referenceUnit]??"";if(!o)return null;let i=e.currencyCode||n||"USD",a=Ho(r,i),l=t.referenceValue,d=l===1?o:`${l}${o}`;return`${a}/${d}`}function Oo(e,t){return Math.max(0,e-Math.floor(e*t/100))}function ze(e,t){if(t.discountType==="percentage"){let r=0;for(let o of e)r+=Oo(o.unitCents,t.discountValue)*o.quantity;return Math.max(0,r)}let n=0;for(let r of e)n+=r.unitCents*r.quantity;if(t.discountType==="flat_price"){let r=Math.round(t.discountValue*100);return Math.max(0,Math.min(r,n))}return Math.max(0,n-Math.round(t.discountValue*100))}var we={};ln(we,{computePosition:()=>Fo,emptyTypeAheadState:()=>jo,firstEnabled:()=>Fe,handleKey:()=>Qo,pushTypeAheadChar:()=>Go});var Vo=4;function Fo({trigger:e,viewportHeight:t,desiredHeight:n,margin:r=Vo,clip:o}){let i=o?Math.min(t,o.bottom):t,a=o?Math.max(0,o.top):0,l=Math.max(0,i-e.bottom-r),d=Math.max(0,e.top-a-r),s=n<=l?"down":d>l?"up":"down",c=Math.min(n,s==="down"?l:d),p=s==="down"?e.bottom+r:e.top-r-c;return{placement:s,maxHeight:c,offsetTop:p,offsetLeft:e.left,width:e.width}}var kt={type:"passthrough",preventDefault:!1};function Fe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function nn(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Uo(e,t){if(e.length===0)return-1;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r].disabled)return r}return t}function zo(e,t){if(e.length===0)return-1;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r].disabled)return r}return t}function rn(e){return e.length===1&&e!==" "&&/\S/.test(e)}function Qo(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return kt;let{key:n}=e,{isOpen:r,activeIndex:o,selectedIndex:i,options:a}=t;if(!r)switch(n){case"Enter":case" ":case"ArrowDown":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Fe(a),preventDefault:!0};case"ArrowUp":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:nn(a),preventDefault:!0};default:return rn(n)?{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Fe(a),preventDefault:!0}:kt}switch(n){case"ArrowDown":return{type:"move-active",activeIndex:Uo(a,o),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:zo(a,o),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:Fe(a),preventDefault:!0};case"End":return{type:"move-active",activeIndex:nn(a),preventDefault:!0};case"Enter":case" ":return o>=0&&!a[o]?.disabled?{type:"commit",index:o,preventDefault:!0}:{type:"passthrough",preventDefault:!0};case"Escape":return{type:"close",commit:!1,restoreFocus:!0,preventDefault:!0};case"Tab":return{type:"close",commit:!1,restoreFocus:!1,preventDefault:!1};default:return rn(n)?{type:"type-ahead",char:n,preventDefault:!1}:kt}}var Wo=500;function jo(){return{buffer:"",lastTime:0}}function Go(e,t,n,r,o=Wo){if(t.length!==1)return{newState:e,matchedIndex:null};let a=(n-e.lastTime>o?"":e.buffer)+t.toLowerCase(),l={buffer:a,lastTime:n};for(let d=0;d<r.length;d++){let s=r[d];if(!s.disabled&&s.label.toLowerCase().startsWith(a))return{newState:l,matchedIndex:d}}return{newState:l,matchedIndex:null}}var $o={};ln($o,{findVariantByOptions:()=>Ko,isOptionValueAvailable:()=>Yo,toPickerVariant:()=>Jo});function Ln(e){return e.availableForSale&&!e.currentlyNotInStock&&e.quantityAvailable!=null&&e.quantityAvailable<=0}function Ae(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null||Ln(e)?!0:e.quantityAvailable>=t:!1}function Qe(e){return e.currentlyNotInStock||e.quantityAvailable==null||Ln(e)?null:Math.max(0,e.quantityAvailable)}function Ko(e,t){if(e.length===0)return null;for(let n of e){if(n.optionValues.length!==t.length)continue;let r=!0;for(let o=0;o<n.optionValues.length;o++)if(n.optionValues[o]!==t[o]){r=!1;break}if(r)return n}return null}function Yo(e,t,n,r){for(let o of e){if(!o.available||o.optionValues[t]!==n)continue;let i=!0;for(let a=0;a<o.optionValues.length;a++)if(a!==t&&o.optionValues[a]!==r[a]){i=!1;break}if(i)return!0}return!1}function Jo(e,t){return{id:e.id,optionValues:e.selectedOptions.map(n=>n.value),available:t!==void 0?Ae(e,t):e.availableForSale}}var on="_lb_v",Tt=null;function Xo(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t>>>=0;return t>>>0}function Mn(){try{let e=window.localStorage.getItem(on);if(e)return e;let t=an();return window.localStorage.setItem(on,t),t}catch{return Tt||(Tt=an()),Tt}}function an(){return Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,10)}function Zo(e,t,n){let r=e.slice().sort((a,l)=>a.id<l.id?-1:a.id>l.id?1:0),o=Xo(t+":"+n)%100,i=0;for(let a of r)if(i+=Math.max(0,a.abWeight),o<i)return a;return r[r.length-1]}function Pn(e,t){let n=new Map;for(let o of e){if(!o.abTestId)continue;let i=n.get(o.abTestId);i?i.push(o):n.set(o.abTestId,[o])}if(n.size===0)return e.slice();let r=new Map;return n.forEach((o,i)=>{if(o.length===1){r.set(i,o[0]);return}r.set(i,Zo(o,t,i))}),e.filter(o=>!o.abTestId||r.get(o.abTestId)===o)}function se(e){return t=>{try{return new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(t/100)}catch{return e+" "+(t/100).toFixed(2)}}}var We="_lime_bundle_gid",ei="_lime_bundle_type",Bn="_lime_bundle_role",qn="get";function de(e,t){return[{key:We,value:e},{key:ei,value:t}]}var ti=["MERCHANDISE_NOT_ENOUGH_STOCK","MERCHANDISE_OUT_OF_STOCK"];function Rn(e){return!!e.code&&ti.indexOf(e.code)!==-1}function Nn(e){let t=e||[];for(let n=0;n<t.length;n++)if(Rn(t[n]))return!0;return!1}function Hn(e){let t=e||[];for(let n=0;n<t.length;n++){let r=t[n];if(Rn(r)&&r.message)return r.message}}function Pt(e){let t=Object.create(null);for(let n=0;n<e.length;n++){let r=e[n];t[r.variantId]=(t[r.variantId]||0)+(r.quantity||0)}return t}function Dn(e,t,n){let r=Pt(e),o=Pt(t),i=Pt(n);for(let a in r)if((i[a]||0)-(o[a]||0)<r[a])return!0;return!1}var ae={locale:"en",addItem:"Add",addedItem:"Added",removeItem:"Remove",swapItem:"Swap",required:"Required",soldOut:"Sold out",outOfStock:"Out of stock",itemsOutOfStock:{one:"__COUNT__ item out of stock",other:"__COUNT__ items out of stock"},cartStockError:"This bundle couldn't be added to your cart. __MESSAGE__",quantity:"Quantity",increaseQuantity:"Increase quantity",decreaseQuantity:"Decrease quantity",allTypes:"All",editSelection:"Edit selection",addToCart:"Add to cart",bundlePrice:"Bundle total",save:"You save",complete:"Complete",ofSelected:"__COUNT__ of __TOTAL__ added",moreToGo:"__COUNT__ more to go",nProductsShown:"__COUNT__ products shown",bundleComplete:"Your bundle is complete",chooseMoreUnlock:"Choose __COUNT__ more to unlock __PCT__% off",chooseMoreComplete:"Choose __COUNT__ more to complete your bundle",stepOf:"Step __STEP__ of __TOTAL__",stepsCompleted:"__COUNT__ of __TOTAL__ steps completed",doorChoose:"Choose your products",doorContinue:"Continue building",doorQuickSteps:{one:"__COUNT__ quick step",other:"__COUNT__ quick steps"},doorStepsToGo:{one:"__COUNT__ step to go",other:"__COUNT__ steps to go"},each:" each",buyQty:"Buy __COUNT__",itemCount:{one:"__COUNT__ item",other:"__COUNT__ items"},needsSpots:{one:"Needs __COUNT__ spot",other:"Needs __COUNT__ spots"}};function je(e,t){let n=e.itemsOutOfStock,r;if(n&&typeof n=="object"){let o=new Intl.PluralRules(e.locale||"en").select(t);r=n[o]||n.other}else r=n;return(r||"__COUNT__ items out of stock").split("__COUNT__").join(String(t))}var ni="This bundle couldn't be added to your cart. __MESSAGE__";function On(e,t){let n=(e||"").trim()||ni,r=(t||"").trim();return(n.indexOf("__MESSAGE__")===-1?n+" "+r:n.split("__MESSAGE__").join(r)).replace(/\s+/g," ").trim()}function Vn(e){let t=e.slice(e.lastIndexOf("/")+1),n=Number(t);return Number.isFinite(n)&&t!==""?n:e}function Ge(e){if(!e)return 0;let t=parseFloat(e);return Number.isFinite(t)?Math.round(t*100):0}function ri(e){let t=e?.width,n=e?.height;return typeof t!="number"||typeof n!="number"||t<=0||n<=0?null:t/n}function oi(e,t,n){return{id:Vn(e.id),title:e.title,options:(e.selectedOptions??[]).map(r=>r.value),available:Ae(e,t),price:Ge(e.price?.amount),compareAtPrice:Ge(e.compareAtPrice?.amount),unitPrice:In(e.unitPrice,e.unitPriceMeasurement,n),image:e.image?.url??null,inventoryQuantity:Qe(e)}}function Ce(e,t,n){let r=n.allowedVariantIds,o=e.variants.nodes.filter(s=>!r||r.length===0||r.includes(s.id)),i=e.priceRange.minVariantPrice.currencyCode,a=Lt(n.quantities,e.id,o[0]?.id??""),l=o.map(s=>{let u=Lt(n.quantities,e.id,s.id),c=oi(s,u,i);return u!==a&&(c.quantity=u),c}),d=l.find(s=>s.available)??l[0];return{productId:Vn(e.id),title:e.title,url:e.handle?"/products/"+e.handle:null,featuredImage:e.featuredImage?.url??null,featuredImageRatio:ri(e.featuredImage),quantity:a,selectedVariantId:d?d.id:"",optionNames:(o[0]?.selectedOptions??[]).map(s=>s.name),variants:l}}function $e(e){return e.products.map((t,n)=>Ce(t,e.id,{quantities:{productQuantities:e.productQuantities,variantQuantities:e.variantQuantities},allowedVariantIds:e.selectedVariantIds?.[n]??null}))}function ee(e,t){for(let n=0;n<e.variants.length;n++)if(String(e.variants[n].id)===String(t))return e.variants[n];return e.variants[0]}function Fn(e){let t=ee(e,e.selectedVariantId);if(t&&t.available!==!1)return t;for(let n=0;n<e.variants.length;n++)if(e.variants[n].available!==!1)return e.variants[n];return null}function Un(e,t){if(!e.variants||!t)return null;for(let n=0;n<e.variants.length;n++){let r=e.variants[n];if(!r.options||r.options.length!==t.length)continue;let o=!0;for(let i=0;i<r.options.length;i++)if(r.options[i]!==t[i]){o=!1;break}if(o)return r}return null}function zn(e,t,n,r){for(let o=0;o<e.length;o++){let i=e[o];if(i.available===!1||!i.options||i.options[t]!==n)continue;let a=!0;for(let l=0;l<i.options.length;l++)if(l!==t&&i.options[l]!==r[l]){a=!1;break}if(a)return!0}return!1}function Qn(e){let t=[];for(let n=0;n<e.length;n++){let r=ee(e[n],e[n].selectedVariantId),o=r.quantity||e[n].quantity||1;t.push({variantId:Number(e[n].selectedVariantId),quantity:o,priceCents:(r.price||0)*o})}return t}function ii(e,t,n){let r=0,o=0;for(let i=0;i<e.length;i++){let a=ee(e[i],e[i].selectedVariantId),l=a.quantity||e[i].quantity||1,d=a.price*l;if(r+=d,t==="percentage"){let s=Math.floor(a.price*n/100);o+=(a.price-s)*l}else o+=d}if(t==="fixed_amount"&&(o=Math.max(0,r-Math.round(n*100))),t==="flat_price"){let i=Math.round(n*100);o=i<r?i:r}return{totalPrice:r,salePrice:o,savings:r-o}}function Bt(e,t,n){let r=e.classList?.contains("lb-fixed")?e:e.querySelector(".lb-fixed");if(!r)return;let{totalPrice:o,salePrice:i,savings:a}=ii(t,r.getAttribute("data-discount-type")||"",parseFloat(r.getAttribute("data-discount-value")??"")||0),l=e.querySelector("[data-sale-price]"),d=e.querySelector("[data-compare-price]"),s=e.querySelector("[data-savings-bar]"),u=e.querySelector("[data-savings-amount]"),c=e.querySelector("[data-savings-percent]");if(l&&(l.textContent=n(i)),d&&(a>0?(d.textContent=n(o),d.style.display=""):d.style.display="none"),s)if(a>0){if(u&&(u.textContent=n(a)),c){let p=o>0?Math.round(a*100/o):0;c.textContent="("+p+"%)"}s.style.display="",s.classList.remove("lb-savings-pending")}else s.style.display="none"}function Ke(e,t,n){let r=e.querySelectorAll("[data-variant-option]");if(!r.length)return;function o(s){return parseInt(s.getAttribute("data-option-position")??"",10)}function i(){let s=[];for(let u=0;u<r.length;u++){let c=o(r[u]);!c||c<1||(s[c-1]=r[u].value)}return s}function a(s){if(!(!s||!s.options))for(let u=0;u<r.length;u++){let c=o(r[u]);if(!c||c<1)continue;let p=s.options[c-1];r[u].value!==p&&(r[u].value=p)}}function l(s,u){for(let c=0;c<r.length;c++){let p=r[c],h=o(p);if(!h||h<1)continue;let m=p.options;for(let k=0;k<m.length;k++)m[k].disabled=!zn(s.variants,h-1,m[k].value,u)}}let d=t();if(d){let s=ee(d,d.selectedVariantId);s&&s.options&&l(d,s.options)}for(let s=0;s<r.length;s++)r[s].addEventListener("change",u=>{u.stopPropagation();let c=t();if(!c)return;let p=Un(c,i());if(!p){let h=ee(c,c.selectedVariantId);a(h),h&&h.options&&l(c,h.options);return}c.selectedVariantId=p.id,l(c,p.options),n(p,c)})}function Ye(e,t,n){if(!t.variants.length)return;let r=e.querySelector(".lb-bundle-variant-badge");r&&!r.textContent&&(r.textContent=n.title);let o=e.querySelector(".lb-bundle-variant-option-groups");o&&!o.children.length&&ai(o,t,n)}function ai(e,t,n){let r=t.optionNames||[];for(let o=0;o<r.length;o++){let i=document.createElement("div");i.className="lb-bundle-variant-option-group";let a=document.createElement("span");a.className="lb-bundle-variant-option-label",a.textContent=r[o],i.appendChild(a);let l=document.createElement("select");l.className="lb-bundle-variant-select",l.setAttribute("data-variant-option",""),l.setAttribute("data-option-position",String(o+1)),l.setAttribute("data-product-id",String(t.productId)),l.name="lb-variant-"+t.productId+"-"+(o+1),l.setAttribute("aria-label",r[o]);let d=Object.create(null);for(let s of t.variants){let u=s.options&&s.options[o];if(!u||d[u])continue;d[u]=!0;let c=document.createElement("option");c.value=u,c.textContent=u,n.options&&n.options[o]===u&&(c.selected=!0),l.appendChild(c)}i.appendChild(l),e.appendChild(i)}}var Je="http://www.w3.org/2000/svg",qt="data-lb-placeholder",Wn="lb-thumb--placeholder";function li(){let e=document.createElementNS(Je,"svg");e.setAttribute("class","lb-bundle-placeholder-icon"),e.setAttribute("viewBox","0 0 48 48");let t=document.createElementNS(Je,"rect");t.setAttribute("x","15"),t.setAttribute("y","15"),t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("rx","2"),e.appendChild(t);let n=document.createElementNS(Je,"circle");n.setAttribute("cx","20.5"),n.setAttribute("cy","20.5"),n.setAttribute("r","1.5"),e.appendChild(n);let r=document.createElementNS(Je,"path");return r.setAttribute("d","M33 27l-5-5L17 33"),e.appendChild(r),e}var si=li;function di(){let e=si(),t=e.nodeType===1?e:null;return t&&(t.setAttribute(qt,""),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false")),e}function ke(e){let t=e.querySelector("img");t&&t.remove(),e.classList.add(Wn),!e.querySelector("["+qt+"]")&&e.appendChild(di())}function Xe(e){let t=e.querySelector("["+qt+"]");t&&t.remove(),e.classList.remove(Wn)}var Rt=new WeakMap;function Ie(e,t,n){let r=e.querySelector("[data-thumbnail]");if(!r)return;let o=r.querySelector("img");if(!Rt.has(e)){let a=n||(o?o.src:null);a&&Rt.set(e,a)}let i=t&&t.image||Rt.get(e)||null;if(!i){ke(r);return}if(Xe(r),o)o.src=i,o.srcset="";else{let a=document.createElement("img");a.src=i,a.loading="lazy",a.alt="",r.textContent="",r.appendChild(a)}}function ci(e,t){let n=e.querySelector("[data-qty-inline]");n&&(n.textContent="\xD7"+t)}function Nt(e,t,n,r){if(!t){Ie(e,null,n.featuredImage);return}Ie(e,t,n.featuredImage),ci(e,t.quantity||n.quantity||1);let o=e.querySelector("[data-product-price]");o&&t.price!=null&&(o.textContent=r(t.price));let i=e.querySelector("[data-product-compare-price]");if(i){let l=t.compareAtPrice;l&&l>t.price?(i.textContent=r(l),i.hidden=!1):(i.textContent="",i.hidden=!0)}let a=e.querySelector("[data-product-unit-price]");a&&(t.unitPrice?(a.textContent=t.unitPrice,a.hidden=!1):(a.textContent="",a.hidden=!0))}function P(e,t,n){let r=document.createElement(e);r.className=t;for(let o in n)r.setAttribute(o,n[o]);return r}function Ze(e,t,n){let r=e.variants.length,o=P("div","lb-bundle-product-row");n.isOos&&(o.classList.add("lb-bundle-product-row--oos"),o.setAttribute("aria-disabled","true")),o.setAttribute("data-product-id",String(e.productId)),n.bogoRole&&o.setAttribute("data-bogo-role",n.bogoRole);let i=P("div","lb-bundle-thumbnail",{"data-thumbnail":""}),a=e.featuredImageRatio;n.thumbnailRatio==="original"&&i.style.setProperty("--lb-row-thumb-ratio",String(a!=null&&a>0?a:1)),o.appendChild(i);let l=P("div","lb-bundle-product-info"),d=document.createElement(n.href?"a":"span");if(d.className="lb-bundle-product-name",n.href&&(d.href=n.href),d.textContent=e.title??"",l.appendChild(d),n.isOos){let u=P("span","lb-bundle-oos-label");return u.textContent=t.outOfStock||"Out of stock",l.appendChild(u),o.appendChild(l),o}r===1&&e.variants[0]?.title!=="Default Title"&&l.appendChild(P("span","lb-bundle-variant-badge"));let s=P("span","lb-bundle-product-prices");if(s.appendChild(P("span","lb-bundle-product-compare-price",{"data-product-compare-price":"",hidden:""})),s.appendChild(P("span","lb-bundle-product-price",{"data-product-price":""})),n.inlineQuantity!=null){let u=P("span","lb-bundle-qty-inline",{"data-qty-inline":""});u.textContent="\xD7"+n.inlineQuantity,s.appendChild(u)}if(l.appendChild(s),l.appendChild(P("span","lb-bundle-product-unit-price",{"data-product-unit-price":""})),r>1&&l.appendChild(P("div","lb-bundle-variant-option-groups",{style:"--lb-row-option-count: "+(e.optionNames.length||1)})),o.appendChild(l),n.inlineQuantity==null&&o.appendChild(P("span","lb-bundle-qty-chip",{"data-qty-inline":""})),n.badgeText){let u=P("span","lb-bogo__badge");u.textContent=n.badgeText,o.appendChild(u)}return o}function ce(e,t){let n=P("div",e),r=P("div","lb-bundle-header"),o=P("h3","lb-bundle-title");if(o.textContent=t.title,r.appendChild(o),t.subtitle){let p=P("p","lb-bundle-subtitle");p.textContent=t.subtitle,r.appendChild(p)}if(n.appendChild(r),t.endsAt){let p=P("div","lb-bundle-countdown",{"data-countdown":""}),h=P("div","lb-bundle-countdown__label"),m=document.createElement("span");m.textContent=t.countdownLabel??"Limited time offer",h.appendChild(m),p.appendChild(h),p.appendChild(P("span","lb-bundle-countdown__timer",{"data-countdown-timer":""})),n.appendChild(p)}let i=P("div",e+"__products lb-edge-fade");n.appendChild(i),n.appendChild(P("div","lb-bundle-divider"));let a=P("div","lb-bundle-summary",{"data-pricing-section":""}),l=P("div","lb-bundle-summary__text"),d=P("span","lb-bundle-summary__label");if(d.textContent=t.summaryLabel??"Bundle total",l.appendChild(d),t.withItemCount&&d.appendChild(P("span","",{"data-item-count":""})),t.showSavingsBar){let p=P("p","lb-bundle-savings-line",{"data-savings-bar":"",style:"display:none"});p.appendChild(document.createTextNode("Save ")),p.appendChild(P("span","",{"data-savings-amount":""})),p.appendChild(document.createTextNode(" ")),p.appendChild(P("span","",{"data-savings-percent":""})),l.appendChild(p)}a.appendChild(l);let s=P("span","lb-bundle-summary__prices");t.showComparePrice&&s.appendChild(P("span","lb-bundle-compare-price",{"data-compare-price":""})),s.appendChild(P("span","lb-bundle-sale-price",{[t.totalPriceSlot?"data-total-price":"data-sale-price"]:""})),a.appendChild(s),n.appendChild(a);let u=P("button","lb-bundle-cta",{"data-cta-text":t.ctaText,type:"button","data-add-bundle":""}),c=P("span","lb-cta-label",{"data-cta-label":""});return c.textContent=t.ctaText,u.appendChild(c),n.appendChild(u),n.appendChild(P("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),n.appendChild(P("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),{root:n,products:i,cta:u}}function jn(e,t,n={}){let r=n.showCompare!==!1,o=n.showPriceEach!==!1,i=P("div","lb-volume__tiers lb-edge-fade",{role:"radiogroup","aria-label":t,"data-tier-group":""});return e.forEach((a,l)=>{let d=P("div","lb-volume__tier",{role:"radio","aria-checked":a.selected?"true":"false",tabindex:a.selected?"0":"-1","data-tier-index":String(l),"data-tier-qty":String(a.quantity),"data-tier-pct":String(a.percent),"data-tier-amt":String(a.amountCents)}),s=P("span","lb-volume__radio");s.appendChild(P("span","lb-volume__radio-dot")),d.appendChild(s);let u=P("span","lb-volume__tier-info"),c=P("span","lb-volume__tier-label");c.textContent=a.label,u.appendChild(c);let p=P("span","lb-volume__tier-price");if(r&&(a.percent>0||a.amountCents>0)&&p.appendChild(P("span","lb-volume__tier-compare")),o&&(p.appendChild(P("span","",{"data-tier-price-each":""})),n.unitLabel)){let h=P("span","lb-volume__tier-unit");h.textContent=n.unitLabel,p.appendChild(h)}if(u.appendChild(p),d.appendChild(u),a.badgeLabel||a.savingsLabel){let h=P("span","lb-volume__tier-right");if(a.badgeLabel){let m=P("span","lb-volume__tier-badge");m.textContent=a.badgeLabel,h.appendChild(m)}if(a.savingsLabel){let m=P("span","lb-volume__tier-savings");m.textContent=a.savingsLabel,h.appendChild(m)}d.appendChild(h)}i.appendChild(d)}),i}function et(e){let t=P("div","lb-mix-match__progress",{"data-progress":""}),n=P("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)});for(let o=0;o<e;o++)n.appendChild(P("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));t.appendChild(n);let r=P("div","lb-mix-match__progress-labels");return r.appendChild(P("span","lb-mix-match__progress-count",{"data-progress-count":"","aria-live":"polite"})),r.appendChild(P("span","lb-mix-match__progress-remaining",{"data-progress-remaining":"","aria-live":"polite"})),t.appendChild(r),t}function Te(e){return e<10?"0"+e:String(e)}function ue(e){e._lbCountdownInterval&&(clearInterval(e._lbCountdownInterval),e._lbCountdownInterval=null);let t=e.querySelector("[data-countdown]");if(!t)return;let n=e.closest(".lb-bundle-widget"),r=n&&n.getAttribute("data-ends-at");if(!r){t.style.display="none";return}let o=new Date(r).getTime();if(isNaN(o)){t.style.display="none";return}let i=t.querySelector("[data-countdown-timer]");if(!i)return;let a;function l(){let d=o-Date.now();if(d<=0){n&&(n.style.display="none"),a&&clearInterval(a);return}let s=Math.floor(d/864e5),u=Math.floor(d%864e5/36e5),c=Math.floor(d%36e5/6e4),p=Math.floor(d%6e4/1e3);i.textContent=s>0?s+"d "+Te(u)+"h "+Te(c)+"m "+Te(p)+"s":Te(u)+"h "+Te(c)+"m "+Te(p)+"s"}l(),o-Date.now()>0&&(a=setInterval(l,1e3),e._lbCountdownInterval=a)}function Gn(e){let t=e.ownerDocument,n=t&&t.defaultView;if(!n)return null;let r=e.parentElement;for(;r&&r!==t.body;){let o=n.getComputedStyle(r).overflowY;if(o==="auto"||o==="scroll"||o==="hidden")return r;r=r.parentElement}return null}var re=[],tt=!1;function ui(e,t){if(e.composedPath){let r=e.composedPath();for(let o=0;o<r.length;o++)if(r[o]===t.shell||r[o]===t.listbox)return!0;return!1}let n=e.target;return t.shell.contains(n)||t.listbox.contains(n)}function nt(e){for(let t=re.length-1;t>=0;t--)ui(e,re[t])||re[t].close()}function $n(){for(let e=re.length-1;e>=0;e--)re[e].close()}function pi(){tt||(document.addEventListener("pointerdown",nt,!0),window.addEventListener("resize",$n),window.addEventListener("scroll",nt,!0),tt=!0)}function mi(){tt&&(document.removeEventListener("pointerdown",nt,!0),window.removeEventListener("resize",$n),window.removeEventListener("scroll",nt,!0),tt=!1)}function Kn(e){re.push(e),re.length===1&&pi()}function Yn(e){let t=re.indexOf(e);t>=0&&re.splice(t,1),re.length===0&&mi()}function Jn(e){for(let t=re.length-1;t>=0;t--)re[t]!==e&&re[t].close()}var bi=32,hi=8,fi=8,Ht=new WeakMap;function Xn(e){return Ht.get(e)}function Zn(e){if(e.classList.contains("lb-dropdown-state"))return null;let t=document,n=e.getAttribute("aria-label")||"",r="lb-dd-"+Math.random().toString(36).slice(2,9);e.classList.add("lb-dropdown-state"),e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1");let o=t.createElement("div");o.className="lb-dropdown",o.setAttribute("data-lb-dropdown","");let i=t.createElement("button");i.type="button",i.className="lb-dropdown-trigger",i.setAttribute("role","combobox"),i.setAttribute("aria-haspopup","listbox"),i.setAttribute("aria-expanded","false");let a=r+"-listbox";i.setAttribute("aria-controls",a),n&&i.setAttribute("aria-label",n);let l=t.createElement("span");l.className="lb-dropdown-trigger-value";let d=t.createElement("span");d.className="lb-dropdown-chevron",d.setAttribute("aria-hidden","true"),i.appendChild(l),i.appendChild(d);let s=t.createElement("ul");s.id=a,s.className="lb-dropdown-listbox",s.setAttribute("role","listbox"),n&&s.setAttribute("aria-label",n),s.hidden=!0,o.appendChild(i),e.parentNode?.insertBefore(o,e.nextSibling);let u=e.closest("[data-modal-overlay]");u?(u.appendChild(s),s.setAttribute("data-lb-dropdown-portal","")):o.appendChild(s);let c=!1,p=-1,h=we.emptyTypeAheadState(),m=[];function k(){let A=[];for(let E=0;E<e.options.length;E++){let f=e.options[E];A.push({disabled:f.disabled,label:f.textContent||f.value})}return A}function B(){i.disabled=e.disabled;let A=k(),E=e.selectedIndex;for(l.textContent=E>=0&&A[E]?A[E].label:"";s.firstChild;)s.removeChild(s.firstChild);m=[];for(let f=0;f<A.length;f++){let I=t.createElement("li");I.id=r+"-opt-"+f,I.className="lb-dropdown-option",I.setAttribute("role","option"),I.setAttribute("aria-selected",f===E?"true":"false"),A[f].disabled&&I.setAttribute("aria-disabled","true"),I.setAttribute("data-value",e.options[f].value),I.setAttribute("data-index",String(f)),I.textContent=A[f].label,s.appendChild(I),m.push(I)}}function y(A){if(p>=0&&m[p]&&m[p].classList.remove("is-active"),p=A,A<0||!m[A]){i.setAttribute("aria-activedescendant","");return}let E=m[A];E.classList.add("is-active"),i.setAttribute("aria-activedescendant",E.id);let f=E.offsetTop,I=f+E.offsetHeight,U=s.scrollTop,g=U+s.clientHeight;f<U?s.scrollTop=f:I>g&&(s.scrollTop=I-s.clientHeight)}function S(){let A=i.getBoundingClientRect();if(A.width===0)return!1;let f=Math.min(m.length||1,fi)*bi+hi,I=Gn(i),U=I?{top:I.getBoundingClientRect().top,bottom:I.getBoundingClientRect().bottom}:void 0,g=we.computePosition({trigger:{top:A.top,bottom:A.bottom,left:A.left,width:A.width},viewportHeight:window.innerHeight,desiredHeight:f,clip:U});return s.setAttribute("data-placement",g.placement),s.style.maxHeight=g.maxHeight+"px",s.hasAttribute("data-lb-dropdown-portal")&&(s.style.top=g.offsetTop+"px",s.style.left=g.offsetLeft+"px",s.style.width=g.width+"px"),!0}function N(){if(c)return;Jn(W),c=!0,s.hidden=!1,i.setAttribute("aria-expanded","true"),S()||requestAnimationFrame(()=>{S()});let A=k(),E=e.selectedIndex;E>=0&&A[E]&&!A[E].disabled?y(E):y(we.firstEnabled(A)),Kn(W)}function L(A){c&&(c=!1,s.hidden=!0,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-activedescendant",""),p>=0&&m[p]&&m[p].classList.remove("is-active"),p=-1,Yn(W),A&&i.focus())}function V(A){let E=e.options[A];!E||E.disabled||(e.value!==E.value&&(e.value=E.value,e.dispatchEvent(new Event("change",{bubbles:!0}))),B(),L(!0))}function _(A){let E=k(),f=we.handleKey({key:A.key,ctrlKey:A.ctrlKey,metaKey:A.metaKey,altKey:A.altKey,shiftKey:A.shiftKey},{isOpen:c,activeIndex:p,selectedIndex:e.selectedIndex,options:E});switch(f.preventDefault&&A.preventDefault(),f.type){case"open":N(),f.activeIndex>=0&&y(f.activeIndex);break;case"close":L(f.restoreFocus);break;case"move-active":y(f.activeIndex);break;case"commit":V(f.index);break;case"type-ahead":{let I=we.pushTypeAheadChar(h,f.char,Date.now(),E);h=I.newState,I.matchedIndex!==null&&(c||N(),y(I.matchedIndex));break}}}function w(A){A.preventDefault(),c?L(!1):N()}function b(A){let E=A.target;for(;E&&E!==s;){if(E.classList&&E.classList.contains("lb-dropdown-option")){let f=parseInt(E.getAttribute("data-index")??"",10);return isNaN(f)?null:f}E=E.parentNode}return null}function D(A){let E=b(A);E!==null&&V(E)}function H(A){let E=A.target;for(;E&&E!==s;){if(E.classList&&E.classList.contains("lb-dropdown-option")){if(E.getAttribute("aria-disabled")==="true")return;let f=parseInt(E.getAttribute("data-index")??"",10);!isNaN(f)&&f!==p&&y(f);return}E=E.parentNode}}function R(){setTimeout(()=>{c&&(o.contains(document.activeElement)||L(!1))},0)}function q(){B()}let $=new MutationObserver(()=>{B()});$.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});function G(A){A.preventDefault()}i.addEventListener("click",w),i.addEventListener("keydown",_),o.addEventListener("focusout",R),s.addEventListener("mousedown",G),s.addEventListener("click",D),s.addEventListener("mousemove",H),e.addEventListener("change",q);function J(){c&&L(!1),$.disconnect(),i.removeEventListener("click",w),i.removeEventListener("keydown",_),o.removeEventListener("focusout",R),s.removeEventListener("mousedown",G),s.removeEventListener("click",D),s.removeEventListener("mousemove",H),e.removeEventListener("change",q),o.parentNode?.removeChild(o),s.parentNode?.removeChild(s),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),Ht.delete(e)}let W={shell:o,listbox:s,select:e,close:()=>L(!1),destroy:J};return Ht.set(e,W),B(),W}var gi="select.lb-bundle-variant-select:not(.lb-dropdown-state), select.lb-mix-match__variant-select:not(.lb-dropdown-state)";function er(e){let n=(e??document).querySelectorAll(gi);for(let r=0;r<n.length;r++)Zn(n[r])}function tr(e){let n=(e??document).querySelectorAll("select.lb-dropdown-state");for(let r=0;r<n.length;r++)Xn(n[r])?.destroy()}function fe(e){return er(e),()=>tr(e)}function nr(e,t,n,r){let o=t.widgetConfig,i=$e(t);if(!i.length)return;let a=i.filter(c=>!c.variants.some(p=>p.available)),l=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",d=se(l),s=ae,u=ce("lb-fixed",{title:t.title,subtitle:t.description,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||s.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt});u.root.setAttribute("data-discount-type",t.discountConfig.discountType),u.root.setAttribute("data-discount-value",String(t.discountConfig.discountValue));for(let c of i){let p=!c.variants.some(B=>B.available),h=Ze(c,s,{isOos:p,href:c.url,thumbnailRatio:o.productList?.thumbnailRatio});if(u.products.appendChild(h),p)continue;let m=Fn(c);m&&(c.selectedVariantId=m.id);let k=m??ee(c,c.selectedVariantId);Ye(h,c,k),Nt(h,k,c,d),Ke(h,()=>c,(B,y)=>{Nt(h,B,y,d),Bt(u.root,i,d)})}if(a.length>0){u.cta.disabled=!0;let c=u.cta.querySelector("[data-cta-label]");c&&(c.textContent=je(s,a.length))}else u.cta.addEventListener("click",()=>{n(Qn(i).map(c=>({merchandiseId:"gid://shopify/ProductVariant/"+c.variantId,quantity:c.quantity,attributes:de(t.id,t.bundleType)})))});e.appendChild(u.root),ue(u.root),Bt(u.root,i,d),r?.(fe(u.root))}function Z(e,t){let n=e;for(let r in t)n=n.split("__"+r+"__").join(String(t[r]));return n}function rt(e,t){let n=t.needsSpots;if(!n)return"Needs "+e+" spots";let r=new Intl.PluralRules(t.locale||"en").select(e);return Z(n[r]||n.other||"__COUNT__",{COUNT:e})}function ot(e,t,n){return Z(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function rr(e,t){return e>0?Z(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function or(e,t,n,r){if(e<=0)return r.bundleComplete||"Your bundle is complete";let o=t==="percentage"&&n?Math.round(n):0;return o>0?Z(r.chooseMoreUnlock||"Choose __COUNT__ more to unlock __PCT__% off",{COUNT:e,PCT:o}):Z(r.chooseMoreComplete||"Choose __COUNT__ more to complete your bundle",{COUNT:e})}var xi={min:1,max:99};function te(e,t,n){if(n!=null){let o=t["gid://shopify/ProductVariant/"+n];if(o&&typeof o.min=="number"&&typeof o.max=="number")return o}let r=t["gid://shopify/Product/"+e];return!r||typeof r.min!="number"||typeof r.max!="number"?xi:r}function pe(e,t){if(e==null)return;let n=t["gid://shopify/ProductVariant/"+e];if(!(!n||typeof n.min!="number"||typeof n.max!="number"))return n}function it(e,t){let n=e??{};if(!t)return n;let r=Object.keys(t);if(r.length===0)return n;let o={...n};for(let i of r)o[i]=t[i];return o}function at(e,t,n){return te(e,t,n).min}function oe(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].quantity||1;return t}function be(e,t){for(let n=0;n<e.length;n++)if(e[n]&&e[n].variantId===t)return n;return-1}function ir(e,t){let n=be(e,t);return n===-1?0:e[n].quantity||0}function ar(e,t){return e.min<=t}function lr(e,t,n,r=0,o=0,i){let a=Math.min(e.max-o,r+t);return typeof i=="number"&&(a=Math.min(a,i)),typeof n=="number"?Math.min(a,n):a}var sr=[120,180,240],dr=[480,600,768,1024],cr="60px",ur="(max-width: 767px) 45vw, 228px";function Le(e,t){return e&&(/[?&]width=\d+/.test(e)?e.replace(/([?&])width=\d+/,"$1width="+t):e+(e.indexOf("?")===-1?"?":"&")+"width="+t)}function lt(e,t){return e?t.map(n=>Le(e,n)+" "+n+"w").join(", "):""}function st(e,t){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Se(e){return e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase():""}var yi=600;function dt(e,t,n){let{t:r,rulesMap:o,capacity:i,formatMoney:a}=n,l=te(e.id,o),d=document.createElement("div");d.className="lb-mix-match__modal-product",e.available||(d.className+=" lb-mix-match__modal-product--sold-out"),d.setAttribute("data-product-item",""),d.setAttribute("data-title",Se(e.title)),d.setAttribute("data-type",e.type||"");let s=!1,u=!1,c=document.createElement("div");c.className="lb-mix-match__modal-product-thumb";let p=document.createElement("span");p.className="lb-mix-match__modal-added-badge",p.textContent=r.addedItem||"Added",p.hidden=!0,c.appendChild(p);let h=g=>{if(!g){ke(c);return}Xe(c);let O=c.querySelector("img");O||(O=document.createElement("img"),O.sizes=ur,O.alt=e.title,O.loading="lazy",c.appendChild(O)),O.src=Le(g,yi),O.srcset=lt(g,dr)},m=e.variants.find(g=>g.available)??null;h(m&&m.image||e.featuredImage),d.appendChild(c);let k=document.createElement("div");k.className="lb-mix-match__modal-product-info";let B=document.createElement("p");if(B.className="lb-mix-match__modal-product-title",e.url){let g=document.createElement("a");g.href=e.url,g.target="_blank",g.rel="noopener noreferrer",g.textContent=e.title,B.appendChild(g)}else B.textContent=e.title;k.appendChild(B);let y=m??(e.variants.length>0?e.variants[0]:null),S=g=>te(e.id,o,g?g.id:null),N=y?S(y).min:1,L=document.createElement("p");L.className="lb-mix-match__modal-product-price",L.setAttribute("data-row-price","");let V=document.createElement("span");V.setAttribute("data-row-price-sale",""),y&&(V.textContent=a(y.price*N)),L.appendChild(V);let _=document.createElement("s");_.className="lb-mix-match__modal-product-compare",_.setAttribute("data-row-compare",""),L.appendChild(_),k.appendChild(L);function w(g,O,j){let Q=O&&O.compareAtPrice?O.compareAtPrice*j:0,K=O?O.price*j:0;Q>K?(g.textContent=a(Q),g.hidden=!1):(g.textContent="",g.hidden=!0)}w(_,y,N);let b=document.createElement("p");b.className="lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price",b.setAttribute("data-row-unit-price","");let D=y?y.unitPrice:null;D?b.textContent=D:b.hidden=!0,k.appendChild(b);let H=null,R=null,q=S(y).min,$=S(y).max,G=null,J=null;if(e.available&&n.showQtySelector){H=document.createElement("div"),H.className="lb-bundle-variant-option-group lb-mix-match__qty-stepper-group";let g=document.createElement("div");g.className="lb-mix-match__qty-stepper",g.setAttribute("role","group"),g.setAttribute("aria-label",r.quantity||"Quantity");let O=document.createElement("button");O.type="button",O.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--minus",O.setAttribute("aria-label",r.decreaseQuantity||"Decrease quantity"),O.textContent="\u2212",R=document.createElement("span"),R.className="lb-mix-match__qty-stepper-value",R.setAttribute("data-row-qty",""),R.setAttribute("aria-live","polite"),R.textContent=String(S(y).min);let j=document.createElement("button");j.type="button",j.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--plus",j.setAttribute("aria-label",r.increaseQuantity||"Increase quantity"),j.textContent="+",g.appendChild(O),g.appendChild(R),g.appendChild(j),H.appendChild(g);let Q=R;G=()=>{Q.textContent=String(q),Q.setAttribute("data-qty",String(q)),O.disabled=u||q<=S(y).min,j.disabled=u||q>=$},J=(C,T=0)=>{let x=C?C.id:null,v=x===null?0:i.ownQty(x),M=x===null?0:i.productUnitsElsewhere(e.id,x),z=x===null?0:i.swapUnits(e.id,x),F=C?C.inventoryQuantity:null,X=Math.max(0,T-v),me=typeof F=="number"?Math.max(0,F-X):void 0,he=pe(x,o)?.max,ne=S(C).min;$=z>0?typeof me=="number"?Math.min(z,me):z:lr(l,i.remainingSpots(),me,v,M,he),$<ne?q=ne:(q>$&&(q=$),q<ne&&(q=ne)),G()};let K=()=>{y&&i.commitQty(y.id,q)&&n.onCommittedQtyChanged()};O.addEventListener("click",()=>{q>S(y).min&&(q-=1),G(),K()}),j.addEventListener("click",()=>{q<$&&(q+=1),G(),K()}),y?J(y):G()}let W=e.variants.slice(),A=[];if(W.length>1){let g=e.optionNames||[];y=W.find(x=>x.available!==!1)??W[0];let O=()=>{let x=A.map(v=>v.value);for(let v of W)if(!(!v.options||v.options.length!==x.length)&&v.options.every((M,z)=>M===x[z]))return v;return null},j=x=>{if(!(!x||!x.options))for(let v=0;v<A.length&&v<x.options.length;v++)A[v].value!==x.options[v]&&(A[v].value=x.options[v])},Q=(x,v,M)=>{for(let z of W){if(z.available===!1||!z.options||z.options[x]!==v)continue;let F=!0;for(let X=0;X<z.options.length;X++)if(X!==x&&z.options[X]!==M[X]){F=!1;break}if(F)return!0}return!1},K=x=>{for(let v=0;v<A.length;v++){let M=A[v];for(let z=0;z<M.options.length;z++)M.options[z].disabled=!Q(v,M.options[z].value,x)}},C=()=>{let x=O();if(!x){j(y),y?.options&&K(y.options);return}y=x,d.setAttribute("data-selected-variant-id",String(x.id));let v=S(x).min;V.textContent=a(x.price*v),w(_,x,v),x.unitPrice?(b.textContent=x.unitPrice,b.hidden=!1):(b.textContent="",b.hidden=!0),h(x.image||e.featuredImage),J?.(x,i.variantUnitsElsewhere(x.id)),x.options&&K(x.options),U()},T=document.createElement("div");T.className="lb-bundle-variant-option-groups";for(let x=0;x<g.length;x++){let v=g[x],M=document.createElement("div");M.className="lb-bundle-variant-option-group";let z=document.createElement("span");z.className="lb-bundle-variant-option-label",z.textContent=v,M.appendChild(z);let F=document.createElement("select");F.className="lb-mix-match__variant-select",F.setAttribute("data-variant-option",""),F.setAttribute("data-option-position",String(x+1)),F.name="lb-variant-"+e.id+"-"+(x+1),F.setAttribute("aria-label",v);let X=Object.create(null),me=y?.options?.[x];for(let he of W){let ne=he.options&&he.options[x];if(!ne||X[ne])continue;X[ne]=!0;let ye=document.createElement("option");ye.value=ne,ye.textContent=ne,ne===me&&(ye.selected=!0),F.appendChild(ye)}F.addEventListener("change",C),A.push(F),M.appendChild(F),T.appendChild(M)}k.appendChild(T),y&&(d.setAttribute("data-selected-variant-id",String(y.id)),y.options&&K(y.options))}else if(W.length===1&&W[0].title!=="Default Title"){let g=document.createElement("span");g.className="lb-mix-match__filled-variant",g.textContent=W[0].title,k.appendChild(g)}let E=null;e.available&&(E=document.createElement("span"),E.className="lb-mix-match__modal-needs-spots",E.hidden=!0,k.appendChild(E));let f=null;if(e.available){let g=document.createElement("div");g.className="lb-mix-match__modal-product-actions",H&&g.appendChild(H),f=document.createElement("button"),f.type="button",f.className="lb-mix-match__modal-add",f.textContent=r.addItem||"Add",f.setAttribute("aria-label",(r.addItem||"Add")+" "+e.title),f.setAttribute("data-add-product",String(t)),g.appendChild(f),k.appendChild(g)}else{let g=document.createElement("span");g.className="lb-mix-match__modal-sold-out-label",g.textContent=r.soldOut||"Sold out",d.setAttribute("aria-disabled","true"),k.appendChild(g)}d.appendChild(k);let I=y?y.id:null;function U(){if(!y)return;let g=y,O=g.inventoryQuantity,j=typeof O=="number"?i.variantUnitsElsewhere(g.id):0,Q=i.isInBundle(g.id);if(J){let M=i.ownQty(g.id);M>0?q=M:I!==g.id&&(q=S(g).min),I=g.id,J(g,j)}let K=i.swapUnits(e.id,g.id),C=S(g),T=K>=C.min,x=i.remainingSpots(),v=!Q&&!T&&!ar(C,x);if(E&&(v&&x>0?(E.textContent=rt(C.min,r),E.hidden=!1):E.hidden=!0),f)if(Q)f.disabled=!1,i.canRemove(g.id)?(f.textContent=r.removeItem||"Remove",f.setAttribute("aria-label",(r.removeItem||"Remove")+" "+e.title),f.classList.remove("lb-mix-match__modal-add--required")):(f.disabled=!0,f.textContent=r.required||"Required",f.setAttribute("aria-label",e.title+" is required and cannot be removed"),f.classList.add("lb-mix-match__modal-add--required")),f.classList.add("lb-mix-match__modal-add--added"),d.classList.add("lb-mix-match__modal-product--in-bundle"),p.hidden=!1;else{let M=r.swapItem||"Swap",z=T?M:r.addItem||"Add";f.textContent=z,f.setAttribute("aria-label",z+" "+e.title),f.classList.remove("lb-mix-match__modal-add--added"),f.classList.remove("lb-mix-match__modal-add--required"),d.classList.remove("lb-mix-match__modal-product--in-bundle"),p.hidden=!0;let F=typeof O=="number"?Math.max(0,O-j)<C.min:!1;if(T)f.disabled=F;else{let X=l.max-i.productUnitsElsewhere(e.id,g.id)<C.min;f.disabled=F||X||v||i.isFull()}}s=!e.available,u=!e.available||!Q&&!!f?.disabled,G?.();for(let M of A)M.disabled=s}return{el:d,refresh:U}}var vi='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function ct(e){let t=e.querySelectorAll(vi),n=[];for(let r=0;r<t.length;r++)t[r].offsetParent!==null&&n.push(t[r]);return n}var Dt=0,Me=0;function ut(){if(Me++,Me>1)return;Dt=window.pageYOffset||document.documentElement.scrollTop;let e=document.body;e.style.position="fixed",e.style.top="-"+Dt+"px",e.style.left="0",e.style.right="0",e.style.overflow="hidden"}function pt(){if(Me<=0||(Me--,Me>0))return;let e=document.body;e.style.position="",e.style.top="",e.style.left="",e.style.right="",e.style.overflow="",window.scrollTo(0,Dt)}function mt(e,t,n){let r=[],o=[];for(let i=0;i<t.length;i++)(n(i)?o:r).push(t[i]);for(let i of r)e.appendChild(i);for(let i of o)e.appendChild(i)}var Pe="__all__",wi=300,_i=200;function pr(e){let{container:t,data:n,t:r,eligibleProducts:o,items:i}=e,a=t.querySelector("[data-modal-overlay]");a&&e.portalTarget&&e.portalTarget.appendChild(a);let l=f=>a?a.querySelector(f):null,d=l('[role="dialog"]'),s=l("[data-modal-search]"),u=l("[data-modal-search-clear]"),c=l("[data-modal-list]"),p=l("[data-modal-empty]"),h=l("[data-modal-live]"),m=l("[data-modal-close]"),k=l("[data-modal-done]"),B=l("[data-modal-footer-count]"),y=l("[data-modal-subtitle]"),S=l("[data-modal-filters]"),N=n.showTypeFilters!==!1,L=Pe,V=!1,_=!1,w=!1,b=[];function D(){for(let f of b)f.refresh()}function H(){let f=Math.min(oe(i),e.requiredQty),I=Math.max(0,e.requiredQty-f);B&&(B.textContent=ot(f,e.requiredQty,r)),y&&(y.textContent=or(I,n.discountType,n.discountValue,r))}function R(){D(),H()}function q(){if(c){e.dropdown?.unbindAll(c),c.innerHTML="",b=[];for(let f=0;f<o.length;f++){let I=dt(o[f],f,{t:r,rulesMap:e.rulesMap,showQtySelector:e.showQtySelector,capacity:e.rowCapacity,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),R()}});b.push(I),c.appendChild(I.el)}e.dropdown?.bindAll(c),c.addEventListener("click",$)}}function $(f){let I=f.target.closest("[data-add-product]");if(!I||I.disabled)return;let U=parseInt(I.getAttribute("data-add-product")??"",10),g=o[U];if(!g)return;let O=I.closest(".lb-mix-match__modal-product"),j=O&&O.getAttribute("data-selected-variant-id"),Q=(j?g.variants.find(v=>v.id===parseInt(j,10)):null)??null;if(Q||(Q=g.variants.find(v=>v.available)??null),!Q)return;if(e.isInBundle(Q.id)){e.removeVariant(Q.id),R();return}let K=O?.querySelector("[data-row-qty]"),C=K?Math.max(1,parseInt(K.getAttribute("data-qty")||K.textContent||"",10)||1):at(g.id,e.rulesMap,Q.id),T={productId:g.id,variantId:Q.id,title:g.title,url:g.url||null,variantTitle:Q.title,featuredImage:Q.image||g.featuredImage||null,price:Q.price,compareAtPrice:Q.compareAtPrice||null,unitPrice:Q.unitPrice||null,quantity:C},x=e.swapUnitsFor(g.id,Q.id);if(x>0){e.swapVariant(T,Math.min(C,x)),R();return}e.atCapacity()||(e.addSelection(T),R())}function G(){if(!S||!N)return;let f=[],I=Object.create(null);for(let U of o){let g=(U.type||"").trim();g&&!I[g]&&(I[g]=!0,f.push(g))}if(f.length<2){S.style.display="none",d?.classList.add("lb-mix-match__modal--filters-hidden");return}S.innerHTML="";for(let U of[Pe,...f]){let g=document.createElement("button");g.type="button",g.className="lb-mix-match__filter",g.setAttribute("data-filter",U),g.setAttribute("aria-pressed",U===L?"true":"false"),U===L&&g.classList.add("lb-mix-match__filter--active"),g.textContent=U===Pe?r.allTypes||"All":U,g.addEventListener("click",()=>{L=U,J(),W(s?s.value:"")}),S.appendChild(g)}}function J(){if(!S)return;let f=S.querySelectorAll("[data-filter]");for(let I=0;I<f.length;I++){let U=f[I].getAttribute("data-filter")===L;f[I].classList.toggle("lb-mix-match__filter--active",U),f[I].setAttribute("aria-pressed",U?"true":"false")}}function W(f){if(!c)return;let I=Se(f),U=c.querySelectorAll("[data-product-item]"),g=0;for(let O=0;O<U.length;O++){let j=U[O].getAttribute("data-title")??"",Q=U[O].getAttribute("data-type")||"",K=(!I||j.indexOf(I)!==-1)&&(L===Pe||Q===L);U[O].classList.toggle("lb-hidden",!K),K&&g++}p&&(p.style.display=g===0&&I.length>0?"":"none"),u&&(u.style.display=f.length>0?"":"none"),h&&(h.textContent=Z(r.nProductsShown||"__COUNT__ products shown",{COUNT:g}))}if(s){let f=st(()=>W(s.value),_i);s.addEventListener("input",f)}u&&u.addEventListener("click",()=>{s&&(s.value="",W(""),s.focus())});function A(){if(!(!a||w)){if(w=!0,V||(q(),V=!0),_||(G(),_=!0),R(),L=Pe,J(),s&&(s.value=""),W(s?s.value:""),c){let f=Object.create(null);for(let I of i)f[String(I.productId)]=!0;mt(c,b.map(I=>I.el),I=>f[String(o[I].id)]===!0),c.scrollTop=0}a.style.display="",a.offsetHeight,a.classList.add("lb-mix-match__modal-overlay--open"),ut(),setTimeout(()=>{m?m.focus():d?.focus()},50)}}function E(){if(!a||!w)return;w=!1,a.classList.remove("lb-mix-match__modal-overlay--open"),pt(),setTimeout(()=>{w||(a.style.display="none")},wi);let f=e.fallbackFocus;f&&typeof f.focus=="function"&&setTimeout(()=>f.focus(),0)}if(m?.addEventListener("click",E),k?.addEventListener("click",E),a){let f=null;a.addEventListener("mousedown",I=>{f=I.target}),a.addEventListener("mouseup",I=>{I.target===a&&f===a&&E(),f=null})}return document.addEventListener("keydown",f=>{if(w){if(f.key==="Escape"){f.preventDefault(),E();return}if(f.key==="Tab"&&d){let I=ct(d);if(I.length===0){f.preventDefault();return}let U=I[0],g=I[I.length-1];f.shiftKey&&document.activeElement===U?(f.preventDefault(),g.focus()):!f.shiftKey&&document.activeElement===g&&(f.preventDefault(),U.focus())}}}),{open:A,close:E,isOpen:()=>w,refresh:R,overlay:a}}function mr(e,t){return Math.max(0,t-oe(e))}function Ot(e,t){return oe(e)>=t}function br(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].variantId===t&&(n+=e[r].quantity||0);return n}function bt(e,t,n){let r=0;for(let o=0;o<e.length;o++){let i=e[o];i&&i.productId===t&&i.variantId!==n&&(r+=i.quantity||0)}return r}function Ee(e,t,n){if(pe(t.variantId,n)?.required)return!1;let r=te(t.productId,n);if(!r.required)return!0;let o=0;for(let i=0;i<e.length;i++){let a=e[i];a!==t&&a.productId===t.productId&&(o+=a.quantity||1)}return o>=r.min}function Vt(e,t,n,r){let o=te(t,r);return!o.required||o.max!==o.min||be(e,n)!==-1?0:bt(e,t,n)}function Ci(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","16"),t.setAttribute("height","16"),t.setAttribute("viewBox","0 0 20 20"),t.setAttribute("fill","none");for(let[n,r,o,i]of[["5","5","15","15"],["15","5","5","15"]]){let a=document.createElementNS(e,"line");a.setAttribute("x1",n),a.setAttribute("y1",r),a.setAttribute("x2",o),a.setAttribute("y2",i),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","2"),a.setAttribute("stroke-linecap","round"),t.appendChild(a)}return t}function ht(e,t,n,r,o,i){let a=document.createElement("div");a.className="lb-mix-match__slot lb-mix-match__slot--filled";let l=document.createElement("div");if(l.className="lb-bundle-thumbnail",e.featuredImage){let m=document.createElement("img");m.src=Le(e.featuredImage,240),m.srcset=lt(e.featuredImage,sr),m.sizes=cr,m.alt=e.title,m.loading="lazy",l.appendChild(m)}else ke(l);a.appendChild(l);let d=document.createElement("div");d.className="lb-mix-match__filled-info";let s=document.createElement("button");if(s.type="button",s.className="lb-mix-match__filled-title",s.textContent=e.title,s.setAttribute("aria-label",(t.editSelection||"Edit selection")+": "+e.title),d.appendChild(s),e.variantTitle&&e.variantTitle!=="Default Title"){let m=document.createElement("span");m.className="lb-mix-match__filled-variant",m.textContent=e.variantTitle,d.appendChild(m)}let u=document.createElement("span");u.className="lb-mix-match__filled-price";let c=e.compareAtPrice||0;if(c>e.price){let m=document.createElement("s");m.className="lb-mix-match__filled-compare",m.textContent=n(c),u.appendChild(m)}let p=document.createElement("span");p.className="lb-bundle-product-price",p.textContent=n(e.price),u.appendChild(p);let h=document.createElement("span");if(h.className="lb-bundle-qty-inline",h.textContent="\xD7"+(e.quantity||1),u.appendChild(h),d.appendChild(u),e.unitPrice){let m=document.createElement("span");m.className="lb-bundle-product-unit-price",m.textContent=e.unitPrice,d.appendChild(m)}if(a.appendChild(d),r){let m=document.createElement("button");m.type="button",m.className="lb-mix-match__slot-remove",m.setAttribute("aria-label",(t.removeItem||"Remove")+" "+e.title),m.appendChild(Ci()),m.addEventListener("click",k=>{k.stopPropagation(),o()}),a.appendChild(m)}else{let m=document.createElement("span");m.className="lb-mix-match__slot-required",m.textContent=t.required||"Required",a.appendChild(m)}return a.addEventListener("click",i),a}function hr(e,t,n,r,o){let i=r.translations||{},a=e.querySelector("[data-selection-slots]");if(a){a.innerHTML="";for(let s=0;s<t.length;s++){let u=s;a.appendChild(ht(t[u],i,o.formatMoney,Ee(t,t[u],o.rulesMap),()=>o.onRemove(u),o.onEdit))}}let l=e.querySelector("[data-add-product-trigger]");l&&(l.style.display=oe(t)>=n?"none":"");let d=e.querySelector("[data-add-bundle]");if(d){d.disabled=oe(t)<n;let s=d.querySelector("[data-cta-label]");s&&(s.textContent=d.getAttribute("data-cta-text")||i.addToCart||"Add to cart")}}function fr(e,t,n,r,o){let i=e.querySelector("[data-pricing-section]");if(oe(t)<n){i&&(i.style.display="none");return}i&&(i.style.display="");let a=t.map(d=>({unitCents:d.price,quantity:d.quantity||1})),l=0;for(let d of a)l+=d.unitCents*d.quantity;l>0&&r.discountType&&o(e,ze(a,{discountType:r.discountType,discountValue:r.discountValue??0}),l)}function gr(e,t,n,r,o){let i=Math.min(oe(n),r),a=Math.max(0,r-i),l=[e];t&&l.push(t);for(let d of l){let s=d.querySelectorAll("[data-progress-segment]");for(let h=0;h<s.length;h++)s[h].classList.toggle("lb-mix-match__progress-segment--filled",h<i);let u=d.querySelector("[data-progress-count]");u&&(u.textContent=ot(i,r,o));let c=d.querySelector("[data-progress-remaining]");c&&(c.textContent=rr(a,o));let p=d.querySelector(".lb-mix-match__progress-segments");p&&p.setAttribute("aria-valuenow",String(i))}}function ft(e){return(t,n,r)=>{let o=t.querySelector("[data-sale-price]"),i=t.querySelector("[data-compare-price]"),a=t.querySelector("[data-savings-bar]"),l=t.querySelector("[data-savings-amount]"),d=t.querySelector("[data-savings-percent]"),s=r-n;if(o&&(o.textContent=e(n)),i&&(s>0?(i.textContent=e(r),i.style.display=""):i.style.display="none"),a)if(s>0){if(l&&(l.textContent=e(s)),d){let u=r>0?Math.round(s*100/r):0;d.textContent="("+u+"%)"}a.style.display=""}else a.style.display="none"}}function xr(e,t,n,r){let o=u=>u.variants.find(c=>c.available)??null,i=(u,c,p)=>({productId:u.id,variantId:c.id,title:u.title,url:u.url||null,variantTitle:c.title,featuredImage:u.featuredImage||null,price:c.price,compareAtPrice:c.compareAtPrice||null,unitPrice:c.unitPrice||null,quantity:p}),a=[];for(let u of e){if(!u.available||!u.variants)continue;let c=!1;for(let m of u.variants){let k=pe(m.id,t);!k?.required||!m.available||(a.push(i(u,m,Math.max(1,k.min))),c=!0)}if(c)continue;let p=te(u.id,t);if(!p.required)continue;let h=o(u);h&&a.push(i(u,h,Math.max(1,p.min)))}if(a.length||!r?.enabled)return a;let l=u=>u.available&&te(u.id,t).min<=n&&o(u)!==null,d=(r.currentProductId!=null?e.find(u=>u.id===r.currentProductId&&l(u)):null)??e.find(l);if(!d)return[];let s=o(d);return s?[i(d,s,te(d.id,t).min)]:[]}function yr(e){let t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("width","20"),n.setAttribute("height","20"),n.setAttribute("viewBox","0 0 20 20"),n.setAttribute("fill","none");for(let[r,o,i,a]of e){let l=document.createElementNS(t,"line");l.setAttribute("x1",r),l.setAttribute("y1",o),l.setAttribute("x2",i),l.setAttribute("y2",a),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","2"),l.setAttribute("stroke-linecap","round"),n.appendChild(l)}return n}function Y(e,t,n={}){let r=document.createElement(e);t&&(r.className=t);for(let o in n)r.setAttribute(o,n[o]);return r}function gt(e){let t="lb-modal-title-"+e.domId,n=e.strings||{},r=Y("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.bundleGid,style:"display: none;"}),o=Y("div","lb-mix-match__modal"+(e.showTypeFilters?"":" lb-mix-match__modal--filters-hidden"),{role:"dialog","aria-modal":"true","aria-labelledby":t,tabindex:"-1"}),i=Y("div","lb-mix-match__modal-header"),a=Y("div","lb-mix-match__modal-header-top"),l=Y("div","lb-mix-match__modal-heading"),d=Y("h4","lb-mix-match__modal-title",{id:t});e.wizard&&d.setAttribute("tabindex","-1"),d.textContent=n.addToBundle||"Add to your bundle",l.appendChild(d),l.appendChild(Y("p","lb-mix-match__modal-subtitle",{"data-modal-subtitle":""})),a.appendChild(l);let s=Y("button","lb-mix-match__modal-close",{type:"button","data-modal-close":"","aria-label":n.closeModal||"Close"});s.appendChild(yr([["5","5","15","15"],["15","5","5","15"]])),a.appendChild(s),i.appendChild(a);let u=Y("div","lb-mix-match__progress lb-mix-match__modal-progress",{"data-progress":""}),c=Y("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e.segmentCount??0)});if(e.wizard)c.setAttribute("data-modal-step-segments","");else for(let B=0;B<(e.segmentCount??0);B++)c.appendChild(Y("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));if(u.appendChild(c),i.appendChild(u),o.appendChild(i),e.showSearch){let B=Y("div","lb-mix-match__modal-search"),y=Y("input","lb-mix-match__modal-search-input",{type:"text","data-modal-search":"",role:"searchbox","aria-label":n.searchProducts||"Search products",placeholder:n.searchProducts||"Search products",autocomplete:"off"});B.appendChild(y);let S=Y("button","lb-mix-match__modal-search-clear",{type:"button","data-modal-search-clear":"","aria-label":n.clearSearch||"Clear search",style:"display: none;"});S.appendChild(yr([["5","5","15","15"],["15","5","5","15"]])),B.appendChild(S),o.appendChild(B)}e.showTypeFilters&&o.appendChild(Y("div","lb-mix-match__filters",{"data-modal-filters":"",role:"group","aria-label":"Filter by type"})),o.appendChild(Y("div","lb-mix-match__modal-list",{"data-modal-list":""}));let p=Y("div","lb-mix-match__modal-empty",{"data-modal-empty":"",style:"display: none;"}),h=document.createElement("p");h.textContent=n.noSearchResults||"No products match your search",p.appendChild(h),o.appendChild(p),o.appendChild(Y("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"}));let m=Y("div",e.wizard?"lb-mix-match__modal-footer lb-multi-step__modal-footer":"lb-mix-match__modal-footer");if(e.wizard){let B=Y("button","lb-multi-step__modal-back",{type:"button","data-modal-back":"",style:"display: none;"});B.textContent=n.back||"Back",m.appendChild(B)}if(m.appendChild(Y("span","lb-mix-match__modal-footer-count",{"data-modal-footer-count":"","aria-live":"polite"})),e.wizard){let B=Y("button","lb-mix-match__modal-done",{type:"button","data-modal-next":"",style:"display: none;"});B.textContent=n.next||"Next",m.appendChild(B)}let k=Y("button","lb-mix-match__modal-done",{type:"button","data-modal-done":"",...e.wizard?{style:"display: none;"}:{}});return k.textContent=n.done||"Done",m.appendChild(k),o.appendChild(m),r.appendChild(o),r}function vr(e,t,n,r,o){let i=t.widgetConfig,a=ae,l=t.minQuantity||1,d=it(t.productRules,t.variantRules),u=$e(t).map((_,w)=>({id:Number(_.productId),title:_.title??"",url:_.url??null,type:t.products[w]?.productType??"",featuredImage:_.featuredImage??null,available:_.variants.some(b=>b.available),optionNames:_.optionNames,variants:_.variants.map(b=>({id:Number(b.id),title:b.title,options:b.options,available:b.available,price:b.price,compareAtPrice:b.compareAtPrice,unitPrice:b.unitPrice,image:b.image,inventoryQuantity:b.inventoryQuantity??null}))}));if(!u.length||u.filter(_=>_.available).length===0)return;let p=se(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),h=ce("lb-mix-match",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||a.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});h.root.setAttribute("data-required-quantity",String(l)),h.products.before(et(l));let m=document.createElement("div");m.className="lb-mix-match__slots lb-edge-fade",m.setAttribute("data-selection-slots",""),h.products.replaceWith(m);let k=document.createElement("button");k.type="button",k.className="lb-mix-match__add-product",k.setAttribute("data-add-product-trigger",""),k.textContent=(a.addItem,"Add a product"),m.after(k);let B=gt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:i.showSearch!==!1,showTypeFilters:i.mixMatchShowTypeFilters!==!1,segmentCount:l,wizard:!1});h.root.appendChild(B);let y=o?t.products.findIndex(_=>_.handle===o):-1,S=xr(u,d,l,{enabled:!!o,currentProductId:y!==-1?u[y]?.id??null:null}),N={remainingSpots:()=>mr(S,l),ownQty:_=>ir(S,_),variantUnitsElsewhere:_=>br(S,_),productUnitsElsewhere:(_,w)=>bt(S,_,w),swapUnits:(_,w)=>Vt(S,_,w,d),isInBundle:_=>be(S,_)!==-1,canRemove:_=>{let w=be(S,_);return w!==-1&&Ee(S,S[w],d)},isFull:()=>Ot(S,l),commitQty:(_,w)=>{let b=be(S,_);return b===-1||S[b].quantity===w?!1:(S[b].quantity=w,!0)}};function L(){hr(h.root,S,l,t,{formatMoney:p,rulesMap:d,onRemove:_=>{Ee(S,S[_],d)&&(S.splice(_,1),L(),V.isOpen()&&V.refresh())},onEdit:()=>V.open()}),fr(h.root,S,l,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},ft(p)),gr(h.root,V.overlay,S,l,a)}let V=pr({container:h.root,data:{translations:a,discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},t:a,rulesMap:d,eligibleProducts:u,requiredQty:l,showQtySelector:i.mixMatchShowQuantitySelector!==!1,items:S,formatMoney:p,rowCapacity:N,dropdown:void 0,portalTarget:null,fallbackFocus:k,onSelectionChanged:L,addSelection:_=>{if(oe(S)+(_.quantity||1)>l)return;let w=pe(_.variantId,d)?.max,b=te(_.productId,d).max-bt(S,_.productId,_.variantId);typeof w=="number"&&(b=Math.min(b,w)),!((_.quantity||1)>b)&&(S.push(_),L())},removeVariant:_=>{let w=be(S,_);w===-1||!Ee(S,S[w],d)||(S.splice(w,1),L())},swapVariant:(_,w)=>{let b=0;for(let D=S.length-1;D>=0&&b<w;D--){let H=S[D];if(H.productId!==_.productId||H.variantId===_.variantId)continue;let R=Math.min(H.quantity||1,w-b);R>=(H.quantity||1)?S.splice(D,1):H.quantity=(H.quantity||1)-R,b+=R}b>0&&(_.quantity=b,S.push(_),L())},swapUnitsFor:(_,w)=>Vt(S,_,w,d),isInBundle:_=>be(S,_)!==-1,atCapacity:()=>Ot(S,l)});k.addEventListener("click",()=>{V.isOpen()||V.open()}),h.cta.addEventListener("click",()=>{oe(S)<l||n(S.map(_=>({merchandiseId:"gid://shopify/ProductVariant/"+_.variantId,quantity:_.quantity||1,attributes:de(t.id,t.bundleType)})))}),e.appendChild(h.root),ue(h.root),L(),r?.(fe(h.root))}var wr="lb-volume__tier--oos";function ki(e){return parseInt(e.getAttribute("data-tier-qty")??"",10)||0}function Be(e){return e.getAttribute("aria-disabled")==="true"}function _r(e,t){for(let n=0;n<e.length;n++){let r=e[n];t!==null&&ki(r)>t?(r.classList.add(wr),r.setAttribute("aria-disabled","true")):(r.classList.remove(wr),r.removeAttribute("aria-disabled"))}}function Cr(e,t){let n=e[t];if(n&&!Be(n))return t;for(let r=0;r<e.length;r++)if(!Be(e[r]))return r;return-1}function Ft(e,t,n){let r=t+n;for(;r>=0&&r<e.length;){if(!Be(e[r]))return r;r+=n}return t}function kr(e,t,n){if(t==="fixed_amount"){let o=parseInt(n.getAttribute("data-tier-amt")??"",10)||0;return Math.max(0,e-o)}let r=parseInt(n.getAttribute("data-tier-pct")??"",10)||0;return Math.max(0,e-Math.floor(e*r/100))}function Ti(e,t,n){let r=parseInt(n.getAttribute("data-tier-qty")??"",10),o=kr(e,t,n),i=o*r,a=e*r;return{qty:r,priceEach:o,totalPrice:i,undiscountedTotal:a,totalSavings:a-i}}function Si(e,t){if(!t.itemCount)return null;let n=new Intl.PluralRules(t.locale||"en").select(e);return" ("+(t.itemCount[n]||t.itemCount.other||"__COUNT__").split("__COUNT__").join(String(e))+")"}function Tr(e,t,n,r){for(let o=0;o<e.length;o++){let i=e[o],a=i.querySelector("[data-tier-price-each]");a&&(a.textContent=r(kr(t,n,i)));let l=i.querySelector(".lb-volume__tier-compare");l&&(l.textContent=r(t))}}function Sr(e,t,n,r,o,i,a){for(let y=0;y<t.length;y++)t[y].setAttribute("aria-checked",y===o?"true":"false"),t[y].setAttribute("tabindex",y===o?"0":"-1");let{qty:l,totalPrice:d,undiscountedTotal:s,totalSavings:u}=Ti(n,r,t[o]),c=e.querySelector("[data-item-count]");if(c){let y=Si(l,i);y!==null&&(c.textContent=y)}let p=e.querySelector("[data-total-price]");p&&(p.textContent=a(d));let h=e.querySelector("[data-compare-price]");h&&(u>0?(h.textContent=a(s),h.style.display=""):h.style.display="none");let m=e.querySelector("[data-savings-bar]"),k=e.querySelector("[data-savings-amount]"),B=e.querySelector("[data-savings-percent]");if(m)if(u>0){if(k&&(k.textContent=a(u)),B){let y=s>0?Math.round(u*100/s):0;B.textContent="("+y+"%)"}m.style.display="",m.classList.remove("lb-savings-pending")}else m.style.display="none"}function Er(e,t,n,r){let o=t.widgetConfig,i=_n(t.products,r);if(!i)return;let a=i.variants.nodes,l=Math.min(...t.volumeTiers.map(w=>w.minQuantity)),d=a.find(w=>Ae(w,l))??a.find(w=>w.availableForSale)??a[0];if(!d)return;let s=Ge(d.price.amount),u=t.discountConfig.discountType,c=se(i.priceRange.minVariantPrice.currencyCode),p=ae,h=xn(t.volumeTiers,u),m=yn(o.defaultTier,t.volumeTiers.length,h),k=vn(o.popularBadge?.tierIndex,o.popularBadge?.visible!==!1,h),B=t.volumeTiers.map((w,b)=>{let D=u==="fixed_amount"?0:Math.round(w.percentage??0),H=u==="fixed_amount"?Math.round((w.amount??0)*100):0,R=u==="fixed_amount"?Math.max(0,s-H):Math.max(0,s-Math.floor(s*D/100)),q=s>0?Math.round((s-R)*100/s):0;return{quantity:w.minQuantity,percent:D,amountCents:H,label:Z(p.buyQty||"Buy __COUNT__",{COUNT:w.minQuantity}),savingsLabel:q>0?"Save "+q+"%":null,badgeLabel:b===k?o.popularBadge?.text||"Most popular":null,selected:b===m}});if(!B.length)return;let y=ce("lb-volume",{title:t.title,subtitle:t.description,summaryLabel:"Total",withItemCount:o.pricing?.showItemCount!==!1,totalPriceSlot:!0,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||p.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt}),S=jn(B,"Select quantity",{showCompare:o.pricing?.showComparePrice!==!1,showPriceEach:o.pricing?.showPerUnitPrice!==!1,unitLabel:(p.each||"each").trim()});y.products.replaceWith(S);let N=S.querySelectorAll("[data-tier-index]");Tr(N,s,u,c),_r(N,Qe(d));let L=Cr(N,m),V=L===-1;V&&(L=m);let _=()=>Sr(y.root,N,s,u,L,p,c);if(S.addEventListener("click",w=>{let b=w.target.closest("[data-tier-index]");!b||Be(b)||(L=parseInt(b.getAttribute("data-tier-index")??"",10)||0,_())}),S.addEventListener("keydown",w=>{w.key==="ArrowDown"||w.key==="ArrowRight"?(w.preventDefault(),L=Ft(N,L,1),_(),N[L].focus()):(w.key==="ArrowUp"||w.key==="ArrowLeft")&&(w.preventDefault(),L=Ft(N,L,-1),_(),N[L].focus())}),V){y.cta.disabled=!0;let w=y.cta.querySelector("[data-cta-label]");w&&(w.textContent=p.outOfStock||"Out of stock")}else y.cta.addEventListener("click",()=>{let w=parseInt(N[L].getAttribute("data-tier-qty")??"",10);n([{merchandiseId:d.id,quantity:w,attributes:de(t.id,t.bundleType)}])});e.appendChild(y.root),ue(y.root),_()}function xt(e,t){return e-Math.floor(e*t/100)}function Ei(e,t,n,r){let o=ee(e[0],e[0].selectedVariantId),i=ee(e[1],e[1].selectedVariantId),a=o.price*n+i.price*r,l=o.price*n+xt(i.price,t)*r;return{totalPrice:a,salePrice:l,savings:a-l}}function Ut(e,t,n,r,o){let i=e.querySelector("[data-product-price]"),a=e.querySelector("[data-product-compare-price]");if(i){if(r&&n>0){i.textContent=o(xt(t.price,n)),a&&(a.textContent=o(t.price),a.hidden=!1);return}if(i.textContent=o(t.price),a){let l=t.compareAtPrice;l&&l>t.price?(a.textContent=o(l),a.hidden=!1):(a.textContent="",a.hidden=!0)}}}function zt(e,t,n,r,o,i){let{totalPrice:a,salePrice:l,savings:d}=Ei(t,n,r,o),s=e.querySelector("[data-sale-price]"),u=e.querySelector("[data-compare-price]"),c=e.querySelector("[data-savings-bar]"),p=e.querySelector("[data-savings-amount]"),h=e.querySelector("[data-savings-percent]");if(s&&(s.textContent=i(l)),u&&(d>0?(u.textContent=i(a),u.style.display=""):u.style.display="none"),c)if(d>0){if(p&&(p.textContent=i(d)),h){let m=a>0?Math.round(d*100/a):0;h.textContent="("+m+"%)"}c.style.display="",c.classList.remove("lb-savings-pending")}else c.style.display="none"}function Ar(e,t,n,r){let o=ee(e[0],e[0].selectedVariantId),i=ee(e[1],e[1].selectedVariantId),a={variantId:Number(e[0].selectedVariantId),quantity:n,priceCents:(o.price||0)*n},l=xt(i.price||0,t)*r;return String(e[0].selectedVariantId)===String(e[1].selectedVariantId)?[{variantId:a.variantId,quantity:n+r,priceCents:(a.priceCents??0)+l}]:[a,{variantId:Number(e[1].selectedVariantId),quantity:r,priceCents:l,attributes:[{key:Bn,value:qn}]}]}function Ai(){let e=document.createElement("div");return e.className="lb-bogo__plus",e.setAttribute("aria-hidden","true"),e.innerHTML='<svg width="12" height="12" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><line x1="9" y1="3" x2="9" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><line x1="3" y1="9" x2="15" y2="9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',e}function Ir(e,t,n,r){let o=t.widgetConfig,i=t.products.find(N=>N.id===t.buyProductId),a=t.products.find(N=>N.id===t.getProductId);if(!i||!a)return;let l=t.buyQuantity,d=t.getQuantity,s=t.discountConfig.discountValue,u={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},c=t.buyVariantIds?.length?t.buyVariantIds:null,p=t.getVariantIds?.length?t.getVariantIds:null,h=[{...Ce(i,t.id,{quantities:u,allowedVariantIds:c}),role:"buy"},{...Ce(a,t.id,{quantities:u,allowedVariantIds:p}),role:"get"}],m=h.filter(N=>!N.variants.some(L=>L.available)).length,k=se(i.priceRange.minVariantPrice.currencyCode),B=ae,y=ce("lb-bogo",{title:t.title,subtitle:t.description,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||B.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt});y.root.setAttribute("data-discount-value",String(s)),y.root.setAttribute("data-buy-qty",String(l)),y.root.setAttribute("data-get-qty",String(d));let S=s>=100?"Free":s+"% off";if(h.forEach((N,L)=>{let V=L===1;V&&y.products.appendChild(Ai());let _=!N.variants.some(D=>D.available),w=Ze(N,B,{isOos:_,href:N.url,bogoRole:N.role,inlineQuantity:V?d:l,badgeText:V&&!_?S:null,thumbnailRatio:o.productList?.thumbnailRatio});if(y.products.appendChild(w),_)return;let b=ee(N,N.selectedVariantId);Ye(w,N,b),Ie(w,b,N.featuredImage),Ut(w,b,s,V,k),Ke(w,()=>N,D=>{Ie(w,D,N.featuredImage),Ut(w,D,s,V,k),zt(y.root,h,s,l,d,k)})}),m>0){y.cta.disabled=!0;let N=y.cta.querySelector("[data-cta-label]");N&&(N.textContent=je(B,m))}else y.cta.addEventListener("click",()=>{n(Ar(h,s,l,d).map(N=>({merchandiseId:"gid://shopify/ProductVariant/"+N.variantId,quantity:N.quantity,attributes:[...de(t.id,t.bundleType),...N.attributes??[]]})))});e.appendChild(y.root),ue(y.root),zt(y.root,h,s,l,d,k),r?.(fe(y.root))}function Qt(e,t,n){return Z(n.stepOf||"Step __STEP__ of __TOTAL__",{STEP:e+1,TOTAL:t})}function qe(e,t,n){return Z(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function Mr(e,t,n){return Z(n.stepsCompleted||"__COUNT__ of __TOTAL__ steps completed",{COUNT:e,TOTAL:t})}function Pr(e,t){return e>0?Z(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function Lr(e,t,n){let r=new Intl.PluralRules(n||"en").select(t);return Z(e[r]||e.other||"__COUNT__",{COUNT:t})}function Br(e,t){return e?t.doorContinue||"Continue building":t.doorChoose||"Choose your products"}function qr(e,t,n,r){if(!e){let o=r.doorQuickSteps;return typeof o=="string"?Z(o,{COUNT:n}):Lr(o||{one:"__COUNT__ quick step",other:"__COUNT__ quick steps"},n,r.locale)}return Lr(r.doorStepsToGo||{one:"__COUNT__ step to go",other:"__COUNT__ steps to go"},t,r.locale)}function ge(e,t){let n=0;for(let r=0;r<e[t].length;r++)n+=e[t][r].quantity||1;return n}function xe(e,t,n){return ge(e,n)>=(t[n].minQuantity||1)}function Re(e,t,n){let r=t[n].maxQuantity;return r==null?1/0:Math.max(0,r-ge(e,n))}function Ne(e,t){for(let n=0;n<t.length;n++)if(!xe(e,t,n))return!1;return!0}function He(e,t,n){if(pe(t.variantId,n)?.required)return!1;let r=te(t.productId,n);if(!r.required)return!0;let o=0;for(let i of e)for(let a of i)a!==t&&a.productId===t.productId&&(o+=a.quantity||1);return o>=r.min}function Wt(e,t,n,r,o){let i=te(n,o);if(!i.required||i.max!==i.min||_e(e,t,r)!==-1)return 0;let a=0;for(let l of e[t])l.productId===n&&l.variantId!==r&&(a+=l.quantity||1);return a}function _e(e,t,n){for(let r=0;r<e[t].length;r++)if(e[t][r].variantId===n)return r;return-1}function Rr(e){let{container:t,steps:n,selections:r,t:o}=e;for(let i=0;i<n.length;i++){let a=n[i].minQuantity||1,l=t.querySelector('[data-step-group="'+i+'"]');l&&l.setAttribute("data-step-mode",r[i].length>0?"open":"row");let d=qe(Math.min(ge(r,i),a),a,o),s=xe(r,n,i),u=t.querySelectorAll('[data-step-count="'+i+'"]');for(let p=0;p<u.length;p++)u[p].textContent=d,u[p].classList.toggle("lb-multi-step__group-count--met",s);let c=t.querySelector('[data-step-slots="'+i+'"]');if(c){c.innerHTML="";for(let p=0;p<r[i].length;p++){let h=i,m=p,k=r[h][m];c.appendChild(ht(k,o,e.formatMoney,He(r,k,e.rulesMap),()=>e.onRemove(h,m),()=>e.onEdit(h)))}}}}function Nr(e){let{container:t,steps:n,selections:r,t:o}=e,i=t.querySelector("[data-step-door]");if(!i)return;let a=-1,l=0,d=!1;for(let m=0;m<n.length;m++)r[m].length>0&&(d=!0),xe(r,n,m)||(l+=1,a===-1&&(a=m));if(a===-1){i.style.display="none",i.classList.add("lb-multi-step__door--hidden");let m=i.parentElement;m&&m.firstElementChild!==i&&m.insertBefore(i,m.firstElementChild);return}i.style.display="",i.classList.remove("lb-multi-step__door--hidden"),i.setAttribute("data-step-door",String(a));let s=Br(d,o),u=i.querySelector(".lb-mix-match__add-product-label");u&&(u.textContent=s);let c=i.querySelector(".lb-multi-step__door-sub");c&&(c.textContent=qr(d,l,n.length,o));let p=n[a].name||"";i.setAttribute("aria-label",p?s+": "+p:s);let h=t.querySelector('[data-step-group="'+a+'"]');h&&h.parentElement&&h.previousElementSibling!==i&&h.parentElement.insertBefore(i,h)}function Hr(e,t,n){let{container:r,steps:o,selections:i}=e,a=r.querySelector("[data-pricing-section]");if(!Ne(i,o)){a&&(a.style.display="none");return}a&&(a.style.display="");let l=[],d=0;for(let s of i)for(let u of s){let c={unitCents:u.price,quantity:u.quantity||1};l.push(c),d+=c.unitCents*c.quantity}d>0&&t.discountType&&n(r,ze(l,{discountType:t.discountType,discountValue:t.discountValue??0}),d)}function Dr(e){let{container:t,steps:n,selections:r,t:o}=e,i=0;for(let c=0;c<n.length;c++)xe(r,n,c)&&(i+=1);let a=n.length-i,l=t.querySelectorAll("[data-progress] [data-progress-segment]");for(let c=0;c<l.length;c++)l[c].classList.toggle("lb-mix-match__progress-segment--filled",c<i);let d=t.querySelector("[data-progress-count]");d&&(d.textContent=Mr(i,n.length,o));let s=t.querySelector("[data-progress-remaining]");s&&(s.textContent=Pr(a,o));let u=t.querySelector(".lb-mix-match__progress-segments");u&&u.setAttribute("aria-valuenow",String(i))}function Or(e){let t=e.container.querySelector("[data-add-bundle]");if(!t)return;t.disabled=!Ne(e.selections,e.steps);let n=t.querySelector("[data-cta-label]");n&&(n.textContent=t.getAttribute("data-cta-text")||e.t.addToCart||"Add to cart")}function Vr(e){let t=Object.create(null),n=[];for(let r of e)for(let o of r){let i=o.quantity||1,a=String(o.variantId);t[a]?(t[a].quantity+=i,t[a].priceCents=(t[a].priceCents??0)+(o.price||0)*i):(t[a]={variantId:o.variantId,quantity:i,priceCents:(o.price||0)*i},n.push(a))}return n.map(r=>t[r])}var De="__all__",Ii=300,Li=200,Mi=500,Pi=160;function Fr(e){let{container:t,steps:n,selections:r,t:o}=e,i=t.querySelector("[data-modal-overlay]");i&&e.portalTarget&&e.portalTarget.appendChild(i);let a=C=>i?i.querySelector(C):null,l=a('[role="dialog"]'),d=a(".lb-mix-match__modal-title"),s=a("[data-modal-search]"),u=a("[data-modal-search-clear]"),c=a("[data-modal-list]"),p=a("[data-modal-empty]"),h=a("[data-modal-live]"),m=a("[data-modal-close]"),k=a("[data-modal-back]"),B=a("[data-modal-next]"),y=a("[data-modal-done]"),S=a("[data-modal-footer-count]"),N=a("[data-modal-subtitle]"),L=a("[data-modal-step-segments]"),V=a("[data-modal-filters]"),_=De,w=!1,b=0,D=[],H=null,R=null,q=C=>n[C].eligibleProducts||[],$={remainingSpots:()=>Re(r,n,b),ownQty:C=>{let T=_e(r,b,C);return T===-1?0:r[b][T].quantity||0},variantUnitsElsewhere:C=>{let T=0;for(let x of r)for(let v of x)v.variantId===C&&(T+=v.quantity||0);return T},productUnitsElsewhere:(C,T)=>{let x=0;for(let v=0;v<r.length;v++)for(let M of r[v])M.productId===C&&(v===b&&M.variantId===T||(x+=M.quantity||0));return x},swapUnits:(C,T)=>Wt(r,b,C,T,e.rulesMap),isInBundle:C=>_e(r,b,C)!==-1,canRemove:C=>{let T=_e(r,b,C);return T!==-1&&e.canRemove(r[b][T])},isFull:()=>Re(r,n,b)===0,commitQty:(C,T)=>{let x=_e(r,b,C);return x===-1||r[b][x].quantity===T?!1:(r[b][x].quantity=T,!0)}};function G(C){if(!L)return;let T=n[C].minQuantity||1;L.innerHTML="",L.setAttribute("aria-valuemax",String(T));for(let x=0;x<T;x++){let v=document.createElement("span");v.className="lb-mix-match__progress-segment",v.setAttribute("data-progress-segment",""),L.appendChild(v)}J()}function J(){if(!L)return;let C=n[b].minQuantity||1,T=Math.min(ge(r,b),C),x=L.querySelectorAll("[data-progress-segment]");for(let v=0;v<x.length;v++)x[v].classList.toggle("lb-mix-match__progress-segment--filled",v<T);L.setAttribute("aria-valuenow",String(T))}function W(){let C=n[b].minQuantity||1,T=Math.min(ge(r,b),C);S&&(S.textContent=qe(T,C,o)),N&&(N.textContent=Qt(b,n.length,o)+" \xB7 "+(n[b].name||""));let x=xe(r,n,b),v=b===n.length-1;k&&(k.style.display=b>0?"":"none"),B&&(B.style.display=v?"none":"",B.disabled=!x),y&&(y.style.display=v?"":"none",y.disabled=!x),J()}function A(){for(let C of D)C.refresh();W()}function E(){if(!e.autoAdvance||b>=n.length-1||Re(r,n,b)!==0)return;let C=b;R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null,w&&j(C+1)},Pi)}function f(C){if(!c)return;e.dropdown?.unbindAll(c),c.innerHTML="",D=[];let T=q(C);for(let M=0;M<T.length;M++){let z=dt(T[M],M,{t:o,rulesMap:e.rulesMap,capacity:$,showQtySelector:e.showQtySelector,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),A(),E()}});D.push(z),c.appendChild(z.el)}let x=r[C]||[],v=Object.create(null);for(let M of x)v[String(M.productId)]=!0;mt(c,D.map(M=>M.el),M=>v[String(T[M].id)]===!0),e.dropdown?.bindAll(c)}function I(C){let T=C.target.closest("[data-add-product]");if(!T||T.disabled)return;let v=q(b)[parseInt(T.getAttribute("data-add-product")??"",10)];if(!v)return;let M=T.closest(".lb-mix-match__modal-product"),z=M&&M.getAttribute("data-selected-variant-id"),F=(z?v.variants.find(_t=>_t.id===parseInt(z,10)):null)??null;if(F||(F=v.variants.find(_t=>_t.available)??null),!F)return;let X=_e(r,b,F.id);if(X!==-1){if(!e.canRemove(r[b][X]))return;r[b].splice(X,1),e.onSelectionChanged(),A();return}let me=M?.querySelector("[data-row-qty]"),he=me?Math.max(1,parseInt(me.getAttribute("data-qty")||me.textContent||"",10)||1):at(v.id,e.rulesMap,F.id),ne={productId:v.id,variantId:F.id,title:v.title,url:v.url||null,variantTitle:F.title,featuredImage:F.image||v.featuredImage||null,price:F.price,compareAtPrice:F.compareAtPrice||null,unitPrice:F.unitPrice||null,quantity:he},ye=Wt(r,b,v.id,F.id,e.rulesMap);if(ye>0){e.swapVariant(b,ne,Math.min(he,ye)),A();return}let Gt=Re(r,n,b);Gt!==1/0&&he>Gt||(r[b].push(ne),e.onSelectionChanged(),A(),E())}c&&c.addEventListener("click",I);function U(C){if(!V||!e.showTypeFilters)return;let T=[],x=Object.create(null);for(let v of q(C)){let M=(v.type||"").trim();M&&!x[M]&&(x[M]=!0,T.push(M))}if(T.length<2){V.style.display="none",l?.classList.add("lb-mix-match__modal--filters-hidden");return}V.style.display="",l?.classList.remove("lb-mix-match__modal--filters-hidden"),V.innerHTML="";for(let v of[De,...T]){let M=document.createElement("button");M.type="button",M.className="lb-mix-match__filter",M.setAttribute("data-filter",v),M.setAttribute("aria-pressed",v===_?"true":"false"),v===_&&M.classList.add("lb-mix-match__filter--active"),M.textContent=v===De?o.allTypes||"All":v,M.addEventListener("click",()=>{_=v,g(),O(s?s.value:"")}),V.appendChild(M)}}function g(){if(!V)return;let C=V.querySelectorAll("[data-filter]");for(let T=0;T<C.length;T++){let x=C[T].getAttribute("data-filter")===_;C[T].classList.toggle("lb-mix-match__filter--active",x),C[T].setAttribute("aria-pressed",x?"true":"false")}}function O(C){if(!c)return;let T=Se(C),x=c.querySelectorAll("[data-product-item]"),v=0;for(let M=0;M<x.length;M++){let z=x[M].getAttribute("data-title")??"",F=x[M].getAttribute("data-type")||"",X=(!T||z.indexOf(T)!==-1)&&(_===De||F===_);x[M].classList.toggle("lb-hidden",!X),X&&v++}p&&(p.style.display=v===0&&T.length>0?"":"none"),u&&(u.style.display=C.length>0?"":"none"),h&&(h.textContent=Z(o.nProductsShown||"__COUNT__ products shown",{COUNT:v}))}if(s){let C=st(()=>O(s.value),Li);s.addEventListener("input",C)}u&&u.addEventListener("click",()=>{s&&(s.value="",O(""),s.focus())});function j(C,T={}){let x=Math.max(0,Math.min(n.length-1,C));if(R!==null&&(clearTimeout(R),R=null),l&&(H!==null&&clearTimeout(H),H=null,l.removeAttribute("data-step-transition"),T.animate!==!1&&x!==b)){l.offsetHeight,l.setAttribute("data-step-transition",x>b?"forward":"back");let v=l;H=setTimeout(()=>{H=null,v.removeAttribute("data-step-transition")},Mi)}if(b=x,f(b),U(b),_=De,g(),s&&(s.value=""),O(""),c&&(c.scrollTop=0),G(b),A(),h){let v=n[b].minQuantity||1;h.textContent=Qt(b,n.length,o)+". "+(n[b].name||"")+". "+qe(Math.min(ge(r,b),v),v,o)}!T.skipFocus&&d&&typeof d.focus=="function"&&d.focus()}function Q(C){!i||w||(w=!0,j(typeof C=="number"?C:0,{skipFocus:!0,animate:!1}),i.style.display="",i.offsetHeight,i.classList.add("lb-mix-match__modal-overlay--open"),ut(),setTimeout(()=>{m?m.focus():l?.focus()},50))}function K(){if(!i||!w)return;w=!1,R!==null&&(clearTimeout(R),R=null),H!==null&&(clearTimeout(H),H=null),i.classList.remove("lb-mix-match__modal-overlay--open"),pt(),setTimeout(()=>{w||(i.style.display="none")},Ii);let C=x=>x&&x.offsetParent!==null?x:null,T=C(t.querySelector('[data-step-row="'+b+'"]'))||C(t.querySelector("[data-step-door]"))||e.ctaButton;T&&typeof T.focus=="function"&&setTimeout(()=>T.focus(),0)}if(m?.addEventListener("click",K),y?.addEventListener("click",K),k?.addEventListener("click",()=>{b>0&&j(b-1)}),B?.addEventListener("click",()=>{b<n.length-1&&xe(r,n,b)&&j(b+1)}),i){let C=null;i.addEventListener("mousedown",T=>{C=T.target}),i.addEventListener("mouseup",T=>{T.target===i&&C===i&&K(),C=null})}return document.addEventListener("keydown",C=>{if(w){if(C.key==="Escape"){C.preventDefault(),K();return}if(C.key==="Tab"&&l){let T=ct(l);if(T.length===0){C.preventDefault();return}let x=T[0],v=T[T.length-1];C.shiftKey&&document.activeElement===x?(C.preventDefault(),v.focus()):!C.shiftKey&&document.activeElement===v&&(C.preventDefault(),x.focus())}}}),{open:Q,close:K,isOpen:()=>w,refresh:A}}function Bi(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","18"),t.setAttribute("height","18"),t.setAttribute("viewBox","0 0 18 18"),t.setAttribute("fill","none");for(let[n,r,o,i]of[["9","3","9","15"],["3","9","15","9"]]){let a=document.createElementNS(e,"line");a.setAttribute("x1",n),a.setAttribute("y1",r),a.setAttribute("x2",o),a.setAttribute("y2",i),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","2"),a.setAttribute("stroke-linecap","round"),t.appendChild(a)}return t}function Ur(e,t,n,r){let o=t.widgetConfig,i=ae,a=it(t.productRules,t.variantRules),l=t.steps??[];if(!l.length)return;let d={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},s=l.map((b,D)=>Cn(t,D).map(H=>{let R=Ce(H,t.id,{quantities:d,allowedVariantIds:null});return{id:Number(R.productId),title:R.title??"",url:R.url??null,type:H.productType??"",featuredImage:R.featuredImage??null,available:R.variants.some(q=>q.available),optionNames:R.optionNames,variants:R.variants.map(q=>({id:Number(q.id),title:q.title,options:q.options,available:q.available,price:q.price,compareAtPrice:q.compareAtPrice,unitPrice:q.unitPrice,image:q.image,inventoryQuantity:q.inventoryQuantity??null}))}}));if(!(s.length>0&&s.every(b=>b.some(D=>D.available))))return;let c=se(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),p=ce("lb-multi-step",{title:t.title,subtitle:t.description,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||i.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt});p.products.before(et(l.length));let h=document.createElement("div");h.className="lb-multi-step__groups",h.setAttribute("data-step-groups","");let m=document.createElement("button");m.type="button",m.className="lb-mix-match__add-product lb-multi-step__door",m.setAttribute("data-step-door","0");let k=document.createElement("span");k.className="lb-mix-match__add-product-icon",k.setAttribute("aria-hidden","true"),k.appendChild(Bi()),m.appendChild(k);let B=document.createElement("span");B.className="lb-multi-step__door-copy";let y=document.createElement("span");y.className="lb-mix-match__add-product-label",B.appendChild(y);let S=document.createElement("span");S.className="lb-multi-step__door-sub",B.appendChild(S),m.appendChild(B),h.appendChild(m),l.forEach((b,D)=>{let H=document.createElement("section");H.className="lb-multi-step__group",H.setAttribute("data-step-group",String(D)),H.setAttribute("data-step-mode","row");let R=()=>{let E=document.createElement("span");return E.className="lb-multi-step__group-count",E.setAttribute("data-step-count",String(D)),E},q=document.createElement("button");q.type="button",q.className="lb-multi-step__step-row",q.setAttribute("data-step-row",String(D)),q.setAttribute("aria-label","Choose products: "+b.name);let $=document.createElement("span");$.className="lb-multi-step__step-ix",$.setAttribute("aria-hidden","true"),$.textContent=String(D+1),q.appendChild($);let G=document.createElement("span");G.className="lb-multi-step__group-name",G.textContent=b.name,q.appendChild(G),q.appendChild(R()),H.appendChild(q);let J=document.createElement("div");J.className="lb-multi-step__group-heading";let W=document.createElement("span");W.className="lb-multi-step__group-name",W.textContent=b.name,J.appendChild(W),J.appendChild(R()),H.appendChild(J);let A=document.createElement("div");A.className="lb-mix-match__slots lb-edge-fade lb-multi-step__group-slots",A.setAttribute("data-step-slots",String(D)),H.appendChild(A),h.appendChild(H)}),p.products.replaceWith(h);let N=gt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:o.showSearch!==!1,showTypeFilters:o.mixMatchShowTypeFilters!==!1,segmentCount:null,wizard:!0});p.root.appendChild(N);let L=l.map(()=>[]),V={container:p.root,steps:l.map((b,D)=>({name:b.name,minQuantity:b.minQuantity,maxQuantity:b.maxQuantity,eligibleProducts:s[D]})),selections:L,t:i,rulesMap:a,formatMoney:c,onRemove:(b,D)=>{let H=L[b][D];!H||!He(L,H,a)||(L[b].splice(D,1),_(),w.isOpen()&&w.refresh())},onEdit:b=>w.open(b)};function _(){Rr(V),Nr(V),Hr(V,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},ft(c)),Dr(V),Or(V)}let w=Fr({container:p.root,steps:V.steps,selections:L,t:i,rulesMap:a,showQtySelector:o.mixMatchShowQuantitySelector!==!1,showTypeFilters:o.mixMatchShowTypeFilters!==!1,autoAdvance:o.multiStepAutoAdvance===!0,formatMoney:c,dropdown:void 0,portalTarget:null,ctaButton:p.cta,onSelectionChanged:_,swapVariant:(b,D,H)=>{let R=0,q=L[b];for(let $=q.length-1;$>=0&&R<H;$--){let G=q[$];if(G.productId!==D.productId||G.variantId===D.variantId)continue;let J=Math.min(G.quantity||1,H-R);J>=(G.quantity||1)?q.splice($,1):G.quantity=(G.quantity||1)-J,R+=J}R>0&&(D.quantity=R,q.push(D),_())},canRemove:b=>He(L,b,a)});m.addEventListener("click",()=>{w.isOpen()||w.open(parseInt(m.getAttribute("data-step-door")??"",10)||0)}),p.root.querySelectorAll("[data-step-row]").forEach(b=>{b.addEventListener("click",()=>{w.isOpen()||w.open(parseInt(b.getAttribute("data-step-row")??"",10)||0)})}),p.cta.addEventListener("click",()=>{Ne(L,V.steps)&&n(Vr(L).map(b=>({merchandiseId:"gid://shopify/ProductVariant/"+b.variantId,quantity:b.quantity,attributes:de(t.id,t.bundleType)})))}),e.appendChild(p.root),ue(p.root),_(),r?.(fe(p.root))}var qi=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),yt=new Set,vt=!1;function zr(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let n of yt)n.classList.add(e),n.classList.remove(t)}function Qr(e){qi.has(e.key)&&zr("using-keyboard")}function Wr(){zr("using-mouse")}function Ri(){vt||(vt=!0,document.addEventListener("keydown",Qr,!0),document.addEventListener("pointerdown",Wr,!0))}function Ni(){vt&&(vt=!1,document.removeEventListener("keydown",Qr,!0),document.removeEventListener("pointerdown",Wr,!0))}function wt(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),yt.add(e),Ri(),()=>{yt.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),yt.size===0&&Ni()}}var jt=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
|
|
283
283
|
|
|
284
284
|
.lb-bundle-widget.lb-bundle-widget,
|
|
285
285
|
.lb-bundle-widget.lb-bundle-widget * {
|