@best-bundles/bundle-ui 0.0.21 → 0.0.23

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