@best-bundles/bundle-ui 0.0.16 → 0.0.17

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,56 +1,56 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.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_364yo_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 9999);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_364yo_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_364yo_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:#0b1b44;background:linear-gradient(180deg,#fff,#bae6fd);border:2px solid 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_364yo_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_364yo_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_364yo_74{opacity:1}._backdropClosed_364yo_78{opacity:0}._panel_364yo_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_364yo_102{animation:_bbSlideInFromRight_364yo_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_364yo_106{animation:_bbSlideOutToRight_364yo_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_364yo_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_364yo_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_364yo_1{transition:none}._celebrationChip_364yo_23,._panelOpen_364yo_102,._panelClosed_364yo_106{animation:none}}._header_364yo_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_364yo_154{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_364yo_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_364yo_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_364yo_171:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_364yo_171:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_364yo_193{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_364yo_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_364yo_209 ._headerTitleWrap_364yo_193{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_364yo_209 ._headerSearchWrap_364yo_197{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_364yo_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_364yo_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_364yo_233::-webkit-search-cancel-button,._searchInput_364yo_233::-webkit-search-decoration,._searchInput_364yo_233::-webkit-search-results-button,._searchInput_364yo_233::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_364yo_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_364yo_254:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_364yo_254:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_364yo_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_364yo_276:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_364yo_276:disabled{opacity:.6;cursor:not-allowed}._closeButton_364yo_276:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_364yo_193,._headerSearchWrap_364yo_197{transition:none}}._body_364yo_309{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_364yo_314{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_364yo_319{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_364yo_324{margin-top:4px}._variantList_364yo_328{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_364yo_336{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantLeft_364yo_344{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_364yo_351{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_364yo_351:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_364yo_351:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_364yo_351:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._variantThumb_364yo_379{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_364yo_389{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_364yo_396{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_364yo_406{min-width:0}._variantName_364yo_410{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_364yo_419{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_364yo_427{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_364yo_434{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_364yo_427{font-size:13px;font-weight:800}._qtyControls_364yo_445{display:inline-flex;align-items:center;gap:6px}._qtyButton_364yo_451{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_364yo_451:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_364yo_451:disabled{opacity:.6;cursor:not-allowed}._qtyButton_364yo_451:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_364yo_476{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_364yo_483{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_364yo_490{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_364yo_490 a{color:inherit;text-decoration:none}._boxSummaryWindow_364yo_502{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_364yo_502::-webkit-scrollbar{display:none}._boxSummaryRow_364yo_519{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_364yo_527{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_364yo_535{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_364yo_547{cursor:pointer}._boxItemClickable_364yo_547:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_364yo_556{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:nowrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_364yo_567{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_364yo_573{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_364yo_579{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:linear-gradient(180deg,#2563eb1a,#2563eb08);color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemDiscountText_364yo_587{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_364yo_595{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_364yo_602{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_364yo_609{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}._cta_364yo_620{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}._ctaTotals_364yo_632{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_364yo_640{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_364yo_654{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_364yo_667{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_364yo_674{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_364yo_681{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_364yo_654{transition:none}}._cta_364yo_620:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_364yo_620:disabled{opacity:.6;cursor:not-allowed}._cta_364yo_620:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_364yo_706{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_364yo_1{padding:0;justify-content:stretch}._panel_364yo_82{width:100%;height:100%;border-radius:0}}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { jsx as h, jsxs as R, Fragment as lt } from "react/jsx-runtime";
3
- import Ae, { useState as O, useRef as V, useEffect as j, useCallback as be, useMemo as N, createContext as ut, useContext as dt, forwardRef as rt, createElement as ze } from "react";
4
- const ke = {
1
+ (function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.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_vl21a_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 9999);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_vl21a_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_vl21a_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:#0b1b44;background:linear-gradient(180deg,#fff,#bae6fd);border:2px solid 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_vl21a_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_vl21a_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_vl21a_74{opacity:1}._backdropClosed_vl21a_78{opacity:0}._panel_vl21a_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_vl21a_102{animation:_bbSlideInFromRight_vl21a_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_vl21a_106{animation:_bbSlideOutToRight_vl21a_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_vl21a_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_vl21a_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_vl21a_1{transition:none}._celebrationChip_vl21a_23,._panelOpen_vl21a_102,._panelClosed_vl21a_106{animation:none}}._header_vl21a_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_vl21a_154{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_vl21a_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_vl21a_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_vl21a_171:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_vl21a_171:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_vl21a_193{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_vl21a_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_vl21a_209 ._headerTitleWrap_vl21a_193{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_vl21a_209 ._headerSearchWrap_vl21a_197{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_vl21a_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_vl21a_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_vl21a_233::-webkit-search-cancel-button,._searchInput_vl21a_233::-webkit-search-decoration,._searchInput_vl21a_233::-webkit-search-results-button,._searchInput_vl21a_233::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_vl21a_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_vl21a_254:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_vl21a_254:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_vl21a_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_vl21a_276:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_vl21a_276:disabled{opacity:.6;cursor:not-allowed}._closeButton_vl21a_276:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_vl21a_193,._headerSearchWrap_vl21a_197{transition:none}}._body_vl21a_309{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_vl21a_314{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_vl21a_319{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_vl21a_324{margin-top:4px}._variantList_vl21a_328{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_vl21a_336{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantLeft_vl21a_344{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_vl21a_351{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_vl21a_351:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_vl21a_351:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_vl21a_351:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._variantThumb_vl21a_379{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_vl21a_389{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_vl21a_396{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_vl21a_406{min-width:0}._variantName_vl21a_410{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_vl21a_419{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_vl21a_427{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_vl21a_434{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_vl21a_427{font-size:13px;font-weight:800}._qtyControls_vl21a_445{display:inline-flex;align-items:center;gap:6px}._qtyButton_vl21a_451{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_vl21a_451:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_vl21a_451:disabled{opacity:.6;cursor:not-allowed}._qtyButton_vl21a_451:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_vl21a_476{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_vl21a_483{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_vl21a_490{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_vl21a_490 a{color:inherit;text-decoration:none}._boxSummaryWindow_vl21a_502{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_vl21a_502::-webkit-scrollbar{display:none}._boxSummaryRow_vl21a_519{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_vl21a_527{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_vl21a_535{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_vl21a_547{cursor:pointer}._boxItemClickable_vl21a_547:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_vl21a_556{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:nowrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_vl21a_567{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_vl21a_573{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_vl21a_579{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:linear-gradient(180deg,#2563eb1a,#2563eb08);color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemDiscountText_vl21a_587{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_vl21a_595{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_vl21a_602{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_vl21a_609{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_vl21a_620{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_vl21a_627{gap:0}._cta_vl21a_620{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_vl21a_643{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_vl21a_655{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_vl21a_673{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_vl21a_673>span{opacity:0}._ctaDualRight_vl21a_686{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_vl21a_702{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_vl21a_702>span{opacity:0}._ctaTotals_vl21a_713{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_vl21a_721{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_vl21a_735{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_vl21a_748{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_vl21a_755{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_vl21a_762{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_vl21a_735{transition:none}}._cta_vl21a_620:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_vl21a_620:disabled{opacity:.6;cursor:not-allowed}._cta_vl21a_620:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_vl21a_643:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_vl21a_643:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_vl21a_643:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_vl21a_655:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_vl21a_655:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_vl21a_655:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_vl21a_686:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_vl21a_686:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_vl21a_686:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_vl21a_831{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_vl21a_1{padding:0;justify-content:stretch}._panel_vl21a_82{width:100%;height:100%;border-radius:0}}')),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { jsx as h, jsxs as k, Fragment as fe } from "react/jsx-runtime";
3
+ import Ft, { useState as O, useRef as U, useEffect as z, useCallback as dt, useMemo as M, createContext as me, useContext as pe, forwardRef as se, createElement as Vt } from "react";
4
+ const kt = {
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 ht(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 be(i) {
11
+ const t = new URL("/api/public/bundle-config", i.apiBaseUrl);
12
+ t.searchParams.set("shop", i.shop);
13
+ const a = await (await fetch(t, {
14
14
  method: "GET",
15
15
  signal: i.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 !a || typeof a != "object" ? { ok: !1, error: "Invalid response." } : a;
19
19
  }
20
- const Je = "bb_anonymous_user_id";
21
- function Fe() {
20
+ const ne = "bb_anonymous_user_id";
21
+ function At() {
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(Je);
25
+ const i = localStorage.getItem(ne);
26
26
  if (i && typeof i == "string" && i.length > 0)
27
27
  return i;
28
- let e;
28
+ let t;
29
29
  try {
30
- const t = globalThis.crypto;
31
- if (t != null && t.randomUUID)
32
- e = t.randomUUID();
30
+ const e = globalThis.crypto;
31
+ if (e != null && e.randomUUID)
32
+ t = e.randomUUID();
33
33
  else
34
34
  throw new Error("crypto.randomUUID not available");
35
35
  } catch {
36
- e = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
36
+ t = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
37
37
  }
38
- return localStorage.setItem(Je, e), e;
38
+ return localStorage.setItem(ne, t), t;
39
39
  } catch {
40
40
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
41
41
  }
42
42
  }
43
- async function Re(i, e, t) {
43
+ async function Rt(i, t, e) {
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 a = new URL(i, window.location.origin);
47
+ a.searchParams.set("shop", t);
48
+ const r = await fetch(a, {
49
49
  method: "POST",
50
50
  headers: {
51
51
  "Content-Type": "application/json"
52
52
  },
53
- body: JSON.stringify(t),
53
+ body: JSON.stringify(e),
54
54
  // Don't wait for response - fire and forget
55
55
  keepalive: !0
56
56
  });
@@ -58,12 +58,12 @@ async function Re(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 (a) {
62
+ console.warn("[Bundle Analytics] Failed to track event:", a);
63
63
  }
64
64
  }
65
- const ot = ut(null);
66
- function ft() {
65
+ const ce = me(null);
66
+ function ve() {
67
67
  try {
68
68
  const i = globalThis.crypto;
69
69
  if (i != null && i.randomUUID) return i.randomUUID();
@@ -71,438 +71,450 @@ function ft() {
71
71
  }
72
72
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
73
73
  }
74
- function Ze(i) {
74
+ function re(i) {
75
75
  return Number.isFinite(i) ? Math.max(0, Math.floor(i)) : 0;
76
76
  }
77
- function Yn(i) {
77
+ function rr(i) {
78
78
  const {
79
- apiBaseUrl: e,
80
- shop: t,
81
- cartAdapter: o,
79
+ apiBaseUrl: t,
80
+ shop: e,
81
+ cartAdapter: a,
82
82
  configHandle: r = "default",
83
83
  initialData: n,
84
84
  configFetcher: l,
85
85
  analyticsEndpoint: c,
86
- children: f
87
- } = i, v = c ?? `${e}/api/public/bundle-analytics`, [P, k] = O(!1), [x, X] = O(!n), [J, re] = O(!1), [M, q] = O(null), [T, Z] = O((n == null ? void 0 : n.currencyCode) ?? null), [g, we] = O((n == null ? void 0 : n.config) ?? null), [ee, oe] = O(
86
+ children: m
87
+ } = i, w = c ?? `${t}/api/public/bundle-analytics`, [A, R] = O(!1), [x, J] = O(!n), [E, H] = O(!1), [L, P] = O(null), [F, V] = O((n == null ? void 0 : n.currencyCode) ?? null), [g, ft] = O((n == null ? void 0 : n.config) ?? null), [st, wt] = O(
88
88
  (n == null ? void 0 : n.eligibleVariants) ?? []
89
- ), [Ne, Te] = O(
89
+ ), [mt, St] = O(
90
90
  () => ({ selections: {}, order: [] })
91
- ), Me = V(null);
92
- j(() => {
93
- var A;
91
+ ), Nt = U(null);
92
+ z(() => {
93
+ var D;
94
94
  if (n) return;
95
- (A = Me.current) == null || A.abort();
96
- const y = new AbortController();
97
- Me.current = y;
98
- const C = l ?? ht;
99
- return X(!0), q(null), C({ apiBaseUrl: e, shop: t, signal: y.signal }).then((_) => {
100
- if (!_.ok) {
101
- q(_.error || "Failed to load bundle config."), we(null), oe([]), Z(null);
95
+ (D = Nt.current) == null || D.abort();
96
+ const f = new AbortController();
97
+ Nt.current = f;
98
+ const C = l ?? be;
99
+ return J(!0), P(null), C({ apiBaseUrl: t, shop: e, signal: f.signal }).then((y) => {
100
+ if (!y.ok) {
101
+ P(y.error || "Failed to load bundle config."), ft(null), wt([]), V(null);
102
102
  return;
103
103
  }
104
- Z(_.currencyCode ?? null), we(_.config), oe(_.eligibleVariants ?? []);
105
- }).catch((_) => {
106
- const D = _ instanceof Error ? _.message : "Failed to load bundle config.";
107
- q(D), we(null), oe([]), Z(null);
108
- }).finally(() => X(!1)), () => y.abort();
109
- }, [e, t, n, l]);
110
- const _e = be(() => {
111
- if (k(!0), v)
104
+ V(y.currencyCode ?? null), ft(y.config), wt(y.eligibleVariants ?? []);
105
+ }).catch((y) => {
106
+ const rt = y instanceof Error ? y.message : "Failed to load bundle config.";
107
+ P(rt), ft(null), wt([]), V(null);
108
+ }).finally(() => J(!1)), () => f.abort();
109
+ }, [t, e, n, l]);
110
+ const Tt = dt(() => {
111
+ if (R(!0), w)
112
112
  try {
113
- const y = Fe();
114
- Re(v, t, {
113
+ const f = At();
114
+ Rt(w, e, {
115
115
  eventType: "DRAWER_OPENED",
116
- shop: t,
117
- anonymousUserId: y,
116
+ shop: e,
117
+ anonymousUserId: f,
118
118
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
119
119
  }).catch((C) => {
120
120
  console.warn("[Bundle Analytics] Failed to track drawer opened:", C);
121
121
  });
122
- } catch (y) {
123
- console.warn("[Bundle Analytics] Error in open() callback:", y);
122
+ } catch (f) {
123
+ console.warn("[Bundle Analytics] Error in open() callback:", f);
124
124
  }
125
- }, [v, t]), me = be(() => k(!1), []), Oe = be(() => {
126
- k((y) => {
127
- if (!y && v)
125
+ }, [w, e]), pt = dt(() => R(!1), []), Mt = dt(() => {
126
+ R((f) => {
127
+ if (!f && w)
128
128
  try {
129
- const C = Fe();
130
- Re(v, t, {
129
+ const C = At();
130
+ Rt(w, e, {
131
131
  eventType: "DRAWER_OPENED",
132
- shop: t,
132
+ shop: e,
133
133
  anonymousUserId: C,
134
134
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
135
- }).catch((A) => {
136
- console.warn("[Bundle Analytics] Failed to track drawer opened:", A);
135
+ }).catch((D) => {
136
+ console.warn("[Bundle Analytics] Failed to track drawer opened:", D);
137
137
  });
138
138
  } catch (C) {
139
139
  console.warn("[Bundle Analytics] Error in toggle() callback:", C);
140
140
  }
141
- return !y;
141
+ return !f;
142
142
  });
143
- }, [v, t]), ve = N(() => {
144
- const y = Number((g == null ? void 0 : g.maxBundleSize) ?? NaN), C = Number.isFinite(y) ? Math.floor(y) : 100;
143
+ }, [w, e]), Pt = M(() => {
144
+ const f = Number((g == null ? void 0 : g.maxBundleSize) ?? NaN), C = Number.isFinite(f) ? Math.floor(f) : 100;
145
145
  return Math.max(2, Math.min(100, C));
146
- }, [g == null ? void 0 : g.maxBundleSize]), Q = N(() => new Set(ee.map((y) => y.id)), [ee]), ge = be((y, C) => {
147
- if (!Q.has(y))
146
+ }, [g == null ? void 0 : g.maxBundleSize]), bt = M(() => new Set(st.map((f) => f.id)), [st]), tt = dt((f, C) => {
147
+ if (!bt.has(f))
148
148
  return;
149
- const A = Ze(C);
150
- Te((_) => {
151
- const D = _.selections[y] ?? 0, he = A - D, E = Object.values(_.selections).reduce((z, L) => z + (L || 0), 0), F = he > 0 ? Math.min(he, Math.max(0, ve - E)) : he, $ = D + F;
152
- let G;
153
- if ($ <= 0) {
154
- const { [y]: z, ...L } = _.selections;
155
- G = L;
156
- } else D === $ ? G = _.selections : G = { ..._.selections, [y]: $ };
157
- let se = _.order;
158
- if (F > 0)
159
- se = [..._.order, ...Array.from({ length: F }, () => y)];
160
- else if (F < 0) {
161
- let z = -F;
162
- const L = [];
163
- for (let ce = _.order.length - 1; ce >= 0; ce--) {
164
- const B = _.order[ce];
165
- if (B === y && z > 0) {
166
- z--;
149
+ const D = re(C);
150
+ St((y) => {
151
+ const rt = y.selections[f] ?? 0, q = D - rt, G = Object.values(y.selections).reduce(($, Y) => $ + (Y || 0), 0), B = q > 0 ? Math.min(q, Math.max(0, Pt - G)) : q, at = rt + B;
152
+ let Q;
153
+ if (at <= 0) {
154
+ const { [f]: $, ...Y } = y.selections;
155
+ Q = Y;
156
+ } else rt === at ? Q = y.selections : Q = { ...y.selections, [f]: at };
157
+ let it = y.order;
158
+ if (B > 0)
159
+ it = [...y.order, ...Array.from({ length: B }, () => f)];
160
+ else if (B < 0) {
161
+ let $ = -B;
162
+ const Y = [];
163
+ for (let T = y.order.length - 1; T >= 0; T--) {
164
+ const S = y.order[T];
165
+ if (S === f && $ > 0) {
166
+ $--;
167
167
  continue;
168
168
  }
169
- L.push(B);
169
+ Y.push(S);
170
170
  }
171
- L.reverse(), se = L;
171
+ Y.reverse(), it = Y;
172
172
  }
173
- if (G === _.selections && se === _.order) return _;
174
- if (v)
173
+ if (Q === y.selections && it === y.order) return y;
174
+ if (w)
175
175
  try {
176
- const z = Fe();
177
- Re(v, t, {
176
+ const $ = At();
177
+ Rt(w, e, {
178
178
  eventType: "VARIANT_SELECTION_CHANGED",
179
- shop: t,
180
- anonymousUserId: z,
181
- before: { ..._.selections },
182
- after: { ...G },
179
+ shop: e,
180
+ anonymousUserId: $,
181
+ before: { ...y.selections },
182
+ after: { ...Q },
183
183
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
184
184
  });
185
185
  } catch {
186
186
  }
187
- return { selections: G, order: se };
187
+ return { selections: Q, order: it };
188
188
  });
189
- }, [ve, Q, v, t]), de = be(() => Te({ selections: {}, order: [] }), []), K = Ne.selections, Pe = Ne.order, Y = N(() => Object.values(K).reduce((y, C) => y + (C || 0), 0), [K]), pe = N(() => {
190
- const y = (g == null ? void 0 : g.rules) ?? [], C = y.length ? Math.min(...y.map((A) => A.minBundleSize)) : 2;
189
+ }, [Pt, bt, w, e]), vt = dt(() => St({ selections: {}, order: [] }), []), X = mt.selections, xt = mt.order, ct = M(() => Object.values(X).reduce((f, C) => f + (C || 0), 0), [X]), et = M(() => {
190
+ const f = (g == null ? void 0 : g.rules) ?? [], C = f.length ? Math.min(...f.map((D) => D.minBundleSize)) : 2;
191
191
  return Number.isFinite(C) && C > 0 ? C : 2;
192
- }, [g]), ie = N(() => !(x || J || M || !(g != null && g.isActive) || Y < pe), [Y, g == null ? void 0 : g.isActive, M, x, pe, J]), xe = be(async () => {
193
- var ce, B;
194
- if (!ie || !g) return;
195
- const y = ft(), C = (g.title ?? "").trim().slice(0, 255), A = Object.entries(K).map(([b, te]) => ({ merchandiseId: b, quantity: Ze(te) })).filter((b) => b.quantity > 0).filter((b) => Q.has(b.merchandiseId)).map((b) => ({
196
- merchandiseId: b.merchandiseId,
197
- quantity: b.quantity,
192
+ }, [g]), gt = M(() => !(x || E || L || !(g != null && g.isActive) || ct < et), [ct, g == null ? void 0 : g.isActive, L, x, et, E]), lt = dt(async (f) => {
193
+ var S;
194
+ if (!gt || !g) return;
195
+ const C = ve(), D = (g.title ?? "").trim().slice(0, 255), y = Object.entries(X).map(([v, K]) => ({ merchandiseId: v, quantity: re(K) })).filter((v) => v.quantity > 0).filter((v) => bt.has(v.merchandiseId)).map((v) => ({
196
+ merchandiseId: v.merchandiseId,
197
+ quantity: v.quantity,
198
198
  attributes: [
199
- { key: ke.bundleId, value: y },
200
- { key: ke.bundleConfig, value: r },
201
- { key: ke.bundleSource, value: "bundle_builder" },
202
- ...C ? [{ key: ke.bundleTitle, value: C }] : []
199
+ { key: kt.bundleId, value: C },
200
+ { key: kt.bundleConfig, value: r },
201
+ { key: kt.bundleSource, value: "bundle_builder" },
202
+ ...D ? [{ key: kt.bundleTitle, value: D }] : []
203
203
  ]
204
204
  }));
205
- if (!A.length) return;
206
- const _ = new Map(ee.map((b) => [b.id, b]));
207
- let D = 0;
208
- for (const [b, te] of Object.entries(K)) {
209
- const le = te ?? 0;
210
- if (le <= 0) continue;
211
- const Ie = _.get(b), ye = Number(Ie == null ? void 0 : Ie.price);
212
- Number.isFinite(ye) && (D += ye * le);
205
+ if (!y.length) return;
206
+ const rt = new Map(st.map((v) => [v.id, v]));
207
+ let q = 0;
208
+ for (const [v, K] of Object.entries(X)) {
209
+ const Ot = K ?? 0;
210
+ if (Ot <= 0) continue;
211
+ const _t = rt.get(v), ut = Number(_t == null ? void 0 : _t.price);
212
+ Number.isFinite(ut) && (q += ut * Ot);
213
213
  }
214
- D = Math.round(D * 100) / 100;
215
- const he = [...g.rules ?? []].sort((b, te) => b.minBundleSize - te.minBundleSize);
216
- let E = null;
217
- for (const b of he)
218
- Y >= b.minBundleSize && (E = b);
219
- const F = E ? (() => {
220
- const b = Number.parseFloat(E.discountPercent);
221
- return Number.isFinite(b) && b > 0 ? b : null;
222
- })() : null, $ = F ? Math.round(D * (1 - F / 100) * 100) / 100 : D, G = D - $, se = A.map((b) => b.merchandiseId), z = (E == null ? void 0 : E.handle) ?? "", L = ((ce = E == null ? void 0 : E.label) == null ? void 0 : ce.trim()) || "";
223
- re(!0);
214
+ q = Math.round(q * 100) / 100;
215
+ const G = [...g.rules ?? []].sort((v, K) => v.minBundleSize - K.minBundleSize);
216
+ let B = null;
217
+ for (const v of G)
218
+ ct >= v.minBundleSize && (B = v);
219
+ const at = B ? (() => {
220
+ const v = Number.parseFloat(B.discountPercent);
221
+ return Number.isFinite(v) && v > 0 ? v : null;
222
+ })() : null, Q = at ? Math.round(q * (1 - at / 100) * 100) / 100 : q, it = q - Q, $ = y.map((v) => v.merchandiseId), Y = (B == null ? void 0 : B.handle) ?? "", T = ((S = B == null ? void 0 : B.label) == null ? void 0 : S.trim()) || "";
223
+ H(!0);
224
224
  try {
225
- if (await o.linesAdd(A), v)
225
+ if (await a.linesAdd(y), w)
226
226
  try {
227
- const b = Fe();
228
- Re(v, t, {
227
+ const v = At();
228
+ Rt(w, e, {
229
229
  eventType: "BUNDLE_ADDED_TO_BASKET",
230
- shop: t,
231
- anonymousUserId: b,
232
- bundleId: y,
233
- productVariantIds: se,
234
- grossPrice: D,
235
- discountedPrice: $,
236
- currency: T ?? void 0,
237
- discountThresholdIdentifier: z,
238
- discountLabel: L,
239
- discountPercentage: F,
240
- discountedAmount: G,
230
+ shop: e,
231
+ anonymousUserId: v,
232
+ bundleId: C,
233
+ productVariantIds: $,
234
+ grossPrice: q,
235
+ discountedPrice: Q,
236
+ currency: F ?? void 0,
237
+ discountThresholdIdentifier: Y,
238
+ discountLabel: T,
239
+ discountPercentage: at,
240
+ discountedAmount: it,
241
241
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
242
242
  });
243
243
  } catch {
244
244
  }
245
- de(), me(), (B = o.openCartUI) == null || B.call(o);
245
+ vt(), pt(), f == null || f();
246
246
  } finally {
247
- re(!1);
247
+ H(!1);
248
248
  }
249
249
  }, [
250
- ie,
251
- o,
252
- de,
253
- me,
250
+ gt,
251
+ a,
252
+ vt,
253
+ pt,
254
254
  g,
255
255
  r,
256
- T,
257
- K,
258
- Q,
259
- ee,
260
- Y,
261
- v,
262
- t
263
- ]), ae = N(
256
+ F,
257
+ X,
258
+ bt,
259
+ st,
260
+ ct,
261
+ w,
262
+ e
263
+ ]), It = dt(async () => {
264
+ await lt(() => {
265
+ var f;
266
+ (f = a.openCartUI) == null || f.call(a);
267
+ });
268
+ }, [lt, a]), nt = dt(async () => {
269
+ await lt(() => {
270
+ var f;
271
+ (f = a.navigateToCheckout) == null || f.call(a);
272
+ });
273
+ }, [lt, a]), Dt = M(
264
274
  () => ({
265
- isOpen: P,
266
- open: _e,
267
- close: me,
268
- toggle: Oe,
275
+ isOpen: A,
276
+ open: Tt,
277
+ close: pt,
278
+ toggle: Mt,
269
279
  loading: x,
270
- submitting: J,
271
- error: M,
272
- currencyCode: T,
280
+ submitting: E,
281
+ error: L,
282
+ currencyCode: F,
273
283
  config: g,
274
- eligibleVariants: ee,
275
- selections: K,
276
- selectionOrder: Pe,
277
- setQuantity: ge,
278
- clearSelections: de,
279
- bundleSize: Y,
280
- minRequired: pe,
281
- canSubmit: ie,
282
- submit: xe
284
+ eligibleVariants: st,
285
+ selections: X,
286
+ selectionOrder: xt,
287
+ setQuantity: tt,
288
+ clearSelections: vt,
289
+ bundleSize: ct,
290
+ minRequired: et,
291
+ canSubmit: gt,
292
+ submit: It,
293
+ submitAndCheckout: nt
283
294
  }),
284
295
  [
285
- P,
286
- _e,
287
- me,
288
- Oe,
296
+ A,
297
+ Tt,
298
+ pt,
299
+ Mt,
289
300
  x,
290
- J,
291
- M,
292
- T,
301
+ E,
302
+ L,
303
+ F,
293
304
  g,
294
- ee,
295
- K,
296
- Pe,
297
- ge,
298
- de,
299
- Y,
300
- pe,
301
- ie,
302
- xe
305
+ st,
306
+ X,
307
+ xt,
308
+ tt,
309
+ vt,
310
+ ct,
311
+ et,
312
+ gt,
313
+ It,
314
+ nt
303
315
  ]
304
316
  );
305
- return /* @__PURE__ */ h(ot.Provider, { value: ae, children: f });
317
+ return /* @__PURE__ */ h(ce.Provider, { value: Dt, children: m });
306
318
  }
307
- function We() {
308
- const i = dt(ot);
319
+ function jt() {
320
+ const i = pe(ce);
309
321
  if (!i)
310
322
  throw new Error("useBundleBuilder must be used within <BundleProvider />");
311
323
  return i;
312
324
  }
313
- function Kn() {
314
- const { isOpen: i, open: e, close: t, toggle: o } = We();
315
- return { isOpen: i, open: e, close: t, toggle: o };
325
+ function ar() {
326
+ const { isOpen: i, open: t, close: e, toggle: a } = jt();
327
+ return { isOpen: i, open: t, close: e, toggle: a };
316
328
  }
317
- const mt = "_button_18rtl_1", pt = {
318
- button: mt
329
+ const _e = "_button_18rtl_1", ye = {
330
+ button: _e
319
331
  };
320
- function Gn(i) {
321
- const { toggle: e } = We();
332
+ function ir(i) {
333
+ const { toggle: t } = jt();
322
334
  return /* @__PURE__ */ h(
323
335
  "button",
324
336
  {
325
337
  type: "button",
326
- onClick: e,
327
- className: [pt.button, i.className].filter(Boolean).join(" "),
338
+ onClick: t,
339
+ className: [ye.button, i.className].filter(Boolean).join(" "),
328
340
  children: i.children ?? "Build a bundle"
329
341
  }
330
342
  );
331
343
  }
332
- var Le, et;
333
- function yt() {
334
- if (et) return Le;
335
- et = 1;
344
+ var Ut, ae;
345
+ function we() {
346
+ if (ae) return Ut;
347
+ ae = 1;
336
348
  var i = {
337
- linear: function(e, t, o, r) {
338
- var n = o - t;
339
- return n * e / r + t;
349
+ linear: function(t, e, a, r) {
350
+ var n = a - e;
351
+ return n * t / r + e;
340
352
  },
341
- easeInQuad: function(e, t, o, r) {
342
- var n = o - t;
343
- return n * (e /= r) * e + t;
353
+ easeInQuad: function(t, e, a, r) {
354
+ var n = a - e;
355
+ return n * (t /= r) * t + e;
344
356
  },
345
- easeOutQuad: function(e, t, o, r) {
346
- var n = o - t;
347
- return -n * (e /= r) * (e - 2) + t;
357
+ easeOutQuad: function(t, e, a, r) {
358
+ var n = a - e;
359
+ return -n * (t /= r) * (t - 2) + e;
348
360
  },
349
- easeInOutQuad: function(e, t, o, r) {
350
- var n = o - t;
351
- return (e /= r / 2) < 1 ? n / 2 * e * e + t : -n / 2 * (--e * (e - 2) - 1) + t;
361
+ easeInOutQuad: function(t, e, a, r) {
362
+ var n = a - e;
363
+ return (t /= r / 2) < 1 ? n / 2 * t * t + e : -n / 2 * (--t * (t - 2) - 1) + e;
352
364
  },
353
- easeInCubic: function(e, t, o, r) {
354
- var n = o - t;
355
- return n * (e /= r) * e * e + t;
365
+ easeInCubic: function(t, e, a, r) {
366
+ var n = a - e;
367
+ return n * (t /= r) * t * t + e;
356
368
  },
357
- easeOutCubic: function(e, t, o, r) {
358
- var n = o - t;
359
- return n * ((e = e / r - 1) * e * e + 1) + t;
369
+ easeOutCubic: function(t, e, a, r) {
370
+ var n = a - e;
371
+ return n * ((t = t / r - 1) * t * t + 1) + e;
360
372
  },
361
- easeInOutCubic: function(e, t, o, r) {
362
- var n = o - t;
363
- return (e /= r / 2) < 1 ? n / 2 * e * e * e + t : n / 2 * ((e -= 2) * e * e + 2) + t;
373
+ easeInOutCubic: function(t, e, a, r) {
374
+ var n = a - e;
375
+ return (t /= r / 2) < 1 ? n / 2 * t * t * t + e : n / 2 * ((t -= 2) * t * t + 2) + e;
364
376
  },
365
- easeInQuart: function(e, t, o, r) {
366
- var n = o - t;
367
- return n * (e /= r) * e * e * e + t;
377
+ easeInQuart: function(t, e, a, r) {
378
+ var n = a - e;
379
+ return n * (t /= r) * t * t * t + e;
368
380
  },
369
- easeOutQuart: function(e, t, o, r) {
370
- var n = o - t;
371
- return -n * ((e = e / r - 1) * e * e * e - 1) + t;
381
+ easeOutQuart: function(t, e, a, r) {
382
+ var n = a - e;
383
+ return -n * ((t = t / r - 1) * t * t * t - 1) + e;
372
384
  },
373
- easeInOutQuart: function(e, t, o, r) {
374
- var n = o - t;
375
- return (e /= r / 2) < 1 ? n / 2 * e * e * e * e + t : -n / 2 * ((e -= 2) * e * e * e - 2) + t;
385
+ easeInOutQuart: function(t, e, a, r) {
386
+ var n = a - e;
387
+ return (t /= r / 2) < 1 ? n / 2 * t * t * t * t + e : -n / 2 * ((t -= 2) * t * t * t - 2) + e;
376
388
  },
377
- easeInQuint: function(e, t, o, r) {
378
- var n = o - t;
379
- return n * (e /= r) * e * e * e * e + t;
389
+ easeInQuint: function(t, e, a, r) {
390
+ var n = a - e;
391
+ return n * (t /= r) * t * t * t * t + e;
380
392
  },
381
- easeOutQuint: function(e, t, o, r) {
382
- var n = o - t;
383
- return n * ((e = e / r - 1) * e * e * e * e + 1) + t;
393
+ easeOutQuint: function(t, e, a, r) {
394
+ var n = a - e;
395
+ return n * ((t = t / r - 1) * t * t * t * t + 1) + e;
384
396
  },
385
- easeInOutQuint: function(e, t, o, r) {
386
- var n = o - t;
387
- return (e /= r / 2) < 1 ? n / 2 * e * e * e * e * e + t : n / 2 * ((e -= 2) * e * e * e * e + 2) + t;
397
+ easeInOutQuint: function(t, e, a, r) {
398
+ var n = a - e;
399
+ return (t /= r / 2) < 1 ? n / 2 * t * t * t * t * t + e : n / 2 * ((t -= 2) * t * t * t * t + 2) + e;
388
400
  },
389
- easeInSine: function(e, t, o, r) {
390
- var n = o - t;
391
- return -n * Math.cos(e / r * (Math.PI / 2)) + n + t;
401
+ easeInSine: function(t, e, a, r) {
402
+ var n = a - e;
403
+ return -n * Math.cos(t / r * (Math.PI / 2)) + n + e;
392
404
  },
393
- easeOutSine: function(e, t, o, r) {
394
- var n = o - t;
395
- return n * Math.sin(e / r * (Math.PI / 2)) + t;
405
+ easeOutSine: function(t, e, a, r) {
406
+ var n = a - e;
407
+ return n * Math.sin(t / r * (Math.PI / 2)) + e;
396
408
  },
397
- easeInOutSine: function(e, t, o, r) {
398
- var n = o - t;
399
- return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t;
409
+ easeInOutSine: function(t, e, a, r) {
410
+ var n = a - e;
411
+ return -n / 2 * (Math.cos(Math.PI * t / r) - 1) + e;
400
412
  },
401
- easeInExpo: function(e, t, o, r) {
402
- var n = o - t;
403
- return e == 0 ? t : n * Math.pow(2, 10 * (e / r - 1)) + t;
413
+ easeInExpo: function(t, e, a, r) {
414
+ var n = a - e;
415
+ return t == 0 ? e : n * Math.pow(2, 10 * (t / r - 1)) + e;
404
416
  },
405
- easeOutExpo: function(e, t, o, r) {
406
- var n = o - t;
407
- return e == r ? t + n : n * (-Math.pow(2, -10 * e / r) + 1) + t;
417
+ easeOutExpo: function(t, e, a, r) {
418
+ var n = a - e;
419
+ return t == r ? e + n : n * (-Math.pow(2, -10 * t / r) + 1) + e;
408
420
  },
409
- easeInOutExpo: function(e, t, o, r) {
410
- var n = o - t;
411
- 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;
421
+ easeInOutExpo: function(t, e, a, r) {
422
+ var n = a - e;
423
+ return t === 0 ? e : t === r ? e + n : (t /= r / 2) < 1 ? n / 2 * Math.pow(2, 10 * (t - 1)) + e : n / 2 * (-Math.pow(2, -10 * --t) + 2) + e;
412
424
  },
413
- easeInCirc: function(e, t, o, r) {
414
- var n = o - t;
415
- return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t;
425
+ easeInCirc: function(t, e, a, r) {
426
+ var n = a - e;
427
+ return -n * (Math.sqrt(1 - (t /= r) * t) - 1) + e;
416
428
  },
417
- easeOutCirc: function(e, t, o, r) {
418
- var n = o - t;
419
- return n * Math.sqrt(1 - (e = e / r - 1) * e) + t;
429
+ easeOutCirc: function(t, e, a, r) {
430
+ var n = a - e;
431
+ return n * Math.sqrt(1 - (t = t / r - 1) * t) + e;
420
432
  },
421
- easeInOutCirc: function(e, t, o, r) {
422
- var n = o - t;
423
- return (e /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + t : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
433
+ easeInOutCirc: function(t, e, a, r) {
434
+ var n = a - e;
435
+ return (t /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - t * t) - 1) + e : n / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + e;
424
436
  },
425
- easeInElastic: function(e, t, o, r) {
426
- var n = o - t, l, c, f;
427
- return f = 1.70158, c = 0, l = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), l < Math.abs(n) ? (l = n, f = c / 4) : f = c / (2 * Math.PI) * Math.asin(n / l), -(l * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - f) * (2 * Math.PI) / c)) + t);
437
+ easeInElastic: function(t, e, a, r) {
438
+ var n = a - e, l, c, m;
439
+ return m = 1.70158, c = 0, l = n, t === 0 ? e : (t /= r) === 1 ? e + n : (c || (c = r * 0.3), l < Math.abs(n) ? (l = n, m = c / 4) : m = c / (2 * Math.PI) * Math.asin(n / l), -(l * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * r - m) * (2 * Math.PI) / c)) + e);
428
440
  },
429
- easeOutElastic: function(e, t, o, r) {
430
- var n = o - t, l, c, f;
431
- return f = 1.70158, c = 0, l = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), l < Math.abs(n) ? (l = n, f = c / 4) : f = c / (2 * Math.PI) * Math.asin(n / l), l * Math.pow(2, -10 * e) * Math.sin((e * r - f) * (2 * Math.PI) / c) + n + t);
441
+ easeOutElastic: function(t, e, a, r) {
442
+ var n = a - e, l, c, m;
443
+ return m = 1.70158, c = 0, l = n, t === 0 ? e : (t /= r) === 1 ? e + n : (c || (c = r * 0.3), l < Math.abs(n) ? (l = n, m = c / 4) : m = c / (2 * Math.PI) * Math.asin(n / l), l * Math.pow(2, -10 * t) * Math.sin((t * r - m) * (2 * Math.PI) / c) + n + e);
432
444
  },
433
- easeInOutElastic: function(e, t, o, r) {
434
- var n = o - t, l, c, f;
435
- return f = 1.70158, c = 0, l = n, e === 0 ? t : (e /= r / 2) === 2 ? t + n : (c || (c = r * (0.3 * 1.5)), l < Math.abs(n) ? (l = n, f = c / 4) : f = c / (2 * Math.PI) * Math.asin(n / l), e < 1 ? -0.5 * (l * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - f) * (2 * Math.PI) / c)) + t : l * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * r - f) * (2 * Math.PI) / c) * 0.5 + n + t);
445
+ easeInOutElastic: function(t, e, a, r) {
446
+ var n = a - e, l, c, m;
447
+ return m = 1.70158, c = 0, l = n, t === 0 ? e : (t /= r / 2) === 2 ? e + n : (c || (c = r * (0.3 * 1.5)), l < Math.abs(n) ? (l = n, m = c / 4) : m = c / (2 * Math.PI) * Math.asin(n / l), t < 1 ? -0.5 * (l * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * r - m) * (2 * Math.PI) / c)) + e : l * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * r - m) * (2 * Math.PI) / c) * 0.5 + n + e);
436
448
  },
437
- easeInBack: function(e, t, o, r, n) {
438
- var l = o - t;
439
- return n === void 0 && (n = 1.70158), l * (e /= r) * e * ((n + 1) * e - n) + t;
449
+ easeInBack: function(t, e, a, r, n) {
450
+ var l = a - e;
451
+ return n === void 0 && (n = 1.70158), l * (t /= r) * t * ((n + 1) * t - n) + e;
440
452
  },
441
- easeOutBack: function(e, t, o, r, n) {
442
- var l = o - t;
443
- return n === void 0 && (n = 1.70158), l * ((e = e / r - 1) * e * ((n + 1) * e + n) + 1) + t;
453
+ easeOutBack: function(t, e, a, r, n) {
454
+ var l = a - e;
455
+ return n === void 0 && (n = 1.70158), l * ((t = t / r - 1) * t * ((n + 1) * t + n) + 1) + e;
444
456
  },
445
- easeInOutBack: function(e, t, o, r, n) {
446
- var l = o - t;
447
- return n === void 0 && (n = 1.70158), (e /= r / 2) < 1 ? l / 2 * (e * e * (((n *= 1.525) + 1) * e - n)) + t : l / 2 * ((e -= 2) * e * (((n *= 1.525) + 1) * e + n) + 2) + t;
457
+ easeInOutBack: function(t, e, a, r, n) {
458
+ var l = a - e;
459
+ return n === void 0 && (n = 1.70158), (t /= r / 2) < 1 ? l / 2 * (t * t * (((n *= 1.525) + 1) * t - n)) + e : l / 2 * ((t -= 2) * t * (((n *= 1.525) + 1) * t + n) + 2) + e;
448
460
  },
449
- easeInBounce: function(e, t, o, r) {
450
- var n = o - t, l;
451
- return l = i.easeOutBounce(r - e, 0, n, r), n - l + t;
461
+ easeInBounce: function(t, e, a, r) {
462
+ var n = a - e, l;
463
+ return l = i.easeOutBounce(r - t, 0, n, r), n - l + e;
452
464
  },
453
- easeOutBounce: function(e, t, o, r) {
454
- var n = o - t;
455
- 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;
465
+ easeOutBounce: function(t, e, a, r) {
466
+ var n = a - e;
467
+ return (t /= r) < 1 / 2.75 ? n * (7.5625 * t * t) + e : t < 2 / 2.75 ? n * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + e : t < 2.5 / 2.75 ? n * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + e : n * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + e;
456
468
  },
457
- easeInOutBounce: function(e, t, o, r) {
458
- var n = o - t, l;
459
- return e < r / 2 ? (l = i.easeInBounce(e * 2, 0, n, r), l * 0.5 + t) : (l = i.easeOutBounce(e * 2 - r, 0, n, r), l * 0.5 + n * 0.5 + t);
469
+ easeInOutBounce: function(t, e, a, r) {
470
+ var n = a - e, l;
471
+ return t < r / 2 ? (l = i.easeInBounce(t * 2, 0, n, r), l * 0.5 + e) : (l = i.easeOutBounce(t * 2 - r, 0, n, r), l * 0.5 + n * 0.5 + e);
460
472
  }
461
473
  };
462
- return Le = i, Le;
474
+ return Ut = i, Ut;
463
475
  }
464
- var bt = yt();
465
- function wt(i) {
476
+ var ge = we();
477
+ function xe(i) {
466
478
  return i * Math.PI / 180;
467
479
  }
468
- function U(i, e) {
469
- return i + Math.random() * (e - i);
480
+ function W(i, t) {
481
+ return i + Math.random() * (t - i);
470
482
  }
471
- function _t(i, e) {
472
- return Math.floor(i + Math.random() * (e - i + 1));
483
+ function Ie(i, t) {
484
+ return Math.floor(i + Math.random() * (t - i + 1));
473
485
  }
474
- var Be;
486
+ var Bt;
475
487
  (function(i) {
476
488
  i[i.Circle = 0] = "Circle", i[i.Square = 1] = "Square", i[i.Strip = 2] = "Strip";
477
- })(Be || (Be = {}));
478
- var ue;
489
+ })(Bt || (Bt = {}));
490
+ var ht;
479
491
  (function(i) {
480
492
  i[i.Positive = 1] = "Positive", i[i.Negative = -1] = "Negative";
481
- })(ue || (ue = {}));
482
- const vt = 1e3 / 60;
483
- class gt {
484
- constructor(e, t, o, r) {
485
- this.getOptions = t;
493
+ })(ht || (ht = {}));
494
+ const Ce = 1e3 / 60;
495
+ class Be {
496
+ constructor(t, e, a, r) {
497
+ this.getOptions = e;
486
498
  const { colors: n, initialVelocityX: l, initialVelocityY: c } = this.getOptions();
487
- 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 l == "number" ? U(-l, l) : U(l.min, l.max), this.vy = typeof c == "number" ? U(-c, 0) : U(c.min, c.max), this.shape = _t(0, 2), this.angle = wt(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) ? ue.Positive : ue.Negative;
499
+ this.context = t, this.x = a, this.y = r, this.w = W(5, 20), this.h = W(5, 20), this.radius = W(5, 10), this.vx = typeof l == "number" ? W(-l, l) : W(l.min, l.max), this.vy = typeof c == "number" ? W(-c, 0) : W(c.min, c.max), this.shape = Ie(0, 2), this.angle = xe(W(0, 360)), this.angularSpin = W(-0.2, 0.2), this.color = n[Math.floor(Math.random() * n.length)], this.rotateY = W(0, 1), this.rotationDirection = W(0, 1) ? ht.Positive : ht.Negative;
488
500
  }
489
- update(e) {
490
- const { gravity: t, wind: o, friction: r, opacity: n, drawShape: l } = this.getOptions(), c = e / vt;
491
- 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 === ue.Positive ? this.rotationDirection = ue.Negative : this.rotateY <= -1 && this.rotationDirection === ue.Negative && (this.rotationDirection = ue.Positive);
492
- const f = 0.1 * this.rotationDirection * c;
493
- if (this.rotateY += f, 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, l && typeof l == "function")
501
+ update(t) {
502
+ const { gravity: e, wind: a, friction: r, opacity: n, drawShape: l } = this.getOptions(), c = t / Ce;
503
+ this.x += this.vx * c, this.y += this.vy * c, this.vy += e * c, this.vx += a * c, this.vx *= r ** c, this.vy *= r ** c, this.rotateY >= 1 && this.rotationDirection === ht.Positive ? this.rotationDirection = ht.Negative : this.rotateY <= -1 && this.rotationDirection === ht.Negative && (this.rotationDirection = ht.Positive);
504
+ const m = 0.1 * this.rotationDirection * c;
505
+ if (this.rotateY += m, 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, l && typeof l == "function")
494
506
  l.call(this, this.context);
495
507
  else
496
508
  switch (this.shape) {
497
- case Be.Circle: {
509
+ case Bt.Circle: {
498
510
  this.context.beginPath(), this.context.arc(0, 0, this.radius, 0, 2 * Math.PI), this.context.fill();
499
511
  break;
500
512
  }
501
- case Be.Square: {
513
+ case Bt.Square: {
502
514
  this.context.fillRect(-this.w / 2, -this.h / 2, this.w, this.h);
503
515
  break;
504
516
  }
505
- case Be.Strip: {
517
+ case Bt.Strip: {
506
518
  this.context.fillRect(-this.w / 6, -this.h / 2, this.w / 3, this.h);
507
519
  break;
508
520
  }
@@ -510,39 +522,39 @@ class gt {
510
522
  this.context.closePath(), this.context.restore();
511
523
  }
512
524
  }
513
- class xt {
514
- constructor(e, t) {
525
+ class Se {
526
+ constructor(t, e) {
515
527
  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) => {
516
528
  this.particles.splice(r, 1);
517
529
  }, this.getParticle = () => {
518
- const r = U(this.x, this.w + this.x), n = U(this.y, this.h + this.y);
519
- return new gt(this.context, this.getOptions, r, n);
530
+ const r = W(this.x, this.w + this.x), n = W(this.y, this.h + this.y);
531
+ return new Be(this.context, this.getOptions, r, n);
520
532
  }, this.animate = (r) => {
521
- const { canvas: n, context: l, particlesGenerated: c, lastNumberOfPieces: f } = this, { run: v, recycle: P, numberOfPieces: k, debug: x, tweenFunction: X, tweenDuration: J } = this.getOptions();
522
- if (!v)
533
+ const { canvas: n, context: l, particlesGenerated: c, lastNumberOfPieces: m } = this, { run: w, recycle: A, numberOfPieces: R, debug: x, tweenFunction: J, tweenDuration: E } = this.getOptions();
534
+ if (!w)
523
535
  return !1;
524
- const re = this.particles.length, M = P ? re : c;
525
- if (M < k) {
526
- f !== k && (this.tweenProgress = 0, this.tweenFrom = M, this.lastNumberOfPieces = k), this.tweenProgress = Math.min(J, Math.max(0, this.tweenProgress + r));
527
- const q = X(this.tweenProgress, this.tweenFrom, k, J), T = Math.round(q - M);
528
- for (let Z = 0; Z < T; Z++)
536
+ const H = this.particles.length, L = A ? H : c;
537
+ if (L < R) {
538
+ m !== R && (this.tweenProgress = 0, this.tweenFrom = L, this.lastNumberOfPieces = R), this.tweenProgress = Math.min(E, Math.max(0, this.tweenProgress + r));
539
+ const P = J(this.tweenProgress, this.tweenFrom, R, E), F = Math.round(P - L);
540
+ for (let V = 0; V < F; V++)
529
541
  this.particles.push(this.getParticle());
530
- this.particlesGenerated += T;
542
+ this.particlesGenerated += F;
531
543
  }
532
- x && (l.font = "12px sans-serif", l.fillStyle = "#333", l.textAlign = "right", l.fillText(`Particles: ${re}`, n.width - 10, n.height - 20));
533
- for (let q = this.particles.length - 1; q >= 0; q--) {
534
- const T = this.particles[q];
535
- T.update(r), (T.y > n.height || T.y < -100 || T.x > n.width + 100 || T.x < -100) && (P && M <= k ? this.particles[q] = this.getParticle() : this.removeParticleAt(q));
544
+ x && (l.font = "12px sans-serif", l.fillStyle = "#333", l.textAlign = "right", l.fillText(`Particles: ${H}`, n.width - 10, n.height - 20));
545
+ for (let P = this.particles.length - 1; P >= 0; P--) {
546
+ const F = this.particles[P];
547
+ F.update(r), (F.y > n.height || F.y < -100 || F.x > n.width + 100 || F.x < -100) && (A && L <= R ? this.particles[P] = this.getParticle() : this.removeParticleAt(P));
536
548
  }
537
- return re > 0 || M < k;
538
- }, this.canvas = e;
539
- const o = this.canvas.getContext("2d");
540
- if (!o)
549
+ return H > 0 || L < R;
550
+ }, this.canvas = t;
551
+ const a = this.canvas.getContext("2d");
552
+ if (!a)
541
553
  throw new Error("Could not get canvas context");
542
- this.context = o, this.getOptions = t;
554
+ this.context = a, this.getOptions = e;
543
555
  }
544
556
  }
545
- const Ve = {
557
+ const Gt = {
546
558
  width: typeof window < "u" ? window.innerWidth : 300,
547
559
  height: typeof window < "u" ? window.innerHeight : 200,
548
560
  numberOfPieces: 200,
@@ -572,13 +584,13 @@ const Ve = {
572
584
  ],
573
585
  opacity: 1,
574
586
  debug: !1,
575
- tweenFunction: bt.easeInOutQuad,
587
+ tweenFunction: ge.easeInOutQuad,
576
588
  tweenDuration: 5e3,
577
589
  recycle: !0,
578
590
  run: !0
579
591
  };
580
- class It {
581
- constructor(e, t) {
592
+ class Ne {
593
+ constructor(t, e) {
582
594
  this.lastFrameTime = 0, this.setOptionsWithDefaults = (r) => {
583
595
  const n = {
584
596
  confettiSource: {
@@ -590,55 +602,55 @@ class It {
590
602
  };
591
603
  this._options = {
592
604
  ...n,
593
- ...Ve,
605
+ ...Gt,
594
606
  ...r
595
607
  }, Object.assign(this, r.confettiSource);
596
608
  }, this.update = (r = 0) => {
597
- const { options: { run: n, onConfettiComplete: l, frameRate: c }, canvas: f, context: v } = this, P = Math.min(r - this.lastFrameTime, 50);
598
- if (c && P < 1e3 / c) {
609
+ const { options: { run: n, onConfettiComplete: l, frameRate: c }, canvas: m, context: w } = this, A = Math.min(r - this.lastFrameTime, 50);
610
+ if (c && A < 1e3 / c) {
599
611
  this.rafId = requestAnimationFrame(this.update);
600
612
  return;
601
613
  }
602
- this.lastFrameTime = r - (c ? P % c : 0), n && (v.fillStyle = "white", v.clearRect(0, 0, f.width, f.height)), this.generator.animate(P) ? this.rafId = requestAnimationFrame(this.update) : (l && typeof l == "function" && this.generator.particlesGenerated > 0 && l.call(this, this), this._options.run = !1);
614
+ this.lastFrameTime = r - (c ? A % c : 0), n && (w.fillStyle = "white", w.clearRect(0, 0, m.width, m.height)), this.generator.animate(A) ? this.rafId = requestAnimationFrame(this.update) : (l && typeof l == "function" && this.generator.particlesGenerated > 0 && l.call(this, this), this._options.run = !1);
603
615
  }, this.reset = () => {
604
616
  this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
605
617
  }, this.stop = () => {
606
618
  this.options = { run: !1 }, this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = void 0);
607
- }, this.canvas = e;
608
- const o = this.canvas.getContext("2d");
609
- if (!o)
619
+ }, this.canvas = t;
620
+ const a = this.canvas.getContext("2d");
621
+ if (!a)
610
622
  throw new Error("Could not get canvas context");
611
- this.context = o, this.generator = new xt(this.canvas, () => this.options), this.options = t, this.update();
623
+ this.context = a, this.generator = new Se(this.canvas, () => this.options), this.options = e, this.update();
612
624
  }
613
625
  get options() {
614
626
  return this._options;
615
627
  }
616
- set options(e) {
628
+ set options(t) {
617
629
  var r, n;
618
- const t = (r = this._options) == null ? void 0 : r.run, o = (n = this._options) == null ? void 0 : n.recycle;
619
- 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();
630
+ const e = (r = this._options) == null ? void 0 : r.run, a = (n = this._options) == null ? void 0 : n.recycle;
631
+ this.setOptionsWithDefaults(t), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof t.recycle == "boolean" && t.recycle && a === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof t.run == "boolean" && t.run && e === !1 && this.update();
620
632
  }
621
633
  }
622
- const Ct = Ae.createRef();
623
- class je extends Ae.Component {
624
- constructor(e) {
625
- super(e), this.canvas = Ae.createRef(), this.canvas = e.canvasRef || Ct;
634
+ const Te = Ft.createRef();
635
+ class Qt extends Ft.Component {
636
+ constructor(t) {
637
+ super(t), this.canvas = Ft.createRef(), this.canvas = t.canvasRef || Te;
626
638
  }
627
639
  componentDidMount() {
628
640
  if (this.canvas.current) {
629
- const e = Ue(this.props)[0];
630
- this.confetti = new It(this.canvas.current, e);
641
+ const t = zt(this.props)[0];
642
+ this.confetti = new Ne(this.canvas.current, t);
631
643
  }
632
644
  }
633
645
  componentDidUpdate() {
634
- const e = Ue(this.props)[0];
635
- this.confetti && (this.confetti.options = e);
646
+ const t = zt(this.props)[0];
647
+ this.confetti && (this.confetti.options = t);
636
648
  }
637
649
  componentWillUnmount() {
638
650
  this.confetti && this.confetti.stop(), this.confetti = void 0;
639
651
  }
640
652
  render() {
641
- const [e, t] = Ue(this.props), o = {
653
+ const [t, e] = zt(this.props), a = {
642
654
  zIndex: 2,
643
655
  position: "absolute",
644
656
  pointerEvents: "none",
@@ -646,18 +658,18 @@ class je extends Ae.Component {
646
658
  left: 0,
647
659
  bottom: 0,
648
660
  right: 0,
649
- ...t.style
661
+ ...e.style
650
662
  };
651
- return h("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: o });
663
+ return h("canvas", { width: t.width, height: t.height, ref: this.canvas, ...e, style: a });
652
664
  }
653
665
  }
654
- je.defaultProps = {
655
- ...Ve
666
+ Qt.defaultProps = {
667
+ ...Gt
656
668
  };
657
- je.displayName = "ReactConfetti";
658
- function Ue(i) {
659
- const e = {}, t = {}, o = {}, r = [
660
- ...Object.keys(Ve),
669
+ Qt.displayName = "ReactConfetti";
670
+ function zt(i) {
671
+ const t = {}, e = {}, a = {}, r = [
672
+ ...Object.keys(Gt),
661
673
  "confettiSource",
662
674
  "drawShape",
663
675
  "onConfettiComplete",
@@ -665,26 +677,26 @@ function Ue(i) {
665
677
  ], n = ["canvasRef"];
666
678
  for (const l in i) {
667
679
  const c = i[l];
668
- r.includes(l) ? e[l] = c : n.includes(l) ? n[l] = c : o[l] = c;
680
+ r.includes(l) ? t[l] = c : n.includes(l) ? n[l] = c : a[l] = c;
669
681
  }
670
- return [e, o, t];
682
+ return [t, a, e];
671
683
  }
672
- const St = Ae.forwardRef((i, e) => h(je, { canvasRef: e, ...i }));
684
+ const Me = Ft.forwardRef((i, t) => h(Qt, { canvasRef: t, ...i }));
673
685
  /**
674
686
  * @license lucide-react v0.515.0 - ISC
675
687
  *
676
688
  * This source code is licensed under the ISC license.
677
689
  * See the LICENSE file in the root directory of this source tree.
678
690
  */
679
- const Bt = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Nt = (i) => i.replace(
691
+ const Pe = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Oe = (i) => i.replace(
680
692
  /^([A-Z])|[\s-_]+(\w)/g,
681
- (e, t, o) => o ? o.toUpperCase() : t.toLowerCase()
682
- ), tt = (i) => {
683
- const e = Nt(i);
684
- return e.charAt(0).toUpperCase() + e.slice(1);
685
- }, it = (...i) => i.filter((e, t, o) => !!e && e.trim() !== "" && o.indexOf(e) === t).join(" ").trim(), Tt = (i) => {
686
- for (const e in i)
687
- if (e.startsWith("aria-") || e === "role" || e === "title")
693
+ (t, e, a) => a ? a.toUpperCase() : e.toLowerCase()
694
+ ), ie = (i) => {
695
+ const t = Oe(i);
696
+ return t.charAt(0).toUpperCase() + t.slice(1);
697
+ }, le = (...i) => i.filter((t, e, a) => !!t && t.trim() !== "" && a.indexOf(t) === e).join(" ").trim(), ke = (i) => {
698
+ for (const t in i)
699
+ if (t.startsWith("aria-") || t === "role" || t === "title")
688
700
  return !0;
689
701
  };
690
702
  /**
@@ -693,7 +705,7 @@ const Bt = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Nt = (
693
705
  * This source code is licensed under the ISC license.
694
706
  * See the LICENSE file in the root directory of this source tree.
695
707
  */
696
- var Mt = {
708
+ var Ae = {
697
709
  xmlns: "http://www.w3.org/2000/svg",
698
710
  width: 24,
699
711
  height: 24,
@@ -710,31 +722,31 @@ var Mt = {
710
722
  * This source code is licensed under the ISC license.
711
723
  * See the LICENSE file in the root directory of this source tree.
712
724
  */
713
- const Ot = rt(
725
+ const Re = se(
714
726
  ({
715
727
  color: i = "currentColor",
716
- size: e = 24,
717
- strokeWidth: t = 2,
718
- absoluteStrokeWidth: o,
728
+ size: t = 24,
729
+ strokeWidth: e = 2,
730
+ absoluteStrokeWidth: a,
719
731
  className: r = "",
720
732
  children: n,
721
733
  iconNode: l,
722
734
  ...c
723
- }, f) => ze(
735
+ }, m) => Vt(
724
736
  "svg",
725
737
  {
726
- ref: f,
727
- ...Mt,
728
- width: e,
729
- height: e,
738
+ ref: m,
739
+ ...Ae,
740
+ width: t,
741
+ height: t,
730
742
  stroke: i,
731
- strokeWidth: o ? Number(t) * 24 / Number(e) : t,
732
- className: it("lucide", r),
733
- ...!n && !Tt(c) && { "aria-hidden": "true" },
743
+ strokeWidth: a ? Number(e) * 24 / Number(t) : e,
744
+ className: le("lucide", r),
745
+ ...!n && !ke(c) && { "aria-hidden": "true" },
734
746
  ...c
735
747
  },
736
748
  [
737
- ...l.map(([v, P]) => ze(v, P)),
749
+ ...l.map(([w, A]) => Vt(w, A)),
738
750
  ...Array.isArray(n) ? n : [n]
739
751
  ]
740
752
  )
@@ -745,20 +757,20 @@ const Ot = rt(
745
757
  * This source code is licensed under the ISC license.
746
758
  * See the LICENSE file in the root directory of this source tree.
747
759
  */
748
- const Pt = (i, e) => {
749
- const t = rt(
750
- ({ className: o, ...r }, n) => ze(Ot, {
760
+ const Fe = (i, t) => {
761
+ const e = se(
762
+ ({ className: a, ...r }, n) => Vt(Re, {
751
763
  ref: n,
752
- iconNode: e,
753
- className: it(
754
- `lucide-${Bt(tt(i))}`,
764
+ iconNode: t,
765
+ className: le(
766
+ `lucide-${Pe(ie(i))}`,
755
767
  `lucide-${i}`,
756
- o
768
+ a
757
769
  ),
758
770
  ...r
759
771
  })
760
772
  );
761
- return t.displayName = tt(i), t;
773
+ return e.displayName = ie(i), e;
762
774
  };
763
775
  /**
764
776
  * @license lucide-react v0.515.0 - ISC
@@ -766,274 +778,289 @@ const Pt = (i, e) => {
766
778
  * This source code is licensed under the ISC license.
767
779
  * See the LICENSE file in the root directory of this source tree.
768
780
  */
769
- const kt = [
781
+ const De = [
770
782
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
771
783
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
772
- ], Ft = Pt("search", kt), Rt = "_backdrop_364yo_1", At = "_celebrationOverlay_364yo_14", Dt = "_celebrationChip_364yo_23", qt = "_backdropOpen_364yo_74", Et = "_backdropClosed_364yo_78", Lt = "_panel_364yo_82", Ut = "_panelOpen_364yo_102", $t = "_panelClosed_364yo_106", zt = "_header_364yo_145", Wt = "_headerCenter_364yo_154", Vt = "_title_364yo_162", jt = "_searchIconButton_364yo_171", Qt = "_headerTitleWrap_364yo_193", Yt = "_headerSearchWrap_364yo_197", Kt = "_headerSearchOpen_364yo_209", Gt = "_searchBar_364yo_221", Ht = "_searchInput_364yo_233", Xt = "_searchClearButton_364yo_254", Jt = "_closeButton_364yo_276", Zt = "_body_364yo_309", en = "_muted_364yo_314", tn = "_error_364yo_319", nn = "_variants_364yo_324", rn = "_variantList_364yo_328", on = "_variantRow_364yo_336", an = "_variantLeft_364yo_344", sn = "_addToBundleButton_364yo_351", cn = "_variantThumb_364yo_379", ln = "_variantThumbImg_364yo_389", un = "_variantThumbFallback_364yo_396", dn = "_variantInfo_364yo_406", hn = "_variantName_364yo_410", fn = "_variantMeta_364yo_419", mn = "_variantPriceRow_364yo_427", pn = "_variantCompareAt_364yo_434", yn = "_variantPrice_364yo_427", bn = "_qtyControls_364yo_445", wn = "_qtyButton_364yo_451", _n = "_qtyValue_364yo_476", vn = "_footer_364yo_483", gn = "_poweredBy_364yo_490", xn = "_boxSummaryWindow_364yo_502", In = "_boxSummaryRow_364yo_519", Cn = "_boxSlot_364yo_527", Sn = "_boxItem_364yo_535", Bn = "_boxItemClickable_364yo_547", Nn = "_boxThresholdLabel_364yo_556", Tn = "_boxItemPlaceholder_364yo_567", Mn = "_boxItemFilled_364yo_573", On = "_boxItemThreshold_364yo_579", Pn = "_boxItemDiscountText_364yo_587", kn = "_boxItemPlus_364yo_595", Fn = "_boxItemImage_364yo_602", Rn = "_boxItemFallback_364yo_609", An = "_cta_364yo_620", Dn = "_ctaTotals_364yo_632", qn = "_ctaDiscountBadge_364yo_640", En = "_ctaTotalsWrap_364yo_654", Ln = "_ctaTotalsWrapVisible_364yo_667", Un = "_ctaTotalsStrike_364yo_674", $n = "_ctaTotalsPrice_364yo_681", u = {
773
- backdrop: Rt,
774
- celebrationOverlay: At,
775
- celebrationChip: Dt,
776
- backdropOpen: qt,
777
- backdropClosed: Et,
778
- panel: Lt,
779
- panelOpen: Ut,
780
- panelClosed: $t,
781
- header: zt,
782
- headerCenter: Wt,
783
- title: Vt,
784
- searchIconButton: jt,
785
- headerTitleWrap: Qt,
786
- headerSearchWrap: Yt,
787
- headerSearchOpen: Kt,
788
- searchBar: Gt,
789
- searchInput: Ht,
790
- searchClearButton: Xt,
791
- closeButton: Jt,
792
- body: Zt,
793
- muted: en,
794
- error: tn,
795
- variants: nn,
796
- variantList: rn,
797
- variantRow: on,
798
- variantLeft: an,
799
- addToBundleButton: sn,
800
- variantThumb: cn,
801
- variantThumbImg: ln,
802
- variantThumbFallback: un,
803
- variantInfo: dn,
804
- variantName: hn,
805
- variantMeta: fn,
806
- variantPriceRow: mn,
807
- variantCompareAt: pn,
808
- variantPrice: yn,
809
- qtyControls: bn,
810
- qtyButton: wn,
811
- qtyValue: _n,
812
- footer: vn,
813
- poweredBy: gn,
814
- boxSummaryWindow: xn,
815
- boxSummaryRow: In,
816
- boxSlot: Cn,
817
- boxItem: Sn,
818
- boxItemClickable: Bn,
819
- boxThresholdLabel: Nn,
820
- boxItemPlaceholder: Tn,
821
- boxItemFilled: Mn,
822
- boxItemThreshold: On,
823
- boxItemDiscountText: Pn,
824
- boxItemPlus: kn,
825
- boxItemImage: Fn,
826
- boxItemFallback: Rn,
827
- cta: An,
828
- ctaTotals: Dn,
829
- ctaDiscountBadge: qn,
830
- ctaTotalsWrap: En,
831
- ctaTotalsWrapVisible: Ln,
832
- ctaTotalsStrike: Un,
833
- ctaTotalsPrice: $n
784
+ ], qe = Fe("search", De), Ee = "_backdrop_vl21a_1", Le = "_celebrationOverlay_vl21a_14", $e = "_celebrationChip_vl21a_23", Ue = "_backdropOpen_vl21a_74", ze = "_backdropClosed_vl21a_78", We = "_panel_vl21a_82", Ve = "_panelOpen_vl21a_102", je = "_panelClosed_vl21a_106", Ge = "_header_vl21a_145", Qe = "_headerCenter_vl21a_154", Ye = "_title_vl21a_162", Ke = "_searchIconButton_vl21a_171", He = "_headerTitleWrap_vl21a_193", Xe = "_headerSearchWrap_vl21a_197", Ze = "_headerSearchOpen_vl21a_209", Je = "_searchBar_vl21a_221", tn = "_searchInput_vl21a_233", en = "_searchClearButton_vl21a_254", nn = "_closeButton_vl21a_276", rn = "_body_vl21a_309", an = "_muted_vl21a_314", on = "_error_vl21a_319", sn = "_variants_vl21a_324", cn = "_variantList_vl21a_328", ln = "_variantRow_vl21a_336", un = "_variantLeft_vl21a_344", dn = "_addToBundleButton_vl21a_351", hn = "_variantThumb_vl21a_379", fn = "_variantThumbImg_vl21a_389", mn = "_variantThumbFallback_vl21a_396", pn = "_variantInfo_vl21a_406", bn = "_variantName_vl21a_410", vn = "_variantMeta_vl21a_419", _n = "_variantPriceRow_vl21a_427", yn = "_variantCompareAt_vl21a_434", wn = "_variantPrice_vl21a_427", gn = "_qtyControls_vl21a_445", xn = "_qtyButton_vl21a_451", In = "_qtyValue_vl21a_476", Cn = "_footer_vl21a_483", Bn = "_poweredBy_vl21a_490", Sn = "_boxSummaryWindow_vl21a_502", Nn = "_boxSummaryRow_vl21a_519", Tn = "_boxSlot_vl21a_527", Mn = "_boxItem_vl21a_535", Pn = "_boxItemClickable_vl21a_547", On = "_boxThresholdLabel_vl21a_556", kn = "_boxItemPlaceholder_vl21a_567", An = "_boxItemFilled_vl21a_573", Rn = "_boxItemThreshold_vl21a_579", Fn = "_boxItemDiscountText_vl21a_587", Dn = "_boxItemPlus_vl21a_595", qn = "_boxItemImage_vl21a_602", En = "_boxItemFallback_vl21a_609", Ln = "_ctaButtonGroup_vl21a_620", $n = "_ctaButtonGroupAnimating_vl21a_627", Un = "_cta_vl21a_620", zn = "_ctaDualLeft_vl21a_655", Wn = "_ctaDualLeftAnimating_vl21a_673", Vn = "_ctaDualRight_vl21a_686", jn = "_ctaDualRightAnimating_vl21a_702", Gn = "_ctaTotals_vl21a_713", Qn = "_ctaDiscountBadge_vl21a_721", Yn = "_ctaTotalsWrap_vl21a_735", Kn = "_ctaTotalsWrapVisible_vl21a_748", Hn = "_ctaTotalsStrike_vl21a_755", Xn = "_ctaTotalsPrice_vl21a_762", u = {
785
+ backdrop: Ee,
786
+ celebrationOverlay: Le,
787
+ celebrationChip: $e,
788
+ backdropOpen: Ue,
789
+ backdropClosed: ze,
790
+ panel: We,
791
+ panelOpen: Ve,
792
+ panelClosed: je,
793
+ header: Ge,
794
+ headerCenter: Qe,
795
+ title: Ye,
796
+ searchIconButton: Ke,
797
+ headerTitleWrap: He,
798
+ headerSearchWrap: Xe,
799
+ headerSearchOpen: Ze,
800
+ searchBar: Je,
801
+ searchInput: tn,
802
+ searchClearButton: en,
803
+ closeButton: nn,
804
+ body: rn,
805
+ muted: an,
806
+ error: on,
807
+ variants: sn,
808
+ variantList: cn,
809
+ variantRow: ln,
810
+ variantLeft: un,
811
+ addToBundleButton: dn,
812
+ variantThumb: hn,
813
+ variantThumbImg: fn,
814
+ variantThumbFallback: mn,
815
+ variantInfo: pn,
816
+ variantName: bn,
817
+ variantMeta: vn,
818
+ variantPriceRow: _n,
819
+ variantCompareAt: yn,
820
+ variantPrice: wn,
821
+ qtyControls: gn,
822
+ qtyButton: xn,
823
+ qtyValue: In,
824
+ footer: Cn,
825
+ poweredBy: Bn,
826
+ boxSummaryWindow: Sn,
827
+ boxSummaryRow: Nn,
828
+ boxSlot: Tn,
829
+ boxItem: Mn,
830
+ boxItemClickable: Pn,
831
+ boxThresholdLabel: On,
832
+ boxItemPlaceholder: kn,
833
+ boxItemFilled: An,
834
+ boxItemThreshold: Rn,
835
+ boxItemDiscountText: Fn,
836
+ boxItemPlus: Dn,
837
+ boxItemImage: qn,
838
+ boxItemFallback: En,
839
+ ctaButtonGroup: Ln,
840
+ ctaButtonGroupAnimating: $n,
841
+ cta: Un,
842
+ ctaDualLeft: zn,
843
+ ctaDualLeftAnimating: Wn,
844
+ ctaDualRight: Vn,
845
+ ctaDualRightAnimating: jn,
846
+ ctaTotals: Gn,
847
+ ctaDiscountBadge: Qn,
848
+ ctaTotalsWrap: Yn,
849
+ ctaTotalsWrapVisible: Kn,
850
+ ctaTotalsStrike: Hn,
851
+ ctaTotalsPrice: Xn
834
852
  };
835
- function Hn(i) {
836
- var Xe;
853
+ function or(i) {
854
+ var ee;
837
855
  const {
838
- isOpen: e,
839
- close: t,
840
- loading: o,
856
+ isOpen: t,
857
+ close: e,
858
+ loading: a,
841
859
  submitting: r,
842
860
  error: n,
843
861
  currencyCode: l,
844
862
  config: c,
845
- eligibleVariants: f,
846
- selections: v,
847
- selectionOrder: P,
848
- setQuantity: k,
863
+ eligibleVariants: m,
864
+ selections: w,
865
+ selectionOrder: A,
866
+ setQuantity: R,
849
867
  bundleSize: x,
850
- minRequired: X,
851
- canSubmit: J,
852
- submit: re
853
- } = We(), [M, q] = O(!1), [T, Z] = O(""), g = V(null), we = V(null), ee = V(null), [oe, Ne] = O(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Te, Me] = O(0), [_e, me] = O(null), [Oe, ve] = O(!1), Q = V(null), ge = V(x), de = 7e3, [K, Pe] = O(0), [Y, pe] = O(null), [ie, xe] = O(!1), ae = V(null), y = 2800, C = (a) => {
854
- const s = Number.parseFloat(a);
855
- return Number.isFinite(s) ? String(Math.round(s)) : a;
856
- }, A = (a) => {
857
- const s = (a ?? []).filter((d) => {
858
- var I, w;
859
- const p = (I = d == null ? void 0 : d.name) == null ? void 0 : I.trim(), m = (w = d == null ? void 0 : d.value) == null ? void 0 : w.trim();
860
- return !(!p || !m || p.toLowerCase() === "title");
868
+ minRequired: J,
869
+ canSubmit: E,
870
+ submit: H,
871
+ submitAndCheckout: L
872
+ } = jt(), [P, F] = O(!1), [V, g] = O(""), ft = U(null), st = U(null), wt = U(null), [mt, St] = O(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Nt, Tt] = O(0), [pt, Mt] = O(null), [Pt, bt] = O(!1), tt = U(null), vt = U(x), X = 7e3, [xt, ct] = O(0), [et, gt] = O(null), [lt, It] = O(!1), nt = U(null), Dt = 2800, f = (o) => {
873
+ const s = Number.parseFloat(o);
874
+ return Number.isFinite(s) ? String(Math.round(s)) : o;
875
+ }, C = (o) => {
876
+ const s = (o ?? []).filter((d) => {
877
+ var I, _;
878
+ const b = (I = d == null ? void 0 : d.name) == null ? void 0 : I.trim(), p = (_ = d == null ? void 0 : d.value) == null ? void 0 : _.trim();
879
+ return !(!b || !p || b.toLowerCase() === "title");
861
880
  });
862
881
  return s.length ? s.map((d) => `${d.name}: ${d.value}`).join(" · ") : null;
863
- }, _ = (a) => {
882
+ }, D = (o) => {
864
883
  var s;
865
- return ((s = a.product) == null ? void 0 : s.title) ?? a.displayName ?? a.title;
866
- }, D = (a) => {
867
- const s = _(a), d = A(a.selectedOptions);
884
+ return ((s = o.product) == null ? void 0 : s.title) ?? o.displayName ?? o.title;
885
+ }, y = (o) => {
886
+ const s = D(o), d = C(o.selectedOptions);
868
887
  return [s, d].filter(Boolean).join(" — ");
869
- }, [he, E] = O(e), F = V(null), $ = (a) => {
870
- const s = Number(a);
871
- if (!Number.isFinite(s)) return a;
888
+ }, [rt, q] = O(t), G = U(null), B = (o) => {
889
+ const s = Number(o);
890
+ if (!Number.isFinite(s)) return o;
872
891
  if (l)
873
892
  try {
874
893
  return new Intl.NumberFormat(void 0, { style: "currency", currency: l }).format(s);
875
894
  } catch {
876
895
  }
877
896
  return `$${s.toFixed(2)}`;
878
- }, G = ((Xe = c == null ? void 0 : c.title) == null ? void 0 : Xe.trim()) || "Build your bundle", se = N(() => {
879
- const a = Number((c == null ? void 0 : c.maxBundleSize) ?? NaN), s = Number.isFinite(a) ? Math.floor(a) : 100;
897
+ }, at = ((ee = c == null ? void 0 : c.title) == null ? void 0 : ee.trim()) || "Build your bundle", Q = M(() => {
898
+ const o = Number((c == null ? void 0 : c.maxBundleSize) ?? NaN), s = Number.isFinite(o) ? Math.floor(o) : 100;
880
899
  return Math.max(2, Math.min(100, s));
881
- }, [c == null ? void 0 : c.maxBundleSize]), z = x >= se, L = N(() => [...f].sort((a, s) => a.displayName.localeCompare(s.displayName)), [f]), ce = N(() => {
882
- const a = T.trim().toLowerCase();
883
- if (!a) return L;
884
- const s = a.split(/\s+/).filter(Boolean), d = (p) => {
885
- var w;
886
- const m = [];
887
- m.push(p.displayName), (w = p.product) != null && w.title && m.push(p.product.title);
888
- for (const S of p.selectedOptions ?? [])
889
- m.push(S.name), m.push(S.value);
890
- const I = m.join(" ").toLowerCase();
891
- return s.every((S) => I.includes(S));
900
+ }, [c == null ? void 0 : c.maxBundleSize]), it = x >= Q, $ = M(() => [...m].sort((o, s) => o.displayName.localeCompare(s.displayName)), [m]), Y = M(() => {
901
+ const o = V.trim().toLowerCase();
902
+ if (!o) return $;
903
+ const s = o.split(/\s+/).filter(Boolean), d = (b) => {
904
+ var _;
905
+ const p = [];
906
+ p.push(b.displayName), (_ = b.product) != null && _.title && p.push(b.product.title);
907
+ for (const N of b.selectedOptions ?? [])
908
+ p.push(N.name), p.push(N.value);
909
+ const I = p.join(" ").toLowerCase();
910
+ return s.every((N) => I.includes(N));
892
911
  };
893
- return L.filter(d);
894
- }, [T, L]), B = N(() => [...(c == null ? void 0 : c.rules) ?? []].sort((a, s) => a.minBundleSize - s.minBundleSize), [c == null ? void 0 : c.rules]), b = N(() => Math.max(0, X - x), [x, X]), te = N(() => {
895
- let a = null;
896
- for (const s of B)
897
- x >= s.minBundleSize && (a = s);
898
- return a;
899
- }, [x, B]), le = N(() => {
900
- if (!te) return null;
901
- const a = Number.parseFloat(te.discountPercent);
902
- return !Number.isFinite(a) || a <= 0 ? null : a;
903
- }, [te]), Ie = N(() => {
904
- const a = B[0];
905
- if (!a) return null;
906
- const s = Number.parseFloat(a.discountPercent);
912
+ return $.filter(d);
913
+ }, [V, $]), T = M(() => [...(c == null ? void 0 : c.rules) ?? []].sort((o, s) => o.minBundleSize - s.minBundleSize), [c == null ? void 0 : c.rules]), S = M(() => Math.max(0, J - x), [x, J]), v = M(() => {
914
+ let o = null;
915
+ for (const s of T)
916
+ x >= s.minBundleSize && (o = s);
917
+ return o;
918
+ }, [x, T]), K = M(() => {
919
+ if (!v) return null;
920
+ const o = Number.parseFloat(v.discountPercent);
921
+ return !Number.isFinite(o) || o <= 0 ? null : o;
922
+ }, [v]), Ot = M(() => {
923
+ const o = T[0];
924
+ if (!o) return null;
925
+ const s = Number.parseFloat(o.discountPercent);
907
926
  return !Number.isFinite(s) || s <= 0 ? null : s;
908
- }, [B]), ye = le ?? Ie, Ce = N(() => {
909
- const a = new Map(f.map((d) => [d.id, d]));
927
+ }, [T]), _t = K ?? Ot, ut = M(() => {
928
+ const o = new Map(m.map((d) => [d.id, d]));
910
929
  let s = 0;
911
- for (const [d, p] of Object.entries(v)) {
912
- const m = p ?? 0;
913
- if (m <= 0) continue;
914
- const I = a.get(d), w = Number(I == null ? void 0 : I.price);
915
- Number.isFinite(w) && (s += w * m);
930
+ for (const [d, b] of Object.entries(w)) {
931
+ const p = b ?? 0;
932
+ if (p <= 0) continue;
933
+ const I = o.get(d), _ = Number(I == null ? void 0 : I.price);
934
+ Number.isFinite(_) && (s += _ * p);
916
935
  }
917
936
  return Math.round(s * 100) / 100;
918
- }, [f, v]), at = N(() => {
919
- if (!le) return Ce;
920
- const a = Ce * (1 - le / 100);
921
- return Math.round(a * 100) / 100;
922
- }, [le, Ce]), Qe = N(() => B.length ? Math.max(...B.map((a) => a.minBundleSize)) : 0, [B]), De = N(() => {
923
- const a = new Map(f.map((s) => [s.id, s]));
924
- return P.map((s) => a.get(s)).filter((s) => !!s);
925
- }, [f, P]), st = N(() => {
937
+ }, [m, w]), ue = M(() => {
938
+ if (!K) return ut;
939
+ const o = ut * (1 - K / 100);
940
+ return Math.round(o * 100) / 100;
941
+ }, [K, ut]), Yt = M(() => T.length ? Math.max(...T.map((o) => o.minBundleSize)) : 0, [T]), qt = M(() => {
942
+ const o = new Map(m.map((s) => [s.id, s]));
943
+ return A.map((s) => o.get(s)).filter((s) => !!s);
944
+ }, [m, A]), de = M(() => {
926
945
  var s;
927
- const a = /* @__PURE__ */ new Map();
928
- for (const d of B) {
929
- const p = Math.max(0, d.minBundleSize - 1);
930
- a.set(p, {
946
+ const o = /* @__PURE__ */ new Map();
947
+ for (const d of T) {
948
+ const b = Math.max(0, d.minBundleSize - 1);
949
+ o.set(b, {
931
950
  discountPercent: d.discountPercent,
932
951
  minBundleSize: d.minBundleSize,
933
952
  label: ((s = d.label) == null ? void 0 : s.trim()) || `Buy ${d.minBundleSize}+`
934
953
  });
935
954
  }
936
- return a;
937
- }, [B]), ct = N(() => Math.max(Qe || X, De.length), [De.length, Qe, X]), qe = V(null), Ye = V(null), Ke = V(null), Ge = V(x), He = (a) => {
938
- const s = Ye.current;
955
+ return o;
956
+ }, [T]), he = M(() => Math.max(Yt || J, qt.length), [qt.length, Yt, J]), [Et, Kt] = O(!0), Ht = U(S);
957
+ z(() => {
958
+ if (((c == null ? void 0 : c.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
959
+ const s = Ht.current > 0;
960
+ Kt(!(s && S === 0));
961
+ }
962
+ Ht.current = S;
963
+ }, [S, c == null ? void 0 : c.ctaButtonMode]);
964
+ const Lt = U(null), Xt = U(null), Zt = U(null), Jt = U(x), te = (o) => {
965
+ const s = Xt.current;
939
966
  if (!s) return;
940
- const d = s.querySelector(`[data-variant-row="${a}"]`);
967
+ const d = s.querySelector(`[data-variant-row="${o}"]`);
941
968
  if (!d) return;
942
- const p = s.getBoundingClientRect(), m = d.getBoundingClientRect(), I = 8;
943
- if (m.top >= p.top + I && m.bottom <= p.bottom - I) return;
944
- const S = Math.max(0, s.scrollHeight - s.clientHeight), W = m.top - p.top + m.height / 2, H = s.scrollTop + W - s.clientHeight / 2, ne = Math.min(S, Math.max(0, H));
945
- s.scrollTo({ top: ne, behavior: "smooth" });
969
+ const b = s.getBoundingClientRect(), p = d.getBoundingClientRect(), I = 8;
970
+ if (p.top >= b.top + I && p.bottom <= b.bottom - I) return;
971
+ const N = Math.max(0, s.scrollHeight - s.clientHeight), j = p.top - b.top + p.height / 2, Z = s.scrollTop + j - s.clientHeight / 2, ot = Math.min(N, Math.max(0, Z));
972
+ s.scrollTo({ top: ot, behavior: "smooth" });
946
973
  };
947
- return j(() => {
948
- if (!e) return;
949
- const a = (s) => {
950
- s.key === "Escape" && t();
974
+ return z(() => {
975
+ if (!t) return;
976
+ const o = (s) => {
977
+ s.key === "Escape" && e();
951
978
  };
952
- return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
953
- }, [t, e]), j(() => {
979
+ return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
980
+ }, [e, t]), z(() => {
954
981
  if (typeof window > "u") return;
955
- const a = () => Ne({ width: window.innerWidth, height: window.innerHeight });
956
- return a(), window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
957
- }, []), j(() => {
958
- if (F.current != null && (window.clearTimeout(F.current), F.current = null), e) {
959
- E(!0);
982
+ const o = () => St({ width: window.innerWidth, height: window.innerHeight });
983
+ return o(), window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
984
+ }, []), z(() => {
985
+ if (G.current != null && (window.clearTimeout(G.current), G.current = null), t) {
986
+ q(!0);
960
987
  return;
961
988
  }
962
- F.current = window.setTimeout(() => {
963
- E(!1), F.current = null;
989
+ G.current = window.setTimeout(() => {
990
+ q(!1), G.current = null;
964
991
  }, 220);
965
- }, [e]), j(() => () => {
966
- F.current != null && window.clearTimeout(F.current);
967
- }, []), j(() => () => {
968
- Q.current != null && window.clearTimeout(Q.current);
969
- }, []), j(() => () => {
970
- ae.current != null && window.clearTimeout(ae.current);
971
- }, []), j(() => {
972
- if (!e || !M) return;
973
- const a = requestAnimationFrame(() => {
992
+ }, [t]), z(() => () => {
993
+ G.current != null && window.clearTimeout(G.current);
994
+ }, []), z(() => () => {
995
+ tt.current != null && window.clearTimeout(tt.current);
996
+ }, []), z(() => () => {
997
+ nt.current != null && window.clearTimeout(nt.current);
998
+ }, []), z(() => {
999
+ if (!t || !P) return;
1000
+ const o = requestAnimationFrame(() => {
974
1001
  var s;
975
- return (s = g.current) == null ? void 0 : s.focus();
1002
+ return (s = ft.current) == null ? void 0 : s.focus();
976
1003
  });
977
- return () => cancelAnimationFrame(a);
978
- }, [e, M]), j(() => {
979
- const a = Ge.current;
980
- if (Ge.current = x, x <= a) return;
981
- const s = Ke.current;
1004
+ return () => cancelAnimationFrame(o);
1005
+ }, [t, P]), z(() => {
1006
+ const o = Jt.current;
1007
+ if (Jt.current = x, x <= o) return;
1008
+ const s = Zt.current;
982
1009
  if (!s) return;
983
- const d = B.some((w) => w.minBundleSize === x), p = B.find((w) => w.minBundleSize > x), m = p && d ? p.minBundleSize - 1 : p ? null : x - 1;
984
- if (m == null || m < 0) return;
1010
+ const d = T.some((_) => _.minBundleSize === x), b = T.find((_) => _.minBundleSize > x), p = b && d ? b.minBundleSize - 1 : b ? null : x - 1;
1011
+ if (p == null || p < 0) return;
985
1012
  const I = requestAnimationFrame(() => {
986
- const w = s.querySelector(`[data-box-slot="${m}"]`);
987
- if (!w) return;
988
- const S = s.getBoundingClientRect(), H = w.getBoundingClientRect().right - S.right;
989
- if (H <= 1) return;
990
- const ne = Math.max(0, s.scrollWidth - s.clientWidth), fe = Math.min(ne, Math.max(0, s.scrollLeft + H));
991
- s.scrollTo({ left: fe, behavior: "smooth" });
1013
+ const _ = s.querySelector(`[data-box-slot="${p}"]`);
1014
+ if (!_) return;
1015
+ const N = s.getBoundingClientRect(), Z = _.getBoundingClientRect().right - N.right;
1016
+ if (Z <= 1) return;
1017
+ const ot = Math.max(0, s.scrollWidth - s.clientWidth), yt = Math.min(ot, Math.max(0, s.scrollLeft + Z));
1018
+ s.scrollTo({ left: yt, behavior: "smooth" });
992
1019
  });
993
1020
  return () => cancelAnimationFrame(I);
994
- }, [x, B]), j(() => {
995
- if (!e) return;
996
- const a = ge.current;
997
- if (ge.current = x, x <= a) return;
998
- const s = B.find((d) => d.minBundleSize === x);
999
- s && (pe(`You received a ${C(s.discountPercent)}% discount!`), Pe((d) => d + 1), xe(!0), ae.current != null && window.clearTimeout(ae.current), ae.current = window.setTimeout(() => {
1000
- xe(!1), ae.current = null;
1001
- }, y));
1002
- }, [x, e, B]), j(() => {
1003
- if (!e || !ie || !Y) return;
1004
- const a = requestAnimationFrame(() => {
1005
- var S;
1006
- const s = ee.current, d = s == null ? void 0 : s.getBoundingClientRect(), p = (S = qe.current) == null ? void 0 : S.getBoundingClientRect(), m = d ? d.left + d.width / 2 : p ? p.left + p.width / 2 : window.innerWidth / 2, I = d ? d.top + d.height / 2 : p ? p.top + p.height / 2 : window.innerHeight / 2, w = {
1007
- x: m - 2,
1021
+ }, [x, T]), z(() => {
1022
+ if (!t) return;
1023
+ const o = vt.current;
1024
+ if (vt.current = x, x <= o) return;
1025
+ const s = T.find((d) => d.minBundleSize === x);
1026
+ s && (gt(`You received a ${f(s.discountPercent)}% discount!`), ct((d) => d + 1), It(!0), nt.current != null && window.clearTimeout(nt.current), nt.current = window.setTimeout(() => {
1027
+ It(!1), nt.current = null;
1028
+ }, Dt));
1029
+ }, [x, t, T]), z(() => {
1030
+ if (!t || !lt || !et) return;
1031
+ const o = requestAnimationFrame(() => {
1032
+ var N;
1033
+ const s = wt.current, d = s == null ? void 0 : s.getBoundingClientRect(), b = (N = Lt.current) == null ? void 0 : N.getBoundingClientRect(), p = d ? d.left + d.width / 2 : b ? b.left + b.width / 2 : window.innerWidth / 2, I = d ? d.top + d.height / 2 : b ? b.top + b.height / 2 : window.innerHeight / 2, _ = {
1034
+ x: p - 2,
1008
1035
  y: I - 2,
1009
1036
  w: 4,
1010
1037
  h: 4
1011
1038
  };
1012
- me(w), Me((W) => W + 1), ve(!0), Q.current != null && window.clearTimeout(Q.current), Q.current = window.setTimeout(() => {
1013
- ve(!1), Q.current = null;
1014
- }, de);
1039
+ Mt(_), Tt((j) => j + 1), bt(!0), tt.current != null && window.clearTimeout(tt.current), tt.current = window.setTimeout(() => {
1040
+ bt(!1), tt.current = null;
1041
+ }, X);
1015
1042
  });
1016
- return () => cancelAnimationFrame(a);
1017
- }, [K, Y, de, ie, e]), j(() => {
1018
- var a;
1019
- e && ((a = qe.current) == null || a.focus());
1020
- }, [e]), he ? /* @__PURE__ */ R(
1043
+ return () => cancelAnimationFrame(o);
1044
+ }, [xt, et, X, lt, t]), z(() => {
1045
+ var o;
1046
+ t && ((o = Lt.current) == null || o.focus());
1047
+ }, [t]), rt ? /* @__PURE__ */ k(
1021
1048
  "div",
1022
1049
  {
1023
1050
  role: "dialog",
1024
1051
  "aria-modal": "true",
1025
1052
  "aria-label": "Bundle builder",
1026
- className: [u.backdrop, e ? u.backdropOpen : u.backdropClosed, i.className].filter(Boolean).join(" "),
1027
- onMouseDown: (a) => {
1028
- a.target === a.currentTarget && t();
1053
+ className: [u.backdrop, t ? u.backdropOpen : u.backdropClosed, i.className].filter(Boolean).join(" "),
1054
+ onMouseDown: (o) => {
1055
+ o.target === o.currentTarget && e();
1029
1056
  },
1030
1057
  children: [
1031
- Oe && _e && oe.width > 0 && oe.height > 0 ? /* @__PURE__ */ h(
1032
- St,
1058
+ Pt && pt && mt.width > 0 && mt.height > 0 ? /* @__PURE__ */ h(
1059
+ Me,
1033
1060
  {
1034
- width: oe.width,
1035
- height: oe.height,
1036
- confettiSource: _e,
1061
+ width: mt.width,
1062
+ height: mt.height,
1063
+ confettiSource: pt,
1037
1064
  colors: [
1038
1065
  "#2563eb",
1039
1066
  // blue-600
@@ -1056,52 +1083,52 @@ function Hn(i) {
1056
1083
  initialVelocityX: { min: -6, max: 6 },
1057
1084
  style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
1058
1085
  },
1059
- Te
1086
+ Nt
1060
1087
  ) : null,
1061
- /* @__PURE__ */ R("aside", { ref: qe, className: [u.panel, e ? u.panelOpen : u.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1062
- ie && Y ? /* @__PURE__ */ h("div", { className: u.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ h("div", { ref: ee, className: u.celebrationChip, children: Y }, K) }) : null,
1063
- /* @__PURE__ */ R("header", { className: [u.header, M ? u.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1088
+ /* @__PURE__ */ k("aside", { ref: Lt, className: [u.panel, t ? u.panelOpen : u.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1089
+ lt && et ? /* @__PURE__ */ h("div", { className: u.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ h("div", { ref: wt, className: u.celebrationChip, children: et }, xt) }) : null,
1090
+ /* @__PURE__ */ k("header", { className: [u.header, P ? u.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1064
1091
  /* @__PURE__ */ h(
1065
1092
  "button",
1066
1093
  {
1067
1094
  type: "button",
1068
1095
  className: u.searchIconButton,
1069
- "aria-label": M ? "Search (expanded)" : "Search",
1070
- "aria-expanded": M,
1096
+ "aria-label": P ? "Search (expanded)" : "Search",
1097
+ "aria-expanded": P,
1071
1098
  onClick: () => {
1072
- q(!0);
1099
+ F(!0);
1073
1100
  },
1074
- children: /* @__PURE__ */ h(Ft, { size: 18, "aria-hidden": "true" })
1101
+ children: /* @__PURE__ */ h(qe, { size: 18, "aria-hidden": "true" })
1075
1102
  }
1076
1103
  ),
1077
- /* @__PURE__ */ R("div", { className: u.headerCenter, children: [
1078
- /* @__PURE__ */ h("div", { className: u.headerTitleWrap, "aria-hidden": M, children: /* @__PURE__ */ h("h2", { className: u.title, children: G }) }),
1079
- /* @__PURE__ */ h("div", { className: u.headerSearchWrap, "aria-hidden": !M, children: /* @__PURE__ */ R("div", { className: u.searchBar, children: [
1104
+ /* @__PURE__ */ k("div", { className: u.headerCenter, children: [
1105
+ /* @__PURE__ */ h("div", { className: u.headerTitleWrap, "aria-hidden": P, children: /* @__PURE__ */ h("h2", { className: u.title, children: at }) }),
1106
+ /* @__PURE__ */ h("div", { className: u.headerSearchWrap, "aria-hidden": !P, children: /* @__PURE__ */ k("div", { className: u.searchBar, children: [
1080
1107
  /* @__PURE__ */ h(
1081
1108
  "input",
1082
1109
  {
1083
- ref: g,
1110
+ ref: ft,
1084
1111
  className: u.searchInput,
1085
1112
  type: "search",
1086
- value: T,
1113
+ value: V,
1087
1114
  placeholder: "Search",
1088
- onChange: (a) => Z(a.target.value),
1115
+ onChange: (o) => g(o.target.value),
1089
1116
  onBlur: () => {
1090
- T.trim() === "" && q(!1);
1117
+ V.trim() === "" && F(!1);
1091
1118
  }
1092
1119
  }
1093
1120
  ),
1094
- T.trim() ? /* @__PURE__ */ h(
1121
+ V.trim() ? /* @__PURE__ */ h(
1095
1122
  "button",
1096
1123
  {
1097
1124
  type: "button",
1098
1125
  className: u.searchClearButton,
1099
- onMouseDown: (a) => {
1100
- a.preventDefault();
1126
+ onMouseDown: (o) => {
1127
+ o.preventDefault();
1101
1128
  },
1102
1129
  onClick: () => {
1103
- var a;
1104
- Z(""), (a = g.current) == null || a.focus();
1130
+ var o;
1131
+ g(""), (o = ft.current) == null || o.focus();
1105
1132
  },
1106
1133
  "aria-label": "Clear search",
1107
1134
  children: "Clear"
@@ -1109,33 +1136,33 @@ function Hn(i) {
1109
1136
  ) : null
1110
1137
  ] }) })
1111
1138
  ] }),
1112
- /* @__PURE__ */ h("button", { type: "button", onClick: t, disabled: r, className: u.closeButton, "aria-label": "Close", children: "×" })
1139
+ /* @__PURE__ */ h("button", { type: "button", onClick: e, disabled: r, className: u.closeButton, "aria-label": "Close", children: "×" })
1113
1140
  ] }),
1114
- /* @__PURE__ */ R("div", { className: u.body, ref: Ye, children: [
1115
- o ? /* @__PURE__ */ h("p", { className: u.muted, children: "Loading…" }) : null,
1141
+ /* @__PURE__ */ k("div", { className: u.body, ref: Xt, children: [
1142
+ a ? /* @__PURE__ */ h("p", { className: u.muted, children: "Loading…" }) : null,
1116
1143
  n ? /* @__PURE__ */ h("p", { className: u.error, children: n }) : null,
1117
- !o && c && !c.isActive ? /* @__PURE__ */ h("p", { className: u.error, children: "Bundles are not active." }) : null,
1118
- /* @__PURE__ */ h("div", { className: u.variants, children: /* @__PURE__ */ h("ul", { className: u.variantList, children: ce.map((a) => {
1119
- var H, ne, fe, Se;
1120
- const s = v[a.id] ?? 0, d = _(a), p = A(a.selectedOptions), m = D(a), I = ye, w = Number(a.price), S = I != null && Number.isFinite(I) && I > 0 && Number.isFinite(w), W = S ? Math.round(w * (1 - I / 100) * 100) / 100 : null;
1121
- return /* @__PURE__ */ R("li", { className: u.variantRow, "data-variant-row": a.id, children: [
1122
- /* @__PURE__ */ R("div", { className: u.variantLeft, children: [
1123
- /* @__PURE__ */ h("div", { className: u.variantThumb, "aria-hidden": "true", children: (H = a.image) != null && H.url ? /* @__PURE__ */ h(
1144
+ !a && c && !c.isActive ? /* @__PURE__ */ h("p", { className: u.error, children: "Bundles are not active." }) : null,
1145
+ /* @__PURE__ */ h("div", { className: u.variants, children: /* @__PURE__ */ h("ul", { className: u.variantList, children: Y.map((o) => {
1146
+ var Z, ot, yt, Ct;
1147
+ const s = w[o.id] ?? 0, d = D(o), b = C(o.selectedOptions), p = y(o), I = _t, _ = Number(o.price), N = I != null && Number.isFinite(I) && I > 0 && Number.isFinite(_), j = N ? Math.round(_ * (1 - I / 100) * 100) / 100 : null;
1148
+ return /* @__PURE__ */ k("li", { className: u.variantRow, "data-variant-row": o.id, children: [
1149
+ /* @__PURE__ */ k("div", { className: u.variantLeft, children: [
1150
+ /* @__PURE__ */ h("div", { className: u.variantThumb, "aria-hidden": "true", children: (Z = o.image) != null && Z.url ? /* @__PURE__ */ h(
1124
1151
  "img",
1125
1152
  {
1126
1153
  className: u.variantThumbImg,
1127
- src: a.image.url,
1128
- alt: a.image.altText ?? m,
1154
+ src: o.image.url,
1155
+ alt: o.image.altText ?? p,
1129
1156
  loading: "lazy"
1130
1157
  }
1131
- ) : /* @__PURE__ */ h("div", { className: u.variantThumbFallback, children: ((Se = (fe = (ne = a.product) == null ? void 0 : ne.title) == null ? void 0 : fe.slice(0, 1)) == null ? void 0 : Se.toUpperCase()) ?? "•" }) }),
1132
- /* @__PURE__ */ R("div", { className: u.variantInfo, children: [
1158
+ ) : /* @__PURE__ */ h("div", { className: u.variantThumbFallback, children: ((Ct = (yt = (ot = o.product) == null ? void 0 : ot.title) == null ? void 0 : yt.slice(0, 1)) == null ? void 0 : Ct.toUpperCase()) ?? "•" }) }),
1159
+ /* @__PURE__ */ k("div", { className: u.variantInfo, children: [
1133
1160
  /* @__PURE__ */ h("div", { className: u.variantName, children: d }),
1134
- p ? /* @__PURE__ */ h("div", { className: u.variantMeta, children: p }) : null,
1135
- /* @__PURE__ */ R("div", { className: u.variantPriceRow, children: [
1136
- S ? /* @__PURE__ */ h("span", { className: u.variantCompareAt, children: $(Number.isFinite(w) ? w.toFixed(2) : a.price) }) : null,
1137
- /* @__PURE__ */ h("span", { className: u.variantPrice, children: $(
1138
- W != null ? W.toFixed(2) : Number.isFinite(w) ? w.toFixed(2) : a.price
1161
+ b ? /* @__PURE__ */ h("div", { className: u.variantMeta, children: b }) : null,
1162
+ /* @__PURE__ */ k("div", { className: u.variantPriceRow, children: [
1163
+ N ? /* @__PURE__ */ h("span", { className: u.variantCompareAt, children: B(Number.isFinite(_) ? _.toFixed(2) : o.price) }) : null,
1164
+ /* @__PURE__ */ h("span", { className: u.variantPrice, children: B(
1165
+ j != null ? j.toFixed(2) : Number.isFinite(_) ? _.toFixed(2) : o.price
1139
1166
  ) })
1140
1167
  ] })
1141
1168
  ] })
@@ -1144,21 +1171,21 @@ function Hn(i) {
1144
1171
  "button",
1145
1172
  {
1146
1173
  type: "button",
1147
- onClick: () => k(a.id, 1),
1148
- disabled: r || z,
1174
+ onClick: () => R(o.id, 1),
1175
+ disabled: r || it,
1149
1176
  className: u.addToBundleButton,
1150
- "aria-label": `Add ${m} to bundle`,
1177
+ "aria-label": `Add ${p} to bundle`,
1151
1178
  children: "Add"
1152
1179
  }
1153
- ) : /* @__PURE__ */ R("div", { className: u.qtyControls, children: [
1180
+ ) : /* @__PURE__ */ k("div", { className: u.qtyControls, children: [
1154
1181
  /* @__PURE__ */ h(
1155
1182
  "button",
1156
1183
  {
1157
1184
  type: "button",
1158
- onClick: () => k(a.id, s - 1),
1185
+ onClick: () => R(o.id, s - 1),
1159
1186
  disabled: r || s <= 0,
1160
1187
  className: u.qtyButton,
1161
- "aria-label": `Decrease ${m}`,
1188
+ "aria-label": `Decrease ${p}`,
1162
1189
  children: "−"
1163
1190
  }
1164
1191
  ),
@@ -1167,40 +1194,40 @@ function Hn(i) {
1167
1194
  "button",
1168
1195
  {
1169
1196
  type: "button",
1170
- onClick: () => k(a.id, s + 1),
1171
- disabled: r || z,
1197
+ onClick: () => R(o.id, s + 1),
1198
+ disabled: r || it,
1172
1199
  className: u.qtyButton,
1173
- "aria-label": `Increase ${m}`,
1200
+ "aria-label": `Increase ${p}`,
1174
1201
  children: "+"
1175
1202
  }
1176
1203
  )
1177
1204
  ] })
1178
- ] }, a.id);
1205
+ ] }, o.id);
1179
1206
  }) }) })
1180
1207
  ] }),
1181
- /* @__PURE__ */ R("footer", { className: u.footer, ref: we, children: [
1182
- /* @__PURE__ */ h("div", { className: u.boxSummaryWindow, ref: Ke, children: /* @__PURE__ */ h("div", { className: u.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ct }).map((a, s) => {
1183
- var H, ne, fe, Se;
1184
- const d = De[s], p = st.get(s), m = !!d, I = !!p, w = I && !m, S = p ? `${p.discountPercent}% off` : null, W = m ? d.displayName : `Slot ${s + 1}`;
1185
- return /* @__PURE__ */ R("div", { "data-box-slot": s, className: u.boxSlot, children: [
1208
+ /* @__PURE__ */ k("footer", { className: u.footer, ref: st, children: [
1209
+ /* @__PURE__ */ h("div", { className: u.boxSummaryWindow, ref: Zt, children: /* @__PURE__ */ h("div", { className: u.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: he }).map((o, s) => {
1210
+ var Z, ot, yt, Ct;
1211
+ const d = qt[s], b = de.get(s), p = !!d, I = !!b, _ = I && !p, N = b ? `${b.discountPercent}% off` : null, j = p ? d.displayName : `Slot ${s + 1}`;
1212
+ return /* @__PURE__ */ k("div", { "data-box-slot": s, className: u.boxSlot, children: [
1186
1213
  /* @__PURE__ */ h(
1187
1214
  "div",
1188
1215
  {
1189
1216
  className: [
1190
1217
  u.boxItem,
1191
- m ? u.boxItemFilled : u.boxItemPlaceholder,
1218
+ p ? u.boxItemFilled : u.boxItemPlaceholder,
1192
1219
  I ? u.boxItemThreshold : null,
1193
- m ? u.boxItemClickable : null
1220
+ p ? u.boxItemClickable : null
1194
1221
  ].filter(Boolean).join(" "),
1195
- role: m ? "button" : void 0,
1196
- tabIndex: m ? 0 : void 0,
1197
- onClick: m ? () => He(d.id) : void 0,
1198
- onKeyDown: m ? (Ee) => {
1199
- (Ee.key === "Enter" || Ee.key === " ") && (Ee.preventDefault(), He(d.id));
1222
+ role: p ? "button" : void 0,
1223
+ tabIndex: p ? 0 : void 0,
1224
+ onClick: p ? () => te(d.id) : void 0,
1225
+ onKeyDown: p ? ($t) => {
1226
+ ($t.key === "Enter" || $t.key === " ") && ($t.preventDefault(), te(d.id));
1200
1227
  } : void 0,
1201
- "aria-label": w && S ? `${W}. Unlocks ${S}.` : W,
1202
- title: w && S ? `${W} • Unlocks ${S}` : W,
1203
- children: m ? (H = d.image) != null && H.url ? /* @__PURE__ */ h(
1228
+ "aria-label": _ && N ? `${j}. Unlocks ${N}.` : j,
1229
+ title: _ && N ? `${j} • Unlocks ${N}` : j,
1230
+ children: p ? (Z = d.image) != null && Z.url ? /* @__PURE__ */ h(
1204
1231
  "img",
1205
1232
  {
1206
1233
  className: u.boxItemImage,
@@ -1208,32 +1235,56 @@ function Hn(i) {
1208
1235
  alt: d.image.altText ?? d.displayName,
1209
1236
  loading: "lazy"
1210
1237
  }
1211
- ) : /* @__PURE__ */ h("div", { className: u.boxItemFallback, "aria-hidden": "true", children: ((Se = (fe = (ne = d.product) == null ? void 0 : ne.title) == null ? void 0 : fe.slice(0, 1)) == null ? void 0 : Se.toUpperCase()) ?? "•" }) : w && S ? /* @__PURE__ */ h("div", { className: u.boxItemDiscountText, children: S }) : /* @__PURE__ */ h("div", { className: u.boxItemPlus, "aria-hidden": "true", children: "+" })
1238
+ ) : /* @__PURE__ */ h("div", { className: u.boxItemFallback, "aria-hidden": "true", children: ((Ct = (yt = (ot = d.product) == null ? void 0 : ot.title) == null ? void 0 : yt.slice(0, 1)) == null ? void 0 : Ct.toUpperCase()) ?? "•" }) : _ && N ? /* @__PURE__ */ h("div", { className: u.boxItemDiscountText, children: N }) : /* @__PURE__ */ h("div", { className: u.boxItemPlus, "aria-hidden": "true", children: "+" })
1212
1239
  }
1213
1240
  ),
1214
- I ? /* @__PURE__ */ h("div", { className: u.boxThresholdLabel, children: p.label }) : null
1241
+ I ? /* @__PURE__ */ h("div", { className: u.boxThresholdLabel, children: b.label }) : null
1215
1242
  ] }, s);
1216
1243
  }) }) }),
1217
1244
  /* @__PURE__ */ h(
1218
1245
  "div",
1219
1246
  {
1220
- className: [u.ctaTotalsWrap, b <= 0 ? u.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1221
- "aria-hidden": b > 0,
1222
- children: /* @__PURE__ */ R("div", { className: u.ctaTotals, "aria-label": "Totals", children: [
1223
- ye ? /* @__PURE__ */ R("span", { className: u.ctaDiscountBadge, children: [
1224
- ye,
1247
+ className: [u.ctaTotalsWrap, S <= 0 ? u.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1248
+ "aria-hidden": S > 0,
1249
+ children: /* @__PURE__ */ k("div", { className: u.ctaTotals, "aria-label": "Totals", children: [
1250
+ _t ? /* @__PURE__ */ k("span", { className: u.ctaDiscountBadge, children: [
1251
+ _t,
1225
1252
  "% Discount"
1226
1253
  ] }) : /* @__PURE__ */ h("span", {}),
1227
- /* @__PURE__ */ h("span", { children: le ? /* @__PURE__ */ R(lt, { children: [
1228
- /* @__PURE__ */ h("span", { className: u.ctaTotalsStrike, children: $(Ce.toFixed(2)) }),
1254
+ /* @__PURE__ */ h("span", { children: K ? /* @__PURE__ */ k(fe, { children: [
1255
+ /* @__PURE__ */ h("span", { className: u.ctaTotalsStrike, children: B(ut.toFixed(2)) }),
1229
1256
  " ",
1230
- /* @__PURE__ */ h("span", { className: u.ctaTotalsPrice, children: $(at.toFixed(2)) })
1231
- ] }) : /* @__PURE__ */ h("span", { className: u.ctaTotalsPrice, children: $(Ce.toFixed(2)) }) })
1257
+ /* @__PURE__ */ h("span", { className: u.ctaTotalsPrice, children: B(ue.toFixed(2)) })
1258
+ ] }) : /* @__PURE__ */ h("span", { className: u.ctaTotalsPrice, children: B(ut.toFixed(2)) }) })
1232
1259
  ] })
1233
1260
  }
1234
1261
  ),
1235
- /* @__PURE__ */ h("button", { type: "button", onClick: re, disabled: !J, className: u.cta, children: r ? "Adding…" : b > 0 ? `Add ${b} more product${b === 1 ? "" : "s"}` : "Add to Basket" }),
1236
- /* @__PURE__ */ R("div", { className: u.poweredBy, children: [
1262
+ (() => {
1263
+ const o = (c == null ? void 0 : c.ctaButtonMode) || "add_to_cart";
1264
+ return o === "add_to_cart_checkout" ? S > 0 ? /* @__PURE__ */ h("button", { type: "button", onClick: H, disabled: !E, className: u.cta, children: r ? "Adding…" : `Add ${S} more product${S === 1 ? "" : "s"}` }) : /* @__PURE__ */ k("div", { className: `${u.ctaButtonGroup} ${Et ? u.ctaButtonGroupAnimating : ""}`, children: [
1265
+ /* @__PURE__ */ h(
1266
+ "button",
1267
+ {
1268
+ type: "button",
1269
+ onClick: H,
1270
+ disabled: !E,
1271
+ className: `${u.ctaDualLeft} ${Et ? u.ctaDualLeftAnimating : ""}`,
1272
+ children: /* @__PURE__ */ h("span", { children: r ? "Adding…" : "Add to Basket" })
1273
+ }
1274
+ ),
1275
+ /* @__PURE__ */ h(
1276
+ "button",
1277
+ {
1278
+ type: "button",
1279
+ onClick: L,
1280
+ disabled: !E,
1281
+ className: `${u.ctaDualRight} ${Et ? u.ctaDualRightAnimating : ""}`,
1282
+ children: /* @__PURE__ */ h("span", { children: r ? "Processing…" : "Checkout" })
1283
+ }
1284
+ )
1285
+ ] }) : o === "checkout" ? /* @__PURE__ */ h("button", { type: "button", onClick: L, disabled: !E, className: u.cta, children: r ? "Processing…" : S > 0 ? `Add ${S} more product${S === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ h("button", { type: "button", onClick: H, disabled: !E, className: u.cta, children: r ? "Adding…" : S > 0 ? `Add ${S} more product${S === 1 ? "" : "s"}` : "Add to Basket" });
1286
+ })(),
1287
+ /* @__PURE__ */ k("div", { className: u.poweredBy, children: [
1237
1288
  "powered by ",
1238
1289
  /* @__PURE__ */ h("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
1239
1290
  ] })
@@ -1243,30 +1294,30 @@ function Hn(i) {
1243
1294
  }
1244
1295
  ) : null;
1245
1296
  }
1246
- function nt(i) {
1297
+ function oe(i) {
1247
1298
  if (i != null && i.length)
1248
- return i.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
1299
+ return i.reduce((t, e) => (e != null && e.key && (t[e.key] = e.value ?? ""), t), {});
1249
1300
  }
1250
- function zn(i) {
1251
- const e = /\/(\d+)$/.exec(i);
1252
- return e ? e[1] : i;
1301
+ function Zn(i) {
1302
+ const t = /\/(\d+)$/.exec(i);
1303
+ return t ? t[1] : i;
1253
1304
  }
1254
- function Wn() {
1305
+ function Jn() {
1255
1306
  var i;
1256
1307
  return ((i = window == null ? void 0 : window.routes) == null ? void 0 : i.cart_url) || "/cart";
1257
1308
  }
1258
- async function Vn() {
1309
+ async function tr() {
1259
1310
  try {
1260
- const i = Wn(), e = encodeURIComponent("cart-drawer,cart-icon-bubble,cart-live-region-text"), t = await fetch(`${i}?sections=${e}`, { method: "GET" });
1261
- if (!t.ok) return;
1262
- const o = await t.json().catch(() => null);
1263
- if (!o) return;
1311
+ const i = Jn(), t = encodeURIComponent("cart-drawer,cart-icon-bubble,cart-live-region-text"), e = await fetch(`${i}?sections=${t}`, { method: "GET" });
1312
+ if (!e.ok) return;
1313
+ const a = await e.json().catch(() => null);
1314
+ if (!a) return;
1264
1315
  const r = ["cart-drawer", "cart-icon-bubble", "cart-live-region-text"];
1265
1316
  for (const c of r) {
1266
- const f = o[c];
1267
- if (!f) continue;
1268
- const v = new DOMParser().parseFromString(f, "text/html"), P = v.getElementById(c) || v.querySelector(c), k = document.getElementById(c) || document.querySelector(c);
1269
- k && P && k.replaceWith(P);
1317
+ const m = a[c];
1318
+ if (!m) continue;
1319
+ const w = new DOMParser().parseFromString(m, "text/html"), A = w.getElementById(c) || w.querySelector(c), R = document.getElementById(c) || document.querySelector(c);
1320
+ R && A && R.replaceWith(A);
1270
1321
  }
1271
1322
  const n = document.querySelector("cart-drawer");
1272
1323
  if (n && typeof n.open == "function") {
@@ -1279,57 +1330,60 @@ async function Vn() {
1279
1330
  } catch {
1280
1331
  }
1281
1332
  }
1282
- async function $e(i, e) {
1283
- const t = await fetch(i, {
1333
+ async function Wt(i, t) {
1334
+ const e = await fetch(i, {
1284
1335
  method: "POST",
1285
1336
  headers: {
1286
1337
  Accept: "application/json",
1287
1338
  "Content-Type": "application/json"
1288
1339
  },
1289
- body: JSON.stringify(e)
1340
+ body: JSON.stringify(t)
1290
1341
  });
1291
- if (!t.ok) {
1292
- const o = await t.text().catch(() => "");
1293
- throw new Error(o || `Cart request failed: ${t.status}`);
1342
+ if (!e.ok) {
1343
+ const a = await e.text().catch(() => "");
1344
+ throw new Error(a || `Cart request failed: ${e.status}`);
1294
1345
  }
1295
- return t.json().catch(() => null);
1346
+ return e.json().catch(() => null);
1296
1347
  }
1297
- function Xn() {
1348
+ function sr() {
1298
1349
  return {
1299
1350
  async linesAdd(i) {
1300
- const e = i.map((t) => ({
1301
- id: zn(t.merchandiseId),
1302
- quantity: t.quantity,
1303
- properties: nt(t.attributes)
1351
+ const t = i.map((e) => ({
1352
+ id: Zn(e.merchandiseId),
1353
+ quantity: e.quantity,
1354
+ properties: oe(e.attributes)
1304
1355
  }));
1305
- await $e("/cart/add.js", { items: e });
1356
+ await Wt("/cart/add.js", { items: t });
1306
1357
  },
1307
1358
  async linesUpdate(i) {
1308
- for (const e of i)
1309
- await $e("/cart/change.js", {
1310
- id: e.id,
1311
- quantity: e.quantity,
1312
- properties: nt(e.attributes)
1359
+ for (const t of i)
1360
+ await Wt("/cart/change.js", {
1361
+ id: t.id,
1362
+ quantity: t.quantity,
1363
+ properties: oe(t.attributes)
1313
1364
  });
1314
1365
  },
1315
1366
  async linesRemove(i) {
1316
- for (const e of i)
1317
- await $e("/cart/change.js", { id: e, quantity: 0 });
1367
+ for (const t of i)
1368
+ await Wt("/cart/change.js", { id: t, quantity: 0 });
1318
1369
  },
1319
1370
  openCartUI() {
1320
1371
  window.setTimeout(() => {
1321
- Vn();
1372
+ tr();
1322
1373
  }, 0);
1374
+ },
1375
+ navigateToCheckout() {
1376
+ window.location.href = "/checkout";
1323
1377
  }
1324
1378
  };
1325
1379
  }
1326
1380
  export {
1327
- Hn as BundleBuilderDrawer,
1328
- Gn as BundleButton,
1329
- ke as BundleLineAttributeKeys,
1330
- Yn as BundleProvider,
1331
- Xn as createLiquidCartAdapter,
1332
- We as useBundleBuilder,
1333
- Kn as useBundleBuilderDrawer
1381
+ or as BundleBuilderDrawer,
1382
+ ir as BundleButton,
1383
+ kt as BundleLineAttributeKeys,
1384
+ rr as BundleProvider,
1385
+ sr as createLiquidCartAdapter,
1386
+ jt as useBundleBuilder,
1387
+ ar as useBundleBuilderDrawer
1334
1388
  };
1335
1389
  //# sourceMappingURL=index.js.map