@best-bundles/bundle-ui 0.0.40 → 0.0.42

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,82 +1,82 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.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_ta0om_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 2147483647);display:flex;justify-content:flex-end;background:var(--bb-backdrop-bg, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(var(--bb-backdrop-blur, 2px));backdrop-filter:blur(var(--bb-backdrop-blur, 2px));padding:var(--bb-backdrop-padding, 12px);opacity:0;transition:opacity var(--bb-drawer-transition-duration, .22s) ease}._celebrationOverlay_ta0om_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_ta0om_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_ta0om_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_ta0om_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_ta0om_74{opacity:1}._backdropClosed_ta0om_78{opacity:0}._panel_ta0om_82{width:440px;max-width:100%;min-width:0;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_ta0om_103{animation:_bbSlideInFromRight_ta0om_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_ta0om_107{animation:_bbSlideOutToRight_ta0om_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_ta0om_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_ta0om_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_ta0om_1{transition:none}._celebrationChip_ta0om_23,._panelOpen_ta0om_103,._panelClosed_ta0om_107{animation:none}}._header_ta0om_146{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_ta0om_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_ta0om_163{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_ta0om_172{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;padding:0}._searchIconButton_ta0om_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_ta0om_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_ta0om_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_ta0om_199{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_ta0om_211 ._headerTitleWrap_ta0om_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_ta0om_211 ._headerSearchWrap_ta0om_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_ta0om_223{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_ta0om_235{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_ta0om_235::-webkit-search-cancel-button,._searchInput_ta0om_235::-webkit-search-decoration,._searchInput_ta0om_235::-webkit-search-results-button,._searchInput_ta0om_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_ta0om_256{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_ta0om_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_ta0om_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_ta0om_278{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;padding:0}._closeButton_ta0om_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_ta0om_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_ta0om_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_ta0om_195,._headerSearchWrap_ta0om_199{transition:none}}._body_ta0om_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_ta0om_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_ta0om_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_ta0om_327{margin-top:4px}._variantList_ta0om_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_ta0om_339{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_ta0om_347{opacity:.65}._variantLeft_ta0om_351{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_ta0om_358{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_ta0om_358:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_ta0om_358:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_ta0om_358:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_ta0om_386{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._stockLimitContainer_ta0om_394{display:flex;align-items:center;justify-content:center;height:100%;max-width:120px;padding:0 12px}._soldOut_ta0om_386{align-self:center;text-align:center;color:var(--bb-muted-color, rgba(17, 24, 39));font-size:.9em;font-weight:600;pointer-events:none}._stockLimitNotice_ta0om_412{color:var(--bb-muted-color, rgba(17, 24, 39, .72));font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;text-align:center}._variantThumb_ta0om_421{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_ta0om_431{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_ta0om_438{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_ta0om_448{min-width:0}._variantName_ta0om_452{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_ta0om_461{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_ta0om_469{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_ta0om_476{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_ta0om_469{font-size:13px;font-weight:800}._qtyControls_ta0om_487{display:inline-flex;align-items:center;gap:6px}._qtyControlsWrap_ta0om_493{display:grid;justify-items:center;gap:4px}._qtyButton_ta0om_499{padding:0;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_ta0om_499:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_ta0om_499:disabled{opacity:.6;cursor:not-allowed}._qtyButton_ta0om_499:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_ta0om_525{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_ta0om_532{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;min-width:0}._poweredBy_ta0om_540{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_ta0om_540 a{color:inherit;text-decoration:none}._boxSummaryWindow_ta0om_552{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;min-width:0;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_ta0om_552::-webkit-scrollbar{display:none}._boxSummaryRow_ta0om_570{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_ta0om_578{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_ta0om_587{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_ta0om_599{cursor:pointer}._boxItemClickable_ta0om_599:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_ta0om_608{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_ta0om_619{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_ta0om_625{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_ta0om_631{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_ta0om_639{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_ta0om_647{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_ta0om_654{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_ta0om_661{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_ta0om_672{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_ta0om_679{gap:0}._cta_ta0om_672{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_ta0om_695{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_ta0om_707{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_ta0om_725{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_ta0om_725>span{opacity:0}._ctaDualRight_ta0om_738{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_ta0om_754{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_ta0om_754>span{opacity:0}._ctaTotals_ta0om_765{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_ta0om_773{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));color:var(--bb-tier-text, rgba(29, 78, 216, .95));white-space:nowrap}._ctaTotalsWrap_ta0om_787{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_ta0om_800{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_ta0om_807{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_ta0om_814{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_ta0om_787{transition:none}}._cta_ta0om_672:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_ta0om_672:disabled{opacity:.6;cursor:not-allowed}._cta_ta0om_672:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_ta0om_695:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_ta0om_695:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_ta0om_695:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_ta0om_707:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_ta0om_707:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_ta0om_707:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_ta0om_738:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_ta0om_738:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_ta0om_738:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_ta0om_883{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_ta0om_1{padding:0;justify-content:stretch}._panel_ta0om_82{width:100%;height:100%;border-radius:0}}._panel_96rr4_2 button,._panel_96rr4_2 input,._panel_96rr4_2 [role=button]{box-sizing:border-box;margin:0}._panel_96rr4_2{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:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));border-radius:var(--bb-panel-radius, 16px);padding:20px;display:grid;gap:14px}._header_96rr4_20{text-align:start}._title_96rr4_24{font-size:22px;margin:0;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))}._status_96rr4_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_96rr4_37{font-size:13px;color:#b91c1c;font-weight:600}._inactive_96rr4_43{font-size:13px;color:#b45309;font-weight:600}._section_96rr4_49{display:grid;gap:6px}._sectionTitle_96rr4_54{text-align:left;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._rules_96rr4_63{display:flex;justify-content:center;gap:6px}._rulesList_96rr4_69{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_96rr4_80{display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px 10px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .25));background:var(--bb-tier-bg, rgba(37, 99, 235, .06));color:var(--bb-tier-text, #1f2937)}._ruleMin_96rr4_92{font-weight:600;font-size:13px}._ruleDiscount_96rr4_97{font-weight:700;font-size:13px}._ruleLabel_96rr4_102{font-size:12px;opacity:.7}._rulesVisual_96rr4_107{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_96rr4_114,._rulesLinesRow_96rr4_121{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_96rr4_128{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_96rr4_128:empty{display:flex!important}._rulesLineLabel_96rr4_128{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_96rr4_145{height:1em}._rulesLine_96rr4_121{display:block;width:100%;height:4px;border-radius:999px;background-color:var(--bb-tier-background, rgba(148, 163, 184, .22));transition:background-color .2s ease}._rulesLine_96rr4_121:empty{display:block!important}._rulesLineEmpty_96rr4_162{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_96rr4_166{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_96rr4_170{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_96rr4_178{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_96rr4_186{display:grid;grid-template-columns:76px minmax(0,1fr);gap:12px;align-items:start;padding:8px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-border-color, rgba(15, 23, 42, .08));background:#fff;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease}._variantRowInteractive_96rr4_198{cursor:pointer}._variantRowSelected_96rr4_202{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_96rr4_207{opacity:.65}._variantMedia_96rr4_211{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_96rr4_219{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_96rr4_227{display:flex;flex-direction:column;gap:4px}._variantTitle_96rr4_233{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_96rr4_239{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_96rr4_247{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_96rr4_255{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);background:linear-gradient(135deg,#94a3b84d,#94a3b80d);display:grid;place-items:center;color:#94a3b8cc;font-size:10px;text-transform:uppercase;letter-spacing:.08em}._variantMeta_96rr4_268{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_96rr4_273{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_96rr4_279{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_96rr4_286{display:grid;align-items:end;justify-items:end}._qtyActions_96rr4_292{display:inline-flex;align-items:center;gap:6px}._qtyActionsWrap_96rr4_298{display:grid;justify-items:end;gap:4px}._variantUnavailable_96rr4_304{display:none}._qtyControls_96rr4_308{display:inline-flex;align-items:center;gap:6px;padding:4px;border-radius:999px;border:1px solid var(--bb-border-strong-color, rgba(15, 23, 42, .12));background:#0f172a0a}._qtyButton_96rr4_318{width:30px;height:30px;padding:0;border-radius:999px;border:0;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-size:16px;cursor:pointer;display:grid;place-items:center}._qtyButton_96rr4_318:disabled{cursor:not-allowed;opacity:.4}._qtyButton_96rr4_318:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_96rr4_342{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_96rr4_349{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._stockLimitNotice_96rr4_357{color:var(--bb-muted-color, rgba(17, 24, 39, .72));font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;text-align:end}._qtyChip_96rr4_366{min-width:44px;height:30px;padding:0 2px;border-radius:var(--bb-border-radius, 12px);background:#0f172a14;color:#0f172a;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:3px}._qtyChipInteractive_96rr4_381{cursor:pointer}._qtyChipValue_96rr4_385{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_96rr4_391{margin-bottom:-3px;font-weight:500}._qtyChipClear_96rr4_396{width:22px;height:22px;border-radius:999px;border:1px solid rgba(15,23,42,.12);background:#fff;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0;transition:background .16s ease,color .16s ease}._qtyChip_96rr4_366:hover ._qtyChipClear_96rr4_396{background:#0f172a;color:#fff}._qtyChipClear_96rr4_396:disabled{cursor:not-allowed;opacity:.45}._qtyChip_96rr4_366:hover ._qtyChipClear_96rr4_396:disabled{background:#fff;color:#0f172a}._qtyTrash_96rr4_425{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_96rr4_437{display:grid;padding-top:6px}._boxSummaryWindow_96rr4_442{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_96rr4_442::-webkit-scrollbar{display:none}._boxSummaryRow_96rr4_456{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_96rr4_464{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_96rr4_473{width:100%;border-radius:var(--bb-border-radius, 12px);position:relative;display:block;-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden}._boxItem_96rr4_473:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_96rr4_490{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_96rr4_496{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))}._boxItemThreshold_96rr4_502{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))}._boxItemClickable_96rr4_510{cursor:pointer}._boxItemClickable_96rr4_510:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_96rr4_519{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;display:block}._boxItemFallback_96rr4_530{position:absolute;top:0;right:0;bottom:0;left:0;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}._boxItemPlus_96rr4_543{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemDiscountText_96rr4_555{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxThresholdLabel_96rr4_568{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._totalsReveal_96rr4_579{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_96rr4_587{max-height:80px;opacity:1}._ctaTotalsWrap_96rr4_592{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_96rr4_597{opacity:1}._ctaTotals_96rr4_592{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_96rr4_612{padding:4px 8px;border-radius:999px;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));color:var(--bb-tier-text, rgba(30, 64, 175, .9));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));font-size:11px;text-transform:uppercase;letter-spacing:.08em}._ctaTotalsStrike_96rr4_623{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_96rr4_629{font-weight:700;color:#0f172a}._cta_96rr4_592{border:0;border-radius:var(--bb-border-radius, 12px);padding:14px 18px;min-height:44px;font-weight:700;font-size:14px;background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff);cursor:pointer;letter-spacing:.02em;transition:transform .14s ease,box-shadow .14s ease,background .14s ease;box-shadow:0 10px 24px #0f172a40}._cta_96rr4_592:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_96rr4_592:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_96rr4_661{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_96rr4_667,._ctaDualRight_96rr4_668{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_96rr4_667{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_96rr4_668{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_96rr4_667:disabled,._ctaDualRight_96rr4_668:disabled{cursor:not-allowed;opacity:.6}._poweredBy_96rr4_695{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_96rr4_695 a{color:inherit;text-decoration:none;font-weight:700}@media(max-width:640px){._panel_96rr4_2{padding:16px}._variantRow_96rr4_186{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_96rr4_308{justify-self:start}._variantDetailsRow_96rr4_239{grid-template-columns:1fr}}')),document.head.appendChild(r)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { jsx as c, jsxs as I, Fragment as xe } from "react/jsx-runtime";
3
- import fe, { useState as q, useRef as V, useCallback as K, useEffect as F, useMemo as T, createContext as qe, useContext as Ve, forwardRef as $e, createElement as Ce } from "react";
4
- const ue = {
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.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_1i4y2_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 2147483647);display:flex;justify-content:flex-end;background:var(--bb-backdrop-bg, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(var(--bb-backdrop-blur, 2px));backdrop-filter:blur(var(--bb-backdrop-blur, 2px));padding:var(--bb-backdrop-padding, 12px);opacity:0;transition:opacity var(--bb-drawer-transition-duration, .22s) ease}._celebrationOverlay_1i4y2_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_1i4y2_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_1i4y2_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_1i4y2_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_1i4y2_74{opacity:1}._backdropClosed_1i4y2_78{opacity:0}._panel_1i4y2_82{width:440px;max-width:100%;min-width:0;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_1i4y2_103{animation:_bbSlideInFromRight_1i4y2_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_1i4y2_107{animation:_bbSlideOutToRight_1i4y2_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_1i4y2_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_1i4y2_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_1i4y2_1{transition:none}._celebrationChip_1i4y2_23,._panelOpen_1i4y2_103,._panelClosed_1i4y2_107{animation:none}}._header_1i4y2_146{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_1i4y2_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_1i4y2_163{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_1i4y2_172{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;padding:0}._searchIconButton_1i4y2_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_1i4y2_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_1i4y2_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_1i4y2_199{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_1i4y2_211 ._headerTitleWrap_1i4y2_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_1i4y2_211 ._headerSearchWrap_1i4y2_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_1i4y2_223{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_1i4y2_235{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_1i4y2_235::-webkit-search-cancel-button,._searchInput_1i4y2_235::-webkit-search-decoration,._searchInput_1i4y2_235::-webkit-search-results-button,._searchInput_1i4y2_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_1i4y2_256{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_1i4y2_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_1i4y2_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_1i4y2_278{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;padding:0}._closeButton_1i4y2_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_1i4y2_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_1i4y2_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_1i4y2_195,._headerSearchWrap_1i4y2_199{transition:none}}._body_1i4y2_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_1i4y2_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_1i4y2_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_1i4y2_327{margin-top:4px}._variantList_1i4y2_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_1i4y2_339{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_1i4y2_347{opacity:.65}._variantLeft_1i4y2_351{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_1i4y2_358{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_1i4y2_358:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_1i4y2_358:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_1i4y2_358:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_1i4y2_386{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._stockLimitContainer_1i4y2_394{display:flex;align-items:center;justify-content:center;height:100%;max-width:120px;padding:0 12px}._soldOut_1i4y2_386{align-self:center;text-align:center;color:var(--bb-muted-color, rgba(17, 24, 39));font-size:.9em;font-weight:600;pointer-events:none}._stockLimitNotice_1i4y2_412{color:var(--bb-muted-color, rgba(17, 24, 39, .72));font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;text-align:center}._variantThumb_1i4y2_421{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_1i4y2_431{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_1i4y2_438{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_1i4y2_448{min-width:0}._variantName_1i4y2_452{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_1i4y2_461{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_1i4y2_469{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_1i4y2_476{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_1i4y2_469{font-size:13px;font-weight:800}._qtyControls_1i4y2_487{display:inline-flex;align-items:center;gap:6px}._qtyControlsWrap_1i4y2_493{display:grid;justify-items:center;gap:4px}._qtyButton_1i4y2_499{padding:0;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_1i4y2_499:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_1i4y2_499:disabled{opacity:.6;cursor:not-allowed}._qtyButton_1i4y2_499:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_1i4y2_525{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_1i4y2_532{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;min-width:0}._poweredBy_1i4y2_540{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_1i4y2_540 a{color:inherit;text-decoration:none}._boxSummaryWindow_1i4y2_552{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;min-width:0;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_1i4y2_552::-webkit-scrollbar{display:none}._boxSummaryRow_1i4y2_570{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_1i4y2_578{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_1i4y2_587{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_1i4y2_599{cursor:pointer}._boxItemClickable_1i4y2_599:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_1i4y2_608{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_1i4y2_619{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_1i4y2_625{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_1i4y2_631{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_1i4y2_639{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_1i4y2_647{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_1i4y2_654{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_1i4y2_661{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_1i4y2_672{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_1i4y2_679{gap:0}._cta_1i4y2_672{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_1i4y2_695{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_1i4y2_707{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_1i4y2_725{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_1i4y2_725>span{opacity:0}._ctaDualRight_1i4y2_738{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_1i4y2_754{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_1i4y2_754>span{opacity:0}._ctaTotals_1i4y2_765{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_1i4y2_773{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));color:var(--bb-tier-text, rgba(29, 78, 216, .95));white-space:nowrap}._ctaTotalsWrap_1i4y2_787{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_1i4y2_800{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_1i4y2_807{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_1i4y2_814{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_1i4y2_787{transition:none}}._cta_1i4y2_672:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_1i4y2_672:disabled{opacity:.6;cursor:not-allowed}._cta_1i4y2_672:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_1i4y2_695:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_1i4y2_695:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_1i4y2_695:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_1i4y2_707:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_1i4y2_707:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_1i4y2_707:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_1i4y2_738:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_1i4y2_738:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_1i4y2_738:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_1i4y2_883{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_1i4y2_1{padding:0;justify-content:stretch}._panel_1i4y2_82{width:100%;height:100%;border-radius:0}}._panel_96rr4_2 button,._panel_96rr4_2 input,._panel_96rr4_2 [role=button]{box-sizing:border-box;margin:0}._panel_96rr4_2{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:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));border-radius:var(--bb-panel-radius, 16px);padding:20px;display:grid;gap:14px}._header_96rr4_20{text-align:start}._title_96rr4_24{font-size:22px;margin:0;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))}._status_96rr4_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_96rr4_37{font-size:13px;color:#b91c1c;font-weight:600}._inactive_96rr4_43{font-size:13px;color:#b45309;font-weight:600}._section_96rr4_49{display:grid;gap:6px}._sectionTitle_96rr4_54{text-align:left;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._rules_96rr4_63{display:flex;justify-content:center;gap:6px}._rulesList_96rr4_69{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_96rr4_80{display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px 10px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .25));background:var(--bb-tier-bg, rgba(37, 99, 235, .06));color:var(--bb-tier-text, #1f2937)}._ruleMin_96rr4_92{font-weight:600;font-size:13px}._ruleDiscount_96rr4_97{font-weight:700;font-size:13px}._ruleLabel_96rr4_102{font-size:12px;opacity:.7}._rulesVisual_96rr4_107{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_96rr4_114,._rulesLinesRow_96rr4_121{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_96rr4_128{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_96rr4_128:empty{display:flex!important}._rulesLineLabel_96rr4_128{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_96rr4_145{height:1em}._rulesLine_96rr4_121{display:block;width:100%;height:4px;border-radius:999px;background-color:var(--bb-tier-background, rgba(148, 163, 184, .22));transition:background-color .2s ease}._rulesLine_96rr4_121:empty{display:block!important}._rulesLineEmpty_96rr4_162{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_96rr4_166{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_96rr4_170{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_96rr4_178{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_96rr4_186{display:grid;grid-template-columns:76px minmax(0,1fr);gap:12px;align-items:start;padding:8px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-border-color, rgba(15, 23, 42, .08));background:#fff;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease}._variantRowInteractive_96rr4_198{cursor:pointer}._variantRowSelected_96rr4_202{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_96rr4_207{opacity:.65}._variantMedia_96rr4_211{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_96rr4_219{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_96rr4_227{display:flex;flex-direction:column;gap:4px}._variantTitle_96rr4_233{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_96rr4_239{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_96rr4_247{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_96rr4_255{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);background:linear-gradient(135deg,#94a3b84d,#94a3b80d);display:grid;place-items:center;color:#94a3b8cc;font-size:10px;text-transform:uppercase;letter-spacing:.08em}._variantMeta_96rr4_268{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_96rr4_273{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_96rr4_279{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_96rr4_286{display:grid;align-items:end;justify-items:end}._qtyActions_96rr4_292{display:inline-flex;align-items:center;gap:6px}._qtyActionsWrap_96rr4_298{display:grid;justify-items:end;gap:4px}._variantUnavailable_96rr4_304{display:none}._qtyControls_96rr4_308{display:inline-flex;align-items:center;gap:6px;padding:4px;border-radius:999px;border:1px solid var(--bb-border-strong-color, rgba(15, 23, 42, .12));background:#0f172a0a}._qtyButton_96rr4_318{width:30px;height:30px;padding:0;border-radius:999px;border:0;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-size:16px;cursor:pointer;display:grid;place-items:center}._qtyButton_96rr4_318:disabled{cursor:not-allowed;opacity:.4}._qtyButton_96rr4_318:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_96rr4_342{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_96rr4_349{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._stockLimitNotice_96rr4_357{color:var(--bb-muted-color, rgba(17, 24, 39, .72));font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;text-align:end}._qtyChip_96rr4_366{min-width:44px;height:30px;padding:0 2px;border-radius:var(--bb-border-radius, 12px);background:#0f172a14;color:#0f172a;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:3px}._qtyChipInteractive_96rr4_381{cursor:pointer}._qtyChipValue_96rr4_385{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_96rr4_391{margin-bottom:-3px;font-weight:500}._qtyChipClear_96rr4_396{width:22px;height:22px;border-radius:999px;border:1px solid rgba(15,23,42,.12);background:#fff;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0;transition:background .16s ease,color .16s ease}._qtyChip_96rr4_366:hover ._qtyChipClear_96rr4_396{background:#0f172a;color:#fff}._qtyChipClear_96rr4_396:disabled{cursor:not-allowed;opacity:.45}._qtyChip_96rr4_366:hover ._qtyChipClear_96rr4_396:disabled{background:#fff;color:#0f172a}._qtyTrash_96rr4_425{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_96rr4_437{display:grid;padding-top:6px}._boxSummaryWindow_96rr4_442{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_96rr4_442::-webkit-scrollbar{display:none}._boxSummaryRow_96rr4_456{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_96rr4_464{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_96rr4_473{width:100%;border-radius:var(--bb-border-radius, 12px);position:relative;display:block;-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden}._boxItem_96rr4_473:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_96rr4_490{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_96rr4_496{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))}._boxItemThreshold_96rr4_502{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))}._boxItemClickable_96rr4_510{cursor:pointer}._boxItemClickable_96rr4_510:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_96rr4_519{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;display:block}._boxItemFallback_96rr4_530{position:absolute;top:0;right:0;bottom:0;left:0;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}._boxItemPlus_96rr4_543{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemDiscountText_96rr4_555{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxThresholdLabel_96rr4_568{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._totalsReveal_96rr4_579{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_96rr4_587{max-height:80px;opacity:1}._ctaTotalsWrap_96rr4_592{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_96rr4_597{opacity:1}._ctaTotals_96rr4_592{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_96rr4_612{padding:4px 8px;border-radius:999px;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));color:var(--bb-tier-text, rgba(30, 64, 175, .9));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));font-size:11px;text-transform:uppercase;letter-spacing:.08em}._ctaTotalsStrike_96rr4_623{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_96rr4_629{font-weight:700;color:#0f172a}._cta_96rr4_592{border:0;border-radius:var(--bb-border-radius, 12px);padding:14px 18px;min-height:44px;font-weight:700;font-size:14px;background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff);cursor:pointer;letter-spacing:.02em;transition:transform .14s ease,box-shadow .14s ease,background .14s ease;box-shadow:0 10px 24px #0f172a40}._cta_96rr4_592:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_96rr4_592:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_96rr4_661{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_96rr4_667,._ctaDualRight_96rr4_668{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_96rr4_667{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_96rr4_668{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_96rr4_667:disabled,._ctaDualRight_96rr4_668:disabled{cursor:not-allowed;opacity:.6}._poweredBy_96rr4_695{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_96rr4_695 a{color:inherit;text-decoration:none;font-weight:700}@media(max-width:640px){._panel_96rr4_2{padding:16px}._variantRow_96rr4_186{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_96rr4_308{justify-self:start}._variantDetailsRow_96rr4_239{grid-template-columns:1fr}}')),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { jsx as l, jsxs as R, Fragment as kt } from "react/jsx-runtime";
3
+ import vt, { useCallback as J, useState as j, useRef as U, useEffect as O, useMemo as L, createContext as Qt, useContext as Gt, forwardRef as Wt, createElement as Tt } from "react";
4
+ const _t = {
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 ze(a) {
11
- const t = new URL("/api/public/bundle-configs-active", a.apiBaseUrl);
12
- t.searchParams.set("shop", a.shop);
13
- const o = await (await fetch(t, {
10
+ async function Yt(n) {
11
+ const e = new URL("/api/public/bundle-configs-active", n.apiBaseUrl);
12
+ e.searchParams.set("shop", n.shop);
13
+ const a = await (await fetch(e, {
14
14
  method: "GET",
15
- signal: a.signal,
15
+ signal: n.signal,
16
16
  headers: { "Content-Type": "application/json" }
17
17
  })).json().catch(() => null);
18
- return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
18
+ return !a || typeof a != "object" ? { ok: !1, error: "Invalid response." } : a;
19
19
  }
20
- async function We(a) {
21
- const t = new URL("/api/public/bundle-config", a.apiBaseUrl);
22
- t.searchParams.set("shop", a.shop), a.configHandle && t.searchParams.set("handle", a.configHandle), a.fresh && t.searchParams.set("fresh", "1");
23
- const o = await (await fetch(t, {
20
+ async function Kt(n) {
21
+ const e = new URL("/api/public/bundle-config", n.apiBaseUrl);
22
+ e.searchParams.set("shop", n.shop), n.configHandle && e.searchParams.set("handle", n.configHandle), n.fresh && e.searchParams.set("fresh", "1");
23
+ const a = await (await fetch(e, {
24
24
  method: "GET",
25
- signal: a.signal,
25
+ signal: n.signal,
26
26
  headers: { "Content-Type": "application/json" }
27
27
  })).json().catch(() => null);
28
- return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
28
+ return !a || typeof a != "object" ? { ok: !1, error: "Invalid response." } : a;
29
29
  }
30
- async function je(a) {
31
- const t = new URL("/api/public/bundle-config-status", a.apiBaseUrl);
32
- t.searchParams.set("shop", a.shop), a.configHandle && t.searchParams.set("handle", a.configHandle);
33
- const o = await (await fetch(t, {
30
+ async function Xt(n) {
31
+ const e = new URL("/api/public/bundle-config-status", n.apiBaseUrl);
32
+ e.searchParams.set("shop", n.shop), n.configHandle && e.searchParams.set("handle", n.configHandle);
33
+ const a = await (await fetch(e, {
34
34
  method: "GET",
35
- signal: a.signal,
35
+ signal: n.signal,
36
36
  headers: { "Content-Type": "application/json" }
37
37
  })).json().catch(() => null);
38
- return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
38
+ return !a || typeof a != "object" ? { ok: !1, error: "Invalid response." } : a;
39
39
  }
40
- function pe(a) {
41
- if (!a || a.availableForSale === !1) return 0;
42
- if (a.inventoryPolicy === "CONTINUE") return Number.POSITIVE_INFINITY;
43
- const t = Number(a.sellableOnlineQuantity ?? 0);
44
- return Number.isFinite(t) ? Math.max(0, Math.floor(t)) : 0;
40
+ function xt(n) {
41
+ if (!n || n.availableForSale === !1) return 0;
42
+ if (n.inventoryPolicy === "CONTINUE" || n.sellableOnlineQuantity == null) return Number.POSITIVE_INFINITY;
43
+ const e = Number(n.sellableOnlineQuantity);
44
+ return !Number.isFinite(e) || e <= 0 && n.availableForSale === !0 ? Number.POSITIVE_INFINITY : Math.max(0, Math.floor(e));
45
45
  }
46
- const Te = "bb_anonymous_user_id";
47
- function de() {
46
+ const Ft = "bb_anonymous_user_id";
47
+ function pt() {
48
48
  if (typeof window > "u" || typeof localStorage > "u")
49
49
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
50
50
  try {
51
- const a = localStorage.getItem(Te);
52
- if (a && typeof a == "string" && a.length > 0)
53
- return a;
54
- let t;
51
+ const n = localStorage.getItem(Ft);
52
+ if (n && typeof n == "string" && n.length > 0)
53
+ return n;
54
+ let e;
55
55
  try {
56
- const e = globalThis.crypto;
57
- if (e != null && e.randomUUID)
58
- t = e.randomUUID();
56
+ const t = globalThis.crypto;
57
+ if (t != null && t.randomUUID)
58
+ e = t.randomUUID();
59
59
  else
60
60
  throw new Error("crypto.randomUUID not available");
61
61
  } catch {
62
- t = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
62
+ e = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
63
63
  }
64
- return localStorage.setItem(Te, t), t;
64
+ return localStorage.setItem(Ft, e), e;
65
65
  } catch {
66
66
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
67
67
  }
68
68
  }
69
- async function te(a, t, e) {
69
+ async function lt(n, e, t) {
70
70
  if (!(typeof window > "u"))
71
71
  try {
72
- const o = new URL(a, window.location.origin);
73
- o.searchParams.set("shop", t);
74
- const i = await fetch(o, {
72
+ const a = new URL(n, window.location.origin);
73
+ a.searchParams.set("shop", e);
74
+ const i = await fetch(a, {
75
75
  method: "POST",
76
76
  headers: {
77
77
  "Content-Type": "application/json"
78
78
  },
79
- body: JSON.stringify(e),
79
+ body: JSON.stringify(t),
80
80
  // Don't wait for response - fire and forget
81
81
  keepalive: !0
82
82
  });
@@ -84,23 +84,179 @@ async function te(a, t, e) {
84
84
  `[Bundle Analytics] Event tracking failed with status ${i.status}:`,
85
85
  await i.text().catch(() => "Unable to read response")
86
86
  );
87
- } catch (o) {
88
- console.warn("[Bundle Analytics] Failed to track event:", o);
87
+ } catch (a) {
88
+ console.warn("[Bundle Analytics] Failed to track event:", a);
89
89
  }
90
90
  }
91
- const De = qe(null), oe = "#best-bundles", Ue = [];
92
- function qt(a) {
93
- const t = String(a ?? "").trim().toLowerCase();
94
- return t && t.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
91
+ const ft = {
92
+ "bundle.title.default": "Build your bundle",
93
+ "bundle.loading": "Loading...",
94
+ "bundle.inactive": "Bundles are not active.",
95
+ "bundle.drawer.aria": "Bundle builder",
96
+ "bundle.search": "Search",
97
+ "bundle.search.expanded": "Search (expanded)",
98
+ "bundle.search.placeholder": "Search",
99
+ "bundle.search.clear": "Clear search",
100
+ "bundle.close": "Close",
101
+ "bundle.section.discount_tiers": "Discount tiers",
102
+ "bundle.section.your_bundle": "Your bundle",
103
+ "bundle.section.select_items": "Choose items",
104
+ "bundle.select.items": "Select items",
105
+ "bundle.size.min": "(min {{min}})",
106
+ "bundle.stock.max_reached": "Max Reached",
107
+ "bundle.stock.max_added": "Max Added To Cart",
108
+ "bundle.stock.sold_out": "Sold Out",
109
+ "bundle.item.generic": "Item",
110
+ "bundle.slot": "Slot {{slot}}",
111
+ "bundle.unlocks": "Unlocks {{discount}}",
112
+ "bundle.totals": "Totals",
113
+ "bundle.discount.badge": "{{discount}}% Discount",
114
+ "bundle.discount.off_label": "{{discount}}% off",
115
+ "bundle.celebration.received_discount": "You received a {{discount}}% discount!",
116
+ "bundle.cta.adding": "Adding...",
117
+ "bundle.cta.processing": "Processing...",
118
+ "bundle.cta.checkout": "Checkout",
119
+ "bundle.cta.add_to_bundle": "Add",
120
+ "bundle.cta.add_to_basket": "Add to Basket",
121
+ "bundle.cta.add_more": "Add {{count}} more {{productWord}}",
122
+ "bundle.powered_by": "powered by",
123
+ "bundle.button.default": "Build a bundle",
124
+ "bundle.provider.inactive_error": "Bundle is inactive.",
125
+ "bundle.provider.load_error": "Failed to load bundle config.",
126
+ "bundle.provider.stock_error": "Some bundle items are no longer available in the requested quantity. Please review your selection.",
127
+ "bundle.provider.add_error": "We couldn't add this bundle right now. Please try again.",
128
+ "bundle.a11y.add_to_bundle": "Add {{name}} to bundle",
129
+ "bundle.a11y.remove_from_bundle": "Remove {{name}} from bundle",
130
+ "bundle.a11y.quantity": "{{name}} quantity {{qty}}",
131
+ "bundle.a11y.sold_out": "{{name}} is sold out",
132
+ "bundle.a11y.max_available_selected": "{{name}} max available selected",
133
+ "bundle.a11y.increase": "Increase {{name}}",
134
+ "bundle.a11y.decrease": "Decrease {{name}}"
135
+ }, Zt = {
136
+ ...ft,
137
+ "bundle.title.default": "Creez votre bundle",
138
+ "bundle.loading": "Chargement...",
139
+ "bundle.inactive": "Les bundles ne sont pas actifs.",
140
+ "bundle.drawer.aria": "Constructeur de bundle",
141
+ "bundle.search": "Rechercher",
142
+ "bundle.search.expanded": "Rechercher (deplie)",
143
+ "bundle.search.placeholder": "Rechercher",
144
+ "bundle.search.clear": "Effacer la recherche",
145
+ "bundle.close": "Fermer",
146
+ "bundle.section.discount_tiers": "Paliers de remise",
147
+ "bundle.section.your_bundle": "Votre bundle",
148
+ "bundle.section.select_items": "Choisir des articles",
149
+ "bundle.select.items": "Selectionner des articles",
150
+ "bundle.stock.max_reached": "Maximum atteint",
151
+ "bundle.stock.max_added": "Maximum deja dans le panier",
152
+ "bundle.stock.sold_out": "Rupture de stock",
153
+ "bundle.totals": "Totaux",
154
+ "bundle.discount.badge": "{{discount}}% de réduction",
155
+ "bundle.discount.off_label": "{{discount}}% de réduction",
156
+ "bundle.celebration.received_discount": "Vous avez recu une reduction de {{discount}}% !",
157
+ "bundle.cta.checkout": "Paiement",
158
+ "bundle.cta.add_to_bundle": "Ajouter",
159
+ "bundle.cta.add_to_basket": "Ajouter au panier",
160
+ "bundle.powered_by": "propulse par",
161
+ "bundle.button.default": "Creer un bundle"
162
+ }, Jt = {
163
+ ...ft,
164
+ "bundle.title.default": "Bundle erstellen",
165
+ "bundle.loading": "Wird geladen...",
166
+ "bundle.inactive": "Bundles sind nicht aktiv.",
167
+ "bundle.drawer.aria": "Bundle-Builder",
168
+ "bundle.search": "Suchen",
169
+ "bundle.search.expanded": "Suche (erweitert)",
170
+ "bundle.search.placeholder": "Suchen",
171
+ "bundle.search.clear": "Suche loschen",
172
+ "bundle.close": "Schliessen",
173
+ "bundle.section.discount_tiers": "Rabattstufen",
174
+ "bundle.section.your_bundle": "Ihr Bundle",
175
+ "bundle.section.select_items": "Artikel auswahlen",
176
+ "bundle.select.items": "Artikel auswahlen",
177
+ "bundle.stock.max_reached": "Maximum erreicht",
178
+ "bundle.stock.max_added": "Maximum bereits im Warenkorb",
179
+ "bundle.stock.sold_out": "Ausverkauft",
180
+ "bundle.totals": "Summen",
181
+ "bundle.discount.badge": "{{discount}}% Rabatt",
182
+ "bundle.discount.off_label": "{{discount}}% Rabatt",
183
+ "bundle.celebration.received_discount": "Sie haben {{discount}}% Rabatt erhalten!",
184
+ "bundle.cta.checkout": "Zur Kasse",
185
+ "bundle.cta.add_to_bundle": "Hinzufügen",
186
+ "bundle.cta.add_to_basket": "In den Warenkorb",
187
+ "bundle.powered_by": "powered by",
188
+ "bundle.button.default": "Bundle erstellen"
189
+ }, en = {
190
+ ...ft,
191
+ "bundle.title.default": "Crea tu bundle",
192
+ "bundle.loading": "Cargando...",
193
+ "bundle.inactive": "Los bundles no estan activos.",
194
+ "bundle.drawer.aria": "Constructor de bundles",
195
+ "bundle.search": "Buscar",
196
+ "bundle.search.expanded": "Buscar (expandido)",
197
+ "bundle.search.placeholder": "Buscar",
198
+ "bundle.search.clear": "Limpiar busqueda",
199
+ "bundle.close": "Cerrar",
200
+ "bundle.section.discount_tiers": "Niveles de descuento",
201
+ "bundle.section.your_bundle": "Tu bundle",
202
+ "bundle.section.select_items": "Elegir articulos",
203
+ "bundle.select.items": "Seleccionar articulos",
204
+ "bundle.stock.max_reached": "Maximo alcanzado",
205
+ "bundle.stock.max_added": "Maximo agregado al carrito",
206
+ "bundle.stock.sold_out": "Agotado",
207
+ "bundle.totals": "Totales",
208
+ "bundle.discount.badge": "{{discount}}% de descuento",
209
+ "bundle.discount.off_label": "{{discount}}% de descuento",
210
+ "bundle.celebration.received_discount": "Has recibido un {{discount}}% de descuento!",
211
+ "bundle.cta.checkout": "Pagar",
212
+ "bundle.cta.add_to_bundle": "Agregar",
213
+ "bundle.cta.add_to_basket": "Agregar al carrito",
214
+ "bundle.powered_by": "impulsado por",
215
+ "bundle.button.default": "Crear bundle"
216
+ }, tn = {
217
+ en: ft,
218
+ fr: Zt,
219
+ de: Jt,
220
+ es: en
221
+ };
222
+ function nn(n) {
223
+ const e = String(n ?? "").trim().toLowerCase();
224
+ if (!e) return "en";
225
+ const t = e.split("-")[0] ?? "en";
226
+ return t === "fr" || t === "de" || t === "en" || t === "es" ? t : "en";
227
+ }
228
+ function rn(n, e, t, a) {
229
+ var r;
230
+ const i = (a == null ? void 0 : a[e]) ?? ((r = tn[n]) == null ? void 0 : r[e]) ?? ft[e] ?? e;
231
+ return t ? Object.entries(t).reduce((h, [u, B]) => h.replaceAll(`{{${u}}}`, String(B)), i) : i;
232
+ }
233
+ function jt(n, e, t) {
234
+ const a = Number(n);
235
+ if (!Number.isFinite(a)) return String(n);
236
+ if (e)
237
+ try {
238
+ return new Intl.NumberFormat(t || void 0, { style: "currency", currency: e }).format(a);
239
+ } catch {
240
+ }
241
+ return `$${a.toFixed(2)}`;
242
+ }
243
+ function ct(n, e) {
244
+ const t = e === 1 ? "one" : "many";
245
+ return n === "fr" ? t === "one" ? "produit" : "produits" : n === "de" ? t === "one" ? "Produkt" : "Produkte" : n === "es" ? t === "one" ? "producto" : "productos" : t === "one" ? "product" : "products";
95
246
  }
96
- function ke(a) {
97
- const t = String(a ?? "").trim().toLowerCase();
98
- if (!t.startsWith(oe)) return null;
99
- if (t === oe) return "default";
100
- const e = `${oe}:`;
101
- return t.startsWith(e) ? qt(t.slice(e.length)) : null;
247
+ const Ut = Qt(null), mt = "#best-bundles", an = [];
248
+ function Qe(n) {
249
+ const e = String(n ?? "").trim().toLowerCase();
250
+ return e && e.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
102
251
  }
103
- const He = {
252
+ function Ot(n) {
253
+ const e = String(n ?? "").trim().toLowerCase();
254
+ if (!e.startsWith(mt)) return null;
255
+ if (e === mt) return "default";
256
+ const t = `${mt}:`;
257
+ return e.startsWith(t) ? Qe(e.slice(t.length)) : null;
258
+ }
259
+ const on = {
104
260
  primaryColor: "--bb-cta-bg",
105
261
  primaryHoverColor: "--bb-cta-bg-hover",
106
262
  primaryTextColor: "--bb-cta-text",
@@ -122,753 +278,760 @@ const He = {
122
278
  celebrationBorderColor: "--bb-celebration-border",
123
279
  fontFamilyBody: "--bb-font-family-body",
124
280
  fontFamilyTitle: "--bb-font-family-title"
125
- }, _e = "bb-google-fonts";
126
- function Re(a) {
127
- const t = (a ?? "").trim().replace(/^["']|["']$/g, "");
128
- return t ? encodeURIComponent(t).replace(/%20/g, "+") : "";
281
+ }, Ct = "bb-google-fonts";
282
+ function At(n) {
283
+ const e = (n ?? "").trim().replace(/^["']|["']$/g, "");
284
+ return e ? encodeURIComponent(e).replace(/%20/g, "+") : "";
129
285
  }
130
- function Qe(a) {
131
- var d;
286
+ function sn(n) {
287
+ var u;
132
288
  if (typeof document > "u" || !document.head) return;
133
- if (!a) {
134
- (d = document.getElementById(_e)) == null || d.remove();
289
+ if (!n) {
290
+ (u = document.getElementById(Ct)) == null || u.remove();
135
291
  return;
136
292
  }
137
- const t = (a.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), e = (a.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), o = [];
138
- t && o.push("family=" + Re(t)), e && e !== t && o.push("family=" + Re(e));
139
- const i = document.getElementById(_e);
140
- if (o.length === 0) {
293
+ const e = (n.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (n.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), a = [];
294
+ e && a.push("family=" + At(e)), t && t !== e && a.push("family=" + At(t));
295
+ const i = document.getElementById(Ct);
296
+ if (a.length === 0) {
141
297
  i == null || i.remove();
142
298
  return;
143
299
  }
144
- const r = `https://fonts.googleapis.com/css2?${o.join("&")}&display=swap`;
300
+ const r = `https://fonts.googleapis.com/css2?${a.join("&")}&display=swap`;
145
301
  if (i) {
146
302
  i.getAttribute("href") !== r && i.setAttribute("href", r);
147
303
  return;
148
304
  }
149
- const m = document.createElement("link");
150
- m.id = _e, m.rel = "stylesheet", m.href = r, document.head.appendChild(m);
305
+ const h = document.createElement("link");
306
+ h.id = Ct, h.rel = "stylesheet", h.href = r, document.head.appendChild(h);
151
307
  }
152
- function Me(a) {
153
- if (!a) return;
154
- Qe(a);
155
- const t = document.documentElement;
156
- Object.entries(He).forEach(([e, o]) => {
157
- let i = a[e];
158
- i && ((e === "fontFamilyBody" || e === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(i) && !/^["']/.test(i.trim()) && (i = `"${i.trim().replace(/^["']|["']$/g, "")}"`), t.style.setProperty(o, i));
308
+ function Dt(n) {
309
+ if (!n) return;
310
+ sn(n);
311
+ const e = document.documentElement;
312
+ Object.entries(on).forEach(([t, a]) => {
313
+ let i = n[t];
314
+ i && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(i) && !/^["']/.test(i.trim()) && (i = `"${i.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(a, i));
159
315
  });
160
316
  }
161
- function Le(a) {
162
- if (typeof window > "u") return a;
163
- const t = window.__BUNDLE_PREVIEW_STYLES__;
164
- return t && typeof t == "object" ? t : a;
317
+ function Et(n) {
318
+ if (typeof window > "u") return n;
319
+ const e = window.__BUNDLE_PREVIEW_STYLES__;
320
+ return e && typeof e == "object" ? e : n;
165
321
  }
166
- function Ge() {
322
+ function ln() {
167
323
  try {
168
- const a = globalThis.crypto;
169
- if (a != null && a.randomUUID) return a.randomUUID();
324
+ const n = globalThis.crypto;
325
+ if (n != null && n.randomUUID) return n.randomUUID();
170
326
  } catch {
171
327
  }
172
328
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
173
329
  }
174
- function me(a) {
175
- return Number.isFinite(a) ? Math.max(0, Math.floor(a)) : 0;
330
+ function gt(n) {
331
+ return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0;
176
332
  }
177
- function ye(a, t) {
178
- const e = me(a);
179
- return Number.isFinite(t) ? Math.min(e, Math.max(0, Math.floor(t))) : e;
333
+ function It(n, e) {
334
+ const t = gt(n);
335
+ return Number.isFinite(e) ? Math.min(t, Math.max(0, Math.floor(e))) : t;
180
336
  }
181
- function Ye(a, t) {
182
- return !a && !t;
337
+ function cn(n, e) {
338
+ return !n && !e;
183
339
  }
184
- function ci(a) {
340
+ function wi(n) {
185
341
  const {
186
- apiBaseUrl: t,
187
- shop: e,
188
- cartAdapter: o,
342
+ apiBaseUrl: e,
343
+ shop: t,
344
+ cartAdapter: a,
189
345
  configHandle: i = "default",
190
346
  initialData: r,
191
- configFetcher: m,
192
- activeConfigsFetcher: d,
193
- configStatusFetcher: S,
194
- analyticsEndpoint: lt,
195
- allowDrawerWhenInactive: A = !1,
196
- children: O
197
- } = a, et = qt(i), C = lt ?? `${t}/api/public/bundle-analytics`, Y = Ye(A, r), [X, ot] = q(!1), [J, z] = q(!1), [yt, Z] = q(null), [gt, $t] = q(!1), [j, ut] = q({}), [U, dt] = q(et), [Tt, Nt] = q(() => r ? { [et]: r } : {}), [ht, zt] = q(Y), [kt, Ct] = q(
198
- !Y && !r ? et : null
199
- ), [It, Dt] = q(null), [Rt, Wt] = q(null), [Xt, wt] = q(
347
+ configFetcher: h,
348
+ activeConfigsFetcher: u,
349
+ configStatusFetcher: B,
350
+ analyticsEndpoint: le,
351
+ allowDrawerWhenInactive: $ = !1,
352
+ locale: D,
353
+ messages: de,
354
+ children: F
355
+ } = n, te = nn(D), W = J((o, s) => rn(te, o, s, de), [te, de]), K = Qe(i), g = le ?? `${e}/api/public/bundle-analytics`, H = cn($, r), [I, he] = j(!1), [ke, Te] = j(!1), [ye, ae] = j(null), [X, ie] = j(!1), [me, Re] = j({}), [ne, Ce] = j(K), [be, Ve] = j(() => r ? { [K]: r } : {}), [ge, Le] = j(H), [Ie, Ae] = j(
356
+ !H && !r ? K : null
357
+ ), [nt, ze] = j(null), [We, Me] = j(null), [Ye, Ne] = j(
200
358
  () => ({ selections: {}, order: [] })
201
- ), jt = V(null), Mt = V(null), Lt = V(null), ft = V(0), h = V(U), _ = V(Tt), w = V(ht), B = V(null), R = m ?? We, E = d ?? ze, $ = S ?? je, H = K(async () => {
202
- if (typeof o.getLineQuantitiesByMerchandiseId != "function") return null;
203
- const n = await o.getLineQuantitiesByMerchandiseId();
204
- return Object.entries(n ?? {}).reduce((s, [u, p]) => {
205
- const y = me(p);
206
- return y > 0 && (s[u] = y), s;
359
+ ), De = U(null), ve = U(null), f = U(null), p = U(0), x = U(ne), T = U(be), M = U(ge), E = U(null), V = h ?? Kt, Z = u ?? Yt, ee = B ?? Xt, Q = J(async () => {
360
+ if (typeof a.getLineQuantitiesByMerchandiseId != "function") return null;
361
+ const o = await a.getLineQuantitiesByMerchandiseId();
362
+ return Object.entries(o ?? {}).reduce((s, [b, w]) => {
363
+ const y = gt(w);
364
+ return y > 0 && (s[b] = y), s;
207
365
  }, {});
208
- }, [o]), M = K(async () => {
209
- const n = ++ft.current;
210
- $t(!0);
366
+ }, [a]), A = J(async () => {
367
+ const o = ++p.current;
368
+ ie(!0);
211
369
  try {
212
- const s = await H();
213
- return s && n === ft.current && ut(s), s;
370
+ const s = await Q();
371
+ return s && o === p.current && Re(s), s;
214
372
  } catch {
215
373
  return null;
216
374
  } finally {
217
- n === ft.current && $t(!1);
375
+ o === p.current && ie(!1);
218
376
  }
219
- }, [H]);
220
- F(() => {
221
- h.current = U;
222
- }, [U]), F(() => {
223
- _.current = Tt;
224
- }, [Tt]), F(() => {
225
- w.current = ht;
226
- }, [ht]), F(() => {
227
- M();
228
- }, [M]);
229
- const W = K((n) => {
230
- dt(qt(n));
231
- }, []), Q = K(() => {
232
- if (C)
377
+ }, [Q]);
378
+ O(() => {
379
+ x.current = ne;
380
+ }, [ne]), O(() => {
381
+ T.current = be;
382
+ }, [be]), O(() => {
383
+ M.current = ge;
384
+ }, [ge]), O(() => {
385
+ A();
386
+ }, [A]);
387
+ const q = J((o) => {
388
+ Ce(Qe(o));
389
+ }, []), Se = J(() => {
390
+ if (g)
233
391
  try {
234
- const n = de();
235
- te(C, e, {
392
+ const o = pt();
393
+ lt(g, t, {
236
394
  eventType: "DRAWER_CLOSED",
237
- shop: e,
238
- anonymousUserId: n,
395
+ shop: t,
396
+ anonymousUserId: o,
239
397
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
240
398
  mixpanelEvent: "bundle_closed"
241
399
  }).catch((s) => {
242
400
  console.warn("[Bundle Analytics] Failed to track drawer closed:", s);
243
401
  });
244
- } catch (n) {
245
- console.warn("[Bundle Analytics] Error in close() callback:", n);
402
+ } catch (o) {
403
+ console.warn("[Bundle Analytics] Error in close() callback:", o);
246
404
  }
247
- ot(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(oe) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
248
- }, [C, e]), L = K(() => {
249
- ot((n) => {
250
- if (n) return n;
251
- if (C)
405
+ he(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(mt) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
406
+ }, [g, t]), Pe = J(() => {
407
+ he((o) => {
408
+ if (o) return o;
409
+ if (g)
252
410
  try {
253
- const s = de();
254
- te(C, e, {
411
+ const s = pt();
412
+ lt(g, t, {
255
413
  eventType: "DRAWER_OPENED",
256
- shop: e,
414
+ shop: t,
257
415
  anonymousUserId: s,
258
416
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
259
417
  mixpanelEvent: "bundle_opened"
260
- }).catch((u) => {
261
- console.warn("[Bundle Analytics] Failed to track drawer opened:", u);
418
+ }).catch((b) => {
419
+ console.warn("[Bundle Analytics] Failed to track drawer opened:", b);
262
420
  });
263
421
  } catch (s) {
264
422
  console.warn("[Bundle Analytics] Error in open() callback:", s);
265
423
  }
266
424
  return !0;
267
425
  });
268
- }, [C, e]), Ut = K((n, s) => !s.ok || s.config.isActive === !1 ? (Nt((u) => {
269
- if (!u[n]) return u;
270
- const p = { ...u };
271
- return delete p[n], p;
272
- }), !A && h.current === n && (Z(s.ok ? "Bundle is inactive." : s.error || "Failed to load bundle config."), ot(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(oe) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (Nt((u) => ({
273
- ...u,
274
- [n]: {
426
+ }, [g, t]), rt = J((o, s) => !s.ok || s.config.isActive === !1 ? (Ve((b) => {
427
+ if (!b[o]) return b;
428
+ const w = { ...b };
429
+ return delete w[o], w;
430
+ }), !$ && x.current === o && (ae(s.ok ? W("bundle.provider.inactive_error") : s.error || W("bundle.provider.load_error")), he(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(mt) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (Ve((b) => ({
431
+ ...b,
432
+ [o]: {
275
433
  currencyCode: s.currencyCode ?? null,
276
434
  config: s.config,
277
435
  eligibleVariants: s.eligibleVariants ?? []
278
436
  }
279
- })), h.current === n && Z(null), !0), [A]), mt = K((n, s) => {
437
+ })), x.current === o && ae(null), !0), [$, W]), Fe = J((o, s) => {
280
438
  var y;
281
- const u = qt(n);
282
- (y = Mt.current) == null || y.abort();
283
- const p = new AbortController();
284
- Mt.current = p, s != null && s.blocking && Ct(u), Z(null), R({
285
- apiBaseUrl: t,
286
- shop: e,
287
- configHandle: u,
288
- fresh: (s == null ? void 0 : s.blocking) === !0 && !_.current[u],
289
- signal: p.signal
290
- }).then((g) => {
291
- p.signal.aborted || Ut(u, g);
292
- }).catch((g) => {
293
- if (p.signal.aborted) return;
294
- const x = g instanceof Error ? g.message : "Failed to load bundle config.";
295
- h.current === u && Z(x);
439
+ const b = Qe(o);
440
+ (y = ve.current) == null || y.abort();
441
+ const w = new AbortController();
442
+ ve.current = w, s != null && s.blocking && Ae(b), ae(null), V({
443
+ apiBaseUrl: e,
444
+ shop: t,
445
+ configHandle: b,
446
+ fresh: (s == null ? void 0 : s.blocking) === !0 && !T.current[b],
447
+ signal: w.signal
448
+ }).then((C) => {
449
+ w.signal.aborted || rt(b, C);
450
+ }).catch((C) => {
451
+ if (w.signal.aborted) return;
452
+ const k = C instanceof Error ? C.message : W("bundle.provider.load_error");
453
+ x.current === b && ae(k);
296
454
  }).finally(() => {
297
- p.signal.aborted || Ct((g) => g === u ? null : g);
455
+ w.signal.aborted || Ae((C) => C === b ? null : C);
298
456
  });
299
- }, [t, Ut, R, e]), Jt = K((n) => {
300
- const s = qt(n), u = _.current[s];
301
- dt(s), Z(null), mt(s, { blocking: !u });
302
- }, [mt]), vt = K((n, s = "api") => {
303
- var g, x;
304
- const u = qt(n), p = _.current[u];
305
- if (Y && w.current && !p) {
306
- Wt({ handle: u, source: s });
457
+ }, [e, rt, V, t, W]), re = J((o) => {
458
+ const s = Qe(o), b = T.current[s];
459
+ Ce(s), ae(null), Fe(s, { blocking: !b });
460
+ }, [Fe]), z = J((o, s = "api") => {
461
+ var C, k;
462
+ const b = Qe(o), w = T.current[b];
463
+ if (H && M.current && !w) {
464
+ Me({ handle: b, source: s });
307
465
  return;
308
466
  }
309
- if (dt(u), A) {
310
- L(), mt(u, { blocking: !p });
467
+ if (Ce(b), $) {
468
+ Pe(), Fe(b, { blocking: !w });
311
469
  return;
312
470
  }
313
- if ((g = p == null ? void 0 : p.config) != null && g.isActive) {
314
- Z(null), L(), mt(u, { blocking: !1 });
471
+ if ((C = w == null ? void 0 : w.config) != null && C.isActive) {
472
+ ae(null), Pe(), Fe(b, { blocking: !1 });
315
473
  return;
316
474
  }
317
- Dt(u), (x = Lt.current) == null || x.abort();
475
+ ze(b), (k = f.current) == null || k.abort();
318
476
  const y = new AbortController();
319
- Lt.current = y, $({
320
- apiBaseUrl: t,
321
- shop: e,
322
- configHandle: u,
477
+ f.current = y, ee({
478
+ apiBaseUrl: e,
479
+ shop: t,
480
+ configHandle: b,
323
481
  signal: y.signal
324
- }).then((k) => {
482
+ }).then((P) => {
325
483
  if (!y.signal.aborted) {
326
- if (Dt((D) => D === u ? null : D), !k.ok || k.isActive !== !0) {
327
- s === "hash" && typeof window < "u" && ke(window.location.hash) === u && window.history.replaceState(null, "", window.location.pathname + window.location.search);
484
+ if (ze((G) => G === b ? null : G), !P.ok || P.isActive !== !0) {
485
+ s === "hash" && typeof window < "u" && Ot(window.location.hash) === b && window.history.replaceState(null, "", window.location.pathname + window.location.search);
328
486
  return;
329
487
  }
330
- Z(null), dt(u), L(), mt(u, { blocking: !0 });
488
+ ae(null), Ce(b), Pe(), Fe(b, { blocking: !0 });
331
489
  }
332
490
  }).catch(() => {
333
- y.signal.aborted || Dt((k) => k === u ? null : k);
491
+ y.signal.aborted || ze((P) => P === b ? null : P);
334
492
  });
335
493
  }, [
336
- A,
337
- t,
338
- L,
339
- mt,
340
- e,
341
494
  $,
342
- Y
343
- ]), nt = K(() => {
344
- M(), vt(h.current, "api");
345
- }, [vt, M]);
346
- F(() => {
347
- B.current = vt;
348
- }, [vt]);
349
- const rt = K(() => {
350
- if (X) {
351
- Q();
495
+ e,
496
+ Pe,
497
+ Fe,
498
+ t,
499
+ ee,
500
+ H
501
+ ]), at = J(() => {
502
+ A(), z(x.current, "api");
503
+ }, [z, A]);
504
+ O(() => {
505
+ E.current = z;
506
+ }, [z]);
507
+ const Oe = J(() => {
508
+ if (I) {
509
+ Se();
352
510
  return;
353
511
  }
354
- M(), vt(h.current, "api");
355
- }, [Q, X, vt, M]);
356
- F(() => {
357
- dt(qt(i));
358
- }, [i]), F(() => {
512
+ A(), z(x.current, "api");
513
+ }, [Se, I, z, A]);
514
+ O(() => {
515
+ Ce(Qe(i));
516
+ }, [i]), O(() => {
359
517
  var s;
360
- if (!Y) {
361
- zt(!1), r || mt(et, { blocking: !0 });
518
+ if (!H) {
519
+ Le(!1), r || Fe(K, { blocking: !0 });
362
520
  return;
363
521
  }
364
- (s = jt.current) == null || s.abort();
365
- const n = new AbortController();
366
- return jt.current = n, zt(!0), E({ apiBaseUrl: t, shop: e, signal: n.signal }).then((u) => {
367
- n.signal.aborted || u.ok && Nt((p) => {
368
- const y = { ...p };
369
- for (const [g, x] of Object.entries(u.configs ?? {}))
370
- y[qt(g)] = {
371
- currencyCode: x.currencyCode ?? null,
372
- config: x.config,
373
- eligibleVariants: x.eligibleVariants ?? []
522
+ (s = De.current) == null || s.abort();
523
+ const o = new AbortController();
524
+ return De.current = o, Le(!0), Z({ apiBaseUrl: e, shop: t, signal: o.signal }).then((b) => {
525
+ o.signal.aborted || b.ok && Ve((w) => {
526
+ const y = { ...w };
527
+ for (const [C, k] of Object.entries(b.configs ?? {}))
528
+ y[Qe(C)] = {
529
+ currencyCode: k.currencyCode ?? null,
530
+ config: k.config,
531
+ eligibleVariants: k.eligibleVariants ?? []
374
532
  };
375
533
  return y;
376
534
  });
377
535
  }).catch(() => {
378
536
  }).finally(() => {
379
- n.signal.aborted || zt(!1);
380
- }), () => n.abort();
381
- }, [E, t, r, et, mt, e, Y]), F(() => {
382
- ht || !Rt || (vt(Rt.handle, Rt.source), Wt(null));
383
- }, [ht, vt, Rt]), F(() => {
537
+ o.signal.aborted || Le(!1);
538
+ }), () => o.abort();
539
+ }, [Z, e, r, K, Fe, t, H]), O(() => {
540
+ ge || !We || (z(We.handle, We.source), Me(null));
541
+ }, [ge, z, We]), O(() => {
384
542
  if (typeof window > "u") return;
385
- const n = () => {
386
- var u;
387
- const s = ke(window.location.hash);
388
- s && ((u = B.current) == null || u.call(B, s, "hash"));
543
+ const o = () => {
544
+ var b;
545
+ const s = Ot(window.location.hash);
546
+ s && ((b = E.current) == null || b.call(E, s, "hash"));
389
547
  };
390
- return n(), window.addEventListener("hashchange", n), () => window.removeEventListener("hashchange", n);
548
+ return o(), window.addEventListener("hashchange", o), () => window.removeEventListener("hashchange", o);
391
549
  }, []);
392
- const bt = Tt[U] ?? null, v = (bt == null ? void 0 : bt.config) ?? null, xt = (bt == null ? void 0 : bt.eligibleVariants) ?? Ue, Pt = (bt == null ? void 0 : bt.currencyCode) ?? null, st = !v && (kt === U || It === U) || A && !v && kt != null;
393
- F(() => {
394
- const n = Le(v == null ? void 0 : v.styleSettings);
395
- n && Me(n);
396
- }, [v == null ? void 0 : v.styleSettings]), F(() => {
550
+ const we = be[ne] ?? null, N = (we == null ? void 0 : we.config) ?? null, oe = (we == null ? void 0 : we.eligibleVariants) ?? an, je = (we == null ? void 0 : we.currencyCode) ?? null, xe = !N && (Ie === ne || nt === ne) || $ && !N && Ie != null;
551
+ O(() => {
552
+ const o = Et(N == null ? void 0 : N.styleSettings);
553
+ o && Dt(o);
554
+ }, [N == null ? void 0 : N.styleSettings]), O(() => {
397
555
  if (typeof window > "u") return;
398
- const n = () => {
399
- const s = Le(void 0);
400
- s && Me(s);
556
+ const o = () => {
557
+ const s = Et(void 0);
558
+ s && Dt(s);
401
559
  };
402
- return window.addEventListener("bundle-preview-styles-updated", n), () => window.removeEventListener("bundle-preview-styles-updated", n);
403
- }, []), F(() => {
560
+ return window.addEventListener("bundle-preview-styles-updated", o), () => window.removeEventListener("bundle-preview-styles-updated", o);
561
+ }, []), O(() => {
404
562
  if (typeof window > "u") return;
405
- const n = window, s = () => {
406
- const u = n.__BUNDLE_PREVIEW_CONFIG__;
407
- if (!u) return;
408
- const p = n.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ ?? [];
409
- Nt((y) => {
410
- var g;
563
+ const o = window, s = () => {
564
+ const b = o.__BUNDLE_PREVIEW_CONFIG__;
565
+ if (!b) return;
566
+ const w = o.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ ?? [];
567
+ Ve((y) => {
568
+ var C;
411
569
  return {
412
570
  ...y,
413
- [h.current]: {
414
- currencyCode: Pt ?? null,
415
- config: u,
416
- eligibleVariants: p.length ? p : ((g = y[h.current]) == null ? void 0 : g.eligibleVariants) ?? []
571
+ [x.current]: {
572
+ currencyCode: je ?? null,
573
+ config: b,
574
+ eligibleVariants: w.length ? w : ((C = y[x.current]) == null ? void 0 : C.eligibleVariants) ?? []
417
575
  }
418
576
  };
419
- }), n.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0 ? Ct(h.current) : Ct((y) => y === h.current ? null : y);
577
+ }), o.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0 ? Ae(x.current) : Ae((y) => y === x.current ? null : y);
420
578
  };
421
- return n.__BUNDLE_PREVIEW_CONFIG__ && s(), window.addEventListener("bundle-preview-config-updated", s), () => window.removeEventListener("bundle-preview-config-updated", s);
422
- }, [Pt]);
423
- const ce = T(() => {
424
- const n = Number((v == null ? void 0 : v.maxBundleSize) ?? Number.NaN), s = Number.isFinite(n) ? Math.floor(n) : 100;
579
+ return o.__BUNDLE_PREVIEW_CONFIG__ && s(), window.addEventListener("bundle-preview-config-updated", s), () => window.removeEventListener("bundle-preview-config-updated", s);
580
+ }, [je]);
581
+ const it = L(() => {
582
+ const o = Number((N == null ? void 0 : N.maxBundleSize) ?? Number.NaN), s = Number.isFinite(o) ? Math.floor(o) : 100;
425
583
  return Math.max(2, Math.min(100, s));
426
- }, [v == null ? void 0 : v.maxBundleSize]), Ft = T(() => new Map(
427
- xt.map((n) => {
428
- const s = pe(n);
429
- if (!Number.isFinite(s)) return [n.id, s];
430
- const u = me(j[n.id] ?? 0);
431
- return [n.id, Math.max(0, Math.floor(s) - u)];
584
+ }, [N == null ? void 0 : N.maxBundleSize]), Ue = L(() => new Map(
585
+ oe.map((o) => {
586
+ const s = xt(o);
587
+ if (!Number.isFinite(s)) return [o.id, s];
588
+ const b = gt(me[o.id] ?? 0);
589
+ return [o.id, Math.max(0, Math.floor(s) - b)];
432
590
  })
433
- ), [xt, j]), St = T(() => new Set(
434
- xt.filter((n) => pe(n) > 0).map((n) => n.id)
435
- ), [xt]), Ot = T(() => {
436
- const n = (v == null ? void 0 : v.rules) ?? [], s = n.length ? Math.min(...n.map((g) => g.minBundleSize)) : 2, u = Number.isFinite(s) && s > 0 ? s : 2, p = Number((v == null ? void 0 : v.minBundleSize) ?? Number.NaN), y = Number.isFinite(p) && Number.isInteger(p) ? Math.max(2, Math.min(100, p)) : null;
437
- return y == null ? u : Math.min(u, y);
438
- }, [v == null ? void 0 : v.minBundleSize, v == null ? void 0 : v.rules]), le = K((n, s) => {
439
- if (gt || !St.has(n) && !st)
591
+ ), [oe, me]), He = L(() => new Set(
592
+ oe.filter((o) => xt(o) > 0).map((o) => o.id)
593
+ ), [oe]), Be = L(() => {
594
+ const o = (N == null ? void 0 : N.rules) ?? [], s = o.length ? Math.min(...o.map((C) => C.minBundleSize)) : 2, b = Number.isFinite(s) && s > 0 ? s : 2, w = Number((N == null ? void 0 : N.minBundleSize) ?? Number.NaN), y = Number.isFinite(w) && Number.isInteger(w) ? Math.max(2, Math.min(100, w)) : null;
595
+ return y == null ? b : Math.min(b, y);
596
+ }, [N == null ? void 0 : N.minBundleSize, N == null ? void 0 : N.rules]), ut = J((o, s) => {
597
+ if (X || !He.has(o) && !xe)
440
598
  return;
441
- const u = Ft.get(n) ?? (st ? Number.POSITIVE_INFINITY : 0), p = ye(s, u);
442
- wt((y) => {
443
- const g = y.selections[n] ?? 0, x = p - g, k = Object.values(y.selections).reduce((it, tt) => it + (tt || 0), 0), D = Number.isFinite(u) ? Math.max(0, Math.floor(u) - g) : x, P = x > 0 ? Math.min(
444
- x,
445
- Math.max(0, ce - k),
446
- D
447
- ) : x, G = g + P;
448
- let at;
449
- if (G <= 0) {
450
- const it = { ...y.selections };
451
- delete it[n], at = it;
452
- } else g === G ? at = y.selections : at = { ...y.selections, [n]: G };
453
- let pt = y.order;
454
- if (P > 0)
455
- pt = [...y.order, ...Array.from({ length: P }, () => n)];
456
- else if (P < 0) {
457
- let it = -P;
458
- const tt = [];
459
- for (let Zt = y.order.length - 1; Zt >= 0; Zt--) {
460
- const N = y.order[Zt];
461
- if (N === n && it > 0) {
462
- it--;
599
+ const b = Ue.get(o) ?? (xe ? Number.POSITIVE_INFINITY : 0), w = It(s, b);
600
+ Ne((y) => {
601
+ const C = y.selections[o] ?? 0, k = w - C, P = Object.values(y.selections).reduce((_e, ue) => _e + (ue || 0), 0), G = Number.isFinite(b) ? Math.max(0, Math.floor(b) - C) : k, Y = k > 0 ? Math.min(
602
+ k,
603
+ Math.max(0, it - P),
604
+ G
605
+ ) : k, ce = C + Y;
606
+ let fe;
607
+ if (ce <= 0) {
608
+ const _e = { ...y.selections };
609
+ delete _e[o], fe = _e;
610
+ } else C === ce ? fe = y.selections : fe = { ...y.selections, [o]: ce };
611
+ let $e = y.order;
612
+ if (Y > 0)
613
+ $e = [...y.order, ...Array.from({ length: Y }, () => o)];
614
+ else if (Y < 0) {
615
+ let _e = -Y;
616
+ const ue = [];
617
+ for (let st = y.order.length - 1; st >= 0; st--) {
618
+ const S = y.order[st];
619
+ if (S === o && _e > 0) {
620
+ _e--;
463
621
  continue;
464
622
  }
465
- tt.push(N);
623
+ ue.push(S);
466
624
  }
467
- tt.reverse(), pt = tt;
625
+ ue.reverse(), $e = ue;
468
626
  }
469
- if (at === y.selections && pt === y.order) return y;
470
- const Gt = k, Yt = Object.values(at).reduce((it, tt) => it + (tt || 0), 0);
471
- if (C)
627
+ if (fe === y.selections && $e === y.order) return y;
628
+ const Je = P, et = Object.values(fe).reduce((_e, ue) => _e + (ue || 0), 0);
629
+ if (g)
472
630
  try {
473
- const it = de(), tt = {
631
+ const _e = pt(), ue = {
474
632
  eventType: "VARIANT_SELECTION_CHANGED",
475
- shop: e,
476
- anonymousUserId: it,
633
+ shop: t,
634
+ anonymousUserId: _e,
477
635
  before: { ...y.selections },
478
- after: { ...at },
636
+ after: { ...fe },
479
637
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
480
638
  };
481
- te(C, e, tt), Gt === 0 && Yt >= 1 && te(C, e, {
482
- ...tt,
639
+ lt(g, t, ue), Je === 0 && et >= 1 && lt(g, t, {
640
+ ...ue,
483
641
  mixpanelEvent: "bundle_started"
484
- }), Gt < Ot && Yt >= Ot && te(C, e, {
485
- ...tt,
642
+ }), Je < Be && et >= Be && lt(g, t, {
643
+ ...ue,
486
644
  mixpanelEvent: "bundle_completed"
487
645
  });
488
646
  } catch {
489
647
  }
490
- return { selections: at, order: pt };
648
+ return { selections: fe, order: $e };
491
649
  });
492
- }, [C, gt, St, st, ce, Ot, e, Ft]);
493
- F(() => {
494
- st || wt((n) => {
495
- const s = Object.entries(n.selections).map(([g, x]) => {
496
- if (!St.has(g)) return null;
497
- const k = Ft.get(g) ?? 0, D = ye(x, k);
498
- return D <= 0 ? null : [g, D];
499
- }).filter(Boolean), u = Object.fromEntries(s), p = new Map(s), y = n.order.filter((g) => {
500
- const x = p.get(g) ?? 0;
501
- return x <= 0 ? !1 : (p.set(g, x - 1), !0);
650
+ }, [g, X, He, xe, it, Be, t, Ue]);
651
+ O(() => {
652
+ xe || Ne((o) => {
653
+ const s = Object.entries(o.selections).map(([C, k]) => {
654
+ if (!He.has(C)) return null;
655
+ const P = Ue.get(C) ?? 0, G = It(k, P);
656
+ return G <= 0 ? null : [C, G];
657
+ }).filter(Boolean), b = Object.fromEntries(s), w = new Map(s), y = o.order.filter((C) => {
658
+ const k = w.get(C) ?? 0;
659
+ return k <= 0 ? !1 : (w.set(C, k - 1), !0);
502
660
  });
503
- return y.length === n.order.length && s.length === Object.keys(n.selections).length && s.every(([g, x]) => n.selections[g] === x) ? n : { selections: u, order: y };
661
+ return y.length === o.order.length && s.length === Object.keys(o.selections).length && s.every(([C, k]) => o.selections[C] === k) ? o : { selections: b, order: y };
504
662
  });
505
- }, [St, st, Ft]), F(() => {
506
- wt({ selections: {}, order: [] });
507
- }, [U]);
508
- const Et = K(() => wt({ selections: {}, order: [] }), []), ee = K(async () => {
509
- await M();
510
- }, [M]), ne = K((n) => {
511
- const s = Ft.get(n);
663
+ }, [He, xe, Ue]), O(() => {
664
+ Ne({ selections: {}, order: [] });
665
+ }, [ne]);
666
+ const Ke = J(() => Ne({ selections: {}, order: [] }), []), ot = J(async () => {
667
+ await A();
668
+ }, [A]), dt = J((o) => {
669
+ const s = Ue.get(o);
512
670
  return s == null || !Number.isFinite(s) ? null : Math.max(0, Math.floor(s));
513
- }, [Ft]), Bt = Xt.selections, re = Xt.order, At = T(() => Object.values(Bt).reduce((n, s) => n + (s || 0), 0), [Bt]), Ht = T(() => !(st || gt || J || yt || !(v != null && v.isActive) || At < Ot), [At, gt, v == null ? void 0 : v.isActive, yt, st, Ot, J]), Qt = K(async (n) => {
514
- var tt, Zt;
515
- if (!Ht || !v) return;
516
- const s = Ge(), u = (v.title ?? "").trim().slice(0, 255), p = await M(), y = new Map(
517
- xt.map((N) => {
518
- const ct = pe(N);
519
- if (!Number.isFinite(ct)) return [N.id, ct];
520
- const Kt = me((p ?? j)[N.id] ?? 0);
521
- return [N.id, Math.max(0, Math.floor(ct) - Kt)];
671
+ }, [Ue]), Ee = Ye.selections, ht = Ye.order, qe = L(() => Object.values(Ee).reduce((o, s) => o + (s || 0), 0), [Ee]), Xe = L(() => !(xe || X || ke || ye || !(N != null && N.isActive) || qe < Be), [qe, X, N == null ? void 0 : N.isActive, ye, xe, Be, ke]), Ze = J(async (o) => {
672
+ var ue, st;
673
+ if (!Xe || !N) return;
674
+ const s = ln(), b = (N.title ?? "").trim().slice(0, 255), w = await A(), y = new Map(
675
+ oe.map((S) => {
676
+ const se = xt(S);
677
+ if (!Number.isFinite(se)) return [S.id, se];
678
+ const tt = gt((w ?? me)[S.id] ?? 0);
679
+ return [S.id, Math.max(0, Math.floor(se) - tt)];
522
680
  })
523
- ), g = Object.entries(Bt).map(([N, ct]) => ({
524
- merchandiseId: N,
525
- quantity: ye(ct, y.get(N) ?? 0)
526
- })).filter((N) => N.quantity > 0).filter((N) => St.has(N.merchandiseId)).map((N) => ({
527
- merchandiseId: N.merchandiseId,
528
- quantity: N.quantity,
681
+ ), C = Object.entries(Ee).map(([S, se]) => ({
682
+ merchandiseId: S,
683
+ quantity: It(se, y.get(S) ?? 0)
684
+ })).filter((S) => S.quantity > 0).filter((S) => He.has(S.merchandiseId)).map((S) => ({
685
+ merchandiseId: S.merchandiseId,
686
+ quantity: S.quantity,
529
687
  attributes: [
530
- { key: ue.bundleId, value: s },
531
- { key: ue.bundleConfig, value: U },
532
- { key: ue.bundleSource, value: "bundle_builder" },
533
- ...u ? [{ key: ue.bundleTitle, value: u }] : []
688
+ { key: _t.bundleId, value: s },
689
+ { key: _t.bundleConfig, value: ne },
690
+ { key: _t.bundleSource, value: "bundle_builder" },
691
+ ...b ? [{ key: _t.bundleTitle, value: b }] : []
534
692
  ]
535
693
  }));
536
- if (!g.length) return;
537
- const x = new Map(xt.map((N) => [N.id, N]));
538
- let k = 0;
539
- for (const N of g) {
540
- const ct = N.quantity ?? 0;
541
- if (ct <= 0) continue;
542
- const Kt = x.get(N.merchandiseId), Be = Number(Kt == null ? void 0 : Kt.price);
543
- Number.isFinite(Be) && (k += Be * ct);
694
+ if (!C.length) return;
695
+ const k = new Map(oe.map((S) => [S.id, S]));
696
+ let P = 0;
697
+ for (const S of C) {
698
+ const se = S.quantity ?? 0;
699
+ if (se <= 0) continue;
700
+ const tt = k.get(S.merchandiseId), Pt = Number(tt == null ? void 0 : tt.price);
701
+ Number.isFinite(Pt) && (P += Pt * se);
544
702
  }
545
- k = Math.round(k * 100) / 100;
546
- const D = [...v.rules ?? []].sort((N, ct) => N.minBundleSize - ct.minBundleSize);
547
- let P = null;
548
- for (const N of D)
549
- At >= N.minBundleSize && (P = N);
550
- const G = P ? (() => {
551
- const N = Number.parseFloat(P.discountPercent);
552
- return Number.isFinite(N) && N > 0 ? N : null;
553
- })() : null, at = G ? Math.round(k * (1 - G / 100) * 100) / 100 : k, pt = k - at, Gt = g.map((N) => N.merchandiseId), Yt = (P == null ? void 0 : P.handle) ?? "", it = ((tt = P == null ? void 0 : P.label) == null ? void 0 : tt.trim()) || "";
554
- z(!0);
703
+ P = Math.round(P * 100) / 100;
704
+ const G = [...N.rules ?? []].sort((S, se) => S.minBundleSize - se.minBundleSize);
705
+ let Y = null;
706
+ for (const S of G)
707
+ qe >= S.minBundleSize && (Y = S);
708
+ const ce = Y ? (() => {
709
+ const S = Number.parseFloat(Y.discountPercent);
710
+ return Number.isFinite(S) && S > 0 ? S : null;
711
+ })() : null, fe = ce ? Math.round(P * (1 - ce / 100) * 100) / 100 : P, $e = P - fe, Je = C.map((S) => S.merchandiseId), et = (Y == null ? void 0 : Y.handle) ?? "", _e = ((ue = Y == null ? void 0 : Y.label) == null ? void 0 : ue.trim()) || "";
712
+ Te(!0);
555
713
  try {
556
- if (n != null && n.checkout ? await o.linesAddForCheckout(g) : await o.linesAdd(g), C)
714
+ if (o != null && o.checkout ? await a.linesAddForCheckout(C) : await a.linesAdd(C), g)
557
715
  try {
558
- const N = de(), ct = !!(n != null && n.checkout);
559
- te(C, e, {
716
+ const S = pt(), se = !!(o != null && o.checkout);
717
+ lt(g, t, {
560
718
  eventType: "BUNDLE_ADDED_TO_BASKET",
561
- shop: e,
562
- anonymousUserId: N,
719
+ shop: t,
720
+ anonymousUserId: S,
563
721
  bundleId: s,
564
- productVariantIds: Gt,
565
- grossPrice: k,
566
- discountedPrice: at,
567
- currency: Pt ?? void 0,
568
- discountThresholdIdentifier: Yt,
569
- discountLabel: it,
570
- discountPercentage: G,
571
- discountedAmount: pt,
722
+ productVariantIds: Je,
723
+ grossPrice: P,
724
+ discountedPrice: fe,
725
+ currency: je ?? void 0,
726
+ discountThresholdIdentifier: et,
727
+ discountLabel: _e,
728
+ discountPercentage: ce,
729
+ discountedAmount: $e,
572
730
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
573
- checkout: ct,
574
- mixpanelEvent: ct ? "checkout_started_with_bundle" : "bundle_added_to_cart"
731
+ checkout: se,
732
+ mixpanelEvent: se ? "checkout_started_with_bundle" : "bundle_added_to_cart"
575
733
  });
576
734
  } catch {
577
735
  }
578
- Et(), Q(), M(), (Zt = n == null ? void 0 : n.onComplete) == null || Zt.call(n), Z(null);
579
- } catch (N) {
580
- const ct = N instanceof Error ? N.message : "", Kt = /stock|sold out|inventory|insufficient|available|422/i.test(ct);
581
- Z(
582
- Kt ? "Some bundle items are no longer available in the requested quantity. Please review your selection." : "We couldn't add this bundle right now. Please try again."
583
- ), M();
736
+ Ke(), Se(), A(), (st = o == null ? void 0 : o.onComplete) == null || st.call(o), ae(null);
737
+ } catch (S) {
738
+ const se = S instanceof Error ? S.message : "", tt = /stock|sold out|inventory|insufficient|available|422/i.test(se);
739
+ ae(
740
+ W(tt ? "bundle.provider.stock_error" : "bundle.provider.add_error")
741
+ ), A();
584
742
  } finally {
585
- z(!1);
743
+ Te(!1);
586
744
  }
587
745
  }, [
588
- C,
589
- At,
590
- Ht,
591
- o,
592
- Et,
593
- Q,
594
- v,
595
- Pt,
596
- j,
597
- U,
598
- St,
599
- xt,
600
- M,
601
- Bt,
602
- e
603
- ]), ae = K(async () => {
604
- await Qt({
746
+ g,
747
+ qe,
748
+ Xe,
749
+ a,
750
+ Ke,
751
+ Se,
752
+ N,
753
+ je,
754
+ me,
755
+ ne,
756
+ He,
757
+ oe,
758
+ A,
759
+ Ee,
760
+ t,
761
+ W
762
+ ]), c = J(async () => {
763
+ await Ze({
605
764
  onComplete: () => {
606
- var n;
607
- (n = o.openCartUI) == null || n.call(o);
765
+ var o;
766
+ (o = a.openCartUI) == null || o.call(a);
608
767
  }
609
768
  });
610
- }, [o, Qt]), ie = K(async () => {
611
- await Qt({
769
+ }, [a, Ze]), d = J(async () => {
770
+ await Ze({
612
771
  checkout: !0,
613
772
  onComplete: () => {
614
- var n;
615
- (n = o.navigateToCheckout) == null || n.call(o);
773
+ var o;
774
+ (o = a.navigateToCheckout) == null || o.call(a);
616
775
  }
617
776
  });
618
- }, [o, Qt]), l = T(() => ({
619
- isOpen: X,
620
- open: nt,
621
- openForHandle: vt,
622
- close: Q,
623
- toggle: rt,
624
- currentHandle: U,
625
- setConfigHandle: W,
626
- loadHandle: Jt,
627
- syncCartQuantities: ee,
628
- loading: st,
629
- submitting: J,
630
- error: yt,
631
- currencyCode: Pt,
632
- config: v,
633
- eligibleVariants: xt,
634
- selections: Bt,
635
- selectionOrder: re,
636
- getVariantMaxSelectableQuantity: ne,
637
- setQuantity: le,
638
- clearSelections: Et,
639
- bundleSize: At,
640
- minRequired: Ot,
641
- canSubmit: Ht,
642
- submit: ae,
643
- submitAndCheckout: ie
777
+ }, [a, Ze]), v = L(() => ({
778
+ isOpen: I,
779
+ open: at,
780
+ openForHandle: z,
781
+ close: Se,
782
+ toggle: Oe,
783
+ currentHandle: ne,
784
+ setConfigHandle: q,
785
+ loadHandle: re,
786
+ syncCartQuantities: ot,
787
+ loading: xe,
788
+ submitting: ke,
789
+ error: ye,
790
+ currencyCode: je,
791
+ config: N,
792
+ eligibleVariants: oe,
793
+ selections: Ee,
794
+ selectionOrder: ht,
795
+ getVariantMaxSelectableQuantity: dt,
796
+ setQuantity: ut,
797
+ clearSelections: Ke,
798
+ bundleSize: qe,
799
+ minRequired: Be,
800
+ canSubmit: Xe,
801
+ submit: c,
802
+ submitAndCheckout: d,
803
+ locale: te,
804
+ t: W
644
805
  }), [
645
- At,
646
- Ht,
647
- Et,
648
- Q,
649
- v,
650
- Pt,
651
- U,
652
- xt,
653
- yt,
654
- X,
655
- st,
656
- Ot,
657
- nt,
658
- vt,
659
- re,
660
- Bt,
661
- W,
662
- Jt,
663
- ee,
806
+ qe,
807
+ Xe,
808
+ Ke,
809
+ Se,
810
+ N,
811
+ je,
664
812
  ne,
665
- le,
666
- ae,
667
- ie,
668
- J,
669
- rt
813
+ oe,
814
+ ye,
815
+ I,
816
+ xe,
817
+ Be,
818
+ at,
819
+ z,
820
+ ht,
821
+ Ee,
822
+ q,
823
+ re,
824
+ ot,
825
+ dt,
826
+ ut,
827
+ c,
828
+ d,
829
+ ke,
830
+ Oe,
831
+ te,
832
+ W
670
833
  ]);
671
- return /* @__PURE__ */ c(De.Provider, { value: l, children: O });
834
+ return /* @__PURE__ */ l(Ut.Provider, { value: v, children: F });
672
835
  }
673
- function be() {
674
- const a = Ve(De);
675
- if (!a)
836
+ function wt() {
837
+ const n = Gt(Ut);
838
+ if (!n)
676
839
  throw new Error("useBundleBuilder must be used within <BundleProvider />");
677
- return a;
840
+ return n;
678
841
  }
679
- function li() {
680
- const { isOpen: a, open: t, close: e, toggle: o } = be();
681
- return { isOpen: a, open: t, close: e, toggle: o };
842
+ function xi() {
843
+ const { isOpen: n, open: e, close: t, toggle: a } = wt();
844
+ return { isOpen: n, open: e, close: t, toggle: a };
682
845
  }
683
- const Ke = "_button_18rtl_1", Xe = {
684
- button: Ke
846
+ const un = "_button_18rtl_1", dn = {
847
+ button: un
685
848
  };
686
- function ui(a) {
687
- const { toggle: t } = be();
688
- return /* @__PURE__ */ c(
849
+ function Ci(n) {
850
+ const { toggle: e, t } = wt();
851
+ return /* @__PURE__ */ l(
689
852
  "button",
690
853
  {
691
854
  type: "button",
692
- onClick: t,
693
- className: [Xe.button, a.className].filter(Boolean).join(" "),
694
- children: a.children ?? "Build a bundle"
855
+ onClick: e,
856
+ className: [dn.button, n.className].filter(Boolean).join(" "),
857
+ children: n.children ?? t("bundle.button.default")
695
858
  }
696
859
  );
697
860
  }
698
- var ge, Pe;
699
- function Je() {
700
- if (Pe) return ge;
701
- Pe = 1;
702
- var a = {
703
- linear: function(t, e, o, i) {
704
- var r = o - e;
705
- return r * t / i + e;
861
+ var Nt, qt;
862
+ function hn() {
863
+ if (qt) return Nt;
864
+ qt = 1;
865
+ var n = {
866
+ linear: function(e, t, a, i) {
867
+ var r = a - t;
868
+ return r * e / i + t;
706
869
  },
707
- easeInQuad: function(t, e, o, i) {
708
- var r = o - e;
709
- return r * (t /= i) * t + e;
870
+ easeInQuad: function(e, t, a, i) {
871
+ var r = a - t;
872
+ return r * (e /= i) * e + t;
710
873
  },
711
- easeOutQuad: function(t, e, o, i) {
712
- var r = o - e;
713
- return -r * (t /= i) * (t - 2) + e;
874
+ easeOutQuad: function(e, t, a, i) {
875
+ var r = a - t;
876
+ return -r * (e /= i) * (e - 2) + t;
714
877
  },
715
- easeInOutQuad: function(t, e, o, i) {
716
- var r = o - e;
717
- return (t /= i / 2) < 1 ? r / 2 * t * t + e : -r / 2 * (--t * (t - 2) - 1) + e;
878
+ easeInOutQuad: function(e, t, a, i) {
879
+ var r = a - t;
880
+ return (e /= i / 2) < 1 ? r / 2 * e * e + t : -r / 2 * (--e * (e - 2) - 1) + t;
718
881
  },
719
- easeInCubic: function(t, e, o, i) {
720
- var r = o - e;
721
- return r * (t /= i) * t * t + e;
882
+ easeInCubic: function(e, t, a, i) {
883
+ var r = a - t;
884
+ return r * (e /= i) * e * e + t;
722
885
  },
723
- easeOutCubic: function(t, e, o, i) {
724
- var r = o - e;
725
- return r * ((t = t / i - 1) * t * t + 1) + e;
886
+ easeOutCubic: function(e, t, a, i) {
887
+ var r = a - t;
888
+ return r * ((e = e / i - 1) * e * e + 1) + t;
726
889
  },
727
- easeInOutCubic: function(t, e, o, i) {
728
- var r = o - e;
729
- return (t /= i / 2) < 1 ? r / 2 * t * t * t + e : r / 2 * ((t -= 2) * t * t + 2) + e;
890
+ easeInOutCubic: function(e, t, a, i) {
891
+ var r = a - t;
892
+ return (e /= i / 2) < 1 ? r / 2 * e * e * e + t : r / 2 * ((e -= 2) * e * e + 2) + t;
730
893
  },
731
- easeInQuart: function(t, e, o, i) {
732
- var r = o - e;
733
- return r * (t /= i) * t * t * t + e;
894
+ easeInQuart: function(e, t, a, i) {
895
+ var r = a - t;
896
+ return r * (e /= i) * e * e * e + t;
734
897
  },
735
- easeOutQuart: function(t, e, o, i) {
736
- var r = o - e;
737
- return -r * ((t = t / i - 1) * t * t * t - 1) + e;
898
+ easeOutQuart: function(e, t, a, i) {
899
+ var r = a - t;
900
+ return -r * ((e = e / i - 1) * e * e * e - 1) + t;
738
901
  },
739
- easeInOutQuart: function(t, e, o, i) {
740
- var r = o - e;
741
- return (t /= i / 2) < 1 ? r / 2 * t * t * t * t + e : -r / 2 * ((t -= 2) * t * t * t - 2) + e;
902
+ easeInOutQuart: function(e, t, a, i) {
903
+ var r = a - t;
904
+ return (e /= i / 2) < 1 ? r / 2 * e * e * e * e + t : -r / 2 * ((e -= 2) * e * e * e - 2) + t;
742
905
  },
743
- easeInQuint: function(t, e, o, i) {
744
- var r = o - e;
745
- return r * (t /= i) * t * t * t * t + e;
906
+ easeInQuint: function(e, t, a, i) {
907
+ var r = a - t;
908
+ return r * (e /= i) * e * e * e * e + t;
746
909
  },
747
- easeOutQuint: function(t, e, o, i) {
748
- var r = o - e;
749
- return r * ((t = t / i - 1) * t * t * t * t + 1) + e;
910
+ easeOutQuint: function(e, t, a, i) {
911
+ var r = a - t;
912
+ return r * ((e = e / i - 1) * e * e * e * e + 1) + t;
750
913
  },
751
- easeInOutQuint: function(t, e, o, i) {
752
- var r = o - e;
753
- return (t /= i / 2) < 1 ? r / 2 * t * t * t * t * t + e : r / 2 * ((t -= 2) * t * t * t * t + 2) + e;
914
+ easeInOutQuint: function(e, t, a, i) {
915
+ var r = a - t;
916
+ return (e /= i / 2) < 1 ? r / 2 * e * e * e * e * e + t : r / 2 * ((e -= 2) * e * e * e * e + 2) + t;
754
917
  },
755
- easeInSine: function(t, e, o, i) {
756
- var r = o - e;
757
- return -r * Math.cos(t / i * (Math.PI / 2)) + r + e;
918
+ easeInSine: function(e, t, a, i) {
919
+ var r = a - t;
920
+ return -r * Math.cos(e / i * (Math.PI / 2)) + r + t;
758
921
  },
759
- easeOutSine: function(t, e, o, i) {
760
- var r = o - e;
761
- return r * Math.sin(t / i * (Math.PI / 2)) + e;
922
+ easeOutSine: function(e, t, a, i) {
923
+ var r = a - t;
924
+ return r * Math.sin(e / i * (Math.PI / 2)) + t;
762
925
  },
763
- easeInOutSine: function(t, e, o, i) {
764
- var r = o - e;
765
- return -r / 2 * (Math.cos(Math.PI * t / i) - 1) + e;
926
+ easeInOutSine: function(e, t, a, i) {
927
+ var r = a - t;
928
+ return -r / 2 * (Math.cos(Math.PI * e / i) - 1) + t;
766
929
  },
767
- easeInExpo: function(t, e, o, i) {
768
- var r = o - e;
769
- return t == 0 ? e : r * Math.pow(2, 10 * (t / i - 1)) + e;
930
+ easeInExpo: function(e, t, a, i) {
931
+ var r = a - t;
932
+ return e == 0 ? t : r * Math.pow(2, 10 * (e / i - 1)) + t;
770
933
  },
771
- easeOutExpo: function(t, e, o, i) {
772
- var r = o - e;
773
- return t == i ? e + r : r * (-Math.pow(2, -10 * t / i) + 1) + e;
934
+ easeOutExpo: function(e, t, a, i) {
935
+ var r = a - t;
936
+ return e == i ? t + r : r * (-Math.pow(2, -10 * e / i) + 1) + t;
774
937
  },
775
- easeInOutExpo: function(t, e, o, i) {
776
- var r = o - e;
777
- return t === 0 ? e : t === i ? e + r : (t /= i / 2) < 1 ? r / 2 * Math.pow(2, 10 * (t - 1)) + e : r / 2 * (-Math.pow(2, -10 * --t) + 2) + e;
938
+ easeInOutExpo: function(e, t, a, i) {
939
+ var r = a - t;
940
+ return e === 0 ? t : e === i ? t + r : (e /= i / 2) < 1 ? r / 2 * Math.pow(2, 10 * (e - 1)) + t : r / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
778
941
  },
779
- easeInCirc: function(t, e, o, i) {
780
- var r = o - e;
781
- return -r * (Math.sqrt(1 - (t /= i) * t) - 1) + e;
942
+ easeInCirc: function(e, t, a, i) {
943
+ var r = a - t;
944
+ return -r * (Math.sqrt(1 - (e /= i) * e) - 1) + t;
782
945
  },
783
- easeOutCirc: function(t, e, o, i) {
784
- var r = o - e;
785
- return r * Math.sqrt(1 - (t = t / i - 1) * t) + e;
946
+ easeOutCirc: function(e, t, a, i) {
947
+ var r = a - t;
948
+ return r * Math.sqrt(1 - (e = e / i - 1) * e) + t;
786
949
  },
787
- easeInOutCirc: function(t, e, o, i) {
788
- var r = o - e;
789
- return (t /= i / 2) < 1 ? -r / 2 * (Math.sqrt(1 - t * t) - 1) + e : r / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + e;
950
+ easeInOutCirc: function(e, t, a, i) {
951
+ var r = a - t;
952
+ return (e /= i / 2) < 1 ? -r / 2 * (Math.sqrt(1 - e * e) - 1) + t : r / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
790
953
  },
791
- easeInElastic: function(t, e, o, i) {
792
- var r = o - e, m, d, S;
793
- return S = 1.70158, d = 0, m = r, t === 0 ? e : (t /= i) === 1 ? e + r : (d || (d = i * 0.3), m < Math.abs(r) ? (m = r, S = d / 4) : S = d / (2 * Math.PI) * Math.asin(r / m), -(m * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - S) * (2 * Math.PI) / d)) + e);
954
+ easeInElastic: function(e, t, a, i) {
955
+ var r = a - t, h, u, B;
956
+ return B = 1.70158, u = 0, h = r, e === 0 ? t : (e /= i) === 1 ? t + r : (u || (u = i * 0.3), h < Math.abs(r) ? (h = r, B = u / 4) : B = u / (2 * Math.PI) * Math.asin(r / h), -(h * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * i - B) * (2 * Math.PI) / u)) + t);
794
957
  },
795
- easeOutElastic: function(t, e, o, i) {
796
- var r = o - e, m, d, S;
797
- return S = 1.70158, d = 0, m = r, t === 0 ? e : (t /= i) === 1 ? e + r : (d || (d = i * 0.3), m < Math.abs(r) ? (m = r, S = d / 4) : S = d / (2 * Math.PI) * Math.asin(r / m), m * Math.pow(2, -10 * t) * Math.sin((t * i - S) * (2 * Math.PI) / d) + r + e);
958
+ easeOutElastic: function(e, t, a, i) {
959
+ var r = a - t, h, u, B;
960
+ return B = 1.70158, u = 0, h = r, e === 0 ? t : (e /= i) === 1 ? t + r : (u || (u = i * 0.3), h < Math.abs(r) ? (h = r, B = u / 4) : B = u / (2 * Math.PI) * Math.asin(r / h), h * Math.pow(2, -10 * e) * Math.sin((e * i - B) * (2 * Math.PI) / u) + r + t);
798
961
  },
799
- easeInOutElastic: function(t, e, o, i) {
800
- var r = o - e, m, d, S;
801
- return S = 1.70158, d = 0, m = r, t === 0 ? e : (t /= i / 2) === 2 ? e + r : (d || (d = i * (0.3 * 1.5)), m < Math.abs(r) ? (m = r, S = d / 4) : S = d / (2 * Math.PI) * Math.asin(r / m), t < 1 ? -0.5 * (m * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - S) * (2 * Math.PI) / d)) + e : m * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * i - S) * (2 * Math.PI) / d) * 0.5 + r + e);
962
+ easeInOutElastic: function(e, t, a, i) {
963
+ var r = a - t, h, u, B;
964
+ return B = 1.70158, u = 0, h = r, e === 0 ? t : (e /= i / 2) === 2 ? t + r : (u || (u = i * (0.3 * 1.5)), h < Math.abs(r) ? (h = r, B = u / 4) : B = u / (2 * Math.PI) * Math.asin(r / h), e < 1 ? -0.5 * (h * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * i - B) * (2 * Math.PI) / u)) + t : h * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * i - B) * (2 * Math.PI) / u) * 0.5 + r + t);
802
965
  },
803
- easeInBack: function(t, e, o, i, r) {
804
- var m = o - e;
805
- return r === void 0 && (r = 1.70158), m * (t /= i) * t * ((r + 1) * t - r) + e;
966
+ easeInBack: function(e, t, a, i, r) {
967
+ var h = a - t;
968
+ return r === void 0 && (r = 1.70158), h * (e /= i) * e * ((r + 1) * e - r) + t;
806
969
  },
807
- easeOutBack: function(t, e, o, i, r) {
808
- var m = o - e;
809
- return r === void 0 && (r = 1.70158), m * ((t = t / i - 1) * t * ((r + 1) * t + r) + 1) + e;
970
+ easeOutBack: function(e, t, a, i, r) {
971
+ var h = a - t;
972
+ return r === void 0 && (r = 1.70158), h * ((e = e / i - 1) * e * ((r + 1) * e + r) + 1) + t;
810
973
  },
811
- easeInOutBack: function(t, e, o, i, r) {
812
- var m = o - e;
813
- return r === void 0 && (r = 1.70158), (t /= i / 2) < 1 ? m / 2 * (t * t * (((r *= 1.525) + 1) * t - r)) + e : m / 2 * ((t -= 2) * t * (((r *= 1.525) + 1) * t + r) + 2) + e;
974
+ easeInOutBack: function(e, t, a, i, r) {
975
+ var h = a - t;
976
+ return r === void 0 && (r = 1.70158), (e /= i / 2) < 1 ? h / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : h / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t;
814
977
  },
815
- easeInBounce: function(t, e, o, i) {
816
- var r = o - e, m;
817
- return m = a.easeOutBounce(i - t, 0, r, i), r - m + e;
978
+ easeInBounce: function(e, t, a, i) {
979
+ var r = a - t, h;
980
+ return h = n.easeOutBounce(i - e, 0, r, i), r - h + t;
818
981
  },
819
- easeOutBounce: function(t, e, o, i) {
820
- var r = o - e;
821
- return (t /= i) < 1 / 2.75 ? r * (7.5625 * t * t) + e : t < 2 / 2.75 ? r * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + e : t < 2.5 / 2.75 ? r * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + e : r * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + e;
982
+ easeOutBounce: function(e, t, a, i) {
983
+ var r = a - t;
984
+ return (e /= i) < 1 / 2.75 ? r * (7.5625 * e * e) + t : e < 2 / 2.75 ? r * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t : e < 2.5 / 2.75 ? r * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t : r * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
822
985
  },
823
- easeInOutBounce: function(t, e, o, i) {
824
- var r = o - e, m;
825
- return t < i / 2 ? (m = a.easeInBounce(t * 2, 0, r, i), m * 0.5 + e) : (m = a.easeOutBounce(t * 2 - i, 0, r, i), m * 0.5 + r * 0.5 + e);
986
+ easeInOutBounce: function(e, t, a, i) {
987
+ var r = a - t, h;
988
+ return e < i / 2 ? (h = n.easeInBounce(e * 2, 0, r, i), h * 0.5 + t) : (h = n.easeOutBounce(e * 2 - i, 0, r, i), h * 0.5 + r * 0.5 + t);
826
989
  }
827
990
  };
828
- return ge = a, ge;
991
+ return Nt = n, Nt;
829
992
  }
830
- var Ze = Je();
831
- function tn(a) {
832
- return a * Math.PI / 180;
993
+ var mn = hn();
994
+ function bn(n) {
995
+ return n * Math.PI / 180;
833
996
  }
834
- function _t(a, t) {
835
- return a + Math.random() * (t - a);
997
+ function pe(n, e) {
998
+ return n + Math.random() * (e - n);
836
999
  }
837
- function en(a, t) {
838
- return Math.floor(a + Math.random() * (t - a + 1));
1000
+ function fn(n, e) {
1001
+ return Math.floor(n + Math.random() * (e - n + 1));
839
1002
  }
840
- var se;
841
- (function(a) {
842
- a[a.Circle = 0] = "Circle", a[a.Square = 1] = "Square", a[a.Strip = 2] = "Strip";
843
- })(se || (se = {}));
844
- var Vt;
845
- (function(a) {
846
- a[a.Positive = 1] = "Positive", a[a.Negative = -1] = "Negative";
847
- })(Vt || (Vt = {}));
848
- const nn = 1e3 / 60;
849
- class rn {
850
- constructor(t, e, o, i) {
851
- this.getOptions = e;
852
- const { colors: r, initialVelocityX: m, initialVelocityY: d } = this.getOptions();
853
- this.context = t, this.x = o, this.y = i, this.w = _t(5, 20), this.h = _t(5, 20), this.radius = _t(5, 10), this.vx = typeof m == "number" ? _t(-m, m) : _t(m.min, m.max), this.vy = typeof d == "number" ? _t(-d, 0) : _t(d.min, d.max), this.shape = en(0, 2), this.angle = tn(_t(0, 360)), this.angularSpin = _t(-0.2, 0.2), this.color = r[Math.floor(Math.random() * r.length)], this.rotateY = _t(0, 1), this.rotationDirection = _t(0, 1) ? Vt.Positive : Vt.Negative;
1003
+ var bt;
1004
+ (function(n) {
1005
+ n[n.Circle = 0] = "Circle", n[n.Square = 1] = "Square", n[n.Strip = 2] = "Strip";
1006
+ })(bt || (bt = {}));
1007
+ var Ge;
1008
+ (function(n) {
1009
+ n[n.Positive = 1] = "Positive", n[n.Negative = -1] = "Negative";
1010
+ })(Ge || (Ge = {}));
1011
+ const _n = 1e3 / 60;
1012
+ class pn {
1013
+ constructor(e, t, a, i) {
1014
+ this.getOptions = t;
1015
+ const { colors: r, initialVelocityX: h, initialVelocityY: u } = this.getOptions();
1016
+ this.context = e, this.x = a, this.y = i, this.w = pe(5, 20), this.h = pe(5, 20), this.radius = pe(5, 10), this.vx = typeof h == "number" ? pe(-h, h) : pe(h.min, h.max), this.vy = typeof u == "number" ? pe(-u, 0) : pe(u.min, u.max), this.shape = fn(0, 2), this.angle = bn(pe(0, 360)), this.angularSpin = pe(-0.2, 0.2), this.color = r[Math.floor(Math.random() * r.length)], this.rotateY = pe(0, 1), this.rotationDirection = pe(0, 1) ? Ge.Positive : Ge.Negative;
854
1017
  }
855
- update(t) {
856
- const { gravity: e, wind: o, friction: i, opacity: r, drawShape: m } = this.getOptions(), d = t / nn;
857
- this.x += this.vx * d, this.y += this.vy * d, this.vy += e * d, this.vx += o * d, this.vx *= i ** d, this.vy *= i ** d, this.rotateY >= 1 && this.rotationDirection === Vt.Positive ? this.rotationDirection = Vt.Negative : this.rotateY <= -1 && this.rotationDirection === Vt.Negative && (this.rotationDirection = Vt.Positive);
858
- const S = 0.1 * this.rotationDirection * d;
859
- if (this.rotateY += S, 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 = r, this.context.lineCap = "round", this.context.lineWidth = 2, m && typeof m == "function")
860
- m.call(this, this.context);
1018
+ update(e) {
1019
+ const { gravity: t, wind: a, friction: i, opacity: r, drawShape: h } = this.getOptions(), u = e / _n;
1020
+ this.x += this.vx * u, this.y += this.vy * u, this.vy += t * u, this.vx += a * u, this.vx *= i ** u, this.vy *= i ** u, this.rotateY >= 1 && this.rotationDirection === Ge.Positive ? this.rotationDirection = Ge.Negative : this.rotateY <= -1 && this.rotationDirection === Ge.Negative && (this.rotationDirection = Ge.Positive);
1021
+ const B = 0.1 * this.rotationDirection * u;
1022
+ if (this.rotateY += B, this.angle += this.angularSpin, this.context.save(), this.context.translate(this.x, this.y), this.context.rotate(this.angle), this.context.scale(1, this.rotateY), this.context.rotate(this.angle), this.context.beginPath(), this.context.fillStyle = this.color, this.context.strokeStyle = this.color, this.context.globalAlpha = r, this.context.lineCap = "round", this.context.lineWidth = 2, h && typeof h == "function")
1023
+ h.call(this, this.context);
861
1024
  else
862
1025
  switch (this.shape) {
863
- case se.Circle: {
1026
+ case bt.Circle: {
864
1027
  this.context.beginPath(), this.context.arc(0, 0, this.radius, 0, 2 * Math.PI), this.context.fill();
865
1028
  break;
866
1029
  }
867
- case se.Square: {
1030
+ case bt.Square: {
868
1031
  this.context.fillRect(-this.w / 2, -this.h / 2, this.w, this.h);
869
1032
  break;
870
1033
  }
871
- case se.Strip: {
1034
+ case bt.Strip: {
872
1035
  this.context.fillRect(-this.w / 6, -this.h / 2, this.w / 3, this.h);
873
1036
  break;
874
1037
  }
@@ -876,39 +1039,39 @@ class rn {
876
1039
  this.context.closePath(), this.context.restore();
877
1040
  }
878
1041
  }
879
- class an {
880
- constructor(t, e) {
1042
+ class yn {
1043
+ constructor(e, t) {
881
1044
  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 = (i) => {
882
1045
  this.particles.splice(i, 1);
883
1046
  }, this.getParticle = () => {
884
- const i = _t(this.x, this.w + this.x), r = _t(this.y, this.h + this.y);
885
- return new rn(this.context, this.getOptions, i, r);
1047
+ const i = pe(this.x, this.w + this.x), r = pe(this.y, this.h + this.y);
1048
+ return new pn(this.context, this.getOptions, i, r);
886
1049
  }, this.animate = (i) => {
887
- const { canvas: r, context: m, particlesGenerated: d, lastNumberOfPieces: S } = this, { run: lt, recycle: A, numberOfPieces: O, debug: et, tweenFunction: C, tweenDuration: Y } = this.getOptions();
888
- if (!lt)
1050
+ const { canvas: r, context: h, particlesGenerated: u, lastNumberOfPieces: B } = this, { run: le, recycle: $, numberOfPieces: D, debug: de, tweenFunction: F, tweenDuration: te } = this.getOptions();
1051
+ if (!le)
889
1052
  return !1;
890
- const X = this.particles.length, ot = A ? X : d;
891
- if (ot < O) {
892
- S !== O && (this.tweenProgress = 0, this.tweenFrom = ot, this.lastNumberOfPieces = O), this.tweenProgress = Math.min(Y, Math.max(0, this.tweenProgress + i));
893
- const J = C(this.tweenProgress, this.tweenFrom, O, Y), z = Math.round(J - ot);
894
- for (let yt = 0; yt < z; yt++)
1053
+ const W = this.particles.length, K = $ ? W : u;
1054
+ if (K < D) {
1055
+ B !== D && (this.tweenProgress = 0, this.tweenFrom = K, this.lastNumberOfPieces = D), this.tweenProgress = Math.min(te, Math.max(0, this.tweenProgress + i));
1056
+ const g = F(this.tweenProgress, this.tweenFrom, D, te), H = Math.round(g - K);
1057
+ for (let I = 0; I < H; I++)
895
1058
  this.particles.push(this.getParticle());
896
- this.particlesGenerated += z;
1059
+ this.particlesGenerated += H;
897
1060
  }
898
- et && (m.font = "12px sans-serif", m.fillStyle = "#333", m.textAlign = "right", m.fillText(`Particles: ${X}`, r.width - 10, r.height - 20));
899
- for (let J = this.particles.length - 1; J >= 0; J--) {
900
- const z = this.particles[J];
901
- z.update(i), (z.y > r.height || z.y < -100 || z.x > r.width + 100 || z.x < -100) && (A && ot <= O ? this.particles[J] = this.getParticle() : this.removeParticleAt(J));
1061
+ de && (h.font = "12px sans-serif", h.fillStyle = "#333", h.textAlign = "right", h.fillText(`Particles: ${W}`, r.width - 10, r.height - 20));
1062
+ for (let g = this.particles.length - 1; g >= 0; g--) {
1063
+ const H = this.particles[g];
1064
+ H.update(i), (H.y > r.height || H.y < -100 || H.x > r.width + 100 || H.x < -100) && ($ && K <= D ? this.particles[g] = this.getParticle() : this.removeParticleAt(g));
902
1065
  }
903
- return X > 0 || ot < O;
904
- }, this.canvas = t;
905
- const o = this.canvas.getContext("2d");
906
- if (!o)
1066
+ return W > 0 || K < D;
1067
+ }, this.canvas = e;
1068
+ const a = this.canvas.getContext("2d");
1069
+ if (!a)
907
1070
  throw new Error("Could not get canvas context");
908
- this.context = o, this.getOptions = e;
1071
+ this.context = a, this.getOptions = t;
909
1072
  }
910
1073
  }
911
- const Ne = {
1074
+ const Rt = {
912
1075
  width: typeof window < "u" ? window.innerWidth : 300,
913
1076
  height: typeof window < "u" ? window.innerHeight : 200,
914
1077
  numberOfPieces: 200,
@@ -938,13 +1101,13 @@ const Ne = {
938
1101
  ],
939
1102
  opacity: 1,
940
1103
  debug: !1,
941
- tweenFunction: Ze.easeInOutQuad,
1104
+ tweenFunction: mn.easeInOutQuad,
942
1105
  tweenDuration: 5e3,
943
1106
  recycle: !0,
944
1107
  run: !0
945
1108
  };
946
- class on {
947
- constructor(t, e) {
1109
+ class gn {
1110
+ constructor(e, t) {
948
1111
  this.lastFrameTime = 0, this.setOptionsWithDefaults = (i) => {
949
1112
  const r = {
950
1113
  confettiSource: {
@@ -956,55 +1119,55 @@ class on {
956
1119
  };
957
1120
  this._options = {
958
1121
  ...r,
959
- ...Ne,
1122
+ ...Rt,
960
1123
  ...i
961
1124
  }, Object.assign(this, i.confettiSource);
962
1125
  }, this.update = (i = 0) => {
963
- const { options: { run: r, onConfettiComplete: m, frameRate: d }, canvas: S, context: lt } = this, A = Math.min(i - this.lastFrameTime, 50);
964
- if (d && A < 1e3 / d) {
1126
+ const { options: { run: r, onConfettiComplete: h, frameRate: u }, canvas: B, context: le } = this, $ = Math.min(i - this.lastFrameTime, 50);
1127
+ if (u && $ < 1e3 / u) {
965
1128
  this.rafId = requestAnimationFrame(this.update);
966
1129
  return;
967
1130
  }
968
- this.lastFrameTime = i - (d ? A % d : 0), r && (lt.fillStyle = "white", lt.clearRect(0, 0, S.width, S.height)), this.generator.animate(A) ? this.rafId = requestAnimationFrame(this.update) : (m && typeof m == "function" && this.generator.particlesGenerated > 0 && m.call(this, this), this._options.run = !1);
1131
+ this.lastFrameTime = i - (u ? $ % u : 0), r && (le.fillStyle = "white", le.clearRect(0, 0, B.width, B.height)), this.generator.animate($) ? this.rafId = requestAnimationFrame(this.update) : (h && typeof h == "function" && this.generator.particlesGenerated > 0 && h.call(this, this), this._options.run = !1);
969
1132
  }, this.reset = () => {
970
1133
  this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
971
1134
  }, this.stop = () => {
972
1135
  this.options = { run: !1 }, this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = void 0);
973
- }, this.canvas = t;
974
- const o = this.canvas.getContext("2d");
975
- if (!o)
1136
+ }, this.canvas = e;
1137
+ const a = this.canvas.getContext("2d");
1138
+ if (!a)
976
1139
  throw new Error("Could not get canvas context");
977
- this.context = o, this.generator = new an(this.canvas, () => this.options), this.options = e, this.update();
1140
+ this.context = a, this.generator = new yn(this.canvas, () => this.options), this.options = t, this.update();
978
1141
  }
979
1142
  get options() {
980
1143
  return this._options;
981
1144
  }
982
- set options(t) {
1145
+ set options(e) {
983
1146
  var i, r;
984
- const e = (i = this._options) == null ? void 0 : i.run, o = (r = this._options) == null ? void 0 : r.recycle;
985
- 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();
1147
+ const t = (i = this._options) == null ? void 0 : i.run, a = (r = this._options) == null ? void 0 : r.recycle;
1148
+ this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle && a === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof e.run == "boolean" && e.run && t === !1 && this.update();
986
1149
  }
987
1150
  }
988
- const sn = fe.createRef();
989
- class Ie extends fe.Component {
990
- constructor(t) {
991
- super(t), this.canvas = fe.createRef(), this.canvas = t.canvasRef || sn;
1151
+ const vn = vt.createRef();
1152
+ class Lt extends vt.Component {
1153
+ constructor(e) {
1154
+ super(e), this.canvas = vt.createRef(), this.canvas = e.canvasRef || vn;
992
1155
  }
993
1156
  componentDidMount() {
994
1157
  if (this.canvas.current) {
995
- const t = we(this.props)[0];
996
- this.confetti = new on(this.canvas.current, t);
1158
+ const e = St(this.props)[0];
1159
+ this.confetti = new gn(this.canvas.current, e);
997
1160
  }
998
1161
  }
999
1162
  componentDidUpdate() {
1000
- const t = we(this.props)[0];
1001
- this.confetti && (this.confetti.options = t);
1163
+ const e = St(this.props)[0];
1164
+ this.confetti && (this.confetti.options = e);
1002
1165
  }
1003
1166
  componentWillUnmount() {
1004
1167
  this.confetti && this.confetti.stop(), this.confetti = void 0;
1005
1168
  }
1006
1169
  render() {
1007
- const [t, e] = we(this.props), o = {
1170
+ const [e, t] = St(this.props), a = {
1008
1171
  zIndex: 2,
1009
1172
  position: "absolute",
1010
1173
  pointerEvents: "none",
@@ -1012,45 +1175,45 @@ class Ie extends fe.Component {
1012
1175
  left: 0,
1013
1176
  bottom: 0,
1014
1177
  right: 0,
1015
- ...e.style
1178
+ ...t.style
1016
1179
  };
1017
- return c("canvas", { width: t.width, height: t.height, ref: this.canvas, ...e, style: o });
1180
+ return l("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: a });
1018
1181
  }
1019
1182
  }
1020
- Ie.defaultProps = {
1021
- ...Ne
1183
+ Lt.defaultProps = {
1184
+ ...Rt
1022
1185
  };
1023
- Ie.displayName = "ReactConfetti";
1024
- function we(a) {
1025
- const t = {}, e = {}, o = {}, i = [
1026
- ...Object.keys(Ne),
1186
+ Lt.displayName = "ReactConfetti";
1187
+ function St(n) {
1188
+ const e = {}, t = {}, a = {}, i = [
1189
+ ...Object.keys(Rt),
1027
1190
  "confettiSource",
1028
1191
  "drawShape",
1029
1192
  "onConfettiComplete",
1030
1193
  "frameRate"
1031
1194
  ], r = ["canvasRef"];
1032
- for (const m in a) {
1033
- const d = a[m];
1034
- i.includes(m) ? t[m] = d : r.includes(m) ? r[m] = d : o[m] = d;
1195
+ for (const h in n) {
1196
+ const u = n[h];
1197
+ i.includes(h) ? e[h] = u : r.includes(h) ? r[h] = u : a[h] = u;
1035
1198
  }
1036
- return [t, o, e];
1199
+ return [e, a, t];
1037
1200
  }
1038
- const cn = fe.forwardRef((a, t) => c(Ie, { canvasRef: t, ...a }));
1201
+ const wn = vt.forwardRef((n, e) => l(Lt, { canvasRef: e, ...n }));
1039
1202
  /**
1040
1203
  * @license lucide-react v0.515.0 - ISC
1041
1204
  *
1042
1205
  * This source code is licensed under the ISC license.
1043
1206
  * See the LICENSE file in the root directory of this source tree.
1044
1207
  */
1045
- const ln = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), un = (a) => a.replace(
1208
+ const xn = (n) => n.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Cn = (n) => n.replace(
1046
1209
  /^([A-Z])|[\s-_]+(\w)/g,
1047
- (t, e, o) => o ? o.toUpperCase() : e.toLowerCase()
1048
- ), Fe = (a) => {
1049
- const t = un(a);
1050
- return t.charAt(0).toUpperCase() + t.slice(1);
1051
- }, Ee = (...a) => a.filter((t, e, o) => !!t && t.trim() !== "" && o.indexOf(t) === e).join(" ").trim(), dn = (a) => {
1052
- for (const t in a)
1053
- if (t.startsWith("aria-") || t === "role" || t === "title")
1210
+ (e, t, a) => a ? a.toUpperCase() : t.toLowerCase()
1211
+ ), $t = (n) => {
1212
+ const e = Cn(n);
1213
+ return e.charAt(0).toUpperCase() + e.slice(1);
1214
+ }, Ht = (...n) => n.filter((e, t, a) => !!e && e.trim() !== "" && a.indexOf(e) === t).join(" ").trim(), In = (n) => {
1215
+ for (const e in n)
1216
+ if (e.startsWith("aria-") || e === "role" || e === "title")
1054
1217
  return !0;
1055
1218
  };
1056
1219
  /**
@@ -1059,7 +1222,7 @@ const ln = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), un = (
1059
1222
  * This source code is licensed under the ISC license.
1060
1223
  * See the LICENSE file in the root directory of this source tree.
1061
1224
  */
1062
- var hn = {
1225
+ var Nn = {
1063
1226
  xmlns: "http://www.w3.org/2000/svg",
1064
1227
  width: 24,
1065
1228
  height: 24,
@@ -1076,31 +1239,31 @@ var hn = {
1076
1239
  * This source code is licensed under the ISC license.
1077
1240
  * See the LICENSE file in the root directory of this source tree.
1078
1241
  */
1079
- const mn = $e(
1242
+ const Sn = Wt(
1080
1243
  ({
1081
- color: a = "currentColor",
1082
- size: t = 24,
1083
- strokeWidth: e = 2,
1084
- absoluteStrokeWidth: o,
1244
+ color: n = "currentColor",
1245
+ size: e = 24,
1246
+ strokeWidth: t = 2,
1247
+ absoluteStrokeWidth: a,
1085
1248
  className: i = "",
1086
1249
  children: r,
1087
- iconNode: m,
1088
- ...d
1089
- }, S) => Ce(
1250
+ iconNode: h,
1251
+ ...u
1252
+ }, B) => Tt(
1090
1253
  "svg",
1091
1254
  {
1092
- ref: S,
1093
- ...hn,
1094
- width: t,
1095
- height: t,
1096
- stroke: a,
1097
- strokeWidth: o ? Number(e) * 24 / Number(t) : e,
1098
- className: Ee("lucide", i),
1099
- ...!r && !dn(d) && { "aria-hidden": "true" },
1100
- ...d
1255
+ ref: B,
1256
+ ...Nn,
1257
+ width: e,
1258
+ height: e,
1259
+ stroke: n,
1260
+ strokeWidth: a ? Number(t) * 24 / Number(e) : t,
1261
+ className: Ht("lucide", i),
1262
+ ...!r && !In(u) && { "aria-hidden": "true" },
1263
+ ...u
1101
1264
  },
1102
1265
  [
1103
- ...m.map(([lt, A]) => Ce(lt, A)),
1266
+ ...h.map(([le, $]) => Tt(le, $)),
1104
1267
  ...Array.isArray(r) ? r : [r]
1105
1268
  ]
1106
1269
  )
@@ -1111,20 +1274,20 @@ const mn = $e(
1111
1274
  * This source code is licensed under the ISC license.
1112
1275
  * See the LICENSE file in the root directory of this source tree.
1113
1276
  */
1114
- const Se = (a, t) => {
1115
- const e = $e(
1116
- ({ className: o, ...i }, r) => Ce(mn, {
1277
+ const Mt = (n, e) => {
1278
+ const t = Wt(
1279
+ ({ className: a, ...i }, r) => Tt(Sn, {
1117
1280
  ref: r,
1118
- iconNode: t,
1119
- className: Ee(
1120
- `lucide-${ln(Fe(a))}`,
1121
- `lucide-${a}`,
1122
- o
1281
+ iconNode: e,
1282
+ className: Ht(
1283
+ `lucide-${xn($t(n))}`,
1284
+ `lucide-${n}`,
1285
+ a
1123
1286
  ),
1124
1287
  ...i
1125
1288
  })
1126
1289
  );
1127
- return e.displayName = Fe(a), e;
1290
+ return t.displayName = $t(n), t;
1128
1291
  };
1129
1292
  /**
1130
1293
  * @license lucide-react v0.515.0 - ISC
@@ -1132,328 +1295,328 @@ const Se = (a, t) => {
1132
1295
  * This source code is licensed under the ISC license.
1133
1296
  * See the LICENSE file in the root directory of this source tree.
1134
1297
  */
1135
- const fn = [
1298
+ const Bn = [
1136
1299
  ["path", { d: "M5 12h14", key: "1ays0h" }],
1137
1300
  ["path", { d: "M12 5v14", key: "s699le" }]
1138
- ], Oe = Se("plus", fn);
1301
+ ], Vt = Mt("plus", Bn);
1139
1302
  /**
1140
1303
  * @license lucide-react v0.515.0 - ISC
1141
1304
  *
1142
1305
  * This source code is licensed under the ISC license.
1143
1306
  * See the LICENSE file in the root directory of this source tree.
1144
1307
  */
1145
- const bn = [
1308
+ const kn = [
1146
1309
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
1147
1310
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
1148
- ], pn = Se("search", bn);
1311
+ ], Tn = Mt("search", kn);
1149
1312
  /**
1150
1313
  * @license lucide-react v0.515.0 - ISC
1151
1314
  *
1152
1315
  * This source code is licensed under the ISC license.
1153
1316
  * See the LICENSE file in the root directory of this source tree.
1154
1317
  */
1155
- const _n = [
1318
+ const Rn = [
1156
1319
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
1157
1320
  ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
1158
1321
  ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
1159
1322
  ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
1160
1323
  ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
1161
- ], yn = Se("trash-2", _n), gn = "_backdrop_ta0om_1", wn = "_celebrationOverlay_ta0om_14", vn = "_celebrationChip_ta0om_23", xn = "_backdropOpen_ta0om_74", Cn = "_backdropClosed_ta0om_78", Nn = "_panel_ta0om_82", In = "_panelOpen_ta0om_103", Sn = "_panelClosed_ta0om_107", Bn = "_header_ta0om_146", Tn = "_headerCenter_ta0om_155", kn = "_title_ta0om_163", Rn = "_searchIconButton_ta0om_172", Mn = "_headerTitleWrap_ta0om_195", Ln = "_headerSearchWrap_ta0om_199", Pn = "_headerSearchOpen_ta0om_211", Fn = "_searchBar_ta0om_223", On = "_searchInput_ta0om_235", An = "_searchClearButton_ta0om_256", $n = "_closeButton_ta0om_278", Dn = "_body_ta0om_312", En = "_muted_ta0om_317", qn = "_error_ta0om_322", Vn = "_variants_ta0om_327", zn = "_variantList_ta0om_331", Wn = "_variantRow_ta0om_339", jn = "_variantRowSoldOut_ta0om_347", Un = "_variantLeft_ta0om_351", Hn = "_addToBundleButton_ta0om_358", Qn = "_soldOutContainer_ta0om_386", Gn = "_stockLimitContainer_ta0om_394", Yn = "_soldOut_ta0om_386", Kn = "_stockLimitNotice_ta0om_412", Xn = "_variantThumb_ta0om_421", Jn = "_variantThumbImg_ta0om_431", Zn = "_variantThumbFallback_ta0om_438", tr = "_variantInfo_ta0om_448", er = "_variantName_ta0om_452", nr = "_variantMeta_ta0om_461", rr = "_variantPriceRow_ta0om_469", ar = "_variantCompareAt_ta0om_476", ir = "_variantPrice_ta0om_469", or = "_qtyControls_ta0om_487", sr = "_qtyControlsWrap_ta0om_493", cr = "_qtyButton_ta0om_499", lr = "_qtyValue_ta0om_525", ur = "_footer_ta0om_532", dr = "_poweredBy_ta0om_540", hr = "_boxSummaryWindow_ta0om_552", mr = "_boxSummaryRow_ta0om_570", fr = "_boxSlot_ta0om_578", br = "_boxItem_ta0om_587", pr = "_boxItemClickable_ta0om_599", _r = "_boxThresholdLabel_ta0om_608", yr = "_boxItemPlaceholder_ta0om_619", gr = "_boxItemFilled_ta0om_625", wr = "_boxItemThreshold_ta0om_631", vr = "_boxItemDiscountText_ta0om_639", xr = "_boxItemPlus_ta0om_647", Cr = "_boxItemImage_ta0om_654", Nr = "_boxItemFallback_ta0om_661", Ir = "_ctaButtonGroup_ta0om_672", Sr = "_ctaButtonGroupAnimating_ta0om_679", Br = "_cta_ta0om_672", Tr = "_ctaDualLeft_ta0om_707", kr = "_ctaDualLeftAnimating_ta0om_725", Rr = "_ctaDualRight_ta0om_738", Mr = "_ctaDualRightAnimating_ta0om_754", Lr = "_ctaTotals_ta0om_765", Pr = "_ctaDiscountBadge_ta0om_773", Fr = "_ctaTotalsWrap_ta0om_787", Or = "_ctaTotalsWrapVisible_ta0om_800", Ar = "_ctaTotalsStrike_ta0om_807", $r = "_ctaTotalsPrice_ta0om_814", f = {
1162
- backdrop: gn,
1163
- celebrationOverlay: wn,
1164
- celebrationChip: vn,
1165
- backdropOpen: xn,
1166
- backdropClosed: Cn,
1167
- panel: Nn,
1168
- panelOpen: In,
1169
- panelClosed: Sn,
1170
- header: Bn,
1171
- headerCenter: Tn,
1172
- title: kn,
1173
- searchIconButton: Rn,
1174
- headerTitleWrap: Mn,
1175
- headerSearchWrap: Ln,
1176
- headerSearchOpen: Pn,
1177
- searchBar: Fn,
1178
- searchInput: On,
1179
- searchClearButton: An,
1180
- closeButton: $n,
1181
- body: Dn,
1182
- muted: En,
1183
- error: qn,
1184
- variants: Vn,
1185
- variantList: zn,
1186
- variantRow: Wn,
1187
- variantRowSoldOut: jn,
1188
- variantLeft: Un,
1189
- addToBundleButton: Hn,
1190
- soldOutContainer: Qn,
1191
- stockLimitContainer: Gn,
1192
- soldOut: Yn,
1193
- stockLimitNotice: Kn,
1194
- variantThumb: Xn,
1195
- variantThumbImg: Jn,
1196
- variantThumbFallback: Zn,
1197
- variantInfo: tr,
1198
- variantName: er,
1199
- variantMeta: nr,
1200
- variantPriceRow: rr,
1201
- variantCompareAt: ar,
1202
- variantPrice: ir,
1203
- qtyControls: or,
1204
- qtyControlsWrap: sr,
1205
- qtyButton: cr,
1206
- qtyValue: lr,
1207
- footer: ur,
1208
- poweredBy: dr,
1209
- boxSummaryWindow: hr,
1210
- boxSummaryRow: mr,
1211
- boxSlot: fr,
1212
- boxItem: br,
1213
- boxItemClickable: pr,
1214
- boxThresholdLabel: _r,
1215
- boxItemPlaceholder: yr,
1216
- boxItemFilled: gr,
1217
- boxItemThreshold: wr,
1218
- boxItemDiscountText: vr,
1219
- boxItemPlus: xr,
1220
- boxItemImage: Cr,
1221
- boxItemFallback: Nr,
1222
- ctaButtonGroup: Ir,
1223
- ctaButtonGroupAnimating: Sr,
1224
- cta: Br,
1225
- ctaDualLeft: Tr,
1226
- ctaDualLeftAnimating: kr,
1227
- ctaDualRight: Rr,
1228
- ctaDualRightAnimating: Mr,
1229
- ctaTotals: Lr,
1230
- ctaDiscountBadge: Pr,
1231
- ctaTotalsWrap: Fr,
1232
- ctaTotalsWrapVisible: Or,
1233
- ctaTotalsStrike: Ar,
1234
- ctaTotalsPrice: $r
1324
+ ], Ln = Mt("trash-2", Rn), Mn = "_backdrop_1i4y2_1", Pn = "_celebrationOverlay_1i4y2_14", Fn = "_celebrationChip_1i4y2_23", On = "_backdropOpen_1i4y2_74", An = "_backdropClosed_1i4y2_78", Dn = "_panel_1i4y2_82", En = "_panelOpen_1i4y2_103", qn = "_panelClosed_1i4y2_107", $n = "_header_1i4y2_146", Vn = "_headerCenter_1i4y2_155", zn = "_title_1i4y2_163", Wn = "_searchIconButton_1i4y2_172", jn = "_headerTitleWrap_1i4y2_195", Un = "_headerSearchWrap_1i4y2_199", Hn = "_headerSearchOpen_1i4y2_211", Qn = "_searchBar_1i4y2_223", Gn = "_searchInput_1i4y2_235", Yn = "_searchClearButton_1i4y2_256", Kn = "_closeButton_1i4y2_278", Xn = "_body_1i4y2_312", Zn = "_muted_1i4y2_317", Jn = "_error_1i4y2_322", er = "_variants_1i4y2_327", tr = "_variantList_1i4y2_331", nr = "_variantRow_1i4y2_339", rr = "_variantRowSoldOut_1i4y2_347", ar = "_variantLeft_1i4y2_351", ir = "_addToBundleButton_1i4y2_358", or = "_soldOutContainer_1i4y2_386", sr = "_stockLimitContainer_1i4y2_394", lr = "_soldOut_1i4y2_386", cr = "_stockLimitNotice_1i4y2_412", ur = "_variantThumb_1i4y2_421", dr = "_variantThumbImg_1i4y2_431", hr = "_variantThumbFallback_1i4y2_438", mr = "_variantInfo_1i4y2_448", br = "_variantName_1i4y2_452", fr = "_variantMeta_1i4y2_461", _r = "_variantPriceRow_1i4y2_469", pr = "_variantCompareAt_1i4y2_476", yr = "_variantPrice_1i4y2_469", gr = "_qtyControls_1i4y2_487", vr = "_qtyControlsWrap_1i4y2_493", wr = "_qtyButton_1i4y2_499", xr = "_qtyValue_1i4y2_525", Cr = "_footer_1i4y2_532", Ir = "_poweredBy_1i4y2_540", Nr = "_boxSummaryWindow_1i4y2_552", Sr = "_boxSummaryRow_1i4y2_570", Br = "_boxSlot_1i4y2_578", kr = "_boxItem_1i4y2_587", Tr = "_boxItemClickable_1i4y2_599", Rr = "_boxThresholdLabel_1i4y2_608", Lr = "_boxItemPlaceholder_1i4y2_619", Mr = "_boxItemFilled_1i4y2_625", Pr = "_boxItemThreshold_1i4y2_631", Fr = "_boxItemDiscountText_1i4y2_639", Or = "_boxItemPlus_1i4y2_647", Ar = "_boxItemImage_1i4y2_654", Dr = "_boxItemFallback_1i4y2_661", Er = "_ctaButtonGroup_1i4y2_672", qr = "_ctaButtonGroupAnimating_1i4y2_679", $r = "_cta_1i4y2_672", Vr = "_ctaDualLeft_1i4y2_707", zr = "_ctaDualLeftAnimating_1i4y2_725", Wr = "_ctaDualRight_1i4y2_738", jr = "_ctaDualRightAnimating_1i4y2_754", Ur = "_ctaTotals_1i4y2_765", Hr = "_ctaDiscountBadge_1i4y2_773", Qr = "_ctaTotalsWrap_1i4y2_787", Gr = "_ctaTotalsWrapVisible_1i4y2_800", Yr = "_ctaTotalsStrike_1i4y2_807", Kr = "_ctaTotalsPrice_1i4y2_814", m = {
1325
+ backdrop: Mn,
1326
+ celebrationOverlay: Pn,
1327
+ celebrationChip: Fn,
1328
+ backdropOpen: On,
1329
+ backdropClosed: An,
1330
+ panel: Dn,
1331
+ panelOpen: En,
1332
+ panelClosed: qn,
1333
+ header: $n,
1334
+ headerCenter: Vn,
1335
+ title: zn,
1336
+ searchIconButton: Wn,
1337
+ headerTitleWrap: jn,
1338
+ headerSearchWrap: Un,
1339
+ headerSearchOpen: Hn,
1340
+ searchBar: Qn,
1341
+ searchInput: Gn,
1342
+ searchClearButton: Yn,
1343
+ closeButton: Kn,
1344
+ body: Xn,
1345
+ muted: Zn,
1346
+ error: Jn,
1347
+ variants: er,
1348
+ variantList: tr,
1349
+ variantRow: nr,
1350
+ variantRowSoldOut: rr,
1351
+ variantLeft: ar,
1352
+ addToBundleButton: ir,
1353
+ soldOutContainer: or,
1354
+ stockLimitContainer: sr,
1355
+ soldOut: lr,
1356
+ stockLimitNotice: cr,
1357
+ variantThumb: ur,
1358
+ variantThumbImg: dr,
1359
+ variantThumbFallback: hr,
1360
+ variantInfo: mr,
1361
+ variantName: br,
1362
+ variantMeta: fr,
1363
+ variantPriceRow: _r,
1364
+ variantCompareAt: pr,
1365
+ variantPrice: yr,
1366
+ qtyControls: gr,
1367
+ qtyControlsWrap: vr,
1368
+ qtyButton: wr,
1369
+ qtyValue: xr,
1370
+ footer: Cr,
1371
+ poweredBy: Ir,
1372
+ boxSummaryWindow: Nr,
1373
+ boxSummaryRow: Sr,
1374
+ boxSlot: Br,
1375
+ boxItem: kr,
1376
+ boxItemClickable: Tr,
1377
+ boxThresholdLabel: Rr,
1378
+ boxItemPlaceholder: Lr,
1379
+ boxItemFilled: Mr,
1380
+ boxItemThreshold: Pr,
1381
+ boxItemDiscountText: Fr,
1382
+ boxItemPlus: Or,
1383
+ boxItemImage: Ar,
1384
+ boxItemFallback: Dr,
1385
+ ctaButtonGroup: Er,
1386
+ ctaButtonGroupAnimating: qr,
1387
+ cta: $r,
1388
+ ctaDualLeft: Vr,
1389
+ ctaDualLeftAnimating: zr,
1390
+ ctaDualRight: Wr,
1391
+ ctaDualRightAnimating: jr,
1392
+ ctaTotals: Ur,
1393
+ ctaDiscountBadge: Hr,
1394
+ ctaTotalsWrap: Qr,
1395
+ ctaTotalsWrapVisible: Gr,
1396
+ ctaTotalsStrike: Yr,
1397
+ ctaTotalsPrice: Kr
1235
1398
  };
1236
- function di(a) {
1237
- var ae, ie;
1399
+ function Ii(n) {
1400
+ var Xe, Ze;
1238
1401
  const {
1239
- isOpen: t,
1240
- close: e,
1241
- loading: o,
1402
+ isOpen: e,
1403
+ close: t,
1404
+ loading: a,
1242
1405
  submitting: i,
1243
1406
  error: r,
1244
- currencyCode: m,
1245
- config: d,
1246
- eligibleVariants: S,
1247
- selections: lt,
1248
- selectionOrder: A,
1249
- getVariantMaxSelectableQuantity: O,
1250
- setQuantity: et,
1251
- bundleSize: C,
1252
- minRequired: Y,
1253
- canSubmit: X,
1254
- submit: ot,
1255
- submitAndCheckout: J
1256
- } = be(), [z, yt] = q(!1), [Z, gt] = q(""), $t = V(null), j = V(null), ut = V(null), [U, dt] = q(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Tt, Nt] = q(0), [ht, zt] = q(null), [kt, Ct] = q(!1), It = V(null), Dt = V(C), Rt = 7e3, [Wt, Xt] = q(0), [wt, jt] = q(null), [Mt, Lt] = q(!1), ft = V(null), h = 2800, _ = [
1407
+ currencyCode: h,
1408
+ config: u,
1409
+ eligibleVariants: B,
1410
+ selections: le,
1411
+ selectionOrder: $,
1412
+ getVariantMaxSelectableQuantity: D,
1413
+ setQuantity: de,
1414
+ bundleSize: F,
1415
+ minRequired: te,
1416
+ canSubmit: W,
1417
+ submit: K,
1418
+ submitAndCheckout: g,
1419
+ locale: H,
1420
+ t: I
1421
+ } = wt(), [he, ke] = j(!1), [Te, ye] = j(""), ae = U(null), X = U(null), ie = U(null), [me, Re] = j(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [ne, Ce] = j(0), [be, Ve] = j(null), [ge, Le] = j(!1), Ie = U(null), Ae = U(F), nt = 7e3, [ze, We] = j(0), [Me, Ye] = j(null), [Ne, De] = j(!1), ve = U(null), f = 2800, p = [
1257
1422
  "#2563eb",
1258
1423
  "#3b82f6",
1259
1424
  "#60a5fa",
1260
1425
  "#93c5fd",
1261
1426
  "#bae6fd",
1262
1427
  "#e0f2fe"
1263
- ], w = T(() => {
1264
- var n;
1265
- const l = (n = d == null ? void 0 : d.styleSettings) == null ? void 0 : n.confettiColors;
1266
- return Array.isArray(l) && l.length >= 6 ? l.slice(0, 6).map(
1267
- (s, u) => typeof s == "string" && s.trim() ? s : _[u]
1268
- ) : [..._];
1269
- }, [(ae = d == null ? void 0 : d.styleSettings) == null ? void 0 : ae.confettiColors]), B = (l) => {
1270
- const n = Number.parseFloat(l);
1271
- return Number.isFinite(n) ? String(Math.round(n)) : l;
1272
- }, R = (l) => {
1273
- const n = (l ?? []).filter((s) => {
1274
- var y, g;
1275
- const u = (y = s == null ? void 0 : s.name) == null ? void 0 : y.trim(), p = (g = s == null ? void 0 : s.value) == null ? void 0 : g.trim();
1276
- return !(!u || !p || u.toLowerCase() === "title");
1428
+ ], x = L(() => {
1429
+ var d;
1430
+ const c = (d = u == null ? void 0 : u.styleSettings) == null ? void 0 : d.confettiColors;
1431
+ return Array.isArray(c) && c.length >= 6 ? c.slice(0, 6).map(
1432
+ (v, o) => typeof v == "string" && v.trim() ? v : p[o]
1433
+ ) : [...p];
1434
+ }, [(Xe = u == null ? void 0 : u.styleSettings) == null ? void 0 : Xe.confettiColors]), T = (c) => {
1435
+ const d = Number.parseFloat(c);
1436
+ return Number.isFinite(d) ? String(Math.round(d)) : c;
1437
+ }, M = (c) => {
1438
+ const d = (c ?? []).filter((v) => {
1439
+ var b, w;
1440
+ const o = (b = v == null ? void 0 : v.name) == null ? void 0 : b.trim(), s = (w = v == null ? void 0 : v.value) == null ? void 0 : w.trim();
1441
+ return !(!o || !s || o.toLowerCase() === "title");
1277
1442
  });
1278
- return n.length ? n.map((s) => `${s.name}: ${s.value}`).join(" · ") : null;
1279
- }, E = (l) => {
1280
- var n;
1281
- return ((n = l.product) == null ? void 0 : n.title) ?? l.displayName ?? l.title;
1282
- }, $ = (l) => {
1283
- const n = E(l), s = R(l.selectedOptions);
1284
- return [n, s].filter(Boolean).join(" — ");
1285
- }, [H, M] = q(t), W = V(null), Q = (l) => {
1286
- const n = Number(l);
1287
- if (!Number.isFinite(n)) return l;
1288
- if (m)
1289
- try {
1290
- return new Intl.NumberFormat(void 0, { style: "currency", currency: m }).format(n);
1291
- } catch {
1292
- }
1293
- return `$${n.toFixed(2)}`;
1294
- }, L = ((ie = d == null ? void 0 : d.title) == null ? void 0 : ie.trim()) || "Build your bundle", Ut = T(() => {
1295
- const l = Number((d == null ? void 0 : d.maxBundleSize) ?? NaN), n = Number.isFinite(l) ? Math.floor(l) : 100;
1296
- return Math.max(2, Math.min(100, n));
1297
- }, [d == null ? void 0 : d.maxBundleSize]), mt = C >= Ut, Jt = T(() => [...S].sort((l, n) => l.displayName.localeCompare(n.displayName)), [S]), vt = T(() => {
1298
- const l = Z.trim().toLowerCase();
1299
- if (!l) return Jt;
1300
- const n = l.split(/\s+/).filter(Boolean), s = (u) => {
1301
- var g;
1302
- const p = [];
1303
- p.push(u.displayName), (g = u.product) != null && g.title && p.push(u.product.title);
1304
- for (const x of u.selectedOptions ?? [])
1305
- p.push(x.name), p.push(x.value);
1306
- const y = p.join(" ").toLowerCase();
1307
- return n.every((x) => y.includes(x));
1443
+ return d.length ? d.map((v) => `${v.name}: ${v.value}`).join(" · ") : null;
1444
+ }, E = (c) => {
1445
+ var d;
1446
+ return ((d = c.product) == null ? void 0 : d.title) ?? c.displayName ?? c.title;
1447
+ }, V = (c) => {
1448
+ const d = E(c), v = M(c.selectedOptions);
1449
+ return [d, v].filter(Boolean).join(" — ");
1450
+ }, [Z, ee] = j(e), Q = U(null), A = (c) => {
1451
+ const d = Number(c);
1452
+ return Number.isFinite(d) ? jt(d, h, H) : c;
1453
+ }, q = ((Ze = u == null ? void 0 : u.title) == null ? void 0 : Ze.trim()) || I("bundle.title.default"), Se = L(() => {
1454
+ const c = Number((u == null ? void 0 : u.maxBundleSize) ?? NaN), d = Number.isFinite(c) ? Math.floor(c) : 100;
1455
+ return Math.max(2, Math.min(100, d));
1456
+ }, [u == null ? void 0 : u.maxBundleSize]), Pe = F >= Se, rt = L(() => [...B].sort((c, d) => c.displayName.localeCompare(d.displayName)), [B]), Fe = L(() => {
1457
+ const c = Te.trim().toLowerCase();
1458
+ if (!c) return rt;
1459
+ const d = c.split(/\s+/).filter(Boolean), v = (o) => {
1460
+ var w;
1461
+ const s = [];
1462
+ s.push(o.displayName), (w = o.product) != null && w.title && s.push(o.product.title);
1463
+ for (const y of o.selectedOptions ?? [])
1464
+ s.push(y.name), s.push(y.value);
1465
+ const b = s.join(" ").toLowerCase();
1466
+ return d.every((y) => b.includes(y));
1308
1467
  };
1309
- return Jt.filter(s);
1310
- }, [Z, Jt]), nt = T(() => [...(d == null ? void 0 : d.rules) ?? []].sort((l, n) => l.minBundleSize - n.minBundleSize), [d == null ? void 0 : d.rules]), rt = T(() => Math.max(0, Y - C), [C, Y]), bt = T(() => {
1311
- let l = null;
1312
- for (const n of nt)
1313
- C >= n.minBundleSize && (l = n);
1314
- return l;
1315
- }, [C, nt]), v = T(() => {
1316
- if (!bt) return null;
1317
- const l = Number.parseFloat(bt.discountPercent);
1318
- return !Number.isFinite(l) || l <= 0 ? null : l;
1319
- }, [bt]), xt = nt[0], Pt = !!(xt && C >= xt.minBundleSize), st = T(() => {
1320
- const l = new Map(S.map((s) => [s.id, s]));
1321
- let n = 0;
1322
- for (const [s, u] of Object.entries(lt)) {
1323
- const p = u ?? 0;
1324
- if (p <= 0) continue;
1325
- const y = l.get(s), g = Number(y == null ? void 0 : y.price);
1326
- Number.isFinite(g) && (n += g * p);
1468
+ return rt.filter(v);
1469
+ }, [Te, rt]), re = L(() => [...(u == null ? void 0 : u.rules) ?? []].sort((c, d) => c.minBundleSize - d.minBundleSize), [u == null ? void 0 : u.rules]), z = L(() => Math.max(0, te - F), [F, te]), at = L(() => {
1470
+ let c = null;
1471
+ for (const d of re)
1472
+ F >= d.minBundleSize && (c = d);
1473
+ return c;
1474
+ }, [F, re]), Oe = L(() => {
1475
+ if (!at) return null;
1476
+ const c = Number.parseFloat(at.discountPercent);
1477
+ return !Number.isFinite(c) || c <= 0 ? null : c;
1478
+ }, [at]), we = re[0], N = !!(we && F >= we.minBundleSize), oe = L(() => {
1479
+ const c = new Map(B.map((v) => [v.id, v]));
1480
+ let d = 0;
1481
+ for (const [v, o] of Object.entries(le)) {
1482
+ const s = o ?? 0;
1483
+ if (s <= 0) continue;
1484
+ const b = c.get(v), w = Number(b == null ? void 0 : b.price);
1485
+ Number.isFinite(w) && (d += w * s);
1327
1486
  }
1328
- return Math.round(n * 100) / 100;
1329
- }, [S, lt]), ce = T(() => {
1330
- if (!v) return st;
1331
- const l = st * (1 - v / 100);
1332
- return Math.round(l * 100) / 100;
1333
- }, [v, st]), Ft = T(() => nt.length ? Math.max(...nt.map((l) => l.minBundleSize)) : 0, [nt]), St = T(() => {
1334
- const l = new Map(S.map((n) => [n.id, n]));
1335
- return A.map((n) => l.get(n)).filter((n) => !!n);
1336
- }, [S, A]), Ot = T(() => {
1337
- var n;
1338
- const l = /* @__PURE__ */ new Map();
1339
- for (const s of nt) {
1340
- const u = Math.max(0, s.minBundleSize - 1);
1341
- l.set(u, {
1342
- discountPercent: s.discountPercent,
1343
- minBundleSize: s.minBundleSize,
1344
- label: ((n = s.label) == null ? void 0 : n.trim()) || `Buy ${s.minBundleSize}+`
1487
+ return Math.round(d * 100) / 100;
1488
+ }, [B, le]), je = L(() => {
1489
+ if (!Oe) return oe;
1490
+ const c = oe * (1 - Oe / 100);
1491
+ return Math.round(c * 100) / 100;
1492
+ }, [Oe, oe]), xe = L(() => re.length ? Math.max(...re.map((c) => c.minBundleSize)) : 0, [re]), it = L(() => {
1493
+ const c = new Map(B.map((d) => [d.id, d]));
1494
+ return $.map((d) => c.get(d)).filter((d) => !!d);
1495
+ }, [B, $]), Ue = L(() => {
1496
+ var d;
1497
+ const c = /* @__PURE__ */ new Map();
1498
+ for (const v of re) {
1499
+ const o = Math.max(0, v.minBundleSize - 1);
1500
+ c.set(o, {
1501
+ discountPercent: v.discountPercent,
1502
+ minBundleSize: v.minBundleSize,
1503
+ label: ((d = v.label) == null ? void 0 : d.trim()) || `Buy ${v.minBundleSize}+`
1345
1504
  });
1346
1505
  }
1347
- return l;
1348
- }, [nt]), le = T(() => Math.max(Ft || Y, St.length), [St.length, Ft, Y]), [Et, ee] = q(!0), ne = V(rt);
1349
- F(() => {
1350
- if (((d == null ? void 0 : d.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
1351
- const n = ne.current > 0;
1352
- ee(!(n && rt === 0));
1506
+ return c;
1507
+ }, [re]), He = L(() => Math.max(xe || te, it.length), [it.length, xe, te]), [Be, ut] = j(!0), Ke = U(z);
1508
+ O(() => {
1509
+ if (((u == null ? void 0 : u.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
1510
+ const d = Ke.current > 0;
1511
+ ut(!(d && z === 0));
1353
1512
  }
1354
- ne.current = rt;
1355
- }, [rt, d == null ? void 0 : d.ctaButtonMode]);
1356
- const Bt = V(null), re = V(null), At = V(null), Ht = V(C), Qt = (l) => {
1357
- const n = re.current;
1358
- if (!n) return;
1359
- const s = n.querySelector(`[data-variant-row="${l}"]`);
1360
- if (!s) return;
1361
- const u = n.getBoundingClientRect(), p = s.getBoundingClientRect(), y = 8;
1362
- if (p.top >= u.top + y && p.bottom <= u.bottom - y) return;
1363
- const x = Math.max(0, n.scrollHeight - n.clientHeight), k = p.top - u.top + p.height / 2, D = n.scrollTop + k - n.clientHeight / 2, P = Math.min(x, Math.max(0, D));
1364
- n.scrollTo({ top: P, behavior: "smooth" });
1513
+ Ke.current = z;
1514
+ }, [z, u == null ? void 0 : u.ctaButtonMode]);
1515
+ const ot = U(null), dt = U(null), Ee = U(null), ht = U(F), qe = (c) => {
1516
+ const d = dt.current;
1517
+ if (!d) return;
1518
+ const v = d.querySelector(`[data-variant-row="${c}"]`);
1519
+ if (!v) return;
1520
+ const o = d.getBoundingClientRect(), s = v.getBoundingClientRect(), b = 8;
1521
+ if (s.top >= o.top + b && s.bottom <= o.bottom - b) return;
1522
+ const y = Math.max(0, d.scrollHeight - d.clientHeight), C = s.top - o.top + s.height / 2, k = d.scrollTop + C - d.clientHeight / 2, P = Math.min(y, Math.max(0, k));
1523
+ d.scrollTo({ top: P, behavior: "smooth" });
1365
1524
  };
1366
- return F(() => {
1367
- if (!t) return;
1368
- const l = (n) => {
1369
- n.key === "Escape" && e();
1525
+ return O(() => {
1526
+ if (!e) return;
1527
+ const c = (d) => {
1528
+ d.key === "Escape" && t();
1370
1529
  };
1371
- return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
1372
- }, [e, t]), F(() => {
1530
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
1531
+ }, [t, e]), O(() => {
1373
1532
  if (typeof window > "u") return;
1374
- const l = () => dt({ width: window.innerWidth, height: window.innerHeight });
1375
- return l(), window.addEventListener("resize", l), () => window.removeEventListener("resize", l);
1376
- }, []), F(() => {
1377
- if (W.current != null && (window.clearTimeout(W.current), W.current = null), t) {
1378
- M(!0);
1533
+ const c = () => Re({ width: window.innerWidth, height: window.innerHeight });
1534
+ return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
1535
+ }, []), O(() => {
1536
+ if (Q.current != null && (window.clearTimeout(Q.current), Q.current = null), e) {
1537
+ ee(!0);
1379
1538
  return;
1380
1539
  }
1381
- W.current = window.setTimeout(() => {
1382
- M(!1), W.current = null;
1540
+ Q.current = window.setTimeout(() => {
1541
+ ee(!1), Q.current = null;
1383
1542
  }, 220);
1384
- }, [t]), F(() => () => {
1385
- W.current != null && window.clearTimeout(W.current);
1386
- }, []), F(() => () => {
1387
- It.current != null && window.clearTimeout(It.current);
1388
- }, []), F(() => () => {
1389
- ft.current != null && window.clearTimeout(ft.current);
1390
- }, []), F(() => {
1391
- if (!t || !z) return;
1392
- const l = requestAnimationFrame(() => {
1393
- var n;
1394
- return (n = $t.current) == null ? void 0 : n.focus();
1543
+ }, [e]), O(() => () => {
1544
+ Q.current != null && window.clearTimeout(Q.current);
1545
+ }, []), O(() => () => {
1546
+ Ie.current != null && window.clearTimeout(Ie.current);
1547
+ }, []), O(() => () => {
1548
+ ve.current != null && window.clearTimeout(ve.current);
1549
+ }, []), O(() => {
1550
+ if (!e || !he) return;
1551
+ const c = requestAnimationFrame(() => {
1552
+ var d;
1553
+ return (d = ae.current) == null ? void 0 : d.focus();
1395
1554
  });
1396
- return () => cancelAnimationFrame(l);
1397
- }, [t, z]), F(() => {
1398
- const l = Ht.current;
1399
- if (Ht.current = C, C <= l) return;
1400
- const n = At.current;
1401
- if (!n) return;
1402
- const s = nt.some((g) => g.minBundleSize === C), u = nt.find((g) => g.minBundleSize > C), p = u && s ? u.minBundleSize - 1 : u ? null : C - 1;
1403
- if (p == null || p < 0) return;
1404
- const y = requestAnimationFrame(() => {
1405
- const g = n.querySelector(`[data-box-slot="${p}"]`);
1406
- if (!g) return;
1407
- const x = n.getBoundingClientRect(), D = g.getBoundingClientRect().right - x.right;
1408
- if (D <= 1) return;
1409
- const P = Math.max(0, n.scrollWidth - n.clientWidth), G = Math.min(P, Math.max(0, n.scrollLeft + D));
1410
- n.scrollTo({ left: G, behavior: "smooth" });
1555
+ return () => cancelAnimationFrame(c);
1556
+ }, [e, he]), O(() => {
1557
+ const c = ht.current;
1558
+ if (ht.current = F, F <= c) return;
1559
+ const d = Ee.current;
1560
+ if (!d) return;
1561
+ const v = re.some((w) => w.minBundleSize === F), o = re.find((w) => w.minBundleSize > F), s = o && v ? o.minBundleSize - 1 : o ? null : F - 1;
1562
+ if (s == null || s < 0) return;
1563
+ const b = requestAnimationFrame(() => {
1564
+ const w = d.querySelector(`[data-box-slot="${s}"]`);
1565
+ if (!w) return;
1566
+ const y = d.getBoundingClientRect(), k = w.getBoundingClientRect().right - y.right;
1567
+ if (k <= 1) return;
1568
+ const P = Math.max(0, d.scrollWidth - d.clientWidth), G = Math.min(P, Math.max(0, d.scrollLeft + k));
1569
+ d.scrollTo({ left: G, behavior: "smooth" });
1411
1570
  });
1412
- return () => cancelAnimationFrame(y);
1413
- }, [C, nt]), F(() => {
1414
- if (!t) return;
1415
- const l = Dt.current;
1416
- if (Dt.current = C, C <= l) return;
1417
- const n = nt.find((s) => s.minBundleSize === C);
1418
- n && (jt(`You received a ${B(n.discountPercent)}% discount!`), Xt((s) => s + 1), Lt(!0), ft.current != null && window.clearTimeout(ft.current), ft.current = window.setTimeout(() => {
1419
- Lt(!1), ft.current = null;
1420
- }, h));
1421
- }, [C, t, nt]), F(() => {
1422
- if (!t || !Mt || !wt) return;
1423
- const l = requestAnimationFrame(() => {
1424
- var x;
1425
- const n = ut.current, s = n == null ? void 0 : n.getBoundingClientRect(), u = (x = Bt.current) == null ? void 0 : x.getBoundingClientRect(), p = s ? s.left + s.width / 2 : u ? u.left + u.width / 2 : window.innerWidth / 2, y = s ? s.top + s.height / 2 : u ? u.top + u.height / 2 : window.innerHeight / 2, g = {
1426
- x: p - 2,
1427
- y: y - 2,
1571
+ return () => cancelAnimationFrame(b);
1572
+ }, [F, re]), O(() => {
1573
+ if (!e) return;
1574
+ const c = Ae.current;
1575
+ if (Ae.current = F, F <= c) return;
1576
+ const d = re.find((v) => v.minBundleSize === F);
1577
+ d && (Ye(
1578
+ I("bundle.celebration.received_discount", {
1579
+ discount: T(d.discountPercent)
1580
+ })
1581
+ ), We((v) => v + 1), De(!0), ve.current != null && window.clearTimeout(ve.current), ve.current = window.setTimeout(() => {
1582
+ De(!1), ve.current = null;
1583
+ }, f));
1584
+ }, [F, e, re]), O(() => {
1585
+ if (!e || !Ne || !Me) return;
1586
+ const c = requestAnimationFrame(() => {
1587
+ var y;
1588
+ const d = ie.current, v = d == null ? void 0 : d.getBoundingClientRect(), o = (y = ot.current) == null ? void 0 : y.getBoundingClientRect(), s = v ? v.left + v.width / 2 : o ? o.left + o.width / 2 : window.innerWidth / 2, b = v ? v.top + v.height / 2 : o ? o.top + o.height / 2 : window.innerHeight / 2, w = {
1589
+ x: s - 2,
1590
+ y: b - 2,
1428
1591
  w: 4,
1429
1592
  h: 4
1430
1593
  };
1431
- zt(g), Nt((k) => k + 1), Ct(!0), It.current != null && window.clearTimeout(It.current), It.current = window.setTimeout(() => {
1432
- Ct(!1), It.current = null;
1433
- }, Rt);
1594
+ Ve(w), Ce((C) => C + 1), Le(!0), Ie.current != null && window.clearTimeout(Ie.current), Ie.current = window.setTimeout(() => {
1595
+ Le(!1), Ie.current = null;
1596
+ }, nt);
1434
1597
  });
1435
- return () => cancelAnimationFrame(l);
1436
- }, [Wt, wt, Rt, Mt, t]), F(() => {
1437
- var l;
1438
- t && ((l = Bt.current) == null || l.focus());
1439
- }, [t]), H ? /* @__PURE__ */ I(
1598
+ return () => cancelAnimationFrame(c);
1599
+ }, [ze, Me, nt, Ne, e]), O(() => {
1600
+ var c;
1601
+ e && ((c = ot.current) == null || c.focus());
1602
+ }, [e]), Z ? /* @__PURE__ */ R(
1440
1603
  "div",
1441
1604
  {
1442
1605
  role: "dialog",
1443
1606
  "aria-modal": "true",
1444
- "aria-label": "Bundle builder",
1445
- className: [f.backdrop, t ? f.backdropOpen : f.backdropClosed, a.className].filter(Boolean).join(" "),
1446
- onMouseDown: (l) => {
1447
- l.target === l.currentTarget && e();
1607
+ "aria-label": I("bundle.drawer.aria"),
1608
+ className: [m.backdrop, e ? m.backdropOpen : m.backdropClosed, n.className].filter(Boolean).join(" "),
1609
+ onMouseDown: (c) => {
1610
+ c.target === c.currentTarget && t();
1448
1611
  },
1449
1612
  children: [
1450
- kt && ht && U.width > 0 && U.height > 0 ? /* @__PURE__ */ c(
1451
- cn,
1613
+ ge && be && me.width > 0 && me.height > 0 ? /* @__PURE__ */ l(
1614
+ wn,
1452
1615
  {
1453
- width: U.width,
1454
- height: U.height,
1455
- confettiSource: ht,
1456
- colors: w,
1616
+ width: me.width,
1617
+ height: me.height,
1618
+ confettiSource: be,
1619
+ colors: x,
1457
1620
  recycle: !1,
1458
1621
  numberOfPieces: 70,
1459
1622
  tweenDuration: 100,
@@ -1462,224 +1625,218 @@ function di(a) {
1462
1625
  initialVelocityX: { min: -6, max: 6 },
1463
1626
  style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
1464
1627
  },
1465
- Tt
1628
+ ne
1466
1629
  ) : null,
1467
- /* @__PURE__ */ I("aside", { ref: Bt, className: [f.panel, t ? f.panelOpen : f.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1468
- Mt && wt ? /* @__PURE__ */ c("div", { className: f.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ c("div", { ref: ut, className: f.celebrationChip, children: wt }, Wt) }) : null,
1469
- /* @__PURE__ */ I("header", { className: [f.header, z ? f.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1470
- /* @__PURE__ */ c(
1630
+ /* @__PURE__ */ R("aside", { ref: ot, className: [m.panel, e ? m.panelOpen : m.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1631
+ Ne && Me ? /* @__PURE__ */ l("div", { className: m.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ l("div", { ref: ie, className: m.celebrationChip, children: Me }, ze) }) : null,
1632
+ /* @__PURE__ */ R("header", { className: [m.header, he ? m.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1633
+ /* @__PURE__ */ l(
1471
1634
  "button",
1472
1635
  {
1473
1636
  type: "button",
1474
- className: f.searchIconButton,
1475
- "aria-label": z ? "Search (expanded)" : "Search",
1476
- "aria-expanded": z,
1637
+ className: m.searchIconButton,
1638
+ "aria-label": I(he ? "bundle.search.expanded" : "bundle.search"),
1639
+ "aria-expanded": he,
1477
1640
  onClick: () => {
1478
- yt(!0);
1641
+ ke(!0);
1479
1642
  },
1480
- children: /* @__PURE__ */ c(pn, { size: 18, "aria-hidden": "true" })
1643
+ children: /* @__PURE__ */ l(Tn, { size: 18, "aria-hidden": "true" })
1481
1644
  }
1482
1645
  ),
1483
- /* @__PURE__ */ I("div", { className: f.headerCenter, children: [
1484
- /* @__PURE__ */ c("div", { className: f.headerTitleWrap, "aria-hidden": z, children: /* @__PURE__ */ c("h2", { className: f.title, children: L }) }),
1485
- /* @__PURE__ */ c("div", { className: f.headerSearchWrap, "aria-hidden": !z, children: /* @__PURE__ */ I("div", { className: f.searchBar, children: [
1486
- /* @__PURE__ */ c(
1646
+ /* @__PURE__ */ R("div", { className: m.headerCenter, children: [
1647
+ /* @__PURE__ */ l("div", { className: m.headerTitleWrap, "aria-hidden": he, children: /* @__PURE__ */ l("h2", { className: m.title, children: q }) }),
1648
+ /* @__PURE__ */ l("div", { className: m.headerSearchWrap, "aria-hidden": !he, children: /* @__PURE__ */ R("div", { className: m.searchBar, children: [
1649
+ /* @__PURE__ */ l(
1487
1650
  "input",
1488
1651
  {
1489
- ref: $t,
1490
- className: f.searchInput,
1652
+ ref: ae,
1653
+ className: m.searchInput,
1491
1654
  type: "search",
1492
- value: Z,
1493
- placeholder: "Search",
1494
- onChange: (l) => gt(l.target.value),
1655
+ value: Te,
1656
+ placeholder: I("bundle.search.placeholder"),
1657
+ onChange: (c) => ye(c.target.value),
1495
1658
  onBlur: () => {
1496
- Z.trim() === "" && yt(!1);
1659
+ Te.trim() === "" && ke(!1);
1497
1660
  }
1498
1661
  }
1499
1662
  ),
1500
- Z.trim() ? /* @__PURE__ */ c(
1663
+ Te.trim() ? /* @__PURE__ */ l(
1501
1664
  "button",
1502
1665
  {
1503
1666
  type: "button",
1504
- className: f.searchClearButton,
1505
- onMouseDown: (l) => {
1506
- l.preventDefault();
1667
+ className: m.searchClearButton,
1668
+ onMouseDown: (c) => {
1669
+ c.preventDefault();
1507
1670
  },
1508
1671
  onClick: () => {
1509
- var l;
1510
- gt(""), (l = $t.current) == null || l.focus();
1672
+ var c;
1673
+ ye(""), (c = ae.current) == null || c.focus();
1511
1674
  },
1512
- "aria-label": "Clear search",
1513
- children: "Clear"
1675
+ "aria-label": I("bundle.search.clear"),
1676
+ children: I("bundle.search.clear")
1514
1677
  }
1515
1678
  ) : null
1516
1679
  ] }) })
1517
1680
  ] }),
1518
- /* @__PURE__ */ c("button", { type: "button", onClick: e, disabled: i, className: f.closeButton, "aria-label": "Close", children: "×" })
1681
+ /* @__PURE__ */ l("button", { type: "button", onClick: t, disabled: i, className: m.closeButton, "aria-label": I("bundle.close"), children: "×" })
1519
1682
  ] }),
1520
- /* @__PURE__ */ I("div", { className: f.body, ref: re, children: [
1521
- o ? /* @__PURE__ */ c("p", { className: f.muted, children: "Loading…" }) : null,
1522
- r ? /* @__PURE__ */ c("p", { className: f.error, children: r }) : null,
1523
- /* @__PURE__ */ c("div", { className: f.variants, children: /* @__PURE__ */ c("ul", { className: f.variantList, children: vt.map((l) => {
1524
- var Gt, Yt, it, tt;
1525
- const n = lt[l.id] ?? 0, s = E(l), u = R(l.selectedOptions), p = $(l), y = O(l.id), g = y ?? Number.POSITIVE_INFINITY, x = n >= g, k = l.availableForSale !== !1 && !mt && !x, D = l.availableForSale === !1 ? null : x ? "Max Reached" : null, P = v, G = Number(l.price), at = P != null && Number.isFinite(P) && P > 0 && Number.isFinite(G), pt = at ? Math.round(G * (1 - P / 100) * 100) / 100 : null;
1526
- return /* @__PURE__ */ I(
1683
+ /* @__PURE__ */ R("div", { className: m.body, ref: dt, children: [
1684
+ a ? /* @__PURE__ */ l("p", { className: m.muted, children: I("bundle.loading") }) : null,
1685
+ r ? /* @__PURE__ */ l("p", { className: m.error, children: r }) : null,
1686
+ /* @__PURE__ */ l("div", { className: m.variants, children: /* @__PURE__ */ l("ul", { className: m.variantList, children: Fe.map((c) => {
1687
+ var fe, $e, Je, et;
1688
+ const d = le[c.id] ?? 0, v = E(c), o = M(c.selectedOptions), s = V(c), b = D(c.id), w = b ?? Number.POSITIVE_INFINITY, y = d >= w, C = c.availableForSale !== !1 && !Pe && !y, k = c.availableForSale === !1 ? null : y ? I("bundle.stock.max_reached") : null, P = Oe, G = Number(c.price), Y = P != null && Number.isFinite(P) && P > 0 && Number.isFinite(G), ce = Y ? Math.round(G * (1 - P / 100) * 100) / 100 : null;
1689
+ return /* @__PURE__ */ R(
1527
1690
  "li",
1528
1691
  {
1529
- className: [f.variantRow, l.availableForSale === !1 && f.variantRowSoldOut].filter(Boolean).join(" "),
1530
- "data-variant-row": l.id,
1692
+ className: [m.variantRow, c.availableForSale === !1 && m.variantRowSoldOut].filter(Boolean).join(" "),
1693
+ "data-variant-row": c.id,
1531
1694
  children: [
1532
- /* @__PURE__ */ I("div", { className: f.variantLeft, children: [
1533
- /* @__PURE__ */ c("div", { className: f.variantThumb, "aria-hidden": "true", children: (Gt = l.image) != null && Gt.url ? /* @__PURE__ */ c(
1695
+ /* @__PURE__ */ R("div", { className: m.variantLeft, children: [
1696
+ /* @__PURE__ */ l("div", { className: m.variantThumb, "aria-hidden": "true", children: (fe = c.image) != null && fe.url ? /* @__PURE__ */ l(
1534
1697
  "img",
1535
1698
  {
1536
- className: f.variantThumbImg,
1537
- src: l.image.url,
1538
- alt: l.image.altText ?? p,
1699
+ className: m.variantThumbImg,
1700
+ src: c.image.url,
1701
+ alt: c.image.altText ?? s,
1539
1702
  loading: "lazy"
1540
1703
  }
1541
- ) : /* @__PURE__ */ c("div", { className: f.variantThumbFallback, children: ((tt = (it = (Yt = l.product) == null ? void 0 : Yt.title) == null ? void 0 : it.slice(0, 1)) == null ? void 0 : tt.toUpperCase()) ?? "•" }) }),
1542
- /* @__PURE__ */ I("div", { className: f.variantInfo, children: [
1543
- /* @__PURE__ */ c("div", { className: f.variantName, children: s }),
1544
- u ? /* @__PURE__ */ c("div", { className: f.variantMeta, children: u }) : null,
1545
- /* @__PURE__ */ I("div", { className: f.variantPriceRow, children: [
1546
- at ? /* @__PURE__ */ c("span", { className: f.variantCompareAt, children: Q(Number.isFinite(G) ? G.toFixed(2) : l.price) }) : null,
1547
- /* @__PURE__ */ c("span", { className: f.variantPrice, children: Q(
1548
- pt != null ? pt.toFixed(2) : Number.isFinite(G) ? G.toFixed(2) : l.price
1704
+ ) : /* @__PURE__ */ l("div", { className: m.variantThumbFallback, children: ((et = (Je = ($e = c.product) == null ? void 0 : $e.title) == null ? void 0 : Je.slice(0, 1)) == null ? void 0 : et.toUpperCase()) ?? "•" }) }),
1705
+ /* @__PURE__ */ R("div", { className: m.variantInfo, children: [
1706
+ /* @__PURE__ */ l("div", { className: m.variantName, children: v }),
1707
+ o ? /* @__PURE__ */ l("div", { className: m.variantMeta, children: o }) : null,
1708
+ /* @__PURE__ */ R("div", { className: m.variantPriceRow, children: [
1709
+ Y ? /* @__PURE__ */ l("span", { className: m.variantCompareAt, children: A(Number.isFinite(G) ? G.toFixed(2) : c.price) }) : null,
1710
+ /* @__PURE__ */ l("span", { className: m.variantPrice, children: A(
1711
+ ce != null ? ce.toFixed(2) : Number.isFinite(G) ? G.toFixed(2) : c.price
1549
1712
  ) })
1550
1713
  ] })
1551
1714
  ] })
1552
1715
  ] }),
1553
- l.availableForSale === !1 ? /* @__PURE__ */ c("div", { className: f.soldOutContainer, children: /* @__PURE__ */ I("span", { className: f.soldOut, "aria-label": `${p} is sold out`, children: [
1554
- "Sold",
1555
- /* @__PURE__ */ c("br", {}),
1556
- "Out"
1557
- ] }) }) : n <= 0 && g <= 0 ? /* @__PURE__ */ c("div", { className: f.stockLimitContainer, children: /* @__PURE__ */ c("span", { className: f.stockLimitNotice, "aria-label": `${p} max available selected`, children: "Max Added To Cart" }) }) : n <= 0 ? /* @__PURE__ */ c(
1716
+ c.availableForSale === !1 ? /* @__PURE__ */ l("div", { className: m.soldOutContainer, children: /* @__PURE__ */ l("span", { className: m.soldOut, "aria-label": I("bundle.a11y.sold_out", { name: s }), children: I("bundle.stock.sold_out") }) }) : d <= 0 && w <= 0 ? /* @__PURE__ */ l("div", { className: m.stockLimitContainer, children: /* @__PURE__ */ l("span", { className: m.stockLimitNotice, "aria-label": I("bundle.a11y.max_available_selected", { name: s }), children: I("bundle.stock.max_added") }) }) : d <= 0 ? /* @__PURE__ */ l(
1558
1717
  "button",
1559
1718
  {
1560
1719
  type: "button",
1561
- onClick: () => et(l.id, 1),
1562
- disabled: i || !k,
1563
- className: f.addToBundleButton,
1564
- "aria-label": D ? `${p} ${D.toLowerCase()}` : `Add ${p} to bundle`,
1565
- children: "Add"
1720
+ onClick: () => de(c.id, 1),
1721
+ disabled: i || !C,
1722
+ className: m.addToBundleButton,
1723
+ "aria-label": k ? `${s} ${k.toLowerCase()}` : I("bundle.a11y.add_to_bundle", { name: s }),
1724
+ children: I("bundle.cta.add_to_bundle")
1566
1725
  }
1567
- ) : /* @__PURE__ */ I("div", { className: f.qtyControlsWrap, children: [
1568
- /* @__PURE__ */ I("div", { className: f.qtyControls, children: [
1569
- /* @__PURE__ */ c(
1726
+ ) : /* @__PURE__ */ R("div", { className: m.qtyControlsWrap, children: [
1727
+ /* @__PURE__ */ R("div", { className: m.qtyControls, children: [
1728
+ /* @__PURE__ */ l(
1570
1729
  "button",
1571
1730
  {
1572
1731
  type: "button",
1573
- onClick: () => et(l.id, n - 1),
1574
- disabled: i || n <= 0,
1575
- className: f.qtyButton,
1576
- "aria-label": `Decrease ${p}`,
1732
+ onClick: () => de(c.id, d - 1),
1733
+ disabled: i || d <= 0,
1734
+ className: m.qtyButton,
1735
+ "aria-label": I("bundle.a11y.decrease", { name: s }),
1577
1736
  children: "−"
1578
1737
  }
1579
1738
  ),
1580
- /* @__PURE__ */ c("span", { className: f.qtyValue, "aria-label": `Quantity ${n}`, children: n }),
1581
- /* @__PURE__ */ c(
1739
+ /* @__PURE__ */ l("span", { className: m.qtyValue, "aria-label": I("bundle.a11y.quantity", { name: s, qty: d }), children: d }),
1740
+ /* @__PURE__ */ l(
1582
1741
  "button",
1583
1742
  {
1584
1743
  type: "button",
1585
- onClick: () => et(l.id, n + 1),
1586
- disabled: i || !k,
1587
- className: f.qtyButton,
1588
- "aria-label": D ? `${p} ${D.toLowerCase()}` : `Increase ${p}`,
1744
+ onClick: () => de(c.id, d + 1),
1745
+ disabled: i || !C,
1746
+ className: m.qtyButton,
1747
+ "aria-label": k ? `${s} ${k.toLowerCase()}` : I("bundle.a11y.increase", { name: s }),
1589
1748
  children: "+"
1590
1749
  }
1591
1750
  )
1592
1751
  ] }),
1593
- D ? /* @__PURE__ */ c("div", { className: f.stockLimitNotice, children: D }) : null
1752
+ k ? /* @__PURE__ */ l("div", { className: m.stockLimitNotice, children: k }) : null
1594
1753
  ] })
1595
1754
  ]
1596
1755
  },
1597
- l.id
1756
+ c.id
1598
1757
  );
1599
1758
  }) }) })
1600
1759
  ] }),
1601
- /* @__PURE__ */ I("footer", { className: f.footer, ref: j, children: [
1602
- /* @__PURE__ */ c("div", { className: f.boxSummaryWindow, ref: At, children: /* @__PURE__ */ c("div", { className: f.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: le }).map((l, n) => {
1603
- var D, P, G, at;
1604
- const s = St[n], u = Ot.get(n), p = !!s, y = !!u, g = y && !p, x = u ? `${u.discountPercent}% off` : null, k = p ? s.displayName : `Slot ${n + 1}`;
1605
- return /* @__PURE__ */ I("div", { "data-box-slot": n, className: f.boxSlot, children: [
1606
- /* @__PURE__ */ c(
1760
+ /* @__PURE__ */ R("footer", { className: m.footer, ref: X, children: [
1761
+ /* @__PURE__ */ l("div", { className: m.boxSummaryWindow, ref: Ee, children: /* @__PURE__ */ l("div", { className: m.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: He }).map((c, d) => {
1762
+ var k, P, G, Y;
1763
+ const v = it[d], o = Ue.get(d), s = !!v, b = !!o, w = b && !s, y = o ? I("bundle.discount.off_label", { discount: T(o.discountPercent) }) : null, C = s ? v.displayName : I("bundle.slot", { slot: d + 1 });
1764
+ return /* @__PURE__ */ R("div", { "data-box-slot": d, className: m.boxSlot, children: [
1765
+ /* @__PURE__ */ l(
1607
1766
  "div",
1608
1767
  {
1609
1768
  className: [
1610
- f.boxItem,
1611
- p ? f.boxItemFilled : f.boxItemPlaceholder,
1612
- y ? f.boxItemThreshold : null,
1613
- p ? f.boxItemClickable : null
1769
+ m.boxItem,
1770
+ s ? m.boxItemFilled : m.boxItemPlaceholder,
1771
+ b ? m.boxItemThreshold : null,
1772
+ s ? m.boxItemClickable : null
1614
1773
  ].filter(Boolean).join(" "),
1615
- role: p ? "button" : void 0,
1616
- tabIndex: p ? 0 : void 0,
1617
- onClick: p ? () => Qt(s.id) : void 0,
1618
- onKeyDown: p ? (pt) => {
1619
- (pt.key === "Enter" || pt.key === " ") && (pt.preventDefault(), Qt(s.id));
1774
+ role: s ? "button" : void 0,
1775
+ tabIndex: s ? 0 : void 0,
1776
+ onClick: s ? () => qe(v.id) : void 0,
1777
+ onKeyDown: s ? (ce) => {
1778
+ (ce.key === "Enter" || ce.key === " ") && (ce.preventDefault(), qe(v.id));
1620
1779
  } : void 0,
1621
- "aria-label": g && x ? `${k}. Unlocks ${x}.` : k,
1622
- title: g && x ? `${k} • Unlocks ${x}` : k,
1623
- children: p ? (D = s.image) != null && D.url ? /* @__PURE__ */ c(
1780
+ "aria-label": w && y ? `${C}. ${I("bundle.unlocks", { discount: y })}.` : C,
1781
+ title: w && y ? `${C} • ${I("bundle.unlocks", { discount: y })}` : C,
1782
+ children: s ? (k = v.image) != null && k.url ? /* @__PURE__ */ l(
1624
1783
  "img",
1625
1784
  {
1626
- className: f.boxItemImage,
1627
- src: s.image.url,
1628
- alt: s.image.altText ?? s.displayName,
1785
+ className: m.boxItemImage,
1786
+ src: v.image.url,
1787
+ alt: v.image.altText ?? v.displayName,
1629
1788
  loading: "lazy"
1630
1789
  }
1631
- ) : /* @__PURE__ */ c("div", { className: f.boxItemFallback, "aria-hidden": "true", children: ((at = (G = (P = s.product) == null ? void 0 : P.title) == null ? void 0 : G.slice(0, 1)) == null ? void 0 : at.toUpperCase()) ?? "•" }) : g && x ? /* @__PURE__ */ c("div", { className: f.boxItemDiscountText, children: x }) : /* @__PURE__ */ c("div", { className: f.boxItemPlus, "aria-hidden": "true", children: "+" })
1790
+ ) : /* @__PURE__ */ l("div", { className: m.boxItemFallback, "aria-hidden": "true", children: ((Y = (G = (P = v.product) == null ? void 0 : P.title) == null ? void 0 : G.slice(0, 1)) == null ? void 0 : Y.toUpperCase()) ?? "•" }) : w && y ? /* @__PURE__ */ l("div", { className: m.boxItemDiscountText, children: y }) : /* @__PURE__ */ l("div", { className: m.boxItemPlus, "aria-hidden": "true", children: "+" })
1632
1791
  }
1633
1792
  ),
1634
- y ? /* @__PURE__ */ c("div", { className: f.boxThresholdLabel, children: u.label }) : null
1635
- ] }, n);
1793
+ b ? /* @__PURE__ */ l("div", { className: m.boxThresholdLabel, children: o.label }) : null
1794
+ ] }, d);
1636
1795
  }) }) }),
1637
- /* @__PURE__ */ c(
1796
+ /* @__PURE__ */ l(
1638
1797
  "div",
1639
1798
  {
1640
- className: [f.ctaTotalsWrap, Pt ? f.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1641
- "aria-hidden": !Pt,
1642
- children: /* @__PURE__ */ I("div", { className: f.ctaTotals, "aria-label": "Totals", children: [
1643
- v ? /* @__PURE__ */ I("span", { className: f.ctaDiscountBadge, children: [
1644
- v,
1645
- "% Discount"
1646
- ] }) : /* @__PURE__ */ c("span", {}),
1647
- /* @__PURE__ */ c("span", { children: v ? /* @__PURE__ */ I(xe, { children: [
1648
- /* @__PURE__ */ c("span", { className: f.ctaTotalsStrike, children: Q(st.toFixed(2)) }),
1799
+ className: [m.ctaTotalsWrap, N ? m.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1800
+ "aria-hidden": !N,
1801
+ children: /* @__PURE__ */ R("div", { className: m.ctaTotals, "aria-label": I("bundle.totals"), children: [
1802
+ Oe ? /* @__PURE__ */ l("span", { className: m.ctaDiscountBadge, children: I("bundle.discount.badge", { discount: Oe }) }) : /* @__PURE__ */ l("span", {}),
1803
+ /* @__PURE__ */ l("span", { children: Oe ? /* @__PURE__ */ R(kt, { children: [
1804
+ /* @__PURE__ */ l("span", { className: m.ctaTotalsStrike, children: A(oe.toFixed(2)) }),
1649
1805
  " ",
1650
- /* @__PURE__ */ c("span", { className: f.ctaTotalsPrice, children: Q(ce.toFixed(2)) })
1651
- ] }) : /* @__PURE__ */ c("span", { className: f.ctaTotalsPrice, children: Q(st.toFixed(2)) }) })
1806
+ /* @__PURE__ */ l("span", { className: m.ctaTotalsPrice, children: A(je.toFixed(2)) })
1807
+ ] }) : /* @__PURE__ */ l("span", { className: m.ctaTotalsPrice, children: A(oe.toFixed(2)) }) })
1652
1808
  ] })
1653
1809
  }
1654
1810
  ),
1655
1811
  (() => {
1656
- const l = (d == null ? void 0 : d.ctaButtonMode) || "add_to_cart";
1657
- return l === "add_to_cart_checkout" ? rt > 0 ? /* @__PURE__ */ c("button", { type: "button", onClick: ot, disabled: !X, className: f.cta, children: i ? "Adding…" : `Add ${rt} more product${rt === 1 ? "" : "s"}` }) : /* @__PURE__ */ I("div", { className: `${f.ctaButtonGroup} ${Et ? f.ctaButtonGroupAnimating : ""}`, children: [
1658
- /* @__PURE__ */ c(
1812
+ const c = (u == null ? void 0 : u.ctaButtonMode) || "add_to_cart";
1813
+ return c === "add_to_cart_checkout" ? z > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: K, disabled: !W, className: m.cta, children: i ? I("bundle.cta.adding") : I("bundle.cta.add_more", { count: z, productWord: ct(H, z) }) }) : /* @__PURE__ */ R("div", { className: `${m.ctaButtonGroup} ${Be ? m.ctaButtonGroupAnimating : ""}`, children: [
1814
+ /* @__PURE__ */ l(
1659
1815
  "button",
1660
1816
  {
1661
1817
  type: "button",
1662
- onClick: ot,
1663
- disabled: !X,
1664
- className: `${f.ctaDualLeft} ${Et ? f.ctaDualLeftAnimating : ""}`,
1665
- children: /* @__PURE__ */ c("span", { children: i ? "Adding…" : "Add to Basket" })
1818
+ onClick: K,
1819
+ disabled: !W,
1820
+ className: `${m.ctaDualLeft} ${Be ? m.ctaDualLeftAnimating : ""}`,
1821
+ children: /* @__PURE__ */ l("span", { children: I(i ? "bundle.cta.adding" : "bundle.cta.add_to_basket") })
1666
1822
  }
1667
1823
  ),
1668
- /* @__PURE__ */ c(
1824
+ /* @__PURE__ */ l(
1669
1825
  "button",
1670
1826
  {
1671
1827
  type: "button",
1672
- onClick: J,
1673
- disabled: !X,
1674
- className: `${f.ctaDualRight} ${Et ? f.ctaDualRightAnimating : ""}`,
1675
- children: /* @__PURE__ */ c("span", { children: i ? "Processing…" : "Checkout" })
1828
+ onClick: g,
1829
+ disabled: !W,
1830
+ className: `${m.ctaDualRight} ${Be ? m.ctaDualRightAnimating : ""}`,
1831
+ children: /* @__PURE__ */ l("span", { children: I(i ? "bundle.cta.processing" : "bundle.cta.checkout") })
1676
1832
  }
1677
1833
  )
1678
- ] }) : l === "checkout" ? /* @__PURE__ */ c("button", { type: "button", onClick: J, disabled: !X, className: f.cta, children: i ? "Processing…" : rt > 0 ? `Add ${rt} more product${rt === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ c("button", { type: "button", onClick: ot, disabled: !X, className: f.cta, children: i ? "Adding…" : rt > 0 ? `Add ${rt} more product${rt === 1 ? "" : "s"}` : "Add to Basket" });
1834
+ ] }) : c === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: g, disabled: !W, className: m.cta, children: i ? I("bundle.cta.processing") : z > 0 ? I("bundle.cta.add_more", { count: z, productWord: ct(H, z) }) : I("bundle.cta.checkout") }) : /* @__PURE__ */ l("button", { type: "button", onClick: K, disabled: !W, className: m.cta, children: i ? I("bundle.cta.adding") : z > 0 ? I("bundle.cta.add_more", { count: z, productWord: ct(H, z) }) : I("bundle.cta.add_to_basket") });
1679
1835
  })(),
1680
- /* @__PURE__ */ I("div", { className: f.poweredBy, children: [
1681
- "powered by ",
1682
- /* @__PURE__ */ c("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
1836
+ /* @__PURE__ */ R("div", { className: m.poweredBy, children: [
1837
+ I("bundle.powered_by"),
1838
+ " ",
1839
+ /* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
1683
1840
  ] })
1684
1841
  ] })
1685
1842
  ] })
@@ -1687,433 +1844,426 @@ function di(a) {
1687
1844
  }
1688
1845
  ) : null;
1689
1846
  }
1690
- const Dr = "_panel_96rr4_2", Er = "_header_96rr4_20", qr = "_title_96rr4_24", Vr = "_status_96rr4_32", zr = "_error_96rr4_37", Wr = "_inactive_96rr4_43", jr = "_section_96rr4_49", Ur = "_sectionTitle_96rr4_54", Hr = "_rulesVisual_96rr4_107", Qr = "_rulesLabelsRow_96rr4_114", Gr = "_rulesLinesRow_96rr4_121", Yr = "_rulesLineLabelCell_96rr4_128", Kr = "_rulesLineLabel_96rr4_128", Xr = "_rulesLine_96rr4_121", Jr = "_rulesLineEmpty_96rr4_162", Zr = "_rulesLineFilled_96rr4_166", ta = "_variants_96rr4_170", ea = "_variantList_96rr4_178", na = "_variantRow_96rr4_186", ra = "_variantRowInteractive_96rr4_198", aa = "_variantRowSelected_96rr4_202", ia = "_variantRowSoldOut_96rr4_207", oa = "_variantMedia_96rr4_211", sa = "_variantContent_96rr4_219", ca = "_variantHeader_96rr4_227", la = "_variantTitle_96rr4_233", ua = "_variantImage_96rr4_247", da = "_variantImageFallback_96rr4_255", ha = "_variantMeta_96rr4_268", ma = "_variantPrice_96rr4_273", fa = "_variantFooterRow_96rr4_279", ba = "_variantActions_96rr4_286", pa = "_qtyActions_96rr4_292", _a = "_qtyActionsWrap_96rr4_298", ya = "_soldOut_96rr4_349", ga = "_stockLimitNotice_96rr4_357", wa = "_qtyChip_96rr4_366", va = "_qtyChipInteractive_96rr4_381", xa = "_qtyChipValue_96rr4_385", Ca = "_qtyChipPlus_96rr4_391", Na = "_qtyChipClear_96rr4_396", Ia = "_qtyTrash_96rr4_425", Sa = "_footer_96rr4_437", Ba = "_boxSummaryWindow_96rr4_442", Ta = "_boxSummaryRow_96rr4_456", ka = "_boxSlot_96rr4_464", Ra = "_boxItem_96rr4_473", Ma = "_boxItemFilled_96rr4_490", La = "_boxItemPlaceholder_96rr4_496", Pa = "_boxItemThreshold_96rr4_502", Fa = "_boxItemClickable_96rr4_510", Oa = "_boxItemImage_96rr4_519", Aa = "_boxItemFallback_96rr4_530", $a = "_boxItemPlus_96rr4_543", Da = "_boxItemDiscountText_96rr4_555", Ea = "_boxThresholdLabel_96rr4_568", qa = "_totalsReveal_96rr4_579", Va = "_totalsRevealOpen_96rr4_587", za = "_ctaTotalsWrap_96rr4_592", Wa = "_ctaTotalsWrapVisible_96rr4_597", ja = "_ctaTotals_96rr4_592", Ua = "_ctaDiscountBadge_96rr4_612", Ha = "_ctaTotalsStrike_96rr4_623", Qa = "_ctaTotalsPrice_96rr4_629", Ga = "_cta_96rr4_592", Ya = "_ctaButtonGroup_96rr4_661", Ka = "_ctaDualLeft_96rr4_667", Xa = "_ctaDualRight_96rr4_668", Ja = "_poweredBy_96rr4_695", b = {
1691
- panel: Dr,
1692
- header: Er,
1693
- title: qr,
1694
- status: Vr,
1695
- error: zr,
1696
- inactive: Wr,
1697
- section: jr,
1698
- sectionTitle: Ur,
1699
- rulesVisual: Hr,
1700
- rulesLabelsRow: Qr,
1701
- rulesLinesRow: Gr,
1702
- rulesLineLabelCell: Yr,
1703
- rulesLineLabel: Kr,
1704
- rulesLine: Xr,
1705
- rulesLineEmpty: Jr,
1706
- rulesLineFilled: Zr,
1707
- variants: ta,
1708
- variantList: ea,
1709
- variantRow: na,
1710
- variantRowInteractive: ra,
1711
- variantRowSelected: aa,
1712
- variantRowSoldOut: ia,
1713
- variantMedia: oa,
1714
- variantContent: sa,
1715
- variantHeader: ca,
1716
- variantTitle: la,
1717
- variantImage: ua,
1718
- variantImageFallback: da,
1719
- variantMeta: ha,
1720
- variantPrice: ma,
1721
- variantFooterRow: fa,
1722
- variantActions: ba,
1723
- qtyActions: pa,
1724
- qtyActionsWrap: _a,
1725
- soldOut: ya,
1726
- stockLimitNotice: ga,
1727
- qtyChip: wa,
1728
- qtyChipInteractive: va,
1729
- qtyChipValue: xa,
1730
- qtyChipPlus: Ca,
1731
- qtyChipClear: Na,
1732
- qtyTrash: Ia,
1733
- footer: Sa,
1734
- boxSummaryWindow: Ba,
1735
- boxSummaryRow: Ta,
1736
- boxSlot: ka,
1737
- boxItem: Ra,
1738
- boxItemFilled: Ma,
1739
- boxItemPlaceholder: La,
1740
- boxItemThreshold: Pa,
1741
- boxItemClickable: Fa,
1742
- boxItemImage: Oa,
1743
- boxItemFallback: Aa,
1744
- boxItemPlus: $a,
1745
- boxItemDiscountText: Da,
1746
- boxThresholdLabel: Ea,
1747
- totalsReveal: qa,
1748
- totalsRevealOpen: Va,
1749
- ctaTotalsWrap: za,
1750
- ctaTotalsWrapVisible: Wa,
1751
- ctaTotals: ja,
1752
- ctaDiscountBadge: Ua,
1753
- ctaTotalsStrike: Ha,
1754
- ctaTotalsPrice: Qa,
1755
- cta: Ga,
1756
- ctaButtonGroup: Ya,
1757
- ctaDualLeft: Ka,
1758
- ctaDualRight: Xa,
1759
- poweredBy: Ja
1847
+ const Xr = "_panel_96rr4_2", Zr = "_header_96rr4_20", Jr = "_title_96rr4_24", ea = "_status_96rr4_32", ta = "_error_96rr4_37", na = "_inactive_96rr4_43", ra = "_section_96rr4_49", aa = "_sectionTitle_96rr4_54", ia = "_rulesVisual_96rr4_107", oa = "_rulesLabelsRow_96rr4_114", sa = "_rulesLinesRow_96rr4_121", la = "_rulesLineLabelCell_96rr4_128", ca = "_rulesLineLabel_96rr4_128", ua = "_rulesLine_96rr4_121", da = "_rulesLineEmpty_96rr4_162", ha = "_rulesLineFilled_96rr4_166", ma = "_variants_96rr4_170", ba = "_variantList_96rr4_178", fa = "_variantRow_96rr4_186", _a = "_variantRowInteractive_96rr4_198", pa = "_variantRowSelected_96rr4_202", ya = "_variantRowSoldOut_96rr4_207", ga = "_variantMedia_96rr4_211", va = "_variantContent_96rr4_219", wa = "_variantHeader_96rr4_227", xa = "_variantTitle_96rr4_233", Ca = "_variantImage_96rr4_247", Ia = "_variantImageFallback_96rr4_255", Na = "_variantMeta_96rr4_268", Sa = "_variantPrice_96rr4_273", Ba = "_variantFooterRow_96rr4_279", ka = "_variantActions_96rr4_286", Ta = "_qtyActions_96rr4_292", Ra = "_qtyActionsWrap_96rr4_298", La = "_soldOut_96rr4_349", Ma = "_stockLimitNotice_96rr4_357", Pa = "_qtyChip_96rr4_366", Fa = "_qtyChipInteractive_96rr4_381", Oa = "_qtyChipValue_96rr4_385", Aa = "_qtyChipPlus_96rr4_391", Da = "_qtyChipClear_96rr4_396", Ea = "_qtyTrash_96rr4_425", qa = "_footer_96rr4_437", $a = "_boxSummaryWindow_96rr4_442", Va = "_boxSummaryRow_96rr4_456", za = "_boxSlot_96rr4_464", Wa = "_boxItem_96rr4_473", ja = "_boxItemFilled_96rr4_490", Ua = "_boxItemPlaceholder_96rr4_496", Ha = "_boxItemThreshold_96rr4_502", Qa = "_boxItemClickable_96rr4_510", Ga = "_boxItemImage_96rr4_519", Ya = "_boxItemFallback_96rr4_530", Ka = "_boxItemPlus_96rr4_543", Xa = "_boxItemDiscountText_96rr4_555", Za = "_boxThresholdLabel_96rr4_568", Ja = "_totalsReveal_96rr4_579", ei = "_totalsRevealOpen_96rr4_587", ti = "_ctaTotalsWrap_96rr4_592", ni = "_ctaTotalsWrapVisible_96rr4_597", ri = "_ctaTotals_96rr4_592", ai = "_ctaDiscountBadge_96rr4_612", ii = "_ctaTotalsStrike_96rr4_623", oi = "_ctaTotalsPrice_96rr4_629", si = "_cta_96rr4_592", li = "_ctaButtonGroup_96rr4_661", ci = "_ctaDualLeft_96rr4_667", ui = "_ctaDualRight_96rr4_668", di = "_poweredBy_96rr4_695", _ = {
1848
+ panel: Xr,
1849
+ header: Zr,
1850
+ title: Jr,
1851
+ status: ea,
1852
+ error: ta,
1853
+ inactive: na,
1854
+ section: ra,
1855
+ sectionTitle: aa,
1856
+ rulesVisual: ia,
1857
+ rulesLabelsRow: oa,
1858
+ rulesLinesRow: sa,
1859
+ rulesLineLabelCell: la,
1860
+ rulesLineLabel: ca,
1861
+ rulesLine: ua,
1862
+ rulesLineEmpty: da,
1863
+ rulesLineFilled: ha,
1864
+ variants: ma,
1865
+ variantList: ba,
1866
+ variantRow: fa,
1867
+ variantRowInteractive: _a,
1868
+ variantRowSelected: pa,
1869
+ variantRowSoldOut: ya,
1870
+ variantMedia: ga,
1871
+ variantContent: va,
1872
+ variantHeader: wa,
1873
+ variantTitle: xa,
1874
+ variantImage: Ca,
1875
+ variantImageFallback: Ia,
1876
+ variantMeta: Na,
1877
+ variantPrice: Sa,
1878
+ variantFooterRow: Ba,
1879
+ variantActions: ka,
1880
+ qtyActions: Ta,
1881
+ qtyActionsWrap: Ra,
1882
+ soldOut: La,
1883
+ stockLimitNotice: Ma,
1884
+ qtyChip: Pa,
1885
+ qtyChipInteractive: Fa,
1886
+ qtyChipValue: Oa,
1887
+ qtyChipPlus: Aa,
1888
+ qtyChipClear: Da,
1889
+ qtyTrash: Ea,
1890
+ footer: qa,
1891
+ boxSummaryWindow: $a,
1892
+ boxSummaryRow: Va,
1893
+ boxSlot: za,
1894
+ boxItem: Wa,
1895
+ boxItemFilled: ja,
1896
+ boxItemPlaceholder: Ua,
1897
+ boxItemThreshold: Ha,
1898
+ boxItemClickable: Qa,
1899
+ boxItemImage: Ga,
1900
+ boxItemFallback: Ya,
1901
+ boxItemPlus: Ka,
1902
+ boxItemDiscountText: Xa,
1903
+ boxThresholdLabel: Za,
1904
+ totalsReveal: Ja,
1905
+ totalsRevealOpen: ei,
1906
+ ctaTotalsWrap: ti,
1907
+ ctaTotalsWrapVisible: ni,
1908
+ ctaTotals: ri,
1909
+ ctaDiscountBadge: ai,
1910
+ ctaTotalsStrike: ii,
1911
+ ctaTotalsPrice: oi,
1912
+ cta: si,
1913
+ ctaButtonGroup: li,
1914
+ ctaDualLeft: ci,
1915
+ ctaDualRight: ui,
1916
+ poweredBy: di
1760
1917
  };
1761
- function hi(a) {
1762
- var ft;
1918
+ function Ni(n) {
1919
+ var ve;
1763
1920
  const {
1764
- loading: t,
1765
- submitting: e,
1766
- error: o,
1921
+ loading: e,
1922
+ submitting: t,
1923
+ error: a,
1767
1924
  currencyCode: i,
1768
1925
  config: r,
1769
- eligibleVariants: m,
1770
- selections: d,
1771
- selectionOrder: S,
1772
- getVariantMaxSelectableQuantity: lt,
1773
- setQuantity: A,
1774
- bundleSize: O,
1775
- minRequired: et,
1776
- canSubmit: C,
1777
- submit: Y,
1778
- submitAndCheckout: X
1779
- } = be(), {
1780
- className: ot,
1781
- showRules: J = !0,
1782
- showVariants: z = !0
1783
- } = a, yt = (h) => {
1784
- const _ = Number.parseFloat(h);
1785
- return Number.isFinite(_) ? String(Math.round(_)) : h;
1786
- }, Z = (h) => {
1787
- const _ = (h ?? []).filter((w) => {
1788
- var E, $;
1789
- const B = (E = w == null ? void 0 : w.name) == null ? void 0 : E.trim(), R = ($ = w == null ? void 0 : w.value) == null ? void 0 : $.trim();
1790
- return !(!B || !R || B.toLowerCase() === "title");
1926
+ eligibleVariants: h,
1927
+ selections: u,
1928
+ selectionOrder: B,
1929
+ getVariantMaxSelectableQuantity: le,
1930
+ setQuantity: $,
1931
+ bundleSize: D,
1932
+ minRequired: de,
1933
+ canSubmit: F,
1934
+ submit: te,
1935
+ submitAndCheckout: W,
1936
+ locale: K,
1937
+ t: g
1938
+ } = wt(), {
1939
+ className: H,
1940
+ showRules: I = !0,
1941
+ showVariants: he = !0
1942
+ } = n, ke = (f) => {
1943
+ const p = Number.parseFloat(f);
1944
+ return Number.isFinite(p) ? String(Math.round(p)) : f;
1945
+ }, Te = (f) => {
1946
+ const p = (f ?? []).filter((x) => {
1947
+ var E, V;
1948
+ const T = (E = x == null ? void 0 : x.name) == null ? void 0 : E.trim(), M = (V = x == null ? void 0 : x.value) == null ? void 0 : V.trim();
1949
+ return !(!T || !M || T.toLowerCase() === "title");
1791
1950
  });
1792
- return _.length ? _.map((w) => `${w.name}: ${w.value}`).join(" • ") : null;
1793
- }, gt = (h) => {
1794
- const _ = Number(h);
1795
- if (!Number.isFinite(_)) return h;
1796
- if (i)
1797
- try {
1798
- return new Intl.NumberFormat(void 0, { style: "currency", currency: i }).format(_);
1799
- } catch {
1800
- }
1801
- return `$${_.toFixed(2)}`;
1802
- }, $t = T(() => [...m].sort((h, _) => h.displayName.localeCompare(_.displayName)), [m]), j = T(() => [...(r == null ? void 0 : r.rules) ?? []].sort((h, _) => h.minBundleSize - _.minBundleSize), [r == null ? void 0 : r.rules]), ut = T(() => Math.max(0, et - O), [O, et]), U = T(() => {
1803
- let h = null;
1804
- for (const _ of j)
1805
- O >= _.minBundleSize && (h = _);
1806
- return h;
1807
- }, [O, j]), dt = T(() => {
1808
- if (!U) return null;
1809
- const h = Number.parseFloat(U.discountPercent);
1810
- return !Number.isFinite(h) || h <= 0 ? null : h;
1811
- }, [U]), Tt = j[0], Nt = !!(Tt && O >= Tt.minBundleSize), ht = T(() => {
1812
- const h = new Map(m.map((w) => [w.id, w]));
1813
- let _ = 0;
1814
- for (const [w, B] of Object.entries(d)) {
1815
- const R = B ?? 0;
1816
- if (R <= 0) continue;
1817
- const E = h.get(w), $ = Number(E == null ? void 0 : E.price);
1818
- Number.isFinite($) && (_ += $ * R);
1951
+ return p.length ? p.map((x) => `${x.name}: ${x.value}`).join(" • ") : null;
1952
+ }, ye = (f) => {
1953
+ const p = Number(f);
1954
+ return Number.isFinite(p) ? jt(p, i, K) : f;
1955
+ }, ae = L(() => [...h].sort((f, p) => f.displayName.localeCompare(p.displayName)), [h]), X = L(() => [...(r == null ? void 0 : r.rules) ?? []].sort((f, p) => f.minBundleSize - p.minBundleSize), [r == null ? void 0 : r.rules]), ie = L(() => Math.max(0, de - D), [D, de]), me = L(() => {
1956
+ let f = null;
1957
+ for (const p of X)
1958
+ D >= p.minBundleSize && (f = p);
1959
+ return f;
1960
+ }, [D, X]), Re = L(() => {
1961
+ if (!me) return null;
1962
+ const f = Number.parseFloat(me.discountPercent);
1963
+ return !Number.isFinite(f) || f <= 0 ? null : f;
1964
+ }, [me]), ne = X[0], Ce = !!(ne && D >= ne.minBundleSize), be = L(() => {
1965
+ const f = new Map(h.map((x) => [x.id, x]));
1966
+ let p = 0;
1967
+ for (const [x, T] of Object.entries(u)) {
1968
+ const M = T ?? 0;
1969
+ if (M <= 0) continue;
1970
+ const E = f.get(x), V = Number(E == null ? void 0 : E.price);
1971
+ Number.isFinite(V) && (p += V * M);
1819
1972
  }
1820
- return Math.round(_ * 100) / 100;
1821
- }, [m, d]), zt = T(() => {
1822
- if (!dt) return ht;
1823
- const h = ht * (1 - dt / 100);
1824
- return Math.round(h * 100) / 100;
1825
- }, [dt, ht]), kt = T(() => j.length ? Math.max(...j.map((h) => h.minBundleSize)) : 0, [j]), Ct = T(() => {
1826
- const h = new Map(m.map((_) => [_.id, _]));
1827
- return S.map((_) => h.get(_)).filter((_) => !!_);
1828
- }, [m, S]), It = T(() => {
1829
- var _;
1830
- const h = /* @__PURE__ */ new Map();
1831
- for (const w of j) {
1832
- const B = Math.max(0, w.minBundleSize - 1);
1833
- h.set(B, {
1834
- discountPercent: w.discountPercent,
1835
- minBundleSize: w.minBundleSize,
1836
- label: ((_ = w.label) == null ? void 0 : _.trim()) || `Buy ${w.minBundleSize}+`
1973
+ return Math.round(p * 100) / 100;
1974
+ }, [h, u]), Ve = L(() => {
1975
+ if (!Re) return be;
1976
+ const f = be * (1 - Re / 100);
1977
+ return Math.round(f * 100) / 100;
1978
+ }, [Re, be]), ge = L(() => X.length ? Math.max(...X.map((f) => f.minBundleSize)) : 0, [X]), Le = L(() => {
1979
+ const f = new Map(h.map((p) => [p.id, p]));
1980
+ return B.map((p) => f.get(p)).filter((p) => !!p);
1981
+ }, [h, B]), Ie = L(() => {
1982
+ var p;
1983
+ const f = /* @__PURE__ */ new Map();
1984
+ for (const x of X) {
1985
+ const T = Math.max(0, x.minBundleSize - 1);
1986
+ f.set(T, {
1987
+ discountPercent: x.discountPercent,
1988
+ minBundleSize: x.minBundleSize,
1989
+ label: ((p = x.label) == null ? void 0 : p.trim()) || `Buy ${x.minBundleSize}+`
1837
1990
  });
1838
1991
  }
1839
- return h;
1840
- }, [j]), Dt = T(() => {
1841
- const h = Number((r == null ? void 0 : r.maxBundleSize) ?? NaN), _ = Number.isFinite(h) ? Math.floor(h) : 100;
1842
- return Math.max(2, Math.min(100, _));
1843
- }, [r == null ? void 0 : r.maxBundleSize]), Rt = ((ft = r == null ? void 0 : r.title) == null ? void 0 : ft.trim()) || "Build your bundle", Wt = T(() => Math.max(kt || et, Ct.length), [Ct.length, kt, et]), Xt = O >= Dt, wt = V(null), jt = V(null), Mt = V(O);
1844
- F(() => {
1845
- const h = Mt.current;
1846
- if (Mt.current = O, O <= h) return;
1847
- const _ = jt.current;
1848
- if (!_) return;
1849
- const w = j.some(($) => $.minBundleSize === O), B = j.find(($) => $.minBundleSize > O), R = B && w ? B.minBundleSize - 1 : B ? null : O - 1;
1850
- if (R == null || R < 0) return;
1992
+ return f;
1993
+ }, [X]), Ae = L(() => {
1994
+ const f = Number((r == null ? void 0 : r.maxBundleSize) ?? NaN), p = Number.isFinite(f) ? Math.floor(f) : 100;
1995
+ return Math.max(2, Math.min(100, p));
1996
+ }, [r == null ? void 0 : r.maxBundleSize]), nt = ((ve = r == null ? void 0 : r.title) == null ? void 0 : ve.trim()) || g("bundle.title.default"), ze = L(() => Math.max(ge || de, Le.length), [Le.length, ge, de]), We = D >= Ae, Me = U(null), Ye = U(null), Ne = U(D);
1997
+ O(() => {
1998
+ const f = Ne.current;
1999
+ if (Ne.current = D, D <= f) return;
2000
+ const p = Ye.current;
2001
+ if (!p) return;
2002
+ const x = X.some((V) => V.minBundleSize === D), T = X.find((V) => V.minBundleSize > D), M = T && x ? T.minBundleSize - 1 : T ? null : D - 1;
2003
+ if (M == null || M < 0) return;
1851
2004
  const E = requestAnimationFrame(() => {
1852
- const $ = _.querySelector(`[data-box-slot="${R}"]`);
1853
- if (!$) return;
1854
- const H = _.getBoundingClientRect(), W = $.getBoundingClientRect().right - H.right;
1855
- if (W <= 1) return;
1856
- const Q = Math.max(0, _.scrollWidth - _.clientWidth), L = Math.min(Q, Math.max(0, _.scrollLeft + W));
1857
- _.scrollTo({ left: L, behavior: "smooth" });
2005
+ const V = p.querySelector(`[data-box-slot="${M}"]`);
2006
+ if (!V) return;
2007
+ const Z = p.getBoundingClientRect(), Q = V.getBoundingClientRect().right - Z.right;
2008
+ if (Q <= 1) return;
2009
+ const A = Math.max(0, p.scrollWidth - p.clientWidth), q = Math.min(A, Math.max(0, p.scrollLeft + Q));
2010
+ p.scrollTo({ left: q, behavior: "smooth" });
1858
2011
  });
1859
2012
  return () => cancelAnimationFrame(E);
1860
- }, [O, j]);
1861
- const Lt = (h) => {
1862
- const _ = wt.current;
1863
- if (!_) return;
1864
- const w = _.querySelector(`[data-variant-row="${h}"]`);
1865
- w && w.scrollIntoView({ behavior: "smooth", block: "nearest" });
2013
+ }, [D, X]);
2014
+ const De = (f) => {
2015
+ const p = Me.current;
2016
+ if (!p) return;
2017
+ const x = p.querySelector(`[data-variant-row="${f}"]`);
2018
+ x && x.scrollIntoView({ behavior: "smooth", block: "nearest" });
1866
2019
  };
1867
- return /* @__PURE__ */ I("section", { className: [b.panel, ot].filter(Boolean).join(" "), "aria-busy": t, children: [
1868
- /* @__PURE__ */ c("header", { className: b.header, children: /* @__PURE__ */ c("h2", { className: b.title, children: Rt }) }),
1869
- t ? /* @__PURE__ */ c("div", { className: b.status, children: "Loading…" }) : null,
1870
- o ? /* @__PURE__ */ c("div", { className: b.error, children: o }) : null,
1871
- !t && r && !r.isActive ? /* @__PURE__ */ c("div", { className: b.inactive, children: "Bundles are not active." }) : null,
1872
- J && j.length ? /* @__PURE__ */ c("div", { className: b.section, children: /* @__PURE__ */ I("div", { className: b.rulesVisual, children: [
1873
- /* @__PURE__ */ c("div", { className: b.rulesLabelsRow, children: Array.from({ length: kt }).map((h, _) => {
1874
- const w = _ + 1, B = j.find((E) => E.minBundleSize === w), R = B ? `${yt(B.discountPercent)}% off` : null;
1875
- return /* @__PURE__ */ c("div", { className: b.rulesLineLabelCell, children: R ? /* @__PURE__ */ c("span", { className: b.rulesLineLabel, children: R }) : null }, w);
2020
+ return /* @__PURE__ */ R("section", { className: [_.panel, H].filter(Boolean).join(" "), "aria-busy": e, children: [
2021
+ /* @__PURE__ */ l("header", { className: _.header, children: /* @__PURE__ */ l("h2", { className: _.title, children: nt }) }),
2022
+ e ? /* @__PURE__ */ l("div", { className: _.status, children: g("bundle.loading") }) : null,
2023
+ a ? /* @__PURE__ */ l("div", { className: _.error, children: a }) : null,
2024
+ !e && r && !r.isActive ? /* @__PURE__ */ l("div", { className: _.inactive, children: g("bundle.inactive") }) : null,
2025
+ I && X.length ? /* @__PURE__ */ l("div", { className: _.section, children: /* @__PURE__ */ R("div", { className: _.rulesVisual, children: [
2026
+ /* @__PURE__ */ l("div", { className: _.rulesLabelsRow, children: Array.from({ length: ge }).map((f, p) => {
2027
+ const x = p + 1, T = X.find((E) => E.minBundleSize === x), M = T ? g("bundle.discount.off_label", { discount: ke(T.discountPercent) }) : null;
2028
+ return /* @__PURE__ */ l("div", { className: _.rulesLineLabelCell, children: M ? /* @__PURE__ */ l("span", { className: _.rulesLineLabel, children: M }) : null }, x);
1876
2029
  }) }),
1877
- /* @__PURE__ */ c("div", { className: b.rulesLinesRow, children: Array.from({ length: kt }).map((h, _) => {
1878
- const w = _ + 1, B = O >= w;
1879
- return /* @__PURE__ */ c(
2030
+ /* @__PURE__ */ l("div", { className: _.rulesLinesRow, children: Array.from({ length: ge }).map((f, p) => {
2031
+ const x = p + 1, T = D >= x;
2032
+ return /* @__PURE__ */ l(
1880
2033
  "div",
1881
2034
  {
1882
2035
  className: [
1883
- b.rulesLine,
1884
- B ? b.rulesLineFilled : b.rulesLineEmpty
2036
+ _.rulesLine,
2037
+ T ? _.rulesLineFilled : _.rulesLineEmpty
1885
2038
  ].filter(Boolean).join(" ")
1886
2039
  },
1887
- w
2040
+ x
1888
2041
  );
1889
2042
  }) })
1890
2043
  ] }) }) : null,
1891
- z ? /* @__PURE__ */ I("div", { className: b.section, ref: wt, children: [
1892
- /* @__PURE__ */ c("div", { className: b.sectionTitle, children: "Select items" }),
1893
- /* @__PURE__ */ c("div", { className: b.variants, children: /* @__PURE__ */ c("ul", { className: b.variantList, children: $t.map((h) => {
1894
- var Q;
1895
- const _ = d[h.id] ?? 0, w = Z(h.selectedOptions), B = h.availableForSale === !1, R = lt(h.id), E = R ?? Number.POSITIVE_INFINITY, $ = _ >= E, H = !B && !Xt && !$, M = H, W = !B && $ ? "Max Reached" : null;
1896
- return /* @__PURE__ */ I(
2044
+ he ? /* @__PURE__ */ R("div", { className: _.section, ref: Me, children: [
2045
+ /* @__PURE__ */ l("div", { className: _.sectionTitle, children: g("bundle.select.items") }),
2046
+ /* @__PURE__ */ l("div", { className: _.variants, children: /* @__PURE__ */ l("ul", { className: _.variantList, children: ae.map((f) => {
2047
+ var A;
2048
+ const p = u[f.id] ?? 0, x = Te(f.selectedOptions), T = f.availableForSale === !1, M = le(f.id), E = M ?? Number.POSITIVE_INFINITY, V = p >= E, Z = !T && !We && !V, ee = Z, Q = !T && V ? g("bundle.stock.max_reached") : null;
2049
+ return /* @__PURE__ */ R(
1897
2050
  "li",
1898
2051
  {
1899
2052
  className: [
1900
- b.variantRow,
1901
- M ? b.variantRowInteractive : null,
1902
- _ > 0 ? b.variantRowSelected : null,
1903
- B ? b.variantRowSoldOut : null
2053
+ _.variantRow,
2054
+ ee ? _.variantRowInteractive : null,
2055
+ p > 0 ? _.variantRowSelected : null,
2056
+ T ? _.variantRowSoldOut : null
1904
2057
  ].filter(Boolean).join(" "),
1905
- "data-variant-row": h.id,
1906
- role: M ? "button" : void 0,
1907
- tabIndex: M ? 0 : void 0,
1908
- onClick: M ? () => {
1909
- A(h.id, _ + 1);
2058
+ "data-variant-row": f.id,
2059
+ role: ee ? "button" : void 0,
2060
+ tabIndex: ee ? 0 : void 0,
2061
+ onClick: ee ? () => {
2062
+ $(f.id, p + 1);
1910
2063
  } : void 0,
1911
- onKeyDown: M ? (L) => {
1912
- (L.key === "Enter" || L.key === " ") && (L.preventDefault(), A(h.id, _ + 1), Lt(h.id));
2064
+ onKeyDown: ee ? (q) => {
2065
+ (q.key === "Enter" || q.key === " ") && (q.preventDefault(), $(f.id, p + 1), De(f.id));
1913
2066
  } : void 0,
1914
- "aria-label": B ? `${h.displayName} is sold out` : W ? `${h.displayName} ${W.toLowerCase()}` : `Add ${h.displayName} to bundle`,
2067
+ "aria-label": T ? g("bundle.a11y.sold_out", { name: f.displayName }) : Q ? `${f.displayName} ${Q.toLowerCase()}` : g("bundle.a11y.add_to_bundle", { name: f.displayName }),
1915
2068
  children: [
1916
- /* @__PURE__ */ c("div", { className: b.variantMedia, children: (Q = h.image) != null && Q.url ? /* @__PURE__ */ c(
2069
+ /* @__PURE__ */ l("div", { className: _.variantMedia, children: (A = f.image) != null && A.url ? /* @__PURE__ */ l(
1917
2070
  "img",
1918
2071
  {
1919
- src: h.image.url,
1920
- alt: h.image.altText ?? h.displayName,
1921
- width: h.image.width ?? 64,
1922
- height: h.image.height ?? 64,
1923
- className: b.variantImage,
2072
+ src: f.image.url,
2073
+ alt: f.image.altText ?? f.displayName,
2074
+ width: f.image.width ?? 64,
2075
+ height: f.image.height ?? 64,
2076
+ className: _.variantImage,
1924
2077
  loading: "lazy"
1925
2078
  }
1926
- ) : /* @__PURE__ */ c("div", { className: b.variantImageFallback, children: "Item" }) }),
1927
- /* @__PURE__ */ I("div", { className: b.variantContent, children: [
1928
- /* @__PURE__ */ I("div", { className: b.variantHeader, children: [
1929
- /* @__PURE__ */ c("div", { className: b.variantTitle, children: h.displayName }),
1930
- w ? /* @__PURE__ */ c("div", { className: b.variantMeta, children: w }) : null
2079
+ ) : /* @__PURE__ */ l("div", { className: _.variantImageFallback, children: g("bundle.item.generic") }) }),
2080
+ /* @__PURE__ */ R("div", { className: _.variantContent, children: [
2081
+ /* @__PURE__ */ R("div", { className: _.variantHeader, children: [
2082
+ /* @__PURE__ */ l("div", { className: _.variantTitle, children: f.displayName }),
2083
+ x ? /* @__PURE__ */ l("div", { className: _.variantMeta, children: x }) : null
1931
2084
  ] }),
1932
- /* @__PURE__ */ I("div", { className: b.variantFooterRow, children: [
1933
- /* @__PURE__ */ c("div", { className: b.variantPrice, children: gt(h.price) }),
1934
- /* @__PURE__ */ c("div", { className: b.variantActions, children: B ? /* @__PURE__ */ c("div", { className: b.soldOut, "aria-label": `${h.displayName} is sold out`, children: "Sold Out" }) : _ <= 0 && E <= 0 ? /* @__PURE__ */ c("div", { className: b.stockLimitNotice, "aria-label": `${h.displayName} max available selected`, children: "Max Added To Cart" }) : /* @__PURE__ */ I("div", { className: b.qtyActionsWrap, children: [
1935
- /* @__PURE__ */ I("div", { className: b.qtyActions, children: [
1936
- _ > 0 ? /* @__PURE__ */ c(
2085
+ /* @__PURE__ */ R("div", { className: _.variantFooterRow, children: [
2086
+ /* @__PURE__ */ l("div", { className: _.variantPrice, children: ye(f.price) }),
2087
+ /* @__PURE__ */ l("div", { className: _.variantActions, children: T ? /* @__PURE__ */ l("div", { className: _.soldOut, "aria-label": g("bundle.a11y.sold_out", { name: f.displayName }), children: g("bundle.stock.sold_out") }) : p <= 0 && E <= 0 ? /* @__PURE__ */ l("div", { className: _.stockLimitNotice, "aria-label": g("bundle.a11y.max_available_selected", { name: f.displayName }), children: g("bundle.stock.max_added") }) : /* @__PURE__ */ R("div", { className: _.qtyActionsWrap, children: [
2088
+ /* @__PURE__ */ R("div", { className: _.qtyActions, children: [
2089
+ p > 0 ? /* @__PURE__ */ l(
1937
2090
  "button",
1938
2091
  {
1939
2092
  type: "button",
1940
- className: b.qtyTrash,
1941
- "aria-label": `Remove ${h.displayName} from bundle`,
1942
- onClick: (L) => {
1943
- L.stopPropagation(), A(h.id, 0);
2093
+ className: _.qtyTrash,
2094
+ "aria-label": g("bundle.a11y.remove_from_bundle", { name: f.displayName }),
2095
+ onClick: (q) => {
2096
+ q.stopPropagation(), $(f.id, 0);
1944
2097
  },
1945
- onKeyDown: (L) => {
1946
- L.stopPropagation();
2098
+ onKeyDown: (q) => {
2099
+ q.stopPropagation();
1947
2100
  },
1948
- children: /* @__PURE__ */ c(yn, { size: 14 })
2101
+ children: /* @__PURE__ */ l(Ln, { size: 14 })
1949
2102
  }
1950
2103
  ) : null,
1951
- /* @__PURE__ */ c(
2104
+ /* @__PURE__ */ l(
1952
2105
  "div",
1953
2106
  {
1954
- className: [b.qtyChip, H ? b.qtyChipInteractive : null].filter(Boolean).join(" "),
1955
- "aria-label": `${h.displayName} quantity ${_}`,
1956
- onClick: H ? (L) => {
1957
- L.stopPropagation(), A(h.id, _ + 1);
2107
+ className: [_.qtyChip, Z ? _.qtyChipInteractive : null].filter(Boolean).join(" "),
2108
+ "aria-label": g("bundle.a11y.quantity", { name: f.displayName, qty: p }),
2109
+ onClick: Z ? (q) => {
2110
+ q.stopPropagation(), $(f.id, p + 1);
1958
2111
  } : void 0,
1959
- onKeyDown: (L) => {
1960
- L.stopPropagation();
2112
+ onKeyDown: (q) => {
2113
+ q.stopPropagation();
1961
2114
  },
1962
- role: H ? "button" : void 0,
1963
- tabIndex: H ? 0 : void 0,
1964
- children: _ <= 0 ? /* @__PURE__ */ c("span", { className: b.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ c(Oe, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ I(xe, { children: [
1965
- /* @__PURE__ */ c("span", { className: b.qtyChipValue, children: _ }),
1966
- /* @__PURE__ */ c(
2115
+ role: Z ? "button" : void 0,
2116
+ tabIndex: Z ? 0 : void 0,
2117
+ children: p <= 0 ? /* @__PURE__ */ l("span", { className: _.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ l(Vt, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ R(kt, { children: [
2118
+ /* @__PURE__ */ l("span", { className: _.qtyChipValue, children: p }),
2119
+ /* @__PURE__ */ l(
1967
2120
  "button",
1968
2121
  {
1969
2122
  type: "button",
1970
- className: b.qtyChipClear,
1971
- "aria-label": `Add ${h.displayName}`,
1972
- onClick: (L) => {
1973
- L.stopPropagation(), A(h.id, _ + 1);
2123
+ className: _.qtyChipClear,
2124
+ "aria-label": g("bundle.a11y.increase", { name: f.displayName }),
2125
+ onClick: (q) => {
2126
+ q.stopPropagation(), $(f.id, p + 1);
1974
2127
  },
1975
- onKeyDown: (L) => {
1976
- L.stopPropagation();
2128
+ onKeyDown: (q) => {
2129
+ q.stopPropagation();
1977
2130
  },
1978
- disabled: !H,
1979
- children: /* @__PURE__ */ c(Oe, { size: 12, strokeWidth: 2 })
2131
+ disabled: !Z,
2132
+ children: /* @__PURE__ */ l(Vt, { size: 12, strokeWidth: 2 })
1980
2133
  }
1981
2134
  )
1982
2135
  ] })
1983
2136
  }
1984
2137
  )
1985
2138
  ] }),
1986
- W ? /* @__PURE__ */ c("div", { className: b.stockLimitNotice, children: W }) : null
2139
+ Q ? /* @__PURE__ */ l("div", { className: _.stockLimitNotice, children: Q }) : null
1987
2140
  ] }) })
1988
2141
  ] })
1989
2142
  ] })
1990
2143
  ]
1991
2144
  },
1992
- h.id
2145
+ f.id
1993
2146
  );
1994
2147
  }) }) })
1995
2148
  ] }) : null,
1996
- /* @__PURE__ */ I("footer", { className: b.footer, children: [
1997
- /* @__PURE__ */ c("div", { className: b.boxSummaryWindow, ref: jt, children: /* @__PURE__ */ c("div", { className: b.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Wt }).map((h, _) => {
1998
- var W, Q, L, Ut;
1999
- const w = Ct[_], B = It.get(_), R = !!w, E = !!B, $ = E && !R, H = B ? `${B.discountPercent}% off` : null, M = R ? w.displayName : `Slot ${_ + 1}`;
2000
- return /* @__PURE__ */ I("div", { "data-box-slot": _, className: b.boxSlot, children: [
2001
- /* @__PURE__ */ c(
2149
+ /* @__PURE__ */ R("footer", { className: _.footer, children: [
2150
+ /* @__PURE__ */ l("div", { className: _.boxSummaryWindow, ref: Ye, children: /* @__PURE__ */ l("div", { className: _.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ze }).map((f, p) => {
2151
+ var Q, A, q, Se;
2152
+ const x = Le[p], T = Ie.get(p), M = !!x, E = !!T, V = E && !M, Z = T ? g("bundle.discount.off_label", { discount: ke(T.discountPercent) }) : null, ee = M ? x.displayName : g("bundle.slot", { slot: p + 1 });
2153
+ return /* @__PURE__ */ R("div", { "data-box-slot": p, className: _.boxSlot, children: [
2154
+ /* @__PURE__ */ l(
2002
2155
  "div",
2003
2156
  {
2004
2157
  className: [
2005
- b.boxItem,
2006
- R ? b.boxItemFilled : b.boxItemPlaceholder,
2007
- E ? b.boxItemThreshold : null,
2008
- R ? b.boxItemClickable : null
2158
+ _.boxItem,
2159
+ M ? _.boxItemFilled : _.boxItemPlaceholder,
2160
+ E ? _.boxItemThreshold : null,
2161
+ M ? _.boxItemClickable : null
2009
2162
  ].filter(Boolean).join(" "),
2010
- role: R ? "button" : void 0,
2011
- tabIndex: R ? 0 : void 0,
2012
- onClick: R ? () => Lt(w.id) : void 0,
2013
- onKeyDown: R ? (mt) => {
2014
- (mt.key === "Enter" || mt.key === " ") && (mt.preventDefault(), Lt(w.id));
2163
+ role: M ? "button" : void 0,
2164
+ tabIndex: M ? 0 : void 0,
2165
+ onClick: M ? () => De(x.id) : void 0,
2166
+ onKeyDown: M ? (Pe) => {
2167
+ (Pe.key === "Enter" || Pe.key === " ") && (Pe.preventDefault(), De(x.id));
2015
2168
  } : void 0,
2016
- "aria-label": $ && H ? `${M}. Unlocks ${H}.` : M,
2017
- title: $ && H ? `${M} • Unlocks ${H}` : M,
2018
- children: R ? (W = w.image) != null && W.url ? /* @__PURE__ */ c(
2169
+ "aria-label": V && Z ? `${ee}. ${g("bundle.unlocks", { discount: Z })}.` : ee,
2170
+ title: V && Z ? `${ee} • ${g("bundle.unlocks", { discount: Z })}` : ee,
2171
+ children: M ? (Q = x.image) != null && Q.url ? /* @__PURE__ */ l(
2019
2172
  "img",
2020
2173
  {
2021
- className: b.boxItemImage,
2022
- src: w.image.url,
2023
- alt: w.image.altText ?? w.displayName,
2174
+ className: _.boxItemImage,
2175
+ src: x.image.url,
2176
+ alt: x.image.altText ?? x.displayName,
2024
2177
  width: 1,
2025
2178
  height: 1,
2026
2179
  loading: "lazy"
2027
2180
  }
2028
- ) : /* @__PURE__ */ c("div", { className: b.boxItemFallback, "aria-hidden": "true", children: ((Ut = (L = (Q = w.product) == null ? void 0 : Q.title) == null ? void 0 : L.slice(0, 1)) == null ? void 0 : Ut.toUpperCase()) ?? "•" }) : $ && H ? /* @__PURE__ */ c("div", { className: b.boxItemDiscountText, children: H }) : /* @__PURE__ */ c("div", { className: b.boxItemPlus, "aria-hidden": "true", children: "+" })
2181
+ ) : /* @__PURE__ */ l("div", { className: _.boxItemFallback, "aria-hidden": "true", children: ((Se = (q = (A = x.product) == null ? void 0 : A.title) == null ? void 0 : q.slice(0, 1)) == null ? void 0 : Se.toUpperCase()) ?? "•" }) : V && Z ? /* @__PURE__ */ l("div", { className: _.boxItemDiscountText, children: Z }) : /* @__PURE__ */ l("div", { className: _.boxItemPlus, "aria-hidden": "true", children: "+" })
2029
2182
  }
2030
2183
  ),
2031
- E ? /* @__PURE__ */ c("div", { className: b.boxThresholdLabel, children: B.label }) : null
2032
- ] }, _);
2184
+ E ? /* @__PURE__ */ l("div", { className: _.boxThresholdLabel, children: T.label }) : null
2185
+ ] }, p);
2033
2186
  }) }) }),
2034
- /* @__PURE__ */ c("div", { className: [b.totalsReveal, Nt ? b.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ c(
2187
+ /* @__PURE__ */ l("div", { className: [_.totalsReveal, Ce ? _.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ l(
2035
2188
  "div",
2036
2189
  {
2037
- className: [b.ctaTotalsWrap, Nt ? b.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
2038
- "aria-hidden": !Nt,
2039
- children: /* @__PURE__ */ I("div", { className: b.ctaTotals, "aria-label": "Totals", children: [
2040
- dt ? /* @__PURE__ */ I("span", { className: b.ctaDiscountBadge, children: [
2041
- dt,
2042
- "% Discount"
2043
- ] }) : /* @__PURE__ */ c("span", {}),
2044
- /* @__PURE__ */ c("span", { children: dt ? /* @__PURE__ */ I(xe, { children: [
2045
- /* @__PURE__ */ c("span", { className: b.ctaTotalsStrike, children: gt(ht.toFixed(2)) }),
2190
+ className: [_.ctaTotalsWrap, Ce ? _.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
2191
+ "aria-hidden": !Ce,
2192
+ children: /* @__PURE__ */ R("div", { className: _.ctaTotals, "aria-label": g("bundle.totals"), children: [
2193
+ Re ? /* @__PURE__ */ l("span", { className: _.ctaDiscountBadge, children: g("bundle.discount.badge", { discount: Re }) }) : /* @__PURE__ */ l("span", {}),
2194
+ /* @__PURE__ */ l("span", { children: Re ? /* @__PURE__ */ R(kt, { children: [
2195
+ /* @__PURE__ */ l("span", { className: _.ctaTotalsStrike, children: ye(be.toFixed(2)) }),
2046
2196
  " ",
2047
- /* @__PURE__ */ c("span", { className: b.ctaTotalsPrice, children: gt(zt.toFixed(2)) })
2048
- ] }) : /* @__PURE__ */ c("span", { className: b.ctaTotalsPrice, children: gt(ht.toFixed(2)) }) })
2197
+ /* @__PURE__ */ l("span", { className: _.ctaTotalsPrice, children: ye(Ve.toFixed(2)) })
2198
+ ] }) : /* @__PURE__ */ l("span", { className: _.ctaTotalsPrice, children: ye(be.toFixed(2)) }) })
2049
2199
  ] })
2050
2200
  }
2051
2201
  ) }),
2052
2202
  (() => {
2053
- const h = (r == null ? void 0 : r.ctaButtonMode) || "add_to_cart";
2054
- return h === "add_to_cart_checkout" ? ut > 0 ? /* @__PURE__ */ c("button", { type: "button", onClick: Y, disabled: !C, className: b.cta, children: e ? "Adding…" : `Add ${ut} more product${ut === 1 ? "" : "s"}` }) : /* @__PURE__ */ I("div", { className: b.ctaButtonGroup, children: [
2055
- /* @__PURE__ */ c("button", { type: "button", onClick: Y, disabled: !C, className: b.ctaDualLeft, children: /* @__PURE__ */ c("span", { children: e ? "Adding…" : "Add to Basket" }) }),
2056
- /* @__PURE__ */ c("button", { type: "button", onClick: X, disabled: !C, className: b.ctaDualRight, children: /* @__PURE__ */ c("span", { children: e ? "Processing…" : "Checkout" }) })
2057
- ] }) : h === "checkout" ? /* @__PURE__ */ c("button", { type: "button", onClick: X, disabled: !C, className: b.cta, children: e ? "Processing…" : ut > 0 ? `Add ${ut} more product${ut === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ c("button", { type: "button", onClick: Y, disabled: !C, className: b.cta, children: e ? "Adding…" : ut > 0 ? `Add ${ut} more product${ut === 1 ? "" : "s"}` : "Add to Basket" });
2203
+ const f = (r == null ? void 0 : r.ctaButtonMode) || "add_to_cart";
2204
+ return f === "add_to_cart_checkout" ? ie > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: te, disabled: !F, className: _.cta, children: t ? g("bundle.cta.adding") : g("bundle.cta.add_more", { count: ie, productWord: ct(K, ie) }) }) : /* @__PURE__ */ R("div", { className: _.ctaButtonGroup, children: [
2205
+ /* @__PURE__ */ l("button", { type: "button", onClick: te, disabled: !F, className: _.ctaDualLeft, children: /* @__PURE__ */ l("span", { children: g(t ? "bundle.cta.adding" : "bundle.cta.add_to_basket") }) }),
2206
+ /* @__PURE__ */ l("button", { type: "button", onClick: W, disabled: !F, className: _.ctaDualRight, children: /* @__PURE__ */ l("span", { children: g(t ? "bundle.cta.processing" : "bundle.cta.checkout") }) })
2207
+ ] }) : f === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: W, disabled: !F, className: _.cta, children: t ? g("bundle.cta.processing") : ie > 0 ? g("bundle.cta.add_more", { count: ie, productWord: ct(K, ie) }) : g("bundle.cta.checkout") }) : /* @__PURE__ */ l("button", { type: "button", onClick: te, disabled: !F, className: _.cta, children: t ? g("bundle.cta.adding") : ie > 0 ? g("bundle.cta.add_more", { count: ie, productWord: ct(K, ie) }) : g("bundle.cta.add_to_basket") });
2058
2208
  })(),
2059
- /* @__PURE__ */ I("div", { className: b.poweredBy, children: [
2060
- "powered by",
2209
+ /* @__PURE__ */ R("div", { className: _.poweredBy, children: [
2210
+ g("bundle.powered_by"),
2061
2211
  " ",
2062
- /* @__PURE__ */ c("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
2212
+ /* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
2063
2213
  ] })
2064
2214
  ] })
2065
2215
  ] });
2066
2216
  }
2067
- function ve(a) {
2068
- if (a != null && a.length)
2069
- return a.reduce((t, e) => (e != null && e.key && (t[e.key] = e.value ?? ""), t), {});
2217
+ function Bt(n) {
2218
+ if (n != null && n.length)
2219
+ return n.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
2070
2220
  }
2071
- function Ae(a) {
2072
- const t = /\/(\d+)$/.exec(a);
2073
- return t ? t[1] : a;
2221
+ function zt(n) {
2222
+ const e = /\/(\d+)$/.exec(n);
2223
+ return e ? e[1] : n;
2074
2224
  }
2075
- function Za(a) {
2076
- if (a == null) return null;
2077
- const t = String(a).trim();
2078
- return t ? t.startsWith("gid://shopify/ProductVariant/") ? t : `gid://shopify/ProductVariant/${t}` : null;
2225
+ function hi(n) {
2226
+ if (n == null) return null;
2227
+ const e = String(n).trim();
2228
+ return e ? e.startsWith("gid://shopify/ProductVariant/") ? e : `gid://shopify/ProductVariant/${e}` : null;
2079
2229
  }
2080
- function ti() {
2081
- var a;
2082
- return typeof window > "u" ? null : ((a = window.Shopify) == null ? void 0 : a.theme) ?? null;
2230
+ function mi() {
2231
+ var n;
2232
+ return typeof window > "u" ? null : ((n = window.Shopify) == null ? void 0 : n.theme) ?? null;
2083
2233
  }
2084
- function ei() {
2085
- const a = ti();
2086
- return a ? a.schema_name === "Sleek" ? !0 : /sleek/i.test(a.name ?? "") : !1;
2234
+ function bi() {
2235
+ const n = mi();
2236
+ return n ? n.schema_name === "Sleek" ? !0 : /sleek/i.test(n.name ?? "") : !1;
2087
2237
  }
2088
- function ni() {
2238
+ function fi() {
2089
2239
  return typeof document > "u" ? !1 : !!document.querySelector("cart-drawer");
2090
2240
  }
2091
- function ri() {
2092
- return !ei() || !ni() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2241
+ function _i() {
2242
+ return !bi() || !fi() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2093
2243
  bubbles: !0,
2094
2244
  detail: { open: !0 }
2095
2245
  })), !0);
2096
2246
  }
2097
- function ai() {
2247
+ function pi() {
2098
2248
  window.location.reload();
2099
2249
  }
2100
- async function he(a, t) {
2101
- const e = await fetch(a, {
2250
+ async function yt(n, e) {
2251
+ const t = await fetch(n, {
2102
2252
  method: "POST",
2103
2253
  headers: {
2104
2254
  Accept: "application/json",
2105
2255
  "Content-Type": "application/json"
2106
2256
  },
2107
- body: JSON.stringify(t)
2257
+ body: JSON.stringify(e)
2108
2258
  });
2109
- if (!e.ok) {
2110
- const o = await e.text().catch(() => "");
2111
- throw new Error(o || `Cart request failed: ${e.status}`);
2259
+ if (!t.ok) {
2260
+ const a = await t.text().catch(() => "");
2261
+ throw new Error(a || `Cart request failed: ${t.status}`);
2112
2262
  }
2113
- return e.json().catch(() => null);
2263
+ return t.json().catch(() => null);
2114
2264
  }
2115
- async function ii() {
2116
- const a = await fetch("/cart.js", {
2265
+ async function yi() {
2266
+ const n = await fetch("/cart.js", {
2117
2267
  method: "GET",
2118
2268
  cache: "no-store",
2119
2269
  headers: {
@@ -2121,52 +2271,52 @@ async function ii() {
2121
2271
  "Content-Type": "application/json"
2122
2272
  }
2123
2273
  });
2124
- if (!a.ok)
2125
- throw new Error(`Cart request failed: ${a.status}`);
2126
- return a.json();
2274
+ if (!n.ok)
2275
+ throw new Error(`Cart request failed: ${n.status}`);
2276
+ return n.json();
2127
2277
  }
2128
- function mi() {
2278
+ function Si() {
2129
2279
  return {
2130
- async linesAdd(a) {
2131
- const t = a.map((e) => ({
2132
- id: Ae(e.merchandiseId),
2133
- quantity: e.quantity,
2134
- properties: ve(e.attributes)
2280
+ async linesAdd(n) {
2281
+ const e = n.map((t) => ({
2282
+ id: zt(t.merchandiseId),
2283
+ quantity: t.quantity,
2284
+ properties: Bt(t.attributes)
2135
2285
  }));
2136
- await he("/cart/add.js", { items: t });
2286
+ await yt("/cart/add.js", { items: e });
2137
2287
  },
2138
- async linesAddForCheckout(a) {
2139
- const t = a.map((e) => ({
2140
- id: Ae(e.merchandiseId),
2141
- quantity: e.quantity,
2142
- properties: ve(e.attributes)
2288
+ async linesAddForCheckout(n) {
2289
+ const e = n.map((t) => ({
2290
+ id: zt(t.merchandiseId),
2291
+ quantity: t.quantity,
2292
+ properties: Bt(t.attributes)
2143
2293
  }));
2144
- await he("/cart/add.js", { items: t });
2294
+ await yt("/cart/add.js", { items: e });
2145
2295
  },
2146
- async linesUpdate(a) {
2147
- for (const t of a)
2148
- await he("/cart/change.js", {
2149
- id: t.id,
2150
- quantity: t.quantity,
2151
- properties: ve(t.attributes)
2296
+ async linesUpdate(n) {
2297
+ for (const e of n)
2298
+ await yt("/cart/change.js", {
2299
+ id: e.id,
2300
+ quantity: e.quantity,
2301
+ properties: Bt(e.attributes)
2152
2302
  });
2153
2303
  },
2154
- async linesRemove(a) {
2155
- for (const t of a)
2156
- await he("/cart/change.js", { id: t, quantity: 0 });
2304
+ async linesRemove(n) {
2305
+ for (const e of n)
2306
+ await yt("/cart/change.js", { id: e, quantity: 0 });
2157
2307
  },
2158
2308
  async getLineQuantitiesByMerchandiseId() {
2159
- const a = await ii(), t = {};
2160
- for (const e of a.items ?? []) {
2161
- const o = Za(e.id);
2162
- if (!o) continue;
2163
- const i = Number(e.quantity ?? 0);
2164
- !Number.isFinite(i) || i <= 0 || (t[o] = (t[o] ?? 0) + Math.floor(i));
2309
+ const n = await yi(), e = {};
2310
+ for (const t of n.items ?? []) {
2311
+ const a = hi(t.id);
2312
+ if (!a) continue;
2313
+ const i = Number(t.quantity ?? 0);
2314
+ !Number.isFinite(i) || i <= 0 || (e[a] = (e[a] ?? 0) + Math.floor(i));
2165
2315
  }
2166
- return t;
2316
+ return e;
2167
2317
  },
2168
2318
  openCartUI() {
2169
- ri() || window.setTimeout(() => ai(), 0);
2319
+ _i() || window.setTimeout(() => pi(), 0);
2170
2320
  },
2171
2321
  navigateToCheckout() {
2172
2322
  window.location.href = "/checkout";
@@ -2174,13 +2324,13 @@ function mi() {
2174
2324
  };
2175
2325
  }
2176
2326
  export {
2177
- di as BundleBuilderDrawer,
2178
- hi as BundleBuilderPanel,
2179
- ui as BundleButton,
2180
- ue as BundleLineAttributeKeys,
2181
- ci as BundleProvider,
2182
- mi as createLiquidCartAdapter,
2183
- be as useBundleBuilder,
2184
- li as useBundleBuilderDrawer
2327
+ Ii as BundleBuilderDrawer,
2328
+ Ni as BundleBuilderPanel,
2329
+ Ci as BundleButton,
2330
+ _t as BundleLineAttributeKeys,
2331
+ wi as BundleProvider,
2332
+ Si as createLiquidCartAdapter,
2333
+ wt as useBundleBuilder,
2334
+ xi as useBundleBuilderDrawer
2185
2335
  };
2186
2336
  //# sourceMappingURL=index.js.map