@best-bundles/bundle-ui 0.0.32 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._button_18rtl_1{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--bb-font-family, inherit);border:1px solid var(--bb-button-border, rgba(0, 0, 0, .12));background:var(--bb-button-bg, #111827);color:var(--bb-button-text, #ffffff);font:inherit;line-height:1;padding:10px 14px;border-radius:var(--bb-button-radius, 10px);cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease,opacity .12s ease}._button_18rtl_1:hover{background:var(--bb-button-bg-hover, #0b1220)}._button_18rtl_1:active{transform:translateY(1px)}._button_18rtl_1:disabled{opacity:.6;cursor:not-allowed}._button_18rtl_1:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._backdrop_jhu8z_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 2147483647);display:flex;justify-content:flex-end;background:var(--bb-backdrop-bg, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(var(--bb-backdrop-blur, 2px));backdrop-filter:blur(var(--bb-backdrop-blur, 2px));padding:var(--bb-backdrop-padding, 12px);opacity:0;transition:opacity var(--bb-drawer-transition-duration, .22s) ease}._celebrationOverlay_jhu8z_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_jhu8z_23{font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.03em;font-size:18px;line-height:1;padding:12px 16px;border-radius:999px;color:var(--bb-celebration-text, #0b1b44);background:linear-gradient(180deg,var(--bb-celebration-bg-top, #ffffff),var(--bb-celebration-bg-bottom, #bae6fd));border:2px solid var(--bb-celebration-border, rgba(37, 99, 235, .28));box-shadow:0 18px 55px #0006,0 10px 28px #2563eb33,inset 0 1px #ffffffbf;transform-origin:50% 60%;will-change:transform,opacity,filter;animation:_bbCelebrationPop_jhu8z_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_jhu8z_1{0%{opacity:0;transform:translateY(10px) scale(.6);filter:blur(1px) saturate(1.1)}12%{opacity:1;transform:translateY(0) scale(1.12);filter:blur(0px) saturate(1.1)}22%{opacity:1;transform:translateY(0) scale(1)}80%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-10px) scale(.98)}}._backdropOpen_jhu8z_74{opacity:1}._backdropClosed_jhu8z_78{opacity:0}._panel_jhu8z_82{width:440px;max-width:100%;height:100%;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);border-radius:var(--bb-panel-radius, 16px);box-shadow:0 20px 60px #00000059;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden;outline:none;position:relative;top:unset;right:unset;bottom:unset;left:unset}._panelOpen_jhu8z_102{animation:_bbSlideInFromRight_jhu8z_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_jhu8z_106{animation:_bbSlideOutToRight_jhu8z_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_jhu8z_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_jhu8z_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_jhu8z_1{transition:none}._celebrationChip_jhu8z_23,._panelOpen_jhu8z_102,._panelClosed_jhu8z_106{animation:none}}._header_jhu8z_145{display:grid;grid-template-columns:36px 1fr 36px;align-items:center;column-gap:12px;padding:var(--bb-header-padding, 16px 16px 12px 16px);border-bottom:1px solid var(--bb-border-color, rgba(17, 24, 39, .08))}._headerCenter_jhu8z_154{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_jhu8z_162{font-size:24px;margin:0;line-height:1.2;font-family:var(--bb-font-family-title, "Bebas Neue", "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.02em;color:var(--bb-title-color, var(--bb-text-color, #111827))}._searchIconButton_jhu8z_171{width:36px;height:36px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);cursor:pointer;display:inline-flex;align-items:center;justify-content:center}._searchIconButton_jhu8z_171:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_jhu8z_171:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_jhu8z_193{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_jhu8z_197{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;pointer-events:none;opacity:0;transform:translateY(-2px);transition:opacity .18s ease,transform .22s ease}._headerSearchOpen_jhu8z_209 ._headerTitleWrap_jhu8z_193{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_jhu8z_209 ._headerSearchWrap_jhu8z_197{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_jhu8z_221{width:min(320px,100%);height:36px;display:flex;align-items:center;gap:8px;background:var(--bb-surface-bg, #ffffff);border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));border-radius:10px;padding:0 8px}._searchInput_jhu8z_233{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_jhu8z_233::-webkit-search-cancel-button,._searchInput_jhu8z_233::-webkit-search-decoration,._searchInput_jhu8z_233::-webkit-search-results-button,._searchInput_jhu8z_233::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_jhu8z_254{border:none;background:transparent;color:var(--bb-text-color, #111827);font:inherit;font-size:13px;font-weight:700;cursor:pointer;padding:6px;border-radius:10px;line-height:1}._searchClearButton_jhu8z_254:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_jhu8z_254:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_jhu8z_276{border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);width:36px;height:36px;border-radius:10px;cursor:pointer;flex:0 0 auto}._closeButton_jhu8z_276:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_jhu8z_276:disabled{opacity:.6;cursor:not-allowed}._closeButton_jhu8z_276:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_jhu8z_193,._headerSearchWrap_jhu8z_197{transition:none}}._body_jhu8z_309{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_jhu8z_314{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_jhu8z_319{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_jhu8z_324{margin-top:4px}._variantList_jhu8z_328{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_jhu8z_336{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_jhu8z_344{opacity:.65}._variantLeft_jhu8z_348{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_jhu8z_355{height:100%;align-self:stretch;border-radius:12px;border:none;background:var(--bb-cta-bg, #91aae5);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:800;padding:0 16px;cursor:pointer;white-space:nowrap}._addToBundleButton_jhu8z_355:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_jhu8z_355:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_jhu8z_355:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_jhu8z_383{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._soldOut_jhu8z_383{align-self:center;text-align:center;color:var(--bb-muted-color, rgba(17, 24, 39));font-size:.9em;font-weight:600;pointer-events:none}._variantThumb_jhu8z_400{width:60px;height:60px;border-radius:12px;overflow:hidden;border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));flex:0 0 auto}._variantThumbImg_jhu8z_410{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_jhu8z_417{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_jhu8z_427{min-width:0}._variantName_jhu8z_431{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_jhu8z_440{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_jhu8z_448{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_jhu8z_455{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_jhu8z_448{font-size:13px;font-weight:800}._qtyControls_jhu8z_466{display:inline-flex;align-items:center;gap:6px}._qtyButton_jhu8z_472{width:34px;height:34px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);cursor:pointer;line-height:1;font-size:16px}._qtyButton_jhu8z_472:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_jhu8z_472:disabled{opacity:.6;cursor:not-allowed}._qtyButton_jhu8z_472:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_jhu8z_497{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_jhu8z_504{padding:var(--bb-footer-padding, 12px 16px 16px 16px);border-top:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);position:relative}._poweredBy_jhu8z_511{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_jhu8z_511 a{color:inherit;text-decoration:none}._boxSummaryWindow_jhu8z_523{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_jhu8z_523::-webkit-scrollbar{display:none}._boxSummaryRow_jhu8z_540{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_jhu8z_548{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_jhu8z_557{width:100%;aspect-ratio:1 / 1;border-radius:12px;position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;box-sizing:border-box}._boxItemClickable_jhu8z_569{cursor:pointer}._boxItemClickable_jhu8z_569:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_jhu8z_578{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_jhu8z_589{border:1px dashed var(--bb-border-strong-color, rgba(17, 24, 39, .18));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));color:var(--bb-muted-color, rgba(17, 24, 39, .6))}._boxItemFilled_jhu8z_595{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_jhu8z_601{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:var(--bb-tier-bg, rgba(37, 99, 235, .08));color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemDiscountText_jhu8z_609{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_jhu8z_617{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_jhu8z_624{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_jhu8z_631{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .04));color:var(--bb-text-color, #111827);font-weight:800}._ctaButtonGroup_jhu8z_642{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_jhu8z_649{gap:0}._cta_jhu8z_642{width:100%;border:1px solid var(--bb-cta-border, rgba(0, 0, 0, .12));background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:700;padding:12px 14px;border-radius:12px;cursor:pointer}._ctaSecondary_jhu8z_665{width:100%;border:2px solid var(--bb-cta-bg, #2563eb);background:transparent;color:var(--bb-cta-bg, #2563eb);font:inherit;font-weight:700;padding:10px 14px;border-radius:12px;cursor:pointer}._ctaDualLeft_jhu8z_677{width:100%;border:2px solid var(--bb-cta-bg, #2563eb);background:transparent;color:var(--bb-cta-bg, #2563eb);font:inherit;font-weight:700;padding:10px 14px;border-radius:12px;cursor:pointer;transition:border-radius .3s cubic-bezier(.4,0,.2,1),background .3s cubic-bezier(.4,0,.2,1),color .3s cubic-bezier(.4,0,.2,1),border-right-width .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}._ctaDualLeftAnimating_jhu8z_695{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0;background:var(--bb-cta-bg, #2563eb);opacity:.6;color:var(--bb-cta-text, #ffffff)}._ctaDualLeftAnimating_jhu8z_695>span{opacity:0}._ctaDualRight_jhu8z_708{width:100%;border:1px solid var(--bb-cta-border, rgba(0, 0, 0, .12));background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:700;padding:12px 14px;border-radius:12px;cursor:pointer;transition:border-radius .3s cubic-bezier(.4,0,.2,1),border-left-width .3s cubic-bezier(.4,0,.2,1),opacity .3s cubic-bezier(.4,0,.2,1)}._ctaDualRightAnimating_jhu8z_724{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_jhu8z_724>span{opacity:0}._ctaTotals_jhu8z_735{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_jhu8z_743{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:linear-gradient(180deg,#2563eb24,#2563eb0f);border:1px solid rgba(37,99,235,.3);color:#1d4ed8f2;white-space:nowrap}._ctaTotalsWrap_jhu8z_757{overflow:hidden;max-height:0;opacity:0;transform:translateY(4px);margin-bottom:0;transition:max-height .22s ease,opacity .16s ease,transform .22s ease,margin-bottom .22s ease}._ctaTotalsWrapVisible_jhu8z_770{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_jhu8z_777{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_jhu8z_784{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_jhu8z_757{transition:none}}._cta_jhu8z_642:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_jhu8z_642:disabled{opacity:.6;cursor:not-allowed}._cta_jhu8z_642:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_jhu8z_665:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_jhu8z_665:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_jhu8z_665:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_jhu8z_677:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_jhu8z_677:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_jhu8z_677:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_jhu8z_708:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_jhu8z_708:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_jhu8z_708:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_jhu8z_853{margin-top:8px;font-size:12px;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center}@media(max-width:767px){._backdrop_jhu8z_1{padding:0;justify-content:stretch}._panel_jhu8z_82{width:100%;height:100%;border-radius:0}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  import { jsx as f, jsxs as z, Fragment as xt } from "react/jsx-runtime";
3
- import Ee, { useState as j, useRef as q, useEffect as M, useCallback as he, useMemo as O, createContext as Ct, useContext as St, forwardRef as bt, createElement as Ye } from "react";
4
- const Re = {
3
+ import De, { useState as A, useRef as W, useEffect as j, useCallback as fe, useMemo as P, createContext as Ct, useContext as It, forwardRef as bt, createElement as Ye } from "react";
4
+ const Me = {
5
5
  bundleId: "_bundle_id",
6
6
  bundleConfig: "_bundle_config",
7
7
  bundleSource: "_bundle_source",
8
8
  bundleTitle: "_bundle_title"
9
9
  };
10
- async function It(i) {
11
- const e = new URL("/api/public/bundle-config", i.apiBaseUrl);
12
- e.searchParams.set("shop", i.shop);
13
- const o = await (await fetch(e, {
10
+ async function St(o) {
11
+ const e = new URL("/api/public/bundle-config", o.apiBaseUrl);
12
+ e.searchParams.set("shop", o.shop);
13
+ const i = await (await fetch(e, {
14
14
  method: "GET",
15
- signal: i.signal,
15
+ signal: o.signal,
16
16
  headers: { "Content-Type": "application/json" }
17
17
  })).json().catch(() => null);
18
- return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
18
+ return !i || typeof i != "object" ? { ok: !1, error: "Invalid response." } : i;
19
19
  }
20
20
  const st = "bb_anonymous_user_id";
21
- function Ne() {
21
+ function Te() {
22
22
  if (typeof window > "u" || typeof localStorage > "u")
23
23
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
24
24
  try {
25
- const i = localStorage.getItem(st);
26
- if (i && typeof i == "string" && i.length > 0)
27
- return i;
25
+ const o = localStorage.getItem(st);
26
+ if (o && typeof o == "string" && o.length > 0)
27
+ return o;
28
28
  let e;
29
29
  try {
30
30
  const t = globalThis.crypto;
@@ -40,12 +40,12 @@ function Ne() {
40
40
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
41
41
  }
42
42
  }
43
- async function xe(i, e, t) {
43
+ async function Ce(o, e, t) {
44
44
  if (!(typeof window > "u"))
45
45
  try {
46
- const o = new URL(i, window.location.origin);
47
- o.searchParams.set("shop", e);
48
- const r = await fetch(o, {
46
+ const i = new URL(o, window.location.origin);
47
+ i.searchParams.set("shop", e);
48
+ const r = await fetch(i, {
49
49
  method: "POST",
50
50
  headers: {
51
51
  "Content-Type": "application/json"
@@ -58,8 +58,8 @@ async function xe(i, e, t) {
58
58
  `[Bundle Analytics] Event tracking failed with status ${r.status}:`,
59
59
  await r.text().catch(() => "Unable to read response")
60
60
  );
61
- } catch (o) {
62
- console.warn("[Bundle Analytics] Failed to track event:", o);
61
+ } catch (i) {
62
+ console.warn("[Bundle Analytics] Failed to track event:", i);
63
63
  }
64
64
  }
65
65
  const _t = Ct(null), ct = "#best-bundles", Bt = {
@@ -84,551 +84,583 @@ const _t = Ct(null), ct = "#best-bundles", Bt = {
84
84
  celebrationBorderColor: "--bb-celebration-border",
85
85
  fontFamilyBody: "--bb-font-family-body",
86
86
  fontFamilyTitle: "--bb-font-family-title"
87
- }, We = "bb-google-fonts";
88
- function lt(i) {
89
- const e = (i ?? "").trim().replace(/^["']|["']$/g, "");
87
+ }, Ue = "bb-google-fonts";
88
+ function lt(o) {
89
+ const e = (o ?? "").trim().replace(/^["']|["']$/g, "");
90
90
  return e ? encodeURIComponent(e).replace(/%20/g, "+") : "";
91
91
  }
92
- function Tt(i) {
92
+ function Nt(o) {
93
93
  var c;
94
94
  if (typeof document > "u" || !document.head) return;
95
- if (!i) {
96
- (c = document.getElementById(We)) == null || c.remove();
95
+ if (!o) {
96
+ (c = document.getElementById(Ue)) == null || c.remove();
97
97
  return;
98
98
  }
99
- const e = (i.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (i.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), o = [];
100
- e && o.push("family=" + lt(e)), t && t !== e && o.push("family=" + lt(t));
101
- const r = document.getElementById(We);
102
- if (o.length === 0) {
99
+ const e = (o.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (o.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), i = [];
100
+ e && i.push("family=" + lt(e)), t && t !== e && i.push("family=" + lt(t));
101
+ const r = document.getElementById(Ue);
102
+ if (i.length === 0) {
103
103
  r == null || r.remove();
104
104
  return;
105
105
  }
106
- const n = `https://fonts.googleapis.com/css2?${o.join("&")}&display=swap`;
106
+ const n = `https://fonts.googleapis.com/css2?${i.join("&")}&display=swap`;
107
107
  if (r) {
108
108
  r.getAttribute("href") !== n && r.setAttribute("href", n);
109
109
  return;
110
110
  }
111
111
  const u = document.createElement("link");
112
- u.id = We, u.rel = "stylesheet", u.href = n, document.head.appendChild(u);
112
+ u.id = Ue, u.rel = "stylesheet", u.href = n, document.head.appendChild(u);
113
113
  }
114
- function ut(i) {
115
- if (!i) return;
116
- Tt(i);
114
+ function ut(o) {
115
+ if (!o) return;
116
+ Nt(o);
117
117
  const e = document.documentElement;
118
- Object.entries(Bt).forEach(([t, o]) => {
119
- let r = i[t];
120
- r && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(r) && !/^["']/.test(r.trim()) && (r = `"${r.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(o, r));
118
+ Object.entries(Bt).forEach(([t, i]) => {
119
+ let r = o[t];
120
+ r && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(r) && !/^["']/.test(r.trim()) && (r = `"${r.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(i, r));
121
121
  });
122
122
  }
123
- function dt(i) {
124
- if (typeof window > "u") return i;
123
+ function dt(o) {
124
+ if (typeof window > "u") return o;
125
125
  const e = window.__BUNDLE_PREVIEW_STYLES__;
126
- return e && typeof e == "object" ? e : i;
126
+ return e && typeof e == "object" ? e : o;
127
127
  }
128
- function Nt() {
128
+ function Tt() {
129
129
  try {
130
- const i = globalThis.crypto;
131
- if (i != null && i.randomUUID) return i.randomUUID();
130
+ const o = globalThis.crypto;
131
+ if (o != null && o.randomUUID) return o.randomUUID();
132
132
  } catch {
133
133
  }
134
134
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
135
135
  }
136
- function ht(i) {
137
- return Number.isFinite(i) ? Math.max(0, Math.floor(i)) : 0;
136
+ function ht(o) {
137
+ return Number.isFinite(o) ? Math.max(0, Math.floor(o)) : 0;
138
138
  }
139
- function pr(i) {
139
+ function pr(o) {
140
140
  const {
141
141
  apiBaseUrl: e,
142
142
  shop: t,
143
- cartAdapter: o,
143
+ cartAdapter: i,
144
144
  configHandle: r = "default",
145
145
  initialData: n,
146
146
  configFetcher: u,
147
147
  analyticsEndpoint: c,
148
- allowDrawerWhenInactive: p = !1,
149
- children: W
150
- } = i, v = c ?? `${e}/api/public/bundle-analytics`, [P, I] = j(!1), [Y, H] = j(!n), [V, K] = j(!1), [k, A] = j(null), [D, Ce] = j((n == null ? void 0 : n.currencyCode) ?? null), [m, Se] = j((n == null ? void 0 : n.config) ?? null), [te, ae] = j(
148
+ allowDrawerWhenInactive: b = !1,
149
+ children: Q
150
+ } = o, x = c ?? `${e}/api/public/bundle-analytics`, [M, B] = A(!1), [Z, L] = A(!n), [Y, J] = A(!1), [k, F] = A(null), [V, Ie] = A((n == null ? void 0 : n.currencyCode) ?? null), [m, pe] = A((n == null ? void 0 : n.config) ?? null), [ie, H] = A(
151
151
  (n == null ? void 0 : n.eligibleVariants) ?? []
152
- ), [ke, ze] = j(
152
+ ), [Pe, ke] = A(
153
153
  () => ({ selections: {}, order: [] })
154
- ), je = q(null);
155
- M(() => {
156
- var F;
154
+ ), ze = W(null);
155
+ j(() => {
156
+ var E;
157
157
  if (n) return;
158
- (F = je.current) == null || F.abort();
158
+ (E = ze.current) == null || E.abort();
159
159
  const d = new AbortController();
160
- je.current = d;
161
- const C = u ?? It;
162
- return H(!0), A(null), C({ apiBaseUrl: e, shop: t, signal: d.signal }).then((g) => {
163
- if (!g.ok) {
164
- A(g.error || "Failed to load bundle config."), Se(null), ae([]), Ce(null);
160
+ ze.current = d;
161
+ const g = u ?? St;
162
+ return L(!0), F(null), g({ apiBaseUrl: e, shop: t, signal: d.signal }).then((p) => {
163
+ if (!p.ok) {
164
+ F(p.error || "Failed to load bundle config."), pe(null), H([]), Ie(null);
165
165
  return;
166
166
  }
167
- Ce(g.currencyCode ?? null), Se(g.config), ae(g.eligibleVariants ?? []);
168
- }).catch((g) => {
169
- const oe = g instanceof Error ? g.message : "Failed to load bundle config.";
170
- A(oe), Se(null), ae([]), Ce(null);
171
- }).finally(() => H(!1)), () => d.abort();
172
- }, [e, t, n, u]), M(() => {
167
+ Ie(p.currencyCode ?? null);
168
+ const R = typeof window < "u" ? window : null, T = R == null ? void 0 : R.__BUNDLE_PREVIEW_CONFIG__;
169
+ if (T) {
170
+ pe(T);
171
+ const q = R.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__;
172
+ if (q !== void 0)
173
+ H(q);
174
+ else {
175
+ const I = new Set(T.eligibleVariantIds ?? []);
176
+ H(
177
+ I.size === 0 ? p.eligibleVariants ?? [] : (p.eligibleVariants ?? []).filter((D) => I.has(D.id))
178
+ );
179
+ }
180
+ L(R.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0);
181
+ } else
182
+ pe(p.config), H(p.eligibleVariants ?? []), L(!1);
183
+ }).catch((p) => {
184
+ const R = p instanceof Error ? p.message : "Failed to load bundle config.";
185
+ F(R), pe(null), H([]), Ie(null);
186
+ }).finally(() => {
187
+ const p = typeof window < "u" ? window : null;
188
+ p != null && p.__BUNDLE_PREVIEW_CONFIG__ || L(!1);
189
+ }), () => d.abort();
190
+ }, [e, t, n, u]), j(() => {
173
191
  const d = dt(m == null ? void 0 : m.styleSettings);
174
192
  d && ut(d);
175
- }, [m == null ? void 0 : m.styleSettings]), M(() => {
193
+ }, [m == null ? void 0 : m.styleSettings]), j(() => {
176
194
  if (typeof window > "u") return;
177
195
  const d = () => {
178
- const C = dt(void 0);
179
- C && ut(C);
196
+ const g = dt(void 0);
197
+ g && ut(g);
180
198
  };
181
199
  return window.addEventListener("bundle-preview-styles-updated", d), () => window.removeEventListener("bundle-preview-styles-updated", d);
200
+ }, []), j(() => {
201
+ if (typeof window > "u") return;
202
+ const d = window, g = () => {
203
+ const E = d.__BUNDLE_PREVIEW_CONFIG__;
204
+ if (!E) return;
205
+ const p = d.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0;
206
+ L(p), pe(E);
207
+ const R = d.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__;
208
+ R ? H(R) : p || H((T) => {
209
+ const q = new Set(E.eligibleVariantIds ?? []);
210
+ return q.size === 0 || T.length === 0 ? T : T.filter((I) => q.has(I.id));
211
+ });
212
+ };
213
+ return d.__BUNDLE_PREVIEW_CONFIG__ && g(), window.addEventListener("bundle-preview-config-updated", g), () => window.removeEventListener("bundle-preview-config-updated", g);
182
214
  }, []);
183
- const me = he(() => {
184
- if (!(!p && m != null && !m.isActive) && (I(!0), v))
215
+ const be = fe(() => {
216
+ if (!(!b && m != null && !m.isActive) && (B(!0), x))
185
217
  try {
186
- const d = Ne();
187
- xe(v, t, {
218
+ const d = Te();
219
+ Ce(x, t, {
188
220
  eventType: "DRAWER_OPENED",
189
221
  shop: t,
190
222
  anonymousUserId: d,
191
223
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
192
224
  mixpanelEvent: "bundle_opened"
193
- }).catch((C) => {
194
- console.warn("[Bundle Analytics] Failed to track drawer opened:", C);
225
+ }).catch((g) => {
226
+ console.warn("[Bundle Analytics] Failed to track drawer opened:", g);
195
227
  });
196
228
  } catch (d) {
197
229
  console.warn("[Bundle Analytics] Error in open() callback:", d);
198
230
  }
199
- }, [v, t, m, p]), Z = he(() => {
200
- if (v)
231
+ }, [x, t, m, b]), te = fe(() => {
232
+ if (x)
201
233
  try {
202
- const d = Ne();
203
- xe(v, t, {
234
+ const d = Te();
235
+ Ce(x, t, {
204
236
  eventType: "DRAWER_CLOSED",
205
237
  shop: t,
206
238
  anonymousUserId: d,
207
239
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
208
240
  mixpanelEvent: "bundle_closed"
209
- }).catch((C) => {
210
- console.warn("[Bundle Analytics] Failed to track drawer closed:", C);
241
+ }).catch((g) => {
242
+ console.warn("[Bundle Analytics] Failed to track drawer closed:", g);
211
243
  });
212
244
  } catch (d) {
213
245
  console.warn("[Bundle Analytics] Error in close() callback:", d);
214
246
  }
215
- I(!1), typeof window < "u" && window.location.hash === ct && window.history.replaceState(null, "", window.location.pathname + window.location.search);
216
- }, [v, t]);
217
- M(() => {
247
+ B(!1), typeof window < "u" && window.location.hash === ct && window.history.replaceState(null, "", window.location.pathname + window.location.search);
248
+ }, [x, t]);
249
+ j(() => {
218
250
  if (typeof window > "u") return;
219
251
  const d = () => {
220
- window.location.hash === ct && me();
252
+ window.location.hash === ct && be();
221
253
  };
222
254
  return d(), window.addEventListener("hashchange", d), () => window.removeEventListener("hashchange", d);
223
- }, [me]);
224
- const Pe = he(() => {
225
- !p && !P && m != null && !m.isActive || I((d) => {
255
+ }, [be]);
256
+ const Ae = fe(() => {
257
+ !b && !M && m != null && !m.isActive || B((d) => {
226
258
  if (d)
227
- Z();
228
- else if (v)
259
+ te();
260
+ else if (x)
229
261
  try {
230
- const C = Ne();
231
- xe(v, t, {
262
+ const g = Te();
263
+ Ce(x, t, {
232
264
  eventType: "DRAWER_OPENED",
233
265
  shop: t,
234
- anonymousUserId: C,
266
+ anonymousUserId: g,
235
267
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
236
268
  mixpanelEvent: "bundle_opened"
237
- }).catch((F) => {
238
- console.warn("[Bundle Analytics] Failed to track drawer opened:", F);
269
+ }).catch((E) => {
270
+ console.warn("[Bundle Analytics] Failed to track drawer opened:", E);
239
271
  });
240
- } catch (C) {
241
- console.warn("[Bundle Analytics] Error in toggle() callback:", C);
272
+ } catch (g) {
273
+ console.warn("[Bundle Analytics] Error in toggle() callback:", g);
242
274
  }
243
275
  return !d;
244
276
  });
245
- }, [v, t, Z, m, P, p]);
246
- M(() => {
247
- !p && (m == null ? void 0 : m.isActive) === !1 && P && Z();
248
- }, [p, m == null ? void 0 : m.isActive, P, Z]);
249
- const Ie = O(() => {
250
- const d = Number((m == null ? void 0 : m.maxBundleSize) ?? NaN), C = Number.isFinite(d) ? Math.floor(d) : 100;
251
- return Math.max(2, Math.min(100, C));
252
- }, [m == null ? void 0 : m.maxBundleSize]), X = O(() => new Set(
253
- te.filter((d) => d.availableForSale !== !1).map((d) => d.id)
254
- ), [te]), J = O(() => {
255
- const d = (m == null ? void 0 : m.rules) ?? [], C = d.length ? Math.min(...d.map((F) => F.minBundleSize)) : 2;
256
- return Number.isFinite(C) && C > 0 ? C : 2;
257
- }, [m]), Be = he((d, C) => {
258
- if (!X.has(d))
277
+ }, [x, t, te, m, M, b]);
278
+ j(() => {
279
+ !b && (m == null ? void 0 : m.isActive) === !1 && M && te();
280
+ }, [b, m == null ? void 0 : m.isActive, M, te]);
281
+ const Se = P(() => {
282
+ const d = Number((m == null ? void 0 : m.maxBundleSize) ?? NaN), g = Number.isFinite(d) ? Math.floor(d) : 100;
283
+ return Math.max(2, Math.min(100, g));
284
+ }, [m == null ? void 0 : m.maxBundleSize]), ee = P(() => new Set(
285
+ ie.filter((d) => d.availableForSale !== !1).map((d) => d.id)
286
+ ), [ie]), ne = P(() => {
287
+ const d = (m == null ? void 0 : m.rules) ?? [], g = d.length ? Math.min(...d.map((E) => E.minBundleSize)) : 2;
288
+ return Number.isFinite(g) && g > 0 ? g : 2;
289
+ }, [m]), Be = fe((d, g) => {
290
+ if (!ee.has(d))
259
291
  return;
260
- const F = ht(C);
261
- ze((g) => {
262
- const oe = g.selections[d] ?? 0, E = F - oe, ye = Object.values(g.selections).reduce(($, w) => $ + (w || 0), 0), B = E > 0 ? Math.min(E, Math.max(0, Ie - ye)) : E, L = oe + B;
263
- let G;
264
- if (L <= 0) {
265
- const { [d]: $, ...w } = g.selections;
266
- G = w;
267
- } else oe === L ? G = g.selections : G = { ...g.selections, [d]: L };
268
- let le = g.order;
269
- if (B > 0)
270
- le = [...g.order, ...Array.from({ length: B }, () => d)];
271
- else if (B < 0) {
272
- let $ = -B;
273
- const w = [];
274
- for (let T = g.order.length - 1; T >= 0; T--) {
275
- const y = g.order[T];
276
- if (y === d && $ > 0) {
277
- $--;
292
+ const E = ht(g);
293
+ ke((p) => {
294
+ const R = p.selections[d] ?? 0, T = E - R, q = Object.values(p.selections).reduce((U, v) => U + (v || 0), 0), I = T > 0 ? Math.min(T, Math.max(0, Se - q)) : T, D = R + I;
295
+ let K;
296
+ if (D <= 0) {
297
+ const { [d]: U, ...v } = p.selections;
298
+ K = v;
299
+ } else R === D ? K = p.selections : K = { ...p.selections, [d]: D };
300
+ let ue = p.order;
301
+ if (I > 0)
302
+ ue = [...p.order, ...Array.from({ length: I }, () => d)];
303
+ else if (I < 0) {
304
+ let U = -I;
305
+ const v = [];
306
+ for (let N = p.order.length - 1; N >= 0; N--) {
307
+ const y = p.order[N];
308
+ if (y === d && U > 0) {
309
+ U--;
278
310
  continue;
279
311
  }
280
- w.push(y);
312
+ v.push(y);
281
313
  }
282
- w.reverse(), le = w;
314
+ v.reverse(), ue = v;
283
315
  }
284
- if (G === g.selections && le === g.order) return g;
285
- const we = ye, ue = Object.values(G).reduce(($, w) => $ + (w || 0), 0);
286
- if (v)
316
+ if (K === p.selections && ue === p.order) return p;
317
+ const ge = q, de = Object.values(K).reduce((U, v) => U + (v || 0), 0);
318
+ if (x)
287
319
  try {
288
- const $ = Ne(), w = {
320
+ const U = Te(), v = {
289
321
  eventType: "VARIANT_SELECTION_CHANGED",
290
322
  shop: t,
291
- anonymousUserId: $,
292
- before: { ...g.selections },
293
- after: { ...G },
323
+ anonymousUserId: U,
324
+ before: { ...p.selections },
325
+ after: { ...K },
294
326
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
295
327
  };
296
- xe(v, t, w), we === 0 && ue >= 1 && xe(v, t, {
297
- ...w,
328
+ Ce(x, t, v), ge === 0 && de >= 1 && Ce(x, t, {
329
+ ...v,
298
330
  mixpanelEvent: "bundle_started"
299
- }), we < J && ue >= J && xe(v, t, {
300
- ...w,
331
+ }), ge < ne && de >= ne && Ce(x, t, {
332
+ ...v,
301
333
  mixpanelEvent: "bundle_completed"
302
334
  });
303
335
  } catch {
304
336
  }
305
- return { selections: G, order: le };
337
+ return { selections: K, order: ue };
306
338
  });
307
- }, [Ie, J, X, v, t]), pe = he(() => ze({ selections: {}, order: [] }), []), ne = ke.selections, be = ke.order, se = O(() => Object.values(ne).reduce((d, C) => d + (C || 0), 0), [ne]), ce = O(() => !(Y || V || k || !(m != null && m.isActive) || se < J), [se, m == null ? void 0 : m.isActive, k, Y, J, V]), _e = he(async (d) => {
308
- var w, T;
309
- if (!ce || !m) return;
310
- const C = Nt(), F = (m.title ?? "").trim().slice(0, 255), g = Object.entries(ne).map(([y, R]) => ({ merchandiseId: y, quantity: ht(R) })).filter((y) => y.quantity > 0).filter((y) => X.has(y.merchandiseId)).map((y) => ({
339
+ }, [Se, ne, ee, x, t]), _e = fe(() => ke({ selections: {}, order: [] }), []), oe = Pe.selections, we = Pe.order, ce = P(() => Object.values(oe).reduce((d, g) => d + (g || 0), 0), [oe]), le = P(() => !(Z || Y || k || !(m != null && m.isActive) || ce < ne), [ce, m == null ? void 0 : m.isActive, k, Z, ne, Y]), ye = fe(async (d) => {
340
+ var v, N;
341
+ if (!le || !m) return;
342
+ const g = Tt(), E = (m.title ?? "").trim().slice(0, 255), p = Object.entries(oe).map(([y, $]) => ({ merchandiseId: y, quantity: ht($) })).filter((y) => y.quantity > 0).filter((y) => ee.has(y.merchandiseId)).map((y) => ({
311
343
  merchandiseId: y.merchandiseId,
312
344
  quantity: y.quantity,
313
345
  attributes: [
314
- { key: Re.bundleId, value: C },
315
- { key: Re.bundleConfig, value: r },
316
- { key: Re.bundleSource, value: "bundle_builder" },
317
- ...F ? [{ key: Re.bundleTitle, value: F }] : []
346
+ { key: Me.bundleId, value: g },
347
+ { key: Me.bundleConfig, value: r },
348
+ { key: Me.bundleSource, value: "bundle_builder" },
349
+ ...E ? [{ key: Me.bundleTitle, value: E }] : []
318
350
  ]
319
351
  }));
320
- if (!g.length) return;
321
- const oe = new Map(te.map((y) => [y.id, y]));
322
- let E = 0;
323
- for (const [y, R] of Object.entries(ne)) {
324
- const Fe = R ?? 0;
325
- if (Fe <= 0) continue;
326
- const ge = oe.get(y), de = Number(ge == null ? void 0 : ge.price);
327
- Number.isFinite(de) && (E += de * Fe);
352
+ if (!p.length) return;
353
+ const R = new Map(ie.map((y) => [y.id, y]));
354
+ let T = 0;
355
+ for (const [y, $] of Object.entries(oe)) {
356
+ const je = $ ?? 0;
357
+ if (je <= 0) continue;
358
+ const ve = R.get(y), he = Number(ve == null ? void 0 : ve.price);
359
+ Number.isFinite(he) && (T += he * je);
328
360
  }
329
- E = Math.round(E * 100) / 100;
330
- const ye = [...m.rules ?? []].sort((y, R) => y.minBundleSize - R.minBundleSize);
331
- let B = null;
332
- for (const y of ye)
333
- se >= y.minBundleSize && (B = y);
334
- const L = B ? (() => {
335
- const y = Number.parseFloat(B.discountPercent);
361
+ T = Math.round(T * 100) / 100;
362
+ const q = [...m.rules ?? []].sort((y, $) => y.minBundleSize - $.minBundleSize);
363
+ let I = null;
364
+ for (const y of q)
365
+ ce >= y.minBundleSize && (I = y);
366
+ const D = I ? (() => {
367
+ const y = Number.parseFloat(I.discountPercent);
336
368
  return Number.isFinite(y) && y > 0 ? y : null;
337
- })() : null, G = L ? Math.round(E * (1 - L / 100) * 100) / 100 : E, le = E - G, we = g.map((y) => y.merchandiseId), ue = (B == null ? void 0 : B.handle) ?? "", $ = ((w = B == null ? void 0 : B.label) == null ? void 0 : w.trim()) || "";
338
- K(!0);
369
+ })() : null, K = D ? Math.round(T * (1 - D / 100) * 100) / 100 : T, ue = T - K, ge = p.map((y) => y.merchandiseId), de = (I == null ? void 0 : I.handle) ?? "", U = ((v = I == null ? void 0 : I.label) == null ? void 0 : v.trim()) || "";
370
+ J(!0);
339
371
  try {
340
- if (d != null && d.checkout ? await o.linesAddForCheckout(g) : await o.linesAdd(g), v)
372
+ if (d != null && d.checkout ? await i.linesAddForCheckout(p) : await i.linesAdd(p), x)
341
373
  try {
342
- const y = Ne(), R = !!(d != null && d.checkout);
343
- xe(v, t, {
374
+ const y = Te(), $ = !!(d != null && d.checkout);
375
+ Ce(x, t, {
344
376
  eventType: "BUNDLE_ADDED_TO_BASKET",
345
377
  shop: t,
346
378
  anonymousUserId: y,
347
- bundleId: C,
348
- productVariantIds: we,
349
- grossPrice: E,
350
- discountedPrice: G,
351
- currency: D ?? void 0,
352
- discountThresholdIdentifier: ue,
353
- discountLabel: $,
354
- discountPercentage: L,
355
- discountedAmount: le,
379
+ bundleId: g,
380
+ productVariantIds: ge,
381
+ grossPrice: T,
382
+ discountedPrice: K,
383
+ currency: V ?? void 0,
384
+ discountThresholdIdentifier: de,
385
+ discountLabel: U,
386
+ discountPercentage: D,
387
+ discountedAmount: ue,
356
388
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
357
- checkout: R,
358
- mixpanelEvent: R ? "checkout_started_with_bundle" : "bundle_added_to_cart"
389
+ checkout: $,
390
+ mixpanelEvent: $ ? "checkout_started_with_bundle" : "bundle_added_to_cart"
359
391
  });
360
392
  } catch {
361
393
  }
362
- pe(), Z(), (T = d == null ? void 0 : d.onComplete) == null || T.call(d);
394
+ _e(), te(), (N = d == null ? void 0 : d.onComplete) == null || N.call(d);
363
395
  } finally {
364
- K(!1);
396
+ J(!1);
365
397
  }
366
398
  }, [
367
- ce,
368
- o,
369
- pe,
370
- Z,
399
+ le,
400
+ i,
401
+ _e,
402
+ te,
371
403
  m,
372
404
  r,
373
- D,
374
- ne,
375
- X,
376
- te,
377
- se,
378
- v,
405
+ V,
406
+ oe,
407
+ ee,
408
+ ie,
409
+ ce,
410
+ x,
379
411
  t
380
- ]), re = he(async () => {
381
- await _e(
412
+ ]), ae = fe(async () => {
413
+ await ye(
382
414
  {
383
415
  onComplete: () => {
384
416
  var d;
385
- (d = o.openCartUI) == null || d.call(o);
417
+ (d = i.openCartUI) == null || d.call(i);
386
418
  }
387
419
  }
388
420
  );
389
- }, [_e, o]), Me = he(async () => {
390
- await _e(
421
+ }, [ye, i]), Ee = fe(async () => {
422
+ await ye(
391
423
  {
392
424
  checkout: !0,
393
425
  onComplete: () => {
394
426
  var d;
395
- (d = o.navigateToCheckout) == null || d.call(o);
427
+ (d = i.navigateToCheckout) == null || d.call(i);
396
428
  }
397
429
  }
398
430
  );
399
- }, [_e, o]), Ae = O(
431
+ }, [ye, i]), Re = P(
400
432
  () => ({
401
- isOpen: P,
402
- open: me,
403
- close: Z,
404
- toggle: Pe,
405
- loading: Y,
406
- submitting: V,
433
+ isOpen: M,
434
+ open: be,
435
+ close: te,
436
+ toggle: Ae,
437
+ loading: Z,
438
+ submitting: Y,
407
439
  error: k,
408
- currencyCode: D,
440
+ currencyCode: V,
409
441
  config: m,
410
- eligibleVariants: te,
411
- selections: ne,
412
- selectionOrder: be,
442
+ eligibleVariants: ie,
443
+ selections: oe,
444
+ selectionOrder: we,
413
445
  setQuantity: Be,
414
- clearSelections: pe,
415
- bundleSize: se,
416
- minRequired: J,
417
- canSubmit: ce,
418
- submit: re,
419
- submitAndCheckout: Me
446
+ clearSelections: _e,
447
+ bundleSize: ce,
448
+ minRequired: ne,
449
+ canSubmit: le,
450
+ submit: ae,
451
+ submitAndCheckout: Ee
420
452
  }),
421
453
  [
422
- P,
423
- me,
454
+ M,
455
+ be,
456
+ te,
457
+ Ae,
424
458
  Z,
425
- Pe,
426
459
  Y,
427
- V,
428
460
  k,
429
- D,
461
+ V,
430
462
  m,
431
- te,
432
- ne,
433
- be,
463
+ ie,
464
+ oe,
465
+ we,
434
466
  Be,
435
- pe,
436
- se,
437
- J,
467
+ _e,
438
468
  ce,
439
- re,
440
- Me
469
+ ne,
470
+ le,
471
+ ae,
472
+ Ee
441
473
  ]
442
474
  );
443
- return /* @__PURE__ */ f(_t.Provider, { value: Ae, children: W });
475
+ return /* @__PURE__ */ f(_t.Provider, { value: Re, children: Q });
444
476
  }
445
477
  function He() {
446
- const i = St(_t);
447
- if (!i)
478
+ const o = It(_t);
479
+ if (!o)
448
480
  throw new Error("useBundleBuilder must be used within <BundleProvider />");
449
- return i;
481
+ return o;
450
482
  }
451
483
  function br() {
452
- const { isOpen: i, open: e, close: t, toggle: o } = He();
453
- return { isOpen: i, open: e, close: t, toggle: o };
484
+ const { isOpen: o, open: e, close: t, toggle: i } = He();
485
+ return { isOpen: o, open: e, close: t, toggle: i };
454
486
  }
455
- const Ot = "_button_18rtl_1", kt = {
487
+ const Ot = "_button_18rtl_1", Pt = {
456
488
  button: Ot
457
489
  };
458
- function _r(i) {
490
+ function _r(o) {
459
491
  const { toggle: e } = He();
460
492
  return /* @__PURE__ */ f(
461
493
  "button",
462
494
  {
463
495
  type: "button",
464
496
  onClick: e,
465
- className: [kt.button, i.className].filter(Boolean).join(" "),
466
- children: i.children ?? "Build a bundle"
497
+ className: [Pt.button, o.className].filter(Boolean).join(" "),
498
+ children: o.children ?? "Build a bundle"
467
499
  }
468
500
  );
469
501
  }
470
- var Ve, ft;
471
- function zt() {
472
- if (ft) return Ve;
502
+ var We, ft;
503
+ function kt() {
504
+ if (ft) return We;
473
505
  ft = 1;
474
- var i = {
475
- linear: function(e, t, o, r) {
476
- var n = o - t;
506
+ var o = {
507
+ linear: function(e, t, i, r) {
508
+ var n = i - t;
477
509
  return n * e / r + t;
478
510
  },
479
- easeInQuad: function(e, t, o, r) {
480
- var n = o - t;
511
+ easeInQuad: function(e, t, i, r) {
512
+ var n = i - t;
481
513
  return n * (e /= r) * e + t;
482
514
  },
483
- easeOutQuad: function(e, t, o, r) {
484
- var n = o - t;
515
+ easeOutQuad: function(e, t, i, r) {
516
+ var n = i - t;
485
517
  return -n * (e /= r) * (e - 2) + t;
486
518
  },
487
- easeInOutQuad: function(e, t, o, r) {
488
- var n = o - t;
519
+ easeInOutQuad: function(e, t, i, r) {
520
+ var n = i - t;
489
521
  return (e /= r / 2) < 1 ? n / 2 * e * e + t : -n / 2 * (--e * (e - 2) - 1) + t;
490
522
  },
491
- easeInCubic: function(e, t, o, r) {
492
- var n = o - t;
523
+ easeInCubic: function(e, t, i, r) {
524
+ var n = i - t;
493
525
  return n * (e /= r) * e * e + t;
494
526
  },
495
- easeOutCubic: function(e, t, o, r) {
496
- var n = o - t;
527
+ easeOutCubic: function(e, t, i, r) {
528
+ var n = i - t;
497
529
  return n * ((e = e / r - 1) * e * e + 1) + t;
498
530
  },
499
- easeInOutCubic: function(e, t, o, r) {
500
- var n = o - t;
531
+ easeInOutCubic: function(e, t, i, r) {
532
+ var n = i - t;
501
533
  return (e /= r / 2) < 1 ? n / 2 * e * e * e + t : n / 2 * ((e -= 2) * e * e + 2) + t;
502
534
  },
503
- easeInQuart: function(e, t, o, r) {
504
- var n = o - t;
535
+ easeInQuart: function(e, t, i, r) {
536
+ var n = i - t;
505
537
  return n * (e /= r) * e * e * e + t;
506
538
  },
507
- easeOutQuart: function(e, t, o, r) {
508
- var n = o - t;
539
+ easeOutQuart: function(e, t, i, r) {
540
+ var n = i - t;
509
541
  return -n * ((e = e / r - 1) * e * e * e - 1) + t;
510
542
  },
511
- easeInOutQuart: function(e, t, o, r) {
512
- var n = o - t;
543
+ easeInOutQuart: function(e, t, i, r) {
544
+ var n = i - t;
513
545
  return (e /= r / 2) < 1 ? n / 2 * e * e * e * e + t : -n / 2 * ((e -= 2) * e * e * e - 2) + t;
514
546
  },
515
- easeInQuint: function(e, t, o, r) {
516
- var n = o - t;
547
+ easeInQuint: function(e, t, i, r) {
548
+ var n = i - t;
517
549
  return n * (e /= r) * e * e * e * e + t;
518
550
  },
519
- easeOutQuint: function(e, t, o, r) {
520
- var n = o - t;
551
+ easeOutQuint: function(e, t, i, r) {
552
+ var n = i - t;
521
553
  return n * ((e = e / r - 1) * e * e * e * e + 1) + t;
522
554
  },
523
- easeInOutQuint: function(e, t, o, r) {
524
- var n = o - t;
555
+ easeInOutQuint: function(e, t, i, r) {
556
+ var n = i - t;
525
557
  return (e /= r / 2) < 1 ? n / 2 * e * e * e * e * e + t : n / 2 * ((e -= 2) * e * e * e * e + 2) + t;
526
558
  },
527
- easeInSine: function(e, t, o, r) {
528
- var n = o - t;
559
+ easeInSine: function(e, t, i, r) {
560
+ var n = i - t;
529
561
  return -n * Math.cos(e / r * (Math.PI / 2)) + n + t;
530
562
  },
531
- easeOutSine: function(e, t, o, r) {
532
- var n = o - t;
563
+ easeOutSine: function(e, t, i, r) {
564
+ var n = i - t;
533
565
  return n * Math.sin(e / r * (Math.PI / 2)) + t;
534
566
  },
535
- easeInOutSine: function(e, t, o, r) {
536
- var n = o - t;
567
+ easeInOutSine: function(e, t, i, r) {
568
+ var n = i - t;
537
569
  return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t;
538
570
  },
539
- easeInExpo: function(e, t, o, r) {
540
- var n = o - t;
571
+ easeInExpo: function(e, t, i, r) {
572
+ var n = i - t;
541
573
  return e == 0 ? t : n * Math.pow(2, 10 * (e / r - 1)) + t;
542
574
  },
543
- easeOutExpo: function(e, t, o, r) {
544
- var n = o - t;
575
+ easeOutExpo: function(e, t, i, r) {
576
+ var n = i - t;
545
577
  return e == r ? t + n : n * (-Math.pow(2, -10 * e / r) + 1) + t;
546
578
  },
547
- easeInOutExpo: function(e, t, o, r) {
548
- var n = o - t;
579
+ easeInOutExpo: function(e, t, i, r) {
580
+ var n = i - t;
549
581
  return e === 0 ? t : e === r ? t + n : (e /= r / 2) < 1 ? n / 2 * Math.pow(2, 10 * (e - 1)) + t : n / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
550
582
  },
551
- easeInCirc: function(e, t, o, r) {
552
- var n = o - t;
583
+ easeInCirc: function(e, t, i, r) {
584
+ var n = i - t;
553
585
  return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t;
554
586
  },
555
- easeOutCirc: function(e, t, o, r) {
556
- var n = o - t;
587
+ easeOutCirc: function(e, t, i, r) {
588
+ var n = i - t;
557
589
  return n * Math.sqrt(1 - (e = e / r - 1) * e) + t;
558
590
  },
559
- easeInOutCirc: function(e, t, o, r) {
560
- var n = o - t;
591
+ easeInOutCirc: function(e, t, i, r) {
592
+ var n = i - t;
561
593
  return (e /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + t : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
562
594
  },
563
- easeInElastic: function(e, t, o, r) {
564
- var n = o - t, u, c, p;
565
- return p = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), u < Math.abs(n) ? (u = n, p = c / 4) : p = c / (2 * Math.PI) * Math.asin(n / u), -(u * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - p) * (2 * Math.PI) / c)) + t);
595
+ easeInElastic: function(e, t, i, r) {
596
+ var n = i - t, u, c, b;
597
+ return b = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), u < Math.abs(n) ? (u = n, b = c / 4) : b = c / (2 * Math.PI) * Math.asin(n / u), -(u * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - b) * (2 * Math.PI) / c)) + t);
566
598
  },
567
- easeOutElastic: function(e, t, o, r) {
568
- var n = o - t, u, c, p;
569
- return p = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), u < Math.abs(n) ? (u = n, p = c / 4) : p = c / (2 * Math.PI) * Math.asin(n / u), u * Math.pow(2, -10 * e) * Math.sin((e * r - p) * (2 * Math.PI) / c) + n + t);
599
+ easeOutElastic: function(e, t, i, r) {
600
+ var n = i - t, u, c, b;
601
+ return b = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), u < Math.abs(n) ? (u = n, b = c / 4) : b = c / (2 * Math.PI) * Math.asin(n / u), u * Math.pow(2, -10 * e) * Math.sin((e * r - b) * (2 * Math.PI) / c) + n + t);
570
602
  },
571
- easeInOutElastic: function(e, t, o, r) {
572
- var n = o - t, u, c, p;
573
- return p = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r / 2) === 2 ? t + n : (c || (c = r * (0.3 * 1.5)), u < Math.abs(n) ? (u = n, p = c / 4) : p = c / (2 * Math.PI) * Math.asin(n / u), e < 1 ? -0.5 * (u * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - p) * (2 * Math.PI) / c)) + t : u * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * r - p) * (2 * Math.PI) / c) * 0.5 + n + t);
603
+ easeInOutElastic: function(e, t, i, r) {
604
+ var n = i - t, u, c, b;
605
+ return b = 1.70158, c = 0, u = n, e === 0 ? t : (e /= r / 2) === 2 ? t + n : (c || (c = r * (0.3 * 1.5)), u < Math.abs(n) ? (u = n, b = c / 4) : b = c / (2 * Math.PI) * Math.asin(n / u), e < 1 ? -0.5 * (u * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - b) * (2 * Math.PI) / c)) + t : u * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * r - b) * (2 * Math.PI) / c) * 0.5 + n + t);
574
606
  },
575
- easeInBack: function(e, t, o, r, n) {
576
- var u = o - t;
607
+ easeInBack: function(e, t, i, r, n) {
608
+ var u = i - t;
577
609
  return n === void 0 && (n = 1.70158), u * (e /= r) * e * ((n + 1) * e - n) + t;
578
610
  },
579
- easeOutBack: function(e, t, o, r, n) {
580
- var u = o - t;
611
+ easeOutBack: function(e, t, i, r, n) {
612
+ var u = i - t;
581
613
  return n === void 0 && (n = 1.70158), u * ((e = e / r - 1) * e * ((n + 1) * e + n) + 1) + t;
582
614
  },
583
- easeInOutBack: function(e, t, o, r, n) {
584
- var u = o - t;
615
+ easeInOutBack: function(e, t, i, r, n) {
616
+ var u = i - t;
585
617
  return n === void 0 && (n = 1.70158), (e /= r / 2) < 1 ? u / 2 * (e * e * (((n *= 1.525) + 1) * e - n)) + t : u / 2 * ((e -= 2) * e * (((n *= 1.525) + 1) * e + n) + 2) + t;
586
618
  },
587
- easeInBounce: function(e, t, o, r) {
588
- var n = o - t, u;
589
- return u = i.easeOutBounce(r - e, 0, n, r), n - u + t;
619
+ easeInBounce: function(e, t, i, r) {
620
+ var n = i - t, u;
621
+ return u = o.easeOutBounce(r - e, 0, n, r), n - u + t;
590
622
  },
591
- easeOutBounce: function(e, t, o, r) {
592
- var n = o - t;
623
+ easeOutBounce: function(e, t, i, r) {
624
+ var n = i - t;
593
625
  return (e /= r) < 1 / 2.75 ? n * (7.5625 * e * e) + t : e < 2 / 2.75 ? n * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t : e < 2.5 / 2.75 ? n * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t : n * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
594
626
  },
595
- easeInOutBounce: function(e, t, o, r) {
596
- var n = o - t, u;
597
- return e < r / 2 ? (u = i.easeInBounce(e * 2, 0, n, r), u * 0.5 + t) : (u = i.easeOutBounce(e * 2 - r, 0, n, r), u * 0.5 + n * 0.5 + t);
627
+ easeInOutBounce: function(e, t, i, r) {
628
+ var n = i - t, u;
629
+ return e < r / 2 ? (u = o.easeInBounce(e * 2, 0, n, r), u * 0.5 + t) : (u = o.easeOutBounce(e * 2 - r, 0, n, r), u * 0.5 + n * 0.5 + t);
598
630
  }
599
631
  };
600
- return Ve = i, Ve;
632
+ return We = o, We;
601
633
  }
602
- var jt = zt();
603
- function Pt(i) {
604
- return i * Math.PI / 180;
634
+ var zt = kt();
635
+ function At(o) {
636
+ return o * Math.PI / 180;
605
637
  }
606
- function U(i, e) {
607
- return i + Math.random() * (e - i);
638
+ function G(o, e) {
639
+ return o + Math.random() * (e - o);
608
640
  }
609
- function Mt(i, e) {
610
- return Math.floor(i + Math.random() * (e - i + 1));
641
+ function Et(o, e) {
642
+ return Math.floor(o + Math.random() * (e - o + 1));
611
643
  }
612
644
  var Oe;
613
- (function(i) {
614
- i[i.Circle = 0] = "Circle", i[i.Square = 1] = "Square", i[i.Strip = 2] = "Strip";
645
+ (function(o) {
646
+ o[o.Circle = 0] = "Circle", o[o.Square = 1] = "Square", o[o.Strip = 2] = "Strip";
615
647
  })(Oe || (Oe = {}));
616
- var fe;
617
- (function(i) {
618
- i[i.Positive = 1] = "Positive", i[i.Negative = -1] = "Negative";
619
- })(fe || (fe = {}));
620
- const At = 1e3 / 60;
621
- class Ft {
622
- constructor(e, t, o, r) {
648
+ var me;
649
+ (function(o) {
650
+ o[o.Positive = 1] = "Positive", o[o.Negative = -1] = "Negative";
651
+ })(me || (me = {}));
652
+ const Rt = 1e3 / 60;
653
+ class jt {
654
+ constructor(e, t, i, r) {
623
655
  this.getOptions = t;
624
656
  const { colors: n, initialVelocityX: u, initialVelocityY: c } = this.getOptions();
625
- this.context = e, this.x = o, this.y = r, this.w = U(5, 20), this.h = U(5, 20), this.radius = U(5, 10), this.vx = typeof u == "number" ? U(-u, u) : U(u.min, u.max), this.vy = typeof c == "number" ? U(-c, 0) : U(c.min, c.max), this.shape = Mt(0, 2), this.angle = Pt(U(0, 360)), this.angularSpin = U(-0.2, 0.2), this.color = n[Math.floor(Math.random() * n.length)], this.rotateY = U(0, 1), this.rotationDirection = U(0, 1) ? fe.Positive : fe.Negative;
657
+ this.context = e, this.x = i, this.y = r, this.w = G(5, 20), this.h = G(5, 20), this.radius = G(5, 10), this.vx = typeof u == "number" ? G(-u, u) : G(u.min, u.max), this.vy = typeof c == "number" ? G(-c, 0) : G(c.min, c.max), this.shape = Et(0, 2), this.angle = At(G(0, 360)), this.angularSpin = G(-0.2, 0.2), this.color = n[Math.floor(Math.random() * n.length)], this.rotateY = G(0, 1), this.rotationDirection = G(0, 1) ? me.Positive : me.Negative;
626
658
  }
627
659
  update(e) {
628
- const { gravity: t, wind: o, friction: r, opacity: n, drawShape: u } = this.getOptions(), c = e / At;
629
- this.x += this.vx * c, this.y += this.vy * c, this.vy += t * c, this.vx += o * c, this.vx *= r ** c, this.vy *= r ** c, this.rotateY >= 1 && this.rotationDirection === fe.Positive ? this.rotationDirection = fe.Negative : this.rotateY <= -1 && this.rotationDirection === fe.Negative && (this.rotationDirection = fe.Positive);
630
- const p = 0.1 * this.rotationDirection * c;
631
- if (this.rotateY += p, this.angle += this.angularSpin, this.context.save(), this.context.translate(this.x, this.y), this.context.rotate(this.angle), this.context.scale(1, this.rotateY), this.context.rotate(this.angle), this.context.beginPath(), this.context.fillStyle = this.color, this.context.strokeStyle = this.color, this.context.globalAlpha = n, this.context.lineCap = "round", this.context.lineWidth = 2, u && typeof u == "function")
660
+ const { gravity: t, wind: i, friction: r, opacity: n, drawShape: u } = this.getOptions(), c = e / Rt;
661
+ this.x += this.vx * c, this.y += this.vy * c, this.vy += t * c, this.vx += i * c, this.vx *= r ** c, this.vy *= r ** c, this.rotateY >= 1 && this.rotationDirection === me.Positive ? this.rotationDirection = me.Negative : this.rotateY <= -1 && this.rotationDirection === me.Negative && (this.rotationDirection = me.Positive);
662
+ const b = 0.1 * this.rotationDirection * c;
663
+ if (this.rotateY += b, this.angle += this.angularSpin, this.context.save(), this.context.translate(this.x, this.y), this.context.rotate(this.angle), this.context.scale(1, this.rotateY), this.context.rotate(this.angle), this.context.beginPath(), this.context.fillStyle = this.color, this.context.strokeStyle = this.color, this.context.globalAlpha = n, this.context.lineCap = "round", this.context.lineWidth = 2, u && typeof u == "function")
632
664
  u.call(this, this.context);
633
665
  else
634
666
  switch (this.shape) {
@@ -648,36 +680,36 @@ class Ft {
648
680
  this.context.closePath(), this.context.restore();
649
681
  }
650
682
  }
651
- class Rt {
683
+ class Mt {
652
684
  constructor(e, t) {
653
685
  this.x = 0, this.y = 0, this.w = 0, this.h = 0, this.lastNumberOfPieces = 0, this.tweenProgress = 0, this.tweenFrom = 0, this.particles = [], this.particlesGenerated = 0, this.removeParticleAt = (r) => {
654
686
  this.particles.splice(r, 1);
655
687
  }, this.getParticle = () => {
656
- const r = U(this.x, this.w + this.x), n = U(this.y, this.h + this.y);
657
- return new Ft(this.context, this.getOptions, r, n);
688
+ const r = G(this.x, this.w + this.x), n = G(this.y, this.h + this.y);
689
+ return new jt(this.context, this.getOptions, r, n);
658
690
  }, this.animate = (r) => {
659
- const { canvas: n, context: u, particlesGenerated: c, lastNumberOfPieces: p } = this, { run: W, recycle: v, numberOfPieces: P, debug: I, tweenFunction: Y, tweenDuration: H } = this.getOptions();
660
- if (!W)
691
+ const { canvas: n, context: u, particlesGenerated: c, lastNumberOfPieces: b } = this, { run: Q, recycle: x, numberOfPieces: M, debug: B, tweenFunction: Z, tweenDuration: L } = this.getOptions();
692
+ if (!Q)
661
693
  return !1;
662
- const V = this.particles.length, K = v ? V : c;
663
- if (K < P) {
664
- p !== P && (this.tweenProgress = 0, this.tweenFrom = K, this.lastNumberOfPieces = P), this.tweenProgress = Math.min(H, Math.max(0, this.tweenProgress + r));
665
- const k = Y(this.tweenProgress, this.tweenFrom, P, H), A = Math.round(k - K);
666
- for (let D = 0; D < A; D++)
694
+ const Y = this.particles.length, J = x ? Y : c;
695
+ if (J < M) {
696
+ b !== M && (this.tweenProgress = 0, this.tweenFrom = J, this.lastNumberOfPieces = M), this.tweenProgress = Math.min(L, Math.max(0, this.tweenProgress + r));
697
+ const k = Z(this.tweenProgress, this.tweenFrom, M, L), F = Math.round(k - J);
698
+ for (let V = 0; V < F; V++)
667
699
  this.particles.push(this.getParticle());
668
- this.particlesGenerated += A;
700
+ this.particlesGenerated += F;
669
701
  }
670
- I && (u.font = "12px sans-serif", u.fillStyle = "#333", u.textAlign = "right", u.fillText(`Particles: ${V}`, n.width - 10, n.height - 20));
702
+ B && (u.font = "12px sans-serif", u.fillStyle = "#333", u.textAlign = "right", u.fillText(`Particles: ${Y}`, n.width - 10, n.height - 20));
671
703
  for (let k = this.particles.length - 1; k >= 0; k--) {
672
- const A = this.particles[k];
673
- A.update(r), (A.y > n.height || A.y < -100 || A.x > n.width + 100 || A.x < -100) && (v && K <= P ? this.particles[k] = this.getParticle() : this.removeParticleAt(k));
704
+ const F = this.particles[k];
705
+ F.update(r), (F.y > n.height || F.y < -100 || F.x > n.width + 100 || F.x < -100) && (x && J <= M ? this.particles[k] = this.getParticle() : this.removeParticleAt(k));
674
706
  }
675
- return V > 0 || K < P;
707
+ return Y > 0 || J < M;
676
708
  }, this.canvas = e;
677
- const o = this.canvas.getContext("2d");
678
- if (!o)
709
+ const i = this.canvas.getContext("2d");
710
+ if (!i)
679
711
  throw new Error("Could not get canvas context");
680
- this.context = o, this.getOptions = t;
712
+ this.context = i, this.getOptions = t;
681
713
  }
682
714
  }
683
715
  const Ke = {
@@ -710,12 +742,12 @@ const Ke = {
710
742
  ],
711
743
  opacity: 1,
712
744
  debug: !1,
713
- tweenFunction: jt.easeInOutQuad,
745
+ tweenFunction: zt.easeInOutQuad,
714
746
  tweenDuration: 5e3,
715
747
  recycle: !0,
716
748
  run: !0
717
749
  };
718
- class Dt {
750
+ class Ft {
719
751
  constructor(e, t) {
720
752
  this.lastFrameTime = 0, this.setOptionsWithDefaults = (r) => {
721
753
  const n = {
@@ -732,40 +764,40 @@ class Dt {
732
764
  ...r
733
765
  }, Object.assign(this, r.confettiSource);
734
766
  }, this.update = (r = 0) => {
735
- const { options: { run: n, onConfettiComplete: u, frameRate: c }, canvas: p, context: W } = this, v = Math.min(r - this.lastFrameTime, 50);
736
- if (c && v < 1e3 / c) {
767
+ const { options: { run: n, onConfettiComplete: u, frameRate: c }, canvas: b, context: Q } = this, x = Math.min(r - this.lastFrameTime, 50);
768
+ if (c && x < 1e3 / c) {
737
769
  this.rafId = requestAnimationFrame(this.update);
738
770
  return;
739
771
  }
740
- this.lastFrameTime = r - (c ? v % c : 0), n && (W.fillStyle = "white", W.clearRect(0, 0, p.width, p.height)), this.generator.animate(v) ? this.rafId = requestAnimationFrame(this.update) : (u && typeof u == "function" && this.generator.particlesGenerated > 0 && u.call(this, this), this._options.run = !1);
772
+ this.lastFrameTime = r - (c ? x % c : 0), n && (Q.fillStyle = "white", Q.clearRect(0, 0, b.width, b.height)), this.generator.animate(x) ? this.rafId = requestAnimationFrame(this.update) : (u && typeof u == "function" && this.generator.particlesGenerated > 0 && u.call(this, this), this._options.run = !1);
741
773
  }, this.reset = () => {
742
774
  this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
743
775
  }, this.stop = () => {
744
776
  this.options = { run: !1 }, this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = void 0);
745
777
  }, this.canvas = e;
746
- const o = this.canvas.getContext("2d");
747
- if (!o)
778
+ const i = this.canvas.getContext("2d");
779
+ if (!i)
748
780
  throw new Error("Could not get canvas context");
749
- this.context = o, this.generator = new Rt(this.canvas, () => this.options), this.options = t, this.update();
781
+ this.context = i, this.generator = new Mt(this.canvas, () => this.options), this.options = t, this.update();
750
782
  }
751
783
  get options() {
752
784
  return this._options;
753
785
  }
754
786
  set options(e) {
755
787
  var r, n;
756
- const t = (r = this._options) == null ? void 0 : r.run, o = (n = this._options) == null ? void 0 : n.recycle;
757
- this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle && o === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof e.run == "boolean" && e.run && t === !1 && this.update();
788
+ const t = (r = this._options) == null ? void 0 : r.run, i = (n = this._options) == null ? void 0 : n.recycle;
789
+ this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle && i === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof e.run == "boolean" && e.run && t === !1 && this.update();
758
790
  }
759
791
  }
760
- const Et = Ee.createRef();
761
- class Xe extends Ee.Component {
792
+ const Dt = De.createRef();
793
+ class Xe extends De.Component {
762
794
  constructor(e) {
763
- super(e), this.canvas = Ee.createRef(), this.canvas = e.canvasRef || Et;
795
+ super(e), this.canvas = De.createRef(), this.canvas = e.canvasRef || Dt;
764
796
  }
765
797
  componentDidMount() {
766
798
  if (this.canvas.current) {
767
799
  const e = Ge(this.props)[0];
768
- this.confetti = new Dt(this.canvas.current, e);
800
+ this.confetti = new Ft(this.canvas.current, e);
769
801
  }
770
802
  }
771
803
  componentDidUpdate() {
@@ -776,7 +808,7 @@ class Xe extends Ee.Component {
776
808
  this.confetti && this.confetti.stop(), this.confetti = void 0;
777
809
  }
778
810
  render() {
779
- const [e, t] = Ge(this.props), o = {
811
+ const [e, t] = Ge(this.props), i = {
780
812
  zIndex: 2,
781
813
  position: "absolute",
782
814
  pointerEvents: "none",
@@ -786,42 +818,42 @@ class Xe extends Ee.Component {
786
818
  right: 0,
787
819
  ...t.style
788
820
  };
789
- return f("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: o });
821
+ return f("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: i });
790
822
  }
791
823
  }
792
824
  Xe.defaultProps = {
793
825
  ...Ke
794
826
  };
795
827
  Xe.displayName = "ReactConfetti";
796
- function Ge(i) {
797
- const e = {}, t = {}, o = {}, r = [
828
+ function Ge(o) {
829
+ const e = {}, t = {}, i = {}, r = [
798
830
  ...Object.keys(Ke),
799
831
  "confettiSource",
800
832
  "drawShape",
801
833
  "onConfettiComplete",
802
834
  "frameRate"
803
835
  ], n = ["canvasRef"];
804
- for (const u in i) {
805
- const c = i[u];
806
- r.includes(u) ? e[u] = c : n.includes(u) ? n[u] = c : o[u] = c;
836
+ for (const u in o) {
837
+ const c = o[u];
838
+ r.includes(u) ? e[u] = c : n.includes(u) ? n[u] = c : i[u] = c;
807
839
  }
808
- return [e, o, t];
840
+ return [e, i, t];
809
841
  }
810
- const Lt = Ee.forwardRef((i, e) => f(Xe, { canvasRef: e, ...i }));
842
+ const Lt = De.forwardRef((o, e) => f(Xe, { canvasRef: e, ...o }));
811
843
  /**
812
844
  * @license lucide-react v0.515.0 - ISC
813
845
  *
814
846
  * This source code is licensed under the ISC license.
815
847
  * See the LICENSE file in the root directory of this source tree.
816
848
  */
817
- const $t = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), qt = (i) => i.replace(
849
+ const $t = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Vt = (o) => o.replace(
818
850
  /^([A-Z])|[\s-_]+(\w)/g,
819
- (e, t, o) => o ? o.toUpperCase() : t.toLowerCase()
820
- ), mt = (i) => {
821
- const e = qt(i);
851
+ (e, t, i) => i ? i.toUpperCase() : t.toLowerCase()
852
+ ), mt = (o) => {
853
+ const e = Vt(o);
822
854
  return e.charAt(0).toUpperCase() + e.slice(1);
823
- }, yt = (...i) => i.filter((e, t, o) => !!e && e.trim() !== "" && o.indexOf(e) === t).join(" ").trim(), Ut = (i) => {
824
- for (const e in i)
855
+ }, wt = (...o) => o.filter((e, t, i) => !!e && e.trim() !== "" && i.indexOf(e) === t).join(" ").trim(), qt = (o) => {
856
+ for (const e in o)
825
857
  if (e.startsWith("aria-") || e === "role" || e === "title")
826
858
  return !0;
827
859
  };
@@ -831,7 +863,7 @@ const $t = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), qt = (
831
863
  * This source code is licensed under the ISC license.
832
864
  * See the LICENSE file in the root directory of this source tree.
833
865
  */
834
- var Wt = {
866
+ var Ut = {
835
867
  xmlns: "http://www.w3.org/2000/svg",
836
868
  width: 24,
837
869
  height: 24,
@@ -848,31 +880,31 @@ var Wt = {
848
880
  * This source code is licensed under the ISC license.
849
881
  * See the LICENSE file in the root directory of this source tree.
850
882
  */
851
- const Vt = bt(
883
+ const Wt = bt(
852
884
  ({
853
- color: i = "currentColor",
885
+ color: o = "currentColor",
854
886
  size: e = 24,
855
887
  strokeWidth: t = 2,
856
- absoluteStrokeWidth: o,
888
+ absoluteStrokeWidth: i,
857
889
  className: r = "",
858
890
  children: n,
859
891
  iconNode: u,
860
892
  ...c
861
- }, p) => Ye(
893
+ }, b) => Ye(
862
894
  "svg",
863
895
  {
864
- ref: p,
865
- ...Wt,
896
+ ref: b,
897
+ ...Ut,
866
898
  width: e,
867
899
  height: e,
868
- stroke: i,
869
- strokeWidth: o ? Number(t) * 24 / Number(e) : t,
870
- className: yt("lucide", r),
871
- ...!n && !Ut(c) && { "aria-hidden": "true" },
900
+ stroke: o,
901
+ strokeWidth: i ? Number(t) * 24 / Number(e) : t,
902
+ className: wt("lucide", r),
903
+ ...!n && !qt(c) && { "aria-hidden": "true" },
872
904
  ...c
873
905
  },
874
906
  [
875
- ...u.map(([W, v]) => Ye(W, v)),
907
+ ...u.map(([Q, x]) => Ye(Q, x)),
876
908
  ...Array.isArray(n) ? n : [n]
877
909
  ]
878
910
  )
@@ -883,20 +915,20 @@ const Vt = bt(
883
915
  * This source code is licensed under the ISC license.
884
916
  * See the LICENSE file in the root directory of this source tree.
885
917
  */
886
- const Gt = (i, e) => {
918
+ const Gt = (o, e) => {
887
919
  const t = bt(
888
- ({ className: o, ...r }, n) => Ye(Vt, {
920
+ ({ className: i, ...r }, n) => Ye(Wt, {
889
921
  ref: n,
890
922
  iconNode: e,
891
- className: yt(
892
- `lucide-${$t(mt(i))}`,
893
- `lucide-${i}`,
894
- o
923
+ className: wt(
924
+ `lucide-${$t(mt(o))}`,
925
+ `lucide-${o}`,
926
+ i
895
927
  ),
896
928
  ...r
897
929
  })
898
930
  );
899
- return t.displayName = mt(i), t;
931
+ return t.displayName = mt(o), t;
900
932
  };
901
933
  /**
902
934
  * @license lucide-react v0.515.0 - ISC
@@ -907,7 +939,7 @@ const Gt = (i, e) => {
907
939
  const Qt = [
908
940
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
909
941
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
910
- ], Yt = Gt("search", Qt), Ht = "_backdrop_jhu8z_1", Kt = "_celebrationOverlay_jhu8z_14", Xt = "_celebrationChip_jhu8z_23", Zt = "_backdropOpen_jhu8z_74", Jt = "_backdropClosed_jhu8z_78", en = "_panel_jhu8z_82", tn = "_panelOpen_jhu8z_102", nn = "_panelClosed_jhu8z_106", rn = "_header_jhu8z_145", on = "_headerCenter_jhu8z_154", an = "_title_jhu8z_162", sn = "_searchIconButton_jhu8z_171", cn = "_headerTitleWrap_jhu8z_193", ln = "_headerSearchWrap_jhu8z_197", un = "_headerSearchOpen_jhu8z_209", dn = "_searchBar_jhu8z_221", hn = "_searchInput_jhu8z_233", fn = "_searchClearButton_jhu8z_254", mn = "_closeButton_jhu8z_276", pn = "_body_jhu8z_309", bn = "_muted_jhu8z_314", _n = "_error_jhu8z_319", yn = "_variants_jhu8z_324", wn = "_variantList_jhu8z_328", gn = "_variantRow_jhu8z_336", vn = "_variantRowSoldOut_jhu8z_344", xn = "_variantLeft_jhu8z_348", Cn = "_addToBundleButton_jhu8z_355", Sn = "_soldOutContainer_jhu8z_383", In = "_soldOut_jhu8z_383", Bn = "_variantThumb_jhu8z_400", Tn = "_variantThumbImg_jhu8z_410", Nn = "_variantThumbFallback_jhu8z_417", On = "_variantInfo_jhu8z_427", kn = "_variantName_jhu8z_431", zn = "_variantMeta_jhu8z_440", jn = "_variantPriceRow_jhu8z_448", Pn = "_variantCompareAt_jhu8z_455", Mn = "_variantPrice_jhu8z_448", An = "_qtyControls_jhu8z_466", Fn = "_qtyButton_jhu8z_472", Rn = "_qtyValue_jhu8z_497", Dn = "_footer_jhu8z_504", En = "_poweredBy_jhu8z_511", Ln = "_boxSummaryWindow_jhu8z_523", $n = "_boxSummaryRow_jhu8z_540", qn = "_boxSlot_jhu8z_548", Un = "_boxItem_jhu8z_557", Wn = "_boxItemClickable_jhu8z_569", Vn = "_boxThresholdLabel_jhu8z_578", Gn = "_boxItemPlaceholder_jhu8z_589", Qn = "_boxItemFilled_jhu8z_595", Yn = "_boxItemThreshold_jhu8z_601", Hn = "_boxItemDiscountText_jhu8z_609", Kn = "_boxItemPlus_jhu8z_617", Xn = "_boxItemImage_jhu8z_624", Zn = "_boxItemFallback_jhu8z_631", Jn = "_ctaButtonGroup_jhu8z_642", er = "_ctaButtonGroupAnimating_jhu8z_649", tr = "_cta_jhu8z_642", nr = "_ctaDualLeft_jhu8z_677", rr = "_ctaDualLeftAnimating_jhu8z_695", or = "_ctaDualRight_jhu8z_708", ir = "_ctaDualRightAnimating_jhu8z_724", ar = "_ctaTotals_jhu8z_735", sr = "_ctaDiscountBadge_jhu8z_743", cr = "_ctaTotalsWrap_jhu8z_757", lr = "_ctaTotalsWrapVisible_jhu8z_770", ur = "_ctaTotalsStrike_jhu8z_777", dr = "_ctaTotalsPrice_jhu8z_784", l = {
942
+ ], Yt = Gt("search", Qt), Ht = "_backdrop_jhu8z_1", Kt = "_celebrationOverlay_jhu8z_14", Xt = "_celebrationChip_jhu8z_23", Zt = "_backdropOpen_jhu8z_74", Jt = "_backdropClosed_jhu8z_78", en = "_panel_jhu8z_82", tn = "_panelOpen_jhu8z_102", nn = "_panelClosed_jhu8z_106", rn = "_header_jhu8z_145", on = "_headerCenter_jhu8z_154", an = "_title_jhu8z_162", sn = "_searchIconButton_jhu8z_171", cn = "_headerTitleWrap_jhu8z_193", ln = "_headerSearchWrap_jhu8z_197", un = "_headerSearchOpen_jhu8z_209", dn = "_searchBar_jhu8z_221", hn = "_searchInput_jhu8z_233", fn = "_searchClearButton_jhu8z_254", mn = "_closeButton_jhu8z_276", pn = "_body_jhu8z_309", bn = "_muted_jhu8z_314", _n = "_error_jhu8z_319", wn = "_variants_jhu8z_324", yn = "_variantList_jhu8z_328", gn = "_variantRow_jhu8z_336", vn = "_variantRowSoldOut_jhu8z_344", xn = "_variantLeft_jhu8z_348", Cn = "_addToBundleButton_jhu8z_355", In = "_soldOutContainer_jhu8z_383", Sn = "_soldOut_jhu8z_383", Bn = "_variantThumb_jhu8z_400", Nn = "_variantThumbImg_jhu8z_410", Tn = "_variantThumbFallback_jhu8z_417", On = "_variantInfo_jhu8z_427", Pn = "_variantName_jhu8z_431", kn = "_variantMeta_jhu8z_440", zn = "_variantPriceRow_jhu8z_448", An = "_variantCompareAt_jhu8z_455", En = "_variantPrice_jhu8z_448", Rn = "_qtyControls_jhu8z_466", jn = "_qtyButton_jhu8z_472", Mn = "_qtyValue_jhu8z_497", Fn = "_footer_jhu8z_504", Dn = "_poweredBy_jhu8z_511", Ln = "_boxSummaryWindow_jhu8z_523", $n = "_boxSummaryRow_jhu8z_540", Vn = "_boxSlot_jhu8z_548", qn = "_boxItem_jhu8z_557", Un = "_boxItemClickable_jhu8z_569", Wn = "_boxThresholdLabel_jhu8z_578", Gn = "_boxItemPlaceholder_jhu8z_589", Qn = "_boxItemFilled_jhu8z_595", Yn = "_boxItemThreshold_jhu8z_601", Hn = "_boxItemDiscountText_jhu8z_609", Kn = "_boxItemPlus_jhu8z_617", Xn = "_boxItemImage_jhu8z_624", Zn = "_boxItemFallback_jhu8z_631", Jn = "_ctaButtonGroup_jhu8z_642", er = "_ctaButtonGroupAnimating_jhu8z_649", tr = "_cta_jhu8z_642", nr = "_ctaDualLeft_jhu8z_677", rr = "_ctaDualLeftAnimating_jhu8z_695", ir = "_ctaDualRight_jhu8z_708", or = "_ctaDualRightAnimating_jhu8z_724", ar = "_ctaTotals_jhu8z_735", sr = "_ctaDiscountBadge_jhu8z_743", cr = "_ctaTotalsWrap_jhu8z_757", lr = "_ctaTotalsWrapVisible_jhu8z_770", ur = "_ctaTotalsStrike_jhu8z_777", dr = "_ctaTotalsPrice_jhu8z_784", l = {
911
943
  backdrop: Ht,
912
944
  celebrationOverlay: Kt,
913
945
  celebrationChip: Xt,
@@ -930,34 +962,34 @@ const Qt = [
930
962
  body: pn,
931
963
  muted: bn,
932
964
  error: _n,
933
- variants: yn,
934
- variantList: wn,
965
+ variants: wn,
966
+ variantList: yn,
935
967
  variantRow: gn,
936
968
  variantRowSoldOut: vn,
937
969
  variantLeft: xn,
938
970
  addToBundleButton: Cn,
939
- soldOutContainer: Sn,
940
- soldOut: In,
971
+ soldOutContainer: In,
972
+ soldOut: Sn,
941
973
  variantThumb: Bn,
942
- variantThumbImg: Tn,
943
- variantThumbFallback: Nn,
974
+ variantThumbImg: Nn,
975
+ variantThumbFallback: Tn,
944
976
  variantInfo: On,
945
- variantName: kn,
946
- variantMeta: zn,
947
- variantPriceRow: jn,
948
- variantCompareAt: Pn,
949
- variantPrice: Mn,
950
- qtyControls: An,
951
- qtyButton: Fn,
952
- qtyValue: Rn,
953
- footer: Dn,
954
- poweredBy: En,
977
+ variantName: Pn,
978
+ variantMeta: kn,
979
+ variantPriceRow: zn,
980
+ variantCompareAt: An,
981
+ variantPrice: En,
982
+ qtyControls: Rn,
983
+ qtyButton: jn,
984
+ qtyValue: Mn,
985
+ footer: Fn,
986
+ poweredBy: Dn,
955
987
  boxSummaryWindow: Ln,
956
988
  boxSummaryRow: $n,
957
- boxSlot: qn,
958
- boxItem: Un,
959
- boxItemClickable: Wn,
960
- boxThresholdLabel: Vn,
989
+ boxSlot: Vn,
990
+ boxItem: qn,
991
+ boxItemClickable: Un,
992
+ boxThresholdLabel: Wn,
961
993
  boxItemPlaceholder: Gn,
962
994
  boxItemFilled: Qn,
963
995
  boxItemThreshold: Yn,
@@ -970,8 +1002,8 @@ const Qt = [
970
1002
  cta: tr,
971
1003
  ctaDualLeft: nr,
972
1004
  ctaDualLeftAnimating: rr,
973
- ctaDualRight: or,
974
- ctaDualRightAnimating: ir,
1005
+ ctaDualRight: ir,
1006
+ ctaDualRightAnimating: or,
975
1007
  ctaTotals: ar,
976
1008
  ctaDiscountBadge: sr,
977
1009
  ctaTotalsWrap: cr,
@@ -979,55 +1011,55 @@ const Qt = [
979
1011
  ctaTotalsStrike: ur,
980
1012
  ctaTotalsPrice: dr
981
1013
  };
982
- function yr(i) {
983
- var it, at;
1014
+ function wr(o) {
1015
+ var ot, at;
984
1016
  const {
985
1017
  isOpen: e,
986
1018
  close: t,
987
- loading: o,
1019
+ loading: i,
988
1020
  submitting: r,
989
1021
  error: n,
990
1022
  currencyCode: u,
991
1023
  config: c,
992
- eligibleVariants: p,
993
- selections: W,
994
- selectionOrder: v,
995
- setQuantity: P,
996
- bundleSize: I,
997
- minRequired: Y,
998
- canSubmit: H,
999
- submit: V,
1000
- submitAndCheckout: K
1001
- } = He(), [k, A] = j(!1), [D, Ce] = j(""), m = q(null), Se = q(null), te = q(null), [ae, ke] = j(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [ze, je] = j(0), [me, Z] = j(null), [Pe, Ie] = j(!1), X = q(null), J = q(I), Be = 7e3, [pe, ne] = j(0), [be, se] = j(null), [ce, _e] = j(!1), re = q(null), Me = 2800, Ae = [
1024
+ eligibleVariants: b,
1025
+ selections: Q,
1026
+ selectionOrder: x,
1027
+ setQuantity: M,
1028
+ bundleSize: B,
1029
+ minRequired: Z,
1030
+ canSubmit: L,
1031
+ submit: Y,
1032
+ submitAndCheckout: J
1033
+ } = He(), [k, F] = A(!1), [V, Ie] = A(""), m = W(null), pe = W(null), ie = W(null), [H, Pe] = A(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [ke, ze] = A(0), [be, te] = A(null), [Ae, Se] = A(!1), ee = W(null), ne = W(B), Be = 7e3, [_e, oe] = A(0), [we, ce] = A(null), [le, ye] = A(!1), ae = W(null), Ee = 2800, Re = [
1002
1034
  "#2563eb",
1003
1035
  "#3b82f6",
1004
1036
  "#60a5fa",
1005
1037
  "#93c5fd",
1006
1038
  "#bae6fd",
1007
1039
  "#e0f2fe"
1008
- ], d = O(() => {
1040
+ ], d = P(() => {
1009
1041
  var s;
1010
1042
  const a = (s = c == null ? void 0 : c.styleSettings) == null ? void 0 : s.confettiColors;
1011
1043
  return Array.isArray(a) && a.length >= 6 ? a.slice(0, 6).map(
1012
- (h, _) => typeof h == "string" && h.trim() ? h : Ae[_]
1013
- ) : [...Ae];
1014
- }, [(it = c == null ? void 0 : c.styleSettings) == null ? void 0 : it.confettiColors]), C = (a) => {
1044
+ (h, w) => typeof h == "string" && h.trim() ? h : Re[w]
1045
+ ) : [...Re];
1046
+ }, [(ot = c == null ? void 0 : c.styleSettings) == null ? void 0 : ot.confettiColors]), g = (a) => {
1015
1047
  const s = Number.parseFloat(a);
1016
1048
  return Number.isFinite(s) ? String(Math.round(s)) : a;
1017
- }, F = (a) => {
1049
+ }, E = (a) => {
1018
1050
  const s = (a ?? []).filter((h) => {
1019
- var S, x;
1020
- const _ = (S = h == null ? void 0 : h.name) == null ? void 0 : S.trim(), b = (x = h == null ? void 0 : h.value) == null ? void 0 : x.trim();
1021
- return !(!_ || !b || _.toLowerCase() === "title");
1051
+ var S, C;
1052
+ const w = (S = h == null ? void 0 : h.name) == null ? void 0 : S.trim(), _ = (C = h == null ? void 0 : h.value) == null ? void 0 : C.trim();
1053
+ return !(!w || !_ || w.toLowerCase() === "title");
1022
1054
  });
1023
1055
  return s.length ? s.map((h) => `${h.name}: ${h.value}`).join(" · ") : null;
1024
- }, g = (a) => {
1056
+ }, p = (a) => {
1025
1057
  var s;
1026
1058
  return ((s = a.product) == null ? void 0 : s.title) ?? a.displayName ?? a.title;
1027
- }, oe = (a) => {
1028
- const s = g(a), h = F(a.selectedOptions);
1059
+ }, R = (a) => {
1060
+ const s = p(a), h = E(a.selectedOptions);
1029
1061
  return [s, h].filter(Boolean).join(" — ");
1030
- }, [E, ye] = j(e), B = q(null), L = (a) => {
1062
+ }, [T, q] = A(e), I = W(null), D = (a) => {
1031
1063
  const s = Number(a);
1032
1064
  if (!Number.isFinite(s)) return a;
1033
1065
  if (u)
@@ -1036,173 +1068,173 @@ function yr(i) {
1036
1068
  } catch {
1037
1069
  }
1038
1070
  return `$${s.toFixed(2)}`;
1039
- }, G = ((at = c == null ? void 0 : c.title) == null ? void 0 : at.trim()) || "Build your bundle", le = O(() => {
1071
+ }, K = ((at = c == null ? void 0 : c.title) == null ? void 0 : at.trim()) || "Build your bundle", ue = P(() => {
1040
1072
  const a = Number((c == null ? void 0 : c.maxBundleSize) ?? NaN), s = Number.isFinite(a) ? Math.floor(a) : 100;
1041
1073
  return Math.max(2, Math.min(100, s));
1042
- }, [c == null ? void 0 : c.maxBundleSize]), we = I >= le, ue = O(() => [...p].sort((a, s) => a.displayName.localeCompare(s.displayName)), [p]), $ = O(() => {
1043
- const a = D.trim().toLowerCase();
1044
- if (!a) return ue;
1045
- const s = a.split(/\s+/).filter(Boolean), h = (_) => {
1046
- var x;
1047
- const b = [];
1048
- b.push(_.displayName), (x = _.product) != null && x.title && b.push(_.product.title);
1049
- for (const N of _.selectedOptions ?? [])
1050
- b.push(N.name), b.push(N.value);
1051
- const S = b.join(" ").toLowerCase();
1052
- return s.every((N) => S.includes(N));
1074
+ }, [c == null ? void 0 : c.maxBundleSize]), ge = B >= ue, de = P(() => [...b].sort((a, s) => a.displayName.localeCompare(s.displayName)), [b]), U = P(() => {
1075
+ const a = V.trim().toLowerCase();
1076
+ if (!a) return de;
1077
+ const s = a.split(/\s+/).filter(Boolean), h = (w) => {
1078
+ var C;
1079
+ const _ = [];
1080
+ _.push(w.displayName), (C = w.product) != null && C.title && _.push(w.product.title);
1081
+ for (const O of w.selectedOptions ?? [])
1082
+ _.push(O.name), _.push(O.value);
1083
+ const S = _.join(" ").toLowerCase();
1084
+ return s.every((O) => S.includes(O));
1053
1085
  };
1054
- return ue.filter(h);
1055
- }, [D, ue]), w = O(() => [...(c == null ? void 0 : c.rules) ?? []].sort((a, s) => a.minBundleSize - s.minBundleSize), [c == null ? void 0 : c.rules]), T = O(() => Math.max(0, Y - I), [I, Y]), y = O(() => {
1086
+ return de.filter(h);
1087
+ }, [V, de]), v = P(() => [...(c == null ? void 0 : c.rules) ?? []].sort((a, s) => a.minBundleSize - s.minBundleSize), [c == null ? void 0 : c.rules]), N = P(() => Math.max(0, Z - B), [B, Z]), y = P(() => {
1056
1088
  let a = null;
1057
- for (const s of w)
1058
- I >= s.minBundleSize && (a = s);
1089
+ for (const s of v)
1090
+ B >= s.minBundleSize && (a = s);
1059
1091
  return a;
1060
- }, [I, w]), R = O(() => {
1092
+ }, [B, v]), $ = P(() => {
1061
1093
  if (!y) return null;
1062
1094
  const a = Number.parseFloat(y.discountPercent);
1063
1095
  return !Number.isFinite(a) || a <= 0 ? null : a;
1064
- }, [y]), Fe = O(() => {
1065
- const a = w[0];
1096
+ }, [y]), je = P(() => {
1097
+ const a = v[0];
1066
1098
  if (!a) return null;
1067
1099
  const s = Number.parseFloat(a.discountPercent);
1068
1100
  return !Number.isFinite(s) || s <= 0 ? null : s;
1069
- }, [w]), ge = R ?? Fe, de = O(() => {
1070
- const a = new Map(p.map((h) => [h.id, h]));
1101
+ }, [v]), ve = $ ?? je, he = P(() => {
1102
+ const a = new Map(b.map((h) => [h.id, h]));
1071
1103
  let s = 0;
1072
- for (const [h, _] of Object.entries(W)) {
1073
- const b = _ ?? 0;
1074
- if (b <= 0) continue;
1075
- const S = a.get(h), x = Number(S == null ? void 0 : S.price);
1076
- Number.isFinite(x) && (s += x * b);
1104
+ for (const [h, w] of Object.entries(Q)) {
1105
+ const _ = w ?? 0;
1106
+ if (_ <= 0) continue;
1107
+ const S = a.get(h), C = Number(S == null ? void 0 : S.price);
1108
+ Number.isFinite(C) && (s += C * _);
1077
1109
  }
1078
1110
  return Math.round(s * 100) / 100;
1079
- }, [p, W]), wt = O(() => {
1080
- if (!R) return de;
1081
- const a = de * (1 - R / 100);
1111
+ }, [b, Q]), yt = P(() => {
1112
+ if (!$) return he;
1113
+ const a = he * (1 - $ / 100);
1082
1114
  return Math.round(a * 100) / 100;
1083
- }, [R, de]), Ze = O(() => w.length ? Math.max(...w.map((a) => a.minBundleSize)) : 0, [w]), Le = O(() => {
1084
- const a = new Map(p.map((s) => [s.id, s]));
1085
- return v.map((s) => a.get(s)).filter((s) => !!s);
1086
- }, [p, v]), gt = O(() => {
1115
+ }, [$, he]), Ze = P(() => v.length ? Math.max(...v.map((a) => a.minBundleSize)) : 0, [v]), Le = P(() => {
1116
+ const a = new Map(b.map((s) => [s.id, s]));
1117
+ return x.map((s) => a.get(s)).filter((s) => !!s);
1118
+ }, [b, x]), gt = P(() => {
1087
1119
  var s;
1088
1120
  const a = /* @__PURE__ */ new Map();
1089
- for (const h of w) {
1090
- const _ = Math.max(0, h.minBundleSize - 1);
1091
- a.set(_, {
1121
+ for (const h of v) {
1122
+ const w = Math.max(0, h.minBundleSize - 1);
1123
+ a.set(w, {
1092
1124
  discountPercent: h.discountPercent,
1093
1125
  minBundleSize: h.minBundleSize,
1094
1126
  label: ((s = h.label) == null ? void 0 : s.trim()) || `Buy ${h.minBundleSize}+`
1095
1127
  });
1096
1128
  }
1097
1129
  return a;
1098
- }, [w]), vt = O(() => Math.max(Ze || Y, Le.length), [Le.length, Ze, Y]), [$e, Je] = j(!0), et = q(T);
1099
- M(() => {
1130
+ }, [v]), vt = P(() => Math.max(Ze || Z, Le.length), [Le.length, Ze, Z]), [$e, Je] = A(!0), et = W(N);
1131
+ j(() => {
1100
1132
  if (((c == null ? void 0 : c.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
1101
1133
  const s = et.current > 0;
1102
- Je(!(s && T === 0));
1134
+ Je(!(s && N === 0));
1103
1135
  }
1104
- et.current = T;
1105
- }, [T, c == null ? void 0 : c.ctaButtonMode]);
1106
- const qe = q(null), tt = q(null), nt = q(null), rt = q(I), ot = (a) => {
1136
+ et.current = N;
1137
+ }, [N, c == null ? void 0 : c.ctaButtonMode]);
1138
+ const Ve = W(null), tt = W(null), nt = W(null), rt = W(B), it = (a) => {
1107
1139
  const s = tt.current;
1108
1140
  if (!s) return;
1109
1141
  const h = s.querySelector(`[data-variant-row="${a}"]`);
1110
1142
  if (!h) return;
1111
- const _ = s.getBoundingClientRect(), b = h.getBoundingClientRect(), S = 8;
1112
- if (b.top >= _.top + S && b.bottom <= _.bottom - S) return;
1113
- const N = Math.max(0, s.scrollHeight - s.clientHeight), Q = b.top - _.top + b.height / 2, ee = s.scrollTop + Q - s.clientHeight / 2, ie = Math.min(N, Math.max(0, ee));
1114
- s.scrollTo({ top: ie, behavior: "smooth" });
1143
+ const w = s.getBoundingClientRect(), _ = h.getBoundingClientRect(), S = 8;
1144
+ if (_.top >= w.top + S && _.bottom <= w.bottom - S) return;
1145
+ const O = Math.max(0, s.scrollHeight - s.clientHeight), X = _.top - w.top + _.height / 2, re = s.scrollTop + X - s.clientHeight / 2, se = Math.min(O, Math.max(0, re));
1146
+ s.scrollTo({ top: se, behavior: "smooth" });
1115
1147
  };
1116
- return M(() => {
1148
+ return j(() => {
1117
1149
  if (!e) return;
1118
1150
  const a = (s) => {
1119
1151
  s.key === "Escape" && t();
1120
1152
  };
1121
1153
  return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
1122
- }, [t, e]), M(() => {
1154
+ }, [t, e]), j(() => {
1123
1155
  if (typeof window > "u") return;
1124
- const a = () => ke({ width: window.innerWidth, height: window.innerHeight });
1156
+ const a = () => Pe({ width: window.innerWidth, height: window.innerHeight });
1125
1157
  return a(), window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
1126
- }, []), M(() => {
1127
- if (B.current != null && (window.clearTimeout(B.current), B.current = null), e) {
1128
- ye(!0);
1158
+ }, []), j(() => {
1159
+ if (I.current != null && (window.clearTimeout(I.current), I.current = null), e) {
1160
+ q(!0);
1129
1161
  return;
1130
1162
  }
1131
- B.current = window.setTimeout(() => {
1132
- ye(!1), B.current = null;
1163
+ I.current = window.setTimeout(() => {
1164
+ q(!1), I.current = null;
1133
1165
  }, 220);
1134
- }, [e]), M(() => () => {
1135
- B.current != null && window.clearTimeout(B.current);
1136
- }, []), M(() => () => {
1137
- X.current != null && window.clearTimeout(X.current);
1138
- }, []), M(() => () => {
1139
- re.current != null && window.clearTimeout(re.current);
1140
- }, []), M(() => {
1166
+ }, [e]), j(() => () => {
1167
+ I.current != null && window.clearTimeout(I.current);
1168
+ }, []), j(() => () => {
1169
+ ee.current != null && window.clearTimeout(ee.current);
1170
+ }, []), j(() => () => {
1171
+ ae.current != null && window.clearTimeout(ae.current);
1172
+ }, []), j(() => {
1141
1173
  if (!e || !k) return;
1142
1174
  const a = requestAnimationFrame(() => {
1143
1175
  var s;
1144
1176
  return (s = m.current) == null ? void 0 : s.focus();
1145
1177
  });
1146
1178
  return () => cancelAnimationFrame(a);
1147
- }, [e, k]), M(() => {
1179
+ }, [e, k]), j(() => {
1148
1180
  const a = rt.current;
1149
- if (rt.current = I, I <= a) return;
1181
+ if (rt.current = B, B <= a) return;
1150
1182
  const s = nt.current;
1151
1183
  if (!s) return;
1152
- const h = w.some((x) => x.minBundleSize === I), _ = w.find((x) => x.minBundleSize > I), b = _ && h ? _.minBundleSize - 1 : _ ? null : I - 1;
1153
- if (b == null || b < 0) return;
1184
+ const h = v.some((C) => C.minBundleSize === B), w = v.find((C) => C.minBundleSize > B), _ = w && h ? w.minBundleSize - 1 : w ? null : B - 1;
1185
+ if (_ == null || _ < 0) return;
1154
1186
  const S = requestAnimationFrame(() => {
1155
- const x = s.querySelector(`[data-box-slot="${b}"]`);
1156
- if (!x) return;
1157
- const N = s.getBoundingClientRect(), ee = x.getBoundingClientRect().right - N.right;
1158
- if (ee <= 1) return;
1159
- const ie = Math.max(0, s.scrollWidth - s.clientWidth), ve = Math.min(ie, Math.max(0, s.scrollLeft + ee));
1160
- s.scrollTo({ left: ve, behavior: "smooth" });
1187
+ const C = s.querySelector(`[data-box-slot="${_}"]`);
1188
+ if (!C) return;
1189
+ const O = s.getBoundingClientRect(), re = C.getBoundingClientRect().right - O.right;
1190
+ if (re <= 1) return;
1191
+ const se = Math.max(0, s.scrollWidth - s.clientWidth), xe = Math.min(se, Math.max(0, s.scrollLeft + re));
1192
+ s.scrollTo({ left: xe, behavior: "smooth" });
1161
1193
  });
1162
1194
  return () => cancelAnimationFrame(S);
1163
- }, [I, w]), M(() => {
1195
+ }, [B, v]), j(() => {
1164
1196
  if (!e) return;
1165
- const a = J.current;
1166
- if (J.current = I, I <= a) return;
1167
- const s = w.find((h) => h.minBundleSize === I);
1168
- s && (se(`You received a ${C(s.discountPercent)}% discount!`), ne((h) => h + 1), _e(!0), re.current != null && window.clearTimeout(re.current), re.current = window.setTimeout(() => {
1169
- _e(!1), re.current = null;
1170
- }, Me));
1171
- }, [I, e, w]), M(() => {
1172
- if (!e || !ce || !be) return;
1197
+ const a = ne.current;
1198
+ if (ne.current = B, B <= a) return;
1199
+ const s = v.find((h) => h.minBundleSize === B);
1200
+ s && (ce(`You received a ${g(s.discountPercent)}% discount!`), oe((h) => h + 1), ye(!0), ae.current != null && window.clearTimeout(ae.current), ae.current = window.setTimeout(() => {
1201
+ ye(!1), ae.current = null;
1202
+ }, Ee));
1203
+ }, [B, e, v]), j(() => {
1204
+ if (!e || !le || !we) return;
1173
1205
  const a = requestAnimationFrame(() => {
1174
- var N;
1175
- const s = te.current, h = s == null ? void 0 : s.getBoundingClientRect(), _ = (N = qe.current) == null ? void 0 : N.getBoundingClientRect(), b = h ? h.left + h.width / 2 : _ ? _.left + _.width / 2 : window.innerWidth / 2, S = h ? h.top + h.height / 2 : _ ? _.top + _.height / 2 : window.innerHeight / 2, x = {
1176
- x: b - 2,
1206
+ var O;
1207
+ const s = ie.current, h = s == null ? void 0 : s.getBoundingClientRect(), w = (O = Ve.current) == null ? void 0 : O.getBoundingClientRect(), _ = h ? h.left + h.width / 2 : w ? w.left + w.width / 2 : window.innerWidth / 2, S = h ? h.top + h.height / 2 : w ? w.top + w.height / 2 : window.innerHeight / 2, C = {
1208
+ x: _ - 2,
1177
1209
  y: S - 2,
1178
1210
  w: 4,
1179
1211
  h: 4
1180
1212
  };
1181
- Z(x), je((Q) => Q + 1), Ie(!0), X.current != null && window.clearTimeout(X.current), X.current = window.setTimeout(() => {
1182
- Ie(!1), X.current = null;
1213
+ te(C), ze((X) => X + 1), Se(!0), ee.current != null && window.clearTimeout(ee.current), ee.current = window.setTimeout(() => {
1214
+ Se(!1), ee.current = null;
1183
1215
  }, Be);
1184
1216
  });
1185
1217
  return () => cancelAnimationFrame(a);
1186
- }, [pe, be, Be, ce, e]), M(() => {
1218
+ }, [_e, we, Be, le, e]), j(() => {
1187
1219
  var a;
1188
- e && ((a = qe.current) == null || a.focus());
1189
- }, [e]), E ? /* @__PURE__ */ z(
1220
+ e && ((a = Ve.current) == null || a.focus());
1221
+ }, [e]), T ? /* @__PURE__ */ z(
1190
1222
  "div",
1191
1223
  {
1192
1224
  role: "dialog",
1193
1225
  "aria-modal": "true",
1194
1226
  "aria-label": "Bundle builder",
1195
- className: [l.backdrop, e ? l.backdropOpen : l.backdropClosed, i.className].filter(Boolean).join(" "),
1227
+ className: [l.backdrop, e ? l.backdropOpen : l.backdropClosed, o.className].filter(Boolean).join(" "),
1196
1228
  onMouseDown: (a) => {
1197
1229
  a.target === a.currentTarget && t();
1198
1230
  },
1199
1231
  children: [
1200
- Pe && me && ae.width > 0 && ae.height > 0 ? /* @__PURE__ */ f(
1232
+ Ae && be && H.width > 0 && H.height > 0 ? /* @__PURE__ */ f(
1201
1233
  Lt,
1202
1234
  {
1203
- width: ae.width,
1204
- height: ae.height,
1205
- confettiSource: me,
1235
+ width: H.width,
1236
+ height: H.height,
1237
+ confettiSource: be,
1206
1238
  colors: d,
1207
1239
  recycle: !1,
1208
1240
  numberOfPieces: 70,
@@ -1212,10 +1244,10 @@ function yr(i) {
1212
1244
  initialVelocityX: { min: -6, max: 6 },
1213
1245
  style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
1214
1246
  },
1215
- ze
1247
+ ke
1216
1248
  ) : null,
1217
- /* @__PURE__ */ z("aside", { ref: qe, className: [l.panel, e ? l.panelOpen : l.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1218
- ce && be ? /* @__PURE__ */ f("div", { className: l.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ f("div", { ref: te, className: l.celebrationChip, children: be }, pe) }) : null,
1249
+ /* @__PURE__ */ z("aside", { ref: Ve, className: [l.panel, e ? l.panelOpen : l.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1250
+ le && we ? /* @__PURE__ */ f("div", { className: l.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ f("div", { ref: ie, className: l.celebrationChip, children: we }, _e) }) : null,
1219
1251
  /* @__PURE__ */ z("header", { className: [l.header, k ? l.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1220
1252
  /* @__PURE__ */ f(
1221
1253
  "button",
@@ -1225,13 +1257,13 @@ function yr(i) {
1225
1257
  "aria-label": k ? "Search (expanded)" : "Search",
1226
1258
  "aria-expanded": k,
1227
1259
  onClick: () => {
1228
- A(!0);
1260
+ F(!0);
1229
1261
  },
1230
1262
  children: /* @__PURE__ */ f(Yt, { size: 18, "aria-hidden": "true" })
1231
1263
  }
1232
1264
  ),
1233
1265
  /* @__PURE__ */ z("div", { className: l.headerCenter, children: [
1234
- /* @__PURE__ */ f("div", { className: l.headerTitleWrap, "aria-hidden": k, children: /* @__PURE__ */ f("h2", { className: l.title, children: G }) }),
1266
+ /* @__PURE__ */ f("div", { className: l.headerTitleWrap, "aria-hidden": k, children: /* @__PURE__ */ f("h2", { className: l.title, children: K }) }),
1235
1267
  /* @__PURE__ */ f("div", { className: l.headerSearchWrap, "aria-hidden": !k, children: /* @__PURE__ */ z("div", { className: l.searchBar, children: [
1236
1268
  /* @__PURE__ */ f(
1237
1269
  "input",
@@ -1239,15 +1271,15 @@ function yr(i) {
1239
1271
  ref: m,
1240
1272
  className: l.searchInput,
1241
1273
  type: "search",
1242
- value: D,
1274
+ value: V,
1243
1275
  placeholder: "Search",
1244
- onChange: (a) => Ce(a.target.value),
1276
+ onChange: (a) => Ie(a.target.value),
1245
1277
  onBlur: () => {
1246
- D.trim() === "" && A(!1);
1278
+ V.trim() === "" && F(!1);
1247
1279
  }
1248
1280
  }
1249
1281
  ),
1250
- D.trim() ? /* @__PURE__ */ f(
1282
+ V.trim() ? /* @__PURE__ */ f(
1251
1283
  "button",
1252
1284
  {
1253
1285
  type: "button",
@@ -1257,7 +1289,7 @@ function yr(i) {
1257
1289
  },
1258
1290
  onClick: () => {
1259
1291
  var a;
1260
- Ce(""), (a = m.current) == null || a.focus();
1292
+ Ie(""), (a = m.current) == null || a.focus();
1261
1293
  },
1262
1294
  "aria-label": "Clear search",
1263
1295
  children: "Clear"
@@ -1268,11 +1300,11 @@ function yr(i) {
1268
1300
  /* @__PURE__ */ f("button", { type: "button", onClick: t, disabled: r, className: l.closeButton, "aria-label": "Close", children: "×" })
1269
1301
  ] }),
1270
1302
  /* @__PURE__ */ z("div", { className: l.body, ref: tt, children: [
1271
- o ? /* @__PURE__ */ f("p", { className: l.muted, children: "Loading…" }) : null,
1303
+ i ? /* @__PURE__ */ f("p", { className: l.muted, children: "Loading…" }) : null,
1272
1304
  n ? /* @__PURE__ */ f("p", { className: l.error, children: n }) : null,
1273
- /* @__PURE__ */ f("div", { className: l.variants, children: /* @__PURE__ */ f("ul", { className: l.variantList, children: $.map((a) => {
1274
- var ee, ie, ve, Te;
1275
- const s = W[a.id] ?? 0, h = g(a), _ = F(a.selectedOptions), b = oe(a), S = ge, x = Number(a.price), N = S != null && Number.isFinite(S) && S > 0 && Number.isFinite(x), Q = N ? Math.round(x * (1 - S / 100) * 100) / 100 : null;
1305
+ /* @__PURE__ */ f("div", { className: l.variants, children: /* @__PURE__ */ f("ul", { className: l.variantList, children: U.map((a) => {
1306
+ var re, se, xe, Ne;
1307
+ const s = Q[a.id] ?? 0, h = p(a), w = E(a.selectedOptions), _ = R(a), S = ve, C = Number(a.price), O = S != null && Number.isFinite(S) && S > 0 && Number.isFinite(C), X = O ? Math.round(C * (1 - S / 100) * 100) / 100 : null;
1276
1308
  return /* @__PURE__ */ z(
1277
1309
  "li",
1278
1310
  {
@@ -1280,27 +1312,27 @@ function yr(i) {
1280
1312
  "data-variant-row": a.id,
1281
1313
  children: [
1282
1314
  /* @__PURE__ */ z("div", { className: l.variantLeft, children: [
1283
- /* @__PURE__ */ f("div", { className: l.variantThumb, "aria-hidden": "true", children: (ee = a.image) != null && ee.url ? /* @__PURE__ */ f(
1315
+ /* @__PURE__ */ f("div", { className: l.variantThumb, "aria-hidden": "true", children: (re = a.image) != null && re.url ? /* @__PURE__ */ f(
1284
1316
  "img",
1285
1317
  {
1286
1318
  className: l.variantThumbImg,
1287
1319
  src: a.image.url,
1288
- alt: a.image.altText ?? b,
1320
+ alt: a.image.altText ?? _,
1289
1321
  loading: "lazy"
1290
1322
  }
1291
- ) : /* @__PURE__ */ f("div", { className: l.variantThumbFallback, children: ((Te = (ve = (ie = a.product) == null ? void 0 : ie.title) == null ? void 0 : ve.slice(0, 1)) == null ? void 0 : Te.toUpperCase()) ?? "•" }) }),
1323
+ ) : /* @__PURE__ */ f("div", { className: l.variantThumbFallback, children: ((Ne = (xe = (se = a.product) == null ? void 0 : se.title) == null ? void 0 : xe.slice(0, 1)) == null ? void 0 : Ne.toUpperCase()) ?? "•" }) }),
1292
1324
  /* @__PURE__ */ z("div", { className: l.variantInfo, children: [
1293
1325
  /* @__PURE__ */ f("div", { className: l.variantName, children: h }),
1294
- _ ? /* @__PURE__ */ f("div", { className: l.variantMeta, children: _ }) : null,
1326
+ w ? /* @__PURE__ */ f("div", { className: l.variantMeta, children: w }) : null,
1295
1327
  /* @__PURE__ */ z("div", { className: l.variantPriceRow, children: [
1296
- N ? /* @__PURE__ */ f("span", { className: l.variantCompareAt, children: L(Number.isFinite(x) ? x.toFixed(2) : a.price) }) : null,
1297
- /* @__PURE__ */ f("span", { className: l.variantPrice, children: L(
1298
- Q != null ? Q.toFixed(2) : Number.isFinite(x) ? x.toFixed(2) : a.price
1328
+ O ? /* @__PURE__ */ f("span", { className: l.variantCompareAt, children: D(Number.isFinite(C) ? C.toFixed(2) : a.price) }) : null,
1329
+ /* @__PURE__ */ f("span", { className: l.variantPrice, children: D(
1330
+ X != null ? X.toFixed(2) : Number.isFinite(C) ? C.toFixed(2) : a.price
1299
1331
  ) })
1300
1332
  ] })
1301
1333
  ] })
1302
1334
  ] }),
1303
- a.availableForSale === !1 ? /* @__PURE__ */ f("div", { className: l.soldOutContainer, children: /* @__PURE__ */ z("span", { className: l.soldOut, "aria-label": `${b} is sold out`, children: [
1335
+ a.availableForSale === !1 ? /* @__PURE__ */ f("div", { className: l.soldOutContainer, children: /* @__PURE__ */ z("span", { className: l.soldOut, "aria-label": `${_} is sold out`, children: [
1304
1336
  "Sold",
1305
1337
  /* @__PURE__ */ f("br", {}),
1306
1338
  "Out"
@@ -1308,10 +1340,10 @@ function yr(i) {
1308
1340
  "button",
1309
1341
  {
1310
1342
  type: "button",
1311
- onClick: () => P(a.id, 1),
1312
- disabled: r || we,
1343
+ onClick: () => M(a.id, 1),
1344
+ disabled: r || ge,
1313
1345
  className: l.addToBundleButton,
1314
- "aria-label": `Add ${b} to bundle`,
1346
+ "aria-label": `Add ${_} to bundle`,
1315
1347
  children: "Add"
1316
1348
  }
1317
1349
  ) : /* @__PURE__ */ z("div", { className: l.qtyControls, children: [
@@ -1319,10 +1351,10 @@ function yr(i) {
1319
1351
  "button",
1320
1352
  {
1321
1353
  type: "button",
1322
- onClick: () => P(a.id, s - 1),
1354
+ onClick: () => M(a.id, s - 1),
1323
1355
  disabled: r || s <= 0,
1324
1356
  className: l.qtyButton,
1325
- "aria-label": `Decrease ${b}`,
1357
+ "aria-label": `Decrease ${_}`,
1326
1358
  children: "−"
1327
1359
  }
1328
1360
  ),
@@ -1331,10 +1363,10 @@ function yr(i) {
1331
1363
  "button",
1332
1364
  {
1333
1365
  type: "button",
1334
- onClick: () => P(a.id, s + 1),
1335
- disabled: r || we,
1366
+ onClick: () => M(a.id, s + 1),
1367
+ disabled: r || ge,
1336
1368
  className: l.qtyButton,
1337
- "aria-label": `Increase ${b}`,
1369
+ "aria-label": `Increase ${_}`,
1338
1370
  children: "+"
1339
1371
  }
1340
1372
  )
@@ -1345,29 +1377,29 @@ function yr(i) {
1345
1377
  );
1346
1378
  }) }) })
1347
1379
  ] }),
1348
- /* @__PURE__ */ z("footer", { className: l.footer, ref: Se, children: [
1380
+ /* @__PURE__ */ z("footer", { className: l.footer, ref: pe, children: [
1349
1381
  /* @__PURE__ */ f("div", { className: l.boxSummaryWindow, ref: nt, children: /* @__PURE__ */ f("div", { className: l.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: vt }).map((a, s) => {
1350
- var ee, ie, ve, Te;
1351
- const h = Le[s], _ = gt.get(s), b = !!h, S = !!_, x = S && !b, N = _ ? `${_.discountPercent}% off` : null, Q = b ? h.displayName : `Slot ${s + 1}`;
1382
+ var re, se, xe, Ne;
1383
+ const h = Le[s], w = gt.get(s), _ = !!h, S = !!w, C = S && !_, O = w ? `${w.discountPercent}% off` : null, X = _ ? h.displayName : `Slot ${s + 1}`;
1352
1384
  return /* @__PURE__ */ z("div", { "data-box-slot": s, className: l.boxSlot, children: [
1353
1385
  /* @__PURE__ */ f(
1354
1386
  "div",
1355
1387
  {
1356
1388
  className: [
1357
1389
  l.boxItem,
1358
- b ? l.boxItemFilled : l.boxItemPlaceholder,
1390
+ _ ? l.boxItemFilled : l.boxItemPlaceholder,
1359
1391
  S ? l.boxItemThreshold : null,
1360
- b ? l.boxItemClickable : null
1392
+ _ ? l.boxItemClickable : null
1361
1393
  ].filter(Boolean).join(" "),
1362
- role: b ? "button" : void 0,
1363
- tabIndex: b ? 0 : void 0,
1364
- onClick: b ? () => ot(h.id) : void 0,
1365
- onKeyDown: b ? (Ue) => {
1366
- (Ue.key === "Enter" || Ue.key === " ") && (Ue.preventDefault(), ot(h.id));
1394
+ role: _ ? "button" : void 0,
1395
+ tabIndex: _ ? 0 : void 0,
1396
+ onClick: _ ? () => it(h.id) : void 0,
1397
+ onKeyDown: _ ? (qe) => {
1398
+ (qe.key === "Enter" || qe.key === " ") && (qe.preventDefault(), it(h.id));
1367
1399
  } : void 0,
1368
- "aria-label": x && N ? `${Q}. Unlocks ${N}.` : Q,
1369
- title: x && N ? `${Q} • Unlocks ${N}` : Q,
1370
- children: b ? (ee = h.image) != null && ee.url ? /* @__PURE__ */ f(
1400
+ "aria-label": C && O ? `${X}. Unlocks ${O}.` : X,
1401
+ title: C && O ? `${X} • Unlocks ${O}` : X,
1402
+ children: _ ? (re = h.image) != null && re.url ? /* @__PURE__ */ f(
1371
1403
  "img",
1372
1404
  {
1373
1405
  className: l.boxItemImage,
@@ -1375,39 +1407,39 @@ function yr(i) {
1375
1407
  alt: h.image.altText ?? h.displayName,
1376
1408
  loading: "lazy"
1377
1409
  }
1378
- ) : /* @__PURE__ */ f("div", { className: l.boxItemFallback, "aria-hidden": "true", children: ((Te = (ve = (ie = h.product) == null ? void 0 : ie.title) == null ? void 0 : ve.slice(0, 1)) == null ? void 0 : Te.toUpperCase()) ?? "•" }) : x && N ? /* @__PURE__ */ f("div", { className: l.boxItemDiscountText, children: N }) : /* @__PURE__ */ f("div", { className: l.boxItemPlus, "aria-hidden": "true", children: "+" })
1410
+ ) : /* @__PURE__ */ f("div", { className: l.boxItemFallback, "aria-hidden": "true", children: ((Ne = (xe = (se = h.product) == null ? void 0 : se.title) == null ? void 0 : xe.slice(0, 1)) == null ? void 0 : Ne.toUpperCase()) ?? "•" }) : C && O ? /* @__PURE__ */ f("div", { className: l.boxItemDiscountText, children: O }) : /* @__PURE__ */ f("div", { className: l.boxItemPlus, "aria-hidden": "true", children: "+" })
1379
1411
  }
1380
1412
  ),
1381
- S ? /* @__PURE__ */ f("div", { className: l.boxThresholdLabel, children: _.label }) : null
1413
+ S ? /* @__PURE__ */ f("div", { className: l.boxThresholdLabel, children: w.label }) : null
1382
1414
  ] }, s);
1383
1415
  }) }) }),
1384
1416
  /* @__PURE__ */ f(
1385
1417
  "div",
1386
1418
  {
1387
- className: [l.ctaTotalsWrap, T <= 0 ? l.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1388
- "aria-hidden": T > 0,
1419
+ className: [l.ctaTotalsWrap, N <= 0 ? l.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1420
+ "aria-hidden": N > 0,
1389
1421
  children: /* @__PURE__ */ z("div", { className: l.ctaTotals, "aria-label": "Totals", children: [
1390
- ge ? /* @__PURE__ */ z("span", { className: l.ctaDiscountBadge, children: [
1391
- ge,
1422
+ ve ? /* @__PURE__ */ z("span", { className: l.ctaDiscountBadge, children: [
1423
+ ve,
1392
1424
  "% Discount"
1393
1425
  ] }) : /* @__PURE__ */ f("span", {}),
1394
- /* @__PURE__ */ f("span", { children: R ? /* @__PURE__ */ z(xt, { children: [
1395
- /* @__PURE__ */ f("span", { className: l.ctaTotalsStrike, children: L(de.toFixed(2)) }),
1426
+ /* @__PURE__ */ f("span", { children: $ ? /* @__PURE__ */ z(xt, { children: [
1427
+ /* @__PURE__ */ f("span", { className: l.ctaTotalsStrike, children: D(he.toFixed(2)) }),
1396
1428
  " ",
1397
- /* @__PURE__ */ f("span", { className: l.ctaTotalsPrice, children: L(wt.toFixed(2)) })
1398
- ] }) : /* @__PURE__ */ f("span", { className: l.ctaTotalsPrice, children: L(de.toFixed(2)) }) })
1429
+ /* @__PURE__ */ f("span", { className: l.ctaTotalsPrice, children: D(yt.toFixed(2)) })
1430
+ ] }) : /* @__PURE__ */ f("span", { className: l.ctaTotalsPrice, children: D(he.toFixed(2)) }) })
1399
1431
  ] })
1400
1432
  }
1401
1433
  ),
1402
1434
  (() => {
1403
1435
  const a = (c == null ? void 0 : c.ctaButtonMode) || "add_to_cart";
1404
- return a === "add_to_cart_checkout" ? T > 0 ? /* @__PURE__ */ f("button", { type: "button", onClick: V, disabled: !H, className: l.cta, children: r ? "Adding…" : `Add ${T} more product${T === 1 ? "" : "s"}` }) : /* @__PURE__ */ z("div", { className: `${l.ctaButtonGroup} ${$e ? l.ctaButtonGroupAnimating : ""}`, children: [
1436
+ return a === "add_to_cart_checkout" ? N > 0 ? /* @__PURE__ */ f("button", { type: "button", onClick: Y, disabled: !L, className: l.cta, children: r ? "Adding…" : `Add ${N} more product${N === 1 ? "" : "s"}` }) : /* @__PURE__ */ z("div", { className: `${l.ctaButtonGroup} ${$e ? l.ctaButtonGroupAnimating : ""}`, children: [
1405
1437
  /* @__PURE__ */ f(
1406
1438
  "button",
1407
1439
  {
1408
1440
  type: "button",
1409
- onClick: V,
1410
- disabled: !H,
1441
+ onClick: Y,
1442
+ disabled: !L,
1411
1443
  className: `${l.ctaDualLeft} ${$e ? l.ctaDualLeftAnimating : ""}`,
1412
1444
  children: /* @__PURE__ */ f("span", { children: r ? "Adding…" : "Add to Basket" })
1413
1445
  }
@@ -1416,13 +1448,13 @@ function yr(i) {
1416
1448
  "button",
1417
1449
  {
1418
1450
  type: "button",
1419
- onClick: K,
1420
- disabled: !H,
1451
+ onClick: J,
1452
+ disabled: !L,
1421
1453
  className: `${l.ctaDualRight} ${$e ? l.ctaDualRightAnimating : ""}`,
1422
1454
  children: /* @__PURE__ */ f("span", { children: r ? "Processing…" : "Checkout" })
1423
1455
  }
1424
1456
  )
1425
- ] }) : a === "checkout" ? /* @__PURE__ */ f("button", { type: "button", onClick: K, disabled: !H, className: l.cta, children: r ? "Processing…" : T > 0 ? `Add ${T} more product${T === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ f("button", { type: "button", onClick: V, disabled: !H, className: l.cta, children: r ? "Adding…" : T > 0 ? `Add ${T} more product${T === 1 ? "" : "s"}` : "Add to Basket" });
1457
+ ] }) : a === "checkout" ? /* @__PURE__ */ f("button", { type: "button", onClick: J, disabled: !L, className: l.cta, children: r ? "Processing…" : N > 0 ? `Add ${N} more product${N === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ f("button", { type: "button", onClick: Y, disabled: !L, className: l.cta, children: r ? "Adding…" : N > 0 ? `Add ${N} more product${N === 1 ? "" : "s"}` : "Add to Basket" });
1426
1458
  })(),
1427
1459
  /* @__PURE__ */ z("div", { className: l.poweredBy, children: [
1428
1460
  "powered by ",
@@ -1434,19 +1466,19 @@ function yr(i) {
1434
1466
  }
1435
1467
  ) : null;
1436
1468
  }
1437
- function Qe(i) {
1438
- if (i != null && i.length)
1439
- return i.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
1469
+ function Qe(o) {
1470
+ if (o != null && o.length)
1471
+ return o.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
1440
1472
  }
1441
- function pt(i) {
1442
- const e = /\/(\d+)$/.exec(i);
1443
- return e ? e[1] : i;
1473
+ function pt(o) {
1474
+ const e = /\/(\d+)$/.exec(o);
1475
+ return e ? e[1] : o;
1444
1476
  }
1445
1477
  function hr() {
1446
1478
  window.location.reload();
1447
1479
  }
1448
- async function De(i, e) {
1449
- const t = await fetch(i, {
1480
+ async function Fe(o, e) {
1481
+ const t = await fetch(o, {
1450
1482
  method: "POST",
1451
1483
  headers: {
1452
1484
  Accept: "application/json",
@@ -1455,40 +1487,40 @@ async function De(i, e) {
1455
1487
  body: JSON.stringify(e)
1456
1488
  });
1457
1489
  if (!t.ok) {
1458
- const o = await t.text().catch(() => "");
1459
- throw new Error(o || `Cart request failed: ${t.status}`);
1490
+ const i = await t.text().catch(() => "");
1491
+ throw new Error(i || `Cart request failed: ${t.status}`);
1460
1492
  }
1461
1493
  return t.json().catch(() => null);
1462
1494
  }
1463
- function wr() {
1495
+ function yr() {
1464
1496
  return {
1465
- async linesAdd(i) {
1466
- const e = i.map((t) => ({
1497
+ async linesAdd(o) {
1498
+ const e = o.map((t) => ({
1467
1499
  id: pt(t.merchandiseId),
1468
1500
  quantity: t.quantity,
1469
1501
  properties: Qe(t.attributes)
1470
1502
  }));
1471
- await De("/cart/add.js", { items: e });
1503
+ await Fe("/cart/add.js", { items: e });
1472
1504
  },
1473
- async linesAddForCheckout(i) {
1474
- const e = i.map((t) => ({
1505
+ async linesAddForCheckout(o) {
1506
+ const e = o.map((t) => ({
1475
1507
  id: pt(t.merchandiseId),
1476
1508
  quantity: t.quantity,
1477
1509
  properties: Qe(t.attributes)
1478
1510
  }));
1479
- await De("/cart/add.js", { items: e });
1511
+ await Fe("/cart/add.js", { items: e });
1480
1512
  },
1481
- async linesUpdate(i) {
1482
- for (const e of i)
1483
- await De("/cart/change.js", {
1513
+ async linesUpdate(o) {
1514
+ for (const e of o)
1515
+ await Fe("/cart/change.js", {
1484
1516
  id: e.id,
1485
1517
  quantity: e.quantity,
1486
1518
  properties: Qe(e.attributes)
1487
1519
  });
1488
1520
  },
1489
- async linesRemove(i) {
1490
- for (const e of i)
1491
- await De("/cart/change.js", { id: e, quantity: 0 });
1521
+ async linesRemove(o) {
1522
+ for (const e of o)
1523
+ await Fe("/cart/change.js", { id: e, quantity: 0 });
1492
1524
  },
1493
1525
  openCartUI() {
1494
1526
  window.setTimeout(() => hr(), 0);
@@ -1499,11 +1531,11 @@ function wr() {
1499
1531
  };
1500
1532
  }
1501
1533
  export {
1502
- yr as BundleBuilderDrawer,
1534
+ wr as BundleBuilderDrawer,
1503
1535
  _r as BundleButton,
1504
- Re as BundleLineAttributeKeys,
1536
+ Me as BundleLineAttributeKeys,
1505
1537
  pr as BundleProvider,
1506
- wr as createLiquidCartAdapter,
1538
+ yr as createLiquidCartAdapter,
1507
1539
  He as useBundleBuilder,
1508
1540
  br as useBundleBuilderDrawer
1509
1541
  };