@lime-bundles/widget 4.5.0 → 4.6.0

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.
@@ -1,4 +1,4 @@
1
- "use strict";var LimeBundles=(()=>{var gt=Object.defineProperty;var Nr=Object.getOwnPropertyDescriptor;var Hr=Object.getOwnPropertyNames;var Dr=Object.prototype.hasOwnProperty;var Or=(e,t)=>{for(var n in t)gt(e,n,{get:t[n],enumerable:!0})},Fr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Hr(t))!Dr.call(e,o)&&o!==n&&gt(e,o,{get:()=>t[o],enumerable:!(r=Nr(t,o))||r.enumerable});return e};var Vr=e=>Fr(gt({},"__esModule",{value:!0}),e);var ui={};Or(ui,{LimeBundleElement:()=>De,trackInputMode:()=>ft});var Ur=Object.defineProperty,Jt=(e,t)=>{for(var n in t)Ur(e,n,{get:t[n],enumerable:!0})},Ot=class extends Error{constructor(e){super(e.map(t=>t.message).join("; ")),this.errors=e,this.name="StorefrontApiError"}},zr="2026-07";async function Qr(e){if(e)return typeof e=="function"?await e():e}function Xt(e){return!!(e.country||e.language||e.buyer)}function yt(e){let t=e.apiVersion??zr,n=`https://${e.shopDomain}/api/${t}/graphql.json`;return{async query(r,o,i){let a={"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":e.accessToken};e.buyerIp&&(a["Shopify-Storefront-Buyer-IP"]=e.buyerIp);let l=await Qr(e.buyer),d={...o??{}};e.country&&(d.country=e.country),e.language&&(d.language=e.language),l&&(d.buyer=l);let s=await fetch(n,{method:"POST",headers:a,body:JSON.stringify({query:r,variables:d}),signal:i?.signal});if(!s.ok)throw new Ot([{message:`Storefront API error: ${s.status} ${s.statusText}`}]);let u=await s.json();if(u.errors?.length)throw new Ot(u.errors);return u.data}}}function Zt(e){return e.replace(/query\s+(\w+)\s*(?:\(([^)]*)\))?\s*\{/,(t,n,r)=>{let o=(r||"").trim(),i="$country: CountryCode, $language: LanguageCode, $buyer: BuyerInput",a=o?`${o}, ${i}`:i;return`query ${n}(${a}) @inContext(country: $country, language: $language, buyer: $buyer) {`})}var en=`#graphql
1
+ "use strict";var LimeBundles=(()=>{var vt=Object.defineProperty;var Vr=Object.getOwnPropertyDescriptor;var Ur=Object.getOwnPropertyNames;var zr=Object.prototype.hasOwnProperty;var Qr=(e,t)=>{for(var n in t)vt(e,n,{get:t[n],enumerable:!0})},Wr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ur(t))!zr.call(e,o)&&o!==n&&vt(e,o,{get:()=>t[o],enumerable:!(r=Vr(t,o))||r.enumerable});return e};var jr=e=>Wr(vt({},"__esModule",{value:!0}),e);var yi={};Qr(yi,{LimeBundleElement:()=>De,trackInputMode:()=>gt});var $r=Object.defineProperty,nn=(e,t)=>{for(var n in t)$r(e,n,{get:t[n],enumerable:!0})},Qt=class extends Error{constructor(e){super(e.map(t=>t.message).join("; ")),this.errors=e,this.name="StorefrontApiError"}},Gr="2026-07";async function Kr(e){if(e)return typeof e=="function"?await e():e}function rn(e){return!!(e.country||e.language||e.buyer)}function Ct(e){let t=e.apiVersion??Gr,n=`https://${e.shopDomain}/api/${t}/graphql.json`;return{async query(r,o,i){let a={"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":e.accessToken};e.buyerIp&&(a["Shopify-Storefront-Buyer-IP"]=e.buyerIp);let l=await Kr(e.buyer),d={...o??{}};e.country&&(d.country=e.country),e.language&&(d.language=e.language),l&&(d.buyer=l);let s=await fetch(n,{method:"POST",headers:a,body:JSON.stringify({query:r,variables:d}),signal:i?.signal});if(!s.ok)throw new Qt([{message:`Storefront API error: ${s.status} ${s.statusText}`}]);let u=await s.json();if(u.errors?.length)throw new Qt(u.errors);return u.data}}}function on(e){return e.replace(/query\s+(\w+)\s*(?:\(([^)]*)\))?\s*\{/,(t,n,r)=>{let o=(r||"").trim(),i="$country: CountryCode, $language: LanguageCode, $buyer: BuyerInput",a=o?`${o}, ${i}`:i;return`query ${n}(${a}) @inContext(country: $country, language: $language, buyer: $buyer) {`})}var an=`#graphql
2
2
  query BundleMetaobject($id: ID!) {
3
3
  metaobject(id: $id) {
4
4
  id
@@ -100,7 +100,7 @@
100
100
  }
101
101
  }
102
102
  }
103
- `,tn=`#graphql
103
+ `,ln=`#graphql
104
104
  query ShopSettings {
105
105
  shop {
106
106
  customCss: metafield(namespace: "$app", key: "custom_css") {
@@ -108,7 +108,7 @@
108
108
  }
109
109
  }
110
110
  }
111
- `,nn=`#graphql
111
+ `,sn=`#graphql
112
112
  query BundlesForProduct($handle: String!) {
113
113
  product(handle: $handle) {
114
114
  id
@@ -221,7 +221,7 @@
221
221
  }
222
222
  }
223
223
  }
224
- `,rn=`#graphql
224
+ `,dn=`#graphql
225
225
  mutation CartCreate($input: CartInput!) {
226
226
  cartCreate(input: $input) {
227
227
  cart { id checkoutUrl }
@@ -229,7 +229,7 @@
229
229
  warnings { code message target }
230
230
  }
231
231
  }
232
- `,on=`#graphql
232
+ `,cn=`#graphql
233
233
  mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
234
234
  cartLinesAdd(cartId: $cartId, lines: $lines) {
235
235
  cart { id checkoutUrl }
@@ -237,7 +237,7 @@
237
237
  warnings { code message target }
238
238
  }
239
239
  }
240
- `,an=`#graphql
240
+ `,un=`#graphql
241
241
  query CartLines($cartId: ID!) {
242
242
  cart(id: $cartId) {
243
243
  id
@@ -249,7 +249,7 @@
249
249
  }
250
250
  }
251
251
  }
252
- `,ln=`#graphql
252
+ `,pn=`#graphql
253
253
  mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {
254
254
  cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
255
255
  cart { id checkoutUrl }
@@ -257,7 +257,7 @@
257
257
  warnings { code message target }
258
258
  }
259
259
  }
260
- `;var ae=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},Ft={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 Wr(e){if(!e||typeof e!="object")return ie;let t=e;return{...ie,...t,defaultTier:jr(t.defaultTier),pickerBorderRadius:Vt(t.pickerBorderRadius),header:{...ie.header,...t.header??{}},layout:{...ie.layout,...t.layout??{},borderRadius:Vt(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 jr(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:ie.defaultTier}function Vt(e){return e==="none"||e==="subtle"||e==="rounded"||e==="round"?e:ie.layout.borderRadius}function $r(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:Ft[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:Ft[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 Gr={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"},Kr=new Set(["borderRadius","borderWidth","ctaBorderWidth","popularBadgeBorderWidth","pickerBorderWidth","pickerBorderRadius","pickerAddBorderWidth"]);function sn(e,t){let n=$r(t);for(let[i,a]of Object.entries(Gr)){let l=n[i];if(l==null)continue;let d=Kr.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",Ut(t.layout.borderColor)),e.style.setProperty("--lb-picker-variant-chevron",Ut(t.pickerBorderColor));let r=zt(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=zt(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 Ut(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 zt(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 Yr=new Set(["fixed","mix_match","volume","bogo","multi_step"]),Jr=new Set(["active"]);function wt(e,t){try{return Xr(e,t)}catch(n){if(n instanceof ae)return null;throw n}}function Xr(e,t){let n=new Map(t.map(v=>[v.key,v])),r=n.get("title")?.value??"Bundle",o=n.get("bundle_type")?.value,i=n.get("status")?.value;if(!o||!Yr.has(o))throw new ae(`Invalid or missing bundle_type: ${o??"null"}`,"invalid_type");let a=o;if(!i||!Jr.has(i))throw new ae(`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 v=new Date(d);if(Number.isNaN(v.getTime()))throw new ae(`Invalid starts_at: ${d}`,"invalid_type");if(v>u)throw new ae(`Bundle not yet started: starts_at=${d}`,"not_started")}if(s){let v=new Date(s);if(Number.isNaN(v.getTime()))throw new ae(`Invalid ends_at: ${s}`,"invalid_type");if(v<u)throw new ae(`Bundle has expired: ends_at=${s}`,"expired")}let c=no(n),p=ro(n),f=oo(n),b={id:e,title:r,description:n.get("description")?.value||null,status:l,products:c,discountConfig:p,widgetConfig:f,startsAt:d,endsAt:s,discountLabel:n.get("discount_label")?.value??null,selectedVariantIds:io(n),productQuantities:Qt(n,"product_quantities"),variantQuantities:Qt(n,"variant_quantities"),marketVisibility:ao(n),marketIds:lo(n),abTestId:n.get("ab_test_id")?.value||null,abWeight:so(n)};switch(a){case"fixed":return{...b,bundleType:"fixed"};case"volume":return{...b,bundleType:"volume",volumeTiers:co(n)};case"mix_match":return{...b,bundleType:"mix_match",minQuantity:po(n,"min_quantity",{min:1}),maxQuantity:null,productRules:Oe(n,"product_rules"),variantRules:Oe(n,"variant_rules")};case"bogo":return{...b,bundleType:"bogo",...to(n)};case"multi_step":return{...b,bundleType:"multi_step",steps:Zr(n),productRules:Oe(n,"product_rules"),variantRules:Oe(n,"variant_rules"),collectionProductIds:eo(n)}}}function Zr(e){let t=ye(e,"steps");if(!Array.isArray(t))throw new ae("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 ae("multi_step bundle has no valid steps","invalid_type");return r}function eo(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 to(e){let t=ye(e,"bogo_config");if(!t||typeof t!="object"||Array.isArray(t))throw new ae("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 ae("bogo_config is missing buy/get product ids","invalid_type");let i=a=>{let l=typeof a=="number"?a:Number(a);return!Number.isFinite(l)||l<1?1:Math.min(99,Math.floor(l))};return{buyProductId:r,getProductId:o,buyQuantity:i(n.buyQuantity),getQuantity:i(n.getQuantity)}}function no(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 ro(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 oo(e){return Wr(ye(e,"widget_config"))}function io(e){let t=ye(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 Qt(e,t){let n=ye(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 Oe(e,t){let n=ye(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 ao(e){return e.get("market_visibility")?.value==="specific"?"specific":"all"}function lo(e){let t=e.get("markets")?.value;if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>typeof r=="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 co(e){let t=ye(e,"volume_tiers");return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null).map(uo):[]}function uo(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 ye(e,t){let n=e.get(t)?.value;if(!n)return null;try{return JSON.parse(n)}catch{return null}}function po(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 dn(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 cn(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 un(e,t,n){return t?typeof e=="number"&&Number.isFinite(e)?Math.floor(e):n:-1}function Wt(e){return e.split("/").pop()??e}function pn(e,t){if(e.marketVisibility!=="specific")return!0;if(!t)return!1;let n=Wt(t);return e.marketIds.some(r=>Wt(r)===n)}function mo(e,t){return e===t?!0:/^\d+$/.test(t)&&e.endsWith(`/${t}`)}function mn(e,t){let n=t?.productId?.trim();if(n){let o=e.find(i=>mo(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 _t(e,t,n){let r=e.variantQuantities[n];return r!==void 0?r:e.productQuantities[t]??1}function bn(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 hn(e,t){await xn(e,{shopDomain:e.shopDomain,eventType:"bundle_impression",bundleGid:t.bundleGid,bundleType:t.bundleType,productId:t.productId,occurredAt:new Date().toISOString()})}async function fn(e,t){await xn(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function gn(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 xn(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 jt=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"]],ho=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function Ct(e){if(e.length>jt)return{ok:!1,error:`CSS exceeds ${jt.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&&!ho.test(o))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var fo="lb-custom-css-";function vn(e,t){if(typeof document>"u"||!t)return!1;let n=Ct(t);if(!n.ok||!n.css.trim())return!1;let r=fo+go(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 go(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 xo(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)}`}}function Ve(e,t,n){return t==="percentage"?Math.max(0,e*(1-n/100)):Math.max(0,e-n)}var vo={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 yn(e,t,n){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let r=parseFloat(e.amount);if(!Number.isFinite(r))return null;let o=vo[t.referenceUnit]??"";if(!o)return null;let i=e.currencyCode||n||"USD",a=xo(r,i),l=t.referenceValue,d=l===1?o:`${l}${o}`;return`${a}/${d}`}var we={};Jt(we,{computePosition:()=>wo,emptyTypeAheadState:()=>So,firstEnabled:()=>Fe,handleKey:()=>ko,pushTypeAheadChar:()=>Eo});var yo=4;function wo({trigger:e,viewportHeight:t,desiredHeight:n,margin:r=yo,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 xt={type:"passthrough",preventDefault:!1};function Fe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function $t(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function _o(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 Co(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 Gt(e){return e.length===1&&e!==" "&&/\S/.test(e)}function ko(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return xt;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:$t(a),preventDefault:!0};default:return Gt(n)?{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Fe(a),preventDefault:!0}:xt}switch(n){case"ArrowDown":return{type:"move-active",activeIndex:_o(a,o),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:Co(a,o),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:Fe(a),preventDefault:!0};case"End":return{type:"move-active",activeIndex:$t(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 Gt(n)?{type:"type-ahead",char:n,preventDefault:!1}:xt}}var To=500;function So(){return{buffer:"",lastTime:0}}function Eo(e,t,n,r,o=To){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 Io={};Jt(Io,{findVariantByOptions:()=>Ao,isOptionValueAvailable:()=>Lo,toPickerVariant:()=>Mo});function wn(e){return e.availableForSale&&!e.currentlyNotInStock&&e.quantityAvailable!=null&&e.quantityAvailable<=0}function Ie(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null||wn(e)?!0:e.quantityAvailable>=t:!1}function Ue(e){return e.currentlyNotInStock||e.quantityAvailable==null||wn(e)?null:Math.max(0,e.quantityAvailable)}function Ao(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 Lo(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 Mo(e,t){return{id:e.id,optionValues:e.selectedOptions.map(n=>n.value),available:t!==void 0?Ie(e,t):e.availableForSale}}var Kt="_lb_v",vt=null;function Po(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 _n(){try{let e=window.localStorage.getItem(Kt);if(e)return e;let t=Yt();return window.localStorage.setItem(Kt,t),t}catch{return vt||(vt=Yt()),vt}}function Yt(){return Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,10)}function Bo(e,t,n){let r=e.slice().sort((a,l)=>a.id<l.id?-1:a.id>l.id?1:0),o=Po(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 Cn(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,Bo(o,t,i))}),e.filter(o=>!o.abTestId||r.get(o.abTestId)===o)}function le(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 kt="_lime_bundle_gid",qo="_lime_bundle_type";function se(e,t){return[{key:kt,value:e},{key:qo,value:t}]}function kn(e){let t=e.slice(e.lastIndexOf("/")+1),n=Number(t);return Number.isFinite(n)&&t!==""?n:e}function ze(e){if(!e)return 0;let t=parseFloat(e);return Number.isFinite(t)?Math.round(t*100):0}function Ro(e){let t=e?.width,n=e?.height;return typeof t!="number"||typeof n!="number"||t<=0||n<=0?null:t/n}function No(e,t,n){return{id:kn(e.id),title:e.title,options:(e.selectedOptions??[]).map(r=>r.value),available:Ie(e,t),price:ze(e.price?.amount),compareAtPrice:ze(e.compareAtPrice?.amount),unitPrice:yn(e.unitPrice,e.unitPriceMeasurement,n),image:e.image?.url??null,inventoryQuantity:Ue(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=_t(n.quantities,e.id,o[0]?.id??""),l=o.map(s=>{let u=_t(n.quantities,e.id,s.id),c=No(s,u,i);return u!==a&&(c.quantity=u),c}),d=l.find(s=>s.available)??l[0];return{productId:kn(e.id),title:e.title,url:e.handle?"/products/"+e.handle:null,featuredImage:e.featuredImage?.url??null,featuredImageRatio:Ro(e.featuredImage),quantity:a,selectedVariantId:d?d.id:"",optionNames:(o[0]?.selectedOptions??[]).map(s=>s.name),variants:l}}function Qe(e){return e.products.map((t,n)=>Ce(t,e.id,{quantities:{productQuantities:e.productQuantities,variantQuantities:e.variantQuantities},allowedVariantIds:e.selectedVariantIds?.[n]??null}))}function Z(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 Tn(e){let t=Z(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 Sn(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 En(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 In(e){let t=[];for(let n=0;n<e.length;n++){let r=Z(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 Ho(e,t,n){let r=0,o=0;for(let i=0;i<e.length;i++){let a=Z(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 Tt(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}=Ho(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=""}else s.style.display="none"}function We(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],f=o(p);if(!f||f<1)continue;let b=p.options;for(let v=0;v<b.length;v++)b[v].disabled=!En(s.variants,f-1,b[v].value,u)}}let d=t();if(d){let s=Z(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=Sn(c,i());if(!p){let f=Z(c,c.selectedVariantId);a(f),f&&f.options&&l(c,f.options);return}c.selectedVariantId=p.id,l(c,p.options),n(p,c)})}function je(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&&Do(o,t,n)}function Do(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 St=new WeakMap;function $e(e,t,n){let r=e.querySelector("[data-thumbnail]");if(!r)return;let o=r.querySelector("img");if(!St.has(e)){let a=n||(o?o.src:null);a&&St.set(e,a)}let i=t.image||St.get(e)||null;if(i)if(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 Oo(e,t){let n=e.querySelector("[data-qty-inline]");n&&(n.textContent="\xD7"+t)}function Et(e,t,n,r){if(!t)return;$e(e,t,n.featuredImage),Oo(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 Ge(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"&&a!=null&&a>0&&i.style.setProperty("--lb-row-thumb-ratio",String(a)),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 de(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":""}),f=P("span","lb-bundle-countdown-label");f.textContent=t.countdownLabel??"Limited time offer",p.appendChild(f),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 An(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 f=P("span","lb-volume__tier-unit");f.textContent=n.unitLabel,p.appendChild(f)}if(u.appendChild(p),d.appendChild(u),a.badgeLabel||a.savingsLabel){let f=P("span","lb-volume__tier-right");if(a.badgeLabel){let b=P("span","lb-volume__tier-badge");b.textContent=a.badgeLabel,f.appendChild(b)}if(a.savingsLabel){let b=P("span","lb-volume__tier-savings");b.textContent=a.savingsLabel,f.appendChild(b)}d.appendChild(f)}i.appendChild(d)}),i}function Ke(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 ke(e){return e<10?"0"+e:String(e)}function ce(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 "+ke(u)+"h "+ke(c)+"m "+ke(p)+"s":ke(u)+"h "+ke(c)+"m "+ke(p)+"s"}l(),o-Date.now()>0&&(a=setInterval(l,1e3),e._lbCountdownInterval=a)}var ue={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"},quantity:"Quantity",increaseQuantity:"Increase quantity",decreaseQuantity:"Decrease quantity",allTypes:"All",editSelection:"Edit selection",addToCart:"Add to cart",bundlePrice:"Bundle price",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 Ye(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))}function Ln(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=[],Je=!1;function Fo(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 Xe(e){for(let t=re.length-1;t>=0;t--)Fo(e,re[t])||re[t].close()}function Mn(){for(let e=re.length-1;e>=0;e--)re[e].close()}function Vo(){Je||(document.addEventListener("pointerdown",Xe,!0),window.addEventListener("resize",Mn),window.addEventListener("scroll",Xe,!0),Je=!0)}function Uo(){Je&&(document.removeEventListener("pointerdown",Xe,!0),window.removeEventListener("resize",Mn),window.removeEventListener("scroll",Xe,!0),Je=!1)}function Pn(e){re.push(e),re.length===1&&Vo()}function Bn(e){let t=re.indexOf(e);t>=0&&re.splice(t,1),re.length===0&&Uo()}function qn(e){for(let t=re.length-1;t>=0;t--)re[t]!==e&&re[t].close()}var zo=32,Qo=8,Wo=8,It=new WeakMap;function Rn(e){return It.get(e)}function Nn(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,f=we.emptyTypeAheadState(),b=[];function v(){let A=[];for(let S=0;S<e.options.length;S++){let h=e.options[S];A.push({disabled:h.disabled,label:h.textContent||h.value})}return A}function F(){i.disabled=e.disabled;let A=v(),S=e.selectedIndex;for(l.textContent=S>=0&&A[S]?A[S].label:"";s.firstChild;)s.removeChild(s.firstChild);b=[];for(let h=0;h<A.length;h++){let E=t.createElement("li");E.id=r+"-opt-"+h,E.className="lb-dropdown-option",E.setAttribute("role","option"),E.setAttribute("aria-selected",h===S?"true":"false"),A[h].disabled&&E.setAttribute("aria-disabled","true"),E.setAttribute("data-value",e.options[h].value),E.setAttribute("data-index",String(h)),E.textContent=A[h].label,s.appendChild(E),b.push(E)}}function x(A){if(p>=0&&b[p]&&b[p].classList.remove("is-active"),p=A,A<0||!b[A]){i.setAttribute("aria-activedescendant","");return}let S=b[A];S.classList.add("is-active"),i.setAttribute("aria-activedescendant",S.id);let h=S.offsetTop,E=h+S.offsetHeight,V=s.scrollTop,g=V+s.clientHeight;h<V?s.scrollTop=h:E>g&&(s.scrollTop=E-s.clientHeight)}function T(){let A=i.getBoundingClientRect();if(A.width===0)return!1;let h=Math.min(b.length||1,Wo)*zo+Qo,E=Ln(i),V=E?{top:E.getBoundingClientRect().top,bottom:E.getBoundingClientRect().bottom}:void 0,g=we.computePosition({trigger:{top:A.top,bottom:A.bottom,left:A.left,width:A.width},viewportHeight:window.innerHeight,desiredHeight:h,clip:V});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 z(){if(c)return;qn(W),c=!0,s.hidden=!1,i.setAttribute("aria-expanded","true"),T()||requestAnimationFrame(()=>{T()});let A=v(),S=e.selectedIndex;S>=0&&A[S]&&!A[S].disabled?x(S):x(we.firstEnabled(A)),Pn(W)}function I(A){c&&(c=!1,s.hidden=!0,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-activedescendant",""),p>=0&&b[p]&&b[p].classList.remove("is-active"),p=-1,Bn(W),A&&i.focus())}function R(A){let S=e.options[A];!S||S.disabled||(e.value!==S.value&&(e.value=S.value,e.dispatchEvent(new Event("change",{bubbles:!0}))),F(),I(!0))}function _(A){let S=v(),h=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:S});switch(h.preventDefault&&A.preventDefault(),h.type){case"open":z(),h.activeIndex>=0&&x(h.activeIndex);break;case"close":I(h.restoreFocus);break;case"move-active":x(h.activeIndex);break;case"commit":R(h.index);break;case"type-ahead":{let E=we.pushTypeAheadChar(f,h.char,Date.now(),S);f=E.newState,E.matchedIndex!==null&&(c||z(),x(E.matchedIndex));break}}}function C(A){A.preventDefault(),c?I(!1):z()}function m(A){let S=A.target;for(;S&&S!==s;){if(S.classList&&S.classList.contains("lb-dropdown-option")){let h=parseInt(S.getAttribute("data-index")??"",10);return isNaN(h)?null:h}S=S.parentNode}return null}function H(A){let S=m(A);S!==null&&R(S)}function N(A){let S=A.target;for(;S&&S!==s;){if(S.classList&&S.classList.contains("lb-dropdown-option")){if(S.getAttribute("aria-disabled")==="true")return;let h=parseInt(S.getAttribute("data-index")??"",10);!isNaN(h)&&h!==p&&x(h);return}S=S.parentNode}}function D(){setTimeout(()=>{c&&(o.contains(document.activeElement)||I(!1))},0)}function B(){F()}let G=new MutationObserver(()=>{F()});G.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});function K(A){A.preventDefault()}i.addEventListener("click",C),i.addEventListener("keydown",_),o.addEventListener("focusout",D),s.addEventListener("mousedown",K),s.addEventListener("click",H),s.addEventListener("mousemove",N),e.addEventListener("change",B);function j(){c&&I(!1),G.disconnect(),i.removeEventListener("click",C),i.removeEventListener("keydown",_),o.removeEventListener("focusout",D),s.removeEventListener("mousedown",K),s.removeEventListener("click",H),s.removeEventListener("mousemove",N),e.removeEventListener("change",B),o.parentNode?.removeChild(o),s.parentNode?.removeChild(s),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),It.delete(e)}let W={shell:o,listbox:s,select:e,close:()=>I(!1),destroy:j};return It.set(e,W),F(),W}var jo="select.lb-bundle-variant-select:not(.lb-dropdown-state), select.lb-mix-match__variant-select:not(.lb-dropdown-state)";function Hn(e){let n=(e??document).querySelectorAll(jo);for(let r=0;r<n.length;r++)Nn(n[r])}function Dn(e){let n=(e??document).querySelectorAll("select.lb-dropdown-state");for(let r=0;r<n.length;r++)Rn(n[r])?.destroy()}function fe(e){return Hn(e),()=>Dn(e)}function On(e,t,n,r){let o=t.widgetConfig,i=Qe(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=le(l),s=ue,u=de("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(F=>F.available),f=Ge(c,s,{isOos:p,href:c.url,thumbnailRatio:o.productList?.thumbnailRatio});if(u.products.appendChild(f),p)continue;let b=Tn(c);b&&(c.selectedVariantId=b.id);let v=b??Z(c,c.selectedVariantId);je(f,c,v),Et(f,v,c,d),We(f,()=>c,(F,x)=>{Et(f,F,x,d),Tt(u.root,i,d)})}if(a.length>0){u.cta.disabled=!0;let c=u.cta.querySelector("[data-cta-label]");c&&(c.textContent=Ye(s,a.length))}else u.cta.addEventListener("click",()=>{n(In(i).map(c=>({merchandiseId:"gid://shopify/ProductVariant/"+c.variantId,quantity:c.quantity,attributes:se(t.id,t.bundleType)})))});e.appendChild(u.root),ce(u.root),Tt(u.root,i,d),r?.(fe(u.root))}function X(e,t){let n=e;for(let r in t)n=n.split("__"+r+"__").join(String(t[r]));return n}function Ze(e,t){let n=t.needsSpots;if(!n)return"Needs "+e+" spots";let r=new Intl.PluralRules(t.locale||"en").select(e);return X(n[r]||n.other||"__COUNT__",{COUNT:e})}function et(e,t,n){return X(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function Fn(e,t){return e>0?X(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function Vn(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?X(r.chooseMoreUnlock||"Choose __COUNT__ more to unlock __PCT__% off",{COUNT:e,PCT:o}):X(r.chooseMoreComplete||"Choose __COUNT__ more to complete your bundle",{COUNT:e})}var $o={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"?$o: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 tt(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 nt(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 me(e,t){for(let n=0;n<e.length;n++)if(e[n]&&e[n].variantId===t)return n;return-1}function Un(e,t){let n=me(e,t);return n===-1?0:e[n].quantity||0}function zn(e,t){return e.min<=t}function Qn(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 Wn=[120,180,240],At=[480,600,768,1024],jn="60px",$n="(max-width: 767px) 45vw, 228px";function Te(e,t){return e&&(/[?&]width=\d+/.test(e)?e.replace(/([?&])width=\d+/,"$1width="+t):e+(e.indexOf("?")===-1?"?":"&")+"width="+t)}function Ae(e,t){return e?t.map(n=>Te(e,n)+" "+n+"w").join(", "):""}function rt(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 Gn=600;function ot(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 f=e.variants.find(g=>g.available)??null,b=f&&f.image||e.featuredImage;if(b){let g=document.createElement("img");g.src=Te(b,Gn),g.srcset=Ae(b,At),g.sizes=$n,g.alt=e.title,g.loading="lazy",c.appendChild(g)}d.appendChild(c);let v=document.createElement("div");v.className="lb-mix-match__modal-product-info";let F=document.createElement("p");if(F.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,F.appendChild(g)}else F.textContent=e.title;v.appendChild(F);let x=f??(e.variants.length>0?e.variants[0]:null),T=g=>te(e.id,o,g?g.id:null),z=x?T(x).min:1,I=document.createElement("p");I.className="lb-mix-match__modal-product-price",I.setAttribute("data-row-price","");let R=document.createElement("span");R.setAttribute("data-row-price-sale",""),x&&(R.textContent=a(x.price*z)),I.appendChild(R);let _=document.createElement("s");_.className="lb-mix-match__modal-product-compare",_.setAttribute("data-row-compare",""),I.appendChild(_),v.appendChild(I);function C(g,Q,$){let y=Q&&Q.compareAtPrice?Q.compareAtPrice*$:0,k=Q?Q.price*$:0;y>k?(g.textContent=a(y),g.hidden=!1):(g.textContent="",g.hidden=!0)}C(_,x,z);let m=document.createElement("p");m.className="lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price",m.setAttribute("data-row-unit-price","");let H=x?x.unitPrice:null;H?m.textContent=H:m.hidden=!0,v.appendChild(m);let N=null,D=null,B=T(x).min,G=T(x).max,K=null,j=null;if(e.available&&n.showQtySelector){N=document.createElement("div"),N.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 Q=document.createElement("button");Q.type="button",Q.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--minus",Q.setAttribute("aria-label",r.decreaseQuantity||"Decrease quantity"),Q.textContent="\u2212",D=document.createElement("span"),D.className="lb-mix-match__qty-stepper-value",D.setAttribute("data-row-qty",""),D.setAttribute("aria-live","polite"),D.textContent=String(T(x).min);let $=document.createElement("button");$.type="button",$.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--plus",$.setAttribute("aria-label",r.increaseQuantity||"Increase quantity"),$.textContent="+",g.appendChild(Q),g.appendChild(D),g.appendChild($),N.appendChild(g);let y=D;K=()=>{y.textContent=String(B),y.setAttribute("data-qty",String(B)),Q.disabled=u||B<=T(x).min,$.disabled=u||B>=G},j=(M,L=0)=>{let w=M?M.id:null,q=w===null?0:i.ownQty(w),O=w===null?0:i.productUnitsElsewhere(e.id,w),U=w===null?0:i.swapUnits(e.id,w),J=M?M.inventoryQuantity:null,ee=Math.max(0,L-q),be=typeof J=="number"?Math.max(0,J-ee):void 0,ve=pe(w,o)?.max,ne=T(M).min;G=U>0?typeof be=="number"?Math.min(U,be):U:Qn(l,i.remainingSpots(),be,q,O,ve),G<ne?B=ne:(B>G&&(B=G),B<ne&&(B=ne)),K()};let k=()=>{x&&i.commitQty(x.id,B)&&n.onCommittedQtyChanged()};Q.addEventListener("click",()=>{B>T(x).min&&(B-=1),K(),k()}),$.addEventListener("click",()=>{B<G&&(B+=1),K(),k()}),x?j(x):K()}let W=e.variants.slice(),A=[];if(W.length>1){let g=e.optionNames||[];x=W.find(w=>w.available!==!1)??W[0];let Q=()=>{let w=A.map(q=>q.value);for(let q of W)if(!(!q.options||q.options.length!==w.length)&&q.options.every((O,U)=>O===w[U]))return q;return null},$=w=>{if(!(!w||!w.options))for(let q=0;q<A.length&&q<w.options.length;q++)A[q].value!==w.options[q]&&(A[q].value=w.options[q])},y=(w,q,O)=>{for(let U of W){if(U.available===!1||!U.options||U.options[w]!==q)continue;let J=!0;for(let ee=0;ee<U.options.length;ee++)if(ee!==w&&U.options[ee]!==O[ee]){J=!1;break}if(J)return!0}return!1},k=w=>{for(let q=0;q<A.length;q++){let O=A[q];for(let U=0;U<O.options.length;U++)O.options[U].disabled=!y(q,O.options[U].value,w)}},M=()=>{let w=Q();if(!w){$(x),x?.options&&k(x.options);return}x=w,d.setAttribute("data-selected-variant-id",String(w.id));let q=T(w).min;R.textContent=a(w.price*q),C(_,w,q),w.unitPrice?(m.textContent=w.unitPrice,m.hidden=!1):(m.textContent="",m.hidden=!0);let O=c.querySelector("img"),U=w.image||e.featuredImage;O&&U&&(O.src=Te(U,Gn),O.srcset=Ae(U,At)),j?.(w,i.variantUnitsElsewhere(w.id)),w.options&&k(w.options),V()},L=document.createElement("div");L.className="lb-bundle-variant-option-groups";for(let w=0;w<g.length;w++){let q=g[w],O=document.createElement("div");O.className="lb-bundle-variant-option-group";let U=document.createElement("span");U.className="lb-bundle-variant-option-label",U.textContent=q,O.appendChild(U);let J=document.createElement("select");J.className="lb-mix-match__variant-select",J.setAttribute("data-variant-option",""),J.setAttribute("data-option-position",String(w+1)),J.name="lb-variant-"+e.id+"-"+(w+1),J.setAttribute("aria-label",q);let ee=Object.create(null),be=x?.options?.[w];for(let ve of W){let ne=ve.options&&ve.options[w];if(!ne||ee[ne])continue;ee[ne]=!0;let he=document.createElement("option");he.value=ne,he.textContent=ne,ne===be&&(he.selected=!0),J.appendChild(he)}J.addEventListener("change",M),A.push(J),O.appendChild(J),L.appendChild(O)}v.appendChild(L),x&&(d.setAttribute("data-selected-variant-id",String(x.id)),x.options&&k(x.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,v.appendChild(g)}let S=null;e.available&&(S=document.createElement("span"),S.className="lb-mix-match__modal-needs-spots",S.hidden=!0,v.appendChild(S));let h=null;if(e.available){let g=document.createElement("div");g.className="lb-mix-match__modal-product-actions",N&&g.appendChild(N),h=document.createElement("button"),h.type="button",h.className="lb-mix-match__modal-add",h.textContent=r.addItem||"Add",h.setAttribute("aria-label",(r.addItem||"Add")+" "+e.title),h.setAttribute("data-add-product",String(t)),g.appendChild(h),v.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"),v.appendChild(g)}d.appendChild(v);let E=x?x.id:null;function V(){if(!x)return;let g=x,Q=g.inventoryQuantity,$=typeof Q=="number"?i.variantUnitsElsewhere(g.id):0,y=i.isInBundle(g.id);if(j){let O=i.ownQty(g.id);O>0?B=O:E!==g.id&&(B=T(g).min),E=g.id,j(g,$)}let k=i.swapUnits(e.id,g.id),M=T(g),L=k>=M.min,w=i.remainingSpots(),q=!y&&!L&&!zn(M,w);if(S&&(q&&w>0?(S.textContent=Ze(M.min,r),S.hidden=!1):S.hidden=!0),h)if(y)h.disabled=!1,i.canRemove(g.id)?(h.textContent=r.removeItem||"Remove",h.setAttribute("aria-label",(r.removeItem||"Remove")+" "+e.title),h.classList.remove("lb-mix-match__modal-add--required")):(h.disabled=!0,h.textContent=r.required||"Required",h.setAttribute("aria-label",e.title+" is required and cannot be removed"),h.classList.add("lb-mix-match__modal-add--required")),h.classList.add("lb-mix-match__modal-add--added"),d.classList.add("lb-mix-match__modal-product--in-bundle"),p.hidden=!1;else{let O=r.swapItem||"Swap",U=L?O:r.addItem||"Add";h.textContent=U,h.setAttribute("aria-label",U+" "+e.title),h.classList.remove("lb-mix-match__modal-add--added"),h.classList.remove("lb-mix-match__modal-add--required"),d.classList.remove("lb-mix-match__modal-product--in-bundle"),p.hidden=!0;let J=typeof Q=="number"?Math.max(0,Q-$)<M.min:!1;if(L)h.disabled=J;else{let ee=l.max-i.productUnitsElsewhere(e.id,g.id)<M.min;h.disabled=J||ee||q||i.isFull()}}s=!e.available,u=!e.available||!y&&!!h?.disabled,K?.();for(let O of A)O.disabled=s}return{el:d,refresh:V}}var Go='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function it(e){let t=e.querySelectorAll(Go),n=[];for(let r=0;r<t.length;r++)t[r].offsetParent!==null&&n.push(t[r]);return n}var Lt=0,Le=0;function at(){if(Le++,Le>1)return;Lt=window.pageYOffset||document.documentElement.scrollTop;let e=document.body;e.style.position="fixed",e.style.top="-"+Lt+"px",e.style.left="0",e.style.right="0",e.style.overflow="hidden"}function lt(){if(Le<=0||(Le--,Le>0))return;let e=document.body;e.style.position="",e.style.top="",e.style.left="",e.style.right="",e.style.overflow="",window.scrollTo(0,Lt)}function st(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 Me="__all__",Ko=300,Yo=200;function Kn(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=h=>a?a.querySelector(h):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]"),f=l("[data-modal-live]"),b=l("[data-modal-close]"),v=l("[data-modal-done]"),F=l("[data-modal-footer-count]"),x=l("[data-modal-subtitle]"),T=l("[data-modal-filters]"),z=n.showTypeFilters!==!1,I=Me,R=!1,_=!1,C=!1,m=[];function H(){for(let h of m)h.refresh()}function N(){let h=Math.min(oe(i),e.requiredQty),E=Math.max(0,e.requiredQty-h);F&&(F.textContent=et(h,e.requiredQty,r)),x&&(x.textContent=Vn(E,n.discountType,n.discountValue,r))}function D(){H(),N()}function B(){if(c){e.dropdown?.unbindAll(c),c.innerHTML="",m=[];for(let h=0;h<o.length;h++){let E=ot(o[h],h,{t:r,rulesMap:e.rulesMap,showQtySelector:e.showQtySelector,capacity:e.rowCapacity,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),D()}});m.push(E),c.appendChild(E.el)}e.dropdown?.bindAll(c),c.addEventListener("click",G)}}function G(h){let E=h.target.closest("[data-add-product]");if(!E||E.disabled)return;let V=parseInt(E.getAttribute("data-add-product")??"",10),g=o[V];if(!g)return;let Q=E.closest(".lb-mix-match__modal-product"),$=Q&&Q.getAttribute("data-selected-variant-id"),y=($?g.variants.find(q=>q.id===parseInt($,10)):null)??null;if(y||(y=g.variants.find(q=>q.available)??null),!y)return;if(e.isInBundle(y.id)){e.removeVariant(y.id),D();return}let k=Q?.querySelector("[data-row-qty]"),M=k?Math.max(1,parseInt(k.getAttribute("data-qty")||k.textContent||"",10)||1):nt(g.id,e.rulesMap,y.id),L={productId:g.id,variantId:y.id,title:g.title,url:g.url||null,variantTitle:y.title,featuredImage:y.image||g.featuredImage||null,price:y.price,compareAtPrice:y.compareAtPrice||null,unitPrice:y.unitPrice||null,quantity:M},w=e.swapUnitsFor(g.id,y.id);if(w>0){e.swapVariant(L,Math.min(M,w)),D();return}e.atCapacity()||(e.addSelection(L),D())}function K(){if(!T||!z)return;let h=[],E=Object.create(null);for(let V of o){let g=(V.type||"").trim();g&&!E[g]&&(E[g]=!0,h.push(g))}if(h.length<2){T.style.display="none",d?.classList.add("lb-mix-match__modal--filters-hidden");return}T.innerHTML="";for(let V of[Me,...h]){let g=document.createElement("button");g.type="button",g.className="lb-mix-match__filter",g.setAttribute("data-filter",V),g.setAttribute("aria-pressed",V===I?"true":"false"),V===I&&g.classList.add("lb-mix-match__filter--active"),g.textContent=V===Me?r.allTypes||"All":V,g.addEventListener("click",()=>{I=V,j(),W(s?s.value:"")}),T.appendChild(g)}}function j(){if(!T)return;let h=T.querySelectorAll("[data-filter]");for(let E=0;E<h.length;E++){let V=h[E].getAttribute("data-filter")===I;h[E].classList.toggle("lb-mix-match__filter--active",V),h[E].setAttribute("aria-pressed",V?"true":"false")}}function W(h){if(!c)return;let E=Se(h),V=c.querySelectorAll("[data-product-item]"),g=0;for(let Q=0;Q<V.length;Q++){let $=V[Q].getAttribute("data-title")??"",y=V[Q].getAttribute("data-type")||"",k=(!E||$.indexOf(E)!==-1)&&(I===Me||y===I);V[Q].classList.toggle("lb-hidden",!k),k&&g++}p&&(p.style.display=g===0&&E.length>0?"":"none"),u&&(u.style.display=h.length>0?"":"none"),f&&(f.textContent=X(r.nProductsShown||"__COUNT__ products shown",{COUNT:g}))}if(s){let h=rt(()=>W(s.value),Yo);s.addEventListener("input",h)}u&&u.addEventListener("click",()=>{s&&(s.value="",W(""),s.focus())});function A(){if(!(!a||C)){if(C=!0,R||(B(),R=!0),_||(K(),_=!0),D(),I=Me,j(),s&&(s.value=""),W(s?s.value:""),c){let h=Object.create(null);for(let E of i)h[String(E.productId)]=!0;st(c,m.map(E=>E.el),E=>h[String(o[E].id)]===!0),c.scrollTop=0}a.style.display="",a.offsetHeight,a.classList.add("lb-mix-match__modal-overlay--open"),at(),setTimeout(()=>{b?b.focus():d?.focus()},50)}}function S(){if(!a||!C)return;C=!1,a.classList.remove("lb-mix-match__modal-overlay--open"),lt(),setTimeout(()=>{C||(a.style.display="none")},Ko);let h=e.fallbackFocus;h&&typeof h.focus=="function"&&setTimeout(()=>h.focus(),0)}if(b?.addEventListener("click",S),v?.addEventListener("click",S),a){let h=null;a.addEventListener("mousedown",E=>{h=E.target}),a.addEventListener("mouseup",E=>{E.target===a&&h===a&&S(),h=null})}return document.addEventListener("keydown",h=>{if(C){if(h.key==="Escape"){h.preventDefault(),S();return}if(h.key==="Tab"&&d){let E=it(d);if(E.length===0){h.preventDefault();return}let V=E[0],g=E[E.length-1];h.shiftKey&&document.activeElement===V?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),V.focus())}}}),{open:A,close:S,isOpen:()=>C,refresh:D,overlay:a}}function Yn(e,t){return Math.max(0,t-oe(e))}function Mt(e,t){return oe(e)>=t}function Jn(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 dt(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 Pt(e,t,n,r){let o=te(t,r);return!o.required||o.max!==o.min||me(e,n)!==-1?0:dt(e,t,n)}function Jo(){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 ct(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 b=document.createElement("img");b.src=Te(e.featuredImage,240),b.srcset=Ae(e.featuredImage,Wn),b.sizes=jn,b.alt=e.title,b.loading="lazy",l.appendChild(b)}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 b=document.createElement("span");b.className="lb-mix-match__filled-variant",b.textContent=e.variantTitle,d.appendChild(b)}let u=document.createElement("span");u.className="lb-mix-match__filled-price";let c=e.compareAtPrice||0;if(c>e.price){let b=document.createElement("s");b.className="lb-mix-match__filled-compare",b.textContent=n(c),u.appendChild(b)}let p=document.createElement("span");p.className="lb-bundle-product-price",p.textContent=n(e.price),u.appendChild(p);let f=document.createElement("span");if(f.className="lb-bundle-qty-inline",f.textContent="\xD7"+(e.quantity||1),u.appendChild(f),d.appendChild(u),e.unitPrice){let b=document.createElement("span");b.className="lb-bundle-product-unit-price",b.textContent=e.unitPrice,d.appendChild(b)}if(a.appendChild(d),r){let b=document.createElement("button");b.type="button",b.className="lb-mix-match__slot-remove",b.setAttribute("aria-label",(t.removeItem||"Remove")+" "+e.title),b.appendChild(Jo()),b.addEventListener("click",v=>{v.stopPropagation(),o()}),a.appendChild(b)}else{let b=document.createElement("span");b.className="lb-mix-match__slot-required",b.textContent=t.required||"Required",a.appendChild(b)}return a.addEventListener("click",i),a}function Xn(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(ct(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 Zn(e,t,n,r,o,i){let a=e.querySelector("[data-pricing-section]");if(oe(t)<n){a&&(a.style.display="none");return}a&&(a.style.display="");let l=0;for(let d=0;d<t.length;d++)l+=t[d].price*(t[d].quantity||1);l>0&&r.discountType&&i(e,o(l,r.discountType,r.discountValue??0),l)}function er(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 f=0;f<s.length;f++)s[f].classList.toggle("lb-mix-match__progress-segment--filled",f<i);let u=d.querySelector("[data-progress-count]");u&&(u.textContent=et(i,r,o));let c=d.querySelector("[data-progress-remaining]");c&&(c.textContent=Fn(a,o));let p=d.querySelector(".lb-mix-match__progress-segments");p&&p.setAttribute("aria-valuenow",String(i))}}function ut(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 tr(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 b of u.variants){let v=pe(b.id,t);!v?.required||!b.available||(a.push(i(u,b,Math.max(1,v.min))),c=!0)}if(c)continue;let p=te(u.id,t);if(!p.required)continue;let f=o(u);f&&a.push(i(u,f,Math.max(1,p.min)))}if(a.length||!r?.enabled)return a;let l=u=>u.available&&te(u.id,t).min<=n,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 nr(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 pt(e){let t="lb-modal-title-"+e.domId,n=Y("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.bundleGid,style:"display: none;"}),r=Y("div","lb-mix-match__modal"+(e.showTypeFilters?"":" lb-mix-match__modal--filters-hidden"),{role:"dialog","aria-modal":"true","aria-labelledby":t,tabindex:"-1"}),o=Y("div","lb-mix-match__modal-header"),i=Y("div","lb-mix-match__modal-header-top"),a=Y("div","lb-mix-match__modal-heading"),l=Y("h4","lb-mix-match__modal-title",{id:t});e.wizard&&l.setAttribute("tabindex","-1"),l.textContent="Add to your bundle",a.appendChild(l),a.appendChild(Y("p","lb-mix-match__modal-subtitle",{"data-modal-subtitle":""})),i.appendChild(a);let d=Y("button","lb-mix-match__modal-close",{type:"button","data-modal-close":"","aria-label":"Close"});d.appendChild(nr([["5","5","15","15"],["15","5","5","15"]])),i.appendChild(d),o.appendChild(i);let s=Y("div","lb-mix-match__progress lb-mix-match__modal-progress",{"data-progress":""}),u=Y("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e.segmentCount??0)});if(e.wizard)u.setAttribute("data-modal-step-segments","");else for(let v=0;v<(e.segmentCount??0);v++)u.appendChild(Y("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));if(s.appendChild(u),o.appendChild(s),r.appendChild(o),e.showSearch){let v=Y("div","lb-mix-match__modal-search"),F=Y("input","lb-mix-match__modal-search-input",{type:"text","data-modal-search":"",role:"searchbox","aria-label":"Search products",placeholder:"Search products",autocomplete:"off"});v.appendChild(F);let x=Y("button","lb-mix-match__modal-search-clear",{type:"button","data-modal-search-clear":"","aria-label":"Clear search",style:"display: none;"});x.appendChild(nr([["5","5","15","15"],["15","5","5","15"]])),v.appendChild(x),r.appendChild(v)}e.showTypeFilters&&r.appendChild(Y("div","lb-mix-match__filters",{"data-modal-filters":"",role:"group","aria-label":"Filter by type"})),r.appendChild(Y("div","lb-mix-match__modal-list",{"data-modal-list":""}));let c=Y("div","lb-mix-match__modal-empty",{"data-modal-empty":"",style:"display: none;"}),p=document.createElement("p");p.textContent="No products match your search",c.appendChild(p),r.appendChild(c),r.appendChild(Y("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"}));let f=Y("div",e.wizard?"lb-mix-match__modal-footer lb-multi-step__modal-footer":"lb-mix-match__modal-footer");if(e.wizard){let v=Y("button","lb-multi-step__modal-back",{type:"button","data-modal-back":"",style:"display: none;"});v.textContent="Back",f.appendChild(v)}if(f.appendChild(Y("span","lb-mix-match__modal-footer-count",{"data-modal-footer-count":"","aria-live":"polite"})),e.wizard){let v=Y("button","lb-mix-match__modal-done",{type:"button","data-modal-next":"",style:"display: none;"});v.textContent="Next",f.appendChild(v)}let b=Y("button","lb-mix-match__modal-done",{type:"button","data-modal-done":"",...e.wizard?{style:"display: none;"}:{}});return b.textContent="Done",f.appendChild(b),r.appendChild(f),n.appendChild(r),n}function rr(e,t,n,r,o){let i=t.widgetConfig,a=ue,l=t.minQuantity||1,d=tt(t.productRules,t.variantRules),u=Qe(t).map((_,C)=>({id:Number(_.productId),title:_.title??"",url:_.url??null,type:t.products[C]?.productType??"",featuredImage:_.featuredImage??null,available:_.variants.some(m=>m.available),optionNames:_.optionNames,variants:_.variants.map(m=>({id:Number(m.id),title:m.title,options:m.options,available:m.available,price:m.price,compareAtPrice:m.compareAtPrice,unitPrice:m.unitPrice,image:m.image,inventoryQuantity:m.inventoryQuantity??null}))}));if(!u.length||u.filter(_=>_.available).length===0)return;let p=le(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),f=de("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});f.root.setAttribute("data-required-quantity",String(l)),f.products.before(Ke(l));let b=document.createElement("div");b.className="lb-mix-match__slots lb-edge-fade",b.setAttribute("data-selection-slots",""),f.products.replaceWith(b);let v=document.createElement("button");v.type="button",v.className="lb-mix-match__add-product",v.setAttribute("data-add-product-trigger",""),v.textContent=(a.addItem,"Add a product"),b.after(v);let F=pt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:i.showSearch!==!1,showTypeFilters:i.mixMatchShowTypeFilters!==!1,segmentCount:l,wizard:!1});f.root.appendChild(F);let x=o?t.products.findIndex(_=>_.handle===o):-1,T=tr(u,d,l,{enabled:!!o,currentProductId:x!==-1?u[x]?.id??null:null}),z={remainingSpots:()=>Yn(T,l),ownQty:_=>Un(T,_),variantUnitsElsewhere:_=>Jn(T,_),productUnitsElsewhere:(_,C)=>dt(T,_,C),swapUnits:(_,C)=>Pt(T,_,C,d),isInBundle:_=>me(T,_)!==-1,canRemove:_=>{let C=me(T,_);return C!==-1&&Ee(T,T[C],d)},isFull:()=>Mt(T,l),commitQty:(_,C)=>{let m=me(T,_);return m===-1||T[m].quantity===C?!1:(T[m].quantity=C,!0)}};function I(){Xn(f.root,T,l,t,{formatMoney:p,rulesMap:d,onRemove:_=>{Ee(T,T[_],d)&&(T.splice(_,1),I(),R.isOpen()&&R.refresh())},onEdit:()=>R.open()}),Zn(f.root,T,l,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},(_,C,m)=>Ve(_,C,m),ut(p)),er(f.root,R.overlay,T,l,a)}let R=Kn({container:f.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:T,formatMoney:p,rowCapacity:z,dropdown:void 0,portalTarget:null,fallbackFocus:v,onSelectionChanged:I,addSelection:_=>{if(oe(T)+(_.quantity||1)>l)return;let C=pe(_.variantId,d)?.max,m=te(_.productId,d).max-dt(T,_.productId,_.variantId);typeof C=="number"&&(m=Math.min(m,C)),!((_.quantity||1)>m)&&(T.push(_),I())},removeVariant:_=>{let C=me(T,_);C===-1||!Ee(T,T[C],d)||(T.splice(C,1),I())},swapVariant:(_,C)=>{let m=0;for(let H=T.length-1;H>=0&&m<C;H--){let N=T[H];if(N.productId!==_.productId||N.variantId===_.variantId)continue;let D=Math.min(N.quantity||1,C-m);D>=(N.quantity||1)?T.splice(H,1):N.quantity=(N.quantity||1)-D,m+=D}m>0&&(_.quantity=m,T.push(_),I())},swapUnitsFor:(_,C)=>Pt(T,_,C,d),isInBundle:_=>me(T,_)!==-1,atCapacity:()=>Mt(T,l)});v.addEventListener("click",()=>{R.isOpen()||R.open()}),f.cta.addEventListener("click",()=>{oe(T)<l||n(T.map(_=>({merchandiseId:"gid://shopify/ProductVariant/"+_.variantId,quantity:_.quantity||1,attributes:se(t.id,t.bundleType)})))}),e.appendChild(f.root),ce(f.root),I(),r?.(fe(f.root))}var or="lb-volume__tier--oos";function Xo(e){return parseInt(e.getAttribute("data-tier-qty")??"",10)||0}function Pe(e){return e.getAttribute("aria-disabled")==="true"}function ir(e,t){for(let n=0;n<e.length;n++){let r=e[n];t!==null&&Xo(r)>t?(r.classList.add(or),r.setAttribute("aria-disabled","true")):(r.classList.remove(or),r.removeAttribute("aria-disabled"))}}function ar(e,t){let n=e[t];if(n&&!Pe(n))return t;for(let r=0;r<e.length;r++)if(!Pe(e[r]))return r;return-1}function Bt(e,t,n){let r=t+n;for(;r>=0&&r<e.length;){if(!Pe(e[r]))return r;r+=n}return t}function lr(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 Zo(e,t,n){let r=parseInt(n.getAttribute("data-tier-qty")??"",10),o=lr(e,t,n),i=o*r,a=e*r;return{qty:r,priceEach:o,totalPrice:i,undiscountedTotal:a,totalSavings:a-i}}function ei(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 sr(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(lr(t,n,i)));let l=i.querySelector(".lb-volume__tier-compare");l&&(l.textContent=r(t))}}function dr(e,t,n,r,o,i,a){for(let x=0;x<t.length;x++)t[x].setAttribute("aria-checked",x===o?"true":"false"),t[x].setAttribute("tabindex",x===o?"0":"-1");let{qty:l,totalPrice:d,undiscountedTotal:s,totalSavings:u}=Zo(n,r,t[o]),c=e.querySelector("[data-item-count]");if(c){let x=ei(l,i);x!==null&&(c.textContent=x)}let p=e.querySelector("[data-total-price]");p&&(p.textContent=a(d));let f=e.querySelector("[data-compare-price]");f&&(u>0?(f.textContent=a(s),f.style.display=""):f.style.display="none");let b=e.querySelector("[data-savings-bar]"),v=e.querySelector("[data-savings-amount]"),F=e.querySelector("[data-savings-percent]");if(b)if(u>0){if(v&&(v.textContent=a(u)),F){let x=s>0?Math.round(u*100/s):0;F.textContent="("+x+"%)"}b.style.display=""}else b.style.display="none"}function cr(e,t,n,r){let o=t.widgetConfig,i=mn(t.products,r);if(!i)return;let a=i.variants.nodes,l=Math.min(...t.volumeTiers.map(C=>C.minQuantity)),d=a.find(C=>Ie(C,l))??a.find(C=>C.availableForSale)??a[0];if(!d)return;let s=ze(d.price.amount),u=t.discountConfig.discountType,c=le(i.priceRange.minVariantPrice.currencyCode),p=ue,f=dn(t.volumeTiers,u),b=cn(o.defaultTier,t.volumeTiers.length,f),v=un(o.popularBadge?.tierIndex,o.popularBadge?.visible!==!1,f),F=t.volumeTiers.map((C,m)=>{let H=u==="fixed_amount"?0:Math.round(C.percentage??0),N=u==="fixed_amount"?Math.round((C.amount??0)*100):0,D=u==="fixed_amount"?Math.max(0,s-N):Math.max(0,s-Math.floor(s*H/100)),B=s>0?Math.round((s-D)*100/s):0;return{quantity:C.minQuantity,percent:H,amountCents:N,label:X(p.buyQty||"Buy __COUNT__",{COUNT:C.minQuantity}),savingsLabel:B>0?"Save "+B+"%":null,badgeLabel:m===v?o.popularBadge?.text||"Most popular":null,selected:m===b}});if(!F.length)return;let x=de("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}),T=An(F,"Select quantity",{showCompare:o.pricing?.showComparePrice!==!1,showPriceEach:o.pricing?.showPerUnitPrice!==!1,unitLabel:(p.each||"each").trim()});x.products.replaceWith(T);let z=T.querySelectorAll("[data-tier-index]");sr(z,s,u,c),ir(z,Ue(d));let I=ar(z,b),R=I===-1;R&&(I=b);let _=()=>dr(x.root,z,s,u,I,p,c);if(T.addEventListener("click",C=>{let m=C.target.closest("[data-tier-index]");!m||Pe(m)||(I=parseInt(m.getAttribute("data-tier-index")??"",10)||0,_())}),T.addEventListener("keydown",C=>{C.key==="ArrowDown"||C.key==="ArrowRight"?(C.preventDefault(),I=Bt(z,I,1),_(),z[I].focus()):(C.key==="ArrowUp"||C.key==="ArrowLeft")&&(C.preventDefault(),I=Bt(z,I,-1),_(),z[I].focus())}),R){x.cta.disabled=!0;let C=x.cta.querySelector("[data-cta-label]");C&&(C.textContent=p.outOfStock||"Out of stock")}else x.cta.addEventListener("click",()=>{let C=parseInt(z[I].getAttribute("data-tier-qty")??"",10);n([{merchandiseId:d.id,quantity:C,attributes:se(t.id,t.bundleType)}])});e.appendChild(x.root),ce(x.root),_()}function mt(e,t){return e-Math.floor(e*t/100)}function ti(e,t,n,r){let o=Z(e[0],e[0].selectedVariantId),i=Z(e[1],e[1].selectedVariantId),a=o.price*n+i.price*r,l=o.price*n+mt(i.price,t)*r;return{totalPrice:a,salePrice:l,savings:a-l}}function qt(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(mt(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 Rt(e,t,n,r,o,i){let{totalPrice:a,salePrice:l,savings:d}=ti(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]"),f=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)),f){let b=a>0?Math.round(d*100/a):0;f.textContent="("+b+"%)"}c.style.display=""}else c.style.display="none"}function ur(e,t,n,r){let o=Z(e[0],e[0].selectedVariantId),i=Z(e[1],e[1].selectedVariantId),a={variantId:Number(e[0].selectedVariantId),quantity:n,priceCents:(o.price||0)*n},l=mt(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}]}function ni(){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 pr(e,t,n,r){let o=t.widgetConfig,i=t.products.find(x=>x.id===t.buyProductId),a=t.products.find(x=>x.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=[{...Ce(i,t.id,{quantities:u,allowedVariantIds:t.selectedVariantIds?.[0]??null}),role:"buy"},{...Ce(a,t.id,{quantities:u,allowedVariantIds:t.selectedVariantIds?.[1]??null}),role:"get"}],p=c.filter(x=>!x.variants.some(T=>T.available)).length,f=le(i.priceRange.minVariantPrice.currencyCode),b=ue,v=de("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});v.root.setAttribute("data-discount-value",String(s)),v.root.setAttribute("data-buy-qty",String(l)),v.root.setAttribute("data-get-qty",String(d));let F=s>=100?"Free":s+"% off";if(c.forEach((x,T)=>{let z=T===1;z&&v.products.appendChild(ni());let I=!x.variants.some(C=>C.available),R=Ge(x,b,{isOos:I,href:x.url,bogoRole:x.role,inlineQuantity:z?d:l,badgeText:z&&!I?F:null,thumbnailRatio:o.productList?.thumbnailRatio});if(v.products.appendChild(R),I)return;let _=Z(x,x.selectedVariantId);je(R,x,_),$e(R,_,x.featuredImage),qt(R,_,s,z,f),We(R,()=>x,C=>{$e(R,C,x.featuredImage),qt(R,C,s,z,f),Rt(v.root,c,s,l,d,f)})}),p>0){v.cta.disabled=!0;let x=v.cta.querySelector("[data-cta-label]");x&&(x.textContent=Ye(b,p))}else v.cta.addEventListener("click",()=>{n(ur(c,s,l,d).map(x=>({merchandiseId:"gid://shopify/ProductVariant/"+x.variantId,quantity:x.quantity,attributes:se(t.id,t.bundleType)})))});e.appendChild(v.root),ce(v.root),Rt(v.root,c,s,l,d,f),r?.(fe(v.root))}function Nt(e,t,n){return X(n.stepOf||"Step __STEP__ of __TOTAL__",{STEP:e+1,TOTAL:t})}function Be(e,t,n){return X(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function br(e,t,n){return X(n.stepsCompleted||"__COUNT__ of __TOTAL__ steps completed",{COUNT:e,TOTAL:t})}function hr(e,t){return e>0?X(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function mr(e,t,n){let r=new Intl.PluralRules(n||"en").select(t);return X(e[r]||e.other||"__COUNT__",{COUNT:t})}function fr(e,t){return e?t.doorContinue||"Continue building":t.doorChoose||"Choose your products"}function gr(e,t,n,r){if(!e){let o=r.doorQuickSteps;return typeof o=="string"?X(o,{COUNT:n}):mr(o||{one:"__COUNT__ quick step",other:"__COUNT__ quick steps"},n,r.locale)}return mr(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 qe(e,t,n){let r=t[n].maxQuantity;return r==null?1/0:Math.max(0,r-ge(e,n))}function Re(e,t){for(let n=0;n<t.length;n++)if(!xe(e,t,n))return!1;return!0}function Ne(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 Ht(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 xr(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=Be(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 f=i,b=p,v=r[f][b];c.appendChild(ct(v,o,e.formatMoney,Ne(r,v,e.rulesMap),()=>e.onRemove(f,b),()=>e.onEdit(f)))}}}}function vr(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 b=0;b<n.length;b++)r[b].length>0&&(d=!0),xe(r,n,b)||(l+=1,a===-1&&(a=b));if(a===-1){i.style.display="none",i.classList.add("lb-multi-step__door--hidden");let b=i.parentElement;b&&b.firstElementChild!==i&&b.insertBefore(i,b.firstElementChild);return}i.style.display="",i.classList.remove("lb-multi-step__door--hidden"),i.setAttribute("data-step-door",String(a));let s=fr(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=gr(d,l,n.length,o));let p=n[a].name||"";i.setAttribute("aria-label",p?s+": "+p:s);let f=t.querySelector('[data-step-group="'+a+'"]');f&&f.parentElement&&f.previousElementSibling!==i&&f.parentElement.insertBefore(i,f)}function yr(e,t,n,r){let{container:o,steps:i,selections:a}=e,l=o.querySelector("[data-pricing-section]");if(!Re(a,i)){l&&(l.style.display="none");return}l&&(l.style.display="");let d=0;for(let s of a)for(let u of s)d+=u.price*(u.quantity||1);d>0&&t.discountType&&r(o,n(d,t.discountType,t.discountValue??0),d)}function wr(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=br(i,n.length,o));let s=t.querySelector("[data-progress-remaining]");s&&(s.textContent=hr(a,o));let u=t.querySelector(".lb-mix-match__progress-segments");u&&u.setAttribute("aria-valuenow",String(i))}function _r(e){let t=e.container.querySelector("[data-add-bundle]");if(!t)return;t.disabled=!Re(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 Cr(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 He="__all__",ri=300,oi=200;function kr(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=y=>i?i.querySelector(y):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]"),f=a("[data-modal-live]"),b=a("[data-modal-close]"),v=a("[data-modal-back]"),F=a("[data-modal-next]"),x=a("[data-modal-done]"),T=a("[data-modal-footer-count]"),z=a("[data-modal-subtitle]"),I=a("[data-modal-step-segments]"),R=a("[data-modal-filters]"),_=He,C=!1,m=0,H=[],N=y=>n[y].eligibleProducts||[],D={remainingSpots:()=>qe(r,n,m),ownQty:y=>{let k=_e(r,m,y);return k===-1?0:r[m][k].quantity||0},variantUnitsElsewhere:y=>{let k=0;for(let M of r)for(let L of M)L.variantId===y&&(k+=L.quantity||0);return k},productUnitsElsewhere:(y,k)=>{let M=0;for(let L=0;L<r.length;L++)for(let w of r[L])w.productId===y&&(L===m&&w.variantId===k||(M+=w.quantity||0));return M},swapUnits:(y,k)=>Ht(r,m,y,k,e.rulesMap),isInBundle:y=>_e(r,m,y)!==-1,canRemove:y=>{let k=_e(r,m,y);return k!==-1&&e.canRemove(r[m][k])},isFull:()=>qe(r,n,m)===0,commitQty:(y,k)=>{let M=_e(r,m,y);return M===-1||r[m][M].quantity===k?!1:(r[m][M].quantity=k,!0)}};function B(y){if(!I)return;let k=n[y].minQuantity||1;I.innerHTML="",I.setAttribute("aria-valuemax",String(k));for(let M=0;M<k;M++){let L=document.createElement("span");L.className="lb-mix-match__progress-segment",L.setAttribute("data-progress-segment",""),I.appendChild(L)}G()}function G(){if(!I)return;let y=n[m].minQuantity||1,k=Math.min(ge(r,m),y),M=I.querySelectorAll("[data-progress-segment]");for(let L=0;L<M.length;L++)M[L].classList.toggle("lb-mix-match__progress-segment--filled",L<k);I.setAttribute("aria-valuenow",String(k))}function K(){let y=n[m].minQuantity||1,k=Math.min(ge(r,m),y);T&&(T.textContent=Be(k,y,o)),z&&(z.textContent=Nt(m,n.length,o)+" \xB7 "+(n[m].name||""));let M=xe(r,n,m),L=m===n.length-1;v&&(v.style.display=m>0?"":"none"),F&&(F.style.display=L?"none":"",F.disabled=!M),x&&(x.style.display=L?"":"none",x.disabled=!M),G()}function j(){for(let y of H)y.refresh();K()}function W(){e.autoAdvance&&(m>=n.length-1||qe(r,n,m)===0&&g(m+1))}function A(y){if(!c)return;e.dropdown?.unbindAll(c),c.innerHTML="",H=[];let k=N(y);for(let w=0;w<k.length;w++){let q=ot(k[w],w,{t:o,rulesMap:e.rulesMap,capacity:D,showQtySelector:e.showQtySelector,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),j(),W()}});H.push(q),c.appendChild(q.el)}let M=r[y]||[],L=Object.create(null);for(let w of M)L[String(w.productId)]=!0;st(c,H.map(w=>w.el),w=>L[String(k[w].id)]===!0),e.dropdown?.bindAll(c)}function S(y){let k=y.target.closest("[data-add-product]");if(!k||k.disabled)return;let L=N(m)[parseInt(k.getAttribute("data-add-product")??"",10)];if(!L)return;let w=k.closest(".lb-mix-match__modal-product"),q=w&&w.getAttribute("data-selected-variant-id"),O=(q?L.variants.find(he=>he.id===parseInt(q,10)):null)??null;if(O||(O=L.variants.find(he=>he.available)??null),!O)return;let U=_e(r,m,O.id);if(U!==-1){if(!e.canRemove(r[m][U]))return;r[m].splice(U,1),e.onSelectionChanged(),j();return}let J=w?.querySelector("[data-row-qty]"),ee=J?Math.max(1,parseInt(J.getAttribute("data-qty")||J.textContent||"",10)||1):nt(L.id,e.rulesMap,O.id),be={productId:L.id,variantId:O.id,title:L.title,url:L.url||null,variantTitle:O.title,featuredImage:O.image||L.featuredImage||null,price:O.price,compareAtPrice:O.compareAtPrice||null,unitPrice:O.unitPrice||null,quantity:ee},ve=Ht(r,m,L.id,O.id,e.rulesMap);if(ve>0){e.swapVariant(m,be,Math.min(ee,ve)),j();return}let ne=qe(r,n,m);ne!==1/0&&ee>ne||(r[m].push(be),e.onSelectionChanged(),j(),W())}c&&c.addEventListener("click",S);function h(y){if(!R||!e.showTypeFilters)return;let k=[],M=Object.create(null);for(let L of N(y)){let w=(L.type||"").trim();w&&!M[w]&&(M[w]=!0,k.push(w))}if(k.length<2){R.style.display="none",l?.classList.add("lb-mix-match__modal--filters-hidden");return}R.style.display="",l?.classList.remove("lb-mix-match__modal--filters-hidden"),R.innerHTML="";for(let L of[He,...k]){let w=document.createElement("button");w.type="button",w.className="lb-mix-match__filter",w.setAttribute("data-filter",L),w.setAttribute("aria-pressed",L===_?"true":"false"),L===_&&w.classList.add("lb-mix-match__filter--active"),w.textContent=L===He?o.allTypes||"All":L,w.addEventListener("click",()=>{_=L,E(),V(s?s.value:"")}),R.appendChild(w)}}function E(){if(!R)return;let y=R.querySelectorAll("[data-filter]");for(let k=0;k<y.length;k++){let M=y[k].getAttribute("data-filter")===_;y[k].classList.toggle("lb-mix-match__filter--active",M),y[k].setAttribute("aria-pressed",M?"true":"false")}}function V(y){if(!c)return;let k=Se(y),M=c.querySelectorAll("[data-product-item]"),L=0;for(let w=0;w<M.length;w++){let q=M[w].getAttribute("data-title")??"",O=M[w].getAttribute("data-type")||"",U=(!k||q.indexOf(k)!==-1)&&(_===He||O===_);M[w].classList.toggle("lb-hidden",!U),U&&L++}p&&(p.style.display=L===0&&k.length>0?"":"none"),u&&(u.style.display=y.length>0?"":"none"),f&&(f.textContent=X(o.nProductsShown||"__COUNT__ products shown",{COUNT:L}))}if(s){let y=rt(()=>V(s.value),oi);s.addEventListener("input",y)}u&&u.addEventListener("click",()=>{s&&(s.value="",V(""),s.focus())});function g(y,k={}){if(m=Math.max(0,Math.min(n.length-1,y)),A(m),h(m),_=He,E(),s&&(s.value=""),V(""),c&&(c.scrollTop=0),B(m),j(),f){let M=n[m].minQuantity||1;f.textContent=Nt(m,n.length,o)+". "+(n[m].name||"")+". "+Be(Math.min(ge(r,m),M),M,o)}!k.skipFocus&&d&&typeof d.focus=="function"&&d.focus()}function Q(y){!i||C||(C=!0,g(typeof y=="number"?y:0,{skipFocus:!0}),i.style.display="",i.offsetHeight,i.classList.add("lb-mix-match__modal-overlay--open"),at(),setTimeout(()=>{b?b.focus():l?.focus()},50))}function $(){if(!i||!C)return;C=!1,i.classList.remove("lb-mix-match__modal-overlay--open"),lt(),setTimeout(()=>{C||(i.style.display="none")},ri);let y=M=>M&&M.offsetParent!==null?M:null,k=y(t.querySelector('[data-step-row="'+m+'"]'))||y(t.querySelector("[data-step-door]"))||e.ctaButton;k&&typeof k.focus=="function"&&setTimeout(()=>k.focus(),0)}if(b?.addEventListener("click",$),x?.addEventListener("click",$),v?.addEventListener("click",()=>{m>0&&g(m-1)}),F?.addEventListener("click",()=>{m<n.length-1&&xe(r,n,m)&&g(m+1)}),i){let y=null;i.addEventListener("mousedown",k=>{y=k.target}),i.addEventListener("mouseup",k=>{k.target===i&&y===i&&$(),y=null})}return document.addEventListener("keydown",y=>{if(C){if(y.key==="Escape"){y.preventDefault(),$();return}if(y.key==="Tab"&&l){let k=it(l);if(k.length===0){y.preventDefault();return}let M=k[0],L=k[k.length-1];y.shiftKey&&document.activeElement===M?(y.preventDefault(),L.focus()):!y.shiftKey&&document.activeElement===L&&(y.preventDefault(),M.focus())}}}),{open:Q,close:$,isOpen:()=>C,refresh:j}}function ii(){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 Tr(e,t,n,r){let o=t.widgetConfig,i=ue,a=tt(t.productRules,t.variantRules),l=t.steps??[];if(!l.length)return;let d={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},s=l.map((m,H)=>bn(t,H).map(N=>{let D=Ce(N,t.id,{quantities:d,allowedVariantIds:null});return{id:Number(D.productId),title:D.title??"",url:D.url??null,type:N.productType??"",featuredImage:D.featuredImage??null,available:D.variants.some(B=>B.available),optionNames:D.optionNames,variants:D.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(!(s.length>0&&s.every(m=>m.some(H=>H.available))))return;let c=le(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),p=de("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(Ke(l.length));let f=document.createElement("div");f.className="lb-multi-step__groups",f.setAttribute("data-step-groups","");let b=document.createElement("button");b.type="button",b.className="lb-mix-match__add-product lb-multi-step__door",b.setAttribute("data-step-door","0");let v=document.createElement("span");v.className="lb-mix-match__add-product-icon",v.setAttribute("aria-hidden","true"),v.appendChild(ii()),b.appendChild(v);let F=document.createElement("span");F.className="lb-multi-step__door-copy";let x=document.createElement("span");x.className="lb-mix-match__add-product-label",F.appendChild(x);let T=document.createElement("span");T.className="lb-multi-step__door-sub",F.appendChild(T),b.appendChild(F),f.appendChild(b),l.forEach((m,H)=>{let N=document.createElement("section");N.className="lb-multi-step__group",N.setAttribute("data-step-group",String(H)),N.setAttribute("data-step-mode","row");let D=()=>{let S=document.createElement("span");return S.className="lb-multi-step__group-count",S.setAttribute("data-step-count",String(H)),S},B=document.createElement("button");B.type="button",B.className="lb-multi-step__step-row",B.setAttribute("data-step-row",String(H)),B.setAttribute("aria-label","Choose products: "+m.name);let G=document.createElement("span");G.className="lb-multi-step__step-ix",G.setAttribute("aria-hidden","true"),G.textContent=String(H+1),B.appendChild(G);let K=document.createElement("span");K.className="lb-multi-step__group-name",K.textContent=m.name,B.appendChild(K),B.appendChild(D()),N.appendChild(B);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=m.name,j.appendChild(W),j.appendChild(D()),N.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(H)),N.appendChild(A),f.appendChild(N)}),p.products.replaceWith(f);let z=pt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:o.showSearch!==!1,showTypeFilters:o.mixMatchShowTypeFilters!==!1,segmentCount:null,wizard:!0});p.root.appendChild(z);let I=l.map(()=>[]),R={container:p.root,steps:l.map((m,H)=>({name:m.name,minQuantity:m.minQuantity,maxQuantity:m.maxQuantity,eligibleProducts:s[H]})),selections:I,t:i,rulesMap:a,formatMoney:c,onRemove:(m,H)=>{let N=I[m][H];!N||!Ne(I,N,a)||(I[m].splice(H,1),_(),C.isOpen()&&C.refresh())},onEdit:m=>C.open(m)};function _(){xr(R),vr(R),yr(R,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},(m,H,N)=>Ve(m,H,N),ut(c)),wr(R),_r(R)}let C=kr({container:p.root,steps:R.steps,selections:I,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:(m,H,N)=>{let D=0,B=I[m];for(let G=B.length-1;G>=0&&D<N;G--){let K=B[G];if(K.productId!==H.productId||K.variantId===H.variantId)continue;let j=Math.min(K.quantity||1,N-D);j>=(K.quantity||1)?B.splice(G,1):K.quantity=(K.quantity||1)-j,D+=j}D>0&&(H.quantity=D,B.push(H),_())},canRemove:m=>Ne(I,m,a)});b.addEventListener("click",()=>{C.isOpen()||C.open(parseInt(b.getAttribute("data-step-door")??"",10)||0)}),p.root.querySelectorAll("[data-step-row]").forEach(m=>{m.addEventListener("click",()=>{C.isOpen()||C.open(parseInt(m.getAttribute("data-step-row")??"",10)||0)})}),p.cta.addEventListener("click",()=>{Re(I,R.steps)&&n(Cr(I).map(m=>({merchandiseId:"gid://shopify/ProductVariant/"+m.variantId,quantity:m.quantity,attributes:se(t.id,t.bundleType)})))}),e.appendChild(p.root),ce(p.root),_(),r?.(fe(p.root))}var ai=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),bt=new Set,ht=!1;function Sr(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let n of bt)n.classList.add(e),n.classList.remove(t)}function Er(e){ai.has(e.key)&&Sr("using-keyboard")}function Ir(){Sr("using-mouse")}function li(){ht||(ht=!0,document.addEventListener("keydown",Er,!0),document.addEventListener("pointerdown",Ir,!0))}function si(){ht&&(ht=!1,document.removeEventListener("keydown",Er,!0),document.removeEventListener("pointerdown",Ir,!0))}function ft(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),bt.add(e),li(),()=>{bt.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),bt.size===0&&si()}}var Dt=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
260
+ `;var ae=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},Wt={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 Yr(e){if(!e||typeof e!="object")return ie;let t=e;return{...ie,...t,defaultTier:Jr(t.defaultTier),pickerBorderRadius:jt(t.pickerBorderRadius),header:{...ie.header,...t.header??{}},layout:{...ie.layout,...t.layout??{},borderRadius:jt(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 Jr(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:ie.defaultTier}function jt(e){return e==="none"||e==="subtle"||e==="rounded"||e==="round"?e:ie.layout.borderRadius}function Xr(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:Wt[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:Wt[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 Zr={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"},eo=new Set(["borderRadius","borderWidth","ctaBorderWidth","popularBadgeBorderWidth","pickerBorderWidth","pickerBorderRadius","pickerAddBorderWidth"]);function mn(e,t){let n=Xr(t);for(let[i,a]of Object.entries(Zr)){let l=n[i];if(l==null)continue;let d=eo.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",$t(t.layout.borderColor)),e.style.setProperty("--lb-picker-variant-chevron",$t(t.pickerBorderColor));let r=Gt(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=Gt(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 $t(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 Gt(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 to=new Set(["fixed","mix_match","volume","bogo","multi_step"]),no=new Set(["active"]);function kt(e,t){try{return ro(e,t)}catch(n){if(n instanceof ae)return null;throw n}}function ro(e,t){let n=new Map(t.map(v=>[v.key,v])),r=n.get("title")?.value??"Bundle",o=n.get("bundle_type")?.value,i=n.get("status")?.value;if(!o||!to.has(o))throw new ae(`Invalid or missing bundle_type: ${o??"null"}`,"invalid_type");let a=o;if(!i||!no.has(i))throw new ae(`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 v=new Date(d);if(Number.isNaN(v.getTime()))throw new ae(`Invalid starts_at: ${d}`,"invalid_type");if(v>u)throw new ae(`Bundle not yet started: starts_at=${d}`,"not_started")}if(s){let v=new Date(s);if(Number.isNaN(v.getTime()))throw new ae(`Invalid ends_at: ${s}`,"invalid_type");if(v<u)throw new ae(`Bundle has expired: ends_at=${s}`,"expired")}let c=lo(n),m=so(n),f=co(n),b={id:e,title:r,description:n.get("description")?.value||null,status:l,products:c,discountConfig:m,widgetConfig:f,startsAt:d,endsAt:s,discountLabel:n.get("discount_label")?.value??null,selectedVariantIds:uo(n),productQuantities:Kt(n,"product_quantities"),variantQuantities:Kt(n,"variant_quantities"),marketVisibility:po(n),marketIds:mo(n),countryCodes:_t(n,"country_codes"),companyLocationIds:_t(n,"company_location_ids"),abTestId:n.get("ab_test_id")?.value||null,abWeight:bo(n)};switch(a){case"fixed":return{...b,bundleType:"fixed"};case"volume":return{...b,bundleType:"volume",volumeTiers:ho(n)};case"mix_match":return{...b,bundleType:"mix_match",minQuantity:go(n,"min_quantity",{min:1}),maxQuantity:null,productRules:Oe(n,"product_rules"),variantRules:Oe(n,"variant_rules")};case"bogo":return{...b,bundleType:"bogo",...ao(n)};case"multi_step":return{...b,bundleType:"multi_step",steps:oo(n),productRules:Oe(n,"product_rules"),variantRules:Oe(n,"variant_rules"),collectionProductIds:io(n)}}}function oo(e){let t=ye(e,"steps");if(!Array.isArray(t))throw new ae("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 ae("multi_step bundle has no valid steps","invalid_type");return r}function io(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 ao(e){let t=ye(e,"bogo_config");if(!t||typeof t!="object"||Array.isArray(t))throw new ae("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 ae("bogo_config is missing buy/get product ids","invalid_type");let i=a=>{let l=typeof a=="number"?a:Number(a);return!Number.isFinite(l)||l<1?1:Math.min(99,Math.floor(l))};return{buyProductId:r,getProductId:o,buyQuantity:i(n.buyQuantity),getQuantity:i(n.getQuantity)}}function lo(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 so(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 co(e){return Yr(ye(e,"widget_config"))}function uo(e){let t=ye(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 Kt(e,t){let n=ye(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 Oe(e,t){let n=ye(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))),m=Math.max(c,Math.min(99,Math.floor(u)));r[o]=d===!0?{min:c,max:m,required:!0}:{min:c,max:m}}return r}function po(e){return e.get("market_visibility")?.value==="specific"?"specific":"all"}function mo(e){return _t(e,"markets")}function _t(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 bo(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 ho(e){let t=ye(e,"volume_tiers");return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null).map(fo):[]}function fo(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 ye(e,t){let n=e.get(t)?.value;if(!n)return null;try{return JSON.parse(n)}catch{return null}}function go(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 xo(e){let t=typeof e=="string"?parseFloat(e):e;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:1}function Tt(e,t){let n=xo(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 bn(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 hn(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 fn(e,t,n){return t?typeof e=="number"&&Number.isFinite(e)?Math.floor(e):n:-1}var vo="*";function Ve(e){return e.split("/").pop()??e}function Yt(e,t,n){if(!e||e.length===0)return!1;if(e.includes(vo))return!0;if(!t)return!1;if(!n)return e.includes(t);let r=Ve(t);return e.some(o=>Ve(o)===r)}function gn(e,t){if(e.marketVisibility!=="specific"||Yt(e.countryCodes,t.countryCode,!1)||t.companyLocationId&&Yt(e.companyLocationIds,t.companyLocationId,!0))return!0;if(t.marketId){let n=Ve(t.marketId);if(e.marketIds.some(r=>Ve(r)===n))return!0}return!1}function yo(e,t){return e===t?!0:/^\d+$/.test(t)&&e.endsWith(`/${t}`)}function xn(e,t){let n=t?.productId?.trim();if(n){let o=e.find(i=>yo(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 St(e,t,n){let r=e.variantQuantities[n];return r!==void 0?r:e.productQuantities[t]??1}function vn(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 yn(e,t){await Cn(e,{shopDomain:e.shopDomain,eventType:"bundle_impression",bundleGid:t.bundleGid,bundleType:t.bundleType,productId:t.productId,occurredAt:new Date().toISOString()})}async function wn(e,t){await Cn(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function _n(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 Cn(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 Jt=1e4,wo=[[/@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"]],_o=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function Et(e){if(e.length>Jt)return{ok:!1,error:`CSS exceeds ${Jt.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 wo)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&&!_o.test(o))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Co="lb-custom-css-";function kn(e,t){if(typeof document>"u"||!t)return!1;let n=Et(t);if(!n.ok||!n.css.trim())return!1;let r=Co+ko(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 ko(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 To(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)}`}}function Ue(e,t,n){return t==="percentage"?Math.max(0,e*(1-n/100)):Math.max(0,e-n)}var So={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 Tn(e,t,n){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let r=parseFloat(e.amount);if(!Number.isFinite(r))return null;let o=So[t.referenceUnit]??"";if(!o)return null;let i=e.currencyCode||n||"USD",a=To(r,i),l=t.referenceValue,d=l===1?o:`${l}${o}`;return`${a}/${d}`}var we={};nn(we,{computePosition:()=>Io,emptyTypeAheadState:()=>Bo,firstEnabled:()=>Fe,handleKey:()=>Mo,pushTypeAheadChar:()=>qo});var Eo=4;function Io({trigger:e,viewportHeight:t,desiredHeight:n,margin:r=Eo,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),m=s==="down"?e.bottom+r:e.top-r-c;return{placement:s,maxHeight:c,offsetTop:m,offsetLeft:e.left,width:e.width}}var yt={type:"passthrough",preventDefault:!1};function Fe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Xt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Ao(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 Lo(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 Zt(e){return e.length===1&&e!==" "&&/\S/.test(e)}function Mo(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return yt;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:Xt(a),preventDefault:!0};default:return Zt(n)?{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Fe(a),preventDefault:!0}:yt}switch(n){case"ArrowDown":return{type:"move-active",activeIndex:Ao(a,o),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:Lo(a,o),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:Fe(a),preventDefault:!0};case"End":return{type:"move-active",activeIndex:Xt(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 Zt(n)?{type:"type-ahead",char:n,preventDefault:!1}:yt}}var Po=500;function Bo(){return{buffer:"",lastTime:0}}function qo(e,t,n,r,o=Po){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 Ro={};nn(Ro,{findVariantByOptions:()=>No,isOptionValueAvailable:()=>Ho,toPickerVariant:()=>Do});function Sn(e){return e.availableForSale&&!e.currentlyNotInStock&&e.quantityAvailable!=null&&e.quantityAvailable<=0}function Ie(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null||Sn(e)?!0:e.quantityAvailable>=t:!1}function ze(e){return e.currentlyNotInStock||e.quantityAvailable==null||Sn(e)?null:Math.max(0,e.quantityAvailable)}function No(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 Ho(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 Do(e,t){return{id:e.id,optionValues:e.selectedOptions.map(n=>n.value),available:t!==void 0?Ie(e,t):e.availableForSale}}var en="_lb_v",wt=null;function Oo(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 En(){try{let e=window.localStorage.getItem(en);if(e)return e;let t=tn();return window.localStorage.setItem(en,t),t}catch{return wt||(wt=tn()),wt}}function tn(){return Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,10)}function Fo(e,t,n){let r=e.slice().sort((a,l)=>a.id<l.id?-1:a.id>l.id?1:0),o=Oo(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 In(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,Fo(o,t,i))}),e.filter(o=>!o.abTestId||r.get(o.abTestId)===o)}function le(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 It="_lime_bundle_gid",Vo="_lime_bundle_type";function se(e,t){return[{key:It,value:e},{key:Vo,value:t}]}function An(e){let t=e.slice(e.lastIndexOf("/")+1),n=Number(t);return Number.isFinite(n)&&t!==""?n:e}function Qe(e){if(!e)return 0;let t=parseFloat(e);return Number.isFinite(t)?Math.round(t*100):0}function Uo(e){let t=e?.width,n=e?.height;return typeof t!="number"||typeof n!="number"||t<=0||n<=0?null:t/n}function zo(e,t,n){return{id:An(e.id),title:e.title,options:(e.selectedOptions??[]).map(r=>r.value),available:Ie(e,t),price:Qe(e.price?.amount),compareAtPrice:Qe(e.compareAtPrice?.amount),unitPrice:Tn(e.unitPrice,e.unitPriceMeasurement,n),image:e.image?.url??null,inventoryQuantity:ze(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=St(n.quantities,e.id,o[0]?.id??""),l=o.map(s=>{let u=St(n.quantities,e.id,s.id),c=zo(s,u,i);return u!==a&&(c.quantity=u),c}),d=l.find(s=>s.available)??l[0];return{productId:An(e.id),title:e.title,url:e.handle?"/products/"+e.handle:null,featuredImage:e.featuredImage?.url??null,featuredImageRatio:Uo(e.featuredImage),quantity:a,selectedVariantId:d?d.id:"",optionNames:(o[0]?.selectedOptions??[]).map(s=>s.name),variants:l}}function We(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 Ln(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 Mn(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 Pn(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 Bn(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 Qo(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 At(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}=Qo(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 m=o>0?Math.round(a*100/o):0;c.textContent="("+m+"%)"}s.style.display=""}else s.style.display="none"}function je(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 m=s.options[c-1];r[u].value!==m&&(r[u].value=m)}}function l(s,u){for(let c=0;c<r.length;c++){let m=r[c],f=o(m);if(!f||f<1)continue;let b=m.options;for(let v=0;v<b.length;v++)b[v].disabled=!Pn(s.variants,f-1,b[v].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 m=Mn(c,i());if(!m){let f=ee(c,c.selectedVariantId);a(f),f&&f.options&&l(c,f.options);return}c.selectedVariantId=m.id,l(c,m.options),n(m,c)})}function $e(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&&Wo(o,t,n)}function Wo(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 Lt=new WeakMap;function Ge(e,t,n){let r=e.querySelector("[data-thumbnail]");if(!r)return;let o=r.querySelector("img");if(!Lt.has(e)){let a=n||(o?o.src:null);a&&Lt.set(e,a)}let i=t.image||Lt.get(e)||null;if(i)if(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 jo(e,t){let n=e.querySelector("[data-qty-inline]");n&&(n.textContent="\xD7"+t)}function Mt(e,t,n,r){if(!t)return;Ge(e,t,n.featuredImage),jo(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 Ke(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"&&a!=null&&a>0&&i.style.setProperty("--lb-row-thumb-ratio",String(a)),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 de(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 m=P("p","lb-bundle-subtitle");m.textContent=t.subtitle,r.appendChild(m)}if(n.appendChild(r),t.endsAt){let m=P("div","lb-bundle-countdown",{"data-countdown":""}),f=P("span","lb-bundle-countdown-label");f.textContent=t.countdownLabel??"Limited time offer",m.appendChild(f),m.appendChild(P("span","lb-bundle-countdown-timer",{"data-countdown-timer":""})),n.appendChild(m)}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 m=P("p","lb-bundle-savings-line",{"data-savings-bar":"",style:"display:none"});m.appendChild(document.createTextNode("Save ")),m.appendChild(P("span","",{"data-savings-amount":""})),m.appendChild(document.createTextNode(" ")),m.appendChild(P("span","",{"data-savings-percent":""})),l.appendChild(m)}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 qn(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 m=P("span","lb-volume__tier-price");if(r&&(a.percent>0||a.amountCents>0)&&m.appendChild(P("span","lb-volume__tier-compare")),o&&(m.appendChild(P("span","",{"data-tier-price-each":""})),n.unitLabel)){let f=P("span","lb-volume__tier-unit");f.textContent=n.unitLabel,m.appendChild(f)}if(u.appendChild(m),d.appendChild(u),a.badgeLabel||a.savingsLabel){let f=P("span","lb-volume__tier-right");if(a.badgeLabel){let b=P("span","lb-volume__tier-badge");b.textContent=a.badgeLabel,f.appendChild(b)}if(a.savingsLabel){let b=P("span","lb-volume__tier-savings");b.textContent=a.savingsLabel,f.appendChild(b)}d.appendChild(f)}i.appendChild(d)}),i}function Ye(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 ke(e){return e<10?"0"+e:String(e)}function ce(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),m=Math.floor(d%6e4/1e3);i.textContent=s>0?s+"d "+ke(u)+"h "+ke(c)+"m "+ke(m)+"s":ke(u)+"h "+ke(c)+"m "+ke(m)+"s"}l(),o-Date.now()>0&&(a=setInterval(l,1e3),e._lbCountdownInterval=a)}var ue={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"},quantity:"Quantity",increaseQuantity:"Increase quantity",decreaseQuantity:"Decrease quantity",allTypes:"All",editSelection:"Edit selection",addToCart:"Add to cart",bundlePrice:"Bundle price",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))}function Rn(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=[],Xe=!1;function $o(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 Ze(e){for(let t=re.length-1;t>=0;t--)$o(e,re[t])||re[t].close()}function Nn(){for(let e=re.length-1;e>=0;e--)re[e].close()}function Go(){Xe||(document.addEventListener("pointerdown",Ze,!0),window.addEventListener("resize",Nn),window.addEventListener("scroll",Ze,!0),Xe=!0)}function Ko(){Xe&&(document.removeEventListener("pointerdown",Ze,!0),window.removeEventListener("resize",Nn),window.removeEventListener("scroll",Ze,!0),Xe=!1)}function Hn(e){re.push(e),re.length===1&&Go()}function Dn(e){let t=re.indexOf(e);t>=0&&re.splice(t,1),re.length===0&&Ko()}function On(e){for(let t=re.length-1;t>=0;t--)re[t]!==e&&re[t].close()}var Yo=32,Jo=8,Xo=8,Pt=new WeakMap;function Fn(e){return Pt.get(e)}function Vn(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,m=-1,f=we.emptyTypeAheadState(),b=[];function v(){let I=[];for(let E=0;E<e.options.length;E++){let h=e.options[E];I.push({disabled:h.disabled,label:h.textContent||h.value})}return I}function D(){i.disabled=e.disabled;let I=v(),E=e.selectedIndex;for(l.textContent=E>=0&&I[E]?I[E].label:"";s.firstChild;)s.removeChild(s.firstChild);b=[];for(let h=0;h<I.length;h++){let A=t.createElement("li");A.id=r+"-opt-"+h,A.className="lb-dropdown-option",A.setAttribute("role","option"),A.setAttribute("aria-selected",h===E?"true":"false"),I[h].disabled&&A.setAttribute("aria-disabled","true"),A.setAttribute("data-value",e.options[h].value),A.setAttribute("data-index",String(h)),A.textContent=I[h].label,s.appendChild(A),b.push(A)}}function x(I){if(m>=0&&b[m]&&b[m].classList.remove("is-active"),m=I,I<0||!b[I]){i.setAttribute("aria-activedescendant","");return}let E=b[I];E.classList.add("is-active"),i.setAttribute("aria-activedescendant",E.id);let h=E.offsetTop,A=h+E.offsetHeight,z=s.scrollTop,g=z+s.clientHeight;h<z?s.scrollTop=h:A>g&&(s.scrollTop=A-s.clientHeight)}function S(){let I=i.getBoundingClientRect();if(I.width===0)return!1;let h=Math.min(b.length||1,Xo)*Yo+Jo,A=Rn(i),z=A?{top:A.getBoundingClientRect().top,bottom:A.getBoundingClientRect().bottom}:void 0,g=we.computePosition({trigger:{top:I.top,bottom:I.bottom,left:I.left,width:I.width},viewportHeight:window.innerHeight,desiredHeight:h,clip:z});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 U(){if(c)return;On(W),c=!0,s.hidden=!1,i.setAttribute("aria-expanded","true"),S()||requestAnimationFrame(()=>{S()});let I=v(),E=e.selectedIndex;E>=0&&I[E]&&!I[E].disabled?x(E):x(we.firstEnabled(I)),Hn(W)}function M(I){c&&(c=!1,s.hidden=!0,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-activedescendant",""),m>=0&&b[m]&&b[m].classList.remove("is-active"),m=-1,Dn(W),I&&i.focus())}function N(I){let E=e.options[I];!E||E.disabled||(e.value!==E.value&&(e.value=E.value,e.dispatchEvent(new Event("change",{bubbles:!0}))),D(),M(!0))}function _(I){let E=v(),h=we.handleKey({key:I.key,ctrlKey:I.ctrlKey,metaKey:I.metaKey,altKey:I.altKey,shiftKey:I.shiftKey},{isOpen:c,activeIndex:m,selectedIndex:e.selectedIndex,options:E});switch(h.preventDefault&&I.preventDefault(),h.type){case"open":U(),h.activeIndex>=0&&x(h.activeIndex);break;case"close":M(h.restoreFocus);break;case"move-active":x(h.activeIndex);break;case"commit":N(h.index);break;case"type-ahead":{let A=we.pushTypeAheadChar(f,h.char,Date.now(),E);f=A.newState,A.matchedIndex!==null&&(c||U(),x(A.matchedIndex));break}}}function C(I){I.preventDefault(),c?M(!1):U()}function p(I){let E=I.target;for(;E&&E!==s;){if(E.classList&&E.classList.contains("lb-dropdown-option")){let h=parseInt(E.getAttribute("data-index")??"",10);return isNaN(h)?null:h}E=E.parentNode}return null}function H(I){let E=p(I);E!==null&&N(E)}function R(I){let E=I.target;for(;E&&E!==s;){if(E.classList&&E.classList.contains("lb-dropdown-option")){if(E.getAttribute("aria-disabled")==="true")return;let h=parseInt(E.getAttribute("data-index")??"",10);!isNaN(h)&&h!==m&&x(h);return}E=E.parentNode}}function q(){setTimeout(()=>{c&&(o.contains(document.activeElement)||M(!1))},0)}function B(){D()}let G=new MutationObserver(()=>{D()});G.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});function $(I){I.preventDefault()}i.addEventListener("click",C),i.addEventListener("keydown",_),o.addEventListener("focusout",q),s.addEventListener("mousedown",$),s.addEventListener("click",H),s.addEventListener("mousemove",R),e.addEventListener("change",B);function J(){c&&M(!1),G.disconnect(),i.removeEventListener("click",C),i.removeEventListener("keydown",_),o.removeEventListener("focusout",q),s.removeEventListener("mousedown",$),s.removeEventListener("click",H),s.removeEventListener("mousemove",R),e.removeEventListener("change",B),o.parentNode?.removeChild(o),s.parentNode?.removeChild(s),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),Pt.delete(e)}let W={shell:o,listbox:s,select:e,close:()=>M(!1),destroy:J};return Pt.set(e,W),D(),W}var Zo="select.lb-bundle-variant-select:not(.lb-dropdown-state), select.lb-mix-match__variant-select:not(.lb-dropdown-state)";function Un(e){let n=(e??document).querySelectorAll(Zo);for(let r=0;r<n.length;r++)Vn(n[r])}function zn(e){let n=(e??document).querySelectorAll("select.lb-dropdown-state");for(let r=0;r<n.length;r++)Fn(n[r])?.destroy()}function fe(e){return Un(e),()=>zn(e)}function Qn(e,t,n,r){let o=t.widgetConfig,i=We(t);if(!i.length)return;let a=i.filter(c=>!c.variants.some(m=>m.available)),l=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",d=le(l),s=ue,u=de("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 m=!c.variants.some(D=>D.available),f=Ke(c,s,{isOos:m,href:c.url,thumbnailRatio:o.productList?.thumbnailRatio});if(u.products.appendChild(f),m)continue;let b=Ln(c);b&&(c.selectedVariantId=b.id);let v=b??ee(c,c.selectedVariantId);$e(f,c,v),Mt(f,v,c,d),je(f,()=>c,(D,x)=>{Mt(f,D,x,d),At(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(Bn(i).map(c=>({merchandiseId:"gid://shopify/ProductVariant/"+c.variantId,quantity:c.quantity,attributes:se(t.id,t.bundleType)})))});e.appendChild(u.root),ce(u.root),At(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 et(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 tt(e,t,n){return Z(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function Wn(e,t){return e>0?Z(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function jn(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 ei={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"?ei: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 nt(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 rt(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 $n(e,t){let n=be(e,t);return n===-1?0:e[n].quantity||0}function Gn(e,t){return e.min<=t}function Kn(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 Yn=[120,180,240],Bt=[480,600,768,1024],Jn="60px",Xn="(max-width: 767px) 45vw, 228px";function Te(e,t){return e&&(/[?&]width=\d+/.test(e)?e.replace(/([?&])width=\d+/,"$1width="+t):e+(e.indexOf("?")===-1?"?":"&")+"width="+t)}function Ae(e,t){return e?t.map(n=>Te(e,n)+" "+n+"w").join(", "):""}function ot(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 Zn=600;function it(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 m=document.createElement("span");m.className="lb-mix-match__modal-added-badge",m.textContent=r.addedItem||"Added",m.hidden=!0,c.appendChild(m);let f=e.variants.find(g=>g.available)??null,b=f&&f.image||e.featuredImage;if(b){let g=document.createElement("img");g.src=Te(b,Zn),g.srcset=Ae(b,Bt),g.sizes=Xn,g.alt=e.title,g.loading="lazy",c.appendChild(g)}d.appendChild(c);let v=document.createElement("div");v.className="lb-mix-match__modal-product-info";let D=document.createElement("p");if(D.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,D.appendChild(g)}else D.textContent=e.title;v.appendChild(D);let x=f??(e.variants.length>0?e.variants[0]:null),S=g=>te(e.id,o,g?g.id:null),U=x?S(x).min:1,M=document.createElement("p");M.className="lb-mix-match__modal-product-price",M.setAttribute("data-row-price","");let N=document.createElement("span");N.setAttribute("data-row-price-sale",""),x&&(N.textContent=a(x.price*U)),M.appendChild(N);let _=document.createElement("s");_.className="lb-mix-match__modal-product-compare",_.setAttribute("data-row-compare",""),M.appendChild(_),v.appendChild(M);function C(g,F,j){let Q=F&&F.compareAtPrice?F.compareAtPrice*j:0,K=F?F.price*j:0;Q>K?(g.textContent=a(Q),g.hidden=!1):(g.textContent="",g.hidden=!0)}C(_,x,U);let p=document.createElement("p");p.className="lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price",p.setAttribute("data-row-unit-price","");let H=x?x.unitPrice:null;H?p.textContent=H:p.hidden=!0,v.appendChild(p);let R=null,q=null,B=S(x).min,G=S(x).max,$=null,J=null;if(e.available&&n.showQtySelector){R=document.createElement("div"),R.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 F=document.createElement("button");F.type="button",F.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--minus",F.setAttribute("aria-label",r.decreaseQuantity||"Decrease quantity"),F.textContent="\u2212",q=document.createElement("span"),q.className="lb-mix-match__qty-stepper-value",q.setAttribute("data-row-qty",""),q.setAttribute("aria-live","polite"),q.textContent=String(S(x).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(F),g.appendChild(q),g.appendChild(j),R.appendChild(g);let Q=q;$=()=>{Q.textContent=String(B),Q.setAttribute("data-qty",String(B)),F.disabled=u||B<=S(x).min,j.disabled=u||B>=G},J=(k,T=0)=>{let y=k?k.id:null,w=y===null?0:i.ownQty(y),L=y===null?0:i.productUnitsElsewhere(e.id,y),O=y===null?0:i.swapUnits(e.id,y),V=k?k.inventoryQuantity:null,X=Math.max(0,T-w),me=typeof V=="number"?Math.max(0,V-X):void 0,he=pe(y,o)?.max,ne=S(k).min;G=O>0?typeof me=="number"?Math.min(O,me):O:Kn(l,i.remainingSpots(),me,w,L,he),G<ne?B=ne:(B>G&&(B=G),B<ne&&(B=ne)),$()};let K=()=>{x&&i.commitQty(x.id,B)&&n.onCommittedQtyChanged()};F.addEventListener("click",()=>{B>S(x).min&&(B-=1),$(),K()}),j.addEventListener("click",()=>{B<G&&(B+=1),$(),K()}),x?J(x):$()}let W=e.variants.slice(),I=[];if(W.length>1){let g=e.optionNames||[];x=W.find(y=>y.available!==!1)??W[0];let F=()=>{let y=I.map(w=>w.value);for(let w of W)if(!(!w.options||w.options.length!==y.length)&&w.options.every((L,O)=>L===y[O]))return w;return null},j=y=>{if(!(!y||!y.options))for(let w=0;w<I.length&&w<y.options.length;w++)I[w].value!==y.options[w]&&(I[w].value=y.options[w])},Q=(y,w,L)=>{for(let O of W){if(O.available===!1||!O.options||O.options[y]!==w)continue;let V=!0;for(let X=0;X<O.options.length;X++)if(X!==y&&O.options[X]!==L[X]){V=!1;break}if(V)return!0}return!1},K=y=>{for(let w=0;w<I.length;w++){let L=I[w];for(let O=0;O<L.options.length;O++)L.options[O].disabled=!Q(w,L.options[O].value,y)}},k=()=>{let y=F();if(!y){j(x),x?.options&&K(x.options);return}x=y,d.setAttribute("data-selected-variant-id",String(y.id));let w=S(y).min;N.textContent=a(y.price*w),C(_,y,w),y.unitPrice?(p.textContent=y.unitPrice,p.hidden=!1):(p.textContent="",p.hidden=!0);let L=c.querySelector("img"),O=y.image||e.featuredImage;L&&O&&(L.src=Te(O,Zn),L.srcset=Ae(O,Bt)),J?.(y,i.variantUnitsElsewhere(y.id)),y.options&&K(y.options),z()},T=document.createElement("div");T.className="lb-bundle-variant-option-groups";for(let y=0;y<g.length;y++){let w=g[y],L=document.createElement("div");L.className="lb-bundle-variant-option-group";let O=document.createElement("span");O.className="lb-bundle-variant-option-label",O.textContent=w,L.appendChild(O);let V=document.createElement("select");V.className="lb-mix-match__variant-select",V.setAttribute("data-variant-option",""),V.setAttribute("data-option-position",String(y+1)),V.name="lb-variant-"+e.id+"-"+(y+1),V.setAttribute("aria-label",w);let X=Object.create(null),me=x?.options?.[y];for(let he of W){let ne=he.options&&he.options[y];if(!ne||X[ne])continue;X[ne]=!0;let ve=document.createElement("option");ve.value=ne,ve.textContent=ne,ne===me&&(ve.selected=!0),V.appendChild(ve)}V.addEventListener("change",k),I.push(V),L.appendChild(V),T.appendChild(L)}v.appendChild(T),x&&(d.setAttribute("data-selected-variant-id",String(x.id)),x.options&&K(x.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,v.appendChild(g)}let E=null;e.available&&(E=document.createElement("span"),E.className="lb-mix-match__modal-needs-spots",E.hidden=!0,v.appendChild(E));let h=null;if(e.available){let g=document.createElement("div");g.className="lb-mix-match__modal-product-actions",R&&g.appendChild(R),h=document.createElement("button"),h.type="button",h.className="lb-mix-match__modal-add",h.textContent=r.addItem||"Add",h.setAttribute("aria-label",(r.addItem||"Add")+" "+e.title),h.setAttribute("data-add-product",String(t)),g.appendChild(h),v.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"),v.appendChild(g)}d.appendChild(v);let A=x?x.id:null;function z(){if(!x)return;let g=x,F=g.inventoryQuantity,j=typeof F=="number"?i.variantUnitsElsewhere(g.id):0,Q=i.isInBundle(g.id);if(J){let L=i.ownQty(g.id);L>0?B=L:A!==g.id&&(B=S(g).min),A=g.id,J(g,j)}let K=i.swapUnits(e.id,g.id),k=S(g),T=K>=k.min,y=i.remainingSpots(),w=!Q&&!T&&!Gn(k,y);if(E&&(w&&y>0?(E.textContent=et(k.min,r),E.hidden=!1):E.hidden=!0),h)if(Q)h.disabled=!1,i.canRemove(g.id)?(h.textContent=r.removeItem||"Remove",h.setAttribute("aria-label",(r.removeItem||"Remove")+" "+e.title),h.classList.remove("lb-mix-match__modal-add--required")):(h.disabled=!0,h.textContent=r.required||"Required",h.setAttribute("aria-label",e.title+" is required and cannot be removed"),h.classList.add("lb-mix-match__modal-add--required")),h.classList.add("lb-mix-match__modal-add--added"),d.classList.add("lb-mix-match__modal-product--in-bundle"),m.hidden=!1;else{let L=r.swapItem||"Swap",O=T?L:r.addItem||"Add";h.textContent=O,h.setAttribute("aria-label",O+" "+e.title),h.classList.remove("lb-mix-match__modal-add--added"),h.classList.remove("lb-mix-match__modal-add--required"),d.classList.remove("lb-mix-match__modal-product--in-bundle"),m.hidden=!0;let V=typeof F=="number"?Math.max(0,F-j)<k.min:!1;if(T)h.disabled=V;else{let X=l.max-i.productUnitsElsewhere(e.id,g.id)<k.min;h.disabled=V||X||w||i.isFull()}}s=!e.available,u=!e.available||!Q&&!!h?.disabled,$?.();for(let L of I)L.disabled=s}return{el:d,refresh:z}}var ti='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function at(e){let t=e.querySelectorAll(ti),n=[];for(let r=0;r<t.length;r++)t[r].offsetParent!==null&&n.push(t[r]);return n}var qt=0,Le=0;function lt(){if(Le++,Le>1)return;qt=window.pageYOffset||document.documentElement.scrollTop;let e=document.body;e.style.position="fixed",e.style.top="-"+qt+"px",e.style.left="0",e.style.right="0",e.style.overflow="hidden"}function st(){if(Le<=0||(Le--,Le>0))return;let e=document.body;e.style.position="",e.style.top="",e.style.left="",e.style.right="",e.style.overflow="",window.scrollTo(0,qt)}function dt(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 Me="__all__",ni=300,ri=200;function er(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=h=>a?a.querySelector(h):null,d=l('[role="dialog"]'),s=l("[data-modal-search]"),u=l("[data-modal-search-clear]"),c=l("[data-modal-list]"),m=l("[data-modal-empty]"),f=l("[data-modal-live]"),b=l("[data-modal-close]"),v=l("[data-modal-done]"),D=l("[data-modal-footer-count]"),x=l("[data-modal-subtitle]"),S=l("[data-modal-filters]"),U=n.showTypeFilters!==!1,M=Me,N=!1,_=!1,C=!1,p=[];function H(){for(let h of p)h.refresh()}function R(){let h=Math.min(oe(i),e.requiredQty),A=Math.max(0,e.requiredQty-h);D&&(D.textContent=tt(h,e.requiredQty,r)),x&&(x.textContent=jn(A,n.discountType,n.discountValue,r))}function q(){H(),R()}function B(){if(c){e.dropdown?.unbindAll(c),c.innerHTML="",p=[];for(let h=0;h<o.length;h++){let A=it(o[h],h,{t:r,rulesMap:e.rulesMap,showQtySelector:e.showQtySelector,capacity:e.rowCapacity,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),q()}});p.push(A),c.appendChild(A.el)}e.dropdown?.bindAll(c),c.addEventListener("click",G)}}function G(h){let A=h.target.closest("[data-add-product]");if(!A||A.disabled)return;let z=parseInt(A.getAttribute("data-add-product")??"",10),g=o[z];if(!g)return;let F=A.closest(".lb-mix-match__modal-product"),j=F&&F.getAttribute("data-selected-variant-id"),Q=(j?g.variants.find(w=>w.id===parseInt(j,10)):null)??null;if(Q||(Q=g.variants.find(w=>w.available)??null),!Q)return;if(e.isInBundle(Q.id)){e.removeVariant(Q.id),q();return}let K=F?.querySelector("[data-row-qty]"),k=K?Math.max(1,parseInt(K.getAttribute("data-qty")||K.textContent||"",10)||1):rt(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:k},y=e.swapUnitsFor(g.id,Q.id);if(y>0){e.swapVariant(T,Math.min(k,y)),q();return}e.atCapacity()||(e.addSelection(T),q())}function $(){if(!S||!U)return;let h=[],A=Object.create(null);for(let z of o){let g=(z.type||"").trim();g&&!A[g]&&(A[g]=!0,h.push(g))}if(h.length<2){S.style.display="none",d?.classList.add("lb-mix-match__modal--filters-hidden");return}S.innerHTML="";for(let z of[Me,...h]){let g=document.createElement("button");g.type="button",g.className="lb-mix-match__filter",g.setAttribute("data-filter",z),g.setAttribute("aria-pressed",z===M?"true":"false"),z===M&&g.classList.add("lb-mix-match__filter--active"),g.textContent=z===Me?r.allTypes||"All":z,g.addEventListener("click",()=>{M=z,J(),W(s?s.value:"")}),S.appendChild(g)}}function J(){if(!S)return;let h=S.querySelectorAll("[data-filter]");for(let A=0;A<h.length;A++){let z=h[A].getAttribute("data-filter")===M;h[A].classList.toggle("lb-mix-match__filter--active",z),h[A].setAttribute("aria-pressed",z?"true":"false")}}function W(h){if(!c)return;let A=Se(h),z=c.querySelectorAll("[data-product-item]"),g=0;for(let F=0;F<z.length;F++){let j=z[F].getAttribute("data-title")??"",Q=z[F].getAttribute("data-type")||"",K=(!A||j.indexOf(A)!==-1)&&(M===Me||Q===M);z[F].classList.toggle("lb-hidden",!K),K&&g++}m&&(m.style.display=g===0&&A.length>0?"":"none"),u&&(u.style.display=h.length>0?"":"none"),f&&(f.textContent=Z(r.nProductsShown||"__COUNT__ products shown",{COUNT:g}))}if(s){let h=ot(()=>W(s.value),ri);s.addEventListener("input",h)}u&&u.addEventListener("click",()=>{s&&(s.value="",W(""),s.focus())});function I(){if(!(!a||C)){if(C=!0,N||(B(),N=!0),_||($(),_=!0),q(),M=Me,J(),s&&(s.value=""),W(s?s.value:""),c){let h=Object.create(null);for(let A of i)h[String(A.productId)]=!0;dt(c,p.map(A=>A.el),A=>h[String(o[A].id)]===!0),c.scrollTop=0}a.style.display="",a.offsetHeight,a.classList.add("lb-mix-match__modal-overlay--open"),lt(),setTimeout(()=>{b?b.focus():d?.focus()},50)}}function E(){if(!a||!C)return;C=!1,a.classList.remove("lb-mix-match__modal-overlay--open"),st(),setTimeout(()=>{C||(a.style.display="none")},ni);let h=e.fallbackFocus;h&&typeof h.focus=="function"&&setTimeout(()=>h.focus(),0)}if(b?.addEventListener("click",E),v?.addEventListener("click",E),a){let h=null;a.addEventListener("mousedown",A=>{h=A.target}),a.addEventListener("mouseup",A=>{A.target===a&&h===a&&E(),h=null})}return document.addEventListener("keydown",h=>{if(C){if(h.key==="Escape"){h.preventDefault(),E();return}if(h.key==="Tab"&&d){let A=at(d);if(A.length===0){h.preventDefault();return}let z=A[0],g=A[A.length-1];h.shiftKey&&document.activeElement===z?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),z.focus())}}}),{open:I,close:E,isOpen:()=>C,refresh:q,overlay:a}}function tr(e,t){return Math.max(0,t-oe(e))}function Rt(e,t){return oe(e)>=t}function nr(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 ct(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 Nt(e,t,n,r){let o=te(t,r);return!o.required||o.max!==o.min||be(e,n)!==-1?0:ct(e,t,n)}function oi(){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 ut(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 b=document.createElement("img");b.src=Te(e.featuredImage,240),b.srcset=Ae(e.featuredImage,Yn),b.sizes=Jn,b.alt=e.title,b.loading="lazy",l.appendChild(b)}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 b=document.createElement("span");b.className="lb-mix-match__filled-variant",b.textContent=e.variantTitle,d.appendChild(b)}let u=document.createElement("span");u.className="lb-mix-match__filled-price";let c=e.compareAtPrice||0;if(c>e.price){let b=document.createElement("s");b.className="lb-mix-match__filled-compare",b.textContent=n(c),u.appendChild(b)}let m=document.createElement("span");m.className="lb-bundle-product-price",m.textContent=n(e.price),u.appendChild(m);let f=document.createElement("span");if(f.className="lb-bundle-qty-inline",f.textContent="\xD7"+(e.quantity||1),u.appendChild(f),d.appendChild(u),e.unitPrice){let b=document.createElement("span");b.className="lb-bundle-product-unit-price",b.textContent=e.unitPrice,d.appendChild(b)}if(a.appendChild(d),r){let b=document.createElement("button");b.type="button",b.className="lb-mix-match__slot-remove",b.setAttribute("aria-label",(t.removeItem||"Remove")+" "+e.title),b.appendChild(oi()),b.addEventListener("click",v=>{v.stopPropagation(),o()}),a.appendChild(b)}else{let b=document.createElement("span");b.className="lb-mix-match__slot-required",b.textContent=t.required||"Required",a.appendChild(b)}return a.addEventListener("click",i),a}function rr(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(ut(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 or(e,t,n,r,o,i){let a=e.querySelector("[data-pricing-section]");if(oe(t)<n){a&&(a.style.display="none");return}a&&(a.style.display="");let l=0;for(let d=0;d<t.length;d++)l+=t[d].price*(t[d].quantity||1);l>0&&r.discountType&&i(e,o(l,r.discountType,r.discountValue??0),l)}function ir(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 f=0;f<s.length;f++)s[f].classList.toggle("lb-mix-match__progress-segment--filled",f<i);let u=d.querySelector("[data-progress-count]");u&&(u.textContent=tt(i,r,o));let c=d.querySelector("[data-progress-remaining]");c&&(c.textContent=Wn(a,o));let m=d.querySelector(".lb-mix-match__progress-segments");m&&m.setAttribute("aria-valuenow",String(i))}}function pt(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 ar(e,t,n,r){let o=u=>u.variants.find(c=>c.available)??null,i=(u,c,m)=>({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:m}),a=[];for(let u of e){if(!u.available||!u.variants)continue;let c=!1;for(let b of u.variants){let v=pe(b.id,t);!v?.required||!b.available||(a.push(i(u,b,Math.max(1,v.min))),c=!0)}if(c)continue;let m=te(u.id,t);if(!m.required)continue;let f=o(u);f&&a.push(i(u,f,Math.max(1,m.min)))}if(a.length||!r?.enabled)return a;let l=u=>u.available&&te(u.id,t).min<=n,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 lr(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 mt(e){let t="lb-modal-title-"+e.domId,n=Y("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.bundleGid,style:"display: none;"}),r=Y("div","lb-mix-match__modal"+(e.showTypeFilters?"":" lb-mix-match__modal--filters-hidden"),{role:"dialog","aria-modal":"true","aria-labelledby":t,tabindex:"-1"}),o=Y("div","lb-mix-match__modal-header"),i=Y("div","lb-mix-match__modal-header-top"),a=Y("div","lb-mix-match__modal-heading"),l=Y("h4","lb-mix-match__modal-title",{id:t});e.wizard&&l.setAttribute("tabindex","-1"),l.textContent="Add to your bundle",a.appendChild(l),a.appendChild(Y("p","lb-mix-match__modal-subtitle",{"data-modal-subtitle":""})),i.appendChild(a);let d=Y("button","lb-mix-match__modal-close",{type:"button","data-modal-close":"","aria-label":"Close"});d.appendChild(lr([["5","5","15","15"],["15","5","5","15"]])),i.appendChild(d),o.appendChild(i);let s=Y("div","lb-mix-match__progress lb-mix-match__modal-progress",{"data-progress":""}),u=Y("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e.segmentCount??0)});if(e.wizard)u.setAttribute("data-modal-step-segments","");else for(let v=0;v<(e.segmentCount??0);v++)u.appendChild(Y("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));if(s.appendChild(u),o.appendChild(s),r.appendChild(o),e.showSearch){let v=Y("div","lb-mix-match__modal-search"),D=Y("input","lb-mix-match__modal-search-input",{type:"text","data-modal-search":"",role:"searchbox","aria-label":"Search products",placeholder:"Search products",autocomplete:"off"});v.appendChild(D);let x=Y("button","lb-mix-match__modal-search-clear",{type:"button","data-modal-search-clear":"","aria-label":"Clear search",style:"display: none;"});x.appendChild(lr([["5","5","15","15"],["15","5","5","15"]])),v.appendChild(x),r.appendChild(v)}e.showTypeFilters&&r.appendChild(Y("div","lb-mix-match__filters",{"data-modal-filters":"",role:"group","aria-label":"Filter by type"})),r.appendChild(Y("div","lb-mix-match__modal-list",{"data-modal-list":""}));let c=Y("div","lb-mix-match__modal-empty",{"data-modal-empty":"",style:"display: none;"}),m=document.createElement("p");m.textContent="No products match your search",c.appendChild(m),r.appendChild(c),r.appendChild(Y("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"}));let f=Y("div",e.wizard?"lb-mix-match__modal-footer lb-multi-step__modal-footer":"lb-mix-match__modal-footer");if(e.wizard){let v=Y("button","lb-multi-step__modal-back",{type:"button","data-modal-back":"",style:"display: none;"});v.textContent="Back",f.appendChild(v)}if(f.appendChild(Y("span","lb-mix-match__modal-footer-count",{"data-modal-footer-count":"","aria-live":"polite"})),e.wizard){let v=Y("button","lb-mix-match__modal-done",{type:"button","data-modal-next":"",style:"display: none;"});v.textContent="Next",f.appendChild(v)}let b=Y("button","lb-mix-match__modal-done",{type:"button","data-modal-done":"",...e.wizard?{style:"display: none;"}:{}});return b.textContent="Done",f.appendChild(b),r.appendChild(f),n.appendChild(r),n}function sr(e,t,n,r,o){let i=t.widgetConfig,a=ue,l=t.minQuantity||1,d=nt(t.productRules,t.variantRules),u=We(t).map((_,C)=>({id:Number(_.productId),title:_.title??"",url:_.url??null,type:t.products[C]?.productType??"",featuredImage:_.featuredImage??null,available:_.variants.some(p=>p.available),optionNames:_.optionNames,variants:_.variants.map(p=>({id:Number(p.id),title:p.title,options:p.options,available:p.available,price:p.price,compareAtPrice:p.compareAtPrice,unitPrice:p.unitPrice,image:p.image,inventoryQuantity:p.inventoryQuantity??null}))}));if(!u.length||u.filter(_=>_.available).length===0)return;let m=le(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),f=de("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});f.root.setAttribute("data-required-quantity",String(l)),f.products.before(Ye(l));let b=document.createElement("div");b.className="lb-mix-match__slots lb-edge-fade",b.setAttribute("data-selection-slots",""),f.products.replaceWith(b);let v=document.createElement("button");v.type="button",v.className="lb-mix-match__add-product",v.setAttribute("data-add-product-trigger",""),v.textContent=(a.addItem,"Add a product"),b.after(v);let D=mt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:i.showSearch!==!1,showTypeFilters:i.mixMatchShowTypeFilters!==!1,segmentCount:l,wizard:!1});f.root.appendChild(D);let x=o?t.products.findIndex(_=>_.handle===o):-1,S=ar(u,d,l,{enabled:!!o,currentProductId:x!==-1?u[x]?.id??null:null}),U={remainingSpots:()=>tr(S,l),ownQty:_=>$n(S,_),variantUnitsElsewhere:_=>nr(S,_),productUnitsElsewhere:(_,C)=>ct(S,_,C),swapUnits:(_,C)=>Nt(S,_,C,d),isInBundle:_=>be(S,_)!==-1,canRemove:_=>{let C=be(S,_);return C!==-1&&Ee(S,S[C],d)},isFull:()=>Rt(S,l),commitQty:(_,C)=>{let p=be(S,_);return p===-1||S[p].quantity===C?!1:(S[p].quantity=C,!0)}};function M(){rr(f.root,S,l,t,{formatMoney:m,rulesMap:d,onRemove:_=>{Ee(S,S[_],d)&&(S.splice(_,1),M(),N.isOpen()&&N.refresh())},onEdit:()=>N.open()}),or(f.root,S,l,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},(_,C,p)=>Ue(_,C,p),pt(m)),ir(f.root,N.overlay,S,l,a)}let N=er({container:f.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:m,rowCapacity:U,dropdown:void 0,portalTarget:null,fallbackFocus:v,onSelectionChanged:M,addSelection:_=>{if(oe(S)+(_.quantity||1)>l)return;let C=pe(_.variantId,d)?.max,p=te(_.productId,d).max-ct(S,_.productId,_.variantId);typeof C=="number"&&(p=Math.min(p,C)),!((_.quantity||1)>p)&&(S.push(_),M())},removeVariant:_=>{let C=be(S,_);C===-1||!Ee(S,S[C],d)||(S.splice(C,1),M())},swapVariant:(_,C)=>{let p=0;for(let H=S.length-1;H>=0&&p<C;H--){let R=S[H];if(R.productId!==_.productId||R.variantId===_.variantId)continue;let q=Math.min(R.quantity||1,C-p);q>=(R.quantity||1)?S.splice(H,1):R.quantity=(R.quantity||1)-q,p+=q}p>0&&(_.quantity=p,S.push(_),M())},swapUnitsFor:(_,C)=>Nt(S,_,C,d),isInBundle:_=>be(S,_)!==-1,atCapacity:()=>Rt(S,l)});v.addEventListener("click",()=>{N.isOpen()||N.open()}),f.cta.addEventListener("click",()=>{oe(S)<l||n(S.map(_=>({merchandiseId:"gid://shopify/ProductVariant/"+_.variantId,quantity:_.quantity||1,attributes:se(t.id,t.bundleType)})))}),e.appendChild(f.root),ce(f.root),M(),r?.(fe(f.root))}var dr="lb-volume__tier--oos";function ii(e){return parseInt(e.getAttribute("data-tier-qty")??"",10)||0}function Pe(e){return e.getAttribute("aria-disabled")==="true"}function cr(e,t){for(let n=0;n<e.length;n++){let r=e[n];t!==null&&ii(r)>t?(r.classList.add(dr),r.setAttribute("aria-disabled","true")):(r.classList.remove(dr),r.removeAttribute("aria-disabled"))}}function ur(e,t){let n=e[t];if(n&&!Pe(n))return t;for(let r=0;r<e.length;r++)if(!Pe(e[r]))return r;return-1}function Ht(e,t,n){let r=t+n;for(;r>=0&&r<e.length;){if(!Pe(e[r]))return r;r+=n}return t}function pr(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 ai(e,t,n){let r=parseInt(n.getAttribute("data-tier-qty")??"",10),o=pr(e,t,n),i=o*r,a=e*r;return{qty:r,priceEach:o,totalPrice:i,undiscountedTotal:a,totalSavings:a-i}}function li(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 mr(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(pr(t,n,i)));let l=i.querySelector(".lb-volume__tier-compare");l&&(l.textContent=r(t))}}function br(e,t,n,r,o,i,a){for(let x=0;x<t.length;x++)t[x].setAttribute("aria-checked",x===o?"true":"false"),t[x].setAttribute("tabindex",x===o?"0":"-1");let{qty:l,totalPrice:d,undiscountedTotal:s,totalSavings:u}=ai(n,r,t[o]),c=e.querySelector("[data-item-count]");if(c){let x=li(l,i);x!==null&&(c.textContent=x)}let m=e.querySelector("[data-total-price]");m&&(m.textContent=a(d));let f=e.querySelector("[data-compare-price]");f&&(u>0?(f.textContent=a(s),f.style.display=""):f.style.display="none");let b=e.querySelector("[data-savings-bar]"),v=e.querySelector("[data-savings-amount]"),D=e.querySelector("[data-savings-percent]");if(b)if(u>0){if(v&&(v.textContent=a(u)),D){let x=s>0?Math.round(u*100/s):0;D.textContent="("+x+"%)"}b.style.display=""}else b.style.display="none"}function hr(e,t,n,r){let o=t.widgetConfig,i=xn(t.products,r);if(!i)return;let a=i.variants.nodes,l=Math.min(...t.volumeTiers.map(C=>C.minQuantity)),d=a.find(C=>Ie(C,l))??a.find(C=>C.availableForSale)??a[0];if(!d)return;let s=Qe(d.price.amount),u=t.discountConfig.discountType,c=le(i.priceRange.minVariantPrice.currencyCode),m=ue,f=bn(t.volumeTiers,u),b=hn(o.defaultTier,t.volumeTiers.length,f),v=fn(o.popularBadge?.tierIndex,o.popularBadge?.visible!==!1,f),D=t.volumeTiers.map((C,p)=>{let H=u==="fixed_amount"?0:Math.round(C.percentage??0),R=u==="fixed_amount"?Math.round((C.amount??0)*100):0,q=u==="fixed_amount"?Math.max(0,s-R):Math.max(0,s-Math.floor(s*H/100)),B=s>0?Math.round((s-q)*100/s):0;return{quantity:C.minQuantity,percent:H,amountCents:R,label:Z(m.buyQty||"Buy __COUNT__",{COUNT:C.minQuantity}),savingsLabel:B>0?"Save "+B+"%":null,badgeLabel:p===v?o.popularBadge?.text||"Most popular":null,selected:p===b}});if(!D.length)return;let x=de("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||m.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt}),S=qn(D,"Select quantity",{showCompare:o.pricing?.showComparePrice!==!1,showPriceEach:o.pricing?.showPerUnitPrice!==!1,unitLabel:(m.each||"each").trim()});x.products.replaceWith(S);let U=S.querySelectorAll("[data-tier-index]");mr(U,s,u,c),cr(U,ze(d));let M=ur(U,b),N=M===-1;N&&(M=b);let _=()=>br(x.root,U,s,u,M,m,c);if(S.addEventListener("click",C=>{let p=C.target.closest("[data-tier-index]");!p||Pe(p)||(M=parseInt(p.getAttribute("data-tier-index")??"",10)||0,_())}),S.addEventListener("keydown",C=>{C.key==="ArrowDown"||C.key==="ArrowRight"?(C.preventDefault(),M=Ht(U,M,1),_(),U[M].focus()):(C.key==="ArrowUp"||C.key==="ArrowLeft")&&(C.preventDefault(),M=Ht(U,M,-1),_(),U[M].focus())}),N){x.cta.disabled=!0;let C=x.cta.querySelector("[data-cta-label]");C&&(C.textContent=m.outOfStock||"Out of stock")}else x.cta.addEventListener("click",()=>{let C=parseInt(U[M].getAttribute("data-tier-qty")??"",10);n([{merchandiseId:d.id,quantity:C,attributes:se(t.id,t.bundleType)}])});e.appendChild(x.root),ce(x.root),_()}function bt(e,t){return e-Math.floor(e*t/100)}function si(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+bt(i.price,t)*r;return{totalPrice:a,salePrice:l,savings:a-l}}function Dt(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(bt(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 Ot(e,t,n,r,o,i){let{totalPrice:a,salePrice:l,savings:d}=si(t,n,r,o),s=e.querySelector("[data-sale-price]"),u=e.querySelector("[data-compare-price]"),c=e.querySelector("[data-savings-bar]"),m=e.querySelector("[data-savings-amount]"),f=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(m&&(m.textContent=i(d)),f){let b=a>0?Math.round(d*100/a):0;f.textContent="("+b+"%)"}c.style.display=""}else c.style.display="none"}function fr(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=bt(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}]}function di(){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 gr(e,t,n,r){let o=t.widgetConfig,i=t.products.find(x=>x.id===t.buyProductId),a=t.products.find(x=>x.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=[{...Ce(i,t.id,{quantities:u,allowedVariantIds:t.selectedVariantIds?.[0]??null}),role:"buy"},{...Ce(a,t.id,{quantities:u,allowedVariantIds:t.selectedVariantIds?.[1]??null}),role:"get"}],m=c.filter(x=>!x.variants.some(S=>S.available)).length,f=le(i.priceRange.minVariantPrice.currencyCode),b=ue,v=de("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});v.root.setAttribute("data-discount-value",String(s)),v.root.setAttribute("data-buy-qty",String(l)),v.root.setAttribute("data-get-qty",String(d));let D=s>=100?"Free":s+"% off";if(c.forEach((x,S)=>{let U=S===1;U&&v.products.appendChild(di());let M=!x.variants.some(C=>C.available),N=Ke(x,b,{isOos:M,href:x.url,bogoRole:x.role,inlineQuantity:U?d:l,badgeText:U&&!M?D:null,thumbnailRatio:o.productList?.thumbnailRatio});if(v.products.appendChild(N),M)return;let _=ee(x,x.selectedVariantId);$e(N,x,_),Ge(N,_,x.featuredImage),Dt(N,_,s,U,f),je(N,()=>x,C=>{Ge(N,C,x.featuredImage),Dt(N,C,s,U,f),Ot(v.root,c,s,l,d,f)})}),m>0){v.cta.disabled=!0;let x=v.cta.querySelector("[data-cta-label]");x&&(x.textContent=Je(b,m))}else v.cta.addEventListener("click",()=>{n(fr(c,s,l,d).map(x=>({merchandiseId:"gid://shopify/ProductVariant/"+x.variantId,quantity:x.quantity,attributes:se(t.id,t.bundleType)})))});e.appendChild(v.root),ce(v.root),Ot(v.root,c,s,l,d,f),r?.(fe(v.root))}function Ft(e,t,n){return Z(n.stepOf||"Step __STEP__ of __TOTAL__",{STEP:e+1,TOTAL:t})}function Be(e,t,n){return Z(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function vr(e,t,n){return Z(n.stepsCompleted||"__COUNT__ of __TOTAL__ steps completed",{COUNT:e,TOTAL:t})}function yr(e,t){return e>0?Z(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function xr(e,t,n){let r=new Intl.PluralRules(n||"en").select(t);return Z(e[r]||e.other||"__COUNT__",{COUNT:t})}function wr(e,t){return e?t.doorContinue||"Continue building":t.doorChoose||"Choose your products"}function _r(e,t,n,r){if(!e){let o=r.doorQuickSteps;return typeof o=="string"?Z(o,{COUNT:n}):xr(o||{one:"__COUNT__ quick step",other:"__COUNT__ quick steps"},n,r.locale)}return xr(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 qe(e,t,n){let r=t[n].maxQuantity;return r==null?1/0:Math.max(0,r-ge(e,n))}function Re(e,t){for(let n=0;n<t.length;n++)if(!xe(e,t,n))return!1;return!0}function Ne(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 Vt(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 Cr(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=Be(Math.min(ge(r,i),a),a,o),s=xe(r,n,i),u=t.querySelectorAll('[data-step-count="'+i+'"]');for(let m=0;m<u.length;m++)u[m].textContent=d,u[m].classList.toggle("lb-multi-step__group-count--met",s);let c=t.querySelector('[data-step-slots="'+i+'"]');if(c){c.innerHTML="";for(let m=0;m<r[i].length;m++){let f=i,b=m,v=r[f][b];c.appendChild(ut(v,o,e.formatMoney,Ne(r,v,e.rulesMap),()=>e.onRemove(f,b),()=>e.onEdit(f)))}}}}function kr(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 b=0;b<n.length;b++)r[b].length>0&&(d=!0),xe(r,n,b)||(l+=1,a===-1&&(a=b));if(a===-1){i.style.display="none",i.classList.add("lb-multi-step__door--hidden");let b=i.parentElement;b&&b.firstElementChild!==i&&b.insertBefore(i,b.firstElementChild);return}i.style.display="",i.classList.remove("lb-multi-step__door--hidden"),i.setAttribute("data-step-door",String(a));let s=wr(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=_r(d,l,n.length,o));let m=n[a].name||"";i.setAttribute("aria-label",m?s+": "+m:s);let f=t.querySelector('[data-step-group="'+a+'"]');f&&f.parentElement&&f.previousElementSibling!==i&&f.parentElement.insertBefore(i,f)}function Tr(e,t,n,r){let{container:o,steps:i,selections:a}=e,l=o.querySelector("[data-pricing-section]");if(!Re(a,i)){l&&(l.style.display="none");return}l&&(l.style.display="");let d=0;for(let s of a)for(let u of s)d+=u.price*(u.quantity||1);d>0&&t.discountType&&r(o,n(d,t.discountType,t.discountValue??0),d)}function Sr(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=vr(i,n.length,o));let s=t.querySelector("[data-progress-remaining]");s&&(s.textContent=yr(a,o));let u=t.querySelector(".lb-mix-match__progress-segments");u&&u.setAttribute("aria-valuenow",String(i))}function Er(e){let t=e.container.querySelector("[data-add-bundle]");if(!t)return;t.disabled=!Re(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 Ir(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 He="__all__",ci=300,ui=200,pi=500,mi=160;function Ar(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=k=>i?i.querySelector(k):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]"),m=a("[data-modal-empty]"),f=a("[data-modal-live]"),b=a("[data-modal-close]"),v=a("[data-modal-back]"),D=a("[data-modal-next]"),x=a("[data-modal-done]"),S=a("[data-modal-footer-count]"),U=a("[data-modal-subtitle]"),M=a("[data-modal-step-segments]"),N=a("[data-modal-filters]"),_=He,C=!1,p=0,H=[],R=null,q=null,B=k=>n[k].eligibleProducts||[],G={remainingSpots:()=>qe(r,n,p),ownQty:k=>{let T=_e(r,p,k);return T===-1?0:r[p][T].quantity||0},variantUnitsElsewhere:k=>{let T=0;for(let y of r)for(let w of y)w.variantId===k&&(T+=w.quantity||0);return T},productUnitsElsewhere:(k,T)=>{let y=0;for(let w=0;w<r.length;w++)for(let L of r[w])L.productId===k&&(w===p&&L.variantId===T||(y+=L.quantity||0));return y},swapUnits:(k,T)=>Vt(r,p,k,T,e.rulesMap),isInBundle:k=>_e(r,p,k)!==-1,canRemove:k=>{let T=_e(r,p,k);return T!==-1&&e.canRemove(r[p][T])},isFull:()=>qe(r,n,p)===0,commitQty:(k,T)=>{let y=_e(r,p,k);return y===-1||r[p][y].quantity===T?!1:(r[p][y].quantity=T,!0)}};function $(k){if(!M)return;let T=n[k].minQuantity||1;M.innerHTML="",M.setAttribute("aria-valuemax",String(T));for(let y=0;y<T;y++){let w=document.createElement("span");w.className="lb-mix-match__progress-segment",w.setAttribute("data-progress-segment",""),M.appendChild(w)}J()}function J(){if(!M)return;let k=n[p].minQuantity||1,T=Math.min(ge(r,p),k),y=M.querySelectorAll("[data-progress-segment]");for(let w=0;w<y.length;w++)y[w].classList.toggle("lb-mix-match__progress-segment--filled",w<T);M.setAttribute("aria-valuenow",String(T))}function W(){let k=n[p].minQuantity||1,T=Math.min(ge(r,p),k);S&&(S.textContent=Be(T,k,o)),U&&(U.textContent=Ft(p,n.length,o)+" \xB7 "+(n[p].name||""));let y=xe(r,n,p),w=p===n.length-1;v&&(v.style.display=p>0?"":"none"),D&&(D.style.display=w?"none":"",D.disabled=!y),x&&(x.style.display=w?"":"none",x.disabled=!y),J()}function I(){for(let k of H)k.refresh();W()}function E(){if(!e.autoAdvance||p>=n.length-1||qe(r,n,p)!==0)return;let k=p;q!==null&&clearTimeout(q),q=setTimeout(()=>{q=null,C&&j(k+1)},mi)}function h(k){if(!c)return;e.dropdown?.unbindAll(c),c.innerHTML="",H=[];let T=B(k);for(let L=0;L<T.length;L++){let O=it(T[L],L,{t:o,rulesMap:e.rulesMap,capacity:G,showQtySelector:e.showQtySelector,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),I(),E()}});H.push(O),c.appendChild(O.el)}let y=r[k]||[],w=Object.create(null);for(let L of y)w[String(L.productId)]=!0;dt(c,H.map(L=>L.el),L=>w[String(T[L].id)]===!0),e.dropdown?.bindAll(c)}function A(k){let T=k.target.closest("[data-add-product]");if(!T||T.disabled)return;let w=B(p)[parseInt(T.getAttribute("data-add-product")??"",10)];if(!w)return;let L=T.closest(".lb-mix-match__modal-product"),O=L&&L.getAttribute("data-selected-variant-id"),V=(O?w.variants.find(xt=>xt.id===parseInt(O,10)):null)??null;if(V||(V=w.variants.find(xt=>xt.available)??null),!V)return;let X=_e(r,p,V.id);if(X!==-1){if(!e.canRemove(r[p][X]))return;r[p].splice(X,1),e.onSelectionChanged(),I();return}let me=L?.querySelector("[data-row-qty]"),he=me?Math.max(1,parseInt(me.getAttribute("data-qty")||me.textContent||"",10)||1):rt(w.id,e.rulesMap,V.id),ne={productId:w.id,variantId:V.id,title:w.title,url:w.url||null,variantTitle:V.title,featuredImage:V.image||w.featuredImage||null,price:V.price,compareAtPrice:V.compareAtPrice||null,unitPrice:V.unitPrice||null,quantity:he},ve=Vt(r,p,w.id,V.id,e.rulesMap);if(ve>0){e.swapVariant(p,ne,Math.min(he,ve)),I();return}let zt=qe(r,n,p);zt!==1/0&&he>zt||(r[p].push(ne),e.onSelectionChanged(),I(),E())}c&&c.addEventListener("click",A);function z(k){if(!N||!e.showTypeFilters)return;let T=[],y=Object.create(null);for(let w of B(k)){let L=(w.type||"").trim();L&&!y[L]&&(y[L]=!0,T.push(L))}if(T.length<2){N.style.display="none",l?.classList.add("lb-mix-match__modal--filters-hidden");return}N.style.display="",l?.classList.remove("lb-mix-match__modal--filters-hidden"),N.innerHTML="";for(let w of[He,...T]){let L=document.createElement("button");L.type="button",L.className="lb-mix-match__filter",L.setAttribute("data-filter",w),L.setAttribute("aria-pressed",w===_?"true":"false"),w===_&&L.classList.add("lb-mix-match__filter--active"),L.textContent=w===He?o.allTypes||"All":w,L.addEventListener("click",()=>{_=w,g(),F(s?s.value:"")}),N.appendChild(L)}}function g(){if(!N)return;let k=N.querySelectorAll("[data-filter]");for(let T=0;T<k.length;T++){let y=k[T].getAttribute("data-filter")===_;k[T].classList.toggle("lb-mix-match__filter--active",y),k[T].setAttribute("aria-pressed",y?"true":"false")}}function F(k){if(!c)return;let T=Se(k),y=c.querySelectorAll("[data-product-item]"),w=0;for(let L=0;L<y.length;L++){let O=y[L].getAttribute("data-title")??"",V=y[L].getAttribute("data-type")||"",X=(!T||O.indexOf(T)!==-1)&&(_===He||V===_);y[L].classList.toggle("lb-hidden",!X),X&&w++}m&&(m.style.display=w===0&&T.length>0?"":"none"),u&&(u.style.display=k.length>0?"":"none"),f&&(f.textContent=Z(o.nProductsShown||"__COUNT__ products shown",{COUNT:w}))}if(s){let k=ot(()=>F(s.value),ui);s.addEventListener("input",k)}u&&u.addEventListener("click",()=>{s&&(s.value="",F(""),s.focus())});function j(k,T={}){let y=Math.max(0,Math.min(n.length-1,k));if(q!==null&&(clearTimeout(q),q=null),l&&(R!==null&&clearTimeout(R),R=null,l.removeAttribute("data-step-transition"),T.animate!==!1&&y!==p)){l.offsetHeight,l.setAttribute("data-step-transition",y>p?"forward":"back");let w=l;R=setTimeout(()=>{R=null,w.removeAttribute("data-step-transition")},pi)}if(p=y,h(p),z(p),_=He,g(),s&&(s.value=""),F(""),c&&(c.scrollTop=0),$(p),I(),f){let w=n[p].minQuantity||1;f.textContent=Ft(p,n.length,o)+". "+(n[p].name||"")+". "+Be(Math.min(ge(r,p),w),w,o)}!T.skipFocus&&d&&typeof d.focus=="function"&&d.focus()}function Q(k){!i||C||(C=!0,j(typeof k=="number"?k:0,{skipFocus:!0,animate:!1}),i.style.display="",i.offsetHeight,i.classList.add("lb-mix-match__modal-overlay--open"),lt(),setTimeout(()=>{b?b.focus():l?.focus()},50))}function K(){if(!i||!C)return;C=!1,q!==null&&(clearTimeout(q),q=null),R!==null&&(clearTimeout(R),R=null),i.classList.remove("lb-mix-match__modal-overlay--open"),st(),setTimeout(()=>{C||(i.style.display="none")},ci);let k=y=>y&&y.offsetParent!==null?y:null,T=k(t.querySelector('[data-step-row="'+p+'"]'))||k(t.querySelector("[data-step-door]"))||e.ctaButton;T&&typeof T.focus=="function"&&setTimeout(()=>T.focus(),0)}if(b?.addEventListener("click",K),x?.addEventListener("click",K),v?.addEventListener("click",()=>{p>0&&j(p-1)}),D?.addEventListener("click",()=>{p<n.length-1&&xe(r,n,p)&&j(p+1)}),i){let k=null;i.addEventListener("mousedown",T=>{k=T.target}),i.addEventListener("mouseup",T=>{T.target===i&&k===i&&K(),k=null})}return document.addEventListener("keydown",k=>{if(C){if(k.key==="Escape"){k.preventDefault(),K();return}if(k.key==="Tab"&&l){let T=at(l);if(T.length===0){k.preventDefault();return}let y=T[0],w=T[T.length-1];k.shiftKey&&document.activeElement===y?(k.preventDefault(),w.focus()):!k.shiftKey&&document.activeElement===w&&(k.preventDefault(),y.focus())}}}),{open:Q,close:K,isOpen:()=>C,refresh:I}}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 Lr(e,t,n,r){let o=t.widgetConfig,i=ue,a=nt(t.productRules,t.variantRules),l=t.steps??[];if(!l.length)return;let d={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},s=l.map((p,H)=>vn(t,H).map(R=>{let q=Ce(R,t.id,{quantities:d,allowedVariantIds:null});return{id:Number(q.productId),title:q.title??"",url:q.url??null,type:R.productType??"",featuredImage:q.featuredImage??null,available:q.variants.some(B=>B.available),optionNames:q.optionNames,variants:q.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(!(s.length>0&&s.every(p=>p.some(H=>H.available))))return;let c=le(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),m=de("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});m.products.before(Ye(l.length));let f=document.createElement("div");f.className="lb-multi-step__groups",f.setAttribute("data-step-groups","");let b=document.createElement("button");b.type="button",b.className="lb-mix-match__add-product lb-multi-step__door",b.setAttribute("data-step-door","0");let v=document.createElement("span");v.className="lb-mix-match__add-product-icon",v.setAttribute("aria-hidden","true"),v.appendChild(bi()),b.appendChild(v);let D=document.createElement("span");D.className="lb-multi-step__door-copy";let x=document.createElement("span");x.className="lb-mix-match__add-product-label",D.appendChild(x);let S=document.createElement("span");S.className="lb-multi-step__door-sub",D.appendChild(S),b.appendChild(D),f.appendChild(b),l.forEach((p,H)=>{let R=document.createElement("section");R.className="lb-multi-step__group",R.setAttribute("data-step-group",String(H)),R.setAttribute("data-step-mode","row");let q=()=>{let E=document.createElement("span");return E.className="lb-multi-step__group-count",E.setAttribute("data-step-count",String(H)),E},B=document.createElement("button");B.type="button",B.className="lb-multi-step__step-row",B.setAttribute("data-step-row",String(H)),B.setAttribute("aria-label","Choose products: "+p.name);let G=document.createElement("span");G.className="lb-multi-step__step-ix",G.setAttribute("aria-hidden","true"),G.textContent=String(H+1),B.appendChild(G);let $=document.createElement("span");$.className="lb-multi-step__group-name",$.textContent=p.name,B.appendChild($),B.appendChild(q()),R.appendChild(B);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=p.name,J.appendChild(W),J.appendChild(q()),R.appendChild(J);let I=document.createElement("div");I.className="lb-mix-match__slots lb-edge-fade lb-multi-step__group-slots",I.setAttribute("data-step-slots",String(H)),R.appendChild(I),f.appendChild(R)}),m.products.replaceWith(f);let U=mt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:o.showSearch!==!1,showTypeFilters:o.mixMatchShowTypeFilters!==!1,segmentCount:null,wizard:!0});m.root.appendChild(U);let M=l.map(()=>[]),N={container:m.root,steps:l.map((p,H)=>({name:p.name,minQuantity:p.minQuantity,maxQuantity:p.maxQuantity,eligibleProducts:s[H]})),selections:M,t:i,rulesMap:a,formatMoney:c,onRemove:(p,H)=>{let R=M[p][H];!R||!Ne(M,R,a)||(M[p].splice(H,1),_(),C.isOpen()&&C.refresh())},onEdit:p=>C.open(p)};function _(){Cr(N),kr(N),Tr(N,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},(p,H,R)=>Ue(p,H,R),pt(c)),Sr(N),Er(N)}let C=Ar({container:m.root,steps:N.steps,selections:M,t:i,rulesMap:a,showQtySelector:o.mixMatchShowQuantitySelector!==!1,showTypeFilters:o.mixMatchShowTypeFilters!==!1,autoAdvance:o.multiStepAutoAdvance===!0,formatMoney:c,dropdown:void 0,portalTarget:null,ctaButton:m.cta,onSelectionChanged:_,swapVariant:(p,H,R)=>{let q=0,B=M[p];for(let G=B.length-1;G>=0&&q<R;G--){let $=B[G];if($.productId!==H.productId||$.variantId===H.variantId)continue;let J=Math.min($.quantity||1,R-q);J>=($.quantity||1)?B.splice(G,1):$.quantity=($.quantity||1)-J,q+=J}q>0&&(H.quantity=q,B.push(H),_())},canRemove:p=>Ne(M,p,a)});b.addEventListener("click",()=>{C.isOpen()||C.open(parseInt(b.getAttribute("data-step-door")??"",10)||0)}),m.root.querySelectorAll("[data-step-row]").forEach(p=>{p.addEventListener("click",()=>{C.isOpen()||C.open(parseInt(p.getAttribute("data-step-row")??"",10)||0)})}),m.cta.addEventListener("click",()=>{Re(M,N.steps)&&n(Ir(M).map(p=>({merchandiseId:"gid://shopify/ProductVariant/"+p.variantId,quantity:p.quantity,attributes:se(t.id,t.bundleType)})))}),e.appendChild(m.root),ce(m.root),_(),r?.(fe(m.root))}var hi=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),ht=new Set,ft=!1;function Mr(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let n of ht)n.classList.add(e),n.classList.remove(t)}function Pr(e){hi.has(e.key)&&Mr("using-keyboard")}function Br(){Mr("using-mouse")}function fi(){ft||(ft=!0,document.addEventListener("keydown",Pr,!0),document.addEventListener("pointerdown",Br,!0))}function gi(){ft&&(ft=!1,document.removeEventListener("keydown",Pr,!0),document.removeEventListener("pointerdown",Br,!0))}function gt(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),ht.add(e),fi(),()=>{ht.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),ht.size===0&&gi()}}var Ut=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
261
261
 
262
262
  .lb-bundle-widget.lb-bundle-widget,
263
263
  .lb-bundle-widget.lb-bundle-widget * {
@@ -275,11 +275,18 @@
275
275
  --lb-list-max-height: 360px;
276
276
  /* Depth of the soft fade at a scroll list's clipped edge. */
277
277
  --lb-edge-fade-size: 20px;
278
- /* Derived "small" corner radius for inner controls (thumbnails, variant
279
- selects, the qty chip). One step tighter than the global --lb-radius so
280
- small elements stay proportionate. Both come from the global radius
281
- preset; nothing else sets a radius. */
282
- --lb-radius-sm: max(0px, calc(var(--lb-radius) - 4px));
278
+ /* Derived "small" corner radius for chips and badges \u2014 the low-stock badge,
279
+ the volume tier badge, the multi-step count chip. Controls and media
280
+ (thumbnails, selects, steppers, buttons) take the full --lb-radius: they
281
+ are the elements the merchant is looking at when they pick a preset, and
282
+ the picker's own help text already promises they follow it.
283
+
284
+ Proportional rather than a fixed subtraction. At "subtle" (6px) minus-4px
285
+ left 2px, which reads as square \u2014 the merchant saw a picker set to Subtle
286
+ render with sharp corners (issue #363). Two thirds holds the proportion at
287
+ every preset: none 0, subtle 4px, rounded 8px, round 12px. No max() needed,
288
+ since 0 \xD7 \u2154 is 0. */
289
+ --lb-radius-sm: calc(var(--lb-radius) * 2 / 3);
283
290
 
284
291
  font-family: inherit;
285
292
  font-size: 16px;
@@ -443,7 +450,7 @@
443
450
  ratio. Default keeps the historical 1:1 behaviour. */
444
451
  aspect-ratio: var(--lb-thumbnail-aspect-ratio, 1 / 1);
445
452
  background: var(--lb-thumbnail-bg);
446
- border-radius: var(--lb-radius-sm);
453
+ border-radius: var(--lb-radius);
447
454
  overflow: hidden;
448
455
  display: flex;
449
456
  align-items: center;
@@ -960,7 +967,7 @@ a.lb-bundle-product-name:focus-visible {
960
967
  emit the inline var for the "original" ratio and nothing else. Emitting it
961
968
  unconditionally silently replaced every merchant ratio with the image's own,
962
969
  which looks like the setting being ignored. */
963
- `,Ar=`/* Lime Bundles \u2014 Fixed bundle styles */
970
+ `,qr=`/* Lime Bundles \u2014 Fixed bundle styles */
964
971
 
965
972
  .lb-fixed__products {
966
973
  display: flex;
@@ -992,12 +999,12 @@ a.lb-bundle-product-name:focus-visible {
992
999
  .lb-fixed .lb-bundle-thumbnail {
993
1000
  width: 60px;
994
1001
  min-width: 60px;
995
- border-radius: var(--lb-radius-sm);
1002
+ border-radius: var(--lb-radius);
996
1003
  box-sizing: border-box;
997
1004
  }
998
1005
 
999
1006
  .lb-fixed .lb-bundle-thumbnail img {
1000
- border-radius: var(--lb-radius-sm);
1007
+ border-radius: var(--lb-radius);
1001
1008
  border: none;
1002
1009
  }
1003
1010
 
@@ -1014,7 +1021,7 @@ a.lb-bundle-product-name:focus-visible {
1014
1021
  display: var(--lb-product-qty-chip-display, inline-flex);
1015
1022
  align-items: center;
1016
1023
  justify-content: center;
1017
- border-radius: var(--lb-radius-sm);
1024
+ border-radius: var(--lb-radius);
1018
1025
  background: color-mix(in srgb, var(--lb-text) 7%, transparent);
1019
1026
  color: color-mix(in srgb, var(--lb-text) 75%, transparent);
1020
1027
  font-size: 13px;
@@ -1030,7 +1037,7 @@ a.lb-bundle-product-name:focus-visible {
1030
1037
  .lb-bundle-variant-select {
1031
1038
  display: inline-block;
1032
1039
  border: var(--lb-border-width) solid var(--lb-border);
1033
- border-radius: var(--lb-radius-sm);
1040
+ border-radius: var(--lb-radius);
1034
1041
  padding: 8px 32px 8px 12px;
1035
1042
  font-size: 12px;
1036
1043
  line-height: 16px;
@@ -1053,7 +1060,7 @@ a.lb-bundle-product-name:focus-visible {
1053
1060
  outline-offset: 2px;
1054
1061
  box-shadow: none;
1055
1062
  }
1056
- `,Lr=`/* Lime Bundles \u2014 Mix & Match styles */
1063
+ `,Rr=`/* Lime Bundles \u2014 Mix & Match styles */
1057
1064
 
1058
1065
  /* === Selected product list ================================================
1059
1066
  The chosen products render as bordered cards. Capped height so long
@@ -1177,12 +1184,12 @@ a.lb-bundle-product-name:focus-visible {
1177
1184
  position: relative;
1178
1185
  width: 60px;
1179
1186
  min-width: 60px;
1180
- border-radius: var(--lb-radius-sm);
1187
+ border-radius: var(--lb-radius);
1181
1188
  box-sizing: border-box;
1182
1189
  }
1183
1190
 
1184
1191
  .lb-mix-match .lb-bundle-thumbnail img {
1185
- border-radius: var(--lb-radius-sm);
1192
+ border-radius: var(--lb-radius);
1186
1193
  border: none;
1187
1194
  }
1188
1195
 
@@ -1348,14 +1355,26 @@ a.lb-bundle-product-name:focus-visible {
1348
1355
  color: inherit;
1349
1356
  }
1350
1357
 
1351
- /* Derived "small" radius for the picker's inner controls (search, thumbnails,
1352
- variant select, qty stepper, Add/Done buttons), one step tighter than the
1353
- modal's --lb-picker-radius \u2014 the picker-scoped mirror of --lb-radius-sm in the
1354
- main widget. Defined on the overlay so the modal AND the variant listbox
1355
- (which portals up to [data-modal-overlay]) both inherit it. The modal shell
1356
- and product tiles keep the full --lb-picker-radius. */
1358
+ /* Derived "small" radius for the picker's chips and badges \u2014 the progress
1359
+ segments, the "Added" badge, the close button, the filter pills. The
1360
+ picker-scoped mirror of --lb-radius-sm, and proportional for the same reason
1361
+ (see bundle-base.css).
1362
+
1363
+ Everything the merchant would call a control or an image \u2014 the modal, search,
1364
+ product tiles, thumbnails, variant dropdown, quantity stepper and the
1365
+ buttons \u2014 takes the full --lb-picker-radius instead. That is what the
1366
+ editor's own Borders copy promises them, and the reduced tier had it
1367
+ rendering square at the Subtle preset (issue #363).
1368
+
1369
+ Declared on BOTH hosts the modal can live under. On the storefront it portals
1370
+ to [data-modal-overlay], which the variant listbox portals up to as well. In
1371
+ the admin widget editor there is no overlay at all \u2014 the preview renders the
1372
+ modal directly under .lb-bundle-widget \u2014 so scoping this to the overlay alone
1373
+ left the variable undefined there and every control using it fell back to
1374
+ square corners while the modal and tiles rounded correctly (issue #363). */
1375
+ .lb-bundle-widget,
1357
1376
  [data-modal-overlay] {
1358
- --lb-picker-radius-sm: max(0px, calc(var(--lb-picker-radius) - 4px));
1377
+ --lb-picker-radius-sm: calc(var(--lb-picker-radius) * 2 / 3);
1359
1378
  }
1360
1379
 
1361
1380
  /* === Modal Overlay === */
@@ -1452,7 +1471,7 @@ a.lb-bundle-product-name:focus-visible {
1452
1471
  border: none;
1453
1472
  cursor: pointer;
1454
1473
  color: var(--lb-picker-text);
1455
- border-radius: 8px;
1474
+ border-radius: var(--lb-picker-radius-sm);
1456
1475
  padding: 0;
1457
1476
  margin: -12px -12px 0 0;
1458
1477
  transition: background 0.25s ease;
@@ -1482,7 +1501,9 @@ a.lb-bundle-product-name:focus-visible {
1482
1501
  .lb-mix-match__filter {
1483
1502
  padding: 6px 14px;
1484
1503
  border: var(--lb-picker-border-width) solid var(--lb-picker-border-color);
1485
- border-radius: 999px;
1504
+ /* Pills followed the merchant's picker radius as of #363 \u2014 a fixed 999px
1505
+ read as a stray rounded shape in a picker set to None or Subtle. */
1506
+ border-radius: var(--lb-picker-radius-sm);
1486
1507
  background: transparent;
1487
1508
  color: var(--lb-picker-text);
1488
1509
  font-family: inherit;
@@ -1536,7 +1557,7 @@ a.lb-bundle-product-name:focus-visible {
1536
1557
  width: 100%;
1537
1558
  padding: 12px 40px 12px 44px;
1538
1559
  border: var(--lb-picker-border-width) solid var(--lb-picker-border-color);
1539
- border-radius: var(--lb-picker-radius-sm);
1560
+ border-radius: var(--lb-picker-radius);
1540
1561
  font-size: 16px;
1541
1562
  line-height: 20px;
1542
1563
  color: var(--lb-picker-text);
@@ -1636,7 +1657,7 @@ a.lb-bundle-product-name:focus-visible {
1636
1657
  independent from the main widget's thumbnailRatio so a merchant can
1637
1658
  e.g. show tall picker thumbs with square main thumbs. */
1638
1659
  aspect-ratio: var(--lb-picker-thumbnail-aspect-ratio, 1 / 1);
1639
- border-radius: var(--lb-picker-radius-sm);
1660
+ border-radius: var(--lb-picker-radius);
1640
1661
  box-sizing: border-box;
1641
1662
  overflow: hidden;
1642
1663
  background: var(--lb-thumbnail-bg);
@@ -1649,7 +1670,7 @@ a.lb-bundle-product-name:focus-visible {
1649
1670
  to auto/contain so the image renders uncropped at intrinsic ratio. */
1650
1671
  height: var(--lb-picker-thumbnail-img-height, 100%);
1651
1672
  object-fit: var(--lb-picker-thumbnail-img-fit, cover);
1652
- border-radius: var(--lb-picker-radius-sm);
1673
+ border-radius: var(--lb-picker-radius);
1653
1674
  }
1654
1675
 
1655
1676
  .lb-mix-match__modal-product-info {
@@ -1724,7 +1745,7 @@ a.lb-bundle-product-name:focus-visible {
1724
1745
  font-size: 12px;
1725
1746
  padding: 4px 24px 4px 8px;
1726
1747
  border: var(--lb-picker-border-width) solid var(--lb-picker-border-color);
1727
- border-radius: var(--lb-picker-radius-sm);
1748
+ border-radius: var(--lb-picker-radius);
1728
1749
  background-color: var(--lb-picker-bg);
1729
1750
  background-image: var(--lb-picker-variant-chevron);
1730
1751
  background-repeat: no-repeat;
@@ -1775,7 +1796,7 @@ a.lb-bundle-product-name:focus-visible {
1775
1796
  width: 100%;
1776
1797
  flex-shrink: 0;
1777
1798
  border: var(--lb-picker-border-width) solid var(--lb-picker-border-color);
1778
- border-radius: var(--lb-picker-radius-sm);
1799
+ border-radius: var(--lb-picker-radius);
1779
1800
  background-color: var(--lb-picker-bg);
1780
1801
  overflow: hidden;
1781
1802
  box-sizing: border-box;
@@ -1852,7 +1873,7 @@ a.lb-bundle-product-name:focus-visible {
1852
1873
  background: var(--lb-picker-add-bg);
1853
1874
  color: var(--lb-picker-add-label);
1854
1875
  border: var(--lb-picker-add-border-width) solid var(--lb-picker-add-border-color);
1855
- border-radius: var(--lb-picker-radius-sm);
1876
+ border-radius: var(--lb-picker-radius);
1856
1877
  box-sizing: border-box;
1857
1878
  font-size: 12px;
1858
1879
  font-weight: 600;
@@ -1993,7 +2014,7 @@ a.lb-bundle-product-name:focus-visible {
1993
2014
  background: var(--lb-picker-add-bg);
1994
2015
  color: var(--lb-picker-add-label);
1995
2016
  border: var(--lb-picker-add-border-width) solid var(--lb-picker-add-border-color);
1996
- border-radius: var(--lb-picker-radius-sm);
2017
+ border-radius: var(--lb-picker-radius);
1997
2018
  box-sizing: border-box;
1998
2019
  font-family: inherit;
1999
2020
  font-size: 14px;
@@ -2042,7 +2063,9 @@ a.lb-bundle-product-name:focus-visible {
2042
2063
  .lb-mix-match__modal {
2043
2064
  max-width: 100%;
2044
2065
  max-height: 90vh;
2045
- border-radius: 16px 16px 0 0;
2066
+ /* Bottom sheet: only the top corners round, but they round to whatever the
2067
+ merchant picked rather than a fixed 16px (issue #363). */
2068
+ border-radius: var(--lb-picker-radius) var(--lb-picker-radius) 0 0;
2046
2069
  transform: translateY(100%);
2047
2070
  }
2048
2071
 
@@ -2100,7 +2123,7 @@ a.lb-bundle-product-name:focus-visible {
2100
2123
  transition: none;
2101
2124
  }
2102
2125
  }
2103
- `,Mr=`/* Lime Bundles \u2014 Volume / Quantity Breaks styles */
2126
+ `,Nr=`/* Lime Bundles \u2014 Volume / Quantity Breaks styles */
2104
2127
 
2105
2128
  .lb-volume__tiers {
2106
2129
  display: flex;
@@ -2283,7 +2306,7 @@ a.lb-bundle-product-name:focus-visible {
2283
2306
  opacity: 0.5;
2284
2307
  cursor: not-allowed;
2285
2308
  }
2286
- `,Pr=`/* Lime Bundles \u2014 BOGO (Buy X Get Y) bundle styles */
2309
+ `,Hr=`/* Lime Bundles \u2014 BOGO (Buy X Get Y) bundle styles */
2287
2310
 
2288
2311
  .lb-bogo__products {
2289
2312
  display: flex;
@@ -2307,12 +2330,12 @@ a.lb-bundle-product-name:focus-visible {
2307
2330
  .lb-bogo .lb-bundle-thumbnail {
2308
2331
  width: 60px;
2309
2332
  min-width: 60px;
2310
- border-radius: var(--lb-radius-sm);
2333
+ border-radius: var(--lb-radius);
2311
2334
  box-sizing: border-box;
2312
2335
  }
2313
2336
 
2314
2337
  .lb-bogo .lb-bundle-thumbnail img {
2315
- border-radius: var(--lb-radius-sm);
2338
+ border-radius: var(--lb-radius);
2316
2339
  border: none;
2317
2340
  }
2318
2341
 
@@ -2356,7 +2379,7 @@ a.lb-bundle-product-name:focus-visible {
2356
2379
  text-decoration: line-through;
2357
2380
  opacity: 0.6;
2358
2381
  }
2359
- `,Br=`/**
2382
+ `,Dr=`/**
2360
2383
  * Lime Bundles \u2014 Multi-step bundle widget styles (wizard chrome ONLY).
2361
2384
  *
2362
2385
  * The multi-step widget reuses the mix & match classes wholesale \u2014
@@ -2432,6 +2455,13 @@ a.lb-bundle-product-name:focus-visible {
2432
2455
  cursor: pointer;
2433
2456
  box-sizing: border-box;
2434
2457
  transition: background-color 0.25s ease;
2458
+ /* Deliberately no border-radius. This row paints the checklist hairline as
2459
+ its own border-top (see the run rule above), and a radius tapers that
2460
+ border into the corner arcs \u2014 the dividers came out visibly curved at the
2461
+ "round" preset (issue #363). A full-bleed list row is meant to be square
2462
+ anyway; the hover tint below spans the card width, so it has no corner to
2463
+ round against. The :focus-visible radius is fine: an outline is a
2464
+ separate paint and never touches the border. */
2435
2465
  }
2436
2466
 
2437
2467
  .lb-multi-step__step-row:hover {
@@ -2579,7 +2609,7 @@ a.lb-bundle-product-name:focus-visible {
2579
2609
  padding: 10px 24px;
2580
2610
  background: none;
2581
2611
  border: var(--lb-picker-border-width) solid var(--lb-picker-border-color);
2582
- border-radius: var(--lb-picker-radius-sm);
2612
+ border-radius: var(--lb-picker-radius);
2583
2613
  box-sizing: border-box;
2584
2614
  color: var(--lb-picker-text);
2585
2615
  font-family: inherit;
@@ -2597,7 +2627,109 @@ a.lb-bundle-product-name:focus-visible {
2597
2627
  outline: 2px solid var(--lb-primary-color);
2598
2628
  outline-offset: 2px;
2599
2629
  }
2600
- `,qr=`/**
2630
+
2631
+ /* \u2500\u2500 Step-change transition \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
2632
+ Moving between steps swaps the whole step-scoped region in a single
2633
+ paint, which reads as nothing happening (or as a glitch) rather than
2634
+ as arriving somewhere new \u2014 and worst of all under auto-advance,
2635
+ where the shopper never clicked anything. So the step assembles
2636
+ instead of arriving whole: the step label leads, the filter pills
2637
+ follow, then the product cards one after another. Staging is what
2638
+ makes the change legible; a uniform slide of everything at once only
2639
+ wobbles the card.
2640
+
2641
+ The wizard stamps data-step-transition="forward" | "back" on the
2642
+ dialog on every step change (manual Next/Back and auto-advance
2643
+ alike, never on open, where the modal entrance already carries the
2644
+ motion), and clears it again once the cascade has played \u2014 see
2645
+ STEP_CASCADE_MS in multi-step/wizard.ts. That clear is load-bearing,
2646
+ not tidiness: search and filter hide cards with .lb-hidden
2647
+ (display: none), and restoring display restarts a card's animation,
2648
+ so a live attribute would replay the whole cascade on every
2649
+ keystroke that reveals a card.
2650
+
2651
+ Two elements deliberately hold still. The footer, because Back/Next
2652
+ are the shopper's anchor while everything above them moves. And the
2653
+ progress rail, because it is the one thing that answers "where am I
2654
+ now" \u2014 animating the shopper's only orientation cue is what made the
2655
+ previous version hard to read. Its segment fill carries its own
2656
+ state change already. */
2657
+ @keyframes lb-multi-step-cascade-fwd {
2658
+ from {
2659
+ opacity: 0;
2660
+ transform: translateY(10px);
2661
+ }
2662
+ }
2663
+
2664
+ @keyframes lb-multi-step-cascade-back {
2665
+ from {
2666
+ opacity: 0;
2667
+ transform: translateY(-10px);
2668
+ }
2669
+ }
2670
+
2671
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__modal-subtitle {
2672
+ animation: lb-multi-step-cascade-fwd 0.2s ease-out both;
2673
+ }
2674
+
2675
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__filters {
2676
+ animation: lb-multi-step-cascade-fwd 0.2s ease-out 0.05s both;
2677
+ }
2678
+
2679
+ /* Cards stagger 30ms apart, but only the first four: a step can hold
2680
+ dozens of products and the two-column grid shows about four at a
2681
+ time, so past that the stagger is below the fold and would only add
2682
+ lag. Everything from the fifth on shares the fourth's landing. */
2683
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__modal-list > * {
2684
+ animation: lb-multi-step-cascade-fwd 0.22s ease-out 0.2s both;
2685
+ }
2686
+
2687
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__modal-list > :nth-child(1) {
2688
+ animation-delay: 0.09s;
2689
+ }
2690
+
2691
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__modal-list > :nth-child(2) {
2692
+ animation-delay: 0.12s;
2693
+ }
2694
+
2695
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__modal-list > :nth-child(3) {
2696
+ animation-delay: 0.15s;
2697
+ }
2698
+
2699
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__modal-list > :nth-child(4) {
2700
+ animation-delay: 0.18s;
2701
+ }
2702
+
2703
+ /* Going back runs the same cascade in the same order \u2014 only the offset
2704
+ flips, so the shopper still reads which way they moved. Overrides
2705
+ the name alone; the staggered delays above must survive. */
2706
+ .lb-mix-match__modal[data-step-transition="back"] .lb-mix-match__modal-subtitle,
2707
+ .lb-mix-match__modal[data-step-transition="back"] .lb-mix-match__filters,
2708
+ .lb-mix-match__modal[data-step-transition="back"] .lb-mix-match__modal-list > * {
2709
+ animation-name: lb-multi-step-cascade-back;
2710
+ }
2711
+
2712
+ @keyframes lb-multi-step-cascade-fade {
2713
+ from {
2714
+ opacity: 0;
2715
+ }
2716
+ }
2717
+
2718
+ /* Reduced motion keeps the fade and drops the travel and the stagger:
2719
+ the step change still has to be perceptible, which is the whole
2720
+ point of this block. The card selector is :nth-child(n) rather than
2721
+ * on purpose \u2014 a plain * loses to the :nth-child(1..4) delays above
2722
+ on specificity, which would leave the stagger running with nothing
2723
+ moving. :nth-child(n) matches every child at equal specificity and
2724
+ wins on order. */
2725
+ @media (prefers-reduced-motion: reduce) {
2726
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__modal-subtitle,
2727
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__filters,
2728
+ .lb-mix-match__modal[data-step-transition] .lb-mix-match__modal-list > :nth-child(n) {
2729
+ animation: lb-multi-step-cascade-fade 0.15s ease-out both;
2730
+ }
2731
+ }
2732
+ `,Or=`/**
2601
2733
  * Lime Bundles \u2014 Custom variant-picker dropdown styling.
2602
2734
  *
2603
2735
  * Reuses existing CSS variables: no new merchant-configurable surface.
@@ -2643,7 +2775,7 @@ a.lb-bundle-product-name:focus-visible {
2643
2775
  gap: 8px;
2644
2776
  width: 100%;
2645
2777
  border: var(--lb-border-width) solid var(--lb-border);
2646
- border-radius: var(--lb-radius-sm);
2778
+ border-radius: var(--lb-radius);
2647
2779
  padding: 8px 12px;
2648
2780
  font-size: 12px;
2649
2781
  line-height: 16px;
@@ -2706,7 +2838,7 @@ a.lb-bundle-product-name:focus-visible {
2706
2838
  background: var(--lb-bg);
2707
2839
  color: var(--lb-text);
2708
2840
  border: var(--lb-border-width) solid var(--lb-border);
2709
- border-radius: var(--lb-radius-sm);
2841
+ border-radius: var(--lb-radius);
2710
2842
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
2711
2843
  overflow-y: auto;
2712
2844
  overflow-x: hidden;
@@ -2767,6 +2899,10 @@ a.lb-bundle-product-name:focus-visible {
2767
2899
  overflow: hidden;
2768
2900
  text-overflow: ellipsis;
2769
2901
  color: var(--lb-text);
2902
+ /* The active/hover tint below fills the option, so it rounds with the rest
2903
+ of the widget rather than squaring off against the listbox corner it sits
2904
+ in (issue #363). */
2905
+ border-radius: var(--lb-radius-sm);
2770
2906
  }
2771
2907
 
2772
2908
  .lb-dropdown-option[aria-selected="true"] {
@@ -2825,7 +2961,7 @@ a.lb-bundle-product-name:focus-visible {
2825
2961
  .lb-mix-match__modal .lb-dropdown-trigger {
2826
2962
  border-color: var(--lb-picker-border-color);
2827
2963
  border-width: var(--lb-picker-border-width);
2828
- border-radius: var(--lb-picker-radius-sm);
2964
+ border-radius: var(--lb-picker-radius);
2829
2965
  background: var(--lb-picker-bg);
2830
2966
  color: var(--lb-picker-text);
2831
2967
  /* Match the picker qty stepper + Add button height (border-box so 32px is
@@ -2846,13 +2982,17 @@ a.lb-bundle-product-name:focus-visible {
2846
2982
  [data-modal-overlay] > .lb-dropdown-listbox {
2847
2983
  border-color: var(--lb-picker-border-color);
2848
2984
  border-width: var(--lb-picker-border-width);
2849
- border-radius: var(--lb-picker-radius-sm);
2985
+ border-radius: var(--lb-picker-radius);
2850
2986
  background: var(--lb-picker-bg);
2851
2987
  color: var(--lb-picker-text);
2852
2988
  scrollbar-color: color-mix(in srgb, var(--lb-picker-text) 15%, transparent)
2853
2989
  color-mix(in srgb, var(--lb-picker-text) 2%, transparent);
2854
2990
  }
2855
2991
 
2992
+ [data-modal-overlay] > .lb-dropdown-listbox .lb-dropdown-option {
2993
+ border-radius: var(--lb-picker-radius-sm);
2994
+ }
2995
+
2856
2996
  [data-modal-overlay] > .lb-dropdown-listbox::-webkit-scrollbar-track {
2857
2997
  background: color-mix(in srgb, var(--lb-picker-text) 2%, transparent);
2858
2998
  border-radius: 2px;
@@ -2860,7 +3000,7 @@ a.lb-bundle-product-name:focus-visible {
2860
3000
  [data-modal-overlay] > .lb-dropdown-listbox::-webkit-scrollbar-thumb {
2861
3001
  background: color-mix(in srgb, var(--lb-picker-text) 15%, transparent);
2862
3002
  }
2863
- `,Rr=`/* Lime Bundles \u2014 web-component loading skeleton (not mirrored to theme assets) */
3003
+ `,Fr=`/* Lime Bundles \u2014 web-component loading skeleton (not mirrored to theme assets) */
2864
3004
 
2865
3005
  .lb-bundle-widget--loading {
2866
3006
  display: block;
@@ -2956,10 +3096,10 @@ a.lb-bundle-product-name:focus-visible {
2956
3096
  animation: none;
2957
3097
  }
2958
3098
  }
2959
- `;var di=e=>`lb_cart_id:${e}`;function ci(e){if(e)return e.trim()||null;if(typeof document<"u"){let t=document.querySelector('meta[name="shopify:product-handle"]');if(t?.content)return t.content.trim()||null}if(typeof window<"u"){let t=window.location.pathname.match(/\/products\/([^/?#]+)/);if(t?.[1])return decodeURIComponent(t[1])}return null}var De=class extends HTMLElement{static observedAttributes=["shop-domain","storefront-token","bundle-gid","product-handle","product-id","app-url","analytics","locale","country","language","market-id"];buyer=void 0;shadow;bundles=[];currentProductHandle=null;abortController=null;impressionCleanups=[];renderCleanups=[];shopCustomCss=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.fetchBundle()}disconnectedCallback(){this.abortController?.abort(),this.teardownImpressions(),this.teardownRenderers()}teardownImpressions(){for(let t of this.impressionCleanups)t();this.impressionCleanups=[]}teardownRenderers(){for(let t of this.renderCleanups)t();this.renderCleanups=[]}attributeChangedCallback(t,n,r){n===r||!this.isConnected||(t==="bundle-gid"||t==="product-handle"||t==="product-id"||t==="shop-domain"||t==="storefront-token")&&this.shopDomain&&this.storefrontToken&&this.fetchBundle()}get shopDomain(){return this.getAttribute("shop-domain")??""}get storefrontToken(){return this.getAttribute("storefront-token")??""}get bundleGid(){return this.getAttribute("bundle-gid")??""}get productHandleAttr(){return this.getAttribute("product-handle")??""}get productIdAttr(){return this.getAttribute("product-id")??""}get appUrl(){return this.getAttribute("app-url")??""}get analyticsEnabled(){return this.getAttribute("analytics")!=="false"}get country(){return this.getAttribute("country")??void 0}get language(){return this.getAttribute("language")??void 0}get marketId(){return this.getAttribute("market-id")??void 0}wrapQueryForContext(t){return Xt({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer})?Zt(t):t}isMarketHidden(t){return!pn(t,this.marketId)}async fetchBundle(){if(!this.shopDomain||!this.storefrontToken){this.renderError("Missing required attributes: shop-domain, storefront-token");return}this.abortController?.abort();let t=new AbortController;this.abortController=t,this.renderLoading();let n=yt({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer});try{let r,o=!1;if(this.currentProductHandle=ci(this.productHandleAttr),this.bundleGid)o=!0,r=this.fetchSingleBundle(n,t.signal);else{let d=this.currentProductHandle;if(!d){this.teardownImpressions(),this.renderError("No bundle-gid or product-handle provided, and the current URL doesn't match /products/<handle>.");return}r=this.fetchProductBundles(n,t.signal,d)}let i=n.query(tn,void 0,{signal:t.signal}).catch(()=>null);if(await r,t.signal.aborted)return;if(o&&this.bundles.length===0){this.teardownImpressions(),this.renderError("Bundle not found");return}let l=(await i)?.shop?.customCss?.value;if(l){vn(this.shopDomain,l);let d=Ct(l);d.ok&&(this.shopCustomCss=d.css)}this.renderBundles()}catch(r){if(t.signal.aborted)return;this.bundles=[],this.teardownImpressions(),this.renderError(r instanceof Error?r.message:"Failed to load bundle")}}async fetchSingleBundle(t,n){let r=await t.query(this.wrapQueryForContext(en),{id:this.bundleGid},{signal:n});if(!r.metaobject){this.bundles=[];return}let o=wt(r.metaobject.id,r.metaobject.fields);this.bundles=o&&!this.isMarketHidden(o)?[o]:[]}async fetchProductBundles(t,n,r){let o=await t.query(this.wrapQueryForContext(nn),{handle:r},{signal:n});if(!o.product){this.bundles=[];return}let i=o.product.metafield?.references?.nodes??[],a=[];for(let l of i){let d=wt(l.id,l.fields);d&&!this.isMarketHidden(d)&&a.push(d)}this.bundles=Cn(a,_n())}handleAddToCart=async(t,n)=>{let r=new CustomEvent("lime-bundle:add-to-cart",{detail:{lines:n},bubbles:!0,composed:!0,cancelable:!0}),o=this.dispatchEvent(r);this.reportAddToCartEvent(t,n),o&&await this.defaultAddToCart(n)};async defaultAddToCart(t){if(typeof window>"u")return;let n=yt({shopDomain:this.shopDomain,accessToken:this.storefrontToken}),r=window.localStorage,o=di(this.shopDomain),i=r?.getItem(o)??null,a=s=>s.length>0&&s.every(u=>(u.field??[]).includes("cartId")),l=s=>(s??[]).some(u=>u.code==="MERCHANDISE_NOT_ENOUGH_STOCK"),d=s=>{this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:s,code:"CART_ERROR"},bubbles:!0,composed:!0}))};try{let s=null;if(i&&(i=await this.clearAbandonedBundleLines(n,i,()=>r?.removeItem(o))),i){let c=(await n.query(on,{cartId:i,lines:t})).cartLinesAdd;if(c?.userErrors?.length){if(!a(c.userErrors)){d(c.userErrors[0].message);return}r?.removeItem(o)}else if(l(c?.warnings)){d("Some items in this bundle are out of stock.");return}else c?.cart&&(s=c.cart.checkoutUrl)}if(!s){let c=(await n.query(rn,{input:{lines:t}})).cartCreate;if(c?.userErrors?.length){d(c.userErrors[0].message);return}if(l(c?.warnings)){d("Some items in this bundle are out of stock.");return}c?.cart&&(r?.setItem(o,c.cart.id),s=c.cart.checkoutUrl)}s?window.location.assign(s):d("Cart creation failed")}catch(s){this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:s instanceof Error?s.message:"Cart mutation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}}async clearAbandonedBundleLines(t,n,r){let o=await t.query(an,{cartId:n});if(!o.cart)return r(),null;let i=o.cart.lines.nodes.filter(l=>l.attributes.some(d=>d.key===kt)).map(l=>l.id);return i.length===0?n:(await t.query(ln,{cartId:n,lineIds:i})).cartLinesRemove?.userErrors?.length?(r(),null):n}reportAddToCartEvent(t,n){if(!this.analyticsEnabled||!this.appUrl)return;let r=n.reduce((i,a)=>i+a.quantity,0),o=n.reduce((i,a)=>{let d=t.products.find(u=>u.variants.nodes.some(c=>c.id===a.merchandiseId))?.variants.nodes.find(u=>u.id===a.merchandiseId),s=d?parseFloat(d.price.amount):0;return i+s*a.quantity},0);fn({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType,productId:t.products[0]?.id??"",quantity:r,totalPrice:Math.round(o*100)/100})}renderBundles(){this.teardownImpressions(),this.teardownRenderers(),this.shadow.innerHTML="";let t=document.createElement("style");if(t.textContent=[Dt,Ar,Lr,Br,Mr,Pr,qr].join(`
2960
- `),this.shadow.appendChild(t),this.shopCustomCss){let r=document.createElement("style");r.setAttribute("data-lime-bundles","shop-custom-css"),r.textContent=this.shopCustomCss,this.shadow.appendChild(r)}for(let r of this.bundles){let o=document.createElement("div");o.className="lb-bundle-widget",o.setAttribute("role","region"),o.setAttribute("aria-label",r.title),o.setAttribute("data-bundle-type",r.bundleType),o.setAttribute("data-bundle-gid",r.id),r.endsAt&&o.setAttribute("data-ends-at",r.endsAt),sn(o,r.widgetConfig),this.renderCleanups.push(ft(o));let i=l=>this.handleAddToCart(r,l),a=l=>this.renderCleanups.push(l);switch(r.bundleType){case"fixed":On(o,r,i,a);break;case"mix_match":rr(o,r,i,a,this.currentProductHandle);break;case"volume":cr(o,r,i,{productId:this.productIdAttr||null,productHandle:this.currentProductHandle});break;case"bogo":pr(o,r,i,a);break;case"multi_step":Tr(o,r,i,a);break}this.shadow.appendChild(o),this.setupImpressionFor(r,o)}let n=this.bundles[0];this.dispatchEvent(new CustomEvent("lime-bundle:loaded",{detail:{bundleCount:this.bundles.length,bundleTypes:this.bundles.map(r=>r.bundleType),bundleType:n?.bundleType,title:n?.title},bubbles:!0,composed:!0}))}setupImpressionFor(t,n){if(!this.analyticsEnabled||!this.appUrl)return;let r=gn(n,()=>{hn({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType})});this.impressionCleanups.push(r)}renderLoading(){this.shadow.innerHTML=`
2961
- <style>${Dt}</style>
2962
- <style>${Rr}</style>
3099
+ `;var xi=e=>`lb_cart_id:${e}`;function vi(e){if(e)return e.trim()||null;if(typeof document<"u"){let t=document.querySelector('meta[name="shopify:product-handle"]');if(t?.content)return t.content.trim()||null}if(typeof window<"u"){let t=window.location.pathname.match(/\/products\/([^/?#]+)/);if(t?.[1])return decodeURIComponent(t[1])}return null}var De=class extends HTMLElement{static observedAttributes=["shop-domain","storefront-token","bundle-gid","product-handle","product-id","app-url","analytics","locale","country","language","market-id","currency-rate"];buyer=void 0;shadow;bundles=[];currentProductHandle=null;abortController=null;impressionCleanups=[];renderCleanups=[];shopCustomCss=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.fetchBundle()}disconnectedCallback(){this.abortController?.abort(),this.teardownImpressions(),this.teardownRenderers()}teardownImpressions(){for(let t of this.impressionCleanups)t();this.impressionCleanups=[]}teardownRenderers(){for(let t of this.renderCleanups)t();this.renderCleanups=[]}attributeChangedCallback(t,n,r){n===r||!this.isConnected||(t==="bundle-gid"||t==="product-handle"||t==="product-id"||t==="shop-domain"||t==="storefront-token"||t==="currency-rate")&&this.shopDomain&&this.storefrontToken&&this.fetchBundle()}get shopDomain(){return this.getAttribute("shop-domain")??""}get storefrontToken(){return this.getAttribute("storefront-token")??""}get bundleGid(){return this.getAttribute("bundle-gid")??""}get productHandleAttr(){return this.getAttribute("product-handle")??""}get productIdAttr(){return this.getAttribute("product-id")??""}get appUrl(){return this.getAttribute("app-url")??""}get analyticsEnabled(){return this.getAttribute("analytics")!=="false"}get country(){return this.getAttribute("country")??void 0}get language(){return this.getAttribute("language")??void 0}get marketId(){return this.getAttribute("market-id")??void 0}get currencyRate(){return this.getAttribute("currency-rate")??void 0}wrapQueryForContext(t){return rn({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer})?on(t):t}resolvedBuyer=void 0;isMarketHidden(t){return!gn(t,{marketId:this.marketId,countryCode:this.country,companyLocationId:this.resolvedBuyer?.companyLocationId})}async fetchBundle(){if(!this.shopDomain||!this.storefrontToken){this.renderError("Missing required attributes: shop-domain, storefront-token");return}this.abortController?.abort();let t=new AbortController;this.abortController=t,this.renderLoading();try{this.resolvedBuyer=typeof this.buyer=="function"?await this.buyer():this.buyer}catch{this.resolvedBuyer=void 0}let n=Ct({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.resolvedBuyer});try{let r,o=!1;if(this.currentProductHandle=vi(this.productHandleAttr),this.bundleGid)o=!0,r=this.fetchSingleBundle(n,t.signal);else{let d=this.currentProductHandle;if(!d){this.teardownImpressions(),this.renderError("No bundle-gid or product-handle provided, and the current URL doesn't match /products/<handle>.");return}r=this.fetchProductBundles(n,t.signal,d)}let i=n.query(ln,void 0,{signal:t.signal}).catch(()=>null);if(await r,t.signal.aborted)return;if(o&&this.bundles.length===0){this.teardownImpressions(),this.renderError("Bundle not found");return}let l=(await i)?.shop?.customCss?.value;if(l){kn(this.shopDomain,l);let d=Et(l);d.ok&&(this.shopCustomCss=d.css)}this.renderBundles()}catch(r){if(t.signal.aborted)return;this.bundles=[],this.teardownImpressions(),this.renderError(r instanceof Error?r.message:"Failed to load bundle")}}async fetchSingleBundle(t,n){let r=await t.query(this.wrapQueryForContext(an),{id:this.bundleGid},{signal:n});if(!r.metaobject){this.bundles=[];return}let o=kt(r.metaobject.id,r.metaobject.fields);this.bundles=o&&!this.isMarketHidden(o)?[Tt(o,this.currencyRate)]:[]}async fetchProductBundles(t,n,r){let o=await t.query(this.wrapQueryForContext(sn),{handle:r},{signal:n});if(!o.product){this.bundles=[];return}let i=o.product.metafield?.references?.nodes??[],a=[];for(let l of i){let d=kt(l.id,l.fields);d&&!this.isMarketHidden(d)&&a.push(Tt(d,this.currencyRate))}this.bundles=In(a,En())}handleAddToCart=async(t,n)=>{let r=new CustomEvent("lime-bundle:add-to-cart",{detail:{lines:n},bubbles:!0,composed:!0,cancelable:!0}),o=this.dispatchEvent(r);this.reportAddToCartEvent(t,n),o&&await this.defaultAddToCart(n)};async defaultAddToCart(t){if(typeof window>"u")return;let n=Ct({shopDomain:this.shopDomain,accessToken:this.storefrontToken}),r=window.localStorage,o=xi(this.shopDomain),i=r?.getItem(o)??null,a=s=>s.length>0&&s.every(u=>(u.field??[]).includes("cartId")),l=s=>(s??[]).some(u=>u.code==="MERCHANDISE_NOT_ENOUGH_STOCK"),d=s=>{this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:s,code:"CART_ERROR"},bubbles:!0,composed:!0}))};try{let s=null;if(i&&(i=await this.clearAbandonedBundleLines(n,i,()=>r?.removeItem(o))),i){let c=(await n.query(cn,{cartId:i,lines:t})).cartLinesAdd;if(c?.userErrors?.length){if(!a(c.userErrors)){d(c.userErrors[0].message);return}r?.removeItem(o)}else if(l(c?.warnings)){d("Some items in this bundle are out of stock.");return}else c?.cart&&(s=c.cart.checkoutUrl)}if(!s){let c=(await n.query(dn,{input:{lines:t}})).cartCreate;if(c?.userErrors?.length){d(c.userErrors[0].message);return}if(l(c?.warnings)){d("Some items in this bundle are out of stock.");return}c?.cart&&(r?.setItem(o,c.cart.id),s=c.cart.checkoutUrl)}s?window.location.assign(s):d("Cart creation failed")}catch(s){this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:s instanceof Error?s.message:"Cart mutation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}}async clearAbandonedBundleLines(t,n,r){let o=await t.query(un,{cartId:n});if(!o.cart)return r(),null;let i=o.cart.lines.nodes.filter(l=>l.attributes.some(d=>d.key===It)).map(l=>l.id);return i.length===0?n:(await t.query(pn,{cartId:n,lineIds:i})).cartLinesRemove?.userErrors?.length?(r(),null):n}reportAddToCartEvent(t,n){if(!this.analyticsEnabled||!this.appUrl)return;let r=n.reduce((i,a)=>i+a.quantity,0),o=n.reduce((i,a)=>{let d=t.products.find(u=>u.variants.nodes.some(c=>c.id===a.merchandiseId))?.variants.nodes.find(u=>u.id===a.merchandiseId),s=d?parseFloat(d.price.amount):0;return i+s*a.quantity},0);wn({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType,productId:t.products[0]?.id??"",quantity:r,totalPrice:Math.round(o*100)/100})}renderBundles(){this.teardownImpressions(),this.teardownRenderers(),this.shadow.innerHTML="";let t=document.createElement("style");if(t.textContent=[Ut,qr,Rr,Dr,Nr,Hr,Or].join(`
3100
+ `),this.shadow.appendChild(t),this.shopCustomCss){let r=document.createElement("style");r.setAttribute("data-lime-bundles","shop-custom-css"),r.textContent=this.shopCustomCss,this.shadow.appendChild(r)}for(let r of this.bundles){let o=document.createElement("div");o.className="lb-bundle-widget",o.setAttribute("role","region"),o.setAttribute("aria-label",r.title),o.setAttribute("data-bundle-type",r.bundleType),o.setAttribute("data-bundle-gid",r.id),r.endsAt&&o.setAttribute("data-ends-at",r.endsAt),mn(o,r.widgetConfig),this.renderCleanups.push(gt(o));let i=l=>this.handleAddToCart(r,l),a=l=>this.renderCleanups.push(l);switch(r.bundleType){case"fixed":Qn(o,r,i,a);break;case"mix_match":sr(o,r,i,a,this.currentProductHandle);break;case"volume":hr(o,r,i,{productId:this.productIdAttr||null,productHandle:this.currentProductHandle});break;case"bogo":gr(o,r,i,a);break;case"multi_step":Lr(o,r,i,a);break}this.shadow.appendChild(o),this.setupImpressionFor(r,o)}let n=this.bundles[0];this.dispatchEvent(new CustomEvent("lime-bundle:loaded",{detail:{bundleCount:this.bundles.length,bundleTypes:this.bundles.map(r=>r.bundleType),bundleType:n?.bundleType,title:n?.title},bubbles:!0,composed:!0}))}setupImpressionFor(t,n){if(!this.analyticsEnabled||!this.appUrl)return;let r=_n(n,()=>{yn({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType})});this.impressionCleanups.push(r)}renderLoading(){this.shadow.innerHTML=`
3101
+ <style>${Ut}</style>
3102
+ <style>${Fr}</style>
2963
3103
  <div class="lb-bundle-widget lb-bundle-widget--loading" aria-busy="true" aria-label="Loading bundle">
2964
3104
  <div class="lb-skeleton lb-skeleton--title"></div>
2965
3105
  <div class="lb-skeleton--products">
@@ -2993,5 +3133,5 @@ a.lb-bundle-product-name:focus-visible {
2993
3133
  <div class="lb-skeleton lb-skeleton--cta"></div>
2994
3134
  </div>
2995
3135
  </div>
2996
- `}renderError(t){this.shadow.innerHTML="",this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:t,code:"LOAD_ERROR"},bubbles:!0,composed:!0}))}};typeof customElements<"u"&&!customElements.get("lime-bundle")&&customElements.define("lime-bundle",De);return Vr(ui);})();
3136
+ `}renderError(t){this.shadow.innerHTML="",this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:t,code:"LOAD_ERROR"},bubbles:!0,composed:!0}))}};typeof customElements<"u"&&!customElements.get("lime-bundle")&&customElements.define("lime-bundle",De);return jr(yi);})();
2997
3137
  //# sourceMappingURL=lime-bundle.global.js.map